[debian-edu-commits] debian-edu/ 02/21: Packaging style: Stop shipping upstream files in Debian packaging Git. Superfluous overhead.

Mike Gabriel sunweaver at debian.org
Mon Nov 28 12:58:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository italc.

commit e38af00fc6cc34028eb5046eb30fb943fce1b2e2
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Nov 28 11:48:34 2016 +0100

    Packaging style: Stop shipping upstream files in Debian packaging Git. Superfluous overhead.
---
 AUTHORS                                            |     9 -
 CMakeLists.txt                                     |   351 -
 COPYING                                            |   352 -
 ChangeLog                                          |  4275 -----
 INSTALL                                            |   172 -
 README                                             |    75 -
 README.LZO                                         |   124 -
 TODO                                               |    36 -
 build_mingw32                                      |     6 -
 build_mingw64                                      |     6 -
 cmake/modules/DetectMachine.cmake                  |    40 -
 cmake/modules/FindPAM.cmake                        |    74 -
 cmake/modules/MinGWCrossCompile.cmake              |    35 -
 cmake/modules/Qt4Hacks.cmake                       |    44 -
 cmake/modules/Win32Toolchain.cmake                 |     6 -
 cmake/modules/Win64Toolchain.cmake                 |    10 -
 contrib/README.txt                                 |    28 -
 contrib/en-US/italc.adml                           |   198 -
 contrib/italc.admx                                 |   327 -
 doc/AutomatedSetupWithIMC.txt                      |    52 -
 doc/ControllingIMCAtTheCommandline.txt             |    70 -
 doc/CrossCompilingForWindows.txt                   |    40 -
 doc/UsingPathVariables.txt                         |    30 -
 iTALC.nsi.in                                       |   305 -
 ica/CMakeLists.txt                                 |   187 -
 ica/JavaViewer/AuthPanel.java                      |   166 -
 ica/JavaViewer/ButtonPanel.java                    |   172 -
 ica/JavaViewer/ChangeLog                           |    44 -
 ica/JavaViewer/ClipboardFrame.java                 |   133 -
 ica/JavaViewer/DH.java                             |   182 -
 ica/JavaViewer/DesCipher.java                      |   524 -
 ica/JavaViewer/FTPFrame.java                       |  1344 --
 ica/JavaViewer/LICENCE.TXT                         |   340 -
 ica/JavaViewer/MANIFEST.MF                         |     3 -
 ica/JavaViewer/OptionsFrame.java                   |   398 -
 ica/JavaViewer/README                              |   444 -
 ica/JavaViewer/RecordingFrame.java                 |   309 -
 ica/JavaViewer/RfbProto.java                       |  1935 --
 ica/JavaViewer/SessionRecorder.java                |   193 -
 ica/JavaViewer/VncCanvas.java                      |  1698 --
 ica/JavaViewer/VncViewer.java                      |   994 -
 ica/JavaViewer/dir.mk                              |    20 -
 ica/JavaViewer/hextile.vnc                         |    19 -
 ica/JavaViewer/index.vnc                           |    16 -
 ica/JavaViewer/mk.bat                              |     2 -
 ica/JavaViewer/noshared.vnc                        |    17 -
 ica/JavaViewer/run.bat                             |     1 -
 ica/JavaViewer/runapplet.bat                       |     2 -
 ica/JavaViewer/shared.vnc                          |    17 -
 ica/JavaViewer/tight.vnc                           |    18 -
 ica/JavaViewer/zlib.vnc                            |    18 -
 ica/helpers/CMakeLists.txt                         |     4 -
 ica/helpers/ItalcAuthHelper.cpp                    |    78 -
 ica/ica.1                                          |   101 -
 ica/ica.qrc                                        |     4 -
 ica/ica.rc                                         |    35 -
 ica/ica.rc.in                                      |    35 -
 ica/src/AccessDialogSlave.cpp                      |   123 -
 ica/src/AccessDialogSlave.h                        |    51 -
 ica/src/DemoClient.cpp                             |   117 -
 ica/src/DemoClient.h                               |    54 -
 ica/src/DemoClientSlave.cpp                        |    57 -
 ica/src/DemoClientSlave.h                          |    53 -
 ica/src/DemoServer.cpp                             |   721 -
 ica/src/DemoServer.h                               |   149 -
 ica/src/DemoServerMaster.cpp                       |    75 -
 ica/src/DemoServerMaster.h                         |    69 -
 ica/src/DemoServerSlave.cpp                        |   132 -
 ica/src/DemoServerSlave.h                          |    52 -
 ica/src/DesktopAccessPermission.cpp                |    93 -
 ica/src/DesktopAccessPermission.h                  |    62 -
 ica/src/IcaMain.cpp                                |   327 -
 ica/src/IcaSlave.h                                 |    46 -
 ica/src/InputLockSlave.cpp                         |    51 -
 ica/src/InputLockSlave.h                           |    53 -
 ica/src/ItalcCoreServer.cpp                        |   461 -
 ica/src/ItalcCoreServer.h                          |    86 -
 ica/src/ItalcSlaveManager.cpp                      |   292 -
 ica/src/ItalcSlaveManager.h                        |   129 -
 ica/src/ItalcVncServer.cpp                         |   363 -
 ica/src/ItalcVncServer.h                           |    53 -
 ica/src/LocalSystemIca.cpp                         |   193 -
 ica/src/MessageBoxSlave.cpp                        |    56 -
 ica/src/MessageBoxSlave.h                          |    50 -
 ica/src/RfbItalcCursor.cpp                         |    71 -
 ica/src/RfbItalcCursor.h                           |    41 -
 ica/src/RfbLZORLE.cpp                              |   188 -
 ica/src/RfbLZORLE.h                                |    50 -
 ica/src/ScreenLockSlave.cpp                        |    51 -
 ica/src/ScreenLockSlave.h                          |    53 -
 ica/src/ScreenLockSlaveLauncher.cpp                |   129 -
 ica/src/ScreenLockSlaveLauncher.h                  |    63 -
 ica/src/SystemTrayIconSlave.cpp                    |    69 -
 ica/src/SystemTrayIconSlave.h                      |    54 -
 ica/src/WindowsService.cpp                         |   826 -
 ica/src/WindowsService.h                           |   125 -
 ica/src/moc_AccessDialogSlave.cxx_parameters       |    22 -
 ica/src/moc_DemoClient.cxx_parameters              |    22 -
 ica/src/moc_DemoClientSlave.cxx_parameters         |    22 -
 ica/src/moc_DemoServer.cxx_parameters              |    22 -
 ica/src/moc_DemoServerMaster.cxx_parameters        |    22 -
 ica/src/moc_DemoServerSlave.cxx_parameters         |    22 -
 ica/src/moc_DesktopAccessPermission.cxx_parameters |    22 -
 ica/src/moc_IcaSlave.cxx_parameters                |    22 -
 ica/src/moc_InputLockSlave.cxx_parameters          |    22 -
 ica/src/moc_ItalcCoreServer.cxx_parameters         |    22 -
 ica/src/moc_ItalcSlaveManager.cxx_parameters       |    22 -
 ica/src/moc_ItalcVncServer.cxx_parameters          |    22 -
 ica/src/moc_MessageBoxSlave.cxx_parameters         |    22 -
 ica/src/moc_RfbItalcCursor.cxx_parameters          |    22 -
 ica/src/moc_RfbLZORLE.cxx_parameters               |    22 -
 ica/src/moc_ScreenLockSlave.cxx_parameters         |    22 -
 ica/src/moc_ScreenLockSlaveLauncher.cxx_parameters |    22 -
 ica/src/moc_SystemTrayIconSlave.cxx_parameters     |    22 -
 ica/src/moc_WindowsService.cxx_parameters          |    22 -
 ica/x11/AUTHORS                                    |    43 -
 ica/x11/ChangeLog                                  |  7760 --------
 ica/x11/README                                     |   439 -
 ica/x11/common/d3des.c                             |   436 -
 ica/x11/common/d3des.h                             |    56 -
 ica/x11/common/lzoconf.h                           |   446 -
 ica/x11/common/lzodefs.h                           |  1852 --
 ica/x11/common/md5.c                               |   452 -
 ica/x11/common/md5.h                               |   148 -
 ica/x11/common/minilzo.c                           |  4579 -----
 ica/x11/common/minilzo.h                           |   109 -
 ica/x11/common/turbojpeg.c                         |   854 -
 ica/x11/common/turbojpeg.h                         |   529 -
 ica/x11/common/vncauth.c                           |   212 -
 ica/x11/common/zywrletemplate.c                    |   828 -
 ica/x11/libvncclient/corre.c                       |    70 -
 ica/x11/libvncclient/cursor.c                      |   179 -
 ica/x11/libvncclient/h264.c                        |   644 -
 ica/x11/libvncclient/hextile.c                     |   127 -
 ica/x11/libvncclient/listen.c                      |   227 -
 ica/x11/libvncclient/rfbproto.c                    |  2450 ---
 ica/x11/libvncclient/rre.c                         |    68 -
 ica/x11/libvncclient/sockets.c                     |   822 -
 ica/x11/libvncclient/tight.c                       |   688 -
 ica/x11/libvncclient/tls.h                         |    51 -
 ica/x11/libvncclient/tls_gnutls.c                  |   505 -
 ica/x11/libvncclient/tls_none.c                    |    58 -
 ica/x11/libvncclient/tls_openssl.c                 |   587 -
 ica/x11/libvncclient/ultra.c                       |   210 -
 ica/x11/libvncclient/vncviewer.c                   |   392 -
 ica/x11/libvncclient/zlib.c                        |   162 -
 ica/x11/libvncclient/zrle.c                        |   427 -
 ica/x11/libvncserver/auth.c                        |   416 -
 ica/x11/libvncserver/cargs.c                       |   261 -
 ica/x11/libvncserver/corre.c                       |   342 -
 ica/x11/libvncserver/cursor.c                      |   756 -
 ica/x11/libvncserver/cutpaste.c                    |    38 -
 ica/x11/libvncserver/draw.c                        |    61 -
 ica/x11/libvncserver/font.c                        |   196 -
 ica/x11/libvncserver/hextile.c                     |   342 -
 ica/x11/libvncserver/httpd.c                       |   650 -
 ica/x11/libvncserver/main.c                        |  1197 --
 ica/x11/libvncserver/private.h                     |    35 -
 ica/x11/libvncserver/rfbcrypto.h                   |    12 -
 ica/x11/libvncserver/rfbcrypto_gnutls.c            |    50 -
 ica/x11/libvncserver/rfbcrypto_included.c          |    49 -
 ica/x11/libvncserver/rfbcrypto_openssl.c           |    49 -
 ica/x11/libvncserver/rfbcrypto_polarssl.c          |    26 -
 ica/x11/libvncserver/rfbregion.c                   |   886 -
 ica/x11/libvncserver/rfbserver.c                   |  3457 ----
 ica/x11/libvncserver/rfbssl.h                      |    15 -
 ica/x11/libvncserver/rfbssl_gnutls.c               |   268 -
 ica/x11/libvncserver/rfbssl_none.c                 |    58 -
 ica/x11/libvncserver/rfbssl_openssl.c              |   135 -
 ica/x11/libvncserver/rre.c                         |   309 -
 ica/x11/libvncserver/scale.c                       |   416 -
 ica/x11/libvncserver/scale.h                       |    10 -
 ica/x11/libvncserver/selbox.c                      |   300 -
 ica/x11/libvncserver/sockets.c                     |  1071 --
 ica/x11/libvncserver/stats.c                       |   479 -
 ica/x11/libvncserver/tableinit24.c                 |   157 -
 ica/x11/libvncserver/tableinitcmtemplate.c         |    84 -
 ica/x11/libvncserver/tableinittctemplate.c         |   142 -
 ica/x11/libvncserver/tabletrans24template.c        |   281 -
 ica/x11/libvncserver/tabletranstemplate.c          |   117 -
 ica/x11/libvncserver/tight.c                       |  1900 --
 ica/x11/libvncserver/translate.c                   |   477 -
 ica/x11/libvncserver/ultra.c                       |   231 -
 ica/x11/libvncserver/websockets.c                  |   904 -
 ica/x11/libvncserver/zlib.c                        |   331 -
 ica/x11/libvncserver/zrle.c                        |   257 -
 ica/x11/libvncserver/zrleencodetemplate.c          |   316 -
 ica/x11/libvncserver/zrleoutstream.c               |   275 -
 ica/x11/libvncserver/zrleoutstream.h               |    62 -
 ica/x11/libvncserver/zrlepalettehelper.c           |    62 -
 ica/x11/libvncserver/zrlepalettehelper.h           |    46 -
 ica/x11/libvncserver/zrletypes.h                   |    30 -
 ica/x11/rfb/default8x16.h                          |   266 -
 ica/x11/rfb/rfbregion.h                            |    65 -
 ica/x11/x11vnc.c                                   |    95 -
 ica/x11/x11vnc/8to24.c                             |  2155 ---
 ica/x11/x11vnc/8to24.h                             |    45 -
 ica/x11/x11vnc/ChangeLog                           |  1257 --
 ica/x11/x11vnc/README                              | 18246 -------------------
 ica/x11/x11vnc/RELEASE-NOTES                       |  1553 --
 ica/x11/x11vnc/allowed_input_t.h                   |    46 -
 ica/x11/x11vnc/appshare.c                          |  2124 ---
 ica/x11/x11vnc/avahi.c                             |   434 -
 ica/x11/x11vnc/avahi.h                             |    43 -
 ica/x11/x11vnc/blackout_t.h                        |    49 -
 ica/x11/x11vnc/cleanup.c                           |   770 -
 ica/x11/x11vnc/cleanup.h                           |    59 -
 ica/x11/x11vnc/connections.c                       |  4455 -----
 ica/x11/x11vnc/connections.h                       |    83 -
 ica/x11/x11vnc/cursor.c                            |  2025 --
 ica/x11/x11vnc/cursor.h                            |    70 -
 ica/x11/x11vnc/enc.h                               |  2166 ---
 ica/x11/x11vnc/enums.h                             |    54 -
 ica/x11/x11vnc/gui.c                               |   937 -
 ica/x11/x11vnc/gui.h                               |    53 -
 ica/x11/x11vnc/help.c                              |  6441 -------
 ica/x11/x11vnc/help.h                              |    43 -
 ica/x11/x11vnc/inet.c                              |   935 -
 ica/x11/x11vnc/inet.h                              |    60 -
 ica/x11/x11vnc/keyboard.c                          |  3418 ----
 ica/x11/x11vnc/keyboard.h                          |    62 -
 ica/x11/x11vnc/linuxfb.c                           |   394 -
 ica/x11/x11vnc/linuxfb.h                           |    42 -
 ica/x11/x11vnc/macosx.c                            |   752 -
 ica/x11/x11vnc/macosx.h                            |    63 -
 ica/x11/x11vnc/macosxCG.c                          |   989 -
 ica/x11/x11vnc/macosxCG.h                          |    62 -
 ica/x11/x11vnc/macosxCGP.c                         |   221 -
 ica/x11/x11vnc/macosxCGP.h                         |    49 -
 ica/x11/x11vnc/macosxCGS.c                         |   602 -
 ica/x11/x11vnc/macosxCGS.h                         |    45 -
 ica/x11/x11vnc/macosx_opengl.c                     |   176 -
 ica/x11/x11vnc/macosx_opengl.h                     |    41 -
 ica/x11/x11vnc/nox11.h                             |  6671 -------
 ica/x11/x11vnc/nox11_funcs.h                       |  2822 ---
 ica/x11/x11vnc/options.c                           |   514 -
 ica/x11/x11vnc/options.h                           |   404 -
 ica/x11/x11vnc/params.h                            |   103 -
 ica/x11/x11vnc/pm.c                                |   297 -
 ica/x11/x11vnc/pm.h                                |    40 -
 ica/x11/x11vnc/pointer.c                           |  1206 --
 ica/x11/x11vnc/pointer.h                           |    47 -
 ica/x11/x11vnc/rates.c                             |   732 -
 ica/x11/x11vnc/rates.h                             |    55 -
 ica/x11/x11vnc/remote.c                            |  6323 -------
 ica/x11/x11vnc/remote.h                            |    50 -
 ica/x11/x11vnc/scan.c                              |  3691 ----
 ica/x11/x11vnc/scan.h                              |    60 -
 ica/x11/x11vnc/screen.c                            |  4742 -----
 ica/x11/x11vnc/screen.h                            |    68 -
 ica/x11/x11vnc/scrollevent_t.h                     |    47 -
 ica/x11/x11vnc/selection.c                         |   548 -
 ica/x11/x11vnc/selection.h                         |    55 -
 ica/x11/x11vnc/solid.c                             |  1429 --
 ica/x11/x11vnc/solid.h                             |    47 -
 ica/x11/x11vnc/sslcmds.c                           |   916 -
 ica/x11/x11vnc/sslcmds.h                           |    49 -
 ica/x11/x11vnc/sslhelper.c                         |  4350 -----
 ica/x11/x11vnc/sslhelper.h                         |    73 -
 ica/x11/x11vnc/ssltools.h                          |  2560 ---
 ica/x11/x11vnc/tkx11vnc                            |  7335 --------
 ica/x11/x11vnc/tkx11vnc.h                          |  7351 --------
 ica/x11/x11vnc/uinput.c                            |  1876 --
 ica/x11/x11vnc/uinput.h                            |    59 -
 ica/x11/x11vnc/unixpw.c                            |  2281 ---
 ica/x11/x11vnc/unixpw.h                            |    64 -
 ica/x11/x11vnc/user.c                              |  3163 ----
 ica/x11/x11vnc/user.h                              |    49 -
 ica/x11/x11vnc/userinput.c                         | 10199 -----------
 ica/x11/x11vnc/userinput.h                         |    77 -
 ica/x11/x11vnc/util.c                              |   787 -
 ica/x11/x11vnc/util.h                              |   156 -
 ica/x11/x11vnc/v4l.c                               |  1785 --
 ica/x11/x11vnc/v4l.h                               |    42 -
 ica/x11/x11vnc/win_utils.c                         |   771 -
 ica/x11/x11vnc/win_utils.h                         |    59 -
 ica/x11/x11vnc/winattr_t.h                         |    66 -
 ica/x11/x11vnc/x11vnc.1                            |  6962 -------
 ica/x11/x11vnc/x11vnc.c                            |  5955 ------
 ica/x11/x11vnc/x11vnc.h                            |   708 -
 ica/x11/x11vnc/x11vnc_defs.c                       |   232 -
 ica/x11/x11vnc/xdamage.c                           |   840 -
 ica/x11/x11vnc/xdamage.h                           |    64 -
 ica/x11/x11vnc/xevents.c                           |  2175 ---
 ica/x11/x11vnc/xevents.h                           |    67 -
 ica/x11/x11vnc/xinerama.c                          |   556 -
 ica/x11/x11vnc/xinerama.h                          |    50 -
 ica/x11/x11vnc/xkb_bell.c                          |   167 -
 ica/x11/x11vnc/xkb_bell.h                          |    44 -
 ica/x11/x11vnc/xrandr.c                            |   306 -
 ica/x11/x11vnc/xrandr.h                            |    94 -
 ica/x11/x11vnc/xrecord.c                           |  2084 ---
 ica/x11/x11vnc/xrecord.h                           |    68 -
 ica/x11/x11vnc/xwrappers.c                         |  1522 --
 ica/x11/x11vnc/xwrappers.h                         |   121 -
 ima/CMakeLists.txt                                 |    31 -
 ima/data/italc.desktop.in                          |    12 -
 ima/data/italc.ico                                 |   Bin 109806 -> 0 bytes
 ima/data/italc.in                                  |     7 -
 ima/data/italc.png                                 |   Bin 10098 -> 0 bytes
 ima/data/italc.xpm                                 |  2690 ---
 ima/dialogs/ClientSettingsDialog.ui                |   250 -
 ima/dialogs/Config.ui                              |   735 -
 ima/dialogs/MainWindow.ui                          |    90 -
 ima/dialogs/Overview.ui                            |   214 -
 ima/dialogs/RemoteLogonDialog.ui                   |   188 -
 ima/dialogs/RunCommandsDialog.ui                   |   127 -
 ima/dialogs/Snapshots.ui                           |   156 -
 ima/dialogs/SupportDialog.ui                       |   136 -
 ima/dialogs/TextMessageDialog.ui                   |   127 -
 ima/italc.1                                        |    32 -
 ima/italc.qrc                                      |    66 -
 ima/italc.rc                                       |    26 -
 ima/italc.rc.in                                    |    26 -
 ima/resources/adjust_size.png                      |   Bin 16792 -> 0 bytes
 ima/resources/auto_arrange.png                     |   Bin 12589 -> 0 bytes
 ima/resources/back.png                             |   Bin 2522 -> 0 bytes
 ima/resources/cancel.png                           |   Bin 1333 -> 0 bytes
 ima/resources/classroom.png                        |   Bin 16185 -> 0 bytes
 ima/resources/classroom_add.png                    |   Bin 1377 -> 0 bytes
 ima/resources/classroom_manager.png                |   Bin 16232 -> 0 bytes
 ima/resources/classroom_manager_48.png             |   Bin 3693 -> 0 bytes
 ima/resources/classroom_remove.png                 |   Bin 1455 -> 0 bytes
 ima/resources/classroom_show.png                   |   Bin 1400 -> 0 bytes
 ima/resources/client.png                           |   Bin 5531 -> 0 bytes
 ima/resources/client_add.png                       |   Bin 4362 -> 0 bytes
 ima/resources/client_demo.png                      |   Bin 743 -> 0 bytes
 ima/resources/client_hidden.png                    |   Bin 523 -> 0 bytes
 ima/resources/client_remove.png                    |   Bin 4988 -> 0 bytes
 ima/resources/client_settings.png                  |   Bin 3411 -> 0 bytes
 ima/resources/client_show.png                      |   Bin 1017 -> 0 bytes
 ima/resources/client_visible.png                   |   Bin 575 -> 0 bytes
 ima/resources/clock.png                            |   Bin 1336 -> 0 bytes
 ima/resources/config.png                           |   Bin 20278 -> 0 bytes
 ima/resources/config_48.png                        |   Bin 4652 -> 0 bytes
 ima/resources/error.png                            |   Bin 9356 -> 0 bytes
 ima/resources/filesave.png                         |   Bin 2122 -> 0 bytes
 ima/resources/fullscreen.png                       |   Bin 1010 -> 0 bytes
 ima/resources/fullscreen_demo.png                  |   Bin 7703 -> 0 bytes
 ima/resources/greenled.png                         |   Bin 537 -> 0 bytes
 ima/resources/help.png                             |   Bin 15585 -> 0 bytes
 ima/resources/host_unreachable.png                 |   Bin 28165 -> 0 bytes
 ima/resources/info.png                             |   Bin 2742 -> 0 bytes
 ima/resources/info_22.png                          |   Bin 1145 -> 0 bytes
 ima/resources/locked.png                           |   Bin 33282 -> 0 bytes
 ima/resources/logout.png                           |   Bin 15860 -> 0 bytes
 ima/resources/network.png                          |   Bin 1506 -> 0 bytes
 ima/resources/no_mouse.png                         |   Bin 2617 -> 0 bytes
 ima/resources/no_user.png                          |   Bin 18927 -> 0 bytes
 ima/resources/overview.png                         |   Bin 14272 -> 0 bytes
 ima/resources/overview_mode.png                    |   Bin 15845 -> 0 bytes
 ima/resources/power_off.png                        |   Bin 11254 -> 0 bytes
 ima/resources/power_on.png                         |   Bin 21784 -> 0 bytes
 ima/resources/quit.png                             |   Bin 1760 -> 0 bytes
 ima/resources/reboot.png                           |   Bin 10726 -> 0 bytes
 ima/resources/remote_control.png                   |   Bin 17638 -> 0 bytes
 ima/resources/remote_control_48.png                |   Bin 4267 -> 0 bytes
 ima/resources/remotelogon.png                      |   Bin 10668 -> 0 bytes
 ima/resources/remotelogon_22.png                   |   Bin 1135 -> 0 bytes
 ima/resources/remotelogon_48.png                   |   Bin 3042 -> 0 bytes
 ima/resources/run.png                              |   Bin 3480 -> 0 bytes
 ima/resources/snapshot.png                         |   Bin 16667 -> 0 bytes
 ima/resources/snapshot_48.png                      |   Bin 3884 -> 0 bytes
 ima/resources/splash.png                           |   Bin 43105 -> 0 bytes
 ima/resources/stop.png                             |   Bin 4624 -> 0 bytes
 ima/resources/text_message.png                     |   Bin 13839 -> 0 bytes
 ima/resources/text_message_48.png                  |   Bin 3428 -> 0 bytes
 ima/resources/thinclient.png                       |   Bin 1178 -> 0 bytes
 ima/resources/toolbar-background.png               |   Bin 223 -> 0 bytes
 ima/resources/toolbar.png                          |   Bin 769 -> 0 bytes
 ima/resources/tray-menu-bg.png                     |   Bin 9427 -> 0 bytes
 ima/resources/userinterface.png                    |   Bin 3518 -> 0 bytes
 ima/resources/users.png                            |   Bin 11703 -> 0 bytes
 ima/resources/users_48.png                         |   Bin 3147 -> 0 bytes
 ima/resources/viewmag.png                          |   Bin 5090 -> 0 bytes
 ima/resources/window.png                           |   Bin 1010 -> 0 bytes
 ima/resources/window_demo.png                      |   Bin 8236 -> 0 bytes
 ima/src/ClassroomManager.cpp                       |  2187 ---
 ima/src/ClassroomManager.h                         |   347 -
 ima/src/Client.cpp                                 |  1205 --
 ima/src/Client.h                                   |   337 -
 ima/src/ConfigWidget.cpp                           |   183 -
 ima/src/ConfigWidget.h                             |    51 -
 ima/src/Dialogs.cpp                                |   245 -
 ima/src/Dialogs.h                                  |   152 -
 ima/src/MainToolBar.cpp                            |    94 -
 ima/src/MainToolBar.h                              |    49 -
 ima/src/MainWindow.cpp                             |   643 -
 ima/src/MainWindow.h                               |   220 -
 ima/src/OverviewWidget.cpp                         |    47 -
 ima/src/OverviewWidget.h                           |    42 -
 ima/src/RemoteControlWidget.cpp                    |   424 -
 ima/src/RemoteControlWidget.h                      |   123 -
 ima/src/RunCommandsDialog.cpp                      |    53 -
 ima/src/RunCommandsDialog.h                        |    48 -
 ima/src/SideBar.cpp                                |   287 -
 ima/src/SideBar.h                                  |    68 -
 ima/src/SideBarWidget.cpp                          |    99 -
 ima/src/SideBarWidget.h                            |    83 -
 ima/src/SnapshotList.cpp                           |   135 -
 ima/src/SnapshotList.h                             |    61 -
 ima/src/ToolButton.cpp                             |   446 -
 ima/src/ToolButton.h                               |   143 -
 ima/src/main.cpp                                   |   170 -
 ima/src/moc_ClassroomManager.cxx_parameters        |    22 -
 ima/src/moc_Client.cxx_parameters                  |    22 -
 ima/src/moc_ConfigWidget.cxx_parameters            |    22 -
 ima/src/moc_Dialogs.cxx_parameters                 |    22 -
 ima/src/moc_MainToolBar.cxx_parameters             |    22 -
 ima/src/moc_MainWindow.cxx_parameters              |    22 -
 ima/src/moc_OverviewWidget.cxx_parameters          |    22 -
 ima/src/moc_RemoteControlWidget.cxx_parameters     |    22 -
 ima/src/moc_RunCommandsDialog.cxx_parameters       |    22 -
 ima/src/moc_SideBar.cxx_parameters                 |    22 -
 ima/src/moc_SideBarWidget.cxx_parameters           |    22 -
 ima/src/moc_SnapshotList.cxx_parameters            |    22 -
 ima/src/moc_ToolButton.cxx_parameters              |    22 -
 imc/CMakeLists.txt                                 |    32 -
 imc/Forms/KeyFileAssistant.ui                      |   973 -
 imc/Forms/LogonGroupEditor.ui                      |   214 -
 imc/Forms/MainWindow.ui                            |  1633 --
 imc/Resources/Authentication.png                   |   Bin 2696 -> 0 bytes
 imc/Resources/General.png                          |   Bin 4042 -> 0 bytes
 imc/Resources/Paths.png                            |   Bin 1592 -> 0 bytes
 imc/Resources/Vnc.png                              |   Bin 4331 -> 0 bytes
 imc/Resources/arrow-right.png                      |   Bin 527 -> 0 bytes
 imc/Resources/document-open.png                    |   Bin 639 -> 0 bytes
 imc/Resources/document-save.png                    |   Bin 563 -> 0 bytes
 imc/Resources/edit-clear.png                       |   Bin 802 -> 0 bytes
 imc/Resources/go-next.png                          |   Bin 721 -> 0 bytes
 imc/Resources/go-previous.png                      |   Bin 634 -> 0 bytes
 imc/Resources/help-hint.png                        |   Bin 2925 -> 0 bytes
 imc/Resources/imc.ico                              |   Bin 122726 -> 0 bytes
 imc/Resources/imc.png                              |   Bin 17432 -> 0 bytes
 imc/Resources/kbugbuster.png                       |   Bin 3166 -> 0 bytes
 imc/Resources/preferences-other.png                |   Bin 945 -> 0 bytes
 imc/Resources/system-shutdown.png                  |   Bin 775 -> 0 bytes
 imc/Resources/task-accepted.png                    |   Bin 924 -> 0 bytes
 imc/Resources/tools-wizard.png                     |   Bin 797 -> 0 bytes
 imc/imc.1                                          |    77 -
 imc/imc.qrc                                        |    21 -
 imc/imc.rc                                         |    26 -
 imc/imc.rc.in                                      |    26 -
 imc/src/FileSystemBrowser.cpp                      |   105 -
 imc/src/FileSystemBrowser.h                        |    74 -
 imc/src/ImcCore.cpp                                |   247 -
 imc/src/ImcCore.h                                  |    59 -
 imc/src/KeyDirectoriesPage.cpp                     |    96 -
 imc/src/KeyDirectoriesPage.h                       |    50 -
 imc/src/KeyFileAssistant.cpp                       |   186 -
 imc/src/KeyFileAssistant.h                         |    52 -
 imc/src/KeyFileAssistantModePage.cpp               |    54 -
 imc/src/KeyFileAssistantModePage.h                 |    51 -
 imc/src/LogonAclSettings.h                         |   109 -
 imc/src/LogonGroupEditor.cpp                       |   192 -
 imc/src/LogonGroupEditor.h                         |    56 -
 imc/src/MainWindow.cpp                             |   676 -
 imc/src/MainWindow.h                               |    82 -
 imc/src/SystemConfigurationModifier.cpp            |   600 -
 imc/src/SystemConfigurationModifier.h              |    41 -
 imc/src/Win32AclEditor.cpp                         |   157 -
 imc/src/Win32AclEditor.h                           |    62 -
 imc/src/main.cpp                                   |   244 -
 imc/src/moc_FileSystemBrowser.cxx_parameters       |    22 -
 imc/src/moc_ImcCore.cxx_parameters                 |    22 -
 imc/src/moc_KeyDirectoriesPage.cxx_parameters      |    22 -
 imc/src/moc_KeyFileAssistant.cxx_parameters        |    22 -
 .../moc_KeyFileAssistantModePage.cxx_parameters    |    22 -
 imc/src/moc_LogonAclSettings.cxx_parameters        |    22 -
 imc/src/moc_LogonGroupEditor.cxx_parameters        |    22 -
 imc/src/moc_MainWindow.cxx_parameters              |    22 -
 .../moc_SystemConfigurationModifier.cxx_parameters |    22 -
 imc/src/moc_Win32AclEditor.cxx_parameters          |    22 -
 imc/src/moc_netfw.cxx_parameters                   |    22 -
 imc/src/netfw.h                                    |  4563 -----
 italc.spec.in                                      |   152 -
 italcconfig.h.in                                   |   107 -
 lib/CMakeLists.txt                                 |    47 -
 lib/ItalcCore.qrc                                  |    56 -
 lib/dialogs/AboutDialog.ui                         |   262 -
 lib/dialogs/PasswordDialog.ui                      |   239 -
 lib/include/AboutDialog.h                          |    47 -
 lib/include/AuthenticationCredentials.h            |    92 -
 lib/include/Configuration/LocalStore.h             |    50 -
 lib/include/Configuration/Object.h                 |   167 -
 lib/include/Configuration/Store.h                  |   104 -
 lib/include/Configuration/UiMapping.h              |    78 -
 lib/include/Configuration/XmlStore.h               |    53 -
 .../Configuration/moc_LocalStore.cxx_parameters    |    22 -
 .../Configuration/moc_Object.cxx_parameters        |    22 -
 lib/include/Configuration/moc_Store.cxx_parameters |    22 -
 .../Configuration/moc_UiMapping.cxx_parameters     |    22 -
 .../Configuration/moc_XmlStore.cxx_parameters      |    22 -
 lib/include/DecoratedMessageBox.h                  |    55 -
 lib/include/DsaKey.h                               |   161 -
 lib/include/FastQImage.h                           |   223 -
 lib/include/Inject.h                               |    42 -
 lib/include/Ipc/Core.h                             |   133 -
 lib/include/Ipc/Master.h                           |   108 -
 lib/include/Ipc/QtSlaveLauncher.h                  |    58 -
 lib/include/Ipc/Slave.h                            |    61 -
 lib/include/Ipc/SlaveLauncher.h                    |    58 -
 lib/include/Ipc/moc_Core.cxx_parameters            |    22 -
 lib/include/Ipc/moc_Master.cxx_parameters          |    22 -
 lib/include/Ipc/moc_QtSlaveLauncher.cxx_parameters |    22 -
 lib/include/Ipc/moc_Slave.cxx_parameters           |    22 -
 lib/include/Ipc/moc_SlaveLauncher.cxx_parameters   |    22 -
 lib/include/ItalcConfiguration.h                   |   129 -
 lib/include/ItalcCore.h                            |   169 -
 lib/include/ItalcCoreConnection.h                  |   135 -
 lib/include/ItalcRfbExt.h                          |    82 -
 lib/include/ItalcVncConnection.h                   |   244 -
 lib/include/LocalSystem.h                          |   200 -
 lib/include/LockWidget.h                           |    63 -
 lib/include/Logger.h                               |   128 -
 lib/include/LogonAuthentication.h                  |    37 -
 lib/include/PasswordDialog.h                       |    57 -
 lib/include/ProgressWidget.h                       |    61 -
 lib/include/QuadTree.h                             |   286 -
 lib/include/Snapshot.h                             |    73 -
 lib/include/SocketDevice.h                         |   117 -
 lib/include/SystemKeyTrapper.h                     |    90 -
 lib/include/VncView.h                              |   151 -
 lib/include/moc_AboutDialog.cxx_parameters         |    22 -
 .../moc_AuthenticationCredentials.cxx_parameters   |    22 -
 lib/include/moc_DecoratedMessageBox.cxx_parameters |    22 -
 lib/include/moc_DsaKey.cxx_parameters              |    22 -
 lib/include/moc_FastQImage.cxx_parameters          |    22 -
 lib/include/moc_Inject.cxx_parameters              |    22 -
 lib/include/moc_ItalcConfiguration.cxx_parameters  |    22 -
 lib/include/moc_ItalcCore.cxx_parameters           |    22 -
 lib/include/moc_ItalcCoreConnection.cxx_parameters |    22 -
 lib/include/moc_ItalcRfbExt.cxx_parameters         |    22 -
 lib/include/moc_ItalcVncConnection.cxx_parameters  |    22 -
 lib/include/moc_LocalSystem.cxx_parameters         |    22 -
 lib/include/moc_LockWidget.cxx_parameters          |    22 -
 lib/include/moc_Logger.cxx_parameters              |    22 -
 lib/include/moc_LogonAuthentication.cxx_parameters |    22 -
 lib/include/moc_PasswordDialog.cxx_parameters      |    22 -
 lib/include/moc_ProgressWidget.cxx_parameters      |    22 -
 lib/include/moc_QuadTree.cxx_parameters            |    22 -
 lib/include/moc_Snapshot.cxx_parameters            |    22 -
 lib/include/moc_SocketDevice.cxx_parameters        |    22 -
 lib/include/moc_SystemKeyTrapper.cxx_parameters    |    22 -
 lib/include/moc_VncView.cxx_parameters             |    22 -
 lib/include/rfb/dh.h                               |    83 -
 lib/include/rfb/keysym.h                           |  1638 --
 lib/include/rfb/rfb.h                              |  1273 --
 lib/include/rfb/rfbclient.h                        |   652 -
 lib/include/rfb/rfbint.h                           |    17 -
 lib/include/rfb/rfbproto.h                         |  1555 --
 lib/resources/ar.qm                                |   Bin 64974 -> 0 bytes
 lib/resources/ar.ts                                |  1762 --
 lib/resources/authors.png                          |   Bin 1383 -> 0 bytes
 lib/resources/cs.qm                                |   Bin 39561 -> 0 bytes
 lib/resources/cs.ts                                |  1766 --
 lib/resources/de.qm                                |   Bin 74065 -> 0 bytes
 lib/resources/de.ts                                |  1762 --
 lib/resources/dialog-password.png                  |   Bin 11197 -> 0 bytes
 lib/resources/el.qm                                |   Bin 46828 -> 0 bytes
 lib/resources/el.ts                                |  1763 --
 lib/resources/es.qm                                |   Bin 41239 -> 0 bytes
 lib/resources/es.ts                                |  1760 --
 lib/resources/fi.qm                                |   Bin 42907 -> 0 bytes
 lib/resources/fi.ts                                |  1766 --
 lib/resources/fr.qm                                |   Bin 44879 -> 0 bytes
 lib/resources/fr.ts                                |  1767 --
 lib/resources/he.qm                                |   Bin 42140 -> 0 bytes
 lib/resources/he.ts                                |  1786 --
 lib/resources/hu.qm                                |   Bin 77549 -> 0 bytes
 lib/resources/hu.ts                                |  1794 --
 lib/resources/icon16.png                           |   Bin 825 -> 0 bytes
 lib/resources/icon22.png                           |   Bin 1184 -> 0 bytes
 lib/resources/icon32.png                           |   Bin 1876 -> 0 bytes
 lib/resources/icon64.png                           |   Bin 3975 -> 0 bytes
 lib/resources/info.png                             |   Bin 4255 -> 0 bytes
 lib/resources/it.qm                                |   Bin 80489 -> 0 bytes
 lib/resources/it.ts                                |  1773 --
 lib/resources/license.png                          |   Bin 3626 -> 0 bytes
 lib/resources/locale.png                           |   Bin 1559 -> 0 bytes
 lib/resources/locked_bg.png                        |   Bin 42847 -> 0 bytes
 lib/resources/manage-with-imc.png                  |   Bin 815 -> 0 bytes
 lib/resources/message.png                          |   Bin 4939 -> 0 bytes
 lib/resources/nl.qm                                |     1 -
 lib/resources/nl.ts                                |  1749 --
 lib/resources/nn.qm                                |   Bin 28313 -> 0 bytes
 lib/resources/nn.ts                                |  1754 --
 lib/resources/ok.png                               |   Bin 808 -> 0 bytes
 lib/resources/pl.qm                                |   Bin 41165 -> 0 bytes
 lib/resources/pl.ts                                |  1766 --
 lib/resources/pointcursor.png                      |   Bin 143 -> 0 bytes
 lib/resources/pointcursormask.png                  |   Bin 146 -> 0 bytes
 lib/resources/pt_br.qm                             |   Bin 82657 -> 0 bytes
 lib/resources/pt_br.ts                             |  1779 --
 lib/resources/ru.qm                                |   Bin 77313 -> 0 bytes
 lib/resources/ru.ts                                |  1777 --
 lib/resources/sk.qm                                |   Bin 39352 -> 0 bytes
 lib/resources/sk.ts                                |  1766 --
 lib/resources/sl.qm                                |   Bin 39934 -> 0 bytes
 lib/resources/sl.ts                                |  1767 --
 lib/resources/sv.qm                                |   Bin 63248 -> 0 bytes
 lib/resources/sv.ts                                |  1770 --
 lib/resources/tr.qm                                |   Bin 44541 -> 0 bytes
 lib/resources/tr.ts                                |  1763 --
 lib/resources/uk.qm                                |   Bin 81308 -> 0 bytes
 lib/resources/uk.ts                                |  1777 --
 lib/resources/watch1.png                           |   Bin 2616 -> 0 bytes
 lib/resources/watch10.png                          |   Bin 2635 -> 0 bytes
 lib/resources/watch11.png                          |   Bin 2585 -> 0 bytes
 lib/resources/watch12.png                          |   Bin 2630 -> 0 bytes
 lib/resources/watch13.png                          |   Bin 2630 -> 0 bytes
 lib/resources/watch14.png                          |   Bin 2609 -> 0 bytes
 lib/resources/watch15.png                          |   Bin 2534 -> 0 bytes
 lib/resources/watch16.png                          |   Bin 2655 -> 0 bytes
 lib/resources/watch2.png                           |   Bin 2605 -> 0 bytes
 lib/resources/watch3.png                           |   Bin 2568 -> 0 bytes
 lib/resources/watch4.png                           |   Bin 2603 -> 0 bytes
 lib/resources/watch5.png                           |   Bin 2630 -> 0 bytes
 lib/resources/watch6.png                           |   Bin 2623 -> 0 bytes
 lib/resources/watch7.png                           |   Bin 2568 -> 0 bytes
 lib/resources/watch8.png                           |   Bin 2625 -> 0 bytes
 lib/resources/watch9.png                           |   Bin 2641 -> 0 bytes
 lib/resources/zh_cn.qm                             |   Bin 30420 -> 0 bytes
 lib/resources/zh_cn.ts                             |  1766 --
 lib/resources/zh_tw.qm                             |   Bin 56196 -> 0 bytes
 lib/resources/zh_tw.ts                             |  1777 --
 lib/src/3rdparty/XEventLog.cpp                     |   426 -
 lib/src/3rdparty/XEventLog.h                       |    44 -
 lib/src/AboutDialog.cpp                            |    48 -
 lib/src/AuthenticationCredentials.cpp              |   107 -
 lib/src/Configuration/LocalStore.cpp               |   125 -
 lib/src/Configuration/Object.cpp                   |   334 -
 lib/src/Configuration/XmlStore.cpp                 |   185 -
 lib/src/DecoratedMessageBox.cpp                    |   144 -
 lib/src/DsaKey.cpp                                 |   849 -
 lib/src/FastQImage.cpp                             |   864 -
 lib/src/Inject.cpp                                 |   655 -
 lib/src/Ipc/Core.cpp                               |    47 -
 lib/src/Ipc/Master.cpp                             |   316 -
 lib/src/Ipc/QtSlaveLauncher.cpp                    |   134 -
 lib/src/Ipc/Slave.cpp                              |   126 -
 lib/src/Ipc/SlaveLauncher.cpp                      |    63 -
 lib/src/ItalcConfiguration.cpp                     |   125 -
 lib/src/ItalcCore.cpp                              |   320 -
 lib/src/ItalcCoreConnection.cpp                    |   356 -
 lib/src/ItalcVncConnection.cpp                     |   867 -
 lib/src/LocalSystem.cpp                            |  1183 --
 lib/src/LockWidget.cpp                             |   157 -
 lib/src/Logger.cpp                                 |   253 -
 lib/src/LogonAuthentication.cpp                    |    94 -
 lib/src/PasswordDialog.cpp                         |   111 -
 lib/src/ProgressWidget.cpp                         |   102 -
 lib/src/Snapshot.cpp                               |   160 -
 lib/src/SystemKeyTrapper.cpp                       |   376 -
 lib/src/VncView.cpp                                |   818 -
 lib/src/dh.cpp                                     |   178 -
 nsis/header.bmp                                    |   Bin 34254 -> 0 bytes
 nsis/welcome-page.bmp                              |   Bin 206038 -> 0 bytes
 658 files changed, 296585 deletions(-)

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 178020b..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,9 +0,0 @@
-Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
-Maintainer and developer
-
-Andrei Krueger	<anc/at/iki/dot/fi>
-Developer
-
-Additional thanks to the authors of x11vnc and TightVNC.
-See ica/x11/README and ica/win32/README for details.
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index f8ff3c6..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,351 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
-
-PROJECT(italc)
-
-SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
-SET(CMAKE_BUILD_TYPE relwithdebinfo)
-
-IF(COMMAND CMAKE_POLICY)
-	CMAKE_POLICY(SET CMP0005 NEW)
-	CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
-
-INCLUDE(AddFileDependencies)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckFunctionExists)
-INCLUDE(FindPkgConfig)
-INCLUDE(Qt4Hacks)
-
-SET(VERSION_MAJOR "2")
-SET(VERSION_MINOR "0")
-SET(VERSION_PATCH "2")
-SET(VERSION_SUFFIX "")
-SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
-IF(VERSION_SUFFIX)
-	SET (VERSION "${VERSION}-${VERSION_SUFFIX}")
-ENDIF(VERSION_SUFFIX)
-ADD_DEFINITIONS(-D'ITALC_VERSION="${VERSION}"')
-
-
-INCLUDE(DetectMachine)
-
-# check for pthreads and TLS support
-IF(WIN32)
-	SET(ITALC_HAVE_LIBPTHREAD true)
-ELSE(WIN32)
-    FIND_PACKAGE(Threads)
-	IF(CMAKE_USE_PTHREADS_INIT)
-		SET(ITALC_HAVE_LIBPTHREAD true)
-	ENDIF(CMAKE_USE_PTHREADS_INIT)
-ENDIF(WIN32)
-
-CHECK_C_SOURCE_COMPILES("static __thread int p = 0; int main() {}" ITALC_HAVE_TLS)
-
-CHECK_INCLUDE_FILES(arpa/inet.h ITALC_HAVE_ARPA_INET_H)
-CHECK_INCLUDE_FILES(unistd.h ITALC_HAVE_UNISTD_H)
-CHECK_INCLUDE_FILES(fcntl.h ITALC_HAVE_FCNTL_H)
-CHECK_INCLUDE_FILES(limits.h ITALC_HAVE_LIMITS_H)
-CHECK_INCLUDE_FILES(memory.h ITALC_HAVE_MEMORY_H)
-CHECK_INCLUDE_FILES(netdb.h ITALC_HAVE_NETDB_H)
-CHECK_INCLUDE_FILES(netinet/in.h ITALC_HAVE_NETINET_IN_H)
-CHECK_INCLUDE_FILES(stdint.h ITALC_HAVE_STDINT_H)
-CHECK_INCLUDE_FILES(stdlib.h ITALC_HAVE_STDLIB_H)
-CHECK_INCLUDE_FILES(stdbool.h ITALC_HAVE_STDBOOL_H)
-CHECK_INCLUDE_FILES(string.h ITALC_HAVE_STRING_H)
-CHECK_INCLUDE_FILES(strings.h ITALC_HAVE_STRINGS_H)
-CHECK_INCLUDE_FILES(sys/ioctl.h ITALC_HAVE_SYS_IOCTL_H)
-CHECK_INCLUDE_FILES(sys/socket.h ITALC_HAVE_SYS_SOCKET_H)
-CHECK_INCLUDE_FILES(sys/time.h ITALC_HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILES(sys/timeb.h ITALC_HAVE_SYS_TIMEB_H)
-CHECK_INCLUDE_FILES(sys/stat.h ITALC_HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILES(syslog.h ITALC_HAVE_SYSLOG_H)
-CHECK_INCLUDE_FILES(unistd.h ITALC_HAVE_UNISTD_H)
-CHECK_INCLUDE_FILES(pwd.h ITALC_HAVE_PWD_H)
-CHECK_INCLUDE_FILES(sys/types.h ITALC_HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILES(utmpx.h ITALC_HAVE_UTMPX_H)
-CHECK_INCLUDE_FILES(sys/wait.h ITALC_HAVE_SYS_WAIT_H)
-CHECK_INCLUDE_FILES(time.h ITALC_HAVE_TIME_H)
-CHECK_INCLUDE_FILES(errno.h ITALC_HAVE_ERRNO_H)
-CHECK_INCLUDE_FILES(pthread.h ITALC_HAVE_PTHREAD_H)
-CHECK_INCLUDE_FILES(sys/ipc.h ITALC_HAVE_SYS_IPC_H)
-CHECK_INCLUDE_FILES(sys/shm.h ITALC_HAVE_SYS_SHM_H)
-CHECK_INCLUDE_FILES(stdarg.h ITALC_HAVE_STDARG_H)
-CHECK_INCLUDE_FILES(signal.h ITALC_HAVE_SIGNAL_H)
-CHECK_INCLUDE_FILES(ctype.h ITALC_HAVE_CTYPE_H)
-CHECK_INCLUDE_FILES(process.h ITALC_HAVE_PROCESS_H)
-CHECK_INCLUDE_FILES(dlfcn.h ITALC_HAVE_DLFCN_H)
-CHECK_INCLUDE_FILES(inttypes.h ITALC_HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILES(vfork.h ITALC_HAVE_VFORK_H)
-CHECK_INCLUDE_FILES(linux/fb.h ITALC_HAVE_LINUX_FB_H)
-CHECK_INCLUDE_FILES(linux/input.h ITALC_HAVE_LINUX_INPUT_H)
-CHECK_INCLUDE_FILES(linux/uinput.h ITALC_HAVE_LINUX_UINPUT_H)
-CHECK_INCLUDE_FILES(linux/videodev.h ITALC_HAVE_LINUX_VIDEODEV_H)
-CHECK_INCLUDE_FILES(linux/videodev2.h ITALC_HAVE_LINUX_VIDEODEV2_H)
-
-IF(NOT ITALC_BUILD_WIN32)
-	FIND_PACKAGE(PAM REQUIRED)
-ENDIF()
-
-SET(CMAKE_REQUIRED_LIBRARIES "-lm")
-
-SET(FUNCS dup2 floor ftime geteuid gethostbyname gethostname getpwnam getpwuid getspnam gettimeofday getuid grantpt inet_ntoa initgroups memcmp memcpy memmove memset mkfifo mmap pow putenv select seteuid setpgrp setsid setutxent socket strchr strdup strerror strpbrk strrchr strstr uname waitpid)
-FOREACH(_func ${FUNCS})
-	STRING(TOUPPER "${_func}" fuc)
-	CHECK_FUNCTION_EXISTS(${_func} ITALC_HAVE_${fuc})
-ENDFOREACH(_func ${FUNCS})
-
-# TODO: ITALC_WORDS_BIGENDIAN
-
-# check for Qt4
-
-SET(QT_MIN_VERSION "4.6.0")
-FIND_PACKAGE(Qt4 REQUIRED)
-SET(QT_USE_QTXML 1)
-SET(QT_USE_QTNETWORK 1)
-IF(WIN32)
-	SET(QT_QM_RCC "<!DOCTYPE RCC><RCC version=\"1.0\"><qresource>")
-	FILE(GLOB QT_QM ${MINGW_PREFIX}/share/qt4/translations/qt_*.qm)
-	FOREACH(f ${QT_QM})
-		STRING(REGEX MATCH ".*qt_help.*" TMP "${f}")
-		IF(NOT TMP)
-			STRING(REPLACE "${MINGW_PREFIX}/share/qt4/translations/" "" fa "${f}")
-			SET(QT_QM_RCC "${QT_QM_RCC}<file alias=\"${fa}\">${f}</file>")
-		ENDIF()
-	ENDFOREACH()
-	SET(QT_QM_RCC "${QT_QM_RCC}</qresource></RCC>")
-	FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lib/qt_qm.qrc "${QT_QM_RCC}")
-ELSE()
-	EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_TRANSLATIONS" OUTPUT_VARIABLE QT_TRANSLATIONS_DIR)
-	IF(EXISTS "${QT_TRANSLATIONS_DIR}")
-		MESSAGE("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
-		ADD_DEFINITIONS(-D'QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"')
-	ENDIF(EXISTS "${QT_TRANSLATIONS_DIR}")
-ENDIF()
-
-IF(NOT WIN32)
-	STRING(REPLACE "-DQT_DLL" "" QT_DEFINITIONS "${QT_DEFINITIONS}")
-ENDIF(NOT WIN32)
-INCLUDE(${QT_USE_FILE})
-
-
-# find libraries
-FIND_PACKAGE(ZLIB REQUIRED)
-FIND_PACKAGE(JPEG REQUIRED)
-IF(ITALC_BUILD_WIN32)
-	SET(OPENSSL_LIBRARIES -L${MINGW_PREFIX}/bin -leay32)
-ELSE(ITALC_BUILD_WIN32)
-	FIND_PACKAGE(OpenSSL REQUIRED)
-ENDIF(ITALC_BUILD_WIN32)
-FIND_PACKAGE(PNG)
-
-# find X libraries
-IF(NOT ITALC_BUILD_WIN32)
-	FIND_PACKAGE(X11 REQUIRED)
-
-	SET(CMAKE_REQUIRED_LIBRARIES ${X11_LIBRARIES} ${X11_XTest_LIB})
-	SET(ITALC_HAVE_X11 TRUE)
-
-	IF(X11_XShm_FOUND)
-		SET(ITALC_HAVE_XSHM TRUE)
-	ENDIF(X11_XShm_FOUND)
-	IF(X11_XTest_FOUND)
-		SET(ITALC_HAVE_XTEST TRUE)
-	ENDIF(X11_XTest_FOUND)
-	IF(X11_Xinerama_FOUND)
-		SET(ITALC_HAVE_LIBXINERAMA TRUE)
-	ENDIF(X11_Xinerama_FOUND)
-	IF(X11_Xrandr_FOUND)
-		SET(ITALC_HAVE_LIBXRANDR TRUE)
-	ENDIF(X11_Xrandr_FOUND)
-	IF(X11_Xfixes_FOUND)
-		SET(ITALC_HAVE_LIBXFIXES TRUE)
-	ENDIF(X11_Xfixes_FOUND)
-	IF(X11_Xdamage_FOUND)
-		SET(ITALC_HAVE_LIBXDAMAGE TRUE)
-	ENDIF(X11_Xdamage_FOUND)
-
-	CHECK_FUNCTION_EXISTS(XReadScreen ITALC_HAVE_SOLARIS_XREADSCREEN)
-	CHECK_FUNCTION_EXISTS(FBPMForceLevel ITALC_HAVE_FBPM)
-	CHECK_FUNCTION_EXISTS(DPMSForceLevel ITALC_HAVE_DPMS)
-	CHECK_FUNCTION_EXISTS(XTestGrabControl ITALC_HAVE_XTESTGRABCONTROL)
-	CHECK_FUNCTION_EXISTS(XRecordEnableContextAsync ITALC_HAVE_RECORD)
-	CHECK_INCLUDE_FILES(X11/extensions/readdisplay.h ITALC_HAVE_IRIX_XREADDISPLAY)
-	CHECK_INCLUDE_FILES(X11/XKBlib.h ITALC_HAVE_XKBLIB_H)
-	IF(ITALC_HAVE_XKBLIB_H)
-		CHECK_FUNCTION_EXISTS(XkbSelectEvents ITALC_HAVE_XKEYBOARD)
-	ENDIF(ITALC_HAVE_XKBLIB_H)
-	SET(ITALC_HAVE_LIBCRYPT FALSE)
-ENDIF(NOT ITALC_BUILD_WIN32)
-SET(ITALC_ALLOW24BPP TRUE)
-SET(ITALC_BACKCHANNEL TRUE)
-
-# find Java compiler for the JavaViewer
-FIND_PACKAGE(Java)
-IF(JAVA_COMPILE)
-	SET(STATUS_JAVA "yes")
-ELSE(JAVA_COMPILE)
-	SET(STATUS_JAVA "no - please install a Java compiler")
-ENDIF(JAVA_COMPILE)
-
-
-SET(ITALCCONFIG ${CMAKE_BINARY_DIR}/italcconfig.h)
-SET(RFBCONFIG ${CMAKE_BINARY_DIR}/rfb/rfbconfig.h)
-
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/italcconfig.h.in ${ITALCCONFIG})
-SET(IN_FILES iTALC.nsi italc.spec ima/data/italc ima/data/italc.desktop ica/ica.rc ima/italc.rc imc/imc.rc)
-FOREACH(f ${IN_FILES})
-	CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${f}.in ${CMAKE_BINARY_DIR}/${f} @ONLY)
-ENDFOREACH(f ${IN_FILES})
-
-FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/rfb)
-IF(${ITALCCONFIG} IS_NEWER_THAN ${RFBCONFIG})
-	EXECUTE_PROCESS(COMMAND sed -e "s/ITALC_/LIBVNCSERVER_/g" INPUT_FILE ${ITALCCONFIG} OUTPUT_FILE ${RFBCONFIG})
-ENDIF(${ITALCCONFIG} IS_NEWER_THAN ${RFBCONFIG})
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions ${CXXFLAGS}")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ${CFLAGS}")
-IF(ITALC_BUILD_WIN32)
-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes -Wno-pragmas")
-ELSE()
-	SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} -lcrypto)
-ENDIF(ITALC_BUILD_WIN32)
-
-ADD_DEFINITIONS(-D'LIB_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/"' -D'PLUGIN_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/italc/"')
-ADD_DEFINITIONS(-DLIBVNCSERVER_HAVE_LIBZ)
-ADD_DEFINITIONS(-DLIBVNCSERVER_HAVE_LIBJPEG)
-IF(PNG_FOUND)
-	ADD_DEFINITIONS(-DLIBVNCSERVER_HAVE_LIBPNG)
-ENDIF(PNG_FOUND)
-
-INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib/include ${ZLIB_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR})
-LINK_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_BINARY_DIR}/lib)
-LINK_LIBRARIES(${QT_LIBRARIES} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${OPENSSL_LIBRARIES})
-
-# make sub-directories
-ADD_SUBDIRECTORY(lib)
-ADD_SUBDIRECTORY(ica)
-ADD_SUBDIRECTORY(ima)
-ADD_SUBDIRECTORY(imc)
-
-INSTALL()
-
-#
-# rules for building localizations
-#
-FILE(GLOB italc_LOCALES lib/resources/*.ts)
-SET(ts_targets "")
-SET(qm_targets "")
-FILE(GLOB_RECURSE italc_SOURCES *.cpp *.h *.ui)
-FOREACH(_ts_file ${italc_LOCALES})
-	STRING(REPLACE "${CMAKE_SOURCE_DIR}/lib/resources/" "" _ts_target "${_ts_file}")
-	STRING(REPLACE ".ts" ".qm" _qm_file "${_ts_file}")
-	STRING(REPLACE ".ts" ".qm" _qm_target "${_ts_target}")
-	ADD_CUSTOM_TARGET(${_ts_target} COMMAND ${QT_LUPDATE_EXECUTABLE} -I${CMAKE_SOURCE_DIR}/lib/include -locations none -no-obsolete ${italc_SOURCES} -ts ${_ts_file})
-	ADD_CUSTOM_TARGET(${_qm_target} COMMAND ${QT_LRELEASE_EXECUTABLE} ${_ts_file} -qm ${_qm_file})
-	LIST(APPEND ts_targets "${_ts_target}")
-	LIST(APPEND qm_targets "${_qm_target}")
-ENDFOREACH(_ts_file ${italc_LOCALES})
-
-ADD_CUSTOM_TARGET(update-locales)
-FOREACH(_item ${ts_targets})
-	ADD_DEPENDENCIES(update-locales ${_item})
-ENDFOREACH(_item ${ts_targets})
-
-ADD_CUSTOM_TARGET(finalize-locales)
-FOREACH(_item ${qm_targets})
-	ADD_DEPENDENCIES(finalize-locales ${_item})
-ENDFOREACH(_item ${qm_targets})
-
-
-#
-# add tarball-target
-#
-SET(TMP "italc-${VERSION}")
-ADD_CUSTOM_TARGET(dist
-			COMMAND make clean
-			COMMAND rm -rf ${TMP}
-			COMMAND mkdir -p ${TMP}
-			COMMAND cp AUTHORS build_mingw* ChangeLog CMakeLists.txt COPYING INSTALL italcconfig.h.in italc.spec.in iTALC.nsi.in README* TODO ${TMP}
-			COMMAND cp -r cmake contrib doc lib ica ima imc nsis ${TMP}
-			COMMAND rm -rf `find ${TMP} -type d -name ".svn"`  `find ${TMP} -name cmake_install.cmake` `find ${TMP} -name Makefile` `find ${TMP} -type d -name CMakeFiles` ${TMP}/CMakeCache.txt `find ${TMP} -name "*.depends"` ${TMP}/ima/data/italc ${TMP}/ima/data/italc.desktop
-			COMMAND tar cjf italc-${VERSION}.tar.bz2 ${TMP}
-			COMMAND rm -rf ${TMP})
-
-SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "italcconfig.h")
-
-ADD_CUSTOM_TARGET(win-nsi
-			COMMAND make
-			COMMAND rm -rf ${TMP}
-			COMMAND mkdir -p ${TMP}
-			COMMAND cp lib/ItalcCore.dll ica/ica.exe ica/win32/vnchooks.dll ica/win32/authSSP.dll ima/italc.exe imc/imc.exe ${TMP}
-			COMMAND ${STRIP} ${TMP}/*
-			COMMAND cp -r ${CMAKE_SOURCE_DIR}/doc ${TMP}
-			COMMAND cp -r ${CMAKE_SOURCE_DIR}/contrib ${TMP}
-			COMMAND cp ${CMAKE_SOURCE_DIR}/COPYING ${TMP}
-			COMMAND cp ${CMAKE_SOURCE_DIR}/COPYING ${TMP}/LICENSE.TXT
-			COMMAND cp ${CMAKE_SOURCE_DIR}/README ${TMP}/README.TXT
-			COMMAND todos ${TMP}/*.txt ${TMP}/*.TXT
-			COMMAND makensis iTALC.nsi
-			#COMMAND rm -rf ${TMP}
-		)
-
-
-#
-# display configuration information
-#
-
-MESSAGE("\n"
-"iTALC build summary\n"
-"--------------------\n"
-"* Install prefix              : ${CMAKE_INSTALL_PREFIX}\n"
-"* Build type                  : ${CMAKE_BUILD_TYPE}\n"
-"* Platform                    : ${CMAKE_SYSTEM_PROCESSOR} (${Machine})\n"
-"* Builtin JavaViewer support  : ${STATUS_JAVA}\n"
-"* Compile flags               : ${CMAKE_C_FLAGS} (CXX: ${CMAKE_CXX_FLAGS})\n"
-)
-
-MESSAGE(
-"\n"
-"-----------------------------------------------------------------\n"
-"IMPORTANT:\n"
-"After installing missing packages, remove CMakeCache.txt before\n"
-"running cmake again!\n"
-"-----------------------------------------------------------------\n"
-"\n\n")
-
-
-INCLUDE(InstallRequiredSystemLibraries)
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "iTALC - Intelligent Teaching And Learning with Computers")
-SET(CPACK_PACKAGE_VENDOR "ITALC Developers")
-SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
-SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
-SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
-SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
-SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}-${VERSION_SUFFIX}")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "iTALC ${VERSION}")
-IF(WIN32)
-SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/data\\\\nsis_branding.bmp")
-SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/ima/data\\\\italc.ico")
-SET(CPACK_NSIS_INSTALLED_ICON_NAME "italc.exe")
-SET(CPACK_NSIS_DISPLAY_NAME "iTALC ${VERSION}")
-SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\italc.sourceforge.net")
-SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\italc.sourceforge.net")
-SET(CPACK_NSIS_CONTACT "italc-devel at lists.sourceforge.net")
-SET(CPACK_PACKAGE_EXECUTABLES "italc.exe;iTALC ${VERSION}")
-SET(CPACK_NSIS_MENU_LINKS "italc.exe;iTALC ${VERSION}")
-ELSE(WIN32)
-SET(CPACK_STRIP_FILES "bin/italc;bin/ica;${LIB_DIR}/*.so;${PLUGIN_DIR}/*.so")
-SET(CPACK_PACKAGE_EXECUTABLES "italc" "iTALC binary")
-ENDIF(WIN32)
-
-SET(MACOSX_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/data/themes/default/icon.png")
-SET(MACOSX_BUNDLE_GUI_IDENTIFIER "iTALC")
-SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}")
-SET(MACOSX_BUNDLE_BUNDLE_NAME "iTALC")
-SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
-SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
-SET(MACOSX_BUNDLE_COPYRIGHT "Tobias Doerffel, 2008")
-
-INCLUDE(CPack)
-
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 29aeaac..0000000
--- a/COPYING
+++ /dev/null
@@ -1,352 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
-
--------------------------------------------------------------------------
-
-In addition, as a special exception, Tobias Doerffel gives permission to link the
-code of its release of iTALC with the OpenSSL project's "OpenSSL" library (or
-modified versions of the "OpenSSL" library that use the same license as the
-original version), and distribute the linked executables.
-
-You must comply with the GNU General Public License version 2 in all respects
-for all of the code used other than the "OpenSSL" code.  If you modify this
-file, you may extend this exception to your version of the file, but you are
-not obligated to do so.  If you do not wish to do so, delete this exception
-statement from your version of this file.
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index ce96ae5..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,4275 +0,0 @@
-2008-11-08	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/include/types.h:
-	include stdint.h for compiling with GCC 4.4
-
-2008-11-05	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* build_mingw32:
-	improved CFLAGS and CXXFLAGS
-
-	* ima/src/client.cpp:
-	allow remote login without password
-
-	* lib/src/local_system.cpp:
-	fixed registry setting for personal configuration directory and
-	personal configuration file (closes #2006515)
-
-2008-11-05	James Mitchell <james_mitchell/at/user/dot/sourceforge/dot/net>
-
-	* ima/src/classroom_manager.cpp:
-	* ima/src/classroom_manager.h:
-	* ima/src/client.cpp:
-	* ima/src/main_window.cpp:
-	Implemented Toggle Autoview
-
-2008-10-16	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/system_service.cpp:
-	* ica/src/system_service.h:
-	* ica/src/local_system_ica.cpp:
-	* lib/include/local_system.h:
-	* lib/src/local_system.cpp:
-	applied patch by James Mitchell <James.P.Mitchell at education.nsw.gov.au>
-	for improved username detection on win32
-
-2008-07-23	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.9 release
-
-	* ica/ica.rc.in:
-	* setup/setup.rc.in:
-	* ima/italc.rc.in:
-	fixed version-information (closes #2025199)
-
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	moved cursor-position queries to demoServer - workaround for an
-	unknown bug in Qt 4.4 (closes #1994549, #2006526, #2015845)
-
-	* lib/src/isd_base.cpp:
-	use QTcpSocket::waitForBytesWritten() rather than flush()
-
-	* lib/src/local_system.cpp:
-	initialize LZO-library on startup
-
-	* lib/src/messagebox.cpp:
-	fixed compiler warning
-
-2008-07-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.9-rc4 release
-
-	* ica/src/isd_server.cpp:
-	win32: run processes with rights of logged on user
-
-	* lib/src/local_system.cpp:
-	win32: tried better way for logging on user but had no success
-
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	use QTimer-objects instead of QTimer::singleShot() as Qt 4.4.0 crashes
-	quite often otherwise (for whatever reason)
-
-	* utils-win32/Makefile.am:
-	* utils-win32/userinfo.cpp:
-	removed obsolete files
-
-	* build_mingw32:
-	-fno-strict-aliasing is not neccessary anymore with GCC 4.3
-
-	* ima/src/main.cpp:
-	if custom ISD-port is used, apply at startup
-
-	* ica/x11/x11vnc/inet.c:
-	renamed deprecated member-variable as it's been reverted on 2008-06-24
-
-2008-06-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	do not call client::update() outside of GUI-thread - fixes crashes of
-	master
-
-2008-06-24	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/ivs.cpp:
-	* ica/x11/x11vnc/userinput.c:
-	* ica/x11/x11vnc/inet.c:
-	* ica/x11/x11vnc/options.h:
-	* ica/x11/x11vnc/xinerama.c:
-	* ica/x11/x11vnc/user.c:
-	* ica/x11/x11vnc/8to24.c:
-	* ica/x11/x11vnc/connections.c:
-	* ica/x11/x11vnc/cursor.c:
-	* ica/x11/x11vnc/x11vnc_defs.c:
-	* ica/x11/x11vnc/tkx11vnc.h:
-	* ica/x11/x11vnc/scan.c:
-	* ica/x11/x11vnc/gui.c:
-	* ica/x11/x11vnc/selection.c:
-	* ica/x11/x11vnc/unixpw.c:
-	* ica/x11/x11vnc/screen.c:
-	* ica/x11/x11vnc/x11vnc.c:
-	* ica/x11/x11vnc/ssltools.h:
-	* ica/x11/x11vnc/sslhelper.c:
-	* ica/x11/x11vnc/help.c:
-	* ica/x11/x11vnc/options.c:
-	* ica/x11/libvncserver/stats.c:
-	* ica/x11/libvncserver/rfbregion.c:
-	* ica/x11/libvncserver/zywrletemplate.c:
-	* ica/x11/libvncserver/rfbserver.c:
-	- integrated latest x11vnc-version which fixes ICA-crahes when
-	  disconnecting in certain situations
-	- disabled x11vnc-debug-console per default
-
-2008-06-13	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/isd_server.cpp:
-	* ima/src/main.cpp:
-	* ima/src/main_window.cpp:
-	* ima/italc.1:
-	applied patch by Stephane Graber <stgraber/at/gmail/dot/com> which
-	adds -isdhost option in order to connect to local ISD's in
-	TC-environments
-
-2008-06-11	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/cs.qm:
-	* ica/resources/pt_br.qm:
-	* ica/resources/fi.ts:
-	* ica/resources/fr.qm:
-	* ica/resources/es.qm:
-	* ica/resources/nn.qm:
-	* ica/resources/pl.qm:
-	* ica/resources/it.qm:
-	* ica/resources/cs.ts:
-	* ica/resources/sl.qm:
-	* ica/resources/uk.qm:
-	* ica/resources/pt_br.ts:
-	* ica/resources/es.ts:
-	* ica/resources/fr.ts:
-	* ica/resources/zh.qm:
-	* ica/resources/nn.ts:
-	* ica/resources/pl.ts:
-	* ica/resources/it.ts:
-	* ica/resources/ru.qm:
-	* ica/resources/sl.ts:
-	* ica/resources/uk.ts:
-	* ica/resources/zh.ts:
-	* ica/resources/fi.qm:
-	* ica/resources/ru.ts:
-	* ica/resources/el.qm:
-	* setup/resources/fr.qm:
-	* setup/resources/fi.ts:
-	* setup/resources/nn.qm:
-	* setup/resources/pl.qm:
-	* setup/resources/sl.qm:
-	* setup/resources/cs.ts:
-	* setup/resources/pt_br.ts:
-	* setup/resources/zh.qm:
-	* setup/resources/sk.ts:
-	* setup/resources/uk.ts:
-	* setup/resources/fi.qm:
-	* setup/resources/ru.ts:
-	* setup/resources/cs.qm:
-	* setup/resources/pt_br.qm:
-	* setup/resources/el.ts:
-	* setup/resources/uk.qm:
-	* setup/resources/fr.ts:
-	* setup/resources/nn.ts:
-	* setup/resources/pl.ts:
-	* setup/resources/it.ts:
-	* setup/resources/ru.qm:
-	* setup/resources/sl.ts:
-	* setup/resources/zh.ts:
-	* setup/resources/el.qm:
-	* ima/resources/pl.qm:
-	* ima/resources/it.qm:
-	* ima/resources/cs.ts:
-	* ima/resources/sl.qm:
-	* ima/resources/es.ts:
-	* ima/resources/zh.qm:
-	* ima/resources/sk.ts:
-	* ima/resources/uk.ts:
-	* ima/resources/cs.qm:
-	* ima/resources/es.qm:
-	* ima/resources/sk.qm:
-	* ima/resources/uk.qm:
-	* ima/resources/fr.ts:
-	* ima/resources/nn.ts:
-	* ima/resources/de.ts:
-	* ima/resources/fi.ts:
-	* ima/resources/fr.qm:
-	* ima/resources/nn.qm:
-	* ima/resources/pt_br.ts:
-	* ima/resources/de.qm:
-	* ima/resources/fi.qm:
-	* ima/resources/ru.ts:
-	* ima/resources/pt_br.qm:
-	* ima/resources/el.ts:
-	* ima/resources/pl.ts:
-	* ima/resources/it.ts:
-	* ima/resources/ru.qm:
-	* ima/resources/sl.ts:
-	* ima/resources/zh.ts:
-	* ima/resources/el.qm:
-	* lib/resources/fr.qm:
-	* lib/resources/fi.ts:
-	* lib/resources/nn.qm:
-	* lib/resources/pl.qm:
-	* lib/resources/it.qm:
-	* lib/resources/sl.qm:
-	* lib/resources/cs.ts:
-	* lib/resources/pt_br.ts:
-	* lib/resources/es.ts:
-	* lib/resources/zh.qm:
-	* lib/resources/sk.ts:
-	* lib/resources/uk.ts:
-	* lib/resources/fi.qm:
-	* lib/resources/ru.ts:
-	* lib/resources/cs.qm:
-	* lib/resources/pt_br.qm:
-	* lib/resources/es.qm:
-	* lib/resources/el.ts:
-	* lib/resources/uk.qm:
-	* lib/resources/fr.ts:
-	* lib/resources/nn.ts:
-	* lib/resources/pl.ts:
-	* lib/resources/it.ts:
-	* lib/resources/ru.qm:
-	* lib/resources/sl.ts:
-	* lib/resources/zh.ts:
-	* lib/resources/el.qm:
-	refreshed localization-files
-
-2008-06-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/x11/x11vnc/inet.c:
-	renamed deprecated member-variable
-
-	* lib/src/isd_connection.cpp:
-	fixed sleep()-call
-
-	* lib/src/local_system.cpp:
-	immediately exit application when encountering messages containing
-	timer-threading-problem under win32
-
-2008-05-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/lock_widget.cpp:
-	additionally set blank cursor before showing in fullscreen
-
-	* lib/src/system_key_trapper.cpp:
-	disable and hide taskbar while being locked
-
-	* lib/src/isd_connection.cpp:
-	- if connection failed, sleep for 2 seconds for not reaching
-	  max-connection limit of WinXP/SP2 instantly
-	- increased timeout when waiting for new connection to 5 seconds
-
-	* ima/src/main_window.cpp:
-	more graceful shutdown under win32
-
-	* ica/src/ivs.cpp:
-	- forward stdout and stderr or x11vnc to ICA's stdout/stderr
-	- pass "-dbg" option to x11vnc
-
-	* configure.in:
-	1.0.9-rc2 release
-
-2008-05-30	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ica/ica.qrc:
-	* ica/resources/el.ts:
-	* ica/resources/el.qm:
-	* setup/setup.qrc:
-	* setup/resources/el.ts:
-	* setup/resources/el.qm:
-	* lib/italc_core.qrc:
-	* lib/resources/el.ts:
-	* lib/resources/el.qm:
-	* ima/italc.qrc:
-	* ima/resources/el.ts:
-	* ima/resources/el.qm:
-	added Greek localization-files by Giorgos Nikolaidis
-
-2008-05-27	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/client.h:
-	* ima/src/classroom_manager.h:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	customized menus - user can hide existing client-menu items
-	and add own commands to the menu (added menu-element to personalconfig)
-
-2008-05-27	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/main_window.h:
-	* ima/src/kmultitabbar.cpp:
-	* ima/src/italc_side_bar.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/kmultitabbar.h:
-	* ima/src/italc_side_bar.h:
-	* ima/src/classroom_manager.cpp:
-	made visibility of individual sidebar-buttons configurable via
-	context-menu
-
-2008-05-26	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/client.h:
-	* ima/src/classroom_manager.h:
-	* ima/src/cmd_input_dialog.h:
-	* ima/src/client.cpp:
-	* ima/src/dialogs.h:
-	* ima/src/classroom_manager.cpp:
-	- added classes clientAction and clientMenu
-	- improved multiselection of clients and implemented
-	  execution of client actions on all selected items
-	- re-structured contextMenuRequest() of classmanager
-
-	* ima/src/classroom_manager.h:
-	* ima/src/classroom_manager.cpp:
-	- moved initialization of menus to setupMenus()
-	- simplified changeMode()
-	- removed m_domTree
-	- fixed show/hide menu action
-
-2008-05-24	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/remote_control_widget.cpp:
-	reverted hotfix from 2008-05-20
-
-	* lib/src/vncview.cpp:
-	Qt::WA_PaintOnScreen-property seems to have changed in Qt >= 4.4.0 so
-	that widgets with this property set can't have overlapping
-	sibling-widgets - so do not use this property anymore which fixes
-	with toolbar in remote-control view
-
-	* acinclude.m4:
-	when cross-compiling, use non-native Qt-development-tools (moc, uic)
-
-2008-05-21	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.cpp:
-	fixed mode-buttons in toolbar which were broken in 1.0.9-rc1
-
-2008-05-20	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/sk.qm:
-	* ica/resources/sk.ts:
-	* setup/resources/sk.ts:
-	* setup/resources/sk.qm:
-	* ima/resources/sk.ts:
-	* ima/resources/sk.qm:
-	* lib/resources/sk.ts:
-	* lib/resources/sk.qm:
-	updated Slovakian localization-files by Jan Valuska
-	<jvaluska/at/gymzv8rocne/dot/edu/dot/sk>
-
-	* ima/src/remote_control_widget.cpp:
-	hotfix for Qt >= 4.4.0 where toolbar didn't appear anymore
-
-	* ima/src/client.cpp:
-	fixed tray-menu-actions when main-window is minimized
-
-	* lib/src/isd_connection.cpp:
-	increased timeout again
-
-2008-05-09	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/ru.qm:
-	* ica/resources/ru.ts:
-	* setup/setup.qrc:
-	* setup/resources/ru.ts:
-	* setup/resources/ru.qm:
-	* ima/italc.qrc:
-	* ima/resources/ru.ts:
-	* ima/resources/ru.qm:
-	* lib/italc_core.qrc:
-	* lib/resources/ru.ts:
-	* lib/resources/ru.qm:
-	added Russian localization-files by Alexander Kazancev
-
-	* ima/resources/uk.ts:
-	* ima/resources/uk.qm:
-	updated Ukrainian localization-files by Yuri Chornoivan
-
-2008-05-06	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/main.cpp:
-	disabled stylesheet with Qt < 4.3
-
-	* ima/resources/fi.ts:
-	* ima/resources/fi.qm:
-	updated Finnish localization
-
-2008-05-05	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/it.qm:
-	* ima/resources/it.ts:
-	* setup/resources/it.qm:
-	* setup/resources/it.ts:
-	Updated Italian localization
-
-2008-05-04	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* build_mingw32:
-	build with -fno-strict-aliasing as compiling with MinGW-GCC < 4.3.0
-	can lead to miscompilations without this flag
-
-	* ima/src/main_window.cpp:
-	added exit()-call in main-window-destructor when building for win32 -
-	hack which fixes bug
-
-	* lib/src/isd_connection.cpp:
-	increased timeout when reading from socket
-
-	* ima/src/client.cpp:
-	changed color of active titlebar
-
-	* ica/src/isd_server.cpp:
-	* ima/italc.qrc:
-	* ima/src/tool_button.h:
-	* ima/src/main_window.h:
-	* ima/src/main.cpp:
-	* ima/src/classroom_manager.h:
-	* ima/src/tool_button.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/classroom_manager.cpp:
-	* ima/resources/tray-menu-bg.png:
-	* lib/include/isd_connection.h:
-	* lib/include/isd_base.h:
-	* lib/src/isd_connection.cpp:
-	added support for controlling master-application via system-tray-icon
-
-	* README.LZO:
-	* lib/include/lzodefs.h:
-	* lib/include/lzoconf.h:
-	* lib/include/minilzo.h:
-	* lib/src/minilzo.c:
-	updated miniLZO-library to version 2.03
-
-2008-05-03	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/win32/src/vncEncodeCoRRE.cpp:
-	included patch from TightVNC-bug-tracker
-
-2008-04-27	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/tool_button.h:
-	* ima/src/tool_button.cpp:
-	fixed tooltip flicker issue
-
-	* ima/dialogs/config.ui:
-	* ima/src/config_widget.h:
-	* ima/src/config_widget.cpp:
-	* ima/src/classroom_manager.cpp:
-	* ima/src/tool_button.h:
-	* ima/src/tool_button.cpp:
-	added option for making toolbar buttons only display icon
-
-	* ima/src/client.h:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	better shutdown on exit - hopefully fixes threading-problems
-
-	* ima/src/main_window.cpp:
-	fixed endless loop when initializing keys
-
-2008-04-23	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/ivs.cpp:
-	* ica/src/isd_server.cpp:
-	* lib/include/isd_base.h:
-	* lib/src/isd_base.cpp:
-	* ica/win32/win32vnc.cpp:
-	- renamed SocketGetIPBoundTo to SocketGetPeerAddress
-	- fixed demo-mode on Linux-clients by not adding host-names twice
-	  because of isdForwarder
-
-	* lib/src/local_system.cpp:
-	added patch by Ben Dailey <bdailey/at/bhmsd/dot/k12/dot/in/dot/us>
-	which adds dates and times to logfiles
-
-2008-04-21	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	* README:
-	made 1.0.8 release
-
-2008-04-21	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ima/resources/it.qm:
-	* ima/resources/it.ts:
-	* lib/resources/it.ts:
-	refreshed Italian localization
-
-2008-04-17	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/isd_server.cpp:
-	cleanups
-
-	* lib/src/isd_connection.cpp:
-	do not load key-file from empty filename
-
-	* lib/include/isd_connection.h:
-	* lib/src/isd_connection.cpp:
-	added gracefulClose() which should be used whereever possible as this
-	gracefully closes the connection instead of aborting it - avoids
-	SIGPIPE-signals
-
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	* ica/src/isd_server.cpp:
-	* ica/src/isd_server.h:
-	* ima/src/main_window.cpp:
-	* lib/include/isd_connection.h:
-	* lib/include/isd_base.h:
-	* lib/src/isd_connection.cpp:
-	rewrote the way, demo-servers are instantiated, started, stopped and
-	destroyed - hopefully fixes crashs when using demo-mode heavily
-
-	* lib/src/vncview.cpp:
-	update scaled-size as soon as we have a connection - fixes buggy
-	demo-mode and remote-control
-
-	* ica/src/isd_server.cpp:
-	* ima/dialogs/config.ui:
-	* ima/src/config_widget.cpp:
-	* ima/src/main_window.h:
-	* ima/src/main.cpp:
-	* ima/src/config_widget.h:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	* lib/include/isd_connection.h:
-	* lib/src/isd_connection.cpp:
-	determine demo-master-IP via active master-client connection -
-	obsoletes network-interface-configuration in master-application
-
-	* ima/src/cmd_input_dialog.cpp:
-	fixed orientation of OK- and cancel-button
-
-	* lib/src/isd_connection.cpp:
-	print connection-failure-messages via qDebug so that they normally do
-	not appear (closes #1945142)
-
-	* setup/resources/fr.qm:
-	* setup/resources/fr.ts:
-	* ima/resources/fr.ts:
-	* ima/resources/fr.qm:
-	* lib/resources/fr.qm:
-	* lib/resources/fr.ts:
-	updated French localization-files
-
-	* ima/resources/uk.ts:
-	* ima/resources/uk.qm:
-	updated Ukrainian localization-files
-
-2008-04-17	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/resources/fi.ts:
-	* ima/resources/fi.qm:
-	updated Finnish localization-files
-
-2008-04-17	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	*  ima/src/dialogs.cpp:
-	set default-focus on hostNameEdit
-
-2008-04-15	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/Makefile.am:
-	* ima/src/tool_bar.h:
-	* ima/src/tool_button.h:
-	* ima/src/classroom_manager.h:
-	* ima/src/tool_bar.cpp:
-	* ima/src/tool_button.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/classroom_manager.cpp:
-	- reintroduced align- and auto-arrange-buttons
-	- made visibility of individual toolbar-buttons configurable via
-	  context-menu
-
-	* ica/resources/cs.ts:
-	* ica/resources/pt_br.ts:
-	* ica/resources/fr.ts:
-	* ica/resources/es.ts:
-	* ica/resources/nn.ts:
-	* ica/resources/pl.ts:
-	* ica/resources/sl.ts:
-	* ica/resources/uk.ts:
-	* ica/resources/zh.ts:
-	* ica/resources/de.ts:
-	* setup/resources/fi.ts:
-	* setup/resources/cs.ts:
-	* setup/resources/pt_br.ts:
-	* setup/resources/uk.ts:
-	* setup/resources/fr.ts:
-	* setup/resources/nn.ts:
-	* setup/resources/pl.ts:
-	* setup/resources/it.ts:
-	* setup/resources/sl.ts:
-	* setup/resources/zh.ts:
-	* setup/resources/de.ts:
-	* ima/resources/pl.qm:
-	* ima/resources/it.qm:
-	* ima/resources/sl.qm:
-	* ima/resources/cs.ts:
-	* ima/resources/es.ts:
-	* ima/resources/zh.qm:
-	* ima/resources/sk.ts:
-	* ima/resources/uk.ts:
-	* ima/resources/cs.qm:
-	* ima/resources/es.qm:
-	* ima/resources/sk.qm:
-	* ima/resources/uk.qm:
-	* ima/resources/fr.ts:
-	* ima/resources/nn.ts:
-	* ima/resources/de.ts:
-	* ima/resources/fi.ts:
-	* ima/resources/fr.qm:
-	* ima/resources/nn.qm:
-	* ima/resources/pt_br.ts:
-	* ima/resources/de.qm:
-	* ima/resources/fi.qm:
-	* ima/resources/pt_br.qm:
-	* ima/resources/pl.ts:
-	* ima/resources/it.ts:
-	* ima/resources/sl.ts:
-	* ima/resources/zh.ts:
-	* lib/resources/cs.ts:
-	* lib/resources/pt_br.ts:
-	* lib/resources/es.ts:
-	* lib/resources/uk.ts:
-	* lib/resources/fr.ts:
-	* lib/resources/nn.ts:
-	* lib/resources/pl.ts:
-	* lib/resources/it.ts:
-	* lib/resources/sl.ts:
-	* lib/resources/zh.ts:
-	* lib/resources/de.ts:
-	refreshed localization-files
-
-2008-04-15	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/pt_br.ts:
-	* setup/resources/pt_br.ts:
-	* ima/resources/pt_br.ts:
-	* ima/resources/pt_br.qm:
-	* lib/resources/pt_br.ts:
-	updated Brazilian Portuguese localization-files
-
-	* ica/ica.qrc:
-	* ica/resources/sk.qm:
-	* ica/resources/sk.ts:
-	* setup/setup.qrc:
-	* setup/resources/sk.ts:
-	* setup/resources/sk.qm:
-	* ima/italc.qrc:
-	* ima/resources/pl.qm:
-	* ima/resources/sk.ts:
-	* ima/resources/sk.qm:
-	* ima/resources/pl.ts:
-	* lib/italc_core.qrc:
-	* lib/resources/sk.ts:
-	* lib/resources/sk.qm:
-	added Slovakian localization-files by Jan Valuska
-	<jvaluska/at/gymzv8rocne/dot/edu/dot/sk>
-
-	* ima/src/main.cpp:
-	fixed loading of country-specific localizations
-
-2008-04-11	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* classroom_manager.cpp:
-	* classroom_manager.h:
-	Fixed removing of child classroom (closes #1936559)
-	Improved addClassRoom.
-
-2008-04-11	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/dialogs/client_settings.ui:
-	* ima/src/main_window.h:
-	* ima/src/dialogs.cpp:
-	* ima/src/client.h:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	Name (nickname) of the client is now optional,
-	hostname (ip) is used as default (closes #1886578)
-
-2008-04-03	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/it.qm:
-	* ima/resources/it.ts:
-	updated Italian localization
-
-2008-04-03	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/classroom_manager.cpp:
-	drag'n'drop workaround for Qt bug #155700 (Qt < 4.3.4)
-
-2008-04-02	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/isd_connection.cpp:
-	made readFromServer() have a timeout - fixes hung processes/threads on
-	blocked connections (closes #1924390)
-
-	* lib/src/ivs_connection.cpp:
-	fill screen and scaled screen with black
-
-	* ima/src/client.cpp:
-	improved client-thread-destruction
-
-	* ima/src/main_window.cpp:
-	improved button-texts
-
-	* ima/src/classroom_manager.cpp:
-	* ima/src/classroom_manager.h:
-	- removed obsolete functions
-	- small optimizations by not using foreach
-
-	* ica/src/system_service.cpp:
-	use QString::toLocal8Bit() instead of QString::toUtf8() - hopefully
-	fixes #1898070
-
-	* ica/src/local_system_ica.cpp:
-	use SHTDN_REASON_MAJOR_OTHER instead of SHTDN_REASON_MAJOR_SYSTEM
-
-	* setup/src/dialogs.cpp:
-	- removed obsolete userinfo.exe
-	- misc fixes
-
-	* ima/src/italc_side_bar.cpp:
-	improved painting
-
-	* setup/src/dialogs.cpp:
-	* setup/src/dialogs.h:
-	fixed confirmation-dialog when closing setup-window via Alt+F4 or
-	close-button (closes #1912695)
-
-2008-04-02	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/classroom_manager.h:
-	* ima/src/classroom_manager.cpp:
-	drag and drop support for classroom manager (closes #1886602)
-
-	* ica/resources/fi.ts:
-	* lib/resources/fi.ts:
-	* ima/resources/fi.ts:
-	* ima/resources/fi.qm:
-	updated Finnish localization-files
-
-2008-03-31	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/include/vncview.h:
-	* lib/src/vncview.cpp:
-	fixed wrong mapping to framebuffer-coordinates
-
-	* lib/include/local_system.h:
-	* lib/src/local_system.cpp:
-	* ima/src/main_window.cpp:
-	always try to run demo-server on default-port 5858 - allows better
-	firewall-configuration in many places
-
-2008-03-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* italc.spec.in:
-	applied patch to build properly/better on recent openSUSE releases by  
-	Lars Vogdt <lars/at/linux-schulserve/dot/.de>
-
-2008-03-27	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/pt_br.qm:
-	* ica/resources/pt_br.ts:
-	* setup/setup.qrc:
-	* setup/resources/pt_br.ts:
-	* setup/resources/pt_br.qm:
-	* ima/italc.qrc:
-	* ima/resources/pt_br.ts:
-	* ima/resources/pt_br.qm:
-	* lib/italc_core.qrc:
-	* lib/resources/pt_br.ts:
-	* lib/resources/pt_br.qm:
-	integrated localization-files for Brazilian Portuguese by
-	Thomas Marques <thomasmarques/at/gmx/dot/net>
-
-	* ima/src/side_bar_widget.cpp:
-	* ima/src/tool_button.cpp:
-	some color-fine-tunings
-
-	* ima/src/client.cpp:
-	improved painting of title-bar
-
-2008-03-28	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* client.cpp:
-	client window if highlighted when selected
-
-	* classroom_manager.cpp:
-	* classroom_manager.h:
-	client window is zoomed when pressed on manager list
-
-2008-03-28	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/classroom_manager.cpp:
-	arrange order is based on classroom manager list
-
-2008-03-28	Andrei Krueger	<anc/at/iki/dot/fi>
-
-	* ima/src/kmultitabbar.cpp:
-	support for Qt 4.2
-	
-2008-03-27	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/vncview.cpp:
-	fixed wrong calculation in mapToFramebuffer in case screen is scaled
-
-2007-03-27	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ima/resources/it.ts:
-	* lib/resources/it.ts:
-	updated Italian localization
-
-2008-03-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/resources/pl.qm:
-	* setup/resources/pl.ts:
-	* ima/resources/pl.qm:
-	* ima/resources/pl.ts:
-	updated Polish localization-files by
-	Robert Radko <robert/at/radko/dot/pl>
-
-2008-03-21	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/tool_bar.h:
-	* ima/src/italc_side_bar.cpp:
-	* ima/src/tool_bar.cpp:
-	* ima/src/tool_button.cpp:
-	* ima/src/main_window.cpp:
-	improved appearence of toolbar and tool-buttons
-
-	* lib/include/vncview.h:
-	* lib/src/vncview.cpp:
-	in scaled view keep aspect ratio of screen and also do not expand
-	image if vncView-size > framebuffer-size
-
-2008-03-20	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	set user-name as tooltip if hostname is displayed in titlebar
-
-	* ima/resources/sidebar.png:
-	* ima/italc.qrc:
-	* ima/src/italc_side_bar.h:
-	* ima/src/side_bar_widget.cpp:
-	* ima/src/italc_side_bar.cpp:
-	improved appearence of left toolbar
-
-	* ima/src/main_window.h:
-	* ima/src/classroom_manager.h:
-	* ima/src/main_window.cpp:
-	* ima/src/classroom_manager.cpp:
-	- moved auto-rearrange and adjust-buttons from toolbar into
-	  classroom-menu
-	- show classroom-menu as context-menu of workspace-area
-	- removed support-workspace and added Direct-Support-button in toolbar
-	  instead
-	- use spacing=0 for main-layout which removes odd vertical bar between
-	  left toolbar and working-space
-
-	* ima/src/kmultitabbar.cpp:
-	* ima/src/kmultitabbar.h:
-	updated KMultiTabBar from KDE-SVN
-
-	* ima/src/support_widget.cpp:
-	* ima/src/support_widget.h:
-	* ima/Makefile.am:
-	removed support_widget.*
-
-	* ima/src/classroom_manager.h:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	applied patches by Andrei Krueger <anc/at/iki/dot/fi> which displays
-	host-name in client-windows if "show user"-name checkbox in
-	classroom-manager is not activated
-
-	* lib/src/lock_widget.cpp:
-	disable screen-saver while screen is locked (e.g. while fullscreen-demo)
-
-2008-03-19	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/fi.ts:
-	* ica/resources/fi.qm:
-	* setup/setup.qrc:
-	* setup/resources/fi.ts:
-	* setup/resources/fi.qm:
-	* ima/italc.qrc:
-	* ima/resources/fi.ts:
-	* ima/resources/fi.qm:
-	* lib/italc_core.qrc:
-	* lib/resources/fi.ts:
-	* lib/resources/fi.qm:
-	added Finnish localization-files by Andrei Krueger <anc/at/iki/dot/fi>
-
-2008-03-17	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/fast_qimage.cpp:
-	disabled MMX-optimized code on x86_64 for the time being as it crashes
-	sometimes - needs to be reviewed somewhen later
-
-	applied patches by Andrei Krueger <anc/at/iki/dot/fi>:
-
-	* configure.in:
-	* lib/src/vncview.cpp:
-	* ica/src/system_service.cpp:
-	* ima/src/client.cpp:
-	fixed compiler-warnings
-
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	added zoom-feature
-
-2008-03-10	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/fast_qimage.cpp:
-	fixed (superfluous) MMX detection on 64-bit-platforms
-
-2008-03-09	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* README:
-	* configure.in:
-	made 1.0.7 release
-
-2008-03-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/de.ts:
-	updated
-
-	* ima/dialogs/support.ui:
-	* ima/resources/remote_control_16.png:
-	* ima/resources/remote_control.png:
-	new icon and other UI-fixes
-
-	* ica/src/local_system_ica.cpp:
-	* ima/dialogs/overview.ui:
-	* ima/src/user_list.cpp:
-	* ima/src/classroom_manager.h:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	* ima/src/user_list.h:
-	* ima/src/classroom_manager.cpp:
-	* ima/Makefile.am:
-	applied patch by Andrei Krueger <anc/at/iki/dot/fi>:
-	- Merged userlist-view into classManager-view. Second column can show
-	  IP-address or username (selected by checkbox).  The computer name and
-	  IP are added to exported file.
-	- Moved actions submenus to the top of popup-menus
-
-2008-03-03	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/dialogs/client_settings.ui:
-	* ima/src/dialogs.cpp:
-	* ima/src/client.h:
-	* ima/src/main_window.cpp:
-	* ima/src/classroom_manager.cpp:
-	removed remoteIP-property as it's useless in current implementation
-
-	* ima/src/client.cpp:
-	use opaque painting again in order to perform well on older machines
-	too
-
-2008-03-03	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/classroom_manager.cpp:
-	fixed logon-feature from classroom-action-menu
-
-	* ima/src/main_window.cpp:
-	* lib/src/isd_connection.cpp:
-	in case user accidently changed role but no keys exist for this role
-	try teacher-role as fallback in order to make iTALC still usable in
-	such cases (Closes #1866440)
-
-	* italc.spec.in:
-	added missing library
-
-	* setup/resources/pl.qm:
-	* setup/resources/qt_pl.qm:
-	* setup/resources/pl.ts:
-	* ima/resources/pl.qm:
-	* ima/resources/qt_pl.qm:
-	* ima/resources/pl.ts:
-	fixes in Polish localization-files by
-	Robert Radko <robert/at/radko/dot/pl>
-
-2008-02-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/local_system_ica.cpp:
-	* lib/include/local_system.h:
-	* lib/src/local_system.cpp:
-	moved powerDown(), reboot() and logoffUser() to local_system_ica.cpp
-	and made those functions work when no user is logged on under Linux
-
-	* lib/src/vncview.cpp:
-	- fixed mapFromFramebuffer()-method
-	- fixed draw-position for cursor in scaled mode
-
-	* ica/src/demo_client.cpp:
-	* ima/src/remote_control_widget.cpp:
-	* lib/include/vncview.h:
-	* lib/src/vncview.cpp:
-	made progress-widget optional - do not use when remote-controlling to
-	speed things up
-
-	* ima/src/remote_control_widget.cpp:
-	scale logo (which is now rendered larger) to fit into toolbar
-
-	* lib/src/ivs_connection.cpp:
-	directly use fastQImage::scaleTo(...) rather than
-	fastQImage::scaled(...) to avoid creating temporary images
-
-	* lib/src/fast_qimage.cpp:
-	check for format() == Format_Invalid and handle properly
-
-	* lib/include/fast_qimage.h:
-	* lib/src/fast_qimage.cpp:
-	in fastQImage::scaleTo(...) return reference to destination image for
-	convenience
-
-2008-02-25	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/pl.qm:
-	* ica/resources/pl.ts:
-	* setup/setup.qrc:
-	* setup/resources/pl.qm:
-	* setup/resources/pl.ts:
-	* ima/italc.qrc:
-	* ima/resources/pl.qm:
-	* ima/resources/pl.ts:
-	* lib/italc_core.qrc:
-	* lib/resources/pl.qm:
-	* lib/resources/pl.ts:
-	added Polish localization-files by Robert Radko <robert/at/radko/dot/pl>
-
-	* ima/src/client.cpp:
-	less transparency
-
-2008-02-25	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/resources/page_artwork_welcome.png:
-	* ima/italc.qrc:
-	* ima/dialogs/client_settings.ui:
-	* ima/src/cmd_input_dialog.cpp:
-	* ima/data/italc.png:
-	* ima/data/italc.xpm:
-	* ima/data/italc.ico:
-	* ima/resources/demoquality.png:
-	* ima/resources/client_settings.png:
-	* ima/resources/info_22.png:
-	* ima/resources/viewmag.png:
-	* ima/resources/no_user.png:
-	* ima/resources/adjust_size.png:
-	* ima/resources/apply.png:
-	* ima/resources/client_add.png:
-	* ima/resources/reboot.png:
-	* ima/resources/client_remove.png:
-	* ima/resources/client_visible.png:
-	* ima/resources/clock.png:
-	* ima/resources/config.png:
-	* ima/resources/host_unreachable.png:
-	* ima/resources/classroom_manager_48.png:
-	* ima/resources/client-properties.png:
-	* ima/resources/ok.png:
-	* ima/resources/classroom_add.png:
-	* ima/resources/client.png:
-	* ima/resources/client_show.png:
-	* ima/resources/whatsthis.png:
-	* ima/resources/classroom_remove.png:
-	* ima/resources/tutorials.png:
-	* ima/resources/error.png:
-	* ima/resources/info.png:
-	* ima/resources/classroom_manager.png:
-	* ima/resources/logo.png:
-	* ima/resources/classroom_show.png:
-	* ima/resources/overview_mode.png:
-	* ima/resources/cancel.png:
-	* ima/resources/power_off.png:
-	* ima/resources/help.png:
-	* ima/resources/back.png:
-	* ima/resources/locked.png:
-	* ima/resources/fullscreen.png:
-	* ima/resources/toolbar.png:
-	* ima/resources/run.png:
-	* ima/resources/config_48.png:
-	* ima/resources/quit.png:
-	* ima/resources/client_hidden.png:
-	* ima/resources/splash.png:
-	* lib/src/lock_widget.cpp:
-	* lib/resources/icon22.png:
-	* lib/resources/locked_bg.png:
-	* lib/resources/icon32.png:
-	* lib/resources/icon16.png:
-	* lib/resources/ok.png:
-	* lib/resources/info.png:
-	- improved graphics to have one consistent theme and fixed wrong
-	  resource-references
-	- updated logo
-
-	* lib/src/fast_qimage.cpp:
-	added check for valid destination-size
-
-	* ima/src/main_window.h:
-	* ima/src/client.h:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	- wrote own workspace- and workspace-window-concept which looks much
-	  cooler, provides a simpler UI and allows to have bigger
-	  preview-windows
-	- rewrote painting-code for client-windows
-	- improved auto-rearranger
-
-2008-02-23	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	instantly rescale screen after change of window-size
-
-	* lib/include/ivs_connection.h:
-	return shallow QImage-copy instead of reference to image which isn't
-	protected by read-lock after leaving scaledScreen()-method - fixes
-	crashes under rare circumstances where image has been drawn while
-	being rescaled
-
-	* lib/include/ivs_connection.h:
-	* lib/src/ivs_connection.cpp:
-	* lib/include/vncview.h:
-	* lib/src/vncview.cpp:
-	added support for scaled view to vncView-class
-
-	* lib/src/fast_qimage.cpp:
-	replaced old slow image-scaling code with fast new one - if available,
-	MMX-optimized version is being used which makes things even faster -
-	fixes unresponsive master-workstations when overviewing a lot of
-	clients
-
-2008-02-10	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.6 release
-
-	* lib/Makefile.am:
-	* ica/Makefile.am:
-	* ima/Makefile.am:
-	install libitalc_core.so to /usr/lib/italc/ instead of /usr/lib/
-
-	* lib/src/vncview.cpp:
-	make Backtab (i.e. Shift+Tab) work properly in remote-control (closes
-	#1889307)
-
-	* README.LZO:
-	* lib/include/lzodefs.h:
-	* lib/include/lzoconf.h:
-	* lib/include/minilzo.h:
-	* lib/src/minilzo.c:
-	* lib/Makefile.am:
-	updated from version 1.08 to 2.02 which fixes random crashes on
-	64-bit-platforms
-
-	* ica/src/demo_server.cpp:
-	use correct type (lzo_uint) for bytes-lzo-parameter when calling
-	lzo1x_1_compress - fixes possible problems on 64-bit-platforms
-
-	* lib/src/local_system.cpp:
-	* ica/src/ica_main.cpp:
-	* ica/src/ivs.cpp:
-	* ica/src/system_service.cpp:
-	* ica/src/isd_server.cpp:
-	* ima/src/classroom_manager.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/user_list.cpp:
-	replaced QString::toAscii() with QString::toUtf8()
-
-	* lib/src/messagebox.cpp:
-	check for GUI-thread-affinity and only show message in logfile/console
-	in case we're not in GUI-thread - fixes various crashes
-
-	* ica/src/isd_server.cpp:
-	fixed host-based authentication in such a way that it works for
-	ThinClient-environments as well as when ports other than 5900 are used
-	for IVS (i.e. -ivsport has been used) - fixes non-working-demo in
-	these scenarios
-
-	* lib/src/ivs_connection.cpp:
-	when deflating compressed data, handle num_rows = 0, i.e. do not call
-	m_screen.copyRect()
-
-	* lib/include/fast_qimage.h:
-	in fastQImage::copyRect() handle case when height of rect is zero
-	instead of calling QImage::scanLine() with invalid parameter - fixes
-	frequent crashes of IMA!
-
-	* ica/src/isd_server.cpp:
-	moved initialization of IVS-server to end of isdServer-constructor so
-	that correct isdport-parameter is passed to IVS-sub-processes
-
-2008-02-09	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/include/rect_list.h:
-	* lib/src/rect_list.cpp:
-	removed
-
-	* lib/include/isd_base.h:
-	* lib/include/qt_user_events.h:
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	- replaced own rectList-implementation by QRegion
-	- fixed endianess-problems of demo-mode
-
-	* ima/src/classroom_manager.cpp:
-	hide item before pushing client into remove-list
-
-	* lib/include/ivs_connection.h:
-	* lib/src/ivs_connection.cpp:
-	- moved ivsConnection::s_localDisplayFormat to static
-	  __localDisplayFormat-struct
-	- fixed broken gradient-filter of tight-encoding
-	- fixed missing parentheses in pixel-calculation in tight-encoding
-	- when handling jpeg-data, dynamically allocate memory instead of
-	  using the stack in a non-standard way
-	- fixed color-conversion when handling X-cursor
-	- fixed frequent crash of demo-mode by adding additional check in
-	  ivsConnection::handleItalc(...) which avoids calling
-	  QImage::scanLine() with an invalid parameter and thus raising a
-	  Qt-internal assertion (closes #1849671)
-
-	* lib/resources/*.ts:
-	* lib/resources/*.qm:
-	* ica/resources/*.ts:
-	* ica/resources/*.qm:
-	* ima/resources/*.ts:
-	* ima/resources/*.qm:
-	refreshed localization files, included updates of Spanish localization
-	by <schoolboy/at/ole/dot/com>
-
-2008-02-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.6-rc1 release
-
-	* ica/x11/x11vnc/xrandr.c:
-	* ica/x11/x11vnc/userinput.c:
-	* ica/x11/x11vnc/macosx.h:
-	* ica/x11/x11vnc/xwrappers.h:
-	* ica/x11/x11vnc/keyboard.c:
-	* ica/x11/x11vnc/options.h:
-	* ica/x11/x11vnc/xrandr.h:
-	* ica/x11/x11vnc/userinput.h:
-	* ica/x11/x11vnc/xinerama.c:
-	* ica/x11/x11vnc/keyboard.h:
-	* ica/x11/x11vnc/util.c:
-	* ica/x11/x11vnc/user.c:
-	* ica/x11/x11vnc/8to24.c:
-	* ica/x11/x11vnc/winattr_t.h:
-	* ica/x11/x11vnc/connections.c:
-	* ica/x11/x11vnc/user.h:
-	* ica/x11/x11vnc/macosxCGP.c:
-	* ica/x11/x11vnc/avahi.c:
-	* ica/x11/x11vnc/xevents.c:
-	* ica/x11/x11vnc/avahi.h:
-	* ica/x11/x11vnc/xevents.h:
-	* ica/x11/x11vnc/macosxCG.c:
-	* ica/x11/x11vnc/macosxCG.h:
-	* ica/x11/x11vnc/win_utils.c:
-	* ica/x11/x11vnc/cursor.c:
-	* ica/x11/x11vnc/rates.c:
-	* ica/x11/x11vnc/x11vnc_defs.c:
-	* ica/x11/x11vnc/cursor.h:
-	* ica/x11/x11vnc/gui.c:
-	* ica/x11/x11vnc/scan.c:
-	* ica/x11/x11vnc/tkx11vnc.h:
-	* ica/x11/x11vnc/uinput.c:
-	* ica/x11/x11vnc/selection.c:
-	* ica/x11/x11vnc/scan.h:
-	* ica/x11/x11vnc/unixpw.c:
-	* ica/x11/x11vnc/remote.c:
-	* ica/x11/x11vnc/allowed_input_t.h:
-	* ica/x11/x11vnc/unixpw.h:
-	* ica/x11/x11vnc/screen.c:
-	* ica/x11/x11vnc/x11vnc.c:
-	* ica/x11/x11vnc/pointer.c:
-	* ica/x11/x11vnc/screen.h:
-	* ica/x11/x11vnc/x11vnc.h:
-	* ica/x11/x11vnc/pointer.h:
-	* ica/x11/x11vnc/ssltools.h:
-	* ica/x11/x11vnc/macosxCGS.c:
-	* ica/x11/x11vnc/macosxCGS.h:
-	* ica/x11/x11vnc/sslhelper.c:
-	* ica/x11/x11vnc/v4l.c:
-	* ica/x11/x11vnc/sslhelper.h:
-	* ica/x11/x11vnc/xdamage.c:
-	* ica/x11/x11vnc/xrecord.c:
-	* ica/x11/x11vnc/nox11_funcs.h:
-	* ica/x11/x11vnc/solid.c:
-	* ica/x11/x11vnc/xdamage.h:
-	* ica/x11/x11vnc/pm.c:
-	* ica/x11/x11vnc/solid.h:
-	* ica/x11/x11vnc/pm.h:
-	* ica/x11/x11vnc/cleanup.c:
-	* ica/x11/x11vnc/params.h:
-	* ica/x11/x11vnc/help.c:
-	* ica/x11/x11vnc/macosx.c:
-	* ica/x11/x11vnc/options.c:
-	* ica/x11/x11vnc/xwrappers.c:
-	* ica/x11/x11vnc.c:
-	* ica/x11/libvncserver/stats.c:
-	* ica/x11/libvncserver/zrle.c:
-	* ica/x11/libvncserver/rfbserver.c:
-	* ica/x11/libvncserver/cursor.c:
-	* ica/x11/libvncserver/httpd.c:
-	* ica/x11/libvncserver/main.c:
-	* ica/x11/libvncserver/zrleencodetemplate.c:
-	* ica/x11/libvncserver/scale.c:
-	* ica/Makefile.am:
-	* lib/include/rfb/rfb.h:
-	* lib/include/rfb/rfbproto.h:
-	* lib/include/rfb/rfbclient.h:
-	* lib/Makefile.am:
-	integrated latest release of x11vnc (0.9.4)
-
-	* ima/italc.1:
-	updated manpage
-
-	* ima/src/main.cpp:
-	* ima/src/main_window.cpp:
-	added -isdport-option in order to connect to a different local ISD
-	(e.g. for LTSP-environments)
-
-	* ica/src/local_system_ica.cpp:
-	when retrieving user-name, construct QString using QString::fromUtf8()
-	which fixes encoding problems in user-names
-
-	* lib/src/local_system.cpp:
-	fixed shutdown, reboot and logoff methods for KDE and GNOME
-
-	* lib/src/isd_connection.cpp:
-	- fixed broken authentication-type rfbNoAuth
-	- include port-number in warning
-
-	* lib/include/types.h:
-	made typedefs for 32-bit-integers more specific
-
-	* configure.in:
-	cleanups
-
-	* ica/src/ivs.cpp:
-	fixed missing pe.pseudoEncoding-NULL-initialization which lead to
-	crash on several platforms
-
-	* ica/src/isd_server.cpp:
-	fixed too small array-sizes
-
-	* configure.in:
-	added -fPIC-flag to make everything compile well on x86_64
-
-2008-01-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.cpp:
-	* ima/src/main.cpp:
-	fixed "-screen"-parameter for virtual desktops
-
-2008-01-29	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.5 release
-
-	* README:
-	* ima/dialogs/about.ui:
-	* ima/resources/splash.png:
-	extended copyright-notice from 2007 to 2008
-
-	* lib/include/local_system.h:
-	* lib/src/local_system.cpp:
-	* setup/src/dialogs.cpp:
-	- use Win32-API for determining program-files folder (closes #1846814)
-	- use %temp% and %tmp% environment-variables instead of C:\temp if
-	  possible (closes #1879580)
-
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	* ima/src/main.cpp:
-	added "-screen"-argument which makes it possible to specify which
-	screen the remote-control-window should be displayed on
-
-	* ica/ica.rc.in:
-	* ima/italc.rc.in:
-	fixed FILEVERSION-info-tag
-
-	* ica/Makefile.am:
-	made ICA a non-console-application in order to make it usable when
-	running as normal application instead of service
-
-	* COPYING:
-	* lib/include/dsa_key.h:
-	* lib/src/dsa_key.cpp:
-	added permission to link iTALC against OpenSSL library
-
-	* ima/resources/uk.qm:
-	* ima/resources/uk.qm:
-	updated Ukrainian localization
-
-2008-01-14	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/uk.qm:
-	* ica/resources/uk.ts:
-	* setup/setup.qrc:
-	* setup/resources/uk.qm:
-	* setup/resources/uk.ts:
-	* ima/italc.qrc:
-	* ima/resources/uk.qm:
-	* ima/resources/uk.qm:
-	* lib/italc_core.qrc:
-	* lib/resources/uk.qm:
-	* lib/resources/uk.ts:
-	added Ukrainian localization-files by Yuri Chornoivan
-	<yurchor/at/ukr/dot/net>
-
-2008-01-14	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/classroom_manager.cpp:
-	fixed typo
-
-2007-12-23	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/cs.qm:
-	* ica/resources/cs.ts:
-	* setup/setup.qrc:
-	* setup/resources/cs.qm:
-	* setup/resources/cs.ts:
-	* ima/italc.qrc:
-	* ima/resources/cs.qm:
-	* ima/resources/cs.qm:
-	* lib/italc_core.qrc:
-	* lib/resources/zh.qm:
-	* lib/resources/zh.ts:
-	added Czech localization-files by Martin Sin
-	<martin/dot/sin/at/zshk/dot/cz>
-
-2007-11-24	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.4 release
-
-	* ima/src/client.cpp:
-	- change to overview-mode before quitting update-thread
-	- at exit properly close connection inside update-thread and flush
-	  the event-queue before
-
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	stripped out mainWindow-update-thread into separate class (instead of
-	nested class) - now the update-thread is event-loop/timer-based which
-	allows further fixes of lockups and other optimizations
-
-	* ica/src/demo_client.cpp:
-	fixed non-working window-demo under win32 (a certain size has to be
-	set for a window before it is shown)
-
-	* lib/src/lock_widget.cpp:
-	use QApplication's desktop-widget instead of creating a new one
-
-	* ica/src/ivs.cpp:
-	run IVS in separate process again
-
-	* setup/src/dialogs.cpp:
-	- add ICA as an exception-application for windows-firewall
-	- when user chose to keep keys do not show key-directory-page
-
-	* Makfile.am:
-	improved win32-packaging
-
-	* acinclude.m4:
-	added more Qt4-search-paths
-
-	* lib/src/vncview.cpp:
-	- do not set Qt::WA_PaintOnScreen-attribute on win32 as it causes
-	  painting errors (although Qt-docs say that this flag has no effect on
-	  win32!) in VNC-views
-	- increased framebuffer-update-interval from 20 to 25 ms
-	- use QTimer-timeout-signals instead of recursive QTimer-singleshots
-	  (fixes lockups on unreachable hosts etc.)
-
-	* lib/src/ivs_connection.cpp:
-	re-enabled CopyRect-encoding
-
-	* lib/include/ivs_connection.h:
-	re-enabled read-locker for screen-image
-
-	* ima/src/3rdparty/qnetworkinterface_win.cpp:
-	* ima/src/3rdparty/qnetworkinterface.h:
-	* ima/src/3rdparty/qnetworkinterface_p.h:
-	* ima/src/3rdparty/qnetworkinterface.cpp:
-	* ima/src/3rdparty/qnetworkinterface_win_p.h
-	* ima/src/3rdparty/qnetworkinterface_unix.cpp:
-	* ima/src/qnetworkinterface.cpp:
-	* ima/src/qnetworkinterface.h:
-	removed as not needed anymore
-
-	* lib/include/qt_features.h:
-	* ica/src/isd_server.cpp:
-	* ima/src/config_widget.cpp:
-	* ima/src/client.cpp:
-	* setup/src/dialogs.cpp:
-	removed support for Qt < 4.2.0
-
-	* build_mingw32:
-	added generic-tune parameter (new in GCC 4.2.x)
-
-	* README:
-	updated
-
-2007-10-11	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/zh.qm:
-	* ica/resources/zh.ts:
-	* setup/setup.qrc:
-	* setup/resources/qt_zh.qm:
-	* setup/resources/zh.qm:
-	* setup/resources/zh.ts:
-	* ima/italc.qrc:
-	* ima/resources/qt_zh.qm:
-	* ima/resources/zh.qm:
-	* ima/resources/zh.ts:
-	* lib/italc_core.qrc:
-	added Chinese localization-files
-
-	* ima/src/classroom_manager.cpp:
-	when saving XML-file use toUtf8() instead of toAscii() for solving
-	problems with different locales
-
-2007-09-16	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/src/main.cpp:
-	when running auto-setup from UNC-path and specifying relative path to
-	XML-file do not fail (because of bug or so in QFile) by making path to
-	XML-file absolute
-
-	* setup/src/dialogs.cpp:
-	- only run net-command in win32-version
-	- when upgrading, only sleep 3 seconds since the systray-bug has been
-	  fixed a while ago
-
-	* ica/src/system_service.cpp:
-	do not show message about already registered service when running in
-	quiet-mode
-
-	* ima/data/italc.in:
-	changed from section "Apps" to "Applications"
-
-	* configure.in:
-	removed orphaned reference to utils-win32/Makefile.in
-
-2007-09-15	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/local_system.cpp:
-	fixed code which replaced duplicate dir-separators - made things not
-	work on network-shares ("\\...") under win32
-
-2007-09-02	Iztok <Iztok/dot/osredkar/at/guest/dot/arnes/dot/si>
-
-	* ica/resources/sl.qm:
-	* ica/resources/sl.ts:
-	* ima/resources/sl.qm:
-	* ima/resources/sl.ts:
-	* lib/resources/sl.qm:
-	* lib/resources/sl.ts:
-	* setup/resources/sl.qm:
-	* setup/resources/sl.ts:
-	added Slovenian localization-files
-
-2007-08-02	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-	* ica/resources/it.ts:
-	* lib/resources/it.ts:
-	updated Italian localization
-
-2007-07-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/win32/src/VNCHooks/SharedData.cpp:
-	* ica/src/local_system_ica.cpp:
-	* ica/Makefile.am:
-	* lib/include/messagebox.h:
-	* lib/include/local_system.h:
-	* lib/include/isd_base.h:
-	* lib/src/inject.cpp:
-	more fixes and improvements for compiling (and working!!) with
-	GCC 4.2 - has been a mess to find out that now we need
-	--enable-auto-image-base flag when linking vnchooks.dll because
-	otherwise ICA won't even start under win32
-
-	* ica/src/ica_main.cpp:
-	* ica/src/system_service.cpp:
-	* ica/Makefile.am:
-	* lib/Makefile.am:
-	removed some more LUPUS-references
-
-2007-07-28	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/dsa_key.cpp:
-	do not use QFile::handle() with Qt >= 4.3.0 under win32 as it always
-	returns -1, use fopen() instead
-
-	* lib/src/local_system.cpp:
-	fixed wrong code for line-endings in log files
-
-	* ica/win32/win32vnc.cpp:
-	* lib/src/system_key_trapper.cpp:
-	* lib/src/isd_connection.cpp:
-	re-ordered win32-header-inclusion to fix some compile errors with
-	recent GCC versions
-
-	* lib/src/ivs_connection.cpp:
-	* lib/include/ivs_connection.h:
-	post regionChangedEvent in separate method (i.e. use postEvent instead
-	of sendEvent as sendEvent is not thread-safe and produces
-	Qt-assertions)
-
-	* lib/src/vncview.cpp:
-	* lib/include/vncview.h:
-	close connection in destructor vncWorker-class - fixes assertions with
-	Qt >= 4.3.0
-
-	* Makefile.am:
-	* ica/Makefile.am:
-	* ica/src/local_system_ica.cpp:
-	moved code from userinfo.cpp here
-
-	* ica/src/ivs.cpp:
-	do not run IVS in separate process anymore (to be tested)
-
-	* ica/win32/src/VideoDriver.cpp:
-	fixed compiler warning
-
-	* utils-win32/userinfo.cpp:
-	fixed uninitialized pointer and improved some casts - fixes
-	non-working code when compiling with GCC 4.x
-
-	* configure.in:
-	use -fPIC as compiler flag per default
-
-	* lib/Makefile.am:
-	added -soname-flag to linker flags for not having shared library
-	without SONAME-entry
-
-	* ica/Makefile.am:
-	* ima/Makefile.am:
-	* setup/Makefile.am:
-	* lib/Makefile.am:
-	use $(RCC)-variable instead of rcc - fixes some compilation errors on
-	several platforms/distributions
-
-	* acinclude.m4:
-	- added some more Qt4-search-paths and removed deprecated ones
-	- cleaned up a lot all the Qt4-detection code and made ready for
-	  64 bit platforms
-	- also check for Qt's rcc-utility
-	- fixed typos in lrelease and lupdate-detection
-
-2007-07-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/ica_main.cpp:
-	include version-info in tooltip of system-tray-icon
-
-	* lib/include/system_key_trapper.h:
-	* lib/src/system_key_trapper.cpp:
-	* lib/src/lock_widget.cpp:
-	win32: disable *all* keys while screen is being locked
-
-2007-07-04	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* Makefile.svn:
-	removed LUPUS-references
-
-	* utils-win32/userinfo.cpp:
-	more error-handling
-
-	* lib/src/dsa_key.cpp:
-	applied patch from Diego J. Brengi <brengi/at/inti/dot/gov/dot/ar> for
-	also accepting keys that were generated using ssh-keygen
-
-2007-06-09	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* lib/resources/it.ts:
-	* lib/resources/it.qm:
-	updated Italian localization and removed obsolete
-	translations
-
-2007-06-04	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.3 release
-
-	* lib/Makefile.am:
-	fixed missing SOURCE-entry for italc_core.dll
-
-	* ica/win32/src/Log.h:
-	* ica/win32/src/Log.cpp:
-	* lib/include/local_system.h:
-	* lib/src/local_system.cpp:
-	made log-level of WinVNC being equal to iTALC log-level
-
-	* ica/src/isd_server.cpp:
-	use QProcess::startDetached() instead of QProcess::start() for
-	launching commands
-
-	* ima/src/classroom_manager.h:
-	* ima/src/classroom_manager.cpp:
-	* ima/src/client.cpp:
-	* ima/src/dialogs.cpp:
-	* ima/src/dialogs.h:
-	renamed class multiLogonDialog to remoteLogonDialog
-
-	* ima/dialogs/multi_logon.ui:
-	* ima/artwork/multilogon*png:
-	renamed to "remotelogon*"
-
-2007-06-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	stop demo on clients after student showed demo
-
-	* ica/src/ica_main.cpp:
-	create QSystemTrayIcon-object on stack rather than heap for being
-	destroyed properly at exit - fixes problem with non-disappearing icon
-	after exit on win32
-
-2007-05-30	Dirk Zoellner <dirkzoellner/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.cpp:
-	* ima/src/main_window.h:
-	added fullscreen-functionality via F11
-
-	* ima/src/classroom_manager.cpp:
-	- save window-position in personal-config, move to (0,0) if no items
-	  in configuration exist
-	- set sane default-size for main-window if no according configuration
-	  exists
-	- in client-treeview display remote IP of client rather local IP
-
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/main_window.cpp:
-	apply API-changes of toolButton-class
-
-	* ima/src/tool_button.cpp:
-	* ima/src/tool_button.h:
-	added alternative label functionality
-
-2007-05-26	Dirk Zoellner <dirkzoellner/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/dialog.cpp:
-	changed clientsettings-dialog, always focus on name, only for
-	convenience purposes
-
-2007-05-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/isd_connection.cpp:
-	re-activated old connectToHost-method and added support for
-	non-blocking connect etc.
-
-2007-05-25	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* italc/ica.qrc:
-	* lib/italc_core.qrc:
-	* setup/ica.qrc:
-	added Norwegian localization-files
-
-2007-05-24	Asbj�rn Stokka <asbjorn/dot/stokka/at/lyse/dot/net>
-
-	* ica/resources/nn.ts:
-	* ica/resources/nn.qm:
-	* ima/resources/nn.ts:
-	* ima/resources/nn.qm:
-	* lib/resources/nn.ts:
-	* lib/resources/nn.qm:
-	* setup/resources/nn.ts:
-	* setup/resources/nn.qm:
-	added Norwegian localization
-
-2007-05-21	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* lib/resources/it.ts:
-	* lib/resources/it.qm:
-	* setup/resources/it.ts:
-	* setup/resources/it.qm:
-	updated Italian localization to svn 180 and removed obsolete
-	translations
-
-2007-05-20	Dirk Zoellner <dirkzoellner/at/users/dot/sourceforge/dot/net>
-	
-	* lib/src/local_system.cpp:
-	- modified log-system to work with loglevels
-	- changed log-directory to /tmp resp. C:\temp
-
-	* setup/src/dialogs.cpp:
-	- added key for loglevel: 0 silent, 2 fatal, 4 critical, 6 warning,
-	  9 debug, default is 6 
-	
-2007-05-20	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/Makefile.am:
-	mention DLL as library so that it gets removed on "make clean"
-
-2007-05-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/dialogs/client_settings.ui:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	- fixed/improved some texts/descriptions ("client" -> "computer")
-	- added "hide-teacher-computers"-function to context-menu of classrooms
-	
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	updated German localization
-
-2007-05-17	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/fr.ts:
-	* ica/resources/fr.qm:
-	* ima/resources/fr.ts:
-	* ima/resources/fr.qm:
-	* lib/resources/fr.ts:
-	* lib/resources/fr.qm:
-	* setup/resources/fr.ts:
-	* setup/resources/fr.qm:
-	updated French localization from Guillaume Allegre
-	(guillaume/dot/allegre/at/silecs/dot/info)
-
-	* ima/src/remote_control_widget.h:
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	reload snapshot-list after taking snapshot in remote-control-/
-	view-live-mode
-
-	* lib/src/dsa_key.cpp:
-	fixed case where ICA would quit on authentication with bad signed data
-
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	updated German localization
-
-	* ima/src/classroom_manager.cpp:
-	* ima/src/classroom_manager.h:
-	added "hide teacher-clients"-feature in classroom-menu
-
-	* ima/resources/greenled.png:
-	* ima/italc.qrc:
-	* ima/src/classroom_manager.cpp:
-	highlight current classroom in classroom-menu
-
-	* ima/dialogs/client_settings.ui:
-	* ima/src/dialogs.cpp:
-	* ima/src/classroom_manager.cpp:
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	added "type"-property to clients to have another distinction between
-	different clients
-
-	* ima/src/classroom_manager.cpp:
-	* ima/src/client.cpp:
-	* ima/src/client.h:
-	more clear identifiers in enums
-
-	* ima/src/classroom_manager.cpp:
-	* ica/src/ica_main.cpp:
-	cleanups
-
-	* ica/src/local_system_ica.cpp:
-	fixed compiling error
-
-2007-05-14	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/mouse.png:
-	removed
-
-	* ima/italc.qrc:
-	* ima/resources/no_mouse.png:
-	* ima/src/remote_control_widget.cpp:
-	better icon for blocked input
-
-	* lib/include/isd_base.h:
-	cleanups
-
-	* ica/win32/src/VNCHooks/SharedData.h:
-	* ica/win32/src/VNCHooks/SharedData.cpp:
-	* ica/win32/src/VNCHooks/VNCHooks.cpp:
-	* ica/win32/src/vncServer.cpp:
-	* ica/src/local_system_ica.h:
-	* ica/src/local_system_ica.cpp:
-	* ica/src/isd_server.cpp:
-	* ima/src/remote_control_widget.h:
-	* ima/src/remote_control_widget.cpp:
-	* lib/include/isd_base.h:
-	* lib/include/isd_connection.h:
-	* lib/src/isd_connection.cpp:
-	implemented "lock student"-functionality in remote-control
-
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	do not freeze client-update-threads while remote-control is running
-	and do nothing instead - fixes several bugs such as non-working
-	student-demo etc.
-
-	* ica/src/isd_server.cpp:
-	when doing ItalcAuthChallengeViaAuthFile-authentication, flush
-	temporary file before requesting response
-
-2007-05-11	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* Makefile.svn:
-	fixed automake-call to ignore warnings
-
-	* setup/Makefile.am:
-	link Linux-version against static version of library
-
-	* lib/Makefile.am:
-	fixed missing resource-file-object in shared library
-
-	* lib/resources/de.ts:
-	* lib/resources/de.qm:
-	updated German localization
-
-2007-05-10	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* Makefile.svn:
-	ignore errors (which are not real errors) from automake
-
-	* lib/src/ivs_connection.cpp:
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/remote_control_widget.h:
-	display user-name in toolbar - closes #1711333
-
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/remote_control_widget.h:
-	added snapshot-functionality in remote-control/view-live mode
-
-	* lib/include/ivs_connection.h:
-	* lib/src/ivs_connection.cpp:
-	* ima/src/client.cpp:
-	moved snapshot-functionality into ivsConnection-class
-
-	* ica/win32/src/vncDesktop.cpp:
-	* ica/win32/win32vnc.cpp:
-	disabled TightVNC's new terminal-session-support
-
-	* setup/src/dialogs.cpp:
-	when copying file add absolute paths to source-file-names
-	closes #1704173
-
-2007-05-07	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	better Italian translation of supporter-role
-
-2007-05-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/Makefile.am:
-	make library being installed at proper place under Linux
-
-2007-05-02	Dirk Zoellner <dirkzoellner/at/users/dot/sourceforge/dot/net>
-
-	* build_mingw32:
-	works now without modifying PATH-variable
-	
-2007-05-02	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ica/resources/it.qm:
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* lib/resources/it.ts:
-	* lib/resources/it.qm:
-	* setup/resources/it.ts:
-	* setup/resources/it.qm:
-	updated Italian localization and removed obsolete translations
-
-2007-05-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/src/local_system.cpp:
-	use "halt" rather than "poweroff" for halting Linux-systems
-
-	* ima/src/classroom_manager.cpp:
-	sort items in ascending order per default
-
-	* ica/win32/src/vncEncodeRRE.cpp:
-	* ica/win32/src/VSocket.cpp:
-	* ica/win32/src/vncDesktop.cpp:
-	* ica/win32/src/VideoDriver.cpp:
-	* ica/win32/src/vncEncoder.cpp:
-	* ica/win32/src/vncRegion.cpp:
-	* ica/win32/src/vncService.cpp:
-	* ica/win32/src/vncKeymap.cpp:
-	* ica/win32/src/vncEncodeHexT.cpp:
-	* ica/win32/src/vncClient.cpp:
-	fixes & cleanups to compile without any warnings at all
-
-	* ica/win32/src/vncServer.h:
-	* ica/win32/src/vncServer.cpp:
-	* ica/win32/src/vncDesktop.cpp:
-	* ica/win32/src/TsSessions.h:
-	* ica/win32/src/TsSessions.cpp:
-	* ica/win32/src/DynamicFn.cpp:
-	* ica/win32/src/DynamicFn.h:
-	* ica/win32/src/resource.cpp:
-	* ica/win32/win32vnc.cpp:
-	* ica/Makefile.am:
-	merged changes from TightVNC-upstream
-
-2007-04-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/Makefile.am:
-	fixed variable-name
-
-	* ica/ica.1:
-	* ima/italc.1:
-	updated manpages
-
-2007-04-29	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/Makefile.am:
-	fixed variable-name
-
-	* lib/src/vncview.cpp:
-	show local cursor when only viewing
-
-	* ica/src/demo_client.cpp:
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/remote_control_widget.h:
-	* lib/include/system_key_trapper.h:
-	* lib/include/vncview.h:
-	* lib/src/system_key_trapper.cpp:
-	* lib/src/vncview.cpp:
-	made view-only-property of vncView-class switchable and added button
-	in remote-control-view to be able to switch between "remote control"
-	and "view only"
-
-	* ima/src/client.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/main_window.h:
-	introduced mechanisms for blocking all client-update-threads via a
-	wait-condition while remote-control is active for not wasting
-	CPU-time - should speed up remote-control a bit
-
-	* ima/src/classroom_manager.cpp:
-	* ima/dialogs/config.ui:
-	defaulted update-interval from 1 to 2 for not causing too high
-	CPU-load
-
-	* ima/src/client.cpp:
-	in paintEvent() only redraw requested rect of state-pixmap - possible
-	speed-up
-
-	* ima/src/main_window.cpp:
-	* ima/src/classroom_manager.h:
-	* ima/src/client.cpp:
-	* ima/src/client.h:
-	cleanups
-
-	* lib/src/system_key_trapper.cpp:
-	- set m_enabled in setEnabled()-method
-	- decrement s_refCnt before accessing it
-
-	* lib/Makefile.am:
-	fixed entry for inject.h
-
-2007-04-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* lib/include/vncview.h:
-	* lib/src/vncview.cpp:
-	on focus-out-event release keyboard-grab and system-key-trapping and
-	get them back at focus-in-event
-
-	* lib/include/system_key_trapper.h:
-	* lib/src/system_key_trapper.cpp:
-	added possibility to dynamically enable or disable trapping of
-	system-keys
-
-	* ima/src/tool_button.cpp:
-	draw button more dark if checked/pressed
-
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/remote_control_widget.h:
-	- reworked texts in toolbar
-	- when in window mode, show maximized per default
-	- lot of cleanups
-
-	* setup/src/dialogs.cpp:
-	fixed installation of italc_core.dll under win32
-
-	* ima/src/remote_control_widget.cpp:
-	do not resize to desktop-geometry in window-mode
-
-2007-04-22	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.cpp:
-	* ima/src/main_window.h:
-	* ima/src/client.cpp:
-	do not reload clients if remote-control is active
-
-	* common/:
-	renamed to "lib"
-
-	* common/include/local_system.h:
-	* common/include/isd_connection.h:
-	* common/include/isd_base.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* common/italc_core.qrc:
-	* common/resources/es.ts:
-	* common/resources/fr.ts:
-	* common/resources/it.ts:
-	* common/resources/de.ts:
-	* ica/src/ica_main.cpp:
-	* ica/src/isd_server.cpp:
-	* ica/src/isd_server.h:
-	changes for new library-infrastructure
-
-	* ica/src/progress_widget.cpp:
-	* ica/src/progress_widget.h:
-	* ica/src/lzoconf.h:
-	* ica/src/vncview.cpp:
-	* ica/src/vncview.h:
-	* ica/src/minilzo.c:
-	* ica/src/minilzo.h:
-	* ica/src/system_key_trapper.cpp:
-	* ica/src/system_key_trapper.h:
-	* ica/src/lock_widget.cpp:
-	* ica/src/lock_widget.h:
-	moved to common
-
-	* ica/Makefile.am:
-	* ima/Makefile.am:
-	* setup/Makefile.am:
-	* common/Makefile.am:
-	* setup/src/main.cpp:
-	made all code in common-dir a shared library which all components are
-	linked against
-
-	* ima/italc.qrc:
-	* ima/src/main.cpp:
-	* ima/src/tool_button.h:
-	* ima/src/main_window.h:
-	* ima/src/tool_button.cpp:
-	adapted toolbar from remote-control
-
-	* ima/src/main.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	* ima/src/support_widget.cpp:
-	* ima/src/remote_control_widget.cpp:
-	* ima/src/remote_control_widget.h:
-	* ima/Makefile.am:
-	moved remote-control-feature from ICA to IMA
-
-2007-04-21	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ica/resources/mouse.png:
-	* ica/resources/up.png:
-	* ica/src/remote_control_widget.cpp:
-	* ica/src/remote_control_widget.h:
-	* ica/src/vncview.cpp:
-	* ica/src/vncview.h:
-	complete redesign of toolbar and buttons
-
-	* common/src/ivs_connection.cpp:
-	enqueue cursor-encodings in an earlier stage
-
-	* build_mingw32:
-	* ica/Makefile.am:
-	* ica/win32/win32vnc.cpp:
-	* ica/win32/src/vncDesktop.cpp:
-	* ica/win32/src/VNCHooks/VNCHooks.cpp:
-	put vnc-hook-stuff into separate DLL-file to make hooks work as
-	expected - closes #1698534 and probably fixes some other problems
-
-	* ica/src/vncview.cpp:
-	set widget-cursor for vncView to according remote-cursor instead of
-	drawing it - speeds thing a bit up
-
-	* ica/src/vncview.h:
-	* ica/src/remote_control_widget.cpp:
-	correct titlebar caption - closes #1700553
-
-	* ica/win32/src/vncServer.cpp:
-	tweaked default-settings a bit
-
-	* ica/win32/src/VideoDriver.h:
-	fixed non-ANSI-conform code
-
-	* ica/win32/src/VNCHooks/SharedData.cpp:
-	added SHARED-attribute to make all variables reside in a different
-	shared segment
-
-2007-04-20	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/local_system.cpp:
-	also print log-messages to stdout
-
-	* ica/src/system_key_trapper.h:
-	* ica/src/system_key_trapper.cpp:
-	added support for trapping Alt+Space - closes #1704091
-
-	* common/src/local_system.cpp:
-	* common/include/local_system.h:
-	* ica/src/ica_main.cpp:
-	renamed "localSystem::parameterSetting" to "localSystem::parameter"
-
-	* ica/src/ica_main.cpp:
-	added "-v" and "--version"-parameter
-
-2007-04-13	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/dialogs/config.ui:
-	* ima/src/config_widget.cpp:
-	* ima/src/classroom_manager.h:
-	* ima/src/classroom_manager.cpp:
-	* ima/src/client.cpp:
-	added setting for client-double-click-action
-
-2007-04-12	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/include/local_system.h:
-	* common/src/local_system.cpp:
-	* ica/src/ica_main.cpp:
-	added possibility to set parameters such as -ivsport and -isdport
-	using settings in either /etc/qt4/iTALC Solutions/iTALC.conf (Linux)
-	or registry (win32)
-
-	* ima/Makefile.am:
-	* ima/data/italc.desktop.in:
-	* ima/data/italc.in:
-	change paths inside these menu-files accordingly to prefix
-
-	* ima/data/italc.xpm:
-	* ima/Makefile.am:
-	added XPM-file for being installed into $prefix/share/pixmaps -
-	replaces PNG-file which is now installed into $prefix/share/icons
-
-	* italc.spec.in:
-	updated everything for being usable with re-developed iTALC
-
-2007-04-04	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.2 release
-
-	* build_mingw32:
-	build with MMX-support per default
-
-	* setup/src/dialogs.h:
-	* setup/src/dialogs.cpp:
-	* setup/src/main.cpp:
-	when doing auto-install do not display information-messages concerning
-	service-(un)registration
-
-	* common/src/system_service.cpp:
-	* common/include/system_service.h:
-	added quiet-option for being able to supress information-messages
-
-2007-04-04	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ica/resources/it.qm:
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* setup/resources/it.ts:
-	* setup/resources/it.qm:
-	updated Italian localization and removed obsolete translations
-
-2007-04-03	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/de.ts:
-	* ica/resources/de.qm:
-	updated German localization
-
-	* setup/src/dialogs.cpp:
-	- fixed typo which made key-import not working - closes #1686845
-	- added "net stop icas"-call which might be neccessary when updating
-	  old installations
-
-	* ica/src/isd_server.h:
-	* ica/src/isd_server.cpp:
-	show messages about failed authentication via system-tray-icon
-
-	* ica/src/ica_main.h:
-	* ica/src/ica_main.cpp:
-	changed several stuff concerning QSystemTray-instantiation
-
-	* ica/src/ica_main.cpp:
-	install event-filter in QCoreApplication and handle
-	WM_ENDSESSION-messages for not terminating on user-logoff (which is
-	the case if there was some desktop-interaction) - closes #1686921
-
-	* common/include/messagebox.h:
-	* common/src/messagebox.cpp:
-	added static trySysTrayMessage(...)-method for being able to display
-	several stuff in system-tray-icon (if available) in an easy way
-
-2007-03-31	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	fixed small bug which made --with-linux not working
-
-2007-03-29	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/win32/src/WinVNC.cpp:
-	* ica/win32/win32vnc.cpp:
-	made "-ivsport"-parameter functional under win32, closes #1688198
-
-	* ica/win32/src/vncDesktop.h:
-	* ica/win32/src/vncDesktop.cpp:
-	* ica/win32/src/vncInstHandler.cpp:
-	merged changes from TightVNC-SVN
-
-2007-03-29	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.1 release
-
-	* ica/resources/de.ts:
-	* ica/resources/es.ts:
-	* ica/resources/it.ts:
-	* ica/resources/fr.ts:
-	fixed translation of logon-dialog-accellerators
-
-	* common/include/isd_connection.h:
-	* common/src/isd_connection.cpp:
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	reload username-tooltip regularly
-
-	* common/src/local_system.cpp:
-	win32: - create C:\WINDOWS if it does not exist as otherwise there are
-	         strange errors with iTALC Master
-	       - partly rewrote logon-code
-
-	* ica/win32/src/stdhdrs.cpp:
-	only log warnings and more severe messages - fixes security issue
-	where faked keysyms were logged, e.g. key-presses of logon-function
-	were logged!
-
-2007-03-22	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.0 release
-
-	* common/src/system_service.cpp:
-	- win32: use ChangeServiceConfig2( ... ) instead of calling "sc" which
-	  might not exist on target system
-	- start service using "net"-command
-	- several small fixes
-
-	* common/src/dsa_key.cpp:
-	remove existing key-files before saving them
-
-	* common/src/local_system.cpp:
-	- disable caps-lock when logging on user under win32
-	- use ExitWindowsEx instead of InitiateSystemShutdown - hopefully also
-	  shutsdown W2K properly
-
-	* ima/src/client.cpp:
-	decreased font-size for messages like "Host not reachable"
-
-	* ima/src/main_window.cpp:
-	* common/src/isd_connection.cpp:
-	do not create new key-pair if private key could not be loaded and show
-	message instead
-
-	* ica/src/ica_main.cpp:
-	- run "man ica" if ica is launched with option "-h"
-	- fixed bug in argument-processing
-
-	* ima/src/tool_button.cpp:
-	always draw button-label with black color
-
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	* setup/resources/de.ts:
-	* setup/resources/de.qm:
-	updated German localization and removed obsolete translations
-
-	* setup/dialogs/page_setup_finished.ui:
-	* setup/src/dialogs.cpp:
-	start service after registering it
-
-	* setup/dialogs/page_security_options.ui:
-	* setup/src/dialogs.h:
-	* setup/src/dialogs.cpp:
-	added possibility to keep all keys during installation
-
-2007-03-20	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ica/resources/it.qm:
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* setup/resources/it.ts:
-	* setup/resources/it.qm:
-	updated Italian localization and removed obsolete translations
-
-2007-03-13	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/de.ts:
-	* ica/resources/de.qm:
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	updated German localization
-
-	* ima/dialogs/overview.ui:
-	* ima/src/user_list.h:
-	* ima/src/main_window.h:
-	* ima/src/classroom_manager.h:
-	* ima/src/config_widget.cpp:
-	* ima/src/user_list.cpp:
-	* ima/src/dialogs.cpp:
-	* ima/src/snapshot_list.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/client.cpp:
-	* ima/src/classroom_manager.cpp:
-	- renamed "client-manager" to "classroom-manager"
-	- renamed all occurences of "client" to "computer"
-	- made tree-widget in classroom-manager sortable
-	- simplified/improved/corrected help-texts
-
-	* ima/Makefile.am:
-	only include files from common/src/ in lupdate-run which are actually
-	used by IMA
-
-	* ima/src/client_manager.h:
-	* ima/src/client_manager.cpp:
-	* ima/resources/client_manager.png:
-	* ima/resources/client_manager_48.png:
-	* ima/italc.qrc.am:
-	* ima/Makefile.am:
-	moved to classroom_manager*.*
-
-	* ima/src/main_window.cpp:
-	added short-titles for all buttons in action-toolbar
-
-	* ima/resources/logo.png:
-	* ima/italc.qrc:
-	* ima/dialogs/about.ui:
-	added and integrated iTALC-logo
-
-	* ima/src/tool_button.h:
-	* ima/src/tool_button.cpp:
-	- removed annoying dissolve-effect
-	- improved design of tooltips
-	- added "short-title" which is displayed on tool-buttons
-	- decreased "roundness-factor" of tooltips from 3000 to 2000
-
-	* TODO:
-	- cleaned up
-	- added roadmap
-
-	* ima/Makefile.am:
-	* ima/src/client_manager.cpp:
-	removed references to progressInformation-dialog
-
-	* ima/src/progress_information.h:
-	* ima/src/progress_information.cpp:
-	removed
-
-	* setup/src/dialogs.cpp:
-	- removed "wake.exe" from file-list
-	- set "back" and "cancel"-button disabled when on last page
-
-	* ima/dialogs/client_settings.ui:
-	disabled widgets which are currently unused
-
-	* ica/src/lock_widget.cpp:
-	added widget-flag Qt::X11BypassWindowManagerHint again together with
-	several fixes making it work flawless
-
-	* ica/src/remote_control_widget.h:
-	* ica/src/remote_control_widget.cpp:
-	- removed non-fullscreen-view
-	- use widget-flag Qt::X11BypassWindowManagerHint to make window always
-	  being at top
-
-	* common/src/local_system.cpp:
-	more clean (but maybe less compatible) way to logout user under Linux
-
-	* ica/src/ica_main.cpp:
-	- more helpfull output on key-creation
-	- allow key-creation without creating a QApplication in systemService-
-	  class
-
-	* common/src/dsa_key.cpp:
-	- when saving private key, make it only readable by user and group
-	- when saving public key, make it only read- but not writeable by
-	  user, group and others
-
-	* configure.in:
-	* ica/Makefile.am:
-	* ima/Makefile.am:
-	* setup/Makefile.am:
-	do complete linking against OpenSSL-libraries
-
-2007-03-12	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client_manager.cpp:
-	* ima/src/config_widget.cpp:
-	save correct demo-network-interface even if selected interface has
-	more than one addresses
-
-	* ima/src/client_manager.cpp:
-	do not provide client-demo in context-menu of classrooms
-
-	* common/include/isd_connection.h:
-	cleanups
-
-	* common/src/local_system.cpp:
-	new organization-domain
-
-	* ica/Makefile.am:
-	* ica/src/system_service.cpp:
-	* ica/src/system_service.h:
-	moved to common/src/system_service.cpp and
-	common/include/system_service.h
-
-	* utils-win32/userinfo.cpp:
-	small fixes
-
-2007-03-12	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ica/resources/it.qm:
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* setup/resources/it.ts:
-	* setup/resources/it.qm:
-	updated Italian localization
-
-2007-03-08	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ima/italc.qrc:
-	* setup/setup.qrc:
-	added French localization-files
-
-	* configure.in:
-	added switch for debugging
-
-2007-03-07	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.qrc:
-	* ima/italc.qrc:
-	* setup/setup.qrc:
-	added Italian localization-files
-
-	* ima/Makefile.am:
-	* ima/data/italc.ico
-	* ima/data/italc.png
-	* ima/data/italc.desktop
-	* ima/data/italc:
-	added several files for better desktop-integration under Linux
-
-	* ima/Makefile.am:
-	* ima/italc.ico:
-	moved ima/italc.ico to ima/data/italc.ico
-
-	* INSTALL:
-	updated
-
-	* acinclude.m4:
-	evaluate $host instead of $build
-
-	* build_mingw32:
-	do not pass --build for allowing cross-compile without WINE being
-	installed
-
-2007-03-05	Andriano Rino <rino-andr/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/it.ts:
-	* ica/resources/it.qm:
-	* ima/resources/it.ts:
-	* ima/resources/it.qm:
-	* setup/resources/it.ts:
-	* setup/resources/it.qm:
-	added Italian localization
-
-2007-03-02	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/lock_widget.cpp:
-	removed widget-flag Qt::X11BypassWindowManagerHint as it caused
-	problems on some test systems
-
-2007-03-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made RC4 release
-
-	* configure.in:
-	- added several stuff from x11vnc-0.8.4/configure.ac
-	- print out error if XTEST-extension could not be found under Linux
-	- removed "-ansi"-flag
-	- added v4l-check again
-
-	* ica/x11/README:
-	* ica/win32/README:
-	added README's with copyright-notices
-
-	* ica/x11/x11vnc/*
-	* ica/x11/x11vnc.c:
-	integrated x11vnc 0.8.4
-
-	* acinclude.m4:
-	several fixes for less problems with cross-compiling iTALC (thanks to
-	Timshell Knoll-Miller)
-
-	* ima/Makefile.am:
-	added italc.ico to EXTRA_DIST (thanks to Timshell Knoll-Miller)
-
-	* ima/src/client.cpp:
-	close connection to invisible clients (thanks to Timshell Knoll-Miller)
-
-	* ima/src/client_manager.cpp:
-	do not show all clients if no personal-config exists (thanks to Timshell
-	Knoll-Miller)
-
-	* setup/Makefile.am:
-	added setup.ico to EXTRA_DIST (thanks to Timshell Knoll-Miller)
-
-	* setup/src/dialogs.cpp:
-	- include <QtXml/QtXml> instead of <Qt/QtXml> - fixes build-problem
-	  reported by an user
-	- correctly create installation-path in auto-setup-mode
-	- export public key properly if it does not exist
-
-	* ica/Makefile.am:
-	- several small fixes in build-system
-	- added missing entry for a header-file to sources-list
-	- removed obsolete files from sources-list
-
-	* ica/x11/rfb/default8x16.h:
-	prevent from being included more than once
-
-	* ica/src/local_system.cpp:
-	after registering service under win32, change failure-config of it to
-	make it being restart each time, it is stopped, e.g. at user-logoff
-	(the problem had been reported by some users)
-
-	* ica/win32/src/vncClient.cpp:
-	* ica/win32/src/vncServer.h:
-	corrected #include-statements
-
-	* ica/win32/vncCORBAConnect.h:
-	* ica/win32/Windows.h:
-	removed as caused troubles under operating systems that do not have
-	case-sensitive filename-handling
-
-	* common/src/local_system.cpp:
-	handle additional state of logon-dialog under win32 (thanks to
-	Timshell Knoll-Miller)
-
-2007-02-28	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/fr.ts:
-	* ica/resources/fr.qm:
-	* ima/resources/fr.ts:
-	* ima/resources/fr.qm:
-	* setup/resources/fr.ts:
-	* setup/resources/fr.qm:
-	added French localization from Guillaume Allegre
-	(guillaume/dot/allegre/at/silecs/dot/info)
-
-2007-02-22	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/isd_connection.cpp:
-	fixed typo
-
-	* common/src/local_system.cpp:
-	* utils-win32/userinfo.cpp:
-	rewrote userinfo for being invoked once and continuously printing
-	user-name - solves problem with high CPU-load
-
-	* setup/src/dialogs.cpp:
-	when invoking installed "ica.exe", pass arguments in separate
-	QStringList for not running into problems if installation-path
-	contains spaces - fixes several bugs concerning key-creation and
-	service-registration
-
-	* ima/src/client_manager.cpp:
-	remember state of main-window (maximized/normal)
-
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	updated German localization
-
-2007-02-19	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made RC3 release
-
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	- added flag which is set upon exit
-	- proper destruction of whole application on window-close
-	- do not change global client mode as it's done by clients individually
-
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	- made update-thread eventloop-based for better scheduling and less
-	  potential problems
-	- do not set m_mode to Mode_FullscreenDemo in all demo-modes - fixes
-	  bug which made it impossible to change from window- to fullscreen-demo
-	  directly
-	- everywhere pass m_mainWindow->localISD() as parameter for
-	  changeMode(...) to fix potential crashes
-
-	* ica/src/isd_server.cpp:
-	do not explicitely delete m_demoServer as this should be done per
-	connection - fixes bug which crashed ICA in several cases
-
-	* common/src/local_system.cpp:
-	completely rewritten code for running userinfo.exe under win32 as
-	QProcess-class is buggy and caused several Windows-processes to hang
-	when being used the way done in iTALC - should fix explorer-freezes
-	and many more
-
-	* common/src/isd_connection.cpp:
-	use QTcpSocket::connect() rather than own methods as they do not time
-	out
-
-2007-02-10	Mario Izquierdo <mariodebian/at/gmail/dot/com>
-
-	* ica/resources/es.ts:
-	* ica/resources/es.qm:
-	* ima/resources/es.ts:
-	* ima/resources/es.qm:
-	added/updated Spanish localization
-
-2007-02-03	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/system_key_trapper.cpp:
-	disable sticky-keys and according confirmation-dialog while
-	system-keys are trapped - fixes issue where users could cheat while
-	screen is locked by pressing shift 5 times
-
-2007-02-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	* ima/src/client.h:
-	changed title of client-window, now only hostname + classroom are
-	displayed - user-name is as usual displayed as tooltip
-
-	* setup/resources/de.qm:
-	* setup/resources/de.ts:
-	updated German localization
-
-	* setup/src/dialogs.cpp:
-	* setup/src/dialogs.h:
-	if exported-key already exists, ask whether to overwrite and if so do
-	so instead of failure silently
-
-2007-01-20	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/x11/x11vnc/x11vnc.1:
-	removed as accidently added to repo somewhen
-
-	* ima/src/client_manager.cpp:
-	when auto-arranging windows, include decoration-width and -height in
-	calculation - fixes bug described in
-	http://sourceforge.net/forum/message.php?msg_id=4110695
-
-	* ima/src/tool_button.cpp:
-	set button-title as text - if toolbar is not completely visible, a
-	button on the right opens a menu with actions which did not fit into
-	available space - each menu-item is labeled with button-title and if
-	it is not set, there're only empty items...
-
-2007-01-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.cpp:
-	disable action for showing/hiding toolbar
-
-2007-01-15	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/src/dialogs.h:
-	* setup/src/dialogs.cpp:
-	fixed bug which made auto-setup not work if
-	iTALC-installation-directory was not existing
-
-2007-01-09	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/dialogs/page_setup_finished.ui:
-	* setup/src/dialogs.h:
-	* setup/src/main.cpp:
-	* setup/src/dialogs.cpp:
-	first initial (incomplete) support for auto-setup
-
-2007-01-07	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.0.0-rc2 release
-
-	* INSTALL:
-	added missing build-requirement
-
-	* Makefile.am:
-	added some "rm -f"-calls to clean-target for not leaving files created
-	during build-process
-
-	* setup/Makefile.am:
-	marked setup as not-installable target
-
-	* ica/Makefile.am:
-	* italc/Makefile.am:
-	added manpages to EXTRA_DIST-variable
-
-	* common/Makefile.am:
-	explicitely list files for EXTRA_DIST instead of using wildcards, thus
-	files built by configure are not packaged into distribution anymore
-
-	* Makefile.svn:
-	commented out make-call for LUPUS
-
-2007-01-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/ica.rc.in:
-	* ima/italc.rc.in:
-	* setup/setup.rc.in:
-	fixes and copyright-enhancements
-
-	* ica/src/ica_main.cpp:
-	* ica/src/ivs.cpp:
-	let the user pass more options for x11vnc
-
-	* ica/ica.1:
-	* ica/Makefile.am:
-	* ima/italc.1:
-	* ima/Makefile.am:
-	added manpages
-
-2007-01-05	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* INSTALL:
-	rewritten for new version
-
-2007-01-02	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* README:
-	* ima/dialogs/about.ui:
-	* ima/resources/splash.png:
-	extended copyright-notice from 2006 to 2007
-
-2006-12-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/dsa_key.cpp:
-	* common/src/isd_base.cpp:
-	* common/src/isd_server.cpp:
-	* common/src/ivs_connection.cpp:
-	* common/src/local_system.cpp:
-	* ica/win32/src/Log.h:
-	* ica/win32/src/Log.cpp:
-	* ica/win32/src/stdhdrs.cpp:
-	* ica/src/demo_server.cpp:
-	* ica/src/ica_main.cpp:
-	* ica/src/isd_server.cpp:
-	* ica/src/system_service.cpp:
-	use Qt-debugging-techniques rather than printf & co
-
-	* common/src/local_system.cpp:
-	- under win32, handle logoff-events for not stopping service at logoff
-	- added qt-message-handler for logging messages into file
-	- do not create user-poll-thread when not building ICA
-
-2006-12-24	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* acinclude.m4:
-	added -L$QTDIR/lib/qt4 to linker-flags to make iTALC compile under
-	Gentoo
-
-2006-12-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/isd_server.cpp:
-	show access-confirmation-dialog in foreground
-
-	* ima/src/client_manager.cpp:
-	* ima/src/main_window.cpp:
-	save and restore state of main-window
-
-	* ima/src/client_manager.cpp:
-	always allow switching to overview-mode in changeGlobalClientMode()
-
-2006-12-16	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/dialogs/overview.ui:
-	unique names for labels which avoids uic-warnings
-
-	* ica/src/isd_server.cpp:
-	do not try to make a reverse-lookup on IPs when doing
-	host-based-authentication
-
-	* ica/Makefile.am:
-	* ica/win32/win32vnc.cpp:
-	* ica/win32/vncMenu.h:
-	* ica/win32/src/*:
-	integrated new sources from TightVNC 1.3.8
-
-	* common/src/isd_connection.cpp:
-	- self-written code for connecting to socket as Qt's
-	  QAbstractSocket::connectToHost() does lot of extra stuff (ghost
-	  connections etc) which also confuses the different servers sometimes
-	- when doint authentication, check whether number of sec-types is
-	  greater then zero and return (instead of crash) if so
-
-2006-12-13	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/include/isd_connection.h:
-	added NULL-check for m_socket in hasData()-method
-
-2006-12-11	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	made 1.0.0.0-rc1 release
-
-	* utils-win32/userinfo.cpp:
-	fixed crash when being called as local administrator
-
-	* ima/src/main_window.cpp:
-	bugfixes in mainWindow::changeGlobalClientMode( ... )
-
-	* ima/src/client.cpp:
-	decreased font-size for embedded information from 20 to 14
-
-	* ima/src/snapshot_list.h:
-	* ima/src/snapshot_list.cpp:
-	* ima/dialogs/snapshots.ui:
-	- completely revised snapshot-workspace using designer
-	- when viewing snapshot, use scroll-area
-	- preview etc. is now working again
-
-2006-12-10	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/de.ts:
-	* ica/resources/de.qm:
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	* setup/resources/de.ts:
-	* setup/resources/de.qm:
-	updated German localization
-
-	* ima/src/client.cpp:
-	- initialize m_classRoomItem with NULL - makes iTALC work with Qt 4.2.2
-	- when constructing snapshot-filename, add directory *after* replacing
-	  all occurences of ":" with "-" as this also replaces ":" in "X:\"
-	  under win32 which is not really desired...
-	- again new implementation of client::clientDemo() - starts
-	  fullscreen-demo on all clients except the one showing the demo and
-	  also presses fullscreen-mode-button in toolbar using new method in
-	  mainWindow
-
-	* ima/src/main_window.cpp:
-	- save config-files at exit
-	- start update-thread with QThread::LowestPriority as not really
-	  important
-
-	* ima/src/client_manager.cpp:
-	do not save config-files in doCleanupWork(), instead only do so when
-	adding/chaning/removing client(s)
-
-	* ima/src/main_window.h:
-	added checkModeButton( ... )
-
-	* utils-win32/userinfo.cpp:
-	if retrieval of full user name failed, use account-name instead
-
-	* setup/src/dialogs.cpp:
-	create shortcut to iTALC-master in start-menu-root
-
-	* configure.in:
-	check for ${prefix} before extending CFLAGS etc. - should fix issue
-	with make-problems when using older automake-versions
-
-	* common/src/messagebox.cpp:
-	* ica/src/remote_control_widget.cpp:
-	* ica/src/demo_client.cpp:
-	* ica/src/lock_widget.cpp:
-	activate window (bring it to forgeground) using
-	localSystem::activateWindow()
-
-	* include/local_system.h:
-	* common/src/local_system.cpp:
-	- added globalStartmenuDir(), windowsConfigPath(), activateWindow()
-	- do not logon user under win32 when explorer.exe-process is found
-	- snapshot-dir in "My Documents" under win32
-	- personalConfigDir(): query application-data-path using
-	  windowsConfigPath()
-
-	* common/src/isd_connection.cpp:
-	proper cleanup of sockets in destructor
-
-2006-12-08	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/local_system.cpp:
-	bigger delays between input of user/password/domain under win32
-
-2006-12-05	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/include/isd_base.h:
-	* common/src/isd_connection.cpp:
-	* ica/src/isd_server.cpp:
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	* ima/src/client_manager.cpp:
-	compat-fixes for new w32-API
-
-	* setup/src/dialogs.cpp:
-	make public-key read-only after installing it
-
-2006-12-02	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main.cpp:
-	- small improvement concerning splash
-	- removed inclusion of obsolete header-files
-
-	* ima/dialogs/overview.ui:
-	bigger height for about-button
-
-	* common/include/rfb/rfbproto.h:
-	* ica/Makefile.am:
-	fixes for GCC 4.1 (mingw-x)
-
-2006-12-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client_manager.cpp:
-	do not sleep in changeGlobalClientMode( ... ) at all as not neccessary
-	any longer
-
-	* common/src/local_system.cpp:
-	fixes concerning logonUser( ... )-implementation under win32
-
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	demo of a client is now done by starting a fullscreen-demo on all
-	other clients and remote-control this client
-
-	* ica/x11/x11vnc/*:
-	integrated latest x11vnc-code
-
-2006-11-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/src/dialogs.cpp:
-	small fixes concerning progress-dialog
-
-	* common/src/local_system.cpp:
-	when saving path to key, replace multiple dir-separators by one
-	separator
-
-	* ima/src/user_list.cpp:
-	* ima/src/snapshot_list.cpp:
-	* ima/src/config_widget.cpp:
-	several code-cleanups
-
-	* ica/src/demo_server.cpp:
-	fixed some really bad bugs which caused ICA to freeze if
-	initialization of even one demo-client failed (demoServerClient::run()
-	returned without unlocking m_dataMutex which caused a deadlock if
-	slots called from GUI-thread tried to lock the mutex)
-
-	* common/src/local_system.cpp:
-	several fixes concerning paths for keys and config-files
-
-	* common/src/isd_connection.cpp:
-	fixed typos concerning auto-logon
-
-	* ima/dialogs/multi_logon.ui:
-	fixed tab-order
-
-	* ima/src/client_manager.cpp:
-	- before writing global/personal config, copy old file to backup and try
-	  to copy backup-file back if according file does not exist at startup
-	- except for questions, always use own messageBox-class
-
-	* ima/Makefile.am:
-	when updating translation, also include files in common src-dir
-
-	* ima/src/main_window.cpp:
-	use localSystem::ensurePathExists() in ensureConfigPathExists()
-
-2006-11-27	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main.cpp:
-	do not set mask on splash as not neccessary anymore
-
-	* acinclude.m4:
-	* configure.in:
-	* ima/Makefile.am:
-	* ica/Makefile.am:
-	* setup/Makefile.am:
-	* ima/setup.rc.in:
-	* ica/setup.rc.in:
-	* setup/setup.rc.in:
-	added standard-resource-files for win32-exe-files which contain an
-	icon as well as file-descriptions
-
-	* ima/src/client.cpp:
-	do not show context-menu of client-windows at startup
-
-	* setup/src/dialogs.cpp:
-	- some bugfixes concerning directory-handling
-	- pass window() as parent to dialogs
-	- remove file before copying them, otherwise QFile::copy() fails
-	- other bugfixes
-
-	* ica/src/system_service.cpp:
-	load localization even when only doing some service-stuff
-
-2006-11-26	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/de.ts:
-	* ica/resources/de.qm:
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	updated German localization
-
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	- rewrote code for client-demo - should work now
-	- added note to "watch only"-action
-
-	* ima/src/client_manager.h:
-	* ima/src/main_window.h:
-	* ima/src/main_window.cpp:
-	clicking buttons such as "lock screens" or "start-demo" when already
-	activated will switch back to view-only-mode - probably avoids some
-	confused users...
-
-	* ima/src/client_manager.cpp:
-	only sleep in changeGlobalClientMode( ... ) when starting demo
-
-	* common/include/local_system.h:
-	* common/include/isd_connection.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* ica/src/isd_server.cpp:
-	* ima/dialogs/config.ui:
-	* ima/dialogs/multi_logon.ui:
-	* ima/src/config_widget.h:
-	* ima/src/config_widget.cpp:
-	* ima/src/client.cpp:
-	* ima/src/client_manager.cpp:
-	* ima/src/dialogs.h:
-	* ima/src/dialogs.cpp:
-	* ima/src/main.cpp:
-	* ima/src/main_window.h:
-	better support for multi-logon under win32 by using accellerators
-	for each input-field and also allowing to enter domain-name
-
-	* ica/src/vncview.cpp:
-	also display toolbar when user moves cursor to top of screen while
-	connecting to host
-
-2006-11-23	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	- replaced toolbar by context-menu
-	- before remote-controlling, ensure no demo etc. is running
-
-	* common/src/local_system.cpp:
-	fixed size of buffer - fixes segfault when broadcasting WOL-packets
-
-	* ima/src/client_manager.cpp:
-	increased sleep between mode-changes of clients from 200ms to 400ms
-
-	* ica/src/vncview.cpp:
-	- do not change view-port while not connected
-	- completely re-worked threading - makes remote-control etc. more
-	  stable
-
-	* common/src/local_system.cpp:
-	win32: press Escape before sending Alt+Ctrl+Del to make sure an
-	already opened login-dialog is closed
-
-	* common/include/local_system.h:
-	* common/src/local_system.cpp:
-	save paths to keys in setup
-
-	* setup/dialogs/page_key_dirs.ui:
-	improved usability in several ways
-
-	* setup/dialogs/page_security_options.ui:
-	disable field for input of key-export-dir etc. when selecting "create
-	new keys"
-
-	* setup/dialogs/page_select_components.ui:
-	for the time being disable checkboxes for components "LUPUS" and
-	"docs"
-
-	* setup/Makefile.am:
-	pass -mwindows to linker when creating win32-executable
-
-	* setup/resources/qt*qm:
-	added Qt-localizations to setup
-
-	* setup/src/main.cpp:
-	call localSystem::initialize() at startup
-
-	* setup/dialogs/page_setup_finished.ui:
-	* setup/resources/page_setup_finished.png:
-	* setup/src/dialogs.cpp:
-	added page at the end of setup to inform user about finished
-	installation and so on
-
-2006-11-20	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/system_key_trapper.cpp:
-	under win32 do not disable taskbar as sometimes remote-control-widget
-	does not come to front and as all system-keys are trapped there would
-	be no possibility to switch to it or even just quit it
-
-	* ica/src/remote_control_widget.cpp:
-	close remoteControlWidget when pressing escape while establishing
-	connection
-
-	* ima/dialogs/overview.ui:
-	* ima/resources/client_manager_48.png:
-	* ima/resources/config_48.png:
-	* ima/resources/snapshot_48.png:
-	* ima/resources/users_48.png:
-	* ima/src/overview.h:
-	* ima/src/overview.cpp:
-	re-made overview-widget using Qt-designer and added some nice icons
-
-	* ima/dialogs/about.ui:
-	* ima/dialogs/client_settings.ui:
-	* ima/dialogs/config.ui:
-	* ima/dialogs/multi_logon.ui:
-	* ima/dialogs/support.ui:
-	* ima/dialogs/text_message.ui:
-	higher value for spacing and margin of several layouts for better
-	design and other small fixes
-
-	* ima/resources/ok.png:
-	added ok-icon for messagebox
-
-	* common/src/messagebox.cpp:
-	better layout-handling better looking message-boxes
-
-	* ima/resources/de.ts:
-	* ima/resources/de.qm:
-	updated German localization
-
-	* ima/src/main_window.cpp:
-	- more clear message if ICA is not running
-	- more descriptive balloon-message for overview-button
-
-	* ima/italc.qrc:
-	* ima/resources/auto_arrange.png:
-	* ima/src/client_manager.cpp:
-	* ima/src/main_window.cpp:
-	new auto-arrange-feature for client-windows
-
-	* ima/src/client_manager.cpp:
-	pass window() as parent for dialogs - fixes bug which made dialogs
-	inaccessible under win32
-
-	* ima/resources/qt_*qm:
-	updated Qt-localizations
-
-	* ica/src/ica_main.cpp:
-	when using default-paths, do not save private key in public-key-file
-	and vice versa...
-
-	* ica/src/demo_client.cpp:
-	do not call showMaximized() on top-level-widget if in fullscreen-mode
-
-2006-11-16	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* setup/src/dialogs.h:
-	* setup/src/dialogs.cpp:
-	- now keys are created/imported/exported
-	- show confirm-dialog before cancel setup
-
-	* setup/resources/de.ts:
-	* setup/resources/de.qm:
-	* setup/setup.qrc:
-	added German localization
-
-	* setup/dialogs/page_security_options.ui:
-	* setup/dialogs/wizard.ui:
-	small fixes
-
-	* common/src/dsa_key.cpp:
-	if filename does not contain dir-separators, do not call
-	localSystem::ensurePathExists()
-
-	* common/include/local_system.h:
-	* common/src/local_system.cpp:
-	added option to privateKeyPath() and publicKeyPath() for only
-	returning path without filename
-
-	* ica/src/ica_main.cpp:
-	* common/src/dsa_key.cpp:
-	* common/src/local_system.cpp:
-	added "-createkeypair"-option to ICA
-
-2006-11-14	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	added some more checks for better configuration of miniLZO
-
-2006-11-13	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main.cpp:
-	per default set __role to RoleTeacher
-
-	* ima/dialogs/multi_logon.ui:
-	use password-echo-mode for password-input-field
-
-2006-11-12	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/de.ts:
-	updated German localization
-
-	* ica/src/vncview.cpp:
-	use Qt::DirectConnection's to make framebufferUpdate()-method being
-	executed with vncViewThread-affinity -> GUI of remote-control etc. does
-	not hang anymore if host is not reachable or connected via slow link
-	for now the last kno wn critical bug is fixed!
-
-	* ica/src/demo_server.cpp:
-	- use QTimer-objects with Qt::DirectConnection instead of
-	  QTime::singleShot for running connected methods within desired
-	  thread - fixes warnings about QSocketNotifier etc.
-	- use m_lastCursorPos instead of QCursor::pos() for reading current
-	  cursor-position -> no more Xlib-errors
-
-2006-11-11	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	* ima/src/dialogs.h:
-	* ima/src/dialogs.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/support_widget.cpp:
-	always try to set parent-window for dialogs for not having separate
-	taskbar-entries for dialogs
-
-	* common/include/isd_connection.h:
-	* common/include/local_system.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* ica/src/isd_server.cpp:
-	* ima/src/client.cpp:
-	* Makefile.am:
-	new (built-in) WakeOnLAN-technology
-
-	* common/include/isd_base.h:
-	* common/include/isd_connection.h:
-	* common/include/local_system.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* ica/win32/src/WinVNC.cpp:
-	* ica/src/ivs.cpp:
-	* ica/src/isd_server.cpp:
-	* ica/x11/x11vnc/keyboard.h:
-	* ima/Makefile.am:
-	* ima/italc.qrc:
-	* ima/dialogs/multi_logon.ui:
-	* ima/resources/multilogon.png:
-	* ima/resources/multilogon_48.png:
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	* ima/src/client_manager.h:
-	* ima/src/client_manager.cpp:
-	* ima/src/dialogs.h:
-	* ima/src/dialogs.cpp:
-	* ima/src/main_window.cpp:
-	added multi-user-logon-feature, i.e. the teacher enters the username
-	and password which will be used for logging on the according users on
-	selected computers by faking neccessary key-events
-
-2006-11-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/de.ts:
-	* ima/resources/de.s:
-	updated German localization
-
-	* ica/src/vncview.cpp:
-	initialize m_viewOffset
-
-	* ica/src/demo_server.cpp:
-	do not flush socket-write-buf inside processing loop - fixes critical
-	bug in demo-mode
-
-	* common/src/ivs_connection.cpp:
-	added write-lock for scaled-image-lock
-
-	* common/src/local_system.cpp:
-	changed organization-name and -domain to "iTALC Solutions" and
-	"is.org"
-
-2006-11-04	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/include/ivs_connection.h:
-	* common/src/ivs_connection.cpp:
-	added read-write-lock for cursor-shape, should eliminate some problems
-	with demo-mode etc.
-
-	* ima/src/client.cpp:
-	start client-update-threads only with low priority for not withdrawing
-	the GUI-thread all CPU-time
-
-	* ica/src/vncview.h:
-	* ica/src/vncview.cpp:
-	deal with ivsConnection in a separate thread for not blocking GUI if
-	lot of data is processed
-
-	* ica/src/remote_control_widget.cpp:
-	clean ups and some more checks on pointers
-
-	* common/irc/ivs_connection.cpp:
-	if size of updated region is zero, return earlier, so senseless
-	screen-scaling is not done
-
-	* common/irc/isd_connection.cpp:
-	always test m_socket for being NULL as some functions might be called
-	before open() initially was called
-
-	* common/include/ivs_connection.h:
-	do not lock image when returning a read-only-reference as it's
-	absolutely senseless as the reference could be used somewhen later
-	when the actual mutex is locked... should speed up accesses by GUI-
-	thread
-
-2006-11-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/Makefile.am:
-	* ica/src/system_service.h:
-	* ica/src/system_service.cpp:
-	* ica/src/service.h:
-	* ica/src/service.cpp:
-	* ica/src/ica_main.h:
-	* ica/src/ica_main.cpp:
-	new generic systemService-class
-
-2006-10-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	* Makefile.am:
-	* Makefile.svn:
-	build-integration of LUPUS which is now an external
-	subversion-reference
-
-	* common/src/ivs_connection.cpp:
-	fixed several memory-leaks
-
-	* common/include/qt_features.h:
-	do not build win32-version with system-tray-support as it causes ICA
-	to crash in several cases
-
-	* ica/src/lock_widget.h:
-	* ica/src/lock_widget.cpp:
-	* ica/src/system_key_trapper.cpp:
-	cleanups
-
-2006-10-28	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/resources/de.ts:
-	* ica/resources/de.qm:
-	updated German localization
-
-	* common/src/local_system.cpp:
-	shutdown and reboot under win32 via InitiateSystemShutdown() instead
-	of ExitWindowsEx() - makes shutdown and rebooting under win32 possible
-	when running as service
-
-	* common/include/local_system.h:
-	* common/src/local_system.cpp:
-	* ica/src/inject.cpp:
-	moved enablePrivilege()-function to local-system
-
-2006-10-22	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/inject.cpp:
-	made code follow coding-style-guidelines
-
-	* ica/src/demo_server.cpp:
-	do not quit if first attempt to connect to local IVS fails, instead
-	retry in loop - should make demo-server more stable in general
-
-	* ica/src/isd_server.cpp:
-	if master-app terminated unexspected and did not send
-	demo-stop-command, stop the demo-server started over according socket
-	(for each socket, the property "demoserver" is set when a demo-start-
-	command is received over it - the property contains a pointer to the
-	demo-server and therefore can be deleted when socket emits
-	destroyed()-signal)
-
-	* ica/src/isd_server.cpp:
-	* ica/src/ivs.h:
-	* ica/src/ivs.cpp:
-	Linux/X11-version: pass role to IVS in separate process and restart it
-	as soon as role changes
-
-	* ica/src/ica_main.h:
-	* ica/src/ica_main.cpp:
-	* ica/src/isd_server.h:
-	* ica/src/isd_server.cpp:
-	under Linux/X11 we can't display the access-dialog within IVS-process
-	as no QApplication is being created - instead launch a sub-process
-	whose exit-code corresponds to the choice the user made
-
-	* ica/src/ica_main.h:
-	* ica/src/ica_main.cpp:
-	- made rx11vs a global variable (__rx11vs)
-	- made ivs_port a global variable (__ivs_port)
-
-	* common/src/isd_connection.cpp:
-	use RoleOther for __role per default
-
-	* common/include/local_system.h:
-	* common/src/local_system.cpp:
-	new method userRoleName(...)
-
-2006-10-21	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/local_system.cpp:
-	- cleanups and small fixes
-	- under Linux/X11 first try to evaluate USER-env-var before using
-	  getuid()
-	
-	* setup/dialogs/page_select_components.ui:
-	* setup/src/dialogs.cpp:
-	- when installing to according to list of components selected by user
-	- progress-dialog during actual installation
-
-	* ima/dialogs/config.ui:
-	- corrected "what's this"-texts for some elements
-	- items for demo-quality-combobox are now inserted by UIC-code instead
-	  of in ima/src/config_widget.cpp
-
-	* common/include/isd_base.h:
-	* common/include/isd_connection.h:
-	* common/include/italc_rfb_ext.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* ica/src/ica_main.cpp:
-	* ica/src/isd_server.h:
-	* ica/src/isd_server.cpp:
-	* ima/dialogs/config.ui:
-	* ima/src/config_widget.h:
-	* ima/src/config_widget.cpp:
-	* ima/src/client_manager.cpp:
-	* ima/src/main_window.cpp:
-	support for several roles, e.g. teachers, admins, supporters and
-	others (students etc.) and therefore different keys for each role
-
-	* ica/Makefile.am:
-	* ima/Makefile.am:
-	* setup/Makefile.am:
-	* acinclude.m4:
-	- more clean Qt-detection code
-	- separated QtGui-lib to extra variable as it isn't needed by all
-	  components
-
-	* ima/resources/low.png:
-	* ima/resources/medium.png:
-	* ima/resources/high.png:
-	* ima/italc.qrc:
-	added icons for different demo-quality-types
-
-2006-10-19	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/include/qt_features.h:
-	* setup/src/dialogs.cpp:
-	support static functions of QMessageBox in Qt < 4.2
-
-	* ica/src/ica_main.cpp:
-	compat-fix for Qt < 4.2
-
-2006-10-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/include/dsa_key.h:
-	* common/src/dsa_key.cpp:
-	* common/src/isd_connection.cpp:
-	renamed "dsaKey::valid()" to "dsaKey::isValid()" for closer match with
-	Qt-API-style
-
-	* ica/win32/win32vnc.cpp:
-	include assert.h to compile successfully with GCC 4.1
-
-	* ica/src/service.cpp:
-	implementation of icaServiceStop() under Linux
-
-	* setup/dialogs/page_key_dirs.ui:
-	* setup/dialogs/page_license_agreement.ui:
-	* setup/dialogs/page_welcome.ui:
-	* setup/dialogs/page_security_options.ui:
-	* setup/dialogs/page_install_dir.ui:
-	* setup/dialogs/page_select_components.ui:
-	* setup/dialogs/wizard.ui:
-	* setup/src/dialogs.cpp:
-	* setup/src/main.cpp:
-	* setup/src/dialogs.h:
-	* setup/Makefile.am:
-	* setup/setup.qrc::
-	* setup/resources/next.png:
-	* setup/resources/page_security_options.png:
-	* setup/resources/page_artwork_welcome.png:
-	* setup/resources/page_license_agreement.png:
-	* setup/resources/setup.png:
-	* setup/resources/back.png:
-	* setup/resources/page_select_components.png:
-	* setup/resources/page_install_dir.png:
-	* setup/resources/fileopen.png:
-	* setup/resources/cancel.png:
-	added setup-wizard for easy installation and setup of iTALC in a
-	network
-
-	* ica/src/isd_server.cpp:
-	do not lock screen if demo-server is running
-
-2006-10-15	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* acinclude.m4:
-	some bugfixes concerning Qt-devel-tool-recognition
-
-	* configure.in:
-	added template for WIN32-define as new autoheader otherwise refuses to
-	work
-
-	* ica/resources/de.ts:
-	* ima/resources/de.ts:
-	updated German localization
-
-	* ica/src/vncview.cpp:
-	* ica/src/demo_server.cpp:
-	cleanups etc.
-
-	* ica/src/isd_server.cpp:
-	- never start a demo if a demo-server is running within the same
-	  process!
-	- if supported, show messages using system-tray-message (balloon)
-	  instead of messagebox
-
-	* ica/src/service.h:
-	* ica/src/service.cpp:
-	* ica/src/ica_main.cpp:
-	- support for stopping ICA-service via command-line
-	- print out error-message when encountering unknown commandline
-	  argument
-
-	* ica/src/service.cpp:
-	use QMessageBox instead of native MessageBox()-function for displaying
-	service-related messages, allows localization as well
-
-	* ica/ica.qrc:
-	* ica/src/ica_main.h:
-	* ica/src/ica_main.cpp:
-	support for system-tray-icon
-
-	* common/include/rect_list.h:
-	* common/src/rect_list.cpp:
-	improved and optimized nonOverlappingRects()-algorithm
-
-	* common/include/qt_features.h:
-	added file which contains definition of several macros depending on
-	Qt-version and target platform
-
-2006-10-12	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/vncview.cpp:
-	only do complete repaints of we indeed changed viewport if mouse is on
-	an edge - fixes flickering cursors in demo-mode if client's cursor was
-	on an edge
-
-	* common/include/ivs_connection.h:
-	* common/src/ivs_connection.cpp:
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	* ica/src/isd_server.cpp:
-	* ima/dialogs/config.ui:
-	* ima/src/client_manager.cpp:
-	* ima/src/config_widget.h:
-	* ima/src/config_widget.cpp:
-	* ima/src/main_window.h:
-	* ima/src/main.cpp:
-	* ima/src/resources/demoquality.png:
-	support for several quality-modes for demo-mode
-
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	removed debugging-code
-
-	* common/include/qt_user_events.h:
-	* common/include/ivs_connection.h:
-	* common/src/ivs_connection.cpp:
-	* ica/src/demo_server.cpp:
-	* ica/src/demo_server.h:
-	use rectList instead of QRegion, should fix some X-errors on
-	Linux/X11-version
-
-	* common/include/rectlist.h:
-	* common/src/rectlist.cpp:
-	added lightweight and non-GUI-dependent class "rectList" as replacement
-	for QRegion
-
-2006-10-11	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/main_window.cpp:
-	connect power-down-all-button to clientManager::powerDownClients
-	instead of clientManager::powerOffClients
-
-	* ica/src/progress_widget.cpp:
-	do not use semi-transparent progress-widget as it's horribly slow
-	under win32
-
-	* ica/src/service.cpp:
-	do not call exit(0) at the end of ServiceStop() - win32-service-manager
-	now properly detects if service had been stopped
-
-	* ica/src/ica_main.cpp:
-	- do not create QApplication in first invocation of ICAMain() when
-	  running as service for not creating two QApplication-objects
-	- bugfix: when settings up commandline for ICAMain() in WinMain() make
-	  the first item to be the application-path - fixes several problems
-	  when building against Qt 4.2.0 and running as service under win32
-
-	* ica/src/remote_control_widget.cpp:
-	more usable toolbar and toolbuttons
-
-	* common/src/isd_connection.cpp:
-	wait 1000 ms instead of 500 ms for connection to be established
-
-	* ica/win32/src/vncService.cpp:
-	in SimulateCtrlAltDelThreadFn(): if switching to winlogon-desktop
-	failed, launch taskmgr manually
-
-	* ica/src/system_key_trapper.h:
-	* ica/src/system_key_trapper.cpp:
-	- trap Alt+F4 under win32
-	- detect Alt+Ctrl+Del-presses under win32
-
-	* ica/src/vncview.cpp:
-	* ica/src/vncview.h:
-	- full support for level3-shift-key (AKA AltGr) and unicode-characters
-	  such as euro-sign
-	- unpress all modifiers when quitting
-
-	* ima/src/client.cpp:
-	- do not lock m_syncMutex when changing client-mode as it isn't
-	  neccessary anymore and just causes senseless delays
-	- only lock m_queueMutex where it is really needed, improves reaction-
-	  time when changing client-mode as well
-
-	* ima/src/client_manager.cpp:
-	much smaller delay when changing global client mode in the hope this
-	doesn't cause problems with demo-mode
-
-	* ima/src/client.cpp:
-	* ima/src/client_manager.cpp:
-	set mainWindow::m_clientManager in constructor of clientManager, so
-	code called out of it does not crash when using
-	mainWindow::m_clientManager
-
-2006-10-10	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/system_key_trapper.cpp:
-	* ica/src/system_key_trapper.h:
-	* ica/src/vncview.cpp:
-	* ica/src/vncview.h:
-	* ica/src/lock_widget.cpp:
-	added systemKeyTrapper, a class for trapping system-keys, especially
-	under win32
-
-	* ica/src/isd_server.cpp:
-	* ica/src/demo_server.cpp:
-	* ica/src/demo_server.h:
-	start demo-server on given port - bugfix
-
-	* ica/Makefile.am:
-	* ica/src/lock_widget.cpp:
-	* ica/src/inject.cpp:
-	* ica/src/inject.h:
-	inject some code into winlogon.exe for safely disabling Secure Attention
-	Sequence (SAS=Alt+Ctrl+Del) - much better than old solution which
-	simply disabled task-mgr by security-policy
-
-	* Makefile.am:
-	* ica/src/ica_main.cpp:
-	* utils-win32/HookNTQSI.dll:
-	try to hide ICA-process using HookNTQSI.dll
-
-2006-10-09	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	* ima/src/client_manager.cpp:
-	made client-windows resizable
-
-2006-10-08	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/vncview.h:
-	* ica/src/vncview.cpp:
-	revised whole key-event-handling, especially handling of modifiers -
-	now things like holding <Alt> while switching apps with <Alt>+<Tab> are
-	supported, <Control>+<any key> is now recognized (e.g. Ctrl+C), under
-	Linux/X11 native translation of X-keycodes is done when compiling with
-	Qt >= 4.2.0
-
-	* ica/src/vncview.cpp:
-	- do not pass QX11BypassWindowManagerHint to parent-widget as this
-	  causes troubles with Qt 4.2.0 and things work without it as well
-	- when viewing remote desktop, update every 70ms instead of 80ms
-
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	- sleep less between updates of demo-screen (20ms instead of 25ms)
-	- do check for cursor-movements with GUI-thread-affinity and send
-	  actual changes within thread in which socket to client was created
-
-	* ica/src/ica_main.cpp:
-	renamed parameters "-installservice" and "-removeservice" to
-	"-registerservice" and "-unregisterservice"
-
-	* common/include/isd_connection.h:
-	* ica/src/isd_server.cpp:
-	introduced helper-class "isdForwarder" which is used by VNC-server-
-	subprocess under Linux/X11 for forwarding all requests received by
-	VNC-server to actual ISD-server in parent-process
-
-	* ica/src/ica_main.cpp:
-	* ica/src/ivs.cpp:
-	* ica/src/ivs.h:
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	* ica/src/vncview.cpp:
-	under Linux/X11 VNC-server is now run in separate process which
-	introduces several changes in the whole client-application
-
-	* ica/src/isd_server.h:
-	* ica/src/isd_server.cpp:
-	* ica/src/ivs.cpp:
-	* ica/win32/src/vncClient.cpp:
-	removed global authSecTypeItalc()-method and made according function
-	in isdServer static
-
-	* common/include/ivs_connection.h:
-	* common/src/ivs_connection.cpp:
-	* ica/src/vncview.cpp:
-	use QImage instead of QPixmap as image-container for cursor-shape
-	which sometimes led to X-errors as dealing with QPixmap's in non-GUI-
-	threads isn't safe
-
-	* common/src/isd_connection.cpp:
-	do not create QTcpSocket as child of isdConnection as isdConnection
-	was created in another thread than the socket - fixes some bugs
-
-	* common/include/italc_rfb_ext.h:
-	* common/include/ivs_connection.h:
-	* common/src/isd_connection.cpp:
-	* common/src/ivs_connection.cpp:
-	new authentication-mechanism: authentication via a file which is only
-	readable by owner and over which challenge is transmitted
-
-	* common/include/isd_base.h:
-	* common/include/isd_connection.h:
-	* common/include/local_system.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* ica/src/isd_server.cpp:
-	* ica/src/isd_server.h:
-	* ima/src/main_window.cpp:
-	port for demo-server is chosen before it is started - makes
-	demoserver-port-info-response-message obsolete
-
-2006-10-07	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/snapshot_list.cpp:
-	do not crash when clicking one of the action-buttons while no item is
-	selected
-
-2006-10-06	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* configure.in:
-	do not check for linux/videodev.h-header as not really needed and
-	causes senseless warning
-
-	* Makefile.svn:
-	added for auto-creating files just removed from repository (see below)
-
-	* aclocal.m4:
-	* config.h.in:
-	* config.guess:
-	* config.sub:
-	* configure:
-	* depcomp:
-	* install-sh:
-	* missing:
-	* Makefile.in:
-	* common/Makefile.in:
-	* ica/Makefile.in:
-	* ima/Makefile.in:
-	* utils-win32/Makefile.in:
-	removed as these files should be generated on target-system
-
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	enqueue all actions which need writing to socket and process queue by
-	update-thread for using socket indeed only from one thread - supresses
-	some warnings and maybe iTALC also runs better
-
-	* ima/src/client_manager.cpp:
-	sleep 2 seconds between mode-changes of clients for avoiding troubles
-	with demo-server
-
-	* ima/src/main.cpp:
-	register quint16 as Qt-metatype at application-startup
-
-	* ica/src/service.cpp:
-	misc cleanups
-
-2006-09-27	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	in updater-thread: only reload client if it is visible
-
-	* ima/src/main.cpp:
-	register meta-type QModelIndex
-
-	* ima/src/support_widget.cpp:
-	use dynamic_cast for casting layout, as Qt4-MinGW-X is now built with
-	rtti-support and therefore doesn't make problems anymore
-
-	* common/src/local_system.cpp:
-	before trying to create path, check whether it already exists! makes
-	it possible to make snapshots etc.
-
-2006-09-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.h:
-	* ima/src/client.cpp:
-	* ima/src/main_window.cpp:
-	create threads for each client for reloading it instead of doing that
-	in one loop in main-window-updater-thread - if one client hangs, it
-	doesn't block the others anymore
-
-	* common/include/isd_base.h:
-	in socketDevice::socketDevice, pass Unbuffered-flag to open() for
-	making iTALC work with Qt 4.2
-
-2006-09-07	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/resources/de.ts:
-	updated German localization
-
-	* ima/src/client_manager.cpp:
-	* ima/src/config_widget.h:
-	* ima/src/config_widget.cpp:
-	* ima/src/tool_button.h:
-	* ima/src/tool_button.cpp:
-	added option for disabling balloon-tooltips for toolbar-buttons
-
-	* ima/dialogs/config.ui:
-	* ima/resources/userinterface.png:
-	* ima/italc.qrc:
-	* ima/src/config_widget.h:
-	* ima/src/config_widget.cpp:
-	- re-made config-workspace using ui-designer
-	- warn user when selecting local loopback as net-iface
-
-	* ima/dialogs/client_settings.ui:
-	corrected tab-order of input-fields
-
-	* common/include/isd_connection.h:
-	* common/include/local_system.h:
-	* common/src/isd_connection.cpp:
-	* common/src/local_system.cpp:
-	* ima/src/client.cpp:
-	implemented WOL under win32
-
-2006-09-05	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/local_system.cpp:
-	re-activated username-code using external userinfo-tool
-
-	* ica/src/ica_main.h:
-	* ica/src/ica_main.cpp:
-	* ica/src/service.h:
-	* ica/src/service.cpp:
-	added service-functionality under win32
-
-2006-09-04	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/isd_connection.cpp:
-	handle ItalcAuthNone
-
-	* ica/src/demo_server.h:
-	* ica/src/demo_server.cpp:
-	- create client-sockets within according threads (using
-	  socket-descriptors) - fixes segfaults and other bugs on SMP-systems
-	- do not rely on readyRead()-signal, use QTimer::singleShot instead
-
-	* ica/src/isd_server.cpp:
-	when doing host-based auth., pass _user-ptr to socket-dispatcher-call
-	for getting peer address - fixes crash of ica when acting as
-	demo-master
-
-2006-09-01	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/x11/libvncserver/auth.c:
-	* ica/src/isd_server.cpp:
-	* ica/src/ivs.cpp:
-	- enabled security-mechanisms
-	- fixed bugs in authentication via DSA-keys
-
-	* ica/src/isd_server.cpp:
-	- bugfixes in support for host-based auth.
-
-	* common/src/ivs_connection.cpp:
-	when running for demo-purposes, use app-internal-auth-mechanism
-
-	* ica/src/demo_server.cpp:
-	- first attempts to fix similiar bugs as in ivs.cpp (multithreading)
-	- do a host-based auth. for demo-clients instead of app-internal
-
-	* ica/src/ivs.cpp:
-	- build command-line-stuff within thread in which VNC-server will run
-	  later (fixes segfaults on Linux-SMP-machines)
-
-	* common/src/isd_connection.cpp:
-	- initialize privDSAKey before using it when still zero within
-	  authAgainstServer()
-	- made __role a global variable
-	- support for host-based auth.
-
-2006-08-30	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* Makefile.am:
-	added missing entries for copying win32-utils and mingwm10.dll into
-	win32-package
-
-2006-08-28	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/include/main_window.h:
-	* ima/src/client.cpp:
-	* ima/src/core/client_manager.cpp:
-	* ima/src/core/config_widget.cpp:
-	* ima/src/core/main.cpp:
-	completely revised demo-master-stuff using QNetworkInterface-class
-
-	* ima/src/3rdparty/*:
-	* ima/src/qnetworkinterface.cpp:
-	* ima/src/qnetworkinterface.h:
-	added implementation of QNetworkInterface from recent Qt 4.2-snapshot
-
-	* ima/src/client.cpp:
-	- use localSystem::ensurePathExists() before trying to save a snapshot
-	- when quitting iTALC, change mode of all clients to overview-mode
-	- draw semi-transparent background for toolbar
-
-2006-08-22	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/ivs_connection.cpp:
-	- update software-cursor when remote-controlling
-	- disabled XCursor-support as it's buggy under Win32
-
-	* ima/src/client.cpp:
-	when re-entering view-only-mode, check do not crash if passed
-	connection-pointer is NULL
-
-	* utils-w32/userinfo.cpp:
-	added userinfo-utility
-
-	* configure.in:
-	* Makefile.am:
-	* utils-w32/:
-	added directory for several utils used by win32-version of localSystem
-
-	* common/src/local_system.cpp:
-	(Win32)
-	as there're problems when using functions from netapi32.dll we can't
-	use some functions we need for getUserName(), therefore this code has
-	been moved to "userinfo"-utility which is called periodically by
-	userPollThread - localSystem::currentUser() now returns what the
-	userPollThread received when launching userinfo
-
-2006-08-18	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/client.cpp:
-	do not reload user-name each time screen is being updated, instead do
-	only if user-name not set so far or is "unknown"
-
-	* common/src/local_system.cpp:
-	completely new code for retrieving user-name and his full name of
-	logged in user under win
-
-2006-08-17	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/local_system.cpp:
-	correct system-calls for shutting down, rebooting and logging off user
-
-	* ima/src/client.cpp:
-	bugfixes
-
-2006-08-16	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/ivs_connection.cpp:
-	fixed some bugs in palette-filter/tight-encoding which were
-	responsible for grave graphic-errors in some cases (when using
-	mono-palette)
-
-	* common/include/ivs_connection.h:
-	* common/src/ivs_connection.cpp:
-	added Zlib-encoding
-
-	* common/include/rfb/rfbint.h:
-	* common/include/rfb/rfbconfig.h:
-	removed as generated by configure
-
-	* ima/resources/splash.png:
-	new modern splash-screen
-
-2006-08-15	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* common/src/ivs_connection.cpp:
-	disabled tight- and zlib-encoding for the moment as it causes
-	graphic-errors when connecting to Win32-VNC-server
-
-	* ima/src/client.cpp:
-	* ima/src/client_manager.cpp:
-	fixes with bool-vars
-
-	* ima/src/config_widget.cpp:
-	* ima/src/support_widget.cpp:
-	do a static_cast instead of dynamic_cast for getting pointer to layout
-	of parent - HACK for make app working on Win32/MinGW which has a problem
-	with dynamic_cast
-
-	* ima/src/kmultittabbar.cpp:
-	commented out some stuff which is does not work on Win32
-
-	* configure.in:
-	* ica/x11/:
-	* ica/x11/x11vnc.c:
-	upgraded to x11vnc 0.8.3
-
-2006-08-14	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/src/ica_main.cpp:
-	* ica/src/isd_server.cpp:
-	* common/include/isd_base.cpp:
-	* common/src/dsa_key.cpp:
-	* common/src/isd_connection.cpp:
-	* ima/src/client.cpp:
-	* ima/src/client_manager.cpp:
-	* ima/src/main.cpp:
-	* ima/src/main_window.cpp:
-	* ima/src/snapshot_list.cpp:
-	* ima/src/snapshot_list.h:
-	use new methods from localSystem-namespace for retrieving information
-	where to store keys and settings
-
-	* common/include/local_system.h:
-	* common/src/local_system.cpp:
-	added methods for platform-independent storage of keys and settings:
-	  - privateKeyPath()
-	  - publicKeyPath()
-	  - snapshotDir()
-	  - globalConfigPath()
-	  - personalConfigDir()
-	  - personalConfigPath()
-	  - ensurePathExists()
-
-	* ima/src/dialogs.h:
-	made derivation from ui-classes private
-
-	* common/include/paths.h:
-	removed
-
-	* AUTHORS:
-	cleaned up as now the whole code-base is what I worked out
-
-	* ima/src/client_manager.cpp:
-	* ima/src/client.cpp:
-	- do not include (not existing) dialog-specific header-files, use
-	  dialogs.h instead
-	- replace msgInputDialog-references with textMessageDialog
-
-	* ima/src/about_dialog.h:
-	* ima/src/about_dialog.cpp:
-	* ima/src/client_settings_dialog.h:
-	* ima/src/client_settings_dialog.cpp:
-	* ima/src/msg_input_dialog.h:
-	* ima/src/msg_input_dialog.cpp:
-	removed
-
-	* ima/src/dialog.cpp:
-	* ima/src/dialog.h:
-	* ima/dialogs/text_message.ui:
-	added text-message-dialog as replacement of msgInputDialog
-
-	* ima/src/support_widget.h:
-	* ima/src/support_widget.cpp:
-	removed code for dialog
-
-	* ima/src/dialogs.h:
-	* ima/src/dialogs.cpp:
-	moved code from about_dialog.*, client_settings_dialog.* and
-	support_widget.* into these files for having one central include-
-	and implementation-file for dialogs
-
-	* Makefile.am:
-	added target "win32-pkg" for creating distribution-zip-file of iTALC
-	including neccessary DLLs
-
-	* configure.in:
-	changed some optimization-flags
-
-2006-07-24	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ica/Makefile.am:
-	added missing files in EXTRA_DIST-section
-
-	* ica/src/lock_widget.cpp:
-	pass 0L instead of NULL as third argument to RegSetValueEx(...)-call
-	to avoid compiler-warning
-
-	* ica/src/win32/...:
-	added missing files
-
-	* common/src/local_system.cpp:
-	corrected shutdown-calls under win32 ("-t 0" instead of "-t0")
-
-2006-07-21	Tobias Doerffel	<tobydox/at/users/dot/sourceforge/dot/net>
-
-	* ima/src/support_widget.h:
-	* ima/src/support_widget.cpp:
-	* ima/dialogs/support.ui:
-	added dialog for supporting on arbitrary clients
-
-	* ima/src/help_widget.cpp:
-	* ima/src/help_widget.h:
-	moved to support_widget.*
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 0a46541..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,172 +0,0 @@
-INSTALLING AND SETTING UP iTALC FOR USE
-=========================================
-
-
-Please note that all instructions in this file apply to the Linux version of
-iTALC. Users of the win32 version of iTALC should run the installer which will
-guide you through the installation. Afterwards the graphical iTALC Management
-Console helps to set up iTALC.
-
-For further information you can also take a look at iTALC-Wiki:
-
-	http://italc.sf.net/wiki/
-
-
-
-Building iTALC
-----------------
-
-If you have ready to use packages (RPMs, DEBs etc.), you can skip this section
-and continue with "Install iTALC".
-
-
-Requirements:
-
-- libqt4-dev and qt4-dev-tools (Debian-based distributions) or qt4-devel
-  (Fedora etc.)
-- xorg-dev or similiar
-- libxtst-dev
-- libjpeg62-dev/libjpeg-devel
-- zlib1g-dev/zlib-devel
-- libssl-dev/openssl-devel
-- libpam0g-dev/pam-devel
-
-Of course GCC/G++ must not be missing...
-
-
-Building:
-
-	mkdir build
-	cd build
-	cmake ..
-
-If some requirements are not fullfilled, CMake will inform you about it and
-you will have to install the missing software before continuing.
-
-After CMake ran successfully you can run
-
-	make install
-
-Make sure you're issuing the "make install" as root! This will install iTALC
-directly on the computer.
-
-
-Read the next section on how to setup iTALC.
-
-
-
-Installing iTALC
--------------------
-
-Requirements:
-
-Of course you should have some computers, connected via TCP/IP network... :-)
-
-First you should download the neccessary packages depending on your
-Linux distribution. If there're no packages for your distribution,
-try to build iTALC yourself. See previous section for details.
-
-If there're unfulfilled requirements, your package management system (dpkg,
-RPM etc.) will complain about it.
-
-
-Installing:
-
-First you have to install the neccessary packages on your computer(s).
-On clients you only have to install the packages italc:
-
-on DPKG-based systems:
-
-
-	apt-get install italc-client
-
-
-on RPM-based systems:
-
-	rpm -i italc...rpm
-
-
-On the master computer you additionally need italc-master.
-
-	apt-get install italc-master
-
-or
-
-	rpm -i italc-master...rpm
-
-
-
-Setup an iTALC client
-----------------------
-
-On clients you have to make sure that the iTALC Client Application (ICA),
-is being started when either X is started or a user logs on.
-There're several methods to achieve this (this is why it's not done
-automatically when installing the package):
-
-1. Add the appropriate command ("ica &") to /etc/X11/xinit/xinitrc or
-   add an according desktop file to /etc/xdg/autostart.
-   This method isn't recommend, because ICA then runs with the user's
-   privileges -> the user is able to kill ICA and get out of teacher's
-   control.
-
-2. add "ica &" to /etc/X11/xdm/Xsetup. On some systems, this
-   doesn't take effect, so either edit /etc/kde4/kdm/Xsetup or
-   /etc/X11/gdm/Xsetup
-
-You can easily test whether all is fine by running telnet on port 11100 of the
-according compter.
-
-example:
-
-	telnet 192.168.1.2 11100
-
-
-You should see something like "RFB 003.008".
-
-
-
-Setup iTALC authentication
-----------------------------
-
-iTALC uses a sophisticated authentication concept to make sure only
-authorized persons are able to access computers using iTALC.
-
-The security is achieved by data signing and -verification using a public and
-a private key. Thus you have to create a key pair by invoking
-
-	imc -role teacher -createkeypair
-
-which will create a key pair in /etc/italc/keys.
-
-Now copy the directory /etc/italc/keys/public to each client. Make sure the
-whole directory including subdirectories and files are readable but not
-writable to normal users. If you have network shares (AFS, NFS, Samba etc.) it's
-recommended to copy this directory to a network share, set the according
-permissions and link it on each client to /etc/italc/keys. This way it's no
-problem to generate a new key pair (e.g. if the private key was compromised)
-
-Then (the most important thing!) make sure only the users which should be
-allowed to use iTALC have (only!) read access to /etc/italc/keys/private
-including subdirectories and files. In most cases you would have to create a
-group "teacher", add all teachers etc. to it and set permissions, so that only
-this group has read permissions.
-
-
-
-Setup clients and classrooms (i.e. client groups)
--------------------------------------------------
-
-Before using iTALC, you need tell iTALC which clients to access and how they're
-grouped. For doing so iTALC has an easy to use client manager. After starting
-iTALC, you can open it by clicking on the according button on iTALC's sidebar.
-
-Now you can add clients and client groups using the context menu.
-
-For installing the client configuration you made for other users, copy the
-XML files in $HOME/.italc/ into directory .italc in every iTALC user's home.
-You can also link the file 'GlobalConfig.xml' to one global client
-configuration in a public network directory, so that you can change every
-user's client config at once, if something in your network has changed (e.g. a
-client was exchanged -> different MAC address).
-
diff --git a/README b/README
deleted file mode 100644
index a13ce65..0000000
--- a/README
+++ /dev/null
@@ -1,75 +0,0 @@
-iTALC 2.0.1 - Intelligent Teaching and Learning with Computers
-===============================================================
-
-
-Copyright (c) 2004-2013 Tobias Doerffel
-
-
-
-This program is free software; you can redistribute it and/or modify 
-it under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-
-What is iTALC?
-----------------
-
-iTALC is a use- and powerful didactical tool which lets you view and control
-computers in your labs and interact with students in a modern way.
-
-iTALC has been designed for usage in school.
-Therefore it offers a lot of possibilities to teachers, such as
-
-  * see what's going on in computer-labs by using overview mode and make snapshots
-  * remote-control computers to support and help other people
-  * show a demo (either in fullscreen or in a window) - the teacher's screen is
-    shown on all student's computers in realtime
-  * lock workstations for moving undivided attention to teacher
-  * send text-messages to students
-  * powering on/off and rebooting computers per remote
-  * remote logon and logoff and remote execution of arbitrary commands/scripts
-  * home-schooling - iTALC's network-technology is not restricted to a subnet
-    and therefore students at home can join lessons via VPN-connections just by
-    installing iTALC client software
-
-
-
-How to build, install and setup iTALC
----------------------------------------
-
-* Linux:
-   run CMake, make and make install - see INSTALL for details.
-
-* Windows:
-   run setup file
-
-
-
-More Information
-------------------
-
-http://italc.sourceforge.net/
-http://italc.sourceforge.net/wiki/
-
-
-
-Help developing iTALC
------------------------
-
-If you want to help developing iTALC, have any problems or anything else,
-feel free to e-mail me!
-
-My e-mail-adress: tobydox/at/users/dot/sf/dot/net
-
-
diff --git a/README.LZO b/README.LZO
deleted file mode 100644
index c0bf7ee..0000000
--- a/README.LZO
+++ /dev/null
@@ -1,124 +0,0 @@
-
- ============================================================================
- miniLZO -- mini subset of the LZO real-time data compression library
- ============================================================================
-
- Author  : Markus Franz Xaver Johannes Oberhumer
-           <markus at oberhumer.com>
-           http://www.oberhumer.com/opensource/lzo/
- Version : 2.05
- Date    : 23 Apr 2011
-
- I've created miniLZO for projects where it is inconvenient to
- include (or require) the full LZO source code just because you
- want to add a little bit of data compression to your application.
-
- miniLZO implements the LZO1X-1 compressor and both the standard and
- safe LZO1X decompressor. Apart from fast compression it also useful
- for situations where you want to use pre-compressed data files (which
- must have been compressed with LZO1X-999).
-
- miniLZO consists of one C source file and three header files:
-    minilzo.c
-    minilzo.h, lzoconf.h, lzodefs.h
-
- To use miniLZO just copy these files into your source directory, add
- minilzo.c to your Makefile and #include minilzo.h from your program.
- Note: you also must distribute this file ('README.LZO') with your project.
-
- minilzo.o compiles to about 6 KiB (using gcc or Visual C on an i386), and
- the sources are about 30 KiB when packed with zip - so there's no more
- excuse that your application doesn't support data compression :-)
-
- For more information, documentation, example programs and other support
- files (like Makefiles and build scripts) please download the full LZO
- package from
-    http://www.oberhumer.com/opensource/lzo/
-
- Have fun,
-  Markus
-
-
- P.S. minilzo.c is generated automatically from the LZO sources and
-      therefore functionality is completely identical
-
-
- Appendix A: building miniLZO
- ----------------------------
- miniLZO is written such a way that it should compile and run
- out-of-the-box on most machines.
-
- If you are running on a very unusual architecture and lzo_init() fails then
- you should first recompile with '-DLZO_DEBUG' to see what causes the failure.
- The most probable case is something like 'sizeof(void *) != sizeof(size_t)'.
- After identifying the problem you can compile by adding some defines
- like '-DSIZEOF_VOID_P=8' to your Makefile.
-
- The best solution is (of course) using Autoconf - if your project uses
- Autoconf anyway just add '-DMINILZO_HAVE_CONFIG_H' to your compiler
- flags when compiling minilzo.c. See the LZO distribution for an example
- how to set up configure.ac.
-
-
- Appendix B: list of public functions available in miniLZO
- ---------------------------------------------------------
- Library initialization
-    lzo_init()
-
- Compression
-    lzo1x_1_compress()
-
- Decompression
-    lzo1x_decompress()
-    lzo1x_decompress_safe()
-
- Checksum functions
-    lzo_adler32()
-
- Version functions
-    lzo_version()
-    lzo_version_string()
-    lzo_version_date()
-
- Portable (but slow) string functions
-    lzo_memcmp()
-    lzo_memcpy()
-    lzo_memmove()
-    lzo_memset()
-
-
- Appendix C: suggested macros for 'configure.ac' when using Autoconf
- -------------------------------------------------------------------
- Checks for typedefs and structures
-    AC_CHECK_TYPE(ptrdiff_t,long)
-    AC_TYPE_SIZE_T
-    AC_CHECK_SIZEOF(short)
-    AC_CHECK_SIZEOF(int)
-    AC_CHECK_SIZEOF(long)
-    AC_CHECK_SIZEOF(long long)
-    AC_CHECK_SIZEOF(__int64)
-    AC_CHECK_SIZEOF(void *)
-    AC_CHECK_SIZEOF(size_t)
-    AC_CHECK_SIZEOF(ptrdiff_t)
-
- Checks for compiler characteristics
-    AC_C_CONST
-
- Checks for library functions
-    AC_CHECK_FUNCS(memcmp memcpy memmove memset)
-
-
- Appendix D: Copyright
- ---------------------
- LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Markus Franz Xaver Oberhumer <markus at oberhumer.com>.
-
- LZO and miniLZO are distributed under the terms of the GNU General
- Public License (GPL).  See the file COPYING.
-
- Special licenses for commercial and other applications which
- are not willing to accept the GNU General Public License
- are available by contacting the author.
-
-
diff --git a/TODO b/TODO
deleted file mode 100644
index af63bb8..0000000
--- a/TODO
+++ /dev/null
@@ -1,36 +0,0 @@
-TODO
-=====
-
-
-
-Roadmap
-========
-
-iTALC 1.1 (Q2-Q3 2007)
------------------------
-
-- better LTSP-support
-- support for VPN-connections/-gateways etc.
-- better integration into common Linux-distributions
-- clean uninstallation/win32
-- self-adjusting demo-mode for optimal performance?
-- full documentation / manual (with help-browser?)
-
-
-iTALC 2.0 (Q4 2007 - Q1 2008)
-------------------------------
-
-- OS X support
-- iTALC Plugin Architecture (IPA) - also allowing proprietary plugins
-- ideas for plugins (won't be realized completely in 2.0):
-   * file-collecting and -distributing
-   * audio- and video-streaming support (VLC?)
-   * modules for importing information about clients (name, IP, MAC-addres)
-     (LDAP, NIS, Subnet-Scan, XML- and CSV-file ...)
-   * chat-management-system
-   * annotate-plugin
-   * internet-access-control module
-- iTALC Server Application (ISA) for hosting server-side plugins
-  (i.e. internet-access control)
-- encrypted network-traffic
-
diff --git a/build_mingw32 b/build_mingw32
deleted file mode 100755
index 42d0e16..0000000
--- a/build_mingw32
+++ /dev/null
@@ -1,6 +0,0 @@
-MINGW=/opt/mingw32
-export PATH=$PATH:$MINGW/bin
-export CFLAGS=""
-export CXXFLAGS="$CFLAGS"
-cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/modules/Win32Toolchain.cmake -DCMAKE_MODULE_PATH=`pwd`/../cmake/modules/
-
diff --git a/build_mingw64 b/build_mingw64
deleted file mode 100755
index 5639b40..0000000
--- a/build_mingw64
+++ /dev/null
@@ -1,6 +0,0 @@
-MINGW=/opt/mingw64
-export PATH=$PATH:$MINGW/bin
-export CFLAGS=""
-export CXXFLAGS="$CFLAGS"
-cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/modules/Win64Toolchain.cmake -DCMAKE_MODULE_PATH=`pwd`/../cmake/modules/
-
diff --git a/cmake/modules/DetectMachine.cmake b/cmake/modules/DetectMachine.cmake
deleted file mode 100644
index 5e27048..0000000
--- a/cmake/modules/DetectMachine.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-IF(WIN32)
-	SET(ITALC_BUILD_WIN32 1)
-ELSE(WIN32)
-	IF(APPLE)
-		SET(ITALC_BUILD_APPLE 1)
-	ELSE(APPLE)
-		SET(ITALC_BUILD_LINUX 1)
-	ENDIF(APPLE)
-ENDIF(WIN32)
-
-SET(ITALC_HOST_X86 FALSE)
-SET(ITALC_HOST_X86_64 FALSE)
-
-EXEC_PROGRAM( ${CMAKE_C_COMPILER} ARGS "-dumpmachine" OUTPUT_VARIABLE Machine )
-STRING(REGEX MATCH "i.86" IS_X86 "${Machine}")
-STRING(REGEX MATCH "86_64" IS_X86_64 "${Machine}")
-
-IF(WIN32)
-	IF(WIN64)
-		SET(IS_X86_64 TRUE)
-		SET(ITALC_BUILD_WIN64 TRUE)
-	ELSE(WIN64)
-		SET(IS_X86 TRUE)
-	ENDIF(WIN64)
-ENDIF(WIN32)
-
-IF(IS_X86)
-	SET(ITALC_HOST_X86 TRUE)
-ELSEIF(IS_X86_64)
-	SET(ITALC_HOST_X86_64 TRUE)
-ELSE(IS_X86)
-	MESSAGE("Can't identify target host. Assuming 32 bit platform.")
-ENDIF(IS_X86)
-
-IF(CMAKE_INSTALL_LIBDIR)
-    SET(LIB_DIR "${CMAKE_INSTALL_LIBDIR}")
-ELSE(CMAKE_INSTALL_LIBDIR)
-	SET(LIB_DIR lib)
-ENDIF(CMAKE_INSTALL_LIBDIR)
-
diff --git a/cmake/modules/FindPAM.cmake b/cmake/modules/FindPAM.cmake
deleted file mode 100644
index 3499836..0000000
--- a/cmake/modules/FindPAM.cmake
+++ /dev/null
@@ -1,74 +0,0 @@
-# - Try to find the PAM libraries
-# Once done this will define
-#
-#  PAM_FOUND - system has pam
-#  PAM_INCLUDE_DIR - the pam include directory
-#  PAM_LIBRARIES - libpam library
-
-if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
-	# Already in cache, be silent
-	set(PAM_FIND_QUIETLY TRUE)
-endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
-
-find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h)
-find_library(PAM_LIBRARY pam)
-find_library(DL_LIBRARY dl)
-
-if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
-	set(PAM_FOUND TRUE)
-	if (DL_LIBRARY)
-		set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
-	else (DL_LIBRARY)
-		set(PAM_LIBRARIES ${PAM_LIBRARY})
-	endif (DL_LIBRARY)
-
-	if (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
-		# darwin claims to be something special
-		set(HAVE_PAM_PAM_APPL_H 1)
-	endif (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
-
-	if (NOT DEFINED PAM_MESSAGE_CONST)
-		include(CheckCXXSourceCompiles)
-		# XXX does this work with plain c?
-		check_cxx_source_compiles("
-#if ${HAVE_PAM_PAM_APPL_H}+0
-# include <pam/pam_appl.h>
-#else
-# include <security/pam_appl.h>
-#endif
-
-static int PAM_conv(
-	int num_msg,
-	const struct pam_message **msg, /* this is the culprit */
-	struct pam_response **resp,
-	void *ctx)
-{
-	return 0;
-}
-
-int main(void)
-{
-	struct pam_conv PAM_conversation = {
-		&PAM_conv, /* this bombs out if the above does not match */
-		0
-	};
-
-	return 0;
-}
-" PAM_MESSAGE_CONST)
-	endif (NOT DEFINED PAM_MESSAGE_CONST)
-	set(PAM_MESSAGE_CONST ${PAM_MESSAGE_CONST} CACHE BOOL "PAM expects a conversation function with const pam_message")
-
-endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
-
-if (PAM_FOUND)
-	if (NOT PAM_FIND_QUIETLY)
-		message(STATUS "Found PAM: ${PAM_LIBRARIES}")
-	endif (NOT PAM_FIND_QUIETLY)
-else (PAM_FOUND)
-	if (PAM_FIND_REQUIRED)
-		message(FATAL_ERROR "PAM was not found")
-	endif(PAM_FIND_REQUIRED)
-endif (PAM_FOUND)
-
-mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY PAM_MESSAGE_CONST)
diff --git a/cmake/modules/MinGWCrossCompile.cmake b/cmake/modules/MinGWCrossCompile.cmake
deleted file mode 100644
index ebc0c99..0000000
--- a/cmake/modules/MinGWCrossCompile.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-# this one is important
-SET(CMAKE_SYSTEM_NAME Windows)
-#this one not so much
-SET(CMAKE_SYSTEM_VERSION 1)
-
-# where is the target environment 
-SET(CMAKE_FIND_ROOT_PATH	${MINGW_PREFIX})
-SET(CMAKE_INSTALL_PREFIX	${MINGW_PREFIX})
-
-SET(MINGW_TOOL_PREFIX		${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-)
-
-# specify the cross compiler
-SET(CMAKE_RC_COMPILER		${MINGW_TOOL_PREFIX}gcc)
-SET(CMAKE_C_COMPILER		${MINGW_TOOL_PREFIX}gcc)
-SET(CMAKE_CXX_COMPILER		${MINGW_TOOL_PREFIX}g++)
-
-# specify location of some tools
-SET(STRIP					${MINGW_TOOL_PREFIX}strip)
-SET(WINDRES					${MINGW_TOOL_PREFIX}windres)
-SET(PKG_CONFIG_EXECUTABLE	${MINGW_TOOL_PREFIX}pkg-config)
-
-SET(QT_BINARY_DIR			${MINGW_PREFIX}/bin)
-SET(QT_QMAKE_EXECUTABLE		${QT_BINARY_DIR}/qmake)
-
-# search for programs in the build host directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-# for libraries and headers in the target directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-SET(CMAKE_INCLUDE_PATH ${MINGW_PREFIX}/include)
-
-INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include)
-LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin)
-
diff --git a/cmake/modules/Qt4Hacks.cmake b/cmake/modules/Qt4Hacks.cmake
deleted file mode 100644
index 852832f..0000000
--- a/cmake/modules/Qt4Hacks.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
- MACRO(QT4_CREATE_TRANSLATION_FOR_QRC _qm_files _qrc_file)
-      SET(_my_sources)
-      SET(_my_tsfiles)
-      FOREACH (_file ${ARGN})
-         GET_FILENAME_COMPONENT(_ext ${_file} EXT)
-         GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
-         IF(_ext MATCHES "ts")
-           LIST(APPEND _my_tsfiles ${_abs_FILE})
-         ELSE(_ext MATCHES "ts")
-           LIST(APPEND _my_sources ${_abs_FILE})
-         ENDIF(_ext MATCHES "ts")
-      ENDFOREACH(_file)
-      FOREACH(_ts_file ${_my_tsfiles})
-        ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
-           COMMAND ${QT_LUPDATE_EXECUTABLE}
-           ARGS ${_my_sources} -ts ${_ts_file} DEPENDS ${_qrc_file})
-      ENDFOREACH(_ts_file)
-      QT4_ADD_TRANSLATION_FOR_QRC(${_qm_files} ${_my_tsfiles})
-ENDMACRO(QT4_CREATE_TRANSLATION_FOR_QRC)
-
-MACRO(QT4_ADD_TRANSLATION_FOR_QRC _qm_files)
-      FOREACH (_current_FILE ${ARGN})
-         GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
-         GET_FILENAME_COMPONENT(qm_path ${_abs_FILE} PATH)
-         GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
-         SET(qm "${qm_path}/${qm}.qm")
-
-         ADD_CUSTOM_COMMAND(OUTPUT ${qm}
-            COMMAND ${QT_LRELEASE_EXECUTABLE}
-            ARGS ${_abs_FILE} -qm ${qm}
-            DEPENDS ${_abs_FILE}
-         )
-         SET(${_qm_files} ${${_qm_files}} ${qm})
-      ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_ADD_TRANSLATION_FOR_QRC)
-
-MACRO(QT4_TRANSLATIONS_FOR_QRC _qrc_file)
-	SET(TS_FILES)
-	FOREACH(_lang ${SUPPORTED_LANGUAGES})
-		LIST(APPEND TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/${_lang}.ts")
-	ENDFOREACH(_lang ${SUPPORTED_LANGUAGES})
-	QT4_CREATE_TRANSLATION_FOR_QRC(_qm_files ${_qrc_file} ${ARGN} ${TS_FILES})
-ENDMACRO(QT4_TRANSLATIONS_FOR_QRC _qrc_file)
-
diff --git a/cmake/modules/Win32Toolchain.cmake b/cmake/modules/Win32Toolchain.cmake
deleted file mode 100644
index e2b837b..0000000
--- a/cmake/modules/Win32Toolchain.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-SET(MINGW_PREFIX /opt/mingw32)
-SET(MINGW_PLATFORM win32)
-
-SET(CMAKE_SYSTEM_PROCESSOR i686)
-
-INCLUDE(MinGWCrossCompile)
diff --git a/cmake/modules/Win64Toolchain.cmake b/cmake/modules/Win64Toolchain.cmake
deleted file mode 100644
index 40bf539..0000000
--- a/cmake/modules/Win64Toolchain.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-SET(MINGW_PREFIX /opt/mingw64)
-SET(MINGW_PLATFORM win64)
-
-SET(CMAKE_SYSTEM_PROCESSOR x86_64)
-
-SET(WIN64 TRUE)
-
-
-INCLUDE(MinGWCrossCompile)
-
diff --git a/contrib/README.txt b/contrib/README.txt
deleted file mode 100644
index 6494e18..0000000
--- a/contrib/README.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-ADMX files for Active Directory integration of iTALC have been provided by
-Peter Gigengack <Peter/dot/Gigengack/at/sthildas/dot/wa/dot/edu/dot/au>:
-
-================================================================================
-
-I believe I have successfully created an ADMX template that will work for
-iTALC 2. Each of the policies when created will control the parameters in use
-created/modified when using the iTALC Management Console.
- 
-The only limitation as mentioned in previous emails is using the Active Directory
-integrated or “Logon settings” from authentication where binary values are
-created in registry which cannot be created with an ADMX template in the group
-policy.  This would be best created using the command line options as suggested
-in your last email:
- 
-  I guess you won't be able to somehow generate this binary data. Easiest 
-  possibility will be to export current settings in IMC as XML file, delete all 
-  undesired settings from that file (e.g. only leave the LogonACL tags etc.) and 
-  run  "imc -ApplySettings mySettings.xml".
- 
-From the testing in my AD environment the settings do get applied correctly.
-I would suggest that a couple people who may be interested could try it if they
-were happy to test it. I have filled out the explanations/help sections of each
-policy as much as possible within the ADMX template, however there were several
-that I left.
-
-================================================================================
-
diff --git a/contrib/en-US/italc.adml b/contrib/en-US/italc.adml
deleted file mode 100644
index 65506cf..0000000
--- a/contrib/en-US/italc.adml
+++ /dev/null
@@ -1,198 +0,0 @@
-<policyDefinitionResources revision="1.0" schemaVersion="1.0">
-  <displayName>
-  </displayName>
-  <description>
-  </description>
-  <resources>
-    <stringTable>
-      <string id="CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005">iTALC</string>
-      <string id="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0">General</string>
-      <string id="POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11">Hide Tray Icon</string>
-      <string id="POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11_Help">This policy setting changes the behavior of the iTALC client displaying the system tray icon. 
-
-If you enable this policy the iTALC system tray icon will not be displayed
-
-If you disable this policy the iTALC system tray icon will be displayed
-
-The default setting is that the system tray icon will be displayed.</string>
-      <string id="POL_662B8988_93CC_4255_9569_06D871FA5620">Service Autostart</string>
-      <string id="POL_662B8988_93CC_4255_9569_06D871FA5620_Help">This policy setting changes the starting behavior of the iTALC service
-
-If you enable this policy the iTALC service will start automatically at startup
-
-If you disable this policy the iTALC service will not start automatically at startup
-
-The default setting is that the iTALC service starts automatically at startup i.e. Enabled</string>
-      <string id="POL_7773AF6B_B297_400B_8D84_BBD247EAC334">Log File Directory</string>
-      <string id="POL_7773AF6B_B297_400B_8D84_BBD247EAC334_Help">This policy setting changes the logging directory for the iTALC service.  The default location is the %temp% folder which is normally located at c:\windows\temp\
-</string>
-      <string id="POL_2EDF2411_B7EF_4E25_B545_9463015CE39E">Log Level</string>
-      <string id="POL_C7358096_E7C6_4A9D_96FE_AE48C78CC770">Log to standard error output</string>
-      <string id="POL_FE44DB41_2023_44B8_8C1B_86730F5B84B6">Additional Arguments</string>
-      <string id="CAT_D70BA71E_524E_4561_833B_8A6D8852360D">Paths</string>
-      <string id="POL_812B4929_AA2A_491F_9EE6_457D5074F8E6">Global Configuration</string>
-      <string id="POL_AF018DCF_30AD_41AB_8DFF_29C174C4D17B">Personal Configuration</string>
-      <string id="POL_CDE8DA03_8E43_428A_B57E_8031656B83B1">Snapshot Directory</string>
-      <string id="CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E">Authentication</string>
-      <string id="POL_9DD077A5_0E53_412F_97C9_1769609B7DA9">Key File Authentication</string>
-      <string id="POL_F622107A_F3E6_418B_95EE_3DDEB80646EA">ACL-Based Logon Authentication</string>
-      <string id="POL_9DD077A5_0E53_412F_97C9_1769609B7DA9_Help">This policy setting allows you to enable or disable Key File Authentication between master and clients.
-
-If you Enable this policy setting Key File Authentication will be enabled on the iTALC service
-
-If you Disable this policy setting Key File Authentication will be disabled on the iTALC service
-
-The default setting for iTALC is to be Enabled.
-
-NB.  If both Key File and ACL-based Logon Authentication methods are disabled then an iTALC Master will not be able to contact the client
-
-When this policy is Enabled you must also configure a public and private key base directory.  By default the keys are stored on the local client</string>
-      <string id="POL_F622107A_F3E6_418B_95EE_3DDEB80646EA_Help">This policy setting allows you to enable or disable ACL-based Logon Authentication between master and clients
-
-If you Enable this policy setting ACL-based Logon Authentication will be enabled on the iTALC service
-
-If you Disable this policy setting ACL-based Logon Authentication will be disabled on the iTALC service
-
-The default setting for iTALC is to be Enabled.
-
-NB.  If both Key File and ACL-based Logon Authentication methods are disabled then an iTALC Master will not be able to contact the client</string>
-      <string id="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F">Server</string>
-      <string id="POL_0A4FF41B_EAC7_4DFA_B143_C5C911528B36">Enable capturing of layered (semi-transparent) windows</string>
-      <string id="POL_3E564BAB_A95E_4C4F_B12E_7849DDAB127C">Poll Full Screen</string>
-      <string id="POL_315D0DCE_88E6_481F_ADC7_42147A288D65">Low Accuracy (turbo mode)</string>
-      <string id="POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA">Demo Server Backend</string>
-      <string id="ITM_6FC14439_C03E_49A4_A438_8D5F17766C94">VNC Reflector</string>
-      <string id="ITM_8321B5CD_5BEE_4EAF_9B7D_62BC0E0DED81">iTALC 1 Demo Server</string>
-      <string id="POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6">Multithreading</string>
-      <string id="POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6_Help">This policy setting changes the multithreaded behavior of the iTALC service.
-
-If you enable this policy the iTALC service will run with Multithreading when using the VNC Reflector backend
-
-If you disable this policy the iTALC service will not run with Multithreading when using the VNC Reflector backend
-
-The default setting is to have Multithreading enabled</string>
-      <string id="POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA_Help">
-      </string>
-      <string id="POL_789CFC83_C979_4BD5_9760_C39916C6786F">Core Server Port</string>
-      <string id="POL_789CFC83_C979_4BD5_9760_C39916C6786F_Help">This policy setting changes the network port on which the iTALC service listens for requests
-
-The default Core Server Port is 11100
-</string>
-      <string id="POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3">Demo server port</string>
-      <string id="POL_5CB7663E_F4FC_4462_A353_FDD5FB0B90A0">Enable firewall exception</string>
-      <string id="POL_5CB7663E_F4FC_4462_A353_FDD5FB0B90A0_Help">This policy setting changes if a firewall exception has been made for the iTALC service
-
-If you enable this policy the iTALC service icon will create a firewall exception for the ica.exe process
-
-The default setting is to have an exception placed in the firewall</string>
-      <string id="POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3_Help">
-      </string>
-      <string id="POL_BD6B9FA6_D9B1_497D_B9D7_857FE2871480">Allow connections from localhost only</string>
-      <string id="POL_BD6B9FA6_D9B1_497D_B9D7_857FE2871480_Help">This policy setting changes the iTALC service to listen for requests only on the localhost or 127.0.0.1 (loopback) address.
-
-If you enable this policy the iTALC service will run listening only to the localhost or 127.0.0.1 (loopback) address.
-
-If you disable this policy the iTALC service will listen on all interfaces for requests.
-
-The default setting is to be disabled and allow connections from all sources.</string>
-      <string id="POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8">Enable HTTP Server</string>
-      <string id="POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8_Help">This policy setting changes the iTALC service to run a HTTP server which provides a JavaViewer applet
-
-If you enable this policy the iTALC service will run with a HTTP server.
-
-If you disable this policy the iTALC service will not run with a HTTP server
-
-The default setting is to be disabled
-
-When enabling this policy you should also set a HTTP server port on which the HTTP server will listen on.</string>
-      <string id="ITM_8ED46BE0_B873_45A7_A78C_881C66BCC8AB">Nothing</string>
-      <string id="ITM_7CA444CB_EA44_494E_A49E_A36360058B05">Only Critical Messages</string>
-      <string id="ITM_7F639549_7B94_4047_B890_0689EA436A8C">Warnings and Errors</string>
-      <string id="ITM_E6465EB9_8B8F_4E0F_A361_724EA3DCBC06">Information, warnings and errors</string>
-      <string id="ITM_D2A5DF60_E5DF_4432_AF5A_4210AB20470A">Debug messages and everything else</string>
-      <string id="POL_5F42AD52_12DE_415D_9E1A_F99E6EF218EA">Limit log file size</string>
-      <string id="POL_F3F42BE8_3CDF_4FA4_8AEA_DE90699FAE76">Log to Windows event log</string>
-      <string id="POL_6A15AC8F_D05F_40A6_8F33_F02BE63FDB92">Access confirmation - Key file Authentication</string>
-      <string id="POL_82CAE5C2_998D_4EB5_BF9E_8C6414C40003">Access confirmation - Logon Authentication</string>
-      <string id="POL_B3A40764_63FC_4BE1_AF56_5AA7DCAE5258">Enable desktop switching for screen lock (experimental)</string>
-      <string id="POL_2EDF2411_B7EF_4E25_B545_9463015CE39E_Help">This policy setting changes the log level detail for the iTALC service.</string>
-      <string id="POL_C7358096_E7C6_4A9D_96FE_AE48C78CC770_Help">
-      </string>
-      <string id="POL_F3F42BE8_3CDF_4FA4_8AEA_DE90699FAE76_Help">This policy setting allows the iTALC log to be added to the windows event log.
-
-If you enable this policy the iTALC service will send logs to the windows event log
-
-If you disable this policy the iTALC service will not send logs to the windows event log
-
-The default setting is disabled</string>
-      <string id="POL_B3A40764_63FC_4BE1_AF56_5AA7DCAE5258_Help">
-      </string>
-    </stringTable>
-    <presentationTable>
-      <presentation id="POL_7773AF6B_B297_400B_8D84_BBD247EAC334">
-        <textBox refId="TXT_BC01A7E3_4B4C_4FC4_B216_0D094C18D960">
-          <label>Log File Directory</label>
-          <defaultValue>%TEMP%</defaultValue>
-        </textBox>
-      </presentation>
-      <presentation id="POL_2EDF2411_B7EF_4E25_B545_9463015CE39E">
-        <dropdownList refId="DST_B780FD16_FCA9_4ACC_BA08_99D8FE87F9C8" defaultItem="0">Log Level</dropdownList>
-      </presentation>
-      <presentation id="POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11" />
-      <presentation id="POL_812B4929_AA2A_491F_9EE6_457D5074F8E6">
-        <textBox refId="TXT_1BD429DA_5FE1_42CB_8D7A_58DE15956FA0">
-          <label>Specify the Global Configuration path</label>
-          <defaultValue>$APPDATA\GlobalConfig.xml</defaultValue>
-        </textBox>
-      </presentation>
-      <presentation id="POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA">
-        <dropdownList refId="DST_600D95A8_3EAF_4D25_BBF1_5A0B84D1B577" defaultItem="0">Backend</dropdownList>
-      </presentation>
-      <presentation id="POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6" />
-      <presentation id="POL_789CFC83_C979_4BD5_9760_C39916C6786F">
-        <decimalTextBox refId="DXT_414AE5C6_3D02_43A5_8698_942530126DED" defaultValue="11100">Core Server Port</decimalTextBox>
-      </presentation>
-      <presentation id="POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3">
-        <decimalTextBox refId="DXT_9D6EF27F_5710_4B65_B36B_59B8AC34AB1D" defaultValue="11400">Demo Server Port</decimalTextBox>
-      </presentation>
-      <presentation id="POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8">
-        <decimalTextBox refId="DXT_AF6B507A_8C97_4706_BDCE_7900742047B4" defaultValue="5800">HTTP Server Port</decimalTextBox>
-      </presentation>
-      <presentation id="POL_9DD077A5_0E53_412F_97C9_1769609B7DA9">
-        <textBox refId="TXT_10B8096A_C236_4AFB_9645_00F24D623534">
-          <label>Public key file base directory</label>
-          <defaultValue>$GLOBALAPPDATA\keys\public</defaultValue>
-        </textBox>
-        <textBox refId="TXT_DFEE24A6_F32C_4F73_8211_5189B619BA3E">
-          <label>Private key file base directory</label>
-          <defaultValue>$GLOBALAPPDATA\keys\private</defaultValue>
-        </textBox>
-      </presentation>
-      <presentation id="POL_AF018DCF_30AD_41AB_8DFF_29C174C4D17B">
-        <textBox refId="TXT_8062DA4D_351A_485F_A908_D213AC03099F">
-          <label>Personal Configuration Path</label>
-          <defaultValue>$APPDATA\PersonalConfig.xml</defaultValue>
-        </textBox>
-      </presentation>
-      <presentation id="POL_CDE8DA03_8E43_428A_B57E_8031656B83B1">
-        <textBox refId="TXT_285A3E7F_4E08_481B_AC98_6E651FA87084">
-          <label>Snapshot Directory Path</label>
-          <defaultValue>$APPDATA\Snapshots</defaultValue>
-        </textBox>
-      </presentation>
-      <presentation id="POL_FE44DB41_2023_44B8_8C1B_86730F5B84B6">
-        <textBox refId="TXT_A82D7855_F654_4DA2_AB92_9285A298D8EF">
-          <label>Additional Startup Arguements</label>
-          <defaultValue>
-          </defaultValue>
-        </textBox>
-      </presentation>
-      <presentation id="POL_5F42AD52_12DE_415D_9E1A_F99E6EF218EA">
-        <decimalTextBox refId="DXT_B6F2D87F_B738_4C7A_8530_1C12C3C65F84">Limit log file size (MB)</decimalTextBox>
-      </presentation>
-      <presentation id="POL_82CAE5C2_998D_4EB5_BF9E_8C6414C40003">
-        <checkBox refId="CHK_203AD3C4_4D8C_46BB_B117_6A9B02F6FA76">Allow same user to access desktop without confirmation</checkBox>
-      </presentation>
-    </presentationTable>
-  </resources>
-</policyDefinitionResources>
\ No newline at end of file
diff --git a/contrib/italc.admx b/contrib/italc.admx
deleted file mode 100644
index 59359ff..0000000
--- a/contrib/italc.admx
+++ /dev/null
@@ -1,327 +0,0 @@
-<policyDefinitions revision="1.0" schemaVersion="1.0">
-  <policyNamespaces>
-    <target prefix="fullarmor" namespace="FullArmor.Policies.42CC9973_C881_4AE4_9520_734C46E506A9" />
-    <using prefix="windows" namespace="Microsoft.Policies.Windows" />
-  </policyNamespaces>
-  <supersededAdm fileName="" />
-  <resources minRequiredRevision="1.0" />
-  <categories>
-    <category name="CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005" displayName="$(string.CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005)" />
-    <category name="CAT_D70BA71E_524E_4561_833B_8A6D8852360D" displayName="$(string.CAT_D70BA71E_524E_4561_833B_8A6D8852360D)">
-      <parentCategory ref="CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005" />
-    </category>
-    <category name="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" displayName="$(string.CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F)">
-      <parentCategory ref="CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005" />
-    </category>
-    <category name="CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E" displayName="$(string.CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E)">
-      <parentCategory ref="CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005" />
-    </category>
-    <category name="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" displayName="$(string.CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0)">
-      <parentCategory ref="CAT_E6822BC9_5417_4E95_8BBA_CD94F08CD005" />
-    </category>
-  </categories>
-  <policies>
-    <policy name="POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11" class="Machine" displayName="$(string.POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11)" explainText="$(string.POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11_Help)" presentation="$(presentation.POL_9A9480B3_E1F7_4129_A2EE_5DEBB661FE11)" key="SOFTWARE\iTALC Solutions\iTALC\Service" valueName="HideTrayIcon">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_662B8988_93CC_4255_9569_06D871FA5620" class="Machine" displayName="$(string.POL_662B8988_93CC_4255_9569_06D871FA5620)" explainText="$(string.POL_662B8988_93CC_4255_9569_06D871FA5620_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Service" valueName="Autostart">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_7773AF6B_B297_400B_8D84_BBD247EAC334" class="Machine" displayName="$(string.POL_7773AF6B_B297_400B_8D84_BBD247EAC334)" explainText="$(string.POL_7773AF6B_B297_400B_8D84_BBD247EAC334_Help)" presentation="$(presentation.POL_7773AF6B_B297_400B_8D84_BBD247EAC334)" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogFileDirectory">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <text id="TXT_BC01A7E3_4B4C_4FC4_B216_0D094C18D960" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogFileDirectory" required="true" />
-      </elements>
-    </policy>
-    <policy name="POL_2EDF2411_B7EF_4E25_B545_9463015CE39E" class="Machine" displayName="$(string.POL_2EDF2411_B7EF_4E25_B545_9463015CE39E)" explainText="$(string.POL_2EDF2411_B7EF_4E25_B545_9463015CE39E_Help)" presentation="$(presentation.POL_2EDF2411_B7EF_4E25_B545_9463015CE39E)" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogLevel">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <enum id="DST_B780FD16_FCA9_4ACC_BA08_99D8FE87F9C8" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogLevel">
-          <item displayName="$(string.ITM_8ED46BE0_B873_45A7_A78C_881C66BCC8AB)">
-            <value>
-              <string>0</string>
-            </value>
-          </item>
-          <item displayName="$(string.ITM_7CA444CB_EA44_494E_A49E_A36360058B05)">
-            <value>
-              <string>1</string>
-            </value>
-          </item>
-          <item displayName="$(string.ITM_7F639549_7B94_4047_B890_0689EA436A8C)">
-            <value>
-              <string>3</string>
-            </value>
-          </item>
-          <item displayName="$(string.ITM_E6465EB9_8B8F_4E0F_A361_724EA3DCBC06)">
-            <value>
-              <string>4</string>
-            </value>
-          </item>
-          <item displayName="$(string.ITM_D2A5DF60_E5DF_4432_AF5A_4210AB20470A)">
-            <value>
-              <string>5</string>
-            </value>
-          </item>
-        </enum>
-      </elements>
-    </policy>
-    <policy name="POL_C7358096_E7C6_4A9D_96FE_AE48C78CC770" class="Machine" displayName="$(string.POL_C7358096_E7C6_4A9D_96FE_AE48C78CC770)" explainText="$(string.POL_C7358096_E7C6_4A9D_96FE_AE48C78CC770_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogToStdErr">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_FE44DB41_2023_44B8_8C1B_86730F5B84B6" class="Machine" displayName="$(string.POL_FE44DB41_2023_44B8_8C1B_86730F5B84B6)" presentation="$(presentation.POL_FE44DB41_2023_44B8_8C1B_86730F5B84B6)" key="SOFTWARE\iTALC Solutions\iTALC\Service" valueName="Arguments">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <text id="TXT_A82D7855_F654_4DA2_AB92_9285A298D8EF" key="SOFTWARE\iTALC Solutions\iTALC\Service" valueName="Arguments" maxLength="256" />
-      </elements>
-    </policy>
-    <policy name="POL_812B4929_AA2A_491F_9EE6_457D5074F8E6" class="Machine" displayName="$(string.POL_812B4929_AA2A_491F_9EE6_457D5074F8E6)" presentation="$(presentation.POL_812B4929_AA2A_491F_9EE6_457D5074F8E6)" key="SOFTWARE\iTALC Solutions\iTALC\Paths" valueName="GlobalConfiguration">
-      <parentCategory ref="CAT_D70BA71E_524E_4561_833B_8A6D8852360D" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <text id="TXT_1BD429DA_5FE1_42CB_8D7A_58DE15956FA0" key="SOFTWARE\iTALC Solutions\iTALC\Paths" valueName="GlobalConfiguration" required="true" maxLength="256" />
-      </elements>
-    </policy>
-    <policy name="POL_AF018DCF_30AD_41AB_8DFF_29C174C4D17B" class="Machine" displayName="$(string.POL_AF018DCF_30AD_41AB_8DFF_29C174C4D17B)" presentation="$(presentation.POL_AF018DCF_30AD_41AB_8DFF_29C174C4D17B)" key="SOFTWARE\iTALC Solutions\iTALC\Paths" valueName="PersonalConfiguration">
-      <parentCategory ref="CAT_D70BA71E_524E_4561_833B_8A6D8852360D" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <text id="TXT_8062DA4D_351A_485F_A908_D213AC03099F" key="SOFTWARE\iTALC Solutions\iTALC\Paths" valueName="PersonalConfiguration" required="true" maxLength="256" />
-      </elements>
-    </policy>
-    <policy name="POL_CDE8DA03_8E43_428A_B57E_8031656B83B1" class="Machine" displayName="$(string.POL_CDE8DA03_8E43_428A_B57E_8031656B83B1)" presentation="$(presentation.POL_CDE8DA03_8E43_428A_B57E_8031656B83B1)" key="SOFTWARE\iTALC Solutions\iTALC\Paths" valueName="SnapshotDirectory">
-      <parentCategory ref="CAT_D70BA71E_524E_4561_833B_8A6D8852360D" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <text id="TXT_285A3E7F_4E08_481B_AC98_6E651FA87084" key="SOFTWARE\iTALC Solutions\iTALC\Paths" valueName="SnapshotDirectory" required="true" />
-      </elements>
-    </policy>
-    <policy name="POL_9DD077A5_0E53_412F_97C9_1769609B7DA9" class="Machine" displayName="$(string.POL_9DD077A5_0E53_412F_97C9_1769609B7DA9)" explainText="$(string.POL_9DD077A5_0E53_412F_97C9_1769609B7DA9_Help)" presentation="$(presentation.POL_9DD077A5_0E53_412F_97C9_1769609B7DA9)" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="KeyAuthenticationEnabled">
-      <parentCategory ref="CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-      <elements>
-        <text id="TXT_DFEE24A6_F32C_4F73_8211_5189B619BA3E" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="PrivateKeyBaseDir" required="true" maxLength="250" />
-        <text id="TXT_10B8096A_C236_4AFB_9645_00F24D623534" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="PublicKeyBaseDir" required="true" maxLength="250" />
-      </elements>
-    </policy>
-    <policy name="POL_F622107A_F3E6_418B_95EE_3DDEB80646EA" class="Machine" displayName="$(string.POL_F622107A_F3E6_418B_95EE_3DDEB80646EA)" explainText="$(string.POL_F622107A_F3E6_418B_95EE_3DDEB80646EA_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="LogonAuthenticationEnabled">
-      <parentCategory ref="CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_0A4FF41B_EAC7_4DFA_B143_C5C911528B36" class="Machine" displayName="$(string.POL_0A4FF41B_EAC7_4DFA_B143_C5C911528B36)" key="SOFTWARE\iTALC Solutions\iTALC\VNC" valueName="CaptureLayeredWindows">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_3E564BAB_A95E_4C4F_B12E_7849DDAB127C" class="Machine" displayName="$(string.POL_3E564BAB_A95E_4C4F_B12E_7849DDAB127C)" key="SOFTWARE\iTALC Solutions\iTALC\VNC" valueName="PollFullScreen">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_315D0DCE_88E6_481F_ADC7_42147A288D65" class="Machine" displayName="$(string.POL_315D0DCE_88E6_481F_ADC7_42147A288D65)" key="SOFTWARE\iTALC Solutions\iTALC\VNC" valueName="LowAccuracy">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA" class="Machine" displayName="$(string.POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA)" explainText="$(string.POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA_Help)" presentation="$(presentation.POL_19687667_F2FD_42C4_9A0A_C7EEF3D572DA)" key="SOFTWARE\iTALC Solutions\DemoServer" valueName="Backend">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-      <elements>
-        <enum id="DST_600D95A8_3EAF_4D25_BBF1_5A0B84D1B577" key="SOFTWARE\iTALC Solutions\DemoServer" valueName="Backend" required="true">
-          <item displayName="$(string.ITM_6FC14439_C03E_49A4_A438_8D5F17766C94)">
-            <value>
-              <string>0</string>
-            </value>
-          </item>
-          <item displayName="$(string.ITM_8321B5CD_5BEE_4EAF_9B7D_62BC0E0DED81)">
-            <value>
-              <string>1</string>
-            </value>
-          </item>
-        </enum>
-      </elements>
-    </policy>
-    <policy name="POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6" class="Machine" displayName="$(string.POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6)" explainText="$(string.POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6_Help)" presentation="$(presentation.POL_E1969258_5B49_4CE7_B85D_8F7B4C01E7A6)" key="SOFTWARE\iTALC Solutions\iTALC\DemoServer" valueName="Multithreaded">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_789CFC83_C979_4BD5_9760_C39916C6786F" class="Machine" displayName="$(string.POL_789CFC83_C979_4BD5_9760_C39916C6786F)" explainText="$(string.POL_789CFC83_C979_4BD5_9760_C39916C6786F_Help)" presentation="$(presentation.POL_789CFC83_C979_4BD5_9760_C39916C6786F)" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="CoreServerPort">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-      <elements>
-        <decimal id="DXT_414AE5C6_3D02_43A5_8698_942530126DED" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="CoreServerPort" required="true" maxValue="65535" storeAsText="true" />
-      </elements>
-    </policy>
-    <policy name="POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3" class="Machine" displayName="$(string.POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3)" explainText="$(string.POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3_Help)" presentation="$(presentation.POL_9EE6A627_73AE_4EB2_882B_136CB3A6FED3)" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="DemoServerPort">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-      <elements>
-        <decimal id="DXT_9D6EF27F_5710_4B65_B36B_59B8AC34AB1D" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="DemoServerPort" required="true" maxValue="65535" storeAsText="true" />
-      </elements>
-    </policy>
-    <policy name="POL_5CB7663E_F4FC_4462_A353_FDD5FB0B90A0" class="Machine" displayName="$(string.POL_5CB7663E_F4FC_4462_A353_FDD5FB0B90A0)" explainText="$(string.POL_5CB7663E_F4FC_4462_A353_FDD5FB0B90A0_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="FirewallExceptionEnabled">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_BD6B9FA6_D9B1_497D_B9D7_857FE2871480" class="Machine" displayName="$(string.POL_BD6B9FA6_D9B1_497D_B9D7_857FE2871480)" explainText="$(string.POL_BD6B9FA6_D9B1_497D_B9D7_857FE2871480_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="LocalConnectOnly">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8" class="Machine" displayName="$(string.POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8)" explainText="$(string.POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8_Help)" presentation="$(presentation.POL_96BFBCE9_F707_417A_B425_F11DF1ED22C8)" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="HttpServerEnabled">
-      <parentCategory ref="CAT_6F7A78F2_BB62_490E_B84C_3D863160CC7F" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-      <elements>
-        <decimal id="DXT_AF6B507A_8C97_4706_BDCE_7900742047B4" key="SOFTWARE\iTALC Solutions\iTALC\Network" valueName="HttpServerPort" required="true" maxValue="65535" storeAsText="true" />
-      </elements>
-    </policy>
-    <policy name="POL_5F42AD52_12DE_415D_9E1A_F99E6EF218EA" class="Machine" displayName="$(string.POL_5F42AD52_12DE_415D_9E1A_F99E6EF218EA)" presentation="$(presentation.POL_5F42AD52_12DE_415D_9E1A_F99E6EF218EA)" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LimittedLogFileSize">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-      <elements>
-        <decimal id="DXT_B6F2D87F_B738_4C7A_8530_1C12C3C65F84" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogFileSizeLimit" storeAsText="true" />
-      </elements>
-    </policy>
-    <policy name="POL_F3F42BE8_3CDF_4FA4_8AEA_DE90699FAE76" class="Machine" displayName="$(string.POL_F3F42BE8_3CDF_4FA4_8AEA_DE90699FAE76)" explainText="$(string.POL_F3F42BE8_3CDF_4FA4_8AEA_DE90699FAE76_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Logging" valueName="LogToWindowsEventLog">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_6A15AC8F_D05F_40A6_8F33_F02BE63FDB92" class="Machine" displayName="$(string.POL_6A15AC8F_D05F_40A6_8F33_F02BE63FDB92)" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="PermissionRequiredWithKeyAuthentication">
-      <parentCategory ref="CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-    <policy name="POL_82CAE5C2_998D_4EB5_BF9E_8C6414C40003" class="Machine" displayName="$(string.POL_82CAE5C2_998D_4EB5_BF9E_8C6414C40003)" presentation="$(presentation.POL_82CAE5C2_998D_4EB5_BF9E_8C6414C40003)" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="PermissionRequiredWithLogonAuthentication">
-      <parentCategory ref="CAT_D5109123_FD1C_4A0A_B3A6_614D2913C31E" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-      <elements>
-        <boolean id="CHK_203AD3C4_4D8C_46BB_B117_6A9B02F6FA76" key="SOFTWARE\iTALC Solutions\iTALC\Authentication" valueName="SameUserConfirmationDisabled">
-          <trueValue>
-            <string>1</string>
-          </trueValue>
-          <falseValue>
-            <string>0</string>
-          </falseValue>
-        </boolean>
-      </elements>
-    </policy>
-    <policy name="POL_B3A40764_63FC_4BE1_AF56_5AA7DCAE5258" class="Machine" displayName="$(string.POL_B3A40764_63FC_4BE1_AF56_5AA7DCAE5258)" explainText="$(string.POL_B3A40764_63FC_4BE1_AF56_5AA7DCAE5258_Help)" key="SOFTWARE\iTALC Solutions\iTALC\Service" valueName="LockWithDesktopSwitching">
-      <parentCategory ref="CAT_2A348098_3EA3_4875_9ADD_F005E090EEC0" />
-      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
-	  <enabledValue>
-            <string>1</string>
-      </enabledValue>
-      <disabledValue>
-            <string>0</string>
-      </disabledValue>
-    </policy>
-  </policies>
-</policyDefinitions>
\ No newline at end of file
diff --git a/doc/AutomatedSetupWithIMC.txt b/doc/AutomatedSetupWithIMC.txt
deleted file mode 100644
index d48630e..0000000
--- a/doc/AutomatedSetupWithIMC.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-Automated setup with the iTALC Management Console (IMC)
-=======================================================
-
-The iTALC Management Console (IMC) allows to configure an iTALC installation
-easily. The IMC provides an easy to use graphical user interface where all
-iTALC-related settings can be made.
-
-This document describes how a computer can be setup for the use of iTALC
-automatically. All instructions refer to an automated setup on Windows but
-should be identical on Linux except platform-specific characteristics such
-as path delimiter, installation paths etc.
-
-
-1) Prepare a global common directory which can be accessed by all computers
-   in the network. Alternatively, a directory on an USB drive works as well.
-
-
-2) Install iTALC on the master computer. Afterwards run the IMC and alter the
-   settings according to your needs and your environment.
-
-   In the "Authentication" area, launch the iTALC access key assistant and
-   let it create an access key pair and export the public key to the directory
-   prepared in step 1)
-
-
-3) Create an iTALC client reference installation. Afterwards run the IMC and
-   alter the settings according to your needs and your environment. Then save
-   the settings via "File" -> "Save settings into file" to the directory
-   prepared in step 1) and choose a filename, e.g. ClientSettings.xml
-
-
-4) Copy the content of the installation directory (e.g. all files in
-   C:\Program Files\iTALC\) to the directory prepared in step 1).
-
-
-5) Write a batch file with the following commands and place it in the same
-   directory as the files in the previous steps.
-
-     mkdir "C:\Program Files\iTALC"
-     cp *.exe *.dll *.txt *.xml "C:\Program Files\iTALC\"
-     cd "\Program Files\iTALC"
-     imc -ApplySettings ClientSettings.xml
-     imc -ImportPublicKey PublicKey.key.txt
-     ica -RegisterService
-     ica -StartService
-
-   When calling IMC for applying settings and importing the public key you can
-   also pass "-silent" or "-quiet" in order to suppress any message boxes.
-
-   After running this batch file on a client, the client should be ready for use
-   with the iTALC network.
-
diff --git a/doc/ControllingIMCAtTheCommandline.txt b/doc/ControllingIMCAtTheCommandline.txt
deleted file mode 100644
index 42cde99..0000000
--- a/doc/ControllingIMCAtTheCommandline.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-Controlling IMC at the commandline
-==================================
-
-This document describes how the iTALC Management Console (IMC) can be used
-to alter an iTALC installation at the commandline.
-
-
-Listing current configuration
------------------------------
-
-The current configuration with all keys and values can be listed via the
-"ListConfig" command. It can be abbreviated with "-l".
-
-Example:
-
-   imc -ListConfig
-
-
-This will give an output like
-
-   ...
-   Logging/LogLevel=1
-   Network/CoreServerPort=11100
-   Network/DemoServerPort=11400
-   ...
-
-
-
-Changing the value of a configuration property
-----------------------------------------------
-
-A the value of configuration property can be changed using the
-"SetConfigValue" command. It can be abbreviated with "-s".
-
-Examples:
-
-  imc -SetConfigValue Logging/LogFileDirectory C:\temp
-  imc -s Logging/LogLevel=4
-
-
-
-Applying settings from settings file
-------------------------------------
-
-You can apply the settings previously saved in a settings file using the
-"ApplySettings" command. It can be abbreviated with "-a".
-
-Examples:
-
-  imc -ApplySettings MyCustomSettings.xml
-
-
-
-Importing a public key
-----------------------
-
-You can import a public key file which has been exported during the installation
-of the iTALC master computer using the "ImportPublicKey" command. It can be
-abbreviated with "-i".
-
-You can omit the the second parameter which specifies the public key file if it
-is located in the directory from which you launch IMC. IMC will automatically
-search for a *.key.txt file. If it finds exactly one, it'll import this one.
-
-Examples:
-
-  imc -ImportPublicKey MyPublicKey.key.txt
-  imc -i
-
-
diff --git a/doc/CrossCompilingForWindows.txt b/doc/CrossCompilingForWindows.txt
deleted file mode 100644
index ae0902d..0000000
--- a/doc/CrossCompilingForWindows.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-Cross compiling iTALC for Windows on Linux
-==========================================
-
-- Create an Ubuntu 12.04 installation, e.g. by using the netboot installer at
-
-    http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/mini.iso
-
-- Add the following line to your /etc/apt/sources.list
-
-    deb http://ppa.launchpad.net/tobydox/mingw/ubuntu precise main
-
-  and update your package list cache (e.g. apt-get update or similiar)
-
-- Install the following packages:
-
-  * cmake
-  * nsis
-  * tofrodos
-  * mingw32-x-gcc
-  * mingw32-x-qt
-  * mingw32-x-zlib
-  * mingw32-x-openssl
-  * mingw32-x-libjpeg
-  * mingw32-x-libpng
-  * mingw32-x-pthreads
-  * gcj-jdk
-
-- Change into the iTALC source directory and type
-
-  mkdir b
-  cd b
-  ../build_mingw32
-  make win-nsi
-
-- This will build a ready-to-use Win32 installer like the ones you can download
-  from the iTALC website.
-
-- If you want to build a Win64 installer, replace all occurences of "32" in the
-  above instructions (including package names) with "64".
-
diff --git a/doc/UsingPathVariables.txt b/doc/UsingPathVariables.txt
deleted file mode 100644
index cd48021..0000000
--- a/doc/UsingPathVariables.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Using path variables
-====================
-
-This document describes how to use the builtin path variables for paths which
-can be customized using IMC. Path variables are helpful if you do not want
-to hardcode paths e.g. for configuration files but make them relative to a
-certain environment, e.g. the user's home/profile.
-
-The following path variables are known to iTALC and replaced automatically:
-
-* $HOME, %HOME%, $PROFILE, %PROFILE%
-  - the home/profile directory of the user which started the application
-    (e.g. iTALC Master Application)
-
-* $APPDATA, %APPDATA
-  - Linux: $HOME/.italc
-  - Windows XP: C:\Documents and Settings\<user>\Application Data\iTALC
-  - Windows Vista/7: C:\Users\<user>\AppData\Roaming\iTALC
-
-* $GLOBALAPPDATA, %GLOBALAPPDATA%
-  - Linux: /etc/italc
-  - Windows XP: C:\Documents and Settings\All Users\Application Data\iTALC
-  - Windows Vista/7: C:\ProgramData\iTALC
-
-* $TEMP, %TEMP%, $TMP, %TMP%:
-  - Linux: /tmp
-  - Windows: current %TEMP% environment variable:
-    - Windows XP: C:\Documents and Settings\<user>\Local Settings\Temp
-    - Windows Vista/7: C:\Users\<user>\AppData\Local\Temp
-
diff --git a/iTALC.nsi.in b/iTALC.nsi.in
deleted file mode 100644
index 916f104..0000000
--- a/iTALC.nsi.in
+++ /dev/null
@@ -1,305 +0,0 @@
-!define DLLDIR "@MINGW_PREFIX@/bin"
-!define SYSTEM_DLLDIR "@MINGW_PREFIX@/@CMAKE_SYSTEM_PROCESSOR at -w64-mingw32/bin"
-!define APP_NAME "iTALC"
-!define COMP_NAME "iTALC Solutions Inc."
-!define WEB_SITE "http://italc.sf.net"
-!define VERSION "@VERSION@"
-!define COPYRIGHT "© Tobias Doerffel 2004-2013"
-!define DESCRIPTION "Intelligent Teaching and Learning with Computers"
-!define LICENSE_TXT "@CMAKE_SOURCE_DIR@/COPYING"
-!define INSTALLER_NAME "italc-${VERSION}- at MINGW_PLATFORM@-setup.exe"
-!define MAIN_APP_EXE "italc.exe"
-!define INSTALL_TYPE "SetShellVarContext all"
-!define REG_ROOT "HKLM"
-!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
-!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
-
-######################################################################
-
-VIProductVersion  "${VERSION}.0"
-VIAddVersionKey "ProductName"  "${APP_NAME}"
-VIAddVersionKey "CompanyName"  "${COMP_NAME}"
-VIAddVersionKey "LegalCopyright"  "${COPYRIGHT}"
-VIAddVersionKey "FileDescription"  "${DESCRIPTION}"
-VIAddVersionKey "FileVersion"  "${VERSION}"
-
-######################################################################
-
-SetCompressor /SOLID Lzma
-Name "${APP_NAME}"
-Caption "${APP_NAME} ${VERSION}"
-OutFile "${INSTALLER_NAME}"
-BrandingText "${APP_NAME} ${VERSION}"
-XPStyle on
-InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
-InstallDir "$PROGRAMFILES64\iTALC"
-ShowInstDetails show
-
-######################################################################
-
-!include "MUI.nsh"
-
-!define MUI_ABORTWARNING
-!define MUI_UNABORTWARNING
-
-!define MUI_WELCOMEFINISHPAGE_BITMAP "@CMAKE_SOURCE_DIR@/nsis/welcome-page.bmp"
-
-!define MUI_HEADERIMAGE
-!define MUI_HEADERIMAGE_BITMAP "@CMAKE_SOURCE_DIR@/nsis/header.bmp"
-
-!define MUI_LANGDLL_REGISTRY_ROOT "${REG_ROOT}"
-!define MUI_LANGDLL_REGISTRY_KEY "${UNINSTALL_PATH}"
-!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
-
-!insertmacro MUI_PAGE_WELCOME
-
-!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
-
-!insertmacro MUI_PAGE_DIRECTORY
-
-!insertmacro MUI_PAGE_COMPONENTS
-
-!ifdef REG_START_MENU
-!define MUI_STARTMENUPAGE_NODISABLE
-!define MUI_STARTMENUPAGE_DEFAULTFOLDER "iTALC"
-!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
-!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
-!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
-!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
-!endif
-
-!insertmacro MUI_PAGE_INSTFILES
-
-!define MUI_FINISHPAGE_RUN
-!define MUI_FINISHPAGE_RUN_TEXT "Run iTALC Management Console now"
-!define MUI_FINISHPAGE_RUN_FUNCTION "RunIMC"
-
-!insertmacro MUI_PAGE_FINISH
-
-!insertmacro MUI_UNPAGE_CONFIRM
-
-!insertmacro MUI_UNPAGE_INSTFILES
-
-!insertmacro MUI_UNPAGE_FINISH
-
-!insertmacro MUI_LANGUAGE "Albanian"
-!insertmacro MUI_LANGUAGE "Arabic"
-!insertmacro MUI_LANGUAGE "Belarusian"
-!insertmacro MUI_LANGUAGE "Bosnian"
-!insertmacro MUI_LANGUAGE "Breton"
-!insertmacro MUI_LANGUAGE "Bulgarian"
-!insertmacro MUI_LANGUAGE "Catalan"
-!insertmacro MUI_LANGUAGE "Croatian"
-!insertmacro MUI_LANGUAGE "Czech"
-!insertmacro MUI_LANGUAGE "Danish"
-!insertmacro MUI_LANGUAGE "Dutch"
-!insertmacro MUI_LANGUAGE "English"
-!insertmacro MUI_LANGUAGE "Estonian"
-!insertmacro MUI_LANGUAGE "Farsi"
-!insertmacro MUI_LANGUAGE "Finnish"
-!insertmacro MUI_LANGUAGE "French"
-!insertmacro MUI_LANGUAGE "German"
-!insertmacro MUI_LANGUAGE "Greek"
-!insertmacro MUI_LANGUAGE "Hebrew"
-!insertmacro MUI_LANGUAGE "Hungarian"
-!insertmacro MUI_LANGUAGE "Icelandic"
-!insertmacro MUI_LANGUAGE "Indonesian"
-!insertmacro MUI_LANGUAGE "Italian"
-!insertmacro MUI_LANGUAGE "Japanese"
-!insertmacro MUI_LANGUAGE "Korean"
-!insertmacro MUI_LANGUAGE "Kurdish"
-!insertmacro MUI_LANGUAGE "Latvian"
-!insertmacro MUI_LANGUAGE "Lithuanian"
-!insertmacro MUI_LANGUAGE "Luxembourgish"
-!insertmacro MUI_LANGUAGE "Macedonian"
-!insertmacro MUI_LANGUAGE "Malay"
-!insertmacro MUI_LANGUAGE "Mongolian"
-!insertmacro MUI_LANGUAGE "Norwegian"
-!insertmacro MUI_LANGUAGE "Polish"
-!insertmacro MUI_LANGUAGE "Portuguese"
-!insertmacro MUI_LANGUAGE "PortugueseBR"
-!insertmacro MUI_LANGUAGE "Romanian"
-!insertmacro MUI_LANGUAGE "Russian"
-!insertmacro MUI_LANGUAGE "Serbian"
-!insertmacro MUI_LANGUAGE "SerbianLatin"
-!insertmacro MUI_LANGUAGE "SimpChinese"
-!insertmacro MUI_LANGUAGE "Slovak"
-!insertmacro MUI_LANGUAGE "Slovenian"
-!insertmacro MUI_LANGUAGE "Spanish"
-!insertmacro MUI_LANGUAGE "Swedish"
-!insertmacro MUI_LANGUAGE "Thai"
-!insertmacro MUI_LANGUAGE "TradChinese"
-!insertmacro MUI_LANGUAGE "Turkish"
-!insertmacro MUI_LANGUAGE "Ukrainian"
-
-!insertmacro MUI_RESERVEFILE_LANGDLL
-
-######################################################################
-
-Function .onInit
-#!insertmacro MUI_LANGDLL_DISPLAY
-FunctionEnd
-
-######################################################################
-
-Section "iTALC Service"
-SectionIn RO
-${INSTALL_TYPE}
-ExecWait '"$INSTDIR\ica.exe" -quiet -unregisterservice'
-SetOverwrite on
-SetOutPath "$INSTDIR"
-# DLLs
-File "${DLLDIR}\QtCore4.dll"
-File "${DLLDIR}\QtGui4.dll"
-File "${DLLDIR}\QtXml4.dll"
-File "${DLLDIR}\QtNetwork4.dll"
-File "${DLLDIR}\zlib1.dll"
-File "${DLLDIR}\libjpeg-9.dll"
-File "${DLLDIR}\libeay32.dll"
-File "${DLLDIR}\libssl32.dll"
-File "${DLLDIR}\libpng16-16.dll"
-File "${SYSTEM_DLLDIR}\libwinpthread-1.dll"
-# core components
-File "italc-${VERSION}\ica.exe"
-File "italc-${VERSION}\vnchooks.dll"
-File "italc-${VERSION}\authSSP.dll"
-File "italc-${VERSION}\ItalcCore.dll"
-File "italc-${VERSION}\imc.exe"
-File "italc-${VERSION}\LICENSE.TXT"
-File "italc-${VERSION}\README.TXT"
-SetOutPath "$INSTDIR\doc"
-File "italc-${VERSION}\doc\*txt"
-SetOutPath "$INSTDIR\contrib"
-File "italc-${VERSION}\contrib\*"
-SetOutPath "$INSTDIR\contrib\en-US"
-File "italc-${VERSION}\contrib\en-US\*"
-ExecWait '"$INSTDIR\ica.exe" -quiet -registerservice'
-ExecWait '"$INSTDIR\imc.exe" -s Network/FirewallExceptionEnabled=1'
-ExecWait '"$INSTDIR\ica.exe" -quiet -startservice'
-# disable forced guest logon as otherwise logon authentication fails
-WriteRegDWORD ${REG_ROOT} "SYSTEM\CurrentControlSet\Control\Lsa"  "ForceGuest" "0"
-SectionEnd
-
-Section "iTALC Master"
-${INSTALL_TYPE}
-SetOutPath "$INSTDIR"
-File "italc-${VERSION}\italc.exe"
-
-!ifdef REG_START_MENU
-!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
-CreateDirectory "$SMPROGRAMS\$SM_Folder"
-CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
-CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
-!insertmacro MUI_STARTMENU_WRITE_END
-!endif
-
-!ifndef REG_START_MENU
-CreateDirectory "$SMPROGRAMS\iTALC"
-CreateShortCut "$SMPROGRAMS\iTALC\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
-CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
-!endif
-SectionEnd
-
-Function RunIMC
-	Exec '"$INSTDIR\imc.exe"'
-FunctionEnd
-
-######################################################################
-
-Section -Icons_Reg
-SetOutPath "$INSTDIR"
-WriteUninstaller "$INSTDIR\uninstall.exe"
-
-!ifdef REG_START_MENU
-!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
-CreateDirectory "$SMPROGRAMS\$SM_Folder"
-CreateShortCut "$SMPROGRAMS\$SM_Folder\iTALC Management Console.lnk" "$INSTDIR\imc.exe"
-CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall iTALC.lnk" "$INSTDIR\uninstall.exe"
-WriteIniStr "$INSTDIR\iTALC website.url" "InternetShortcut" "URL" "${WEB_SITE}"
-CreateShortCut "$SMPROGRAMS\$SM_Folder\iTALC Website.lnk" "$INSTDIR\iTALC website.url"
-!insertmacro MUI_STARTMENU_WRITE_END
-!endif
-
-!ifndef REG_START_MENU
-CreateDirectory "$SMPROGRAMS\iTALC"
-CreateShortCut "$SMPROGRAMS\iTALC\iTALC Management Console.lnk" "$INSTDIR\imc.exe"
-CreateShortCut "$SMPROGRAMS\iTALC\Uninstall iTALC.lnk" "$INSTDIR\uninstall.exe"
-WriteIniStr "$INSTDIR\iTALC website.url" "InternetShortcut" "URL" "${WEB_SITE}"
-CreateShortCut "$SMPROGRAMS\iTALC\iTALC Website.lnk" "$INSTDIR\iTALC website.url"
-!endif
-
-WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
-WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "DisplayName" "iTALC"
-WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "UninstallString" "$INSTDIR\uninstall.exe"
-WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "DisplayIcon" "$INSTDIR\${MAIN_APP_EXE}"
-WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "DisplayVersion" "${VERSION}"
-WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "Publisher" "${COMP_NAME}"
-WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}"  "URLInfoAbout" "${WEB_SITE}"
-SectionEnd
-
-######################################################################
-
-Section Uninstall
-${INSTALL_TYPE}
-ExecWait '"$INSTDIR\imc.exe" -s Network/FirewallExceptionEnabled=0'
-ExecWait '"$INSTDIR\ica.exe" -quiet -unregisterservice'
-# make sure the service is stopped and all file handles are released
-Sleep 2000
-Delete "$INSTDIR\ica.exe"
-Delete "$INSTDIR\libwinpthread-1.dll"
-Delete "$INSTDIR\zlib1.dll"
-Delete "$INSTDIR\libjpeg-9.dll"
-Delete "$INSTDIR\QtXml4.dll"
-Delete "$INSTDIR\libeay32.dll"
-Delete "$INSTDIR\libpng16-16.dll"
-Delete "$INSTDIR\QtNetwork4.dll"
-Delete "$INSTDIR\QtCore4.dll"
-Delete "$INSTDIR\libssl32.dll"
-Delete "$INSTDIR\LICENSE.TXT"
-Delete "$INSTDIR\authSSP.dll"
-Delete "$INSTDIR\vnchooks.dll"
-Delete "$INSTDIR\imc.exe"
-Delete "$INSTDIR\italc.exe"
-Delete "$INSTDIR\README.TXT"
-Delete "$INSTDIR\ItalcCore.dll"
-Delete "$INSTDIR\QtGui4.dll"
-Delete "$INSTDIR\uninstall.exe"
-Delete "$INSTDIR\iTALC website.url"
-RmDir /r "$INSTDIR\doc"
-RmDir /r "$INSTDIR\contrib"
-
-RmDir "$INSTDIR"
-
-!ifdef REG_START_MENU
-!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
-Delete "$SMPROGRAMS\$SM_Folder\iTALC.lnk"
-Delete "$SMPROGRAMS\$SM_Folder\Uninstall iTALC.lnk"
-Delete "$SMPROGRAMS\$SM_Folder\iTALC Management Console.lnk"
-Delete "$SMPROGRAMS\$SM_Folder\iTALC Website.lnk"
-Delete "$DESKTOP\iTALC.lnk"
-
-RmDir "$SMPROGRAMS\$SM_Folder"
-!endif
-
-!ifndef REG_START_MENU
-Delete "$SMPROGRAMS\iTALC\iTALC.lnk"
-Delete "$SMPROGRAMS\iTALC\iTALC Management Console.lnk"
-Delete "$SMPROGRAMS\iTALC\Uninstall iTALC.lnk"
-Delete "$SMPROGRAMS\iTALC\iTALC Website.lnk"
-Delete "$DESKTOP\iTALC.lnk"
-
-RmDir "$SMPROGRAMS\iTALC"
-!endif
-
-DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
-DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
-SectionEnd
-
-######################################################################
-
-Function un.onInit
-!insertmacro MUI_UNGETLANGUAGE
-FunctionEnd
-
-######################################################################
-
diff --git a/ica/CMakeLists.txt b/ica/CMakeLists.txt
deleted file mode 100644
index eb3b1d3..0000000
--- a/ica/CMakeLists.txt
+++ /dev/null
@@ -1,187 +0,0 @@
-FILE(GLOB ica_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
-FILE(GLOB ica_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
-SET(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ica.qrc)
-QT4_WRAP_CPP(ica_MOC_out ${ica_INCLUDES})
-QT4_ADD_RESOURCES(ica_RCC_out ${QRC_FILE})
-QT4_TRANSLATIONS_FOR_QRC(${QRC_FILE} ${ica_SOURCES} ${ica_INCLUDES})
-ADD_DEFINITIONS(-DLIBVNCSERVER_PACKAGE_STRING="iTALC ${VERSION}")
-
-# build JavaViewer
-SET(JAVAVIEWER_DIR ${CMAKE_CURRENT_BINARY_DIR}/JavaViewer)
-SET(VNCVIEWER_JAR ${JAVAVIEWER_DIR}/VncViewer.jar)
-FILE(MAKE_DIRECTORY ${JAVAVIEWER_DIR})
-
-IF(JAVA_COMPILE AND JAVA_ARCHIVE)
-
-	ADD_CUSTOM_COMMAND(OUTPUT ${VNCVIEWER_JAR}
-						COMMAND ${JAVA_COMPILE} -d ${JAVAVIEWER_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/JavaViewer/*.java
-						COMMAND cd ${JAVAVIEWER_DIR} && ${JAVA_ARCHIVE} cfm ${VNCVIEWER_JAR} ${CMAKE_CURRENT_SOURCE_DIR}/JavaViewer/MANIFEST.MF OptionsFrame.class VncCanvas.class ButtonPanel.class FTPFrame.class SessionRecorder.class DH.class VncViewer.class DesCipher.class RecordingFrame.class FTPFrame$$StrComp.class RfbProto.class ClipboardFrame.class AuthPanel.class
-						DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/JavaViewer/* )
-	INSTALL(FILES ${VNCVIEWER_JAR} ${CMAKE_CURRENT_SOURCE_DIR}/JavaViewer/index.vnc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/italc/JavaViewer)
-
-ELSE()
-
-	ADD_CUSTOM_COMMAND(OUTPUT ${VNCVIEWER_JAR} COMMAND touch ${VNCVIEWER_JAR})
-
-ENDIF()
-
-ADD_CUSTOM_TARGET(JavaViewer DEPENDS ${VNCVIEWER_JAR})
-
-# end build JavaViewer
-
-
-SET(x11vnc_SOURCES
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/auth.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/cargs.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/corre.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/cursor.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/cutpaste.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/draw.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/font.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/hextile.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/httpd.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/main.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/rfbregion.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/rfbserver.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/rre.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/scale.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/selbox.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/sockets.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/stats.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/translate.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/ultra.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/zlib.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/zrle.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/zrleoutstream.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/zrlepalettehelper.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver/tight.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/common/d3des.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/common/vncauth.c
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/x11vnc.c )
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/x11 ${CMAKE_CURRENT_SOURCE_DIR}/x11/x11vnc ${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncserver ${CMAKE_CURRENT_SOURCE_DIR}/x11/common)
-ADD_DEFINITIONS(-DVNCSHARED -DFOREVER -DNOREPEAT=0 -DNOPW=1 -DREMOTE_CONTROL=0 -DEXTERNAL_COMMANDS=0 -DFILEXFER=0 -DNOGUI -DSMALL_FOOTPRINT=3)
-
-IF(ITALC_BUILD_LINUX)
-
-	ADD_SUBDIRECTORY(helpers)
-
-	SET(platform_SOURCES
-		${CMAKE_CURRENT_SOURCE_DIR}/x11/x11vnc/appshare.c)
-
-	LINK_LIBRARIES(${X11_LIBRARIES} ${X11_XTest_LIB} ${X11_Xfixes_LIB} ${X11_Xinerama_LIB} ${X11_Xdamage_LIB} ${X11_Xrandr_LIB})
-
-ENDIF(ITALC_BUILD_LINUX)
-
-IF(ITALC_BUILD_WIN32)
-
-	ADD_SUBDIRECTORY(win32)
-
-	ADD_DEFINITIONS(-DX11VNC_IPV6=0 -DPTW32_STATIC_LIB -DTLS=__thread -DX11VNC_USLEEP -D__USE_MINGW_ANSI_STDIO=1)
-	INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/win32 ${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc ${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/omnithread ${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc ${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncclient)
-	SET(platform_SOURCES
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/ultravnc.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/ultravnc-italc.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/HideDesktop.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/rfbRegion_win32.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vistahook.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncdesktopthread.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncdesktopsink.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/IPC.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncmenu.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncencoderre.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncserver.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncabout.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/black_layered.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncsetauth.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncacceptdialog.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/rfbUpdateTracker.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncencodehext.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/d3des.c
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncproperties.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/security.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/buildtime.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/Timer.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncconndialog.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncencoderCursor.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncencoder.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vnclog.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/translate.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncencodecorre.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncencodezrle.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vnchttpconnect.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncEncodeTight.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncservice.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncMultiMonitor.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/inifile.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncbuffer.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/videodrivercheck.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/videodriver.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/read_write_ini.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vnctimedmsgbox.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncDesktopSW.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vnckeymap.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncOSVersion.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/winvnc.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncauth.c
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncListDlg.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/stdhdrs.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncEncodeUltra.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncEncodeUltra2.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncsockconnect.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncntlm.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncinsthandler.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncEncodeZlib.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncEncodeZlibHex.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/vncpropertiesPoll.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/helpers.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/service_motor.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/service.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/CpuUsage.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/getinfo.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/Dtwinver.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/winvnc/httpconnect.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/omnithread/nt.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/winvnc/DSMPlugin/DSMPlugin.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/common/Clipboard.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/common/win32_helpers.cpp
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/rdr/ZlibOutStream.cxx
-		${CMAKE_CURRENT_SOURCE_DIR}/win32/rdr/ZlibInStream.cxx
-		)
-
-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -fexceptions")
-	LINK_LIBRARIES(-luserenv -lole32 -lversion -lgdi32 -limm32 -lwinmm)
-
-	ADD_DEFINITIONS(-DULTRAVNC_ITALC_SUPPORT -DLIBVNCSERVER_NEED_INADDR_T)
-
-	SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/icarc.obj")
-	ADD_CUSTOM_COMMAND(OUTPUT ${WINRC}
-						COMMAND ${WINDRES}
-							-I${CMAKE_CURRENT_SOURCE_DIR}
-							-o${WINRC}
-							-i${CMAKE_CURRENT_BINARY_DIR}/ica.rc
-						DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ica.rc ${VNCVIEWER_JAR})
-
-ENDIF(ITALC_BUILD_WIN32)
-
-IF(ITALC_BUILD_WIN64)
-	ADD_DEFINITIONS(-D_X64)
-ENDIF(ITALC_BUILD_WIN64)
-
-
-ADD_DEFINITIONS(-DBUILD_ICA)
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/x11/libvncclient)
-LINK_LIBRARIES(-lpthread)
-
-ADD_EXECUTABLE(ica ${ica_SOURCES} ${ica_INCLUDES} ${ica_MOC_out} ${ica_RCC_out} ${x11vnc_SOURCES} ${platform_SOURCES} ${WINRC})
-TARGET_LINK_LIBRARIES(ica ItalcCore)
-
-ADD_DEPENDENCIES(ica JavaViewer)
-
-INSTALL(TARGETS ica RUNTIME DESTINATION bin)
-
-IF(ITALC_BUILD_WIN32)
-	SET_TARGET_PROPERTIES(ica PROPERTIES LINK_FLAGS -mwindows)
-ENDIF(ITALC_BUILD_WIN32)
-
diff --git a/ica/JavaViewer/AuthPanel.java b/ica/JavaViewer/AuthPanel.java
deleted file mode 100644
index b36fc26..0000000
--- a/ica/JavaViewer/AuthPanel.java
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-import java.awt.*;
-import java.awt.event.*;
-
-//
-// The panel which implements the user authentication scheme
-//
-
-class AuthPanel extends Panel implements ActionListener {
-
-  Label title, retry, prompt;
-  TextField password;
-  Button ok;
-  
-  // mslgon support
-  Label promptuser; 
-  TextField username;
-  boolean mslogon = false;
-  // mslogon support end
-  
-  //
-  // Constructor.
-  //
-
-    // mslgon support 2
-  public AuthPanel(boolean logon) {
-
-    mslogon = logon;
-    // mslgon support 2 end
-	  
-    title = new Label("VNC Authentication",Label.CENTER);
-    title.setFont(new Font("Helvetica", Font.BOLD, 18));
-
-    prompt = new Label("Password:",Label.CENTER);
-
-    password = new TextField(10);
-    password.setForeground(Color.black);
-    password.setBackground(Color.white);
-    password.setEchoChar('*');
-
-    // mslogon support 3
-
-    if (mslogon) {
-    promptuser = new Label("Username:",Label.CENTER);
-    username = new TextField(10);
-    username.setForeground(Color.black);
-    username.setBackground(Color.white);
-    }
-    // mslogon support 3 end
-   
-    ok = new Button("OK");
-
-    retry = new Label("",Label.CENTER);
-    retry.setFont(new Font("Courier", Font.BOLD, 16));
-
-
-    GridBagLayout gridbag = new GridBagLayout();
-    GridBagConstraints gbc = new GridBagConstraints();
-
-    setLayout(gridbag);
-
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gridbag.setConstraints(title,gbc);
-    add(title);
-
-    gbc.fill = GridBagConstraints.HORIZONTAL;
-    gridbag.setConstraints(retry,gbc);
-    add(retry);
-
-    gbc.fill = GridBagConstraints.NONE;
-    gbc.gridwidth = 1;
-  
-    //mslogon support 4
-   
-    if (mslogon) { 
-    gridbag.setConstraints(promptuser,gbc);
-    add(promptuser);
-    gridbag.setConstraints(username,gbc);
-    add(username);
-    username.addActionListener(this);
-    }
-    //mslogon support 4 end
-
-    gridbag.setConstraints(prompt,gbc);
-    add(prompt);
-
-    gridbag.setConstraints(password,gbc);
-    add(password);
-    password.addActionListener(this);
-
-    gbc.ipady = 10;
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gbc.fill = GridBagConstraints.BOTH;
-    gbc.insets = new Insets(0,20,0,0);
-    gbc.ipadx = 40;
-    gridbag.setConstraints(ok,gbc);
-    add(ok);
-    ok.addActionListener(this);
-  }
-
-  // mslogon support 5
-  public void setmslogon(boolean InfoMsLogon) {
-    mslogon = InfoMsLogon;	 
-  }
-
-  public void moveFocusToUsernameField() {
-    if (mslogon) { username.requestFocus(); }
-    else { moveFocusToPasswordField();}
-  }
-  
-	public void setUserName( String un ) {
-		username.setText( un );
-  }
-
-  // mslogon support 5 end	  
-	  
-  //
-  // Move keyboard focus to the password text field object.
-  //
-
-  public void moveFocusToPasswordField() {
-    password.requestFocus();
-  }
-
-  //
-  // This method is called when a button is pressed or return is
-  // pressed in the password text field.
-  //
-
-  public synchronized void actionPerformed(ActionEvent evt) {
-    if (evt.getSource() == password || evt.getSource() == ok) {
-      password.setEnabled(false);
-      notify();
-    }
-  }
-
-  //
-  // retry().
-  //
-
-  public void retry() {
-    retry.setText("Sorry. Try again.");
-    password.setEnabled(true);
-    password.setText("");
-    moveFocusToPasswordField();
-  }
-
-}
diff --git a/ica/JavaViewer/ButtonPanel.java b/ica/JavaViewer/ButtonPanel.java
deleted file mode 100644
index 87d6285..0000000
--- a/ica/JavaViewer/ButtonPanel.java
+++ /dev/null
@@ -1,172 +0,0 @@
-//  Copyright (C) 2002-2003 Ultr at VNC Team.  All Rights Reserved.
-//  Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
-//  Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// ButtonPanel class implements panel with four buttons in the
-// VNCViewer desktop window.
-//
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-
-class ButtonPanel extends Panel implements ActionListener {
-
-  VncViewer viewer;
-  Button disconnectButton;
-  Button optionsButton;
-  Button recordButton;
-  Button clipboardButton;
-  Button ctrlAltDelButton;
-  Button refreshButton;
-  Button ftpButton;
-
-  ButtonPanel(VncViewer v) {
-    viewer = v;
-
-    setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
-    disconnectButton = new Button("Disconnect");
-    disconnectButton.setEnabled(false);
-    add(disconnectButton);
-    disconnectButton.addActionListener(this);
-    optionsButton = new Button("Options");
-    add(optionsButton);
-    optionsButton.addActionListener(this);
-    clipboardButton = new Button("Clipboard");
-    clipboardButton.setEnabled(false);
-    add(clipboardButton);
-    clipboardButton.addActionListener(this);
-    if (viewer.rec != null) {
-      recordButton = new Button("Record");
-      add(recordButton);
-      recordButton.addActionListener(this);
-    }
-    ctrlAltDelButton = new Button("Send Ctrl-Alt-Del");
-    ctrlAltDelButton.setEnabled(false);
-    add(ctrlAltDelButton);
-    ctrlAltDelButton.addActionListener(this);
-    refreshButton = new Button("Refresh");
-    refreshButton.setEnabled(false);
-    add(refreshButton);
-    refreshButton.addActionListener(this);
-    ftpButton = new Button("File Transfer");
-    ftpButton.setEnabled(false);
-    add(ftpButton);
-    ftpButton.addActionListener(this);
-  }
-
-  //
-  // Enable buttons on successful connection.
-  //
-
-  public void enableButtons() {
-    disconnectButton.setEnabled(true);
-    clipboardButton.setEnabled(true);
-    refreshButton.setEnabled(true);
-    ftpButton.setEnabled(true);
-  }
-
-  //
-  // Disable all buttons on disconnect.
-  //
-
-  public void disableButtonsOnDisconnect() {
-    remove(disconnectButton);
-    disconnectButton = new Button("Hide desktop");
-    disconnectButton.setEnabled(true);
-    add(disconnectButton, 0);
-    disconnectButton.addActionListener(this);
-
-    optionsButton.setEnabled(false);
-    clipboardButton.setEnabled(false);
-    ctrlAltDelButton.setEnabled(false);
-    refreshButton.setEnabled(false);
-    ftpButton.setEnabled(false);
-
-    validate();
-  }
-
-  //
-  // Enable/disable controls that should not be available in view-only
-  // mode.
-  //
-
-  public void enableRemoteAccessControls(boolean enable) {
-    ctrlAltDelButton.setEnabled(enable);
-  }
-
-  //
-  // Event processing.
-  //
-
-  public void actionPerformed(ActionEvent evt) {
-
-    viewer.moveFocusToDesktop();
-
-    if (evt.getSource() == disconnectButton) {
-      viewer.disconnect();
-
-    } else if (evt.getSource() == optionsButton) {
-      viewer.options.setVisible(!viewer.options.isVisible());
-
-    } else if (evt.getSource() == recordButton) {
-      viewer.rec.setVisible(!viewer.rec.isVisible());
-
-    } else if (evt.getSource() == clipboardButton) {
-      viewer.clipboard.setVisible(!viewer.clipboard.isVisible());
-
-    } else if (evt.getSource() == ctrlAltDelButton) {
-      try {
-        final int modifiers = InputEvent.CTRL_MASK | InputEvent.ALT_MASK;
-
-        KeyEvent ctrlAltDelEvent =
-          new KeyEvent(this, KeyEvent.KEY_PRESSED, 0, modifiers, 127);
-        viewer.rfb.writeKeyEvent(ctrlAltDelEvent);
-
-        ctrlAltDelEvent =
-          new KeyEvent(this, KeyEvent.KEY_RELEASED, 0, modifiers, 127);
-        viewer.rfb.writeKeyEvent(ctrlAltDelEvent);
-
-      } catch (IOException e) {
-        e.printStackTrace();
-      }
-    }
-    else if (evt.getSource() == refreshButton)
-    {
-      try {
-			RfbProto rfb = viewer.rfb;
-			rfb.writeFramebufferUpdateRequest(0, 0, rfb.framebufferWidth,
-					  rfb.framebufferHeight, false);
-      }
-      catch (IOException e)
-	  {
-        e.printStackTrace();
-      }
-    }
-    else if (evt.getSource() == ftpButton)
-    {
-		viewer.ftp.setVisible(!viewer.ftp.isVisible());
-		viewer.rfb.readServerDriveList();
-	
-    }
-  }
-}
-
diff --git a/ica/JavaViewer/ChangeLog b/ica/JavaViewer/ChangeLog
deleted file mode 100644
index 16369d0..0000000
--- a/ica/JavaViewer/ChangeLog
+++ /dev/null
@@ -1,44 +0,0 @@
-2006-05 UltraVNC Team
-        * Improved MS Logon
-        * MS Logon weak challenge fixed
-
-2005-01-?? and 2005-02-?? ??:?? Ultr at VNC team
-
-        * Made the viewer compilable with Java SDK 1.3
-        * Added support for huge files transfers (> 4Gb)
-        * Added more color modes (64 colors, 8 Colors, Grey scales). Default settings
-          are now Tight and 64 Colors.
-
-
-2004-11-10 23:00 Ultr at VNC Team
-
-        * Prevented the FT GUI to be closed while a transfer is running
-        * Made FT GUI window non resizable
-        * Added confirmation dialogs for file Deletion and Overwrite
-        * Uniformized and cleaned the status/history messages
-        * Added "Stop" button
-        * Added certificate into the applet
-        * Made it compatible with enhanced FT protocole ( >= RC19)
-        * The selected pane is more "white" so the user knows to which
-          side the buttons apply
-        * Directory names are listed first, and are surrounded with
-          "[ " and " ]"
-
-2004-08-15 18:00 Ultr at VNC Team
-
-        * Added Kenn Min Chong and John Witchel FileTransfer code and GUI
-        * Added improvements in FileTransfer code (compression...) and GUI
-
-
-2004-07-05 12:00 Alban Chazot - Carmi Grenoble
-
-	* Modified AuthPanel to show username if Ultr at VNC mslogon connection required
-	* Modified VncViewer to accept Ultravnc mslogon
-	* Modified VncViewer to add scrollPane to applet mode
-
-2002-09-30 12:00  Ultr at VNC Team
-
-	* Replaced "TightVNC" with "Ultr at VNC" string in ClipboardFrame.java,
-	OptionsFrame.java and VncViewer.java
-
-	* Added Ultr at VNC in the .vnc files
diff --git a/ica/JavaViewer/ClipboardFrame.java b/ica/JavaViewer/ClipboardFrame.java
deleted file mode 100644
index 70a4ca6..0000000
--- a/ica/JavaViewer/ClipboardFrame.java
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-//  Copyright (C) 2001 HorizonLive.com, Inc.  All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// Clipboard frame.
-//
-
-import java.awt.*;
-import java.awt.event.*;
-
-class ClipboardFrame extends Frame
-  implements WindowListener, ActionListener {
-
-  TextArea textArea;
-  Button clearButton, closeButton;
-  String selection;
-  VncViewer viewer;
-
-  //
-  // Constructor.
-  //
-
-  ClipboardFrame(VncViewer v) {
-    super("Ultr at VNC Clipboard");
-
-    viewer = v;
-
-    GridBagLayout gridbag = new GridBagLayout();
-    setLayout(gridbag);
-
-    GridBagConstraints gbc = new GridBagConstraints();
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gbc.fill = GridBagConstraints.BOTH;
-    gbc.weighty = 1.0;
-
-    textArea = new TextArea(5, 40);
-    gridbag.setConstraints(textArea, gbc);
-    add(textArea);
-
-    gbc.fill = GridBagConstraints.HORIZONTAL;
-    gbc.weightx = 1.0;
-    gbc.weighty = 0.0;
-    gbc.gridwidth = 1;
-
-    clearButton = new Button("Clear");
-    gridbag.setConstraints(clearButton, gbc);
-    add(clearButton);
-    clearButton.addActionListener(this);
-
-    closeButton = new Button("Close");
-    gridbag.setConstraints(closeButton, gbc);
-    add(closeButton);
-    closeButton.addActionListener(this);
-
-    pack();
-
-    addWindowListener(this);
-  }
-
-
-  //
-  // Set the cut text from the RFB server.
-  //
-
-  void setCutText(String text) {
-    selection = text;
-    textArea.setText(text);
-    if (isVisible()) {
-      textArea.selectAll();
-    }
-  }
-
-
-  //
-  // When the focus leaves the window, see if we have new cut text and
-  // if so send it to the RFB server.
-  //
-
-  public void windowDeactivated (WindowEvent evt) {
-    if (selection != null && !selection.equals(textArea.getText())) {
-      selection = textArea.getText();
-      viewer.setCutText(selection);
-    }
-  }
-
-  //
-  // Close our window properly.
-  //
-
-  public void windowClosing(WindowEvent evt) {
-    setVisible(false);
-  }
-
-  //
-  // Ignore window events we're not interested in.
-  //
-
-  public void windowActivated(WindowEvent evt) {}
-  public void windowOpened(WindowEvent evt) {}
-  public void windowClosed(WindowEvent evt) {}
-  public void windowIconified(WindowEvent evt) {}
-  public void windowDeiconified(WindowEvent evt) {}
-
-
-  //
-  // Respond to button presses
-  //
-
-  public void actionPerformed(ActionEvent evt) {
-    if (evt.getSource() == clearButton) {
-      textArea.setText("");
-    } else if (evt.getSource() == closeButton) {
-      setVisible(false);
-    }
-  }
-}
diff --git a/ica/JavaViewer/DH.java b/ica/JavaViewer/DH.java
deleted file mode 100644
index 987d20d..0000000
--- a/ica/JavaViewer/DH.java
+++ /dev/null
@@ -1,182 +0,0 @@
-// CRYPTO LIBRARY FOR EXCHANGING KEYS
-// USING THE DIFFIE-HELLMAN KEY EXCHANGE PROTOCOL
-
-// The diffie-hellman can be used to securely exchange keys
-// between parties, where a third party eavesdropper given
-// the values being transmitted cannot determine the key.
-
-// Implemented by Lee Griffiths, Jan 2004.
-// This software is freeware, you may use it to your discretion,
-// however by doing so you take full responsibility for any damage
-// it may cause.
-
-// Hope you find it useful, even if you just use some of the functions
-// out of it like the prime number generator and the XtoYmodN function.
-
-// It would be great if you could send me emails to: lee.griffiths at first4internet.co.uk
-// with any suggestions, comments, or questions!
-
-// Enjoy.
-
-// Adopted to ms-logon for ultravnc and ported to Java by marscha, 2006.
-
-//import java.lang.Math;
-
-public class DH {
-
-	public DH() {
-		maxNum = (((long) 1) << DH_MAX_BITS) - 1;
-	}
-
-	public DH(long generator, long modulus) throws Exception {
-		maxNum = (((long) 1) << DH_MAX_BITS) - 1;
-		if (generator >= maxNum || modulus >= maxNum)
-			throw new Exception("Modulus or generator too large.");
-		gen = generator;
-		mod = modulus;
-	}
-
-	private long rng(long limit) {
-		return (long) (java.lang.Math.random() * limit);
-	}
-
-	//Performs the miller-rabin primality test on a guessed prime n.
-	//trials is the number of attempts to verify this, because the function
-	//is not 100% accurate it may be a composite.  However setting the trial
-	//value to around 5 should guarantee success even with very large primes
-	private boolean millerRabin (long n, int trials) { 
-		long a = 0; 
-	
-		for (int i = 0; i < trials; i++) { 
-			a = rng(n - 3) + 2;// gets random value in [2..n-1] 
-			if (XpowYmodN(a, n - 1, n) != 1) return false; //n composite, return false 
-		}
-		return true; // n probably prime 
-	} 
-	
-	//Generates a large prime number by
-	//choosing a randomly large integer, and ensuring the value is odd
-	//then uses the miller-rabin primality test on it to see if it is prime
-	//if not the value gets increased until it is prime
-	private long generatePrime() {
-		long prime = 0;
-	
-		do {
-			long start = rng(maxNum);
-			prime = tryToGeneratePrime(start);
-		} while (prime == 0);
-		return prime;
-	}
-	 
-	private long tryToGeneratePrime(long prime) {
-		//ensure it is an odd number
-		if ((prime & 1) == 0)
-			prime += 1;
-	
-		long cnt = 0;
-		while (!millerRabin(prime, 25) && (cnt++ < DH_RANGE) && prime < maxNum) {
-			prime += 2;
-			if ((prime % 3) == 0) prime += 2;
-		}
-		return (cnt >= DH_RANGE || prime >= maxNum) ? 0 : prime;
-	}
-	 
-	//Raises X to the power Y in modulus N
-	//the values of X, Y, and N can be massive, and this can be 
-	//achieved by first calculating X to the power of 2 then 
-	//using power chaining over modulus N
-	private long XpowYmodN(long x, long y, long N) {
-		long result = 1;
-		final long oneShift63 = ((long) 1) << 63;
-		
-		for (int i = 0; i < 64; y <<= 1, i++){
-			result = result * result % N;
-			if ((y & oneShift63) != 0)
-				result = result * x % N;
-		}
-		return result;
-	}
-	
-	public void createKeys() {
-		gen = generatePrime();
-		mod = generatePrime();
-	
-		if (gen > mod) {
-			long swap = gen;
-			gen  = mod;
-			mod  = swap;
-		}
-	}
-	
-	public long createInterKey() {
-		priv = rng(maxNum);
-		return pub = XpowYmodN(gen,priv,mod);
-	}
-	
-	public long createEncryptionKey(long interKey) throws Exception {
-		if (interKey >= maxNum){
-			throw new Exception("interKey too large");
-		}
-		return key = XpowYmodN(interKey,priv,mod);
-	}
-	
-	
-	public long getValue(int flags) {
-		switch (flags) {
-			case DH_MOD:
-				return mod;
-			case DH_GEN:
-				return gen;
-			case DH_PRIV:
-				return priv;
-			case DH_PUB:
-				return pub;
-			case DH_KEY:
-				return key;
-			default:
-				return (long) 0;
-		}
-	}
-	
-	public int bits(long number){
-		for (int i = 0; i < 64; i++){
-			number /= 2;
-			if (number < 2) return i;
-		}
-		return 0;
-	}
-	
-	public static byte[] longToBytes(long number) {
-		byte[] bytes  = new byte[8];
-		for (int i = 0; i < 8; i++) {
-			bytes[i] = (byte) (0xff & (number >> (8 * (7 - i))));
-		}
-		return bytes;
-	}
-	
-	public static long bytesToLong(byte[] bytes) {
-		long result = 0;
-		for (int i = 0; i < 8; i++) {
-			result <<= 8;
-			result += (byte) bytes[i];
-		}
-		return result;
-	}
-
-	private long gen;
-	private long mod;
-	private long priv;
-	private long pub;
-	private long key;
-	private long maxNum;
-
-	private static final int DH_MAX_BITS = 31;
-	private static final int DH_RANGE = 100;
-
-	private static final int DH_MOD	 = 1;
-	private static final int DH_GEN	 = 2;
-	private static final int DH_PRIV = 3;
-	private static final int DH_PUB  = 4;
-	private static final int DH_KEY  = 5;
-
-}
\ No newline at end of file
diff --git a/ica/JavaViewer/DesCipher.java b/ica/JavaViewer/DesCipher.java
deleted file mode 100644
index d753970..0000000
--- a/ica/JavaViewer/DesCipher.java
+++ /dev/null
@@ -1,524 +0,0 @@
-//
-// This DES class has been extracted from package Acme.Crypto for use in VNC.
-// The bytebit[] array has been reversed so that the most significant bit
-// in each byte of the key is ignored, not the least significant.  Also the
-// unnecessary odd parity code has been removed.
-//
-// These changes are:
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-// This software is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-//
-
-// DesCipher - the DES encryption method
-//
-// The meat of this code is by Dave Zimmerman <dzimm at widget.com>, and is:
-//
-// Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.
-//
-// Permission to use, copy, modify, and distribute this software
-// and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and
-// without fee is hereby granted, provided that this copyright notice is kept 
-// intact. 
-// 
-// WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
-// OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-// TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-// PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE
-// FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
-// DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
-// 
-// THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
-// CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
-// PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
-// NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
-// SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
-// SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
-// PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES").  WIDGET WORKSHOP
-// SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR
-// HIGH RISK ACTIVITIES.
-//
-//
-// The rest is:
-//
-// Copyright (C) 1996 by Jef Poskanzer <jef at acme.com>.  All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-//    notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-//    notice, this list of conditions and the following disclaimer in the
-//    documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE.
-//
-// Visit the ACME Labs Java page for up-to-date versions of this and other
-// fine Java utilities: http://www.acme.com/java/
-
-
-//import java.io.*;
-
-/// The DES encryption method.
-// <P>
-// This is surprisingly fast, for pure Java.  On a SPARC 20, wrapped
-// in Acme.Crypto.EncryptedOutputStream or Acme.Crypto.EncryptedInputStream,
-// it does around 7000 bytes/second.
-// <P>
-// Most of this code is by Dave Zimmerman <dzimm at widget.com>, and is
-// Copyright (c) 1996 Widget Workshop, Inc.  See the source file for details.
-// <P>
-// <A HREF="/resources/classes/Acme/Crypto/DesCipher.java">Fetch the software.</A><BR>
-// <A HREF="/resources/classes/Acme.tar.Z">Fetch the entire Acme package.</A>
-// <P>
-// @see Des3Cipher
-// @see EncryptedOutputStream
-// @see EncryptedInputStream
-
-public class DesCipher
-    {
-
-    // Constructor, byte-array key.
-    public DesCipher( byte[] key )
-	{
-	setKey( key );
-	}
-
-    // Key routines.
-
-    private int[] encryptKeys = new int[32];
-    private int[] decryptKeys = new int[32];
-
-    /// Set the key.
-    public void setKey( byte[] key )
-	{
-	deskey( key, true, encryptKeys );
-	deskey( key, false, decryptKeys );
-	}
-
-    // Turn an 8-byte key into internal keys.
-    private void deskey( byte[] keyBlock, boolean encrypting, int[] KnL )
-	{
-	int i, j, l, m, n;
-	int[] pc1m = new int[56];
-	int[] pcr = new int[56];
-	int[] kn = new int[32];
-
-	for ( j = 0; j < 56; ++j )
-	    {
-	    l = pc1[j];
-	    m = l & 07;
-	    pc1m[j] = ( (keyBlock[l >>> 3] & bytebit[m]) != 0 )? 1: 0;
-	    }
-
-	for ( i = 0; i < 16; ++i )
-	    {
-	    if ( encrypting )
-		m = i << 1;
-	    else
-		m = (15-i) << 1;
-	    n = m+1;
-	    kn[m] = kn[n] = 0;
-	    for ( j = 0; j < 28; ++j )
-		{
-		l = j+totrot[i];
-		if ( l < 28 )
-		    pcr[j] = pc1m[l];
-		else
-		    pcr[j] = pc1m[l-28];
-		}
-	    for ( j=28; j < 56; ++j )
-		{
-		l = j+totrot[i];
-		if ( l < 56 )
-		    pcr[j] = pc1m[l];
-		else
-		    pcr[j] = pc1m[l-28];
-		}
-	    for ( j = 0; j < 24; ++j )
-		{
-		if ( pcr[pc2[j]] != 0 )
-		    kn[m] |= bigbyte[j];
-		if ( pcr[pc2[j+24]] != 0 )
-		    kn[n] |= bigbyte[j];
-		}
-	    }
-	cookey( kn, KnL );
-	}
-
-    private void cookey( int[] raw, int KnL[] )
-	{
-	int raw0, raw1;
-	int rawi, KnLi;
-	int i;
-
-	for ( i = 0, rawi = 0, KnLi = 0; i < 16; ++i )
-	    {
-	    raw0 = raw[rawi++];
-	    raw1 = raw[rawi++];
-	    KnL[KnLi]  = (raw0 & 0x00fc0000) <<   6;
-	    KnL[KnLi] |= (raw0 & 0x00000fc0) <<  10;
-	    KnL[KnLi] |= (raw1 & 0x00fc0000) >>> 10;
-	    KnL[KnLi] |= (raw1 & 0x00000fc0) >>>  6;
-	    ++KnLi;
-	    KnL[KnLi]  = (raw0 & 0x0003f000) <<  12;
-	    KnL[KnLi] |= (raw0 & 0x0000003f) <<  16;
-	    KnL[KnLi] |= (raw1 & 0x0003f000) >>>  4;
-	    KnL[KnLi] |= (raw1 & 0x0000003f);
-	    ++KnLi;
-	    }
-	}
-
-
-    // Block encryption routines.
-
-    private int[] tempInts = new int[2];
-
-    /// Encrypt a block of eight bytes.
-    public void encrypt( byte[] clearText, int clearOff, byte[] cipherText, int cipherOff )
-	{
-	squashBytesToInts( clearText, clearOff, tempInts, 0, 2 );
-	des( tempInts, tempInts, encryptKeys );
-	spreadIntsToBytes( tempInts, 0, cipherText, cipherOff, 2 );
-	}
-
-    /// Decrypt a block of eight bytes.
-    public void decrypt( byte[] cipherText, int cipherOff, byte[] clearText, int clearOff )
-	{
-	squashBytesToInts( cipherText, cipherOff, tempInts, 0, 2 );
-	des( tempInts, tempInts, decryptKeys );
-	spreadIntsToBytes( tempInts, 0, clearText, clearOff, 2 );
-	}
-
-	// Encrypt a text which is a multiple of 8 bytes.
-    public void encryptText( byte[] clearText, byte[] cipherText, byte[] key) {
-		int i, j;
-		
-		for (i = 0; i< 8; i++)
-			clearText[i] ^= key[i];
-		encrypt(clearText, 0, cipherText, 0);
-		for (i = 8; i < clearText.length; i += 8) {
-			for (j = 0; j < 8; j++)
-				clearText[i + j] ^= cipherText[i + j - 8];
-			encrypt(clearText, i, cipherText, i);
-		}
-	}
-
-    // Decrypt a text which is a multiple of 8 bytes.
-    public void decryptText( byte[] cipherText, byte[] clearText, byte[] key) {
-    		int i, j;
-    		for (i = cipherText.length - 8; i > 0; i -= 8) {
-    			decrypt(cipherText, i, clearText, i);
-    			for (j = 0; j < 8; j++)
-    				clearText[i + j] ^= cipherText[i + j - 8];
-    		}
-    		/* i = 0 */
-    		decrypt(cipherText, 0, clearText, 0);
-    		for (i = 0; i < 8; i++)
-    			clearText[i] ^= key[i];
-    	}
-
-    // The DES function.
-    private void des( int[] inInts, int[] outInts, int[] keys )
-	{
-	int fval, work, right, leftt;
-	int round;
-	int keysi = 0;
-
-	leftt = inInts[0];
-	right = inInts[1];
-
-	work   = ((leftt >>>  4) ^ right) & 0x0f0f0f0f;
-	right ^= work;
-	leftt ^= (work << 4);
-
-	work   = ((leftt >>> 16) ^ right) & 0x0000ffff;
-	right ^= work;
-	leftt ^= (work << 16);
-
-	work   = ((right >>>  2) ^ leftt) & 0x33333333;
-	leftt ^= work;
-	right ^= (work << 2);
-
-	work   = ((right >>>  8) ^ leftt) & 0x00ff00ff;
-	leftt ^= work;
-	right ^= (work << 8);
-	right  = (right << 1) | ((right >>> 31) & 1);
-
-	work   = (leftt ^ right) & 0xaaaaaaaa;
-	leftt ^= work;
-	right ^= work;
-	leftt  = (leftt << 1) | ((leftt >>> 31) & 1);
-
-	for ( round = 0; round < 8; ++round )
-	    {
-	    work   = (right << 28) | (right >>> 4);
-	    work  ^= keys[keysi++];
-	    fval   = SP7[ work	       & 0x0000003f ];
-	    fval  |= SP5[(work >>>  8) & 0x0000003f ];
-	    fval  |= SP3[(work >>> 16) & 0x0000003f ];
-	    fval  |= SP1[(work >>> 24) & 0x0000003f ];
-	    work   = right ^ keys[keysi++];
-	    fval  |= SP8[ work         & 0x0000003f ];
-	    fval  |= SP6[(work >>>  8) & 0x0000003f ];
-	    fval  |= SP4[(work >>> 16) & 0x0000003f ];
-	    fval  |= SP2[(work >>> 24) & 0x0000003f ];
-	    leftt ^= fval;
-	    work   = (leftt << 28) | (leftt >>> 4);
-	    work  ^= keys[keysi++];
-	    fval   = SP7[ work	       & 0x0000003f ];
-	    fval  |= SP5[(work >>>  8) & 0x0000003f ];
-	    fval  |= SP3[(work >>> 16) & 0x0000003f ];
-	    fval  |= SP1[(work >>> 24) & 0x0000003f ];
-	    work   = leftt ^ keys[keysi++];
-	    fval  |= SP8[ work	       & 0x0000003f ];
-	    fval  |= SP6[(work >>>  8) & 0x0000003f ];
-	    fval  |= SP4[(work >>> 16) & 0x0000003f ];
-	    fval  |= SP2[(work >>> 24) & 0x0000003f ];
-	    right ^= fval;
-	    }
-
-	right  = (right << 31) | (right >>> 1);
-	work   = (leftt ^ right) & 0xaaaaaaaa;
-	leftt ^= work;
-	right ^= work;
-	leftt  = (leftt << 31) | (leftt >>> 1);
-	work   = ((leftt >>>  8) ^ right) & 0x00ff00ff;
-	right ^= work;
-	leftt ^= (work << 8);
-	work   = ((leftt >>>  2) ^ right) & 0x33333333;
-	right ^= work;
-	leftt ^= (work << 2);
-	work   = ((right >>> 16) ^ leftt) & 0x0000ffff;
-	leftt ^= work;
-	right ^= (work << 16);
-	work   = ((right >>>  4) ^ leftt) & 0x0f0f0f0f;
-	leftt ^= work;
-	right ^= (work << 4);
-	outInts[0] = right;
-	outInts[1] = leftt;
-	}
-
-
-    // Tables, permutations, S-boxes, etc.
-
-    private static byte[] bytebit = {
-	(byte)0x01, (byte)0x02, (byte)0x04, (byte)0x08,
-	(byte)0x10, (byte)0x20, (byte)0x40, (byte)0x80
-	};
-    private static int[] bigbyte = {
-	0x800000, 0x400000, 0x200000, 0x100000,
-	0x080000, 0x040000, 0x020000, 0x010000,
-	0x008000, 0x004000, 0x002000, 0x001000,
-	0x000800, 0x000400, 0x000200, 0x000100,
-	0x000080, 0x000040, 0x000020, 0x000010,
-	0x000008, 0x000004, 0x000002, 0x000001
-	};
-    private static byte[] pc1 = {
-         (byte)56, (byte)48, (byte)40, (byte)32, (byte)24, (byte)16, (byte) 8,
-      (byte) 0, (byte)57, (byte)49, (byte)41, (byte)33, (byte)25, (byte)17,
-	 (byte) 9, (byte) 1, (byte)58, (byte)50, (byte)42, (byte)34, (byte)26,
-      (byte)18, (byte)10, (byte) 2, (byte)59, (byte)51, (byte)43, (byte)35,
-	 (byte)62, (byte)54, (byte)46, (byte)38, (byte)30, (byte)22, (byte)14,
-      (byte) 6, (byte)61, (byte)53, (byte)45, (byte)37, (byte)29, (byte)21,
-	 (byte)13, (byte) 5, (byte)60, (byte)52, (byte)44, (byte)36, (byte)28,
-      (byte)20, (byte)12, (byte) 4, (byte)27, (byte)19, (byte)11, (byte)3
-	};
-    private static int[] totrot = {
-        1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28
-	};
-
-    private static byte[] pc2 = {
-	(byte)13, (byte)16, (byte)10, (byte)23, (byte) 0, (byte) 4,
-	          (byte) 2, (byte)27, (byte)14, (byte) 5, (byte)20, (byte) 9,
-	(byte)22, (byte)18, (byte)11, (byte)3 , (byte)25, (byte) 7,
-	          (byte)15, (byte) 6, (byte)26, (byte)19, (byte)12, (byte) 1,
-	(byte)40, (byte)51, (byte)30, (byte)36, (byte)46, (byte)54,
-	          (byte)29, (byte)39, (byte)50, (byte)44, (byte)32, (byte)47,
-	(byte)43, (byte)48, (byte)38, (byte)55, (byte)33, (byte)52,
-	          (byte)45, (byte)41, (byte)49, (byte)35, (byte)28, (byte)31,
-	};
-
-    private static int[] SP1 = {
-        0x01010400, 0x00000000, 0x00010000, 0x01010404,
-	0x01010004, 0x00010404, 0x00000004, 0x00010000,
-	0x00000400, 0x01010400, 0x01010404, 0x00000400,
-	0x01000404, 0x01010004, 0x01000000, 0x00000004,
-	0x00000404, 0x01000400, 0x01000400, 0x00010400,
-	0x00010400, 0x01010000, 0x01010000, 0x01000404,
-	0x00010004, 0x01000004, 0x01000004, 0x00010004,
-	0x00000000, 0x00000404, 0x00010404, 0x01000000,
-	0x00010000, 0x01010404, 0x00000004, 0x01010000,
-	0x01010400, 0x01000000, 0x01000000, 0x00000400,
-	0x01010004, 0x00010000, 0x00010400, 0x01000004,
-	0x00000400, 0x00000004, 0x01000404, 0x00010404,
-	0x01010404, 0x00010004, 0x01010000, 0x01000404,
-	0x01000004, 0x00000404, 0x00010404, 0x01010400,
-	0x00000404, 0x01000400, 0x01000400, 0x00000000,
-	0x00010004, 0x00010400, 0x00000000, 0x01010004
-	};
-    private static int[] SP2 = {
-	0x80108020, 0x80008000, 0x00008000, 0x00108020,
-	0x00100000, 0x00000020, 0x80100020, 0x80008020,
-	0x80000020, 0x80108020, 0x80108000, 0x80000000,
-	0x80008000, 0x00100000, 0x00000020, 0x80100020,
-	0x00108000, 0x00100020, 0x80008020, 0x00000000,
-	0x80000000, 0x00008000, 0x00108020, 0x80100000,
-	0x00100020, 0x80000020, 0x00000000, 0x00108000,
-	0x00008020, 0x80108000, 0x80100000, 0x00008020,
-	0x00000000, 0x00108020, 0x80100020, 0x00100000,
-	0x80008020, 0x80100000, 0x80108000, 0x00008000,
-	0x80100000, 0x80008000, 0x00000020, 0x80108020,
-	0x00108020, 0x00000020, 0x00008000, 0x80000000,
-	0x00008020, 0x80108000, 0x00100000, 0x80000020,
-	0x00100020, 0x80008020, 0x80000020, 0x00100020,
-	0x00108000, 0x00000000, 0x80008000, 0x00008020,
-	0x80000000, 0x80100020, 0x80108020, 0x00108000
-	};
-    private static int[] SP3 = {
-	0x00000208, 0x08020200, 0x00000000, 0x08020008,
-	0x08000200, 0x00000000, 0x00020208, 0x08000200,
-	0x00020008, 0x08000008, 0x08000008, 0x00020000,
-	0x08020208, 0x00020008, 0x08020000, 0x00000208,
-	0x08000000, 0x00000008, 0x08020200, 0x00000200,
-	0x00020200, 0x08020000, 0x08020008, 0x00020208,
-	0x08000208, 0x00020200, 0x00020000, 0x08000208,
-	0x00000008, 0x08020208, 0x00000200, 0x08000000,
-	0x08020200, 0x08000000, 0x00020008, 0x00000208,
-	0x00020000, 0x08020200, 0x08000200, 0x00000000,
-	0x00000200, 0x00020008, 0x08020208, 0x08000200,
-	0x08000008, 0x00000200, 0x00000000, 0x08020008,
-	0x08000208, 0x00020000, 0x08000000, 0x08020208,
-	0x00000008, 0x00020208, 0x00020200, 0x08000008,
-	0x08020000, 0x08000208, 0x00000208, 0x08020000,
-	0x00020208, 0x00000008, 0x08020008, 0x00020200
-	};
-    private static int[] SP4 = {
-	0x00802001, 0x00002081, 0x00002081, 0x00000080,
-	0x00802080, 0x00800081, 0x00800001, 0x00002001,
-	0x00000000, 0x00802000, 0x00802000, 0x00802081,
-	0x00000081, 0x00000000, 0x00800080, 0x00800001,
-	0x00000001, 0x00002000, 0x00800000, 0x00802001,
-	0x00000080, 0x00800000, 0x00002001, 0x00002080,
-	0x00800081, 0x00000001, 0x00002080, 0x00800080,
-	0x00002000, 0x00802080, 0x00802081, 0x00000081,
-	0x00800080, 0x00800001, 0x00802000, 0x00802081,
-	0x00000081, 0x00000000, 0x00000000, 0x00802000,
-	0x00002080, 0x00800080, 0x00800081, 0x00000001,
-	0x00802001, 0x00002081, 0x00002081, 0x00000080,
-	0x00802081, 0x00000081, 0x00000001, 0x00002000,
-	0x00800001, 0x00002001, 0x00802080, 0x00800081,
-	0x00002001, 0x00002080, 0x00800000, 0x00802001,
-	0x00000080, 0x00800000, 0x00002000, 0x00802080
-	};
-    private static int[] SP5 = {
-	0x00000100, 0x02080100, 0x02080000, 0x42000100,
-	0x00080000, 0x00000100, 0x40000000, 0x02080000,
-	0x40080100, 0x00080000, 0x02000100, 0x40080100,
-	0x42000100, 0x42080000, 0x00080100, 0x40000000,
-	0x02000000, 0x40080000, 0x40080000, 0x00000000,
-	0x40000100, 0x42080100, 0x42080100, 0x02000100,
-	0x42080000, 0x40000100, 0x00000000, 0x42000000,
-	0x02080100, 0x02000000, 0x42000000, 0x00080100,
-	0x00080000, 0x42000100, 0x00000100, 0x02000000,
-	0x40000000, 0x02080000, 0x42000100, 0x40080100,
-	0x02000100, 0x40000000, 0x42080000, 0x02080100,
-	0x40080100, 0x00000100, 0x02000000, 0x42080000,
-	0x42080100, 0x00080100, 0x42000000, 0x42080100,
-	0x02080000, 0x00000000, 0x40080000, 0x42000000,
-	0x00080100, 0x02000100, 0x40000100, 0x00080000,
-	0x00000000, 0x40080000, 0x02080100, 0x40000100
-	};
-    private static int[] SP6 = {
-	0x20000010, 0x20400000, 0x00004000, 0x20404010,
-	0x20400000, 0x00000010, 0x20404010, 0x00400000,
-	0x20004000, 0x00404010, 0x00400000, 0x20000010,
-	0x00400010, 0x20004000, 0x20000000, 0x00004010,
-	0x00000000, 0x00400010, 0x20004010, 0x00004000,
-	0x00404000, 0x20004010, 0x00000010, 0x20400010,
-	0x20400010, 0x00000000, 0x00404010, 0x20404000,
-	0x00004010, 0x00404000, 0x20404000, 0x20000000,
-	0x20004000, 0x00000010, 0x20400010, 0x00404000,
-	0x20404010, 0x00400000, 0x00004010, 0x20000010,
-	0x00400000, 0x20004000, 0x20000000, 0x00004010,
-	0x20000010, 0x20404010, 0x00404000, 0x20400000,
-	0x00404010, 0x20404000, 0x00000000, 0x20400010,
-	0x00000010, 0x00004000, 0x20400000, 0x00404010,
-	0x00004000, 0x00400010, 0x20004010, 0x00000000,
-	0x20404000, 0x20000000, 0x00400010, 0x20004010
-	};
-    private static int[] SP7 = {
-	0x00200000, 0x04200002, 0x04000802, 0x00000000,
-	0x00000800, 0x04000802, 0x00200802, 0x04200800,
-	0x04200802, 0x00200000, 0x00000000, 0x04000002,
-	0x00000002, 0x04000000, 0x04200002, 0x00000802,
-	0x04000800, 0x00200802, 0x00200002, 0x04000800,
-	0x04000002, 0x04200000, 0x04200800, 0x00200002,
-	0x04200000, 0x00000800, 0x00000802, 0x04200802,
-	0x00200800, 0x00000002, 0x04000000, 0x00200800,
-	0x04000000, 0x00200800, 0x00200000, 0x04000802,
-	0x04000802, 0x04200002, 0x04200002, 0x00000002,
-	0x00200002, 0x04000000, 0x04000800, 0x00200000,
-	0x04200800, 0x00000802, 0x00200802, 0x04200800,
-	0x00000802, 0x04000002, 0x04200802, 0x04200000,
-	0x00200800, 0x00000000, 0x00000002, 0x04200802,
-	0x00000000, 0x00200802, 0x04200000, 0x00000800,
-	0x04000002, 0x04000800, 0x00000800, 0x00200002
-	};
-    private static int[] SP8 = {
-	0x10001040, 0x00001000, 0x00040000, 0x10041040,
-	0x10000000, 0x10001040, 0x00000040, 0x10000000,
-	0x00040040, 0x10040000, 0x10041040, 0x00041000,
-	0x10041000, 0x00041040, 0x00001000, 0x00000040,
-	0x10040000, 0x10000040, 0x10001000, 0x00001040,
-	0x00041000, 0x00040040, 0x10040040, 0x10041000,
-	0x00001040, 0x00000000, 0x00000000, 0x10040040,
-	0x10000040, 0x10001000, 0x00041040, 0x00040000,
-	0x00041040, 0x00040000, 0x10041000, 0x00001000,
-	0x00000040, 0x10040040, 0x00001000, 0x00041040,
-	0x10001000, 0x00000040, 0x10000040, 0x10040000,
-	0x10040040, 0x10000000, 0x00040000, 0x10001040,
-	0x00000000, 0x10041040, 0x00040040, 0x10000040,
-	0x10040000, 0x10001000, 0x10001040, 0x00000000,
-	0x10041040, 0x00041000, 0x00041000, 0x00001040,
-	0x00001040, 0x00040040, 0x10000000, 0x10041000
-	};
-
-    // Routines taken from other parts of the Acme utilities.
-
-    /// Squash bytes down to ints.
-    public static void squashBytesToInts( byte[] inBytes, int inOff, int[] outInts, int outOff, int intLen )
-        {
-	for ( int i = 0; i < intLen; ++i )
-	    outInts[outOff + i] = 
-		( ( inBytes[inOff + i * 4    ] & 0xff ) << 24 ) |
-		( ( inBytes[inOff + i * 4 + 1] & 0xff ) << 16 ) |
-		( ( inBytes[inOff + i * 4 + 2] & 0xff ) <<  8 ) |
-		  ( inBytes[inOff + i * 4 + 3] & 0xff );
-        }
-
-    /// Spread ints into bytes.
-    public static void spreadIntsToBytes( int[] inInts, int inOff, byte[] outBytes, int outOff, int intLen )
-        {
-	for ( int i = 0; i < intLen; ++i )
-	    {
-	    outBytes[outOff + i * 4    ] = (byte) ( inInts[inOff + i] >>> 24 );
-	    outBytes[outOff + i * 4 + 1] = (byte) ( inInts[inOff + i] >>> 16 );
-	    outBytes[outOff + i * 4 + 2] = (byte) ( inInts[inOff + i] >>>  8 );
-	    outBytes[outOff + i * 4 + 3] = (byte)   inInts[inOff + i];
-	    }
-        }
-    }
diff --git a/ica/JavaViewer/FTPFrame.java b/ica/JavaViewer/FTPFrame.java
deleted file mode 100644
index 03c23c4..0000000
--- a/ica/JavaViewer/FTPFrame.java
+++ /dev/null
@@ -1,1344 +0,0 @@
-// Copyright (C) 2002-2005 Ultr at VNC Team.  All Rights Reserved.
-// Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
-//
-//This is free software; you can redistribute it and/or modify
-//it under the terms of the GNU General Public License as published by
-//the Free Software Foundation; either version 2 of the License, or
-//(at your option) any later version.
-//
-//This software is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU General Public License for more details.
-//
-//You should have received a copy of the GNU General Public License
-//along with this software; if not, write to the Free Software
-//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//USA.
-//
-
-
-import javax.swing.JFrame;
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Vector;
-import javax.swing.*;
-
-
-/*
- * Created on Feb 25, 2004
- *
- */
-
-
-/**
- * @author John Witchel, Kenn Min Chong
- * sf at 2004, 2005, 2006, 2007
- *
- */
-public class FTPFrame extends JFrame implements ActionListener, MouseListener {
-
-	private VncViewer viewer;
-
-	private javax.swing.JPanel jContentPane = null;
-	private javax.swing.JPanel topPanel = null;
-	private javax.swing.JPanel topPanelLocal = null;
-	private javax.swing.JPanel topPanelRemote = null;
-	private javax.swing.JPanel statusPanel = null;
-	private javax.swing.JPanel remotePanel = null;
-	private javax.swing.JPanel localPanel = null;
-	private javax.swing.JPanel buttonPanel = null;
-	private javax.swing.JButton sendButton = null;
-	private javax.swing.JButton receiveButton = null;
-	private javax.swing.JButton deleteButton = null;
-	private javax.swing.JButton newFolderButton = null;
-	private javax.swing.JButton stopButton = null;
-	private javax.swing.JButton closeButton = null;
-	private javax.swing.JComboBox localDrivesComboBox = null;
-	private javax.swing.JComboBox remoteDrivesComboBox = null;
-	private javax.swing.JTextField localMachineLabel = null;
-	private javax.swing.JTextField remoteMachineLabel = null;
-	private javax.swing.JButton localTopButton = null;
-	private javax.swing.JButton remoteTopButton = null;
-	private javax.swing.JScrollPane localScrollPane = null;
-	private javax.swing.JList localFileTable = null;
-	private javax.swing.JScrollPane remoteScrollPane = null;
-	private javax.swing.JList remoteFileTable = null;
-	private javax.swing.JTextField remoteLocation = null;
-	private javax.swing.JTextField localLocation = null;
-	private javax.swing.JTextField localStatus = null;
-	public javax.swing.JTextField remoteStatus = null;
-	public javax.swing.JComboBox historyComboBox = null;
-	public javax.swing.JProgressBar jProgressBar = null;
-	public javax.swing.JTextField connectionStatus = null;
-	public boolean updateDriveList;
-	private Vector remoteList = null;
-	private Vector localList = null;
-	private File currentLocalDirectory = null;	// Holds the current local Directory
-	public String selectedTable = null;
-	private ArrayList localDirList;
-	private ArrayList localFileList;
-	//private final static boolean DEBUG  = false;
-
-
-        // sf at 2007 - The 'natural' string comparator is case sensitive... which sucks
-        // for our purpose as the files names beginning with an upper case char are
-        // all grouped before files names starting with a lower case char...
-        public class StrComp implements java.util.Comparator
-        {
-          public int compare(Object obj1, Object obj2)
-          {
-               String str1 = obj1.toString().toUpperCase();
-               String str2 = obj2.toString().toUpperCase();
-               return str1.compareTo(str2);
-          }
-        }
-
-	///////////////////////////////////////////////////////////////////////////
-	//																		//
-	//							Constructor									//
-	//																		//
-	///////////////////////////////////////////////////////////////////////////
-
-	/**
-	 * only constructor
-	 * @param VnvViewer
-	 */
-
-	FTPFrame(VncViewer v) {
-		super("Ultr at VNC File Transfer");
-		viewer = v;
-		initialize();
-	}
-
-	///////////////////////////////////////////////////////////////////////////
-	//																		//
-	//						public - Methods								//
-	//																		//
-	///////////////////////////////////////////////////////////////////////////
-
-	/**
-	 * Implements Action listener.
-	 * @return void
-	 */
-
-	public void actionPerformed(ActionEvent evt) {
-		System.out.println(evt.getSource());
-
-		if (evt.getSource() == closeButton) {
-			doClose();
-		}
-		else if (evt.getSource() == sendButton) {
-			Dimension dim = localPanel.getSize();
-			doSend();
-			this.repaint(); // Fix: troessner - Disapearing buttons bug
-		}
-		else if (evt.getSource() == receiveButton) {
-			doReceive();
-			this.repaint();
-		}
-		else if (evt.getSource() == localDrivesComboBox) {
-			changeLocalDrive();
-			this.repaint();
-		}
-		else if (evt.getSource() == remoteDrivesComboBox) {
-			changeRemoteDrive();
-			remoteList.clear();
-			remoteFileTable.setListData(remoteList);
-		}
-		else if (evt.getSource() == localTopButton) {
-			changeLocalDrive();
-			this.repaint();
-		}
-		else if (evt.getSource() == remoteTopButton) {
-		  	changeRemoteDrive();
-			this.repaint();
-		}
-		else if(evt.getSource() == deleteButton) {
-			doDelete();
-			this.repaint();
-			this.repaint();
-		}
-		else if(evt.getSource() == newFolderButton) {
-			doNewFolder();
-			this.repaint();
-			this.repaint();
-		}
-		else if (evt.getSource() == stopButton) {
-			doStop();
-			this.repaint();
-			this.repaint();
-		}
-	}
-
-	/**
-	 * Disable buttons/lists while file transfer is in progress
-	 * @return void
-	 */
-
-	public void disableButtons() {
-
-		closeButton.setEnabled(false);
-		deleteButton.setEnabled(false);
-		localTopButton.setEnabled(false);
-		newFolderButton.setEnabled(false);
-		stopButton.setVisible(true);
-		stopButton.setEnabled(true);
-		receiveButton.setEnabled(false);
-		remoteTopButton.setEnabled(false);
-		sendButton.setEnabled(false);
-		remoteFileTable.setEnabled(false);
-		localFileTable.setEnabled(false);
-		localLocation.setEnabled(false);
-		remoteLocation.setEnabled(false);
-		remoteDrivesComboBox.setEnabled(false);
-		localDrivesComboBox.setEnabled(false);
-		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // sf at 2004
-	}
-
-	/**
-	 * Enable buttons/lists when file transfer is done
-	 * @return void
-	 */
-	
-	public void enableButtons() {
-		
-		closeButton.setEnabled(true);
-		deleteButton.setEnabled(true);
-		localTopButton.setEnabled(true);
-		newFolderButton.setEnabled(true);
-		stopButton.setVisible(false);
-		stopButton.setEnabled(false);
-		receiveButton.setEnabled(true);
-		remoteTopButton.setEnabled(true);
-		sendButton.setEnabled(true);
-		remoteFileTable.setEnabled(true);
-		localFileTable.setEnabled(true);
-		localLocation.setEnabled(true);		
-		remoteLocation.setEnabled(true);
-		remoteDrivesComboBox.setEnabled(true);
-		localDrivesComboBox.setEnabled(true);
-	}
-	
-	/**
-	 * This method updates the file table to the current selection of the remoteComboBox
-	 * @return void
-	 */
-	
-	public void changeRemoteDrive() {
-
-		if (!updateDriveList) {
-			String drive =	remoteDrivesComboBox.getSelectedItem().toString().substring(0,1)+ ":\\";
-			viewer.rfb.readServerDirectory(drive);
-			remoteLocation.setText(drive);
-		}
-		remoteList.clear();
-		remoteFileTable.setListData(remoteList);
-	}
-	
-	/**
-	 * Determines which FileTable was double-clicked and updates the table
-	 */
-	
-	public void mouseClicked(MouseEvent e) {
-		
-		// Single clicked
-		if(e.getClickCount() == 1) {
-			// on local file table
-			if (e.getSource() == localFileTable ){  	 
-				updateLocalFileTableSelection();
-			}
-			// on a remote file table
-			else if (e.getSource() == remoteFileTable) {
-				updateRemoteFileTableSelection();						
-			}
-		}
-		// Mouse Double clicked
-		else if (e.getClickCount() == 2) {
-			// Clicked on local file
-			if (e.getSource() == localFileTable) {	
-				updateLocalFileTable();
-			}
-			// Clicked on remote file
-			else if (e.getSource() == remoteFileTable) {	
-				updateRemoteFileTable();
-			}
-		}
-	}
-	
-	/**
-	 * Refreshing local and remote directory lists after an operation has been performed
-	 * @return void
-	 */
-
-	 public void refreshLocalLocation()	{
-		 
-	 	File f = new File(localLocation.getText());
-	 	this.changeLocalDirectory(f);
-	 }
-	 
-	 public void refreshRemoteLocation() {
-		 
-		remoteList.clear();
-		remoteFileTable.setListData(remoteList);	
-		viewer.rfb.readServerDirectory(remoteLocation.getText());
-	 }
-
-	 
-	/**
-	 * Prints the list of drives on the remote directory and returns a String[].  
-	 * str takes as string like A:fC:lD:lE:lF:lG:cH:c
-	 * in the form Drive Letter:Drive Type where 
-	 * f = floppy, l = local drive, c=CD-ROM, n = network
-	 *
-	 * @return String[]
-	 */
- 
-	public String[] printDrives(String str) {
-		
-		updateDriveList = true;
-		remoteDrivesComboBox.removeAllItems();
-		int size = str.length();
-		String driveType = null;
-		String[] drive = new String[str.length() / 3];
-
-		// Loop through the string to create a String[]
-		for (int i = 0; i < size; i = i + 3) {
-			drive[i / 3] = str.substring(i, i + 2);
-			driveType = str.substring(i + 2, i + 3);
-			if (driveType.compareTo("f") == 0)
-				drive[i / 3] += "\\ Floppy";
-			if (driveType.compareTo("l") == 0)
-				drive[i / 3] += "\\ Local Disk";
-			if (driveType.compareTo("c") == 0)
-				drive[i / 3] += "\\ CD-ROM";
-			if (driveType.compareTo("n") == 0)
-				drive[i / 3] += "\\ Network";
-
-			remoteDrivesComboBox.addItem(drive[i / 3]);
-		}
-		//sf@ - Select Drive C:as default if possible
-		boolean bFound = false;
-		for(int i = 0; i < remoteDrivesComboBox.getItemCount() ; i++)
-		{
-			if(remoteDrivesComboBox.getItemAt(i).toString().substring(0,1).toUpperCase().equals("C"))
-			{
-				remoteDrivesComboBox.setSelectedIndex(i);
-				bFound = true;
-			}
-		}
-		if (!bFound) remoteDrivesComboBox.setSelectedIndex(0);
-		updateDriveList = false;
-		return drive;
-	}
-
-
-	/**
-	 * Print Directory prints out all the contents of a directory
-	 */
-        // Remote directory content sorting - Modif: troessner
-	public void printRemoteDirectory(ArrayList a) {
-
-                remoteList.clear(); // sf at 2007 - Avoids to have the same entries twice in some cases
-
-		ArrayList files = new ArrayList();
-		ArrayList dirs = new ArrayList();
-
-		for (Iterator i = a.iterator(); i.hasNext();) {
-			String name = (String) i.next();
-
-			if(name.equals("[..]")) {
-				remoteList.add(name);
-			}
-			// blank before '[' is mandatory!
-			else if(name.startsWith(" [") && name.endsWith("]")) {
-				dirs.add(name.substring(2, name.length() - 1));
-			}
-			else {
-				files.add(name);
-			}
-		}
-		Collections.sort(dirs, new StrComp());
-		Collections.sort(files, new StrComp());
-
-		for (Iterator i = dirs.iterator(); i.hasNext();) {
-			String dirname = (String) i.next();
-			// blank before '[' is mandatory!
-			remoteList.add(" [" + dirname + "]");
-		}
-		for (Iterator i = files.iterator(); i.hasNext();) {
-			String filename = (String) i.next();
-			remoteList.add(filename);
-		}
-		remoteFileTable.setListData(remoteList);
-	}
-
-
-
-	public void mouseEntered(MouseEvent e) {}
-	public void mouseExited(MouseEvent e) {}
-	public void mousePressed(MouseEvent e) {}
-	public void mouseReleased(MouseEvent e) {}
-
-
-	///////////////////////////////////////////////////////////////////////////
-	//						private - Methods								//
-	///////////////////////////////////////////////////////////////////////////
-
-
-	//************************************************************************//
-	//								ACTIONS									  //
-	//************************************************************************//
-	
-	private void doNewFolder() {
-		
-		String name = JOptionPane.showInputDialog(null,"Enter new directory name", "Create New Directory", JOptionPane.QUESTION_MESSAGE);
-		// Fix: troessner - if name is null, the user hit the "cancel"-button. in that case -> do not create folder
-		if(name == null) {
-			return;
-		}
-		if(selectedTable.equals("remote")) {
-			name = remoteLocation.getText()+name;
-			viewer.rfb.createRemoteDirectory(name);
-		}
-		else {
-			name = localLocation.getText()+name;
-			File f = new File(name);
-			f.mkdir();
-			refreshLocalLocation();
-			historyComboBox.insertItemAt(new String("Created Local Directory: " + name),0);
-			historyComboBox.setSelectedIndex(0);
-		}
-	}
-	
-	private void doClose() {
-		
-		try {
-			this.setVisible(false);
-			viewer.rfb.writeFramebufferUpdateRequest(
-									0,
-									0,
-									viewer.rfb.framebufferWidth,
-									viewer.rfb.framebufferHeight,
-									true);
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-	private void doDelete() {
-		
-		System.out.println("Delete Button Pressed");
-		//Call this method to delete a file at server
-		if(selectedTable.equals("remote"))
-		{	
-			String sFileName = ((String) this.remoteFileTable.getSelectedValue());
-			
-//			 sf at 2004 - Directory can't be deleted
-			if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
-			{
-				JOptionPane.showMessageDialog(null, (String)"Directory Deletion is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
-				return;
-			}			
-			// for (int i = 0; i < remoteList.contains(size(); i++)
-			// 	remoteFileTable.g(i));
-			// sf at 2004 - Delete prompt
-			if (remoteList.contains(sFileName))
-			{
-				int r = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete the file \n< " + sFileName + " >\n on Remote Machine ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
-				if (r == JOptionPane.NO_OPTION)
-					return;
-			}
-			
-			String fileName = remoteLocation.getText()+ sFileName.substring(1);
-			viewer.rfb.deleteRemoteFile(fileName);
-		}
-		else
-		{
-			String sFileName = ((String) this.localFileTable.getSelectedValue());
-			
-//			 sf at 2004 - Directory can't be deleted
-			if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
-			{
-				JOptionPane.showMessageDialog(null, (String)"Directory Deletion is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
-				return;
-			}			
-			// sf at 2004 - Delete prompt
-			if (localList.contains(sFileName))
-			{
-				int r = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete the file \n< " + sFileName + " >\n on Local Machine ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
-				if (r == JOptionPane.NO_OPTION)
-					return;
-			}			
-			String s = localLocation.getText() + sFileName.substring(1);
-			File f = new File(s);
-			f.delete();
-			refreshLocalLocation();
-			historyComboBox.insertItemAt(new String("Deleted On Local Disk: " + s),0);
-			historyComboBox.setSelectedIndex(0);
-		}
-	}
-
-	private void doReceive() {
-		
-		System.out.println("Received Button Pressed");
-
-		String sFileName = ((String) this.remoteFileTable.getSelectedValue());
-		
-		// sf at 2004 - Directory can't be transfered
-		if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
-		{
-			JOptionPane.showMessageDialog(null, (String)"Directory Transfer is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
-			return;
-		}
-		
-		// sf at 2004 - Overwrite prompt
-		if (localList.contains(sFileName))
-		{
-			int r = JOptionPane.showConfirmDialog(null, "The file < " + sFileName + " >\n already exists on Local Machine\n Are you sure you want to overwrite it ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
-			if (r == JOptionPane.NO_OPTION)
-				return;
-		}
-		
-		//updateHistory("Downloaded " + localSelection.toString());
-		String remoteFileName = this.remoteLocation.getText();
-		remoteFileName+= ((String) this.remoteFileTable.getSelectedValue()).substring(1);
-
-		String localDestinationPath = this.localLocation.getText()+((String)this.remoteFileTable.getSelectedValue()).substring(1);
-		viewer.rfb.requestRemoteFile(remoteFileName,localDestinationPath);
-	}
-
-	private void doSend() {
-		
-		System.out.println("Send Button Pressed");
-
-		String sFileName = ((String) this.localFileTable.getSelectedValue());
-		
-		// sf at 2004 - Directory can't be transfered
-		if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
-		{
-			JOptionPane.showMessageDialog(null, (String)"Directory Transfer is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
-			return;
-		}
-		
-		// sf at 2004 - Overwrite prompt
-		if (remoteList.contains(sFileName))
-		{
-			int r = JOptionPane.showConfirmDialog(null, "The file < " + sFileName + " >\n already exists on Remote Machine\n Are you sure you want to overwrite it ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
-			if (r == JOptionPane.NO_OPTION)
-				return;
-		}
-		//updateHistory("Uploaded " + localSelection.toString());
-		String source = this.localLocation.getText();
-		source += ((String) this.localFileTable.getSelectedValue()).substring(1);
-		
-		String destinationPath = this.remoteLocation.getText();
-		viewer.rfb.offerLocalFile(source,destinationPath);
-	}
-
-	//
-	// sf at 2004 - The user stops the current file transfer
-	// 
-	private void doStop() {
-		viewer.rfb.fAbort = true;
-	}
-
-
-	/**
-	 * changeLocalDrive updates the file table
-	 * to the current selection of the localComboBox
-	 */
-	private void changeLocalDrive() {
-		
-		File currentDrive = new File(localDrivesComboBox.getSelectedItem().toString());
-		if(currentDrive.canRead()) {
-			localStatus.setText("");
-			changeLocalDirectory(currentDrive);
-		}
-		else {
-			localList.clear();
-			localStatus.setText("WARNING: Drive " + localDrivesComboBox.getSelectedItem().toString());
-			connectionStatus.setText(" > WARNING - Local Drive unavailable (possibly restricted access or media not present)");
-		}
-	}
-
-	/**
-	 * Updates the globally accessible remote file selection if a file is single clicked in the RemoteFileTable
-	 *
-	 */
-	
-	private void updateRemoteFileTableSelection() {
-		
-		selectedTable = "remote";
-		localFileTable.setBackground(new Color(238, 238, 238));
-		remoteFileTable.setBackground(new Color(255, 255, 255));
-	}
-
-	/**
-	 * Updates the globally accessible local file selection
-	 * if a file is single clicked in the LocalFileTable 
-	 *
-	 */
-	
-	private void updateLocalFileTableSelection() {
-		
-		selectedTable="local";
-		remoteFileTable.setBackground(new Color(238, 238, 238));
-		localFileTable.setBackground(new Color(255, 255, 255));
-	}
-	
-	/**
-	 * Updates the Remote File Table based on selection.  Called from mouseClicked handler
-	 */
-	
-	public void updateRemoteFileTable() {
-
-		String name = null;
-		String drive = null;
-		name = (remoteFileTable.getSelectedValue().toString()).substring(1);
-
-		if (name.equals("[..]")) {
-			drive = remoteLocation.getText().substring(0, remoteLocation.getText().length() - 1);
-			// JOptionPane.showMessageDialog(null, (String)drive, "FileTransfer ", JOptionPane.INFORMATION_MESSAGE);
-			int index = drive.lastIndexOf("\\");
-			drive = drive.substring(0, index + 1);
-
-			remoteLocation.setText(drive);
-			viewer.rfb.readServerDirectory(drive);
-			remoteList.clear();
-			remoteFileTable.setListData(remoteList);
-		}
-		else if (!name.substring(0, 2).equals(" [") && !name.substring((name.length() - 1), name.length()).equals("]")) {
-
-			drive = remoteLocation.getText();
-		}
-		else {
-			name = name.substring(1, name.length() - 1);
-			drive = remoteLocation.getText() + name + "\\";
-			remoteLocation.setText(drive);
-			viewer.rfb.readServerDirectory(drive);
-			remoteList.clear();
-			remoteFileTable.setListData(remoteList);
-		}	
-		//remoteLocation.setText(drive);	
-	}
-	/**
-	 * Updates the Local File Table based on selection. Called from MouseClicked handler
-	 */
-
-	private void updateLocalFileTable()
-	{
-		localStatus.setText("");
-		File currentSelection = new File(currentLocalDirectory , getTrimmedSelection());		// Selection
-
-		if (getTrimmedSelection().equals(".."))
-		{ // The [..] selected
-			currentSelection = currentLocalDirectory.getParentFile();
-			if(currentSelection != null)
-			{
-				changeLocalDirectory(currentSelection);
-			}
-			else
-			{
-				localStatus.setText("You are at the root !"); 
-			}
-		}
-		
-		else if (currentSelection.isDirectory())
-		{
-			changeLocalDirectory(currentSelection);
-		}
-	}
-
-	/*
-	 * Trims off the [] of a directory entry if it exists, else ignores it
-	 * 
-	 */
-	private String getTrimmedSelection(){
-		String currentSelection = (localFileTable.getSelectedValue().toString()).substring(1);
-				if(currentSelection.substring(0,1).equals("[") &&
-				currentSelection.substring(currentSelection.length()-1,currentSelection.length()).equals("]")){
-				return currentSelection.substring(1,currentSelection.length()-1);
-				} else {
-					return currentSelection;
-				}
-	}
-
-	/*
-	 *  Reads the localDriveComboBox and returns the first readable drive for populating
-	 *  the file table on load, so it's not looking at the A:\ drive when it opens. 
-	 */
-	 public File getFirstReadableLocalDrive(){
-		File currentDrive;
-		// sf@ - Select C: as default first readable drive
-		for(int i = 0; i < localDrivesComboBox.getItemCount() ; i++)
-		{
-			currentDrive = new File(localDrivesComboBox.getItemAt(i).toString());
-			if(localDrivesComboBox.getItemAt(i).toString().substring(0,1).toUpperCase().equals("C") && currentDrive.canRead())
-			{
-				localDrivesComboBox.setSelectedIndex(i);
-				return currentDrive;
-			}
-		}
-		// if C: not available, take the first readable drive, this time.
-		for(int i = 0; i < localDrivesComboBox.getItemCount() ; i++)
-		{
-			currentDrive = new File(localDrivesComboBox.getItemAt(i).toString());
-			if(currentDrive.canRead())
-			{
-				localDrivesComboBox.setSelectedIndex(i);
-				return currentDrive;
-			}
-		}
-		
-		localStatus.setText("ERROR!: No Local Drives are Readable"); 
-	 	return null;
-	}
-
-		/*
-		 * Navigates the local file structure up or down one directory
-		 */
-
-		public void changeLocalDirectory(File dir)
-		{
-				currentLocalDirectory = dir;	// Updates Global
-				String[] contents = dir.list();
-
-				localList.clear();
-				localList.addElement(" [..]");
-
-				// sort content list
-				Arrays.sort(contents);
-
-				// Populate the Lists
-				for (int i = 0; i < contents.length; i++)
-				{
-					if (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + contents[i]).isDirectory()) {
-						// localList.addElement("[" + contents[i] + "]");
-						localDirList.add(" [" + contents[i] + "]"); // sf at 2004
-						//System.out.println(contents[i] + " is a directory");
-					}
-					else
-					{
-						// localList.addElement(contents[i]);
-						localFileList.add(" " + contents[i]); // sf at 2004
-						//System.out.println(contents[i] + " is a file");
-					}
-				}
-
-				// sf at 2007 - Sort the lists, using a good string comparator
-				Collections.sort(localDirList, new StrComp());
-				Collections.sort(localFileList, new StrComp());
-
-				// sf at 2004
-				for (int i = 0; i < localDirList.size(); i++)
-					localList.addElement(localDirList.get(i));
-				for (int i = 0; i < localFileList.size(); i++)
-					localList.addElement(localFileList.get(i));
-
-				localFileList.clear();
-				localDirList.clear();
-
-				localFileTable.setListData(localList);
-				if(dir.toString().charAt(dir.toString().length()-1)==(File.separatorChar))
-				{
-					localLocation.setText(dir.toString());
-				}
-				else
-				{
-					localLocation.setText(dir.toString()+File.separator);	// Display updated location above file table
-				}
-				localStatus.setText("Total Files / Folders: " + (localList.size()-1));
-				//if(DEBUG) System.out.println("leaving changeRemoteDrive() / FTPFrame...");
-		}
-
-
-	
-	//************************************************************************//
-	//								INIT									  //
-	//************************************************************************//
-	
-	/**
-	 * This method initializes the whole frame
-	 * 
-	 * @return void
-	 */
-		
-	private void initialize() {
-		
-		this.setResizable(false);
-		this.setSize(794, 500);
-		this.setContentPane(getJContentPane());
-		localDirList = new ArrayList();
-		localFileList = new ArrayList();
-		updateDriveList = true;
-		}
-
-	//////////////////////////////////////////////
-	/*				INIT PANELS					*/
-	//////////////////////////////////////////////
-	
-	/**
-	 * This method initializes jContentPane.  This is the main content pane
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getJContentPane() {
-		if (jContentPane == null) {
-			jContentPane = new javax.swing.JPanel();
-			jContentPane.setLayout(new java.awt.BorderLayout());
-			jContentPane.add(getTopPanel(), java.awt.BorderLayout.NORTH);
-			jContentPane.add(getStatusPanel(), java.awt.BorderLayout.SOUTH);
-			jContentPane.add(getRemotePanel(), java.awt.BorderLayout.EAST);			
-			jContentPane.add(getLocalPanel(), java.awt.BorderLayout.WEST);
-			jContentPane.add(getButtonPanel(), java.awt.BorderLayout.CENTER);
-			
-			// Fix : troessner - Long path causing unusable window bug
-			localPanel.setMaximumSize(new Dimension(325,398));
-			localPanel.setMinimumSize(new Dimension(325,398));
-			localPanel.setPreferredSize(new Dimension(325,398));
-			
-			remotePanel.setMaximumSize(new Dimension(325,398));
-			remotePanel.setMinimumSize(new Dimension(325,398));
-			remotePanel.setPreferredSize(new Dimension(325,398));
-
-		}
-		return jContentPane;
-	}
-	/**
-	 * This method initializes topPanel
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getTopPanelLocal() {
-		if (topPanelLocal == null) {
-			topPanelLocal = new javax.swing.JPanel();
-			topPanelLocal.setLayout(new java.awt.BorderLayout());
-			topPanelLocal.setPreferredSize(new java.awt.Dimension(325, 22));
-			topPanelLocal.add(getLocalDrivesComboBox(), java.awt.BorderLayout.WEST);
-			topPanelLocal.add(getLocalMachineLabel(), java.awt.BorderLayout.CENTER);
-			topPanelLocal.add(getLocalTopButton(), java.awt.BorderLayout.EAST);
-			topPanelLocal.setBackground(java.awt.Color.lightGray);
-		}
-		return topPanelLocal;
-	}
-	
-	/**
-	 * This method initializes topPanelRemote
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getTopPanelRemote() {
-		if (topPanelRemote == null) {
-			topPanelRemote = new javax.swing.JPanel();
-			topPanelRemote.setLayout(new java.awt.BorderLayout());
-			topPanelRemote.setPreferredSize(new java.awt.Dimension(325, 20));
-			topPanelRemote.add(getRemoteDrivesComboBox(), java.awt.BorderLayout.WEST);
-			topPanelRemote.add(getRemoteMachineLabel(), java.awt.BorderLayout.CENTER);
-			topPanelRemote.add(getRemoteTopButton(), java.awt.BorderLayout.EAST);
-			topPanelRemote.setBackground(java.awt.Color.lightGray);
-		}
-		return topPanelRemote;
-	}
-
-	
-	/**
-	 * This method initializes topPanel
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	
-	private javax.swing.JPanel getTopPanel() {
-		if (topPanel == null) {
-			topPanel = new javax.swing.JPanel();
-			topPanel.setLayout(new java.awt.BorderLayout());
-			//sf at 2004 - We manage 2 top panels
-			topPanel.add(getTopPanelLocal(), java.awt.BorderLayout.WEST);
-			// topPanel.add(getTopPanelCenter(), java.awt.BorderLayout.CENTER);
-			topPanel.add(getTopPanelRemote(), java.awt.BorderLayout.EAST);
-
-		}
-		return topPanel;
-	}
-
-	/**
-	 * This method initializes statusPanel
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getStatusPanel() {
-		if (statusPanel == null) {
-			statusPanel = new javax.swing.JPanel();
-			statusPanel.setLayout(
-				new javax.swing.BoxLayout(
-					statusPanel,
-					javax.swing.BoxLayout.Y_AXIS));
-			statusPanel.add(getHistoryComboBox(), null);
-			statusPanel.add(getJProgressBar(), null);
-			statusPanel.add(getConnectionStatus(), null);
-			statusPanel.setBackground(java.awt.Color.lightGray);
-
-		}
-		return statusPanel;
-	}
-	/**
-	 * This method initializes remotePanel
-	 *
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getRemotePanel() {
-		if (remotePanel == null) // Fix: troessner
-                {
-			remotePanel = new javax.swing.JPanel();
-			remotePanel.setLayout(
-				new javax.swing.BoxLayout(
-					remotePanel,
-					javax.swing.BoxLayout.Y_AXIS));
-			remotePanel.add(getRemoteLocation(), null);
-			remotePanel.add(getRemoteScrollPane(), null);
-			remotePanel.add(getRemoteStatus(), null);
-			remotePanel.setBackground(java.awt.Color.lightGray);
-		}
-
-		/*
-		 * EDIT troessner end
-		 */
-		return remotePanel;
-	}
-	/**
-	 * This method initializes localPanel
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getLocalPanel() {
-		if (localPanel == null) {
-			localPanel = new javax.swing.JPanel();
-			localPanel.setLayout(
-				new javax.swing.BoxLayout(
-					localPanel,
-					javax.swing.BoxLayout.Y_AXIS));
-			localPanel.add(getLocalLocation(), null);
-			localPanel.add(getLocalScrollPane(), null);
-			localPanel.add(getLocalStatus(), null);
-			localPanel.setBackground(java.awt.Color.lightGray);
-			localPanel.setComponentOrientation(
-				java.awt.ComponentOrientation.UNKNOWN);
-			localPanel.setName("localPanel");
-			Dimension dim = localPanel.getSize();
-
-		}
-		return localPanel;
-	}
-	/**
-	 * This method initializes buttonPanel
-	 * 
-	 * @return javax.swing.JPanel
-	 */
-	private javax.swing.JPanel getButtonPanel()
-	{
-		if (buttonPanel == null)
-		{
-			buttonPanel = new javax.swing.JPanel();
-			buttonPanel.setLayout(null);
-			buttonPanel.add(getReceiveButton(), null);
-			buttonPanel.add(getNewFolderButton(), null);
-			buttonPanel.add(getCloseButton(), null);
-			buttonPanel.add(getDeleteButton(), null);
-			buttonPanel.add(getSendButton(), null);
-			buttonPanel.add(getStopButton(), null);
-			buttonPanel.setBackground(java.awt.Color.lightGray);
-		}
-		return buttonPanel;
-	}
-	
-	/*				INIT BUTTONS					*/
-	
-	/**
-	 * This method initializes sendButton
-	 * 
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getSendButton() {
-		if (sendButton == null) {
-			sendButton = new javax.swing.JButton();
-			sendButton.setBounds(20, 30, 97, 25);
-			sendButton.setText("Send >>");
-			sendButton.setName("sendButton");
-			sendButton.addActionListener(this);
-
-		}
-		return sendButton;
-	}
-	/**
-	 * This method initializes receiveButton
-	 * 
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getReceiveButton() {
-		if (receiveButton == null) {
-			receiveButton = new javax.swing.JButton();
-			receiveButton.setBounds(20, 60, 97, 25);
-			receiveButton.setText("<< Receive");
-			receiveButton.setName("receiveButton");
-			receiveButton.addActionListener(this);
-		}
-		return receiveButton;
-	}
-	/**
-	 * This method initializes deleteButton
-	 * 
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getDeleteButton() {
-		if (deleteButton == null) {
-			deleteButton = new javax.swing.JButton();
-			deleteButton.setBounds(20, 110, 97, 25);
-			deleteButton.setText("Delete File");
-			deleteButton.setName("deleteButton");
-			deleteButton.addActionListener(this);
-		}
-		return deleteButton;
-	}
-	/**
-	 * This method initializes newFolderButton
-	 * 
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getNewFolderButton() {
-		if (newFolderButton == null) {
-			newFolderButton = new javax.swing.JButton();
-			newFolderButton.setBounds(20, 140, 97, 25);
-			newFolderButton.setText("New Folder");
-			newFolderButton.setName("newFolderButton");
-			newFolderButton.addActionListener(this);
-		}
-		return newFolderButton;
-	}
-	
-	/**
-	 * This method initializes stopButton
-	 * 
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getStopButton()
-	{
-		if (stopButton == null)
-		{
-			stopButton = new javax.swing.JButton();
-			stopButton.setBounds(20, 200, 97, 25);
-			stopButton.setText("Stop");
-			stopButton.setName("stopButton");
-			stopButton.addActionListener(this);
-			stopButton.setVisible(false);
-		}
-		return stopButton;
-	}
-	
-	/**
-	 * This method initializes closeButton
-	 *
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getCloseButton() {
-		if (closeButton == null) {
-			closeButton = new javax.swing.JButton();
-			closeButton.setBounds(20, 325, 97, 25);
-			closeButton.setText("Close");
-			closeButton.setName("closeButton");
-			closeButton.addActionListener(this);
-		}
-		return closeButton;
-	}
-
-	/**
-	 * This method initializes localDrivesComboBox
-	 * 
-	 * @return javax.swing.JComboBox
-	 */
-	private javax.swing.JComboBox getLocalDrivesComboBox() {
-		updateDriveList = true;
-		// Read in Drive letters from local disk
-		File[] roots = File.listRoots();
-		String[] localDisks = new String[roots.length];
-		for (int i = 0; i < roots.length; i++) {
-			localDisks[i] = roots[i].toString();
-		}
-
-		// Create the combo box
-		if (localDrivesComboBox == null) {
-			localDrivesComboBox = new javax.swing.JComboBox(localDisks);
-			localDrivesComboBox.setName("LocalDisks");
-			localDrivesComboBox.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-
-			//Select the second entry (e.g. C:\)
-			// localDrivesComboBox.setSelectedIndex(1);
-			localDrivesComboBox.addActionListener(this);
-		}
-		updateDriveList = false;
-		return localDrivesComboBox;
-	}
-	/**
-	 * This method initializes remoteDrivesComboBox
-	 * 
-	 * @return javax.swing.JComboBox
-	 */
-	private javax.swing.JComboBox getRemoteDrivesComboBox() {
-		if (remoteDrivesComboBox == null) {
-			remoteDrivesComboBox = new javax.swing.JComboBox();
-			remoteDrivesComboBox.setName("remoteDisks");
-			remoteDrivesComboBox.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-			remoteDrivesComboBox.addActionListener(this);
-
-		}
-		return remoteDrivesComboBox;
-	}
-	/**
-	 * This method initializes localMachineLabel
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getLocalMachineLabel() {
-		if (localMachineLabel == null) {
-			localMachineLabel = new javax.swing.JTextField();
-			localMachineLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
-			// localMachineLabel.setPreferredSize(new java.awt.Dimension(150, 19));
-			localMachineLabel.setBackground(java.awt.Color.lightGray);
-			localMachineLabel.setText("             LOCAL MACHINE");
-			localMachineLabel.setName("localLocation");
-			localMachineLabel.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.BOLD, 11));
-			localMachineLabel.setEditable(false);
-		}
-		return localMachineLabel;
-	}
-	/**
-	 * This method initializes remoteMachineLabel
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getRemoteMachineLabel() {
-		if (remoteMachineLabel == null) {
-			remoteMachineLabel = new javax.swing.JTextField();
-			// remoteMachineLabel.setPreferredSize(new java.awt.Dimension(150, 19));
-			remoteMachineLabel.setName("remoteLocation");
-			remoteMachineLabel.setText("        REMOTE MACHINE");
-			remoteMachineLabel.setBackground(java.awt.Color.lightGray);
-			remoteMachineLabel.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.BOLD, 11));
-			remoteMachineLabel.setEditable(false);
-				
-		}
-		return remoteMachineLabel;
-	}
-	/**
-	 * This method initializes localTopButton
-	 * 
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getLocalTopButton() {
-		if (localTopButton == null) {
-			localTopButton = new javax.swing.JButton();
-			localTopButton.setText("Root (\\)");
-			// localTopButton.setPreferredSize(new java.awt.Dimension(30, 19));
-			localTopButton.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
-			localTopButton.addActionListener(this);
-		}
-		return localTopButton;
-	}
-	/**
-	 * This method initializes remoteTopButton
-	 *
-	 * @return javax.swing.JButton
-	 */
-	private javax.swing.JButton getRemoteTopButton() {
-		if (remoteTopButton == null) {
-			remoteTopButton = new javax.swing.JButton();
-			remoteTopButton.setText("Root (\\)");
-			// remoteTopButton.setPreferredSize(new java.awt.Dimension(49, 25));
-			remoteTopButton.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
-			remoteTopButton.addActionListener(this);
-		}
-		return remoteTopButton;
-	}
-	/**
-	 * This method initializes localFileTable
-	 * 
-	 * @return javax.swing.JTable
-	 */
-
-	private javax.swing.JList getLocalFileTable() {
-		if (localFileTable == null) {
-			localList = new Vector(0);
-			localFileTable = new JList(localList);
-			localFileTable.addMouseListener(this);
-			localFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		}
-		return localFileTable;
-	}
-	/**
-	 * This method initializes localScrollPane
-	 * 
-	 * @return javax.swing.JScrollPane
-	 */
-	private javax.swing.JScrollPane getLocalScrollPane() {
-		if (localScrollPane == null) {
-			localScrollPane = new javax.swing.JScrollPane();
-			localScrollPane.setViewportView(getLocalFileTable());
-			localScrollPane.setPreferredSize(new java.awt.Dimension(325, 418));
-			localScrollPane.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-			localScrollPane.setName("localFileList");
-		}
-		return localScrollPane;
-	}
-	/**
-	 * This method initializes remoteFileTable
-	 * 
-	 * @return javax.swing.JTable
-	 */
-	private javax.swing.JList getRemoteFileTable() {
-		if (remoteFileTable == null) {
-			remoteList = new Vector(0);
-			remoteFileTable = new JList(remoteList);
-			remoteFileTable.addMouseListener(this);
-			remoteFileTable.setSelectedValue("C:\\", false);
-			remoteFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
-		}
-		return remoteFileTable;
-	}
-	/**
-	 * This method initializes remoteScrollPane
-	 * 
-	 * @return javax.swing.JScrollPane
-	 */
-	private javax.swing.JScrollPane getRemoteScrollPane() {
-		if (remoteScrollPane == null) {
-			remoteScrollPane = new javax.swing.JScrollPane();
-			remoteScrollPane.setViewportView(getRemoteFileTable());
-			remoteScrollPane.setPreferredSize(new java.awt.Dimension(325, 418));
-		}
-		return remoteScrollPane;
-	}
-	/**
-	 * This method initializes remoteLocation
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getRemoteLocation()
-	{
-		if (remoteLocation == null)
-		{
-			remoteLocation = new javax.swing.JTextField();
-			remoteLocation.setText("");
-			remoteLocation.setEditable(false); // sf at 2004
-			remoteLocation.setBackground(new Color(255,255,238));
-			remoteLocation.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-		}
-		return remoteLocation;
-	}
-	/**
-	 * This method initializes localLocation
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getLocalLocation() {
-		if (localLocation == null) {
-			localLocation = new javax.swing.JTextField();
-			localLocation.setText("");
-			localLocation.setEditable(false); // sf at 2004
-			localLocation.setBackground( new Color(255,255,238));
-			localLocation.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-		}
-		return localLocation;
-	}
-	/**
-	 * This method initializes localStatus
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getLocalStatus() {
-		if (localStatus == null) {
-			localStatus = new javax.swing.JTextField();
-			//		localStatus.setText("> Found 63 File(s) 7 Directorie(s)");
-			localStatus.setBackground(java.awt.Color.lightGray);
-			localStatus.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-			localStatus.setEditable(false);
-		}
-		return localStatus;
-	}
-	/**
-	 * This method initializes remoteStatus
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getRemoteStatus() {
-		if (remoteStatus == null) {
-			remoteStatus = new javax.swing.JTextField();
-			//		remoteStatus.setText("> Found 15 File(s) 2 Directorie(s)");
-			remoteStatus.setBackground(java.awt.Color.lightGray);
-			remoteStatus.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-			remoteStatus.setEditable(false);
-		}
-		return remoteStatus;
-	}
-	/**
-	 * This method initializes historyComboBox
-	 * 
-	 * @return javax.swing.JComboBox
-	 */
-	private javax.swing.JComboBox getHistoryComboBox() {
-		if (historyComboBox == null) {
-			historyComboBox = new javax.swing.JComboBox();
-			historyComboBox.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
-			historyComboBox.insertItemAt(new String("Pulldown to view history ..."),0);
-			historyComboBox.setSelectedIndex(0);
-			historyComboBox.addActionListener(this);
-		}
-		return historyComboBox;
-	}
-	/**
-	 * This method initializes jProgressBar
-	 * 
-	 * @return javax.swing.JProgressBar
-	 */
-	private javax.swing.JProgressBar getJProgressBar() {
-		if (jProgressBar == null) {
-			jProgressBar = new javax.swing.JProgressBar();
-		}
-		return jProgressBar;
-	}
-	/**
-	 * This method initializes connectionStatus
-	 * 
-	 * @return javax.swing.JTextField
-	 */
-	private javax.swing.JTextField getConnectionStatus() {
-		if (connectionStatus == null) {
-			connectionStatus = new javax.swing.JTextField();
-			connectionStatus.setText("Connected...");
-			connectionStatus.setBackground(java.awt.Color.lightGray);
-			connectionStatus.setFont(
-				new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
-		}
-			connectionStatus.setEditable(false);
-		return connectionStatus;
-	}
-
-
-
-}
diff --git a/ica/JavaViewer/LICENCE.TXT b/ica/JavaViewer/LICENCE.TXT
deleted file mode 100644
index 71e95a1..0000000
--- a/ica/JavaViewer/LICENCE.TXT
+++ /dev/null
@@ -1,340 +0,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
-	  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-	 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-

-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-

-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-

-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-

-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-

-	Appendix: How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 19yy  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-    USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) 19yy name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/ica/JavaViewer/MANIFEST.MF b/ica/JavaViewer/MANIFEST.MF
deleted file mode 100644
index 4e87fdf..0000000
--- a/ica/JavaViewer/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: VncViewer
-
diff --git a/ica/JavaViewer/OptionsFrame.java b/ica/JavaViewer/OptionsFrame.java
deleted file mode 100644
index d7c41eb..0000000
--- a/ica/JavaViewer/OptionsFrame.java
+++ /dev/null
@@ -1,398 +0,0 @@
-//
-//  Copyright (C) 2001 HorizonLive.com, Inc.  All Rights Reserved.
-//  Copyright (C) 2001 Constantin Kaplinsky.  All Rights Reserved.
-//  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// Options frame.
-//
-// This deals with all the options the user can play with.
-// It sets the encodings array and some booleans.
-//
-
-import java.awt.*;
-import java.awt.event.*;
-
-class OptionsFrame extends Frame
-  implements WindowListener, ActionListener, ItemListener {
-
-  static String[] names = {
-    "Encoding",
-    "Compression level",
-    "JPEG image quality",
-    "Cursor shape updates",
-    "Use CopyRect",
-    "Restricted colors",
-    "Mouse buttons 2 and 3",
-    "View only",
-    "Share desktop",
-  };
-
-  static String[][] values = {
-  	    { "Raw", "RRE", "CoRRE", "Hextile", "Zlib", "Tight" },
-  	    { "Default", "1", "2", "3", "4", "5", "6", "7", "8", "9" },
-  	    { "JPEG off", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" },
-  	    { "Enable", "Ignore", "Disable" },
-  	    { "Yes", "No" },
-  	    { "Full", "256", "64", "8", "4 (Grey)", "2 (B&W)" },
-  	    { "Normal", "Reversed" },
-  	    { "Yes", "No" },
-  	    { "Yes", "No" },
-  	  };
-  
-  final int
-    encodingIndex	 = 0,
-    compressLevelIndex	 = 1,
-    jpegQualityIndex	 = 2,
-    cursorUpdatesIndex	 = 3,
-    useCopyRectIndex	 = 4,
-    eightBitColorsIndex  = 5,
-    mouseButtonIndex	 = 6,
-    viewOnlyIndex	 = 7,
-    shareDesktopIndex	 = 8;
-
-  Label[] labels = new Label[names.length];
-  Choice[] choices = new Choice[names.length];
-  Button closeButton;
-  VncViewer viewer;
-
-
-  //
-  // The actual data which other classes look at:
-  //
-
-  int[] encodings = new int[20];
-  int nEncodings;
-
-  int compressLevel;
-  int jpegQuality;
-
-  int eightBitColors; // sf at 2005
-  int oldEightBitColors;
-
-  boolean requestCursorUpdates;
-  boolean ignoreCursorUpdates;
-
-  boolean reverseMouseButtons2And3;
-  boolean shareDesktop;
-  boolean viewOnly;
-
-  //
-  // Constructor.  Set up the labels and choices from the names and values
-  // arrays.
-  //
-
-  OptionsFrame(VncViewer v) {
-    super("Ultr at VNC Options");
-
-    viewer = v;
-
-    GridBagLayout gridbag = new GridBagLayout();
-    setLayout(gridbag);
-
-    GridBagConstraints gbc = new GridBagConstraints();
-    gbc.fill = GridBagConstraints.BOTH;
-
-    for (int i = 0; i < names.length; i++) {
-      labels[i] = new Label(names[i]);
-      gbc.gridwidth = 1;
-      gridbag.setConstraints(labels[i],gbc);
-      add(labels[i]);
-
-      choices[i] = new Choice();
-      gbc.gridwidth = GridBagConstraints.REMAINDER;
-      gridbag.setConstraints(choices[i],gbc);
-      add(choices[i]);
-      choices[i].addItemListener(this);
-
-      for (int j = 0; j < values[i].length; j++) {
-	choices[i].addItem(values[i][j]);
-      }
-    }
-
-    closeButton = new Button("Close");
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gridbag.setConstraints(closeButton, gbc);
-    add(closeButton);
-    closeButton.addActionListener(this);
-
-    pack();
-
-    addWindowListener(this);
-
-    // Set up defaults
-
-    choices[encodingIndex].select("Tight");
-    choices[compressLevelIndex].select("Default");
-    choices[jpegQualityIndex].select("9");
-    choices[cursorUpdatesIndex].select("Enable");
-    choices[useCopyRectIndex].select("Yes");
-    choices[eightBitColorsIndex].select("Full");
-    choices[mouseButtonIndex].select("Normal");
-    choices[viewOnlyIndex].select("No");
-    choices[shareDesktopIndex].select("Yes");
-
-    // But let them be overridden by parameters
-
-    for (int i = 0; i < names.length; i++) {
-      String s = viewer.readParameter(names[i], false);
-      if (s != null) {
-	for (int j = 0; j < values[i].length; j++) {
-	  if (s.equalsIgnoreCase(values[i][j])) {
-	    choices[i].select(j);
-	  }
-	}
-      }
-    }
-
-    // Make the booleans and encodings array correspond to the state of the GUI
-
-    setEncodings();
-    setColorFormat();
-    setOtherOptions();
-  }
-
-
-  //
-  // Disable the shareDesktop option
-  //
-
-  void disableShareDesktop() {
-    labels[shareDesktopIndex].setEnabled(false);
-    choices[shareDesktopIndex].setEnabled(false);
-  }
-
-
-  //
-  // setEncodings looks at the encoding, compression level, JPEG
-  // quality level, cursor shape updates and copyRect choices and sets
-  // the encodings array appropriately. It also calls the VncViewer's
-  // setEncodings method to send a message to the RFB server if
-  // necessary.
-  //
-
-  void setEncodings() {
-    nEncodings = 0;
-    if (choices[useCopyRectIndex].getSelectedItem().equals("Yes")) {
-      encodings[nEncodings++] = RfbProto.EncodingCopyRect;
-    }
-
-    int preferredEncoding = RfbProto.EncodingRaw;
-    boolean enableCompressLevel = false;
-
-    if (choices[encodingIndex].getSelectedItem().equals("RRE")) {
-      preferredEncoding = RfbProto.EncodingRRE;
-    } else if (choices[encodingIndex].getSelectedItem().equals("CoRRE")) {
-      preferredEncoding = RfbProto.EncodingCoRRE;
-    } else if (choices[encodingIndex].getSelectedItem().equals("Hextile")) {
-      preferredEncoding = RfbProto.EncodingHextile;
-    } else if (choices[encodingIndex].getSelectedItem().equals("Zlib")) {
-      preferredEncoding = RfbProto.EncodingZlib;
-      enableCompressLevel = true;
-    } else if (choices[encodingIndex].getSelectedItem().equals("Tight")) {
-      preferredEncoding = RfbProto.EncodingTight;
-      enableCompressLevel = true;
-    }
-
-    encodings[nEncodings++] = preferredEncoding;
-    if (preferredEncoding != RfbProto.EncodingHextile) {
-      encodings[nEncodings++] = RfbProto.EncodingHextile;
-    }
-    if (preferredEncoding != RfbProto.EncodingTight) {
-      encodings[nEncodings++] = RfbProto.EncodingTight;
-    }
-    if (preferredEncoding != RfbProto.EncodingZlib) {
-      encodings[nEncodings++] = RfbProto.EncodingZlib;
-    }
-    if (preferredEncoding != RfbProto.EncodingCoRRE) {
-      encodings[nEncodings++] = RfbProto.EncodingCoRRE;
-    }
-    if (preferredEncoding != RfbProto.EncodingRRE) {
-      encodings[nEncodings++] = RfbProto.EncodingRRE;
-    }
-
-    // Handle compression level setting.
-
-    if (enableCompressLevel) {
-      labels[compressLevelIndex].setEnabled(true);
-      choices[compressLevelIndex].setEnabled(true);
-      try {
-	compressLevel =
-	  Integer.parseInt(choices[compressLevelIndex].getSelectedItem());
-      }
-      catch (NumberFormatException e) {
-	compressLevel = -1;
-      }
-      if (compressLevel >= 1 && compressLevel <= 9) {
-	encodings[nEncodings++] =
-	  RfbProto.EncodingCompressLevel0 + compressLevel;
-      } else {
-	compressLevel = -1;
-      }
-    } else {
-      labels[compressLevelIndex].setEnabled(false);
-      choices[compressLevelIndex].setEnabled(false);
-    }
-
-    // Handle JPEG quality setting.
-
-    if (preferredEncoding == RfbProto.EncodingTight && (eightBitColors == 0)) {
-      labels[jpegQualityIndex].setEnabled(true);
-      choices[jpegQualityIndex].setEnabled(true);
-      try {
-	jpegQuality =
-	  Integer.parseInt(choices[jpegQualityIndex].getSelectedItem());
-      }
-      catch (NumberFormatException e) {
-	jpegQuality = -1;
-      }
-      if (jpegQuality >= 0 && jpegQuality <= 9) {
-	encodings[nEncodings++] =
-	  RfbProto.EncodingQualityLevel0 + jpegQuality;
-      } else {
-	jpegQuality = -1;
-      }
-    } else {
-      labels[jpegQualityIndex].setEnabled(false);
-      choices[jpegQualityIndex].setEnabled(false);
-    }
-
-    // Request cursor shape updates if necessary.
-
-    requestCursorUpdates =
-      !choices[cursorUpdatesIndex].getSelectedItem().equals("Disable");
-
-    if (requestCursorUpdates) {
-      encodings[nEncodings++] = RfbProto.EncodingXCursor;
-      encodings[nEncodings++] = RfbProto.EncodingRichCursor;
-      ignoreCursorUpdates =
-	choices[cursorUpdatesIndex].getSelectedItem().equals("Ignore");
-	  // marscha - PointerPos
-	  if (!ignoreCursorUpdates) {
-		encodings[nEncodings++] = RfbProto.EncodingPointerPos;
-	  }
-    }
-
-    encodings[nEncodings++] = RfbProto.EncodingLastRect;
-    encodings[nEncodings++] = RfbProto.EncodingNewFBSize;
-
-    viewer.setEncodings();
-  }
-
-  //
-  // setColorFormat sets eightBitColors variable depending on the GUI
-  // setting, causing switches between 8-bit and 24-bit colors mode if
-  // necessary.
-  //
-
-  void setColorFormat() {
-
-  	// sf at 2005 - Adding more color modes
-  	if (choices[eightBitColorsIndex].getSelectedItem().equals("Full"))
-  		eightBitColors = 0;
-  	else if (choices[eightBitColorsIndex].getSelectedItem().equals("256"))
-  			eightBitColors = 1;
-  	else if (choices[eightBitColorsIndex].getSelectedItem().equals("64"))
-  			eightBitColors = 2;
-  	else if (choices[eightBitColorsIndex].getSelectedItem().equals("8"))
-  			eightBitColors = 3;
-  	else if (choices[eightBitColorsIndex].getSelectedItem().equals("4 (Grey)"))
-  			eightBitColors = 4;
-  	else if (choices[eightBitColorsIndex].getSelectedItem().equals("2 (B&W)"))
-  			eightBitColors = 5;
-  	  
-    boolean enableJPEG = (eightBitColors == 0) &&
-      choices[encodingIndex].getSelectedItem().equals("Tight");
-
-    labels[jpegQualityIndex].setEnabled(enableJPEG);
-    choices[jpegQualityIndex].setEnabled(enableJPEG);
-  }
-
-  //
-  // setOtherOptions looks at the "other" choices (ones which don't set the
-  // encoding or the color format) and sets the boolean flags appropriately.
-  //
-
-  void setOtherOptions() {
-
-    reverseMouseButtons2And3
-      = choices[mouseButtonIndex].getSelectedItem().equals("Reversed");
-
-    viewOnly 
-      = choices[viewOnlyIndex].getSelectedItem().equals("Yes");
-    if (viewer.vc != null)
-      viewer.vc.enableInput(!viewOnly);
-
-    shareDesktop
-      = choices[shareDesktopIndex].getSelectedItem().equals("Yes");
-  }
-
-
-  //
-  // Respond to actions on Choice controls
-  //
-
-  public void itemStateChanged(ItemEvent evt) {
-    Object source = evt.getSource();
-
-    if (source == choices[encodingIndex] ||
-	source == choices[compressLevelIndex] ||
-	source == choices[jpegQualityIndex] ||
-	source == choices[cursorUpdatesIndex] ||
-	source == choices[useCopyRectIndex]) {
-
-      setEncodings();
-
-    } else if (source == choices[eightBitColorsIndex]) {
-
-      setColorFormat();
-
-    } else if (source == choices[mouseButtonIndex] ||
-	       source == choices[shareDesktopIndex] ||
-	       source == choices[viewOnlyIndex]) {
-
-      setOtherOptions();
-    }
-  }
-
-  //
-  // Respond to button press
-  //
-
-  public void actionPerformed(ActionEvent evt) {
-    if (evt.getSource() == closeButton)
-      setVisible(false);
-  }
-
-  //
-  // Respond to window events
-  //
-
-  public void windowClosing(WindowEvent evt) {
-    setVisible(false);
-  }
-
-  public void windowActivated(WindowEvent evt) {}
-  public void windowDeactivated(WindowEvent evt) {}
-  public void windowOpened(WindowEvent evt) {}
-  public void windowClosed(WindowEvent evt) {}
-  public void windowIconified(WindowEvent evt) {}
-  public void windowDeiconified(WindowEvent evt) {}
-}
diff --git a/ica/JavaViewer/README b/ica/JavaViewer/README
deleted file mode 100644
index b6ab1d7..0000000
--- a/ica/JavaViewer/README
+++ /dev/null
@@ -1,444 +0,0 @@
-
-Ultr at VNC 1.0.0 RC19 Java Viewer
-===================================
-
-Copyright (C) 2002-2005 Ultr at VNC Team.  All Rights Reserved.
-Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
-Copyright (C) 2004 Alban Chazot.  All Rights Reserved.
-Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
-Copyright (C) 2001,2002 Constantin Kaplinsky.  All Rights Reserved.
-Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-
-This software is distributed under the GNU General Public Licence as
-published by the Free Software Foundation. See the file LICENCE.TXT for the
-conditions under which this software is made available. VNC also contains
-code from other sources. See the Acknowledgements section below, and the
-individual files for details of the conditions under which they are made
-available.
-
-****************************************************************************
-
-
-
-This JavaViewer supports Ultr at VNC FileTransfer ( >= RC19 protocole version)
-as well as Ultr at VNC MS Logon.
-
-So even from a Unix or Mac machine you can use a simple Web browser and do
-some FileTransfer with the UltraVNC Win32 Server, as well as taking advantage
-of the more secure MSLogon authentication method.
-
-When loaded in the WebBrowser (browsing http://YourUltraServerIP:5800), the
-user is prompted to accept or reject the Ultr at VNC JavaViewer applet signed
-certificate. It is necessary as this new JavaViewer does some FileTransfer
-and consequently needs to access the user's local drives.
-
-WARNING: This JavaViewer Applet can't be loaded using the default MS IE JVM
-as it doesn't support Swing. You must install a Java JVM (v1.3 or >).
-
-What still needs to be implemented as soon as possible (that is already in
-the Win32 Viewer):
-
-   - Add files datetime and size in the files lists
-   - Add files multi-selection for transfer
-   - Add a "Parent Directory" button the the files panels.
-   - Directory transfer
-   - Delta transfer
-   - ...
-
-
-NEW: added support for more color modes, usefull on slow connections:
-64 Colors, 8 Colors, 2 B/W, 8 and 4 Grey Scale colors.
-
-
-Compiling and Running the JavaViewer
-====================================
-
-** To compile the JavaViewer
-
-1. Edit the "mk.bat" file and replace the path "c:\soft" with the
-path where your Java sdk stands.
-
-2. Save and execute your mk.bat
-
-3. If you want to sign the generated applet so it can be embedded into
-Ultra winvnc.exe and injected into web browsers on connections to port 5800,
-use the keytool.exe and jarsigner.exe programs that can be found in the
-Java sdk.
-
-4. To replace the winvnc JavaViewer applet with your modifed
-and signed applet, copy the generated .class files and the vncviewer.jar
-file into winvnc\res directory and recompile WinVNC.
-
-
-
-** To run this JavaViewer as a Java application, you must have the Java
-Runtime installed.
-
-1. Edit the "run.bat" file and replace the path "c:\Ultravnc\JavaViewer"
-with the path where you've copied the JavaViewer, then replace "127.0.0.1"
-with the IP adress or network name of the machine where WinVNC server is
-running.
-
-2. Save and Execute run.bat
-
-=> If the path and adress you've written are correct, you should be prompted
-for the VNC password. If MS Logon is required on the server, you will also be
-prompted for Windows Username.
-
-
-Under Linux and Mac, you can also make a batchfile that executes this command:
-
-java.exe -cp **YourJavaViewerFullPath** VncViewer HOST **YourServerIP** PORT 5900
-
-
-As soon as this new JavaViewer reaches the "beta" stage we'll put the source
-code in Ultr at VNC CVS repository. For now, the source code is available on demand
-only. If you know Java, have time and want to improve the Ultr at VNC project, your
-help would be greatly appreciated.
-
-
-
-
-
-
-
-Compiling from the sources
-==========================
-
-To compile all the .java files to .class files, simply do:
-
-	% make all
-
-This will also generate a JAR (Java archive) file containing all the classes.
-Copy all the .class files, the .jar file and the .vnc files to an
-installation directory (e.g. /usr/local/vnc/classes):
-
-	% cp *.class *.jar *.vnc /usr/local/vnc/classes
-
-Make sure that the vncserver script is configured to point to the
-installation directory.
-
-
-Configuration
-=============
-
-Ultr at VNC Java viewer supports a number of parameters allowing you to
-customize its behaviour. Most parameter names copy settings available from
-the Options frame in the Java viewer. Both parameter names and their values
-are case-insensitive, with one exception for the "PASSWORD" parameter. Here
-is the full list of parameters supported in Ultr at VNC Java viewer:
-
---> "HOST" (no GUI equivalent)
-
-    Value: host name or IP address of the VNC server.
-    Default: in applet mode, the host from which the applet was loaded.
-
-    This parameter tells the viewer which server to connect to. Normally,
-    it's not needed, because default Java security policy allow connections
-    from applets to the only one host anyway, and that is the host from which
-    the applet was loaded.
-
---> "PORT" (no GUI equivalent)
-
-    Value: TCP port number on the VNC server.
-    Default: none.
-
-    This parameter is required in all cases. Note that this port is not the
-    one used for HTTP connection from the browser, it is the port used for
-    RFB connection. Usually, VNC servers use ports 58xx for HTTP connections,
-    and ports 59xx for RFB connections. Thus, most likely, this parameter
-    should be set to something like 5900, 5901 etc.
-
---> "PASSWORD"
-
-    Value: session password in plan text.
-    Default: none, ask user.
-
-    DO NOT EVER USE THIS PARAMETER, unless you really know what you are
-    doing. It's extremely dangerous from the security point of view. When
-    this parameter is set, the viewer won't ever ask for a password.
-
---> "ENCPASSWORD"
-
-    Value: encrypted session password in hex-ascii.
-    Default: none, ask user.
-
-    The same as the "PASSWORD" parameter but DES-encrypted using a fixed key.
-    Its value should be represented in hex-ascii e.g. "494015f9a35e8b22".
-    This parameter has higher priority over the "PASSWORD" parameter. DO NOT
-    EVER USE THIS PARAMETER, unless you really know what you are doing. It's
-    extremely dangerous from the security point of view, and encryption does
-    not actually help here since the decryption key is always known.
-
---> "Encoding"
-
-    Values: "Raw", "RRE", "CoRRE", "Hextile", "Zlib", "Tight".
-    Default: "Tight".
-
-    The preferred encoding. "Hextile" is a good choice for fast networks,
-    while "Tight" is better suited for low-bandwidth connections. From the
-    other side, the "Tight" decoder in Ultr at VNC Java viewer seems to be more
-    efficient than "Hextile" decoder so it's possible that this default
-    setting can be ok for fast networks too.
-
---> "Compression level"
-
-    Values: "Default", "1", "2", "3", "4", "5", "6", "7", "8", "9".
-    Default: "Default". ;-)
-
-    Use specified compression level for "Tight" and "Zlib" encodings. Level 1
-    uses minimum of CPU time on the server but achieves weak compression
-    ratios. Level 9 offers best compression but may be slow in terms of CPU
-    time consumption on the server side. Use high levels with very slow
-    network connections, and low levels when working over higher-speed
-    networks. The "Default" value means that the server's default compression
-    level should be used.
-
---> "JPEG image quality"
-
-    Values: "JPEG off", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9".
-    Default: "6".
-
-    Use the specified image quality level in "Tight" encoding. Quality level
-    0 denotes bad image quality but very impressive compression ratios, while
-    level 9 offers very good image quality at lower compression ratios. If
-    the value is "JPEG off", the server will not use lossy JPEG compression
-    in "Tight" encoding.
-
---> "Cursor shape updates"
-
-    Values: "Enable", "Ignore", "Disable".
-    Default: "Enable".
-
-    Cursor shape updates is a protocol extension used to handle remote cursor
-    movements locally on the client side, saving bandwidth and eliminating
-    delays in mouse pointer movement. Note that current implementation of
-    cursor shape updates does not allow a client to track mouse cursor
-    position at the server side. This means that clients would not see mouse
-    cursor movements if mouse was moved either locally on the server, or by
-    another remote VNC client. Set this parameter to "Disable" if you always
-    want to see real cursor position on the remote side. Setting this option
-    to "Ignore" is similar to "Enable" but the remote cursor will not be
-    visible at all. This can be a reasonable setting if you don't care about
-    cursor shape and don't want to see two mouse cursors, one above another.
-
---> "Use CopyRect"
-
-    Values: "Yes", "No".
-    Default: "Yes".
-
-    The "CopyRect" encoding saves bandwidth and drawing time when parts of
-    the remote screen are moving around. Most likely, you don't want to
-    change this setting.
-
---> "Restricted colors"
-
-    Values: "Yes", "No".
-    Default: "No".
-
-    If set to "No", then 24-bit color format is used to represent pixel data. 
-    If set to "Yes", then only 8 bits are used to represent each pixel. 8-bit
-    color format can save bandwidth, but colors may look very inaccurate.
-
---> "Mouse buttons 2 and 3"
-
-    Values: "Normal", "Reversed".
-    Default: "Normal".
-
-    If set to "Reversed", then right mouse button (button 2) will act as it
-    was middle mouse button (button 3), and vice versa.
-
---> "View only"
-
-    Values: "Yes", "No".
-    Default: "No".
-
-    If set to "Yes", then all keyboard and mouse events in the desktop window
-    will be silently ignored and will not be passed to the remote side.
-
---> "Share desktop"
-
-    Values: "Yes", "No".
-    Default: "Yes".
-
-    Share the connection with other clients on the same VNC server. The exact
-    behaviour in each case depends on the server configuration.
-
---> "Open new window" (no GUI equivalent, applicable only in the applet mode)
-
-    Values: "Yes", "No".
-    Default: "No".
-
-    Operate in a separate window. This makes possible resizing the desktop,
-    and adds scroll bars when necessary. If the server supports variable
-    desktop size, the window will resize automatically when remote desktop
-    size changes.
-
---> "Show controls" (no GUI equivalent)
-
-    Values: "Yes", "No".
-    Default: "Yes".
-
-    Set to "No" if you want to get rid of that button panel at the top.
-
---> "Show offline desktop" (no GUI equivalent)
-
-    Values: "Yes", "No".
-    Default: "No".
-
-    If set to "Yes", the viewer would continue to display desktop even
-    if the remote side has closed the connection. In this case, if the
-    button panel is enabled, then the "Disconnect" button would be
-    changed to "Hide desktop" after the connection is lost.
-
---> "Defer screen updates" (no GUI equivalent)
-
-    Value: time in milliseconds.
-    Default: "20".
-
-    When updating the desktop contents after receiving an update from server,
-    schedule repaint within the specified number of milliseconds. Small delay
-    helps to coalesce several small updates into one drawing operation,
-    improving CPU usage. Set this parameter to 0 to disable deferred updates.
-
---> "Defer cursor updates" (no GUI equivalent)
-
-    Value: time in milliseconds.
-    Default: "10".
-
-    When updating the desktop after moving the mouse, schedule repaint within
-    the specified number of milliseconds. This setting makes sense only when
-    "Cursor shape updates" parameter is set to "Enable". Small delay helps to
-    coalesce several small updates into one drawing operation, improving CPU
-    usage. Set this parameter to 0 to disable deferred cursor updates.
-
---> "Defer update requests" (no GUI equivalent)
-
-    Value: time in milliseconds.
-    Default: "50".
-
-    After processing an update received from server, wait for the specified
-    number of milliseconds before requesting next screen update. Such delay
-    will end immediately on every mouse or keyboard event if not in the "view
-    only" mode. Small delay helps the server to coalesce several small
-    updates into one framebuffer update, improving both bandwidth and CPU
-    usage. Increasing the parameter value does not affect responsiveness on
-    mouse and keyboard events, but causes delays in updating the screen when
-    there is no mouse and keyboard activity on the client side.
-
-
-RECORDING VNC SESSIONS
-======================
-
-Current version of the Ultr at VNC Java viewer is able to record VNC (RFB)
-sessions in files for later playback. The data format in saved session files
-is compatible with the rfbproxy program written by Tim Waugh. Most important
-thing about session recording is that it's supported only if Java security
-manager allows access to local filesystem. Typically, it would not work for
-unsigned applets. To use this feature, either use Ultr at VNC Java viewer as a
-standalone application (Java Runtime Environment or Java Development Kit
-should be installed), or as a signed applet. The code checks if it's possible
-to support session recording, and if everything's fine, the new "Record"
-button should appear in the button panel. Pressing this button opens new
-window which controls session recording. The GUI is pretty self-explained.
-
-Other important facts about session recording:
-
---> All sessions are recorded in the 24-bit color format. If you use
-    restricted colors (8-bit format), it will be temporarly switched to
-    24-bit mode during session recording.
-
---> All sessions are recorded with cursor shape updates turned off. This is
-    necessary to represent remote cursor movements in recorded sessions.
-
---> Closing and re-opening the recording control window does not affect the
-    recording. It's not necessary to keep that window open during recording a
-    session.
-
---> Avoid using Zlib encoding when recording sessions. It's ok if you started
-    recording BEFORE the connection to the VNC server has been established,
-    but if you started recording during an active session, all Zlib sessions
-    will be saved Raw-encoded (that is, without compression at all). Zlib
-    decoding depends on the pixel data received earlier, thus saving the data
-    received from the server at an arbitrary moment is not sufficient to
-    decompress it correctly. And there is no way to say Zlib decoder to reset
-    decompressor's state -- that's a limitation of the Zlib encoder. The
-    viewer could re-compress raw pixel data again before saving Zlib-encoded
-    sessions, but unfortunately Java API does not allow to flush zlib data
-    streams making it impossible to save Zlib-encoded RFB pixel data without
-    using native code.
-
---> Usually, Tight encoding is the most suitable one for session recording,
-    but some of the issues described above for the Zlib encoding affect the
-    Tight encoding as well. Unlike Zlib sessions, Tight-encoded sessions are
-    always saved Tight-encoded, but the viewer has to re-compress parts of
-    data to synchronize encoder's and decoder's zlib streams. And, due to
-    Java zlib API limitations, zlib streams' states have to be reset on each
-    compressed rectangle, causing compression ratios to be lower than in the
-    original VNC session. If you want to achieve the best possible
-    performance, turn recording on BEFORE connecting to the VNC server,
-    otherwise CPU usage and compression ratios may be notably less efficient.
-
-
-HINTS
-=====
-
---> To refresh remote desktop in the view-only mode, press "r" or "R"
-    on the keyboard.
-
-
-ACKNOWLEDGEMENTS
-================
-
-This distribution contains Java DES software by Dave Zimmerman
-<dzimm at widget.com> and Jef Poskanzer <jef at acme.com>.  This is:
-
-    Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.
-
-    Permission to use, copy, modify, and distribute this software and its
-    documentation for NON-COMMERCIAL or COMMERCIAL purposes and without fee
-    is hereby granted, provided that this copyright notice is kept intact.
-    
-    WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
-    SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
-    NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-    PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE
-    LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
-    MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
-
-    THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
-    CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
-    PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
-    NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
-    SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
-    SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
-    PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES").	WIDGET
-    WORKSHOP SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF
-    FITNESS FOR HIGH RISK ACTIVITIES.
-
-    Copyright (C) 1996 by Jef Poskanzer <jef at acme.com>.  All rights
-    reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
-    1. Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in the
-       documentation and/or other materials provided with the distribution.
-
-    THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-    BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-    Visit the ACME Labs Java page for up-to-date versions of this and other
-    fine Java utilities: http://www.acme.com/java/
diff --git a/ica/JavaViewer/RecordingFrame.java b/ica/JavaViewer/RecordingFrame.java
deleted file mode 100644
index 2da158d..0000000
--- a/ica/JavaViewer/RecordingFrame.java
+++ /dev/null
@@ -1,309 +0,0 @@
-//
-//  Copyright (C) 2002 Constantin Kaplinsky.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// Recording frame. It allows to control recording RFB sessions into
-// FBS (FrameBuffer Stream) files.
-//
-
-import java.io.*;
-import java.awt.*;
-import java.awt.event.*;
-
-class RecordingFrame extends Frame
-  implements WindowListener, ActionListener {
-
-  boolean recording;
-
-  TextField fnameField;
-  Button browseButton;
-
-  Label statusLabel;
-
-  Button recordButton, nextButton, closeButton;
-  VncViewer viewer;
-
-  //
-  // Check if current security manager allows to create a
-  // RecordingFrame object.
-  //
-
-  public static boolean checkSecurity() {
-    SecurityManager security = System.getSecurityManager();
-    if (security != null) {
-      try {
-	security.checkPropertyAccess("user.dir");
-	security.checkPropertyAccess("file.separator");
-      } catch (SecurityException e) {
-	System.out.println("SecurityManager restricts session recording.");
-	return false;
-      }
-    }
-    return true;
-  }
-
-  //
-  // Constructor.
-  //
-
-  RecordingFrame(VncViewer v) {
-    super("TightVNC Session Recording");
-
-    viewer = v;
-
-    // Determine initial filename for next saved session.
-    // FIXME: Check SecurityManager.
-
-    String fname = nextNewFilename(System.getProperty("user.dir") +
-				   System.getProperty("file.separator") +
-				   "vncsession.fbs");
-
-    // Construct new panel with file name field and "Browse" button.
-
-    Panel fnamePanel = new Panel();
-    GridBagLayout fnameGridbag = new GridBagLayout();
-    fnamePanel.setLayout(fnameGridbag);
-
-    GridBagConstraints fnameConstraints = new GridBagConstraints();
-    fnameConstraints.gridwidth = GridBagConstraints.RELATIVE;
-    fnameConstraints.fill = GridBagConstraints.BOTH;
-    fnameConstraints.weightx = 4.0;
-
-    fnameField = new TextField(fname, 64);
-    fnameGridbag.setConstraints(fnameField, fnameConstraints);
-    fnamePanel.add(fnameField);
-    fnameField.addActionListener(this);
-
-    fnameConstraints.gridwidth = GridBagConstraints.REMAINDER;
-    fnameConstraints.weightx = 1.0;
-
-    browseButton = new Button("Browse");
-    fnameGridbag.setConstraints(browseButton, fnameConstraints);
-    fnamePanel.add(browseButton);
-    browseButton.addActionListener(this);
-
-    // Construct the frame.
-
-    GridBagLayout gridbag = new GridBagLayout();
-    setLayout(gridbag);
-
-    GridBagConstraints gbc = new GridBagConstraints();
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gbc.fill = GridBagConstraints.BOTH;
-    gbc.weighty = 1.0;
-    gbc.insets = new Insets(10, 0, 0, 0);
-
-    Label helpLabel =
-      new Label("File name to save next recorded session in:", Label.CENTER);
-    gridbag.setConstraints(helpLabel, gbc);
-    add(helpLabel);
-
-    gbc.fill = GridBagConstraints.HORIZONTAL;
-    gbc.weighty = 0.0;
-    gbc.insets = new Insets(0, 0, 0, 0);
-
-    gridbag.setConstraints(fnamePanel, gbc);
-    add(fnamePanel);
-
-    gbc.fill = GridBagConstraints.BOTH;
-    gbc.weighty = 1.0;
-    gbc.insets = new Insets(10, 0, 10, 0);
-
-    statusLabel = new Label("", Label.CENTER);
-    gridbag.setConstraints(statusLabel, gbc);
-    add(statusLabel);
-
-    gbc.fill = GridBagConstraints.HORIZONTAL;
-    gbc.weightx = 1.0;
-    gbc.weighty = 0.0;
-    gbc.gridwidth = 1;
-    gbc.insets = new Insets(0, 0, 0, 0);
-
-    recordButton = new Button("Record");
-    gridbag.setConstraints(recordButton, gbc);
-    add(recordButton);
-    recordButton.addActionListener(this);
-
-    nextButton = new Button("Next file");
-    gridbag.setConstraints(nextButton, gbc);
-    add(nextButton);
-    nextButton.addActionListener(this);
-
-    closeButton = new Button("Close");
-    gridbag.setConstraints(closeButton, gbc);
-    add(closeButton);
-    closeButton.addActionListener(this);
-
-    // Set correct text, font and color for the statusLabel.
-    stopRecording();
-
-    pack();
-
-    addWindowListener(this);
-  }
-
-  //
-  // If the given string ends with ".NNN" where NNN is a decimal
-  // number, increase this number by one. Otherwise, append ".001"
-  // to the given string.
-  //
-
-  protected String nextFilename(String fname) {
-    int len = fname.length();
-    int suffixPos = len;
-    int suffixNum = 1;
-
-    if (len > 4 && fname.charAt(len - 4) == '.') {
-      try {
-	suffixNum = Integer.parseInt(fname.substring(len - 3, len)) + 1;
-	suffixPos = len - 4;
-      } catch (NumberFormatException e) { }
-    }
-
-    char[] zeroes = {'0', '0', '0'};
-    String suffix = String.valueOf(suffixNum);
-    if (suffix.length() < 3) {
-      suffix = new String(zeroes, 0, 3 - suffix.length()) + suffix;
-    }
-
-    return fname.substring(0, suffixPos) + '.' + suffix;
-  }
-
-  //
-  // Find next name of a file which does not exist yet.
-  //
-
-  protected String nextNewFilename(String fname) {
-    String newName = fname;
-    File f;
-    try {
-      do {
-	newName = nextFilename(newName);
-	f = new File(newName);
-      } while (f.exists());
-    } catch (SecurityException e) { }
-
-    return newName;
-  }
-
-  //
-  // Let the user choose a file name showing a FileDialog.
-  //
-
-  protected boolean browseFile() {
-    File currentFile = new File(fnameField.getText());
-
-    FileDialog fd =
-      new FileDialog(this, "Save next session as...", FileDialog.SAVE);
-    fd.setDirectory(currentFile.getParent());
-    fd.setVisible(true);
-    if (fd.getFile() != null) {
-      String newDir = fd.getDirectory();
-      String sep = System.getProperty("file.separator");
-      if (newDir.length() > 0) {
-	if (!sep.equals(newDir.substring(newDir.length() - sep.length())))
-	  newDir += sep;
-      }
-      String newFname = newDir + fd.getFile();
-      if (newFname.equals(fnameField.getText())) {
-	fnameField.setText(newFname);
-	return true;
-      }
-    }
-    return false;
-  }
-
-  //
-  // Start recording.
-  //
-
-  public void startRecording() {
-    statusLabel.setText("Status: Recording...");
-    statusLabel.setFont(new Font("Helvetica", Font.BOLD, 12));
-    statusLabel.setForeground(Color.red);
-    recordButton.setLabel("Stop recording");
-
-    recording = true;
-
-    viewer.setRecordingStatus(fnameField.getText());
-  }
-
-  //
-  // Stop recording.
-  //
-
-  public void stopRecording() {
-    statusLabel.setText("Status: Not recording.");
-    statusLabel.setFont(new Font("Helvetica", Font.PLAIN, 12));
-    statusLabel.setForeground(Color.black);
-    recordButton.setLabel("Record");
-
-    recording = false;
-
-    viewer.setRecordingStatus(null);
-  }
-
-  //
-  // Close our window properly.
-  //
-
-  public void windowClosing(WindowEvent evt) {
-    setVisible(false);
-  }
-
-  //
-  // Ignore window events we're not interested in.
-  //
-
-  public void windowActivated(WindowEvent evt) {}
-  public void windowDeactivated (WindowEvent evt) {}
-  public void windowOpened(WindowEvent evt) {}
-  public void windowClosed(WindowEvent evt) {}
-  public void windowIconified(WindowEvent evt) {}
-  public void windowDeiconified(WindowEvent evt) {}
-
-
-  //
-  // Respond to button presses
-  //
-
-  public void actionPerformed(ActionEvent evt) {
-    if (evt.getSource() == browseButton) {
-      if (browseFile() && recording)
-	startRecording();
-
-    } else if (evt.getSource() == recordButton) {
-      if (!recording) {
-	startRecording();
-      } else {
-	stopRecording();
-        fnameField.setText(nextNewFilename(fnameField.getText()));
-      }
-
-    } else if (evt.getSource() == nextButton) {
-      fnameField.setText(nextNewFilename(fnameField.getText()));
-      if (recording)
-	startRecording();
-
-    } else if (evt.getSource() == closeButton) {
-      setVisible(false);
-
-    }
-  }
-}
diff --git a/ica/JavaViewer/RfbProto.java b/ica/JavaViewer/RfbProto.java
deleted file mode 100644
index b5556e4..0000000
--- a/ica/JavaViewer/RfbProto.java
+++ /dev/null
@@ -1,1935 +0,0 @@
-//  Copyright (C) 2002-2004 Ultr at VNC Team.  All Rights Reserved.
-//  Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
-//  Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
-//  Copyright (C) 2001,2002 Constantin Kaplinsky.  All Rights Reserved.
-//  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// RfbProto.java
-//4/19/04
-
-import java.io.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.net.Socket;
-import java.util.*;
-import java.util.zip.*;
-
-
-class RfbProto {
-
-	private final static boolean DEBUG  = false; // Modif: troessner
-	final String versionMsg = "RFB 003.003\n";
-	final static int ConnFailed = 0, NoAuth = 1, VncAuth = 2, MsLogon = 0xfffffffa;
-	final static int VncAuthOK = 0, VncAuthFailed = 1, VncAuthTooMany = 2;
-
-	final static int FramebufferUpdate = 0,
-		SetColourMapEntries = 1,
-		Bell = 2,
-		ServerCutText = 3,
-		rfbFileTransfer = 7;
-
-	final int SetPixelFormat = 0,
-		FixColourMapEntries = 1,
-		SetEncodings = 2,
-		FramebufferUpdateRequest = 3,
-		KeyboardEvent = 4,
-		PointerEvent = 5,
-		ClientCutText = 6;
-
-	final static int EncodingRaw = 0,
-		EncodingCopyRect = 1,
-		EncodingRRE = 2,
-		EncodingCoRRE = 4,
-		EncodingHextile = 5,
-		EncodingZlib = 6,
-		EncodingTight = 7,
-		EncodingCompressLevel0 = 0xFFFFFF00,
-		EncodingQualityLevel0 = 0xFFFFFFE0,
-		EncodingXCursor = 0xFFFFFF10,
-		EncodingRichCursor = 0xFFFFFF11,
-		EncodingPointerPos = 0xFFFFFF18, // marscha - PointerPos
-		EncodingLastRect = 0xFFFFFF20,
-		EncodingNewFBSize = 0xFFFFFF21;
-
-	final int HextileRaw = (1 << 0);
-	final int HextileBackgroundSpecified = (1 << 1);
-	final int HextileForegroundSpecified = (1 << 2);
-	final int HextileAnySubrects = (1 << 3);
-	final int HextileSubrectsColoured = (1 << 4);
-
-	final static int TightExplicitFilter = 0x04;
-	final static int TightFill = 0x08;
-	final static int TightJpeg = 0x09;
-	final static int TightMaxSubencoding = 0x09;
-	final static int TightFilterCopy = 0x00;
-	final static int TightFilterPalette = 0x01;
-	final static int TightFilterGradient = 0x02;
-
-	final static int TightMinToCompress = 12;
-
-	// sf at 2004 - FileTransfer part
-	ArrayList remoteDirsList;
-	ArrayList remoteFilesList;
-	ArrayList a;
-	boolean fFTInit = true; // sf at 2004
-	boolean fFTAllowed = true;
-	boolean fAbort = false;
-	boolean fFileReceptionError = false;
-	boolean fFileReceptionRunning = false;
-	boolean inDirectory2;
-	FileOutputStream fos;
-	FileInputStream fis;
-	String sendFileSource;
-	String receivePath;
-	long fileSize;
-	long receiveFileSize;
-	long fileChunkCounter;
-
-	final static int sz_rfbFileTransferMsg = 12,
-	// FileTransfer Content types and Params defines
-	rfbDirContentRequest = 1,
-	// Client asks for the content of a given Server directory
-	rfbDirPacket = 2, // Full directory name or full file name.
-	// Null content means end of Directory
-	rfbFileTransferRequest = 3,
-	// Client asks the server for the tranfer of a given file
-	rfbFileHeader = 4,
-	// First packet of a file transfer, containing file's features
-	rfbFilePacket = 5, // One slice of the file
-	rfbEndOfFile = 6,
-	// End of file transfer (the file has been received or error)
-	rfbAbortFileTransfer = 7,
-	// The file transfer must be aborted, whatever the state
-	rfbFileTransferOffer = 8,
-	// The client offers to send a file to the server
-	rfbFileAcceptHeader = 9, // The server accepts or rejects the file
-	rfbCommand = 10,
-	// The Client sends a simple command (File Delete, Dir create etc...)
-	rfbCommandReturn = 11,
-	//	New FT Protocole (V2) The zipped checksums of the destination file (Delta Transfer)
-	rfbFileChecksums = 12,
-	// The Client receives the server's answer about a simple command
-	// rfbDirContentRequest client Request - content params 
-	rfbRDirContent = 1, // Request a Server Directory contents
-	rfbRDrivesList = 2, // Request the server's drives list
-	
-	// rfbDirPacket & rfbCommandReturn  server Answer - content params
-	rfbADirectory = 1, // Reception of a directory name
-	rfbAFile = 2, // Reception of a file name 
-	rfbADrivesList = 3, // Reception of a list of drives
-	rfbADirCreate = 4, // Response to a create dir command 
-	rfbADirDelete = 5, // Response to a delete dir command 
-	rfbAFileCreate = 6, // Response to a create file command 
-	rfbAFileDelete = 7, // Response to a delete file command
-	
-	// rfbCommand Command - content params
-	rfbCDirCreate = 1, // Request the server to create the given directory
-	rfbCDirDelete = 2, // Request the server to delete the given directory
-	rfbCFileCreate = 3, // Request the server to create the given file
-	rfbCFileDelete = 4, // Request the server to delete the given file
-	
-	// Errors - content params or "size" field
-	rfbRErrorUnknownCmd = 1, // Unknown FileTransfer command.
-	rfbRErrorCmd = 0xFFFFFFFF,
-	
-	// Error when a command fails on remote side (ret in "size" field)
-	sz_rfbBlockSize = 8192, // new FT protocole (v2)
-	
-	// Size of a File Transfer packet (before compression)
-	sz_rfbZipDirectoryPrefix = 9;
-
-	String rfbZipDirectoryPrefix = "!UVNCDIR-\0";
-	// Transfered directory are zipped in a file with this prefix. Must end with "-"
-
-	// End of FileTransfer part 
-	
-	String host;
-	int port;
-	Socket sock;
-	DataInputStream is;
-	OutputStream os;
-	OutputStreamWriter osw;
-
-	SessionRecorder rec;
-	boolean inNormalProtocol = false;
-	VncViewer viewer;
-
-	// Java on UNIX does not call keyPressed() on some keys, for example
-	// swedish keys To prevent our workaround to produce duplicate
-	// keypresses on JVMs that actually works, keep track of if
-	// keyPressed() for a "broken" key was called or not. 
-	boolean brokenKeyPressed = false;
-
-	// This will be set to true on the first framebuffer update
-	// containing Zlib- or Tight-encoded data.
-	boolean wereZlibUpdates = false;
-
-	// This will be set to false if the startSession() was called after
-	// we have received at least one Zlib- or Tight-encoded framebuffer
-	// update.
-	boolean recordFromBeginning = true;
-
-	// This fields are needed to show warnings about inefficiently saved
-	// sessions only once per each saved session file.
-	boolean zlibWarningShown;
-	boolean tightWarningShown;
-
-	// Before starting to record each saved session, we set this field
-	// to 0, and increment on each framebuffer update. We don't flush
-	// the SessionRecorder data into the file before the second update. 
-	// This allows us to write initial framebuffer update with zero
-	// timestamp, to let the player show initial desktop before
-	// playback.
-	int numUpdatesInSession;
-
-	//
-	// Constructor. Make TCP connection to RFB server.
-	//
-
-	RfbProto(String h, int p, VncViewer v, String repeaterHost, int repeaterPort) throws IOException {
-		viewer = v;
-		host = h;
-		port = p;
-		
-        if (repeaterHost != null) {
-            sock = new Socket(repeaterHost, repeaterPort);
-            doRepeater(sock,host,port);
-        } else {
-            sock = new Socket(host, port);
-        }
-		is =
-			new DataInputStream(
-				new BufferedInputStream(sock.getInputStream(), 16384));
-		os = sock.getOutputStream();
-		osw = new OutputStreamWriter(sock.getOutputStream());
-		inDirectory2 = false;
-		a = new ArrayList();
-		// sf at 2004
-		remoteDirsList = new ArrayList();
-		remoteFilesList = new ArrayList();
-	
-		sendFileSource = "";
-	}
-	
-	    private void doRepeater(Socket sock, String host, int port) throws IOException {
-        // Read the RFB protocol version
-        final String buf2 = "";
-        sock.getOutputStream().write(buf2.getBytes());
-
-        DataInputStream is = new DataInputStream(sock.getInputStream());
-        String line = is.readLine();
-
-        // Write the ID
-        //if (!id.startsWith("ID:"))
-            //id = "ID:" + id;
-
-        String dest = host + ":" + port;
-        byte[] buf = new byte[250];
-        System.arraycopy(dest.getBytes("ISO-8859-1"), 0, buf, 0, dest.length());
-
-        sock.getOutputStream().write(buf);
-    }
-
-	void close() {
-		try {
-			sock.close();
-			if (rec != null) {
-				rec.close();
-				rec = null;
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	//
-	// Read server's protocol version message
-	//
-
-	int serverMajor, serverMinor;
-
-	void readVersionMsg() throws Exception {
-
-		byte[] b = new byte[12];
-
-		is.readFully(b);
-
-		if ((b[0] != 'R')
-			|| (b[1] != 'F')
-			|| (b[2] != 'B')
-			|| (b[3] != ' ')
-			|| (b[4] < '0')
-			|| (b[4] > '9')
-			|| (b[5] < '0')
-			|| (b[5] > '9')
-			|| (b[6] < '0')
-			|| (b[6] > '9')
-			|| (b[7] != '.')
-			|| (b[8] < '0')
-			|| (b[8] > '9')
-			|| (b[9] < '0')
-			|| (b[9] > '9')
-			|| (b[10] < '0')
-			|| (b[10] > '9')
-			|| (b[11] != '\n')) {
-			throw new Exception(
-				"Host " + host + " port " + port + " is not an RFB server");
-		}
-
-		serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0');
-		serverMinor = (b[8] - '0') * 100 + (b[9] - '0') * 10 + (b[10] - '0');
-	}
-
-	//
-	// Write our protocol version message
-	//
-
-	void writeVersionMsg() throws IOException {
-		os.write(versionMsg.getBytes());
-	}
-
-	//
-	// Find out the authentication scheme.
-	//
-
-	int readAuthScheme() throws Exception {
-		int authScheme = is.readInt();
-
-		switch (authScheme) {
-
-			case ConnFailed :
-				int reasonLen = is.readInt();
-				byte[] reason = new byte[reasonLen];
-				is.readFully(reason);
-				throw new Exception(new String(reason));
-
-			case NoAuth :
-			case VncAuth :
-			case MsLogon:
-				return authScheme;
-
-			default :
-				throw new Exception(
-					"Unknown authentication scheme from RFB server: "
-						+ authScheme);
-
-		}
-	}
-
-	//
-	// Write the client initialisation message
-	//
-
-	void writeClientInit() throws IOException {
-		if (viewer.options.shareDesktop) {
-			os.write(1);
-		} else {
-			os.write(0);
-		}
-		viewer.options.disableShareDesktop();
-	}
-
-	//
-	// Read the server initialisation message
-	//
-
-	String desktopName;
-	int framebufferWidth, framebufferHeight;
-	int bitsPerPixel, depth;
-	boolean bigEndian, trueColour;
-	int redMax, greenMax, blueMax, redShift, greenShift, blueShift;
-
-	void readServerInit() throws IOException {
-		framebufferWidth = is.readUnsignedShort();
-		framebufferHeight = is.readUnsignedShort();
-		bitsPerPixel = is.readUnsignedByte();
-		depth = is.readUnsignedByte();
-		bigEndian = (is.readUnsignedByte() != 0);
-		trueColour = (is.readUnsignedByte() != 0);
-		redMax = is.readUnsignedShort();
-		greenMax = is.readUnsignedShort();
-		blueMax = is.readUnsignedShort();
-		redShift = is.readUnsignedByte();
-		greenShift = is.readUnsignedByte();
-		blueShift = is.readUnsignedByte();
-		byte[] pad = new byte[3];
-		is.readFully(pad);
-		int nameLength = is.readInt();
-		byte[] name = new byte[nameLength];
-		is.readFully(name);
-		desktopName = new String(name);
-
-		inNormalProtocol = true;
-	}
-
-	//
-	// Create session file and write initial protocol messages into it.
-	//
-
-	void startSession(String fname) throws IOException {
-		rec = new SessionRecorder(fname);
-		rec.writeHeader();
-		rec.write(versionMsg.getBytes());
-		rec.writeIntBE(NoAuth);
-		rec.writeShortBE(framebufferWidth);
-		rec.writeShortBE(framebufferHeight);
-		byte[] fbsServerInitMsg =
-			{
-				32,
-				24,
-				0,
-				1,
-				0,
-				(byte) 0xFF,
-				0,
-				(byte) 0xFF,
-				0,
-				(byte) 0xFF,
-				16,
-				8,
-				0,
-				0,
-				0,
-				0 };
-		rec.write(fbsServerInitMsg);
-		rec.writeIntBE(desktopName.length());
-		rec.write(desktopName.getBytes());
-		numUpdatesInSession = 0;
-
-		if (wereZlibUpdates)
-			recordFromBeginning = false;
-
-		zlibWarningShown = false;
-		tightWarningShown = false;
-	}
-
-	//
-	// Close session file.
-	//
-
-	void closeSession() throws IOException {
-		if (rec != null) {
-			rec.close();
-			rec = null;
-		}
-	}
-
-	//
-	// Set new framebuffer size
-	//
-
-	void setFramebufferSize(int width, int height) {
-		framebufferWidth = width;
-		framebufferHeight = height;
-	}
-
-	//
-	// Read the server message type
-	//
-
-	int readServerMessageType() throws IOException {
-		int msgType = is.readUnsignedByte();
-
-		// If the session is being recorded:
-		if (rec != null) {
-			if (msgType == Bell) { // Save Bell messages in session files.
-				rec.writeByte(msgType);
-				if (numUpdatesInSession > 0)
-					rec.flush();
-			}
-		}
-
-		return msgType;
-	}
-
-	//
-	// Read a FramebufferUpdate message
-	//
-
-	int updateNRects;
-
-	void readFramebufferUpdate() throws IOException {
-		is.readByte();
-		updateNRects = is.readUnsignedShort();
-
-		// If the session is being recorded:
-		if (rec != null) {
-			rec.writeByte(FramebufferUpdate);
-			rec.writeByte(0);
-			rec.writeShortBE(updateNRects);
-		}
-
-		numUpdatesInSession++;
-	}
-
-	// Read a FramebufferUpdate rectangle header
-
-	int updateRectX, updateRectY, updateRectW, updateRectH, updateRectEncoding;
-
-	void readFramebufferUpdateRectHdr() throws Exception {
-		updateRectX = is.readUnsignedShort();
-		updateRectY = is.readUnsignedShort();
-		updateRectW = is.readUnsignedShort();
-		updateRectH = is.readUnsignedShort();
-		updateRectEncoding = is.readInt();
-
-		if (updateRectEncoding == EncodingZlib
-			|| updateRectEncoding == EncodingTight)
-			wereZlibUpdates = true;
-
-		// If the session is being recorded:
-		if (rec != null) {
-			if (numUpdatesInSession > 1)
-				rec.flush(); // Flush the output on each rectangle.
-			rec.writeShortBE(updateRectX);
-			rec.writeShortBE(updateRectY);
-			rec.writeShortBE(updateRectW);
-			rec.writeShortBE(updateRectH);
-			if (updateRectEncoding == EncodingZlib && !recordFromBeginning) {
-				// Here we cannot write Zlib-encoded rectangles because the
-				// decoder won't be able to reproduce zlib stream state.
-				if (!zlibWarningShown) {
-					System.out.println(
-						"Warning: Raw encoding will be used "
-							+ "instead of Zlib in recorded session.");
-					zlibWarningShown = true;
-				}
-				rec.writeIntBE(EncodingRaw);
-			} else {
-				rec.writeIntBE(updateRectEncoding);
-				if (updateRectEncoding == EncodingTight
-					&& !recordFromBeginning
-					&& !tightWarningShown) {
-					System.out.println(
-						"Warning: Re-compressing Tight-encoded "
-							+ "updates for session recording.");
-					tightWarningShown = true;
-				}
-			}
-		}
-
-		if (updateRectEncoding == EncodingLastRect
-			|| updateRectEncoding == EncodingNewFBSize)
-			return;
-
-		if (updateRectX + updateRectW > framebufferWidth
-			|| updateRectY + updateRectH > framebufferHeight) {
-			throw new Exception(
-				"Framebuffer update rectangle too large: "
-					+ updateRectW
-					+ "x"
-					+ updateRectH
-					+ " at ("
-					+ updateRectX
-					+ ","
-					+ updateRectY
-					+ ")");
-		}
-	}
-
-	// Read CopyRect source X and Y.
-
-	int copyRectSrcX, copyRectSrcY;
-
-	void readCopyRect() throws IOException {
-		copyRectSrcX = is.readUnsignedShort();
-		copyRectSrcY = is.readUnsignedShort();
-
-		// If the session is being recorded:
-		if (rec != null) {
-			rec.writeShortBE(copyRectSrcX);
-			rec.writeShortBE(copyRectSrcY);
-		}
-	}
-
-	//
-	// Read a ServerCutText message
-	//
-
-	String readServerCutText() throws IOException {
-		byte[] pad = new byte[3];
-		is.readFully(pad);
-		int len = is.readInt();
-		byte[] text = new byte[len];
-		is.readFully(text);
-		return new String(text);
-	}
-
-	//
-	// Read an integer in compact representation (1..3 bytes).
-	// Such format is used as a part of the Tight encoding.
-	// Also, this method records data if session recording is active and
-	// the viewer's recordFromBeginning variable is set to true.
-	//
-
-	int readCompactLen() throws IOException {
-		int[] portion = new int[3];
-		portion[0] = is.readUnsignedByte();
-		int byteCount = 1;
-		int len = portion[0] & 0x7F;
-		if ((portion[0] & 0x80) != 0) {
-			portion[1] = is.readUnsignedByte();
-			byteCount++;
-			len |= (portion[1] & 0x7F) << 7;
-			if ((portion[1] & 0x80) != 0) {
-				portion[2] = is.readUnsignedByte();
-				byteCount++;
-				len |= (portion[2] & 0xFF) << 14;
-			}
-		}
-
-		if (rec != null && recordFromBeginning)
-			for (int i = 0; i < byteCount; i++)
-				rec.writeByte(portion[i]);
-
-		return len;
-	}
-
-	//Author: Kenn Min Chong/////////////////////////////////////////////
-
-	//Read/Write a rfbFileTransferMsg
-	/*typedef struct _rfbFileTransferMsg {
-	    CARD8 type;			// always rfbFileTransfer
-	    CARD8 contentType;  // See defines below
-	    CARD16 contentParam;// Other possible content classification (Dir or File name, etc..)
-		CARD32 size;		// FileSize or packet index or error or other 
-	    CARD32 length;
-	    // followed by data char text[length]
-	} rfbFileTransferMsg;
-	*/
-
-	//	Parsing Rfb message to see what type 
-
-	void readRfbFileTransferMsg() throws IOException
-	{
-		int contentType = is.readUnsignedByte();
-		int contentParamT = is.readUnsignedByte();
-		int contentParam = contentParamT;
-		contentParamT = is.readUnsignedByte();
-		contentParamT = contentParamT << 8;
-		contentParam = contentParam | contentParamT;
-		if (contentType == rfbRDrivesList || contentType == rfbDirPacket)
-		{
-			readDriveOrDirectory(contentParam);
-		}
-		else if (contentType == rfbFileHeader)
-		{
-			receiveFileHeader();
-		}
-		else if (contentType == rfbFilePacket)
-		{
-				receiveFileChunk();
-		}
-		else if (contentType == rfbEndOfFile)
-		{
-			endOfReceiveFile(true); // Ok
-		}
-		else if (contentType == rfbAbortFileTransfer)
-		{
-			if (fFileReceptionRunning)
-			{
-				endOfReceiveFile(false); // Error
-			}
-			else
-			{
-				// sf at 2004 - Todo: Add TestPermission 
-				// System.out.println("File Transfer Aborted!");
-			}
-			
-		}
-		else if (contentType == rfbCommandReturn)
-		{
-			createDirectoryorDeleteFile(contentParam);
-		}
-		else if (contentType == rfbFileAcceptHeader)
-		{
-			sendFile();
-		}
-		else if (contentType == rfbFileChecksums)
-		{
-			ReceiveDestinationFileChecksums();
-		}
-		else
-		{
-			//System.out.println("ContentType: " + contentType);
-		}
-	}
-
-	//Refactored from readRfbFileTransferMsg()
-	public void createDirectoryorDeleteFile(int contentParam)
-		throws IOException {
-		if (contentParam == rfbADirCreate)
-		{
-			createRemoteDirectoryFeedback();
-		}
-		else if (contentParam == rfbAFileDelete)
-		{
-			deleteRemoteFileFeedback();
-		}
-	}
-
-	//Refactored from readRfbFileTransferMsg()
-	public void readDriveOrDirectory(int contentParam) throws IOException {
-		if (contentParam == rfbADrivesList)
-		{
-			readFTPMsgDriveList();
-		}
-		else if (contentParam == rfbADirectory && !inDirectory2)
-		{
-			inDirectory2 = true;
-			readFTPMsgDirectoryList();
-		}
-		else if (contentParam == rfbADirectory && inDirectory2)
-		{
-			readFTPMsgDirectoryListContent();
-		}
-		else if (contentParam == 0)
-		{
-			readFTPMsgDirectoryListEndContent();
-			inDirectory2 = false;
-		}
-		else
-		{
-			//System.out.println("ContentParam: " + contentParam);
-		}
-	}
-
-	// Internally used. Write an Rfb message to the server
-	void writeRfbFileTransferMsg(
-								int contentType,
-								int contentParam,
-								long size, // 0 : compression not supported - 1 : compression supported
-								long length,
-								String text) throws IOException
-	{
-		byte b[] = new byte[12];
-
-		b[0] = (byte) rfbFileTransfer;
-		b[1] = (byte) contentType;
-		b[2] = (byte) contentParam;
-
-		byte by = 0;
-		long c = 0;
-		length++;
-		c = size & 0xFF000000;
-		by = (byte) (c >>> 24);
-		b[4] = by;
-		c = size & 0xFF0000;
-		by = (byte) (c >>> 16);
-		b[5] = by;
-		c = size & 0xFF00;
-		by = (byte) (c >>> 8);
-		b[6] = by;
-		c = size & 0xFF;
-		by = (byte) c;
-		b[7] = by;
-
-		c = length & 0xFF000000;
-		by = (byte) (c >>> 24);
-		b[8] = by;
-		c = length & 0xFF0000;
-		by = (byte) (c >>> 16);
-		b[9] = by;
-		c = length & 0xFF00;
-		by = (byte) (c >>> 8);
-		b[10] = by;
-		c = length & 0xFF;
-		by = (byte) c;
-		b[11] = by;
-		os.write(b);
-		
-
-		if (text != null)
-		{
-			byte byteArray[] = text.getBytes();
-			byte byteArray2[] = new byte[byteArray.length + 1];
-			for (int i = 0; i < byteArray.length; i++) {
-				byteArray2[i] = byteArray[i];
-			}
-			byteArray2[byteArray2.length - 1] = 0;
-			os.write(byteArray2);
-		}
-		
-	}
-
-	//Internally used. Write an rfb message to the server for sending files ONLY 
-	int writeRfbFileTransferMsgForSendFile(
-											int contentType,
-											int contentParam,
-											long size,
-											long length,
-											String source
-											) throws IOException
-	{
-		File f = new File(source);
-		fis = new FileInputStream(f);
-		byte byteBuffer[] = new byte[sz_rfbBlockSize]; 
-		int bytesRead = fis.read(byteBuffer);
-		long counter=0;
-		boolean fError = false;
-		
-		// sf@ - Manage compression
-		boolean fCompress = true;
-		Deflater myDeflater = new Deflater();
-		byte[] CompressionBuffer = new byte[sz_rfbBlockSize + 1024];
-		int compressedSize = 0;
-	
-		while (bytesRead!=-1)
-		{
-				counter += bytesRead;
-				myDeflater.setInput(byteBuffer, 0, bytesRead);
-				myDeflater.finish();
-				compressedSize = myDeflater.deflate(CompressionBuffer);
-				myDeflater.reset();
-				// If the compressed data is larger than the original one, we're dealing with
-				// already compressed data
-				if (compressedSize > bytesRead)
-					fCompress = false;
-				this.writeRfbFileTransferMsg(
-											contentType,
-											contentParam,
-											(fCompress ? 1 : 0), 
-											(fCompress ? compressedSize-1 : bytesRead-1),
-											null
-											);
-				// Todo: Test write error !
-				os.write(
-						fCompress ? CompressionBuffer : byteBuffer,
-						0,
-						fCompress ? compressedSize : bytesRead
-						);
-				
-				// Todo: test read error !
-				bytesRead = fis.read(byteBuffer);
-				
-				// viewer.ftp.connectionStatus.setText("Sent: "+ counter + " bytes of "+ f.length() + " bytes");
-				viewer.ftp.jProgressBar.setValue((int)((counter * 100) / f.length()));
-				viewer.ftp.connectionStatus.setText(">>> Sending File: " + source + " - Size: " + f.length() + " bytes - Progress: " + ((counter * 100) / f.length()) + "%");
-				
-				if (fAbort == true)
-				{
-					fAbort = false;
-					fError = true;
-					break;
-				}
-				try
-				{
-			        Thread.sleep(5);
-			    }
-				catch(InterruptedException e)
-				{
-			        System.err.println("Interrupted");
-			    }				
-		}
-		
-		writeRfbFileTransferMsg(fError ? rfbAbortFileTransfer : rfbEndOfFile, 0, 0, 0, null);
-		fis.close();
-		return (fError ? -1 : 1);
-	}
-
-	//This method is internally used to send the file to the server once the server is ready
-	void sendFile()
-	{
-		try
-		{
-			viewer.ftp.disableButtons();
-			int size = is.readInt();
-			int length = is.readInt();
-			for (int i = 0; i < length; i++)
-			{
-				System.out.print((char) is.readUnsignedByte());
-			}
-			
-			int ret = writeRfbFileTransferMsgForSendFile(
-															rfbFilePacket,
-															0,
-															0,
-															0,
-															sendFileSource);
-	
-			viewer.ftp.refreshRemoteLocation();
-			if (ret != 1)
-			{
-				viewer.ftp.connectionStatus.setText(" > Error - File NOT sent");
-				viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - File: <" + sendFileSource) + "> was not correctly sent (aborted by user or error)",0);
-			}
-			else
-			{
-				viewer.ftp.connectionStatus.setText(" > File sent");
-				viewer.ftp.historyComboBox.insertItemAt(new String(" > File: <" + sendFileSource) + "> was sent to Remote Machine",0);
-			}
-			viewer.ftp.historyComboBox.setSelectedIndex(0);
-			viewer.ftp.enableButtons();
-		}
-		catch (IOException e)
-		{
-			System.err.println(e);
-		}
-	}
-
-	//Call this method to send a file from local pc to server
-	void offerLocalFile(String source, String destinationPath)
-	{
-		try
-		{
-			sendFileSource = source;
-			File f = new File(source);
-			// sf at 2004 - Add support for huge files
-			long lSize = f.length();
-			int iLowSize = (int)(lSize & 0x00000000FFFFFFFF); 
-			int iHighSize = (int)(lSize >> 32);
-			
-			String temp = destinationPath + f.getName();
-			writeRfbFileTransferMsg(
-									rfbFileTransferOffer,
-									0,
-									iLowSize, // f.length(),
-									temp.length(),
-									temp);
-			
-			// sf at 2004 - Send the high part of the size			
-			byte b[] = new byte[4];
-			byte by = 0;
-			long c = 0;
-			c = iHighSize & 0xFF000000;
-			by = (byte) (c >>> 24);
-			b[0] = by;
-			c = iHighSize & 0xFF0000;
-			by = (byte) (c >>> 16);
-			b[1] = by;
-			c = iHighSize & 0xFF00;
-			by = (byte) (c >>> 8);
-			b[2] = by;
-			c = iHighSize & 0xFF;
-			by = (byte) c;
-			b[3] = by;			
-			os.write(b); 
-		}
-		catch (IOException e)
-		{
-			System.err.println(e);
-		}
-	}
-
-	//Internally used.
-	//Handles acknowledgement that the file has been deleted on the server
-	void deleteRemoteFileFeedback() throws IOException
-	{
-		is.readInt();
-		int length = is.readInt();
-		String f = "";
-		for (int i = 0; i < length; i++)
-		{
-			f += (char)is.readUnsignedByte();
-		}
-		
-		viewer.ftp.refreshRemoteLocation();	
-		viewer.ftp.historyComboBox.insertItemAt(new String(" > Deleted File On Remote Machine: " + f.substring(0, f.length()-1)),0);
-		viewer.ftp.historyComboBox.setSelectedIndex(0);
-		viewer.ftp.setEnabled(false);
-		viewer.ftp.repaint();
-		viewer.ftp.setEnabled(true);
-	}
-
-	//Call this method to delete a file at server
-	void deleteRemoteFile(String text)
-	{
-		try
-		{
-			String temp = text;
-			writeRfbFileTransferMsg(
-									rfbCommand,
-									rfbCFileDelete,
-									0,
-									temp.length(),
-									temp);
-		}
-		catch (IOException e)
-		{
-			System.err.println(e);
-		}
-	}
-
-	//Internally used.
-	// Handles acknowledgement that the directory has been created on the server
-	void createRemoteDirectoryFeedback() throws IOException
-	{
-		is.readInt();
-		int length = is.readInt();
-		String f="";
-		for (int i = 0; i < length; i++)
-		{
-			f += (char)is.readUnsignedByte();
-		}
-		viewer.ftp.refreshRemoteLocation();	
-		viewer.ftp.historyComboBox.insertItemAt(new String(" > Created Directory on Remote Machine: " + f.substring(0, f.length()-1)),0);
-		viewer.ftp.historyComboBox.setSelectedIndex(0);
-	}
-
-	//Call this method to create a directory at server
-	void createRemoteDirectory(String text)
-	{
-		try
-		{
-			String temp = text;
-			writeRfbFileTransferMsg(
-				rfbCommand,
-				rfbCDirCreate,
-				0,
-				temp.length(),
-				temp);
-		}
-		catch (IOException e)
-		{
-			System.err.println(e);
-		}
-	}
-
-	//Call this method to get a file from the server
-	void requestRemoteFile(String text, String localPath)
-	{
-		try
-		{
-			String temp = text;
-			receivePath = localPath;
-					
-			writeRfbFileTransferMsg(
-									rfbFileTransferRequest,
-									0,
-									1, // 0 : compression not supported - 1 : compression supported
-									temp.length(),
-									temp);
-		}
-		catch (IOException e)
-		{
-			System.err.println(e);
-		}
-	}
-
-	//Internally used when transferring file from server. Here, the server sends
-	//a rfb packet signalling that it is ready to send the file requested
-	void receiveFileHeader() throws IOException
-	{
-		fFileReceptionRunning = true;
-		fFileReceptionError = false;
-		viewer.ftp.disableButtons();
-		int size = is.readInt();
-		int length = is.readInt();
-		
-		String tempName = "";
-		for (int i = 0; i < length; i++)
-		{
-			tempName += (char) is.readUnsignedByte();
-		}
-
-		// sf at 2004 - Read the high part of file size (not yet in rfbFileTransferMsg for 
-		// backward compatibility reasons...)
-		int sizeH = is.readInt();
-		long lSize = ((long)(sizeH) << 32) + size;
-		
-		receiveFileSize = lSize;
-		viewer.ftp.connectionStatus.setText("Received: 0 bytes of " + lSize + " bytes");
-		fileSize=0;
-		fileChunkCounter = 0;
-		String fileName = receivePath;
-		fos = new FileOutputStream(fileName);
-		writeRfbFileTransferMsg(rfbFileHeader, 0, 0, 0, null);
-	}
-
-	//Internally used when transferring file from server. This method receives one chunk
-	//of the file
-	void receiveFileChunk() throws IOException
-	{
-		// sf at 2004 - Size = 0 means file chunck not compressed
-		int size = is.readInt();
-		boolean fCompressed = (size != 0);
-		int length = is.readInt();
-		fileChunkCounter++;
-
-		// sf at 2004 - allocates buffers for file chunck reception and decompression 
-		byte[] ReceptionBuffer = new byte[length + 32];
-
-		// Read the incoming file data
-		// Todo: check error !
-		is.readFully(ReceptionBuffer,0, length);
-		
-		if (fCompressed)
-		{
-			int bufSize = sz_rfbBlockSize + 1024; // Todo: set a more accurate value here
-			int decompressedSize = 0;
-			byte[] DecompressionBuffer = new byte[bufSize];
-			Inflater myInflater = new Inflater();
-			myInflater.setInput(ReceptionBuffer);
-			try
-			{
-				decompressedSize = myInflater.inflate(DecompressionBuffer);
-			}
-			catch (DataFormatException e)
-			{
-				System.err.println(e);
-			}
-			// Todo: check error !
-			fos.write(DecompressionBuffer, 0, decompressedSize);
-			fileSize += decompressedSize;
-		}
-		else
-		{
-			//	 Todo: check error !
-			fos.write(ReceptionBuffer, 0, length);
-			fileSize += length;
-		}
-		
-		/*
-		for (int i = 0; i < length; i++) 
-		{
-			fos.write(is.readUnsignedByte());
-			fileSize++;
-		}
-		*/
-		
-		// viewer.ftp.connectionStatus.setText("Received: " + fileSize + " bytes of "+ receiveFileSize+ " bytes" );
-		viewer.ftp.jProgressBar.setValue((int)((fileSize * 100) / receiveFileSize));
-		viewer.ftp.connectionStatus.setText(">>> Receiving File: " + receivePath + " - Size: " + receiveFileSize + " bytes - Progress: " + ((fileSize * 100) / receiveFileSize) + "%");
-		
-		if (fAbort == true)
-		{
-			fAbort = false;
-			fFileReceptionError = true;
-			writeRfbFileTransferMsg(rfbAbortFileTransfer, 0, 0, 0, null);
-			
-		}
-		// sf at 2004 - For old FT protocole only
-		/*
-		if(fileChunkCounter==10)
-		{
-			writeRfbFileTransferMsg(rfbFileHeader,0,0,0,null);
-			fileChunkCounter=0;
-		}
-		*/
-	}
-	
-	//Internally used when transferring file from server. Server signals end of file.
-	void endOfReceiveFile(boolean fReceptionOk) throws IOException
-	{
-		int size = is.readInt();
-		int length = is.readInt();
-		fileSize=0;
-		fos.close();
-		
-		viewer.ftp.refreshLocalLocation();
-		if (fReceptionOk && !fFileReceptionError)
-		{
-			viewer.ftp.connectionStatus.setText(" > File successfully received");
-			viewer.ftp.historyComboBox.insertItemAt(new String(" > File: <" + receivePath + "> received from Remote Machine" ),0);
-		}
-		else
-		{
-			// sf at 2004 - Delete the incomplete receieved file for now (until we use Delta Transfer)
-			File f = new File(receivePath);
-			f.delete();		
-			viewer.ftp.connectionStatus.setText(" > Error - File NOT received");
-			viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - File: <" + receivePath + "> not correctly received from Remote Machine (aborted by user or error)") ,0);
-		}
-
-		fFileReceptionError = false;
-		fFileReceptionRunning = false;
-		viewer.ftp.historyComboBox.setSelectedIndex(0);
-		viewer.ftp.enableButtons();
-	}
-
-	//Call this method to read the contents of the server directory
-	void readServerDirectory(String text)
-	{
-		try
-		{
-			String temp = text;
-			writeRfbFileTransferMsg(
-									rfbDirContentRequest,
-									rfbRDirContent,
-									0,
-									temp.length(),
-									temp);
-		}
-		catch (IOException e)
-		{
-			System.out.println("IOException in readServerDirectory(String text) in RfbProto!");
-			System.out.println(e);
-			System.out.println("End of exception");
-		}
-
-	}
-
-	//Internally used to receive list of drives available on the server
-	void readFTPMsgDriveList() throws IOException
-	{
-		String str = "";
-		for (int i = 0; i < 4; i++)
-		{
-			is.readUnsignedByte();
-		}
-		int length = is.readInt();
-		for (int i = 0; i < length; i++)
-		{
-			char temp = (char) is.readUnsignedByte();
-			if (temp != '\0')
-			{
-				str += temp;
-			}
-		}
-		viewer.ftp.printDrives(str);
-		
-		// sf at 2004
-		// Finds the first readable drive and populates the local directory
-		viewer.ftp.changeLocalDirectory(viewer.ftp.getFirstReadableLocalDrive());
-		// Populate the remote directory
-		viewer.ftp.changeRemoteDrive();
-		viewer.ftp.refreshRemoteLocation();
-
-	}
-
-	//Internally used to receive directory content from server
-	//Here, the server marks the start of the directory listing
-	void readFTPMsgDirectoryList() throws IOException
-	{
-		is.readInt();
-		int length = is.readInt();
-		if (length == 0)
-		{
-			readFTPMsgDirectorydriveNotReady();
-			inDirectory2 = false;
-		}
-		else
-		{
-			// sf at 2004 - New FT protocole sends remote directory name
-			String str = "";
-			for (int i = 0; i < length; i++)
-			{
-				char temp = (char) is.readUnsignedByte();
-				if (temp != '\0')
-				{
-					str += temp;
-				}
-			}
-			// viewer.ftp.changeRemoteDirectory(str);
-
-		}
-	}
-
-	//Internally used to receive directory content from server
-	//Here, the server sends one file/directory with it's attributes
-	void readFTPMsgDirectoryListContent() throws IOException
-	{
-		String fileName = "", alternateFileName = "";
-		byte contentType = 0;
-		int contentParamT = 0;
-		int contentParam = 0;
-		byte temp = 0;
-		int dwFileAttributes,
-			nFileSizeHigh,
-			nFileSizeLow,
-			dwReserved0,
-			dwReserved1;
-		long ftCreationTime, ftLastAccessTime, ftLastWriteTime;
-		char cFileName, cAlternateFileName;
-		int length = 0;
-		is.readInt();
-		length = is.readInt();
-		dwFileAttributes = is.readInt();
-		length -= 4;
-		ftCreationTime = is.readLong();
-		length -= 8;
-		ftLastAccessTime = is.readLong();
-		length -= 8;
-		ftLastWriteTime = is.readLong();
-		length -= 8;
-		nFileSizeHigh = is.readInt();
-		length -= 4;
-		nFileSizeLow = is.readInt();
-		length -= 4;
-		dwReserved0 = is.readInt();
-		length -= 4;
-		dwReserved1 = is.readInt();
-		length -= 4;
-		cFileName = (char) is.readUnsignedByte();
-		length--;
-		while (cFileName != '\0')
-		{
-			fileName += cFileName;
-			cFileName = (char) is.readUnsignedByte();
-			length--;
-		}
-		cAlternateFileName = (char) is.readByte();
-		length--;
-		while (length != 0)
-		{
-			alternateFileName += cAlternateFileName;
-			cAlternateFileName = (char) is.readUnsignedByte();
-			length--;
-		}
-		//System.out.println("fileName= " + fileName);
-		//System.out.println("dwFileAttributes= " + dwFileAttributes);
-                /*
-		if (dwFileAttributes == 268435456
-			|| dwFileAttributes == 369098752
-			|| dwFileAttributes == 285212672
-			|| dwFileAttributes == 271056896
-			|| dwFileAttributes == 824705024
-			||	dwFileAttributes == 807927808
-			|| dwFileAttributes == 371720192
-			|| dwFileAttributes == 369623040
-			|| dwFileAttributes == 805306368) // Fix: troessner
-		*/
-		// Added Jef Fix (jdp) - check for FILE_ATTRIBUTE_DIRECTORY attribute bit
-		// note that we're looking at a little-endian value in a big-endian world
-		if ((dwFileAttributes & 0x10000000) == 0x10000000)
- 		{
- 			fileName = " [" + fileName + "]";
- 			remoteDirsList.add(fileName); // sf at 2004
-		}
-		else
-		{
-			remoteFilesList.add(" " + fileName); // sf at 2004
-		}
-
-		// a.add(fileName);
-	}
-
-	//Internally used to read directory content of server.
-	//Here, server signals end of directory.
-	void readFTPMsgDirectoryListEndContent() throws IOException
-	{
-		is.readInt();
-		int length = is.readInt();
-
-		// sf at 2004
-		a.clear();
-		for (int i = 0; i < remoteDirsList.size(); i++) 
-			a.add(remoteDirsList.get(i));
-		for (int i = 0; i < remoteFilesList.size(); i++) 
-			a.add(remoteFilesList.get(i));
-		remoteDirsList.clear();
-		remoteFilesList.clear();
-		
-		viewer.ftp.printRemoteDirectory(a);
-	}
-
-	//Internally used to signify the drive requested is not ready
-
-	void readFTPMsgDirectorydriveNotReady() throws IOException
-	{
-		System.out.println("Remote Drive unavailable");
-		viewer.ftp.connectionStatus.setText(" > WARNING - Remote Drive unavailable (possibly restricted access or media not present)");
-		viewer.ftp.remoteStatus.setText("WARNING: Remote Drive unavailable");
-	}
-
-	//Call this method to request the list of drives on the server.
-	void readServerDriveList()
-	{
-		try
-		{
-			viewer.rfb.writeRfbFileTransferMsg(
-												RfbProto.rfbDirContentRequest,
-												RfbProto.rfbRDrivesList,
-												0,
-												0,
-												null);
-		}
-		catch (IOException e)
-		{
-			System.err.println(e);
-		}
-	}
-
-	// sf at 2004 - Read the destination file checksums data
-	// We don't use it for now
-	void ReceiveDestinationFileChecksums() throws IOException
-	{
-		int size = is.readInt();
-		int length = is.readInt();
-		
-		byte[] ReceptionBuffer = new byte[length + 32];
-
-		// Read the incoming file data
-		is.readFully(ReceptionBuffer,0, length);
-
-		/*
-		String csData = "";
-		for (int i = 0; i < length; i++)
-		{
-			csData += (char) is.readUnsignedByte();
-		}
-		*/
-	
-		// viewer.ftp.connectionStatus.setText("Received: 0 bytes of " + size + " bytes");
-	}
-	
-	///////////////////////////////////////////////////////////////////////////////////////////////
-	//////////////////////////////////////////////////////////////////////////
-	//
-	// Write a FramebufferUpdateRequest message
-	//
-
-	void writeFramebufferUpdateRequest(
-		int x,
-		int y,
-		int w,
-		int h,
-		boolean incremental)
-		throws IOException {
-			if (!viewer.ftp.isVisible()) {
-		byte[] b = new byte[10];
-
-		b[0] = (byte) FramebufferUpdateRequest;
-		b[1] = (byte) (incremental ? 1 : 0);
-		b[2] = (byte) ((x >> 8) & 0xff);
-		b[3] = (byte) (x & 0xff);
-		b[4] = (byte) ((y >> 8) & 0xff);
-		b[5] = (byte) (y & 0xff);
-		b[6] = (byte) ((w >> 8) & 0xff);
-		b[7] = (byte) (w & 0xff);
-		b[8] = (byte) ((h >> 8) & 0xff);
-		b[9] = (byte) (h & 0xff);
-
-		os.write(b);
-		}
-	}
-
-	//
-	// Write a SetPixelFormat message
-	//
-
-	void writeSetPixelFormat(
-		int bitsPerPixel,
-		int depth,
-		boolean bigEndian,
-		boolean trueColour,
-		int redMax,
-		int greenMax,
-		int blueMax,
-		int redShift,
-		int greenShift,
-		int blueShift,
-		boolean fGreyScale) // sf at 2005
-		throws IOException {
-		byte[] b = new byte[20];
-
-		b[0] = (byte) SetPixelFormat;
-		b[4] = (byte) bitsPerPixel;
-		b[5] = (byte) depth;
-		b[6] = (byte) (bigEndian ? 1 : 0);
-		b[7] = (byte) (trueColour ? 1 : 0);
-		b[8] = (byte) ((redMax >> 8) & 0xff);
-		b[9] = (byte) (redMax & 0xff);
-		b[10] = (byte) ((greenMax >> 8) & 0xff);
-		b[11] = (byte) (greenMax & 0xff);
-		b[12] = (byte) ((blueMax >> 8) & 0xff);
-		b[13] = (byte) (blueMax & 0xff);
-		b[14] = (byte) redShift;
-		b[15] = (byte) greenShift;
-		b[16] = (byte) blueShift;
-		b[17] = (byte) (fGreyScale ? 1 : 0); // sf at 2005
-
-		os.write(b);
-
-	}
-
-	//
-	// Write a FixColourMapEntries message.  The values in the red, green and
-	// blue arrays are from 0 to 65535.
-	//
-
-	void writeFixColourMapEntries(
-		int firstColour,
-		int nColours,
-		int[] red,
-		int[] green,
-		int[] blue)
-		throws IOException {
-		byte[] b = new byte[6 + nColours * 6];
-
-		b[0] = (byte) FixColourMapEntries;
-		b[2] = (byte) ((firstColour >> 8) & 0xff);
-		b[3] = (byte) (firstColour & 0xff);
-		b[4] = (byte) ((nColours >> 8) & 0xff);
-		b[5] = (byte) (nColours & 0xff);
-
-		for (int i = 0; i < nColours; i++) {
-			b[6 + i * 6] = (byte) ((red[i] >> 8) & 0xff);
-			b[6 + i * 6 + 1] = (byte) (red[i] & 0xff);
-			b[6 + i * 6 + 2] = (byte) ((green[i] >> 8) & 0xff);
-			b[6 + i * 6 + 3] = (byte) (green[i] & 0xff);
-			b[6 + i * 6 + 4] = (byte) ((blue[i] >> 8) & 0xff);
-			b[6 + i * 6 + 5] = (byte) (blue[i] & 0xff);
-		}
-
-		os.write(b);
-
-	}
-
-	//
-	// Write a SetEncodings message
-	//
-
-	void writeSetEncodings(int[] encs, int len) throws IOException {
-		byte[] b = new byte[4 + 4 * len];
-
-		b[0] = (byte) SetEncodings;
-		b[2] = (byte) ((len >> 8) & 0xff);
-		b[3] = (byte) (len & 0xff);
-
-		for (int i = 0; i < len; i++) {
-			b[4 + 4 * i] = (byte) ((encs[i] >> 24) & 0xff);
-			b[5 + 4 * i] = (byte) ((encs[i] >> 16) & 0xff);
-			b[6 + 4 * i] = (byte) ((encs[i] >> 8) & 0xff);
-			b[7 + 4 * i] = (byte) (encs[i] & 0xff);
-		}
-
-		os.write(b);
-
-	}
-
-	//
-	// Write a ClientCutText message
-	//
-
-	void writeClientCutText(String text) throws IOException {
-	//	if (!viewer.ftp.isVisible()) {
-
-		byte[] b = new byte[8 + text.length()];
-
-		b[0] = (byte) ClientCutText;
-		b[4] = (byte) ((text.length() >> 24) & 0xff);
-		b[5] = (byte) ((text.length() >> 16) & 0xff);
-		b[6] = (byte) ((text.length() >> 8) & 0xff);
-		b[7] = (byte) (text.length() & 0xff);
-
-		System.arraycopy(text.getBytes(), 0, b, 8, text.length());
-
-		os.write(b);
-	//	}
-	}
-
-	//
-	// A buffer for putting pointer and keyboard events before being sent.  This
-	// is to ensure that multiple RFB events generated from a single Java Event 
-	// will all be sent in a single network packet.  The maximum possible
-	// length is 4 modifier down events, a single key event followed by 4
-	// modifier up events i.e. 9 key events or 72 bytes.
-	//
-
-	byte[] eventBuf = new byte[72];
-	int eventBufLen;
-
-	// Useful shortcuts for modifier masks.
-
-	final static int CTRL_MASK = InputEvent.CTRL_MASK;
-	final static int SHIFT_MASK = InputEvent.SHIFT_MASK;
-	final static int META_MASK = InputEvent.META_MASK;
-	final static int ALT_MASK = InputEvent.ALT_MASK;
-
-	void writeWheelEvent(MouseWheelEvent evt) throws IOException {
-
-		eventBufLen = 0;
-
-		int x = evt.getX();
-		int y = evt.getY();
-
-		if (x < 0) x = 0;
-		if (y < 0) y = 0;
-
-		int ptrmask;
-
-		int clicks = evt.getWheelRotation();
-		System.out.println("writeWheelEvent: clicks: " + clicks);
-		if (clicks > 0) {
-			ptrmask = 16;
-		} else if (clicks < 0) {
-			ptrmask = 8;
-		} else {
-			return;
-		}
-
-		eventBuf[eventBufLen++] = (byte) PointerEvent;
-		eventBuf[eventBufLen++] = (byte) ptrmask;
-		eventBuf[eventBufLen++] = (byte) ((x >> 8) & 0xff);
-		eventBuf[eventBufLen++] = (byte) (x & 0xff);
-		eventBuf[eventBufLen++] = (byte) ((y >> 8) & 0xff);
-		eventBuf[eventBufLen++] = (byte) (y & 0xff);
-
-		os.write(eventBuf, 0, eventBufLen);
-	}
-
-	//
-	// Write a pointer event message.  We may need to send modifier key events
-	// around it to set the correct modifier state.
-	//
-
-	int pointerMask = 0;
-
-	void writePointerEvent(MouseEvent evt) throws IOException {
-		if (!viewer.ftp.isVisible()) {
-		int modifiers = evt.getModifiers();
-
-		int mask2 = 2;
-		int mask3 = 4;
-		if (viewer.options.reverseMouseButtons2And3) {
-			mask2 = 4;
-			mask3 = 2;
-		}
-
-		// Note: For some reason, AWT does not set BUTTON1_MASK on left
-		// button presses. Here we think that it was the left button if
-		// modifiers do not include BUTTON2_MASK or BUTTON3_MASK.
-
-		if (evt.getID() == MouseEvent.MOUSE_PRESSED) {
-			if ((modifiers & InputEvent.BUTTON2_MASK) != 0) {
-				pointerMask = mask2;
-				modifiers &= ~ALT_MASK;
-			} else if ((modifiers & InputEvent.BUTTON3_MASK) != 0) {
-				pointerMask = mask3;
-				modifiers &= ~META_MASK;
-			} else {
-				pointerMask = 1;
-			}
-		} else if (evt.getID() == MouseEvent.MOUSE_RELEASED) {
-			pointerMask = 0;
-			if ((modifiers & InputEvent.BUTTON2_MASK) != 0) {
-				modifiers &= ~ALT_MASK;
-			} else if ((modifiers & InputEvent.BUTTON3_MASK) != 0) {
-				modifiers &= ~META_MASK;
-			}
-		}
-
-		eventBufLen = 0;
-		writeModifierKeyEvents(modifiers);
-
-		int x = evt.getX();
-		int y = evt.getY();
-
-		if (x < 0)
-			x = 0;
-		if (y < 0)
-			y = 0;
-
-		eventBuf[eventBufLen++] = (byte) PointerEvent;
-		eventBuf[eventBufLen++] = (byte) pointerMask;
-		eventBuf[eventBufLen++] = (byte) ((x >> 8) & 0xff);
-		eventBuf[eventBufLen++] = (byte) (x & 0xff);
-		eventBuf[eventBufLen++] = (byte) ((y >> 8) & 0xff);
-		eventBuf[eventBufLen++] = (byte) (y & 0xff);
-
-		//
-		// Always release all modifiers after an "up" event
-		//
-
-		if (pointerMask == 0) {
-			writeModifierKeyEvents(0);
-		}
-
-		os.write(eventBuf, 0, eventBufLen);
-		}
-	}
-
-	//
-	// Write a key event message.  We may need to send modifier key events
-	// around it to set the correct modifier state.  Also we need to translate
-	// from the Java key values to the X keysym values used by the RFB protocol.
-	//
-
-	void writeKeyEvent(KeyEvent evt) throws IOException {
-		if (!viewer.ftp.isVisible()) {
-		int keyChar = evt.getKeyChar();
-
-		//
-		// Ignore event if only modifiers were pressed.
-		//
-
-		// Some JVMs return 0 instead of CHAR_UNDEFINED in getKeyChar().
-		if (keyChar == 0)
-			keyChar = KeyEvent.CHAR_UNDEFINED;
-
-		if (keyChar == KeyEvent.CHAR_UNDEFINED) {
-			int code = evt.getKeyCode();
-			if (code == KeyEvent.VK_CONTROL
-				|| code == KeyEvent.VK_SHIFT
-				|| code == KeyEvent.VK_META
-				|| code == KeyEvent.VK_ALT)
-				return;
-		}
-
-		//
-		// Key press or key release?
-		//
-
-		boolean down = (evt.getID() == KeyEvent.KEY_PRESSED);
-
-		int key;
-		if (evt.isActionKey()) {
-
-			//
-			// An action key should be one of the following.
-			// If not then just ignore the event.
-			//
-
-			switch (evt.getKeyCode()) {
-				case KeyEvent.VK_HOME :
-					key = 0xff50;
-					break;
-				case KeyEvent.VK_LEFT :
-					key = 0xff51;
-					break;
-				case KeyEvent.VK_UP :
-					key = 0xff52;
-					break;
-				case KeyEvent.VK_RIGHT :
-					key = 0xff53;
-					break;
-				case KeyEvent.VK_DOWN :
-					key = 0xff54;
-					break;
-				case KeyEvent.VK_PAGE_UP :
-					key = 0xff55;
-					break;
-				case KeyEvent.VK_PAGE_DOWN :
-					key = 0xff56;
-					break;
-				case KeyEvent.VK_END :
-					key = 0xff57;
-					break;
-				case KeyEvent.VK_INSERT :
-					key = 0xff63;
-					break;
-				case KeyEvent.VK_F1 :
-					key = 0xffbe;
-					break;
-				case KeyEvent.VK_F2 :
-					key = 0xffbf;
-					break;
-				case KeyEvent.VK_F3 :
-					key = 0xffc0;
-					break;
-				case KeyEvent.VK_F4 :
-					key = 0xffc1;
-					break;
-				case KeyEvent.VK_F5 :
-					key = 0xffc2;
-					break;
-				case KeyEvent.VK_F6 :
-					key = 0xffc3;
-					break;
-				case KeyEvent.VK_F7 :
-					key = 0xffc4;
-					break;
-				case KeyEvent.VK_F8 :
-					key = 0xffc5;
-					break;
-				case KeyEvent.VK_F9 :
-					key = 0xffc6;
-					break;
-				case KeyEvent.VK_F10 :
-					key = 0xffc7;
-					break;
-				case KeyEvent.VK_F11 :
-					key = 0xffc8;
-					break;
-				case KeyEvent.VK_F12 :
-					key = 0xffc9;
-					break;
-			    /*
-			     * EDIT troessner start
-			     */
-			     /*
-				case KeyEvent.VK_WINDOWS:
-					key = 0xFFEB;
-					break;
-			     */
-			    /*
-			     * EDIT troessner end
-			     */	
-				default :
-					return;
-			}
-
-		} else {
-
-			//
-			// A "normal" key press.  Ordinary ASCII characters go straight through.
-			// For CTRL-<letter>, CTRL is sent separately so just send <letter>.
-			// Backspace, tab, return, escape and delete have special keysyms.
-			// Anything else we ignore.
-			//
-
-			key = keyChar;
-
-			if (key < 0x20) {
-				if (evt.isControlDown()) {
-					key += 0x60;
-				} else {
-					switch (key) {
-						case KeyEvent.VK_BACK_SPACE :
-							key = 0xff08;
-							break;
-						case KeyEvent.VK_TAB :
-							key = 0xff09;
-							break;
-						case KeyEvent.VK_ENTER :
-							key = 0xff0d;
-							break;
-						case KeyEvent.VK_ESCAPE :
-							key = 0xff1b;
-							break;
-					}
-				}
-			} else if (key == 0x7f) {
-				// Delete
-				key = 0xffff;
-			} else if (key > 0xff) {
-				// JDK1.1 on X incorrectly passes some keysyms straight through,
-				// so we do too.  JDK1.1.4 seems to have fixed this.
-				// The keysyms passed are 0xff00 .. XK_BackSpace .. XK_Delete
-				if ((key < 0xff00) || (key > 0xffff))
-					return;
-			}
-		}
-
-		// Fake keyPresses for keys that only generates keyRelease events
-		if ((key == 0xe5)
-			|| (key == 0xc5)
-			|| // XK_aring / XK_Aring
-		 (key == 0xe4)
-			|| (key == 0xc4)
-			|| // XK_adiaeresis / XK_Adiaeresis
-		 (key == 0xf6)
-			|| (key == 0xd6)
-			|| // XK_odiaeresis / XK_Odiaeresis
-		 (key == 0xa7)
-			|| (key == 0xbd)
-			|| // XK_section / XK_onehalf
-		 (key == 0xa3)) { // XK_sterling
-			// Make sure we do not send keypress events twice on platforms
-			// with correct JVMs (those that actually report KeyPress for all
-			// keys)	
-			if (down)
-				brokenKeyPressed = true;
-
-			if (!down && !brokenKeyPressed) {
-				// We've got a release event for this key, but haven't received
-				// a press. Fake it. 
-				eventBufLen = 0;
-				writeModifierKeyEvents(evt.getModifiers());
-				writeKeyEvent(key, true);
-				os.write(eventBuf, 0, eventBufLen);
-			}
-
-			if (!down)
-				brokenKeyPressed = false;
-		}
-
-		eventBufLen = 0;
-		writeModifierKeyEvents(evt.getModifiers());
-		writeKeyEvent(key, down);
-
-		// Always release all modifiers after an "up" event
-		if (!down)
-			writeModifierKeyEvents(0);
-
-		os.write(eventBuf, 0, eventBufLen);
-		}
-	}
-	//
-	// Add a raw key event with the given X keysym to eventBuf.
-	//
-
-	void writeKeyEvent(int keysym, boolean down) {
-		eventBuf[eventBufLen++] = (byte) KeyboardEvent;
-		eventBuf[eventBufLen++] = (byte) (down ? 1 : 0);
-		eventBuf[eventBufLen++] = (byte) 0;
-		eventBuf[eventBufLen++] = (byte) 0;
-		eventBuf[eventBufLen++] = (byte) ((keysym >> 24) & 0xff);
-		eventBuf[eventBufLen++] = (byte) ((keysym >> 16) & 0xff);
-		eventBuf[eventBufLen++] = (byte) ((keysym >> 8) & 0xff);
-		eventBuf[eventBufLen++] = (byte) (keysym & 0xff);
-	}
-
-	//
-	// Write key events to set the correct modifier state.
-	//
-
-	int oldModifiers = 0;
-
-	void writeModifierKeyEvents(int newModifiers) {
-		if ((newModifiers & CTRL_MASK) != (oldModifiers & CTRL_MASK))
-			writeKeyEvent(0xffe3, (newModifiers & CTRL_MASK) != 0);
-
-		if ((newModifiers & SHIFT_MASK) != (oldModifiers & SHIFT_MASK))
-			writeKeyEvent(0xffe1, (newModifiers & SHIFT_MASK) != 0);
-
-		if ((newModifiers & META_MASK) != (oldModifiers & META_MASK))
-			writeKeyEvent(0xffe7, (newModifiers & META_MASK) != 0);
-
-		if ((newModifiers & ALT_MASK) != (oldModifiers & ALT_MASK))
-			writeKeyEvent(0xffe9, (newModifiers & ALT_MASK) != 0);
-
-		oldModifiers = newModifiers;
-	}
-
-	//
-	// Compress and write the data into the recorded session file. This
-	// method assumes the recording is on (rec != null).
-	//
-
-	void recordCompressedData(byte[] data, int off, int len)
-		throws IOException {
-		Deflater deflater = new Deflater();
-		deflater.setInput(data, off, len);
-		int bufSize = len + len / 100 + 12;
-		byte[] buf = new byte[bufSize];
-		deflater.finish();
-		int compressedSize = deflater.deflate(buf);
-		recordCompactLen(compressedSize);
-		rec.write(buf, 0, compressedSize);
-	}
-
-	void recordCompressedData(byte[] data) throws IOException {
-		recordCompressedData(data, 0, data.length);
-	}
-
-	//
-	// Write an integer in compact representation (1..3 bytes) into the
-	// recorded session file. This method assumes the recording is on
-	// (rec != null).
-	//
-
-	void recordCompactLen(int len) throws IOException {
-		byte[] buf = new byte[3];
-		int bytes = 0;
-		buf[bytes++] = (byte) (len & 0x7F);
-		if (len > 0x7F) {
-			buf[bytes - 1] |= 0x80;
-			buf[bytes++] = (byte) (len >> 7 & 0x7F);
-			if (len > 0x3FFF) {
-				buf[bytes - 1] |= 0x80;
-				buf[bytes++] = (byte) (len >> 14 & 0xFF);
-			}
-		}
-		rec.write(buf, 0, bytes);
-	}
-}
diff --git a/ica/JavaViewer/SessionRecorder.java b/ica/JavaViewer/SessionRecorder.java
deleted file mode 100644
index b6a593d..0000000
--- a/ica/JavaViewer/SessionRecorder.java
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-//  Copyright (C) 2002 Constantin Kaplinsky.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// SessionRecorder is a class to write FBS (FrameBuffer Stream) files.
-// FBS files are used to save RFB sessions for later playback.
-//
-
-import java.io.*;
-
-class SessionRecorder {
-
-  protected FileOutputStream f;
-  protected DataOutputStream df;
-  protected long startTime, lastTimeOffset;
-
-  protected byte[] buffer;
-  protected int bufferSize;
-  protected int bufferBytes;
-
-  public SessionRecorder(String name, int bufsize) throws IOException {
-    f = new FileOutputStream(name);
-    df = new DataOutputStream(f);
-    startTime = System.currentTimeMillis();
-    lastTimeOffset = 0;
-    
-    bufferSize = bufsize;
-    bufferBytes = 0;
-    buffer = new byte[bufferSize];
-  }
-
-  public SessionRecorder(String name) throws IOException {
-    this(name, 65536);
-  }
-
-  //
-  // Close the file, free resources.
-  //
-
-  public void close() throws IOException {
-    try {
-      flush();
-    } catch (IOException e) {
-    }
-
-    df = null;
-    f.close();
-    f = null;
-    buffer = null;
-  }
-
-  //
-  // Write the FBS file header as defined in the rfbproxy utility.
-  //
-
-  public void writeHeader() throws IOException {
-    df.write("FBS 001.000\n".getBytes());
-  }
-
-  //
-  // Write one byte.
-  //
-
-  public void writeByte(int b) throws IOException {
-    prepareWriting();
-    buffer[bufferBytes++] = (byte)b;
-  }
-
-  //
-  // Write 16-bit value, big-endian.
-  //
-
-  public void writeShortBE(int v) throws IOException {
-    prepareWriting();
-    buffer[bufferBytes++] = (byte)(v >> 8);
-    buffer[bufferBytes++] = (byte)v;
-  }
-
-  //
-  // Write 32-bit value, big-endian.
-  //
-
-  public void writeIntBE(int v) throws IOException {
-    prepareWriting();
-    buffer[bufferBytes]     = (byte)(v >> 24);
-    buffer[bufferBytes + 1] = (byte)(v >> 16);
-    buffer[bufferBytes + 2] = (byte)(v >> 8);
-    buffer[bufferBytes + 3] = (byte)v;
-    bufferBytes += 4;
-  }
-
-  //
-  // Write 16-bit value, little-endian.
-  //
-
-  public void writeShortLE(int v) throws IOException {
-    prepareWriting();
-    buffer[bufferBytes++] = (byte)v;
-    buffer[bufferBytes++] = (byte)(v >> 8);
-  }
-
-  //
-  // Write 32-bit value, little-endian.
-  //
-
-  public void writeIntLE(int v) throws IOException {
-    prepareWriting();
-    buffer[bufferBytes]     = (byte)v;
-    buffer[bufferBytes + 1] = (byte)(v >> 8);
-    buffer[bufferBytes + 2] = (byte)(v >> 16);
-    buffer[bufferBytes + 3] = (byte)(v >> 24);
-    bufferBytes += 4;
-  }
-
-  //
-  // Write byte arrays.
-  //
-
-  public void write(byte b[], int off, int len) throws IOException {
-    prepareWriting();
-    while (len > 0) {
-      if (bufferBytes > bufferSize - 4)
-	flush(false);
-
-      int partLen;
-      if (bufferBytes + len > bufferSize) {
-	partLen = bufferSize - bufferBytes;
-      } else {
-	partLen = len;
-      }
-      System.arraycopy(b, off, buffer, bufferBytes, partLen);
-      bufferBytes += partLen;
-      off += partLen;
-      len -= partLen;
-    }
-  }
-
-  public void write(byte b[]) throws IOException {
-    write(b, 0, b.length);
-  }
-
-  //
-  // Flush the output. This method saves buffered data in the
-  // underlying file object adding data sizes and timestamps. If the
-  // updateTimeOffset is set to false, then the current time offset
-  // will not be changed for next write operation.
-  //
-
-  public void flush(boolean updateTimeOffset) throws IOException {
-    if (bufferBytes > 0) {
-      df.writeInt(bufferBytes);
-      df.write(buffer, 0, (bufferBytes + 3) & 0x7FFFFFFC);
-      df.writeInt((int)lastTimeOffset);
-      bufferBytes = 0;
-      if (updateTimeOffset)
-	lastTimeOffset = -1;
-    }
-  }
-
-  public void flush() throws IOException {
-    flush(true);
-  }
-
-  //
-  // Before writing any data, remember time offset and flush the
-  // buffer before it becomes full.
-  //
-
-  protected void prepareWriting() throws IOException {
-    if (lastTimeOffset == -1)
-      lastTimeOffset = System.currentTimeMillis() - startTime;
-    if (bufferBytes > bufferSize - 4)
-      flush(false);
-  }
-
-}
-
diff --git a/ica/JavaViewer/VncCanvas.java b/ica/JavaViewer/VncCanvas.java
deleted file mode 100644
index 78562b6..0000000
--- a/ica/JavaViewer/VncCanvas.java
+++ /dev/null
@@ -1,1698 +0,0 @@
-//
-//  Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
-//  Copyright (C) 2001,2002 Constantin Kaplinsky.  All Rights Reserved.
-//  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-import java.io.*;
-import java.lang.*;
-import java.util.zip.*;
-
-import java.util.Collections;
-
-//
-// VncCanvas is a subclass of Canvas which draws a VNC desktop on it.
-//
-
-class VncCanvas
-	extends Canvas
-	implements KeyListener, MouseListener, MouseMotionListener, MouseWheelListener {
-
-	VncViewer viewer;
-	RfbProto rfb;
-	ColorModel cm8_256c, cm8_64c, cm8_8c, cm24;
-	Color[] colors;
-	int bytesPixel;
-
-	Image memImage;
-	Graphics memGraphics;
-
-	Image rawPixelsImage;
-	MemoryImageSource pixelsSource;
-	byte[] pixels8;
-	int[] pixels24;
-
-	// Zlib encoder's data.
-	byte[] zlibBuf;
-	int zlibBufLen = 0;
-	Inflater zlibInflater;
-
-	// Tight encoder's data.
-	final static int tightZlibBufferSize = 512;
-	Inflater[] tightInflaters;
-
-	// Since JPEG images are loaded asynchronously, we have to remember
-	// their position in the framebuffer. Also, this jpegRect object is
-	// used for synchronization between the rfbThread and a JVM's thread
-	// which decodes and loads JPEG images.
-	Rectangle jpegRect;
-
-	// True if we process keyboard and mouse events.
-	boolean inputEnabled;
-	
-	//
-	// The constructor.
-	//
-
-	VncCanvas(VncViewer v) throws IOException {
-		viewer = v;
-		rfb = viewer.rfb;
-
-		tightInflaters = new Inflater[4];
-
-		// sf at 2005 - Adding more color modes
-		cm8_256c = new DirectColorModel(8, 7, (7 << 3), (3 << 6));
-		cm8_64c = new DirectColorModel(8, (3 << 4), (3 << 2), (3 << 0));
-		cm8_8c = new DirectColorModel(8, (1 << 2), (1 << 1), (1 << 0));
-		
-		cm24 = new DirectColorModel(24, 0xFF0000, 0x00FF00, 0x0000FF);
-
-    // kludge to not show any Java cursor in the canvas since we are
-    // showing the soft cursor (should be a user setting...)
-/*    Cursor dot = Toolkit.getDefaultToolkit().createCustomCursor(
-        Toolkit.getDefaultToolkit().createImage(new byte[4]), new Point(0,0),
-        "dot");
-    this.setCursor(dot);*/
-
-    // while we are at it... get rid of the keyboard traversals that
-    // make it so we can't type a Tab character:
-    this.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
-        Collections.EMPTY_SET);
-    this.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
-        Collections.EMPTY_SET);
-
-		colors = new Color[256];
-		// sf at 2005 - Now Default
-		for (int i = 0; i < 256; i++)
-			colors[i] = new Color(cm8_256c.getRGB(i));
-
-		setPixelFormat();
-
-		inputEnabled = false;
-		if (!viewer.options.viewOnly)
-			enableInput(true);
-
-		// Keyboard listener is enabled even in view-only mode, to catch
-		// 'r' or 'R' key presses used to request screen update.
-		addKeyListener(this);
-	}
-
-	//
-	// Callback methods to determine geometry of our Component.
-	//
-
-	public Dimension getPreferredSize() {
-		return new Dimension(rfb.framebufferWidth, rfb.framebufferHeight);
-	}
-
-	public Dimension getMinimumSize() {
-		return new Dimension(rfb.framebufferWidth, rfb.framebufferHeight);
-	}
-
-	public Dimension getMaximumSize() {
-		return new Dimension(rfb.framebufferWidth, rfb.framebufferHeight);
-	}
-
-	//
-	// All painting is performed here.
-	//
-
-	public void update(Graphics g) {
-		paint(g);
-	}
-
-	public void paint(Graphics g) {
-		synchronized (memImage) {
-			g.drawImage(memImage, 0, 0, null);
-		}
-		if (showSoftCursor) {
-			int x0 = cursorX - hotX, y0 = cursorY - hotY;
-			Rectangle r = new Rectangle(x0, y0, cursorWidth, cursorHeight);
-			if (r.intersects(g.getClipBounds())) {
-				g.drawImage(softCursor, x0, y0, null);
-			}
-		}
-	}
-
-	//
-	// Override the ImageObserver interface method to handle drawing of
-	// JPEG-encoded data.
-	//
-
-	public boolean imageUpdate(
-		Image img,
-		int infoflags,
-		int x,
-		int y,
-		int width,
-		int height) {
-		if ((infoflags & (ALLBITS | ABORT)) == 0) {
-			return true; // We need more image data.
-		} else {
-			// If the whole image is available, draw it now.
-			if ((infoflags & ALLBITS) != 0) {
-				if (jpegRect != null) {
-					synchronized (jpegRect) {
-						memGraphics.drawImage(
-							img,
-							jpegRect.x,
-							jpegRect.y,
-							null);
-						scheduleRepaint(
-							jpegRect.x,
-							jpegRect.y,
-							jpegRect.width,
-							jpegRect.height);
-						jpegRect.notify();
-					}
-				}
-			}
-			return false; // All image data was processed.
-		}
-	}
-
-	//
-	// Start/stop receiving mouse events. Keyboard events are received
-	// even in view-only mode, because we want to map the 'r' key to the
-	// screen refreshing function.
-	//
-
-	public synchronized void enableInput(boolean enable) {
-		if (enable && !inputEnabled) {
-			inputEnabled = true;
-			addMouseListener(this);
-			addMouseMotionListener(this);
-			addMouseWheelListener(this);
-			if (viewer.showControls) {
-				viewer.buttonPanel.enableRemoteAccessControls(true);
-			}
-		} else if (!enable && inputEnabled) {
-			inputEnabled = false;
-			removeMouseListener(this);
-			removeMouseMotionListener(this);
-			removeMouseWheelListener(this);
-			if (viewer.showControls) {
-				viewer.buttonPanel.enableRemoteAccessControls(false);
-			}
-		}
-	}
-
-	
-	public void setPixelFormat() throws IOException {
-		// sf at 2005 - Adding more color modes
-		if (viewer.options.eightBitColors > 0)
-		{
-			viewer.options.oldEightBitColors = viewer.options.eightBitColors;
-			switch (viewer.options.eightBitColors)
-			{
-				case 1: // 256
-					for (int i = 0; i < 256; i++)
-						colors[i] = new Color(cm8_256c.getRGB(i));					
-					rfb.writeSetPixelFormat(8, 8, false, true, 7, 7, 3, 0, 3, 6, false);
-					break;
-				case 2: // 64
-					for (int i = 0; i < 256; i++)
-						colors[i] = new Color(cm8_64c.getRGB(i));					
-					rfb.writeSetPixelFormat(8, 6, false, true, 3, 3, 3, 4, 2, 0, false);
-					break;
-				case 3: // 8
-					for (int i = 0; i < 256; i++)
-						colors[i] = new Color(cm8_8c.getRGB(i));					
-					rfb.writeSetPixelFormat(8, 3, false, true, 1, 1, 1, 2, 1, 0, false);
-					break;
-				case 4: // 4 (Grey)
-					for (int i = 0; i < 256; i++)
-						colors[i] = new Color(cm8_64c.getRGB(i));					
-					rfb.writeSetPixelFormat(8, 6, false, true, 3, 3, 3, 4, 2, 0, true);
-					break;
-				case 5: // 2 (B&W)
-					for (int i = 0; i < 256; i++)
-						colors[i] = new Color(cm8_8c.getRGB(i));					
-					rfb.writeSetPixelFormat(8, 3, false, true, 1, 1, 1, 2, 1, 0, true);
-					break;
-			}
-			bytesPixel = 1;
-		}
-		else 
-		{
-			rfb.writeSetPixelFormat(
-				32,
-				24,
-				false,
-				true,
-				255,
-				255,
-				255,
-				16,
-				8,
-				0,
-				false);
-			bytesPixel = 4;
-		}
-		updateFramebufferSize();
-	}
-
-	void updateFramebufferSize() {
-
-		// Useful shortcuts.
-		int fbWidth = rfb.framebufferWidth;
-		int fbHeight = rfb.framebufferHeight;
-
-		// Create new off-screen image either if it does not exist, or if
-		// its geometry should be changed. It's not necessary to replace
-		// existing image if only pixel format should be changed.
-		if (memImage == null) {
-			memImage = viewer.createImage(fbWidth, fbHeight);
-			memGraphics = memImage.getGraphics();
-		} else if (
-			memImage.getWidth(null) != fbWidth
-				|| memImage.getHeight(null) != fbHeight) {
-			synchronized (memImage) {
-				memImage = viewer.createImage(fbWidth, fbHeight);
-				memGraphics = memImage.getGraphics();
-			}
-		}
-
-		// Images with raw pixels should be re-allocated on every change
-		// of geometry or pixel format.
-		if (bytesPixel == 1) {
-			pixels24 = null;
-			pixels8 = new byte[fbWidth * fbHeight];
-
-			// sf at 2005
-			ColorModel cml = cm8_8c;
-			
-			//	 sf at 2005
-			switch (viewer.options.eightBitColors)
-			{
-				case 1:
-					cml = cm8_256c;
-					break;
-					
-				case 2:
-				case 4:
-					cml = cm8_64c;
-					break;
-				case 3:
-				case 5:
-					cml = cm8_8c;
-					break;
-			}
-			
-			pixelsSource =
-				new MemoryImageSource(
-					fbWidth,
-					fbHeight,
-					cml,
-					pixels8,
-					0,
-					fbWidth);
-		} else {
-			pixels8 = null;
-			pixels24 = new int[fbWidth * fbHeight];
-
-			pixelsSource =
-				new MemoryImageSource(
-					fbWidth,
-					fbHeight,
-					cm24,
-					pixels24,
-					0,
-					fbWidth);
-		}
-		pixelsSource.setAnimated(true);
-		rawPixelsImage = createImage(pixelsSource);
-
-		// Update the size of desktop containers.
-		if (viewer.inSeparateFrame) {
-			if (viewer.desktopScrollPane != null)
-				resizeDesktopFrame();
-		} else {
-			setSize(fbWidth, fbHeight);
-		}
-	}
-
-	void resizeDesktopFrame() {
-		setSize(rfb.framebufferWidth, rfb.framebufferHeight);
-
-		// FIXME: Find a better way to determine correct size of a
-		// ScrollPane.  -- const
-		Insets insets = viewer.desktopScrollPane.getInsets();
-		viewer.desktopScrollPane.setSize(
-			rfb.framebufferWidth + 2 * Math.min(insets.left, insets.right),
-			rfb.framebufferHeight + 2 * Math.min(insets.top, insets.bottom));
-
-		viewer.vncFrame.pack();
-
-		// Try to limit the frame size to the screen size.
-		Dimension screenSize = viewer.vncFrame.getToolkit().getScreenSize();
-		Dimension frameSize = viewer.vncFrame.getSize();
-		Dimension newSize = frameSize;
-		boolean needToResizeFrame = false;
-		if (frameSize.height > screenSize.height) {
-			newSize.height = screenSize.height;
-			needToResizeFrame = true;
-		}
-		if (frameSize.width > screenSize.width) {
-			newSize.width = screenSize.width;
-			needToResizeFrame = true;
-		}
-		if (needToResizeFrame) {
-			viewer.vncFrame.setSize(newSize);
-		}
-
-		viewer.desktopScrollPane.doLayout();
-	}
-
-	//
-	// processNormalProtocol() - executed by the rfbThread to deal with the
-	// RFB socket.
-	//
-
-	public void processNormalProtocol() throws Exception {
-
-		// Start/stop session recording if necessary.
-		viewer.checkRecordingStatus();
-
-		rfb.writeFramebufferUpdateRequest(
-			0,
-			0,
-			rfb.framebufferWidth,
-			rfb.framebufferHeight,
-			false);
-
-		//
-		// main dispatch loop
-		//
-
-		while (true) {
-			// Read message type from the server.
-			int msgType = rfb.readServerMessageType();
-
-			// Process the message depending on its type.
-			switch (msgType) {
-				case RfbProto.FramebufferUpdate :
-					rfb.readFramebufferUpdate();
-
-					for (int i = 0; i < rfb.updateNRects; i++) {
-						rfb.readFramebufferUpdateRectHdr();
-						int rx = rfb.updateRectX, ry = rfb.updateRectY;
-						int rw = rfb.updateRectW, rh = rfb.updateRectH;
-
-						if (rfb.updateRectEncoding == rfb.EncodingLastRect)
-							break;
-
-						if (rfb.updateRectEncoding == rfb.EncodingNewFBSize) {
-							rfb.setFramebufferSize(rw, rh);
-							updateFramebufferSize();
-							break;
-						}
-
-						if (rfb.updateRectEncoding == rfb.EncodingXCursor
-							|| rfb.updateRectEncoding == rfb.EncodingRichCursor) {
-							handleCursorShapeUpdate(
-								rfb.updateRectEncoding,
-								rx,
-								ry,
-								rw,
-								rh);
-							continue;
-						}
-
-						switch (rfb.updateRectEncoding) {
-							case RfbProto.EncodingRaw :
-								handleRawRect(rx, ry, rw, rh);
-								break;
-							case RfbProto.EncodingCopyRect :
-								handleCopyRect(rx, ry, rw, rh);
-								break;
-							case RfbProto.EncodingRRE :
-								handleRRERect(rx, ry, rw, rh);
-								break;
-							case RfbProto.EncodingCoRRE :
-								handleCoRRERect(rx, ry, rw, rh);
-								break;
-							case RfbProto.EncodingHextile :
-								handleHextileRect(rx, ry, rw, rh);
-								break;
-							case RfbProto.EncodingZlib :
-								handleZlibRect(rx, ry, rw, rh);
-								break;
-							case RfbProto.EncodingTight :
-								handleTightRect(rx, ry, rw, rh);
-								break;
-							// marscha - PointerPos
-							case RfbProto.EncodingPointerPos :
-								handleCursorPosUpdate(rx, ry);
-								break;
-							default :
-								throw new Exception(
-									"Unknown RFB rectangle encoding "
-										+ rfb.updateRectEncoding);
-						}
-					}
-
-					boolean fullUpdateNeeded = false;
-
-					// Start/stop session recording if necessary. Request full
-					// update if a new session file was opened.
-					if (viewer.checkRecordingStatus())
-						fullUpdateNeeded = true;
-
-					// Defer framebuffer update request if necessary. But wake up
-					// immediately on keyboard or mouse event.
-					if (viewer.deferUpdateRequests > 0) {
-						synchronized (rfb) {
-							try {
-								rfb.wait(viewer.deferUpdateRequests);
-							} catch (InterruptedException e) {
-							}
-						}
-					}
-
-					// Before requesting framebuffer update, check if the pixel
-					// format should be changed. If it should, request full update
-					// instead of an incremental one.
-					if ((viewer.options.eightBitColors > 0) && (bytesPixel != 1)
-						||
-						(viewer.options.eightBitColors == 0) && (bytesPixel == 1)
-						||
-						(viewer.options.eightBitColors != viewer.options.oldEightBitColors)
-						)
-					{
-						setPixelFormat();
-						fullUpdateNeeded = true;
-					}
-
-					rfb.writeFramebufferUpdateRequest(
-						0,
-						0,
-						rfb.framebufferWidth,
-						rfb.framebufferHeight,
-						!fullUpdateNeeded);
-
-					break;
-
-				case RfbProto.SetColourMapEntries :
-					throw new Exception("Can't handle SetColourMapEntries message");
-
-				case RfbProto.Bell :
-					Toolkit.getDefaultToolkit().beep();
-					break;
-
-				case RfbProto.ServerCutText :
-					String s = rfb.readServerCutText();
-					viewer.clipboard.setCutText(s);
-					break;
-
-				case RfbProto.rfbFileTransfer :
-					viewer.rfb.readRfbFileTransferMsg();
-					break;
-
-				default :
-					throw new Exception("Unknown RFB message type " + msgType);
-			}
-		}
-	}
-
-	//
-	// Handle a raw rectangle. The second form with paint==false is used
-	// by the Hextile decoder for raw-encoded tiles.
-	//
-
-	void handleRawRect(int x, int y, int w, int h) throws IOException {
-		handleRawRect(x, y, w, h, true);
-	}
-
-	void handleRawRect(int x, int y, int w, int h, boolean paint)
-		throws IOException {
-
-		if (bytesPixel == 1) {
-			for (int dy = y; dy < y + h; dy++) {
-				rfb.is.readFully(pixels8, dy * rfb.framebufferWidth + x, w);
-				if (rfb.rec != null) {
-					rfb.rec.write(pixels8, dy * rfb.framebufferWidth + x, w);
-				}
-			}
-		} else {
-			byte[] buf = new byte[w * 4];
-			int i, offset;
-			for (int dy = y; dy < y + h; dy++) {
-				rfb.is.readFully(buf);
-				if (rfb.rec != null) {
-					rfb.rec.write(buf);
-				}
-				offset = dy * rfb.framebufferWidth + x;
-				for (i = 0; i < w; i++) {
-					pixels24[offset + i] =
-						(buf[i * 4 + 2] & 0xFF)
-							<< 16 | (buf[i * 4 + 1] & 0xFF)
-							<< 8 | (buf[i * 4] & 0xFF);
-				}
-			}
-		}
-
-		handleUpdatedPixels(x, y, w, h);
-		if (paint)
-			scheduleRepaint(x, y, w, h);
-	}
-
-	//
-	// Handle a CopyRect rectangle.
-	//
-
-	void handleCopyRect(int x, int y, int w, int h) throws IOException {
-
-		rfb.readCopyRect();
-		memGraphics.copyArea(
-			rfb.copyRectSrcX,
-			rfb.copyRectSrcY,
-			w,
-			h,
-			x - rfb.copyRectSrcX,
-			y - rfb.copyRectSrcY);
-
-		scheduleRepaint(x, y, w, h);
-	}
-
-	//
-	// Handle an RRE-encoded rectangle.
-	//
-
-	void handleRRERect(int x, int y, int w, int h) throws IOException {
-
-		int nSubrects = rfb.is.readInt();
-
-		byte[] bg_buf = new byte[bytesPixel];
-		rfb.is.readFully(bg_buf);
-		Color pixel;
-		if (bytesPixel == 1)
-		{
-			pixel = colors[bg_buf[0] & 0xFF];
-		}
-		else
-		{
-			pixel = new Color(bg_buf[2] & 0xFF, bg_buf[1] & 0xFF, bg_buf[0] & 0xFF);
-		}
-		memGraphics.setColor(pixel);
-		memGraphics.fillRect(x, y, w, h);
-
-		byte[] buf = new byte[nSubrects * (bytesPixel + 8)];
-		rfb.is.readFully(buf);
-		DataInputStream ds = new DataInputStream(new ByteArrayInputStream(buf));
-
-		if (rfb.rec != null) {
-			rfb.rec.writeIntBE(nSubrects);
-			rfb.rec.write(bg_buf);
-			rfb.rec.write(buf);
-		}
-
-		int sx, sy, sw, sh;
-
-		for (int j = 0; j < nSubrects; j++) {
-			if (bytesPixel == 1) {
-				pixel = colors[ds.readUnsignedByte()];
-			} else {
-				ds.skip(4);
-				pixel =
-					new Color(
-						buf[j * 12 + 2] & 0xFF,
-						buf[j * 12 + 1] & 0xFF,
-						buf[j * 12] & 0xFF);
-			}
-			sx = x + ds.readUnsignedShort();
-			sy = y + ds.readUnsignedShort();
-			sw = ds.readUnsignedShort();
-			sh = ds.readUnsignedShort();
-
-			memGraphics.setColor(pixel);
-			memGraphics.fillRect(sx, sy, sw, sh);
-		}
-
-		scheduleRepaint(x, y, w, h);
-	}
-
-	//
-	// Handle a CoRRE-encoded rectangle.
-	//
-
-	void handleCoRRERect(int x, int y, int w, int h) throws IOException {
-		int nSubrects = rfb.is.readInt();
-
-		byte[] bg_buf = new byte[bytesPixel];
-		rfb.is.readFully(bg_buf);
-		Color pixel;
-		if (bytesPixel == 1) {
-			pixel = colors[bg_buf[0] & 0xFF];
-		} else {
-			pixel =
-				new Color(bg_buf[2] & 0xFF, bg_buf[1] & 0xFF, bg_buf[0] & 0xFF);
-		}
-		memGraphics.setColor(pixel);
-		memGraphics.fillRect(x, y, w, h);
-
-		byte[] buf = new byte[nSubrects * (bytesPixel + 4)];
-		rfb.is.readFully(buf);
-
-		if (rfb.rec != null) {
-			rfb.rec.writeIntBE(nSubrects);
-			rfb.rec.write(bg_buf);
-			rfb.rec.write(buf);
-		}
-
-		int sx, sy, sw, sh;
-		int i = 0;
-
-		for (int j = 0; j < nSubrects; j++) {
-			if (bytesPixel == 1) {
-				pixel = colors[buf[i++] & 0xFF];
-			} else {
-				pixel =
-					new Color(
-						buf[i + 2] & 0xFF,
-						buf[i + 1] & 0xFF,
-						buf[i] & 0xFF);
-				i += 4;
-			}
-			sx = x + (buf[i++] & 0xFF);
-			sy = y + (buf[i++] & 0xFF);
-			sw = buf[i++] & 0xFF;
-			sh = buf[i++] & 0xFF;
-
-			memGraphics.setColor(pixel);
-			memGraphics.fillRect(sx, sy, sw, sh);
-		}
-
-		scheduleRepaint(x, y, w, h);
-	}
-
-	//
-	// Handle a Hextile-encoded rectangle.
-	//
-
-	// These colors should be kept between handleHextileSubrect() calls.
-	private Color hextile_bg, hextile_fg;
-
-	void handleHextileRect(int x, int y, int w, int h) throws IOException {
-
-		hextile_bg = new Color(0);
-		hextile_fg = new Color(0);
-
-		for (int ty = y; ty < y + h; ty += 16) {
-			int th = 16;
-			if (y + h - ty < 16)
-				th = y + h - ty;
-
-			for (int tx = x; tx < x + w; tx += 16) {
-				int tw = 16;
-				if (x + w - tx < 16)
-					tw = x + w - tx;
-
-				handleHextileSubrect(tx, ty, tw, th);
-			}
-
-			// Finished with a row of tiles, now let's show it.
-			scheduleRepaint(x, y, w, h);
-		}
-	}
-
-	//
-	// Handle one tile in the Hextile-encoded data.
-	//
-
-	void handleHextileSubrect(int tx, int ty, int tw, int th)
-		throws IOException {
-
-		int subencoding = rfb.is.readUnsignedByte();
-		if (rfb.rec != null) {
-			rfb.rec.writeByte(subencoding);
-		}
-
-		// Is it a raw-encoded sub-rectangle?
-		if ((subencoding & rfb.HextileRaw) != 0) {
-			handleRawRect(tx, ty, tw, th, false);
-			return;
-		}
-
-		// Read and draw the background if specified.
-		byte[] cbuf = new byte[bytesPixel];
-		if ((subencoding & rfb.HextileBackgroundSpecified) != 0) {
-			rfb.is.readFully(cbuf);
-			if (bytesPixel == 1) {
-				hextile_bg = colors[cbuf[0] & 0xFF];
-			} else {
-				hextile_bg =
-					new Color(cbuf[2] & 0xFF, cbuf[1] & 0xFF, cbuf[0] & 0xFF);
-			}
-			if (rfb.rec != null) {
-				rfb.rec.write(cbuf);
-			}
-		}
-		memGraphics.setColor(hextile_bg);
-		memGraphics.fillRect(tx, ty, tw, th);
-
-		// Read the foreground color if specified.
-		if ((subencoding & rfb.HextileForegroundSpecified) != 0) {
-			rfb.is.readFully(cbuf);
-			if (bytesPixel == 1) {
-				hextile_fg = colors[cbuf[0] & 0xFF];
-			} else {
-				hextile_fg =
-					new Color(cbuf[2] & 0xFF, cbuf[1] & 0xFF, cbuf[0] & 0xFF);
-			}
-			if (rfb.rec != null) {
-				rfb.rec.write(cbuf);
-			}
-		}
-
-		// Done with this tile if there is no sub-rectangles.
-		if ((subencoding & rfb.HextileAnySubrects) == 0)
-			return;
-
-		int nSubrects = rfb.is.readUnsignedByte();
-		int bufsize = nSubrects * 2;
-		if ((subencoding & rfb.HextileSubrectsColoured) != 0) {
-			bufsize += nSubrects * bytesPixel;
-		}
-		byte[] buf = new byte[bufsize];
-		rfb.is.readFully(buf);
-		if (rfb.rec != null) {
-			rfb.rec.writeByte(nSubrects);
-			rfb.rec.write(buf);
-		}
-
-		int b1, b2, sx, sy, sw, sh;
-		int i = 0;
-
-		if ((subencoding & rfb.HextileSubrectsColoured) == 0) {
-
-			// Sub-rectangles are all of the same color.
-			memGraphics.setColor(hextile_fg);
-			for (int j = 0; j < nSubrects; j++) {
-				b1 = buf[i++] & 0xFF;
-				b2 = buf[i++] & 0xFF;
-				sx = tx + (b1 >> 4);
-				sy = ty + (b1 & 0xf);
-				sw = (b2 >> 4) + 1;
-				sh = (b2 & 0xf) + 1;
-				memGraphics.fillRect(sx, sy, sw, sh);
-			}
-		} else if (bytesPixel == 1) {
-
-			// BGR233 (8-bit color) version for colored sub-rectangles.
-			for (int j = 0; j < nSubrects; j++) {
-				hextile_fg = colors[buf[i++] & 0xFF];
-				b1 = buf[i++] & 0xFF;
-				b2 = buf[i++] & 0xFF;
-				sx = tx + (b1 >> 4);
-				sy = ty + (b1 & 0xf);
-				sw = (b2 >> 4) + 1;
-				sh = (b2 & 0xf) + 1;
-				memGraphics.setColor(hextile_fg);
-				memGraphics.fillRect(sx, sy, sw, sh);
-			}
-
-		} else {
-
-			// Full-color (24-bit) version for colored sub-rectangles.
-			for (int j = 0; j < nSubrects; j++) {
-				hextile_fg =
-					new Color(
-						buf[i + 2] & 0xFF,
-						buf[i + 1] & 0xFF,
-						buf[i] & 0xFF);
-				i += 4;
-				b1 = buf[i++] & 0xFF;
-				b2 = buf[i++] & 0xFF;
-				sx = tx + (b1 >> 4);
-				sy = ty + (b1 & 0xf);
-				sw = (b2 >> 4) + 1;
-				sh = (b2 & 0xf) + 1;
-				memGraphics.setColor(hextile_fg);
-				memGraphics.fillRect(sx, sy, sw, sh);
-			}
-
-		}
-	}
-
-	//
-	// Handle a Zlib-encoded rectangle.
-	//
-
-	void handleZlibRect(int x, int y, int w, int h) throws Exception {
-
-		int nBytes = rfb.is.readInt();
-
-		if (zlibBuf == null || zlibBufLen < nBytes) {
-			zlibBufLen = nBytes * 2;
-			zlibBuf = new byte[zlibBufLen];
-		}
-
-		rfb.is.readFully(zlibBuf, 0, nBytes);
-
-		if (rfb.rec != null && rfb.recordFromBeginning) {
-			rfb.rec.writeIntBE(nBytes);
-			rfb.rec.write(zlibBuf, 0, nBytes);
-		}
-
-		if (zlibInflater == null) {
-			zlibInflater = new Inflater();
-		}
-		zlibInflater.setInput(zlibBuf, 0, nBytes);
-
-		if (bytesPixel == 1) {
-			for (int dy = y; dy < y + h; dy++) {
-				zlibInflater.inflate(pixels8, dy * rfb.framebufferWidth + x, w);
-				if (rfb.rec != null && !rfb.recordFromBeginning)
-					rfb.rec.write(pixels8, dy * rfb.framebufferWidth + x, w);
-			}
-		} else {
-			byte[] buf = new byte[w * 4];
-			int i, offset;
-			for (int dy = y; dy < y + h; dy++) {
-				zlibInflater.inflate(buf);
-				offset = dy * rfb.framebufferWidth + x;
-				for (i = 0; i < w; i++) {
-					pixels24[offset + i] =
-						(buf[i * 4 + 2] & 0xFF)
-							<< 16 | (buf[i * 4 + 1] & 0xFF)
-							<< 8 | (buf[i * 4] & 0xFF);
-				}
-				if (rfb.rec != null && !rfb.recordFromBeginning)
-					rfb.rec.write(buf);
-			}
-		}
-
-		handleUpdatedPixels(x, y, w, h);
-		scheduleRepaint(x, y, w, h);
-	}
-
-	//
-	// Handle a Tight-encoded rectangle.
-	//
-
-	void handleTightRect(int x, int y, int w, int h) throws Exception {
-
-		int comp_ctl = rfb.is.readUnsignedByte();
-		if (rfb.rec != null) {
-			if (rfb.recordFromBeginning
-				|| comp_ctl == (rfb.TightFill << 4)
-				|| comp_ctl == (rfb.TightJpeg << 4)) {
-				// Send data exactly as received.
-				rfb.rec.writeByte(comp_ctl);
-			} else {
-				// Tell the decoder to flush each of the four zlib streams.
-				rfb.rec.writeByte(comp_ctl | 0x0F);
-			}
-		}
-
-		// Flush zlib streams if we are told by the server to do so.
-		for (int stream_id = 0; stream_id < 4; stream_id++) {
-			if ((comp_ctl & 1) != 0 && tightInflaters[stream_id] != null) {
-				tightInflaters[stream_id] = null;
-			}
-			comp_ctl >>= 1;
-		}
-
-		// Check correctness of subencoding value.
-		if (comp_ctl > rfb.TightMaxSubencoding) {
-			throw new Exception("Incorrect tight subencoding: " + comp_ctl);
-		}
-
-		// Handle solid-color rectangles.
-		if (comp_ctl == rfb.TightFill) {
-
-			if (bytesPixel == 1) {
-				int idx = rfb.is.readUnsignedByte();
-				memGraphics.setColor(colors[idx]);
-				if (rfb.rec != null) {
-					rfb.rec.writeByte(idx);
-				}
-			} else {
-				byte[] buf = new byte[3];
-				rfb.is.readFully(buf);
-				if (rfb.rec != null) {
-					rfb.rec.write(buf);
-				}
-				Color bg =
-					new Color(
-						0xFF000000 | (buf[0] & 0xFF)
-							<< 16 | (buf[1] & 0xFF)
-							<< 8 | (buf[2] & 0xFF));
-				memGraphics.setColor(bg);
-			}
-			memGraphics.fillRect(x, y, w, h);
-			scheduleRepaint(x, y, w, h);
-			return;
-
-		}
-
-		if (comp_ctl == rfb.TightJpeg) {
-
-			// Read JPEG data.
-			byte[] jpegData = new byte[rfb.readCompactLen()];
-			rfb.is.readFully(jpegData);
-			if (rfb.rec != null) {
-				if (!rfb.recordFromBeginning) {
-					rfb.recordCompactLen(jpegData.length);
-				}
-				rfb.rec.write(jpegData);
-			}
-
-			// Create an Image object from the JPEG data.
-			Image jpegImage = Toolkit.getDefaultToolkit().createImage(jpegData);
-
-			// Remember the rectangle where the image should be drawn.
-			jpegRect = new Rectangle(x, y, w, h);
-
-			// Let the imageUpdate() method do the actual drawing, here just
-			// wait until the image is fully loaded and drawn.
-			synchronized (jpegRect) {
-				Toolkit.getDefaultToolkit().prepareImage(
-					jpegImage,
-					-1,
-					-1,
-					this);
-				try {
-					// Wait no longer than three seconds.
-					jpegRect.wait(3000);
-				} catch (InterruptedException e) {
-					throw new Exception("Interrupted while decoding JPEG image");
-				}
-			}
-
-			// Done, jpegRect is not needed any more.
-			jpegRect = null;
-			return;
-
-		}
-
-		// Read filter id and parameters.
-		int numColors = 0, rowSize = w;
-		byte[] palette8 = new byte[2];
-		int[] palette24 = new int[256];
-		boolean useGradient = false;
-		if ((comp_ctl & rfb.TightExplicitFilter) != 0) {
-			int filter_id = rfb.is.readUnsignedByte();
-			if (rfb.rec != null) {
-				rfb.rec.writeByte(filter_id);
-			}
-			if (filter_id == rfb.TightFilterPalette) {
-				numColors = rfb.is.readUnsignedByte() + 1;
-				if (rfb.rec != null) {
-					rfb.rec.writeByte(numColors - 1);
-				}
-				if (bytesPixel == 1) {
-					if (numColors != 2) {
-						throw new Exception(
-							"Incorrect tight palette size: " + numColors);
-					}
-					rfb.is.readFully(palette8);
-					if (rfb.rec != null) {
-						rfb.rec.write(palette8);
-					}
-				} else {
-					byte[] buf = new byte[numColors * 3];
-					rfb.is.readFully(buf);
-					if (rfb.rec != null) {
-						rfb.rec.write(buf);
-					}
-					for (int i = 0; i < numColors; i++) {
-						palette24[i] =
-							((buf[i * 3] & 0xFF)
-								<< 16 | (buf[i * 3 + 1] & 0xFF)
-								<< 8 | (buf[i * 3 + 2] & 0xFF));
-					}
-				}
-				if (numColors == 2)
-					rowSize = (w + 7) / 8;
-			} else if (filter_id == rfb.TightFilterGradient) {
-				useGradient = true;
-			} else if (filter_id != rfb.TightFilterCopy) {
-				throw new Exception("Incorrect tight filter id: " + filter_id);
-			}
-		}
-		if (numColors == 0 && bytesPixel == 4)
-			rowSize *= 3;
-
-		// Read, optionally uncompress and decode data.
-		int dataSize = h * rowSize;
-		if (dataSize < rfb.TightMinToCompress) {
-			// Data size is small - not compressed with zlib.
-			if (numColors != 0) {
-				// Indexed colors.
-				byte[] indexedData = new byte[dataSize];
-				rfb.is.readFully(indexedData);
-				if (rfb.rec != null) {
-					rfb.rec.write(indexedData);
-				}
-				if (numColors == 2) {
-					// Two colors.
-					if (bytesPixel == 1) {
-						decodeMonoData(x, y, w, h, indexedData, palette8);
-					} else {
-						decodeMonoData(x, y, w, h, indexedData, palette24);
-					}
-				} else {
-					// 3..255 colors (assuming bytesPixel == 4).
-					int i = 0;
-					for (int dy = y; dy < y + h; dy++) {
-						for (int dx = x; dx < x + w; dx++) {
-							pixels24[dy * rfb.framebufferWidth + dx] =
-								palette24[indexedData[i++] & 0xFF];
-						}
-					}
-				}
-			} else if (useGradient) {
-				// "Gradient"-processed data
-				byte[] buf = new byte[w * h * 3];
-				rfb.is.readFully(buf);
-				if (rfb.rec != null) {
-					rfb.rec.write(buf);
-				}
-				decodeGradientData(x, y, w, h, buf);
-			} else {
-				// Raw truecolor data.
-				if (bytesPixel == 1) {
-					for (int dy = y; dy < y + h; dy++) {
-						rfb.is.readFully(
-							pixels8,
-							dy * rfb.framebufferWidth + x,
-							w);
-						if (rfb.rec != null) {
-							rfb.rec.write(
-								pixels8,
-								dy * rfb.framebufferWidth + x,
-								w);
-						}
-					}
-				} else {
-					byte[] buf = new byte[w * 3];
-					int i, offset;
-					for (int dy = y; dy < y + h; dy++) {
-						rfb.is.readFully(buf);
-						if (rfb.rec != null) {
-							rfb.rec.write(buf);
-						}
-						offset = dy * rfb.framebufferWidth + x;
-						for (i = 0; i < w; i++) {
-							pixels24[offset + i] =
-								(buf[i * 3] & 0xFF)
-									<< 16 | (buf[i * 3 + 1] & 0xFF)
-									<< 8 | (buf[i * 3 + 2] & 0xFF);
-						}
-					}
-				}
-			}
-		} else {
-			// Data was compressed with zlib.
-			int zlibDataLen = rfb.readCompactLen();
-			byte[] zlibData = new byte[zlibDataLen];
-			rfb.is.readFully(zlibData);
-			if (rfb.rec != null && rfb.recordFromBeginning) {
-				rfb.rec.write(zlibData);
-			}
-			int stream_id = comp_ctl & 0x03;
-			if (tightInflaters[stream_id] == null) {
-				tightInflaters[stream_id] = new Inflater();
-			}
-			Inflater myInflater = tightInflaters[stream_id];
-			myInflater.setInput(zlibData);
-			byte[] buf = new byte[dataSize];
-			myInflater.inflate(buf);
-			if (rfb.rec != null && !rfb.recordFromBeginning) {
-				rfb.recordCompressedData(buf);
-			}
-
-			if (numColors != 0) {
-				// Indexed colors.
-				if (numColors == 2) {
-					// Two colors.
-					if (bytesPixel == 1) {
-						decodeMonoData(x, y, w, h, buf, palette8);
-					} else {
-						decodeMonoData(x, y, w, h, buf, palette24);
-					}
-				} else {
-					// More than two colors (assuming bytesPixel == 4).
-					int i = 0;
-					for (int dy = y; dy < y + h; dy++) {
-						for (int dx = x; dx < x + w; dx++) {
-							pixels24[dy * rfb.framebufferWidth + dx] =
-								palette24[buf[i++] & 0xFF];
-						}
-					}
-				}
-			} else if (useGradient) {
-				// Compressed "Gradient"-filtered data (assuming bytesPixel == 4).
-				decodeGradientData(x, y, w, h, buf);
-			} else {
-				// Compressed truecolor data.
-				if (bytesPixel == 1) {
-					int destOffset = y * rfb.framebufferWidth + x;
-					for (int dy = 0; dy < h; dy++) {
-						System.arraycopy(buf, dy * w, pixels8, destOffset, w);
-						destOffset += rfb.framebufferWidth;
-					}
-				} else {
-					int srcOffset = 0;
-					int destOffset, i;
-					for (int dy = 0; dy < h; dy++) {
-						myInflater.inflate(buf);
-						destOffset = (y + dy) * rfb.framebufferWidth + x;
-						for (i = 0; i < w; i++) {
-							pixels24[destOffset + i] =
-								(buf[srcOffset] & 0xFF)
-									<< 16 | (buf[srcOffset + 1] & 0xFF)
-									<< 8 | (buf[srcOffset + 2] & 0xFF);
-							srcOffset += 3;
-						}
-					}
-				}
-			}
-		}
-
-		handleUpdatedPixels(x, y, w, h);
-		scheduleRepaint(x, y, w, h);
-	}
-
-	//
-	// Decode 1bpp-encoded bi-color rectangle (8-bit and 24-bit versions).
-	//
-
-	void decodeMonoData(
-		int x,
-		int y,
-		int w,
-		int h,
-		byte[] src,
-		byte[] palette) {
-
-		int dx, dy, n;
-		int i = y * rfb.framebufferWidth + x;
-		int rowBytes = (w + 7) / 8;
-		byte b;
-
-		for (dy = 0; dy < h; dy++) {
-			for (dx = 0; dx < w / 8; dx++) {
-				b = src[dy * rowBytes + dx];
-				for (n = 7; n >= 0; n--)
-					pixels8[i++] = palette[b >> n & 1];
-			}
-			for (n = 7; n >= 8 - w % 8; n--) {
-				pixels8[i++] = palette[src[dy * rowBytes + dx] >> n & 1];
-			}
-			i += (rfb.framebufferWidth - w);
-		}
-	}
-
-	void decodeMonoData(
-		int x,
-		int y,
-		int w,
-		int h,
-		byte[] src,
-		int[] palette) {
-
-		int dx, dy, n;
-		int i = y * rfb.framebufferWidth + x;
-		int rowBytes = (w + 7) / 8;
-		byte b;
-
-		for (dy = 0; dy < h; dy++) {
-			for (dx = 0; dx < w / 8; dx++) {
-				b = src[dy * rowBytes + dx];
-				for (n = 7; n >= 0; n--)
-					pixels24[i++] = palette[b >> n & 1];
-			}
-			for (n = 7; n >= 8 - w % 8; n--) {
-				pixels24[i++] = palette[src[dy * rowBytes + dx] >> n & 1];
-			}
-			i += (rfb.framebufferWidth - w);
-		}
-	}
-
-	//
-	// Decode data processed with the "Gradient" filter.
-	//
-
-	void decodeGradientData(int x, int y, int w, int h, byte[] buf) {
-
-		int dx, dy, c;
-		byte[] prevRow = new byte[w * 3];
-		byte[] thisRow = new byte[w * 3];
-		byte[] pix = new byte[3];
-		int[] est = new int[3];
-
-		int offset = y * rfb.framebufferWidth + x;
-
-		for (dy = 0; dy < h; dy++) {
-
-			/* First pixel in a row */
-			for (c = 0; c < 3; c++) {
-				pix[c] = (byte) (prevRow[c] + buf[dy * w * 3 + c]);
-				thisRow[c] = pix[c];
-			}
-			pixels24[offset++] =
-				(pix[0] & 0xFF) << 16 | (pix[1] & 0xFF) << 8 | (pix[2] & 0xFF);
-
-			/* Remaining pixels of a row */
-			for (dx = 1; dx < w; dx++) {
-				for (c = 0; c < 3; c++) {
-					est[c] =
-						((prevRow[dx * 3 + c] & 0xFF)
-							+ (pix[c] & 0xFF)
-							- (prevRow[(dx - 1) * 3 + c] & 0xFF));
-					if (est[c] > 0xFF) {
-						est[c] = 0xFF;
-					} else if (est[c] < 0x00) {
-						est[c] = 0x00;
-					}
-					pix[c] = (byte) (est[c] + buf[(dy * w + dx) * 3 + c]);
-					thisRow[dx * 3 + c] = pix[c];
-				}
-				pixels24[offset++] =
-					(pix[0] & 0xFF)
-						<< 16 | (pix[1] & 0xFF)
-						<< 8 | (pix[2] & 0xFF);
-			}
-
-			System.arraycopy(thisRow, 0, prevRow, 0, w * 3);
-			offset += (rfb.framebufferWidth - w);
-		}
-	}
-
-	//
-	// Display newly updated area of pixels.
-	//
-
-	void handleUpdatedPixels(int x, int y, int w, int h) {
-
-		// Draw updated pixels of the off-screen image.
-		pixelsSource.newPixels(x, y, w, h);
-		memGraphics.setClip(x, y, w, h);
-		memGraphics.drawImage(rawPixelsImage, 0, 0, null);
-		memGraphics.setClip(0, 0, rfb.framebufferWidth, rfb.framebufferHeight);
-	}
-
-	//
-	// Tell JVM to repaint specified desktop area.
-	//
-
-	void scheduleRepaint(int x, int y, int w, int h) {
-		// Request repaint, deferred if necessary.
-		repaint(viewer.deferScreenUpdates, x, y, w, h);
-	}
-
-	//
-	// Handle events.
-	//
-
-	public void keyPressed(KeyEvent evt) {
-		processLocalKeyEvent(evt);
-	}
-	public void keyReleased(KeyEvent evt) {
-		processLocalKeyEvent(evt);
-	}
-	public void keyTyped(KeyEvent evt) {
-		evt.consume();
-	}
-
-	public void mousePressed(MouseEvent evt) {
-		processLocalMouseEvent(evt, false);
-	}
-	public void mouseReleased(MouseEvent evt) {
-		processLocalMouseEvent(evt, false);
-	}
-	public void mouseMoved(MouseEvent evt) {
-		processLocalMouseEvent(evt, true);
-	}
-	public void mouseDragged(MouseEvent evt) {
-		processLocalMouseEvent(evt, true);
-	}
-	public void mouseWheelMoved(MouseWheelEvent evt) {
-		processLocalMouseWheelEvent(evt);
-	}
-
-	public void processLocalKeyEvent(KeyEvent evt) {
-		if (viewer.rfb != null && rfb.inNormalProtocol) {
-			if (!inputEnabled) {
-				if ((evt.getKeyChar() == 'r' || evt.getKeyChar() == 'R')
-					&& evt.getID() == KeyEvent.KEY_PRESSED) {
-					// Request screen update.
-					try {
-						rfb.writeFramebufferUpdateRequest(
-							0,
-							0,
-							rfb.framebufferWidth,
-							rfb.framebufferHeight,
-							false);
-					} catch (IOException e) {
-						e.printStackTrace();
-					}
-				}
-			} else {
-				// Input enabled.
-				synchronized (rfb) {
-					try {
-						rfb.writeKeyEvent(evt);
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-					rfb.notify();
-				}
-			}
-		}
-		// Don't ever pass keyboard events to AWT for default processing. 
-		// Otherwise, pressing Tab would switch focus to ButtonPanel etc.
-		evt.consume();
-	}
-
-	public void processLocalMouseWheelEvent(MouseWheelEvent evt) {
-		if (viewer.rfb != null && rfb.inNormalProtocol) {
-			synchronized(rfb) {
-				try {
-					rfb.writeWheelEvent(evt);
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-				rfb.notify();
-			}
-		}
-	}
-
-	public void processLocalMouseEvent(MouseEvent evt, boolean moved) {
-		if (viewer.rfb != null && rfb.inNormalProtocol) {
-			if (moved) {
-				softCursorMove(evt.getX(), evt.getY());
-			}
-			synchronized (rfb) {
-				try {
-					rfb.writePointerEvent(evt);
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-				rfb.notify();
-			}
-		}
-	}
-
-	//
-	// Ignored events.
-	//
-
-	public void mouseClicked(MouseEvent evt) {
-	}
-	public void mouseEntered(MouseEvent evt) {
-	}
-	public void mouseExited(MouseEvent evt) {
-	}
-
-	//////////////////////////////////////////////////////////////////
-	//
-	// Handle cursor shape updates (XCursor and RichCursor encodings).
-	//
-
-	boolean showSoftCursor = false;
-
-	int[] softCursorPixels;
-	MemoryImageSource softCursorSource;
-	Image softCursor;
-
-	int cursorX = 0, cursorY = 0;
-	int cursorWidth, cursorHeight;
-	int hotX, hotY;
-
-	//
-	// Handle cursor shape update (XCursor and RichCursor encodings).
-	//
-
-	synchronized void handleCursorShapeUpdate(
-		int encodingType,
-		int xhot,
-		int yhot,
-		int width,
-		int height)
-		throws IOException {
-
-		int bytesPerRow = (width + 7) / 8;
-		int bytesMaskData = bytesPerRow * height;
-
-		softCursorFree();
-
-		if (width * height == 0)
-			return;
-
-		// Ignore cursor shape data if requested by user.
-
-		if (viewer.options.ignoreCursorUpdates) {
-			if (encodingType == rfb.EncodingXCursor) {
-				rfb.is.skipBytes(6 + bytesMaskData * 2);
-			} else {
-				// rfb.EncodingRichCursor
-				rfb.is.skipBytes(width * height + bytesMaskData);
-			}
-			return;
-		}
-
-		// Decode cursor pixel data.
-
-		softCursorPixels = new int[width * height];
-
-		if (encodingType == rfb.EncodingXCursor) {
-
-			// Read foreground and background colors of the cursor.
-			byte[] rgb = new byte[6];
-			rfb.is.readFully(rgb);
-			int[] colors =
-				{
-					(0xFF000000 | (rgb[3] & 0xFF)
-						<< 16 | (rgb[4] & 0xFF)
-						<< 8 | (rgb[5] & 0xFF)),
-					(0xFF000000 | (rgb[0] & 0xFF)
-						<< 16 | (rgb[1] & 0xFF)
-						<< 8 | (rgb[2] & 0xFF))};
-
-			// Read pixel and mask data.
-			byte[] pixBuf = new byte[bytesMaskData];
-			rfb.is.readFully(pixBuf);
-			byte[] maskBuf = new byte[bytesMaskData];
-			rfb.is.readFully(maskBuf);
-
-			// Decode pixel data into softCursorPixels[].
-			byte pixByte, maskByte;
-			int x, y, n, result;
-			int i = 0;
-			for (y = 0; y < height; y++) {
-				for (x = 0; x < width / 8; x++) {
-					pixByte = pixBuf[y * bytesPerRow + x];
-					maskByte = maskBuf[y * bytesPerRow + x];
-					for (n = 7; n >= 0; n--) {
-						if ((maskByte >> n & 1) != 0) {
-							result = colors[pixByte >> n & 1];
-						} else {
-							result = 0; // Transparent pixel
-						}
-						softCursorPixels[i++] = result;
-					}
-				}
-				for (n = 7; n >= 8 - width % 8; n--) {
-					if ((maskBuf[y * bytesPerRow + x] >> n & 1) != 0) {
-						result = colors[pixBuf[y * bytesPerRow + x] >> n & 1];
-					} else {
-						result = 0; // Transparent pixel
-					}
-					softCursorPixels[i++] = result;
-				}
-			}
-
-		} else {
-			// encodingType == rfb.EncodingRichCursor
-
-			// Read pixel and mask data.
-			byte[] pixBuf = new byte[width * height * bytesPixel];
-			rfb.is.readFully(pixBuf);
-			byte[] maskBuf = new byte[bytesMaskData];
-			rfb.is.readFully(maskBuf);
-
-			// Decode pixel data into softCursorPixels[].
-			byte pixByte, maskByte;
-			int x, y, n, result;
-			int i = 0;
-			for (y = 0; y < height; y++) {
-				for (x = 0; x < width / 8; x++) {
-					maskByte = maskBuf[y * bytesPerRow + x];
-					for (n = 7; n >= 0; n--) {
-						if ((maskByte >> n & 1) != 0) {
-							if (bytesPixel == 1)
-							{
-								result = 0;
-								// sf at 2005
-								switch (viewer.options.eightBitColors)
-								{
-									case 1:
-										result = cm8_256c.getRGB(pixBuf[i]);
-										break;
-									case 2:
-									case 4:
-										result = cm8_64c.getRGB(pixBuf[i]);
-										break;
-									case 3:
-									case 5:
-										result = cm8_8c.getRGB(pixBuf[i]);
-										break;
-								}
-							}
-							else
-							{
-								result =
-									0xFF000000 | (pixBuf[i * 4 + 2] & 0xFF)
-										<< 16 | (pixBuf[i * 4 + 1] & 0xFF)
-										<< 8 | (pixBuf[i * 4 + 0] & 0xFF);
-							}
-						} else {
-							result = 0; // Transparent pixel
-						}
-						softCursorPixels[i++] = result;
-					}
-				}
-				for (n = 7; n >= 8 - width % 8; n--) {
-					if ((maskBuf[y * bytesPerRow + x] >> n & 1) != 0) {
-						if (bytesPixel == 1)
-						{
-							result = 0;
-//							 sf at 2005
-							switch (viewer.options.eightBitColors)
-							{
-								case 1:
-									result = cm8_256c.getRGB(pixBuf[i]);
-									break;
-								case 2:
-								case 4:
-									result = cm8_64c.getRGB(pixBuf[i]);
-									break;
-								case 3:
-								case 5:
-									result = cm8_8c.getRGB(pixBuf[i]);
-									break;
-							}						}
-						else
-						{
-							result =
-								0xFF000000 | (pixBuf[i * 4 + 1] & 0xFF)
-									<< 16 | (pixBuf[i * 4 + 2] & 0xFF)
-									<< 8 | (pixBuf[i * 4 + 3] & 0xFF);
-						}
-					} else {
-						result = 0; // Transparent pixel
-					}
-					softCursorPixels[i++] = result;
-				}
-			}
-
-		}
-
-		// Draw the cursor on an off-screen image.
-
-		softCursorSource =
-			new MemoryImageSource(width, height, softCursorPixels, 0, width);
-		softCursor = createImage(softCursorSource);
-
-		// Set remaining data associated with cursor.
-
-		cursorWidth = width;
-		cursorHeight = height;
-		hotX = xhot;
-		hotY = yhot;
-
-		showSoftCursor = true;
-
-		// Show the cursor.
-
-		repaint(
-			viewer.deferCursorUpdates,
-			cursorX - hotX,
-			cursorY - hotY,
-			cursorWidth,
-			cursorHeight);
-	}
-
-	//
-	// marscha - PointerPos
-	// Handle cursor position update (PointerPos encoding).
-	//
-
-	synchronized void handleCursorPosUpdate(
-		int x,
-		int y) {
-		if (x >= rfb.framebufferWidth)
-			x = rfb.framebufferWidth - 1;
-		if (y >= rfb.framebufferHeight)
-			y = rfb.framebufferHeight - 1;
-
-		softCursorMove(x, y);
-	}
-	
-	//
-	// softCursorMove(). Moves soft cursor into a particular location.
-	//
-
-	synchronized void softCursorMove(int x, int y) {
-		if (showSoftCursor) {
-			repaint(
-				viewer.deferCursorUpdates,
-				cursorX - hotX,
-				cursorY - hotY,
-				cursorWidth,
-				cursorHeight);
-			repaint(
-				viewer.deferCursorUpdates,
-				x - hotX,
-				y - hotY,
-				cursorWidth,
-				cursorHeight);
-		}
-
-		cursorX = x;
-		cursorY = y;
-	}
-
-	//
-	// softCursorFree(). Remove soft cursor, dispose resources.
-	//
-
-	synchronized void softCursorFree() {
-		if (showSoftCursor) {
-			showSoftCursor = false;
-			softCursor = null;
-			softCursorSource = null;
-			softCursorPixels = null;
-
-			repaint(
-				viewer.deferCursorUpdates,
-				cursorX - hotX,
-				cursorY - hotY,
-				cursorWidth,
-				cursorHeight);
-		}
-	}
-}
diff --git a/ica/JavaViewer/VncViewer.java b/ica/JavaViewer/VncViewer.java
deleted file mode 100644
index cb28a8a..0000000
--- a/ica/JavaViewer/VncViewer.java
+++ /dev/null
@@ -1,994 +0,0 @@
-
-//  Copyright (C) 2002-2005 Ultr at VNC Team.  All Rights Reserved.
-//  Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
-//  Copyright (C) 2004 Alban Chazot.  All Rights Reserved.
-//  Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
-//  Copyright (C) 2002 Constantin Kaplinsky.  All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
-//
-//  This is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This software is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this software; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-
-//
-// VncViewer.java - the VNC viewer applet.  This class mainly just sets up the
-// user interface, leaving it to the VncCanvas to do the actual rendering of
-// a VNC desktop.
-//
-
-// Alban Chazot - Carmi Grenoble July 5th 2004 
-// * Add support for Ultr at VNC mslogon feature.
-//   You can now be connected to a Ultr at VNC box with mslogon required.
-//   Thanks to Wim Vandersmissen, who provide a TightVNC viewer patch do to so.
-//   That give me the idea to provide it in the java viewer too.
-//
-// * Add ScrollPanel to applet mode
-//
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.net.*;
-import javax.swing.*;
-
-public class VncViewer extends java.applet.Applet
-  implements java.lang.Runnable, WindowListener {
-
-  boolean inAnApplet = true;
-  boolean inSeparateFrame = false;
-
-  // mslogon support
-
-  boolean mslogon = true;
-
-  // mslogon support end
-
-  //
-  // main() is called when run as a java program from the command line.
-  // It simply runs the applet inside a newly-created frame.
-  //
-
-  public static void main(String[] argv) {
-    VncViewer v = new VncViewer();
-    v.mainArgs = argv;
-    v.inAnApplet = false;
-    v.inSeparateFrame = true;
-
-    v.init();
-    v.start();
-  }
-
-  String[] mainArgs;
-
-  RfbProto rfb;
-  Thread rfbThread;
-
-  Frame vncFrame;
-  Container vncContainer;
-  ScrollPane desktopScrollPane;
-  GridBagLayout gridbag;
-  ButtonPanel buttonPanel;
-  AuthPanel authenticator;
-  VncCanvas vc;
-  OptionsFrame options;
-  ClipboardFrame clipboard;
-  RecordingFrame rec;
-  FTPFrame ftp; // KMC: FTP Frame declaration
-
-  // Control session recording.
-  Object recordingSync;
-  String sessionFileName;
-  boolean recordingActive;
-  boolean recordingStatusChanged;
-  String cursorUpdatesDef;
-  String eightBitColorsDef;
-
-  // Variables read from parameter values.
-  String host;
-  int port;
-  String passwordParam;
-  String encPasswordParam;
-  boolean showControls;
-  boolean showOfflineDesktop;
-  int deferScreenUpdates;
-  int deferCursorUpdates;
-  int deferUpdateRequests;
-
-  // mslogon support 2
-  String usernameParam;
-  String encUsernameParam;
-  String dm; 
-  byte[] domain = new byte[256];
-  byte[] user = new byte[256];
-  byte[] passwd = new byte[32];
-  int i;
-  // mslogon support 2 end
-
-  //
-  // init()
-  //
-
-  public void init() {
-
-    readParameters();
-
-    if (inSeparateFrame) {
-      vncFrame = new Frame("Ultr at VNC");
-      if (!inAnApplet) {
-	vncFrame.add("Center", this);
-      }
-      vncContainer = vncFrame;
-    } else {
-      vncContainer = this;
-    }
-
-    recordingSync = new Object();
-
-    options = new OptionsFrame(this);
-    clipboard = new ClipboardFrame(this);
-    // authenticator = new AuthPanel(false);   // mslogon support : go to connectAndAuthenticate()
-    if (RecordingFrame.checkSecurity())
-      rec = new RecordingFrame(this);
-
-    sessionFileName = null;
-    recordingActive = false;
-    recordingStatusChanged = false;
-    cursorUpdatesDef = null;
-    eightBitColorsDef = null;
-
-    if (inSeparateFrame)
-      vncFrame.addWindowListener(this);
-
-    ftp = new FTPFrame(this); // KMC: FTPFrame creation
-    rfbThread = new Thread(this);
-    rfbThread.start();
-  }
-
-  public void update(Graphics g) {
-  }
-
-  //
-  // run() - executed by the rfbThread to deal with the RFB socket.
-  //
-
-  public void run() {
-
-    gridbag = new GridBagLayout();
-    vncContainer.setLayout(gridbag);
-
-    GridBagConstraints gbc = new GridBagConstraints();
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gbc.anchor = GridBagConstraints.NORTHWEST;
-
-    if (showControls) {
-      buttonPanel = new ButtonPanel(this);
-      gridbag.setConstraints(buttonPanel, gbc);
-      vncContainer.add(buttonPanel);
-    }
-
-    try {
-      connectAndAuthenticate();
-
-      doProtocolInitialisation();
-
-      vc = new VncCanvas(this);
-      gbc.weightx = 1.0;
-      gbc.weighty = 1.0;
-
-	// Add ScrollPanel to applet mode
-
-	// Create a panel which itself is resizeable and can hold
-	// non-resizeable VncCanvas component at the top left corner.
-	Panel canvasPanel = new Panel();
-	canvasPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
-	canvasPanel.add(vc);
-
-	// Create a ScrollPane which will hold a panel with VncCanvas
-	// inside.
-	desktopScrollPane = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
-	gbc.fill = GridBagConstraints.BOTH;
-	gridbag.setConstraints(desktopScrollPane, gbc);
-	desktopScrollPane.add(canvasPanel);
-
-      if (inSeparateFrame) {
-	// Finally, add our ScrollPane to the Frame window.
-	vncFrame.add(desktopScrollPane);
-	vncFrame.setTitle(rfb.desktopName);
-	vncFrame.pack();
-	vc.resizeDesktopFrame();
-      } else {
-	// Finally, add the scrollable panel component to the Applet.
-        gridbag.setConstraints(desktopScrollPane, gbc);
-	add(desktopScrollPane);
-
-	// Add ScrollPanel to applet mode end
- 
-	validate();
-
-      }
-
-      if (showControls)
-	buttonPanel.enableButtons();
-
-      moveFocusToDesktop();
-      vc.processNormalProtocol();
-
-    } catch (NoRouteToHostException e) {
-      e.printStackTrace();
-      fatalError("Network error: no route to server: " + host);
-    } catch (UnknownHostException e) {
-      e.printStackTrace();
-      fatalError("Network error: server name unknown: " + host);
-    } catch (ConnectException e) {
-      e.printStackTrace();
-      fatalError("Network error: could not connect to server: " +
-		 host + ":" + port);
-    } catch (EOFException e) {
-      e.printStackTrace();
-      if (showOfflineDesktop) {
-	System.out.println("Network error: remote side closed connection");
-	if (vc != null) {
-	  vc.enableInput(false);
-	}
-	if (inSeparateFrame) {
-	  vncFrame.setTitle(rfb.desktopName + " [disconnected]");
-	}
-	if (rfb != null) {
-	  rfb.close();
-	  rfb = null;
-	}
-	if (showControls && buttonPanel != null) {
-	  buttonPanel.disableButtonsOnDisconnect();
-	  if (inSeparateFrame) {
-	    vncFrame.pack();
-	  } else {
-	    validate();
-	  }
-	}
-      } else {
-	fatalError("Network error: remote side closed connection");
-      }
-    } catch (IOException e) {
-      String str = e.getMessage();
-      e.printStackTrace();
-      if (str != null && str.length() != 0) {
-	fatalError("Network Error: " + str);
-      } else {
-	fatalError(e.toString());
-      }
-    } catch (Exception e) {
-      String str = e.getMessage();
-      e.printStackTrace();
-      if (str != null && str.length() != 0) {
-	fatalError("Error: " + str);
-      } else {
-	fatalError(e.toString());
-      }
-    }
-    
-  }
-
-
-  //
-  // Connect to the RFB server and authenticate the user.
-  //
-
-  void connectAndAuthenticate() throws Exception {
-
-    // If "ENCPASSWORD" parameter is set, decrypt the password into
-    // the passwordParam string.
-
-    if (encPasswordParam != null) {
-      // ENCPASSWORD is hexascii-encoded. Decode.
-      byte[] pw = {0, 0, 0, 0, 0, 0, 0, 0};
-      int len = encPasswordParam.length() / 2;
-      if (len > 8)
-	len = 8;
-      for (int i = 0; i < len; i++) {
-	String hex = encPasswordParam.substring(i*2, i*2+2);
-	Integer x = new Integer(Integer.parseInt(hex, 16));
-	pw[i] = x.byteValue();
-      }
-
-      // Decrypt the password.
-      byte[] key = {23, 82, 107, 6, 35, 78, 88, 7};
-      DesCipher des = new DesCipher(key);
-      des.decrypt(pw, 0, pw, 0);
-      passwordParam = new String(pw);
-    }
-
-    // If a password parameter ("PASSWORD" or "ENCPASSWORD") is set,
-    // don't ask user a password, get one from passwordParam instead.
-    // Authentication failures would be fatal.
-
-    if (passwordParam != null) {
-      if (inSeparateFrame) {
-	vncFrame.pack();
-	vncFrame.show();
-      } else {
-	validate();
-      }
-      if (!tryAuthenticate(usernameParam,passwordParam)) {
-	throw new Exception("VNC authentication failed");
-      }
-      return;
-    }
-
-    // There is no "PASSWORD" or "ENCPASSWORD" parameters -- ask user
-    // for a password, try to authenticate, retry on authentication
-    // failures.
-
-    // mslogon support
-    //
-    // Detect Auth Protocol (Ultr at VNC or the standard One)
-    // To know if we must show the username box
-    //
-
-    
-    //prologueDetectAuthProtocol() ;
-
-    authenticator = new AuthPanel(mslogon);
-    
-    // mslogon support end
-    
-    GridBagConstraints gbc = new GridBagConstraints();
-    gbc.gridwidth = GridBagConstraints.REMAINDER;
-    gbc.anchor = GridBagConstraints.NORTHWEST;
-    gbc.weightx = 1.0;
-    gbc.weighty = 1.0;
-    gbc.ipadx = 100;
-    gbc.ipady = 50;
-    
-    gridbag.setConstraints(authenticator, gbc);
-    vncContainer.add(authenticator);
-
-    if (inSeparateFrame) {
-      vncFrame.pack();
-      vncFrame.show();
-    } else {
-      validate();
-      // FIXME: here moveFocusToPasswordField() does not always work
-      // under Netscape 4.7x/Java 1.1.5/Linux. It seems like this call
-      // is being executed before the password field of the
-      // authenticator is fully drawn and activated, therefore
-      // requestFocus() does not work. Currently, I don't know how to
-      // solve this problem.
-      //   -- const
-      
-     //mslogon support 
-     //mslogon support end
-    }
-
-	authenticator.setUserName(readParameter("USER", false));
-	if( readParameter("USER", false) == null )
-	{
-		authenticator.moveFocusToUsernameField();
-	}
-	else
-	{
-		authenticator.moveFocusToPasswordField();
-	}
-
-    while (true) {
-      // Wait for user entering a password, or a username and a password
-      synchronized(authenticator) {
-	try {
-	  authenticator.wait();
-	} catch (InterruptedException e) {
-	}
-      }
-
-      // Try to authenticate with a given password.
-      //mslogon support 
-      String us;
-      if (mslogon) { us = authenticator.username.getText(); }
-      else { us = "";}
-
-      if (tryAuthenticate(us,authenticator.password.getText()))
-	break;
-      //mslogon support end
-
-      // Retry on authentication failure.
-      authenticator.retry();
-    }
-
-    vncContainer.remove(authenticator);
-  }
-
-  // mslogon support
-  //
-  // Detect Server rfb Protocol to know the auth Method
-  // Perform a connexion to detect the Serverminor 
-  //
-
-  void prologueDetectAuthProtocol() throws Exception {
-
-    rfb = new RfbProto(host, port, this, null, 0); // Modif: troessner - sf at 2007: not yet used
-
-    rfb.readVersionMsg();
-
-    System.out.println("RFB server supports protocol version " +
-		       rfb.serverMajor + "." + rfb.serverMinor);
-
-    // Mslogon support 
-    if (rfb.serverMinor == 4) {
-	    mslogon = true;    
-	    System.out.println("Ultr at VNC mslogon detected");
-    }
-    
-    rfb.writeVersionMsg();
-
-  }
-  
-  // mslogon support end
-
-
-  //
-  // Try to authenticate with a given password.
-  //
-
-  boolean tryAuthenticate(String us, String pw) throws Exception {
-    
-    rfb = new RfbProto(host, port, this, null, 0); // Modif: troessner - sf at 2007: not yet used
-
-    rfb.readVersionMsg();
-
-    System.out.println("RFB server supports protocol version " +
-		       rfb.serverMajor + "." + rfb.serverMinor);
-
-    rfb.writeVersionMsg();
-
-    int authScheme = rfb.readAuthScheme();
-
-    switch (authScheme) {
-
-    case RfbProto.NoAuth:
-      System.out.println("No authentication needed");
-      return true;
-
-    case RfbProto.VncAuth:
-      
-      if (mslogon) {
-    	  System.out.println("showing JOptionPane warning.");
-    	  int n = JOptionPane.showConfirmDialog(
-                  vncFrame, "The current authentication method does not transfer your password securely."
-                   + "Do you want to continue?",
-                  "Warning",
-                  JOptionPane.YES_NO_OPTION);
-          if (n != JOptionPane.YES_OPTION) {
-              throw new Exception("User cancelled insecure MS-Logon");
-          }
-      }
-      // mslogon support 
-      byte[] challengems = new byte[64];
-      if (mslogon) { 
-        // copy the us (user) parameter into the user Byte formated variable 
-	System.arraycopy(us.getBytes(), 0, user, 0, us.length() );
-	// and pad it with Null
-	if (us.length() < 256) {
-	  for (i=us.length(); i<256; i++){ user[i]= 0; }
-	}
-
-	dm = ".";
-        // copy the dm (domain) parameter into the domain Byte formated variable 
-        System.arraycopy(dm.getBytes(), 0, domain, 0, dm.length() );
-	// and pad it with Null
-	if (dm.length() < 256) {
-	  for (i=dm.length(); i<256; i++){ domain[i]= 0; }
-	}
-		
-        // equivalent of vncEncryptPasswdMS
-	 
-        // copy the pw (password) parameter into the password Byte formated variable 
-        System.arraycopy(pw.getBytes(), 0, passwd, 0, pw.length() );
-	// and pad it with Null
-	if (pw.length() < 32) {
-	  for (i=pw.length(); i<32; i++){ passwd[i]= 0; }
-	}
-
-	// Encrypt the full given password
-        byte[] fixedkey = {23, 82, 107, 6, 35, 78, 88, 7};
-        DesCipher desme = new DesCipher(fixedkey);
-        desme.encrypt(passwd, 0, passwd, 0);
-
-        // end equivalent of vncEncryptPasswdMS
-
-	// get the mslogon Challenge from server 
-        rfb.is.readFully(challengems);
-      }
-      // mslogon support end
-      
-      byte[] challenge = new byte[16];
-      rfb.is.readFully(challenge);
-
-      if (pw.length() > 8)
-	pw = pw.substring(0, 8); // Truncate to 8 chars
-
-      // vncEncryptBytes in the UNIX libvncauth truncates password
-      // after the first zero byte. We do to.
-      int firstZero = pw.indexOf(0);
-      if (firstZero != -1)
-	pw = pw.substring(0, firstZero);
-
-      // mslogon support
-      if (mslogon ){ 
-        for (i= 0; i<32; i++) {
-		challengems[i]= (byte) (passwd[i]^challengems[i]);
-        }
-        rfb.os.write(user);
-        rfb.os.write(domain);
-        rfb.os.write(challengems);
-      }
-      // mslogon support end
-
-      byte[] key = {0, 0, 0, 0, 0, 0, 0, 0};
-      System.arraycopy(pw.getBytes(), 0, key, 0, pw.length());
-
-      DesCipher des = new DesCipher(key);
-
-      des.encrypt(challenge, 0, challenge, 0);
-      des.encrypt(challenge, 8, challenge, 8);
-     
-      rfb.os.write(challenge);
-
-      int authResult = rfb.is.readInt();
-
-      switch (authResult) {
-      case RfbProto.VncAuthOK:
-	System.out.println("VNC authentication succeeded");
-	return true;
-      case RfbProto.VncAuthFailed:
-	System.out.println("VNC authentication failed");
-	break;
-      case RfbProto.VncAuthTooMany:
-	throw new Exception("VNC authentication failed - too many tries");
-      default:
-	throw new Exception("Unknown VNC authentication result " + authResult);
-      }
-      break;
-
-    case RfbProto.MsLogon:
-    	System.out.println("MS-Logon (DH) detected");
-		if (AuthMsLogon(us, pw)) {
-			return true;
-		}
-		break;
-    default:
-      throw new Exception("Unknown VNC authentication scheme " + authScheme);
-    }
-    return false;
-  }
-
-  // marscha at 2006: Try to better hide the windows password.
-  // I know that this is no breakthrough in modern cryptography.
-  // It's just a patch/kludge/workaround.
-  boolean AuthMsLogon(String us, String pw) throws Exception {
-	byte user[] = new byte[256];
-	byte passwd[] = new byte[64];
-
-    long gen  = rfb.is.readLong();
-	long mod  = rfb.is.readLong();
-	long resp = rfb.is.readLong();
-		
-	DH dh = new DH(gen, mod);
-	long pub = dh.createInterKey();
-
-	rfb.os.write(DH.longToBytes(pub));
-
-	long key = dh.createEncryptionKey(resp);
-	System.out.println("gen=" + gen + ", mod=" + mod
-			+ ", pub=" + pub + ", key=" + key);
-
-	DesCipher des = new DesCipher(DH.longToBytes(key));
-
-	System.arraycopy(us.getBytes(), 0, user, 0, us.length() );
-	// and pad it with Null
-	if (us.length() < 256) {
-	  for (i=us.length(); i<256; i++){ user[i]= 0; }
-	}
-
-    // copy the pw (password) parameter into the password Byte formated variable 
-    System.arraycopy(pw.getBytes(), 0, passwd, 0, pw.length() );
-	// and pad it with Null
-	if (pw.length() < 32) {
-	  for (i=pw.length(); i<32; i++){ passwd[i]= 0; }
-	}
-
-	//user = domain + "\\" + user;
-
-	des.encryptText(user, user, DH.longToBytes(key));
-	des.encryptText(passwd, passwd, DH.longToBytes(key));
-	
-	rfb.os.write(user);
-	rfb.os.write(passwd);
-
-
-    int authResult = rfb.is.readInt();
-
-    switch (authResult) {
-      case RfbProto.VncAuthOK:
-	System.out.println("MS-Logon (DH) authentication succeeded");
-	return true;
-      case RfbProto.VncAuthFailed:
-	System.out.println("MS-Logon (DH) authentication failed");
-	break;
-      case RfbProto.VncAuthTooMany:
-	throw new Exception("MS-Logon (DH) authentication failed - too many tries");
-      default:
-	throw new Exception("Unknown MS-Logon (DH) authentication result " + authResult);
-    }
-    return false;
-}
-
-
-  //
-  // Do the rest of the protocol initialisation.
-  //
-
-  void doProtocolInitialisation() throws IOException {
-
-    rfb.writeClientInit();
-
-    rfb.readServerInit();
-
-    System.out.println("Desktop name is " + rfb.desktopName);
-    System.out.println("Desktop size is " + rfb.framebufferWidth + " x " +
-		       rfb.framebufferHeight);
-
-    setEncodings();
-  }
-
-
-  //
-  // Send current encoding list to the RFB server.
-  //
-
-  void setEncodings() {
-    try {
-      if (rfb != null && rfb.inNormalProtocol) {
-	rfb.writeSetEncodings(options.encodings, options.nEncodings);
-	if (vc != null) {
-	  vc.softCursorFree();
-	}
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-
-
-  //
-  // setCutText() - send the given cut text to the RFB server.
-  //
-
-  void setCutText(String text) {
-    try {
-      if (rfb != null && rfb.inNormalProtocol) {
-	rfb.writeClientCutText(text);
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-
-
-  //
-  // Order change in session recording status. To stop recording, pass
-  // null in place of the fname argument.
-  //
-
-  void setRecordingStatus(String fname) {
-    synchronized(recordingSync) {
-      sessionFileName = fname;
-      recordingStatusChanged = true;
-    }
-  }
-
-  //
-  // Start or stop session recording. Returns true if this method call
-  // causes recording of a new session.
-  //
-
-  boolean checkRecordingStatus() throws IOException {
-    synchronized(recordingSync) {
-      if (recordingStatusChanged) {
-	recordingStatusChanged = false;
-	if (sessionFileName != null) {
-	  startRecording();
-	  return true;
-	} else {
-	  stopRecording();
-	}
-      }
-    }
-    return false;
-  }
-
-  //
-  // Start session recording.
-  //
-
-  protected void startRecording() throws IOException {
-    synchronized(recordingSync) {
-      if (!recordingActive) {
-	// Save settings to restore them after recording the session.
-	cursorUpdatesDef =
-	  options.choices[options.cursorUpdatesIndex].getSelectedItem();
-	eightBitColorsDef =
-	  options.choices[options.eightBitColorsIndex].getSelectedItem();
-	// Set options to values suitable for recording.
-	options.choices[options.cursorUpdatesIndex].select("Disable");
-	options.choices[options.cursorUpdatesIndex].setEnabled(false);
-	options.setEncodings();
-	options.choices[options.eightBitColorsIndex].select("Full");
-	options.choices[options.eightBitColorsIndex].setEnabled(false);
-	options.setColorFormat();
-      } else {
-	rfb.closeSession();
-      }
-
-      System.out.println("Recording the session in " + sessionFileName);
-      rfb.startSession(sessionFileName);
-      recordingActive = true;
-    }
-  }
-
-  //
-  // Stop session recording.
-  //
-
-  protected void stopRecording() throws IOException {
-    synchronized(recordingSync) {
-      if (recordingActive) {
-	// Restore options.
-	options.choices[options.cursorUpdatesIndex].select(cursorUpdatesDef);
-	options.choices[options.cursorUpdatesIndex].setEnabled(true);
-	options.setEncodings();
-	options.choices[options.eightBitColorsIndex].select(eightBitColorsDef);
-	options.choices[options.eightBitColorsIndex].setEnabled(true);
-	options.setColorFormat();
-
-	rfb.closeSession();
-	System.out.println("Session recording stopped.");
-      }
-      sessionFileName = null;
-      recordingActive = false;
-    }
-  }
-
-
-  //
-  // readParameters() - read parameters from the html source or from the
-  // command line.  On the command line, the arguments are just a sequence of
-  // param_name/param_value pairs where the names and values correspond to
-  // those expected in the html applet tag source.
-  //
-
-  public void readParameters() {
-    host = readParameter("HOST", !inAnApplet);
-    if (host == null) {
-      host = getCodeBase().getHost();
-      if (host.equals("")) {
-	fatalError("HOST parameter not specified");
-      }
-    }
-
-    String str = readParameter("PORT", true);
-    port = Integer.parseInt(str);
-
-    if (inAnApplet) {
-      str = readParameter("Open New Window", false);
-      if (str != null && str.equalsIgnoreCase("Yes"))
-	inSeparateFrame = true;
-    }
-
-    encPasswordParam = readParameter("ENCPASSWORD", false);
-    if (encPasswordParam == null)
-      passwordParam = readParameter("PASSWORD", false);
-
-    usernameParam = readParameter("USER", false);
-    // "Show Controls" set to "No" disables button panel.
-    showControls = true;
-    str = readParameter("Show Controls", false);
-    if (str != null && str.equalsIgnoreCase("No"))
-      showControls = false;
-
-    // Do we continue showing desktop on remote disconnect?
-    showOfflineDesktop = false;
-    str = readParameter("Show Offline Desktop", false);
-    if (str != null && str.equalsIgnoreCase("Yes"))
-      showOfflineDesktop = true;
-
-    // Fine tuning options.
-    deferScreenUpdates = readIntParameter("Defer screen updates", 20);
-    deferCursorUpdates = readIntParameter("Defer cursor updates", 10);
-    deferUpdateRequests = readIntParameter("Defer update requests", 50);
-  }
-
-  public String readParameter(String name, boolean required) {
-    if (inAnApplet) {
-      String s = getParameter(name);
-      if ((s == null) && required) {
-	fatalError(name + " parameter not specified");
-      }
-      return s;
-    }
-
-    for (int i = 0; i < mainArgs.length; i += 2) {
-      if (mainArgs[i].equalsIgnoreCase(name)) {
-	try {
-	  return mainArgs[i+1];
-	} catch (Exception e) {
-	  if (required) {
-	    fatalError(name + " parameter not specified");
-	  }
-	  return null;
-	}
-      }
-    }
-    if (required) {
-      fatalError(name + " parameter not specified");
-    }
-    return null;
-  }
-
-  int readIntParameter(String name, int defaultValue) {
-    String str = readParameter(name, false);
-    int result = defaultValue;
-    if (str != null) {
-      try {
-	result = Integer.parseInt(str);
-      } catch (NumberFormatException e) { }
-    }
-    return result;
-  }
-
-  //
-  // moveFocusToDesktop() - move keyboard focus either to the
-  // VncCanvas or to the AuthPanel.
-  //
-
-  void moveFocusToDesktop() {
-    if (vncContainer != null) {
-      if (vc != null && vncContainer.isAncestorOf(vc)) {
-	vc.requestFocus();
-      } else if (vncContainer.isAncestorOf(authenticator)) {
-	authenticator.moveFocusToPasswordField();
-      }
-    }
-  }
-
-  //
-  // disconnect() - close connection to server.
-  //
-
-  boolean disconnectRequested = false;
-
-  synchronized public void disconnect() {
-    disconnectRequested = true;
-    if (rfb != null) {
-      rfb.close();
-      rfb = null;
-    }
-    System.out.println("Disconnect");
-    options.dispose();
-    clipboard.dispose();
-    if (rec != null)
-      rec.dispose();
-
-    if (inAnApplet) {
-      vncContainer.removeAll();
-      Label errLabel = new Label("Disconnected");
-      errLabel.setFont(new Font("Helvetica", Font.PLAIN, 12));
-      vncContainer.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 30));
-      vncContainer.add(errLabel);
-      if (inSeparateFrame) {
-	vncFrame.pack();
-      } else {
-	validate();
-      }
-      rfbThread.stop();
-    } else {
-      System.exit(0);
-    }
-  }
-
-  //
-  // fatalError() - print out a fatal error message.
-  //
-
-  synchronized public void fatalError(String str) {
-    if (rfb != null) {
-      rfb.close();
-      rfb = null;
-    }
-    System.out.println(str);
-
-    if (disconnectRequested) {
-      // Not necessary to show error message if the error was caused
-      // by I/O problems after the disconnect() method call.
-      disconnectRequested = false;
-      return;
-    }
-
-    if (inAnApplet) {
-      vncContainer.removeAll();
-      Label errLabel = new Label(str);
-      errLabel.setFont(new Font("Helvetica", Font.PLAIN, 12));
-      vncContainer.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 30));
-      vncContainer.add(errLabel);
-      if (inSeparateFrame) {
-	vncFrame.pack();
-      } else {
-	validate();
-      }
-      Thread.currentThread().stop();
-    } else {
-      System.exit(1);
-    }
-  }
-
-
-  //
-  // This method is called before the applet is destroyed.
-  //
-
-  public void destroy() {
-    vncContainer.removeAll();
-    options.dispose();
-    clipboard.dispose();
-    if (ftp != null)
-      ftp.dispose();
-    if (rec != null)
-      rec.dispose();
-    if (rfb != null)
-      rfb.close();
-    if (inSeparateFrame)
-      vncFrame.dispose();
-  }
-
-
-  //
-  // Close application properly on window close event.
-  //
-
-  public void windowClosing(WindowEvent evt) {
-    if (rfb != null)
-      disconnect();
-
-    vncFrame.dispose();
-    if (!inAnApplet) {
-      System.exit(0);
-    }
-  }
-
-  //
-  // Move the keyboard focus to the password field on window activation.
-  //
-
-  public void windowActivated(WindowEvent evt) {
-    if (vncFrame.isAncestorOf(authenticator))
-      authenticator.moveFocusToPasswordField();
-  }
-
-  //
-  // Ignore window events we're not interested in.
-  //
-
-  public void windowDeactivated (WindowEvent evt) {}
-  public void windowOpened(WindowEvent evt) {}
-  public void windowClosed(WindowEvent evt) {}
-  public void windowIconified(WindowEvent evt) {}
-  public void windowDeiconified(WindowEvent evt) {}
-}
diff --git a/ica/JavaViewer/dir.mk b/ica/JavaViewer/dir.mk
deleted file mode 100644
index cf383d6..0000000
--- a/ica/JavaViewer/dir.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Making the VNC applet.
-#
-
-CLASSES = VncViewer.class RfbProto.class AuthPanel.class VncCanvas.class \
-	  OptionsFrame.class ClipboardFrame.class ButtonPanel.class \
-	  DesCipher.class
-
-PAGES = index.vnc shared.vnc noshared.vnc hextile.vnc zlib.vnc tight.vnc
-
-all: $(CLASSES) VncViewer.jar
-
-VncViewer.jar: $(CLASSES)
-	@$(JavaArchive)
-
-export:: $(CLASSES) VncViewer.jar $(PAGES)
-	@$(ExportJavaClasses)
-
-clean::
-	$(RM) *.class *.jar
diff --git a/ica/JavaViewer/hextile.vnc b/ica/JavaViewer/hextile.vnc
deleted file mode 100644
index 5392c8f..0000000
--- a/ica/JavaViewer/hextile.vnc
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- hextile.vnc - hextile html page for Java VNC viewer applet.  On
-     any file ending in .vnc, the HTTP server embedded in Xvnc will
-     substitute the following variables when preceded by a dollar:
-     USER, DESKTOP, DISPLAY, APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT,
-     PORT.  Use two dollar signs ($$) to get a dollar sign in the
-     generated html. -->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop ($DISPLAY)
-</TITLE>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-<param name=ENCODING value=Hextile>
-</APPLET>
-<BR>
-<A href="http://ultravnc.sf.net/">UltraVNC Site</A>
-</HTML>
diff --git a/ica/JavaViewer/index.vnc b/ica/JavaViewer/index.vnc
deleted file mode 100644
index 614b774..0000000
--- a/ica/JavaViewer/index.vnc
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- index.vnc - default html page for Java VNC viewer applet.  On any file
-     ending in .vnc, the HTTP server embedded in Xvnc will substitute the
-     following variables when preceded by a dollar: USER, DESKTOP, DISPLAY,
-     APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT, PORT.  Use two dollar signs
-     ($$) to get a dollar sign in the generated html. -->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop ($DISPLAY)
-</TITLE>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-$PARAMS
-</APPLET>
-</HTML>
diff --git a/ica/JavaViewer/mk.bat b/ica/JavaViewer/mk.bat
deleted file mode 100644
index 7bb682e..0000000
--- a/ica/JavaViewer/mk.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-c:\sam\jdk1.3.1_15\bin\javac.exe *.java
-c:\sam\jdk1.3.1_15\bin\jar.exe cf VncViewer.jar *.class
diff --git a/ica/JavaViewer/noshared.vnc b/ica/JavaViewer/noshared.vnc
deleted file mode 100644
index df145c7..0000000
--- a/ica/JavaViewer/noshared.vnc
+++ /dev/null
@@ -1,17 +0,0 @@
-<!-- This is an example of how to set default options in the Java VNC viewer
-     applet - in this case the "Share Desktop" option is set to "No".  Any
-     option can be set by giving a parameter with the same name as the
-     option (spaces are important, but case isn't) -->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop ($DISPLAY) [not shared]
-</TITLE>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-<param name="share desktop" value=no>
-</APPLET>
-<BR>
-<A href="http://ultravnc.sf.net/">UltraVNC Site</A>
-</HTML>
diff --git a/ica/JavaViewer/run.bat b/ica/JavaViewer/run.bat
deleted file mode 100644
index 78b0653..0000000
--- a/ica/JavaViewer/run.bat
+++ /dev/null
@@ -1 +0,0 @@
-java.exe -cp "s:\svn\ultravnc\Ultravnc Project Root\Ultravnc\JavaViewer" VncViewer HOST localhost PORT 5900
diff --git a/ica/JavaViewer/runapplet.bat b/ica/JavaViewer/runapplet.bat
deleted file mode 100644
index 9e1b7ff..0000000
--- a/ica/JavaViewer/runapplet.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-c:\sam\jdk1.3.1_15\bin\appletviewer.exe vncviewer.jar
-
diff --git a/ica/JavaViewer/shared.vnc b/ica/JavaViewer/shared.vnc
deleted file mode 100644
index 0b518b3..0000000
--- a/ica/JavaViewer/shared.vnc
+++ /dev/null
@@ -1,17 +0,0 @@
-<!-- This is an example of how to set default options in the Java VNC viewer
-     applet - in this case the "Share Desktop" option is set to "Yes".  Any
-     option can be set by giving a parameter with the same name as the
-     option (spaces are important, but case isn't) -->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop ($DISPLAY) [shared]
-</TITLE>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-<param name="share desktop" value=yes>
-</APPLET>
-<BR>
-<A href="http://ultravnc.sf.net/">UltraVNC Site</A>
-</HTML>
diff --git a/ica/JavaViewer/tight.vnc b/ica/JavaViewer/tight.vnc
deleted file mode 100644
index 3dcbae1..0000000
--- a/ica/JavaViewer/tight.vnc
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- tight.vnc - tight html page for Java VNC viewer applet.  On any file
-     ending in .vnc, the HTTP server embedded in Xvnc will substitute the
-     following variables when preceded by a dollar: USER, DESKTOP, DISPLAY,
-     APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT, PORT.  Use two dollar signs
-     ($$) to get a dollar sign in the generated html. -->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop ($DISPLAY)
-</TITLE>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-<param name=ENCODING value=Tight>
-</APPLET>
-<BR>
-<A href="http://ultravnc.sf.net/">UltraVNC Site</A>
-</HTML>
diff --git a/ica/JavaViewer/zlib.vnc b/ica/JavaViewer/zlib.vnc
deleted file mode 100644
index 991d375..0000000
--- a/ica/JavaViewer/zlib.vnc
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- zlib.vnc - zlib html page for Java VNC viewer applet.  On any file
-     ending in .vnc, the HTTP server embedded in Xvnc will substitute the
-     following variables when preceded by a dollar: USER, DESKTOP, DISPLAY,
-     APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT, PORT.  Use two dollar signs
-     ($$) to get a dollar sign in the generated html. -->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop ($DISPLAY)
-</TITLE>
-<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-<param name=ENCODING value=Zlib>
-</APPLET>
-<BR>
-<A href="http://ultravnc.sf.net/">UltraVNC Site</A>
-</HTML>
diff --git a/ica/helpers/CMakeLists.txt b/ica/helpers/CMakeLists.txt
deleted file mode 100644
index 6fc4a7c..0000000
--- a/ica/helpers/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-LINK_LIBRARIES(${PAM_LIBRARY})
-INCLUDE_DIRECTORIES(${PAM_INCLUDE_DIR})
-ADD_EXECUTABLE(italc_auth_helper ${CMAKE_CURRENT_SOURCE_DIR}/ItalcAuthHelper.cpp)
-INSTALL(TARGETS italc_auth_helper RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE SETUID GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/ica/helpers/ItalcAuthHelper.cpp b/ica/helpers/ItalcAuthHelper.cpp
deleted file mode 100644
index 9705d32..0000000
--- a/ica/helpers/ItalcAuthHelper.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <cstdlib>
-
-#include <QtCore/QDataStream>
-#include <QtCore/QFile>
-
-#include <security/pam_appl.h>
-
-
-static QString username, password;
-
-static int pam_conv( int num_msg, const struct pam_message **msg,
-						struct pam_response **resp,
-						void *appdata_ptr )
-{
-	struct pam_response *reply = NULL;
-
-	reply = (pam_response *) malloc( sizeof(struct pam_response) * num_msg );
-	if( !reply )
-	{
-		return PAM_CONV_ERR;
-	}
-
-	for( int replies = 0; replies < num_msg; ++replies )
-	{
-		switch( msg[replies]->msg_style )
-		{
-			case PAM_PROMPT_ECHO_ON:
-				reply[replies].resp_retcode = PAM_SUCCESS;
-				reply[replies].resp = strdup( username.toUtf8().constData() );
-				break;
-			case PAM_PROMPT_ECHO_OFF:
-				reply[replies].resp_retcode = PAM_SUCCESS;
-				reply[replies].resp = strdup( password.toUtf8().constData() );
-				break;
-			case PAM_TEXT_INFO:
-			case PAM_ERROR_MSG:
-				reply[replies].resp_retcode = PAM_SUCCESS;
-				reply[replies].resp = NULL;
-				break;
-			default:
-				free( reply );
-				return PAM_CONV_ERR;
-		}
-	}
-
-	*resp = reply;
-	return PAM_SUCCESS;
-}
-
-
-int main()
-{
-	QFile stdIn;
-	stdIn.open( 0, QFile::ReadOnly );
-	QDataStream ds( &stdIn );
-	ds >> username;
-	ds >> password;
-
-	struct pam_conv pconv = { &pam_conv, NULL };
-	pam_handle_t *pamh;
-	int err = pam_start( "su", NULL, &pconv, &pamh );
-
-	err = pam_authenticate( pamh, PAM_SILENT );
-	if( err == PAM_SUCCESS )
-	{
-		pam_open_session( pamh, PAM_SILENT );
-		pam_end( pamh, err );
-		return 0;
-	}
-	else
-	{
-		printf( "%s\n", pam_strerror( pamh, err ) );
-	}
-
-	pam_end( pamh, err );
-
-	return -1;
-}
diff --git a/ica/ica.1 b/ica/ica.1
deleted file mode 100644
index 1e87dbf..0000000
--- a/ica/ica.1
+++ /dev/null
@@ -1,101 +0,0 @@
-.\"                                      Hey, EMACS: -*- nroff -*-
-.\" First parameter, NAME, should be all caps
-.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
-.\" other parameters are allowed: see man(7), man(1)
-.TH ICA 1 2013-08-12 iTALC
-.\" Please adjust this date whenever revising the manpage.
-.\"
-.\" Some roff macros, for reference:
-.\" .nh        disable hyphenation
-.\" .hy        enable hyphenation
-.\" .ad l      left justify
-.\" .ad b      justify to both left and right margins
-.\" .nf        disable filling
-.\" .fi        enable filling
-.\" .br        insert line break
-.\" .sp <n>    insert n+1 empty lines
-.\" for manpage-specific macros, see man(7)
-.SH NAME
-ica \- iTALC Client Application
-.SH SYNOPSIS
-.B ica
-.RB "[options]"
-.br
-.B ica
-.RI "[options] [command]"
-.SH DESCRIPTION
-.PP
-.\" TeX users may be more comfortable with the \fB<whatever>\fP and
-.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
-.\" respectively.
-.B ICA
-is the software which needs to run on clients in order to access them using iTALC master application. It provides a VNC server and a service daemon which is neccessary for taking control over the client.
-
-.SH iTALC OPTIONS
-.IP "\fB\-role\fP \fIrole\fP
-.IP
-Set role under which ICA should run where \fIrole\fP has to be "teacher", "admin", "supporter" or "other".
-.IP "\fB\-port\fP \fIport\fP
-.IP
-Set port at which the iTALC VNC server should listen. Default: 11100
-.PP
-The \fB\-createkeypair\fP option has been moved to the iTALC Management Console \fBimc\fP since iTALC 2.0.0.
-
-.SH X11VNC OPTIONS
-.IP \fB-noshm\fR
-.IP
-Do not use the MIT-SHM extension for the polling.
-Remote displays can be polled this way: be careful this
-can use large amounts of network bandwidth.  This is
-also of use if the local machine has a limited number
-of shm segments and \fB-onetile\fR is not sufficient.
-.PP
-\fB-onetile\fR
-.IP
-Do not use the new copy_tiles() framebuffer mechanism,
-just use 1 shm tile for polling.  Limits shm segments
-used to 3.
-.PP
-\fB-nosel\fR
-.IP
- Do not manage exchange of X selection/cutbuffer between VNC viewers and the X server at all.
-.PP
-\fB-nosetclipboard\fR
-.IP
-Do not set the CLIPBOARD selection for changes received from VNC clients.
-.PP
-\fB-solid\fR \fI[color]\fR
-.IP
-To improve performance, when VNC clients are connected try to change the desktop background to a solid color.  The [color] is optional: the
-default color is "cyan4".  For a different one specify the X color (rgb.txt name, e.g. "darkblue" or numerical "#RRGGBB").
-.IP
-Currently  this  option only works on GNOME, KDE3, CDE, XFCE, and classic X (i.e. with the background image on the root window).  The "gconftool-2",
-"dcop" and "xfconf-query" external commands are run for GNOME, KDE, and XFCE respectively.
-(There  is  no  color selection for XFCE.)  Other desktops won't work, (send us the corresponding commands if you find them).
-.IP
-
-.PP
-\fB-xrandr\fR \fI[mode]\fR
-.IP
-If  the display supports the XRANDR (X Resize, Rotate and Reflection) extension, and you expect XRANDR events to occur to the display while
-x11vnc is running, this options indicates x11vnc should try to respond to them (as opposed to simply crashing by assuming  the  old  screen
-size).  See the xrandr(1) manpage and run ´xrandr -q' for more info.  [mode] is optional and described below.
-.IP
-Since  watching for XRANDR events and trapping errors increases polling overhead, only use this option if XRANDR changes are expected.  For
-example on a rotatable screen PDA or laptop, or using a XRANDR-aware Desktop where you resize often.  It is  best  to  be  viewing  with  a
-vncviewer that supports the NewFBSize encoding, since it knows how to react to screen size changes.  Otherwise, LibVNCServer tries to do so
-something reasonable for viewers that cannot do this (portions of the screen may be clipped, unused, etc).
-.IP
-"mode"  defaults  to  "resize",  which means create a new, resized, framebuffer and hope all viewers can cope with the change.  "newfbsize"
-means first disconnect all viewers that do not support the NewFBSize VNC encoding, and then resize the framebuffer.  "exit"  means  disconnect
-all viewer clients, and then terminate x11vnc.
-.PP
-.SH SEE ALSO
-.IR italc (1), imc (8), italc_auth_helper (1)
-.PP
-.IR http://italc.sf.net/
-
-.SH AUTHOR
-iTALC has been written by Tobias Doerffel. See AUTHORS for details.
-.PP
-This manual page has been written by Tobias Doerffel and updated by Mike Gabriel. It was originally written for the Debian project (but may be used by others).
diff --git a/ica/ica.qrc b/ica/ica.qrc
deleted file mode 100644
index 56dd4e9..0000000
--- a/ica/ica.qrc
+++ /dev/null
@@ -1,4 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-	<qresource>
-	</qresource>
-</RCC>
diff --git a/ica/ica.rc b/ica/ica.rc
deleted file mode 100644
index ca6b2dd..0000000
--- a/ica/ica.rc
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <windows.h>
-#include "win32/winvnc/winvnc/resource.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// JAVAARCHIVE
-//
-
-IDR_VNCVIEWER_JAR       JAVAARCHIVE             "JavaViewer/VncViewer.jar"
-
-
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	2,0,2,0
-  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-  FILEOS	VOS_NT_WINDOWS32
-  FILETYPE	VFT_APP
-  FILESUBTYPE	VFT2_UNKNOWN
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, charset = Windows, Multilingual
-    BEGIN
-      VALUE "Comments",		"Intelligent Teaching And Learning with Computers (http://italc.sf.net)\0"
-      VALUE "CompanyName",	"iTALC Solutions\0"
-      VALUE "FileDescription",	"iTALC Client Application\0"
-      VALUE "FileVersion",	"\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2004-2014 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"ica.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"\0"
-    END
-  END
-END
diff --git a/ica/ica.rc.in b/ica/ica.rc.in
deleted file mode 100644
index 2c0dc78..0000000
--- a/ica/ica.rc.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <windows.h>
-#include "win32/winvnc/winvnc/resource.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// JAVAARCHIVE
-//
-
-IDR_VNCVIEWER_JAR       JAVAARCHIVE             "JavaViewer/VncViewer.jar"
-
-
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	2,0,2,0
-  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-  FILEOS	VOS_NT_WINDOWS32
-  FILETYPE	VFT_APP
-  FILESUBTYPE	VFT2_UNKNOWN
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, charset = Windows, Multilingual
-    BEGIN
-      VALUE "Comments",		"Intelligent Teaching And Learning with Computers (http://italc.sf.net)\0"
-      VALUE "CompanyName",	"iTALC Solutions\0"
-      VALUE "FileDescription",	"iTALC Client Application\0"
-      VALUE "FileVersion",	"@PACKAGE_VERSION@\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2004-2014 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"ica.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"@PACKAGE_VERSION@\0"
-    END
-  END
-END
diff --git a/ica/src/AccessDialogSlave.cpp b/ica/src/AccessDialogSlave.cpp
deleted file mode 100644
index 62637f8..0000000
--- a/ica/src/AccessDialogSlave.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * AccessDialogSlave.cpp - an IcaSlave providing an access dialog
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-
-#include "AccessDialogSlave.h"
-#include "DesktopAccessPermission.h"
-#include "ItalcSlaveManager.h"
-#include "LocalSystem.h"
-
-
-AccessDialogSlave::AccessDialogSlave() :
-	IcaSlave()
-{
-}
-
-
-
-AccessDialogSlave::~AccessDialogSlave()
-{
-}
-
-
-static int exec( const QString &user, const QString &host,
-								int choiceFlags )
-{
-	QMessageBox::StandardButtons btns = QMessageBox::NoButton;
-	if( choiceFlags & DesktopAccessPermission::ChoiceYes )
-	{
-		btns |= QMessageBox::Yes;
-	}
-	if( choiceFlags & DesktopAccessPermission::ChoiceNo )
-	{
-		btns |= QMessageBox::No;
-	}
-	QMessageBox m( QMessageBox::Question,
-		AccessDialogSlave::tr( "Confirm desktop access" ),
-		AccessDialogSlave::tr( "The user %1 at host %2 wants to access your "
-								"desktop. Do you want to grant access?" ).
-									arg( user ).arg( host ), btns );
-
-	QPushButton *neverBtn = NULL, *alwaysBtn = NULL;
-	if( choiceFlags & DesktopAccessPermission::ChoiceNever )
-	{
-		neverBtn = m.addButton(
-						AccessDialogSlave::tr( "Never for this session" ),
-														QMessageBox::NoRole );
-		m.setDefaultButton( neverBtn );
-	}
-	if( choiceFlags & DesktopAccessPermission::ChoiceAlways )
-	{
-		alwaysBtn = m.addButton(
-						AccessDialogSlave::tr( "Always for this session" ),
-														QMessageBox::YesRole );
-	}
-
-	m.setEscapeButton( m.button( QMessageBox::No ) );
-
-	LocalSystem::activateWindow( &m );
-
-	const int res = m.exec();
-	if( m.clickedButton() == neverBtn )
-	{
-		return DesktopAccessPermission::ChoiceNever;
-	}
-	else if( m.clickedButton() == alwaysBtn )
-	{
-		return DesktopAccessPermission::ChoiceAlways;
-	}
-	else if( res == QMessageBox::Yes )
-	{
-		return DesktopAccessPermission::ChoiceYes;
-	}
-
-	return DesktopAccessPermission::ChoiceNo;
-}
-
-
-
-
-bool AccessDialogSlave::handleMessage( const Ipc::Msg &m )
-{
-	if( m.cmd() == ItalcSlaveManager::AccessDialog::Ask )
-	{
-		QString user = m.arg( ItalcSlaveManager::AccessDialog::User );
-		QString host = m.arg( ItalcSlaveManager::AccessDialog::Host );
-		int choiceFlags = m.argV( ItalcSlaveManager::AccessDialog::ChoiceFlags ).toInt();
-
-		choiceFlags = exec( user, host, choiceFlags );
-
-		Ipc::Msg( ItalcSlaveManager::AccessDialog::ReportChoice ).
-			addArg( ItalcSlaveManager::AccessDialog::ChoiceFlags, choiceFlags ).
-				send( this );
-
-		return true;
-	}
-
-	return false;
-}
-
diff --git a/ica/src/AccessDialogSlave.h b/ica/src/AccessDialogSlave.h
deleted file mode 100644
index daaf076..0000000
--- a/ica/src/AccessDialogSlave.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * AccessDialogSlave.h - an IcaSlave providing the access dialog
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ACCESS_DIALOG_SLAVE_H
-#define ACCESS_DIALOG_SLAVE_H
-
-#include "IcaSlave.h"
-
-
-class AccessDialogSlave : public IcaSlave
-{
-	Q_OBJECT
-public:
-	AccessDialogSlave();
-	virtual ~AccessDialogSlave();
-
-	static QString slaveName()
-	{
-		return "AccessDialogSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-} ;
-
-#endif
-
diff --git a/ica/src/DemoClient.cpp b/ica/src/DemoClient.cpp
deleted file mode 100644
index a3225f0..0000000
--- a/ica/src/DemoClient.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * DemoClient.cpp - client widget for demo mode
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QIcon>
-#include <QtGui/QLayout>
-#include <QtGui/QApplication>
-#include <QtGui/QDesktopWidget>
-
-#include "DemoClient.h"
-#include "LocalSystem.h"
-#include "LockWidget.h"
-#include "RfbLZORLE.h"
-#include "RfbItalcCursor.h"
-#include "VncView.h"
-
-
-DemoClient::DemoClient( const QString &host, bool fullscreen ) :
-	QObject(),
-	m_toplevel( fullscreen ? new LockWidget( LockWidget::NoBackground )
-							: new QWidget() )
-{
-	m_toplevel->setWindowTitle( tr( "iTALC Demo" ) );
-	m_toplevel->setWindowIcon( QPixmap( ":/resources/display.png" ) );
-	m_toplevel->setAttribute( Qt::WA_DeleteOnClose, false );
-	m_toplevel->setWindowFlags( Qt::Window |
-								Qt::CustomizeWindowHint |
-								Qt::WindowTitleHint |
-								Qt::WindowMinMaxButtonsHint );
-	m_toplevel->resize( QApplication::desktop()->
-					availableGeometry( m_toplevel ).size() - QSize( 10, 30 ) );
-
-	// initialize extended protocol handlers
-	RfbLZORLE();
-	RfbItalcCursor();
-
-	m_vncView = new VncView( host, m_toplevel, VncView::DemoMode );
-
-	QVBoxLayout * toplevelLayout = new QVBoxLayout;
-	toplevelLayout->setMargin( 0 );
-	toplevelLayout->setSpacing( 0 );
-	toplevelLayout->addWidget( m_vncView );
-
-	m_toplevel->setLayout( toplevelLayout );
-
-	connect( m_toplevel, SIGNAL( destroyed( QObject * ) ),
-			this, SLOT( viewDestroyed( QObject * ) ) );
-	connect( m_vncView, SIGNAL( sizeHintChanged() ),
-				this, SLOT( resizeToplevelWidget() ) );
-
-	m_toplevel->move( 0, 0 );
-	if( !fullscreen )
-	{
-		m_toplevel->show();
-	}
-	else
-	{
-		m_toplevel->showFullScreen();
-	}
-	LocalSystem::activateWindow( m_toplevel );
-}
-
-
-
-
-DemoClient::~DemoClient()
-{
-	delete m_toplevel;
-}
-
-
-
-
-void DemoClient::viewDestroyed( QObject * _obj )
-{
-	if( m_toplevel == _obj )
-	{
-		m_toplevel = NULL;
-	}
-	deleteLater();
-}
-
-
-
-
-void DemoClient::resizeToplevelWidget()
-{
-	if( !( m_toplevel->windowState() & Qt::WindowFullScreen ) )
-	{
-		m_toplevel->resize( m_vncView->sizeHint() );
-	}
-	else
-	{
-		m_vncView->resize( m_toplevel->size() );
-	}
-}
-
diff --git a/ica/src/DemoClient.h b/ica/src/DemoClient.h
deleted file mode 100644
index 83d28ef..0000000
--- a/ica/src/DemoClient.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * DemoClient.h - client for demo-server
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef DEMO_CLIENT_H
-#define DEMO_CLIENT_H
-
-#include <QtCore/QObject>
-
-class VncView;
-
-class DemoClient : public QObject
-{
-	Q_OBJECT
-public:
-	DemoClient( const QString & _host, bool _fullscreen );
-	virtual ~DemoClient();
-
-
-private slots:
-	void viewDestroyed( QObject * );
-	void resizeToplevelWidget();
-
-
-private:
-	QWidget * m_toplevel;
-	VncView *m_vncView;
-
-} ;
-
-
-#endif
-
diff --git a/ica/src/DemoClientSlave.cpp b/ica/src/DemoClientSlave.cpp
deleted file mode 100644
index 71c7e18..0000000
--- a/ica/src/DemoClientSlave.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DemoClientSlave.cpp - an IcaSlave providing the demo window
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "DemoClientSlave.h"
-#include "DemoClient.h"
-#include "ItalcSlaveManager.h"
-
-
-DemoClientSlave::DemoClientSlave() :
-	IcaSlave(),
-	m_demoClient( NULL )
-{
-}
-
-
-
-DemoClientSlave::~DemoClientSlave()
-{
-	delete m_demoClient;
-}
-
-
-
-bool DemoClientSlave::handleMessage( const Ipc::Msg &m )
-{
-	if( m.cmd() == ItalcSlaveManager::DemoClient::StartDemo )
-	{
-		m_demoClient = new DemoClient( m.arg( ItalcSlaveManager::DemoClient::MasterHost ),
-										m.argV( ItalcSlaveManager::DemoClient::FullScreen ).toInt() );
-		return true;
-	}
-
-	return false;
-}
-
diff --git a/ica/src/DemoClientSlave.h b/ica/src/DemoClientSlave.h
deleted file mode 100644
index f3ebfd4..0000000
--- a/ica/src/DemoClientSlave.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * DemoClientSlave.h - an IcaSlave providing the demo window
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DEMO_CLIENT_SLAVE_H
-#define DEMO_CLIENT_SLAVE_H
-
-#include "IcaSlave.h"
-
-class DemoClient;
-
-class DemoClientSlave : public IcaSlave
-{
-public:
-	DemoClientSlave();
-	virtual ~DemoClientSlave();
-
-	static QString slaveName()
-	{
-		return "DemoClientSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-	DemoClient *m_demoClient;
-
-} ;
-
-#endif
-
diff --git a/ica/src/DemoServer.cpp b/ica/src/DemoServer.cpp
deleted file mode 100644
index ae50121..0000000
--- a/ica/src/DemoServer.cpp
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
- * DemoServer.cpp - multi-threaded slim VNC-server for demo-purposes (optimized
- *                   for lot of clients accessing server in read-only-mode)
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#define USE_QREGION
-
-#include <QtCore/QDateTime>
-#include <QtNetwork/QTcpSocket>
-#include <QtCore/QTimer>
-#include <QtGui/QCursor>
-
-#include "DemoServer.h"
-#include "ItalcCoreServer.h"
-#include "ItalcVncConnection.h"
-#ifndef USE_QREGION
-#include "QuadTree.h"
-#endif
-#include "RfbLZORLE.h"
-#include "RfbItalcCursor.h"
-#include "SocketDevice.h"
-
-#include "minilzo.h"
-#include "rfb/rfb.h"
-
-const int CURSOR_UPDATE_TIME = 35;
-
-
-static qint64 qtcpsocketDispatcher( char * buffer, const qint64 bytes,
-									const SocketOpCodes opCode, void * user )
-{
-	QTcpSocket * sock = static_cast<QTcpSocket *>( user );
-	qint64 ret = 0;
-
-	QTime opStartTime;
-	opStartTime.start();
-
-	switch( opCode )
-	{
-		case SocketRead:
-			while( ret < bytes )
-			{
-				qint64 bytesRead = sock->read( buffer+ret, bytes-ret );
-				if( bytesRead < 0 || opStartTime.elapsed() > 5000 )
-				{
-					qWarning( "qtcpsocketDispatcher(...): connection closed while reading" );
-					return 0;
-				}
-				else if( bytesRead == 0 )
-				{
-					if( sock->state() != QTcpSocket::ConnectedState )
-					{
-						qWarning( "qtcpsocketDispatcher(...): connection failed while reading "
-									"state:%d  error:%d", sock->state(), sock->error() );
-						return 0;
-					}
-					sock->waitForReadyRead( 10 );
-				}
-				else
-				{
-					ret += bytesRead;
-					opStartTime.restart();
-				}
-			}
-			break;
-
-		case SocketWrite:
-			while( ret < bytes )
-			{
-				qint64 written = sock->write( buffer+ret, bytes-ret );
-				if( written < 0 || opStartTime.elapsed() > 5000 )
-				{
-					qWarning( "qtcpsocketDispatcher(...): connection closed while writing" );
-					return 0;
-				}
-				else if( written == 0 )
-				{
-					if( sock->state() != QTcpSocket::ConnectedState )
-					{
-						qWarning( "qtcpsocketDispatcher(...): connection failed while writing  "
-									"state:%d error:%d", sock->state(), sock->error() );
-						return 0;
-					}
-				}
-				else
-				{
-					ret += written;
-					opStartTime.restart();
-				}
-			}
-			//sock->flush();
-			break;
-
-		case SocketGetPeerAddress:
-			strncpy( buffer,
-		sock->peerAddress().toString().toUtf8().constData(), bytes );
-			break;
-	}
-
-	return ret;
-}
-
-
-
-
-DemoServer::DemoServer( int srcPort, int dstPort, QObject *parent ) :
-	QTcpServer( parent ),
-	m_vncConn()
-{
-	if( listen( QHostAddress::Any, dstPort ) == false )
-	{
-		qCritical( "DemoServer::DemoServer(): "
-					"could not start demo-server!" );
-		return;
-	}
-
-	m_vncConn.setHost( QHostAddress( QHostAddress::LocalHost ).toString() );
-	m_vncConn.setPort( srcPort );
-	m_vncConn.setItalcAuthType( ItalcAuthCommonSecret );
-	m_vncConn.setQuality( ItalcVncConnection::DemoServerQuality );
-	m_vncConn.start();
-
-	connect( &m_vncConn, SIGNAL( cursorShapeUpdated( const QImage &, int, int ) ),
-				this, SLOT( updateInitialCursorShape( const QImage &, int, int ) ) );
-	checkForCursorMovement();
-}
-
-
-
-
-DemoServer::~DemoServer()
-{
-	QList<DemoServerClient *> l;
-	while( !( l = findChildren<DemoServerClient *>() ).isEmpty() )
-	{
-		delete l.front();
-	}
-}
-
-
-
-
-void DemoServer::checkForCursorMovement()
-{
-return;	// TODO
-	m_cursorLock.lockForWrite();
-	if( m_cursorPos != QCursor::pos() )
-	{
-		m_cursorPos = QCursor::pos();
-	}
-	m_cursorLock.unlock();
-	QTimer::singleShot( CURSOR_UPDATE_TIME, this,
-					SLOT( checkForCursorMovement() ) );
-}
-
-
-
-
-void DemoServer::updateInitialCursorShape( const QImage &img, int x, int y )
-{
-return;	// TODO
-	m_cursorLock.lockForWrite();
-	m_initialCursorShape = img;
-	m_cursorLock.unlock();
-}
-
-
-
-
-void DemoServer::incomingConnection( int sock )
-{
-	new DemoServerClient( sock, &m_vncConn, this );
-}
-
-
-
-
-#define RAW_MAX_PIXELS 1024
-
-DemoServerClient::DemoServerClient( int sock, const ItalcVncConnection *vncConn,
-										DemoServer *parent ) :
-	QThread( parent ),
-	m_demoServer( parent ),
-	m_dataMutex( QMutex::Recursive ),
-	m_updatesPending( false ),
-	m_changedRects(),
-	m_cursorHotX( 0 ),
-	m_cursorHotY( 0 ),
-	m_cursorShapeChanged( false ),
-	m_socketDescriptor( sock ),
-	m_sock( NULL ),
-	m_vncConn( vncConn ),
-	m_otherEndianess( false ),
-	m_lzoWorkMem( new char[sizeof( lzo_align_t ) *
-			( ( ( LZO1X_1_MEM_COMPRESS ) +
-					( sizeof( lzo_align_t ) - 1 ) ) /
-						sizeof( lzo_align_t ) ) ] ),
-	m_rawBuf( new QRgb[RAW_MAX_PIXELS] ),
-	m_rleBuf( NULL ),
-	m_currentRleBufSize( 0 ),
-	m_lzoOutBuf( NULL ),
-	m_currentLzoOutBufSize( 0 )
-{
-	start();
-}
-
-
-
-
-DemoServerClient::~DemoServerClient()
-{
-	exit();
-	wait();
-
-	if( m_lzoOutBuf )
-	{
-		delete[] m_lzoOutBuf;
-	}
-	if( m_rleBuf )
-	{
-		delete[] m_rleBuf;
-	}
-	delete[] m_lzoWorkMem;
-	delete[] m_rawBuf;
-}
-
-
-
-
-void DemoServerClient::updateRect( int x, int y, int w, int h )
-{
-	m_dataMutex.lock();
-	m_changedRects += QRect( x, y, w, h );
-	m_dataMutex.unlock();
-}
-
-
-
-
-void DemoServerClient::updateCursorShape( const QImage &img, int x, int y )
-{
-return;		// TODO
-	m_dataMutex.lock();
-	m_cursorShape = img;
-	m_cursorHotX = x;
-	m_cursorHotY = y;
-	m_cursorShapeChanged = true;
-	m_dataMutex.unlock();
-}
-
-
-
-
-void DemoServerClient::moveCursor()
-{
-return;		// TODO
-	QPoint p = m_demoServer->cursorPos();
-	if( p != m_lastCursorPos )
-	{
-		m_dataMutex.lock();
-		m_lastCursorPos = p;
-		const rfbFramebufferUpdateMsg m =
-		{
-			rfbFramebufferUpdate,
-			0,
-			(uint16_t) Swap16IfLE( 1 )
-		} ;
-
-		m_sock->write( (const char *) &m, sizeof( m ) );
-
-		const rfbRectangle rr =
-		{
-			(uint16_t) Swap16IfLE( m_lastCursorPos.x() ),
-			(uint16_t) Swap16IfLE( m_lastCursorPos.y() ),
-			(uint16_t) Swap16IfLE( 0 ),
-			(uint16_t) Swap16IfLE( 0 )
-		} ;
-
-		const rfbFramebufferUpdateRectHeader rh =
-		{
-			rr,
-			Swap32IfLE( rfbEncodingPointerPos )
-		} ;
-
-		m_sock->write( (const char *) &rh, sizeof( rh ) );
-		m_sock->flush();
-		m_dataMutex.unlock();
-	}
-}
-
-
-
-
-void DemoServerClient::sendUpdates()
-{
-	QMutexLocker ml( &m_dataMutex );
-
-	if( m_changedRects.isEmpty() && m_cursorShapeChanged == false )
-	{
-		if( m_updatesPending )
-		{
-			QTimer::singleShot( 50, this, SLOT( sendUpdates() ) );
-		}
-		return;
-	}
-
-	// extract single (non-overlapping) rects out of changed region
-	// this way we avoid lot of simliar/overlapping rectangles,
-	// e.g. if we didn't get an update-request for a quite long time
-	// and there were a lot of updates - at the end we don't send
-	// more than the whole screen one time
-#ifdef USE_QREGION
-	QRegion region;
-	foreach( const QRect &rect, m_changedRects )
-	{
-		region += rect;
-	}
-	QVector<QRect> r = region.rects();
-#else
-	QuadTree q( 0, 0, m_vncConn->image().width()-1, m_vncConn->image().height()-1, 4 );
-	QVector<QuadTreeRect> r;
-	if( !m_changedRects.isEmpty() )
-	{
-		q.addRects( m_changedRects );
-		r = q.rects();
-	}
-#endif
-
-	// no we gonna post all changed rects!
-	const rfbFramebufferUpdateMsg m =
-	{
-		rfbFramebufferUpdate,
-		0,
-		(uint16_t) Swap16IfLE( r.size() +
-				( m_cursorShapeChanged ? 1 : 0 ) )
-	} ;
-
-	SocketDevice sd( qtcpsocketDispatcher, m_sock );
-	sd.write( (const char *) &m, sz_rfbFramebufferUpdateMsg );
-
-	// process each rect
-#ifdef USE_QREGION
-	for( QVector<QRect>::ConstIterator it = r.begin(); it != r.end(); ++it )
-#else
-	for( QVector<QuadTreeRect>::const_iterator it = r.begin(); it != r.end(); ++it )
-#endif
-	{
-#ifdef USE_QREGION
-		const int rx = it->x();
-		const int ry = it->y();
-		const int rw = it->width();
-		const int rh = it->height();
-#else
-		const int rx = it->x1();
-		const int ry = it->y1();
-		const int rw = it->x2()-it->x1()+1;
-		const int rh = it->y2()-it->y1()+1;
-#endif
-		const rfbRectangle rr =
-		{
-			(uint16_t) Swap16IfLE( rx ),
-			(uint16_t) Swap16IfLE( ry ),
-			(uint16_t) Swap16IfLE( rw ),
-			(uint16_t) Swap16IfLE( rh )
-		} ;
-
-		const rfbFramebufferUpdateRectHeader rhdr =
-		{
-			rr,
-			(uint32_t) Swap32IfLE( rfbEncodingLZORLE )
-		} ;
-
-		sd.write( (const char *) &rhdr, sizeof( rhdr ) );
-
-		const QImage & i = m_vncConn->image();
-		RfbLZORLE::Header hdr = { 0, 0, 0 } ;
-
-		// we only compress if it's enough data, otherwise
-		// there's too much overhead
-		if( rw * rh > RAW_MAX_PIXELS )
-		{
-
-	hdr.compressed = 1;
-	QRgb last_pix = *( (QRgb *) i.scanLine( ry ) + rx );
-
-	// re-allocate RLE buffer if current one is too small
-	const size_t rleBufSize = rw * rh * sizeof( QRgb )+16;
-	if( rleBufSize > m_currentRleBufSize )
-	{
-		if( m_rleBuf )
-		{
-			delete[] m_rleBuf;
-		}
-		m_rleBuf = new uint8_t[rleBufSize];
-		m_currentRleBufSize = rleBufSize;
-	}
-
-	uint8_t rle_cnt = 0;
-	uint8_t rle_sub = 1;
-	uint8_t *out = m_rleBuf;
-	uint8_t *out_ptr = out;
-	for( int y = ry; y < ry+rh; ++y )
-	{
-		const QRgb * data = ( (const QRgb *) i.scanLine( y ) ) + rx;
-		for( int x = 0; x < rw; ++x )
-		{
-			if( data[x] != last_pix || rle_cnt > 254 )
-			{
-				*( (QRgb *) out_ptr ) = Swap32IfBE( last_pix );
-				*( out_ptr + 3 ) = rle_cnt - rle_sub;
-				out_ptr += 4;
-				last_pix = data[x];
-				rle_cnt = rle_sub = 0;
-			}
-			else
-			{
-				++rle_cnt;
-			}
-		}
-	}
-
-	// flush RLE-loop
-	*( (QRgb *) out_ptr ) = last_pix;
-	*( out_ptr + 3 ) = rle_cnt;
-	out_ptr += 4;
-	hdr.bytesRLE = out_ptr - out;
-
-	lzo_uint bytes_lzo = hdr.bytesRLE + hdr.bytesRLE / 16 + 67;
-
-	// re-allocate LZO output buffer if current one is too small
-	if( bytes_lzo > m_currentLzoOutBufSize )
-	{
-		if( m_lzoOutBuf )
-		{
-			delete[] m_lzoOutBuf;
-		}
-		m_lzoOutBuf = new uint8_t[bytes_lzo];
-		m_currentLzoOutBufSize = bytes_lzo;
-	}
-
-	uint8_t *comp = m_lzoOutBuf;
-	lzo1x_1_compress( (const unsigned char *) out, (lzo_uint) hdr.bytesRLE,
-				(unsigned char *) comp,
-				&bytes_lzo, m_lzoWorkMem );
-	hdr.bytesRLE = Swap32IfLE( hdr.bytesRLE );
-	hdr.bytesLZO = Swap32IfLE( bytes_lzo );
-
-	sd.write( (const char *) &hdr, sizeof( hdr ) );
-	sd.write( (const char *) comp, Swap32IfLE( hdr.bytesLZO ) );
-
-		}
-		else
-		{
-			sd.write( (const char *) &hdr, sizeof( hdr ) );
-			QRgb *dst = m_rawBuf;
-			if( m_otherEndianess )
-			{
-				for( int y = 0; y < rh; ++y )
-				{
-					const QRgb *src = (const QRgb *) i.scanLine( ry + y ) + rx;
-					for( int x = 0; x < rw; ++x, ++src, ++dst )
-					{
-						*dst = Swap32( *src );
-					}
-				}
-			}
-			else
-			{
-				for( int y = 0; y < rh; ++y )
-				{
-					const QRgb *src = (const QRgb *) i.scanLine( ry + y ) + rx;
-					for( int x = 0; x < rw; ++x, ++src, ++dst )
-					{
-						*dst = *src;
-					}
-				}
-			}
-			sd.write( (const char *) m_rawBuf, rh * rw * sizeof( QRgb ) );
-		}
-	}
-
-	if( m_cursorShapeChanged )
-	{
-		const QImage cur = m_cursorShape;
-		const rfbRectangle rr =
-		{
-			(uint16_t) Swap16IfLE( m_cursorHotX ),
-			(uint16_t) Swap16IfLE( m_cursorHotY ),
-			(uint16_t) Swap16IfLE( cur.width() ),
-			(uint16_t) Swap16IfLE( cur.height() )
-		} ;
-
-		const rfbFramebufferUpdateRectHeader rh =
-		{
-			rr,
-			(uint32_t) Swap32IfLE( rfbEncodingItalcCursor )
-		} ;
-
-		sd.write( (const char *) &rh, sizeof( rh ) );
-
-		sd.write( QVariant::fromValue( cur ) );
-	}
-
-	// reset vars
-	m_changedRects.clear();
-	m_cursorShapeChanged = false;
-
-	if( m_updatesPending )
-	{
-		// make sure to send an update once more even if there has
-		// been no update request
-		QTimer::singleShot( 1000, this, SLOT( sendUpdates() ) );
-	}
-
-	m_updatesPending = false;
-}
-
-
-
-void DemoServerClient::processClient()
-{
-	SocketDevice sd( qtcpsocketDispatcher, m_sock );
-
-	m_dataMutex.lock();
-	while( m_sock->bytesAvailable() > 0 )
-	{
-		rfbClientToServerMsg msg;
-		if( sd.read( (char *) &msg, 1 ) <= 0 )
-		{
-			qWarning( "DemoServerClient::processClient(): "
-							"could not read cmd" );
-			continue;
-		}
-
-		switch( msg.type )
-		{
-			case rfbSetEncodings:
-				sd.read( ((char *)&msg)+1, sz_rfbSetEncodingsMsg-1 );
-				msg.se.nEncodings = Swap16IfLE(msg.se.nEncodings);
-				for( int i = 0; i < msg.se.nEncodings; ++i )
-				{
-					uint32_t enc;
-					sd.read( (char *) &enc, 4 );
-				}
-				continue;
-
-			case rfbSetPixelFormat:
-				sd.read( ((char *) &msg)+1, sz_rfbSetPixelFormatMsg-1 );
-				continue;
-			case rfbSetServerInput:
-				sd.read( ((char *) &msg)+1, sz_rfbSetServerInputMsg-1 );
-				continue;
-			case rfbClientCutText:
-				sd.read( ((char *) &msg)+1, sz_rfbClientCutTextMsg-1 );
-				msg.cct.length = Swap32IfLE( msg.cct.length );
-				if( msg.cct.length )
-				{
-					char *t = new char[msg.cct.length];
-					sd.read( t, msg.cct.length );
-					delete[] t;
-				}
-				continue;
-			case rfbFramebufferUpdateRequest:
-				sd.read( ((char *) &msg)+1, sz_rfbFramebufferUpdateRequestMsg-1 );
-				m_updatesPending = true;
-				break;
-			default:
-				qWarning( "DemoServerClient::processClient(): "
-							"ignoring msg type %d", msg.type );
-				continue;
-		}
-
-	}
-
-	if( m_updatesPending )
-	{
-		sendUpdates();
-	}
-
-	m_dataMutex.unlock();
-}
-
-
-
-
-void DemoServerClient::run()
-{
-	QMutexLocker ml( &m_dataMutex );
-
-	QTcpSocket sock;
-	m_sock = &sock;
-	if( !m_sock->setSocketDescriptor( m_socketDescriptor ) )
-	{
-		qCritical( "DemoServerClient::run(): "
-				"could not set socket-descriptor - aborting" );
-		deleteLater();
-		return;
-	}
-
-	SocketDevice sd( qtcpsocketDispatcher, m_sock );
-
-	rfbProtocolVersionMsg pv;
-	sprintf( pv, rfbProtocolVersionFormat, rfbProtocolMajorVersion,
-											rfbProtocolMinorVersion );
-
-	sd.write( pv, sz_rfbProtocolVersionMsg );
-	sd.read( pv, sz_rfbProtocolVersionMsg );
-
-	const uint8_t secTypeList[2] = { 1, rfbSecTypeItalc } ;
-	sd.write( (const char *) secTypeList, sizeof( secTypeList ) );
-
-	uint8_t chosen = 0;
-	sd.read( (char *) &chosen, sizeof( chosen ) );
-
-	if( chosen != rfbSecTypeItalc )
-	{
-		qCritical( "DemoServerClient:::run(): "
-					"protocol initialization failed" );
-		deleteLater();
-		return;
-	}
-
-	uint32_t authResult = Swap32IfLE(rfbVncAuthFailed);
-
-    if( ItalcCoreServer::instance()->
-			authSecTypeItalc( qtcpsocketDispatcher, m_sock ) != true )
-	{
-		qWarning("auth of demo client failed\n");
-		deleteLater();
-		return;
-	}
-
-	authResult = Swap32IfLE(rfbVncAuthOK);
-
-	sd.write( (char *) &authResult, sizeof( authResult ) );
-
-	rfbClientInitMsg ci;
-
-	if( !sd.read( (char *) &ci, sz_rfbClientInitMsg ) )
-	{
-		qWarning( "failed reading rfbClientInitMsg" );
-		deleteLater();
-		return;
-	}
-
-	rfbServerInitMsg si = m_vncConn->getRfbClient()->si;
-	si.framebufferWidth = Swap16IfLE( si.framebufferWidth );
-	si.framebufferHeight = Swap16IfLE( si.framebufferHeight );
-	si.format.redMax = Swap16IfLE( si.format.redMax );
-	si.format.greenMax = Swap16IfLE( si.format.greenMax );
-	si.format.blueMax = Swap16IfLE( si.format.blueMax );
-	si.format.bigEndian = ( QSysInfo::ByteOrder == QSysInfo::BigEndian )
-									? 1 : 0;
-	si.nameLength = 0;
-	if( !sd.write( ( const char *) &si, sz_rfbServerInitMsg ) )
-	{
-		qWarning( "failed writing rfbServerInitMsg" );
-		deleteLater();
-		return;
-	}
-
-
-	connect( m_vncConn, SIGNAL( cursorShapeUpdated( const QImage &, int, int ) ),
-			this, SLOT( updateCursorShape( const QImage &, int, int ) ),
-							Qt::QueuedConnection );
-	connect( m_vncConn, SIGNAL( imageUpdated( int, int, int, int ) ),
-			this, SLOT( updateRect( int, int, int, int ) ),
-							Qt::QueuedConnection );
-
-	ml.unlock();
-
-	// TODO
-	//updateCursorShape( m_demoServer->initialCursorShape(), 0, 0 );
-
-	// first time send a key-frame
-	QSize s = m_vncConn->framebufferSize();
-	updateRect( 0, 0, s.width(), s.height() );
-
-	connect( m_sock, SIGNAL( readyRead() ),
-				this, SLOT( processClient() ), Qt::DirectConnection );
-	connect( m_sock, SIGNAL( disconnected() ),
-						this, SLOT( quit() ) );
-
-	// TODO
-/*	QTimer t;
-	connect( &t, SIGNAL( timeout() ),
-			this, SLOT( moveCursor() ), Qt::DirectConnection );
-	t.start( CURSOR_UPDATE_TIME );*/
-
-/*	QTimer t2;
-	connect( &t2, SIGNAL( timeout() ),
-			this, SLOT( processClient() ), Qt::DirectConnection );
-	t2.start( 2*CURSOR_UPDATE_TIME );*/
-
-	// now run our own event-loop for optimal scheduling
-	exec();
-
-	deleteLater();
-}
-
-
diff --git a/ica/src/DemoServer.h b/ica/src/DemoServer.h
deleted file mode 100644
index f93f065..0000000
--- a/ica/src/DemoServer.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * DemoServer.h - multi-threaded slim VNC-server for demo-purposes (optimized
- *                for lot of clients accessing server in read-only-mode)
- *
- * Copyright (c) 2006-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DEMO_SERVER_H
-#define DEMO_SERVER_H
-
-#include <QtCore/QPair>
-#include <QtCore/QReadWriteLock>
-#include <QtNetwork/QTcpServer>
-
-#include "ItalcVncConnection.h"
-
-
-// there's one instance of a DemoServer on the iTALC master
-class DemoServer : public QTcpServer
-{
-	Q_OBJECT
-public:
-	DemoServer( int srcPort, int dstPort, QObject *parent );
-	virtual ~DemoServer();
-
-	QPoint cursorPos()
-	{
-		m_cursorLock.lockForRead();
-		QPoint p = m_cursorPos;
-		m_cursorLock.unlock();
-		return p;
-	}
-
-	QImage initialCursorShape()
-	{
-		m_cursorLock.lockForRead();
-		QImage i = m_initialCursorShape;
-		m_cursorLock.unlock();
-		return i;
-	}
-
-
-private slots:
-	// checks whether cursor was moved and sets according flags and
-	// variables used by moveCursor() - connection has to be done in
-	// GUI-thread as we're calling QCursor::pos() which at least under X11
-	// must not be called from another thread than the GUI-thread
-	void checkForCursorMovement();
-	void updateInitialCursorShape( const QImage &img, int x, int y );
-
-
-private:
-	virtual void incomingConnection( int sock );
-
-	ItalcVncConnection m_vncConn;
-	QReadWriteLock m_cursorLock;
-	QImage m_initialCursorShape;
-	QPoint m_cursorPos;
-
-} ;
-
-
-
-// the demo-server creates an instance of this class for each client, i.e.
-// each client is connected to a different server-thread for a maximum
-// performance
-class DemoServerClient : public QThread
-{
-	Q_OBJECT
-public:
-	DemoServerClient( int sock, const ItalcVncConnection *vncConn,
-							DemoServer *parent );
-	virtual ~DemoServerClient();
-
-
-private slots:
-	// connected to imageUpdated(...)-signal of demo-server's
-	// VNC connection - this way we can record changes in screen, later we
-	// extract single, non-overlapping rectangles out of changed region for
-	// updating as less as possible of screen
-	void updateRect( int x, int y, int w, int h );
-
-	// called whenever ItalcVncConnection::cursorShapeUpdated() is emitted
-	void updateCursorShape( const QImage &cursorShape, int xh, int yh );
-
-	// called regularly for sending pointer-movement-events detected by
-	// checkForCursorMovement() to clients - connection has to be done
-	// in DemoServerClient-thread-context as we're writing to socket
-	void moveCursor();
-
-	// connected to readyRead()-signal of our client-socket and called as
-	// soon as the clients sends something (e.g. an update-request)
-	void processClient();
-
-	// actually sends framebuffer update - if there's nothing to send but
-	// an update response pending, it will start a singleshot timer
-	void sendUpdates();
-
-private:
-	// thread-entry-point - does some initializations and then enters
-	// event-loop of thread
-	virtual void run();
-
-	DemoServer * m_demoServer;
-	QMutex m_dataMutex;
-	bool m_updatesPending;
-	QList<QRect> m_changedRects;
-	QImage m_cursorShape;
-	int m_cursorHotX;
-	int m_cursorHotY;
-	QPoint m_lastCursorPos;
-	volatile bool m_cursorShapeChanged;
-
-	int m_socketDescriptor;
-	QTcpSocket *m_sock;
-	const ItalcVncConnection *m_vncConn;
-	bool m_otherEndianess;
-	char *m_lzoWorkMem;
-	QRgb *m_rawBuf;
-
-	uint8_t *m_rleBuf;
-	size_t m_currentRleBufSize;
-
-	uint8_t *m_lzoOutBuf;
-	size_t m_currentLzoOutBufSize;
-
-} ;
-
-
-#endif
-
diff --git a/ica/src/DemoServerMaster.cpp b/ica/src/DemoServerMaster.cpp
deleted file mode 100644
index f4233b0..0000000
--- a/ica/src/DemoServerMaster.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DemoServerMaster.cpp - class for controlling the VNC reflector slave process
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "DemoServerMaster.h"
-#include "ItalcCore.h"
-#include "ItalcSlaveManager.h"
-
-
-DemoServerMaster::DemoServerMaster( ItalcSlaveManager *slaveManager ) :
-	m_slaveManager( slaveManager ),
-	m_allowedHosts(),
-	m_serverPort( -1 )
-{
-}
-
-
-
-DemoServerMaster::~DemoServerMaster()
-{
-}
-
-
-
-void DemoServerMaster::start( int sourcePort, int destinationPort )
-{
-	m_slaveManager->createSlave( ItalcSlaveManager::IdDemoServer );
-	m_slaveManager->sendMessage( ItalcSlaveManager::IdDemoServer,
-					Ipc::Msg( ItalcSlaveManager::DemoServer::StartDemoServer ).
-						addArg( ItalcSlaveManager::DemoServer::CommonSecret,
-									ItalcCore::authenticationCredentials->commonSecret() ).
-						addArg( ItalcSlaveManager::DemoServer::SourcePort, sourcePort ).
-						addArg( ItalcSlaveManager::DemoServer::DestinationPort, destinationPort ) );
-
-	m_serverPort = destinationPort;
-}
-
-
-
-void DemoServerMaster::stop()
-{
-	m_slaveManager->stopSlave( ItalcSlaveManager::IdDemoServer );
-}
-
-
-
-void DemoServerMaster::updateAllowedHosts()
-{
-	m_slaveManager->sendMessage( ItalcSlaveManager::IdDemoServer,
-					Ipc::Msg( ItalcSlaveManager::DemoServer::UpdateAllowedHosts ).
-						addArg( ItalcSlaveManager::DemoServer::AllowedHosts, m_allowedHosts ) );
-}
-
-
diff --git a/ica/src/DemoServerMaster.h b/ica/src/DemoServerMaster.h
deleted file mode 100644
index 0aafb4f..0000000
--- a/ica/src/DemoServerMaster.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DemoServerMaster.h - DemoServerMaster which manages (GUI) slave apps
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DEMO_SERVER_MASTER_H
-#define DEMO_SERVER_MASTER_H
-
-#include <QtCore/QStringList>
-
-class ItalcSlaveManager;
-
-class DemoServerMaster
-{
-public:
-	DemoServerMaster( ItalcSlaveManager *slaveManager );
-	virtual ~DemoServerMaster();
-
-	void start( int sourcePort, int destinationPort );
-	void stop();
-	void updateAllowedHosts();
-
-	void allowHost( const QString &host )
-	{
-		m_allowedHosts += host;
-		updateAllowedHosts();
-	}
-
-	void unallowHost( const QString &host )
-	{
-		m_allowedHosts.removeAll( host );
-		updateAllowedHosts();
-	}
-
-	int serverPort() const
-	{
-		return m_serverPort;
-	}
-
-
-private:
-	ItalcSlaveManager *m_slaveManager;
-
-	QStringList m_allowedHosts;
-	int m_serverPort;
-
-} ;
-
-#endif
diff --git a/ica/src/DemoServerSlave.cpp b/ica/src/DemoServerSlave.cpp
deleted file mode 100644
index 87cd544..0000000
--- a/ica/src/DemoServerSlave.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DemoServerSlave.cpp - an IcaSlave providing the demo window
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QThread>
-#include <QtNetwork/QHostInfo>
-
-#include "DemoServerSlave.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "ItalcVncServer.h"
-#include "DemoServer.h"
-
-
-// a helper threading running the VNC reflector
-class VncReflectorThread : public QThread
-{
-public:
-	VncReflectorThread( int srcPort, int dstPort ) :
-		QThread(),
-		m_srcPort( srcPort ),
-		m_dstPort( dstPort )
-	{
-		start();
-	}
-
-
-protected:
-	virtual void run()
-	{
-		ItalcVncServer::runVncReflector( m_srcPort, m_dstPort );
-	}
-
-
-private:
-	int m_srcPort;
-	int m_dstPort;
-
-} ;
-
-
-
-
-DemoServerSlave::DemoServerSlave() :
-	IcaSlave(),
-	m_demoServer( NULL ),
-	m_coreServer()
-{
-}
-
-
-
-DemoServerSlave::~DemoServerSlave()
-{
-	delete m_demoServer;
-}
-
-
-
-bool DemoServerSlave::handleMessage( const Ipc::Msg &m )
-{
-	if( m.cmd() == ItalcSlaveManager::DemoServer::StartDemoServer )
-	{
-		ItalcCore::authenticationCredentials->setCommonSecret(
-						m.arg( ItalcSlaveManager::DemoServer::CommonSecret ) );
-
-		const int srcPort =
-				m.argV( ItalcSlaveManager::DemoServer::SourcePort ).toInt();
-		const int dstPort =
-				m.argV( ItalcSlaveManager::DemoServer::DestinationPort ).toInt();
-		if( ItalcCore::config->demoServerBackend() == 0 )
-		{
-			m_demoServer = new VncReflectorThread( srcPort, dstPort );
-		}
-		else
-		{
-			m_demoServer = new DemoServer( srcPort, dstPort, this );
-		}
-		return true;
-	}
-	else if( m.cmd() == ItalcSlaveManager::DemoServer::UpdateAllowedHosts )
-	{
-		const QStringList allowedHosts =
-			m.argV( ItalcSlaveManager::DemoServer::AllowedHosts ).toStringList();
-		// resolve IP addresses of all hosts
-		QStringList allowedIPs;
-		foreach( const QString &host, allowedHosts )
-		{
-			if( QHostAddress().setAddress( host ) )
-			{
-				allowedIPs += host;
-			}
-			else
-			{
-				QList<QHostAddress> addr = QHostInfo::fromName( host ).addresses();
-				foreach( const QHostAddress a, addr )
-				{
-					allowedIPs += a.toString();
-				}
-			}
-		}
-
-		// now we can use the list of IP addresses for host-based authentication
-		m_coreServer.setAllowedIPs( allowedIPs );
-
-		return true;
-	}
-
-	return false;
-}
-
diff --git a/ica/src/DemoServerSlave.h b/ica/src/DemoServerSlave.h
deleted file mode 100644
index 0d88e1b..0000000
--- a/ica/src/DemoServerSlave.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * DemoServerSlave.h - an IcaSlave providing the demo window
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DEMO_SERVER_SLAVE_H
-#define DEMO_SERVER_SLAVE_H
-
-#include "IcaSlave.h"
-#include "ItalcCoreServer.h"
-
-class DemoServerSlave : public IcaSlave
-{
-public:
-	DemoServerSlave();
-	virtual ~DemoServerSlave();
-
-	static QString slaveName()
-	{
-		return "DemoServerSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-	QObject *m_demoServer;
-	ItalcCoreServer m_coreServer;
-} ;
-
-#endif
-
diff --git a/ica/src/DesktopAccessPermission.cpp b/ica/src/DesktopAccessPermission.cpp
deleted file mode 100644
index a4f50d0..0000000
--- a/ica/src/DesktopAccessPermission.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DesktopAccessPermission.cpp - DesktopAccessPermission
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QMessageBox>
-
-#include "DesktopAccessPermission.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCoreServer.h"
-#include "LocalSystem.h"
-
-
-DesktopAccessPermission::DesktopAccessPermission( AuthenticationMethod authMethod ) :
-	m_authenticationMethod( authMethod )
-{
-}
-
-
-
-
-DesktopAccessPermission::~DesktopAccessPermission()
-{
-}
-
-
-
-
-bool DesktopAccessPermission::ask( const QString &user, const QString &host )
-{
-	// look for exceptions
-	if( host == QHostAddress( QHostAddress::LocalHost ).toString() )
-	{
-		return true;
-	}
-
-	switch( m_authenticationMethod )
-	{
-		case KeyAuthentication:
-			if( !ItalcCore::config->isPermissionRequiredWithKeyAuthentication() )
-			{
-				return true;
-			}
-			break;
-		case LogonAuthentication:
-			if( !ItalcCore::config->isPermissionRequiredWithLogonAuthentication() )
-			{
-				return true;
-			}
-			if( ItalcCore::config->isSameUserConfirmationDisabled() &&
-					!user.isEmpty() &&
-					LocalSystem::User::loggedOnUser().name() == user )
-			{
-				return true;
-			}
-			break;
-		default:
-			break;
-	}
-
-	// okay we got to ask now
-	int r = ItalcCoreServer::instance()->slaveManager()->
-				execAccessDialog( user, host, ChoiceDefault );
-	if( r & ChoiceNo )
-	{
-		return false;
-	}
-	if( r & ChoiceYes )
-	{
-		return true;
-	}
-	return false;
-}
-
diff --git a/ica/src/DesktopAccessPermission.h b/ica/src/DesktopAccessPermission.h
deleted file mode 100644
index 5cfc1af..0000000
--- a/ica/src/DesktopAccessPermission.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DesktopAccessPermission.h - DesktopAccessPermission
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DESKTOP_ACCESS_PERMISSION_H
-#define DESKTOP_ACCESS_PERMISSION_H
-
-#include <QtCore/QString>
-
-class DesktopAccessPermission
-{
-public:
-	enum Choices
-	{
-		ChoiceYes 		= 0x01,
-		ChoiceNo		= 0x02,
-		ChoiceAlways	= 0x04,
-		ChoiceNever		= 0x08,
-		ChoiceDefault	= ChoiceYes | ChoiceNo,
-		AllChoices		= ChoiceYes | ChoiceNo | ChoiceAlways | ChoiceNever
-	} ;
-
-	enum AuthenticationMethods
-	{
-		KeyAuthentication,
-		LogonAuthentication,
-		NumAuthenticationMethods
-	} ;
-	typedef AuthenticationMethods AuthenticationMethod;
-
-	DesktopAccessPermission( AuthenticationMethod authMethod );
-	~DesktopAccessPermission();
-
-	bool ask( const QString &user, const QString &host );
-
-
-private:
-	AuthenticationMethod m_authenticationMethod;
-
-} ;
-
-#endif
diff --git a/ica/src/IcaMain.cpp b/ica/src/IcaMain.cpp
deleted file mode 100644
index cc3f831..0000000
--- a/ica/src/IcaMain.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * IcaMain.cpp - main file for ICA (iTALC Client Application)
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QProcess>
-#include <QtGui/QApplication>
-#include <QtNetwork/QHostInfo>
-
-#include "WindowsService.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "ItalcCoreServer.h"
-#include "ItalcVncServer.h"
-#include "Logger.h"
-
-#include "AccessDialogSlave.h"
-#include "DemoClientSlave.h"
-#include "DemoServerSlave.h"
-#include "MessageBoxSlave.h"
-#include "InputLockSlave.h"
-#include "ScreenLockSlave.h"
-#include "SystemTrayIconSlave.h"
-
-
-#ifdef ITALC_BUILD_WIN32
-static HANDLE hShutdownEvent = NULL;
-
-// event-filter which makes ICA recognize logoff events etc.
-bool eventFilter( void *msg, long *result )
-{
-	DWORD winMsg = ( ( MSG *) msg )->message;
-
-	if( winMsg == WM_QUERYENDSESSION )
-	{
-		ilog( Info, "Got WM_QUERYENDSESSION - initiating server shutdown" );
-
-		// tell UltraVNC server to quit
-		SetEvent( hShutdownEvent );
-	}
-
-	return false;
-}
-
-#endif
-
-
-
-static bool parseArguments( const QStringList &arguments )
-{
-	QStringListIterator argIt( arguments );
-	argIt.next();	// skip application file name
-	while( argIt.hasNext() )
-	{
-		const QString & a = argIt.next().toLower();
-		if( a == "-port" && argIt.hasNext() )
-		{
-			ItalcCore::serverPort = argIt.next().toInt();
-		}
-		else if( a == "-role" )
-		{
-			if( argIt.hasNext() )
-			{
-				const QString role = argIt.next();
-				if( role == "teacher" )
-				{
-					ItalcCore::role = ItalcCore::RoleTeacher;
-				}
-				else if( role == "admin" )
-				{
-					ItalcCore::role = ItalcCore::RoleAdmin;
-				}
-				else if( role == "supporter" )
-				{
-					ItalcCore::role = ItalcCore::RoleSupporter;
-				}
-			}
-			else
-			{
-				printf( "-role needs an argument:\n"
-					"	teacher\n"
-					"	admin\n"
-					"	supporter\n\n" );
-				return false;
-			}
-		}
-#ifdef ITALC_BUILD_LINUX
-		// accept these options for x11vnc
-		else if( a == "-nosel" || a == "-nosetclipboard" ||
-				a == "-noshm" || a == "-solid" ||
-				a == "-xrandr" || a == "-onetile" )
-		{
-		}
-		else if( a == "-h" || a == "--help" )
-		{
-			QProcess::execute( "man ica" );
-			return false;
-		}
-#endif
-		else if( a == "-v" || a == "--version" )
-		{
-			printf( "%s\n", ITALC_VERSION );
-			return false;
-		}
-		else if( a == "-slave" )
-		{
-			return true;
-		}
-		else
-		{
-			qWarning() << "Unrecognized commandline argument" << a;
-			return false;
-		}
-	}
-
-	return true;
-}
-
-
-
-
-static int runCoreServer( int argc, char **argv )
-{
-	QCoreApplication app( argc, argv );
-
-	ItalcCore::init();
-
-	Logger l( "ItalcCoreServer" );
-
-	// initialize global AuthenticationCredentials object so we can read and
-	// write a common secret later
-	ItalcCore::initAuthentication( AuthenticationCredentials::CommonSecret );
-
-	if( !parseArguments( app.arguments() ) )
-	{
-		return -1;
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	hShutdownEvent = OpenEvent( EVENT_ALL_ACCESS, FALSE,
-								"Global\\SessionEventUltra" );
-	if( !hShutdownEvent )
-	{
-		// no global event available already as we're not running under the
-		// control of the ICA service supervisor?
-		if( GetLastError() == ERROR_FILE_NOT_FOUND )
-		{
-			// then create our own event as otherwise the VNC server main loop
-			// will eat 100% CPU due to failing WaitForSingleObject() calls
-			hShutdownEvent = CreateEvent( NULL, FALSE, FALSE,
-											"Global\\SessionEventUltra" );
-		}
-		else
-		{
-			qCritical( "Could not open or create session event" );
-			return -1;
-		}
-	}
-	app.setEventFilter( eventFilter );
-#endif
-
-	ItalcCoreServer coreServer;
-	ItalcVncServer vncServer;
-
-	// start the SystemTrayIconSlave and set the default tooltip
-	coreServer.slaveManager()->setSystemTrayToolTip(
-		QApplication::tr( "iTALC Client %1 on %2:%3" ).
-							arg( ITALC_VERSION ).
-							arg( QHostInfo::localHostName() ).
-							arg( QString::number( vncServer.serverPort() ) ) );
-
-	// make app terminate once the VNC server thread has finished
-	app.connect( &vncServer, SIGNAL( finished() ), SLOT( quit() ) );
-
-	vncServer.start();
-
-	ilog( Info, "Exec" );
-	int ret = app.exec();
-
-#ifdef ITALC_BUILD_WIN32
-	CloseHandle( hShutdownEvent );
-#endif
-
-	return ret;
-}
-
-
-
-template<class SlaveClass, class Application>
-static int runSlave( int argc, char **argv )
-{
-	Application app( argc, argv );
-
-	ItalcCore::init();
-
-	Logger l( "Italc" + SlaveClass::slaveName() );
-
-	// initialize global AuthenticationCredentials object so we can read and
-	// write a common secret later
-	ItalcCore::initAuthentication( AuthenticationCredentials::CommonSecret );
-
-	if( !parseArguments( app.arguments() ) )
-	{
-		return -1;
-	}
-
-	SlaveClass s;
-
-	ilog( Info, "Exec" );
-
-	return app.exec();
-}
-
-
-
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-
-extern HINSTANCE	hAppInstance;
-extern DWORD		mainthreadId;
-#endif
-
-int main( int argc, char **argv )
-{
-#ifdef DEBUG
-	extern int _Xdebug;
-//	_Xdebug = 1;
-#endif
-
-#ifdef ITALC_BUILD_WIN32
-	// initialize global instance handler and main thread ID
-	hAppInstance = GetModuleHandle( NULL );
-	mainthreadId = GetCurrentThreadId();
-#endif
-
-	// decide in what mode to run
-	if( argc >= 2 )
-	{
-		const QString arg1 = argv[1];
-#ifdef ITALC_BUILD_WIN32
-		for( int i = 1; i < argc; ++i )
-		{
-			if( QString( argv[i] ).toLower().contains( "service" ) )
-			{
-				WindowsService winService( "icas", "-service", "iTALC Client",
-											QString(), argc, argv );
-				if( winService.evalArgs( argc, argv ) )
-				{
-					return 0;
-				}
-				break;
-			}
-		}
-#endif
-		if( arg1.toLower() == "-slave" )
-		{
-			if( argc <= 2 )
-			{
-				qCritical( "Need to specify slave" );
-				return -1;
-			}
-			const QString arg2 = argv[2];
-			if( arg2 == ItalcSlaveManager::IdCoreServer )
-			{
-				return runCoreServer( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdAccessDialog )
-			{
-				return runSlave<AccessDialogSlave, QApplication>( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdDemoClient )
-			{
-				return runSlave<DemoClientSlave, QApplication>( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdMessageBox )
-			{
-				return runSlave<MessageBoxSlave, QApplication>( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdScreenLock )
-			{
-				return runSlave<ScreenLockSlave, QApplication>( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdInputLock )
-			{
-				return runSlave<InputLockSlave, QApplication>( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdSystemTrayIcon )
-			{
-				return runSlave<SystemTrayIconSlave, QApplication>( argc, argv );
-			}
-			else if( arg2 == ItalcSlaveManager::IdDemoServer )
-			{
-				return runSlave<DemoServerSlave, QApplication>( argc, argv );
-			}
-			else
-			{
-				qCritical( "Unknown slave" );
-				return -1;
-			}
-		}
-	}
-
-	return runCoreServer( argc, argv );
-}
-
-
diff --git a/ica/src/IcaSlave.h b/ica/src/IcaSlave.h
deleted file mode 100644
index 3ac4eea..0000000
--- a/ica/src/IcaSlave.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * IcaSlave.h - class IcaSlave, a base class for all ICA-related slaves
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ICA_SLAVE_H
-#define ICA_SLAVE_H
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QStringList>
-
-#include "Ipc/Slave.h"
-
-class IcaSlave : public Ipc::Slave
-{
-public:
-	IcaSlave() :
-		Ipc::Slave( QCoreApplication::arguments()[3],	// master ID
-					QCoreApplication::arguments()[2] )	// slave ID
-	{
-	}
-} ;
-
-
-#endif
-
diff --git a/ica/src/InputLockSlave.cpp b/ica/src/InputLockSlave.cpp
deleted file mode 100644
index 2cd4ab8..0000000
--- a/ica/src/InputLockSlave.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * InputLockSlave.h - an IcaSlave providing the input lock functionality
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "LockWidget.h"
-#include "InputLockSlave.h"
-
-
-InputLockSlave::InputLockSlave() :
-	IcaSlave(),
-	m_lockWidget( new LockWidget( LockWidget::DesktopVisible ) )
-{
-}
-
-
-
-
-InputLockSlave::~InputLockSlave()
-{
-	delete m_lockWidget;
-}
-
-
-
-
-bool InputLockSlave::handleMessage( const Ipc::Msg &m )
-{
-	return false;
-}
-
diff --git a/ica/src/InputLockSlave.h b/ica/src/InputLockSlave.h
deleted file mode 100644
index a266812..0000000
--- a/ica/src/InputLockSlave.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * InputLockSlave.h - an IcaSlave providing the input lock functionality
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef INPUT_LOCK_SLAVE_H
-#define INPUT_LOCK_SLAVE_H
-
-#include "IcaSlave.h"
-
-class LockWidget;
-
-class InputLockSlave : public IcaSlave
-{
-public:
-	InputLockSlave();
-	virtual ~InputLockSlave();
-
-	static QString slaveName()
-	{
-		return "InputLockSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-	LockWidget *m_lockWidget;
-
-} ;
-
-#endif
-
diff --git a/ica/src/ItalcCoreServer.cpp b/ica/src/ItalcCoreServer.cpp
deleted file mode 100644
index 8e09a6c..0000000
--- a/ica/src/ItalcCoreServer.cpp
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * ItalcCoreServer.cpp - ItalcCoreServer
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-#define _WIN32_WINNT 0x0501
-#include <windows.h>
-#include <psapi.h>
-#endif
-
-#include <QtCore/QCoreApplication>
-#include <QtNetwork/QHostInfo>
-
-#include "ItalcCoreServer.h"
-#include "DesktopAccessPermission.h"
-#include "DsaKey.h"
-#include "ItalcRfbExt.h"
-#include "LocalSystem.h"
-
-
-ItalcCoreServer * ItalcCoreServer::_this = NULL;
-
-
-ItalcCoreServer::ItalcCoreServer() :
-	QObject(),
-	m_allowedIPs(),
-	m_slaveManager()
-{
-	Q_ASSERT( _this == NULL );
-	_this = this;
-}
-
-
-
-
-ItalcCoreServer::~ItalcCoreServer()
-{
-	_this = NULL;
-}
-
-
-
-
-int ItalcCoreServer::handleItalcClientMessage( socketDispatcher sock,
-												void *user )
-{
-	SocketDevice sdev( sock, user );
-
-	// receive message
-	ItalcCore::Msg msgIn( &sdev );
-	msgIn.receive();
-
-	qDebug() << "ItalcCoreServer: received message" << msgIn.cmd()
-					<< "with arguments" << msgIn.args();
-
-	const QString cmd = msgIn.cmd();
-	if( cmd == ItalcCore::GetUserInformation )
-	{
-		static QString lastUserName, lastFullUsername;
-
-		LocalSystem::User user = LocalSystem::User::loggedOnUser();
-		QString currentUsername = user.name();
-		if( lastUserName != currentUsername )
-		{
-			lastUserName = currentUsername;
-			lastFullUsername = user.fullName();
-		}
-		if( !lastFullUsername.isEmpty() &&
-				currentUsername != lastFullUsername )
-		{
-			currentUsername = QString( "%1 (%2)" ).arg( currentUsername ).
-									arg( lastFullUsername );
-		}
-		ItalcCore::Msg( &sdev, ItalcCore::UserInformation ).
-					addArg( "username", currentUsername ).
-					addArg( "homedir", user.homePath() ).
-									send();
-	}
-	else if( cmd == ItalcCore::ExecCmds )
-	{
-		const QString cmds = msgIn.arg( "cmds" );
-		if( !cmds.isEmpty() )
-		{
-			LocalSystem::User user = LocalSystem::User::loggedOnUser();
-			LocalSystem::Process proc(
-				LocalSystem::Process::findProcessId( QString(), -1, &user ) );
-
-			foreach( const QString & cmd, cmds.split( '\n' ) )
-			{
-				LocalSystem::Process::Handle hProcess =
-					proc.runAsUser( cmd,
-						LocalSystem::Desktop::activeDesktop().name() );
-#ifdef ITALC_BUILD_WIN32
-				if( hProcess )
-				{
-					CloseHandle( hProcess );
-				}
-#else
-				(void) hProcess;
-#endif
-			}
-		}
-	}
-	else if( cmd == ItalcCore::LogonUserCmd )
-	{
-		LocalSystem::logonUser( msgIn.arg( "uname" ),
-					msgIn.arg( "passwd" ),
-					msgIn.arg( "domain" ) );
-	}
-	else if( cmd == ItalcCore::LogoutUser )
-	{
-		LocalSystem::logoutUser();
-	}
-	else if( cmd == ItalcCore::PowerOnComputer )
-	{
-		LocalSystem::broadcastWOLPacket( msgIn.arg( "mac" ) );
-	}
-	else if( cmd == ItalcCore::PowerDownComputer )
-	{
-		LocalSystem::powerDown();
-	}
-	else if( cmd == ItalcCore::RestartComputer )
-	{
-		LocalSystem::reboot();
-	}
-	else if( cmd == ItalcCore::DisableLocalInputs )
-	{
-		// TODO
-		//LocalSystem::disableLocalInputs( msgIn.arg( "disabled" ).toInt() );
-	}
-	else if( cmd == ItalcCore::SetRole )
-	{
-		const int role = msgIn.arg( "role" ).toInt();
-		if( role > ItalcCore::RoleNone && role < ItalcCore::RoleCount )
-		{
-			ItalcCore::role = static_cast<ItalcCore::UserRoles>( role );
-		}
-	}
-	else if( cmd == ItalcCore::StartDemo )
-	{
-		QString host = msgIn.arg( "host" );
-		QString port = msgIn.arg( "port" );
-		// no host given?
-		if( host.isEmpty() )
-		{
-			// then guess IP from remote peer address
-			const int MAX_HOST_LEN = 255;
-			char hostArr[MAX_HOST_LEN+1];
-			sock( hostArr, MAX_HOST_LEN, SocketGetPeerAddress, user );
-			hostArr[MAX_HOST_LEN] = 0;
-			host = hostArr;
-		}
-		if( port.isEmpty() )
-		{
-			port = QString::number( PortOffsetDemoServer );
-		}
-		if( !host.contains( ':' ) )
-		{
-			host += ':' + port;
-		}
-		m_slaveManager.startDemo( host, msgIn.arg( "fullscreen" ).toInt() );
-	}
-	else if( cmd == ItalcCore::StopDemo )
-	{
-		m_slaveManager.stopDemo();
-	}
-	else if( cmd == ItalcCore::DisplayTextMessage )
-	{
-		m_slaveManager.messageBox( msgIn.arg( "text" ) );
-	}
-	else if( cmd == ItalcCore::LockScreen )
-	{
-		m_slaveManager.lockScreen();
-	}
-	else if( cmd == ItalcCore::UnlockScreen )
-	{
-		m_slaveManager.unlockScreen();
-	}
-	else if( cmd == ItalcCore::LockInput )
-	{
-		m_slaveManager.lockInput();
-	}
-	else if( cmd == ItalcCore::UnlockInput )
-	{
-		m_slaveManager.unlockInput();
-	}
-	else if( cmd == ItalcCore::StartDemoServer )
-	{
-		ItalcCore::authenticationCredentials->setCommonSecret(
-									DsaKey::generateChallenge().toBase64() );
-		m_slaveManager.demoServerMaster()->start(
-			msgIn.arg( "sourceport" ).toInt(),
-			msgIn.arg( "destinationport" ).toInt() );
-	}
-	else if( cmd == ItalcCore::StopDemoServer )
-	{
-		m_slaveManager.demoServerMaster()->stop();
-	}
-	else if( cmd == ItalcCore::DemoServerAllowHost )
-	{
-		m_slaveManager.demoServerMaster()->allowHost( msgIn.arg( "host" ) );
-	}
-	else if( cmd == ItalcCore::DemoServerUnallowHost )
-	{
-		m_slaveManager.demoServerMaster()->unallowHost( msgIn.arg( "host" ) );
-	}
-	else if( cmd == ItalcCore::ReportSlaveStateFlags )
-	{
-		ItalcCore::Msg( &sdev, cmd ).
-				addArg( "slavestateflags", m_slaveManager.slaveStateFlags() ).
-					send();
-	}
-	// TODO: handle plugins
-	else
-	{
-		qCritical() << "ItalcCoreServer::handleItalcClientMessage(...): "
-				"could not handle cmd" << cmd;
-	}
-
-	return true;
-}
-
-
-
-bool ItalcCoreServer::authSecTypeItalc( socketDispatcher sd, void *user )
-{
-	QMutexLocker l( &m_dataMutex );
-
-	// find out IP of host - needed at several places
-	const int MAX_HOST_LEN = 255;
-	char host[MAX_HOST_LEN+1];
-	sd( host, MAX_HOST_LEN, SocketGetPeerAddress, user );
-	host[MAX_HOST_LEN] = 0;
-
-	SocketDevice sdev( sd, user );
-
-	// send list of supported authentication types - can't use QList<QVariant>
-	// here due to a strange bug in Qt
-	QMap<QString, QVariant> supportedAuthTypes;
-	supportedAuthTypes["ItalcAuthDSA"] = ItalcAuthDSA;
-	supportedAuthTypes["ItalcAuthHostBased"] = ItalcAuthHostBased;
-	if( ItalcCore::authenticationCredentials->hasCredentials(
-									AuthenticationCredentials::CommonSecret ) )
-	{
-		supportedAuthTypes["ItalcAuthCommonSecret"] = ItalcAuthCommonSecret;
-	}
-	sdev.write( supportedAuthTypes );
-
-	uint32_t result = rfbVncAuthFailed;
-	ItalcAuthTypes chosen = static_cast<ItalcAuthTypes>( sdev.read().toInt() );
-	if( !supportedAuthTypes.values().contains( chosen ) )
-	{
-		errorMsgAuth( host );
-		qCritical( "ItalcCoreServer::authSecTypeItalc(...): "
-				"client chose unsupported authentication type!" );
-		return result;
-	}
-
-	const QString username = sdev.read().toString();
-
-	switch( chosen )
-	{
-		// no authentication
-		case ItalcAuthNone:
-			result = rfbVncAuthOK;
-			break;
-
-		// host has to be in list of allowed hosts
-		case ItalcAuthHostBased:
-			if( doHostBasedAuth( host ) )
-			{
-				result = rfbVncAuthOK;
-			}
-			break;
-
-		// authentication via DSA-challenge/-response
-		case ItalcAuthDSA:
-			if( doKeyBasedAuth( sdev, host ) )
-			{
-				if( DesktopAccessPermission(
-						DesktopAccessPermission::KeyAuthentication ).
-							ask( username, host ) )
-				{
-					result = rfbVncAuthOK;
-				}
-			}
-			break;
-
-		case ItalcAuthCommonSecret:
-			if( doCommonSecretAuth( sdev ) )
-			{
-				result = rfbVncAuthOK;
-			}
-			break;
-
-		default:
-			break;
-	}
-
-	if( result != rfbVncAuthOK )
-	{
-		// only report about failed authentications for hosts that are not
-		// blacklisted already
-		if( !m_manuallyDeniedHosts.contains( host ) &&
-				chosen != ItalcAuthHostBased )
-		{
-			errorMsgAuth( host );
-		}
-		qWarning() << "ItalcCoreServer::authSecTypeItalc(): failed "
-						"authenticating client" << host;
-		return false;
-	}
-
-	return true;
-}
-
-
-
-
-void ItalcCoreServer::errorMsgAuth( const QString &ip )
-{
-	_this->m_slaveManager.systemTrayMessage(
-			tr( "Authentication error" ),
-			tr( "Somebody (IP: %1) tried to access this computer "
-					"but could not authenticate itself "
-					"successfully!" ).arg( ip ) );
-}
-
-
-
-
-bool ItalcCoreServer::doKeyBasedAuth( SocketDevice &sdev, const QString &host )
-{
-	// generate data to sign and send to client
-	const QByteArray chall = DsaKey::generateChallenge();
-	sdev.write( QVariant( chall ) );
-
-	// get user-role
-	const ItalcCore::UserRoles urole =
-				static_cast<ItalcCore::UserRoles>( sdev.read().toInt() );
-#if 0
-	if( ItalcCore::role != ItalcCore::RoleOther &&
-		host != QHostAddress( QHostAddress::LocalHost ).toString() )
-	{
-		if( m_manuallyDeniedHosts.contains( host ) )
-		{
-			return false;
-		}
-		if( !m_manuallyAllowedHosts.contains( host ) )
-		{
-			switch( m_slaveManager.execAccessDialog( host ) )
-			{
-				case ItalcSlaveManager::AccessAlways:
-					m_manuallyAllowedHosts += host;
-				case ItalcSlaveManager::AccessYes:
-					break;
-				case ItalcSlaveManager::AccessNever:
-					m_manuallyDeniedHosts += host;
-				case ItalcSlaveManager::AccessNo:
-				default:
-					return false;
-			}
-		}
-	}
-#endif
-
-	// now try to verify received signed data using public key of the user
-	// under which the client claims to run
-	const QByteArray sig = sdev.read().toByteArray();
-
-	qDebug() << "Loading public key" << LocalSystem::Path::publicKeyPath( urole )
-				<< "for role" << urole;
-	// (publicKeyPath does range-checking of urole)
-	PublicDSAKey pubKey( LocalSystem::Path::publicKeyPath( urole ) );
-
-	return pubKey.verifySignature( chall, sig );
-}
-
-
-
-
-bool ItalcCoreServer::doHostBasedAuth( const QString &host )
-{
-	qDebug() << "ItalcCoreServer: doing host based auth for host" << host;
-
-	if( m_allowedIPs.isEmpty() )
-	{
-		qWarning() << "ItalcCoreServer: empty list of allowed IPs";
-		return false;
-	}
-
-	// already valid IP?
-	if( QHostAddress().setAddress( host ) )
-	{
-		if( m_allowedIPs.contains( host ) )
-		{
-			return true;
-		}
-	}
-	else
-	{
-		// create a list of all known addresses of host
-		QList<QHostAddress> addr = QHostInfo::fromName( host ).addresses();
-
-		// check each address for existence in list of allowed clients
-		foreach( const QHostAddress a, addr )
-		{
-			if( m_allowedIPs.contains( a.toString() ) ||
-					a.toString() == QHostAddress( QHostAddress::LocalHost ).
-																	toString() )
-			{
-				return true;
-			}
-		}
-	}
-
-	qWarning() << "ItalcCoreServer::doHostBasedAuth() failed for host " << host;
-
-	// host-based authentication failed
-	return false;
-}
-
-
-
-
-bool ItalcCoreServer::doCommonSecretAuth( SocketDevice &sdev )
-{
-	qDebug() << "ItalcCoreServer: doing common secret auth";
-
-	const QString secret = sdev.read().toString();
-	if( secret == ItalcCore::authenticationCredentials->commonSecret() )
-	{
-		return true;
-	}
-
-	return false;
-}
-
diff --git a/ica/src/ItalcCoreServer.h b/ica/src/ItalcCoreServer.h
deleted file mode 100644
index 02b0bdc..0000000
--- a/ica/src/ItalcCoreServer.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * ItalcCoreServer.h - ItalcCoreServer
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_CORE_SERVER_H
-#define ITALC_CORE_SERVER_H
-
-#include <QtCore/QMutex>
-#include <QtCore/QStringList>
-
-#include "SocketDevice.h"
-#include "ItalcSlaveManager.h"
-
-
-class ItalcCoreServer : public QObject
-{
-	Q_OBJECT
-public:
-	ItalcCoreServer();
-	virtual ~ItalcCoreServer();
-
-	static ItalcCoreServer *instance()
-	{
-		Q_ASSERT( _this != NULL );
-		return _this;
-	}
-
-	int handleItalcClientMessage( socketDispatcher sd, void *user );
-
-	bool authSecTypeItalc( socketDispatcher sd, void *user );
-
-	ItalcSlaveManager * slaveManager()
-	{
-		return &m_slaveManager;
-	}
-
-	void setAllowedIPs( const QStringList &allowedIPs )
-	{
-		QMutexLocker l( &m_dataMutex );
-		m_allowedIPs = allowedIPs;
-	}
-
-
-private:
-	static void errorMsgAuth( const QString & _ip );
-
-	bool doKeyBasedAuth( SocketDevice &sdev, const QString &host );
-	bool doHostBasedAuth( const QString &host );
-	bool doCommonSecretAuth( SocketDevice &sdev );
-
-	static ItalcCoreServer *_this;
-
-	QMutex m_dataMutex;
-	QStringList m_allowedIPs;
-
-	// list of hosts that are allowed/denied to access ICA when ICA is running
-	// under a role different from "RoleOther"
-	QStringList m_manuallyAllowedHosts;
-	QStringList m_manuallyDeniedHosts;
-
-	ItalcSlaveManager m_slaveManager;
-
-} ;
-
-
-#endif
diff --git a/ica/src/ItalcSlaveManager.cpp b/ica/src/ItalcSlaveManager.cpp
deleted file mode 100644
index 265a848..0000000
--- a/ica/src/ItalcSlaveManager.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * ItalcSlaveManager.cpp - ItalcSlaveManager which manages (GUI) slave apps
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-#include <QtCore/QTime>
-
-#include "DesktopAccessPermission.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "ItalcSlaveManager.h"
-#include "LocalSystem.h"
-#include "ScreenLockSlaveLauncher.h"
-
-const Ipc::Id ItalcSlaveManager::IdCoreServer = "CoreServer";
-const Ipc::Id ItalcSlaveManager::IdAccessDialog = "AccessDialog";
-const Ipc::Id ItalcSlaveManager::IdDemoClient = "DemoClient";
-const Ipc::Id ItalcSlaveManager::IdDemoServer = "DemoServer";
-const Ipc::Id ItalcSlaveManager::IdMessageBox = "MessageBox";
-const Ipc::Id ItalcSlaveManager::IdScreenLock = "ScreenLock";
-const Ipc::Id ItalcSlaveManager::IdInputLock = "InputLock";
-const Ipc::Id ItalcSlaveManager::IdSystemTrayIcon = "SystemTrayIcon";
-
-const Ipc::Command ItalcSlaveManager::AccessDialog::Ask = "Ask";
-const Ipc::Argument ItalcSlaveManager::AccessDialog::User = "User";
-const Ipc::Argument ItalcSlaveManager::AccessDialog::Host = "Host";
-const Ipc::Argument ItalcSlaveManager::AccessDialog::ChoiceFlags = "ChoiceFlags";
-const Ipc::Command ItalcSlaveManager::AccessDialog::ReportChoice = "ReportChoice";
-
-const Ipc::Command ItalcSlaveManager::DemoClient::StartDemo = "StartDemo";
-const Ipc::Argument ItalcSlaveManager::DemoClient::MasterHost = "MasterHost";
-const Ipc::Argument ItalcSlaveManager::DemoClient::FullScreen = "FullScreen";
-
-const Ipc::Command ItalcSlaveManager::DemoServer::StartDemoServer = "StartDemoServer";
-const Ipc::Argument ItalcSlaveManager::DemoServer::SourcePort = "SourcePort";
-const Ipc::Argument ItalcSlaveManager::DemoServer::DestinationPort = "DestinationPort";
-const Ipc::Argument ItalcSlaveManager::DemoServer::CommonSecret = "CommonSecret";
-
-const Ipc::Command ItalcSlaveManager::DemoServer::UpdateAllowedHosts = "UpdateAllowedHosts";
-const Ipc::Argument ItalcSlaveManager::DemoServer::AllowedHosts = "AllowedHosts";
-
-const Ipc::Command ItalcSlaveManager::MessageBoxSlave::ShowMessageBox = "ShowMessageBox";
-const Ipc::Argument ItalcSlaveManager::MessageBoxSlave::Text = "Text";
-
-const Ipc::Command ItalcSlaveManager::SystemTrayIcon::SetToolTip = "SetToolTip";
-const Ipc::Argument ItalcSlaveManager::SystemTrayIcon::ToolTipText = "ToolTipText";
-
-const Ipc::Command ItalcSlaveManager::SystemTrayIcon::ShowMessage = "ShowMessage";
-const Ipc::Argument ItalcSlaveManager::SystemTrayIcon::Title = "Title";
-const Ipc::Argument ItalcSlaveManager::SystemTrayIcon::Text = "Text";
-
-
-
-ItalcSlaveManager::ItalcSlaveManager() :
-	Ipc::Master( QCoreApplication::applicationDirPath() +
-					QDir::separator() + "ica" ),
-	m_demoServerMaster( this )
-{
-}
-
-
-
-
-ItalcSlaveManager::~ItalcSlaveManager()
-{
-}
-
-
-
-
-void ItalcSlaveManager::startDemo( const QString &masterHost, bool fullscreen )
-{
-	Ipc::SlaveLauncher *slaveLauncher = NULL;
-	if( fullscreen && ItalcCore::config->lockWithDesktopSwitching() )
-	{
-		slaveLauncher = new ScreenLockSlaveLauncher( applicationFilePath() );
-	}
-	createSlave( IdDemoClient, slaveLauncher );
-	sendMessage( IdDemoClient,
-					Ipc::Msg( DemoClient::StartDemo ).
-						addArg( DemoClient::MasterHost, masterHost ).
-						addArg( DemoClient::FullScreen, fullscreen ) );
-}
-
-
-
-
-void ItalcSlaveManager::stopDemo()
-{
-	stopSlave( IdDemoClient );
-}
-
-
-
-
-void ItalcSlaveManager::lockScreen()
-{
-	Ipc::SlaveLauncher *slaveLauncher = NULL;
-	if( ItalcCore::config->lockWithDesktopSwitching() )
-	{
-		slaveLauncher = new ScreenLockSlaveLauncher( applicationFilePath() );
-	}
-	createSlave( IdScreenLock, slaveLauncher );
-}
-
-
-
-
-void ItalcSlaveManager::unlockScreen()
-{
-	stopSlave( IdScreenLock );
-}
-
-
-
-
-void ItalcSlaveManager::lockInput()
-{
-	createSlave( IdInputLock );
-}
-
-
-
-
-void ItalcSlaveManager::unlockInput()
-{
-	stopSlave( IdInputLock );
-}
-
-
-
-
-void ItalcSlaveManager::messageBox( const QString &msg )
-{
-	if( !isSlaveRunning( IdMessageBox ) )
-	{
-		createSlave( IdMessageBox );
-	}
-	sendMessage( IdMessageBox,
-					Ipc::Msg( MessageBoxSlave::ShowMessageBox ).
-						addArg( MessageBoxSlave::Text, msg ) );
-}
-
-
-
-
-void ItalcSlaveManager::systemTrayMessage( const QString &title,
-										const QString &msg )
-{
-	if( ItalcCore::config->isTrayIconHidden() )
-	{
-		messageBox( msg );
-		return;
-	}
-	if( !isSlaveRunning( IdSystemTrayIcon ) )
-	{
-		createSlave( IdSystemTrayIcon );
-	}
-	sendMessage( IdSystemTrayIcon,
-					Ipc::Msg( SystemTrayIcon::ShowMessage ).
-						addArg( SystemTrayIcon::Title, title ).
-						addArg( SystemTrayIcon::Text, msg ) );
-}
-
-
-
-
-void ItalcSlaveManager::setSystemTrayToolTip( const QString &tooltip )
-{
-	if( ItalcCore::config->isTrayIconHidden() )
-	{
-		return;
-	}
-	if( !isSlaveRunning( IdSystemTrayIcon ) )
-	{
-		createSlave( IdSystemTrayIcon );
-	}
-	sendMessage( IdSystemTrayIcon,
-					Ipc::Msg( SystemTrayIcon::SetToolTip ).
-						addArg( SystemTrayIcon::ToolTipText, tooltip ) );
-}
-
-
-
-
-int ItalcSlaveManager::execAccessDialog( const QString &user,
-											const QString &host,
-											int choiceFlags )
-{
-	m_accessDialogChoice = -1;
-
-	createSlave( IdAccessDialog );
-	sendMessage( IdAccessDialog,
-					Ipc::Msg( AccessDialog::Ask ).
-						addArg( AccessDialog::User , user ).
-						addArg( AccessDialog::Host, host ).
-						addArg( AccessDialog::ChoiceFlags, choiceFlags ) );
-
-	// wait for answer
-	QTime t;
-	t.start();
-	while( m_accessDialogChoice < 0 )
-	{
-		QCoreApplication::processEvents();
-		if( t.elapsed() > 30000 )
-		{
-			stopSlave( IdAccessDialog );
-			return DesktopAccessPermission::ChoiceNo;
-		}
-	}
-
-	return m_accessDialogChoice;
-}
-
-
-
-
-int ItalcSlaveManager::slaveStateFlags()
-{
-	int s = 0;
-#define GEN_SLAVE_STATE_SETTER(x)				\
-			if( isSlaveRunning( Id##x ) )		\
-			{									\
-				s |= ItalcCore::x##Running;		\
-			}
-	GEN_SLAVE_STATE_SETTER(AccessDialog)
-	GEN_SLAVE_STATE_SETTER(DemoServer)
-	GEN_SLAVE_STATE_SETTER(DemoClient)
-	GEN_SLAVE_STATE_SETTER(ScreenLock)
-	GEN_SLAVE_STATE_SETTER(InputLock)
-	GEN_SLAVE_STATE_SETTER(SystemTrayIcon)
-	GEN_SLAVE_STATE_SETTER(MessageBox)
-
-	return s;
-}
-
-
-
-void ItalcSlaveManager::createSlave( const Ipc::Id &id, Ipc::SlaveLauncher *slaveLauncher )
-{
-	// only launch interactive iTALC slaves (screen lock, demo, message box,
-	// access dialog) if a user is logged on - prevents us from messing up logon
-	// dialog on Windows
-	if( id == IdSystemTrayIcon ||
-			!LocalSystem::User::loggedOnUser().name().isEmpty() )
-	{
-		Ipc::Master::createSlave( id, slaveLauncher );
-	}
-	else
-	{
-		qDebug() << "ItalcSlaveManager: not creating slave" << id
-					<< "as no user is logged on.";
-	}
-}
-
-
-
-bool ItalcSlaveManager::handleMessage( const Ipc::Id &slaveId, const Ipc::Msg &m )
-{
-	if( slaveId == IdAccessDialog )
-	{
-		if( m.cmd() == AccessDialog::ReportChoice )
-		{
-			m_accessDialogChoice = m.arg( AccessDialog::ChoiceFlags ).toInt();
-			return true;
-		}
-	}
-	return false;
-}
-
diff --git a/ica/src/ItalcSlaveManager.h b/ica/src/ItalcSlaveManager.h
deleted file mode 100644
index 5f92fa1..0000000
--- a/ica/src/ItalcSlaveManager.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * ItalcSlaveManager.h - ItalcSlaveManager which manages (GUI) slave apps
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_SLAVE_MANAGER_H
-#define ITALC_SLAVE_MANAGER_H
-
-#include "Ipc/Master.h"
-#include "DemoServerMaster.h"
-
-
-class ItalcSlaveManager : protected Ipc::Master
-{
-	Q_OBJECT
-public:
-	ItalcSlaveManager();
-	virtual ~ItalcSlaveManager();
-
-	static const Ipc::Id IdCoreServer;
-	static const Ipc::Id IdAccessDialog;
-	static const Ipc::Id IdDemoClient;
-	static const Ipc::Id IdDemoServer;
-	static const Ipc::Id IdMessageBox;
-	static const Ipc::Id IdScreenLock;
-	static const Ipc::Id IdInputLock;
-	static const Ipc::Id IdSystemTrayIcon;
-
-	struct AccessDialog
-	{
-		static const Ipc::Command Ask;
-		static const Ipc::Argument User;
-		static const Ipc::Argument Host;
-		static const Ipc::Argument ChoiceFlags;
-		static const Ipc::Command ReportChoice;
-	} ;
-
-	struct SystemTrayIcon
-	{
-		static const Ipc::Command ShowMessage;
-		static const Ipc::Argument Title;
-		static const Ipc::Argument Text;
-		static const Ipc::Command SetToolTip;
-		static const Ipc::Argument ToolTipText;
-	} ;
-
-	struct DemoClient
-	{
-		static const Ipc::Command StartDemo;
-		static const Ipc::Argument MasterHost;
-		static const Ipc::Argument FullScreen;
-	} ;
-
-	struct DemoServer
-	{
-		static const Ipc::Command StartDemoServer;
-		static const Ipc::Argument SourcePort;
-		static const Ipc::Argument DestinationPort;
-		static const Ipc::Argument CommonSecret;
-
-		static const Ipc::Command UpdateAllowedHosts;
-		static const Ipc::Argument AllowedHosts;
-	} ;
-
-	struct MessageBoxSlave
-	{
-		static const Ipc::Command ShowMessageBox;
-		static const Ipc::Argument Text;
-	} ;
-
-	DemoServerMaster *demoServerMaster()
-	{
-		return &m_demoServerMaster;
-	}
-
-	void startDemo( const QString &masterHost, bool fullscreen);
-	void stopDemo();
-
-	void lockScreen();
-	void unlockScreen();
-
-	void lockInput();
-	void unlockInput();
-
-	void messageBox( const QString &msg );
-	void setSystemTrayToolTip( const QString &tooltip );
-	void systemTrayMessage( const QString &title, const QString &msg );
-
-	int execAccessDialog( const QString &user, const QString &host,
-							int choiceFlags );
-
-	int slaveStateFlags();
-
-
-private:
-	virtual void createSlave( const Ipc::Id &id,
-								Ipc::SlaveLauncher *slaveLauncher = NULL );
-
-	virtual bool handleMessage( const Ipc::Id &slaveId, const Ipc::Msg &m );
-
-	DemoServerMaster m_demoServerMaster;
-	volatile int m_accessDialogChoice;
-
-	friend class DemoServerMaster;
-
-} ;
-
-
-#endif
diff --git a/ica/src/ItalcVncServer.cpp b/ica/src/ItalcVncServer.cpp
deleted file mode 100644
index 70e3ee9..0000000
--- a/ica/src/ItalcVncServer.cpp
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * ItalcVncServer.cpp - implementation of ItalcVncServer, a VNC-server-
- *                      abstraction for platform independent VNC-server-usage
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include "rfb/rfb.h"
-#include "rfb/dh.h"
-
-#ifdef ITALC_BUILD_WIN32
-
-#include <windows.h>
-#include <pthread.h>
-
-#else
-
-extern "C"
-{
-#include "d3des.h"
-}
-
-#endif
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-#include <QtCore/QProcess>
-
-#include "ItalcVncServer.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "ItalcCoreServer.h"
-#include "ItalcRfbExt.h"
-#include "Logger.h"
-#include "LogonAuthentication.h"
-
-
-extern "C" int x11vnc_main( int argc, char * * argv );
-
-
-
-qint64 libvncServerDispatcher( char * _buf, const qint64 _len,
-				const SocketOpCodes _op_code, void * _user )
-{
-	rfbClientPtr cl = (rfbClientPtr) _user;
-	switch( _op_code )
-	{
-		case SocketRead:
-			return rfbReadExact( cl, _buf, _len ) == 1 ? _len : 0;
-		case SocketWrite:
-			return rfbWriteExact( cl, _buf, _len ) == 1 ? _len : 0;
-		case SocketGetPeerAddress:
-			strncpy( _buf, cl->host, _len );
-			break;
-	}
-	return 0;
-
-}
-
-
-
-
-static rfbBool italcCoreNewClient( struct _rfbClientRec *, void * * )
-{
-	return true;
-}
-
-
-
-
-static rfbBool lvs_italcHandleMessage( struct _rfbClientRec *client,
-					void *data,
-					const rfbClientToServerMsg *message )
-{
-	if( message->type == rfbItalcCoreRequest )
-	{
-		return ItalcCoreServer::instance()->
-				handleItalcClientMessage( libvncServerDispatcher, client );
-	}
-	return false;
-}
-
-
-extern "C" void rfbClientSendString(rfbClientPtr cl, char *reason);
-
-
-static void lvs_italcSecurityHandler( struct _rfbClientRec *cl )
-{
-	bool authOK = ItalcCoreServer::instance()->
-								authSecTypeItalc( libvncServerDispatcher, cl );
-
-	uint32_t result = authOK ? rfbVncAuthOK : rfbVncAuthFailed;
-	result = Swap32IfLE( result );
-	rfbWriteExact( cl, (char *) &result, 4 );
-
-	if( authOK )
-	{
-		cl->state = rfbClientRec::RFB_INITIALISATION;
-	}
-	else
-	{
-		rfbClientSendString( cl, (char *) "Signature verification failed!" );
-    }
-}
-
-
-
-
-#ifndef ITALC_BUILD_WIN32
-
-static void vncDecryptBytes(unsigned char *where, const int length, const unsigned char *key)
-{
-	int i, j;
-	rfbDesKey((unsigned char*) key, DE1);
-	for (i = length - 8; i > 0; i -= 8) {
-		rfbDes(where + i, where + i);
-		for (j = 0; j < 8; j++)
-			where[i + j] ^= where[i + j - 8];
-	}
-	/* i = 0 */
-	rfbDes(where, where);
-	for (i = 0; i < 8; i++)
-		where[i] ^= key[i];
-}
-
-
-
-static bool authMsLogon( struct _rfbClientRec *cl )
-{
-	DiffieHellman dh;
-	char gen[8], mod[8], pub[8], resp[8];
-	char user[256], passwd[64];
-	unsigned char key[8];
-
-	dh.createKeys();
-	int64ToBytes( dh.getValue(DH_GEN), gen );
-	int64ToBytes( dh.getValue(DH_MOD), mod );
-	int64ToBytes( dh.createInterKey(), pub );
-	if( !rfbWriteExact( cl, gen, sizeof(gen) ) ) return false;
-	if( !rfbWriteExact( cl, mod, sizeof(mod) ) ) return false;
-	if( !rfbWriteExact( cl, pub, sizeof(pub) ) ) return false;
-	if( !rfbReadExact( cl, resp, sizeof(resp) ) ) return false;
-	if( !rfbReadExact( cl, user, sizeof(user) ) ) return false;
-	if( !rfbReadExact( cl, passwd, sizeof(passwd) ) ) return false;
-
-	int64ToBytes( dh.createEncryptionKey( bytesToInt64( resp ) ), (char*) key );
-	vncDecryptBytes( (unsigned char*) user, sizeof(user), key ); user[255] = '\0';
-	vncDecryptBytes( (unsigned char*) passwd, sizeof(passwd), key ); passwd[63] = '\0';
-
-	AuthenticationCredentials credentials;
-	credentials.setLogonUsername( user );
-	credentials.setLogonPassword( passwd );
-
-	return LogonAuthentication::authenticateUser( credentials );
-}
-
-
-
-static void lvs_msLogonIISecurityHandler( struct _rfbClientRec *cl )
-{
-	bool authOK = authMsLogon( cl );
-
-	uint32_t result = authOK ? rfbVncAuthOK : rfbVncAuthFailed;
-	result = Swap32IfLE( result );
-	rfbWriteExact( cl, (char *) &result, 4 );
-
-	if( authOK )
-	{
-		cl->state = rfbClientRec::RFB_INITIALISATION;
-	}
-	else
-	{
-		rfbClientSendString( cl, (char *) "MS Logon II authentication failed!" );
-    }
-}
-
-#endif
-
-
-#ifdef ITALC_BUILD_WIN32
-
-extern bool Myinit( HINSTANCE hInstance );
-extern int WinVNCAppMain();
-
-#endif
-
-
-
-ItalcVncServer::ItalcVncServer() :
-	QThread(),
-	m_port( ItalcCore::serverPort )
-{
-}
-
-
-
-ItalcVncServer::~ItalcVncServer()
-{
-}
-
-
-
-static void runX11vnc( QStringList cmdline, int port, bool plainVnc )
-{
-	cmdline
-		<< "-nosel"	// do not exchange clipboard-contents
-		<< "-nosetclipboard"	// do not exchange clipboard-contents
-		<< "-rfbport" << QString::number( port )
-				// set port where the VNC server should listen
-		;
-
-#ifdef ITALC_BUILD_LINUX
-	if( !plainVnc && ItalcCore::config->isHttpServerEnabled() )
-	{
-		QDir d( QCoreApplication::applicationDirPath() );
-		if( d.cdUp() && d.cd( "share" ) && d.cd( "italc" ) &&
-				d.cd( "JavaViewer" ) )
-		{
-			cmdline << "-httpport"
-					<< QString::number( ItalcCore::config->httpServerPort() )
-					<< "-httpdir" << d.absolutePath();
-			LogStream() << "Using JavaViewer files at" << d.absolutePath();
-		}
-		else
-		{
-			qWarning( "Could not find JavaViewer files. "
-						"Check your iTALC installation!" );
-		}
-	}
-
-	// workaround for x11vnc when running in an NX session
-	foreach( const QString &s, QProcess::systemEnvironment() )
-	{
-		if( s.startsWith( "NXSESSIONID=" ) || s.startsWith( "X2GO_SESSION=" ) )
-		{
-			cmdline << "-noxdamage";
-		}
-	}
-#endif
-
-	// build new C-style command line array based on cmdline-QStringList
-	char **argv = new char *[cmdline.size()+1];
-	argv[0] = qstrdup( QCoreApplication::arguments()[0].toUtf8().constData() );
-	int argc = 1;
-
-	for( QStringList::iterator it = cmdline.begin();
-				it != cmdline.end(); ++it, ++argc )
-	{
-		argv[argc] = new char[it->length() + 1];
-		strcpy( argv[argc], it->toUtf8().constData() );
-	}
-
-	static bool firstTime = true;
-
-	if( firstTime )
-	{
-		if( plainVnc == false )
-		{
-			// register iTALC protocol extension
-			static rfbProtocolExtension pe;
-
-			// initialize all pointers inside the struct to NULL
-			memset( &pe, 0, sizeof( pe ) );
-
-			// register our own handlers
-			pe.newClient = italcCoreNewClient;
-			pe.handleMessage = lvs_italcHandleMessage;
-
-			rfbRegisterProtocolExtension( &pe );
-		}
-
-		// register handler for iTALC's security-type
-		static rfbSecurityHandler shi = { rfbSecTypeItalc, lvs_italcSecurityHandler, NULL };
-		rfbRegisterSecurityHandler( &shi );
-
-#ifndef ITALC_BUILD_WIN32
-		// register handler for MS Logon II security type
-		static rfbSecurityHandler shmsl = { rfbUltraVNC_MsLogonIIAuth, lvs_msLogonIISecurityHandler, NULL };
-		rfbRegisterSecurityHandler( &shmsl );
-#endif
-
-		firstTime = false;
-	}
-
-	// run x11vnc-server
-	x11vnc_main( argc, argv );
-
-}
-
-
-
-void ItalcVncServer::runVncReflector( int srcPort, int dstPort )
-{
-	QStringList args;
-	args << "-viewonly"
-		<< "-reflect"
-		<< QString( "localhost:%1" ).arg( srcPort );
-	if( ItalcCore::config->isDemoServerMultithreaded() )
-	{
-		args << "-threads";
-	}
-
-	while( 1 )
-	{
-		runX11vnc( args, dstPort, true );
-	}
-}
-
-
-
-void ItalcVncServer::run()
-{
-#ifdef ITALC_BUILD_LINUX
-	QStringList cmdline;
-
-	QStringList acceptedArguments;
-	acceptedArguments
-			<< "-noshm"
-			<< "-solid"
-			<< "-xrandr"
-			<< "-onetile";
-
-	foreach( const QString & arg, QCoreApplication::arguments() )
-	{
-		if( acceptedArguments.contains( arg ) )
-		{
-			cmdline.append( arg );
-		}
-	}
-
-	runX11vnc( cmdline, m_port, false );
-
-#elif ITALC_BUILD_WIN32
-
-	// run winvnc-server
-	Myinit( GetModuleHandle( NULL ) );
-	WinVNCAppMain();
-
-#endif
-
-}
-
-
diff --git a/ica/src/ItalcVncServer.h b/ica/src/ItalcVncServer.h
deleted file mode 100644
index 9732472..0000000
--- a/ica/src/ItalcVncServer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * ItalcVncServer.h - class ItalcVncServer, a VNC server abstraction for
- *                    platform-independent VNC server usage
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_VNC_SERVER_H
-#define ITALC_VNC_SERVER_H
-
-#include <QtCore/QThread>
-
-class ItalcVncServer : public QThread
-{
-public:
-	ItalcVncServer();
-	virtual ~ItalcVncServer();
-
-	int serverPort() const
-	{
-		return m_port;
-	}
-
-	static void runVncReflector( int srcPort, int dstPort );
-
-
-private:
-	virtual void run();
-
-	int m_port;
-
-} ;
-
-#endif
-
diff --git a/ica/src/LocalSystemIca.cpp b/ica/src/LocalSystemIca.cpp
deleted file mode 100644
index 732bdba..0000000
--- a/ica/src/LocalSystemIca.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * LocalSystemIca.cpp - namespace LocalSystem, providing an interface for
- *                      transparent usage of operating-system-specific
- *                      functions
- *
- * Copyright (c) 2007-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-#define _WIN32_WINNT 0x0501
-#endif
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QProcess>
-
-#ifdef ITALC_BUILD_WIN32
-
-#include <windows.h>
-#include <psapi.h>
-#include <lm.h>
-#include <shlobj.h>
-#include <winable.h>
-
-#if _WIN32_WINNT >= 0x500
-#define SHUTDOWN_FLAGS (EWX_FORCE | EWX_FORCEIFHUNG)
-#else
-#define SHUTDOWN_FLAGS (EWX_FORCE)
-#endif
-
-#if _WIN32_WINNT >= 0x501
-#include <reason.h>
-#define SHUTDOWN_REASON SHTDN_REASON_MAJOR_OTHER
-#else
-#define SHUTDOWN_REASON 0
-#endif
-
-#include <QtCore/QMutex>
-#include <QtCore/QThread>
-
-#include "LocalSystem.h"
-#include "SystemKeyTrapper.h"
-
-#else
-
-#include "LocalSystem.h"
-
-#ifdef ITALC_HAVE_X11
-#include <X11/Xlib.h>
-#else
-#define KeySym int
-#endif
-
-#ifdef ITALC_HAVE_PWD_H
-#include <pwd.h>
-#endif
-
-#include "rfb/rfb.h"
-
-extern "C"
-{
-#include "keyboard.h"
-}
-
-
-extern rfbClientPtr __client;
-
-static inline void pressKey( int _key, bool _down )
-{
-	if( !__client )
-	{
-		return;
-	}
-	keyboard( _down, _key, __client );
-}
-
-
-#endif
-
-
-namespace LocalSystem
-{
-
-
-/*void disableLocalInputs( bool _disabled )
-{
-#if 0
-#ifdef ITALC_BUILD_WIN32
-	static systemKeyTrapper * __skt = NULL;
-	if( __localInputsDisabled != _disabled )
-	{
-		__localInputsDisabled = _disabled;
-		if( _disabled && __skt == NULL )
-		{
-			__skt = new systemKeyTrapper();
-		}
-		else
-		{
-			delete __skt;
-			__skt = NULL;
-		}
-	}
-#else
-#warning TODO
-#endif
-#endif
-}*/
-
-
-
-void powerDown( void )
-{
-#ifdef ITALC_BUILD_WIN32
-	enablePrivilege( SE_SHUTDOWN_NAME, TRUE );
-	ExitWindowsEx( EWX_POWEROFF | SHUTDOWN_FLAGS, SHUTDOWN_REASON );
-	enablePrivilege( SE_SHUTDOWN_NAME, FALSE );
-#else
-	if( LocalSystem::User::loggedOnUser().name() == "root" )
-	{
-		QProcess::startDetached( "poweroff" );
-	}
-	else
-	{
-		QProcess::startDetached( "gdm-signal -h" ); // Gnome shutdown
-		QProcess::startDetached( "gnome-session-save --silent --kill" ); // Gnome logout
-		QProcess::startDetached( "dcop ksmserver ksmserver logout 0 2 0" ); // KDE shutdown
-		QProcess::startDetached( "qdbus org.kde.ksmserver /KSMServer logout 0 2 0" ); // KDE4 shutdown
-	}
-#endif
-}
-
-
-
-
-void logoutUser( void )
-{
-#ifdef ITALC_BUILD_WIN32
-	ExitWindowsEx( EWX_LOGOFF | SHUTDOWN_FLAGS, SHUTDOWN_REASON );
-#else
-	QProcess::startDetached( "gnome-session-save --silent --kill" ); // Gnome logout
-	QProcess::startDetached( "dcop ksmserver ksmserver logout 0 0 0" ); // KDE logout
-	QProcess::startDetached( "qdbus org.kde.ksmserver /KSMServer logout 0 0 0" ); // KDE4 logout
-#endif
-}
-
-
-
-void reboot( void )
-{
-#ifdef ITALC_BUILD_WIN32
-	enablePrivilege( SE_SHUTDOWN_NAME, TRUE );
-	ExitWindowsEx( EWX_REBOOT | SHUTDOWN_FLAGS, SHUTDOWN_REASON );
-	enablePrivilege( SE_SHUTDOWN_NAME, FALSE );
-#else
-	if( LocalSystem::User::loggedOnUser().name() == "root" )
-	{
-		QProcess::startDetached( "poweroff" );
-	}
-	else
-	{
-		QProcess::startDetached( "gdm-signal -r" ); // Gnome reboot
-		QProcess::startDetached( "gnome-session-save --silent --kill" ); // Gnome logout
-		QProcess::startDetached( "dcop ksmserver ksmserver logout 0 1 0" ); // KDE reboot
-		QProcess::startDetached( "qdbus org.kde.ksmserver /KSMServer logout 0 1 0" ); // KDE4 reboot
-	}
-#endif
-}
-
-
-
-
-} // end of namespace LocalSystem
-
diff --git a/ica/src/MessageBoxSlave.cpp b/ica/src/MessageBoxSlave.cpp
deleted file mode 100644
index 826454d..0000000
--- a/ica/src/MessageBoxSlave.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * MessageBoxSlave.cpp - an IcaSlave providing message boxes
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "MessageBoxSlave.h"
-#include "ItalcSlaveManager.h"
-#include "DecoratedMessageBox.h"
-
-
-MessageBoxSlave::MessageBoxSlave() :
-	IcaSlave()
-{
-}
-
-
-
-MessageBoxSlave::~MessageBoxSlave()
-{
-}
-
-
-
-bool MessageBoxSlave::handleMessage( const Ipc::Msg &m )
-{
-	if( m.cmd() == ItalcSlaveManager::MessageBoxSlave::ShowMessageBox )
-	{
-		new DecoratedMessageBox( tr( "Message from teacher" ),
-				m.arg( ItalcSlaveManager::MessageBoxSlave::Text ),
-				QPixmap( ":/resources/message.png" ) );
-
-		return true;
-	}
-
-	return false;
-}
-
diff --git a/ica/src/MessageBoxSlave.h b/ica/src/MessageBoxSlave.h
deleted file mode 100644
index 6332758..0000000
--- a/ica/src/MessageBoxSlave.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * MessageBoxSlave.h - an IcaSlave providing message boxes
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef MESSAGE_BOX_SLAVE_H
-#define MESSAGE_BOX_SLAVE_H
-
-#include "IcaSlave.h"
-
-class MessageBoxSlave : public IcaSlave
-{
-	Q_OBJECT
-public:
-	MessageBoxSlave();
-	virtual ~MessageBoxSlave();
-
-	static QString slaveName()
-	{
-		return "MessageBoxSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-} ;
-
-#endif
-
diff --git a/ica/src/RfbItalcCursor.cpp b/ica/src/RfbItalcCursor.cpp
deleted file mode 100644
index 05a9ac4..0000000
--- a/ica/src/RfbItalcCursor.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * RfbItalcCursor.cpp - iTALC cursor rectangle encoding
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "ItalcVncConnection.h"
-#include "RfbItalcCursor.h"
-#include "SocketDevice.h"
-
-#include <rfb/rfb.h>
-#include <rfb/rfbclient.h>
-
-
-static rfbBool handleEncodingItalcCursor( rfbClient *c,
-										rfbFramebufferUpdateRectHeader *r )
-{
-	ItalcVncConnection *t = (ItalcVncConnection *) rfbClientGetClientData( c, 0 );
-	if( r->encoding != rfbEncodingItalcCursor || t == NULL )
-	{
-		return false;
-	}
-
-	QImage cursorShape(
-				SocketDevice( libvncClientDispatcher, c ).read().value<QImage>() );
-
-	t->cursorShapeUpdatedExternal( cursorShape, r->r.x, r->r.y );
-
-	return true;
-}
-
-
-
-
-static rfbClientProtocolExtension * __italcCursorProtocolExt = NULL;
-
-
-RfbItalcCursor::RfbItalcCursor()
-{
-	if( __italcCursorProtocolExt == NULL )
-	{
-		__italcCursorProtocolExt = new rfbClientProtocolExtension;
-		__italcCursorProtocolExt->encodings = new int[2];
-		__italcCursorProtocolExt->encodings[0] = rfbEncodingItalcCursor;
-		__italcCursorProtocolExt->encodings[1] = 0;
-		__italcCursorProtocolExt->handleEncoding = handleEncodingItalcCursor;
-		__italcCursorProtocolExt->handleMessage = NULL;
-
-		rfbClientRegisterExtension( __italcCursorProtocolExt );
-	}
-}
-
-
diff --git a/ica/src/RfbItalcCursor.h b/ica/src/RfbItalcCursor.h
deleted file mode 100644
index 8befe9b..0000000
--- a/ica/src/RfbItalcCursor.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * RfbItalcCursor.h - iTALC cursor rectangle encoding
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * code partly taken from KRDC / vncclientthread.h:
- * Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef RFB_ITALC_CURSOR_H
-#define RFB_ITALC_CURSOR_H
-
-#define rfbEncodingItalcCursor 31
-
-class RfbItalcCursor
-{
-public:
-	RfbItalcCursor();
-
-} ;
-
-#endif
-
diff --git a/ica/src/RfbLZORLE.cpp b/ica/src/RfbLZORLE.cpp
deleted file mode 100644
index df4133e..0000000
--- a/ica/src/RfbLZORLE.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * RfbLZORLE.cpp - LZO+RLE-based VNC rectangle encoding
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "RfbLZORLE.h"
-
-#include "minilzo.h"
-
-#include <QtGui/QColor>
-
-#include <rfb/rfb.h>
-#include <rfb/rfbclient.h>
-
-
-static void CopyRectangle( rfbClient* client, uint8_t* buffer, int x, int y, int w, int h )
-{
-	const int rs = w*4, rs2 = client->width * 4;
-	for( int j = (x *4) + (y * rs2); j < (y + h) * rs2; j += rs2 )
-	{
-		memcpy( client->frameBuffer + j, buffer, rs );
-		buffer += rs;
-	}
-}
-
-
-static bool handleRaw( rfbClient *c, int rx, int ry, int rw, int rh )
-{
-	int y=ry, h=rh;
-	int bytesPerLine = rw * c->format.bitsPerPixel / 8;
-	int linesToRead = RFB_BUFFER_SIZE / bytesPerLine;
-
-	while( h > 0 )
-	{
-		if( linesToRead > h )
-			linesToRead = h;
-
-		if( !ReadFromRFBServer( c, c->buffer,bytesPerLine * linesToRead ) )
-			return false;
-
-		CopyRectangle( c, (uint8_t *)c->buffer, rx, y, rw,linesToRead );
-
-		h -= linesToRead;
-		y += linesToRead;
-	}
-
-	return true;
-}
-
-
-
-static rfbBool handleEncodingLZORLE( rfbClient *c,
-										rfbFramebufferUpdateRectHeader *r )
-{
-	if( r->encoding != rfbEncodingLZORLE )
-	{
-		return false;
-	}
-
-	uint16_t rx = r->r.x;
-	uint16_t ry = r->r.y;
-	const uint16_t rw = r->r.w;
-	const uint16_t rh = r->r.h;
-
-	RfbLZORLE::Header hdr;
-	if( !ReadFromRFBServer( c, (char *) &hdr, sizeof( hdr ) ) )
-	{
-		qWarning( "failed reading RfbLZORLE::Header from server" );
-		return false;
-	}
-
-	if( !hdr.compressed )
-	{
-		return handleRaw( c, rx, ry, rw, rh );
-	}
-
-	hdr.bytesLZO = Swap32IfLE( hdr.bytesLZO );
-	hdr.bytesRLE = Swap32IfLE( hdr.bytesRLE );
-
-	uint8_t *lzo_data = new uint8_t[hdr.bytesLZO];
-
-	if( !ReadFromRFBServer( c, (char *) lzo_data, hdr.bytesLZO ) )
-	{
-		qWarning( "failed reading LZO data from server" );
-		delete[] lzo_data;
-		return false;
-	}
-
-	uint8_t *rle_data = new uint8_t[hdr.bytesRLE];
-
-	lzo_uint decomp_bytes = hdr.bytesRLE;
-	lzo1x_decompress_safe( (const unsigned char *) lzo_data,
-				(lzo_uint) hdr.bytesLZO,
-				(unsigned char *) rle_data,
-				(lzo_uint *) &decomp_bytes, NULL );
-	if( decomp_bytes != hdr.bytesRLE )
-	{
-		delete[] rle_data;
-		delete[] lzo_data;
-		qCritical( "handleEncodingLZORLE(...): expected and real "
-					"size of decompressed data do not match!" );
-		return false;
-	}
-
-	QRgb *dst = ( (QRgb *) c->frameBuffer ) + c->width*ry + rx;
-	int dx = 0;
-	bool done = FALSE;
-	const int sh = c->height;
-	for( uint32_t i = 0; i < hdr.bytesRLE && done == false; i+=4 )
-	{
-		const QRgb val = Swap32IfBE( *( (QRgb*)( rle_data + i ) ) ) & 0xffffff;
-		const uint8_t rleCount = rle_data[i+3];
-		for( uint16_t j = 0; j <= rleCount; ++j )
-		{
-			*dst = val;
-			if( ++dx >= rw )
-			{
-				dx = 0;
-				if( ry+1 < sh )
-				{
-					++ry;
-					dst = ( (QRgb *) c->frameBuffer ) + c->width*ry + rx;
-				}
-				else
-				{
-					done = true;
-					break;
-				}
-			}
-			else
-			{
-				++dst;
-			}
-		}
-	}
-
-	if( dx != 0 )
-	{
-		qWarning( "handleEncodingLZORLE(...): dx(%d) != 0", dx );
-	}
-
-	delete[] lzo_data;
-	delete[] rle_data;
-
-	return true;
-}
-
-
-
-
-static rfbClientProtocolExtension * __lzoRleProtocolExt = NULL;
-
-
-RfbLZORLE::RfbLZORLE()
-{
-	if( __lzoRleProtocolExt == NULL )
-	{
-		__lzoRleProtocolExt = new rfbClientProtocolExtension;
-		__lzoRleProtocolExt->encodings = new int[2];
-		__lzoRleProtocolExt->encodings[0] = rfbEncodingLZORLE;
-		__lzoRleProtocolExt->encodings[1] = 0;
-		__lzoRleProtocolExt->handleEncoding = handleEncodingLZORLE;
-		__lzoRleProtocolExt->handleMessage = NULL;
-
-		rfbClientRegisterExtension( __lzoRleProtocolExt );
-	}
-}
-
-
diff --git a/ica/src/RfbLZORLE.h b/ica/src/RfbLZORLE.h
deleted file mode 100644
index 6086837..0000000
--- a/ica/src/RfbLZORLE.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * RfbLZORLE.h - LZO+RLE-based RFB rectangle encoding
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * code partly taken from KRDC / vncclientthread.h:
- * Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef RFB_LZO_RLE_H
-#define RFB_LZO_RLE_H
-
-#include <stdint.h>
-
-#define rfbEncodingLZORLE 30
-
-class RfbLZORLE
-{
-public:
-	RfbLZORLE();
-
-	struct Header
-	{
-		uint8_t compressed;
-		uint32_t bytesLZO;
-		uint32_t bytesRLE;
-	} ;
-
-} ;
-
-#endif
-
diff --git a/ica/src/ScreenLockSlave.cpp b/ica/src/ScreenLockSlave.cpp
deleted file mode 100644
index 9eeca05..0000000
--- a/ica/src/ScreenLockSlave.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * ScreenLockSlave.h - an IcaSlave providing the screeen lock functionality
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "LockWidget.h"
-#include "ScreenLockSlave.h"
-
-
-ScreenLockSlave::ScreenLockSlave() :
-	IcaSlave(),
-	m_lockWidget( new LockWidget() )
-{
-}
-
-
-
-
-ScreenLockSlave::~ScreenLockSlave()
-{
-	delete m_lockWidget;
-}
-
-
-
-
-bool ScreenLockSlave::handleMessage( const Ipc::Msg &m )
-{
-	return false;
-}
-
diff --git a/ica/src/ScreenLockSlave.h b/ica/src/ScreenLockSlave.h
deleted file mode 100644
index 9377775..0000000
--- a/ica/src/ScreenLockSlave.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * ScreenLockSlave.h - an IcaSlave providing the screen lock functionality
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SCREEN_LOCK_SLAVE_H
-#define SCREEN_LOCK_SLAVE_H
-
-#include "IcaSlave.h"
-
-class LockWidget;
-
-class ScreenLockSlave : public IcaSlave
-{
-public:
-	ScreenLockSlave();
-	virtual ~ScreenLockSlave();
-
-	static QString slaveName()
-	{
-		return "ScreenLockSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-	LockWidget *m_lockWidget;
-
-} ;
-
-#endif
-
diff --git a/ica/src/ScreenLockSlaveLauncher.cpp b/ica/src/ScreenLockSlaveLauncher.cpp
deleted file mode 100644
index 1189cc5..0000000
--- a/ica/src/ScreenLockSlaveLauncher.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * ScreenLockSlaveLauncher.cpp - a SlaveLauncher for the ScreenLockSlave
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QStringList>
-
-#include "ScreenLockSlaveLauncher.h"
-#include "LocalSystem.h"
-#include "Ipc/QtSlaveLauncher.h"
-
-
-ScreenLockSlaveLauncher::ScreenLockSlaveLauncher(
-										const QString &applicationFilePath ) :
-	Ipc::SlaveLauncher( applicationFilePath ),
-#ifdef ITALC_BUILD_WIN32
-	m_newDesktop( NULL ),
-	m_origThreadDesktop( NULL ),
-	m_origInputDesktop( NULL ),
-	m_lockProcess( NULL )
-#else
-	m_launcher( NULL )
-#endif
-{
-}
-
-
-
-ScreenLockSlaveLauncher::~ScreenLockSlaveLauncher()
-{
-	// base class destructor calls stop()
-}
-
-
-
-void ScreenLockSlaveLauncher::start( const QStringList &arguments )
-{
-	stop();
-
-#ifdef ITALC_BUILD_WIN32
-
-	m_origThreadDesktop = GetThreadDesktop( GetCurrentThreadId() );
-	m_origInputDesktop = OpenInputDesktop( 0, FALSE, DESKTOP_SWITCHDESKTOP );
-
-	char *desktopName = qstrdup( LocalSystem::Desktop::screenLockDesktop().
-												name().toUtf8().constData() );
-	m_newDesktop = CreateDesktop( desktopName, NULL, NULL, 0, GENERIC_ALL, NULL );
-
-	LocalSystem::User user = LocalSystem::User::loggedOnUser();
-	LocalSystem::Process proc(
-				LocalSystem::Process::findProcessId( QString(), -1, &user ) );
-
-	m_lockProcess =
-		proc.runAsUser( applicationFilePath() + " " + arguments.join( " " ),
-							LocalSystem::Desktop::screenLockDesktop().name() );
-
-	delete[] desktopName;
-
-	// sleep a bit so switch to desktop with loaded screen locker runs smoothly
-	Sleep( 2000 );
-
-	SwitchDesktop( m_newDesktop );
-
-#else
-
-	m_launcher = new Ipc::QtSlaveLauncher( applicationFilePath() );
-	m_launcher->start( arguments );
-
-#endif
-}
-
-
-
-void ScreenLockSlaveLauncher::stop()
-{
-#ifdef ITALC_BUILD_WIN32
-	if( m_lockProcess )
-	{
-		SwitchDesktop( m_origInputDesktop );
-		if( WaitForSingleObject( m_lockProcess, 10000 ) == WAIT_TIMEOUT )
-		{
-			qWarning( "ScreenLockSlaveLauncher: calling TerminateProcess()" );
-			TerminateProcess( m_lockProcess, 0 );
-		}
-		CloseDesktop( m_newDesktop );
-
-		m_lockProcess = NULL;
-	}
-#else
-	if( m_launcher )
-	{
-		m_launcher->stop();
-		delete m_launcher;
-		m_launcher = NULL;
-	}
-#endif
-}
-
-
-
-bool ScreenLockSlaveLauncher::isRunning()
-{
-#ifdef ITALC_BUILD_WIN32
-	return true;		// TODO
-#else
-	return m_launcher && m_launcher->isRunning();
-#endif
-}
-
diff --git a/ica/src/ScreenLockSlaveLauncher.h b/ica/src/ScreenLockSlaveLauncher.h
deleted file mode 100644
index 0a23589..0000000
--- a/ica/src/ScreenLockSlaveLauncher.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * ScreenLockSlaveLauncher.h - a SlaveLauncher for the ScreenLockSlave
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SCREEN_LOCK_SLAVE_LAUNCHER_H
-#define SCREEN_LOCK_SLAVE_LAUNCHER_H
-
-#include <italcconfig.h>
-
-#include "Ipc/SlaveLauncher.h"
-
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-#else
-#include "Ipc/QtSlaveLauncher.h"
-#endif
-
-class ScreenLockSlaveLauncher : public Ipc::SlaveLauncher
-{
-public:
-	ScreenLockSlaveLauncher( const QString &applicationFilePath );
-	~ScreenLockSlaveLauncher();
-
-	virtual void start( const QStringList &arguments );
-	virtual void stop();
-	virtual bool isRunning();
-
-
-private:
-#ifdef ITALC_BUILD_WIN32
-	HDESK m_newDesktop;
-	HDESK m_origThreadDesktop;
-	HDESK m_origInputDesktop;
-	HANDLE m_lockProcess;
-#else
-	Ipc::QtSlaveLauncher *m_launcher;
-#endif
-};
-
-
-#endif
-
diff --git a/ica/src/SystemTrayIconSlave.cpp b/ica/src/SystemTrayIconSlave.cpp
deleted file mode 100644
index 365162d..0000000
--- a/ica/src/SystemTrayIconSlave.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * SystemTrayIconSlave.cpp - an IcaSlave providing the system tray icon
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "SystemTrayIconSlave.h"
-#include "ItalcSlaveManager.h"
-
-
-SystemTrayIconSlave::SystemTrayIconSlave() :
-	IcaSlave(),
-	m_systemTrayIcon()
-{
-	QIcon icon( ":/resources/icon16.png" );
-	icon.addFile( ":/resources/icon22.png" );
-	icon.addFile( ":/resources/icon32.png" );
-
-	m_systemTrayIcon.setIcon( icon );
-	m_systemTrayIcon.show();
-}
-
-
-
-
-SystemTrayIconSlave::~SystemTrayIconSlave()
-{
-}
-
-
-
-bool SystemTrayIconSlave::handleMessage( const Ipc::Msg &m )
-{
-	if( m.cmd() == ItalcSlaveManager::SystemTrayIcon::SetToolTip )
-	{
-		m_systemTrayIcon.setToolTip(
-					m.arg( ItalcSlaveManager::SystemTrayIcon::ToolTipText ) );
-		return true;
-	}
-	else if( m.cmd() == ItalcSlaveManager::SystemTrayIcon::ShowMessage )
-	{
-		m_systemTrayIcon.showMessage(
-					m.arg( ItalcSlaveManager::SystemTrayIcon::Title ),
-					m.arg( ItalcSlaveManager::SystemTrayIcon::Text ) );
-		return true;
-	}
-
-	return false;
-}
-
diff --git a/ica/src/SystemTrayIconSlave.h b/ica/src/SystemTrayIconSlave.h
deleted file mode 100644
index 518d994..0000000
--- a/ica/src/SystemTrayIconSlave.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * SystemTrayIconSlave.h - an IcaSlave providing the system tray icon
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SYSTEM_TRAY_ICON_SLAVE_H
-#define SYSTEM_TRAY_ICON_SLAVE_H
-
-#include <QtGui/QSystemTrayIcon>
-
-#include "IcaSlave.h"
-
-class SystemTrayIconSlave : public IcaSlave
-{
-public:
-	SystemTrayIconSlave();
-	virtual ~SystemTrayIconSlave();
-
-	static QString slaveName()
-	{
-		return "SystemTrayIconSlave";
-	}
-
-
-private:
-	virtual bool handleMessage( const Ipc::Msg &m );
-
-	QSystemTrayIcon m_systemTrayIcon;
-
-} ;
-
-#endif
-
-
diff --git a/ica/src/WindowsService.cpp b/ica/src/WindowsService.cpp
deleted file mode 100644
index 2c7a4b0..0000000
--- a/ica/src/WindowsService.cpp
+++ /dev/null
@@ -1,826 +0,0 @@
-/*
- * WindowsService.cpp - implementation of WindowsService-class
- *
- * Copyright (c) 2006-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QDebug>
-#include <QtCore/QProcess>
-#include <QtCore/QTime>
-#include <QtGui/QApplication>
-#include <QtGui/QMessageBox>
-
-#include "WindowsService.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-#ifdef ITALC_BUILD_WIN32
-
-
-class ItalcServiceSubProcess
-{
-public:
-	ItalcServiceSubProcess() :
-		m_subProcessHandle( NULL )
-	{
-	}
-
-	~ItalcServiceSubProcess()
-	{
-		stop();
-	}
-
-	void start( int sessionId )
-	{
-		stop();
-
-		char appPath[MAX_PATH];
-		if( GetModuleFileName( NULL, appPath, ARRAYSIZE(appPath) ) )
-		{
-			LogStream() << "Starting core server for user"
-						<< LocalSystem::User::loggedOnUser().name();
-			// run with the same user as winlogon.exe does
-			m_subProcessHandle =
-				LocalSystem::Process(
-					LocalSystem::Process::findProcessId( "winlogon.exe",
-															sessionId )
-									).runAsUser( appPath,
-											LocalSystem::Desktop().name() );
-		}
-	}
-
-	void stop()
-	{
-		if( m_subProcessHandle )
-		{
-			ilog( Info, "Waiting for core server to shutdown" );
-			if( WaitForSingleObject( m_subProcessHandle, 10000 ) ==
-																WAIT_TIMEOUT )
-			{
-				ilog( Warning, "Terminating core server" );
-				TerminateProcess( m_subProcessHandle, 0 );
-			}
-			CloseHandle( m_subProcessHandle ),
-			m_subProcessHandle = NULL;
-		}
-	}
-
-	bool isRunning() const
-	{
-		if( m_subProcessHandle &&
-			WaitForSingleObject( m_subProcessHandle, 5000 ) == WAIT_TIMEOUT )
-		{
-			return true;
-		}
-
-		return false;
-	}
-
-
-private:
-	HANDLE m_subProcessHandle;
-} ;
-
-
-
-WindowsService::WindowsService(
-			const QString &serviceName,
-			const QString &serviceArg,
-			const QString &displayName,
-			const QString &serviceDependencies,
-			int argc,
-			char **argv )
-		:
-	m_name( serviceName ),
-	m_arg( serviceArg ),
-	m_displayName( displayName ),
-	m_dependencies( serviceDependencies ),
-	m_running( false ),
-	m_quiet( false ),
-	m_argc( argc ),
-	m_argv( argv )
-{
-}
-
-
-
-
-bool WindowsService::evalArgs( int &argc, char **argv )
-{
-	if( argc <= 1 )
-	{
-		return false;
-	}
-
-	char appPath[MAX_PATH];
-	if( !GetModuleFileName( NULL, appPath, ARRAYSIZE(appPath) ) )
-	{
-		return false;
-	}
-
-	if( argv[1] == m_arg )
-	{
-		ItalcCore::init();
-		Logger l( "ItalcServiceMonitor" );
-		return runAsService();
-	}
-
-	QApplication app( argc, argv );
-
-	ItalcCore::init();
-
-	Logger l( "ItalcServiceControl" );
-
-	QStringList args = app.arguments();
-	args.removeFirst();
-
-	m_quiet = args.removeAll( "-quiet" ) > 0;
-
-	struct ServiceOp
-	{
-		const char *arg;
-		typedef bool(WindowsService:: * OpFunc)();
-		OpFunc opFunc;
-	} ;
-
-	static const ServiceOp serviceOps[] = {
-		{ "-registerservice", &WindowsService::install },
-		{ "-unregisterservice", &WindowsService::remove },
-		{ "-startservice", &WindowsService::start },
-		{ "-stopservice", &WindowsService::stop },
-		{ "", NULL }
-	} ;
-
-	foreach( QString arg, args )
-	{
-		arg = arg.toLower();
-		for( size_t i = 0; i < sizeof( serviceOps ); ++i )
-		{
-			if( arg == serviceOps[i].arg )
-			{
-				// make sure to run as administrator.
-				if( !LocalSystem::Process::isRunningAsAdmin() )
-				{
-					QString serviceArgs = serviceOps[i].arg;
-					if( m_quiet )
-					{
-						serviceArgs += " -quiet";
-					}
-					LocalSystem::Process::runAsAdmin( appPath,
-											serviceArgs.toUtf8().constData() );
-				}
-				else
-				{
-					(this->*serviceOps[i].opFunc)();
-				}
-				return true;
-			}
-		}
-		qWarning() << "Unknown option" << arg;
-	}
-
-	return false;
-}
-
-
-
-
-WindowsService *WindowsService::s_this = NULL;
-SERVICE_STATUS WindowsService::s_status;
-SERVICE_STATUS_HANDLE WindowsService::s_statusHandle;
-HANDLE WindowsService::s_stopServiceEvent = (DWORD) NULL;
-QAtomicInt WindowsService::s_sessionChangeEvent = 0;
-
-
-
-bool WindowsService::install()
-{
-	const unsigned int pathlength = 2048;
-	char path[pathlength];
-	char servicecmd[pathlength];
-
-	// Get the filename of this executable
-	if( GetModuleFileName( NULL, path, pathlength-(m_arg.length()+2) ) == 0 )
-	{
-		QMessageBox::critical( NULL, m_displayName,
-			QApplication::tr( "Unable to register service '%1'." ).
-								arg( m_displayName ) );
-		return false;
-	}
-
-	// Append the service-start flag to the end of the path:
-	if( strlen( path ) + 4 + m_arg.length() < pathlength )
-	{
-		sprintf( servicecmd, "\"%s\" %s", path,
-					m_arg.toLocal8Bit().constData() );
-	}
-	else
-	{
-		return false;
-	}
-
-	// Open the default, local Service Control Manager database
-	SC_HANDLE hsrvmanager = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
-	if( hsrvmanager == NULL )
-	{
-		QMessageBox::critical( NULL, m_displayName,
-				QApplication::tr(
-					"The Service Control Manager could "
-					"not be contacted (do you have the "
-					"neccessary rights?!) - the "
-					"service '%1' was not registered." ).
-							arg( m_displayName ) );
-		return false;
-	}
-
-	// Create an entry for the WinVNC service
-	SC_HANDLE hservice = CreateService(
-			hsrvmanager,		// SCManager database
-			m_name.toLocal8Bit().constData(),	// name of service
-			m_displayName.toLocal8Bit().constData(),// name to display
-			SERVICE_ALL_ACCESS,	// desired access
-			SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS,
-						// service type
-			SERVICE_AUTO_START,	// start type
-			SERVICE_ERROR_NORMAL,	// error control type
-			servicecmd,		// service's binary
-			NULL,			// no load ordering group
-			NULL,			// no tag identifier
-			NULL,//m_dependencies.toLocal8Bit().constData(), // dependencies
-			NULL,			// LocalSystem account
-			NULL );			// no password
-	if( hservice == NULL)
-	{
-		DWORD error = GetLastError();
-		if( error == ERROR_SERVICE_EXISTS && !m_quiet )
-		{
-			QMessageBox::warning( NULL, m_displayName,
-				QApplication::tr( "The service '%1' is already " "registered." ).
-					arg( m_displayName ) );
-		}
-		else
-		{
-			QMessageBox::critical( NULL, m_displayName,
-				QApplication::tr( "The service '%1' could not be registered." ).
-					arg( m_displayName ) );
-		}
-		CloseServiceHandle( hsrvmanager );
-		return false;
-	}
-
-	SC_ACTION service_actions;
-	service_actions.Delay = 10000;
-	service_actions.Type = SC_ACTION_RESTART;
-
-
-	SERVICE_FAILURE_ACTIONS service_failure_actions;
-	service_failure_actions.dwResetPeriod = 0;
-	service_failure_actions.lpRebootMsg = NULL;
-	service_failure_actions.lpCommand = NULL;
-	service_failure_actions.lpsaActions = &service_actions;
-	service_failure_actions.cActions = 1;
-	ChangeServiceConfig2( hservice, SERVICE_CONFIG_FAILURE_ACTIONS,
-						&service_failure_actions );
-/*	QProcess::execute(
-		QString( "sc failure %1 reset= 0 actions= restart/1000"
-							).arg( m_name ) );*/
-
-	CloseServiceHandle( hservice );
-	CloseServiceHandle( hsrvmanager );
-	// Everything went fine
-	if( !m_quiet )
-	{
-		QMessageBox::information( NULL, m_displayName,
-			QApplication::tr( "The service '%1' was successfully registered." ).
-														arg( m_displayName ) );
-	}
-
-	return true;
-}
-
-
-
-
-bool WindowsService::remove()
-{
-	// Open the SCM
-	SC_HANDLE hsrvmanager = OpenSCManager(
-					NULL,	// machine (NULL == local)
-					NULL,	// database (NULL == default)
-				SC_MANAGER_ALL_ACCESS	// access required
-							);
-	bool suc = true;
-
-	if( hsrvmanager )
-	{
-		SC_HANDLE hservice = OpenService( hsrvmanager,
-						m_name.toLocal8Bit().constData(),
-							SERVICE_ALL_ACCESS );
-
-		if( hservice != NULL )
-		{
-			SERVICE_STATUS status;
-
-			// Try to stop the service
-			if( ControlService( hservice, SERVICE_CONTROL_STOP, &status ) )
-			{
-				while( QueryServiceStatus( hservice, &status ) )
-				{
-					if( status.dwCurrentState == SERVICE_STOP_PENDING )
-					{
-						Sleep( 1000 );
-					}
-					else
-					{
-						break;
-					}
-				}
-
-				if( status.dwCurrentState != SERVICE_STOPPED )
-				{
-					QMessageBox::critical( NULL, m_displayName,
-						QApplication::tr( "The service '%1' could not be "
-											"stopped." ).arg( m_displayName ) );
-					suc = false;
-				}
-			}
-
-			// Now remove the service from the SCM
-			if( suc && DeleteService( hservice ) )
-			{
-				if( !m_quiet )
-				{
-					QMessageBox::information( NULL, m_displayName,
-						QApplication::tr( "The service '%1' has been "
-											"unregistered." ).arg( m_displayName ) );
-				}
-			}
-			else
-			{
-				DWORD error = GetLastError();
-				if( error == ERROR_SERVICE_MARKED_FOR_DELETE )
-				{
-					if( !m_quiet )
-					{
-						QMessageBox::critical( NULL, m_displayName,
-							QApplication::tr( "The service '%1' isn't "
-												"registered and therefore "
-												"can't be unregistered." ).
-								arg( m_displayName ) );
-					}
-				}
-				else
-				{
-						QMessageBox::critical( NULL, m_displayName,
-							QApplication::tr( "The service '%1' could not be "
-												"unregistered." ).
-								arg( m_displayName ) );
-				}
-				suc = false;
-			}
-			CloseServiceHandle( hservice );
-		}
-		else
-		{
-			QMessageBox::critical( NULL, m_displayName,
-				QApplication::tr( "The service '%1' could not be found." ).
-					arg( m_displayName ) );
-			suc = false;
-		}
-		CloseServiceHandle( hsrvmanager );
-	}
-	else
-	{
-		QMessageBox::critical( NULL, m_displayName,
-			QApplication::tr( "The Service Control Manager could not be "
-								"contacted (do you have the neccessary "
-								"rights?!) - the service '%1' was not "
-								"unregistered." ).arg( m_displayName ) );
-		suc = false;
-	}
-	return suc;
-}
-
-
-
-bool WindowsService::start()
-{
-	return QProcess::execute( QString( "net start %1" ).arg( m_name ) ) == 0;
-
-/*	// Open the SCM
-	SC_HANDLE hsrvmanager = OpenSCManager(
-					NULL,	// machine (NULL == local)
-					NULL,	// database (NULL == default)
-				SC_MANAGER_ALL_ACCESS	// access required
-							);
-	if( hsrvmanager )
-	{
-		SC_HANDLE hservice = OpenService( hsrvmanager,
-						m_name.toUtf8().constData(),
-							SERVICE_ALL_ACCESS );
-
-		if( hservice != NULL )
-		{
-			SERVICE_STATUS status;
-			status.dwCurrentState = SERVICE_START_PENDING;
-			if( StartService( hservice, 0, NULL ) )
-			{
-				while( QueryServiceStatus( hservice, &status ) )
-				{
-					if( status.dwCurrentState ==
-							SERVICE_START_PENDING )
-					{
-						Sleep( 1000 );
-					}
-					else
-					{
-						break;
-					}
-				}
-			}
-			CloseServiceHandle( hservice );
-			CloseServiceHandle( hsrvmanager );
-			if( status.dwCurrentState != SERVICE_RUNNING )
-			{
-	QMessageBox::critical( NULL, m_displayName,
-		QApplication::tr( "The service '%1' could not be started." ).
-							arg( m_displayName ) );
-				return false;
-			}
-		}
-		else
-		{
-			QMessageBox::critical( NULL, m_displayName,
-		QApplication::tr( "The service '%1' could not be found." ).
-							arg( m_displayName ) );
-			CloseServiceHandle( hsrvmanager );
-			return false;
-		}
-	}
-	else
-	{
-		QMessageBox::critical( NULL, m_displayName,
-			QApplication::tr( "The Service Control Manager could "
-						"not be contacted (do you have "
-						"the neccessary rights?!) - "
-						"the service '%1' was not "
-						"started." ).
-							arg( m_displayName )  );
-		return false;
-	}*/
-	return true;
-}
-
-
-
-
-bool WindowsService::stop()
-{
-	// Open the SCM
-	SC_HANDLE hsrvmanager = OpenSCManager(
-					NULL,	// machine (NULL == local)
-					NULL,	// database (NULL == default)
-				SC_MANAGER_ALL_ACCESS	// access required
-							);
-	if( hsrvmanager )
-	{
-		SC_HANDLE hservice = OpenService( hsrvmanager,
-					m_name.toLocal8Bit().constData(),
-							SERVICE_ALL_ACCESS );
-
-		if( hservice != NULL )
-		{
-			SERVICE_STATUS status;
-
-			// Try to stop the service
-			if( ControlService( hservice, SERVICE_CONTROL_STOP,
-								&status ) )
-			{
-				while( QueryServiceStatus( hservice, &status ) )
-				{
-					if( status.dwCurrentState == SERVICE_STOP_PENDING )
-					{
-						Sleep( 1000 );
-					}
-					else
-					{
-						break;
-					}
-				}
-
-				if( status.dwCurrentState != SERVICE_STOPPED )
-				{
-	QMessageBox::critical( NULL, m_displayName,
-		QApplication::tr( "The service '%1' could not be stopped." ).
-						arg( m_displayName ) );
-					CloseServiceHandle( hservice );
-					CloseServiceHandle( hsrvmanager );
-					return false;
-				}
-			}
-			CloseServiceHandle( hservice );
-		}
-		else
-		{
-			QMessageBox::critical( NULL, m_displayName,
-				QApplication::tr( "The service '%1' could not be found." ).
-						arg( m_displayName ) );
-			CloseServiceHandle( hsrvmanager );
-			return false;
-		}
-		CloseServiceHandle( hsrvmanager );
-	}
-	else
-	{
-		QMessageBox::critical( NULL, m_displayName,
-			QApplication::tr( "The Service Control Manager could "
-						"not be contacted (do you have "
-						"the neccessary rights?!) - "
-						"the service '%1' was not "
-						"stopped." ).
-							arg( m_displayName ) );
-		return false;
-	}
-	return true;
-}
-
-
-
-
-bool WindowsService::runAsService()
-{
-	if( m_running )
-	{
-		return false;
-	}
-	m_running = true;
-
-	// Create a service entry table
-	SERVICE_TABLE_ENTRY dispatchTable[] =
-	{
-		{ m_name.toLocal8Bit().data(), (LPSERVICE_MAIN_FUNCTION) serviceMain },
-		{ NULL, NULL }
-	} ;
-
-	s_this = this;
-
-	// call the service control dispatcher with our entry table
-	if( !StartServiceCtrlDispatcher( dispatchTable ) )
-	{
-		qCritical( "WindowsService::runAsService(): "
-					"StartServiceCtrlDispatcher failed." );
-		return false;
-	}
-
-	return true;
-}
-
-
-
-
-void WINAPI WindowsService::serviceMain( DWORD argc, char **argv )
-{
-	DWORD context = 1;
-	// register the service control handler
-	s_statusHandle = RegisterServiceCtrlHandlerEx(
-					s_this->m_name.toLocal8Bit().constData(),
-								serviceCtrl, &context );
-
-	if( s_statusHandle == 0 )
-	{
-		return;
-	}
-
-	// Set up some standard service state values
-	s_status.dwServiceType = SERVICE_WIN32 | SERVICE_INTERACTIVE_PROCESS;
-	s_status.dwServiceSpecificExitCode = 0;
-
-	// Give this status to the SCM
-	if( !reportStatus(
-			SERVICE_START_PENDING,	// Service state
-			NO_ERROR,		// Exit code type
-			15000 ) )		// Hint as to how long WinVNC
-						// should have hung before you
-						// assume error
-	{
-		reportStatus( SERVICE_STOPPED, 0, 0 );
-		return;
-	}
-
-	s_stopServiceEvent = CreateEvent( 0, FALSE, FALSE, 0 );
-
-	// report the status to the service control manager.
-	if( !reportStatus( SERVICE_RUNNING, NO_ERROR, 0 ) )
-	{
-		return;
-	}
-
-	monitorSessions();
-
-	CloseHandle( s_stopServiceEvent );
-
-	// Tell the service manager that we've stopped.
-	reportStatus( SERVICE_STOPPED, 0, 0 );
-}
-
-
-
-
-// Service control routine
-DWORD WINAPI WindowsService::serviceCtrl( DWORD _ctrlcode, DWORD dwEventType,
-							LPVOID lpEventData,
-							LPVOID lpContext )
-{
-	// What control code have we been sent?
-	switch( _ctrlcode )
-	{
-		case SERVICE_CONTROL_SHUTDOWN:
-		case SERVICE_CONTROL_STOP:
-			// STOP : The service must stop
-			s_status.dwCurrentState = SERVICE_STOP_PENDING;
-			SetEvent( s_stopServiceEvent );
-			break;
-
-		case SERVICE_CONTROL_INTERROGATE:
-			// Service control manager just wants to know our state
-			break;
-
-		case SERVICE_CONTROL_SESSIONCHANGE:
-			switch( dwEventType )
-			{
-				case WTS_SESSION_LOGOFF:
-					ilog( Info, "Session change event: WTS_SESSION_LOGOFF" );
-					s_sessionChangeEvent = 1;
-					break;
-				case WTS_SESSION_LOGON:
-					ilog( Info, "Session change event: WTS_SESSION_LOGON" );
-					//s_sessionChangeEvent = 1;	// no need to restart server upon logon
-					break;
-			}
-			break;
-
-		default:
-			// Control code not recognised
-			break;
-	}
-
-	// Tell the control manager what we're up to.
-	reportStatus( s_status.dwCurrentState, NO_ERROR, 0 );
-
-	return NO_ERROR;
-}
-
-
-
-// Service manager status reporting
-bool WindowsService::reportStatus( DWORD state, DWORD exitCode, DWORD waitHint )
-{
-	static DWORD checkpoint = 1;
-	bool result = true;
-
-	// If we're in the start state then we don't want the control manager
-	// sending us control messages because they'll confuse us.
-	if( state == SERVICE_START_PENDING )
-	{
-		s_status.dwControlsAccepted = 0;
-	}
-	else
-	{
-		s_status.dwControlsAccepted = SERVICE_ACCEPT_STOP |
-										SERVICE_ACCEPT_SHUTDOWN |
-										SERVICE_ACCEPT_SESSIONCHANGE;
-	}
-
-	// Save the new status we've been given
-	s_status.dwCurrentState = state;
-	s_status.dwWin32ExitCode = exitCode;
-	s_status.dwWaitHint = waitHint;
-
-	// Update the checkpoint variable to let the SCM know that we
-	// haven't died if requests take a long time
-	if( ( state == SERVICE_RUNNING ) || ( state == SERVICE_STOPPED ) )
-	{
-		s_status.dwCheckPoint = 0;
-	}
-	else
-	{
-		s_status.dwCheckPoint = checkpoint++;
-	}
-
-	ilogf( Debug, "Reporting service status: %d", state );
-
-	// Tell the SCM our new status
-	if( !( result = SetServiceStatus( s_statusHandle, &s_status ) ) )
-	{
-		qCritical( "WindowsService::reportStatus(...): "
-						"SetServiceStatus failed." );
-	}
-
-	return result;
-}
-
-
-
-
-void WindowsService::monitorSessions()
-{
-	ItalcServiceSubProcess italcProcess;
-
-	HANDLE hShutdownEvent = CreateEvent( NULL, FALSE, FALSE,
-									"Global\\SessionEventUltra" );
-	ResetEvent( hShutdownEvent );
-
-	const DWORD SESSION_INVALID = 0xFFFFFFFF;
-	DWORD oldSessionId = SESSION_INVALID;
-
-	QTime lastServiceStart;
-
-	while( WaitForSingleObject( s_stopServiceEvent, 1000 ) == WAIT_TIMEOUT )
-	{
-		bool sessionChanged = s_sessionChangeEvent.testAndSetOrdered( 1, 0 );
-		// ignore session change events on Windows Vista and Windows 7 as
-		// monitoring session IDs is reliable enough there and prevents us
-		// from uneccessary server restarts
-		if( sessionChanged &&
-			( QSysInfo::windowsVersion() == QSysInfo::WV_VISTA ||
-				QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7 ) )
-		{
-			ilog( Info, "Ignoring session change event as the operating system "
-						"is recent enough" );
-			sessionChanged = false;
-		}
-
-		const DWORD sessionId = WTSGetActiveConsoleSessionId();
-		if( oldSessionId != sessionId || sessionChanged )
-		{
-			ilogf( Info, "Session ID changed from %d to %d",
-									oldSessionId, sessionId );
-			// some logic for not reacting to desktop changes when the screen
-			// locker got active - we also don't update oldSessionId so when
-			// switching back to the original desktop, the above condition
-			// should not be met and nothing should happen
-			if( LocalSystem::Desktop::screenLockDesktop().isActive() )
-			{
-				ilog( Debug, "ScreenLockDesktop is active - ignoring" );
-				continue;
-			}
-
-			if( oldSessionId != SESSION_INVALID || sessionChanged )
-			{
-				// workaround for situations where service is stopped
-				// while it is still starting up
-				do
-				{
-					SetEvent( hShutdownEvent );
-				}
-				while( lastServiceStart.elapsed() < 10000 && italcProcess.isRunning() );
-
-				italcProcess.stop();
-
-				Sleep( 5000 );
-			}
-			if( sessionId != SESSION_INVALID || sessionChanged )
-			{
-				italcProcess.start( sessionId );
-				lastServiceStart.restart();
-			}
-
-			oldSessionId = sessionId;
-		}
-		else if( italcProcess.isRunning() == false )
-		{
-			italcProcess.start( sessionId );
-			oldSessionId = sessionId;
-			lastServiceStart.restart();
-		}
-	}
-
-	ilog( Info, "Service shutdown" );
-
-	SetEvent( hShutdownEvent );
-	italcProcess.stop();
-
-	CloseHandle( hShutdownEvent );
-}
-
-
-#endif
-
diff --git a/ica/src/WindowsService.h b/ica/src/WindowsService.h
deleted file mode 100644
index 63f66dd..0000000
--- a/ica/src/WindowsService.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * WindowsService.h - convenient class for using app as Windows service
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef WINDOWS_SERVICE_H
-#define WINDOWS_SERVICE_H
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-#include <wtsapi32.h>
-
-#include <QtCore/QAtomicInt>
-#include <QtCore/QString>
-
-typedef BOOL(WINAPI *PFN_WTSQuerySessionInformation)( HANDLE, DWORD,
-					WTS_INFO_CLASS, LPTSTR*, DWORD* );
-extern PFN_WTSQuerySessionInformation pfnWTSQuerySessionInformation;
-
-typedef void(WINAPI *PFN_WTSFreeMemory)( PVOID );
-extern PFN_WTSFreeMemory pfnWTSFreeMemory;
-
-
-class WindowsService
-{
-public:
-	WindowsService( const QString &serviceName,
-					const QString &serviceArg,
-					const QString &displayName,
-					const QString &serviceDependencies,
-					int argc,
-					char **argv );
-
-	// install service - will start at next boot
-	bool install();
-
-	// unregister service
-	bool remove();
-
-	// re-install service
-	bool reinstall()
-	{
-		return remove() && install();
-	}
-
-	// try to start service
-	bool start();
-
-	// try to stop service
-	bool stop();
-
-	// re-start service
-	bool restart()
-	{
-		return stop() && start();
-	}
-
-	bool runAsService();
-
-	bool evalArgs( int &argc, char **argv );
-
-	inline int & argc()
-	{
-		return m_argc;
-	}
-
-	inline char **argv()
-	{
-		return m_argv;
-	}
-
-
-private:
-	const QString m_name;
-	const QString m_arg;
-	const QString m_displayName;
-	const QString m_dependencies;
-	bool m_running;
-	bool m_quiet;
-
-	int m_argc;
-	char **m_argv;
-
-
-	static void WINAPI serviceMain( DWORD, char ** );
-	static DWORD WINAPI serviceCtrl( DWORD _ctrlcode, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext );
-	static bool reportStatus( DWORD state, DWORD exitCode, DWORD waitHint );
-
-	static void monitorSessions();
-
-	// we assume that a process won't contain more than one services
-	// therefore we can make these members static
-	static WindowsService *s_this;
-	static SERVICE_STATUS s_status;
-	static SERVICE_STATUS_HANDLE s_statusHandle;
-	static HANDLE s_stopServiceEvent;
-	static QAtomicInt s_sessionChangeEvent;
-
-} ;
-
-#endif
-
-#endif
-
diff --git a/ica/src/moc_AccessDialogSlave.cxx_parameters b/ica/src/moc_AccessDialogSlave.cxx_parameters
deleted file mode 100644
index ae59c61..0000000
--- a/ica/src/moc_AccessDialogSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_AccessDialogSlave.cxx
-/tmp/foo/ica/src/AccessDialogSlave.h
diff --git a/ica/src/moc_DemoClient.cxx_parameters b/ica/src/moc_DemoClient.cxx_parameters
deleted file mode 100644
index eedf96a..0000000
--- a/ica/src/moc_DemoClient.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_DemoClient.cxx
-/tmp/foo/ica/src/DemoClient.h
diff --git a/ica/src/moc_DemoClientSlave.cxx_parameters b/ica/src/moc_DemoClientSlave.cxx_parameters
deleted file mode 100644
index 9be940f..0000000
--- a/ica/src/moc_DemoClientSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_DemoClientSlave.cxx
-/tmp/foo/ica/src/DemoClientSlave.h
diff --git a/ica/src/moc_DemoServer.cxx_parameters b/ica/src/moc_DemoServer.cxx_parameters
deleted file mode 100644
index a0a1d51..0000000
--- a/ica/src/moc_DemoServer.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_DemoServer.cxx
-/tmp/foo/ica/src/DemoServer.h
diff --git a/ica/src/moc_DemoServerMaster.cxx_parameters b/ica/src/moc_DemoServerMaster.cxx_parameters
deleted file mode 100644
index 4f789eb..0000000
--- a/ica/src/moc_DemoServerMaster.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_DemoServerMaster.cxx
-/tmp/foo/ica/src/DemoServerMaster.h
diff --git a/ica/src/moc_DemoServerSlave.cxx_parameters b/ica/src/moc_DemoServerSlave.cxx_parameters
deleted file mode 100644
index edf79f0..0000000
--- a/ica/src/moc_DemoServerSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_DemoServerSlave.cxx
-/tmp/foo/ica/src/DemoServerSlave.h
diff --git a/ica/src/moc_DesktopAccessPermission.cxx_parameters b/ica/src/moc_DesktopAccessPermission.cxx_parameters
deleted file mode 100644
index c298c0a..0000000
--- a/ica/src/moc_DesktopAccessPermission.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_DesktopAccessPermission.cxx
-/tmp/foo/ica/src/DesktopAccessPermission.h
diff --git a/ica/src/moc_IcaSlave.cxx_parameters b/ica/src/moc_IcaSlave.cxx_parameters
deleted file mode 100644
index 9d04ad6..0000000
--- a/ica/src/moc_IcaSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_IcaSlave.cxx
-/tmp/foo/ica/src/IcaSlave.h
diff --git a/ica/src/moc_InputLockSlave.cxx_parameters b/ica/src/moc_InputLockSlave.cxx_parameters
deleted file mode 100644
index a57dc95..0000000
--- a/ica/src/moc_InputLockSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_InputLockSlave.cxx
-/tmp/foo/ica/src/InputLockSlave.h
diff --git a/ica/src/moc_ItalcCoreServer.cxx_parameters b/ica/src/moc_ItalcCoreServer.cxx_parameters
deleted file mode 100644
index 0035a0c..0000000
--- a/ica/src/moc_ItalcCoreServer.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_ItalcCoreServer.cxx
-/tmp/foo/ica/src/ItalcCoreServer.h
diff --git a/ica/src/moc_ItalcSlaveManager.cxx_parameters b/ica/src/moc_ItalcSlaveManager.cxx_parameters
deleted file mode 100644
index 7e04cbc..0000000
--- a/ica/src/moc_ItalcSlaveManager.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_ItalcSlaveManager.cxx
-/tmp/foo/ica/src/ItalcSlaveManager.h
diff --git a/ica/src/moc_ItalcVncServer.cxx_parameters b/ica/src/moc_ItalcVncServer.cxx_parameters
deleted file mode 100644
index 904b650..0000000
--- a/ica/src/moc_ItalcVncServer.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_ItalcVncServer.cxx
-/tmp/foo/ica/src/ItalcVncServer.h
diff --git a/ica/src/moc_MessageBoxSlave.cxx_parameters b/ica/src/moc_MessageBoxSlave.cxx_parameters
deleted file mode 100644
index 2dbcf92..0000000
--- a/ica/src/moc_MessageBoxSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_MessageBoxSlave.cxx
-/tmp/foo/ica/src/MessageBoxSlave.h
diff --git a/ica/src/moc_RfbItalcCursor.cxx_parameters b/ica/src/moc_RfbItalcCursor.cxx_parameters
deleted file mode 100644
index be06a91..0000000
--- a/ica/src/moc_RfbItalcCursor.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_RfbItalcCursor.cxx
-/tmp/foo/ica/src/RfbItalcCursor.h
diff --git a/ica/src/moc_RfbLZORLE.cxx_parameters b/ica/src/moc_RfbLZORLE.cxx_parameters
deleted file mode 100644
index 87f2417..0000000
--- a/ica/src/moc_RfbLZORLE.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_RfbLZORLE.cxx
-/tmp/foo/ica/src/RfbLZORLE.h
diff --git a/ica/src/moc_ScreenLockSlave.cxx_parameters b/ica/src/moc_ScreenLockSlave.cxx_parameters
deleted file mode 100644
index e8c9a7a..0000000
--- a/ica/src/moc_ScreenLockSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_ScreenLockSlave.cxx
-/tmp/foo/ica/src/ScreenLockSlave.h
diff --git a/ica/src/moc_ScreenLockSlaveLauncher.cxx_parameters b/ica/src/moc_ScreenLockSlaveLauncher.cxx_parameters
deleted file mode 100644
index b07506a..0000000
--- a/ica/src/moc_ScreenLockSlaveLauncher.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_ScreenLockSlaveLauncher.cxx
-/tmp/foo/ica/src/ScreenLockSlaveLauncher.h
diff --git a/ica/src/moc_SystemTrayIconSlave.cxx_parameters b/ica/src/moc_SystemTrayIconSlave.cxx_parameters
deleted file mode 100644
index 420c98c..0000000
--- a/ica/src/moc_SystemTrayIconSlave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_SystemTrayIconSlave.cxx
-/tmp/foo/ica/src/SystemTrayIconSlave.h
diff --git a/ica/src/moc_WindowsService.cxx_parameters b/ica/src/moc_WindowsService.cxx_parameters
deleted file mode 100644
index a1e55e7..0000000
--- a/ica/src/moc_WindowsService.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ica/src/moc_WindowsService.cxx
-/tmp/foo/ica/src/WindowsService.h
diff --git a/ica/x11/AUTHORS b/ica/x11/AUTHORS
deleted file mode 100644
index 4fa0630..0000000
--- a/ica/x11/AUTHORS
+++ /dev/null
@@ -1,43 +0,0 @@
-*  LibVNCServer (C) 2001 Johannes E. Schindelin <Johannes.Schindelin at gmx.de>
-is based on
-*  Original OSXvnc (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>,
-which in turn is based on
-*  Original Xvnc (C) 1999 AT&T Laboratories Cambridge.
-
-Lots of improvements of this library are thanks to
-* TightVNC (C) 2000-2003 Const Kaplinsky
-
-The ZRLE compression scheme is from
-* RealVNC (James "Wez" Weatherall, who helped also with regions)
-
-The good folks from
-* KRFB (I think it was Tim Jansen)
-helped also a lot (some *big* bugs!).
-
-Karl Runge provides an x11vnc, which is a much, much improved version of my
-original proof-of-concept. It really deserves to replace the old version,
-as it is a state-of-the-art, fast and usable program by now! However, he
-maintains it and improves it still in amazing ways!
-
-The file transfer protocol from TightVNC was implemented by Rohit Kumar.
-This includes an implementation of RFB protocol version 3.7t.
-
-Occasional important patches were sent by (in order I found the names in my
-archives and please don't beat me, if I forgot you, but just send me an
-email!): Akira Hatakeyama, Karl J. Runge, Justin "Zippy" Dearing,
-Oliver Mihatsch, Greg Sternberg, Werner Hofer, Giampiero Giancipoli,
-Glenn Mabutt, Paul Kreiner, Erik Kunze, Mike Frysinger, Martin Waitz,
-Mark McLoughlin, Paul Fox, Juan Jose Costello, Andre Leiadella,
-Alberto Lusiani, Malvina Mazin, Dave Stuart, Rohit Kumar, Donald Dugger,
-Steven Carr, Uwe Völker, Charles Coffing, Guillaume Rousse,
-Alessandro Praduroux, Brad Hards, Timo Ketola, Christian Ehrlicher,
-Noriaki Yamazaki, Ben Klopfenstein, Vic Lee, Christian Beier,
-Alexander Dorokhine, Corentin Chary, Wouter Van Meir, George Kiagiadakis,
-Joel Martin, Gernot Tenchio, William Roberts, Cristian Rodríguez,
-George Fleury, Kan-Ru Chen, Steve Guo, Luca Stauble, Peter Watkins,
-Kyle J. McKay, Mateus Cesar Groess, Philip Van Hoof, D. R. Commander,
-Rostislav Lisovy, Oliver Loch and Raphael Kubo da Costa.
-
-Probably I forgot quite a few people sending a patch here and there, which
-really made a difference. Without those, some obscure bugs still would
-be unfound.
diff --git a/ica/x11/ChangeLog b/ica/x11/ChangeLog
deleted file mode 100644
index 13cde9f..0000000
--- a/ica/x11/ChangeLog
+++ /dev/null
@@ -1,7760 +0,0 @@
-2012-05-04  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: Enable building DLLs with MinGW32.
-
-2012-05-04  Christian Beier <dontmind at freeshell.org>
-
-	* NEWS: Update NEWS for 0.9.9.
-
-2012-05-03  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c: LibVNCClient: #undef these types in case
-	it's WIN32.  The various other headers include windows.h and the winsock headers
-	which give an error when SOCKET and socklen_t are already defined.
-
-2012-05-03  Christian Beier <dontmind at freeshell.org>
-
-	* rfb/rfb.h: LibVNCServer: Include ws2tcpip.h if it's available.  Needed for the IPv6 stuff.
-
-2012-04-30  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/Makefile.am: LibVNCServer: Prefer GnuTLS over OpenSSL
-	to be in sync with LibVNCClient.
-
-2012-04-30  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbserver.c: Some more libjpeg, libpng and zlib
-	related build fixes.
-
-2012-04-30  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: Make PKG_CHECK_MODULES fail non-fatal.  These check for optional modules.
-
-2012-04-30  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbserver.c, rfb/rfb.h: Only try to build TightPNG
-	stuff when libjpeg is available.  TightPNG replaces the ZLIB stuff int Tight encoding with PNG. It
-	still uses JPEG rects as well. Theoretically, we could build
-	TightPNG with only libpng and libjpeg - without zlib - but libpng
-	depends on zlib, so this is kinda moot.
-
-2012-04-27  Christian Beier <dontmind at freeshell.org>
-
-	* test/Makefile.am: Only build libjpeg test programs if libjpeg is
-	actually available.
-
-2012-04-26  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt: Fix CMake build of LibVNCClient.
-
-2012-04-26  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbserver.c: Properly check return value.  This also fixes a compiler warning.
-
-2012-04-26  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: Fix build when no libjpeg is available.
-
-2012-04-26  Christian Beier <dontmind at freeshell.org>
-
-	* examples/android/Makefile.am, libvncserver/Makefile.am: Include
-	some more missing files for make dist.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/Makefile.am: Include missing files for make dist.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/Makefile.am: Fix libvncclient make dist.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: Better check for Linux build.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* vncterm/Makefile.am: Binaries that are to be installed should be
-	all lowercase.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt, configure.ac: Bump version to 0.9.9.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* common/turbojpeg.c, libvncserver/rfbserver.c,
-	libvncserver/websockets.c, test/tjbench.c: Fix some compiler
-	warnings thrown with newer gcc.
-
-2012-04-25  Christian Beier <dontmind at freeshell.org>
-
-	* test/Makefile.am: Fix turbojpeg tests compilation.
-
-2012-04-25  DRC <information at virtualgl.org>
-
-	* common/turbojpeg.c: Fix compilation with some libjpeg
-	distributions.
-
-2012-04-22  Monkey <chris.boyle.1978 at gmail.com>
-
-	* libvncclient/rfbproto.c: Added support for UltraVNC Single Click
-	as originally proposed by Noobius (Boobius) on 6/1/11.  Original thread:
-
-	http://sourceforge.net/tracker/?func=detail&aid=3310255&group_id=32584&atid=405860
-
-2012-04-15  Christian Beier <dontmind at freeshell.org>
-
-	* AUTHORS: Add Philip to AUTHORS.
-
-2012-04-15  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/tls_none.c: LibVNCClient: Fix build with no SSL/TLS
-	library available.
-
-2012-04-15  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/tls_openssl.c: LibVNCClient: properly free the
-	openssl session stuff on shutdown.
-
-2012-04-15  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c, libvncclient/sockets.c,
-	libvncclient/tls_gnutls.c, libvncclient/vncviewer.c,
-	rfb/rfbclient.h: LibVNCClient: Remove all those WITH_CLIENT_TLS
-	#ifdefs and move GnuTLS specific functionality into tls_gnutls.c.
-
-2012-04-14  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: Unify GnuTLS vs OpenSSL build systems stuff between
-	libvncclient and libvncserver.
-
-2012-04-14  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/Makefile.am, libvncclient/tls.c,
-	libvncclient/tls_gnutls.c, libvncclient/tls_none.c,
-	libvncclient/tls_openssl.c: Add the OpenSSL libvncclient TLS version
-	to the build system.
-
-2012-04-12  Christian Beier <dontmind at freeshell.org>
-
-	* webclients/novnc/LICENSE.txt, webclients/novnc/README.md,
-	webclients/novnc/include/base.css,
-	webclients/novnc/include/base64.js,
-	webclients/novnc/include/display.js,
-	webclients/novnc/include/input.js,
-	webclients/novnc/include/jsunzip.js,
-	webclients/novnc/include/rfb.js, webclients/novnc/include/ui.js,
-	webclients/novnc/include/util.js, webclients/novnc/include/vnc.js,
-	webclients/novnc/include/websock.js,
-	webclients/novnc/include/webutil.js, webclients/novnc/vnc.html,
-	webclients/novnc/vnc_auto.html: Update our copy of noVNC.  Bugfixes and support for tight encoding with zlib.
-
-2012-04-12  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/tight.c: Make TurboVNC compress level 3 actually
-	work.
-
-2012-04-09  DRC <information at virtualgl.org>
-
-	* common/turbojpeg.c: Fix memory leak in TurboVNC Note that the memory leak was only occurring with the colorspace
-	emulation code, which is only active when using regular libjpeg (not
-	libjpeg-turbo.) Diagnosed by Christian Beier, using valgrind.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2012-04-02  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/listen.c, libvncclient/sockets.c,
-	libvncserver/httpd.c, libvncserver/sockets.c: IPv6 support for
-	LibVNCServer, part four: add copyright notices to files with
-	non-trivial changes.
-
-2012-03-29  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: map Apple/Windows
-	keys correctly Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2012-03-29  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* .gitignore: gitignore the compiled gtkvncclient Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2012-03-29  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: fix the SDL_KEYUP
-	issue Keys got stuck because unicode is 0 upon SDL_KEYUP events, even if
-	the same key event sets unicode correctly in SDL_KEYDOWN events.  Work around that for the common case (ASCII) using the fact that
-	both SDL and X11 keysyms were created with ASCII compatibility in
-	mind. So as long as we type ASCII symbols, we can map things
-	trivially.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2012-03-23  DRC <information at virtualgl.org>
-
-	* CMakeLists.txt: Extend support for the new TurboVNC encoder to the
-	CMake build system
-
-2012-03-25  DRC <information at virtualgl.org>
-
-	* common/turbojpeg.c, common/turbojpeg.h, configure.ac,
-	libvncserver/Makefile.am, libvncserver/rfbserver.c,
-	libvncserver/tight.c, libvncserver/turbo.c, rfb/rfb.h,
-	rfb/rfbproto.h, test/Makefile.am, test/bmp.c, test/bmp.h,
-	test/tjbench.c, test/tjunittest.c, test/tjutil.c, test/tjutil.h: 
-	Replace TightVNC encoder with TurboVNC encoder. This patch is the
-	result of further research and discussion that revealed the
-	following: -- TightPng encoding and the rfbTightNoZlib extension need not
-	   conflict.  Since TightPng is a separate encoding type, not supported
-	   by TurboVNC-compatible viewers, then the rfbTightNoZlib extension
-	   can be used solely whenever the encoding type is Tight and disabled
-	with the encoding type is TightPng.  -- In the TightVNC encoder, compression levels above 5 are basically
-	   useless.  On the set of 20 low-level datasets that were used to
-	   design the TurboVNC encoder (these include the eight 2D application
-	   captures that were also used when designing the TightVNC encoder, as
-	   well as 12 3D application captures provided by the VirtualGL
-	   Project-- see
-	   http://www.virtualgl.org/pmwiki/uploads/About/tighttoturbo.pdf),
-	   moving from Compression Level (CL) 5 to CL 9 in the TightVNC
-	   encoder did not increase the compression ratio of any datasets more
-	   than 10%, and the compression ratio only increased by more than 5%
-	   on four of them.  The compression ratio actually decreased a few
-	   percent on five of them.  In exchange for this paltry increase in
-	   compression ratio, the CPU usage, on average, went up by a factor of
-	   5.  Thus, for all intents and purposes, TightVNC CL 5 provides the
-	"best useful compression" for that encoder.  -- TurboVNC's best compression level (CL 2) compresses 3D and video
-	   workloads significantly more "tightly" than TightVNC CL 5 (~70%
-	   better, in the aggregate) but does not quite achieve the same level
-	   of compression with 2D workloads (~20% worse, in the aggregate.)
-	   This decrease in compression ratio may or may not be noticeable,
-	   since many of the datasets it affects are not performance-critical
-	   (such as the console output of a compilation, etc.) However, for
-	   peace of mind, it was still desirable to have a mode that compressed
-	   with equal "tightness" to TightVNC CL 5, since we proposed to
-	replace that encoder entirely.  -- A new mode was discovered in the TurboVNC encoder that produces,
-	   in the aggregate, similar compression ratios on 2D datasets as
-	   TightVNC CL 5.  That new mode involves using Zlib level 7 (the same
-	   level used by TightVNC CL 5) but setting the "palette threshold" to
-	   256, so that indexed color encoding is used whenever possible.  This
-	   mode reduces bandwidth only marginally (typically 10-20%) relative
-	   to TurboVNC CL 2 on low-color workloads, in exchange for nearly
-	   doubling CPU usage, and it does not benefit high-color workloads at
-	   all (since those are usually encoded with JPEG.)  However, it
-	provides a means of reproducing the same "tightness" as the TightVNC    encoder on 2D workloads without sacrificing any compression for
-	   3D/video workloads, and without using any more CPU time than
-	necessary.  -- The TurboVNC encoder still performs as well or better than the
-	   TightVNC encoder when plain libjpeg is used instead of
-	libjpeg-turbo.  Specific notes follow: common/turbojpeg.c common/turbojpeg.h: Added code to emulate the
-	libjpeg-turbo colorspace extensions, so that the TurboJPEG wrapper
-	can be used with plain libjpeg as well.  This required updating the
-	TurboJPEG wrapper to the latest code from libjpeg-turbo 1.2.0,
-	mainly because the TurboJPEG 1.2 API handles pixel formats in a much
-	cleaner way, which made the conversion code easier to write.  It
-	also eases the maintenance to have the wrapper synced as much as
-	possible with the upstream code base (so I can merge any relevant
-	bug fixes that are discovered upstream.) The libvncserver version of
-	the TurboJPEG wrapper is a "lite" version, containing only the JPEG
-	compression/decompression code and not the lossless transform, YUV
-	encoding/decoding, and dynamic buffer allocation features from
-	TurboJPEG 1.2.  configure.ac: Removed the --with-turbovnc option.  configure still
-	checks for the presence of libjpeg-turbo, but only for the purposes
-	of printing a performance warning if it isn't available.  rfb/rfb.h: Fix a bug introduced with the initial TurboVNC encoder
-	patch.  We cannot use tightQualityLevel for the TurboVNC 1-100
-	quality level, because tightQualityLevel is also used by ZRLE.
-	Thus, a new parameter (turboQualityLevel) was created.  rfb/rfbproto.h: Remove TurboVNC-specific #ifdefs and language libvncserver/rfbserver.c: Remove TurboVNC-specific #ifdefs.  Fix
-	afore-mentioned tightQualityLevel bug.  libvncserver/tight.c: Replaced the TightVNC encoder with the
-	TurboVNC encoder.  Relative to the initial TurboVNC encoder patch,
-	this patch also: -- Adds TightPng support to the TurboVNC encoder --
-	   Adds the afore-mentioned low-bandwidth mode, which is mapped
-	   externally to Compression Level 9 test/*: Included TJUnitTest (a regression test for the TurboJPEG
-	wrapper) as well as TJBench (a benchmark for same.)  These are
-	useful for ensuring that the wrapper still functions correctly and
-	performantly if it needs to be modified for whatever reason.  Both
-	of these programs are derived from libjpeg-turbo 1.2.0.  As with the
-	TurboJPEG wrapper, they do not contain the more advanced features of
-	TurboJPEG 1.2, such as YUV encoding/decoding and lossless
-	transforms.
-
-2012-03-15  Christian Beier <dontmind at freeshell.org>
-
-	* AUTHORS: Add DRC to AUTHORS.
-
-2012-03-15  Christian Beier <dontmind at freeshell.org>
-
-	* rfb/rfb.h: Move tightsubsamplevel member to the end of rfbClient
-	struct.  Try to not break ABI between releases. Even if the code gets ugly...
-
-2012-03-10  DRC <information at virtualgl.org>
-
-	* x11vnc/Makefile.am: Fix the build of x11vnc when an out-of-tree
-	build directory is used
-
-2012-03-10  DRC <information at virtualgl.org>
-
-	* libvncserver/rfbserver.c: Fix an issue that affects the existing
-	Tight encoder as well as the newly-implemented Turbo encoder.  The issue is that, when using the current libvncserver source, it is
-	impossible to disable Tight JPEG encoding.  The way Tight/Turbo
-	viewers disable JPEG encoding is by simply not sending the Tight
-	quality value, causing the server to use the default value of -1.
-	Thus, cl->tightQualityLevel has to be set to -1 prior to processing
-	the encodings message for this mechanism to work.  Similarly, it is
-	not guaranteed that the compress level will be set in the encodings
-	message, so it is set to a default value prior to processing the
-	message.
-
-2012-03-10  DRC <information at virtualgl.org>
-
-	* common/turbojpeg.c, common/turbojpeg.h, configure.ac,
-	libvncserver/Makefile.am, libvncserver/rfbserver.c,
-	libvncserver/turbo.c, rfb/rfb.h, rfb/rfbproto.h: Add TurboVNC
-	encoding support.  TurboVNC is a variant of TightVNC that uses the same client/server
-	protocol (RFB version 3.8t), and thus it is fully cross-compatible
-	with TightVNC and TigerVNC (with one exception, which is noted
-	below.) Both the TightVNC and TurboVNC encoders analyze each
-	rectangle, pick out regions of solid color to send separately, and
-	send the remaining subrectangles using mono, indexed color, JPEG, or
-	raw encoding, depending on the number of colors in the subrectangle.
-	However, TurboVNC uses a fundamentally different selection algorithm
-	to determine the appropriate subencoding to use for each
-	subrectangle.  Thus, while it sends a protocol stream that can be
-	decoded by any TightVNC-compatible viewer, the mix of subencoding
-	types in this protocol stream will be different from those generated
-	by a TightVNC server.  The research that led to TurboVNC is described in the following
-	report:
-	http://www.virtualgl.org/pmwiki/uploads/About/tighttoturbo.pdf.  In
-	summary:  20 RFB captures, representing "common" 2D and 3D
-	application workloads (the 3D workloads were run using VirtualGL),
-	were studied using the TightVNC encoder in isolation.  Some of the
-	analysis features in the TightVNC encoder, such as smoothness
-	detection, were found to generate a lot of CPU usage with little or
-	no benefit in compression, so those features were disabled.  JPEG
-	encoding was accelerated using libjpeg-turbo (which achieves a 2-4x
-	speedup over plain libjpeg on modern x86 or ARM processors.)
-	Finally, the "palette threshold" (minimum number of colors that the
-	subrectangle must have before it is compressed using JPEG or raw)
-	was adjusted to account for the fact that JPEG encoding is now quite
-	a bit faster (meaning that we can now use it more without a CPU
-	penalty.)  TurboVNC has additional optimizations, such as the
-	ability to count colors and encode JPEG images directly from the
-	framebuffer without first translating the pixels into RGB.  The
-	TurboVNC encoder compares quite favorably in terms of compression
-	ratio with TightVNC and generally encodes a great deal faster (often
-	an order of magnitude or more.) The version of the TurboVNC encoder included in this patch is
-	roughly equivalent to the one found in version 0.6 of the Unix
-	TurboVNC Server, with a few minor patches integrated from TurboVNC
-	1.1.  TurboVNC 1.0 added multi-threading capabilities, which can be
-	added in later if desired (at the expense of making libvncserver
-	depend on libpthread.) Because TurboVNC uses a fundamentally different mix of subencodings
-	than TightVNC, because it uses the identical protocol (and thus a
-	viewer really has no idea whether it's talking to a TightVNC or
-	TurboVNC server), and because it doesn't support rfbTightPng (and in
-	fact conflicts with it-- see below), the TurboVNC and TightVNC
-	encoders cannot be enabled simultaneously.  Compatibility: In *most* cases, a TurboVNC-enabled viewer is fully compatible with
-	a TightVNC server, and vice versa.  TurboVNC supports
-	pseudo-encodings for specifying a fine-grained (1-100) quality scale
-	and specifying chrominance subsampling.  If a TurboVNC viewer sends
-	those to a TightVNC server, then the TightVNC server ignores them,
-	so the TurboVNC viewer also sends the quality on a 0-9 scale that
-	the TightVNC server can understand.  Similarly, the TurboVNC server
-	checks first for fine-grained quality and subsampling
-	pseudo-encodings from the viewer, and failing to receive those, it
-	then checks for the TightVNC 0-9 quality pseudo-encoding.  There is one case in which the two systems are not compatible, and
-	that is when a TightVNC or TigerVNC viewer requests compression
-	level 0 without JPEG from a TurboVNC server.  For performance
-	reasons, this causes the TurboVNC server to send images directly to
-	the viewer, bypassing Zlib.  When the TurboVNC server does this, it
-	also sets bits 7-4 in the compression control byte to rfbTightNoZlib
-	(0x0A), which is unfortunately the same value as rfbTightPng.  Older
-	TightVNC viewers that don't handle PNG will assume that the stream
-	is uncompressed but still encapsulated in a Zlib structure, whereas
-	newer PNG-supporting TightVNC viewers will assume that the stream is
-	PNG.  In either case, the viewer will probably crash.  Since most
-	VNC viewers don't expose compression level 0 in the GUI, this is a
-	relatively rare situation.  Description of changes: configure.ac -- Added support for libjpeg-turbo.  If passed an
-	   argument of --with-turbovnc, configure will now run (or, if cross-compiling, just link) a test program that determines
-	   whether the libjpeg library being used is libjpeg-turbo.
-	   libjpeg-turbo must be used when building the TurboVNC encoder,
-	   because the TurboVNC encoder relies on the libjpeg-turbo
-	   colorspace extensions in order to compress images directly out of
-	   the framebuffer (which may be, for instance, BGRA rather than RGB.)
-	   libjpeg-turbo can optionally be used with the TightVNC encoder as
-	   well, but the speedup will only be marginal (the report linked above
-	    explains why in more detail, but basically it's because of Amdahl's
-	    Law.  The TightVNC encoder was designed with the assumption that
-	JPEG had a very high CPU cost, and thus JPEG is used only
-	sparingly.) -- Added a new configure variable, JPEG_LDFLAGS.  This
-	   is necessitated by the fact that libjpeg-turbo often distributes
-	   libjpeg.a and libjpeg.so in /opt/libjpeg-turbo/lib32 or
-	   /opt/libjpeg-turbo/lib64, and many people prefer to statically
-	   link with it.  Thus, more flexibility is needed than is provided by
-	   --with-jpeg.  If JPEG_LDFLAGS is specified, then it overrides the
-	   changes to LDFLAGS enacted by --with-jpeg (but --with-jpeg is
-	   still used to set the include path.)  The addition of JPEG_LDFLAGS
-	necessitated replacing AC_CHECK_LIB with AC_LINK_IFELSE (because
-	   AC_CHECK_LIB automatically sets LIBS to -ljpeg, which is not what we
-	want if we're, for instance, linking statically with libjpeg-turbo.)
-	-- configure does not check for PNG support if TurboVNC encoding is
-	   enabled.  This prevents the rfbSendRectEncodingTightPng() function
-	   from being compiled in, since the TurboVNC encoder doesn't (and
-	can't) support it.  common/turbojpeg.c, common/turbojpeg.h -- TurboJPEG is a simple API
-	   used to compress and decompress JPEG images in memory.  It was
-	   originally implemented because it was desirable to use different
-	   types of underlying technologies to compress JPEG on different
-	   platforms (mediaLib on SPARC, Quicktime on PPC Macs, Intel
-	   Performance Primitives, etc.) These days, however, libjpeg-turbo
-	   is the only underlying technology used by TurboVNC, so TurboJPEG's
-	purpose is largely just code simplicity and flexibility.  Thus,
-	   since there is no real need for libvncserver to use any technology
-	   other than libjpeg-turbo for compressing JPEG, the TurboJPEG wrapper
-	for libjpeg-turbo has been included in-tree so that libvncserver can
-	   be directly linked with libjpeg-turbo.  This is convenient because
-	   many modern Linux distros (Fedora, Ubuntu, etc.) now ship
-	   libjpeg-turbo as their default libjpeg library.  libvncserver/rfbserver.c -- Added logic to check for the TurboVNC
-	   fine-grained quality level and subsampling encodings and to map
-	   Tight (0-9) quality levels to appropriate fine-grained quality level
-	   and subsampling values if communicating with a TightVNC/TigerVNC
-	viewer.  libvncserver/turbo.c -- TurboVNC encoder (compiled instead of
-	libvncserver/tight.c) rfb/rfb.h -- Added support for the TurboVNC subsampling level rfb/rfbproto.h -- Added constants for the TurboVNC fine quality
-	   level and subsampling encodings as well as the rfbTightNoZlib
-	constant and notes on its usage.
-
-2012-03-10  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/SDLvncviewer.c, libvncclient/listen.c,
-	libvncclient/sockets.c, libvncclient/vncviewer.c,
-	libvncserver/sockets.c, rfb/rfbclient.h: IPv6 support for
-	LibVNCServer, part three: make reverse connections IPv6-capable.  Besided making libvncserver reverseVNC IPv6-aware, this introduces
-	some changes on the client side as well to make clients listen on
-	IPv6 sockets, too. Like the server side, this also uses a
-	separate-socket approach.
-
-2012-03-10  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/sockets.c: IPv6 support for LibVNCServer, part
-	onepointseven: Plug a memleak.  We have to properly free the addrinfo struct when jumping out of the
-	function.
-
-2012-03-09  Christian Beier <dontmind at freeshell.org>
-
-	* webclients/index.vnc: IPv6 support for LibVNCServer, part
-	twopointone: properly surround IPv6 addresses with [] for noVNC URL.  Some browsers omit the square brackets in
-	document.location.hostname, so add them if missing.
-
-2012-02-27  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/cargs.c, libvncserver/httpd.c, libvncserver/main.c,
-	rfb/rfb.h: IPv6 support for LibVNCServer, part two: Let the http
-	server listen on IPv6, too.  As done with the RFB sockets, this uses a separate-socket approach
-	as well.
-
-2012-02-27  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/main.c: IPv6 support for LibVNCServer, part
-	onepointsix: fix a small logic error.  Without this, we would have gotten a stale IPv4 socket in a race
-	condition.
-
-2012-02-27  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbserver.c, libvncserver/sockets.c: IPv6 support for
-	LibVNCServer, part onepointfive: Fix compilation with IPv6 missing.  There was an oversight that crept in...
-
-2012-02-20  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/cargs.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/sockets.c, rfb/rfb.h: IPv6
-	support for LibVNCServer, part one: accept IPv4 and IPv6
-	connections.  This uses a separate-socket approach since there are systems that do
-	not support dual binding sockets under *any* circumstances, for
-	instance OpenBSD. Using separate sockets for IPv4 and IPv6 is thus
-	more portable than having a v6 socket handle v4 connections as well.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2012-02-11  Mateus Cesar Groess <mateuscg at gmail.com>
-
-	* AUTHORS, client_examples/Makefile.am,
-	client_examples/gtkvncviewer.c, configure.ac: Here is a port of
-	SDLvncviewer to GTK+2.  I think it may encourage people to implement more features for the
-	viewer, because a GTK GUI seems to be easier to implement than a SDL
-	one (and it is more integrated with the major Linux Desktops out
-	there).  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2012-02-11  Christian Beier <dontmind at freeshell.org>
-
-	* AUTHORS: Update AUTHORS.
-
-2012-02-10  Kyle J. McKay <mackyle at gmail.com>
-
-	* libvncserver/auth.c, libvncserver/rfbserver.c, rfb/rfb.h: Support
-	Mac OS X vnc client with no password Support connections from the Mac OS X built-in VNC client to
-	LibVNCServers running with no password and advertising a server
-	version of 3.7 or greater.
-
-2012-02-04  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Add Luca to the AUTHORS Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2012-02-04  Luca Stauble <gnekoz at gmail.com>
-
-	* libvncclient/listen.c, libvncclient/sockets.c,
-	libvncclient/vncviewer.c, rfb/rfbclient.h: Add an optional parameter
-	to specify the ip address for reverse connections For security reasons, it can be important to limit which IP
-	addresses a LibVNCClient-based client should listen for reverse
-	connections. This commit adds that option.  To preserve binary backwards-compatibility, the field was added to
-	the end of the rfbclient struct, and the function ListenAtTcpPort
-	retains its signature (but calls the new ListenAtTcpPortAndAddress).  [jes: shortened the commit subject, added a longer explanation in
-	the commit body and adjusted style] Signed-off-by: Luca Stauble <gnekoz at gmail.com> Signed-off-by:
-	Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2012-01-12  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/websockets.c: websockets: removed debug message
-
-2012-01-12  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/websockets.c: websockets: restore errno after logging
-	an error
-
-2012-01-12  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* CMakeLists.txt: cmake: adapted to latest websocket crypto changes
-
-2011-12-15  Christian Beier <dontmind at freeshell.org>
-
-	* rfb/rfbclient.h: Small changes to LibNVCClient doxygen
-	documentation.
-
-2011-12-01  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/Makefile.am: Fix build error when libpng is
-	available, but libjpeg is not.  The png stuff in tight.c depends on code in tight.c that uses
-	libjpeg features. We could probably seperate that, but for now the
-	dependency for 'tight' goes: PNG depends on JPEG depends on ZLIB.  This is reflected in Makefile.am now.  NB: Building tight.c with JPEG but without PNG is still possible,     but nor the other way around.
-
-2011-12-01  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: Use AM_SILENT_RULES only when it's actually
-	available.  Otherwise building breaks with older make versions. Happens on OS X
-	10.6 for instance.
-
-2011-11-09  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac, webclients/Makefile.am, webclients/index.vnc,
-	webclients/java-applet/Makefile.am,
-	webclients/java-applet/javaviewer.pseudo_proxy.patch,
-	webclients/java-applet/ssl/Makefile.am,
-	webclients/java-applet/ssl/README,
-	webclients/java-applet/ssl/index.vnc,
-	webclients/java-applet/ssl/onetimekey,
-	webclients/java-applet/ssl/proxy.vnc,
-	webclients/java-applet/ssl/ss_vncviewer,
-	webclients/java-applet/ssl/tightvnc-1.3dev7_javasrc-vncviewer-curso
-	r-colors+no-tab-traversal.patch,
-	webclients/java-applet/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.p
-	atch, webclients/java-applet/ssl/ultra.vnc,
-	webclients/java-applet/ssl/ultraproxy.vnc,
-	webclients/java-applet/ssl/ultrasigned.vnc,
-	webclients/java-applet/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	webclients/javaviewer.pseudo_proxy.patch,
-	webclients/ssl/Makefile.am, webclients/ssl/README,
-	webclients/ssl/index.vnc, webclients/ssl/onetimekey,
-	webclients/ssl/proxy.vnc, webclients/ssl/ss_vncviewer,
-	webclients/ssl/tightvnc-1.3dev7_javasrc-vncviewer-cursor-colors+no-
-	tab-traversal.patch,
-	webclients/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	webclients/ssl/ultra.vnc, webclients/ssl/ultraproxy.vnc,
-	webclients/ssl/ultrasigned.vnc,
-	webclients/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: Move the java
-	stuff into webclients/java-applet.
-
-2011-11-09  Christian Beier <dontmind at freeshell.org>
-
-	* LibVNCServer.spec.in, Makefile.am, README, classes/Makefile.am,
-	classes/index.vnc, classes/javaviewer.pseudo_proxy.patch,
-	classes/novnc/LICENSE.txt, classes/novnc/README.md,
-	classes/novnc/favicon.ico, classes/novnc/include/base.css,
-	classes/novnc/include/base64.js, classes/novnc/include/black.css,
-	classes/novnc/include/blue.css, classes/novnc/include/des.js,
-	classes/novnc/include/display.js, classes/novnc/include/input.js,
-	classes/novnc/include/logo.js, classes/novnc/include/playback.js,
-	classes/novnc/include/rfb.js, classes/novnc/include/ui.js,
-	classes/novnc/include/util.js, classes/novnc/include/vnc.js,
-	classes/novnc/include/web-socket-js/README.txt,
-	classes/novnc/include/web-socket-js/swfobject.js,
-	classes/novnc/include/web-socket-js/web_socket.js,
-	classes/novnc/include/websock.js, classes/novnc/include/webutil.js,
-	classes/novnc/vnc.html, classes/novnc/vnc_auto.html,
-	classes/ssl/Makefile.am, classes/ssl/README, classes/ssl/index.vnc,
-	classes/ssl/onetimekey, classes/ssl/proxy.vnc,
-	classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-cursor-colors+no-tab
-	-traversal.patch,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultra.vnc, classes/ssl/ultraproxy.vnc,
-	classes/ssl/ultrasigned.vnc,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch, configure.ac,
-	examples/example.c, examples/pnmshow.c, examples/pnmshow24.c,
-	rfb/rfb.h, webclients/Makefile.am, webclients/index.vnc,
-	webclients/javaviewer.pseudo_proxy.patch,
-	webclients/novnc/LICENSE.txt, webclients/novnc/README.md,
-	webclients/novnc/favicon.ico, webclients/novnc/include/base.css,
-	webclients/novnc/include/base64.js,
-	webclients/novnc/include/black.css,
-	webclients/novnc/include/blue.css, webclients/novnc/include/des.js,
-	webclients/novnc/include/display.js,
-	webclients/novnc/include/input.js,
-	webclients/novnc/include/logo.js,
-	webclients/novnc/include/playback.js,
-	webclients/novnc/include/rfb.js, webclients/novnc/include/ui.js,
-	webclients/novnc/include/util.js, webclients/novnc/include/vnc.js,
-	webclients/novnc/include/web-socket-js/README.txt,
-	webclients/novnc/include/web-socket-js/swfobject.js,
-	webclients/novnc/include/web-socket-js/web_socket.js,
-	webclients/novnc/include/websock.js,
-	webclients/novnc/include/webutil.js, webclients/novnc/vnc.html,
-	webclients/novnc/vnc_auto.html, webclients/ssl/Makefile.am,
-	webclients/ssl/README, webclients/ssl/index.vnc,
-	webclients/ssl/onetimekey, webclients/ssl/proxy.vnc,
-	webclients/ssl/ss_vncviewer,
-	webclients/ssl/tightvnc-1.3dev7_javasrc-vncviewer-cursor-colors+no-
-	tab-traversal.patch,
-	webclients/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	webclients/ssl/ultra.vnc, webclients/ssl/ultraproxy.vnc,
-	webclients/ssl/ultrasigned.vnc,
-	webclients/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: Rename
-	'classes' dir to 'webclients'.
-
-2011-11-09  Christian Beier <dontmind at freeshell.org>
-
-	* classes/index.vnc, libvncserver/httpd.c: novnc client: use the
-	client's notion about the server hostname instead of what the server
-	thinks.
-
-2011-11-09  Christian Beier <dontmind at freeshell.org>
-
-	* classes/index.vnc: Fix tiny typo.
-
-2011-11-09  Christian Beier <dontmind at freeshell.org>
-
-	* NEWS: Add 0.9.8.2 NEWS entry.
-
-2011-11-09  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c: When GetCredential() callback is not set,
-	don't use authentications requiring it.  The auth methods that employ Getcredential() will only be used if
-	the client's GetCredential callback is actually set.
-
-2011-10-12  Christian Beier <dontmind at freeshell.org>
-
-	* ChangeLog: Update ChangeLog for 0.9.8.1.
-
-2011-10-12  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt, NEWS, configure.ac: Update version number in
-	autotools && cmake, NEWS entry.
-
-2011-10-26  Peter Watkins <watkipet at gmail.com>
-
-	* rfb/rfbclient.h: Added comments.
-
-2011-10-26  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbserver.c: Fix deadlock in threaded mode when using
-	nested rfbClientIteratorNext() calls.  Lengthy explanation follows...  First, the scenario before this patch: We have three clients 1,2,3 connected. The main thread loops through
-	them using rfbClientIteratorNext() (loop L1) and is currently at
-	client 2 i.e. client 2's cl_2->refCount is 1. At this point we need
-	to loop again through the clients, with cl_2->refCount == 1, i.e. do
-	a loop L2 nested within loop L1.  BUT: Now client 2 disconnects, it's clientInput thread terminates
-	its clientOutput thread and calls rfbClientConnectionGone(). This
-	LOCKs clientListMutex and WAITs for cl_2->refCount to become 0. This
-	means this thread waits for the main thread to release cl_2.
-	Waiting, with clientListMutex LOCKed! Meanwhile, the main thread is about to begin the inner
-	rfbClientIteratorNext() loop L2. The first call to
-	rfbClientIteratorNext() LOCKs clientListMutex. BAAM. This mutex is
-	locked by cl2's clientInput thread and is only released when
-	cl_2->refCount becomes 0. The main thread would decrement
-	cl_2->refCount when it would continue with loop L1. But it's waiting
-	for cl2's clientInput thread to release clientListMutex. Which never
-	happens since this one's waiting for the main thread to decrement
-	cl_2->refCount. DEADLOCK.  Now, situation with this patch: Same as above, but when client 2 disconnects it's clientInput thread
-	rfbClientConnectionGone(). This again LOCKs clientListMutex, removes
-	cl_2 from the linked list and UNLOCKS clientListMutex. The WAIT for
-	cl_2->refCount to become 0 is _after_ that. Waiting, with
-	clientListMutex UNLOCKed! Therefore, the main thread can continue, do the inner loop L2 (now
-	only looping through 1,3 - 2 was removed from the linked list) and
-	continue with loop L1, finally decrementing cl_2->refCount, allowing
-	cl2's clientInput thread to continue and terminate. The resources
-	held by cl2 are not free()'d by rfbClientConnectionGone until
-	cl2->refCount becomes 0, i.e. loop L1 has released cl2.
-
-2011-10-16  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Update AUTHORS Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-10-16  George Fleury <gfleury at gmail.com>
-
-	* libvncserver/rfbserver.c: Fix memory leak I was debbuging some code tonight and i found a pointer that is not
-	been freed, so i think there is maybe a memory leak, so it is...  there is the malloc caller reverse order: ( malloc cl->statEncList ) 	<- rfbStatLookupEncoding 	<- rfbStatRecordEncodingSent 	<- rfbSendCursorPos 	<- rfbSendFramebufferUpdate 	<- rfbProcessEvents I didnt look the whole libvncserver api, but i am using
-	rfbReverseConnection with rfbProcessEvents, and then when the client
-	connection dies, i am calling a rfbShutdownServer and
-	rfbScreenCleanup, but the malloc at rfbStatLookupEncoding isnt been
-	freed.  So to free the stats i added a rfbResetStats(cl) after
-	rfbPrintStats(cl) at rfbClientConnectionGone in rfbserver.c before
-	free the cl pointer. (at rfbserver.c line 555). And this, obviously,
-	is correcting the memory leak.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-10-08  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* rfb/rfbclient.h: Hopefully fix the crash when updating from 0.9.7
-	or earlier For backwards-compatibility reasons, we can only add struct members
-	to the end. That way, existing callers still can use newer
-	libraries, as the structs are always allocated by the library (and
-	therefore guaranteed to have the correct size) and still rely on the
-	same position of the parts the callers know about.  Reported by Luca Falavigna.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-10-09  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: make it resizable by
-	default I got annoyed having to specify -resizable all the time; I never use
-	it in another mode anymore, since I am on a netbook.  The option -no-resizable was added to be able to switch off that
-	feature.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-10-06  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/httpd.c: httpd: fix sending of binary data such as
-	images.  We do this simply by omitting the content-type and let the browser
-	decide upon the mime-type of the sent file. Only exception is
-	'index.vnc', where we do set the content-type since some browsers
-	fail to detect it's html when it's ending in '.vnc' Also, remove superfluous #defines. We close the connection always.
-
-2011-10-06  Christian Beier <dontmind at freeshell.org>
-
-	* classes/index.vnc: Fix typo && use proper website.
-
-2011-10-04  Christian Beier <dontmind at freeshell.org>
-
-	* classes/index.vnc, classes/novnc/LICENSE.txt,
-	classes/novnc/README.md, classes/novnc/favicon.ico,
-	classes/novnc/include/base.css, classes/novnc/include/base64.js,
-	classes/novnc/include/black.css, classes/novnc/include/blue.css,
-	classes/novnc/include/des.js, classes/novnc/include/display.js,
-	classes/novnc/include/input.js, classes/novnc/include/logo.js,
-	classes/novnc/include/playback.js, classes/novnc/include/rfb.js,
-	classes/novnc/include/ui.js, classes/novnc/include/util.js,
-	classes/novnc/include/vnc.js,
-	classes/novnc/include/web-socket-js/README.txt,
-	classes/novnc/include/web-socket-js/swfobject.js,
-	classes/novnc/include/web-socket-js/web_socket.js,
-	classes/novnc/include/websock.js, classes/novnc/include/webutil.js,
-	classes/novnc/vnc.html, classes/novnc/vnc_auto.html,
-	libvncserver/httpd.c: Add noVNC HTML5 client connect possibility to
-	our http server.  Pure JavaScript, no Java plugin required anymore! (But a recent
-	browser...)
-
-2011-10-04  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac: This build warning is a libvncserver one, not for
-	x11vnc.  Also, make it warn more generally when no known encryption lib is
-	available.
-
-2011-09-21  Gernot Tenchio <gernot at tenchio.de>
-
-	* common/md5.c: md5: forced to use function names with leading
-	underscores Commented out the surrounding '#ifdef _LIBC' to build md5.o with
-	leading underscores. This is required to match the prototypes
-	defined in md5.h.
-
-2011-09-20  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/rfbcrypto_included.c: rfbcrypto_included: fix c&p
-	errors
-
-2011-09-20  Gernot Tenchio <gernot at tenchio.de>
-
-	* libvncserver/rfbcrypto_polarssl.c: rfbcrypto_polarssl: it was way
-	to late last night...
-
-2011-09-18  Gernot Tenchio <gernot at tenchio.de>
-
-	* libvncserver/Makefile.am, libvncserver/rfbcrypto.h,
-	libvncserver/rfbcrypto_gnutls.c, libvncserver/rfbcrypto_included.c,
-	libvncserver/rfbcrypto_openssl.c,
-	libvncserver/rfbcrypto_polarssl.c, libvncserver/websockets.c: Add
-	support for different crypto implementations
-
-2011-09-11  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac, libvncserver/Makefile.am: Autotools: Fix OpenSSL and
-	GnuTLS advertisement.
-
-2011-09-11  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbssl_gnutls.c: Fix libvncserver GnuTLS init.  gnutls_certificate_set_x509_trust_file() returns the number of
-	processed certs and _not_ GNUTLS_E_SUCCESS (0) on success!
-
-2011-09-11  Christian Beier <dontmind at freeshell.org>
-
-	* AUTHORS, libvncserver/websockets.c: Update AUTHORS regarding the
-	websocket guys.
-
-2011-08-28  Gernot Tenchio <gernot at tenchio.de>
-
-	* configure.ac: configure: Add AM_SILENT_RULES Working with “silent make mode” makes debugging a lot of easier
-	since warnings wont shadowed by useless compiler noise
-
-2011-08-27  Gernot Tenchio <gernot at tenchio.de>
-
-	* CMakeLists.txt: cmake: set SOVERSION
-
-2011-09-11  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac, libvncserver/Makefile.am: Autotools: Fix OpenSSL and
-	GnuTLS advertisement.
-
-2011-09-11  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbssl_gnutls.c: Fix libvncserver GnuTLS init.  gnutls_certificate_set_x509_trust_file() returns the number of
-	processed certs and _not_ GNUTLS_E_SUCCESS (0) on success!
-
-2011-09-11  Christian Beier <dontmind at freeshell.org>
-
-	* AUTHORS, libvncserver/websockets.c: Update AUTHORS regarding the
-	websocket guys.
-
-2011-09-02  Gernot Tenchio <gernot at tenchio.de>
-
-	* libvncserver/websockets.c: websocket: Use a single buffer for
-	both, encoding and decoding
-
-2011-08-30  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/rfbssl_gnutls.c: rfbssl_gnutls: Merge
-	rfbssl_peek/rfbssl_read into one function
-
-2011-08-30  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/websockets.c: websockets: fix
-	webSocketCheckDisconnect() Do not consume the peeked data if no close frame was detected.
-
-2011-08-29  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/websockets.c: websockets: use 32bit Xor in
-	webSocketsDecodeHybi()
-
-2011-08-29  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* CMakeLists.txt: cmake: use sha1.c for websocket builds
-
-2011-08-25  Gernot Tenchio <gernot at tenchio.de>
-
-	* libvncserver/websockets.c: websockets: nothing to worry about
-
-2011-08-25  Gernot Tenchio <gernot at tenchio.de>
-
-	* libvncserver/websockets.c: websockets: added gcrypt based sha1
-	digest funtion
-
-2011-08-25  Joel Martin <jmartin at sentryds.com>
-
-	* common/sha1.c, common/sha1.h, libvncserver/Makefile.am,
-	libvncserver/websockets.c: Add sha1.*. Remove UTF-8 encode. Protocol
-	handling.  Add common/sha1.h and common/sha1.c so that we have the SHA routines
-	even if openssl is not available. From the IETF SHA RFC example
-	code.  Remove the UTF-8 encoding hack. This was really just an experiment.  If the protocol passed in the handshake has "binary" then don't
-	base64 encode for the HyBi protocol. This will allow noVNC to
-	request the binary data be passed raw and not base64 encoded.
-	Unfortunately, the client doesn't speak first in VNC protocol (bad
-	original design). If it did then we could determine whether to
-	base64 encode or not based on the first HyBi frame from the client
-	and whether the binary bit is set or not. Oh well.  Misc Cleanup: - Always free response and buf in handshake routine.  - Remove some unused variables.
-
-2011-08-25  Gernot Tenchio <gernot at tenchio.de>
-
-	* CMakeLists.txt: cmake: make some noise
-
-2011-08-25  Gernot Tenchio <gernot at tenchio.de>
-
-	* libvncserver/rfbssl_gnutls.c: websockets: remove warning on 64bit
-	platforms
-
-2011-08-25  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/websockets.c: websockets: Removed debugging left over
-
-2011-08-25  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/websockets.c: websockets: Use callback functions for
-	encode/decode
-
-2011-08-25  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/rfbserver.c, libvncserver/sockets.c,
-	libvncserver/websockets.c, rfb/rfb.h: websockets: Move Hixie
-	disconnect hack to websockets.c Move the hixie disconnect hack to websockets.c. Removed the
-	remaining websockets vars from rfbClientPtr, so all websockets stuff
-	is hidden behind an opaque pointer.
-
-2011-08-25  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/rfbserver.c, libvncserver/sockets.c,
-	libvncserver/websockets.c, rfb/rfb.h: websockets: Initial HyBi
-	support
-
-2011-08-16  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* CMakeLists.txt: cmake: don't link sdl libs to vnc libraries Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/sockets.c, libvncserver/websockets.c, rfb/rfb.h: 
-	websockets: Add wspath member to rfbClientRec Added wspath member to rfbClientRec which holds the path component
-	of the initial websocket request.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* CMakeLists.txt, common/md5.c, common/md5.h,
-	libvncserver/Makefile.am, libvncserver/md5.c, libvncserver/md5.h: 
-	Move libvncserver/md5* to common Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* CMakeLists.txt, rfb/rfbconfig.h.cmake: websockets: Add Websockets
-	support to CMakeLists.txt Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Joel Martin <github at martintribe.org>
-
-	* libvncserver/Makefile.am, libvncserver/cargs.c: websockets: Add
-	SSL cert command line options.  - Add --sslcertfile and --sslkeyfile. These should really be
-	  combined with the existing x11vnc command line options for SSL
-	support.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-17  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* configure.ac, libvncserver/Makefile.am,
-	libvncserver/rfbssl_gnutls.c, libvncserver/rfbssl_openssl.c: 
-	websockets: add GnuTLS and OpenSSL support For now, only OpenSSL support is activated through configure, since
-	GnuTLS is only used in LibVNCClient.  [jes: separated this out from the commit adding encryption support,
-	added autoconf support.] Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Gernot Tenchio <gernot.tenchio at securepoint.de>
-
-	* libvncserver/Makefile.am, libvncserver/rfbserver.c,
-	libvncserver/rfbssl.h, libvncserver/rfbssl_none.c,
-	libvncserver/sockets.c, libvncserver/websockets.c, rfb/rfb.h: 
-	websockets: Add encryption support [jes: moved out GnuTLS and OpenSSL support, added a dummy support,
-	to separate changes better, and to keep things compiling] Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Joel Martin <jmartin at sentryds.com>
-
-	* libvncserver/websockets.c: websockets: Properly parse Hixie-76
-	handshake.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Joel Martin <github at martintribe.org>
-
-	* libvncserver/rfbserver.c, libvncserver/websockets.c: websockets:
-	Add UTF-8 encoding support.  This is not completely standard UTF-8 encoding. Only code points
-	0-255 are encoded and never encoded to more than two octets. Since
-	'\x00' is a WebSockets framing character, it's easier for all
-	parties to encode zero as '\xc4\x80', i.e. 194+128, i.e. UTF-8 256.  This means that a random stream will be slightly more than 50%
-	larger using this encoding scheme. But it's easy CPU-wise for client
-	and server to decode/encode. This is especially important for
-	clients written in languages that have weak bitops, like Javascript
-	(i.e. the noVNC client).  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Joel Martin <github at martintribe.org>
-
-	* libvncserver/rfbserver.c: websockets: Better disconnect detection.  If the only thing we are waiting on is a WebSockets terminator, then
-	remove it from the stream early on in rfbProcessClientNormalMessage.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-16  Joel Martin <github at martintribe.org>
-
-	* configure.ac, libvncserver/Makefile.am, libvncserver/md5.c,
-	libvncserver/md5.h, libvncserver/rfbserver.c,
-	libvncserver/sockets.c, libvncserver/websockets.c, rfb/rfb.h: 
-	websockets: Initial WebSockets support.  Has a bug: WebSocket client disconnects are not detected.
-	rfbSendFramebufferUpdate is doing a MSG_PEEK recv to determine if
-	enough data is available which prevents a disconnect from being
-	detected.  Otherwise it's working pretty well.  [jes: moved added struct members to the end for binary compatibility
-	with previous LibVNCServer versions, removed an unused variable] Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-08-17  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* .gitignore: .gitignore: zippy has moved Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-07-25  Christian Beier <dontmind at freeshell.org>
-
-	* examples/android/README: Add installation hints to android example
-	README.
-
-2011-07-22  William Roberts <wroberts at sta.samsung.com>
-
-	* examples/android/jni/fbvncserver.c: Reduced memory footprint by
-	50%
-
-2011-07-22  William Roberts <wroberts at sta.samsung.com>
-
-	* examples/android/jni/fbvncserver.c: Corrected resolution issue,
-	but screen is getting reported as wrong size
-
-2011-07-23  ckanru <ckanru at code.google.com>
-
-	* examples/android/jni/fbvncserver.c: Fixes running vncserver on
-	beagleboard/0xdroid and possibly any device without a touch screen.
-	Because fake touch screen always report zero when query device
-	information, coordinates transformation is not needed.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-07-23  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac, examples/Makefile.am, examples/android/Makefile.am,
-	rfb/rfb.h, vncterm/Makefile.am: Adopt autotools build system to
-	Android.  LibVNCServer/LibVNCClient now build for Android!
-
-2011-07-23  Christian Beier <dontmind at freeshell.org>
-
-	* examples/android/README, examples/android/jni/Android.mk,
-	examples/android/jni/fbvncserver.c: Add androidvncserver example.
-
-2011-07-22  letsgoustc <letsgoustc at gmail.com>
-
-	* rfb/rfb.h: Make LibVNCServer build for Android.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-07-19  Joel Martin <github at martintribe.org>
-
-	* libvncserver/tight.c: tightPng: check even for SendGradientRect.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-07-19  Joel Martin <github at martintribe.org>
-
-	* CMakeLists.txt, configure.ac, libvncserver/Makefile.am,
-	libvncserver/rfbserver.c, libvncserver/stats.c,
-	libvncserver/tight.c, rfb/rfb.h, rfb/rfbconfig.h.cmake,
-	rfb/rfbproto.h: tightPng: Add initial tightPng encoding support.  http://wiki.qemu.org/VNC_Tight_PNG Signed-off-by: Joel Martin <github at martintribe.org> Signed-off-by:
-	Christian Beier <dontmind at freeshell.org>
-
-2011-06-01  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/main.c, libvncserver/sockets.c: Remove some unused
-	variables.
-
-2010-11-14  George Kiagiadakis <kiagiadakis.george at gmail.com>
-
-	* libvncserver/sockets.c, rfb/rfb.h: Fix rfbProcessNewConnection to
-	return some value instead of void.  BUG: 256891 Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-11-10  George Kiagiadakis <kiagiadakis.george at gmail.com>
-
-	* libvncserver/main.c, libvncserver/sockets.c, rfb/rfb.h: Split two
-	event-loop related functions out of the rfbProcessEvents()
-	mechanism.  This is required to be able to do proper event loop integration with
-	Qt.  Idea was taken from vino's libvncserver fork.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-05-06  Cristian Rodríguez <crrodriguez at opensuse.org>
-
-	* libvncserver/tightvnc-filetransfer/filetransfermsg.c: Fix buffer
-	overflow Signed-off-by: Cristian Rodríguez <crrodriguez at opensuse.org>
-	Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-04-30  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/tight.c: Revert "Fix memory corruption bug." This reverts commit c1363fa9583ed41b94fbc79b3ff410b7d5189407.  The proper fix was already in
-	804335f9d296440bb708ca844f5d89b58b50b0c6.
-
-2011-04-28  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: UTF-8ify AUTHORS Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-04-28  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Update AUTHORS Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-11-10  George Kiagiadakis <kiagiadakis.george at gmail.com>
-
-	* libvncserver/tight.c: Fix memory corruption bug.  This bug occured when a second telepathy tubes client was connected
-	after the first one had disconnected and the channel (thus, the
-	screen too) had been destroyed.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-11-10  George Kiagiadakis <kiagiadakis.george at gmail.com>
-
-	* common/zywrletemplate.c, libvncserver/auth.c,
-	libvncserver/rfbserver.c, libvncserver/scale.c,
-	libvncserver/scale.h, rfb/rfb.h: Fix compilation in c89 mode.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-04-27  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/tls.c: Replace deprecated GnuTLS functions
-	gnutls_*_set_priority with gnutls_priority_set_direct.  The functions gnutls_*_set_priority we used were marked deprecated
-	since latest GnuTLS version 2.12. However the replacement function
-	gnutls_priority_set_direct is available since 2.2, which is even
-	lower than our version requirement 2.4 in configure. The patch just
-	replace the deprecate function to fix the compile warning.  Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2011-03-30  Christian Beier <dontmind at freeshell.org>
-
-	* ChangeLog: Update ChangeLog for 0.9.8.
-
-2011-03-29  Christian Beier <dontmind at freeshell.org>
-
-	* README: Remove RDP from the README description.  We do VNC but no RDP. Pointed out by Vic Lee, thanks!
-
-2011-03-29  Christian Beier <dontmind at freeshell.org>
-
-	* utils/git2cl.pl: Fix skipping of merge commits in log convert
-	script.
-
-2011-03-29  Christian Beier <dontmind at freeshell.org>
-
-	* bdf2c.pl, consolefont2c.pl, utils/bdf2c.pl,
-	utils/consolefont2c.pl, utils/git2cl.pl: Add a git-log to GNU-Style
-	ChangeLog converter script.  Also put all helper scripts into a utils directory.
-
-2011-03-28  Christian Beier <dontmind at freeshell.org>
-
-	* NEWS: Mention the pkg-config stuff in NEWS.
-
-2011-03-27  Vic Lee <llyzs at 163.com>
-
-	* .gitignore, Makefile.am, configure.ac, libvncclient.pc.in,
-	libvncserver.pc.in: Add libvncserver.pc and libvncclient.pc files.  Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Christian
-	Beier <dontmind at freeshell.org>
-
-2011-03-17  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/ultra.c, libvncserver/ultra.c: Fix regression in
-	Ultra encoding introduced by commit
-	fe1ca16e9b75b5f38ab374c8dfff92d2c3ea4532.  My bad. There we see what the encodings test is good for ;-)
-
-2011-03-17  Christian Beier <dontmind at freeshell.org>
-
-	* test/encodingstest.c: Update encodingstest.  * Fixed segfault on shutdown.  * Updated to test all encodings.  * Fixed to operate with encodings that split up rects into   smaller rects.
-
-2011-03-17  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c: Remove useless comparisons that always
-	evaluate to false.  There can not be more than 255 security types and MSLogon is RFB 3.6
-	only.
-
-2011-03-17  Christian Beier <dontmind at freeshell.org>
-
-	* examples/rotate.c, examples/rotatetemplate.c, examples/vncev.c,
-	libvncclient/listen.c, libvncclient/rfbproto.c,
-	libvncclient/ultra.c, libvncclient/zrle.c,
-	libvncserver/rfbserver.c, libvncserver/ultra.c: Fix (most) MinGW32
-	compiler warnings.
-
-2011-03-17  Christian Beier <dontmind at freeshell.org>
-
-	* examples/rotate.c, examples/zippy.c, libvncserver/zrle.c,
-	libvncserver/zrleencodetemplate.c: Fix remaining compiler warnings.
-
-2011-03-17  Christian Beier <dontmind at freeshell.org>
-
-	* VisualNaCro/nacro.c, examples/backchannel.c, examples/camera.c,
-	examples/colourmaptest.c, examples/example.c,
-	examples/filetransfer.c, examples/fontsel.c, examples/mac.c,
-	examples/pnmshow.c, examples/pnmshow24.c, examples/simple.c,
-	examples/simple15.c, examples/vncev.c, examples/zippy.c,
-	test/cargstest.c, test/copyrecttest.c, test/cursortest.c,
-	test/encodingstest.c: Check rfbGetScreen() return value everywhere.  This fixes a segfault when a server is invoked with the '-help'
-	commandline argument.
-
-2011-03-12  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt, rfb/rfbconfig.h.cmake: CMake: Check for libgcrypt
-	availability.
-
-2011-03-12  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt: CMake: Threads can be available even if SDL is
-	not.
-
-2011-03-12  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt: CMake: fix building SDLvncviewer.
-
-2011-03-12  Christian Beier <dontmind at freeshell.org>
-
-	* Makefile.am: Include cmake configure file templates in dist
-	tarball.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-03-12  Christian Beier <dontmind at freeshell.org>
-
-	* rfb/rfbconfig.h.in, rfb/stamp-h.in: Remove autogenerated files.
-
-2011-03-12  Christian Beier <dontmind at freeshell.org>
-
-	* NEWS: Update NEWS for 0.9.8 release.
-
-2011-03-07  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/tls.c: Fix libvncclient TLS for Windows builds.  GnuTLS seems to expect proper errno values internally. So set them
-	in our custom push/pull functions. Parts of the patch stolen from
-	libcurl, thanks! Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-03-07  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c: Let libvncclient build with gcrypt for
-	MinGW32 builds.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-03-07  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/sockets.c: Use WaitForMessage instead of sleep in
-	socket reading to fix performance issue.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-03-10  Christian Beier <dontmind at freeshell.org>
-
-	* common/d3des.c, common/d3des.h, libvncserver/auth.c,
-	libvncserver/corre.c, libvncserver/cutpaste.c, libvncserver/draw.c,
-	libvncserver/font.c, libvncserver/hextile.c, libvncserver/httpd.c,
-	libvncserver/rfbregion.c, libvncserver/rre.c,
-	libvncserver/selbox.c, libvncserver/sockets.c,
-	libvncserver/stats.c, libvncserver/tableinit24.c,
-	libvncserver/tableinitcmtemplate.c,
-	libvncserver/tableinittctemplate.c,
-	libvncserver/tabletrans24template.c,
-	libvncserver/tabletranstemplate.c, libvncserver/translate.c,
-	libvncserver/zrletypes.h, rfb/rfbregion.h, test/blooptest.c,
-	test/cursortest.c: Set proper file permissions for source files.
-
-2011-03-10  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt, configure.ac: Next version will be 0.9.8.
-
-2011-03-10  Christian Beier <dontmind at freeshell.org>
-
-	* Makefile.am, configure.ac, contrib/Makefile.am, contrib/zippy.c,
-	examples/Makefile.am, examples/zippy.c: Move zippy.c to examples.
-
-2011-03-03  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/sockets.c, libvncclient/tls.c, libvncserver/httpd.c,
-	libvncserver/rfbserver.c, libvncserver/sockets.c: Call
-	WSAGetLastError() everywhere errno is read after a Winsock call.  Winsock does NOT update errno for us, we have fetch the last error
-	manually using WSAGetLastError().
-
-2011-01-29  Christian Beier <dontmind at freeshell.org>
-
-	* common/lzoconf.h, common/lzodefs.h, common/minilzo.c,
-	common/minilzo.h, libvncclient/Makefile.am,
-	libvncserver/Makefile.am: Update minilzo library used for Ultra
-	encoding to ver 2.04.  According to the minilzo README, this brings a significant speedup
-	on 64-bit architechtures.  Changes compared to old version 1.08 can be found here:
-	http://www.oberhumer.com/opensource/lzo/lzonews.php Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-01-24  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/corre.c, libvncserver/main.c,
-	libvncserver/private.h, libvncserver/rfbserver.c,
-	libvncserver/rre.c, libvncserver/ultra.c, rfb/rfb.h: libvncserver:
-	Make RRE, CoRRE and Ultra encodings thread-safe.  This adds generic before/after encoding buffers to the rfbClient
-	struct, so there is no need for thread local storage.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-02-02  Christian Beier <dontmind at freeshell.org>
-
-	* Makefile.am: Include CMakeLists.txt file in dist tarball.
-
-2011-01-29  Christian Beier <dontmind at freeshell.org>
-
-	* .cvsignore, README.cvs, VisualNaCro/.cvsignore,
-	classes/.cvsignore, client_examples/.cvsignore, contrib/.cvsignore,
-	cvs_update_anonymously, examples/.cvsignore,
-	libvncclient/.cvsignore, libvncserver/.cvsignore,
-	libvncserver/tightvnc-filetransfer/.cvsignore, rfb/.cvsignore,
-	test/.cvsignore, vncterm/.cvsignore: Remove unneeded files
-	concerning CVS.  We have a git repo nowadays and I guess we won't go back to CVS.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-01-31  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* examples/example.dsp, libvncserver.dsp, libvncserver.dsw: Remove
-	completely broken Visual Studio project files If people seriously consider building with Visual Studio, there is
-	always CMake.  Pointed out by Christian Beier.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-01-31  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/Makefile.am, client_examples/SDLvncviewer.c: 
-	SDLvncviewer: fix compilation from dist tarball.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2011-01-21  Vic Lee <llyzs at 163.com>
-
-	* acinclude.m4, configure.ac, libvncclient/rfbproto.c,
-	rfb/rfbproto.h: Add ARD (Apple Remote Desktop) security type support Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Christian
-	Beier <dontmind at freeshell.org>
-
-2011-01-25  Christian Beier <dontmind at freeshell.org>
-
-	* CMakeLists.txt, common/d3des.c, common/d3des.h, common/lzoconf.h,
-	common/minilzo.c, common/minilzo.h, common/vncauth.c,
-	common/zywrletemplate.c, libvncclient/Makefile.am,
-	libvncclient/lzoconf.h, libvncclient/minilzo.c,
-	libvncclient/minilzo.h, libvncclient/rfbproto.c,
-	libvncclient/zrle.c, libvncserver/Makefile.am,
-	libvncserver/d3des.c, libvncserver/d3des.h, libvncserver/lzoconf.h,
-	libvncserver/minilzo.c, libvncserver/minilzo.h,
-	libvncserver/vncauth.c, libvncserver/zywrletemplate.c: Put files
-	used by both libs into a 'common' dir.  No functional changes. All files used by _both_ libvncserver and
-	libvncclient are put into a 'common' directory and references from
-	other files as well as Autotools and CMake build systems are
-	updated.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2011-01-20  ebola_rulez <ebola_rulez at users.sourceforge.net>
-
-	* libvncserver/vncauth.c: Fix two errors found by cppcheck Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Christian
-	Beier <dontmind at freeshell.org>
-
-2011-01-01  runge <runge at karlrunge.com>
-
-	* libvncserver/rfbserver.c: Remove never used protocol version name
-	string.
-
-2010-12-29  runge <runge at karlrunge.com>
-
-	* configure.ac, x11vnc/ChangeLog, x11vnc/Makefile.am,
-	x11vnc/README, x11vnc/avahi.c, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/help.c,
-	x11vnc/inet.c, x11vnc/inet.h, x11vnc/macosx.c, x11vnc/macosxCG.c,
-	x11vnc/macosxCG.h, x11vnc/macosx_opengl.c, x11vnc/macosx_opengl.h,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/rates.c,
-	x11vnc/screen.c, x11vnc/ssltools.h, x11vnc/util.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xwrappers.c: x11vnc: Use opengl to read screen on macosx.
-	non-deprecated macosx interfaces for input injection.
-
-2010-12-21  runge <runge at karlrunge.com>
-
-	* configure.ac, prepare_x11vnc_dist.sh, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: x11vnc: force
-	--with-system-libvncserver to use correct headers.
-
-2010-12-21  runge <runge at karlrunge.com>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-cursor-colors+no-tab
-	-traversal.patch,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	prepare_x11vnc_dist.sh, x11vnc/8to24.c, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/RELEASE-NOTES,
-	x11vnc/appshare.c, x11vnc/cleanup.c, x11vnc/gui.c, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/keyboard.h, x11vnc/linuxfb.c,
-	x11vnc/macosx.c, x11vnc/macosxCG.c, x11vnc/misc/Makefile.am,
-	x11vnc/misc/README, x11vnc/misc/qt_tslib_inject.pl,
-	x11vnc/misc/uinput.pl, x11vnc/pointer.c, x11vnc/remote.c,
-	x11vnc/scan.c, x11vnc/screen.c, x11vnc/sslhelper.c,
-	x11vnc/ssltools.h, x11vnc/uinput.c, x11vnc/uinput.h,
-	x11vnc/unixpw.c, x11vnc/user.c, x11vnc/util.h, x11vnc/v4l.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xevents.h,
-	x11vnc/xrecord.c, x11vnc/xrecord.h, x11vnc/xwrappers.c: x11vnc:
-	touchscreen uinput support and Java viewer mousewheel support.  See
-	x11vnc/ChangeLog for rest.
-
-2010-12-01  Tobias Doerffel <tobias.doerffel at gmail.com>
-
-	* libvncserver/sockets.c: libvncserver sockets: check cl->screen
-	before accessing it In commit 079394ca5b14d8067b95a9cf95a834828b4425a6 new code with
-	insufficient checks was introduced causing a segfault when doing a
-	HTTP server connection. Such connections have no screen set in the
-	client data structure.  Signed-off-by: Tobias Doerffel <tobias.doerffel at gmail.com>
-
-2010-11-30  Christian Beier <dontmind at freeshell.org>
-
-	* Doxyfile: Doxygen documentation: actually add Doxyfile.
-
-2010-11-29  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* index.html, success.html: The website is now maintained
-	independently Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-11-18  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/SDLvncviewer.c, client_examples/backchannel.c,
-	client_examples/ppmtest.c, client_examples/vnc2mpg.c,
-	examples/backchannel.c, examples/camera.c, examples/example.c,
-	examples/filetransfer.c, examples/pnmshow.c, examples/pnmshow24.c,
-	examples/vncev.c, rfb/rfb.h, rfb/rfbclient.h, rfb/rfbproto.h: 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: Christian Beier <dontmind at freeshell.org>
-
-2010-11-18  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/main.c: libvncserver: fix endless loop when server
-	closed client in threaded mode.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-11-18  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/sockets.c: libvncserver sockets: favor per-screen
-	maxclientwait over global one when set.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-11-11  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/rfbserver.c, libvncserver/stats.c, rfb/rfbproto.h: 
-	libvncserver cleanup: remove rfbKeyFrame remnants.
-
-2010-11-02  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/stats.c, rfb/rfb.h,
-	rfb/rfbclient.h, rfb/rfbproto.h: libvnc[server|client]: implement
-	xvp VNC extension.  This implements the xvp VNC extension, which is described in the
-	community version of the RFB protocol:
-	http://tigervnc.sourceforge.net/cgi-bin/rfbproto It is also
-	mentioned in the official RFB protocol.
-
-2010-10-28  Tobias Doerffel <tobias.doerffel at gmail.com>
-
-	* libvncserver/main.c: Added missing initialization of extension
-	mutex When not calling rfbRegisterProtocolExtension() the extension mutex
-	is uninitialized but used upon calling rfbGetExtensionIterator() and
-	rfbReleaseExtensionIterator() in rfbNewTCPOrUDPClient(). This causes
-	libvncserver to crash on Win32 when building with thread support.  Signed-off-by: Tobias Doerffel <tobias.doerffel at gmail.com>
-	Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-10-21  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c, rfb/rfbproto.h: Only define strncasecmp
-	to _strnicmp when using MS compiler.  Redefining strncasecmp to _strnicmp makes libvncclient hang forever
-	in SetFormatAndEncodings() on Windows when built with MinGW64.  Reported by Tobias Doerffel <tobias.doerffel at gmail.com>, thanks!
-
-2010-10-20  Tobias Doerffel <tobias.doerffel at gmail.com>
-
-	* libvncserver/rfbserver.c: In rfbSendDirContent() we have to make
-	sure to call closedir() before returning. This did not happen if
-	rfbSendFileTransferMessage() failed.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-10-20  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/sockets.c: Fix build failure wrt IP QoS support in
-	libvncclient.  This is a small addendum to
-	0797e42a4aaf8131ae71899faea2d682ed81cb59.  Seems that having IPv6
-	support in the OS does not necessarily mean that IPV6_TCLASS is
-	available. One such case seems to be Mac OS X 10.5.
-
-2010-02-09  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/sockets.c: Avoid 100% CPU usage when calling
-	ReadFromRFBServer and no available bytes to read Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Christian
-	Beier <dontmind at freeshell.org>
-
-2010-10-08  Christian Beier <dontmind at freeshell.org>
-
-	* rfb/rfbproto.h: rfb/rfbproto.h: Prefix WORDS_BIGENDIAN when it is
-	defined.  Some (all?) autotool versions do not properly prefix WORDS_BIGENDIAN
-	with LIBVNCSERVER_, so do that manually here.  Thanks to Lorenz Kolb for reporting.
-
-2010-09-29  Christian Beier <dontmind at freeshell.org>
-
-	* TODO, libvncclient/rfbproto.c, libvncclient/sockets.c,
-	libvncclient/vncviewer.c, rfb/rfbclient.h: IP QoS support in
-	libvncclient.  This enables setting the DSCP/Traffic Class field of IP/IPv6 packets
-	sent by a client. For example starting a client with -qosdscp 184
-	marks all outgoing traffic for expedited forwarding.  Implementation for Win32 is still a TODO, though. See
-
-	http://betelco.blogspot.com/2009/03/dscp-marking-under-windows-at.htmlfor an overview of the Win32 QoS API mess...
-
-2010-09-07  Christian Beier <dontmind at freeshell.org>
-
-	* TODO, libvncclient/sockets.c, libvncserver/httpd.c,
-	libvncserver/rfbserver.c, libvncserver/sockets.c, rfb/rfb.h: 
-	Non-blocking sockets for Windows.  Expands the SetNonBlocking() function in libvncclient/sockets.c to
-	also work under Windows and also changes it to honour maybe already
-	present socket flags.  A similar function was introduced for libvncserver as well and all
-	the #ifdef'ed fnctl calls replaced with calls to that one.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-09-06  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/main.c, libvncserver/rfbserver.c,
-	libvncserver/scale.c: Cleanup: remove CORBA stuff.  The header file and most of the functions referred to do not exist
-	in libvncserver.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-09-10  runge <runge at karlrunge.com>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: update
-	classes/ssl jars, patches, and script
-
-2010-09-10  runge <runge at karlrunge.com>
-
-	* prepare_x11vnc_dist.sh, x11vnc/8to24.c, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/avahi.c, x11vnc/avahi.h,
-	x11vnc/cleanup.c, x11vnc/connections.c, x11vnc/help.c,
-	x11vnc/inet.c, x11vnc/keyboard.c, x11vnc/misc/ultravnc_repeater.pl,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pointer.c,
-	x11vnc/pointer.h, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xwrappers.c: update
-	to x11vnc 0.9.12
-
-2010-09-06  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c, libvncserver/tight.c: Fix MinGW32
-	compilation with libjpeg.  MinGW32 (or more exactly, a rpcndr.h file included by winsock2.h)
-	typedefs a 'boolean' type that jmorecfg.h included by jpeglib.h also
-	tries to typedef.  So, tell the jpeg headers.  Closes: 3007302
-
-2010-07-11  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac, libvncclient/sockets.c: Fix MinGW32 checking for
-	IPv6.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-06-29  Vic Lee <llyzs at 163.com>
-
-	* configure.ac, libvncclient/rfbproto.c, libvncclient/sockets.c,
-	rfb/rfbclient.h: libvncclient: add ipv6 support [jes: pulled the "host" declarations into the conditionally compiled
-	blocks where that variable is used. Also fixed non-IPv6
-	connections.] Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2010-05-31  Wouter Van Meir <wouter.vanmeir at pandora.be>
-
-	* libvncclient/vncviewer.c: Call MallocFrameBuffer before
-	SetFormatAndEncodings The hook is still called after InitialiseRFBConnection() so we can
-	choose the color settings depending on the vnc server (or settings)
-	in that hook.  This way one can use the "VNC server default format" pixelformat if
-	the client supports it, or perform a workaround (Intel AMT KVM
-	"classic vnc" server only works using 8bit colors in RFB3.8) Signed-off-by: Wouter Van Meir <wouter.vanmeir at pandora.be>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-05-19  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/main.c, libvncserver/rfbserver.c, rfb/rfb.h: 
-	Implement a DisplayFinishedHook for libvncserver.  If set, this hook gets called just before rfbSendFrameBufferUpdate()
-	returns.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-
-2010-05-08  runge <runge at karlrunge.com>
-
-	* ChangeLog, libvncclient/rfbproto.c: libvncclient:
-	rfbResizeFrameBuffer should also set updateRect.
-
-2010-05-08  runge <runge at karlrunge.com>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/screen.c, x11vnc/unixpw.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: x11vnc: tweaks to
-	prepare_x11vnc_dist.sh. set cd->unixname in apply_opts().
-
-2010-05-07  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Complete the AUTHORS file Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-05-07  Wouter Van Meir <wouter.vanmeir at pandora.be>
-
-	* CMakeLists.txt: fix CMakeLists.txt: other way to find pthread
-	library ... and fixed linking of the tests in the examples directory.  Signed-off-by: Wouter Van Meir <wouter.vanmeir at pandora.be>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-05-05  runge <runge at karlrunge.com>
-
-	* classes/ssl/index.vnc, classes/ssl/proxy.vnc,
-	classes/ssl/ultra.vnc, classes/ssl/ultraproxy.vnc,
-	classes/ssl/ultrasigned.vnc, prepare_x11vnc_dist.sh, x11vnc/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: misc/etv sync.
-
-2010-05-01  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/misc/ultravnc_repeater.pl,
-	x11vnc/sslhelper.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c,
-	x11vnc/xrecord.c: x11vnc: X11VNC_DISABLE_SSL_CLIENT_MODE option to
-	          disable SSL client role in reverse connections.  Improvements to
-	          logging in ultravnc_repeater, ULTRAVNC_REPEATER_NO_RFB option.
-	          Increase SSL timeout and print message if 'repeater' mode is
-	          detected for reverse SSL connection.  Fix RECORD scroll XCopyArea
-	          detection with recent gtk/gdk library; set X11VNC_SCROLL_MUST_EQUAL           to disable.  Limit logging of RECORD error messages.
-
-2010-04-28  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* client_examples/Makefile.am: Another try to fix the _SOURCES issue Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-04-28  Corentin Chary <corentin.chary at gmail.com>
-
-	* CMakeLists.txt, rfb/rfbconfig.h.cmake: cmake: fix CMakeLists.txt - It's SDL_LIBRARY, not SDL_LIBRARIES - Detect GnuTLS and set the macro in rfbconfig.h - Add tls.c to libvncclient to avoid missing symbols Signed-off-by: Corentin Chary <corentin.chary at gmail.com>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-04-25  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/enc.h, x11vnc/help.c,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/sslhelper.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: incorporate new
-	ultravnc_dsm_helper.c.
-
-2010-04-18  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.pa
-	tch,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: Sync ssvncviewer changes.
-
-2010-04-18  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/appshare.c,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/inet.c, x11vnc/inet.h,
-	x11vnc/misc/connect_switch, x11vnc/misc/desktop.cgi,
-	x11vnc/misc/ultravnc_repeater.pl, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/util.c, x11vnc/v4l.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xinerama.c: 
-	Improvements to demo scripts. Alias -coe for -connect_or_exit.  Fix
-	HAVE_V4L2. Warn no Xvfb, Xdummy, or Xvnc. Xinerama screens.
-
-2010-04-09  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/connections.h, x11vnc/enc.h, x11vnc/help.c, x11vnc/inet.c,
-	x11vnc/inet.h, x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/sslcmds.c, x11vnc/sslhelper.c,
-	x11vnc/sslhelper.h, x11vnc/ssltools.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/user.c, x11vnc/util.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c, x11vnc/xinerama.c: x11vnc: exit(1) for
-	-connect_or_exit failure, quiet query mode for grab_state,
-	pointer_pos, etc. ipv6 support. STUNNEL_LISTEN for particular
-	interface. -input_eagerly in addition to -allinput.  quiet Xinerama
-	message.
-
-2010-04-09  runge <runge at karlrunge.com>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: Improvements to
-	Java viewer: troubleshooting settings and workarounds, misc bug
-	fixes.
-
-2010-04-09  runge <runge at karlrunge.com>
-
-	* x11vnc/misc/connect_switch, x11vnc/misc/desktop.cgi,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/misc/inet6to4: Synchronize ssvnc 1.0.26.
-	Improvements to perl scripts desktop.cgi, connect_switch and
-	inet6to4.
-
-2010-03-21  runge <runge at karlrunge.com>
-
-	* classes/ssl/README, classes/ssl/onetimekey,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/misc/Makefile.am, x11vnc/misc/README,
-	x11vnc/misc/connect_switch, x11vnc/misc/desktop.cgi,
-	x11vnc/misc/inet6to4, x11vnc/misc/panner.pl,
-	x11vnc/misc/ultravnc_repeater.pl, x11vnc/remote.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: classes/ssl:
-	          Many improvements to Java SSL applet, onetimekey serverCert param,
-	          debugging printout, user dialogs, catch socket exceptions,
-	autodetect x11vnc for GET=1.  x11vnc: misc/scripts: desktop.cgi,
-	          inet6to4, panner.pl.  X11VNC_HTTPS_DOWNLOAD_WAIT_TIME, -unixpw %xxx
-	          documented, and can run user cmd in UNIXPW_CMD. FD_XDMCP_IF for
-	          create script, autodetect dm on udp6 only.  Queries: pointer_x,
-	          pointer_y, pointer_same, pointer_root.  Switch on -xkd if keysyms
-	          per key > 4 in all cases.  daemon mode improvements for
-	          connect_switch, inet6to4, ultravnc_repeater.pl.  Dynamic change of
-	          -clip do not create new fb if WxH is unchanged.
-
-2010-03-21  runge <runge at karlrunge.com>
-
-	* configure.ac: I think two HAVE_X's were missed.
-
-2010-03-13  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* libvncclient/rfbproto.c, libvncclient/vncviewer.c: Fix compilation
-	without TLS Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-03-13  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* client_examples/Makefile.am, client_examples/SDLvncviewer.c: Fix
-	compilation with newer automake For some reason, this developer's automake no longer understands
-	_SOURCES lines anymore. Work around that.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-03-13  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* client_examples/Makefile.am, configure.ac: Rename HAVE_X ->
-	HAVE_X11 This change is just for consistency reasons.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-02-22  runge <runge at karlrunge.com>
-
-	* classes/ssl/README,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/scan.c,
-	x11vnc/sslcmds.c, x11vnc/sslcmds.h, x11vnc/ssltools.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: classes/ssl:
-	Java SSL applet viewer now works with certificate chains.  x11vnc:
-	Printout option -sslScripts.  Suggest -auth guess in error message.
-	Set fake_screen width and height.  Test for +kb in Xvfb.
-
-2010-01-22  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/vncviewer.c: libvncclient/vncviewer.c: don't set
-	serverPort in rfbInitClient().  The serverPort member is already set in rfbGetClient(), if we set it
-	again in rfbInitClient(), this breaks playing of vncrec files (this
-	relies on serverPort set to -1).  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-01-16  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* libvncclient/vncviewer.c: LibVNCClient: make sure that the port is
-	initialized correctly.  While at it, adjust coding style.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-01-15  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c, libvncclient/vncviewer.c,
-	rfb/rfbclient.h: Add UltraVNC Repeater support in libvncclient [jes: adjusted coding style, made sure port is initialized
-	correctly] Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2010-01-07  runge <runge at karlrunge.com>
-
-	* x11vnc/README, x11vnc/misc/Xdummy, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: add modeline creation to Xdummy.
-
-2010-01-07  Christian Beier <dontmind at freeshell.org>
-
-	* libvncserver/font.c: libvncserver/font.c: add some checks to
-	rfbDrawChar().  In some cases (bad font data) the coordinates evaluate to <0,
-	causing a segfault in the following memcpy().  [jes: keep the offset, but do not try to segfault] Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-01-07  Christian Beier <dontmind at freeshell.org>
-
-	* vncterm/LinuxVNC.c: LinuxVNC: Fix for no input possible because of
-	ctrl key being stuck.  Issue was reported as Debian bug ##555988,
-	http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555988 Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-01-04  Christian Beier <dontmind at freeshell.org>
-
-	* vncterm/LinuxVNC.c, vncterm/VNConsole.c: LinuxVNC: fix segfault at
-	"linuxvnc 1 -help".  This fixes Debian Bug #399501: Switch to tty1.  Run "linuxvnc 1
-	-help".  You see help text, followed by "Segmentation fault".  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2010-01-02  runge <runge at karlrunge.com>
-
-	* x11vnc/8to24.c, x11vnc/8to24.h, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/allowed_input_t.h, x11vnc/appshare.c, x11vnc/avahi.c,
-	x11vnc/avahi.h, x11vnc/blackout_t.h, x11vnc/cleanup.c,
-	x11vnc/cleanup.h, x11vnc/connections.c, x11vnc/connections.h,
-	x11vnc/cursor.c, x11vnc/cursor.h, x11vnc/enc.h, x11vnc/enums.h,
-	x11vnc/gui.c, x11vnc/gui.h, x11vnc/help.c, x11vnc/help.h,
-	x11vnc/inet.c, x11vnc/inet.h, x11vnc/keyboard.c, x11vnc/keyboard.h,
-	x11vnc/linuxfb.c, x11vnc/linuxfb.h, x11vnc/macosx.c,
-	x11vnc/macosx.h, x11vnc/macosxCG.c, x11vnc/macosxCG.h,
-	x11vnc/macosxCGP.c, x11vnc/macosxCGP.h, x11vnc/macosxCGS.c,
-	x11vnc/macosxCGS.h, x11vnc/misc/README, x11vnc/misc/Xdummy,
-	x11vnc/misc/rx11vnc, x11vnc/misc/rx11vnc.pl, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/params.h, x11vnc/pm.c, x11vnc/pm.h,
-	x11vnc/pointer.c, x11vnc/pointer.h, x11vnc/rates.c, x11vnc/rates.h,
-	x11vnc/remote.c, x11vnc/remote.h, x11vnc/scan.c, x11vnc/scan.h,
-	x11vnc/screen.c, x11vnc/screen.h, x11vnc/scrollevent_t.h,
-	x11vnc/selection.c, x11vnc/selection.h, x11vnc/solid.c,
-	x11vnc/solid.h, x11vnc/sslcmds.c, x11vnc/sslcmds.h,
-	x11vnc/sslhelper.c, x11vnc/sslhelper.h, x11vnc/ssltools.h,
-	x11vnc/uinput.c, x11vnc/uinput.h, x11vnc/unixpw.c, x11vnc/unixpw.h,
-	x11vnc/user.c, x11vnc/user.h, x11vnc/userinput.c,
-	x11vnc/userinput.h, x11vnc/util.c, x11vnc/util.h, x11vnc/v4l.c,
-	x11vnc/v4l.h, x11vnc/win_utils.c, x11vnc/win_utils.h,
-	x11vnc/winattr_t.h, x11vnc/x11vnc.1, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c, x11vnc/xdamage.h,
-	x11vnc/xevents.c, x11vnc/xevents.h, x11vnc/xinerama.c,
-	x11vnc/xinerama.h, x11vnc/xkb_bell.c, x11vnc/xkb_bell.h,
-	x11vnc/xrandr.c, x11vnc/xrandr.h, x11vnc/xrecord.c,
-	x11vnc/xrecord.h, x11vnc/xwrappers.c, x11vnc/xwrappers.h: x11vnc:
-	small tweaks to Xdummy, rx11vnc*.  Apply SMALL_FOOTPRINT to
-	-appshare text.  Copyright year change.
-
-2010-01-02  runge <runge at karlrunge.com>
-
-	* libvncserver/tightvnc-filetransfer/rfbtightserver.c: year++;
-
-2010-01-02  runge <runge at karlrunge.com>
-
-	* ChangeLog, libvncserver/tightvnc-filetransfer/rfbtightserver.c: 
-	tightvnc-filetransfer/rfbtightserver.c: enabled fix for tight
-	security type for RFB 3.8 (debian bug 517422.)
-
-2010-01-01  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c, libvncclient/vncviewer.c,
-	rfb/rfbclient.h: Add support for viewers to select security types on
-	demand Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2009-12-29  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/misc/Xdummy, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: rename -create_x to -create_xsrv.
-	Hopefully done fixing Xdummy.
-
-2009-12-28  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/appshare.c,
-	x11vnc/misc/Xdummy, x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/remote.c, x11vnc/solid.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: Fix problems in
-	--without-x builds.  Fix crash with -QD query for dbus info.  Adjust
-	window size for small screens in -gui.  Improve F1 help for xdm,
-	etc.  include ssvnc 1.0.25 source.
-
-2009-12-24  runge <runge at karlrunge.com>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/help.c, x11vnc/misc/Xdummy, x11vnc/ssltools.h,
-	x11vnc/unixpw.c, x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: prepare_x11vnc_dist.sh for 0.9.10.
-	        -xdummy_xvfb, -svc_xdummy_xvfb and -create_x shorthand. lxde
-	        session.  Xdummy improvements and root no longer required.
-
-2009-12-20  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c: Fix version checking (>=3.8) for
-	rfbVncAuthOK confirmation when no password required It seems that vino does not send AuthOK  when there is no password
-	with anonymous TLS, and it seems that vino is the only <3.8 VNC
-	server that handles anonymous TLS at all, so let's not wait for the
-	packet that will never come.  Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2009-12-21  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/sslhelper.c,
-	x11vnc/ssltools.h, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: -DENC_HAVE_OPENSSL=0 to disable enc.h
-	        but still have ssl. Tweak ps command in find_display. Try to handle         AIX su. Ignore an initial newline at login: for -unixpw.
-
-2009-12-18  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog: ChangeLog typo
-
-2009-12-18  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/unixpw.c,
-	x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: Add tag=... to unixpw opts to set FD_TAG.
-	Prefer Xvfb over Xdummy.  Reduce wait time for https. Add 'Login
-	succeeded' output to unixpw panel.
-
-2009-12-18  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/remote.c, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: fix keycode and other
-	        remote control actions under DIRECT: with an extra XFlush and other
-	        safety measures.  fflush(stderr) much in su_verify.  Make the
-	        -unixpw env. vars UNIXPW_DISABLE_SSL and UNIXPW_DISABLE_LOCALHOST
-	        work correctly.  Make -loopbg actually imply -bg.
-
-2009-12-15  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/inet.c,
-	x11vnc/misc/Makefile.am, x11vnc/misc/connect_switch,
-	x11vnc/misc/ultravnc_repeater.pl, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/pointer.c, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/ssltools.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xdamage.c, x11vnc/xevents.c: X props names via env var.
-	fakebuttonevent action, connect_switch and ultravnc_repeater.pl
-	scripts, find_display try FD_XDM on failure, -quiet and -storepasswd
-	changes, better port 113 testing.
-
-2009-12-07  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c, x11vnc/help.c,
-	x11vnc/remote.c, x11vnc/screen.c, x11vnc/sslhelper.c,
-	x11vnc/ssltools.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: X11VNC_EXTRA_HTTPS_PARAMS,
-	X11VNC_HTTP_LISTEN_LOCALHOST, X11VNC_REOPEN_SLEEP_MAX,
-	-findauth/-auth guess FD_XDM=1 for root, work around xhost
-	SI:localuser:root.
-
-2009-12-05  runge <runge at karlrunge.com>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/appshare.c, x11vnc/gui.c,
-	x11vnc/unixpw.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: Update java
-	and scripts in classes/ssl.  x11vnc: declare crypt() on all
-	platforms.  more wishes.
-
-2009-12-02  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/README,
-	x11vnc/appshare.c, x11vnc/connections.c, x11vnc/cursor.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/pm.c, x11vnc/pointer.c, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/sslhelper.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/util.c, x11vnc/util.h,
-	x11vnc/win_utils.c, x11vnc/win_utils.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xinerama.c, x11vnc/xrandr.c: x11vnc: -appshare mode for
-	sharing an application windows instead of the entire desktop. map
-	port + 5500 in reverse connect.  Add id_cmd remote control functions
-	for id (and other) windows.  Allow zero port in SSL reverse
-	connections.  Adjust delays between multiple reverse connections;
-	X11VNC_REVERSE_SLEEP_MAX env var.  Add some missing mutex locks; add
-	INPUT_LOCK and threads_drop_input.  More safety in -threads mode for
-	new framebuffer change.  Fix some stderr leaking in -inetd mode.
-
-2009-12-01  runge <runge at karlrunge.com>
-
-	* libvncserver/cursor.c, libvncserver/sockets.c,
-	libvncserver/translate.c: Add locks of updateMutex in
-	rfbRedrawAfterHideCursor() and rfbSetClientColourMap().  Up listen
-	limit from 5 to 32.
-
-2009-11-18  runge <runge at karlrunge.com>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: ssvnc/enhanced_tightvnc_viewer update.
-
-2009-11-18  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/cursor.h,
-	x11vnc/enc.h, x11vnc/help.c, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/selection.c, x11vnc/solid.c, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xevents.h: x11vnc:
-	-findauth, -auth guess, & etc.
-
-2009-11-11  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/listen.c, rfb/rfbclient.h: libvncclient: better
-	return value for non-forking listen.  The return value now better reflects what has happened: 1 on success
-	(incoming connection on listen socket, we accepted it successfully),
-	-1 on error, 0 on timeout.  Also change the select calls to not check _all_ possible file
-	descriptors.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-11-05  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/listen.c, libvncclient/rfbproto.c,
-	libvncclient/vncviewer.c, libvncserver/rfbserver.c: Fix checks for
-	socket values, 0 is a legal value.  To make this work, we also have to initialize sockets to a default
-	value of -1.  Also close a client listen socket if it's open.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-31  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/vncviewer.c: libvncclient: include winsock2.h in
-	vncviewer.c.  fixes warning about closesocket being implicitly declared.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-11-05  Vic Lee <llyzs at 163.com>
-
-	* configure.ac: Change GnuTLS minimum requirement to 2.4.0 Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2009-11-04  Vic Lee <llyzs at 163.com>
-
-	* client_examples/ppmtest.c, examples/example.c,
-	libvncclient/sockets.c, libvncclient/zrle.c, libvncserver/cursor.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c,
-	vncterm/VNConsole.c: Fix various compilation warnings Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-07  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c, libvncserver/vncauth.c, rfb/rfbclient.h,
-	rfb/rfbproto.h: Add MSLogon security type Signed-off-by: Vic Lee <llyzs at 163.com> Signed-off-by: Johannes
-	Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-31  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Add Alexander to the authors Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-31  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: don't call clean up
-	the same client twice.  If rfbInitConnection fails, it cleans up the client, so protect
-	against doing it ourselves again.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-30  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: add SIGINT handler
-	to be able to actually stop program.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-26  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: use -listennofork
-	when -listen specified.  As -listen mode isn't really working under UNIX and not at all under
-	windows, use -listennofork and an outer listen loop instead.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-26  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/listen.c, libvncclient/vncviewer.c, rfb/rfbclient.h: 
-	libvncclient: add a non-forking listen function.  Forking the whole process from deep within a library call does not
-	really work at all with apps that use multiple threads, i.e. every
-	reasonably modern GUI app. So, provide a non-forking listen function
-	so that the caller can decide if to fork, start a thread, etc.  This implementation adds a timeout parameter to be able to call the
-	listen function multiple times so that it's possible to do sth. else
-	in between, e.g. abort listening.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-21  Christian Beier <dontmind at freeshell.org>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: make listen mode
-	work _somewhat_.  set the port to listen on and really ensure that the window of the
-	fork()ed instance is closed.  works somewhat: it's now actually possible to listen for an incoming
-	connection and to close it again, but the second connection attempt
-	fails with 'XIO:  fatal IO error 11 (Resource temporarily
-	unavailable)'. this could relate to the fact that SDL uses threads
-	internally and we're fork()ing here...  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-30  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/sockets.c: libvncclient: make listenAtTCPPort() work
-	under windows.  Actually, initSockets() has to be called everywhere we possibly use
-	sockets the first time.  Also fix return value of initSockets().  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-30  Alexander Dorokhine <arrenlex at gmail.com>
-
-	* libvncclient/rfbproto.c, libvncclient/vncviewer.c,
-	rfb/rfbclient.h: libvncclient: Add FinishedFrameBufferUpdate
-	callback When working on a program which searches the display for some image,
-	one does not want to search again without getting an FB update.  Add
-	a callback to make this possible.
-
-2009-10-30  Alexander Dorokhine <arrenlex at gmail.com>
-
-	* libvncclient/sockets.c: Fix hostname resolution problems under
-	Windows On Windows, the WSA system needs to be initialized to be able to
-	look up host names.  This patch also changes *addr = 0 to use the constant
-	INADDR_LOOPBACK instead, which seems to be required on Windows.
-
-2009-10-17  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c, x11vnc/help.c,
-	x11vnc/solid.c, x11vnc/sslhelper.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: Workaround for inane
-	X_ShmAttach incompatibility in Xorg, -solid support in xfce,
-	showrfbauth option.
-
-2009-10-08  runge <runge at karlrunge.com>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: Synchronize ssvnc source, etc.   Nearly the 1.0.24
-	release...
-
-2009-10-08  runge <runge at karlrunge.com>
-
-	* classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/connections.h, x11vnc/enc.h, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/params.h, x11vnc/remote.c, x11vnc/remote.h, x11vnc/screen.c,
-	x11vnc/selection.c, x11vnc/selection.h, x11vnc/solid.c,
-	x11vnc/solid.h, x11vnc/sslcmds.c, x11vnc/sslcmds.h,
-	x11vnc/sslhelper.c, x11vnc/sslhelper.h, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/util.c, x11vnc/util.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xdamage.c, x11vnc/xdamage.h, x11vnc/xevents.c,
-	x11vnc/xevents.h, x11vnc/xwrappers.c: Huge number of changes, see
-	x11vnc/ChangeLog
-
-2009-10-07  runge <runge at karlrunge.com>
-
-	* libvncclient/rfbproto.c: Some broken build environments treat
-	fprintf(fh, buf) as a fatal error...
-
-2009-10-07  runge <runge at karlrunge.com>
-
-	* libvncserver/main.c: Some broken build environments treat
-	fprintf(fh, buf) as a fatal error...
-
-2009-10-02  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c, libvncclient/tls.c, rfb/rfbclient.h,
-	rfb/rfbproto.h: Add VeNCrypt support in libvncclient Signed-off-by: Vic Lee <llyzs at 163.com>
-
-2009-10-02  Christian Beier <dontmind at freeshell.org>
-
-	* configure.ac, libvncclient/rfbproto.c, libvncclient/sockets.c,
-	rfb/rfb.h, vncterm/Makefile.am: mingw32 crosscompile fixes.  SOCKET is redefined in winsock2.h so #undef it where winsock2.h is
-	included. The changes in rfbproto.c circumvent crosscompiler errors
-	like 'S_IFMT' undeclared ...', the Makefile.am changes avoid
-	building linux specific stuff for a win32 host target.  Also added
-	configure option to specify sdl-config.  Signed-off-by: Christian Beier <dontmind at freeshell.org>
-	Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-02  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* configure.ac: Fallback to --without-client-tls if GNUTLS could not
-	be found Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-01  Vic Lee <llyzs at 163.com>
-
-	* configure.ac, libvncclient/Makefile.am, libvncclient/rfbproto.c,
-	libvncclient/sockets.c, libvncclient/tls.c, libvncclient/tls.h,
-	libvncclient/vncviewer.c, rfb/rfbclient.h, rfb/rfbproto.h: Add
-	anonymous TLS support in libvncclient Signed-off-by: Vic Lee <llyzs at 163.com>
-
-2009-10-02  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* test/encodingstest.c: encodingstest: fix multi-threading issue Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-02  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* test/encodingstest.c: encodingstest: fix whitespace Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-02  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Add Christian Beier to the AUTHORS Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-10-02  Christian Beier <dontmind at freeshell.org>
-
-	* libvncclient/rfbproto.c: Fix IsUnixSocket() This is a pure functionality fix: according to its manpage, stat()
-	returns 0 on success. Checking for a return value of zero fixes
-	incorrect results of IsUnixSocket().  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-09-27  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Add Vic Lee to the author list Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-09-14  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c: Fix bug for logging unsupported security
-	types Signed-off-by: Vic Lee <llyzs at 163.com>
-
-2009-09-14  Vic Lee <llyzs at 163.com>
-
-	* libvncclient/rfbproto.c: Fix bug for VNC Server version 4 Signed-off-by: Vic Lee <llyzs at 163.com>
-
-2009-08-10  runge <runge at karlrunge.com>
-
-	* x11vnc/README, x11vnc/connections.c, x11vnc/enc.h, x11vnc/help.c,
-	x11vnc/pointer.c, x11vnc/unixpw.c, x11vnc/unixpw.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: Improvements
-	to -unixpw_cmd and -unixpw_nis.  Experimental X11VNC_WATCH_DX_DY=1
-	for buggy theme menus, see:
-	http://ubuntuforums.org/showthread.php?t=1223490
-
-2009-07-11  runge <runge at karlrunge.com>
-
-	* prepare_x11vnc_dist.sh, x11vnc/README, x11vnc/help.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: Setup for x11vnc version
-	0.9.9
-
-2009-06-19  runge <runge at karlrunge.com>
-
-	* classes/ssl/README,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch, x11vnc/README: 
-	Add proxyHost and proxyPort java applet params.
-
-2009-06-18  runge <runge at karlrunge.com>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/README.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: classes/ssl: java viewer now handles auth-basic proxy
-	logins.  misc/enhanced_tightvnc_viewer: update ssvnc.
-
-2009-06-16  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* libvncclient/vncviewer.c: Fix two issues in rfbGetClient() There was an unnecessary assignment, and an assignment of a string
-	that was to be free()ed later, so it has to be strdup()ed.  Both issues spotted by Roman Held.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-06-14  runge <runge at karlrunge.com>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/screen.c, x11vnc/sslhelper.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: 
-	X11VNC_REFLECT_PASSWORD env. var., warning about compiz, improve
-	single-port.
-
-2009-05-22  Stefan Becker <stefanb2 at users.sourceforge.net>
-
-	* libvncclient/vncviewer.c: Add close() to rfbClientCleanup() Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-05-21  runge <runge at karlrunge.com>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/cursor.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/misc/turbovnc/convert,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/rates.c,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/util.c, x11vnc/util.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xrecord.c, x11vnc/xwrappers.c: Thread safety.  Fix -clip -in
-	-rawfb.  Try to avoid Xorg stuck key bug.
-
-2009-05-21  runge <runge at karlrunge.com>
-
-	* ChangeLog, configure.ac, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/tight.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c,
-	libvncserver/zlib.c, libvncserver/zrle.c,
-	libvncserver/zrleencodetemplate.c, rfb/rfb.h: Thread safety for
-	zrle, zlib, tight.  Proposed tight security type fix for debian bug
-	517422.
-
-2009-05-20  llyzs <llyzs at 163.com>
-
-	* rfb/rfbclient.h: Export the functions SupportsClient2Server and
-	SupportsServer2Client These are useful functions for VNC clients, so let's export them for
-	everybody to use.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-05-12  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* AUTHORS: Add Ben to the authors Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-05-12  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* autogen.sh: Make autogen.sh executable Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-05-12  Ben Klopfenstein <benklop at gmail.com>
-
-	* libvncclient/rfbproto.c, libvncclient/sockets.c, rfb/rfbclient.h: 
-	libvncclient: Unix sockets support by Ben Klopfenstein Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-31  runge <runge at karlrunge.com>
-
-	* x11vnc/README, x11vnc/connections.c, x11vnc/connections.h,
-	x11vnc/screen.c, x11vnc/x11vnc.1, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: rebuild for x11vnc dev 0.9.8
-
-2009-03-31  runge <runge at karlrunge.com>
-
-	* prepare_x11vnc_dist.sh: x11vnc 0.9.8 dev
-
-2009-03-30  Johannes Schindelin <johannes.schindelin at gmx.de>
-
-	* success.html: Add LCD4Linux to the success stories Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-16  runge <runge at karlrunge.com>
-
-	* x11vnc/README, x11vnc/enc.h, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/util.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: Add some -remap tricks.  Limit rfbCFD message
-	count.
-
-2009-03-14  runge <runge at karlrunge.com>
-
-	* x11vnc/8to24.c, x11vnc/8to24.h, x11vnc/README,
-	x11vnc/allowed_input_t.h, x11vnc/avahi.c, x11vnc/avahi.h,
-	x11vnc/blackout_t.h, x11vnc/cleanup.c, x11vnc/cleanup.h,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/cursor.c,
-	x11vnc/cursor.h, x11vnc/enc.h, x11vnc/enums.h, x11vnc/gui.c,
-	x11vnc/gui.h, x11vnc/help.c, x11vnc/help.h, x11vnc/inet.c,
-	x11vnc/inet.h, x11vnc/keyboard.c, x11vnc/keyboard.h,
-	x11vnc/linuxfb.c, x11vnc/linuxfb.h, x11vnc/macosx.c,
-	x11vnc/macosx.h, x11vnc/macosxCG.c, x11vnc/macosxCG.h,
-	x11vnc/macosxCGP.c, x11vnc/macosxCGP.h, x11vnc/macosxCGS.c,
-	x11vnc/macosxCGS.h, x11vnc/misc/LICENSE,
-	x11vnc/misc/turbovnc/Makefile.am, x11vnc/misc/turbovnc/README,
-	x11vnc/misc/turbovnc/apply_turbovnc, x11vnc/misc/turbovnc/convert,
-	x11vnc/misc/turbovnc/convert_rfbserver,
-	x11vnc/misc/turbovnc/undo_turbovnc, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/params.h, x11vnc/pm.c, x11vnc/pm.h,
-	x11vnc/pointer.c, x11vnc/pointer.h, x11vnc/rates.c, x11vnc/rates.h,
-	x11vnc/remote.c, x11vnc/remote.h, x11vnc/scan.c, x11vnc/scan.h,
-	x11vnc/screen.c, x11vnc/screen.h, x11vnc/scrollevent_t.h,
-	x11vnc/selection.c, x11vnc/selection.h, x11vnc/solid.c,
-	x11vnc/solid.h, x11vnc/sslcmds.c, x11vnc/sslcmds.h,
-	x11vnc/sslhelper.c, x11vnc/sslhelper.h, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/uinput.c,
-	x11vnc/uinput.h, x11vnc/unixpw.c, x11vnc/unixpw.h, x11vnc/user.c,
-	x11vnc/user.h, x11vnc/userinput.c, x11vnc/userinput.h,
-	x11vnc/util.c, x11vnc/util.h, x11vnc/v4l.c, x11vnc/v4l.h,
-	x11vnc/win_utils.c, x11vnc/win_utils.h, x11vnc/winattr_t.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c, x11vnc/xdamage.h,
-	x11vnc/xevents.c, x11vnc/xevents.h, x11vnc/xinerama.c,
-	x11vnc/xinerama.h, x11vnc/xkb_bell.c, x11vnc/xkb_bell.h,
-	x11vnc/xrandr.c, x11vnc/xrandr.h, x11vnc/xrecord.c,
-	x11vnc/xrecord.h, x11vnc/xwrappers.c, x11vnc/xwrappers.h: Insert
-	x11vnc copyright and license notices.
-
-2009-03-14  runge <runge at karlrunge.com>
-
-	* x11vnc/README: Test git commit setting username & etc.
-
-2009-03-14  Karl J. Runge <runge at haystack.runge.home>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: Tweak settings and docs for
-	create_display.  Add FD_EXTRA finishing cmd.
-
-2009-03-13  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/screen.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: Fix off-screen bug for -ncache_cr
-	copyrect.
-
-2009-03-12  dscho <dscho>
-
-	* ChangeLog, client_examples/SDLvncviewer.c: Teach SDLvncviewer
-	about scroll wheel events Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-12  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: fix passing a wrong
-	pointer type Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-08  dscho <dscho>
-
-	* ChangeLog, client_examples/Makefile.am,
-	client_examples/SDLvncviewer.c, client_examples/scrap.c,
-	client_examples/scrap.h: Clipboard support for SDLvncviewer The clipboard support has only been tested on Linux so far.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-07  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/misc/turbovnc/Makefile.am,
-	x11vnc/misc/turbovnc/README, x11vnc/misc/turbovnc/apply_turbovnc,
-	x11vnc/misc/turbovnc/convert,
-	x11vnc/misc/turbovnc/convert_rfbserver,
-	x11vnc/misc/turbovnc/undo_turbovnc, x11vnc/scan.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/user.h, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: Allow range
-	for X11VNC_SKIP_DISPLAY, document grab Xserver issue.  Add
-	progress_client() to proceed more quickly thru handshake.
-	Improvements to turbovnc hack.
-
-2009-03-07  dscho <dscho>
-
-	* ChangeLog, TODO, client_examples/SDLvncviewer.c: SDLvncviewer:
-	upon focus loss, force releasing the Alt keys When switching windows using the Alt+Tab shortcut, SDLvncviewer
-	would get the "down" event, but not the "up" event.  This patch
-	provides a workaround.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-07  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: refactor event
-	handling Instead of having deep indent levels, put the code to handle events
-	into its own function.  That also helps readability.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-07  dscho <dscho>
-
-	* TODO: Update SDLvncviewer TODOs Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-07  dscho <dscho>
-
-	* ChangeLog, client_examples/SDLvncviewer.c: Teach SDLvncviewer to
-	be resizable Using "SDLvncviewer -resizable", you make the window resizable.
-	This means that you can shrink the window (e.g. when you are trying
-	to access an x11vnc from your little netbook), or you can enlarge
-	it.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-03-06  dscho <dscho>
-
-	* ChangeLog, TODO, client_examples/SDLvncviewer.c: SDLvncviewer:
-	enable key repeat Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-02-28  runge <runge>
-
-	* configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/misc/Makefile.am, x11vnc/misc/turbovnc/Makefile.am,
-	x11vnc/misc/turbovnc/README, x11vnc/misc/turbovnc/apply_turbovnc,
-	x11vnc/misc/turbovnc/convert, x11vnc/misc/turbovnc/tight.c,
-	x11vnc/misc/turbovnc/turbojpeg.h,
-	x11vnc/misc/turbovnc/undo_turbovnc: x11vnc: add kludge to experiment
-	with turbovnc.
-
-2009-02-26  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/remote.c,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: fix some -QD cases for use in
-	tkx11vnc.
-
-2009-02-22  runge <runge>
-
-	* x11vnc/README, x11vnc/avahi.c, x11vnc/enc.h, x11vnc/selection.c: 
-	fix some compiler warnings.
-
-2009-02-22  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: add -noskip_lockkeys option
-	for future use.
-
-2009-02-04  runge <runge>
-
-	* classes/ssl/README,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/selection.c, x11vnc/sslhelper.c,
-	x11vnc/ssltools.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xwrappers.c: x11vnc: Add "sendbell"
-	remote cmd.  Fix copyrect updates under -reflect.  Workaround that
-	checks valid window of selection requestor.  Wait on some ssl helper
-	pids earlier.  Workaround XAUTHLOCALHOSTNAME for some new usage
-	modes.  Set fake fb to requested bpp with correct masks.  -padgeom
-	once:... mode.  Set LIBXCB_ALLOW_SLOPPY_LOCK by default.
-	rfbRandomBytes earlier.  classes/ssl: Update jars.  Add "TOP_"
-	dropdown customization to ultravnc java viewer applet FTP panel.
-
-2009-02-03  dscho <dscho>
-
-	* test/Makefile.am: test/Makefile: use check_PROGRAMS Rather than use noinst_PROGRAMS, check_PROGRAMS will define programs
-	that are only compiled when someone actually runs `make check`.  Signed-off-by: Mike Frysinger <vapier at gentoo.org> Signed-off-by:
-	Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-02-03  dscho <dscho>
-
-	* ChangeLog: Record Mike's automake cleanups Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-02-03  dscho <dscho>
-
-	* Makefile.am, client_examples/Makefile.am, configure.ac,
-	contrib/Makefile.am, examples/Makefile.am,
-	libvncclient/Makefile.am, libvncserver/Makefile.am,
-	test/Makefile.am, vncterm/Makefile.am, x11vnc/Makefile.am: clean up
-	build flags The flag handling (both compiler options and include paths) are a
-	mess at the moment.  There is no point in forcing "-O2 -g" when
-	these are already the defaults, and if someone changes the defaults,
-	chances are good they don't want you clobbering their choices.  The -Wall flag should be handled in configure and thrown into CFLAGS
-	once rather than every Makefile.am.  Plus, this way we can control
-	which compilers the flag actually gets used with.  Finally, the INCLUDES variable is for -I paths, not AM_CFLAGS.  Nor
-	should it contain -I. as this is already in the default includes
-	setup.  Signed-off-by: Mike Frysinger <vapier at gentoo.org> Signed-off-by:
-	Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-02-03  dscho <dscho>
-
-	* configure.ac: configure: use _cv_ in cache var name Newer autoconf fails if _cv_ is not in the cache var name.  Signed-off-by: Mike Frysinger <vapier at gentoo.org> Signed-off-by:
-	Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-02-03  dscho <dscho>
-
-	* configure.ac: configure: use AM_PROG_CC_C_O Newer automakes error out due to per-file CFLAGS being used unless
-	the macro AM_PROG_CC_C_O is set in configure.ac.  [jes: The macro AM_PROG_CC_C_O has been around since 1999, so it
-	 should be safe.] Signed-off-by: Mike Frysinger <vapier at gentoo.org> Signed-off-by:
-	Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-02-03  dscho <dscho>
-
-	* autogen.sh: autogen.sh: run with set -e If any autotool command fails, we want to abort, not keep running.
-	Otherwise, errors in say a Makefile.am will be missed as the
-	automake failure gets ignored and then lost in the noise.  Signed-off-by: Mike Frysinger <vapier at gentoo.org> Signed-off-by:
-	Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2009-01-12  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: SSVNC 1.0.22 release (+ a little bit more).  crl lists,
-	ssh pid finding improvements, and more.
-
-2009-01-12  runge <runge>
-
-	* CMakeLists.txt, ChangeLog, configure.ac: configure.ac,
-	CMakeLists.txt: set LibVNCServer version to 0.9.7
-
-2009-01-12  runge <runge>
-
-	* classes/ssl/README, classes/ssl/ss_vncviewer,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: classes/ssl: Add configurable Ultra java
-	applet Filexfer Drives drop down (e.g.
-	ftpDropDown=Home.Desktop.bin).  Document all applet parameters in
-	classes/ssl/README.
-
-2009-01-11  runge <runge>
-
-	* ChangeLog: Forgot ChangeLog
-
-2009-01-11  runge <runge>
-
-	* prepare_x11vnc_dist.sh: prepare_x11vnc_dist.sh: fix SUBDIRS and
-	DIST_SUBDRIS when using --with-system-libvncserver
-
-2009-01-10  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README, x11vnc/screen.c,
-	x11vnc/selection.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c,
-	x11vnc/xrecord.c: x11vnc: fix failure of -8to24 on default depth 24
-	due to nonstandard indexed color support changes.  Fix small window
-	for failure after XSendEvent selection call; add env var.
-	X11VNC_SENDEVENT_SYNC=1 to take even more care.
-
-2009-01-04  runge <runge>
-
-	* x11vnc/README, x11vnc/avahi.c, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/enc.h,
-	x11vnc/gui.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/solid.c,
-	x11vnc/sslhelper.c, x11vnc/x11vnc.c, x11vnc/xwrappers.c: x11vnc: fix
-	compiler warnings.
-
-2009-01-04  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/linuxfb.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pointer.c,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/v4l.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xwrappers.c: x11vnc:
-	add -rmflag option, -rawfb vt support, bpp < 8 support for rawfb,
-	find /dev/video better. Fix reverse SSL connection for DH.  Some
-	improvements for CUPS TS helper, restart if needed.
-
-2009-01-04  runge <runge>
-
-	* configure.ac, prepare_x11vnc_dist.sh: configure.ac: add include
-	file file for libXrandr on Solaris.  prepare_x11vnc_dist.sh: set
-	version to 0.9.7
-
-2008-12-10  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/options.c, x11vnc/options.h, x11vnc/params.h,
-	x11vnc/remote.c, x11vnc/sslhelper.c, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/util.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: 0.9.6 release.  Some
-	strtok bugfixes. rename -tlsvnc to -anontls.  Disable ssl caching.
-	No cert creation prompting in inetd or bg modes.  waitpid a bit more
-	carefully on ssl helpers.  Tune ssl initial timeouts.  Let -create
-	user specify starting X display.  fix -rfbport prompt gui for older
-	tk.  -sslonly option. Error if no -ssl with related options. -rand
-	option.  -ssl implies -ssl SAVE
-
-2008-11-22  runge <runge>
-
-	* classes/ssl/ss_vncviewer: Update ss_vncviewer...
-
-2008-11-22  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.pa
-	tch,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/misc/enhanced_tightvnc_viewer/ssvnc.desktop: SSVNC
-	  sync: stunnel upgrade and patch, change wish order, -anondh -ciphers
-	  option VeNCrypt and TLSVNC support (in pproxy and unix vncviewer).
-	  Help text tweaks -killstunnel, s_client fixes, No Encryption easier.
-	  Zeroconf/avahi support.  tk font fixes. SSVNC_ULTRA_FTP_JAR finding
-	  SSVNC_PREDIGESTED_HANDSHAKE SSVNC_SKIP_RFB_PROTOCOL_VERSION,
-	SSVNC_SET_SECURITY_TYPE, etc hacks.
-
-2008-11-22  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/README,
-	x11vnc/avahi.c, x11vnc/cleanup.c, x11vnc/connections.c,
-	x11vnc/gui.c, x11vnc/help.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/params.h, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/sslcmds.c, x11vnc/sslhelper.c, x11vnc/sslhelper.h,
-	x11vnc/ssltools.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/unixpw.h, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.desktop,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xdamage.c,
-	x11vnc/xdamage.h, x11vnc/xevents.c, x11vnc/xrecord.c,
-	x11vnc/xrecord.h, x11vnc/xwrappers.c: x11vnc: x11vnc.desktop file.
-	  -reopen, -dhparams, -sslCRL, -setdefer options. -rfbport PROMPT
-	  VeNCrypt and TLSVNC SSL/TLS encryption support.  Tweaks to
-	  choose_delay() algorithm.  -ssl ANON anonymouse Diffie-Hellman mode.
-	  Fix bugs in certs management.  Additions to tray=setpass naive user
-	mode.
-
-2008-11-05  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/avahi.c,
-	x11vnc/cleanup.c, x11vnc/cleanup.h, x11vnc/help.c,
-	x11vnc/macosxCG.c, x11vnc/rates.c, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/solid.c, x11vnc/sslhelper.c,
-	x11vnc/ssltools.h, x11vnc/userinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c: x11vnc: add zeroconf external helpers
-	(avahi-publish and dns-sd).  Alias -zeroconf.  Close pipeinput_fh on
-	exit.  Kludge to make -solid work on MacOSX console.  Attempt at cpp
-	macros to disable newer libvncserver interfaces.
-
-2008-11-05  runge <runge>
-
-	* configure.ac: Tweak messages.  Add shmat for --without-x building.
-
-2008-10-30  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: synchronize ssvnc
-
-2008-10-29  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/help.c, x11vnc/nox11.h, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c, x11vnc/xevents.c: x11vnc:
-	-http_oneport for single port HTTP and VNC. Improve find_display wrt
-	lsof blocking with -b.
-
-2008-10-19  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vnc
-	viewer.sh, x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: Sync SSVNC changes: fullscreen fixes, local scaling,
-	-chatonly, iso-8859-1/utf8 etc., etc.
-
-2008-10-19  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: Update ssl VNC
-	viewer jars and patch file.
-
-2008-10-19  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/cleanup.c, x11vnc/connections.c, x11vnc/connections.h,
-	x11vnc/cursor.c, x11vnc/enc.h, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/linuxfb.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/scan.h, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/selection.c, x11vnc/solid.c,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xinerama.c, x11vnc/xrandr.c, x11vnc/xrandr.h,
-	x11vnc/xrecord.c, x11vnc/xwrappers.c, x11vnc/xwrappers.h: x11vnc:
-	-chatwindow, -scale WxH, -enc changes.
-
-2008-09-21  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/Makefile.am,
-	x11vnc/README, x11vnc/enc.h, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pointer.c,
-	x11vnc/screen.c, x11vnc/sslhelper.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/util.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: Add symmetric key encryption -enc
-	cipher:keyfile, works with SSVNC.  Make -remap work on MacOSX
-	console.  update to 0.9.5 strings.  Add a couple menu items to
-	tkx11vnc.
-
-2008-09-17  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/sslhelper.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: make -allow work in -ssl mode.
-
-2008-09-14  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/gui.c, x11vnc/help.c,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/userinput.c, x11vnc/util.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc:
-	-sleepin m-n for random sleep. More mktemp and mkstemp protections.
-	SSL_INIT_TIMEOUT=n env. var.  Fix macosx console X call bug.
-	Synchronize other projects sources.
-
-2008-09-07  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch, x11vnc/8to24.c,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/gui.c, x11vnc/gui.h, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/macosxCG.c, x11vnc/macosxCG.h,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/sshvnc.bat,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/tsvnc.bat,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/sshvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/tsvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvnc.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/options.c, x11vnc/options.h, x11vnc/pointer.c,
-	x11vnc/remote.c, x11vnc/solid.c, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xevents.h, x11vnc/xinerama.c, x11vnc/xinerama.h: x11vnc: kill
-	   gui_pid on exit in -connect/-connect_or_exit mode.  -grablocal n
-	   experiment (not compiled by default).  -macuskbd option for macosx
-	   for orig uskdb code. keycode=N remote contol cmd.  Find dpy look at
-	   non-NFS cookies in /tmp.  Fix gui tray insertion on recent gnome dt.
-	Fix connect_file bug. Sync SSVNC
-
-2008-06-24  runge <runge>
-
-	* libvncserver/rfbserver.c: We seem to need to guard against freeing
-	iterator 'i' twice in rfbSendFramebufferUpdate()  (italc reported
-	bug)
-
-2008-06-07  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/unixpw.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xinerama.c: x11vnc: -clip xineramaN option, -DIGNORE_GETSPNAM
-	          for HP-UX.  Print info on SSH_CONNECTION override.
-
-2008-06-03  dscho <dscho>
-
-	* ChangeLog, client_examples/SDLvncviewer.c: SDLvncviewer: update
-	screen correctly after a resize Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-06-03  runge <runge>
-
-	* configure.ac: Enable --with-ssl=DIR option.
-
-2008-06-01  runge <runge>
-
-	* x11vnc/README, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc:
-	lower waitms and defer if framebuffer reads are fast (> 100MB/s)
-
-2008-06-01  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/misc/Xdummy, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/scan.c, x11vnc/screen.c, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xinerama.c: x11vnc: support colormaps for depths other than
-	8.  xinerama warppointer only if more than one subscreen.
-
-2008-05-31  dscho <dscho>
-
-	* .gitignore: .gitignore: ignore also temporary editor files Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-31  dscho <dscho>
-
-	* VisualNaCro/.gitignore: VisualNaCro: add .gitignore file Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-31  dscho <dscho>
-
-	* VisualNaCro/configure.ac: VisualNaCro: fix configure.ac There was a misunderstanding as to the workings of AC_CHECK_PROG().  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-31  dscho <dscho>
-
-	* TODO: Update TODOs Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-31  dscho <dscho>
-
-	* libvncserver-config.in: Fix libvncserver-config for in-place
-	operation Since quite some time, the linkable libraries are stored in the
-	.libs/ subdirectories.  Adjust libvncserver-config to account for
-	that when running without installing.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-23  runge <runge>
-
-	* libvncserver/rfbserver.c: Handle colormaps with more than 256
-	colors.
-
-2008-05-13  dscho <dscho>
-
-	* examples/mac.c: examples/mac: disable the cursor We cannot write access the frame buffer, and we do not have a
-	sensible cursor anyway, so better disable the cursor (which would
-	have to be drawn for clients that do not support
-	CursorShapeUpdates).  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-13  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: SDLvncviewer: add -viewonly Just like its siblings from other projects, SDLvncviewer now
-	supports viewonly connections.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-05-12  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/selection.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: SSL fixes.  Increase cert lifetimes to
-	2 years.  Print ssl err msg.
-
-2008-05-12  runge <runge>
-
-	* configure.ac: Add X509_print_ex_fp check for x11vnc.
-
-2008-05-12  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: Many improvement to the frontend and unix viewer.
-	UltraVNC proxy support, and other proxy improvements.
-
-2008-05-08  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/gui.c, x11vnc/help.c, x11vnc/options.c, x11vnc/scan.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: add UltraVNC repeater proxy support.
-	        fix to setp gui mode. -threads is now strongly discouraged.  Read
-	        PORT= in url.  User can set nolisten for Xvfb in -create mode.
-	        clean up wait_for_client() to some degree.
-
-2008-05-08  runge <runge>
-
-	* classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: Add check for
-	"https" to viewers.  update jars.
-
-2008-04-28  dscho <dscho>
-
-	* rfb/rfbclient.h: Fix compilation in the absence of libjpeg The JPEG library is not necessarily installed everywhere, and
-	sometimes it is outright undesirable to compile with JPEG support,
-	e.g. when the server is not very fast.  So fix the compilation for
-	that case.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-03-21  dscho <dscho>
-
-	* TODO: Update TODOs Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-18  dscho <dscho>
-
-	* ChangeLog, libvncserver/rfbregion.c: Please MS Visual C++ a bit
-	(Christian Ehrlicher) Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-18  runge <runge>
-
-	* classes/ssl/ss_vncviewer, x11vnc/README: Update ssl jars.
-
-2008-02-18  runge <runge>
-
-	* x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: changes for
-	release
-
-2008-02-18  runge <runge>
-
-	* x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: minor date changes.
-
-2008-02-18  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: ssvnc sync with zywrle support and improvements to popup.
-
-2008-02-04  dscho <dscho>
-
-	* ChangeLog, libvncclient/rfbproto.c, libvncclient/zrle.c: ZYWRLE
-	patch for libvncclient (thanks Noriaki Yamazaki) Highlite:  * use qualityLevel/zlib_buffer. No new variable is needed.   * Change coding style to recursive fashion.   * Change meaning of qualityLevel== 9 for easy calc zywrle_level:      old:zywrle_level== 1      new:disable ZYWRLE(same as ZRLE)    so, we should not use this value for compatible reason.   * Color mode handling isn't complete.     I provided and checked 16 bit colors(RGB555,RGB565) and    some color mode of 32 bit colors  [...]
-
-2008-02-04  dscho <dscho>
-
-	* ChangeLog, libvncserver/zywrletemplate.c: Fix ZYWRLE en/decoding
-	for width != scanline (thanks Noriaki Yamazaki) Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-03  runge <runge>
-
-	* libvncserver/stats.c: Add ZYWRLE to server printout.
-
-2008-02-02  dscho <dscho>
-
-	* ChangeLog, TODO, client_examples/SDLvncviewer.c: SDLvncviewer: fix
-	button handling For some reason, I swapped buttons 2 and 3 on Dec 7, 2005, in commit
-	"translate keys based on unicode (much more reliable than sym)".  I
-	do not remember why, nor what I smoked, but this was wrong.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-02  dscho <dscho>
-
-	* TODO, client_examples/SDLvncviewer.c: SDLvncviewer: fix
-	Ctrl+<letter> Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-02  dscho <dscho>
-
-	* TODO, client_examples/SDLvncviewer.c: SDLvncviewer: fix
-	translation of the Tab key Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-02  dscho <dscho>
-
-	* TODO: Updated TODOs Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-02-01  runge <runge>
-
-	* libvncserver/Makefile.am: Need to include zywrletemplate.c in
-	Makefile.am
-
-2008-02-01  runge <runge>
-
-	* classes/ssl/ss_vncviewer: sync java viewer.
-
-2008-02-01  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/rates.c, x11vnc/ssltools.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc: during speeds
-	estimate, guard against client disconnecting.
-
-2008-01-31  dscho <dscho>
-
-	* libvncserver/rfbserver.c: Fix rfbSendSupportedEncodings There was a long standing TODO to make the counting of the supported
-	encodings dynamic.  It never triggered, until ZYWRLE was added.  Noticed by Christian Ehrlicher.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-31  dscho <dscho>
-
-	* Makefile.am, configure.ac: Recurse into subdirectory x11vnc/ when
-	configuring with --with-x11vnc Since we separated the packages LibVNCServer and x11vnc, there is a
-	configure switch --with-x11vnc, without which x11vnc is not built.  However, even _with_ this switch, it is not built, because the
-	Makefile would not recurse into the x11vnc/ subdirectory.  Fix that.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-31  dscho <dscho>
-
-	* libvncserver/rfbserver.c: Fix Swap16IfLE() on bytes When swapping the values for the colour table to little-endian
-	(because they are 16-bit values), we need to cast "unsigned char" to
-	"unsigned short"; otherwise, Microsoft's compiler would keep
-	complaining.  Noticed by Christian Ehrlicher.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-31  dscho <dscho>
-
-	* libvncserver/rfbserver.c, rfb/rfb.h: Move tightQualityLevel out of
-	the JPEG specific part The variable tightQualityLevel is used for ZYWRLE compression, too,
-	so if libjpeg is not present, but libz is, we still need to have
-	that struct member.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-30  dscho <dscho>
-
-	* libvncserver/zrle.c, libvncserver/zrleencodetemplate.c, rfb/rfb.h: 
-	Make ZYWRLE thread-safe for multiple clients ZYWRLE used a static buffer, which does not work too well if you
-	have more than one client in a threaded server.  Instead, we have
-	the data in the client structure now.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-30  dscho <dscho>
-
-	* libvncserver/zrle.c, libvncserver/zywrletemplate.c: ZYWRLE brown
-	paper bag fix While adjusting the coding style, three stupid mistakes happened.
-	The quality is _not_ just 1, 2, 3, but really 1, 3, 2.  And the
-	macros ZYWRLE_PACK_COEFF() and ZYWRLE_UNPACK_COEFF() expand to more
-	than one statement, which means that we need curly brackets around
-	them when they are in an if clause.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-29  dscho <dscho>
-
-	* TODO: Update TODOs Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-29  dscho <dscho>
-
-	* .gitignore: Add a .gitignore file At least one developer (me) uses git to work on local branches, and
-	this file does not hurt.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-29  dscho <dscho>
-
-	* ChangeLog, libvncserver/rfbserver.c: Add missing #include <time.h>
-	(thanks Christian Ehrlicher) Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-29  dscho <dscho>
-
-	* AUTHORS, ChangeLog, libvncserver/rfbserver.c,
-	libvncserver/scale.c, libvncserver/zrle.c,
-	libvncserver/zrleencodetemplate.c, libvncserver/zywrletemplate.c,
-	rfb/rfbproto.h: Add ZYWRLE server-side support (thanks Noriaki
-	Yamazaki, Hitachi) Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-29  dscho <dscho>
-
-	* AUTHORS, CMakeLists.txt, ChangeLog, configure.ac,
-	rfb/rfbconfig.h.cmake, rfb/rfbint.h.cmake: Add CMake support (thanks
-	to Christian Ehrlicher) Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2008-01-15  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/scan.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: -ping option, fix memory corruption in
-	copy_tiles after xrandr resize.
-
-2007-12-16  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c, x11vnc/gui.c,
-	x11vnc/macosxCG.c, x11vnc/remote.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: setup remote-ctrl file by default on
-	        macosx. improve tkx11vnc wrt attaching to existing server in
-	icon/tray mode.
-
-2007-12-16  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: Fixes for MacOSX 10.5.  Improve usage of x11 viewer on
-	macosx.
-
-2007-12-16  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/keyboard.c,
-	x11vnc/macosxCG.c, x11vnc/macosxCGS.c, x11vnc/ssltools.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: fix
-	find_display and usleep() prototype on macosx.  -display console and
-	check DISPLAY /tmp/...:0 on macosx.  implement -noxinerama.
-
-2007-11-13  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/keyboard.h, x11vnc/options.c,
-	x11vnc/remote.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: add
-	clear_locks (Caps_Lock, etc) action.
-
-2007-10-27  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle: ssvnc
-	sync: connect_br.tcl socks4/5 http proxies, ss_vncviewer socks5
-	proxy. ssh 1st proxy. whatismyip.com fix. 127.0.0.1 on Darwin
-
-2007-10-27  runge <runge>
-
-	* classes/ssl/ss_vncviewer: ssl java and ss_vncviewer (socks5) sync.
-
-2007-10-27  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/8to24.c, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/cleanup.c, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/macosxCGP.c,
-	x11vnc/macosxCGS.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/remote.c, x11vnc/screen.c, x11vnc/selection.c,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/util.c, x11vnc/win_utils.c,
-	x11vnc/winattr_t.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xrecord.c: x11vnc: -proxy, -ssh
-	options. ncache bug in -8to24, Selection "targets" bugfix.
-
-2007-10-04  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/ssltools.h, x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: add xfce to createdisplay
-
-2007-09-26  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/ssltools.h, x11vnc/user.c, x11vnc/util.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: x11vnc: COLUMNS=256 and other fixes to
-	find/create scripts. More ratecheck.
-
-2007-09-17  dscho <dscho>
-
-	* libvncserver/rfbserver.c: Avoid misaligned access on 64-bit
-	machines We used to assume that a char[256] is properly aligned to be cast to
-	an rfbServerInitMsg, but that was not the case.  So use a union
-	instead.  Noticed by Flavio Leitner.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
-
-2007-09-11  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: update
-	ss_vncviewer script, jars, and patch files.
-
-2007-09-11  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/README.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle: ssvnc:
-	          sshvnc ssh-only, tsvnc Terminal Services modes.  Improvements to
-	          ss_vncviewer.  Automatically find X dpy and X login.  Reorganize
-	menus a bit.  ~/.ssvncrc file.
-
-2007-09-11  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xrecord.c, x11vnc/xwrappers.c: x11vnc:
-	          fix wireframe crash under -clip.  Add -redirect for VNC redir.
-	          -rawfb nullbig, randbig, solid, swirl, etc.  FD_XDM mode to
-	          find_display.  -listdpy.  Add enlightenment.  Xvnc.redirect
-	          FINDDISPLAY-vnc_redirect. -xvnc, -xvnc_redirect, -svc_xvnc.
-	AUTO_PORT.
-
-2007-09-05  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/misc/Xdummy, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/screen.c, x11vnc/solid.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xevents.h, x11vnc/xrandr.c, x11vnc/xwrappers.c: x11vnc:
-	-autoport, -finddpy, -xdummy. watch xrandr events.
-	check_redir_services() utilities for Terminal services.  Improve
-	Xdummy.
-
-2007-09-05  runge <runge>
-
-	* ChangeLog, classes/ssl/Makefile.am, classes/ssl/proxy.vnc,
-	classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	classes/ssl/ultraproxy.vnc,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: classes/ssl:
-	improve timeouts, port fallback, and connection time.
-
-2007-08-19  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/keyboard.c, x11vnc/x11vnc.1: 
-	malloc score_hint and make it shorts to save space.
-
-2007-08-19  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: x11vnc: better -xkb
-	tie-breaking for up keystrokes.  Add Xsrv/FD_XSRV custom server to
-	FINDCREATEDISPLAY list.
-
-2007-08-18  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/solid.c,
-	x11vnc/ssltools.h, x11vnc/user.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: improve FINDCREATEDISPLAY (-create)
-	script, FD_GEOM, FD_SESS, FD_OPTS, FD_PROG env vars, add Xvnc
-	support
-
-2007-08-16  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: x11vnc: add reverse -connect
-	support to -display WAIT:, fix SSL Fetch cert only for -display
-	WAIT:
-
-2007-08-14  dscho <dscho>
-
-	* AUTHORS, ChangeLog, libvncclient/rfbproto.c: LibVNCClient: if the
-	GotRect hook is set, override default op.
-
-2007-08-04  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/solid.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c: x11vnc: -xrefresh,
-	.DCOPserver bug, -unixpw_unsafe ignores SSH tunnel.
-
-2007-08-04  runge <runge>
-
-	* libvncclient/vncviewer.c: argv > 0 doesn't make sense for a
-	pointer; assuming argv != NULL.
-
-2007-07-05  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/scan.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/userinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: -debug_ncache, fix
-	big fonts in tkx11vnc.
-
-2007-07-05  runge <runge>
-
-	* configure.ac, prepare_x11vnc_dist.sh: configure.ac check for
-	external system libvncserver version. set x11vnc version 0.9.3
-
-2007-06-18  runge <runge>
-
-	* x11vnc/README, x11vnc/options.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: set NCACHE -1 for release.
-
-2007-06-15  runge <runge>
-
-	* ChangeLog, classes/ssl/ultra.vnc, classes/ssl/ultrasigned.vnc,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch, configure.ac,
-	x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vnc
-	viewer.sh, x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/options.c, x11vnc/options.h, x11vnc/scan.c,
-	x11vnc/sslhelper.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c: x11vnc: fix build error if libssl is missing or
-	--without-ssl supplied.
-
-2007-05-27  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: sync ssvnc unix viewer diffs; fix X cursor size.
-
-2007-05-27  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: update java viewer and ssvnc.
-
-2007-05-27  runge <runge>
-
-	* configure.ac, x11vnc/README: configure.ac: fix x11vnc
-	--with-system-libvncserver build and add -R link flag.
-
-2007-05-27  runge <runge>
-
-	* libvncserver-config.in: Fix --libs, echo -n doesn't work
-	everywhere.  Question: why -R only for Solaris??
-
-2007-05-27  runge <runge>
-
-	* x11vnc/Makefile.am: clobbered x11vnc/Makefile.am by mistake.
-
-2007-05-27  runge <runge>
-
-	* ChangeLog, Makefile.am, configure.ac, prepare_x11vnc_dist.sh,
-	x11vnc/README: configure: make more of a split between libvncserver
-	and x11vnc pkgs.
-
-2007-05-26  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/help.c, x11vnc/options.c, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: x11vnc: in -unixpw, initial Escape means no
-	echo username.
-
-2007-05-22  runge <runge>
-
-	* classes/ssl/ss_vncviewer: update regular SSL viewer jars; update
-	ss_vncviewer script.
-
-2007-05-22  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: update ssvnc (SSVNC_EXTRA_SLEEP), and unix viewer (1/n
-	menu and chat windows)
-
-2007-05-22  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: set
-	things up (NCACHE = -1) to not have -ncache on by default.
-
-2007-05-19  runge <runge>
-
-	* classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch,
-	libvncserver/rfbserver.c, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: More fixes to ultra java
-	viewer, ultrafilexfer debugging output, fix -loop in .x11vncrc case.
-
-2007-05-17  runge <runge>
-
-	* libvncserver/tightvnc-filetransfer/rfbtightserver.c: Pre-C99
-	declaration error.
-
-2007-05-17  runge <runge>
-
-	* libvncserver/rfbserver.c: In rfbSendFileTransferChunk() check
-	permitFileTransfer 1st to avoid false alarms.
-
-2007-05-16  runge <runge>
-
-	* prepare_x11vnc_dist.sh: Add UltraViewerSSL.jar, etc. to dist list.
-
-2007-05-16  runge <runge>
-
-	* libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c: Add logging
-	output to know when inside tightvnc-filetransfer functions.
-
-2007-05-16  runge <runge>
-
-	* classes/ssl/Makefile.am, classes/ssl/README,
-	classes/ssl/ss_vncviewer, classes/ssl/ultra.vnc,
-	classes/ssl/ultrasigned.vnc,
-	classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch: Add SSL support
-	to UltraVNC Java Viewer (has filetransfer gui).  Fix UltraVNC bugs
-	and improve FTP gui a bit.
-
-2007-05-16  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/sslhelper.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: ssvnc: SOCKS support, PORT=, Verify all Certs
-	and accepted certs logging. x11vnc SSL debugging output.
-
-2007-05-16  runge <runge>
-
-	* libvncserver/rfbserver.c: Drop client if UltraVNC filetransfer is
-	not enabled.
-
-2007-05-07  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle: ssvnc:
-	Home dir changing, skip enc warning, memory stick doc.
-
-2007-05-07  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/options.c,
-	x11vnc/sslhelper.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c: x11vnc: lower -wait and -defer to 20ms. Drop
-	client doing ultravnc stuff in -unixpw during login phase.
-
-2007-05-05  runge <runge>
-
-	* x11vnc/README, x11vnc/connections.c, x11vnc/help.c,
-	x11vnc/remote.c, x11vnc/sslhelper.c, x11vnc/unixpw.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/xevents.c: filexfer
-	warnings and messages.
-
-2007-05-05  runge <runge>
-
-	* configure.ac, x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/user.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc: add
-	groups handling for -users mode.
-
-2007-05-04  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: x11vnc: add WAITBG=1 env.
-	var, add mwm to -create.
-
-2007-05-01  runge <runge>
-
-	* classes/ssl/Makefile.am, classes/ssl/onetimekey,
-	classes/ssl/ss_vncviewer, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/sslhelper.c,
-	x11vnc/ssltools.h, x11vnc/user.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: ssl: java viewer patches, onetimekey; x11vnc
-	setsid/setpgrp and -cc 4 for -create
-
-2007-04-28  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch, x11vnc/options.c, x11vnc/options.h, x11vnc/sslhelper.c,
-	x11vnc/sslhelper.h, x11vnc/ssltools.h, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc:
-	-users sslpeer= option. RFB_SSL_CLIENT_CERT, -ncache 10 default
-
-2007-04-19  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc: set to next release
-	(0.9.1)
-
-2007-04-19  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: Add latest vncviewer patch.
-
-2007-04-19  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/stunnel-server.conf,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle: Sync with
-	SSVNC 1.0.15
-
-2007-04-18  runge <runge>
-
-	* x11vnc/README, x11vnc/userinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc: small changes for 0.9
-	release.
-
-2007-04-08  runge <runge>
-
-	* prepare_x11vnc_dist.sh: change x11vnc version to 0.9
-
-2007-04-07  dscho <dscho>
-
-	* configure.ac: prepare for release of LibVNCServer 0.9
-
-2007-04-07  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/ssltools.h, x11vnc/user.c, x11vnc/userinput.c,
-	x11vnc/x11vnc.1: x11vnc: add gnome, kde, etc. FINDCREATEDISPLAY
-	tags.
-
-2007-04-07  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch: update
-	viewer jars and ss script
-
-2007-04-07  runge <runge>
-
-	* x11vnc/README, x11vnc/connections.c, x11vnc/help.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/v4l.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: java
-	ingoreProxy, fix old libssl free_func problem
-
-2007-04-06  dscho <dscho>
-
-	* AUTHORS, ChangeLog, rfb/rfbclient.h: rfbclient.h: use 'extern "C"'
-	to make it convenient to include from C++
-
-2007-04-06  dscho <dscho>
-
-	* AUTHORS, ChangeLog, rfb/rfb.h: rfb.h: Do not misplace guards This buglet made it impossible to double include rfb.h from C++.
-
-2007-03-30  dscho <dscho>
-
-	* prepare_x11vnc_dist.sh: build x11vnc with static libraries (at
-	least for now) Maybe at a later stage, we want x11vnc to pick up on existing
-	libvncserver.so and libvncclient.so, but right now, x11vnc and the
-	libraries progress together (and thus it is better to build static,
-	necessarily up-to-date libraries for x11vnc).
-
-2007-03-30  dscho <dscho>
-
-	* AUTHORS, ChangeLog, acinclude.m4, client_examples/Makefile.am,
-	configure.ac, contrib/Makefile.am, examples/Makefile.am,
-	libvncclient/Makefile.am, libvncserver/Makefile.am, ltmain.sh,
-	test/Makefile.am, vncterm/Makefile.am, x11vnc/Makefile.am: Build
-	shared libraries per default Thanks to Guillaume Rousse, we now use libtool to build shared
-	libraries.
-
-2007-03-25  runge <runge>
-
-	* x11vnc/README, x11vnc/pm.c, x11vnc/scan.c, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/xevents.c: x11vnc: remove build errors,
-	get -ncache working on macosx again.
-
-2007-03-24  runge <runge>
-
-	* libvncserver/cursor.c: Fix short vs. char problem with X cursors.
-	Have fg == bg == 0 imply interpolation to B&W.
-
-2007-03-24  runge <runge>
-
-	* classes/ssl/ss_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch: reverse
-	connections for ss_vncviewer.  java one-time-keys.
-
-2007-03-24  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/screen.c, x11vnc/sslhelper.c,
-	x11vnc/sslhelper.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: reverse SSL connections. -sleepin
-	option.
-
-2007-03-24  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: reverse (listening) VNC connections.
-
-2007-03-20  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/README.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: ssvnc: sync to 1.0.13 release.
-
-2007-03-20  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/sslhelper.c, x11vnc/user.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: -httpsredir,
-	x11cursor fix, nc=N login opt, no -ncache betatest for java viewer.
-
-2007-03-20  runge <runge>
-
-	* ChangeLog, libvncserver/httpd.c: Add "Connection: close" to HTTP
-	replies.
-
-2007-03-17  dscho <dscho>
-
-	* AUTHORS, ChangeLog, libvncserver/main.c, libvncserver/rfbserver.c: 
-	Fix a locking problem in libvncserver There seems to be a locking problem in libvncserver, with respect to
-	how condition variables are used.  On certain machines in our lab, when using a vncviewer to view a
-	display that has a very high rate of updates, we will occasionally
-	see the VNC server process crash.  In one stack trace that was
-	obtained, an assertion had tripped in glibc's pthread_cond_wait,
-	which was called from clientOutput.  Inspection of clientOutput suggests that WAIT is being called
-	incorrectly.  The mutex that protects a condition variable should
-	always be locked when calling wait, and on return from the wait will
-	still be locked.  The attached patch fixes the locking around this
-	condition variable, and one other that I found by grepping the
-	source for similar occurrences.  Signed-off-by: Charles Coffing <ccoffing at novell.com>
-
-2007-03-13  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: ssvnc: sync src/patches/tight-vncviewer-full.patch
-
-2007-03-13  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/scan.c,
-	x11vnc/screen.c, x11vnc/solid.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: fix crash for kde dcop. limit ncache
-	beta tester to 96MB viewers.
-
-2007-02-19  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/Windows/README.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: ssvnc: more fixes for painting problems.
-
-2007-02-19  runge <runge>
-
-	* x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: fix -users bob= in -inetd mode.
-
-2007-02-19  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: store 1.0.12 snapshot.
-
-2007-02-19  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c, x11vnc/xevents.c: x11vnc: Get
-	ultravnc textchat working with ssvnc.
-
-2007-02-17  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/sslhelper.c, x11vnc/x11vnc.1: 
-	x11vnc: make https fetch in accept_openssl() work again.
-
-2007-02-16  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/allowed_input_t.h,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/keyboard.h, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c, x11vnc/xevents.c: x11vnc: add
-	Files mode to user controlled input. more ultra/tight filexfer
-	tweaks.  rfbversion remote control. noncache/nc unixpw user opt.
-
-2007-02-16  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/avahi.c,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/ssltools.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xevents.c: x11vnc:
-	tightvnc filetransfer off by default. FINDCREATEDISPLAY geometry.
-
-2007-02-12  runge <runge>
-
-	* configure.ac, x11vnc/ChangeLog, x11vnc/Makefile.am,
-	x11vnc/README, x11vnc/avahi.c, x11vnc/avahi.h, x11vnc/cleanup.c,
-	x11vnc/help.c, x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/user.c,
-	x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: add avahi (aka
-	mDNS/Zeroconf/Bonjour...) support thanks to Diego Petteno. add -find
-	-create
-
-2007-02-12  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/options.c, x11vnc/options.h, x11vnc/pm.c,
-	x11vnc/remote.c, x11vnc/sslhelper.c, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xevents.h,
-	x11vnc/xwrappers.c: x11vnc: -grabalways, -forcedpms, -clientdpms,
-	-noserverdpms, -loopbg, -svc, -xdmsvc
-
-2007-02-10  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/pm.c, x11vnc/pm.h, x11vnc/pointer.c, x11vnc/pointer.h,
-	x11vnc/scan.c, x11vnc/screen.c, x11vnc/ssltools.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/user.h, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c, x11vnc/xevents.h: x11vnc: watch textchat, etc in
-	unixpw, implement kbdReleaseAllKeys, setSingleWindow,
-	setServerInput. watch for OpenGL apps breaking XDAMAGE.
-
-2007-02-05  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	ll.patch: ssvnc 1.0.11 files.
-
-2007-02-05  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: Setup for x11vnc 0.8.5
-
-2007-02-01  dscho <dscho>
-
-	* ChangeLog, libvncclient/rfbproto.c, libvncclient/vncviewer.c,
-	rfb/rfbclient.h: LibVNCClient: some users do not want to get
-	whole-screen updates; introduce client->updateRect for that
-
-2007-02-01  dscho <dscho>
-
-	* libvncclient/zrle.c: sometimes zrle sends too many bytes; play
-	safe
-
-2007-01-31  runge <runge>
-
-	* x11vnc/README, x11vnc/keyboard.c, x11vnc/pointer.c,
-	x11vnc/screen.c, x11vnc/solid.c, x11vnc/userinput.c,
-	x11vnc/xdamage.c, x11vnc/xevents.c: fix warnings.
-
-2007-01-31  runge <runge>
-
-	* ChangeLog: libvncclient changes.
-
-2007-01-31  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/README,
-	x11vnc/cleanup.c, x11vnc/connections.c, x11vnc/cursor.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/macosx.c,
-	x11vnc/macosxCG.c, x11vnc/macosxCGS.c,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-ne
-	wfbsize.patch, x11vnc/options.c, x11vnc/options.h, x11vnc/params.h,
-	x11vnc/pointer.c, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/solid.c, x11vnc/solid.h, x11vnc/ssltools.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/userinput.c, x11vnc/util.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c, x11vnc/xdamage.h,
-	x11vnc/xevents.c: x11vnc: -reflect, -N. -ncache, FINDDISPLAY,
-	FINDCREATEDISPLAY, improvements.  MODTWEAK_LOWEST workaround.
-
-2007-01-31  runge <runge>
-
-	* Makefile.am, libvncclient/cursor.c, libvncclient/rfbproto.c,
-	libvncclient/vncviewer.c, prepare_x11vnc_dist.sh, rfb/rfbclient.h: 
-	libvncclient: add GotCursorShape() and GotCopyRect(); x11vnc dep on
-	libvncclient
-
-2007-01-25  dscho <dscho>
-
-	* libvncserver/rfbserver.c: compile fix for MinGW
-
-2007-01-25  dscho <dscho>
-
-	* VisualNaCro/Makefile.am: complain when SWIG is not present, but
-	needed
-
-2007-01-25  dscho <dscho>
-
-	* VisualNaCro/configure.ac: Complain if libvncserver-config was not
-	found in PATH
-
-2007-01-10  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/userinput.c, x11vnc/userinput.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c, x11vnc/xevents.c,
-	x11vnc/xinerama.c, x11vnc/xrandr.h: some -ncache performance
-	improvements, rootpixmap watching, gnome wm heuristics
-
-2007-01-09  runge <runge>
-
-	* x11vnc/README, x11vnc/userinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc_defs.c: Fix old compiler error; fix warnings.
-
-2007-01-09  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/remote.c, x11vnc/screen.c, x11vnc/solid.c, x11vnc/solid.h,
-	x11vnc/userinput.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c: more speed and accuracy
-	improvements to -ncache mode.
-
-2007-01-07  runge <runge>
-
-	* x11vnc/README, x11vnc/options.c, x11vnc/userinput.c,
-	x11vnc/winattr_t.h, x11vnc/x11vnc.1, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c: changes to ncache cache
-	aging and xdamage skipping
-
-2007-01-04  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xdamage.c: x11vnc: more -ncache improvements.
-
-2007-01-02  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/scan.c,
-	x11vnc/ssltools.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/user.c, x11vnc/userinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c, x11vnc/xevents.h: x11vnc: more -ncache
-	improvements.
-
-2006-12-29  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/README, x11vnc/cursor.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/pointer.c, x11vnc/screen.c,
-	x11vnc/selection.c, x11vnc/userinput.c, x11vnc/util.c,
-	x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xwrappers.c: x11vnc
-	-ncache on by default for beta test.  fix -nofb & -rawfb modes.
-
-2006-12-28  runge <runge>
-
-	* x11vnc/README, x11vnc/userinput.c, x11vnc/win_utils.c: a couple
-	more warnings...
-
-2006-12-28  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/README, x11vnc/connections.c,
-	x11vnc/cursor.c, x11vnc/gui.c, x11vnc/keyboard.c, x11vnc/macosx.c,
-	x11vnc/macosx.h, x11vnc/macosxCG.c, x11vnc/macosxCGS.c,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/nox11_funcs.h, x11vnc/pointer.c, x11vnc/remote.c,
-	x11vnc/scan.c, x11vnc/screen.c, x11vnc/selection.c, x11vnc/solid.c,
-	x11vnc/userinput.c, x11vnc/util.c, x11vnc/win_utils.c,
-	x11vnc/xevents.c, x11vnc/xrandr.c, x11vnc/xrecord.c,
-	x11vnc/xwrappers.c: still more compiler warnings; ssvnc 1.0.9 sync.
-
-2006-12-28  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/macosx.c,
-	x11vnc/macosx.h, x11vnc/macosxCG.c, x11vnc/macosxCG.h,
-	x11vnc/macosxCGP.c, x11vnc/macosxCGS.c, x11vnc/macosxCGS.h,
-	x11vnc/scan.c, x11vnc/screen.c, x11vnc/sslhelper.c,
-	x11vnc/uinput.c, x11vnc/userinput.c, x11vnc/v4l.c,
-	x11vnc/win_utils.c, x11vnc/xevents.c, x11vnc/xwrappers.c: more
-	compiler warnings cleanup.
-
-2006-12-28  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/README, x11vnc/connections.c,
-	x11vnc/cursor.c, x11vnc/gui.c, x11vnc/keyboard.c, x11vnc/macosx.c,
-	x11vnc/macosxCG.c, x11vnc/pointer.c, x11vnc/scan.c,
-	x11vnc/screen.c, x11vnc/solid.c, x11vnc/user.c, x11vnc/userinput.c,
-	x11vnc/userinput.h, x11vnc/win_utils.c, x11vnc/xwrappers.c,
-	x11vnc/xwrappers.h: x11vnc: clean up compiler warnings.
-
-2006-12-28  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/cursor.h,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/macosx.c, x11vnc/macosx.h,
-	x11vnc/macosxCGS.c, x11vnc/macosxCGS.h, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/pointer.c, x11vnc/remote.c, x11vnc/scan.c,
-	x11vnc/scan.h, x11vnc/screen.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/userinput.c, x11vnc/userinput.h, x11vnc/winattr_t.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c, x11vnc/xrecord.c, x11vnc/xwrappers.c,
-	x11vnc/xwrappers.h: x11vnc: more work on -ncache.
-
-2006-12-17  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/unixpw.c, x11vnc/unixpw.h, x11vnc/userinput.c,
-	x11vnc/userinput.h, x11vnc/winattr_t.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c, x11vnc/xinerama.c: x11vnc: first pass at
-	client-side caching, -ncache option.
-
-2006-12-17  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xinerama.c: x11vnc: make -xwarppointer
-	the default if xinerama is active.
-
-2006-12-16  runge <runge>
-
-	* rfb/rfbproto.h: Move our rfbEncodings numbers out of the TightVNC
-	range.
-
-2006-12-15  runge <runge>
-
-	* libvncserver/auth.c: fix typo.
-
-2006-12-13  runge <runge>
-
-	* ChangeLog: Remove stray "-permitfiletransfer  permit file transfer
-	support" output
-
-2006-12-13  runge <runge>
-
-	* libvncserver/cargs.c: Remove stray ""-permitfiletransfer    permit
-	file transfer support" output.
-
-2006-12-11  runge <runge>
-
-	* x11vnc/README, x11vnc/macosxCG.c, x11vnc/macosxCGS.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: cleanup some
-	comments.
-
-2006-12-10  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd: sync etv 1.0.8
-
-2006-12-10  runge <runge>
-
-	* classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/cleanup.h, x11vnc/connections.c, x11vnc/gui.c,
-	x11vnc/help.c, x11vnc/misc/Makefile.am, x11vnc/pointer.c,
-	x11vnc/screen.c, x11vnc/screen.h, x11vnc/solid.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/user.c, x11vnc/v4l.c,
-	x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c: x11vnc: FINDCREATEDISPLAY support to create X
-	session if one cannot be found.  Fix bug in java viewer.
-
-2006-11-24  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/help.c, x11vnc/remote.c, x11vnc/user.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: install ss_vncviewer 755,
-	-prog option, HTTPONCE new socket for -inetd.
-
-2006-11-23  runge <runge>
-
-	* classes/ssl/Makefile.am, classes/ssl/README: rename to
-	ss_vncviewer
-
-2006-11-23  runge <runge>
-
-	* classes/ssl/ss_vncviewer, classes/ssl/ssl_vncviewer: rename
-	ssl_vncviewer to ss_vncviewer
-
-2006-11-23  runge <runge>
-
-	* classes/ssl/ss_vncviewer: rename ssl_vncviewer to ss_vncviewer
-
-2006-11-22  runge <runge>
-
-	* configure.ac: use AC_CHECK_LIB for fbpm and dpms
-
-2006-11-21  runge <runge>
-
-	* configure.ac: enable --without-fbpm and --without-dpms
-
-2006-11-21  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/cleanup.c, x11vnc/connections.c, x11vnc/cursor.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/macosx.c, x11vnc/macosx.h,
-	x11vnc/macosxCG.c, x11vnc/macosxCGS.c, x11vnc/macosxCGS.h,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pm.c, x11vnc/pointer.c,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/unixpw.c,
-	x11vnc/userinput.c, x11vnc/win_utils.c, x11vnc/win_utils.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c, x11vnc/xevents.c,
-	x11vnc/xwrappers.c: x11vnc: Mac OS X fb fixes and cuttext, -nodpms
-	option, local user wireframing
-
-2006-11-21  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/README.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/filelist.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/zips/README: update to
-	1.0.8 and renaming
-
-2006-11-21  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_vnc_gui,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/tightvncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l, x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_vncviewer: 
-	delete
-
-2006-11-21  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl: rename
-
-2006-11-13  runge <runge>
-
-	* ChangeLog, configure.ac, prepare_x11vnc_dist.sh, x11vnc/8to24.c,
-	x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/README,
-	x11vnc/cleanup.c, x11vnc/connections.c, x11vnc/cursor.c,
-	x11vnc/cursor.h, x11vnc/gui.c, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/linuxfb.c, x11vnc/macosx.c, x11vnc/macosx.h,
-	x11vnc/macosxCG.c, x11vnc/macosxCG.h, x11vnc/macosxCGP.c,
-	x11vnc/macosxCGP.h, x11vnc/macosxCGS.c, x11vnc/macosxCGS.h,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/params.h,
-	x11vnc/pointer.c, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/selection.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/userinput.c, x11vnc/win_utils.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xdamage.c, x11vnc/xdamage.h, x11vnc/xevents.c,
-	x11vnc/xinerama.c, x11vnc/xrandr.c, x11vnc/xrecord.c,
-	x11vnc/xwrappers.c, x11vnc/xwrappers.h: x11vnc: Native Mac OS X
-	support.
-
-2006-11-08  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/.cp
-	over,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vnc
-	viewer.sh,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.i386/.cpover,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_vnc_gui,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/tightvncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l, x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle: Add Darwin
-	stuff.  Sync to current 1.0.7
-
-2006-11-08  runge <runge>
-
-	* ChangeLog, classes/ssl/ssl_vncviewer, configure.ac,
-	prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: configure.ac -R and macosx,
-	prepare_x11vnc_dist.sh rpm fix
-
-2006-10-30  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: Add tip about how to
-	reenable RECORD extension.
-
-2006-10-12  dscho <dscho>
-
-	* VisualNaCro/nacro.c, VisualNaCro/nacro.h: VisualNaCro: add
-	sendascii
-
-2006-10-12  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: x11vnc: -cursor_drag for DnD, etc.
-
-2006-10-11  runge <runge>
-
-	* libvncserver/tightvnc-filetransfer/rfbtightserver.c: N_ENC_CAPS
-	check does not work if libz is not present.
-
-2006-10-10  dscho <dscho>
-
-	* VisualNaCro/ChangeLog, VisualNaCro/recorder.pl: VisualNaCro: add
-	'i', 'c' and 'r' menu keys
-
-2006-10-10  dscho <dscho>
-
-	* VisualNaCro/ChangeLog, VisualNaCro/recorder.pl: VisualNaCro: add
-	--compact and --compact-dragging
-
-2006-10-07  runge <runge>
-
-	* classes/ssl/ssl_vncviewer, x11vnc/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/stunnel/loca
-	tion.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l, x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/zips/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: Changes for ETV, double
-	SSL/SSH.
-
-2006-09-24  runge <runge>
-
-	* classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/pointer.c,
-	x11vnc/sslhelper.c, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: improve SSL Java
-	viewer, cleanup -unixpw code.
-
-2006-09-21  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l, x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_vncviewer: sync
-	etv. profile cleanup
-
-2006-09-21  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/connections.h, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/sslhelper.c, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/user.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc:
-	-unixpw_cmd, -passwfile cmd:/custom:, -sslnofail, -ultrafilexfer
-
-2006-09-18  runge <runge>
-
-	* x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l: ETV release 1.0.4
-
-2006-09-18  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l, x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle: sync
-	ETV 1.0.4
-
-2006-09-18  runge <runge>
-
-	* libvncserver/rfbserver.c, x11vnc/README, x11vnc/x11vnc.c: x11vnc:
-	improve ultravnc filexfer rate by calling rfbCheckFD more often
-
-2006-09-17  runge <runge>
-
-	*
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l: Sync ETV.
-
-2006-09-17  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/cursor.c, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pm.c, x11vnc/scan.c,
-	x11vnc/screen.c, x11vnc/sslcmds.c, x11vnc/sslhelper.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xinerama.c, x11vnc/xwrappers.c: x11vnc: -verbose,
-	-connect_or_exit, -rfbport 0, print out SSL cert.
-
-2006-09-15  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c: 
-	small tweaks, -sig alias.
-
-2006-09-15  runge <runge>
-
-	* libvncserver/rfbserver.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/cleanup.c, x11vnc/help.c, x11vnc/screen.c, x11vnc/unixpw.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: x11vnc: clear DISPLAY for
-	-unixpw su_verify, user supplied sig ignore.
-
-2006-09-14  runge <runge>
-
-	* classes/ssl/ssl_vncviewer, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/help.c, x11vnc/misc/enhanced_tightvnc_viewer/COPYING,
-	x11vnc/misc/enhanced_tightvnc_viewer/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/README.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/esound/downl
-	oad.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/openssl/down
-	load.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/openssl/loca
-	tion.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/plink/downlo
-	ad.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/plink/licenc
-	e.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/stunnel/down
-	load.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/stunnel/loca
-	tion.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/vncviewer/do
-	wnload.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/info/vncviewer/lo
-	cation.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/stunnel-client.co
-	nf,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/stunnel-server.co
-	nf,
-	x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/w98/location.url,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_tightvncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/ssl_vnc_gui,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/tightvncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tc
-	l, x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssl_vncviewer,
-	x11vnc/misc/enhanced_tightvnc_viewer/bin/util/stunnel-server.conf,
-	x11vnc/misc/enhanced_tightvnc_viewer/build.unix,
-	x11vnc/misc/enhanced_tightvnc_viewer/filelist.txt,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/README,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_vncpatchapplied,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.pa
-	tch,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fu
-	llscreen.patch,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-ne
-	wfbsize.patch,
-	x11vnc/misc/enhanced_tightvnc_viewer/src/zips/README,
-	x11vnc/remote.c, x11vnc/util.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc:
-	enhanced_tightvnc_viewer files, ssh -t keystroke response
-	improvement.
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/Makefile.am, libvncserver-config.in: fix in-place
-	compilation of VisualNaCro
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/recorder.pl: fix call to alert()
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/NEWS, VisualNaCro/nacro.c, VisualNaCro/nacro.h,
-	VisualNaCro/recorder.pl: VisualNaCro: add magic key 'd' to display
-	the current reference image
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/nacro.h: forgot to check in nacro.h
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/nacro.c, VisualNaCro/recorder.pl: implement rubberband
-	for rectangular selection
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/Makefile.am, VisualNaCro/configure.ac: fix compilation
-	with cygwin
-
-2006-09-12  dscho <dscho>
-
-	* rfb/rfbproto.h, vncterm/LinuxVNC.c, vncterm/VNConsole.c: do not
-	always include rfb/keysym.h
-
-2006-09-12  dscho <dscho>
-
-	* AUTHORS, VisualNaCro/NEWS, VisualNaCro/nacro.c,
-	VisualNaCro/nacro.h, VisualNaCro/recorder.pl: VisualNaCro: support
-	clipboard and symbolic key names with X11::Keysyms
-
-2006-09-12  dscho <dscho>
-
-	* VisualNaCro/nacro.c, VisualNaCro/nacro.h: support clipboard
-
-2006-09-11  dscho <dscho>
-
-	* libvncclient/rfbproto.c, rfb/rfbclient.h: make cut text handling
-	using a hook
-
-2006-09-10  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/ssltools.h, x11vnc/uinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: REQ_ARGS,
-	EV_SYN/SYN_REPORT check. restore -cursor most under -display WAIT
-
-2006-09-05  runge <runge>
-
-	* classes/ssl/proxy.vnc, classes/ssl/ssl_vncviewer: Update
-	ssl_vncviewer.  Fix bug in proxy.vnc with multiple PORT= params.
-
-2006-08-10  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/linuxfb.c,
-	x11vnc/uinput.c, x11vnc/uinput.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c: x11vnc: first pass at
-	touchscreens via uinput.
-
-2006-08-02  runge <runge>
-
-	* x11vnc/ChangeLog: add to changelog
-
-2006-08-02  runge <runge>
-
-	* classes/ssl/ssl_vncviewer, x11vnc/README, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/sslhelper.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc:
-	tweaks to ssl_xfer; -ssltimeout option.
-
-2006-07-31  runge <runge>
-
-	* classes/ssl/ssl_vncviewer, x11vnc/README, x11vnc/pointer.c,
-	x11vnc/scan.c, x11vnc/scan.h, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: 
-	x11vnc: more features to ssl_vncviewer for enhanced tightvnc viewer
-	project
-
-2006-07-29  runge <runge>
-
-	* classes/ssl/ssl_vncviewer: one more tweak, start from disp 30
-
-2006-07-29  runge <runge>
-
-	* classes/ssl/ssl_vncviewer: add debug = 6 to stunnel config.
-
-2006-07-28  runge <runge>
-
-	* classes/ssl/ssl_vncviewer, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/cursor.c, x11vnc/help.c, x11vnc/params.h, x11vnc/pointer.c,
-	x11vnc/rates.c, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/solid.c, x11vnc/sslcmds.c,
-	x11vnc/sslhelper.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/user.c, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: x11vnc: -rotate option
-
-2006-07-18  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/8to24.c, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/gui.c,
-	x11vnc/keyboard.c, x11vnc/linuxfb.c, x11vnc/nox11.h,
-	x11vnc/nox11_funcs.h, x11vnc/pointer.c, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/selection.c, x11vnc/solid.c,
-	x11vnc/sslhelper.c, x11vnc/uinput.c, x11vnc/userinput.c,
-	x11vnc/util.c, x11vnc/v4l.c, x11vnc/win_utils.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c, x11vnc/xwrappers.c: x11vnc: enable --without-x
-	builds for -rawfb only binaries.
-
-2006-07-15  runge <runge>
-
-	* configure.ac, prepare_x11vnc_dist.sh, x11vnc/README,
-	x11vnc/help.c, x11vnc/user.c, x11vnc/x11vnc.1, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: update versions for next rel.  add some more
-	shortcuts to user:opts
-
-2006-07-12  runge <runge>
-
-	* ChangeLog, configure.ac: LibVNCServer 0.8.2 release.
-
-2006-07-12  runge <runge>
-
-	* x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: set REL8x
-
-2006-07-12  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/linuxfb.c, x11vnc/params.h, x11vnc/pointer.c,
-	x11vnc/screen.c, x11vnc/user.c, x11vnc/x11vnc.1: x11vnc: wording
-	changes; remove "-rawfb cons" in favor of "console"
-
-2006-07-11  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/keyboard.c, x11vnc/remote.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/uinput.c, x11vnc/uinput.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: more
-	UINPUT mode tweaks.
-
-2006-07-10  runge <runge>
-
-	* x11vnc/README, x11vnc/help.c, x11vnc/remote.c, x11vnc/sslcmds.c,
-	x11vnc/sslhelper.c, x11vnc/uinput.c, x11vnc/unixpw.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: x11vnc: improve uinput heuristics so button
-	clicks work on qt-embedded.
-
-2006-07-09  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/Makefile.am,
-	x11vnc/README, x11vnc/help.c, x11vnc/keyboard.c, x11vnc/linuxfb.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/params.h,
-	x11vnc/pointer.c, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/uinput.c,
-	x11vnc/uinput.h, x11vnc/util.c, x11vnc/v4l.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c: x11vnc: add uinput support
-	for full input into linux fb device (e.g. qt-embed).
-
-2006-07-05  runge <runge>
-
-	* x11vnc/README, x11vnc/keyboard.c: x11vnc: whoops str decl in wrong
-	place for old compilers.
-
-2006-07-04  runge <runge>
-
-	* x11vnc/README, x11vnc/keyboard.c, x11vnc/pointer.c,
-	x11vnc/xwrappers.c: x11vnc: check all XKeysymToString() return
-	values.
-
-2006-07-04  runge <runge>
-
-	* x11vnc/README, x11vnc/keyboard.c, x11vnc/unixpw.c,
-	x11vnc/unixpw.h: x11vnc: plug a couple unixpw gaps.
-
-2006-07-04  runge <runge>
-
-	* configure.ac, x11vnc/README, x11vnc/inet.c, x11vnc/keyboard.c,
-	x11vnc/sslhelper.c, x11vnc/unixpw.c, x11vnc/user.c, x11vnc/util.c,
-	x11vnc/v4l.c, x11vnc/x11vnc.c, x11vnc/x11vnc.h: x11vnc: remove
-	compiler warnings; HP-UX tweaks.
-
-2006-07-04  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/cursor.c,
-	x11vnc/cursor.h, x11vnc/help.c, x11vnc/help.h, x11vnc/inet.c,
-	x11vnc/pointer.c, x11vnc/remote.c, x11vnc/scan.c,
-	x11vnc/sslhelper.c, x11vnc/sslhelper.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/userinput.c, x11vnc/util.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c: x11vnc: more -unixpw work.  add -license, etc.
-	options
-
-2006-06-24  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/gui.c,
-	x11vnc/scan.c, x11vnc/solid.c, x11vnc/sslcmds.c, x11vnc/unixpw.c,
-	x11vnc/user.c, x11vnc/util.c, x11vnc/v4l.c, x11vnc/win_utils.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xwrappers.c: x11vnc: misc cleanup.
-
-2006-06-18  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/cleanup.c, x11vnc/connections.c, x11vnc/connections.h,
-	x11vnc/cursor.c, x11vnc/gui.c, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pm.c, x11vnc/pointer.c,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/solid.c,
-	x11vnc/sslcmds.c, x11vnc/sslhelper.c, x11vnc/sslhelper.h,
-	x11vnc/ssltools.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/unixpw.h, x11vnc/user.c,
-	x11vnc/userinput.c, x11vnc/util.c, x11vnc/v4l.c,
-	x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xdamage.c,
-	x11vnc/xevents.c, x11vnc/xevents.h, x11vnc/xrandr.h,
-	x11vnc/xwrappers.c: x11vnc: --grabkbd, -grabptr, -env, -allowedcmds,
-	unixpw+WAIT user fred:options
-
-2006-06-15  dscho <dscho>
-
-	* VisualNaCro/README: fix typo
-
-2006-06-15  dscho <dscho>
-
-	* VisualNaCro/ChangeLog, VisualNaCro/NEWS, VisualNaCro/recorder.pl: 
-	no need for Time::HiRes to play back
-
-2006-06-15  dscho <dscho>
-
-	* VisualNaCro/recorder.pl: add timing
-
-2006-06-13  runge <runge>
-
-	* classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/screen.c,
-	x11vnc/sslhelper.c, x11vnc/ssltools.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/util.c, x11vnc/util.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c: x11vnc: -display WAIT:cmd=FINDDISPLAY,
-	HTTPONCE, -http_ssl option, Java fixes.
-
-2006-06-09  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/unixpw.c, x11vnc/user.c: 
-	x11vnc: make -display WAIT + -unixpw work on Solaris.
-
-2006-06-08  runge <runge>
-
-	* ChangeLog, prepare_x11vnc_dist.sh, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/cleanup.c, x11vnc/connections.c,
-	x11vnc/gui.c, x11vnc/help.c, x11vnc/options.c, x11vnc/pointer.c,
-	x11vnc/remote.c, x11vnc/screen.c, x11vnc/solid.c, x11vnc/sslcmds.c,
-	x11vnc/sslhelper.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/unixpw.h, x11vnc/user.c, x11vnc/user.h,
-	x11vnc/v4l.c, x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xkb_bell.c, x11vnc/xrecord.c, x11vnc/xwrappers.c,
-	x11vnc/xwrappers.h:   x11vnc: -display WAIT:..., -users unixpw=, su_verify dpy command.
-
-2006-06-05  steven_carr <steven_carr>
-
-	* libvncclient/rfbproto.c, libvncserver/auth.c,
-	libvncserver/rfbserver.c: RFB 3.8 clients are well informed
-
-2006-06-05  steven_carr <steven_carr>
-
-	* libvncserver/auth.c: Better support for RFB >= 3.8 protocols
-
-2006-06-05  steven_carr <steven_carr>
-
-	* libvncserver/auth.c: All security types for RFB >= 3.7 *have* to
-	respond with a Security Result (Even rfbSecTypeNone)
-
-2006-06-03  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/linuxfb.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/rates.c, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/sslcmds.c, x11vnc/sslhelper.c,
-	x11vnc/sslhelper.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/userinput.c, x11vnc/win_utils.c,
-	x11vnc/win_utils.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xevents.c,
-	x11vnc/xevents.h, x11vnc/xwrappers.c:  x11vnc: -capslock -skip_lockkeys; Alt keys under -rawfb cons.
-
-2006-06-03  runge <runge>
-
-	* libvncserver/auth.c: move all types into handler loop.
-
-2006-05-29  steven_carr <steven_carr>
-
-	* ChangeLog: Identified and removed some memory leaks associated
-	with the Encodings RRE, CoRRE, ZLIB, and Ultra.  KeyboardLedState
-	now has portable masks defined.  rfb >= 3.7 Security Type Handler
-	list would grow 1 entry for each new client connection.
-
-2006-05-29  steven_carr <steven_carr>
-
-	* libvncserver/auth.c: Security Type memory leak plugged.  Leaks
-	when rfb >= 3.7 clients connects.  The security list would grow 1
-	entry when clients connect.
-
-2006-05-28  steven_carr <steven_carr>
-
-	* rfb/rfbproto.h: KeyboardLedState Encoding Masks are now defined
-	for portability
-
-2006-05-28  steven_carr <steven_carr>
-
-	* libvncserver/corre.c, libvncserver/main.c,
-	libvncserver/private.h, libvncserver/rfbserver.c,
-	libvncserver/rre.c, libvncserver/ultra.c, libvncserver/zlib.c: 
-	Plugged some memory leakage
-
-2006-05-16  steven_carr <steven_carr>
-
-	* libvncserver/rfbserver.c, rfb/rfb.h: Permit auth.c to test major
-	version
-
-2006-05-16  steven_carr <steven_carr>
-
-	* libvncserver/auth.c: Specifically test for Major Version 3 added
-
-2006-05-16  steven_carr <steven_carr>
-
-	* ChangeLog, libvncserver/stats.c: Statistics now fit into 80-column
-	output
-
-2006-05-16  steven_carr <steven_carr>
-
-	* libvncserver/stats.c: Statistics output now fits in 80-column
-	output
-
-2006-05-16  steven_carr <steven_carr>
-
-	* libvncserver/cursor.c: Corrected Cursor Statistics reporting as
-	messages
-
-2006-05-15  dscho <dscho>
-
-	* libvncserver/tightvnc-filetransfer/Makefile.am: remove unneeded
-	file
-
-2006-05-15  steven_carr <steven_carr>
-
-	* libvncserver/rfbserver.c, rfb/rfb.h: Support sending TextChat
-	messages back to the client
-
-2006-05-15  steven_carr <steven_carr>
-
-	* ChangeLog, libvncserver/cargs.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, rfb/rfb.h, rfb/rfbproto.h: Default to RFB
-	3.8, add command line option to specify the RFB version.
-
-2006-05-15  steven_carr <steven_carr>
-
-	* ChangeLog, client_examples/SDLvncviewer.c,
-	libvncclient/rfbproto.c, libvncclient/ultra.c, libvncclient/zrle.c,
-	libvncserver/auth.c, libvncserver/corre.c, libvncserver/cursor.c,
-	libvncserver/hextile.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/rre.c, libvncserver/scale.c,
-	libvncserver/sockets.c, libvncserver/stats.c, libvncserver/tight.c,
-	libvncserver/tightvnc-filetransfer/rfbtightproto.h,
-	libvncserver/ultra.c, libvncserver/zlib.c, libvncserver/zrle.c,
-	rfb/rfb.h, rfb/rfbclient.h, rfb/rfbproto.h, x11vnc/rates.c,
-	x11vnc/userinput.c: The great UltraVNC Compatibility Commit
-
-2006-05-13  runge <runge>
-
-	* ChangeLog, libvncclient/Makefile.am, libvncclient/lzoconf.h,
-	libvncclient/minilzo.c, libvncclient/minilzo.h,
-	libvncserver/lzoconf.h, libvncserver/minilzo.c,
-	libvncserver/minilzo.h, libvncserver/rfbserver.c,
-	libvncserver/scale.c, vncterm/Makefile.am:  fix some build issues WRT ultravnc code.
-
-2006-05-07  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/8to24.c, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/connections.c,
-	x11vnc/cursor.c, x11vnc/gui.c, x11vnc/help.c, x11vnc/keyboard.c,
-	x11vnc/linuxfb.c, x11vnc/linuxfb.h, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/params.h, x11vnc/pm.c, x11vnc/pointer.c,
-	x11vnc/rates.c, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/selection.c, x11vnc/solid.c,
-	x11vnc/sslhelper.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/user.c, x11vnc/userinput.c, x11vnc/v4l.c,
-	x11vnc/v4l.h, x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xdamage.c,
-	x11vnc/xevents.c, x11vnc/xinerama.c, x11vnc/xkb_bell.c,
-	x11vnc/xrandr.c, x11vnc/xrecord.c, x11vnc/xwrappers.c,
-	x11vnc/xwrappers.h:  x11vnc: support for video4linux webcams & tv-tuners, -24to32 bpp
-	 option, -rawfb console.
-
-2006-05-04  steven_carr <steven_carr>
-
-	* ChangeLog, libvncclient/rfbproto.c, libvncserver/rfbserver.c,
-	rfb/rfb.h, rfb/rfbproto.h, x11vnc/screen.c: Server Capability
-	Encodings rfbEncodingSupportedEncodings - What encodings are
-	supported? rfbEncodingSupportedMessages  - What message types are
-	supported? rfbEncodingServerIdentity     - What is the servers
-	version string? ie: "x11vnc: 0.8.1 lastmod: 2006-04-25 (LibVNCServer
-	0.9pre)"
-
-2006-05-04  steven_carr <steven_carr>
-
-	* libvncclient/rfbproto.c: UltraVNC with scaling, will send
-	rectangles with a zero W or H We need to process the rectangle
-	(especially if it a type that contains subrectangles or any kind of
-	compression).   UltraVNC should be fixed to prevent these useless
-	rectangles from being sent.
-
-2006-05-04  steven_carr <steven_carr>
-
-	* libvncclient/rfbproto.c, libvncclient/vncviewer.c,
-	rfb/rfbclient.h: Client side support for PalmVNC/UltraVNC 'Server
-	Side Scaling'
-
-2006-05-04  steven_carr <steven_carr>
-
-	* rfb/rfbproto.h: KeyboardLedState should be placed in 'various
-	protocol extensions'
-
-2006-05-03  steven_carr <steven_carr>
-
-	* ChangeLog, libvncserver/Makefile.am, libvncserver/corre.c,
-	libvncserver/cursor.c, libvncserver/hextile.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/rre.c, libvncserver/scale.c,
-	libvncserver/scale.h, libvncserver/stats.c, libvncserver/tight.c,
-	libvncserver/ultra.c, libvncserver/zlib.c, libvncserver/zrle.c,
-	rfb/rfb.h: Client Independent Server Side Scaling is now supported
-	Both PalmVNC and UltraVNC SetScale messages are supported
-
-2006-05-02  steven_carr <steven_carr>
-
-	* ChangeLog, libvncclient/Makefile.am, libvncclient/lzoconf.h,
-	libvncclient/minilzo.c, libvncclient/minilzo.h,
-	libvncclient/rfbproto.c, libvncclient/ultra.c,
-	libvncclient/vncviewer.c, libvncserver/Makefile.am,
-	libvncserver/lzoconf.h, libvncserver/minilzo.c,
-	libvncserver/minilzo.h, libvncserver/rfbserver.c,
-	libvncserver/ultra.c, rfb/rfb.h, rfb/rfbclient.h: Ultra Encoding
-	added.   Tested against UltraVNC V1.01
-
-2006-05-02  steven_carr <steven_carr>
-
-	* libvncclient/rfbproto.c: CopyRectangle() BPP!=8 bug fixed
-
-2006-05-02  steven_carr <steven_carr>
-
-	* libvncclient/vncviewer.c: Eliminate incompatible pointer
-	assignment warning (gcc 4.0.1)
-
-2006-05-02  steven_carr <steven_carr>
-
-	* libvncclient/hextile.c, libvncclient/tight.c, libvncclient/zlib.c: 
-	signed vs unsigned warnings eliminated (gcc 4.0.1)
-
-2006-04-30  dscho <dscho>
-
-	* examples/Makefile.am: include rotatetemplate.c in the tarball
-
-2006-04-28  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c, libvncclient/rfbproto.c,
-	rfb/rfbclient.h: libvncclient: support changing of framebuffer size;
-	make SDLvncviewer use it
-
-2006-04-28  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: fix SDLvncviewer for widths which
-	are not divisible by 8
-
-2006-04-27  dscho <dscho>
-
-	* ChangeLog, examples/.cvsignore, examples/Makefile.am,
-	examples/pnmshow.c, examples/rotate.c, examples/rotatetemplate.c: 
-	add rotate and flip example
-
-2006-04-27  dscho <dscho>
-
-	* examples/camera.c: malloc.h should not be needed (it is missing on
-	quite a few platforms)
-
-2006-04-26  runge <runge>
-
-	* ChangeLog, classes/ssl/ssl_vncviewer,
-	client_examples/Makefile.am, configure.ac, contrib/Makefile.am,
-	examples/Makefile.am, libvncclient/Makefile.am,
-	libvncserver/Makefile.am,
-	libvncserver/tightvnc-filetransfer/Makefile.am, test/Makefile.am,
-	x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/README, x11vnc/help.c,
-	x11vnc/sslhelper.c, x11vnc/x11vnc.1, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c:  Make VPATH building work with -I $(top_srcdir) for rfb/rfb.h
-
-2006-04-17  steven_carr <steven_carr>
-
-	* ChangeLog, examples/Makefile.am, examples/camera.c: Added an
-	example camera application to demonstrate another way to write a
-	server application.
-
-2006-04-16  runge <runge>
-
-	* classes/ssl/ssl_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c, x11vnc/help.c,
-	x11vnc/sslcmds.c, x11vnc/sslhelper.c, x11vnc/ssltools.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c:  Apache SSL gateway. More web proxy cases for Java and
-	 ssl_vncviewer.
-
-2006-04-05  runge <runge>
-
-	* ChangeLog, classes/ssl/Makefile.am, classes/ssl/README,
-	classes/ssl/proxy.vnc, classes/ssl/ssl_vncviewer,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	configure.ac, prepare_x11vnc_dist.sh, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/cleanup.h, x11vnc/connections.c, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pm.c, x11vnc/pm.h,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/sslcmds.c,
-	x11vnc/sslcmds.h, x11vnc/sslhelper.c, x11vnc/sslhelper.h,
-	x11vnc/ssltools.h, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c:  SSL Java viewer work thru proxy.  -sslGenCA, etc key/cert
-	 management utils for x11vnc.  FBPM "support".
-
-2006-03-28  dscho <dscho>
-
-	* ChangeLog, client_examples/SDLvncviewer.c,
-	libvncclient/rfbproto.c, libvncclient/vncviewer.c,
-	libvncserver/main.c, libvncserver/rfbserver.c, rfb/rfb.h,
-	rfb/rfbclient.h, rfb/rfbproto.h: add KeyboardLedState extension
-
-2006-03-28  runge <runge>
-
-	* ChangeLog, classes/Makefile.am, classes/ssl/Makefile.am,
-	classes/ssl/index.vnc,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-cursor-colors+no-tab
-	-traversal.patch,
-	classes/ssl/tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch,
-	configure.ac, libvncserver/httpd.c, prepare_x11vnc_dist.sh,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/cursor.c,
-	x11vnc/help.c, x11vnc/keyboard.c, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/pointer.c, x11vnc/rates.c,
-	x11vnc/remote.c, x11vnc/screen.c, x11vnc/sslcmds.c,
-	x11vnc/sslhelper.c, x11vnc/sslhelper.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xwrappers.c:  SSL patch for Java viewer.  https support for x11vnc.
-
-2006-03-27  dscho <dscho>
-
-	* AUTHORS, ChangeLog, libvncserver/rfbserver.c: ignore
-	maxRectsPerUpdate when encoding is Zlib (thanks scarr)
-
-2006-03-27  dscho <dscho>
-
-	* libvncclient/vncviewer.c: libvncclient: take -compress <level> and
-	-quality <level> command line arguments
-
-2006-03-12  runge <runge>
-
-	* configure.ac, x11vnc/ChangeLog, x11vnc/Makefile.am,
-	x11vnc/README, x11vnc/cleanup.c, x11vnc/connections.c,
-	x11vnc/gui.c, x11vnc/help.c, x11vnc/misc/Xdummy, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/selection.c, x11vnc/sslcmds.c,
-	x11vnc/sslhelper.c, x11vnc/sslhelper.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c,
-	x11vnc/xevents.c:  x11vnc: add -ssl mode using libssl.  Include Xdummy in misc.
-
-2006-03-08  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/help.c, x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/screen.c, x11vnc/selection.c, x11vnc/selection.h,
-	x11vnc/sslcmds.c, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/unixpw.c, x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xevents.h:  x11vnc: do CLIPBOARD, reverse conn require passwds, -usepw,
-	 -debug_sel, -storepasswd homedir.
-
-2006-03-06  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/connections.c,
-	x11vnc/connections.h, x11vnc/gui.c, x11vnc/gui.h, x11vnc/help.c,
-	x11vnc/params.h, x11vnc/remote.c, x11vnc/sslcmds.c,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc_defs.c, x11vnc/xevents.c, x11vnc/xevents.h:  x11vnc: gui speedup and fixes. -unixpw and -inetd
-
-2006-03-05  runge <runge>
-
-	* configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/gui.c, x11vnc/help.c, x11vnc/inet.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/remote.c,
-	x11vnc/sslcmds.c, x11vnc/sslcmds.h, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/unixpw.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c:  x11vnc: -unixpw on *bsd, hpux and tru64. -unixpw_nis mode. stunnel
-	 and gui tweaks.
-
-2006-03-03  runge <runge>
-
-	* configure.ac, x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/help.c, x11vnc/inet.c, x11vnc/inet.h,
-	x11vnc/keyboard.c, x11vnc/remote.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/unixpw.c, x11vnc/unixpw.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c:  x11vnc: more -unixpw mode. -gone popup mode. Change filexfer via
-	 -R. Tune SMALL_FOOTPRINT.
-
-2006-03-01  dscho <dscho>
-
-	* examples/Makefile.am, examples/blooptest.c, examples/example.c: 
-	Fix blooptest example
-
-2006-03-01  dscho <dscho>
-
-	* rfb/keysym.h: do not assume that KEYSYM_H guards X11's keysym.h
-
-2006-03-01  dscho <dscho>
-
-	* libvncserver/main.c: do not timeout on idle client input (with
-	pthreads)
-
-2006-03-01  dscho <dscho>
-
-	* examples/Makefile.am: if compiling with pthreads, also compile
-	blooptest
-
-2006-02-28  dscho <dscho>
-
-	* libvncserver/sockets.c: rfbCheckFds now returns the number of
-	processed events
-
-2006-02-28  dscho <dscho>
-
-	* AUTHORS, ChangeLog, libvncserver/main.c, libvncserver/sockets.c,
-	rfb/rfb.h: add handleEventsEagerly flag (Thanks, Donald)
-
-2006-02-25  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/Makefile.am,
-	x11vnc/README, x11vnc/allowed_input_t.h, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/help.c,
-	x11vnc/inet.c, x11vnc/inet.h, x11vnc/keyboard.c, x11vnc/keyboard.h,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pointer.c,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c,
-	x11vnc/selection.c, x11vnc/sslcmds.c, x11vnc/sslcmds.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/unixpw.c,
-	x11vnc/unixpw.h, x11vnc/user.c, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c, x11vnc/xdamage.c, x11vnc/xevents.c,
-	x11vnc/xrecord.c:  x11vnc: -unixpw and -stunnel.  Add clipboard to input control.
-
-2006-02-24  rohit_99129 <rohit_99129>
-
-	* libvncserver/main.c, rfb/rfb.h: Added method to get extension
-	specific client data
-
-2006-02-24  rohit_99129 <rohit_99129>
-
-	* ChangeLog, libvncserver/main.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c, rfb/rfb.h: 
-	Added method to get extension specific client data
-
-2006-02-22  dscho <dscho>
-
-	* ChangeLog, libvncserver/auth.c, libvncserver/main.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c, rfb/rfb.h: add
-	functions to unregister extensions/security types
-
-2006-02-21  dscho <dscho>
-
-	* configure.ac, x11vnc/Makefile.am: IRIX linker is very picky about
-	order of libraries
-
-2006-02-20  runge <runge>
-
-	* ChangeLog, configure.ac, libvncserver/cursor.c,
-	libvncserver/main.c,
-	libvncserver/tightvnc-filetransfer/filelistinfo.c,
-	libvncserver/tightvnc-filetransfer/filetransfermsg.c,
-	libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c,
-	prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/connections.c, x11vnc/inet.c, x11vnc/user.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c, x11vnc/xevents.c:  fix some non-gcc compiler warnings and signals in x11vnc
-
-2006-02-07  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.h: x11vnc: fix AIX build wrt h_errno.
-
-2006-02-06  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/win_utils.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c:  x11vnc: -8to24 more speedups; tunables for very slow machines.
-
-2006-02-05  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/8to24.h, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/help.c, x11vnc/options.c, x11vnc/options.h, x11vnc/params.h,
-	x11vnc/rates.c, x11vnc/scan.c, x11vnc/scan.h, x11vnc/userinput.c,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c,
-	x11vnc/xinerama.c:  x11vnc: -8to24 speedups and improvements.
-
-2006-01-22  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/options.c, x11vnc/options.h, x11vnc/pointer.c,
-	x11vnc/rates.c, x11vnc/remote.c, x11vnc/screen.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/win_utils.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c:  x11vnc: -8to24 opts, use XGetSubImage. fix -threads deadlocks and
-	 -rawfb crash
-
-2006-01-19  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/8to24.h, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/cursor.c, x11vnc/help.c, x11vnc/remote.c, x11vnc/scan.c,
-	x11vnc/screen.c, x11vnc/userinput.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c:  x11vnc: -8to24 now works on default depth 8 displays.
-
-2006-01-16  runge <runge>
-
-	* x11vnc/8to24.c, x11vnc/ChangeLog, x11vnc/README, x11vnc/help.c,
-	x11vnc/util.c, x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c:  x11vnc: more tweaks to -8to24 XGETIMAGE_8TO24
-
-2006-01-15  runge <runge>
-
-	* ChangeLog, x11vnc/8to24.c, x11vnc/8to24.h, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/connections.c,
-	x11vnc/cursor.c, x11vnc/help.c, x11vnc/options.c, x11vnc/options.h,
-	x11vnc/remote.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/userinput.c, x11vnc/util.c,
-	x11vnc/util.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c, x11vnc/x11vnc.h,
-	x11vnc/x11vnc_defs.c:  x11vnc: add -8to24 option for some multi-depth displays.
-
-2006-01-12  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.h: configure.ac:
-	add switches for most X extensions.
-
-2006-01-11  runge <runge>
-
-	* libvncserver/main.c, prepare_x11vnc_dist.sh, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc_defs.c: logMutex needs to be
-	initialized too; in rfbDefaultLog.
-
-2006-01-11  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/cleanup.c,
-	x11vnc/connections.c, x11vnc/cursor.c, x11vnc/keyboard.c,
-	x11vnc/pointer.c, x11vnc/scan.c, x11vnc/screen.c, x11vnc/solid.c,
-	x11vnc/userinput.c, x11vnc/win_utils.c, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c, x11vnc/x11vnc_defs.c, x11vnc/xdamage.c,
-	x11vnc/xrecord.c:  x11vnc: close fd > 2 in run_user_command(), -nocmds in crash_debug,
-	 fix 64bit bug for -solid.
-
-2006-01-10  dscho <dscho>
-
-	* ChangeLog, libvncserver/main.c, libvncserver/rfbserver.c: 
-	rfbProcessEvents() has to iterate also over clients with sock < 0 to
-	close them
-
-2006-01-09  runge <runge>
-
-	* ChangeLog, examples/pnmshow24.c, x11vnc/ChangeLog,
-	x11vnc/Makefile.am, x11vnc/README, x11vnc/allowed_input_t.h,
-	x11vnc/blackout_t.h, x11vnc/cleanup.c, x11vnc/cleanup.h,
-	x11vnc/connections.c, x11vnc/connections.h, x11vnc/cursor.c,
-	x11vnc/cursor.h, x11vnc/enums.h, x11vnc/gui.c, x11vnc/gui.h,
-	x11vnc/help.c, x11vnc/help.h, x11vnc/inet.c, x11vnc/inet.h,
-	x11vnc/keyboard.c, x11vnc/keyboard.h, x11vnc/options.c,
-	x11vnc/options.h, x11vnc/params.h, x11vnc/pointer.c,
-	x11vnc/pointer.h, x11vnc/rates.c, x11vnc/rates.h, x11vnc/remote.c,
-	x11vnc/remote.h, x11vnc/scan.c, x11vnc/scan.h, x11vnc/screen.c,
-	x11vnc/screen.h, x11vnc/scrollevent_t.h, x11vnc/selection.c,
-	x11vnc/selection.h, x11vnc/solid.c, x11vnc/solid.h,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/user.c, x11vnc/user.h,
-	x11vnc/userinput.c, x11vnc/userinput.h, x11vnc/util.c,
-	x11vnc/util.h, x11vnc/win_utils.c, x11vnc/win_utils.h,
-	x11vnc/winattr_t.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c,
-	x11vnc/x11vnc.h, x11vnc/x11vnc_defs.c, x11vnc/xdamage.c,
-	x11vnc/xdamage.h, x11vnc/xevents.c, x11vnc/xevents.h,
-	x11vnc/xinerama.c, x11vnc/xinerama.h, x11vnc/xkb_bell.c,
-	x11vnc/xkb_bell.h, x11vnc/xrandr.c, x11vnc/xrandr.h,
-	x11vnc/xrecord.c, x11vnc/xrecord.h, x11vnc/xwrappers.c,
-	x11vnc/xwrappers.h:  x11vnc: the big split.
-
-2006-01-08  runge <runge>
-
-	* ChangeLog, examples/pnmshow24.c, libvncclient/vncviewer.c,
-	libvncserver/main.c:  fix client non-jpeg/libz builds
-
-2006-01-06  runge <runge>
-
-	* ChangeLog, libvncserver/main.c:  rfbRegisterProtocolExtension extMutex was never initialized.
-
-2005-12-24  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: enhance -passwdfile features, filetransfer on by default.
-
-2005-12-22  dscho <dscho>
-
-	* libvncserver/rfbserver.c: make compile again with pthreads; fix
-	off-by-one error
-
-2005-12-19  dscho <dscho>
-
-	* AUTHORS, ChangeLog, libvncserver/cargs.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, rfb/rfb.h: introduce -deferptrupdate
-	(thanks Dave)
-
-2005-12-19  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c, libvncclient/sockets.c,
-	libvncclient/vncviewer.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/sockets.c: assorted fixes for
-	MinGW32
-
-2005-12-09  dscho <dscho>
-
-	* ChangeLog, configure.ac, libvncclient/sockets.c,
-	libvncserver/sockets.c: work around write() returning ENOENT on
-	Solaris 2.7
-
-2005-12-09  dscho <dscho>
-
-	* examples/mac.c: previous patch turned compile warning in a compile
-	error; fix that ;-)
-
-2005-12-08  dscho <dscho>
-
-	* examples/mac.c: fix compile warnings
-
-2005-12-07  dscho <dscho>
-
-	* libvncclient/vncviewer.c: one more memory leak
-
-2005-12-07  dscho <dscho>
-
-	* ChangeLog, libvncclient/vncviewer.c, rfb/rfbclient.h: plug memory
-	leaks
-
-2005-12-07  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: translate keys based on unicode
-	(much more reliable than sym)
-
-2005-11-28  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: add -loop option.
-
-2005-11-25  runge <runge>
-
-	* ChangeLog, configure.ac, libvncclient/rfbproto.c,
-	libvncclient/tight.c, libvncclient/vncviewer.c,
-	libvncserver/Makefile.am, libvncserver/auth.c, libvncserver/main.c,
-	libvncserver/private.h, libvncserver/rfbserver.c,
-	libvncserver/tightvnc-filetransfer/filelistinfo.h,
-	libvncserver/tightvnc-filetransfer/filetransfermsg.c,
-	libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c,
-	rfb/rfbclient.h, rfb/rfbproto.h, x11vnc/ChangeLog,
-	x11vnc/misc/x11vnc_pw, x11vnc/x11vnc.c:  fix deadlock from rfbReleaseExtensionIterator(), fix no
-	 libz/libjpeg builds, disable tightvnc-filetransfer if no
-	 libpthread, add --without-pthread option, rm // comments, set
-	 NAME_MAX if not defined, x11vnc: throttle load if fb update
-	 requests not taking place.
-
-2005-10-23  runge <runge>
-
-	* configure.ac, x11vnc/README:  configure.ac: test ... == ... not allowed on all unix.
-
-2005-10-23  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -filexfer, -slow_fb, -blackout noptr,...
-
-2005-10-07  dscho <dscho>
-
-	* TODO: update TODO
-
-2005-10-07  dscho <dscho>
-
-	* examples/backchannel.c, libvncserver/rfbserver.c, rfb/rfb.h: The
-	PseudoEncoding extension code was getting silly: If the client asked for an encoding, and no enabled extension
-	handled it, LibVNCServer would walk through all extensions, and if
-	they promised to handle the encoding, execute the extension's
-	newClient() if it was not NULL.  However, if newClient is not NULL, it will be called when a client
-	connects, and if it returns TRUE, the extension will be enabled.
-	Since all the state of the extension should be in the client data,
-	there is no good reason why newClient should return FALSE the first
-	time (thus not enabling the extension), but TRUE when called just
-	before calling enablePseudoEncoding().  So in effect, the extension got enabled all the time, even if that
-	was not necessary.  The resolution is to pass a void** to enablePseudoEncoding. This has
-	the further advantage that enablePseudoEncoding can remalloc() or
-	free() the data without problems. Though keep in mind that if
-	enablePseudoEncoding() is called on a not-yet-enabled extension, the
-	passed data points to NULL.
-
-2005-10-06  dscho <dscho>
-
-	* ChangeLog: update ChangeLog for today
-
-2005-10-06  dscho <dscho>
-
-	* client_examples/Makefile.am, client_examples/SDLvncviewer.c,
-	client_examples/backchannel.c, libvncclient/rfbproto.c,
-	rfb/rfbclient.h: 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.
-
-2005-10-06  dscho <dscho>
-
-	* examples/Makefile.am, examples/backchannel.c: add BackChannel
-	extension example
-
-2005-10-06  dscho <dscho>
-
-	* libvncclient/zrle.c: fix warning
-
-2005-10-06  dscho <dscho>
-
-	* configure.ac, examples/mac.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/stats.c,
-	libvncserver/tightvnc-filetransfer/filetransfermsg.c, rfb/rfb.h,
-	rfb/rfbproto.h: kill BackChannel and CustomClientMessage: the new
-	extension technique makes these hooks obsolete
-
-2005-10-06  dscho <dscho>
-
-	* libvncserver/rfbserver.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c, rfb/rfb.h: 
-	provide a list of the pseudo encodings understood by the extension
-
-2005-10-06  dscho <dscho>
-
-	* contrib/Makefile.am, x11vnc/Makefile.am: DEFINES -> AM_CFLAGS
-
-2005-10-06  dscho <dscho>
-
-	* client_examples/Makefile.am, examples/Makefile.am,
-	libvncclient/Makefile.am,
-	libvncserver/tightvnc-filetransfer/Makefile.am, test/Makefile.am: do
-	it right: it is not DEFINES, but AM_CFLAGS
-
-2005-10-03  dscho <dscho>
-
-	* ChangeLog, libvncserver/rfbserver.c,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c, rfb/rfb.h: add
-	enablePseudoEncoding() to rfbProtocolExtension
-
-2005-09-29  dscho <dscho>
-
-	* TODO, index.html: more TODOs, and an update to the website
-
-2005-09-28  dscho <dscho>
-
-	* AUTHORS, ChangeLog, configure.ac, examples/.cvsignore,
-	examples/Makefile.am, examples/filetransfer.c,
-	libvncclient/.cvsignore, libvncserver/.cvsignore,
-	libvncserver/Makefile.am, libvncserver/auth.c,
-	libvncserver/cargs.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/sockets.c,
-	libvncserver/tightvnc-filetransfer/.cvsignore,
-	libvncserver/tightvnc-filetransfer/Makefile.am,
-	libvncserver/tightvnc-filetransfer/filelistinfo.c,
-	libvncserver/tightvnc-filetransfer/filelistinfo.h,
-	libvncserver/tightvnc-filetransfer/filetransfermsg.c,
-	libvncserver/tightvnc-filetransfer/filetransfermsg.h,
-	libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c,
-	libvncserver/tightvnc-filetransfer/handlefiletransferrequest.h,
-	libvncserver/tightvnc-filetransfer/rfbtightproto.h,
-	libvncserver/tightvnc-filetransfer/rfbtightserver.c, rfb/rfb.h: This
-	monster commit contains support for TightVNC's file transfer
-	protocol.  Thank you very much, Rohit!
-
-2005-09-27  dscho <dscho>
-
-	* ChangeLog, libvncserver/cargs.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/sockets.c, rfb/rfb.h: 
-	Introduce generic protocol extension method. Deprecate the
-	processCustomClientMessage() method.
-
-2005-09-27  dscho <dscho>
-
-	* libvncserver/auth.c, libvncserver/main.c, rfb/rfb.h: Security is
-	global. This was a misguided attempt to evade a global list.  I
-	eventually saw the light and went with Rohit�s original approach.
-
-2005-09-27  dscho <dscho>
-
-	* client_examples/Makefile.am, client_examples/vnc2mpg.c: support
-	new ffmpeg version
-
-2005-09-26  dscho <dscho>
-
-	* ChangeLog, libvncserver/auth.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, rfb/rfb.h, rfb/rfbproto.h: support VNC
-	protocol version 3.7
-
-2005-08-22  dscho <dscho>
-
-	* prepare_x11vnc_dist.sh: for x11vnc standalone package, adaptions
-	were needed after changing LibVNCServer.spec.in
-
-2005-08-21  dscho <dscho>
-
-	* AUTHORS, ChangeLog, LibVNCServer.spec.in: split rpm into three
-	packages: the library, -devel (headers), and x11vnc
-
-2005-07-18  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: more gui fixes, gui requests via client_sock,
-	 PASSWD_REQUIRED build opt.
-
-2005-07-13  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: setup for new release 0.7.3 while I remember how..
-
-2005-07-13  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: tweaks for release, fix queue buildup under -viewonly.
-
-2005-07-11  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: more improvements to gui, scary nopassword warning msg.
-
-2005-07-09  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -grab_buster for XGrabServer deadlock; fix scrolls and
-	 copyrect for -clip and -id
-
-2005-07-07  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -gui tray now embeds in systray; more improvements to gui.
-
-2005-07-02  runge <runge>
-
-	* ChangeLog, libvncserver/httpd.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: -gui tray mode, httpd.c: check httpListenSock >= 0.
-
-2005-06-28  dscho <dscho>
-
-	* ChangeLog, TODO, libvncclient/zrle.c: fix annoying zrle decoding
-	bug
-
-2005-06-27  runge <runge>
-
-	* ChangeLog, libvncserver/main.c:  main.c: fix screen->deferUpdateTime default.
-
-2005-06-27  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: track keycode state for heuristics, -sloppy_keys, -wmdt,
-	 add -nodbg as option
-
-2005-06-21  dscho <dscho>
-
-	* TODO: ZRLE has problems with RealVNC server. Look into it.
-
-2005-06-21  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: long info and tips when XOpenDisplay fails, reinstate "bad
-	 desktop" for wireframe
-
-2005-06-18  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  configure.ac: HP-UX and OSF1 no -R, x11vnc: second round of
-	 beta-testing fixes.
-
-2005-06-14  runge <runge>
-
-	* ChangeLog, configure.ac, libvncserver/cursor.c, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  main.c: XReadScreen check, fix 64bit use of cursors, x11vnc: first
-	 round of beta-testing fixes, RFE's.
-
-2005-06-11  dscho <dscho>
-
-	* ChangeLog, configure.ac: no longer complain on Solaris about
-	missing ar, which was not really missing
-
-2005-06-06  dscho <dscho>
-
-	* rfb/rfbproto.h: add definitions from other VNC implementations
-
-2005-06-06  dscho <dscho>
-
-	* TODO: more TODOs
-
-2005-06-06  dscho <dscho>
-
-	* client_examples/Makefile.am, configure.ac: link to libmp3lame only
-	if exists
-
-2005-06-04  runge <runge>
-
-	* ChangeLog, libvncserver/main.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  main.c: no sraRgnSubstract for copyRect, scrolls for x11vnc -scale;
-	 add -fixscreen
-
-2005-05-31  runge <runge>
-
-	* ChangeLog, libvncserver/main.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  main.c: fix copyRect for non-cursor-shape-aware clients.
-
-2005-05-25  dscho <dscho>
-
-	* index.html: news
-
-2005-05-25  runge <runge>
-
-	* ChangeLog, prepare_x11vnc_dist.sh, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: scrolling: grabserver, autorepeat throttling, mouse wheel,
-	 fix onetile
-
-2005-05-24  dscho <dscho>
-
-	* examples/.cvsignore: mac works!
-
-2005-05-24  dscho <dscho>
-
-	* Makefile.am, configure.ac: make libvncserver-conf executable the
-	autoconf way
-
-2005-05-24  dscho <dscho>
-
-	* Makefile.am: "make t" now executes the tests
-
-2005-05-24  dscho <dscho>
-
-	* libvncclient/Makefile.am: do distribute and depend on zrle.c
-
-2005-05-24  dscho <dscho>
-
-	* TODO, libvncclient/rfbproto.c, libvncclient/tight.c,
-	libvncclient/vncviewer.c, libvncclient/zlib.c, libvncclient/zrle.c,
-	test/encodingstest.c: implement ZRLE decoding
-
-2005-05-24  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: try 32 bit first
-
-2005-05-24  dscho <dscho>
-
-	* examples/example.c, libvncserver/font.c: fix off by one bug
-
-2005-05-23  dscho <dscho>
-
-	* libvncclient/tight.c, libvncclient/vncviewer.c: init a structure
-	*before* using it...
-
-2005-05-23  dscho <dscho>
-
-	* libvncclient/tight.c: remove wrong comment
-
-2005-05-23  dscho <dscho>
-
-	* libvncclient/rfbproto.c, libvncclient/tight.c,
-	libvncclient/vncviewer.c, libvncclient/zlib.c, rfb/rfbclient.h: make
-	zlib and tight handling thread safe (static -> rfbClient)
-
-2005-05-23  dscho <dscho>
-
-	* client_examples/vnc2mpg.c: work around bug in ffmpeg
-
-2005-05-23  dscho <dscho>
-
-	* ChangeLog, configure.ac: simplify configure (do not check for
-	malloc(0) bug)
-
-2005-05-23  dscho <dscho>
-
-	* client_examples/vnc2mpg.c: fix compilation for
-	LIBAVCODEC_BUILD==4754
-
-2005-05-20  dscho <dscho>
-
-	* acinclude.m4: finally fix socklen_t problem
-
-2005-05-18  dscho <dscho>
-
-	* acinclude.m4: fix socklen_t also for defines
-
-2005-05-18  dscho <dscho>
-
-	* ChangeLog, acinclude.m4, rfb/rfb.h: fix compilation for systems
-	without socklen_t
-
-2005-05-18  dscho <dscho>
-
-	* libvncserver/main.c: fix off by one bug
-
-2005-05-18  dscho <dscho>
-
-	* examples/vncev.c, libvncclient/listen.c, libvncclient/rfbproto.c,
-	libvncclient/sockets.c, libvncclient/vncviewer.c,
-	libvncserver/main.c, libvncserver/rfbserver.c,
-	libvncserver/vncauth.c, rfb/rfb.h, test/copyrecttest.c,
-	test/encodingstest.c, vncterm/VNCommand.c: hide strict ansi stuff if
-	not explicitely turned on; actually use the socklen_t test from
-	configure.ac
-
-2005-05-18  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: more scrolling, -scr_term, -wait_ui, -nowait_bog
-
-2005-05-17  dscho <dscho>
-
-	* libvncserver/Makefile.am: also distribute private.h...
-
-2005-05-17  dscho <dscho>
-
-	* TODO: update TODOs
-
-2005-05-16  dscho <dscho>
-
-	* libvncserver/rfbserver.c: fix SIGSEGV when client has incompatible
-	protocol; release mutex before freeing it
-
-2005-05-15  dscho <dscho>
-
-	* ChangeLog, VisualNaCro/configure.ac, VisualNaCro/default8x16.h,
-	VisualNaCro/nacro.c, client_examples/SDLvncviewer.c,
-	client_examples/ppmtest.c, contrib/zippy.c, examples/example.c,
-	examples/fontsel.c, examples/pnmshow.c, examples/pnmshow24.c,
-	examples/radon.h, examples/storepasswd.c, examples/vncev.c,
-	libvncclient/listen.c, libvncclient/rfbproto.c,
-	libvncclient/sockets.c, libvncclient/vncviewer.c,
-	libvncserver/auth.c, libvncserver/cargs.c, libvncserver/corre.c,
-	libvncserver/cursor.c, libvncserver/d3des.c, libvncserver/font.c,
-	libvncserver/hextile.c, libvncserver/httpd.c, libvncserver/main.c,
-	libvncserver/private.h, libvncserver/rfbregion.c,
-	libvncserver/rfbserver.c, libvncserver/rre.c,
-	libvncserver/selbox.c, libvncserver/sockets.c,
-	libvncserver/tight.c, libvncserver/translate.c,
-	libvncserver/vncauth.c, libvncserver/zlib.c, libvncserver/zrle.c,
-	libvncserver/zrleencodetemplate.c, libvncserver/zrleoutstream.c,
-	rfb/default8x16.h, rfb/rfb.h, rfb/rfbproto.h, test/copyrecttest.c,
-	test/cursortest.c, test/encodingstest.c, vncterm/VNCommand.c,
-	vncterm/VNConsole.c: ANSIfy, fix some warnings from Linus' sparse
-
-2005-05-15  runge <runge>
-
-	* libvncserver/main.c, libvncserver/rfbserver.c:  libvncserver/{main.c,rfbserver.c}: fix a couple more CopyRect
-	 memory leaks
-
-2005-05-14  dscho <dscho>
-
-	* .cvsignore, examples/.cvsignore, test/.cvsignore,
-	x11vnc/misc/.cvsignore: more files to ignore
-
-2005-05-14  dscho <dscho>
-
-	* ChangeLog, examples/example.c, libvncserver/main.c,
-	libvncserver/rfbserver.c: fix memory leaks detected using valgrind
-
-2005-05-14  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: more improvements to -scrollcopyrect and -xkb modes.
-
-2005-05-07  dscho <dscho>
-
-	* ChangeLog, VisualNaCro/nacro.c, VisualNaCro/nacro.h,
-	examples/example.c, examples/fontsel.c, libvncserver/httpd.c,
-	libvncserver/main.c, libvncserver/rfbserver.c,
-	libvncserver/sockets.c, rfb/rfb.h, test/cursortest.c,
-	vncterm/LinuxVNC.c, vncterm/VNConsole.c, x11vnc/x11vnc.c: 
-	socketInitDone -> socketState
-
-2005-05-03  runge <runge>
-
-	* ChangeLog, configure.ac, libvncserver/main.c:  libvncserver/main.c: fix memory leak in
-	 rfbDoCopyRect/rfbScheduleCopyRect; configure.ac tweaks.
-
-2005-05-03  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: -scrollcopyrect/RECORD, etc. configure.ac: customizations
-	 for x11vnc pkg
-
-2005-04-27  dscho <dscho>
-
-	* ChangeLog, libvncserver/rfbserver.c: clear requested region after
-	handling it
-
-2005-04-19  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/misc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: -wireframe, -wirecopyrect, -privremote, -safer, -nocmd,
-	 -unsafe, -noviewonly
-
-2005-04-12  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/misc/Makefile.am, x11vnc/misc/ranfb.pl:  x11vnc: add rawfb setup example misc/ranfb.pl
-
-2005-04-11  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/misc/slide.pl,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: fix some -rawfb bugs, add setup:cmd
-
-2005-04-10  runge <runge>
-
-	* ChangeLog, configure.ac, prepare_x11vnc_dist.sh,
-	x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/README,
-	x11vnc/misc/Makefile.am, x11vnc/misc/README,
-	x11vnc/misc/blockdpy.c, x11vnc/misc/dtVncPopup,
-	x11vnc/misc/rx11vnc, x11vnc/misc/rx11vnc.pl, x11vnc/misc/shm_clear,
-	x11vnc/misc/slide.pl, x11vnc/misc/vcinject.pl,
-	x11vnc/misc/x11vnc_loop, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -rawfb, -pipeinput, -xtrap, -flag, ...
-
-2005-04-04  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: use DEC-XTRAP on legacy X11R5, -shiftcmap, -http
-
-2005-03-29  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: fix event leaks, build-time customizations, -nolookup
-
-2005-03-20  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: scale cursors, speed up some scaling, alt arrows, -norepeat
-	 N
-
-2005-03-12  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: X DAMAGE support, -clip WxH+X+Y, identd.
-
-2005-03-09  dscho <dscho>
-
-	* test/encodingstest.c: fix compilation when no libz is available
-
-2005-03-07  dscho <dscho>
-
-	* configure.ac, rfb/rfbproto.h: do the in_addr_t stuff correctly...
-
-2005-03-07  dscho <dscho>
-
-	* configure.ac: check for in_addr_t
-
-2005-03-06  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: fix for older SDL versions
-
-2005-03-05  runge <runge>
-
-	* ChangeLog, Makefile.am, configure.ac, libvncserver/Makefile.am:  autoconf: rpm -> rpmbuild and echo -n -> printf
-
-2005-03-05  runge <runge>
-
-	* ChangeLog, libvncclient/sockets.c, libvncserver/cargs.c,
-	libvncserver/httpd.c, libvncserver/main.c, libvncserver/sockets.c,
-	rfb/rfb.h, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  add '-listen ipaddr' option
-
-2005-03-01  dscho <dscho>
-
-	* client_examples/ppmtest.c: do not crash when /tmp is not writable
-
-2005-02-23  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: final changes for 0.7.1 release.
-
-2005-02-22  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -nap is now the default, version str 0.7.1.
-
-2005-02-14  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -users lurk=, -solid for cde, -gui ez,.. beginner mode.
-
-2005-02-11  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc -input to fine tune allow user input.  per-client settings
-	 -R
-
-2005-02-09  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc -users, fix -solid on gnome/kde, configure.ac pwd.h wait.h
-	 and utmpx.h
-
-2005-02-07  runge <runge>
-
-	* ChangeLog, prepare_x11vnc_dist.sh:  prepare_x11vnc_dist.sh: few tweaks for next release
-
-2005-02-07  runge <runge>
-
-	* ChangeLog, configure.ac:  configure.ac: --with-jpeg=DIR --with-zlib=DIR, /usr/sfw
-
-2005-02-05  runge <runge>
-
-	* ChangeLog, tightvnc-1.3dev5-vncviewer-alpha-cursor.patch,
-	x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc -solid color, -opts; tightvnc unix viewer alpha patch
-
-2005-01-25  dscho <dscho>
-
-	* TODO, libvncserver/rfbserver.c: 10l: really fix preferredEncoding
-	set from outside
-
-2005-01-24  runge <runge>
-
-	* x11vnc/x11vnc.c:  whoops, test version of x11vnc.c leaked out...
-
-2005-01-24  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  sync with new cursor mechanism, -timeout, -noalphablend, try :0 if
-	 no other info
-
-2005-01-23  dscho <dscho>
-
-	* test/cursortest.c: test Floyd-Steinberg dither for alpha masks
-
-2005-01-21  dscho <dscho>
-
-	* TODO, libvncserver/cursor.c, rfb/rfb.h: implemented
-	Floyd-Steinberg dither in order to rfbMakeMaskFromAlphaSource
-
-2005-01-21  dscho <dscho>
-
-	* VisualNaCro/recorder.pl: use Getopt
-
-2005-01-21  dscho <dscho>
-
-	* libvncclient/vncviewer.c: if no argc & argv are passed, honour the
-	serverHost&serverPort which was set by the application
-
-2005-01-20  dscho <dscho>
-
-	* test/cursortest.c: no need to strdup for MakeXCursor
-
-2005-01-20  dscho <dscho>
-
-	* ChangeLog, libvncserver/cursor.c: disappearing cursor fixed &
-	debug message purged
-
-2005-01-20  dscho <dscho>
-
-	* libvncserver/cursor.c, libvncserver/main.c,
-	libvncserver/rfbserver.c: fix disappearing cursor
-
-2005-01-19  dscho <dscho>
-
-	* libvncserver/cursor.c: redraw region under old cursor even if the
-	old cursor doesn't have to be freed.
-
-2005-01-19  dscho <dscho>
-
-	* TODO: a granted wish has several children ;-)
-
-2005-01-19  dscho <dscho>
-
-	* test/encodingstest.c: fix test (don't show cursor...); correctly
-	set the encodings in the client; really test 20 seconds
-
-2005-01-19  dscho <dscho>
-
-	* libvncserver/cursor.c: oops, a debug message slipped through
-
-2005-01-18  dscho <dscho>
-
-	* ChangeLog, contrib/zippy.c, examples/example.c,
-	libvncserver/cursor.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/selbox.c, rfb/rfb.h,
-	vncterm/VNConsole.c, x11vnc/x11vnc.c: pointerClient was still
-	static.  do not make requestedRegion empty without reason.  the cursor handling for clients which don't handle CursorShape
-	updates was completely broken. It originally was very complicated
-	for performance reasons, however, in most cases it made performance
-	even worse, because at idle times there was way too much checking
-	going on, and furthermore, sometimes unnecessary updates were
-	inevitable.  The code now is much more elegant: the ClientRec structure knows
-	exactly where it last painted the cursor, and the ScreenInfo
-	structure knows where the cursor shall be.  As a consequence there is no more rfbDrawCursor()/rfbUndrawCursor(),
-	no more dontSendFramebufferUpdate, and no more isCursorDrawn.  It is
-	now possible to have clients which understand CursorShape updates
-	and clients which don't at the same time.  rfbSetCursor no longer has the option freeOld; this is obsolete, as
-	the cursor structure knows what to free and what not.
-
-2005-01-18  dscho <dscho>
-
-	* libvncserver/rfbregion.c, rfb/rfbregion.h: add convenience
-	function to clip using x2,y2 instead of w,h
-
-2005-01-18  dscho <dscho>
-
-	* test/Makefile.am, test/cursortest.c: add a cursor test
-	(interactive for now)
-
-2005-01-18  dscho <dscho>
-
-	* VisualNaCro/.cvsignore: more ignorance
-
-2005-01-17  dscho <dscho>
-
-	* index.html: LibVNCClient is included
-
-2005-01-17  dscho <dscho>
-
-	* index.html: alpha cursor and VisualNaCro news
-
-2005-01-16  dscho <dscho>
-
-	* VisualNaCro/.cvsignore: ignore generated files
-
-2005-01-16  runge <runge>
-
-	* ChangeLog, libvncserver/cursor.c, rfb/rfb.h, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  add cursor alphablending to rfb.h cursor.c, x11vnc -alphablend
-	 -snapfb etc..
-
-2005-01-14  dscho <dscho>
-
-	* VisualNaCro/Makefile.am, VisualNaCro/default8x16.h,
-	VisualNaCro/nacro.c, VisualNaCro/nacro.h, VisualNaCro/recorder.pl: 
-	fix most TODOs; recorder.pl now actually records something; add
-	nacro.pm to package
-
-2005-01-14  dscho <dscho>
-
-	* examples/example.c: reverted segfault fix; use rfbDrawCharWithClip
-
-2005-01-14  dscho <dscho>
-
-	* libvncserver/font.c: add comment "if col=bcol, assume background
-	is transparent"
-
-2005-01-14  dscho <dscho>
-
-	* libvncserver/main.c: fix comment
-
-2005-01-14  dscho <dscho>
-
-	* libvncserver/rfbserver.c: close socket in ClientConnectionGone
-
-2005-01-14  dscho <dscho>
-
-	* configure.ac: new version...
-
-2005-01-14  dscho <dscho>
-
-	* VisualNaCro/AUTHORS, VisualNaCro/ChangeLog,
-	VisualNaCro/Makefile.am, VisualNaCro/NEWS, VisualNaCro/README,
-	VisualNaCro/autogen.sh, VisualNaCro/configure.ac,
-	VisualNaCro/nacro.c, VisualNaCro/nacro.h, VisualNaCro/recorder.pl: 
-	VisualNacro, a visual macro recorder for VNC. Alpha version
-
-2005-01-14  dscho <dscho>
-
-	* libvncserver/main.c, rfb/rfb.h: return value of rfbProcessEvents
-	tells if an update was pending
-
-2005-01-14  dscho <dscho>
-
-	* libvncserver/font.c: fix segfault when trying to write outside of
-	frameBuffer
-
-2005-01-14  dscho <dscho>
-
-	* libvncclient/vncviewer.c: argc and argv may be zero (which means
-	to ignore them)
-
-2005-01-03  dscho <dscho>
-
-	* libvncserver/main.c, libvncserver/rfbserver.c, rfb/rfb.h: add hook
-	to allow for custom client messages
-
-2004-12-27  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/tkx11vnc,
-	x11vnc/tkx11vnc.h, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: improve XFIXES cursor transparency, more remote-control
-	 cmds.
-
-2004-12-23  runge <runge>
-
-	* x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: need tkx11vnc and tkx11vnc.h in x11vnc package
-
-2004-12-23  runge <runge>
-
-	* x11vnc/Makefile.am:  x11vnc: need tkx11vnc and tkx11vnc.h in x11vnc package
-
-2004-12-23  runge <runge>
-
-	* x11vnc/Makefile.am:  x11vnc: need tkx11vnc and tkx11vnc.h in x11vnc package
-
-2004-12-23  runge <runge>
-
-	* prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: minor tweaks for x11vnc 0.7 file release
-
-2004-12-20  dscho <dscho>
-
-	* index.html: Ooh, I'm lazy. Some news were added retroactively.
-
-2004-12-20  dscho <dscho>
-
-	* ChangeLog, configure.ac, index.html: released 0.7
-
-2004-12-20  dscho <dscho>
-
-	* examples/mac.c: compile fix on mac; still untested...
-
-2004-12-20  dscho <dscho>
-
-	* test/Makefile.am: fix for MinGW
-
-2004-12-20  runge <runge>
-
-	* x11vnc/README, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: minor tweaks for 0.7 file release
-
-2004-12-20  runge <runge>
-
-	* ChangeLog, libvncserver/cursor.c, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: synchronous mode for -remote, string cleanup
-
-2004-12-17  dscho <dscho>
-
-	* libvncserver/cursor.c: don't mix up width & height!
-
-2004-12-17  runge <runge>
-
-	* ChangeLog, test/encodingstest.c, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/tkx11vnc, x11vnc/tkx11vnc.h, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: XFIXES cursorshape, XRANDR resize, remote control, gui
-
-2004-12-01  dscho <dscho>
-
-	* rfb/rfb.h: fix compilation on non MinGW32...
-
-2004-12-01  dscho <dscho>
-
-	* ChangeLog, TODO, client_examples/Makefile.am,
-	client_examples/SDLvncviewer.c, configure.ac, contrib/Makefile.am,
-	examples/Makefile.am, examples/vncev.c, libvncclient/listen.c,
-	libvncclient/rfbproto.c, libvncclient/sockets.c,
-	libvncclient/vncviewer.c, libvncserver-config.in,
-	libvncserver/httpd.c, libvncserver/main.c, libvncserver/sockets.c,
-	rfb/rfb.h, rfb/rfbproto.h, test/Makefile.am, vncterm/Makefile.am,
-	x11vnc/Makefile.am: support MinGW32!
-
-2004-12-01  dscho <dscho>
-
-	* AUTHORS, libvncclient/listen.c, libvncclient/sockets.c,
-	libvncclient/vncviewer.c: use rfbClientErr to log errors, check if
-	calloc succeded (both hinted by Andre Leiradella)
-
-2004-11-30  dscho <dscho>
-
-	* ChangeLog, libvncclient/sockets.c: fix long reads (in some events
-	of success, no TRUE was returned)
-
-2004-11-30  dscho <dscho>
-
-	* rfb/rfbproto.h: add EncodingUltra; it is not implemented in the
-	libraries yet, so this is just a place holder
-
-2004-10-16  dscho <dscho>
-
-	* TODO: TODOs from encodingstest
-
-2004-10-16  dscho <dscho>
-
-	* test/.cvsignore: tight-1 -> encodingstest
-
-2004-10-16  dscho <dscho>
-
-	* test/Makefile.am, test/encodingstest.c, test/tight-1.c: rename
-	tight-1.c into encodingstest.c, fixing it in the process. It now
-	passes all encodings except corre (broken) and zrle (not yet
-	implemented in libvncclient)
-
-2004-10-16  dscho <dscho>
-
-	* libvncclient/rfbproto.c, libvncclient/sockets.c,
-	libvncclient/tight.c, libvncclient/vncviewer.c,
-	libvncclient/zlib.c, rfb/rfbclient.h: move read buffer to rfbClient
-	structure (thread safety); make rfbClientLog overrideable
-
-2004-10-15  dscho <dscho>
-
-	* test/tight-1.c: compiles, 1st run is okay, 2nd and subsequent give
-	errors. Evidently, libvncclient is not yet reentrant (or
-	threadsafe).
-
-2004-10-15  dscho <dscho>
-
-	* libvncclient/vncviewer.c: no need to modify argv
-
-2004-10-15  dscho <dscho>
-
-	* TODO: ideas
-
-2004-10-15  dscho <dscho>
-
-	* test/tight-1.c: compiling, non functional version of a unit test
-	for encodings
-
-2004-10-04  dscho <dscho>
-
-	* TODO: cursor problem
-
-2004-10-02  dscho <dscho>
-
-	* libvncserver/rfbserver.c: release client list mutex earlier
-
-2004-09-14  dscho <dscho>
-
-	* index.html, success.html: added success stories and link to
-	x11vnc's home
-
-2004-09-14  dscho <dscho>
-
-	* success.html: add success stories (only one at the moment)
-
-2004-09-07  dscho <dscho>
-
-	* index.html: new API
-
-2004-09-03  dscho <dscho>
-
-	* libvncserver/rfbregion.c: output only via rfbErr
-
-2004-09-03  dscho <dscho>
-
-	* libvncserver-config.in: libvncserver.a is in libvncserver/ now
-
-2004-09-01  runge <runge>
-
-	* ChangeLog, prepare_x11vnc_dist.sh, x11vnc/ChangeLog,
-	x11vnc/README, x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: new pointer input handling algorithm; x11vnc pkg installs
-	 java viewer
-
-2004-08-30  dscho <dscho>
-
-	* ChangeLog: API changes
-
-2004-08-30  dscho <dscho>
-
-	* contrib/zippy.c, examples/colourmaptest.c, examples/example.c,
-	examples/pnmshow.c, examples/pnmshow24.c, examples/storepasswd.c,
-	examples/vncev.c, libvncclient/rfbproto.c, libvncserver/auth.c,
-	libvncserver/cargs.c, libvncserver/corre.c, libvncserver/cursor.c,
-	libvncserver/d3des.c, libvncserver/d3des.h, libvncserver/font.c,
-	libvncserver/hextile.c, libvncserver/httpd.c, libvncserver/main.c,
-	libvncserver/rfbserver.c, libvncserver/rre.c,
-	libvncserver/selbox.c, libvncserver/sockets.c,
-	libvncserver/stats.c, libvncserver/tight.c,
-	libvncserver/translate.c, libvncserver/vncauth.c,
-	libvncserver/zlib.c, libvncserver/zrle.c, rfb/rfb.h,
-	rfb/rfbproto.h, test/cargstest.c, test/copyrecttest.c,
-	vncterm/LinuxVNC.c, vncterm/VNConsole.c, vncterm/VNConsole.h,
-	x11vnc/x11vnc.c: global structures/functions should have "rfb",
-	"sra" or "zrle" as prefix, while structure members should not
-
-2004-08-30  dscho <dscho>
-
-	* client_examples/Makefile.am: my ffmpeg was compiled with
-	mp3lame...
-
-2004-08-30  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/README,
-	x11vnc/x11vnc.1, x11vnc/x11vnc.c:  x11vnc: -cursor change shape handling, configure.ac: add more
-	 macros for X extensions
-
-2004-08-17  dscho <dscho>
-
-	* index.html: news: QEMU patch v6
-
-2004-08-15  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/README, x11vnc/x11vnc.1,
-	x11vnc/x11vnc.c:  x11vnc: -overlay to fix colors with Sun 8+24 overlay visuals. -sid
-	 option.
-
-2004-08-04  runge <runge>
-
-	* x11vnc/README, x11vnc/x11vnc.1:  fix XKBlib.h detection on *BSD, x11vnc: manpage and README
-
-2004-08-04  runge <runge>
-
-	* ChangeLog, configure.ac, prepare_x11vnc_dist.sh,
-	x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/x11vnc.c:  fix XKBlib.h detection on *BSD, x11vnc: manpage and README
-
-2004-07-31  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: adjust version number and output
-
-2004-07-31  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: -cursorpos now the default, fix cursorpos + scaling bug.
-
-2004-07-29  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: -add_keysyms dynamically add missing keysyms to X server
-
-2004-07-27  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: -xkb (XKEYBOARD modtweak), -skip_keycodes, multi lines in
-	 x11vncrc
-
-2004-07-19  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: ignore keysyms >4 for a keycode, add lastmod to -help,
-	 -version
-
-2004-07-16  runge <runge>
-
-	* ChangeLog, configure.ac, x11vnc/ChangeLog, x11vnc/x11vnc.c:  modtweak is now the default for x11vnc; check X11/XKBlib.h in
-	 configure.ac
-
-2004-07-11  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: -norepeat to turn off X server autorepeat when clients
-	 exist.
-
-2004-07-05  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: extend -allow to re-read a file with allowed IP addresses.
-
-2004-07-02  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: improve scaled grid calc to regain text compression. add
-	 :pad option
-
-2004-06-30  dscho <dscho>
-
-	* libvncclient/vncviewer.c: do not use GNU-only getline
-
-2004-06-28  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: round scaled width to multiple of 4 to make vncviewer
-	 happy.
-
-2004-06-27  runge <runge>
-
-	* x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: speed up scaling a bit, add no blending option to -scale
-
-2004-06-26  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: add "-scale fraction" for global server-side scaling.
-
-2004-06-18  dscho <dscho>
-
-	* libvncserver/zrleencodetemplate.c, test/tight-1.c,
-	vncterm/LinuxVNC.c, vncterm/VNCommand.c, vncterm/VNConsole.c,
-	vncterm/example.c: convert c++ comments to c comments
-
-2004-06-18  dscho <dscho>
-
-	* libvncserver/sockets.c: debug
-
-2004-06-18  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: cleanups; libvncclient supports
-	-encodings already
-
-2004-06-18  dscho <dscho>
-
-	* client_examples/vnc2mpg.c: cleanups; support vncrec'orded files as
-	input
-
-2004-06-18  dscho <dscho>
-
-	* examples/example.c, examples/pnmshow.c, examples/pnmshow24.c: now
-	that the examples reside in a subdirectory, the classes path has to
-	be adapted
-
-2004-06-18  dscho <dscho>
-
-	* rfb/rfbclient.h: more comments; support playing vncrec'orded files
-
-2004-06-18  dscho <dscho>
-
-	* libvncclient/rfbproto.c, libvncclient/sockets.c,
-	libvncclient/vncviewer.c: support password reading with getpass();
-	support -play to play vncrec'orded files
-
-2004-06-17  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: simple ~/.x11vncrc config file support, -rc, -norc
-
-2004-06-15  dscho <dscho>
-
-	* TODO: fixed
-
-2004-06-15  dscho <dscho>
-
-	* libvncclient/hextile.c: fix silly hextile bug
-
-2004-06-15  dscho <dscho>
-
-	* libvncclient/rfbproto.c: recognize more encodings
-
-2004-06-15  dscho <dscho>
-
-	* libvncclient/sockets.c: debug
-
-2004-06-15  dscho <dscho>
-
-	* libvncserver/rfbserver.c: fix CoRRE with maxRectsPerUpdate bug
-
-2004-06-15  dscho <dscho>
-
-	* libvncclient/rfbproto.c: fix silly update bug with raw encoding
-
-2004-06-12  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: -clear_mods -clear_keys -storepasswd, add RFB_SERVER_IP
-	 RFB_SERVER_PORT to -accept/-gone
-
-2004-06-08  dscho <dscho>
-
-	* client_examples/Makefile.am, configure.ac: fix compilation on IRIX
-
-2004-06-08  dscho <dscho>
-
-	* configure.ac: fix test for sdl
-
-2004-06-08  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: fix compilation on MacOSX
-
-2004-06-07  dscho <dscho>
-
-	* index.html: layout and wording fix
-
-2004-06-07  dscho <dscho>
-
-	* index.html: more news
-
-2004-06-07  dscho <dscho>
-
-	* .cvsignore, prepare_x11vnc_dist.sh: now that it is released,
-	increment x11vnc's version
-
-2004-06-07  dscho <dscho>
-
-	* .cvsignore, client_examples/.cvsignore, libvncclient/.cvsignore,
-	libvncserver/.cvsignore, test/.cvsignore, x11vnc/.cvsignore: all
-	this moving and renaming needs changes in the cvsignores, too!
-
-2004-06-07  dscho <dscho>
-
-	* LibVNCServer.spec.in, Makefile.am, libvncserver.spec.in,
-	prepare_x11vnc_dist.sh: fix bug 968264: make rpm did not work with
-	x11vnc package
-
-2004-06-07  dscho <dscho>
-
-	* client_examples/Makefile.am, client_examples/vnc2mpg.c,
-	configure.ac: add vnc2mpg, a program which makes a movie from a VNC
-	desktop using FFMPEG
-
-2004-06-07  dscho <dscho>
-
-	* TODO, client_examples/SDLvncviewer.c: added -encodings
-
-2004-06-07  dscho <dscho>
-
-	* ChangeLog, TODO, libvncserver/cursor.c, rfb/rfb.h: fix cursor
-	trails (when not using cursor encoding and moving the cursor, the
-	redrawn part of the screen didn't get updated, and so left cursor
-	trails).
-
-2004-06-07  dscho <dscho>
-
-	* client_examples/SDLvncviewer.c: add mouse button handling
-
-2004-06-07  dscho <dscho>
-
-	* ChangeLog, Makefile.am, TODO, client_examples/Makefile.am,
-	client_examples/SDLvncviewer.c, client_examples/ppmtest.c,
-	configure.ac, contrib/Makefile.am, examples/Makefile.am,
-	examples/blooptest.c, examples/copyrecttest.c,
-	libvncclient/Makefile.am, libvncclient/client_test.c,
-	libvncclient/sockets.c, libvncclient/vncviewer.c,
-	libvncserver/Makefile.am, prepare_x11vnc_dist.sh, rfb/rfbclient.h,
-	test/Makefile.am, test/blooptest.c, test/copyrecttest.c,
-	test/tight-1.c, x11vnc/Makefile.am: add client_examples/, add
-	SDLvncviewer, libvncclient API changes, suppress automake CFLAGS
-	nagging
-
-2004-06-06  runge <runge>
-
-	* ChangeLog, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: rearrange file for easier maintenance, add RFB_CLIENT_COUNT
-	 to -accept/-gone
-
-2004-05-28  runge <runge>
-
-	* x11vnc/x11vnc.c: [no log message]
-
-2004-05-27  runge <runge>
-
-	* ChangeLog, libvncserver/main.c, libvncserver/rfbserver.c,
-	prepare_x11vnc_dist.sh, x11vnc/ChangeLog, x11vnc/x11vnc.c:  x11vnc: view-only plain passwd: -viewpasswd and 2nd line of
-	 -passwdfile
-
-2004-05-25  dscho <dscho>
-
-	* prepare_x11vnc_dist.sh: a script which automatically converts a
-	few files to make an x11vnc release
-
-2004-05-25  dscho <dscho>
-
-	* configure.ac: -lvncserver is not default now
-
-2004-05-25  dscho <dscho>
-
-	* ChangeLog, Makefile.am, auth.c, cargs.c, configure.ac,
-	contrib/ChangeLog, contrib/Makefile.am, contrib/x11vnc.c, corre.c,
-	cursor.c, cutpaste.c, d3des.c, d3des.h, draw.c,
-	examples/Makefile.am, examples/regiontest.c, font.c, hextile.c,
-	httpd.c, libvncclient/rfbproto.c, libvncserver/Makefile.am,
-	libvncserver/auth.c, libvncserver/cargs.c, libvncserver/config.h,
-	libvncserver/corre.c, libvncserver/cursor.c,
-	libvncserver/cutpaste.c, libvncserver/d3des.c,
-	libvncserver/d3des.h, libvncserver/draw.c, libvncserver/font.c,
-	libvncserver/hextile.c, libvncserver/httpd.c, libvncserver/main.c,
-	libvncserver/rfbconfig.h, libvncserver/rfbregion.c,
-	libvncserver/rfbserver.c, libvncserver/rre.c,
-	libvncserver/selbox.c, libvncserver/sockets.c,
-	libvncserver/stats.c, libvncserver/tableinit24.c,
-	libvncserver/tableinitcmtemplate.c,
-	libvncserver/tableinittctemplate.c,
-	libvncserver/tabletrans24template.c,
-	libvncserver/tabletranstemplate.c, libvncserver/tight.c,
-	libvncserver/translate.c, libvncserver/vncauth.c,
-	libvncserver/zlib.c, libvncserver/zrle.c,
-	libvncserver/zrleencodetemplate.c, libvncserver/zrleoutstream.c,
-	libvncserver/zrleoutstream.h, libvncserver/zrlepalettehelper.c,
-	libvncserver/zrlepalettehelper.h, libvncserver/zrletypes.h, main.c,
-	rfbregion.c, rfbserver.c, rre.c, selbox.c, sockets.c, stats.c,
-	tableinit24.c, tableinitcmtemplate.c, tableinittctemplate.c,
-	tabletrans24template.c, tabletranstemplate.c, test/Makefile.am,
-	tight.c, translate.c, vncauth.c, vncterm/Makefile.am,
-	x11vnc/ChangeLog, x11vnc/Makefile.am, x11vnc/x11vnc.c, zlib.c,
-	zrle.c, zrleencodetemplate.c, zrleoutstream.c, zrleoutstream.h,
-	zrlepalettehelper.c, zrlepalettehelper.h, zrletypes.h: move the
-	library into libvncserver/, x11vnc into x11vnc/
-
-2004-05-22  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c, httpd.c:  x11vnc: -gone, -passwdfile, -o logfile; add view-only to -accept
-
-2004-05-14  runge <runge>
-
-	* contrib/x11vnc.c:  x11vnc: more -inetd fixes.
-
-2004-05-14  runge <runge>
-
-	* contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: less fprintf under -q so '-q -inetd' has no stderr output.
-
-2004-05-13  runge <runge>
-
-	* contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: improvements to -accept popup: yes/no buttons and timeout.
-
-2004-05-08  runge <runge>
-
-	* contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: clean up -Wall warnings.
-
-2004-05-08  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: add -accept some-command/xmessage/popup
-
-2004-05-06  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: mouse -> keystroke and keystroke -> mouse remappings.
-
-2004-05-05  dscho <dscho>
-
-	* rfbserver.c, sockets.c: prevent segmentation fault when requested
-	area is too big; if select is interrupted while WriteExact, just try
-	again.
-
-2004-04-28  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: add -auth, more -cursorpos and -nofb work
-
-2004-04-20  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: add -cursorpos for Cursor Position Updates, and -sigpipe
-
-2004-04-19  dscho <dscho>
-
-	* main.c: ignore SIGPIPE the correct way
-
-2004-04-13  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc: do not send selection unless all clients are in RFB_NORMAL
-	 state.  increase rfbMaxClientWait when threaded to avoid
-	ReadExact() timeouts for some viewers.
-
-2004-04-12  dscho <dscho>
-
-	* configure.ac: fix compilation without jpeg and a certain autoconf
-	version
-
-2004-04-08  runge <runge>
-
-	* ChangeLog, configure.ac, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc options -blackout, -xinerama, -xwarppointer.  check cargs.   modify configure.ac to pick up -lXinerama
-
-2004-03-24  dscho <dscho>
-
-	* examples/pnmshow.c: add support for pgm and pbm (8-bit and 1-bit
-	grayscale images)
-
-2004-03-22  dscho <dscho>
-
-	* ChangeLog, cargs.c, test/Makefile.am, test/cargstest.c: fix
-	cargs.c: arguments were not correctly purged.
-
-2004-03-15  dscho <dscho>
-
-	* ChangeLog, libvncserver-config.in: fix --link for
-	libvncserver-config
-
-2004-03-11  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc options -vncconnect, -connect, -remap,  -debug_pointer, and -debug_keyboard  add reverse connections, keysym remapping,  and debug output option
-
-2004-02-29  dscho <dscho>
-
-	* index.html: link to pre.tar.gz, mention valgrind
-
-2004-02-29  dscho <dscho>
-
-	* index.html: update on news
-
-2004-02-29  dscho <dscho>
-
-	* ChangeLog, rfbregion.c: fixed valgrind warning
-
-2004-02-20  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc options -nosel -noprimary -visual.   add clipboard/selection handling.   add visual option (mostly for testing and workarounds).   improve shm cleanup on failures.
-
-2004-02-04  dscho <dscho>
-
-	* AUTHORS, ChangeLog, examples/colourmaptest.c,
-	examples/copyrecttest.c, examples/example.c, examples/simple.c,
-	examples/simple15.c, examples/vncev.c: make examples g++
-	compileable, thanks to Juan Jose Costello
-
-2004-01-30  dscho <dscho>
-
-	* ChangeLog, rfbserver.c: memory leaks fixed
-
-2004-01-29  dscho <dscho>
-
-	* ChangeLog, Makefile.am, configure.ac, tight.c, zlib.c, zrle.c,
-	zrleencodetemplate.c, zrleoutstream.c, zrleoutstream.h,
-	zrlepalettehelper.c, zrlepalettehelper.h: Honour the check for libz,
-	libjpeg again
-
-2004-01-21  dscho <dscho>
-
-	* ChangeLog, cargs.c, main.c, rfb/rfb.h, rfbserver.c: add
-	"-progressive height" option to make SendFramebufferUpdate
-	"preemptive"
-
-2004-01-21  dscho <dscho>
-
-	* ChangeLog: update
-
-2004-01-21  dscho <dscho>
-
-	* examples/.cvsignore: ignore all test programs
-
-2004-01-21  dscho <dscho>
-
-	* examples/Makefile.am, examples/copyrecttest.c: add a simple
-	example how to use rfbDoCopyRect
-
-2004-01-21  dscho <dscho>
-
-	* main.c, rfb/rfb.h: ignore SIGPIPE by default; it is handled via
-	EPIPE
-
-2004-01-21  dscho <dscho>
-
-	* cursor.c: do not send unnecessary updated because of cursor
-	drawing
-
-2004-01-19  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  handle mouse button number mismatch  improved pointer input handling during drags, etc.   somewhat faster copy_tiles() -> copy_tiles()  x11vnc options -buttonmap -old_pointer -old_copytile
-
-2004-01-19  dscho <dscho>
-
-	* configure.ac: 0.6 is out... version is 0.7pre now
-
-2004-01-19  dscho <dscho>
-
-	* vncterm/Makefile.am: inherit CFLAGS
-
-2004-01-19  dscho <dscho>
-
-	* vncterm/VNConsole.c: fix usage of non-existent attribute buffer
-
-2004-01-16  dscho <dscho>
-
-	* ChangeLog, cargs.c, configure.ac, contrib/Makefile.am,
-	rfbserver.c, vncauth.c: compile fix for cygwin
-
-2004-01-10  runge <runge>
-
-	* ChangeLog, contrib/ChangeLog, contrib/x11vnc.c:  x11vnc options -allow, -localhost, -nodragging, -input_skip  minimize memory usage under -nofb
-
-2003-12-09  dscho <dscho>
-
-	* libvncclient/hextile.c: fix compilation with Mac OSX: preprocessor
-	can't do recursive macros
-
-2003-12-09  runge <runge>
-
-	* ChangeLog, configure.ac, contrib/ChangeLog, contrib/x11vnc.c: 
-	x11vnc: XBell events, -nofb, -notruecolor, misc. cleaning
-
-2003-11-27  dscho <dscho>
-
-	* index.html: fixed link
-
-2003-11-11  dscho <dscho>
-
-	* ChangeLog, contrib/x11vnc.c: -inetd, -noshm and friends added
-
-2003-11-07  dscho <dscho>
-
-	* ChangeLog, README.cvs, configure.ac: release 0.6
-
-2003-10-08  dscho <dscho>
-
-	* zrle.c: fix gcc 2.x compilation: no C99
-
-2003-09-11  markmc <markmc>
-
-	* ChangeLog, Makefile.in, aclocal.m4, bootstrap.sh,
-	classes/.cvsignore, classes/Makefile.in, config.h.in, configure,
-	contrib/Makefile.in, depcomp, examples/Makefile.in, install-sh,
-	libvncclient/Makefile.in, missing, mkinstalldirs, test/.cvsignore,
-	test/Makefile.in, vncterm/Makefile.in: 2002-09-11  Mark McLoughlin
-	<mark at skynet.ie>         * Makefile.in, */Makefile.in, aclocal.m4,           bootstrap.sh, config.h.in, configure,           depcomp, install-sh, missing, mkinstalldirs,         Removed auto-generated files from CVS.
-
-2003-09-11  markmc <markmc>
-
-	* ChangeLog, NEWS, rdr/Exception.h, rdr/FdInStream.cxx,
-	rdr/FdInStream.h, rdr/FdOutStream.cxx, rdr/FdOutStream.h,
-	rdr/FixedMemOutStream.h, rdr/InStream.cxx, rdr/InStream.h,
-	rdr/MemInStream.h, rdr/MemOutStream.h, rdr/NullOutStream.cxx,
-	rdr/NullOutStream.h, rdr/OutStream.h, rdr/ZlibInStream.cxx,
-	rdr/ZlibInStream.h, rdr/ZlibOutStream.cxx, rdr/ZlibOutStream.h,
-	rdr/types.h, zrle.cxx, zrleDecode.h, zrleEncode.h: 2003-09-11  Mark
-	McLoughlin  <mark at skynet.ie>         * rdr/Exception.h, rdr/FdInStream.cxx, rdr/FdInStream.h,           rdr/FdOutStream.cxx, rdr/FdOutStream.h,
-	          rdr/FixedMemOutStream.h, rdr/InStream.cxx, rdr/InStream.h,
-	          rdr/MemInStream.h, rdr/MemOutStream.h, rdr/NullOutStream.cxx,
-	          rdr/NullOutStream.h, rdr/OutStream.h, rdr/ZlibInStream.cxx,
-	          rdr/ZlibInStream.h, rdr/ZlibOutStream.cxx, rdr/ZlibOutStream.h,
-	          rdr/types.h, zrle.cxx, zrleDecode.h, zrleEncode.h: remove original         C++ ZRLE implementation. Its been ported to C.          * NEWS: copy the existing ChangeLog to here and make         this a more detailed ChangeLog.
-
-2003-09-08  dscho <dscho>
-
-	* AUTHORS, ChangeLog, Makefile.am, Makefile.in, autogen.sh,
-	classes/Makefile.in, config.h.in, configure, configure.ac,
-	contrib/Makefile.in, examples/Makefile.in,
-	libvncclient/Makefile.in, rfb/rfb.h, rfb/rfbproto.h, rfbserver.c,
-	test/Makefile.in, vncterm/Makefile.in, zrle.c,
-	zrleencodetemplate.c, zrleoutstream.c, zrleoutstream.h,
-	zrlepalettehelper.c, zrlepalettehelper.h, zrletypes.h: ZRLE no
-	longer uses C++, but C
-
-2003-08-29  dscho <dscho>
-
-	* ChangeLog, Makefile.in, configure, configure.ac,
-	libvncclient/Makefile.in, test/Makefile.in, vncterm/Makefile.in: 
-	added --disable-cxx flag to configure
-
-2003-08-18  dscho <dscho>
-
-	* contrib/x11vnc.c: Karl Runge: 8bpp handling now much better,
-	single window also, many improvements
-
-2003-08-18  dscho <dscho>
-
-	* httpd.c, main.c, rfbserver.c, sockets.c: socklen_t -> size_t
-
-2003-08-18  dscho <dscho>
-
-	* Makefile.in, aclocal.m4, classes/Makefile.in, config.h.in,
-	contrib/Makefile.in, examples/Makefile.in, vncterm/Makefile.in: 
-	using autoconf 1.6
-
-2003-08-09  dscho <dscho>
-
-	* README: added Projects section
-
-2003-08-08  dscho <dscho>
-
-	* .cvsignore, classes/.cvsignore, libvncclient/.cvsignore,
-	test/.cvsignore: more files to ignore
-
-2003-08-08  dscho <dscho>
-
-	* libvncclient/rfbproto.c, libvncclient/tight.c,
-	libvncclient/zlib.c, main.c, rfbserver.c: make --without-jpeg,
-	--without-zlib work
-
-2003-08-08  dscho <dscho>
-
-	* AUTHORS, configure, configure.ac: add --without-jpeg,
-	--without-zlib; repair --without-backchannel, --without-24bpp
-
-2003-08-08  dscho <dscho>
-
-	* httpd.c, sockets.c: handle EINTR after select()
-
-2003-08-06  dscho <dscho>
-
-	* ChangeLog, auth.c, contrib/x11vnc.c, examples/fontsel.c,
-	examples/mac.c, httpd.c, main.c, rfb/rfb.h, rfbregion.c,
-	rfbserver.c, rre.c, sockets.c, translate.c, vncterm/LinuxVNC.c,
-	vncterm/VNCommand.c, zlib.c: rfbErr introduced
-
-2003-08-03  dscho <dscho>
-
-	* rfb/rfbproto.h: forgot to change WORDS_BIGENDIAN to
-	LIBVNCSERVER_BIGENDIAN; #undef VERSION unneccessary...
-
-2003-08-02  dscho <dscho>
-
-	* config.h.in, configure, configure.ac: really check for setsid, not
-	pgrp
-
-2003-08-02  dscho <dscho>
-
-	* main.c: overlooked endian config.h constant
-
-2003-08-02  dscho <dscho>
-
-	* config.h.in: required file
-
-2003-08-01  dscho <dscho>
-
-	* README, configure, configure.ac: mention NEWS in README, add
-	checks for fork and setpgrp
-
-2003-07-31  dscho <dscho>
-
-	* ChangeLog: credit last two changes to Erik
-
-2003-07-31  dscho <dscho>
-
-	* main.c, rfb/rfb.h, sockets.c: rfbLog can be overridden; EINTR on
-	read/write means just try again
-
-2003-07-30  dscho <dscho>
-
-	* Makefile.am, Makefile.in, rfb/rfb.h, rfb/rfbclient.h: add
-	rfbclient.h to distribution; avoid C++ style comments
-
-2003-07-30  dscho <dscho>
-
-	* AUTHORS, ChangeLog, Makefile.in, NEWS, README, acinclude.m4,
-	aclocal.m4, auth.c, cargs.c, classes/Makefile.in, configure,
-	configure.ac, contrib/Makefile.in, contrib/x11vnc.c,
-	contrib/zippy.c, corre.c, cursor.c, cutpaste.c, draw.c,
-	examples/Makefile.in, examples/example.c, examples/mac.c,
-	examples/pnmshow.c, examples/pnmshow24.c, examples/vncev.c, font.c,
-	hextile.c, httpd.c, libvncclient/Makefile.in, libvncclient/corre.c,
-	libvncclient/cursor.c, libvncclient/hextile.c,
-	libvncclient/listen.c, libvncclient/rfbproto.c, libvncclient/rre.c,
-	libvncclient/sockets.c, libvncclient/tight.c,
-	libvncclient/vncviewer.c, libvncclient/zlib.c, main.c, rfb/rfb.h,
-	rfb/rfbclient.h, rfb/rfbconfig.h.in, rfb/rfbproto.h,
-	rfb/rfbregion.h, rfbregion.c, rfbserver.c, rre.c, selbox.c,
-	sockets.c, stats.c, test/Makefile.in, tight.c, translate.c,
-	vncauth.c, vncterm/LinuxVNC.c, vncterm/Makefile.in,
-	vncterm/VNCommand.c, vncterm/VNConsole.c, vncterm/VNConsole.h,
-	zlib.c, zrle.cxx: API change: Bool, KeySym, Pixel get prefix "rfb";
-	constants in rfbconfig.h get prefix "LIBVNCSERVER_"
-
-2003-07-29  dscho <dscho>
-
-	* cursor.c, libvncclient/client_test.c, libvncclient/rfbproto.c,
-	libvncclient/vncviewer.c, main.c, rfb/rfb.h, rfb/rfbclient.h,
-	test/tight-1.c, tight.c: further valgrinding showed leaked mallocs
-
-2003-07-28  dscho <dscho>
-
-	* ChangeLog, README.cvs: adapted dox
-
-2003-07-28  dscho <dscho>
-
-	* libvncclient/Makefile: is autoconfed now
-
-2003-07-28  dscho <dscho>
-
-	* Makefile.am, Makefile.in, aclocal.m4, classes/Makefile.in,
-	configure, configure.ac, contrib/Makefile.in, contrib/x11vnc.c,
-	contrib/zippy.c, examples/1instance.c, examples/Makefile.in,
-	examples/fontsel.c, examples/mac.c, examples/pnmshow.c,
-	examples/pnmshow24.c, examples/vncev.c, libvncclient/Makefile,
-	libvncclient/Makefile.am, libvncclient/Makefile.in,
-	libvncclient/client_test.c, libvncclient/corre.c,
-	libvncclient/listen.c, libvncclient/rfbproto.c, libvncclient/rre.c,
-	libvncclient/sockets.c, libvncclient/tight.c,
-	libvncclient/vncviewer.c, libvncclient/zlib.c, main.c,
-	rdr/FdInStream.cxx, rdr/ZlibOutStream.cxx, rfb/rfb.h,
-	rfb/rfbclient.h, rfb/rfbconfig.h.in, rfbregion.c, rfbserver.c,
-	test/Makefile.am, test/Makefile.in, test/tight-1.c, tight.c,
-	vncterm/LinuxVNC.c, vncterm/Makefile.in, vncterm/VNCommand.c,
-	vncterm/VNConsole.c, vncterm/example.c: fixed maxRectsPerUpdate with
-	Tight encoding bug; some autoconfing; stderr should not be used in a
-	library (use rfbLog instead)
-
-2003-07-28  dscho <dscho>
-
-	* test/tight-1.c: first beginnings of automatic tests, thanks to
-	libvncclient
-
-2003-07-28  dscho <dscho>
-
-	* ChangeLog, TODO, main.c, rfb/rfb.h, rfb/rfbregion.h, rfbregion.c,
-	rfbserver.c, sockets.c, tight.c, vncauth.c: synced with TightVNC and
-	RealVNC
-
-2003-07-28  dscho <dscho>
-
-	* Makefile.am, Makefile.in, examples/Makefile.am,
-	examples/Makefile.in: debug flags
-
-2003-07-27  dscho <dscho>
-
-	* ChangeLog: libvncclient
-
-2003-07-27  dscho <dscho>
-
-	* libvncclient/Makefile, libvncclient/corre.c,
-	libvncclient/cursor.c, libvncclient/hextile.c,
-	libvncclient/listen.c, libvncclient/rfbproto.c, libvncclient/rre.c,
-	libvncclient/sockets.c, libvncclient/tight.c,
-	libvncclient/vncviewer.c, libvncclient/zlib.c, rfb/rfbclient.h,
-	vncauth.c: first alpha version of libvncclient
-
-2003-07-27  dscho <dscho>
-
-	* rfb/rfb.h, rfb/rfbproto.h, vncauth.c: make vncauth usable also for
-	upcoming libvncclient
-
-2003-07-25  dscho <dscho>
-
-	* ChangeLog, examples/.cvsignore, examples/Makefile.am,
-	examples/Makefile.in, examples/simple.c, examples/simple15.c,
-	index.html: Added simple examples
-
-2003-07-11  dscho <dscho>
-
-	* rfb/rfbconfig.h, rfb/rfbint.h: these files are generated by
-	configure
-
-2003-07-11  dscho <dscho>
-
-	* ChangeLog, httpd.c: long standing bug in http; was sending .jar
-	twice
-
-2003-07-10  dscho <dscho>
-
-	* INSTALL, Makefile.in, aclocal.m4, classes/Makefile.in, configure,
-	contrib/Makefile.in, depcomp, examples/Makefile.in, install-sh,
-	missing, mkinstalldirs, rfb/rfbconfig.h, rfb/rfbconfig.h.in,
-	rfb/rfbint.h, rfb/stamp-h.in, vncterm/Makefile.in: another try to
-	make CVS more helpful with configure
-
-2003-07-10  dscho <dscho>
-
-	* Makefile.am, classes/Makefile.am, configure.ac: also distribute
-	classes/ directory
-
-2003-07-10  dscho <dscho>
-
-	* cargs.c: fix compile
-
-2003-06-28  dscho <dscho>
-
-	* ChangeLog, cargs.c: http options inserted
-
-2003-05-05  dscho <dscho>
-
-	* configure.ac: fix am__fastdepCXX for system not having ZLIB
-
-2003-04-03  dscho <dscho>
-
-	* contrib/ChangeLog: added ChangeLog for x11vnc
-
-2003-04-03  dscho <dscho>
-
-	* contrib/x11vnc.c: new version from Karl!
-
-2003-02-28  dscho <dscho>
-
-	* Makefile.am, configure.ac, libvncserver-config.in: let
-	libvncserver-config behave as expected when called without
-	installing
-
-2003-02-27  dscho <dscho>
-
-	* README.cvs: added some documentation how to compile from CVS
-	sources
-
-2003-02-21  dscho <dscho>
-
-	* rfb/rfb.h: #include <rfb/rfbregion.h> instead of #include
-	"rfbregion.h"
-
-2003-02-20  dscho <dscho>
-
-	* ChangeLog: update ChangeLog
-
-2003-02-20  dscho <dscho>
-
-	* index.html: #include <rfb/rfb.h> instead of "rfb.h"
-
-2003-02-20  dscho <dscho>
-
-	* contrib/Makefile.am, contrib/x11vnc.c, contrib/zippy.c,
-	examples/Makefile.am, examples/colourmaptest.c, examples/example.c,
-	examples/fontsel.c, examples/mac.c, examples/pnmshow.c,
-	examples/pnmshow24.c, examples/storepasswd.c, examples/vncev.c,
-	libvncserver-config.in, vncterm/Makefile.am, vncterm/VNConsole.h: 
-	the correct way to include rfb.h is now "#include <rfb/rfb.h>"
-
-2003-02-19  dscho <dscho>
-
-	* index.html: webpage update
-
-2003-02-19  dscho <dscho>
-
-	* rfb/.cvsignore: forgotten .cvsignore
-
-2003-02-19  dscho <dscho>
-
-	* Makefile.am: fixed header installation into $(prefix)/include/rfb
-
-2003-02-18  dscho <dscho>
-
-	* Makefile.am, configure.ac, include/.cvsignore,
-	include/default8x16.h, include/keysym.h, include/rfb.h,
-	include/rfbproto.h, include/rfbregion.h, rfb/default8x16.h,
-	rfb/keysym.h, rfb/rfb.h, rfb/rfbproto.h, rfb/rfbregion.h: moved
-	include/ to rfb/
-
-2003-02-18  dscho <dscho>
-
-	* sockets.c: fixed a bug when closing a client if no longer
-	listening for new clients.
-
-2003-02-17  dscho <dscho>
-
-	* cursor.c, include/rfb.h: export rfbReverseBytes; undefine VERSION,
-	because it's too common
-
-2003-02-17  dscho <dscho>
-
-	* INSTALL: INSTALL is copied by automake
-
-2003-02-17  dscho <dscho>
-
-	* INSTALL: INSTALL was missing
-
-2003-02-16  dscho <dscho>
-
-	* configure.ac, libvncserver-config.in: fixed --link option to
-	libvncserver-config
-
-2003-02-10  dscho <dscho>
-
-	* cvs_update_anonymously, include/rfbproto.h: cvs more flexible now;
-	ZRLE encoding only when HAVE_ZRLE defined
-
-2003-02-10  dscho <dscho>
-
-	* ChangeLog, rfbserver.c: really fixed ClientConnectionGone problem
-
-2003-02-10  dscho <dscho>
-
-	* vncterm/LinuxVNC.c, vncterm/VNConsole.c: fixed LinuxVNC colours
-
-2003-02-10  dscho <dscho>
-
-	* main.c, rfbserver.c: fixed a bug that prevented the first
-	connection to be closed
-
-2003-02-10  dscho <dscho>
-
-	* include/rfb.h: fixed pthread debugging (locks...)
-
-2003-02-10  dscho <dscho>
-
-	* contrib/Makefile.am, examples/Makefile.am, vncterm/Makefile.am: 
-	fixed dependecy to libvncserver.a; if the lib is newer, the programs
-	are relinked
-
-2003-02-10  dscho <dscho>
-
-	* go: removed superfluous file
-
-2003-02-10  dscho <dscho>
-
-	* examples/.cvsignore, examples/Makefile.am,
-	examples/colourmaptest.c, vncterm/VNConsole.c: added
-	colourmapexample; fixed LinuxVNC to show the right colours
-
-2003-02-09  dscho <dscho>
-
-	* ChangeLog: vncterm imported, porting issues solved (IRIX, OS X,
-	Solaris)
-
-2003-02-09  dscho <dscho>
-
-	* configure.ac, examples/Makefile.am, examples/mac.c,
-	vncterm/Makefile.am, vncterm/VNCommand.c: support for OS X is better
-	now
-
-2003-02-09  dscho <dscho>
-
-	* configure.ac, examples/Makefile.am: trying again to support OS X
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.am, configure.ac, examples/.cvsignore,
-	vncterm/.cvsignore, vncterm/ChangeLog, vncterm/LinuxVNC.c,
-	vncterm/Makefile.am, vncterm/README, vncterm/TODO,
-	vncterm/VNCommand.c, vncterm/VNConsole.c, vncterm/VNConsole.h,
-	vncterm/example.c, vncterm/vga.h: included vncterm
-
-2003-02-09  dscho <dscho>
-
-	* .cvsignore, configure.ac, examples/mac.c, mac.c: moved the
-	OSXvnc-server to examples; IRIX fixes (not really IRIX, but shows
-	there)
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.am, examples/Makefile.am, examples/regiontest.c,
-	examples/sratest.c, include/rfbregion.h, main.c, rfbregion.c,
-	rfbserver.c, sraRegion.c, sraRegion.h, translate.c: renamed
-	sraRegion to rfbregion and put it in include/; will be installed now
-
-2003-02-09  dscho <dscho>
-
-	* ChangeLog: portability changes
-
-2003-02-09  dscho <dscho>
-
-	* configure.ac: order of X libraries is not good for IRIX
-
-2003-02-09  dscho <dscho>
-
-	* configure.ac, main.c: include order was wrong
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.in, configure, contrib/Makefile.in, examples/Makefile.in: 
-	source from CVS always will need a current autoconf/automake
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.in, acinclude.m4, configure, contrib/Makefile.in,
-	examples/Makefile.in: I give up supporting old autoconf/automake;
-	now require at least 2.52
-
-2003-02-09  dscho <dscho>
-
-	* acinclude.m4: more macros included for older autoconf/automake
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.am, TODO, acinclude.m4, auth.c, configure.ac,
-	contrib/x11vnc.c, corre.c, cursor.c, cutpaste.c, hextile.c,
-	httpd.c, include/.cvsignore, include/rfb.h, include/rfbproto.h,
-	main.c, rfbserver.c, rre.c, sockets.c, sraRegion.c, stats.c,
-	tableinit24.c, tableinitcmtemplate.c, tableinittctemplate.c,
-	tabletrans24template.c, tabletranstemplate.c, tight.c, translate.c,
-	vncauth.c, zlib.c, zrle.cxx: converted CARD{8,16,32} to
-	uint{8,16,32}_t and included support for stdint.h
-
-2003-02-09  dscho <dscho>
-
-	* .cvsignore: ignore libvncserver-config
-
-2003-02-09  dscho <dscho>
-
-	* configure.ac, include/rfb.h, main.c: bigendian is now determined
-	at configure time
-
-2003-02-09  dscho <dscho>
-
-	* index.html: added website
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.am, configure.ac: small adjustments for autoconf/automake
-	compatibility
-
-2003-02-09  dscho <dscho>
-
-	* Makefile.am, configure.ac, contrib/Makefile.am,
-	examples/Makefile.am, examples/vncev.c, libvncserver-config.in,
-	libvncserver.spec.in: make dist fixed; make rpm introduced
-
-2003-02-08  dscho <dscho>
-
-	* .cvsignore, Makefile, bootstrap.sh, contrib/.cvsignore,
-	contrib/Makefile, examples/.cvsignore, examples/Makefile: removed
-	Makefiles; these are generated now
-
-2003-02-08  dscho <dscho>
-
-	* .cvsignore, contrib/.cvsignore, examples/.cvsignore,
-	libvncserver.spec.in: ignore generated files
-
-2003-02-08  dscho <dscho>
-
-	* contrib/.cvsignore, examples/.cvsignore, examples/blooptest.c,
-	examples/sratest.c, include/.cvsignore: missing files
-
-2003-02-08  dscho <dscho>
-
-	* AUTHORS, CHANGES, ChangeLog, NEWS, TODO: further autoconf'ing
-
-2003-02-08  dscho <dscho>
-
-	* Makefile, Makefile.am, TODO, bootstrap.sh, configure.ac,
-	contrib/Makefile, contrib/Makefile.am, examples/Makefile,
-	examples/Makefile.am, examples/example.c, include/rfb.h,
-	include/rfbproto.h, main.c, rfbserver.c, sockets.c, tight.c,
-	zlib.c, zrle.cc, zrle.cxx: autoconf'ed everything
-
-2003-02-07  dscho <dscho>
-
-	* examples/.cvsignore, examples/radon.h: added files
-
-2003-02-07  dscho <dscho>
-
-	* cvs_update_anonymously, examples/Makefile: added Makefile in
-	examples; "export" in cvs_update_anonymously
-
-2003-02-07  dscho <dscho>
-
-	* 1instance.c, Makefile, contrib/Makefile, contrib/zippy.c,
-	default8x16.h, examples/1instance.c, examples/pnmshow24.c,
-	include/default8x16.h, include/keysym.h, include/rfb.h,
-	include/rfbproto.h, keysym.h, main.c, radon.h, rfb.h, rfbproto.h: 
-	moved files to include; moved a file to examples/
-
-2003-02-07  dscho <dscho>
-
-	* CHANGES, example.c, example.dsp, examples/example.c,
-	examples/example.dsp, examples/fontsel.c, examples/pnmshow.c,
-	examples/pnmshow24.c, examples/storepasswd.c, examples/vncev.c,
-	fontsel.c, pnmshow.c, pnmshow24.c, storepasswd.c, vncev.c: moved
-	files to contrib/ and examples/
-
-2002-12-30  dscho <dscho>
-
-	* CHANGES, cargs.c: fixed cargs (segmentation fault!)
-
-2002-12-25  dscho <dscho>
-
-	* contrib/x11vnc.c: strange, but standard X11 behaviour from Sun
-	keymappings...
-
-2002-12-20  dscho <dscho>
-
-	* contrib/x11vnc.c: include commented debug functionality
-
-2002-12-20  dscho <dscho>
-
-	* contrib/x11vnc.c: AltGr fixes in x11vnc, renamed from altgr to
-	modtweak
-
-2002-12-20  dscho <dscho>
-
-	* Makefile: fixed compilation for zippy
-
-2002-12-20  dscho <dscho>
-
-	* contrib/Makefile: Makefile for contrib
-
-2002-12-19  dscho <dscho>
-
-	* contrib/x11vnc.c, contrib/zippy.c: new version of x11vnc from Karl
-	Runge
-
-2002-12-15  dscho <dscho>
-
-	* contrib/x11vnc.c: small fixes: in X11/Xlib.h Bool is int (Karl
-	Runge); indexed colour support
-
-2002-12-15  dscho <dscho>
-
-	* Makefile, rfbserver.c: fix: if no CXX is defined, really don't use
-	zrle (Karl Runge)
-
-2002-12-06  dscho <dscho>
-
-	* CHANGES, Makefile, contrib/x11vnc.c, contrib/zippy.c, httpd.c,
-	main.c, rfb.h, x11vnc.c, zippy.c: compiler warnings, contrib
-	directory, new x11vnc from Karl Runge
-
-2002-10-29  dscho <dscho>
-
-	* CHANGES, main.c, rfbserver.c: fixed severe bug with sending
-	fbupdates
-
-2002-10-29  dscho <dscho>
-
-	* CHANGES, README, cursor.c, main.c, rfb.h, rfbproto.h,
-	rfbserver.c, stats.c: patch from Const for CursorPosUpdate encoding
-
-2002-10-22  dscho <dscho>
-
-	* rdr/Exception.h, rdr/FdInStream.cxx, rdr/FdInStream.h,
-	rdr/FdOutStream.cxx, rdr/FdOutStream.h, rdr/FixedMemOutStream.h,
-	rdr/InStream.cxx, rdr/InStream.h, rdr/MemInStream.h,
-	rdr/MemOutStream.h, rdr/NullOutStream.cxx, rdr/NullOutStream.h,
-	rdr/OutStream.h, rdr/ZlibInStream.cxx, rdr/ZlibInStream.h,
-	rdr/ZlibOutStream.cxx, rdr/ZlibOutStream.h, rdr/types.h: rdr
-
-2002-10-22  dscho <dscho>
-
-	* Makefile, corre.c, cvs_update_anonymously, httpd.c, main.c,
-	rfb.h, rfbproto.h, rfbserver.c, stats.c, zrle.cc, zrleDecode.h,
-	zrleEncode.h: updated to vnc-3.3.4 (ZRLE encoding)
-
-2002-08-31  dscho <dscho>
-
-	* x11vnc.c: patch for IRIX
-
-2002-08-31  dscho <dscho>
-
-	* cvs_update_anonymously, httpd.c, rfbserver.c, vncauth.c: socket
-	via proxy gets options set, compiler warning fixes
-
-2002-08-31  dscho <dscho>
-
-	* Makefile, cvs_update_anonymously, httpd.c, mac.c, pnmshow24.c,
-	vncev.c, x11vnc.c, zippy.c: compiler warnings and format
-	vulnerabilities fixed
-
-2002-08-27  dscho <dscho>
-
-	* Makefile, httpd.c: IRIX changes
-
-2002-08-22  dscho <dscho>
-
-	* CHANGES: changes
-
-2002-08-22  dscho <dscho>
-
-	* classes/javaviewer.pseudo_proxy.patch, example.c, httpd.c,
-	main.c, rfb.h: a pseudo HTTP request for tunnelling (also via strict
-	Web Proxy) was added.
-
-2002-08-22  dscho <dscho>
-
-	* classes/index.vnc, httpd.c, vncauth.c: synchronized with tightVNC
-	1.2.5
-
-2002-08-19  dscho <dscho>
-
-	* Makefile, auth.c, cursor.c, example.c, httpd.c, main.c,
-	pnmshow.c, rfb.h, rfbserver.c, sraRegion.c, sraRegion.h, tight.c,
-	vncauth.c: unwarn compilation
-
-2002-07-28  dscho <dscho>
-
-	* CHANGES, README: prepare for version 0.4
-
-2002-07-28  dscho <dscho>
-
-	* CHANGES, classes/index.vnc, example.c, httpd.c, main.c, rfb.h,
-	rfbproto.h, rfbserver.c, stats.c: NewFB encoding added
-
-2002-06-13  dscho <dscho>
-
-	* main.c, rfbserver.c, sockets.c: pthread fix
-
-2002-05-03  dscho <dscho>
-
-	* Makefile, rfb.h: solaris fixes (INADDR_NONE)
-
-2002-05-02  dscho <dscho>
-
-	* selbox.c: index was shadowed
-
-2002-05-02  dscho <dscho>
-
-	* cursor.c, font.c, httpd.c, main.c, rfb.h, rfbserver.c, sockets.c,
-	sraRegion.c, stats.c, tableinit24.c, tight.c, translate.c: Tim's
-	Changes
-
-2002-04-30  dscho <dscho>
-
-	* cargs.c, rfb.h: command line handling
-
-2002-04-30  dscho <dscho>
-
-	* Makefile, mac.c: more mac
-
-2002-04-30  dscho <dscho>
-
-	* mac.c: dimming for mac
-
-2002-04-30  dscho <dscho>
-
-	* mac.c: Mac compile fix
-
-2002-04-25  dscho <dscho>
-
-	* Makefile, x11vnc.c: x11vnc memleaks patched
-
-2002-04-25  dscho <dscho>
-
-	* CHANGES, cursor.c, example.c, main.c, rfbserver.c: memleaks
-	patched
-
-2002-04-25  dscho <dscho>
-
-	* mac.c: now colour handling should be correct
-
-2002-04-24  dscho <dscho>
-
-	* main.c: bug for 3 bpp planes (as Mac OSX)
-
-2002-04-23  dscho <dscho>
-
-	* CHANGES, classes/index.vnc, httpd.c, rfbserver.c, sockets.c: sync
-	with TightVNC 1.2.3
-
-2002-04-23  dscho <dscho>
-
-	* Makefile, mac.c: OSXvnc-server compile fixes
-
-2002-04-23  dscho <dscho>
-
-	* CHANGES, Makefile, rfb.h: another solaris clean compile
-
-2002-04-23  dscho <dscho>
-
-	* x11vnc.c: KBDDEBUG
-
-2002-04-23  dscho <dscho>
-
-	* main.c, rfb.h: solaris endian changes
-
-2002-03-04  dscho <dscho>
-
-	* Makefile, rfbserver.c, sockets.c: reverted exception fds to NULL,
-	because of unexpected behaviour
-
-2002-02-19  dscho <dscho>
-
-	* CHANGES: changes
-
-2002-02-18  dscho <dscho>
-
-	* sockets.c: select exceptfds
-
-2002-02-18  dscho <dscho>
-
-	* README, cursor.c, example.c, httpd.c, main.c, rfb.h, rfbserver.c,
-	sockets.c, tight.c, translate.c: changes from Tim Jansen: threading
-	issues, new client can be rejected, and more
-
-2002-01-17  dscho <dscho>
-
-	* 1instance.c, Makefile: compile warning fix, dependency on
-	1instance.c
-
-2002-01-17  dscho <dscho>
-
-	* mac.c: compile warning fix
-
-2002-01-17  dscho <dscho>
-
-	* font.c, rfb.h, rfbproto.h, rfbserver.c, vncauth.c: correct
-	BackChannel handling, compile cleanups
-
-2002-01-16  dscho <dscho>
-
-	* mac.c: compile fix
-
-2002-01-16  dscho <dscho>
-
-	* 1instance.c, Makefile, cargs.c, mac.c, rfb.h, rfbproto.h,
-	rfbserver.c, x11vnc.c: clean ups and encoding "backchannel"
-
-2002-01-14  dscho <dscho>
-
-	* mac.c: fixed compile on MAC
-
-2002-01-14  dscho <dscho>
-
-	* mac.c: toggle view only with OSX
-
-2002-01-14  dscho <dscho>
-
-	* 1instance.c, x11vnc.c: view mode now toggleable
-
-2001-12-21  dscho <dscho>
-
-	* mac.c, x11vnc.c: shared mode added
-
-2001-12-14  dscho <dscho>
-
-	* cargs.c, main.c: *argc=0 in cargs allowed, when copying area,
-	first undraw cursor ...
-
-2001-12-11  dscho <dscho>
-
-	* mac.c: fixed osx compiling
-
-2001-12-09  dscho <dscho>
-
-	* Makefile, mac.c: Makefile cleanup, some special options for OSX
-
-2001-12-09  dscho <dscho>
-
-	* x11vnc.c: tile modus now near perfect (shm's better though)
-
-2001-12-08  dscho <dscho>
-
-	* x11vnc.c: start to probe single pixels for updates
-
-2001-11-27  dscho <dscho>
-
-	* TODO, x11vnc.c: fixed dumb XTestFakeInput bug
-
-2001-11-27  dscho <dscho>
-
-	* TODO, x11vnc.c: removed XTestGrabControl. Doesn't really solve the
-	problem of a bad param.
-
-2001-11-27  dscho <dscho>
-
-	* TODO, x11vnc.c: few changes
-
-2001-11-27  dscho <dscho>
-
-	* Makefile, x11vnc.c: input works on other X11 servers than XFree86
-
-2001-11-26  dscho <dscho>
-
-	* TODO, x11vnc.c: no crash when display was wrong
-
-2001-11-26  dscho <dscho>
-
-	* TODO: todo
-
-2001-11-25  dscho <dscho>
-
-	* x11vnc.c: init keyboard now takes correct display
-
-2001-11-23  dscho <dscho>
-
-	* x11vnc.c: keyboard handling now works.
-
-2001-11-22  dscho <dscho>
-
-	* x11vnc.c: added cmd line parameters
-
-2001-11-21  dscho <dscho>
-
-	* CHANGES: changes
-
-2001-11-20  dscho <dscho>
-
-	* x11vnc.c: shm works again
-
-2001-11-20  dscho <dscho>
-
-	* Makefile, x11vnc.c: missing include for XTest
-
-2001-11-19  dscho <dscho>
-
-	* x11vnc.c: x11vnc now works with colour maps
-
-2001-11-19  dscho <dscho>
-
-	* x11vnc.c: tmp
-
-2001-11-19  dscho <dscho>
-
-	* x11vnc.c: first support for colourmaps
-
-2001-11-19  dscho <dscho>
-
-	* Makefile, x11vnc.c: works, but loads high
-
-2001-11-19  dscho <dscho>
-
-	* cargs.c, main.c, rfb.h: cmdline arg -passwd added
-
-2001-11-19  dscho <dscho>
-
-	* Makefile, x11vnc.c: x11vnc now works view only and with SHM
-
-2001-11-18  dscho <dscho>
-
-	* Makefile, example.c, main.c, rfb.h, rfbserver.c, x11vnc.c: start
-	x11vnc, an x0rfbserver clone
-
-2001-11-15  dscho <dscho>
-
-	* example.dsp, libvncserver.dsp, libvncserver.dsw, main.c, rfb.h,
-	rfbserver.c, sockets.c: Visual C++ / win32 compatibility
-	reestablished
-
-2001-11-14  dscho <dscho>
-
-	* Makefile, TODO, font.c: docu, warning fixed
-
-2001-11-14  dscho <dscho>
-
-	* CHANGES: changes
-
-2001-11-14  dscho <dscho>
-
-	* cargs.c: separated argument handling from main.c
-
-2001-11-14  dscho <dscho>
-
-	* Makefile, d3des.h, example.c, fontsel.c, keysym.h, mac.c, main.c,
-	pnmshow.c, pnmshow24.c, rfb.h, rfbproto.h, sraRegion.h, vncev.c,
-	zippy.c: changes from Justin, zippy added
-
-2001-11-08  dscho <dscho>
-
-	* main.c: gettimeofday for windows
-
-2001-10-25  dscho <dscho>
-
-	* Makefile, main.c, rfbserver.c, sraRegion.c, sraRegion.h: clean ups
-
-2001-10-19  dscho <dscho>
-
-	* CHANGES: changes
-
-2001-10-18  dscho <dscho>
-
-	* Makefile, TODO, draw.c, main.c, rfb.h, vncev.c: add rfbDrawLine,
-	rfbDrawPixel and vncev, an xev "lookalike"
-
-2001-10-16  dscho <dscho>
-
-	* main.c: scheduleCopyRegion no longer sends frameBufferUpdates (no
-	longer clobbers deferring)
-
-2001-10-16  dscho <dscho>
-
-	* CHANGES, TODO, main.c, rfb.h, rfbserver.c: deferUpdate
-
-2001-10-16  dscho <dscho>
-
-	* TODO, font.c, rfbserver.c: font errors, requestedRegion bug
-
-2001-10-15  dscho <dscho>
-
-	* .gdb_history: unneccessary file
-
-2001-10-13  dscho <dscho>
-
-	* font.c: INT_MAX maybe not defined
-
-2001-10-13  dscho <dscho>
-
-	* TODO: todo
-
-2001-10-13  dscho <dscho>
-
-	* CHANGES, Makefile, README, TODO, auth.c, bdf2c.pl,
-	consolefont2c.pl, cursor.c, default8x16.h, draw.c, font.c,
-	fontsel.c, keysym.h, main.c, radon.h, rfb.h, selbox.c: rfbSelectBox,
-	consoleFonts, too many changes
-
-2001-10-12  dscho <dscho>
-
-	* Makefile: changes to Makefile
-
-2001-10-12  dscho <dscho>
-
-	* README, rfb.h, rfbserver.c: cleanups
-
-2001-10-11  dscho <dscho>
-
-	* auth.c, corre.c, httpd.c, main.c, rfb.h, rfbserver.c, rre.c,
-	sockets.c, sraRegion.c, tableinit24.c, tableinittctemplate.c,
-	tight.c, zlib.c: replaced xalloc with malloc functions, udp input
-	support (untested), fixed http
-
-2001-10-10  dscho <dscho>
-
-	* CHANGES, TODO, main.c, rfb.h, rfbserver.c: copyrect corrections,
-	fd_set in rfbNewClient, dox in rfb.h for pthreads problem
-
-2001-10-10  dscho <dscho>
-
-	* Makefile, cursor.c, main.c, rfb.h, rfbserver.c, sockets.c: 
-	pthreads corrections
-
-2001-10-09  dscho <dscho>
-
-	* sockets.c: start udp
-
-2001-10-08  dscho <dscho>
-
-	* Makefile, region.h, rfbserver.c: removes region.h
-
-2001-10-07  dscho <dscho>
-
-	* Makefile, README, tabletrans24template.c: fixed 24bit (update was
-	garbled)
-
-2001-10-07  dscho <dscho>
-
-	* bdf2c.pl, font.c, main.c, rfb.h, rfbserver.c: font corrections,
-	displayHook
-
-2001-10-06  dscho <dscho>
-
-	* README, d3des.c, example.c, example.dsp, httpd.c, kbdptr.c,
-	libvncserver.dsp, libvncserver.dsw, main.c, rfb.h, rfbserver.c,
-	sockets.c, tableinitcmtemplate.c, tight.c, translate.c, vncauth.c: 
-	WIN32 compatibility, removed kbdptr.c
-
-2001-10-05  dscho <dscho>
-
-	* CHANGES, TODO, cursor.c, example.c, main.c, rfb.h, rfbserver.c: 
-	changed cursor functions to use screen info, not cursor fixed copy
-	rect.
-
-2001-10-05  dscho <dscho>
-
-	* Makefile, bdf2c.pl, example.c, font.c, radon.h, rfb.h: extracted
-	font routines from example
-
-2001-10-04  dscho <dscho>
-
-	* CHANGES, Makefile, TODO, main.c, rfb.h, rfbserver.c: 
-	rfbDoCopyRect/Region and rfbScheduleCopyRect/Region.
-
-2001-10-04  dscho <dscho>
-
-	* rfb.h: tried to compile on Sparcs. Original cc has problems. ar
-	isn't there.
-
-2001-10-04  dscho <dscho>
-
-	* CHANGES, TODO, cursor.c, main.c, rfb.h, rfbserver.c: fixed 2
-	pthreads issues, added noXCursor option.
-
-2001-10-03  dscho <dscho>
-
-	* TODO, main.c: working on IRIX pthreads problem
-
-2001-10-03  dscho <dscho>
-
-	* TODO, rfbserver.c: java viewer bug fixed
-
-2001-10-03  dscho <dscho>
-
-	* CHANGES, Makefile, TODO, main.c, rfb.h, rfbserver.c, sockets.c,
-	stats.c, tight.c: upgraded to TridiaVNC 1.2.1
-
-2001-10-02  dscho <dscho>
-
-	* Makefile, TODO, cursor.c, d3des.c, main.c, rfb.h, rfbserver.c,
-	sockets.c, translate.c, vncauth.c: no more compile warnings, pthread
-	final(?) fixes
-
-2001-10-02  dscho <dscho>
-
-	* TODO: some todo items
-
-2001-10-02  dscho <dscho>
-
-	* CHANGES, cursor.c, rfb.h: implemented rfbSetCursor
-
-2001-10-02  dscho <dscho>
-
-	* rfb.h: prototype for rfbSendBell
-
-2001-10-02  dscho <dscho>
-
-	* CHANGES: changes
-
-2001-10-02  dscho <dscho>
-
-	* pnmshow24.c, tableinit24.c, tabletrans24template.c: forgot files
-	for 3 bpp
-
-2001-10-02  dscho <dscho>
-
-	* Makefile, README, TODO, example.c, main.c, rfb.h, rfbserver.c,
-	sockets.c, tableinitcmtemplate.c, translate.c: support for server
-	side colour maps, fix for non-pthread, support for 3bpp
-
-2001-10-01  dscho <dscho>
-
-	* TODO: have to upgrade to newest VNC sources
-
-2001-09-29  dscho <dscho>
-
-	* Makefile, README, TODO, example.c, main.c, rfb.h, rfbserver.c,
-	sockets.c: finally fixed pthreads
-
-2001-09-29  dscho <dscho>
-
-	* TODO, cursor.c: nother try
-
-2001-09-29  dscho <dscho>
-
-	* Makefile, cursor.c, main.c, rfb.h, rfbserver.c, sockets.c: more
-	pthread debugging
-
-2001-09-29  dscho <dscho>
-
-	* Makefile, main.c, rfb.h: cleaned up pthreads (now compiles) and
-	rfb.h (first undefine TRUE)
-
-2001-09-29  dscho <dscho>
-
-	* Makefile, README, TODO, include/X11/X.h, include/X11/Xalloca.h,
-	include/X11/Xfuncproto.h, include/X11/Xfuncs.h, include/X11/Xmd.h,
-	include/X11/Xos.h, include/X11/Xosdefs.h, include/X11/Xproto.h,
-	include/X11/Xprotostr.h, include/X11/keysym.h,
-	include/X11/keysymdef.h, include/Xserver/colormap.h,
-	include/Xserver/cursor.h, include/Xserver/dix.h,
-	include/Xserver/gc.h, include/Xserver/input.h,
-	include/Xserver/misc.h, include/Xserver/miscstruct.h,
-	include/Xserver/opaque.h, include/Xserver/os.h,
-	include/Xserver/pixmap.h, include/Xserver/region.h,
-	include/Xserver/regionstr.h, include/Xserver/screenint.h,
-	include/Xserver/scrnintstr.h, include/Xserver/validate.h,
-	include/Xserver/window.h, main.c, miregion.c, region.h, rfb.h,
-	rfbserver.c, sraRegion.c, sraRegion.h, translate.c, xalloc.c: 
-	dropped miregion and all the X stuff in favour of Wez' sraRegion,
-	added dox
-
-2001-09-28  dscho <dscho>
-
-	* cursor.c, rfb.h: exported rfbReverseByte
-
-2001-09-28  dscho <dscho>
-
-	* cursor.c: don't send a cursor update if there is no cursor
-
-2001-09-28  dscho <dscho>
-
-	* README, TODO: small changes to README (contact) and TODO
-	(autoconf?)
-
-2001-09-28  dscho <dscho>
-
-	* Makefile: libvncserver.a is not deleted by make clean
-
-2001-09-28  dscho <dscho>
-
-	* example.c: unnecessary include
-
-2001-09-28  dscho <dscho>
-
-	* Makefile, example.c, rfb.h: now compiles on FreeBSD
-
-2001-09-28  dscho <dscho>
-
-	* Makefile: make clean now cleans mac.o pnmshow.o and example.o
-
-2001-09-27  dscho <dscho>
-
-	* README, cursor.c, main.c, rfb.h, rfbserver.c: added
-	setTranslateFunction as member of rfbScreenInfo, cursor may be NULL
-	(no cursor).
-
-2001-09-27  dscho <dscho>
-
-	* Makefile, mac.c, rfb.h: try to make OSXvnc run again.
-
-2001-09-27  dscho <dscho>
-
-	* README, TODO, example.c, main.c, rfb.h: docu and cursors in
-	examples.
-
-2001-09-26  dscho <dscho>
-
-	* Makefile, README, TODO, example.c, httpd.c, main.c, pnmshow.c,
-	rfb.h: API corrections
-
-2001-09-26  dscho <dscho>
-
-	* TODO, main.c, pnmshow.c: adapted pnmshow to aligned width
-
-2001-09-25  dscho <dscho>
-
-	* example.c, tabletranstemplate.c: look for align bug with odd
-	width. Bug in vncviewer?
-
-2001-09-25  dscho <dscho>
-
-	* d3des.c, d3des.h, libvncauth/Imakefile, libvncauth/Makefile,
-	libvncauth/d3des.c, libvncauth/d3des.h, libvncauth/vncauth.c,
-	libvncauth/vncauth.h, vncauth.c: permanently moved authorization
-
-2001-09-25  dscho <dscho>
-
-	* Makefile, rfb.h, storepasswd.c: moved vncauth to libvncserver
-
-2001-09-25  dscho <dscho>
-
-	* .depend: rmoved unneccessary files
-
-2001-09-25  dscho <dscho>
-
-	* Makefile, TODO, cursor.c, example.c, keysym.h, main.c, pnmshow.c,
-	region.h, rfb.h, rfbserver.c: fix cursor bug; missing keysym; fix
-	align problem on SGI; clean up cursor.c clean up rfb.h a bit; endian
-	issues
-
-2001-09-24  dscho <dscho>
-
-	* region.h: forgot file
-
-2001-09-24  dscho <dscho>
-
-	* Makefile, TODO, cursor.c, example.c, include/Xserver/os.h,
-	main.c, miregion.c, pnmshow.c, rfb.h, rfbserver.c, sockets.c,
-	xalloc.c: bugfix: cursor (works now without xcursor encoding)
-
-2001-09-24  dscho <dscho>
-
-	* cursor.c, example.c, main.c, rfb.h, rfbserver.c: cursor changes
-
-2001-09-23  dscho <dscho>
-
-	* Makefile, README, TODO, cursor.c, example.c, httpd.c, main.c,
-	rfb.h, rfbserver.c, sockets.c, zlib.c: cleaned up warnings, cursor
-	changes
-
-2001-09-21  dscho <dscho>
-
-	* Makefile, classes/index.vnc, cursor.c, example.c, httpd.c,
-	main.c, rfb.h: http added, prepare for cursor
-
-2001-09-20  dscho <dscho>
-
-	* README: changed README at last
-
-2001-09-13  dscho <dscho>
-
-	* Makefile, bdf2c.pl, example.c, radon.h: Now you can write
-	something in addition to mouse movements ...
-
-2001-08-14  dscho <dscho>
-
-	* Makefile, example.c, main.c, pnmshow.c: comments & new example:
-	pnmshow
-
-2001-08-14  dscho <dscho>
-
-	* example.c, main.c, rfb.h: now lines are drawn for the example,
-	first steps to make clients independent.
-
-2001-08-14  dscho <dscho>
-
-	* Makefile, example.c, main.c, rfb.h, rfbserver.c: hooks inserted
-
-2001-08-01  dscho <dscho>
-
-	* Initial revision
-
diff --git a/ica/x11/README b/ica/x11/README
deleted file mode 100644
index 499b72b..0000000
--- a/ica/x11/README
+++ /dev/null
@@ -1,439 +0,0 @@
-LibVNCServer: A library for easy implementation of a VNC server.
-Copyright (C) 2001-2003 Johannes E. Schindelin
-
-If you already used LibVNCServer, you probably want to read NEWS.
-
-What is it?
------------
-
-VNC is a set of programs using the RFB (Remote Frame Buffer) protocol. They
-are designed to "export" a frame buffer via net (if you don't know VNC, I
-suggest you read "Basics" below). It is already in wide use for
-administration, but it is not that easy to program a server yourself.
-
-This has been changed by LibVNCServer.
-
-There are two examples included:
- - example, a shared scribble sheet
- - pnmshow, a program to show PNMs (pictures) over the net.
-
-The examples are not too well documented, but easy straight forward and a
-good starting point.
-
-Try example: it outputs on which port it listens (default: 5900), so it is
-display 0. To view, call
-	vncviewer :0
-You should see a sheet with a gradient and "Hello World!" written on it. Try
-to paint something. Note that everytime you click, there is some bigger blot,
-whereas when you drag the mouse while clicked you draw a line. The size of the
-blot depends on the mouse button you click. Open a second vncviewer with
-the same parameters and watch it as you paint in the other window. This also
-works over internet. You just have to know either the name or the IP of your
-machine. Then it is
-	vncviewer machine.where.example.runs.com:0
-or similar for the remote client. Now you are ready to type something. Be sure
-that your mouse sits still, because everytime the mouse moves, the cursor is
-reset to the position of the pointer! If you are done with that demo, press
-the down or up arrows. If your viewer supports it, then the dimensions of the
-sheet change. Just press Escape in the viewer. Note that the server still
-runs, even if you closed both windows. When you reconnect now, everything you
-painted and wrote is still there. You can press "Page Up" for a blank page.
-
-The demo pnmshow is much simpler: you either provide a filename as argument
-or pipe a file through stdin. Note that the file has to be a raw pnm/ppm file,
-i.e. a truecolour graphics. Only the Escape key is implemented. This may be
-the best starting point if you want to learn how to use LibVNCServer. You
-are confronted with the fact that the bytes per pixel can only be 8, 16 or 32.
-
-Projects using it
-----------------------------------------
-
-VNC for KDE
-http://www.tjansen.de/krfb
-
-GemsVNC
-http://www.elilabs.com/~rj/gemsvnc/
-
-VNC for Netware
-http://forge.novell.com/modules/xfmod/project/?vncnw
-
-RDesktop
-http://rdesktop.sourceforge.net
-
-Mail me, if your application is missing!
-
-How to use
-----------
-
-To make a server, you just have to initialise a server structure using the
-function rfbDefaultScreenInit, like
-  rfbScreenInfoPtr rfbScreen =
-    rfbGetScreen(argc,argv,width,height,8,3,bpp);
-where byte per pixel should be 1, 2 or 4. If performance doesn't matter,
-you may try bpp=3 (internally one cannot use native data types in this
-case; if you want to use this, look at pnmshow24).
-
-
-You then can set hooks and io functions (see below) or other
-options (see below).
-
-And you allocate the frame buffer like this:
-    rfbScreen->frameBuffer = (char*)malloc(width*height*bpp);
-
-After that, you initialize the server, like
-  rfbInitServer(rfbScreen);
-
-You can use a blocking event loop, a background (pthread based) event loop,
-or implement your own using the rfbProcessEvents function.
-
-Making it interactive
----------------------
-
-Input is handled by IO functions (see below).
-
-Whenever you change something in the frame buffer, call rfbMarkRectAsModified.
-You should make sure that the cursor is not drawn before drawing yourself
-by calling rfbUndrawCursor. You can also draw the cursor using rfbDrawCursor,
-but it hardly seems necessary. For cursor details, see below.
-
-Utility functions
------------------
-
-Whenever you draw something, you have to call
- rfbMarkRectAsModified(screen,x1,y1,x2,y2).
-This tells LibVNCServer to send updates to all connected clients.
-
-Before you draw something, be sure to call
- rfbUndrawCursor(screen).
-This tells LibVNCServer to hide the cursor.
-Remark: There are vncviewers out there, which know a cursor encoding, so
-that network traffic is low, and also the cursor doesn't need to be
-drawn the cursor everytime an update is sent. LibVNCServer handles
-all the details. Just set the cursor and don't bother any more.
-
-To set the mouse coordinates (or emulate mouse clicks), call
-  defaultPtrAddEvent(buttonMask,x,y,cl);
-IMPORTANT: do this at the end of your function, because this actually draws
-the cursor if no cursor encoding is active.
-
-What is the difference between rfbScreenInfoPtr and rfbClientPtr?
------------------------------------------------------------------
-
-The rfbScreenInfoPtr is a pointer to a rfbScreenInfo structure, which
-holds information about the server, like pixel format, io functions,
-frame buffer etc.
-
-The rfbClientPtr is a pointer to an rfbClientRec structure, which holds
-information about a client, like pixel format, socket of the
-connection, etc.
-
-A server can have several clients, but needn't have any. So, if you
-have a server and three clients are connected, you have one instance
-of a rfbScreenInfo and three instances of rfbClientRec's.
-
-The rfbClientRec structure holds a member
-  rfbScreenInfoPtr screen
-which points to the server and a member
-  rfbClientPtr next
-to the next client.
-
-The rfbScreenInfo structure holds a member
-  rfbClientPtr rfbClientHead
-which points to the first client.
-
-So, to access the server from the client structure, you use client->screen.
-To access all clients from a server, get screen->rfbClientHead and
-iterate using client->next.
-
-If you change client settings, be sure to use the provided iterator
- rfbGetClientIterator(rfbScreen)
-with
- rfbClientIteratorNext(iterator)
-and
- rfbReleaseClientIterator
-to prevent thread clashes.
-
-Other options
--------------
-
-These options have to be set between rfbGetScreen and rfbInitServer.
-
-If you already have a socket to talk to, just set rfbScreen->inetdSock
-(originally this is for inetd handling, but why not use it for your purpose?).
-
-To also start an HTTP server (running on port 5800+display_number), you have
-to set rfbScreen->httpdDir to a directory containing vncviewer.jar and
-index.vnc (like the included "webclients" directory).
-
-Hooks and IO functions
-----------------------
-
-There exist the following IO functions as members of rfbScreen:
-kbdAddEvent, kbdReleaseAllKeys, ptrAddEvent and setXCutText
-
-kbdAddEvent(rfbBool down,rfbKeySym key,rfbClientPtr cl)
-  is called when a key is pressed.
-kbdReleaseAllKeys(rfbClientPtr cl)
-  is not called at all (maybe in the future).
-ptrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl)
-  is called when the mouse moves or a button is pressed.
-  WARNING: if you want to have proper cursor handling, call
-	defaultPtrAddEvent(buttonMask,x,y,cl)
-  in your own function. This sets the coordinates of the cursor.
-setXCutText(char* str,int len,rfbClientPtr cl)
-  is called when the selection changes.
-
-There are only two hooks:
-newClientHook(rfbClientPtr cl)
-  is called when a new client has connected.
-displayHook
-  is called just before a frame buffer update is sent.
-
-You can also override the following methods:
-getCursorPtr(rfbClientPtr cl)
-  This could be used to make an animated cursor (if you really want ...)
-setTranslateFunction(rfbClientPtr cl)
-  If you insist on colour maps or something more obscure, you have to
-  implement this. Default is a trueColour mapping.
-
-Cursor handling
----------------
-
-The screen holds a pointer
- rfbCursorPtr cursor
-to the current cursor. Whenever you set it, remember that any dynamically
-created cursor (like return value from rfbMakeXCursor) is not free'd!
-
-The rfbCursor structure consists mainly of a mask and a source. The mask
-describes, which pixels are drawn for the cursor (a cursor needn't be
-rectangular). The source describes, which colour those pixels should have.
-
-The standard is an XCursor: a cursor with a foreground and a background
-colour (stored in backRed,backGreen,backBlue and the same for foreground
-in a range from 0-0xffff). Therefore, the arrays "mask" and "source"
-contain pixels as single bits stored in bytes in MSB order. The rows are
-padded, such that each row begins with a new byte (i.e. a 10x4
-cursor's mask has 2x4 bytes, because 2 bytes are needed to hold 10 bits).
-
-It is however very easy to make a cursor like this:
-
-char* cur="    "
-          " xx "
-	  " x  "
-	  "    ";
-char* mask="xxxx"
-           "xxxx"
-	   "xxxx"
-	   "xxx ";
-rfbCursorPtr c=rfbMakeXCursor(4,4,cur,mask);
-
-You can even set "mask" to NULL in this call and LibVNCServer will calculate
-a mask for you (dynamically, so you have to free it yourself).
-
-There is also an array named "richSource" for colourful cursors. They have
-the same format as the frameBuffer (i.e. if the server is 32 bit,
-a 10x4 cursor has 4x10x4 bytes).
-
-History
--------
-
-LibVNCServer is based on Tridia VNC and OSXvnc, which in turn are based on
-the original code from ORL/AT&T.
-
-When I began hacking with computers, my first interest was speed. So, when I
-got around assembler, I programmed the floppy to do much of the work, because
-it's clock rate was higher than that of my C64. This was my first experience
-with client/server techniques.
-
-When I came around Xwindows (much later), I was at once intrigued by the
-elegance of such connectedness between the different computers. I used it
-a lot - not the least priority lay on games. However, when I tried it over
-modem from home, it was no longer that much fun.
-
-When I started working with ASP (Application Service Provider) programs, I
-tumbled across Tarantella and Citrix. Being a security fanatic, the idea of
-running a server on windows didn't appeal to me, so Citrix went down the
-basket. However, Tarantella has it's own problems (security as well as the
-high price). But at the same time somebody told me about this "great little
-administrator's tool" named VNC. Being used to windows programs' sizes, the
-surprise was reciprocal inverse to the size of VNC!
-
-At the same time, the program "rdesktop" (a native Linux client for the
-Terminal Services of Windows servers) came to my attention. There where even
-works under way to make a protocol converter "rdp2vnc" out of this. However,
-my primary goal was a slow connection and rdp2vnc could only speak RRE
-encoding, which is not that funny with just 5kB/s. Tim Edmonds, the original
-author of rdp2vnc, suggested that I adapt it to Hextile Encoding, which is
-better. I first tried that, but had no success at all (crunchy pictures).
-
-Also, I liked the idea of an HTTP server included and possibly other
-encodings like the Tight Encodings from Const Kaplinsky. So I started looking
-for libraries implementing a VNC server where I could steal what I can't make.
-I found some programs based on the demo server from AT&T, which was also the
-basis for rdp2vnc (can only speak Raw and RRE encoding). There were some
-rumors that GGI has a VNC backend, but I didn't find any code, so probably
-there wasn't a working version anyway.
-
-All of a sudden, everything changed: I read on freshmeat that "OSXvnc" was
-released. I looked at the code and it was not much of a problem to work out
-a simple server - using every functionality there is in Xvnc. It became clear
-to me that I *had* to build a library out of it, so everybody can use it.
-Every change, every new feature can propagate to every user of it.
-
-It also makes everything easier:
- You don't care about the cursor, once set (or use the standard cursor).
-You don't care about those sockets. You don't care about encodings.
-You just change your frame buffer and inform the library about it. Every once
-in a while you call rfbProcessEvents and that's it.
-
-Basics
-------
-
-VNC (Virtual network computing) works like this: You set up a server and can
-connect to it via vncviewers. The communication uses a protocol named RFB
-(Remote Frame Buffer). If the server supports HTTP, you can also connect
-using a java enabled browser. In this case, the server sends back a
-vncviewer applet with the correct settings.
-
-There exist several encodings for VNC, which are used to compress the regions
-which have changed before they are sent to the client. A client need not be
-able to understand every encoding, but at least Raw encoding. Which encoding
-it understands is negotiated by the RFB protocol.
-
-The following encodings are known to me:
-Raw, RRE, CoRRE, Hextile, CopyRect from the original AT&T code and
-Tight, ZLib, LastRect, XCursor, RichCursor from Const Kaplinsky et al.
-
-If you are using a modem, you want to try the "new" encodings. Especially
-with my 56k modem I like ZLib or Tight with Quality 0. In my tests, it even
-beats Tarantella.
-
-There is the possibility to set a password, which is also negotiated by the
-RFB protocol, but IT IS NOT SECURE. Anybody sniffing your net can get the
-password. You really should tunnel through SSH.
-
-Windows or: why do you do that to me?
---------------------------------------------
-
-If you love products from Redmod, you better skip this paragraph.
-I am always amazed how people react whenever Microsoft(tm) puts in some
-features into their products which were around for a long time. Especially
-reporters seem to not know dick about what they are reporting about! But
-what is everytime annoying again, is that they don't do it right. Every
-concept has it's new name (remember what enumerators used to be until
-Mickeysoft(tm) claimed that enumerators are what we thought were iterators.
-Yeah right, enumerators are also containers. They are not separated. Muddy.)
-
-There are three packages you want to get hold of: zlib, jpeg and pthreads.
-The latter is not strictly necessary, but when you put something like this
-into your source:
-
-#define MUTEX(s)
-	struct {
-		int something;
-		MUTEX(latex);
-	}
-
-Microsoft's C++ compiler doesn't do it. It complains that this is an error.
-This, however, is how I implemented mutexes in case you don't need pthreads,
-and so don't need the mutex.
-
-You can find the packages at
-http://www.gimp.org/win32/extralibs-dev-20001007.zip
-
-Thanks go to all the GIMP team!
-
-What are those other targets in the Makefile?
----------------------------------------------
-
-OSXvnc-server is the original OSXvnc adapted to use the library, which was in
-turn adapted from OSXvnc. As you easily can see, the OSX dependend part is
-minimal.
-
-storepasswd is the original program to save a vnc style password in a file.
-Unfortunately, authentication as every vncviewer speaks it means the server
-has to know the plain password. You really should tunnel via ssh or use
-your own PasswordCheck to build a PIN/TAN system.
-
-sratest is a test unit. Run it to assert correct behaviour of sraRegion. I
-wrote this to test my iterator implementation.
-
-blooptest is a test of pthreads. It is just the example, but with a background
-loop to hunt down thread lockups.
-
-pnmshow24 is like pnmshow, but it uses 3 bytes/pixel internally, which is not
-as efficient as 4 bytes/pixel for translation, because there is no native data
-type of that size, so you have to memcpy pixels and be real cautious with
-endianness. Anyway, it works.
-
-fontsel is a test for rfbSelectBox and rfbLoadConsoleFont. If you have Linux
-console fonts, you can browse them via VNC. Directory browsing not implemented
-yet :-(
-
-Why I don't feel bad about GPL
-------------------------------
-
-At the beginning of this projects I would have liked to make it a BSD
-license. However, it is based on plenty of GPL'ed code, so it has to be
-a GPL. I hear BeeGee complaining: "but that's invasive, every derivative
-work, even just linking, makes my software GPL!"
-
-Yeah. That's right. It is because there are nasty jarheads out there who
-would take anybody's work and claim it their own, selling it for much too
-much money, stealing freedom and innovation from others, saying they were
-the maintainers of innovation, lying, making money with that.
-
-The people at AT&T worked really well to produce something as clean and lean
-as VNC. The managers decided that for their fame, they would release the
-program for free. But not only that! They realized that by releasing also
-the code for free, VNC would become an evolving little child, conquering
-new worlds, making it's parents very proud. As well they can be! To protect
-this innovation, they decided to make it GPL, not BSD. The principal
-difference is: You can make closed source programs deriving from BSD, not
-from GPL. You have to give proper credit with both.
-
-Now, why not BSD? Well, imagine your child being some famous actor. Along
-comes a manager who exploits your child exclusively, that is: nobody else
-can profit from the child, it itself included. Got it?
-
-What reason do you have now to use this library commercially?
-
-Several: You don't have to give away your product. Then you have effectively
-circumvented the GPL, because you have the benefits of other's work and you
-don't give back anything and you will be in hell for that. In fact, this
-library, as my other projects, is a payback for all the free software I can
-use (and sometimes, make better). For example, just now, I am using XEmacs
-on top of XFree86, all running under Linux.
-
-Better: Use a concept like MySQL. This is free software, however, they make
-money with it. If you want something implemented, you have the choice:
-Ask them to do it (and pay a fair price), or do it yourself, normally giving
-back your enhancements to the free world of computing.
-
-Learn from it: If you like the style this is written, learn how to imitate
-it. If you don't like the style, learn how to avoid those things you don't
-like. I learnt so much, just from looking at code like Linux, XEmacs,
-LilyPond, STL, etc.
-
-License
--------
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.dfdf
-
-Contact
--------
-
-To contact me, mail me: Johannes dot Schindelin at gmx dot de
-
diff --git a/ica/x11/common/d3des.c b/ica/x11/common/d3des.c
deleted file mode 100644
index 2df1aab..0000000
--- a/ica/x11/common/d3des.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * This is D3DES (V5.09) by Richard Outerbridge with the double and
- * triple-length support removed for use in VNC.  Also the bytebit[] array
- * has been reversed so that the most significant bit in each byte of the
- * key is ignored, not the least significant.
- *
- * These changes are:
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* D3DES (V5.09) -
- *
- * A portable, public domain, version of the Data Encryption Standard.
- *
- * Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.
- * Thanks to: Dan Hoey for his excellent Initial and Inverse permutation
- * code;  Jim Gillogly & Phil Karn for the DES key schedule code; Dennis
- * Ferguson, Eric Young and Dana How for comparing notes; and Ray Lau,
- * for humouring me on.
- *
- * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
- * (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
- */
-
-#include "d3des.h"
-
-static void scrunch(unsigned char *, unsigned long *);
-static void unscrun(unsigned long *, unsigned char *);
-static void desfunc(unsigned long *, unsigned long *);
-static void cookey(unsigned long *);
-
-static unsigned long KnL[32] = { 0L };
-/*
-static unsigned long KnR[32] = { 0L };
-static unsigned long Kn3[32] = { 0L };
-static unsigned char Df_Key[24] = {
-	0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
-	0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10,
-	0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 };
-*/
-
-static unsigned short bytebit[8]	= {
-	01, 02, 04, 010, 020, 040, 0100, 0200 };
-
-static unsigned long bigbyte[24] = {
-	0x800000L,	0x400000L,	0x200000L,	0x100000L,
-	0x80000L,	0x40000L,	0x20000L,	0x10000L,
-	0x8000L,	0x4000L,	0x2000L,	0x1000L,
-	0x800L, 	0x400L, 	0x200L, 	0x100L,
-	0x80L,		0x40L,		0x20L,		0x10L,
-	0x8L,		0x4L,		0x2L,		0x1L	};
-
-/* Use the key schedule specified in the Standard (ANSI X3.92-1981). */
-
-static unsigned char pc1[56] = {
-	56, 48, 40, 32, 24, 16,  8,	 0, 57, 49, 41, 33, 25, 17,
-	 9,  1, 58, 50, 42, 34, 26,	18, 10,  2, 59, 51, 43, 35,
-	62, 54, 46, 38, 30, 22, 14,	 6, 61, 53, 45, 37, 29, 21,
-	13,  5, 60, 52, 44, 36, 28,	20, 12,  4, 27, 19, 11,  3 };
-
-static unsigned char totrot[16] = {
-	1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 };
-
-static unsigned char pc2[48] = {
-	13, 16, 10, 23,  0,  4,  2, 27, 14,  5, 20,  9,
-	22, 18, 11,  3, 25,  7, 15,  6, 26, 19, 12,  1,
-	40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,
-	43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };
-
-void rfbDesKey(unsigned char *key,
-               int edf)
-{
-	register int i, j, l, m, n;
-	unsigned char pc1m[56], pcr[56];
-	unsigned long kn[32];
-
-	for ( j = 0; j < 56; j++ ) {
-		l = pc1[j];
-		m = l & 07;
-		pc1m[j] = (key[l >> 3] & bytebit[m]) ? 1 : 0;
-		}
-	for( i = 0; i < 16; i++ ) {
-		if( edf == DE1 ) m = (15 - i) << 1;
-		else m = i << 1;
-		n = m + 1;
-		kn[m] = kn[n] = 0L;
-		for( j = 0; j < 28; j++ ) {
-			l = j + totrot[i];
-			if( l < 28 ) pcr[j] = pc1m[l];
-			else pcr[j] = pc1m[l - 28];
-			}
-		for( j = 28; j < 56; j++ ) {
-		    l = j + totrot[i];
-		    if( l < 56 ) pcr[j] = pc1m[l];
-		    else pcr[j] = pc1m[l - 28];
-		    }
-		for( j = 0; j < 24; j++ ) {
-			if( pcr[pc2[j]] ) kn[m] |= bigbyte[j];
-			if( pcr[pc2[j+24]] ) kn[n] |= bigbyte[j];
-			}
-		}
-	cookey(kn);
-	return;
-	}
-
-static void cookey(register unsigned long *raw1)
-{
-	register unsigned long *cook, *raw0;
-	unsigned long dough[32];
-	register int i;
-
-	cook = dough;
-	for( i = 0; i < 16; i++, raw1++ ) {
-		raw0 = raw1++;
-		*cook	 = (*raw0 & 0x00fc0000L) << 6;
-		*cook	|= (*raw0 & 0x00000fc0L) << 10;
-		*cook	|= (*raw1 & 0x00fc0000L) >> 10;
-		*cook++ |= (*raw1 & 0x00000fc0L) >> 6;
-		*cook	 = (*raw0 & 0x0003f000L) << 12;
-		*cook	|= (*raw0 & 0x0000003fL) << 16;
-		*cook	|= (*raw1 & 0x0003f000L) >> 4;
-		*cook++ |= (*raw1 & 0x0000003fL);
-		}
-	rfbUseKey(dough);
-	return;
-	}
-
-void rfbCPKey(register unsigned long *into)
-{
-	register unsigned long *from, *endp;
-
-	from = KnL, endp = &KnL[32];
-	while( from < endp ) *into++ = *from++;
-	return;
-	}
-
-void rfbUseKey(register unsigned long *from)
-{
-	register unsigned long *to, *endp;
-
-	to = KnL, endp = &KnL[32];
-	while( to < endp ) *to++ = *from++;
-	return;
-	}
-
-void rfbDes(unsigned char *inblock,
-            unsigned char *outblock)
-{
-	unsigned long work[2];
-
-	scrunch(inblock, work);
-	desfunc(work, KnL);
-	unscrun(work, outblock);
-	return;
-	}
-
-static void scrunch(register unsigned char *outof,
-                    register unsigned long *into)
-{
-	*into	 = (*outof++ & 0xffL) << 24;
-	*into	|= (*outof++ & 0xffL) << 16;
-	*into	|= (*outof++ & 0xffL) << 8;
-	*into++ |= (*outof++ & 0xffL);
-	*into	 = (*outof++ & 0xffL) << 24;
-	*into	|= (*outof++ & 0xffL) << 16;
-	*into	|= (*outof++ & 0xffL) << 8;
-	*into	|= (*outof   & 0xffL);
-	return;
-	}
-
-static void unscrun(register unsigned long *outof,
-                    register unsigned char *into)
-{
-	*into++ = (unsigned char)((*outof >> 24) & 0xffL);
-	*into++ = (unsigned char)((*outof >> 16) & 0xffL);
-	*into++ = (unsigned char)((*outof >>  8) & 0xffL);
-	*into++ = (unsigned char)( *outof++	 & 0xffL);
-	*into++ = (unsigned char)((*outof >> 24) & 0xffL);
-	*into++ = (unsigned char)((*outof >> 16) & 0xffL);
-	*into++ = (unsigned char)((*outof >>  8) & 0xffL);
-	*into	= (unsigned char)( *outof	 & 0xffL);
-	return;
-	}
-
-static unsigned long SP1[64] = {
-	0x01010400L, 0x00000000L, 0x00010000L, 0x01010404L,
-	0x01010004L, 0x00010404L, 0x00000004L, 0x00010000L,
-	0x00000400L, 0x01010400L, 0x01010404L, 0x00000400L,
-	0x01000404L, 0x01010004L, 0x01000000L, 0x00000004L,
-	0x00000404L, 0x01000400L, 0x01000400L, 0x00010400L,
-	0x00010400L, 0x01010000L, 0x01010000L, 0x01000404L,
-	0x00010004L, 0x01000004L, 0x01000004L, 0x00010004L,
-	0x00000000L, 0x00000404L, 0x00010404L, 0x01000000L,
-	0x00010000L, 0x01010404L, 0x00000004L, 0x01010000L,
-	0x01010400L, 0x01000000L, 0x01000000L, 0x00000400L,
-	0x01010004L, 0x00010000L, 0x00010400L, 0x01000004L,
-	0x00000400L, 0x00000004L, 0x01000404L, 0x00010404L,
-	0x01010404L, 0x00010004L, 0x01010000L, 0x01000404L,
-	0x01000004L, 0x00000404L, 0x00010404L, 0x01010400L,
-	0x00000404L, 0x01000400L, 0x01000400L, 0x00000000L,
-	0x00010004L, 0x00010400L, 0x00000000L, 0x01010004L };
-
-static unsigned long SP2[64] = {
-	0x80108020L, 0x80008000L, 0x00008000L, 0x00108020L,
-	0x00100000L, 0x00000020L, 0x80100020L, 0x80008020L,
-	0x80000020L, 0x80108020L, 0x80108000L, 0x80000000L,
-	0x80008000L, 0x00100000L, 0x00000020L, 0x80100020L,
-	0x00108000L, 0x00100020L, 0x80008020L, 0x00000000L,
-	0x80000000L, 0x00008000L, 0x00108020L, 0x80100000L,
-	0x00100020L, 0x80000020L, 0x00000000L, 0x00108000L,
-	0x00008020L, 0x80108000L, 0x80100000L, 0x00008020L,
-	0x00000000L, 0x00108020L, 0x80100020L, 0x00100000L,
-	0x80008020L, 0x80100000L, 0x80108000L, 0x00008000L,
-	0x80100000L, 0x80008000L, 0x00000020L, 0x80108020L,
-	0x00108020L, 0x00000020L, 0x00008000L, 0x80000000L,
-	0x00008020L, 0x80108000L, 0x00100000L, 0x80000020L,
-	0x00100020L, 0x80008020L, 0x80000020L, 0x00100020L,
-	0x00108000L, 0x00000000L, 0x80008000L, 0x00008020L,
-	0x80000000L, 0x80100020L, 0x80108020L, 0x00108000L };
-
-static unsigned long SP3[64] = {
-	0x00000208L, 0x08020200L, 0x00000000L, 0x08020008L,
-	0x08000200L, 0x00000000L, 0x00020208L, 0x08000200L,
-	0x00020008L, 0x08000008L, 0x08000008L, 0x00020000L,
-	0x08020208L, 0x00020008L, 0x08020000L, 0x00000208L,
-	0x08000000L, 0x00000008L, 0x08020200L, 0x00000200L,
-	0x00020200L, 0x08020000L, 0x08020008L, 0x00020208L,
-	0x08000208L, 0x00020200L, 0x00020000L, 0x08000208L,
-	0x00000008L, 0x08020208L, 0x00000200L, 0x08000000L,
-	0x08020200L, 0x08000000L, 0x00020008L, 0x00000208L,
-	0x00020000L, 0x08020200L, 0x08000200L, 0x00000000L,
-	0x00000200L, 0x00020008L, 0x08020208L, 0x08000200L,
-	0x08000008L, 0x00000200L, 0x00000000L, 0x08020008L,
-	0x08000208L, 0x00020000L, 0x08000000L, 0x08020208L,
-	0x00000008L, 0x00020208L, 0x00020200L, 0x08000008L,
-	0x08020000L, 0x08000208L, 0x00000208L, 0x08020000L,
-	0x00020208L, 0x00000008L, 0x08020008L, 0x00020200L };
-
-static unsigned long SP4[64] = {
-	0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,
-	0x00802080L, 0x00800081L, 0x00800001L, 0x00002001L,
-	0x00000000L, 0x00802000L, 0x00802000L, 0x00802081L,
-	0x00000081L, 0x00000000L, 0x00800080L, 0x00800001L,
-	0x00000001L, 0x00002000L, 0x00800000L, 0x00802001L,
-	0x00000080L, 0x00800000L, 0x00002001L, 0x00002080L,
-	0x00800081L, 0x00000001L, 0x00002080L, 0x00800080L,
-	0x00002000L, 0x00802080L, 0x00802081L, 0x00000081L,
-	0x00800080L, 0x00800001L, 0x00802000L, 0x00802081L,
-	0x00000081L, 0x00000000L, 0x00000000L, 0x00802000L,
-	0x00002080L, 0x00800080L, 0x00800081L, 0x00000001L,
-	0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,
-	0x00802081L, 0x00000081L, 0x00000001L, 0x00002000L,
-	0x00800001L, 0x00002001L, 0x00802080L, 0x00800081L,
-	0x00002001L, 0x00002080L, 0x00800000L, 0x00802001L,
-	0x00000080L, 0x00800000L, 0x00002000L, 0x00802080L };
-
-static unsigned long SP5[64] = {
-	0x00000100L, 0x02080100L, 0x02080000L, 0x42000100L,
-	0x00080000L, 0x00000100L, 0x40000000L, 0x02080000L,
-	0x40080100L, 0x00080000L, 0x02000100L, 0x40080100L,
-	0x42000100L, 0x42080000L, 0x00080100L, 0x40000000L,
-	0x02000000L, 0x40080000L, 0x40080000L, 0x00000000L,
-	0x40000100L, 0x42080100L, 0x42080100L, 0x02000100L,
-	0x42080000L, 0x40000100L, 0x00000000L, 0x42000000L,
-	0x02080100L, 0x02000000L, 0x42000000L, 0x00080100L,
-	0x00080000L, 0x42000100L, 0x00000100L, 0x02000000L,
-	0x40000000L, 0x02080000L, 0x42000100L, 0x40080100L,
-	0x02000100L, 0x40000000L, 0x42080000L, 0x02080100L,
-	0x40080100L, 0x00000100L, 0x02000000L, 0x42080000L,
-	0x42080100L, 0x00080100L, 0x42000000L, 0x42080100L,
-	0x02080000L, 0x00000000L, 0x40080000L, 0x42000000L,
-	0x00080100L, 0x02000100L, 0x40000100L, 0x00080000L,
-	0x00000000L, 0x40080000L, 0x02080100L, 0x40000100L };
-
-static unsigned long SP6[64] = {
-	0x20000010L, 0x20400000L, 0x00004000L, 0x20404010L,
-	0x20400000L, 0x00000010L, 0x20404010L, 0x00400000L,
-	0x20004000L, 0x00404010L, 0x00400000L, 0x20000010L,
-	0x00400010L, 0x20004000L, 0x20000000L, 0x00004010L,
-	0x00000000L, 0x00400010L, 0x20004010L, 0x00004000L,
-	0x00404000L, 0x20004010L, 0x00000010L, 0x20400010L,
-	0x20400010L, 0x00000000L, 0x00404010L, 0x20404000L,
-	0x00004010L, 0x00404000L, 0x20404000L, 0x20000000L,
-	0x20004000L, 0x00000010L, 0x20400010L, 0x00404000L,
-	0x20404010L, 0x00400000L, 0x00004010L, 0x20000010L,
-	0x00400000L, 0x20004000L, 0x20000000L, 0x00004010L,
-	0x20000010L, 0x20404010L, 0x00404000L, 0x20400000L,
-	0x00404010L, 0x20404000L, 0x00000000L, 0x20400010L,
-	0x00000010L, 0x00004000L, 0x20400000L, 0x00404010L,
-	0x00004000L, 0x00400010L, 0x20004010L, 0x00000000L,
-	0x20404000L, 0x20000000L, 0x00400010L, 0x20004010L };
-
-static unsigned long SP7[64] = {
-	0x00200000L, 0x04200002L, 0x04000802L, 0x00000000L,
-	0x00000800L, 0x04000802L, 0x00200802L, 0x04200800L,
-	0x04200802L, 0x00200000L, 0x00000000L, 0x04000002L,
-	0x00000002L, 0x04000000L, 0x04200002L, 0x00000802L,
-	0x04000800L, 0x00200802L, 0x00200002L, 0x04000800L,
-	0x04000002L, 0x04200000L, 0x04200800L, 0x00200002L,
-	0x04200000L, 0x00000800L, 0x00000802L, 0x04200802L,
-	0x00200800L, 0x00000002L, 0x04000000L, 0x00200800L,
-	0x04000000L, 0x00200800L, 0x00200000L, 0x04000802L,
-	0x04000802L, 0x04200002L, 0x04200002L, 0x00000002L,
-	0x00200002L, 0x04000000L, 0x04000800L, 0x00200000L,
-	0x04200800L, 0x00000802L, 0x00200802L, 0x04200800L,
-	0x00000802L, 0x04000002L, 0x04200802L, 0x04200000L,
-	0x00200800L, 0x00000000L, 0x00000002L, 0x04200802L,
-	0x00000000L, 0x00200802L, 0x04200000L, 0x00000800L,
-	0x04000002L, 0x04000800L, 0x00000800L, 0x00200002L };
-
-static unsigned long SP8[64] = {
-	0x10001040L, 0x00001000L, 0x00040000L, 0x10041040L,
-	0x10000000L, 0x10001040L, 0x00000040L, 0x10000000L,
-	0x00040040L, 0x10040000L, 0x10041040L, 0x00041000L,
-	0x10041000L, 0x00041040L, 0x00001000L, 0x00000040L,
-	0x10040000L, 0x10000040L, 0x10001000L, 0x00001040L,
-	0x00041000L, 0x00040040L, 0x10040040L, 0x10041000L,
-	0x00001040L, 0x00000000L, 0x00000000L, 0x10040040L,
-	0x10000040L, 0x10001000L, 0x00041040L, 0x00040000L,
-	0x00041040L, 0x00040000L, 0x10041000L, 0x00001000L,
-	0x00000040L, 0x10040040L, 0x00001000L, 0x00041040L,
-	0x10001000L, 0x00000040L, 0x10000040L, 0x10040000L,
-	0x10040040L, 0x10000000L, 0x00040000L, 0x10001040L,
-	0x00000000L, 0x10041040L, 0x00040040L, 0x10000040L,
-	0x10040000L, 0x10001000L, 0x10001040L, 0x00000000L,
-	0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L,
-	0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L };
-
-static void desfunc(register unsigned long *block,
-                    register unsigned long *keys)
-{
-	register unsigned long fval, work, right, leftt;
-	register int round;
-
-	leftt = block[0];
-	right = block[1];
-	work = ((leftt >> 4) ^ right) & 0x0f0f0f0fL;
-	right ^= work;
-	leftt ^= (work << 4);
-	work = ((leftt >> 16) ^ right) & 0x0000ffffL;
-	right ^= work;
-	leftt ^= (work << 16);
-	work = ((right >> 2) ^ leftt) & 0x33333333L;
-	leftt ^= work;
-	right ^= (work << 2);
-	work = ((right >> 8) ^ leftt) & 0x00ff00ffL;
-	leftt ^= work;
-	right ^= (work << 8);
-	right = ((right << 1) | ((right >> 31) & 1L)) & 0xffffffffL;
-	work = (leftt ^ right) & 0xaaaaaaaaL;
-	leftt ^= work;
-	right ^= work;
-	leftt = ((leftt << 1) | ((leftt >> 31) & 1L)) & 0xffffffffL;
-
-	for( round = 0; round < 8; round++ ) {
-		work  = (right << 28) | (right >> 4);
-		work ^= *keys++;
-		fval  = SP7[ work		 & 0x3fL];
-		fval |= SP5[(work >>  8) & 0x3fL];
-		fval |= SP3[(work >> 16) & 0x3fL];
-		fval |= SP1[(work >> 24) & 0x3fL];
-		work  = right ^ *keys++;
-		fval |= SP8[ work		 & 0x3fL];
-		fval |= SP6[(work >>  8) & 0x3fL];
-		fval |= SP4[(work >> 16) & 0x3fL];
-		fval |= SP2[(work >> 24) & 0x3fL];
-		leftt ^= fval;
-		work  = (leftt << 28) | (leftt >> 4);
-		work ^= *keys++;
-		fval  = SP7[ work		 & 0x3fL];
-		fval |= SP5[(work >>  8) & 0x3fL];
-		fval |= SP3[(work >> 16) & 0x3fL];
-		fval |= SP1[(work >> 24) & 0x3fL];
-		work  = leftt ^ *keys++;
-		fval |= SP8[ work		 & 0x3fL];
-		fval |= SP6[(work >>  8) & 0x3fL];
-		fval |= SP4[(work >> 16) & 0x3fL];
-		fval |= SP2[(work >> 24) & 0x3fL];
-		right ^= fval;
-		}
-
-	right = (right << 31) | (right >> 1);
-	work = (leftt ^ right) & 0xaaaaaaaaL;
-	leftt ^= work;
-	right ^= work;
-	leftt = (leftt << 31) | (leftt >> 1);
-	work = ((leftt >> 8) ^ right) & 0x00ff00ffL;
-	right ^= work;
-	leftt ^= (work << 8);
-	work = ((leftt >> 2) ^ right) & 0x33333333L;
-	right ^= work;
-	leftt ^= (work << 2);
-	work = ((right >> 16) ^ leftt) & 0x0000ffffL;
-	leftt ^= work;
-	right ^= (work << 16);
-	work = ((right >> 4) ^ leftt) & 0x0f0f0f0fL;
-	leftt ^= work;
-	right ^= (work << 4);
-	*block++ = right;
-	*block = leftt;
-	return;
-	}
-
-/* Validation sets:
- *
- * Single-length key, single-length plaintext -
- * Key	  : 0123 4567 89ab cdef
- * Plain  : 0123 4567 89ab cde7
- * Cipher : c957 4425 6a5e d31d
- *
- * Double-length key, single-length plaintext -
- * Key	  : 0123 4567 89ab cdef fedc ba98 7654 3210
- * Plain  : 0123 4567 89ab cde7
- * Cipher : 7f1d 0a77 826b 8aff
- *
- * Double-length key, double-length plaintext -
- * Key	  : 0123 4567 89ab cdef fedc ba98 7654 3210
- * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff
- * Cipher : 27a0 8440 406a df60 278f 47cf 42d6 15d7
- *
- * Triple-length key, single-length plaintext -
- * Key	  : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567
- * Plain  : 0123 4567 89ab cde7
- * Cipher : de0b 7c06 ae5e 0ed5
- *
- * Triple-length key, double-length plaintext -
- * Key	  : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567
- * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff
- * Cipher : ad0d 1b30 ac17 cf07 0ed1 1c63 81e4 4de5
- *
- * d3des V5.0a rwo 9208.07 18:44 Graven Imagery
- **********************************************************************/
diff --git a/ica/x11/common/d3des.h b/ica/x11/common/d3des.h
deleted file mode 100644
index e3761ca..0000000
--- a/ica/x11/common/d3des.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef D3DES_H
-#define D3DES_H
-
-/*
- * This is D3DES (V5.09) by Richard Outerbridge with the double and
- * triple-length support removed for use in VNC.
- *
- * These changes are:
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* d3des.h -
- *
- *	Headers and defines for d3des.c
- *	Graven Imagery, 1992.
- *
- * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
- *	(GEnie : OUTER; CIS : [71755,204])
- */
-
-#define EN0	0	/* MODE == encrypt */
-#define DE1	1	/* MODE == decrypt */
-
-extern void rfbDesKey(unsigned char *, int);
-/*		      hexkey[8]     MODE
- * Sets the internal key register according to the hexadecimal
- * key contained in the 8 bytes of hexkey, according to the DES,
- * for encryption or decryption according to MODE.
- */
-
-extern void rfbUseKey(unsigned long *);
-/*		    cookedkey[32]
- * Loads the internal key register with the data in cookedkey.
- */
-
-extern void rfbCPKey(unsigned long *);
-/*		   cookedkey[32]
- * Copies the contents of the internal key register into the storage
- * located at &cookedkey[0].
- */
-
-extern void rfbDes(unsigned char *, unsigned char *);
-/*		    from[8]	      to[8]
- * Encrypts/Decrypts (according to the key currently loaded in the
- * internal key register) one block of eight bytes at address 'from'
- * into the block at address 'to'.  They can be the same.
- */
-
-/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery
- ********************************************************************/
-
-#endif
diff --git a/ica/x11/common/lzoconf.h b/ica/x11/common/lzoconf.h
deleted file mode 100644
index 23c6ca9..0000000
--- a/ica/x11/common/lzoconf.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/* lzoconf.h -- configuration of the LZO data compression library
-
-   This file is part of the LZO real-time data compression library.
-
-   Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
-   All Rights Reserved.
-
-   The LZO library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   The LZO library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with the LZO library; see the file COPYING.
-   If not, write to the Free Software Foundation, Inc.,
-   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-   Markus F.X.J. Oberhumer
-   <markus at oberhumer.com>
-   http://www.oberhumer.com/opensource/lzo/
- */
-
-
-#ifndef __LZOCONF_H_INCLUDED
-#define __LZOCONF_H_INCLUDED 1
-
-#define LZO_VERSION             0x2060
-#define LZO_VERSION_STRING      "2.06"
-#define LZO_VERSION_DATE        "Aug 12 2011"
-
-/* internal Autoconf configuration file - only used when building LZO */
-#if defined(LZO_HAVE_CONFIG_H)
-#  include <config.h>
-#endif
-#include <limits.h>
-#include <stddef.h>
-
-
-/***********************************************************************
-// LZO requires a conforming <limits.h>
-************************************************************************/
-
-#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
-#  error "invalid CHAR_BIT"
-#endif
-#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
-#  error "check your compiler installation"
-#endif
-#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
-#  error "your limits.h macros are broken"
-#endif
-
-/* get OS and architecture defines */
-#ifndef __LZODEFS_H_INCLUDED
-#include "lzodefs.h"
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/***********************************************************************
-// some core defines
-************************************************************************/
-
-#if !defined(LZO_UINT32_C)
-#  if (UINT_MAX < LZO_0xffffffffL)
-#    define LZO_UINT32_C(c)     c ## UL
-#  else
-#    define LZO_UINT32_C(c)     ((c) + 0U)
-#  endif
-#endif
-
-/* memory checkers */
-#if !defined(__LZO_CHECKER)
-#  if defined(__BOUNDS_CHECKING_ON)
-#    define __LZO_CHECKER       1
-#  elif defined(__CHECKER__)
-#    define __LZO_CHECKER       1
-#  elif defined(__INSURE__)
-#    define __LZO_CHECKER       1
-#  elif defined(__PURIFY__)
-#    define __LZO_CHECKER       1
-#  endif
-#endif
-
-
-/***********************************************************************
-// integral and pointer types
-************************************************************************/
-
-/* lzo_uint should match size_t */
-#if !defined(LZO_UINT_MAX)
-#  if defined(LZO_ABI_LLP64) /* WIN64 */
-#    if defined(LZO_OS_WIN64)
-     typedef unsigned __int64   lzo_uint;
-     typedef __int64            lzo_int;
-#    else
-     typedef unsigned long long lzo_uint;
-     typedef long long          lzo_int;
-#    endif
-#    define LZO_UINT_MAX        0xffffffffffffffffull
-#    define LZO_INT_MAX         9223372036854775807LL
-#    define LZO_INT_MIN         (-1LL - LZO_INT_MAX)
-#  elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
-     typedef unsigned int       lzo_uint;
-     typedef int                lzo_int;
-#    define LZO_UINT_MAX        UINT_MAX
-#    define LZO_INT_MAX         INT_MAX
-#    define LZO_INT_MIN         INT_MIN
-#  elif (ULONG_MAX >= LZO_0xffffffffL)
-     typedef unsigned long      lzo_uint;
-     typedef long               lzo_int;
-#    define LZO_UINT_MAX        ULONG_MAX
-#    define LZO_INT_MAX         LONG_MAX
-#    define LZO_INT_MIN         LONG_MIN
-#  else
-#    error "lzo_uint"
-#  endif
-#endif
-
-/* Integral types with 32 bits or more. */
-#if !defined(LZO_UINT32_MAX)
-#  if (UINT_MAX >= LZO_0xffffffffL)
-     typedef unsigned int       lzo_uint32;
-     typedef int                lzo_int32;
-#    define LZO_UINT32_MAX      UINT_MAX
-#    define LZO_INT32_MAX       INT_MAX
-#    define LZO_INT32_MIN       INT_MIN
-#  elif (ULONG_MAX >= LZO_0xffffffffL)
-     typedef unsigned long      lzo_uint32;
-     typedef long               lzo_int32;
-#    define LZO_UINT32_MAX      ULONG_MAX
-#    define LZO_INT32_MAX       LONG_MAX
-#    define LZO_INT32_MIN       LONG_MIN
-#  else
-#    error "lzo_uint32"
-#  endif
-#endif
-
-/* Integral types with exactly 64 bits. */
-#if !defined(LZO_UINT64_MAX)
-#  if (LZO_UINT_MAX >= LZO_0xffffffffL)
-#   if ((((LZO_UINT_MAX) >> 31) >> 31) == 3)
-#    define lzo_uint64          lzo_uint
-#    define lzo_int64           lzo_int
-#    define LZO_UINT64_MAX      LZO_UINT_MAX
-#    define LZO_INT64_MAX       LZO_INT_MAX
-#    define LZO_INT64_MIN       LZO_INT_MIN
-#   endif
-#  elif (ULONG_MAX >= LZO_0xffffffffL)
-#   if ((((ULONG_MAX) >> 31) >> 31) == 3)
-     typedef unsigned long      lzo_uint64;
-     typedef long               lzo_int64;
-#    define LZO_UINT64_MAX      ULONG_MAX
-#    define LZO_INT64_MAX       LONG_MAX
-#    define LZO_INT64_MIN       LONG_MIN
-#   endif
-#  endif
-#endif
-
-/* The larger type of lzo_uint and lzo_uint32. */
-#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
-#  define lzo_xint              lzo_uint
-#else
-#  define lzo_xint              lzo_uint32
-#endif
-
-/* Memory model that allows to access memory at offsets of lzo_uint. */
-#if !defined(__LZO_MMODEL)
-#  if (LZO_UINT_MAX <= UINT_MAX)
-#    define __LZO_MMODEL        /*empty*/
-#  elif defined(LZO_HAVE_MM_HUGE_PTR)
-#    define __LZO_MMODEL_HUGE   1
-#    define __LZO_MMODEL        __huge
-#  else
-#    define __LZO_MMODEL        /*empty*/
-#  endif
-#endif
-
-/* no typedef here because of const-pointer issues */
-#define lzo_bytep               unsigned char __LZO_MMODEL *
-#define lzo_charp               char __LZO_MMODEL *
-#define lzo_voidp               void __LZO_MMODEL *
-#define lzo_shortp              short __LZO_MMODEL *
-#define lzo_ushortp             unsigned short __LZO_MMODEL *
-#define lzo_uint32p             lzo_uint32 __LZO_MMODEL *
-#define lzo_int32p              lzo_int32 __LZO_MMODEL *
-#if defined(LZO_UINT64_MAX)
-#define lzo_uint64p             lzo_uint64 __LZO_MMODEL *
-#define lzo_int64p              lzo_int64 __LZO_MMODEL *
-#endif
-#define lzo_uintp               lzo_uint __LZO_MMODEL *
-#define lzo_intp                lzo_int __LZO_MMODEL *
-#define lzo_xintp               lzo_xint __LZO_MMODEL *
-#define lzo_voidpp              lzo_voidp __LZO_MMODEL *
-#define lzo_bytepp              lzo_bytep __LZO_MMODEL *
-/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
-#define lzo_byte                unsigned char __LZO_MMODEL
-
-typedef int lzo_bool;
-
-
-/***********************************************************************
-// function types
-************************************************************************/
-
-/* name mangling */
-#if !defined(__LZO_EXTERN_C)
-#  ifdef __cplusplus
-#    define __LZO_EXTERN_C      extern "C"
-#  else
-#    define __LZO_EXTERN_C      extern
-#  endif
-#endif
-
-/* calling convention */
-#if !defined(__LZO_CDECL)
-#  define __LZO_CDECL           __lzo_cdecl
-#endif
-
-/* DLL export information */
-#if !defined(__LZO_EXPORT1)
-#  define __LZO_EXPORT1         /*empty*/
-#endif
-#if !defined(__LZO_EXPORT2)
-#  define __LZO_EXPORT2         /*empty*/
-#endif
-
-/* __cdecl calling convention for public C and assembly functions */
-#if !defined(LZO_PUBLIC)
-#  define LZO_PUBLIC(_rettype)  __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
-#endif
-#if !defined(LZO_EXTERN)
-#  define LZO_EXTERN(_rettype)  __LZO_EXTERN_C LZO_PUBLIC(_rettype)
-#endif
-#if !defined(LZO_PRIVATE)
-#  define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
-#endif
-
-/* function types */
-typedef int
-(__LZO_CDECL *lzo_compress_t)   ( const lzo_bytep src, lzo_uint  src_len,
-                                        lzo_bytep dst, lzo_uintp dst_len,
-                                        lzo_voidp wrkmem );
-
-typedef int
-(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint  src_len,
-                                        lzo_bytep dst, lzo_uintp dst_len,
-                                        lzo_voidp wrkmem );
-
-typedef int
-(__LZO_CDECL *lzo_optimize_t)   (       lzo_bytep src, lzo_uint  src_len,
-                                        lzo_bytep dst, lzo_uintp dst_len,
-                                        lzo_voidp wrkmem );
-
-typedef int
-(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint  src_len,
-                                         lzo_bytep dst, lzo_uintp dst_len,
-                                         lzo_voidp wrkmem,
-                                   const lzo_bytep dict, lzo_uint dict_len );
-
-typedef int
-(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint  src_len,
-                                           lzo_bytep dst, lzo_uintp dst_len,
-                                           lzo_voidp wrkmem,
-                                     const lzo_bytep dict, lzo_uint dict_len );
-
-
-/* Callback interface. Currently only the progress indicator ("nprogress")
- * is used, but this may change in a future release. */
-
-struct lzo_callback_t;
-typedef struct lzo_callback_t lzo_callback_t;
-#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
-
-/* malloc & free function types */
-typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
-    (lzo_callback_p self, lzo_uint items, lzo_uint size);
-typedef void      (__LZO_CDECL *lzo_free_func_t)
-    (lzo_callback_p self, lzo_voidp ptr);
-
-/* a progress indicator callback function */
-typedef void (__LZO_CDECL *lzo_progress_func_t)
-    (lzo_callback_p, lzo_uint, lzo_uint, int);
-
-struct lzo_callback_t
-{
-    /* custom allocators (set to 0 to disable) */
-    lzo_alloc_func_t nalloc;                /* [not used right now] */
-    lzo_free_func_t nfree;                  /* [not used right now] */
-
-    /* a progress indicator callback function (set to 0 to disable) */
-    lzo_progress_func_t nprogress;
-
-    /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
-     * callbacks points back to this struct, so you are free to store
-     * some extra info in the following variables. */
-    lzo_voidp user1;
-    lzo_xint user2;
-    lzo_xint user3;
-};
-
-
-/***********************************************************************
-// error codes and prototypes
-************************************************************************/
-
-/* Error codes for the compression/decompression functions. Negative
- * values are errors, positive values will be used for special but
- * normal events.
- */
-#define LZO_E_OK                    0
-#define LZO_E_ERROR                 (-1)
-#define LZO_E_OUT_OF_MEMORY         (-2)    /* [lzo_alloc_func_t failure] */
-#define LZO_E_NOT_COMPRESSIBLE      (-3)    /* [not used right now] */
-#define LZO_E_INPUT_OVERRUN         (-4)
-#define LZO_E_OUTPUT_OVERRUN        (-5)
-#define LZO_E_LOOKBEHIND_OVERRUN    (-6)
-#define LZO_E_EOF_NOT_FOUND         (-7)
-#define LZO_E_INPUT_NOT_CONSUMED    (-8)
-#define LZO_E_NOT_YET_IMPLEMENTED   (-9)    /* [not used right now] */
-#define LZO_E_INVALID_ARGUMENT      (-10)
-
-
-#ifndef lzo_sizeof_dict_t
-#  define lzo_sizeof_dict_t     ((unsigned)sizeof(lzo_bytep))
-#endif
-
-/* lzo_init() should be the first function you call.
- * Check the return code !
- *
- * lzo_init() is a macro to allow checking that the library and the
- * compiler's view of various types are consistent.
- */
-#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
-    (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
-    (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
-    (int)sizeof(lzo_callback_t))
-LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
-
-/* version functions (useful for shared libraries) */
-LZO_EXTERN(unsigned) lzo_version(void);
-LZO_EXTERN(const char *) lzo_version_string(void);
-LZO_EXTERN(const char *) lzo_version_date(void);
-LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
-LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
-
-/* string functions */
-LZO_EXTERN(int)
-    lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len);
-LZO_EXTERN(lzo_voidp)
-    lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
-LZO_EXTERN(lzo_voidp)
-    lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
-LZO_EXTERN(lzo_voidp)
-    lzo_memset(lzo_voidp buf, int c, lzo_uint len);
-
-/* checksum functions */
-LZO_EXTERN(lzo_uint32)
-    lzo_adler32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
-LZO_EXTERN(lzo_uint32)
-    lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
-LZO_EXTERN(const lzo_uint32p)
-    lzo_get_crc32_table(void);
-
-/* misc. */
-LZO_EXTERN(int) _lzo_config_check(void);
-typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
-typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
-typedef union { void *vp; lzo_bytep bp; lzo_uint u; lzo_uint32 u32; unsigned long l; } lzo_align_t;
-
-/* align a char pointer on a boundary that is a multiple of 'size' */
-LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
-#define LZO_PTR_ALIGN_UP(p,size) \
-    ((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size)))
-
-
-/***********************************************************************
-// deprecated macros - only for backward compatibility with LZO v1.xx
-************************************************************************/
-
-#if defined(LZO_CFG_COMPAT)
-
-#define __LZOCONF_H 1
-
-#if defined(LZO_ARCH_I086)
-#  define __LZO_i386 1
-#elif defined(LZO_ARCH_I386)
-#  define __LZO_i386 1
-#endif
-
-#if defined(LZO_OS_DOS16)
-#  define __LZO_DOS 1
-#  define __LZO_DOS16 1
-#elif defined(LZO_OS_DOS32)
-#  define __LZO_DOS 1
-#elif defined(LZO_OS_WIN16)
-#  define __LZO_WIN 1
-#  define __LZO_WIN16 1
-#elif defined(LZO_OS_WIN32)
-#  define __LZO_WIN 1
-#endif
-
-#define __LZO_CMODEL            /*empty*/
-#define __LZO_DMODEL            /*empty*/
-#define __LZO_ENTRY             __LZO_CDECL
-#define LZO_EXTERN_CDECL        LZO_EXTERN
-#define LZO_ALIGN               LZO_PTR_ALIGN_UP
-
-#define lzo_compress_asm_t      lzo_compress_t
-#define lzo_decompress_asm_t    lzo_decompress_t
-
-#endif /* LZO_CFG_COMPAT */
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* already included */
-
-
-/* vim:set ts=4 et: */
diff --git a/ica/x11/common/lzodefs.h b/ica/x11/common/lzodefs.h
deleted file mode 100644
index 0e40e33..0000000
--- a/ica/x11/common/lzodefs.h
+++ /dev/null
@@ -1,1852 +0,0 @@
-/* lzodefs.h -- architecture, OS and compiler specific defines
-
-   This file is part of the LZO real-time data compression library.
-
-   Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
-   All Rights Reserved.
-
-   The LZO library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   The LZO library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with the LZO library; see the file COPYING.
-   If not, write to the Free Software Foundation, Inc.,
-   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-   Markus F.X.J. Oberhumer
-   <markus at oberhumer.com>
-   http://www.oberhumer.com/opensource/lzo/
- */
-
-
-#ifndef __LZODEFS_H_INCLUDED
-#define __LZODEFS_H_INCLUDED 1
-
-#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
-#  define __CYGWIN__ __CYGWIN32__
-#endif
-#if defined(__IBMCPP__) && !defined(__IBMC__)
-#  define __IBMC__ __IBMCPP__
-#endif
-#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
-#  define __INTEL_COMPILER __ICL
-#endif
-#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
-#  define _ALL_SOURCE 1
-#endif
-#if defined(__mips__) && defined(__R5900__)
-#  if !defined(__LONG_MAX__)
-#    define __LONG_MAX__ 9223372036854775807L
-#  endif
-#endif
-#if defined(__INTEL_COMPILER) && defined(__linux__)
-#  pragma warning(disable: 193)
-#endif
-#if defined(__KEIL__) && defined(__C166__)
-#  pragma warning disable = 322
-#elif 0 && defined(__C251__)
-#  pragma warning disable = 322
-#endif
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
-#  if (_MSC_VER >= 1300)
-#    pragma warning(disable: 4668)
-#  endif
-#endif
-#if 0 && defined(__WATCOMC__)
-#  if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
-#    pragma warning 203 9
-#  endif
-#endif
-#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
-#  pragma option -h
-#endif
-#if 0
-#define LZO_0xffffL             0xfffful
-#define LZO_0xffffffffL         0xfffffffful
-#else
-#define LZO_0xffffL             65535ul
-#define LZO_0xffffffffL         4294967295ul
-#endif
-#if (LZO_0xffffL == LZO_0xffffffffL)
-#  error "your preprocessor is broken 1"
-#endif
-#if (16ul * 16384ul != 262144ul)
-#  error "your preprocessor is broken 2"
-#endif
-#if 0
-#if (32767 >= 4294967295ul)
-#  error "your preprocessor is broken 3"
-#endif
-#if (65535u >= 4294967295ul)
-#  error "your preprocessor is broken 4"
-#endif
-#endif
-#if (UINT_MAX == LZO_0xffffL)
-#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
-#  if !defined(MSDOS)
-#    define MSDOS 1
-#  endif
-#  if !defined(_MSDOS)
-#    define _MSDOS 1
-#  endif
-#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
-#  if (__VERSION == 520) && (MB_LEN_MAX == 1)
-#    if !defined(__AZTEC_C__)
-#      define __AZTEC_C__ __VERSION
-#    endif
-#    if !defined(__DOS__)
-#      define __DOS__ 1
-#    endif
-#  endif
-#endif
-#endif
-#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL)
-#  define ptrdiff_t long
-#  define _PTRDIFF_T_DEFINED 1
-#endif
-#if (UINT_MAX == LZO_0xffffL)
-#  undef __LZO_RENAME_A
-#  undef __LZO_RENAME_B
-#  if defined(__AZTEC_C__) && defined(__DOS__)
-#    define __LZO_RENAME_A 1
-#  elif defined(_MSC_VER) && defined(MSDOS)
-#    if (_MSC_VER < 600)
-#      define __LZO_RENAME_A 1
-#    elif (_MSC_VER < 700)
-#      define __LZO_RENAME_B 1
-#    endif
-#  elif defined(__TSC__) && defined(__OS2__)
-#    define __LZO_RENAME_A 1
-#  elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
-#    define __LZO_RENAME_A 1
-#  elif defined(__PACIFIC__) && defined(DOS)
-#    if !defined(__far)
-#      define __far far
-#    endif
-#    if !defined(__near)
-#      define __near near
-#    endif
-#  endif
-#  if defined(__LZO_RENAME_A)
-#    if !defined(__cdecl)
-#      define __cdecl cdecl
-#    endif
-#    if !defined(__far)
-#      define __far far
-#    endif
-#    if !defined(__huge)
-#      define __huge huge
-#    endif
-#    if !defined(__near)
-#      define __near near
-#    endif
-#    if !defined(__pascal)
-#      define __pascal pascal
-#    endif
-#    if !defined(__huge)
-#      define __huge huge
-#    endif
-#  elif defined(__LZO_RENAME_B)
-#    if !defined(__cdecl)
-#      define __cdecl _cdecl
-#    endif
-#    if !defined(__far)
-#      define __far _far
-#    endif
-#    if !defined(__huge)
-#      define __huge _huge
-#    endif
-#    if !defined(__near)
-#      define __near _near
-#    endif
-#    if !defined(__pascal)
-#      define __pascal _pascal
-#    endif
-#  elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
-#    if !defined(__cdecl)
-#      define __cdecl cdecl
-#    endif
-#    if !defined(__pascal)
-#      define __pascal pascal
-#    endif
-#  endif
-#  undef __LZO_RENAME_A
-#  undef __LZO_RENAME_B
-#endif
-#if (UINT_MAX == LZO_0xffffL)
-#if defined(__AZTEC_C__) && defined(__DOS__)
-#  define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#elif defined(_MSC_VER) && defined(MSDOS)
-#  if (_MSC_VER < 600)
-#    define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#  endif
-#  if (_MSC_VER < 700)
-#    define LZO_BROKEN_INTEGRAL_PROMOTION 1
-#    define LZO_BROKEN_SIZEOF 1
-#  endif
-#elif defined(__PACIFIC__) && defined(DOS)
-#  define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#elif defined(__TURBOC__) && defined(__MSDOS__)
-#  if (__TURBOC__ < 0x0150)
-#    define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#    define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#    define LZO_BROKEN_INTEGRAL_PROMOTION 1
-#  endif
-#  if (__TURBOC__ < 0x0200)
-#    define LZO_BROKEN_SIZEOF 1
-#  endif
-#  if (__TURBOC__ < 0x0400) && defined(__cplusplus)
-#    define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#  endif
-#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
-#  define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#  define LZO_BROKEN_SIZEOF 1
-#endif
-#endif
-#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
-#  define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#endif
-#if defined(_CRAY) && defined(_CRAY1)
-#  define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1
-#endif
-#define LZO_PP_STRINGIZE(x)             #x
-#define LZO_PP_MACRO_EXPAND(x)          LZO_PP_STRINGIZE(x)
-#define LZO_PP_CONCAT2(a,b)             a ## b
-#define LZO_PP_CONCAT3(a,b,c)           a ## b ## c
-#define LZO_PP_CONCAT4(a,b,c,d)         a ## b ## c ## d
-#define LZO_PP_CONCAT5(a,b,c,d,e)       a ## b ## c ## d ## e
-#define LZO_PP_ECONCAT2(a,b)            LZO_PP_CONCAT2(a,b)
-#define LZO_PP_ECONCAT3(a,b,c)          LZO_PP_CONCAT3(a,b,c)
-#define LZO_PP_ECONCAT4(a,b,c,d)        LZO_PP_CONCAT4(a,b,c,d)
-#define LZO_PP_ECONCAT5(a,b,c,d,e)      LZO_PP_CONCAT5(a,b,c,d,e)
-#if 1
-#define LZO_CPP_STRINGIZE(x)            #x
-#define LZO_CPP_MACRO_EXPAND(x)         LZO_CPP_STRINGIZE(x)
-#define LZO_CPP_CONCAT2(a,b)            a ## b
-#define LZO_CPP_CONCAT3(a,b,c)          a ## b ## c
-#define LZO_CPP_CONCAT4(a,b,c,d)        a ## b ## c ## d
-#define LZO_CPP_CONCAT5(a,b,c,d,e)      a ## b ## c ## d ## e
-#define LZO_CPP_ECONCAT2(a,b)           LZO_CPP_CONCAT2(a,b)
-#define LZO_CPP_ECONCAT3(a,b,c)         LZO_CPP_CONCAT3(a,b,c)
-#define LZO_CPP_ECONCAT4(a,b,c,d)       LZO_CPP_CONCAT4(a,b,c,d)
-#define LZO_CPP_ECONCAT5(a,b,c,d,e)     LZO_CPP_CONCAT5(a,b,c,d,e)
-#endif
-#define __LZO_MASK_GEN(o,b)     (((((o) << ((b)-1)) - (o)) << 1) + (o))
-#if 1 && defined(__cplusplus)
-#  if !defined(__STDC_CONSTANT_MACROS)
-#    define __STDC_CONSTANT_MACROS 1
-#  endif
-#  if !defined(__STDC_LIMIT_MACROS)
-#    define __STDC_LIMIT_MACROS 1
-#  endif
-#endif
-#if defined(__cplusplus)
-#  define LZO_EXTERN_C extern "C"
-#else
-#  define LZO_EXTERN_C extern
-#endif
-#if !defined(__LZO_OS_OVERRIDE)
-#if (LZO_OS_FREESTANDING)
-#  define LZO_INFO_OS           "freestanding"
-#elif (LZO_OS_EMBEDDED)
-#  define LZO_INFO_OS           "embedded"
-#elif 1 && defined(__IAR_SYSTEMS_ICC__)
-#  define LZO_OS_EMBEDDED       1
-#  define LZO_INFO_OS           "embedded"
-#elif defined(__CYGWIN__) && defined(__GNUC__)
-#  define LZO_OS_CYGWIN         1
-#  define LZO_INFO_OS           "cygwin"
-#elif defined(__EMX__) && defined(__GNUC__)
-#  define LZO_OS_EMX            1
-#  define LZO_INFO_OS           "emx"
-#elif defined(__BEOS__)
-#  define LZO_OS_BEOS           1
-#  define LZO_INFO_OS           "beos"
-#elif defined(__Lynx__)
-#  define LZO_OS_LYNXOS         1
-#  define LZO_INFO_OS           "lynxos"
-#elif defined(__OS400__)
-#  define LZO_OS_OS400          1
-#  define LZO_INFO_OS           "os400"
-#elif defined(__QNX__)
-#  define LZO_OS_QNX            1
-#  define LZO_INFO_OS           "qnx"
-#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
-#  define LZO_OS_DOS32          1
-#  define LZO_INFO_OS           "dos32"
-#elif defined(__BORLANDC__) && defined(__DPMI16__)
-#  define LZO_OS_DOS16          1
-#  define LZO_INFO_OS           "dos16"
-#elif defined(__ZTC__) && defined(DOS386)
-#  define LZO_OS_DOS32          1
-#  define LZO_INFO_OS           "dos32"
-#elif defined(__OS2__) || defined(__OS2V2__)
-#  if (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_OS216        1
-#    define LZO_INFO_OS         "os216"
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_OS_OS2          1
-#    define LZO_INFO_OS         "os2"
-#  else
-#    error "check your limits.h header"
-#  endif
-#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
-#  define LZO_OS_WIN64          1
-#  define LZO_INFO_OS           "win64"
-#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
-#  define LZO_OS_WIN32          1
-#  define LZO_INFO_OS           "win32"
-#elif defined(__MWERKS__) && defined(__INTEL__)
-#  define LZO_OS_WIN32          1
-#  define LZO_INFO_OS           "win32"
-#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
-#  if (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_WIN16        1
-#    define LZO_INFO_OS         "win16"
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_OS_WIN32        1
-#    define LZO_INFO_OS         "win32"
-#  else
-#    error "check your limits.h header"
-#  endif
-#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
-#  if (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_DOS16        1
-#    define LZO_INFO_OS         "dos16"
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_OS_DOS32        1
-#    define LZO_INFO_OS         "dos32"
-#  else
-#    error "check your limits.h header"
-#  endif
-#elif defined(__WATCOMC__)
-#  if defined(__NT__) && (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_DOS16        1
-#    define LZO_INFO_OS         "dos16"
-#  elif defined(__NT__) && (__WATCOMC__ < 1100)
-#    define LZO_OS_WIN32        1
-#    define LZO_INFO_OS         "win32"
-#  elif defined(__linux__) || defined(__LINUX__)
-#    define LZO_OS_POSIX        1
-#    define LZO_INFO_OS         "posix"
-#  else
-#    error "please specify a target using the -bt compiler option"
-#  endif
-#elif defined(__palmos__)
-#  define LZO_OS_PALMOS         1
-#  define LZO_INFO_OS           "palmos"
-#elif defined(__TOS__) || defined(__atarist__)
-#  define LZO_OS_TOS            1
-#  define LZO_INFO_OS           "tos"
-#elif defined(macintosh) && !defined(__ppc__)
-#  define LZO_OS_MACCLASSIC     1
-#  define LZO_INFO_OS           "macclassic"
-#elif defined(__VMS)
-#  define LZO_OS_VMS            1
-#  define LZO_INFO_OS           "vms"
-#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
-#  define LZO_OS_CONSOLE        1
-#  define LZO_OS_CONSOLE_PS2    1
-#  define LZO_INFO_OS           "console"
-#  define LZO_INFO_OS_CONSOLE   "ps2"
-#elif (defined(__mips__) && defined(__psp__))
-#  define LZO_OS_CONSOLE        1
-#  define LZO_OS_CONSOLE_PSP    1
-#  define LZO_INFO_OS           "console"
-#  define LZO_INFO_OS_CONSOLE   "psp"
-#else
-#  define LZO_OS_POSIX          1
-#  define LZO_INFO_OS           "posix"
-#endif
-#if (LZO_OS_POSIX)
-#  if defined(_AIX) || defined(__AIX__) || defined(__aix__)
-#    define LZO_OS_POSIX_AIX        1
-#    define LZO_INFO_OS_POSIX       "aix"
-#  elif defined(__FreeBSD__)
-#    define LZO_OS_POSIX_FREEBSD    1
-#    define LZO_INFO_OS_POSIX       "freebsd"
-#  elif defined(__hpux__) || defined(__hpux)
-#    define LZO_OS_POSIX_HPUX       1
-#    define LZO_INFO_OS_POSIX       "hpux"
-#  elif defined(__INTERIX)
-#    define LZO_OS_POSIX_INTERIX    1
-#    define LZO_INFO_OS_POSIX       "interix"
-#  elif defined(__IRIX__) || defined(__irix__)
-#    define LZO_OS_POSIX_IRIX       1
-#    define LZO_INFO_OS_POSIX       "irix"
-#  elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
-#    define LZO_OS_POSIX_LINUX      1
-#    define LZO_INFO_OS_POSIX       "linux"
-#  elif defined(__APPLE__) || defined(__MACOS__)
-#    define LZO_OS_POSIX_MACOSX     1
-#    define LZO_INFO_OS_POSIX       "macosx"
-#  elif defined(__minix__) || defined(__minix)
-#    define LZO_OS_POSIX_MINIX      1
-#    define LZO_INFO_OS_POSIX       "minix"
-#  elif defined(__NetBSD__)
-#    define LZO_OS_POSIX_NETBSD     1
-#    define LZO_INFO_OS_POSIX       "netbsd"
-#  elif defined(__OpenBSD__)
-#    define LZO_OS_POSIX_OPENBSD    1
-#    define LZO_INFO_OS_POSIX       "openbsd"
-#  elif defined(__osf__)
-#    define LZO_OS_POSIX_OSF        1
-#    define LZO_INFO_OS_POSIX       "osf"
-#  elif defined(__solaris__) || defined(__sun)
-#    if defined(__SVR4) || defined(__svr4__)
-#      define LZO_OS_POSIX_SOLARIS  1
-#      define LZO_INFO_OS_POSIX     "solaris"
-#    else
-#      define LZO_OS_POSIX_SUNOS    1
-#      define LZO_INFO_OS_POSIX     "sunos"
-#    endif
-#  elif defined(__ultrix__) || defined(__ultrix)
-#    define LZO_OS_POSIX_ULTRIX     1
-#    define LZO_INFO_OS_POSIX       "ultrix"
-#  elif defined(_UNICOS)
-#    define LZO_OS_POSIX_UNICOS     1
-#    define LZO_INFO_OS_POSIX       "unicos"
-#  else
-#    define LZO_OS_POSIX_UNKNOWN    1
-#    define LZO_INFO_OS_POSIX       "unknown"
-#  endif
-#endif
-#endif
-#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#  if (UINT_MAX != LZO_0xffffL)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
-#  if (UINT_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
-#  define LZO_CC_CILLY          1
-#  define LZO_INFO_CC           "Cilly"
-#  if defined(__CILLY__)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__CILLY__)
-#  else
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
-#  define LZO_CC_SDCC           1
-#  define LZO_INFO_CC           "sdcc"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(SDCC)
-#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
-#  define LZO_CC_PATHSCALE      (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
-#  define LZO_INFO_CC           "Pathscale C"
-#  define LZO_INFO_CCVER        __PATHSCALE__
-#elif defined(__INTEL_COMPILER)
-#  define LZO_CC_INTELC         1
-#  define LZO_INFO_CC           "Intel C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
-#  if defined(_WIN32) || defined(_WIN64)
-#    define LZO_CC_SYNTAX_MSC 1
-#  else
-#    define LZO_CC_SYNTAX_GNUC 1
-#  endif
-#elif defined(__POCC__) && defined(_WIN32)
-#  define LZO_CC_PELLESC        1
-#  define LZO_INFO_CC           "Pelles C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__POCC__)
-#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
-#  if defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  else
-#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  endif
-#  if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
-#    define LZO_CC_CLANG_CLANG  (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
-#  else
-#    define LZO_CC_CLANG_CLANG  0x010000L
-#  endif
-#  define LZO_CC_CLANG          LZO_CC_CLANG_GNUC
-#  define LZO_INFO_CC           "clang"
-#  define LZO_INFO_CCVER        __VERSION__
-#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
-#  if defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  else
-#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  endif
-#  define LZO_CC_LLVM           LZO_CC_LLVM_GNUC
-#  define LZO_INFO_CC           "llvm-gcc"
-#  define LZO_INFO_CCVER        __VERSION__
-#elif defined(__GNUC__) && defined(__VERSION__)
-#  if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  elif defined(__GNUC_MINOR__)
-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  else
-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L)
-#  endif
-#  define LZO_INFO_CC           "gcc"
-#  define LZO_INFO_CCVER        __VERSION__
-#elif defined(__ACK__) && defined(_ACK)
-#  define LZO_CC_ACK            1
-#  define LZO_INFO_CC           "Amsterdam Compiler Kit C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__AZTEC_C__)
-#  define LZO_CC_AZTECC         1
-#  define LZO_INFO_CC           "Aztec C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__AZTEC_C__)
-#elif defined(__CODEGEARC__)
-#  define LZO_CC_CODEGEARC      1
-#  define LZO_INFO_CC           "CodeGear C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__CODEGEARC__)
-#elif defined(__BORLANDC__)
-#  define LZO_CC_BORLANDC       1
-#  define LZO_INFO_CC           "Borland C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__BORLANDC__)
-#elif defined(_CRAYC) && defined(_RELEASE)
-#  define LZO_CC_CRAYC          1
-#  define LZO_INFO_CC           "Cray C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(_RELEASE)
-#elif defined(__DMC__) && defined(__SC__)
-#  define LZO_CC_DMC            1
-#  define LZO_INFO_CC           "Digital Mars C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__DMC__)
-#elif defined(__DECC)
-#  define LZO_CC_DECC           1
-#  define LZO_INFO_CC           "DEC C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__DECC)
-#elif defined(__HIGHC__)
-#  define LZO_CC_HIGHC          1
-#  define LZO_INFO_CC           "MetaWare High C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__IAR_SYSTEMS_ICC__)
-#  define LZO_CC_IARC           1
-#  define LZO_INFO_CC           "IAR C"
-#  if defined(__VER__)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__VER__)
-#  else
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(__IBMC__)
-#  define LZO_CC_IBMC           1
-#  define LZO_INFO_CC           "IBM C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__IBMC__)
-#elif defined(__KEIL__) && defined(__C166__)
-#  define LZO_CC_KEILC          1
-#  define LZO_INFO_CC           "Keil C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__C166__)
-#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
-#  define LZO_CC_LCCWIN32       1
-#  define LZO_INFO_CC           "lcc-win32"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__LCC__)
-#  define LZO_CC_LCC            1
-#  define LZO_INFO_CC           "lcc"
-#  if defined(__LCC_VERSION__)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__LCC_VERSION__)
-#  else
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(_MSC_VER)
-#  define LZO_CC_MSC            1
-#  define LZO_INFO_CC           "Microsoft C"
-#  if defined(_MSC_FULL_VER)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
-#  else
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER)
-#  endif
-#elif defined(__MWERKS__)
-#  define LZO_CC_MWERKS         1
-#  define LZO_INFO_CC           "Metrowerks C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__MWERKS__)
-#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
-#  define LZO_CC_NDPC           1
-#  define LZO_INFO_CC           "Microway NDP C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__PACIFIC__)
-#  define LZO_CC_PACIFICC       1
-#  define LZO_INFO_CC           "Pacific C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__PACIFIC__)
-#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
-#  define LZO_CC_PGI            1
-#  define LZO_INFO_CC           "Portland Group PGI C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__PUREC__) && defined(__TOS__)
-#  define LZO_CC_PUREC          1
-#  define LZO_INFO_CC           "Pure C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__PUREC__)
-#elif defined(__SC__) && defined(__ZTC__)
-#  define LZO_CC_SYMANTECC      1
-#  define LZO_INFO_CC           "Symantec C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__SC__)
-#elif defined(__SUNPRO_C)
-#  define LZO_INFO_CC           "SunPro C"
-#  if ((__SUNPRO_C)+0 > 0)
-#    define LZO_CC_SUNPROC      __SUNPRO_C
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__SUNPRO_C)
-#  else
-#    define LZO_CC_SUNPROC      1
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(__SUNPRO_CC)
-#  define LZO_INFO_CC           "SunPro C"
-#  if ((__SUNPRO_CC)+0 > 0)
-#    define LZO_CC_SUNPROC      __SUNPRO_CC
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
-#  else
-#    define LZO_CC_SUNPROC      1
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(__TINYC__)
-#  define LZO_CC_TINYC          1
-#  define LZO_INFO_CC           "Tiny C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__TINYC__)
-#elif defined(__TSC__)
-#  define LZO_CC_TOPSPEEDC      1
-#  define LZO_INFO_CC           "TopSpeed C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__TSC__)
-#elif defined(__WATCOMC__)
-#  define LZO_CC_WATCOMC        1
-#  define LZO_INFO_CC           "Watcom C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__WATCOMC__)
-#elif defined(__TURBOC__)
-#  define LZO_CC_TURBOC         1
-#  define LZO_INFO_CC           "Turbo C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__TURBOC__)
-#elif defined(__ZTC__)
-#  define LZO_CC_ZORTECHC       1
-#  define LZO_INFO_CC           "Zortech C"
-#  if (__ZTC__ == 0x310)
-#    define LZO_INFO_CCVER      "0x310"
-#  else
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__ZTC__)
-#  endif
-#else
-#  define LZO_CC_UNKNOWN        1
-#  define LZO_INFO_CC           "unknown"
-#  define LZO_INFO_CCVER        "unknown"
-#endif
-#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
-#  error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
-#endif
-#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY)
-#  if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY)
-#    if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
-#      define LZO_ARCH_CRAY_MPP     1
-#    elif defined(_CRAY1)
-#      define LZO_ARCH_CRAY_PVP     1
-#    endif
-#  endif
-#endif
-#if !defined(__LZO_ARCH_OVERRIDE)
-#if (LZO_ARCH_GENERIC)
-#  define LZO_INFO_ARCH             "generic"
-#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#  define LZO_ARCH_I086             1
-#  define LZO_ARCH_IA16             1
-#  define LZO_INFO_ARCH             "i086"
-#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
-#  define LZO_ARCH_ALPHA            1
-#  define LZO_INFO_ARCH             "alpha"
-#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
-#  define LZO_ARCH_ALPHA            1
-#  define LZO_INFO_ARCH             "alpha"
-#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
-#  define LZO_ARCH_AMD64            1
-#  define LZO_INFO_ARCH             "amd64"
-#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
-#  define LZO_ARCH_ARM              1
-#  define LZO_ARCH_ARM_THUMB        1
-#  define LZO_INFO_ARCH             "arm_thumb"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
-#  define LZO_ARCH_ARM              1
-#  if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
-#    define LZO_ARCH_ARM_THUMB      1
-#    define LZO_INFO_ARCH           "arm_thumb"
-#  elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
-#    define LZO_INFO_ARCH           "arm"
-#  else
-#    define LZO_INFO_ARCH           "arm"
-#  endif
-#elif defined(__arm__) || defined(_M_ARM)
-#  define LZO_ARCH_ARM              1
-#  define LZO_INFO_ARCH             "arm"
-#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
-#  define LZO_ARCH_AVR              1
-#  define LZO_INFO_ARCH             "avr"
-#elif defined(__avr32__) || defined(__AVR32__)
-#  define LZO_ARCH_AVR32            1
-#  define LZO_INFO_ARCH             "avr32"
-#elif defined(__bfin__)
-#  define LZO_ARCH_BLACKFIN         1
-#  define LZO_INFO_ARCH             "blackfin"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__)
-#  define LZO_ARCH_C166             1
-#  define LZO_INFO_ARCH             "c166"
-#elif defined(__cris__)
-#  define LZO_ARCH_CRIS             1
-#  define LZO_INFO_ARCH             "cris"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
-#  define LZO_ARCH_EZ80             1
-#  define LZO_INFO_ARCH             "ez80"
-#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
-#  define LZO_ARCH_H8300            1
-#  define LZO_INFO_ARCH             "h8300"
-#elif defined(__hppa__) || defined(__hppa)
-#  define LZO_ARCH_HPPA             1
-#  define LZO_INFO_ARCH             "hppa"
-#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
-#  define LZO_ARCH_I386             1
-#  define LZO_ARCH_IA32             1
-#  define LZO_INFO_ARCH             "i386"
-#elif (LZO_CC_ZORTECHC && defined(__I86__))
-#  define LZO_ARCH_I386             1
-#  define LZO_ARCH_IA32             1
-#  define LZO_INFO_ARCH             "i386"
-#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386)
-#  define LZO_ARCH_I386             1
-#  define LZO_ARCH_IA32             1
-#  define LZO_INFO_ARCH             "i386"
-#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
-#  define LZO_ARCH_IA64             1
-#  define LZO_INFO_ARCH             "ia64"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__)
-#  define LZO_ARCH_M16C             1
-#  define LZO_INFO_ARCH             "m16c"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
-#  define LZO_ARCH_M16C             1
-#  define LZO_INFO_ARCH             "m16c"
-#elif defined(__m32r__)
-#  define LZO_ARCH_M32R             1
-#  define LZO_INFO_ARCH             "m32r"
-#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
-#  define LZO_ARCH_M68K             1
-#  define LZO_INFO_ARCH             "m68k"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__)
-#  define LZO_ARCH_MCS251           1
-#  define LZO_INFO_ARCH             "mcs251"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__)
-#  define LZO_ARCH_MCS51            1
-#  define LZO_INFO_ARCH             "mcs51"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
-#  define LZO_ARCH_MCS51            1
-#  define LZO_INFO_ARCH             "mcs51"
-#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
-#  define LZO_ARCH_MIPS             1
-#  define LZO_INFO_ARCH             "mips"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__)
-#  define LZO_ARCH_MSP430           1
-#  define LZO_INFO_ARCH             "msp430"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
-#  define LZO_ARCH_MSP430           1
-#  define LZO_INFO_ARCH             "msp430"
-#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
-#  define LZO_ARCH_POWERPC          1
-#  define LZO_INFO_ARCH             "powerpc"
-#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
-#  define LZO_ARCH_S390             1
-#  define LZO_INFO_ARCH             "s390"
-#elif defined(__sh__) || defined(_M_SH)
-#  define LZO_ARCH_SH               1
-#  define LZO_INFO_ARCH             "sh"
-#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
-#  define LZO_ARCH_SPARC            1
-#  define LZO_INFO_ARCH             "sparc"
-#elif defined(__SPU__)
-#  define LZO_ARCH_SPU              1
-#  define LZO_INFO_ARCH             "spu"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
-#  define LZO_ARCH_Z80              1
-#  define LZO_INFO_ARCH             "z80"
-#elif (LZO_ARCH_CRAY_PVP)
-#  if defined(_CRAYSV1)
-#    define LZO_ARCH_CRAY_SV1       1
-#    define LZO_INFO_ARCH           "cray_sv1"
-#  elif (_ADDR64)
-#    define LZO_ARCH_CRAY_T90       1
-#    define LZO_INFO_ARCH           "cray_t90"
-#  elif (_ADDR32)
-#    define LZO_ARCH_CRAY_YMP       1
-#    define LZO_INFO_ARCH           "cray_ymp"
-#  else
-#    define LZO_ARCH_CRAY_XMP       1
-#    define LZO_INFO_ARCH           "cray_xmp"
-#  endif
-#else
-#  define LZO_ARCH_UNKNOWN          1
-#  define LZO_INFO_ARCH             "unknown"
-#endif
-#endif
-#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2)
-#  error "FIXME - missing define for CPU architecture"
-#endif
-#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
-#  error "FIXME - missing WIN32 define for CPU architecture"
-#endif
-#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
-#  error "FIXME - missing WIN64 define for CPU architecture"
-#endif
-#if (LZO_OS_OS216 || LZO_OS_WIN16)
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#endif
-#if (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM)
-#  error "this should not happen"
-#endif
-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086)
-#  error "this should not happen"
-#endif
-#if (LZO_ARCH_I086)
-#  if (UINT_MAX != LZO_0xffffL)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if (LZO_ARCH_I386)
-#  if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
-#    error "this should not happen"
-#  endif
-#  if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if !defined(__LZO_MM_OVERRIDE)
-#if (LZO_ARCH_I086)
-#if (UINT_MAX != LZO_0xffffL)
-#  error "this should not happen"
-#endif
-#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
-#  define LZO_MM_TINY           1
-#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
-#  define LZO_MM_HUGE           1
-#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
-#  define LZO_MM_SMALL          1
-#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
-#  define LZO_MM_MEDIUM         1
-#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
-#  define LZO_MM_COMPACT        1
-#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
-#  define LZO_MM_LARGE          1
-#elif (LZO_CC_AZTECC)
-#  if defined(_LARGE_CODE) && defined(_LARGE_DATA)
-#    define LZO_MM_LARGE        1
-#  elif defined(_LARGE_CODE)
-#    define LZO_MM_MEDIUM       1
-#  elif defined(_LARGE_DATA)
-#    define LZO_MM_COMPACT      1
-#  else
-#    define LZO_MM_SMALL        1
-#  endif
-#elif (LZO_CC_ZORTECHC && defined(__VCM__))
-#  define LZO_MM_LARGE          1
-#else
-#  error "unknown memory model"
-#endif
-#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#define LZO_HAVE_MM_HUGE_PTR        1
-#define LZO_HAVE_MM_HUGE_ARRAY      1
-#if (LZO_MM_TINY)
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#endif
-#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC)
-#  undef LZO_HAVE_MM_HUGE_PTR
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#elif (LZO_CC_MSC && defined(_QC))
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#  if (_MSC_VER < 600)
-#    undef LZO_HAVE_MM_HUGE_PTR
-#  endif
-#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295))
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#endif
-#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR)
-#  if (LZO_OS_DOS16)
-#    error "this should not happen"
-#  elif (LZO_CC_ZORTECHC)
-#  else
-#    error "this should not happen"
-#  endif
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC)
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295))
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16)
-#  define LZO_MM_AHSHIFT      12
-#elif (LZO_CC_WATCOMC)
-   extern unsigned char _HShift;
-#  define LZO_MM_AHSHIFT      ((unsigned) _HShift)
-#else
-#  error "FIXME - implement LZO_MM_AHSHIFT"
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
-#elif (LZO_ARCH_C166)
-#if !defined(__MODEL__)
-#  error "FIXME - C166 __MODEL__"
-#elif ((__MODEL__) == 0)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 1)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 2)
-#  define LZO_MM_LARGE          1
-#elif ((__MODEL__) == 3)
-#  define LZO_MM_TINY           1
-#elif ((__MODEL__) == 4)
-#  define LZO_MM_XTINY          1
-#elif ((__MODEL__) == 5)
-#  define LZO_MM_XSMALL         1
-#else
-#  error "FIXME - C166 __MODEL__"
-#endif
-#elif (LZO_ARCH_MCS251)
-#if !defined(__MODEL__)
-#  error "FIXME - MCS251 __MODEL__"
-#elif ((__MODEL__) == 0)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 2)
-#  define LZO_MM_LARGE          1
-#elif ((__MODEL__) == 3)
-#  define LZO_MM_TINY           1
-#elif ((__MODEL__) == 4)
-#  define LZO_MM_XTINY          1
-#elif ((__MODEL__) == 5)
-#  define LZO_MM_XSMALL         1
-#else
-#  error "FIXME - MCS251 __MODEL__"
-#endif
-#elif (LZO_ARCH_MCS51)
-#if !defined(__MODEL__)
-#  error "FIXME - MCS51 __MODEL__"
-#elif ((__MODEL__) == 1)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 2)
-#  define LZO_MM_LARGE          1
-#elif ((__MODEL__) == 3)
-#  define LZO_MM_TINY           1
-#elif ((__MODEL__) == 4)
-#  define LZO_MM_XTINY          1
-#elif ((__MODEL__) == 5)
-#  define LZO_MM_XSMALL         1
-#else
-#  error "FIXME - MCS51 __MODEL__"
-#endif
-#elif (LZO_ARCH_CRAY_PVP)
-#  define LZO_MM_PVP            1
-#else
-#  define LZO_MM_FLAT           1
-#endif
-#if (LZO_MM_COMPACT)
-#  define LZO_INFO_MM           "compact"
-#elif (LZO_MM_FLAT)
-#  define LZO_INFO_MM           "flat"
-#elif (LZO_MM_HUGE)
-#  define LZO_INFO_MM           "huge"
-#elif (LZO_MM_LARGE)
-#  define LZO_INFO_MM           "large"
-#elif (LZO_MM_MEDIUM)
-#  define LZO_INFO_MM           "medium"
-#elif (LZO_MM_PVP)
-#  define LZO_INFO_MM           "pvp"
-#elif (LZO_MM_SMALL)
-#  define LZO_INFO_MM           "small"
-#elif (LZO_MM_TINY)
-#  define LZO_INFO_MM           "tiny"
-#else
-#  error "unknown memory model"
-#endif
-#endif
-#if defined(SIZEOF_SHORT)
-#  define LZO_SIZEOF_SHORT          (SIZEOF_SHORT)
-#endif
-#if defined(SIZEOF_INT)
-#  define LZO_SIZEOF_INT            (SIZEOF_INT)
-#endif
-#if defined(SIZEOF_LONG)
-#  define LZO_SIZEOF_LONG           (SIZEOF_LONG)
-#endif
-#if defined(SIZEOF_LONG_LONG)
-#  define LZO_SIZEOF_LONG_LONG      (SIZEOF_LONG_LONG)
-#endif
-#if defined(SIZEOF___INT16)
-#  define LZO_SIZEOF___INT16        (SIZEOF___INT16)
-#endif
-#if defined(SIZEOF___INT32)
-#  define LZO_SIZEOF___INT32        (SIZEOF___INT32)
-#endif
-#if defined(SIZEOF___INT64)
-#  define LZO_SIZEOF___INT64        (SIZEOF___INT64)
-#endif
-#if defined(SIZEOF_VOID_P)
-#  define LZO_SIZEOF_VOID_P         (SIZEOF_VOID_P)
-#endif
-#if defined(SIZEOF_SIZE_T)
-#  define LZO_SIZEOF_SIZE_T         (SIZEOF_SIZE_T)
-#endif
-#if defined(SIZEOF_PTRDIFF_T)
-#  define LZO_SIZEOF_PTRDIFF_T      (SIZEOF_PTRDIFF_T)
-#endif
-#define __LZO_LSR(x,b)    (((x)+0ul) >> (b))
-#if !defined(LZO_SIZEOF_SHORT)
-#  if (LZO_ARCH_CRAY_PVP)
-#    define LZO_SIZEOF_SHORT        8
-#  elif (USHRT_MAX == LZO_0xffffL)
-#    define LZO_SIZEOF_SHORT        2
-#  elif (__LZO_LSR(USHRT_MAX,7) == 1)
-#    define LZO_SIZEOF_SHORT        1
-#  elif (__LZO_LSR(USHRT_MAX,15) == 1)
-#    define LZO_SIZEOF_SHORT        2
-#  elif (__LZO_LSR(USHRT_MAX,31) == 1)
-#    define LZO_SIZEOF_SHORT        4
-#  elif (__LZO_LSR(USHRT_MAX,63) == 1)
-#    define LZO_SIZEOF_SHORT        8
-#  elif (__LZO_LSR(USHRT_MAX,127) == 1)
-#    define LZO_SIZEOF_SHORT        16
-#  else
-#    error "LZO_SIZEOF_SHORT"
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_INT)
-#  if (LZO_ARCH_CRAY_PVP)
-#    define LZO_SIZEOF_INT          8
-#  elif (UINT_MAX == LZO_0xffffL)
-#    define LZO_SIZEOF_INT          2
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_SIZEOF_INT          4
-#  elif (__LZO_LSR(UINT_MAX,7) == 1)
-#    define LZO_SIZEOF_INT          1
-#  elif (__LZO_LSR(UINT_MAX,15) == 1)
-#    define LZO_SIZEOF_INT          2
-#  elif (__LZO_LSR(UINT_MAX,31) == 1)
-#    define LZO_SIZEOF_INT          4
-#  elif (__LZO_LSR(UINT_MAX,63) == 1)
-#    define LZO_SIZEOF_INT          8
-#  elif (__LZO_LSR(UINT_MAX,127) == 1)
-#    define LZO_SIZEOF_INT          16
-#  else
-#    error "LZO_SIZEOF_INT"
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_LONG)
-#  if (ULONG_MAX == LZO_0xffffffffL)
-#    define LZO_SIZEOF_LONG         4
-#  elif (__LZO_LSR(ULONG_MAX,7) == 1)
-#    define LZO_SIZEOF_LONG         1
-#  elif (__LZO_LSR(ULONG_MAX,15) == 1)
-#    define LZO_SIZEOF_LONG         2
-#  elif (__LZO_LSR(ULONG_MAX,31) == 1)
-#    define LZO_SIZEOF_LONG         4
-#  elif (__LZO_LSR(ULONG_MAX,63) == 1)
-#    define LZO_SIZEOF_LONG         8
-#  elif (__LZO_LSR(ULONG_MAX,127) == 1)
-#    define LZO_SIZEOF_LONG         16
-#  else
-#    error "LZO_SIZEOF_LONG"
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
-#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
-#  if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
-#    if (LZO_CC_GNUC >= 0x030300ul)
-#      if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
-#        define LZO_SIZEOF_LONG_LONG      LZO_SIZEOF_LONG
-#      elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
-#        define LZO_SIZEOF_LONG_LONG      4
-#      endif
-#    endif
-#  endif
-#endif
-#endif
-#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
-#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
-#if (LZO_ARCH_I086 && LZO_CC_DMC)
-#elif (LZO_CC_CILLY) && defined(__GNUC__)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_OS_WIN64 || defined(_WIN64))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_ARCH_I386 && (LZO_CC_DMC))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700)))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__)))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC))
-#  define LZO_SIZEOF___INT64        8
-#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100)))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2)
-#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#  define LZO_SIZEOF_LONG_LONG      8
-#endif
-#endif
-#endif
-#if defined(__cplusplus) && (LZO_CC_GNUC)
-#  if (LZO_CC_GNUC < 0x020800ul)
-#    undef LZO_SIZEOF_LONG_LONG
-#  endif
-#endif
-#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
-#  undef LZO_SIZEOF_LONG_LONG
-#endif
-#if !defined(LZO_SIZEOF_VOID_P)
-#if (LZO_ARCH_I086)
-#  define __LZO_WORDSIZE            2
-#  if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
-#    define LZO_SIZEOF_VOID_P       2
-#  elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
-#    define LZO_SIZEOF_VOID_P       4
-#  else
-#    error "LZO_MM"
-#  endif
-#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
-#  define __LZO_WORDSIZE            1
-#  define LZO_SIZEOF_VOID_P         2
-#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430)
-#  define LZO_SIZEOF_VOID_P         2
-#elif (LZO_ARCH_H8300)
-#  if defined(__NORMAL_MODE__)
-#    define __LZO_WORDSIZE          4
-#    define LZO_SIZEOF_VOID_P       2
-#  elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
-#    define __LZO_WORDSIZE          4
-#    define LZO_SIZEOF_VOID_P       4
-#  else
-#    define __LZO_WORDSIZE          2
-#    define LZO_SIZEOF_VOID_P       2
-#  endif
-#  if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4)
-#    define LZO_SIZEOF_SIZE_T       LZO_SIZEOF_INT
-#    define LZO_SIZEOF_PTRDIFF_T    LZO_SIZEOF_INT
-#  endif
-#elif (LZO_ARCH_M16C)
-#  define __LZO_WORDSIZE            2
-#  if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
-#    define LZO_SIZEOF_VOID_P       4
-#  else
-#    define LZO_SIZEOF_VOID_P       2
-#  endif
-#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
-#  define __LZO_WORDSIZE            8
-#  define LZO_SIZEOF_VOID_P         4
-#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
-#  define __LZO_WORDSIZE            8
-#  define LZO_SIZEOF_VOID_P         8
-#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
-#  define LZO_SIZEOF_VOID_P         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_LONG
-#elif (LZO_OS_OS400 || defined(__OS400__))
-#  define __LZO_WORDSIZE            LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_VOID_P         16
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_LONG
-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
-#  define LZO_SIZEOF_VOID_P         8
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_LONG
-#elif (LZO_ARCH_SPU)
-# if 0
-#  define __LZO_WORDSIZE            16
-# endif
-#  define LZO_SIZEOF_VOID_P         4
-#else
-#  define LZO_SIZEOF_VOID_P         LZO_SIZEOF_LONG
-#endif
-#endif
-#if !defined(LZO_WORDSIZE)
-#  if defined(__LZO_WORDSIZE)
-#    define LZO_WORDSIZE            __LZO_WORDSIZE
-#  else
-#    define LZO_WORDSIZE            LZO_SIZEOF_VOID_P
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_SIZE_T)
-#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
-#  define LZO_SIZEOF_SIZE_T         2
-#else
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_VOID_P
-#endif
-#endif
-#if !defined(LZO_SIZEOF_PTRDIFF_T)
-#if (LZO_ARCH_I086)
-#  if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE)
-#    define LZO_SIZEOF_PTRDIFF_T    LZO_SIZEOF_VOID_P
-#  elif (LZO_MM_COMPACT || LZO_MM_LARGE)
-#    if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
-#      define LZO_SIZEOF_PTRDIFF_T  4
-#    else
-#      define LZO_SIZEOF_PTRDIFF_T  2
-#    endif
-#  else
-#    error "LZO_MM"
-#  endif
-#else
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_SIZE_T
-#endif
-#endif
-#if (LZO_ABI_NEUTRAL_ENDIAN)
-#  undef LZO_ABI_BIG_ENDIAN
-#  undef LZO_ABI_LITTLE_ENDIAN
-#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN)
-#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
-#  if (__LITTLE_ENDIAN__ == 1)
-#    define LZO_ABI_LITTLE_ENDIAN   1
-#  else
-#    define LZO_ABI_BIG_ENDIAN      1
-#  endif
-#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#endif
-#endif
-#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN)
-#  error "this should not happen"
-#endif
-#if (LZO_ABI_BIG_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "be"
-#elif (LZO_ABI_LITTLE_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "le"
-#elif (LZO_ABI_NEUTRAL_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "neutral"
-#endif
-#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
-#  define LZO_ABI_I8LP16         1
-#  define LZO_INFO_ABI_PM       "i8lp16"
-#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
-#  define LZO_ABI_ILP16         1
-#  define LZO_INFO_ABI_PM       "ilp16"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
-#  define LZO_ABI_ILP32         1
-#  define LZO_INFO_ABI_PM       "ilp32"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8)
-#  define LZO_ABI_LLP64         1
-#  define LZO_INFO_ABI_PM       "llp64"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
-#  define LZO_ABI_LP64          1
-#  define LZO_INFO_ABI_PM       "lp64"
-#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
-#  define LZO_ABI_ILP64         1
-#  define LZO_INFO_ABI_PM       "ilp64"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4)
-#  define LZO_ABI_IP32L64       1
-#  define LZO_INFO_ABI_PM       "ip32l64"
-#endif
-#if !defined(__LZO_LIBC_OVERRIDE)
-#if (LZO_LIBC_NAKED)
-#  define LZO_INFO_LIBC         "naked"
-#elif (LZO_LIBC_FREESTANDING)
-#  define LZO_INFO_LIBC         "freestanding"
-#elif (LZO_LIBC_MOSTLY_FREESTANDING)
-#  define LZO_INFO_LIBC         "mfreestanding"
-#elif (LZO_LIBC_ISOC90)
-#  define LZO_INFO_LIBC         "isoc90"
-#elif (LZO_LIBC_ISOC99)
-#  define LZO_INFO_LIBC         "isoc99"
-#elif defined(__dietlibc__)
-#  define LZO_LIBC_DIETLIBC     1
-#  define LZO_INFO_LIBC         "dietlibc"
-#elif defined(_NEWLIB_VERSION)
-#  define LZO_LIBC_NEWLIB       1
-#  define LZO_INFO_LIBC         "newlib"
-#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
-#  if defined(__UCLIBC_SUBLEVEL__)
-#    define LZO_LIBC_UCLIBC     (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
-#  else
-#    define LZO_LIBC_UCLIBC     0x00090bL
-#  endif
-#  define LZO_INFO_LIBC         "uclibc"
-#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
-#  define LZO_LIBC_GLIBC        (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
-#  define LZO_INFO_LIBC         "glibc"
-#elif (LZO_CC_MWERKS) && defined(__MSL__)
-#  define LZO_LIBC_MSL          __MSL__
-#  define LZO_INFO_LIBC         "msl"
-#elif 1 && defined(__IAR_SYSTEMS_ICC__)
-#  define LZO_LIBC_ISOC90       1
-#  define LZO_INFO_LIBC         "isoc90"
-#else
-#  define LZO_LIBC_DEFAULT      1
-#  define LZO_INFO_LIBC         "default"
-#endif
-#endif
-#if !defined(__lzo_gnuc_extension__)
-#if (LZO_CC_GNUC >= 0x020800ul)
-#  define __lzo_gnuc_extension__    __extension__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_gnuc_extension__    __extension__
-#else
-#  define __lzo_gnuc_extension__    /*empty*/
-#endif
-#endif
-#if !defined(__lzo_ua_volatile)
-#  define __lzo_ua_volatile     volatile
-#endif
-#if !defined(__lzo_alignof)
-#if (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
-#  define __lzo_alignof(e)      __alignof__(e)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700))
-#  define __lzo_alignof(e)      __alignof__(e)
-#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
-#  define __lzo_alignof(e)      __alignof(e)
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_alignof(e)      __alignof__(e)
-#endif
-#endif
-#if defined(__lzo_alignof)
-#  define __lzo_HAVE_alignof 1
-#endif
-#if !defined(__lzo_constructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-#  define __lzo_constructor     __attribute__((__constructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-#  define __lzo_constructor     __attribute__((__constructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_constructor     __attribute__((__constructor__))
-#endif
-#endif
-#if defined(__lzo_constructor)
-#  define __lzo_HAVE_constructor 1
-#endif
-#if !defined(__lzo_destructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-#  define __lzo_destructor      __attribute__((__destructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-#  define __lzo_destructor      __attribute__((__destructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_destructor      __attribute__((__destructor__))
-#endif
-#endif
-#if defined(__lzo_destructor)
-#  define __lzo_HAVE_destructor 1
-#endif
-#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
-#  error "this should not happen"
-#endif
-#if !defined(__lzo_inline)
-#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
-#elif defined(__cplusplus)
-#  define __lzo_inline          inline
-#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
-#  define __lzo_inline          __inline
-#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
-#  define __lzo_inline          __inline__
-#elif (LZO_CC_DMC)
-#  define __lzo_inline          __inline
-#elif (LZO_CC_INTELC)
-#  define __lzo_inline          __inline
-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405))
-#  define __lzo_inline          __inline
-#elif (LZO_CC_MSC && (_MSC_VER >= 900))
-#  define __lzo_inline          __inline
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_inline          __inline__
-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#  define __lzo_inline          inline
-#endif
-#endif
-#if defined(__lzo_inline)
-#  define __lzo_HAVE_inline 1
-#else
-#  define __lzo_inline          /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-#if (LZO_CC_GNUC >= 0x030200ul)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-#  define __lzo_forceinline     __forceinline
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-#  define __lzo_forceinline     __forceinline
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#endif
-#endif
-#if defined(__lzo_forceinline)
-#  define __lzo_HAVE_forceinline 1
-#else
-#  define __lzo_forceinline     /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
-#  define __lzo_noinline        __attribute__((__noinline__,__used__))
-#elif (LZO_CC_GNUC >= 0x030200ul)
-#  define __lzo_noinline        __attribute__((__noinline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC)
-#  define __lzo_noinline        __declspec(noinline)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_noinline        __attribute__((__noinline__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_noinline        __attribute__((__noinline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
-#  define __lzo_noinline        __declspec(noinline)
-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64))
-#  if defined(__cplusplus)
-#  else
-#    define __lzo_noinline      __declspec(noinline)
-#  endif
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_noinline        __attribute__((__noinline__))
-#endif
-#endif
-#if defined(__lzo_noinline)
-#  define __lzo_HAVE_noinline 1
-#else
-#  define __lzo_noinline        /*empty*/
-#endif
-#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
-#  error "this should not happen"
-#endif
-#if !defined(__lzo_noreturn)
-#if (LZO_CC_GNUC >= 0x020700ul)
-#  define __lzo_noreturn        __attribute__((__noreturn__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-#  define __lzo_noreturn        __declspec(noreturn)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_noreturn        __attribute__((__noreturn__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_noreturn        __attribute__((__noreturn__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-#  define __lzo_noreturn        __declspec(noreturn)
-#endif
-#endif
-#if defined(__lzo_noreturn)
-#  define __lzo_HAVE_noreturn 1
-#else
-#  define __lzo_noreturn        /*empty*/
-#endif
-#if !defined(__lzo_nothrow)
-#if (LZO_CC_GNUC >= 0x030300ul)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus)
-#  define __lzo_nothrow         __declspec(nothrow)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
-#  define __lzo_nothrow         __declspec(nothrow)
-#endif
-#endif
-#if defined(__lzo_nothrow)
-#  define __lzo_HAVE_nothrow 1
-#else
-#  define __lzo_nothrow         /*empty*/
-#endif
-#if !defined(__lzo_restrict)
-#if (LZO_CC_GNUC >= 0x030400ul)
-#  define __lzo_restrict        __restrict__
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_restrict        __restrict__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM)
-#  define __lzo_restrict        __restrict__
-#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
-#  define __lzo_restrict        __restrict
-#endif
-#endif
-#if defined(__lzo_restrict)
-#  define __lzo_HAVE_restrict 1
-#else
-#  define __lzo_restrict        /*empty*/
-#endif
-#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
-#if (LZO_CC_GNUC >= 0x030200ul)
-#  define __lzo_likely(e)       (__builtin_expect(!!(e),1))
-#  define __lzo_unlikely(e)     (__builtin_expect(!!(e),0))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
-#  define __lzo_likely(e)       (__builtin_expect(!!(e),1))
-#  define __lzo_unlikely(e)     (__builtin_expect(!!(e),0))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_likely(e)       (__builtin_expect(!!(e),1))
-#  define __lzo_unlikely(e)     (__builtin_expect(!!(e),0))
-#endif
-#endif
-#if defined(__lzo_likely)
-#  define __lzo_HAVE_likely 1
-#else
-#  define __lzo_likely(e)       (e)
-#endif
-#if defined(__lzo_unlikely)
-#  define __lzo_HAVE_unlikely 1
-#else
-#  define __lzo_unlikely(e)     (e)
-#endif
-#if !defined(LZO_UNUSED)
-#  if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
-#    define LZO_UNUSED(var)         ((void) &var)
-#  elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC)
-#    define LZO_UNUSED(var)         if (&var) ; else
-#  elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#    define LZO_UNUSED(var)         ((void) var)
-#  elif (LZO_CC_MSC && (_MSC_VER < 900))
-#    define LZO_UNUSED(var)         if (&var) ; else
-#  elif (LZO_CC_KEILC)
-#    define LZO_UNUSED(var)         {extern int __lzo_unused[1-2*!(sizeof(var)>0)];}
-#  elif (LZO_CC_PACIFICC)
-#    define LZO_UNUSED(var)         ((void) sizeof(var))
-#  elif (LZO_CC_WATCOMC) && defined(__cplusplus)
-#    define LZO_UNUSED(var)         ((void) var)
-#  else
-#    define LZO_UNUSED(var)         ((void) &var)
-#  endif
-#endif
-#if !defined(LZO_UNUSED_FUNC)
-#  if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
-#    define LZO_UNUSED_FUNC(func)   ((void) func)
-#  elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC)
-#    define LZO_UNUSED_FUNC(func)   if (func) ; else
-#  elif (LZO_CC_CLANG || LZO_CC_LLVM)
-#    define LZO_UNUSED_FUNC(func)   ((void) &func)
-#  elif (LZO_CC_MSC && (_MSC_VER < 900))
-#    define LZO_UNUSED_FUNC(func)   if (func) ; else
-#  elif (LZO_CC_MSC)
-#    define LZO_UNUSED_FUNC(func)   ((void) &func)
-#  elif (LZO_CC_KEILC || LZO_CC_PELLESC)
-#    define LZO_UNUSED_FUNC(func)   {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];}
-#  else
-#    define LZO_UNUSED_FUNC(func)   ((void) func)
-#  endif
-#endif
-#if !defined(LZO_UNUSED_LABEL)
-#  if (LZO_CC_WATCOMC) && defined(__cplusplus)
-#    define LZO_UNUSED_LABEL(l)     switch(0) case 1:goto l
-#  elif (LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC)
-#    define LZO_UNUSED_LABEL(l)     if (0) goto l
-#  else
-#    define LZO_UNUSED_LABEL(l)     switch(0) case 1:goto l
-#  endif
-#endif
-#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
-#  if 0
-#    define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init)  type var
-#  elif 0 && (LZO_CC_GNUC)
-#    define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init)  type var = var
-#  else
-#    define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init)  type var = init
-#  endif
-#endif
-#if !defined(LZO_UNCONST_CAST)
-#  if 0 && defined(__cplusplus)
-#    define LZO_UNCONST_CAST(t,e)   (const_cast<t> (e))
-#  elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#    define LZO_UNCONST_CAST(t,e)   ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e))))))
-#  else
-#    define LZO_UNCONST_CAST(t,e)   ((t) ((void *) ((char *) ((const void *) (e)))))
-#  endif
-#endif
-#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
-#  if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1-!(e)];
-#  elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1u-2*!(e)];
-#  elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1-!(e)];
-#  else
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1-2*!(e)];
-#  endif
-#endif
-#if !defined(LZO_COMPILE_TIME_ASSERT)
-#  if (LZO_CC_AZTECC)
-#    define LZO_COMPILE_TIME_ASSERT(e)  {typedef int __lzo_cta_t[1-!(e)];}
-#  elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
-#    define LZO_COMPILE_TIME_ASSERT(e)  switch(0) case 1:case !(e):break;
-#  elif (LZO_CC_MSC && (_MSC_VER < 900))
-#    define LZO_COMPILE_TIME_ASSERT(e)  switch(0) case 1:case !(e):break;
-#  elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
-#    define LZO_COMPILE_TIME_ASSERT(e)  switch(0) case 1:case !(e):break;
-#  else
-#    define LZO_COMPILE_TIME_ASSERT(e)  {typedef int __lzo_cta_t[1-2*!(e)];}
-#  endif
-#endif
-#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
-#  if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC)
-#  elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
-#    define __lzo_cdecl                 __cdecl
-#    define __lzo_cdecl_atexit          /*empty*/
-#    define __lzo_cdecl_main            __cdecl
-#    if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
-#      define __lzo_cdecl_qsort         __pascal
-#    elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
-#      define __lzo_cdecl_qsort         _stdcall
-#    else
-#      define __lzo_cdecl_qsort         __cdecl
-#    endif
-#  elif (LZO_CC_WATCOMC)
-#    define __lzo_cdecl                 __cdecl
-#  else
-#    define __lzo_cdecl                 __cdecl
-#    define __lzo_cdecl_atexit          __cdecl
-#    define __lzo_cdecl_main            __cdecl
-#    define __lzo_cdecl_qsort           __cdecl
-#  endif
-#  if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC)
-#  elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
-#    define __lzo_cdecl_sighandler      __pascal
-#  elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
-#    define __lzo_cdecl_sighandler      _stdcall
-#  elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
-#    define __lzo_cdecl_sighandler      __clrcall
-#  elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
-#    if defined(_DLL)
-#      define __lzo_cdecl_sighandler    _far _cdecl _loadds
-#    elif defined(_MT)
-#      define __lzo_cdecl_sighandler    _far _cdecl
-#    else
-#      define __lzo_cdecl_sighandler    _cdecl
-#    endif
-#  else
-#    define __lzo_cdecl_sighandler      __cdecl
-#  endif
-#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC)
-#  define __lzo_cdecl                   __cdecl
-#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
-#  define __lzo_cdecl                   cdecl
-#endif
-#if !defined(__lzo_cdecl)
-#  define __lzo_cdecl                   /*empty*/
-#endif
-#if !defined(__lzo_cdecl_atexit)
-#  define __lzo_cdecl_atexit            /*empty*/
-#endif
-#if !defined(__lzo_cdecl_main)
-#  define __lzo_cdecl_main              /*empty*/
-#endif
-#if !defined(__lzo_cdecl_qsort)
-#  define __lzo_cdecl_qsort             /*empty*/
-#endif
-#if !defined(__lzo_cdecl_sighandler)
-#  define __lzo_cdecl_sighandler        /*empty*/
-#endif
-#if !defined(__lzo_cdecl_va)
-#  define __lzo_cdecl_va                __lzo_cdecl
-#endif
-#if !(LZO_CFG_NO_WINDOWS_H)
-#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64)
-#  if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
-#  elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
-#  elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul)))
-#  else
-#    define LZO_HAVE_WINDOWS_H 1
-#  endif
-#endif
-#endif
-#if (LZO_ARCH_ALPHA)
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#  define LZO_OPT_AVOID_SHORT       1
-#  define LZO_OPT_AVOID_USHORT      1
-#elif (LZO_ARCH_AMD64)
-#  define LZO_OPT_AVOID_INT_INDEX   1
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#  define LZO_OPT_UNALIGNED64       1
-#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB)
-#elif (LZO_ARCH_ARM)
-#  define LZO_OPT_AVOID_SHORT       1
-#  define LZO_OPT_AVOID_USHORT      1
-#elif (LZO_ARCH_CRIS)
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#elif (LZO_ARCH_I386)
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#elif (LZO_ARCH_IA64)
-#  define LZO_OPT_AVOID_INT_INDEX   1
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#  define LZO_OPT_PREFER_POSTINC    1
-#elif (LZO_ARCH_M68K)
-#  define LZO_OPT_PREFER_POSTINC    1
-#  define LZO_OPT_PREFER_PREDEC     1
-#  if defined(__mc68020__) && !defined(__mcoldfire__)
-#    define LZO_OPT_UNALIGNED16     1
-#    define LZO_OPT_UNALIGNED32     1
-#  endif
-#elif (LZO_ARCH_MIPS)
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#elif (LZO_ARCH_POWERPC)
-#  define LZO_OPT_PREFER_PREINC     1
-#  define LZO_OPT_PREFER_PREDEC     1
-#  if (LZO_ABI_BIG_ENDIAN)
-#    define LZO_OPT_UNALIGNED16     1
-#    define LZO_OPT_UNALIGNED32     1
-#  endif
-#elif (LZO_ARCH_S390)
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#  if (LZO_SIZEOF_SIZE_T == 8)
-#    define LZO_OPT_UNALIGNED64     1
-#  endif
-#elif (LZO_ARCH_SH)
-#  define LZO_OPT_PREFER_POSTINC    1
-#  define LZO_OPT_PREFER_PREDEC     1
-#endif
-#ifndef LZO_CFG_NO_INLINE_ASM
-#if (LZO_CC_LLVM)
-#  define LZO_CFG_NO_INLINE_ASM 1
-#endif
-#endif
-#ifndef LZO_CFG_NO_UNALIGNED
-#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
-#  define LZO_CFG_NO_UNALIGNED 1
-#endif
-#endif
-#if (LZO_CFG_NO_UNALIGNED)
-#  undef LZO_OPT_UNALIGNED16
-#  undef LZO_OPT_UNALIGNED32
-#  undef LZO_OPT_UNALIGNED64
-#endif
-#if (LZO_CFG_NO_INLINE_ASM)
-#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
-#  define LZO_ASM_SYNTAX_MSC 1
-#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
-#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul))
-#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
-#  define LZO_ASM_SYNTAX_GNUC 1
-#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
-#  define LZO_ASM_SYNTAX_GNUC 1
-#endif
-#if (LZO_ASM_SYNTAX_GNUC)
-#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
-#  define __LZO_ASM_CLOBBER         "ax"
-#elif (LZO_CC_INTELC)
-#  define __LZO_ASM_CLOBBER         "memory"
-#else
-#  define __LZO_ASM_CLOBBER         "cc", "memory"
-#endif
-#endif
-#if defined(__LZO_INFOSTR_MM)
-#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM))
-#  define __LZO_INFOSTR_MM          ""
-#elif defined(LZO_INFO_MM)
-#  define __LZO_INFOSTR_MM          "." LZO_INFO_MM
-#else
-#  define __LZO_INFOSTR_MM          ""
-#endif
-#if defined(__LZO_INFOSTR_PM)
-#elif defined(LZO_INFO_ABI_PM)
-#  define __LZO_INFOSTR_PM          "." LZO_INFO_ABI_PM
-#else
-#  define __LZO_INFOSTR_PM          ""
-#endif
-#if defined(__LZO_INFOSTR_ENDIAN)
-#elif defined(LZO_INFO_ABI_ENDIAN)
-#  define __LZO_INFOSTR_ENDIAN      "." LZO_INFO_ABI_ENDIAN
-#else
-#  define __LZO_INFOSTR_ENDIAN      ""
-#endif
-#if defined(__LZO_INFOSTR_OSNAME)
-#elif defined(LZO_INFO_OS_CONSOLE)
-#  define __LZO_INFOSTR_OSNAME      LZO_INFO_OS "." LZO_INFO_OS_CONSOLE
-#elif defined(LZO_INFO_OS_POSIX)
-#  define __LZO_INFOSTR_OSNAME      LZO_INFO_OS "." LZO_INFO_OS_POSIX
-#else
-#  define __LZO_INFOSTR_OSNAME      LZO_INFO_OS
-#endif
-#if defined(__LZO_INFOSTR_LIBC)
-#elif defined(LZO_INFO_LIBC)
-#  define __LZO_INFOSTR_LIBC        "." LZO_INFO_LIBC
-#else
-#  define __LZO_INFOSTR_LIBC        ""
-#endif
-#if defined(__LZO_INFOSTR_CCVER)
-#elif defined(LZO_INFO_CCVER)
-#  define __LZO_INFOSTR_CCVER       " " LZO_INFO_CCVER
-#else
-#  define __LZO_INFOSTR_CCVER       ""
-#endif
-#define LZO_INFO_STRING \
-    LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \
-    " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER
-
-#endif /* already included */
-
-/* vim:set ts=4 et: */
diff --git a/ica/x11/common/md5.c b/ica/x11/common/md5.c
deleted file mode 100644
index e185bc1..0000000
--- a/ica/x11/common/md5.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/* Functions to compute MD5 message digest of files or memory blocks.
-   according to the definition of MD5 in RFC 1321 from April 1992.
-   Copyright (C) 1995,1996,1997,1999,2000,2001,2005
-    Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* Written by Ulrich Drepper <drepper at gnu.ai.mit.edu>, 1995.  */
-
-#include <sys/types.h>
-
-# include <stdlib.h>
-# include <string.h>
-
-#include "md5.h"
-
-/* #ifdef _LIBC */
-# include <endian.h>
-# if __BYTE_ORDER == __BIG_ENDIAN
-#  define WORDS_BIGENDIAN 1
-# endif
-/* We need to keep the namespace clean so define the MD5 function
-   protected using leading __ .  */
-# define md5_init_ctx __md5_init_ctx
-# define md5_process_block __md5_process_block
-# define md5_process_bytes __md5_process_bytes
-# define md5_finish_ctx __md5_finish_ctx
-# define md5_read_ctx __md5_read_ctx
-# define md5_stream __md5_stream
-# define md5_buffer __md5_buffer
-/* #endif */
-
-#ifdef WORDS_BIGENDIAN
-# define SWAP(n)                                                        \
-    (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
-#else
-# define SWAP(n) (n)
-#endif
-
-void
-md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx);
-void
-md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx);
-
-/* This array contains the bytes used to pad the buffer to the next
-   64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
-static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
-
-
-/* Initialize structure containing state of computation.
-   (RFC 1321, 3.3: Step 3)  */
-void
-md5_init_ctx (ctx)
-     struct md5_ctx *ctx;
-{
-  ctx->A = 0x67452301;
-  ctx->B = 0xefcdab89;
-  ctx->C = 0x98badcfe;
-  ctx->D = 0x10325476;
-
-  ctx->total[0] = ctx->total[1] = 0;
-  ctx->buflen = 0;
-}
-
-/* Put result from CTX in first 16 bytes following RESBUF.  The result
-   must be in little endian byte order.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-void *
-md5_read_ctx (ctx, resbuf)
-     const struct md5_ctx *ctx;
-     void *resbuf;
-{
-  ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
-  ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
-  ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C);
-  ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D);
-
-  return resbuf;
-}
-
-/* Process the remaining bytes in the internal buffer and the usual
-   prolog according to the standard and write the result to RESBUF.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-void *
-md5_finish_ctx (ctx, resbuf)
-     struct md5_ctx *ctx;
-     void *resbuf;
-{
-  /* Take yet unprocessed bytes into account.  */
-  md5_uint32 bytes = ctx->buflen;
-  size_t pad;
-
-  /* Now count remaining bytes.  */
-  ctx->total[0] += bytes;
-  if (ctx->total[0] < bytes)
-    ++ctx->total[1];
-
-  pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
-  memcpy (&ctx->buffer[bytes], fillbuf, pad);
-
-  /* Put the 64-bit file length in *bits* at the end of the buffer.  */
-  *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
-  *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
-                            (ctx->total[0] >> 29));
-
-  /* Process last bytes.  */
-  md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
-
-  return md5_read_ctx (ctx, resbuf);
-}
-
-/* Compute MD5 message digest for bytes read from STREAM.  The
-   resulting message digest number will be written into the 16 bytes
-   beginning at RESBLOCK.  */
-int
-md5_stream (stream, resblock)
-     FILE *stream;
-     void *resblock;
-{
-  /* Important: BLOCKSIZE must be a multiple of 64.  */
-#define BLOCKSIZE 4096
-  struct md5_ctx ctx;
-  char buffer[BLOCKSIZE + 72];
-  size_t sum;
-
-  /* Initialize the computation context.  */
-  md5_init_ctx (&ctx);
-
-  /* Iterate over full file contents.  */
-  while (1)
-    {
-      /* We read the file in blocks of BLOCKSIZE bytes.  One call of the
-     computation function processes the whole buffer so that with the
-     next round of the loop another block can be read.  */
-      size_t n;
-      sum = 0;
-
-      /* Read block.  Take care for partial reads.  */
-      do
-    {
-      n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
-
-      sum += n;
-    }
-      while (sum < BLOCKSIZE && n != 0);
-      if (n == 0 && ferror (stream))
-        return 1;
-
-      /* If end of file is reached, end the loop.  */
-      if (n == 0)
-    break;
-
-      /* Process buffer with BLOCKSIZE bytes.  Note that
-            BLOCKSIZE % 64 == 0
-       */
-      md5_process_block (buffer, BLOCKSIZE, &ctx);
-    }
-
-  /* Add the last bytes if necessary.  */
-  if (sum > 0)
-    md5_process_bytes (buffer, sum, &ctx);
-
-  /* Construct result in desired memory.  */
-  md5_finish_ctx (&ctx, resblock);
-  return 0;
-}
-
-/* Compute MD5 message digest for LEN bytes beginning at BUFFER.  The
-   result is always in little endian byte order, so that a byte-wise
-   output yields to the wanted ASCII representation of the message
-   digest.  */
-void *
-md5_buffer (buffer, len, resblock)
-     const char *buffer;
-     size_t len;
-     void *resblock;
-{
-  struct md5_ctx ctx;
-
-  /* Initialize the computation context.  */
-  md5_init_ctx (&ctx);
-
-  /* Process whole buffer but last len % 64 bytes.  */
-  md5_process_bytes (buffer, len, &ctx);
-
-  /* Put result in desired memory area.  */
-  return md5_finish_ctx (&ctx, resblock);
-}
-
-
-void
-md5_process_bytes (buffer, len, ctx)
-     const void *buffer;
-     size_t len;
-     struct md5_ctx *ctx;
-{
-  /* When we already have some bits in our internal buffer concatenate
-     both inputs first.  */
-  if (ctx->buflen != 0)
-    {
-      size_t left_over = ctx->buflen;
-      size_t add = 128 - left_over > len ? len : 128 - left_over;
-
-      memcpy (&ctx->buffer[left_over], buffer, add);
-      ctx->buflen += add;
-
-      if (ctx->buflen > 64)
-    {
-      md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
-
-      ctx->buflen &= 63;
-      /* The regions in the following copy operation cannot overlap.  */
-      memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
-          ctx->buflen);
-    }
-
-      buffer = (const char *) buffer + add;
-      len -= add;
-    }
-
-  /* Process available complete blocks.  */
-  if (len >= 64)
-    {
-#if !_STRING_ARCH_unaligned
-/* To check alignment gcc has an appropriate operator.  Other
-   compilers don't.  */
-# if __GNUC__ >= 2
-#  define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0)
-# else
-#  define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0)
-# endif
-      if (UNALIGNED_P (buffer))
-    while (len > 64)
-      {
-        md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
-        buffer = (const char *) buffer + 64;
-        len -= 64;
-      }
-      else
-#endif
-    {
-      md5_process_block (buffer, len & ~63, ctx);
-      buffer = (const char *) buffer + (len & ~63);
-      len &= 63;
-    }
-    }
-
-  /* Move remaining bytes in internal buffer.  */
-  if (len > 0)
-    {
-      size_t left_over = ctx->buflen;
-
-      memcpy (&ctx->buffer[left_over], buffer, len);
-      left_over += len;
-      if (left_over >= 64)
-    {
-      md5_process_block (ctx->buffer, 64, ctx);
-      left_over -= 64;
-      memcpy (ctx->buffer, &ctx->buffer[64], left_over);
-    }
-      ctx->buflen = left_over;
-    }
-}
-
-
-/* These are the four functions used in the four steps of the MD5 algorithm
-   and defined in the RFC 1321.  The first function is a little bit optimized
-   (as found in Colin Plumbs public domain implementation).  */
-/* #define FF(b, c, d) ((b & c) | (~b & d)) */
-#define FF(b, c, d) (d ^ (b & (c ^ d)))
-#define FG(b, c, d) FF (d, b, c)
-#define FH(b, c, d) (b ^ c ^ d)
-#define FI(b, c, d) (c ^ (b | ~d))
-
-/* Process LEN bytes of BUFFER, accumulating context into CTX.
-   It is assumed that LEN % 64 == 0.  */
-
-void
-md5_process_block (buffer, len, ctx)
-     const void *buffer;
-     size_t len;
-     struct md5_ctx *ctx;
-{
-  md5_uint32 correct_words[16];
-  const md5_uint32 *words = buffer;
-  size_t nwords = len / sizeof (md5_uint32);
-  const md5_uint32 *endp = words + nwords;
-  md5_uint32 A = ctx->A;
-  md5_uint32 B = ctx->B;
-  md5_uint32 C = ctx->C;
-  md5_uint32 D = ctx->D;
-
-  /* First increment the byte count.  RFC 1321 specifies the possible
-     length of the file up to 2^64 bits.  Here we only compute the
-     number of bytes.  Do a double word increment.  */
-  ctx->total[0] += len;
-  if (ctx->total[0] < len)
-    ++ctx->total[1];
-
-  /* Process all bytes in the buffer with 64 bytes in each round of
-     the loop.  */
-  while (words < endp)
-    {
-      md5_uint32 *cwp = correct_words;
-      md5_uint32 A_save = A;
-      md5_uint32 B_save = B;
-      md5_uint32 C_save = C;
-      md5_uint32 D_save = D;
-
-      /* First round: using the given function, the context and a constant
-     the next context is computed.  Because the algorithms processing
-     unit is a 32-bit word and it is determined to work on words in
-     little endian byte order we perhaps have to change the byte order
-     before the computation.  To reduce the work for the next steps
-     we store the swapped words in the array CORRECT_WORDS.  */
-
-#define OP(a, b, c, d, s, T)                                            \
-      do                                                                \
-        {                                                               \
-      a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T;         \
-      ++words;                                                  \
-      CYCLIC (a, s);                                            \
-      a += b;                                                   \
-        }                                                               \
-      while (0)
-
-      /* It is unfortunate that C does not provide an operator for
-     cyclic rotation.  Hope the C compiler is smart enough.  */
-#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
-
-      /* Before we start, one word to the strange constants.
-     They are defined in RFC 1321 as
-
-     T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
-       */
-
-      /* Round 1.  */
-      OP (A, B, C, D,  7, 0xd76aa478);
-      OP (D, A, B, C, 12, 0xe8c7b756);
-      OP (C, D, A, B, 17, 0x242070db);
-      OP (B, C, D, A, 22, 0xc1bdceee);
-      OP (A, B, C, D,  7, 0xf57c0faf);
-      OP (D, A, B, C, 12, 0x4787c62a);
-      OP (C, D, A, B, 17, 0xa8304613);
-      OP (B, C, D, A, 22, 0xfd469501);
-      OP (A, B, C, D,  7, 0x698098d8);
-      OP (D, A, B, C, 12, 0x8b44f7af);
-      OP (C, D, A, B, 17, 0xffff5bb1);
-      OP (B, C, D, A, 22, 0x895cd7be);
-      OP (A, B, C, D,  7, 0x6b901122);
-      OP (D, A, B, C, 12, 0xfd987193);
-      OP (C, D, A, B, 17, 0xa679438e);
-      OP (B, C, D, A, 22, 0x49b40821);
-
-      /* For the second to fourth round we have the possibly swapped words
-     in CORRECT_WORDS.  Redefine the macro to take an additional first
-     argument specifying the function to use.  */
-#undef OP
-#define OP(f, a, b, c, d, k, s, T)                                      \
-      do                                                                \
-    {                                                           \
-      a += f (b, c, d) + correct_words[k] + T;                  \
-      CYCLIC (a, s);                                            \
-      a += b;                                                   \
-    }                                                           \
-      while (0)
-
-      /* Round 2.  */
-      OP (FG, A, B, C, D,  1,  5, 0xf61e2562);
-      OP (FG, D, A, B, C,  6,  9, 0xc040b340);
-      OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
-      OP (FG, B, C, D, A,  0, 20, 0xe9b6c7aa);
-      OP (FG, A, B, C, D,  5,  5, 0xd62f105d);
-      OP (FG, D, A, B, C, 10,  9, 0x02441453);
-      OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
-      OP (FG, B, C, D, A,  4, 20, 0xe7d3fbc8);
-      OP (FG, A, B, C, D,  9,  5, 0x21e1cde6);
-      OP (FG, D, A, B, C, 14,  9, 0xc33707d6);
-      OP (FG, C, D, A, B,  3, 14, 0xf4d50d87);
-      OP (FG, B, C, D, A,  8, 20, 0x455a14ed);
-      OP (FG, A, B, C, D, 13,  5, 0xa9e3e905);
-      OP (FG, D, A, B, C,  2,  9, 0xfcefa3f8);
-      OP (FG, C, D, A, B,  7, 14, 0x676f02d9);
-      OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
-
-      /* Round 3.  */
-      OP (FH, A, B, C, D,  5,  4, 0xfffa3942);
-      OP (FH, D, A, B, C,  8, 11, 0x8771f681);
-      OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
-      OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
-      OP (FH, A, B, C, D,  1,  4, 0xa4beea44);
-      OP (FH, D, A, B, C,  4, 11, 0x4bdecfa9);
-      OP (FH, C, D, A, B,  7, 16, 0xf6bb4b60);
-      OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
-      OP (FH, A, B, C, D, 13,  4, 0x289b7ec6);
-      OP (FH, D, A, B, C,  0, 11, 0xeaa127fa);
-      OP (FH, C, D, A, B,  3, 16, 0xd4ef3085);
-      OP (FH, B, C, D, A,  6, 23, 0x04881d05);
-      OP (FH, A, B, C, D,  9,  4, 0xd9d4d039);
-      OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
-      OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
-      OP (FH, B, C, D, A,  2, 23, 0xc4ac5665);
-
-      /* Round 4.  */
-      OP (FI, A, B, C, D,  0,  6, 0xf4292244);
-      OP (FI, D, A, B, C,  7, 10, 0x432aff97);
-      OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
-      OP (FI, B, C, D, A,  5, 21, 0xfc93a039);
-      OP (FI, A, B, C, D, 12,  6, 0x655b59c3);
-      OP (FI, D, A, B, C,  3, 10, 0x8f0ccc92);
-      OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
-      OP (FI, B, C, D, A,  1, 21, 0x85845dd1);
-      OP (FI, A, B, C, D,  8,  6, 0x6fa87e4f);
-      OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
-      OP (FI, C, D, A, B,  6, 15, 0xa3014314);
-      OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
-      OP (FI, A, B, C, D,  4,  6, 0xf7537e82);
-      OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
-      OP (FI, C, D, A, B,  2, 15, 0x2ad7d2bb);
-      OP (FI, B, C, D, A,  9, 21, 0xeb86d391);
-
-      /* Add the starting values of the context.  */
-      A += A_save;
-      B += B_save;
-      C += C_save;
-      D += D_save;
-    }
-
-  /* Put checksum in context given as argument.  */
-  ctx->A = A;
-  ctx->B = B;
-  ctx->C = C;
-  ctx->D = D;
-}
diff --git a/ica/x11/common/md5.h b/ica/x11/common/md5.h
deleted file mode 100644
index b48545b..0000000
--- a/ica/x11/common/md5.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Declaration of functions and data types used for MD5 sum computing
-   library functions.
-   Copyright (C) 1995-1997,1999,2000,2001,2004,2005
-      Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef _MD5_H
-#define _MD5_H 1
-
-#include <stdio.h>
-
-#if defined HAVE_LIMITS_H || _LIBC
-# include <limits.h>
-#endif
-
-#define MD5_DIGEST_SIZE 16
-#define MD5_BLOCK_SIZE 64
-
-/* The following contortions are an attempt to use the C preprocessor
-   to determine an unsigned integral type that is 32 bits wide.  An
-   alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
-   doing that would require that the configure script compile and *run*
-   the resulting executable.  Locally running cross-compiled executables
-   is usually not possible.  */
-
-#ifdef _LIBC
-# include <stdint.h>
-typedef uint32_t md5_uint32;
-typedef uintptr_t md5_uintptr;
-#else
-# if defined __STDC__ && __STDC__
-#  define UINT_MAX_32_BITS 4294967295U
-# else
-#  define UINT_MAX_32_BITS 0xFFFFFFFF
-# endif
-
-/* If UINT_MAX isn't defined, assume it's a 32-bit type.
-   This should be valid for all systems GNU cares about because
-   that doesn't include 16-bit systems, and only modern systems
-   (that certainly have <limits.h>) have 64+-bit integral types.  */
-
-# ifndef UINT_MAX
-#  define UINT_MAX UINT_MAX_32_BITS
-# endif
-
-# if UINT_MAX == UINT_MAX_32_BITS
-   typedef unsigned int md5_uint32;
-# else
-#  if USHRT_MAX == UINT_MAX_32_BITS
-    typedef unsigned short md5_uint32;
-#  else
-#   if ULONG_MAX == UINT_MAX_32_BITS
-     typedef unsigned long md5_uint32;
-#   else
-     /* The following line is intended to evoke an error.
-        Using #error is not portable enough.  */
-     "Cannot determine unsigned 32-bit data type."
-#   endif
-#  endif
-# endif
-/* We have to make a guess about the integer type equivalent in size
-   to pointers which should always be correct.  */
-typedef unsigned long int md5_uintptr;
-#endif
-
-/* Structure to save state of computation between the single steps.  */
-struct md5_ctx
-{
-  md5_uint32 A;
-  md5_uint32 B;
-  md5_uint32 C;
-  md5_uint32 D;
-
-  md5_uint32 total[2];
-  md5_uint32 buflen;
-  char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
-};
-
-/*
- * The following three functions are build up the low level used in
- * the functions `md5_stream' and `md5_buffer'.
- */
-
-/* Initialize structure containing state of computation.
-   (RFC 1321, 3.3: Step 3)  */
-extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW;
-
-/* Starting with the result of former calls of this function (or the
-   initialization function update the context for the next LEN bytes
-   starting at BUFFER.
-   It is necessary that LEN is a multiple of 64!!! */
-extern void __md5_process_block (const void *buffer, size_t len,
-                 struct md5_ctx *ctx) __THROW;
-
-/* Starting with the result of former calls of this function (or the
-   initialization function update the context for the next LEN bytes
-   starting at BUFFER.
-   It is NOT required that LEN is a multiple of 64.  */
-extern void __md5_process_bytes (const void *buffer, size_t len,
-                 struct md5_ctx *ctx) __THROW;
-
-/* Process the remaining bytes in the buffer and put result from CTX
-   in first 16 bytes following RESBUF.  The result is always in little
-   endian byte order, so that a byte-wise output yields to the wanted
-   ASCII representation of the message digest.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
-
-
-/* Put result from CTX in first 16 bytes following RESBUF.  The result is
-   always in little endian byte order, so that a byte-wise output yields
-   to the wanted ASCII representation of the message digest.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
-
-
-/* Compute MD5 message digest for bytes read from STREAM.  The
-   resulting message digest number will be written into the 16 bytes
-   beginning at RESBLOCK.  */
-extern int __md5_stream (FILE *stream, void *resblock) __THROW;
-
-/* Compute MD5 message digest for LEN bytes beginning at BUFFER.  The
-   result is always in little endian byte order, so that a byte-wise
-   output yields to the wanted ASCII representation of the message
-   digest.  */
-extern void *__md5_buffer (const char *buffer, size_t len,
-               void *resblock) __THROW;
-
-#endif /* md5.h */
diff --git a/ica/x11/common/minilzo.c b/ica/x11/common/minilzo.c
deleted file mode 100644
index 34ce0f0..0000000
--- a/ica/x11/common/minilzo.c
+++ /dev/null
@@ -1,4579 +0,0 @@
-/* minilzo.c -- mini subset of the LZO real-time data compression library
-
-   This file is part of the LZO real-time data compression library.
-
-   Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
-   All Rights Reserved.
-
-   The LZO library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   The LZO library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with the LZO library; see the file COPYING.
-   If not, write to the Free Software Foundation, Inc.,
-   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-   Markus F.X.J. Oberhumer
-   <markus at oberhumer.com>
-   http://www.oberhumer.com/opensource/lzo/
- */
-
-/*
- * NOTE:
- *   the full LZO package can be found at
- *   http://www.oberhumer.com/opensource/lzo/
- */
-
-#define __LZO_IN_MINILZO 1
-
-#if defined(LZO_CFG_FREESTANDING)
-#  undef MINILZO_HAVE_CONFIG_H
-#  define LZO_LIBC_FREESTANDING 1
-#  define LZO_OS_FREESTANDING 1
-#endif
-
-#ifdef MINILZO_HAVE_CONFIG_H
-#  include <config.h>
-#endif
-#include <limits.h>
-#include <stddef.h>
-#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS)
-
-#ifndef __LZODEFS_H_INCLUDED
-#define __LZODEFS_H_INCLUDED 1
-
-#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
-#  define __CYGWIN__ __CYGWIN32__
-#endif
-#if defined(__IBMCPP__) && !defined(__IBMC__)
-#  define __IBMC__ __IBMCPP__
-#endif
-#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
-#  define __INTEL_COMPILER __ICL
-#endif
-#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
-#  define _ALL_SOURCE 1
-#endif
-#if defined(__mips__) && defined(__R5900__)
-#  if !defined(__LONG_MAX__)
-#    define __LONG_MAX__ 9223372036854775807L
-#  endif
-#endif
-#if defined(__INTEL_COMPILER) && defined(__linux__)
-#  pragma warning(disable: 193)
-#endif
-#if defined(__KEIL__) && defined(__C166__)
-#  pragma warning disable = 322
-#elif 0 && defined(__C251__)
-#  pragma warning disable = 322
-#endif
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
-#  if (_MSC_VER >= 1300)
-#    pragma warning(disable: 4668)
-#  endif
-#endif
-#if 0 && defined(__WATCOMC__)
-#  if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
-#    pragma warning 203 9
-#  endif
-#endif
-#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
-#  pragma option -h
-#endif
-#if 0
-#define LZO_0xffffL             0xfffful
-#define LZO_0xffffffffL         0xfffffffful
-#else
-#define LZO_0xffffL             65535ul
-#define LZO_0xffffffffL         4294967295ul
-#endif
-#if (LZO_0xffffL == LZO_0xffffffffL)
-#  error "your preprocessor is broken 1"
-#endif
-#if (16ul * 16384ul != 262144ul)
-#  error "your preprocessor is broken 2"
-#endif
-#if 0
-#if (32767 >= 4294967295ul)
-#  error "your preprocessor is broken 3"
-#endif
-#if (65535u >= 4294967295ul)
-#  error "your preprocessor is broken 4"
-#endif
-#endif
-#if (UINT_MAX == LZO_0xffffL)
-#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
-#  if !defined(MSDOS)
-#    define MSDOS 1
-#  endif
-#  if !defined(_MSDOS)
-#    define _MSDOS 1
-#  endif
-#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
-#  if (__VERSION == 520) && (MB_LEN_MAX == 1)
-#    if !defined(__AZTEC_C__)
-#      define __AZTEC_C__ __VERSION
-#    endif
-#    if !defined(__DOS__)
-#      define __DOS__ 1
-#    endif
-#  endif
-#endif
-#endif
-#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL)
-#  define ptrdiff_t long
-#  define _PTRDIFF_T_DEFINED 1
-#endif
-#if (UINT_MAX == LZO_0xffffL)
-#  undef __LZO_RENAME_A
-#  undef __LZO_RENAME_B
-#  if defined(__AZTEC_C__) && defined(__DOS__)
-#    define __LZO_RENAME_A 1
-#  elif defined(_MSC_VER) && defined(MSDOS)
-#    if (_MSC_VER < 600)
-#      define __LZO_RENAME_A 1
-#    elif (_MSC_VER < 700)
-#      define __LZO_RENAME_B 1
-#    endif
-#  elif defined(__TSC__) && defined(__OS2__)
-#    define __LZO_RENAME_A 1
-#  elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
-#    define __LZO_RENAME_A 1
-#  elif defined(__PACIFIC__) && defined(DOS)
-#    if !defined(__far)
-#      define __far far
-#    endif
-#    if !defined(__near)
-#      define __near near
-#    endif
-#  endif
-#  if defined(__LZO_RENAME_A)
-#    if !defined(__cdecl)
-#      define __cdecl cdecl
-#    endif
-#    if !defined(__far)
-#      define __far far
-#    endif
-#    if !defined(__huge)
-#      define __huge huge
-#    endif
-#    if !defined(__near)
-#      define __near near
-#    endif
-#    if !defined(__pascal)
-#      define __pascal pascal
-#    endif
-#    if !defined(__huge)
-#      define __huge huge
-#    endif
-#  elif defined(__LZO_RENAME_B)
-#    if !defined(__cdecl)
-#      define __cdecl _cdecl
-#    endif
-#    if !defined(__far)
-#      define __far _far
-#    endif
-#    if !defined(__huge)
-#      define __huge _huge
-#    endif
-#    if !defined(__near)
-#      define __near _near
-#    endif
-#    if !defined(__pascal)
-#      define __pascal _pascal
-#    endif
-#  elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
-#    if !defined(__cdecl)
-#      define __cdecl cdecl
-#    endif
-#    if !defined(__pascal)
-#      define __pascal pascal
-#    endif
-#  endif
-#  undef __LZO_RENAME_A
-#  undef __LZO_RENAME_B
-#endif
-#if (UINT_MAX == LZO_0xffffL)
-#if defined(__AZTEC_C__) && defined(__DOS__)
-#  define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#elif defined(_MSC_VER) && defined(MSDOS)
-#  if (_MSC_VER < 600)
-#    define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#  endif
-#  if (_MSC_VER < 700)
-#    define LZO_BROKEN_INTEGRAL_PROMOTION 1
-#    define LZO_BROKEN_SIZEOF 1
-#  endif
-#elif defined(__PACIFIC__) && defined(DOS)
-#  define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#elif defined(__TURBOC__) && defined(__MSDOS__)
-#  if (__TURBOC__ < 0x0150)
-#    define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#    define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#    define LZO_BROKEN_INTEGRAL_PROMOTION 1
-#  endif
-#  if (__TURBOC__ < 0x0200)
-#    define LZO_BROKEN_SIZEOF 1
-#  endif
-#  if (__TURBOC__ < 0x0400) && defined(__cplusplus)
-#    define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#  endif
-#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
-#  define LZO_BROKEN_CDECL_ALT_SYNTAX 1
-#  define LZO_BROKEN_SIZEOF 1
-#endif
-#endif
-#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
-#  define LZO_BROKEN_INTEGRAL_CONSTANTS 1
-#endif
-#if defined(_CRAY) && defined(_CRAY1)
-#  define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1
-#endif
-#define LZO_PP_STRINGIZE(x)             #x
-#define LZO_PP_MACRO_EXPAND(x)          LZO_PP_STRINGIZE(x)
-#define LZO_PP_CONCAT2(a,b)             a ## b
-#define LZO_PP_CONCAT3(a,b,c)           a ## b ## c
-#define LZO_PP_CONCAT4(a,b,c,d)         a ## b ## c ## d
-#define LZO_PP_CONCAT5(a,b,c,d,e)       a ## b ## c ## d ## e
-#define LZO_PP_ECONCAT2(a,b)            LZO_PP_CONCAT2(a,b)
-#define LZO_PP_ECONCAT3(a,b,c)          LZO_PP_CONCAT3(a,b,c)
-#define LZO_PP_ECONCAT4(a,b,c,d)        LZO_PP_CONCAT4(a,b,c,d)
-#define LZO_PP_ECONCAT5(a,b,c,d,e)      LZO_PP_CONCAT5(a,b,c,d,e)
-#if 1
-#define LZO_CPP_STRINGIZE(x)            #x
-#define LZO_CPP_MACRO_EXPAND(x)         LZO_CPP_STRINGIZE(x)
-#define LZO_CPP_CONCAT2(a,b)            a ## b
-#define LZO_CPP_CONCAT3(a,b,c)          a ## b ## c
-#define LZO_CPP_CONCAT4(a,b,c,d)        a ## b ## c ## d
-#define LZO_CPP_CONCAT5(a,b,c,d,e)      a ## b ## c ## d ## e
-#define LZO_CPP_ECONCAT2(a,b)           LZO_CPP_CONCAT2(a,b)
-#define LZO_CPP_ECONCAT3(a,b,c)         LZO_CPP_CONCAT3(a,b,c)
-#define LZO_CPP_ECONCAT4(a,b,c,d)       LZO_CPP_CONCAT4(a,b,c,d)
-#define LZO_CPP_ECONCAT5(a,b,c,d,e)     LZO_CPP_CONCAT5(a,b,c,d,e)
-#endif
-#define __LZO_MASK_GEN(o,b)     (((((o) << ((b)-1)) - (o)) << 1) + (o))
-#if 1 && defined(__cplusplus)
-#  if !defined(__STDC_CONSTANT_MACROS)
-#    define __STDC_CONSTANT_MACROS 1
-#  endif
-#  if !defined(__STDC_LIMIT_MACROS)
-#    define __STDC_LIMIT_MACROS 1
-#  endif
-#endif
-#if defined(__cplusplus)
-#  define LZO_EXTERN_C extern "C"
-#else
-#  define LZO_EXTERN_C extern
-#endif
-#if !defined(__LZO_OS_OVERRIDE)
-#if (LZO_OS_FREESTANDING)
-#  define LZO_INFO_OS           "freestanding"
-#elif (LZO_OS_EMBEDDED)
-#  define LZO_INFO_OS           "embedded"
-#elif 1 && defined(__IAR_SYSTEMS_ICC__)
-#  define LZO_OS_EMBEDDED       1
-#  define LZO_INFO_OS           "embedded"
-#elif defined(__CYGWIN__) && defined(__GNUC__)
-#  define LZO_OS_CYGWIN         1
-#  define LZO_INFO_OS           "cygwin"
-#elif defined(__EMX__) && defined(__GNUC__)
-#  define LZO_OS_EMX            1
-#  define LZO_INFO_OS           "emx"
-#elif defined(__BEOS__)
-#  define LZO_OS_BEOS           1
-#  define LZO_INFO_OS           "beos"
-#elif defined(__Lynx__)
-#  define LZO_OS_LYNXOS         1
-#  define LZO_INFO_OS           "lynxos"
-#elif defined(__OS400__)
-#  define LZO_OS_OS400          1
-#  define LZO_INFO_OS           "os400"
-#elif defined(__QNX__)
-#  define LZO_OS_QNX            1
-#  define LZO_INFO_OS           "qnx"
-#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
-#  define LZO_OS_DOS32          1
-#  define LZO_INFO_OS           "dos32"
-#elif defined(__BORLANDC__) && defined(__DPMI16__)
-#  define LZO_OS_DOS16          1
-#  define LZO_INFO_OS           "dos16"
-#elif defined(__ZTC__) && defined(DOS386)
-#  define LZO_OS_DOS32          1
-#  define LZO_INFO_OS           "dos32"
-#elif defined(__OS2__) || defined(__OS2V2__)
-#  if (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_OS216        1
-#    define LZO_INFO_OS         "os216"
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_OS_OS2          1
-#    define LZO_INFO_OS         "os2"
-#  else
-#    error "check your limits.h header"
-#  endif
-#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
-#  define LZO_OS_WIN64          1
-#  define LZO_INFO_OS           "win64"
-#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
-#  define LZO_OS_WIN32          1
-#  define LZO_INFO_OS           "win32"
-#elif defined(__MWERKS__) && defined(__INTEL__)
-#  define LZO_OS_WIN32          1
-#  define LZO_INFO_OS           "win32"
-#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
-#  if (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_WIN16        1
-#    define LZO_INFO_OS         "win16"
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_OS_WIN32        1
-#    define LZO_INFO_OS         "win32"
-#  else
-#    error "check your limits.h header"
-#  endif
-#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
-#  if (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_DOS16        1
-#    define LZO_INFO_OS         "dos16"
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_OS_DOS32        1
-#    define LZO_INFO_OS         "dos32"
-#  else
-#    error "check your limits.h header"
-#  endif
-#elif defined(__WATCOMC__)
-#  if defined(__NT__) && (UINT_MAX == LZO_0xffffL)
-#    define LZO_OS_DOS16        1
-#    define LZO_INFO_OS         "dos16"
-#  elif defined(__NT__) && (__WATCOMC__ < 1100)
-#    define LZO_OS_WIN32        1
-#    define LZO_INFO_OS         "win32"
-#  elif defined(__linux__) || defined(__LINUX__)
-#    define LZO_OS_POSIX        1
-#    define LZO_INFO_OS         "posix"
-#  else
-#    error "please specify a target using the -bt compiler option"
-#  endif
-#elif defined(__palmos__)
-#  define LZO_OS_PALMOS         1
-#  define LZO_INFO_OS           "palmos"
-#elif defined(__TOS__) || defined(__atarist__)
-#  define LZO_OS_TOS            1
-#  define LZO_INFO_OS           "tos"
-#elif defined(macintosh) && !defined(__ppc__)
-#  define LZO_OS_MACCLASSIC     1
-#  define LZO_INFO_OS           "macclassic"
-#elif defined(__VMS)
-#  define LZO_OS_VMS            1
-#  define LZO_INFO_OS           "vms"
-#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
-#  define LZO_OS_CONSOLE        1
-#  define LZO_OS_CONSOLE_PS2    1
-#  define LZO_INFO_OS           "console"
-#  define LZO_INFO_OS_CONSOLE   "ps2"
-#elif (defined(__mips__) && defined(__psp__))
-#  define LZO_OS_CONSOLE        1
-#  define LZO_OS_CONSOLE_PSP    1
-#  define LZO_INFO_OS           "console"
-#  define LZO_INFO_OS_CONSOLE   "psp"
-#else
-#  define LZO_OS_POSIX          1
-#  define LZO_INFO_OS           "posix"
-#endif
-#if (LZO_OS_POSIX)
-#  if defined(_AIX) || defined(__AIX__) || defined(__aix__)
-#    define LZO_OS_POSIX_AIX        1
-#    define LZO_INFO_OS_POSIX       "aix"
-#  elif defined(__FreeBSD__)
-#    define LZO_OS_POSIX_FREEBSD    1
-#    define LZO_INFO_OS_POSIX       "freebsd"
-#  elif defined(__hpux__) || defined(__hpux)
-#    define LZO_OS_POSIX_HPUX       1
-#    define LZO_INFO_OS_POSIX       "hpux"
-#  elif defined(__INTERIX)
-#    define LZO_OS_POSIX_INTERIX    1
-#    define LZO_INFO_OS_POSIX       "interix"
-#  elif defined(__IRIX__) || defined(__irix__)
-#    define LZO_OS_POSIX_IRIX       1
-#    define LZO_INFO_OS_POSIX       "irix"
-#  elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
-#    define LZO_OS_POSIX_LINUX      1
-#    define LZO_INFO_OS_POSIX       "linux"
-#  elif defined(__APPLE__) || defined(__MACOS__)
-#    define LZO_OS_POSIX_MACOSX     1
-#    define LZO_INFO_OS_POSIX       "macosx"
-#  elif defined(__minix__) || defined(__minix)
-#    define LZO_OS_POSIX_MINIX      1
-#    define LZO_INFO_OS_POSIX       "minix"
-#  elif defined(__NetBSD__)
-#    define LZO_OS_POSIX_NETBSD     1
-#    define LZO_INFO_OS_POSIX       "netbsd"
-#  elif defined(__OpenBSD__)
-#    define LZO_OS_POSIX_OPENBSD    1
-#    define LZO_INFO_OS_POSIX       "openbsd"
-#  elif defined(__osf__)
-#    define LZO_OS_POSIX_OSF        1
-#    define LZO_INFO_OS_POSIX       "osf"
-#  elif defined(__solaris__) || defined(__sun)
-#    if defined(__SVR4) || defined(__svr4__)
-#      define LZO_OS_POSIX_SOLARIS  1
-#      define LZO_INFO_OS_POSIX     "solaris"
-#    else
-#      define LZO_OS_POSIX_SUNOS    1
-#      define LZO_INFO_OS_POSIX     "sunos"
-#    endif
-#  elif defined(__ultrix__) || defined(__ultrix)
-#    define LZO_OS_POSIX_ULTRIX     1
-#    define LZO_INFO_OS_POSIX       "ultrix"
-#  elif defined(_UNICOS)
-#    define LZO_OS_POSIX_UNICOS     1
-#    define LZO_INFO_OS_POSIX       "unicos"
-#  else
-#    define LZO_OS_POSIX_UNKNOWN    1
-#    define LZO_INFO_OS_POSIX       "unknown"
-#  endif
-#endif
-#endif
-#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#  if (UINT_MAX != LZO_0xffffL)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
-#  if (UINT_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
-#  define LZO_CC_CILLY          1
-#  define LZO_INFO_CC           "Cilly"
-#  if defined(__CILLY__)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__CILLY__)
-#  else
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
-#  define LZO_CC_SDCC           1
-#  define LZO_INFO_CC           "sdcc"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(SDCC)
-#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
-#  define LZO_CC_PATHSCALE      (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
-#  define LZO_INFO_CC           "Pathscale C"
-#  define LZO_INFO_CCVER        __PATHSCALE__
-#elif defined(__INTEL_COMPILER)
-#  define LZO_CC_INTELC         1
-#  define LZO_INFO_CC           "Intel C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
-#  if defined(_WIN32) || defined(_WIN64)
-#    define LZO_CC_SYNTAX_MSC 1
-#  else
-#    define LZO_CC_SYNTAX_GNUC 1
-#  endif
-#elif defined(__POCC__) && defined(_WIN32)
-#  define LZO_CC_PELLESC        1
-#  define LZO_INFO_CC           "Pelles C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__POCC__)
-#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
-#  if defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  else
-#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  endif
-#  if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
-#    define LZO_CC_CLANG_CLANG  (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
-#  else
-#    define LZO_CC_CLANG_CLANG  0x010000L
-#  endif
-#  define LZO_CC_CLANG          LZO_CC_CLANG_GNUC
-#  define LZO_INFO_CC           "clang"
-#  define LZO_INFO_CCVER        __VERSION__
-#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
-#  if defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  else
-#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  endif
-#  define LZO_CC_LLVM           LZO_CC_LLVM_GNUC
-#  define LZO_INFO_CC           "llvm-gcc"
-#  define LZO_INFO_CCVER        __VERSION__
-#elif defined(__GNUC__) && defined(__VERSION__)
-#  if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  elif defined(__GNUC_MINOR__)
-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  else
-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L)
-#  endif
-#  define LZO_INFO_CC           "gcc"
-#  define LZO_INFO_CCVER        __VERSION__
-#elif defined(__ACK__) && defined(_ACK)
-#  define LZO_CC_ACK            1
-#  define LZO_INFO_CC           "Amsterdam Compiler Kit C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__AZTEC_C__)
-#  define LZO_CC_AZTECC         1
-#  define LZO_INFO_CC           "Aztec C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__AZTEC_C__)
-#elif defined(__CODEGEARC__)
-#  define LZO_CC_CODEGEARC      1
-#  define LZO_INFO_CC           "CodeGear C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__CODEGEARC__)
-#elif defined(__BORLANDC__)
-#  define LZO_CC_BORLANDC       1
-#  define LZO_INFO_CC           "Borland C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__BORLANDC__)
-#elif defined(_CRAYC) && defined(_RELEASE)
-#  define LZO_CC_CRAYC          1
-#  define LZO_INFO_CC           "Cray C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(_RELEASE)
-#elif defined(__DMC__) && defined(__SC__)
-#  define LZO_CC_DMC            1
-#  define LZO_INFO_CC           "Digital Mars C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__DMC__)
-#elif defined(__DECC)
-#  define LZO_CC_DECC           1
-#  define LZO_INFO_CC           "DEC C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__DECC)
-#elif defined(__HIGHC__)
-#  define LZO_CC_HIGHC          1
-#  define LZO_INFO_CC           "MetaWare High C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__IAR_SYSTEMS_ICC__)
-#  define LZO_CC_IARC           1
-#  define LZO_INFO_CC           "IAR C"
-#  if defined(__VER__)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__VER__)
-#  else
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(__IBMC__)
-#  define LZO_CC_IBMC           1
-#  define LZO_INFO_CC           "IBM C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__IBMC__)
-#elif defined(__KEIL__) && defined(__C166__)
-#  define LZO_CC_KEILC          1
-#  define LZO_INFO_CC           "Keil C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__C166__)
-#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
-#  define LZO_CC_LCCWIN32       1
-#  define LZO_INFO_CC           "lcc-win32"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__LCC__)
-#  define LZO_CC_LCC            1
-#  define LZO_INFO_CC           "lcc"
-#  if defined(__LCC_VERSION__)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__LCC_VERSION__)
-#  else
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(_MSC_VER)
-#  define LZO_CC_MSC            1
-#  define LZO_INFO_CC           "Microsoft C"
-#  if defined(_MSC_FULL_VER)
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
-#  else
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER)
-#  endif
-#elif defined(__MWERKS__)
-#  define LZO_CC_MWERKS         1
-#  define LZO_INFO_CC           "Metrowerks C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__MWERKS__)
-#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
-#  define LZO_CC_NDPC           1
-#  define LZO_INFO_CC           "Microway NDP C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__PACIFIC__)
-#  define LZO_CC_PACIFICC       1
-#  define LZO_INFO_CC           "Pacific C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__PACIFIC__)
-#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
-#  define LZO_CC_PGI            1
-#  define LZO_INFO_CC           "Portland Group PGI C"
-#  define LZO_INFO_CCVER        "unknown"
-#elif defined(__PUREC__) && defined(__TOS__)
-#  define LZO_CC_PUREC          1
-#  define LZO_INFO_CC           "Pure C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__PUREC__)
-#elif defined(__SC__) && defined(__ZTC__)
-#  define LZO_CC_SYMANTECC      1
-#  define LZO_INFO_CC           "Symantec C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__SC__)
-#elif defined(__SUNPRO_C)
-#  define LZO_INFO_CC           "SunPro C"
-#  if ((__SUNPRO_C)+0 > 0)
-#    define LZO_CC_SUNPROC      __SUNPRO_C
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__SUNPRO_C)
-#  else
-#    define LZO_CC_SUNPROC      1
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(__SUNPRO_CC)
-#  define LZO_INFO_CC           "SunPro C"
-#  if ((__SUNPRO_CC)+0 > 0)
-#    define LZO_CC_SUNPROC      __SUNPRO_CC
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
-#  else
-#    define LZO_CC_SUNPROC      1
-#    define LZO_INFO_CCVER      "unknown"
-#  endif
-#elif defined(__TINYC__)
-#  define LZO_CC_TINYC          1
-#  define LZO_INFO_CC           "Tiny C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__TINYC__)
-#elif defined(__TSC__)
-#  define LZO_CC_TOPSPEEDC      1
-#  define LZO_INFO_CC           "TopSpeed C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__TSC__)
-#elif defined(__WATCOMC__)
-#  define LZO_CC_WATCOMC        1
-#  define LZO_INFO_CC           "Watcom C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__WATCOMC__)
-#elif defined(__TURBOC__)
-#  define LZO_CC_TURBOC         1
-#  define LZO_INFO_CC           "Turbo C"
-#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__TURBOC__)
-#elif defined(__ZTC__)
-#  define LZO_CC_ZORTECHC       1
-#  define LZO_INFO_CC           "Zortech C"
-#  if (__ZTC__ == 0x310)
-#    define LZO_INFO_CCVER      "0x310"
-#  else
-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__ZTC__)
-#  endif
-#else
-#  define LZO_CC_UNKNOWN        1
-#  define LZO_INFO_CC           "unknown"
-#  define LZO_INFO_CCVER        "unknown"
-#endif
-#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
-#  error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
-#endif
-#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY)
-#  if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY)
-#    if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
-#      define LZO_ARCH_CRAY_MPP     1
-#    elif defined(_CRAY1)
-#      define LZO_ARCH_CRAY_PVP     1
-#    endif
-#  endif
-#endif
-#if !defined(__LZO_ARCH_OVERRIDE)
-#if (LZO_ARCH_GENERIC)
-#  define LZO_INFO_ARCH             "generic"
-#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#  define LZO_ARCH_I086             1
-#  define LZO_ARCH_IA16             1
-#  define LZO_INFO_ARCH             "i086"
-#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
-#  define LZO_ARCH_ALPHA            1
-#  define LZO_INFO_ARCH             "alpha"
-#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
-#  define LZO_ARCH_ALPHA            1
-#  define LZO_INFO_ARCH             "alpha"
-#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
-#  define LZO_ARCH_AMD64            1
-#  define LZO_INFO_ARCH             "amd64"
-#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
-#  define LZO_ARCH_ARM              1
-#  define LZO_ARCH_ARM_THUMB        1
-#  define LZO_INFO_ARCH             "arm_thumb"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
-#  define LZO_ARCH_ARM              1
-#  if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
-#    define LZO_ARCH_ARM_THUMB      1
-#    define LZO_INFO_ARCH           "arm_thumb"
-#  elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
-#    define LZO_INFO_ARCH           "arm"
-#  else
-#    define LZO_INFO_ARCH           "arm"
-#  endif
-#elif defined(__arm__) || defined(_M_ARM)
-#  define LZO_ARCH_ARM              1
-#  define LZO_INFO_ARCH             "arm"
-#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
-#  define LZO_ARCH_AVR              1
-#  define LZO_INFO_ARCH             "avr"
-#elif defined(__avr32__) || defined(__AVR32__)
-#  define LZO_ARCH_AVR32            1
-#  define LZO_INFO_ARCH             "avr32"
-#elif defined(__bfin__)
-#  define LZO_ARCH_BLACKFIN         1
-#  define LZO_INFO_ARCH             "blackfin"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__)
-#  define LZO_ARCH_C166             1
-#  define LZO_INFO_ARCH             "c166"
-#elif defined(__cris__)
-#  define LZO_ARCH_CRIS             1
-#  define LZO_INFO_ARCH             "cris"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
-#  define LZO_ARCH_EZ80             1
-#  define LZO_INFO_ARCH             "ez80"
-#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
-#  define LZO_ARCH_H8300            1
-#  define LZO_INFO_ARCH             "h8300"
-#elif defined(__hppa__) || defined(__hppa)
-#  define LZO_ARCH_HPPA             1
-#  define LZO_INFO_ARCH             "hppa"
-#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
-#  define LZO_ARCH_I386             1
-#  define LZO_ARCH_IA32             1
-#  define LZO_INFO_ARCH             "i386"
-#elif (LZO_CC_ZORTECHC && defined(__I86__))
-#  define LZO_ARCH_I386             1
-#  define LZO_ARCH_IA32             1
-#  define LZO_INFO_ARCH             "i386"
-#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386)
-#  define LZO_ARCH_I386             1
-#  define LZO_ARCH_IA32             1
-#  define LZO_INFO_ARCH             "i386"
-#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
-#  define LZO_ARCH_IA64             1
-#  define LZO_INFO_ARCH             "ia64"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__)
-#  define LZO_ARCH_M16C             1
-#  define LZO_INFO_ARCH             "m16c"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
-#  define LZO_ARCH_M16C             1
-#  define LZO_INFO_ARCH             "m16c"
-#elif defined(__m32r__)
-#  define LZO_ARCH_M32R             1
-#  define LZO_INFO_ARCH             "m32r"
-#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
-#  define LZO_ARCH_M68K             1
-#  define LZO_INFO_ARCH             "m68k"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__)
-#  define LZO_ARCH_MCS251           1
-#  define LZO_INFO_ARCH             "mcs251"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__)
-#  define LZO_ARCH_MCS51            1
-#  define LZO_INFO_ARCH             "mcs51"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
-#  define LZO_ARCH_MCS51            1
-#  define LZO_INFO_ARCH             "mcs51"
-#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
-#  define LZO_ARCH_MIPS             1
-#  define LZO_INFO_ARCH             "mips"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__)
-#  define LZO_ARCH_MSP430           1
-#  define LZO_INFO_ARCH             "msp430"
-#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
-#  define LZO_ARCH_MSP430           1
-#  define LZO_INFO_ARCH             "msp430"
-#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
-#  define LZO_ARCH_POWERPC          1
-#  define LZO_INFO_ARCH             "powerpc"
-#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
-#  define LZO_ARCH_S390             1
-#  define LZO_INFO_ARCH             "s390"
-#elif defined(__sh__) || defined(_M_SH)
-#  define LZO_ARCH_SH               1
-#  define LZO_INFO_ARCH             "sh"
-#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
-#  define LZO_ARCH_SPARC            1
-#  define LZO_INFO_ARCH             "sparc"
-#elif defined(__SPU__)
-#  define LZO_ARCH_SPU              1
-#  define LZO_INFO_ARCH             "spu"
-#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
-#  define LZO_ARCH_Z80              1
-#  define LZO_INFO_ARCH             "z80"
-#elif (LZO_ARCH_CRAY_PVP)
-#  if defined(_CRAYSV1)
-#    define LZO_ARCH_CRAY_SV1       1
-#    define LZO_INFO_ARCH           "cray_sv1"
-#  elif (_ADDR64)
-#    define LZO_ARCH_CRAY_T90       1
-#    define LZO_INFO_ARCH           "cray_t90"
-#  elif (_ADDR32)
-#    define LZO_ARCH_CRAY_YMP       1
-#    define LZO_INFO_ARCH           "cray_ymp"
-#  else
-#    define LZO_ARCH_CRAY_XMP       1
-#    define LZO_INFO_ARCH           "cray_xmp"
-#  endif
-#else
-#  define LZO_ARCH_UNKNOWN          1
-#  define LZO_INFO_ARCH             "unknown"
-#endif
-#endif
-#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2)
-#  error "FIXME - missing define for CPU architecture"
-#endif
-#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
-#  error "FIXME - missing WIN32 define for CPU architecture"
-#endif
-#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
-#  error "FIXME - missing WIN64 define for CPU architecture"
-#endif
-#if (LZO_OS_OS216 || LZO_OS_WIN16)
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
-#  define LZO_ARCH_I086PM           1
-#  define LZO_ARCH_IA16PM           1
-#endif
-#if (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM)
-#  error "this should not happen"
-#endif
-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086)
-#  error "this should not happen"
-#endif
-#if (LZO_ARCH_I086)
-#  if (UINT_MAX != LZO_0xffffL)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if (LZO_ARCH_I386)
-#  if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
-#    error "this should not happen"
-#  endif
-#  if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
-#    error "this should not happen"
-#  endif
-#  if (ULONG_MAX != LZO_0xffffffffL)
-#    error "this should not happen"
-#  endif
-#endif
-#if !defined(__LZO_MM_OVERRIDE)
-#if (LZO_ARCH_I086)
-#if (UINT_MAX != LZO_0xffffL)
-#  error "this should not happen"
-#endif
-#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
-#  define LZO_MM_TINY           1
-#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
-#  define LZO_MM_HUGE           1
-#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
-#  define LZO_MM_SMALL          1
-#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
-#  define LZO_MM_MEDIUM         1
-#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
-#  define LZO_MM_COMPACT        1
-#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
-#  define LZO_MM_LARGE          1
-#elif (LZO_CC_AZTECC)
-#  if defined(_LARGE_CODE) && defined(_LARGE_DATA)
-#    define LZO_MM_LARGE        1
-#  elif defined(_LARGE_CODE)
-#    define LZO_MM_MEDIUM       1
-#  elif defined(_LARGE_DATA)
-#    define LZO_MM_COMPACT      1
-#  else
-#    define LZO_MM_SMALL        1
-#  endif
-#elif (LZO_CC_ZORTECHC && defined(__VCM__))
-#  define LZO_MM_LARGE          1
-#else
-#  error "unknown memory model"
-#endif
-#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#define LZO_HAVE_MM_HUGE_PTR        1
-#define LZO_HAVE_MM_HUGE_ARRAY      1
-#if (LZO_MM_TINY)
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#endif
-#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC)
-#  undef LZO_HAVE_MM_HUGE_PTR
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#elif (LZO_CC_MSC && defined(_QC))
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#  if (_MSC_VER < 600)
-#    undef LZO_HAVE_MM_HUGE_PTR
-#  endif
-#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295))
-#  undef LZO_HAVE_MM_HUGE_ARRAY
-#endif
-#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR)
-#  if (LZO_OS_DOS16)
-#    error "this should not happen"
-#  elif (LZO_CC_ZORTECHC)
-#  else
-#    error "this should not happen"
-#  endif
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC)
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295))
-   extern void __near __cdecl _AHSHIFT(void);
-#  define LZO_MM_AHSHIFT      ((unsigned) _AHSHIFT)
-#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16)
-#  define LZO_MM_AHSHIFT      12
-#elif (LZO_CC_WATCOMC)
-   extern unsigned char _HShift;
-#  define LZO_MM_AHSHIFT      ((unsigned) _HShift)
-#else
-#  error "FIXME - implement LZO_MM_AHSHIFT"
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
-#elif (LZO_ARCH_C166)
-#if !defined(__MODEL__)
-#  error "FIXME - C166 __MODEL__"
-#elif ((__MODEL__) == 0)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 1)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 2)
-#  define LZO_MM_LARGE          1
-#elif ((__MODEL__) == 3)
-#  define LZO_MM_TINY           1
-#elif ((__MODEL__) == 4)
-#  define LZO_MM_XTINY          1
-#elif ((__MODEL__) == 5)
-#  define LZO_MM_XSMALL         1
-#else
-#  error "FIXME - C166 __MODEL__"
-#endif
-#elif (LZO_ARCH_MCS251)
-#if !defined(__MODEL__)
-#  error "FIXME - MCS251 __MODEL__"
-#elif ((__MODEL__) == 0)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 2)
-#  define LZO_MM_LARGE          1
-#elif ((__MODEL__) == 3)
-#  define LZO_MM_TINY           1
-#elif ((__MODEL__) == 4)
-#  define LZO_MM_XTINY          1
-#elif ((__MODEL__) == 5)
-#  define LZO_MM_XSMALL         1
-#else
-#  error "FIXME - MCS251 __MODEL__"
-#endif
-#elif (LZO_ARCH_MCS51)
-#if !defined(__MODEL__)
-#  error "FIXME - MCS51 __MODEL__"
-#elif ((__MODEL__) == 1)
-#  define LZO_MM_SMALL          1
-#elif ((__MODEL__) == 2)
-#  define LZO_MM_LARGE          1
-#elif ((__MODEL__) == 3)
-#  define LZO_MM_TINY           1
-#elif ((__MODEL__) == 4)
-#  define LZO_MM_XTINY          1
-#elif ((__MODEL__) == 5)
-#  define LZO_MM_XSMALL         1
-#else
-#  error "FIXME - MCS51 __MODEL__"
-#endif
-#elif (LZO_ARCH_CRAY_PVP)
-#  define LZO_MM_PVP            1
-#else
-#  define LZO_MM_FLAT           1
-#endif
-#if (LZO_MM_COMPACT)
-#  define LZO_INFO_MM           "compact"
-#elif (LZO_MM_FLAT)
-#  define LZO_INFO_MM           "flat"
-#elif (LZO_MM_HUGE)
-#  define LZO_INFO_MM           "huge"
-#elif (LZO_MM_LARGE)
-#  define LZO_INFO_MM           "large"
-#elif (LZO_MM_MEDIUM)
-#  define LZO_INFO_MM           "medium"
-#elif (LZO_MM_PVP)
-#  define LZO_INFO_MM           "pvp"
-#elif (LZO_MM_SMALL)
-#  define LZO_INFO_MM           "small"
-#elif (LZO_MM_TINY)
-#  define LZO_INFO_MM           "tiny"
-#else
-#  error "unknown memory model"
-#endif
-#endif
-#if defined(SIZEOF_SHORT)
-#  define LZO_SIZEOF_SHORT          (SIZEOF_SHORT)
-#endif
-#if defined(SIZEOF_INT)
-#  define LZO_SIZEOF_INT            (SIZEOF_INT)
-#endif
-#if defined(SIZEOF_LONG)
-#  define LZO_SIZEOF_LONG           (SIZEOF_LONG)
-#endif
-#if defined(SIZEOF_LONG_LONG)
-#  define LZO_SIZEOF_LONG_LONG      (SIZEOF_LONG_LONG)
-#endif
-#if defined(SIZEOF___INT16)
-#  define LZO_SIZEOF___INT16        (SIZEOF___INT16)
-#endif
-#if defined(SIZEOF___INT32)
-#  define LZO_SIZEOF___INT32        (SIZEOF___INT32)
-#endif
-#if defined(SIZEOF___INT64)
-#  define LZO_SIZEOF___INT64        (SIZEOF___INT64)
-#endif
-#if defined(SIZEOF_VOID_P)
-#  define LZO_SIZEOF_VOID_P         (SIZEOF_VOID_P)
-#endif
-#if defined(SIZEOF_SIZE_T)
-#  define LZO_SIZEOF_SIZE_T         (SIZEOF_SIZE_T)
-#endif
-#if defined(SIZEOF_PTRDIFF_T)
-#  define LZO_SIZEOF_PTRDIFF_T      (SIZEOF_PTRDIFF_T)
-#endif
-#define __LZO_LSR(x,b)    (((x)+0ul) >> (b))
-#if !defined(LZO_SIZEOF_SHORT)
-#  if (LZO_ARCH_CRAY_PVP)
-#    define LZO_SIZEOF_SHORT        8
-#  elif (USHRT_MAX == LZO_0xffffL)
-#    define LZO_SIZEOF_SHORT        2
-#  elif (__LZO_LSR(USHRT_MAX,7) == 1)
-#    define LZO_SIZEOF_SHORT        1
-#  elif (__LZO_LSR(USHRT_MAX,15) == 1)
-#    define LZO_SIZEOF_SHORT        2
-#  elif (__LZO_LSR(USHRT_MAX,31) == 1)
-#    define LZO_SIZEOF_SHORT        4
-#  elif (__LZO_LSR(USHRT_MAX,63) == 1)
-#    define LZO_SIZEOF_SHORT        8
-#  elif (__LZO_LSR(USHRT_MAX,127) == 1)
-#    define LZO_SIZEOF_SHORT        16
-#  else
-#    error "LZO_SIZEOF_SHORT"
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_INT)
-#  if (LZO_ARCH_CRAY_PVP)
-#    define LZO_SIZEOF_INT          8
-#  elif (UINT_MAX == LZO_0xffffL)
-#    define LZO_SIZEOF_INT          2
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define LZO_SIZEOF_INT          4
-#  elif (__LZO_LSR(UINT_MAX,7) == 1)
-#    define LZO_SIZEOF_INT          1
-#  elif (__LZO_LSR(UINT_MAX,15) == 1)
-#    define LZO_SIZEOF_INT          2
-#  elif (__LZO_LSR(UINT_MAX,31) == 1)
-#    define LZO_SIZEOF_INT          4
-#  elif (__LZO_LSR(UINT_MAX,63) == 1)
-#    define LZO_SIZEOF_INT          8
-#  elif (__LZO_LSR(UINT_MAX,127) == 1)
-#    define LZO_SIZEOF_INT          16
-#  else
-#    error "LZO_SIZEOF_INT"
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_LONG)
-#  if (ULONG_MAX == LZO_0xffffffffL)
-#    define LZO_SIZEOF_LONG         4
-#  elif (__LZO_LSR(ULONG_MAX,7) == 1)
-#    define LZO_SIZEOF_LONG         1
-#  elif (__LZO_LSR(ULONG_MAX,15) == 1)
-#    define LZO_SIZEOF_LONG         2
-#  elif (__LZO_LSR(ULONG_MAX,31) == 1)
-#    define LZO_SIZEOF_LONG         4
-#  elif (__LZO_LSR(ULONG_MAX,63) == 1)
-#    define LZO_SIZEOF_LONG         8
-#  elif (__LZO_LSR(ULONG_MAX,127) == 1)
-#    define LZO_SIZEOF_LONG         16
-#  else
-#    error "LZO_SIZEOF_LONG"
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
-#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
-#  if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
-#    if (LZO_CC_GNUC >= 0x030300ul)
-#      if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
-#        define LZO_SIZEOF_LONG_LONG      LZO_SIZEOF_LONG
-#      elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
-#        define LZO_SIZEOF_LONG_LONG      4
-#      endif
-#    endif
-#  endif
-#endif
-#endif
-#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
-#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
-#if (LZO_ARCH_I086 && LZO_CC_DMC)
-#elif (LZO_CC_CILLY) && defined(__GNUC__)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_OS_WIN64 || defined(_WIN64))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_ARCH_I386 && (LZO_CC_DMC))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700)))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__)))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC))
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC))
-#  define LZO_SIZEOF___INT64        8
-#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100)))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
-#  define LZO_SIZEOF___INT64        8
-#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
-#  define LZO_SIZEOF_LONG_LONG      8
-#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2)
-#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#  define LZO_SIZEOF_LONG_LONG      8
-#endif
-#endif
-#endif
-#if defined(__cplusplus) && (LZO_CC_GNUC)
-#  if (LZO_CC_GNUC < 0x020800ul)
-#    undef LZO_SIZEOF_LONG_LONG
-#  endif
-#endif
-#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
-#  undef LZO_SIZEOF_LONG_LONG
-#endif
-#if !defined(LZO_SIZEOF_VOID_P)
-#if (LZO_ARCH_I086)
-#  define __LZO_WORDSIZE            2
-#  if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
-#    define LZO_SIZEOF_VOID_P       2
-#  elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
-#    define LZO_SIZEOF_VOID_P       4
-#  else
-#    error "LZO_MM"
-#  endif
-#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
-#  define __LZO_WORDSIZE            1
-#  define LZO_SIZEOF_VOID_P         2
-#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430)
-#  define LZO_SIZEOF_VOID_P         2
-#elif (LZO_ARCH_H8300)
-#  if defined(__NORMAL_MODE__)
-#    define __LZO_WORDSIZE          4
-#    define LZO_SIZEOF_VOID_P       2
-#  elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
-#    define __LZO_WORDSIZE          4
-#    define LZO_SIZEOF_VOID_P       4
-#  else
-#    define __LZO_WORDSIZE          2
-#    define LZO_SIZEOF_VOID_P       2
-#  endif
-#  if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4)
-#    define LZO_SIZEOF_SIZE_T       LZO_SIZEOF_INT
-#    define LZO_SIZEOF_PTRDIFF_T    LZO_SIZEOF_INT
-#  endif
-#elif (LZO_ARCH_M16C)
-#  define __LZO_WORDSIZE            2
-#  if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
-#    define LZO_SIZEOF_VOID_P       4
-#  else
-#    define LZO_SIZEOF_VOID_P       2
-#  endif
-#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
-#  define __LZO_WORDSIZE            8
-#  define LZO_SIZEOF_VOID_P         4
-#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
-#  define __LZO_WORDSIZE            8
-#  define LZO_SIZEOF_VOID_P         8
-#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
-#  define LZO_SIZEOF_VOID_P         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_LONG
-#elif (LZO_OS_OS400 || defined(__OS400__))
-#  define __LZO_WORDSIZE            LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_VOID_P         16
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_LONG
-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
-#  define LZO_SIZEOF_VOID_P         8
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_LONG
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_LONG
-#elif (LZO_ARCH_SPU)
-# if 0
-#  define __LZO_WORDSIZE            16
-# endif
-#  define LZO_SIZEOF_VOID_P         4
-#else
-#  define LZO_SIZEOF_VOID_P         LZO_SIZEOF_LONG
-#endif
-#endif
-#if !defined(LZO_WORDSIZE)
-#  if defined(__LZO_WORDSIZE)
-#    define LZO_WORDSIZE            __LZO_WORDSIZE
-#  else
-#    define LZO_WORDSIZE            LZO_SIZEOF_VOID_P
-#  endif
-#endif
-#if !defined(LZO_SIZEOF_SIZE_T)
-#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
-#  define LZO_SIZEOF_SIZE_T         2
-#else
-#  define LZO_SIZEOF_SIZE_T         LZO_SIZEOF_VOID_P
-#endif
-#endif
-#if !defined(LZO_SIZEOF_PTRDIFF_T)
-#if (LZO_ARCH_I086)
-#  if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE)
-#    define LZO_SIZEOF_PTRDIFF_T    LZO_SIZEOF_VOID_P
-#  elif (LZO_MM_COMPACT || LZO_MM_LARGE)
-#    if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
-#      define LZO_SIZEOF_PTRDIFF_T  4
-#    else
-#      define LZO_SIZEOF_PTRDIFF_T  2
-#    endif
-#  else
-#    error "LZO_MM"
-#  endif
-#else
-#  define LZO_SIZEOF_PTRDIFF_T      LZO_SIZEOF_SIZE_T
-#endif
-#endif
-#if (LZO_ABI_NEUTRAL_ENDIAN)
-#  undef LZO_ABI_BIG_ENDIAN
-#  undef LZO_ABI_LITTLE_ENDIAN
-#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN)
-#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
-#  if (__LITTLE_ENDIAN__ == 1)
-#    define LZO_ABI_LITTLE_ENDIAN   1
-#  else
-#    define LZO_ABI_BIG_ENDIAN      1
-#  endif
-#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
-#  define LZO_ABI_BIG_ENDIAN        1
-#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
-#  define LZO_ABI_LITTLE_ENDIAN     1
-#endif
-#endif
-#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN)
-#  error "this should not happen"
-#endif
-#if (LZO_ABI_BIG_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "be"
-#elif (LZO_ABI_LITTLE_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "le"
-#elif (LZO_ABI_NEUTRAL_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "neutral"
-#endif
-#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
-#  define LZO_ABI_I8LP16         1
-#  define LZO_INFO_ABI_PM       "i8lp16"
-#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
-#  define LZO_ABI_ILP16         1
-#  define LZO_INFO_ABI_PM       "ilp16"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
-#  define LZO_ABI_ILP32         1
-#  define LZO_INFO_ABI_PM       "ilp32"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8)
-#  define LZO_ABI_LLP64         1
-#  define LZO_INFO_ABI_PM       "llp64"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
-#  define LZO_ABI_LP64          1
-#  define LZO_INFO_ABI_PM       "lp64"
-#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
-#  define LZO_ABI_ILP64         1
-#  define LZO_INFO_ABI_PM       "ilp64"
-#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4)
-#  define LZO_ABI_IP32L64       1
-#  define LZO_INFO_ABI_PM       "ip32l64"
-#endif
-#if !defined(__LZO_LIBC_OVERRIDE)
-#if (LZO_LIBC_NAKED)
-#  define LZO_INFO_LIBC         "naked"
-#elif (LZO_LIBC_FREESTANDING)
-#  define LZO_INFO_LIBC         "freestanding"
-#elif (LZO_LIBC_MOSTLY_FREESTANDING)
-#  define LZO_INFO_LIBC         "mfreestanding"
-#elif (LZO_LIBC_ISOC90)
-#  define LZO_INFO_LIBC         "isoc90"
-#elif (LZO_LIBC_ISOC99)
-#  define LZO_INFO_LIBC         "isoc99"
-#elif defined(__dietlibc__)
-#  define LZO_LIBC_DIETLIBC     1
-#  define LZO_INFO_LIBC         "dietlibc"
-#elif defined(_NEWLIB_VERSION)
-#  define LZO_LIBC_NEWLIB       1
-#  define LZO_INFO_LIBC         "newlib"
-#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
-#  if defined(__UCLIBC_SUBLEVEL__)
-#    define LZO_LIBC_UCLIBC     (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
-#  else
-#    define LZO_LIBC_UCLIBC     0x00090bL
-#  endif
-#  define LZO_INFO_LIBC         "uclibc"
-#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
-#  define LZO_LIBC_GLIBC        (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
-#  define LZO_INFO_LIBC         "glibc"
-#elif (LZO_CC_MWERKS) && defined(__MSL__)
-#  define LZO_LIBC_MSL          __MSL__
-#  define LZO_INFO_LIBC         "msl"
-#elif 1 && defined(__IAR_SYSTEMS_ICC__)
-#  define LZO_LIBC_ISOC90       1
-#  define LZO_INFO_LIBC         "isoc90"
-#else
-#  define LZO_LIBC_DEFAULT      1
-#  define LZO_INFO_LIBC         "default"
-#endif
-#endif
-#if !defined(__lzo_gnuc_extension__)
-#if (LZO_CC_GNUC >= 0x020800ul)
-#  define __lzo_gnuc_extension__    __extension__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_gnuc_extension__    __extension__
-#else
-#  define __lzo_gnuc_extension__    /*empty*/
-#endif
-#endif
-#if !defined(__lzo_ua_volatile)
-#  define __lzo_ua_volatile     volatile
-#endif
-#if !defined(__lzo_alignof)
-#if (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
-#  define __lzo_alignof(e)      __alignof__(e)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700))
-#  define __lzo_alignof(e)      __alignof__(e)
-#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
-#  define __lzo_alignof(e)      __alignof(e)
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_alignof(e)      __alignof__(e)
-#endif
-#endif
-#if defined(__lzo_alignof)
-#  define __lzo_HAVE_alignof 1
-#endif
-#if !defined(__lzo_constructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-#  define __lzo_constructor     __attribute__((__constructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-#  define __lzo_constructor     __attribute__((__constructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_constructor     __attribute__((__constructor__))
-#endif
-#endif
-#if defined(__lzo_constructor)
-#  define __lzo_HAVE_constructor 1
-#endif
-#if !defined(__lzo_destructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-#  define __lzo_destructor      __attribute__((__destructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-#  define __lzo_destructor      __attribute__((__destructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_destructor      __attribute__((__destructor__))
-#endif
-#endif
-#if defined(__lzo_destructor)
-#  define __lzo_HAVE_destructor 1
-#endif
-#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
-#  error "this should not happen"
-#endif
-#if !defined(__lzo_inline)
-#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
-#elif defined(__cplusplus)
-#  define __lzo_inline          inline
-#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
-#  define __lzo_inline          __inline
-#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
-#  define __lzo_inline          __inline__
-#elif (LZO_CC_DMC)
-#  define __lzo_inline          __inline
-#elif (LZO_CC_INTELC)
-#  define __lzo_inline          __inline
-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405))
-#  define __lzo_inline          __inline
-#elif (LZO_CC_MSC && (_MSC_VER >= 900))
-#  define __lzo_inline          __inline
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_inline          __inline__
-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#  define __lzo_inline          inline
-#endif
-#endif
-#if defined(__lzo_inline)
-#  define __lzo_HAVE_inline 1
-#else
-#  define __lzo_inline          /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-#if (LZO_CC_GNUC >= 0x030200ul)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-#  define __lzo_forceinline     __forceinline
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-#  define __lzo_forceinline     __forceinline
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#endif
-#endif
-#if defined(__lzo_forceinline)
-#  define __lzo_HAVE_forceinline 1
-#else
-#  define __lzo_forceinline     /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
-#  define __lzo_noinline        __attribute__((__noinline__,__used__))
-#elif (LZO_CC_GNUC >= 0x030200ul)
-#  define __lzo_noinline        __attribute__((__noinline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC)
-#  define __lzo_noinline        __declspec(noinline)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_noinline        __attribute__((__noinline__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_noinline        __attribute__((__noinline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
-#  define __lzo_noinline        __declspec(noinline)
-#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64))
-#  if defined(__cplusplus)
-#  else
-#    define __lzo_noinline      __declspec(noinline)
-#  endif
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-#  define __lzo_noinline        __attribute__((__noinline__))
-#endif
-#endif
-#if defined(__lzo_noinline)
-#  define __lzo_HAVE_noinline 1
-#else
-#  define __lzo_noinline        /*empty*/
-#endif
-#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
-#  error "this should not happen"
-#endif
-#if !defined(__lzo_noreturn)
-#if (LZO_CC_GNUC >= 0x020700ul)
-#  define __lzo_noreturn        __attribute__((__noreturn__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-#  define __lzo_noreturn        __declspec(noreturn)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_noreturn        __attribute__((__noreturn__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_noreturn        __attribute__((__noreturn__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-#  define __lzo_noreturn        __declspec(noreturn)
-#endif
-#endif
-#if defined(__lzo_noreturn)
-#  define __lzo_HAVE_noreturn 1
-#else
-#  define __lzo_noreturn        /*empty*/
-#endif
-#if !defined(__lzo_nothrow)
-#if (LZO_CC_GNUC >= 0x030300ul)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus)
-#  define __lzo_nothrow         __declspec(nothrow)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
-#  define __lzo_nothrow         __declspec(nothrow)
-#endif
-#endif
-#if defined(__lzo_nothrow)
-#  define __lzo_HAVE_nothrow 1
-#else
-#  define __lzo_nothrow         /*empty*/
-#endif
-#if !defined(__lzo_restrict)
-#if (LZO_CC_GNUC >= 0x030400ul)
-#  define __lzo_restrict        __restrict__
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_restrict        __restrict__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM)
-#  define __lzo_restrict        __restrict__
-#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
-#  define __lzo_restrict        __restrict
-#endif
-#endif
-#if defined(__lzo_restrict)
-#  define __lzo_HAVE_restrict 1
-#else
-#  define __lzo_restrict        /*empty*/
-#endif
-#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
-#if (LZO_CC_GNUC >= 0x030200ul)
-#  define __lzo_likely(e)       (__builtin_expect(!!(e),1))
-#  define __lzo_unlikely(e)     (__builtin_expect(!!(e),0))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
-#  define __lzo_likely(e)       (__builtin_expect(!!(e),1))
-#  define __lzo_unlikely(e)     (__builtin_expect(!!(e),0))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_likely(e)       (__builtin_expect(!!(e),1))
-#  define __lzo_unlikely(e)     (__builtin_expect(!!(e),0))
-#endif
-#endif
-#if defined(__lzo_likely)
-#  define __lzo_HAVE_likely 1
-#else
-#  define __lzo_likely(e)       (e)
-#endif
-#if defined(__lzo_unlikely)
-#  define __lzo_HAVE_unlikely 1
-#else
-#  define __lzo_unlikely(e)     (e)
-#endif
-#if !defined(LZO_UNUSED)
-#  if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
-#    define LZO_UNUSED(var)         ((void) &var)
-#  elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC)
-#    define LZO_UNUSED(var)         if (&var) ; else
-#  elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#    define LZO_UNUSED(var)         ((void) var)
-#  elif (LZO_CC_MSC && (_MSC_VER < 900))
-#    define LZO_UNUSED(var)         if (&var) ; else
-#  elif (LZO_CC_KEILC)
-#    define LZO_UNUSED(var)         {extern int __lzo_unused[1-2*!(sizeof(var)>0)];}
-#  elif (LZO_CC_PACIFICC)
-#    define LZO_UNUSED(var)         ((void) sizeof(var))
-#  elif (LZO_CC_WATCOMC) && defined(__cplusplus)
-#    define LZO_UNUSED(var)         ((void) var)
-#  else
-#    define LZO_UNUSED(var)         ((void) &var)
-#  endif
-#endif
-#if !defined(LZO_UNUSED_FUNC)
-#  if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
-#    define LZO_UNUSED_FUNC(func)   ((void) func)
-#  elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC)
-#    define LZO_UNUSED_FUNC(func)   if (func) ; else
-#  elif (LZO_CC_CLANG || LZO_CC_LLVM)
-#    define LZO_UNUSED_FUNC(func)   ((void) &func)
-#  elif (LZO_CC_MSC && (_MSC_VER < 900))
-#    define LZO_UNUSED_FUNC(func)   if (func) ; else
-#  elif (LZO_CC_MSC)
-#    define LZO_UNUSED_FUNC(func)   ((void) &func)
-#  elif (LZO_CC_KEILC || LZO_CC_PELLESC)
-#    define LZO_UNUSED_FUNC(func)   {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];}
-#  else
-#    define LZO_UNUSED_FUNC(func)   ((void) func)
-#  endif
-#endif
-#if !defined(LZO_UNUSED_LABEL)
-#  if (LZO_CC_WATCOMC) && defined(__cplusplus)
-#    define LZO_UNUSED_LABEL(l)     switch(0) case 1:goto l
-#  elif (LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC)
-#    define LZO_UNUSED_LABEL(l)     if (0) goto l
-#  else
-#    define LZO_UNUSED_LABEL(l)     switch(0) case 1:goto l
-#  endif
-#endif
-#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
-#  if 0
-#    define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init)  type var
-#  elif 0 && (LZO_CC_GNUC)
-#    define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init)  type var = var
-#  else
-#    define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init)  type var = init
-#  endif
-#endif
-#if !defined(LZO_UNCONST_CAST)
-#  if 0 && defined(__cplusplus)
-#    define LZO_UNCONST_CAST(t,e)   (const_cast<t> (e))
-#  elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-#    define LZO_UNCONST_CAST(t,e)   ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e))))))
-#  else
-#    define LZO_UNCONST_CAST(t,e)   ((t) ((void *) ((char *) ((const void *) (e)))))
-#  endif
-#endif
-#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
-#  if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1-!(e)];
-#  elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1u-2*!(e)];
-#  elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1-!(e)];
-#  else
-#    define LZO_COMPILE_TIME_ASSERT_HEADER(e)  extern int __lzo_cta[1-2*!(e)];
-#  endif
-#endif
-#if !defined(LZO_COMPILE_TIME_ASSERT)
-#  if (LZO_CC_AZTECC)
-#    define LZO_COMPILE_TIME_ASSERT(e)  {typedef int __lzo_cta_t[1-!(e)];}
-#  elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
-#    define LZO_COMPILE_TIME_ASSERT(e)  switch(0) case 1:case !(e):break;
-#  elif (LZO_CC_MSC && (_MSC_VER < 900))
-#    define LZO_COMPILE_TIME_ASSERT(e)  switch(0) case 1:case !(e):break;
-#  elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
-#    define LZO_COMPILE_TIME_ASSERT(e)  switch(0) case 1:case !(e):break;
-#  else
-#    define LZO_COMPILE_TIME_ASSERT(e)  {typedef int __lzo_cta_t[1-2*!(e)];}
-#  endif
-#endif
-#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
-#  if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC)
-#  elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
-#    define __lzo_cdecl                 __cdecl
-#    define __lzo_cdecl_atexit          /*empty*/
-#    define __lzo_cdecl_main            __cdecl
-#    if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
-#      define __lzo_cdecl_qsort         __pascal
-#    elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
-#      define __lzo_cdecl_qsort         _stdcall
-#    else
-#      define __lzo_cdecl_qsort         __cdecl
-#    endif
-#  elif (LZO_CC_WATCOMC)
-#    define __lzo_cdecl                 __cdecl
-#  else
-#    define __lzo_cdecl                 __cdecl
-#    define __lzo_cdecl_atexit          __cdecl
-#    define __lzo_cdecl_main            __cdecl
-#    define __lzo_cdecl_qsort           __cdecl
-#  endif
-#  if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC)
-#  elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
-#    define __lzo_cdecl_sighandler      __pascal
-#  elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
-#    define __lzo_cdecl_sighandler      _stdcall
-#  elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
-#    define __lzo_cdecl_sighandler      __clrcall
-#  elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
-#    if defined(_DLL)
-#      define __lzo_cdecl_sighandler    _far _cdecl _loadds
-#    elif defined(_MT)
-#      define __lzo_cdecl_sighandler    _far _cdecl
-#    else
-#      define __lzo_cdecl_sighandler    _cdecl
-#    endif
-#  else
-#    define __lzo_cdecl_sighandler      __cdecl
-#  endif
-#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC)
-#  define __lzo_cdecl                   __cdecl
-#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
-#  define __lzo_cdecl                   cdecl
-#endif
-#if !defined(__lzo_cdecl)
-#  define __lzo_cdecl                   /*empty*/
-#endif
-#if !defined(__lzo_cdecl_atexit)
-#  define __lzo_cdecl_atexit            /*empty*/
-#endif
-#if !defined(__lzo_cdecl_main)
-#  define __lzo_cdecl_main              /*empty*/
-#endif
-#if !defined(__lzo_cdecl_qsort)
-#  define __lzo_cdecl_qsort             /*empty*/
-#endif
-#if !defined(__lzo_cdecl_sighandler)
-#  define __lzo_cdecl_sighandler        /*empty*/
-#endif
-#if !defined(__lzo_cdecl_va)
-#  define __lzo_cdecl_va                __lzo_cdecl
-#endif
-#if !(LZO_CFG_NO_WINDOWS_H)
-#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64)
-#  if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
-#  elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
-#  elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul)))
-#  else
-#    define LZO_HAVE_WINDOWS_H 1
-#  endif
-#endif
-#endif
-#if (LZO_ARCH_ALPHA)
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#  define LZO_OPT_AVOID_SHORT       1
-#  define LZO_OPT_AVOID_USHORT      1
-#elif (LZO_ARCH_AMD64)
-#  define LZO_OPT_AVOID_INT_INDEX   1
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#  define LZO_OPT_UNALIGNED64       1
-#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB)
-#elif (LZO_ARCH_ARM)
-#  define LZO_OPT_AVOID_SHORT       1
-#  define LZO_OPT_AVOID_USHORT      1
-#elif (LZO_ARCH_CRIS)
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#elif (LZO_ARCH_I386)
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#elif (LZO_ARCH_IA64)
-#  define LZO_OPT_AVOID_INT_INDEX   1
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#  define LZO_OPT_PREFER_POSTINC    1
-#elif (LZO_ARCH_M68K)
-#  define LZO_OPT_PREFER_POSTINC    1
-#  define LZO_OPT_PREFER_PREDEC     1
-#  if defined(__mc68020__) && !defined(__mcoldfire__)
-#    define LZO_OPT_UNALIGNED16     1
-#    define LZO_OPT_UNALIGNED32     1
-#  endif
-#elif (LZO_ARCH_MIPS)
-#  define LZO_OPT_AVOID_UINT_INDEX  1
-#elif (LZO_ARCH_POWERPC)
-#  define LZO_OPT_PREFER_PREINC     1
-#  define LZO_OPT_PREFER_PREDEC     1
-#  if (LZO_ABI_BIG_ENDIAN)
-#    define LZO_OPT_UNALIGNED16     1
-#    define LZO_OPT_UNALIGNED32     1
-#  endif
-#elif (LZO_ARCH_S390)
-#  define LZO_OPT_UNALIGNED16       1
-#  define LZO_OPT_UNALIGNED32       1
-#  if (LZO_SIZEOF_SIZE_T == 8)
-#    define LZO_OPT_UNALIGNED64     1
-#  endif
-#elif (LZO_ARCH_SH)
-#  define LZO_OPT_PREFER_POSTINC    1
-#  define LZO_OPT_PREFER_PREDEC     1
-#endif
-#ifndef LZO_CFG_NO_INLINE_ASM
-#if (LZO_CC_LLVM)
-#  define LZO_CFG_NO_INLINE_ASM 1
-#endif
-#endif
-#ifndef LZO_CFG_NO_UNALIGNED
-#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
-#  define LZO_CFG_NO_UNALIGNED 1
-#endif
-#endif
-#if (LZO_CFG_NO_UNALIGNED)
-#  undef LZO_OPT_UNALIGNED16
-#  undef LZO_OPT_UNALIGNED32
-#  undef LZO_OPT_UNALIGNED64
-#endif
-#if (LZO_CFG_NO_INLINE_ASM)
-#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
-#  define LZO_ASM_SYNTAX_MSC 1
-#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
-#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul))
-#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
-#  define LZO_ASM_SYNTAX_GNUC 1
-#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
-#  define LZO_ASM_SYNTAX_GNUC 1
-#endif
-#if (LZO_ASM_SYNTAX_GNUC)
-#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
-#  define __LZO_ASM_CLOBBER         "ax"
-#elif (LZO_CC_INTELC)
-#  define __LZO_ASM_CLOBBER         "memory"
-#else
-#  define __LZO_ASM_CLOBBER         "cc", "memory"
-#endif
-#endif
-#if defined(__LZO_INFOSTR_MM)
-#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM))
-#  define __LZO_INFOSTR_MM          ""
-#elif defined(LZO_INFO_MM)
-#  define __LZO_INFOSTR_MM          "." LZO_INFO_MM
-#else
-#  define __LZO_INFOSTR_MM          ""
-#endif
-#if defined(__LZO_INFOSTR_PM)
-#elif defined(LZO_INFO_ABI_PM)
-#  define __LZO_INFOSTR_PM          "." LZO_INFO_ABI_PM
-#else
-#  define __LZO_INFOSTR_PM          ""
-#endif
-#if defined(__LZO_INFOSTR_ENDIAN)
-#elif defined(LZO_INFO_ABI_ENDIAN)
-#  define __LZO_INFOSTR_ENDIAN      "." LZO_INFO_ABI_ENDIAN
-#else
-#  define __LZO_INFOSTR_ENDIAN      ""
-#endif
-#if defined(__LZO_INFOSTR_OSNAME)
-#elif defined(LZO_INFO_OS_CONSOLE)
-#  define __LZO_INFOSTR_OSNAME      LZO_INFO_OS "." LZO_INFO_OS_CONSOLE
-#elif defined(LZO_INFO_OS_POSIX)
-#  define __LZO_INFOSTR_OSNAME      LZO_INFO_OS "." LZO_INFO_OS_POSIX
-#else
-#  define __LZO_INFOSTR_OSNAME      LZO_INFO_OS
-#endif
-#if defined(__LZO_INFOSTR_LIBC)
-#elif defined(LZO_INFO_LIBC)
-#  define __LZO_INFOSTR_LIBC        "." LZO_INFO_LIBC
-#else
-#  define __LZO_INFOSTR_LIBC        ""
-#endif
-#if defined(__LZO_INFOSTR_CCVER)
-#elif defined(LZO_INFO_CCVER)
-#  define __LZO_INFOSTR_CCVER       " " LZO_INFO_CCVER
-#else
-#  define __LZO_INFOSTR_CCVER       ""
-#endif
-#define LZO_INFO_STRING \
-    LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \
-    " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER
-
-#endif
-
-#endif
-
-#undef LZO_HAVE_CONFIG_H
-#include "minilzo.h"
-
-#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2060)
-#  error "version mismatch in miniLZO source files"
-#endif
-
-#ifdef MINILZO_HAVE_CONFIG_H
-#  define LZO_HAVE_CONFIG_H 1
-#endif
-
-#ifndef __LZO_CONF_H
-#define __LZO_CONF_H 1
-
-#if !defined(__LZO_IN_MINILZO)
-#if (LZO_CFG_FREESTANDING)
-#  define LZO_LIBC_FREESTANDING 1
-#  define LZO_OS_FREESTANDING 1
-#  define ACC_LIBC_FREESTANDING 1
-#  define ACC_OS_FREESTANDING 1
-#endif
-#if (LZO_CFG_NO_UNALIGNED)
-#  define ACC_CFG_NO_UNALIGNED 1
-#endif
-#if (LZO_ARCH_GENERIC)
-#  define ACC_ARCH_GENERIC 1
-#endif
-#if (LZO_ABI_NEUTRAL_ENDIAN)
-#  define ACC_ABI_NEUTRAL_ENDIAN 1
-#endif
-#if (LZO_HAVE_CONFIG_H)
-#  define ACC_CONFIG_NO_HEADER 1
-#endif
-#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
-#  include LZO_CFG_EXTRA_CONFIG_HEADER
-#endif
-#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED)
-#  error "include this file first"
-#endif
-#include "lzo/lzoconf.h"
-#endif
-
-#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED)
-#  error "version mismatch"
-#endif
-
-#if (LZO_CC_BORLANDC && LZO_ARCH_I086)
-#  pragma option -h
-#endif
-
-#if (LZO_CC_MSC && (_MSC_VER >= 1000))
-#  pragma warning(disable: 4127 4701)
-#endif
-#if (LZO_CC_MSC && (_MSC_VER >= 1300))
-#  pragma warning(disable: 4820)
-#  pragma warning(disable: 4514 4710 4711)
-#endif
-
-#if (LZO_CC_SUNPROC)
-#if !defined(__cplusplus)
-#  pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED)
-#  pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP)
-#  pragma error_messages(off,E_STATEMENT_NOT_REACHED)
-#endif
-#endif
-
-#if (__LZO_MMODEL_HUGE) && !(LZO_HAVE_MM_HUGE_PTR)
-#  error "this should not happen - check defines for __huge"
-#endif
-
-#if defined(__LZO_IN_MINILZO) || defined(LZO_CFG_FREESTANDING)
-#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
-#  define ACC_WANT_ACC_INCD_H 1
-#  define ACC_WANT_ACC_INCE_H 1
-#  define ACC_WANT_ACC_INCI_H 1
-#elif 1
-#  include <string.h>
-#else
-#  define ACC_WANT_ACC_INCD_H 1
-#endif
-
-#if (LZO_ARCH_I086)
-#  define ACC_MM_AHSHIFT        LZO_MM_AHSHIFT
-#  define ACC_PTR_FP_OFF(x)     (((const unsigned __far*)&(x))[0])
-#  define ACC_PTR_FP_SEG(x)     (((const unsigned __far*)&(x))[1])
-#  define ACC_PTR_MK_FP(s,o)    ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
-#endif
-
-#if !defined(lzo_uintptr_t)
-#  if defined(__LZO_MMODEL_HUGE)
-#    define lzo_uintptr_t       unsigned long
-#  elif 1 && defined(LZO_OS_OS400) && (LZO_SIZEOF_VOID_P == 16)
-#    define __LZO_UINTPTR_T_IS_POINTER 1
-     typedef char*              lzo_uintptr_t;
-#    define lzo_uintptr_t       lzo_uintptr_t
-#  elif (LZO_SIZEOF_SIZE_T == LZO_SIZEOF_VOID_P)
-#    define lzo_uintptr_t       size_t
-#  elif (LZO_SIZEOF_LONG == LZO_SIZEOF_VOID_P)
-#    define lzo_uintptr_t       unsigned long
-#  elif (LZO_SIZEOF_INT == LZO_SIZEOF_VOID_P)
-#    define lzo_uintptr_t       unsigned int
-#  elif (LZO_SIZEOF_LONG_LONG == LZO_SIZEOF_VOID_P)
-#    define lzo_uintptr_t       unsigned long long
-#  else
-#    define lzo_uintptr_t       size_t
-#  endif
-#endif
-LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
-
-#if 1 && !defined(LZO_CFG_FREESTANDING)
-#if 1 && !defined(HAVE_STRING_H)
-#define HAVE_STRING_H 1
-#endif
-#if 1 && !defined(HAVE_MEMCMP)
-#define HAVE_MEMCMP 1
-#endif
-#if 1 && !defined(HAVE_MEMCPY)
-#define HAVE_MEMCPY 1
-#endif
-#if 1 && !defined(HAVE_MEMMOVE)
-#define HAVE_MEMMOVE 1
-#endif
-#if 1 && !defined(HAVE_MEMSET)
-#define HAVE_MEMSET 1
-#endif
-#endif
-
-#if 1 && defined(HAVE_STRING_H)
-#include <string.h>
-#endif
-
-#if (LZO_CFG_FREESTANDING)
-#  undef HAVE_MEMCMP
-#  undef HAVE_MEMCPY
-#  undef HAVE_MEMMOVE
-#  undef HAVE_MEMSET
-#endif
-
-#if !(HAVE_MEMCMP)
-#  undef memcmp
-#  define memcmp(a,b,c)         lzo_memcmp(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
-#  undef lzo_memcmp
-#  define lzo_memcmp(a,b,c)     memcmp(a,b,c)
-#endif
-#if !(HAVE_MEMCPY)
-#  undef memcpy
-#  define memcpy(a,b,c)         lzo_memcpy(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
-#  undef lzo_memcpy
-#  define lzo_memcpy(a,b,c)     memcpy(a,b,c)
-#endif
-#if !(HAVE_MEMMOVE)
-#  undef memmove
-#  define memmove(a,b,c)        lzo_memmove(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
-#  undef lzo_memmove
-#  define lzo_memmove(a,b,c)    memmove(a,b,c)
-#endif
-#if !(HAVE_MEMSET)
-#  undef memset
-#  define memset(a,b,c)         lzo_memset(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
-#  undef lzo_memset
-#  define lzo_memset(a,b,c)     memset(a,b,c)
-#endif
-
-#undef NDEBUG
-#if (LZO_CFG_FREESTANDING)
-#  undef LZO_DEBUG
-#  define NDEBUG 1
-#  undef assert
-#  define assert(e) ((void)0)
-#else
-#  if !defined(LZO_DEBUG)
-#    define NDEBUG 1
-#  endif
-#  include <assert.h>
-#endif
-
-#if 0 && defined(__BOUNDS_CHECKING_ON)
-#  include <unchecked.h>
-#else
-#  define BOUNDS_CHECKING_OFF_DURING(stmt)      stmt
-#  define BOUNDS_CHECKING_OFF_IN_EXPR(expr)     (expr)
-#endif
-
-#if !defined(__lzo_inline)
-#  define __lzo_inline              /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-#  define __lzo_forceinline         /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-#  define __lzo_noinline            /*empty*/
-#endif
-
-#if (LZO_CFG_PGO)
-#  undef __acc_likely
-#  undef __acc_unlikely
-#  undef __lzo_likely
-#  undef __lzo_unlikely
-#  define __acc_likely(e)       (e)
-#  define __acc_unlikely(e)     (e)
-#  define __lzo_likely(e)       (e)
-#  define __lzo_unlikely(e)     (e)
-#endif
-
-#if 1
-#  define LZO_BYTE(x)       ((unsigned char) (x))
-#else
-#  define LZO_BYTE(x)       ((unsigned char) ((x) & 0xff))
-#endif
-
-#define LZO_MAX(a,b)        ((a) >= (b) ? (a) : (b))
-#define LZO_MIN(a,b)        ((a) <= (b) ? (a) : (b))
-#define LZO_MAX3(a,b,c)     ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c))
-#define LZO_MIN3(a,b,c)     ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c))
-
-#define lzo_sizeof(type)    ((lzo_uint) (sizeof(type)))
-
-#define LZO_HIGH(array)     ((lzo_uint) (sizeof(array)/sizeof(*(array))))
-
-#define LZO_SIZE(bits)      (1u << (bits))
-#define LZO_MASK(bits)      (LZO_SIZE(bits) - 1)
-
-#define LZO_LSIZE(bits)     (1ul << (bits))
-#define LZO_LMASK(bits)     (LZO_LSIZE(bits) - 1)
-
-#define LZO_USIZE(bits)     ((lzo_uint) 1 << (bits))
-#define LZO_UMASK(bits)     (LZO_USIZE(bits) - 1)
-
-#if !defined(DMUL)
-#if 0
-
-#  define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b)))
-#else
-#  define DMUL(a,b) ((lzo_xint) ((a) * (b)))
-#endif
-#endif
-
-#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386 || LZO_ARCH_POWERPC)
-#  if (LZO_SIZEOF_SHORT == 2)
-#    define LZO_UNALIGNED_OK_2 1
-#  endif
-#  if (LZO_SIZEOF_INT == 4)
-#    define LZO_UNALIGNED_OK_4 1
-#  endif
-#endif
-#if 1 && (LZO_ARCH_AMD64)
-#  if defined(LZO_UINT64_MAX)
-#    define LZO_UNALIGNED_OK_8 1
-#  endif
-#endif
-#if (LZO_CFG_NO_UNALIGNED)
-#  undef LZO_UNALIGNED_OK_2
-#  undef LZO_UNALIGNED_OK_4
-#  undef LZO_UNALIGNED_OK_8
-#endif
-
-#undef UA_GET16
-#undef UA_SET16
-#undef UA_COPY16
-#undef UA_GET32
-#undef UA_SET32
-#undef UA_COPY32
-#undef UA_GET64
-#undef UA_SET64
-#undef UA_COPY64
-#if defined(LZO_UNALIGNED_OK_2)
-   LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(unsigned short) == 2)
-#  if 1 && defined(ACC_UA_COPY16)
-#    define UA_GET16        ACC_UA_GET16
-#    define UA_SET16        ACC_UA_SET16
-#    define UA_COPY16       ACC_UA_COPY16
-#  else
-#    define UA_GET16(p)     (* (__lzo_ua_volatile const lzo_ushortp) (__lzo_ua_volatile const lzo_voidp) (p))
-#    define UA_SET16(p,v)   ((* (__lzo_ua_volatile lzo_ushortp) (__lzo_ua_volatile lzo_voidp) (p)) = (unsigned short) (v))
-#    define UA_COPY16(d,s)  UA_SET16(d, UA_GET16(s))
-#  endif
-#endif
-#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-   LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
-#  if 1 && defined(ACC_UA_COPY32)
-#    define UA_GET32        ACC_UA_GET32
-#    define UA_SET32        ACC_UA_SET32
-#    define UA_COPY32       ACC_UA_COPY32
-#  else
-#    define UA_GET32(p)     (* (__lzo_ua_volatile const lzo_uint32p) (__lzo_ua_volatile const lzo_voidp) (p))
-#    define UA_SET32(p,v)   ((* (__lzo_ua_volatile lzo_uint32p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint32) (v))
-#    define UA_COPY32(d,s)  UA_SET32(d, UA_GET32(s))
-#  endif
-#endif
-#if defined(LZO_UNALIGNED_OK_8)
-   LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64) == 8)
-#  if 1 && defined(ACC_UA_COPY64)
-#    define UA_GET64        ACC_UA_GET64
-#    define UA_SET64        ACC_UA_SET64
-#    define UA_COPY64       ACC_UA_COPY64
-#  else
-#    define UA_GET64(p)     (* (__lzo_ua_volatile const lzo_uint64p) (__lzo_ua_volatile const lzo_voidp) (p))
-#    define UA_SET64(p,v)   ((* (__lzo_ua_volatile lzo_uint64p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint64) (v))
-#    define UA_COPY64(d,s)  UA_SET64(d, UA_GET64(s))
-#  endif
-#endif
-
-#define MEMCPY8_DS(dest,src,len) \
-    lzo_memcpy(dest,src,len); dest += len; src += len
-
-#define BZERO8_PTR(s,l,n) \
-    lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
-
-#define MEMCPY_DS(dest,src,len) \
-    do *dest++ = *src++; while (--len > 0)
-
-LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
-
-#ifndef __LZO_PTR_H
-#define __LZO_PTR_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(lzo_uintptr_t)
-#  if (__LZO_MMODEL_HUGE)
-#    define lzo_uintptr_t   unsigned long
-#  else
-#    define lzo_uintptr_t   acc_uintptr_t
-#    ifdef __ACC_INTPTR_T_IS_POINTER
-#      define __LZO_UINTPTR_T_IS_POINTER 1
-#    endif
-#  endif
-#endif
-
-#if (LZO_ARCH_I086)
-#define PTR(a)              ((lzo_bytep) (a))
-#define PTR_ALIGNED_4(a)    ((ACC_PTR_FP_OFF(a) & 3) == 0)
-#define PTR_ALIGNED2_4(a,b) (((ACC_PTR_FP_OFF(a) | ACC_PTR_FP_OFF(b)) & 3) == 0)
-#elif (LZO_MM_PVP)
-#define PTR(a)              ((lzo_bytep) (a))
-#define PTR_ALIGNED_8(a)    ((((lzo_uintptr_t)(a)) >> 61) == 0)
-#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0)
-#else
-#define PTR(a)              ((lzo_uintptr_t) (a))
-#define PTR_LINEAR(a)       PTR(a)
-#define PTR_ALIGNED_4(a)    ((PTR_LINEAR(a) & 3) == 0)
-#define PTR_ALIGNED_8(a)    ((PTR_LINEAR(a) & 7) == 0)
-#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0)
-#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0)
-#endif
-
-#define PTR_LT(a,b)         (PTR(a) < PTR(b))
-#define PTR_GE(a,b)         (PTR(a) >= PTR(b))
-#define PTR_DIFF(a,b)       (PTR(a) - PTR(b))
-#define pd(a,b)             ((lzo_uint) ((a)-(b)))
-
-LZO_EXTERN(lzo_uintptr_t)
-__lzo_ptr_linear(const lzo_voidp ptr);
-
-typedef union
-{
-    char            a_char;
-    unsigned char   a_uchar;
-    short           a_short;
-    unsigned short  a_ushort;
-    int             a_int;
-    unsigned int    a_uint;
-    long            a_long;
-    unsigned long   a_ulong;
-    lzo_int         a_lzo_int;
-    lzo_uint        a_lzo_uint;
-    lzo_int32       a_lzo_int32;
-    lzo_uint32      a_lzo_uint32;
-#if defined(LZO_UINT64_MAX)
-    lzo_int64       a_lzo_int64;
-    lzo_uint64      a_lzo_uint64;
-#endif
-    ptrdiff_t       a_ptrdiff_t;
-    lzo_uintptr_t   a_lzo_uintptr_t;
-    lzo_voidp       a_lzo_voidp;
-    void *          a_void_p;
-    lzo_bytep       a_lzo_bytep;
-    lzo_bytepp      a_lzo_bytepp;
-    lzo_uintp       a_lzo_uintp;
-    lzo_uint *      a_lzo_uint_p;
-    lzo_uint32p     a_lzo_uint32p;
-    lzo_uint32 *    a_lzo_uint32_p;
-    unsigned char * a_uchar_p;
-    char *          a_char_p;
-}
-lzo_full_align_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#ifndef LZO_DETERMINISTIC
-#define LZO_DETERMINISTIC 1
-#endif
-
-#ifndef LZO_DICT_USE_PTR
-#define LZO_DICT_USE_PTR 1
-#if 0 && (LZO_ARCH_I086)
-#  undef LZO_DICT_USE_PTR
-#  define LZO_DICT_USE_PTR 0
-#endif
-#endif
-
-#if (LZO_DICT_USE_PTR)
-#  define lzo_dict_t    const lzo_bytep
-#  define lzo_dict_p    lzo_dict_t __LZO_MMODEL *
-#else
-#  define lzo_dict_t    lzo_uint
-#  define lzo_dict_p    lzo_dict_t __LZO_MMODEL *
-#endif
-
-#endif
-
-#if !defined(MINILZO_CFG_SKIP_LZO_PTR)
-
-LZO_PUBLIC(lzo_uintptr_t)
-__lzo_ptr_linear(const lzo_voidp ptr)
-{
-    lzo_uintptr_t p;
-
-#if (LZO_ARCH_I086)
-    p = (((lzo_uintptr_t)(ACC_PTR_FP_SEG(ptr))) << (16 - ACC_MM_AHSHIFT)) + (ACC_PTR_FP_OFF(ptr));
-#elif (LZO_MM_PVP)
-    p = (lzo_uintptr_t) (ptr);
-    p = (p << 3) | (p >> 61);
-#else
-    p = (lzo_uintptr_t) PTR_LINEAR(ptr);
-#endif
-
-    return p;
-}
-
-LZO_PUBLIC(unsigned)
-__lzo_align_gap(const lzo_voidp ptr, lzo_uint size)
-{
-#if defined(__LZO_UINTPTR_T_IS_POINTER)
-    size_t n = (size_t) ptr;
-    n = (((n + size - 1) / size) * size) - n;
-#else
-    lzo_uintptr_t p, n;
-    p = __lzo_ptr_linear(ptr);
-    n = (((p + size - 1) / size) * size) - p;
-#endif
-
-    assert(size > 0);
-    assert((long)n >= 0);
-    assert(n <= size);
-    return (unsigned)n;
-}
-
-#endif
-#if !defined(MINILZO_CFG_SKIP_LZO_UTIL)
-
-/* If you use the LZO library in a product, I would appreciate that you
- * keep this copyright string in the executable of your product.
- */
-
-static const char __lzo_copyright[] =
-#if !defined(__LZO_IN_MINLZO)
-    LZO_VERSION_STRING;
-#else
-    "\r\n\n"
-    "LZO data compression library.\n"
-    "$Copyright: LZO Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\n"
-    "<markus at oberhumer.com>\n"
-    "http://www.oberhumer.com $\n\n"
-    "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n"
-    "$Info: " LZO_INFO_STRING " $\n";
-#endif
-
-LZO_PUBLIC(const lzo_bytep)
-lzo_copyright(void)
-{
-#if (LZO_OS_DOS16 && LZO_CC_TURBOC)
-    return (lzo_voidp) __lzo_copyright;
-#else
-    return (const lzo_bytep) __lzo_copyright;
-#endif
-}
-
-LZO_PUBLIC(unsigned)
-lzo_version(void)
-{
-    return LZO_VERSION;
-}
-
-LZO_PUBLIC(const char *)
-lzo_version_string(void)
-{
-    return LZO_VERSION_STRING;
-}
-
-LZO_PUBLIC(const char *)
-lzo_version_date(void)
-{
-    return LZO_VERSION_DATE;
-}
-
-LZO_PUBLIC(const lzo_charp)
-_lzo_version_string(void)
-{
-    return LZO_VERSION_STRING;
-}
-
-LZO_PUBLIC(const lzo_charp)
-_lzo_version_date(void)
-{
-    return LZO_VERSION_DATE;
-}
-
-#define LZO_BASE 65521u
-#define LZO_NMAX 5552
-
-#define LZO_DO1(buf,i)  s1 += buf[i]; s2 += s1
-#define LZO_DO2(buf,i)  LZO_DO1(buf,i); LZO_DO1(buf,i+1);
-#define LZO_DO4(buf,i)  LZO_DO2(buf,i); LZO_DO2(buf,i+2);
-#define LZO_DO8(buf,i)  LZO_DO4(buf,i); LZO_DO4(buf,i+4);
-#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
-
-LZO_PUBLIC(lzo_uint32)
-lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len)
-{
-    lzo_uint32 s1 = adler & 0xffff;
-    lzo_uint32 s2 = (adler >> 16) & 0xffff;
-    unsigned k;
-
-    if (buf == NULL)
-        return 1;
-
-    while (len > 0)
-    {
-        k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX;
-        len -= k;
-        if (k >= 16) do
-        {
-            LZO_DO16(buf,0);
-            buf += 16;
-            k -= 16;
-        } while (k >= 16);
-        if (k != 0) do
-        {
-            s1 += *buf++;
-            s2 += s1;
-        } while (--k > 0);
-        s1 %= LZO_BASE;
-        s2 %= LZO_BASE;
-    }
-    return (s2 << 16) | s1;
-}
-
-#undef LZO_DO1
-#undef LZO_DO2
-#undef LZO_DO4
-#undef LZO_DO8
-#undef LZO_DO16
-
-#endif
-#if !defined(MINILZO_CFG_SKIP_LZO_STRING)
-#undef lzo_memcmp
-#undef lzo_memcpy
-#undef lzo_memmove
-#undef lzo_memset
-#if !defined(__LZO_MMODEL_HUGE)
-#  undef LZO_HAVE_MM_HUGE_PTR
-#endif
-#define lzo_hsize_t             lzo_uint
-#define lzo_hvoid_p             lzo_voidp
-#define lzo_hbyte_p             lzo_bytep
-#define LZOLIB_PUBLIC(r,f)      LZO_PUBLIC(r) f
-#define lzo_hmemcmp             lzo_memcmp
-#define lzo_hmemcpy             lzo_memcpy
-#define lzo_hmemmove            lzo_memmove
-#define lzo_hmemset             lzo_memset
-#define __LZOLIB_HMEMCPY_CH_INCLUDED 1
-#if !defined(LZOLIB_PUBLIC)
-#  define LZOLIB_PUBLIC(r,f)    r __LZOLIB_FUNCNAME(f)
-#endif
-LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len)
-{
-#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCMP)
-    const lzo_hbyte_p p1 = (const lzo_hbyte_p) s1;
-    const lzo_hbyte_p p2 = (const lzo_hbyte_p) s2;
-    if __lzo_likely(len > 0) do
-    {
-        int d = *p1 - *p2;
-        if (d != 0)
-            return d;
-        p1++; p2++;
-    } while __lzo_likely(--len > 0);
-    return 0;
-#else
-    return memcmp(s1, s2, len);
-#endif
-}
-LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len)
-{
-#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCPY)
-    lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
-    const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
-    if (!(len > 0) || p1 == p2)
-        return dest;
-    do
-        *p1++ = *p2++;
-    while __lzo_likely(--len > 0);
-    return dest;
-#else
-    return memcpy(dest, src, len);
-#endif
-}
-LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len)
-{
-#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMMOVE)
-    lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
-    const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
-    if (!(len > 0) || p1 == p2)
-        return dest;
-    if (p1 < p2)
-    {
-        do
-            *p1++ = *p2++;
-        while __lzo_likely(--len > 0);
-    }
-    else
-    {
-        p1 += len;
-        p2 += len;
-        do
-            *--p1 = *--p2;
-        while __lzo_likely(--len > 0);
-    }
-    return dest;
-#else
-    return memmove(dest, src, len);
-#endif
-}
-LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len)
-{
-#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
-    lzo_hbyte_p p = (lzo_hbyte_p) s;
-    if __lzo_likely(len > 0) do
-        *p++ = (unsigned char) c;
-    while __lzo_likely(--len > 0);
-    return s;
-#else
-    return memset(s, c, len);
-#endif
-}
-#undef LZOLIB_PUBLIC
-#endif
-#if !defined(MINILZO_CFG_SKIP_LZO_INIT)
-
-#if !defined(__LZO_IN_MINILZO)
-
-#define ACC_WANT_ACC_CHK_CH 1
-#undef ACCCHK_ASSERT
-
-    ACCCHK_ASSERT_IS_SIGNED_T(lzo_int)
-    ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
-
-    ACCCHK_ASSERT_IS_SIGNED_T(lzo_int32)
-    ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32)
-    ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
-    ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4)
-#if defined(LZO_UINT64_MAX)
-    ACCCHK_ASSERT(sizeof(lzo_uint64) == 8)
-    ACCCHK_ASSERT_IS_SIGNED_T(lzo_int64)
-    ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64)
-#endif
-
-#if !defined(__LZO_UINTPTR_T_IS_POINTER)
-    ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
-#endif
-    ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
-
-    ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
-    ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32))
-    ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint))
-    ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint))
-
-#endif
-#undef ACCCHK_ASSERT
-
-#define WANT_lzo_bitops_clz32 1
-#define WANT_lzo_bitops_clz64 1
-#define WANT_lzo_bitops_ctz32 1
-#define WANT_lzo_bitops_ctz64 1
-
-#if (defined(_WIN32) || defined(_WIN64)) && ((LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
-#include <intrin.h>
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) && 0
-#pragma intrinsic(_BitScanReverse)
-static __lzo_inline unsigned lzo_bitops_clz32(lzo_uint32 v)
-{
-    unsigned long r;
-    (void) _BitScanReverse(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_clz32 lzo_bitops_clz32
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX) && 0
-#pragma intrinsic(_BitScanReverse64)
-static __lzo_inline unsigned lzo_bitops_clz64(lzo_uint64 v)
-{
-    unsigned long r;
-    (void) _BitScanReverse64(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_clz64 lzo_bitops_clz64
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#pragma intrinsic(_BitScanForward)
-static __lzo_inline unsigned lzo_bitops_ctz32(lzo_uint32 v)
-{
-    unsigned long r;
-    (void) _BitScanForward(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_ctz32 lzo_bitops_ctz32
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#pragma intrinsic(_BitScanForward64)
-static __lzo_inline unsigned lzo_bitops_ctz64(lzo_uint64 v)
-{
-    unsigned long r;
-    (void) _BitScanForward64(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_ctz64 lzo_bitops_ctz64
-#endif
-
-#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32)
-#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v))
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_clz64(v) ((unsigned) __builtin_clzll(v))
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#define lzo_bitops_ctz32(v) ((unsigned) __builtin_ctz(v))
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_ctz64(v) ((unsigned) __builtin_ctzll(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount32)
-#define lzo_bitops_popcount32(v) ((unsigned) __builtin_popcount(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v))
-#endif
-#endif
-
-#if 0
-#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off)))
-#else
-static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off)
-{
-    return (lzo_voidp) ((lzo_bytep) ptr + off);
-}
-#endif
-
-LZO_PUBLIC(int)
-_lzo_config_check(void)
-{
-    lzo_bool r = 1;
-    union {
-        lzo_xint a[2]; unsigned char b[2*LZO_MAX(8,sizeof(lzo_xint))];
-#if defined(LZO_UNALIGNED_OK_8)
-        lzo_uint64 c[2];
-#endif
-        unsigned short x[2]; lzo_uint32 y[2]; lzo_uint z[2];
-    } u;
-    lzo_voidp p;
-
-    u.a[0] = u.a[1] = 0;
-    p = u2p(&u, 0);
-    r &= ((* (lzo_bytep) p) == 0);
-#if !defined(LZO_CFG_NO_CONFIG_CHECK)
-#if defined(LZO_ABI_BIG_ENDIAN)
-    u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128;
-    p = u2p(&u, 0);
-    r &= ((* (lzo_uintp) p) == 128);
-#endif
-#if defined(LZO_ABI_LITTLE_ENDIAN)
-    u.a[0] = u.a[1] = 0; u.b[0] = 128;
-    p = u2p(&u, 0);
-    r &= ((* (lzo_uintp) p) == 128);
-#endif
-#if defined(LZO_UNALIGNED_OK_2)
-    u.a[0] = u.a[1] = 0;
-    u.b[0] = 1; u.b[sizeof(unsigned short) + 1] = 2;
-    p = u2p(&u, 1);
-    r &= ((* (lzo_ushortp) p) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_4)
-    u.a[0] = u.a[1] = 0;
-    u.b[0] = 3; u.b[sizeof(lzo_uint32) + 1] = 4;
-    p = u2p(&u, 1);
-    r &= ((* (lzo_uint32p) p) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_8)
-    u.c[0] = u.c[1] = 0;
-    u.b[0] = 5; u.b[sizeof(lzo_uint64) + 1] = 6;
-    p = u2p(&u, 1);
-    r &= ((* (lzo_uint64p) p) == 0);
-#endif
-#if defined(lzo_bitops_clz32)
-    { unsigned i; lzo_uint32 v = 1;
-    for (i = 0; i < 32; i++, v <<= 1)
-        r &= lzo_bitops_clz32(v) == 31 - i;
-    }
-#endif
-#if defined(lzo_bitops_clz64)
-    { unsigned i; lzo_uint64 v = 1;
-    for (i = 0; i < 64; i++, v <<= 1)
-        r &= lzo_bitops_clz64(v) == 63 - i;
-    }
-#endif
-#if defined(lzo_bitops_ctz32)
-    { unsigned i; lzo_uint32 v = 1;
-    for (i = 0; i < 32; i++, v <<= 1)
-        r &= lzo_bitops_ctz32(v) == i;
-    }
-#endif
-#if defined(lzo_bitops_ctz64)
-    { unsigned i; lzo_uint64 v = 1;
-    for (i = 0; i < 64; i++, v <<= 1)
-        r &= lzo_bitops_ctz64(v) == i;
-    }
-#endif
-#endif
-
-    return r == 1 ? LZO_E_OK : LZO_E_ERROR;
-}
-
-LZO_PUBLIC(int)
-__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
-                          int s6, int s7, int s8, int s9)
-{
-    int r;
-
-#if defined(__LZO_IN_MINILZO)
-#elif (LZO_CC_MSC && ((_MSC_VER) < 700))
-#else
-#define ACC_WANT_ACC_CHK_CH 1
-#undef ACCCHK_ASSERT
-#define ACCCHK_ASSERT(expr)  LZO_COMPILE_TIME_ASSERT(expr)
-#endif
-#undef ACCCHK_ASSERT
-
-    if (v == 0)
-        return LZO_E_ERROR;
-
-    r = (s1 == -1 || s1 == (int) sizeof(short)) &&
-        (s2 == -1 || s2 == (int) sizeof(int)) &&
-        (s3 == -1 || s3 == (int) sizeof(long)) &&
-        (s4 == -1 || s4 == (int) sizeof(lzo_uint32)) &&
-        (s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
-        (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
-        (s7 == -1 || s7 == (int) sizeof(char *)) &&
-        (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) &&
-        (s9 == -1 || s9 == (int) sizeof(lzo_callback_t));
-    if (!r)
-        return LZO_E_ERROR;
-
-    r = _lzo_config_check();
-    if (r != LZO_E_OK)
-        return r;
-
-    return r;
-}
-
-#if !defined(__LZO_IN_MINILZO)
-
-#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD)
-
-#if 0
-BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment,
-                          WORD wHeapSize, LPSTR lpszCmdLine )
-#else
-int __far __pascal LibMain ( int a, short b, short c, long d )
-#endif
-{
-    LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d);
-    return 1;
-}
-
-#endif
-
-#endif
-
-#endif
-
-#define LZO1X           1
-#define LZO_EOF_CODE    1
-#define M2_MAX_OFFSET   0x0800
-
-#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS)
-
-#if 1 && defined(UA_GET32)
-#undef  LZO_DICT_USE_PTR
-#define LZO_DICT_USE_PTR 0
-#undef  lzo_dict_t
-#define lzo_dict_t unsigned short
-#endif
-
-#define LZO_NEED_DICT_H 1
-#ifndef D_BITS
-#define D_BITS          14
-#endif
-#define D_INDEX1(d,p)       d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
-#define D_INDEX2(d,p)       d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
-#if 1
-#define DINDEX(dv,p)        DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
-#else
-#define DINDEX(dv,p)        DM((dv) + ((dv) >> (32-D_BITS)))
-#endif
-
-#ifndef __LZO_CONFIG1X_H
-#define __LZO_CONFIG1X_H 1
-
-#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
-#  define LZO1X 1
-#endif
-
-#if !defined(__LZO_IN_MINILZO)
-#include "lzo/lzo1x.h"
-#endif
-
-#ifndef LZO_EOF_CODE
-#define LZO_EOF_CODE 1
-#endif
-#undef LZO_DETERMINISTIC
-
-#define M1_MAX_OFFSET   0x0400
-#ifndef M2_MAX_OFFSET
-#define M2_MAX_OFFSET   0x0800
-#endif
-#define M3_MAX_OFFSET   0x4000
-#define M4_MAX_OFFSET   0xbfff
-
-#define MX_MAX_OFFSET   (M1_MAX_OFFSET + M2_MAX_OFFSET)
-
-#define M1_MIN_LEN      2
-#define M1_MAX_LEN      2
-#define M2_MIN_LEN      3
-#ifndef M2_MAX_LEN
-#define M2_MAX_LEN      8
-#endif
-#define M3_MIN_LEN      3
-#define M3_MAX_LEN      33
-#define M4_MIN_LEN      3
-#define M4_MAX_LEN      9
-
-#define M1_MARKER       0
-#define M2_MARKER       64
-#define M3_MARKER       32
-#define M4_MARKER       16
-
-#ifndef MIN_LOOKAHEAD
-#define MIN_LOOKAHEAD       (M2_MAX_LEN + 1)
-#endif
-
-#if defined(LZO_NEED_DICT_H)
-
-#ifndef LZO_HASH
-#define LZO_HASH            LZO_HASH_LZO_INCREMENTAL_B
-#endif
-#define DL_MIN_LEN          M2_MIN_LEN
-
-#ifndef __LZO_DICT_H
-#define __LZO_DICT_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(D_BITS) && defined(DBITS)
-#  define D_BITS        DBITS
-#endif
-#if !defined(D_BITS)
-#  error "D_BITS is not defined"
-#endif
-#if (D_BITS < 16)
-#  define D_SIZE        LZO_SIZE(D_BITS)
-#  define D_MASK        LZO_MASK(D_BITS)
-#else
-#  define D_SIZE        LZO_USIZE(D_BITS)
-#  define D_MASK        LZO_UMASK(D_BITS)
-#endif
-#define D_HIGH          ((D_MASK >> 1) + 1)
-
-#if !defined(DD_BITS)
-#  define DD_BITS       0
-#endif
-#define DD_SIZE         LZO_SIZE(DD_BITS)
-#define DD_MASK         LZO_MASK(DD_BITS)
-
-#if !defined(DL_BITS)
-#  define DL_BITS       (D_BITS - DD_BITS)
-#endif
-#if (DL_BITS < 16)
-#  define DL_SIZE       LZO_SIZE(DL_BITS)
-#  define DL_MASK       LZO_MASK(DL_BITS)
-#else
-#  define DL_SIZE       LZO_USIZE(DL_BITS)
-#  define DL_MASK       LZO_UMASK(DL_BITS)
-#endif
-
-#if (D_BITS != DL_BITS + DD_BITS)
-#  error "D_BITS does not match"
-#endif
-#if (D_BITS < 6 || D_BITS > 18)
-#  error "invalid D_BITS"
-#endif
-#if (DL_BITS < 6 || DL_BITS > 20)
-#  error "invalid DL_BITS"
-#endif
-#if (DD_BITS < 0 || DD_BITS > 6)
-#  error "invalid DD_BITS"
-#endif
-
-#if !defined(DL_MIN_LEN)
-#  define DL_MIN_LEN    3
-#endif
-#if !defined(DL_SHIFT)
-#  define DL_SHIFT      ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN)
-#endif
-
-#define LZO_HASH_GZIP                   1
-#define LZO_HASH_GZIP_INCREMENTAL       2
-#define LZO_HASH_LZO_INCREMENTAL_A      3
-#define LZO_HASH_LZO_INCREMENTAL_B      4
-
-#if !defined(LZO_HASH)
-#  error "choose a hashing strategy"
-#endif
-
-#undef DM
-#undef DX
-
-#if (DL_MIN_LEN == 3)
-#  define _DV2_A(p,shift1,shift2) \
-        (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2])
-#  define _DV2_B(p,shift1,shift2) \
-        (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0])
-#  define _DV3_B(p,shift1,shift2,shift3) \
-        ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0])
-#elif (DL_MIN_LEN == 2)
-#  define _DV2_A(p,shift1,shift2) \
-        (( (lzo_xint)(p[0]) << shift1) ^ p[1])
-#  define _DV2_B(p,shift1,shift2) \
-        (( (lzo_xint)(p[1]) << shift1) ^ p[2])
-#else
-#  error "invalid DL_MIN_LEN"
-#endif
-#define _DV_A(p,shift)      _DV2_A(p,shift,shift)
-#define _DV_B(p,shift)      _DV2_B(p,shift,shift)
-#define DA2(p,s1,s2) \
-        (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0])
-#define DS2(p,s1,s2) \
-        (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0])
-#define DX2(p,s1,s2) \
-        (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
-#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0])
-#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0])
-#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
-#define DMS(v,s)        ((lzo_uint) (((v) & (D_MASK >> (s))) << (s)))
-#define DM(v)           DMS(v,0)
-
-#if (LZO_HASH == LZO_HASH_GZIP)
-#  define _DINDEX(dv,p)     (_DV_A((p),DL_SHIFT))
-
-#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
-#  define __LZO_HASH_INCREMENTAL 1
-#  define DVAL_FIRST(dv,p)  dv = _DV_A((p),DL_SHIFT)
-#  define DVAL_NEXT(dv,p)   dv = (((dv) << DL_SHIFT) ^ p[2])
-#  define _DINDEX(dv,p)     (dv)
-#  define DVAL_LOOKAHEAD    DL_MIN_LEN
-
-#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A)
-#  define __LZO_HASH_INCREMENTAL 1
-#  define DVAL_FIRST(dv,p)  dv = _DV_A((p),5)
-#  define DVAL_NEXT(dv,p) \
-                dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
-#  define _DINDEX(dv,p)     ((DMUL(0x9f5f,dv)) >> 5)
-#  define DVAL_LOOKAHEAD    DL_MIN_LEN
-
-#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
-#  define __LZO_HASH_INCREMENTAL 1
-#  define DVAL_FIRST(dv,p)  dv = _DV_B((p),5)
-#  define DVAL_NEXT(dv,p) \
-                dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5)))
-#  define _DINDEX(dv,p)     ((DMUL(0x9f5f,dv)) >> 5)
-#  define DVAL_LOOKAHEAD    DL_MIN_LEN
-
-#else
-#  error "choose a hashing strategy"
-#endif
-
-#ifndef DINDEX
-#define DINDEX(dv,p)        ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS)
-#endif
-#if !defined(DINDEX1) && defined(D_INDEX1)
-#define DINDEX1             D_INDEX1
-#endif
-#if !defined(DINDEX2) && defined(D_INDEX2)
-#define DINDEX2             D_INDEX2
-#endif
-
-#if !defined(__LZO_HASH_INCREMENTAL)
-#  define DVAL_FIRST(dv,p)  ((void) 0)
-#  define DVAL_NEXT(dv,p)   ((void) 0)
-#  define DVAL_LOOKAHEAD    0
-#endif
-
-#if !defined(DVAL_ASSERT)
-#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG)
-#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_LLVM)
-static void __attribute__((__unused__))
-#else
-static void
-#endif
-DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
-{
-    lzo_xint df;
-    DVAL_FIRST(df,(p));
-    assert(DINDEX(dv,p) == DINDEX(df,p));
-}
-#else
-#  define DVAL_ASSERT(dv,p) ((void) 0)
-#endif
-#endif
-
-#if (LZO_DICT_USE_PTR)
-#  define DENTRY(p,in)                          (p)
-#  define GINDEX(m_pos,m_off,dict,dindex,in)    m_pos = dict[dindex]
-#else
-#  define DENTRY(p,in)                          ((lzo_dict_t) pd(p, in))
-#  define GINDEX(m_pos,m_off,dict,dindex,in)    m_off = dict[dindex]
-#endif
-
-#if (DD_BITS == 0)
-
-#  define UPDATE_D(dict,drun,dv,p,in)       dict[ DINDEX(dv,p) ] = DENTRY(p,in)
-#  define UPDATE_I(dict,drun,index,p,in)    dict[index] = DENTRY(p,in)
-#  define UPDATE_P(ptr,drun,p,in)           (ptr)[0] = DENTRY(p,in)
-
-#else
-
-#  define UPDATE_D(dict,drun,dv,p,in)   \
-        dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
-#  define UPDATE_I(dict,drun,index,p,in)    \
-        dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
-#  define UPDATE_P(ptr,drun,p,in)   \
-        (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK
-
-#endif
-
-#if (LZO_DICT_USE_PTR)
-
-#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
-        (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset)
-
-#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
-    (BOUNDS_CHECKING_OFF_IN_EXPR(( \
-        m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \
-        PTR_LT(m_pos,in) || \
-        (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) == 0 || \
-         m_off > max_offset )))
-
-#else
-
-#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
-        (m_off == 0 || \
-         ((m_off = pd(ip, in) - m_off) > max_offset) || \
-         (m_pos = (ip) - (m_off), 0) )
-
-#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
-        (pd(ip, in) <= m_off || \
-         ((m_off = pd(ip, in) - m_off) > max_offset) || \
-         (m_pos = (ip) - (m_off), 0) )
-
-#endif
-
-#if (LZO_DETERMINISTIC)
-#  define LZO_CHECK_MPOS    LZO_CHECK_MPOS_DET
-#else
-#  define LZO_CHECK_MPOS    LZO_CHECK_MPOS_NON_DET
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#endif
-
-#endif
-
-#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
-
-#ifndef DO_COMPRESS
-#define DO_COMPRESS     lzo1x_1_compress
-#endif
-
-#if 1 && defined(DO_COMPRESS) && !defined(do_compress)
-#  define do_compress       LZO_CPP_ECONCAT2(DO_COMPRESS,_core)
-#endif
-
-#if defined(UA_GET64) && (LZO_ABI_BIG_ENDIAN)
-#  define WANT_lzo_bitops_clz64 1
-#elif defined(UA_GET64) && (LZO_ABI_LITTLE_ENDIAN)
-#  define WANT_lzo_bitops_ctz64 1
-#elif defined(UA_GET32) && (LZO_ABI_BIG_ENDIAN)
-#  define WANT_lzo_bitops_clz32 1
-#elif defined(UA_GET32) && (LZO_ABI_LITTLE_ENDIAN)
-#  define WANT_lzo_bitops_ctz32 1
-#endif
-
-#if (defined(_WIN32) || defined(_WIN64)) && ((LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
-#include <intrin.h>
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) && 0
-#pragma intrinsic(_BitScanReverse)
-static __lzo_inline unsigned lzo_bitops_clz32(lzo_uint32 v)
-{
-    unsigned long r;
-    (void) _BitScanReverse(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_clz32 lzo_bitops_clz32
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX) && 0
-#pragma intrinsic(_BitScanReverse64)
-static __lzo_inline unsigned lzo_bitops_clz64(lzo_uint64 v)
-{
-    unsigned long r;
-    (void) _BitScanReverse64(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_clz64 lzo_bitops_clz64
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#pragma intrinsic(_BitScanForward)
-static __lzo_inline unsigned lzo_bitops_ctz32(lzo_uint32 v)
-{
-    unsigned long r;
-    (void) _BitScanForward(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_ctz32 lzo_bitops_ctz32
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#pragma intrinsic(_BitScanForward64)
-static __lzo_inline unsigned lzo_bitops_ctz64(lzo_uint64 v)
-{
-    unsigned long r;
-    (void) _BitScanForward64(&r, v);
-    return (unsigned) r;
-}
-#define lzo_bitops_ctz64 lzo_bitops_ctz64
-#endif
-
-#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32)
-#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v))
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_clz64(v) ((unsigned) __builtin_clzll(v))
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#define lzo_bitops_ctz32(v) ((unsigned) __builtin_ctz(v))
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_ctz64(v) ((unsigned) __builtin_ctzll(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount32)
-#define lzo_bitops_popcount32(v) ((unsigned) __builtin_popcount(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v))
-#endif
-#endif
-
-static __lzo_noinline lzo_uint
-do_compress ( const lzo_bytep in , lzo_uint  in_len,
-                    lzo_bytep out, lzo_uintp out_len,
-                    lzo_uint  ti,  lzo_voidp wrkmem)
-{
-    register const lzo_bytep ip;
-    lzo_bytep op;
-    const lzo_bytep const in_end = in + in_len;
-    const lzo_bytep const ip_end = in + in_len - 20;
-    const lzo_bytep ii;
-    lzo_dict_p const dict = (lzo_dict_p) wrkmem;
-
-    op = out;
-    ip = in;
-    ii = ip;
-
-    ip += ti < 4 ? 4 - ti : 0;
-    for (;;)
-    {
-        const lzo_bytep m_pos;
-#if !(LZO_DETERMINISTIC)
-        LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
-        lzo_uint m_len;
-        lzo_uint dindex;
-next:
-        if __lzo_unlikely(ip >= ip_end)
-            break;
-        DINDEX1(dindex,ip);
-        GINDEX(m_pos,m_off,dict,dindex,in);
-        if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
-            goto literal;
-#if 1
-        if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
-            goto try_match;
-        DINDEX2(dindex,ip);
-#endif
-        GINDEX(m_pos,m_off,dict,dindex,in);
-        if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
-            goto literal;
-        if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
-            goto try_match;
-        goto literal;
-
-try_match:
-#if defined(UA_GET32)
-        if (UA_GET32(m_pos) != UA_GET32(ip))
-#else
-        if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3])
-#endif
-        {
-literal:
-            UPDATE_I(dict,0,dindex,ip,in);
-            ip += 1 + ((ip - ii) >> 5);
-            continue;
-        }
-        UPDATE_I(dict,0,dindex,ip,in);
-#else
-        lzo_uint m_off;
-        lzo_uint m_len;
-        {
-        lzo_uint32 dv;
-        lzo_uint dindex;
-literal:
-        ip += 1 + ((ip - ii) >> 5);
-next:
-        if __lzo_unlikely(ip >= ip_end)
-            break;
-        dv = UA_GET32(ip);
-        dindex = DINDEX(dv,ip);
-        GINDEX(m_off,m_pos,in+dict,dindex,in);
-        UPDATE_I(dict,0,dindex,ip,in);
-        if __lzo_unlikely(dv != UA_GET32(m_pos))
-            goto literal;
-        }
-#endif
-
-        ii -= ti; ti = 0;
-        {
-        register lzo_uint t = pd(ip,ii);
-        if (t != 0)
-        {
-            if (t <= 3)
-            {
-                op[-2] |= LZO_BYTE(t);
-#if defined(UA_COPY32)
-                UA_COPY32(op, ii);
-                op += t;
-#else
-                { do *op++ = *ii++; while (--t > 0); }
-#endif
-            }
-#if defined(UA_COPY32) || defined(UA_COPY64)
-            else if (t <= 16)
-            {
-                *op++ = LZO_BYTE(t - 3);
-#if defined(UA_COPY64)
-                UA_COPY64(op, ii);
-                UA_COPY64(op+8, ii+8);
-#else
-                UA_COPY32(op, ii);
-                UA_COPY32(op+4, ii+4);
-                UA_COPY32(op+8, ii+8);
-                UA_COPY32(op+12, ii+12);
-#endif
-                op += t;
-            }
-#endif
-            else
-            {
-                if (t <= 18)
-                    *op++ = LZO_BYTE(t - 3);
-                else
-                {
-                    register lzo_uint tt = t - 18;
-                    *op++ = 0;
-                    while __lzo_unlikely(tt > 255)
-                    {
-                        tt -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
-                        * (volatile unsigned char *) op++ = 0;
-#else
-                        *op++ = 0;
-#endif
-                    }
-                    assert(tt > 0);
-                    *op++ = LZO_BYTE(tt);
-                }
-#if defined(UA_COPY32) || defined(UA_COPY64)
-                do {
-#if defined(UA_COPY64)
-                    UA_COPY64(op, ii);
-                    UA_COPY64(op+8, ii+8);
-#else
-                    UA_COPY32(op, ii);
-                    UA_COPY32(op+4, ii+4);
-                    UA_COPY32(op+8, ii+8);
-                    UA_COPY32(op+12, ii+12);
-#endif
-                    op += 16; ii += 16; t -= 16;
-                } while (t >= 16); if (t > 0)
-#endif
-                { do *op++ = *ii++; while (--t > 0); }
-            }
-        }
-        }
-        m_len = 4;
-        {
-#if defined(UA_GET64)
-        lzo_uint64 v;
-        v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
-        if __lzo_unlikely(v == 0) {
-            do {
-                m_len += 8;
-                v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
-                if __lzo_unlikely(ip + m_len >= ip_end)
-                    goto m_len_done;
-            } while (v == 0);
-        }
-#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz64)
-        m_len += lzo_bitops_clz64(v) / CHAR_BIT;
-#elif (LZO_ABI_BIG_ENDIAN)
-        if ((v >> (64 - CHAR_BIT)) == 0) do {
-            v <<= CHAR_BIT;
-            m_len += 1;
-        } while ((v >> (64 - CHAR_BIT)) == 0);
-#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz64)
-        m_len += lzo_bitops_ctz64(v) / CHAR_BIT;
-#elif (LZO_ABI_LITTLE_ENDIAN)
-        if ((v & UCHAR_MAX) == 0) do {
-            v >>= CHAR_BIT;
-            m_len += 1;
-        } while ((v & UCHAR_MAX) == 0);
-#else
-        if (ip[m_len] == m_pos[m_len]) do {
-            m_len += 1;
-        } while (ip[m_len] == m_pos[m_len]);
-#endif
-#elif defined(UA_GET32)
-        lzo_uint32 v;
-        v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
-        if __lzo_unlikely(v == 0) {
-            do {
-                m_len += 4;
-                v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
-                if __lzo_unlikely(ip + m_len >= ip_end)
-                    goto m_len_done;
-            } while (v == 0);
-        }
-#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz32)
-        m_len += lzo_bitops_clz32(v) / CHAR_BIT;
-#elif (LZO_ABI_BIG_ENDIAN)
-        if ((v >> (32 - CHAR_BIT)) == 0) do {
-            v <<= CHAR_BIT;
-            m_len += 1;
-        } while ((v >> (32 - CHAR_BIT)) == 0);
-#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz32)
-        m_len += lzo_bitops_ctz32(v) / CHAR_BIT;
-#elif (LZO_ABI_LITTLE_ENDIAN)
-        if ((v & UCHAR_MAX) == 0) do {
-            v >>= CHAR_BIT;
-            m_len += 1;
-        } while ((v & UCHAR_MAX) == 0);
-#else
-        if (ip[m_len] == m_pos[m_len]) do {
-            m_len += 1;
-        } while (ip[m_len] == m_pos[m_len]);
-#endif
-#else
-        if __lzo_unlikely(ip[m_len] == m_pos[m_len]) {
-            do {
-                m_len += 1;
-                if __lzo_unlikely(ip + m_len >= ip_end)
-                    goto m_len_done;
-            } while (ip[m_len] == m_pos[m_len]);
-        }
-#endif
-        }
-m_len_done:
-        m_off = pd(ip,m_pos);
-        ip += m_len;
-        ii = ip;
-        if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
-        {
-            m_off -= 1;
-#if defined(LZO1X)
-            *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
-            *op++ = LZO_BYTE(m_off >> 3);
-#elif defined(LZO1Y)
-            *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
-            *op++ = LZO_BYTE(m_off >> 2);
-#endif
-        }
-        else if (m_off <= M3_MAX_OFFSET)
-        {
-            m_off -= 1;
-            if (m_len <= M3_MAX_LEN)
-                *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
-            else
-            {
-                m_len -= M3_MAX_LEN;
-                *op++ = M3_MARKER | 0;
-                while __lzo_unlikely(m_len > 255)
-                {
-                    m_len -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
-                    * (volatile unsigned char *) op++ = 0;
-#else
-                    *op++ = 0;
-#endif
-                }
-                *op++ = LZO_BYTE(m_len);
-            }
-            *op++ = LZO_BYTE(m_off << 2);
-            *op++ = LZO_BYTE(m_off >> 6);
-        }
-        else
-        {
-            m_off -= 0x4000;
-            if (m_len <= M4_MAX_LEN)
-                *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8) | (m_len - 2));
-            else
-            {
-                m_len -= M4_MAX_LEN;
-                *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8));
-                while __lzo_unlikely(m_len > 255)
-                {
-                    m_len -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
-                    * (volatile unsigned char *) op++ = 0;
-#else
-                    *op++ = 0;
-#endif
-                }
-                *op++ = LZO_BYTE(m_len);
-            }
-            *op++ = LZO_BYTE(m_off << 2);
-            *op++ = LZO_BYTE(m_off >> 6);
-        }
-        goto next;
-    }
-
-    *out_len = pd(op, out);
-    return pd(in_end,ii-ti);
-}
-
-LZO_PUBLIC(int)
-DO_COMPRESS      ( const lzo_bytep in , lzo_uint  in_len,
-                         lzo_bytep out, lzo_uintp out_len,
-                         lzo_voidp wrkmem )
-{
-    const lzo_bytep ip = in;
-    lzo_bytep op = out;
-    lzo_uint l = in_len;
-    lzo_uint t = 0;
-
-    while (l > 20)
-    {
-        lzo_uint ll = l;
-        lzo_uintptr_t ll_end;
-#if 0 || (LZO_DETERMINISTIC)
-        ll = LZO_MIN(ll, 49152);
-#endif
-        ll_end = (lzo_uintptr_t)ip + ll;
-        if ((ll_end + ((t + ll) >> 5)) <= ll_end || (const lzo_bytep)(ll_end + ((t + ll) >> 5)) <= ip + ll)
-            break;
-#if (LZO_DETERMINISTIC)
-        lzo_memset(wrkmem, 0, ((lzo_uint)1 << D_BITS) * sizeof(lzo_dict_t));
-#endif
-        t = do_compress(ip,ll,op,out_len,t,wrkmem);
-        ip += ll;
-        op += *out_len;
-        l  -= ll;
-    }
-    t += l;
-
-    if (t > 0)
-    {
-        const lzo_bytep ii = in + in_len - t;
-
-        if (op == out && t <= 238)
-            *op++ = LZO_BYTE(17 + t);
-        else if (t <= 3)
-            op[-2] |= LZO_BYTE(t);
-        else if (t <= 18)
-            *op++ = LZO_BYTE(t - 3);
-        else
-        {
-            lzo_uint tt = t - 18;
-
-            *op++ = 0;
-            while (tt > 255)
-            {
-                tt -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
-
-                * (volatile unsigned char *) op++ = 0;
-#else
-                *op++ = 0;
-#endif
-            }
-            assert(tt > 0);
-            *op++ = LZO_BYTE(tt);
-        }
-        do *op++ = *ii++; while (--t > 0);
-    }
-
-    *op++ = M4_MARKER | 1;
-    *op++ = 0;
-    *op++ = 0;
-
-    *out_len = pd(op, out);
-    return LZO_E_OK;
-}
-
-#endif
-
-#undef do_compress
-#undef DO_COMPRESS
-#undef LZO_HASH
-
-#undef LZO_TEST_OVERRUN
-#undef DO_DECOMPRESS
-#define DO_DECOMPRESS       lzo1x_decompress
-
-#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS)
-
-#if defined(LZO_TEST_OVERRUN)
-#  if !defined(LZO_TEST_OVERRUN_INPUT)
-#    define LZO_TEST_OVERRUN_INPUT       2
-#  endif
-#  if !defined(LZO_TEST_OVERRUN_OUTPUT)
-#    define LZO_TEST_OVERRUN_OUTPUT      2
-#  endif
-#  if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-#    define LZO_TEST_OVERRUN_LOOKBEHIND  1
-#  endif
-#endif
-
-#undef TEST_IP
-#undef TEST_OP
-#undef TEST_LB
-#undef TEST_LBO
-#undef NEED_IP
-#undef NEED_OP
-#undef HAVE_TEST_IP
-#undef HAVE_TEST_OP
-#undef HAVE_NEED_IP
-#undef HAVE_NEED_OP
-#undef HAVE_ANY_IP
-#undef HAVE_ANY_OP
-
-#if defined(LZO_TEST_OVERRUN_INPUT)
-#  if (LZO_TEST_OVERRUN_INPUT >= 1)
-#    define TEST_IP             (ip < ip_end)
-#  endif
-#  if (LZO_TEST_OVERRUN_INPUT >= 2)
-#    define NEED_IP(x) \
-            if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x))  goto input_overrun
-#  endif
-#endif
-
-#if defined(LZO_TEST_OVERRUN_OUTPUT)
-#  if (LZO_TEST_OVERRUN_OUTPUT >= 1)
-#    define TEST_OP             (op <= op_end)
-#  endif
-#  if (LZO_TEST_OVERRUN_OUTPUT >= 2)
-#    undef TEST_OP
-#    define NEED_OP(x) \
-            if ((lzo_uint)(op_end - op) < (lzo_uint)(x))  goto output_overrun
-#  endif
-#endif
-
-#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-#  define TEST_LB(m_pos)        if (m_pos < out || m_pos >= op) goto lookbehind_overrun
-#  define TEST_LBO(m_pos,o)     if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun
-#else
-#  define TEST_LB(m_pos)        ((void) 0)
-#  define TEST_LBO(m_pos,o)     ((void) 0)
-#endif
-
-#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
-#  define TEST_IP               (ip < ip_end)
-#endif
-
-#if defined(TEST_IP)
-#  define HAVE_TEST_IP 1
-#else
-#  define TEST_IP               1
-#endif
-#if defined(TEST_OP)
-#  define HAVE_TEST_OP 1
-#else
-#  define TEST_OP               1
-#endif
-
-#if defined(NEED_IP)
-#  define HAVE_NEED_IP 1
-#else
-#  define NEED_IP(x)            ((void) 0)
-#endif
-#if defined(NEED_OP)
-#  define HAVE_NEED_OP 1
-#else
-#  define NEED_OP(x)            ((void) 0)
-#endif
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-#  define HAVE_ANY_IP 1
-#endif
-#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-#  define HAVE_ANY_OP 1
-#endif
-
-#if defined(DO_DECOMPRESS)
-LZO_PUBLIC(int)
-DO_DECOMPRESS  ( const lzo_bytep in , lzo_uint  in_len,
-                       lzo_bytep out, lzo_uintp out_len,
-                       lzo_voidp wrkmem )
-#endif
-{
-    register lzo_bytep op;
-    register const lzo_bytep ip;
-    register lzo_uint t;
-#if defined(COPY_DICT)
-    lzo_uint m_off;
-    const lzo_bytep dict_end;
-#else
-    register const lzo_bytep m_pos;
-#endif
-
-    const lzo_bytep const ip_end = in + in_len;
-#if defined(HAVE_ANY_OP)
-    lzo_bytep const op_end = out + *out_len;
-#endif
-#if defined(LZO1Z)
-    lzo_uint last_m_off = 0;
-#endif
-
-    LZO_UNUSED(wrkmem);
-
-#if defined(COPY_DICT)
-    if (dict)
-    {
-        if (dict_len > M4_MAX_OFFSET)
-        {
-            dict += dict_len - M4_MAX_OFFSET;
-            dict_len = M4_MAX_OFFSET;
-        }
-        dict_end = dict + dict_len;
-    }
-    else
-    {
-        dict_len = 0;
-        dict_end = NULL;
-    }
-#endif
-
-    *out_len = 0;
-
-    op = out;
-    ip = in;
-
-    if (*ip > 17)
-    {
-        t = *ip++ - 17;
-        if (t < 4)
-            goto match_next;
-        assert(t > 0); NEED_OP(t); NEED_IP(t+1);
-        do *op++ = *ip++; while (--t > 0);
-        goto first_literal_run;
-    }
-
-    while (TEST_IP && TEST_OP)
-    {
-        t = *ip++;
-        if (t >= 16)
-            goto match;
-        if (t == 0)
-        {
-            NEED_IP(1);
-            while (*ip == 0)
-            {
-                t += 255;
-                ip++;
-                NEED_IP(1);
-            }
-            t += 15 + *ip++;
-        }
-        assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
-        t += 3;
-        if (t >= 8) do
-        {
-            UA_COPY64(op,ip);
-            op += 8; ip += 8; t -= 8;
-        } while (t >= 8);
-        if (t >= 4)
-        {
-            UA_COPY32(op,ip);
-            op += 4; ip += 4; t -= 4;
-        }
-        if (t > 0)
-        {
-            *op++ = *ip++;
-            if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
-        }
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-        if (PTR_ALIGNED2_4(op,ip))
-        {
-#endif
-        UA_COPY32(op,ip);
-        op += 4; ip += 4;
-        if (--t > 0)
-        {
-            if (t >= 4)
-            {
-                do {
-                    UA_COPY32(op,ip);
-                    op += 4; ip += 4; t -= 4;
-                } while (t >= 4);
-                if (t > 0) do *op++ = *ip++; while (--t > 0);
-            }
-            else
-                do *op++ = *ip++; while (--t > 0);
-        }
-#if !defined(LZO_UNALIGNED_OK_4)
-        }
-        else
-#endif
-#endif
-#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
-        {
-            *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
-            do *op++ = *ip++; while (--t > 0);
-        }
-#endif
-
-first_literal_run:
-
-        t = *ip++;
-        if (t >= 16)
-            goto match;
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-        m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
-        last_m_off = m_off;
-#else
-        m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
-#endif
-        NEED_OP(3);
-        t = 3; COPY_DICT(t,m_off)
-#else
-#if defined(LZO1Z)
-        t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
-        m_pos = op - t;
-        last_m_off = t;
-#else
-        m_pos = op - (1 + M2_MAX_OFFSET);
-        m_pos -= t >> 2;
-        m_pos -= *ip++ << 2;
-#endif
-        TEST_LB(m_pos); NEED_OP(3);
-        *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
-#endif
-        goto match_done;
-
-        do {
-match:
-            if (t >= 64)
-            {
-#if defined(COPY_DICT)
-#if defined(LZO1X)
-                m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
-                t = (t >> 5) - 1;
-#elif defined(LZO1Y)
-                m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
-                t = (t >> 4) - 3;
-#elif defined(LZO1Z)
-                m_off = t & 0x1f;
-                if (m_off >= 0x1c)
-                    m_off = last_m_off;
-                else
-                {
-                    m_off = 1 + (m_off << 6) + (*ip++ >> 2);
-                    last_m_off = m_off;
-                }
-                t = (t >> 5) - 1;
-#endif
-#else
-#if defined(LZO1X)
-                m_pos = op - 1;
-                m_pos -= (t >> 2) & 7;
-                m_pos -= *ip++ << 3;
-                t = (t >> 5) - 1;
-#elif defined(LZO1Y)
-                m_pos = op - 1;
-                m_pos -= (t >> 2) & 3;
-                m_pos -= *ip++ << 2;
-                t = (t >> 4) - 3;
-#elif defined(LZO1Z)
-                {
-                    lzo_uint off = t & 0x1f;
-                    m_pos = op;
-                    if (off >= 0x1c)
-                    {
-                        assert(last_m_off > 0);
-                        m_pos -= last_m_off;
-                    }
-                    else
-                    {
-                        off = 1 + (off << 6) + (*ip++ >> 2);
-                        m_pos -= off;
-                        last_m_off = off;
-                    }
-                }
-                t = (t >> 5) - 1;
-#endif
-                TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-                goto copy_match;
-#endif
-            }
-            else if (t >= 32)
-            {
-                t &= 31;
-                if (t == 0)
-                {
-                    NEED_IP(1);
-                    while (*ip == 0)
-                    {
-                        t += 255;
-                        ip++;
-                        NEED_IP(1);
-                    }
-                    t += 31 + *ip++;
-                }
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-                m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
-                last_m_off = m_off;
-#else
-                m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
-#endif
-#else
-#if defined(LZO1Z)
-                {
-                    lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
-                    m_pos = op - off;
-                    last_m_off = off;
-                }
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
-                m_pos = op - 1;
-                m_pos -= UA_GET16(ip) >> 2;
-#else
-                m_pos = op - 1;
-                m_pos -= (ip[0] >> 2) + (ip[1] << 6);
-#endif
-#endif
-                ip += 2;
-            }
-            else if (t >= 16)
-            {
-#if defined(COPY_DICT)
-                m_off = (t & 8) << 11;
-#else
-                m_pos = op;
-                m_pos -= (t & 8) << 11;
-#endif
-                t &= 7;
-                if (t == 0)
-                {
-                    NEED_IP(1);
-                    while (*ip == 0)
-                    {
-                        t += 255;
-                        ip++;
-                        NEED_IP(1);
-                    }
-                    t += 7 + *ip++;
-                }
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-                m_off += (ip[0] << 6) + (ip[1] >> 2);
-#else
-                m_off += (ip[0] >> 2) + (ip[1] << 6);
-#endif
-                ip += 2;
-                if (m_off == 0)
-                    goto eof_found;
-                m_off += 0x4000;
-#if defined(LZO1Z)
-                last_m_off = m_off;
-#endif
-#else
-#if defined(LZO1Z)
-                m_pos -= (ip[0] << 6) + (ip[1] >> 2);
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
-                m_pos -= UA_GET16(ip) >> 2;
-#else
-                m_pos -= (ip[0] >> 2) + (ip[1] << 6);
-#endif
-                ip += 2;
-                if (m_pos == op)
-                    goto eof_found;
-                m_pos -= 0x4000;
-#if defined(LZO1Z)
-                last_m_off = pd((const lzo_bytep)op, m_pos);
-#endif
-#endif
-            }
-            else
-            {
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-                m_off = 1 + (t << 6) + (*ip++ >> 2);
-                last_m_off = m_off;
-#else
-                m_off = 1 + (t >> 2) + (*ip++ << 2);
-#endif
-                NEED_OP(2);
-                t = 2; COPY_DICT(t,m_off)
-#else
-#if defined(LZO1Z)
-                t = 1 + (t << 6) + (*ip++ >> 2);
-                m_pos = op - t;
-                last_m_off = t;
-#else
-                m_pos = op - 1;
-                m_pos -= t >> 2;
-                m_pos -= *ip++ << 2;
-#endif
-                TEST_LB(m_pos); NEED_OP(2);
-                *op++ = *m_pos++; *op++ = *m_pos;
-#endif
-                goto match_done;
-            }
-
-#if defined(COPY_DICT)
-
-            NEED_OP(t+3-1);
-            t += 3-1; COPY_DICT(t,m_off)
-
-#else
-
-            TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
-            if (op - m_pos >= 8)
-            {
-                t += (3 - 1);
-                if (t >= 8) do
-                {
-                    UA_COPY64(op,m_pos);
-                    op += 8; m_pos += 8; t -= 8;
-                } while (t >= 8);
-                if (t >= 4)
-                {
-                    UA_COPY32(op,m_pos);
-                    op += 4; m_pos += 4; t -= 4;
-                }
-                if (t > 0)
-                {
-                    *op++ = m_pos[0];
-                    if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
-                }
-            }
-            else
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-            if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
-            {
-                assert((op - m_pos) >= 4);
-#else
-            if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
-            {
-#endif
-                UA_COPY32(op,m_pos);
-                op += 4; m_pos += 4; t -= 4 - (3 - 1);
-                do {
-                    UA_COPY32(op,m_pos);
-                    op += 4; m_pos += 4; t -= 4;
-                } while (t >= 4);
-                if (t > 0) do *op++ = *m_pos++; while (--t > 0);
-            }
-            else
-#endif
-            {
-copy_match:
-                *op++ = *m_pos++; *op++ = *m_pos++;
-                do *op++ = *m_pos++; while (--t > 0);
-            }
-
-#endif
-
-match_done:
-#if defined(LZO1Z)
-            t = ip[-1] & 3;
-#else
-            t = ip[-2] & 3;
-#endif
-            if (t == 0)
-                break;
-
-match_next:
-            assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
-#if 0
-            do *op++ = *ip++; while (--t > 0);
-#else
-            *op++ = *ip++;
-            if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
-#endif
-            t = *ip++;
-        } while (TEST_IP && TEST_OP);
-    }
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
-    *out_len = pd(op, out);
-    return LZO_E_EOF_NOT_FOUND;
-#endif
-
-eof_found:
-    assert(t == 1);
-    *out_len = pd(op, out);
-    return (ip == ip_end ? LZO_E_OK :
-           (ip < ip_end  ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
-
-#if defined(HAVE_NEED_IP)
-input_overrun:
-    *out_len = pd(op, out);
-    return LZO_E_INPUT_OVERRUN;
-#endif
-
-#if defined(HAVE_NEED_OP)
-output_overrun:
-    *out_len = pd(op, out);
-    return LZO_E_OUTPUT_OVERRUN;
-#endif
-
-#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-lookbehind_overrun:
-    *out_len = pd(op, out);
-    return LZO_E_LOOKBEHIND_OVERRUN;
-#endif
-}
-
-#endif
-
-#define LZO_TEST_OVERRUN 1
-#undef DO_DECOMPRESS
-#define DO_DECOMPRESS       lzo1x_decompress_safe
-
-#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE)
-
-#if defined(LZO_TEST_OVERRUN)
-#  if !defined(LZO_TEST_OVERRUN_INPUT)
-#    define LZO_TEST_OVERRUN_INPUT       2
-#  endif
-#  if !defined(LZO_TEST_OVERRUN_OUTPUT)
-#    define LZO_TEST_OVERRUN_OUTPUT      2
-#  endif
-#  if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-#    define LZO_TEST_OVERRUN_LOOKBEHIND  1
-#  endif
-#endif
-
-#undef TEST_IP
-#undef TEST_OP
-#undef TEST_LB
-#undef TEST_LBO
-#undef NEED_IP
-#undef NEED_OP
-#undef HAVE_TEST_IP
-#undef HAVE_TEST_OP
-#undef HAVE_NEED_IP
-#undef HAVE_NEED_OP
-#undef HAVE_ANY_IP
-#undef HAVE_ANY_OP
-
-#if defined(LZO_TEST_OVERRUN_INPUT)
-#  if (LZO_TEST_OVERRUN_INPUT >= 1)
-#    define TEST_IP             (ip < ip_end)
-#  endif
-#  if (LZO_TEST_OVERRUN_INPUT >= 2)
-#    define NEED_IP(x) \
-            if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x))  goto input_overrun
-#  endif
-#endif
-
-#if defined(LZO_TEST_OVERRUN_OUTPUT)
-#  if (LZO_TEST_OVERRUN_OUTPUT >= 1)
-#    define TEST_OP             (op <= op_end)
-#  endif
-#  if (LZO_TEST_OVERRUN_OUTPUT >= 2)
-#    undef TEST_OP
-#    define NEED_OP(x) \
-            if ((lzo_uint)(op_end - op) < (lzo_uint)(x))  goto output_overrun
-#  endif
-#endif
-
-#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-#  define TEST_LB(m_pos)        if (m_pos < out || m_pos >= op) goto lookbehind_overrun
-#  define TEST_LBO(m_pos,o)     if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun
-#else
-#  define TEST_LB(m_pos)        ((void) 0)
-#  define TEST_LBO(m_pos,o)     ((void) 0)
-#endif
-
-#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
-#  define TEST_IP               (ip < ip_end)
-#endif
-
-#if defined(TEST_IP)
-#  define HAVE_TEST_IP 1
-#else
-#  define TEST_IP               1
-#endif
-#if defined(TEST_OP)
-#  define HAVE_TEST_OP 1
-#else
-#  define TEST_OP               1
-#endif
-
-#if defined(NEED_IP)
-#  define HAVE_NEED_IP 1
-#else
-#  define NEED_IP(x)            ((void) 0)
-#endif
-#if defined(NEED_OP)
-#  define HAVE_NEED_OP 1
-#else
-#  define NEED_OP(x)            ((void) 0)
-#endif
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-#  define HAVE_ANY_IP 1
-#endif
-#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-#  define HAVE_ANY_OP 1
-#endif
-
-#if defined(DO_DECOMPRESS)
-LZO_PUBLIC(int)
-DO_DECOMPRESS  ( const lzo_bytep in , lzo_uint  in_len,
-                       lzo_bytep out, lzo_uintp out_len,
-                       lzo_voidp wrkmem )
-#endif
-{
-    register lzo_bytep op;
-    register const lzo_bytep ip;
-    register lzo_uint t;
-#if defined(COPY_DICT)
-    lzo_uint m_off;
-    const lzo_bytep dict_end;
-#else
-    register const lzo_bytep m_pos;
-#endif
-
-    const lzo_bytep const ip_end = in + in_len;
-#if defined(HAVE_ANY_OP)
-    lzo_bytep const op_end = out + *out_len;
-#endif
-#if defined(LZO1Z)
-    lzo_uint last_m_off = 0;
-#endif
-
-    LZO_UNUSED(wrkmem);
-
-#if defined(COPY_DICT)
-    if (dict)
-    {
-        if (dict_len > M4_MAX_OFFSET)
-        {
-            dict += dict_len - M4_MAX_OFFSET;
-            dict_len = M4_MAX_OFFSET;
-        }
-        dict_end = dict + dict_len;
-    }
-    else
-    {
-        dict_len = 0;
-        dict_end = NULL;
-    }
-#endif
-
-    *out_len = 0;
-
-    op = out;
-    ip = in;
-
-    if (*ip > 17)
-    {
-        t = *ip++ - 17;
-        if (t < 4)
-            goto match_next;
-        assert(t > 0); NEED_OP(t); NEED_IP(t+1);
-        do *op++ = *ip++; while (--t > 0);
-        goto first_literal_run;
-    }
-
-    while (TEST_IP && TEST_OP)
-    {
-        t = *ip++;
-        if (t >= 16)
-            goto match;
-        if (t == 0)
-        {
-            NEED_IP(1);
-            while (*ip == 0)
-            {
-                t += 255;
-                ip++;
-                NEED_IP(1);
-            }
-            t += 15 + *ip++;
-        }
-        assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
-        t += 3;
-        if (t >= 8) do
-        {
-            UA_COPY64(op,ip);
-            op += 8; ip += 8; t -= 8;
-        } while (t >= 8);
-        if (t >= 4)
-        {
-            UA_COPY32(op,ip);
-            op += 4; ip += 4; t -= 4;
-        }
-        if (t > 0)
-        {
-            *op++ = *ip++;
-            if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
-        }
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-        if (PTR_ALIGNED2_4(op,ip))
-        {
-#endif
-        UA_COPY32(op,ip);
-        op += 4; ip += 4;
-        if (--t > 0)
-        {
-            if (t >= 4)
-            {
-                do {
-                    UA_COPY32(op,ip);
-                    op += 4; ip += 4; t -= 4;
-                } while (t >= 4);
-                if (t > 0) do *op++ = *ip++; while (--t > 0);
-            }
-            else
-                do *op++ = *ip++; while (--t > 0);
-        }
-#if !defined(LZO_UNALIGNED_OK_4)
-        }
-        else
-#endif
-#endif
-#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
-        {
-            *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
-            do *op++ = *ip++; while (--t > 0);
-        }
-#endif
-
-first_literal_run:
-
-        t = *ip++;
-        if (t >= 16)
-            goto match;
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-        m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
-        last_m_off = m_off;
-#else
-        m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
-#endif
-        NEED_OP(3);
-        t = 3; COPY_DICT(t,m_off)
-#else
-#if defined(LZO1Z)
-        t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
-        m_pos = op - t;
-        last_m_off = t;
-#else
-        m_pos = op - (1 + M2_MAX_OFFSET);
-        m_pos -= t >> 2;
-        m_pos -= *ip++ << 2;
-#endif
-        TEST_LB(m_pos); NEED_OP(3);
-        *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
-#endif
-        goto match_done;
-
-        do {
-match:
-            if (t >= 64)
-            {
-#if defined(COPY_DICT)
-#if defined(LZO1X)
-                m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
-                t = (t >> 5) - 1;
-#elif defined(LZO1Y)
-                m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
-                t = (t >> 4) - 3;
-#elif defined(LZO1Z)
-                m_off = t & 0x1f;
-                if (m_off >= 0x1c)
-                    m_off = last_m_off;
-                else
-                {
-                    m_off = 1 + (m_off << 6) + (*ip++ >> 2);
-                    last_m_off = m_off;
-                }
-                t = (t >> 5) - 1;
-#endif
-#else
-#if defined(LZO1X)
-                m_pos = op - 1;
-                m_pos -= (t >> 2) & 7;
-                m_pos -= *ip++ << 3;
-                t = (t >> 5) - 1;
-#elif defined(LZO1Y)
-                m_pos = op - 1;
-                m_pos -= (t >> 2) & 3;
-                m_pos -= *ip++ << 2;
-                t = (t >> 4) - 3;
-#elif defined(LZO1Z)
-                {
-                    lzo_uint off = t & 0x1f;
-                    m_pos = op;
-                    if (off >= 0x1c)
-                    {
-                        assert(last_m_off > 0);
-                        m_pos -= last_m_off;
-                    }
-                    else
-                    {
-                        off = 1 + (off << 6) + (*ip++ >> 2);
-                        m_pos -= off;
-                        last_m_off = off;
-                    }
-                }
-                t = (t >> 5) - 1;
-#endif
-                TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-                goto copy_match;
-#endif
-            }
-            else if (t >= 32)
-            {
-                t &= 31;
-                if (t == 0)
-                {
-                    NEED_IP(1);
-                    while (*ip == 0)
-                    {
-                        t += 255;
-                        ip++;
-                        NEED_IP(1);
-                    }
-                    t += 31 + *ip++;
-                }
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-                m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
-                last_m_off = m_off;
-#else
-                m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
-#endif
-#else
-#if defined(LZO1Z)
-                {
-                    lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
-                    m_pos = op - off;
-                    last_m_off = off;
-                }
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
-                m_pos = op - 1;
-                m_pos -= UA_GET16(ip) >> 2;
-#else
-                m_pos = op - 1;
-                m_pos -= (ip[0] >> 2) + (ip[1] << 6);
-#endif
-#endif
-                ip += 2;
-            }
-            else if (t >= 16)
-            {
-#if defined(COPY_DICT)
-                m_off = (t & 8) << 11;
-#else
-                m_pos = op;
-                m_pos -= (t & 8) << 11;
-#endif
-                t &= 7;
-                if (t == 0)
-                {
-                    NEED_IP(1);
-                    while (*ip == 0)
-                    {
-                        t += 255;
-                        ip++;
-                        NEED_IP(1);
-                    }
-                    t += 7 + *ip++;
-                }
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-                m_off += (ip[0] << 6) + (ip[1] >> 2);
-#else
-                m_off += (ip[0] >> 2) + (ip[1] << 6);
-#endif
-                ip += 2;
-                if (m_off == 0)
-                    goto eof_found;
-                m_off += 0x4000;
-#if defined(LZO1Z)
-                last_m_off = m_off;
-#endif
-#else
-#if defined(LZO1Z)
-                m_pos -= (ip[0] << 6) + (ip[1] >> 2);
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
-                m_pos -= UA_GET16(ip) >> 2;
-#else
-                m_pos -= (ip[0] >> 2) + (ip[1] << 6);
-#endif
-                ip += 2;
-                if (m_pos == op)
-                    goto eof_found;
-                m_pos -= 0x4000;
-#if defined(LZO1Z)
-                last_m_off = pd((const lzo_bytep)op, m_pos);
-#endif
-#endif
-            }
-            else
-            {
-#if defined(COPY_DICT)
-#if defined(LZO1Z)
-                m_off = 1 + (t << 6) + (*ip++ >> 2);
-                last_m_off = m_off;
-#else
-                m_off = 1 + (t >> 2) + (*ip++ << 2);
-#endif
-                NEED_OP(2);
-                t = 2; COPY_DICT(t,m_off)
-#else
-#if defined(LZO1Z)
-                t = 1 + (t << 6) + (*ip++ >> 2);
-                m_pos = op - t;
-                last_m_off = t;
-#else
-                m_pos = op - 1;
-                m_pos -= t >> 2;
-                m_pos -= *ip++ << 2;
-#endif
-                TEST_LB(m_pos); NEED_OP(2);
-                *op++ = *m_pos++; *op++ = *m_pos;
-#endif
-                goto match_done;
-            }
-
-#if defined(COPY_DICT)
-
-            NEED_OP(t+3-1);
-            t += 3-1; COPY_DICT(t,m_off)
-
-#else
-
-            TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
-            if (op - m_pos >= 8)
-            {
-                t += (3 - 1);
-                if (t >= 8) do
-                {
-                    UA_COPY64(op,m_pos);
-                    op += 8; m_pos += 8; t -= 8;
-                } while (t >= 8);
-                if (t >= 4)
-                {
-                    UA_COPY32(op,m_pos);
-                    op += 4; m_pos += 4; t -= 4;
-                }
-                if (t > 0)
-                {
-                    *op++ = m_pos[0];
-                    if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
-                }
-            }
-            else
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-            if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
-            {
-                assert((op - m_pos) >= 4);
-#else
-            if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
-            {
-#endif
-                UA_COPY32(op,m_pos);
-                op += 4; m_pos += 4; t -= 4 - (3 - 1);
-                do {
-                    UA_COPY32(op,m_pos);
-                    op += 4; m_pos += 4; t -= 4;
-                } while (t >= 4);
-                if (t > 0) do *op++ = *m_pos++; while (--t > 0);
-            }
-            else
-#endif
-            {
-copy_match:
-                *op++ = *m_pos++; *op++ = *m_pos++;
-                do *op++ = *m_pos++; while (--t > 0);
-            }
-
-#endif
-
-match_done:
-#if defined(LZO1Z)
-            t = ip[-1] & 3;
-#else
-            t = ip[-2] & 3;
-#endif
-            if (t == 0)
-                break;
-
-match_next:
-            assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
-#if 0
-            do *op++ = *ip++; while (--t > 0);
-#else
-            *op++ = *ip++;
-            if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
-#endif
-            t = *ip++;
-        } while (TEST_IP && TEST_OP);
-    }
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
-    *out_len = pd(op, out);
-    return LZO_E_EOF_NOT_FOUND;
-#endif
-
-eof_found:
-    assert(t == 1);
-    *out_len = pd(op, out);
-    return (ip == ip_end ? LZO_E_OK :
-           (ip < ip_end  ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
-
-#if defined(HAVE_NEED_IP)
-input_overrun:
-    *out_len = pd(op, out);
-    return LZO_E_INPUT_OVERRUN;
-#endif
-
-#if defined(HAVE_NEED_OP)
-output_overrun:
-    *out_len = pd(op, out);
-    return LZO_E_OUTPUT_OVERRUN;
-#endif
-
-#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
-lookbehind_overrun:
-    *out_len = pd(op, out);
-    return LZO_E_LOOKBEHIND_OVERRUN;
-#endif
-}
-
-#endif
-
-/***** End of minilzo.c *****/
-
diff --git a/ica/x11/common/minilzo.h b/ica/x11/common/minilzo.h
deleted file mode 100644
index 4c7b237..0000000
--- a/ica/x11/common/minilzo.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* minilzo.h -- mini subset of the LZO real-time data compression library
-
-   This file is part of the LZO real-time data compression library.
-
-   Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
-   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
-   All Rights Reserved.
-
-   The LZO library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   The LZO library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with the LZO library; see the file COPYING.
-   If not, write to the Free Software Foundation, Inc.,
-   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-   Markus F.X.J. Oberhumer
-   <markus at oberhumer.com>
-   http://www.oberhumer.com/opensource/lzo/
- */
-
-/*
- * NOTE:
- *   the full LZO package can be found at
- *   http://www.oberhumer.com/opensource/lzo/
- */
-
-
-#ifndef __MINILZO_H
-#define __MINILZO_H 1
-
-#define MINILZO_VERSION         0x2060
-
-#ifdef __LZOCONF_H
-#  error "you cannot use both LZO and miniLZO"
-#endif
-
-#undef LZO_HAVE_CONFIG_H
-#include "lzoconf.h"
-
-#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
-#  error "version mismatch in header files"
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/***********************************************************************
-//
-************************************************************************/
-
-/* Memory required for the wrkmem parameter.
- * When the required size is 0, you can also pass a NULL pointer.
- */
-
-#define LZO1X_MEM_COMPRESS      LZO1X_1_MEM_COMPRESS
-#define LZO1X_1_MEM_COMPRESS    ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
-#define LZO1X_MEM_DECOMPRESS    (0)
-
-
-/* compression */
-LZO_EXTERN(int)
-lzo1x_1_compress        ( const lzo_bytep src, lzo_uint  src_len,
-                                lzo_bytep dst, lzo_uintp dst_len,
-                                lzo_voidp wrkmem );
-
-/* decompression */
-LZO_EXTERN(int)
-lzo1x_decompress        ( const lzo_bytep src, lzo_uint  src_len,
-                                lzo_bytep dst, lzo_uintp dst_len,
-                                lzo_voidp wrkmem /* NOT USED */ );
-
-/* safe decompression with overrun testing */
-LZO_EXTERN(int)
-lzo1x_decompress_safe   ( const lzo_bytep src, lzo_uint  src_len,
-                                lzo_bytep dst, lzo_uintp dst_len,
-                                lzo_voidp wrkmem /* NOT USED */ );
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* already included */
-
diff --git a/ica/x11/common/turbojpeg.c b/ica/x11/common/turbojpeg.c
deleted file mode 100644
index 09df173..0000000
--- a/ica/x11/common/turbojpeg.c
+++ /dev/null
@@ -1,854 +0,0 @@
-/*
- * Copyright (C)2009-2012 D. R. Commander.  All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the libjpeg-turbo Project nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* TurboJPEG/OSS:  this implements the TurboJPEG API using libjpeg-turbo */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifndef JCS_EXTENSIONS
-#define JPEG_INTERNAL_OPTIONS
-#endif
-#include <jpeglib.h>
-#include <jerror.h>
-#include <setjmp.h>
-#include "./turbojpeg.h"
-
-#define PAD(v, p) ((v+(p)-1)&(~((p)-1)))
-
-#define CSTATE_START 100
-#define DSTATE_START 200
-#define MEMZERO(ptr, size) memset(ptr, 0, size)
-
-#ifndef min
- #define min(a,b) ((a)<(b)?(a):(b))
-#endif
-
-#ifndef max
- #define max(a,b) ((a)>(b)?(a):(b))
-#endif
-
-
-/* Error handling (based on example in example.c) */
-
-static char errStr[JMSG_LENGTH_MAX]="No error";
-
-struct my_error_mgr
-{
-	struct jpeg_error_mgr pub;
-	jmp_buf setjmp_buffer;
-};
-typedef struct my_error_mgr *my_error_ptr;
-
-static void my_error_exit(j_common_ptr cinfo)
-{
-	my_error_ptr myerr=(my_error_ptr)cinfo->err;
-	(*cinfo->err->output_message)(cinfo);
-	longjmp(myerr->setjmp_buffer, 1);
-}
-
-/* Based on output_message() in jerror.c */
-
-static void my_output_message(j_common_ptr cinfo)
-{
-	(*cinfo->err->format_message)(cinfo, errStr);
-}
-
-
-/* Global structures, macros, etc. */
-
-enum {COMPRESS=1, DECOMPRESS=2};
-
-typedef struct _tjinstance
-{
-	struct jpeg_compress_struct cinfo;
-	struct jpeg_decompress_struct dinfo;
-	struct jpeg_destination_mgr jdst;
-	struct jpeg_source_mgr jsrc;
-	struct my_error_mgr jerr;
-	int init;
-} tjinstance;
-
-static const int pixelsize[TJ_NUMSAMP]={3, 3, 3, 1, 3};
-
-#define NUMSF 4
-static const tjscalingfactor sf[NUMSF]={
-	{1, 1},
-	{1, 2},
-	{1, 4},
-	{1, 8}
-};
-
-#define _throw(m) {snprintf(errStr, JMSG_LENGTH_MAX, "%s", m);  \
-	retval=-1;  goto bailout;}
-#define getinstance(handle) tjinstance *this=(tjinstance *)handle;  \
-	j_compress_ptr cinfo=NULL;  j_decompress_ptr dinfo=NULL;  \
-	(void) cinfo; (void) dinfo; /* silence warnings */ \
-	if(!this) {snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle");  \
-		return -1;}  \
-	cinfo=&this->cinfo;  dinfo=&this->dinfo;
-
-static int getPixelFormat(int pixelSize, int flags)
-{
-	if(pixelSize==1) return TJPF_GRAY;
-	if(pixelSize==3)
-	{
-		if(flags&TJ_BGR) return TJPF_BGR;
-		else return TJPF_RGB;
-	}
-	if(pixelSize==4)
-	{
-		if(flags&TJ_ALPHAFIRST)
-		{
-			if(flags&TJ_BGR) return TJPF_XBGR;
-			else return TJPF_XRGB;
-		}
-		else
-		{
-			if(flags&TJ_BGR) return TJPF_BGRX;
-			else return TJPF_RGBX;
-		}
-	}
-	return -1;
-}
-
-static int setCompDefaults(struct jpeg_compress_struct *cinfo,
-	int pixelFormat, int subsamp, int jpegQual)
-{
-	int retval=0;
-
-	switch(pixelFormat)
-	{
-		case TJPF_GRAY:
-			cinfo->in_color_space=JCS_GRAYSCALE;  break;
-		#if JCS_EXTENSIONS==1
-		case TJPF_RGB:
-			cinfo->in_color_space=JCS_EXT_RGB;  break;
-		case TJPF_BGR:
-			cinfo->in_color_space=JCS_EXT_BGR;  break;
-		case TJPF_RGBX:
-		case TJPF_RGBA:
-			cinfo->in_color_space=JCS_EXT_RGBX;  break;
-		case TJPF_BGRX:
-		case TJPF_BGRA:
-			cinfo->in_color_space=JCS_EXT_BGRX;  break;
-		case TJPF_XRGB:
-		case TJPF_ARGB:
-			cinfo->in_color_space=JCS_EXT_XRGB;  break;
-		case TJPF_XBGR:
-		case TJPF_ABGR:
-			cinfo->in_color_space=JCS_EXT_XBGR;  break;
-		#else
-		case TJPF_RGB:
-		case TJPF_BGR:
-		case TJPF_RGBX:
-		case TJPF_BGRX:
-		case TJPF_XRGB:
-		case TJPF_XBGR:
-		case TJPF_RGBA:
-		case TJPF_BGRA:
-		case TJPF_ARGB:
-		case TJPF_ABGR:
-			cinfo->in_color_space=JCS_RGB;  pixelFormat=TJPF_RGB;
-			break;
-		#endif
-	}
-
-	cinfo->input_components=tjPixelSize[pixelFormat];
-	jpeg_set_defaults(cinfo);
-	if(jpegQual>=0)
-	{
-		jpeg_set_quality(cinfo, jpegQual, TRUE);
-		if(jpegQual>=96) cinfo->dct_method=JDCT_ISLOW;
-		else cinfo->dct_method=JDCT_FASTEST;
-	}
-	if(subsamp==TJSAMP_GRAY)
-		jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
-	else
-		jpeg_set_colorspace(cinfo, JCS_YCbCr);
-
-	cinfo->comp_info[0].h_samp_factor=tjMCUWidth[subsamp]/8;
-	cinfo->comp_info[1].h_samp_factor=1;
-	cinfo->comp_info[2].h_samp_factor=1;
-	cinfo->comp_info[0].v_samp_factor=tjMCUHeight[subsamp]/8;
-	cinfo->comp_info[1].v_samp_factor=1;
-	cinfo->comp_info[2].v_samp_factor=1;
-
-	return retval;
-}
-
-static int setDecompDefaults(struct jpeg_decompress_struct *dinfo,
-	int pixelFormat)
-{
-	int retval=0;
-
-	switch(pixelFormat)
-	{
-		case TJPF_GRAY:
-			dinfo->out_color_space=JCS_GRAYSCALE;  break;
-		#if JCS_EXTENSIONS==1
-		case TJPF_RGB:
-			dinfo->out_color_space=JCS_EXT_RGB;  break;
-		case TJPF_BGR:
-			dinfo->out_color_space=JCS_EXT_BGR;  break;
-		case TJPF_RGBX:
-			dinfo->out_color_space=JCS_EXT_RGBX;  break;
-		case TJPF_BGRX:
-			dinfo->out_color_space=JCS_EXT_BGRX;  break;
-		case TJPF_XRGB:
-			dinfo->out_color_space=JCS_EXT_XRGB;  break;
-		case TJPF_XBGR:
-			dinfo->out_color_space=JCS_EXT_XBGR;  break;
-		#if JCS_ALPHA_EXTENSIONS==1
-		case TJPF_RGBA:
-			dinfo->out_color_space=JCS_EXT_RGBA;  break;
-		case TJPF_BGRA:
-			dinfo->out_color_space=JCS_EXT_BGRA;  break;
-		case TJPF_ARGB:
-			dinfo->out_color_space=JCS_EXT_ARGB;  break;
-		case TJPF_ABGR:
-			dinfo->out_color_space=JCS_EXT_ABGR;  break;
-		#endif
-		#else
-		case TJPF_RGB:
-		case TJPF_BGR:
-		case TJPF_RGBX:
-		case TJPF_BGRX:
-		case TJPF_XRGB:
-		case TJPF_XBGR:
-		case TJPF_RGBA:
-		case TJPF_BGRA:
-		case TJPF_ARGB:
-		case TJPF_ABGR:
-			dinfo->out_color_space=JCS_RGB;  break;
-		#endif
-		default:
-			_throw("Unsupported pixel format");
-	}
-
-	bailout:
-	return retval;
-}
-
-
-static int getSubsamp(j_decompress_ptr dinfo)
-{
-	int retval=-1, i, k;
-	for(i=0; i<NUMSUBOPT; i++)
-	{
-		if(dinfo->num_components==pixelsize[i])
-		{
-			if(dinfo->comp_info[0].h_samp_factor==tjMCUWidth[i]/8
-				&& dinfo->comp_info[0].v_samp_factor==tjMCUHeight[i]/8)
-			{
-				int match=0;
-				for(k=1; k<dinfo->num_components; k++)
-				{
-					if(dinfo->comp_info[k].h_samp_factor==1
-						&& dinfo->comp_info[k].v_samp_factor==1)
-						match++;
-				}
-				if(match==dinfo->num_components-1)
-				{
-					retval=i;  break;
-				}
-			}
-		}
-	}
-	return retval;
-}
-
-
-#ifndef JCS_EXTENSIONS
-
-/* Conversion functions to emulate the colorspace extensions.  This allows the
-   TurboJPEG wrapper to be used with libjpeg */
-
-#define TORGB(PS, ROFFSET, GOFFSET, BOFFSET) {  \
-	int rowPad=pitch-width*PS;  \
-	while(height--)  \
-	{  \
-		unsigned char *endOfRow=src+width*PS;  \
-		while(src<endOfRow)  \
-		{  \
-			dst[RGB_RED]=src[ROFFSET];  \
-			dst[RGB_GREEN]=src[GOFFSET];  \
-			dst[RGB_BLUE]=src[BOFFSET];  \
-			dst+=RGB_PIXELSIZE;  src+=PS;  \
-		}  \
-		src+=rowPad;  \
-	}  \
-}
-
-static unsigned char *toRGB(unsigned char *src, int width, int pitch,
-	int height, int pixelFormat, unsigned char *dst)
-{
-	unsigned char *retval=src;
-	switch(pixelFormat)
-	{
-		case TJPF_RGB:
-			#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=3
-			retval=dst;  TORGB(3, 0, 1, 2);
-			#endif
-			break;
-		case TJPF_BGR:
-			#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=3
-			retval=dst;  TORGB(3, 2, 1, 0);
-			#endif
-			break;
-		case TJPF_RGBX:
-		case TJPF_RGBA:
-			#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4
-			retval=dst;  TORGB(4, 0, 1, 2);
-			#endif
-			break;
-		case TJPF_BGRX:
-		case TJPF_BGRA:
-			#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4
-			retval=dst;  TORGB(4, 2, 1, 0);
-			#endif
-			break;
-		case TJPF_XRGB:
-		case TJPF_ARGB:
-			#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4
-			retval=dst;  TORGB(4, 1, 2, 3);
-			#endif
-			break;
-		case TJPF_XBGR:
-		case TJPF_ABGR:
-			#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4
-			retval=dst;  TORGB(4, 3, 2, 1);
-			#endif
-			break;
-	}
-	return retval;
-}
-
-#define FROMRGB(PS, ROFFSET, GOFFSET, BOFFSET, SETALPHA) {  \
-	int rowPad=pitch-width*PS;  \
-	while(height--)  \
-	{  \
-		unsigned char *endOfRow=dst+width*PS;  \
-		while(dst<endOfRow)  \
-		{  \
-			dst[ROFFSET]=src[RGB_RED];  \
-			dst[GOFFSET]=src[RGB_GREEN];  \
-			dst[BOFFSET]=src[RGB_BLUE];  \
-			SETALPHA  \
-			dst+=PS;  src+=RGB_PIXELSIZE;  \
-		}  \
-		dst+=rowPad;  \
-	}  \
-}
-
-static void fromRGB(unsigned char *src, unsigned char *dst, int width,
-	int pitch, int height, int pixelFormat)
-{
-	switch(pixelFormat)
-	{
-		case TJPF_RGB:
-			#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=3
-			FROMRGB(3, 0, 1, 2,);
-			#endif
-			break;
-		case TJPF_BGR:
-			#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=3
-			FROMRGB(3, 2, 1, 0,);
-			#endif
-			break;
-		case TJPF_RGBX:
-			#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 0, 1, 2,);
-			#endif
-			break;
-		case TJPF_RGBA:
-			#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 0, 1, 2, dst[3]=0xFF;);
-			#endif
-			break;
-		case TJPF_BGRX:
-			#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 2, 1, 0,);
-			#endif
-			break;
-		case TJPF_BGRA:
-			#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 2, 1, 0, dst[3]=0xFF;);  return;
-			#endif
-			break;
-		case TJPF_XRGB:
-			#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 1, 2, 3,);  return;
-			#endif
-			break;
-		case TJPF_ARGB:
-			#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 1, 2, 3, dst[0]=0xFF;);  return;
-			#endif
-			break;
-		case TJPF_XBGR:
-			#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 3, 2, 1,);  return;
-			#endif
-			break;
-		case TJPF_ABGR:
-			#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4
-			FROMRGB(4, 3, 2, 1, dst[0]=0xFF;);  return;
-			#endif
-			break;
-	}
-}
-
-#endif
-
-
-/* General API functions */
-
-DLLEXPORT char* DLLCALL tjGetErrorStr(void)
-{
-	return errStr;
-}
-
-
-DLLEXPORT int DLLCALL tjDestroy(tjhandle handle)
-{
-	getinstance(handle);
-	if(setjmp(this->jerr.setjmp_buffer)) return -1;
-	if(this->init&COMPRESS) jpeg_destroy_compress(cinfo);
-	if(this->init&DECOMPRESS) jpeg_destroy_decompress(dinfo);
-	free(this);
-	return 0;
-}
-
-
-/* Compressor  */
-
-static boolean empty_output_buffer(j_compress_ptr cinfo)
-{
-	ERREXIT(cinfo, JERR_BUFFER_SIZE);
-	return TRUE;
-}
-
-static void dst_noop(j_compress_ptr cinfo)
-{
-}
-
-static tjhandle _tjInitCompress(tjinstance *this)
-{
-	/* This is also straight out of example.c */
-	this->cinfo.err=jpeg_std_error(&this->jerr.pub);
-	this->jerr.pub.error_exit=my_error_exit;
-	this->jerr.pub.output_message=my_output_message;
-
-	if(setjmp(this->jerr.setjmp_buffer))
-	{
-		/* If we get here, the JPEG code has signaled an error. */
-		if(this) free(this);  return NULL;
-	}
-
-	jpeg_create_compress(&this->cinfo);
-	this->cinfo.dest=&this->jdst;
-	this->jdst.init_destination=dst_noop;
-	this->jdst.empty_output_buffer=empty_output_buffer;
-	this->jdst.term_destination=dst_noop;
-
-	this->init|=COMPRESS;
-	return (tjhandle)this;
-}
-
-DLLEXPORT tjhandle DLLCALL tjInitCompress(void)
-{
-	tjinstance *this=NULL;
-	if((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)
-	{
-		snprintf(errStr, JMSG_LENGTH_MAX,
-			"tjInitCompress(): Memory allocation failure");
-		return NULL;
-	}
-	MEMZERO(this, sizeof(tjinstance));
-	return _tjInitCompress(this);
-}
-
-
-DLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,
-	int jpegSubsamp)
-{
-	unsigned long retval=0;  int mcuw, mcuh, chromasf;
-	if(width<1 || height<1 || jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT)
-		_throw("tjBufSize(): Invalid argument");
-
-	/*
-	 * This allows for rare corner cases in which a JPEG image can actually be
-	 * larger than the uncompressed input (we wouldn't mention it if it hadn't
-	 * happened before.)
-	 */
-	mcuw=tjMCUWidth[jpegSubsamp];
-	mcuh=tjMCUHeight[jpegSubsamp];
-	chromasf=jpegSubsamp==TJSAMP_GRAY? 0: 4*64/(mcuw*mcuh);
-	retval=PAD(width, mcuw) * PAD(height, mcuh) * (2 + chromasf) + 2048;
-
-	bailout:
-	return retval;
-}
-
-
-DLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height)
-{
-	unsigned long retval=0;
-	if(width<1 || height<1)
-		_throw("TJBUFSIZE(): Invalid argument");
-
-	/*
-	 * This allows for rare corner cases in which a JPEG image can actually be
-	 * larger than the uncompressed input (we wouldn't mention it if it hadn't
-	 * happened before.)
-	 */
-	retval=PAD(width, 16) * PAD(height, 16) * 6 + 2048;
-
-	bailout:
-	return retval;
-}
-
-
-DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
-	int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,
-	unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)
-{
-	int i, retval=0;  JSAMPROW *row_pointer=NULL;
-	#ifndef JCS_EXTENSIONS
-	unsigned char *rgbBuf=NULL;
-	#endif
-
-	getinstance(handle)
-	if((this->init&COMPRESS)==0)
-		_throw("tjCompress2(): Instance has not been initialized for compression");
-
-	if(srcBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0
-		|| pixelFormat>=TJ_NUMPF || jpegBuf==NULL || jpegSize==NULL
-		|| jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT || jpegQual<0 || jpegQual>100)
-		_throw("tjCompress2(): Invalid argument");
-
-	if(setjmp(this->jerr.setjmp_buffer))
-	{
-		/* If we get here, the JPEG code has signaled an error. */
-		retval=-1;
-		goto bailout;
-	}
-
-	if(pitch==0) pitch=width*tjPixelSize[pixelFormat];
-
-	#ifndef JCS_EXTENSIONS
-	if(pixelFormat!=TJPF_GRAY)
-	{
-		rgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);
-		if(!rgbBuf) _throw("tjCompress2(): Memory allocation failure");
-		srcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);
-		pitch=width*RGB_PIXELSIZE;
-	}
-	#endif
-
-	cinfo->image_width=width;
-	cinfo->image_height=height;
-
-	if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
-	else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
-	else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
-
-	if(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual)==-1)
-		return -1;
-
-	this->jdst.next_output_byte=*jpegBuf;
-	this->jdst.free_in_buffer=tjBufSize(width, height, jpegSubsamp);
-
-	jpeg_start_compress(cinfo, TRUE);
-	if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*height))==NULL)
-		_throw("tjCompress2(): Memory allocation failure");
-	for(i=0; i<height; i++)
-	{
-		if(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&srcBuf[(height-i-1)*pitch];
-		else row_pointer[i]=&srcBuf[i*pitch];
-	}
-	while(cinfo->next_scanline<cinfo->image_height)
-	{
-		jpeg_write_scanlines(cinfo, &row_pointer[cinfo->next_scanline],
-			cinfo->image_height-cinfo->next_scanline);
-	}
-	jpeg_finish_compress(cinfo);
- 	*jpegSize=tjBufSize(width, height, jpegSubsamp)
-		-(unsigned long)(this->jdst.free_in_buffer);
-
-	bailout:
-	if(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);
-	#ifndef JCS_EXTENSIONS
-	if(rgbBuf) free(rgbBuf);
-	#endif
-	if(row_pointer) free(row_pointer);
-	return retval;
-}
-
-DLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,
-	int width, int pitch, int height, int pixelSize, unsigned char *jpegBuf,
-	unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)
-{
-	int retval=0;  unsigned long size;
-	retval=tjCompress2(handle, srcBuf, width, pitch, height,
-		getPixelFormat(pixelSize, flags), &jpegBuf, &size, jpegSubsamp, jpegQual,
-		flags);
-	*jpegSize=size;
-	return retval;
-}
-
-
-/* Decompressor */
-
-static boolean fill_input_buffer(j_decompress_ptr dinfo)
-{
-	ERREXIT(dinfo, JERR_BUFFER_SIZE);
-	return TRUE;
-}
-
-static void skip_input_data(j_decompress_ptr dinfo, long num_bytes)
-{
-	dinfo->src->next_input_byte += (size_t) num_bytes;
-	dinfo->src->bytes_in_buffer -= (size_t) num_bytes;
-}
-
-static void src_noop(j_decompress_ptr dinfo)
-{
-}
-
-static tjhandle _tjInitDecompress(tjinstance *this)
-{
-	/* This is also straight out of example.c */
-	this->dinfo.err=jpeg_std_error(&this->jerr.pub);
-	this->jerr.pub.error_exit=my_error_exit;
-	this->jerr.pub.output_message=my_output_message;
-
-	if(setjmp(this->jerr.setjmp_buffer))
-	{
-		/* If we get here, the JPEG code has signaled an error. */
-		if(this) free(this);  return NULL;
-	}
-
-	jpeg_create_decompress(&this->dinfo);
-	this->dinfo.src=&this->jsrc;
-	this->jsrc.init_source=src_noop;
-	this->jsrc.fill_input_buffer=fill_input_buffer;
-	this->jsrc.skip_input_data=skip_input_data;
-	this->jsrc.resync_to_restart=jpeg_resync_to_restart;
-	this->jsrc.term_source=src_noop;
-
-	this->init|=DECOMPRESS;
-	return (tjhandle)this;
-}
-
-DLLEXPORT tjhandle DLLCALL tjInitDecompress(void)
-{
-	tjinstance *this;
-	if((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)
-	{
-		snprintf(errStr, JMSG_LENGTH_MAX,
-			"tjInitDecompress(): Memory allocation failure");
-		return NULL;
-	}
-	MEMZERO(this, sizeof(tjinstance));
-	return _tjInitDecompress(this);
-}
-
-
-DLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,
-	unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,
-	int *jpegSubsamp)
-{
-	int retval=0;
-
-	getinstance(handle);
-	if((this->init&DECOMPRESS)==0)
-		_throw("tjDecompressHeader2(): Instance has not been initialized for decompression");
-
-	if(jpegBuf==NULL || jpegSize<=0 || width==NULL || height==NULL
-		|| jpegSubsamp==NULL)
-		_throw("tjDecompressHeader2(): Invalid argument");
-
-	if(setjmp(this->jerr.setjmp_buffer))
-	{
-		/* If we get here, the JPEG code has signaled an error. */
-		return -1;
-	}
-
-	this->jsrc.bytes_in_buffer=jpegSize;
-	this->jsrc.next_input_byte=jpegBuf;
-	jpeg_read_header(dinfo, TRUE);
-
-	*width=dinfo->image_width;
-	*height=dinfo->image_height;
-	*jpegSubsamp=getSubsamp(dinfo);
-
-	jpeg_abort_decompress(dinfo);
-
-	if(*jpegSubsamp<0)
-		_throw("tjDecompressHeader2(): Could not determine subsampling type for JPEG image");
-	if(*width<1 || *height<1)
-		_throw("tjDecompressHeader2(): Invalid data returned in header");
-
-	bailout:
-	return retval;
-}
-
-DLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,
-	unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height)
-{
-	int jpegSubsamp;
-	return tjDecompressHeader2(handle, jpegBuf, jpegSize, width, height,
-		&jpegSubsamp);
-}
-
-
-DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors)
-{
-	if(numscalingfactors==NULL)
-	{
-		snprintf(errStr, JMSG_LENGTH_MAX,
-			"tjGetScalingFactors(): Invalid argument");
-		return NULL;
-	}
-
-	*numscalingfactors=NUMSF;
-	return (tjscalingfactor *)sf;
-}
-
-
-DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, unsigned char *jpegBuf,
-	unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch,
-	int height, int pixelFormat, int flags)
-{
-	int i, retval=0;  JSAMPROW *row_pointer=NULL;
-	int jpegwidth, jpegheight, scaledw, scaledh;
-	#ifndef JCS_EXTENSIONS
-	unsigned char *rgbBuf=NULL;
-	unsigned char *_dstBuf=NULL;  int _pitch=0;
-	#endif
-
-	getinstance(handle);
-	if((this->init&DECOMPRESS)==0)
-		_throw("tjDecompress2(): Instance has not been initialized for decompression");
-
-	if(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL || width<0 || pitch<0
-		|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)
-		_throw("tjDecompress2(): Invalid argument");
-
-	if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
-	else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
-	else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
-
-	if(setjmp(this->jerr.setjmp_buffer))
-	{
-		/* If we get here, the JPEG code has signaled an error. */
-		retval=-1;
-		goto bailout;
-	}
-
-	this->jsrc.bytes_in_buffer=jpegSize;
-	this->jsrc.next_input_byte=jpegBuf;
-	jpeg_read_header(dinfo, TRUE);
-	if(setDecompDefaults(dinfo, pixelFormat)==-1)
-	{
-		retval=-1;  goto bailout;
-	}
-
-	if(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;
-
-	jpegwidth=dinfo->image_width;  jpegheight=dinfo->image_height;
-	if(width==0) width=jpegwidth;
-	if(height==0) height=jpegheight;
-	for(i=0; i<NUMSF; i++)
-	{
-		scaledw=TJSCALED(jpegwidth, sf[i]);
-		scaledh=TJSCALED(jpegheight, sf[i]);
-		if(scaledw<=width && scaledh<=height)
-				break;
-	}
-	if(scaledw>width || scaledh>height)
-		_throw("tjDecompress2(): Could not scale down to desired image dimensions");
-	width=scaledw;  height=scaledh;
-	dinfo->scale_num=sf[i].num;
-	dinfo->scale_denom=sf[i].denom;
-
-	jpeg_start_decompress(dinfo);
-	if(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];
-
-	#ifndef JCS_EXTENSIONS
-	if(pixelFormat!=TJPF_GRAY &&
-		(RGB_RED!=tjRedOffset[pixelFormat] ||
-			RGB_GREEN!=tjGreenOffset[pixelFormat] ||
-			RGB_BLUE!=tjBlueOffset[pixelFormat] ||
-			RGB_PIXELSIZE!=tjPixelSize[pixelFormat]))
-	{
-		rgbBuf=(unsigned char *)malloc(width*height*3);
-		if(!rgbBuf) _throw("tjDecompress2(): Memory allocation failure");
-		_pitch=pitch;  pitch=width*3;
-		_dstBuf=dstBuf;  dstBuf=rgbBuf;
-	}
-	#endif
-
-	if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)
-		*dinfo->output_height))==NULL)
-		_throw("tjDecompress2(): Memory allocation failure");
-	for(i=0; i<(int)dinfo->output_height; i++)
-	{
-		if(flags&TJFLAG_BOTTOMUP)
-			row_pointer[i]=&dstBuf[(dinfo->output_height-i-1)*pitch];
-		else row_pointer[i]=&dstBuf[i*pitch];
-	}
-	while(dinfo->output_scanline<dinfo->output_height)
-	{
-		jpeg_read_scanlines(dinfo, &row_pointer[dinfo->output_scanline],
-			dinfo->output_height-dinfo->output_scanline);
-	}
-	jpeg_finish_decompress(dinfo);
-
-	#ifndef JCS_EXTENSIONS
-	fromRGB(rgbBuf, _dstBuf, width, _pitch, height, pixelFormat);
-	#endif
-
-	bailout:
-	if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);
-	#ifndef JCS_EXTENSIONS
-	if(rgbBuf) free(rgbBuf);
-	#endif
-	if(row_pointer) free(row_pointer);
-	return retval;
-}
-
-DLLEXPORT int DLLCALL tjDecompress(tjhandle handle, unsigned char *jpegBuf,
-	unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch,
-	int height, int pixelSize, int flags)
-{
-	return tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, width, pitch,
-		height, getPixelFormat(pixelSize, flags), flags);
-}
diff --git a/ica/x11/common/turbojpeg.h b/ica/x11/common/turbojpeg.h
deleted file mode 100644
index ab8adda..0000000
--- a/ica/x11/common/turbojpeg.h
+++ /dev/null
@@ -1,529 +0,0 @@
-/*
- * Copyright (C)2009-2012 D. R. Commander.  All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the libjpeg-turbo Project nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __TURBOJPEG_H__
-#define __TURBOJPEG_H__
-
-#if defined(_WIN32) && defined(DLLDEFINE)
-#define DLLEXPORT __declspec(dllexport)
-#else
-#define DLLEXPORT
-#endif
-#define DLLCALL
-
-
-/**
- * @addtogroup TurboJPEG Lite
- * TurboJPEG API.  This API provides an interface for generating and decoding
- * JPEG images in memory.
- *
- * @{
- */
-
-
-/**
- * The number of chrominance subsampling options
- */
-#define TJ_NUMSAMP 5
-
-/**
- * Chrominance subsampling options.
- * When an image is converted from the RGB to the YCbCr colorspace as part of
- * the JPEG compression process, some of the Cb and Cr (chrominance) components
- * can be discarded or averaged together to produce a smaller image with little
- * perceptible loss of image clarity (the human eye is more sensitive to small
- * changes in brightness than small changes in color.)  This is called
- * "chrominance subsampling".
- */
-enum TJSAMP
-{
-  /**
-   * 4:4:4 chrominance subsampling (no chrominance subsampling).  The JPEG or
-   * YUV image will contain one chrominance component for every pixel in the
-   * source image.
-   */
-  TJSAMP_444=0,
-  /**
-   * 4:2:2 chrominance subsampling.  The JPEG or YUV image will contain one
-   * chrominance component for every 2x1 block of pixels in the source image.
-   */
-  TJSAMP_422,
-  /**
-   * 4:2:0 chrominance subsampling.  The JPEG or YUV image will contain one
-   * chrominance component for every 2x2 block of pixels in the source image.
-   */
-  TJSAMP_420,
-  /**
-   * Grayscale.  The JPEG or YUV image will contain no chrominance components.
-   */
-  TJSAMP_GRAY,
-  /**
-   * 4:4:0 chrominance subsampling.  The JPEG or YUV image will contain one
-   * chrominance component for every 1x2 block of pixels in the source image.
-   */
-  TJSAMP_440
-};
-
-/**
- * MCU block width (in pixels) for a given level of chrominance subsampling.
- * MCU block sizes:
- * - 8x8 for no subsampling or grayscale
- * - 16x8 for 4:2:2
- * - 8x16 for 4:4:0
- * - 16x16 for 4:2:0 
- */
-static const int tjMCUWidth[TJ_NUMSAMP]  = {8, 16, 16, 8, 8};
-
-/**
- * MCU block height (in pixels) for a given level of chrominance subsampling.
- * MCU block sizes:
- * - 8x8 for no subsampling or grayscale
- * - 16x8 for 4:2:2
- * - 8x16 for 4:4:0
- * - 16x16 for 4:2:0 
- */
-static const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16};
-
-
-/**
- * The number of pixel formats
- */
-#define TJ_NUMPF 11
-
-/**
- * Pixel formats
- */
-enum TJPF
-{
-  /**
-   * RGB pixel format.  The red, green, and blue components in the image are
-   * stored in 3-byte pixels in the order R, G, B from lowest to highest byte
-   * address within each pixel.
-   */
-  TJPF_RGB=0,
-  /**
-   * BGR pixel format.  The red, green, and blue components in the image are
-   * stored in 3-byte pixels in the order B, G, R from lowest to highest byte
-   * address within each pixel.
-   */
-  TJPF_BGR,
-  /**
-   * RGBX pixel format.  The red, green, and blue components in the image are
-   * stored in 4-byte pixels in the order R, G, B from lowest to highest byte
-   * address within each pixel.  The X component is ignored when compressing
-   * and undefined when decompressing.
-   */
-  TJPF_RGBX,
-  /**
-   * BGRX pixel format.  The red, green, and blue components in the image are
-   * stored in 4-byte pixels in the order B, G, R from lowest to highest byte
-   * address within each pixel.  The X component is ignored when compressing
-   * and undefined when decompressing.
-   */
-  TJPF_BGRX,
-  /**
-   * XBGR pixel format.  The red, green, and blue components in the image are
-   * stored in 4-byte pixels in the order R, G, B from highest to lowest byte
-   * address within each pixel.  The X component is ignored when compressing
-   * and undefined when decompressing.
-   */
-  TJPF_XBGR,
-  /**
-   * XRGB pixel format.  The red, green, and blue components in the image are
-   * stored in 4-byte pixels in the order B, G, R from highest to lowest byte
-   * address within each pixel.  The X component is ignored when compressing
-   * and undefined when decompressing.
-   */
-  TJPF_XRGB,
-  /**
-   * Grayscale pixel format.  Each 1-byte pixel represents a luminance
-   * (brightness) level from 0 to 255.
-   */
-  TJPF_GRAY,
-  /**
-   * RGBA pixel format.  This is the same as @ref TJPF_RGBX, except that when
-   * decompressing, the X component is guaranteed to be 0xFF, which can be
-   * interpreted as an opaque alpha channel.
-   */
-  TJPF_RGBA,
-  /**
-   * BGRA pixel format.  This is the same as @ref TJPF_BGRX, except that when
-   * decompressing, the X component is guaranteed to be 0xFF, which can be
-   * interpreted as an opaque alpha channel.
-   */
-  TJPF_BGRA,
-  /**
-   * ABGR pixel format.  This is the same as @ref TJPF_XBGR, except that when
-   * decompressing, the X component is guaranteed to be 0xFF, which can be
-   * interpreted as an opaque alpha channel.
-   */
-  TJPF_ABGR,
-  /**
-   * ARGB pixel format.  This is the same as @ref TJPF_XRGB, except that when
-   * decompressing, the X component is guaranteed to be 0xFF, which can be
-   * interpreted as an opaque alpha channel.
-   */
-  TJPF_ARGB
-};
-
-/**
- * Red offset (in bytes) for a given pixel format.  This specifies the number
- * of bytes that the red component is offset from the start of the pixel.  For
- * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,
- * then the red component will be <tt>pixel[tjRedOffset[TJ_BGRX]]</tt>.
- */
-static const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1};
-/**
- * Green offset (in bytes) for a given pixel format.  This specifies the number
- * of bytes that the green component is offset from the start of the pixel.
- * For instance, if a pixel of format TJ_BGRX is stored in
- * <tt>char pixel[]</tt>, then the green component will be
- * <tt>pixel[tjGreenOffset[TJ_BGRX]]</tt>.
- */
-static const int tjGreenOffset[TJ_NUMPF] = {1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2};
-/**
- * Blue offset (in bytes) for a given pixel format.  This specifies the number
- * of bytes that the Blue component is offset from the start of the pixel.  For
- * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,
- * then the blue component will be <tt>pixel[tjBlueOffset[TJ_BGRX]]</tt>.
- */
-static const int tjBlueOffset[TJ_NUMPF] = {2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3};
-
-/**
- * Pixel size (in bytes) for a given pixel format.
- */
-static const int tjPixelSize[TJ_NUMPF] = {3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4};
-
-
-/**
- * The uncompressed source/destination image is stored in bottom-up (Windows,
- * OpenGL) order, not top-down (X11) order.
- */
-#define TJFLAG_BOTTOMUP        2
-/**
- * Turn off CPU auto-detection and force TurboJPEG to use MMX code (IPP and
- * 32-bit libjpeg-turbo versions only.)
- */
-#define TJFLAG_FORCEMMX        8
-/**
- * Turn off CPU auto-detection and force TurboJPEG to use SSE code (32-bit IPP
- * and 32-bit libjpeg-turbo versions only)
- */
-#define TJFLAG_FORCESSE       16
-/**
- * Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (32-bit IPP
- * and 32-bit libjpeg-turbo versions only)
- */
-#define TJFLAG_FORCESSE2      32
-/**
- * Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (64-bit IPP
- * version only)
- */
-#define TJFLAG_FORCESSE3     128
-/**
- * Use fast, inaccurate chrominance upsampling routines in the JPEG
- * decompressor (libjpeg and libjpeg-turbo versions only)
- */
-#define TJFLAG_FASTUPSAMPLE  256
-
-
-/**
- * Scaling factor
- */
-typedef struct
-{
-  /**
-   * Numerator
-   */
-  int num;
-  /**
-   * Denominator
-   */
-  int denom;
-} tjscalingfactor;
-
-
-/**
- * TurboJPEG instance handle
- */
-typedef void* tjhandle;
-
-
-/**
- * Pad the given width to the nearest 32-bit boundary
- */
-#define TJPAD(width) (((width)+3)&(~3))
-
-/**
- * Compute the scaled value of <tt>dimension</tt> using the given scaling
- * factor.  This macro performs the integer equivalent of <tt>ceil(dimension *
- * scalingFactor)</tt>. 
- */
-#define TJSCALED(dimension, scalingFactor) ((dimension * scalingFactor.num \
-  + scalingFactor.denom - 1) / scalingFactor.denom)
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * Create a TurboJPEG compressor instance.
- *
- * @return a handle to the newly-created instance, or NULL if an error
- * occurred (see #tjGetErrorStr().)
- */
-DLLEXPORT tjhandle DLLCALL tjInitCompress(void);
-
-
-/**
- * Compress an RGB or grayscale image into a JPEG image.
- *
- * @param handle a handle to a TurboJPEG compressor or transformer instance
- * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
- *        to be compressed
- * @param width width (in pixels) of the source image
- * @param pitch bytes per line of the source image.  Normally, this should be
- *        <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded,
- *        or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of
- *        the image is padded to the nearest 32-bit boundary, as is the case
- *        for Windows bitmaps.  You can also be clever and use this parameter
- *        to skip lines, etc.  Setting this parameter to 0 is the equivalent of
- *        setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
- * @param height height (in pixels) of the source image
- * @param pixelFormat pixel format of the source image (see @ref TJPF
- *        "Pixel formats".)
- * @param jpegBuf address of a pointer to an image buffer that will receive the
- *        JPEG image.  TurboJPEG has the ability to reallocate the JPEG buffer
- *        to accommodate the size of the JPEG image.  Thus, you can choose to:
- *        -# pre-allocate the JPEG buffer with an arbitrary size using
- *        #tjAlloc() and let TurboJPEG grow the buffer as needed,
- *        -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the
- *        buffer for you, or
- *        -# pre-allocate the buffer to a "worst case" size determined by
- *        calling #tjBufSize().  This should ensure that the buffer never has
- *        to be re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
- *        .
- *        If you choose option 1, <tt>*jpegSize</tt> should be set to the
- *        size of your pre-allocated buffer.  In any case, unless you have
- *        set #TJFLAG_NOREALLOC, you should always check <tt>*jpegBuf</tt> upon
- *        return from this function, as it may have changed.
- * @param jpegSize pointer to an unsigned long variable that holds the size of
- *        the JPEG image buffer.  If <tt>*jpegBuf</tt> points to a
- *        pre-allocated buffer, then <tt>*jpegSize</tt> should be set to the
- *        size of the buffer.  Upon return, <tt>*jpegSize</tt> will contain the
- *        size of the JPEG image (in bytes.)
- * @param jpegSubsamp the level of chrominance subsampling to be used when
- *        generating the JPEG image (see @ref TJSAMP
- *        "Chrominance subsampling options".)
- * @param jpegQual the image quality of the generated JPEG image (1 = worst,
-          100 = best)
- * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
- *        "flags".
- *
- * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
-*/
-DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
-  int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,
-  unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags);
-
-
-/**
- * The maximum size of the buffer (in bytes) required to hold a JPEG image with
- * the given parameters.  The number of bytes returned by this function is
- * larger than the size of the uncompressed source image.  The reason for this
- * is that the JPEG format uses 16-bit coefficients, and it is thus possible
- * for a very high-quality JPEG image with very high frequency content to
- * expand rather than compress when converted to the JPEG format.  Such images
- * represent a very rare corner case, but since there is no way to predict the
- * size of a JPEG image prior to compression, the corner case has to be
- * handled.
- *
- * @param width width of the image (in pixels)
- * @param height height of the image (in pixels)
- * @param jpegSubsamp the level of chrominance subsampling to be used when
- *        generating the JPEG image (see @ref TJSAMP
- *        "Chrominance subsampling options".)
- *
- * @return the maximum size of the buffer (in bytes) required to hold the
- * image, or -1 if the arguments are out of bounds.
- */
-DLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,
-  int jpegSubsamp);
-
-
-/**
- * Create a TurboJPEG decompressor instance.
- *
- * @return a handle to the newly-created instance, or NULL if an error
- * occurred (see #tjGetErrorStr().)
-*/
-DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
-
-
-/**
- * Retrieve information about a JPEG image without decompressing it.
- *
- * @param handle a handle to a TurboJPEG decompressor or transformer instance
- * @param jpegBuf pointer to a buffer containing a JPEG image
- * @param jpegSize size of the JPEG image (in bytes)
- * @param width pointer to an integer variable that will receive the width (in
- *        pixels) of the JPEG image
- * @param height pointer to an integer variable that will receive the height
- *        (in pixels) of the JPEG image
- * @param jpegSubsamp pointer to an integer variable that will receive the
- *        level of chrominance subsampling used when compressing the JPEG image
- *        (see @ref TJSAMP "Chrominance subsampling options".)
- *
- * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
-*/
-DLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,
-  unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,
-  int *jpegSubsamp);
-
-
-/**
- * Returns a list of fractional scaling factors that the JPEG decompressor in
- * this implementation of TurboJPEG supports.
- *
- * @param numscalingfactors pointer to an integer variable that will receive
- *        the number of elements in the list
- *
- * @return a pointer to a list of fractional scaling factors, or NULL if an
- * error is encountered (see #tjGetErrorStr().)
-*/
-DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors);
-
-
-/**
- * Decompress a JPEG image to an RGB or grayscale image.
- *
- * @param handle a handle to a TurboJPEG decompressor or transformer instance
- * @param jpegBuf pointer to a buffer containing the JPEG image to decompress
- * @param jpegSize size of the JPEG image (in bytes)
- * @param dstBuf pointer to an image buffer that will receive the decompressed
- *        image.  This buffer should normally be <tt>pitch * scaledHeight</tt>
- *        bytes in size, where <tt>scaledHeight</tt> can be determined by
- *        calling #TJSCALED() with the JPEG image height and one of the scaling
- *        factors returned by #tjGetScalingFactors().  The dstBuf pointer may
- *        also be used to decompress into a specific region of a larger buffer.
- * @param width desired width (in pixels) of the destination image.  If this is
- *        smaller than the width of the JPEG image being decompressed, then
- *        TurboJPEG will use scaling in the JPEG decompressor to generate the
- *        largest possible image that will fit within the desired width.  If
- *        width is set to 0, then only the height will be considered when
- *        determining the scaled image size.
- * @param pitch bytes per line of the destination image.  Normally, this is
- *        <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt> if the decompressed
- *        image is unpadded, else <tt>#TJPAD(scaledWidth *
- *        #tjPixelSize[pixelFormat])</tt> if each line of the decompressed
- *        image is padded to the nearest 32-bit boundary, as is the case for
- *        Windows bitmaps.  (NOTE: <tt>scaledWidth</tt> can be determined by
- *        calling #TJSCALED() with the JPEG image width and one of the scaling
- *        factors returned by #tjGetScalingFactors().)  You can also be clever
- *        and use the pitch parameter to skip lines, etc.  Setting this
- *        parameter to 0 is the equivalent of setting it to <tt>scaledWidth
- *        * #tjPixelSize[pixelFormat]</tt>.
- * @param height desired height (in pixels) of the destination image.  If this
- *        is smaller than the height of the JPEG image being decompressed, then
- *        TurboJPEG will use scaling in the JPEG decompressor to generate the
- *        largest possible image that will fit within the desired height.  If
- *        height is set to 0, then only the width will be considered when
- *        determining the scaled image size.
- * @param pixelFormat pixel format of the destination image (see @ref
- *        TJPF "Pixel formats".)
- * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
- *        "flags".
- *
- * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
- */
-DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,
-  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
-  int width, int pitch, int height, int pixelFormat, int flags);
-
-
-/**
- * Destroy a TurboJPEG compressor, decompressor, or transformer instance.
- *
- * @param handle a handle to a TurboJPEG compressor, decompressor or
- *        transformer instance
- *
- * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
- */
-DLLEXPORT int DLLCALL tjDestroy(tjhandle handle);
-
-
-/**
- * Returns a descriptive error message explaining why the last command failed.
- *
- * @return a descriptive error message explaining why the last command failed.
- */
-DLLEXPORT char* DLLCALL tjGetErrorStr(void);
-
-
-/* Backward compatibility functions and macros (nothing to see here) */
-#define NUMSUBOPT TJ_NUMSAMP
-#define TJ_444 TJSAMP_444
-#define TJ_422 TJSAMP_422
-#define TJ_420 TJSAMP_420
-#define TJ_411 TJSAMP_420
-#define TJ_GRAYSCALE TJSAMP_GRAY
-
-#define TJ_BGR 1
-#define TJ_BOTTOMUP TJFLAG_BOTTOMUP
-#define TJ_FORCEMMX TJFLAG_FORCEMMX
-#define TJ_FORCESSE TJFLAG_FORCESSE
-#define TJ_FORCESSE2 TJFLAG_FORCESSE2
-#define TJ_ALPHAFIRST 64
-#define TJ_FORCESSE3 TJFLAG_FORCESSE3
-#define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE
-
-DLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height);
-
-DLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,
-  int width, int pitch, int height, int pixelSize, unsigned char *dstBuf,
-  unsigned long *compressedSize, int jpegSubsamp, int jpegQual, int flags);
-
-DLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,
-  unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height);
-
-DLLEXPORT int DLLCALL tjDecompress(tjhandle handle,
-  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
-  int width, int pitch, int height, int pixelSize, int flags);
-
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/ica/x11/common/vncauth.c b/ica/x11/common/vncauth.c
deleted file mode 100644
index 0b20f53..0000000
--- a/ica/x11/common/vncauth.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * vncauth.c - Functions for VNC password management and authentication.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE 600
-#endif
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <rfb/rfbproto.h>
-#include "d3des.h"
-
-#include <string.h>
-#include <math.h>
-
-#ifdef LIBVNCSERVER_HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#include <time.h>
-
-#ifdef WIN32
-#define srandom srand
-#define random rand
-#else
-#include <sys/time.h>
-#endif
-
-
-/* libvncclient does not need this */
-#ifndef rfbEncryptBytes
-
-/*
- * We use a fixed key to store passwords, since we assume that our local
- * file system is secure but nonetheless don't want to store passwords
- * as plaintext.
- */
-
-static unsigned char fixedkey[8] = {23,82,107,6,35,78,88,7};
-
-
-/*
- * Encrypt a password and store it in a file.  Returns 0 if successful,
- * 1 if the file could not be written.
- */
-
-int
-rfbEncryptAndStorePasswd(char *passwd, char *fname)
-{
-    FILE *fp;
-    unsigned int i;
-    unsigned char encryptedPasswd[8];
-
-    if ((fp = fopen(fname,"w")) == NULL) return 1;
-
-	/* windows security sux */
-#ifndef WIN32
-    fchmod(fileno(fp), S_IRUSR|S_IWUSR);
-#endif
-
-    /* pad password with nulls */
-
-    for (i = 0; i < 8; i++) {
-	if (i < strlen(passwd)) {
-	    encryptedPasswd[i] = passwd[i];
-	} else {
-	    encryptedPasswd[i] = 0;
-	}
-    }
-
-    /* Do encryption in-place - this way we overwrite our copy of the plaintext
-       password */
-
-    rfbDesKey(fixedkey, EN0);
-    rfbDes(encryptedPasswd, encryptedPasswd);
-
-    for (i = 0; i < 8; i++) {
-	putc(encryptedPasswd[i], fp);
-    }
-
-    fclose(fp);
-    return 0;
-}
-
-
-/*
- * Decrypt a password from a file.  Returns a pointer to a newly allocated
- * string containing the password or a null pointer if the password could
- * not be retrieved for some reason.
- */
-
-char *
-rfbDecryptPasswdFromFile(char *fname)
-{
-    FILE *fp;
-    int i, ch;
-    unsigned char *passwd = (unsigned char *)malloc(9);
-
-    if ((fp = fopen(fname,"r")) == NULL) {
-	free(passwd);
-	return NULL;
-    }
-
-    for (i = 0; i < 8; i++) {
-	ch = getc(fp);
-	if (ch == EOF) {
-	    fclose(fp);
-	    free(passwd);
-	    return NULL;
-	}
-	passwd[i] = ch;
-    }
-
-    fclose(fp);
-
-    rfbDesKey(fixedkey, DE1);
-    rfbDes(passwd, passwd);
-
-    passwd[8] = 0;
-
-    return (char *)passwd;
-}
-
-
-/*
- * Generate CHALLENGESIZE random bytes for use in challenge-response
- * authentication.
- */
-
-void
-rfbRandomBytes(unsigned char *bytes)
-{
-    int i;
-    static rfbBool s_srandom_called = FALSE;
-
-    if (!s_srandom_called) {
-	srandom((unsigned int)time(NULL) ^ (unsigned int)getpid());
-	s_srandom_called = TRUE;
-    }
-
-    for (i = 0; i < CHALLENGESIZE; i++) {
-	bytes[i] = (unsigned char)(random() & 255);
-    }
-}
-
-#endif
-
-/*
- * Encrypt CHALLENGESIZE bytes in memory using a password.
- */
-
-void
-rfbEncryptBytes(unsigned char *bytes, char *passwd)
-{
-    unsigned char key[8];
-    unsigned int i;
-
-    /* key is simply password padded with nulls */
-
-    for (i = 0; i < 8; i++) {
-	if (i < strlen(passwd)) {
-	    key[i] = passwd[i];
-	} else {
-	    key[i] = 0;
-	}
-    }
-
-    rfbDesKey(key, EN0);
-
-    for (i = 0; i < CHALLENGESIZE; i += 8) {
-	rfbDes(bytes+i, bytes+i);
-    }
-}
-
-void
-rfbEncryptBytes2(unsigned char *where, const int length, unsigned char *key) {
-  int i, j;
-  rfbDesKey(key, EN0);
-  for (i = 0; i< 8; i++)
-    where[i] ^= key[i];
-  rfbDes(where, where);
-  for (i = 8; i < length; i += 8) {
-    for (j = 0; j < 8; j++)
-      where[i + j] ^= where[i + j - 8];
-      rfbDes(where + i, where + i);
-  }
-}
diff --git a/ica/x11/common/zywrletemplate.c b/ica/x11/common/zywrletemplate.c
deleted file mode 100644
index 904de40..0000000
--- a/ica/x11/common/zywrletemplate.c
+++ /dev/null
@@ -1,828 +0,0 @@
-
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE 'ZYWRLE' VNC CODEC SOURCE CODE.         *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A FOLLOWING BSD-STYLE SOURCE LICENSE.                *
- * PLEASE READ THESE TERMS BEFORE DISTRIBUTING.                     *
- *                                                                  *
- * THE 'ZYWRLE' VNC CODEC SOURCE CODE IS (C) COPYRIGHT 2006         *
- * BY Hitachi Systems & Services, Ltd.                              *
- * (Noriaki Yamazaki, Research & Developement Center)               *                                                                 *
- *                                                                  *
- ********************************************************************
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-- Neither the name of the Hitachi Systems & Services, Ltd. nor
-the names of its contributors may be used to endorse or promote
-products derived from this software without specific prior written
-permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- ********************************************************************/
-
-/* Change Log:
-     V0.02 : 2008/02/04 : Fix mis encode/decode when width != scanline
-	                     (Thanks Johannes Schindelin, author of LibVNC
-						  Server/Client)
-     V0.01 : 2007/02/06 : Initial release
-*/
-
-/* #define ZYWRLE_ENCODE */
-/* #define ZYWRLE_DECODE */
-#define ZYWRLE_QUANTIZE
-
-/*
-[References]
- PLHarr:
-   Senecal, J. G., P. Lindstrom, M. A. Duchaineau, and K. I. Joy, "An Improved N-Bit to N-Bit Reversible Haar-Like Transform," Pacific Graphics 2004, October 2004, pp. 371-380.
- EZW:
-   Shapiro, JM: Embedded Image Coding Using Zerotrees of Wavelet Coefficients, IEEE Trans. Signal. Process., Vol.41, pp.3445-3462 (1993).
-*/
-
-
-/* Template Macro stuffs. */
-#undef ZYWRLE_ANALYZE
-#undef ZYWRLE_SYNTHESIZE
-#define ZYWRLE_ANALYZE __RFB_CONCAT3E(zywrleAnalyze,BPP,END_FIX)
-#define ZYWRLE_SYNTHESIZE __RFB_CONCAT3E(zywrleSynthesize,BPP,END_FIX)
-
-#define ZYWRLE_RGBYUV __RFB_CONCAT3E(zywrleRGBYUV,BPP,END_FIX)
-#define ZYWRLE_YUVRGB __RFB_CONCAT3E(zywrleYUVRGB,BPP,END_FIX)
-#define ZYWRLE_YMASK __RFB_CONCAT2E(ZYWRLE_YMASK,BPP)
-#define ZYWRLE_UVMASK __RFB_CONCAT2E(ZYWRLE_UVMASK,BPP)
-#define ZYWRLE_LOAD_PIXEL __RFB_CONCAT2E(ZYWRLE_LOAD_PIXEL,BPP)
-#define ZYWRLE_SAVE_PIXEL __RFB_CONCAT2E(ZYWRLE_SAVE_PIXEL,BPP)
-
-/* Packing/Unpacking pixel stuffs.
-   Endian conversion stuffs. */
-#undef S_0
-#undef S_1
-#undef L_0
-#undef L_1
-#undef L_2
-#if ZYWRLE_ENDIAN == ENDIAN_BIG
-#  define S_0	1
-#  define S_1	0
-#  define L_0	3
-#  define L_1	2
-#  define L_2	1
-#else
-#  define S_0	0
-#  define S_1	1
-#  define L_0	0
-#  define L_1	1
-#  define L_2	2
-#endif
-
-/*   Load/Save pixel stuffs. */
-#define ZYWRLE_YMASK15  0xFFFFFFF8
-#define ZYWRLE_UVMASK15 0xFFFFFFF8
-#define ZYWRLE_LOAD_PIXEL15(pSrc,R,G,B) { \
-	R =  (((unsigned char*)pSrc)[S_1]<< 1)& 0xF8;	\
-	G = ((((unsigned char*)pSrc)[S_1]<< 6)|(((unsigned char*)pSrc)[S_0]>> 2))& 0xF8;	\
-	B =  (((unsigned char*)pSrc)[S_0]<< 3)& 0xF8;	\
-}
-#define ZYWRLE_SAVE_PIXEL15(pDst,R,G,B) { \
-	R &= 0xF8;	\
-	G &= 0xF8;	\
-	B &= 0xF8;	\
-	((unsigned char*)pDst)[S_1] = (unsigned char)( (R>>1)|(G>>6)       );	\
-	((unsigned char*)pDst)[S_0] = (unsigned char)(((B>>3)|(G<<2))& 0xFF);	\
-}
-#define ZYWRLE_YMASK16  0xFFFFFFFC
-#define ZYWRLE_UVMASK16 0xFFFFFFF8
-#define ZYWRLE_LOAD_PIXEL16(pSrc,R,G,B) { \
-	R =   ((unsigned char*)pSrc)[S_1]     & 0xF8;	\
-	G = ((((unsigned char*)pSrc)[S_1]<< 5)|(((unsigned char*)pSrc)[S_0]>> 3))& 0xFC;	\
-	B =  (((unsigned char*)pSrc)[S_0]<< 3)& 0xF8;	\
-}
-#define ZYWRLE_SAVE_PIXEL16(pDst,R,G,B) { \
-	R &= 0xF8;	\
-	G &= 0xFC;	\
-	B &= 0xF8;	\
-	((unsigned char*)pDst)[S_1] = (unsigned char)(  R    |(G>>5)       );	\
-	((unsigned char*)pDst)[S_0] = (unsigned char)(((B>>3)|(G<<3))& 0xFF);	\
-}
-#define ZYWRLE_YMASK32  0xFFFFFFFF
-#define ZYWRLE_UVMASK32 0xFFFFFFFF
-#define ZYWRLE_LOAD_PIXEL32(pSrc,R,G,B) { \
-	R = ((unsigned char*)pSrc)[L_2];	\
-	G = ((unsigned char*)pSrc)[L_1];	\
-	B = ((unsigned char*)pSrc)[L_0];	\
-}
-#define ZYWRLE_SAVE_PIXEL32(pDst,R,G,B) { \
-	((unsigned char*)pDst)[L_2] = (unsigned char)R;	\
-	((unsigned char*)pDst)[L_1] = (unsigned char)G;	\
-	((unsigned char*)pDst)[L_0] = (unsigned char)B;	\
-}
-
-#ifndef ZYWRLE_ONCE
-#define ZYWRLE_ONCE
-
-#ifdef WIN32
-#define InlineX __inline
-#else
-# ifndef __STRICT_ANSI__
-#  define InlineX inline
-# else
-#  define InlineX
-# endif
-#endif
-
-#ifdef ZYWRLE_ENCODE
-/* Tables for Coefficients filtering. */
-#  ifndef ZYWRLE_QUANTIZE
-/* Type A:lower bit omitting of EZW style. */
-const static unsigned int zywrleParam[3][3]={
-	{0x0000F000,0x00000000,0x00000000},
-	{0x0000C000,0x00F0F0F0,0x00000000},
-	{0x0000C000,0x00C0C0C0,0x00F0F0F0},
-/*	{0x0000FF00,0x00000000,0x00000000},
-	{0x0000FF00,0x00FFFFFF,0x00000000},
-	{0x0000FF00,0x00FFFFFF,0x00FFFFFF}, */
-};
-#  else
-/* Type B:Non liner quantization filter. */
-static const signed char zywrleConv[4][256]={
-{	/* bi=5, bo=5 r=0.0:PSNR=24.849 */
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-},
-{	/* bi=5, bo=5 r=2.0:PSNR=74.031 */
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 32,
-	32, 32, 32, 32, 32, 32, 32, 32,
-	32, 32, 32, 32, 32, 32, 32, 32,
-	48, 48, 48, 48, 48, 48, 48, 48,
-	48, 48, 48, 56, 56, 56, 56, 56,
-	56, 56, 56, 56, 64, 64, 64, 64,
-	64, 64, 64, 64, 72, 72, 72, 72,
-	72, 72, 72, 72, 80, 80, 80, 80,
-	80, 80, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 96, 96,
-	96, 96, 96, 104, 104, 104, 104, 104,
-	104, 104, 104, 104, 104, 112, 112, 112,
-	112, 112, 112, 112, 112, 112, 120, 120,
-	120, 120, 120, 120, 120, 120, 120, 120,
-	0, -120, -120, -120, -120, -120, -120, -120,
-	-120, -120, -120, -112, -112, -112, -112, -112,
-	-112, -112, -112, -112, -104, -104, -104, -104,
-	-104, -104, -104, -104, -104, -104, -96, -96,
-	-96, -96, -96, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -80,
-	-80, -80, -80, -80, -80, -72, -72, -72,
-	-72, -72, -72, -72, -72, -64, -64, -64,
-	-64, -64, -64, -64, -64, -56, -56, -56,
-	-56, -56, -56, -56, -56, -56, -48, -48,
-	-48, -48, -48, -48, -48, -48, -48, -48,
-	-48, -32, -32, -32, -32, -32, -32, -32,
-	-32, -32, -32, -32, -32, -32, -32, -32,
-	-32, -32, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-},
-{	/* bi=5, bo=4 r=2.0:PSNR=64.441 */
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	48, 48, 48, 48, 48, 48, 48, 48,
-	48, 48, 48, 48, 48, 48, 48, 48,
-	48, 48, 48, 48, 48, 48, 48, 48,
-	64, 64, 64, 64, 64, 64, 64, 64,
-	64, 64, 64, 64, 64, 64, 64, 64,
-	80, 80, 80, 80, 80, 80, 80, 80,
-	80, 80, 80, 80, 80, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	104, 104, 104, 104, 104, 104, 104, 104,
-	104, 104, 104, 112, 112, 112, 112, 112,
-	112, 112, 112, 112, 120, 120, 120, 120,
-	120, 120, 120, 120, 120, 120, 120, 120,
-	0, -120, -120, -120, -120, -120, -120, -120,
-	-120, -120, -120, -120, -120, -112, -112, -112,
-	-112, -112, -112, -112, -112, -112, -104, -104,
-	-104, -104, -104, -104, -104, -104, -104, -104,
-	-104, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -80, -80, -80, -80,
-	-80, -80, -80, -80, -80, -80, -80, -80,
-	-80, -64, -64, -64, -64, -64, -64, -64,
-	-64, -64, -64, -64, -64, -64, -64, -64,
-	-64, -48, -48, -48, -48, -48, -48, -48,
-	-48, -48, -48, -48, -48, -48, -48, -48,
-	-48, -48, -48, -48, -48, -48, -48, -48,
-	-48, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-},
-{	/* bi=5, bo=2 r=2.0:PSNR=43.175 */
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	88, 88, 88, 88, 88, 88, 88, 88,
-	0, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, -88, -88, -88, -88, -88, -88, -88,
-	-88, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0,
-}
-};
-const static signed char* zywrleParam[3][3][3]={
-	{{zywrleConv[0],zywrleConv[2],zywrleConv[0]},{zywrleConv[0],zywrleConv[0],zywrleConv[0]},{zywrleConv[0],zywrleConv[0],zywrleConv[0]}},
-	{{zywrleConv[0],zywrleConv[3],zywrleConv[0]},{zywrleConv[1],zywrleConv[1],zywrleConv[1]},{zywrleConv[0],zywrleConv[0],zywrleConv[0]}},
-	{{zywrleConv[0],zywrleConv[3],zywrleConv[0]},{zywrleConv[2],zywrleConv[2],zywrleConv[2]},{zywrleConv[1],zywrleConv[1],zywrleConv[1]}},
-};
-#  endif
-#endif
-
-static InlineX void Harr(signed char* pX0, signed char* pX1)
-{
-	/* Piecewise-Linear Harr(PLHarr) */
-	int X0 = (int)*pX0, X1 = (int)*pX1;
-	int orgX0 = X0, orgX1 = X1;
-	if ((X0 ^ X1) & 0x80) {
-		/* differ sign */
-		X1 += X0;
-		if (((X1^orgX1)&0x80)==0) {
-			/* |X1| > |X0| */
-			X0 -= X1;	/* H = -B */
-		}
-	} else {
-		/* same sign */
-		X0 -= X1;
-		if (((X0 ^ orgX0) & 0x80) == 0) {
-			/* |X0| > |X1| */
-			X1 += X0;	/* L = A */
-		}
-	}
-	*pX0 = (signed char)X1;
-	*pX1 = (signed char)X0;
-}
-/*
- 1D-Wavelet transform.
-
- In coefficients array, the famous 'pyramid' decomposition is well used.
-
- 1D Model:
-   |L0L0L0L0|L0L0L0L0|H0H0H0H0|H0H0H0H0| : level 0
-   |L1L1L1L1|H1H1H1H1|H0H0H0H0|H0H0H0H0| : level 1
-
- But this method needs line buffer because H/L is different position from X0/X1.
- So, I used 'interleave' decomposition instead of it.
-
- 1D Model:
-   |L0H0L0H0|L0H0L0H0|L0H0L0H0|L0H0L0H0| : level 0
-   |L1H0H1H0|L1H0H1H0|L1H0H1H0|L1H0H1H0| : level 1
-
- In this method, H/L and X0/X1 is always same position.
- This lead us to more speed and less memory.
- Of cause, the result of both method is quite same
- because it's only difference that coefficient position.
-*/
-static InlineX void WaveletLevel(int* data, int size, int l, int SkipPixel)
-{
-	int s, ofs;
-	signed char* pX0;
-	signed char* end;
-
-	pX0 = (signed char*)data;
-	s = (8<<l)*SkipPixel;
-	end = pX0+(size>>(l+1))*s;
-	s -= 2;
-	ofs = (4<<l)*SkipPixel;
-	while (pX0 < end) {
-		Harr(pX0, pX0+ofs);
-		pX0++;
-		Harr(pX0, pX0+ofs);
-		pX0++;
-		Harr(pX0, pX0+ofs);
-		pX0 += s;
-	}
-}
-#define InvWaveletLevel(d,s,l,pix) WaveletLevel(d,s,l,pix)
-
-#ifdef ZYWRLE_ENCODE
-#  ifndef ZYWRLE_QUANTIZE
-/* Type A:lower bit omitting of EZW style. */
-static InlineX void FilterWaveletSquare(int* pBuf, int width, int height, int level, int l)
-{
-	int r, s;
-	int x, y;
-	int* pH;
-	const unsigned int* pM;
-
-	pM = &(zywrleParam[level-1][l]);
-	s = 2<<l;
-	for (r = 1; r < 4; r++) {
-		pH   = pBuf;
-		if (r & 0x01)
-			pH +=  s>>1;
-		if (r & 0x02)
-			pH += (s>>1)*width;
-		for (y = 0; y < height / s; y++) {
-			for (x = 0; x < width / s; x++) {
-				/*
-				 these are same following code.
-				     pH[x] = pH[x] / (~pM[x]+1) * (~pM[x]+1);
-				     ( round pH[x] with pM[x] bit )
-				 '&' operator isn't 'round' but is 'floor'.
-				 So, we must offset when pH[x] is negative.
-				*/
-				if (((signed char*)pH)[0] & 0x80)
-					((signed char*)pH)[0] += ~((signed char*)pM)[0];
-				if (((signed char*)pH)[1] & 0x80)
-					((signed char*)pH)[1] += ~((signed char*)pM)[1];
-				if (((signed char*)pH)[2] & 0x80)
-					((signed char*)pH)[2] += ~((signed char*)pM)[2];
-				*pH &= *pM;
-				pH += s;
-			}
-			pH += (s-1)*width;
-		}
-	}
-}
-#  else
-/*
- Type B:Non liner quantization filter.
-
- Coefficients have Gaussian curve and smaller value which is
- large part of coefficients isn't more important than larger value.
- So, I use filter of Non liner quantize/dequantize table.
- In general, Non liner quantize formula is explained as following.
-
-    y=f(x)   = sign(x)*round( ((abs(x)/(2^7))^ r   )* 2^(bo-1) )*2^(8-bo)
-    x=f-1(y) = sign(y)*round( ((abs(y)/(2^7))^(1/r))* 2^(bi-1) )*2^(8-bi)
- ( r:power coefficient  bi:effective MSB in input  bo:effective MSB in output )
-
-   r < 1.0 : Smaller value is more important than larger value.
-   r > 1.0 : Larger value is more important than smaller value.
-   r = 1.0 : Liner quantization which is same with EZW style.
-
- r = 0.75 is famous non liner quantization used in MP3 audio codec.
- In contrast to audio data, larger value is important in wavelet coefficients.
- So, I select r = 2.0 table( quantize is x^2, dequantize sqrt(x) ).
-
- As compared with EZW style liner quantization, this filter tended to be
- more sharp edge and be more compression rate but be more blocking noise and be less quality.
- Especially, the surface of graphic objects has distinguishable noise in middle quality mode.
-
- We need only quantized-dequantized(filtered) value rather than quantized value itself
- because all values are packed or palette-lized in later ZRLE section.
- This lead us not to need to modify client decoder when we change
- the filtering procedure in future.
- Client only decodes coefficients given by encoder.
-*/
-static InlineX void FilterWaveletSquare(int* pBuf, int width, int height, int level, int l)
-{
-	int r, s;
-	int x, y;
-	int* pH;
-	const signed char** pM;
-
-	pM = zywrleParam[level-1][l];
-	s = 2<<l;
-	for (r = 1; r < 4; r++) {
-		pH   = pBuf;
-		if (r & 0x01)
-			pH +=  s>>1;
-		if (r & 0x02)
-			pH += (s>>1)*width;
-		for (y = 0; y < height / s; y++) {
-			for (x = 0; x < width / s; x++) {
-				((signed char*)pH)[0] = pM[0][((unsigned char*)pH)[0]];
-				((signed char*)pH)[1] = pM[1][((unsigned char*)pH)[1]];
-				((signed char*)pH)[2] = pM[2][((unsigned char*)pH)[2]];
-				pH += s;
-			}
-			pH += (s-1)*width;
-		}
-	}
-}
-#  endif
-
-static InlineX void Wavelet(int* pBuf, int width, int height, int level)
-{
-	int l, s;
-	int* pTop;
-	int* pEnd;
-
-	for (l = 0; l < level; l++) {
-		pTop = pBuf;
-		pEnd = pBuf+height*width;
-		s = width<<l;
-		while (pTop < pEnd) {
-			WaveletLevel(pTop, width, l, 1);
-			pTop += s;
-		}
-		pTop = pBuf;
-		pEnd = pBuf+width;
-		s = 1<<l;
-		while (pTop < pEnd) {
-			WaveletLevel(pTop, height,l, width);
-			pTop += s;
-		}
-		FilterWaveletSquare(pBuf, width, height, level, l);
-	}
-}
-#endif
-#ifdef ZYWRLE_DECODE
-static InlineX void InvWavelet(int* pBuf, int width, int height, int level)
-{
-	int l, s;
-	int* pTop;
-	int* pEnd;
-
-	for (l = level - 1; l >= 0; l--) {
-		pTop = pBuf;
-		pEnd = pBuf+width;
-		s = 1<<l;
-		while (pTop < pEnd) {
-			InvWaveletLevel(pTop, height,l, width);
-			pTop += s;
-		}
-		pTop = pBuf;
-		pEnd = pBuf+height*width;
-		s = width<<l;
-		while (pTop < pEnd) {
-			InvWaveletLevel(pTop, width, l, 1);
-			pTop += s;
-		}
-	}
-}
-#endif
-
-/* Load/Save coefficients stuffs.
- Coefficients manages as 24 bits little-endian pixel. */
-#define ZYWRLE_LOAD_COEFF(pSrc,R,G,B) { \
-	R = ((signed char*)pSrc)[2];	\
-	G = ((signed char*)pSrc)[1];	\
-	B = ((signed char*)pSrc)[0];	\
-}
-#define ZYWRLE_SAVE_COEFF(pDst,R,G,B) { \
-	((signed char*)pDst)[2] = (signed char)R;	\
-	((signed char*)pDst)[1] = (signed char)G;	\
-	((signed char*)pDst)[0] = (signed char)B;	\
-}
-
-/*
- RGB <=> YUV conversion stuffs.
- YUV coversion is explained as following formula in strict meaning:
-   Y =  0.299R + 0.587G + 0.114B (   0<=Y<=255)
-   U = -0.169R - 0.331G + 0.500B (-128<=U<=127)
-   V =  0.500R - 0.419G - 0.081B (-128<=V<=127)
-
- I use simple conversion RCT(reversible color transform) which is described
- in JPEG-2000 specification.
-   Y = (R + 2G + B)/4 (   0<=Y<=255)
-   U = B-G (-256<=U<=255)
-   V = R-G (-256<=V<=255)
-*/
-#define ROUND(x) (((x)<0)?0:(((x)>255)?255:(x)))
-	/* RCT is N-bit RGB to N-bit Y and N+1-bit UV.
-	 For make Same N-bit, UV is lossy.
-	 More exact PLHarr, we reduce to odd range(-127<=x<=127). */
-#define ZYWRLE_RGBYUV1(R,G,B,Y,U,V,ymask,uvmask) { \
-	Y = (R+(G<<1)+B)>>2;	\
-	U =  B-G;	\
-	V =  R-G;	\
-	Y -= 128;	\
-	U >>= 1;	\
-	V >>= 1;	\
-	Y &= ymask;	\
-	U &= uvmask;	\
-	V &= uvmask;	\
-	if (Y == -128)	\
-		Y += (0xFFFFFFFF-ymask+1);	\
-	if (U == -128)	\
-		U += (0xFFFFFFFF-uvmask+1);	\
-	if (V == -128)	\
-		V += (0xFFFFFFFF-uvmask+1);	\
-}
-#define ZYWRLE_YUVRGB1(R,G,B,Y,U,V) { \
-	Y += 128;	\
-	U <<= 1;	\
-	V <<= 1;	\
-	G = Y-((U+V)>>2);	\
-	B = U+G;	\
-	R = V+G;	\
-	G = ROUND(G);	\
-	B = ROUND(B);	\
-	R = ROUND(R);	\
-}
-
-/*
- coefficient packing/unpacking stuffs.
- Wavelet transform makes 4 sub coefficient image from 1 original image.
-
- model with pyramid decomposition:
-   +------+------+
-   |      |      |
-   |  L   |  Hx  |
-   |      |      |
-   +------+------+
-   |      |      |
-   |  H   |  Hxy |
-   |      |      |
-   +------+------+
-
- So, we must transfer each sub images individually in strict meaning.
- But at least ZRLE meaning, following one decompositon image is same as
- avobe individual sub image. I use this format.
- (Strictly saying, transfer order is reverse(Hxy->Hy->Hx->L)
-  for simplified procedure for any wavelet level.)
-
-   +------+------+
-   |      L      |
-   +------+------+
-   |      Hx     |
-   +------+------+
-   |      Hy     |
-   +------+------+
-   |      Hxy    |
-   +------+------+
-*/
-#define INC_PTR(data) \
-	data++;	\
-	if( data-pData >= (w+uw) ){	\
-		data += scanline-(w+uw);	\
-		pData = data;	\
-	}
-
-#define ZYWRLE_TRANSFER_COEFF(pBuf,data,r,w,h,scanline,level,TRANS)	\
-	pH = pBuf;	\
-	s = 2<<level;	\
-	if (r & 0x01)	\
-		pH +=  s>>1;	\
-	if (r & 0x02)	\
-		pH += (s>>1)*w;	\
-	pEnd = pH+h*w;	\
-	while (pH < pEnd) {	\
-		pLine = pH+w;	\
-		while (pH < pLine) {	\
-			TRANS	\
-			INC_PTR(data)	\
-			pH += s;	\
-		}	\
-		pH += (s-1)*w;	\
-	}
-
-#define ZYWRLE_PACK_COEFF(pBuf,data,r,width,height,scanline,level)	\
-	ZYWRLE_TRANSFER_COEFF(pBuf,data,r,width,height,scanline,level,ZYWRLE_LOAD_COEFF(pH,R,G,B);ZYWRLE_SAVE_PIXEL(data,R,G,B);)
-
-#define ZYWRLE_UNPACK_COEFF(pBuf,data,r,width,height,scanline,level)	\
-	ZYWRLE_TRANSFER_COEFF(pBuf,data,r,width,height,scanline,level,ZYWRLE_LOAD_PIXEL(data,R,G,B);ZYWRLE_SAVE_COEFF(pH,R,G,B);)
-
-#define ZYWRLE_SAVE_UNALIGN(data,TRANS)	\
-	pTop = pBuf+w*h;	\
-	pEnd = pBuf + (w+uw)*(h+uh);	\
-	while (pTop < pEnd) {	\
-		TRANS	\
-		INC_PTR(data)	\
-		pTop++;	\
-	}
-
-#define ZYWRLE_LOAD_UNALIGN(data,TRANS)	\
-	pTop = pBuf+w*h;	\
-	if (uw) {	\
-		pData=         data + w;	\
-		pEnd = (int*)(pData+ h*scanline);	\
-		while (pData < (PIXEL_T*)pEnd) {	\
-			pLine = (int*)(pData + uw);	\
-			while (pData < (PIXEL_T*)pLine) {	\
-				TRANS	\
-				pData++;	\
-				pTop++;	\
-			}	\
-			pData += scanline-uw;	\
-		}	\
-	}	\
-	if (uh) {	\
-		pData=         data +  h*scanline;	\
-		pEnd = (int*)(pData+ uh*scanline);	\
-		while (pData < (PIXEL_T*)pEnd) {	\
-			pLine = (int*)(pData + w);	\
-			while (pData < (PIXEL_T*)pLine) {	\
-				TRANS	\
-				pData++;	\
-				pTop++;	\
-			}	\
-			pData += scanline-w;	\
-		}	\
-	}	\
-	if (uw && uh) {	\
-		pData=         data + w+ h*scanline;	\
-		pEnd = (int*)(pData+   uh*scanline);	\
-		while (pData < (PIXEL_T*)pEnd) {	\
-			pLine = (int*)(pData + uw);	\
-			while (pData < (PIXEL_T*)pLine) {	\
-				TRANS	\
-				pData++;	\
-				pTop++;	\
-			}	\
-			pData += scanline-uw;	\
-		}	\
-	}
-
-static InlineX void zywrleCalcSize(int* pW, int* pH, int level)
-{
-	*pW &= ~((1<<level)-1);
-	*pH &= ~((1<<level)-1);
-}
-
-#endif /* ZYWRLE_ONCE */
-
-#ifndef CPIXEL
-#ifdef ZYWRLE_ENCODE
-static InlineX void ZYWRLE_RGBYUV(int* pBuf, PIXEL_T* data, int width, int height, int scanline)
-{
-	int R, G, B;
-	int Y, U, V;
-	int* pLine;
-	int* pEnd;
-	pEnd = pBuf+height*width;
-	while (pBuf < pEnd) {
-		pLine = pBuf+width;
-		while (pBuf < pLine) {
-			ZYWRLE_LOAD_PIXEL(data,R,G,B);
-			ZYWRLE_RGBYUV1(R,G,B,Y,U,V,ZYWRLE_YMASK,ZYWRLE_UVMASK);
-			ZYWRLE_SAVE_COEFF(pBuf,V,Y,U);
-			pBuf++;
-			data++;
-		}
-		data += scanline-width;
-	}
-}
-#endif
-#ifdef ZYWRLE_DECODE
-static InlineX void ZYWRLE_YUVRGB(int* pBuf, PIXEL_T* data, int width, int height, int scanline) {
-	int R, G, B;
-	int Y, U, V;
-	int* pLine;
-	int* pEnd;
-	pEnd = pBuf+height*width;
-	while (pBuf < pEnd) {
-		pLine = pBuf+width;
-		while (pBuf < pLine) {
-			ZYWRLE_LOAD_COEFF(pBuf,V,Y,U);
-			ZYWRLE_YUVRGB1(R,G,B,Y,U,V);
-			ZYWRLE_SAVE_PIXEL(data,R,G,B);
-			pBuf++;
-			data++;
-		}
-		data += scanline-width;
-	}
-}
-#endif
-
-#ifdef ZYWRLE_ENCODE
-PIXEL_T* ZYWRLE_ANALYZE(PIXEL_T* dst, PIXEL_T* src, int w, int h, int scanline, int level, int* pBuf) {
-	int l;
-	int uw = w;
-	int uh = h;
-	int* pTop;
-	int* pEnd;
-	int* pLine;
-	PIXEL_T* pData;
-	int R, G, B;
-	int s;
-	int* pH;
-
-	zywrleCalcSize(&w, &h, level);
-	if (w == 0 || h == 0)
-		return NULL;
-	uw -= w;
-	uh -= h;
-
-	pData = dst;
-	ZYWRLE_LOAD_UNALIGN(src,*(PIXEL_T*)pTop=*pData;)
-	ZYWRLE_RGBYUV(pBuf, src, w, h, scanline);
-	Wavelet(pBuf, w, h, level);
-	for (l = 0; l < level; l++) {
-		ZYWRLE_PACK_COEFF(pBuf, dst, 3, w, h, scanline, l);
-		ZYWRLE_PACK_COEFF(pBuf, dst, 2, w, h, scanline, l);
-		ZYWRLE_PACK_COEFF(pBuf, dst, 1, w, h, scanline, l);
-		if (l == level - 1) {
-			ZYWRLE_PACK_COEFF(pBuf, dst, 0, w, h, scanline, l);
-		}
-	}
-	ZYWRLE_SAVE_UNALIGN(dst,*dst=*(PIXEL_T*)pTop;)
-	return dst;
-}
-#endif
-#ifdef ZYWRLE_DECODE
-PIXEL_T* ZYWRLE_SYNTHESIZE(PIXEL_T* dst, PIXEL_T* src, int w, int h, int scanline, int level, int* pBuf)
-{
-	int l;
-	int uw = w;
-	int uh = h;
-	int* pTop;
-	int* pEnd;
-	int* pLine;
-	PIXEL_T* pData;
-	int R, G, B;
-	int s;
-	int* pH;
-
-	zywrleCalcSize(&w, &h, level);
-	if (w == 0 || h == 0)
-		return NULL;
-	uw -= w;
-	uh -= h;
-
-	pData = src;
-	for (l = 0; l < level; l++) {
-		ZYWRLE_UNPACK_COEFF(pBuf, src, 3, w, h, scanline, l);
-		ZYWRLE_UNPACK_COEFF(pBuf, src, 2, w, h, scanline, l);
-		ZYWRLE_UNPACK_COEFF(pBuf, src, 1, w, h, scanline, l);
-		if (l == level - 1) {
-			ZYWRLE_UNPACK_COEFF(pBuf, src, 0, w, h, scanline, l);
-		}
-	}
-	ZYWRLE_SAVE_UNALIGN(src,*(PIXEL_T*)pTop=*src;)
-	InvWavelet(pBuf, w, h, level);
-	ZYWRLE_YUVRGB(pBuf, dst, w, h, scanline);
-	ZYWRLE_LOAD_UNALIGN(dst,*pData=*(PIXEL_T*)pTop;)
-	return src;
-}
-#endif
-#endif  /* CPIXEL */
-
-#undef ZYWRLE_RGBYUV
-#undef ZYWRLE_YUVRGB
-#undef ZYWRLE_LOAD_PIXEL
-#undef ZYWRLE_SAVE_PIXEL
diff --git a/ica/x11/libvncclient/corre.c b/ica/x11/libvncclient/corre.c
deleted file mode 100644
index baf91cc..0000000
--- a/ica/x11/libvncclient/corre.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * corre.c - handle CoRRE encoding.
- *
- * This file shouldn't be compiled directly.  It is included multiple times by
- * rfbproto.c, each time with a different definition of the macro BPP.  For
- * each value of BPP, this file defines a function which handles a CoRRE
- * encoded rectangle with BPP bits per pixel.
- */
-
-#define HandleCoRREBPP CONCAT2E(HandleCoRRE,BPP)
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-
-static rfbBool
-HandleCoRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-    rfbRREHeader hdr;
-    int i;
-    CARDBPP pix;
-    uint8_t *ptr;
-    int x, y, w, h;
-
-    if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
-	return FALSE;
-
-    hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
-
-    if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
-	return FALSE;
-
-    FillRectangle(client, rx, ry, rw, rh, pix);
-
-    if (!ReadFromRFBServer(client, client->buffer, hdr.nSubrects * (4 + (BPP / 8))))
-	return FALSE;
-
-    ptr = (uint8_t *)client->buffer;
-
-    for (i = 0; i < hdr.nSubrects; i++) {
-	pix = *(CARDBPP *)ptr;
-	ptr += BPP/8;
-	x = *ptr++;
-	y = *ptr++;
-	w = *ptr++;
-	h = *ptr++;
-
-	FillRectangle(client, rx+x, ry+y, w, h, pix);
-    }
-
-    return TRUE;
-}
-
-#undef CARDBPP
diff --git a/ica/x11/libvncclient/cursor.c b/ica/x11/libvncclient/cursor.c
deleted file mode 100644
index a48d7c5..0000000
--- a/ica/x11/libvncclient/cursor.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *  Copyright (C) 2001,2002 Constantin Kaplinsky.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * cursor.c - code to support cursor shape updates (XCursor and
- * RichCursor preudo-encodings).
- */
-
-#include <rfb/rfbclient.h>
-
-
-#define OPER_SAVE     0
-#define OPER_RESTORE  1
-
-#define RGB24_TO_PIXEL(bpp,r,g,b)                                       \
-   ((((uint##bpp##_t)(r) & 0xFF) * client->format.redMax + 127) / 255             \
-    << client->format.redShift |                                              \
-    (((uint##bpp##_t)(g) & 0xFF) * client->format.greenMax + 127) / 255           \
-    << client->format.greenShift |                                            \
-    (((uint##bpp##_t)(b) & 0xFF) * client->format.blueMax + 127) / 255            \
-    << client->format.blueShift)
-
-
-/*********************************************************************
- * HandleCursorShape(). Support for XCursor and RichCursor shape
- * updates. We emulate cursor operating on the frame buffer (that is
- * why we call it "software cursor").
- ********************************************************************/
-
-rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc)
-{
-  int bytesPerPixel;
-  size_t bytesPerRow, bytesMaskData;
-  rfbXCursorColors rgb;
-  uint32_t colors[2];
-  char *buf;
-  uint8_t *ptr;
-  int x, y, b;
-
-  bytesPerPixel = client->format.bitsPerPixel / 8;
-  bytesPerRow = (width + 7) / 8;
-  bytesMaskData = bytesPerRow * height;
-
-  if (width * height == 0)
-    return TRUE;
-
-  /* Allocate memory for pixel data and temporary mask data. */
-  if(client->rcSource)
-    free(client->rcSource);
-
-  client->rcSource = malloc(width * height * bytesPerPixel);
-  if (client->rcSource == NULL)
-    return FALSE;
-
-  buf = malloc(bytesMaskData);
-  if (buf == NULL) {
-    free(client->rcSource);
-    client->rcSource = NULL;
-    return FALSE;
-  }
-
-  /* Read and decode cursor pixel data, depending on the encoding type. */
-
-  if (enc == rfbEncodingXCursor) {
-    /* Read and convert background and foreground colors. */
-    if (!ReadFromRFBServer(client, (char *)&rgb, sz_rfbXCursorColors)) {
-      free(client->rcSource);
-      client->rcSource = NULL;
-      free(buf);
-      return FALSE;
-    }
-    colors[0] = RGB24_TO_PIXEL(32, rgb.backRed, rgb.backGreen, rgb.backBlue);
-    colors[1] = RGB24_TO_PIXEL(32, rgb.foreRed, rgb.foreGreen, rgb.foreBlue);
-
-    /* Read 1bpp pixel data into a temporary buffer. */
-    if (!ReadFromRFBServer(client, buf, bytesMaskData)) {
-      free(client->rcSource);
-      client->rcSource = NULL;
-      free(buf);
-      return FALSE;
-    }
-
-    /* Convert 1bpp data to byte-wide color indices. */
-    ptr = client->rcSource;
-    for (y = 0; y < height; y++) {
-      for (x = 0; x < width / 8; x++) {
-	for (b = 7; b >= 0; b--) {
-	  *ptr = buf[y * bytesPerRow + x] >> b & 1;
-	  ptr += bytesPerPixel;
-	}
-      }
-      for (b = 7; b > 7 - width % 8; b--) {
-	*ptr = buf[y * bytesPerRow + x] >> b & 1;
-	ptr += bytesPerPixel;
-      }
-    }
-
-    /* Convert indices into the actual pixel values. */
-    switch (bytesPerPixel) {
-    case 1:
-      for (x = 0; x < width * height; x++)
-	client->rcSource[x] = (uint8_t)colors[client->rcSource[x]];
-      break;
-    case 2:
-      for (x = 0; x < width * height; x++)
-	((uint16_t *)client->rcSource)[x] = (uint16_t)colors[client->rcSource[x * 2]];
-      break;
-    case 4:
-      for (x = 0; x < width * height; x++)
-	((uint32_t *)client->rcSource)[x] = colors[client->rcSource[x * 4]];
-      break;
-    }
-
-  } else {			/* enc == rfbEncodingRichCursor */
-
-    if (!ReadFromRFBServer(client, (char *)client->rcSource, width * height * bytesPerPixel)) {
-      free(client->rcSource);
-      client->rcSource = NULL;
-      free(buf);
-      return FALSE;
-    }
-
-  }
-
-  /* Read and decode mask data. */
-
-  if (!ReadFromRFBServer(client, buf, bytesMaskData)) {
-    free(client->rcSource);
-    client->rcSource = NULL;
-    free(buf);
-    return FALSE;
-  }
-
-  client->rcMask = malloc(width * height);
-  if (client->rcMask == NULL) {
-    free(client->rcSource);
-    client->rcSource = NULL;
-    free(buf);
-    return FALSE;
-  }
-
-  ptr = client->rcMask;
-  for (y = 0; y < height; y++) {
-    for (x = 0; x < width / 8; x++) {
-      for (b = 7; b >= 0; b--) {
-	*ptr++ = buf[y * bytesPerRow + x] >> b & 1;
-      }
-    }
-    for (b = 7; b > 7 - width % 8; b--) {
-      *ptr++ = buf[y * bytesPerRow + x] >> b & 1;
-    }
-  }
-
-  if (client->GotCursorShape != NULL) {
-     client->GotCursorShape(client, xhot, yhot, width, height, bytesPerPixel);
-  }
-
-  free(buf);
-
-  return TRUE;
-}
-
-
diff --git a/ica/x11/libvncclient/h264.c b/ica/x11/libvncclient/h264.c
deleted file mode 100644
index 1d94454..0000000
--- a/ica/x11/libvncclient/h264.c
+++ /dev/null
@@ -1,644 +0,0 @@
-/*
- *  Copyright (C) 2012 Intel Corporation.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef LIBVNCSERVER_CONFIG_LIBVA
-
-#include <X11/Xlib.h>
-#include <va/va_x11.h>
-
-enum _slice_types {
-	SLICE_TYPE_P = 0,  /* Predicted */
-	SLICE_TYPE_B = 1,  /* Bi-predicted */
-	SLICE_TYPE_I = 2,  /* Intra coded */
-};
-
-#define SURFACE_NUM     7
-
-VADisplay       va_dpy = NULL;
-VAConfigID      va_config_id;
-VASurfaceID     va_surface_id[SURFACE_NUM];
-VAContextID     va_context_id = 0;
-
-VABufferID      va_pic_param_buf_id[SURFACE_NUM];
-VABufferID      va_mat_param_buf_id[SURFACE_NUM];
-VABufferID      va_sp_param_buf_id[SURFACE_NUM];
-VABufferID      va_d_param_buf_id[SURFACE_NUM];
-
-static int cur_height = 0;
-static int cur_width = 0;
-static unsigned int num_frames = 0;
-static int sid = 0;
-static unsigned int frame_id = 0;
-static int field_order_count = 0;
-static VASurfaceID curr_surface = VA_INVALID_ID;
-
-VAStatus gva_status;
-VASurfaceStatus gsurface_status;
-#define CHECK_SURF(X) \
-    gva_status = vaQuerySurfaceStatus(va_dpy, X, &gsurface_status); \
-    if (gsurface_status != 4) printf("ss: %d\n", gsurface_status);
-
-#ifdef _DEBUG
-#define DebugLog(A) rfbClientLog A
-#else
-#define DebugLog(A)
-#endif
-
-#define CHECK_VASTATUS(va_status,func)                  \
-    if (va_status != VA_STATUS_SUCCESS) {                   \
-        /*fprintf(stderr,"%s:%s (%d) failed,exit\n", __func__, func, __LINE__);*/ \
-        rfbClientErr("%s:%s:%d failed (0x%x),exit\n", __func__, func, __LINE__, va_status); \
-        exit(1);                                \
-    } else  { \
-        /*fprintf(stderr,">> SUCCESS for: %s:%s (%d)\n", __func__, func, __LINE__);*/ \
-        DebugLog(("%s:%s:%d success\n", __func__, func, __LINE__)); \
-    }
-
-/*
- * Forward declarations
- */
-static void h264_decode_frame(int f_width, int f_height, char *framedata, int framesize, int slice_type);
-static void SetVAPictureParameterBufferH264(VAPictureParameterBufferH264 *p, int width, int height);
-static void SetVASliceParameterBufferH264(VASliceParameterBufferH264 *p);
-static void SetVASliceParameterBufferH264_Intra(VASliceParameterBufferH264 *p, int first);
-
-static void put_updated_rectangle(rfbClient *client, int x, int y, int width, int height, int f_width, int f_height, int first_for_frame);
-static void nv12_to_rgba(const VAImage vaImage, rfbClient *client, int ch_x, int ch_y, int ch_w, int ch_h);
-
-
-/* FIXME: get this value from the server instead of hardcoding 32bit pixels */
-#define BPP (4 * 8)
-
-static const char *string_of_FOURCC(uint32_t fourcc)
-{
-    static int buf;
-    static char str[2][5];
-
-    buf ^= 1;
-    str[buf][0] = fourcc;
-    str[buf][1] = fourcc >> 8;
-    str[buf][2] = fourcc >> 16;
-    str[buf][3] = fourcc >> 24;
-    str[buf][4] = '\0';
-    return str[buf];
-}
-
-static inline const char *string_of_VAImageFormat(VAImageFormat *imgfmt)
-{
-    return string_of_FOURCC(imgfmt->fourcc);
-}
-
-
-static rfbBool
-HandleH264 (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-    rfbH264Header hdr;
-    char *framedata;
-
-    DebugLog(("Framebuffer update with H264 (x: %d, y: %d, w: %d, h: %d)\n", rx, ry, rw, rh));
-
-    /* First, read the frame size and allocate buffer to store the data */
-    if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbH264Header))
-        return FALSE;
-
-    hdr.slice_type = rfbClientSwap32IfLE(hdr.slice_type);
-    hdr.nBytes = rfbClientSwap32IfLE(hdr.nBytes);
-    hdr.width = rfbClientSwap32IfLE(hdr.width);
-    hdr.height = rfbClientSwap32IfLE(hdr.height);
-
-    framedata = (char*) malloc(hdr.nBytes);
-
-    /* Obtain frame data from the server */
-    DebugLog(("Reading %d bytes of frame data (type: %d)\n", hdr.nBytes, hdr.slice_type));
-    if (!ReadFromRFBServer(client, framedata, hdr.nBytes))
-        return FALSE;
-
-    /* First make sure we have a large enough raw buffer to hold the
-     * decompressed data.  In practice, with a fixed BPP, fixed frame
-     * buffer size and the first update containing the entire frame
-     * buffer, this buffer allocation should only happen once, on the
-     * first update.
-     */
-    if ( client->raw_buffer_size < (( rw * rh ) * ( BPP / 8 ))) {
-        if ( client->raw_buffer != NULL ) {
-            free( client->raw_buffer );
-        }
-
-        client->raw_buffer_size = (( rw * rh ) * ( BPP / 8 ));
-        client->raw_buffer = (char*) malloc( client->raw_buffer_size );
-        rfbClientLog("Allocated raw buffer of %d bytes (%dx%dx%d BPP)\n", client->raw_buffer_size, rw, rh, BPP);
-    }
-
-    /* Decode frame if frame data was sent. Server only sends frame data for the first
-     * framebuffer update message for a particular frame buffer contents.
-     * If more than 1 rectangle is updated, the messages after the first one (with
-     * the H.264 frame) have nBytes == 0.
-     */
-    if (hdr.nBytes > 0) {
-        DebugLog(("  decoding %d bytes of H.264 data\n", hdr.nBytes));
-        h264_decode_frame(hdr.width, hdr.height, framedata, hdr.nBytes, hdr.slice_type);
-    }
-
-    DebugLog(("  updating rectangle (%d, %d)-(%d, %d)\n", rx, ry, rw, rh));
-    put_updated_rectangle(client, rx, ry, rw, rh, hdr.width, hdr.height, hdr.nBytes != 0);
-
-    free(framedata);
-
-    return TRUE;
-}
-
-static void h264_cleanup_decoder()
-{
-    VAStatus va_status;
-
-    rfbClientLog("%s()\n", __FUNCTION__);
-
-    if (va_surface_id[0] != VA_INVALID_ID) {
-        va_status = vaDestroySurfaces(va_dpy, &va_surface_id[0], SURFACE_NUM);
-        CHECK_VASTATUS(va_status, "vaDestroySurfaces");
-    }
-
-    if (va_context_id) {
-        va_status = vaDestroyContext(va_dpy, va_context_id);
-        CHECK_VASTATUS(va_status, "vaDestroyContext");
-        va_context_id = 0;
-    }
-
-    num_frames = 0;
-    sid = 0;
-    frame_id = 0;
-    field_order_count = 0;
-}
-
-static void h264_init_decoder(int width, int height)
-{
-    VAStatus va_status;
-
-    if (va_context_id) {
-        rfbClientLog("%s: va_dpy already initialized\n", __FUNCTION__);
-    }
-
-    if (va_dpy != NULL) {
-        rfbClientLog("%s: Re-initializing H.264 decoder\n", __FUNCTION__);
-    }
-    else {
-        rfbClientLog("%s: initializing H.264 decoder\n", __FUNCTION__);
-
-        /* Attach VA display to local X display */
-        Display *win_display = (Display *)XOpenDisplay(":0.0");
-        if (win_display == NULL) {
-            rfbClientErr("Can't connect to local display\n");
-            exit(-1);
-        }
-
-        int major_ver, minor_ver;
-        va_dpy = vaGetDisplay(win_display);
-        va_status = vaInitialize(va_dpy, &major_ver, &minor_ver);
-        CHECK_VASTATUS(va_status, "vaInitialize");
-        rfbClientLog("%s: libva version %d.%d found\n", __FUNCTION__, major_ver, minor_ver);
-    }
-
-    /* Check for VLD entrypoint */
-    int num_entrypoints;
-    VAEntrypoint    entrypoints[5];
-    int vld_entrypoint_found = 0;
-
-    /* Change VAProfileH264High if needed */
-    VAProfile profile = VAProfileH264High;
-    va_status = vaQueryConfigEntrypoints(va_dpy, profile, entrypoints, &num_entrypoints);
-    CHECK_VASTATUS(va_status, "vaQueryConfigEntrypoints");
-    int i;
-    for (i = 0; i < num_entrypoints; ++i) {
-        if (entrypoints[i] == VAEntrypointVLD) {
-            vld_entrypoint_found = 1;
-            break;
-        }
-    }
-
-    if (vld_entrypoint_found == 0) {
-        rfbClientErr("VLD entrypoint not found\n");
-        exit(1);
-    }
-
-    /* Create configuration for the decode pipeline */
-    VAConfigAttrib attrib;
-    attrib.type = VAConfigAttribRTFormat;
-    va_status = vaCreateConfig(va_dpy, profile, VAEntrypointVLD, &attrib, 1, &va_config_id);
-    CHECK_VASTATUS(va_status, "vaCreateConfig");
-
-    /* Create VA surfaces */
-    for (i = 0; i < SURFACE_NUM; ++i) {
-        va_surface_id[i]       = VA_INVALID_ID;
-        va_pic_param_buf_id[i] = VA_INVALID_ID;
-        va_mat_param_buf_id[i] = VA_INVALID_ID;
-        va_sp_param_buf_id[i]  = VA_INVALID_ID;
-        va_d_param_buf_id[i]   = VA_INVALID_ID;
-    }
-    va_status = vaCreateSurfaces(va_dpy, width, height, VA_RT_FORMAT_YUV420, SURFACE_NUM, &va_surface_id[0]);
-    CHECK_VASTATUS(va_status, "vaCreateSurfaces");
-    for (i = 0; i < SURFACE_NUM; ++i) {
-        DebugLog(("%s: va_surface_id[%d] = %p\n", __FUNCTION__, i, va_surface_id[i]));
-    }
-
-    /* Create VA context */
-    va_status = vaCreateContext(va_dpy, va_config_id, width, height, 0/*VA_PROGRESSIVE*/,  &va_surface_id[0], SURFACE_NUM, &va_context_id);
-    CHECK_VASTATUS(va_status, "vaCreateContext");
-    DebugLog(("%s: VA context created (id: %d)\n", __FUNCTION__, va_context_id));
-
-
-    /* Instantiate decode pipeline */
-    va_status = vaBeginPicture(va_dpy, va_context_id, va_surface_id[0]);
-    CHECK_VASTATUS(va_status, "vaBeginPicture");
-
-    rfbClientLog("%s: H.264 decoder initialized\n", __FUNCTION__);
-}
-
-static void h264_decode_frame(int f_width, int f_height, char *framedata, int framesize, int slice_type)
-{
-    VAStatus va_status;
-
-    DebugLog(("%s: called for frame of %d bytes (%dx%d) slice_type=%d\n", __FUNCTION__, framesize, width, height, slice_type));
-
-    /* Initialize decode pipeline if necessary */
-    if ( (f_width > cur_width) || (f_height > cur_height) ) {
-        if (va_dpy != NULL)
-            h264_cleanup_decoder();
-        cur_width = f_width;
-        cur_height = f_height;
-
-        h264_init_decoder(f_width, f_height);
-        rfbClientLog("%s: decoder initialized\n", __FUNCTION__);
-    }
-
-    /* Decode frame */
-    static VAPictureH264 va_picture_h264, va_old_picture_h264;
-
-    /* The server should always send an I-frame when a new client connects
-     * or when the resolution of the framebuffer changes, but we check
-     * just in case.
-     */
-    if ( (slice_type != SLICE_TYPE_I) && (num_frames == 0) ) {
-        rfbClientLog("First frame is not an I frame !!! Skipping!!!\n");
-        return;
-    }
-
-    DebugLog(("%s: frame_id=%d va_surface_id[%d]=0x%x field_order_count=%d\n", __FUNCTION__, frame_id, sid, va_surface_id[sid], field_order_count));
-
-    va_picture_h264.picture_id = va_surface_id[sid];
-    va_picture_h264.frame_idx  = frame_id;
-    va_picture_h264.flags = 0;
-    va_picture_h264.BottomFieldOrderCnt = field_order_count;
-    va_picture_h264.TopFieldOrderCnt = field_order_count;
-
-    /* Set up picture parameter buffer */
-    if (va_pic_param_buf_id[sid] == VA_INVALID_ID) {
-        va_status = vaCreateBuffer(va_dpy, va_context_id, VAPictureParameterBufferType, sizeof(VAPictureParameterBufferH264), 1, NULL, &va_pic_param_buf_id[sid]);
-        CHECK_VASTATUS(va_status, "vaCreateBuffer(PicParam)");
-    }
-    CHECK_SURF(va_surface_id[sid]);
-
-    VAPictureParameterBufferH264 *pic_param_buf = NULL;
-    va_status = vaMapBuffer(va_dpy, va_pic_param_buf_id[sid], (void **)&pic_param_buf);
-    CHECK_VASTATUS(va_status, "vaMapBuffer(PicParam)");
-
-    SetVAPictureParameterBufferH264(pic_param_buf, f_width, f_height);
-    memcpy(&pic_param_buf->CurrPic, &va_picture_h264, sizeof(VAPictureH264));
-
-    if (slice_type == SLICE_TYPE_P) {
-        memcpy(&pic_param_buf->ReferenceFrames[0], &va_old_picture_h264, sizeof(VAPictureH264));
-        pic_param_buf->ReferenceFrames[0].flags = 0;
-    }
-    else if (slice_type != SLICE_TYPE_I) {
-        rfbClientLog("Frame type %d not supported!!!\n");
-        return;
-    }
-    pic_param_buf->frame_num = frame_id;
-
-    va_status = vaUnmapBuffer(va_dpy, va_pic_param_buf_id[sid]);
-    CHECK_VASTATUS(va_status, "vaUnmapBuffer(PicParam)");
-
-    /* Set up IQ matrix buffer */
-    if (va_mat_param_buf_id[sid] == VA_INVALID_ID) {
-        va_status = vaCreateBuffer(va_dpy, va_context_id, VAIQMatrixBufferType, sizeof(VAIQMatrixBufferH264), 1, NULL, &va_mat_param_buf_id[sid]);
-        CHECK_VASTATUS(va_status, "vaCreateBuffer(IQMatrix)");
-    }
-    CHECK_SURF(va_surface_id[sid]);
-
-    VAIQMatrixBufferH264 *iq_matrix_buf = NULL;
-    va_status = vaMapBuffer(va_dpy, va_mat_param_buf_id[sid], (void **)&iq_matrix_buf);
-    CHECK_VASTATUS(va_status, "vaMapBuffer(IQMatrix)");
-
-    static const unsigned char m_MatrixBufferH264[]= {
-        /* ScalingList4x4[6][16] */
-        0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-        0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-        0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-        0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-        0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-        0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
-        /* ScalingList8x8[2][64] */
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
-    };
-
-    memcpy(iq_matrix_buf, m_MatrixBufferH264, 224);
-    va_status = vaUnmapBuffer(va_dpy, va_mat_param_buf_id[sid]);
-    CHECK_VASTATUS(va_status, "vaUnmapBuffer(IQMatrix)");
-
-    VABufferID buffer_ids[2];
-    buffer_ids[0] = va_pic_param_buf_id[sid];
-    buffer_ids[1] = va_mat_param_buf_id[sid];
-
-    CHECK_SURF(va_surface_id[sid]);
-    va_status = vaRenderPicture(va_dpy, va_context_id, buffer_ids, 2);
-    CHECK_VASTATUS(va_status, "vaRenderPicture");
-
-    /* Set up slice parameter buffer */
-    if (va_sp_param_buf_id[sid] == VA_INVALID_ID) {
-        va_status = vaCreateBuffer(va_dpy, va_context_id, VASliceParameterBufferType, sizeof(VASliceParameterBufferH264), 1, NULL, &va_sp_param_buf_id[sid]);
-        CHECK_VASTATUS(va_status, "vaCreateBuffer(SliceParam)");
-    }
-    CHECK_SURF(va_surface_id[sid]);
-
-    VASliceParameterBufferH264 *slice_param_buf = NULL;
-    va_status = vaMapBuffer(va_dpy, va_sp_param_buf_id[sid], (void **)&slice_param_buf);
-    CHECK_VASTATUS(va_status, "vaMapBuffer(SliceParam)");
-
-    static int t2_first = 1;
-    if (slice_type == SLICE_TYPE_I) {
-        SetVASliceParameterBufferH264_Intra(slice_param_buf, t2_first);
-        t2_first = 0;
-    } else {
-        SetVASliceParameterBufferH264(slice_param_buf);
-        memcpy(&slice_param_buf->RefPicList0[0], &va_old_picture_h264, sizeof(VAPictureH264));
-        slice_param_buf->RefPicList0[0].flags = 0;
-    }
-    slice_param_buf->slice_data_bit_offset = 0;
-    slice_param_buf->slice_data_size = framesize;
-
-    va_status = vaUnmapBuffer(va_dpy, va_sp_param_buf_id[sid]);
-    CHECK_VASTATUS(va_status, "vaUnmapBuffer(SliceParam)");
-    CHECK_SURF(va_surface_id[sid]);
-
-    /* Set up slice data buffer and copy H.264 encoded data */
-    if (va_d_param_buf_id[sid] == VA_INVALID_ID) {
-        /* TODO use estimation matching framebuffer dimensions instead of this large value */
-        va_status = vaCreateBuffer(va_dpy, va_context_id, VASliceDataBufferType, 4177920, 1, NULL, &va_d_param_buf_id[sid]); /* 1080p size */
-        CHECK_VASTATUS(va_status, "vaCreateBuffer(SliceData)");
-    }
-
-    char *slice_data_buf;
-    va_status = vaMapBuffer(va_dpy, va_d_param_buf_id[sid], (void **)&slice_data_buf);
-    CHECK_VASTATUS(va_status, "vaMapBuffer(SliceData)");
-    memcpy(slice_data_buf, framedata, framesize);
-
-    CHECK_SURF(va_surface_id[sid]);
-    va_status = vaUnmapBuffer(va_dpy, va_d_param_buf_id[sid]);
-    CHECK_VASTATUS(va_status, "vaUnmapBuffer(SliceData)");
-
-    buffer_ids[0] = va_sp_param_buf_id[sid];
-    buffer_ids[1] = va_d_param_buf_id[sid];
-
-    CHECK_SURF(va_surface_id[sid]);
-    va_status = vaRenderPicture(va_dpy, va_context_id, buffer_ids, 2);
-    CHECK_VASTATUS(va_status, "vaRenderPicture");
-
-    va_status = vaEndPicture(va_dpy, va_context_id);
-    CHECK_VASTATUS(va_status, "vaEndPicture");
-
-    /* Prepare next one... */
-    int sid_new = (sid + 1) % SURFACE_NUM;
-    DebugLog(("%s: new Surface ID = %d\n", __FUNCTION__, sid_new));
-    va_status = vaBeginPicture(va_dpy, va_context_id, va_surface_id[sid_new]);
-    CHECK_VASTATUS(va_status, "vaBeginPicture");
-
-    /* Get decoded data */
-    va_status = vaSyncSurface(va_dpy, va_surface_id[sid]);
-    CHECK_VASTATUS(va_status, "vaSyncSurface");
-    CHECK_SURF(va_surface_id[sid]);
-
-    curr_surface = va_surface_id[sid];
-
-    sid = sid_new;
-
-    field_order_count += 2;
-    ++frame_id;
-    if (frame_id > 15) {
-        frame_id = 0;
-    }
-
-    ++num_frames;
-
-    memcpy(&va_old_picture_h264, &va_picture_h264, sizeof(VAPictureH264));
-}
-
-static void put_updated_rectangle(rfbClient *client, int x, int y, int width, int height, int f_width, int f_height, int first_for_frame)
-{
-    if (curr_surface == VA_INVALID_ID) {
-        rfbClientErr("%s: called, but current surface is invalid\n", __FUNCTION__);
-        return;
-    }
-
-    VAStatus va_status;
-
-    if (client->outputWindow) {
-        /* use efficient vaPutSurface() method of putting the framebuffer on the screen */
-        if (first_for_frame) {
-            /* vaPutSurface() clears window contents outside the given destination rectangle => always update full screen. */
-            va_status = vaPutSurface(va_dpy, curr_surface, client->outputWindow, 0, 0, f_width, f_height, 0, 0, f_width, f_height, NULL, 0, VA_FRAME_PICTURE);
-            CHECK_VASTATUS(va_status, "vaPutSurface");
-        }
-    }
-    else if (client->frameBuffer) {
-        /* ... or copy the changed framebuffer region manually as a fallback */
-        VAImage decoded_image;
-        decoded_image.image_id = VA_INVALID_ID;
-        decoded_image.buf      = VA_INVALID_ID;
-        va_status = vaDeriveImage(va_dpy, curr_surface, &decoded_image);
-        CHECK_VASTATUS(va_status, "vaDeriveImage");
-
-        if ((decoded_image.image_id == VA_INVALID_ID) || (decoded_image.buf == VA_INVALID_ID)) {
-            rfbClientErr("%s: vaDeriveImage() returned success but VA image is invalid (id: %d, buf: %d)\n", __FUNCTION__, decoded_image.image_id, decoded_image.buf);
-        }
-
-        nv12_to_rgba(decoded_image, client, x, y, width, height);
-
-        va_status = vaDestroyImage(va_dpy, decoded_image.image_id);
-        CHECK_VASTATUS(va_status, "vaDestroyImage");
-    }
-}
-
-static void SetVAPictureParameterBufferH264(VAPictureParameterBufferH264 *p, int width, int height)
-{
-    int i;
-    unsigned int width_in_mbs = (width + 15) / 16;
-    unsigned int height_in_mbs = (height + 15) / 16;
-
-    memset(p, 0, sizeof(VAPictureParameterBufferH264));
-    p->picture_width_in_mbs_minus1 = width_in_mbs - 1;
-    p->picture_height_in_mbs_minus1 = height_in_mbs - 1;
-    p->num_ref_frames = 1;
-    p->seq_fields.value = 145;
-    p->pic_fields.value = 0x501;
-    for (i = 0; i < 16; i++) {
-        p->ReferenceFrames[i].flags = VA_PICTURE_H264_INVALID;
-        p->ReferenceFrames[i].picture_id = 0xffffffff;
-    }
-}
-
-static void SetVASliceParameterBufferH264(VASliceParameterBufferH264 *p)
-{
-    int i;
-    memset(p, 0, sizeof(VASliceParameterBufferH264));
-    p->slice_data_size = 0;
-    p->slice_data_bit_offset = 64;
-    p->slice_alpha_c0_offset_div2 = 2;
-    p->slice_beta_offset_div2 = 2;
-    p->chroma_weight_l0_flag = 1;
-    p->chroma_weight_l0[0][0]=1;
-    p->chroma_offset_l0[0][0]=0;
-    p->chroma_weight_l0[0][1]=1;
-    p->chroma_offset_l0[0][1]=0;
-    p->luma_weight_l1_flag = 1;
-    p->chroma_weight_l1_flag = 1;
-    p->luma_weight_l0[0]=0x01;
-    for (i = 0; i < 32; i++) {
-        p->RefPicList0[i].flags = VA_PICTURE_H264_INVALID;
-        p->RefPicList1[i].flags = VA_PICTURE_H264_INVALID;
-    }
-    p->RefPicList1[0].picture_id = 0xffffffff;
-}
-
-static void SetVASliceParameterBufferH264_Intra(VASliceParameterBufferH264 *p, int first)
-{
-    int i;
-    memset(p, 0, sizeof(VASliceParameterBufferH264));
-    p->slice_data_size = 0;
-    p->slice_data_bit_offset = 64;
-    p->slice_alpha_c0_offset_div2 = 2;
-    p->slice_beta_offset_div2 = 2;
-    p->slice_type = 2;
-    if (first) {
-        p->luma_weight_l0_flag = 1;
-        p->chroma_weight_l0_flag = 1;
-        p->luma_weight_l1_flag = 1;
-        p->chroma_weight_l1_flag = 1;
-    } else {
-        p->chroma_weight_l0_flag = 1;
-        p->chroma_weight_l0[0][0]=1;
-        p->chroma_offset_l0[0][0]=0;
-        p->chroma_weight_l0[0][1]=1;
-        p->chroma_offset_l0[0][1]=0;
-        p->luma_weight_l1_flag = 1;
-        p->chroma_weight_l1_flag = 1;
-        p->luma_weight_l0[0]=0x01;
-    }
-    for (i = 0; i < 32; i++) {
-        p->RefPicList0[i].flags = VA_PICTURE_H264_INVALID;
-        p->RefPicList1[i].flags = VA_PICTURE_H264_INVALID;
-    }
-    p->RefPicList1[0].picture_id = 0xffffffff;
-    p->RefPicList0[0].picture_id = 0xffffffff;
-}
-
-static void nv12_to_rgba(const VAImage vaImage, rfbClient *client, int ch_x, int ch_y, int ch_w, int ch_h)
-{
-    DebugLog(("%s: converting region (%d, %d)-(%d, %d) from NV12->RGBA\n", __FUNCTION__, ch_x, ch_y, ch_w, ch_h));
-
-    VAStatus va_status;
-    uint8_t *nv12_buf;
-    va_status = vaMapBuffer(va_dpy, vaImage.buf, (void **)&nv12_buf);
-    CHECK_VASTATUS(va_status, "vaMapBuffer(DecodedData)");
-
-    /* adjust x, y, width, height of the affected area so
-     * x, y, width and height are always even.
-     */
-    if (ch_x % 2) { --ch_x; ++ch_w; }
-    if (ch_y % 2) { --ch_y; ++ch_h; }
-    if ((ch_x + ch_w) % 2) { ++ch_w; }
-    if ((ch_y + ch_h) % 2) { ++ch_h; }
-
-    /* point nv12_buf and dst to upper left corner of changed area */
-    uint8_t *nv12_y  = &nv12_buf[vaImage.offsets[0] + vaImage.pitches[0] * ch_y + ch_x];
-    uint8_t *nv12_uv = &nv12_buf[vaImage.offsets[1] + vaImage.pitches[1] * (ch_y / 2) + ch_x];
-    uint32_t *dst    = &((uint32_t*)client->frameBuffer)[client->width * ch_y + ch_x];
-
-    /* TODO: optimize R, G, B calculation. Possible ways to do this:
-     *       - use lookup tables
-     *       - convert from floating point to integer arithmetic
-     *       - use MMX/SSE to vectorize calculations
-     *       - use GPU (VA VPP, shader...)
-     */
-    int src_x, src_y;
-    for (src_y = 0; src_y < ch_h; src_y += 2) {
-        for (src_x = 0; src_x < ch_w; src_x += 2) {
-            uint8_t nv_u = nv12_uv[src_x];
-            uint8_t nv_v = nv12_uv[src_x + 1];
-            uint8_t nv_y[4] = { nv12_y[                     src_x], nv12_y[                     src_x + 1],
-                                nv12_y[vaImage.pitches[0] + src_x], nv12_y[vaImage.pitches[0] + src_x + 1] };
-
-        int i;
-            for (i = 0; i < 4; ++i) {
-                double R = 1.164 * (nv_y[i] - 16)                        + 1.596 * (nv_v - 128);
-                double G = 1.164 * (nv_y[i] - 16) - 0.391 * (nv_u - 128) - 0.813 * (nv_v - 128);
-                double B = 1.164 * (nv_y[i] - 16) + 2.018 * (nv_u - 128);
-
-                /* clamp R, G, B values. For some Y, U, V combinations,
-                 * the results of the above calculations fall outside of
-                 * the range 0-255.
-                 */
-                if (R < 0.0) R = 0.0;
-                if (G < 0.0) G = 0.0;
-                if (B < 0.0) B = 0.0;
-                if (R > 255.0) R = 255.0;
-                if (G > 255.0) G = 255.0;
-                if (B > 255.0) B = 255.0;
-
-                dst[client->width * (i / 2) + src_x + (i % 2)] = 0
-                               | ((unsigned int)(R + 0.5) << client->format.redShift)
-                               | ((unsigned int)(G + 0.5) << client->format.greenShift)
-                               | ((unsigned int)(B + 0.5) << client->format.blueShift);
-            }
-        }
-
-        nv12_y  += 2 * vaImage.pitches[0];
-        nv12_uv += vaImage.pitches[1];
-        dst     += 2 * client->width;
-    }
-
-    CHECK_SURF(va_surface_id[sid]);
-    va_status = vaUnmapBuffer(va_dpy, vaImage.buf);
-    CHECK_VASTATUS(va_status, "vaUnmapBuffer(DecodedData)");
-}
-
-#endif /* LIBVNCSERVER_CONFIG_LIBVA */
diff --git a/ica/x11/libvncclient/hextile.c b/ica/x11/libvncclient/hextile.c
deleted file mode 100644
index 8698445..0000000
--- a/ica/x11/libvncclient/hextile.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * hextile.c - handle hextile encoding.
- *
- * This file shouldn't be compiled directly.  It is included multiple times by
- * rfbproto.c, each time with a different definition of the macro BPP.  For
- * each value of BPP, this file defines a function which handles a hextile
- * encoded rectangle with BPP bits per pixel.
- */
-
-#define HandleHextileBPP CONCAT2E(HandleHextile,BPP)
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-
-static rfbBool
-HandleHextileBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-  CARDBPP bg, fg;
-  int i;
-  uint8_t *ptr;
-  int x, y, w, h;
-  int sx, sy, sw, sh;
-  uint8_t subencoding;
-  uint8_t nSubrects;
-
-  for (y = ry; y < ry+rh; y += 16) {
-    for (x = rx; x < rx+rw; x += 16) {
-      w = h = 16;
-      if (rx+rw - x < 16)
-	w = rx+rw - x;
-      if (ry+rh - y < 16)
-	h = ry+rh - y;
-
-      if (!ReadFromRFBServer(client, (char *)&subencoding, 1))
-	return FALSE;
-
-      if (subencoding & rfbHextileRaw) {
-	if (!ReadFromRFBServer(client, client->buffer, w * h * (BPP / 8)))
-	  return FALSE;
-
-	CopyRectangle(client, (uint8_t *)client->buffer, x, y, w, h);
-
-	continue;
-      }
-
-      if (subencoding & rfbHextileBackgroundSpecified)
-	if (!ReadFromRFBServer(client, (char *)&bg, sizeof(bg)))
-	  return FALSE;
-
-      FillRectangle(client, x, y, w, h, bg);
-
-      if (subencoding & rfbHextileForegroundSpecified)
-	if (!ReadFromRFBServer(client, (char *)&fg, sizeof(fg)))
-	  return FALSE;
-
-      if (!(subencoding & rfbHextileAnySubrects)) {
-	continue;
-      }
-
-      if (!ReadFromRFBServer(client, (char *)&nSubrects, 1))
-	return FALSE;
-
-      ptr = (uint8_t*)client->buffer;
-
-      if (subencoding & rfbHextileSubrectsColoured) {
-	if (!ReadFromRFBServer(client, client->buffer, nSubrects * (2 + (BPP / 8))))
-	  return FALSE;
-
-	for (i = 0; i < nSubrects; i++) {
-#if BPP==8
-	  GET_PIXEL8(fg, ptr);
-#elif BPP==16
-	  GET_PIXEL16(fg, ptr);
-#elif BPP==32
-	  GET_PIXEL32(fg, ptr);
-#else
-#error "Invalid BPP"
-#endif
-	  sx = rfbHextileExtractX(*ptr);
-	  sy = rfbHextileExtractY(*ptr);
-	  ptr++;
-	  sw = rfbHextileExtractW(*ptr);
-	  sh = rfbHextileExtractH(*ptr);
-	  ptr++;
-
-	  FillRectangle(client, x+sx, y+sy, sw, sh, fg);
-	}
-
-      } else {
-	if (!ReadFromRFBServer(client, client->buffer, nSubrects * 2))
-	  return FALSE;
-
-	for (i = 0; i < nSubrects; i++) {
-	  sx = rfbHextileExtractX(*ptr);
-	  sy = rfbHextileExtractY(*ptr);
-	  ptr++;
-	  sw = rfbHextileExtractW(*ptr);
-	  sh = rfbHextileExtractH(*ptr);
-	  ptr++;
-
-	  FillRectangle(client, x+sx, y+sy, sw, sh, fg);
-	}
-      }
-    }
-  }
-
-  return TRUE;
-}
-
-#undef CARDBPP
diff --git a/ica/x11/libvncclient/listen.c b/ica/x11/libvncclient/listen.c
deleted file mode 100644
index c91ad6e..0000000
--- a/ica/x11/libvncclient/listen.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- *  Copyright (C) 2011-2012 Christian Beier <dontmind at freeshell.org>
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * listen.c - listen for incoming connections
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#endif
-#include <unistd.h>
-#include <sys/types.h>
-#ifdef __MINGW32__
-#define close closesocket
-#include <winsock2.h>
-#undef max
-#else
-#include <sys/wait.h>
-#include <sys/utsname.h>
-#endif
-#include <sys/time.h>
-#include <rfb/rfbclient.h>
-
-/*
- * listenForIncomingConnections() - listen for incoming connections from
- * servers, and fork a new process to deal with each connection.
- */
-
-void
-listenForIncomingConnections(rfbClient* client)
-{
-#ifdef __MINGW32__
-  /* FIXME */
-  rfbClientErr("listenForIncomingConnections on MinGW32 NOT IMPLEMENTED\n");
-  return;
-#else
-  int listenSocket, listen6Socket = -1;
-  fd_set fds;
-
-  client->listenSpecified = TRUE;
-
-  listenSocket = ListenAtTcpPortAndAddress(client->listenPort, client->listenAddress);
-
-  if ((listenSocket < 0))
-    return;
-
-  rfbClientLog("%s -listen: Listening on port %d\n",
-	  client->programName,client->listenPort);
-  rfbClientLog("%s -listen: Command line errors are not reported until "
-	  "a connection comes in.\n", client->programName);
-
-#ifdef LIBVNCSERVER_IPv6 /* only try that if we're IPv6-capable, otherwise we may try to bind to the same port which would make all that listening fail */ 
-  /* only do IPv6 listen of listen6Port is set */
-  if (client->listen6Port > 0)
-    {
-      listen6Socket = ListenAtTcpPortAndAddress(client->listen6Port, client->listen6Address);
-
-      if (listen6Socket < 0)
-	return;
-
-      rfbClientLog("%s -listen: Listening on IPV6 port %d\n",
-		   client->programName,client->listenPort);
-      rfbClientLog("%s -listen: Command line errors are not reported until "
-		   "a connection comes in.\n", client->programName);
-    }
-#endif
-
-  while (TRUE) {
-    int r;
-    /* reap any zombies */
-    int status, pid;
-    while ((pid= wait3(&status, WNOHANG, (struct rusage *)0))>0);
-
-    /* TODO: callback for discard any events (like X11 events) */
-
-    FD_ZERO(&fds); 
-
-    if(listenSocket >= 0)
-      FD_SET(listenSocket, &fds);  
-    if(listen6Socket >= 0)
-      FD_SET(listen6Socket, &fds);
-
-    r = select(max(listenSocket, listen6Socket)+1, &fds, NULL, NULL, NULL);
-
-    if (r > 0) {
-      if (FD_ISSET(listenSocket, &fds))
-	client->sock = AcceptTcpConnection(client->listenSock); 
-      else if (FD_ISSET(listen6Socket, &fds))
-	client->sock = AcceptTcpConnection(client->listen6Sock);
-
-      if (client->sock < 0)
-	return;
-      if (!SetNonBlocking(client->sock))
-	return;
-
-      /* Now fork off a new process to deal with it... */
-
-      switch (fork()) {
-
-      case -1: 
-	rfbClientErr("fork\n"); 
-	return;
-
-      case 0:
-	/* child - return to caller */
-	close(listenSocket);
-	close(listen6Socket);
-	return;
-
-      default:
-	/* parent - go round and listen again */
-	close(client->sock); 
-	break;
-      }
-    }
-  }
-#endif
-}
-
-
-
-/*
- * listenForIncomingConnectionsNoFork() - listen for incoming connections
- * from servers, but DON'T fork, instead just wait timeout microseconds.
- * If timeout is negative, block indefinitly.
- * Returns 1 on success (there was an incoming connection on the listen socket
- * and we accepted it successfully), -1 on error, 0 on timeout.
- */
-
-int
-listenForIncomingConnectionsNoFork(rfbClient* client, int timeout)
-{
-  fd_set fds;
-  struct timeval to;
-  int r;
-
-  to.tv_sec= timeout / 1000000;
-  to.tv_usec= timeout % 1000000;
-
-  client->listenSpecified = TRUE;
-
-  if (client->listenSock < 0)
-    {
-      client->listenSock = ListenAtTcpPortAndAddress(client->listenPort, client->listenAddress);
-
-      if (client->listenSock < 0)
-	return -1;
-
-      rfbClientLog("%s -listennofork: Listening on port %d\n",
-		   client->programName,client->listenPort);
-      rfbClientLog("%s -listennofork: Command line errors are not reported until "
-		   "a connection comes in.\n", client->programName);
-    }
-
-#ifdef LIBVNCSERVER_IPv6 /* only try that if we're IPv6-capable, otherwise we may try to bind to the same port which would make all that listening fail */ 
-  /* only do IPv6 listen of listen6Port is set */
-  if (client->listen6Port > 0 && client->listen6Sock < 0)
-    {
-      client->listen6Sock = ListenAtTcpPortAndAddress(client->listen6Port, client->listen6Address);
-
-      if (client->listen6Sock < 0)
-	return -1;
-
-      rfbClientLog("%s -listennofork: Listening on IPV6 port %d\n",
-		   client->programName,client->listenPort);
-      rfbClientLog("%s -listennofork: Command line errors are not reported until "
-		   "a connection comes in.\n", client->programName);
-    }
-#endif
-
-  FD_ZERO(&fds);
-
-  if(client->listenSock >= 0)
-    FD_SET(client->listenSock, &fds);
-  if(client->listen6Sock >= 0)
-    FD_SET(client->listen6Sock, &fds);
-
-  if (timeout < 0)
-    r = select(max(client->listenSock, client->listen6Sock) +1, &fds, NULL, NULL, NULL);
-  else
-    r = select(max(client->listenSock, client->listen6Sock) +1, &fds, NULL, NULL, &to);
-
-  if (r > 0)
-    {
-      if (FD_ISSET(client->listenSock, &fds))
-	client->sock = AcceptTcpConnection(client->listenSock); 
-      else if (FD_ISSET(client->listen6Sock, &fds))
-	client->sock = AcceptTcpConnection(client->listen6Sock);
-
-      if (client->sock < 0)
-	return -1;
-      if (!SetNonBlocking(client->sock))
-	return -1;
-
-      if(client->listenSock >= 0) {
-	close(client->listenSock);
-	client->listenSock = -1;
-      }
-      if(client->listen6Sock >= 0) {
-	close(client->listen6Sock);
-	client->listen6Sock = -1;
-      }
-      return r;
-    }
-
-  /* r is now either 0 (timeout) or -1 (error) */
-  return r;
-}
-
-
diff --git a/ica/x11/libvncclient/rfbproto.c b/ica/x11/libvncclient/rfbproto.c
deleted file mode 100644
index db793a2..0000000
--- a/ica/x11/libvncclient/rfbproto.c
+++ /dev/null
@@ -1,2450 +0,0 @@
-/*
- *  Copyright (C) 2000-2002 Constantin Kaplinsky.  All Rights Reserved.
- *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * rfbproto.c - functions to deal with client side of RFB protocol.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE 600
-#endif
-#ifndef WIN32
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pwd.h>
-#endif
-#include <errno.h>
-#include <rfb/rfbclient.h>
-#ifdef WIN32
-#undef SOCKET
-#undef socklen_t
-#endif
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#include <zlib.h>
-#ifdef __CHECKER__
-#undef Z_NULL
-#define Z_NULL NULL
-#endif
-#endif
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-#ifdef _RPCNDR_H /* This Windows header typedefs 'boolean', jpeglib has to know */
-#define HAVE_BOOLEAN
-#endif
-#include <jpeglib.h>
-#endif
-#include <strings.h>
-#include <stdarg.h>
-#include <time.h>
-
-#ifdef LIBVNCSERVER_WITH_CLIENT_GCRYPT
-#include <gcrypt.h>
-#endif
-
-#include "minilzo.h"
-#include "tls.h"
-
-#include "ItalcRfbExt.h"
-
-/*
- * rfbClientLog prints a time-stamped message to the log file (stderr).
- */
-
-rfbBool rfbEnableClientLogging=TRUE;
-
-static void
-rfbDefaultClientLog(const char *format, ...)
-{
-    va_list args;
-    char buf[256];
-    time_t log_clock;
-
-    if(!rfbEnableClientLogging)
-      return;
-
-    va_start(args, format);
-
-    time(&log_clock);
-    strftime(buf, 255, "%d/%m/%Y %X ", localtime(&log_clock));
-    fprintf(stderr, "%s", buf);
-
-    vfprintf(stderr, format, args);
-    fflush(stderr);
-
-    va_end(args);
-}
-
-rfbClientLogProc rfbClientLog=rfbDefaultClientLog;
-rfbClientLogProc rfbClientErr=rfbDefaultClientLog;
-
-/* extensions */
-
-rfbClientProtocolExtension* rfbClientExtensions = NULL;
-
-void rfbClientRegisterExtension(rfbClientProtocolExtension* e)
-{
-	e->next = rfbClientExtensions;
-	rfbClientExtensions = e;
-}
-
-/* client data */
-
-void rfbClientSetClientData(rfbClient* client, void* tag, void* data)
-{
-	rfbClientData* clientData = client->clientData;
-
-	while(clientData && clientData->tag != tag)
-		clientData = clientData->next;
-	if(clientData == NULL) {
-		clientData = calloc(sizeof(rfbClientData), 1);
-		clientData->next = client->clientData;
-		client->clientData = clientData;
-		clientData->tag = tag;
-	}
-
-	clientData->data = data;
-}
-
-void* rfbClientGetClientData(rfbClient* client, void* tag)
-{
-	rfbClientData* clientData = client->clientData;
-
-	while(clientData) {
-		if(clientData->tag == tag)
-			return clientData->data;
-		clientData = clientData->next;
-	}
-
-	return NULL;
-}
-
-/* messages */
-
-static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_t colour) {
-  int i,j;
-
-#define FILL_RECT(BPP) \
-    for(j=y*client->width;j<(y+h)*client->width;j+=client->width) \
-      for(i=x;i<x+w;i++) \
-	((uint##BPP##_t*)client->frameBuffer)[j+i]=colour;
-
-  switch(client->format.bitsPerPixel) {
-  case  8: FILL_RECT(8);  break;
-  case 16: FILL_RECT(16); break;
-  case 32: FILL_RECT(32); break;
-  default:
-    rfbClientLog("Unsupported bitsPerPixel: %d\n",client->format.bitsPerPixel);
-  }
-}
-
-static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int h) {
-  int j;
-
-  if (client->frameBuffer == NULL) {
-      return;
-  }
-
-#define COPY_RECT(BPP) \
-  { \
-    int rs = w * BPP / 8, rs2 = client->width * BPP / 8; \
-    for (j = ((x * (BPP / 8)) + (y * rs2)); j < (y + h) * rs2; j += rs2) { \
-      memcpy(client->frameBuffer + j, buffer, rs); \
-      buffer += rs; \
-    } \
-  }
-
-  switch(client->format.bitsPerPixel) {
-  case  8: COPY_RECT(8);  break;
-  case 16: COPY_RECT(16); break;
-  case 32: COPY_RECT(32); break;
-  default:
-    rfbClientLog("Unsupported bitsPerPixel: %d\n",client->format.bitsPerPixel);
-  }
-}
-
-/* TODO: test */
-static void CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
-  int i,j;
-
-#define COPY_RECT_FROM_RECT(BPP) \
-  { \
-    uint##BPP##_t* _buffer=((uint##BPP##_t*)client->frameBuffer)+(src_y-dest_y)*client->width+src_x-dest_x; \
-    if (dest_y < src_y) { \
-      for(j = dest_y*client->width; j < (dest_y+h)*client->width; j += client->width) { \
-        if (dest_x < src_x) { \
-          for(i = dest_x; i < dest_x+w; i++) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } else { \
-          for(i = dest_x+w-1; i >= dest_x; i--) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } \
-      } \
-    } else { \
-      for(j = (dest_y+h-1)*client->width; j >= dest_y*client->width; j-=client->width) { \
-        if (dest_x < src_x) { \
-          for(i = dest_x; i < dest_x+w; i++) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } else { \
-          for(i = dest_x+w-1; i >= dest_x; i--) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } \
-      } \
-    } \
-  }
-
-  switch(client->format.bitsPerPixel) {
-  case  8: COPY_RECT_FROM_RECT(8);  break;
-  case 16: COPY_RECT_FROM_RECT(16); break;
-  case 32: COPY_RECT_FROM_RECT(32); break;
-  default:
-    rfbClientLog("Unsupported bitsPerPixel: %d\n",client->format.bitsPerPixel);
-  }
-}
-
-static rfbBool HandleRRE8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleRRE16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleRRE32(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleCoRRE8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleCoRRE16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleCoRRE32(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleHextile8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleHextile16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleHextile32(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleUltra8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleUltra16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleUltra32(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleUltraZip8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleUltraZip16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleUltraZip32(rfbClient* client, int rx, int ry, int rw, int rh);
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-static rfbBool HandleZlib8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZlib16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZlib32(rfbClient* client, int rx, int ry, int rw, int rh);
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-static rfbBool HandleTight8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleTight16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleTight32(rfbClient* client, int rx, int ry, int rw, int rh);
-
-static long ReadCompactLen (rfbClient* client);
-
-static void JpegInitSource(j_decompress_ptr cinfo);
-static boolean JpegFillInputBuffer(j_decompress_ptr cinfo);
-static void JpegSkipInputData(j_decompress_ptr cinfo, long num_bytes);
-static void JpegTermSource(j_decompress_ptr cinfo);
-static void JpegSetSrcManager(j_decompress_ptr cinfo, uint8_t *compressedData,
-                              int compressedLen);
-#endif
-static rfbBool HandleZRLE8(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZRLE15(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZRLE16(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZRLE24(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZRLE24Up(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZRLE24Down(rfbClient* client, int rx, int ry, int rw, int rh);
-static rfbBool HandleZRLE32(rfbClient* client, int rx, int ry, int rw, int rh);
-#endif
-#ifdef LIBVNCSERVER_CONFIG_LIBVA
-static rfbBool HandleH264 (rfbClient* client, int rx, int ry, int rw, int rh);
-#endif
-
-/*
- * Server Capability Functions
- */
-rfbBool
-SupportsClient2Server(rfbClient* client, int messageType)
-{
-    return (client->supportedMessages.client2server[((messageType & 0xFF)/8)] & (1<<(messageType % 8)) ? TRUE : FALSE);
-}
-
-rfbBool
-SupportsServer2Client(rfbClient* client, int messageType)
-{
-    return (client->supportedMessages.server2client[((messageType & 0xFF)/8)] & (1<<(messageType % 8)) ? TRUE : FALSE);
-}
-
-void
-SetClient2Server(rfbClient* client, int messageType)
-{
-  client->supportedMessages.client2server[((messageType & 0xFF)/8)] |= (1<<(messageType % 8));
-}
-
-void
-SetServer2Client(rfbClient* client, int messageType)
-{
-  client->supportedMessages.server2client[((messageType & 0xFF)/8)] |= (1<<(messageType % 8));
-}
-
-void
-ClearClient2Server(rfbClient* client, int messageType)
-{
-  client->supportedMessages.client2server[((messageType & 0xFF)/8)] &= (!(1<<(messageType % 8)));
-}
-
-void
-ClearServer2Client(rfbClient* client, int messageType)
-{
-  client->supportedMessages.server2client[((messageType & 0xFF)/8)] &= (!(1<<(messageType % 8)));
-}
-
-
-void
-DefaultSupportedMessages(rfbClient* client)
-{
-    memset((char *)&client->supportedMessages,0,sizeof(client->supportedMessages));
-
-    /* Default client supported messages (universal RFB 3.3 protocol) */
-    SetClient2Server(client, rfbSetPixelFormat);
-    /* SetClient2Server(client, rfbFixColourMapEntries); Not currently supported */
-    SetClient2Server(client, rfbSetEncodings);
-    SetClient2Server(client, rfbFramebufferUpdateRequest);
-    SetClient2Server(client, rfbKeyEvent);
-    SetClient2Server(client, rfbPointerEvent);
-    SetClient2Server(client, rfbClientCutText);
-    /* technically, we only care what we can *send* to the server
-     * but, we set Server2Client Just in case it ever becomes useful
-     */
-    SetServer2Client(client, rfbFramebufferUpdate);
-    SetServer2Client(client, rfbSetColourMapEntries);
-    SetServer2Client(client, rfbBell);
-    SetServer2Client(client, rfbServerCutText);
-}
-
-void
-DefaultSupportedMessagesUltraVNC(rfbClient* client)
-{
-    DefaultSupportedMessages(client);
-    SetClient2Server(client, rfbFileTransfer);
-    SetClient2Server(client, rfbSetScale);
-    SetClient2Server(client, rfbSetServerInput);
-    SetClient2Server(client, rfbSetSW);
-    SetClient2Server(client, rfbTextChat);
-    SetClient2Server(client, rfbPalmVNCSetScaleFactor);
-    /* technically, we only care what we can *send* to the server */
-    SetServer2Client(client, rfbResizeFrameBuffer);
-    SetServer2Client(client, rfbPalmVNCReSizeFrameBuffer);
-    SetServer2Client(client, rfbFileTransfer);
-    SetServer2Client(client, rfbTextChat);
-}
-
-
-void
-DefaultSupportedMessagesTightVNC(rfbClient* client)
-{
-    DefaultSupportedMessages(client);
-    SetClient2Server(client, rfbFileTransfer);
-    SetClient2Server(client, rfbSetServerInput);
-    SetClient2Server(client, rfbSetSW);
-    /* SetClient2Server(client, rfbTextChat); */
-    /* technically, we only care what we can *send* to the server */
-    SetServer2Client(client, rfbFileTransfer);
-    SetServer2Client(client, rfbTextChat);
-}
-
-#ifndef WIN32
-static rfbBool
-IsUnixSocket(const char *name)
-{
-  struct stat sb;
-  if(stat(name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK)
-    return TRUE;
-  return FALSE;
-}
-#endif
-
-/*
- * ConnectToRFBServer.
- */
-
-rfbBool
-ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
-{
-  if (client->serverPort==-1) {
-    /* serverHost is a file recorded by vncrec. */
-    const char* magic="vncLog0.0";
-    char buffer[10];
-    rfbVNCRec* rec = (rfbVNCRec*)malloc(sizeof(rfbVNCRec));
-    client->vncRec = rec;
-
-    rec->file = fopen(client->serverHost,"rb");
-    rec->tv.tv_sec = 0;
-    rec->readTimestamp = FALSE;
-    rec->doNotSleep = FALSE;
-    
-    if (!rec->file) {
-      rfbClientLog("Could not open %s.\n",client->serverHost);
-      return FALSE;
-    }
-    setbuf(rec->file,NULL);
-
-    if (fread(buffer,1,strlen(magic),rec->file) != strlen(magic) || strncmp(buffer,magic,strlen(magic))) {
-      rfbClientLog("File %s was not recorded by vncrec.\n",client->serverHost);
-      fclose(rec->file);
-      return FALSE;
-    }
-    client->sock = -1;
-    return TRUE;
-  }
-
-#ifndef WIN32
-  if(IsUnixSocket(hostname))
-    /* serverHost is a UNIX socket. */
-    client->sock = ConnectClientToUnixSock(hostname);
-  else
-#endif
-  {
-#ifdef LIBVNCSERVER_IPv6
-    client->sock = ConnectClientToTcpAddr6(hostname, port);
-    if (client->sock == -1)
-#endif
-    {
-      unsigned int host;
-
-      /* serverHost is a hostname */
-      if (!StringToIPAddr(hostname, &host)) {
-        rfbClientLog("Couldn't convert '%s' to host address\n", hostname);
-        return FALSE;
-      }
-      client->sock = ConnectClientToTcpAddr(host, port);
-    }
-  }
-
-  if (client->sock < 0) {
-    rfbClientLog("Unable to connect to VNC server\n");
-    return FALSE;
-  }
-
-  if(client->QoS_DSCP && !SetDSCP(client->sock, client->QoS_DSCP))
-     return FALSE;
-
-  return SetNonBlocking(client->sock);
-}
-
-/*
- * ConnectToRFBRepeater.
- */
-
-rfbBool ConnectToRFBRepeater(rfbClient* client,const char *repeaterHost, int repeaterPort, const char *destHost, int destPort)
-{
-  rfbProtocolVersionMsg pv;
-  int major,minor;
-  char tmphost[250];
-
-#ifdef LIBVNCSERVER_IPv6
-  client->sock = ConnectClientToTcpAddr6(repeaterHost, repeaterPort);
-  if (client->sock == -1)
-#endif
-  {
-    unsigned int host;
-    if (!StringToIPAddr(repeaterHost, &host)) {
-      rfbClientLog("Couldn't convert '%s' to host address\n", repeaterHost);
-      return FALSE;
-    }
-
-    client->sock = ConnectClientToTcpAddr(host, repeaterPort);
-  }
-
-  if (client->sock < 0) {
-    rfbClientLog("Unable to connect to VNC repeater\n");
-    return FALSE;
-  }
-
-  if (!SetNonBlocking(client->sock))
-    return FALSE;
-
-  if (!ReadFromRFBServer(client, pv, sz_rfbProtocolVersionMsg))
-    return FALSE;
-  pv[sz_rfbProtocolVersionMsg] = 0;
-
-  /* UltraVNC repeater always report version 000.000 to identify itself */
-  if (sscanf(pv,rfbProtocolVersionFormat,&major,&minor) != 2 || major != 0 || minor != 0) {
-    rfbClientLog("Not a valid VNC repeater (%s)\n",pv);
-    return FALSE;
-  }
-
-  rfbClientLog("Connected to VNC repeater, using protocol version %d.%d\n", major, minor);
-
-  snprintf(tmphost, sizeof(tmphost), "%s:%d", destHost, destPort);
-  if (!WriteToRFBServer(client, tmphost, sizeof(tmphost)))
-    return FALSE;
-
-  return TRUE;
-}
-
-extern void rfbClientEncryptBytes(unsigned char* bytes, char* passwd);
-extern void rfbClientEncryptBytes2(unsigned char *where, const int length, unsigned char *key);
-
-rfbBool
-rfbHandleAuthResult(rfbClient* client)
-{
-    uint32_t authResult=0, reasonLen=0;
-    char *reason=NULL;
-
-    if (!ReadFromRFBServer(client, (char *)&authResult, 4)) return FALSE;
-
-    authResult = rfbClientSwap32IfLE(authResult);
-
-    switch (authResult) {
-    case rfbVncAuthOK:
-      rfbClientLog("VNC authentication succeeded\n");
-      return TRUE;
-      break;
-    case rfbVncAuthFailed:
-      if (client->major==3 && client->minor>7)
-      {
-        /* we have an error following */
-        if (!ReadFromRFBServer(client, (char *)&reasonLen, 4)) return FALSE;
-        reasonLen = rfbClientSwap32IfLE(reasonLen);
-        reason = malloc(reasonLen+1);
-        if (!ReadFromRFBServer(client, reason, reasonLen)) { free(reason); return FALSE; }
-        reason[reasonLen]=0;
-        rfbClientLog("VNC connection failed: %s\n",reason);
-        free(reason);
-        return FALSE;
-      }
-      rfbClientLog("VNC authentication failed\n");
-      return FALSE;
-    case rfbVncAuthTooMany:
-      rfbClientLog("VNC authentication failed - too many tries\n");
-      return FALSE;
-    }
-
-    rfbClientLog("Unknown VNC authentication result: %d\n",
-                 (int)authResult);
-    return FALSE;
-}
-
-static void
-ReadReason(rfbClient* client)
-{
-    uint32_t reasonLen;
-    char *reason;
-
-    /* we have an error following */
-    if (!ReadFromRFBServer(client, (char *)&reasonLen, 4)) return;
-    reasonLen = rfbClientSwap32IfLE(reasonLen);
-    reason = malloc(reasonLen+1);
-    if (!ReadFromRFBServer(client, reason, reasonLen)) { free(reason); return; }
-    reason[reasonLen]=0;
-    rfbClientLog("VNC connection failed: %s\n",reason);
-    free(reason);
-}
-
-static rfbBool
-ReadSupportedSecurityType(rfbClient* client, uint32_t *result, rfbBool subAuth)
-{
-    uint8_t count=0;
-    uint8_t loop=0;
-    uint8_t flag=0;
-    uint8_t tAuth[256];
-    char buf1[500],buf2[10];
-    uint32_t authScheme;
-
-    if (!ReadFromRFBServer(client, (char *)&count, 1)) return FALSE;
-
-    if (count==0)
-    {
-        rfbClientLog("List of security types is ZERO, expecting an error to follow\n");
-        ReadReason(client);
-        return FALSE;
-    }
-
-    rfbClientLog("We have %d security types to read\n", count);
-    authScheme=0;
-    /* now, we have a list of available security types to read ( uint8_t[] ) */
-    for (loop=0;loop<count;loop++)
-    {
-        if (!ReadFromRFBServer(client, (char *)&tAuth[loop], 1)) return FALSE;
-        rfbClientLog("%d) Received security type %d\n", loop, tAuth[loop]);
-        if (flag) continue;
-        if (tAuth[loop]==rfbVncAuth || tAuth[loop]==rfbNoAuth ||
-			( tAuth[loop] == rfbUltraVNC_MsLogonIIAuth && isLogonAuthenticationEnabled( client ) ) ||
-			tAuth[loop] == rfbSecTypeItalc ||
-            (tAuth[loop]==rfbARD && client->GetCredential) ||
-            (!subAuth && (tAuth[loop]==rfbTLS || (tAuth[loop]==rfbVeNCrypt && client->GetCredential))))
-        {
-            if (!subAuth && client->clientAuthSchemes)
-            {
-                int i;
-                for (i=0;client->clientAuthSchemes[i];i++)
-                {
-                    if (client->clientAuthSchemes[i]==(uint32_t)tAuth[loop])
-                    {
-                        flag++;
-                        authScheme=tAuth[loop];
-                        break;
-                    }
-                }
-            }
-            else
-            {
-                flag++;
-                authScheme=tAuth[loop];
-            }
-            if (flag)
-            {
-                rfbClientLog("Selecting security type %d (%d/%d in the list)\n", authScheme, loop, count);
-                /* send back a single byte indicating which security type to use */
-                if (!WriteToRFBServer(client, (char *)&tAuth[loop], 1)) return FALSE;
-            }
-        }
-    }
-    if (authScheme==0)
-    {
-        memset(buf1, 0, sizeof(buf1));
-        for (loop=0;loop<count;loop++)
-        {
-            if (strlen(buf1)>=sizeof(buf1)-1) break;
-            snprintf(buf2, sizeof(buf2), (loop>0 ? ", %d" : "%d"), (int)tAuth[loop]);
-            strncat(buf1, buf2, sizeof(buf1)-strlen(buf1)-1);
-        }
-        rfbClientLog("Unknown authentication scheme from VNC server: %s\n",
-               buf1);
-        return FALSE;
-    }
-    *result = authScheme;
-    return TRUE;
-}
-
-static rfbBool
-HandleVncAuth(rfbClient *client)
-{
-    uint8_t challenge[CHALLENGESIZE];
-    char *passwd=NULL;
-    int i;
-
-    if (!ReadFromRFBServer(client, (char *)challenge, CHALLENGESIZE)) return FALSE;
-
-    if (client->serverPort!=-1) { /* if not playing a vncrec file */
-      if (client->GetPassword)
-        passwd = client->GetPassword(client);
-
-      if ((!passwd) || (strlen(passwd) == 0)) {
-        rfbClientLog("Reading password failed\n");
-        return FALSE;
-      }
-      if (strlen(passwd) > 8) {
-        passwd[8] = '\0';
-      }
-
-      rfbClientEncryptBytes(challenge, passwd);
-
-      /* Lose the password from memory */
-      for (i = strlen(passwd); i >= 0; i--) {
-        passwd[i] = '\0';
-      }
-      free(passwd);
-
-      if (!WriteToRFBServer(client, (char *)challenge, CHALLENGESIZE)) return FALSE;
-    }
-
-    /* Handle the SecurityResult message */
-    if (!rfbHandleAuthResult(client)) return FALSE;
-
-    return TRUE;
-}
-
-static void
-FreeUserCredential(rfbCredential *cred)
-{
-  if (cred->userCredential.username) free(cred->userCredential.username);
-  if (cred->userCredential.password) free(cred->userCredential.password);
-  free(cred);
-}
-
-static rfbBool
-HandlePlainAuth(rfbClient *client)
-{
-  uint32_t ulen, ulensw;
-  uint32_t plen, plensw;
-  rfbCredential *cred;
-
-  if (!client->GetCredential)
-  {
-    rfbClientLog("GetCredential callback is not set.\n");
-    return FALSE;
-  }
-  cred = client->GetCredential(client, rfbCredentialTypeUser);
-  if (!cred)
-  {
-    rfbClientLog("Reading credential failed\n");
-    return FALSE;
-  }
-
-  ulen = (cred->userCredential.username ? strlen(cred->userCredential.username) : 0);
-  ulensw = rfbClientSwap32IfLE(ulen);
-  plen = (cred->userCredential.password ? strlen(cred->userCredential.password) : 0);
-  plensw = rfbClientSwap32IfLE(plen);
-  if (!WriteToRFBServer(client, (char *)&ulensw, 4) ||
-      !WriteToRFBServer(client, (char *)&plensw, 4))
-  {
-    FreeUserCredential(cred);
-    return FALSE;
-  }
-  if (ulen > 0)
-  {
-    if (!WriteToRFBServer(client, cred->userCredential.username, ulen))
-    {
-      FreeUserCredential(cred);
-      return FALSE;
-    }
-  }
-  if (plen > 0)
-  {
-    if (!WriteToRFBServer(client, cred->userCredential.password, plen))
-    {
-      FreeUserCredential(cred);
-      return FALSE;
-    }
-  }
-
-  FreeUserCredential(cred);
-
-  /* Handle the SecurityResult message */
-  if (!rfbHandleAuthResult(client)) return FALSE;
-
-  return TRUE;
-}
-
-/* Simple 64bit big integer arithmetic implementation */
-/* (x + y) % m, works even if (x + y) > 64bit */
-#define rfbAddM64(x,y,m) ((x+y)%m+(x+y<x?(((uint64_t)-1)%m+1)%m:0))
-/* (x * y) % m */
-static uint64_t
-rfbMulM64(uint64_t x, uint64_t y, uint64_t m)
-{
-  uint64_t r;
-  for(r=0;x>0;x>>=1)
-  {
-    if (x&1) r=rfbAddM64(r,y,m);
-    y=rfbAddM64(y,y,m);
-  }
-  return r;
-}
-/* (x ^ y) % m */
-static uint64_t
-rfbPowM64(uint64_t b, uint64_t e, uint64_t m)
-{
-  uint64_t r;
-  for(r=1;e>0;e>>=1)
-  {
-    if(e&1) r=rfbMulM64(r,b,m);
-    b=rfbMulM64(b,b,m);
-  }
-  return r;
-}
-
-static rfbBool
-HandleMSLogonAuth(rfbClient *client)
-{
-  uint64_t gen, mod, resp, priv, pub, key;
-  uint8_t username[256], password[64];
-  rfbCredential *cred;
-
-  if (!ReadFromRFBServer(client, (char *)&gen, 8)) return FALSE;
-  if (!ReadFromRFBServer(client, (char *)&mod, 8)) return FALSE;
-  if (!ReadFromRFBServer(client, (char *)&resp, 8)) return FALSE;
-  gen = rfbClientSwap64IfLE(gen);
-  mod = rfbClientSwap64IfLE(mod);
-  resp = rfbClientSwap64IfLE(resp);
-
-  if (!client->GetCredential)
-  {
-    rfbClientLog("GetCredential callback is not set.\n");
-    return FALSE;
-  }
-  rfbClientLog("WARNING! MSLogon security type has very low password encryption! "\
-    "Use it only with SSH tunnel or trusted network.\n");
-  cred = client->GetCredential(client, rfbCredentialTypeUser);
-  if (!cred)
-  {
-    rfbClientLog("Reading credential failed\n");
-    return FALSE;
-  }
-
-  memset(username, 0, sizeof(username));
-  strncpy((char *)username, cred->userCredential.username, sizeof(username));
-  memset(password, 0, sizeof(password));
-  strncpy((char *)password, cred->userCredential.password, sizeof(password));
-  FreeUserCredential(cred);
-
-  srand(time(NULL));
-  priv = ((uint64_t)rand())<<32;
-  priv |= (uint64_t)rand();
-
-  pub = rfbPowM64(gen, priv, mod);
-  key = rfbPowM64(resp, priv, mod);
-  pub = rfbClientSwap64IfLE(pub);
-  key = rfbClientSwap64IfLE(key);
-
-  rfbClientEncryptBytes2(username, sizeof(username), (unsigned char *)&key);
-  rfbClientEncryptBytes2(password, sizeof(password), (unsigned char *)&key);
-
-  if (!WriteToRFBServer(client, (char *)&pub, 8)) return FALSE;
-  if (!WriteToRFBServer(client, (char *)username, sizeof(username))) return FALSE;
-  if (!WriteToRFBServer(client, (char *)password, sizeof(password))) return FALSE;
-
-  /* Handle the SecurityResult message */
-  if (!rfbHandleAuthResult(client)) return FALSE;
-
-  return TRUE;
-}
-
-#ifdef LIBVNCSERVER_WITH_CLIENT_GCRYPT
-static rfbBool
-rfbMpiToBytes(const gcry_mpi_t value, uint8_t *result, size_t size)
-{
-  gcry_error_t error;
-  size_t len;
-  int i;
-
-  error = gcry_mpi_print(GCRYMPI_FMT_USG, result, size, &len, value);
-  if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-  {
-    rfbClientLog("gcry_mpi_print error: %s\n", gcry_strerror(error));
-    return FALSE;
-  }
-  for (i=size-1;i>(int)size-1-(int)len;--i)
-    result[i] = result[i-size+len];
-  for (;i>=0;--i)
-    result[i] = 0;
-  return TRUE;
-}
-
-static rfbBool
-HandleARDAuth(rfbClient *client)
-{
-  uint8_t gen[2], len[2];
-  size_t keylen;
-  uint8_t *mod = NULL, *resp, *pub, *key, *shared;
-  gcry_mpi_t genmpi = NULL, modmpi = NULL, respmpi = NULL;
-  gcry_mpi_t privmpi = NULL, pubmpi = NULL, keympi = NULL;
-  gcry_md_hd_t md5 = NULL;
-  gcry_cipher_hd_t aes = NULL;
-  gcry_error_t error;
-  uint8_t userpass[128], ciphertext[128];
-  int passwordLen, usernameLen;
-  rfbCredential *cred = NULL;
-  rfbBool result = FALSE;
-
-  while (1)
-  {
-    if (!ReadFromRFBServer(client, (char *)gen, 2))
-      break;
-    if (!ReadFromRFBServer(client, (char *)len, 2))
-      break;
-
-    if (!client->GetCredential)
-    {
-      rfbClientLog("GetCredential callback is not set.\n");
-      break;
-    }
-    cred = client->GetCredential(client, rfbCredentialTypeUser);
-    if (!cred)
-    {
-      rfbClientLog("Reading credential failed\n");
-      break;
-    }
-
-    keylen = 256*len[0]+len[1];
-    mod = (uint8_t*)malloc(keylen*4);
-    if (!mod)
-    {
-      rfbClientLog("malloc out of memory\n");
-      break;
-    }
-    resp = mod+keylen;
-    pub = resp+keylen;
-    key = pub+keylen;
-
-    if (!ReadFromRFBServer(client, (char *)mod, keylen))
-      break;
-    if (!ReadFromRFBServer(client, (char *)resp, keylen))
-      break;
-
-    error = gcry_mpi_scan(&genmpi, GCRYMPI_FMT_USG, gen, 2, NULL);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_mpi_scan error: %s\n", gcry_strerror(error));
-      break;
-    }
-    error = gcry_mpi_scan(&modmpi, GCRYMPI_FMT_USG, mod, keylen, NULL);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_mpi_scan error: %s\n", gcry_strerror(error));
-      break;
-    }
-    error = gcry_mpi_scan(&respmpi, GCRYMPI_FMT_USG, resp, keylen, NULL);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_mpi_scan error: %s\n", gcry_strerror(error));
-      break;
-    }
-
-    privmpi = gcry_mpi_new(keylen);
-    if (!privmpi)
-    {
-      rfbClientLog("gcry_mpi_new out of memory\n");
-      break;
-    }
-    gcry_mpi_randomize(privmpi, (keylen/8)*8, GCRY_STRONG_RANDOM);
-
-    pubmpi = gcry_mpi_new(keylen);
-    if (!pubmpi)
-    {
-      rfbClientLog("gcry_mpi_new out of memory\n");
-      break;
-    }
-    gcry_mpi_powm(pubmpi, genmpi, privmpi, modmpi);
-
-    keympi = gcry_mpi_new(keylen);
-    if (!keympi)
-    {
-      rfbClientLog("gcry_mpi_new out of memory\n");
-      break;
-    }
-    gcry_mpi_powm(keympi, respmpi, privmpi, modmpi);
-
-    if (!rfbMpiToBytes(pubmpi, pub, keylen))
-      break;
-    if (!rfbMpiToBytes(keympi, key, keylen))
-      break;
-
-    error = gcry_md_open(&md5, GCRY_MD_MD5, 0);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_md_open error: %s\n", gcry_strerror(error));
-      break;
-    }
-    gcry_md_write(md5, key, keylen);
-    error = gcry_md_final(md5);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_md_final error: %s\n", gcry_strerror(error));
-      break;
-    }
-    shared = gcry_md_read(md5, GCRY_MD_MD5);
-
-    passwordLen = strlen(cred->userCredential.password)+1;
-    usernameLen = strlen(cred->userCredential.username)+1;
-    if (passwordLen > sizeof(userpass)/2)
-      passwordLen = sizeof(userpass)/2;
-    if (usernameLen > sizeof(userpass)/2)
-      usernameLen = sizeof(userpass)/2;
-
-    gcry_randomize(userpass, sizeof(userpass), GCRY_STRONG_RANDOM);
-    memcpy(userpass, cred->userCredential.username, usernameLen);
-    memcpy(userpass+sizeof(userpass)/2, cred->userCredential.password, passwordLen);
-
-    error = gcry_cipher_open(&aes, GCRY_CIPHER_AES128, GCRY_CIPHER_MODE_ECB, 0);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_cipher_open error: %s\n", gcry_strerror(error));
-      break;
-    }
-    error = gcry_cipher_setkey(aes, shared, 16);
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_cipher_setkey error: %s\n", gcry_strerror(error));
-      break;
-    }
-    error = gcry_cipher_encrypt(aes, ciphertext, sizeof(ciphertext), userpass, sizeof(userpass));
-    if (gcry_err_code(error) != GPG_ERR_NO_ERROR)
-    {
-      rfbClientLog("gcry_cipher_encrypt error: %s\n", gcry_strerror(error));
-      break;
-    }
-
-    if (!WriteToRFBServer(client, (char *)ciphertext, sizeof(ciphertext)))
-      break;
-    if (!WriteToRFBServer(client, (char *)pub, keylen))
-      break;
-
-    /* Handle the SecurityResult message */
-    if (!rfbHandleAuthResult(client))
-      break;
-
-    result = TRUE;
-    break;
-  }
-
-  if (cred)
-    FreeUserCredential(cred);
-  if (mod)
-    free(mod);
-  if (genmpi)
-    gcry_mpi_release(genmpi);
-  if (modmpi)
-    gcry_mpi_release(modmpi);
-  if (respmpi)
-    gcry_mpi_release(respmpi);
-  if (privmpi)
-    gcry_mpi_release(privmpi);
-  if (pubmpi)
-    gcry_mpi_release(pubmpi);
-  if (keympi)
-    gcry_mpi_release(keympi);
-  if (md5)
-    gcry_md_close(md5);
-  if (aes)
-    gcry_cipher_close(aes);
-  return result;
-}
-#endif
-
-/*
- * SetClientAuthSchemes.
- */
-
-void
-SetClientAuthSchemes(rfbClient* client,const uint32_t *authSchemes, int size)
-{
-  int i;
-
-  if (client->clientAuthSchemes)
-  {
-    free(client->clientAuthSchemes);
-    client->clientAuthSchemes = NULL;
-  }
-  if (authSchemes)
-  {
-    if (size<0)
-    {
-      /* If size<0 we assume the passed-in list is also 0-terminate, so we
-       * calculate the size here */
-      for (size=0;authSchemes[size];size++) ;
-    }
-    client->clientAuthSchemes = (uint32_t*)malloc(sizeof(uint32_t)*(size+1));
-    for (i=0;i<size;i++)
-      client->clientAuthSchemes[i] = authSchemes[i];
-    client->clientAuthSchemes[size] = 0;
-  }
-}
-
-/*
- * InitialiseRFBConnection.
- */
-
-rfbBool
-InitialiseRFBConnection(rfbClient* client)
-{
-  rfbProtocolVersionMsg pv;
-  int major,minor;
-  uint32_t authScheme;
-  uint32_t subAuthScheme;
-  rfbClientInitMsg ci;
-
-  /* if the connection is immediately closed, don't report anything, so
-       that pmw's monitor can make test connections */
-
-  if (client->listenSpecified)
-    errorMessageOnReadFailure = FALSE;
-
-  if (!ReadFromRFBServer(client, pv, sz_rfbProtocolVersionMsg)) return FALSE;
-  pv[sz_rfbProtocolVersionMsg]=0;
-
-  errorMessageOnReadFailure = TRUE;
-
-  pv[sz_rfbProtocolVersionMsg] = 0;
-
-  if (sscanf(pv,rfbProtocolVersionFormat,&major,&minor) != 2) {
-    rfbClientLog("Not a valid VNC server (%s)\n",pv);
-    return FALSE;
-  }
-
-
-  DefaultSupportedMessages(client);
-  client->major = major;
-  client->minor = minor;
-
-  /* fall back to viewer supported version */
-  if ((major==rfbProtocolMajorVersion) && (minor>rfbProtocolMinorVersion))
-    client->minor = rfbProtocolMinorVersion;
-
-  /* UltraVNC uses minor codes 4 and 6 for the server */
-  if (major==3 && (minor==4 || minor==6)) {
-      rfbClientLog("UltraVNC server detected, enabling UltraVNC specific messages\n",pv);
-      DefaultSupportedMessagesUltraVNC(client);
-  }
-
-  /* UltraVNC Single Click uses minor codes 14 and 16 for the server */
-  if (major==3 && (minor==14 || minor==16)) {
-     minor = minor - 10;
-     client->minor = minor;
-     rfbClientLog("UltraVNC Single Click server detected, enabling UltraVNC specific messages\n",pv);
-     DefaultSupportedMessagesUltraVNC(client);
-  }
-
-  /* TightVNC uses minor codes 5 for the server */
-  if (major==3 && minor==5) {
-      rfbClientLog("TightVNC server detected, enabling TightVNC specific messages\n",pv);
-      DefaultSupportedMessagesTightVNC(client);
-  }
-
-  /* we do not support > RFB3.8 */
-  if ((major==3 && minor>8) || major>3)
-  {
-    client->major=3;
-    client->minor=8;
-  }
-
-  rfbClientLog("VNC server supports protocol version %d.%d (viewer %d.%d)\n",
-	  major, minor, rfbProtocolMajorVersion, rfbProtocolMinorVersion);
-
-  sprintf(pv,rfbProtocolVersionFormat,client->major,client->minor);
-
-  if (!WriteToRFBServer(client, pv, sz_rfbProtocolVersionMsg)) return FALSE;
-
-
-  /* 3.7 and onwards sends a # of security types first */
-  if (client->major==3 && client->minor > 6)
-  {
-    if (!ReadSupportedSecurityType(client, &authScheme, FALSE)) return FALSE;
-  }
-  else
-  {
-    if (!ReadFromRFBServer(client, (char *)&authScheme, 4)) return FALSE;
-    authScheme = rfbClientSwap32IfLE(authScheme);
-  }
-  
-  rfbClientLog("Selected Security Scheme %d\n", authScheme);
-  client->authScheme = authScheme;
-  
-  switch (authScheme) {
-
-  case rfbConnFailed:
-    ReadReason(client);
-    return FALSE;
-
-  case rfbNoAuth:
-    rfbClientLog("No authentication needed\n");
-
-    /* 3.8 and upwards sends a Security Result for rfbNoAuth */
-    if ((client->major==3 && client->minor > 7) || client->major>3)
-        if (!rfbHandleAuthResult(client)) return FALSE;        
-
-    break;
-
-  case rfbVncAuth:
-    if (!HandleVncAuth(client)) return FALSE;
-    break;
-
-  case rfbMSLogon:
-    if (!HandleMSLogonAuth(client)) return FALSE;
-    break;
-
-  case rfbARD:
-#ifndef LIBVNCSERVER_WITH_CLIENT_GCRYPT
-    rfbClientLog("GCrypt support was not compiled in\n");
-    return FALSE;
-#else
-    if (!HandleARDAuth(client)) return FALSE;
-#endif
-    break;
-
-  case rfbTLS:
-    if (!HandleAnonTLSAuth(client)) return FALSE;
-    /* After the TLS session is established, sub auth types are expected.
-     * Note that all following reading/writing are through the TLS session from here.
-     */
-    if (!ReadSupportedSecurityType(client, &subAuthScheme, TRUE)) return FALSE;
-    client->subAuthScheme = subAuthScheme;
-
-    switch (subAuthScheme) {
-
-      case rfbConnFailed:
-        ReadReason(client);
-        return FALSE;
-
-      case rfbNoAuth:
-        rfbClientLog("No sub authentication needed\n");
-        /* 3.8 and upwards sends a Security Result for rfbNoAuth */
-        if ((client->major==3 && client->minor > 7) || client->major>3)
-            if (!rfbHandleAuthResult(client)) return FALSE;
-        break;
-
-      case rfbVncAuth:
-        if (!HandleVncAuth(client)) return FALSE;
-        break;
-
-      default:
-        rfbClientLog("Unknown sub authentication scheme from VNC server: %d\n",
-            (int)subAuthScheme);
-        return FALSE;
-    }
-
-    break;
-
-  case rfbVeNCrypt:
-    if (!HandleVeNCryptAuth(client)) return FALSE;
-
-    switch (client->subAuthScheme) {
-
-      case rfbVeNCryptTLSNone:
-      case rfbVeNCryptX509None:
-        rfbClientLog("No sub authentication needed\n");
-        if (!rfbHandleAuthResult(client)) return FALSE;
-        break;
-
-      case rfbVeNCryptTLSVNC:
-      case rfbVeNCryptX509VNC:
-        if (!HandleVncAuth(client)) return FALSE;
-        break;
-
-      case rfbVeNCryptTLSPlain:
-      case rfbVeNCryptX509Plain:
-        if (!HandlePlainAuth(client)) return FALSE;
-        break;
-
-      default:
-        rfbClientLog("Unknown sub authentication scheme from VNC server: %d\n",
-            client->subAuthScheme);
-        return FALSE;
-    }
-
-    break;
-
-  case rfbSecTypeItalc:
-    handleSecTypeItalc( client );
-    if (!rfbHandleAuthResult(client)) return FALSE;
-    break;
-
-  case rfbUltraVNC_MsLogonIIAuth:
-    handleMsLogonIIAuth( client );
-    if (!rfbHandleAuthResult(client)) return FALSE;
-    break;
-
-  default:
-    rfbClientLog("Unknown authentication scheme from VNC server: %d\n",
-	    (int)authScheme);
-    return FALSE;
-  }
-
-  ci.shared = (client->appData.shareDesktop ? 1 : 0);
-
-  if (!WriteToRFBServer(client,  (char *)&ci, sz_rfbClientInitMsg)) return FALSE;
-
-  if (!ReadFromRFBServer(client, (char *)&client->si, sz_rfbServerInitMsg)) return FALSE;
-
-  client->si.framebufferWidth = rfbClientSwap16IfLE(client->si.framebufferWidth);
-  client->si.framebufferHeight = rfbClientSwap16IfLE(client->si.framebufferHeight);
-  client->si.format.redMax = rfbClientSwap16IfLE(client->si.format.redMax);
-  client->si.format.greenMax = rfbClientSwap16IfLE(client->si.format.greenMax);
-  client->si.format.blueMax = rfbClientSwap16IfLE(client->si.format.blueMax);
-  client->si.nameLength = rfbClientSwap32IfLE(client->si.nameLength);
-
-  client->desktopName = malloc(client->si.nameLength + 1);
-  if (!client->desktopName) {
-    rfbClientLog("Error allocating memory for desktop name, %lu bytes\n",
-            (unsigned long)client->si.nameLength);
-    return FALSE;
-  }
-
-  if (!ReadFromRFBServer(client, client->desktopName, client->si.nameLength)) return FALSE;
-
-  client->desktopName[client->si.nameLength] = 0;
-
-  rfbClientLog("Desktop name \"%s\"\n",client->desktopName);
-
-  rfbClientLog("Connected to VNC server, using protocol version %d.%d\n",
-	  client->major, client->minor);
-
-  rfbClientLog("VNC server default format:\n");
-  PrintPixelFormat(&client->si.format);
-
-  return TRUE;
-}
-
-
-/*
- * SetFormatAndEncodings.
- */
-
-rfbBool
-SetFormatAndEncodings(rfbClient* client)
-{
-  rfbSetPixelFormatMsg spf;
-  char buf[sz_rfbSetEncodingsMsg + MAX_ENCODINGS * 4];
-
-  rfbSetEncodingsMsg *se = (rfbSetEncodingsMsg *)buf;
-  uint32_t *encs = (uint32_t *)(&buf[sz_rfbSetEncodingsMsg]);
-  int len = 0;
-  rfbBool requestCompressLevel = FALSE;
-  rfbBool requestQualityLevel = FALSE;
-  rfbBool requestLastRectEncoding = FALSE;
-  rfbClientProtocolExtension* e;
-
-  if (!SupportsClient2Server(client, rfbSetPixelFormat)) return TRUE;
-
-  spf.type = rfbSetPixelFormat;
-  spf.format = client->format;
-  spf.format.redMax = rfbClientSwap16IfLE(spf.format.redMax);
-  spf.format.greenMax = rfbClientSwap16IfLE(spf.format.greenMax);
-  spf.format.blueMax = rfbClientSwap16IfLE(spf.format.blueMax);
-
-  if (!WriteToRFBServer(client, (char *)&spf, sz_rfbSetPixelFormatMsg))
-    return FALSE;
-
-
-  if (!SupportsClient2Server(client, rfbSetEncodings)) return TRUE;
-
-  se->type = rfbSetEncodings;
-  se->nEncodings = 0;
-
-  if (client->appData.encodingsString) {
-    const char *encStr = client->appData.encodingsString;
-    int encStrLen;
-    do {
-      const char *nextEncStr = strchr(encStr, ' ');
-      if (nextEncStr) {
-	encStrLen = nextEncStr - encStr;
-	nextEncStr++;
-      } else {
-	encStrLen = strlen(encStr);
-      }
-
-      if (strncasecmp(encStr,"raw",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRaw);
-      } else if (strncasecmp(encStr,"copyrect",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCopyRect);
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-      } else if (strncasecmp(encStr,"tight",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingTight);
-	requestLastRectEncoding = TRUE;
-	if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9)
-	  requestCompressLevel = TRUE;
-	if (client->appData.enableJPEG)
-	  requestQualityLevel = TRUE;
-#endif
-#endif
-      } else if (strncasecmp(encStr,"hextile",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingHextile);
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-      } else if (strncasecmp(encStr,"zlib",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZlib);
-	if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9)
-	  requestCompressLevel = TRUE;
-      } else if (strncasecmp(encStr,"zlibhex",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZlibHex);
-	if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9)
-	  requestCompressLevel = TRUE;
-      } else if (strncasecmp(encStr,"zrle",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZRLE);
-      } else if (strncasecmp(encStr,"zywrle",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZYWRLE);
-	requestQualityLevel = TRUE;
-#endif
-      } else if ((strncasecmp(encStr,"ultra",encStrLen) == 0) || (strncasecmp(encStr,"ultrazip",encStrLen) == 0)) {
-        /* There are 2 encodings used in 'ultra' */
-        encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltra);
-        encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltraZip);
-      } else if (strncasecmp(encStr,"corre",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCoRRE);
-      } else if (strncasecmp(encStr,"rre",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRRE);
-#ifdef LIBVNCSERVER_CONFIG_LIBVA
-      } else if (strncasecmp(encStr,"h264",encStrLen) == 0) {
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingH264);
-#endif
-      } else {
-	rfbClientLog("Unknown encoding '%.*s'\n",encStrLen,encStr);
-      }
-
-      encStr = nextEncStr;
-    } while (encStr && se->nEncodings < MAX_ENCODINGS);
-
-    if (se->nEncodings < MAX_ENCODINGS && requestCompressLevel) {
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.compressLevel +
-					  rfbEncodingCompressLevel0);
-    }
-
-    if (se->nEncodings < MAX_ENCODINGS && requestQualityLevel) {
-      if (client->appData.qualityLevel < 0 || client->appData.qualityLevel > 9)
-        client->appData.qualityLevel = 5;
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.qualityLevel +
-					  rfbEncodingQualityLevel0);
-    }
-  }
-  else {
-    if (SameMachine(client->sock)) {
-      /* TODO:
-      if (!tunnelSpecified) {
-      */
-      rfbClientLog("Same machine: preferring raw encoding\n");
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRaw);
-      /*
-      } else {
-	rfbClientLog("Tunneling active: preferring tight encoding\n");
-      }
-      */
-    }
-
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCopyRect);
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingTight);
-    requestLastRectEncoding = TRUE;
-#endif
-#endif
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingHextile);
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZlib);
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZRLE);
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZYWRLE);
-#endif
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltra);
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltraZip);
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCoRRE);
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRRE);
-
-    if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9) {
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.compressLevel +
-					  rfbEncodingCompressLevel0);
-    } else /* if (!tunnelSpecified) */ {
-      /* If -tunnel option was provided, we assume that server machine is
-	 not in the local network so we use default compression level for
-	 tight encoding instead of fast compression. Thus we are
-	 requesting level 1 compression only if tunneling is not used. */
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCompressLevel1);
-    }
-
-    if (client->appData.enableJPEG) {
-      if (client->appData.qualityLevel < 0 || client->appData.qualityLevel > 9)
-	client->appData.qualityLevel = 5;
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.qualityLevel +
-					  rfbEncodingQualityLevel0);
-    }
-#ifdef LIBVNCSERVER_CONFIG_LIBVA
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingH264);
-    rfbClientLog("h264 encoding added\n");
-#endif
-  }
-
-
-
-  /* Remote Cursor Support (local to viewer) */
-  if (client->appData.useRemoteCursor) {
-    if (se->nEncodings < MAX_ENCODINGS)
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingXCursor);
-    if (se->nEncodings < MAX_ENCODINGS)
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRichCursor);
-    if (se->nEncodings < MAX_ENCODINGS)
-      encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingPointerPos);
-  }
-
-  /* Keyboard State Encodings */
-  if (se->nEncodings < MAX_ENCODINGS)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingKeyboardLedState);
-
-  /* New Frame Buffer Size */
-  if (se->nEncodings < MAX_ENCODINGS && client->canHandleNewFBSize)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingNewFBSize);
-
-  /* Last Rect */
-  if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingLastRect);
-
-  /* Server Capabilities */
-  if (se->nEncodings < MAX_ENCODINGS)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingSupportedMessages);
-  if (se->nEncodings < MAX_ENCODINGS)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingSupportedEncodings);
-  if (se->nEncodings < MAX_ENCODINGS)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingServerIdentity);
-
-  /* xvp */
-  if (se->nEncodings < MAX_ENCODINGS)
-    encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingXvp);
-
-  /* client extensions */
-  for(e = rfbClientExtensions; e; e = e->next)
-    if(e->encodings) {
-      int* enc;
-      for(enc = e->encodings; *enc; enc++)
-	encs[se->nEncodings++] = rfbClientSwap32IfLE(*enc);
-    }
-
-  len = sz_rfbSetEncodingsMsg + se->nEncodings * 4;
-
-  se->nEncodings = rfbClientSwap16IfLE(se->nEncodings);
-
-  if (!WriteToRFBServer(client, buf, len)) return FALSE;
-
-  return TRUE;
-}
-
-
-/*
- * SendIncrementalFramebufferUpdateRequest.
- */
-
-rfbBool
-SendIncrementalFramebufferUpdateRequest(rfbClient* client)
-{
-	return SendFramebufferUpdateRequest(client,
-			client->updateRect.x, client->updateRect.y,
-			client->updateRect.w, client->updateRect.h, TRUE);
-}
-
-
-/*
- * SendFramebufferUpdateRequest.
- */
-
-rfbBool
-SendFramebufferUpdateRequest(rfbClient* client, int x, int y, int w, int h, rfbBool incremental)
-{
-  rfbFramebufferUpdateRequestMsg fur;
-	/* Tobias Doerffel, 2010/10 */
-	char *noUpdates = rfbClientGetClientData(client, (void *) 0x555);
-	if( noUpdates )
-	{
-		return TRUE;
-	}
-	/*                          */
-
-  if (!SupportsClient2Server(client, rfbFramebufferUpdateRequest)) return TRUE;
-  
-  fur.type = rfbFramebufferUpdateRequest;
-  fur.incremental = incremental ? 1 : 0;
-  fur.x = rfbClientSwap16IfLE(x);
-  fur.y = rfbClientSwap16IfLE(y);
-  fur.w = rfbClientSwap16IfLE(w);
-  fur.h = rfbClientSwap16IfLE(h);
-
-  if (!WriteToRFBServer(client, (char *)&fur, sz_rfbFramebufferUpdateRequestMsg))
-    return FALSE;
-
-  return TRUE;
-}
-
-
-/*
- * SendScaleSetting.
- */
-rfbBool
-SendScaleSetting(rfbClient* client,int scaleSetting)
-{
-  rfbSetScaleMsg ssm;
-
-  ssm.scale = scaleSetting;
-  ssm.pad = 0;
-  
-  /* favor UltraVNC SetScale if both are supported */
-  if (SupportsClient2Server(client, rfbSetScale)) {
-      ssm.type = rfbSetScale;
-      if (!WriteToRFBServer(client, (char *)&ssm, sz_rfbSetScaleMsg))
-          return FALSE;
-  }
-  
-  if (SupportsClient2Server(client, rfbPalmVNCSetScaleFactor)) {
-      ssm.type = rfbPalmVNCSetScaleFactor;
-      if (!WriteToRFBServer(client, (char *)&ssm, sz_rfbSetScaleMsg))
-          return FALSE;
-  }
-
-  return TRUE;
-}
-
-/*
- * TextChatFunctions (UltraVNC)
- * Extremely bandwidth friendly method of communicating with a user
- * (Think HelpDesk type applications)
- */
-
-rfbBool TextChatSend(rfbClient* client, char *text)
-{
-    rfbTextChatMsg chat;
-    int count = strlen(text);
-
-    if (!SupportsClient2Server(client, rfbTextChat)) return TRUE;
-    chat.type = rfbTextChat;
-    chat.pad1 = 0;
-    chat.pad2 = 0;
-    chat.length = (uint32_t)count;
-    chat.length = rfbClientSwap32IfLE(chat.length);
-
-    if (!WriteToRFBServer(client, (char *)&chat, sz_rfbTextChatMsg))
-        return FALSE;
-
-    if (count>0) {
-        if (!WriteToRFBServer(client, text, count))
-            return FALSE;
-    }
-    return TRUE;
-}
-
-rfbBool TextChatOpen(rfbClient* client)
-{
-    rfbTextChatMsg chat;
-
-    if (!SupportsClient2Server(client, rfbTextChat)) return TRUE;
-    chat.type = rfbTextChat;
-    chat.pad1 = 0;
-    chat.pad2 = 0;
-    chat.length = rfbClientSwap32IfLE(rfbTextChatOpen);
-    return  (WriteToRFBServer(client, (char *)&chat, sz_rfbTextChatMsg) ? TRUE : FALSE);
-}
-
-rfbBool TextChatClose(rfbClient* client)
-{
-    rfbTextChatMsg chat;
-    if (!SupportsClient2Server(client, rfbTextChat)) return TRUE;
-    chat.type = rfbTextChat;
-    chat.pad1 = 0;
-    chat.pad2 = 0;
-    chat.length = rfbClientSwap32IfLE(rfbTextChatClose);
-    return  (WriteToRFBServer(client, (char *)&chat, sz_rfbTextChatMsg) ? TRUE : FALSE);
-}
-
-rfbBool TextChatFinish(rfbClient* client)
-{
-    rfbTextChatMsg chat;
-    if (!SupportsClient2Server(client, rfbTextChat)) return TRUE;
-    chat.type = rfbTextChat;
-    chat.pad1 = 0;
-    chat.pad2 = 0;
-    chat.length = rfbClientSwap32IfLE(rfbTextChatFinished);
-    return  (WriteToRFBServer(client, (char *)&chat, sz_rfbTextChatMsg) ? TRUE : FALSE);
-}
-
-/*
- * UltraVNC Server Input Disable
- * Apparently, the remote client can *prevent* the local user from interacting with the display
- * I would think this is extremely helpful when used in a HelpDesk situation
- */
-rfbBool PermitServerInput(rfbClient* client, int enabled)
-{
-    rfbSetServerInputMsg msg;
-
-    if (!SupportsClient2Server(client, rfbSetServerInput)) return TRUE;
-    /* enabled==1, then server input from local keyboard is disabled */
-    msg.type = rfbSetServerInput;
-    msg.status = (enabled ? 1 : 0);
-    msg.pad = 0;
-    return  (WriteToRFBServer(client, (char *)&msg, sz_rfbSetServerInputMsg) ? TRUE : FALSE);
-}
-
-
-/*
- * send xvp client message
- * A client supporting the xvp extension sends this to request that the server initiate
- * a clean shutdown, clean reboot or abrupt reset of the system whose framebuffer the
- * client is displaying.
- *
- * only version 1 is defined in the protocol specs
- *
- * possible values for code are:
- *   rfbXvp_Shutdown
- *   rfbXvp_Reboot
- *   rfbXvp_Reset
- */
-
-rfbBool SendXvpMsg(rfbClient* client, uint8_t version, uint8_t code)
-{
-    rfbXvpMsg xvp;
-
-    if (!SupportsClient2Server(client, rfbXvp)) return TRUE;
-    xvp.type = rfbXvp;
-    xvp.pad = 0;
-    xvp.version = version;
-    xvp.code = code;
-
-    if (!WriteToRFBServer(client, (char *)&xvp, sz_rfbXvpMsg))
-        return FALSE;
-
-    return TRUE;
-}
-
-
-/*
- * SendPointerEvent.
- */
-
-rfbBool
-SendPointerEvent(rfbClient* client,int x, int y, int buttonMask)
-{
-  rfbPointerEventMsg pe;
-
-  if (!SupportsClient2Server(client, rfbPointerEvent)) return TRUE;
-
-  pe.type = rfbPointerEvent;
-  pe.buttonMask = buttonMask;
-  if (x < 0) x = 0;
-  if (y < 0) y = 0;
-
-  pe.x = rfbClientSwap16IfLE(x);
-  pe.y = rfbClientSwap16IfLE(y);
-  return WriteToRFBServer(client, (char *)&pe, sz_rfbPointerEventMsg);
-}
-
-
-/*
- * SendKeyEvent.
- */
-
-rfbBool
-SendKeyEvent(rfbClient* client, uint32_t key, rfbBool down)
-{
-  rfbKeyEventMsg ke;
-
-  if (!SupportsClient2Server(client, rfbKeyEvent)) return TRUE;
-
-  ke.type = rfbKeyEvent;
-  ke.down = down ? 1 : 0;
-  ke.key = rfbClientSwap32IfLE(key);
-  return WriteToRFBServer(client, (char *)&ke, sz_rfbKeyEventMsg);
-}
-
-
-/*
- * SendClientCutText.
- */
-
-rfbBool
-SendClientCutText(rfbClient* client, const char *str, int len)
-{
-  rfbClientCutTextMsg cct;
-
-  if (!SupportsClient2Server(client, rfbClientCutText)) return TRUE;
-
-  cct.type = rfbClientCutText;
-  cct.length = rfbClientSwap32IfLE(len);
-  return  (WriteToRFBServer(client, (char *)&cct, sz_rfbClientCutTextMsg) &&
-	   WriteToRFBServer(client, str, len));
-}
-
-
-
-/*
- * HandleRFBServerMessage.
- */
-
-rfbBool
-HandleRFBServerMessage(rfbClient* client)
-{
-  rfbServerToClientMsg msg;
-
-  if (client->serverPort==-1)
-    client->vncRec->readTimestamp = TRUE;
-  if (!ReadFromRFBServer(client, (char *)&msg, 1))
-    return FALSE;
-
-  switch (msg.type) {
-
-  case rfbSetColourMapEntries:
-  {
-    /* TODO:
-    int i;
-    uint16_t rgb[3];
-    XColor xc;
-
-    if (!ReadFromRFBServer(client, ((char *)&msg) + 1,
-			   sz_rfbSetColourMapEntriesMsg - 1))
-      return FALSE;
-
-    msg.scme.firstColour = rfbClientSwap16IfLE(msg.scme.firstColour);
-    msg.scme.nColours = rfbClientSwap16IfLE(msg.scme.nColours);
-
-    for (i = 0; i < msg.scme.nColours; i++) {
-      if (!ReadFromRFBServer(client, (char *)rgb, 6))
-	return FALSE;
-      xc.pixel = msg.scme.firstColour + i;
-      xc.red = rfbClientSwap16IfLE(rgb[0]);
-      xc.green = rfbClientSwap16IfLE(rgb[1]);
-      xc.blue = rfbClientSwap16IfLE(rgb[2]);
-      xc.flags = DoRed|DoGreen|DoBlue;
-      XStoreColor(dpy, cmap, &xc);
-    }
-    */
-
-    break;
-  }
-
-  case rfbFramebufferUpdate:
-  {
-    rfbFramebufferUpdateRectHeader rect;
-    int linesToRead;
-    int bytesPerLine;
-    int i;
-
-    if (!ReadFromRFBServer(client, ((char *)&msg.fu) + 1,
-			   sz_rfbFramebufferUpdateMsg - 1))
-      return FALSE;
-
-    msg.fu.nRects = rfbClientSwap16IfLE(msg.fu.nRects);
-
-    for (i = 0; i < msg.fu.nRects; i++) {
-      if (!ReadFromRFBServer(client, (char *)&rect, sz_rfbFramebufferUpdateRectHeader))
-	return FALSE;
-
-      rect.encoding = rfbClientSwap32IfLE(rect.encoding);
-      if (rect.encoding == rfbEncodingLastRect)
-	break;
-
-      rect.r.x = rfbClientSwap16IfLE(rect.r.x);
-      rect.r.y = rfbClientSwap16IfLE(rect.r.y);
-      rect.r.w = rfbClientSwap16IfLE(rect.r.w);
-      rect.r.h = rfbClientSwap16IfLE(rect.r.h);
-
-
-      if (rect.encoding == rfbEncodingXCursor ||
-	  rect.encoding == rfbEncodingRichCursor) {
-
-	if (!HandleCursorShape(client,
-			       rect.r.x, rect.r.y, rect.r.w, rect.r.h,
-			       rect.encoding)) {
-	  return FALSE;
-	}
-	continue;
-      }
-
-      if (rect.encoding == rfbEncodingPointerPos) {
-	if (!client->HandleCursorPos(client,rect.r.x, rect.r.y)) {
-	  return FALSE;
-	}
-	continue;
-      }
-      
-      if (rect.encoding == rfbEncodingKeyboardLedState) {
-          /* OK! We have received a keyboard state message!!! */
-          client->KeyboardLedStateEnabled = 1;
-          if (client->HandleKeyboardLedState!=NULL)
-              client->HandleKeyboardLedState(client, rect.r.x, 0);
-          /* stash it for the future */
-          client->CurrentKeyboardLedState = rect.r.x;
-          continue;
-      }
-
-      if (rect.encoding == rfbEncodingNewFBSize) {
-	client->width = rect.r.w;
-	client->height = rect.r.h;
-	client->updateRect.x = client->updateRect.y = 0;
-	client->updateRect.w = client->width;
-	client->updateRect.h = client->height;
-	client->MallocFrameBuffer(client);
-	SendFramebufferUpdateRequest(client, 0, 0, rect.r.w, rect.r.h, FALSE);
-	rfbClientLog("Got new framebuffer size: %dx%d\n", rect.r.w, rect.r.h);
-	continue;
-      }
-
-      /* rect.r.w=byte count */
-      if (rect.encoding == rfbEncodingSupportedMessages) {
-          int loop;
-          if (!ReadFromRFBServer(client, (char *)&client->supportedMessages, sz_rfbSupportedMessages))
-              return FALSE;
-
-          /* msgs is two sets of bit flags of supported messages client2server[] and server2client[] */
-          /* currently ignored by this library */
-
-          rfbClientLog("client2server supported messages (bit flags)\n");
-          for (loop=0;loop<32;loop+=8)
-            rfbClientLog("%02X: %04x %04x %04x %04x - %04x %04x %04x %04x\n", loop,
-                client->supportedMessages.client2server[loop],   client->supportedMessages.client2server[loop+1],
-                client->supportedMessages.client2server[loop+2], client->supportedMessages.client2server[loop+3],
-                client->supportedMessages.client2server[loop+4], client->supportedMessages.client2server[loop+5],
-                client->supportedMessages.client2server[loop+6], client->supportedMessages.client2server[loop+7]);
-
-          rfbClientLog("server2client supported messages (bit flags)\n");
-          for (loop=0;loop<32;loop+=8)
-            rfbClientLog("%02X: %04x %04x %04x %04x - %04x %04x %04x %04x\n", loop,
-                client->supportedMessages.server2client[loop],   client->supportedMessages.server2client[loop+1],
-                client->supportedMessages.server2client[loop+2], client->supportedMessages.server2client[loop+3],
-                client->supportedMessages.server2client[loop+4], client->supportedMessages.server2client[loop+5],
-                client->supportedMessages.server2client[loop+6], client->supportedMessages.server2client[loop+7]);
-          continue;
-      }
-
-      /* rect.r.w=byte count, rect.r.h=# of encodings */
-      if (rect.encoding == rfbEncodingSupportedEncodings) {
-          char *buffer;
-          buffer = malloc(rect.r.w);
-          if (!ReadFromRFBServer(client, buffer, rect.r.w))
-          {
-              free(buffer);
-              return FALSE;
-          }
-
-          /* buffer now contains rect.r.h # of uint32_t encodings that the server supports */
-          /* currently ignored by this library */
-          free(buffer);
-          continue;
-      }
-
-      /* rect.r.w=byte count */
-      if (rect.encoding == rfbEncodingServerIdentity) {
-          char *buffer;
-          buffer = malloc(rect.r.w+1);
-          if (!ReadFromRFBServer(client, buffer, rect.r.w))
-          {
-              free(buffer);
-              return FALSE;
-          }
-          buffer[rect.r.w]=0; /* null terminate, just in case */
-          rfbClientLog("Connected to Server \"%s\"\n", buffer);
-          free(buffer);
-          continue;
-      }
-
-      /* rfbEncodingUltraZip is a collection of subrects.   x = # of subrects, and h is always 0 */
-      if (rect.encoding != rfbEncodingUltraZip)
-      {
-        if ((rect.r.x + rect.r.w > client->width) ||
-	    (rect.r.y + rect.r.h > client->height))
-	    {
-	      rfbClientLog("Rect too large: %dx%d at (%d, %d)\n",
-	  	  rect.r.w, rect.r.h, rect.r.x, rect.r.y);
-	      return FALSE;
-            }
-
-        /* UltraVNC with scaling, will send rectangles with a zero W or H
-         *
-        if ((rect.encoding != rfbEncodingTight) && 
-            (rect.r.h * rect.r.w == 0))
-        {
-	  rfbClientLog("Zero size rect - ignoring (encoding=%d (0x%08x) %dx, %dy, %dw, %dh)\n", rect.encoding, rect.encoding, rect.r.x, rect.r.y, rect.r.w, rect.r.h);
-	  continue;
-        }
-        */
-        
-        /* If RichCursor encoding is used, we should prevent collisions
-	   between framebuffer updates and cursor drawing operations. */
-        client->SoftCursorLockArea(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h);
-      }
-
-      switch (rect.encoding) {
-
-      case rfbEncodingRaw: {
-	int y=rect.r.y, h=rect.r.h;
-
-	bytesPerLine = rect.r.w * client->format.bitsPerPixel / 8;
-	linesToRead = RFB_BUFFER_SIZE / bytesPerLine;
-
-	while (h > 0) {
-	  if (linesToRead > h)
-	    linesToRead = h;
-
-	  if (!ReadFromRFBServer(client, client->buffer,bytesPerLine * linesToRead))
-	    return FALSE;
-
-	  CopyRectangle(client, (uint8_t *)client->buffer,
-			   rect.r.x, y, rect.r.w,linesToRead);
-
-	  h -= linesToRead;
-	  y += linesToRead;
-
-	}
-      } break;
-
-      case rfbEncodingCopyRect:
-      {
-	rfbCopyRect cr;
-
-	if (!ReadFromRFBServer(client, (char *)&cr, sz_rfbCopyRect))
-	  return FALSE;
-
-	cr.srcX = rfbClientSwap16IfLE(cr.srcX);
-	cr.srcY = rfbClientSwap16IfLE(cr.srcY);
-
-	/* If RichCursor encoding is used, we should extend our
-	   "cursor lock area" (previously set to destination
-	   rectangle) to the source rectangle as well. */
-	client->SoftCursorLockArea(client,
-				   cr.srcX, cr.srcY, rect.r.w, rect.r.h);
-
-        if (client->GotCopyRect != NULL) {
-          client->GotCopyRect(client, cr.srcX, cr.srcY, rect.r.w, rect.r.h,
-              rect.r.x, rect.r.y);
-        } else
-		CopyRectangleFromRectangle(client,
-				   cr.srcX, cr.srcY, rect.r.w, rect.r.h,
-				   rect.r.x, rect.r.y);
-
-	break;
-      }
-
-      case rfbEncodingRRE:
-      {
-	switch (client->format.bitsPerPixel) {
-	case 8:
-	  if (!HandleRRE8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 16:
-	  if (!HandleRRE16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 32:
-	  if (!HandleRRE32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	}
-	break;
-      }
-
-      case rfbEncodingCoRRE:
-      {
-	switch (client->format.bitsPerPixel) {
-	case 8:
-	  if (!HandleCoRRE8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 16:
-	  if (!HandleCoRRE16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 32:
-	  if (!HandleCoRRE32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	}
-	break;
-      }
-
-      case rfbEncodingHextile:
-      {
-	switch (client->format.bitsPerPixel) {
-	case 8:
-	  if (!HandleHextile8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 16:
-	  if (!HandleHextile16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 32:
-	  if (!HandleHextile32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	}
-	break;
-      }
-
-      case rfbEncodingUltra:
-      {
-        switch (client->format.bitsPerPixel) {
-        case 8:
-          if (!HandleUltra8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-            return FALSE;
-          break;
-        case 16:
-          if (!HandleUltra16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-            return FALSE;
-          break;
-        case 32:
-          if (!HandleUltra32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-            return FALSE;
-          break;
-        }
-        break;
-      }
-      case rfbEncodingUltraZip:
-      {
-        switch (client->format.bitsPerPixel) {
-        case 8:
-          if (!HandleUltraZip8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-            return FALSE;
-          break;
-        case 16:
-          if (!HandleUltraZip16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-            return FALSE;
-          break;
-        case 32:
-          if (!HandleUltraZip32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-            return FALSE;
-          break;
-        }
-        break;
-      }
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-      case rfbEncodingZlib:
-      {
-	switch (client->format.bitsPerPixel) {
-	case 8:
-	  if (!HandleZlib8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 16:
-	  if (!HandleZlib16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 32:
-	  if (!HandleZlib32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	}
-	break;
-     }
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-      case rfbEncodingTight:
-      {
-	switch (client->format.bitsPerPixel) {
-	case 8:
-	  if (!HandleTight8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 16:
-	  if (!HandleTight16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 32:
-	  if (!HandleTight32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	}
-	break;
-      }
-#endif
-      case rfbEncodingZRLE:
-	/* Fail safe for ZYWRLE unsupport VNC server. */
-	client->appData.qualityLevel = 9;
-	/* fall through */
-      case rfbEncodingZYWRLE:
-      {
-	switch (client->format.bitsPerPixel) {
-	case 8:
-	  if (!HandleZRLE8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	case 16:
-	  if (client->si.format.greenMax > 0x1F) {
-	    if (!HandleZRLE16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	      return FALSE;
-	  } else {
-	    if (!HandleZRLE15(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	      return FALSE;
-	  }
-	  break;
-	case 32:
-	{
-	  uint32_t maxColor=(client->format.redMax<<client->format.redShift)|
-		(client->format.greenMax<<client->format.greenShift)|
-		(client->format.blueMax<<client->format.blueShift);
-	  if ((client->format.bigEndian && (maxColor&0xff)==0) ||
-	      (!client->format.bigEndian && (maxColor&0xff000000)==0)) {
-	    if (!HandleZRLE24(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	      return FALSE;
-	  } else if (!client->format.bigEndian && (maxColor&0xff)==0) {
-	    if (!HandleZRLE24Up(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	      return FALSE;
-	  } else if (client->format.bigEndian && (maxColor&0xff000000)==0) {
-	    if (!HandleZRLE24Down(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	      return FALSE;
-	  } else if (!HandleZRLE32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-	    return FALSE;
-	  break;
-	}
-	}
-	break;
-     }
-
-#endif
-#ifdef LIBVNCSERVER_CONFIG_LIBVA
-      case rfbEncodingH264:
-      {
-	if (!HandleH264(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h))
-	  return FALSE;
-	break;
-      }
-#endif
-
-      default:
-	 {
-	   rfbBool handled = FALSE;
-	   rfbClientProtocolExtension* e;
-
-	   for(e = rfbClientExtensions; !handled && e; e = e->next)
-	     if(e->handleEncoding && e->handleEncoding(client, &rect))
-	       handled = TRUE;
-
-	   if(!handled) {
-	     rfbClientLog("Unknown rect encoding %d\n",
-		 (int)rect.encoding);
-	     return FALSE;
-	   }
-	 }
-      }
-
-      /* Now we may discard "soft cursor locks". */
-      client->SoftCursorUnlockScreen(client);
-
-      client->GotFrameBufferUpdate(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h);
-    }
-
-    if (!SendIncrementalFramebufferUpdateRequest(client))
-      return FALSE;
-
-    if (client->FinishedFrameBufferUpdate)
-      client->FinishedFrameBufferUpdate(client);
-
-    break;
-  }
-
-  case rfbBell:
-  {
-    client->Bell(client);
-
-    break;
-  }
-
-  case rfbServerCutText:
-  {
-    char *buffer;
-
-    if (!ReadFromRFBServer(client, ((char *)&msg) + 1,
-			   sz_rfbServerCutTextMsg - 1))
-      return FALSE;
-
-    msg.sct.length = rfbClientSwap32IfLE(msg.sct.length);
-
-    buffer = malloc(msg.sct.length+1);
-
-    if (!ReadFromRFBServer(client, buffer, msg.sct.length))
-      return FALSE;
-
-    buffer[msg.sct.length] = 0;
-
-    if (client->GotXCutText)
-      client->GotXCutText(client, buffer, msg.sct.length);
-
-    free(buffer);
-
-    break;
-  }
-
-  case rfbTextChat:
-  {
-      char *buffer=NULL;
-      if (!ReadFromRFBServer(client, ((char *)&msg) + 1,
-                             sz_rfbTextChatMsg- 1))
-        return FALSE;
-      msg.tc.length = rfbClientSwap32IfLE(msg.sct.length);
-      switch(msg.tc.length) {
-      case rfbTextChatOpen:
-          rfbClientLog("Received TextChat Open\n");
-          if (client->HandleTextChat!=NULL)
-              client->HandleTextChat(client, (int)rfbTextChatOpen, NULL);
-          break;
-      case rfbTextChatClose:
-          rfbClientLog("Received TextChat Close\n");
-         if (client->HandleTextChat!=NULL)
-              client->HandleTextChat(client, (int)rfbTextChatClose, NULL);
-          break;
-      case rfbTextChatFinished:
-          rfbClientLog("Received TextChat Finished\n");
-         if (client->HandleTextChat!=NULL)
-              client->HandleTextChat(client, (int)rfbTextChatFinished, NULL);
-          break;
-      default:
-          buffer=malloc(msg.tc.length+1);
-          if (!ReadFromRFBServer(client, buffer, msg.tc.length))
-          {
-              free(buffer);
-              return FALSE;
-          }
-          /* Null Terminate <just in case> */
-          buffer[msg.tc.length]=0;
-          rfbClientLog("Received TextChat \"%s\"\n", buffer);
-          if (client->HandleTextChat!=NULL)
-              client->HandleTextChat(client, (int)msg.tc.length, buffer);
-          free(buffer);
-          break;
-      }
-      break;
-  }
-
-  case rfbXvp:
-  {
-    if (!ReadFromRFBServer(client, ((char *)&msg) + 1,
-                           sz_rfbXvpMsg -1))
-      return FALSE;
-
-    SetClient2Server(client, rfbXvp);
-    /* technically, we only care what we can *send* to the server
-     * but, we set Server2Client Just in case it ever becomes useful
-     */
-    SetServer2Client(client, rfbXvp);
-
-    if(client->HandleXvpMsg)
-      client->HandleXvpMsg(client, msg.xvp.version, msg.xvp.code);
-
-    break;
-  }
-
-  case rfbResizeFrameBuffer:
-  {
-    if (!ReadFromRFBServer(client, ((char *)&msg) + 1,
-                           sz_rfbResizeFrameBufferMsg -1))
-      return FALSE;
-    client->width = rfbClientSwap16IfLE(msg.rsfb.framebufferWidth);
-    client->height = rfbClientSwap16IfLE(msg.rsfb.framebufferHeigth);
-    client->updateRect.x = client->updateRect.y = 0;
-    client->updateRect.w = client->width;
-    client->updateRect.h = client->height;
-    client->MallocFrameBuffer(client);
-    SendFramebufferUpdateRequest(client, 0, 0, client->width, client->height, FALSE);
-    rfbClientLog("Got new framebuffer size: %dx%d\n", client->width, client->height);
-    break;
-  }
-
-  case rfbPalmVNCReSizeFrameBuffer:
-  {
-    if (!ReadFromRFBServer(client, ((char *)&msg) + 1,
-                           sz_rfbPalmVNCReSizeFrameBufferMsg -1))
-      return FALSE;
-    client->width = rfbClientSwap16IfLE(msg.prsfb.buffer_w);
-    client->height = rfbClientSwap16IfLE(msg.prsfb.buffer_h);
-    client->updateRect.x = client->updateRect.y = 0;
-    client->updateRect.w = client->width;
-    client->updateRect.h = client->height;
-    client->MallocFrameBuffer(client);
-    SendFramebufferUpdateRequest(client, 0, 0, client->width, client->height, FALSE);
-    rfbClientLog("Got new framebuffer size: %dx%d\n", client->width, client->height);
-    break;
-  }
-
-  default:
-    {
-      rfbBool handled = FALSE;
-      rfbClientProtocolExtension* e;
-
-      for(e = rfbClientExtensions; !handled && e; e = e->next)
-	if(e->handleMessage && e->handleMessage(client, &msg))
-	  handled = TRUE;
-
-      if(!handled) {
-	char buffer[256];
-	rfbClientLog("Unknown message type %d from VNC server\n",msg.type);
-	ReadFromRFBServer(client, buffer, 256);
-	return FALSE;
-      }
-    }
-  }
-
-  return TRUE;
-}
-
-
-#define GET_PIXEL8(pix, ptr) ((pix) = *(ptr)++)
-
-#define GET_PIXEL16(pix, ptr) (((uint8_t*)&(pix))[0] = *(ptr)++, \
-			       ((uint8_t*)&(pix))[1] = *(ptr)++)
-
-#define GET_PIXEL32(pix, ptr) (((uint8_t*)&(pix))[0] = *(ptr)++, \
-			       ((uint8_t*)&(pix))[1] = *(ptr)++, \
-			       ((uint8_t*)&(pix))[2] = *(ptr)++, \
-			       ((uint8_t*)&(pix))[3] = *(ptr)++)
-
-/* CONCAT2 concatenates its two arguments.  CONCAT2E does the same but also
-   expands its arguments if they are macros */
-
-#define CONCAT2(a,b) a##b
-#define CONCAT2E(a,b) CONCAT2(a,b)
-#define CONCAT3(a,b,c) a##b##c
-#define CONCAT3E(a,b,c) CONCAT3(a,b,c)
-
-#define BPP 8
-#include "rre.c"
-#include "corre.c"
-#include "hextile.c"
-#include "ultra.c"
-#include "zlib.c"
-#include "tight.c"
-#include "zrle.c"
-#undef BPP
-#define BPP 16
-#include "rre.c"
-#include "corre.c"
-#include "hextile.c"
-#include "ultra.c"
-#include "zlib.c"
-#include "tight.c"
-#include "zrle.c"
-#define REALBPP 15
-#include "zrle.c"
-#undef BPP
-#define BPP 32
-#include "rre.c"
-#include "corre.c"
-#include "hextile.c"
-#include "ultra.c"
-#include "zlib.c"
-#include "tight.c"
-#include "zrle.c"
-#define REALBPP 24
-#include "zrle.c"
-#define REALBPP 24
-#define UNCOMP 8
-#include "zrle.c"
-#define REALBPP 24
-#define UNCOMP -8
-#include "zrle.c"
-#undef BPP
-#include "h264.c"
-
-
-/*
- * PrintPixelFormat.
- */
-
-void
-PrintPixelFormat(rfbPixelFormat *format)
-{
-  if (format->bitsPerPixel == 1) {
-    rfbClientLog("  Single bit per pixel.\n");
-    rfbClientLog(
-	    "  %s significant bit in each byte is leftmost on the screen.\n",
-	    (format->bigEndian ? "Most" : "Least"));
-  } else {
-    rfbClientLog("  %d bits per pixel.\n",format->bitsPerPixel);
-    if (format->bitsPerPixel != 8) {
-      rfbClientLog("  %s significant byte first in each pixel.\n",
-	      (format->bigEndian ? "Most" : "Least"));
-    }
-    if (format->trueColour) {
-      rfbClientLog("  TRUE colour: max red %d green %d blue %d"
-		   ", shift red %d green %d blue %d\n",
-		   format->redMax, format->greenMax, format->blueMax,
-		   format->redShift, format->greenShift, format->blueShift);
-    } else {
-      rfbClientLog("  Colour map (not true colour).\n");
-    }
-  }
-}
-
-/* avoid name clashes with LibVNCServer */
-
-#define rfbEncryptBytes rfbClientEncryptBytes
-#define rfbEncryptBytes2 rfbClientEncryptBytes2
-#define rfbDes rfbClientDes
-#define rfbDesKey rfbClientDesKey
-#define rfbUseKey rfbClientUseKey
-#define rfbCPKey rfbClientCPKey
-
-#include "vncauth.c"
-#include "d3des.c"
diff --git a/ica/x11/libvncclient/rre.c b/ica/x11/libvncclient/rre.c
deleted file mode 100644
index 94158c9..0000000
--- a/ica/x11/libvncclient/rre.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * rre.c - handle RRE encoding.
- *
- * This file shouldn't be compiled directly.  It is included multiple times by
- * rfbproto.c, each time with a different definition of the macro BPP.  For
- * each value of BPP, this file defines a function which handles an RRE
- * encoded rectangle with BPP bits per pixel.
- */
-
-#define HandleRREBPP CONCAT2E(HandleRRE,BPP)
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-
-static rfbBool
-HandleRREBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-  rfbRREHeader hdr;
-  int i;
-  CARDBPP pix;
-  rfbRectangle subrect;
-
-  if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbRREHeader))
-    return FALSE;
-
-  hdr.nSubrects = rfbClientSwap32IfLE(hdr.nSubrects);
-
-  if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
-    return FALSE;
-
-  FillRectangle(client, rx, ry, rw, rh, pix);
-
-  for (i = 0; i < hdr.nSubrects; i++) {
-    if (!ReadFromRFBServer(client, (char *)&pix, sizeof(pix)))
-      return FALSE;
-
-    if (!ReadFromRFBServer(client, (char *)&subrect, sz_rfbRectangle))
-      return FALSE;
-
-    subrect.x = rfbClientSwap16IfLE(subrect.x);
-    subrect.y = rfbClientSwap16IfLE(subrect.y);
-    subrect.w = rfbClientSwap16IfLE(subrect.w);
-    subrect.h = rfbClientSwap16IfLE(subrect.h);
-
-    FillRectangle(client, rx+subrect.x, ry+subrect.y, subrect.w, subrect.h, pix);
-  }
-
-  return TRUE;
-}
-
-#undef CARDBPP
diff --git a/ica/x11/libvncclient/sockets.c b/ica/x11/libvncclient/sockets.c
deleted file mode 100644
index c1cc416..0000000
--- a/ica/x11/libvncclient/sockets.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
- *  Copyright (C) 2011-2012 Christian Beier <dontmind at freeshell.org>
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * sockets.c - functions to deal with sockets.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#ifdef __linux__
-/* Setting this on other systems hides definitions such as INADDR_LOOPBACK.
- * The check should be for __GLIBC__ in fact. */
-# define _POSIX_SOURCE
-#endif
-#endif
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <rfb/rfbclient.h>
-#ifdef WIN32
-#undef SOCKET
-#include <winsock2.h>
-/* make sure to use the WSA error codes instead of the POSIX ones defined in errno.h */
-#ifdef EWOULDBLOCK
-#undef EWOULDBLOCK
-#endif
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define close closesocket
-#define read(sock,buf,len) recv(sock,buf,len,0)
-#define write(sock,buf,len) send(sock,buf,len,0)
-#define socklen_t int
-#ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H
-#undef socklen_t
-#include <ws2tcpip.h>
-#endif
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/un.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-#include "tls.h"
-
-void PrintInHex(char *buf, int len);
-
-rfbBool errorMessageOnReadFailure = TRUE;
-
-/*
- * ReadFromRFBServer is called whenever we want to read some data from the RFB
- * server.  It is non-trivial for two reasons:
- *
- * 1. For efficiency it performs some intelligent buffering, avoiding invoking
- *    the read() system call too often.  For small chunks of data, it simply
- *    copies the data out of an internal buffer.  For large amounts of data it
- *    reads directly into the buffer provided by the caller.
- *
- * 2. Whenever read() would block, it invokes the Xt event dispatching
- *    mechanism to process X events.  In fact, this is the only place these
- *    events are processed, as there is no XtAppMainLoop in the program.
- */
-
-rfbBool
-ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
-{
-#undef DEBUG_READ_EXACT
-#ifdef DEBUG_READ_EXACT
-	char* oout=out;
-	int nn=n;
-	rfbClientLog("ReadFromRFBServer %d bytes\n",n);
-#endif
-  if (client->serverPort==-1) {
-    /* vncrec playing */
-    rfbVNCRec* rec = client->vncRec;
-    struct timeval tv;
-
-    if (rec->readTimestamp) {
-      rec->readTimestamp = FALSE;
-      if (!fread(&tv,sizeof(struct timeval),1,rec->file))
-        return FALSE;
-
-      tv.tv_sec = rfbClientSwap32IfLE (tv.tv_sec);
-      tv.tv_usec = rfbClientSwap32IfLE (tv.tv_usec);
-
-      if (rec->tv.tv_sec!=0 && !rec->doNotSleep) {
-        struct timeval diff;
-        diff.tv_sec = tv.tv_sec - rec->tv.tv_sec;
-        diff.tv_usec = tv.tv_usec - rec->tv.tv_usec;
-        if(diff.tv_usec<0) {
-	  diff.tv_sec--;
-	  diff.tv_usec+=1000000;
-        }
-#ifndef __MINGW32__
-        sleep (diff.tv_sec);
-        usleep (diff.tv_usec);
-#else
-	Sleep (diff.tv_sec * 1000 + diff.tv_usec/1000);
-#endif
-      }
-
-      rec->tv=tv;
-    }
-    
-    return (fread(out,1,n,rec->file) != n ? FALSE : TRUE);
-  }
-  
-  if (n <= client->buffered) {
-    memcpy(out, client->bufoutptr, n);
-    client->bufoutptr += n;
-    client->buffered -= n;
-#ifdef DEBUG_READ_EXACT
-    goto hexdump;
-#endif
-    return TRUE;
-  }
-
-  memcpy(out, client->bufoutptr, client->buffered);
-
-  out += client->buffered;
-  n -= client->buffered;
-
-  client->bufoutptr = client->buf;
-  client->buffered = 0;
-
-  if (n <= RFB_BUF_SIZE) {
-
-    while (client->buffered < n) {
-      int i;
-      if (client->tlsSession) {
-        i = ReadFromTLS(client, client->buf + client->buffered, RFB_BUF_SIZE - client->buffered);
-      } else {
-        i = read(client->sock, client->buf + client->buffered, RFB_BUF_SIZE - client->buffered);
-      }
-      if (i <= 0) {
-	if (i < 0) {
-#ifdef WIN32
-	  errno=WSAGetLastError();
-#endif
-	  if (errno == EWOULDBLOCK || errno == EAGAIN) {
-	    /* TODO:
-	       ProcessXtEvents();
-	    */
-	    WaitForMessage(client, 100000);
-	    i = 0;
-	  } else {
-	    rfbClientErr("read (%d: %s)\n",errno,strerror(errno));
-	    return FALSE;
-	  }
-	} else {
-	  if (errorMessageOnReadFailure) {
-	    rfbClientLog("VNC server closed connection\n");
-	  }
-	  return FALSE;
-	}
-      }
-      client->buffered += i;
-    }
-
-    memcpy(out, client->bufoutptr, n);
-    client->bufoutptr += n;
-    client->buffered -= n;
-
-  } else {
-
-    while (n > 0) {
-      int i;
-      if (client->tlsSession) {
-        i = ReadFromTLS(client, out, n);
-      } else {
-        i = read(client->sock, out, n);
-      }
-
-      if (i <= 0) {
-	if (i < 0) {
-#ifdef WIN32
-	  errno=WSAGetLastError();
-#endif
-	  if (errno == EWOULDBLOCK || errno == EAGAIN) {
-	    /* TODO:
-	       ProcessXtEvents();
-	    */
-	    WaitForMessage(client, 100000);
-	    i = 0;
-	  } else {
-	    rfbClientErr("read (%s)\n",strerror(errno));
-	    return FALSE;
-	  }
-	} else {
-	  if (errorMessageOnReadFailure) {
-	    rfbClientLog("VNC server closed connection\n");
-	  }
-	  return FALSE;
-	}
-      }
-      out += i;
-      n -= i;
-    }
-  }
-
-#ifdef DEBUG_READ_EXACT
-hexdump:
-  { int ii;
-    for(ii=0;ii<nn;ii++)
-      fprintf(stderr,"%02x ",(unsigned char)oout[ii]);
-    fprintf(stderr,"\n");
-  }
-#endif
-
-  return TRUE;
-}
-
-
-/*
- * Write an exact number of bytes, and don't return until you've sent them.
- */
-
-rfbBool
-WriteToRFBServer(rfbClient* client, const char *buf, int n)
-{
-  fd_set fds;
-  int i = 0;
-  int j;
-
-  if (client->serverPort==-1)
-    return TRUE; /* vncrec playing */
-
-  if (client->tlsSession) {
-    /* WriteToTLS() will guarantee either everything is written, or error/eof returns */
-    i = WriteToTLS(client, buf, n);
-    if (i <= 0) return FALSE;
-
-    return TRUE;
-  }
-
-  while (i < n) {
-    j = write(client->sock, buf + i, (n - i));
-    if (j <= 0) {
-      if (j < 0) {
-#ifdef WIN32
-	 errno=WSAGetLastError();
-#endif
-	if (errno == EWOULDBLOCK ||
-#ifdef LIBVNCSERVER_ENOENT_WORKAROUND
-		errno == ENOENT ||
-#endif
-		errno == EAGAIN) {
-	  FD_ZERO(&fds);
-	  FD_SET(client->sock,&fds);
-
-	  if (select(client->sock+1, NULL, &fds, NULL, NULL) <= 0) {
-	    rfbClientErr("select\n");
-	    return FALSE;
-	  }
-	  j = 0;
-	} else {
-	  rfbClientErr("write\n");
-	  return FALSE;
-	}
-      } else {
-	rfbClientLog("write failed\n");
-	return FALSE;
-      }
-    }
-    i += j;
-  }
-  return TRUE;
-}
-
-
-
-static int initSockets() {
-#ifdef WIN32
-  WSADATA trash;
-  static rfbBool WSAinitted=FALSE;
-  if(!WSAinitted) {
-    int i=WSAStartup(MAKEWORD(2,0),&trash);
-    if(i!=0) {
-      rfbClientErr("Couldn't init Windows Sockets\n");
-      return 0;
-    }
-    WSAinitted=TRUE;
-  }
-#endif
-  return 1;
-}
-
-/*
- * ConnectToTcpAddr connects to the given TCP port.
- */
-
-int
-ConnectClientToTcpAddr(unsigned int host, int port)
-{
-  int sock;
-  struct sockaddr_in addr;
-  int one = 1;
-
-  if (!initSockets())
-	  return -1;
-
-  addr.sin_family = AF_INET;
-  addr.sin_port = htons(port);
-  addr.sin_addr.s_addr = host;
-
-  sock = socket(AF_INET, SOCK_STREAM, 0);
-  if (sock < 0) {
-#ifdef WIN32
-    errno=WSAGetLastError();
-#endif
-    rfbClientErr("ConnectToTcpAddr: socket (%s)\n",strerror(errno));
-    return -1;
-  }
-
-  if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-    /*rfbClientErr("ConnectToTcpAddr: connect\n");*/
-    close(sock);
-    return -1;
-  }
-
-  if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-		 (char *)&one, sizeof(one)) < 0) {
-    rfbClientErr("ConnectToTcpAddr: setsockopt\n");
-    close(sock);
-    return -1;
-  }
-
-  return sock;
-}
-
-int
-ConnectClientToTcpAddr6(const char *hostname, int port)
-{
-#ifdef LIBVNCSERVER_IPv6
-  int sock;
-  int n;
-  struct addrinfo hints, *res, *ressave;
-  char port_s[10];
-  int one = 1;
-
-  if (!initSockets())
-	  return -1;
-
-  snprintf(port_s, 10, "%d", port);
-  memset(&hints, 0, sizeof(struct addrinfo));
-  hints.ai_family = AF_UNSPEC;
-  hints.ai_socktype = SOCK_STREAM;
-  if ((n = getaddrinfo(hostname, port_s, &hints, &res)))
-  {
-    rfbClientErr("ConnectClientToTcpAddr6: getaddrinfo (%s)\n", gai_strerror(n));
-    return -1;
-  }
-
-  ressave = res;
-  sock = -1;
-  while (res)
-  {
-    sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
-    if (sock >= 0)
-    {
-      if (connect(sock, res->ai_addr, res->ai_addrlen) == 0)
-        break;
-      close(sock);
-      sock = -1;
-    }
-    res = res->ai_next;
-  }
-  freeaddrinfo(ressave);
-
-  if (sock == -1)
-  {
-    rfbClientErr("ConnectClientToTcpAddr6: connect\n");
-    return -1;
-  }
-
-  if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-		 (char *)&one, sizeof(one)) < 0) {
-    rfbClientErr("ConnectToTcpAddr: setsockopt\n");
-    close(sock);
-    return -1;
-  }
-
-  return sock;
-
-#else
-
-  rfbClientErr("ConnectClientToTcpAddr6: IPv6 disabled\n");
-  return -1;
-
-#endif
-}
-
-int
-ConnectClientToUnixSock(const char *sockFile)
-{
-#ifdef WIN32
-  rfbClientErr("Windows doesn't support UNIX sockets\n");
-  return -1;
-#else
-  int sock;
-  struct sockaddr_un addr;
-  addr.sun_family = AF_UNIX;
-  strcpy(addr.sun_path, sockFile);
-
-  sock = socket(AF_UNIX, SOCK_STREAM, 0);
-  if (sock < 0) {
-    rfbClientErr("ConnectToUnixSock: socket (%s)\n",strerror(errno));
-    return -1;
-  }
-
-  if (connect(sock, (struct sockaddr *)&addr, sizeof(addr.sun_family) + strlen(addr.sun_path)) < 0) {
-    rfbClientErr("ConnectToUnixSock: connect\n");
-    close(sock);
-    return -1;
-  }
-
-  return sock;
-#endif
-}
-
-
-
-/*
- * FindFreeTcpPort tries to find unused TCP port in the range
- * (TUNNEL_PORT_OFFSET, TUNNEL_PORT_OFFSET + 99]. Returns 0 on failure.
- */
-
-int
-FindFreeTcpPort(void)
-{
-  int sock, port;
-  struct sockaddr_in addr;
-
-  addr.sin_family = AF_INET;
-  addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-  if (!initSockets())
-    return -1;
-
-  sock = socket(AF_INET, SOCK_STREAM, 0);
-  if (sock < 0) {
-    rfbClientErr(": FindFreeTcpPort: socket\n");
-    return 0;
-  }
-
-  for (port = TUNNEL_PORT_OFFSET + 99; port > TUNNEL_PORT_OFFSET; port--) {
-    addr.sin_port = htons((unsigned short)port);
-    if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
-      close(sock);
-      return port;
-    }
-  }
-
-  close(sock);
-  return 0;
-}
-
-
-/*
- * ListenAtTcpPort starts listening at the given TCP port.
- */
-
-int
-ListenAtTcpPort(int port)
-{
-  return ListenAtTcpPortAndAddress(port, NULL);
-}
-
-
-
-/*
- * ListenAtTcpPortAndAddress starts listening at the given TCP port on
- * the given IP address
- */
-
-int
-ListenAtTcpPortAndAddress(int port, const char *address)
-{
-  int sock;
-  int one = 1;
-#ifndef LIBVNCSERVER_IPv6
-  struct sockaddr_in addr;
-
-  addr.sin_family = AF_INET;
-  addr.sin_port = htons(port);
-  if (address) {
-    addr.sin_addr.s_addr = inet_addr(address);
-  } else {
-    addr.sin_addr.s_addr = htonl(INADDR_ANY);
-  }
-
-  if (!initSockets())
-    return -1;
-
-  sock = socket(AF_INET, SOCK_STREAM, 0);
-  if (sock < 0) {
-    rfbClientErr("ListenAtTcpPort: socket\n");
-    return -1;
-  }
-
-  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		 (const char *)&one, sizeof(one)) < 0) {
-    rfbClientErr("ListenAtTcpPort: setsockopt\n");
-    close(sock);
-    return -1;
-  }
-
-  if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-    rfbClientErr("ListenAtTcpPort: bind\n");
-    close(sock);
-    return -1;
-  }
-
-#else
-  int rv;
-  struct addrinfo hints, *servinfo, *p;
-  char port_str[8];
-
-  snprintf(port_str, 8, "%d", port);
-
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_UNSPEC;
-  hints.ai_socktype = SOCK_STREAM;
-  hints.ai_flags = AI_PASSIVE; /* fill in wildcard address if address == NULL */
-
-  if (!initSockets())
-    return -1;
-
-  if ((rv = getaddrinfo(address, port_str, &hints, &servinfo)) != 0) {
-    rfbClientErr("ListenAtTcpPortAndAddress: error in getaddrinfo: %s\n", gai_strerror(rv));
-    return -1;
-  }
-
-  /* loop through all the results and bind to the first we can */
-  for(p = servinfo; p != NULL; p = p->ai_next) {
-    if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) < 0) {
-      continue;
-    }
-
-#ifdef IPV6_V6ONLY
-    /* we have seperate IPv4 and IPv6 sockets since some OS's do not support dual binding */
-    if (p->ai_family == AF_INET6 && setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&one, sizeof(one)) < 0) {
-      rfbClientErr("ListenAtTcpPortAndAddress: error in setsockopt IPV6_V6ONLY: %s\n", strerror(errno));
-      close(sock);
-      freeaddrinfo(servinfo);
-      return -1;
-    }
-#endif
-
-    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)) < 0) {
-      rfbClientErr("ListenAtTcpPortAndAddress: error in setsockopt SO_REUSEADDR: %s\n", strerror(errno));
-      close(sock);
-      freeaddrinfo(servinfo);
-      return -1;
-    }
-
-    if (bind(sock, p->ai_addr, p->ai_addrlen) < 0) {
-      close(sock);
-      continue;
-    }
-
-    break;
-  }
-
-  if (p == NULL)  {
-    rfbClientErr("ListenAtTcpPortAndAddress: error in bind: %s\n", strerror(errno));
-    return -1;
-  }
-
-  /* all done with this structure now */
-  freeaddrinfo(servinfo);
-#endif
-
-  if (listen(sock, 5) < 0) {
-    rfbClientErr("ListenAtTcpPort: listen\n");
-    close(sock);
-    return -1;
-  }
-
-  return sock;
-}
-
-
-/*
- * AcceptTcpConnection accepts a TCP connection.
- */
-
-int
-AcceptTcpConnection(int listenSock)
-{
-  int sock;
-  struct sockaddr_in addr;
-  socklen_t addrlen = sizeof(addr);
-  int one = 1;
-
-  sock = accept(listenSock, (struct sockaddr *) &addr, &addrlen);
-  if (sock < 0) {
-    rfbClientErr("AcceptTcpConnection: accept\n");
-    return -1;
-  }
-
-  if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-		 (char *)&one, sizeof(one)) < 0) {
-    rfbClientErr("AcceptTcpConnection: setsockopt\n");
-    close(sock);
-    return -1;
-  }
-
-  return sock;
-}
-
-
-/*
- * SetNonBlocking sets a socket into non-blocking mode.
- */
-
-rfbBool
-SetNonBlocking(int sock)
-{
-#ifdef WIN32
-  unsigned long block=1;
-  if(ioctlsocket(sock, FIONBIO, &block) == SOCKET_ERROR) {
-    errno=WSAGetLastError();
-#else
-  int flags = fcntl(sock, F_GETFL);
-  if(flags < 0 || fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0) {
-#endif
-    rfbClientErr("Setting socket to non-blocking failed: %s\n",strerror(errno));
-    return FALSE;
-  }
-  return TRUE;
-}
-
-
-
-/*
- * SetDSCP sets a socket's IP QoS parameters aka Differentiated Services Code Point field
- */
-
-rfbBool
-SetDSCP(int sock, int dscp)
-{
-#ifdef WIN32
-  rfbClientErr("Setting of QoS IP DSCP not implemented for Windows\n");
-  return TRUE;
-#else
-  int level, cmd;
-  struct sockaddr addr;
-  socklen_t addrlen = sizeof(addr);
-
-  if(getsockname(sock, &addr, &addrlen) != 0) {
-    rfbClientErr("Setting socket QoS failed while getting socket address: %s\n",strerror(errno));
-    return FALSE;
-  }
-
-  switch(addr.sa_family)
-    {
-#if defined LIBVNCSERVER_IPv6 && defined IPV6_TCLASS
-    case AF_INET6:
-      level = IPPROTO_IPV6;
-      cmd = IPV6_TCLASS;
-      break;
-#endif
-    case AF_INET:
-      level = IPPROTO_IP;
-      cmd = IP_TOS;
-      break;
-    default:
-      rfbClientErr("Setting socket QoS failed: Not bound to IP address");
-      return FALSE;
-    }
-
-  if(setsockopt(sock, level, cmd, (void*)&dscp, sizeof(dscp)) != 0) {
-    rfbClientErr("Setting socket QoS failed: %s\n", strerror(errno));
-    return FALSE;
-  }
-
-  return TRUE;
-#endif
-}
-
-
-
-/*
- * StringToIPAddr - convert a host string to an IP address.
- */
-
-rfbBool
-StringToIPAddr(const char *str, unsigned int *addr)
-{
-  struct hostent *hp;
-
-  if (strcmp(str,"") == 0) {
-    *addr = htonl(INADDR_LOOPBACK); /* local */
-    return TRUE;
-  }
-
-  *addr = inet_addr(str);
-
-  if (*addr != -1)
-    return TRUE;
-
-  if (!initSockets())
-	  return -1;
-
-  hp = gethostbyname(str);
-
-  if (hp) {
-    *addr = *(unsigned int *)hp->h_addr;
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-
-/*
- * Test if the other end of a socket is on the same machine.
- */
-
-rfbBool
-SameMachine(int sock)
-{
-  struct sockaddr_in peeraddr, myaddr;
-  socklen_t addrlen = sizeof(struct sockaddr_in);
-
-  getpeername(sock, (struct sockaddr *)&peeraddr, &addrlen);
-  getsockname(sock, (struct sockaddr *)&myaddr, &addrlen);
-
-  return (peeraddr.sin_addr.s_addr == myaddr.sin_addr.s_addr);
-}
-
-
-/*
- * Print out the contents of a packet for debugging.
- */
-
-void
-PrintInHex(char *buf, int len)
-{
-  int i, j;
-  char c, str[17];
-
-  str[16] = 0;
-
-  rfbClientLog("ReadExact: ");
-
-  for (i = 0; i < len; i++)
-    {
-      if ((i % 16 == 0) && (i != 0)) {
-	rfbClientLog("           ");
-      }
-      c = buf[i];
-      str[i % 16] = (((c > 31) && (c < 127)) ? c : '.');
-      rfbClientLog("%02x ",(unsigned char)c);
-      if ((i % 4) == 3)
-	rfbClientLog(" ");
-      if ((i % 16) == 15)
-	{
-	  rfbClientLog("%s\n",str);
-	}
-    }
-  if ((i % 16) != 0)
-    {
-      for (j = i % 16; j < 16; j++)
-	{
-	  rfbClientLog("   ");
-	  if ((j % 4) == 3) rfbClientLog(" ");
-	}
-      str[i % 16] = 0;
-      rfbClientLog("%s\n",str);
-    }
-
-  fflush(stderr);
-}
-
-int WaitForMessage(rfbClient* client,unsigned int usecs)
-{
-  fd_set fds;
-  struct timeval timeout;
-  int num;
-
-  if (client->serverPort==-1)
-    /* playing back vncrec file */
-    return 1;
-  
-  timeout.tv_sec=(usecs/1000000);
-  timeout.tv_usec=(usecs%1000000);
-
-  FD_ZERO(&fds);
-  FD_SET(client->sock,&fds);
-
-  num=select(client->sock+1, &fds, NULL, NULL, &timeout);
-  if(num<0) {
-#ifdef WIN32
-    errno=WSAGetLastError();
-#endif
-    rfbClientLog("Waiting for message failed: %d (%s)\n",errno,strerror(errno));
-  }
-
-  return num;
-}
-
-
diff --git a/ica/x11/libvncclient/tight.c b/ica/x11/libvncclient/tight.c
deleted file mode 100644
index 2f9fbab..0000000
--- a/ica/x11/libvncclient/tight.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/*
- *  Copyright (C) 2000, 2001 Const Kaplinsky.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-
-/*
- * tight.c - handle ``tight'' encoding.
- *
- * This file shouldn't be compiled directly. It is included multiple
- * times by rfbproto.c, each time with a different definition of the
- * macro BPP. For each value of BPP, this file defines a function
- * which handles a tight-encoded rectangle with BPP bits per pixel.
- *
- */
-
-#define TIGHT_MIN_TO_COMPRESS 12
-
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-#define filterPtrBPP CONCAT2E(filterPtr,BPP)
-
-#define HandleTightBPP CONCAT2E(HandleTight,BPP)
-#define InitFilterCopyBPP CONCAT2E(InitFilterCopy,BPP)
-#define InitFilterPaletteBPP CONCAT2E(InitFilterPalette,BPP)
-#define InitFilterGradientBPP CONCAT2E(InitFilterGradient,BPP)
-#define FilterCopyBPP CONCAT2E(FilterCopy,BPP)
-#define FilterPaletteBPP CONCAT2E(FilterPalette,BPP)
-#define FilterGradientBPP CONCAT2E(FilterGradient,BPP)
-
-#if BPP != 8
-#define DecompressJpegRectBPP CONCAT2E(DecompressJpegRect,BPP)
-#endif
-
-#ifndef RGB_TO_PIXEL
-
-#define RGB_TO_PIXEL(bpp,r,g,b)						\
-  (((CARD##bpp)(r) & client->format.redMax) << client->format.redShift |		\
-   ((CARD##bpp)(g) & client->format.greenMax) << client->format.greenShift |	\
-   ((CARD##bpp)(b) & client->format.blueMax) << client->format.blueShift)
-
-#define RGB24_TO_PIXEL(bpp,r,g,b)                                       \
-   ((((CARD##bpp)(r) & 0xFF) * client->format.redMax + 127) / 255             \
-    << client->format.redShift |                                              \
-    (((CARD##bpp)(g) & 0xFF) * client->format.greenMax + 127) / 255           \
-    << client->format.greenShift |                                            \
-    (((CARD##bpp)(b) & 0xFF) * client->format.blueMax + 127) / 255            \
-    << client->format.blueShift)
-
-#define RGB24_TO_PIXEL32(r,g,b)						\
-  (((uint32_t)(r) & 0xFF) << client->format.redShift |				\
-   ((uint32_t)(g) & 0xFF) << client->format.greenShift |			\
-   ((uint32_t)(b) & 0xFF) << client->format.blueShift)
-
-#endif
-
-/* Type declarations */
-
-typedef void (*filterPtrBPP)(rfbClient* client, int, CARDBPP *);
-
-/* Prototypes */
-
-static int InitFilterCopyBPP (rfbClient* client, int rw, int rh);
-static int InitFilterPaletteBPP (rfbClient* client, int rw, int rh);
-static int InitFilterGradientBPP (rfbClient* client, int rw, int rh);
-static void FilterCopyBPP (rfbClient* client, int numRows, CARDBPP *destBuffer);
-static void FilterPaletteBPP (rfbClient* client, int numRows, CARDBPP *destBuffer);
-static void FilterGradientBPP (rfbClient* client, int numRows, CARDBPP *destBuffer);
-
-#if BPP != 8
-static rfbBool DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h);
-#endif
-
-/* Definitions */
-
-static rfbBool
-HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-  CARDBPP fill_colour;
-  uint8_t comp_ctl;
-  uint8_t filter_id;
-  filterPtrBPP filterFn;
-  z_streamp zs;
-  char *buffer2;
-  int err, stream_id, compressedLen, bitsPixel;
-  int bufferSize, rowSize, numRows, portionLen, rowsProcessed, extraBytes;
-
-  if (!ReadFromRFBServer(client, (char *)&comp_ctl, 1))
-    return FALSE;
-
-  /* Flush zlib streams if we are told by the server to do so. */
-  for (stream_id = 0; stream_id < 4; stream_id++) {
-    if ((comp_ctl & 1) && client->zlibStreamActive[stream_id]) {
-      if (inflateEnd (&client->zlibStream[stream_id]) != Z_OK &&
-	  client->zlibStream[stream_id].msg != NULL)
-	rfbClientLog("inflateEnd: %s\n", client->zlibStream[stream_id].msg);
-      client->zlibStreamActive[stream_id] = FALSE;
-    }
-    comp_ctl >>= 1;
-  }
-
-  /* Handle solid rectangles. */
-  if (comp_ctl == rfbTightFill) {
-#if BPP == 32
-    if (client->format.depth == 24 && client->format.redMax == 0xFF &&
-	client->format.greenMax == 0xFF && client->format.blueMax == 0xFF) {
-      if (!ReadFromRFBServer(client, client->buffer, 3))
-	return FALSE;
-      fill_colour = RGB24_TO_PIXEL32(client->buffer[0], client->buffer[1], client->buffer[2]);
-    } else {
-      if (!ReadFromRFBServer(client, (char*)&fill_colour, sizeof(fill_colour)))
-	return FALSE;
-    }
-#else
-    if (!ReadFromRFBServer(client, (char*)&fill_colour, sizeof(fill_colour)))
-	return FALSE;
-#endif
-
-    FillRectangle(client, rx, ry, rw, rh, fill_colour);
-
-    return TRUE;
-  }
-
-#if BPP == 8
-  if (comp_ctl == rfbTightJpeg) {
-    rfbClientLog("Tight encoding: JPEG is not supported in 8 bpp mode.\n");
-    return FALSE;
-  }
-#else
-  if (comp_ctl == rfbTightJpeg) {
-    return DecompressJpegRectBPP(client, rx, ry, rw, rh);
-  }
-#endif
-
-  /* Quit on unsupported subencoding value. */
-  if (comp_ctl > rfbTightMaxSubencoding) {
-    rfbClientLog("Tight encoding: bad subencoding value received.\n");
-    return FALSE;
-  }
-
-  /*
-   * Here primary compression mode handling begins.
-   * Data was processed with optional filter + zlib compression.
-   */
-
-  /* First, we should identify a filter to use. */
-  if ((comp_ctl & rfbTightExplicitFilter) != 0) {
-    if (!ReadFromRFBServer(client, (char*)&filter_id, 1))
-      return FALSE;
-
-    switch (filter_id) {
-    case rfbTightFilterCopy:
-      filterFn = FilterCopyBPP;
-      bitsPixel = InitFilterCopyBPP(client, rw, rh);
-      break;
-    case rfbTightFilterPalette:
-      filterFn = FilterPaletteBPP;
-      bitsPixel = InitFilterPaletteBPP(client, rw, rh);
-      break;
-    case rfbTightFilterGradient:
-      filterFn = FilterGradientBPP;
-      bitsPixel = InitFilterGradientBPP(client, rw, rh);
-      break;
-    default:
-      rfbClientLog("Tight encoding: unknown filter code received.\n");
-      return FALSE;
-    }
-  } else {
-    filterFn = FilterCopyBPP;
-    bitsPixel = InitFilterCopyBPP(client, rw, rh);
-  }
-  if (bitsPixel == 0) {
-    rfbClientLog("Tight encoding: error receiving palette.\n");
-    return FALSE;
-  }
-
-  /* Determine if the data should be decompressed or just copied. */
-  rowSize = (rw * bitsPixel + 7) / 8;
-  if (rh * rowSize < TIGHT_MIN_TO_COMPRESS) {
-    if (!ReadFromRFBServer(client, (char*)client->buffer, rh * rowSize))
-      return FALSE;
-
-    buffer2 = &client->buffer[TIGHT_MIN_TO_COMPRESS * 4];
-    filterFn(client, rh, (CARDBPP *)buffer2);
-
-    CopyRectangle(client, (uint8_t *)buffer2, rx, ry, rw, rh);
-
-    return TRUE;
-  }
-
-  /* Read the length (1..3 bytes) of compressed data following. */
-  compressedLen = (int)ReadCompactLen(client);
-  if (compressedLen <= 0) {
-    rfbClientLog("Incorrect data received from the server.\n");
-    return FALSE;
-  }
-
-  /* Now let's initialize compression stream if needed. */
-  stream_id = comp_ctl & 0x03;
-  zs = &client->zlibStream[stream_id];
-  if (!client->zlibStreamActive[stream_id]) {
-    zs->zalloc = Z_NULL;
-    zs->zfree = Z_NULL;
-    zs->opaque = Z_NULL;
-    err = inflateInit(zs);
-    if (err != Z_OK) {
-      if (zs->msg != NULL)
-	rfbClientLog("InflateInit error: %s.\n", zs->msg);
-      return FALSE;
-    }
-    client->zlibStreamActive[stream_id] = TRUE;
-  }
-
-  /* Read, decode and draw actual pixel data in a loop. */
-
-  bufferSize = RFB_BUFFER_SIZE * bitsPixel / (bitsPixel + BPP) & 0xFFFFFFFC;
-  buffer2 = &client->buffer[bufferSize];
-  if (rowSize > bufferSize) {
-    /* Should be impossible when RFB_BUFFER_SIZE >= 16384 */
-    rfbClientLog("Internal error: incorrect buffer size.\n");
-    return FALSE;
-  }
-
-  rowsProcessed = 0;
-  extraBytes = 0;
-
-  while (compressedLen > 0) {
-    if (compressedLen > ZLIB_BUFFER_SIZE)
-      portionLen = ZLIB_BUFFER_SIZE;
-    else
-      portionLen = compressedLen;
-
-    if (!ReadFromRFBServer(client, (char*)client->zlib_buffer, portionLen))
-      return FALSE;
-
-    compressedLen -= portionLen;
-
-    zs->next_in = (Bytef *)client->zlib_buffer;
-    zs->avail_in = portionLen;
-
-    do {
-      zs->next_out = (Bytef *)&client->buffer[extraBytes];
-      zs->avail_out = bufferSize - extraBytes;
-
-      err = inflate(zs, Z_SYNC_FLUSH);
-      if (err == Z_BUF_ERROR)   /* Input exhausted -- no problem. */
-	break;
-      if (err != Z_OK && err != Z_STREAM_END) {
-	if (zs->msg != NULL) {
-	  rfbClientLog("Inflate error: %s.\n", zs->msg);
-	} else {
-	  rfbClientLog("Inflate error: %d.\n", err);
-	}
-	return FALSE;
-      }
-
-      numRows = (bufferSize - zs->avail_out) / rowSize;
-
-      filterFn(client, numRows, (CARDBPP *)buffer2);
-
-      extraBytes = bufferSize - zs->avail_out - numRows * rowSize;
-      if (extraBytes > 0)
-	memcpy(client->buffer, &client->buffer[numRows * rowSize], extraBytes);
-
-      CopyRectangle(client, (uint8_t *)buffer2, rx, ry+rowsProcessed, rw, numRows);
-
-      rowsProcessed += numRows;
-    }
-    while (zs->avail_out == 0);
-  }
-
-  if (rowsProcessed != rh) {
-    rfbClientLog("Incorrect number of scan lines after decompression.\n");
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/*----------------------------------------------------------------------------
- *
- * Filter stuff.
- *
- */
-
-static int
-InitFilterCopyBPP (rfbClient* client, int rw, int rh)
-{
-  client->rectWidth = rw;
-
-#if BPP == 32
-  if (client->format.depth == 24 && client->format.redMax == 0xFF &&
-      client->format.greenMax == 0xFF && client->format.blueMax == 0xFF) {
-    client->cutZeros = TRUE;
-    return 24;
-  } else {
-    client->cutZeros = FALSE;
-  }
-#endif
-
-  return BPP;
-}
-
-static void
-FilterCopyBPP (rfbClient* client, int numRows, CARDBPP *dst)
-{
-
-#if BPP == 32
-  int x, y;
-
-  if (client->cutZeros) {
-    for (y = 0; y < numRows; y++) {
-      for (x = 0; x < client->rectWidth; x++) {
-	dst[y*client->rectWidth+x] =
-	  RGB24_TO_PIXEL32(client->buffer[(y*client->rectWidth+x)*3],
-			   client->buffer[(y*client->rectWidth+x)*3+1],
-			   client->buffer[(y*client->rectWidth+x)*3+2]);
-      }
-    }
-    return;
-  }
-#endif
-
-  memcpy (dst, client->buffer, numRows * client->rectWidth * (BPP / 8));
-}
-
-static int
-InitFilterGradientBPP (rfbClient* client, int rw, int rh)
-{
-  int bits;
-
-  bits = InitFilterCopyBPP(client, rw, rh);
-  if (client->cutZeros)
-    memset(client->tightPrevRow, 0, rw * 3);
-  else
-    memset(client->tightPrevRow, 0, rw * 3 * sizeof(uint16_t));
-
-  return bits;
-}
-
-#if BPP == 32
-
-static void
-FilterGradient24 (rfbClient* client, int numRows, uint32_t *dst)
-{
-  int x, y, c;
-  uint8_t thisRow[2048*3];
-  uint8_t pix[3];
-  int est[3];
-
-  for (y = 0; y < numRows; y++) {
-
-    /* First pixel in a row */
-    for (c = 0; c < 3; c++) {
-      pix[c] = client->tightPrevRow[c] + client->buffer[y*client->rectWidth*3+c];
-      thisRow[c] = pix[c];
-    }
-    dst[y*client->rectWidth] = RGB24_TO_PIXEL32(pix[0], pix[1], pix[2]);
-
-    /* Remaining pixels of a row */
-    for (x = 1; x < client->rectWidth; x++) {
-      for (c = 0; c < 3; c++) {
-	est[c] = (int)client->tightPrevRow[x*3+c] + (int)pix[c] -
-		 (int)client->tightPrevRow[(x-1)*3+c];
-	if (est[c] > 0xFF) {
-	  est[c] = 0xFF;
-	} else if (est[c] < 0x00) {
-	  est[c] = 0x00;
-	}
-	pix[c] = (uint8_t)est[c] + client->buffer[(y*client->rectWidth+x)*3+c];
-	thisRow[x*3+c] = pix[c];
-      }
-      dst[y*client->rectWidth+x] = RGB24_TO_PIXEL32(pix[0], pix[1], pix[2]);
-    }
-
-    memcpy(client->tightPrevRow, thisRow, client->rectWidth * 3);
-  }
-}
-
-#endif
-
-static void
-FilterGradientBPP (rfbClient* client, int numRows, CARDBPP *dst)
-{
-  int x, y, c;
-  CARDBPP *src = (CARDBPP *)client->buffer;
-  uint16_t *thatRow = (uint16_t *)client->tightPrevRow;
-  uint16_t thisRow[2048*3];
-  uint16_t pix[3];
-  uint16_t max[3];
-  int shift[3];
-  int est[3];
-
-#if BPP == 32
-  if (client->cutZeros) {
-    FilterGradient24(client, numRows, dst);
-    return;
-  }
-#endif
-
-  max[0] = client->format.redMax;
-  max[1] = client->format.greenMax;
-  max[2] = client->format.blueMax;
-
-  shift[0] = client->format.redShift;
-  shift[1] = client->format.greenShift;
-  shift[2] = client->format.blueShift;
-
-  for (y = 0; y < numRows; y++) {
-
-    /* First pixel in a row */
-    for (c = 0; c < 3; c++) {
-      pix[c] = (uint16_t)(((src[y*client->rectWidth] >> shift[c]) + thatRow[c]) & max[c]);
-      thisRow[c] = pix[c];
-    }
-    dst[y*client->rectWidth] = RGB_TO_PIXEL(BPP, pix[0], pix[1], pix[2]);
-
-    /* Remaining pixels of a row */
-    for (x = 1; x < client->rectWidth; x++) {
-      for (c = 0; c < 3; c++) {
-	est[c] = (int)thatRow[x*3+c] + (int)pix[c] - (int)thatRow[(x-1)*3+c];
-	if (est[c] > (int)max[c]) {
-	  est[c] = (int)max[c];
-	} else if (est[c] < 0) {
-	  est[c] = 0;
-	}
-	pix[c] = (uint16_t)(((src[y*client->rectWidth+x] >> shift[c]) + est[c]) & max[c]);
-	thisRow[x*3+c] = pix[c];
-      }
-      dst[y*client->rectWidth+x] = RGB_TO_PIXEL(BPP, pix[0], pix[1], pix[2]);
-    }
-    memcpy(thatRow, thisRow, client->rectWidth * 3 * sizeof(uint16_t));
-  }
-}
-
-static int
-InitFilterPaletteBPP (rfbClient* client, int rw, int rh)
-{
-  uint8_t numColors;
-#if BPP == 32
-  int i;
-  CARDBPP *palette = (CARDBPP *)client->tightPalette;
-#endif
-
-  client->rectWidth = rw;
-
-  if (!ReadFromRFBServer(client, (char*)&numColors, 1))
-    return 0;
-
-  client->rectColors = (int)numColors;
-  if (++client->rectColors < 2)
-    return 0;
-
-#if BPP == 32
-  if (client->format.depth == 24 && client->format.redMax == 0xFF &&
-      client->format.greenMax == 0xFF && client->format.blueMax == 0xFF) {
-    if (!ReadFromRFBServer(client, (char*)&client->tightPalette, client->rectColors * 3))
-      return 0;
-    for (i = client->rectColors - 1; i >= 0; i--) {
-      palette[i] = RGB24_TO_PIXEL32(client->tightPalette[i*3],
-				    client->tightPalette[i*3+1],
-				    client->tightPalette[i*3+2]);
-    }
-    return (client->rectColors == 2) ? 1 : 8;
-  }
-#endif
-
-  if (!ReadFromRFBServer(client, (char*)&client->tightPalette, client->rectColors * (BPP / 8)))
-    return 0;
-
-  return (client->rectColors == 2) ? 1 : 8;
-}
-
-static void
-FilterPaletteBPP (rfbClient* client, int numRows, CARDBPP *dst)
-{
-  int x, y, b, w;
-  uint8_t *src = (uint8_t *)client->buffer;
-  CARDBPP *palette = (CARDBPP *)client->tightPalette;
-
-  if (client->rectColors == 2) {
-    w = (client->rectWidth + 7) / 8;
-    for (y = 0; y < numRows; y++) {
-      for (x = 0; x < client->rectWidth / 8; x++) {
-	for (b = 7; b >= 0; b--)
-	  dst[y*client->rectWidth+x*8+7-b] = palette[src[y*w+x] >> b & 1];
-      }
-      for (b = 7; b >= 8 - client->rectWidth % 8; b--) {
-	dst[y*client->rectWidth+x*8+7-b] = palette[src[y*w+x] >> b & 1];
-      }
-    }
-  } else {
-    for (y = 0; y < numRows; y++)
-      for (x = 0; x < client->rectWidth; x++)
-	dst[y*client->rectWidth+x] = palette[(int)src[y*client->rectWidth+x]];
-  }
-}
-
-#if BPP != 8
-
-/*----------------------------------------------------------------------------
- *
- * JPEG decompression.
- *
- */
-
-static rfbBool
-DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h)
-{
-  struct jpeg_decompress_struct cinfo;
-  struct jpeg_error_mgr jerr;
-  int compressedLen;
-  uint8_t *compressedData;
-  CARDBPP *pixelPtr;
-  JSAMPROW rowPointer[1];
-  int dx, dy;
-
-  compressedLen = (int)ReadCompactLen(client);
-  if (compressedLen <= 0) {
-    rfbClientLog("Incorrect data received from the server.\n");
-    return FALSE;
-  }
-
-  compressedData = malloc(compressedLen);
-  if (compressedData == NULL) {
-    rfbClientLog("Memory allocation error.\n");
-    return FALSE;
-  }
-
-  if (!ReadFromRFBServer(client, (char*)compressedData, compressedLen)) {
-    free(compressedData);
-    return FALSE;
-  }
-
-  cinfo.err = jpeg_std_error(&jerr);
-  cinfo.client_data = client;
-  jpeg_create_decompress(&cinfo);
-
-  JpegSetSrcManager(&cinfo, compressedData, compressedLen);
-
-  jpeg_read_header(&cinfo, TRUE);
-  cinfo.out_color_space = JCS_RGB;
-
-  jpeg_start_decompress(&cinfo);
-  if (cinfo.output_width != w || cinfo.output_height != h ||
-      cinfo.output_components != 3) {
-    rfbClientLog("Tight Encoding: Wrong JPEG data received.\n");
-    jpeg_destroy_decompress(&cinfo);
-    free(compressedData);
-    return FALSE;
-  }
-
-  rowPointer[0] = (JSAMPROW)client->buffer;
-  dy = 0;
-  while (cinfo.output_scanline < cinfo.output_height) {
-    jpeg_read_scanlines(&cinfo, rowPointer, 1);
-    if (client->jpegError) {
-      break;
-    }
-    pixelPtr = (CARDBPP *)&client->buffer[RFB_BUFFER_SIZE / 2];
-    for (dx = 0; dx < w; dx++) {
-      *pixelPtr++ =
-	RGB24_TO_PIXEL(BPP, client->buffer[dx*3], client->buffer[dx*3+1], client->buffer[dx*3+2]);
-    }
-    CopyRectangle(client, (uint8_t *)&client->buffer[RFB_BUFFER_SIZE / 2], x, y + dy, w, 1);
-    dy++;
-  }
-
-  if (!client->jpegError)
-    jpeg_finish_decompress(&cinfo);
-
-  jpeg_destroy_decompress(&cinfo);
-  free(compressedData);
-
-  return !client->jpegError;
-}
-
-#else
-
-static long
-ReadCompactLen (rfbClient* client)
-{
-  long len;
-  uint8_t b;
-
-  if (!ReadFromRFBServer(client, (char *)&b, 1))
-    return -1;
-  len = (int)b & 0x7F;
-  if (b & 0x80) {
-    if (!ReadFromRFBServer(client, (char *)&b, 1))
-      return -1;
-    len |= ((int)b & 0x7F) << 7;
-    if (b & 0x80) {
-      if (!ReadFromRFBServer(client, (char *)&b, 1))
-	return -1;
-      len |= ((int)b & 0xFF) << 14;
-    }
-  }
-  return len;
-}
-
-/*
- * JPEG source manager functions for JPEG decompression in Tight decoder.
- */
-
-static void
-JpegInitSource(j_decompress_ptr cinfo)
-{
-  rfbClient* client=(rfbClient*)cinfo->client_data;
-  client->jpegError = FALSE;
-}
-
-static boolean
-JpegFillInputBuffer(j_decompress_ptr cinfo)
-{
-  rfbClient* client=(rfbClient*)cinfo->client_data;
-  client->jpegError = TRUE;
-  client->jpegSrcManager->bytes_in_buffer = client->jpegBufferLen;
-  client->jpegSrcManager->next_input_byte = (JOCTET *)client->jpegBufferPtr;
-
-  return TRUE;
-}
-
-static void
-JpegSkipInputData(j_decompress_ptr cinfo, long num_bytes)
-{
-  rfbClient* client=(rfbClient*)cinfo->client_data;
-  if (num_bytes < 0 || num_bytes > client->jpegSrcManager->bytes_in_buffer) {
-    client->jpegError = TRUE;
-    client->jpegSrcManager->bytes_in_buffer = client->jpegBufferLen;
-    client->jpegSrcManager->next_input_byte = (JOCTET *)client->jpegBufferPtr;
-  } else {
-    client->jpegSrcManager->next_input_byte += (size_t) num_bytes;
-    client->jpegSrcManager->bytes_in_buffer -= (size_t) num_bytes;
-  }
-}
-
-static void
-JpegTermSource(j_decompress_ptr cinfo)
-{
-  /* nothing to do here. */
-}
-
-static void
-JpegSetSrcManager(j_decompress_ptr cinfo,
-		  uint8_t *compressedData,
-		  int compressedLen)
-{
-  rfbClient* client=(rfbClient*)cinfo->client_data;
-  client->jpegBufferPtr = compressedData;
-  client->jpegBufferLen = (size_t)compressedLen;
-
-  if(client->jpegSrcManager == NULL)
-    client->jpegSrcManager = malloc(sizeof(struct jpeg_source_mgr));
-  client->jpegSrcManager->init_source = JpegInitSource;
-  client->jpegSrcManager->fill_input_buffer = JpegFillInputBuffer;
-  client->jpegSrcManager->skip_input_data = JpegSkipInputData;
-  client->jpegSrcManager->resync_to_restart = jpeg_resync_to_restart;
-  client->jpegSrcManager->term_source = JpegTermSource;
-  client->jpegSrcManager->next_input_byte = (JOCTET*)client->jpegBufferPtr;
-  client->jpegSrcManager->bytes_in_buffer = client->jpegBufferLen;
-
-  cinfo->src = client->jpegSrcManager;
-}
-
-#endif
-
-#undef CARDBPP
-
-/* LIBVNCSERVER_HAVE_LIBZ and LIBVNCSERVER_HAVE_LIBJPEG */
-#endif
-#endif
-
diff --git a/ica/x11/libvncclient/tls.h b/ica/x11/libvncclient/tls.h
deleted file mode 100644
index abd4db3..0000000
--- a/ica/x11/libvncclient/tls.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef TLS_H
-#define TLS_H
-
-/*
- *  Copyright (C) 2009 Vic Lee.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/* Handle Anonymous TLS Authentication (18) with the server.
- * After authentication, client->tlsSession will be set.
- */
-rfbBool HandleAnonTLSAuth(rfbClient* client);
-
-/* Handle VeNCrypt Authentication (19) with the server.
- * The callback function GetX509Credential will be called.
- * After authentication, client->tlsSession will be set.
- */
-rfbBool HandleVeNCryptAuth(rfbClient* client);
-
-/* Read desired bytes from TLS session.
- * It's a wrapper function over gnutls_record_recv() and return values
- * are same as read(), that is, >0 for actual bytes read, 0 for EOF,
- * or EAGAIN, EINTR.
- * This should be a non-blocking call. Blocking is handled in sockets.c.
- */
-int ReadFromTLS(rfbClient* client, char *out, unsigned int n);
-
-/* Write desired bytes to TLS session.
- * It's a wrapper function over gnutls_record_send() and it will be
- * blocking call, until all bytes are written or error returned.
- */
-int WriteToTLS(rfbClient* client, const char *buf, unsigned int n);
-
-/* Free TLS resources */
-void FreeTLS(rfbClient* client);
-
-#endif /* TLS_H */
diff --git a/ica/x11/libvncclient/tls_gnutls.c b/ica/x11/libvncclient/tls_gnutls.c
deleted file mode 100644
index 3daa416..0000000
--- a/ica/x11/libvncclient/tls_gnutls.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- *  Copyright (C) 2009 Vic Lee.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <gnutls/gnutls.h>
-#include <rfb/rfbclient.h>
-#include <errno.h>
-#ifdef WIN32
-#undef SOCKET
-#include <windows.h>           /* for Sleep() */
-#define sleep(X) Sleep(1000*X) /* MinGW32 has no sleep() */
-#include <winsock2.h>
-#define read(sock,buf,len) recv(sock,buf,len,0)
-#define write(sock,buf,len) send(sock,buf,len,0)
-#endif
-#include "tls.h"
-
-
-static const char *rfbTLSPriority = "NORMAL:+DHE-DSS:+RSA:+DHE-RSA:+SRP";
-static const char *rfbAnonTLSPriority= "NORMAL:+ANON-DH";
-
-#define DH_BITS 1024
-static gnutls_dh_params_t rfbDHParams;
-
-static rfbBool rfbTLSInitialized = FALSE;
-
-static rfbBool
-InitializeTLS(void)
-{
-  int ret;
-
-  if (rfbTLSInitialized) return TRUE;
-  if ((ret = gnutls_global_init()) < 0 ||
-      (ret = gnutls_dh_params_init(&rfbDHParams)) < 0 ||
-      (ret = gnutls_dh_params_generate2(rfbDHParams, DH_BITS)) < 0)
-  {
-    rfbClientLog("Failed to initialized GnuTLS: %s.\n", gnutls_strerror(ret));
-    return FALSE;
-  }
-  rfbClientLog("GnuTLS initialized.\n");
-  rfbTLSInitialized = TRUE;
-  return TRUE;
-}
-
-/*
- * On Windows, translate WSAGetLastError() to errno values as GNU TLS does it
- * internally too. This is necessary because send() and recv() on Windows
- * don't set errno when they fail but GNUTLS expects a proper errno value.
- *
- * Use gnutls_transport_set_global_errno() like the GNU TLS documentation
- * suggests to avoid problems with different errno variables when GNU TLS and
- * libvncclient are linked to different versions of msvcrt.dll.
- */
-#ifdef WIN32
-static void WSAtoTLSErrno()
-{
-  switch(WSAGetLastError()) {
-  case WSAEWOULDBLOCK:
-    gnutls_transport_set_global_errno(EAGAIN);
-    break;
-  case WSAEINTR:
-    gnutls_transport_set_global_errno(EINTR);
-    break;
-  default:
-    gnutls_transport_set_global_errno(EIO);
-    break;
-  }
-}
-#endif
-
-
-static ssize_t
-PushTLS(gnutls_transport_ptr_t transport, const void *data, size_t len)
-{
-  rfbClient *client = (rfbClient*)transport;
-  int ret;
-
-  while (1)
-  {
-    ret = write(client->sock, data, len);
-    if (ret < 0)
-    {
-#ifdef WIN32
-      WSAtoTLSErrno();
-#endif
-      if (errno == EINTR) continue;
-      return -1;
-    }
-    return ret;
-  }
-}
-
-
-static ssize_t
-PullTLS(gnutls_transport_ptr_t transport, void *data, size_t len)
-{
-  rfbClient *client = (rfbClient*)transport;
-  int ret;
-
-  while (1)
-  {
-    ret = read(client->sock, data, len);
-    if (ret < 0)
-    {
-#ifdef WIN32
-      WSAtoTLSErrno();
-#endif
-      if (errno == EINTR) continue;
-      return -1;
-    }
-    return ret;
-  }
-}
-
-static rfbBool
-InitializeTLSSession(rfbClient* client, rfbBool anonTLS)
-{
-  int ret;
-  const char *p;
-
-  if (client->tlsSession) return TRUE;
-
-  if ((ret = gnutls_init((gnutls_session_t*)&client->tlsSession, GNUTLS_CLIENT)) < 0)
-  {
-    rfbClientLog("Failed to initialized TLS session: %s.\n", gnutls_strerror(ret));
-    return FALSE;
-  }
-
-  if ((ret = gnutls_priority_set_direct((gnutls_session_t)client->tlsSession,
-    anonTLS ? rfbAnonTLSPriority : rfbTLSPriority, &p)) < 0)
-  {
-    rfbClientLog("Warning: Failed to set TLS priority: %s (%s).\n", gnutls_strerror(ret), p);
-  }
-
-  gnutls_transport_set_ptr((gnutls_session_t)client->tlsSession, (gnutls_transport_ptr_t)client);
-  gnutls_transport_set_push_function((gnutls_session_t)client->tlsSession, PushTLS);
-  gnutls_transport_set_pull_function((gnutls_session_t)client->tlsSession, PullTLS);
-
-  rfbClientLog("TLS session initialized.\n");
-
-  return TRUE;
-}
-
-static rfbBool
-SetTLSAnonCredential(rfbClient* client)
-{
-  gnutls_anon_client_credentials anonCred;
-  int ret;
-
-  if ((ret = gnutls_anon_allocate_client_credentials(&anonCred)) < 0 ||
-      (ret = gnutls_credentials_set((gnutls_session_t)client->tlsSession, GNUTLS_CRD_ANON, anonCred)) < 0)
-  {
-    FreeTLS(client);
-    rfbClientLog("Failed to create anonymous credentials: %s", gnutls_strerror(ret));
-    return FALSE;
-  }
-  rfbClientLog("TLS anonymous credential created.\n");
-  return TRUE;
-}
-
-static rfbBool
-HandshakeTLS(rfbClient* client)
-{
-  int timeout = 15;
-  int ret;
-
-  while (timeout > 0 && (ret = gnutls_handshake((gnutls_session_t)client->tlsSession)) < 0)
-  {
-    if (!gnutls_error_is_fatal(ret))
-    {
-      rfbClientLog("TLS handshake blocking.\n");
-      sleep(1);
-      timeout--;
-      continue;
-    }
-    rfbClientLog("TLS handshake failed: %s.\n", gnutls_strerror(ret));
-    FreeTLS(client);
-    return FALSE;
-  }
-
-  if (timeout <= 0)
-  {
-    rfbClientLog("TLS handshake timeout.\n");
-    FreeTLS(client);
-    return FALSE;
-  }
-
-  rfbClientLog("TLS handshake done.\n");
-  return TRUE;
-}
-
-/* VeNCrypt sub auth. 1 byte auth count, followed by count * 4 byte integers */
-static rfbBool
-ReadVeNCryptSecurityType(rfbClient* client, uint32_t *result)
-{
-    uint8_t count=0;
-    uint8_t loop=0;
-    uint8_t flag=0;
-    uint32_t tAuth[256], t;
-    char buf1[500],buf2[10];
-    uint32_t authScheme;
-
-    if (!ReadFromRFBServer(client, (char *)&count, 1)) return FALSE;
-
-    if (count==0)
-    {
-        rfbClientLog("List of security types is ZERO. Giving up.\n");
-        return FALSE;
-    }
-
-    if (count>sizeof(tAuth))
-    {
-        rfbClientLog("%d security types are too many; maximum is %d\n", count, sizeof(tAuth));
-        return FALSE;
-    }
-
-    rfbClientLog("We have %d security types to read\n", count);
-    authScheme=0;
-    /* now, we have a list of available security types to read ( uint8_t[] ) */
-    for (loop=0;loop<count;loop++)
-    {
-        if (!ReadFromRFBServer(client, (char *)&tAuth[loop], 4)) return FALSE;
-        t=rfbClientSwap32IfLE(tAuth[loop]);
-        rfbClientLog("%d) Received security type %d\n", loop, t);
-        if (flag) continue;
-        if (t==rfbVeNCryptTLSNone ||
-            t==rfbVeNCryptTLSVNC ||
-            t==rfbVeNCryptTLSPlain ||
-            t==rfbVeNCryptX509None ||
-            t==rfbVeNCryptX509VNC ||
-            t==rfbVeNCryptX509Plain)
-        {
-            flag++;
-            authScheme=t;
-            rfbClientLog("Selecting security type %d (%d/%d in the list)\n", authScheme, loop, count);
-            /* send back 4 bytes (in original byte order!) indicating which security type to use */
-            if (!WriteToRFBServer(client, (char *)&tAuth[loop], 4)) return FALSE;
-        }
-        tAuth[loop]=t;
-    }
-    if (authScheme==0)
-    {
-        memset(buf1, 0, sizeof(buf1));
-        for (loop=0;loop<count;loop++)
-        {
-            if (strlen(buf1)>=sizeof(buf1)-1) break;
-            snprintf(buf2, sizeof(buf2), (loop>0 ? ", %d" : "%d"), (int)tAuth[loop]);
-            strncat(buf1, buf2, sizeof(buf1)-strlen(buf1)-1);
-        }
-        rfbClientLog("Unknown VeNCrypt authentication scheme from VNC server: %s\n",
-               buf1);
-        return FALSE;
-    }
-    *result = authScheme;
-    return TRUE;
-}
-
-static void
-FreeX509Credential(rfbCredential *cred)
-{
-  if (cred->x509Credential.x509CACertFile) free(cred->x509Credential.x509CACertFile);
-  if (cred->x509Credential.x509CACrlFile) free(cred->x509Credential.x509CACrlFile);
-  if (cred->x509Credential.x509ClientCertFile) free(cred->x509Credential.x509ClientCertFile);
-  if (cred->x509Credential.x509ClientKeyFile) free(cred->x509Credential.x509ClientKeyFile);
-  free(cred);
-}
-
-static gnutls_certificate_credentials_t
-CreateX509CertCredential(rfbCredential *cred)
-{
-  gnutls_certificate_credentials_t x509_cred;
-  int ret;
-
-  if (!cred->x509Credential.x509CACertFile)
-  {
-    rfbClientLog("No CA certificate provided.\n");
-    return NULL;
-  }
-
-  if ((ret = gnutls_certificate_allocate_credentials(&x509_cred)) < 0)
-  {
-    rfbClientLog("Cannot allocate credentials: %s.\n", gnutls_strerror(ret));
-    return NULL;
-  }
-  if ((ret = gnutls_certificate_set_x509_trust_file(x509_cred,
-    cred->x509Credential.x509CACertFile, GNUTLS_X509_FMT_PEM)) < 0)
-  {
-    rfbClientLog("Cannot load CA credentials: %s.\n", gnutls_strerror(ret));
-    gnutls_certificate_free_credentials (x509_cred);
-    return NULL;
-  }
-  if (cred->x509Credential.x509ClientCertFile && cred->x509Credential.x509ClientKeyFile)
-  {
-    if ((ret = gnutls_certificate_set_x509_key_file(x509_cred,
-      cred->x509Credential.x509ClientCertFile, cred->x509Credential.x509ClientKeyFile,
-      GNUTLS_X509_FMT_PEM)) < 0)
-    {
-      rfbClientLog("Cannot load client certificate or key: %s.\n", gnutls_strerror(ret));
-      gnutls_certificate_free_credentials (x509_cred);
-      return NULL;
-    }
-  } else
-  {
-    rfbClientLog("No client certificate or key provided.\n");
-  }
-  if (cred->x509Credential.x509CACrlFile)
-  {
-    if ((ret = gnutls_certificate_set_x509_crl_file(x509_cred,
-      cred->x509Credential.x509CACrlFile, GNUTLS_X509_FMT_PEM)) < 0)
-    {
-      rfbClientLog("Cannot load CRL: %s.\n", gnutls_strerror(ret));
-      gnutls_certificate_free_credentials (x509_cred);
-      return NULL;
-    }
-  } else
-  {
-    rfbClientLog("No CRL provided.\n");
-  }
-  gnutls_certificate_set_dh_params (x509_cred, rfbDHParams);
-  return x509_cred;
-}
-
-
-rfbBool
-HandleAnonTLSAuth(rfbClient* client)
-{
-  if (!InitializeTLS() || !InitializeTLSSession(client, TRUE)) return FALSE;
-
-  if (!SetTLSAnonCredential(client)) return FALSE;
-
-  if (!HandshakeTLS(client)) return FALSE;
-
-  return TRUE;
-}
-
-rfbBool
-HandleVeNCryptAuth(rfbClient* client)
-{
-  uint8_t major, minor, status;
-  uint32_t authScheme;
-  rfbBool anonTLS;
-  gnutls_certificate_credentials_t x509_cred = NULL;
-  int ret;
-
-  if (!InitializeTLS()) return FALSE;
-
-  /* Read VeNCrypt version */
-  if (!ReadFromRFBServer(client, (char *)&major, 1) ||
-      !ReadFromRFBServer(client, (char *)&minor, 1))
-  {
-    return FALSE;
-  }
-  rfbClientLog("Got VeNCrypt version %d.%d from server.\n", (int)major, (int)minor);
-
-  if (major != 0 && minor != 2)
-  {
-    rfbClientLog("Unsupported VeNCrypt version.\n");
-    return FALSE;
-  }
-
-  if (!WriteToRFBServer(client, (char *)&major, 1) ||
-      !WriteToRFBServer(client, (char *)&minor, 1) ||
-      !ReadFromRFBServer(client, (char *)&status, 1))
-  {
-    return FALSE;
-  }
-
-  if (status != 0)
-  {
-    rfbClientLog("Server refused VeNCrypt version %d.%d.\n", (int)major, (int)minor);
-    return FALSE;
-  }
-
-  if (!ReadVeNCryptSecurityType(client, &authScheme)) return FALSE;
-  if (!ReadFromRFBServer(client, (char *)&status, 1) || status != 1)
-  {
-    rfbClientLog("Server refused VeNCrypt authentication %d (%d).\n", authScheme, (int)status);
-    return FALSE;
-  }
-  client->subAuthScheme = authScheme;
-
-  /* Some VeNCrypt security types are anonymous TLS, others are X509 */
-  switch (authScheme)
-  {
-    case rfbVeNCryptTLSNone:
-    case rfbVeNCryptTLSVNC:
-    case rfbVeNCryptTLSPlain:
-      anonTLS = TRUE;
-      break;
-    default:
-      anonTLS = FALSE;
-      break;
-  }
-
-  /* Get X509 Credentials if it's not anonymous */
-  if (!anonTLS)
-  {
-    rfbCredential *cred;
-
-    if (!client->GetCredential)
-    {
-      rfbClientLog("GetCredential callback is not set.\n");
-      return FALSE;
-    }
-    cred = client->GetCredential(client, rfbCredentialTypeX509);
-    if (!cred)
-    {
-      rfbClientLog("Reading credential failed\n");
-      return FALSE;
-    }
-
-    x509_cred = CreateX509CertCredential(cred);
-    FreeX509Credential(cred);
-    if (!x509_cred) return FALSE;
-  }
-
-  /* Start up the TLS session */
-  if (!InitializeTLSSession(client, anonTLS)) return FALSE;
-
-  if (anonTLS)
-  {
-    if (!SetTLSAnonCredential(client)) return FALSE;
-  }
-  else
-  {
-    if ((ret = gnutls_credentials_set((gnutls_session_t)client->tlsSession, GNUTLS_CRD_CERTIFICATE, x509_cred)) < 0)
-    {
-      rfbClientLog("Cannot set x509 credential: %s.\n", gnutls_strerror(ret));
-      FreeTLS(client);
-      return FALSE;
-    }
-  }
-
-  if (!HandshakeTLS(client)) return FALSE;
-
-  /* TODO: validate certificate */
-
-  /* We are done here. The caller should continue with client->subAuthScheme
-   * to do actual sub authentication.
-   */
-  return TRUE;
-}
-
-int
-ReadFromTLS(rfbClient* client, char *out, unsigned int n)
-{
-  ssize_t ret;
-
-  ret = gnutls_record_recv((gnutls_session_t)client->tlsSession, out, n);
-  if (ret >= 0) return ret;
-  if (ret == GNUTLS_E_REHANDSHAKE || ret == GNUTLS_E_AGAIN)
-  {
-    errno = EAGAIN;
-  } else
-  {
-    rfbClientLog("Error reading from TLS: %s.\n", gnutls_strerror(ret));
-    errno = EINTR;
-  }
-  return -1;
-}
-
-int
-WriteToTLS(rfbClient* client, char *buf, unsigned int n)
-{
-  unsigned int offset = 0;
-  ssize_t ret;
-
-  while (offset < n)
-  {
-    ret = gnutls_record_send((gnutls_session_t)client->tlsSession, buf+offset, (size_t)(n-offset));
-    if (ret == 0) continue;
-    if (ret < 0)
-    {
-      if (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED) continue;
-      rfbClientLog("Error writing to TLS: %s.\n", gnutls_strerror(ret));
-      return -1;
-    }
-    offset += (unsigned int)ret;
-  }
-  return offset;
-}
-
-void FreeTLS(rfbClient* client)
-{
-  if (client->tlsSession)
-  {
-    gnutls_deinit((gnutls_session_t)client->tlsSession);
-    client->tlsSession = NULL;
-  }
-}
diff --git a/ica/x11/libvncclient/tls_none.c b/ica/x11/libvncclient/tls_none.c
deleted file mode 100644
index 97e6a24..0000000
--- a/ica/x11/libvncclient/tls_none.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *  Copyright (C) 2012 Christian Beier.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfbclient.h>
-#include <errno.h>
-#include "tls.h"
-
-rfbBool HandleAnonTLSAuth(rfbClient* client) 
-{
-  rfbClientLog("TLS is not supported.\n");
-  return FALSE;
-}
-
-
-rfbBool HandleVeNCryptAuth(rfbClient* client)
-{
-  rfbClientLog("TLS is not supported.\n");
-  return FALSE;
-}
-
-
-int ReadFromTLS(rfbClient* client, char *out, unsigned int n)
-{
-  rfbClientLog("TLS is not supported.\n");
-  errno = EINTR;
-  return -1;
-}
-
-
-int WriteToTLS(rfbClient* client, const char *buf, unsigned int n)
-{
-  rfbClientLog("TLS is not supported.\n");
-  errno = EINTR;
-  return -1;
-}
-
-
-void FreeTLS(rfbClient* client)
-{
-
-}
-
diff --git a/ica/x11/libvncclient/tls_openssl.c b/ica/x11/libvncclient/tls_openssl.c
deleted file mode 100644
index 529d476..0000000
--- a/ica/x11/libvncclient/tls_openssl.c
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
- *  Copyright (C) 2012 Philip Van Hoof <philip at codeminded.be>
- *  Copyright (C) 2009 Vic Lee.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfbclient.h>
-#include <errno.h>
-
-#include <openssl/err.h>
-#include <openssl/ssl.h>
-#include <openssl/x509.h>
-#include <openssl/rand.h>
-#include <openssl/x509.h>
-
-#include <pthread.h>
-
-#include "tls.h"
-
-static rfbBool rfbTLSInitialized = FALSE;
-static pthread_mutex_t *mutex_buf = NULL;
-
-struct CRYPTO_dynlock_value {
-	pthread_mutex_t mutex;
-};
-
-static void locking_function(int mode, int n, const char *file, int line)
-{
-	if (mode & CRYPTO_LOCK)
-		pthread_mutex_lock(&mutex_buf[n]);
-	else
-		pthread_mutex_unlock(&mutex_buf[n]);
-}
-
-static unsigned long id_function(void)
-{
-	return ((unsigned long) pthread_self());
-}
-
-static struct CRYPTO_dynlock_value *dyn_create_function(const char *file, int line)
-{
-	struct CRYPTO_dynlock_value *value;
-
-	value = (struct CRYPTO_dynlock_value *)
-		malloc(sizeof(struct CRYPTO_dynlock_value));
-	if (!value)
-		goto err;
-	pthread_mutex_init(&value->mutex, NULL);
-
-	return value;
-
-err:
-	return (NULL);
-}
-
-static void dyn_lock_function (int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)
-{
-	if (mode & CRYPTO_LOCK)
-		pthread_mutex_lock(&l->mutex);
-	else
-		pthread_mutex_unlock(&l->mutex);
-}
-
-
-static void
-dyn_destroy_function(struct CRYPTO_dynlock_value *l, const char *file, int line)
-{
-	pthread_mutex_destroy(&l->mutex);
-	free(l);
-}
-
-
-static int
-ssl_errno (SSL *ssl, int ret)
-{
-	switch (SSL_get_error (ssl, ret)) {
-	case SSL_ERROR_NONE:
-		return 0;
-	case SSL_ERROR_ZERO_RETURN:
-		/* this one does not map well at all */
-		//d(printf ("ssl_errno: SSL_ERROR_ZERO_RETURN\n"));
-		return EINVAL;
-	case SSL_ERROR_WANT_READ:   /* non-fatal; retry */
-	case SSL_ERROR_WANT_WRITE:  /* non-fatal; retry */
-		//d(printf ("ssl_errno: SSL_ERROR_WANT_[READ,WRITE]\n"));
-		return EAGAIN;
-	case SSL_ERROR_SYSCALL:
-		//d(printf ("ssl_errno: SSL_ERROR_SYSCALL\n"));
-		return EINTR;
-	case SSL_ERROR_SSL:
-		//d(printf ("ssl_errno: SSL_ERROR_SSL  <-- very useful error...riiiiight\n"));
-		return EINTR;
-	default:
-		//d(printf ("ssl_errno: default error\n"));
-		return EINTR;
-	}
-}
-
-static rfbBool
-InitializeTLS(void)
-{
-  int i;
-
-  if (rfbTLSInitialized) return TRUE;
-
-  mutex_buf = malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
-  if (mutex_buf == NULL) {
-    rfbClientLog("Failed to initialized OpenSSL: memory.\n");
-    return (-1);
-  }
-
-  for (i = 0; i < CRYPTO_num_locks(); i++)
-    pthread_mutex_init(&mutex_buf[i], NULL);
-
-  CRYPTO_set_locking_callback(locking_function);
-  CRYPTO_set_id_callback(id_function);
-  CRYPTO_set_dynlock_create_callback(dyn_create_function);
-  CRYPTO_set_dynlock_lock_callback(dyn_lock_function);
-  CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function);
-  SSL_load_error_strings();
-  SSLeay_add_ssl_algorithms();
-  RAND_load_file("/dev/urandom", 1024);
-
-  rfbClientLog("OpenSSL initialized.\n");
-  rfbTLSInitialized = TRUE;
-  return TRUE;
-}
-
-static int
-ssl_verify (int ok, X509_STORE_CTX *ctx)
-{
-  unsigned char md5sum[16], fingerprint[40], *f;
-  rfbClient *client;
-  char *prompt, *cert_str;
-  int err, i;
-  unsigned int md5len;
-  //char buf[257];
-  X509 *cert;
-  SSL *ssl;
-
-  if (ok)
-    return TRUE;
-
-  ssl = X509_STORE_CTX_get_ex_data (ctx, SSL_get_ex_data_X509_STORE_CTX_idx ());
-
-  client = SSL_CTX_get_app_data (ssl->ctx);
-
-  cert = X509_STORE_CTX_get_current_cert (ctx);
-  err = X509_STORE_CTX_get_error (ctx);
-
-  /* calculate the MD5 hash of the raw certificate */
-  md5len = sizeof (md5sum);
-  X509_digest (cert, EVP_md5 (), md5sum, &md5len);
-  for (i = 0, f = fingerprint; i < 16; i++, f += 3)
-    sprintf ((char *) f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
-
-#define GET_STRING(name) X509_NAME_oneline (name, buf, 256)
-
-  /* TODO: Don't just ignore certificate checks
-
-   fingerprint = key to check in db
-
-   GET_STRING (X509_get_issuer_name (cert));
-   GET_STRING (X509_get_subject_name (cert));
-   cert->valid (bool: GOOD or BAD) */
-
-  ok = TRUE;
-
-  return ok;
-}
-
-static int sock_read_ready(SSL *ssl, uint32_t ms)
-{
-	int r = 0;
-	fd_set fds;
-	struct timeval tv;
-
-	FD_ZERO(&fds);
-
-	FD_SET(SSL_get_fd(ssl), &fds);
-
-	tv.tv_sec = ms / 1000;
-	tv.tv_usec = (ms % 1000) * 1000;
-	
-	r = select (SSL_get_fd(ssl) + 1, &fds, NULL, NULL, &tv); 
-
-	return r;
-}
-
-static int wait_for_data(SSL *ssl, int ret, int timeout)
-{
-  struct timeval tv;
-  fd_set fds;
-  int err;
-  int retval = 1;
-
-  err = SSL_get_error(ssl, ret);
-	
-  switch(err)
-  {
-    case SSL_ERROR_WANT_READ:
-    case SSL_ERROR_WANT_WRITE:
-      ret = sock_read_ready(ssl, timeout*1000);
-			
-      if (ret == -1) {
-        retval = 2;
-      }
-				
-      break;
-      default:
-      retval = 3;
-      break;
-   }
-	
-  ERR_clear_error();
-				
-  return retval;
-}
-
-static SSL *
-open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS)
-{
-  SSL_CTX *ssl_ctx = NULL;
-  SSL *ssl = NULL;
-  int n, finished = 0;
-  BIO *sbio;
-
-  ssl_ctx = SSL_CTX_new (SSLv23_client_method ());
-  SSL_CTX_set_default_verify_paths (ssl_ctx);
-  SSL_CTX_set_verify (ssl_ctx, SSL_VERIFY_NONE, &ssl_verify);
-  ssl = SSL_new (ssl_ctx);
-
-  /* TODO: finetune this list, take into account anonTLS bool */
-  SSL_set_cipher_list(ssl, "ALL");
-
-  SSL_set_fd (ssl, sockfd);
-  SSL_CTX_set_app_data (ssl_ctx, client);
-
-  do
-  {
-    n = SSL_connect(ssl);
-		
-    if (n != 1) 
-    {
-      if (wait_for_data(ssl, n, 1) != 1) 
-      {
-        finished = 1; 
-        if (ssl->ctx)
-          SSL_CTX_free (ssl->ctx);
-        SSL_free(ssl);
-        SSL_shutdown (ssl);
-
-        return NULL;
-      }
-    }
-  } while( n != 1 && finished != 1 );
-
-  return ssl;
-}
-
-
-static rfbBool
-InitializeTLSSession(rfbClient* client, rfbBool anonTLS)
-{
-  int ret;
-
-  if (client->tlsSession) return TRUE;
-
-  client->tlsSession = open_ssl_connection (client, client->sock, anonTLS);
-
-  if (!client->tlsSession)
-    return FALSE;
-
-  rfbClientLog("TLS session initialized.\n");
-
-  return TRUE;
-}
-
-static rfbBool
-SetTLSAnonCredential(rfbClient* client)
-{
-  rfbClientLog("TLS anonymous credential created.\n");
-  return TRUE;
-}
-
-static rfbBool
-HandshakeTLS(rfbClient* client)
-{
-  int timeout = 15;
-  int ret;
-
-return TRUE;
-
-  while (timeout > 0 && (ret = SSL_do_handshake(client->tlsSession)) < 0)
-  {
-    if (ret != -1)
-    {
-      rfbClientLog("TLS handshake blocking.\n");
-      sleep(1);
-      timeout--;
-      continue;
-    }
-    rfbClientLog("TLS handshake failed: -.\n");
-    FreeTLS(client);
-    return FALSE;
-  }
-
-  if (timeout <= 0)
-  {
-    rfbClientLog("TLS handshake timeout.\n");
-    FreeTLS(client);
-    return FALSE;
-  }
-
-  rfbClientLog("TLS handshake done.\n");
-  return TRUE;
-}
-
-/* VeNCrypt sub auth. 1 byte auth count, followed by count * 4 byte integers */
-static rfbBool
-ReadVeNCryptSecurityType(rfbClient* client, uint32_t *result)
-{
-    uint8_t count=0;
-    uint8_t loop=0;
-    uint8_t flag=0;
-    uint32_t tAuth[256], t;
-    char buf1[500],buf2[10];
-    uint32_t authScheme;
-
-    if (!ReadFromRFBServer(client, (char *)&count, 1)) return FALSE;
-
-    if (count==0)
-    {
-        rfbClientLog("List of security types is ZERO. Giving up.\n");
-        return FALSE;
-    }
-
-    if (count>sizeof(tAuth))
-    {
-        rfbClientLog("%d security types are too many; maximum is %d\n", count, sizeof(tAuth));
-        return FALSE;
-    }
-
-    rfbClientLog("We have %d security types to read\n", count);
-    authScheme=0;
-    /* now, we have a list of available security types to read ( uint8_t[] ) */
-    for (loop=0;loop<count;loop++)
-    {
-        if (!ReadFromRFBServer(client, (char *)&tAuth[loop], 4)) return FALSE;
-        t=rfbClientSwap32IfLE(tAuth[loop]);
-        rfbClientLog("%d) Received security type %d\n", loop, t);
-        if (flag) continue;
-        if (t==rfbVeNCryptTLSNone ||
-            t==rfbVeNCryptTLSVNC ||
-            t==rfbVeNCryptTLSPlain ||
-            t==rfbVeNCryptX509None ||
-            t==rfbVeNCryptX509VNC ||
-            t==rfbVeNCryptX509Plain)
-        {
-            flag++;
-            authScheme=t;
-            rfbClientLog("Selecting security type %d (%d/%d in the list)\n", authScheme, loop, count);
-            /* send back 4 bytes (in original byte order!) indicating which security type to use */
-            if (!WriteToRFBServer(client, (char *)&tAuth[loop], 4)) return FALSE;
-        }
-        tAuth[loop]=t;
-    }
-    if (authScheme==0)
-    {
-        memset(buf1, 0, sizeof(buf1));
-        for (loop=0;loop<count;loop++)
-        {
-            if (strlen(buf1)>=sizeof(buf1)-1) break;
-            snprintf(buf2, sizeof(buf2), (loop>0 ? ", %d" : "%d"), (int)tAuth[loop]);
-            strncat(buf1, buf2, sizeof(buf1)-strlen(buf1)-1);
-        }
-        rfbClientLog("Unknown VeNCrypt authentication scheme from VNC server: %s\n",
-               buf1);
-        return FALSE;
-    }
-    *result = authScheme;
-    return TRUE;
-}
-
-rfbBool
-HandleAnonTLSAuth(rfbClient* client)
-{
-  if (!InitializeTLS() || !InitializeTLSSession(client, TRUE)) return FALSE;
-
-  if (!SetTLSAnonCredential(client)) return FALSE;
-
-  if (!HandshakeTLS(client)) return FALSE;
-
-  return TRUE;
-}
-
-rfbBool
-HandleVeNCryptAuth(rfbClient* client)
-{
-  uint8_t major, minor, status;
-  uint32_t authScheme;
-  rfbBool anonTLS;
-//  gnutls_certificate_credentials_t x509_cred = NULL;
-  int ret;
-
-  if (!InitializeTLS()) return FALSE;
-
-  /* Read VeNCrypt version */
-  if (!ReadFromRFBServer(client, (char *)&major, 1) ||
-      !ReadFromRFBServer(client, (char *)&minor, 1))
-  {
-    return FALSE;
-  }
-  rfbClientLog("Got VeNCrypt version %d.%d from server.\n", (int)major, (int)minor);
-
-  if (major != 0 && minor != 2)
-  {
-    rfbClientLog("Unsupported VeNCrypt version.\n");
-    return FALSE;
-  }
-
-  if (!WriteToRFBServer(client, (char *)&major, 1) ||
-      !WriteToRFBServer(client, (char *)&minor, 1) ||
-      !ReadFromRFBServer(client, (char *)&status, 1))
-  {
-    return FALSE;
-  }
-
-  if (status != 0)
-  {
-    rfbClientLog("Server refused VeNCrypt version %d.%d.\n", (int)major, (int)minor);
-    return FALSE;
-  }
-
-  if (!ReadVeNCryptSecurityType(client, &authScheme)) return FALSE;
-  if (!ReadFromRFBServer(client, (char *)&status, 1) || status != 1)
-  {
-    rfbClientLog("Server refused VeNCrypt authentication %d (%d).\n", authScheme, (int)status);
-    return FALSE;
-  }
-  client->subAuthScheme = authScheme;
-
-  /* Some VeNCrypt security types are anonymous TLS, others are X509 */
-  switch (authScheme)
-  {
-    case rfbVeNCryptTLSNone:
-    case rfbVeNCryptTLSVNC:
-    case rfbVeNCryptTLSPlain:
-      anonTLS = TRUE;
-      break;
-    default:
-      anonTLS = FALSE;
-      break;
-  }
-
-  /* Get X509 Credentials if it's not anonymous */
-  if (!anonTLS)
-  {
-    rfbCredential *cred;
-
-    if (!client->GetCredential)
-    {
-      rfbClientLog("GetCredential callback is not set.\n");
-      return FALSE;
-    }
-    cred = client->GetCredential(client, rfbCredentialTypeX509);
-    if (!cred)
-    {
-      rfbClientLog("Reading credential failed\n");
-      return FALSE;
-    }
-
-    /* TODO: don't just ignore this
-    x509_cred = CreateX509CertCredential(cred);
-    FreeX509Credential(cred);
-    if (!x509_cred) return FALSE; */
-  }
-
-  /* Start up the TLS session */
-  if (!InitializeTLSSession(client, anonTLS)) return FALSE;
-
-  if (anonTLS)
-  {
-    if (!SetTLSAnonCredential(client)) return FALSE;
-  }
-  else
-  {
-/* TODO: don't just ignore this
-     if ((ret = gnutls_credentials_set(client->tlsSession, GNUTLS_CRD_CERTIFICATE, x509_cred)) < 0)
-     {
-        rfbClientLog("Cannot set x509 credential: %s.\n", gnutls_strerror(ret));
-        FreeTLS(client); */
-      return FALSE;
-      //  }  
-  }
-
-  if (!HandshakeTLS(client)) return FALSE;
-
-  /* TODO: validate certificate */
-
-  /* We are done here. The caller should continue with client->subAuthScheme
-   * to do actual sub authentication.
-   */
-  return TRUE;
-}
-
-int
-ReadFromTLS(rfbClient* client, char *out, unsigned int n)
-{
-  ssize_t ret;
-
-  ret = SSL_read (client->tlsSession, out, n);
-
-  if (ret >= 0)
-    return ret;
-  else {
-    errno = ssl_errno (client->tlsSession, ret);
-
-    if (errno != EAGAIN) {
-      rfbClientLog("Error reading from TLS: -.\n");
-    }
-  }
-
-  return -1;
-}
-
-int
-WriteToTLS(rfbClient* client, char *buf, unsigned int n)
-{
-  unsigned int offset = 0;
-  ssize_t ret;
-
-  while (offset < n)
-  {
-
-    ret = SSL_write (client->tlsSession, buf + offset, (size_t)(n-offset));
-
-    if (ret < 0)
-      errno = ssl_errno (client->tlsSession, ret);
-
-    if (ret == 0) continue;
-    if (ret < 0)
-    {
-      if (errno == EAGAIN || errno == EWOULDBLOCK) continue;
-      rfbClientLog("Error writing to TLS: -\n");
-      return -1;
-    }
-    offset += (unsigned int)ret;
-  }
-  return offset;
-}
-
-void FreeTLS(rfbClient* client)
-{
-  int i;
-
-  if (mutex_buf != NULL) {
-    CRYPTO_set_dynlock_create_callback(NULL);
-    CRYPTO_set_dynlock_lock_callback(NULL);
-    CRYPTO_set_dynlock_destroy_callback(NULL);
-
-    CRYPTO_set_locking_callback(NULL);
-    CRYPTO_set_id_callback(NULL);
-
-    for (i = 0; i < CRYPTO_num_locks(); i++)
-      pthread_mutex_destroy(&mutex_buf[i]);
-    free(mutex_buf);
-    mutex_buf = NULL;
-  }
-
-  SSL_free(client->tlsSession);
-}
-
diff --git a/ica/x11/libvncclient/ultra.c b/ica/x11/libvncclient/ultra.c
deleted file mode 100644
index dac89b5..0000000
--- a/ica/x11/libvncclient/ultra.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * ultrazip.c - handle ultrazip encoding.
- *
- * This file shouldn't be compiled directly.  It is included multiple times by
- * rfbproto.c, each time with a different definition of the macro BPP.  For
- * each value of BPP, this file defines a function which handles an zlib
- * encoded rectangle with BPP bits per pixel.
- */
-
-#define HandleUltraZipBPP CONCAT2E(HandleUltraZip,BPP)
-#define HandleUltraBPP CONCAT2E(HandleUltra,BPP)
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-
-static rfbBool
-HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-  rfbZlibHeader hdr;
-  int toRead=0;
-  int inflateResult=0;
-  lzo_uint uncompressedBytes = (( rw * rh ) * ( BPP / 8 ));
-
-  if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
-    return FALSE;
-
-  toRead = rfbClientSwap32IfLE(hdr.nBytes);
-  if (toRead==0) return TRUE;
-
-  if (uncompressedBytes==0)
-  {
-      rfbClientLog("ultra error: rectangle has 0 uncomressed bytes ((%dw * %dh) * (%d / 8))\n", rw, rh, BPP); 
-      return FALSE;
-  }
-
-  /* First make sure we have a large enough raw buffer to hold the
-   * decompressed data.  In practice, with a fixed BPP, fixed frame
-   * buffer size and the first update containing the entire frame
-   * buffer, this buffer allocation should only happen once, on the
-   * first update.
-   */
-  if ( client->raw_buffer_size < (int)uncompressedBytes) {
-    if ( client->raw_buffer != NULL ) {
-      free( client->raw_buffer );
-    }
-    client->raw_buffer_size = uncompressedBytes;
-    /* buffer needs to be aligned on 4-byte boundaries */
-    if ((client->raw_buffer_size % 4)!=0)
-      client->raw_buffer_size += (4-(client->raw_buffer_size % 4));
-    client->raw_buffer = (char*) malloc( client->raw_buffer_size );
-  }
-  
-  /* allocate enough space to store the incoming compressed packet */
-  if ( client->ultra_buffer_size < toRead ) {
-    if ( client->ultra_buffer != NULL ) {
-      free( client->ultra_buffer );
-    }
-    client->ultra_buffer_size = toRead;
-    /* buffer needs to be aligned on 4-byte boundaries */
-    if ((client->ultra_buffer_size % 4)!=0)
-      client->ultra_buffer_size += (4-(client->ultra_buffer_size % 4));
-    client->ultra_buffer = (char*) malloc( client->ultra_buffer_size );
-  }
-
-  /* Fill the buffer, obtaining data from the server. */
-  if (!ReadFromRFBServer(client, client->ultra_buffer, toRead))
-      return FALSE;
-
-  /* uncompress the data */
-  uncompressedBytes = client->raw_buffer_size;
-  inflateResult = lzo1x_decompress(
-              (lzo_byte *)client->ultra_buffer, toRead,
-              (lzo_byte *)client->raw_buffer, (lzo_uintp) &uncompressedBytes,
-              NULL);
-  
-  
-  if ((rw * rh * (BPP / 8)) != uncompressedBytes)
-      rfbClientLog("Ultra decompressed too little (%d < %d)", (rw * rh * (BPP / 8)), uncompressedBytes);
-  
-  /* Put the uncompressed contents of the update on the screen. */
-  if ( inflateResult == LZO_E_OK ) 
-  {
-    CopyRectangle(client, (unsigned char *)client->raw_buffer, rx, ry, rw, rh);
-  }
-  else
-  {
-    rfbClientLog("ultra decompress returned error: %d\n",
-            inflateResult);
-    return FALSE;
-  }
-  return TRUE;
-}
-
-
-/* UltraZip is like rre in that it is composed of subrects */
-static rfbBool
-HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-  rfbZlibHeader hdr;
-  int i=0;
-  int toRead=0;
-  int inflateResult=0;
-  unsigned char *ptr=NULL;
-  lzo_uint uncompressedBytes = ry + (rw * 65535);
-  unsigned int numCacheRects = rx;
-
-  if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
-    return FALSE;
-
-  toRead = rfbClientSwap32IfLE(hdr.nBytes);
-
-  if (toRead==0) return TRUE;
-
-  if (uncompressedBytes==0)
-  {
-      rfbClientLog("ultrazip error: rectangle has 0 uncomressed bytes (%dy + (%dw * 65535)) (%d rectangles)\n", ry, rw, rx); 
-      return FALSE;
-  }
-
-  /* First make sure we have a large enough raw buffer to hold the
-   * decompressed data.  In practice, with a fixed BPP, fixed frame
-   * buffer size and the first update containing the entire frame
-   * buffer, this buffer allocation should only happen once, on the
-   * first update.
-   */
-  if ( client->raw_buffer_size < (int)(uncompressedBytes + 500)) {
-    if ( client->raw_buffer != NULL ) {
-      free( client->raw_buffer );
-    }
-    client->raw_buffer_size = uncompressedBytes + 500;
-    /* buffer needs to be aligned on 4-byte boundaries */
-    if ((client->raw_buffer_size % 4)!=0)
-      client->raw_buffer_size += (4-(client->raw_buffer_size % 4));
-    client->raw_buffer = (char*) malloc( client->raw_buffer_size );
-  }
-
- 
-  /* allocate enough space to store the incoming compressed packet */
-  if ( client->ultra_buffer_size < toRead ) {
-    if ( client->ultra_buffer != NULL ) {
-      free( client->ultra_buffer );
-    }
-    client->ultra_buffer_size = toRead;
-    client->ultra_buffer = (char*) malloc( client->ultra_buffer_size );
-  }
-
-  /* Fill the buffer, obtaining data from the server. */
-  if (!ReadFromRFBServer(client, client->ultra_buffer, toRead))
-      return FALSE;
-
-  /* uncompress the data */
-  uncompressedBytes = client->raw_buffer_size;
-  inflateResult = lzo1x_decompress(
-              (lzo_byte *)client->ultra_buffer, toRead,
-              (lzo_byte *)client->raw_buffer, &uncompressedBytes, NULL);
-  if ( inflateResult != LZO_E_OK ) 
-  {
-    rfbClientLog("ultra decompress returned error: %d\n",
-            inflateResult);
-    return FALSE;
-  }
-  
-  /* Put the uncompressed contents of the update on the screen. */
-  ptr = (unsigned char *)client->raw_buffer;
-  for (i=0; i<numCacheRects; i++)
-  {
-    unsigned short sx, sy, sw, sh;
-    unsigned int se;
-
-    memcpy((char *)&sx, ptr, 2); ptr += 2;
-    memcpy((char *)&sy, ptr, 2); ptr += 2;
-    memcpy((char *)&sw, ptr, 2); ptr += 2;
-    memcpy((char *)&sh, ptr, 2); ptr += 2;
-    memcpy((char *)&se, ptr, 4); ptr += 4;
-
-    sx = rfbClientSwap16IfLE(sx);
-    sy = rfbClientSwap16IfLE(sy);
-    sw = rfbClientSwap16IfLE(sw);
-    sh = rfbClientSwap16IfLE(sh);
-    se = rfbClientSwap32IfLE(se);
-
-    if (se == rfbEncodingRaw)
-    {
-        CopyRectangle(client, (unsigned char *)ptr, sx, sy, sw, sh);
-        ptr += ((sw * sh) * (BPP / 8));
-    }
-  }  
-
-  return TRUE;
-}
-
-#undef CARDBPP
diff --git a/ica/x11/libvncclient/vncviewer.c b/ica/x11/libvncclient/vncviewer.c
deleted file mode 100644
index 3b16a6f..0000000
--- a/ica/x11/libvncclient/vncviewer.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * vncviewer.c - the Xt-based VNC viewer.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#define _POSIX_SOURCE
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <rfb/rfbclient.h>
-#include "tls.h"
-
-static void Dummy(rfbClient* client) {
-}
-static rfbBool DummyPoint(rfbClient* client, int x, int y) {
-  return TRUE;
-}
-static void DummyRect(rfbClient* client, int x, int y, int w, int h) {
-}
-
-#ifdef __MINGW32__
-static char* NoPassword(rfbClient* client) {
-  return strdup("");
-}
-#undef SOCKET
-#include <winsock2.h>
-#define close closesocket
-#else
-#include <stdio.h>
-#include <termios.h>
-#endif
-
-static char* ReadPassword(rfbClient* client) {
-#ifdef __MINGW32__
-	/* FIXME */
-	rfbClientErr("ReadPassword on MinGW32 NOT IMPLEMENTED\n");
-	return NoPassword(client);
-#else
-	int i;
-	char* p=malloc(9);
-	struct termios save,noecho;
-	p[0]=0;
-	if(tcgetattr(fileno(stdin),&save)!=0) return p;
-	noecho=save; noecho.c_lflag &= ~ECHO;
-	if(tcsetattr(fileno(stdin),TCSAFLUSH,&noecho)!=0) return p;
-	fprintf(stderr,"Password: ");
-	i=0;
-	while(1) {
-		int c=fgetc(stdin);
-		if(c=='\n')
-			break;
-		if(i<8) {
-			p[i]=c;
-			i++;
-			p[i]=0;
-		}
-	}
-	tcsetattr(fileno(stdin),TCSAFLUSH,&save);
-	return p;
-#endif
-}
-static rfbBool MallocFrameBuffer(rfbClient* client) {
-  if(client->frameBuffer)
-    free(client->frameBuffer);
-  client->frameBuffer=malloc(client->width*client->height*client->format.bitsPerPixel/8);
-  return client->frameBuffer?TRUE:FALSE;
-}
-
-static void initAppData(AppData* data) {
-	data->shareDesktop=TRUE;
-	data->viewOnly=FALSE;
-#ifdef LIBVNCSERVER_CONFIG_LIBVA
-	data->encodingsString="h264 tight zrle ultra copyrect hextile zlib corre rre raw";
-#else
-	data->encodingsString="tight zrle ultra copyrect hextile zlib corre rre raw";
-#endif
-	data->useBGR233=FALSE;
-	data->nColours=0;
-	data->forceOwnCmap=FALSE;
-	data->forceTrueColour=FALSE;
-	data->requestedDepth=0;
-	data->compressLevel=3;
-	data->qualityLevel=5;
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-	data->enableJPEG=TRUE;
-#else
-	data->enableJPEG=FALSE;
-#endif
-	data->useRemoteCursor=FALSE;
-}
-
-rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
-			int bytesPerPixel) {
-  rfbClient* client=(rfbClient*)calloc(sizeof(rfbClient),1);
-  if(!client) {
-    rfbClientErr("Couldn't allocate client structure!\n");
-    return NULL;
-  }
-  initAppData(&client->appData);
-  client->endianTest = 1;
-  client->programName="";
-  client->serverHost=strdup("");
-  client->serverPort=5900;
-
-  client->destHost = NULL;
-  client->destPort = 5900;
-  
-  client->CurrentKeyboardLedState = 0;
-  client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint;
-
-  /* default: use complete frame buffer */ 
-  client->updateRect.x = -1;
- 
-  client->frameBuffer = NULL;
-  client->outputWindow = 0;
- 
-  client->format.bitsPerPixel = bytesPerPixel*8;
-  client->format.depth = bitsPerSample*samplesPerPixel;
-  client->appData.requestedDepth=client->format.depth;
-  client->format.bigEndian = *(char *)&client->endianTest?FALSE:TRUE;
-  client->format.trueColour = TRUE;
-
-  if (client->format.bitsPerPixel == 8) {
-    client->format.redMax = 7;
-    client->format.greenMax = 7;
-    client->format.blueMax = 3;
-    client->format.redShift = 0;
-    client->format.greenShift = 3;
-    client->format.blueShift = 6;
-  } else {
-    client->format.redMax = (1 << bitsPerSample) - 1;
-    client->format.greenMax = (1 << bitsPerSample) - 1;
-    client->format.blueMax = (1 << bitsPerSample) - 1;
-    if(!client->format.bigEndian) {
-      client->format.redShift = 0;
-      client->format.greenShift = bitsPerSample;
-      client->format.blueShift = bitsPerSample * 2;
-    } else {
-      if(client->format.bitsPerPixel==8*3) {
-	client->format.redShift = bitsPerSample*2;
-	client->format.greenShift = bitsPerSample*1;
-	client->format.blueShift = 0;
-      } else {
-	client->format.redShift = bitsPerSample*3;
-	client->format.greenShift = bitsPerSample*2;
-	client->format.blueShift = bitsPerSample;
-      }
-    }
-  }
-
-  client->bufoutptr=client->buf;
-  client->buffered=0;
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-  client->raw_buffer_size = -1;
-  client->decompStreamInited = FALSE;
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-  memset(client->zlibStreamActive,0,sizeof(rfbBool)*4);
-  client->jpegSrcManager = NULL;
-#endif
-#endif
-
-  client->HandleCursorPos = DummyPoint;
-  client->SoftCursorLockArea = DummyRect;
-  client->SoftCursorUnlockScreen = Dummy;
-  client->GotFrameBufferUpdate = DummyRect;
-  client->FinishedFrameBufferUpdate = NULL;
-  client->GetPassword = ReadPassword;
-  client->MallocFrameBuffer = MallocFrameBuffer;
-  client->Bell = Dummy;
-  client->CurrentKeyboardLedState = 0;
-  client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint;
-  client->QoS_DSCP = 0;
-
-  client->authScheme = 0;
-  client->subAuthScheme = 0;
-  client->GetCredential = NULL;
-  client->tlsSession = NULL;
-  client->sock = -1;
-  client->listenSock = -1;
-  client->listenAddress = NULL;
-  client->listen6Sock = -1;
-  client->listen6Address = NULL;
-  client->clientAuthSchemes = NULL;
-  return client;
-}
-
-static rfbBool rfbInitConnection(rfbClient* client)
-{
-  /* Unless we accepted an incoming connection, make a TCP connection to the
-     given VNC server */
-
-  if (!client->listenSpecified) {
-    if (!client->serverHost)
-      return FALSE;
-    if (client->destHost) {
-      if (!ConnectToRFBRepeater(client,client->serverHost,client->serverPort,client->destHost,client->destPort))
-        return FALSE;
-    } else {
-      if (!ConnectToRFBServer(client,client->serverHost,client->serverPort))
-        return FALSE;
-    }
-  }
-
-  /* Initialise the VNC connection, including reading the password */
-
-  if (!InitialiseRFBConnection(client))
-    return FALSE;
-
-  client->width=client->si.framebufferWidth;
-  client->height=client->si.framebufferHeight;
-  client->MallocFrameBuffer(client);
-
-  if (!SetFormatAndEncodings(client))
-    return FALSE;
-
-  if (client->updateRect.x < 0) {
-    client->updateRect.x = client->updateRect.y = 0;
-    client->updateRect.w = client->width;
-    client->updateRect.h = client->height;
-  }
-
-  if (client->appData.scaleSetting>1)
-  {
-      if (!SendScaleSetting(client, client->appData.scaleSetting))
-          return FALSE;
-      if (!SendFramebufferUpdateRequest(client,
-			      client->updateRect.x / client->appData.scaleSetting,
-			      client->updateRect.y / client->appData.scaleSetting,
-			      client->updateRect.w / client->appData.scaleSetting,
-			      client->updateRect.h / client->appData.scaleSetting,
-			      FALSE))
-	      return FALSE;
-  }
-  else
-  {
-      if (!SendFramebufferUpdateRequest(client,
-			      client->updateRect.x, client->updateRect.y,
-			      client->updateRect.w, client->updateRect.h,
-			      FALSE))
-      return FALSE;
-  }
-
-  return TRUE;
-}
-
-rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
-  int i,j;
-
-  if(argv && argc && *argc) {
-    if(client->programName==0)
-      client->programName=argv[0];
-
-    for (i = 1; i < *argc; i++) {
-      j = i;
-      if (strcmp(argv[i], "-listen") == 0) {
-	listenForIncomingConnections(client);
-	break;
-      } else if (strcmp(argv[i], "-listennofork") == 0) {
-	listenForIncomingConnectionsNoFork(client, -1);
-	break;
-      } else if (strcmp(argv[i], "-play") == 0) {
-	client->serverPort = -1;
-	j++;
-      } else if (i+1<*argc && strcmp(argv[i], "-encodings") == 0) {
-	client->appData.encodingsString = argv[i+1];
-	j+=2;
-      } else if (i+1<*argc && strcmp(argv[i], "-compress") == 0) {
-	client->appData.compressLevel = atoi(argv[i+1]);
-	j+=2;
-      } else if (i+1<*argc && strcmp(argv[i], "-quality") == 0) {
-	client->appData.qualityLevel = atoi(argv[i+1]);
-	j+=2;
-      } else if (i+1<*argc && strcmp(argv[i], "-scale") == 0) {
-        client->appData.scaleSetting = atoi(argv[i+1]);
-        j+=2;
-      } else if (i+1<*argc && strcmp(argv[i], "-qosdscp") == 0) {
-        client->QoS_DSCP = atoi(argv[i+1]);
-        j+=2;
-      } else if (i+1<*argc && strcmp(argv[i], "-repeaterdest") == 0) {
-	char* colon=strchr(argv[i+1],':');
-
-	if(client->destHost)
-	  free(client->destHost);
-        client->destPort = 5900;
-
-	client->destHost = strdup(argv[i+1]);
-	if(colon) {
-	  client->destHost[(int)(colon-argv[i+1])] = '\0';
-	  client->destPort = atoi(colon+1);
-	}
-        j+=2;
-      } else {
-	char* colon=strchr(argv[i],':');
-
-	if(client->serverHost)
-	  free(client->serverHost);
-
-	if(colon) {
-	  client->serverHost = strdup(argv[i]);
-	  client->serverHost[(int)(colon-argv[i])] = '\0';
-	  client->serverPort = atoi(colon+1);
-	} else {
-	  client->serverHost = strdup(argv[i]);
-	}
-	if(client->serverPort >= 0 && client->serverPort < 5900)
-	  client->serverPort += 5900;
-      }
-      /* purge arguments */
-      if (j>i) {
-	*argc-=j-i;
-	memmove(argv+i,argv+j,(*argc-i)*sizeof(char*));
-	i--;
-      }
-    }
-  }
-
-  if(!rfbInitConnection(client)) {
-    rfbClientCleanup(client);
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-void rfbClientCleanup(rfbClient* client) {
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-  int i;
-
-  for ( i = 0; i < 4; i++ ) {
-    if (client->zlibStreamActive[i] == TRUE ) {
-      if (inflateEnd (&client->zlibStream[i]) != Z_OK &&
-	  client->zlibStream[i].msg != NULL)
-	rfbClientLog("inflateEnd: %s\n", client->zlibStream[i].msg);
-    }
-  }
-
-  if ( client->decompStreamInited == TRUE ) {
-    if (inflateEnd (&client->decompStream) != Z_OK &&
-	client->decompStream.msg != NULL)
-      rfbClientLog("inflateEnd: %s\n", client->decompStream.msg );
-  }
-
-  if (client->jpegSrcManager)
-    free(client->jpegSrcManager);
-#endif
-#endif
-
-  FreeTLS(client);
-
-  while (client->clientData) {
-    rfbClientData* next = client->clientData->next;
-    free(client->clientData);
-    client->clientData = next;
-  }
-
-  if (client->sock >= 0)
-    close(client->sock);
-  if (client->listenSock >= 0)
-    close(client->listenSock);
-  free(client->desktopName);
-  free(client->serverHost);
-  if (client->destHost)
-    free(client->destHost);
-  if (client->clientAuthSchemes)
-    free(client->clientAuthSchemes);
-  free(client);
-}
diff --git a/ica/x11/libvncclient/zlib.c b/ica/x11/libvncclient/zlib.c
deleted file mode 100644
index e872d40..0000000
--- a/ica/x11/libvncclient/zlib.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-
-/*
- * zlib.c - handle zlib encoding.
- *
- * This file shouldn't be compiled directly.  It is included multiple times by
- * rfbproto.c, each time with a different definition of the macro BPP.  For
- * each value of BPP, this file defines a function which handles an zlib
- * encoded rectangle with BPP bits per pixel.
- */
-
-#define HandleZlibBPP CONCAT2E(HandleZlib,BPP)
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-
-static rfbBool
-HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-  rfbZlibHeader hdr;
-  int remaining;
-  int inflateResult;
-  int toRead;
-
-  /* First make sure we have a large enough raw buffer to hold the
-   * decompressed data.  In practice, with a fixed BPP, fixed frame
-   * buffer size and the first update containing the entire frame
-   * buffer, this buffer allocation should only happen once, on the
-   * first update.
-   */
-  if ( client->raw_buffer_size < (( rw * rh ) * ( BPP / 8 ))) {
-
-    if ( client->raw_buffer != NULL ) {
-
-      free( client->raw_buffer );
-
-    }
-
-    client->raw_buffer_size = (( rw * rh ) * ( BPP / 8 ));
-    client->raw_buffer = (char*) malloc( client->raw_buffer_size );
-
-  }
-
-  if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
-    return FALSE;
-
-  remaining = rfbClientSwap32IfLE(hdr.nBytes);
-
-  /* Need to initialize the decompressor state. */
-  client->decompStream.next_in   = ( Bytef * )client->buffer;
-  client->decompStream.avail_in  = 0;
-  client->decompStream.next_out  = ( Bytef * )client->raw_buffer;
-  client->decompStream.avail_out = client->raw_buffer_size;
-  client->decompStream.data_type = Z_BINARY;
-
-  /* Initialize the decompression stream structures on the first invocation. */
-  if ( client->decompStreamInited == FALSE ) {
-
-    inflateResult = inflateInit( &client->decompStream );
-
-    if ( inflateResult != Z_OK ) {
-      rfbClientLog(
-              "inflateInit returned error: %d, msg: %s\n",
-              inflateResult,
-              client->decompStream.msg);
-      return FALSE;
-    }
-
-    client->decompStreamInited = TRUE;
-
-  }
-
-  inflateResult = Z_OK;
-
-  /* Process buffer full of data until no more to process, or
-   * some type of inflater error, or Z_STREAM_END.
-   */
-  while (( remaining > 0 ) &&
-         ( inflateResult == Z_OK )) {
-  
-    if ( remaining > RFB_BUFFER_SIZE ) {
-      toRead = RFB_BUFFER_SIZE;
-    }
-    else {
-      toRead = remaining;
-    }
-
-    /* Fill the buffer, obtaining data from the server. */
-    if (!ReadFromRFBServer(client, client->buffer,toRead))
-      return FALSE;
-
-    client->decompStream.next_in  = ( Bytef * )client->buffer;
-    client->decompStream.avail_in = toRead;
-
-    /* Need to uncompress buffer full. */
-    inflateResult = inflate( &client->decompStream, Z_SYNC_FLUSH );
-
-    /* We never supply a dictionary for compression. */
-    if ( inflateResult == Z_NEED_DICT ) {
-      rfbClientLog("zlib inflate needs a dictionary!\n");
-      return FALSE;
-    }
-    if ( inflateResult < 0 ) {
-      rfbClientLog(
-              "zlib inflate returned error: %d, msg: %s\n",
-              inflateResult,
-              client->decompStream.msg);
-      return FALSE;
-    }
-
-    /* Result buffer allocated to be at least large enough.  We should
-     * never run out of space!
-     */
-    if (( client->decompStream.avail_in > 0 ) &&
-        ( client->decompStream.avail_out <= 0 )) {
-      rfbClientLog("zlib inflate ran out of space!\n");
-      return FALSE;
-    }
-
-    remaining -= toRead;
-
-  } /* while ( remaining > 0 ) */
-
-  if ( inflateResult == Z_OK ) {
-
-    /* Put the uncompressed contents of the update on the screen. */
-    CopyRectangle(client, (uint8_t *)client->raw_buffer, rx, ry, rw, rh);
-  }
-  else {
-
-    rfbClientLog(
-            "zlib inflate returned error: %d, msg: %s\n",
-            inflateResult,
-            client->decompStream.msg);
-    return FALSE;
-
-  }
-
-  return TRUE;
-}
-
-#undef CARDBPP
-
-#endif
diff --git a/ica/x11/libvncclient/zrle.c b/ica/x11/libvncclient/zrle.c
deleted file mode 100644
index a14ad44..0000000
--- a/ica/x11/libvncclient/zrle.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- *  Copyright (C) 2005 Johannes E. Schindelin.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-
-/*
- * zrle.c - handle zrle encoding.
- *
- * This file shouldn't be compiled directly.  It is included multiple times by
- * rfbproto.c, each time with a different definition of the macro BPP.  For
- * each value of BPP, this file defines a function which handles an zrle
- * encoded rectangle with BPP bits per pixel.
- */
-
-#ifndef REALBPP
-#define REALBPP BPP
-#endif
-
-#if !defined(UNCOMP) || UNCOMP==0
-#define HandleZRLE CONCAT2E(HandleZRLE,REALBPP)
-#define HandleZRLETile CONCAT2E(HandleZRLETile,REALBPP)
-#elif UNCOMP>0
-#define HandleZRLE CONCAT3E(HandleZRLE,REALBPP,Down)
-#define HandleZRLETile CONCAT3E(HandleZRLETile,REALBPP,Down)
-#else
-#define HandleZRLE CONCAT3E(HandleZRLE,REALBPP,Up)
-#define HandleZRLETile CONCAT3E(HandleZRLETile,REALBPP,Up)
-#endif
-#define CARDBPP CONCAT3E(uint,BPP,_t)
-#define CARDREALBPP CONCAT3E(uint,REALBPP,_t)
-
-#define ENDIAN_LITTLE 0
-#define ENDIAN_BIG 1
-#define ENDIAN_NO 2
-#define ZYWRLE_ENDIAN ENDIAN_LITTLE
-#undef END_FIX
-#if ZYWRLE_ENDIAN == ENDIAN_LITTLE
-#  define END_FIX LE
-#elif ZYWRLE_ENDIAN == ENDIAN_BIG
-#  define END_FIX BE
-#else
-#  define END_FIX NE
-#endif
-#define __RFB_CONCAT3E(a,b,c) CONCAT3E(a,b,c)
-#define __RFB_CONCAT2E(a,b) CONCAT2E(a,b)
-#undef CPIXEL
-#if REALBPP != BPP
-#if UNCOMP == 0
-#define CPIXEL REALBPP
-#elif UNCOMP>0
-#define CPIXEL CONCAT2E(REALBPP,Down)
-#else
-#define CPIXEL CONCAT2E(REALBPP,Up)
-#endif
-#endif
-#define PIXEL_T __RFB_CONCAT3E(uint,BPP,_t)
-#if BPP!=8
-#define ZYWRLE_DECODE 1
-#include "zywrletemplate.c"
-#endif
-#undef CPIXEL
-
-static int HandleZRLETile(rfbClient* client,
-	uint8_t* buffer,size_t buffer_length,
-	int x,int y,int w,int h);
-
-static rfbBool
-HandleZRLE (rfbClient* client, int rx, int ry, int rw, int rh)
-{
-	rfbZRLEHeader header;
-	int remaining;
-	int inflateResult;
-	int toRead;
-	int min_buffer_size = rw * rh * (REALBPP / 8) * 2;
-
-	/* First make sure we have a large enough raw buffer to hold the
-	 * decompressed data.  In practice, with a fixed REALBPP, fixed frame
-	 * buffer size and the first update containing the entire frame
-	 * buffer, this buffer allocation should only happen once, on the
-	 * first update.
-	 */
-	if ( client->raw_buffer_size < min_buffer_size) {
-
-		if ( client->raw_buffer != NULL ) {
-
-			free( client->raw_buffer );
-
-		}
-
-		client->raw_buffer_size = min_buffer_size;
-		client->raw_buffer = (char*) malloc( client->raw_buffer_size );
-
-	}
-
-	if (!ReadFromRFBServer(client, (char *)&header, sz_rfbZRLEHeader))
-		return FALSE;
-
-	remaining = rfbClientSwap32IfLE(header.length);
-
-	/* Need to initialize the decompressor state. */
-	client->decompStream.next_in   = ( Bytef * )client->buffer;
-	client->decompStream.avail_in  = 0;
-	client->decompStream.next_out  = ( Bytef * )client->raw_buffer;
-	client->decompStream.avail_out = client->raw_buffer_size;
-	client->decompStream.data_type = Z_BINARY;
-
-	/* Initialize the decompression stream structures on the first invocation. */
-	if ( client->decompStreamInited == FALSE ) {
-
-		inflateResult = inflateInit( &client->decompStream );
-
-		if ( inflateResult != Z_OK ) {
-			rfbClientLog(
-					"inflateInit returned error: %d, msg: %s\n",
-					inflateResult,
-					client->decompStream.msg);
-			return FALSE;
-		}
-
-		client->decompStreamInited = TRUE;
-
-	}
-
-	inflateResult = Z_OK;
-
-	/* Process buffer full of data until no more to process, or
-	 * some type of inflater error, or Z_STREAM_END.
-	 */
-	while (( remaining > 0 ) &&
-			( inflateResult == Z_OK )) {
-
-		if ( remaining > RFB_BUFFER_SIZE ) {
-			toRead = RFB_BUFFER_SIZE;
-		}
-		else {
-			toRead = remaining;
-		}
-
-		/* Fill the buffer, obtaining data from the server. */
-		if (!ReadFromRFBServer(client, client->buffer,toRead))
-			return FALSE;
-
-		client->decompStream.next_in  = ( Bytef * )client->buffer;
-		client->decompStream.avail_in = toRead;
-
-		/* Need to uncompress buffer full. */
-		inflateResult = inflate( &client->decompStream, Z_SYNC_FLUSH );
-
-		/* We never supply a dictionary for compression. */
-		if ( inflateResult == Z_NEED_DICT ) {
-			rfbClientLog("zlib inflate needs a dictionary!\n");
-			return FALSE;
-		}
-		if ( inflateResult < 0 ) {
-			rfbClientLog(
-					"zlib inflate returned error: %d, msg: %s\n",
-					inflateResult,
-					client->decompStream.msg);
-			return FALSE;
-		}
-
-		/* Result buffer allocated to be at least large enough.  We should
-		 * never run out of space!
-		 */
-		if (( client->decompStream.avail_in > 0 ) &&
-				( client->decompStream.avail_out <= 0 )) {
-			rfbClientLog("zlib inflate ran out of space!\n");
-			return FALSE;
-		}
-
-		remaining -= toRead;
-
-	} /* while ( remaining > 0 ) */
-
-	if ( inflateResult == Z_OK ) {
-		void* buf=client->raw_buffer;
-		int i,j;
-
-		remaining = client->raw_buffer_size-client->decompStream.avail_out;
-
-		for(j=0; j<rh; j+=rfbZRLETileHeight)
-			for(i=0; i<rw; i+=rfbZRLETileWidth) {
-				int subWidth=(i+rfbZRLETileWidth>rw)?rw-i:rfbZRLETileWidth;
-				int subHeight=(j+rfbZRLETileHeight>rh)?rh-j:rfbZRLETileHeight;
-				int result=HandleZRLETile(client,buf,remaining,rx+i,ry+j,subWidth,subHeight);
-
-				if(result<0) {
-					rfbClientLog("ZRLE decoding failed (%d)\n",result);
-return TRUE;
-					return FALSE;
-				}
-
-				buf+=result;
-				remaining-=result;
-			}
-	}
-	else {
-
-		rfbClientLog(
-				"zlib inflate returned error: %d, msg: %s\n",
-				inflateResult,
-				client->decompStream.msg);
-		return FALSE;
-
-	}
-
-	return TRUE;
-}
-
-#if REALBPP!=BPP && defined(UNCOMP) && UNCOMP!=0
-#if UNCOMP>0
-#define UncompressCPixel(pointer) ((*(CARDBPP*)pointer)>>UNCOMP)
-#else
-#define UncompressCPixel(pointer) ((*(CARDBPP*)pointer)<<(-(UNCOMP)))
-#endif
-#else
-#define UncompressCPixel(pointer) (*(CARDBPP*)pointer)
-#endif
-
-static int HandleZRLETile(rfbClient* client,
-		uint8_t* buffer,size_t buffer_length,
-		int x,int y,int w,int h) {
-	uint8_t* buffer_copy = buffer;
-	uint8_t* buffer_end = buffer+buffer_length;
-	uint8_t type;
-#if BPP!=8
-	uint8_t zywrle_level = (client->appData.qualityLevel & 0x80) ?
-		0 : (3 - client->appData.qualityLevel / 3);
-#endif
-
-	if(buffer_length<1)
-		return -2;
-
-	type = *buffer;
-	buffer++;
-	{
-		if( type == 0 ) /* raw */
-#if BPP!=8
-          if( zywrle_level > 0 ){
-			CARDBPP* pFrame = (CARDBPP*)client->frameBuffer + y*client->width+x;
-			int ret;
-			client->appData.qualityLevel |= 0x80;
-			ret = HandleZRLETile(client, buffer, buffer_end-buffer, x, y, w, h);
-		    client->appData.qualityLevel &= 0x7F;
-			if( ret < 0 ){
-				return ret;
-			}
-			ZYWRLE_SYNTHESIZE( pFrame, pFrame, w, h, client->width, zywrle_level, (int*)client->zlib_buffer );
-			buffer += ret;
-		  }else
-#endif
-		{
-#if REALBPP!=BPP
-			int i,j;
-
-			if(1+w*h*REALBPP/8>buffer_length) {
-				rfbClientLog("expected %d bytes, got only %d (%dx%d)\n",1+w*h*REALBPP/8,buffer_length,w,h);
-				return -3;
-			}
-
-			for(j=y*client->width; j<(y+h)*client->width; j+=client->width)
-				for(i=x; i<x+w; i++,buffer+=REALBPP/8)
-					((CARDBPP*)client->frameBuffer)[j+i] = UncompressCPixel(buffer);
-#else
-			CopyRectangle(client, buffer, x, y, w, h);
-			buffer+=w*h*REALBPP/8;
-#endif
-		}
-		else if( type == 1 ) /* solid */
-		{
-			CARDBPP color = UncompressCPixel(buffer);
-
-			if(1+REALBPP/8>buffer_length)
-				return -4;
-				
-			FillRectangle(client, x, y, w, h, color);
-
-			buffer+=REALBPP/8;
-
-		}
-		else if( (type >= 2)&&(type <= 127) ) /* packed Palette */
-		{
-			CARDBPP palette[16];
-			int i,j,shift,
-				bpp=(type>4?(type>16?8:4):(type>2?2:1)),
-				mask=(1<<bpp)-1,
-				divider=(8/bpp);
-
-			if(1+type*REALBPP/8+((w+divider-1)/divider)*h>buffer_length)
-				return -5;
-
-			/* read palette */
-			for(i=0; i<type; i++,buffer+=REALBPP/8)
-				palette[i] = UncompressCPixel(buffer);
-
-			/* read palettized pixels */
-			for(j=y*client->width; j<(y+h)*client->width; j+=client->width) {
-				for(i=x,shift=8-bpp; i<x+w; i++) {
-					((CARDBPP*)client->frameBuffer)[j+i] = palette[((*buffer)>>shift)&mask];
-					shift-=bpp;
-					if(shift<0) {
-						shift=8-bpp;
-						buffer++;
-					}
-				}
-				if(shift<8-bpp)
-					buffer++;
-			}
-
-		}
-		/* case 17 ... 127: not used, but valid */
-		else if( type == 128 ) /* plain RLE */
-		{
-			int i=0,j=0;
-			while(j<h) {
-				int color,length;
-				/* read color */
-				if(buffer+REALBPP/8+1>buffer_end)
-					return -7;
-				color = UncompressCPixel(buffer);
-				buffer+=REALBPP/8;
-				/* read run length */
-				length=1;
-				while(*buffer==0xff) {
-					if(buffer+1>=buffer_end)
-						return -8;
-					length+=*buffer;
-					buffer++;
-				}
-				length+=*buffer;
-				buffer++;
-				while(j<h && length>0) {
-					((CARDBPP*)client->frameBuffer)[(y+j)*client->width+x+i] = color;
-					length--;
-					i++;
-					if(i>=w) {
-						i=0;
-						j++;
-					}
-				}
-				if(length>0)
-					rfbClientLog("Warning: possible ZRLE corruption\n");
-			}
-
-		}
-		else if( type == 129 ) /* unused */
-		{
-			return -8;
-		}
-		else if( type >= 130 ) /* palette RLE */
-		{
-			CARDBPP palette[128];
-			int i,j;
-
-			if(2+(type-128)*REALBPP/8>buffer_length)
-				return -9;
-
-			/* read palette */
-			for(i=0; i<type-128; i++,buffer+=REALBPP/8)
-				palette[i] = UncompressCPixel(buffer);
-			/* read palettized pixels */
-			i=j=0;
-			while(j<h) {
-				int color,length;
-				/* read color */
-				if(buffer>=buffer_end)
-					return -10;
-				color = palette[(*buffer)&0x7f];
-				length=1;
-				if(*buffer&0x80) {
-					if(buffer+1>=buffer_end)
-						return -11;
-					buffer++;
-					/* read run length */
-					while(*buffer==0xff) {
-						if(buffer+1>=buffer_end)
-							return -8;
-						length+=*buffer;
-						buffer++;
-					}
-					length+=*buffer;
-				}
-				buffer++;
-				while(j<h && length>0) {
-					((CARDBPP*)client->frameBuffer)[(y+j)*client->width+x+i] = color;
-					length--;
-					i++;
-					if(i>=w) {
-						i=0;
-						j++;
-					}
-				}
-				if(length>0)
-					rfbClientLog("Warning: possible ZRLE corruption\n");
-			}
-		}
-	}
-
-	return buffer-buffer_copy;	
-}
-
-#undef CARDBPP
-#undef CARDREALBPP
-#undef HandleZRLE
-#undef HandleZRLETile
-#undef UncompressCPixel
-#undef REALBPP
-
-#endif
-
-#undef UNCOMP
diff --git a/ica/x11/libvncserver/auth.c b/ica/x11/libvncserver/auth.c
deleted file mode 100644
index 08eb2f4..0000000
--- a/ica/x11/libvncserver/auth.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * auth.c - deal with authentication.
- *
- * This file implements the VNC authentication protocol when setting up an RFB
- * connection.
- */
-
-/*
- *  Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-
-/* RFB 3.8 clients are well informed */
-void rfbClientSendString(rfbClientPtr cl, const char *reason);
-
-
-/*
- * Handle security types
- */
-
-static rfbSecurityHandler* securityHandlers = NULL;
-
-/*
- * This method registers a list of new security types.  
- * It avoids same security type getting registered multiple times. 
- * The order is not preserved if multiple security types are
- * registered at one-go.
- */
-void
-rfbRegisterSecurityHandler(rfbSecurityHandler* handler)
-{
-	rfbSecurityHandler *head = securityHandlers, *next = NULL;
-
-	if(handler == NULL)
-		return;
-
-	next = handler->next;
-
-	while(head != NULL) {
-		if(head == handler) {
-			rfbRegisterSecurityHandler(next);
-			return;
-		}
-
-		head = head->next;
-	}
-
-	handler->next = securityHandlers;
-	securityHandlers = handler;
-
-	rfbRegisterSecurityHandler(next);
-}
-
-/*
- * This method unregisters a list of security types. 
- * These security types won't be available for any new
- * client connection. 
- */
-void
-rfbUnregisterSecurityHandler(rfbSecurityHandler* handler)
-{
-	rfbSecurityHandler *cur = NULL, *pre = NULL;
-
-	if(handler == NULL)
-		return;
-
-	if(securityHandlers == handler) {
-		securityHandlers = securityHandlers->next;
-		rfbUnregisterSecurityHandler(handler->next);
-		return;
-	}
-
-	cur = pre = securityHandlers;
-
-	while(cur) {
-		if(cur == handler) {
-			pre->next = cur->next;
-			break;
-		}
-		pre = cur;
-		cur = cur->next;
-	}
-	rfbUnregisterSecurityHandler(handler->next);
-}
-
-/*
- * Send the authentication challenge.
- */
-
-static void
-rfbVncAuthSendChallenge(rfbClientPtr cl)
-{
-	
-    /* 4 byte header is alreay sent. Which is rfbSecTypeVncAuth 
-       (same as rfbVncAuth). Just send the challenge. */
-    rfbRandomBytes(cl->authChallenge);
-    if (rfbWriteExact(cl, (char *)cl->authChallenge, CHALLENGESIZE) < 0) {
-        rfbLogPerror("rfbAuthNewClient: write");
-        rfbCloseClient(cl);
-        return;
-    }
-    
-    /* Dispatch client input to rfbVncAuthProcessResponse. */
-    cl->state = RFB_AUTHENTICATION;
-}
-
-/*
- * Send the NO AUTHENTICATION. SCARR
- */
-
-/*
- * The rfbVncAuthNone function is currently the only function that contains
- * special logic for the built-in Mac OS X VNC client which is activated by
- * a protocolMinorVersion == 889 coming from the Mac OS X VNC client.
- * The rfbProcessClientInitMessage function does understand how to handle the
- * RFB_INITIALISATION_SHARED state which was introduced to support the built-in
- * Mac OS X VNC client, but rfbProcessClientInitMessage does not examine the
- * protocolMinorVersion version field and so its support for the
- * RFB_INITIALISATION_SHARED state is not restricted to just the OS X client.
- */
-
-static void
-rfbVncAuthNone(rfbClientPtr cl)
-{
-    /* The built-in Mac OS X VNC client behaves in a non-conforming fashion
-     * when the server version is 3.7 or later AND the list of security types
-     * sent to the OS X client contains the 'None' authentication type AND
-     * the OS X client sends back the 'None' type as its choice.  In this case,
-     * and this case ONLY, the built-in Mac OS X VNC client will NOT send the
-     * ClientInit message and instead will behave as though an implicit
-     * ClientInit message containing a shared-flag of true has been sent.
-     * The special state RFB_INITIALISATION_SHARED represents this case.
-     * The Mac OS X VNC client can be detected by checking protocolMinorVersion
-     * for a value of 889.  No other VNC client is known to use this value
-     * for protocolMinorVersion. */
-    uint32_t authResult;
-
-    /* The built-in Mac OS X VNC client expects to NOT receive a SecurityResult
-     * message for authentication type 'None'.  Since its protocolMinorVersion
-     * is greater than 7 (it is 889) this case must be tested for specially. */
-    if (cl->protocolMajorVersion==3 && cl->protocolMinorVersion > 7 && cl->protocolMinorVersion != 889) {
-        rfbLog("rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8\n");
-        authResult = Swap32IfLE(rfbVncAuthOK);
-        if (rfbWriteExact(cl, (char *)&authResult, 4) < 0) {
-            rfbLogPerror("rfbAuthProcessClientMessage: write");
-            rfbCloseClient(cl);
-            return;
-        }
-    }
-    cl->state = cl->protocolMinorVersion == 889 ? RFB_INITIALISATION_SHARED : RFB_INITIALISATION;
-    if (cl->state == RFB_INITIALISATION_SHARED)
-        /* In this case we must call rfbProcessClientMessage now because
-         * otherwise we would hang waiting for data to be received from the
-         * client (the ClientInit message which will never come). */
-        rfbProcessClientMessage(cl);
-    return;
-}
-
-
-/*
- * Advertise the supported security types (protocol 3.7). Here before sending 
- * the list of security types to the client one more security type is added 
- * to the list if primaryType is not set to rfbSecTypeInvalid. This security
- * type is the standard vnc security type which does the vnc authentication
- * or it will be security type for no authentication.
- * Different security types will be added by applications using this library.
- */
-
-static rfbSecurityHandler VncSecurityHandlerVncAuth = {
-    rfbSecTypeVncAuth,
-    rfbVncAuthSendChallenge,
-    NULL
-};
-
-static rfbSecurityHandler VncSecurityHandlerNone = {
-    rfbSecTypeNone,
-    rfbVncAuthNone,
-    NULL
-};
-                        
-
-static void
-rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
-{
-    /* The size of the message is the count of security types +1,
-     * since the first byte is the number of types. */
-    int size = 1;
-    rfbSecurityHandler* handler;
-#define MAX_SECURITY_TYPES 255
-    uint8_t buffer[MAX_SECURITY_TYPES+1];
-
-
-    /* Fill in the list of security types in the client structure. (NOTE: Not really in the client structure) */
-    switch (primaryType) {
-    case rfbSecTypeNone:
-        rfbRegisterSecurityHandler(&VncSecurityHandlerNone);
-        break;
-    case rfbSecTypeVncAuth:
-        rfbRegisterSecurityHandler(&VncSecurityHandlerVncAuth);
-        break;
-    }
-
-    for (handler = securityHandlers;
-	    handler && size<MAX_SECURITY_TYPES; handler = handler->next) {
-	buffer[size] = handler->type;
-	size++;
-    }
-    buffer[0] = (unsigned char)size-1;
-
-    /* Send the list. */
-    if (rfbWriteExact(cl, (char *)buffer, size) < 0) {
-	rfbLogPerror("rfbSendSecurityTypeList: write");
-	rfbCloseClient(cl);
-	return;
-    }
-
-    /*
-      * if count is 0, we need to send the reason and close the connection.
-      */
-    if(size <= 1) {
-	/* This means total count is Zero and so reason msg should be sent */
-	/* The execution should never reach here */
-	char* reason = "No authentication mode is registered!";
-
-	rfbClientSendString(cl, reason);
-	return;
-    }
-
-    /* Dispatch client input to rfbProcessClientSecurityType. */
-    cl->state = RFB_SECURITY_TYPE;
-}
-
-
-
-
-/*
- * Tell the client what security type will be used (protocol 3.3).
- */
-static void
-rfbSendSecurityType(rfbClientPtr cl, uint32_t securityType)
-{
-    uint32_t value32;
-    /* Send the value. */
-    value32 = Swap32IfLE(securityType);
-    if (rfbWriteExact(cl, (char *)&value32, 4) < 0) {
-	rfbLogPerror("rfbSendSecurityType: write");
-	rfbCloseClient(cl);
-	return;
-    }
-
-    /* Decide what to do next. */
-    switch (securityType) {
-    case rfbSecTypeNone:
-	/* Dispatch client input to rfbProcessClientInitMessage. */
-	cl->state = RFB_INITIALISATION;
-	break;
-    case rfbSecTypeVncAuth:
-	/* Begin the standard VNC authentication procedure. */
-	rfbVncAuthSendChallenge(cl);
-	break;
-    default:
-		{
-		    rfbSecurityHandler* handler;
-		    for (handler = securityHandlers; handler; handler = handler->next) {
-				if (securityType == handler->type) {
-					handler->handler(cl);
-					return;
-				}
-			}
-		}
-	/* Impossible case (hopefully). */
-	rfbLogPerror("rfbSendSecurityType: assertion failed");
-	rfbCloseClient(cl);
-    }
-}
-
-
-
-/*
- * rfbAuthNewClient is called right after negotiating the protocol
- * version. Depending on the protocol version, we send either a code
- * for authentication scheme to be used (protocol 3.3), or a list of
- * possible "security types" (protocol 3.7).
- */
-
-void
-rfbAuthNewClient(rfbClientPtr cl)
-{
-    uint32_t securityType = rfbSecTypeInvalid;
-#if 0
-    if (!cl->screen->authPasswdData || cl->reverseConnection) {
-	/* chk if this condition is valid or not. */
-	securityType = rfbSecTypeNone;
-    } else if (cl->screen->authPasswdData) {
- 	    securityType = rfbSecTypeVncAuth;
-    }
-#else
-	securityType = rfbMSLogon;
-#endif
-
-    if (cl->protocolMajorVersion==3 && cl->protocolMinorVersion < 7)
-    {
-	/* Make sure we use only RFB 3.3 compatible security types. */
-	if (securityType == rfbSecTypeInvalid) {
-	    rfbLog("VNC authentication disabled - RFB 3.3 client rejected\n");
-	    rfbClientConnFailed(cl, "Your viewer cannot handle required "
-				"authentication methods");
-	    return;
-	}
-	rfbSendSecurityType(cl, securityType);
-    } else {
-	/* Here it's ok when securityType is set to rfbSecTypeInvalid. */
-	rfbSendSecurityTypeList(cl, securityType);
-    }
-}
-
-/*
- * Read the security type chosen by the client (protocol 3.7).
- */
-
-void
-rfbProcessClientSecurityType(rfbClientPtr cl)
-{
-    int n;
-    uint8_t chosenType;
-    rfbSecurityHandler* handler;
-    
-    /* Read the security type. */
-    n = rfbReadExact(cl, (char *)&chosenType, 1);
-    if (n <= 0) {
-	if (n == 0)
-	    rfbLog("rfbProcessClientSecurityType: client gone\n");
-	else
-	    rfbLogPerror("rfbProcessClientSecurityType: read");
-	rfbCloseClient(cl);
-	return;
-    }
-
-    /* Make sure it was present in the list sent by the server. */
-    for (handler = securityHandlers; handler; handler = handler->next) {
-	if (chosenType == handler->type) {
-	      rfbLog("rfbProcessClientSecurityType: executing handler for type %d\n", chosenType);
-	      handler->handler(cl);
-	      return;
-	}
-    }
-
-    rfbLog("rfbProcessClientSecurityType: wrong security type (%d) requested\n", chosenType);
-    rfbCloseClient(cl);
-}
-
-
-
-/*
- * rfbAuthProcessClientMessage is called when the client sends its
- * authentication response.
- */
-
-void
-rfbAuthProcessClientMessage(rfbClientPtr cl)
-{
-    int n;
-    uint8_t response[CHALLENGESIZE];
-    uint32_t authResult;
-
-    if ((n = rfbReadExact(cl, (char *)response, CHALLENGESIZE)) <= 0) {
-        if (n != 0)
-            rfbLogPerror("rfbAuthProcessClientMessage: read");
-        rfbCloseClient(cl);
-        return;
-    }
-
-    if(!cl->screen->passwordCheck(cl,(const char*)response,CHALLENGESIZE)) {
-        rfbErr("rfbAuthProcessClientMessage: password check failed\n");
-        authResult = Swap32IfLE(rfbVncAuthFailed);
-        if (rfbWriteExact(cl, (char *)&authResult, 4) < 0) {
-            rfbLogPerror("rfbAuthProcessClientMessage: write");
-        }
-	/* support RFB 3.8 clients, they expect a reason *why* it was disconnected */
-        if (cl->protocolMinorVersion > 7) {
-            rfbClientSendString(cl, "password check failed!");
-	}
-	else
-            rfbCloseClient(cl);
-        return;
-    }
-
-    authResult = Swap32IfLE(rfbVncAuthOK);
-
-    if (rfbWriteExact(cl, (char *)&authResult, 4) < 0) {
-        rfbLogPerror("rfbAuthProcessClientMessage: write");
-        rfbCloseClient(cl);
-        return;
-    }
-
-    cl->state = RFB_INITIALISATION;
-}
diff --git a/ica/x11/libvncserver/cargs.c b/ica/x11/libvncserver/cargs.c
deleted file mode 100644
index b9eb02b..0000000
--- a/ica/x11/libvncserver/cargs.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- *  This parses the command line arguments. It was seperated from main.c by 
- *  Justin Dearing <jdeari01 at longisland.poly.edu>.
- */
-
-/*
- *  LibVNCServer (C) 2001 Johannes E. Schindelin <Johannes.Schindelin at gmx.de>
- *  Original OSXvnc (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  see GPL (latest version) for full details
- */
-
-#include <rfb/rfb.h>
-
-extern int rfbStringToAddr(char *str, in_addr_t *iface);
-
-void
-rfbUsage(void)
-{
-    rfbProtocolExtension* extension;
-
-    fprintf(stderr, "-rfbport port          TCP port for RFB protocol\n");
-#ifdef LIBVNCSERVER_IPv6
-    fprintf(stderr, "-rfbportv6 port        TCP6 port for RFB protocol\n");
-#endif
-    fprintf(stderr, "-rfbwait time          max time in ms to wait for RFB client\n");
-    fprintf(stderr, "-rfbauth passwd-file   use authentication on RFB protocol\n"
-                    "                       (use 'storepasswd' to create a password file)\n");
-    fprintf(stderr, "-rfbversion 3.x        Set the version of the RFB we choose to advertise\n");
-    fprintf(stderr, "-permitfiletransfer    permit file transfer support\n");
-    fprintf(stderr, "-passwd plain-password use authentication \n"
-                    "                       (use plain-password as password, USE AT YOUR RISK)\n");
-    fprintf(stderr, "-deferupdate time      time in ms to defer updates "
-                                                             "(default 40)\n");
-    fprintf(stderr, "-deferptrupdate time   time in ms to defer pointer updates"
-                                                           " (default none)\n");
-    fprintf(stderr, "-desktop name          VNC desktop name (default \"LibVNCServer\")\n");
-    fprintf(stderr, "-alwaysshared          always treat new clients as shared\n");
-    fprintf(stderr, "-nevershared           never treat new clients as shared\n");
-    fprintf(stderr, "-dontdisconnect        don't disconnect existing clients when a "
-                                                             "new non-shared\n"
-                    "                       connection comes in (refuse new connection "
-                                                                "instead)\n");
-    fprintf(stderr, "-httpdir dir-path      enable http server using dir-path home\n");
-    fprintf(stderr, "-httpport portnum      use portnum for http connection\n");
-#ifdef LIBVNCSERVER_IPv6
-    fprintf(stderr, "-httpportv6 portnum    use portnum for IPv6 http connection\n");
-#endif
-    fprintf(stderr, "-enablehttpproxy       enable http proxy support\n");
-    fprintf(stderr, "-progressive height    enable progressive updating for slow links\n");
-    fprintf(stderr, "-listen ipaddr         listen for connections only on network interface with\n");
-    fprintf(stderr, "                       addr ipaddr. '-listen localhost' and hostname work too.\n");
-#ifdef LIBVNCSERVER_IPv6
-    fprintf(stderr, "-listenv6 ipv6addr     listen for IPv6 connections only on network interface with\n");
-    fprintf(stderr, "                       addr ipv6addr. '-listen localhost' and hostname work too.\n");
-#endif
-
-    for(extension=rfbGetExtensionIterator();extension;extension=extension->next)
-	if(extension->usage)
-		extension->usage();
-    rfbReleaseExtensionIterator();
-}
-
-/* purges COUNT arguments from ARGV at POSITION and decrements ARGC.
-   POSITION points to the first non purged argument afterwards. */
-void rfbPurgeArguments(int* argc,int* position,int count,char *argv[])
-{
-  int amount=(*argc)-(*position)-count;
-  if(amount)
-    memmove(argv+(*position),argv+(*position)+count,sizeof(char*)*amount);
-  (*argc)-=count;
-}
-
-rfbBool 
-rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
-{
-    int i,i1;
-
-    if(!argc) return TRUE;
-    
-    for (i = i1 = 1; i < *argc;) {
-        if (strcmp(argv[i], "-help") == 0) {
-	    rfbUsage();
-	    return FALSE;
-	} else if (strcmp(argv[i], "-rfbport") == 0) { /* -rfbport port */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-	    rfbScreen->port = atoi(argv[++i]);
-#ifdef LIBVNCSERVER_IPv6
-	} else if (strcmp(argv[i], "-rfbportv6") == 0) { /* -rfbportv6 port */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-	    rfbScreen->ipv6port = atoi(argv[++i]);
-#endif
-        } else if (strcmp(argv[i], "-rfbwait") == 0) {  /* -rfbwait ms */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-	    rfbScreen->maxClientWait = atoi(argv[++i]);
-        } else if (strcmp(argv[i], "-rfbauth") == 0) {  /* -rfbauth passwd-file */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->authPasswdData = argv[++i];
-
-        } else if (strcmp(argv[i], "-permitfiletransfer") == 0) {  /* -permitfiletransfer  */
-            rfbScreen->permitFileTransfer = TRUE;
-        } else if (strcmp(argv[i], "-rfbversion") == 0) {  /* -rfbversion 3.6  */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-	    sscanf(argv[++i],"%d.%d", &rfbScreen->protocolMajorVersion, &rfbScreen->protocolMinorVersion);
-	} else if (strcmp(argv[i], "-passwd") == 0) {  /* -passwd password */
-	    char **passwds = malloc(sizeof(char**)*2);
-	    if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-	    passwds[0] = argv[++i];
-	    passwds[1] = NULL;
-	    rfbScreen->authPasswdData = (void*)passwds;
-	    rfbScreen->passwordCheck = rfbCheckPasswordByList;
-        } else if (strcmp(argv[i], "-deferupdate") == 0) {  /* -deferupdate milliseconds */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->deferUpdateTime = atoi(argv[++i]);
-        } else if (strcmp(argv[i], "-deferptrupdate") == 0) {  /* -deferptrupdate milliseconds */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->deferPtrUpdateTime = atoi(argv[++i]);
-        } else if (strcmp(argv[i], "-desktop") == 0) {  /* -desktop desktop-name */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->desktopName = argv[++i];
-        } else if (strcmp(argv[i], "-alwaysshared") == 0) {
-	    rfbScreen->alwaysShared = TRUE;
-        } else if (strcmp(argv[i], "-nevershared") == 0) {
-            rfbScreen->neverShared = TRUE;
-        } else if (strcmp(argv[i], "-dontdisconnect") == 0) {
-            rfbScreen->dontDisconnect = TRUE;
-        } else if (strcmp(argv[i], "-httpdir") == 0) {  /* -httpdir directory-path */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->httpDir = argv[++i];
-        } else if (strcmp(argv[i], "-httpport") == 0) {  /* -httpport portnum */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->httpPort = atoi(argv[++i]);
-#ifdef LIBVNCSERVER_IPv6
-	} else if (strcmp(argv[i], "-httpportv6") == 0) {  /* -httpportv6 portnum */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->http6Port = atoi(argv[++i]);
-#endif
-        } else if (strcmp(argv[i], "-enablehttpproxy") == 0) {
-            rfbScreen->httpEnableProxyConnect = TRUE;
-        } else if (strcmp(argv[i], "-progressive") == 0) {  /* -httpport portnum */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->progressiveSliceHeight = atoi(argv[++i]);
-        } else if (strcmp(argv[i], "-listen") == 0) {  /* -listen ipaddr */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            if (! rfbStringToAddr(argv[++i], &(rfbScreen->listenInterface))) {
-                return FALSE;
-            }
-#ifdef LIBVNCSERVER_IPv6
-	} else if (strcmp(argv[i], "-listenv6") == 0) {  /* -listenv6 ipv6addr */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-	    rfbScreen->listen6Interface = argv[++i];
-#endif
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-        } else if (strcmp(argv[i], "-sslkeyfile") == 0) {  /* -sslkeyfile sslkeyfile */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->sslkeyfile = argv[++i];
-        } else if (strcmp(argv[i], "-sslcertfile") == 0) {  /* -sslcertfile sslcertfile */
-            if (i + 1 >= *argc) {
-		rfbUsage();
-		return FALSE;
-	    }
-            rfbScreen->sslcertfile = argv[++i];
-#endif
-        } else {
-	    rfbProtocolExtension* extension;
-	    int handled=0;
-
-	    for(extension=rfbGetExtensionIterator();handled==0 && extension;
-			extension=extension->next)
-		if(extension->processArgument)
-			handled = extension->processArgument(*argc - i, argv + i);
-	    rfbReleaseExtensionIterator();
-
-	    if(handled==0) {
-		i++;
-		i1=i;
-		continue;
-	    }
-	    i+=handled-1;
-	}
-	/* we just remove the processed arguments from the list */
-	rfbPurgeArguments(argc,&i1,i-i1+1,argv);
-	i=i1;
-    }
-    return TRUE;
-}
-
-rfbBool 
-rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[])
-{
-    int i,i1;
-
-    if(!argc) return TRUE;
-    for (i = i1 = 1; i < *argc-1;) {
-        if (strcmp(argv[i], "-bpp") == 0) {
-               *bpp = atoi(argv[++i]);
-        } else if (strcmp(argv[i], "-width") == 0) {
-               *width = atoi(argv[++i]);
-        } else if (strcmp(argv[i], "-height") == 0) {
-               *height = atoi(argv[++i]);
-        } else {
-	    i++;
-	    i1=i;
-	    continue;
-	}
-	rfbPurgeArguments(argc,&i1,i-i1,argv);
-	i=i1;
-    }
-    return TRUE;
-}
-
diff --git a/ica/x11/libvncserver/corre.c b/ica/x11/libvncserver/corre.c
deleted file mode 100644
index 8a845ea..0000000
--- a/ica/x11/libvncserver/corre.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * corre.c
- *
- * Routines to implement Compact Rise-and-Run-length Encoding (CoRRE).  This
- * code is based on krw's original javatel rfbserver.
- */
-
-/*
- *  Copyright (C) 2002 RealVNC Ltd.
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-
-/*
- * cl->beforeEncBuf contains pixel data in the client's format.
- * cl->afterEncBuf contains the RRE encoded version.  If the RRE encoded version is
- * larger than the raw data or if it exceeds cl->afterEncBufSize then
- * raw encoding is used instead.
- */
-
-static int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);
-static int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);
-static int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);
-static uint32_t getBgColour(char *data, int size, int bpp);
-static rfbBool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,
-                                          int w, int h);
-
-
-/*
- * rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE
- * encoding.
- */
-
-rfbBool
-rfbSendRectEncodingCoRRE(rfbClientPtr cl,
-                         int x,
-                         int y,
-                         int w,
-                         int h)
-{
-    if (h > cl->correMaxHeight) {
-        return (rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight) &&
-		rfbSendRectEncodingCoRRE(cl, x, y + cl->correMaxHeight, w,
-					 h - cl->correMaxHeight));
-    }
-
-    if (w > cl->correMaxWidth) {
-        return (rfbSendRectEncodingCoRRE(cl, x, y, cl->correMaxWidth, h) &&
-		rfbSendRectEncodingCoRRE(cl, x + cl->correMaxWidth, y,
-					 w - cl->correMaxWidth, h));
-    }
-
-    rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h);
-    return TRUE;
-}
-
-
-
-/*
- * rfbSendSmallRectEncodingCoRRE - send a small (guaranteed < 256x256)
- * rectangle using CoRRE encoding.
- */
-
-static rfbBool
-rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
-                              int x,
-                              int y,
-                              int w,
-                              int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    rfbRREHeader hdr;
-    int nSubrects;
-    int i;
-    char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)
-                   + (x * (cl->scaledScreen->bitsPerPixel / 8)));
-
-    int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
-                      * (cl->format.bitsPerPixel / 8));
-
-    if (cl->beforeEncBufSize < maxRawSize) {
-        cl->beforeEncBufSize = maxRawSize;
-        if (cl->beforeEncBuf == NULL)
-            cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
-        else
-            cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
-    }
-
-    if (cl->afterEncBufSize < maxRawSize) {
-        cl->afterEncBufSize = maxRawSize;
-        if (cl->afterEncBuf == NULL)
-            cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
-        else
-            cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
-    }
-
-    (*cl->translateFn)(cl->translateLookupTable,&(cl->screen->serverFormat),
-                       &cl->format, fbptr, cl->beforeEncBuf,
-                       cl->scaledScreen->paddedWidthInBytes, w, h);
-
-    switch (cl->format.bitsPerPixel) {
-    case 8:
-        nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h);
-        break;
-    case 16:
-        nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h);
-        break;
-    case 32:
-        nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h);
-        break;
-    default:
-        rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
-        return FALSE;
-    }
-        
-    if (nSubrects < 0) {
-
-        /* RRE encoding was too large, use raw */
-
-        return rfbSendRectEncodingRaw(cl, x, y, w, h);
-    }
-
-    rfbStatRecordEncodingSent(cl,rfbEncodingCoRRE,
-        sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen,
-        sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8));
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
-        > UPDATE_BUF_SIZE)
-    {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(rfbEncodingCoRRE);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-           sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    hdr.nSubrects = Swap32IfLE(nSubrects);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
-    cl->ublen += sz_rfbRREHeader;
-
-    for (i = 0; i < cl->afterEncBufLen;) {
-
-        int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
-
-        if (i + bytesToCopy > cl->afterEncBufLen) {
-            bytesToCopy = cl->afterEncBufLen - i;
-        }
-
-        memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
-
-        cl->ublen += bytesToCopy;
-        i += bytesToCopy;
-
-        if (cl->ublen == UPDATE_BUF_SIZE) {
-            if (!rfbSendUpdateBuf(cl))
-                return FALSE;
-        }
-    }
-
-    return TRUE;
-}
-
-
-
-/*
- * subrectEncode() encodes the given multicoloured rectangle as a background 
- * colour overwritten by single-coloured rectangles.  It returns the number 
- * of subrectangles in the encoded buffer, or -1 if subrect encoding won't
- * fit in the buffer.  It puts the encoded rectangles in cl->afterEncBuf.  The
- * single-colour rectangle partition is not optimal, but does find the biggest
- * horizontal or vertical rectangle top-left anchored to each consecutive 
- * coordinate position.
- *
- * The coding scheme is simply [<bgcolour><subrect><subrect>...] where each 
- * <subrect> is [<colour><x><y><w><h>].
- */
-
-#define DEFINE_SUBRECT_ENCODE(bpp)                                            \
-static int                                                                    \
-subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) {                       \
-    uint##bpp##_t cl;                                                         \
-    rfbCoRRERectangle subrect;                                                \
-    int x,y;                                                                  \
-    int i,j;                                                                  \
-    int hx=0,hy,vx=0,vy;                                                      \
-    int hyflag;                                                               \
-    uint##bpp##_t *seg;                                                       \
-    uint##bpp##_t *line;                                                      \
-    int hw,hh,vw,vh;                                                          \
-    int thex,they,thew,theh;                                                  \
-    int numsubs = 0;                                                          \
-    int newLen;                                                               \
-    uint##bpp##_t bg = (uint##bpp##_t)getBgColour((char*)data,w*h,bpp);       \
-                                                                              \
-    *((uint##bpp##_t*)client->afterEncBuf) = bg;                                      \
-                                                                              \
-    client->afterEncBufLen = (bpp/8);                                                 \
-                                                                              \
-    for (y=0; y<h; y++) {                                                     \
-      line = data+(y*w);                                                      \
-      for (x=0; x<w; x++) {                                                   \
-        if (line[x] != bg) {                                                  \
-          cl = line[x];                                                       \
-          hy = y-1;                                                           \
-          hyflag = 1;                                                         \
-          for (j=y; j<h; j++) {                                               \
-            seg = data+(j*w);                                                 \
-            if (seg[x] != cl) {break;}                                        \
-            i = x;                                                            \
-            while ((seg[i] == cl) && (i < w)) i += 1;                         \
-            i -= 1;                                                           \
-            if (j == y) vx = hx = i;                                          \
-            if (i < vx) vx = i;                                               \
-            if ((hyflag > 0) && (i >= hx)) {hy += 1;} else {hyflag = 0;}      \
-          }                                                                   \
-          vy = j-1;                                                           \
-                                                                              \
-          /*  We now have two possible subrects: (x,y,hx,hy) and (x,y,vx,vy)  \
-           *  We'll choose the bigger of the two.                             \
-           */                                                                 \
-          hw = hx-x+1;                                                        \
-          hh = hy-y+1;                                                        \
-          vw = vx-x+1;                                                        \
-          vh = vy-y+1;                                                        \
-                                                                              \
-          thex = x;                                                           \
-          they = y;                                                           \
-                                                                              \
-          if ((hw*hh) > (vw*vh)) {                                            \
-            thew = hw;                                                        \
-            theh = hh;                                                        \
-          } else {                                                            \
-            thew = vw;                                                        \
-            theh = vh;                                                        \
-          }                                                                   \
-                                                                              \
-          subrect.x = thex;                                                   \
-          subrect.y = they;                                                   \
-          subrect.w = thew;                                                   \
-          subrect.h = theh;                                                   \
-                                                                              \
-          newLen = client->afterEncBufLen + (bpp/8) + sz_rfbCoRRERectangle;           \
-          if ((newLen > (w * h * (bpp/8))) || (newLen > client->afterEncBufSize))     \
-            return -1;                                                        \
-                                                                              \
-          numsubs += 1;                                                       \
-          *((uint##bpp##_t*)(client->afterEncBuf + client->afterEncBufLen)) = cl;             \
-          client->afterEncBufLen += (bpp/8);                                          \
-          memcpy(&client->afterEncBuf[client->afterEncBufLen],&subrect,sz_rfbCoRRERectangle); \
-          client->afterEncBufLen += sz_rfbCoRRERectangle;                             \
-                                                                              \
-          /*                                                                  \
-           * Now mark the subrect as done.                                    \
-           */                                                                 \
-          for (j=they; j < (they+theh); j++) {                                \
-            for (i=thex; i < (thex+thew); i++) {                              \
-              data[j*w+i] = bg;                                               \
-            }                                                                 \
-          }                                                                   \
-        }                                                                     \
-      }                                                                       \
-    }                                                                         \
-                                                                              \
-    return numsubs;                                                           \
-}
-
-DEFINE_SUBRECT_ENCODE(8)
-DEFINE_SUBRECT_ENCODE(16)
-DEFINE_SUBRECT_ENCODE(32)
-
-
-/*
- * getBgColour() gets the most prevalent colour in a byte array.
- */
-static uint32_t
-getBgColour(char *data, int size, int bpp)
-{
-
-#define NUMCLRS 256
-  
-  static int counts[NUMCLRS];
-  int i,j,k;
-
-  int maxcount = 0;
-  uint8_t maxclr = 0;
-
-  if (bpp != 8) {
-    if (bpp == 16) {
-      return ((uint16_t *)data)[0];
-    } else if (bpp == 32) {
-      return ((uint32_t *)data)[0];
-    } else {
-      rfbLog("getBgColour: bpp %d?\n",bpp);
-      return 0;
-    }
-  }
-
-  for (i=0; i<NUMCLRS; i++) {
-    counts[i] = 0;
-  }
-
-  for (j=0; j<size; j++) {
-    k = (int)(((uint8_t *)data)[j]);
-    if (k >= NUMCLRS) {
-      rfbLog("getBgColour: unusual colour = %d\n", k);
-      return 0;
-    }
-    counts[k] += 1;
-    if (counts[k] > maxcount) {
-      maxcount = counts[k];
-      maxclr = ((uint8_t *)data)[j];
-    }
-  }
-  
-  return maxclr;
-}
diff --git a/ica/x11/libvncserver/cursor.c b/ica/x11/libvncserver/cursor.c
deleted file mode 100644
index c071dd9..0000000
--- a/ica/x11/libvncserver/cursor.c
+++ /dev/null
@@ -1,756 +0,0 @@
-/*
- * cursor.c - support for cursor shape updates.
- */
-
-/*
- *  Copyright (C) 2000, 2001 Const Kaplinsky.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-#include "private.h"
-
-void rfbScaledScreenUpdate(rfbScreenInfoPtr screen, int x1, int y1, int x2, int y2);
-
-/*
- * Send cursor shape either in X-style format or in client pixel format.
- */
-
-rfbBool
-rfbSendCursorShape(rfbClientPtr cl)
-{
-    rfbCursorPtr pCursor;
-    rfbFramebufferUpdateRectHeader rect;
-    rfbXCursorColors colors;
-    int saved_ublen;
-    int bitmapRowBytes, maskBytes, dataBytes;
-    int i, j;
-    uint8_t *bitmapData;
-    uint8_t bitmapByte;
-
-    /* TODO: scale the cursor data to the correct size */
-
-    pCursor = cl->screen->getCursorPtr(cl);
-    /*if(!pCursor) return TRUE;*/
-
-    if (cl->useRichCursorEncoding) {
-      if(pCursor && !pCursor->richSource)
-	rfbMakeRichCursorFromXCursor(cl->screen,pCursor);
-      rect.encoding = Swap32IfLE(rfbEncodingRichCursor);
-    } else {
-       if(pCursor && !pCursor->source)
-	 rfbMakeXCursorFromRichCursor(cl->screen,pCursor);
-       rect.encoding = Swap32IfLE(rfbEncodingXCursor);
-    }
-
-    /* If there is no cursor, send update with empty cursor data. */
-
-    if ( pCursor && pCursor->width == 1 &&
-	 pCursor->height == 1 &&
-	 pCursor->mask[0] == 0 ) {
-	pCursor = NULL;
-    }
-
-    if (pCursor == NULL) {
-	if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE ) {
-	    if (!rfbSendUpdateBuf(cl))
-		return FALSE;
-	}
-	rect.r.x = rect.r.y = 0;
-	rect.r.w = rect.r.h = 0;
-	memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-	       sz_rfbFramebufferUpdateRectHeader);
-	cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-	if (!rfbSendUpdateBuf(cl))
-	    return FALSE;
-
-	return TRUE;
-    }
-
-    /* Calculate data sizes. */
-
-    bitmapRowBytes = (pCursor->width + 7) / 8;
-    maskBytes = bitmapRowBytes * pCursor->height;
-    dataBytes = (cl->useRichCursorEncoding) ?
-	(pCursor->width * pCursor->height *
-	 (cl->format.bitsPerPixel / 8)) : maskBytes;
-
-    /* Send buffer contents if needed. */
-
-    if ( cl->ublen + sz_rfbFramebufferUpdateRectHeader +
-	 sz_rfbXCursorColors + maskBytes + dataBytes > UPDATE_BUF_SIZE ) {
-	if (!rfbSendUpdateBuf(cl))
-	    return FALSE;
-    }
-
-    if ( cl->ublen + sz_rfbFramebufferUpdateRectHeader +
-	 sz_rfbXCursorColors + maskBytes + dataBytes > UPDATE_BUF_SIZE ) {
-	return FALSE;		/* FIXME. */
-    }
-
-    saved_ublen = cl->ublen;
-
-    /* Prepare rectangle header. */
-
-    rect.r.x = Swap16IfLE(pCursor->xhot);
-    rect.r.y = Swap16IfLE(pCursor->yhot);
-    rect.r.w = Swap16IfLE(pCursor->width);
-    rect.r.h = Swap16IfLE(pCursor->height);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    /* Prepare actual cursor data (depends on encoding used). */
-
-    if (!cl->useRichCursorEncoding) {
-	/* XCursor encoding. */
-	colors.foreRed   = (char)(pCursor->foreRed   >> 8);
-	colors.foreGreen = (char)(pCursor->foreGreen >> 8);
-	colors.foreBlue  = (char)(pCursor->foreBlue  >> 8);
-	colors.backRed   = (char)(pCursor->backRed   >> 8);
-	colors.backGreen = (char)(pCursor->backGreen >> 8);
-	colors.backBlue  = (char)(pCursor->backBlue  >> 8);
-
-	memcpy(&cl->updateBuf[cl->ublen], (char *)&colors, sz_rfbXCursorColors);
-	cl->ublen += sz_rfbXCursorColors;
-
-	bitmapData = (uint8_t *)pCursor->source;
-
-	for (i = 0; i < pCursor->height; i++) {
-	    for (j = 0; j < bitmapRowBytes; j++) {
-		bitmapByte = bitmapData[i * bitmapRowBytes + j];
-		cl->updateBuf[cl->ublen++] = (char)bitmapByte;
-	    }
-	}
-    } else {
-	/* RichCursor encoding. */
-       int bpp1=cl->screen->serverFormat.bitsPerPixel/8,
-	 bpp2=cl->format.bitsPerPixel/8;
-       (*cl->translateFn)(cl->translateLookupTable,
-		       &(cl->screen->serverFormat),
-                       &cl->format, (char*)pCursor->richSource,
-		       &cl->updateBuf[cl->ublen],
-                       pCursor->width*bpp1, pCursor->width, pCursor->height);
-
-       cl->ublen += pCursor->width*bpp2*pCursor->height;
-    }
-
-    /* Prepare transparency mask. */
-
-    bitmapData = (uint8_t *)pCursor->mask;
-
-    for (i = 0; i < pCursor->height; i++) {
-	for (j = 0; j < bitmapRowBytes; j++) {
-	    bitmapByte = bitmapData[i * bitmapRowBytes + j];
-	    cl->updateBuf[cl->ublen++] = (char)bitmapByte;
-	}
-    }
-
-    /* Send everything we have prepared in the cl->updateBuf[]. */
-    rfbStatRecordEncodingSent(cl, (cl->useRichCursorEncoding ? rfbEncodingRichCursor : rfbEncodingXCursor), 
-        sz_rfbFramebufferUpdateRectHeader + (cl->ublen - saved_ublen), sz_rfbFramebufferUpdateRectHeader + (cl->ublen - saved_ublen));
-
-    if (!rfbSendUpdateBuf(cl))
-	return FALSE;
-
-    return TRUE;
-}
-
-/*
- * Send cursor position (PointerPos pseudo-encoding).
- */
-
-rfbBool
-rfbSendCursorPos(rfbClientPtr cl)
-{
-  rfbFramebufferUpdateRectHeader rect;
-
-  if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
-    if (!rfbSendUpdateBuf(cl))
-      return FALSE;
-  }
-
-  rect.encoding = Swap32IfLE(rfbEncodingPointerPos);
-  rect.r.x = Swap16IfLE(cl->screen->cursorX);
-  rect.r.y = Swap16IfLE(cl->screen->cursorY);
-  rect.r.w = 0;
-  rect.r.h = 0;
-
-  memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-	 sz_rfbFramebufferUpdateRectHeader);
-  cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-  rfbStatRecordEncodingSent(cl, rfbEncodingPointerPos, sz_rfbFramebufferUpdateRectHeader, sz_rfbFramebufferUpdateRectHeader);
-
-  if (!rfbSendUpdateBuf(cl))
-    return FALSE;
-
-  return TRUE;
-}
-
-/* conversion routine for predefined cursors in LSB order */
-unsigned char rfbReverseByte[0x100] = {
-  /* copied from Xvnc/lib/font/util/utilbitmap.c */
-	0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-	0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-	0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-	0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-	0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-	0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-	0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-	0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-	0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-	0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-	0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-	0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-	0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-	0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-	0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-	0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-	0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-	0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-	0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-	0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-	0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-	0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-	0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-	0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-	0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-	0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-	0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-	0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-	0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-	0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-	0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-	0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap)
-{
-   int i,t=(width+7)/8*height;
-   for(i=0;i<t;i++)
-     bitmap[i]=rfbReverseByte[(int)bitmap[i]];
-}
-
-/* Cursor creation. You "paint" a cursor and let these routines do the work */
-
-rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString)
-{
-   int i,j,w=(width+7)/8;
-   rfbCursorPtr cursor = (rfbCursorPtr)calloc(1,sizeof(rfbCursor));
-   char* cp;
-   unsigned char bit;
-
-   cursor->cleanup=TRUE;
-   cursor->width=width;
-   cursor->height=height;
-   /*cursor->backRed=cursor->backGreen=cursor->backBlue=0xffff;*/
-   cursor->foreRed=cursor->foreGreen=cursor->foreBlue=0xffff;
-   
-   cursor->source = (unsigned char*)calloc(w,height);
-   cursor->cleanupSource = TRUE;
-   for(j=0,cp=cursorString;j<height;j++)
-      for(i=0,bit=0x80;i<width;i++,bit=(bit&1)?0x80:bit>>1,cp++)
-	if(*cp!=' ') cursor->source[j*w+i/8]|=bit;
-
-   if(maskString) {
-      cursor->mask = (unsigned char*)calloc(w,height);
-      for(j=0,cp=maskString;j<height;j++)
-	for(i=0,bit=0x80;i<width;i++,bit=(bit&1)?0x80:bit>>1,cp++)
-	  if(*cp!=' ') cursor->mask[j*w+i/8]|=bit;
-   } else
-     cursor->mask = (unsigned char*)rfbMakeMaskForXCursor(width,height,(char*)cursor->source);
-   cursor->cleanupMask = TRUE;
-
-   return(cursor);
-}
-
-char* rfbMakeMaskForXCursor(int width,int height,char* source)
-{
-   int i,j,w=(width+7)/8;
-   char* mask=(char*)calloc(w,height);
-   unsigned char c;
-   
-   for(j=0;j<height;j++)
-     for(i=w-1;i>=0;i--) {
-	c=source[j*w+i];
-	if(j>0) c|=source[(j-1)*w+i];
-	if(j<height-1) c|=source[(j+1)*w+i];
-	
-	if(i>0 && (c&0x80))
-	  mask[j*w+i-1]|=0x01;
-	if(i<w-1 && (c&0x01))
-	  mask[j*w+i+1]|=0x80;
-	
-	mask[j*w+i]|=(c<<1)|c|(c>>1);
-     }
-   
-   return(mask);
-}
-
-/* this function dithers the alpha using Floyd-Steinberg */
-
-char* rfbMakeMaskFromAlphaSource(int width,int height,unsigned char* alphaSource)
-{
-	int* error=(int*)calloc(sizeof(int),width);
-	int i,j,currentError=0,maskStride=(width+7)/8;
-	unsigned char* result=(unsigned char*)calloc(maskStride,height);
-	
-	for(j=0;j<height;j++)
-		for(i=0;i<width;i++) {
-			int right,middle,left;
-			currentError+=alphaSource[i+width*j]+error[i];
-		
-			if(currentError<0x80) {
-				/* set to transparent */
-				/* alpha was treated as 0 */
-			} else {
-				/* set to solid */
-				result[i/8+j*maskStride]|=(0x100>>(i&7));
-				/* alpha was treated as 0xff */
-				currentError-=0xff;
-			}
-			/* propagate to next row */
-			right=currentError/16;
-			middle=currentError*5/16;
-			left=currentError*3/16;
-			currentError-=right+middle+left;
-			error[i]=right;
-			if(i>0) {
-				error[i-1]=middle;
-				if(i>1)
-					error[i-2]=left;
-			}
-		}
-	free(error);
-	return (char *) result;
-}
-
-void rfbFreeCursor(rfbCursorPtr cursor)
-{
-   if(cursor) {
-       if(cursor->cleanupRichSource && cursor->richSource)
-	   free(cursor->richSource);
-       if(cursor->cleanupRichSource && cursor->alphaSource)
-	   free(cursor->alphaSource);
-       if(cursor->cleanupSource && cursor->source)
-	   free(cursor->source);
-       if(cursor->cleanupMask && cursor->mask)
-	   free(cursor->mask);
-       if(cursor->cleanup)
-	   free(cursor);
-       else {
-	   cursor->cleanup=cursor->cleanupSource=cursor->cleanupMask
-	       =cursor->cleanupRichSource=FALSE;
-	   cursor->source=cursor->mask=cursor->richSource=NULL;
-	   cursor->alphaSource=NULL;
-       }
-   }
-   
-}
-
-/* background and foregroud colour have to be set beforehand */
-void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
-{
-   rfbPixelFormat* format=&rfbScreen->serverFormat;
-   int i,j,w=(cursor->width+7)/8,bpp=format->bitsPerPixel/8,
-     width=cursor->width*bpp;
-   uint32_t background;
-   char *back=(char*)&background;
-   unsigned char bit;
-   int interp = 0, db = 0;
-
-   if(cursor->source && cursor->cleanupSource)
-       free(cursor->source);
-   cursor->source=(unsigned char*)calloc(w,cursor->height);
-   cursor->cleanupSource=TRUE;
-   
-   if(format->bigEndian) {
-      back+=4-bpp;
-   }
-
-	/* all zeros means we should interpolate to black+white ourselves */
-	if (!cursor->backRed && !cursor->backGreen && !cursor->backBlue &&
-	    !cursor->foreRed && !cursor->foreGreen && !cursor->foreBlue) {
-		if (format->trueColour && (bpp == 1 || bpp == 2 || bpp == 4)) {
-			interp = 1;
-			cursor->foreRed = cursor->foreGreen = cursor->foreBlue = 0xffff;
-		}
-	}
-
-   background = ((format->redMax   * cursor->backRed)   / 0xffff) << format->redShift   |
-                ((format->greenMax * cursor->backGreen) / 0xffff) << format->greenShift |
-                ((format->blueMax  * cursor->backBlue)  / 0xffff) << format->blueShift;
-
-#define SETRGB(u) \
-   r = (255 * (((format->redMax   << format->redShift)   & (*u)) >> format->redShift))   / format->redMax; \
-   g = (255 * (((format->greenMax << format->greenShift) & (*u)) >> format->greenShift)) / format->greenMax; \
-   b = (255 * (((format->blueMax  << format->blueShift)  & (*u)) >> format->blueShift))  / format->blueMax;
-
-   if (db) fprintf(stderr, "interp: %d\n", interp);
-
-   for(j=0;j<cursor->height;j++) {
-	for(i=0,bit=0x80;i<cursor->width;i++,bit=(bit&1)?0x80:bit>>1) {
-		if (interp) {
-			int r = 0, g = 0, b = 0, grey;
-			unsigned char *p = cursor->richSource+j*width+i*bpp;
-			if (bpp == 1) {
-				unsigned char*  uc = (unsigned char*)  p;
-				SETRGB(uc);
-			} else if (bpp == 2) {
-				unsigned short* us = (unsigned short*) p;
-				SETRGB(us);
-			} else if (bpp == 4) {
-				unsigned int*   ui = (unsigned int*)   p;
-				SETRGB(ui);
-			}
-			grey = (r + g + b) / 3;
-			if (grey >= 128) {
-				cursor->source[j*w+i/8]|=bit;
-				if (db) fprintf(stderr, "1");
-			} else {
-				if (db) fprintf(stderr, "0");
-			}
-			
-		} else if(memcmp(cursor->richSource+j*width+i*bpp, back, bpp)) {
-			cursor->source[j*w+i/8]|=bit;
-		}
-	}
-	if (db) fprintf(stderr, "\n");
-   }
-}
-
-void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor)
-{
-   rfbPixelFormat* format=&rfbScreen->serverFormat;
-   int i,j,w=(cursor->width+7)/8,bpp=format->bitsPerPixel/8;
-   uint32_t background,foreground;
-   char *back=(char*)&background,*fore=(char*)&foreground;
-   unsigned char *cp;
-   unsigned char bit;
-
-   if(cursor->richSource && cursor->cleanupRichSource)
-       free(cursor->richSource);
-   cp=cursor->richSource=(unsigned char*)calloc(cursor->width*bpp,cursor->height);
-   cursor->cleanupRichSource=TRUE;
-   
-   if(format->bigEndian) {
-      back+=4-bpp;
-      fore+=4-bpp;
-   }
-
-   background=cursor->backRed<<format->redShift|
-     cursor->backGreen<<format->greenShift|cursor->backBlue<<format->blueShift;
-   foreground=cursor->foreRed<<format->redShift|
-     cursor->foreGreen<<format->greenShift|cursor->foreBlue<<format->blueShift;
-   
-   for(j=0;j<cursor->height;j++)
-     for(i=0,bit=0x80;i<cursor->width;i++,bit=(bit&1)?0x80:bit>>1,cp+=bpp)
-       if(cursor->source[j*w+i/8]&bit) memcpy(cp,fore,bpp);
-       else memcpy(cp,back,bpp);
-}
-
-/* functions to draw/hide cursor directly in the frame buffer */
-
-void rfbHideCursor(rfbClientPtr cl)
-{
-   rfbScreenInfoPtr s=cl->screen;
-   rfbCursorPtr c=s->cursor;
-   int j,x1,x2,y1,y2,bpp=s->serverFormat.bitsPerPixel/8,
-     rowstride=s->paddedWidthInBytes;
-   LOCK(s->cursorMutex);
-   if(!c) {
-     UNLOCK(s->cursorMutex);
-     return;
-   }
-   
-   /* restore what is under the cursor */
-   x1=cl->cursorX-c->xhot;
-   x2=x1+c->width;
-   if(x1<0) x1=0;
-   if(x2>=s->width) x2=s->width-1;
-   x2-=x1; if(x2<=0) {
-     UNLOCK(s->cursorMutex);
-     return;
-   }
-   y1=cl->cursorY-c->yhot;
-   y2=y1+c->height;
-   if(y1<0) y1=0;
-   if(y2>=s->height) y2=s->height-1;
-   y2-=y1; if(y2<=0) {
-     UNLOCK(s->cursorMutex);
-     return;
-   }
-
-   /* get saved data */
-   for(j=0;j<y2;j++)
-     memcpy(s->frameBuffer+(y1+j)*rowstride+x1*bpp,
-	    s->underCursorBuffer+j*x2*bpp,
-	    x2*bpp);
-
-   /* Copy to all scaled versions */
-   rfbScaledScreenUpdate(s, x1, y1, x1+x2, y1+y2);
-   
-   UNLOCK(s->cursorMutex);
-}
-
-void rfbShowCursor(rfbClientPtr cl)
-{
-   rfbScreenInfoPtr s=cl->screen;
-   rfbCursorPtr c=s->cursor;
-   int i,j,x1,x2,y1,y2,i1,j1,bpp=s->serverFormat.bitsPerPixel/8,
-     rowstride=s->paddedWidthInBytes,
-     bufSize,w;
-   rfbBool wasChanged=FALSE;
-
-   if(!c) return;
-   LOCK(s->cursorMutex);
-
-   bufSize=c->width*c->height*bpp;
-   w=(c->width+7)/8;
-   if(s->underCursorBufferLen<bufSize) {
-      if(s->underCursorBuffer!=NULL)
-	free(s->underCursorBuffer);
-      s->underCursorBuffer=malloc(bufSize);
-      s->underCursorBufferLen=bufSize;
-   }
-
-   /* save what is under the cursor */
-   i1=j1=0; /* offset in cursor */
-   x1=cl->cursorX-c->xhot;
-   x2=x1+c->width;
-   if(x1<0) { i1=-x1; x1=0; }
-   if(x2>=s->width) x2=s->width-1;
-   x2-=x1; if(x2<=0) {
-     UNLOCK(s->cursorMutex);
-     return; /* nothing to do */
-   }
-
-   y1=cl->cursorY-c->yhot;
-   y2=y1+c->height;
-   if(y1<0) { j1=-y1; y1=0; }
-   if(y2>=s->height) y2=s->height-1;
-   y2-=y1; if(y2<=0) {
-     UNLOCK(s->cursorMutex);
-     return; /* nothing to do */
-   }
-
-   /* save data */
-   for(j=0;j<y2;j++) {
-     char* dest=s->underCursorBuffer+j*x2*bpp;
-     const char* src=s->frameBuffer+(y1+j)*rowstride+x1*bpp;
-     unsigned int count=x2*bpp;
-     if(wasChanged || memcmp(dest,src,count)) {
-       wasChanged=TRUE;
-       memcpy(dest,src,count);
-     }
-   }
-   
-   if(!c->richSource)
-     rfbMakeRichCursorFromXCursor(s,c);
-  
-   if (c->alphaSource) {
-	int rmax, rshift;
-	int gmax, gshift;
-	int bmax, bshift;
-	int amax = 255;	/* alphaSource is always 8bits of info per pixel */
-	unsigned int rmask, gmask, bmask;
-
-	rmax   = s->serverFormat.redMax;
-	gmax   = s->serverFormat.greenMax;
-	bmax   = s->serverFormat.blueMax;
-	rshift = s->serverFormat.redShift;
-	gshift = s->serverFormat.greenShift;
-	bshift = s->serverFormat.blueShift;
-
-	rmask = (rmax << rshift);
-	gmask = (gmax << gshift);
-	bmask = (bmax << bshift);
-
-	for(j=0;j<y2;j++) {
-		for(i=0;i<x2;i++) {
-			/*
-			 * we loop over the whole cursor ignoring c->mask[],
-			 * using the extracted alpha value instead.
-			 */
-			char *dest;
-			unsigned char *src, *aptr;
-			unsigned int val, dval, sval;
-			int rdst, gdst, bdst;		/* fb RGB */
-			int asrc, rsrc, gsrc, bsrc;	/* rich source ARGB */
-
-			dest = s->frameBuffer + (j+y1)*rowstride + (i+x1)*bpp;
-			src  = c->richSource  + (j+j1)*c->width*bpp + (i+i1)*bpp;
-			aptr = c->alphaSource + (j+j1)*c->width + (i+i1);
-
-			asrc = *aptr;
-			if (!asrc) {
-				continue;
-			}
-
-			if (bpp == 1) {
-				dval = *((unsigned char*) dest);
-				sval = *((unsigned char*) src);
-			} else if (bpp == 2) {
-				dval = *((unsigned short*) dest);
-				sval = *((unsigned short*) src);
-			} else if (bpp == 3) {
-				unsigned char *dst = (unsigned char *) dest;
-				dval = 0;
-				dval |= ((*(dst+0)) << 0);
-				dval |= ((*(dst+1)) << 8);
-				dval |= ((*(dst+2)) << 16);
-				sval = 0;
-				sval |= ((*(src+0)) << 0);
-				sval |= ((*(src+1)) << 8);
-				sval |= ((*(src+2)) << 16);
-			} else if (bpp == 4) {
-				dval = *((unsigned int*) dest);
-				sval = *((unsigned int*) src);
-			} else {
-				continue;
-			}
-
-			/* extract dest and src RGB */
-			rdst = (dval & rmask) >> rshift;	/* fb */
-			gdst = (dval & gmask) >> gshift;
-			bdst = (dval & bmask) >> bshift;
-
-			rsrc = (sval & rmask) >> rshift;	/* richcursor */
-			gsrc = (sval & gmask) >> gshift;
-			bsrc = (sval & bmask) >> bshift;
-
-			/* blend in fb data. */
-			if (! c->alphaPreMultiplied) {
-				rsrc = (asrc * rsrc)/amax;
-				gsrc = (asrc * gsrc)/amax;
-				bsrc = (asrc * bsrc)/amax;
-			}
-			rdst = rsrc + ((amax - asrc) * rdst)/amax;
-			gdst = gsrc + ((amax - asrc) * gdst)/amax;
-			bdst = bsrc + ((amax - asrc) * bdst)/amax;
-
-			val = 0;
-			val |= (rdst << rshift);
-			val |= (gdst << gshift);
-			val |= (bdst << bshift);
-
-			/* insert the cooked pixel into the fb */
-			memcpy(dest, &val, bpp);
-		}
-	}
-   } else {
-      /* now the cursor has to be drawn */
-      for(j=0;j<y2;j++)
-        for(i=0;i<x2;i++)
-          if((c->mask[(j+j1)*w+(i+i1)/8]<<((i+i1)&7))&0x80)
-   	 memcpy(s->frameBuffer+(j+y1)*rowstride+(i+x1)*bpp,
-   		c->richSource+(j+j1)*c->width*bpp+(i+i1)*bpp,bpp);
-   }
-
-   /* Copy to all scaled versions */
-   rfbScaledScreenUpdate(s, x1, y1, x1+x2, y1+y2);
-
-   UNLOCK(s->cursorMutex);
-}
-
-/* 
- * If enableCursorShapeUpdates is FALSE, and the cursor is hidden, make sure
- * that if the frameBuffer was transmitted with a cursor drawn, then that
- * region gets redrawn.
- */
-
-void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion)
-{
-    rfbScreenInfoPtr s = cl->screen;
-    rfbCursorPtr c = s->cursor;
-    
-    if(c) {
-	int x,y,x2,y2;
-
-	x = cl->cursorX-c->xhot;
-	y = cl->cursorY-c->yhot;
-	x2 = x+c->width;
-	y2 = y+c->height;
-
-	if(sraClipRect2(&x,&y,&x2,&y2,0,0,s->width,s->height)) {
-	    sraRegionPtr rect;
-	    rect = sraRgnCreateRect(x,y,x2,y2);
-	    if(updateRegion) {
-	    	sraRgnOr(updateRegion,rect);
-	    } else {
-		    LOCK(cl->updateMutex);
-		    sraRgnOr(cl->modifiedRegion,rect);
-		    UNLOCK(cl->updateMutex);
-	    }
-	    sraRgnDestroy(rect);
-	}
-    }
-}
-
-#ifdef DEBUG
-
-static void rfbPrintXCursor(rfbCursorPtr cursor)
-{
-   int i,i1,j,w=(cursor->width+7)/8;
-   unsigned char bit;
-   for(j=0;j<cursor->height;j++) {
-      for(i=0,i1=0,bit=0x80;i1<cursor->width;i1++,i+=(bit&1)?1:0,bit=(bit&1)?0x80:bit>>1)
-	if(cursor->source[j*w+i]&bit) putchar('#'); else putchar(' ');
-      putchar(':');
-      for(i=0,i1=0,bit=0x80;i1<cursor->width;i1++,i+=(bit&1)?1:0,bit=(bit&1)?0x80:bit>>1)
-	if(cursor->mask[j*w+i]&bit) putchar('#'); else putchar(' ');
-      putchar('\n');
-   }
-}
-
-#endif
-
-void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c)
-{
-  rfbClientIteratorPtr iterator;
-  rfbClientPtr cl;
-
-  LOCK(rfbScreen->cursorMutex);
-
-  if(rfbScreen->cursor) {
-    iterator=rfbGetClientIterator(rfbScreen);
-    while((cl=rfbClientIteratorNext(iterator)))
-	if(!cl->enableCursorShapeUpdates)
-	  rfbRedrawAfterHideCursor(cl,NULL);
-    rfbReleaseClientIterator(iterator);
-
-    if(rfbScreen->cursor->cleanup)
-	 rfbFreeCursor(rfbScreen->cursor);
-  }
-
-  rfbScreen->cursor = c;
-
-  iterator=rfbGetClientIterator(rfbScreen);
-  while((cl=rfbClientIteratorNext(iterator))) {
-    cl->cursorWasChanged = TRUE;
-    if(!cl->enableCursorShapeUpdates)
-      rfbRedrawAfterHideCursor(cl,NULL);
-  }
-  rfbReleaseClientIterator(iterator);
-
-  UNLOCK(rfbScreen->cursorMutex);
-}
-
diff --git a/ica/x11/libvncserver/cutpaste.c b/ica/x11/libvncserver/cutpaste.c
deleted file mode 100644
index 6a9dcb9..0000000
--- a/ica/x11/libvncserver/cutpaste.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * cutpaste.c - routines to deal with cut & paste buffers / selection.
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-
-
-/*
- * rfbSetXCutText sets the cut buffer to be the given string.  We also clear
- * the primary selection.  Ideally we'd like to set it to the same thing, but I
- * can't work out how to do that without some kind of helper X client.
- */
-
-void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len)
-{
-   rfbSendServerCutText(rfbScreen, str, len);
-}
diff --git a/ica/x11/libvncserver/draw.c b/ica/x11/libvncserver/draw.c
deleted file mode 100644
index 7e1ed49..0000000
--- a/ica/x11/libvncserver/draw.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <rfb/rfb.h>
-
-void rfbFillRect(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col)
-{
-  int rowstride = s->paddedWidthInBytes, bpp = s->bitsPerPixel>>3;
-  int i,j;
-  char* colour=(char*)&col;
-
-   if(!rfbEndianTest)
-    colour += 4-bpp;
-  for(j=y1;j<y2;j++)
-    for(i=x1;i<x2;i++)
-      memcpy(s->frameBuffer+j*rowstride+i*bpp,colour,bpp);
-  rfbMarkRectAsModified(s,x1,y1,x2,y2);
-}
-
-#define SETPIXEL(x,y) \
-  memcpy(s->frameBuffer+(y)*rowstride+(x)*bpp,colour,bpp)
-
-void rfbDrawPixel(rfbScreenInfoPtr s,int x,int y,rfbPixel col)
-{
-  int rowstride = s->paddedWidthInBytes, bpp = s->bitsPerPixel>>3;
-  char* colour=(char*)&col;
-
-  if(!rfbEndianTest)
-    colour += 4-bpp;
-  SETPIXEL(x,y);
-  rfbMarkRectAsModified(s,x,y,x+1,y+1);
-}
-
-void rfbDrawLine(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col)
-{
-  int rowstride = s->paddedWidthInBytes, bpp = s->bitsPerPixel>>3;
-  int i;
-  char* colour=(char*)&col;
-
-  if(!rfbEndianTest)
-    colour += 4-bpp;
-
-#define SWAPPOINTS { i=x1; x1=x2; x2=i; i=y1; y1=y2; y2=i; }
-  if(abs(x1-x2)<abs(y1-y2)) {
-    if(y1>y2)
-      SWAPPOINTS
-    for(i=y1;i<=y2;i++)
-      SETPIXEL(x1+(i-y1)*(x2-x1)/(y2-y1),i);
-    /* TODO: Maybe make this more intelligently? */
-    if(x2<x1) { i=x1; x1=x2; x2=i; }
-    rfbMarkRectAsModified(s,x1,y1,x2+1,y2+1);
-  } else {
-    if(x1>x2)
-      SWAPPOINTS
-    else if(x1==x2) {
-      rfbDrawPixel(s,x1,y1,col);
-      return;
-    }
-    for(i=x1;i<=x2;i++)
-      SETPIXEL(i,y1+(i-x1)*(y2-y1)/(x2-x1));
-    if(y2<y1) { i=y1; y1=y2; y2=i; }
-    rfbMarkRectAsModified(s,x1,y1,x2+1,y2+1);
-  }
-}
diff --git a/ica/x11/libvncserver/font.c b/ica/x11/libvncserver/font.c
deleted file mode 100644
index a9091d2..0000000
--- a/ica/x11/libvncserver/font.c
+++ /dev/null
@@ -1,196 +0,0 @@
-#include <rfb/rfb.h>
-
-int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
-		 int x,int y,unsigned char c,rfbPixel col)
-{
-  int i,j,width,height;
-  unsigned char* data=font->data+font->metaData[c*5];
-  unsigned char d=*data;
-  int rowstride=rfbScreen->paddedWidthInBytes;
-  int bpp=rfbScreen->serverFormat.bitsPerPixel/8;
-  char *colour=(char*)&col;
-
-  if(!rfbEndianTest)
-    colour += 4-bpp;
-
-  width=font->metaData[c*5+1];
-  height=font->metaData[c*5+2];
-  x+=font->metaData[c*5+3];
-  y+=-font->metaData[c*5+4]-height+1;
-
-  for(j=0;j<height;j++) {
-    for(i=0;i<width;i++) {
-      if((i&7)==0) {
-	d=*data;
-	data++;
-      }
-      if(d&0x80 && y+j >= 0 && y+j < rfbScreen->height &&
-          x+i >= 0 && x+i < rfbScreen->width)
-	memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,colour,bpp);
-      d<<=1;
-    }
-    /* if((i&7)!=0) data++; */
-  }
-  return(width);
-}
-
-void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
-		   int x,int y,const char* string,rfbPixel colour)
-{
-  while(*string) {
-    x+=rfbDrawChar(rfbScreen,font,x,y,*string,colour);
-    string++;
-  }
-}
-
-/* TODO: these two functions need to be more efficient */
-/* if col==bcol, assume transparent background */
-int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
-			int x,int y,unsigned char c,
-			int x1,int y1,int x2,int y2,
-			rfbPixel col,rfbPixel bcol)
-{
-  int i,j,width,height;
-  unsigned char* data=font->data+font->metaData[c*5];
-  unsigned char d;
-  int rowstride=rfbScreen->paddedWidthInBytes;
-  int bpp=rfbScreen->serverFormat.bitsPerPixel/8,extra_bytes=0;
-  char* colour=(char*)&col;
-  char* bcolour=(char*)&bcol;
-
-  if(!rfbEndianTest) {
-    colour+=4-bpp;
-    bcolour+=4-bpp;
-  }
-
-  width=font->metaData[c*5+1];
-  height=font->metaData[c*5+2];
-  x+=font->metaData[c*5+3];
-  y+=-font->metaData[c*5+4]-height+1;
-
-  /* after clipping, x2 will be count of bytes between rows,
-   * x1 start of i, y1 start of j, width and height will be adjusted. */
-  if(y1>y) { y1-=y; data+=(width+7)/8; height-=y1; y+=y1; } else y1=0;
-  if(x1>x) { x1-=x; data+=x1; width-=x1; x+=x1; extra_bytes+=x1/8; } else x1=0;
-  if(y2<y+height) height-=y+height-y2;
-  if(x2<x+width) { extra_bytes+=(x1+width)/8-(x+width-x2+7)/8; width-=x+width-x2; }
-
-  d=*data;
-  for(j=y1;j<height;j++) {
-    if((x1&7)!=0)
-      d=data[-1]; /* TODO: check if in this case extra_bytes is correct! */
-    for(i=x1;i<width;i++) {
-      if((i&7)==0) {
-	d=*data;
-	data++;
-      }
-      /* if(x+i>=x1 && x+i<x2 && y+j>=y1 && y+j<y2) */ {
-	 if(d&0x80) {
-	   memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,
-		  colour,bpp);
-	 } else if(bcol!=col) {
-	   memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,
-		  bcolour,bpp);
-	 }
-      }
-      d<<=1;
-    }
-    /* if((i&7)==0) data++; */
-    data += extra_bytes;
-  }
-  return(width);
-}
-
-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)
-{
-  while(*string) {
-    x+=rfbDrawCharWithClip(rfbScreen,font,x,y,*string,x1,y1,x2,y2,
-			   colour,backColour);
-    string++;
-  }
-}
-
-int rfbWidthOfString(rfbFontDataPtr font,const char* string)
-{
-  int i=0;
-  while(*string) {
-    i+=font->metaData[*string*5+1];
-    string++;
-  }
-  return(i);
-}
-
-int rfbWidthOfChar(rfbFontDataPtr font,unsigned char c)
-{
-  return(font->metaData[c*5+1]+font->metaData[c*5+3]);
-}
-
-void rfbFontBBox(rfbFontDataPtr font,unsigned char c,int* x1,int* y1,int* x2,int* y2)
-{
-  *x1+=font->metaData[c*5+3];
-  *y1+=-font->metaData[c*5+4]-font->metaData[c*5+2]+1;
-  *x2=*x1+font->metaData[c*5+1]+1;
-  *y2=*y1+font->metaData[c*5+2]+1;
-}
-
-#ifndef INT_MAX
-#define INT_MAX 0x7fffffff
-#endif
-
-void rfbWholeFontBBox(rfbFontDataPtr font,
-		      int *x1, int *y1, int *x2, int *y2)
-{
-   int i;
-   int* m=font->metaData;
-   
-   (*x1)=(*y1)=INT_MAX; (*x2)=(*y2)=1-(INT_MAX);
-   for(i=0;i<256;i++) {
-      if(m[i*5+1]-m[i*5+3]>(*x2))
-	(*x2)=m[i*5+1]-m[i*5+3];
-      if(-m[i*5+2]+m[i*5+4]<(*y1))
-	(*y1)=-m[i*5+2]+m[i*5+4];
-      if(m[i*5+3]<(*x1))
-	(*x1)=m[i*5+3];
-      if(-m[i*5+4]>(*y2))
-	(*y2)=-m[i*5+4];
-   }
-   (*x2)++;
-   (*y2)++;
-}
-
-rfbFontDataPtr rfbLoadConsoleFont(char *filename)
-{
-  FILE *f=fopen(filename,"rb");
-  rfbFontDataPtr p;
-  int i;
-
-  if(!f) return NULL;
-
-  p=(rfbFontDataPtr)malloc(sizeof(rfbFontData));
-  p->data=(unsigned char*)malloc(4096);
-  if(1!=fread(p->data,4096,1,f)) {
-    free(p->data);
-    free(p);
-    return NULL;
-  }
-  fclose(f);
-  p->metaData=(int*)malloc(256*5*sizeof(int));
-  for(i=0;i<256;i++) {
-    p->metaData[i*5+0]=i*16; /* offset */
-    p->metaData[i*5+1]=8; /* width */
-    p->metaData[i*5+2]=16; /* height */
-    p->metaData[i*5+3]=0; /* xhot */
-    p->metaData[i*5+4]=0; /* yhot */
-  }
-  return(p);
-}
-
-void rfbFreeFont(rfbFontDataPtr f)
-{
-  free(f->data);
-  free(f->metaData);
-  free(f);
-}
diff --git a/ica/x11/libvncserver/hextile.c b/ica/x11/libvncserver/hextile.c
deleted file mode 100644
index 52920d8..0000000
--- a/ica/x11/libvncserver/hextile.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * hextile.c
- *
- * Routines to implement Hextile Encoding
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-
-static rfbBool sendHextiles8(rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool sendHextiles16(rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool sendHextiles32(rfbClientPtr cl, int x, int y, int w, int h);
-
-
-/*
- * rfbSendRectEncodingHextile - send a rectangle using hextile encoding.
- */
-
-rfbBool
-rfbSendRectEncodingHextile(rfbClientPtr cl,
-                           int x,
-                           int y,
-                           int w,
-                           int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(rfbEncodingHextile);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-           sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingHextile,
-          sz_rfbFramebufferUpdateRectHeader,
-          sz_rfbFramebufferUpdateRectHeader + w * (cl->format.bitsPerPixel / 8) * h);
-
-    switch (cl->format.bitsPerPixel) {
-    case 8:
-        return sendHextiles8(cl, x, y, w, h);
-    case 16:
-        return sendHextiles16(cl, x, y, w, h);
-    case 32:
-        return sendHextiles32(cl, x, y, w, h);
-    }
-
-    rfbLog("rfbSendRectEncodingHextile: bpp %d?\n", cl->format.bitsPerPixel);
-    return FALSE;
-}
-
-
-#define PUT_PIXEL8(pix) (cl->updateBuf[cl->ublen++] = (pix))
-
-#define PUT_PIXEL16(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \
-                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1])
-
-#define PUT_PIXEL32(pix) (cl->updateBuf[cl->ublen++] = ((char*)&(pix))[0], \
-                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[1], \
-                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[2], \
-                          cl->updateBuf[cl->ublen++] = ((char*)&(pix))[3])
-
-
-#define DEFINE_SEND_HEXTILES(bpp)                                               \
-                                                                                \
-                                                                                \
-static rfbBool subrectEncode##bpp(rfbClientPtr cli, uint##bpp##_t *data,        \
-		int w, int h, uint##bpp##_t bg, uint##bpp##_t fg, rfbBool mono);\
-static void testColours##bpp(uint##bpp##_t *data, int size, rfbBool *mono,      \
-                  rfbBool *solid, uint##bpp##_t *bg, uint##bpp##_t *fg);        \
-                                                                                \
-                                                                                \
-/*                                                                              \
- * rfbSendHextiles                                                              \
- */                                                                             \
-                                                                                \
-static rfbBool                                                                  \
-sendHextiles##bpp(rfbClientPtr cl, int rx, int ry, int rw, int rh) {            \
-    int x, y, w, h;                                                             \
-    int startUblen;                                                             \
-    char *fbptr;                                                                \
-    uint##bpp##_t bg = 0, fg = 0, newBg, newFg;                                 \
-    rfbBool mono, solid;                                                        \
-    rfbBool validBg = FALSE;                                                    \
-    rfbBool validFg = FALSE;                                                    \
-    uint##bpp##_t clientPixelData[16*16*(bpp/8)];                               \
-                                                                                \
-    for (y = ry; y < ry+rh; y += 16) {                                          \
-        for (x = rx; x < rx+rw; x += 16) {                                      \
-            w = h = 16;                                                         \
-            if (rx+rw - x < 16)                                                 \
-                w = rx+rw - x;                                                  \
-            if (ry+rh - y < 16)                                                 \
-                h = ry+rh - y;                                                  \
-                                                                                \
-            if ((cl->ublen + 1 + (2 + 16 * 16) * (bpp/8)) >                     \
-                UPDATE_BUF_SIZE) {                                              \
-                if (!rfbSendUpdateBuf(cl))                                      \
-                    return FALSE;                                               \
-            }                                                                   \
-                                                                                \
-            fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)   \
-                     + (x * (cl->scaledScreen->bitsPerPixel / 8)));                   \
-                                                                                \
-            (*cl->translateFn)(cl->translateLookupTable, &(cl->screen->serverFormat),      \
-                               &cl->format, fbptr, (char *)clientPixelData,     \
-                               cl->scaledScreen->paddedWidthInBytes, w, h);           \
-                                                                                \
-            startUblen = cl->ublen;                                             \
-            cl->updateBuf[startUblen] = 0;                                      \
-            cl->ublen++;                                                        \
-            rfbStatRecordEncodingSentAdd(cl, rfbEncodingHextile, 1);            \
-                                                                                \
-            testColours##bpp(clientPixelData, w * h,                            \
-                             &mono, &solid, &newBg, &newFg);                    \
-                                                                                \
-            if (!validBg || (newBg != bg)) {                                    \
-                validBg = TRUE;                                                 \
-                bg = newBg;                                                     \
-                cl->updateBuf[startUblen] |= rfbHextileBackgroundSpecified;     \
-                PUT_PIXEL##bpp(bg);                                             \
-            }                                                                   \
-                                                                                \
-            if (solid) {                                                        \
-                continue;                                                       \
-            }                                                                   \
-                                                                                \
-            cl->updateBuf[startUblen] |= rfbHextileAnySubrects;                 \
-                                                                                \
-            if (mono) {                                                         \
-                if (!validFg || (newFg != fg)) {                                \
-                    validFg = TRUE;                                             \
-                    fg = newFg;                                                 \
-                    cl->updateBuf[startUblen] |= rfbHextileForegroundSpecified; \
-                    PUT_PIXEL##bpp(fg);                                         \
-                }                                                               \
-            } else {                                                            \
-                validFg = FALSE;                                                \
-                cl->updateBuf[startUblen] |= rfbHextileSubrectsColoured;        \
-            }                                                                   \
-                                                                                \
-            if (!subrectEncode##bpp(cl, clientPixelData, w, h, bg, fg, mono)) { \
-                /* encoding was too large, use raw */                           \
-                validBg = FALSE;                                                \
-                validFg = FALSE;                                                \
-                cl->ublen = startUblen;                                         \
-                cl->updateBuf[cl->ublen++] = rfbHextileRaw;                     \
-                (*cl->translateFn)(cl->translateLookupTable,                    \
-                                   &(cl->screen->serverFormat), &cl->format, fbptr,        \
-                                   (char *)clientPixelData,                     \
-                                   cl->scaledScreen->paddedWidthInBytes, w, h); \
-                                                                                \
-                memcpy(&cl->updateBuf[cl->ublen], (char *)clientPixelData,      \
-                       w * h * (bpp/8));                                        \
-                                                                                \
-                cl->ublen += w * h * (bpp/8);                                   \
-                rfbStatRecordEncodingSentAdd(cl, rfbEncodingHextile,            \
-                             w * h * (bpp/8));                                  \
-            }                                                                   \
-        }                                                                       \
-    }                                                                           \
-                                                                                \
-    return TRUE;                                                                \
-}                                                                               \
-                                                                                \
-                                                                                \
-static rfbBool                                                                  \
-subrectEncode##bpp(rfbClientPtr cl, uint##bpp##_t *data, int w, int h,          \
-                   uint##bpp##_t bg, uint##bpp##_t fg, rfbBool mono)            \
-{                                                                               \
-    uint##bpp##_t cl2;                                                          \
-    int x,y;                                                                    \
-    int i,j;                                                                    \
-    int hx=0,hy,vx=0,vy;                                                        \
-    int hyflag;                                                                 \
-    uint##bpp##_t *seg;                                                         \
-    uint##bpp##_t *line;                                                        \
-    int hw,hh,vw,vh;                                                            \
-    int thex,they,thew,theh;                                                    \
-    int numsubs = 0;                                                            \
-    int newLen;                                                                 \
-    int nSubrectsUblen;                                                         \
-                                                                                \
-    nSubrectsUblen = cl->ublen;                                                 \
-    cl->ublen++;                                                                \
-    rfbStatRecordEncodingSentAdd(cl, rfbEncodingHextile, 1);                    \
-                                                                                \
-    for (y=0; y<h; y++) {                                                       \
-        line = data+(y*w);                                                      \
-        for (x=0; x<w; x++) {                                                   \
-            if (line[x] != bg) {                                                \
-                cl2 = line[x];                                                  \
-                hy = y-1;                                                       \
-                hyflag = 1;                                                     \
-                for (j=y; j<h; j++) {                                           \
-                    seg = data+(j*w);                                           \
-                    if (seg[x] != cl2) {break;}                                 \
-                    i = x;                                                      \
-                    while ((seg[i] == cl2) && (i < w)) i += 1;                  \
-                    i -= 1;                                                     \
-                    if (j == y) vx = hx = i;                                    \
-                    if (i < vx) vx = i;                                         \
-                    if ((hyflag > 0) && (i >= hx)) {                            \
-                        hy += 1;                                                \
-                    } else {                                                    \
-                        hyflag = 0;                                             \
-                    }                                                           \
-                }                                                               \
-                vy = j-1;                                                       \
-                                                                                \
-                /* We now have two possible subrects: (x,y,hx,hy) and           \
-                 * (x,y,vx,vy).  We'll choose the bigger of the two.            \
-                 */                                                             \
-                hw = hx-x+1;                                                    \
-                hh = hy-y+1;                                                    \
-                vw = vx-x+1;                                                    \
-                vh = vy-y+1;                                                    \
-                                                                                \
-                thex = x;                                                       \
-                they = y;                                                       \
-                                                                                \
-                if ((hw*hh) > (vw*vh)) {                                        \
-                    thew = hw;                                                  \
-                    theh = hh;                                                  \
-                } else {                                                        \
-                    thew = vw;                                                  \
-                    theh = vh;                                                  \
-                }                                                               \
-                                                                                \
-                if (mono) {                                                     \
-                    newLen = cl->ublen - nSubrectsUblen + 2;                    \
-                } else {                                                        \
-                    newLen = cl->ublen - nSubrectsUblen + bpp/8 + 2;            \
-                }                                                               \
-                                                                                \
-                if (newLen > (w * h * (bpp/8)))                                 \
-                    return FALSE;                                               \
-                                                                                \
-                numsubs += 1;                                                   \
-                                                                                \
-                if (!mono) PUT_PIXEL##bpp(cl2);                                 \
-                                                                                \
-                cl->updateBuf[cl->ublen++] = rfbHextilePackXY(thex,they);       \
-                cl->updateBuf[cl->ublen++] = rfbHextilePackWH(thew,theh);       \
-                rfbStatRecordEncodingSentAdd(cl, rfbEncodingHextile, 1);        \
-                                                                                \
-                /*                                                              \
-                 * Now mark the subrect as done.                                \
-                 */                                                             \
-                for (j=they; j < (they+theh); j++) {                            \
-                    for (i=thex; i < (thex+thew); i++) {                        \
-                        data[j*w+i] = bg;                                       \
-                    }                                                           \
-                }                                                               \
-            }                                                                   \
-        }                                                                       \
-    }                                                                           \
-                                                                                \
-    cl->updateBuf[nSubrectsUblen] = numsubs;                                    \
-                                                                                \
-    return TRUE;                                                                \
-}                                                                               \
-                                                                                \
-                                                                                \
-/*                                                                              \
- * testColours() tests if there are one (solid), two (mono) or more             \
- * colours in a tile and gets a reasonable guess at the best background         \
- * pixel, and the foreground pixel for mono.                                    \
- */                                                                             \
-                                                                                \
-static void                                                                     \
-testColours##bpp(uint##bpp##_t *data, int size, rfbBool *mono, rfbBool *solid,  \
-                 uint##bpp##_t *bg, uint##bpp##_t *fg) {                        \
-    uint##bpp##_t colour1 = 0, colour2 = 0;                                     \
-    int n1 = 0, n2 = 0;                                                         \
-    *mono = TRUE;                                                               \
-    *solid = TRUE;                                                              \
-                                                                                \
-    for (; size > 0; size--, data++) {                                          \
-                                                                                \
-        if (n1 == 0)                                                            \
-            colour1 = *data;                                                    \
-                                                                                \
-        if (*data == colour1) {                                                 \
-            n1++;                                                               \
-            continue;                                                           \
-        }                                                                       \
-                                                                                \
-        if (n2 == 0) {                                                          \
-            *solid = FALSE;                                                     \
-            colour2 = *data;                                                    \
-        }                                                                       \
-                                                                                \
-        if (*data == colour2) {                                                 \
-            n2++;                                                               \
-            continue;                                                           \
-        }                                                                       \
-                                                                                \
-        *mono = FALSE;                                                          \
-        break;                                                                  \
-    }                                                                           \
-                                                                                \
-    if (n1 > n2) {                                                              \
-        *bg = colour1;                                                          \
-        *fg = colour2;                                                          \
-    } else {                                                                    \
-        *bg = colour2;                                                          \
-        *fg = colour1;                                                          \
-    }                                                                           \
-}
-
-DEFINE_SEND_HEXTILES(8)
-DEFINE_SEND_HEXTILES(16)
-DEFINE_SEND_HEXTILES(32)
diff --git a/ica/x11/libvncserver/httpd.c b/ica/x11/libvncserver/httpd.c
deleted file mode 100644
index 792a52b..0000000
--- a/ica/x11/libvncserver/httpd.c
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * httpd.c - a simple HTTP server
- */
-
-/*
- *  Copyright (C) 2011-2012 Christian Beier <dontmind at freeshell.org>
- *  Copyright (C) 2002 RealVNC Ltd.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#define _POSIX_SOURCE
-#endif
-
-#include <rfb/rfb.h>
-
-#include <ctype.h>
-#ifdef LIBVNCSERVER_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#include <errno.h>
-
-#ifdef WIN32
-#include <winsock.h>
-#define close closesocket
-#else
-#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#endif
-#include <pwd.h>
-#endif
-
-#ifdef USE_LIBWRAP
-#include <tcpd.h>
-#endif
-
-
-#define NOT_FOUND_STR "HTTP/1.0 404 Not found\r\nConnection: close\r\n\r\n" \
-    "<HEAD><TITLE>File Not Found</TITLE></HEAD>\n" \
-    "<BODY><H1>File Not Found</H1></BODY>\n"
-
-#define INVALID_REQUEST_STR "HTTP/1.0 400 Invalid Request\r\nConnection: close\r\n\r\n" \
-    "<HEAD><TITLE>Invalid Request</TITLE></HEAD>\n" \
-    "<BODY><H1>Invalid request</H1></BODY>\n"
-
-#define OK_STR "HTTP/1.0 200 OK\r\nConnection: close\r\n\r\n"
-#define OK_STR_HTML "HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n"
-
-
-
-static void httpProcessInput(rfbScreenInfoPtr screen);
-static rfbBool compareAndSkip(char **ptr, const char *str);
-static rfbBool parseParams(const char *request, char *result, int max_bytes);
-static rfbBool validateString(char *str);
-
-#define BUF_SIZE 32768
-
-static char buf[BUF_SIZE];
-static size_t buf_filled=0;
-
-/*
- * httpInitSockets sets up the TCP socket to listen for HTTP connections.
- */
-
-void
-rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen)
-{
-    if (rfbScreen->httpInitDone)
-	return;
-
-    rfbScreen->httpInitDone = TRUE;
-
-    if (!rfbScreen->httpDir)
-	return;
-
-    if (rfbScreen->httpPort == 0) {
-	rfbScreen->httpPort = rfbScreen->port-100;
-    }
-
-    if ((rfbScreen->httpListenSock =
-      rfbListenOnTCPPort(rfbScreen->httpPort, rfbScreen->listenInterface)) < 0) {
-	rfbLogPerror("ListenOnTCPPort");
-	return;
-    }
-    rfbLog("Listening for HTTP connections on TCP port %d\n", rfbScreen->httpPort);
-    rfbLog("  URL http://%s:%d\n",rfbScreen->thisHost,rfbScreen->httpPort);
-
-#ifdef LIBVNCSERVER_IPv6
-    if (rfbScreen->http6Port == 0) {
-	rfbScreen->http6Port = rfbScreen->ipv6port-100;
-    }
-
-    if ((rfbScreen->httpListen6Sock
-	 = rfbListenOnTCP6Port(rfbScreen->http6Port, rfbScreen->listen6Interface)) < 0) {
-      /* ListenOnTCP6Port has its own detailed error printout */
-      return;
-    }
-    rfbLog("Listening for HTTP connections on TCP6 port %d\n", rfbScreen->http6Port);
-    rfbLog("  URL http://%s:%d\n",rfbScreen->thisHost,rfbScreen->http6Port);
-#endif
-}
-
-void rfbHttpShutdownSockets(rfbScreenInfoPtr rfbScreen) {
-    if(rfbScreen->httpSock>-1) {
-	close(rfbScreen->httpSock);
-	FD_CLR(rfbScreen->httpSock,&rfbScreen->allFds);
-	rfbScreen->httpSock=-1;
-    }
-
-    if(rfbScreen->httpListenSock>-1) {
-	close(rfbScreen->httpListenSock);
-	FD_CLR(rfbScreen->httpListenSock,&rfbScreen->allFds);
-	rfbScreen->httpListenSock=-1;
-    }
-
-    if(rfbScreen->httpListen6Sock>-1) {
-	close(rfbScreen->httpListen6Sock);
-	FD_CLR(rfbScreen->httpListen6Sock,&rfbScreen->allFds);
-	rfbScreen->httpListen6Sock=-1;
-    }
-}
-
-/*
- * httpCheckFds is called from ProcessInputEvents to check for input on the
- * HTTP socket(s).  If there is input to process, httpProcessInput is called.
- */
-
-void
-rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
-{
-    int nfds;
-    fd_set fds;
-    struct timeval tv;
-#ifdef LIBVNCSERVER_IPv6
-    struct sockaddr_storage addr;
-#else
-    struct sockaddr_in addr;
-#endif
-    socklen_t addrlen = sizeof(addr);
-
-    if (!rfbScreen->httpDir)
-	return;
-
-    if (rfbScreen->httpListenSock < 0)
-	return;
-
-    FD_ZERO(&fds);
-    FD_SET(rfbScreen->httpListenSock, &fds);
-    if (rfbScreen->httpListen6Sock >= 0) {
-	FD_SET(rfbScreen->httpListen6Sock, &fds);
-    }
-    if (rfbScreen->httpSock >= 0) {
-	FD_SET(rfbScreen->httpSock, &fds);
-    }
-    tv.tv_sec = 0;
-    tv.tv_usec = 0;
-    nfds = select(max(rfbScreen->httpListen6Sock, max(rfbScreen->httpSock,rfbScreen->httpListenSock)) + 1, &fds, NULL, NULL, &tv);
-    if (nfds == 0) {
-	return;
-    }
-    if (nfds < 0) {
-#ifdef WIN32
-		errno = WSAGetLastError();
-#endif
-	if (errno != EINTR)
-		rfbLogPerror("httpCheckFds: select");
-	return;
-    }
-
-    if ((rfbScreen->httpSock >= 0) && FD_ISSET(rfbScreen->httpSock, &fds)) {
-	httpProcessInput(rfbScreen);
-    }
-
-    if (FD_ISSET(rfbScreen->httpListenSock, &fds) || FD_ISSET(rfbScreen->httpListen6Sock, &fds)) {
-	if (rfbScreen->httpSock >= 0) close(rfbScreen->httpSock);
-
-	if(FD_ISSET(rfbScreen->httpListenSock, &fds)) {
-	    if ((rfbScreen->httpSock = accept(rfbScreen->httpListenSock, (struct sockaddr *)&addr, &addrlen)) < 0) {
-	      rfbLogPerror("httpCheckFds: accept");
-	      return;
-	    }
-	}
-	else if(FD_ISSET(rfbScreen->httpListen6Sock, &fds)) {
-	    if ((rfbScreen->httpSock = accept(rfbScreen->httpListen6Sock, (struct sockaddr *)&addr, &addrlen)) < 0) {
-	      rfbLogPerror("httpCheckFds: accept");
-	      return;
-	    }
-	}
-
-#ifdef USE_LIBWRAP
-	char host[1024];
-#ifdef LIBVNCSERVER_IPv6
-	if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
-	  rfbLogPerror("httpCheckFds: error in getnameinfo");
-	  host[0] = '\0';
-	}
-#else
-	memcpy(host, inet_ntoa(addr.sin_addr), sizeof(host));
-#endif
-	if(!hosts_ctl("vnc",STRING_UNKNOWN, host,
-		      STRING_UNKNOWN)) {
-	  rfbLog("Rejected HTTP connection from client %s\n",
-		 host);
-	  close(rfbScreen->httpSock);
-	  rfbScreen->httpSock=-1;
-	  return;
-	}
-#endif
-        if(!rfbSetNonBlocking(rfbScreen->httpSock)) {
-	    close(rfbScreen->httpSock);
-	    rfbScreen->httpSock=-1;
-	    return;
-	}
-	/*AddEnabledDevice(httpSock);*/
-    }
-}
-
-
-static void
-httpCloseSock(rfbScreenInfoPtr rfbScreen)
-{
-    close(rfbScreen->httpSock);
-    rfbScreen->httpSock = -1;
-    buf_filled = 0;
-}
-
-static rfbClientRec cl;
-
-/*
- * httpProcessInput is called when input is received on the HTTP socket.
- */
-
-static void
-httpProcessInput(rfbScreenInfoPtr rfbScreen)
-{
-#ifdef LIBVNCSERVER_IPv6
-    struct sockaddr_storage addr;
-#else
-    struct sockaddr_in addr;
-#endif
-    socklen_t addrlen = sizeof(addr);
-    char fullFname[512];
-    char params[1024];
-    char *ptr;
-    char *fname;
-    unsigned int maxFnameLen;
-    FILE* fd;
-    rfbBool performSubstitutions = FALSE;
-    char str[256+32];
-#ifndef WIN32
-    char* user=getenv("USER");
-#endif
-   
-    cl.sock=rfbScreen->httpSock;
-
-    if (strlen(rfbScreen->httpDir) > 255) {
-	rfbErr("-httpd directory too long\n");
-	httpCloseSock(rfbScreen);
-	return;
-    }
-    strcpy(fullFname, rfbScreen->httpDir);
-    fname = &fullFname[strlen(fullFname)];
-    maxFnameLen = 511 - strlen(fullFname);
-
-    buf_filled=0;
-
-    /* Read data from the HTTP client until we get a complete request. */
-    while (1) {
-	ssize_t got;
-
-        if (buf_filled > sizeof (buf)) {
-	    rfbErr("httpProcessInput: HTTP request is too long\n");
-	    httpCloseSock(rfbScreen);
-	    return;
-	}
-
-	got = read (rfbScreen->httpSock, buf + buf_filled,
-			    sizeof (buf) - buf_filled - 1);
-
-	if (got <= 0) {
-	    if (got == 0) {
-		rfbErr("httpd: premature connection close\n");
-	    } else {
-#ifdef WIN32
-	        errno=WSAGetLastError();
-#endif
-		if (errno == EAGAIN) {
-		    return;
-		}
-		rfbLogPerror("httpProcessInput: read");
-	    }
-	    httpCloseSock(rfbScreen);
-	    return;
-	}
-
-	buf_filled += got;
-	buf[buf_filled] = '\0';
-
-	/* Is it complete yet (is there a blank line)? */
-	if (strstr (buf, "\r\r") || strstr (buf, "\n\n") ||
-	    strstr (buf, "\r\n\r\n") || strstr (buf, "\n\r\n\r"))
-	    break;
-    }
-
-
-    /* Process the request. */
-    if(rfbScreen->httpEnableProxyConnect) {
-	const static char* PROXY_OK_STR = "HTTP/1.0 200 OK\r\nContent-Type: octet-stream\r\nPragma: no-cache\r\n\r\n";
-	if(!strncmp(buf, "CONNECT ", 8)) {
-	    if(atoi(strchr(buf, ':')+1)!=rfbScreen->port) {
-		rfbErr("httpd: CONNECT format invalid.\n");
-		rfbWriteExact(&cl,INVALID_REQUEST_STR, strlen(INVALID_REQUEST_STR));
-		httpCloseSock(rfbScreen);
-		return;
-	    }
-	    /* proxy connection */
-	    rfbLog("httpd: client asked for CONNECT\n");
-	    rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
-	    rfbNewClientConnection(rfbScreen,rfbScreen->httpSock);
-	    rfbScreen->httpSock = -1;
-	    return;
-	}
-	if (!strncmp(buf, "GET ",4) && !strncmp(strchr(buf,'/'),"/proxied.connection HTTP/1.", 27)) {
-	    /* proxy connection */
-	    rfbLog("httpd: client asked for /proxied.connection\n");
-	    rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
-	    rfbNewClientConnection(rfbScreen,rfbScreen->httpSock);
-	    rfbScreen->httpSock = -1;
-	    return;
-	}	   
-    }
-
-    if (strncmp(buf, "GET ", 4)) {
-	rfbErr("httpd: no GET line\n");
-	httpCloseSock(rfbScreen);
-	return;
-    } else {
-	/* Only use the first line. */
-	buf[strcspn(buf, "\n\r")] = '\0';
-    }
-
-    if (strlen(buf) > maxFnameLen) {
-	rfbErr("httpd: GET line too long\n");
-	httpCloseSock(rfbScreen);
-	return;
-    }
-
-    if (sscanf(buf, "GET %s HTTP/1.", fname) != 1) {
-	rfbErr("httpd: couldn't parse GET line\n");
-	httpCloseSock(rfbScreen);
-	return;
-    }
-
-    if (fname[0] != '/') {
-	rfbErr("httpd: filename didn't begin with '/'\n");
-	rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
-	httpCloseSock(rfbScreen);
-	return;
-    }
-
-
-    getpeername(rfbScreen->httpSock, (struct sockaddr *)&addr, &addrlen);
-#ifdef LIBVNCSERVER_IPv6
-    char host[1024];
-    if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
-      rfbLogPerror("httpProcessInput: error in getnameinfo");
-    }
-    rfbLog("httpd: get '%s' for %s\n", fname+1, host);
-#else
-    rfbLog("httpd: get '%s' for %s\n", fname+1,
-	   inet_ntoa(addr.sin_addr));
-#endif
-
-    /* Extract parameters from the URL string if necessary */
-
-    params[0] = '\0';
-    ptr = strchr(fname, '?');
-    if (ptr != NULL) {
-       *ptr = '\0';
-       if (!parseParams(&ptr[1], params, 1024)) {
-           params[0] = '\0';
-           rfbErr("httpd: bad parameters in the URL\n");
-       }
-    }
-
-
-    /* If we were asked for '/', actually read the file index.vnc */
-
-    if (strcmp(fname, "/") == 0) {
-	strcpy(fname, "/index.vnc");
-	rfbLog("httpd: defaulting to '%s'\n", fname+1);
-    }
-
-    /* Substitutions are performed on files ending .vnc */
-
-    if (strlen(fname) >= 4 && strcmp(&fname[strlen(fname)-4], ".vnc") == 0) {
-	performSubstitutions = TRUE;
-    }
-
-    /* Open the file */
-
-    if ((fd = fopen(fullFname, "r")) == 0) {
-        rfbLogPerror("httpProcessInput: open");
-        rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
-        httpCloseSock(rfbScreen);
-        return;
-    }
-
-    if(performSubstitutions) /* is the 'index.vnc' file */
-      rfbWriteExact(&cl, OK_STR_HTML, strlen(OK_STR_HTML));
-    else
-      rfbWriteExact(&cl, OK_STR, strlen(OK_STR));
-
-    while (1) {
-	int n = fread(buf, 1, BUF_SIZE-1, fd);
-	if (n < 0) {
-	    rfbLogPerror("httpProcessInput: read");
-	    fclose(fd);
-	    httpCloseSock(rfbScreen);
-	    return;
-	}
-
-	if (n == 0)
-	    break;
-
-	if (performSubstitutions) {
-
-	    /* Substitute $WIDTH, $HEIGHT, etc with the appropriate values.
-	       This won't quite work properly if the .vnc file is longer than
-	       BUF_SIZE, but it's reasonable to assume that .vnc files will
-	       always be short. */
-
-	    char *ptr = buf;
-	    char *dollar;
-	    buf[n] = 0; /* make sure it's null-terminated */
-
-	    while ((dollar = strchr(ptr, '$'))!=NULL) {
-		rfbWriteExact(&cl, ptr, (dollar - ptr));
-
-		ptr = dollar;
-
-		if (compareAndSkip(&ptr, "$WIDTH")) {
-
-		    sprintf(str, "%d", rfbScreen->width);
-		    rfbWriteExact(&cl, str, strlen(str));
-
-		} else if (compareAndSkip(&ptr, "$HEIGHT")) {
-
-		    sprintf(str, "%d", rfbScreen->height);
-		    rfbWriteExact(&cl, str, strlen(str));
-
-		} else if (compareAndSkip(&ptr, "$APPLETWIDTH")) {
-
-		    sprintf(str, "%d", rfbScreen->width);
-		    rfbWriteExact(&cl, str, strlen(str));
-
-		} else if (compareAndSkip(&ptr, "$APPLETHEIGHT")) {
-
-		    sprintf(str, "%d", rfbScreen->height + 32);
-		    rfbWriteExact(&cl, str, strlen(str));
-
-		} else if (compareAndSkip(&ptr, "$PORT")) {
-
-		    sprintf(str, "%d", rfbScreen->port);
-		    rfbWriteExact(&cl, str, strlen(str));
-
-		} else if (compareAndSkip(&ptr, "$DESKTOP")) {
-
-		    rfbWriteExact(&cl, rfbScreen->desktopName, strlen(rfbScreen->desktopName));
-
-		} else if (compareAndSkip(&ptr, "$DISPLAY")) {
-
-		    sprintf(str, "%s:%d", rfbScreen->thisHost, rfbScreen->port-5900);
-		    rfbWriteExact(&cl, str, strlen(str));
-
-		} else if (compareAndSkip(&ptr, "$USER")) {
-#ifndef WIN32
-		    if (user) {
-			rfbWriteExact(&cl, user,
-				   strlen(user));
-		    } else
-#endif
-			rfbWriteExact(&cl, "?", 1);
-		} else if (compareAndSkip(&ptr, "$PARAMS")) {
-		    if (params[0] != '\0')
-			rfbWriteExact(&cl, params, strlen(params));
-		} else {
-		    if (!compareAndSkip(&ptr, "$$"))
-			ptr++;
-
-		    if (rfbWriteExact(&cl, "$", 1) < 0) {
-			fclose(fd);
-			httpCloseSock(rfbScreen);
-			return;
-		    }
-		}
-	    }
-	    if (rfbWriteExact(&cl, ptr, (&buf[n] - ptr)) < 0)
-		break;
-
-	} else {
-
-	    /* For files not ending .vnc, just write out the buffer */
-
-	    if (rfbWriteExact(&cl, buf, n) < 0)
-		break;
-	}
-    }
-
-    fclose(fd);
-    httpCloseSock(rfbScreen);
-}
-
-
-static rfbBool
-compareAndSkip(char **ptr, const char *str)
-{
-    if (strncmp(*ptr, str, strlen(str)) == 0) {
-	*ptr += strlen(str);
-	return TRUE;
-    }
-
-    return FALSE;
-}
-
-/*
- * Parse the request tail after the '?' character, and format a sequence
- * of <param> tags for inclusion into an HTML page with embedded applet.
- */
-
-static rfbBool
-parseParams(const char *request, char *result, int max_bytes)
-{
-    char param_request[128];
-    char param_formatted[196];
-    const char *tail;
-    char *delim_ptr;
-    char *value_str;
-    int cur_bytes, len;
-
-    result[0] = '\0';
-    cur_bytes = 0;
-
-    tail = request;
-    for (;;) {
-	/* Copy individual "name=value" string into a buffer */
-	delim_ptr = strchr((char *)tail, '&');
-	if (delim_ptr == NULL) {
-	    if (strlen(tail) >= sizeof(param_request)) {
-		return FALSE;
-	    }
-	    strcpy(param_request, tail);
-	} else {
-	    len = delim_ptr - tail;
-	    if (len >= sizeof(param_request)) {
-		return FALSE;
-	    }
-	    memcpy(param_request, tail, len);
-	    param_request[len] = '\0';
-	}
-
-	/* Split the request into parameter name and value */
-	value_str = strchr(&param_request[1], '=');
-	if (value_str == NULL) {
-	    return FALSE;
-	}
-	*value_str++ = '\0';
-	if (strlen(value_str) == 0) {
-	    return FALSE;
-	}
-
-	/* Validate both parameter name and value */
-	if (!validateString(param_request) || !validateString(value_str)) {
-	    return FALSE;
-	}
-
-	/* Prepare HTML-formatted representation of the name=value pair */
-	len = sprintf(param_formatted,
-		      "<PARAM NAME=\"%s\" VALUE=\"%s\">\n",
-		      param_request, value_str);
-	if (cur_bytes + len + 1 > max_bytes) {
-	    return FALSE;
-	}
-	strcat(result, param_formatted);
-	cur_bytes += len;
-
-	/* Go to the next parameter */
-	if (delim_ptr == NULL) {
-	    break;
-	}
-	tail = delim_ptr + 1;
-    }
-    return TRUE;
-}
-
-/*
- * Check if the string consists only of alphanumeric characters, '+'
- * signs, underscores, dots, colons and square brackets.
- * Replace all '+' signs with spaces.
- */
-
-static rfbBool
-validateString(char *str)
-{
-    char *ptr;
-
-    for (ptr = str; *ptr != '\0'; ptr++) {
-	if (!isalnum(*ptr) && *ptr != '_' && *ptr != '.'
-	    && *ptr != ':' && *ptr != '[' && *ptr != ']' ) {
-	    if (*ptr == '+') {
-		*ptr = ' ';
-	    } else {
-		return FALSE;
-	    }
-	}
-    }
-    return TRUE;
-}
-
diff --git a/ica/x11/libvncserver/main.c b/ica/x11/libvncserver/main.c
deleted file mode 100644
index 4cb18ac..0000000
--- a/ica/x11/libvncserver/main.c
+++ /dev/null
@@ -1,1197 +0,0 @@
-/*
- *  This file is called main.c, because it contains most of the new functions
- *  for use with LibVNCServer.
- *
- *  LibVNCServer (C) 2001 Johannes E. Schindelin <Johannes.Schindelin at gmx.de>
- *  Original OSXvnc (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  see GPL (latest version) for full details
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#endif
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-#include "private.h"
-
-#include <stdarg.h>
-#include <errno.h>
-
-#ifndef false
-#define false 0
-#define true -1
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifndef WIN32
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#endif
-
-#include <signal.h>
-#include <time.h>
-
-static int extMutex_initialized = 0;
-static int logMutex_initialized = 0;
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-static MUTEX(logMutex);
-static MUTEX(extMutex);
-#endif
-
-static int rfbEnableLogging=1;
-
-#ifdef LIBVNCSERVER_WORDS_BIGENDIAN
-char rfbEndianTest = (1==0);
-#else
-char rfbEndianTest = (1==1);
-#endif
-
-/*
- * Protocol extensions
- */
-
-static rfbProtocolExtension* rfbExtensionHead = NULL;
-
-/*
- * This method registers a list of new extensions.  
- * It avoids same extension getting registered multiple times. 
- * The order is not preserved if multiple extensions are
- * registered at one-go.
- */
-void
-rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
-{
-	rfbProtocolExtension *head = rfbExtensionHead, *next = NULL;
-
-	if(extension == NULL)
-		return;
-
-	next = extension->next;
-
-	if (! extMutex_initialized) {
-		INIT_MUTEX(extMutex);
-		extMutex_initialized = 1;
-	}
-
-	LOCK(extMutex);
-
-	while(head != NULL) {
-		if(head == extension) {
-			UNLOCK(extMutex);
-			rfbRegisterProtocolExtension(next);
-			return;
-		}
-
-		head = head->next;
-	}
-
-	extension->next = rfbExtensionHead;
-	rfbExtensionHead = extension;
-
-	UNLOCK(extMutex);
-	rfbRegisterProtocolExtension(next);
-}
-
-/*
- * This method unregisters a list of extensions.  
- * These extensions won't be available for any new
- * client connection. 
- */
-void
-rfbUnregisterProtocolExtension(rfbProtocolExtension* extension)
-{
-
-	rfbProtocolExtension *cur = NULL, *pre = NULL;
-
-	if(extension == NULL)
-		return;
-
-	if (! extMutex_initialized) {
-		INIT_MUTEX(extMutex);
-		extMutex_initialized = 1;
-	}
-
-	LOCK(extMutex);
-
-	if(rfbExtensionHead == extension) {
-		rfbExtensionHead = rfbExtensionHead->next;
-		UNLOCK(extMutex);
-		rfbUnregisterProtocolExtension(extension->next);
-		return;
-	}
-
-	cur = pre = rfbExtensionHead;
-
-	while(cur) {
-		if(cur == extension) {
-			pre->next = cur->next;
-			break;
-		}
-		pre = cur;
-		cur = cur->next;
-	}
-
-	UNLOCK(extMutex);
-
-	rfbUnregisterProtocolExtension(extension->next);
-}
-
-rfbProtocolExtension* rfbGetExtensionIterator()
-{
-	if (! extMutex_initialized) {
-		INIT_MUTEX(extMutex);
-		extMutex_initialized = 1;
-	}
-
-	LOCK(extMutex);
-	return rfbExtensionHead;
-}
-
-void rfbReleaseExtensionIterator()
-{
-	UNLOCK(extMutex);
-}
-
-rfbBool rfbEnableExtension(rfbClientPtr cl, rfbProtocolExtension* extension,
-	void* data)
-{
-	rfbExtensionData* extData;
-
-	/* make sure extension is not yet enabled. */
-	for(extData = cl->extensions; extData; extData = extData->next)
-		if(extData->extension == extension)
-			return FALSE;
-
-	extData = calloc(sizeof(rfbExtensionData),1);
-	extData->extension = extension;
-	extData->data = data;
-	extData->next = cl->extensions;
-	cl->extensions = extData;
-
-	return TRUE;
-}
-
-rfbBool rfbDisableExtension(rfbClientPtr cl, rfbProtocolExtension* extension)
-{
-	rfbExtensionData* extData;
-	rfbExtensionData* prevData = NULL;
-
-	for(extData = cl->extensions; extData; extData = extData->next) {
-		if(extData->extension == extension) {
-			if(extData->data)
-				free(extData->data);
-			if(prevData == NULL)
-				cl->extensions = extData->next;
-			else
-				prevData->next = extData->next;
-			return TRUE;
-		}
-		prevData = extData;
-	}
-
-	return FALSE;
-}
-
-void* rfbGetExtensionClientData(rfbClientPtr cl, rfbProtocolExtension* extension)
-{
-    rfbExtensionData* data = cl->extensions;
-
-    while(data && data->extension != extension)
-	data = data->next;
-
-    if(data == NULL) {
-	rfbLog("Extension is not enabled !\n");
-	/* rfbCloseClient(cl); */
-	return NULL;
-    }
-
-    return data->data;
-}
-
-/*
- * Logging
- */
-
-void rfbLogEnable(int enabled) {
-  rfbEnableLogging=enabled;
-}
-
-/*
- * rfbLog prints a time-stamped message to the log file (stderr).
- */
-
-static void
-rfbDefaultLog(const char *format, ...)
-{
-    va_list args;
-    char buf[256];
-    time_t log_clock;
-
-    if(!rfbEnableLogging)
-      return;
-
-    if (! logMutex_initialized) {
-      INIT_MUTEX(logMutex);
-      logMutex_initialized = 1;
-    }
-
-    LOCK(logMutex);
-    va_start(args, format);
-
-    time(&log_clock);
-    strftime(buf, 255, "%d/%m/%Y %X ", localtime(&log_clock));
-    fprintf(stderr, "%s", buf);
-
-    vfprintf(stderr, format, args);
-    fflush(stderr);
-
-    va_end(args);
-    UNLOCK(logMutex);
-}
-
-rfbLogProc rfbLog=rfbDefaultLog;
-rfbLogProc rfbErr=rfbDefaultLog;
-
-void rfbLogPerror(const char *str)
-{
-    rfbErr("%s: %s\n", str, strerror(errno));
-}
-
-void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy)
-{  
-   rfbClientIteratorPtr iterator;
-   rfbClientPtr cl;
-
-   iterator=rfbGetClientIterator(rfbScreen);
-   while((cl=rfbClientIteratorNext(iterator))) {
-     LOCK(cl->updateMutex);
-     if(cl->useCopyRect) {
-       sraRegionPtr modifiedRegionBackup;
-       if(!sraRgnEmpty(cl->copyRegion)) {
-	  if(cl->copyDX!=dx || cl->copyDY!=dy) {
-	     /* if a copyRegion was not yet executed, treat it as a
-	      * modifiedRegion. The idea: in this case it could be
-	      * source of the new copyRect or modified anyway. */
-	     sraRgnOr(cl->modifiedRegion,cl->copyRegion);
-	     sraRgnMakeEmpty(cl->copyRegion);
-	  } else {
-	     /* we have to set the intersection of the source of the copy
-	      * and the old copy to modified. */
-	     modifiedRegionBackup=sraRgnCreateRgn(copyRegion);
-	     sraRgnOffset(modifiedRegionBackup,-dx,-dy);
-	     sraRgnAnd(modifiedRegionBackup,cl->copyRegion);
-	     sraRgnOr(cl->modifiedRegion,modifiedRegionBackup);
-	     sraRgnDestroy(modifiedRegionBackup);
-	  }
-       }
-	  
-       sraRgnOr(cl->copyRegion,copyRegion);
-       cl->copyDX = dx;
-       cl->copyDY = dy;
-
-       /* if there were modified regions, which are now copied,
-	* mark them as modified, because the source of these can be overlapped
-	* either by new modified or now copied regions. */
-       modifiedRegionBackup=sraRgnCreateRgn(cl->modifiedRegion);
-       sraRgnOffset(modifiedRegionBackup,dx,dy);
-       sraRgnAnd(modifiedRegionBackup,cl->copyRegion);
-       sraRgnOr(cl->modifiedRegion,modifiedRegionBackup);
-       sraRgnDestroy(modifiedRegionBackup);
-
-       if(!cl->enableCursorShapeUpdates) {
-          /*
-           * n.b. (dx, dy) is the vector pointing in the direction the
-           * copyrect displacement will take place.  copyRegion is the
-           * destination rectangle (say), not the source rectangle.
-           */
-          sraRegionPtr cursorRegion;
-          int x = cl->cursorX - cl->screen->cursor->xhot;
-          int y = cl->cursorY - cl->screen->cursor->yhot;
-          int w = cl->screen->cursor->width;
-          int h = cl->screen->cursor->height;
-
-          cursorRegion = sraRgnCreateRect(x, y, x + w, y + h);
-          sraRgnAnd(cursorRegion, cl->copyRegion);
-          if(!sraRgnEmpty(cursorRegion)) {
-             /*
-              * current cursor rect overlaps with the copy region *dest*,
-              * mark it as modified since we won't copy-rect stuff to it.
-              */
-             sraRgnOr(cl->modifiedRegion, cursorRegion);
-          }
-          sraRgnDestroy(cursorRegion);
-
-          cursorRegion = sraRgnCreateRect(x, y, x + w, y + h);
-          /* displace it to check for overlap with copy region source: */
-          sraRgnOffset(cursorRegion, dx, dy);
-          sraRgnAnd(cursorRegion, cl->copyRegion);
-          if(!sraRgnEmpty(cursorRegion)) {
-             /*
-              * current cursor rect overlaps with the copy region *source*,
-              * mark the *displaced* cursorRegion as modified since we
-              * won't copyrect stuff to it.
-              */
-             sraRgnOr(cl->modifiedRegion, cursorRegion);
-          }
-          sraRgnDestroy(cursorRegion);
-       }
-
-     } else {
-       sraRgnOr(cl->modifiedRegion,copyRegion);
-     }
-     TSIGNAL(cl->updateCond);
-     UNLOCK(cl->updateMutex);
-   }
-
-   rfbReleaseClientIterator(iterator);
-}
-
-void rfbDoCopyRegion(rfbScreenInfoPtr screen,sraRegionPtr copyRegion,int dx,int dy)
-{
-   sraRectangleIterator* i;
-   sraRect rect;
-   int j,widthInBytes,bpp=screen->serverFormat.bitsPerPixel/8,
-    rowstride=screen->paddedWidthInBytes;
-   char *in,*out;
-
-   /* copy it, really */
-   i = sraRgnGetReverseIterator(copyRegion,dx<0,dy<0);
-   while(sraRgnIteratorNext(i,&rect)) {
-     widthInBytes = (rect.x2-rect.x1)*bpp;
-     out = screen->frameBuffer+rect.x1*bpp+rect.y1*rowstride;
-     in = screen->frameBuffer+(rect.x1-dx)*bpp+(rect.y1-dy)*rowstride;
-     if(dy<0)
-       for(j=rect.y1;j<rect.y2;j++,out+=rowstride,in+=rowstride)
-	 memmove(out,in,widthInBytes);
-     else {
-       out += rowstride*(rect.y2-rect.y1-1);
-       in += rowstride*(rect.y2-rect.y1-1);
-       for(j=rect.y2-1;j>=rect.y1;j--,out-=rowstride,in-=rowstride)
-	 memmove(out,in,widthInBytes);
-     }
-   }
-   sraRgnReleaseIterator(i);
-  
-   rfbScheduleCopyRegion(screen,copyRegion,dx,dy);
-}
-
-void rfbDoCopyRect(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2,int dx,int dy)
-{
-  sraRegionPtr region = sraRgnCreateRect(x1,y1,x2,y2);
-  rfbDoCopyRegion(screen,region,dx,dy);
-  sraRgnDestroy(region);
-}
-
-void rfbScheduleCopyRect(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2,int dx,int dy)
-{
-  sraRegionPtr region = sraRgnCreateRect(x1,y1,x2,y2);
-  rfbScheduleCopyRegion(screen,region,dx,dy);
-  sraRgnDestroy(region);
-}
-
-void rfbMarkRegionAsModified(rfbScreenInfoPtr screen,sraRegionPtr modRegion)
-{
-   rfbClientIteratorPtr iterator;
-   rfbClientPtr cl;
-
-   iterator=rfbGetClientIterator(screen);
-   while((cl=rfbClientIteratorNext(iterator))) {
-     LOCK(cl->updateMutex);
-     sraRgnOr(cl->modifiedRegion,modRegion);
-     TSIGNAL(cl->updateCond);
-     UNLOCK(cl->updateMutex);
-   }
-
-   rfbReleaseClientIterator(iterator);
-}
-
-void rfbScaledScreenUpdate(rfbScreenInfoPtr screen, int x1, int y1, int x2, int y2);
-void rfbMarkRectAsModified(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2)
-{
-   sraRegionPtr region;
-   int i;
-
-   if(x1>x2) { i=x1; x1=x2; x2=i; }
-   if(x1<0) x1=0;
-   if(x2>screen->width) x2=screen->width;
-   if(x1==x2) return;
-   
-   if(y1>y2) { i=y1; y1=y2; y2=i; }
-   if(y1<0) y1=0;
-   if(y2>screen->height) y2=screen->height;
-   if(y1==y2) return;
-
-   /* update scaled copies for this rectangle */
-   rfbScaledScreenUpdate(screen,x1,y1,x2,y2);
-
-   region = sraRgnCreateRect(x1,y1,x2,y2);
-   rfbMarkRegionAsModified(screen,region);
-   sraRgnDestroy(region);
-}
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-#include <unistd.h>
-
-static void *
-clientOutput(void *data)
-{
-    rfbClientPtr cl = (rfbClientPtr)data;
-    rfbBool haveUpdate;
-    sraRegion* updateRegion;
-
-    while (1) {
-        haveUpdate = false;
-        while (!haveUpdate) {
-		if (cl->sock == -1) {
-			/* Client has disconnected. */
-			return NULL;
-		}
-		if (cl->state != RFB_NORMAL || cl->onHold) {
-			/* just sleep until things get normal */
-			usleep(cl->screen->deferUpdateTime * 1000);
-			continue;
-		}
-
-		LOCK(cl->updateMutex);
-
-		if (sraRgnEmpty(cl->requestedRegion)) {
-			; /* always require a FB Update Request (otherwise can crash.) */
-		} else {
-			haveUpdate = FB_UPDATE_PENDING(cl);
-			if(!haveUpdate) {
-				updateRegion = sraRgnCreateRgn(cl->modifiedRegion);
-				haveUpdate   = sraRgnAnd(updateRegion,cl->requestedRegion);
-				sraRgnDestroy(updateRegion);
-			}
-		}
-
-		if (!haveUpdate) {
-			WAIT(cl->updateCond, cl->updateMutex);
-		}
-
-		UNLOCK(cl->updateMutex);
-        }
-        
-        /* OK, now, to save bandwidth, wait a little while for more
-           updates to come along. */
-        usleep(cl->screen->deferUpdateTime * 1000);
-
-        /* Now, get the region we're going to update, and remove
-           it from cl->modifiedRegion _before_ we send the update.
-           That way, if anything that overlaps the region we're sending
-           is updated, we'll be sure to do another update later. */
-        LOCK(cl->updateMutex);
-	updateRegion = sraRgnCreateRgn(cl->modifiedRegion);
-        UNLOCK(cl->updateMutex);
-
-        /* Now actually send the update. */
-	rfbIncrClientRef(cl);
-        LOCK(cl->sendMutex);
-        rfbSendFramebufferUpdate(cl, updateRegion);
-        UNLOCK(cl->sendMutex);
-	rfbDecrClientRef(cl);
-
-	sraRgnDestroy(updateRegion);
-    }
-
-    /* Not reached. */
-    return NULL;
-}
-
-static void *
-clientInput(void *data)
-{
-    rfbClientPtr cl = (rfbClientPtr)data;
-    pthread_t output_thread;
-    pthread_create(&output_thread, NULL, clientOutput, (void *)cl);
-
-    while (1) {
-	fd_set rfds, wfds, efds;
-	struct timeval tv;
-	int n;
-
-	if (cl->sock == -1) {
-	  /* Client has disconnected. */
-            break;
-        }
-
-	FD_ZERO(&rfds);
-	FD_SET(cl->sock, &rfds);
-	FD_ZERO(&efds);
-	FD_SET(cl->sock, &efds);
-
-	/* Are we transferring a file in the background? */
-	FD_ZERO(&wfds);
-	if ((cl->fileTransfer.fd!=-1) && (cl->fileTransfer.sending==1))
-	    FD_SET(cl->sock, &wfds);
-
-	tv.tv_sec = 60; /* 1 minute */
-	tv.tv_usec = 0;
-	n = select(cl->sock + 1, &rfds, &wfds, &efds, &tv);
-	if (n < 0) {
-	    rfbLogPerror("ReadExact: select");
-	    break;
-	}
-	if (n == 0) /* timeout */
-	{
-            rfbSendFileTransferChunk(cl);
-	    continue;
-        }
-        
-        /* We have some space on the transmit queue, send some data */
-        if (FD_ISSET(cl->sock, &wfds))
-            rfbSendFileTransferChunk(cl);
-
-        if (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds))
-            rfbProcessClientMessage(cl);
-    }
-
-    /* Get rid of the output thread. */
-    LOCK(cl->updateMutex);
-    TSIGNAL(cl->updateCond);
-    UNLOCK(cl->updateMutex);
-    IF_PTHREADS(pthread_join(output_thread, NULL));
-
-    rfbClientConnectionGone(cl);
-
-    return NULL;
-}
-
-static void*
-listenerRun(void *data)
-{
-    rfbScreenInfoPtr screen=(rfbScreenInfoPtr)data;
-    int client_fd;
-    struct sockaddr_storage peer;
-    rfbClientPtr cl = NULL;
-    socklen_t len;
-    fd_set listen_fds;  /* temp file descriptor list for select() */
-
-    /* TODO: this thread wont die by restarting the server */
-    /* TODO: HTTP is not handled */
-    while (1) {
-        client_fd = -1;
-        FD_ZERO(&listen_fds);
-	if(screen->listenSock >= 0) 
-	  FD_SET(screen->listenSock, &listen_fds);
-	if(screen->listen6Sock >= 0) 
-	  FD_SET(screen->listen6Sock, &listen_fds);
-
-        if (select(screen->maxFd+1, &listen_fds, NULL, NULL, NULL) == -1) {
-            rfbLogPerror("listenerRun: error in select");
-            return NULL;
-        }
-	
-	/* there is something on the listening sockets, handle new connections */
-	len = sizeof (peer);
-	if (FD_ISSET(screen->listenSock, &listen_fds)) 
-	    client_fd = accept(screen->listenSock, (struct sockaddr*)&peer, &len);
-	else if (FD_ISSET(screen->listen6Sock, &listen_fds))
-	    client_fd = accept(screen->listen6Sock, (struct sockaddr*)&peer, &len);
-
-	if(client_fd >= 0)
-	  cl = rfbNewClient(screen,client_fd);
-	if (cl && !cl->onHold )
-	  rfbStartOnHoldClient(cl);
-    }
-    return(NULL);
-}
-
-void 
-rfbStartOnHoldClient(rfbClientPtr cl)
-{
-    pthread_create(&cl->client_thread, NULL, clientInput, (void *)cl);
-}
-
-#else
-
-void 
-rfbStartOnHoldClient(rfbClientPtr cl)
-{
-	cl->onHold = FALSE;
-}
-
-#endif
-
-void 
-rfbRefuseOnHoldClient(rfbClientPtr cl)
-{
-    rfbCloseClient(cl);
-    rfbClientConnectionGone(cl);
-}
-
-static void
-rfbDefaultKbdAddEvent(rfbBool down, rfbKeySym keySym, rfbClientPtr cl)
-{
-}
-
-void
-rfbDefaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
-{
-  rfbClientIteratorPtr iterator;
-  rfbClientPtr other_client;
-  rfbScreenInfoPtr s = cl->screen;
-
-  if (x != s->cursorX || y != s->cursorY) {
-    LOCK(s->cursorMutex);
-    s->cursorX = x;
-    s->cursorY = y;
-    UNLOCK(s->cursorMutex);
-
-    /* The cursor was moved by this client, so don't send CursorPos. */
-    if (cl->enableCursorPosUpdates)
-      cl->cursorWasMoved = FALSE;
-
-    /* But inform all remaining clients about this cursor movement. */
-    iterator = rfbGetClientIterator(s);
-    while ((other_client = rfbClientIteratorNext(iterator)) != NULL) {
-      if (other_client != cl && other_client->enableCursorPosUpdates) {
-	other_client->cursorWasMoved = TRUE;
-      }
-    }
-    rfbReleaseClientIterator(iterator);
-  }
-}
-
-static void rfbDefaultSetXCutText(char* text, int len, rfbClientPtr cl)
-{
-}
-
-/* TODO: add a nice VNC or RFB cursor */
-
-#if defined(WIN32) || defined(sparc) || !defined(NO_STRICT_ANSI)
-static rfbCursor myCursor = 
-{
-   FALSE, FALSE, FALSE, FALSE,
-   (unsigned char*)"\000\102\044\030\044\102\000",
-   (unsigned char*)"\347\347\176\074\176\347\347",
-   8, 7, 3, 3,
-   0, 0, 0,
-   0xffff, 0xffff, 0xffff,
-   NULL
-};
-#else
-static rfbCursor myCursor = 
-{
-   cleanup: FALSE,
-   cleanupSource: FALSE,
-   cleanupMask: FALSE,
-   cleanupRichSource: FALSE,
-   source: "\000\102\044\030\044\102\000",
-   mask:   "\347\347\176\074\176\347\347",
-   width: 8, height: 7, xhot: 3, yhot: 3,
-   foreRed: 0, foreGreen: 0, foreBlue: 0,
-   backRed: 0xffff, backGreen: 0xffff, backBlue: 0xffff,
-   richSource: NULL
-};
-#endif
-
-static rfbCursorPtr rfbDefaultGetCursorPtr(rfbClientPtr cl)
-{
-   return(cl->screen->cursor);
-}
-
-/* response is cl->authChallenge vncEncrypted with passwd */
-static rfbBool rfbDefaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
-{
-  int i;
-  char *passwd=rfbDecryptPasswdFromFile(cl->screen->authPasswdData);
-
-  if(!passwd) {
-    rfbErr("Couldn't read password file: %s\n",cl->screen->authPasswdData);
-    return(FALSE);
-  }
-
-  rfbEncryptBytes(cl->authChallenge, passwd);
-
-  /* Lose the password from memory */
-  for (i = strlen(passwd); i >= 0; i--) {
-    passwd[i] = '\0';
-  }
-
-  free(passwd);
-
-  if (memcmp(cl->authChallenge, response, len) != 0) {
-    rfbErr("authProcessClientMessage: authentication failed from %s\n",
-	   cl->host);
-    return(FALSE);
-  }
-
-  return(TRUE);
-}
-
-/* for this method, authPasswdData is really a pointer to an array
-   of char*'s, where the last pointer is 0. */
-rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len)
-{
-  char **passwds;
-  int i=0;
-
-  for(passwds=(char**)cl->screen->authPasswdData;*passwds;passwds++,i++) {
-    uint8_t auth_tmp[CHALLENGESIZE];
-    memcpy((char *)auth_tmp, (char *)cl->authChallenge, CHALLENGESIZE);
-    rfbEncryptBytes(auth_tmp, *passwds);
-
-    if (memcmp(auth_tmp, response, len) == 0) {
-      if(i>=cl->screen->authPasswdFirstViewOnly)
-	cl->viewOnly=TRUE;
-      return(TRUE);
-    }
-  }
-
-  rfbErr("authProcessClientMessage: authentication failed from %s\n",
-	 cl->host);
-  return(FALSE);
-}
-
-void rfbDoNothingWithClient(rfbClientPtr cl)
-{
-}
-
-static enum rfbNewClientAction rfbDefaultNewClientHook(rfbClientPtr cl)
-{
-	return RFB_CLIENT_ACCEPT;
-}
-
-/*
- * Update server's pixel format in screenInfo structure. This
- * function is called from rfbGetScreen() and rfbNewFramebuffer().
- */
-
-static void rfbInitServerFormat(rfbScreenInfoPtr screen, int bitsPerSample)
-{
-   rfbPixelFormat* format=&screen->serverFormat;
-
-   format->bitsPerPixel = screen->bitsPerPixel;
-   format->depth = screen->depth;
-   format->bigEndian = rfbEndianTest?FALSE:TRUE;
-   format->trueColour = TRUE;
-   screen->colourMap.count = 0;
-   screen->colourMap.is16 = 0;
-   screen->colourMap.data.bytes = NULL;
-
-   if (format->bitsPerPixel == 8) {
-     format->redMax = 7;
-     format->greenMax = 7;
-     format->blueMax = 3;
-     format->redShift = 0;
-     format->greenShift = 3;
-     format->blueShift = 6;
-   } else {
-     format->redMax = (1 << bitsPerSample) - 1;
-     format->greenMax = (1 << bitsPerSample) - 1;
-     format->blueMax = (1 << bitsPerSample) - 1;
-     if(rfbEndianTest) {
-       format->redShift = 0;
-       format->greenShift = bitsPerSample;
-       format->blueShift = bitsPerSample * 2;
-     } else {
-       if(format->bitsPerPixel==8*3) {
-	 format->redShift = bitsPerSample*2;
-	 format->greenShift = bitsPerSample*1;
-	 format->blueShift = 0;
-       } else {
-	 format->redShift = bitsPerSample*3;
-	 format->greenShift = bitsPerSample*2;
-	 format->blueShift = bitsPerSample;
-       }
-     }
-   }
-}
-
-rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
- int width,int height,int bitsPerSample,int samplesPerPixel,
- int bytesPerPixel)
-{
-   rfbScreenInfoPtr screen=calloc(sizeof(rfbScreenInfo),1);
-
-   if (! logMutex_initialized) {
-     INIT_MUTEX(logMutex);
-     logMutex_initialized = 1;
-   }
-
-
-   if(width&3)
-     rfbErr("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width);
-
-   screen->autoPort=FALSE;
-   screen->clientHead=NULL;
-   screen->pointerClient=NULL;
-   screen->port=5900;
-   screen->ipv6port=5900;
-   screen->socketState=RFB_SOCKET_INIT;
-
-   screen->inetdInitDone = FALSE;
-   screen->inetdSock=-1;
-
-   screen->udpSock=-1;
-   screen->udpSockConnected=FALSE;
-   screen->udpPort=0;
-   screen->udpClient=NULL;
-
-   screen->maxFd=0;
-   screen->listenSock=-1;
-   screen->listen6Sock=-1;
-
-   screen->httpInitDone=FALSE;
-   screen->httpEnableProxyConnect=FALSE;
-   screen->httpPort=0;
-   screen->http6Port=0;
-   screen->httpDir=NULL;
-   screen->httpListenSock=-1;
-   screen->httpListen6Sock=-1;
-   screen->httpSock=-1;
-
-   screen->desktopName = "LibVNCServer";
-   screen->alwaysShared = FALSE;
-   screen->neverShared = FALSE;
-   screen->dontDisconnect = FALSE;
-   screen->authPasswdData = NULL;
-   screen->authPasswdFirstViewOnly = 1;
-   
-   screen->width = width;
-   screen->height = height;
-   screen->bitsPerPixel = screen->depth = 8*bytesPerPixel;
-
-   screen->passwordCheck = rfbDefaultPasswordCheck;
-
-   screen->ignoreSIGPIPE = TRUE;
-
-   /* disable progressive updating per default */
-   screen->progressiveSliceHeight = 0;
-
-   screen->listenInterface = htonl(INADDR_ANY);
-
-   screen->deferUpdateTime=5;
-   screen->maxRectsPerUpdate=50;
-
-   screen->handleEventsEagerly = FALSE;
-
-   screen->protocolMajorVersion = rfbProtocolMajorVersion;
-   screen->protocolMinorVersion = rfbProtocolMinorVersion;
-
-   screen->permitFileTransfer = FALSE;
-
-   if(!rfbProcessArguments(screen,argc,argv)) {
-     free(screen);
-     return NULL;
-   }
-
-#ifdef WIN32
-   {
-	   DWORD dummy=255;
-	   GetComputerName(screen->thisHost,&dummy);
-   }
-#else
-   gethostname(screen->thisHost, 255);
-#endif
-
-   screen->paddedWidthInBytes = width*bytesPerPixel;
-
-   /* format */
-
-   rfbInitServerFormat(screen, bitsPerSample);
-
-   /* cursor */
-
-   screen->cursorX=screen->cursorY=screen->underCursorBufferLen=0;
-   screen->underCursorBuffer=NULL;
-   screen->dontConvertRichCursorToXCursor = FALSE;
-   screen->cursor = &myCursor;
-   INIT_MUTEX(screen->cursorMutex);
-
-   IF_PTHREADS(screen->backgroundLoop = FALSE);
-
-   /* proc's and hook's */
-
-   screen->kbdAddEvent = rfbDefaultKbdAddEvent;
-   screen->kbdReleaseAllKeys = rfbDoNothingWithClient;
-   screen->ptrAddEvent = rfbDefaultPtrAddEvent;
-   screen->setXCutText = rfbDefaultSetXCutText;
-   screen->getCursorPtr = rfbDefaultGetCursorPtr;
-   screen->setTranslateFunction = rfbSetTranslateFunction;
-   screen->newClientHook = rfbDefaultNewClientHook;
-   screen->displayHook = NULL;
-   screen->displayFinishedHook = NULL;
-   screen->getKeyboardLedStateHook = NULL;
-   screen->xvpHook = NULL;
-
-   /* initialize client list and iterator mutex */
-   rfbClientListInit(screen);
-
-   return(screen);
-}
-
-/*
- * Switch to another framebuffer (maybe of different size and color
- * format). Clients supporting NewFBSize pseudo-encoding will change
- * their local framebuffer dimensions if necessary.
- * NOTE: Rich cursor data should be converted to new pixel format by
- * the caller.
- */
-
-void rfbNewFramebuffer(rfbScreenInfoPtr screen, char *framebuffer,
-                       int width, int height,
-                       int bitsPerSample, int samplesPerPixel,
-                       int bytesPerPixel)
-{
-  rfbPixelFormat old_format;
-  rfbBool format_changed = FALSE;
-  rfbClientIteratorPtr iterator;
-  rfbClientPtr cl;
-
-  /* Update information in the screenInfo structure */
-
-  old_format = screen->serverFormat;
-
-  if (width & 3)
-    rfbErr("WARNING: New width (%d) is not a multiple of 4.\n", width);
-
-  screen->width = width;
-  screen->height = height;
-  screen->bitsPerPixel = screen->depth = 8*bytesPerPixel;
-  screen->paddedWidthInBytes = width*bytesPerPixel;
-
-  rfbInitServerFormat(screen, bitsPerSample);
-
-  if (memcmp(&screen->serverFormat, &old_format,
-             sizeof(rfbPixelFormat)) != 0) {
-    format_changed = TRUE;
-  }
-
-  screen->frameBuffer = framebuffer;
-
-  /* Adjust pointer position if necessary */
-
-  if (screen->cursorX >= width)
-    screen->cursorX = width - 1;
-  if (screen->cursorY >= height)
-    screen->cursorY = height - 1;
-
-  /* For each client: */
-  iterator = rfbGetClientIterator(screen);
-  while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
-
-    /* Re-install color translation tables if necessary */
-
-    if (format_changed)
-      screen->setTranslateFunction(cl);
-
-    /* Mark the screen contents as changed, and schedule sending
-       NewFBSize message if supported by this client. */
-
-    LOCK(cl->updateMutex);
-    sraRgnDestroy(cl->modifiedRegion);
-    cl->modifiedRegion = sraRgnCreateRect(0, 0, width, height);
-    sraRgnMakeEmpty(cl->copyRegion);
-    cl->copyDX = 0;
-    cl->copyDY = 0;
-
-    if (cl->useNewFBSize)
-      cl->newFBSizePending = TRUE;
-
-    TSIGNAL(cl->updateCond);
-    UNLOCK(cl->updateMutex);
-  }
-  rfbReleaseClientIterator(iterator);
-}
-
-/* hang up on all clients and free all reserved memory */
-
-void rfbScreenCleanup(rfbScreenInfoPtr screen)
-{
-  rfbClientIteratorPtr i=rfbGetClientIterator(screen);
-  rfbClientPtr cl,cl1=rfbClientIteratorNext(i);
-  while(cl1) {
-    cl=rfbClientIteratorNext(i);
-    rfbClientConnectionGone(cl1);
-    cl1=cl;
-  }
-  rfbReleaseClientIterator(i);
-    
-#define FREE_IF(x) if(screen->x) free(screen->x)
-  FREE_IF(colourMap.data.bytes);
-  FREE_IF(underCursorBuffer);
-  TINI_MUTEX(screen->cursorMutex);
-  if(screen->cursor && screen->cursor->cleanup)
-    rfbFreeCursor(screen->cursor);
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-  rfbZlibCleanup(screen);
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-  rfbTightCleanup(screen);
-#endif
-
-  /* free all 'scaled' versions of this screen */
-  while (screen->scaledScreenNext!=NULL)
-  {
-      rfbScreenInfoPtr ptr;
-      ptr = screen->scaledScreenNext;
-      screen->scaledScreenNext = ptr->scaledScreenNext;
-      free(ptr->frameBuffer);
-      free(ptr);
-  }
-
-#endif
-  free(screen);
-}
-
-void rfbInitServer(rfbScreenInfoPtr screen)
-{
-#ifdef WIN32
-  WSADATA trash;
-  WSAStartup(MAKEWORD(2,2),&trash);
-#endif
-  rfbInitSockets(screen);
-  rfbHttpInitSockets(screen);
-#ifndef __MINGW32__
-  if(screen->ignoreSIGPIPE)
-    signal(SIGPIPE,SIG_IGN);
-#endif
-}
-
-void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool disconnectClients) {
-  if(disconnectClients) {
-    rfbClientPtr cl;
-    rfbClientIteratorPtr iter = rfbGetClientIterator(screen);
-    while( (cl = rfbClientIteratorNext(iter)) )
-      if (cl->sock > -1)
-	/* we don't care about maxfd here, because the server goes away */
-	rfbCloseClient(cl);
-    rfbReleaseClientIterator(iter);
-  }
-
-  rfbShutdownSockets(screen);
-  rfbHttpShutdownSockets(screen);
-}
-
-#ifndef LIBVNCSERVER_HAVE_GETTIMEOFDAY
-#include <fcntl.h>
-#include <conio.h>
-#include <sys/timeb.h>
-
-void gettimeofday(struct timeval* tv,char* dummy)
-{
-   SYSTEMTIME t;
-   GetSystemTime(&t);
-   tv->tv_sec=t.wHour*3600+t.wMinute*60+t.wSecond;
-   tv->tv_usec=t.wMilliseconds*1000;
-}
-#endif
-
-rfbBool
-rfbProcessEvents(rfbScreenInfoPtr screen,long usec)
-{
-  rfbClientIteratorPtr i;
-  rfbClientPtr cl,clPrev;
-  rfbBool result=FALSE;
-  extern rfbClientIteratorPtr
-    rfbGetClientIteratorWithClosed(rfbScreenInfoPtr rfbScreen);
-
-  if(usec<0)
-    usec=screen->deferUpdateTime*1000;
-
-  rfbCheckFds(screen,usec);
-  rfbHttpCheckFds(screen);
-
-  i = rfbGetClientIteratorWithClosed(screen);
-  cl=rfbClientIteratorHead(i);
-  while(cl) {
-    result = rfbUpdateClient(cl);
-    clPrev=cl;
-    cl=rfbClientIteratorNext(i);
-    if(clPrev->sock==-1) {
-      rfbClientConnectionGone(clPrev);
-      result=TRUE;
-    }
-  }
-  rfbReleaseClientIterator(i);
-
-  return result;
-}
-
-rfbBool
-rfbUpdateClient(rfbClientPtr cl)
-{
-  struct timeval tv;
-  rfbBool result=FALSE;
-  rfbScreenInfoPtr screen = cl->screen;
-
-  if (cl->sock >= 0 && !cl->onHold && FB_UPDATE_PENDING(cl) &&
-        !sraRgnEmpty(cl->requestedRegion)) {
-      result=TRUE;
-      if(screen->deferUpdateTime == 0) {
-          rfbSendFramebufferUpdate(cl,cl->modifiedRegion);
-      } else if(cl->startDeferring.tv_usec == 0) {
-        gettimeofday(&cl->startDeferring,NULL);
-        if(cl->startDeferring.tv_usec == 0)
-          cl->startDeferring.tv_usec++;
-      } else {
-        gettimeofday(&tv,NULL);
-        if(tv.tv_sec < cl->startDeferring.tv_sec /* at midnight */
-           || ((tv.tv_sec-cl->startDeferring.tv_sec)*1000
-               +(tv.tv_usec-cl->startDeferring.tv_usec)/1000)
-             > screen->deferUpdateTime) {
-          cl->startDeferring.tv_usec = 0;
-          rfbSendFramebufferUpdate(cl,cl->modifiedRegion);
-        }
-      }
-    }
-
-    if (!cl->viewOnly && cl->lastPtrX >= 0) {
-      if(cl->startPtrDeferring.tv_usec == 0) {
-        gettimeofday(&cl->startPtrDeferring,NULL);
-        if(cl->startPtrDeferring.tv_usec == 0)
-          cl->startPtrDeferring.tv_usec++;
-      } else {
-        struct timeval tv;
-        gettimeofday(&tv,NULL);
-        if(tv.tv_sec < cl->startPtrDeferring.tv_sec /* at midnight */
-           || ((tv.tv_sec-cl->startPtrDeferring.tv_sec)*1000
-           +(tv.tv_usec-cl->startPtrDeferring.tv_usec)/1000)
-           > cl->screen->deferPtrUpdateTime) {
-          cl->startPtrDeferring.tv_usec = 0;
-          cl->screen->ptrAddEvent(cl->lastPtrButtons,
-                                  cl->lastPtrX,
-                                  cl->lastPtrY, cl);
-          cl->lastPtrX = -1;
-        }
-      }
-    }
-
-    return result;
-}
-
-rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo) {
-  return screenInfo->socketState!=RFB_SOCKET_SHUTDOWN || screenInfo->clientHead!=NULL;
-}
-
-void rfbRunEventLoop(rfbScreenInfoPtr screen, long usec, rfbBool runInBackground)
-{
-  if(runInBackground) {
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-       pthread_t listener_thread;
-
-       screen->backgroundLoop = TRUE;
-
-       pthread_create(&listener_thread, NULL, listenerRun, screen);
-    return;
-#else
-    rfbErr("Can't run in background, because I don't have PThreads!\n");
-    return;
-#endif
-  }
-
-  if(usec<0)
-    usec=screen->deferUpdateTime*1000;
-
-  while(rfbIsActive(screen))
-    rfbProcessEvents(screen,usec);
-}
diff --git a/ica/x11/libvncserver/private.h b/ica/x11/libvncserver/private.h
deleted file mode 100644
index d656e39..0000000
--- a/ica/x11/libvncserver/private.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef RFB_PRIVATE_H
-#define RFB_PRIVATE_H
-
-/* from cursor.c */
-
-void rfbShowCursor(rfbClientPtr cl);
-void rfbHideCursor(rfbClientPtr cl);
-void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion);
-
-/* from main.c */
-
-rfbClientPtr rfbClientIteratorHead(rfbClientIteratorPtr i);
-
-/* from tight.c */
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-extern void rfbTightCleanup(rfbScreenInfoPtr screen);
-#endif
-
-/* from zlib.c */
-extern void rfbZlibCleanup(rfbScreenInfoPtr screen);
-
-/* from zrle.c */
-void rfbFreeZrleData(rfbClientPtr cl);
-
-#endif
-
-
-/* from ultra.c */
-
-extern void rfbFreeUltraData(rfbClientPtr cl);
-
-#endif
-
diff --git a/ica/x11/libvncserver/rfbcrypto.h b/ica/x11/libvncserver/rfbcrypto.h
deleted file mode 100644
index 9dc3e63..0000000
--- a/ica/x11/libvncserver/rfbcrypto.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _RFB_CRYPTO_H
-#define _RFB_CRYPTO_H 1
-
-#include <sys/uio.h>
-
-#define SHA1_HASH_SIZE 20
-#define MD5_HASH_SIZE 16
-
-void digestmd5(const struct iovec *iov, int iovcnt, void *dest);
-void digestsha1(const struct iovec *iov, int iovcnt, void *dest);
-
-#endif
diff --git a/ica/x11/libvncserver/rfbcrypto_gnutls.c b/ica/x11/libvncserver/rfbcrypto_gnutls.c
deleted file mode 100644
index 2ecb2da..0000000
--- a/ica/x11/libvncserver/rfbcrypto_gnutls.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * rfbcrypto_gnutls.c - Crypto wrapper (gnutls version)
- */
-
-/*
- *  Copyright (C) 2011 Gernot Tenchio
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <string.h>
-#include <gcrypt.h>
-#include "rfbcrypto.h"
-
-void digestmd5(const struct iovec *iov, int iovcnt, void *dest)
-{
-    gcry_md_hd_t c;
-    int i;
-
-    gcry_md_open(&c, GCRY_MD_MD5, 0);
-    for (i = 0; i < iovcnt; i++)
-	gcry_md_write(c, iov[i].iov_base, iov[i].iov_len);
-    gcry_md_final(c);
-    memcpy(dest, gcry_md_read(c, 0), gcry_md_get_algo_dlen(GCRY_MD_MD5));
-}
-
-void digestsha1(const struct iovec *iov, int iovcnt, void *dest)
-{
-    gcry_md_hd_t c;
-    int i;
-
-    gcry_md_open(&c, GCRY_MD_SHA1, 0);
-    for (i = 0; i < iovcnt; i++)
-	gcry_md_write(c, iov[i].iov_base, iov[i].iov_len);
-    gcry_md_final(c);
-    memcpy(dest, gcry_md_read(c, 0), gcry_md_get_algo_dlen(GCRY_MD_SHA1));
-}
diff --git a/ica/x11/libvncserver/rfbcrypto_included.c b/ica/x11/libvncserver/rfbcrypto_included.c
deleted file mode 100644
index 58c2e93..0000000
--- a/ica/x11/libvncserver/rfbcrypto_included.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * rfbcrypto_included.c - Crypto wrapper (included version)
- */
-
-/*
- *  Copyright (C) 2011 Gernot Tenchio
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <string.h>
-#include "md5.h"
-#include "sha1.h"
-#include "rfbcrypto.h"
-
-void digestmd5(const struct iovec *iov, int iovcnt, void *dest)
-{
-    struct md5_ctx c;
-    int i;
-
-    __md5_init_ctx(&c);
-    for (i = 0; i < iovcnt; i++)
-	__md5_process_bytes(iov[i].iov_base, iov[i].iov_len, &c);
-    __md5_finish_ctx(&c, dest);
-}
-
-void digestsha1(const struct iovec *iov, int iovcnt, void *dest)
-{
-    SHA1Context c;
-    int i;
-
-    SHA1Reset(&c);
-    for (i = 0; i < iovcnt; i++)
-	SHA1Input(&c, iov[i].iov_base, iov[i].iov_len);
-    SHA1Result(&c, dest);
-}
diff --git a/ica/x11/libvncserver/rfbcrypto_openssl.c b/ica/x11/libvncserver/rfbcrypto_openssl.c
deleted file mode 100644
index 29ec5c1..0000000
--- a/ica/x11/libvncserver/rfbcrypto_openssl.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * rfbcrypto_openssl.c - Crypto wrapper (openssl version)
- */
-
-/*
- *  Copyright (C) 2011 Gernot Tenchio
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <string.h>
-#include <openssl/sha.h>
-#include <openssl/md5.h>
-#include "rfbcrypto.h"
-
-void digestmd5(const struct iovec *iov, int iovcnt, void *dest)
-{
-    MD5_CTX c;
-    int i;
-    
-    MD5_Init(&c);
-    for (i = 0; i < iovcnt; i++)
-	MD5_Update(&c, iov[i].iov_base, iov[i].iov_len);
-    MD5_Final(dest, &c);
-}
-
-void digestsha1(const struct iovec *iov, int iovcnt, void *dest)
-{
-    SHA_CTX c;
-    int i;
-    
-    SHA1_Init(&c);
-    for (i = 0; i < iovcnt; i++)
-	SHA1_Update(&c, iov[i].iov_base, iov[i].iov_len);
-    SHA1_Final(dest, &c);
-}
diff --git a/ica/x11/libvncserver/rfbcrypto_polarssl.c b/ica/x11/libvncserver/rfbcrypto_polarssl.c
deleted file mode 100644
index 55e3a7b..0000000
--- a/ica/x11/libvncserver/rfbcrypto_polarssl.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <string.h>
-#include <polarssl/md5.h>
-#include <polarssl/sha1.h>
-#include "rfbcrypto.h"
-
-void digestmd5(const struct iovec *iov, int iovcnt, void *dest)
-{
-    md5_context c;
-    int i;
-    
-    md5_starts(&c);
-    for (i = 0; i < iovcnt; i++)
-	md5_update(&c, iov[i].iov_base, iov[i].iov_len);
-    md5_finish(&c, dest);
-}
-
-void digestsha1(const struct iovec *iov, int iovcnt, void *dest)
-{
-    sha1_context c;
-    int i;
-    
-    sha1_starts(&c);
-    for (i = 0; i < iovcnt; i++)
-	sha1_update(&c, iov[i].iov_base, iov[i].iov_len);
-    sha1_finish(&c, dest);
-}
diff --git a/ica/x11/libvncserver/rfbregion.c b/ica/x11/libvncserver/rfbregion.c
deleted file mode 100644
index 1947d7c..0000000
--- a/ica/x11/libvncserver/rfbregion.c
+++ /dev/null
@@ -1,886 +0,0 @@
-/* -=- sraRegion.c
- * Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
- *
- * A general purpose region clipping library
- * Only deals with rectangular regions, though.
- */
-
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-
-/* -=- Internal Span structure */
-
-struct sraRegion;
-
-typedef struct sraSpan {
-  struct sraSpan *_next;
-  struct sraSpan *_prev;
-  int start;
-  int end;
-  struct sraRegion *subspan;
-} sraSpan;
-
-typedef struct sraRegion {
-  sraSpan front;
-  sraSpan back;
-} sraSpanList;
-
-/* -=- Span routines */
-
-sraSpanList *sraSpanListDup(const sraSpanList *src);
-void sraSpanListDestroy(sraSpanList *list);
-
-static sraSpan *
-sraSpanCreate(int start, int end, const sraSpanList *subspan) {
-  sraSpan *item = (sraSpan*)malloc(sizeof(sraSpan));
-  item->_next = item->_prev = NULL;
-  item->start = start;
-  item->end = end;
-  item->subspan = sraSpanListDup(subspan);
-  return item;
-}
-
-static sraSpan *
-sraSpanDup(const sraSpan *src) {
-  sraSpan *span;
-  if (!src) return NULL;
-  span = sraSpanCreate(src->start, src->end, src->subspan);
-  return span;
-}
-
-static void
-sraSpanInsertAfter(sraSpan *newspan, sraSpan *after) {
-  newspan->_next = after->_next;
-  newspan->_prev = after;
-  after->_next->_prev = newspan;
-  after->_next = newspan;
-}
-
-static void
-sraSpanInsertBefore(sraSpan *newspan, sraSpan *before) {
-  newspan->_next = before;
-  newspan->_prev = before->_prev;
-  before->_prev->_next = newspan;
-  before->_prev = newspan;
-}
-
-static void
-sraSpanRemove(sraSpan *span) {
-  span->_prev->_next = span->_next;
-  span->_next->_prev = span->_prev;
-}
-
-static void
-sraSpanDestroy(sraSpan *span) {
-  if (span->subspan) sraSpanListDestroy(span->subspan);
-  free(span);
-}
-
-#ifdef DEBUG
-static void
-sraSpanCheck(const sraSpan *span, const char *text) {
-  /* Check the span is valid! */
-  if (span->start == span->end) {
-    printf(text); 
-    printf(":%d-%d\n", span->start, span->end);
-  }
-}
-#endif
-
-/* -=- SpanList routines */
-
-static void sraSpanPrint(const sraSpan *s);
-
-static void
-sraSpanListPrint(const sraSpanList *l) {
-  sraSpan *curr;
-  if (!l) {
-	  printf("NULL");
-	  return;
-  }
-  curr = l->front._next;
-  printf("[");
-  while (curr != &(l->back)) {
-    sraSpanPrint(curr);
-    curr = curr->_next;
-  }
-  printf("]");
-}
-
-void
-sraSpanPrint(const sraSpan *s) {
-  printf("(%d-%d)", (s->start), (s->end));
-  if (s->subspan)
-    sraSpanListPrint(s->subspan);
-}
-
-static sraSpanList *
-sraSpanListCreate(void) {
-  sraSpanList *item = (sraSpanList*)malloc(sizeof(sraSpanList));
-  item->front._next = &(item->back);
-  item->front._prev = NULL;
-  item->back._prev = &(item->front);
-  item->back._next = NULL;
-  return item;
-}
-
-sraSpanList *
-sraSpanListDup(const sraSpanList *src) {
-  sraSpanList *newlist;
-  sraSpan *newspan, *curr;
-
-  if (!src) return NULL;
-  newlist = sraSpanListCreate();
-  curr = src->front._next;
-  while (curr != &(src->back)) {
-    newspan = sraSpanDup(curr);
-    sraSpanInsertBefore(newspan, &(newlist->back));
-    curr = curr->_next;
-  }
-
-  return newlist;
-}
-
-void
-sraSpanListDestroy(sraSpanList *list) {
-  sraSpan *curr, *next;
-  while (list->front._next != &(list->back)) {
-    curr = list->front._next;
-    next = curr->_next;
-    sraSpanRemove(curr);
-    sraSpanDestroy(curr);
-    curr = next;
-  }
-  free(list);
-}
-
-static void
-sraSpanListMakeEmpty(sraSpanList *list) {
-  sraSpan *curr, *next;
-  while (list->front._next != &(list->back)) {
-    curr = list->front._next;
-    next = curr->_next;
-    sraSpanRemove(curr);
-    sraSpanDestroy(curr);
-    curr = next;
-  }
-  list->front._next = &(list->back);
-  list->front._prev = NULL;
-  list->back._prev = &(list->front);
-  list->back._next = NULL;
-}
-
-static rfbBool
-sraSpanListEqual(const sraSpanList *s1, const sraSpanList *s2) {
-  sraSpan *sp1, *sp2;
-
-  if (!s1) {
-    if (!s2) {
-      return 1;
-    } else {
-      rfbErr("sraSpanListEqual:incompatible spans (only one NULL!)\n");
-      return FALSE;
-    }
-  }
-
-  sp1 = s1->front._next;
-  sp2 = s2->front._next;
-  while ((sp1 != &(s1->back)) &&
-	 (sp2 != &(s2->back))) {
-    if ((sp1->start != sp2->start) ||
-	(sp1->end != sp2->end) ||
-	(!sraSpanListEqual(sp1->subspan, sp2->subspan))) {
-      return 0;
-    }
-    sp1 = sp1->_next;
-    sp2 = sp2->_next;
-  }
-
-  if ((sp1 == &(s1->back)) && (sp2 == &(s2->back))) {
-    return 1;
-  } else {
-    return 0;
-  }    
-}
-
-static rfbBool
-sraSpanListEmpty(const sraSpanList *list) {
-  return (list->front._next == &(list->back));
-}
-
-static unsigned long
-sraSpanListCount(const sraSpanList *list) {
-  sraSpan *curr = list->front._next;
-  unsigned long count = 0;
-  while (curr != &(list->back)) {
-    if (curr->subspan) {
-      count += sraSpanListCount(curr->subspan);
-    } else {
-      count += 1;
-    }
-    curr = curr->_next;
-  }
-  return count;
-}
-
-static void
-sraSpanMergePrevious(sraSpan *dest) {
-  sraSpan *prev = dest->_prev;
- 
-  while ((prev->_prev) &&
-	 (prev->end == dest->start) &&
-	 (sraSpanListEqual(prev->subspan, dest->subspan))) {
-    /*
-    printf("merge_prev:");
-    sraSpanPrint(prev);
-    printf(" & ");
-    sraSpanPrint(dest);
-    printf("\n");
-    */
-    dest->start = prev->start;
-    sraSpanRemove(prev);
-    sraSpanDestroy(prev);
-    prev = dest->_prev;
-  }
-}    
-
-static void
-sraSpanMergeNext(sraSpan *dest) {
-  sraSpan *next = dest->_next;
-  while ((next->_next) &&
-	 (next->start == dest->end) &&
-	 (sraSpanListEqual(next->subspan, dest->subspan))) {
-/*
-	  printf("merge_next:");
-    sraSpanPrint(dest);
-    printf(" & ");
-    sraSpanPrint(next);
-    printf("\n");
-	*/
-    dest->end = next->end;
-    sraSpanRemove(next);
-    sraSpanDestroy(next);
-    next = dest->_next;
-  }
-}
-
-static void
-sraSpanListOr(sraSpanList *dest, const sraSpanList *src) {
-  sraSpan *d_curr, *s_curr;
-  int s_start, s_end;
-
-  if (!dest) {
-    if (!src) {
-      return;
-    } else {
-      rfbErr("sraSpanListOr:incompatible spans (only one NULL!)\n");
-      return;
-    }
-  }
-
-  d_curr = dest->front._next;
-  s_curr = src->front._next;
-  s_start = s_curr->start;
-  s_end = s_curr->end;
-  while (s_curr != &(src->back)) {
-
-    /* - If we are at end of destination list OR
-       If the new span comes before the next destination one */
-    if ((d_curr == &(dest->back)) ||
-		(d_curr->start >= s_end)) {
-      /* - Add the span */
-      sraSpanInsertBefore(sraSpanCreate(s_start, s_end,
-					s_curr->subspan),
-			  d_curr);
-      if (d_curr != &(dest->back))
-	sraSpanMergePrevious(d_curr);
-      s_curr = s_curr->_next;
-      s_start = s_curr->start;
-      s_end = s_curr->end;
-    } else {
-
-      /* - If the new span overlaps the existing one */
-      if ((s_start < d_curr->end) &&
-	  (s_end > d_curr->start)) {
-
-	/* - Insert new span before the existing destination one? */
-	if (s_start < d_curr->start) {
-	  sraSpanInsertBefore(sraSpanCreate(s_start,
-					    d_curr->start,
-					    s_curr->subspan),
-			      d_curr);
-	  sraSpanMergePrevious(d_curr);
-	}
-
-	/* Split the existing span if necessary */
-	if (s_end < d_curr->end) {
-	  sraSpanInsertAfter(sraSpanCreate(s_end,
-					   d_curr->end,
-					   d_curr->subspan),
-			     d_curr);
-	  d_curr->end = s_end;
-	}
-	if (s_start > d_curr->start) {
-	  sraSpanInsertBefore(sraSpanCreate(d_curr->start,
-					    s_start,
-					    d_curr->subspan),
-			      d_curr);
-	  d_curr->start = s_start;
-	}
-
-	/* Recursively OR subspans */
-	sraSpanListOr(d_curr->subspan, s_curr->subspan);
-
-	/* Merge this span with previous or next? */
-	if (d_curr->_prev != &(dest->front))
-	  sraSpanMergePrevious(d_curr);
-	if (d_curr->_next != &(dest->back))
-	  sraSpanMergeNext(d_curr);
-
-	/* Move onto the next pair to compare */
-	if (s_end > d_curr->end) {
-	  s_start = d_curr->end;
-	  d_curr = d_curr->_next;
-	} else {
-	  s_curr = s_curr->_next;
-	  s_start = s_curr->start;
-	  s_end = s_curr->end;
-	}
-      } else {
-	/* - No overlap.  Move to the next destination span */
-	d_curr = d_curr->_next;
-      }
-    }
-  }
-}
-
-static rfbBool
-sraSpanListAnd(sraSpanList *dest, const sraSpanList *src) {
-  sraSpan *d_curr, *s_curr, *d_next;
-
-  if (!dest) {
-    if (!src) {
-      return 1;
-    } else {
-      rfbErr("sraSpanListAnd:incompatible spans (only one NULL!)\n");
-      return FALSE;
-    }
-  }
-
-  d_curr = dest->front._next;
-  s_curr = src->front._next;
-  while ((s_curr != &(src->back)) && (d_curr != &(dest->back))) {
-
-    /* - If we haven't reached a destination span yet then move on */
-    if (d_curr->start >= s_curr->end) {
-      s_curr = s_curr->_next;
-      continue;
-    }
-
-    /* - If we are beyond the current destination span then remove it */
-    if (d_curr->end <= s_curr->start) {
-      sraSpan *next = d_curr->_next;
-      sraSpanRemove(d_curr);
-      sraSpanDestroy(d_curr);
-      d_curr = next;
-      continue;
-    }
-
-    /* - If we partially overlap a span then split it up or remove bits */
-    if (s_curr->start > d_curr->start) {
-      /* - The top bit of the span does not match */
-      d_curr->start = s_curr->start;
-    }
-    if (s_curr->end < d_curr->end) {
-      /* - The end of the span does not match */
-      sraSpanInsertAfter(sraSpanCreate(s_curr->end,
-				       d_curr->end,
-				       d_curr->subspan),
-			 d_curr);
-      d_curr->end = s_curr->end;
-    }
-
-    /* - Now recursively process the affected span */
-    if (!sraSpanListAnd(d_curr->subspan, s_curr->subspan)) {
-      /* - The destination subspan is now empty, so we should remove it */
-		sraSpan *next = d_curr->_next;
-      sraSpanRemove(d_curr);
-      sraSpanDestroy(d_curr);
-      d_curr = next;
-    } else {
-      /* Merge this span with previous or next? */
-      if (d_curr->_prev != &(dest->front))
-	sraSpanMergePrevious(d_curr);
-
-      /* - Move on to the next span */
-      d_next = d_curr;
-      if (s_curr->end >= d_curr->end) {
-	d_next = d_curr->_next;
-      }
-      if (s_curr->end <= d_curr->end) {
-	s_curr = s_curr->_next;
-      }
-      d_curr = d_next;
-    }
-  }
-
-  while (d_curr != &(dest->back)) {
-    sraSpan *next = d_curr->_next;
-    sraSpanRemove(d_curr);
-    sraSpanDestroy(d_curr);
-    d_curr=next;
-  }
-
-  return !sraSpanListEmpty(dest);
-}
-
-static rfbBool
-sraSpanListSubtract(sraSpanList *dest, const sraSpanList *src) {
-  sraSpan *d_curr, *s_curr;
-
-  if (!dest) {
-    if (!src) {
-      return 1;
-    } else {
-      rfbErr("sraSpanListSubtract:incompatible spans (only one NULL!)\n");
-      return FALSE;
-    }
-  }
-
-  d_curr = dest->front._next;
-  s_curr = src->front._next;
-  while ((s_curr != &(src->back)) && (d_curr != &(dest->back))) {
-
-    /* - If we haven't reached a destination span yet then move on */
-    if (d_curr->start >= s_curr->end) {
-      s_curr = s_curr->_next;
-      continue;
-    }
-
-    /* - If we are beyond the current destination span then skip it */
-    if (d_curr->end <= s_curr->start) {
-      d_curr = d_curr->_next;
-      continue;
-    }
-
-    /* - If we partially overlap the current span then split it up */
-    if (s_curr->start > d_curr->start) {
-      sraSpanInsertBefore(sraSpanCreate(d_curr->start,
-					s_curr->start,
-					d_curr->subspan),
-			  d_curr);
-      d_curr->start = s_curr->start;
-    }
-    if (s_curr->end < d_curr->end) {
-      sraSpanInsertAfter(sraSpanCreate(s_curr->end,
-				       d_curr->end,
-				       d_curr->subspan),
-			 d_curr);
-      d_curr->end = s_curr->end;
-    }
-
-    /* - Now recursively process the affected span */
-    if ((!d_curr->subspan) || !sraSpanListSubtract(d_curr->subspan, s_curr->subspan)) {
-      /* - The destination subspan is now empty, so we should remove it */
-      sraSpan *next = d_curr->_next;
-      sraSpanRemove(d_curr);
-      sraSpanDestroy(d_curr);
-      d_curr = next;
-    } else {
-      /* Merge this span with previous or next? */
-      if (d_curr->_prev != &(dest->front))
-	sraSpanMergePrevious(d_curr);
-      if (d_curr->_next != &(dest->back))
-	sraSpanMergeNext(d_curr);
-
-      /* - Move on to the next span */
-      if (s_curr->end > d_curr->end) {
-	d_curr = d_curr->_next;
-      } else {
-	s_curr = s_curr->_next;
-      }
-    }
-  }
-
-  return !sraSpanListEmpty(dest);
-}
-
-/* -=- Region routines */
-
-sraRegion *
-sraRgnCreate(void) {
-  return (sraRegion*)sraSpanListCreate();
-}
-
-sraRegion *
-sraRgnCreateRect(int x1, int y1, int x2, int y2) {
-  sraSpanList *vlist, *hlist;
-  sraSpan *vspan, *hspan;
-
-  /* - Build the horizontal portion of the span */
-  hlist = sraSpanListCreate();
-  hspan = sraSpanCreate(x1, x2, NULL);
-  sraSpanInsertAfter(hspan, &(hlist->front));
-
-  /* - Build the vertical portion of the span */
-  vlist = sraSpanListCreate();
-  vspan = sraSpanCreate(y1, y2, hlist);
-  sraSpanInsertAfter(vspan, &(vlist->front));
-
-  sraSpanListDestroy(hlist);
-
-  return (sraRegion*)vlist;
-}
-
-sraRegion *
-sraRgnCreateRgn(const sraRegion *src) {
-  return (sraRegion*)sraSpanListDup((sraSpanList*)src);
-}
-
-void
-sraRgnDestroy(sraRegion *rgn) {
-  sraSpanListDestroy((sraSpanList*)rgn);
-}
-
-void
-sraRgnMakeEmpty(sraRegion *rgn) {
-  sraSpanListMakeEmpty((sraSpanList*)rgn);
-}
-
-/* -=- Boolean Region ops */
-
-rfbBool
-sraRgnAnd(sraRegion *dst, const sraRegion *src) {
-  return sraSpanListAnd((sraSpanList*)dst, (sraSpanList*)src);
-}
-
-void
-sraRgnOr(sraRegion *dst, const sraRegion *src) {
-  sraSpanListOr((sraSpanList*)dst, (sraSpanList*)src);
-}
-
-rfbBool
-sraRgnSubtract(sraRegion *dst, const sraRegion *src) {
-  return sraSpanListSubtract((sraSpanList*)dst, (sraSpanList*)src);
-}
-
-void
-sraRgnOffset(sraRegion *dst, int dx, int dy) {
-  sraSpan *vcurr, *hcurr;
-
-  vcurr = ((sraSpanList*)dst)->front._next;
-  while (vcurr != &(((sraSpanList*)dst)->back)) {
-    vcurr->start += dy;
-    vcurr->end += dy;
-    
-    hcurr = vcurr->subspan->front._next;
-    while (hcurr != &(vcurr->subspan->back)) {
-      hcurr->start += dx;
-      hcurr->end += dx;
-      hcurr = hcurr->_next;
-    }
-
-    vcurr = vcurr->_next;
-  }
-}
-
-sraRegion *sraRgnBBox(const sraRegion *src) {
-  int xmin=((unsigned int)(int)-1)>>1,ymin=xmin,xmax=1-xmin,ymax=xmax;
-  sraSpan *vcurr, *hcurr;
-
-  if(!src)
-    return sraRgnCreate();
-
-  vcurr = ((sraSpanList*)src)->front._next;
-  while (vcurr != &(((sraSpanList*)src)->back)) {
-    if(vcurr->start<ymin)
-      ymin=vcurr->start;
-    if(vcurr->end>ymax)
-      ymax=vcurr->end;
-    
-    hcurr = vcurr->subspan->front._next;
-    while (hcurr != &(vcurr->subspan->back)) {
-      if(hcurr->start<xmin)
-	xmin=hcurr->start;
-      if(hcurr->end>xmax)
-	xmax=hcurr->end;
-      hcurr = hcurr->_next;
-    }
-
-    vcurr = vcurr->_next;
-  }
-
-  if(xmax<xmin || ymax<ymin)
-    return sraRgnCreate();
-
-  return sraRgnCreateRect(xmin,ymin,xmax,ymax);
-}
-
-rfbBool
-sraRgnPopRect(sraRegion *rgn, sraRect *rect, unsigned long flags) {
-  sraSpan *vcurr, *hcurr;
-  sraSpan *vend, *hend;
-  rfbBool right2left = (flags & 2) == 2;
-  rfbBool bottom2top = (flags & 1) == 1;
-
-  /* - Pick correct order */
-  if (bottom2top) {
-    vcurr = ((sraSpanList*)rgn)->back._prev;
-    vend = &(((sraSpanList*)rgn)->front);
-  } else {
-    vcurr = ((sraSpanList*)rgn)->front._next;
-    vend = &(((sraSpanList*)rgn)->back);
-  }
-
-  if (vcurr != vend) {
-    rect->y1 = vcurr->start;
-    rect->y2 = vcurr->end;
-
-    /* - Pick correct order */
-    if (right2left) {
-      hcurr = vcurr->subspan->back._prev;
-      hend = &(vcurr->subspan->front);
-    } else {
-      hcurr = vcurr->subspan->front._next;
-      hend = &(vcurr->subspan->back);
-    }
-
-    if (hcurr != hend) {
-      rect->x1 = hcurr->start;
-      rect->x2 = hcurr->end;
-
-      sraSpanRemove(hcurr);
-      sraSpanDestroy(hcurr);
-      
-      if (sraSpanListEmpty(vcurr->subspan)) {
-	sraSpanRemove(vcurr);
-	sraSpanDestroy(vcurr);
-      }
-
-#if 0
-      printf("poprect:(%dx%d)-(%dx%d)\n",
-	     rect->x1, rect->y1, rect->x2, rect->y2);
-#endif
-      return 1;
-    }
-  }
-
-  return 0;
-}
-
-unsigned long
-sraRgnCountRects(const sraRegion *rgn) {
-  unsigned long count = sraSpanListCount((sraSpanList*)rgn);
-  return count;
-}
-
-rfbBool
-sraRgnEmpty(const sraRegion *rgn) {
-  return sraSpanListEmpty((sraSpanList*)rgn);
-}
-
-/* iterator stuff */
-sraRectangleIterator *sraRgnGetIterator(sraRegion *s)
-{
-  /* these values have to be multiples of 4 */
-#define DEFSIZE 4
-#define DEFSTEP 8
-  sraRectangleIterator *i =
-    (sraRectangleIterator*)malloc(sizeof(sraRectangleIterator));
-  if(!i)
-    return NULL;
-
-  /* we have to recurse eventually. So, the first sPtr is the pointer to
-     the sraSpan in the first level. the second sPtr is the pointer to
-     the sraRegion.back. The third and fourth sPtr are for the second
-     recursion level and so on. */
-  i->sPtrs = (sraSpan**)malloc(sizeof(sraSpan*)*DEFSIZE);
-  if(!i->sPtrs) {
-    free(i);
-    return NULL;
-  }
-  i->ptrSize = DEFSIZE;
-  i->sPtrs[0] = &(s->front);
-  i->sPtrs[1] = &(s->back);
-  i->ptrPos = 0;
-  i->reverseX = 0;
-  i->reverseY = 0;
-  return i;
-}
-
-sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,rfbBool reverseX,rfbBool reverseY)
-{
-  sraRectangleIterator *i = sraRgnGetIterator(s);
-  if(reverseY) {
-    i->sPtrs[1] = &(s->front);
-    i->sPtrs[0] = &(s->back);
-  }
-  i->reverseX = reverseX;
-  i->reverseY = reverseY;
-  return(i);
-}
-
-static rfbBool sraReverse(sraRectangleIterator *i)
-{
-  return( ((i->ptrPos&2) && i->reverseX) ||
-     (!(i->ptrPos&2) && i->reverseY));
-}
-
-static sraSpan* sraNextSpan(sraRectangleIterator *i)
-{
-  if(sraReverse(i))
-    return(i->sPtrs[i->ptrPos]->_prev);
-  else
-    return(i->sPtrs[i->ptrPos]->_next);
-}
-
-rfbBool sraRgnIteratorNext(sraRectangleIterator* i,sraRect* r)
-{
-  /* is the subspan finished? */
-  while(sraNextSpan(i) == i->sPtrs[i->ptrPos+1]) {
-    i->ptrPos -= 2;
-    if(i->ptrPos < 0) /* the end */
-      return(0);
-  }
-
-  i->sPtrs[i->ptrPos] = sraNextSpan(i);
-
-  /* is this a new subspan? */
-  while(i->sPtrs[i->ptrPos]->subspan) {
-    if(i->ptrPos+2 > i->ptrSize) { /* array is too small */
-      i->ptrSize += DEFSTEP;
-      i->sPtrs = (sraSpan**)realloc(i->sPtrs, sizeof(sraSpan*)*i->ptrSize);
-    }
-    i->ptrPos += 2;
-    if(sraReverse(i)) {
-      i->sPtrs[i->ptrPos]   =   i->sPtrs[i->ptrPos-2]->subspan->back._prev;
-      i->sPtrs[i->ptrPos+1] = &(i->sPtrs[i->ptrPos-2]->subspan->front);
-    } else {
-      i->sPtrs[i->ptrPos]   =   i->sPtrs[i->ptrPos-2]->subspan->front._next;
-      i->sPtrs[i->ptrPos+1] = &(i->sPtrs[i->ptrPos-2]->subspan->back);
-    }
-  }
-
-  if((i->ptrPos%4)!=2) {
-    rfbErr("sraRgnIteratorNext: offset is wrong (%d%%4!=2)\n",i->ptrPos);
-    return FALSE;
-  }
-
-  r->y1 = i->sPtrs[i->ptrPos-2]->start;
-  r->y2 = i->sPtrs[i->ptrPos-2]->end;
-  r->x1 = i->sPtrs[i->ptrPos]->start;
-  r->x2 = i->sPtrs[i->ptrPos]->end;
-
-  return(-1);
-}
-
-void sraRgnReleaseIterator(sraRectangleIterator* i)
-{
-  free(i->sPtrs);
-  free(i);
-}
-
-void
-sraRgnPrint(const sraRegion *rgn) {
-	sraSpanListPrint((sraSpanList*)rgn);
-}
-
-rfbBool
-sraClipRect(int *x, int *y, int *w, int *h,
-	    int cx, int cy, int cw, int ch) {
-  if (*x < cx) {
-    *w -= (cx-*x);
-    *x = cx;
-  }
-  if (*y < cy) {
-    *h -= (cy-*y);
-    *y = cy;
-  }
-  if (*x+*w > cx+cw) {
-    *w = (cx+cw)-*x;
-  }
-  if (*y+*h > cy+ch) {
-    *h = (cy+ch)-*y;
-  }
-  return (*w>0) && (*h>0);
-}
-
-rfbBool
-sraClipRect2(int *x, int *y, int *x2, int *y2,
-	    int cx, int cy, int cx2, int cy2) {
-  if (*x < cx)
-    *x = cx;
-  if (*y < cy)
-    *y = cy;
-  if (*x >= cx2)
-    *x = cx2-1;
-  if (*y >= cy2)
-    *y = cy2-1;
-  if (*x2 <= cx)
-    *x2 = cx+1;
-  if (*y2 <= cy)
-    *y2 = cy+1;
-  if (*x2 > cx2)
-    *x2 = cx2;
-  if (*y2 > cy2)
-    *y2 = cy2;
-  return (*x2>*x) && (*y2>*y);
-}
-
-/* test */
-
-#ifdef SRA_TEST
-/* pipe the output to sort|uniq -u and you'll get the errors. */
-int main(int argc, char** argv)
-{
-  sraRegionPtr region, region1, region2;
-  sraRectangleIterator* i;
-  sraRect rect;
-  rfbBool b;
-
-  region = sraRgnCreateRect(10, 10, 600, 300);
-  region1 = sraRgnCreateRect(40, 50, 350, 200);
-  region2 = sraRgnCreateRect(0, 0, 20, 40);
-
-  sraRgnPrint(region);
-  printf("\n[(10-300)[(10-600)]]\n\n");
-
-  b = sraRgnSubtract(region, region1);
-  printf("%s ",b?"true":"false");
-  sraRgnPrint(region);
-  printf("\ntrue [(10-50)[(10-600)](50-200)[(10-40)(350-600)](200-300)[(10-600)]]\n\n");
-
-  sraRgnOr(region, region2);
-  printf("%ld\n6\n\n", sraRgnCountRects(region));
-
-  i = sraRgnGetIterator(region);
-  while(sraRgnIteratorNext(i, &rect))
-    printf("%dx%d+%d+%d ",
-	   rect.x2-rect.x1,rect.y2-rect.y1,
-	   rect.x1,rect.y1);
-  sraRgnReleaseIterator(i);
-  printf("\n20x10+0+0 600x30+0+10 590x10+10+40 30x150+10+50 250x150+350+50 590x100+10+200 \n\n");
-
-  i = sraRgnGetReverseIterator(region,1,0);
-  while(sraRgnIteratorNext(i, &rect))
-    printf("%dx%d+%d+%d ",
-	   rect.x2-rect.x1,rect.y2-rect.y1,
-	   rect.x1,rect.y1);
-  sraRgnReleaseIterator(i);
-  printf("\n20x10+0+0 600x30+0+10 590x10+10+40 250x150+350+50 30x150+10+50 590x100+10+200 \n\n");
-
-  i = sraRgnGetReverseIterator(region,1,1);
-  while(sraRgnIteratorNext(i, &rect))
-    printf("%dx%d+%d+%d ",
-	   rect.x2-rect.x1,rect.y2-rect.y1,
-	   rect.x1,rect.y1);
-  sraRgnReleaseIterator(i);
-  printf("\n590x100+10+200 250x150+350+50 30x150+10+50 590x10+10+40 600x30+0+10 20x10+0+0 \n\n");
-
-  sraRgnDestroy(region);
-  sraRgnDestroy(region1);
-  sraRgnDestroy(region2);
-
-  return(0);
-}
-#endif
diff --git a/ica/x11/libvncserver/rfbserver.c b/ica/x11/libvncserver/rfbserver.c
deleted file mode 100644
index 5f3b31d..0000000
--- a/ica/x11/libvncserver/rfbserver.c
+++ /dev/null
@@ -1,3457 +0,0 @@
-/*
- * rfbserver.c - deal with server-side of the RFB protocol.
- */
-
-/*
- *  Copyright (C) 2011-2012 D. R. Commander
- *  Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
- *  Copyright (C) 2002 RealVNC Ltd.
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE 600
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-#include "private.h"
-
-#ifdef LIBVNCSERVER_HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef WIN32
-#define write(sock,buf,len) send(sock,buf,len,0)
-#else
-#ifdef LIBVNCSERVER_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <pwd.h>
-#ifdef LIBVNCSERVER_HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#endif
-#endif
-
-#ifdef DEBUGPROTO
-#undef DEBUGPROTO
-#define DEBUGPROTO(x) x
-#else
-#define DEBUGPROTO(x)
-#endif
-#include <stdarg.h>
-#include <scale.h>
-/* stst() */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-/* readdir() */
-#include <dirent.h>
-/* errno */
-#include <errno.h>
-/* strftime() */
-#include <time.h>
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-#include "rfbssl.h"
-#endif
-
-#ifdef __MINGW32__
-static int compat_mkdir(const char *path, int mode)
-{
-	return mkdir(path);
-}
-#define mkdir compat_mkdir
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-/*
- * Map of quality levels to provide compatibility with TightVNC/TigerVNC
- * clients.  This emulates the behavior of the TigerVNC Server.
- */
-
-static const int tight2turbo_qual[10] = {
-   15, 29, 41, 42, 62, 77, 79, 86, 92, 100
-};
-
-static const int tight2turbo_subsamp[10] = {
-   1, 1, 1, 2, 2, 2, 0, 0, 0, 0
-};
-#endif
-
-static void rfbProcessClientProtocolVersion(rfbClientPtr cl);
-static void rfbProcessClientNormalMessage(rfbClientPtr cl);
-static void rfbProcessClientInitMessage(rfbClientPtr cl);
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-void rfbIncrClientRef(rfbClientPtr cl)
-{
-  LOCK(cl->refCountMutex);
-  cl->refCount++;
-  UNLOCK(cl->refCountMutex);
-}
-
-void rfbDecrClientRef(rfbClientPtr cl)
-{
-  LOCK(cl->refCountMutex);
-  cl->refCount--;
-  if(cl->refCount<=0) /* just to be sure also < 0 */
-    TSIGNAL(cl->deleteCond);
-  UNLOCK(cl->refCountMutex);
-}
-#else
-void rfbIncrClientRef(rfbClientPtr cl) {}
-void rfbDecrClientRef(rfbClientPtr cl) {}
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-static MUTEX(rfbClientListMutex);
-#endif
-
-struct rfbClientIterator {
-  rfbClientPtr next;
-  rfbScreenInfoPtr screen;
-  rfbBool closedToo;
-};
-
-void
-rfbClientListInit(rfbScreenInfoPtr rfbScreen)
-{
-    if(sizeof(rfbBool)!=1) {
-        /* a sanity check */
-        fprintf(stderr,"rfbBool's size is not 1 (%d)!\n",(int)sizeof(rfbBool));
-	/* we cannot continue, because rfbBool is supposed to be char everywhere */
-	exit(1);
-    }
-    rfbScreen->clientHead = NULL;
-    INIT_MUTEX(rfbClientListMutex);
-}
-
-rfbClientIteratorPtr
-rfbGetClientIterator(rfbScreenInfoPtr rfbScreen)
-{
-  rfbClientIteratorPtr i =
-    (rfbClientIteratorPtr)malloc(sizeof(struct rfbClientIterator));
-  i->next = NULL;
-  i->screen = rfbScreen;
-  i->closedToo = FALSE;
-  return i;
-}
-
-rfbClientIteratorPtr
-rfbGetClientIteratorWithClosed(rfbScreenInfoPtr rfbScreen)
-{
-  rfbClientIteratorPtr i =
-    (rfbClientIteratorPtr)malloc(sizeof(struct rfbClientIterator));
-  i->next = NULL;
-  i->screen = rfbScreen;
-  i->closedToo = TRUE;
-  return i;
-}
-
-rfbClientPtr
-rfbClientIteratorHead(rfbClientIteratorPtr i)
-{
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-  if(i->next != 0) {
-    rfbDecrClientRef(i->next);
-    rfbIncrClientRef(i->screen->clientHead);
-  }
-#endif
-  LOCK(rfbClientListMutex);
-  i->next = i->screen->clientHead;
-  UNLOCK(rfbClientListMutex);
-  return i->next;
-}
-
-rfbClientPtr
-rfbClientIteratorNext(rfbClientIteratorPtr i)
-{
-  if(i->next == 0) {
-    LOCK(rfbClientListMutex);
-    i->next = i->screen->clientHead;
-    UNLOCK(rfbClientListMutex);
-  } else {
-    IF_PTHREADS(rfbClientPtr cl = i->next);
-    i->next = i->next->next;
-    IF_PTHREADS(rfbDecrClientRef(cl));
-  }
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-    if(!i->closedToo)
-      while(i->next && i->next->sock<0)
-        i->next = i->next->next;
-    if(i->next)
-      rfbIncrClientRef(i->next);
-#endif
-
-    return i->next;
-}
-
-void
-rfbReleaseClientIterator(rfbClientIteratorPtr iterator)
-{
-  IF_PTHREADS(if(iterator->next) rfbDecrClientRef(iterator->next));
-  free(iterator);
-}
-
-
-/*
- * rfbNewClientConnection is called from sockets.c when a new connection
- * comes in.
- */
-
-void
-rfbNewClientConnection(rfbScreenInfoPtr rfbScreen,
-                       int sock)
-{
-    rfbNewClient(rfbScreen,sock);
-}
-
-
-/*
- * rfbReverseConnection is called to make an outward
- * connection to a "listening" RFB client.
- */
-
-rfbClientPtr
-rfbReverseConnection(rfbScreenInfoPtr rfbScreen,
-                     char *host,
-                     int port)
-{
-    int sock;
-    rfbClientPtr cl;
-
-    if ((sock = rfbConnect(rfbScreen, host, port)) < 0)
-        return (rfbClientPtr)NULL;
-
-    cl = rfbNewClient(rfbScreen, sock);
-
-    if (cl) {
-        cl->reverseConnection = TRUE;
-    }
-
-    return cl;
-}
-
-
-void
-rfbSetProtocolVersion(rfbScreenInfoPtr rfbScreen, int major_, int minor_)
-{
-    /* Permit the server to set the version to report */
-    /* TODO: sanity checking */
-    if ((major_==3) && (minor_ > 2 && minor_ < 9))
-    {
-      rfbScreen->protocolMajorVersion = major_;
-      rfbScreen->protocolMinorVersion = minor_;
-    }
-    else
-        rfbLog("rfbSetProtocolVersion(%d,%d) set to invalid values\n", major_, minor_);
-}
-
-/*
- * rfbNewClient is called when a new connection has been made by whatever
- * means.
- */
-
-static rfbClientPtr
-rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
-                     int sock,
-                     rfbBool isUDP)
-{
-    rfbProtocolVersionMsg pv;
-    rfbClientIteratorPtr iterator;
-    rfbClientPtr cl,cl_;
-#ifdef LIBVNCSERVER_IPv6
-    struct sockaddr_storage addr;
-#else
-    struct sockaddr_in addr;
-#endif
-    socklen_t addrlen = sizeof(addr);
-    rfbProtocolExtension* extension;
-
-    cl = (rfbClientPtr)calloc(sizeof(rfbClientRec),1);
-
-    cl->screen = rfbScreen;
-    cl->sock = sock;
-    cl->viewOnly = FALSE;
-    /* setup pseudo scaling */
-    cl->scaledScreen = rfbScreen;
-    cl->scaledScreen->scaledScreenRefCount++;
-
-    rfbResetStats(cl);
-
-    cl->clientData = NULL;
-    cl->clientGoneHook = rfbDoNothingWithClient;
-
-    if(isUDP) {
-      rfbLog(" accepted UDP client\n");
-    } else {
-      int one=1;
-
-      getpeername(sock, (struct sockaddr *)&addr, &addrlen);
-#ifdef LIBVNCSERVER_IPv6
-      char host[1024];
-      if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
-	rfbLogPerror("rfbNewClient: error in getnameinfo");
-	cl->host = strdup("");
-      }
-      else
-	cl->host = strdup(host);
-#else
-      cl->host = strdup(inet_ntoa(addr.sin_addr));
-#endif
-
-      rfbLog("  other clients:\n");
-      iterator = rfbGetClientIterator(rfbScreen);
-      while ((cl_ = rfbClientIteratorNext(iterator)) != NULL) {
-        rfbLog("     %s\n",cl_->host);
-      }
-      rfbReleaseClientIterator(iterator);
-
-      if(!rfbSetNonBlocking(sock)) {
-	close(sock);
-	return NULL;
-      }
-
-      if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-		     (char *)&one, sizeof(one)) < 0) {
-	rfbLogPerror("setsockopt failed");
-	close(sock);
-	return NULL;
-      }
-
-      FD_SET(sock,&(rfbScreen->allFds));
-		rfbScreen->maxFd = max(sock,rfbScreen->maxFd);
-
-      INIT_MUTEX(cl->outputMutex);
-      INIT_MUTEX(cl->refCountMutex);
-      INIT_MUTEX(cl->sendMutex);
-      INIT_COND(cl->deleteCond);
-
-      cl->state = RFB_PROTOCOL_VERSION;
-
-      cl->reverseConnection = FALSE;
-      cl->readyForSetColourMapEntries = FALSE;
-      cl->useCopyRect = FALSE;
-      cl->preferredEncoding = -1;
-      cl->correMaxWidth = 48;
-      cl->correMaxHeight = 48;
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-      cl->zrleData = NULL;
-#endif
-
-      cl->copyRegion = sraRgnCreate();
-      cl->copyDX = 0;
-      cl->copyDY = 0;
-   
-      cl->modifiedRegion =
-	sraRgnCreateRect(0,0,rfbScreen->width,rfbScreen->height);
-
-      INIT_MUTEX(cl->updateMutex);
-      INIT_COND(cl->updateCond);
-
-      cl->requestedRegion = sraRgnCreate();
-
-      cl->format = cl->screen->serverFormat;
-      cl->translateFn = rfbTranslateNone;
-      cl->translateLookupTable = NULL;
-
-      LOCK(rfbClientListMutex);
-
-      IF_PTHREADS(cl->refCount = 0);
-      cl->next = rfbScreen->clientHead;
-      cl->prev = NULL;
-      if (rfbScreen->clientHead)
-        rfbScreen->clientHead->prev = cl;
-
-      rfbScreen->clientHead = cl;
-      UNLOCK(rfbClientListMutex);
-
-#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
-      cl->tightQualityLevel = -1;
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-      cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
-      cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP;
-      {
-	int i;
-	for (i = 0; i < 4; i++)
-          cl->zsActive[i] = FALSE;
-      }
-#endif
-#endif
-
-      cl->fileTransfer.fd = -1;
-
-      cl->enableCursorShapeUpdates = FALSE;
-      cl->enableCursorPosUpdates = FALSE;
-      cl->useRichCursorEncoding = FALSE;
-      cl->enableLastRectEncoding = FALSE;
-      cl->enableKeyboardLedState = FALSE;
-      cl->enableSupportedMessages = FALSE;
-      cl->enableSupportedEncodings = FALSE;
-      cl->enableServerIdentity = FALSE;
-      cl->lastKeyboardLedState = -1;
-      cl->cursorX = rfbScreen->cursorX;
-      cl->cursorY = rfbScreen->cursorY;
-      cl->useNewFBSize = FALSE;
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-      cl->compStreamInited = FALSE;
-      cl->compStream.total_in = 0;
-      cl->compStream.total_out = 0;
-      cl->compStream.zalloc = Z_NULL;
-      cl->compStream.zfree = Z_NULL;
-      cl->compStream.opaque = Z_NULL;
-
-      cl->zlibCompressLevel = 5;
-#endif
-
-      cl->progressiveSliceY = 0;
-
-      cl->extensions = NULL;
-
-      cl->lastPtrX = -1;
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-      /*
-       * Wait a few ms for the client to send one of:
-       * - Flash policy request
-       * - WebSockets connection (TLS/SSL or plain)
-       */
-      if (!webSocketsCheck(cl)) {
-        /* Error reporting handled in webSocketsHandshake */
-        rfbCloseClient(cl);
-        rfbClientConnectionGone(cl);
-        return NULL;
-      }
-#endif
-
-      sprintf(pv,rfbProtocolVersionFormat,rfbScreen->protocolMajorVersion, 
-              rfbScreen->protocolMinorVersion);
-
-      if (rfbWriteExact(cl, pv, sz_rfbProtocolVersionMsg) < 0) {
-        rfbLogPerror("rfbNewClient: write");
-        rfbCloseClient(cl);
-	rfbClientConnectionGone(cl);
-        return NULL;
-      }
-    }
-
-    for(extension = rfbGetExtensionIterator(); extension;
-	    extension=extension->next) {
-	void* data = NULL;
-	/* if the extension does not have a newClient method, it wants
-	 * to be initialized later. */
-	if(extension->newClient && extension->newClient(cl, &data))
-		rfbEnableExtension(cl, extension, data);
-    }
-    rfbReleaseExtensionIterator();
-
-    switch (cl->screen->newClientHook(cl)) {
-    case RFB_CLIENT_ON_HOLD:
-	    cl->onHold = TRUE;
-	    break;
-    case RFB_CLIENT_ACCEPT:
-	    cl->onHold = FALSE;
-	    break;
-    case RFB_CLIENT_REFUSE:
-	    rfbCloseClient(cl);
-	    rfbClientConnectionGone(cl);
-	    cl = NULL;
-	    break;
-    }
-    return cl;
-}
-
-rfbClientPtr
-rfbNewClient(rfbScreenInfoPtr rfbScreen,
-             int sock)
-{
-  return(rfbNewTCPOrUDPClient(rfbScreen,sock,FALSE));
-}
-
-rfbClientPtr
-rfbNewUDPClient(rfbScreenInfoPtr rfbScreen)
-{
-  return((rfbScreen->udpClient=
-	  rfbNewTCPOrUDPClient(rfbScreen,rfbScreen->udpSock,TRUE)));
-}
-
-/*
- * rfbClientConnectionGone is called from sockets.c just after a connection
- * has gone away.
- */
-
-void
-rfbClientConnectionGone(rfbClientPtr cl)
-{
-#if defined(LIBVNCSERVER_HAVE_LIBZ) && defined(LIBVNCSERVER_HAVE_LIBJPEG)
-    int i;
-#endif
-
-    LOCK(rfbClientListMutex);
-
-    if (cl->prev)
-        cl->prev->next = cl->next;
-    else
-        cl->screen->clientHead = cl->next;
-    if (cl->next)
-        cl->next->prev = cl->prev;
-
-    UNLOCK(rfbClientListMutex);
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-    if(cl->screen->backgroundLoop != FALSE) {
-      int i;
-      do {
-	LOCK(cl->refCountMutex);
-	i=cl->refCount;
-	if(i>0)
-	  WAIT(cl->deleteCond,cl->refCountMutex);
-	UNLOCK(cl->refCountMutex);
-      } while(i>0);
-    }
-#endif
-
-    if(cl->sock>=0)
-	close(cl->sock);
-
-    if (cl->scaledScreen!=NULL)
-        cl->scaledScreen->scaledScreenRefCount--;
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    rfbFreeZrleData(cl);
-#endif
-
-    rfbFreeUltraData(cl);
-
-    /* free buffers holding pixel data before and after encoding */
-    free(cl->beforeEncBuf);
-    free(cl->afterEncBuf);
-
-    if(cl->sock>=0)
-       FD_CLR(cl->sock,&(cl->screen->allFds));
-
-    cl->clientGoneHook(cl);
-
-    rfbLog("Client %s gone\n",cl->host);
-    free(cl->host);
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    /* Release the compression state structures if any. */
-    if ( cl->compStreamInited ) {
-	deflateEnd( &(cl->compStream) );
-    }
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-    for (i = 0; i < 4; i++) {
-	if (cl->zsActive[i])
-	    deflateEnd(&cl->zsStruct[i]);
-    }
-#endif
-#endif
-
-    if (cl->screen->pointerClient == cl)
-        cl->screen->pointerClient = NULL;
-
-    sraRgnDestroy(cl->modifiedRegion);
-    sraRgnDestroy(cl->requestedRegion);
-    sraRgnDestroy(cl->copyRegion);
-
-    if (cl->translateLookupTable) free(cl->translateLookupTable);
-
-    TINI_COND(cl->updateCond);
-    TINI_MUTEX(cl->updateMutex);
-
-    /* make sure outputMutex is unlocked before destroying */
-    LOCK(cl->outputMutex);
-    UNLOCK(cl->outputMutex);
-    TINI_MUTEX(cl->outputMutex);
-
-    LOCK(cl->sendMutex);
-    UNLOCK(cl->sendMutex);
-    TINI_MUTEX(cl->sendMutex);
-
-    rfbPrintStats(cl);
-    rfbResetStats(cl);
-
-    free(cl);
-}
-
-
-/*
- * rfbProcessClientMessage is called when there is data to read from a client.
- */
-
-void
-rfbProcessClientMessage(rfbClientPtr cl)
-{
-    switch (cl->state) {
-    case RFB_PROTOCOL_VERSION:
-        rfbProcessClientProtocolVersion(cl);
-        return;
-    case RFB_SECURITY_TYPE:
-        rfbProcessClientSecurityType(cl);
-        return;
-    case RFB_AUTHENTICATION:
-        rfbAuthProcessClientMessage(cl);
-        return;
-    case RFB_INITIALISATION:
-    case RFB_INITIALISATION_SHARED:
-        rfbProcessClientInitMessage(cl);
-        return;
-    default:
-        rfbProcessClientNormalMessage(cl);
-        return;
-    }
-}
-
-
-/*
- * rfbProcessClientProtocolVersion is called when the client sends its
- * protocol version.
- */
-
-static void
-rfbProcessClientProtocolVersion(rfbClientPtr cl)
-{
-    rfbProtocolVersionMsg pv;
-    int n, major_, minor_;
-
-    if ((n = rfbReadExact(cl, pv, sz_rfbProtocolVersionMsg)) <= 0) {
-        if (n == 0)
-            rfbLog("rfbProcessClientProtocolVersion: client gone\n");
-        else
-            rfbLogPerror("rfbProcessClientProtocolVersion: read");
-        rfbCloseClient(cl);
-        return;
-    }
-
-    pv[sz_rfbProtocolVersionMsg] = 0;
-    if (sscanf(pv,rfbProtocolVersionFormat,&major_,&minor_) != 2) {
-	rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client: %s\n", pv);
-	rfbCloseClient(cl);
-	return;
-    }
-    rfbLog("Client Protocol Version %d.%d\n", major_, minor_);
-
-    if (major_ != rfbProtocolMajorVersion) {
-        rfbErr("RFB protocol version mismatch - server %d.%d, client %d.%d",
-                cl->screen->protocolMajorVersion, cl->screen->protocolMinorVersion,
-                major_,minor_);
-        rfbCloseClient(cl);
-        return;
-    }
-
-    /* Check for the minor version use either of the two standard version of RFB */
-    /*
-     * UltraVNC Viewer detects FileTransfer compatible servers via rfb versions
-     * 3.4, 3.6, 3.14, 3.16
-     * It's a bad method, but it is what they use to enable features...
-     * maintaining RFB version compatibility across multiple servers is a pain
-     * Should use something like ServerIdentity encoding
-     */
-    cl->protocolMajorVersion = major_;
-    cl->protocolMinorVersion = minor_;
-    
-    rfbLog("Protocol version sent %d.%d, using %d.%d\n",
-              major_, minor_, rfbProtocolMajorVersion, cl->protocolMinorVersion);
-
-    rfbAuthNewClient(cl);
-}
-
-
-void
-rfbClientSendString(rfbClientPtr cl, const char *reason)
-{
-    char *buf;
-    int len = strlen(reason);
-
-    rfbLog("rfbClientSendString(\"%s\")\n", reason);
-
-    buf = (char *)malloc(4 + len);
-    ((uint32_t *)buf)[0] = Swap32IfLE(len);
-    memcpy(buf + 4, reason, len);
-
-    if (rfbWriteExact(cl, buf, 4 + len) < 0)
-        rfbLogPerror("rfbClientSendString: write");
-    free(buf);
-
-    rfbCloseClient(cl);
-}
-
-/*
- * rfbClientConnFailed is called when a client connection has failed either
- * because it talks the wrong protocol or it has failed authentication.
- */
-
-void
-rfbClientConnFailed(rfbClientPtr cl,
-                    const char *reason)
-{
-    char *buf;
-    int len = strlen(reason);
-
-    rfbLog("rfbClientConnFailed(\"%s\")\n", reason);
-
-    buf = (char *)malloc(8 + len);
-    ((uint32_t *)buf)[0] = Swap32IfLE(rfbConnFailed);
-    ((uint32_t *)buf)[1] = Swap32IfLE(len);
-    memcpy(buf + 8, reason, len);
-
-    if (rfbWriteExact(cl, buf, 8 + len) < 0)
-        rfbLogPerror("rfbClientConnFailed: write");
-    free(buf);
-
-    rfbCloseClient(cl);
-}
-
-
-/*
- * rfbProcessClientInitMessage is called when the client sends its
- * initialisation message.
- */
-
-static void
-rfbProcessClientInitMessage(rfbClientPtr cl)
-{
-    rfbClientInitMsg ci;
-    union {
-        char buf[256];
-        rfbServerInitMsg si;
-    } u;
-    int len, n;
-    rfbClientIteratorPtr iterator;
-    rfbClientPtr otherCl;
-    rfbExtensionData* extension;
-
-    if (cl->state == RFB_INITIALISATION_SHARED) {
-        /* In this case behave as though an implicit ClientInit message has
-         * already been received with a shared-flag of true. */
-        ci.shared = 1;
-        /* Avoid the possibility of exposing the RFB_INITIALISATION_SHARED
-         * state to calling software. */
-        cl->state = RFB_INITIALISATION;
-    } else {
-        if ((n = rfbReadExact(cl, (char *)&ci,sz_rfbClientInitMsg)) <= 0) {
-            if (n == 0)
-                rfbLog("rfbProcessClientInitMessage: client gone\n");
-            else
-                rfbLogPerror("rfbProcessClientInitMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-    }
-
-    memset(u.buf,0,sizeof(u.buf));
-
-    u.si.framebufferWidth = Swap16IfLE(cl->screen->width);
-    u.si.framebufferHeight = Swap16IfLE(cl->screen->height);
-    u.si.format = cl->screen->serverFormat;
-    u.si.format.redMax = Swap16IfLE(u.si.format.redMax);
-    u.si.format.greenMax = Swap16IfLE(u.si.format.greenMax);
-    u.si.format.blueMax = Swap16IfLE(u.si.format.blueMax);
-
-    strncpy(u.buf + sz_rfbServerInitMsg, cl->screen->desktopName, 127);
-    len = strlen(u.buf + sz_rfbServerInitMsg);
-    u.si.nameLength = Swap32IfLE(len);
-
-    if (rfbWriteExact(cl, u.buf, sz_rfbServerInitMsg + len) < 0) {
-        rfbLogPerror("rfbProcessClientInitMessage: write");
-        rfbCloseClient(cl);
-        return;
-    }
-
-    for(extension = cl->extensions; extension;) {
-	rfbExtensionData* next = extension->next;
-	if(extension->extension->init &&
-		!extension->extension->init(cl, extension->data))
-	    /* extension requested that it be removed */
-	    rfbDisableExtension(cl, extension->extension);
-	extension = next;
-    }
-
-    cl->state = RFB_NORMAL;
-
-    if (!cl->reverseConnection &&
-                        (cl->screen->neverShared || (!cl->screen->alwaysShared && !ci.shared))) {
-
-        if (cl->screen->dontDisconnect) {
-            iterator = rfbGetClientIterator(cl->screen);
-            while ((otherCl = rfbClientIteratorNext(iterator)) != NULL) {
-                if ((otherCl != cl) && (otherCl->state == RFB_NORMAL)) {
-                    rfbLog("-dontdisconnect: Not shared & existing client\n");
-                    rfbLog("  refusing new client %s\n", cl->host);
-                    rfbCloseClient(cl);
-                    rfbReleaseClientIterator(iterator);
-                    return;
-                }
-            }
-            rfbReleaseClientIterator(iterator);
-        } else {
-            iterator = rfbGetClientIterator(cl->screen);
-            while ((otherCl = rfbClientIteratorNext(iterator)) != NULL) {
-                if ((otherCl != cl) && (otherCl->state == RFB_NORMAL)) {
-                    rfbLog("Not shared - closing connection to client %s\n",
-                           otherCl->host);
-                    rfbCloseClient(otherCl);
-                }
-            }
-            rfbReleaseClientIterator(iterator);
-        }
-    }
-}
-
-/* The values come in based on the scaled screen, we need to convert them to
- * values based on the man screen's coordinate system
- */
-static rfbBool rectSwapIfLEAndClip(uint16_t* x,uint16_t* y,uint16_t* w,uint16_t* h,
-		rfbClientPtr cl)
-{
-	int x1=Swap16IfLE(*x);
-	int y1=Swap16IfLE(*y);
-	int w1=Swap16IfLE(*w);
-	int h1=Swap16IfLE(*h);
-
-	rfbScaledCorrection(cl->scaledScreen, cl->screen, &x1, &y1, &w1, &h1, "rectSwapIfLEAndClip");
-	*x = x1;
-	*y = y1;
-	*w = w1;
-	*h = h1;
-
-	if(*w>cl->screen->width-*x)
-		*w=cl->screen->width-*x;
-	/* possible underflow */
-	if(*w>cl->screen->width-*x)
-		return FALSE;
-	if(*h>cl->screen->height-*y)
-		*h=cl->screen->height-*y;
-	if(*h>cl->screen->height-*y)
-		return FALSE;
-
-	return TRUE;
-}
-
-/*
- * Send keyboard state (PointerPos pseudo-encoding).
- */
-
-rfbBool
-rfbSendKeyboardLedState(rfbClientPtr cl)
-{
-    rfbFramebufferUpdateRectHeader rect;
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.encoding = Swap32IfLE(rfbEncodingKeyboardLedState);
-    rect.r.x = Swap16IfLE(cl->lastKeyboardLedState);
-    rect.r.y = 0;
-    rect.r.w = 0;
-    rect.r.h = 0;
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-        sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingKeyboardLedState, sz_rfbFramebufferUpdateRectHeader, sz_rfbFramebufferUpdateRectHeader);
-
-    if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-
-    return TRUE;
-}
-
-
-#define rfbSetBit(buffer, position)  (buffer[(position & 255) / 8] |= (1 << (position % 8)))
-
-/*
- * Send rfbEncodingSupportedMessages.
- */
-
-rfbBool
-rfbSendSupportedMessages(rfbClientPtr cl)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    rfbSupportedMessages msgs;
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader
-                  + sz_rfbSupportedMessages > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.encoding = Swap32IfLE(rfbEncodingSupportedMessages);
-    rect.r.x = 0;
-    rect.r.y = 0;
-    rect.r.w = Swap16IfLE(sz_rfbSupportedMessages);
-    rect.r.h = 0;
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-        sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    memset((char *)&msgs, 0, sz_rfbSupportedMessages);
-    rfbSetBit(msgs.client2server, rfbSetPixelFormat);
-    rfbSetBit(msgs.client2server, rfbFixColourMapEntries);
-    rfbSetBit(msgs.client2server, rfbSetEncodings);
-    rfbSetBit(msgs.client2server, rfbFramebufferUpdateRequest);
-    rfbSetBit(msgs.client2server, rfbKeyEvent);
-    rfbSetBit(msgs.client2server, rfbPointerEvent);
-    rfbSetBit(msgs.client2server, rfbClientCutText);
-    rfbSetBit(msgs.client2server, rfbFileTransfer);
-    rfbSetBit(msgs.client2server, rfbSetScale);
-    /*rfbSetBit(msgs.client2server, rfbSetServerInput);  */
-    /*rfbSetBit(msgs.client2server, rfbSetSW);           */
-    /*rfbSetBit(msgs.client2server, rfbTextChat);        */
-    rfbSetBit(msgs.client2server, rfbPalmVNCSetScaleFactor);
-    rfbSetBit(msgs.client2server, rfbXvp);
-
-    rfbSetBit(msgs.server2client, rfbFramebufferUpdate);
-    rfbSetBit(msgs.server2client, rfbSetColourMapEntries);
-    rfbSetBit(msgs.server2client, rfbBell);
-    rfbSetBit(msgs.server2client, rfbServerCutText);
-    rfbSetBit(msgs.server2client, rfbResizeFrameBuffer);
-    rfbSetBit(msgs.server2client, rfbPalmVNCReSizeFrameBuffer);
-    rfbSetBit(msgs.server2client, rfbXvp);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&msgs, sz_rfbSupportedMessages);
-    cl->ublen += sz_rfbSupportedMessages;
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingSupportedMessages,
-        sz_rfbFramebufferUpdateRectHeader+sz_rfbSupportedMessages,
-        sz_rfbFramebufferUpdateRectHeader+sz_rfbSupportedMessages);
-    if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-
-    return TRUE;
-}
-
-
-
-/*
- * Send rfbEncodingSupportedEncodings.
- */
-
-rfbBool
-rfbSendSupportedEncodings(rfbClientPtr cl)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    static uint32_t supported[] = {
-        rfbEncodingRaw,
-	rfbEncodingCopyRect,
-	rfbEncodingRRE,
-	rfbEncodingCoRRE,
-	rfbEncodingHextile,
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-	rfbEncodingZlib,
-	rfbEncodingZRLE,
-	rfbEncodingZYWRLE,
-#endif
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-	rfbEncodingTight,
-#endif
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-	rfbEncodingTightPng,
-#endif
-	rfbEncodingUltra,
-	rfbEncodingUltraZip,
-	rfbEncodingXCursor,
-	rfbEncodingRichCursor,
-	rfbEncodingPointerPos,
-	rfbEncodingLastRect,
-	rfbEncodingNewFBSize,
-	rfbEncodingKeyboardLedState,
-	rfbEncodingSupportedMessages,
-	rfbEncodingSupportedEncodings,
-	rfbEncodingServerIdentity,
-    };
-    uint32_t nEncodings = sizeof(supported) / sizeof(supported[0]), i;
-
-    /* think rfbSetEncodingsMsg */
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader
-                  + (nEncodings * sizeof(uint32_t)) > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.encoding = Swap32IfLE(rfbEncodingSupportedEncodings);
-    rect.r.x = 0;
-    rect.r.y = 0;
-    rect.r.w = Swap16IfLE(nEncodings * sizeof(uint32_t));
-    rect.r.h = Swap16IfLE(nEncodings);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-        sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    for (i = 0; i < nEncodings; i++) {
-        uint32_t encoding = Swap32IfLE(supported[i]);
-	memcpy(&cl->updateBuf[cl->ublen], (char *)&encoding, sizeof(encoding));
-	cl->ublen += sizeof(encoding);
-    }
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingSupportedEncodings,
-        sz_rfbFramebufferUpdateRectHeader+(nEncodings * sizeof(uint32_t)),
-        sz_rfbFramebufferUpdateRectHeader+(nEncodings * sizeof(uint32_t)));
-
-    if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-
-    return TRUE;
-}
-
-
-void
-rfbSetServerVersionIdentity(rfbScreenInfoPtr screen, char *fmt, ...)
-{
-    char buffer[256];
-    va_list ap;
-    
-    va_start(ap, fmt);
-    vsnprintf(buffer, sizeof(buffer)-1, fmt, ap);
-    va_end(ap);
-    
-    if (screen->versionString!=NULL) free(screen->versionString);
-    screen->versionString = strdup(buffer);
-}
-
-/*
- * Send rfbEncodingServerIdentity.
- */
-
-rfbBool
-rfbSendServerIdentity(rfbClientPtr cl)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    char buffer[512];
-
-    /* tack on our library version */
-    snprintf(buffer,sizeof(buffer)-1, "%s (%s)", 
-        (cl->screen->versionString==NULL ? "unknown" : cl->screen->versionString),
-        LIBVNCSERVER_PACKAGE_STRING);
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader
-                  + (strlen(buffer)+1) > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.encoding = Swap32IfLE(rfbEncodingServerIdentity);
-    rect.r.x = 0;
-    rect.r.y = 0;
-    rect.r.w = Swap16IfLE(strlen(buffer)+1);
-    rect.r.h = 0;
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-        sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    memcpy(&cl->updateBuf[cl->ublen], buffer, strlen(buffer)+1);
-    cl->ublen += strlen(buffer)+1;
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingServerIdentity,
-        sz_rfbFramebufferUpdateRectHeader+strlen(buffer)+1,
-        sz_rfbFramebufferUpdateRectHeader+strlen(buffer)+1);
-    
-
-    if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-
-    return TRUE;
-}
-
-/*
- * Send an xvp server message
- */
-
-rfbBool
-rfbSendXvp(rfbClientPtr cl, uint8_t version, uint8_t code)
-{
-    rfbXvpMsg xvp;
-
-    xvp.type = rfbXvp;
-    xvp.pad = 0;
-    xvp.version = version;
-    xvp.code = code;
-
-    LOCK(cl->sendMutex);
-    if (rfbWriteExact(cl, (char *)&xvp, sz_rfbXvpMsg) < 0) {
-      rfbLogPerror("rfbSendXvp: write");
-      rfbCloseClient(cl);
-    }
-    UNLOCK(cl->sendMutex);
-
-    rfbStatRecordMessageSent(cl, rfbXvp, sz_rfbXvpMsg, sz_rfbXvpMsg);
-
-    return TRUE;
-}
-
-
-rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer)
-{
-    rfbTextChatMsg tc;
-    int bytesToSend=0;
-
-    memset((char *)&tc, 0, sizeof(tc)); 
-    tc.type = rfbTextChat;
-    tc.length = Swap32IfLE(length);
-    
-    switch(length) {
-    case rfbTextChatOpen:
-    case rfbTextChatClose:
-    case rfbTextChatFinished:
-        bytesToSend=0;
-        break;
-    default:
-        bytesToSend=length;
-        if (bytesToSend>rfbTextMaxSize)
-            bytesToSend=rfbTextMaxSize;
-    }
-
-    if (cl->ublen + sz_rfbTextChatMsg + bytesToSend > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-    
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&tc, sz_rfbTextChatMsg);
-    cl->ublen += sz_rfbTextChatMsg;
-    if (bytesToSend>0) {
-        memcpy(&cl->updateBuf[cl->ublen], buffer, bytesToSend);
-        cl->ublen += bytesToSend;    
-    }
-    rfbStatRecordMessageSent(cl, rfbTextChat, sz_rfbTextChatMsg+bytesToSend, sz_rfbTextChatMsg+bytesToSend);
-
-    if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-        
-    return TRUE;
-}
-
-#define FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN(msg, cl, ret) \
-	if ((cl->screen->getFileTransferPermission != NULL \
-	    && cl->screen->getFileTransferPermission(cl) != TRUE) \
-	    || cl->screen->permitFileTransfer != TRUE) { \
-		rfbLog("%sUltra File Transfer is disabled, dropping client: %s\n", msg, cl->host); \
-		rfbCloseClient(cl); \
-		return ret; \
-	}
-
-int DB = 1;
-
-rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, const char *buffer)
-{
-    rfbFileTransferMsg ft;
-    ft.type = rfbFileTransfer;
-    ft.contentType = contentType;
-    ft.contentParam = contentParam;
-    ft.pad          = 0; /* UltraVNC did not Swap16LE(ft.contentParam) (Looks like it might be BigEndian) */
-    ft.size         = Swap32IfLE(size);
-    ft.length       = Swap32IfLE(length);
-    
-    FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
-    /*
-    rfbLog("rfbSendFileTransferMessage( %dtype, %dparam, %dsize, %dlen, %p)\n", contentType, contentParam, size, length, buffer);
-    */
-    LOCK(cl->sendMutex);
-    if (rfbWriteExact(cl, (char *)&ft, sz_rfbFileTransferMsg) < 0) {
-        rfbLogPerror("rfbSendFileTransferMessage: write");
-        rfbCloseClient(cl);
-        UNLOCK(cl->sendMutex);
-        return FALSE;
-    }
-
-    if (length>0)
-    {
-        if (rfbWriteExact(cl, buffer, length) < 0) {
-            rfbLogPerror("rfbSendFileTransferMessage: write");
-            rfbCloseClient(cl);
-            UNLOCK(cl->sendMutex);
-            return FALSE;
-        }
-    }
-    UNLOCK(cl->sendMutex);
-
-    rfbStatRecordMessageSent(cl, rfbFileTransfer, sz_rfbFileTransferMsg+length, sz_rfbFileTransferMsg+length);
-
-    return TRUE;
-}
-
-
-/*
- * UltraVNC uses Windows Structures
- */
-#define MAX_PATH 260
-
-typedef struct {
-    uint32_t dwLowDateTime;
-    uint32_t dwHighDateTime;
-} RFB_FILETIME; 
-
-typedef struct {
-    uint32_t dwFileAttributes;
-    RFB_FILETIME ftCreationTime;
-    RFB_FILETIME ftLastAccessTime;
-    RFB_FILETIME ftLastWriteTime;
-    uint32_t nFileSizeHigh;
-    uint32_t nFileSizeLow;
-    uint32_t dwReserved0;
-    uint32_t dwReserved1;
-    uint8_t  cFileName[ MAX_PATH ];
-    uint8_t  cAlternateFileName[ 14 ];
-} RFB_FIND_DATA;
-
-#define RFB_FILE_ATTRIBUTE_READONLY   0x1
-#define RFB_FILE_ATTRIBUTE_HIDDEN     0x2
-#define RFB_FILE_ATTRIBUTE_SYSTEM     0x4
-#define RFB_FILE_ATTRIBUTE_DIRECTORY  0x10
-#define RFB_FILE_ATTRIBUTE_ARCHIVE    0x20
-#define RFB_FILE_ATTRIBUTE_NORMAL     0x80
-#define RFB_FILE_ATTRIBUTE_TEMPORARY  0x100
-#define RFB_FILE_ATTRIBUTE_COMPRESSED 0x800
-
-rfbBool rfbFilenameTranslate2UNIX(rfbClientPtr cl, char *path, char *unixPath)
-{
-    int x;
-    char *home=NULL;
-
-    FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
-
-    /* C: */
-    if (path[0]=='C' && path[1]==':')
-      strcpy(unixPath, &path[2]);
-    else
-    {
-      home = getenv("HOME");
-      if (home!=NULL)
-      {
-        strcpy(unixPath, home);
-        strcat(unixPath,"/");
-        strcat(unixPath, path);
-      }
-      else
-        strcpy(unixPath, path);
-    }
-    for (x=0;x<strlen(unixPath);x++)
-      if (unixPath[x]=='\\') unixPath[x]='/';
-    return TRUE;
-}
-
-rfbBool rfbFilenameTranslate2DOS(rfbClientPtr cl, char *unixPath, char *path)
-{
-    int x;
-
-    FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
-
-    sprintf(path,"C:%s", unixPath);
-    for (x=2;x<strlen(path);x++)
-        if (path[x]=='/') path[x]='\\';
-    return TRUE;
-}
-
-rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
-{
-    char retfilename[MAX_PATH];
-    char path[MAX_PATH];
-    struct stat statbuf;
-    RFB_FIND_DATA win32filename;
-    int nOptLen = 0, retval=0;
-    DIR *dirp=NULL;
-    struct dirent *direntp=NULL;
-
-    FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
-
-    /* Client thinks we are Winblows */
-    rfbFilenameTranslate2UNIX(cl, buffer, path);
-
-    if (DB) rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: \"%s\"->\"%s\"\n",buffer, path);
-
-    dirp=opendir(path);
-    if (dirp==NULL)
-        return rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, 0, NULL);
-    /* send back the path name (necessary for links) */
-    if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, length, buffer)==FALSE) return FALSE;
-    for (direntp=readdir(dirp); direntp!=NULL; direntp=readdir(dirp))
-    {
-        /* get stats */
-        snprintf(retfilename,sizeof(retfilename),"%s/%s", path, direntp->d_name);
-        retval = stat(retfilename, &statbuf);
-
-        if (retval==0)
-        {
-            memset((char *)&win32filename, 0, sizeof(win32filename));
-            win32filename.dwFileAttributes = Swap32IfBE(RFB_FILE_ATTRIBUTE_NORMAL);
-            if (S_ISDIR(statbuf.st_mode))
-              win32filename.dwFileAttributes = Swap32IfBE(RFB_FILE_ATTRIBUTE_DIRECTORY);
-            win32filename.ftCreationTime.dwLowDateTime = Swap32IfBE(statbuf.st_ctime);   /* Intel Order */
-            win32filename.ftCreationTime.dwHighDateTime = 0;
-            win32filename.ftLastAccessTime.dwLowDateTime = Swap32IfBE(statbuf.st_atime); /* Intel Order */
-            win32filename.ftLastAccessTime.dwHighDateTime = 0;
-            win32filename.ftLastWriteTime.dwLowDateTime = Swap32IfBE(statbuf.st_mtime);  /* Intel Order */
-            win32filename.ftLastWriteTime.dwHighDateTime = 0;
-            win32filename.nFileSizeLow = Swap32IfBE(statbuf.st_size); /* Intel Order */
-            win32filename.nFileSizeHigh = 0;
-            win32filename.dwReserved0 = 0;
-            win32filename.dwReserved1 = 0;
-
-            /* If this had the full path, we would need to translate to DOS format ("C:\") */
-            /* rfbFilenameTranslate2DOS(cl, retfilename, win32filename.cFileName); */
-            strcpy((char *)win32filename.cFileName, direntp->d_name);
-            
-            /* Do not show hidden files (but show how to move up the tree) */
-            if ((strcmp(direntp->d_name, "..")==0) || (direntp->d_name[0]!='.'))
-            {
-                nOptLen = sizeof(RFB_FIND_DATA) - MAX_PATH - 14 + strlen((char *)win32filename.cFileName);
-                /*
-                rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: Sending \"%s\"\n", (char *)win32filename.cFileName);
-                */
-                if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE)
-                {
-                    closedir(dirp);
-                    return FALSE;
-                }
-            }
-        }
-    }
-    closedir(dirp);
-    /* End of the transfer */
-    return rfbSendFileTransferMessage(cl, rfbDirPacket, 0, 0, 0, NULL);
-}
-
-
-char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length)
-{
-    char *buffer=NULL;
-    int   n=0;
-
-    FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL);
-    /*
-    rfbLog("rfbProcessFileTransferReadBuffer(%dlen)\n", length);
-    */
-    if (length>0) {
-        buffer=malloc(length+1);
-        if (buffer!=NULL) {
-            if ((n = rfbReadExact(cl, (char *)buffer, length)) <= 0) {
-                if (n != 0)
-                    rfbLogPerror("rfbProcessFileTransferReadBuffer: read");
-                rfbCloseClient(cl);
-                /* NOTE: don't forget to free(buffer) if you return early! */
-                if (buffer!=NULL) free(buffer);
-                return NULL;
-            }
-            /* Null Terminate */
-            buffer[length]=0;
-        }
-    }
-    return buffer;
-}
-
-
-rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
-{
-    /* Allocate buffer for compression */
-    unsigned char readBuf[sz_rfbBlockSize];
-    int bytesRead=0;
-    int retval=0;
-    fd_set wfds;
-    struct timeval tv;
-    int n;
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    unsigned char compBuf[sz_rfbBlockSize + 1024];
-    unsigned long nMaxCompSize = sizeof(compBuf);
-    int nRetC = 0;
-#endif
-
-    /*
-     * Don't close the client if we get into this one because 
-     * it is called from many places to service file transfers.
-     * Note that permitFileTransfer is checked first.
-     */
-    if (cl->screen->permitFileTransfer != TRUE ||
-       (cl->screen->getFileTransferPermission != NULL
-        && cl->screen->getFileTransferPermission(cl) != TRUE)) { 
-		return TRUE;
-    }
-
-    /* If not sending, or no file open...   Return as if we sent something! */
-    if ((cl->fileTransfer.fd!=-1) && (cl->fileTransfer.sending==1))
-    {
-	FD_ZERO(&wfds);
-        FD_SET(cl->sock, &wfds);
-
-        /* return immediately */
-	tv.tv_sec = 0; 
-	tv.tv_usec = 0;
-	n = select(cl->sock + 1, NULL, &wfds, NULL, &tv);
-
-	if (n<0) {
-#ifdef WIN32
-	    errno=WSAGetLastError();
-#endif
-            rfbLog("rfbSendFileTransferChunk() select failed: %s\n", strerror(errno));
-	}
-        /* We have space on the transmit queue */
-	if (n > 0)
-	{
-            bytesRead = read(cl->fileTransfer.fd, readBuf, sz_rfbBlockSize);
-            switch (bytesRead) {
-            case 0:
-                /*
-                rfbLog("rfbSendFileTransferChunk(): End-Of-File Encountered\n");
-                */
-                retval = rfbSendFileTransferMessage(cl, rfbEndOfFile, 0, 0, 0, NULL);
-                close(cl->fileTransfer.fd);
-                cl->fileTransfer.fd = -1;
-                cl->fileTransfer.sending   = 0;
-                cl->fileTransfer.receiving = 0;
-                return retval;
-            case -1:
-                /* TODO : send an error msg to the client... */
-#ifdef WIN32
-	        errno=WSAGetLastError();
-#endif
-                rfbLog("rfbSendFileTransferChunk(): %s\n",strerror(errno));
-                retval = rfbSendFileTransferMessage(cl, rfbAbortFileTransfer, 0, 0, 0, NULL);
-                close(cl->fileTransfer.fd);
-                cl->fileTransfer.fd = -1;
-                cl->fileTransfer.sending   = 0;
-                cl->fileTransfer.receiving = 0;
-                return retval;
-            default:
-                /*
-                rfbLog("rfbSendFileTransferChunk(): Read %d bytes\n", bytesRead);
-                */
-                if (!cl->fileTransfer.compressionEnabled)
-                    return  rfbSendFileTransferMessage(cl, rfbFilePacket, 0, 0, bytesRead, (char *)readBuf);
-                else
-                {
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-                    nRetC = compress(compBuf, &nMaxCompSize, readBuf, bytesRead);
-                    /*
-                    rfbLog("Compressed the packet from %d -> %d bytes\n", nMaxCompSize, bytesRead);
-                    */
-                    
-                    if ((nRetC==0) && (nMaxCompSize<bytesRead))
-                        return  rfbSendFileTransferMessage(cl, rfbFilePacket, 0, 1, nMaxCompSize, (char *)compBuf);
-                    else
-                        return  rfbSendFileTransferMessage(cl, rfbFilePacket, 0, 0, bytesRead, (char *)readBuf);
-#else
-                    /* We do not support compression of the data stream */
-                    return  rfbSendFileTransferMessage(cl, rfbFilePacket, 0, 0, bytesRead, (char *)readBuf);
-#endif
-                }
-            }
-        }
-    }
-    return TRUE;
-}
-
-rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length)
-{
-    char *buffer=NULL, *p=NULL;
-    int retval=0;
-    char filename1[MAX_PATH];
-    char filename2[MAX_PATH];
-    char szFileTime[MAX_PATH];
-    struct stat statbuf;
-    uint32_t sizeHtmp=0;
-    int n=0;
-    char timespec[64];
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    unsigned char compBuff[sz_rfbBlockSize];
-    unsigned long nRawBytes = sz_rfbBlockSize;
-    int nRet = 0;
-#endif
-
-    FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
-        
-    /*
-    rfbLog("rfbProcessFileTransfer(%dtype, %dparam, %dsize, %dlen)\n", contentType, contentParam, size, length);
-    */
-
-    switch (contentType) {
-    case rfbDirContentRequest:
-        switch (contentParam) {
-        case rfbRDrivesList: /* Client requests the List of Local Drives */
-            /*
-            rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDrivesList:\n");
-            */
-            /* Format when filled : "C:\<NULL>D:\<NULL>....Z:\<NULL><NULL>
-             *
-             * We replace the "\" char following the drive letter and ":"
-             * with a char corresponding to the type of drive
-             * We obtain something like "C:l<NULL>D:c<NULL>....Z:n\<NULL><NULL>"
-             *  Isn't it ugly ?
-             * DRIVE_FIXED = 'l'     (local?)
-             * DRIVE_REMOVABLE = 'f' (floppy?)
-             * DRIVE_CDROM = 'c'
-             * DRIVE_REMOTE = 'n'
-             */
-            
-            /* in unix, there are no 'drives'  (We could list mount points though)
-             * We fake the root as a "C:" for the Winblows users
-             */
-            filename2[0]='C';
-            filename2[1]=':';
-            filename2[2]='l';
-            filename2[3]=0;
-            filename2[4]=0;
-            retval = rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADrivesList, 0, 5, filename2);
-            if (buffer!=NULL) free(buffer);
-            return retval;
-            break;
-        case rfbRDirContent: /* Client requests the content of a directory */
-            /*
-            rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent\n");
-            */
-            if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
-            retval = rfbSendDirContent(cl, length, buffer);
-            if (buffer!=NULL) free(buffer);
-            return retval;
-        }
-        break;
-
-    case rfbDirPacket:
-        rfbLog("rfbProcessFileTransfer() rfbDirPacket\n");
-        break;
-    case rfbFileAcceptHeader:
-        rfbLog("rfbProcessFileTransfer() rfbFileAcceptHeader\n");
-        break;
-    case rfbCommandReturn:
-        rfbLog("rfbProcessFileTransfer() rfbCommandReturn\n");
-        break;
-    case rfbFileChecksums:
-        /* Destination file already exists - the viewer sends the checksums */
-        rfbLog("rfbProcessFileTransfer() rfbFileChecksums\n");
-        break;
-    case rfbFileTransferAccess:
-        rfbLog("rfbProcessFileTransfer() rfbFileTransferAccess\n");
-        break;
-
-    /*
-     * sending from the server to the viewer
-     */
-
-    case rfbFileTransferRequest:
-        /*
-        rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest:\n");
-        */
-        /* add some space to the end of the buffer as we will be adding a timespec to it */
-        if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
-        /* The client requests a File */
-        rfbFilenameTranslate2UNIX(cl, buffer, filename1);
-        cl->fileTransfer.fd=open(filename1, O_RDONLY, 0744);
-
-        /*
-        */
-        if (DB) rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest(\"%s\"->\"%s\") Open: %s fd=%d\n", buffer, filename1, (cl->fileTransfer.fd==-1?"Failed":"Success"), cl->fileTransfer.fd);
-        
-        if (cl->fileTransfer.fd!=-1) {
-            if (fstat(cl->fileTransfer.fd, &statbuf)!=0) {
-                close(cl->fileTransfer.fd);
-                cl->fileTransfer.fd=-1;
-            }
-            else
-            {
-              /* Add the File Time Stamp to the filename */
-              strftime(timespec, sizeof(timespec), "%m/%d/%Y %H:%M",gmtime(&statbuf.st_ctime));
-              buffer=realloc(buffer, length + strlen(timespec) + 2); /* comma, and Null term */
-              if (buffer==NULL) {
-                  rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest: Failed to malloc %d bytes\n", length + strlen(timespec) + 2);
-                  return FALSE;
-              }
-              strcat(buffer,",");
-              strcat(buffer, timespec);
-              length = strlen(buffer);
-              if (DB) rfbLog("rfbProcessFileTransfer() buffer is now: \"%s\"\n", buffer);
-            }
-        }
-
-        /* The viewer supports compression if size==1 */
-        cl->fileTransfer.compressionEnabled = (size==1);
-
-        /*
-        rfbLog("rfbProcessFileTransfer() rfbFileTransferRequest(\"%s\"->\"%s\")%s\n", buffer, filename1, (size==1?" <Compression Enabled>":""));
-        */
-
-        /* File Size in bytes, 0xFFFFFFFF (-1) means error */
-        retval = rfbSendFileTransferMessage(cl, rfbFileHeader, 0, (cl->fileTransfer.fd==-1 ? -1 : statbuf.st_size), length, buffer);
-
-        if (cl->fileTransfer.fd==-1)
-        {
-            if (buffer!=NULL) free(buffer);
-            return retval;
-        }
-        /* setup filetransfer stuff */
-        cl->fileTransfer.fileSize = statbuf.st_size;
-        cl->fileTransfer.numPackets = statbuf.st_size / sz_rfbBlockSize;
-        cl->fileTransfer.receiving = 0;
-        cl->fileTransfer.sending = 0; /* set when we receive a rfbFileHeader: */
-
-        /* TODO: finish 64-bit file size support */
-        sizeHtmp = 0;        
-        LOCK(cl->sendMutex);
-        if (rfbWriteExact(cl, (char *)&sizeHtmp, 4) < 0) {
-          rfbLogPerror("rfbProcessFileTransfer: write");
-          rfbCloseClient(cl);
-          UNLOCK(cl->sendMutex);
-          if (buffer!=NULL) free(buffer);
-          return FALSE;
-        }
-        UNLOCK(cl->sendMutex);
-        break;
-
-    case rfbFileHeader:
-        /* Destination file (viewer side) is ready for reception (size > 0) or not (size = -1) */
-        if (size==-1) {
-            rfbLog("rfbProcessFileTransfer() rfbFileHeader (error, aborting)\n");
-            close(cl->fileTransfer.fd);
-            cl->fileTransfer.fd=-1;
-            return TRUE;
-        }
-
-        /*
-        rfbLog("rfbProcessFileTransfer() rfbFileHeader (%d bytes of a file)\n", size);
-        */
-
-        /* Starts the transfer! */
-        cl->fileTransfer.sending=1;
-        return rfbSendFileTransferChunk(cl);
-        break;
-
-
-    /*
-     * sending from the viewer to the server
-     */
-
-    case rfbFileTransferOffer:
-        /* client is sending a file to us */
-        /* buffer contains full path name (plus FileTime) */
-        /* size contains size of the file */
-        /*
-        rfbLog("rfbProcessFileTransfer() rfbFileTransferOffer:\n");
-        */
-        if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
-
-        /* Parse the FileTime */
-        p = strrchr(buffer, ',');
-        if (p!=NULL) {
-            *p = '\0';
-            strcpy(szFileTime, p+1);
-        } else
-            szFileTime[0]=0;
-
-
-
-        /* Need to read in sizeHtmp */
-        if ((n = rfbReadExact(cl, (char *)&sizeHtmp, 4)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessFileTransfer: read sizeHtmp");
-            rfbCloseClient(cl);
-            /* NOTE: don't forget to free(buffer) if you return early! */
-            if (buffer!=NULL) free(buffer);
-            return FALSE;
-        }
-        sizeHtmp = Swap32IfLE(sizeHtmp);
-        
-        rfbFilenameTranslate2UNIX(cl, buffer, filename1);
-
-        /* If the file exists... We can send a rfbFileChecksums back to the client before we send an rfbFileAcceptHeader */
-        /* TODO: Delta Transfer */
-
-        cl->fileTransfer.fd=open(filename1, O_CREAT|O_WRONLY|O_TRUNC, 0744);
-        if (DB) rfbLog("rfbProcessFileTransfer() rfbFileTransferOffer(\"%s\"->\"%s\") %s %s fd=%d\n", buffer, filename1, (cl->fileTransfer.fd==-1?"Failed":"Success"), (cl->fileTransfer.fd==-1?strerror(errno):""), cl->fileTransfer.fd);
-        /*
-        */
-        
-        /* File Size in bytes, 0xFFFFFFFF (-1) means error */
-        retval = rfbSendFileTransferMessage(cl, rfbFileAcceptHeader, 0, (cl->fileTransfer.fd==-1 ? -1 : 0), length, buffer);
-        if (cl->fileTransfer.fd==-1) {
-            free(buffer);
-            return retval;
-        }
-        
-        /* setup filetransfer stuff */
-        cl->fileTransfer.fileSize = size;
-        cl->fileTransfer.numPackets = size / sz_rfbBlockSize;
-        cl->fileTransfer.receiving = 1;
-        cl->fileTransfer.sending = 0;
-        break;
-
-    case rfbFilePacket:
-        /*
-        rfbLog("rfbProcessFileTransfer() rfbFilePacket:\n");
-        */
-        if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
-        if (cl->fileTransfer.fd!=-1) {
-            /* buffer contains the contents of the file */
-            if (size==0)
-                retval=write(cl->fileTransfer.fd, buffer, length);
-            else
-            {
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-                /* compressed packet */
-                nRet = uncompress(compBuff,&nRawBytes,(const unsigned char*)buffer, length);
-		if(nRet == Z_OK)
-		  retval=write(cl->fileTransfer.fd, (char*)compBuff, nRawBytes);
-		else
-		  retval = -1;
-#else
-                /* Write the file out as received... */
-                retval=write(cl->fileTransfer.fd, buffer, length);
-#endif
-            }
-            if (retval==-1)
-            {
-                close(cl->fileTransfer.fd);
-                cl->fileTransfer.fd=-1;
-                cl->fileTransfer.sending   = 0;
-                cl->fileTransfer.receiving = 0;
-            }
-        }
-        break;
-
-    case rfbEndOfFile:
-        if (DB) rfbLog("rfbProcessFileTransfer() rfbEndOfFile\n");
-        /*
-        */
-        if (cl->fileTransfer.fd!=-1)
-            close(cl->fileTransfer.fd);
-        cl->fileTransfer.fd=-1;
-        cl->fileTransfer.sending   = 0;
-        cl->fileTransfer.receiving = 0;
-        break;
-
-    case rfbAbortFileTransfer:
-        if (DB) rfbLog("rfbProcessFileTransfer() rfbAbortFileTransfer\n");
-        /*
-        */
-        if (cl->fileTransfer.fd!=-1)
-        {
-            close(cl->fileTransfer.fd);
-            cl->fileTransfer.fd=-1;
-            cl->fileTransfer.sending   = 0;
-            cl->fileTransfer.receiving = 0;
-        }
-        else
-        {
-            /* We use this message for FileTransfer rights (<=RC18 versions)
-             * The client asks for FileTransfer permission
-             */
-            if (contentParam == 0)
-            {
-                rfbLog("rfbProcessFileTransfer() File Transfer Permission DENIED! (Client Version <=RC18)\n");
-                /* Old method for FileTransfer handshake perimssion (<=RC18) (Deny it)*/
-                return rfbSendFileTransferMessage(cl, rfbAbortFileTransfer, 0, -1, 0, "");
-            }
-            /* New method is allowed */
-            if (cl->screen->getFileTransferPermission!=NULL)
-            {
-                if (cl->screen->getFileTransferPermission(cl)==TRUE)
-                {
-                    rfbLog("rfbProcessFileTransfer() File Transfer Permission Granted!\n");
-                    return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, 1 , 0, ""); /* Permit */
-                }
-                else
-                {
-                    rfbLog("rfbProcessFileTransfer() File Transfer Permission DENIED!\n");
-                    return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, -1 , 0, ""); /* Deny */
-                }
-            }
-            else
-            {
-                if (cl->screen->permitFileTransfer)
-                {
-                    rfbLog("rfbProcessFileTransfer() File Transfer Permission Granted!\n");
-                    return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, 1 , 0, ""); /* Permit */
-                }
-                else
-                {
-                    rfbLog("rfbProcessFileTransfer() File Transfer Permission DENIED by default!\n");
-                    return rfbSendFileTransferMessage(cl, rfbFileTransferAccess, 0, -1 , 0, ""); /* DEFAULT: DENY (for security) */
-                }
-                
-            }
-        }
-        break;
-
-
-    case rfbCommand:
-        /*
-        rfbLog("rfbProcessFileTransfer() rfbCommand:\n");
-        */
-        if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
-        switch (contentParam) {
-        case rfbCDirCreate:  /* Client requests the creation of a directory */
-            rfbFilenameTranslate2UNIX(cl, buffer, filename1);
-            retval = mkdir(filename1, 0755);
-            if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCDirCreate(\"%s\"->\"%s\") %s\n", buffer, filename1, (retval==-1?"Failed":"Success"));
-            /*
-            */
-            retval = rfbSendFileTransferMessage(cl, rfbCommandReturn, rfbADirCreate, retval, length, buffer);
-            if (buffer!=NULL) free(buffer);
-            return retval;
-        case rfbCFileDelete: /* Client requests the deletion of a file */
-            rfbFilenameTranslate2UNIX(cl, buffer, filename1);
-            if (stat(filename1,&statbuf)==0)
-            {
-                if (S_ISDIR(statbuf.st_mode))
-                    retval = rmdir(filename1);
-                else
-                    retval = unlink(filename1);
-            }
-            else retval=-1;
-            retval = rfbSendFileTransferMessage(cl, rfbCommandReturn, rfbAFileDelete, retval, length, buffer);
-            if (buffer!=NULL) free(buffer);
-            return retval;
-        case rfbCFileRename: /* Client requests the Renaming of a file/directory */
-            p = strrchr(buffer, '*');
-            if (p != NULL)
-            {
-                /* Split into 2 filenames ('*' is a seperator) */
-                *p = '\0';
-                rfbFilenameTranslate2UNIX(cl, buffer, filename1);
-                rfbFilenameTranslate2UNIX(cl, p+1,    filename2);
-                retval = rename(filename1,filename2);
-                if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCFileRename(\"%s\"->\"%s\" -->> \"%s\"->\"%s\") %s\n", buffer, filename1, p+1, filename2, (retval==-1?"Failed":"Success"));
-                /*
-                */
-                /* Restore the buffer so the reply is good */
-                *p = '*';
-                retval = rfbSendFileTransferMessage(cl, rfbCommandReturn, rfbAFileRename, retval, length, buffer);
-                if (buffer!=NULL) free(buffer);
-                return retval;
-            }
-            break;
-        }
-    
-        break;
-    }
-
-    /* NOTE: don't forget to free(buffer) if you return early! */
-    if (buffer!=NULL) free(buffer);
-    return TRUE;
-}
-
-/*
- * rfbProcessClientNormalMessage is called when the client has sent a normal
- * protocol message.
- */
-
-static void
-rfbProcessClientNormalMessage(rfbClientPtr cl)
-{
-    int n=0;
-    rfbClientToServerMsg msg;
-    char *str;
-    int i;
-    uint32_t enc=0;
-    uint32_t lastPreferredEncoding = -1;
-    char encBuf[64];
-    char encBuf2[64];
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-    if (cl->wsctx && webSocketCheckDisconnect(cl))
-      return;
-#endif
-
-    if ((n = rfbReadExact(cl, (char *)&msg, 1)) <= 0) {
-        if (n != 0)
-            rfbLogPerror("rfbProcessClientNormalMessage: read");
-        rfbCloseClient(cl);
-        return;
-    }
-
-    switch (msg.type) {
-
-    case rfbSetPixelFormat:
-
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                           sz_rfbSetPixelFormatMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-
-        cl->format.bitsPerPixel = msg.spf.format.bitsPerPixel;
-        cl->format.depth = msg.spf.format.depth;
-        cl->format.bigEndian = (msg.spf.format.bigEndian ? TRUE : FALSE);
-        cl->format.trueColour = (msg.spf.format.trueColour ? TRUE : FALSE);
-        cl->format.redMax = Swap16IfLE(msg.spf.format.redMax);
-        cl->format.greenMax = Swap16IfLE(msg.spf.format.greenMax);
-        cl->format.blueMax = Swap16IfLE(msg.spf.format.blueMax);
-        cl->format.redShift = msg.spf.format.redShift;
-        cl->format.greenShift = msg.spf.format.greenShift;
-        cl->format.blueShift = msg.spf.format.blueShift;
-
-	cl->readyForSetColourMapEntries = TRUE;
-        cl->screen->setTranslateFunction(cl);
-
-        rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetPixelFormatMsg, sz_rfbSetPixelFormatMsg);
-
-        return;
-
-
-    case rfbFixColourMapEntries:
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                           sz_rfbFixColourMapEntriesMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-        rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetPixelFormatMsg, sz_rfbSetPixelFormatMsg);
-        rfbLog("rfbProcessClientNormalMessage: %s",
-                "FixColourMapEntries unsupported\n");
-        rfbCloseClient(cl);
-        return;
-
-
-    /* NOTE: Some clients send us a set of encodings (ie: PointerPos) designed to enable/disable features...
-     * We may want to look into this...
-     * Example:
-     *     case rfbEncodingXCursor:
-     *         cl->enableCursorShapeUpdates = TRUE;
-     *
-     * Currently: cl->enableCursorShapeUpdates can *never* be turned off...
-     */
-    case rfbSetEncodings:
-    {
-
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                           sz_rfbSetEncodingsMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-
-        msg.se.nEncodings = Swap16IfLE(msg.se.nEncodings);
-
-        rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetEncodingsMsg+(msg.se.nEncodings*4),sz_rfbSetEncodingsMsg+(msg.se.nEncodings*4));
-
-        /*
-         * UltraVNC Client has the ability to adapt to changing network environments
-         * So, let's give it a change to tell us what it wants now!
-         */
-        if (cl->preferredEncoding!=-1)
-            lastPreferredEncoding = cl->preferredEncoding;
-
-        /* Reset all flags to defaults (allows us to switch between PointerPos and Server Drawn Cursors) */
-        cl->preferredEncoding=-1;
-        cl->useCopyRect              = FALSE;
-        cl->useNewFBSize             = FALSE;
-        cl->cursorWasChanged         = FALSE;
-        cl->useRichCursorEncoding    = FALSE;
-        cl->enableCursorPosUpdates   = FALSE;
-        cl->enableCursorShapeUpdates = FALSE;
-        cl->enableCursorShapeUpdates = FALSE;
-        cl->enableLastRectEncoding   = FALSE;
-        cl->enableKeyboardLedState   = FALSE;
-        cl->enableSupportedMessages  = FALSE;
-        cl->enableSupportedEncodings = FALSE;
-        cl->enableServerIdentity     = FALSE;
-#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
-        cl->tightQualityLevel        = -1;
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-        cl->tightCompressLevel       = TIGHT_DEFAULT_COMPRESSION;
-        cl->turboSubsampLevel        = TURBO_DEFAULT_SUBSAMP;
-        cl->turboQualityLevel        = -1;
-#endif
-#endif
-
-
-        for (i = 0; i < msg.se.nEncodings; i++) {
-            if ((n = rfbReadExact(cl, (char *)&enc, 4)) <= 0) {
-                if (n != 0)
-                    rfbLogPerror("rfbProcessClientNormalMessage: read");
-                rfbCloseClient(cl);
-                return;
-            }
-            enc = Swap32IfLE(enc);
-
-            switch (enc) {
-
-            case rfbEncodingCopyRect:
-		cl->useCopyRect = TRUE;
-                break;
-            case rfbEncodingRaw:
-            case rfbEncodingRRE:
-            case rfbEncodingCoRRE:
-            case rfbEncodingHextile:
-            case rfbEncodingUltra:
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-	    case rfbEncodingZlib:
-            case rfbEncodingZRLE:
-            case rfbEncodingZYWRLE:
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-	    case rfbEncodingTight:
-#endif
-#endif
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-	    case rfbEncodingTightPng:
-#endif
-            /* The first supported encoding is the 'preferred' encoding */
-                if (cl->preferredEncoding == -1)
-                    cl->preferredEncoding = enc;
-
-
-                break;
-	    case rfbEncodingXCursor:
-		if(!cl->screen->dontConvertRichCursorToXCursor) {
-		    rfbLog("Enabling X-style cursor updates for client %s\n",
-			   cl->host);
-		    /* if cursor was drawn, hide the cursor */
-		    if(!cl->enableCursorShapeUpdates)
-		        rfbRedrawAfterHideCursor(cl,NULL);
-
-		    cl->enableCursorShapeUpdates = TRUE;
-		    cl->cursorWasChanged = TRUE;
-		}
-		break;
-	    case rfbEncodingRichCursor:
-	        rfbLog("Enabling full-color cursor updates for client %s\n",
-		       cl->host);
-		/* if cursor was drawn, hide the cursor */
-		if(!cl->enableCursorShapeUpdates)
-		    rfbRedrawAfterHideCursor(cl,NULL);
-
-	        cl->enableCursorShapeUpdates = TRUE;
-	        cl->useRichCursorEncoding = TRUE;
-	        cl->cursorWasChanged = TRUE;
-	        break;
-	    case rfbEncodingPointerPos:
-		if (!cl->enableCursorPosUpdates) {
-		    rfbLog("Enabling cursor position updates for client %s\n",
-			   cl->host);
-		    cl->enableCursorPosUpdates = TRUE;
-		    cl->cursorWasMoved = TRUE;
-		}
-	        break;
-	    case rfbEncodingLastRect:
-		if (!cl->enableLastRectEncoding) {
-		    rfbLog("Enabling LastRect protocol extension for client "
-			   "%s\n", cl->host);
-		    cl->enableLastRectEncoding = TRUE;
-		}
-		break;
-	    case rfbEncodingNewFBSize:
-		if (!cl->useNewFBSize) {
-		    rfbLog("Enabling NewFBSize protocol extension for client "
-			   "%s\n", cl->host);
-		    cl->useNewFBSize = TRUE;
-		}
-		break;
-            case rfbEncodingKeyboardLedState:
-                if (!cl->enableKeyboardLedState) {
-                  rfbLog("Enabling KeyboardLedState protocol extension for client "
-                          "%s\n", cl->host);
-                  cl->enableKeyboardLedState = TRUE;
-                }
-                break;           
-            case rfbEncodingSupportedMessages:
-                if (!cl->enableSupportedMessages) {
-                  rfbLog("Enabling SupportedMessages protocol extension for client "
-                          "%s\n", cl->host);
-                  cl->enableSupportedMessages = TRUE;
-                }
-                break;           
-            case rfbEncodingSupportedEncodings:
-                if (!cl->enableSupportedEncodings) {
-                  rfbLog("Enabling SupportedEncodings protocol extension for client "
-                          "%s\n", cl->host);
-                  cl->enableSupportedEncodings = TRUE;
-                }
-                break;           
-            case rfbEncodingServerIdentity:
-                if (!cl->enableServerIdentity) {
-                  rfbLog("Enabling ServerIdentity protocol extension for client "
-                          "%s\n", cl->host);
-                  cl->enableServerIdentity = TRUE;
-                }
-                break;
-	    case rfbEncodingXvp:
-	        rfbLog("Enabling Xvp protocol extension for client "
-		        "%s\n", cl->host);
-		if (!rfbSendXvp(cl, 1, rfbXvp_Init)) {
-		  rfbCloseClient(cl);
-		  return;
-		}
-                break;
-            default:
-#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
-		if ( enc >= (uint32_t)rfbEncodingCompressLevel0 &&
-		     enc <= (uint32_t)rfbEncodingCompressLevel9 ) {
-		    cl->zlibCompressLevel = enc & 0x0F;
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-		    cl->tightCompressLevel = enc & 0x0F;
-		    rfbLog("Using compression level %d for client %s\n",
-			   cl->tightCompressLevel, cl->host);
-#endif
-		} else if ( enc >= (uint32_t)rfbEncodingQualityLevel0 &&
-			    enc <= (uint32_t)rfbEncodingQualityLevel9 ) {
-		    cl->tightQualityLevel = enc & 0x0F;
-		    rfbLog("Using image quality level %d for client %s\n",
-			   cl->tightQualityLevel, cl->host);
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-		    cl->turboQualityLevel = tight2turbo_qual[enc & 0x0F];
-		    cl->turboSubsampLevel = tight2turbo_subsamp[enc & 0x0F];
-		    rfbLog("Using JPEG subsampling %d, Q%d for client %s\n",
-			   cl->turboSubsampLevel, cl->turboQualityLevel, cl->host);
-		} else if ( enc >= (uint32_t)rfbEncodingFineQualityLevel0 + 1 &&
-			    enc <= (uint32_t)rfbEncodingFineQualityLevel100 ) {
-		    cl->turboQualityLevel = enc & 0xFF;
-		    rfbLog("Using fine quality level %d for client %s\n",
-			   cl->turboQualityLevel, cl->host);
-		} else if ( enc >= (uint32_t)rfbEncodingSubsamp1X &&
-			    enc <= (uint32_t)rfbEncodingSubsampGray ) {
-		    cl->turboSubsampLevel = enc & 0xFF;
-		    rfbLog("Using subsampling level %d for client %s\n",
-			   cl->turboSubsampLevel, cl->host);
-#endif
-		} else
-#endif
-		{
-			rfbExtensionData* e;
-			for(e = cl->extensions; e;) {
-				rfbExtensionData* next = e->next;
-				if(e->extension->enablePseudoEncoding &&
-					e->extension->enablePseudoEncoding(cl,
-						&e->data, (int)enc))
-					/* ext handles this encoding */
-					break;
-				e = next;
-			}
-			if(e == NULL) {
-				rfbBool handled = FALSE;
-				/* if the pseudo encoding is not handled by the
-				   enabled extensions, search through all
-				   extensions. */
-				rfbProtocolExtension* e;
-
-				for(e = rfbGetExtensionIterator(); e;) {
-					int* encs = e->pseudoEncodings;
-					while(encs && *encs!=0) {
-						if(*encs==(int)enc) {
-							void* data = NULL;
-							if(!e->enablePseudoEncoding(cl, &data, (int)enc)) {
-								rfbLog("Installed extension pretends to handle pseudo encoding 0x%x, but does not!\n",(int)enc);
-							} else {
-								rfbEnableExtension(cl, e, data);
-								handled = TRUE;
-								e = NULL;
-								break;
-							}
-						}
-						encs++;
-					}
-
-					if(e)
-						e = e->next;
-				}
-				rfbReleaseExtensionIterator();
-
-				if(!handled)
-					rfbLog("rfbProcessClientNormalMessage: "
-					    "ignoring unsupported encoding type %s\n",
-					    encodingName(enc,encBuf,sizeof(encBuf)));
-			}
-		}
-            }
-        }
-
-
-
-        if (cl->preferredEncoding == -1) {
-            if (lastPreferredEncoding==-1) {
-                cl->preferredEncoding = rfbEncodingRaw;
-                rfbLog("Defaulting to %s encoding for client %s\n", encodingName(cl->preferredEncoding,encBuf,sizeof(encBuf)),cl->host);
-            }
-            else {
-                cl->preferredEncoding = lastPreferredEncoding;
-                rfbLog("Sticking with %s encoding for client %s\n", encodingName(cl->preferredEncoding,encBuf,sizeof(encBuf)),cl->host);
-            }
-        }
-        else
-        {
-          if (lastPreferredEncoding==-1) {
-              rfbLog("Using %s encoding for client %s\n", encodingName(cl->preferredEncoding,encBuf,sizeof(encBuf)),cl->host);
-          } else {
-              rfbLog("Switching from %s to %s Encoding for client %s\n", 
-                  encodingName(lastPreferredEncoding,encBuf2,sizeof(encBuf2)),
-                  encodingName(cl->preferredEncoding,encBuf,sizeof(encBuf)), cl->host);
-          }
-        }
-        
-	if (cl->enableCursorPosUpdates && !cl->enableCursorShapeUpdates) {
-	  rfbLog("Disabling cursor position updates for client %s\n",
-		 cl->host);
-	  cl->enableCursorPosUpdates = FALSE;
-	}
-
-        return;
-    }
-
-
-    case rfbFramebufferUpdateRequest:
-    {
-        sraRegionPtr tmpRegion;
-
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                           sz_rfbFramebufferUpdateRequestMsg-1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-
-        rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbFramebufferUpdateRequestMsg,sz_rfbFramebufferUpdateRequestMsg);
-
-        /* The values come in based on the scaled screen, we need to convert them to
-         * values based on the main screen's coordinate system
-         */
-	if(!rectSwapIfLEAndClip(&msg.fur.x,&msg.fur.y,&msg.fur.w,&msg.fur.h,cl))
-	{
-	        rfbLog("Warning, ignoring rfbFramebufferUpdateRequest: %dXx%dY-%dWx%dH\n",msg.fur.x, msg.fur.y, msg.fur.w, msg.fur.h);
-		return;
-        }
- 
-        
-	tmpRegion =
-	  sraRgnCreateRect(msg.fur.x,
-			   msg.fur.y,
-			   msg.fur.x+msg.fur.w,
-			   msg.fur.y+msg.fur.h);
-
-        LOCK(cl->updateMutex);
-	sraRgnOr(cl->requestedRegion,tmpRegion);
-
-	if (!cl->readyForSetColourMapEntries) {
-	    /* client hasn't sent a SetPixelFormat so is using server's */
-	    cl->readyForSetColourMapEntries = TRUE;
-	    if (!cl->format.trueColour) {
-		if (!rfbSetClientColourMap(cl, 0, 0)) {
-		    sraRgnDestroy(tmpRegion);
-		    TSIGNAL(cl->updateCond);
-		    UNLOCK(cl->updateMutex);
-		    return;
-		}
-	    }
-	}
-
-       if (!msg.fur.incremental) {
-	    sraRgnOr(cl->modifiedRegion,tmpRegion);
-	    sraRgnSubtract(cl->copyRegion,tmpRegion);
-       }
-       TSIGNAL(cl->updateCond);
-       UNLOCK(cl->updateMutex);
-
-       sraRgnDestroy(tmpRegion);
-
-       return;
-    }
-
-    case rfbKeyEvent:
-
-	if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-			   sz_rfbKeyEventMsg - 1)) <= 0) {
-	    if (n != 0)
-		rfbLogPerror("rfbProcessClientNormalMessage: read");
-	    rfbCloseClient(cl);
-	    return;
-	}
-
-	rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbKeyEventMsg, sz_rfbKeyEventMsg);
-
-	if(!cl->viewOnly) {
-	    cl->screen->kbdAddEvent(msg.ke.down, (rfbKeySym)Swap32IfLE(msg.ke.key), cl);
-	}
-
-        return;
-
-
-    case rfbPointerEvent:
-
-	if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-			   sz_rfbPointerEventMsg - 1)) <= 0) {
-	    if (n != 0)
-		rfbLogPerror("rfbProcessClientNormalMessage: read");
-	    rfbCloseClient(cl);
-	    return;
-	}
-
-	rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbPointerEventMsg, sz_rfbPointerEventMsg);
-	
-	if (cl->screen->pointerClient && cl->screen->pointerClient != cl)
-	    return;
-
-	if (msg.pe.buttonMask == 0)
-	    cl->screen->pointerClient = NULL;
-	else
-	    cl->screen->pointerClient = cl;
-
-	if(!cl->viewOnly) {
-	    if (msg.pe.buttonMask != cl->lastPtrButtons ||
-		    cl->screen->deferPtrUpdateTime == 0) {
-		cl->screen->ptrAddEvent(msg.pe.buttonMask,
-			ScaleX(cl->scaledScreen, cl->screen, Swap16IfLE(msg.pe.x)), 
-			ScaleY(cl->scaledScreen, cl->screen, Swap16IfLE(msg.pe.y)),
-			cl);
-		cl->lastPtrButtons = msg.pe.buttonMask;
-	    } else {
-		cl->lastPtrX = ScaleX(cl->scaledScreen, cl->screen, Swap16IfLE(msg.pe.x));
-		cl->lastPtrY = ScaleY(cl->scaledScreen, cl->screen, Swap16IfLE(msg.pe.y));
-		cl->lastPtrButtons = msg.pe.buttonMask;
-	    }
-      }      
-      return;
-
-
-    case rfbFileTransfer:
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                              sz_rfbFileTransferMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-        msg.ft.size         = Swap32IfLE(msg.ft.size);
-        msg.ft.length       = Swap32IfLE(msg.ft.length);
-        /* record statistics in rfbProcessFileTransfer as length is filled with garbage when it is not valid */
-        rfbProcessFileTransfer(cl, msg.ft.contentType, msg.ft.contentParam, msg.ft.size, msg.ft.length);
-        return;
-
-    case rfbSetSW:
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                              sz_rfbSetSWMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-        msg.sw.x = Swap16IfLE(msg.sw.x);
-        msg.sw.y = Swap16IfLE(msg.sw.y);
-        rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetSWMsg, sz_rfbSetSWMsg);
-        /* msg.sw.status is not initialized in the ultraVNC viewer and contains random numbers (why???) */
-
-        rfbLog("Received a rfbSetSingleWindow(%d x, %d y)\n", msg.sw.x, msg.sw.y);
-        if (cl->screen->setSingleWindow!=NULL)
-            cl->screen->setSingleWindow(cl, msg.sw.x, msg.sw.y);
-        return;
-
-    case rfbSetServerInput:
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                              sz_rfbSetServerInputMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-        rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetServerInputMsg, sz_rfbSetServerInputMsg);
-
-        /* msg.sim.pad is not initialized in the ultraVNC viewer and contains random numbers (why???) */
-        /* msg.sim.pad = Swap16IfLE(msg.sim.pad); */
-
-        rfbLog("Received a rfbSetServerInput(%d status)\n", msg.sim.status);
-        if (cl->screen->setServerInput!=NULL)
-            cl->screen->setServerInput(cl, msg.sim.status);
-        return;
-        
-    case rfbTextChat:
-        if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-                              sz_rfbTextChatMsg - 1)) <= 0) {
-            if (n != 0)
-                rfbLogPerror("rfbProcessClientNormalMessage: read");
-            rfbCloseClient(cl);
-            return;
-        }
-        
-        msg.tc.pad2   = Swap16IfLE(msg.tc.pad2);
-        msg.tc.length = Swap32IfLE(msg.tc.length);
-
-        switch (msg.tc.length) {
-        case rfbTextChatOpen:
-        case rfbTextChatClose:
-        case rfbTextChatFinished:
-            /* commands do not have text following */
-            /* Why couldn't they have used the pad byte??? */
-            str=NULL;
-            rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbTextChatMsg, sz_rfbTextChatMsg);
-            break;
-        default:
-            if ((msg.tc.length>0) && (msg.tc.length<rfbTextMaxSize))
-            {
-                str = (char *)malloc(msg.tc.length);
-                if (str==NULL)
-                {
-                    rfbLog("Unable to malloc %d bytes for a TextChat Message\n", msg.tc.length);
-                    rfbCloseClient(cl);
-                    return;
-                }
-                if ((n = rfbReadExact(cl, str, msg.tc.length)) <= 0) {
-                    if (n != 0)
-                        rfbLogPerror("rfbProcessClientNormalMessage: read");
-                    free(str);
-                    rfbCloseClient(cl);
-                    return;
-                }
-                rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbTextChatMsg+msg.tc.length, sz_rfbTextChatMsg+msg.tc.length);
-            }
-            else
-            {
-                /* This should never happen */
-                rfbLog("client sent us a Text Message that is too big %d>%d\n", msg.tc.length, rfbTextMaxSize);
-                rfbCloseClient(cl);
-                return;
-            }
-        }
-
-        /* Note: length can be commands: rfbTextChatOpen, rfbTextChatClose, and rfbTextChatFinished
-         * at which point, the str is NULL (as it is not sent)
-         */
-        if (cl->screen->setTextChat!=NULL)
-            cl->screen->setTextChat(cl, msg.tc.length, str);
-
-        free(str);
-        return;
-
-
-    case rfbClientCutText:
-
-	if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-			   sz_rfbClientCutTextMsg - 1)) <= 0) {
-	    if (n != 0)
-		rfbLogPerror("rfbProcessClientNormalMessage: read");
-	    rfbCloseClient(cl);
-	    return;
-	}
-
-	msg.cct.length = Swap32IfLE(msg.cct.length);
-
-	str = (char *)malloc(msg.cct.length);
-
-	if ((n = rfbReadExact(cl, str, msg.cct.length)) <= 0) {
-	    if (n != 0)
-	        rfbLogPerror("rfbProcessClientNormalMessage: read");
-	    free(str);
-	    rfbCloseClient(cl);
-	    return;
-	}
-	rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbClientCutTextMsg+msg.cct.length, sz_rfbClientCutTextMsg+msg.cct.length);
-	if(!cl->viewOnly) {
-	    cl->screen->setXCutText(str, msg.cct.length, cl);
-	}
-	free(str);
-
-        return;
-
-    case rfbPalmVNCSetScaleFactor:
-      cl->PalmVNC = TRUE;
-      if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-          sz_rfbSetScaleMsg - 1)) <= 0) {
-          if (n != 0)
-            rfbLogPerror("rfbProcessClientNormalMessage: read");
-          rfbCloseClient(cl);
-          return;
-      }
-      rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetScaleMsg, sz_rfbSetScaleMsg);
-      rfbLog("rfbSetScale(%d)\n", msg.ssc.scale);
-      rfbScalingSetup(cl,cl->screen->width/msg.ssc.scale, cl->screen->height/msg.ssc.scale);
-
-      rfbSendNewScaleSize(cl);
-      return;
-      
-    case rfbSetScale:
-
-      if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-          sz_rfbSetScaleMsg - 1)) <= 0) {
-          if (n != 0)
-            rfbLogPerror("rfbProcessClientNormalMessage: read");
-          rfbCloseClient(cl);
-          return;
-      }
-      rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetScaleMsg, sz_rfbSetScaleMsg);
-      rfbLog("rfbSetScale(%d)\n", msg.ssc.scale);
-      rfbScalingSetup(cl,cl->screen->width/msg.ssc.scale, cl->screen->height/msg.ssc.scale);
-
-      rfbSendNewScaleSize(cl);
-      return;
-
-    case rfbXvp:
-
-      if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
-          sz_rfbXvpMsg - 1)) <= 0) {
-          if (n != 0)
-            rfbLogPerror("rfbProcessClientNormalMessage: read");
-          rfbCloseClient(cl);
-          return;
-      }
-      rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbXvpMsg, sz_rfbXvpMsg);
-
-      /* only version when is defined, so echo back a fail */
-      if(msg.xvp.version != 1) {
-	rfbSendXvp(cl, msg.xvp.version, rfbXvp_Fail);
-      }
-      else {
-	/* if the hook exists and fails, send a fail msg */
-	if(cl->screen->xvpHook && !cl->screen->xvpHook(cl, msg.xvp.version, msg.xvp.code))
-	  rfbSendXvp(cl, 1, rfbXvp_Fail);
-      }
-      return;
-
-    default:
-	{
-	    rfbExtensionData *e,*next;
-
-	    for(e=cl->extensions; e;) {
-		next = e->next;
-		if(e->extension->handleMessage &&
-			e->extension->handleMessage(cl, e->data, &msg))
-                {
-                    rfbStatRecordMessageRcvd(cl, msg.type, 0, 0); /* Extension should handle this */
-		    return;
-                }
-		e = next;
-	    }
-
-	    rfbLog("rfbProcessClientNormalMessage: unknown message type %d\n",
-		    msg.type);
-	    rfbLog(" ... closing connection\n");
-	    rfbCloseClient(cl);
-	    return;
-	}
-    }
-}
-
-
-
-/*
- * rfbSendFramebufferUpdate - send the currently pending framebuffer update to
- * the RFB client.
- * givenUpdateRegion is not changed.
- */
-
-rfbBool
-rfbSendFramebufferUpdate(rfbClientPtr cl,
-                         sraRegionPtr givenUpdateRegion)
-{
-    sraRectangleIterator* i=NULL;
-    sraRect rect;
-    int nUpdateRegionRects;
-    rfbFramebufferUpdateMsg *fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;
-    sraRegionPtr updateRegion,updateCopyRegion,tmpRegion;
-    int dx, dy;
-    rfbBool sendCursorShape = FALSE;
-    rfbBool sendCursorPos = FALSE;
-    rfbBool sendKeyboardLedState = FALSE;
-    rfbBool sendSupportedMessages = FALSE;
-    rfbBool sendSupportedEncodings = FALSE;
-    rfbBool sendServerIdentity = FALSE;
-    rfbBool result = TRUE;
-    
-
-    if(cl->screen->displayHook)
-      cl->screen->displayHook(cl);
-
-    /*
-     * If framebuffer size was changed and the client supports NewFBSize
-     * encoding, just send NewFBSize marker and return.
-     */
-
-    if (cl->useNewFBSize && cl->newFBSizePending) {
-      LOCK(cl->updateMutex);
-      cl->newFBSizePending = FALSE;
-      UNLOCK(cl->updateMutex);
-      fu->type = rfbFramebufferUpdate;
-      fu->nRects = Swap16IfLE(1);
-      cl->ublen = sz_rfbFramebufferUpdateMsg;
-      if (!rfbSendNewFBSize(cl, cl->scaledScreen->width, cl->scaledScreen->height)) {
-	if(cl->screen->displayFinishedHook)
-	  cl->screen->displayFinishedHook(cl, FALSE);
-        return FALSE;
-      }
-      result = rfbSendUpdateBuf(cl);
-      if(cl->screen->displayFinishedHook)
-	cl->screen->displayFinishedHook(cl, result);
-      return result;
-    }
-    
-    /*
-     * If this client understands cursor shape updates, cursor should be
-     * removed from the framebuffer. Otherwise, make sure it's put up.
-     */
-
-    if (cl->enableCursorShapeUpdates) {
-      if (cl->cursorWasChanged && cl->readyForSetColourMapEntries)
-	  sendCursorShape = TRUE;
-    }
-
-    /*
-     * Do we plan to send cursor position update?
-     */
-
-    if (cl->enableCursorPosUpdates && cl->cursorWasMoved)
-      sendCursorPos = TRUE;
-
-    /*
-     * Do we plan to send a keyboard state update?
-     */
-    if ((cl->enableKeyboardLedState) &&
-	(cl->screen->getKeyboardLedStateHook!=NULL))
-    {
-        int x;
-        x=cl->screen->getKeyboardLedStateHook(cl->screen);
-        if (x!=cl->lastKeyboardLedState)
-        {
-            sendKeyboardLedState = TRUE;
-            cl->lastKeyboardLedState=x;
-        }
-    }
-
-    /*
-     * Do we plan to send a rfbEncodingSupportedMessages?
-     */
-    if (cl->enableSupportedMessages)
-    {
-        sendSupportedMessages = TRUE;
-        /* We only send this message ONCE <per setEncodings message received>
-         * (We disable it here)
-         */
-        cl->enableSupportedMessages = FALSE;
-    }
-    /*
-     * Do we plan to send a rfbEncodingSupportedEncodings?
-     */
-    if (cl->enableSupportedEncodings)
-    {
-        sendSupportedEncodings = TRUE;
-        /* We only send this message ONCE <per setEncodings message received>
-         * (We disable it here)
-         */
-        cl->enableSupportedEncodings = FALSE;
-    }
-    /*
-     * Do we plan to send a rfbEncodingServerIdentity?
-     */
-    if (cl->enableServerIdentity)
-    {
-        sendServerIdentity = TRUE;
-        /* We only send this message ONCE <per setEncodings message received>
-         * (We disable it here)
-         */
-        cl->enableServerIdentity = FALSE;
-    }
-
-    LOCK(cl->updateMutex);
-
-    /*
-     * The modifiedRegion may overlap the destination copyRegion.  We remove
-     * any overlapping bits from the copyRegion (since they'd only be
-     * overwritten anyway).
-     */
-    
-    sraRgnSubtract(cl->copyRegion,cl->modifiedRegion);
-
-    /*
-     * The client is interested in the region requestedRegion.  The region
-     * which should be updated now is the intersection of requestedRegion
-     * and the union of modifiedRegion and copyRegion.  If it's empty then
-     * no update is needed.
-     */
-
-    updateRegion = sraRgnCreateRgn(givenUpdateRegion);
-    if(cl->screen->progressiveSliceHeight>0) {
-	    int height=cl->screen->progressiveSliceHeight,
-	    	y=cl->progressiveSliceY;
-	    sraRegionPtr bbox=sraRgnBBox(updateRegion);
-	    sraRect rect;
-	    if(sraRgnPopRect(bbox,&rect,0)) {
-		sraRegionPtr slice;
-		if(y<rect.y1 || y>=rect.y2)
-		    y=rect.y1;
-	    	slice=sraRgnCreateRect(0,y,cl->screen->width,y+height);
-		sraRgnAnd(updateRegion,slice);
-		sraRgnDestroy(slice);
-	    }
-	    sraRgnDestroy(bbox);
-	    y+=height;
-	    if(y>=cl->screen->height)
-		    y=0;
-	    cl->progressiveSliceY=y;
-    }
-
-    sraRgnOr(updateRegion,cl->copyRegion);
-    if(!sraRgnAnd(updateRegion,cl->requestedRegion) &&
-       sraRgnEmpty(updateRegion) &&
-       (cl->enableCursorShapeUpdates ||
-	(cl->cursorX == cl->screen->cursorX && cl->cursorY == cl->screen->cursorY)) &&
-       !sendCursorShape && !sendCursorPos && !sendKeyboardLedState &&
-       !sendSupportedMessages && !sendSupportedEncodings && !sendServerIdentity) {
-      sraRgnDestroy(updateRegion);
-      UNLOCK(cl->updateMutex);
-      if(cl->screen->displayFinishedHook)
-	cl->screen->displayFinishedHook(cl, TRUE);
-      return TRUE;
-    }
-
-    /*
-     * We assume that the client doesn't have any pixel data outside the
-     * requestedRegion.  In other words, both the source and destination of a
-     * copy must lie within requestedRegion.  So the region we can send as a
-     * copy is the intersection of the copyRegion with both the requestedRegion
-     * and the requestedRegion translated by the amount of the copy.  We set
-     * updateCopyRegion to this.
-     */
-
-    updateCopyRegion = sraRgnCreateRgn(cl->copyRegion);
-    sraRgnAnd(updateCopyRegion,cl->requestedRegion);
-    tmpRegion = sraRgnCreateRgn(cl->requestedRegion);
-    sraRgnOffset(tmpRegion,cl->copyDX,cl->copyDY);
-    sraRgnAnd(updateCopyRegion,tmpRegion);
-    sraRgnDestroy(tmpRegion);
-    dx = cl->copyDX;
-    dy = cl->copyDY;
-
-    /*
-     * Next we remove updateCopyRegion from updateRegion so that updateRegion
-     * is the part of this update which is sent as ordinary pixel data (i.e not
-     * a copy).
-     */
-
-    sraRgnSubtract(updateRegion,updateCopyRegion);
-
-    /*
-     * Finally we leave modifiedRegion to be the remainder (if any) of parts of
-     * the screen which are modified but outside the requestedRegion.  We also
-     * empty both the requestedRegion and the copyRegion - note that we never
-     * carry over a copyRegion for a future update.
-     */
-
-     sraRgnOr(cl->modifiedRegion,cl->copyRegion);
-     sraRgnSubtract(cl->modifiedRegion,updateRegion);
-     sraRgnSubtract(cl->modifiedRegion,updateCopyRegion);
-
-     sraRgnMakeEmpty(cl->requestedRegion);
-     sraRgnMakeEmpty(cl->copyRegion);
-     cl->copyDX = 0;
-     cl->copyDY = 0;
-   
-     UNLOCK(cl->updateMutex);
-   
-    if (!cl->enableCursorShapeUpdates) {
-      if(cl->cursorX != cl->screen->cursorX || cl->cursorY != cl->screen->cursorY) {
-	rfbRedrawAfterHideCursor(cl,updateRegion);
-	LOCK(cl->screen->cursorMutex);
-	cl->cursorX = cl->screen->cursorX;
-	cl->cursorY = cl->screen->cursorY;
-	UNLOCK(cl->screen->cursorMutex);
-	rfbRedrawAfterHideCursor(cl,updateRegion);
-      }
-      rfbShowCursor(cl);
-    }
-
-    /*
-     * Now send the update.
-     */
-    
-    rfbStatRecordMessageSent(cl, rfbFramebufferUpdate, 0, 0);
-    if (cl->preferredEncoding == rfbEncodingCoRRE) {
-        nUpdateRegionRects = 0;
-
-        for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){
-            int x = rect.x1;
-            int y = rect.y1;
-            int w = rect.x2 - x;
-            int h = rect.y2 - y;
-	    int rectsPerRow, rows;
-            /* We need to count the number of rects in the scaled screen */
-            if (cl->screen!=cl->scaledScreen)
-                rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "rfbSendFramebufferUpdate");
-	    rectsPerRow = (w-1)/cl->correMaxWidth+1;
-	    rows = (h-1)/cl->correMaxHeight+1;
-	    nUpdateRegionRects += rectsPerRow*rows;
-        }
-	sraRgnReleaseIterator(i); i=NULL;
-    } else if (cl->preferredEncoding == rfbEncodingUltra) {
-        nUpdateRegionRects = 0;
-        
-        for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){
-            int x = rect.x1;
-            int y = rect.y1;
-            int w = rect.x2 - x;
-            int h = rect.y2 - y;
-            /* We need to count the number of rects in the scaled screen */
-            if (cl->screen!=cl->scaledScreen)
-                rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "rfbSendFramebufferUpdate");
-            nUpdateRegionRects += (((h-1) / (ULTRA_MAX_SIZE( w ) / w)) + 1);
-          }
-        sraRgnReleaseIterator(i); i=NULL;
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    } else if (cl->preferredEncoding == rfbEncodingZlib) {
-	nUpdateRegionRects = 0;
-
-        for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){
-            int x = rect.x1;
-            int y = rect.y1;
-            int w = rect.x2 - x;
-            int h = rect.y2 - y;
-            /* We need to count the number of rects in the scaled screen */
-            if (cl->screen!=cl->scaledScreen)
-                rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "rfbSendFramebufferUpdate");
-	    nUpdateRegionRects += (((h-1) / (ZLIB_MAX_SIZE( w ) / w)) + 1);
-	}
-	sraRgnReleaseIterator(i); i=NULL;
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-    } else if (cl->preferredEncoding == rfbEncodingTight) {
-	nUpdateRegionRects = 0;
-
-        for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){
-            int x = rect.x1;
-            int y = rect.y1;
-            int w = rect.x2 - x;
-            int h = rect.y2 - y;
-            int n;
-            /* We need to count the number of rects in the scaled screen */
-            if (cl->screen!=cl->scaledScreen)
-                rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "rfbSendFramebufferUpdate");
-	    n = rfbNumCodedRectsTight(cl, x, y, w, h);
-	    if (n == 0) {
-		nUpdateRegionRects = 0xFFFF;
-		break;
-	    }
-	    nUpdateRegionRects += n;
-	}
-	sraRgnReleaseIterator(i); i=NULL;
-#endif
-#endif
-#if defined(LIBVNCSERVER_HAVE_LIBJPEG) && defined(LIBVNCSERVER_HAVE_LIBPNG)
-    } else if (cl->preferredEncoding == rfbEncodingTightPng) {
-	nUpdateRegionRects = 0;
-
-        for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){
-            int x = rect.x1;
-            int y = rect.y1;
-            int w = rect.x2 - x;
-            int h = rect.y2 - y;
-            int n;
-            /* We need to count the number of rects in the scaled screen */
-            if (cl->screen!=cl->scaledScreen)
-                rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "rfbSendFramebufferUpdate");
-	    n = rfbNumCodedRectsTight(cl, x, y, w, h);
-	    if (n == 0) {
-		nUpdateRegionRects = 0xFFFF;
-		break;
-	    }
-	    nUpdateRegionRects += n;
-	}
-	sraRgnReleaseIterator(i); i=NULL;
-#endif
-    } else {
-        nUpdateRegionRects = sraRgnCountRects(updateRegion);
-    }
-
-    fu->type = rfbFramebufferUpdate;
-    if (nUpdateRegionRects != 0xFFFF) {
-	if(cl->screen->maxRectsPerUpdate>0
-	   /* CoRRE splits the screen into smaller squares */
-	   && cl->preferredEncoding != rfbEncodingCoRRE
-	   /* Ultra encoding splits rectangles up into smaller chunks */
-           && cl->preferredEncoding != rfbEncodingUltra
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-	   /* Zlib encoding splits rectangles up into smaller chunks */
-	   && cl->preferredEncoding != rfbEncodingZlib
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-	   /* Tight encoding counts the rectangles differently */
-	   && cl->preferredEncoding != rfbEncodingTight
-#endif
-#endif
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-	   /* Tight encoding counts the rectangles differently */
-	   && cl->preferredEncoding != rfbEncodingTightPng
-#endif
-	   && nUpdateRegionRects>cl->screen->maxRectsPerUpdate) {
-	    sraRegion* newUpdateRegion = sraRgnBBox(updateRegion);
-	    sraRgnDestroy(updateRegion);
-	    updateRegion = newUpdateRegion;
-	    nUpdateRegionRects = sraRgnCountRects(updateRegion);
-	}
-	fu->nRects = Swap16IfLE((uint16_t)(sraRgnCountRects(updateCopyRegion) +
-					   nUpdateRegionRects +
-					   !!sendCursorShape + !!sendCursorPos + !!sendKeyboardLedState +
-					   !!sendSupportedMessages + !!sendSupportedEncodings + !!sendServerIdentity));
-    } else {
-	fu->nRects = 0xFFFF;
-    }
-    cl->ublen = sz_rfbFramebufferUpdateMsg;
-
-   if (sendCursorShape) {
-	cl->cursorWasChanged = FALSE;
-	if (!rfbSendCursorShape(cl))
-	    goto updateFailed;
-    }
-   
-   if (sendCursorPos) {
-	cl->cursorWasMoved = FALSE;
-	if (!rfbSendCursorPos(cl))
-	        goto updateFailed;
-   }
-   
-   if (sendKeyboardLedState) {
-       if (!rfbSendKeyboardLedState(cl))
-           goto updateFailed;
-   }
-
-   if (sendSupportedMessages) {
-       if (!rfbSendSupportedMessages(cl))
-           goto updateFailed;
-   }
-   if (sendSupportedEncodings) {
-       if (!rfbSendSupportedEncodings(cl))
-           goto updateFailed;
-   }
-   if (sendServerIdentity) {
-       if (!rfbSendServerIdentity(cl))
-           goto updateFailed;
-   }
-
-    if (!sraRgnEmpty(updateCopyRegion)) {
-	if (!rfbSendCopyRegion(cl,updateCopyRegion,dx,dy))
-	        goto updateFailed;
-    }
-
-    for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){
-        int x = rect.x1;
-        int y = rect.y1;
-        int w = rect.x2 - x;
-        int h = rect.y2 - y;
-
-        /* We need to count the number of rects in the scaled screen */
-        if (cl->screen!=cl->scaledScreen)
-            rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "rfbSendFramebufferUpdate");
-
-        switch (cl->preferredEncoding) {
-	case -1:
-        case rfbEncodingRaw:
-            if (!rfbSendRectEncodingRaw(cl, x, y, w, h))
-	        goto updateFailed;
-            break;
-        case rfbEncodingRRE:
-            if (!rfbSendRectEncodingRRE(cl, x, y, w, h))
-	        goto updateFailed;
-            break;
-        case rfbEncodingCoRRE:
-            if (!rfbSendRectEncodingCoRRE(cl, x, y, w, h))
-	        goto updateFailed;
-	    break;
-        case rfbEncodingHextile:
-            if (!rfbSendRectEncodingHextile(cl, x, y, w, h))
-	        goto updateFailed;
-            break;
-        case rfbEncodingUltra:
-            if (!rfbSendRectEncodingUltra(cl, x, y, w, h))
-                goto updateFailed;
-            break;
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-	case rfbEncodingZlib:
-	    if (!rfbSendRectEncodingZlib(cl, x, y, w, h))
-	        goto updateFailed;
-	    break;
-       case rfbEncodingZRLE:
-       case rfbEncodingZYWRLE:
-           if (!rfbSendRectEncodingZRLE(cl, x, y, w, h))
-	       goto updateFailed;
-           break;
-#endif
-#if defined(LIBVNCSERVER_HAVE_LIBJPEG) && (defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG))
-	case rfbEncodingTight:
-	    if (!rfbSendRectEncodingTight(cl, x, y, w, h))
-	        goto updateFailed;
-	    break;
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-	case rfbEncodingTightPng:
-	    if (!rfbSendRectEncodingTightPng(cl, x, y, w, h))
-	        goto updateFailed;
-	    break;
-#endif
-#endif
-        }
-    }
-    if (i) {
-        sraRgnReleaseIterator(i);
-        i = NULL;
-    }
-
-    if ( nUpdateRegionRects == 0xFFFF &&
-	 !rfbSendLastRectMarker(cl) )
-	    goto updateFailed;
-
-    if (!rfbSendUpdateBuf(cl)) {
-updateFailed:
-	result = FALSE;
-    }
-
-    if (!cl->enableCursorShapeUpdates) {
-      rfbHideCursor(cl);
-    }
-
-    if(i)
-        sraRgnReleaseIterator(i);
-    sraRgnDestroy(updateRegion);
-    sraRgnDestroy(updateCopyRegion);
-
-    if(cl->screen->displayFinishedHook)
-      cl->screen->displayFinishedHook(cl, result);
-    return result;
-}
-
-
-/*
- * Send the copy region as a string of CopyRect encoded rectangles.
- * The only slightly tricky thing is that we should send the messages in
- * the correct order so that an earlier CopyRect will not corrupt the source
- * of a later one.
- */
-
-rfbBool
-rfbSendCopyRegion(rfbClientPtr cl,
-                  sraRegionPtr reg,
-                  int dx,
-                  int dy)
-{
-    int x, y, w, h;
-    rfbFramebufferUpdateRectHeader rect;
-    rfbCopyRect cr;
-    sraRectangleIterator* i;
-    sraRect rect1;
-
-    /* printf("copyrect: "); sraRgnPrint(reg); putchar('\n');fflush(stdout); */
-    i = sraRgnGetReverseIterator(reg,dx>0,dy>0);
-
-    /* correct for the scale of the screen */
-    dx = ScaleX(cl->screen, cl->scaledScreen, dx);
-    dy = ScaleX(cl->screen, cl->scaledScreen, dy);
-
-    while(sraRgnIteratorNext(i,&rect1)) {
-      x = rect1.x1;
-      y = rect1.y1;
-      w = rect1.x2 - x;
-      h = rect1.y2 - y;
-
-      /* correct for scaling (if necessary) */
-      rfbScaledCorrection(cl->screen, cl->scaledScreen, &x, &y, &w, &h, "copyrect");
-
-      rect.r.x = Swap16IfLE(x);
-      rect.r.y = Swap16IfLE(y);
-      rect.r.w = Swap16IfLE(w);
-      rect.r.h = Swap16IfLE(h);
-      rect.encoding = Swap32IfLE(rfbEncodingCopyRect);
-
-      memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-	     sz_rfbFramebufferUpdateRectHeader);
-      cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-      cr.srcX = Swap16IfLE(x - dx);
-      cr.srcY = Swap16IfLE(y - dy);
-
-      memcpy(&cl->updateBuf[cl->ublen], (char *)&cr, sz_rfbCopyRect);
-      cl->ublen += sz_rfbCopyRect;
-
-      rfbStatRecordEncodingSent(cl, rfbEncodingCopyRect, sz_rfbFramebufferUpdateRectHeader + sz_rfbCopyRect,
-          w * h  * (cl->scaledScreen->bitsPerPixel / 8));
-    }
-    sraRgnReleaseIterator(i);
-
-    return TRUE;
-}
-
-/*
- * Send a given rectangle in raw encoding (rfbEncodingRaw).
- */
-
-rfbBool
-rfbSendRectEncodingRaw(rfbClientPtr cl,
-                       int x,
-                       int y,
-                       int w,
-                       int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    int nlines;
-    int bytesPerLine = w * (cl->format.bitsPerPixel / 8);
-    char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)
-                   + (x * (cl->scaledScreen->bitsPerPixel / 8)));
-
-    /* Flush the buffer to guarantee correct alignment for translateFn(). */
-    if (cl->ublen > 0) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(rfbEncodingRaw);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingRaw, sz_rfbFramebufferUpdateRectHeader + bytesPerLine * h,
-        sz_rfbFramebufferUpdateRectHeader + bytesPerLine * h);
-
-    nlines = (UPDATE_BUF_SIZE - cl->ublen) / bytesPerLine;
-
-    while (TRUE) {
-        if (nlines > h)
-            nlines = h;
-
-        (*cl->translateFn)(cl->translateLookupTable,
-			   &(cl->screen->serverFormat),
-                           &cl->format, fbptr, &cl->updateBuf[cl->ublen],
-                           cl->scaledScreen->paddedWidthInBytes, w, nlines);
-
-        cl->ublen += nlines * bytesPerLine;
-        h -= nlines;
-
-        if (h == 0)     /* rect fitted in buffer, do next one */
-            return TRUE;
-
-        /* buffer full - flush partial rect and do another nlines */
-
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-
-        fbptr += (cl->scaledScreen->paddedWidthInBytes * nlines);
-
-        nlines = (UPDATE_BUF_SIZE - cl->ublen) / bytesPerLine;
-        if (nlines == 0) {
-            rfbErr("rfbSendRectEncodingRaw: send buffer too small for %d "
-                   "bytes per line\n", bytesPerLine);
-            rfbCloseClient(cl);
-            return FALSE;
-        }
-    }
-}
-
-
-
-/*
- * Send an empty rectangle with encoding field set to value of
- * rfbEncodingLastRect to notify client that this is the last
- * rectangle in framebuffer update ("LastRect" extension of RFB
- * protocol).
- */
-
-rfbBool
-rfbSendLastRectMarker(rfbClientPtr cl)
-{
-    rfbFramebufferUpdateRectHeader rect;
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
-	if (!rfbSendUpdateBuf(cl))
-	    return FALSE;
-    }
-
-    rect.encoding = Swap32IfLE(rfbEncodingLastRect);
-    rect.r.x = 0;
-    rect.r.y = 0;
-    rect.r.w = 0;
-    rect.r.h = 0;
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingLastRect, sz_rfbFramebufferUpdateRectHeader, sz_rfbFramebufferUpdateRectHeader);
-
-    return TRUE;
-}
-
-
-/*
- * Send NewFBSize pseudo-rectangle. This tells the client to change
- * its framebuffer size.
- */
-
-rfbBool
-rfbSendNewFBSize(rfbClientPtr cl,
-                 int w,
-                 int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
-	if (!rfbSendUpdateBuf(cl))
-	    return FALSE;
-    }
-
-    if (cl->PalmVNC==TRUE)
-        rfbLog("Sending rfbEncodingNewFBSize in response to a PalmVNC style framebuffer resize (%dx%d)\n", w, h);
-    else
-        rfbLog("Sending rfbEncodingNewFBSize for resize to (%dx%d)\n", w, h);
-
-    rect.encoding = Swap32IfLE(rfbEncodingNewFBSize);
-    rect.r.x = 0;
-    rect.r.y = 0;
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-           sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingNewFBSize, sz_rfbFramebufferUpdateRectHeader, sz_rfbFramebufferUpdateRectHeader);
-
-    return TRUE;
-}
-
-
-/*
- * Send the contents of cl->updateBuf.  Returns 1 if successful, -1 if
- * not (errno should be set).
- */
-
-rfbBool
-rfbSendUpdateBuf(rfbClientPtr cl)
-{
-    if(cl->sock<0)
-      return FALSE;
-
-    if (rfbWriteExact(cl, cl->updateBuf, cl->ublen) < 0) {
-        rfbLogPerror("rfbSendUpdateBuf: write");
-        rfbCloseClient(cl);
-        return FALSE;
-    }
-
-    cl->ublen = 0;
-    return TRUE;
-}
-
-/*
- * rfbSendSetColourMapEntries sends a SetColourMapEntries message to the
- * client, using values from the currently installed colormap.
- */
-
-rfbBool
-rfbSendSetColourMapEntries(rfbClientPtr cl,
-                           int firstColour,
-                           int nColours)
-{
-    char buf[sz_rfbSetColourMapEntriesMsg + 256 * 3 * 2];
-    char *wbuf = buf;
-    rfbSetColourMapEntriesMsg *scme;
-    uint16_t *rgb;
-    rfbColourMap* cm = &cl->screen->colourMap;
-    int i, len;
-
-    if (nColours > 256) {
-	/* some rare hardware has, e.g., 4096 colors cells: PseudoColor:12 */
-    	wbuf = (char *) malloc(sz_rfbSetColourMapEntriesMsg + nColours * 3 * 2);
-    }
-
-    scme = (rfbSetColourMapEntriesMsg *)wbuf;
-    rgb = (uint16_t *)(&wbuf[sz_rfbSetColourMapEntriesMsg]);
-
-    scme->type = rfbSetColourMapEntries;
-
-    scme->firstColour = Swap16IfLE(firstColour);
-    scme->nColours = Swap16IfLE(nColours);
-
-    len = sz_rfbSetColourMapEntriesMsg;
-
-    for (i = 0; i < nColours; i++) {
-      if(i<(int)cm->count) {
-	if(cm->is16) {
-	  rgb[i*3] = Swap16IfLE(cm->data.shorts[i*3]);
-	  rgb[i*3+1] = Swap16IfLE(cm->data.shorts[i*3+1]);
-	  rgb[i*3+2] = Swap16IfLE(cm->data.shorts[i*3+2]);
-	} else {
-	  rgb[i*3] = Swap16IfLE((unsigned short)cm->data.bytes[i*3]);
-	  rgb[i*3+1] = Swap16IfLE((unsigned short)cm->data.bytes[i*3+1]);
-	  rgb[i*3+2] = Swap16IfLE((unsigned short)cm->data.bytes[i*3+2]);
-	}
-      }
-    }
-
-    len += nColours * 3 * 2;
-
-    LOCK(cl->sendMutex);
-    if (rfbWriteExact(cl, wbuf, len) < 0) {
-	rfbLogPerror("rfbSendSetColourMapEntries: write");
-	rfbCloseClient(cl);
-        if (wbuf != buf) free(wbuf);
-        UNLOCK(cl->sendMutex);
-	return FALSE;
-    }
-    UNLOCK(cl->sendMutex);
-
-    rfbStatRecordMessageSent(cl, rfbSetColourMapEntries, len, len);
-    if (wbuf != buf) free(wbuf);
-    return TRUE;
-}
-
-/*
- * rfbSendBell sends a Bell message to all the clients.
- */
-
-void
-rfbSendBell(rfbScreenInfoPtr rfbScreen)
-{
-    rfbClientIteratorPtr i;
-    rfbClientPtr cl;
-    rfbBellMsg b;
-
-    i = rfbGetClientIterator(rfbScreen);
-    while((cl=rfbClientIteratorNext(i))) {
-	b.type = rfbBell;
-        LOCK(cl->sendMutex);
-	if (rfbWriteExact(cl, (char *)&b, sz_rfbBellMsg) < 0) {
-	    rfbLogPerror("rfbSendBell: write");
-	    rfbCloseClient(cl);
-	}
-        UNLOCK(cl->sendMutex);
-    }
-    rfbStatRecordMessageSent(cl, rfbBell, sz_rfbBellMsg, sz_rfbBellMsg);
-    rfbReleaseClientIterator(i);
-}
-
-
-/*
- * rfbSendServerCutText sends a ServerCutText message to all the clients.
- */
-
-void
-rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len)
-{
-    rfbClientPtr cl;
-    rfbServerCutTextMsg sct;
-    rfbClientIteratorPtr iterator;
-
-    iterator = rfbGetClientIterator(rfbScreen);
-    while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
-        sct.type = rfbServerCutText;
-        sct.length = Swap32IfLE(len);
-        LOCK(cl->sendMutex);
-        if (rfbWriteExact(cl, (char *)&sct,
-                       sz_rfbServerCutTextMsg) < 0) {
-            rfbLogPerror("rfbSendServerCutText: write");
-            rfbCloseClient(cl);
-            UNLOCK(cl->sendMutex);
-            continue;
-        }
-        if (rfbWriteExact(cl, str, len) < 0) {
-            rfbLogPerror("rfbSendServerCutText: write");
-            rfbCloseClient(cl);
-        }
-        UNLOCK(cl->sendMutex);
-        rfbStatRecordMessageSent(cl, rfbServerCutText, sz_rfbServerCutTextMsg+len, sz_rfbServerCutTextMsg+len);
-    }
-    rfbReleaseClientIterator(iterator);
-}
-
-/*****************************************************************************
- *
- * UDP can be used for keyboard and pointer events when the underlying
- * network is highly reliable.  This is really here to support ORL's
- * videotile, whose TCP implementation doesn't like sending lots of small
- * packets (such as 100s of pen readings per second!).
- */
-
-static unsigned char ptrAcceleration = 50;
-
-void
-rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,
-                    int sock)
-{
-  if (write(sock, (char*) &ptrAcceleration, 1) < 0) {
-	rfbLogPerror("rfbNewUDPConnection: write");
-    }
-}
-
-/*
- * Because UDP is a message based service, we can't read the first byte and
- * then the rest of the packet separately like we do with TCP.  We will always
- * get a whole packet delivered in one go, so we ask read() for the maximum
- * number of bytes we can possibly get.
- */
-
-void
-rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
-{
-    int n;
-    rfbClientPtr cl=rfbScreen->udpClient;
-    rfbClientToServerMsg msg;
-
-    if((!cl) || cl->onHold)
-      return;
-
-    if ((n = read(rfbScreen->udpSock, (char *)&msg, sizeof(msg))) <= 0) {
-	if (n < 0) {
-	    rfbLogPerror("rfbProcessUDPInput: read");
-	}
-	rfbDisconnectUDPSock(rfbScreen);
-	return;
-    }
-
-    switch (msg.type) {
-
-    case rfbKeyEvent:
-	if (n != sz_rfbKeyEventMsg) {
-	    rfbErr("rfbProcessUDPInput: key event incorrect length\n");
-	    rfbDisconnectUDPSock(rfbScreen);
-	    return;
-	}
-	cl->screen->kbdAddEvent(msg.ke.down, (rfbKeySym)Swap32IfLE(msg.ke.key), cl);
-	break;
-
-    case rfbPointerEvent:
-	if (n != sz_rfbPointerEventMsg) {
-	    rfbErr("rfbProcessUDPInput: ptr event incorrect length\n");
-	    rfbDisconnectUDPSock(rfbScreen);
-	    return;
-	}
-	cl->screen->ptrAddEvent(msg.pe.buttonMask,
-		    Swap16IfLE(msg.pe.x), Swap16IfLE(msg.pe.y), cl);
-	break;
-
-    default:
-	rfbErr("rfbProcessUDPInput: unknown message type %d\n",
-	       msg.type);
-	rfbDisconnectUDPSock(rfbScreen);
-    }
-}
-
-
diff --git a/ica/x11/libvncserver/rfbssl.h b/ica/x11/libvncserver/rfbssl.h
deleted file mode 100644
index f1c4792..0000000
--- a/ica/x11/libvncserver/rfbssl.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _VNCSSL_H
-#define _VNCSSL_H 1
-
-#include "rfb/rfb.h"
-#include "rfb/rfbconfig.h"
-
-int rfbssl_init(rfbClientPtr cl);
-int rfbssl_pending(rfbClientPtr cl);
-int rfbssl_peek(rfbClientPtr cl, char *buf, int bufsize);
-int rfbssl_read(rfbClientPtr cl, char *buf, int bufsize);
-int rfbssl_write(rfbClientPtr cl, const char *buf, int bufsize);
-void rfbssl_destroy(rfbClientPtr cl);
-
-
-#endif /* _VNCSSL_H */
diff --git a/ica/x11/libvncserver/rfbssl_gnutls.c b/ica/x11/libvncserver/rfbssl_gnutls.c
deleted file mode 100644
index cf60cdc..0000000
--- a/ica/x11/libvncserver/rfbssl_gnutls.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * rfbssl_gnutls.c - Secure socket funtions (gnutls version)
- */
-
-/*
- *  Copyright (C) 2011 Gernot Tenchio
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include "rfbssl.h"
-#include <gnutls/gnutls.h>
-#include <errno.h>
-
-struct rfbssl_ctx {
-    char peekbuf[2048];
-    int peeklen;
-    int peekstart;
-    gnutls_session_t session;
-    gnutls_certificate_credentials_t x509_cred;
-    gnutls_dh_params_t dh_params;
-#ifdef I_LIKE_RSA_PARAMS_THAT_MUCH
-    gnutls_rsa_params_t rsa_params;
-#endif
-};
-
-void rfbssl_log_func(int level, const char *msg)
-{
-    rfbErr("SSL: %s", msg);
-}
-
-static void rfbssl_error(const char *msg, int e)
-{
-    rfbErr("%s: %s (%ld)\n", msg, gnutls_strerror(e), e);
-}
-
-static int rfbssl_init_session(struct rfbssl_ctx *ctx, int fd)
-{
-    gnutls_session_t session;
-    int ret;
-
-    if (!GNUTLS_E_SUCCESS == (ret = gnutls_init(&session, GNUTLS_SERVER))) {
-      /* */
-    } else if (!GNUTLS_E_SUCCESS == (ret = gnutls_priority_set_direct(session, "EXPORT", NULL))) {
-      /* */
-    } else if (!GNUTLS_E_SUCCESS == (ret = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, ctx->x509_cred))) {
-      /* */
-    } else {
-      gnutls_session_enable_compatibility_mode(session);
-      gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t)(uintptr_t)fd);
-      ctx->session = session;
-    }
-    return ret;
-}
-
-static int generate_dh_params(struct rfbssl_ctx *ctx)
-{
-    int ret;
-    if (GNUTLS_E_SUCCESS == (ret = gnutls_dh_params_init(&ctx->dh_params)))
-	ret = gnutls_dh_params_generate2(ctx->dh_params, 1024);
-    return ret;
-}
-
-#ifdef I_LIKE_RSA_PARAMS_THAT_MUCH
-static int generate_rsa_params(struct rfbssl_ctx *ctx)
-{
-    int ret;
-    if (GNUTLS_E_SUCCESS == (ret = gnutls_rsa_params_init(&ctx->rsa_params)))
-	ret = gnutls_rsa_params_generate2(ctx->rsa_params, 512);
-    return ret;
-}
-#endif
-
-struct rfbssl_ctx *rfbssl_init_global(char *key, char *cert)
-{
-    int ret = GNUTLS_E_SUCCESS;
-    struct rfbssl_ctx *ctx = NULL;
-
-    if (NULL == (ctx = malloc(sizeof(struct rfbssl_ctx)))) {
-	ret = GNUTLS_E_MEMORY_ERROR;
-    } else if (!GNUTLS_E_SUCCESS == (ret = gnutls_global_init())) {
-	/* */
-    } else if (!GNUTLS_E_SUCCESS == (ret = gnutls_certificate_allocate_credentials(&ctx->x509_cred))) {
-	/* */
-    } else if ((ret = gnutls_certificate_set_x509_trust_file(ctx->x509_cred, cert, GNUTLS_X509_FMT_PEM)) < 0) {
-	/* */
-    } else if (!GNUTLS_E_SUCCESS == (ret = gnutls_certificate_set_x509_key_file(ctx->x509_cred, cert, key, GNUTLS_X509_FMT_PEM))) {
-	/* */
-    } else if (!GNUTLS_E_SUCCESS == (ret = generate_dh_params(ctx))) {
-	/* */
-#ifdef I_LIKE_RSA_PARAMS_THAT_MUCH
-    } else if (!GNUTLS_E_SUCCESS == (ret = generate_rsa_params(ctx))) {
-	/* */
-#endif
-    } else {
-	gnutls_global_set_log_function(rfbssl_log_func);
-	gnutls_global_set_log_level(1);
-	gnutls_certificate_set_dh_params(ctx->x509_cred, ctx->dh_params);
-	return ctx;
-    }
-
-    free(ctx);
-    return NULL;
-}
-
-int rfbssl_init(rfbClientPtr cl)
-{
-    int ret = -1;
-    struct rfbssl_ctx *ctx;
-    char *keyfile;
-    if (!(keyfile = cl->screen->sslkeyfile))
-	keyfile = cl->screen->sslcertfile;
-
-    if (NULL == (ctx = rfbssl_init_global(keyfile,  cl->screen->sslcertfile))) {
-	/* */
-    } else if (GNUTLS_E_SUCCESS != (ret = rfbssl_init_session(ctx, cl->sock))) {
-	/* */
-    } else {
-	while (GNUTLS_E_SUCCESS != (ret = gnutls_handshake(ctx->session))) {
-	    if (ret == GNUTLS_E_AGAIN)
-		continue;
-	    break;
-	}
-    }
-
-    if (ret != GNUTLS_E_SUCCESS) {
-	rfbssl_error(__func__, ret);
-    } else {
-	cl->sslctx = (rfbSslCtx *)ctx;
-	rfbLog("%s protocol initialized\n", gnutls_protocol_get_name(gnutls_protocol_get_version(ctx->session)));
-    }
-    return ret;
-}
-
-static int rfbssl_do_read(rfbClientPtr cl, char *buf, int bufsize)
-{
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-    int ret;
-
-    while ((ret = gnutls_record_recv(ctx->session, buf, bufsize)) < 0) {
-	if (ret == GNUTLS_E_AGAIN) {
-	    /* continue */
-	} else if (ret == GNUTLS_E_INTERRUPTED) {
-	    /* continue */
-	} else {
-	    break;
-	}
-    }
-
-    if (ret < 0) {
-	rfbssl_error(__func__, ret);
-	errno = EIO;
-	ret = -1;
-    }
-
-    return ret < 0 ? -1 : ret;
-}
-
-int rfbssl_write(rfbClientPtr cl, const char *buf, int bufsize)
-{
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-    int ret;
-
-    while ((ret = gnutls_record_send(ctx->session, buf, bufsize)) < 0) {
-	if (ret == GNUTLS_E_AGAIN) {
-	    /* continue */
-	} else if (ret == GNUTLS_E_INTERRUPTED) {
-	    /* continue */
-	} else {
-	    break;
-	}
-    }
-
-    if (ret < 0)
-	rfbssl_error(__func__, ret);
-
-    return ret;
-}
-
-static void rfbssl_gc_peekbuf(struct rfbssl_ctx *ctx, int bufsize)
-{
-    if (ctx->peekstart) {
-	int spaceleft = sizeof(ctx->peekbuf) - ctx->peeklen - ctx->peekstart;
-	if (spaceleft < bufsize) {
-	    memmove(ctx->peekbuf, ctx->peekbuf + ctx->peekstart, ctx->peeklen);
-	    ctx->peekstart = 0;
-	}
-    }
-}
-
-static int __rfbssl_read(rfbClientPtr cl, char *buf, int bufsize, int peek)
-{
-    int ret = 0;
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-
-    rfbssl_gc_peekbuf(ctx, bufsize);
-
-    if (ctx->peeklen) {
-	/* If we have any peek data, simply return that. */
-	ret = bufsize < ctx->peeklen ? bufsize : ctx->peeklen;
-	memcpy (buf, ctx->peekbuf + ctx->peekstart, ret);
-	if (!peek) {
-	    ctx->peeklen -= ret;
-	    if (ctx->peeklen != 0)
-		ctx->peekstart += ret;
-	    else
-		ctx->peekstart = 0;
-	}
-    }
-
-    if (ret < bufsize) {
-	int n;
-	/* read the remaining data */
-	if ((n = rfbssl_do_read(cl, buf + ret, bufsize - ret)) <= 0) {
-	    rfbErr("rfbssl_%s: %s error\n", __func__, peek ? "peek" : "read");
-	    return n;
-	}
-	if (peek) {
-	    memcpy(ctx->peekbuf + ctx->peekstart + ctx->peeklen, buf + ret, n);
-	    ctx->peeklen += n;
-	}
-	ret += n;
-    }
-
-    return ret;
-}
-
-int rfbssl_read(rfbClientPtr cl, char *buf, int bufsize)
-{
-    return __rfbssl_read(cl, buf, bufsize, 0);
-}
-
-int rfbssl_peek(rfbClientPtr cl, char *buf, int bufsize)
-{
-    return __rfbssl_read(cl, buf, bufsize, 1);
-}
-
-int rfbssl_pending(rfbClientPtr cl)
-{
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-    int ret = ctx->peeklen;
-
-    if (ret <= 0)
-	ret = gnutls_record_check_pending(ctx->session);
-
-    return ret;
-}
-
-void rfbssl_destroy(rfbClientPtr cl)
-{
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-    gnutls_bye(ctx->session, GNUTLS_SHUT_WR);
-    gnutls_deinit(ctx->session);
-    gnutls_certificate_free_credentials(ctx->x509_cred);
-}
diff --git a/ica/x11/libvncserver/rfbssl_none.c b/ica/x11/libvncserver/rfbssl_none.c
deleted file mode 100644
index 488a6f4..0000000
--- a/ica/x11/libvncserver/rfbssl_none.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * rfbssl_none.c - Secure socket functions (fallback to failing)
- */
-
-/*
- *  Copyright (C) 2011 Johannes Schindelin
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include "rfbssl.h"
-
-struct rfbssl_ctx *rfbssl_init_global(char *key, char *cert)
-{
-    return NULL;
-}
-
-int rfbssl_init(rfbClientPtr cl)
-{
-    return -1;
-}
-
-int rfbssl_write(rfbClientPtr cl, const char *buf, int bufsize)
-{
-    return -1;
-}
-
-int rfbssl_peek(rfbClientPtr cl, char *buf, int bufsize)
-{
-    return -1;
-}
-
-int rfbssl_read(rfbClientPtr cl, char *buf, int bufsize)
-{
-    return -1;
-}
-
-int rfbssl_pending(rfbClientPtr cl)
-{
-    return -1;
-}
-
-void rfbssl_destroy(rfbClientPtr cl)
-{
-}
diff --git a/ica/x11/libvncserver/rfbssl_openssl.c b/ica/x11/libvncserver/rfbssl_openssl.c
deleted file mode 100644
index cbd6865..0000000
--- a/ica/x11/libvncserver/rfbssl_openssl.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * rfbssl_openssl.c - Secure socket funtions (openssl version)
- */
-
-/*
- *  Copyright (C) 2011 Gernot Tenchio
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include "rfbssl.h"
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-
-struct rfbssl_ctx {
-    SSL_CTX *ssl_ctx;
-    SSL     *ssl;
-};
-
-static void rfbssl_error(void)
-{
-    char buf[1024];
-    unsigned long e = ERR_get_error();
-    rfbErr("%s (%ld)\n", ERR_error_string(e, buf), e);
-}
-
-int rfbssl_init(rfbClientPtr cl)
-{
-    char *keyfile;
-    int r, ret = -1;
-    struct rfbssl_ctx *ctx;
-
-    SSL_library_init();
-    SSL_load_error_strings();
-
-    if (cl->screen->sslkeyfile && *cl->screen->sslkeyfile) {
-      keyfile = cl->screen->sslkeyfile;
-    } else {
-      keyfile = cl->screen->sslcertfile;
-    }
-
-    if (NULL == (ctx = malloc(sizeof(struct rfbssl_ctx)))) {
-	rfbErr("OOM\n");
-    } else if (!cl->screen->sslcertfile || !cl->screen->sslcertfile[0]) {
-	rfbErr("SSL connection but no cert specified\n");
-    } else if (NULL == (ctx->ssl_ctx = SSL_CTX_new(TLSv1_server_method()))) {
-	rfbssl_error();
-    } else if (SSL_CTX_use_PrivateKey_file(ctx->ssl_ctx, keyfile, SSL_FILETYPE_PEM) <= 0) {
-	rfbErr("Unable to load private key file %s\n", keyfile);
-    } else if (SSL_CTX_use_certificate_file(ctx->ssl_ctx, cl->screen->sslcertfile, SSL_FILETYPE_PEM) <= 0) {
-	rfbErr("Unable to load certificate file %s\n", cl->screen->sslcertfile);
-    } else if (NULL == (ctx->ssl = SSL_new(ctx->ssl_ctx))) {
-	rfbErr("SSL_new failed\n");
-	rfbssl_error();
-    } else if (!(SSL_set_fd(ctx->ssl, cl->sock))) {
-	rfbErr("SSL_set_fd failed\n");
-	rfbssl_error();
-    } else {
-	while ((r = SSL_accept(ctx->ssl)) < 0) {
-	    if (SSL_get_error(ctx->ssl, r) != SSL_ERROR_WANT_READ)
-		break;
-	}
-	if (r < 0) {
-	    rfbErr("SSL_accept failed %d\n", SSL_get_error(ctx->ssl, r));
-	} else {
-	    cl->sslctx = (rfbSslCtx *)ctx;
-	    ret = 0;
-	}
-    }
-    return ret;
-}
-
-int rfbssl_write(rfbClientPtr cl, const char *buf, int bufsize)
-{
-    int ret;
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-
-    while ((ret = SSL_write(ctx->ssl, buf, bufsize)) <= 0) {
-	if (SSL_get_error(ctx->ssl, ret) != SSL_ERROR_WANT_WRITE)
-	    break;
-    }
-    return ret;
-}
-
-int rfbssl_peek(rfbClientPtr cl, char *buf, int bufsize)
-{
-    int ret;
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-
-    while ((ret = SSL_peek(ctx->ssl, buf, bufsize)) <= 0) {
-	if (SSL_get_error(ctx->ssl, ret) != SSL_ERROR_WANT_READ)
-	    break;
-    }
-    return ret;
-}
-
-int rfbssl_read(rfbClientPtr cl, char *buf, int bufsize)
-{
-    int ret;
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-
-    while ((ret = SSL_read(ctx->ssl, buf, bufsize)) <= 0) {
-	if (SSL_get_error(ctx->ssl, ret) != SSL_ERROR_WANT_READ)
-	    break;
-    }
-    return ret;
-}
-
-int rfbssl_pending(rfbClientPtr cl)
-{
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-    return SSL_pending(ctx->ssl);
-}
-
-void rfbssl_destroy(rfbClientPtr cl)
-{
-    struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
-    if (ctx->ssl)
-	SSL_free(ctx->ssl);
-    if (ctx->ssl_ctx)
-	SSL_CTX_free(ctx->ssl_ctx);
-}
diff --git a/ica/x11/libvncserver/rre.c b/ica/x11/libvncserver/rre.c
deleted file mode 100644
index 2103153..0000000
--- a/ica/x11/libvncserver/rre.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * rre.c
- *
- * Routines to implement Rise-and-Run-length Encoding (RRE).  This
- * code is based on krw's original javatel rfbserver.
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-
-/*
- * cl->beforeEncBuf contains pixel data in the client's format.
- * cl->afterEncBuf contains the RRE encoded version.  If the RRE encoded version is
- * larger than the raw data or if it exceeds cl->afterEncBufSize then
- * raw encoding is used instead.
- */
-
-static int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);
-static int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);
-static int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);
-static uint32_t getBgColour(char *data, int size, int bpp);
-
-
-/*
- * rfbSendRectEncodingRRE - send a given rectangle using RRE encoding.
- */
-
-rfbBool
-rfbSendRectEncodingRRE(rfbClientPtr cl,
-                       int x,
-                       int y,
-                       int w,
-                       int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    rfbRREHeader hdr;
-    int nSubrects;
-    int i;
-    char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)
-                   + (x * (cl->scaledScreen->bitsPerPixel / 8)));
-
-    int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
-                      * (cl->format.bitsPerPixel / 8));
-
-    if (cl->beforeEncBufSize < maxRawSize) {
-        cl->beforeEncBufSize = maxRawSize;
-        if (cl->beforeEncBuf == NULL)
-            cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
-        else
-            cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
-    }
-
-    if (cl->afterEncBufSize < maxRawSize) {
-        cl->afterEncBufSize = maxRawSize;
-        if (cl->afterEncBuf == NULL)
-            cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
-        else
-            cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
-    }
-
-    (*cl->translateFn)(cl->translateLookupTable,
-		       &(cl->screen->serverFormat),
-                       &cl->format, fbptr, cl->beforeEncBuf,
-                       cl->scaledScreen->paddedWidthInBytes, w, h);
-
-    switch (cl->format.bitsPerPixel) {
-    case 8:
-        nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h);
-        break;
-    case 16:
-        nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h);
-        break;
-    case 32:
-        nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h);
-        break;
-    default:
-        rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
-        return FALSE;
-    }
-        
-    if (nSubrects < 0) {
-
-        /* RRE encoding was too large, use raw */
-
-        return rfbSendRectEncodingRaw(cl, x, y, w, h);
-    }
-
-    rfbStatRecordEncodingSent(cl, rfbEncodingRRE,
-                              sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen,
-                              sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8));
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
-        > UPDATE_BUF_SIZE)
-    {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(rfbEncodingRRE);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-           sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    hdr.nSubrects = Swap32IfLE(nSubrects);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
-    cl->ublen += sz_rfbRREHeader;
-
-    for (i = 0; i < cl->afterEncBufLen;) {
-
-        int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
-
-        if (i + bytesToCopy > cl->afterEncBufLen) {
-            bytesToCopy = cl->afterEncBufLen - i;
-        }
-
-        memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
-
-        cl->ublen += bytesToCopy;
-        i += bytesToCopy;
-
-        if (cl->ublen == UPDATE_BUF_SIZE) {
-            if (!rfbSendUpdateBuf(cl))
-                return FALSE;
-        }
-    }
-
-    return TRUE;
-}
-
-
-
-/*
- * subrectEncode() encodes the given multicoloured rectangle as a background 
- * colour overwritten by single-coloured rectangles.  It returns the number 
- * of subrectangles in the encoded buffer, or -1 if subrect encoding won't
- * fit in the buffer.  It puts the encoded rectangles in cl->afterEncBuf.  The
- * single-colour rectangle partition is not optimal, but does find the biggest
- * horizontal or vertical rectangle top-left anchored to each consecutive 
- * coordinate position.
- *
- * The coding scheme is simply [<bgcolour><subrect><subrect>...] where each 
- * <subrect> is [<colour><x><y><w><h>].
- */
-
-#define DEFINE_SUBRECT_ENCODE(bpp)                                            \
-static int                                                                    \
- subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) { \
-    uint##bpp##_t cl;                                                         \
-    rfbRectangle subrect;                                                     \
-    int x,y;                                                                  \
-    int i,j;                                                                  \
-    int hx=0,hy,vx=0,vy;                                                      \
-    int hyflag;                                                               \
-    uint##bpp##_t *seg;                                                       \
-    uint##bpp##_t *line;                                                      \
-    int hw,hh,vw,vh;                                                          \
-    int thex,they,thew,theh;                                                  \
-    int numsubs = 0;                                                          \
-    int newLen;                                                               \
-    uint##bpp##_t bg = (uint##bpp##_t)getBgColour((char*)data,w*h,bpp);       \
-                                                                              \
-    *((uint##bpp##_t*)client->afterEncBuf) = bg;                                      \
-                                                                              \
-    client->afterEncBufLen = (bpp/8);                                                 \
-                                                                              \
-    for (y=0; y<h; y++) {                                                     \
-      line = data+(y*w);                                                      \
-      for (x=0; x<w; x++) {                                                   \
-        if (line[x] != bg) {                                                  \
-          cl = line[x];                                                       \
-          hy = y-1;                                                           \
-          hyflag = 1;                                                         \
-          for (j=y; j<h; j++) {                                               \
-            seg = data+(j*w);                                                 \
-            if (seg[x] != cl) {break;}                                        \
-            i = x;                                                            \
-            while ((seg[i] == cl) && (i < w)) i += 1;                         \
-            i -= 1;                                                           \
-            if (j == y) vx = hx = i;                                          \
-            if (i < vx) vx = i;                                               \
-            if ((hyflag > 0) && (i >= hx)) {hy += 1;} else {hyflag = 0;}      \
-          }                                                                   \
-          vy = j-1;                                                           \
-                                                                              \
-          /*  We now have two possible subrects: (x,y,hx,hy) and (x,y,vx,vy)  \
-           *  We'll choose the bigger of the two.                             \
-           */                                                                 \
-          hw = hx-x+1;                                                        \
-          hh = hy-y+1;                                                        \
-          vw = vx-x+1;                                                        \
-          vh = vy-y+1;                                                        \
-                                                                              \
-          thex = x;                                                           \
-          they = y;                                                           \
-                                                                              \
-          if ((hw*hh) > (vw*vh)) {                                            \
-            thew = hw;                                                        \
-            theh = hh;                                                        \
-          } else {                                                            \
-            thew = vw;                                                        \
-            theh = vh;                                                        \
-          }                                                                   \
-                                                                              \
-          subrect.x = Swap16IfLE(thex);                                       \
-          subrect.y = Swap16IfLE(they);                                       \
-          subrect.w = Swap16IfLE(thew);                                       \
-          subrect.h = Swap16IfLE(theh);                                       \
-                                                                              \
-          newLen = client->afterEncBufLen + (bpp/8) + sz_rfbRectangle;                \
-          if ((newLen > (w * h * (bpp/8))) || (newLen > client->afterEncBufSize))     \
-            return -1;                                                        \
-                                                                              \
-          numsubs += 1;                                                       \
-          *((uint##bpp##_t*)(client->afterEncBuf + client->afterEncBufLen)) = cl;             \
-          client->afterEncBufLen += (bpp/8);                                          \
-          memcpy(&client->afterEncBuf[client->afterEncBufLen],&subrect,sz_rfbRectangle);      \
-          client->afterEncBufLen += sz_rfbRectangle;                                  \
-                                                                              \
-          /*                                                                  \
-           * Now mark the subrect as done.                                    \
-           */                                                                 \
-          for (j=they; j < (they+theh); j++) {                                \
-            for (i=thex; i < (thex+thew); i++) {                              \
-              data[j*w+i] = bg;                                               \
-            }                                                                 \
-          }                                                                   \
-        }                                                                     \
-      }                                                                       \
-    }                                                                         \
-                                                                              \
-    return numsubs;                                                           \
-}
-
-DEFINE_SUBRECT_ENCODE(8)
-DEFINE_SUBRECT_ENCODE(16)
-DEFINE_SUBRECT_ENCODE(32)
-
-
-/*
- * getBgColour() gets the most prevalent colour in a byte array.
- */
-static uint32_t
-getBgColour(char *data, int size, int bpp)
-{
-    
-#define NUMCLRS 256
-  
-  static int counts[NUMCLRS];
-  int i,j,k;
-
-  int maxcount = 0;
-  uint8_t maxclr = 0;
-
-  if (bpp != 8) {
-    if (bpp == 16) {
-      return ((uint16_t *)data)[0];
-    } else if (bpp == 32) {
-      return ((uint32_t *)data)[0];
-    } else {
-      rfbLog("getBgColour: bpp %d?\n",bpp);
-      return 0;
-    }
-  }
-
-  for (i=0; i<NUMCLRS; i++) {
-    counts[i] = 0;
-  }
-
-  for (j=0; j<size; j++) {
-    k = (int)(((uint8_t *)data)[j]);
-    if (k >= NUMCLRS) {
-      rfbErr("getBgColour: unusual colour = %d\n", k);
-      return 0;
-    }
-    counts[k] += 1;
-    if (counts[k] > maxcount) {
-      maxcount = counts[k];
-      maxclr = ((uint8_t *)data)[j];
-    }
-  }
-  
-  return maxclr;
-}
diff --git a/ica/x11/libvncserver/scale.c b/ica/x11/libvncserver/scale.c
deleted file mode 100644
index 6f91391..0000000
--- a/ica/x11/libvncserver/scale.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * scale.c - deal with server-side scaling.
- */
-
-/*
- *  Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
- *  Copyright (C) 2002 RealVNC Ltd.
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#endif
-#include <string.h>
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-#include "private.h"
-
-#ifdef LIBVNCSERVER_HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef WIN32
-#define write(sock,buf,len) send(sock,buf,len,0)
-#else
-#ifdef LIBVNCSERVER_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <pwd.h>
-#ifdef LIBVNCSERVER_HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#endif
-#endif
-
-#ifdef DEBUGPROTO
-#undef DEBUGPROTO
-#define DEBUGPROTO(x) x
-#else
-#define DEBUGPROTO(x)
-#endif
-
-/****************************/
-#define CEIL(x)  ( (double) ((int) (x)) == (x) ? \
-        (double) ((int) (x)) : (double) ((int) (x) + 1) )
-#define FLOOR(x) ( (double) ((int) (x)) )
-
-
-int ScaleX(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int x)
-{
-    if ((from==to) || (from==NULL) || (to==NULL)) return x;
-    return ((int)(((double) x / (double)from->width) * (double)to->width ));
-}
-
-int ScaleY(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int y)
-{
-    if ((from==to) || (from==NULL) || (to==NULL)) return y;
-    return ((int)(((double) y / (double)from->height) * (double)to->height ));
-}
-
-/* So, all of the encodings point to the ->screen->frameBuffer,
- * We need to change this!
- */
-void rfbScaledCorrection(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int *x, int *y, int *w, int *h, const char *function)
-{
-    double x1,y1,w1,h1, x2, y2, w2, h2;
-    double scaleW = ((double) to->width) / ((double) from->width);
-    double scaleH = ((double) to->height) / ((double) from->height);
-
-
-    /*
-     * rfbLog("rfbScaledCorrection(%p -> %p, %dx%d->%dx%d (%dXx%dY-%dWx%dH)\n",
-     * from, to, from->width, from->height, to->width, to->height, *x, *y, *w, *h);
-     */
-
-    /* If it's the original framebuffer... */
-    if (from==to) return;
-
-    x1 = ((double) *x) * scaleW;
-    y1 = ((double) *y) * scaleH;
-    w1 = ((double) *w) * scaleW;
-    h1 = ((double) *h) * scaleH;
-
-
-    /*cast from double to int is same as "*x = floor(x1);" */
-    x2 = FLOOR(x1);
-    y2 = FLOOR(y1);
-
-    /* include into W and H the jitter of scaling X and Y */
-    w2 = CEIL(w1 + ( x1 - x2 ));
-    h2 = CEIL(h1 + ( y1 - y2 ));
-
-    /*
-     * rfbLog("%s (%dXx%dY-%dWx%dH  ->  %fXx%fY-%fWx%fH) {%dWx%dH -> %dWx%dH}\n",
-     *    function, *x, *y, *w, *h, x2, y2, w2, h2,
-     *    from->width, from->height, to->width, to->height);
-     */
-
-    /* simulate ceil() without math library */
-    *x = (int)x2;
-    *y = (int)y2;
-    *w = (int)w2;
-    *h = (int)h2;
-
-    /* Small changes for a thumbnail may be scaled to zero */
-    if (*w==0) (*w)++;
-    if (*h==0) (*h)++;
-    /* scaling from small to big may overstep the size a bit */
-    if (*x+*w > to->width)  *w=to->width - *x;
-    if (*y+*h > to->height) *h=to->height - *y;
-}
-
-void rfbScaledScreenUpdateRect(rfbScreenInfoPtr screen, rfbScreenInfoPtr ptr, int x0, int y0, int w0, int h0)
-{
-    int x,y,w,v,z;
-    int x1, y1, w1, h1;
-    int bitsPerPixel, bytesPerPixel, bytesPerLine, areaX, areaY, area2;
-    unsigned char *srcptr, *dstptr;
-
-    /* Nothing to do!!! */
-    if (screen==ptr) return;
-
-    x1 = x0;
-    y1 = y0;
-    w1 = w0;
-    h1 = h0;
-
-    rfbScaledCorrection(screen, ptr, &x1, &y1, &w1, &h1, "rfbScaledScreenUpdateRect");
-    x0 = ScaleX(ptr, screen, x1);
-    y0 = ScaleY(ptr, screen, y1);
-    w0 = ScaleX(ptr, screen, w1);
-    h0 = ScaleY(ptr, screen, h1);
-
-    bitsPerPixel = screen->bitsPerPixel;
-    bytesPerPixel = bitsPerPixel / 8;
-    bytesPerLine = w1 * bytesPerPixel;
-    srcptr = (unsigned char *)(screen->frameBuffer +
-     (y0 * screen->paddedWidthInBytes + x0 * bytesPerPixel));
-    dstptr = (unsigned char *)(ptr->frameBuffer +
-     ( y1 * ptr->paddedWidthInBytes + x1 * bytesPerPixel));
-    /* The area of the source framebuffer for each destination pixel */
-    areaX = ScaleX(ptr,screen,1);
-    areaY = ScaleY(ptr,screen,1);
-    area2 = areaX*areaY;
-
-
-    /* Ensure that we do not go out of bounds */
-    if ((x1+w1) > (ptr->width))
-    {
-      if (x1==0) w1=ptr->width; else x1 = ptr->width - w1;
-    }
-    if ((y1+h1) > (ptr->height))
-    {
-      if (y1==0) h1=ptr->height; else y1 = ptr->height - h1;
-    }
-    /*
-     * rfbLog("rfbScaledScreenUpdateRect(%dXx%dY-%dWx%dH  ->  %dXx%dY-%dWx%dH <%dx%d>) {%dWx%dH -> %dWx%dH} 0x%p\n",
-     *    x0, y0, w0, h0, x1, y1, w1, h1, areaX, areaY,
-     *    screen->width, screen->height, ptr->width, ptr->height, ptr->frameBuffer);
-     */
-
-    if (screen->serverFormat.trueColour) { /* Blend neighbouring pixels together */
-      unsigned char *srcptr2;
-      unsigned long pixel_value, red, green, blue;
-      unsigned int redShift = screen->serverFormat.redShift;
-      unsigned int greenShift = screen->serverFormat.greenShift;
-      unsigned int blueShift = screen->serverFormat.blueShift;
-      unsigned long redMax = screen->serverFormat.redMax;
-      unsigned long greenMax = screen->serverFormat.greenMax;
-      unsigned long blueMax = screen->serverFormat.blueMax;
-
-     /* for each *destination* pixel... */
-     for (y = 0; y < h1; y++) {
-       for (x = 0; x < w1; x++) {
-         red = green = blue = 0;
-         /* Get the totals for rgb from the source grid... */
-         for (w = 0; w < areaX; w++) {
-           for (v = 0; v < areaY; v++) {
-             srcptr2 = &srcptr[(((x * areaX) + w) * bytesPerPixel) +
-                               (v * screen->paddedWidthInBytes)];
-             pixel_value = 0;
-
-
-             switch (bytesPerPixel) {
-             case 4: pixel_value = *((unsigned int *)srcptr2);   break;
-             case 2: pixel_value = *((unsigned short *)srcptr2); break;
-             case 1: pixel_value = *((unsigned char *)srcptr2);  break;
-             default:
-               /* fixme: endianess problem? */
-               for (z = 0; z < bytesPerPixel; z++)
-                 pixel_value += (srcptr2[z] << (8 * z));
-                break;
-              }
-              /*
-              srcptr2 += bytesPerPixel;
-              */
-
-            red += ((pixel_value >> redShift) & redMax);
-            green += ((pixel_value >> greenShift) & greenMax);
-            blue += ((pixel_value >> blueShift) & blueMax);
-
-           }
-         }
-         /* We now have a total for all of the colors, find the average! */
-         red /= area2;
-         green /= area2;
-         blue /= area2;
-          /* Stuff the new value back into memory */
-         pixel_value = ((red & redMax) << redShift) | ((green & greenMax) << greenShift) | ((blue & blueMax) << blueShift);
-
-         switch (bytesPerPixel) {
-         case 4: *((unsigned int *)dstptr)   = (unsigned int)   pixel_value; break;
-         case 2: *((unsigned short *)dstptr) = (unsigned short) pixel_value; break;
-         case 1: *((unsigned char *)dstptr)  = (unsigned char)  pixel_value; break;
-         default:
-           /* fixme: endianess problem? */
-           for (z = 0; z < bytesPerPixel; z++)
-             dstptr[z]=(pixel_value >> (8 * z)) & 0xff;
-            break;
-          }
-          dstptr += bytesPerPixel;
-       }
-       srcptr += (screen->paddedWidthInBytes * areaY);
-       dstptr += (ptr->paddedWidthInBytes - bytesPerLine);
-     }
-   } else
-   { /* Not truecolour, so we can't blend. Just use the top-left pixel instead */
-     for (y = y1; y < (y1+h1); y++) {
-       for (x = x1; x < (x1+w1); x++)
-         memcpy (&ptr->frameBuffer[(y *ptr->paddedWidthInBytes) + (x * bytesPerPixel)],
-                 &screen->frameBuffer[(y * areaY * screen->paddedWidthInBytes) + (x *areaX * bytesPerPixel)], bytesPerPixel);
-     }
-  }
-}
-
-void rfbScaledScreenUpdate(rfbScreenInfoPtr screen, int x1, int y1, int x2, int y2)
-{
-    /* ok, now the task is to update each and every scaled version of the framebuffer
-     * and we only have to do this for this specific changed rectangle!
-     */
-    rfbScreenInfoPtr ptr;
-    int count=0;
-
-    /* We don't point to cl->screen as it is the original */
-    for (ptr=screen->scaledScreenNext;ptr!=NULL;ptr=ptr->scaledScreenNext)
-    {
-        /* Only update if it has active clients... */
-        if (ptr->scaledScreenRefCount>0)
-        {
-          rfbScaledScreenUpdateRect(screen, ptr, x1, y1, x2-x1, y2-y1);
-          count++;
-        }
-    }
-}
-
-/* Create a new scaled version of the framebuffer */
-rfbScreenInfoPtr rfbScaledScreenAllocate(rfbClientPtr cl, int width, int height)
-{
-    rfbScreenInfoPtr ptr;
-    ptr = malloc(sizeof(rfbScreenInfo));
-    if (ptr!=NULL)
-    {
-        /* copy *everything* (we don't use most of it, but just in case) */
-        memcpy(ptr, cl->screen, sizeof(rfbScreenInfo));
-        ptr->width = width;
-        ptr->height = height;
-        ptr->paddedWidthInBytes = (ptr->bitsPerPixel/8)*ptr->width;
-
-        /* Need to by multiples of 4 for Sparc systems */
-        ptr->paddedWidthInBytes += (ptr->paddedWidthInBytes % 4);
-
-        /* Reset the reference count to 0! */
-        ptr->scaledScreenRefCount = 0;
-
-        ptr->sizeInBytes = ptr->paddedWidthInBytes * ptr->height;
-        ptr->serverFormat = cl->screen->serverFormat;
-
-        ptr->frameBuffer = malloc(ptr->sizeInBytes);
-        if (ptr->frameBuffer!=NULL)
-        {
-            /* Reset to a known condition: scale the entire framebuffer */
-            rfbScaledScreenUpdateRect(cl->screen, ptr, 0, 0, cl->screen->width, cl->screen->height);
-            /* Now, insert into the chain */
-            LOCK(cl->updateMutex);
-            ptr->scaledScreenNext = cl->screen->scaledScreenNext;
-            cl->screen->scaledScreenNext = ptr;
-            UNLOCK(cl->updateMutex);
-        }
-        else
-        {
-            /* Failed to malloc the new frameBuffer, cleanup */
-            free(ptr);
-            ptr=NULL;
-        }
-    }
-    return ptr;
-}
-
-/* Find an active scaled version of the framebuffer
- * TODO: implement a refcount per scaled screen to prevent
- * unreferenced scaled screens from hanging around
- */
-rfbScreenInfoPtr rfbScalingFind(rfbClientPtr cl, int width, int height)
-{
-    rfbScreenInfoPtr ptr;
-    /* include the original in the search (ie: fine 1:1 scaled version of the frameBuffer) */
-    for (ptr=cl->screen; ptr!=NULL; ptr=ptr->scaledScreenNext)
-    {
-        if ((ptr->width==width) && (ptr->height==height))
-            return ptr;
-    }
-    return NULL;
-}
-
-/* Future needs "scale to 320x240, as that's the client's screen size */
-void rfbScalingSetup(rfbClientPtr cl, int width, int height)
-{
-    rfbScreenInfoPtr ptr;
-
-    ptr = rfbScalingFind(cl,width,height);
-    if (ptr==NULL)
-        ptr = rfbScaledScreenAllocate(cl,width,height);
-    /* Now, there is a new screen available (if ptr is not NULL) */
-    if (ptr!=NULL)
-    {
-        /* Update it! */
-        if (ptr->scaledScreenRefCount<1)
-            rfbScaledScreenUpdateRect(cl->screen, ptr, 0, 0, cl->screen->width, cl->screen->height);
-        /*
-         * rfbLog("Taking one from %dx%d-%d and adding it to %dx%d-%d\n",
-         *    cl->scaledScreen->width, cl->scaledScreen->height,
-         *    cl->scaledScreen->scaledScreenRefCount,
-         *    ptr->width, ptr->height, ptr->scaledScreenRefCount);
-         */
-
-        LOCK(cl->updateMutex);
-        cl->scaledScreen->scaledScreenRefCount--;
-        ptr->scaledScreenRefCount++;
-        cl->scaledScreen=ptr;
-        cl->newFBSizePending = TRUE;
-        UNLOCK(cl->updateMutex);
-
-        rfbLog("Scaling to %dx%d (refcount=%d)\n",width,height,ptr->scaledScreenRefCount);
-    }
-    else
-        rfbLog("Scaling to %dx%d failed, leaving things alone\n",width,height);
-}
-
-int rfbSendNewScaleSize(rfbClientPtr cl)
-{
-    /* if the client supports newFBsize Encoding, use it */
-    if (cl->useNewFBSize && cl->newFBSizePending)
-	return FALSE;
-
-    LOCK(cl->updateMutex);
-    cl->newFBSizePending = FALSE;
-    UNLOCK(cl->updateMutex);
-
-    if (cl->PalmVNC==TRUE)
-    {
-        rfbPalmVNCReSizeFrameBufferMsg pmsg;
-        pmsg.type = rfbPalmVNCReSizeFrameBuffer;
-        pmsg.pad1 = 0;
-        pmsg.desktop_w = Swap16IfLE(cl->screen->width);
-        pmsg.desktop_h = Swap16IfLE(cl->screen->height);
-        pmsg.buffer_w  = Swap16IfLE(cl->scaledScreen->width);
-        pmsg.buffer_h  = Swap16IfLE(cl->scaledScreen->height);
-        pmsg.pad2 = 0;
-
-        rfbLog("Sending a response to a PalmVNC style frameuffer resize event (%dx%d)\n", cl->scaledScreen->width, cl->scaledScreen->height);
-        if (rfbWriteExact(cl, (char *)&pmsg, sz_rfbPalmVNCReSizeFrameBufferMsg) < 0) {
-            rfbLogPerror("rfbNewClient: write");
-            rfbCloseClient(cl);
-            rfbClientConnectionGone(cl);
-            return FALSE;
-        }
-    }
-    else
-    {
-        rfbResizeFrameBufferMsg        rmsg;
-        rmsg.type = rfbResizeFrameBuffer;
-        rmsg.pad1=0;
-        rmsg.framebufferWidth  = Swap16IfLE(cl->scaledScreen->width);
-        rmsg.framebufferHeigth = Swap16IfLE(cl->scaledScreen->height);
-        rfbLog("Sending a response to a UltraVNC style frameuffer resize event (%dx%d)\n", cl->scaledScreen->width, cl->scaledScreen->height);
-        if (rfbWriteExact(cl, (char *)&rmsg, sz_rfbResizeFrameBufferMsg) < 0) {
-            rfbLogPerror("rfbNewClient: write");
-            rfbCloseClient(cl);
-            rfbClientConnectionGone(cl);
-            return FALSE;
-        }
-    }
-    return TRUE;
-}
-/****************************/
diff --git a/ica/x11/libvncserver/scale.h b/ica/x11/libvncserver/scale.h
deleted file mode 100644
index a030d4b..0000000
--- a/ica/x11/libvncserver/scale.h
+++ /dev/null
@@ -1,10 +0,0 @@
-
-int ScaleX(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int x);
-int ScaleY(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int y);
-void rfbScaledCorrection(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int *x, int *y, int *w, int *h, const char *function);
-void rfbScaledScreenUpdateRect(rfbScreenInfoPtr screen, rfbScreenInfoPtr ptr, int x0, int y0, int w0, int h0);
-void rfbScaledScreenUpdate(rfbScreenInfoPtr screen, int x1, int y1, int x2, int y2);
-rfbScreenInfoPtr rfbScaledScreenAllocate(rfbClientPtr cl, int width, int height);
-rfbScreenInfoPtr rfbScalingFind(rfbClientPtr cl, int width, int height);
-void rfbScalingSetup(rfbClientPtr cl, int width, int height);
-int rfbSendNewScaleSize(rfbClientPtr cl);
diff --git a/ica/x11/libvncserver/selbox.c b/ica/x11/libvncserver/selbox.c
deleted file mode 100644
index c065505..0000000
--- a/ica/x11/libvncserver/selbox.c
+++ /dev/null
@@ -1,300 +0,0 @@
-#include <ctype.h>
-#include <rfb/rfb.h>
-#include <rfb/keysym.h>
-
-typedef struct {
-  rfbScreenInfoPtr screen;
-  rfbFontDataPtr font;
-  char** list;
-  int listSize;
-  int selected;
-  int displayStart;
-  int x1,y1,x2,y2,textH,pageH;
-  int xhot,yhot;
-  int buttonWidth,okBX,cancelBX,okX,cancelX,okY;
-  rfbBool okInverted,cancelInverted;
-  int lastButtons;
-  rfbPixel colour,backColour;
-  SelectionChangedHookPtr selChangedHook;
-  enum { SELECTING, OK, CANCEL } state;
-} rfbSelectData;
-
-static const char* okStr="OK";
-static const char* cancelStr="Cancel";
-
-static void selPaintButtons(rfbSelectData* m,rfbBool invertOk,rfbBool invertCancel)
-{
-  rfbScreenInfoPtr s = m->screen;
-  rfbPixel bcolour = m->backColour;
-  rfbPixel colour = m->colour;
-
-  rfbFillRect(s,m->x1,m->okY-m->textH,m->x2,m->okY,bcolour);
-
-  if(invertOk) {
-    rfbFillRect(s,m->okBX,m->okY-m->textH,m->okBX+m->buttonWidth,m->okY,colour);
-    rfbDrawStringWithClip(s,m->font,m->okX+m->xhot,m->okY-1+m->yhot,okStr,
-			  m->x1,m->okY-m->textH,m->x2,m->okY,
-			  bcolour,colour);
-  } else
-    rfbDrawString(s,m->font,m->okX+m->xhot,m->okY-1+m->yhot,okStr,colour);
-    
-  if(invertCancel) {
-    rfbFillRect(s,m->cancelBX,m->okY-m->textH,
-	     m->cancelBX+m->buttonWidth,m->okY,colour);
-    rfbDrawStringWithClip(s,m->font,m->cancelX+m->xhot,m->okY-1+m->yhot,
-			  cancelStr,m->x1,m->okY-m->textH,m->x2,m->okY,
-			  bcolour,colour);
-  } else
-    rfbDrawString(s,m->font,m->cancelX+m->xhot,m->okY-1+m->yhot,cancelStr,colour);
-
-  m->okInverted = invertOk;
-  m->cancelInverted = invertCancel;
-}
-
-/* line is relative to displayStart */
-static void selPaintLine(rfbSelectData* m,int line,rfbBool invert)
-{
-  int y1 = m->y1+line*m->textH, y2 = y1+m->textH;
-  if(y2>m->y2)
-    y2=m->y2;
-  rfbFillRect(m->screen,m->x1,y1,m->x2,y2,invert?m->colour:m->backColour);
-  if(m->displayStart+line<m->listSize)
-    rfbDrawStringWithClip(m->screen,m->font,m->x1+m->xhot,y2-1+m->yhot,
-			  m->list[m->displayStart+line],
-			  m->x1,y1,m->x2,y2,
-			  invert?m->backColour:m->colour,
-			  invert?m->backColour:m->colour);
-}
-
-static void selSelect(rfbSelectData* m,int _index)
-{
-  int delta;
-
-  if(_index==m->selected || _index<0 || _index>=m->listSize)
-    return;
-
-  if(m->selected>=0)
-    selPaintLine(m,m->selected-m->displayStart,FALSE);
-
-  if(_index<m->displayStart || _index>=m->displayStart+m->pageH) {
-    /* targetLine is the screen line in which the selected line will
-       be displayed.
-       targetLine = m->pageH/2 doesn't look so nice */
-    int targetLine = m->selected-m->displayStart;
-    int lineStart,lineEnd;
-
-    /* scroll */
-    if(_index<targetLine)
-      targetLine = _index;
-    else if(_index+m->pageH-targetLine>=m->listSize)
-      targetLine = _index+m->pageH-m->listSize;
-    delta = _index-(m->displayStart+targetLine);
-
-    if(delta>-m->pageH && delta<m->pageH) {
-      if(delta>0) {
-	lineStart = m->pageH-delta;
-	lineEnd = m->pageH;
-	rfbDoCopyRect(m->screen,m->x1,m->y1,m->x2,m->y1+lineStart*m->textH,
-		      0,-delta*m->textH);
-      } else {
-	lineStart = 0;
-	lineEnd = -delta;
-	rfbDoCopyRect(m->screen,
-		      m->x1,m->y1+lineEnd*m->textH,m->x2,m->y2,
-		      0,-delta*m->textH);
-      }
-    } else {
-      lineStart = 0;
-      lineEnd = m->pageH;
-    }
-    m->displayStart += delta;
-    for(delta=lineStart;delta<lineEnd;delta++)
-      if(delta!=_index)
-	selPaintLine(m,delta,FALSE);
-  }
-
-  m->selected = _index;
-  selPaintLine(m,m->selected-m->displayStart,TRUE);
-
-  if(m->selChangedHook)
-    m->selChangedHook(_index);
-
-  /* todo: scrollbars */
-}
-
-static void selKbdAddEvent(rfbBool down,rfbKeySym keySym,rfbClientPtr cl)
-{
-  if(down) {
-    if(keySym>' ' && keySym<0xff) {
-      int i;
-      rfbSelectData* m = (rfbSelectData*)cl->screen->screenData;
-      char c = tolower(keySym);
-
-      for(i=m->selected+1;m->list[i] && tolower(m->list[i][0])!=c;i++);
-      if(!m->list[i])
-	for(i=0;i<m->selected && tolower(m->list[i][0])!=c;i++);
-      selSelect(m,i);
-    } else if(keySym==XK_Escape) {
-      rfbSelectData* m = (rfbSelectData*)cl->screen->screenData;
-      m->state = CANCEL;
-    } else if(keySym==XK_Return) {
-      rfbSelectData* m = (rfbSelectData*)cl->screen->screenData;
-      m->state = OK;
-    } else {
-      rfbSelectData* m = (rfbSelectData*)cl->screen->screenData;
-      int curSel=m->selected;
-      if(keySym==XK_Up) {
-	if(curSel>0)
-	  selSelect(m,curSel-1);
-      } else if(keySym==XK_Down) {
-	if(curSel+1<m->listSize)
-	  selSelect(m,curSel+1);
-      } else {
-	if(keySym==XK_Page_Down) {
-	  if(curSel+m->pageH<m->listSize)
-	    selSelect(m,curSel+m->pageH);
-	  else
-	    selSelect(m,m->listSize-1);
-	} else if(keySym==XK_Page_Up) {
-	  if(curSel-m->pageH>=0)
-	    selSelect(m,curSel-m->pageH);
-	  else
-	    selSelect(m,0);
-	}
-      }
-    }
-  }
-}
-
-static void selPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl)
-{
-  rfbSelectData* m = (rfbSelectData*)cl->screen->screenData;
-  if(y<m->okY && y>=m->okY-m->textH) {
-    if(x>=m->okBX && x<m->okBX+m->buttonWidth) {
-      if(!m->okInverted)
-	selPaintButtons(m,TRUE,FALSE);
-      if(buttonMask)
-	m->state = OK;
-    } else if(x>=m->cancelBX && x<m->cancelBX+m->buttonWidth) {
-      if(!m->cancelInverted)
-	selPaintButtons(m,FALSE,TRUE);
-      if(buttonMask)
-	m->state = CANCEL;
-    } else if(m->okInverted || m->cancelInverted)
-      selPaintButtons(m,FALSE,FALSE);
-  } else {
-    if(m->okInverted || m->cancelInverted)
-      selPaintButtons(m,FALSE,FALSE);
-    if(!m->lastButtons && buttonMask) {
-      if(x>=m->x1 && x<m->x2 && y>=m->y1 && y<m->y2)
-	selSelect(m,m->displayStart+(y-m->y1)/m->textH);
-    }
-  }
-  m->lastButtons = buttonMask;
-
-  /* todo: scrollbars */
-}
-
-static rfbCursorPtr selGetCursorPtr(rfbClientPtr cl)
-{
-  return NULL;
-}
-
-int rfbSelectBox(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
-		 char** list,
-		 int x1,int y1,int x2,int y2,
-		 rfbPixel colour,rfbPixel backColour,
-		 int border,SelectionChangedHookPtr selChangedHook)
-{
-   int bpp = rfbScreen->bitsPerPixel/8;
-   char* frameBufferBackup;
-   void* screenDataBackup = rfbScreen->screenData;
-   rfbKbdAddEventProcPtr kbdAddEventBackup = rfbScreen->kbdAddEvent;
-   rfbPtrAddEventProcPtr ptrAddEventBackup = rfbScreen->ptrAddEvent;
-   rfbGetCursorProcPtr getCursorPtrBackup = rfbScreen->getCursorPtr;
-   rfbDisplayHookPtr displayHookBackup = rfbScreen->displayHook;
-   rfbSelectData selData;
-   int i,j,k;
-   int fx1,fy1,fx2,fy2; /* for font bbox */
-
-   if(list==0 || *list==0)
-     return(-1);
-   
-   rfbWholeFontBBox(font, &fx1, &fy1, &fx2, &fy2);
-   selData.textH = fy2-fy1;
-   /* I need at least one line for the choice and one for the buttons */
-   if(y2-y1<selData.textH*2+3*border)
-     return(-1);
-   selData.xhot = -fx1;
-   selData.yhot = -fy2;
-   selData.x1 = x1+border;
-   selData.y1 = y1+border;
-   selData.y2 = y2-selData.textH-3*border;
-   selData.x2 = x2-2*border;
-   selData.pageH = (selData.y2-selData.y1)/selData.textH;
-
-   i = rfbWidthOfString(font,okStr);
-   j = rfbWidthOfString(font,cancelStr);
-   selData.buttonWidth= k = 4*border+((i<j)?j:i);
-   selData.okBX = x1+(x2-x1-2*k)/3;
-   if(selData.okBX<x1+border) /* too narrow! */
-     return(-1);
-   selData.cancelBX = x1+k+(x2-x1-2*k)*2/3;
-   selData.okX = selData.okBX+(k-i)/2;
-   selData.cancelX = selData.cancelBX+(k-j)/2;
-   selData.okY = y2-border;
-
-   frameBufferBackup = (char*)malloc(bpp*(x2-x1)*(y2-y1));
-
-   selData.state = SELECTING;
-   selData.screen = rfbScreen;
-   selData.font = font;
-   selData.list = list;
-   selData.colour = colour;
-   selData.backColour = backColour;
-   for(i=0;list[i];i++);
-   selData.selected = i;
-   selData.listSize = i;
-   selData.displayStart = i;
-   selData.lastButtons = 0;
-   selData.selChangedHook = selChangedHook;
-   
-   rfbScreen->screenData = &selData;
-   rfbScreen->kbdAddEvent = selKbdAddEvent;
-   rfbScreen->ptrAddEvent = selPtrAddEvent;
-   rfbScreen->getCursorPtr = selGetCursorPtr;
-   rfbScreen->displayHook = NULL;
-   
-   /* backup screen */
-   for(j=0;j<y2-y1;j++)
-     memcpy(frameBufferBackup+j*(x2-x1)*bpp,
-	    rfbScreen->frameBuffer+j*rfbScreen->paddedWidthInBytes+x1*bpp,
-	    (x2-x1)*bpp);
-
-   /* paint list and buttons */
-   rfbFillRect(rfbScreen,x1,y1,x2,y2,colour);
-   selPaintButtons(&selData,FALSE,FALSE);
-   selSelect(&selData,0);
-
-   /* modal loop */
-   while(selData.state == SELECTING)
-     rfbProcessEvents(rfbScreen,20000);
-
-   /* copy back screen data */
-   for(j=0;j<y2-y1;j++)
-     memcpy(rfbScreen->frameBuffer+j*rfbScreen->paddedWidthInBytes+x1*bpp,
-	    frameBufferBackup+j*(x2-x1)*bpp,
-	    (x2-x1)*bpp);
-   free(frameBufferBackup);
-   rfbMarkRectAsModified(rfbScreen,x1,y1,x2,y2);
-   rfbScreen->screenData = screenDataBackup;
-   rfbScreen->kbdAddEvent = kbdAddEventBackup;
-   rfbScreen->ptrAddEvent = ptrAddEventBackup;
-   rfbScreen->getCursorPtr = getCursorPtrBackup;
-   rfbScreen->displayHook = displayHookBackup;
-
-   if(selData.state==CANCEL)
-     selData.selected=-1;
-   return(selData.selected);
-}
-
diff --git a/ica/x11/libvncserver/sockets.c b/ica/x11/libvncserver/sockets.c
deleted file mode 100644
index 4acdd72..0000000
--- a/ica/x11/libvncserver/sockets.c
+++ /dev/null
@@ -1,1071 +0,0 @@
-/*
- * sockets.c - deal with TCP & UDP sockets.
- *
- * This code should be independent of any changes in the RFB protocol.  It just
- * deals with the X server scheduling stuff, calling rfbNewClientConnection and
- * rfbProcessClientMessage to actually deal with the protocol.  If a socket
- * needs to be closed for any reason then rfbCloseClient should be called, and
- * this in turn will call rfbClientConnectionGone.  To make an active
- * connection out, call rfbConnect - note that this does _not_ call
- * rfbNewClientConnection.
- *
- * This file is divided into two types of function.  Those beginning with
- * "rfb" are specific to sockets using the RFB protocol.  Those without the
- * "rfb" prefix are more general socket routines (which are used by the http
- * code).
- *
- * Thanks to Karl Hakimian for pointing out that some platforms return EAGAIN
- * not EWOULDBLOCK.
- */
-
-/*
- *  Copyright (C) 2011-2012 Christian Beier <dontmind at freeshell.org>
- *  Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#ifdef __linux__
-/* Setting this on other systems hides definitions such as INADDR_LOOPBACK.
- * The check should be for __GLIBC__ in fact. */
-# define _POSIX_SOURCE
-#endif
-#endif
-
-#include <rfb/rfb.h>
-
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-#include "rfbssl.h"
-#endif
-
-#if defined(__linux__) && defined(NEED_TIMEVAL)
-struct timeval 
-{
-   long int tv_sec,tv_usec;
-}
-;
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#include <errno.h>
-
-#ifdef USE_LIBWRAP
-#include <syslog.h>
-#include <tcpd.h>
-int allow_severity=LOG_INFO;
-int deny_severity=LOG_WARNING;
-#endif
-
-#if defined(WIN32)
-#ifndef __MINGW32__
-#pragma warning (disable: 4018 4761)
-#endif
-#define read(sock,buf,len) recv(sock,buf,len,0)
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#endif
-#ifndef ETIMEDOUT
-#define ETIMEDOUT WSAETIMEDOUT
-#endif
-#define write(sock,buf,len) send(sock,buf,len,0)
-#else
-#define closesocket close
-#endif
-
-int rfbMaxClientWait = 20000;   /* time (ms) after which we decide client has
-                                   gone away - needed to stop us hanging */
-
-/*
- * rfbInitSockets sets up the TCP and UDP sockets to listen for RFB
- * connections.  It does nothing if called again.
- */
-
-void
-rfbInitSockets(rfbScreenInfoPtr rfbScreen)
-{
-    in_addr_t iface = rfbScreen->listenInterface;
-
-    if (rfbScreen->socketState!=RFB_SOCKET_INIT)
-	return;
-
-    rfbScreen->socketState = RFB_SOCKET_READY;
-
-    if (rfbScreen->inetdSock != -1) {
-	const int one = 1;
-
-        if(!rfbSetNonBlocking(rfbScreen->inetdSock))
-	    return;
-
-	if (setsockopt(rfbScreen->inetdSock, IPPROTO_TCP, TCP_NODELAY,
-		       (char *)&one, sizeof(one)) < 0) {
-	    rfbLogPerror("setsockopt");
-	    return;
-	}
-
-    	FD_ZERO(&(rfbScreen->allFds));
-    	FD_SET(rfbScreen->inetdSock, &(rfbScreen->allFds));
-    	rfbScreen->maxFd = rfbScreen->inetdSock;
-	return;
-    }
-
-    if(rfbScreen->autoPort) {
-        int i;
-        FD_ZERO(&(rfbScreen->allFds));
-
-        rfbLog("Autoprobing TCP port \n");
-        for (i = 5900; i < 6000; i++) {
-            if ((rfbScreen->listenSock = rfbListenOnTCPPort(i, iface)) >= 0) {
-		rfbScreen->port = i;
-		break;
-	    }
-        }
-
-        if (i >= 6000) {
-	    rfbLogPerror("Failure autoprobing");
-	    return;
-        }
-
-        rfbLog("Autoprobing selected TCP port %d\n", rfbScreen->port);
-        FD_SET(rfbScreen->listenSock, &(rfbScreen->allFds));
-        rfbScreen->maxFd = rfbScreen->listenSock;
-
-#ifdef LIBVNCSERVER_IPv6
-        rfbLog("Autoprobing TCP6 port \n");
-	for (i = 5900; i < 6000; i++) {
-            if ((rfbScreen->listen6Sock = rfbListenOnTCP6Port(i, rfbScreen->listen6Interface)) >= 0) {
-		rfbScreen->ipv6port = i;
-		break;
-	    }
-        }
-
-        if (i >= 6000) {
-	    rfbLogPerror("Failure autoprobing");
-	    return;
-        }
-
-        rfbLog("Autoprobing selected TCP6 port %d\n", rfbScreen->ipv6port);
-	FD_SET(rfbScreen->listen6Sock, &(rfbScreen->allFds));
-	rfbScreen->maxFd = max((int)rfbScreen->listen6Sock,rfbScreen->maxFd);
-#endif
-    }
-    else
-    {
-	    if(rfbScreen->port>0) {
-      FD_ZERO(&(rfbScreen->allFds));
-
-      if ((rfbScreen->listenSock = rfbListenOnTCPPort(rfbScreen->port, iface)) < 0) {
-	rfbLogPerror("ListenOnTCPPort");
-	return;
-      }
-      rfbLog("Listening for VNC connections on TCP port %d\n", rfbScreen->port);  
-  
-      FD_SET(rfbScreen->listenSock, &(rfbScreen->allFds));
-      rfbScreen->maxFd = rfbScreen->listenSock;
-	    }
-
-#ifdef LIBVNCSERVER_IPv6
-	    if (rfbScreen->ipv6port>0) {
-      if ((rfbScreen->listen6Sock = rfbListenOnTCP6Port(rfbScreen->ipv6port, rfbScreen->listen6Interface)) < 0) {
-	/* ListenOnTCP6Port has its own detailed error printout */
-	return;
-      }
-      rfbLog("Listening for VNC connections on TCP6 port %d\n", rfbScreen->ipv6port);  
-	
-      FD_SET(rfbScreen->listen6Sock, &(rfbScreen->allFds));
-      rfbScreen->maxFd = max((int)rfbScreen->listen6Sock,rfbScreen->maxFd);
-	    }
-#endif
-
-    }
-
-    if (rfbScreen->udpPort != 0) {
-	rfbLog("rfbInitSockets: listening for input on UDP port %d\n",rfbScreen->udpPort);
-
-	if ((rfbScreen->udpSock = rfbListenOnUDPPort(rfbScreen->udpPort, iface)) < 0) {
-	    rfbLogPerror("ListenOnUDPPort");
-	    return;
-	}
-	rfbLog("Listening for VNC connections on TCP port %d\n", rfbScreen->port);  
-
-	FD_SET(rfbScreen->udpSock, &(rfbScreen->allFds));
-	rfbScreen->maxFd = max((int)rfbScreen->udpSock,rfbScreen->maxFd);
-    }
-}
-
-void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen)
-{
-    if (rfbScreen->socketState!=RFB_SOCKET_READY)
-	return;
-
-    rfbScreen->socketState = RFB_SOCKET_SHUTDOWN;
-
-    if(rfbScreen->inetdSock>-1) {
-	closesocket(rfbScreen->inetdSock);
-	FD_CLR(rfbScreen->inetdSock,&rfbScreen->allFds);
-	rfbScreen->inetdSock=-1;
-    }
-
-    if(rfbScreen->listenSock>-1) {
-	closesocket(rfbScreen->listenSock);
-	FD_CLR(rfbScreen->listenSock,&rfbScreen->allFds);
-	rfbScreen->listenSock=-1;
-    }
-
-    if(rfbScreen->listen6Sock>-1) {
-	closesocket(rfbScreen->listen6Sock);
-	FD_CLR(rfbScreen->listen6Sock,&rfbScreen->allFds);
-	rfbScreen->listen6Sock=-1;
-    }
-
-    if(rfbScreen->udpSock>-1) {
-	closesocket(rfbScreen->udpSock);
-	FD_CLR(rfbScreen->udpSock,&rfbScreen->allFds);
-	rfbScreen->udpSock=-1;
-    }
-}
-
-/*
- * rfbCheckFds is called from ProcessInputEvents to check for input on the RFB
- * socket(s).  If there is input to process, the appropriate function in the
- * RFB server code will be called (rfbNewClientConnection,
- * rfbProcessClientMessage, etc).
- */
-
-int
-rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
-{
-    int nfds;
-    fd_set fds;
-    struct timeval tv;
-    struct sockaddr_in addr;
-    socklen_t addrlen = sizeof(addr);
-    char buf[6];
-    rfbClientIteratorPtr i;
-    rfbClientPtr cl;
-    int result = 0;
-
-    if (!rfbScreen->inetdInitDone && rfbScreen->inetdSock != -1) {
-	rfbNewClientConnection(rfbScreen,rfbScreen->inetdSock); 
-	rfbScreen->inetdInitDone = TRUE;
-    }
-
-    do {
-	memcpy((char *)&fds, (char *)&(rfbScreen->allFds), sizeof(fd_set));
-	tv.tv_sec = 0;
-	tv.tv_usec = usec;
-	nfds = select(rfbScreen->maxFd + 1, &fds, NULL, NULL /* &fds */, &tv);
-	if (nfds == 0) {
-	    /* timed out, check for async events */
-            i = rfbGetClientIterator(rfbScreen);
-            while((cl = rfbClientIteratorNext(i))) {
-                if (cl->onHold)
-                    continue;
-                if (FD_ISSET(cl->sock, &(rfbScreen->allFds)))
-                    rfbSendFileTransferChunk(cl);
-            }
-            rfbReleaseClientIterator(i);
-	    return result;
-	}
-
-	if (nfds < 0) {
-#ifdef WIN32
-	    errno = WSAGetLastError();
-#endif
-	    if (errno != EINTR)
-		rfbLogPerror("rfbCheckFds: select");
-	    return -1;
-	}
-
-	result += nfds;
-
-	if (rfbScreen->listenSock != -1 && FD_ISSET(rfbScreen->listenSock, &fds)) {
-
-	    if (!rfbProcessNewConnection(rfbScreen))
-                return -1;
-
-	    FD_CLR(rfbScreen->listenSock, &fds);
-	    if (--nfds == 0)
-		return result;
-	}
-
-	if (rfbScreen->listen6Sock != -1 && FD_ISSET(rfbScreen->listen6Sock, &fds)) {
-
-	    if (!rfbProcessNewConnection(rfbScreen))
-                return -1;
-
-	    FD_CLR(rfbScreen->listen6Sock, &fds);
-	    if (--nfds == 0)
-		return result;
-	}
-
-	if ((rfbScreen->udpSock != -1) && FD_ISSET(rfbScreen->udpSock, &fds)) {
-	    if(!rfbScreen->udpClient)
-		rfbNewUDPClient(rfbScreen);
-	    if (recvfrom(rfbScreen->udpSock, buf, 1, MSG_PEEK,
-			(struct sockaddr *)&addr, &addrlen) < 0) {
-		rfbLogPerror("rfbCheckFds: UDP: recvfrom");
-		rfbDisconnectUDPSock(rfbScreen);
-		rfbScreen->udpSockConnected = FALSE;
-	    } else {
-		if (!rfbScreen->udpSockConnected ||
-			(memcmp(&addr, &rfbScreen->udpRemoteAddr, addrlen) != 0))
-		{
-		    /* new remote end */
-		    rfbLog("rfbCheckFds: UDP: got connection\n");
-
-		    memcpy(&rfbScreen->udpRemoteAddr, &addr, addrlen);
-		    rfbScreen->udpSockConnected = TRUE;
-
-		    if (connect(rfbScreen->udpSock,
-				(struct sockaddr *)&addr, addrlen) < 0) {
-			rfbLogPerror("rfbCheckFds: UDP: connect");
-			rfbDisconnectUDPSock(rfbScreen);
-			return -1;
-		    }
-
-		    rfbNewUDPConnection(rfbScreen,rfbScreen->udpSock);
-		}
-
-		rfbProcessUDPInput(rfbScreen);
-	    }
-
-	    FD_CLR(rfbScreen->udpSock, &fds);
-	    if (--nfds == 0)
-		return result;
-	}
-
-	i = rfbGetClientIterator(rfbScreen);
-	while((cl = rfbClientIteratorNext(i))) {
-
-	    if (cl->onHold)
-		continue;
-
-            if (FD_ISSET(cl->sock, &(rfbScreen->allFds)))
-            {
-                if (FD_ISSET(cl->sock, &fds))
-                    rfbProcessClientMessage(cl);
-                else
-                    rfbSendFileTransferChunk(cl);
-            }
-	}
-	rfbReleaseClientIterator(i);
-    } while(rfbScreen->handleEventsEagerly);
-    return result;
-}
-
-rfbBool
-rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
-{
-    const int one = 1;
-    int sock = -1;
-#ifdef LIBVNCSERVER_IPv6
-    struct sockaddr_storage addr;
-#else
-    struct sockaddr_in addr;
-#endif
-    socklen_t addrlen = sizeof(addr);
-    fd_set listen_fds; 
-    int chosen_listen_sock = -1;
-
-    /* Do another select() call to find out which listen socket
-       has an incoming connection pending. We know that at least 
-       one of them has, so this should not block for too long! */
-    FD_ZERO(&listen_fds);  
-    if(rfbScreen->listenSock >= 0) 
-      FD_SET(rfbScreen->listenSock, &listen_fds);
-    if(rfbScreen->listen6Sock >= 0) 
-      FD_SET(rfbScreen->listen6Sock, &listen_fds);
-    if (select(rfbScreen->maxFd+1, &listen_fds, NULL, NULL, NULL) == -1) {
-      rfbLogPerror("rfbProcessNewConnection: error in select");
-      return FALSE;
-    }
-    if (rfbScreen->listenSock >= 0 && FD_ISSET(rfbScreen->listenSock, &listen_fds))
-      chosen_listen_sock = rfbScreen->listenSock;
-    if (rfbScreen->listen6Sock >= 0 && FD_ISSET(rfbScreen->listen6Sock, &listen_fds))
-      chosen_listen_sock = rfbScreen->listen6Sock;
-
-    if ((sock = accept(chosen_listen_sock,
-		       (struct sockaddr *)&addr, &addrlen)) < 0) {
-      rfbLogPerror("rfbCheckFds: accept");
-      return FALSE;
-    }
-
-    if(!rfbSetNonBlocking(sock)) {
-      closesocket(sock);
-      return FALSE;
-    }
-
-    if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-		   (char *)&one, sizeof(one)) < 0) {
-      rfbLogPerror("rfbCheckFds: setsockopt");
-      closesocket(sock);
-      return FALSE;
-    }
-
-#ifdef USE_LIBWRAP
-    if(!hosts_ctl("vnc",STRING_UNKNOWN,inet_ntoa(addr.sin_addr),
-		  STRING_UNKNOWN)) {
-      rfbLog("Rejected connection from client %s\n",
-	     inet_ntoa(addr.sin_addr));
-      closesocket(sock);
-      return FALSE;
-    }
-#endif
-
-#ifdef LIBVNCSERVER_IPv6
-    char host[1024];
-    if(getnameinfo((struct sockaddr*)&addr, addrlen, host, sizeof(host), NULL, 0, NI_NUMERICHOST) != 0) {
-      rfbLogPerror("rfbProcessNewConnection: error in getnameinfo");
-    }
-    rfbLog("Got connection from client %s\n", host);
-#else
-    rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr));
-#endif
-
-    rfbNewClient(rfbScreen,sock);
-
-    return TRUE;
-}
-
-
-void
-rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen)
-{
-  rfbScreen->udpSockConnected = FALSE;
-}
-
-
-
-void
-rfbCloseClient(rfbClientPtr cl)
-{
-    rfbExtensionData* extension;
-
-    for(extension=cl->extensions; extension; extension=extension->next)
-	if(extension->extension->close)
-	    extension->extension->close(cl, extension->data);
-
-    LOCK(cl->updateMutex);
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-    if (cl->sock != -1)
-#endif
-      {
-	FD_CLR(cl->sock,&(cl->screen->allFds));
-	if(cl->sock==cl->screen->maxFd)
-	  while(cl->screen->maxFd>0
-		&& !FD_ISSET(cl->screen->maxFd,&(cl->screen->allFds)))
-	    cl->screen->maxFd--;
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-	if (cl->sslctx)
-	    rfbssl_destroy(cl);
-	free(cl->wspath);
-#endif
-#ifndef __MINGW32__
-	shutdown(cl->sock,SHUT_RDWR);
-#endif
-	closesocket(cl->sock);
-	cl->sock = -1;
-      }
-    TSIGNAL(cl->updateCond);
-    UNLOCK(cl->updateMutex);
-}
-
-
-/*
- * rfbConnect is called to make a connection out to a given TCP address.
- */
-
-int
-rfbConnect(rfbScreenInfoPtr rfbScreen,
-           char *host,
-           int port)
-{
-    int sock;
-    int one = 1;
-
-    rfbLog("Making connection to client on host %s port %d\n",
-	   host,port);
-
-    if ((sock = rfbConnectToTcpAddr(host, port)) < 0) {
-	rfbLogPerror("connection failed");
-	return -1;
-    }
-
-    if(!rfbSetNonBlocking(sock)) {
-        closesocket(sock);
-	return -1;
-    }
-
-    if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-		   (char *)&one, sizeof(one)) < 0) {
-	rfbLogPerror("setsockopt failed");
-	closesocket(sock);
-	return -1;
-    }
-
-    /* AddEnabledDevice(sock); */
-    FD_SET(sock, &rfbScreen->allFds);
-    rfbScreen->maxFd = max(sock,rfbScreen->maxFd);
-
-    return sock;
-}
-
-/*
- * ReadExact reads an exact number of bytes from a client.  Returns 1 if
- * those bytes have been read, 0 if the other end has closed, or -1 if an error
- * occurred (errno is set to ETIMEDOUT if it timed out).
- */
-
-int
-rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout)
-{
-    int sock = cl->sock;
-    int n;
-    fd_set fds;
-    struct timeval tv;
-
-    while (len > 0) {
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-        if (cl->wsctx) {
-            n = webSocketsDecode(cl, buf, len);
-        } else if (cl->sslctx) {
-	    n = rfbssl_read(cl, buf, len);
-	} else {
-            n = read(sock, buf, len);
-        }
-#else
-        n = read(sock, buf, len);
-#endif
-
-        if (n > 0) {
-
-            buf += n;
-            len -= n;
-
-        } else if (n == 0) {
-
-            return 0;
-
-        } else {
-#ifdef WIN32
-	    errno = WSAGetLastError();
-#endif
-	    if (errno == EINTR)
-		continue;
-
-#ifdef LIBVNCSERVER_ENOENT_WORKAROUND
-	    if (errno != ENOENT)
-#endif
-            if (errno != EWOULDBLOCK && errno != EAGAIN) {
-                return n;
-            }
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-	    if (cl->sslctx) {
-		if (rfbssl_pending(cl))
-		    continue;
-	    }
-#endif
-            FD_ZERO(&fds);
-            FD_SET(sock, &fds);
-            tv.tv_sec = timeout / 1000;
-            tv.tv_usec = (timeout % 1000) * 1000;
-            n = select(sock+1, &fds, NULL, &fds, &tv);
-            if (n < 0) {
-                rfbLogPerror("ReadExact: select");
-                return n;
-            }
-            if (n == 0) {
-                rfbErr("ReadExact: select timeout\n");
-                errno = ETIMEDOUT;
-                return -1;
-            }
-        }
-    }
-#undef DEBUG_READ_EXACT
-#ifdef DEBUG_READ_EXACT
-    rfbLog("ReadExact %d bytes\n",len);
-    for(n=0;n<len;n++)
-	    fprintf(stderr,"%02x ",(unsigned char)buf[n]);
-    fprintf(stderr,"\n");
-#endif
-
-    return 1;
-}
-
-int rfbReadExact(rfbClientPtr cl,char* buf,int len)
-{
-  /* favor the per-screen value if set */
-  if(cl->screen && cl->screen->maxClientWait)
-    return(rfbReadExactTimeout(cl,buf,len,cl->screen->maxClientWait));
-  else
-    return(rfbReadExactTimeout(cl,buf,len,rfbMaxClientWait));
-}
-
-/*
- * PeekExact peeks at an exact number of bytes from a client.  Returns 1 if
- * those bytes have been read, 0 if the other end has closed, or -1 if an
- * error occurred (errno is set to ETIMEDOUT if it timed out).
- */
-
-int
-rfbPeekExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout)
-{
-    int sock = cl->sock;
-    int n;
-    fd_set fds;
-    struct timeval tv;
-
-    while (len > 0) {
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-	if (cl->sslctx)
-	    n = rfbssl_peek(cl, buf, len);
-	else
-#endif
-	    n = recv(sock, buf, len, MSG_PEEK);
-
-        if (n == len) {
-
-            break;
-
-        } else if (n == 0) {
-
-            return 0;
-
-        } else {
-#ifdef WIN32
-	    errno = WSAGetLastError();
-#endif
-	    if (errno == EINTR)
-		continue;
-
-#ifdef LIBVNCSERVER_ENOENT_WORKAROUND
-	    if (errno != ENOENT)
-#endif
-            if (errno != EWOULDBLOCK && errno != EAGAIN) {
-                return n;
-            }
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-	    if (cl->sslctx) {
-		if (rfbssl_pending(cl))
-		    continue;
-	    }
-#endif
-            FD_ZERO(&fds);
-            FD_SET(sock, &fds);
-            tv.tv_sec = timeout / 1000;
-            tv.tv_usec = (timeout % 1000) * 1000;
-            n = select(sock+1, &fds, NULL, &fds, &tv);
-            if (n < 0) {
-                rfbLogPerror("PeekExact: select");
-                return n;
-            }
-            if (n == 0) {
-                errno = ETIMEDOUT;
-                return -1;
-            }
-        }
-    }
-#undef DEBUG_READ_EXACT
-#ifdef DEBUG_READ_EXACT
-    rfbLog("PeekExact %d bytes\n",len);
-    for(n=0;n<len;n++)
-	    fprintf(stderr,"%02x ",(unsigned char)buf[n]);
-    fprintf(stderr,"\n");
-#endif
-
-    return 1;
-}
-
-/*
- * WriteExact writes an exact number of bytes to a client.  Returns 1 if
- * those bytes have been written, or -1 if an error occurred (errno is set to
- * ETIMEDOUT if it timed out).
- */
-
-int
-rfbWriteExact(rfbClientPtr cl,
-              const char *buf,
-              int len)
-{
-    int sock = cl->sock;
-    int n;
-    fd_set fds;
-    struct timeval tv;
-    int totalTimeWaited = 0;
-    const int timeout = (cl->screen && cl->screen->maxClientWait) ? cl->screen->maxClientWait : rfbMaxClientWait;
-
-#undef DEBUG_WRITE_EXACT
-#ifdef DEBUG_WRITE_EXACT
-    rfbLog("WriteExact %d bytes\n",len);
-    for(n=0;n<len;n++)
-	    fprintf(stderr,"%02x ",(unsigned char)buf[n]);
-    fprintf(stderr,"\n");
-#endif
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-    if (cl->wsctx) {
-        char *tmp = NULL;
-        if ((len = webSocketsEncode(cl, buf, len, &tmp)) < 0) {
-            rfbErr("WriteExact: WebSockets encode error\n");
-            return -1;
-        }
-        buf = tmp;
-    }
-#endif
-
-    LOCK(cl->outputMutex);
-    while (len > 0) {
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-        if (cl->sslctx)
-	    n = rfbssl_write(cl, buf, len);
-	else
-#endif
-	    n = write(sock, buf, len);
-
-        if (n > 0) {
-
-            buf += n;
-            len -= n;
-
-        } else if (n == 0) {
-
-            rfbErr("WriteExact: write returned 0?\n");
-            return 0;
-
-        } else {
-#ifdef WIN32
-			errno = WSAGetLastError();
-#endif
-	    if (errno == EINTR)
-		continue;
-
-            if (errno != EWOULDBLOCK && errno != EAGAIN) {
-	        UNLOCK(cl->outputMutex);
-                return n;
-            }
-
-            /* Retry every 5 seconds until we exceed timeout.  We
-               need to do this because select doesn't necessarily return
-               immediately when the other end has gone away */
-
-            FD_ZERO(&fds);
-            FD_SET(sock, &fds);
-            tv.tv_sec = 5;
-            tv.tv_usec = 0;
-            n = select(sock+1, NULL, &fds, NULL /* &fds */, &tv);
-	    if (n < 0) {
-#ifdef WIN32
-                errno=WSAGetLastError();
-#endif
-       	        if(errno==EINTR)
-		    continue;
-                rfbLogPerror("WriteExact: select");
-                UNLOCK(cl->outputMutex);
-                return n;
-            }
-            if (n == 0) {
-                totalTimeWaited += 5000;
-                if (totalTimeWaited >= timeout) {
-                    errno = ETIMEDOUT;
-                    UNLOCK(cl->outputMutex);
-                    return -1;
-                }
-            } else {
-                totalTimeWaited = 0;
-            }
-        }
-    }
-    UNLOCK(cl->outputMutex);
-    return 1;
-}
-
-/* currently private, called by rfbProcessArguments() */
-int
-rfbStringToAddr(char *str, in_addr_t *addr)  {
-    if (str == NULL || *str == '\0' || strcmp(str, "any") == 0) {
-        *addr = htonl(INADDR_ANY);
-    } else if (strcmp(str, "localhost") == 0) {
-        *addr = htonl(INADDR_LOOPBACK);
-    } else {
-        struct hostent *hp;
-        if ((*addr = inet_addr(str)) == htonl(INADDR_NONE)) {
-            if (!(hp = gethostbyname(str))) {
-                return 0;
-            }
-            *addr = *(unsigned long *)hp->h_addr;
-        }
-    }
-    return 1;
-}
-
-int
-rfbListenOnTCPPort(int port,
-                   in_addr_t iface)
-{
-    struct sockaddr_in addr;
-    int sock;
-    int one = 1;
-
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(port);
-    addr.sin_addr.s_addr = iface;
-
-    if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
-	return -1;
-    }
-    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		   (char *)&one, sizeof(one)) < 0) {
-	closesocket(sock);
-	return -1;
-    }
-    if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-	closesocket(sock);
-	return -1;
-    }
-    if (listen(sock, 32) < 0) {
-	closesocket(sock);
-	return -1;
-    }
-
-    return sock;
-}
-
-
-int
-rfbListenOnTCP6Port(int port,
-                    const char* iface)
-{
-#ifndef LIBVNCSERVER_IPv6
-    rfbLogPerror("This LibVNCServer does not have IPv6 support");
-    return -1;
-#else
-    int sock;
-    int one = 1;
-    int rv;
-    struct addrinfo hints, *servinfo, *p;
-    char port_str[8];
-
-    snprintf(port_str, 8, "%d", port);
-
-    memset(&hints, 0, sizeof(hints));
-    hints.ai_family = AF_INET6;
-    hints.ai_socktype = SOCK_STREAM;
-    hints.ai_flags = AI_PASSIVE; /* fill in wildcard address if iface == NULL */
-
-    if ((rv = getaddrinfo(iface, port_str, &hints, &servinfo)) != 0) {
-        rfbErr("rfbListenOnTCP6Port error in getaddrinfo: %s\n", gai_strerror(rv));
-        return -1;
-    }
-    
-    /* loop through all the results and bind to the first we can */
-    for(p = servinfo; p != NULL; p = p->ai_next) {
-        if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) < 0) {
-            continue;
-        }
-
-#ifdef IPV6_V6ONLY
-	/* we have seperate IPv4 and IPv6 sockets since some OS's do not support dual binding */
-	if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&one, sizeof(one)) < 0) {
-	  rfbLogPerror("rfbListenOnTCP6Port error in setsockopt IPV6_V6ONLY");
-	  closesocket(sock);
-	  freeaddrinfo(servinfo);
-	  return -1;
-	}
-#endif
-
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)) < 0) {
-	  rfbLogPerror("rfbListenOnTCP6Port: error in setsockopt SO_REUSEADDR");
-	  closesocket(sock);
-	  freeaddrinfo(servinfo);
-	  return -1;
-	}
-
-	if (bind(sock, p->ai_addr, p->ai_addrlen) < 0) {
-	  closesocket(sock);
-	  continue;
-	}
-
-        break;
-    }
-
-    if (p == NULL)  {
-        rfbLogPerror("rfbListenOnTCP6Port: error in bind IPv6 socket");
-        freeaddrinfo(servinfo);
-        return -1;
-    }
-
-    /* all done with this structure now */
-    freeaddrinfo(servinfo);
-
-    if (listen(sock, 32) < 0) {
-        rfbLogPerror("rfbListenOnTCP6Port: error in listen on IPv6 socket");
-	closesocket(sock);
-	return -1;
-    }
-
-    return sock;
-#endif
-}
-
-
-int
-rfbConnectToTcpAddr(char *host,
-                    int port)
-{
-    int sock;
-#ifdef LIBVNCSERVER_IPv6
-    struct addrinfo hints, *servinfo, *p;
-    int rv;
-    char port_str[8];
-
-    snprintf(port_str, 8, "%d", port);
-
-    memset(&hints, 0, sizeof hints);
-    hints.ai_family = AF_UNSPEC;
-    hints.ai_socktype = SOCK_STREAM;
-
-    if ((rv = getaddrinfo(host, port_str, &hints, &servinfo)) != 0) {
-        rfbErr("rfbConnectToTcpAddr: error in getaddrinfo: %s\n", gai_strerror(rv));
-        return -1;
-    }
-
-    /* loop through all the results and connect to the first we can */
-    for(p = servinfo; p != NULL; p = p->ai_next) {
-        if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) < 0)
-            continue;
-
-        if (connect(sock, p->ai_addr, p->ai_addrlen) < 0) {
-            closesocket(sock);
-            continue;
-        }
-
-        break;
-    }
-
-    /* all failed */
-    if (p == NULL) {
-        rfbLogPerror("rfbConnectToTcoAddr: failed to connect\n");
-        sock = -1; /* set return value */
-    }
-
-    /* all done with this structure now */
-    freeaddrinfo(servinfo);
-#else
-    struct hostent *hp;
-    struct sockaddr_in addr;
-
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(port);
-
-    if ((addr.sin_addr.s_addr = inet_addr(host)) == htonl(INADDR_NONE))
-    {
-	if (!(hp = gethostbyname(host))) {
-	    errno = EINVAL;
-	    return -1;
-	}
-	addr.sin_addr.s_addr = *(unsigned long *)hp->h_addr;
-    }
-
-    if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
-	return -1;
-    }
-
-    if (connect(sock, (struct sockaddr *)&addr, (sizeof(addr))) < 0) {
-	closesocket(sock);
-	return -1;
-    }
-#endif
-    return sock;
-}
-
-int
-rfbListenOnUDPPort(int port,
-                   in_addr_t iface)
-{
-    struct sockaddr_in addr;
-    int sock;
-    int one = 1;
-
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(port);
-    addr.sin_addr.s_addr = iface;
-
-    if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-	return -1;
-    }
-    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		   (char *)&one, sizeof(one)) < 0) {
-	return -1;
-    }
-    if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-	return -1;
-    }
-
-    return sock;
-}
-
-/*
- * rfbSetNonBlocking sets a socket into non-blocking mode.
- */
-rfbBool
-rfbSetNonBlocking(int sock)
-{
-#ifdef WIN32
-  unsigned long block=1;
-  if(ioctlsocket(sock, FIONBIO, &block) == SOCKET_ERROR) {
-    errno=WSAGetLastError();
-#else
-  int flags = fcntl(sock, F_GETFL);
-  if(flags < 0 || fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0) {
-#endif
-    rfbLogPerror("Setting socket to non-blocking failed");
-    return FALSE;
-  }
-  return TRUE;
-}
diff --git a/ica/x11/libvncserver/stats.c b/ica/x11/libvncserver/stats.c
deleted file mode 100644
index 39de1c6..0000000
--- a/ica/x11/libvncserver/stats.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * stats.c
- */
-
-/*
- *  Copyright (C) 2002 RealVNC Ltd.
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-
-char *messageNameServer2Client(uint32_t type, char *buf, int len);
-char *messageNameClient2Server(uint32_t type, char *buf, int len);
-char *encodingName(uint32_t enc, char *buf, int len);
-
-rfbStatList *rfbStatLookupEncoding(rfbClientPtr cl, uint32_t type);
-rfbStatList *rfbStatLookupMessage(rfbClientPtr cl, uint32_t type);
-
-void  rfbStatRecordEncodingSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-void  rfbStatRecordEncodingRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-void  rfbStatRecordMessageSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-void  rfbStatRecordMessageRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-void rfbResetStats(rfbClientPtr cl);
-void rfbPrintStats(rfbClientPtr cl);
-
-
-
-
-char *messageNameServer2Client(uint32_t type, char *buf, int len) {
-    if (buf==NULL) return "error";
-    switch (type) {
-    case rfbFramebufferUpdate:        snprintf(buf, len, "FramebufferUpdate"); break;
-    case rfbSetColourMapEntries:      snprintf(buf, len, "SetColourMapEntries"); break;
-    case rfbBell:                     snprintf(buf, len, "Bell"); break;
-    case rfbServerCutText:            snprintf(buf, len, "ServerCutText"); break;
-    case rfbResizeFrameBuffer:        snprintf(buf, len, "ResizeFrameBuffer"); break;
-    case rfbFileTransfer:             snprintf(buf, len, "FileTransfer"); break;
-    case rfbTextChat:                 snprintf(buf, len, "TextChat"); break;
-    case rfbPalmVNCReSizeFrameBuffer: snprintf(buf, len, "PalmVNCReSize"); break;
-    case rfbXvp:                      snprintf(buf, len, "XvpServerMessage"); break;
-    default:
-        snprintf(buf, len, "svr2cli-0x%08X", 0xFF);
-    }
-    return buf;
-}
-
-char *messageNameClient2Server(uint32_t type, char *buf, int len) {
-    if (buf==NULL) return "error";
-    switch (type) {
-    case rfbSetPixelFormat:           snprintf(buf, len, "SetPixelFormat"); break;
-    case rfbFixColourMapEntries:      snprintf(buf, len, "FixColourMapEntries"); break;
-    case rfbSetEncodings:             snprintf(buf, len, "SetEncodings"); break;
-    case rfbFramebufferUpdateRequest: snprintf(buf, len, "FramebufferUpdate"); break;
-    case rfbKeyEvent:                 snprintf(buf, len, "KeyEvent"); break;
-    case rfbPointerEvent:             snprintf(buf, len, "PointerEvent"); break;
-    case rfbClientCutText:            snprintf(buf, len, "ClientCutText"); break;
-    case rfbFileTransfer:             snprintf(buf, len, "FileTransfer"); break;
-    case rfbSetScale:                 snprintf(buf, len, "SetScale"); break;
-    case rfbSetServerInput:           snprintf(buf, len, "SetServerInput"); break;
-    case rfbSetSW:                    snprintf(buf, len, "SetSingleWindow"); break;
-    case rfbTextChat:                 snprintf(buf, len, "TextChat"); break;
-    case rfbPalmVNCSetScaleFactor:    snprintf(buf, len, "PalmVNCSetScale"); break;
-    case rfbXvp:                      snprintf(buf, len, "XvpClientMessage"); break;
-    default:
-        snprintf(buf, len, "cli2svr-0x%08X", type);
-
-
-    }
-    return buf;
-}
-
-/* Encoding name must be <=16 characters to fit nicely on the status output in
- * an 80 column terminal window
- */
-char *encodingName(uint32_t type, char *buf, int len) {
-    if (buf==NULL) return "error";
-    
-    switch (type) {
-    case rfbEncodingRaw:                snprintf(buf, len, "raw");         break;
-    case rfbEncodingCopyRect:           snprintf(buf, len, "copyRect");    break;
-    case rfbEncodingRRE:                snprintf(buf, len, "RRE");         break;
-    case rfbEncodingCoRRE:              snprintf(buf, len, "CoRRE");       break;
-    case rfbEncodingHextile:            snprintf(buf, len, "hextile");     break;
-    case rfbEncodingZlib:               snprintf(buf, len, "zlib");        break;
-    case rfbEncodingTight:              snprintf(buf, len, "tight");       break;
-    case rfbEncodingTightPng:           snprintf(buf, len, "tightPng");    break;
-    case rfbEncodingZlibHex:            snprintf(buf, len, "zlibhex");     break;
-    case rfbEncodingUltra:              snprintf(buf, len, "ultra");       break;
-    case rfbEncodingZRLE:               snprintf(buf, len, "ZRLE");        break;
-    case rfbEncodingZYWRLE:             snprintf(buf, len, "ZYWRLE");      break;
-    case rfbEncodingCache:              snprintf(buf, len, "cache");       break;
-    case rfbEncodingCacheEnable:        snprintf(buf, len, "cacheEnable"); break;
-    case rfbEncodingXOR_Zlib:           snprintf(buf, len, "xorZlib");     break;
-    case rfbEncodingXORMonoColor_Zlib:  snprintf(buf, len, "xorMonoZlib");  break;
-    case rfbEncodingXORMultiColor_Zlib: snprintf(buf, len, "xorColorZlib"); break;
-    case rfbEncodingSolidColor:         snprintf(buf, len, "solidColor");  break;
-    case rfbEncodingXOREnable:          snprintf(buf, len, "xorEnable");   break;
-    case rfbEncodingCacheZip:           snprintf(buf, len, "cacheZip");    break;
-    case rfbEncodingSolMonoZip:         snprintf(buf, len, "monoZip");     break;
-    case rfbEncodingUltraZip:           snprintf(buf, len, "ultraZip");    break;
-
-    case rfbEncodingXCursor:            snprintf(buf, len, "Xcursor");     break;
-    case rfbEncodingRichCursor:         snprintf(buf, len, "RichCursor");  break;
-    case rfbEncodingPointerPos:         snprintf(buf, len, "PointerPos");  break;
-
-    case rfbEncodingLastRect:           snprintf(buf, len, "LastRect");    break;
-    case rfbEncodingNewFBSize:          snprintf(buf, len, "NewFBSize");   break;
-    case rfbEncodingKeyboardLedState:   snprintf(buf, len, "LedState");    break;
-    case rfbEncodingSupportedMessages:  snprintf(buf, len, "SupportedMessage");  break;
-    case rfbEncodingSupportedEncodings: snprintf(buf, len, "SupportedEncoding"); break;
-    case rfbEncodingServerIdentity:     snprintf(buf, len, "ServerIdentify");    break;
-
-    /* The following lookups do not report in stats */
-    case rfbEncodingCompressLevel0: snprintf(buf, len, "CompressLevel0");  break;
-    case rfbEncodingCompressLevel1: snprintf(buf, len, "CompressLevel1");  break;
-    case rfbEncodingCompressLevel2: snprintf(buf, len, "CompressLevel2");  break;
-    case rfbEncodingCompressLevel3: snprintf(buf, len, "CompressLevel3");  break;
-    case rfbEncodingCompressLevel4: snprintf(buf, len, "CompressLevel4");  break;
-    case rfbEncodingCompressLevel5: snprintf(buf, len, "CompressLevel5");  break;
-    case rfbEncodingCompressLevel6: snprintf(buf, len, "CompressLevel6");  break;
-    case rfbEncodingCompressLevel7: snprintf(buf, len, "CompressLevel7");  break;
-    case rfbEncodingCompressLevel8: snprintf(buf, len, "CompressLevel8");  break;
-    case rfbEncodingCompressLevel9: snprintf(buf, len, "CompressLevel9");  break;
-    
-    case rfbEncodingQualityLevel0:  snprintf(buf, len, "QualityLevel0");   break;
-    case rfbEncodingQualityLevel1:  snprintf(buf, len, "QualityLevel1");   break;
-    case rfbEncodingQualityLevel2:  snprintf(buf, len, "QualityLevel2");   break;
-    case rfbEncodingQualityLevel3:  snprintf(buf, len, "QualityLevel3");   break;
-    case rfbEncodingQualityLevel4:  snprintf(buf, len, "QualityLevel4");   break;
-    case rfbEncodingQualityLevel5:  snprintf(buf, len, "QualityLevel5");   break;
-    case rfbEncodingQualityLevel6:  snprintf(buf, len, "QualityLevel6");   break;
-    case rfbEncodingQualityLevel7:  snprintf(buf, len, "QualityLevel7");   break;
-    case rfbEncodingQualityLevel8:  snprintf(buf, len, "QualityLevel8");   break;
-    case rfbEncodingQualityLevel9:  snprintf(buf, len, "QualityLevel9");   break;
-
-
-    default:
-        snprintf(buf, len, "Enc(0x%08X)", type);
-    }
-
-    return buf;
-}
-
-
-
-
-
-rfbStatList *rfbStatLookupEncoding(rfbClientPtr cl, uint32_t type)
-{
-    rfbStatList *ptr;
-    if (cl==NULL) return NULL;
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-    {
-        if (ptr->type==type) return ptr;
-    }
-    /* Well, we are here... need to *CREATE* an entry */
-    ptr = (rfbStatList *)malloc(sizeof(rfbStatList));
-    if (ptr!=NULL)
-    {
-        memset((char *)ptr, 0, sizeof(rfbStatList));
-        ptr->type = type;
-        /* add to the top of the list */
-        ptr->Next = cl->statEncList;
-        cl->statEncList = ptr;
-    }
-    return ptr;
-}
-
-
-rfbStatList *rfbStatLookupMessage(rfbClientPtr cl, uint32_t type)
-{
-    rfbStatList *ptr;
-    if (cl==NULL) return NULL;
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-    {
-        if (ptr->type==type) return ptr;
-    }
-    /* Well, we are here... need to *CREATE* an entry */
-    ptr = (rfbStatList *)malloc(sizeof(rfbStatList));
-    if (ptr!=NULL)
-    {
-        memset((char *)ptr, 0, sizeof(rfbStatList));
-        ptr->type = type;
-        /* add to the top of the list */
-        ptr->Next = cl->statMsgList;
-        cl->statMsgList = ptr;
-    }
-    return ptr;
-}
-
-void rfbStatRecordEncodingSentAdd(rfbClientPtr cl, uint32_t type, int byteCount) /* Specifically for tight encoding */
-{
-    rfbStatList *ptr;
-
-    ptr = rfbStatLookupEncoding(cl, type);
-    if (ptr!=NULL)
-        ptr->bytesSent      += byteCount;
-}
-
-
-void  rfbStatRecordEncodingSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
-{
-    rfbStatList *ptr;
-
-    ptr = rfbStatLookupEncoding(cl, type);
-    if (ptr!=NULL)
-    {
-        ptr->sentCount++;
-        ptr->bytesSent      += byteCount;
-        ptr->bytesSentIfRaw += byteIfRaw;
-    }
-}
-
-void  rfbStatRecordEncodingRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
-{
-    rfbStatList *ptr;
-
-    ptr = rfbStatLookupEncoding(cl, type);
-    if (ptr!=NULL)
-    {
-        ptr->rcvdCount++;
-        ptr->bytesRcvd      += byteCount;
-        ptr->bytesRcvdIfRaw += byteIfRaw;
-    }
-}
-
-void  rfbStatRecordMessageSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
-{
-    rfbStatList *ptr;
-
-    ptr = rfbStatLookupMessage(cl, type);
-    if (ptr!=NULL)
-    {
-        ptr->sentCount++;
-        ptr->bytesSent      += byteCount;
-        ptr->bytesSentIfRaw += byteIfRaw;
-    }
-}
-
-void  rfbStatRecordMessageRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
-{
-    rfbStatList *ptr;
-
-    ptr = rfbStatLookupMessage(cl, type);
-    if (ptr!=NULL)
-    {
-        ptr->rcvdCount++;
-        ptr->bytesRcvd      += byteCount;
-        ptr->bytesRcvdIfRaw += byteIfRaw;
-    }
-}
-
-
-int rfbStatGetSentBytes(rfbClientPtr cl)
-{
-    rfbStatList *ptr=NULL;
-    int bytes=0;
-    if (cl==NULL) return 0;
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesSent;
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesSent;
-    return bytes;
-}
-
-int rfbStatGetSentBytesIfRaw(rfbClientPtr cl)
-{
-    rfbStatList *ptr=NULL;
-    int bytes=0;
-    if (cl==NULL) return 0;
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesSentIfRaw;
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesSentIfRaw;
-    return bytes;
-}
-
-int rfbStatGetRcvdBytes(rfbClientPtr cl)
-{
-    rfbStatList *ptr=NULL;
-    int bytes=0;
-    if (cl==NULL) return 0;
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesRcvd;
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesRcvd;
-    return bytes;
-}
-
-int rfbStatGetRcvdBytesIfRaw(rfbClientPtr cl)
-{
-    rfbStatList *ptr=NULL;
-    int bytes=0;
-    if (cl==NULL) return 0;
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesRcvdIfRaw;
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-        bytes += ptr->bytesRcvdIfRaw;
-    return bytes;
-}
-
-int rfbStatGetMessageCountSent(rfbClientPtr cl, uint32_t type)
-{
-  rfbStatList *ptr=NULL;
-    if (cl==NULL) return 0;
-  for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-      if (ptr->type==type) return ptr->sentCount;
-  return 0;
-}
-int rfbStatGetMessageCountRcvd(rfbClientPtr cl, uint32_t type)
-{
-  rfbStatList *ptr=NULL;
-    if (cl==NULL) return 0;
-  for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-      if (ptr->type==type) return ptr->rcvdCount;
-  return 0;
-}
-
-int rfbStatGetEncodingCountSent(rfbClientPtr cl, uint32_t type)
-{
-  rfbStatList *ptr=NULL;
-    if (cl==NULL) return 0;
-  for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-      if (ptr->type==type) return ptr->sentCount;
-  return 0;
-}
-int rfbStatGetEncodingCountRcvd(rfbClientPtr cl, uint32_t type)
-{
-  rfbStatList *ptr=NULL;
-    if (cl==NULL) return 0;
-  for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-      if (ptr->type==type) return ptr->rcvdCount;
-  return 0;
-}
-
-
-
-
-void rfbResetStats(rfbClientPtr cl)
-{
-    rfbStatList *ptr;
-    if (cl==NULL) return;
-    while (cl->statEncList!=NULL)
-    {
-        ptr = cl->statEncList;
-        cl->statEncList = ptr->Next;
-        free(ptr);
-    }
-    while (cl->statMsgList!=NULL)
-    {
-        ptr = cl->statMsgList;
-        cl->statMsgList = ptr->Next;
-        free(ptr);
-    }
-}
-
-
-void rfbPrintStats(rfbClientPtr cl)
-{
-    rfbStatList *ptr=NULL;
-    char encBuf[64];
-    double savings=0.0;
-    int    totalRects=0;
-    double totalBytes=0.0;
-    double totalBytesIfRaw=0.0;
-
-    char *name=NULL;
-    int bytes=0;
-    int bytesIfRaw=0;
-    int count=0;
-
-    if (cl==NULL) return;
-    
-    rfbLog("%-21.21s  %-6.6s   %9.9s/%9.9s (%6.6s)\n", "Statistics", "events", "Transmit","RawEquiv","saved");
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-    {
-        name       = messageNameServer2Client(ptr->type, encBuf, sizeof(encBuf));
-        count      = ptr->sentCount;
-        bytes      = ptr->bytesSent;
-        bytesIfRaw = ptr->bytesSentIfRaw;
-        
-        savings = 0.0;
-        if (bytesIfRaw>0.0)
-            savings = 100.0 - (((double)bytes / (double)bytesIfRaw) * 100.0);
-        if ((bytes>0) || (count>0) || (bytesIfRaw>0))
-            rfbLog(" %-20.20s: %6d | %9d/%9d (%5.1f%%)\n",
-	        name, count, bytes, bytesIfRaw, savings);
-        totalRects += count;
-        totalBytes += bytes;
-        totalBytesIfRaw += bytesIfRaw;
-    }
-
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-    {
-        name       = encodingName(ptr->type, encBuf, sizeof(encBuf));
-        count      = ptr->sentCount;
-        bytes      = ptr->bytesSent;
-        bytesIfRaw = ptr->bytesSentIfRaw;
-        savings    = 0.0;
-
-        if (bytesIfRaw>0.0)
-            savings = 100.0 - (((double)bytes / (double)bytesIfRaw) * 100.0);
-        if ((bytes>0) || (count>0) || (bytesIfRaw>0))
-            rfbLog(" %-20.20s: %6d | %9d/%9d (%5.1f%%)\n",
-	        name, count, bytes, bytesIfRaw, savings);
-        totalRects += count;
-        totalBytes += bytes;
-        totalBytesIfRaw += bytesIfRaw;
-    }
-    savings=0.0;
-    if (totalBytesIfRaw>0.0)
-        savings = 100.0 - ((totalBytes/totalBytesIfRaw)*100.0);
-    rfbLog(" %-20.20s: %6d | %9.0f/%9.0f (%5.1f%%)\n",
-            "TOTALS", totalRects, totalBytes,totalBytesIfRaw, savings);
-
-    totalRects=0.0;
-    totalBytes=0.0;
-    totalBytesIfRaw=0.0;
-
-    rfbLog("%-21.21s  %-6.6s   %9.9s/%9.9s (%6.6s)\n", "Statistics", "events", "Received","RawEquiv","saved");
-    for (ptr = cl->statMsgList; ptr!=NULL; ptr=ptr->Next)
-    {
-        name       = messageNameClient2Server(ptr->type, encBuf, sizeof(encBuf));
-        count      = ptr->rcvdCount;
-        bytes      = ptr->bytesRcvd;
-        bytesIfRaw = ptr->bytesRcvdIfRaw;
-        savings    = 0.0;
-
-        if (bytesIfRaw>0.0)
-            savings = 100.0 - (((double)bytes / (double)bytesIfRaw) * 100.0);
-        if ((bytes>0) || (count>0) || (bytesIfRaw>0))
-            rfbLog(" %-20.20s: %6d | %9d/%9d (%5.1f%%)\n",
-	        name, count, bytes, bytesIfRaw, savings);
-        totalRects += count;
-        totalBytes += bytes;
-        totalBytesIfRaw += bytesIfRaw;
-    }
-    for (ptr = cl->statEncList; ptr!=NULL; ptr=ptr->Next)
-    {
-        name       = encodingName(ptr->type, encBuf, sizeof(encBuf));
-        count      = ptr->rcvdCount;
-        bytes      = ptr->bytesRcvd;
-        bytesIfRaw = ptr->bytesRcvdIfRaw;
-        savings    = 0.0;
-
-        if (bytesIfRaw>0.0)
-            savings = 100.0 - (((double)bytes / (double)bytesIfRaw) * 100.0);
-        if ((bytes>0) || (count>0) || (bytesIfRaw>0))
-            rfbLog(" %-20.20s: %6d | %9d/%9d (%5.1f%%)\n",
-	        name, count, bytes, bytesIfRaw, savings);
-        totalRects += count;
-        totalBytes += bytes;
-        totalBytesIfRaw += bytesIfRaw;
-    }
-    savings=0.0;
-    if (totalBytesIfRaw>0.0)
-        savings = 100.0 - ((totalBytes/totalBytesIfRaw)*100.0);
-    rfbLog(" %-20.20s: %6d | %9.0f/%9.0f (%5.1f%%)\n",
-            "TOTALS", totalRects, totalBytes,totalBytesIfRaw, savings);
-      
-} 
-
diff --git a/ica/x11/libvncserver/tableinit24.c b/ica/x11/libvncserver/tableinit24.c
deleted file mode 100644
index 39e9920..0000000
--- a/ica/x11/libvncserver/tableinit24.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-  24 bit
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-static void
-rfbInitOneRGBTable24 (uint8_t *table, int inMax, int outMax, int outShift,int swap);
-
-
-static void
-rfbInitColourMapSingleTable24(char **table, rfbPixelFormat *in,
-                            rfbPixelFormat *out,rfbColourMap* colourMap)
-{
-    uint32_t i, r, g, b, outValue;
-    uint8_t *t;
-    uint8_t c;
-    unsigned int nEntries = 1 << in->bitsPerPixel;
-    int shift = colourMap->is16?16:8;
-
-    if (*table) free(*table);
-    *table = (char *)malloc(nEntries * 3 + 1);
-    t = (uint8_t *)*table;
-
-    for (i = 0; i < nEntries; i++) {
-        r = g = b = 0;
-	if(i < colourMap->count) {
-	  if(colourMap->is16) {
-	    r = colourMap->data.shorts[3*i+0];
-	    g = colourMap->data.shorts[3*i+1];
-	    b = colourMap->data.shorts[3*i+2];
-	  } else {
-	    r = colourMap->data.bytes[3*i+0];
-	    g = colourMap->data.bytes[3*i+1];
-	    b = colourMap->data.bytes[3*i+2];
-	  }
-	}
-        outValue = ((((r * (1 + out->redMax)) >> shift) << out->redShift) |
-                (((g * (1 + out->greenMax)) >> shift) << out->greenShift) |
-                (((b * (1 + out->blueMax)) >> shift) << out->blueShift));
-	*(uint32_t*)&t[3*i] = outValue;
-	if(!rfbEndianTest)
-	  memmove(t+3*i,t+3*i+1,3);
-        if (out->bigEndian != in->bigEndian) {
-	  c = t[3*i]; t[3*i] = t[3*i+2]; t[3*i+2] = c;
-        }
-    }
-}
-
-/*
- * rfbInitTrueColourSingleTable sets up a single lookup table for truecolour
- * translation.
- */
-
-static void
-rfbInitTrueColourSingleTable24 (char **table, rfbPixelFormat *in,
-                                 rfbPixelFormat *out)
-{
-    int i,outValue;
-    int inRed, inGreen, inBlue, outRed, outGreen, outBlue;
-    uint8_t *t;
-    uint8_t c;
-    int nEntries = 1 << in->bitsPerPixel;
-
-    if (*table) free(*table);
-    *table = (char *)malloc(nEntries * 3 + 1);
-    t = (uint8_t *)*table;
-
-    for (i = 0; i < nEntries; i++) {
-        inRed   = (i >> in->redShift)   & in->redMax;
-        inGreen = (i >> in->greenShift) & in->greenMax;
-        inBlue  = (i >> in->blueShift)  & in->blueMax;
-
-        outRed   = (inRed   * out->redMax   + in->redMax / 2)   / in->redMax;
-        outGreen = (inGreen * out->greenMax + in->greenMax / 2) / in->greenMax;
-        outBlue  = (inBlue  * out->blueMax  + in->blueMax / 2)  / in->blueMax;
-
-	outValue = ((outRed   << out->redShift)   |
-                (outGreen << out->greenShift) |
-                (outBlue  << out->blueShift));
-	*(uint32_t*)&t[3*i] = outValue;
-	if(!rfbEndianTest)
-	  memmove(t+3*i,t+3*i+1,3);
-        if (out->bigEndian != in->bigEndian) {
-	  c = t[3*i]; t[3*i] = t[3*i+2]; t[3*i+2] = c;
-        }
-    }
-}
-
-
-/*
- * rfbInitTrueColourRGBTables sets up three separate lookup tables for the
- * red, green and blue values.
- */
-
-static void
-rfbInitTrueColourRGBTables24 (char **table, rfbPixelFormat *in,
-                               rfbPixelFormat *out)
-{
-    uint8_t *redTable;
-    uint8_t *greenTable;
-    uint8_t *blueTable;
-
-    if (*table) free(*table);
-    *table = (char *)malloc((in->redMax + in->greenMax + in->blueMax + 3)
-                            * 3 + 1);
-    redTable = (uint8_t *)*table;
-    greenTable = redTable + 3*(in->redMax + 1);
-    blueTable = greenTable + 3*(in->greenMax + 1);
-
-    rfbInitOneRGBTable24 (redTable, in->redMax, out->redMax,
-                           out->redShift, (out->bigEndian != in->bigEndian));
-    rfbInitOneRGBTable24 (greenTable, in->greenMax, out->greenMax,
-                           out->greenShift, (out->bigEndian != in->bigEndian));
-    rfbInitOneRGBTable24 (blueTable, in->blueMax, out->blueMax,
-                           out->blueShift, (out->bigEndian != in->bigEndian));
-}
-
-static void
-rfbInitOneRGBTable24 (uint8_t *table, int inMax, int outMax, int outShift,
-                       int swap)
-{
-    int i;
-    int nEntries = inMax + 1;
-    uint32_t outValue;
-    uint8_t c;
-
-    for (i = 0; i < nEntries; i++) {
-      outValue = ((i * outMax + inMax / 2) / inMax) << outShift;
-      *(uint32_t *)&table[3*i] = outValue;
-      if(!rfbEndianTest)
-	memmove(table+3*i,table+3*i+1,3);
-        if (swap) {
-	  c = table[3*i]; table[3*i] = table[3*i+2];
-	  table[3*i+2] = c;
-        }
-    }
-}
diff --git a/ica/x11/libvncserver/tableinitcmtemplate.c b/ica/x11/libvncserver/tableinitcmtemplate.c
deleted file mode 100644
index df01b23..0000000
--- a/ica/x11/libvncserver/tableinitcmtemplate.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * tableinitcmtemplate.c - template for initialising lookup tables for
- * translation from a colour map to true colour.
- *
- * This file shouldn't be compiled.  It is included multiple times by
- * translate.c, each time with a different definition of the macro OUT.
- * For each value of OUT, this file defines a function which allocates an
- * appropriately sized lookup table and initialises it.
- *
- * I know this code isn't nice to read because of all the macros, but
- * efficiency is important here.
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#if !defined(OUT)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#define OUT_T CONCAT3E(uint,OUT,_t)
-#define SwapOUT(x) CONCAT2E(Swap,OUT(x))
-#define rfbInitColourMapSingleTableOUT \
-                                CONCAT2E(rfbInitColourMapSingleTable,OUT)
-
-static void
-rfbInitColourMapSingleTableOUT(char **table, rfbPixelFormat *in,
-                            rfbPixelFormat *out,rfbColourMap* colourMap)
-{
-    uint32_t i, r, g, b;
-    OUT_T *t;
-    uint32_t nEntries = 1 << in->bitsPerPixel;
-    int shift = colourMap->is16?16:8;
-
-    if (*table) free(*table);
-    *table = (char *)malloc(nEntries * sizeof(OUT_T));
-    t = (OUT_T *)*table;
-
-    for (i = 0; i < nEntries; i++) {
-        r = g = b = 0;
-	if(i < colourMap->count) {
-	  if(colourMap->is16) {
-	    r = colourMap->data.shorts[3*i+0];
-	    g = colourMap->data.shorts[3*i+1];
-	    b = colourMap->data.shorts[3*i+2];
-	  } else {
-	    r = colourMap->data.bytes[3*i+0];
-	    g = colourMap->data.bytes[3*i+1];
-	    b = colourMap->data.bytes[3*i+2];
-	  }
-	}
-        t[i] = ((((r * (1 + out->redMax)) >> shift) << out->redShift) |
-                (((g * (1 + out->greenMax)) >> shift) << out->greenShift) |
-                (((b * (1 + out->blueMax)) >> shift) << out->blueShift));
-#if (OUT != 8)
-        if (out->bigEndian != in->bigEndian) {
-            t[i] = SwapOUT(t[i]);
-        }
-#endif
-    }
-}
-
-#undef OUT_T
-#undef SwapOUT
-#undef rfbInitColourMapSingleTableOUT
diff --git a/ica/x11/libvncserver/tableinittctemplate.c b/ica/x11/libvncserver/tableinittctemplate.c
deleted file mode 100644
index 8d4f742..0000000
--- a/ica/x11/libvncserver/tableinittctemplate.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * tableinittctemplate.c - template for initialising lookup tables for
- * truecolour to truecolour translation.
- *
- * This file shouldn't be compiled.  It is included multiple times by
- * translate.c, each time with a different definition of the macro OUT.
- * For each value of OUT, this file defines two functions for initialising
- * lookup tables.  One is for truecolour translation using a single lookup
- * table, the other is for truecolour translation using three separate
- * lookup tables for the red, green and blue values.
- *
- * I know this code isn't nice to read because of all the macros, but
- * efficiency is important here.
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#if !defined(OUT)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#define OUT_T CONCAT3E(uint,OUT,_t)
-#define SwapOUT(x) CONCAT2E(Swap,OUT(x))
-#define rfbInitTrueColourSingleTableOUT \
-                                CONCAT2E(rfbInitTrueColourSingleTable,OUT)
-#define rfbInitTrueColourRGBTablesOUT CONCAT2E(rfbInitTrueColourRGBTables,OUT)
-#define rfbInitOneRGBTableOUT CONCAT2E(rfbInitOneRGBTable,OUT)
-
-static void
-rfbInitOneRGBTableOUT (OUT_T *table, int inMax, int outMax, int outShift,
-                       int swap);
-
-
-/*
- * rfbInitTrueColourSingleTable sets up a single lookup table for truecolour
- * translation.
- */
-
-static void
-rfbInitTrueColourSingleTableOUT (char **table, rfbPixelFormat *in,
-                                 rfbPixelFormat *out)
-{
-    int i;
-    int inRed, inGreen, inBlue, outRed, outGreen, outBlue;
-    OUT_T *t;
-    int nEntries = 1 << in->bitsPerPixel;
-
-    if (*table) free(*table);
-    *table = (char *)malloc(nEntries * sizeof(OUT_T));
-    t = (OUT_T *)*table;
-
-    for (i = 0; i < nEntries; i++) {
-        inRed   = (i >> in->redShift)   & in->redMax;
-        inGreen = (i >> in->greenShift) & in->greenMax;
-        inBlue  = (i >> in->blueShift)  & in->blueMax;
-
-        outRed   = (inRed   * out->redMax   + in->redMax / 2)   / in->redMax;
-        outGreen = (inGreen * out->greenMax + in->greenMax / 2) / in->greenMax;
-        outBlue  = (inBlue  * out->blueMax  + in->blueMax / 2)  / in->blueMax;
-
-        t[i] = ((outRed   << out->redShift)   |
-                (outGreen << out->greenShift) |
-                (outBlue  << out->blueShift));
-#if (OUT != 8)
-        if (out->bigEndian != in->bigEndian) {
-            t[i] = SwapOUT(t[i]);
-        }
-#endif
-    }
-}
-
-
-/*
- * rfbInitTrueColourRGBTables sets up three separate lookup tables for the
- * red, green and blue values.
- */
-
-static void
-rfbInitTrueColourRGBTablesOUT (char **table, rfbPixelFormat *in,
-                               rfbPixelFormat *out)
-{
-    OUT_T *redTable;
-    OUT_T *greenTable;
-    OUT_T *blueTable;
-
-    if (*table) free(*table);
-    *table = (char *)malloc((in->redMax + in->greenMax + in->blueMax + 3)
-                            * sizeof(OUT_T));
-    redTable = (OUT_T *)*table;
-    greenTable = redTable + in->redMax + 1;
-    blueTable = greenTable + in->greenMax + 1;
-
-    rfbInitOneRGBTableOUT (redTable, in->redMax, out->redMax,
-                           out->redShift, (out->bigEndian != in->bigEndian));
-    rfbInitOneRGBTableOUT (greenTable, in->greenMax, out->greenMax,
-                           out->greenShift, (out->bigEndian != in->bigEndian));
-    rfbInitOneRGBTableOUT (blueTable, in->blueMax, out->blueMax,
-                           out->blueShift, (out->bigEndian != in->bigEndian));
-}
-
-static void
-rfbInitOneRGBTableOUT (OUT_T *table, int inMax, int outMax, int outShift,
-                       int swap)
-{
-    int i;
-    int nEntries = inMax + 1;
-
-    for (i = 0; i < nEntries; i++) {
-        table[i] = ((i * outMax + inMax / 2) / inMax) << outShift;
-#if (OUT != 8)
-        if (swap) {
-            table[i] = SwapOUT(table[i]);
-        }
-#endif
-    }
-}
-
-#undef OUT_T
-#undef SwapOUT
-#undef rfbInitTrueColourSingleTableOUT
-#undef rfbInitTrueColourRGBTablesOUT
-#undef rfbInitOneRGBTableOUT
diff --git a/ica/x11/libvncserver/tabletrans24template.c b/ica/x11/libvncserver/tabletrans24template.c
deleted file mode 100644
index 4b3a0a0..0000000
--- a/ica/x11/libvncserver/tabletrans24template.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * tabletranstemplate.c - template for translation using lookup tables.
- *
- * This file shouldn't be compiled.  It is included multiple times by
- * translate.c, each time with different definitions of the macros IN and OUT.
- *
- * For each pair of values IN and OUT, this file defines two functions for
- * translating a given rectangle of pixel data.  One uses a single lookup
- * table, and the other uses three separate lookup tables for the red, green
- * and blue values.
- *
- * I know this code isn't nice to read because of all the macros, but
- * efficiency is important here.
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#if !defined(BPP)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#if BPP == 24
-
-/*
- * rfbTranslateWithSingleTableINtoOUT translates a rectangle of pixel data
- * using a single lookup table.
- */
-
-static void
-rfbTranslateWithSingleTable24to24 (char *table, rfbPixelFormat *in,
-                                    rfbPixelFormat *out,
-                                    char *iptr, char *optr,
-                                    int bytesBetweenInputLines,
-                                    int width, int height)
-{
-    uint8_t *ip = (uint8_t *)iptr;
-    uint8_t *op = (uint8_t *)optr;
-    int ipextra = bytesBetweenInputLines - width * 3;
-    uint8_t *opLineEnd;
-    uint8_t *t = (uint8_t *)table;
-    int shift = rfbEndianTest?0:8;
-    uint8_t c;
-
-    while (height > 0) {
-        opLineEnd = op + width*3;
-
-        while (op < opLineEnd) {
-	    *(uint32_t*)op = t[((*(uint32_t *)ip)>>shift)&0x00ffffff];
-	    if(!rfbEndianTest)
-	      memmove(op,op+1,3);
-	    if (out->bigEndian != in->bigEndian) {
-	      c = op[0]; op[0] = op[2]; op[2] = c;
-	    }
-	    op += 3;
-	    ip += 3;
-        }
-
-        ip += ipextra;
-        height--;
-    }
-}
-
-/*
- * rfbTranslateWithRGBTablesINtoOUT translates a rectangle of pixel data
- * using three separate lookup tables for the red, green and blue values.
- */
-
-static void
-rfbTranslateWithRGBTables24to24 (char *table, rfbPixelFormat *in,
-                                  rfbPixelFormat *out,
-                                  char *iptr, char *optr,
-                                  int bytesBetweenInputLines,
-                                  int width, int height)
-{
-    uint8_t *ip = (uint8_t *)iptr;
-    uint8_t *op = (uint8_t *)optr;
-    int ipextra = bytesBetweenInputLines - width*3;
-    uint8_t *opLineEnd;
-    uint8_t *redTable = (uint8_t *)table;
-    uint8_t *greenTable = redTable + 3*(in->redMax + 1);
-    uint8_t *blueTable = greenTable + 3*(in->greenMax + 1);
-    uint32_t outValue,inValue;
-    int shift = rfbEndianTest?0:8;
-
-    while (height > 0) {
-        opLineEnd = op+3*width;
-
-        while (op < opLineEnd) {
-	    inValue = ((*(uint32_t *)ip)>>shift)&0x00ffffff;
-            outValue = (redTable[(inValue >> in->redShift) & in->redMax] |
-                       greenTable[(inValue >> in->greenShift) & in->greenMax] |
-                       blueTable[(inValue >> in->blueShift) & in->blueMax]);
-	    memcpy(op,&outValue,3);
-	    op += 3;
-            ip+=3;
-        }
-        ip += ipextra;
-        height--;
-    }
-}
-
-#else
-
-#define IN_T CONCAT3E(uint,BPP,_t)
-#define OUT_T CONCAT3E(uint,BPP,_t)
-#define rfbTranslateWithSingleTable24toOUT \
-                                CONCAT4E(rfbTranslateWithSingleTable,24,to,BPP)
-#define rfbTranslateWithSingleTableINto24 \
-                                CONCAT4E(rfbTranslateWithSingleTable,BPP,to,24)
-#define rfbTranslateWithRGBTables24toOUT \
-                                CONCAT4E(rfbTranslateWithRGBTables,24,to,BPP)
-#define rfbTranslateWithRGBTablesINto24 \
-                                CONCAT4E(rfbTranslateWithRGBTables,BPP,to,24)
-
-/*
- * rfbTranslateWithSingleTableINtoOUT translates a rectangle of pixel data
- * using a single lookup table.
- */
-
-static void
-rfbTranslateWithSingleTable24toOUT (char *table, rfbPixelFormat *in,
-                                    rfbPixelFormat *out,
-                                    char *iptr, char *optr,
-                                    int bytesBetweenInputLines,
-                                    int width, int height)
-{
-    uint8_t *ip = (uint8_t *)iptr;
-    OUT_T *op = (OUT_T *)optr;
-    int ipextra = bytesBetweenInputLines - width*3;
-    OUT_T *opLineEnd;
-    OUT_T *t = (OUT_T *)table;
-    int shift = rfbEndianTest?0:8;
-
-    while (height > 0) {
-        opLineEnd = op + width;
-
-        while (op < opLineEnd) {
-            *(op++) = t[((*(uint32_t *)ip)>>shift)&0x00ffffff];
-	    ip+=3;
-        }
-
-        ip += ipextra;
-        height--;
-    }
-}
-
-
-/*
- * rfbTranslateWithRGBTablesINtoOUT translates a rectangle of pixel data
- * using three separate lookup tables for the red, green and blue values.
- */
-
-static void
-rfbTranslateWithRGBTables24toOUT (char *table, rfbPixelFormat *in,
-                                  rfbPixelFormat *out,
-                                  char *iptr, char *optr,
-                                  int bytesBetweenInputLines,
-                                  int width, int height)
-{
-    uint8_t *ip = (uint8_t *)iptr;
-    OUT_T *op = (OUT_T *)optr;
-    int ipextra = bytesBetweenInputLines - width*3;
-    OUT_T *opLineEnd;
-    OUT_T *redTable = (OUT_T *)table;
-    OUT_T *greenTable = redTable + in->redMax + 1;
-    OUT_T *blueTable = greenTable + in->greenMax + 1;
-    uint32_t inValue;
-    int shift = rfbEndianTest?0:8;
-
-    while (height > 0) {
-        opLineEnd = &op[width];
-
-        while (op < opLineEnd) {
-	    inValue = ((*(uint32_t *)ip)>>shift)&0x00ffffff;
-            *(op++) = (redTable[(inValue >> in->redShift) & in->redMax] |
-                       greenTable[(inValue >> in->greenShift) & in->greenMax] |
-                       blueTable[(inValue >> in->blueShift) & in->blueMax]);
-            ip+=3;
-        }
-        ip += ipextra;
-        height--;
-    }
-}
-
-/*
- * rfbTranslateWithSingleTableINto24 translates a rectangle of pixel data
- * using a single lookup table.
- */
-
-static void
-rfbTranslateWithSingleTableINto24 (char *table, rfbPixelFormat *in,
-                                    rfbPixelFormat *out,
-                                    char *iptr, char *optr,
-                                    int bytesBetweenInputLines,
-                                    int width, int height)
-{
-    IN_T *ip = (IN_T *)iptr;
-    uint8_t *op = (uint8_t *)optr;
-    int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width;
-    uint8_t *opLineEnd;
-    uint8_t *t = (uint8_t *)table;
-
-    while (height > 0) {
-        opLineEnd = op + width * 3;
-
-        while (op < opLineEnd) {
-	    memcpy(op,&t[3*(*(ip++))],3);
-	    op += 3;
-        }
-
-        ip += ipextra;
-        height--;
-    }
-}
-
-
-/*
- * rfbTranslateWithRGBTablesINto24 translates a rectangle of pixel data
- * using three separate lookup tables for the red, green and blue values.
- */
-
-static void
-rfbTranslateWithRGBTablesINto24 (char *table, rfbPixelFormat *in,
-                                  rfbPixelFormat *out,
-                                  char *iptr, char *optr,
-                                  int bytesBetweenInputLines,
-                                  int width, int height)
-{
-    IN_T *ip = (IN_T *)iptr;
-    uint8_t *op = (uint8_t *)optr;
-    int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width;
-    uint8_t *opLineEnd;
-    uint8_t *redTable = (uint8_t *)table;
-    uint8_t *greenTable = redTable + 3*(in->redMax + 1);
-    uint8_t *blueTable = greenTable + 3*(in->greenMax + 1);
-    uint32_t outValue;
-
-    while (height > 0) {
-        opLineEnd = op+3*width;
-
-        while (op < opLineEnd) {
-            outValue = (redTable[(*ip >> in->redShift) & in->redMax] |
-                       greenTable[(*ip >> in->greenShift) & in->greenMax] |
-                       blueTable[(*ip >> in->blueShift) & in->blueMax]);
-	    memcpy(op,&outValue,3);
-	    op += 3;
-            ip++;
-        }
-        ip += ipextra;
-        height--;
-    }
-}
-
-#undef IN_T
-#undef OUT_T
-#undef rfbTranslateWithSingleTable24toOUT
-#undef rfbTranslateWithRGBTables24toOUT
-#undef rfbTranslateWithSingleTableINto24
-#undef rfbTranslateWithRGBTablesINto24
-
-#endif
diff --git a/ica/x11/libvncserver/tabletranstemplate.c b/ica/x11/libvncserver/tabletranstemplate.c
deleted file mode 100644
index e83c623..0000000
--- a/ica/x11/libvncserver/tabletranstemplate.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * tabletranstemplate.c - template for translation using lookup tables.
- *
- * This file shouldn't be compiled.  It is included multiple times by
- * translate.c, each time with different definitions of the macros IN and OUT.
- *
- * For each pair of values IN and OUT, this file defines two functions for
- * translating a given rectangle of pixel data.  One uses a single lookup
- * table, and the other uses three separate lookup tables for the red, green
- * and blue values.
- *
- * I know this code isn't nice to read because of all the macros, but
- * efficiency is important here.
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#if !defined(IN) || !defined(OUT)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#define IN_T CONCAT3E(uint,IN,_t)
-#define OUT_T CONCAT3E(uint,OUT,_t)
-#define rfbTranslateWithSingleTableINtoOUT \
-                                CONCAT4E(rfbTranslateWithSingleTable,IN,to,OUT)
-#define rfbTranslateWithRGBTablesINtoOUT \
-                                CONCAT4E(rfbTranslateWithRGBTables,IN,to,OUT)
-
-/*
- * rfbTranslateWithSingleTableINtoOUT translates a rectangle of pixel data
- * using a single lookup table.
- */
-
-static void
-rfbTranslateWithSingleTableINtoOUT (char *table, rfbPixelFormat *in,
-                                    rfbPixelFormat *out,
-                                    char *iptr, char *optr,
-                                    int bytesBetweenInputLines,
-                                    int width, int height)
-{
-    IN_T *ip = (IN_T *)iptr;
-    OUT_T *op = (OUT_T *)optr;
-    int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width;
-    OUT_T *opLineEnd;
-    OUT_T *t = (OUT_T *)table;
-
-    while (height > 0) {
-        opLineEnd = op + width;
-
-        while (op < opLineEnd) {
-            *(op++) = t[*(ip++)];
-        }
-
-        ip += ipextra;
-        height--;
-    }
-}
-
-
-/*
- * rfbTranslateWithRGBTablesINtoOUT translates a rectangle of pixel data
- * using three separate lookup tables for the red, green and blue values.
- */
-
-static void
-rfbTranslateWithRGBTablesINtoOUT (char *table, rfbPixelFormat *in,
-                                  rfbPixelFormat *out,
-                                  char *iptr, char *optr,
-                                  int bytesBetweenInputLines,
-                                  int width, int height)
-{
-    IN_T *ip = (IN_T *)iptr;
-    OUT_T *op = (OUT_T *)optr;
-    int ipextra = bytesBetweenInputLines / sizeof(IN_T) - width;
-    OUT_T *opLineEnd;
-    OUT_T *redTable = (OUT_T *)table;
-    OUT_T *greenTable = redTable + in->redMax + 1;
-    OUT_T *blueTable = greenTable + in->greenMax + 1;
-
-    while (height > 0) {
-        opLineEnd = &op[width];
-
-        while (op < opLineEnd) {
-            *(op++) = (redTable[(*ip >> in->redShift) & in->redMax] |
-                       greenTable[(*ip >> in->greenShift) & in->greenMax] |
-                       blueTable[(*ip >> in->blueShift) & in->blueMax]);
-            ip++;
-        }
-        ip += ipextra;
-        height--;
-    }
-}
-
-#undef IN_T
-#undef OUT_T
-#undef rfbTranslateWithSingleTableINtoOUT
-#undef rfbTranslateWithRGBTablesINtoOUT
diff --git a/ica/x11/libvncserver/tight.c b/ica/x11/libvncserver/tight.c
deleted file mode 100644
index 276a2e3..0000000
--- a/ica/x11/libvncserver/tight.c
+++ /dev/null
@@ -1,1900 +0,0 @@
-/*
- * tight.c
- *
- * Routines to implement Tight Encoding
- *
- * Our Tight encoder is based roughly on the TurboVNC v0.6 encoder with some
- * additional enhancements from TurboVNC 1.1.  For lower compression levels,
- * this encoder provides a tremendous reduction in CPU usage (and subsequently,
- * an increase in throughput for CPU-limited environments) relative to the
- * TightVNC encoder, whereas Compression Level 9 provides a low-bandwidth mode
- * that behaves similarly to Compression Levels 5-9 in the old TightVNC
- * encoder.
- */
-
-/*
- *  Copyright (C) 2010-2012 D. R. Commander.  All Rights Reserved.
- *  Copyright (C) 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
- *  Copyright (C) 2004 Landmark Graphics Corporation.  All Rights Reserved.
- *  Copyright (C) 2000, 2001 Const Kaplinsky.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-#include "private.h"
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-#include <png.h>
-#endif
-#include "turbojpeg.h"
-
-
-/* Note: The following constant should not be changed. */
-#define TIGHT_MIN_TO_COMPRESS 12
-
-/* The parameters below may be adjusted. */
-#define MIN_SPLIT_RECT_SIZE     4096
-#define MIN_SOLID_SUBRECT_SIZE  2048
-#define MAX_SPLIT_TILE_SIZE       16
-
-/*
- * There is so much access of the Tight encoding static data buffers
- * that we resort to using thread local storage instead of having
- * per-client data.
- */
-#if LIBVNCSERVER_HAVE_LIBPTHREAD && LIBVNCSERVER_HAVE_TLS && !defined(TLS) && defined(__linux__)
-#define TLS __thread
-#endif
-#ifndef TLS
-#define TLS
-#endif
-
-/* This variable is set on every rfbSendRectEncodingTight() call. */
-static TLS rfbBool usePixelFormat24 = FALSE;
-
-
-/* Compression level stuff. The following array contains various
-   encoder parameters for each of 10 compression levels (0..9).
-   Last three parameters correspond to JPEG quality levels (0..9). */
-
-typedef struct TIGHT_CONF_s {
-    int maxRectSize, maxRectWidth;
-    int monoMinRectSize;
-    int idxZlibLevel, monoZlibLevel, rawZlibLevel;
-    int idxMaxColorsDivisor;
-    int palMaxColorsWithJPEG;
-} TIGHT_CONF;
-
-static TIGHT_CONF tightConf[4] = {
-    { 65536, 2048,   6, 0, 0, 0,   4, 24 }, /* 0  (used only without JPEG) */
-    { 65536, 2048,  32, 1, 1, 1,  96, 24 }, /* 1 */
-    { 65536, 2048,  32, 3, 3, 2,  96, 96 }, /* 2  (used only with JPEG) */
-    { 65536, 2048,  32, 7, 7, 5,  96, 256 } /* 9 */
-};
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-typedef struct TIGHT_PNG_CONF_s {
-    int png_zlib_level, png_filters;
-} TIGHT_PNG_CONF;
-
-static TIGHT_PNG_CONF tightPngConf[10] = {
-    { 0, PNG_NO_FILTERS },
-    { 1, PNG_NO_FILTERS },
-    { 2, PNG_NO_FILTERS },
-    { 3, PNG_NO_FILTERS },
-    { 4, PNG_NO_FILTERS },
-    { 5, PNG_ALL_FILTERS },
-    { 6, PNG_ALL_FILTERS },
-    { 7, PNG_ALL_FILTERS },
-    { 8, PNG_ALL_FILTERS },
-    { 9, PNG_ALL_FILTERS },
-};
-#endif
-
-static TLS int compressLevel = 1;
-static TLS int qualityLevel = 95;
-static TLS int subsampLevel = TJ_444;
-
-static const int subsampLevel2tjsubsamp[4] = {
-    TJ_444, TJ_420, TJ_422, TJ_GRAYSCALE
-};
-
-
-/* Stuff dealing with palettes. */
-
-typedef struct COLOR_LIST_s {
-    struct COLOR_LIST_s *next;
-    int idx;
-    uint32_t rgb;
-} COLOR_LIST;
-
-typedef struct PALETTE_ENTRY_s {
-    COLOR_LIST *listNode;
-    int numPixels;
-} PALETTE_ENTRY;
-
-typedef struct PALETTE_s {
-    PALETTE_ENTRY entry[256];
-    COLOR_LIST *hash[256];
-    COLOR_LIST list[256];
-} PALETTE;
-
-/* TODO: move into rfbScreen struct */
-static TLS int paletteNumColors = 0;
-static TLS int paletteMaxColors = 0;
-static TLS uint32_t monoBackground = 0;
-static TLS uint32_t monoForeground = 0;
-static TLS PALETTE palette;
-
-/* Pointers to dynamically-allocated buffers. */
-
-static TLS int tightBeforeBufSize = 0;
-static TLS char *tightBeforeBuf = NULL;
-
-static TLS int tightAfterBufSize = 0;
-static TLS char *tightAfterBuf = NULL;
-
-static TLS tjhandle j = NULL;
-
-void rfbTightCleanup (rfbScreenInfoPtr screen)
-{
-    if (tightBeforeBufSize) {
-        free (tightBeforeBuf);
-        tightBeforeBufSize = 0;
-        tightBeforeBuf = NULL;
-    }
-    if (tightAfterBufSize) {
-        free (tightAfterBuf);
-        tightAfterBufSize = 0;
-        tightAfterBuf = NULL;
-    }
-    if (j) tjDestroy(j);
-}
-
-
-/* Prototypes for static functions. */
-
-static rfbBool SendRectEncodingTight(rfbClientPtr cl, int x, int y,
-                                     int w, int h);
-static void FindBestSolidArea (rfbClientPtr cl, int x, int y, int w, int h,
-                               uint32_t colorValue, int *w_ptr, int *h_ptr);
-static void ExtendSolidArea   (rfbClientPtr cl, int x, int y, int w, int h,
-                               uint32_t colorValue,
-                               int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr);
-static rfbBool CheckSolidTile    (rfbClientPtr cl, int x, int y, int w, int h,
-                                  uint32_t *colorPtr, rfbBool needSameColor);
-static rfbBool CheckSolidTile8   (rfbClientPtr cl, int x, int y, int w, int h,
-                                  uint32_t *colorPtr, rfbBool needSameColor);
-static rfbBool CheckSolidTile16  (rfbClientPtr cl, int x, int y, int w, int h,
-                                  uint32_t *colorPtr, rfbBool needSameColor);
-static rfbBool CheckSolidTile32  (rfbClientPtr cl, int x, int y, int w, int h,
-                                  uint32_t *colorPtr, rfbBool needSameColor);
-
-static rfbBool SendRectSimple    (rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool SendSubrect       (rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool SendTightHeader   (rfbClientPtr cl, int x, int y, int w, int h);
-
-static rfbBool SendSolidRect     (rfbClientPtr cl);
-static rfbBool SendMonoRect      (rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool SendIndexedRect   (rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool SendFullColorRect (rfbClientPtr cl, int x, int y, int w, int h);
-
-static rfbBool CompressData (rfbClientPtr cl, int streamId, int dataLen,
-                             int zlibLevel, int zlibStrategy);
-static rfbBool SendCompressedData (rfbClientPtr cl, char *buf,
-                                   int compressedLen);
-
-static void FillPalette8 (int count);
-static void FillPalette16 (int count);
-static void FillPalette32 (int count);
-static void FastFillPalette16 (rfbClientPtr cl, uint16_t *data, int w,
-                               int pitch, int h);
-static void FastFillPalette32 (rfbClientPtr cl, uint32_t *data, int w,
-                               int pitch, int h);
-
-static void PaletteReset (void);
-static int PaletteInsert (uint32_t rgb, int numPixels, int bpp);
-
-static void Pack24 (rfbClientPtr cl, char *buf, rfbPixelFormat *fmt,
-                    int count);
-
-static void EncodeIndexedRect16 (uint8_t *buf, int count);
-static void EncodeIndexedRect32 (uint8_t *buf, int count);
-
-static void EncodeMonoRect8 (uint8_t *buf, int w, int h);
-static void EncodeMonoRect16 (uint8_t *buf, int w, int h);
-static void EncodeMonoRect32 (uint8_t *buf, int w, int h);
-
-static rfbBool SendJpegRect (rfbClientPtr cl, int x, int y, int w, int h,
-                             int quality);
-static void PrepareRowForImg(rfbClientPtr cl, uint8_t *dst, int x, int y, int count);
-static void PrepareRowForImg24(rfbClientPtr cl, uint8_t *dst, int x, int y, int count);
-static void PrepareRowForImg16(rfbClientPtr cl, uint8_t *dst, int x, int y, int count);
-static void PrepareRowForImg32(rfbClientPtr cl, uint8_t *dst, int x, int y, int count);
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-static rfbBool SendPngRect(rfbClientPtr cl, int x, int y, int w, int h);
-static rfbBool CanSendPngRect(rfbClientPtr cl, int w, int h);
-#endif
-
-/*
- * Tight encoding implementation.
- */
-
-int
-rfbNumCodedRectsTight(rfbClientPtr cl,
-                      int x,
-                      int y,
-                      int w,
-                      int h)
-{
-    int maxRectSize, maxRectWidth;
-    int subrectMaxWidth, subrectMaxHeight;
-
-    /* No matter how many rectangles we will send if LastRect markers
-       are used to terminate rectangle stream. */
-    if (cl->enableLastRectEncoding && w * h >= MIN_SPLIT_RECT_SIZE)
-        return 0;
-
-    maxRectSize = tightConf[compressLevel].maxRectSize;
-    maxRectWidth = tightConf[compressLevel].maxRectWidth;
-
-    if (w > maxRectWidth || w * h > maxRectSize) {
-        subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
-        subrectMaxHeight = maxRectSize / subrectMaxWidth;
-        return (((w - 1) / maxRectWidth + 1) *
-                ((h - 1) / subrectMaxHeight + 1));
-    } else {
-        return 1;
-    }
-}
-
-rfbBool
-rfbSendRectEncodingTight(rfbClientPtr cl,
-                         int x,
-                         int y,
-                         int w,
-                         int h)
-{
-    cl->tightEncoding = rfbEncodingTight;
-    return SendRectEncodingTight(cl, x, y, w, h);
-}
-
-rfbBool
-rfbSendRectEncodingTightPng(rfbClientPtr cl,
-                         int x,
-                         int y,
-                         int w,
-                         int h)
-{
-    cl->tightEncoding = rfbEncodingTightPng;
-    return SendRectEncodingTight(cl, x, y, w, h);
-}
-
-
-rfbBool
-SendRectEncodingTight(rfbClientPtr cl,
-                         int x,
-                         int y,
-                         int w,
-                         int h)
-{
-    int nMaxRows;
-    uint32_t colorValue;
-    int dx, dy, dw, dh;
-    int x_best, y_best, w_best, h_best;
-    char *fbptr;
-
-    rfbSendUpdateBuf(cl);
-
-    compressLevel = cl->tightCompressLevel;
-    qualityLevel = cl->turboQualityLevel;
-    subsampLevel = cl->turboSubsampLevel;
-
-    /* We only allow compression levels that have a demonstrable performance
-       benefit.  CL 0 with JPEG reduces CPU usage for workloads that have low
-       numbers of unique colors, but the same thing can be accomplished by
-       using CL 0 without JPEG (AKA "Lossless Tight.")  For those same
-       low-color workloads, CL 2 can provide typically 20-40% better
-       compression than CL 1 (with a commensurate increase in CPU usage.)  For
-       high-color workloads, CL 1 should always be used, as higher compression
-       levels increase CPU usage for these workloads without providing any
-       significant reduction in bandwidth. */
-    if (qualityLevel != -1) {
-        if (compressLevel < 1) compressLevel = 1;
-        if (compressLevel > 2) compressLevel = 2;
-    }
-
-    /* With JPEG disabled, CL 2 offers no significant bandwidth savings over
-       CL 1, so we don't include it. */
-    else if (compressLevel > 1) compressLevel = 1;
-
-    /* CL 9 (which maps internally to CL 3) is included mainly for backward
-       compatibility with TightVNC Compression Levels 5-9.  It should be used
-       only in extremely low-bandwidth cases in which it can be shown to have a
-       benefit.  For low-color workloads, it provides typically only 10-20%
-       better compression than CL 2 with JPEG and CL 1 without JPEG, and it
-       uses, on average, twice as much CPU time. */
-    if (cl->tightCompressLevel == 9) compressLevel = 3;
-
-    if ( cl->format.depth == 24 && cl->format.redMax == 0xFF &&
-         cl->format.greenMax == 0xFF && cl->format.blueMax == 0xFF ) {
-        usePixelFormat24 = TRUE;
-    } else {
-        usePixelFormat24 = FALSE;
-    }
-
-    if (!cl->enableLastRectEncoding || w * h < MIN_SPLIT_RECT_SIZE)
-        return SendRectSimple(cl, x, y, w, h);
-
-    /* Make sure we can write at least one pixel into tightBeforeBuf. */
-
-    if (tightBeforeBufSize < 4) {
-        tightBeforeBufSize = 4;
-        if (tightBeforeBuf == NULL)
-            tightBeforeBuf = (char *)malloc(tightBeforeBufSize);
-        else
-            tightBeforeBuf = (char *)realloc(tightBeforeBuf,
-                                             tightBeforeBufSize);
-    }
-
-    /* Calculate maximum number of rows in one non-solid rectangle. */
-
-    {
-        int maxRectSize, maxRectWidth, nMaxWidth;
-
-        maxRectSize = tightConf[compressLevel].maxRectSize;
-        maxRectWidth = tightConf[compressLevel].maxRectWidth;
-        nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
-        nMaxRows = maxRectSize / nMaxWidth;
-    }
-
-    /* Try to find large solid-color areas and send them separately. */
-
-    for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) {
-
-        /* If a rectangle becomes too large, send its upper part now. */
-
-        if (dy - y >= nMaxRows) {
-            if (!SendRectSimple(cl, x, y, w, nMaxRows))
-                return 0;
-            y += nMaxRows;
-            h -= nMaxRows;
-        }
-
-        dh = (dy + MAX_SPLIT_TILE_SIZE <= y + h) ?
-             MAX_SPLIT_TILE_SIZE : (y + h - dy);
-
-        for (dx = x; dx < x + w; dx += MAX_SPLIT_TILE_SIZE) {
-
-            dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w) ?
-                 MAX_SPLIT_TILE_SIZE : (x + w - dx);
-
-            if (CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, FALSE)) {
-
-                if (subsampLevel == TJ_GRAYSCALE && qualityLevel != -1) {
-                    uint32_t r = (colorValue >> 16) & 0xFF;
-                    uint32_t g = (colorValue >> 8) & 0xFF;
-                    uint32_t b = (colorValue) & 0xFF;
-                    double y = (0.257 * (double)r) + (0.504 * (double)g)
-                             + (0.098 * (double)b) + 16.;
-                    colorValue = (int)y + (((int)y) << 8) + (((int)y) << 16);
-                }
-
-                /* Get dimensions of solid-color area. */
-
-                FindBestSolidArea(cl, dx, dy, w - (dx - x), h - (dy - y),
-				  colorValue, &w_best, &h_best);
-
-                /* Make sure a solid rectangle is large enough
-                   (or the whole rectangle is of the same color). */
-
-                if ( w_best * h_best != w * h &&
-                     w_best * h_best < MIN_SOLID_SUBRECT_SIZE )
-                    continue;
-
-                /* Try to extend solid rectangle to maximum size. */
-
-                x_best = dx; y_best = dy;
-                ExtendSolidArea(cl, x, y, w, h, colorValue,
-                                &x_best, &y_best, &w_best, &h_best);
-
-                /* Send rectangles at top and left to solid-color area. */
-
-                if ( y_best != y &&
-                     !SendRectSimple(cl, x, y, w, y_best-y) )
-                    return FALSE;
-                if ( x_best != x &&
-                     !SendRectEncodingTight(cl, x, y_best,
-                                               x_best-x, h_best) )
-                    return FALSE;
-
-                /* Send solid-color rectangle. */
-
-                if (!SendTightHeader(cl, x_best, y_best, w_best, h_best))
-                    return FALSE;
-
-                fbptr = (cl->scaledScreen->frameBuffer +
-                         (cl->scaledScreen->paddedWidthInBytes * y_best) +
-                         (x_best * (cl->scaledScreen->bitsPerPixel / 8)));
-
-                (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,
-                                   &cl->format, fbptr, tightBeforeBuf,
-                                   cl->scaledScreen->paddedWidthInBytes, 1, 1);
-
-                if (!SendSolidRect(cl))
-                    return FALSE;
-
-                /* Send remaining rectangles (at right and bottom). */
-
-                if ( x_best + w_best != x + w &&
-                     !SendRectEncodingTight(cl, x_best + w_best, y_best,
-                                               w - (x_best-x) - w_best, h_best) )
-                    return FALSE;
-                if ( y_best + h_best != y + h &&
-                     !SendRectEncodingTight(cl, x, y_best + h_best,
-                                               w, h - (y_best-y) - h_best) )
-                    return FALSE;
-
-                /* Return after all recursive calls are done. */
-
-                return TRUE;
-            }
-
-        }
-
-    }
-
-    /* No suitable solid-color rectangles found. */
-
-    return SendRectSimple(cl, x, y, w, h);
-}
-
-
-static void
-FindBestSolidArea(rfbClientPtr cl,
-                  int x,
-                  int y,
-                  int w,
-                  int h,
-                  uint32_t colorValue,
-                  int *w_ptr,
-                  int *h_ptr)
-{
-    int dx, dy, dw, dh;
-    int w_prev;
-    int w_best = 0, h_best = 0;
-
-    w_prev = w;
-
-    for (dy = y; dy < y + h; dy += MAX_SPLIT_TILE_SIZE) {
-
-        dh = (dy + MAX_SPLIT_TILE_SIZE <= y + h) ?
-             MAX_SPLIT_TILE_SIZE : (y + h - dy);
-        dw = (w_prev > MAX_SPLIT_TILE_SIZE) ?
-             MAX_SPLIT_TILE_SIZE : w_prev;
-
-        if (!CheckSolidTile(cl, x, dy, dw, dh, &colorValue, TRUE))
-            break;
-
-        for (dx = x + dw; dx < x + w_prev;) {
-            dw = (dx + MAX_SPLIT_TILE_SIZE <= x + w_prev) ?
-                 MAX_SPLIT_TILE_SIZE : (x + w_prev - dx);
-            if (!CheckSolidTile(cl, dx, dy, dw, dh, &colorValue, TRUE))
-                break;
-	    dx += dw;
-        }
-
-        w_prev = dx - x;
-        if (w_prev * (dy + dh - y) > w_best * h_best) {
-            w_best = w_prev;
-            h_best = dy + dh - y;
-        }
-    }
-
-    *w_ptr = w_best;
-    *h_ptr = h_best;
-}
-
-
-static void
-ExtendSolidArea(rfbClientPtr cl,
-                int x,
-                int y,
-                int w,
-                int h,
-                uint32_t colorValue,
-                int *x_ptr,
-                int *y_ptr,
-                int *w_ptr,
-                int *h_ptr)
-{
-    int cx, cy;
-
-    /* Try to extend the area upwards. */
-    for ( cy = *y_ptr - 1;
-          cy >= y && CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
-          cy-- );
-    *h_ptr += *y_ptr - (cy + 1);
-    *y_ptr = cy + 1;
-
-    /* ... downwards. */
-    for ( cy = *y_ptr + *h_ptr;
-          cy < y + h &&
-              CheckSolidTile(cl, *x_ptr, cy, *w_ptr, 1, &colorValue, TRUE);
-          cy++ );
-    *h_ptr += cy - (*y_ptr + *h_ptr);
-
-    /* ... to the left. */
-    for ( cx = *x_ptr - 1;
-          cx >= x && CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
-          cx-- );
-    *w_ptr += *x_ptr - (cx + 1);
-    *x_ptr = cx + 1;
-
-    /* ... to the right. */
-    for ( cx = *x_ptr + *w_ptr;
-          cx < x + w &&
-              CheckSolidTile(cl, cx, *y_ptr, 1, *h_ptr, &colorValue, TRUE);
-          cx++ );
-    *w_ptr += cx - (*x_ptr + *w_ptr);
-}
-
-
-/*
- * Check if a rectangle is all of the same color. If needSameColor is
- * set to non-zero, then also check that its color equals to the
- * *colorPtr value. The result is 1 if the test is successfull, and in
- * that case new color will be stored in *colorPtr.
- */
-
-static rfbBool CheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, uint32_t* colorPtr, rfbBool needSameColor)
-{
-    switch(cl->screen->serverFormat.bitsPerPixel) {
-    case 32:
-        return CheckSolidTile32(cl, x, y, w, h, colorPtr, needSameColor);
-    case 16:
-        return CheckSolidTile16(cl, x, y, w, h, colorPtr, needSameColor);
-    default:
-        return CheckSolidTile8(cl, x, y, w, h, colorPtr, needSameColor);
-    }
-}
-
-
-#define DEFINE_CHECK_SOLID_FUNCTION(bpp)                                      \
-                                                                              \
-static rfbBool                                                                \
-CheckSolidTile##bpp(rfbClientPtr cl, int x, int y, int w, int h,              \
-		uint32_t* colorPtr, rfbBool needSameColor)                    \
-{                                                                             \
-    uint##bpp##_t *fbptr;                                                     \
-    uint##bpp##_t colorValue;                                                 \
-    int dx, dy;                                                               \
-                                                                              \
-    fbptr = (uint##bpp##_t *)&cl->scaledScreen->frameBuffer                   \
-        [y * cl->scaledScreen->paddedWidthInBytes + x * (bpp/8)];             \
-                                                                              \
-    colorValue = *fbptr;                                                      \
-    if (needSameColor && (uint32_t)colorValue != *colorPtr)                   \
-        return FALSE;                                                         \
-                                                                              \
-    for (dy = 0; dy < h; dy++) {                                              \
-        for (dx = 0; dx < w; dx++) {                                          \
-            if (colorValue != fbptr[dx])                                      \
-                return FALSE;                                                 \
-        }                                                                     \
-        fbptr = (uint##bpp##_t *)((uint8_t *)fbptr                            \
-                 + cl->scaledScreen->paddedWidthInBytes);                     \
-    }                                                                         \
-                                                                              \
-    *colorPtr = (uint32_t)colorValue;                                         \
-    return TRUE;                                                              \
-}
-
-DEFINE_CHECK_SOLID_FUNCTION(8)
-DEFINE_CHECK_SOLID_FUNCTION(16)
-DEFINE_CHECK_SOLID_FUNCTION(32)
-
-static rfbBool
-SendRectSimple(rfbClientPtr cl, int x, int y, int w, int h)
-{
-    int maxBeforeSize, maxAfterSize;
-    int maxRectSize, maxRectWidth;
-    int subrectMaxWidth, subrectMaxHeight;
-    int dx, dy;
-    int rw, rh;
-
-    maxRectSize = tightConf[compressLevel].maxRectSize;
-    maxRectWidth = tightConf[compressLevel].maxRectWidth;
-
-    maxBeforeSize = maxRectSize * (cl->format.bitsPerPixel / 8);
-    maxAfterSize = maxBeforeSize + (maxBeforeSize + 99) / 100 + 12;
-
-    if (tightBeforeBufSize < maxBeforeSize) {
-        tightBeforeBufSize = maxBeforeSize;
-        if (tightBeforeBuf == NULL)
-            tightBeforeBuf = (char *)malloc(tightBeforeBufSize);
-        else
-            tightBeforeBuf = (char *)realloc(tightBeforeBuf,
-                                             tightBeforeBufSize);
-    }
-
-    if (tightAfterBufSize < maxAfterSize) {
-        tightAfterBufSize = maxAfterSize;
-        if (tightAfterBuf == NULL)
-            tightAfterBuf = (char *)malloc(tightAfterBufSize);
-        else
-            tightAfterBuf = (char *)realloc(tightAfterBuf,
-                                            tightAfterBufSize);
-    }
-
-    if (w > maxRectWidth || w * h > maxRectSize) {
-        subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
-        subrectMaxHeight = maxRectSize / subrectMaxWidth;
-
-        for (dy = 0; dy < h; dy += subrectMaxHeight) {
-            for (dx = 0; dx < w; dx += maxRectWidth) {
-                rw = (dx + maxRectWidth < w) ? maxRectWidth : w - dx;
-                rh = (dy + subrectMaxHeight < h) ? subrectMaxHeight : h - dy;
-                if (!SendSubrect(cl, x + dx, y + dy, rw, rh))
-                    return FALSE;
-            }
-        }
-    } else {
-        if (!SendSubrect(cl, x, y, w, h))
-            return FALSE;
-    }
-
-    return TRUE;
-}
-
-static rfbBool
-SendSubrect(rfbClientPtr cl,
-            int x,
-            int y,
-            int w,
-            int h)
-{
-    char *fbptr;
-    rfbBool success = FALSE;
-
-    /* Send pending data if there is more than 128 bytes. */
-    if (cl->ublen > 128) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    if (!SendTightHeader(cl, x, y, w, h))
-        return FALSE;
-
-    fbptr = (cl->scaledScreen->frameBuffer
-             + (cl->scaledScreen->paddedWidthInBytes * y)
-             + (x * (cl->scaledScreen->bitsPerPixel / 8)));
-
-    if (subsampLevel == TJ_GRAYSCALE && qualityLevel != -1)
-        return SendJpegRect(cl, x, y, w, h, qualityLevel);
-
-    paletteMaxColors = w * h / tightConf[compressLevel].idxMaxColorsDivisor;
-    if(qualityLevel != -1)
-        paletteMaxColors = tightConf[compressLevel].palMaxColorsWithJPEG;
-    if ( paletteMaxColors < 2 &&
-         w * h >= tightConf[compressLevel].monoMinRectSize ) {
-        paletteMaxColors = 2;
-    }
-
-    if (cl->format.bitsPerPixel == cl->screen->serverFormat.bitsPerPixel &&
-        cl->format.redMax == cl->screen->serverFormat.redMax &&
-        cl->format.greenMax == cl->screen->serverFormat.greenMax && 
-        cl->format.blueMax == cl->screen->serverFormat.blueMax &&
-        cl->format.bitsPerPixel >= 16) {
-
-        /* This is so we can avoid translating the pixels when compressing
-           with JPEG, since it is unnecessary */
-        switch (cl->format.bitsPerPixel) {
-        case 16:
-            FastFillPalette16(cl, (uint16_t *)fbptr, w,
-                              cl->scaledScreen->paddedWidthInBytes / 2, h);
-            break;
-        default:
-            FastFillPalette32(cl, (uint32_t *)fbptr, w,
-                              cl->scaledScreen->paddedWidthInBytes / 4, h);
-        }
-
-        if(paletteNumColors != 0 || qualityLevel == -1) {
-            (*cl->translateFn)(cl->translateLookupTable,
-                               &cl->screen->serverFormat, &cl->format, fbptr,
-                               tightBeforeBuf,
-                               cl->scaledScreen->paddedWidthInBytes, w, h);
-        }
-    }
-    else {
-        (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,
-                           &cl->format, fbptr, tightBeforeBuf,
-                           cl->scaledScreen->paddedWidthInBytes, w, h);
-
-        switch (cl->format.bitsPerPixel) {
-        case 8:
-            FillPalette8(w * h);
-            break;
-        case 16:
-            FillPalette16(w * h);
-            break;
-        default:
-            FillPalette32(w * h);
-        }
-    }
-
-    switch (paletteNumColors) {
-    case 0:
-        /* Truecolor image */
-        if (qualityLevel != -1) {
-            success = SendJpegRect(cl, x, y, w, h, qualityLevel);
-        } else {
-            success = SendFullColorRect(cl, x, y, w, h);
-        }
-        break;
-    case 1:
-        /* Solid rectangle */
-        success = SendSolidRect(cl);
-        break;
-    case 2:
-        /* Two-color rectangle */
-        success = SendMonoRect(cl, x, y, w, h);
-        break;
-    default:
-        /* Up to 256 different colors */
-        success = SendIndexedRect(cl, x, y, w, h);
-    }
-    return success;
-}
-
-static rfbBool
-SendTightHeader(rfbClientPtr cl,
-                int x,
-                int y,
-                int w,
-                int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(cl->tightEncoding);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-           sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    rfbStatRecordEncodingSent(cl, cl->tightEncoding,
-                              sz_rfbFramebufferUpdateRectHeader,
-                              sz_rfbFramebufferUpdateRectHeader
-                                  + w * (cl->format.bitsPerPixel / 8) * h);
-
-    return TRUE;
-}
-
-/*
- * Subencoding implementations.
- */
-
-static rfbBool
-SendSolidRect(rfbClientPtr cl)
-{
-    int len;
-
-    if (usePixelFormat24) {
-        Pack24(cl, tightBeforeBuf, &cl->format, 1);
-        len = 3;
-    } else
-        len = cl->format.bitsPerPixel / 8;
-
-    if (cl->ublen + 1 + len > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    cl->updateBuf[cl->ublen++] = (char)(rfbTightFill << 4);
-    memcpy (&cl->updateBuf[cl->ublen], tightBeforeBuf, len);
-    cl->ublen += len;
-
-    rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, len + 1);
-
-    return TRUE;
-}
-
-static rfbBool
-SendMonoRect(rfbClientPtr cl,
-             int x,
-             int y,
-             int w,
-             int h)
-{
-    int streamId = 1;
-    int paletteLen, dataLen;
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-    if (CanSendPngRect(cl, w, h)) {
-        /* TODO: setup palette maybe */
-        return SendPngRect(cl, x, y, w, h);
-        /* TODO: destroy palette maybe */
-    }
-#endif
-
-    if ( cl->ublen + TIGHT_MIN_TO_COMPRESS + 6 +
-	 2 * cl->format.bitsPerPixel / 8 > UPDATE_BUF_SIZE ) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    /* Prepare tight encoding header. */
-    dataLen = (w + 7) / 8;
-    dataLen *= h;
-
-    if (tightConf[compressLevel].monoZlibLevel == 0 &&
-        cl->tightEncoding != rfbEncodingTightPng)
-        cl->updateBuf[cl->ublen++] =
-            (char)((rfbTightNoZlib | rfbTightExplicitFilter) << 4);
-    else
-        cl->updateBuf[cl->ublen++] = (streamId | rfbTightExplicitFilter) << 4;
-    cl->updateBuf[cl->ublen++] = rfbTightFilterPalette;
-    cl->updateBuf[cl->ublen++] = 1;
-
-    /* Prepare palette, convert image. */
-    switch (cl->format.bitsPerPixel) {
-
-    case 32:
-        EncodeMonoRect32((uint8_t *)tightBeforeBuf, w, h);
-
-        ((uint32_t *)tightAfterBuf)[0] = monoBackground;
-        ((uint32_t *)tightAfterBuf)[1] = monoForeground;
-        if (usePixelFormat24) {
-            Pack24(cl, tightAfterBuf, &cl->format, 2);
-            paletteLen = 6;
-        } else
-            paletteLen = 8;
-
-        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, paletteLen);
-        cl->ublen += paletteLen;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 3 + paletteLen);
-        break;
-
-    case 16:
-        EncodeMonoRect16((uint8_t *)tightBeforeBuf, w, h);
-
-        ((uint16_t *)tightAfterBuf)[0] = (uint16_t)monoBackground;
-        ((uint16_t *)tightAfterBuf)[1] = (uint16_t)monoForeground;
-
-        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, 4);
-        cl->ublen += 4;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 7);
-        break;
-
-    default:
-        EncodeMonoRect8((uint8_t *)tightBeforeBuf, w, h);
-
-        cl->updateBuf[cl->ublen++] = (char)monoBackground;
-        cl->updateBuf[cl->ublen++] = (char)monoForeground;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 5);
-    }
-
-    return CompressData(cl, streamId, dataLen,
-                        tightConf[compressLevel].monoZlibLevel,
-                        Z_DEFAULT_STRATEGY);
-}
-
-static rfbBool
-SendIndexedRect(rfbClientPtr cl,
-                int x,
-                int y,
-                int w,
-                int h)
-{
-    int streamId = 2;
-    int i, entryLen;
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-    if (CanSendPngRect(cl, w, h)) {
-        return SendPngRect(cl, x, y, w, h);
-    }
-#endif
-
-    if ( cl->ublen + TIGHT_MIN_TO_COMPRESS + 6 +
-	 paletteNumColors * cl->format.bitsPerPixel / 8 >
-         UPDATE_BUF_SIZE ) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    /* Prepare tight encoding header. */
-    if (tightConf[compressLevel].idxZlibLevel == 0 &&
-        cl->tightEncoding != rfbEncodingTightPng)
-        cl->updateBuf[cl->ublen++] =
-            (char)((rfbTightNoZlib | rfbTightExplicitFilter) << 4);
-    else
-        cl->updateBuf[cl->ublen++] = (streamId | rfbTightExplicitFilter) << 4;
-    cl->updateBuf[cl->ublen++] = rfbTightFilterPalette;
-    cl->updateBuf[cl->ublen++] = (char)(paletteNumColors - 1);
-
-    /* Prepare palette, convert image. */
-    switch (cl->format.bitsPerPixel) {
-
-    case 32:
-        EncodeIndexedRect32((uint8_t *)tightBeforeBuf, w * h);
-
-        for (i = 0; i < paletteNumColors; i++) {
-            ((uint32_t *)tightAfterBuf)[i] =
-                palette.entry[i].listNode->rgb;
-        }
-        if (usePixelFormat24) {
-            Pack24(cl, tightAfterBuf, &cl->format, paletteNumColors);
-            entryLen = 3;
-        } else
-            entryLen = 4;
-
-        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf,
-               paletteNumColors * entryLen);
-        cl->ublen += paletteNumColors * entryLen;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding,
-                                     3 + paletteNumColors * entryLen);
-        break;
-
-    case 16:
-        EncodeIndexedRect16((uint8_t *)tightBeforeBuf, w * h);
-
-        for (i = 0; i < paletteNumColors; i++) {
-            ((uint16_t *)tightAfterBuf)[i] =
-                (uint16_t)palette.entry[i].listNode->rgb;
-        }
-
-        memcpy(&cl->updateBuf[cl->ublen], tightAfterBuf, paletteNumColors * 2);
-        cl->ublen += paletteNumColors * 2;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding,
-                                     3 + paletteNumColors * 2);
-        break;
-
-    default:
-        return FALSE;           /* Should never happen. */
-    }
-
-    return CompressData(cl, streamId, w * h,
-                        tightConf[compressLevel].idxZlibLevel,
-                        Z_DEFAULT_STRATEGY);
-}
-
-static rfbBool
-SendFullColorRect(rfbClientPtr cl,
-                  int x,
-                  int y,
-                  int w,
-                  int h)
-{
-    int streamId = 0;
-    int len;
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-    if (CanSendPngRect(cl, w, h)) {
-        return SendPngRect(cl, x, y, w, h);
-    }
-#endif
-
-    if (cl->ublen + TIGHT_MIN_TO_COMPRESS + 1 > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    if (tightConf[compressLevel].rawZlibLevel == 0 &&
-        cl->tightEncoding != rfbEncodingTightPng)
-        cl->updateBuf[cl->ublen++] = (char)(rfbTightNoZlib << 4);
-    else
-        cl->updateBuf[cl->ublen++] = 0x00;  /* stream id = 0, no flushing, no filter */
-    rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 1);
-
-    if (usePixelFormat24) {
-        Pack24(cl, tightBeforeBuf, &cl->format, w * h);
-        len = 3;
-    } else
-        len = cl->format.bitsPerPixel / 8;
-
-    return CompressData(cl, streamId, w * h * len,
-                        tightConf[compressLevel].rawZlibLevel,
-                        Z_DEFAULT_STRATEGY);
-}
-
-static rfbBool
-CompressData(rfbClientPtr cl,
-             int streamId,
-             int dataLen,
-             int zlibLevel,
-             int zlibStrategy)
-{
-    z_streamp pz;
-    int err;
-
-    if (dataLen < TIGHT_MIN_TO_COMPRESS) {
-        memcpy(&cl->updateBuf[cl->ublen], tightBeforeBuf, dataLen);
-        cl->ublen += dataLen;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, dataLen);
-        return TRUE;
-    }
-
-    if (zlibLevel == 0)
-        return SendCompressedData (cl, tightBeforeBuf, dataLen);
-
-    pz = &cl->zsStruct[streamId];
-
-    /* Initialize compression stream if needed. */
-    if (!cl->zsActive[streamId]) {
-        pz->zalloc = Z_NULL;
-        pz->zfree = Z_NULL;
-        pz->opaque = Z_NULL;
-
-        err = deflateInit2 (pz, zlibLevel, Z_DEFLATED, MAX_WBITS,
-                            MAX_MEM_LEVEL, zlibStrategy);
-        if (err != Z_OK)
-            return FALSE;
-
-        cl->zsActive[streamId] = TRUE;
-        cl->zsLevel[streamId] = zlibLevel;
-    }
-
-    /* Prepare buffer pointers. */
-    pz->next_in = (Bytef *)tightBeforeBuf;
-    pz->avail_in = dataLen;
-    pz->next_out = (Bytef *)tightAfterBuf;
-    pz->avail_out = tightAfterBufSize;
-
-    /* Change compression parameters if needed. */
-    if (zlibLevel != cl->zsLevel[streamId]) {
-        if (deflateParams (pz, zlibLevel, zlibStrategy) != Z_OK) {
-            return FALSE;
-        }
-        cl->zsLevel[streamId] = zlibLevel;
-    }
-
-    /* Actual compression. */
-    if (deflate(pz, Z_SYNC_FLUSH) != Z_OK ||
-        pz->avail_in != 0 || pz->avail_out == 0) {
-        return FALSE;
-    }
-
-    return SendCompressedData(cl, tightAfterBuf,
-                              tightAfterBufSize - pz->avail_out);
-}
-
-static rfbBool SendCompressedData(rfbClientPtr cl, char *buf,
-                                  int compressedLen)
-{
-    int i, portionLen;
-
-    cl->updateBuf[cl->ublen++] = compressedLen & 0x7F;
-    rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 1);
-    if (compressedLen > 0x7F) {
-        cl->updateBuf[cl->ublen-1] |= 0x80;
-        cl->updateBuf[cl->ublen++] = compressedLen >> 7 & 0x7F;
-        rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 1);
-        if (compressedLen > 0x3FFF) {
-            cl->updateBuf[cl->ublen-1] |= 0x80;
-            cl->updateBuf[cl->ublen++] = compressedLen >> 14 & 0xFF;
-            rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 1);
-        }
-    }
-
-    portionLen = UPDATE_BUF_SIZE;
-    for (i = 0; i < compressedLen; i += portionLen) {
-        if (i + portionLen > compressedLen) {
-            portionLen = compressedLen - i;
-        }
-        if (cl->ublen + portionLen > UPDATE_BUF_SIZE) {
-            if (!rfbSendUpdateBuf(cl))
-                return FALSE;
-        }
-        memcpy(&cl->updateBuf[cl->ublen], &buf[i], portionLen);
-        cl->ublen += portionLen;
-    }
-    rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, compressedLen);
-
-    return TRUE;
-}
-
-
-/*
- * Code to determine how many different colors used in rectangle.
- */
-
-static void
-FillPalette8(int count)
-{
-    uint8_t *data = (uint8_t *)tightBeforeBuf;
-    uint8_t c0, c1;
-    int i, n0, n1;
-
-    paletteNumColors = 0;
-
-    c0 = data[0];
-    for (i = 1; i < count && data[i] == c0; i++);
-    if (i == count) {
-        paletteNumColors = 1;
-        return;                 /* Solid rectangle */
-    }
-
-    if (paletteMaxColors < 2)
-        return;
-
-    n0 = i;
-    c1 = data[i];
-    n1 = 0;
-    for (i++; i < count; i++) {
-        if (data[i] == c0) {
-            n0++;
-        } else if (data[i] == c1) {
-            n1++;
-        } else
-            break;
-    }
-    if (i == count) {
-        if (n0 > n1) {
-            monoBackground = (uint32_t)c0;
-            monoForeground = (uint32_t)c1;
-        } else {
-            monoBackground = (uint32_t)c1;
-            monoForeground = (uint32_t)c0;
-        }
-        paletteNumColors = 2;   /* Two colors */
-    }
-}
-
-
-#define DEFINE_FILL_PALETTE_FUNCTION(bpp)                               \
-                                                                        \
-static void                                                             \
-FillPalette##bpp(int count) {                                           \
-    uint##bpp##_t *data = (uint##bpp##_t *)tightBeforeBuf;              \
-    uint##bpp##_t c0, c1, ci;                                           \
-    int i, n0, n1, ni;                                                  \
-                                                                        \
-    c0 = data[0];                                                       \
-    for (i = 1; i < count && data[i] == c0; i++);                       \
-    if (i >= count) {                                                   \
-        paletteNumColors = 1;   /* Solid rectangle */                   \
-        return;                                                         \
-    }                                                                   \
-                                                                        \
-    if (paletteMaxColors < 2) {                                         \
-        paletteNumColors = 0;   /* Full-color encoding preferred */     \
-        return;                                                         \
-    }                                                                   \
-                                                                        \
-    n0 = i;                                                             \
-    c1 = data[i];                                                       \
-    n1 = 0;                                                             \
-    for (i++; i < count; i++) {                                         \
-        ci = data[i];                                                   \
-        if (ci == c0) {                                                 \
-            n0++;                                                       \
-        } else if (ci == c1) {                                          \
-            n1++;                                                       \
-        } else                                                          \
-            break;                                                      \
-    }                                                                   \
-    if (i >= count) {                                                   \
-        if (n0 > n1) {                                                  \
-            monoBackground = (uint32_t)c0;                              \
-            monoForeground = (uint32_t)c1;                              \
-        } else {                                                        \
-            monoBackground = (uint32_t)c1;                              \
-            monoForeground = (uint32_t)c0;                              \
-        }                                                               \
-        paletteNumColors = 2;   /* Two colors */                        \
-        return;                                                         \
-    }                                                                   \
-                                                                        \
-    PaletteReset();                                                     \
-    PaletteInsert (c0, (uint32_t)n0, bpp);                              \
-    PaletteInsert (c1, (uint32_t)n1, bpp);                              \
-                                                                        \
-    ni = 1;                                                             \
-    for (i++; i < count; i++) {                                         \
-        if (data[i] == ci) {                                            \
-            ni++;                                                       \
-        } else {                                                        \
-            if (!PaletteInsert (ci, (uint32_t)ni, bpp))                 \
-                return;                                                 \
-            ci = data[i];                                               \
-            ni = 1;                                                     \
-        }                                                               \
-    }                                                                   \
-    PaletteInsert (ci, (uint32_t)ni, bpp);                              \
-}
-
-DEFINE_FILL_PALETTE_FUNCTION(16)
-DEFINE_FILL_PALETTE_FUNCTION(32)
-
-#define DEFINE_FAST_FILL_PALETTE_FUNCTION(bpp)                          \
-                                                                        \
-static void                                                             \
-FastFillPalette##bpp(rfbClientPtr cl, uint##bpp##_t *data, int w,       \
-                     int pitch, int h)                                  \
-{                                                                       \
-    uint##bpp##_t c0, c1, ci, mask, c0t, c1t, cit;                      \
-    int i, j, i2 = 0, j2, n0, n1, ni;                                   \
-                                                                        \
-    if (cl->translateFn != rfbTranslateNone) {                          \
-        mask = cl->screen->serverFormat.redMax                          \
-            << cl->screen->serverFormat.redShift;                       \
-        mask |= cl->screen->serverFormat.greenMax                       \
-             << cl->screen->serverFormat.greenShift;                    \
-        mask |= cl->screen->serverFormat.blueMax                        \
-             << cl->screen->serverFormat.blueShift;                     \
-    } else mask = ~0;                                                   \
-                                                                        \
-    c0 = data[0] & mask;                                                \
-    for (j = 0; j < h; j++) {                                           \
-        for (i = 0; i < w; i++) {                                       \
-            if ((data[j * pitch + i] & mask) != c0)                     \
-                goto done;                                              \
-        }                                                               \
-    }                                                                   \
-    done:                                                               \
-    if (j >= h) {                                                       \
-        paletteNumColors = 1;   /* Solid rectangle */                   \
-        return;                                                         \
-    }                                                                   \
-    if (paletteMaxColors < 2) {                                         \
-        paletteNumColors = 0;   /* Full-color encoding preferred */     \
-        return;                                                         \
-    }                                                                   \
-                                                                        \
-    n0 = j * w + i;                                                     \
-    c1 = data[j * pitch + i] & mask;                                    \
-    n1 = 0;                                                             \
-    i++;  if (i >= w) {i = 0;  j++;}                                    \
-    for (j2 = j; j2 < h; j2++) {                                        \
-        for (i2 = i; i2 < w; i2++) {                                    \
-            ci = data[j2 * pitch + i2] & mask;                          \
-            if (ci == c0) {                                             \
-                n0++;                                                   \
-            } else if (ci == c1) {                                      \
-                n1++;                                                   \
-            } else                                                      \
-                goto done2;                                             \
-        }                                                               \
-        i = 0;                                                          \
-    }                                                                   \
-    done2:                                                              \
-    (*cl->translateFn)(cl->translateLookupTable,                        \
-                       &cl->screen->serverFormat, &cl->format,          \
-                       (char *)&c0, (char *)&c0t, bpp/8, 1, 1);         \
-    (*cl->translateFn)(cl->translateLookupTable,                        \
-                       &cl->screen->serverFormat, &cl->format,          \
-                       (char *)&c1, (char *)&c1t, bpp/8, 1, 1);         \
-    if (j2 >= h) {                                                      \
-        if (n0 > n1) {                                                  \
-            monoBackground = (uint32_t)c0t;                             \
-            monoForeground = (uint32_t)c1t;                             \
-        } else {                                                        \
-            monoBackground = (uint32_t)c1t;                             \
-            monoForeground = (uint32_t)c0t;                             \
-        }                                                               \
-        paletteNumColors = 2;   /* Two colors */                        \
-        return;                                                         \
-    }                                                                   \
-                                                                        \
-    PaletteReset();                                                     \
-    PaletteInsert (c0t, (uint32_t)n0, bpp);                             \
-    PaletteInsert (c1t, (uint32_t)n1, bpp);                             \
-                                                                        \
-    ni = 1;                                                             \
-    i2++;  if (i2 >= w) {i2 = 0;  j2++;}                                \
-    for (j = j2; j < h; j++) {                                          \
-        for (i = i2; i < w; i++) {                                      \
-            if ((data[j * pitch + i] & mask) == ci) {                   \
-                ni++;                                                   \
-            } else {                                                    \
-                (*cl->translateFn)(cl->translateLookupTable,            \
-                                   &cl->screen->serverFormat,           \
-                                   &cl->format, (char *)&ci,            \
-                                   (char *)&cit, bpp/8, 1, 1);          \
-                if (!PaletteInsert (cit, (uint32_t)ni, bpp))            \
-                    return;                                             \
-                ci = data[j * pitch + i] & mask;                        \
-                ni = 1;                                                 \
-            }                                                           \
-        }                                                               \
-        i2 = 0;                                                         \
-    }                                                                   \
-                                                                        \
-    (*cl->translateFn)(cl->translateLookupTable,                        \
-                       &cl->screen->serverFormat, &cl->format,          \
-                       (char *)&ci, (char *)&cit, bpp/8, 1, 1);         \
-    PaletteInsert (cit, (uint32_t)ni, bpp);                             \
-}
-
-DEFINE_FAST_FILL_PALETTE_FUNCTION(16)
-DEFINE_FAST_FILL_PALETTE_FUNCTION(32)
-
-
-/*
- * Functions to operate with palette structures.
- */
-
-#define HASH_FUNC16(rgb) ((int)((((rgb) >> 8) + (rgb)) & 0xFF))
-#define HASH_FUNC32(rgb) ((int)((((rgb) >> 16) + ((rgb) >> 8)) & 0xFF))
-
-
-static void
-PaletteReset(void)
-{
-    paletteNumColors = 0;
-    memset(palette.hash, 0, 256 * sizeof(COLOR_LIST *));
-}
-
-
-static int
-PaletteInsert(uint32_t rgb,
-              int numPixels,
-              int bpp)
-{
-    COLOR_LIST *pnode;
-    COLOR_LIST *prev_pnode = NULL;
-    int hash_key, idx, new_idx, count;
-
-    hash_key = (bpp == 16) ? HASH_FUNC16(rgb) : HASH_FUNC32(rgb);
-
-    pnode = palette.hash[hash_key];
-
-    while (pnode != NULL) {
-        if (pnode->rgb == rgb) {
-            /* Such palette entry already exists. */
-            new_idx = idx = pnode->idx;
-            count = palette.entry[idx].numPixels + numPixels;
-            if (new_idx && palette.entry[new_idx-1].numPixels < count) {
-                do {
-                    palette.entry[new_idx] = palette.entry[new_idx-1];
-                    palette.entry[new_idx].listNode->idx = new_idx;
-                    new_idx--;
-                }
-                while (new_idx && palette.entry[new_idx-1].numPixels < count);
-                palette.entry[new_idx].listNode = pnode;
-                pnode->idx = new_idx;
-            }
-            palette.entry[new_idx].numPixels = count;
-            return paletteNumColors;
-        }
-        prev_pnode = pnode;
-        pnode = pnode->next;
-    }
-
-    /* Check if palette is full. */
-    if (paletteNumColors == 256 || paletteNumColors == paletteMaxColors) {
-        paletteNumColors = 0;
-        return 0;
-    }
-
-    /* Move palette entries with lesser pixel counts. */
-    for ( idx = paletteNumColors;
-          idx > 0 && palette.entry[idx-1].numPixels < numPixels;
-          idx-- ) {
-        palette.entry[idx] = palette.entry[idx-1];
-        palette.entry[idx].listNode->idx = idx;
-    }
-
-    /* Add new palette entry into the freed slot. */
-    pnode = &palette.list[paletteNumColors];
-    if (prev_pnode != NULL) {
-        prev_pnode->next = pnode;
-    } else {
-        palette.hash[hash_key] = pnode;
-    }
-    pnode->next = NULL;
-    pnode->idx = idx;
-    pnode->rgb = rgb;
-    palette.entry[idx].listNode = pnode;
-    palette.entry[idx].numPixels = numPixels;
-
-    return (++paletteNumColors);
-}
-
-
-/*
- * Converting 32-bit color samples into 24-bit colors.
- * Should be called only when redMax, greenMax and blueMax are 255.
- * Color components assumed to be byte-aligned.
- */
-
-static void Pack24(rfbClientPtr cl,
-                   char *buf,
-                   rfbPixelFormat *fmt,
-                   int count)
-{
-    uint32_t *buf32;
-    uint32_t pix;
-    int r_shift, g_shift, b_shift;
-
-    buf32 = (uint32_t *)buf;
-
-    if (!cl->screen->serverFormat.bigEndian == !fmt->bigEndian) {
-        r_shift = fmt->redShift;
-        g_shift = fmt->greenShift;
-        b_shift = fmt->blueShift;
-    } else {
-        r_shift = 24 - fmt->redShift;
-        g_shift = 24 - fmt->greenShift;
-        b_shift = 24 - fmt->blueShift;
-    }
-
-    while (count--) {
-        pix = *buf32++;
-        *buf++ = (char)(pix >> r_shift);
-        *buf++ = (char)(pix >> g_shift);
-        *buf++ = (char)(pix >> b_shift);
-    }
-}
-
-
-/*
- * Converting truecolor samples into palette indices.
- */
-
-#define DEFINE_IDX_ENCODE_FUNCTION(bpp)                                 \
-                                                                        \
-static void                                                             \
-EncodeIndexedRect##bpp(uint8_t *buf, int count) {                       \
-    COLOR_LIST *pnode;                                                  \
-    uint##bpp##_t *src;                                                 \
-    uint##bpp##_t rgb;                                                  \
-    int rep = 0;                                                        \
-                                                                        \
-    src = (uint##bpp##_t *) buf;                                        \
-                                                                        \
-    while (count--) {                                                   \
-        rgb = *src++;                                                   \
-        while (count && *src == rgb) {                                  \
-            rep++, src++, count--;                                      \
-        }                                                               \
-        pnode = palette.hash[HASH_FUNC##bpp(rgb)];                      \
-        while (pnode != NULL) {                                         \
-            if ((uint##bpp##_t)pnode->rgb == rgb) {                     \
-                *buf++ = (uint8_t)pnode->idx;                           \
-                while (rep) {                                           \
-                    *buf++ = (uint8_t)pnode->idx;                       \
-                    rep--;                                              \
-                }                                                       \
-                break;                                                  \
-            }                                                           \
-            pnode = pnode->next;                                        \
-        }                                                               \
-    }                                                                   \
-}
-
-DEFINE_IDX_ENCODE_FUNCTION(16)
-DEFINE_IDX_ENCODE_FUNCTION(32)
-
-
-#define DEFINE_MONO_ENCODE_FUNCTION(bpp)                                \
-                                                                        \
-static void                                                             \
-EncodeMonoRect##bpp(uint8_t *buf, int w, int h) {                       \
-    uint##bpp##_t *ptr;                                                 \
-    uint##bpp##_t bg;                                                   \
-    unsigned int value, mask;                                           \
-    int aligned_width;                                                  \
-    int x, y, bg_bits;                                                  \
-                                                                        \
-    ptr = (uint##bpp##_t *) buf;                                        \
-    bg = (uint##bpp##_t) monoBackground;                                \
-    aligned_width = w - w % 8;                                          \
-                                                                        \
-    for (y = 0; y < h; y++) {                                           \
-        for (x = 0; x < aligned_width; x += 8) {                        \
-            for (bg_bits = 0; bg_bits < 8; bg_bits++) {                 \
-                if (*ptr++ != bg)                                       \
-                    break;                                              \
-            }                                                           \
-            if (bg_bits == 8) {                                         \
-                *buf++ = 0;                                             \
-                continue;                                               \
-            }                                                           \
-            mask = 0x80 >> bg_bits;                                     \
-            value = mask;                                               \
-            for (bg_bits++; bg_bits < 8; bg_bits++) {                   \
-                mask >>= 1;                                             \
-                if (*ptr++ != bg) {                                     \
-                    value |= mask;                                      \
-                }                                                       \
-            }                                                           \
-            *buf++ = (uint8_t)value;                                    \
-        }                                                               \
-                                                                        \
-        mask = 0x80;                                                    \
-        value = 0;                                                      \
-        if (x >= w)                                                     \
-            continue;                                                   \
-                                                                        \
-        for (; x < w; x++) {                                            \
-            if (*ptr++ != bg) {                                         \
-                value |= mask;                                          \
-            }                                                           \
-            mask >>= 1;                                                 \
-        }                                                               \
-        *buf++ = (uint8_t)value;                                        \
-    }                                                                   \
-}
-
-DEFINE_MONO_ENCODE_FUNCTION(8)
-DEFINE_MONO_ENCODE_FUNCTION(16)
-DEFINE_MONO_ENCODE_FUNCTION(32)
-
-
-/*
- * JPEG compression stuff.
- */
-
-static rfbBool
-SendJpegRect(rfbClientPtr cl, int x, int y, int w, int h, int quality)
-{
-    unsigned char *srcbuf;
-    int ps = cl->screen->serverFormat.bitsPerPixel / 8;
-    int subsamp = subsampLevel2tjsubsamp[subsampLevel];
-    unsigned long size = 0;
-    int flags = 0, pitch;
-    unsigned char *tmpbuf = NULL;
-
-    if (cl->screen->serverFormat.bitsPerPixel == 8)
-        return SendFullColorRect(cl, x, y, w, h);
-
-    if (ps < 2) {
-        rfbLog("Error: JPEG requires 16-bit, 24-bit, or 32-bit pixel format.\n");
-        return 0;
-    }
-    if (!j) {
-        if ((j = tjInitCompress()) == NULL) {
-            rfbLog("JPEG Error: %s\n", tjGetErrorStr());
-            return 0;
-        }
-    }
-
-    if (tightAfterBufSize < TJBUFSIZE(w, h)) {
-        if (tightAfterBuf == NULL)
-            tightAfterBuf = (char *)malloc(TJBUFSIZE(w, h));
-        else
-            tightAfterBuf = (char *)realloc(tightAfterBuf,
-                                            TJBUFSIZE(w, h));
-        if (!tightAfterBuf) {
-            rfbLog("Memory allocation failure!\n");
-            return 0;
-        }
-        tightAfterBufSize = TJBUFSIZE(w, h);
-    }
-
-    if (ps == 2) {
-        uint16_t *srcptr, pix;
-        unsigned char *dst;
-        int inRed, inGreen, inBlue, i, j;
-
-        if((tmpbuf = (unsigned char *)malloc(w * h * 3)) == NULL)
-            rfbLog("Memory allocation failure!\n");
-        srcptr = (uint16_t *)&cl->scaledScreen->frameBuffer
-            [y * cl->scaledScreen->paddedWidthInBytes + x * ps];
-        dst = tmpbuf;
-        for(j = 0; j < h; j++) {
-            uint16_t *srcptr2 = srcptr;
-            unsigned char *dst2 = dst;
-            for (i = 0; i < w; i++) {
-                pix = *srcptr2++;
-                inRed = (int) (pix >> cl->screen->serverFormat.redShift
-                               & cl->screen->serverFormat.redMax);
-                inGreen = (int) (pix >> cl->screen->serverFormat.greenShift
-                                 & cl->screen->serverFormat.greenMax);
-                inBlue  = (int) (pix >> cl->screen->serverFormat.blueShift
-                                 & cl->screen->serverFormat.blueMax);
-                *dst2++ = (uint8_t)((inRed * 255
-                                     + cl->screen->serverFormat.redMax / 2)
-                                    / cl->screen->serverFormat.redMax);
-               	*dst2++ = (uint8_t)((inGreen * 255
-                                     + cl->screen->serverFormat.greenMax / 2)
-                                    / cl->screen->serverFormat.greenMax);
-                *dst2++ = (uint8_t)((inBlue * 255
-                                     + cl->screen->serverFormat.blueMax / 2)
-                                    / cl->screen->serverFormat.blueMax);
-            }
-            srcptr += cl->scaledScreen->paddedWidthInBytes / ps;
-            dst += w * 3;
-        }
-        srcbuf = tmpbuf;
-        pitch = w * 3;
-        ps = 3;
-    } else {
-        if (cl->screen->serverFormat.bigEndian && ps == 4)
-            flags |= TJ_ALPHAFIRST;
-        if (cl->screen->serverFormat.redShift == 16
-            && cl->screen->serverFormat.blueShift == 0)
-            flags |= TJ_BGR;
-        if (cl->screen->serverFormat.bigEndian)
-            flags ^= TJ_BGR;
-        pitch = cl->scaledScreen->paddedWidthInBytes;
-        srcbuf = (unsigned char *)&cl->scaledScreen->frameBuffer
-            [y * pitch + x * ps];
-    }
-
-    if (tjCompress(j, srcbuf, w, pitch, h, ps, (unsigned char *)tightAfterBuf,
-                   &size, subsamp, quality, flags) == -1) {
-        rfbLog("JPEG Error: %s\n", tjGetErrorStr());
-        if (tmpbuf) {
-            free(tmpbuf);
-            tmpbuf = NULL;
-        }
-        return 0;
-    }
-
-    if (tmpbuf) {
-        free(tmpbuf);
-        tmpbuf = NULL;
-    }
-
-    if (cl->ublen + TIGHT_MIN_TO_COMPRESS + 1 > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    cl->updateBuf[cl->ublen++] = (char)(rfbTightJpeg << 4);
-    rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 1);
-
-    return SendCompressedData(cl, tightAfterBuf, (int)size);
-}
-
-static void
-PrepareRowForImg(rfbClientPtr cl,
-                  uint8_t *dst,
-                  int x,
-                  int y,
-                  int count)
-{
-    if (cl->screen->serverFormat.bitsPerPixel == 32) {
-        if ( cl->screen->serverFormat.redMax == 0xFF &&
-             cl->screen->serverFormat.greenMax == 0xFF &&
-             cl->screen->serverFormat.blueMax == 0xFF ) {
-            PrepareRowForImg24(cl, dst, x, y, count);
-        } else {
-            PrepareRowForImg32(cl, dst, x, y, count);
-        }
-    } else {
-        /* 16 bpp assumed. */
-        PrepareRowForImg16(cl, dst, x, y, count);
-    }
-}
-
-static void
-PrepareRowForImg24(rfbClientPtr cl,
-                    uint8_t *dst,
-                    int x,
-                    int y,
-                    int count)
-{
-    uint32_t *fbptr;
-    uint32_t pix;
-
-    fbptr = (uint32_t *)
-        &cl->scaledScreen->frameBuffer[y * cl->scaledScreen->paddedWidthInBytes + x * 4];
-
-    while (count--) {
-        pix = *fbptr++;
-        *dst++ = (uint8_t)(pix >> cl->screen->serverFormat.redShift);
-        *dst++ = (uint8_t)(pix >> cl->screen->serverFormat.greenShift);
-        *dst++ = (uint8_t)(pix >> cl->screen->serverFormat.blueShift);
-    }
-}
-
-#define DEFINE_JPEG_GET_ROW_FUNCTION(bpp)                                   \
-                                                                            \
-static void                                                                 \
-PrepareRowForImg##bpp(rfbClientPtr cl, uint8_t *dst, int x, int y, int count) { \
-    uint##bpp##_t *fbptr;                                                   \
-    uint##bpp##_t pix;                                                      \
-    int inRed, inGreen, inBlue;                                             \
-                                                                            \
-    fbptr = (uint##bpp##_t *)                                               \
-        &cl->scaledScreen->frameBuffer[y * cl->scaledScreen->paddedWidthInBytes +       \
-                             x * (bpp / 8)];                                \
-                                                                            \
-    while (count--) {                                                       \
-        pix = *fbptr++;                                                     \
-                                                                            \
-        inRed = (int)                                                       \
-            (pix >> cl->screen->serverFormat.redShift   & cl->screen->serverFormat.redMax); \
-        inGreen = (int)                                                     \
-            (pix >> cl->screen->serverFormat.greenShift & cl->screen->serverFormat.greenMax); \
-        inBlue  = (int)                                                     \
-            (pix >> cl->screen->serverFormat.blueShift  & cl->screen->serverFormat.blueMax); \
-                                                                            \
-	*dst++ = (uint8_t)((inRed   * 255 + cl->screen->serverFormat.redMax / 2) / \
-                         cl->screen->serverFormat.redMax);                  \
-	*dst++ = (uint8_t)((inGreen * 255 + cl->screen->serverFormat.greenMax / 2) / \
-                         cl->screen->serverFormat.greenMax);                \
-	*dst++ = (uint8_t)((inBlue  * 255 + cl->screen->serverFormat.blueMax / 2) / \
-                         cl->screen->serverFormat.blueMax);                 \
-    }                                                                       \
-}
-
-DEFINE_JPEG_GET_ROW_FUNCTION(16)
-DEFINE_JPEG_GET_ROW_FUNCTION(32)
-
-/*
- * PNG compression stuff.
- */
-
-#ifdef LIBVNCSERVER_HAVE_LIBPNG
-
-static TLS int pngDstDataLen = 0;
-
-static rfbBool CanSendPngRect(rfbClientPtr cl, int w, int h) {
-    if (cl->tightEncoding != rfbEncodingTightPng) {
-        return FALSE;
-    }
-
-    if ( cl->screen->serverFormat.bitsPerPixel == 8 ||
-         cl->format.bitsPerPixel == 8) {
-        return FALSE;
-    }
-
-    return TRUE;
-}
-
-static void pngWriteData(png_structp png_ptr, png_bytep data,
-                           png_size_t length)
-{
-#if 0
-    rfbClientPtr cl = png_get_io_ptr(png_ptr);
-
-    buffer_reserve(&vs->tight.png, vs->tight.png.offset + length);
-    memcpy(vs->tight.png.buffer + vs->tight.png.offset, data, length);
-#endif
-    memcpy(tightAfterBuf + pngDstDataLen, data, length);
-
-    pngDstDataLen += length;
-}
-
-static void pngFlushData(png_structp png_ptr)
-{
-}
-
-
-static void *pngMalloc(png_structp png_ptr, png_size_t size)
-{
-    return malloc(size);
-}
-
-static void pngFree(png_structp png_ptr, png_voidp ptr)
-{
-    free(ptr);
-}
-
-static rfbBool SendPngRect(rfbClientPtr cl, int x, int y, int w, int h) {
-    /* rfbLog(">> SendPngRect x:%d, y:%d, w:%d, h:%d\n", x, y, w, h); */
-
-    png_byte color_type;
-    png_structp png_ptr;
-    png_infop info_ptr;
-    png_colorp png_palette = NULL;
-    int level = tightPngConf[cl->tightCompressLevel].png_zlib_level;
-    int filters = tightPngConf[cl->tightCompressLevel].png_filters;
-    uint8_t *buf;
-    int dy;
-
-    pngDstDataLen = 0;
-
-    png_ptr = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL,
-                                        NULL, pngMalloc, pngFree);
-
-    if (png_ptr == NULL)
-        return FALSE;
-
-    info_ptr = png_create_info_struct(png_ptr);
-
-    if (info_ptr == NULL) {
-        png_destroy_write_struct(&png_ptr, NULL);
-        return FALSE;
-    }
-
-    png_set_write_fn(png_ptr, (void *) cl, pngWriteData, pngFlushData);
-    png_set_compression_level(png_ptr, level);
-    png_set_filter(png_ptr, PNG_FILTER_TYPE_DEFAULT, filters);
-
-#if 0
-    /* TODO: */
-    if (palette) {
-        color_type = PNG_COLOR_TYPE_PALETTE;
-    } else {
-        color_type = PNG_COLOR_TYPE_RGB;
-    }
-#else
-    color_type = PNG_COLOR_TYPE_RGB;
-#endif
-    png_set_IHDR(png_ptr, info_ptr, w, h,
-                 8, color_type, PNG_INTERLACE_NONE,
-                 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
-
-#if 0
-    if (color_type == PNG_COLOR_TYPE_PALETTE) {
-        struct palette_cb_priv priv;
-
-        png_palette = pngMalloc(png_ptr, sizeof(*png_palette) *
-                                 palette_size(palette));
-
-        priv.vs = vs;
-        priv.png_palette = png_palette;
-        palette_iter(palette, write_png_palette, &priv);
-
-        png_set_PLTE(png_ptr, info_ptr, png_palette, palette_size(palette));
-
-        offset = vs->tight.tight.offset;
-        if (vs->clientds.pf.bytes_per_pixel == 4) {
-            tight_encode_indexed_rect32(vs->tight.tight.buffer, w * h, palette);
-        } else {
-            tight_encode_indexed_rect16(vs->tight.tight.buffer, w * h, palette);
-        }
-    }
-
-    buffer_reserve(&vs->tight.png, 2048);
-#endif
-
-    png_write_info(png_ptr, info_ptr);
-    buf = malloc(w * 3);
-    for (dy = 0; dy < h; dy++)
-    {
-#if 0
-        if (color_type == PNG_COLOR_TYPE_PALETTE) {
-            memcpy(buf, vs->tight.tight.buffer + (dy * w), w);
-        } else {
-            PrepareRowForImg(cl, buf, x, y + dy, w);
-        }
-#else
-        PrepareRowForImg(cl, buf, x, y + dy, w);
-#endif
-        png_write_row(png_ptr, buf);
-    }
-    free(buf);
-
-    png_write_end(png_ptr, NULL);
-
-    if (color_type == PNG_COLOR_TYPE_PALETTE) {
-        pngFree(png_ptr, png_palette);
-    }
-
-    png_destroy_write_struct(&png_ptr, &info_ptr);
-
-    /* done v */
-
-    if (cl->ublen + TIGHT_MIN_TO_COMPRESS + 1 > UPDATE_BUF_SIZE) {
-        if (!rfbSendUpdateBuf(cl))
-            return FALSE;
-    }
-
-    cl->updateBuf[cl->ublen++] = (char)(rfbTightPng << 4);
-    rfbStatRecordEncodingSentAdd(cl, cl->tightEncoding, 1);
-
-    /* rfbLog("<< SendPngRect\n"); */
-    return SendCompressedData(cl, tightAfterBuf, pngDstDataLen);
-}
-#endif
diff --git a/ica/x11/libvncserver/translate.c b/ica/x11/libvncserver/translate.c
deleted file mode 100644
index 7c341c2..0000000
--- a/ica/x11/libvncserver/translate.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * translate.c - translate between different pixel formats
- */
-
-/*
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-
-static void PrintPixelFormat(rfbPixelFormat *pf);
-static rfbBool rfbSetClientColourMapBGR233(rfbClientPtr cl);
-
-rfbBool rfbEconomicTranslate = FALSE;
-
-/*
- * Some standard pixel formats.
- */
-
-static const rfbPixelFormat BGR233Format = {
-    8, 8, 0, 1, 7, 7, 3, 0, 3, 6, 0, 0
-};
-
-
-/*
- * Macro to compare pixel formats.
- */
-
-#define PF_EQ(x,y)                                                      \
-        ((x.bitsPerPixel == y.bitsPerPixel) &&                          \
-         (x.depth == y.depth) &&                                        \
-         ((x.bigEndian == y.bigEndian) || (x.bitsPerPixel == 8)) &&     \
-         (x.trueColour == y.trueColour) &&                              \
-         (!x.trueColour || ((x.redMax == y.redMax) &&                   \
-                            (x.greenMax == y.greenMax) &&               \
-                            (x.blueMax == y.blueMax) &&                 \
-                            (x.redShift == y.redShift) &&               \
-                            (x.greenShift == y.greenShift) &&           \
-                            (x.blueShift == y.blueShift))))
-
-#define CONCAT2(a,b) a##b
-#define CONCAT2E(a,b) CONCAT2(a,b)
-#define CONCAT3(a,b,c) a##b##c
-#define CONCAT3E(a,b,c) CONCAT3(a,b,c)
-#define CONCAT4(a,b,c,d) a##b##c##d
-#define CONCAT4E(a,b,c,d) CONCAT4(a,b,c,d)
-
-#undef OUT
-#undef IN
-
-#define OUT 8
-#include "tableinitcmtemplate.c"
-#include "tableinittctemplate.c"
-#define IN 8
-#include "tabletranstemplate.c"
-#undef IN
-#define IN 16
-#include "tabletranstemplate.c"
-#undef IN
-#define IN 32
-#include "tabletranstemplate.c"
-#undef IN
-#undef OUT
-
-#define OUT 16
-#include "tableinitcmtemplate.c"
-#include "tableinittctemplate.c"
-#define IN 8
-#include "tabletranstemplate.c"
-#undef IN
-#define IN 16
-#include "tabletranstemplate.c"
-#undef IN
-#define IN 32
-#include "tabletranstemplate.c"
-#undef IN
-#undef OUT
-
-#define OUT 32
-#include "tableinitcmtemplate.c"
-#include "tableinittctemplate.c"
-#define IN 8
-#include "tabletranstemplate.c"
-#undef IN
-#define IN 16
-#include "tabletranstemplate.c"
-#undef IN
-#define IN 32
-#include "tabletranstemplate.c"
-#undef IN
-#undef OUT
-
-#ifdef LIBVNCSERVER_ALLOW24BPP
-#define COUNT_OFFSETS 4
-#define BPP2OFFSET(bpp) ((bpp)/8-1)
-#include "tableinit24.c"
-#define BPP 8
-#include "tabletrans24template.c"
-#undef BPP
-#define BPP 16
-#include "tabletrans24template.c"
-#undef BPP
-#define BPP 24
-#include "tabletrans24template.c"
-#undef BPP
-#define BPP 32
-#include "tabletrans24template.c"
-#undef BPP
-#else
-#define COUNT_OFFSETS 3
-#define BPP2OFFSET(bpp) ((int)(bpp)/16)
-#endif
-
-typedef void (*rfbInitCMTableFnType)(char **table, rfbPixelFormat *in,
-                                   rfbPixelFormat *out,rfbColourMap* cm);
-typedef void (*rfbInitTableFnType)(char **table, rfbPixelFormat *in,
-                                   rfbPixelFormat *out);
-
-static rfbInitCMTableFnType rfbInitColourMapSingleTableFns[COUNT_OFFSETS] = {
-    rfbInitColourMapSingleTable8,
-    rfbInitColourMapSingleTable16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-    rfbInitColourMapSingleTable24,
-#endif
-    rfbInitColourMapSingleTable32
-};
-
-static rfbInitTableFnType rfbInitTrueColourSingleTableFns[COUNT_OFFSETS] = {
-    rfbInitTrueColourSingleTable8,
-    rfbInitTrueColourSingleTable16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-    rfbInitTrueColourSingleTable24,
-#endif
-    rfbInitTrueColourSingleTable32
-};
-
-static rfbInitTableFnType rfbInitTrueColourRGBTablesFns[COUNT_OFFSETS] = {
-    rfbInitTrueColourRGBTables8,
-    rfbInitTrueColourRGBTables16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-    rfbInitTrueColourRGBTables24,
-#endif
-    rfbInitTrueColourRGBTables32
-};
-
-static rfbTranslateFnType rfbTranslateWithSingleTableFns[COUNT_OFFSETS][COUNT_OFFSETS] = {
-    { rfbTranslateWithSingleTable8to8,
-      rfbTranslateWithSingleTable8to16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-      rfbTranslateWithSingleTable8to24,
-#endif
-      rfbTranslateWithSingleTable8to32 },
-    { rfbTranslateWithSingleTable16to8,
-      rfbTranslateWithSingleTable16to16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-      rfbTranslateWithSingleTable16to24,
-#endif
-      rfbTranslateWithSingleTable16to32 },
-#ifdef LIBVNCSERVER_ALLOW24BPP
-    { rfbTranslateWithSingleTable24to8,
-      rfbTranslateWithSingleTable24to16,
-      rfbTranslateWithSingleTable24to24,
-      rfbTranslateWithSingleTable24to32 },
-#endif
-    { rfbTranslateWithSingleTable32to8,
-      rfbTranslateWithSingleTable32to16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-      rfbTranslateWithSingleTable32to24,
-#endif
-      rfbTranslateWithSingleTable32to32 }
-};
-
-static rfbTranslateFnType rfbTranslateWithRGBTablesFns[COUNT_OFFSETS][COUNT_OFFSETS] = {
-    { rfbTranslateWithRGBTables8to8,
-      rfbTranslateWithRGBTables8to16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-      rfbTranslateWithRGBTables8to24,
-#endif
-      rfbTranslateWithRGBTables8to32 },
-    { rfbTranslateWithRGBTables16to8,
-      rfbTranslateWithRGBTables16to16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-      rfbTranslateWithRGBTables16to24,
-#endif
-      rfbTranslateWithRGBTables16to32 },
-#ifdef LIBVNCSERVER_ALLOW24BPP
-    { rfbTranslateWithRGBTables24to8,
-      rfbTranslateWithRGBTables24to16,
-      rfbTranslateWithRGBTables24to24,
-      rfbTranslateWithRGBTables24to32 },
-#endif
-    { rfbTranslateWithRGBTables32to8,
-      rfbTranslateWithRGBTables32to16,
-#ifdef LIBVNCSERVER_ALLOW24BPP
-      rfbTranslateWithRGBTables32to24,
-#endif
-      rfbTranslateWithRGBTables32to32 }
-};
-
-
-
-/*
- * rfbTranslateNone is used when no translation is required.
- */
-
-void
-rfbTranslateNone(char *table, rfbPixelFormat *in, rfbPixelFormat *out,
-                 char *iptr, char *optr, int bytesBetweenInputLines,
-                 int width, int height)
-{
-    int bytesPerOutputLine = width * (out->bitsPerPixel / 8);
-
-    while (height > 0) {
-        memcpy(optr, iptr, bytesPerOutputLine);
-        iptr += bytesBetweenInputLines;
-        optr += bytesPerOutputLine;
-        height--;
-    }
-}
-
-
-/*
- * rfbSetTranslateFunction sets the translation function.
- */
-
-rfbBool
-rfbSetTranslateFunction(rfbClientPtr cl)
-{
-    rfbLog("Pixel format for client %s:\n",cl->host);
-    PrintPixelFormat(&cl->format);
-
-    /*
-     * Check that bits per pixel values are valid
-     */
-
-    if ((cl->screen->serverFormat.bitsPerPixel != 8) &&
-        (cl->screen->serverFormat.bitsPerPixel != 16) &&
-#ifdef LIBVNCSERVER_ALLOW24BPP
-	(cl->screen->serverFormat.bitsPerPixel != 24) &&
-#endif
-        (cl->screen->serverFormat.bitsPerPixel != 32))
-    {
-        rfbErr("%s: server bits per pixel not 8, 16 or 32 (is %d)\n",
-	       "rfbSetTranslateFunction", 
-	       cl->screen->serverFormat.bitsPerPixel);
-        rfbCloseClient(cl);
-        return FALSE;
-    }
-
-    if ((cl->format.bitsPerPixel != 8) &&
-        (cl->format.bitsPerPixel != 16) &&
-#ifdef LIBVNCSERVER_ALLOW24BPP
-	(cl->format.bitsPerPixel != 24) &&
-#endif
-        (cl->format.bitsPerPixel != 32))
-    {
-        rfbErr("%s: client bits per pixel not 8, 16 or 32\n",
-                "rfbSetTranslateFunction");
-        rfbCloseClient(cl);
-        return FALSE;
-    }
-
-    if (!cl->format.trueColour && (cl->format.bitsPerPixel != 8)) {
-        rfbErr("rfbSetTranslateFunction: client has colour map "
-                "but %d-bit - can only cope with 8-bit colour maps\n",
-                cl->format.bitsPerPixel);
-        rfbCloseClient(cl);
-        return FALSE;
-    }
-
-    /*
-     * bpp is valid, now work out how to translate
-     */
-
-    if (!cl->format.trueColour) {
-        /*
-         * truecolour -> colour map
-         *
-         * Set client's colour map to BGR233, then effectively it's
-         * truecolour as well
-         */
-
-        if (!rfbSetClientColourMapBGR233(cl))
-            return FALSE;
-
-        cl->format = BGR233Format;
-    }
-
-    /* truecolour -> truecolour */
-
-    if (PF_EQ(cl->format,cl->screen->serverFormat)) {
-
-        /* client & server the same */
-
-        rfbLog("no translation needed\n");
-        cl->translateFn = rfbTranslateNone;
-        return TRUE;
-    }
-
-    if ((cl->screen->serverFormat.bitsPerPixel < 16) ||
-        ((!cl->screen->serverFormat.trueColour || !rfbEconomicTranslate) &&
-	   (cl->screen->serverFormat.bitsPerPixel == 16))) {
-
-        /* we can use a single lookup table for <= 16 bpp */
-
-        cl->translateFn = rfbTranslateWithSingleTableFns
-                              [BPP2OFFSET(cl->screen->serverFormat.bitsPerPixel)]
-                                  [BPP2OFFSET(cl->format.bitsPerPixel)];
-
-	if(cl->screen->serverFormat.trueColour)
-	  (*rfbInitTrueColourSingleTableFns
-	   [BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
-						   &(cl->screen->serverFormat), &cl->format);
-	else
-	  (*rfbInitColourMapSingleTableFns
-	   [BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
-						   &(cl->screen->serverFormat), &cl->format,&cl->screen->colourMap);
-
-    } else {
-
-        /* otherwise we use three separate tables for red, green and blue */
-
-        cl->translateFn = rfbTranslateWithRGBTablesFns
-                              [BPP2OFFSET(cl->screen->serverFormat.bitsPerPixel)]
-                                  [BPP2OFFSET(cl->format.bitsPerPixel)];
-
-        (*rfbInitTrueColourRGBTablesFns
-            [BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
-                                             &(cl->screen->serverFormat), &cl->format);
-    }
-
-    return TRUE;
-}
-
-
-
-/*
- * rfbSetClientColourMapBGR233 sets the client's colour map so that it's
- * just like an 8-bit BGR233 true colour client.
- */
-
-static rfbBool
-rfbSetClientColourMapBGR233(rfbClientPtr cl)
-{
-    char buf[sz_rfbSetColourMapEntriesMsg + 256 * 3 * 2];
-    rfbSetColourMapEntriesMsg *scme = (rfbSetColourMapEntriesMsg *)buf;
-    uint16_t *rgb = (uint16_t *)(&buf[sz_rfbSetColourMapEntriesMsg]);
-    int i, len;
-    int r, g, b;
-
-    if (cl->format.bitsPerPixel != 8 ) {
-        rfbErr("%s: client not 8 bits per pixel\n",
-                "rfbSetClientColourMapBGR233");
-        rfbCloseClient(cl);
-        return FALSE;
-    }
-    
-    scme->type = rfbSetColourMapEntries;
-
-    scme->firstColour = Swap16IfLE(0);
-    scme->nColours = Swap16IfLE(256);
-
-    len = sz_rfbSetColourMapEntriesMsg;
-
-    i = 0;
-
-    for (b = 0; b < 4; b++) {
-        for (g = 0; g < 8; g++) {
-            for (r = 0; r < 8; r++) {
-                rgb[i++] = Swap16IfLE(r * 65535 / 7);
-                rgb[i++] = Swap16IfLE(g * 65535 / 7);
-                rgb[i++] = Swap16IfLE(b * 65535 / 3);
-            }
-        }
-    }
-
-    len += 256 * 3 * 2;
-
-    if (rfbWriteExact(cl, buf, len) < 0) {
-        rfbLogPerror("rfbSetClientColourMapBGR233: write");
-        rfbCloseClient(cl);
-        return FALSE;
-    }
-    return TRUE;
-}
-
-/* this function is not called very often, so it needn't be
-   efficient. */
-
-/*
- * rfbSetClientColourMap is called to set the client's colour map.  If the
- * client is a true colour client, we simply update our own translation table
- * and mark the whole screen as having been modified.
- */
-
-rfbBool
-rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
-{
-    if (cl->screen->serverFormat.trueColour || !cl->readyForSetColourMapEntries) {
-	return TRUE;
-    }
-
-    if (nColours == 0) {
-	nColours = cl->screen->colourMap.count;
-    }
-
-    if (cl->format.trueColour) {
-	LOCK(cl->updateMutex);
-	(*rfbInitColourMapSingleTableFns
-	    [BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
-					     &cl->screen->serverFormat, &cl->format,&cl->screen->colourMap);
-
-	sraRgnDestroy(cl->modifiedRegion);
-	cl->modifiedRegion =
-	  sraRgnCreateRect(0,0,cl->screen->width,cl->screen->height);
-	UNLOCK(cl->updateMutex);
-
-	return TRUE;
-    }
-
-    return rfbSendSetColourMapEntries(cl, firstColour, nColours);
-}
-
-
-/*
- * rfbSetClientColourMaps sets the colour map for each RFB client.
- */
-
-void
-rfbSetClientColourMaps(rfbScreenInfoPtr rfbScreen, int firstColour, int nColours)
-{
-    rfbClientIteratorPtr i;
-    rfbClientPtr cl;
-
-    i = rfbGetClientIterator(rfbScreen);
-    while((cl = rfbClientIteratorNext(i)))
-      rfbSetClientColourMap(cl, firstColour, nColours);
-    rfbReleaseClientIterator(i);
-}
-
-static void
-PrintPixelFormat(rfbPixelFormat *pf)
-{
-    if (pf->bitsPerPixel == 1) {
-        rfbLog("  1 bpp, %s sig bit in each byte is leftmost on the screen.\n",
-               (pf->bigEndian ? "most" : "least"));
-    } else {
-        rfbLog("  %d bpp, depth %d%s\n",pf->bitsPerPixel,pf->depth,
-               ((pf->bitsPerPixel == 8) ? ""
-                : (pf->bigEndian ? ", big endian" : ", little endian")));
-        if (pf->trueColour) {
-            rfbLog("  true colour: max r %d g %d b %d, shift r %d g %d b %d\n",
-                   pf->redMax, pf->greenMax, pf->blueMax,
-                   pf->redShift, pf->greenShift, pf->blueShift);
-        } else {
-            rfbLog("  uses a colour map (not true colour).\n");
-        }
-    }
-}
diff --git a/ica/x11/libvncserver/ultra.c b/ica/x11/libvncserver/ultra.c
deleted file mode 100644
index 9485591..0000000
--- a/ica/x11/libvncserver/ultra.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * ultra.c
- *
- * Routines to implement ultra based encoding (minilzo).
- * ultrazip supports packed rectangles if the rects are tiny...
- * This improves performance as lzo has more data to work with at once
- * This is 'UltraZip' and is currently not implemented.
- */
-
-#include <rfb/rfb.h>
-#include "minilzo.h"
-
-/*
- * cl->beforeEncBuf contains pixel data in the client's format.
- * cl->afterEncBuf contains the lzo (deflated) encoding version.
- * If the lzo compressed/encoded version is
- * larger than the raw data or if it exceeds cl->afterEncBufSize then
- * raw encoding is used instead.
- */
-
-
-/*
- * rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib
- *                              rectangle encoding.
- */
-
-#define MAX_WRKMEM ((LZO1X_1_MEM_COMPRESS) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t)
-
-
-void rfbFreeUltraData(rfbClientPtr cl) {
-  if (cl->compStreamInitedLZO) {
-    free(cl->lzoWrkMem);
-    cl->compStreamInitedLZO=FALSE;
-  }
-}
-
-
-static rfbBool
-rfbSendOneRectEncodingUltra(rfbClientPtr cl,
-                           int x,
-                           int y,
-                           int w,
-                           int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    rfbZlibHeader hdr;
-    int deflateResult;
-    int i;
-    char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)
-    	   + (x * (cl->scaledScreen->bitsPerPixel / 8)));
-
-    int maxRawSize;
-    lzo_uint maxCompSize;
-
-    maxRawSize = (w * h * (cl->format.bitsPerPixel / 8));
-
-    if (cl->beforeEncBufSize < maxRawSize) {
-	cl->beforeEncBufSize = maxRawSize;
-	if (cl->beforeEncBuf == NULL)
-	    cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
-	else
-	    cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
-    }
-
-    /*
-     * lzo requires output buffer to be slightly larger than the input
-     * buffer, in the worst case.
-     */
-    maxCompSize = (maxRawSize + maxRawSize / 16 + 64 + 3);
-
-    if (cl->afterEncBufSize < (int)maxCompSize) {
-	cl->afterEncBufSize = maxCompSize;
-	if (cl->afterEncBuf == NULL)
-	    cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
-	else
-	    cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
-    }
-
-    /* 
-     * Convert pixel data to client format.
-     */
-    (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,
-		       &cl->format, fbptr, cl->beforeEncBuf,
-		       cl->scaledScreen->paddedWidthInBytes, w, h);
-
-    if ( cl->compStreamInitedLZO == FALSE ) {
-        cl->compStreamInitedLZO = TRUE;
-        /* Work-memory needed for compression. Allocate memory in units
-         * of `lzo_align_t' (instead of `char') to make sure it is properly aligned.
-         */  
-        cl->lzoWrkMem = malloc(sizeof(lzo_align_t) * (((LZO1X_1_MEM_COMPRESS) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t)));
-    }
-
-    /* Perform the compression here. */
-    deflateResult = lzo1x_1_compress((unsigned char *)cl->beforeEncBuf, (lzo_uint)(w * h * (cl->format.bitsPerPixel / 8)), (unsigned char *)cl->afterEncBuf, &maxCompSize, cl->lzoWrkMem);
-    /* maxCompSize now contains the compressed size */
-
-    /* Find the total size of the resulting compressed data. */
-    cl->afterEncBufLen = maxCompSize;
-
-    if ( deflateResult != LZO_E_OK ) {
-        rfbErr("lzo deflation error: %d\n", deflateResult);
-        return FALSE;
-    }
-
-    /* Update statics */
-    rfbStatRecordEncodingSent(cl, rfbEncodingUltra, sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader + cl->afterEncBufLen, maxRawSize);
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader
-	> UPDATE_BUF_SIZE)
-    {
-	if (!rfbSendUpdateBuf(cl))
-	    return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(rfbEncodingUltra);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-	   sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    hdr.nBytes = Swap32IfLE(cl->afterEncBufLen);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbZlibHeader);
-    cl->ublen += sz_rfbZlibHeader;
-
-    /* We might want to try sending the data directly... */
-    for (i = 0; i < cl->afterEncBufLen;) {
-
-	int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
-
-	if (i + bytesToCopy > cl->afterEncBufLen) {
-	    bytesToCopy = cl->afterEncBufLen - i;
-	}
-
-	memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
-
-	cl->ublen += bytesToCopy;
-	i += bytesToCopy;
-
-	if (cl->ublen == UPDATE_BUF_SIZE) {
-	    if (!rfbSendUpdateBuf(cl))
-		return FALSE;
-	}
-    }
-
-    return TRUE;
-
-}
-
-/*
- * rfbSendRectEncodingUltra - send a given rectangle using one or more
- *                           LZO encoding rectangles.
- */
-
-rfbBool
-rfbSendRectEncodingUltra(rfbClientPtr cl,
-                        int x,
-                        int y,
-                        int w,
-                        int h)
-{
-    int  maxLines;
-    int  linesRemaining;
-    rfbRectangle partialRect;
-
-    partialRect.x = x;
-    partialRect.y = y;
-    partialRect.w = w;
-    partialRect.h = h;
-
-    /* Determine maximum pixel/scan lines allowed per rectangle. */
-    maxLines = ( ULTRA_MAX_SIZE(w) / w );
-
-    /* Initialize number of scan lines left to do. */
-    linesRemaining = h;
-
-    /* Loop until all work is done. */
-    while ( linesRemaining > 0 ) {
-
-        int linesToComp;
-
-        if ( maxLines < linesRemaining )
-            linesToComp = maxLines;
-        else
-            linesToComp = linesRemaining;
-
-        partialRect.h = linesToComp;
-
-        /* Encode (compress) and send the next rectangle. */
-        if ( ! rfbSendOneRectEncodingUltra( cl,
-                                           partialRect.x,
-                                           partialRect.y,
-                                           partialRect.w,
-                                           partialRect.h )) {
-
-            return FALSE;
-        }
-
-        /* Technically, flushing the buffer here is not extrememly
-         * efficient.  However, this improves the overall throughput
-         * of the system over very slow networks.  By flushing
-         * the buffer with every maximum size lzo rectangle, we
-         * improve the pipelining usage of the server CPU, network,
-         * and viewer CPU components.  Insuring that these components
-         * are working in parallel actually improves the performance
-         * seen by the user.
-         * Since, lzo is most useful for slow networks, this flush
-         * is appropriate for the desired behavior of the lzo encoding.
-         */
-        if (( cl->ublen > 0 ) &&
-            ( linesToComp == maxLines )) {
-            if (!rfbSendUpdateBuf(cl)) {
-
-                return FALSE;
-            }
-        }
-
-        /* Update remaining and incremental rectangle location. */
-        linesRemaining -= linesToComp;
-        partialRect.y += linesToComp;
-
-    }
-
-    return TRUE;
-
-}
diff --git a/ica/x11/libvncserver/websockets.c b/ica/x11/libvncserver/websockets.c
deleted file mode 100644
index bd5d9d0..0000000
--- a/ica/x11/libvncserver/websockets.c
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * websockets.c - deal with WebSockets clients.
- *
- * This code should be independent of any changes in the RFB protocol. It is
- * an additional handshake and framing of normal sockets:
- *   http://www.whatwg.org/specs/web-socket-protocol/
- *
- */
-
-/*
- *  Copyright (C) 2010 Joel Martin
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifdef __STRICT_ANSI__
-#define _BSD_SOURCE
-#endif
-
-#include <rfb/rfb.h>
-#include <resolv.h> /* __b64_ntop */
-/* errno */
-#include <errno.h>
-
-#ifdef LIBVNCSERVER_HAVE_ENDIAN_H
-#include <endian.h>
-#elif LIBVNCSERVER_HAVE_SYS_ENDIAN_H
-#include <sys/endian.h>
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#include <string.h>
-#include <unistd.h>
-#include "rfb/rfbconfig.h"
-#include "rfbssl.h"
-#include "rfbcrypto.h"
-
-#define WS_NTOH64(n) htobe64(n)
-#define WS_NTOH32(n) htobe32(n)
-#define WS_NTOH16(n) htobe16(n)
-#define WS_HTON64(n) htobe64(n)
-#define WS_HTON16(n) htobe16(n)
-
-#define B64LEN(__x) (((__x + 2) / 3) * 12 / 3)
-#define WSHLENMAX 14  /* 2 + sizeof(uint64_t) + sizeof(uint32_t) */
-
-enum {
-  WEBSOCKETS_VERSION_HIXIE,
-  WEBSOCKETS_VERSION_HYBI
-};
-
-#if 0
-#include <sys/syscall.h>
-static int gettid() {
-    return (int)syscall(SYS_gettid);
-}
-#endif
-
-typedef int (*wsEncodeFunc)(rfbClientPtr cl, const char *src, int len, char **dst);
-typedef int (*wsDecodeFunc)(rfbClientPtr cl, char *dst, int len);
-
-typedef struct ws_ctx_s {
-    char codeBuf[B64LEN(UPDATE_BUF_SIZE) + WSHLENMAX]; /* base64 + maximum frame header length */
-    char readbuf[8192];
-    int readbufstart;
-    int readbuflen;
-    int dblen;
-    char carryBuf[3];                      /* For base64 carry-over */
-    int carrylen;
-    int version;
-    int base64;
-    wsEncodeFunc encode;
-    wsDecodeFunc decode;
-} ws_ctx_t;
-
-typedef union ws_mask_s {
-  char c[4];
-  uint32_t u;
-} ws_mask_t;
-
-/* XXX: The union and the structs do not need to be named.
- *      We are working around a bug present in GCC < 4.6 which prevented
- *      it from recognizing anonymous structs and unions.
- *      See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4784
- */
-typedef struct __attribute__ ((__packed__)) ws_header_s {
-  unsigned char b0;
-  unsigned char b1;
-  union {
-    struct __attribute__ ((__packed__)) {
-      uint16_t l16;
-      ws_mask_t m16;
-    } s16;
-    struct __attribute__ ((__packed__)) {
-      uint64_t l64;
-      ws_mask_t m64;
-    } s64;
-    ws_mask_t m;
-  } u;
-} ws_header_t;
-
-enum
-{
-    WS_OPCODE_CONTINUATION = 0x0,
-    WS_OPCODE_TEXT_FRAME,
-    WS_OPCODE_BINARY_FRAME,
-    WS_OPCODE_CLOSE = 0x8,
-    WS_OPCODE_PING,
-    WS_OPCODE_PONG
-};
-
-#define FLASH_POLICY_RESPONSE "<cross-domain-policy><allow-access-from domain=\"*\" to-ports=\"*\" /></cross-domain-policy>\n"
-#define SZ_FLASH_POLICY_RESPONSE 93
-
-/*
- * draft-ietf-hybi-thewebsocketprotocol-10
- * 5.2.2. Sending the Server's Opening Handshake
- */
-#define GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
-
-#define SERVER_HANDSHAKE_HIXIE "HTTP/1.1 101 Web Socket Protocol Handshake\r\n\
-Upgrade: WebSocket\r\n\
-Connection: Upgrade\r\n\
-%sWebSocket-Origin: %s\r\n\
-%sWebSocket-Location: %s://%s%s\r\n\
-%sWebSocket-Protocol: %s\r\n\
-\r\n%s"
-
-#define SERVER_HANDSHAKE_HYBI "HTTP/1.1 101 Switching Protocols\r\n\
-Upgrade: websocket\r\n\
-Connection: Upgrade\r\n\
-Sec-WebSocket-Accept: %s\r\n\
-Sec-WebSocket-Protocol: %s\r\n\
-\r\n"
-
-
-#define WEBSOCKETS_CLIENT_CONNECT_WAIT_MS 100
-#define WEBSOCKETS_CLIENT_SEND_WAIT_MS 100
-#define WEBSOCKETS_MAX_HANDSHAKE_LEN 4096
-
-#if defined(__linux__) && defined(NEED_TIMEVAL)
-struct timeval
-{
-   long int tv_sec,tv_usec;
-}
-;
-#endif
-
-static rfbBool webSocketsHandshake(rfbClientPtr cl, char *scheme);
-void webSocketsGenMd5(char * target, char *key1, char *key2, char *key3);
-
-static int webSocketsEncodeHybi(rfbClientPtr cl, const char *src, int len, char **dst);
-static int webSocketsEncodeHixie(rfbClientPtr cl, const char *src, int len, char **dst);
-static int webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len);
-static int webSocketsDecodeHixie(rfbClientPtr cl, char *dst, int len);
-
-static int
-min (int a, int b) {
-    return a < b ? a : b;
-}
-
-static void webSocketsGenSha1Key(char *target, int size, char *key)
-{
-    struct iovec iov[2];
-    unsigned char hash[20];
-
-    iov[0].iov_base = key;
-    iov[0].iov_len = strlen(key);
-    iov[1].iov_base = GUID;
-    iov[1].iov_len = sizeof(GUID) - 1;
-    digestsha1(iov, 2, hash);
-    if (-1 == __b64_ntop(hash, sizeof(hash), target, size))
-	rfbErr("b64_ntop failed\n");
-}
-
-/*
- * rfbWebSocketsHandshake is called to handle new WebSockets connections
- */
-
-rfbBool
-webSocketsCheck (rfbClientPtr cl)
-{
-    char bbuf[4], *scheme;
-    int ret;
-
-    ret = rfbPeekExactTimeout(cl, bbuf, 4,
-                                   WEBSOCKETS_CLIENT_CONNECT_WAIT_MS);
-    if ((ret < 0) && (errno == ETIMEDOUT)) {
-      rfbLog("Normal socket connection\n");
-      return TRUE;
-    } else if (ret <= 0) {
-      rfbErr("webSocketsHandshake: unknown connection error\n");
-      return FALSE;
-    }
-
-    if (strncmp(bbuf, "<", 1) == 0) {
-        rfbLog("Got Flash policy request, sending response\n");
-        if (rfbWriteExact(cl, FLASH_POLICY_RESPONSE,
-                          SZ_FLASH_POLICY_RESPONSE) < 0) {
-            rfbErr("webSocketsHandshake: failed sending Flash policy response");
-        }
-        return FALSE;
-    } else if (strncmp(bbuf, "\x16", 1) == 0 || strncmp(bbuf, "\x80", 1) == 0) {
-        rfbLog("Got TLS/SSL WebSockets connection\n");
-        if (-1 == rfbssl_init(cl)) {
-	  rfbErr("webSocketsHandshake: rfbssl_init failed\n");
-	  return FALSE;
-	}
-	ret = rfbPeekExactTimeout(cl, bbuf, 4, WEBSOCKETS_CLIENT_CONNECT_WAIT_MS);
-        scheme = "wss";
-    } else {
-        scheme = "ws";
-    }
-
-    if (strncmp(bbuf, "GET ", 4) != 0) {
-      rfbErr("webSocketsHandshake: invalid client header\n");
-      return FALSE;
-    }
-
-    rfbLog("Got '%s' WebSockets handshake\n", scheme);
-
-    if (!webSocketsHandshake(cl, scheme)) {
-        return FALSE;
-    }
-    /* Start WebSockets framing */
-    return TRUE;
-}
-
-static rfbBool
-webSocketsHandshake(rfbClientPtr cl, char *scheme)
-{
-    char *buf, *response, *line;
-    int n, linestart = 0, len = 0, llen, base64 = TRUE;
-    char prefix[5], trailer[17];
-    char *path = NULL, *host = NULL, *origin = NULL, *protocol = NULL;
-    char *key1 = NULL, *key2 = NULL, *key3 = NULL;
-    char *sec_ws_origin = NULL;
-    char *sec_ws_key = NULL;
-    char sec_ws_version = 0;
-    ws_ctx_t *wsctx = NULL;
-
-    buf = (char *) malloc(WEBSOCKETS_MAX_HANDSHAKE_LEN);
-    if (!buf) {
-        rfbLogPerror("webSocketsHandshake: malloc");
-        return FALSE;
-    }
-    response = (char *) malloc(WEBSOCKETS_MAX_HANDSHAKE_LEN);
-    if (!response) {
-        free(buf);
-        rfbLogPerror("webSocketsHandshake: malloc");
-        return FALSE;
-    }
-
-    while (len < WEBSOCKETS_MAX_HANDSHAKE_LEN-1) {
-        if ((n = rfbReadExactTimeout(cl, buf+len, 1,
-                                     WEBSOCKETS_CLIENT_SEND_WAIT_MS)) <= 0) {
-            if ((n < 0) && (errno == ETIMEDOUT)) {
-                break;
-            }
-            if (n == 0)
-                rfbLog("webSocketsHandshake: client gone\n");
-            else
-                rfbLogPerror("webSocketsHandshake: read");
-            free(response);
-            free(buf);
-            return FALSE;
-        }
-
-        len += 1;
-        llen = len - linestart;
-        if (((llen >= 2)) && (buf[len-1] == '\n')) {
-            line = buf+linestart;
-            if ((llen == 2) && (strncmp("\r\n", line, 2) == 0)) {
-                if (key1 && key2) {
-                    if ((n = rfbReadExact(cl, buf+len, 8)) <= 0) {
-                        if ((n < 0) && (errno == ETIMEDOUT)) {
-                            break;
-                        }
-                        if (n == 0)
-                            rfbLog("webSocketsHandshake: client gone\n");
-                        else
-                            rfbLogPerror("webSocketsHandshake: read");
-                        free(response);
-                        free(buf);
-                        return FALSE;
-                    }
-                    rfbLog("Got key3\n");
-                    key3 = buf+len;
-                    len += 8;
-                } else {
-                    buf[len] = '\0';
-                }
-                break;
-            } else if ((llen >= 16) && ((strncmp("GET ", line, min(llen,4))) == 0)) {
-                /* 16 = 4 ("GET ") + 1 ("/.*") + 11 (" HTTP/1.1\r\n") */
-                path = line+4;
-                buf[len-11] = '\0'; /* Trim trailing " HTTP/1.1\r\n" */
-                cl->wspath = strdup(path);
-                /* rfbLog("Got path: %s\n", path); */
-            } else if ((strncasecmp("host: ", line, min(llen,6))) == 0) {
-                host = line+6;
-                buf[len-2] = '\0';
-                /* rfbLog("Got host: %s\n", host); */
-            } else if ((strncasecmp("origin: ", line, min(llen,8))) == 0) {
-                origin = line+8;
-                buf[len-2] = '\0';
-                /* rfbLog("Got origin: %s\n", origin); */
-            } else if ((strncasecmp("sec-websocket-key1: ", line, min(llen,20))) == 0) {
-                key1 = line+20;
-                buf[len-2] = '\0';
-                /* rfbLog("Got key1: %s\n", key1); */
-            } else if ((strncasecmp("sec-websocket-key2: ", line, min(llen,20))) == 0) {
-                key2 = line+20;
-                buf[len-2] = '\0';
-                /* rfbLog("Got key2: %s\n", key2); */
-            /* HyBI */
-
-	    } else if ((strncasecmp("sec-websocket-protocol: ", line, min(llen,24))) == 0) {
-                protocol = line+24;
-                buf[len-2] = '\0';
-                rfbLog("Got protocol: %s\n", protocol);
-            } else if ((strncasecmp("sec-websocket-origin: ", line, min(llen,22))) == 0) {
-		sec_ws_origin = line+22;
-                buf[len-2] = '\0';
-            } else if ((strncasecmp("sec-websocket-key: ", line, min(llen,19))) == 0) {
-		sec_ws_key = line+19;
-                buf[len-2] = '\0';
-            } else if ((strncasecmp("sec-websocket-version: ", line, min(llen,23))) == 0) {
-		sec_ws_version = strtol(line+23, NULL, 10);
-                buf[len-2] = '\0';
-	    }
-
-            linestart = len;
-        }
-    }
-
-    if (!(path && host && (origin || sec_ws_origin))) {
-        rfbErr("webSocketsHandshake: incomplete client handshake\n");
-        free(response);
-        free(buf);
-        return FALSE;
-    }
-
-    if ((protocol) && (strstr(protocol, "binary"))) {
-        if (! sec_ws_version) {
-            rfbErr("webSocketsHandshake: 'binary' protocol not supported with Hixie\n");
-            free(response);
-            free(buf);
-            return FALSE;
-        }
-        rfbLog("  - webSocketsHandshake: using binary/raw encoding\n");
-        base64 = FALSE;
-        protocol = "binary";
-    } else {
-        rfbLog("  - webSocketsHandshake: using base64 encoding\n");
-        base64 = TRUE;
-        if ((protocol) && (strstr(protocol, "base64"))) {
-            protocol = "base64";
-        } else {
-            protocol = "";
-        }
-    }
-
-    /*
-     * Generate the WebSockets server response based on the the headers sent
-     * by the client.
-     */
-
-    if (sec_ws_version) {
-	char accept[B64LEN(SHA1_HASH_SIZE) + 1];
-	rfbLog("  - WebSockets client version hybi-%02d\n", sec_ws_version);
-	webSocketsGenSha1Key(accept, sizeof(accept), sec_ws_key);
-	len = snprintf(response, WEBSOCKETS_MAX_HANDSHAKE_LEN,
-		 SERVER_HANDSHAKE_HYBI, accept, protocol);
-    } else {
-	/* older hixie handshake, this could be removed if
-	 * a final standard is established */
-	if (!(key1 && key2 && key3)) {
-	    rfbLog("  - WebSockets client version hixie-75\n");
-	    prefix[0] = '\0';
-	    trailer[0] = '\0';
-	} else {
-	    rfbLog("  - WebSockets client version hixie-76\n");
-	    snprintf(prefix, 5, "Sec-");
-	    webSocketsGenMd5(trailer, key1, key2, key3);
-	}
-	len = snprintf(response, WEBSOCKETS_MAX_HANDSHAKE_LEN,
-		 SERVER_HANDSHAKE_HIXIE, prefix, origin, prefix, scheme,
-		 host, path, prefix, protocol, trailer);
-    }
-
-    if (rfbWriteExact(cl, response, len) < 0) {
-        rfbErr("webSocketsHandshake: failed sending WebSockets response\n");
-        free(response);
-        free(buf);
-        return FALSE;
-    }
-    /* rfbLog("webSocketsHandshake: %s\n", response); */
-    free(response);
-    free(buf);
-
-
-    wsctx = calloc(1, sizeof(ws_ctx_t));
-    if (sec_ws_version) {
-	wsctx->version = WEBSOCKETS_VERSION_HYBI;
-	wsctx->encode = webSocketsEncodeHybi;
-	wsctx->decode = webSocketsDecodeHybi;
-    } else {
-	wsctx->version = WEBSOCKETS_VERSION_HIXIE;
-	wsctx->encode = webSocketsEncodeHixie;
-	wsctx->decode = webSocketsDecodeHixie;
-    }
-    wsctx->base64 = base64;
-    cl->wsctx = (wsCtx *)wsctx;
-    return TRUE;
-}
- 
-void
-webSocketsGenMd5(char * target, char *key1, char *key2, char *key3)
-{
-    unsigned int i, spaces1 = 0, spaces2 = 0;
-    unsigned long num1 = 0, num2 = 0;
-    unsigned char buf[17];
-    struct iovec iov[1];
-
-    for (i=0; i < strlen(key1); i++) {
-        if (key1[i] == ' ') {
-            spaces1 += 1;
-        }
-        if ((key1[i] >= 48) && (key1[i] <= 57)) {
-            num1 = num1 * 10 + (key1[i] - 48);
-        }
-    }
-    num1 = num1 / spaces1;
-
-    for (i=0; i < strlen(key2); i++) {
-        if (key2[i] == ' ') {
-            spaces2 += 1;
-        }
-        if ((key2[i] >= 48) && (key2[i] <= 57)) {
-            num2 = num2 * 10 + (key2[i] - 48);
-        }
-    }
-    num2 = num2 / spaces2;
-
-    /* Pack it big-endian */
-    buf[0] = (num1 & 0xff000000) >> 24;
-    buf[1] = (num1 & 0xff0000) >> 16;
-    buf[2] = (num1 & 0xff00) >> 8;
-    buf[3] =  num1 & 0xff;
-
-    buf[4] = (num2 & 0xff000000) >> 24;
-    buf[5] = (num2 & 0xff0000) >> 16;
-    buf[6] = (num2 & 0xff00) >> 8;
-    buf[7] =  num2 & 0xff;
-
-    strncpy((char *)buf+8, key3, 8);
-    buf[16] = '\0';
-
-    iov[0].iov_base = buf;
-    iov[0].iov_len = 16;
-    digestmd5(iov, 1, target);
-    target[16] = '\0';
-
-    return;
-}
-
-static int
-webSocketsEncodeHixie(rfbClientPtr cl, const char *src, int len, char **dst)
-{
-    int sz = 0;
-    ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
-
-    wsctx->codeBuf[sz++] = '\x00';
-    len = __b64_ntop((unsigned char *)src, len, wsctx->codeBuf+sz, sizeof(wsctx->codeBuf) - (sz + 1));
-    if (len < 0) {
-        return len;
-    }
-    sz += len;
-
-    wsctx->codeBuf[sz++] = '\xff';
-    *dst = wsctx->codeBuf;
-    return sz;
-}
-
-static int
-ws_read(rfbClientPtr cl, char *buf, int len)
-{
-    int n;
-    if (cl->sslctx) {
-	n = rfbssl_read(cl, buf, len);
-    } else {
-	n = read(cl->sock, buf, len);
-    }
-    return n;
-}
-
-static int
-ws_peek(rfbClientPtr cl, char *buf, int len)
-{
-    int n;
-    if (cl->sslctx) {
-	n = rfbssl_peek(cl, buf, len);
-    } else {
-	while (-1 == (n = recv(cl->sock, buf, len, MSG_PEEK))) {
-	    if (errno != EAGAIN)
-		break;
-	}
-    }
-    return n;
-}
-
-static int
-webSocketsDecodeHixie(rfbClientPtr cl, char *dst, int len)
-{
-    int retlen = 0, n, i, avail, modlen, needlen;
-    char *buf, *end = NULL;
-    ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
-
-    buf = wsctx->codeBuf;
-
-    n = ws_peek(cl, buf, len*2+2);
-
-    if (n <= 0) {
-        /* save errno because rfbErr() will tamper it */
-        int olderrno = errno;
-        rfbErr("%s: peek (%d) %m\n", __func__, errno);
-        errno = olderrno;
-        return n;
-    }
-
-
-    /* Base64 encoded WebSockets stream */
-
-    if (buf[0] == '\xff') {
-        i = ws_read(cl, buf, 1); /* Consume marker */
-        buf++;
-        n--;
-    }
-    if (n == 0) {
-        errno = EAGAIN;
-        return -1;
-    }
-    if (buf[0] == '\x00') {
-        i = ws_read(cl, buf, 1); /* Consume marker */
-        buf++;
-        n--;
-    }
-    if (n == 0) {
-        errno = EAGAIN;
-        return -1;
-    }
-
-    /* end = memchr(buf, '\xff', len*2+2); */
-    end = memchr(buf, '\xff', n);
-    if (!end) {
-        end = buf + n;
-    }
-    avail = end - buf;
-
-    len -= wsctx->carrylen;
-
-    /* Determine how much base64 data we need */
-    modlen = len + (len+2)/3;
-    needlen = modlen;
-    if (needlen % 4) {
-        needlen += 4 - (needlen % 4);
-    }
-
-    if (needlen > avail) {
-        /* rfbLog("Waiting for more base64 data\n"); */
-        errno = EAGAIN;
-        return -1;
-    }
-
-    /* Any carryover from previous decode */
-    for (i=0; i < wsctx->carrylen; i++) {
-        /* rfbLog("Adding carryover %d\n", wsctx->carryBuf[i]); */
-        dst[i] = wsctx->carryBuf[i];
-        retlen += 1;
-    }
-
-    /* Decode the rest of what we need */
-    buf[needlen] = '\x00';  /* Replace end marker with end of string */
-    /* rfbLog("buf: %s\n", buf); */
-    n = __b64_pton(buf, (unsigned char *)dst+retlen, 2+len);
-    if (n < len) {
-        rfbErr("Base64 decode error\n");
-        errno = EIO;
-        return -1;
-    }
-    retlen += n;
-
-    /* Consume the data from socket */
-    i = ws_read(cl, buf, needlen);
-
-    wsctx->carrylen = n - len;
-    retlen -= wsctx->carrylen;
-    for (i=0; i < wsctx->carrylen; i++) {
-        /* rfbLog("Saving carryover %d\n", dst[retlen + i]); */
-        wsctx->carryBuf[i] = dst[retlen + i];
-    }
-
-    /* rfbLog("<< webSocketsDecode, retlen: %d\n", retlen); */
-    return retlen;
-}
-
-static int
-webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
-{
-    char *buf, *payload;
-    uint32_t *payload32;
-    int ret = -1, result = -1;
-    int total = 0;
-    ws_mask_t mask;
-    ws_header_t *header;
-    int i;
-    unsigned char opcode;
-    ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
-    int flength, fhlen;
-    /* int fin; */ /* not used atm */ 
-
-    /* rfbLog(" <== %s[%d]: %d cl: %p, wsctx: %p-%p (%d)\n", __func__, gettid(), len, cl, wsctx, (char *)wsctx + sizeof(ws_ctx_t), sizeof(ws_ctx_t)); */
-
-    if (wsctx->readbuflen) {
-      /* simply return what we have */
-      if (wsctx->readbuflen > len) {
-	memcpy(dst, wsctx->readbuf +  wsctx->readbufstart, len);
-	result = len;
-	wsctx->readbuflen -= len;
-	wsctx->readbufstart += len;
-      } else {
-	memcpy(dst, wsctx->readbuf +  wsctx->readbufstart, wsctx->readbuflen);
-	result = wsctx->readbuflen;
-	wsctx->readbuflen = 0;
-	wsctx->readbufstart = 0;
-      }
-      goto spor;
-    }
-
-    buf = wsctx->codeBuf;
-    header = (ws_header_t *)wsctx->codeBuf;
-
-    ret = ws_peek(cl, buf, B64LEN(len) + WSHLENMAX);
-
-    if (ret < 2) {
-        /* save errno because rfbErr() will tamper it */
-        if (-1 == ret) {
-            int olderrno = errno;
-            rfbErr("%s: peek; %m\n", __func__);
-            errno = olderrno;
-        } else if (0 == ret) {
-            result = 0;
-        } else {
-            errno = EAGAIN;
-        }
-        goto spor;
-    }
-
-    opcode = header->b0 & 0x0f;
-    /* fin = (header->b0 & 0x80) >> 7; */ /* not used atm */
-    flength = header->b1 & 0x7f;
-
-    /*
-     * 4.3. Client-to-Server Masking
-     *
-     * The client MUST mask all frames sent to the server.  A server MUST
-     * close the connection upon receiving a frame with the MASK bit set to 0.
-    **/
-    if (!(header->b1 & 0x80)) {
-	rfbErr("%s: got frame without mask\n", __func__, ret);
-	errno = EIO;
-	goto spor;
-    }
-
-    if (flength < 126) {
-	fhlen = 2;
-	mask = header->u.m;
-    } else if (flength == 126 && 4 <= ret) {
-	flength = WS_NTOH16(header->u.s16.l16);
-	fhlen = 4;
-	mask = header->u.s16.m16;
-    } else if (flength == 127 && 10 <= ret) {
-	flength = WS_NTOH64(header->u.s64.l64);
-	fhlen = 10;
-	mask = header->u.s64.m64;
-    } else {
-      /* Incomplete frame header */
-      rfbErr("%s: incomplete frame header\n", __func__, ret);
-      errno = EIO;
-      goto spor;
-    }
-
-    /* absolute length of frame */
-    total = fhlen + flength + 4;
-    payload = buf + fhlen + 4; /* header length + mask */
-
-    if (-1 == (ret = ws_read(cl, buf, total))) {
-      int olderrno = errno;
-      rfbErr("%s: read; %m", __func__);
-      errno = olderrno;
-      return ret;
-    } else if (ret < total) {
-      /* GT TODO: hmm? */
-      rfbLog("%s: read; got partial data\n", __func__);
-    } else {
-      buf[ret] = '\0';
-    }
-
-    /* process 1 frame (32 bit op) */
-    payload32 = (uint32_t *)payload;
-    for (i = 0; i < flength / 4; i++) {
-	payload32[i] ^= mask.u;
-    }
-    /* process the remaining bytes (if any) */
-    for (i*=4; i < flength; i++) {
-	payload[i] ^= mask.c[i % 4];
-    }
-
-    switch (opcode) {
-      case WS_OPCODE_CLOSE:
-	rfbLog("got closure, reason %d\n", WS_NTOH16(((uint16_t *)payload)[0]));
-	errno = ECONNRESET;
-	break;
-      case WS_OPCODE_TEXT_FRAME:
-	if (-1 == (flength = __b64_pton(payload, (unsigned char *)wsctx->codeBuf, sizeof(wsctx->codeBuf)))) {
-	  rfbErr("%s: Base64 decode error; %m\n", __func__);
-	  break;
-	}
-	payload = wsctx->codeBuf;
-	/* fall through */
-      case WS_OPCODE_BINARY_FRAME:
-	if (flength > len) {
-	  memcpy(wsctx->readbuf, payload + len, flength - len);
-	  wsctx->readbufstart = 0;
-	  wsctx->readbuflen = flength - len;
-	  flength = len;
-	}
-	memcpy(dst, payload, flength);
-	result = flength;
-	break;
-      default:
-	rfbErr("%s: unhandled opcode %d, b0: %02x, b1: %02x\n", __func__, (int)opcode, header->b0, header->b1);
-    }
-
-    /* single point of return, if someone has questions :-) */
-spor:
-    /* rfbLog("%s: ret: %d/%d\n", __func__, result, len); */
-    return result;
-}
-
-static int
-webSocketsEncodeHybi(rfbClientPtr cl, const char *src, int len, char **dst)
-{
-    int blen, ret = -1, sz = 0;
-    unsigned char opcode = '\0'; /* TODO: option! */
-    ws_header_t *header;
-    ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
-
-
-    /* Optional opcode:
-     *   0x0 - continuation
-     *   0x1 - text frame (base64 encode buf)
-     *   0x2 - binary frame (use raw buf)
-     *   0x8 - connection close
-     *   0x9 - ping
-     *   0xA - pong
-    **/
-    if (!len) {
-	  /* nothing to encode */
-	  return 0;
-    }
-
-    header = (ws_header_t *)wsctx->codeBuf;
-
-    if (wsctx->base64) {
-	opcode = WS_OPCODE_TEXT_FRAME;
-	/* calculate the resulting size */
-	blen = B64LEN(len);
-    } else {
-	opcode = WS_OPCODE_BINARY_FRAME;
-	blen = len;
-    }
-
-    header->b0 = 0x80 | (opcode & 0x0f);
-    if (blen <= 125) {
-      header->b1 = (uint8_t)blen;
-      sz = 2;
-    } else if (blen <= 65536) {
-      header->b1 = 0x7e;
-      header->u.s16.l16 = WS_HTON16((uint16_t)blen);
-      sz = 4;
-    } else {
-      header->b1 = 0x7f;
-      header->u.s64.l64 = WS_HTON64(blen);
-      sz = 10;
-    }
-
-    if (wsctx->base64) {
-        if (-1 == (ret = __b64_ntop((unsigned char *)src, len, wsctx->codeBuf + sz, sizeof(wsctx->codeBuf) - sz))) {
-	  rfbErr("%s: Base 64 encode failed\n", __func__);
-	} else {
-	  if (ret != blen)
-	    rfbErr("%s: Base 64 encode; something weird happened\n", __func__);
-	  ret += sz;
-	}
-    } else {
-      memcpy(wsctx->codeBuf + sz, src, len);
-      ret =  sz + len;
-    }
-
-    *dst = wsctx->codeBuf;
-    return ret;
-}
-
-int
-webSocketsEncode(rfbClientPtr cl, const char *src, int len, char **dst)
-{
-    return ((ws_ctx_t *)cl->wsctx)->encode(cl, src, len, dst);
-}
-
-int
-webSocketsDecode(rfbClientPtr cl, char *dst, int len)
-{
-    return ((ws_ctx_t *)cl->wsctx)->decode(cl, dst, len);
-}
-
-
-/* returns TRUE if client sent a close frame or a single 'end of frame'
- * marker was received, FALSE otherwise
- *
- * Note: This is a Hixie-only hack!
- **/
-rfbBool
-webSocketCheckDisconnect(rfbClientPtr cl)
-{
-    ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
-    /* With Base64 encoding we need at least 4 bytes */
-    char peekbuf[4];
-    int n;
-
-    if (wsctx->version == WEBSOCKETS_VERSION_HYBI)
-	return FALSE;
-
-    if (cl->sslctx)
-	n = rfbssl_peek(cl, peekbuf, 4);
-    else
-	n = recv(cl->sock, peekbuf, 4, MSG_PEEK);
-
-    if (n <= 0) {
-	if (n != 0)
-	    rfbErr("%s: peek; %m", __func__);
-	rfbCloseClient(cl);
-	return TRUE;
-    }
-
-    if (peekbuf[0] == '\xff') {
-	int doclose = 0;
-	/* Make sure we don't miss a client disconnect on an end frame
-	 * marker. Because we use a peek buffer in some cases it is not
-	 * applicable to wait for more data per select(). */
-	switch (n) {
-	    case 3:
-		if (peekbuf[1] == '\xff' && peekbuf[2] == '\x00')
-		    doclose = 1;
-		break;
-	    case 2:
-		if (peekbuf[1] == '\x00')
-		    doclose = 1;
-		break;
-	    default:
-		return FALSE;
-	}
-
-	if (cl->sslctx)
-	    n = rfbssl_read(cl, peekbuf, n);
-	else
-	    n = read(cl->sock, peekbuf, n);
-
-	if (doclose) {
-	    rfbErr("%s: websocket close frame received\n", __func__);
-	    rfbCloseClient(cl);
-	}
-	return TRUE;
-    }
-    return FALSE;
-}
-
diff --git a/ica/x11/libvncserver/zlib.c b/ica/x11/libvncserver/zlib.c
deleted file mode 100644
index ac20c9c..0000000
--- a/ica/x11/libvncserver/zlib.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * zlib.c
- *
- * Routines to implement zlib based encoding (deflate).
- */
-
-/*
- *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- *
- * For the latest source code, please check:
- *
- * http://www.developVNC.org/
- *
- * or send email to feedback at developvnc.org.
- */
-
-#include <rfb/rfb.h>
-
-/*
- * zlibBeforeBuf contains pixel data in the client's format.
- * zlibAfterBuf contains the zlib (deflated) encoding version.
- * If the zlib compressed/encoded version is
- * larger than the raw data or if it exceeds zlibAfterBufSize then
- * raw encoding is used instead.
- */
-
-/*
- * Out of lazyiness, we use thread local storage for zlib as we did for
- * tight.  N.B. ZRLE does it the traditional way with per-client storage
- * (and so at least ZRLE will work threaded on older systems.)
- */
-#if LIBVNCSERVER_HAVE_LIBPTHREAD && LIBVNCSERVER_HAVE_TLS && !defined(TLS) && defined(__linux__)
-#define TLS __thread
-#endif
-#ifndef TLS
-#define TLS
-#endif
-
-static TLS int zlibBeforeBufSize = 0;
-static TLS char *zlibBeforeBuf = NULL;
-
-static TLS int zlibAfterBufSize = 0;
-static TLS char *zlibAfterBuf = NULL;
-static TLS int zlibAfterBufLen = 0;
-
-void rfbZlibCleanup(rfbScreenInfoPtr screen)
-{
-  if (zlibBeforeBufSize) {
-    free(zlibBeforeBuf);
-    zlibBeforeBufSize=0;
-  }
-  if (zlibAfterBufSize) {
-    zlibAfterBufSize=0;
-    free(zlibAfterBuf);
-  }
-}
-
-
-/*
- * rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib
- *                              rectangle encoding.
- */
-
-static rfbBool
-rfbSendOneRectEncodingZlib(rfbClientPtr cl,
-                           int x,
-                           int y,
-                           int w,
-                           int h)
-{
-    rfbFramebufferUpdateRectHeader rect;
-    rfbZlibHeader hdr;
-    int deflateResult;
-    int previousOut;
-    int i;
-    char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)
-    	   + (x * (cl->scaledScreen->bitsPerPixel / 8)));
-
-    int maxRawSize;
-    int maxCompSize;
-
-    maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
-                  * (cl->format.bitsPerPixel / 8));
-
-    if (zlibBeforeBufSize < maxRawSize) {
-	zlibBeforeBufSize = maxRawSize;
-	if (zlibBeforeBuf == NULL)
-	    zlibBeforeBuf = (char *)malloc(zlibBeforeBufSize);
-	else
-	    zlibBeforeBuf = (char *)realloc(zlibBeforeBuf, zlibBeforeBufSize);
-    }
-
-    /* zlib compression is not useful for very small data sets.
-     * So, we just send these raw without any compression.
-     */
-    if (( w * h * (cl->scaledScreen->bitsPerPixel / 8)) <
-          VNC_ENCODE_ZLIB_MIN_COMP_SIZE ) {
-
-        int result;
-
-        /* The translation function (used also by the in raw encoding)
-         * requires 4/2/1 byte alignment in the output buffer (which is
-         * updateBuf for the raw encoding) based on the bitsPerPixel of
-         * the viewer/client.  This prevents SIGBUS errors on some
-         * architectures like SPARC, PARISC...
-         */
-        if (( cl->format.bitsPerPixel > 8 ) &&
-            ( cl->ublen % ( cl->format.bitsPerPixel / 8 )) != 0 ) {
-            if (!rfbSendUpdateBuf(cl))
-                return FALSE;
-        }
-
-        result = rfbSendRectEncodingRaw(cl, x, y, w, h);
-
-        return result;
-
-    }
-
-    /*
-     * zlib requires output buffer to be slightly larger than the input
-     * buffer, in the worst case.
-     */
-    maxCompSize = maxRawSize + (( maxRawSize + 99 ) / 100 ) + 12;
-
-    if (zlibAfterBufSize < maxCompSize) {
-	zlibAfterBufSize = maxCompSize;
-	if (zlibAfterBuf == NULL)
-	    zlibAfterBuf = (char *)malloc(zlibAfterBufSize);
-	else
-	    zlibAfterBuf = (char *)realloc(zlibAfterBuf, zlibAfterBufSize);
-    }
-
-
-    /* 
-     * Convert pixel data to client format.
-     */
-    (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,
-		       &cl->format, fbptr, zlibBeforeBuf,
-		       cl->scaledScreen->paddedWidthInBytes, w, h);
-
-    cl->compStream.next_in = ( Bytef * )zlibBeforeBuf;
-    cl->compStream.avail_in = w * h * (cl->format.bitsPerPixel / 8);
-    cl->compStream.next_out = ( Bytef * )zlibAfterBuf;
-    cl->compStream.avail_out = maxCompSize;
-    cl->compStream.data_type = Z_BINARY;
-
-    /* Initialize the deflation state. */
-    if ( cl->compStreamInited == FALSE ) {
-
-        cl->compStream.total_in = 0;
-        cl->compStream.total_out = 0;
-        cl->compStream.zalloc = Z_NULL;
-        cl->compStream.zfree = Z_NULL;
-        cl->compStream.opaque = Z_NULL;
-
-        deflateInit2( &(cl->compStream),
-                        cl->zlibCompressLevel,
-                        Z_DEFLATED,
-                        MAX_WBITS,
-                        MAX_MEM_LEVEL,
-                        Z_DEFAULT_STRATEGY );
-        /* deflateInit( &(cl->compStream), Z_BEST_COMPRESSION ); */
-        /* deflateInit( &(cl->compStream), Z_BEST_SPEED ); */
-        cl->compStreamInited = TRUE;
-
-    }
-
-    previousOut = cl->compStream.total_out;
-
-    /* Perform the compression here. */
-    deflateResult = deflate( &(cl->compStream), Z_SYNC_FLUSH );
-
-    /* Find the total size of the resulting compressed data. */
-    zlibAfterBufLen = cl->compStream.total_out - previousOut;
-
-    if ( deflateResult != Z_OK ) {
-        rfbErr("zlib deflation error: %s\n", cl->compStream.msg);
-        return FALSE;
-    }
-
-    /* Note that it is not possible to switch zlib parameters based on
-     * the results of the compression pass.  The reason is
-     * that we rely on the compressor and decompressor states being
-     * in sync.  Compressing and then discarding the results would
-     * cause lose of synchronization.
-     */
-
-    /* Update statics */
-    rfbStatRecordEncodingSent(cl, rfbEncodingZlib, sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader + zlibAfterBufLen,
-        + w * (cl->format.bitsPerPixel / 8) * h);
-
-    if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader
-	> UPDATE_BUF_SIZE)
-    {
-	if (!rfbSendUpdateBuf(cl))
-	    return FALSE;
-    }
-
-    rect.r.x = Swap16IfLE(x);
-    rect.r.y = Swap16IfLE(y);
-    rect.r.w = Swap16IfLE(w);
-    rect.r.h = Swap16IfLE(h);
-    rect.encoding = Swap32IfLE(rfbEncodingZlib);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&rect,
-	   sz_rfbFramebufferUpdateRectHeader);
-    cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-    hdr.nBytes = Swap32IfLE(zlibAfterBufLen);
-
-    memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbZlibHeader);
-    cl->ublen += sz_rfbZlibHeader;
-
-    for (i = 0; i < zlibAfterBufLen;) {
-
-	int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
-
-	if (i + bytesToCopy > zlibAfterBufLen) {
-	    bytesToCopy = zlibAfterBufLen - i;
-	}
-
-	memcpy(&cl->updateBuf[cl->ublen], &zlibAfterBuf[i], bytesToCopy);
-
-	cl->ublen += bytesToCopy;
-	i += bytesToCopy;
-
-	if (cl->ublen == UPDATE_BUF_SIZE) {
-	    if (!rfbSendUpdateBuf(cl))
-		return FALSE;
-	}
-    }
-
-    return TRUE;
-
-}
-
-
-/*
- * rfbSendRectEncodingZlib - send a given rectangle using one or more
- *                           Zlib encoding rectangles.
- */
-
-rfbBool
-rfbSendRectEncodingZlib(rfbClientPtr cl,
-                        int x,
-                        int y,
-                        int w,
-                        int h)
-{
-    int  maxLines;
-    int  linesRemaining;
-    rfbRectangle partialRect;
-
-    partialRect.x = x;
-    partialRect.y = y;
-    partialRect.w = w;
-    partialRect.h = h;
-
-    /* Determine maximum pixel/scan lines allowed per rectangle. */
-    maxLines = ( ZLIB_MAX_SIZE(w) / w );
-
-    /* Initialize number of scan lines left to do. */
-    linesRemaining = h;
-
-    /* Loop until all work is done. */
-    while ( linesRemaining > 0 ) {
-
-        int linesToComp;
-
-        if ( maxLines < linesRemaining )
-            linesToComp = maxLines;
-        else
-            linesToComp = linesRemaining;
-
-        partialRect.h = linesToComp;
-
-        /* Encode (compress) and send the next rectangle. */
-        if ( ! rfbSendOneRectEncodingZlib( cl,
-                                           partialRect.x,
-                                           partialRect.y,
-                                           partialRect.w,
-                                           partialRect.h )) {
-
-            return FALSE;
-        }
-
-        /* Technically, flushing the buffer here is not extrememly
-         * efficient.  However, this improves the overall throughput
-         * of the system over very slow networks.  By flushing
-         * the buffer with every maximum size zlib rectangle, we
-         * improve the pipelining usage of the server CPU, network,
-         * and viewer CPU components.  Insuring that these components
-         * are working in parallel actually improves the performance
-         * seen by the user.
-         * Since, zlib is most useful for slow networks, this flush
-         * is appropriate for the desired behavior of the zlib encoding.
-         */
-        if (( cl->ublen > 0 ) &&
-            ( linesToComp == maxLines )) {
-            if (!rfbSendUpdateBuf(cl)) {
-
-                return FALSE;
-            }
-        }
-
-        /* Update remaining and incremental rectangle location. */
-        linesRemaining -= linesToComp;
-        partialRect.y += linesToComp;
-
-    }
-
-    return TRUE;
-
-}
-
diff --git a/ica/x11/libvncserver/zrle.c b/ica/x11/libvncserver/zrle.c
deleted file mode 100644
index 80f629c..0000000
--- a/ica/x11/libvncserver/zrle.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2003 Sun Microsystems, Inc.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-/*
- * zrle.c
- *
- * Routines to implement Zlib Run-length Encoding (ZRLE).
- */
-
-#include "rfb/rfb.h"
-#include "private.h"
-#include "zrleoutstream.h"
-
-
-#define GET_IMAGE_INTO_BUF(tx,ty,tw,th,buf)                                \
-{  char *fbptr = (cl->scaledScreen->frameBuffer                                   \
-		 + (cl->scaledScreen->paddedWidthInBytes * ty)                   \
-                 + (tx * (cl->scaledScreen->bitsPerPixel / 8)));                 \
-                                                                           \
-  (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,\
-                     &cl->format, fbptr, (char*)buf,                       \
-                     cl->scaledScreen->paddedWidthInBytes, tw, th); }
-
-#define EXTRA_ARGS , rfbClientPtr cl
-
-#define ENDIAN_LITTLE 0
-#define ENDIAN_BIG 1
-#define ENDIAN_NO 2
-#define BPP 8
-#define ZYWRLE_ENDIAN ENDIAN_NO
-#include <zrleencodetemplate.c>
-#undef BPP
-#define BPP 15
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_LITTLE
-#include <zrleencodetemplate.c>
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_BIG
-#include <zrleencodetemplate.c>
-#undef BPP
-#define BPP 16
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_LITTLE
-#include <zrleencodetemplate.c>
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_BIG
-#include <zrleencodetemplate.c>
-#undef BPP
-#define BPP 32
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_LITTLE
-#include <zrleencodetemplate.c>
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_BIG
-#include <zrleencodetemplate.c>
-#define CPIXEL 24A
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_LITTLE
-#include <zrleencodetemplate.c>
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_BIG
-#include <zrleencodetemplate.c>
-#undef CPIXEL
-#define CPIXEL 24B
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_LITTLE
-#include <zrleencodetemplate.c>
-#undef ZYWRLE_ENDIAN
-#define ZYWRLE_ENDIAN ENDIAN_BIG
-#include <zrleencodetemplate.c>
-#undef CPIXEL
-#undef BPP
-
-
-/*
- * zrleBeforeBuf contains pixel data in the client's format.  It must be at
- * least one pixel bigger than the largest tile of pixel data, since the
- * ZRLE encoding algorithm writes to the position one past the end of the pixel
- * data.
- */
-
-
-/*
- * rfbSendRectEncodingZRLE - send a given rectangle using ZRLE encoding.
- */
-
-rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h)
-{
-  zrleOutStream* zos;
-  rfbFramebufferUpdateRectHeader rect;
-  rfbZRLEHeader hdr;
-  int i;
-  char *zrleBeforeBuf;
-
-  if (cl->zrleBeforeBuf == NULL) {
-	cl->zrleBeforeBuf = (char *) malloc(rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4);
-  }
-  zrleBeforeBuf = cl->zrleBeforeBuf;
-
-  if (cl->preferredEncoding == rfbEncodingZYWRLE) {
-	  if (cl->tightQualityLevel < 0) {
-		  cl->zywrleLevel = 1;
-	  } else if (cl->tightQualityLevel < 3) {
-		  cl->zywrleLevel = 3;
-	  } else if (cl->tightQualityLevel < 6) {
-		  cl->zywrleLevel = 2;
-	  } else {
-		  cl->zywrleLevel = 1;
-	  }
-  } else
-	  cl->zywrleLevel = 0;
-
-  if (!cl->zrleData)
-    cl->zrleData = zrleOutStreamNew();
-  zos = cl->zrleData;
-  zos->in.ptr = zos->in.start;
-  zos->out.ptr = zos->out.start;
-
-  switch (cl->format.bitsPerPixel) {
-
-  case 8:
-    zrleEncode8NE(x, y, w, h, zos, zrleBeforeBuf, cl);
-    break;
-
-  case 16:
-	if (cl->format.greenMax > 0x1F) {
-		if (cl->format.bigEndian)
-		  zrleEncode16BE(x, y, w, h, zos, zrleBeforeBuf, cl);
-		else
-		  zrleEncode16LE(x, y, w, h, zos, zrleBeforeBuf, cl);
-	} else {
-		if (cl->format.bigEndian)
-		  zrleEncode15BE(x, y, w, h, zos, zrleBeforeBuf, cl);
-		else
-		  zrleEncode15LE(x, y, w, h, zos, zrleBeforeBuf, cl);
-	}
-    break;
-
-  case 32: {
-    rfbBool fitsInLS3Bytes
-      = ((cl->format.redMax   << cl->format.redShift)   < (1<<24) &&
-         (cl->format.greenMax << cl->format.greenShift) < (1<<24) &&
-         (cl->format.blueMax  << cl->format.blueShift)  < (1<<24));
-
-    rfbBool fitsInMS3Bytes = (cl->format.redShift   > 7  &&
-                           cl->format.greenShift > 7  &&
-                           cl->format.blueShift  > 7);
-
-    if ((fitsInLS3Bytes && !cl->format.bigEndian) ||
-        (fitsInMS3Bytes && cl->format.bigEndian)) {
-	if (cl->format.bigEndian)
-		zrleEncode24ABE(x, y, w, h, zos, zrleBeforeBuf, cl);
-	else
-		zrleEncode24ALE(x, y, w, h, zos, zrleBeforeBuf, cl);
-    }
-    else if ((fitsInLS3Bytes && cl->format.bigEndian) ||
-             (fitsInMS3Bytes && !cl->format.bigEndian)) {
-	if (cl->format.bigEndian)
-		zrleEncode24BBE(x, y, w, h, zos, zrleBeforeBuf, cl);
-	else
-		zrleEncode24BLE(x, y, w, h, zos, zrleBeforeBuf, cl);
-    }
-    else {
-	if (cl->format.bigEndian)
-		zrleEncode32BE(x, y, w, h, zos, zrleBeforeBuf, cl);
-	else
-		zrleEncode32LE(x, y, w, h, zos, zrleBeforeBuf, cl);
-    }
-  }
-    break;
-  }
-
-  rfbStatRecordEncodingSent(cl, rfbEncodingZRLE, sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader + ZRLE_BUFFER_LENGTH(&zos->out),
-      + w * (cl->format.bitsPerPixel / 8) * h);
-
-  if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader
-      > UPDATE_BUF_SIZE)
-    {
-      if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-    }
-
-  rect.r.x = Swap16IfLE(x);
-  rect.r.y = Swap16IfLE(y);
-  rect.r.w = Swap16IfLE(w);
-  rect.r.h = Swap16IfLE(h);
-  rect.encoding = Swap32IfLE(cl->preferredEncoding);
-
-  memcpy(cl->updateBuf+cl->ublen, (char *)&rect,
-         sz_rfbFramebufferUpdateRectHeader);
-  cl->ublen += sz_rfbFramebufferUpdateRectHeader;
-
-  hdr.length = Swap32IfLE(ZRLE_BUFFER_LENGTH(&zos->out));
-
-  memcpy(cl->updateBuf+cl->ublen, (char *)&hdr, sz_rfbZRLEHeader);
-  cl->ublen += sz_rfbZRLEHeader;
-
-  /* copy into updateBuf and send from there.  Maybe should send directly? */
-
-  for (i = 0; i < ZRLE_BUFFER_LENGTH(&zos->out);) {
-
-    int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
-
-    if (i + bytesToCopy > ZRLE_BUFFER_LENGTH(&zos->out)) {
-      bytesToCopy = ZRLE_BUFFER_LENGTH(&zos->out) - i;
-    }
-
-    memcpy(cl->updateBuf+cl->ublen, (uint8_t*)zos->out.start + i, bytesToCopy);
-
-    cl->ublen += bytesToCopy;
-    i += bytesToCopy;
-
-    if (cl->ublen == UPDATE_BUF_SIZE) {
-      if (!rfbSendUpdateBuf(cl))
-        return FALSE;
-    }
-  }
-
-  return TRUE;
-}
-
-
-void rfbFreeZrleData(rfbClientPtr cl)
-{
-	if (cl->zrleData) {
-		zrleOutStreamFree(cl->zrleData);
-	}
-	cl->zrleData = NULL;
-
-	if (cl->zrleBeforeBuf) {
-		free(cl->zrleBeforeBuf);
-	}
-	cl->zrleBeforeBuf = NULL;
-
-	if (cl->paletteHelper) {
-		free(cl->paletteHelper);
-	}
-	cl->paletteHelper = NULL;
-}
-
diff --git a/ica/x11/libvncserver/zrleencodetemplate.c b/ica/x11/libvncserver/zrleencodetemplate.c
deleted file mode 100644
index b6de755..0000000
--- a/ica/x11/libvncserver/zrleencodetemplate.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2003 Sun Microsystems, Inc.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-/*
- * Before including this file, you must define a number of CPP macros.
- *
- * BPP should be 8, 16 or 32 depending on the bits per pixel.
- * GET_IMAGE_INTO_BUF should be some code which gets a rectangle of pixel data
- * into the given buffer.  EXTRA_ARGS can be defined to pass any other
- * arguments needed by GET_IMAGE_INTO_BUF.
- *
- * Note that the buf argument to ZRLE_ENCODE needs to be at least one pixel
- * bigger than the largest tile of pixel data, since the ZRLE encoding
- * algorithm writes to the position one past the end of the pixel data.
- */
-
-#include "zrleoutstream.h"
-#include "zrlepalettehelper.h"
-#include <assert.h>
-
-/* __RFB_CONCAT2 concatenates its two arguments.  __RFB_CONCAT2E does the same
-   but also expands its arguments if they are macros */
-
-#ifndef __RFB_CONCAT2E
-#define __RFB_CONCAT2(a,b) a##b
-#define __RFB_CONCAT2E(a,b) __RFB_CONCAT2(a,b)
-#endif
-
-#ifndef __RFB_CONCAT3E
-#define __RFB_CONCAT3(a,b,c) a##b##c
-#define __RFB_CONCAT3E(a,b,c) __RFB_CONCAT3(a,b,c)
-#endif
-
-#undef END_FIX
-#if ZYWRLE_ENDIAN == ENDIAN_LITTLE
-#  define END_FIX LE
-#elif ZYWRLE_ENDIAN == ENDIAN_BIG
-#  define END_FIX BE
-#else
-#  define END_FIX NE
-#endif
-
-#ifdef CPIXEL
-#define PIXEL_T __RFB_CONCAT2E(zrle_U,BPP)
-#define zrleOutStreamWRITE_PIXEL __RFB_CONCAT2E(zrleOutStreamWriteOpaque,CPIXEL)
-#define ZRLE_ENCODE __RFB_CONCAT3E(zrleEncode,CPIXEL,END_FIX)
-#define ZRLE_ENCODE_TILE __RFB_CONCAT3E(zrleEncodeTile,CPIXEL,END_FIX)
-#define BPPOUT 24
-#elif BPP==15
-#define PIXEL_T __RFB_CONCAT2E(zrle_U,16)
-#define zrleOutStreamWRITE_PIXEL __RFB_CONCAT2E(zrleOutStreamWriteOpaque,16)
-#define ZRLE_ENCODE __RFB_CONCAT3E(zrleEncode,BPP,END_FIX)
-#define ZRLE_ENCODE_TILE __RFB_CONCAT3E(zrleEncodeTile,BPP,END_FIX)
-#define BPPOUT 16
-#else
-#define PIXEL_T __RFB_CONCAT2E(zrle_U,BPP)
-#define zrleOutStreamWRITE_PIXEL __RFB_CONCAT2E(zrleOutStreamWriteOpaque,BPP)
-#define ZRLE_ENCODE __RFB_CONCAT3E(zrleEncode,BPP,END_FIX)
-#define ZRLE_ENCODE_TILE __RFB_CONCAT3E(zrleEncodeTile,BPP,END_FIX)
-#define BPPOUT BPP
-#endif
-
-#ifndef ZRLE_ONCE
-#define ZRLE_ONCE
-
-static const int bitsPerPackedPixel[] = {
-  0, 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
-};
-
-#endif /* ZRLE_ONCE */
-
-void ZRLE_ENCODE_TILE (PIXEL_T* data, int w, int h, zrleOutStream* os,
-		int zywrle_level, int *zywrleBuf, void *paletteHelper);
-
-#if BPP!=8
-#define ZYWRLE_ENCODE
-#include "zywrletemplate.c"
-#endif
-
-static void ZRLE_ENCODE (int x, int y, int w, int h,
-		  zrleOutStream* os, void* buf
-                  EXTRA_ARGS
-                  )
-{
-  int ty;
-  for (ty = y; ty < y+h; ty += rfbZRLETileHeight) {
-    int tx, th = rfbZRLETileHeight;
-    if (th > y+h-ty) th = y+h-ty;
-    for (tx = x; tx < x+w; tx += rfbZRLETileWidth) {
-      int tw = rfbZRLETileWidth;
-      if (tw > x+w-tx) tw = x+w-tx;
-
-      GET_IMAGE_INTO_BUF(tx,ty,tw,th,buf);
-
-      if (cl->paletteHelper == NULL) {
-          cl->paletteHelper = (void *) calloc(sizeof(zrlePaletteHelper), 1);
-      }
-
-      ZRLE_ENCODE_TILE((PIXEL_T*)buf, tw, th, os,
-		      cl->zywrleLevel, cl->zywrleBuf, cl->paletteHelper);
-    }
-  }
-  zrleOutStreamFlush(os);
-}
-
-
-void ZRLE_ENCODE_TILE(PIXEL_T* data, int w, int h, zrleOutStream* os,
-	int zywrle_level, int *zywrleBuf,  void *paletteHelper)
-{
-  /* First find the palette and the number of runs */
-
-  zrlePaletteHelper *ph;
-
-  int runs = 0;
-  int singlePixels = 0;
-
-  rfbBool useRle;
-  rfbBool usePalette;
-
-  int estimatedBytes;
-  int plainRleBytes;
-  int i;
-
-  PIXEL_T* ptr = data;
-  PIXEL_T* end = ptr + h * w;
-  *end = ~*(end-1); /* one past the end is different so the while loop ends */
-
-  ph = (zrlePaletteHelper *) paletteHelper;
-  zrlePaletteHelperInit(ph);
-
-  while (ptr < end) {
-    PIXEL_T pix = *ptr;
-    if (*++ptr != pix) {
-      singlePixels++;
-    } else {
-      while (*++ptr == pix) ;
-      runs++;
-    }
-    zrlePaletteHelperInsert(ph, pix);
-  }
-
-  /* Solid tile is a special case */
-
-  if (ph->size == 1) {
-    zrleOutStreamWriteU8(os, 1);
-    zrleOutStreamWRITE_PIXEL(os, ph->palette[0]);
-    return;
-  }
-
-  /* Try to work out whether to use RLE and/or a palette.  We do this by
-     estimating the number of bytes which will be generated and picking the
-     method which results in the fewest bytes.  Of course this may not result
-     in the fewest bytes after compression... */
-
-  useRle = FALSE;
-  usePalette = FALSE;
-
-  estimatedBytes = w * h * (BPPOUT/8); /* start assuming raw */
-
-#if BPP!=8
-  if (zywrle_level > 0 && !(zywrle_level & 0x80))
-	  estimatedBytes >>= zywrle_level;
-#endif
-
-  plainRleBytes = ((BPPOUT/8)+1) * (runs + singlePixels);
-
-  if (plainRleBytes < estimatedBytes) {
-    useRle = TRUE;
-    estimatedBytes = plainRleBytes;
-  }
-
-  if (ph->size < 128) {
-    int paletteRleBytes = (BPPOUT/8) * ph->size + 2 * runs + singlePixels;
-
-    if (paletteRleBytes < estimatedBytes) {
-      useRle = TRUE;
-      usePalette = TRUE;
-      estimatedBytes = paletteRleBytes;
-    }
-
-    if (ph->size < 17) {
-      int packedBytes = ((BPPOUT/8) * ph->size +
-                         w * h * bitsPerPackedPixel[ph->size-1] / 8);
-
-      if (packedBytes < estimatedBytes) {
-        useRle = FALSE;
-        usePalette = TRUE;
-        estimatedBytes = packedBytes;
-      }
-    }
-  }
-
-  if (!usePalette) ph->size = 0;
-
-  zrleOutStreamWriteU8(os, (useRle ? 128 : 0) | ph->size);
-
-  for (i = 0; i < ph->size; i++) {
-    zrleOutStreamWRITE_PIXEL(os, ph->palette[i]);
-  }
-
-  if (useRle) {
-
-    PIXEL_T* ptr = data;
-    PIXEL_T* end = ptr + w * h;
-    PIXEL_T* runStart;
-    PIXEL_T pix;
-    while (ptr < end) {
-      int len;
-      runStart = ptr;
-      pix = *ptr++;
-      while (*ptr == pix && ptr < end)
-        ptr++;
-      len = ptr - runStart;
-      if (len <= 2 && usePalette) {
-        int index = zrlePaletteHelperLookup(ph, pix);
-        if (len == 2)
-          zrleOutStreamWriteU8(os, index);
-        zrleOutStreamWriteU8(os, index);
-        continue;
-      }
-      if (usePalette) {
-        int index = zrlePaletteHelperLookup(ph, pix);
-        zrleOutStreamWriteU8(os, index | 128);
-      } else {
-        zrleOutStreamWRITE_PIXEL(os, pix);
-      }
-      len -= 1;
-      while (len >= 255) {
-        zrleOutStreamWriteU8(os, 255);
-        len -= 255;
-      }
-      zrleOutStreamWriteU8(os, len);
-    }
-
-  } else {
-
-    /* no RLE */
-
-    if (usePalette) {
-      int bppp;
-      PIXEL_T* ptr = data;
-
-      /* packed pixels */
-
-      assert (ph->size < 17);
-
-      bppp = bitsPerPackedPixel[ph->size-1];
-
-      for (i = 0; i < h; i++) {
-        zrle_U8 nbits = 0;
-        zrle_U8 byte = 0;
-
-        PIXEL_T* eol = ptr + w;
-
-        while (ptr < eol) {
-          PIXEL_T pix = *ptr++;
-          zrle_U8 index = zrlePaletteHelperLookup(ph, pix);
-          byte = (byte << bppp) | index;
-          nbits += bppp;
-          if (nbits >= 8) {
-            zrleOutStreamWriteU8(os, byte);
-            nbits = 0;
-          }
-        }
-        if (nbits > 0) {
-          byte <<= 8 - nbits;
-          zrleOutStreamWriteU8(os, byte);
-        }
-      }
-    } else {
-
-      /* raw */
-
-#if BPP!=8
-      if (zywrle_level > 0 && !(zywrle_level & 0x80)) {
-        ZYWRLE_ANALYZE(data, data, w, h, w, zywrle_level, zywrleBuf);
-	ZRLE_ENCODE_TILE(data, w, h, os, zywrle_level | 0x80, zywrleBuf, paletteHelper);
-      }
-      else
-#endif
-      {
-#ifdef CPIXEL
-        PIXEL_T *ptr;
-        for (ptr = data; ptr < data+w*h; ptr++)
-          zrleOutStreamWRITE_PIXEL(os, *ptr);
-#else
-        zrleOutStreamWriteBytes(os, (zrle_U8 *)data, w*h*(BPP/8));
-#endif
-      }
-    }
-  }
-}
-
-#undef PIXEL_T
-#undef zrleOutStreamWRITE_PIXEL
-#undef ZRLE_ENCODE
-#undef ZRLE_ENCODE_TILE
-#undef ZYWRLE_ENCODE_TILE
-#undef BPPOUT
diff --git a/ica/x11/libvncserver/zrleoutstream.c b/ica/x11/libvncserver/zrleoutstream.c
deleted file mode 100644
index 4efe609..0000000
--- a/ica/x11/libvncserver/zrleoutstream.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2003 Sun Microsystems, Inc.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#include "zrleoutstream.h"
-#include <stdlib.h>
-
-#define ZRLE_IN_BUFFER_SIZE  16384
-#define ZRLE_OUT_BUFFER_SIZE 1024
-#undef  ZRLE_DEBUG
-
-static rfbBool zrleBufferAlloc(zrleBuffer *buffer, int size)
-{
-  buffer->ptr = buffer->start = malloc(size);
-  if (buffer->start == NULL) {
-    buffer->end = NULL;
-    return FALSE;
-  }
-
-  buffer->end = buffer->start + size;
-
-  return TRUE;
-}
-
-static void zrleBufferFree(zrleBuffer *buffer)
-{
-  if (buffer->start)
-    free(buffer->start);
-  buffer->start = buffer->ptr = buffer->end = NULL;
-}
-
-static rfbBool zrleBufferGrow(zrleBuffer *buffer, int size)
-{
-  int offset;
-
-  size  += buffer->end - buffer->start;
-  offset = ZRLE_BUFFER_LENGTH (buffer);
-
-  buffer->start = realloc(buffer->start, size);
-  if (!buffer->start) {
-    return FALSE;
-  }
-
-  buffer->end = buffer->start + size;
-  buffer->ptr = buffer->start + offset;
-
-  return TRUE;
-}
-
-zrleOutStream *zrleOutStreamNew(void)
-{
-  zrleOutStream *os;
-
-  os = malloc(sizeof(zrleOutStream));
-  if (os == NULL)
-    return NULL;
-
-  if (!zrleBufferAlloc(&os->in, ZRLE_IN_BUFFER_SIZE)) {
-    free(os);
-    return NULL;
-  }
-
-  if (!zrleBufferAlloc(&os->out, ZRLE_OUT_BUFFER_SIZE)) {
-    zrleBufferFree(&os->in);
-    free(os);
-    return NULL;
-  }
-
-  os->zs.zalloc = Z_NULL;
-  os->zs.zfree  = Z_NULL;
-  os->zs.opaque = Z_NULL;
-  if (deflateInit(&os->zs, Z_DEFAULT_COMPRESSION) != Z_OK) {
-    zrleBufferFree(&os->in);
-    free(os);
-    return NULL;
-  }
-
-  return os;
-}
-
-void zrleOutStreamFree (zrleOutStream *os)
-{
-  deflateEnd(&os->zs);
-  zrleBufferFree(&os->in);
-  zrleBufferFree(&os->out);
-  free(os);
-}
-
-rfbBool zrleOutStreamFlush(zrleOutStream *os)
-{
-  os->zs.next_in = os->in.start;
-  os->zs.avail_in = ZRLE_BUFFER_LENGTH (&os->in);
-  
-#ifdef ZRLE_DEBUG
-  rfbLog("zrleOutStreamFlush: avail_in %d\n", os->zs.avail_in);
-#endif
-
-  while (os->zs.avail_in != 0) {
-    do {
-      int ret;
-
-      if (os->out.ptr >= os->out.end &&
-	  !zrleBufferGrow(&os->out, os->out.end - os->out.start)) {
-	rfbLog("zrleOutStreamFlush: failed to grow output buffer\n");
-	return FALSE;
-      }
-
-      os->zs.next_out = os->out.ptr;
-      os->zs.avail_out = os->out.end - os->out.ptr;
-
-#ifdef ZRLE_DEBUG
-      rfbLog("zrleOutStreamFlush: calling deflate, avail_in %d, avail_out %d\n",
-	     os->zs.avail_in, os->zs.avail_out);
-#endif 
-
-      if ((ret = deflate(&os->zs, Z_SYNC_FLUSH)) != Z_OK) {
-	rfbLog("zrleOutStreamFlush: deflate failed with error code %d\n", ret);
-	return FALSE;
-      }
-
-#ifdef ZRLE_DEBUG
-      rfbLog("zrleOutStreamFlush: after deflate: %d bytes\n",
-	     os->zs.next_out - os->out.ptr);
-#endif
-
-      os->out.ptr = os->zs.next_out;
-    } while (os->zs.avail_out == 0);
-  }
-
-  os->in.ptr = os->in.start;
- 
-  return TRUE;
-}
-
-static int zrleOutStreamOverrun(zrleOutStream *os,
-				int            size)
-{
-#ifdef ZRLE_DEBUG
-  rfbLog("zrleOutStreamOverrun\n");
-#endif
-
-  while (os->in.end - os->in.ptr < size && os->in.ptr > os->in.start) {
-    os->zs.next_in = os->in.start;
-    os->zs.avail_in = ZRLE_BUFFER_LENGTH (&os->in);
-
-    do {
-      int ret;
-
-      if (os->out.ptr >= os->out.end &&
-	  !zrleBufferGrow(&os->out, os->out.end - os->out.start)) {
-	rfbLog("zrleOutStreamOverrun: failed to grow output buffer\n");
-	return FALSE;
-      }
-
-      os->zs.next_out = os->out.ptr;
-      os->zs.avail_out = os->out.end - os->out.ptr;
-
-#ifdef ZRLE_DEBUG
-      rfbLog("zrleOutStreamOverrun: calling deflate, avail_in %d, avail_out %d\n",
-	     os->zs.avail_in, os->zs.avail_out);
-#endif
-
-      if ((ret = deflate(&os->zs, 0)) != Z_OK) {
-	rfbLog("zrleOutStreamOverrun: deflate failed with error code %d\n", ret);
-	return 0;
-      }
-
-#ifdef ZRLE_DEBUG
-      rfbLog("zrleOutStreamOverrun: after deflate: %d bytes\n",
-	     os->zs.next_out - os->out.ptr);
-#endif
-
-      os->out.ptr = os->zs.next_out;
-    } while (os->zs.avail_out == 0);
-
-    /* output buffer not full */
-
-    if (os->zs.avail_in == 0) {
-      os->in.ptr = os->in.start;
-    } else {
-      /* but didn't consume all the data?  try shifting what's left to the
-       * start of the buffer.
-       */
-      rfbLog("zrleOutStreamOverrun: out buf not full, but in data not consumed\n");
-      memmove(os->in.start, os->zs.next_in, os->in.ptr - os->zs.next_in);
-      os->in.ptr -= os->zs.next_in - os->in.start;
-    }
-  }
-
-  if (size > os->in.end - os->in.ptr)
-    size = os->in.end - os->in.ptr;
-
-  return size;
-}
-
-static int zrleOutStreamCheck(zrleOutStream *os, int size)
-{
-  if (os->in.ptr + size > os->in.end) {
-    return zrleOutStreamOverrun(os, size);
-  }
-  return size;
-}
-
-void zrleOutStreamWriteBytes(zrleOutStream *os,
-			     const zrle_U8 *data,
-			     int            length)
-{
-  const zrle_U8* dataEnd = data + length;
-  while (data < dataEnd) {
-    int n = zrleOutStreamCheck(os, dataEnd - data);
-    memcpy(os->in.ptr, data, n);
-    os->in.ptr += n;
-    data += n;
-  }
-}
-
-void zrleOutStreamWriteU8(zrleOutStream *os, zrle_U8 u)
-{
-  zrleOutStreamCheck(os, 1);
-  *os->in.ptr++ = u;
-}
-
-void zrleOutStreamWriteOpaque8(zrleOutStream *os, zrle_U8 u)
-{
-  zrleOutStreamCheck(os, 1);
-  *os->in.ptr++ = u;
-}
-
-void zrleOutStreamWriteOpaque16 (zrleOutStream *os, zrle_U16 u)
-{
-  zrleOutStreamCheck(os, 2);
-  *os->in.ptr++ = ((zrle_U8*)&u)[0];
-  *os->in.ptr++ = ((zrle_U8*)&u)[1];
-}
-
-void zrleOutStreamWriteOpaque32 (zrleOutStream *os, zrle_U32 u)
-{
-  zrleOutStreamCheck(os, 4);
-  *os->in.ptr++ = ((zrle_U8*)&u)[0];
-  *os->in.ptr++ = ((zrle_U8*)&u)[1];
-  *os->in.ptr++ = ((zrle_U8*)&u)[2];
-  *os->in.ptr++ = ((zrle_U8*)&u)[3];
-}
-
-void zrleOutStreamWriteOpaque24A(zrleOutStream *os, zrle_U32 u)
-{
-  zrleOutStreamCheck(os, 3);
-  *os->in.ptr++ = ((zrle_U8*)&u)[0];
-  *os->in.ptr++ = ((zrle_U8*)&u)[1];
-  *os->in.ptr++ = ((zrle_U8*)&u)[2];
-}
-
-void zrleOutStreamWriteOpaque24B(zrleOutStream *os, zrle_U32 u)
-{
-  zrleOutStreamCheck(os, 3);
-  *os->in.ptr++ = ((zrle_U8*)&u)[1];
-  *os->in.ptr++ = ((zrle_U8*)&u)[2];
-  *os->in.ptr++ = ((zrle_U8*)&u)[3];
-}
diff --git a/ica/x11/libvncserver/zrleoutstream.h b/ica/x11/libvncserver/zrleoutstream.h
deleted file mode 100644
index 9e4fe51..0000000
--- a/ica/x11/libvncserver/zrleoutstream.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2003 Sun Microsystems, Inc.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#ifndef __ZRLE_OUT_STREAM_H__
-#define __ZRLE_OUT_STREAM_H__
-
-#include <zlib.h>
-#include "zrletypes.h"
-#include "rfb/rfb.h"
-
-typedef struct {
-  zrle_U8 *start;
-  zrle_U8 *ptr;
-  zrle_U8 *end;
-} zrleBuffer;
-
-typedef struct {
-  zrleBuffer in;
-  zrleBuffer out;
-
-  z_stream   zs;
-} zrleOutStream;
-
-#define ZRLE_BUFFER_LENGTH(b) ((b)->ptr - (b)->start)
-
-zrleOutStream *zrleOutStreamNew           (void);
-void           zrleOutStreamFree          (zrleOutStream *os);
-rfbBool        zrleOutStreamFlush         (zrleOutStream *os);
-void           zrleOutStreamWriteBytes    (zrleOutStream *os,
-					   const zrle_U8 *data,
-					   int            length);
-void           zrleOutStreamWriteU8       (zrleOutStream *os,
-					   zrle_U8        u);
-void           zrleOutStreamWriteOpaque8  (zrleOutStream *os,
-					   zrle_U8        u);
-void           zrleOutStreamWriteOpaque16 (zrleOutStream *os,
-					   zrle_U16       u);
-void           zrleOutStreamWriteOpaque32 (zrleOutStream *os,
-					   zrle_U32       u);
-void           zrleOutStreamWriteOpaque24A(zrleOutStream *os,
-					   zrle_U32       u);
-void           zrleOutStreamWriteOpaque24B(zrleOutStream *os,
-					   zrle_U32       u);
-
-#endif /* __ZRLE_OUT_STREAM_H__ */
diff --git a/ica/x11/libvncserver/zrlepalettehelper.c b/ica/x11/libvncserver/zrlepalettehelper.c
deleted file mode 100644
index d758a26..0000000
--- a/ica/x11/libvncserver/zrlepalettehelper.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2003 Sun Microsystems, Inc.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#include "zrlepalettehelper.h"
-#include <assert.h>
-#include <string.h>
-
-#define ZRLE_HASH(pix) (((pix) ^ ((pix) >> 17)) & 4095)
-
-void zrlePaletteHelperInit(zrlePaletteHelper *helper)
-{
-  memset(helper->palette, 0, sizeof(helper->palette));
-  memset(helper->index, 255, sizeof(helper->index));
-  memset(helper->key, 0, sizeof(helper->key));
-  helper->size = 0;
-}
-
-void zrlePaletteHelperInsert(zrlePaletteHelper *helper, zrle_U32 pix)
-{
-  if (helper->size < ZRLE_PALETTE_MAX_SIZE) {
-    int i = ZRLE_HASH(pix);
-
-    while (helper->index[i] != 255 && helper->key[i] != pix)
-      i++;
-    if (helper->index[i] != 255) return;
-
-    helper->index[i] = helper->size;
-    helper->key[i] = pix;
-    helper->palette[helper->size] = pix;
-  }
-  helper->size++;
-}
-
-int zrlePaletteHelperLookup(zrlePaletteHelper *helper, zrle_U32 pix)
-{
-  int i = ZRLE_HASH(pix);
-
-  assert(helper->size <= ZRLE_PALETTE_MAX_SIZE);
-  
-  while (helper->index[i] != 255 && helper->key[i] != pix)
-    i++;
-  if (helper->index[i] != 255) return helper->index[i];
-
-  return -1;
-}
diff --git a/ica/x11/libvncserver/zrlepalettehelper.h b/ica/x11/libvncserver/zrlepalettehelper.h
deleted file mode 100644
index e1213d1..0000000
--- a/ica/x11/libvncserver/zrlepalettehelper.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2003 Sun Microsystems, Inc.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-/*
- * The PaletteHelper class helps us build up the palette from pixel data by
- * storing a reverse index using a simple hash-table
- */
-
-#ifndef __ZRLE_PALETTE_HELPER_H__
-#define __ZRLE_PALETTE_HELPER_H__
-
-#include "zrletypes.h"
-
-#define ZRLE_PALETTE_MAX_SIZE 127
-
-typedef struct {
-  zrle_U32  palette[ZRLE_PALETTE_MAX_SIZE];
-  zrle_U8   index[ZRLE_PALETTE_MAX_SIZE + 4096];
-  zrle_U32  key[ZRLE_PALETTE_MAX_SIZE + 4096];
-  int       size;
-} zrlePaletteHelper;
-
-void zrlePaletteHelperInit  (zrlePaletteHelper *helper);
-void zrlePaletteHelperInsert(zrlePaletteHelper *helper,
-			     zrle_U32           pix);
-int  zrlePaletteHelperLookup(zrlePaletteHelper *helper,
-			     zrle_U32           pix);
-
-#endif /* __ZRLE_PALETTE_HELPER_H__ */
diff --git a/ica/x11/libvncserver/zrletypes.h b/ica/x11/libvncserver/zrletypes.h
deleted file mode 100644
index 0df42c9..0000000
--- a/ica/x11/libvncserver/zrletypes.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#ifndef __ZRLE_TYPES_H__
-#define __ZRLE_TYPES_H__
-
-typedef unsigned char  zrle_U8;
-typedef unsigned short zrle_U16;
-typedef unsigned int   zrle_U32;
-typedef signed char    zrle_S8;
-typedef signed short   zrle_S16;
-typedef signed int     zrle_S32;
-
-#endif /* __ZRLE_TYPES_H__ */
diff --git a/ica/x11/rfb/default8x16.h b/ica/x11/rfb/default8x16.h
deleted file mode 100644
index 6096b1c..0000000
--- a/ica/x11/rfb/default8x16.h
+++ /dev/null
@@ -1,266 +0,0 @@
-#ifndef _DEFAULT_8_X_16_H
-#define _DEFAULT_8_X_16_H
-
-static unsigned char default8x16FontData[4096+1]={
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
-0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,
-0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,
-0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff,
-0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00,
-0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00,
-0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00,
-0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,0x00,0x00,
-0x18,0x18,0x7c,0xc6,0xc2,0xc0,0x7c,0x06,0x06,0x86,0xc6,0x7c,0x18,0x18,0x00,0x00,
-0x00,0x00,0x00,0x00,0xc2,0xc6,0x0c,0x18,0x30,0x60,0xc6,0x86,0x00,0x00,0x00,0x00,
-0x00,0x00,0x38,0x6c,0x6c,0x38,0x76,0xdc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0x06,0x0c,0x18,0x30,0x60,0xc0,0xc6,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0x06,0x06,0x3c,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xfc,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x38,0x60,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfe,0xc6,0x06,0x06,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7c,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0x0c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xde,0xc6,0xc6,0x66,0x3a,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00,
-0x00,0x00,0xe6,0x66,0x66,0x6c,0x78,0x78,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00,
-0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc3,0xe7,0xff,0xff,0xdb,0xc3,0xc3,0xc3,0xc3,0xc3,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd6,0xde,0x7c,0x0c,0x0e,0x00,0x00,
-0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00,
-0x00,0x00,0x7c,0xc6,0xc6,0x60,0x38,0x0c,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xff,0xdb,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x66,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x3c,0x66,0xc3,0xc3,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xff,0xc3,0x86,0x0c,0x18,0x30,0x60,0xc1,0xc3,0xff,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00,
-0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,
-0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0xe0,0x60,0x60,0x78,0x6c,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x1c,0x0c,0x0c,0x3c,0x6c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,0x00,
-0x00,0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,
-0x00,0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00,
-0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xe6,0xff,0xdb,0xdb,0xdb,0xdb,0xdb,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00,
-0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1e,0x00,
-0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x66,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x10,0x30,0x30,0xfc,0x30,0x30,0x30,0x30,0x36,0x1c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xc3,0x66,0x3c,0x18,0x3c,0x66,0xc3,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0xf8,0x00,
-0x00,0x00,0x00,0x00,0x00,0xfe,0xcc,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x70,0x18,0x18,0x18,0x0e,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
-0x00,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x0c,0x06,0x7c,0x00,0x00,
-0x00,0x00,0xcc,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x0c,0x18,0x30,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x10,0x38,0x6c,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0xcc,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x60,0x30,0x18,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x38,0x6c,0x38,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x0c,0x06,0x3c,0x00,0x00,0x00,
-0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0xc6,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x38,0x6c,0x38,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x18,0x30,0x60,0x00,0xfe,0x66,0x60,0x7c,0x60,0x60,0x66,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x6e,0x3b,0x1b,0x7e,0xd8,0xdc,0x77,0x00,0x00,0x00,0x00,
-0x00,0x00,0x3e,0x6c,0xcc,0xcc,0xfe,0xcc,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00,
-0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x30,0x78,0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x60,0x30,0x18,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc6,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0x78,0x00,
-0x00,0xc6,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0xc6,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x18,0x18,0x7e,0xc3,0xc0,0xc0,0xc0,0xc3,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xe6,0xfc,0x00,0x00,0x00,0x00,
-0x00,0x00,0xc3,0x66,0x3c,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0xfc,0x66,0x66,0x7c,0x62,0x66,0x6f,0x66,0x66,0x66,0xf3,0x00,0x00,0x00,0x00,
-0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x18,0xd8,0x70,0x00,0x00,
-0x00,0x18,0x30,0x60,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x18,0x30,0x60,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x18,0x30,0x60,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
-0x76,0xdc,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xc0,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,
-0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x60,0xce,0x9b,0x06,0x0c,0x1f,0x00,0x00,
-0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x66,0xce,0x96,0x3e,0x06,0x06,0x00,0x00,
-0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xd8,0x6c,0x36,0x6c,0xd8,0x00,0x00,0x00,0x00,0x00,0x00,
-0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,
-0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
-0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
-0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
-0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
-0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,
-0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0xd8,0xd8,0xd8,0xdc,0x76,0x00,0x00,0x00,0x00,
-0x00,0x00,0x78,0xcc,0xcc,0xcc,0xd8,0xcc,0xc6,0xc6,0xc6,0xcc,0x00,0x00,0x00,0x00,
-0x00,0x00,0xfe,0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0xfe,0xc6,0x60,0x30,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7e,0xd8,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xc0,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00,
-0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x6c,0x6c,0x6c,0xee,0x00,0x00,0x00,0x00,
-0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x7e,0xdb,0xdb,0xdb,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x03,0x06,0x7e,0xdb,0xdb,0xf3,0x7e,0x60,0xc0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x60,0x30,0x1c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0xff,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x7e,0x00,0x00,0x00,0x00,
-0x00,0x00,0x0e,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
-0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x0f,0x0c,0x0c,0x0c,0x0c,0x0c,0xec,0x6c,0x6c,0x3c,0x1c,0x00,0x00,0x00,0x00,
-0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-};
-static int default8x16FontMetaData[256*5+1]={
-0,8,16,0,0,16,8,16,0,0,32,8,16,0,0,48,8,16,0,0,64,8,16,0,0,80,8,16,0,0,96,8,16,0,0,112,8,16,0,0,128,8,16,0,0,144,8,16,0,0,160,8,16,0,0,176,8,16,0,0,192,8,16,0,0,208,8,16,0,0,224,8,16,0,0,240,8,16,0,0,256,8,16,0,0,272,8,16,0,0,288,8,16,0,0,304,8,16,0,0,320,8,16,0,0,336,8,16,0,0,352,8,16,0,0,368,8,16,0,0,384,8,16,0,0,400,8,16,0,0,416,8,16,0,0,432,8,16,0,0,448,8,16,0,0,464,8,16,0,0,480,8,16,0,0,496,8,16,0,0,512,8,16,0,0,528,8,16,0,0,544,8,16,0,0,560,8,16,0,0,576,8,16,0,0,592,8,16,0,0,608,8, [...]
-static rfbFontData default8x16Font = { default8x16FontData, default8x16FontMetaData };
-
-#endif
diff --git a/ica/x11/rfb/rfbregion.h b/ica/x11/rfb/rfbregion.h
deleted file mode 100644
index 53da667..0000000
--- a/ica/x11/rfb/rfbregion.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef SRAREGION_H
-#define SRAREGION_H
-
-/* -=- SRA - Simple Region Algorithm
- * A simple rectangular region implementation.
- * Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
- */
-
-/* -=- sraRect */
-
-typedef struct _rect {
-	int x1;
-	int y1;
-	int x2;
-	int y2;
-} sraRect;
-
-typedef struct sraRegion sraRegion;
-
-/* -=- Region manipulation functions */
-
-extern sraRegion *sraRgnCreate();
-extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
-extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
-
-extern void sraRgnDestroy(sraRegion *rgn);
-extern void sraRgnMakeEmpty(sraRegion *rgn);
-extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src);
-extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
-extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
-
-extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
-
-extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect,
-			  unsigned long flags);
-
-extern unsigned long sraRgnCountRects(const sraRegion *rgn);
-extern rfbBool sraRgnEmpty(const sraRegion *rgn);
-
-extern sraRegion *sraRgnBBox(const sraRegion *src);
-
-/* -=- rectangle iterator */
-
-typedef struct sraRectangleIterator {
-  rfbBool reverseX,reverseY;
-  int ptrSize,ptrPos;
-  struct sraSpan** sPtrs;
-} sraRectangleIterator;
-
-extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
-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 rfbBool sraClipRect(int *x, int *y, int *w, int *h,
-			int cx, int cy, int cw, int ch);
-
-extern rfbBool sraClipRect2(int *x, int *y, int *x2, int *y2,
-			int cx, int cy, int cx2, int cy2);
-
-#endif
diff --git a/ica/x11/x11vnc.c b/ica/x11/x11vnc.c
deleted file mode 100644
index 039e311..0000000
--- a/ica/x11/x11vnc.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include <rfb/rfbconfig.h>
-#include <rfb/keysym.h>
-
-#ifdef WIN32
-#define WNOHANG 1
-#define SIGUSR1 10
-#include <fcntl.h>
-#include <io.h>
-#include <stdio.h>
-#include <errno.h>
-static int geteuid()
-{
-	errno = ENOSYS;
-	return -1;
-}
-static int getuid()
-{
-	errno = ENOSYS;
-	return -1;
-}
-static int kill(int pid, int sig)
-{
-	errno = ENOSYS;
-	return -1;
-}
-static int fork()
-{
-	errno = ENOSYS;
-	return -1;
-}
-static int waitpid(int pid, int * loc, int options)
-{
-	errno = ENOSYS;
-	return -1;
-}
-static int mkstemp(char * template)
-{
-	mktemp(template);
-	return open(template, O_RDWR);
-}
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_RECORD
-#include <X11/Xproto.h>
-#endif
-
-#include "x11vnc/avahi.c"
-#include "x11vnc/pm.c"
-#include "x11vnc/rates.c"
-#include "x11vnc/cleanup.c"
-#include "x11vnc/remote.c"
-#include "x11vnc/pointer.c"
-#include "x11vnc/userinput.c"
-#include "x11vnc/unixpw.c"
-#include "x11vnc/gui.c"
-#include "x11vnc/xkb_bell.c"
-#include "x11vnc/xinerama.c"
-#include "x11vnc/solid.c"
-#include "x11vnc/selection.c"
-#include "x11vnc/xrandr.c"
-#include "x11vnc/win_utils.c"
-#include "x11vnc/cursor.c"
-#include "x11vnc/screen.c"
-#include "x11vnc/xevents.c"
-#include "x11vnc/help.c"
-#include "x11vnc/inet.c"
-#include "x11vnc/sslcmds.c"
-#include "x11vnc/xwrappers.c"
-#include "x11vnc/scan.c"
-#include "x11vnc/options.c"
-#include "x11vnc/user.c"
-#include "x11vnc/util.c"
-#include "x11vnc/x11vnc_defs.c"
-#include "x11vnc/xrecord.c"
-#include "x11vnc/8to24.c"
-#include "x11vnc/xdamage.c"
-#include "x11vnc/keyboard.c"
-#include "x11vnc/connections.c"
-#include "x11vnc/sslhelper.c"
-#include "x11vnc/linuxfb.c"
-#include "x11vnc/v4l.c"
-#include "x11vnc/macosx.c"
-#include "x11vnc/macosxCG.c"
-#include "x11vnc/macosxCGP.c"
-#include "x11vnc/macosxCGS.c"
-
-#define db db2
-#include "x11vnc/uinput.c"
-#undef db
-
-#define SHOW_NO_PASSWORD_WARNING 0
-#define main x11vnc_main
-
-#include "x11vnc/x11vnc.c"
-
diff --git a/ica/x11/x11vnc/8to24.c b/ica/x11/x11vnc/8to24.c
deleted file mode 100644
index 30c3da2..0000000
--- a/ica/x11/x11vnc/8to24.c
+++ /dev/null
@@ -1,2155 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- 8to24.c -- */
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "scan.h"
-#include "util.h"
-#include "win_utils.h"
-#include "xwrappers.h"
-
-int multivis_count = 0;
-int multivis_24count = 0;
-
-void check_for_multivis(void);
-void bpp8to24(int, int, int, int);
-void mark_8bpp(int);
-
-#if SKIP_8TO24
-void check_for_multivis(void) {}
-void bpp8to24(int x, int y, int z, int t) {}
-void mark_8bpp(int x) {}
-#else
-/* lots... */
-
-static void set_root_cmap(void);
-static int check_pointer_in_depth24(void);
-static void parse_cmap8to24(void);
-static void set_poll_fb(void);
-static int check_depth(Window win, Window top, int doall);
-static int check_depth_win(Window win, Window top, XWindowAttributes *attr);
-static XImage *p_xi(XImage *xi, Visual *visual, int win_depth, int *w);
-static int poll_line(int x1, int x2, int y1, int n, sraRegionPtr mod);
-static void poll_line_complement(int x1, int x2, int y1, sraRegionPtr mod);
-static int poll_8bpp(sraRegionPtr, int);
-static void poll_8bpp_complement(sraRegionPtr);
-static void mark_rgn_rects(sraRegionPtr mod);
-static int get_8bpp_regions(int validate);
-static int get_cmap(int j, Colormap cmap);
-static void do_8bpp_region(int n, sraRegionPtr mark);
-static XImage *cmap_xi(XImage *xi, Window win, int win_depth);
-static void transform_rect(sraRect rect, Window win, int win_depth, int cm);
-
-/* struct for keeping info about the 8bpp windows: */
-typedef struct window8 {
-	Window win;
-	Window top;
-	int depth;
-	int x, y;
-	int w, h;
-	int map_state;
-	Colormap cmap;
-	Bool map_installed;
-	int fetched;
-	double last_fetched;
-	sraRegionPtr clip_region;
-} window8bpp_t;
-
-enum mark_8bpp_modes {
-	MARK_8BPP_ALL = 0,
-	MARK_8BPP_POINTER,
-	MARK_8BPP_TOP
-};
-
-
-#define NCOLOR 256
-
-static Colormap root_cmap = 0;
-static unsigned int *root_rgb = NULL;
-
-static void set_root_cmap(void) {
-#if NO_X11
-	RAWFB_RET_VOID
-	return;
-#else
-	static time_t last_set = 0;
-	time_t now = time(NULL);
-	XWindowAttributes attr;
-	static XColor *color = NULL;
-	int redo = 0;
-	int ncolor = 0;
-
-	RAWFB_RET_VOID
-
-	if (depth > 16) {
-		ncolor = NCOLOR;
-	} else if (depth > 8) {
-		ncolor = 1 << depth;
-	} else {
-		ncolor = NCOLOR;
-	}
-
-	if (!root_rgb) {
-		root_rgb = (unsigned int *) malloc(ncolor * sizeof(unsigned int));
-	}
-	if (!color) {
-		color = (XColor *) malloc(ncolor * sizeof(XColor));
-	}
-
-	if (now > last_set + 10) {
-		redo = 1;
-	}
-	if (! root_cmap || redo) {
-		X_LOCK;
-		if (! valid_window(window, &attr, 1)) {
-			X_UNLOCK;
-			return;
-		}
-		if (attr.colormap) {
-			int i, ncells = ncolor;
-
-			if (depth < 8) {
-				ncells = CellsOfScreen(ScreenOfDisplay(dpy, scr));
-			}
-			for (i=0; i < ncells; i++) {
-				color[i].pixel = i;
-				color[i].pad = 0;
-			}
-			last_set = now;
-			root_cmap = attr.colormap;
-			XQueryColors(dpy, root_cmap, color, ncells);
-			for (i=0; i < ncells; i++) {
-				unsigned int red, green, blue;
-				/* strip out highest 8 bits of values: */
-				red   = (color[i].red   & 0xff00) >> 8;
-				green = (color[i].green & 0xff00) >> 8;
-				blue  = (color[i].blue  & 0xff00) >> 8;
-
-				/*
-				 * the maxes should be at 255 already,
-				 * but just in case...
-				 */
-				red   = (main_red_max   * red  )/255;
-				green = (main_green_max * green)/255;
-				blue  = (main_blue_max  * blue )/255;
-
-				/* shift them over and or together for value */
-				red   = red    << main_red_shift;
-				green = green  << main_green_shift;
-				blue  = blue   << main_blue_shift;
-
-				/* store it in the array to be used later */
-				root_rgb[i] = red | green | blue;
-			}
-		}
-		X_UNLOCK;
-	}
-#endif	/* NO_X11 */
-}
-
-/* fixed size array.  Will primarily hold visible 8bpp windows */
-#define MAX_8BPP_WINDOWS 64
-static window8bpp_t windows_8bpp[MAX_8BPP_WINDOWS];
-
-static int db24 = 0;
-static int xgetimage_8to24 = 1;
-static double poll_8to24_delay = POLL_8TO24_DELAY;
-static double cache_win = 0.0;
-static int level2_8to24 = 0;
-
-static int check_pointer_in_depth24(void) {
-	int tries = 0, in_24 = 0;
-	XWindowAttributes attr;
-	Window c, w;
-	double now = dnow();
-
-	c = window;
-
-	RAWFB_RET(0)
-
-	if (now > last_keyboard_time + 1.0 && now > last_pointer_time + 1.0) {
-		return 0;
-	}
-
-	X_LOCK;
-	while (c && tries++ < 3) {
-		c = query_pointer(c);
-		if (valid_window(c, &attr, 1)) 	{
-			if (attr.depth == 24) {
-				in_24 = 1;
-				break;
-			}
-		}
-	}
-	X_UNLOCK;
-	if (in_24) {
-		int x1, y1, x2, y2;
-		X_LOCK;
-		xtranslate(c, window, 0, 0, &x1, &y1, &w, 1);
-		X_UNLOCK;
-		x2 = x1 + attr.width;
-		y2 = y1 + attr.height;
-		x1 = nfix(x1, dpy_x);
-		y1 = nfix(y1, dpy_y);
-		x2 = nfix(x2, dpy_x+1);
-		y2 = nfix(y2, dpy_y+1);
-		mark_rect_as_modified(x1, y1, x2, y2, 0);
-
-if (db24 > 1) fprintf(stderr, "check_pointer_in_depth24 %d %d %d %d\n", x1, y1, x2, y2);
-
-		return 1;
-	}
-	return 0;
-}
-
-static void parse_cmap8to24(void) {
-	if (cmap8to24_str) {
-		char *p, *str = strdup(cmap8to24_str);
-		p = strtok(str, ",");
-		/* defaults: */
-		db24 = 0;
-		xgetimage_8to24 = 1;
-		poll_8to24_delay = POLL_8TO24_DELAY;
-		level2_8to24 = 0;
-		cache_win = 0.0;
-		while (p) {
-			if (strstr(p, "dbg=") == p) {
-				db24 = atoi(p + strlen("dbg="));
-			} else if (strstr(p, "poll=") == p) {
-				poll_8to24_delay = atof(p + strlen("poll="));
-			} else if (strstr(p, "cachewin=") == p) {
-				cache_win = atof(p + strlen("cachewin="));
-			} else if (!strcmp(p, "nogetimage")) {
-				xgetimage_8to24 = 0;
-			} else if (!strcmp(p, "level2")) {
-				level2_8to24 = 1;
-			}
-			p = strtok(NULL, ",");
-		}
-		free(str);
-	} else {
-		if (getenv("DEBUG_8TO24") != NULL) {
-			db24 = atoi(getenv("DEBUG_8TO24"));
-		}
-		if (getenv("NOXGETIMAGE_8TO24") != NULL) {
-			xgetimage_8to24 = 0;
-		}
-	}
-}
-
-static char *poll8_fb = NULL, *poll24_fb = NULL;
-static int poll8_fb_w = 0, poll8_fb_h = 0;
-static int poll24_fb_w = 0, poll24_fb_h = 0;
-
-static void pfb(int fac, char **fb, int *w, int *h)  {
-	if (! *fb || *w != dpy_x || *h != dpy_y) {
-		if (*fb) {
-			free(*fb);
-		}
-		*fb = (char *) calloc(fac * dpy_x * dpy_y, 1);
-		*w = dpy_x;
-		*h = dpy_y;
-	}
-}
-
-static void set_poll_fb(void) {
-	/* create polling framebuffers or recreate if too small. */
-
-	if (! xgetimage_8to24) {
-		return;		/* this saves a bit of RAM */
-	}
-	pfb(4, &poll24_fb, &poll24_fb_w, &poll24_fb_h);
-	if (depth > 8 && depth <= 16) {
-		pfb(2, &poll8_fb,  &poll8_fb_w,  &poll8_fb_h);	/* 2X for rare 16bpp colormap case */
-	} else {
-		pfb(1, &poll8_fb,  &poll8_fb_w,  &poll8_fb_h);
-	}
-}
-
-int MV_glob = 0;
-int MV_count;
-int MV_hit;
-double MV_start;
-
-void check_for_multivis(void) {
-#if NO_X11
-	RAWFB_RET_VOID
-	return;
-#else
-	XWindowAttributes attr;
-	int doall = 0;
-	int k, i, cnt, diff;
-	static int first = 1;
-	static Window *stack_old = NULL;
-	static int stack_old_len = 0;
-	static double last_parse = 0.0;
-	static double last_update = 0.0;
-	static double last_clear = 0.0;
-	static double last_poll = 0.0;
-	static double last_fixup = 0.0;
-	static double last_call = 0.0;
-	static double last_query = 0.0;
-	double now = dnow();
-	double delay;
-
-	RAWFB_RET_VOID
-
-	if (now > last_parse + 1.0) {
-		last_parse = now;
-		parse_cmap8to24();
-	}
-if (db24 > 2) fprintf(stderr, " check_for_multivis: %.4f\n", now - last_call);
-	last_call = now;
-
-	if (first) {
-		int i;
-		/* initialize 8bpp window table: */
-		for (i=0; i < MAX_8BPP_WINDOWS; i++) 	{
-			windows_8bpp[i].win = None;
-			windows_8bpp[i].top = None;
-			windows_8bpp[i].map_state = IsUnmapped;
-			windows_8bpp[i].cmap = (Colormap) 0;
-			windows_8bpp[i].fetched = 0;
-			windows_8bpp[i].last_fetched = -1.0;
-			windows_8bpp[i].clip_region = NULL;
-		}
-		set_poll_fb();
-
-		first = 0;
-		doall = 1;	/* fetch everything first time */
-	}
-
-	if (wireframe_in_progress) {
-		return;
-	}
-
-	set_root_cmap();
-
-	/*
-	 * allocate an "old stack" list of all toplevels.  we compare
-	 * this to the current stack to guess stacking order changes.
-	 */
-	if (!stack_old || stack_old_len < stack_list_len) {
-		int n = stack_list_len;
-		if (n < 256) {
-			n = 256;
-		}
-		if (stack_old) {
-			free(stack_old);
-		}
-		stack_old = (Window *) calloc(n*sizeof(Window), 1);
-		stack_old_len = n;
-	}
-
-	/* fill the old stack with visible windows: */
-	cnt = 0;
-	for (k=0; k < stack_list_num; k++) {
-		if (stack_list[k].valid &&
-		    stack_list[k].map_state == IsViewable) {
-			stack_old[cnt++] = stack_list[k].win;
-		}
-	}
-
-	/* snapshot + update the current stacking order: */
-	/* TUNABLE */
-	if (poll_8to24_delay >= POLL_8TO24_DELAY) {
-		delay = 3.0 * poll_8to24_delay;
-	} else {
-		delay = 3.0 * POLL_8TO24_DELAY;	/* 0.15 */
-	}
-	if (doall || now > last_update + delay) {
-		snapshot_stack_list(0, 0.0);
-		update_stack_list();
-		last_update = now;
-	}
-
-	/* look for differences in the visible toplevels: */
-	diff = 0;
-	cnt = 0;
-	for (k=0; k < stack_list_num; k++) {
-		if (stack_list[k].valid && stack_list[k].map_state ==
-		    IsViewable) {
-			if (stack_old[cnt] != stack_list[k].win) {
-				diff = 1;
-				break;
-			}
-			cnt++;
-		}
-	}
-
-	multivis_count = 0;
-	multivis_24count = 0;
-
-	/*
-	 * every 10 seconds we try to clean out and also refresh the window
-	 * info in the 8bpp window table:
-	 */
-	if (now > last_clear + 10) {
-		last_clear = now;
-		X_LOCK;
-		for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-			Window w = windows_8bpp[i].win;
-			if (! valid_window(w, &attr, 1)) {
-				/* catch windows that went away: */
-				windows_8bpp[i].win = None;
-				windows_8bpp[i].top = None;
-				windows_8bpp[i].map_state = IsUnmapped;
-				windows_8bpp[i].cmap = (Colormap) 0;
-				windows_8bpp[i].fetched = 0;
-				windows_8bpp[i].last_fetched = -1.0;
-			}
-		}
-		X_UNLOCK;
-	}
-
-	MV_count = 0;
-	MV_hit = 0;
-	MV_start = dnow();
-
-	set_root_cmap();
-
-	/* loop over all toplevels, both 8 and 24 depths: */
-
-	X_LOCK;	/* a giant lock around the whole activity */
-
-	for (k=0; k < stack_list_num; k++) {
-		Window r, parent;
-		Window *list0;
-		Status rc;
-		unsigned int nc0;
-		int i1;
-		XErrorHandler old_handler;
-		double delay;
-
-		Window win = stack_list[k].win;
-
-		/* TUNABLE */
-		if (poll_8to24_delay >= POLL_8TO24_DELAY) {
-			delay = 1.5 * poll_8to24_delay;
-		} else {
-			delay = 1.5 * POLL_8TO24_DELAY;	/* 0.075 */
-		}
-
-		if (now < last_query + delay) {
-			break;
-		}
-
-		if (win == None) {
-			continue;
-		}
-
-		if (stack_list[k].map_state != IsViewable) {
-			int i;
-			/*
-			 * if the toplevel became unmapped, mark it
-			 * for the children as well...
-			 */
-			for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-				if (windows_8bpp[i].top == win) {
-					windows_8bpp[i].map_state =
-					    stack_list[k].map_state;
-				}
-			}
-		}
-
-		if (check_depth(win, win, doall)) {
-			/*
-			 * returns 1 if no need to recurse down e.g. It
-			 * is 8bpp and we assume all lower ones are too.
-			 */
-			continue;
-		}
-
-		/* we recurse up to two levels down from stack_list windows */
-
-		old_handler = XSetErrorHandler(trap_xerror);
-		trapped_xerror = 0;
-		rc = XQueryTree_wr(dpy, win, &r, &parent, &list0, &nc0);
-		XSetErrorHandler(old_handler);
-
-		if (! rc || trapped_xerror) {
-			trapped_xerror = 0;
-			continue;
-		}
-		trapped_xerror = 0;
-
-		/* loop over grandchildren of rootwin: */
-		for (i1=0; i1 < (int) nc0; i1++) {
-			Window win1 = list0[i1];
-			Window *list1;
-			unsigned int nc1;
-			int i2;
-
-			if (check_depth(win1, win, doall)) {
-				continue;
-			}
-
-			if (level2_8to24) {
-				continue;
-			}
-
-			old_handler = XSetErrorHandler(trap_xerror);
-			trapped_xerror = 0;
-			rc = XQueryTree_wr(dpy, win1, &r, &parent, &list1, &nc1);
-			XSetErrorHandler(old_handler);
-
-			if (! rc || trapped_xerror) {
-				trapped_xerror = 0;
-				continue;
-			}
-			trapped_xerror = 0;
-
-			/* loop over great-grandchildren of rootwin: */
-			for (i2=0; i2< (int) nc1; i2++) {
-				Window win2 = list1[i2];
-
-				if (check_depth(win2, win, doall)) {
-					continue;
-				}
-				/* more? Which wm does this? */
-			}
-			if (nc1) {
-				XFree_wr(list1);
-			}
-		}
-		if (nc0) {
-			XFree_wr(list0);
-		}
-	}
-	X_UNLOCK;
-
-	last_query = dnow();
-
-MV_glob += MV_count;
-if (0) fprintf(stderr, "MV_count: %d hit: %d %.4f  %10.2f\n", MV_count, MV_hit, last_query - MV_start, MV_glob / (last_query - x11vnc_start));
-
-	if (screen_fixup_8 > 0.0 && now > last_fixup + screen_fixup_8) {
-		last_fixup = now;
-		mark_8bpp(MARK_8BPP_ALL);
-		last_poll = now;
-
-	} else if (poll_8to24_delay > 0.0) {
-		int area = -1;
-		int validate = 0;
-
-		if (diff && multivis_count) {
-			validate = 1;
-		}
-		if (now > last_poll + poll_8to24_delay) {
-			sraRegionPtr mod;
-
-			last_poll = now;
-			mod = sraRgnCreate();
-			area = poll_8bpp(mod, validate);
-			if (depth == 24) {
-				poll_8bpp_complement(mod);
-			}
-			mark_rgn_rects(mod);
-			sraRgnDestroy(mod);
-		}
-		if (0 && area < dpy_x * dpy_y / 2 && diff && multivis_count) {
-			mark_8bpp(MARK_8BPP_POINTER);
-			last_poll = now;
-		}
-
-	} else if (diff && multivis_count) {
-		mark_8bpp(MARK_8BPP_ALL);
-		last_poll = now;
-
-	} else if (depth <= 16 && multivis_24count) {
-		static double last_check = 0.0;
-		if (now > last_check + 0.4) {
-			last_check = now;
-			if (check_pointer_in_depth24()) {
-				last_poll = now;
-			}
-		}
-	}
-if (0) fprintf(stderr, "done: %.4f\n", dnow() - last_query);
-#endif	/* NO_X11 */
-}
-
-#define VW_CACHE_MAX 1024
-static XWindowAttributes vw_cache_attr[VW_CACHE_MAX];
-static Window vw_cache_win[VW_CACHE_MAX];
-
-static void set_attr(XWindowAttributes *attr, int j) {
-	memcpy((void *) (vw_cache_attr+j), (void *) attr,
-	    sizeof(XWindowAttributes));
-}
-#if 0
-static int get_attr(XWindowAttributes *attr, int j) {
-	memcpy((void *) attr, (void *) (vw_cache_attr+j),
-	    sizeof(XWindowAttributes));
-	return 1;
-}
-#endif
-
-static XWindowAttributes wattr;
-
-static XWindowAttributes *vw_lookup(Window win) {
-	static double last_purge = 0.0;
-	double now;
-	int i, j, k;
-
-	if (win == None) {
-		return NULL;
-	}
-
-	now = dnow();
-	if (now > last_purge + cache_win) {
-		last_purge = now;
-		for (i=0; i<VW_CACHE_MAX; i++) {
-			vw_cache_win[i] = None;
-		}
-	}
-
-	j = -1;
-	k = -1;
-	for (i=0; i<VW_CACHE_MAX; i++) {
-		if (vw_cache_win[i] == win) {
-			j = i;
-			break;
-		} else if (vw_cache_win[i] == None) {
-			k = i;
-			break;
-		}
-	}
-
-	if (j >= 0) {
-MV_hit++;
-		return vw_cache_attr+j;
-		
-	} else if (k >= 0) {
-		XWindowAttributes attr2;
-		int rc = valid_window(win, &attr2, 1);
-		if (rc) {
-			vw_cache_win[k] = win;
-			set_attr(&attr2, k);
-			return vw_cache_attr+k;
-		} else {
-			return NULL;
-		}
-	} else {
-		/* Full */
-		int rc = valid_window(win, &wattr, 1);
-		if (rc) {
-			return &wattr;
-		} else {
-			return NULL;
-		}
-	}
-}
-
-static int check_depth(Window win, Window top, int doall) {
-	XWindowAttributes attr, *pattr;
-
-	/* first see if it is (still) a valid window: */
-MV_count++;
-
-	if (cache_win > 0.0) {
-		pattr = vw_lookup(win);
-		if (pattr == NULL) {
-			return 1;	/* indicate done */
-		}
-	} else {
-		if (! valid_window(win, &attr, 1)) {
-			return 1;	/* indicate done */
-		}
-		pattr = &attr;
-	}
-
-	if (! doall && pattr->map_state != IsViewable) {
-		/*
-		 * store results anyway...  this may lead to table
-		 * filling up, but currently this allows us to update
-		 * state of onetime mapped windows.
-		 */
-		check_depth_win(win, top, pattr);
-		return 1;	/* indicate done */
-	} else if (check_depth_win(win, top, pattr)) {
-		return 1;	/* indicate done */
-	} else {
-		return 0;	/* indicate not done */
-	}
-}
-
-static int check_depth_win(Window win, Window top, XWindowAttributes *attr) {
-	int store_it = 0;
-	/*
-	 * only store windows with depth not equal to the default visual's
-	 * depth note some windows can have depth == 0 ... (skip them).
-	 */
-	if (attr->depth > 0) {
-		if (depth == 24 && attr->depth != 24) {
-			store_it = 1;
-		} else if (depth <= 16 && root_cmap && attr->colormap != root_cmap) {
-			store_it = 1;
-		}
-	}
-
-	if (store_it) {
-		int i, j = -1, none = -1, nomap = -1;
-		int newc = 0;
-		if (attr->map_state == IsViewable) {
-			/* count the visible ones: */
-			multivis_count++;
-			if (attr->depth == 24) {
-				multivis_24count++;
-			}
-if (db24 > 1) fprintf(stderr, "multivis: 0x%lx %d\n", win, attr->depth);
-		}
-
-		/* try to find a table slot for this window: */
-		for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-			if (none < 0 && windows_8bpp[i].win == None) {
-				/* found first None */
-				none = i;
-			}
-			if (windows_8bpp[i].win == win) {
-				/* found myself */
-				j = i;
-				break;
-			}
-			if (nomap < 0 && windows_8bpp[i].win != None &&
-			    windows_8bpp[i].map_state != IsViewable) {
-				/* found first unmapped */
-				nomap = i;
-			}
-		}
-		if (j < 0) {
-			if (attr->map_state != IsViewable) {
-				/* no slot and not visible: not worth keeping */
-				return 1;
-			} else if (none >= 0) {
-				/* put it in the first None slot */
-				j = none;
-				newc = 1;
-			} else if (nomap >=0) {
-				/* put it in the first unmapped slot */
-				j = nomap;
-			}
-			/* otherwise we cannot store it... */
-		}
-
-if (db24 > 1) fprintf(stderr, "multivis: 0x%lx ms: %d j: %d no: %d nm: %d dep=%d\n", win, attr->map_state, j, none, nomap, attr->depth);
-
-		/* store if if we found a slot j: */
-		if (j >= 0) {
-			Window w;
-			int x, y;
-			int now_vis = 0;
-
-			if (attr->map_state == IsViewable &&
-			    windows_8bpp[j].map_state != IsViewable) {
-				now_vis = 1;
-			}
-if (db24 > 1) fprintf(stderr, "multivis: STORE 0x%lx j: %3d ms: %d dep=%d\n", win, j, attr->map_state, attr->depth);
-			windows_8bpp[j].win = win;
-			windows_8bpp[j].top = top;
-			windows_8bpp[j].depth = attr->depth;
-			windows_8bpp[j].map_state = attr->map_state;
-			windows_8bpp[j].cmap = attr->colormap;
-			windows_8bpp[j].map_installed = attr->map_installed;
-			windows_8bpp[j].w = attr->width;
-			windows_8bpp[j].h = attr->height;
-			windows_8bpp[j].fetched = 1;
-			windows_8bpp[j].last_fetched = dnow();
-
-			/* translate x y to be WRT the root window (not parent) */
-			xtranslate(win, window, 0, 0, &x, &y, &w, 1);
-			windows_8bpp[j].x = x;
-			windows_8bpp[j].y = y;
-
-			if (newc || now_vis) {
-if (db24) fprintf(stderr, "new/now_vis: 0x%lx %d/%d\n", win, newc, now_vis);
-				/* mark it immediately if a new one: */
-				X_UNLOCK;	/* dont forget the giant lock */
-				mark_rect_as_modified(x, y, x + attr->width,
-				    y + attr->height, 0);
-				X_LOCK;
-			}
-		} else {
-			/*
-			 * Error: could not find a slot.
-			 * perhaps keep age and expire old ones??
-			 */
-if (db24) fprintf(stderr, "multivis: CANNOT STORE 0x%lx j=%d\n", win, j);
-			for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-if (db24 > 1) fprintf(stderr, "          ------------ 0x%lx i=%d\n", windows_8bpp[i].win, i);
-			}
-			
-		}
-		return 1;
-	}
-	return 0;
-}
-
-/* polling line XImage */
-static XImage *p_xi(XImage *xi, Visual *visual, int win_depth, int *w) {
-	RAWFB_RET(NULL)
-
-#if NO_X11
-	if (!xi || !visual || !win_depth || !w) {}
-	return NULL;
-#else
-	if (xi == NULL || *w < dpy_x) {
-		char *d;
-		if (xi) {
-			XDestroyImage(xi);
-		}
-		if (win_depth != 24) {
-			if (win_depth > 8) {
-				d = (char *) malloc(dpy_x * 2);
-			} else {
-				d = (char *) malloc(dpy_x * 1);
-			}
-		} else {
-			d = (char *) malloc(dpy_x * 4);
-		}
-		*w = dpy_x;
-		xi = XCreateImage(dpy, visual, win_depth, ZPixmap, 0, d,
-		    dpy_x, 1, 8, 0);
-	}
-	return xi;
-#endif	/* NO_X11 */
-}
-
-static int poll_line(int x1, int x2, int y1, int n, sraRegionPtr mod) {
-#if NO_X11
-	RAWFB_RET(1)
-	if (!x1 || !x2 || !y1 || !n || !mod) {}
-	return 1;
-#else
-	int fac, n_off, w, xo, yo;
-	char *poll_fb, *dst, *src;
-	int w2, xl, xh, stride = 32;
-	int inrun = 0, rx1 = -1, rx2 = -1;
-
-	static XImage *xi8 = NULL, *xi24 = NULL, *xi_r;
-	static int xi8_w = 0, xi24_w = 0;
-
-	XErrorHandler old_handler = NULL;
-	XImage *xi;
-	Window c, win = windows_8bpp[n].win;
-
-	static XWindowAttributes attr;
-	static Window last_win = None; 
-	static double last_time = 0.0;
-	double now;
-
-	sraRegionPtr rect;
-	int mx1, mx2, my1, my2;
-	int ns = NSCAN/2;
-
-	RAWFB_RET(1)
-
-	if (win == None) {
-		return 1;
-	}
-	if (windows_8bpp[n].map_state != IsViewable) {
-		return 1;
-	}
-	if (! xgetimage_8to24) {
-		return 1;
-	}
-
-	X_LOCK;
-	now = dnow();
-	if (last_win != None && win == last_win && now < last_time + 0.5) {
-		;	/* use previous attr */
-	} else {
-		if (! valid_window(win, &attr, 1)) {
-			X_UNLOCK;
-			last_win = None;
-			return 0;
-		}
-		last_time = now;
-		last_win = win;
-	}
-
-	if (attr.depth > 16 && attr.depth != 24) {
-		X_UNLOCK;
-		return 1;
-	} else if (attr.depth <= 16) {
-		xi = xi8 = p_xi(xi8, attr.visual, attr.depth, &xi8_w);
-
-		poll_fb = poll8_fb;
-		if (attr.depth > 8) {
-			fac = 2;
-		} else {
-			fac = 1;
-		}
-		n_off = poll8_fb_w * y1 + x1;
-	} else {
-		xi = xi24 = p_xi(xi24, attr.visual, 24, &xi24_w);
-
-		poll_fb = poll24_fb;
-		fac = 4;
-		n_off = poll24_fb_w * y1 + x1;
-	}
-
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-
-	/* xtranslate() not used to save two XSetErrorHandler calls */
-	XTranslateCoordinates(dpy, win, window, 0, 0, &xo, &yo, &c);
-
-	xo = x1 - xo;
-	yo = y1 - yo;
-	w = x2 - x1;
-
-	if (trapped_xerror || xo < 0 || yo < 0 || xo + w > attr.width) {
-if (db24 > 2) fprintf(stderr, "avoid bad match...\n");
-		XSetErrorHandler(old_handler);
-		trapped_xerror = 0;
-		X_UNLOCK;
-		return 0;
-	}
-
-	trapped_xerror = 0;
-	xi_r = XGetSubImage(dpy, win, xo, yo, w, 1, AllPlanes, ZPixmap, xi,
-	    0, 0);
-	XSetErrorHandler(old_handler);
-
-	X_UNLOCK;
-
-	if (! xi_r || trapped_xerror) {
-		trapped_xerror = 0;
-		return 0;
-	}
-	trapped_xerror = 0;
-
-	src = xi->data;
-	dst = poll_fb + fac * n_off;
-
-	inrun = 0;
-
-	xl = x1;
-	while (xl < x2) {
-		xh = xl + stride;
-		if (xh > x2) {
-			xh = x2;
-		}
-		w2 = xh - xl;
-		if (memcmp(dst, src, fac * w2)) {
-			if (inrun) {
-				rx2 = xh;
-			} else {
-				rx1 = xl;
-				rx2 = xh;
-				inrun = 1;
-			}
-		} else {
-			if (inrun) {
-				mx1 = rx1;
-				mx2 = rx2;
-				my1 = nfix(y1 - ns, dpy_y);
-				my2 = nfix(y1 + ns, dpy_y+1);
-
-				rect = sraRgnCreateRect(mx1, my1, mx2, my2);
-				sraRgnOr(mod, rect);
-				sraRgnDestroy(rect);	
-				inrun = 0;
-			}
-		}
-
-		xl += stride;
-		dst += fac * stride;
-		src += fac * stride;
-	}
-
-	if (inrun) {
-		mx1 = rx1;
-		mx2 = rx2;
-		my1 = nfix(y1 - ns, dpy_y);
-		my2 = nfix(y1 + ns, dpy_y+1);
-
-		rect = sraRgnCreateRect(mx1, my1, mx2, my2);
-		sraRgnOr(mod, rect);
-		sraRgnDestroy(rect);	
-	}
-	return 1;
-#endif	/* NO_X11 */
-}
-
-static void poll_line_complement(int x1, int x2, int y1, sraRegionPtr mod) {
-	int n_off, w, xl, xh, stride = 32;
-	char *dst, *src;
-	int inrun = 0, rx1 = -1, rx2 = -1;
-	sraRegionPtr rect;
-	int mx1, mx2, my1, my2;
-	int ns = NSCAN/2;
-
-	if (depth != 24) {
-		return;
-	}
-	if (! cmap8to24_fb) {
-		return;
-	}
-	if (! xgetimage_8to24) {
-		return;
-	}
-
-	n_off = main_bytes_per_line * y1 + 4 * x1;
-
-	src = main_fb + n_off;
-	dst = cmap8to24_fb + n_off;
-
-	inrun = 0;
-
-	xl = x1;
-	while (xl < x2) {
-		xh = xl + stride;
-		if (xh > x2) {
-			xh = x2;
-		}
-		w = xh - xl;
-		if (memcmp(dst, src, 4 * w)) {
-			if (inrun) {
-				rx2 = xh;
-			} else {
-				rx1 = xl;
-				rx2 = xh;
-				inrun = 1;
-			}
-		} else {
-			if (inrun) {
-				mx1 = rx1;
-				mx2 = rx2;
-				my1 = nfix(y1 - ns, dpy_y);
-				my2 = nfix(y1 + ns, dpy_y+1);
-
-				rect = sraRgnCreateRect(mx1, my1, mx2, my2);
-				sraRgnOr(mod, rect);
-				sraRgnDestroy(rect);	
-
-				inrun = 0;
-			}
-		}
-
-		xl += stride;
-		dst += 4 * stride;
-		src += 4 * stride;
-	}
-
-	if (inrun) {
-		mx1 = rx1;
-		mx2 = rx2;
-		my1 = nfix(y1 - ns, dpy_y);
-		my2 = nfix(y1 + ns, dpy_y+1);
-
-		rect = sraRgnCreateRect(mx1, my1, mx2, my2);
-		sraRgnOr(mod, rect);
-		sraRgnDestroy(rect);	
-
-		inrun = 0;
-	}
-}
-
-#define CMAPMAX 64
-static Colormap cmaps[CMAPMAX];
-static int ncmaps;
-
-static int poll_8bpp(sraRegionPtr mod, int validate) {
-	int i, y, ysh, map_count;
-	static int ycnt = 0;
-	sraRegionPtr line;
-	sraRect rect;
-	sraRectangleIterator *iter;
-	int br = 0, area = 0;
-	static double last_call = 0.0;
-	
-	map_count = get_8bpp_regions(validate);
-
-if (db24 > 1) fprintf(stderr, "poll_8bpp mc: %d\n", map_count);
-
-	if (! map_count) {
-		return 0;
-	}
-
-	set_poll_fb();
-
-	ysh = scanlines[(ycnt++) % NSCAN];
-if (db24 > 2) fprintf(stderr, "poll_8bpp: ysh: %2d  %.4f\n", ysh, dnow() - last_call);
-	last_call = dnow();
-
-	for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-		sraRegionPtr reg = windows_8bpp[i].clip_region;
-
-		if (! reg || sraRgnEmpty(reg)) {
-			continue;
-		}
-		y = ysh;
-		while (y < dpy_y) {
-			line = sraRgnCreateRect(0, y, dpy_x, y+1);
-
-			if (sraRgnAnd(line, reg)) {
-				iter = sraRgnGetIterator(line);
-				while (sraRgnIteratorNext(iter, &rect)) {
-					if (! poll_line(rect.x1, rect.x2,
-					    rect.y1, i, mod)) {
-						br = 1;
-						break;	/* exception */
-					}
-				}
-				sraRgnReleaseIterator(iter);
-			}
-
-			sraRgnDestroy(line);
-			y += NSCAN;
-			if (br) break;
-		}
-		if (br) break;
-	}
-
-	iter = sraRgnGetIterator(mod);
-	while (sraRgnIteratorNext(iter, &rect)) {
-		area += nabs((rect.x2 - rect.x1)*(rect.y2 - rect.y1));
-	}
-	sraRgnReleaseIterator(iter);
-
-	return area;
-}
-
-static void poll_8bpp_complement(sraRegionPtr mod) {
-	int i, y, ysh;
-	static int ycnt = 0;
-	sraRegionPtr disp, line;
-	sraRect rect;
-	sraRectangleIterator *iter;
-
-	disp = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-
-	ysh = scanlines[(ycnt++) % NSCAN];
-
-	for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-		sraRegionPtr reg = windows_8bpp[i].clip_region;
-
-		if (! reg) {
-			continue;
-		}
-		if (windows_8bpp[i].map_state != IsViewable) {
-			continue;	
-		}
-		sraRgnSubtract(disp, reg);
-	}
-
-	y = ysh;
-	while (y < dpy_y) {
-		line = sraRgnCreateRect(0, y, dpy_x, y+1);
-
-		if (sraRgnAnd(line, disp)) {
-			iter = sraRgnGetIterator(line);
-			while (sraRgnIteratorNext(iter, &rect)) {
-				poll_line_complement(rect.x1, rect.x2,
-				    rect.y1, mod);
-			}
-			sraRgnReleaseIterator(iter);
-		}
-
-		sraRgnDestroy(line);
-
-		y += NSCAN;
-	}
-
-	sraRgnDestroy(disp);
-}
-
-static void mark_rgn_rects(sraRegionPtr mod) {
-	sraRect rect;
-	sraRectangleIterator *iter;
-	int area = 0;
-
-	if (sraRgnEmpty(mod)) {
-		return;
-	}
-	
-	iter = sraRgnGetIterator(mod);
-	while (sraRgnIteratorNext(iter, &rect)) {
-		mark_rect_as_modified(rect.x1, rect.y1, rect.x2, rect.y2, 0);
-		area += nabs((rect.x2 - rect.x1)*(rect.y2 - rect.y1));
-	}
-	sraRgnReleaseIterator(iter);
-
-if (db24 > 1) fprintf(stderr, " mark_rgn_rects area: %d\n", area);
-}
-
-static int get_8bpp_regions(int validate) {
-
-	XWindowAttributes attr;
-	int i, k, mapcount = 0;
-
-	/* initialize color map list */
-	ncmaps = 0;
-	for (i=0; i < CMAPMAX; i++) {
-		cmaps[i] = (Colormap) 0;
-	}
-
-	/* loop over the table of 8bpp windows: */
-	for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-		sraRegionPtr tmp_reg, tmp_reg2;
-		Window c, w = windows_8bpp[i].win;
-		int x, y;
-
-		if (windows_8bpp[i].clip_region) {
-			sraRgnDestroy(windows_8bpp[i].clip_region);	
-		}
-		windows_8bpp[i].clip_region = NULL;
-
-		if (w == None) {
-			continue;
-		}
-
-if (db24 > 1) fprintf(stderr, "get_8bpp_regions: 0x%lx ms=%d dep=%d i=%d\n", w, windows_8bpp[i].map_state, windows_8bpp[i].depth, i);
-		if (validate) {
-			/*
-			 * this could be slow: validating 8bpp windows each
-			 * time...
-			 */
-
-			X_LOCK;
-			if (! valid_window(w, &attr, 1)) {
-				X_UNLOCK;
-				windows_8bpp[i].win = None;
-				windows_8bpp[i].top = None;
-				windows_8bpp[i].map_state = IsUnmapped;
-				windows_8bpp[i].cmap = (Colormap) 0;
-				windows_8bpp[i].fetched = 0;
-				windows_8bpp[i].last_fetched = -1.0;
-				continue;
-			}
-			X_UNLOCK;
-
-			windows_8bpp[i].depth = attr.depth;
-			windows_8bpp[i].map_state = attr.map_state;
-			windows_8bpp[i].cmap = attr.colormap;
-			windows_8bpp[i].map_installed = attr.map_installed;
-			windows_8bpp[i].w = attr.width;
-			windows_8bpp[i].h = attr.height;
-			windows_8bpp[i].fetched = 1;
-			windows_8bpp[i].last_fetched = dnow();
-
-			if (attr.map_state != IsViewable) {
-				continue;
-			}
-
-			X_LOCK;
-			xtranslate(w, window, 0, 0, &x, &y, &c, 1);
-			X_UNLOCK;
-			windows_8bpp[i].x = x;
-			windows_8bpp[i].y = y;
-
-		} else {
-			/* this will be faster: no call to X server: */
-			if (windows_8bpp[i].map_state != IsViewable) {
-				continue;
-			}
-			attr.depth = windows_8bpp[i].depth;
-			attr.map_state = windows_8bpp[i].map_state;
-			attr.colormap = windows_8bpp[i].cmap;
-			attr.map_installed = windows_8bpp[i].map_installed;
-			attr.width = windows_8bpp[i].w;
-			attr.height = windows_8bpp[i].h;
-
-			x =  windows_8bpp[i].x; 
-			y =  windows_8bpp[i].y; 
-		}
-
-		mapcount++;
-
-		/* tmp region for this 8bpp rectangle: */
-		tmp_reg = sraRgnCreateRect(nfix(x, dpy_x), nfix(y, dpy_y),
-		    nfix(x + attr.width, dpy_x+1), nfix(y + attr.height, dpy_y+1));
-
-		/* loop over all toplevels, top to bottom clipping: */
-		for (k = stack_list_num - 1; k >= 0; k--) {
-			Window swin = stack_list[k].win;
-			int sx, sy, sw, sh;
-
-if (db24 > 1 && stack_list[k].map_state == IsViewable) fprintf(stderr, "Stack win: 0x%lx %d iv=%d\n", swin, k, stack_list[k].map_state);
-
-			if (swin == windows_8bpp[i].top) {
-				/* found our top level: we skip the rest. */
-if (db24 > 1) fprintf(stderr, "found top: 0x%lx %d iv=%d\n", swin, k, stack_list[k].map_state);
-				break;
-			}
-			if (stack_list[k].map_state != IsViewable) {
-				/* skip unmapped ones: */
-				continue;
-			}
-
-			/* make a temp rect for this toplevel: */
-			sx = stack_list[k].x;
-			sy = stack_list[k].y;
-			sw = stack_list[k].width;
-			sh = stack_list[k].height;
-
-if (db24 > 1) fprintf(stderr, "subtract:  0x%lx %d -- %d %d %d %d\n", swin, k, sx, sy, sw, sh);
-
-			tmp_reg2 = sraRgnCreateRect(nfix(sx, dpy_x),
-			    nfix(sy, dpy_y), nfix(sx + sw, dpy_x+1),
-			    nfix(sy + sh, dpy_y+1));
-
-			/* subtract it from the 8bpp window region */
-			sraRgnSubtract(tmp_reg, tmp_reg2);
-
-			sraRgnDestroy(tmp_reg2);
-
-			if (sraRgnEmpty(tmp_reg)) {
-				break;
-			}
-		}
-
-		if (sraRgnEmpty(tmp_reg)) {
-			/* skip this 8bpp if completely clipped away: */
-			sraRgnDestroy(tmp_reg);
-			continue;
-		}
-
-		/* otherwise, store any new colormaps: */
-		if (ncmaps < CMAPMAX && attr.colormap != (Colormap) 0) {
-			int m, seen = 0;
-			for (m=0; m < ncmaps; m++) {
-				if (cmaps[m] == attr.colormap) {
-					seen = 1;
-					break;
-				}
-			}
-			if (!seen && attr.depth <= 16) {
-				/* store only new ones: */
-				cmaps[ncmaps++] = attr.colormap;
-			}
-		}
-
-		windows_8bpp[i].clip_region = tmp_reg;
-	}
-
-	return mapcount;
-}
-
-static XColor *color[CMAPMAX];
-static unsigned int *rgb[CMAPMAX];
-static int cmap_failed[CMAPMAX];
-static int color_init = 0;
-int histo[65536];
-
-static int get_cmap(int j, Colormap cmap) {
-#if NO_X11
-	RAWFB_RET(0)
-	if (!j || !cmap) {}
-	return 0;
-#else
-	int i, ncells, ncolor;
-	XErrorHandler old_handler = NULL;
-
-	RAWFB_RET(0)
-
-	if (depth > 16) {
-		/* 24 */
-		ncolor = NCOLOR;
-	} else if (depth > 8) {
-		ncolor = 1 << depth;
-	} else {
-		ncolor = NCOLOR;
-	}
-	if (!color_init) {
-		int cm;
-		for (cm = 0; cm < CMAPMAX; cm++) {
-			color[cm] = (XColor *) malloc(ncolor * sizeof(XColor));
-			rgb[cm] = (unsigned int *) malloc(ncolor * sizeof(unsigned int));
-		}
-		color_init = 1;
-	}
-
-	if (depth <= 16) {
-		/* not working properly for depth 24... */
-		X_LOCK;
-		ncells = CellsOfScreen(ScreenOfDisplay(dpy, scr));
-		X_UNLOCK;
-	} else {
-		ncells = NCOLOR;
-	}
-
-	if (depth > 16) {
-		;
-	} else if (ncells > ncolor) {
-		ncells = ncolor;
-	} else if (ncells == 8 && depth != 3) {
-		/* XXX. see set_colormap() */
-		ncells = 1 << depth;
-	}
-
-	/* initialize XColor array: */
-	for (i=0; i < ncells; i++) {
-		color[j][i].pixel = i;
-		color[j][i].pad = 0;
-	}
-if (db24 > 1) fprintf(stderr, "get_cmap: %d 0x%x ncolor=%d ncells=%d\n", j, (unsigned int) cmap, ncolor, ncells);
-
-	/* try to query the colormap, trap errors */
-	X_LOCK;
-	trapped_xerror = 0;
-	old_handler = XSetErrorHandler(trap_xerror);
-	XQueryColors(dpy, cmap, color[j], ncells);
-	XSetErrorHandler(old_handler);
-	X_UNLOCK;
-
-	if (trapped_xerror) {
-		trapped_xerror = 0;
-		return 0;
-	}
-	trapped_xerror = 0;
-
-	/* now map each index to depth 24 RGB */
-	for (i=0; i < ncells; i++) {
-		unsigned int red, green, blue;
-		/* strip out highest 8 bits of values: */
-		red   = (color[j][i].red   & 0xff00) >> 8;
-		green = (color[j][i].green & 0xff00) >> 8;
-		blue  = (color[j][i].blue  & 0xff00) >> 8;
-
-		/*
-		 * the maxes should be at 255 already,
-		 * but just in case...
-		 */
-		red   = (main_red_max   * red  )/255;
-		green = (main_green_max * green)/255;
-		blue  = (main_blue_max  * blue )/255;
-
-if (db24 > 2) fprintf(stderr, " cmap[%02d][%03d]: %03d %03d %03d  0x%08x \n", j, i, red, green, blue, ( red << main_red_shift | green << main_green_shift | blue << main_blue_shift));
-
-		/* shift them over and or together for value */
-		red   = red    << main_red_shift;
-		green = green  << main_green_shift;
-		blue  = blue   << main_blue_shift;
-
-		/* store it in the array to be used later */
-		rgb[j][i] = red | green | blue;
-	}
-	return 1;
-#endif	/* NO_X11 */
-}
-
-static void do_8bpp_region(int n, sraRegionPtr mark) {
-	int k, cm = -1, failed = 0;
-	sraRectangleIterator *iter;
-	sraRegionPtr clip;
-	sraRect rect;
-
-	if (! windows_8bpp[n].clip_region) {
-		return;
-	}
-	if (windows_8bpp[n].win == None) {
-		return;
-	}
-	if (windows_8bpp[n].map_state != IsViewable) {
-		return;
-	}
-if (db24 > 1) fprintf(stderr, "ncmaps: %d\n", ncmaps);
-
-	/* see if XQueryColors failed: */
-	for (k=0; k<ncmaps; k++) {
-		if (windows_8bpp[n].cmap == cmaps[k]) {
-			cm = k;
-			if (cmap_failed[k]) {
-				failed = 1;
-			}
-			break;
-		}
-	}
-
-	if (windows_8bpp[n].depth != 24) {	/* 24 won't have a cmap */
-		if (failed || cm == -1) {
-			return;
-		}
-	}
-
-	clip = sraRgnCreateRgn(mark);
-	sraRgnAnd(clip, windows_8bpp[n].clip_region);
-
-	/* loop over the rectangles making up region */
-	iter = sraRgnGetIterator(clip);
-	while (sraRgnIteratorNext(iter, &rect)) {
-		if (rect.x1 > rect.x2) {
-			int tmp = rect.x2;
-			rect.x2 = rect.x1;
-			rect.x1 = tmp;
-		}
-		if (rect.y1 > rect.y2) {
-			int tmp = rect.y2;
-			rect.y2 = rect.y1;
-			rect.y1 = tmp;
-		}
-
-		transform_rect(rect, windows_8bpp[n].win,
-		    windows_8bpp[n].depth, cm);
-	}
-	sraRgnReleaseIterator(iter);
-	sraRgnDestroy(clip);
-}
-
-static XImage *cmap_xi(XImage *xi, Window win, int win_depth) {
-#if NO_X11
-	if (!xi || !win || !win_depth) {}
-	return NULL;
-#else
-	XWindowAttributes attr;
-	char *d;
-
-	if (xi) {
-		XDestroyImage(xi);
-	}
-	if (! dpy || ! valid_window(win, &attr, 1)) {
-		return (XImage *) NULL;
-	}
-	if (win_depth == 24) {
-		d = (char *) malloc(dpy_x * dpy_y * 4);
-	} else if (win_depth <= 16) {
-		if (win_depth > 8) {
-			d = (char *) malloc(dpy_x * dpy_y * 2);
-		} else {
-			d = (char *) malloc(dpy_x * dpy_y * 1);
-		}
-	} else {
-		return (XImage *) NULL;
-	}
-	return XCreateImage(dpy, attr.visual, win_depth, ZPixmap, 0, d, dpy_x, dpy_y, 8, 0);
-#endif	/* NO_X11 */
-}
-
-
-static void transform_rect(sraRect rect, Window win, int win_depth, int cm) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!rect.x1 || !win || !win_depth || !cm) {}
-	return;
-#else
-
-	char *src, *dst, *poll;
-	unsigned int *ui;
-	unsigned short *us;
-	unsigned char *uc;
-	int ps, pixelsize = bpp/8;
-	int poll_Bpl;
-
-	int do_getimage = xgetimage_8to24;
-	int line, n_off, j, h, w;
-	unsigned int hi, idx;
-	XWindowAttributes attr;
-	XErrorHandler old_handler = NULL;
-
-if (db24 > 1) fprintf(stderr, "transform %4d %4d %4d %4d cm: %d\n", rect.x1, rect.y1, rect.x2, rect.y2, cm);
-
-	RAWFB_RET_VOID
-
-	attr.width = 0;
-	attr.height = 0;
-
-	/* now transform the pixels in this rectangle: */
-	n_off = main_bytes_per_line * rect.y1 + pixelsize * rect.x1;
-
-	h = rect.y2 - rect.y1;
-	w = rect.x2 - rect.x1;
-
-	if (depth != 24) {
-		/* need to fetch depth 24 data. */
-		do_getimage = 1;
-	}
-
-#if 0
-	if (do_getimage) {
-		X_LOCK;
-		vw = valid_window(win, &attr, 1);
-		X_UNLOCK;
-	}
-
-	if (do_getimage && vw) {
-#else
-	if (do_getimage) {
-#endif
-		static XImage *xi_8  = NULL;
-		static XImage *xi_24 = NULL;
-		XImage *xi = NULL, *xi_r;
-		Window c;
-		unsigned int wu, hu;
-		int xo, yo;
-
-		wu = (unsigned int) w;
-		hu = (unsigned int) h;
-
-		X_LOCK;
-#define GETSUBIMAGE
-#ifdef GETSUBIMAGE
-		if (win_depth == 24) {
-			if (xi_24 == NULL || xi_24->width != dpy_x ||
-			    xi_24->height != dpy_y) {
-				xi_24 = cmap_xi(xi_24, win, 24);
-			}
-			xi = xi_24;
-		} else if (win_depth <= 16) {
-			if (xi_8 == NULL || xi_8->width != dpy_x ||
-			    xi_8->height != dpy_y) {
-				if (win_depth > 8) {
-					/* XXX */
-					xi_8 = cmap_xi(xi_8, win, 16);
-				} else {
-					xi_8 = cmap_xi(xi_8, win, 8);
-				}
-			}
-			xi = xi_8;
-		}
-#endif
-
-		if (xi == NULL) {
-			rfbLog("transform_rect: xi is NULL\n");
-			X_UNLOCK;
-			clean_up_exit(1);
-		}
-
-		old_handler = XSetErrorHandler(trap_xerror);
-		trapped_xerror = 0;
-
-		XTranslateCoordinates(dpy, win, window, 0, 0, &xo, &yo, &c);
-
-		xo = rect.x1 - xo;
-		yo = rect.y1 - yo;
-
-if (db24 > 1) fprintf(stderr, "xywh: %d %d %d %d vs. %d %d\n", xo, yo, w, h, attr.width, attr.height);
-
-		if (trapped_xerror || xo < 0 || yo < 0) {
-		        /* w > attr.width || h > attr.height */
-			XSetErrorHandler(old_handler);
-			X_UNLOCK;
-			trapped_xerror = 0;
-if (db24 > 1) fprintf(stderr, "skipping due to potential bad match...\n");
-			return;
-		}
-		trapped_xerror = 0;
-
-#ifndef GETSUBIMAGE
-		xi = XGetImage(dpy, win, xo, yo, wu, hu, AllPlanes, ZPixmap);
-		xi_r = xi;
-#else
-		xi_r = XGetSubImage(dpy, win, xo, yo, wu, hu, AllPlanes,
-		    ZPixmap, xi, 0, 0);
-#endif
-		XSetErrorHandler(old_handler);
-
-		X_UNLOCK;
-
-		if (! xi_r || trapped_xerror) {
-			trapped_xerror = 0;
-if (db24 > 1) fprintf(stderr, "xi-fail: 0x%p trap=%d  %d %d %d %d\n", (void *)xi, trapped_xerror, xo, yo, w, h);
-			return;
-		} else {
-if (db24 > 1) fprintf(stderr, "xi: 0x%p  %d %d %d %d -- %d %d\n", (void *)xi, xo, yo, w, h, xi->width, xi->height);
-		}
-		trapped_xerror = 0;
-
-		if (xi->depth > 16 && xi->depth != 24) {
-#ifndef GETSUBIMAGE
-			X_LOCK;
-			XDestroyImage(xi);
-			X_UNLOCK;
-#endif
-if (db24) fprintf(stderr, "xi: wrong depth: %d\n", xi->depth);
-			return;
-		}
-
-		set_poll_fb();
-
-		if (xi->depth == 24) {
-			/* line by line ... */
-			int ps1 = 4, fac;
-			if (depth <= 8) {
-				fac = 4;
-			} else if (depth <= 16) {
-				fac = 2;
-			} else {
-				fac = 1;	/* will not happen 24 on 24 */
-			}
-
-			src = xi->data;
-			dst = cmap8to24_fb + fac * n_off;
-
-			poll = poll24_fb + (poll24_fb_w * rect.y1 + rect.x1) * 4;
-			poll_Bpl = poll24_fb_w * 4;
-
-			for (line = 0; line < h; line++) {
-				memcpy(dst,  src, w * ps1);
-				memcpy(poll, src, w * ps1);
-
-				src += xi->bytes_per_line;
-				dst += main_bytes_per_line * fac;
-				poll += poll_Bpl;
-			}
-		} else if (xi->depth <= 16) {
-			int ps1, ps2, fac;
-
-			if (depth <= 8) {
-				ps1 = 1;
-				ps2 = 4;
-				fac = 4;
-			} else if (depth <= 16) {
-				ps1 = 2;
-				ps2 = 4;
-				fac = 4;
-			} else {
-				/* should be 24 case */
-				ps1 = 1;
-				ps2 = pixelsize;
-				fac = 1;
-			}
-
-			src = xi->data;
-			dst = cmap8to24_fb + (fac/ps1) * n_off;
-
-			poll = poll8_fb + poll8_fb_w * rect.y1 * ps1 + rect.x1 * ps1;
-			poll_Bpl = poll8_fb_w * ps1;
-
-			/* line by line ... */
-			for (line = 0; line < h; line++) {
-				/* pixel by pixel... */
-				for (j = 0; j < w; j++) {
-					if (ps1 == 2) {
-						unsigned short *ptmp;
-						us    = (unsigned short *) (src + ps1 * j);
-						idx   = (int) (*us);
-						ptmp  = (unsigned short *) (poll + ps1 * j);
-						*ptmp = *us;
-					} else {
-						uc  = (unsigned char *) (src + ps1 * j);
-						idx = (int) (*uc);
-						*(poll + ps1 * j) = *uc;
-					}
-					ui = (unsigned int *) (dst + ps2 * j);
-					*ui = rgb[cm][idx];
-
-				}
-				src += xi->bytes_per_line;
-				dst += main_bytes_per_line * (fac/ps1);
-				poll += poll_Bpl;
-			}
-		}
-
-#ifndef GETSUBIMAGE
-		X_LOCK;
-		XDestroyImage(xi);
-		X_UNLOCK;
-#endif
-
-	} else if (! do_getimage) {
-		int fac;
-
-		if (depth <= 16) {
-			/* cooked up depth 24 TrueColor  */
-			/* but currently disabled (high bits no useful?) */
-			ps = 4;
-			fac = 4;
-			/* XXX not correct for depth > 8, but do we ever come here in that case? */
-			src = cmap8to24_fb + 4 * n_off;
-		} else {
-			ps = pixelsize;
-			fac = 1;
-			src = cmap8to24_fb + n_off;
-		}
-		
-		/* line by line ... */
-		for (line = 0; line < h; line++) {
-			/* pixel by pixel... */
-			for (j = 0; j < w; j++) {
-
-				/* grab 32 bit value */
-				ui = (unsigned int *) (src + ps * j);
-
-				/* extract top 8 bits (FIXME: masks?) */
-				hi = (*ui) & 0xff000000; 
-
-				/* map to lookup index; rewrite pixel */
-				idx = hi >> 24;
-				*ui = hi | rgb[cm][idx];
-			}
-			src += main_bytes_per_line * fac;
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-void bpp8to24(int x1, int y1, int x2, int y2) {
-	char *src, *dst;
-	unsigned char *uc;
-	unsigned short *us;
-	unsigned int *ui;
-	int idx, pixelsize = bpp/8;
-	int line, k, i, j, h, w;
-	int n_off;
-	sraRegionPtr rect;
-	int validate = 1;
-	static int last_map_count = 0, call_count = 0;
-	static double last_get_8bpp_validate = 0.0;
-	static double last_snapshot = 0.0;
-	double now;
-	double dt, d0 = 0.0, t2;
-
-	RAWFB_RET_VOID
-
-	if (! cmap8to24 || ! cmap8to24_fb) {
-		/* hmmm, why were we called? */
-		return;
-	}
-
-if (db24 > 1) fprintf(stderr, "bpp8to24 %d %d %d %d %.4f\n", x1, y1, x2, y2, dnow() - last_get_8bpp_validate);
-
-	call_count++;
-
-	/* clip to display just in case: */
-	if (!ncache) {
-		x1 = nfix(x1, dpy_x);
-		y1 = nfix(y1, dpy_y);
-		x2 = nfix(x2, dpy_x+1);
-		y2 = nfix(y2, dpy_y+1);
-	}
-
-	if (wireframe_in_progress) {
-		/*
-		 * draw_box() manages cmap8to24_fb for us so we get out as
-		 * soon as we can.  No need to cp main_fb -> cmap8to24_fb.
-		 */
-		return;
-	}
-
-	/* copy from main_fb to cmap8to24_fb regardless of 8bpp windows: */
-
-	h = y2 - y1;
-	w = x2 - x1;
-
-	if (depth == 24) {
-		/* pixelsize = 4 */
-		n_off = main_bytes_per_line * y1 + pixelsize * x1;
-
-		src = main_fb      + n_off;
-		dst = cmap8to24_fb + n_off;
-
-		/* otherwise, the pixel data as is */
-		for (line = 0; line < h; line++) {
-			memcpy(dst, src, w * pixelsize);
-			src += main_bytes_per_line;
-			dst += main_bytes_per_line;
-		}
-	} else if (depth <= 16) {
-		/* need to cook up to depth 24 TrueColor  */
-		int ps1 = 1, ps2 = 4;
-		if (depth > 8) {
-			ps1 = 2;
-		}
-
-		/* pixelsize = 1, 2 */
-		n_off = main_bytes_per_line * y1 + pixelsize * x1;
-
-		src = main_fb + n_off;
-		dst = cmap8to24_fb + (4/ps1) * n_off;
-
-		set_root_cmap();
-		if (root_cmap) {
-#if 0
-			unsigned int hi;
-#endif
-
-			/* line by line ... */
-			for (line = 0; line < h; line++) {
-				/* pixel by pixel... */
-				for (j = 0; j < w; j++) {
-					if (ps1 == 2) {
-						us = (unsigned short *) (src + ps1 * j);
-						idx = (int) (*us);
-					} else {
-						uc = (unsigned char *)  (src + ps1 * j);
-						idx = (int) (*uc);
-					}
-					ui = (unsigned int *)  (dst + ps2 * j);
-
-if (0 && line % 100 == 0 && j % 32 == 0) fprintf(stderr, "%d %d %u  x1=%d y1=%d\n", line, j, root_rgb[idx], x1, y1);
-#if 0
-					if (do_hibits) {
-						hi = idx << 24;
-						*ui = hi | rgb[0][idx];
-					} else {
-					}
-#endif
-					*ui = root_rgb[idx];
-if (db24 > 2) histo[idx]++;
-				}
-				src += main_bytes_per_line;
-				dst += main_bytes_per_line * (4/ps1);
-			}
-		}
-		
-	}
-
-	if (last_map_count > MAX_8BPP_WINDOWS/4) {
-		/* table is filling up... skip validating sometimes: */
-		int skip = 3;
-		if (last_map_count > MAX_8BPP_WINDOWS/2) {
-			skip = 6;
-		} else if (last_map_count > 3*MAX_8BPP_WINDOWS/4) {
-			skip = 12;
-		}
-		if (call_count % skip != 0) {
-			validate = 0;
-		}
-	}
-
-if (db24 > 2) {for(i=0;i<256;i++){histo[i]=0;}}
-
-	now = dnow();
-	dt = now - last_get_8bpp_validate;
-	/* TUNABLES  */
-	if (dt < 0.003) {
-		;	/* XXX does this still give painting errors? */
-	} else {
-		int snapit = 0;
-		double delay1, delay2, delay3;
-		if (poll_8to24_delay >= POLL_8TO24_DELAY) {
-			delay1 = 1.0 * poll_8to24_delay;
-			delay2 = 2.0 * poll_8to24_delay;
-			delay3 = 10. * poll_8to24_delay;
-		} else {
-			delay1 = 1.0 * POLL_8TO24_DELAY;	/* 0.05 */
-			delay2 = 2.0 * POLL_8TO24_DELAY;	/* 0.1  */
-			delay3 = 10. * POLL_8TO24_DELAY;	/* 0.5  */
-		}
-		if (cache_win > 1.0) {
-			delay2 *= 2;
-			delay3 *= 2;
-		}
-		if (dt < delay1) {
-			validate = 0;
-		}
-		if (last_map_count) {
-			if (now > last_snapshot + delay2) {
-				snapit = 1;
-			}
-		} else {
-			if (now > last_snapshot + delay3) {
-				snapit = 1;
-			}
-		}
-
-		if (snapit) {
-			/* less problems if we update the stack frequently */
-			snapshot_stack_list(0, 0.0);
-if (0) fprintf(stderr, "SNAP time: %.4f\n", dnow() - now);
-			update_stack_list();
-			last_snapshot = dnow();
-if (0) fprintf(stderr, "UPDA time: %.4f\n", last_snapshot - now);
-		}
-
-if (0) t2 = dnow();
-		last_map_count = get_8bpp_regions(validate);
-		if (validate) {
-			last_get_8bpp_validate = dnow();
-		}
-if (0) fprintf(stderr, "get8bpp-%d: %.4f\n", validate, dnow() - t2);
-	}
-if (db24) d0 = dnow();
-
-if (db24 > 1) fprintf(stderr, "bpp8to24 w=%d h=%d m=%p c=%p r=%p ncmaps=%d\n", w, h, main_fb, cmap8to24_fb, rfb_fb, ncmaps);
-
-	/*
-	 * now go back and transform and 8bpp regions to TrueColor in
-	 * cmap8to24_fb.
-	 */
-	if (last_map_count && (ncmaps || depth <= 16)) {
-		int i, j;
-		int win[MAX_8BPP_WINDOWS];
-		int did[MAX_8BPP_WINDOWS];
-		int count = 0;
-
-		/*
-		 * first, grab all of the associated colormaps from the
-		 * X server.  Hopefully just 1 or 2...
-		 */
-		for (j=0; j<ncmaps; j++) {
-			if (! get_cmap(j, cmaps[j])) {
-				cmap_failed[j] = 1;
-			} else {
-				cmap_failed[j] = 0;
-			}
-if (db24 > 2) fprintf(stderr, "cmap %d  %.4f\n", (int) cmaps[j], dnow() - d0);
-		}
-		for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-			sraRegionPtr reg = windows_8bpp[i].clip_region;
-			if (reg) {
-				rect = sraRgnCreateRect(x1, y1, x2, y2);
-				if (sraRgnAnd(rect, reg)) {
-					win[count] = i;
-					did[count++] = 0;
-				}
-				sraRgnDestroy(rect);
-			}
-		}
-
-		if (count) {
-
-			rect = sraRgnCreateRect(x1, y1, x2, y2);
-			/* try to apply lower windows first */
-			for (k=0; k < stack_list_num; k++) {
-				Window swin = stack_list[k].win;
-				for (j=0; j<count; j++) {
-					i = win[j];
-					if (did[j]) {
-						continue;
-					}
-					if (windows_8bpp[i].top == swin) {
-						do_8bpp_region(i, rect);
-						did[j] = 1;
-						break;
-					}
-				}
-			}
-			for (j=0; j<count; j++) {
-				if (! did[j]) {
-					i = win[j];
-					do_8bpp_region(i, rect);
-					did[j] = 1;
-				}
-			}
-			sraRgnDestroy(rect);
-		}
-	}
-if (0) fprintf(stderr, "done time: %.4f\n", dnow() - d0);
-
-if (db24 > 2) {for(i=0; i<256;i++) {fprintf(stderr, " cmap histo[%03d] %d\n", i, histo[i]);}}
-}
-
-void mark_8bpp(int mode) {
-	int i, cnt = 0;
-	Window top = None;
-
-	RAWFB_RET_VOID
-
-	if (! cmap8to24 || !cmap8to24_fb) {
-		return;
-	}
-	
-	if (mode == MARK_8BPP_TOP) {
-		int k;
-		for (k = stack_list_num - 1; k >= 0; k--) {
-			Window swin = stack_list[k].win;
-			for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-				if (windows_8bpp[i].win == None) {
-					continue;
-				}
-				if (windows_8bpp[i].map_state != IsViewable) {
-					continue;
-				}
-				if (swin == windows_8bpp[i].top) {
-					top = swin;
-					break;
-				}
-			}
-			if (top != None) {
-				break;
-			}
-		}
-	}
-
-	/* for each mapped 8bpp window, mark it changed: */
-
-	for (i=0; i < MAX_8BPP_WINDOWS; i++) {
-		int x1, y1, x2, y2, w, h, f = 32;
-
-		f = 0;	/* skip fuzz, may bring in other windows... */
-
-		if (windows_8bpp[i].win == None) {
-			continue;
-		}
-		if (mode == MARK_8BPP_TOP) {
-			if (windows_8bpp[i].top != top) {
-				continue;
-			}
-		}
-		if (windows_8bpp[i].map_state != IsViewable) {
-			XWindowAttributes attr;
-			int vw = 0;
-
-			X_LOCK;
-			vw = valid_window(windows_8bpp[i].win, &attr, 1);
-			X_UNLOCK;
-			if (vw) {
-				if (attr.map_state != IsViewable) {
-					continue;
-				}
-			} else {
-				continue;
-			}
-		}
-
-		x1 = windows_8bpp[i].x;
-		y1 = windows_8bpp[i].y;
-		w  = windows_8bpp[i].w;
-		h  = windows_8bpp[i].h;
-
-		x2 = x1 + w;
-		y2 = y1 + h;
-
-		if (mode == MARK_8BPP_POINTER) {
-			int b = 32;	/* apply some fuzz for wm border */
-			if (cursor_x < x1 - b || cursor_y < y1 - b) {
-				continue;
-			}
-			if (cursor_x > x2 + b || cursor_y > y2 + b) {
-				continue;
-			}
-		}
-
-		/* apply fuzz f around each one; constrain to screen */
-		x1 = nfix(x1 - f, dpy_x);
-		y1 = nfix(y1 - f, dpy_y);
-		x2 = nfix(x2 + f, dpy_x+1);
-		y2 = nfix(y2 + f, dpy_y+1);
-
-if (db24 > 1) fprintf(stderr, "mark_8bpp: 0x%lx %d %d %d %d\n", windows_8bpp[i].win, x1, y1, x2, y2);
-
-		mark_rect_as_modified(x1, y1, x2, y2, 0);
-		cnt++;
-	}
-	if (cnt) {
-		/* push it to viewers if possible. */
-		rfbPE(-1);
-	}
-}
-
-#endif /* SKIP_8TO24 */
-
diff --git a/ica/x11/x11vnc/8to24.h b/ica/x11/x11vnc/8to24.h
deleted file mode 100644
index d83412b..0000000
--- a/ica/x11/x11vnc/8to24.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_8TO24_H
-#define _X11VNC_8TO24_H
-
-/* -- 8to24.h -- */
-
-extern int multivis_count;
-extern int multivis_24count;
-
-extern void check_for_multivis(void);
-extern void bpp8to24(int, int, int, int);
-extern void mark_8bpp(int);
-
-#endif /* _X11VNC_8TO24_H */
diff --git a/ica/x11/x11vnc/ChangeLog b/ica/x11/x11vnc/ChangeLog
deleted file mode 100644
index 24e33b2..0000000
--- a/ica/x11/x11vnc/ChangeLog
+++ /dev/null
@@ -1,1257 +0,0 @@
-2010-12-29  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Use opengl to read screen on macosx. Experimental
-	  use of non-deprecated macosx interfaces for input injection.
-	  Fix cursors for 64bit macosx. Add -unixsock option.  Work around
-	  grep issue on OpenBSD in create_display.
-
-2010-12-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add RELEASE-NOTES. Call shutdown_uinput() when exiting.
-	  Free some minor memory.  Do not use GetMainDevice() on macosx.
-	  Add utility scripts qt_tslib_inject.pl and uinput.pl. Option
-	  -ungrabboth (not useful.)  X11VNC_SB_FACTOR -sb user tweak.
-	  X11VNC_REFLECT_{bitsPerSample,samplesPerPixel,bytesPerPixel}
-	  for -reflect vncclient.  Fix minor fd leaks. For -create mode
-	  preserve LC_ALL; FIND_DISPLAY_NO_VT_FIND, FIND_DISPLAY_NO_LSOF,
-	  and X11VNC_CREATE_LC_ALL_C_OK.  Speed up -find and  -create scripts
-	  for large installations.  Enable direct event input modes to
-	  bypass uinput.  TSLIB support for uinput touchscreens.  Handle
-	  pressure events on touchscreens.  User can set X11VNC_UINPUT_BUS
-	  and X11VNC_UINPUT_VERSION.  Allow Tab switch in -create login:
-	  prompt.  Fix bug in setting bpp for -rawfb.  Java viewers now
-	  handle mousewheel events. No vars named new.
-
-2010-09-10  Karl Runge <runge at karlrunge.com>
-	* x11vnc: update classes/ssl jars, patches, and script. 
-	  update prepare_x11vnc_dist.sh to 0.9.13. Makefile.am no top_srcdir
-	  Allow user to set avahi name and port via env. vars.  Add
-	  avahi_timeout() sigalarm.  Rename pointer() to pointer_event()
-	  because Xdefs.h is included for some unknown reason. Add
-	  -always_inject option.  Add vnc_reflect_cursor_pos() for -reflect
-	  mode.  Attempt at libvncclient VeNCrypt (disabled.)  Fix bug
-	  with --with-system-libvncserver missing FinishedFrameBufferUpdate.
-	  More info in VncViewer.class http warning.  Look for gdm* in
-	  find display heuristics (e.g. gdm3).  More heuristics with
-	  XAUTHLOCALHOSTNAME attempts.  X11VNC_CREATE_MAX_DISPLAYS: let user
-	  specify max number of -create displays.  FD_USERPREFS modes for
-	  -unixpw (user conf file.) Document all exiting behavior.  Let
-	  user set X11VNC_NO_LIMIT_SHM to avoid autoreduction.  Look for
-	  kdm when avoiding being killed by dm, change timings too.
-
-2010-05-08  Karl Runge <runge at karlrunge.com>
-	* x11vnc: set cd->unixname in apply_opts.  Print message in
-	  vnc_reflect_resize.  Some tweaks to prepare_x11vnc_dist.sh
-
-2010-05-01  Karl Runge <runge at karlrunge.com>
-	* x11vnc: X11VNC_DISABLE_SSL_CLIENT_MODE option to disable SSL
-	  client role in reverse connections.  Improvements to logging in
-	  ultravnc_repeater, ULTRAVNC_REPEATER_NO_RFB option.  Increase
-	  SSL timeout and print message if 'repeater' mode is detected for
-	  reverse SSL connection.  Fix RECORD scroll XCopyArea detection
-	  with recent gtk/gdk library; set X11VNC_SCROLL_MUST_EQUAL
-	  to disable.  Limit logging of RECORD error messages.
-
-2010-04-25  Karl Runge <runge at karlrunge.com>
-	* x11vnc: incorporate new ultravnc_dsm_helper.c, add pointer_mask
-	  remote control query.  Cut openssl default -ping delay.
-
-2010-04-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc/misc: improvements to demo scripts
-	* x11vnc: Alias -coe for -connect_or_exit.  more accurate
-	  dotted_ip() and -listen6.  Improvements to ipv6 mode.
-	  http interface for X11VNC_HTTP_LISTEN_LOCALHOST.  Print
-	  warning about missing Xvfb, Xdummy, or Xvnc in -create.
-	  Fix __LINUX_VIDEODEV2_H / HAVE_V4L2. Always print out info
-	  about Xinerama screens.
-	* x11vnc/misc/enhanced_tightvnc_viewer: check for host cmd.
-	  fix stunnel mode w/o proxy.  Update to stunnel 4.33, Fix
-	  build.unix with new stunnel on Solaris. ipv6 support for
-	  unix ssvncviewer
-
-2010-04-09  Karl Runge <runge at karlrunge.com>
-	* classes/ssl: debugging and workarounds for java viewer
-	* x11vnc/misc: sync ssvnc, improve util scripts.
-	* x11vnc: exit(1) for -connect_or_exit failure, quiet query
-	  mode for grab_state, etc. ipv6 support. STUNNEL_LISTEN for
-	  particular interface. -input_eagerly in addition to -allinput.
-	  quiet Xinerama message.
-
-2010-03-20  Karl Runge <runge at karlrunge.com>
-	* classes/ssl: Many improvements to Java SSL applet, onetimekey
-	  serverCert param, debugging printout, user dialogs, catch
-	  socket exceptions, autodetect x11vnc for GET=1.
-	* x11vnc: misc/scripts: desktop.cgi, inet6to4, panner.pl.
-	  X11VNC_HTTPS_DOWNLOAD_WAIT_TIME, -unixpw %xxx documented, and
-	  can run user cmd in UNIXPW_CMD. FD_XDMCP_IF for create script,
-	  autodetect dm on udp6 only.  Queries: pointer_x, pointer_y,
-	  pointer_same, pointer_root.  Switch on -xkd if keysyms per key >
-	  4 in all cases.  daemon mode improvements for connect_switch,
-	  inet6to4, ultravnc_repeater.pl.  Dynamic change of -clip do
-	  not create new fb if WxH is unchanged.
-
-2010-02-22  Karl Runge <runge at karlrunge.com>
-	* classes/ssl: Java SSL applet viewer now works with certificate
-	  chains.
-	* x11vnc: Printout option -sslScripts.  Suggest -auth guess
-	  in error message.  Set fake_screen width and height.  Test
-	  for +kb in Xvfb.
-
-2010-01-02  Karl Runge <runge at karlrunge.com>
-	* x11vnc: small tweaks to Xdummy, rx11vnc*.  Apply
-	  SMALL_FOOTPRINT to -appshare text.  Copyright year change.
-
-2009-12-29  Karl Runge <runge at karlrunge.com>
-	* x11vnc: rename -create_x to -create_xsrv.  Hopefully
-	  done fixing Xdummy.
-
-2009-12-28  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Fix problems in --without-x builds.  Fix crash
-	  with -QD query for dbus info.  Adjust window size for
-	  small screens in -gui.  Improve F1 help for xdm, etc.
-	  include ssvnc 1.0.25 source.
-
-2009-12-24  Karl Runge <runge at karlrunge.com>
-	* x11vnc: prepare_x11vnc_dist.sh for 0.9.10. -xdummy_xvfb,
-	  -svc_xdummy_xvfb and -create_x shorthand. lxde session.
-	  Xdummy improvements and root no longer required.
-
-2009-12-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -DENC_HAVE_OPENSSL=0 to disable enc.h but still
-	  have ssl. Tweak ps command in find_display. Try to handle
-	  AIX su. Ignore an initial newline at login: for -unixpw.
-
-2009-12-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix keycode and other remote control actions under
-	  DIRECT: with an extra XFlush and other safety measures.
-	  fflush(stderr) much in su_verify.  Make the -unixpw env. vars
-	  UNIXPW_DISABLE_SSL and UNIXPW_DISABLE_LOCALHOST work correctly.
-	  Make -loopbg actually imply -bg.  Add tag=... to unixpw opts
-	  to set FD_TAG.  Prefer Xvfb over Xdummy.  Reduce wait time
-	  for https. Add 'Login succeeded' output to unixpw panel.
-
-2009-12-15  Karl Runge <runge at karlrunge.com>
-	* x11vnc: X11VNC_REMOTE, X11VNC_TICKER, and VNC_CONNECT properties
-	  names can be changed via env. vars (e.g. for multiple
-	  x11vnc instances.) The -quiet option documented better.
-	  Add fakebuttonevent remote control action.  Improve child
-	  test for connecting to port 113.  Add connect_switch and
-	  ultravnc_repeater.pl to CVS. Report X server number of mouse
-	  buttons.  Change find_display script to check for stale pids
-	  in /tmp/.XNN-lock.  If root under find_display, try FD_XDM
-	  if previous failed to find auth.  Print error reasons for
-	  -storepasswd failures.
-
-2009-12-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: findauth/-auth guess works with FD_XDM=1 for root
-	  finding dm's xauthority.  Work around for GDM's recent 
-	  'xhost SI:localuser:root' usage. X11VNC_REOPEN_SLEEP_MAX
-	  for longer lived -reopen-ing. X11VNC_EXTRA_HTTPS_PARAMS for
-	  additional URL parameters, X11VNC_HTTP_LISTEN_LOCALHOST=1 to
-	  force libvncserver http to listen on localhost.
-
-2009-12-04  Karl Runge <runge at karlrunge.com>
-	* classes/ssl: update binaries; new signing key; ss_vncviewer.
-	* x11vnc: add more wish possibilities for -gui.  Declare crypt()
-	  on all platforms (disable with -DDO_NOT_DECLARE_CRYPT.)
-
-2009-12-02  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -appshare mode for sharing an application windows of the
-	  entire desktop. map port + 5500 in reverse connect.  Add id_cmd
-	  remote control functions for id (and other) windows.  Allow zero
-	  port in SSL reverse connections.  Adjust delays between multiple
-	  reverse connections; X11VNC_REVERSE_SLEEP_MAX env var.  Add some
-	  missing mutex locks; add INPUT_LOCK and threads_drop_input.
-	  More safety in -threads mode for new framebuffer change.  Fix
-	  some stderr leaking in -inetd mode.
-
-2009-11-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc: use -timeout setting for reverse connections too.
-	  Delay calling xfixes at the beginning of 1st connection to avoid
-	  display manager Xorg server crash.  Delay selwin creation at the
-	  begin 1st connection to avoid being killed by display manager.
-	  Options -findauth and '-auth guess'. Export icon_mode query.
-	  Do not open X display in -rawfb mode unless asked. Bugfix for
-	  -sid/-id handling window offscreen or bigger than display.
-	  Search for windows with _DBUS_SESSION_BUS_PID to decide which
-	  dbus_launch is ours. Fix missing displays in FIND_DISPLAY
-	  script.  Add X11VNC_SKIP_DISPLAY_NEGATE.  Improvements to
-	  'x11vnc Properties' gui dialog and connecting with x11vnc via
-	  socket (client list.) X11VNC_SYSTEM_GREETER1 for previous text
-	  font size.  Fix bug with unixpw and vencrypt plain login.
-	  Have fast fb read rate keep waitms and defer the same.
-	  More heuristics to check try if GDM is still running (window
-	  names gdm-*)
-
-2009-10-17  Karl Runge <runge at karlrunge.com>
-	* x11vnc: support for -solid option in xfce desktop.  
-	  List -Q guess_dbus query. Implement -showrfbauth option.
-	  Workaround for inane X_ShmAttach incompatibility in Xorg.
-
-2009-10-08  Karl Runge <runge at karlrunge.com>
-	* x11vnc: bcx_xattach/x2x desktop switching facility.
-	  More remote control features: grab_state, ping:mystring,
-	  grablocal, resend_cutbuffer, resend_clipboard, resend_primary,
-	  keycode, keysym, ptr, sleep, get_xprop, set_xprop, wininfo,
-	  pointer_pos, mouse_xy, noop, guess_dbus Add DIRECT: for
-	  remote control w/o server.  X11VNC_NO_CHECK_PM for more
-	  quiet DIRECT: usage.  Options -query_retries, -remote_prefix,
-	  and X11VNC_SYNC_TIMEOUT for remote control.  Add scripting
-	  to remote control.  ping clients during in unixpw login.
-	  Option -unixpw_system_greeter as shortcut to XDM/GDM/etc panel.
-	  Add clear_all, viewonly, nodisplay, to unixpw username:opts.
-	  F1 help for options (including smaller console font).
-	  Document FD_TAG.  Eat multiple property change events in one
-	  sitting (also PROP_DBG=1).  Support more -ssl features (special
-	  cert names, single port, client certs, etc.) in -stunnel
-	  external SSL helper mode.  Reorganize openssl code to allow
-	  integration with stunnel features if not compiled with openssl.
-	  X11VNC_HTTPS_VS_VNC_TIMEOUT Fix dbus session address for -solid
-	  in gnome.  Use dbus-launch in -create mode if available.
-	  X11VNC_SKIP_DISPLAY=all in -find/-create mode.  let noxauth
-	  unset XAUTHORITY for use with su - $USER. CREATE_DISPLAY_EXEC
-	  debugging.  Add x_terminal_emulator to -create cmd search.
-	  Option -extra_fbur to tune fb update requests tracking; make
-	  default tracking more aggressive.  RATE_VERB/CHECK_RATE env. for
-	  fbur rate.  Env. vars to set Tk gui fonts.  Catch closed
-	  socket reads/writes.  Try to detect 'crazy' xdamage insertion,
-	  e.g. from some xscreensavers (needs work.).  Don't switch
-	  on server autorepeat if any keys are pressed down to work
-	  around Xorg server and/or gnome bug.  If PATH is empty, set
-	  it to minimal one.  Fix bug with -bg and -dp/-dk printout if
-	  logfile present.
-	* classes/ssl: license statement.
-
-2009-06-18  Karl Runge <runge at karlrunge.com>
-	* classes/ssl: java viewer now handles auth-basic proxy logins.
-	* misc/enhanced_tightvnc_viewer: update ssvnc.
-
-2009-06-14  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add X11VNC_REFLECT_PASSWORD env. var. for -reflect mode.
-	  Message to user about compiz problems suggesting -noxdamage.
-	  Improvements to single-port detection and logging.
-
-2009-05-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Thread safety improvements. Add 'OpenOffice' to special
-	  case list for scroll detection.  Fix -clip mode under -rawfb.
-	  Workaround Xorg bug that yields infinitely repeating keys
-	  when 'xset r off' action is done with keys pressed. Env. var
-	  X11VNC_IDLE_TIMEOUT.
-
-2009-03-12  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Fix off-screen bug for -ncache_cr copyrect.
-
-2009-03-07  Karl Runge <runge at karlrunge.com>
-	* x11vnc: allow range for X11VNC_SKIP_DISPLAY, document grab
-	  Xserver issue.  Add progress_client() to proceed more quickly
-	  thru handshake.  Improvements to turbovnc hack.
-
-2009-02-28  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add kludge to experiment with turbovnc.
-
-2009-02-25  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix some -QD cases for use in tkx11vnc.
-
-2009-02-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -noskip_lockkeys option for future use.
-
-2009-02-03  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add "sendbell" remote cmd.  Fix copyrect updates under
-	  -reflect.  Workaround that checks valid window of selection
-	  requestor.  Wait on some ssl helper pids earlier.  Workaround
-	  XAUTHLOCALHOSTNAME for some new usage modes.  Set fake fb to
-	  requested bpp with correct masks.  -padgeom once:... mode.
-	  Set LIBXCB_ALLOW_SLOPPY_LOCK by default. rfbRandomBytes earlier.
-	* classes/ssl: Update jars.  Add "TOP_" dropdown customization to
-	  ultravnc java viewer applet FTP panel.
-
-2009-01-11  Karl Runge <runge at karlrunge.com>
-	* classes/ssl: Add configurable Ultra java applet Filexfer Drives
-	  drop down (e.g. ftpDropDown=Home.Desktop.bin).  Document all  
-	  applet parameters in classes/ssl/README.
-
-2009-01-10  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix failure of -8to24 on default depth 24 due to 
-	  nonstandard indexed color support changes.  Fix small window
-	  for failure after XSendEvent selection call; add env var.
-	  X11VNC_SENDEVENT_SYNC=1 to take even more care.
-
-2009-01-03  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -rmflag option, -rawfb vt support, bpp < 8 support
-	  for rawfb, find /dev/video better. Fix reverse SSL connection
-	  for DH.  Some improvements for CUPS TS helper, restart if needed.
-
-2008-12-10  Karl Runge <runge at karlrunge.com>
-	* x11vnc: 0.9.6 release.  Some strtok bugfixes. rename -tlsvnc
-	  to -anontls. Disable ssl caching.  No cert creation prompting
-	  in inetd or bg modes.  waitpid a bit more carefully on ssl
-	  helpers.  Tune ssl initial timeouts. Let -create user specify
-	  starting X display.  fix -rfbport prompt gui for older tk.
-	  -sslonly option. Error if no -ssl with related options. -rand
-	  option.  -ssl implies -ssl SAVE
-
-2008-11-22  Karl Runge <runge at karlrunge.com>
-	* x11vnc: x11vnc.desktop file. -reopen, -dhparams, -sslCRL,
-	  -setdefer options. -rfbport PROMPT VeNCrypt and TLSVNC SSL/TLS
-	  encryption support.  Tweaks to choose_delay() algorithm.
-	  -ssl ANON anonymouse Diffie-Hellman mode.  Fix bugs in certs
-	  management.  Additions to tray=setpass naive user mode.
-
-2008-11-09  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add zeroconf external helpers (avahi-publish and
-	  dns-sd).  Alias -zeroconf.  Close pipeinput_fh on exit.
-	  Kludge to make -solid work on MacOSX console.  Attempt at
-	  cpp macros to disable newer libvncserver interfaces.
-
-2008-10-29  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -http_oneport for single port HTTP and VNC.
-	  Improve find_display wrt lsof blocking with -b.
-
-2008-10-19  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -chatwindow for chat window on X console using SSVNC
-	  as a helper. Print suggestion for X_ShmAttach failure.
-	  Allow -scale WxH for different X- and Y-scaling factors.
-	  Workaround for missing -enc cipher EVP_aes_256_cfb.  Modify
-	  message digest and salt/IV parameters.  Try to improve compile
-	  time by breaking up large if blocks.
-
-2008-09-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add symmetric key encryption -enc cipher:keyfile,
-	  works with SSVNC.  Make -remap work on MacOSX console.
-	  update to 0.9.5 strings.  Add a couple menu items to tkx11vnc.
-
-2008-09-17  Karl Runge <runge at karlrunge.com>
-	* x11vnc: make -allow work in -ssl mode.
-
-2008-09-14  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -sleepin m-n for random sleep. More mktemp and mkstemp
-	  protections. SSL_INIT_TIMEOUT=n env. var.  Fix macosx console
-	  X call bug.  Synchronize other projects sources.
-
-2008-09-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: kill gui_pid on exit in -connect/-connect_or_exit mode.
-	  -grablocal n experiment (not compiled by default).  -macuskbd
-	  option for macosx for orig uskdb code. keycode=N remote contol
-	  cmd.  Find dpy look at non-NFS cookies in /tmp.  Fix gui tray
-	  insertion on recent gnome dt. Fix connect_file bug. Sync SSVNC
-
-2008-06-07  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -clip xineramaN option, -DIGNORE_GETSPNAM for HP-UX.
-	  Print info on SSH_CONNECTION override.
-
-2008-05-31  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Improvements to nonstandard indexed color support, e.g.
-	  depths 1, 4, 12, etc. instead of only 8.  Only enable xinerama
-	  xwarppointer if there is more than 1 subscreen.
-
-2008-05-07  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add UltraVNC repeater proxy support.  fix to setp gui
-	  mode. -threads is now strongly discouraged.  Read PORT= in url.
-	  User can set nolisten for Xvfb in -create mode.  clean up 
-	  wait_for_client() to some degree.
-
-2008-01-31  Karl Runge <runge at karlrunge.com>
-	* x11vnc: during speeds estimate, guard against client
-	  disconnecting.  ssvnc sync.
-
-2008-01-14  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -ping option, fix memory corruption in copy_tiles
-	  after xrandr resize.
-
-2007-12-16  Karl Runge <runge at karlrunge.com>
-	* x11vnc: setup remote-ctrl file by default on macosx. improve
-	  tkx11vnc wrt attaching to existing server in icon/tray mode. 
-
-2007-12-15  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix find_display and usleep() prototype on macosx.
-	  -display console and check DISPLAY /tmp/...:0 on macosx.
-	  implement -noxinerama.
-
-2007-11-12  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add clear_locks (Caps_Lock, etc) action.  Fix
-	  ssh tunnel on Darwin.
-
-2007-10-27  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix ncache bug and others under -8to24, -ssh
-	  option, socks and other proxies in -proxy option.
-	  compiler warnings.  fix TARGETS selection request bug
-	  (java, konsole).
-
-2007-10-03  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add xfce to createdisplay
-
-2007-09-26  Karl Runge <runge at karlrunge.com>
-	* x11vnc: COLUMNS=256 to find/create scripts. More ratecheck.
-
-2007-09-14  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add -sshxdmsvc. Fix find_display for inetd.  Improve
-	  -allinput method; env CHECK_RATE to watch for FBUR build up
-	  (i.e. JFVNC).
-
-2007-09-11  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix wireframe crash under -clip.  Add -redirect for
-	  VNC redir.  -rawfb nullbig, randbig, solid, swirl, etc.
-	  FD_XDM mode to find_display. -listdpy.  Add enlightenment.
-	  Xvnc.redirect FINDDISPLAY-vnc_redirect. -xvnc, -xvnc_redirect,
-	  -svc_xvnc. AUTO_PORT.
-	* ssvnc: sshvnc ssh-only, tsvnc Terminal Services modes.
-	  Improvements to ss_vncviewer.  Automatically find X dpy and
-	  X login.  Reorganize menus a bit.  ~/.ssvncrc file.
-
-2007-09-04  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add -autoport and -finddpy utils. -xdummy creation.
-	  tweak xkb tiebreaking again.  Shut off -ncache in dev mode.
-	  watch for xrandr events even if no -xrandr.  Tips for types
-	  of URLs for java viewers.  Add check_redir_services() to
-	  create_display and tsdo() redir helper utility (-tsd).
-	  Improvements to Xdummy.  Prevent dcop XAUTHORITY=''
-
-2007-08-19  Karl Runge <runge at karlrunge.com>
-	* x11vnc: better -xkb tie-breaking for up keystrokes.  Add 
-	  Xsrv/FD_XSRV custom server to FINDCREATEDISPLAY list.
-
-2007-08-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc: improve FINDCREATEDISPLAY (-create) script.  Document
-	  FD_GEOM, FD_SESS, FD_OPTS, FD_PROG env vars, add Xvnc support. 
-
-2007-08-15  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add reverse -connect support to -display WAIT:
-	  i.e. -find, -create, -svc, ... mode.  Document need for
-	  -shared under -connect host1,host2,...  Fix bug in -display
-	  WAIT: mode if vnc client tries to only retrieve SSL cert.
-
-2007-08-03  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -xrefresh option, fix KDE .DCOPserver parse bug,
-	  make sure UNIXPW_DISABLE_LOCALHOST/-unixpw_unsafe ignore
-	  any SSH tunnel that would imply -localhost.
-
-2007-07-04  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -debug_ncache, fix big fonts in tkx11vnc.
-
-2007-06-14  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add detectors if ultravnc chat or file xfer took place,
-	  if so ping clients more frequently.  Fix compile bug if libssl
-	  not available.
-	* ssvnc: add ultravnc ftp jar feature. Add certificate management
-	  "Verify All Certs".
-
-2007-05-26  Karl Runge <runge at karlrunge.com>
-	* x11vnc: set to version 0.9.2, back to NCACHE -12 for testing.
-	  in -unixpw, initial Escape means no echo username (see ssvnc).
-
-2007-05-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: set things up (NCACHE = -1) to not have -ncache
-	  on by default; just give a blurb about it.
-
-2007-05-16  Karl Runge <runge at karlrunge.com>
-	* x11vnc: print out peer host and port for debugging SSL. 
-	* ssvnc: rand check, SOCKS support, PORT=, Verify all Certs
-	  and accepted certs logging.
-
-2007-05-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: lower -wait and -defer to 20ms.  Change some SSL
-	  debug output.  Drop client doing ultravnc stuff in -unixpw
-	  during login phase.
-
-2007-05-05  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add groups handling for -users mode.
-
-2007-05-01  Karl Runge <runge at karlrunge.com>
-	* ssl: update to java viewer and utility scripts (add onetimekey).
-	* x11vnc: setsid() for -gone mode. setpgrp for -create script and
-	  add -cc 4 to avoid DirectColor.
-
-2007-04-28  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -users sslpeer= option. RFB_SSL_CLIENT_CERT var.
-	  X11VNC_FINDDISPLAY_ALWAYS_FAILS var. -ncache default 10.
-	  gid switch fix.
-	* ssvnc: Linux.i*86 fix and code sync.
-
-2007-04-07  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add gnome, kde, etc. FINDCREATEDISPLAY tags.
-	  In check_ncache periodically check for changed desktop. 
-
-2007-03-24  Karl Runge <runge at karlrunge.com>
-	* x11vnc: reverse SSL connections.  -sleepin option.
-
-2007-03-20  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add -httpsredir option for router port redirs.
-	  set Xcursor bg/fg color values to zero.  Env var to
-	  force timeout: X11VNC_HTTPS_VS_VNC_TIMEOUT.  Let user
-	  supply nc=N at login prompt.  Disable -ncache beta
-	  test under -http/-httpdir.
-
-2007-03-13  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix crash for kde dcop. limit ncache beta
-	  tester to 96MB viewers. 
-
-2007-02-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Get ultravnc textchat working with ssvnc.
-
-2007-02-16  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add Files mode to user controlled input. more
-	  ultra/tight filexfer tweaks.  rfbversion remote control.
-	  noncache/nc unixpw user opt.
-
-2007-02-15  Karl Runge <runge at karlrunge.com>
-	* x11vnc: tightvnc filetransfer off by default. avahi
-	  fixes.  FINDCREATEDISPLAY geometry.  -noultraext.
-
-2007-02-12  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add avahi (aka mDNS/Zeroconf/Bonjour...)
-	  support thanks to Diego Petten�.  -avahi/-mdns.
-	  Add -find and -create FINDISPLAY aliases.
-
-2007-02-11  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -grabalways, -forcedpms, -clientdpms, and 
-	  -noserverdpms (ultravnc viewer) for improvements in
-	  the still approximate server locking.  Add -loopbg
-	  and -svc, -xdmsvc aliases. Bug fix create_display.
-
-2007-02-10  Karl Runge <runge at karlrunge.com>
-	* x11vnc: watch things like textchat, etc. more carefully 
-	  in unixpw state.  Monitor broken XDAMAGE reports when
-	  OpenGL apps like beryl are running.  Implement simple
-	  kbdReleaseAllKeys, setSingleWindow, setServerInput actions
-	  (ultravnc extentions).  Try to send XDM the username in
-	  FINDCREATEDISPLAY, also try .dmrc before .xsession.
-
-2007-01-31  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -reflect reflector/repeater mode with libvncclient.
-	  -ncache tweaks: no kde animations and wm improvements,
-	  fixes to FINDDISPLAY and FINDCREATEDISPLAY login modes,
-	  MODTWEAK_LOWEST envvar for HP-UX keyboard workaround.
-	  -N option for display and rfbport matching.
-
-2007-01-12  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -N option, more -ncache improvements, kde/gnome.
-
-2007-01-03  Karl Runge <runge at karlrunge.com>
-	* x11vnc: more -ncache improvements.
-
-2007-01-01  Karl Runge <runge at karlrunge.com>
-	* x11vnc: more -ncache improvements.
-
-2006-12-28  Karl Runge <runge at karlrunge.com>
-	* x11vnc: more work on -ncache, add macosx support, fix X errors
-	  and improve cache expiration algorithm.
-
-2006-12-17  Karl Runge <runge at karlrunge.com>
-	* x11vnc: first pass at client-side caching, -ncache option.
-	  have -http guess ../classes/.. to run out of build area.
-
-2006-12-17  Karl Runge <runge at karlrunge.com>
-	* x11vnc: make -xwarppointer the default if xinerama is active.
-
-2006-12-09  Karl Runge <runge at karlrunge.com>
-	* java SSL viewer: guard against empty urlPrefix
-	* x11vnc: FINDCREATEDISPLAY support to create X session if
-	  one cannot be found.  close fds utility.  Print VNC Viewer
-	  is.. for find display mode.  chvt(1) utility.
-
-2006-11-23  Karl Runge <runge at karlrunge.com>
-	* prepare_x11vnc_dist.sh: make ss_vncviewer installed 755.
-	* x11vnc: for HTTPONCE open new http port in -inetd mode.
-	  -prog option to indicate full path to program (not know
-	  when in -inetd and tcpd)
-
-2006-11-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: macosx: problem with padded framebuffer rows, wait for
-	  user to switch back, CutText xfer support, ignore a few more
-	  types of toplevels.  Add local user wireframing.  -dpms/-nodpms
-	  option to work around kdesktop_lock problem.
-
-2006-11-13  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Native Mac OS X support.
-
-2006-11-07  Karl Runge <runge at karlrunge.com>
-	* ssl_vncviewer: vnc:// direct connect, add -x to ssh,
-	  SSL_VNC_LISTEN variable for direct proxy.
-
-2006-10-29  Karl Runge <runge at karlrunge.com>
-	* x11vnc: Add tip about how to reenable RECORD extension.
-
-2006-10-11  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -cursor_drag for DnD, etc.
-
-2006-09-23  Karl Runge <runge at karlrunge.com>
-	* Java viewer: improvements to connection response, faster
-	  connections.
-	* x11vnc: some cleanup for -unixpw login process.
-
-2006-09-20  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -unixpw_cmd, -passwfile cmd:/custom:, -sslnofail,
-	  -ultrafilexfer
-
-2006-09-17  Karl Runge <runge at karlrunge.com>
-	* x11vnc: move some info printout to -v, -verbose mode.  Add 
-	  -connect_or_exit option.  Have -rfbport 0 lead to no TCP
-	  listening.  Eliminate double certificates in .pem files.
-	  Always print SSL certificate to the screen to aid pasting.
-
-2006-09-15  Karl Runge <runge at karlrunge.com>
-	* x11vnc: allow user set signals to ignore, clear DISPLAY in 
-	  -unixpw su_verify. -rawfb none same as null. 
-	* rfbserver.c: shorten rfbEncodingNewFBSize message.
-
-2006-09-13  Karl Runge <runge at karlrunge.com>
-	* x11vnc: document 'ssh -t' improved keyboard response.  add
-	  extra rfbPE() around keystrokes. 
-	  misc/enhanced_tightvnc_viewer: incorporate scripts, documentation,
-	  etc. for the enhanced tightvnc viewer package.
-
-2006-09-10  Karl Runge <runge at karlrunge.com>
-	* x11vnc: minor changes: REQ_ARGS for -sslGenCert, EV_SYN
-	  SYN_REPORT check restore cursor most under -display WAIT.
-
-2006-08-10  Karl Runge <runge at karlrunge.com>
-	* x11vnc: first pass at touchscreens via uinput.
-
-2006-08-02  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -ssltimeout option; tweak ssl timeouts.
-
-2006-07-28  Karl Runge <runge at karlrunge.com>
-	* ssl_vncviewer: remove some bashisms, add features.
-	* x11vnc: -rotate option (e.g. handheld), fix FPE on tru64.
-
-2006-07-17  Karl Runge <runge at karlrunge.com>
-	* x11vnc: enable --without-x builds for -rawfb only (NO_X11)
-
-2006-07-11  Karl Runge <runge at karlrunge.com>
-	* x11vnc: more tweaks to UINPUT, mostly mouse motion.
-
-2006-07-08  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add uinput support (-pipeinput UINPUT:...) for full
-	  mouse and key input to linux console (e.g. for qt-embedded apps)
-	  add -allinput for handleEventsEagerly.
-
-2006-07-04  Karl Runge <runge at karlrunge.com>
-	* x11vnc: 2nd -accept popup with WAIT, and UNIX: info for unixpw
-	  login.  Use RFB_CLIENT_ON_HOLD for -unixpw. -unixpw white arrow
-	  -license option.  Use getspnam if getpwnam is short.
-	  abbrevs sc=, cm, ck for user:opts.
-
-2006-06-23  Karl Runge <runge at karlrunge.com>
-	* x11vnc: misc cleanup.
-
-2006-06-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -grabkbd, -grabptr, -env options.  under -unixpw +
-	  WAIT let user add some options after his username (e.g. runge:3/4)
-	  -allowedcmds to fine tune vs. -nocmds.  general cleanup.
-
-2006-06-12  Karl Runge <runge at karlrunge.com>
-	* x11vnc: word tune SSL Java viewer; fix multi-certs bug. Add 
-	  -display WAIT:cmd=FINDDISPLAY builtin script and cmd=HTTPONCE
-	  action.  -http_ssl option for ssl subdir only.  Add -rawfb RAND
-	  test case.  improve raw_xfer() for use in inetd https transfer.
-	  fix bug SSH + -unixpw -> -localhost.  fix bug setup cursors
-	  in WAIT mode.  Mac OS X pty tweak.
-
-2006-06-09  Karl Runge <runge at karlrunge.com>
-	* x11vnc: make -display WAIT + -unixpw work on Solaris.
-
-2006-06-08  Karl Runge <runge at karlrunge.com>
-	* x11vnc: XOpenDisplay wrapper for raw xauth data, -unixpw 
-	  su_verify() to run any cmd, -users unixpw= mode. -display WAIT:...
-	  modes for delayed X display opening and dynamic choosing.
-
-2006-06-03  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -capslock and -skip_lockkeys options.  map some Alt keys
-	  to Latin under linuxfb.  switch to new stats API.  Handle more
-	  cases carefully when switching fb.
-	
-2006-05-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: improved support for webcams and tv tuners with
-	  video4linux /dev/video: -rawfb video, -freqtab etc.
-	  Convenience option for linux VT's: -rawfb cons (LinuxVNC
-	  method).  -pipeinput builtins for video and console.
-	  -24to32 option to avoid 24bpp problems. "snap:" method for
-	  -rawfb.
-
-2006-04-26  Karl Runge <runge at karlrunge.com>
-	* x11vnc: skip exit in check_openssl() if not compiled with
-	  libssl.  set SKIP_HELP (again) in small footprint builds.
-
-2006-04-16  Karl Runge <runge at karlrunge.com>
-	* x11vnc: More web proxy work for Java SSL applet and wrapper
-	  script ssl_vncviewer.  Apache SSL gateway support for
-	  incoming x11vnc connections.  Handle "double proxy" case.
-
-2006-04-05  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add FBPM support (-fbpm) for Suns. -rawfb ZERO for
-	  testing.  Basic key+cert management utilities: -sslGenCA,
-	  -sslGenCert, -sslEncKey, -sslDelCert, -sslCertInfo, and
-	  addln features.  SSL proxy connection.  -storepasswd with
-	  no args or pw echo.
-
-2006-03-26  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -xinerama now on by default.  In -ssl mode accept https
-	  applet downloads thru VNC port.  -https option for 2nd https
-	  port.  Look for classes/ssl under -http.  add Java URL messages
-	  to final output lines.  make -inetd work with -ssl (even for
-	  https).  fix -unixpw login prompt under -scale.  guard against
-	  clientData = NULL. 
-
-2006-03-11  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -ssl mode using libssl.  Include Xdummy in misc.
-	  a few more macros for smallerfoot, etc.
-
-2006-03-08  Karl Runge <runge at karlrunge.com>
-	* x11vnc: manage CLIPBOARD in addition to PRIMARY.  -debug_sel
-	  Make reverse connections require passwords.  -usepw option.
-	  -storepasswd w/o args prompts and writes ~/.vnc/passwd.
-
-2006-03-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: switch remote control to X11VNC_REMOTE property.  Put
-	  in -unixpw constraints for reverse connections under -inetd.
-	  -inetd won't quit when reverse conn client leaves. Allow keyboard
-	  input for viewonly -unixpw logins.  "%*" utils for testing
-	  -unixpw.  improve start time fix bugs, small screen in gui.
-
-2006-03-04  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -unixpw on *bsd, hpux and tru64.  Add -unixpw_nis for
-	  non-shadow systems. check stunnel dying.  check SSH_CONNECTION
-	  in -unixpw.  gui icon tweaks, unix username.
-
-2006-03-02  Karl Runge <runge at karlrunge.com>
-	* x11vnc: more tweaks to -unixpw mode.  Add -gone popup mode.
-	  Change filexfer via -R.  Tune SMALL_FOOTPRINT.  gui fixes.
-
-2006-02-24  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -unixpw for Unix password auth, -stunnel to setup
-	  stunnel(1) for an SSL tunnel on the server end.  Add clipboard
-	  input to per-client input controls.
-
-2006-02-20  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add SIGINT SIGQUIT handling for run_user_command(),
-	  set some signal handlers to SIG_DLF for forked children, 
-	  put a timeout on port 113 connection to viewer machine.
-
-2006-02-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: fix AIX build wrt h_errno.
-
-2006-02-06  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -8to24 more speedups; tunables for very slow machines.
-
-2006-02-04  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -8to24 speedups and improvements.
-
-2006-01-21  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -8to24 opts, use XGetSubImage. fix -threads deadlocks and
-	  -rawfb crash.
-
-2006-01-18  Karl Runge <runge at karlrunge.com>
-	* x11vnc: -8to24 now works on default depth 8 screens.
-
-2006-01-16  Karl Runge <runge at karlrunge.com>
-	* x11vnc: more tweaks to -8to24, add XGETIMAGE_8TO24 mode to call
-	  XGetImage() on the 8bpp regions.
-
-2006-01-14  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -8to24 option for some multi-depth displays (but use
-	  of -overlay is preferred if supported).
-
-2006-01-12  Karl Runge <runge at karlrunge.com>
-	* fix -DSMALL_FOOTPRINT=N builds.
-
-2006-01-11  Karl Runge <runge at karlrunge.com>
-	* x11vnc: close fd > 2 in run_user_command(), -nocmds in crash_debug,
-	  fix 64bit bug for -solid.
-
-2006-01-08  Karl Runge <runge at karlrunge.com>
-	* x11vnc: the big split. opts: -afteraccept and -passwdfile read:
-
-2005-12-24  Karl Runge <runge at karlrunge.com>
-	* x11vnc: enhance -passwdfile features, filetransfer on by default,
-	  call rfbRegisterTightVNCFileTransferExtension() earlier.
-
-2005-11-28  Karl Runge <runge at karlrunge.com>
-	* x11vnc: add -loop option.
-
-2005-11-25  Karl Runge <runge at karlrunge.com>
-	* x11vnc: throttle load if fb update requests not taking place.
-	* misc/x11vnc_pw: add utility script
-
-2005-10-22  Karl Runge <runge at karlrunge.com>
-	* add tightVNC FileTransfer (-filexfer) and -DFILEXFER=1
-	* -slow_fb for special purpose infrequent polling.
-	* make -blackout work with copyrect clipping.
-	* -blackout noptr,WxH+X+Y,... to prevent pointer from going
-	  into a blacked out region.
-
-2005-07-17  Karl Runge <runge at karlrunge.com>
-	* more improvements to gui UE.  gui requests via client_sock
-	  PASSWD_REQUIRED and PASSWD_UNLESS_NOPW build options.
-
-2005-07-12  Karl Runge <runge at karlrunge.com>
-	* gui: remove nevershared etc., parse cmd line, bug fixes.
-	* x11vnc: fix pointer queue buildup under -viewonly.
-
-2005-07-10  Karl Runge <runge at karlrunge.com>
-	* more improvements to gui, default values, save-settings..
-	* x11vnc scary password warnings. Release settings. -QD option.
-	  add \# to rc files and fix rcfile read bug.
-
-2005-07-09  Karl Runge <runge at karlrunge.com>
-	* add -grab_buster helper thread to break up grabs (might not be
-	  need any longer due to gett XFlush-ing).  Fix scrolls and
-	  copyrect for -clip and -id cases.
-
-2005-07-06  Karl Runge <runge at karlrunge.com>
-	* many improvements to the gui. now embeds into system tray ok.
-	  x11vnc -debug_grabs, -printgui, -nosync
-
-2005-07-01  Karl Runge <runge at karlrunge.com>
-	* support for simple "-gui tray" mode (small icon like the original
-	  x0rfbserver had).  Can't figure how to get a tray to swallow it..
-	* passwd, viewpasswd changing in tray mode.
-	* allow typos like: x11vnc -R -scale 3/4
-
-2005-06-26  Karl Runge <runge at karlrunge.com>
-	* track keycode state for heuristics, -sloppy_keys, -wmdt
-	* add -nodbg as option
-
-2005-06-21  Karl Runge <runge at karlrunge.com>
-	* reinstate "bad desktop" for wireframe.
-	* extra long info and tips of XOpenDisplay fails.
-
-2005-06-18  Karl Runge <runge at karlrunge.com>
-	* clean up some malloc/free problems (don't free the current cursor)
-	* set DISPLAY before calling gconf, dcop under -solid
-	* -inetd -q and no -o logfile implies closing stderr.
-
-2005-06-14  Karl Runge <runge at karlrunge.com>
-	* -DNOGUI and -DVIEWONLY build options
-	* -noskip_dups the default (windows viewer sends no ups when
-	  repeating)
-	* HAVE_SOLARIS_XREADSCREEN and HAVE_IRIX_XREADDISPLAY
-	* Alt+Button+Motion to wireframe.  tunable in WIREFRAME_PARMS
-	* copyrect now the default under -scale (works OK, but must
-	  send a cleanup update)
-	* fix -pedantic and Sun cc warnings and errors (unsigned, etc..)
-	* print out fatal error messages under -quiet
-	* -seldir to control and debug selection transfers.
-	* fix crashes on 64bit wrt unsigned long in rich cursors.
-	* fix kde guessing errors
-	* more scrolling and wireframe tweaks.
-
-2005-06-03  Karl Runge <runge at karlrunge.com>
-	* make scrollcopyrect more or less usable under -scale
-	* add -fixscreen for periodic cleanup of painting errors.
-	* adjust keyrepeat scroll behavior.
-
-2005-05-30  Karl Runge <runge at karlrunge.com>
-	* alter "magic cleanup key sequences" (N*Alt_L and N*Super_L)
-	* dial down check_xrecord_reset() reset times.
-
-2005-05-24  Karl Runge <runge at karlrunge.com>
-	* more -scrollcopyrect: GrabServer detection, autorepeat throttling,
-	  hack to clean screen 3,4,5 Alt_L in a row, mouse wheel detect.
-	* fix bug wrt switching to single_copytile, add Darwin to shm limit.
-
-2005-05-17  Karl Runge <runge at karlrunge.com>
-	* more -scrollcopyrect, -scr_term hacks for terminals.
-	* -wait_ui, -nowait_bog tunables.  push cursor sooner.
-
-2005-05-14  Karl Runge <runge at karlrunge.com>
-	* much more work on  "-scrollcopyrect" mode... getting usable.
-	* remove -pointer_mode 3, shift everyone back down
-	* -dbg "crash shell" for debugging
-	* -add_keysyms now the default, periodically clears if needed.
-	* try to autodetect if -xkb would be a good idea.
-	* improve keycode guessing for -xkb mode (force ISO_Level3_Shift)
-	* -remap DEAD, etc. for dead/mute keys remappings.
-
-2005-05-02  Karl Runge <runge at karlrunge.com>
-	* initial support for using RECORD to detect some types of window
-	  scrolls.  This is "-scrollcopyrect" mode, use -noscrollcopyrect
-	  to disable.  Much tuning and painting error repair still required.  
-	* more build time customizations: REMOTE_DEFAULT, REMOTE_CONTROL,
-	  EXTERNAL_COMMANDS, NOREPEAT, WIREFRAME*, SCROLL*, ...
-	* added bandwidth and latency measurements.
-	* added XListHosts to -privremote check.
-	* debug_* remote-control variables.
-	* removed OLD_TREE stuff.
-
-2005-04-19  Karl Runge <runge at karlrunge.com>
-	* somewhat safer remote-control defaults, and addnl options for
-	  more safe operation: -privremote, -safer, -nocmds, -unsafe
-	* -wireframe, -wirecopyrect: instead of having user look at a
-	  slowly moving, lurching window, guess when a window is being
-	  moved/resized and just show a wireframe. -wirecopyrect means to
-	  apply rfbDoCopyRegion to the detected move as well.
-	* debugging switches for X events and X damage: debug_xevents
-	  debug_xdamage.
-	* -rawfb bugfixes. -noviewonly hack to still send UI to X.
-
-2005-04-11  Karl Runge <runge at karlrunge.com>
-	* fix -clip under -rawfb, fix offset bug under file lseeking.
-	* add -rawfb setup:cmd mode to initialize fb. example: misc/ranfb.pl
-
-2005-04-10  Karl Runge <runge at karlrunge.com>
-	* -rawfb non X-polling (i.e. shm, mmap, lseek).
-	* -pipeinput enable external user input processing command.
-	* -xtrap use XESimulateXEventRequest to inject user input.
-	* scaling blend for StaticGray, add :fb scaling option.
-	* default password macros.
-	* improve -norepeat use under -viewonly.
-	* -flag flagfile to aid wrapper scripts.
-	* add utility scripts, etc. dir ./misc
-
-2005-04-03  Karl Runge <runge at karlrunge.com>
-	* try DEC-XTRAP on X11R5 if XTestGrabControl is missing.
-	* -shiftcmap n, for 8bpp displays using < 256 color cells
-	  and with pixel values shifted from zero.
-	* fix DAMAGE event leak after viewers disconnect.
-	* -http option to try to guess where the java viewer is.
-
-2005-03-29  Karl Runge <runge at karlrunge.com>
-	* build-time customizations X11VNC_SHARED, X11VNC_FOREVER,
-	  REMOTE_CONTROL, SMALL_FOOTPRINT for CPPFLAGS
-	* fix event leaks for xkb BellNotify and ClientMessage and others,
-	  esp. under -nofb.  make nofb work with remote control.
-	* -nolookup for bad DNS setups.
-	* more playing with pointer_mode: check_user_input3()
-
-2005-03-19  Karl Runge <runge at karlrunge.com>
-	* scale cursors along with display. Use -scale_cursor to change
-	  or disable cursor scaling.
-	* speed up scaling in some cases, :nb and integer magnification.
-	* provide alternative arrow cursors (1-6) via -arrow n.
-	* reset no autorepeat a couple times if something turns it off,
-	  set with -norepeat N.
-	* do not take a nap if DAMAGE seems to be doing its job.
-
-2005-03-12  Karl Runge <runge at karlrunge.com>
-	* support for the X DAMAGE extension to receive damage
-	  rectangle reports from the X server.  On by default, disable
-	  with -noxdamage.  Currently only trusts small rects
-	  (but see -xd_area n) and uses the rest as "hints" for the
-	  scanline polling.
-	* -clip WxH+X+Y to show a clipped sub-region of the screen.
-	* use RFC 1413 (identd) to attach a name to a client in 
-	  friendly environments.
-	* fix XAUTHORITY wrt '-auth ... -gui other:0'.
-
-2005-03-04  Karl Runge <runge at karlrunge.com>
-	* add changes to couple with -listen option, in particular
-	  the behavior of -localhost and remote control cmds.
-	* workarounds for old trees.
-
-2005-02-23  Karl Runge <runge at karlrunge.com>
-	* final changes for 0.7.1 release.
-
-2005-02-21  Karl Runge <runge at karlrunge.com>
-	* -nap is now the default, disable with -nonap
-	* set version to 0.7.1, word tune -help, etc.
-
-2005-02-14  Karl Runge <runge at karlrunge.com>
-	* cleanup -users stuff, add "lurk=" mode
-	* support cde in -solid
-	* simple gui mode for beginners, -gui ez,...
-
-2005-02-10  Karl Runge <runge at karlrunge.com>
-	* Add -input to fine tune client input (keystroke, mouse motion,
-	  and button presses).  Allow per-client setting via remote cntl.
-	* fix bug in get_remote_port, add ip2host for client info.
-
-2005-02-09  Karl Runge <runge at karlrunge.com>
-	* Add -users switch user mechanism and related utilities.
-	* fix -solid for gnome and kde.
-	* exit earlier on trapped XIO errors.
-
-2005-02-05  Karl Runge <runge at karlrunge.com>
-	* -solid solid color background when clients are connected. 
-	* -opts/-? to show option names only.
-
-2005-01-23  Karl Runge <runge at karlrunge.com>
-	* sync with new draw cursor mechanism, keep old way in OLD_TREE.
-	* add -timeout option, change -alphablend to be default
-	* -R norepeat now forces the issue (Xsession may turn it back on).
-	* try :0 if no other info.
-
-2005-01-15  Karl Runge <runge at karlrunge.com>
-	* adjust alpha blending parameters, -alphablend, handle 24bpp.
-	* add -snapfb snapshot fb, not clear how useful it is..
-	* more functions etc for -pointer_mode 4, still not finished.
-	* scan_for_updates() "count only" mode.
-	* increase max shm size on Linux.
-	* -oa -logappend, -pm, -speeds 
-	* fix bugs in -allow, -R connect, screen == NULL
-
-2004-12-27  Karl Runge <runge at karlrunge.com>
-	* allow -DLIBVNCSERVER_HAVE_FOO=0 override everything
-	* get_xfixes_cursor() try to more carefully convert alpha channel
-	  to opaque pixel.  Options -alphacut, -alphafrac, -alpharemove
-	* more commands under remote control: rfbwait, rfbport, http,
-	  httpport, httpdir, enablehttpproxy, desktop, alwaysshared,
-	  dontdisconnect.  Add to tkx11vnc.
-
-2004-12-22  Karl Runge <runge at karlrunge.com>
-	* final polishing for 0.7 release, tkx11vnc tweaks
-	* more careful rfbPE in pick_window, start check_user_input4()
-
-2004-12-19  Karl Runge <runge at karlrunge.com>
-	* cleanup putenv, snprint, other string manip.
-	* add -sync mode to remote control for better control
-	* allow -remote and -query at same time.
-
-2004-12-16  Karl Runge <runge at karlrunge.com>
-	* support for XFIXES extension to show the exact cursor shape,
-	  working on Linux/Xorg and Solaris 10.  disable with -noxfixes
-	* remote control mania - nearly everything can be changed dynamically!
-	  see the -remote/-query (aka -R/-Q) options. e.g. -R scale:5/6
-	* simple gui tkx11vnc based on the remote control mechanism, see -gui
-	* support for XRANDR extension, if the X screen changes size (see
-	  xrandr(1)), x11vnc will resize the fb. Pays to have NewFBSize viewer 
-	* -overlay support on IRIX with XReadDisplay (not tested).
-	* RFB_MODE is set to "accept" or "gone" in environment
-	* "-id pick" will let you pick the window (calls xwininfo(1)...)
-	* "-pointer_mode n" replaces -old_pointer (n=1) and -old_pointer2 (n=2)
-	  a new mode n=3 is added (similary to nodragging, but dynamic).
-	* "-sb n" screen blank timeout option is now documented.
-	* renamed NON_CVS to OLD_TREE
-
-2004-08-31  Karl Runge <runge at karlrunge.com>
-	* new check_user_input() pointer input algorithm, it tries to avoid
-	  extra-draws. still needs tuning, get previous one with -old_pointer2
-	* add NON_CVS macro for building in older CVS trees.
-
-2004-08-29  Karl Runge <runge at karlrunge.com>
-	* remove old mouse patch code, now use rfbSetCursor (+ workarounds)
-	* changed cursor shape options (no more -mouse, ...) to '-cursor mode'
-	  where 'mode' can be empty "X", "some", or "most".  "some" adds
-	  heuristics for two more cursors.
-	* -nocursorshape added.
-	* ifdef checks for XSHM and XTEST.  Add *_wr wrappers as well.
-	* -vncconnect is now the default.
-
-2004-08-15  Karl Runge <runge at karlrunge.com>
-	* -overlay option to fix color problems on Sun machines with 8+24
-	  and 24+8 overlay visuals, uses Solaris XReadScreen().
-	* expose -sid option (shifted -id windowid) to allow explicit
-	  wrapping of XGetImage, etc for -overlay
-	* fix misc bugs: missing var types, hardwired blackouts sizes,
-	  subwin desktop name crash.
-	  
-2004-08-03  Karl Runge <runge at karlrunge.com>
-	* add man page x11vnc.1 autogenerated from x11vnc -help; tweak
-	  help output a little bit.  Adjust autoconf to pick up manpage.
-	* add README from website docs.
-	* zero watch_bell and use_xkb_modtweak if no XKEYBOARD
-
-2004-07-31  Karl Runge <runge at karlrunge.com>
-	* -cursorpos now the default; make cursorpos work when scaling
-	* fix bug with multiple adds of the same keysym for -add_keysyms
-	* rewhack -help output again
-	* adjust version number and output.
-
-2004-07-28  Karl Runge <runge at karlrunge.com>
-	* -add_keysyms dynamically add missing keysyms to X server
-
-2004-07-26  Karl Runge <runge at karlrunge.com>
-	* first pass at doing modtweak via XKEYBOARD extension (-xkb)
-	* -skip_keycodes option for use with -xkb
-	* reset modtweak and xkb_modtweak on event MappingNotify.
-	* trap Xerror during XSendEvent/XChangeProperty.
-	* fix bug requesting PRIMARY way too often.
-	* more careful to check if XKeysymToString returns NULL.
-	* continuation lines "\" in x11vncrc.
-	* undoc'd expts: -isolevel3, -xkbcompat
-
-2004-07-19  Karl Runge <runge at karlrunge.com>
-	* ignore keysyms 5-8 for keycode keymapping.
-	* help to stdout for easy paging, add lastmod to help and -version.
-
-2004-07-15  Karl Runge <runge at karlrunge.com>
-	* make "modtweak" the default, disable with -nomodtweak.  this
-	  corrects ghost "< >" key on pc104 us in XFree86.
-	* fix bug wrt no got_keyboard_input under modtweak
-
-2004-07-10  Karl Runge <runge at karlrunge.com>
-	* -norepeat to turn off X server autorepeat when clients exist,
-	  (this is workaround for the repeating keystroke bug.  Note that
-	  client side does autorepeating so not a big loss).
-
-2004-07-04  Karl Runge <runge at karlrunge.com>
-	* extend -allow to re-read a file with allowed IP addresses. 
-	* improvements to -help text.
-
-2004-07-01  Karl Runge <runge at karlrunge.com>
-	* improve scaled grid calculation to prevent drift (which causes
-	  drift in pixel weights and poorer tightvnc compression)
-	* add ":pad" scale option, detect small fraction scale = m/n.
-
-2004-06-28  Karl Runge <runge at karlrunge.com>
-	* round scaled width to multiple of 4 to make vncviewer happy.
-	* allow override of above ":n4" and allow 4 point interpolation
-	  to be used even with shrinking ":in". 
-
-2004-06-27  Karl Runge <runge at karlrunge.com>
-	* speed up scaling a bit for slow machines (still all floating point)
-	* add no blending option (-scale fraction:nb)
-
-2004-06-26  Karl Runge <runge at karlrunge.com>
-	* add -scale fract for global (not per-client) server-side scaling
-	  working more or less OK, needs to be optimized at some point.
-	* remove -hints/-nohints options.
-
-2004-06-17  Karl Runge <runge at karlrunge.com>
-	* simple ~/.x11vncrc config file support, -rc, -norc
-
-2004-06-12  Karl Runge <runge at karlrunge.com>
-	* add -clear_mods -clear_keys for (rare) case where keys are
-	  not being released (e.g. Ctrl-C x11vnc thru x11vnc).
-	* export RFB_SERVER_IP and RFB_SERVER_PORT to -accept program
-	  so that the tcp 4-tuple is completely specified.  
-	* add -storepasswd <pass> <file> so storepasswd program not needed
-
-2004-06-05  Karl Runge <runge at karlrunge.com>
-	* rearrange file for easier maintenance, indicating file breakup.
-	* add RFB_CLIENT_COUNT, number of other connected clients to
-	  -accept and -gone commands.
-
-2004-05-27  Karl Runge <runge at karlrunge.com>
-	* add view-only passwd via -viewpasswd and 2nd line of -passwdfile
-
-2004-05-21  Karl Runge <runge at karlrunge.com>
-	* -accept: add view-only decision and other improvements.
-	* add -gone command option for when a client leaves.
-	  Thanks to Jesus Alvarez for these ideas.
-	* -passwdfile to keep passwd off of cmd line.
-	* -o logfile send stderr to a logfile.
-
-2004-05-14  Karl Runge <runge at karlrunge.com>
-	* improvements to -accept popup: yes/no buttons and timeout. 
-	* less fprintf under -q so '-q -inetd' has no stderr output. 
-
-2004-05-08  Karl Runge <runge at karlrunge.com>
-	* add -accept some-command/xmessage/popup to prompt local X11 user
-	  or otherwise decide to accept an incoming client. 
-	* clean up -Wall warnings.
-
-2004-05-05  Karl Runge <runge at karlrunge.com>
-	* enable mouse button -> keystrokes mapping in -buttonmap (mousewheel)
-	* enable keystroke -> mouse button mapping in -remap (touchpad paste)
-	  (-remap incompat ':' -> '-', sorry...)
-	* shm OS blacklist (i.e. <= SunOS 5.8) -> -onetile
-	* revert to check_user_input() under -nofb
-	* cleanup: lastmod, remove tile_shm and update_client_pointer,
-	  debug output, rfbPort failure. 
-	* user friendly last line: 'The VNC desktop is hostname:0'
-
-2004-04-28  Karl Runge <runge at karlrunge.com>
-	* -auth cmdline option for xauthority.
-	* decrease default deferupdate under -nofb.
-	* update_client_pointer() from Edoardo Tirtarahardja.
-	* remove some assumptions about libvncserver defaults.
-
-2004-04-19  Karl Runge <runge at karlrunge.com>
-	* support for cursor positions updates -cursorpos
-	* option for SIGPIPE handling -sigpipe
-
-2004-04-13  Karl Runge <runge at karlrunge.com>
-	* solve problem with sending selection when client initializing
-	  (not yet in RFB_NORMAL state).  Increase delay to 15s as well. 
-	* when threaded: limit rfbMaxClientWait to >= 20 secs and
-	  increase it to a huge value unless -rfbwait is supplied.
-
-2004-04-08  Karl Runge <runge at karlrunge.com>
-	* added support for blacking out regions of the screen, primarily
-	  for Xinerama usage, options: -blackout -xinerama
-	* Xinerama workaround mouse problem on 'embedded' system, 
-	  option -xwarppointer (XWarpPointer instead of XTEST)
-	* let -remap option take key remappings on cmdline as well as file.
-	* use cargs fix to test for invalid cmdline options. Add --option.
-	* remove copy_tile, use copy_tiles(..., 1) instead.
-
-2004-03-10  Karl Runge <runge at karlrunge.com>
-	* added reverse connection for vncconnect(1) and other means
-	  -vncconnect, -connect host:port, and -connect watchfile 
-	* added first pass at user keysym remapping feature via
-	  -remap file.  Ignores modifier state, need to generalize.
-	* debugging options for users -debug_pointer and -debug_keyboard
-	* clear -passwd from argv for privacy (if OS allows).
-
-2004-02-19  Karl Runge <runge at karlrunge.com>
-	* added handling of clipboard/selection exchange to/from clients,
-	  even holds PRIMARY which Xvnc does not do.  disable with -nosel.
-	  use -noprimary to disable polling of PRIMARY selection.
-	* added -visual option to force framebuffer visual.  not really
-	  of general use, more for testing and workarounds (e.g. win2vnc
-	  fails under 8bpp index color)
-	* improve cleanup and error handling WRT shm and other failures.
-
-2004-01-19  Karl Runge <runge at karlrunge.com>
-	* improvements to pointer event handling primarily during window
-	  dragging.  check_user_input() for non-threaded and pointer()
-	  for threaded.  Revert to old way via -old_pointer option.
-	* some memory I/O improvement by using copy_tiles() instead
-	  of copy_tile().  New one does rows of tiles at same time.
-	  Revert to old way via -old_copytile.
-	* handle case of more mouse buttons on client than on X server.
-	* added -buttonmap option for finer control over button differences.
-
-2004-01-09  Karl Runge <runge at karlrunge.com>
-	* options -allow / -localhost for simple IP based access screening
-	* option -nodragging to skip all screen updates during mouse drags
-	  (thanks to Michal Sabala)
-	* option -input_skip to allow users to tune watch_loop dropthru rate
-	* try to avoid wasting RAM for framebuffer under -nofb
-	* cleanup wrt bpp vs. depth
-
-2003-12-08  Karl Runge <runge at karlrunge.com>
-	* add Xbell support using XKEYBOARD extension (disable: -nobell)
-	* add "-nofb" to disable framebuffer, i.e. mouse + keyboard only (!)
-	* add "-notruecolor" to force indexed 8bpp color (when 8bpp) 
-	* make alias "-forever" for "-many"
-
-From Karl (x11vnc's father) on Apr 2, 2003:
-	
-New option -nocursor to not display the vncviewer local cursor if user
-does not want it (also caused some problems with older vncviewers)
-
-New option -mouse to show the position of the X server mouse (i.e. lagged
-from the user's vnc cursor position).  Also: -mouseX will try to show
-the a different cursor (X) when on the root background.
-
-New option -many to wait for more connections rather than exiting when
-the first client(s) disconnect.
-
-New option -flashcmap to try to follow installed colormaps under 8bpp
-indexed color as pointer is moved.
-
-New option -nap to watch for low activity and throttle down the polling
-rate.  Useful on shared machines to keep the load down.
-
-Experimental option -id <windowid> to show just that window and not
-the whole display.  Some remaining bugs and inconvenient behavior...
-(e.g. new toplevels can be unseen)
-
-Fixed bug on multi-headed machines where the screen number was being
-ignored in a number of places.
-
-Fixed bug wrt connect_once mode.  Now just refuses new clients unless
-shared rather than terminating all clients.
-
-Try to follow changing default colormap under 8bpp indexed color
-as color cells are added.
-
-Needed to pick up HAVE_LIBPTHREAD from autoconf.
-
-defined a select() macro for usleep() since usleep is not always thread
-safe.
-
-Catch and exit on errors in the shm setup work (XShmCreateImage, shmget,...)
-and moved the creation and removal work to separate utility functions.
-
-Added signal and X error handlers to try to clean out the shm objects
-before exiting on interrupt, etc.
-
-Improved performance a bit on the memcmp() in scan_display() by checking
-the whole line first.
-
-Added a workaround when threaded where libvncserver may disconnect too
-early if it does not hear from a client (a small heartbeat is sent).
-This may not be needed any longer.
-
-If -desktop has not been prescribed, try to choose a title based on DISPLAY
-and the hostname (and window name under -id).
diff --git a/ica/x11/x11vnc/README b/ica/x11/x11vnc/README
deleted file mode 100644
index e8457e6..0000000
--- a/ica/x11/x11vnc/README
+++ /dev/null
@@ -1,18246 +0,0 @@
-
-Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com>
-All rights reserved.
-
-x11vnc README file                         Date: Mon Dec 27 20:58:57 EST 2010
-
-The following information is taken from these URLs:
-
-	http://www.karlrunge.com/x11vnc/index.html
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-	...
-
-they contain the most up to date info.
-
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/index.html:
-
-
-     _________________________________________________________________
-
-x11vnc: a VNC server for real X displays
-                (to FAQ)    (to Downloads)    (to Building)    (to Beta Test)
-  (to Donations) [PayPal] 
-
-   x11vnc allows one to view remotely and interact with real X displays
-   (i.e. a display corresponding to a physical monitor, keyboard, and
-   mouse) with any VNC viewer. In this way it plays the role for Unix/X11
-   that WinVNC plays for Windows.
-
-   It has built-in SSL/TLS encryption and 2048 bit RSA authentication,
-   including VeNCrypt support; UNIX account and password login support;
-   server-side scaling; single port HTTPS/HTTP+VNC; Zeroconf service
-   advertising; and TightVNC and UltraVNC file-transfer. It has also been
-   extended to work with non-X devices: natively on Mac OS X Aqua/Quartz,
-   webcams and TV tuner capture devices, and embedded Linux systems such
-   as Qtopia Core. Full IPv6 support is provided. More features are
-   described here.
-
-   It also provides an encrypted Terminal Services mode (-create, -svc,
-   or -xdmsvc options) based on Unix usernames and Unix passwords where
-   the user does not need to memorize his VNC display/port number.
-   Normally a virtual X session (Xvfb) is created for each user, but it
-   also works with X sessions on physical hardware. See the tsvnc
-   terminal services mode of the SSVNC viewer for one way to take
-   advantage of this mode.
-
-   I wrote x11vnc back in 2002 because x0rfbserver was basically
-   impossible to build on Solaris and had poor performance. The primary
-   x0rfbserver build problems centered around esoteric C++ toolkits.
-   x11vnc is written in plain C and needs only standard libraries and so
-   should work on nearly all Unixes, even very old ones. I also created
-   enhancements to improve the interactive response, added many features,
-   and etc.
-
-   This page including the FAQ contains much information [*]; solutions
-   to many problems; and interesting applications, but nevertheless
-   please feel free to contact me if you have problems or questions (and
-   if I save you time or expense by giving you some of my time, please
-   consider a PayPal Donation.) Do check the FAQ and this page first; I
-   realize the pages are massive, but you can often use your browser's
-   find-in-page search action using a keyword to find the answer to your
-   problem or question.
-
-   SSVNC:  An x11vnc side-project provides an Enhanced TightVNC Viewer
-   package (SSVNC) for Unix, Windows, and Mac OS X with automatic SSL
-   and/or SSH tunnelling support, SSL Certificate creation, Saved
-   connection profiles, Zeroconf, VeNCrypt, and built-in Proxy support.
-   Added features for the TightVNC Unix viewer: NewFBSize, ZRLE encoding,
-   Viewer-side Scaling, cursor alphablending, low color modes, and
-   enhanced popup menu; UltraVNC extensions support for: File Transfer,
-   Text Chat, Single Window, Server Input, and 1/n Scaling extensions,
-   and UltraVNC DSM encryption. The SSVNC bundle could be placed on, say,
-   a USB memory stick for SSL/SSH VNC viewing from nearly any networked
-   computer.
-
-     _________________________________________________________________
-
-    Announcements:
-
-   Important: If you created any permanent SSL certificates (e.g. via
-   "x11vnc -ssl SAVE ...") on a Debian or Ubuntu system from Sept. 2006
-   through May 2008, then those keys are likely extremely weak and can be
-   easily cracked. The certificate files should be deleted and recreated
-   on a non-Debian system or an updated one. See
-   http://www.debian.org/security/2008/dsa-1571 for details. The same
-   applies to SSH keys (not used by x11vnc directly, but many people use
-   SSH tunnels for VNC access.)
-
-   FAQ moved: The huge FAQ has finally been moved to its own page. If you
-   are trying to follow someone's link to an FAQ once on this page it is
-   now a broken link. Try inserting the string "faq.html", e.g.:
-from:   http://www.karlrunge.com/x11vnc/#faq-singleclick
-to:     http://www.karlrunge.com/x11vnc/faq.html#faq-singleclick
-
-   Apologies for the inconvenience, unfortunately it is not possible to
-   automatically redirect to the new page since the '#' anchor is not
-   sent to the webserver.
-
-     _________________________________________________________________
-
-    Background:
-
-   VNC (Virtual Network Computing) is a very useful network graphics
-   protocol (applications running on one computer but displaying their
-   windows on another) in the spirit of X, however, unlike X, the
-   viewing-end is very simple and maintains no state. It is a remote
-   framebuffer (RFB) protocol.
-
-   Some VNC links:
-     * http://www.realvnc.com
-     * http://www.tightvnc.com
-     * http://www.ultravnc.com/
-     * http://www.testplant.com/products/vine_server/OS_X
-
-   For Unix, the traditional VNC implementation includes a "virtual" X11
-   server Xvnc (usually launched via the vncserver command) that is not
-   associated with a physical display, but provides a "fake" one X11
-   clients (xterm, firefox, etc.) can attach to. A remote user then
-   connects to Xvnc via the VNC client vncviewer from anywhere on the
-   network to view and interact with the whole virtual X11 desktop.
-
-   The VNC protocol is in most cases better suited for remote connections
-   with low bandwidth and high latency than is the X11 protocol because
-   it involves far fewer "roundtrips" (an exception is the cached pixmap
-   data on the viewing-end provided by X.) Also, with no state maintained
-   the viewing-end can crash, be rebooted, or relocated and the
-   applications and desktop continue running. Not so with X11.
-
-   So the standard Xvnc/vncserver program is very useful, I use it for
-   things like:
-     * Desktop conferencing with other users (e.g. code reviews.)
-     * Long running apps/tasks I want to be able to view from many places
-       (e.g. from home and work.)
-     * Motif, GNOME, and similar applications that would yield very poor
-       performance over a high latency link.
-
-   However, sometimes one wants to connect to a real X11 display (i.e.
-   one attached to a physical monitor, keyboard, and mouse: a Workstation
-   or a SunRay session) from far away. Maybe you want to close down an
-   application cleanly rather than using kill, or want to work a bit in
-   an already running application, or would like to help a distant
-   colleague solve a problem with their desktop, or would just like to
-   work out on the deck for a while. This is where x11vnc is useful.
-     _________________________________________________________________
-
-    How to use x11vnc:
-
-   In this basic example let's assume the remote machine with the X
-   display you wish to view is "far-away.east:0" and the workstation you
-   are presently working at is "sitting-here.west".
-
-   Step 0. Download x11vnc (see below) and have it available to run on
-   far-away.east (on some linux distros it is as easy as "apt-get install
-   x11vnc", "emerge x11vnc", etc.) Similarly, have a VNC viewer (e.g.
-   vncviewer) ready to run on sitting-here.west. We recommend TightVNC
-   Viewers (see also our SSVNC viewer.)
-
-   Step 1. By some means log in to far-away.east and get a command shell
-   running there. You can use ssh, or even rlogin, telnet, or any other
-   method to do this. We do this because the x11vnc process needs to be
-   run on the same machine the X server process is running on (otherwise
-   things would be extremely slow.)
-
-   Step 2. In that far-away.east shell (with command prompt "far-away>"
-   in this example) run x11vnc directed at the far-away.east X session
-   display:
-
-  far-away> x11vnc -display :0
-
-   You could have also set the environment variable DISPLAY=:0 instead of
-   using "-display :0". This step attaches x11vnc to the far-away.east:0
-   X display (i.e. no viewer clients yet.)
-
-   Common Gotcha: To get X11 permissions right, you may also need to set
-   the XAUTHORITY environment variable (or use the -auth option) to point
-   to the correct MIT-MAGIC-COOKIE file (e.g. /home/joe/.Xauthority.) If
-   x11vnc does not have the authority to connect to the display it exits
-   immediately. More on how to fix this below.
-
-   If you suspect an X11 permissions problem do this simple test: while
-   sitting at the physical X display open a terminal window
-   (gnome-terminal, xterm, etc.) You should be able to run x11vnc
-   successfully in that terminal without any need for command line
-   options. If that works OK then you know X11 permissions are the only
-   thing preventing it from working when you try to start x11vnc via a
-   remote shell. Then fix this with the tips below.
-
-   Note as of Feb/2007 you can also try the -find option instead of
-   "-display ..." and see if that finds your display and Xauthority. Note
-   as of Dec/2009 the -findauth and "-auth guess" options may be helpful
-   as well.
-   (End of Common Gotcha)
-
-   When x11vnc starts up there will then be much chatter printed out (use
-   "-q" to quiet it), until it finally says something like:
-  .
-  .
-  13/05/2004 14:59:54 Autoprobing selected port 5900
-  13/05/2004 14:59:54 screen setup finished.
-  13/05/2004 14:59:54
-  13/05/2004 14:59:54 The VNC desktop is far-away:0
-  PORT=5900
-
-   which means all is OK, and we are ready for the final step.
-
-   Step 3. At the place where you are sitting (sitting-here.west in this
-   example) you now want to run a VNC viewer program. There are VNC
-   viewers for Unix, Windows, MacOS, Java-enabled web browsers, and even
-   for PDA's like the Palm Pilot and Cell Phones! You can use any of them
-   to connect to x11vnc (see the above VNC links under "Background:" on
-   how to obtain a viewer for your platform or see this FAQ. For Solaris,
-   vncviewer is available in the Companion CD package SFWvnc.)
-
-   In this example we'll use the Unix vncviewer program on sitting-here
-   by typing the following command in a second terminal window:
-
-  sitting-here> vncviewer far-away.east:0
-
-   That should pop up a viewer window on sitting-here.west showing and
-   allowing interaction with the far-away.east:0  X11 desktop. Pretty
-   nifty! When finished, exit the viewer: the remote x11vnc process will
-   shutdown automatically (or you can use the -forever option to have it
-   wait for additional viewer connections.)
-
-   Common Gotcha: Nowadays there will likely be a host-level firewall on
-   the x11vnc side that is blocking remote access to the VNC port (e.g.
-   5900.) You will either have to open up that port (or a range of ports)
-   in your firewall administration tool, or try the SSH tunnelling method
-   below (even still the firewall must allow in the SSH port, 22.)
-
-
-   Shortcut: Of course if you left x11vnc running on far-away.east:0 in a
-   terminal window with the -forever option or as a service, you'd only
-   have to do Step 3 as you moved around. Be sure to use a VNC Password
-   or other measures if you do that.
-
-
-   Super Shortcut: Here is a potentially very easy way to get all of it
-   working.
-     * Have x11vnc (0.9.3 or later) available to run on the remote host
-       (i.e. in $PATH.)
-     * Download and unpack a SSVNC bundle (1.0.19 or later, e.g.
-       ssvnc_no_windows-1.0.28.tar.gz) on the Viewer-side machine.
-     * Start the SSVNC Terminal Services mode GUI: ./ssvnc/bin/tsvnc
-     * Enter your remote username at hostname (e.g. fred at far-away.east) in
-       the "VNC Terminal Server" entry.
-     * Click "Connect".
-
-   That will do an SSH to username at hostname and start up x11vnc and then
-   connect a VNC Viewer through the SSH encrypted tunnel.
-
-   There are a number of things assumed here, first that you are able to
-   SSH into the remote host; i.e. that you have a Unix account there and
-   the SSH server is running. On Unix and MacOS X it is assumed that the
-   ssh client command is available on the local machine (on Windows a
-   plink binary is included in the SSVNC bundle.) Finally, it is assumed
-   that you are already logged into an X session on the remote machine,
-   e.g. your workstation (otherwise, a virtual X server, e.g. Xvfb, will
-   be started for you.)
-
-   In some cases the remote SSH server will not run commands with the
-   same $PATH that you normally have in your shell there. In this case
-   click on Options -> Advanced -> X11VNC Options, and type in the
-   location of the x11vnc binary under "Full Path". (End of Super
-   Shortcut)
-
-
-   Desktop Sharing: The above more or less assumed nobody was sitting at
-   the workstation display "far-away.east:0". This is often the case: a
-   user wants to access her workstation remotely. Another usage pattern
-   has the user sitting at "far-away.east:0" and invites one or more
-   other people to view and interact with his desktop. Perhaps the user
-   gives a demo or presentation this way (using the telephone for vocal
-   communication.) A "Remote Help Desk" mode would be similar: a
-   technician connects remotely to the user's desktop to interactively
-   solve a problem the user is having.
-
-   For these cases it should be obvious how it is done. The above steps
-   will work, but more easily the user sitting at far-away.east:0 simply
-   starts up x11vnc from a terminal window, after which the guests would
-   start their VNC viewers. For this usage mode the "-connect
-   host1,host2" option may be of use to automatically connect to the
-   vncviewers in "-listen" mode on the list of hosts.
-     _________________________________________________________________
-
-    Tunnelling x11vnc via SSH:
-
-   The above example had no security or privacy at all. When logging into
-   remote machines (certainly when going over the internet) it is best to
-   use ssh, or use a VPN (for a VPN, Virtual Private Network, the above
-   example should be pretty safe.)
-
-   For x11vnc one can tunnel the VNC protocol through an encrypted ssh
-   channel. It would look something like running the following commands:
-  sitting-here> ssh -t -L 5900:localhost:5900 far-away.east 'x11vnc -localhost
--display :0'
-
-   (you will likely have to provide passwords/passphrases to login from
-   sitting-here into your far-away.east Unix account; we assume you have
-   a login account on far-away.east and it is running the SSH server)
-
-   And then in another terminal window on sitting-here run the command:
-  sitting-here> vncviewer -encodings "copyrect tight zrle hextile" localhost:0
-
-   Note: The -encodings option is very important: vncviewer will often
-   default to "raw" encoding if it thinks the connection is to the local
-   machine, and so vncviewer gets tricked this way by the ssh
-   redirection. "raw" encoding will be extremely slow over a networked
-   link, so you need to force the issue with -encodings "copyrect tight
-   ...". Nowadays, not all viewers use the -encodings option, try
-   "-PreferredEncoding=ZRLE" (although the newer viewers seem to
-   autodetect well when to use raw or not.)
-
-   Note that "x11vnc -localhost ..." limits incoming vncviewer
-   connections to only those from the same machine. This is very natural
-   for ssh tunnelling (the redirection appears to come from the same
-   machine.) Use of a VNC password is also strongly recommended.
-
-   Note also the -t we used above (force allocate pseudoterminal), it
-   actually seems to improve interactive typing response via VNC!
-
-   You may want to add the -C option to ssh to enable compression. The
-   VNC compression is not perfect, and so this may help a bit. However,
-   over a fast LAN you probably don't want to enable SSH compression
-   because it can slow things down. Try both and see which is faster.
-
-   If your username is different on the remote machine use something
-   like: "fred at far-away.east" in the above ssh command line.
-
-   Some VNC viewers will do the ssh tunnelling for you automatically, the
-   TightVNC Unix vncviewer does this when the "-via far-away.east" option
-   is supplied to it (this requires x11vnc to be already running on
-   far-away.east or having it started by inetd(8).) See the 3rd script
-   example below for more info.
-
-   SSVNC:  You may also want to look at the Enhanced TightVNC Viewer
-   (ssvnc) bundles because they contain scripts and GUIs to automatically
-   set up SSH tunnels (e.g. the GUI, "ssvnc", does it automatically and
-   so does this command: "ssvnc_cmd -ssh user at far-away.east:0") and can
-   even start up x11vnc as well.
-
-   The Terminal Services mode of SSVNC is perhaps the easiest way to use
-   x11vnc. You just need to have x11vnc available in $PATH on the remote
-   side (and can SSH to the host), and then on the viewer-side you type
-   something like:
-  tsvnc fred at far-away.east
-
-   everything else is done automatically for you. Normally this will
-   start a virtual Terminal Services X session (RAM-only), but if you
-   already have a real X session up on the physical hardware it will find
-   that one for you.
-
-   Gateways:  If the machine you SSH into is not the same machine with
-   the X display you wish to view (e.g. your company provides incoming
-   SSH access to a gateway machine), then you need to change the above
-   to, e.g.: "-L 5900:OtherHost:5900":
-  sitting-here> ssh -t -L 5900:OtherHost:5900 gateway.east
-
-   Where gateway.east is the internet hostname (or IP) of the gateway
-   machine (SSH server.) 'OtherHost' might be, e.g., freds-pc or
-   192.168.2.33 (it is OK for these to be private hostnames or private IP
-   addresses, the host in -L is relative to the remote server side.)
-
-   Once logged in, you'll need to do a second login (ssh, rsh, etc.) to
-   the workstation machine 'OtherHost' and then start up x11vnc on it (if
-   it isn't already running.) (The "-connect gateway:59xx" option may be
-   another alternative here with the viewer already in -listen mode.) For
-   an automatic way to use a gateway and have all the network traffic
-   encrypted (including inside the firewall) see Chaining SSH's.
-
-   These gateway access modes also can be done automatically for you via
-   the "Proxy/Gateway" setting in SSVNC (including the Chaining SSH's
-   case, "Double Proxy".)
-
-   Firewalls/Routers:
-
-   A lot of people have inexpensive devices for home or office that act
-   as a Firewall and Router to the machines inside on a private LAN. One
-   can usually configure the Firewall/Router from inside the LAN via a
-   web browser.
-
-   Often having a Firewall/Router sitting between the vncviewer and
-   x11vnc will make it impossible for the viewer to connect to x11vnc.
-
-   One thing that can be done is to redirect a port on the
-   Firewall/Router to, say, the SSH port (22) on an inside machine (how
-   to do this depends on your particular Firewall/Router, often the
-   router config URL is http://192.168.100.1 See www.portforward.com for
-   more info.) This way you reach these computers from anywhere on the
-   Internet and use x11vnc to view X sessions running on them.
-
-   Suppose you configured the Firewall/Router to redirect these ports to
-   two internal machines:
-  Port 12300 -> 192.168.1.3, Port 22 (SSH)
-  Port 12301 -> 192.168.1.4, Port 22 (SSH)
-
-   (where 192.168.1.3 is "jills-pc" and 192.168.1.4 is "freds-pc".) Then
-   the ssh's would look something like:
-  sitting-here> ssh -t -p 12300 -L 5900:localhost:5900 jill at far-away.east 'x11v
-nc -localhost -display :0'
-  sitting-here> ssh -t -p 12301 -L 5900:localhost:5900 fred at far-away.east 'x11v
-nc -localhost -display :0'
-
-   Where far-away.east means the hostname (or IP) that the
-   Router/Firewall is using (for home setups this is usually the IP
-   gotten from your ISP via DHCP, the site http://www.whatismyip.com/ is
-   a convenient way to determine what it is.)
-
-   It is a good idea to add some obscurity to accessing your system via
-   SSH by using some high random port (e.g. 12300 in the above example.)
-   If you can't remember it, or are otherwise not worried about port
-   scanners detecting the presence of your SSH server and there is just
-   one internal PC involved you could map 22:
-  Port 22 -> 192.168.1.3, Port 22 (SSH)
-
-   Again, this SSH gateway access can be done automatically for you via
-   the "Proxy/Gateway" setting in SSVNC. And under the "Remote SSH
-   Command" setting you can enter the x11vnc -localhost -display :0.
-
-   Host-Level-Firewalls: even with the hardware Firewall/Router problem
-   solved via a port redirection, most PC systems have their own Host
-   level "firewalls" enabled to protect users from themselves. I.e. the
-   system itself blocks all incoming connections. So you will need to see
-   what is needed to configure it to allow in the port (e.g. 22) that you
-   desire. E.g. Yast, Firestarter, iptables(1), etc..
-
-   VNC Ports and Firewalls: The above discussion was for configuring the
-   Firewall/Router to let in port 22 (SSH), but the same thing can be
-   done for the default VNC port 5900:
-  Port 5900 -> 192.168.1.3, Port 5900 (VNC)
-  Port 5901 -> 192.168.1.4, Port 5900 (VNC)
-
-   (where 192.168.1.3 is "jills-pc" and 192.168.1.4 is "freds-pc".) This
-   could be used for normal, unencrypted connections and also for SSL
-   encrypted ones.
-
-   The VNC displays to enter in the VNC viewer would be, say,
-   "far-away.east:0" to reach jills-pc and "far-away.east:1" to reach
-   freds-pc. We assume above that x11vnc is using port 5900 (and any
-   Host-Level-firewalls on jills-pc has been configured to let that port
-   in.) Use the "-rfbport" option to tell which port x11vnc should listen
-   on.
-
-   For a home system one likely does not have a hostname and would have
-   to use the IP address, say, "24.56.78.93:0". E.g.:
-  vncviewer 24.56.78.93:0
-
-   You may want to choose a more obscure port on the router side, e.g.
-   5944, to avoid a lot of port scans finding your VNC server. For 5944
-   you would tell the viewer to use:
-  vncviewer 24.56.78.93:44
-
-   The IP address would need to be communicated to the person running the
-   VNC Viewer. The site http://www.whatismyip.com/ can help here.
-
-     _________________________________________________________________
-
-   Scripts to automate ssh tunneling: As discussed below, there may be
-   some problems with port 5900 being available. If that happens, the
-   above port and display numbers may change a bit (e.g. -> 5901 and :1).
-   However, if you "know" port 5900 will be free on the local and remote
-   machines, you can easily automate the above two steps by using the
-   x11vnc option -bg (forks into background after connection to the
-   display is set up) or using the -f option of ssh. Some example scripts
-   are shown below. Feel free to try the ssh -C to enable its compression
-   and see if that speeds things up noticeably.
-     _________________________________________________________________
-
-   #1. A simple example script, assuming no problems with port 5900 being
-   taken on the local or remote sides, looks like:
-#!/bin/sh
-# usage: x11vnc_ssh <host>:<xdisplay>
-#  e.g.: x11vnc_ssh snoopy.peanuts.com:0
-#  (user at host:N also works)
-
-host=`echo $1 | awk -F: '{print $1}'`
-disp=`echo $1 | awk -F: '{print $2}'`
-if [ "x$disp" = "x" ]; then disp=0; fi
-
-cmd="x11vnc -display :$disp -localhost -rfbauth .vnc/passwd"
-enc="copyrect tight zrle hextile zlib corre rre raw"
-
-ssh -f -t -L 5900:localhost:5900 $host "$cmd"
-
-for i in 1 2 3
-do
-        sleep 2
-        if vncviewer -encodings "$enc" :0; then break; fi
-done
-
-   See also rx11vnc.pl below.
-     _________________________________________________________________
-
-   #2. Another method is to start the VNC viewer in listen mode
-   "vncviewer -listen" and have x11vnc initiate a reverse connection
-   using the -connect option:
-#!/bin/sh
-# usage: x11vnc_ssh <host>:<xdisplay>
-#  e.g.: x11vnc_ssh snoopy.peanuts.com:0
-#  (user at host:N also works)
-
-host=`echo $1 | awk -F: '{print $1}'`
-disp=`echo $1 | awk -F: '{print $2}'`
-if [ "x$disp" = "x" ]; then disp=0; fi
-
-cmd="x11vnc -display :$disp -localhost -connect localhost"   # <== note new opt
-ion
-enc="copyrect tight zrle hextile zlib corre rre raw"
-
-vncviewer -encodings "$enc" -listen &
-pid=$!
-ssh -t -R 5500:localhost:5500 $host "$cmd"
-kill $pid
-
-   Note the use of the ssh option "-R" instead of "-L" to set up a remote
-   port redirection.
-     _________________________________________________________________
-
-   #3. A third way is specific to the TightVNC vncviewer special option
-   -via for gateways. The only tricky part is we need to start up x11vnc
-   and give it some time (5 seconds in this example) to start listening
-   for connections (so we cannot use the TightVNC default setting for
-   VNC_VIA_CMD):
-#!/bin/sh
-# usage: x11vnc_ssh <host>:<xdisplay>
-#  e.g.: x11vnc_ssh snoopy.peanuts.com:0
-
-host=`echo $1 | awk -F: '{print $1}'`
-disp=`echo $1 | awk -F: '{print $2}'`
-if [ "x$disp" = "x" ]; then disp=0; fi
-
-VNC_VIA_CMD="ssh -f -t -L %L:%H:%R %G x11vnc -localhost -rfbport 5900 -display
-:$disp; sleep 5"
-export VNC_VIA_CMD
-
-vncviewer -via $host localhost:0      # must be TightVNC vncviewer.
-
-   Of course if you already have the x11vnc running waiting for
-   connections (or have it started out of inetd(8)), you can simply use
-   the TightVNC "vncviewer -via gateway host:port" in its default mode to
-   provide secure ssh tunnelling.
-     _________________________________________________________________
-
-
-
-   VNC password file: Also note in the #1. example script that the option
-   "-rfbauth .vnc/passwd" provides additional protection by requiring a
-   VNC password for every VNC viewer that connects. The vncpasswd or
-   storepasswd programs, or the x11vnc -storepasswd option can be used to
-   create the password file. x11vnc also has the slightly less secure
-   -passwdfile and "-passwd XXXXX" options to specify passwords.
-
-   Very Important: It is up to YOU to tell x11vnc to use password
-   protection (-rfbauth or -passwdfile), it will NOT do it for you
-   automatically or force you to (use -usepw if you want to be forced
-   to.) The same goes for encrypting the channel between the viewer and
-   x11vnc: it is up to you to use ssh, stunnel, -ssl mode, a VPN, etc.
-   (use the Enhanced TightVNC Viewer (SSVNC) GUI if you want to be forced
-   to use SSL or SSH.) For additional safety, also look into the -allow
-   and -localhost options and building x11vnc with tcp_wrappers support
-   to limit host access.
-
-     _________________________________________________________________
-
-    Tunnelling x11vnc via SSL/TLS:
-
-   One can also encrypt the VNC traffic using an SSL/TLS tunnel such as
-   stunnel.mirt.net (also stunnel.org) or using the built-in (Mar/2006)
-   -ssl openssl mode. A SSL-enabled Java applet VNC Viewer is also
-   provided in the x11vnc package (and https can be used to download it.)
-
-   Although not as ubiquitous as ssh, SSL tunnelling still provides a
-   useful alternative. See this FAQ on -ssl and -stunnel modes for
-   details and examples.
-
-   The Enhanced TightVNC Viewer (SSVNC) bundles contain some convenient
-   utilities to automatically set up an SSL tunnel from the viewer-side
-   (i.e. to connect to "x11vnc -ssl ...".) And many other enhancements
-   too.
-     _________________________________________________________________
-
-    Downloading x11vnc:
-
-   x11vnc is a contributed program to the LibVNCServer project at
-   SourceForge.net. I use libvncserver for all of the VNC aspects; I
-   couldn't have done without it. The full source code may be found and
-   downloaded (either file-release tarball or GIT tree) from the above
-   link. As of Sep 2010, the x11vnc-0.9.12.tar.gz source package is
-   released (recommended download). The x11vnc 0.9.12 release notes.
-
-   The x11vnc package is the subset of the libvncserver package needed to
-   build the x11vnc program. Also, you can get a copy of my latest,
-   bleeding edge x11vnc-0.9.13-dev.tar.gz tarball to build the most up to
-   date one.
-
-   Precompiled Binaries/Packages:  See the FAQ below for information
-   about where you might obtain a precompiled x11vnc binary from 3rd
-   parties and some ones I create.
-
-   VNC Viewers:  To obtain VNC viewers for the viewing side (Windows, Mac
-   OS, or Unix) try these links:
-     * http://www.tightvnc.com/download.html
-     * http://www.realvnc.com/download-free.html
-     * http://sourceforge.net/projects/cotvnc/
-     * http://www.ultravnc.com/
-     * Our Enhanced TightVNC Viewer (SSVNC)
-
-       [ssvnc.gif]
-
-
-   More tools: Here is a ssh/rsh wrapper script rx11vnc that attempts to
-   automatically do the above Steps 1-3 for you (provided you have
-   ssh/rsh login permission on the machine x11vnc is to be run on.) The
-   above example would be: "rx11vnc far-away.east:0" typed into a shell
-   on sitting-here.west. Also included is an experimental script
-   rx11vnc.pl that attempts to tunnel the vnc traffic through an ssh port
-   redirection (and does not assume port 5900 is free.) Have a look at
-   them to see what they do and customize as needed:
-     * rx11vnc wrapper script
-     * rx11vnc.pl wrapper script to tunnel traffic thru ssh
-
-     _________________________________________________________________
-
-    Building x11vnc:
-
-   Make sure you have all the needed build/compile/development packages
-   installed (e.g. Linux distributions foolishly don't install them by
-   default.) See this build FAQ for more details.
-
-   If your OS has libjpeg.so and libz.so in standard locations you can
-   build as follows (example given for the 0.9.12 release of x11vnc:
-   replace with the version you downloaded):
-(un-tar the x11vnc+libvncserver tarball)
-# gzip -dc x11vnc-0.9.12.tar.gz | tar -xvf -
-
-(cd to the source directory)
-# cd x11vnc-0.9.12
-
-(run configure and then run make)
-# ./configure
-# make
-
-(if all went OK, copy x11vnc to the desired destination, e.g. $HOME/bin)
-# cp ./x11vnc/x11vnc $HOME/bin
-
-   Or do make install, it will probably install to /usr/local/bin (run
-   ./configure --help for information on customizing your configuration,
-   e.g. --prefix=/my/place.) You can now run it via typing "x11vnc",
-   "x11vnc -help | more", "x11vnc -forever -shared -display :0", etc.
-
-
-   Note: Currently gcc is recommended to build libvncserver. In some
-   cases it will build with non-gcc compilers, but the resulting binary
-   sometimes fails to run properly. For Solaris pre-built gcc binaries
-   are at http://www.sunfreeware.com/. Some Solaris pre-built x11vnc
-   binaries are here.
-
-   However, one user reports it does work fine when built with Sun Studio
-   10, so YMMV. In fact, here is a little build script to do this on
-   Solaris 10:
-#!/bin/sh
-PATH=/usr/ccs/bin:/opt/SUNWspro/bin:$PATH; export PATH
-
-CC='cc' \
-CFLAGS='-xO4' \
-LDFLAGS='-L/usr/sfw/lib -L/usr/X11/lib -R/usr/sfw/lib -R/usr/X11/lib' \
-CPPFLAGS='-I /usr/sfw/include -I/usr/X11/include' \
-./configure
-
-MAKE="make -e"
-AM_CFLAGS=""
-export MAKE AM_CFLAGS
-$MAKE
-
-   In general you can use the "make -e" trick if you don't like
-   libvncserver's choice of AM_CFLAGS. See the build scripts below for
-   more ideas. Scripts similar to the above have been shown to work with
-   vendor C compilers on HP-UX (ccom: HP92453-01) and Tru64 (Compaq C
-   V6.5-011.)
-
-   You can find information on Misc. Build problems here.
-
-     _________________________________________________________________
-
-   Building on Solaris, FreeBSD, etc:   Depending on your version of
-   Solaris or other Unix OS the jpeg and/or zlib libraries may be in
-   non-standard places (e.g. /usr/local, /usr/sfw, /opt/sfw, etc.)
-
-   Note: If configure cannot find these two libraries then TightVNC and
-   ZRLE encoding support will be disabled, and you don't want that!!! The
-   TightVNC encoding gives very good compression and performance, it even
-   makes a noticeable difference over a fast LAN.
-
-
-   Shortcuts: On Solaris 10 you can pick up almost everything just by
-   insuring that your PATH has /usr/sfw/bin (for gcc) and /usr/ccs/bin
-   (for other build tools), e.g.:
-  env PATH=/usr/sfw/bin:/usr/ccs/bin:$PATH sh -c './configure; make'
-
-   (The only thing this misses is /usr/X11/lib/libXrandr.so.2, which is
-   for the little used -xrandr option, see the script below to pick it up
-   as well.)
-
-
-   libjpeg is included in Solaris 9 and later (/usr/sfw/include and
-   /usr/sfw/lib), and zlib in Solaris 8 and later (/usr/include and
-   /usr/lib.) So on Solaris 9 you can pick up everything with something
-   like this:
-  env PATH=/usr/local/bin:/usr/ccs/bin:$PATH sh -c './configure --with-jpeg=/us
-r/sfw; make'
-
-   assuming your gcc is in /usr/local/bin and x11vnc 0.7.1 or later.
-   These are getting pretty long, see those assignments split up in the
-   build script below.
-
-
-   If your system does not have these libraries at all you can get the
-   source for the libraries to build them: libjpeg is available at
-   ftp://ftp.uu.net/graphics/jpeg/ and zlib at http://www.gzip.org/zlib/.
-   See also http://www.sunfreeware.com/ for Solaris binary packages of
-   these libraries as well as for gcc. Normally they will install into
-   /usr/local but you can install them anywhere with the
-   --prefix=/path/to/anywhere, etc.
-
-
-   Here is a build script that indicates one way to pass the library
-   locations information to the libvncserver configuration via the
-   CPPFLAGS and LDFLAGS environment variables.
----8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8
-<---
-#!/bin/sh
-
-# Build script for Solaris, etc, with gcc, libjpeg and libz in
-# non-standard locations.
-
-# set to get your gcc, etc:
-#
-PATH=/path/to/gcc/bin:/usr/ccs/bin:/usr/sfw/bin:$PATH
-
-JPEG=/path/to/jpeg      # set to maybe "/usr/local", "/usr/sfw", or "/opt/sfw"
-ZLIB=/path/to/zlib      # set to maybe "/usr/local", "/usr/sfw", or "/opt/sfw"
-
-# Below we assume headers in $JPEG/include and $ZLIB/include and the
-# shared libraries are in $JPEG/lib and $ZLIB/lib.  If your situation
-# is different change the locations in the two lines below.
-#
-CPPFLAGS="-I $JPEG/include -I $ZLIB/include"
-LDFLAGS="-L$JPEG/lib -R $JPEG/lib -L$ZLIB/lib -R $ZLIB/lib"
-
-# These two lines may not be needed on more recent Solaris releases:
-#
-CPPFLAGS="$CPPFLAGS -I /usr/openwin/include"
-LDFLAGS="$LDFLAGS -L/usr/openwin/lib -R /usr/openwin/lib"
-
-# These are for libXrandr.so on Solaris 10:
-#
-CPPFLAGS="$CPPFLAGS -I /usr/X11/include"
-LDFLAGS="$LDFLAGS -L/usr/X11/lib -R /usr/X11/lib"
-
-# Everything needs to built with _REENTRANT for thread safe errno:
-#
-CPPFLAGS="$CPPFLAGS -D_REENTRANT"
-
-export PATH CPPFLAGS LDFLAGS
-
-./configure
-make
-
-ls -l ./x11vnc/x11vnc
-
----8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8
-<---
-
-   Then do make install or copy the x11vnc binary to your desired
-   destination.
-
-   BTW, To run a shell script, just cut-and-paste the above into a file,
-   say "myscript", then modify the "/path/to/..." items to correspond to
-   your system/environment, and then type: "sh myscript" to run it.
-
-   Note that on Solaris make is /usr/ccs/bin/make, so that is why the
-   above puts /usr/ccs/bin in PATH. Other important build utilities are
-   there too: ld, ar, etc. Also, it is probably a bad idea to have
-   /usr/ucb in your PATH while building.
-
-   Starting with the 0.7.1 x11vnc release the "configure --with-jpeg=DIR
-   --with-zlib=DIR" options are handy if you want to avoid making a
-   script.
-
-   If you need to link OpenSSL libssl.a on Solaris see this method.
-
-   If you need to build on Solaris 2.5.1 or earlier or other older Unix
-   OS's, see this workaround FAQ.
-
-
-   Building on FreeBSD, OpenBSD, ...:   The jpeg libraries seem to be in
-   /usr/local or /usr/pkg on these OS's. You won't need the openwin stuff
-   in the above script (but you may need /usr/X11R6/....) Also starting
-   with the 0.7.1 x11vnc release, this usually works:
-  ./configure --with-jpeg=/usr/local
-  make
-
-
-   Building on HP-UX:   For jpeg and zlib you will need to do the same
-   sort of thing as described above for Solaris. You set CPPFLAGS and
-   LDFLAGS to find them (see below for an example.) You do not need to do
-   any of the above /usr/openwin stuff. Also, HP-UX does not seem to
-   support -R, so get rid of the -R items in LDFLAGS. Because of this, at
-   runtime you may need to set LD_LIBRARY_PATH or SHLIB_PATH to indicate
-   the directory paths so the libraries can be found. It is a good idea
-   to have static archives, e.g. libz.a and libjpeg.a for the nonstandard
-   libraries so that they get bolted into the x11vnc binary (and so won't
-   get "lost".)
-
-   Here is what we recently did to build x11vnc 0.7.2 on HP-UX 11.11
-./configure --with-jpeg=$HOME/hpux/jpeg --with-zlib=$HOME/hpux/zlib
-make
-
-   Where we had static archives (libjpeg.a, libz.a) only and header files
-   in the $HOME/hpux/... directories as discussed for the build script.
-
-   On HP-UX 11.23 and 11.31 we have had problems compiling with gcc.
-   "/usr/include/rpc/auth.h:87: error: field 'syncaddr' has incomplete
-   type". As a workaround for x11vnc 0.9.4 and later set your CPPFLAGS to
-   include:
-  CPPFLAGS="-DIGNORE_GETSPNAM"
-  export CPPFLAGS
-
-   This disables a very rare usage mode for -unixpw_nis by not trying
-   getspnam(3).
-
-   Using HP-UX's C compiler on 11.23 and 11.31 we have some severe
-   compiler errors that have not been worked around yet. If you need to
-   do this, contact me and I will give you a drastic recipe that will
-   produce a working binary.
-
-
-   Building on AIX:   AIX: one user had to add the "X11.adt" package to
-   AIX 4.3.3 and 5.2 to get build header files like XShm.h, etc. You may
-   also want to make sure that /usr/lpp/X11/include, etc is being picked
-   up by the configure and make.
-
-   For a recent build on AIX 5.3 we needed to add these CFLAGS to be able
-   to build with gcc:
-  env CFLAGS='-maix64 -Xlinker -bbigtoc' ./configure ...
-
-   we also built our own libjpeg and libz using -maix64.
-
-   BTW, one way to run an Xvfb-like virtual X server for testing on AIX
-   is something like "/usr/bin/X11/X -force -vfb -ac :1".
-
-
-   Building on Mac OS X:   There is now native Mac OS X support for
-   x11vnc by using the raw framebuffer feature. This mode does not use or
-   need X11 at all. To build you may need to disable X11:
-./configure --without-x ...
-make
-
-   However, if your system has the Mac OS X build package for X11 apps
-   you will not need to supply the "--without-x" option (in this case the
-   resulting x11vnc would be able to export both the native Mac OS X
-   display and windows displayed in the XDarwin X server.) Be sure to
-   include the ./configure option to find libjpeg on your system.
-
-
-   OpenSSL:   Starting with version 0.8.3 x11vnc can now be built with
-   SSL/TLS support. For this to be enabled the libssl.so library needs to
-   be available at build time. So you may need to have additional
-   CPPFLAGS and LDFLAGS items if your libssl.so is in a non-standard
-   place. As of x11vnc 0.9.4 there is also the --with-ssl=DIR configure
-   option.
-
-   On Solaris using static archives libssl.a and libcrypto.a instead of
-   .so shared libraries (e.g. from www.sunfreeware.com), we found we
-   needed to also set LDFLAGS as follows to get the configure to work:
-env LDFLAGS='-lsocket -ldl' ./configure --with-ssl=/path/to/openssl ...
-make
-
-     _________________________________________________________________
-
-    Beta Testing:
-
-   I don't have any formal beta-testers for the releases of x11vnc, so
-   I'd appreciate any additional testing very much.
-
-   Thanks to those who suggested features and helped beta test x11vnc
-   0.9.12 released in Sep 2010!
-
-   Please help test and debug the 0.9.13 version for release sometime in
-   Winter 2010.
-
-   The version 0.9.13 beta tarball is kept here:
-   x11vnc-0.9.13-dev.tar.gz
-
-   There are also some Linux, Solaris, Mac OS X, and other OS test
-   binaries here. Please kick the tires and report bugs, performance
-   regressions, undesired behavior, etc. to me.
-
-   To aid testing of the built-in SSL/TLS support for x11vnc, a number of
-   VNC Viewer packages for Unix, Mac OS X, and Windows have been created
-   that provide SSL Support for the TightVNC Viewer (this is done by
-   wrapper scripts and a GUI that starts STUNNEL.) It should be pretty
-   convenient for automatic SSL and SSH connections. It is described in
-   detail at and can be downloaded from the Enhanced TightVNC Viewer
-   (SSVNC) page. The SSVNC Unix viewer also supports x11vnc's symmetric
-   key encryption ciphers (see the 'UltraVNC DSM Encryption Plugin'
-   settings panel.)
-
-
-   Here are some features that will appear in the 0.9.13 release:
-     * Improved support for non-X11 touchscreen devices (e.g. handheld or
-       cell phone) via Linux uinput input injection. Additional tuning
-       parameters are added. TSLIB touchscreen calibration is supported.
-       Tested on Qtmoko Neo Freerunner. A tool, misc/uinput.pl, is
-       provided to diagnose uinput behavior on new devices. The env.
-       vars. X11VNC_UINPUT_BUS and X11VNC_UINPUT_VERSION are available if
-       leaving them unset does not work.
-     * The Linux uinput non-X11 input injection can now be bypassed:
-       events can be directly written to the /dev/input/event devices
-       specified by the user (direct_abs=..., etc.) A -pipeinput input
-       injection helper script, misc/qt_tslib_inject.pl is provided as a
-       tweakable non-builtin direct input injection method.
-     * The list of new uinput parameters for the above two features is:
-       pressure, tslib_cal, touch_always, dragskip, btn_touch;
-       direct_rel, direct_abs, direct_btn, direct_key.
-     * The MacOSX native server can now use OpenGL for the screen
-       capture. In nearly all cases this is faster than the raw
-       framebuffer capture method. There are build and run time flags,
-       X11VNC_MACOSX_NO_DEPRECATED, etc. to disable use of deprecated
-       input injection and screen access interfaces. Cursor shape now
-       works for 64bit binaries.
-     * The included SSL enabled Java VNC Viewers now handle Mouse Wheel
-       events.
-     * miscellaneous new features and changes:
-     * In -reflect mode, the libvncclient connection can now have the
-       pixel format modified via the environment variables
-       X11VNC_REFLECT_bitsPerSample, X11VNC_REFLECT_samplesPerPixel, and
-       X11VNC_REFLECT_bytesPerPixel
-     * In -create mode the following environment variables are added to
-       fine tune the behavior: FIND_DISPLAY_NO_LSOF: do not use lsof(1)
-       to try to determine the Linux VT, FIND_DISPLAY_NO_VT_FIND: do not
-       try to determine the Linux VT at all, X11VNC_CREATE_LC_ALL_C_OK:
-       do not bother undoing the setting LC_ALL=C that the create_display
-       script sets. The performance of the -create script has been
-       improved for large installations (100's of user sessions on one
-       machine.)
-     * In -unixpw mode, one can now Tab from login: to Password.
-     * An environment variable, X11VNC_SB_FACTOR, allows one to scale the
-       -sb screenblank sleep time from the default 2 secs.
-     * An experimental option -unixsock is available for testing. Note,
-       however, that it requires a manual change to
-       libvncserver/rfbserver.c for it to work.
-     * Documented that -grabkbd is no longer working with some/most
-       window managers (it can prevent resizing and menu posting.)
-
-
-   Here are some features that appeared in the 0.9.12 release (Sep/2010):
-     * One can now specify the maximum number of displays that can be
-       created in -create mode via the env. var.
-       X11VNC_CREATE_MAX_DISPLAYS
-     * The X11VNC_NO_LIMIT_SHM env. var. is added to skip any automatic
-       shared memory reduction.
-     * The kdm display manager is now detected when trying not to get
-       killed by the display manager.
-     * A compile time bug is fixed so that configuring using
-       --with-system-libvncserver pointing to LibVNCServer 0.9.7 works
-       again. A bug from forced use of Xdefs.h is worked around.
-
-
-   Here are some features that appeared in the 0.9.11 release (Aug/2010):
-     * The source tree is synchronized with the most recent libvncclient
-       (this only affects -reflect mode.) Build is fixed for
-       incompatibilities when using an external LibVNCServer (e.g.
-       ./configure --with-system-libvncserver...) Please help test these
-       build and runtime aspects and report back what you find, thanks.
-     * The SSL enabled Java VNC Viewer Makefile has been modified so that
-       the jar files that are built are compatible back to Java 1.4.
-     * In -create/-unixpw mode, the env. var. FD_USERPREFS may be set to
-       a filename in the user's home directory that includes default
-       username:options values (so the options do not need to be typed
-       every time at the login prompt.)
-     * In -reflect mode cursor position updates are now handled
-       correctly.
-
-
-   Here are some features that appeared in the 0.9.10 release (May/2010):
-     * The included SSL enabled Java applet viewer now supports Chained
-       SSL Certificates. The debugCerts=yes applet parameter aids
-       troubleshooting certificate validation. The x11vnc -ssl mode has
-       always supported chained SSL certificates (simply put the
-       intermediate certificates, in order, after the server certificate
-       in the pem file.)
-     * A demo CGI script desktop.cgi shows how to create an SSL
-       encrypted, multi-user x11vnc web login desktop service. The script
-       requires x11vnc version 0.9.10. The user logs into a secure web
-       site and gets his/her own virtual desktop (Xvfb.) x11vnc's SSL
-       enabled Java Viewer Applet is launched by the web browser for
-       secure viewing (and so no software needs to be installed on the
-       viewer-side.) One can use the desktop.cgi script for ideas to
-       create their own fancier or customized web login desktop service
-       (e.g. user-creation, PHP, SQL, specialized desktop application,
-       etc.) More info here. There is also an optional 'port redirection'
-       mode that allows redirection to other SSL enabled VNC servers
-       running inside the firewall.
-     * Built-in support for IPv6 (128 bit internet addresses) is now
-       provided. See the -6 and -connect options for details.
-       Additionally, in case there are still problems with built-in IPv6
-       support, a transitional tool is provided in inet6to4 that allows
-       x11vnc (or any other IPv4 application) to receive connections over
-       IPv6.
-     * The Xdummy wrapper script for Xorg's dummy driver is updated and
-       no longer requires being run as root. New service options are
-       provided to select Xdummy over Xvfb as the virtual X server to be
-       created.
-     * The "%" unix password verification tricks for the -unixpw option
-       are now documented. They have also been extended to run a command
-       as the user if one sets the environment variable UNIXPW_CMD. The
-       desktop.cgi demo script takes advantage of this new feature.
-     * A bug has been fixed that would prevent the Java applet viewer
-       from being downloaded successfully in single-port HTTPS/VNC inetd
-       mode. The env. var. X11VNC_HTTPS_DOWNLOAD_WAIT_TIME can be used to
-       adjust for how many seconds a -inetd or -https httpd download is
-       waited for (default 15 seconds.) The applet will now autodetect
-       x11vnc and use GET=1 for faster connecting. Many other
-       improvements and fixes.
-     * The TightVNC security type (TightVNC features enabler) now works
-       for RFB version 3.8.
-     * The X property X11VNC_TRAP_XRANDR can be set on a desktop to force
-       x11vnc to use the -xrandr screen size change trapping code.
-     * New remote control query options: pointer_x, pointer_y,
-       pointer_same, pointer_root, and pointer_mask. A demo script using
-       them misc/panner.pl is provided.
-     * The -sslScripts option prints out the SSL certificate management
-       scripts.
-
-
-   Here are some features that appeared in the 0.9.9 release (Dec/2009):
-     * The -unixpw_system_greeter option, when used in combined unixpw
-       and XDMCP FINDCREATEDISPLAY mode (for example: -xdmsvc), enables
-       the user to press Escape to jump directly to the XDM/GDM/KDM login
-       greeter screen. This way the user avoids entering his unix
-       password twice at X session creation time. Also, the unixpw login
-       panel now has a short help displayed if the user presses 'F1'.
-     * x11vnc now tries to be a little bit more aggressive in keeping up
-       with VNC client's framebuffer update requests. Some broken VNC
-       clients like Eggplant and JollysFastVNC continuously spray these
-       requests at VNC servers (regardless of whether they have received
-       any updates or not.) Under some circumstances this could lead to
-       x11vnc falling behind. The -extra_fbur option allows one to fine
-       tune the setting. Additionally, one may also dial down delays:
-       e.g. "-defer 5" and "-wait 5" (or to 1 or even 0) or -nonap or
-       -allinput to keep up with these VNC clients at the expense of
-       increased system load.
-     * Heuristics are applied to try to determine if the X display is
-       currently in a Display Manager Greeter Login panel (e.g. GDM) If
-       so, x11vnc's creation of any windows and use of XFIXES are
-       delayed. This is to try to avoid x11vnc being killed after the
-       user logs in if the GDM KillInitClients=true is in effect. So one
-       does not need to set KillInitClients=false. Note that in recent
-       GDM the KillInitClients option has been removed. Also delayed is
-       the use of the XFIXES cursor fetching functionality; this avoids
-       an Xorg bug that causes Xorg to crash right after the user logs
-       in.
-     * A new option -findauth runs the FINDDISPLAY script that applies
-       heuristics that try to determine the XAUTHORITY file. The use of
-       '-auth guess' will use the XAUTHORITY that -findauth reveals. This
-       can be handy in with the lastest GDM where the ability to store
-       cookies in ~/.Xauthority has been removed. If x11vnc is running as
-       root (e.g. inetd) and you add -env FD_XDM=1 to the above -findauth
-       or -auth guess command lines, it will find the correct XAUTHORITY
-       for the given display (this works for XDM/GDM/KDM if the login
-       greeter panel is up or if someone has already logged into an X
-       session.)
-     * The FINDDISPLAY and FINDCREATEDISPLAY modes (i.e. "-display
-       WAIT:cmd=...", -find, -create) now work correctly for the
-       user-supplied login program scheme "-unixpw_cmd ...", as long as
-       the login program supports running commands specified in the
-       environment variable "RFB_UNIXPW_CMD_RUN" as the logged-in user.
-       The mode "-unixpw_nis ..." has also been made more consistent.
-     * The -stunnel option (like -ssl but uses stunnel as an external
-       helper program) now works with the -ssl "SAVE" and "TMP" special
-       certificate names. The -sslverify and -sslCRL options now work
-       correctly in -stunnel mode. Single port HTTPS connections are also
-       supported for this mode.
-     * There is an experimental Application Sharing mode that improves
-       upon the -id/-sid single window sharing: -appshare (run "x11vnc
-       -appshare -help" for more info.) It is still very primitive and
-       approximate, but at least it displays multiple top-level windows.
-     * The remote control command -R can be used to instruct x11vnc to
-       resend its most recent copy of the Clipboard, Primary, or
-       Cutbuffer selections: "x11vnc -R resend_clipboard", "x11vnc -R
-       resend_primary", and "x11vnc -R resend_cutbuffer".
-     * The fonts in the GUI (-gui) can now by set via environment
-       variables, e.g. -env X11VNC_FONT_BOLD='Helvetica -16 bold' and
-       -env X11VNC_FONT_FIXED='Courier -14'.
-     * The XDAMAGE mechanism is now automatically disabled for a period
-       of time if a game or screensaver generates too many XDAMAGE
-       rectangles per second. This avoids the X11 event queue from
-       soaking up too much memory.
-     * There is an experimental workaround: "-env X11VNC_WATCH_DX_DY=1"
-       that tries to avoid problems with poorly constructed menu themes
-       that place the initial position of the mouse cursor inside a menu
-       item's active zone. More information can be found here.
-
-
-   Here are some features that appeared in the 0.9.8 release (Jul/2009):
-     * Stability improvements to -threads mode. Running x11vnc this way
-       is more reliable now. Threaded operation sometimes gives better
-       interactive response and faster updates: try it out. The threaded
-       mode now supports multiple VNC viewers using the same VNC
-       encoding. The threaded mode can also yield a performance
-       enhancement in the many client case (e.g. class-room broadcast.)
-       We have tested with 30 to 50 simultaneous clients. See also
-       -reflect.
-       For simultaneous clients: the ZRLE encoding is thread safe on all
-       platforms, and the Tight and Zlib encodings are currently only
-       thread safe on Linux where thread local storage, __thread, is
-       used. If your non-Linux system and compiler support __thread one
-       can supply -DTLS=__thread to enable it. When there is only one
-       connected client, all encodings are safe on all platforms. Note
-       that some features (e.g. scroll detection and -ncache) may be
-       disabled or run with reduced functionality in -threads mode.
-     * Automatically tries to work around an Xorg server and GNOME bug
-       involving infinitely repeating keys when turning off key
-       repeating. Use -repeat if the automatic workaround fails.
-     * Improved reliability of the Single Port SSL VNC and HTTPS java
-       viewer applet delivery mechanism.
-     * The -clip mode works under -rawfb.
-
-
-   Here are some features that appeared in the 0.9.7 release (Mar/2009):
-     * Support for polling Linux Virtual Terminals (also called virtual
-       consoles) directly instead of using /dev/fb. The option to use is,
-       for example, "-rawfb vt2" for Virtual Terminal 2, etc. In this
-       case the special file /dev/vcsa2 is used to retrieve vt2's current
-       text. Text and colors are shown, but no graphics.
-     * Support for less than 8 bits per pixel framebuffers (e.g. 4 or 1
-       bpp) in the -rawfb mode.
-     * The SSL enabled UltraVNC Java viewer applet now has a [Home] entry
-       in the "drives" drop down menu. This menu can be configured with
-       the ftpDropDown applet parameter. All of the applet parameters are
-       documented in classes/ssl/README.
-     * Experimental support for VirtualGL's TurboVNC (an enhanced
-       TightVNC for fast LAN high framerate usage.)
-     * The CUPS Terminal Services helper mode has been improved.
-     * Improvements to the -ncache_cr that allows smooth opaque window
-       motions using the 'copyrect' encoding when using -ncache mode.
-     * The -rmflag option enables a way to indicate to other processes
-       x11vnc has exited.
-     * Reverse connections using anonymous Diffie Hellman SSL encryption
-       now work.
-
-
-   Here are some features that appeared in the 0.9.6 release (Dec/2008):
-     * Support for VeNCrypt SSL/TLS encrypted connections. It is enabled
-       by default in the -ssl mode. VNC Viewers like vinagre,
-       gvncviewer/gtk-vnc, the vencrypt package, SSVNC, and others
-       support this encryption mode. It can also be used with the -unixpw
-       option to enable Unix username and password authentication
-       (VeNCrypt's "*Plain" modes.) A similar but older VNC security type
-       "ANONTLS" (used by vino) is supported as well. See the -vencrypt
-       and -anontls options for additional control. The difference
-       between x11vnc's normal -ssl mode and VeNCrypt is that the former
-       wraps the entire VNC connection in SSL (like HTTPS does for HTTP,
-       i.e. "vncs://") while VeNCrypt switches on the SSL/TLS at a
-       certain point during the VNC handshake. Use -sslonly to disable
-       both VeNCrypt and ANONTLS (vino.)
-     * The "-ssl ANON" option enables Anonymous Diffie-Hellman (ADH) key
-       exchange for x11vnc's normal SSL/TLS operation. Note that
-       Anonymous Diffie-Hellman uses encryption for privacy, but provides
-       no authentication and so is susceptible to Man-In-The-Middle
-       attacks (and so we do not recommend it: we prefer you use "-ssl
-       SAVE", etc. and have the VNC viewer verify the cert.) The ANONTLS
-       mode (vino) only supports ADH. VeNCrypt mode supports both ADH and
-       regular X509 SSL certificates modes. For these ADH is enabled by
-       default. See -vencrypt and -anontls for how to disable ADH.
-     * For x11vnc's SSL/TLS modes, one can now specify a Certificate
-       Revocation List (CRL) with the -sslCRL option. This will only be
-       useful for wide deployments: say a company-wide x11vnc SSL access
-       deployment using a central Certificate Authority (CA) via
-       -sslGenCA and -sslGenCert. This way if a user has his laptop lost
-       or stolen, you only have to revoke his key instead of creating a
-       new Certificate Authority and redeploying new keys to all users.
-     * The default SSL/TLS mode, "-ssl" (no pem file parameter supplied),
-       is now the same as "-ssl SAVE" and will save the generated
-       self-signed cert in "~/.vnc/certs/server.pem". Previously "-ssl"
-       would create a temporary self-signed cert that was discarded when
-       x11vnc exited. The reason for the change is to at least give the
-       chance for the VNC Viewer side (e.g. SSVNC) to remember the cert
-       to authenticate subsequent connections to the same x11vnc server.
-       Use "-ssl TMP" to regain the previous behavior. Use "-ssl
-       SAVE_NOPROMPT" to avoid being prompted about using passphrase when
-       the certificate is created.
-     * The option -http_oneport enables single-port HTTP connections via
-       the Java VNC Viewer. So, for example, the web browser URL
-       "http://myhost.org:5900" works the same as
-       "http://myhost.org:5800", but with the convenience of only
-       involving one port instead of two. This works for both unencrypted
-       connections and for SSH tunnels (see -httpsredir if the tunnel
-       port differs.) Note that HTTPS single-port operation in -ssl SSL
-       encrypted mode has been available since x11vnc version 0.8.3.
-     * For the -avahi/-zeroconf Service Advertizing mode, if x11vnc was
-       not compiled with the avahi-client library, then an external
-       helper program, either avahi-publish(1) (on Unix) or dns-sd(1) (on
-       Mac OS X), is used instead.
-     * The "-rfbport PROMPT" option will prompt the user via the GUI to
-       select the VNC port (e.g. 5901) to listen on, and a few other
-       basic settings. This enables a handy GUI mode for naive users:
-   x11vnc -gui tray=setpass -rfbport PROMPT -logfile $HOME/.x11vnc.log.%VNCDISP
-LAY
-       suitable for putting in a launcher or menu, e.g. x11vnc.desktop.
-       The -logfile expansion is new too. In the GUI, the tray=setpass
-       Properties panel has been improved.
-     * The -solid solid background color option now works for the Mac OS
-       X console.
-     * The -reopen option instructs x11vnc to try to reopen the X display
-       if it is prematurely closed by, say, the display manager (e.g.
-       GDM.)
-
-
-   Here are some features that appeared in the 0.9.5 release (Oct/2008):
-     * Symmetric key encryption ciphers. ARC4, AES-128, AES-256,
-       blowfish, and 3des are supported. Salt and initialization vector
-       seeding is provided. These compliment the more widely used SSL and
-       SSH encryption access methods. SSVNC also supports these
-       encryption modes.
-     * Scaling differently along the X- and Y-directions. E.g. "-scale
-       1280x1024" or "-scale 0.8x0.75"    Also, "-geometry WxH" is an
-       alias for "-scale WxH"
-     * By having SSVNC version 1.0.21 or later available in your $PATH,
-       the -chatwindow option allows a UltraVNC Text Chat window to
-       appear on the local X11 console/display (this way the remote
-       viewer can chat with the person at the physical display; e.g.
-       helpdesk mode.) This also works on the Mac OS X console if the
-       Xquartz X11 server (enabled by default on leopard) is running for
-       the chatwindow.
-     * The HTTP Java viewer applet jar, classes/VncViewer.jar, has been
-       updated with an improved implementation based on the code used by
-       the classes/ssl applets.
-
-
-   Here are some features that appeared in the 0.9.4 release (Sep/2008):
-     * Improvements to the -find and -create X session finding or
-       creating modes: new desktop types and service redirection options.
-       Personal cupsd daemon and SSH port redirection helper for use with
-       SSVNC's Terminal Services feature.
-     * Reverse VNC connections via -connect work in the -find, -create
-       and related -display WAIT:... modes.
-     * Reverse VNC connections (either normal or SSL) can use a Web Proxy
-       or a SOCKS proxy, or a SSH connection, or even a CGI URL to make
-       the outgoing connection. See: -proxy. Forward connections can also
-       use: -ssh.
-     * Reverse VNC connections via the UltraVNC repeater proxy (either
-       normal or SSL) are supported. Use either the "-connect
-       repeater=ID:NNNN+host:port" or "-connect
-       repeater://host:port+ID:NNNN" notation. The SSVNC VNC viewer also
-       supports the UltraVNC repeater. Also, a perl repeater implemention
-       is here: ultravnc_repeater.pl
-     * Support for indexed colormaps (PseudoColor) with depths other than
-       8 (from 1 to 16 now work) for non-standard hardware. Option
-       "-advertise_truecolor" to handle some workaround in this mode.
-     * Support for the ZYWRLE encoding, this is the RealVNC ZRLE encoding
-       extended to do motion video and photo regions more efficiently by
-       way of a Wavelet based transformation.
-     * The -finddpy and -listdpy utilities help to debug and configure
-       the -find, -create, and -display WAIT:... modes.
-     * Some automatic detection of screen resizes are handled even if the
-       -xrandr option is not supplied.
-     * The -autoport options gives more control over the VNC port x11vnc
-       chooses.
-     * The -ping secs can be used to help keep idle connections alive.
-     * Pasting of the selection/clipboard into remote applications (e.g.
-       Java) has been improved.
-     * Fixed a bug if a client disconnects during the 'speed-estimation'
-       phase.
-     * To unset Caps_Lock, Num_Lock and raise all keys in the X server
-       use -clear_all.
-     * Usage with dvorak keyboards has been improved. See also: -xkb.
-     * The Java Viewer applet source code is now included in the
-       x11vnc-0.9.*.tar.gz tarball. This means you can now build the Java
-       viewer applet jar files from source. If you stopped shipping the
-       Java viewer applet jar files due to lack of source code, you can
-       start again.
-
-
-   Here are some features that appeared in the 0.9.3 release (Oct/2007):
-     * Viewer-side pixmap caching. A large area of pixels (at least 2-3
-       times as big as the framebuffer itself; the bigger the better...
-       default is 10X) is placed below the framebuffer to act as a
-       buffer/cache area for pixel data. The VNC CopyRect encoding is
-       used to move it around, so any viewer can take advantage of it.
-       Until we start modifying viewers you will be able to see the cache
-       area if you scroll down (this makes it easier to debug!) For
-       testing the default is "-ncache 10". The unix Enhanced TightVNC
-       Viewer ssvnc has a nice -ycrop option to help hide the pixel cache
-       area from view.
-
-
-   Here are some features that appeared in the 0.9.2 release (Jun/2007):
-     * Building with no OpenSSL libssl available (or with --without-ssl)
-       has been fixed.
-     * One can configure x11vnc via "./configure
-       --with-system-libvncserver" to use a system installed libvncserver
-       library instead of the one bundled in the release tarball.
-     * If UltraVNC file transfer or chat is detected, then VNC clients
-       are "pinged" more often to prevent these side channels from
-       becoming serviced too infrequently.
-     * In -unixpw mode in the username and password dialog no text will
-       be echoed if the first character sent is "Escape". This enables a
-       convenience feature in SSVNC to send the username and password
-       automatically.
-
-
-   Here are some features that appeared in the 0.9.1 release (May/2007):
-     * The UltraVNC Java viewer has been enhanced to support SSL (as the
-       TightVNC viewer had been previously.) The UltraVNC Java supports
-       ultravnc filetransfer, and so can be used as a VNC viewer on Unix
-       that supports ultravnc filetransfer. It is in the
-       classes/ssl/UltraViewerSSL.jar file (that is pointed to by
-       ultra.vnc.) The signed applet SignedUltraViewerSSL.jar version
-       (pointed to by ultrasigned.vnc) will be needed to access the local
-       drive if you are using it for file transfer via a Web browser.
-       Some other bugs in the UltraVNC Java viewer were fixed and a few
-       improvements to the UI made.
-     * A new Unix username login mode for VNC Viewers authenticated via a
-       Client SSL Certificate: "-users sslpeer=". The emailAddress
-       subject field is inspected for username at hostname and then acts as
-       though "-users +username" has been supplied. This way the Unix
-       username is identified by (i.e. simply extracted from) the Client
-       SSL Certificate. This could be useful with -find, -create and -svc
-       modes if you are also have set up and use VNC Client SSL
-       Certificate authentication.
-     * For external display finding/creating programs (e.g. WAIT:cmd=...)
-       if the VNC Viewer is authenticated via a Client SSL Certificate,
-       then that Certificate is available in the environment variable
-       RFB_SSL_CLIENT_CERT.
-
-
-   Here are some features that appeared in the 0.9 release (Apr/2007):
-     * VNC Service advertising via mDNS / ZeroConf / BonJour with the
-       Avahi client library. Enable via "-avahi" or "-zeroconf".
-     * Implementations of UltraVNC's TextChat, SingleWindow, and
-       ServerInput extensions (requires ultravnc viewer or ssvnc Unix
-       viewer.) They toggle the selection of a single window (-id), and
-       disable (friendly) user input and viewing (monitor blank) at the
-       VNC server.
-     * Short aliases "-find", "-create", "-svc", and "-xdmsvc" for
-       commonly used FINDCREATEDISPLAY usage modes.
-     * Reverse VNC connections (viewer listening) now work in SSL (-ssl)
-       mode.
-     * New options to control the Monitor power state and keyboard/mouse
-       grabbing: -forcedpms, -clientdpms, -noserverdpms, and -grabalways.
-     * A simple way to emulate inetd(8) to some degree via the "-loopbg"
-       option.
-     * Monitor the accuracy of XDAMAGE and apply "-noxdamage" if it is
-       not working well. OpenGL applications like like beryl and MythTv
-       have been shown to make XDAMAGE not work properly.
-     * For Java SSL connections involving a router/firewall port
-       redirection, an option -httpsredir to spare the user from needing
-       to include &PORT=NNN in the browser URL.
-
-
-   Here are some features that appeared in the 0.8.4 release (Feb/2007):
-     * Native Mac OS X Aqua/Quartz support. (i.e. OSXvnc alternative;
-       some activities are faster)
-     * A new login mode: "-display WAIT:cmd=FINDCREATEDISPLAY -unixpw
-       ..." that will Create a new X session (either virtual or real and
-       with or without a display manager, e.g. kdm) for the user if it
-       cannot find the user's X session display via the FINDDISPLAY
-       method. See the -svc and the -xdmsvc aliases.
-     * x11vnc can act as a VNC reflector/repeater using the "-reflect
-       host:N" option. Instead of polling an X display, the remote VNC
-       Server host:N is connected to and re-exported via VNC. This is
-       intended for use in broadcasting a display to many (e.g. > 16;
-       classroom or large demo) VNC viewers where bandwidth and other
-       resources are conserved by spreading the load over a number of
-       repeaters.
-     * Wireframe copyrect detection for local user activity (e.g. someone
-       sitting at the physical display moving windows) Use
-       -nowireframelocal to disable.
-     * The "-N" option couples the VNC Display number to the X Display
-       number. E.g. if your X DISPLAY is :2 then the VNC display will be
-       :2 (i.e. using port 5902.) If that port is taken x11vnc will exit.
-     * Option -nodpms to avoid problems with programs like KDE's
-       kdesktop_lock that keep restarting the screen saver every few
-       seconds.
-     * To automatically fix the common mouse motion problem on XINERAMA
-       (multi-headed) displays, the -xwarppointer option is enabled by
-       default when XINERAMA is active.
-
-   If you have a Mac please try out the native Mac OS X support, build
-   with "./configure --without-x", or download a binary mentioned above,
-   (even if you don't plan on ever using it in this mode!), and let me
-   know how it went. Thanks.
-
-
-   Here are some features that appeared in the 0.8.3 release (Nov/2006):
-     * The -ssl option provides SSL encryption and authentication
-       natively via the www.openssl.org library. One can use from a
-       simple self-signed certificate server certificate up to full CA
-       and client certificate authentication schemes.
-     * Similar to -ssl, the -stunnel option starts up a SSL tunnel server
-       stunnel (that must be installed separately on the system:
-       stunnel.mirt.net ) to allow only encrypted SSL connections from
-       the network.
-     * The -sslverify option allows for authenticating VNC clients via
-       their certificates in either -ssl or -stunnel modes.
-     * Certificate creation and management tools are provide in the
-       -sslGenCert, -sslGenCA, and related options.
-     * An SSL enabled Java applet VNC Viewer applet is provided by x11vnc
-       in classes/ssl/VncViewer.jar. In addition to normal HTTP, the
-       applet may be loaded into the web browser via HTTPS (HTTP over
-       SSL.) (one can use the VNC port, e.g. https://host:5900/, or also
-       the separate -https port option.) A wrapper shell script
-       ss_vncviewer is also provided that sets up a stunnel client-side
-       tunnel on Unix systems. See Enhanced TightVNC Viewer (SSVNC) for
-       other SSL/SSH viewer possibilities.
-     * The -unixpw option supports Unix username and password
-       authentication (a simpler variant is the -unixpw_nis option that
-       works in environments where the encrypted passwords are readable,
-       e.g. NIS.) The -ssl or -localhost + -stunnel options are enforced
-       in this mode to prevent password sniffing. As a convenience, these
-       requirements are lifted if a SSH tunnel can be deduced (but
-       -localhost still applies.)
-     * Coupling -unixpw with "-display WAIT:cmd=FINDDISPLAY" or "-display
-       WAIT:cmd=FINDCREATEDISPLAY" provides a way to allow a user to
-       login with their UNIX password and have their display connected to
-       automatically. See the -svc and the -xdmsvc aliases.
-     * Hooks are provided in the -unixpw_cmd and "-passwdfile
-       cmd:,custom:..." options to allow you to supply your own
-       authentication and password lookup programs.
-     * x11vnc can be configured and built to not depend on X11 libraries
-       "./configure --without-x" for -rawfb only operation (e.g. embedded
-       linux console devices.)
-     * The -rotate option enables you to rotate or reflect the screen
-       before exporting via VNC. This is intended for use on handhelds
-       and other devices where the rotation orientation is not "natural".
-     * The "-ultrafilexfer" alias is provided and improved UltraVNC
-       filetransfer rates have been achieved.
-     * Under the "-connect_or_exit host" option x11vnc will exit
-       immediately unless the reverse connection to host succeeds. The
-       "-rfbport 0" option disables TCP listening for connections (useful
-       for this mode.)
-     * The "-rawfb rand" and "-rawfb none" options are useful for testing
-       automation scripts, etc., without requiring a full desktop.
-     * Reduced spewing of information at startup, use "-verbose" (also
-       "-v") to turn it back on for debugging or if you are going to send
-       me a problem report.
-
-   Here are some Previous Release Notes
-     _________________________________________________________________
-
-    Some Notes:
-
-   Both a client and a server:   It is sometimes confusing to people that
-   x11vnc is both a client and a server at the same time. It is an X
-   client because it connects to the running X server to do the screen
-   polls. Think of it as a rather efficient "screenshot" program running
-   continuously. It is a server in the sense that it is a VNC server that
-   VNC viewers on the network can connect to and view the screen
-   framebuffer it manages.
-
-   When trying to debug problems, remember to think of both roles. E.g.
-   "how is x11vnc connecting to the X server?", "how is the vncviewer
-   connecting to x11vnc?", "what permits/restricts the connection?". Both
-   links may have reachability, permission, and other issues.
-
-   Network performance:   Whether you are using Xvnc or x11vnc it is
-   always a good idea to have a solid background color instead of a
-   pretty background image. Each and every re-exposure of the background
-   must be resent over the network: better to have that background be a
-   solid color that compresses very well compared to a photo image. (This
-   is one place where the X protocol has an advantage over the VNC
-   protocol.) I suggest using xsetroot, dtstyle or similar utility to set
-   a solid background while using x11vnc. You can turn the pretty
-   background image back on when you are using the display directly.
-   Update: As of Feb/2005 x11vnc has the -solid [color] option that works
-   on recent GNOME, KDE, and CDE and also on classic X (background image
-   is on the root window.) Update: As of Oct/2007 x11vnc has the -ncache
-   option that does a reasonable job caching the background (and other)
-   pixmap data on the viewer side.
-
-   I also find the TightVNC encoding gives the best response for my usage
-   (Unix <-> Unix over cable modem.) One needs a tightvnc-aware vncviewer
-   to take advantage of this encoding.
-
-   TCP port issues:   Notice the lines
-  18/07/2003 14:36:31 Autoprobing selected port 5900
-  PORT=5900
-
-   in the output. 5900 is the default VNC listening port (just like 6000
-   is X11's default listening port.) Had port 5900 been taken by some
-   other application, x11vnc would have next tried 5901. That would mean
-   the viewer command above should be changed to vncviewer
-   far-away.east:1. You can force the port with the "-rfbport NNNN"
-   option where NNNN is the desired port number. If that port is already
-   taken, x11vnc will exit immediately. The "-N" option will try to match
-   the VNC display number to the X display.   (also see the "SunRay
-   Gotcha" note below)
-
-   Options:   x11vnc has (far too) many features that may be activated
-   via its command line options. Useful options are, e.g., -scale to do
-   server-side scaling, and -rfbauth passwd-file to use VNC password
-   protection (the vncpasswd or storepasswd programs, or the x11vnc
-   -storepasswd option can be used to create the password file.)
-
-   Algorithm:   How does x11vnc do it? Rather brute-forcedly: it
-   continuously polls the X11 framebuffer for changes using
-   XShmGetImage(). When changes are discovered, it instructs libvncserver
-   which rectangular regions of the framebuffer have changed, and
-   libvncserver compresses the changes and sends them off to any
-   connected VNC viewers. A number of applications do similar things,
-   such as x0rfbserver, krfb, x0vncserver, vino. x11vnc uses a 32 x 32
-   pixel tile model (the desktop is decomposed into roughly 1000 such
-   tiles), where changed tiles are found by pseudo-randomly polling 1
-   pixel tall horizontal scanlines separated vertically by 32 pixels.
-   This is a surprisingly effective algorithm for finding changed
-   regions. For keyboard and mouse user input the XTEST extension is used
-   to pass the input events to the X server. To detect XBell "beeps" the
-   XKEYBOARD extension is used. If available, the XFIXES extension is
-   used to retrieve the current mouse cursor shape. Also, if available
-   the X DAMAGE extension is used to receive hints from the X server
-   where modified regions on the screen are. This greatly reduces the
-   system load when not much is changing on the screen and also improves
-   how quickly the screen is updated.
-
-   Barbershop mirrors effect:   What if x11vnc is started up, and
-   vncviewer is then started up on the same machine and displayed on the
-   same display x11vnc is polling? One might "accidentally" do this when
-   first testing out the programs. You get an interesting
-   recursive/feedback effect where vncviewer images keep popping up each
-   one contained in the previous one and slightly shifted a bit by the
-   window manager decorations. There will be an even more interesting
-   effect if -scale is used. Also, if the XKEYBOARD is supported and the
-   XBell "beeps" once, you get an infinite loop of beeps going off.
-   Although all of this is mildly exciting it is not much use: you will
-   normally run and display the viewer on a different machine!
-     _________________________________________________________________
-
-    Sun Ray Notes:
-
-   You can run x11vnc on your (connected or disconnected) SunRay session.
-   Here are some notes on SunRay usage with x11vnc.
-
-     _________________________________________________________________
-
-    Limitations:
-
-     * Due to the polling nature, some activities (opaque window moves,
-       scrolling), can be pretty choppy/ragged and others (exposures of
-       large areas) slow. Experiment with interacting a bit differently
-       than you normally do to minimize the effects (e.g. do fullpage
-       paging rather than line-by-line scrolling, and move windows in a
-       single, quick motion.) Recent work has provided the
-       -scrollcopyrect and -wireframe speedups using the CopyRect VNC
-       encoding and other things, but they only speed up some activities,
-       not all.
-     * A rate limiting factor for x11vnc performance is that graphics
-       hardware is optimized for writing, not reading (x11vnc reads the
-       video framebuffer for the screen image data.) The difference can
-       be a factor of 10 to 1000, and so it usually takes about 0.5-1 sec
-       to read in the whole video hardware framebuffer (e.g. 5MB for
-       1280x1024 at depth 24 with a read rate of 5-10MB/sec.) So whenever
-       activity changes most of the screen (e.g. moving or iconifying a
-       large window) there is a delay of 0.5-1 sec while x11vnc reads the
-       changed regions in.
-       A slow framebuffer read rate will often be the performance
-       bottleneck on a fast LAN (whereas on slower links the reduced
-       network bandwidth becomes the bottleneck.)
-       Note: A quick way to get a 2X speedup of this for x11vnc is to
-       switch your X server from depth 24 (32bpp) to depth 16 (16bpp.)
-       You get a 4X speedup going to 8bpp, but the lack of color cells is
-       usually unacceptable.
-       To get a sense of the read and write speeds of your video card,
-       you can run benchmarks like: "x11perf -getimage500",  "x11perf
-       -putimage500",  "x11perf -shmput500" and for XFree86 displays with
-       direct graphics access the "dga" command (press "b" to run the
-       benchmark and then after a few seconds press "q" to quit.) Even
-       this "dd if=/dev/fb0 of=/dev/null" often gives a good estimate.
-       x11vnc also prints out its estimate:
-  28/02/2009 11:11:07 Autoprobing TCP port
-  28/02/2009 11:11:07 Autoprobing selected port 5900
-  28/02/2009 11:11:08 fb read rate: 10 MB/sec
-  28/02/2009 11:11:08 screen setup finished.
-       We have seen a few cases where the hardware fb read speed is
-       greater than 65 MB/sec: on high end graphics workstations from SGI
-       and Sun, and also from a Linux user using nvidia proprietary
-       drivers for his nvidia video card. Update 2008: thankfully, these
-       sped up drivers are becoming more common on Linux and *BSD systems
-       and that makes x11vnc run somewhat more quickly. Sometimes they
-       have a read rate of over 400 MB/sec.
-       On XFree86/Xorg it is actually possible to increase the
-       framebuffer read speed considerably (10-100 times) by using the
-       Shadow Framebuffer (a copy of the framebuffer is kept in main
-       memory and this can be read much more quickly.) To do this one
-       puts the line Option "ShadowFB" "true" in the Device section of
-       the /etc/X11/XF86Config or /etc/X11/xorg.conf file. Note that this
-       disables 2D acceleration at the physical display and so that might
-       be unacceptable if one plays games, etc. on the machine's local
-       display. Nevertheless this could be handy in some circumstances,
-       e.g. if the slower speed while sitting at the physical display was
-       acceptable (this seems to be true for most video cards these
-       days.) Unfortunately it does not seem shadowfb can be turned on
-       and off dynamically...
-       Another amusing thing one can do is use Xvfb as the X server, e.g.
-       "xinit $HOME/.xinitrc -- /usr/X11R6/bin/Xvfb :1 -screen 0
-       1024x768x16" x11vnc can poll Xvfb efficiently via main memory.
-       It's not exactly clear why one would want to do this instead of
-       using vncserver/Xvnc, (perhaps to take advantage of an x11vnc
-       feature, such as framebuffer scaling or built-in SSL encryption),
-       but we mention it because it may be of use for special purpose
-       applications. You may need to use the "-cc 4" option to force Xvfb
-       to use a TrueColor visual instead of DirectColor. See also the
-       description of the -create option that does all of this
-       automatically for you (be sure to install the Xvfb package, e.g.
-       apt-get install xvfb.)
-       Also, a faster and more accurate way is to use the "dummy"
-       Xorg/XFree86 device driver (or our Xdummy wrapper script.) See
-       this FAQ for details.
-     * Somewhat surprisingly, the X11 mouse (cursor) shape is write-only
-       and cannot be queried from the X server. So traditionally in
-       x11vnc the cursor shape stays fixed at an arrow. (see the "-cursor
-       X" and "-cursor some" options, however, for a partial hack for the
-       root window, etc.) However, on Solaris using the SUN_OVL overlay
-       extension, x11vnc can show the correct mouse cursor when the
-       -overlay option is also supplied. A similar thing is done on IRIX
-       as well when -overlay is supplied.
-       More generally, as of Dec/2004 x11vnc supports the new XFIXES
-       extension (in Xorg and Solaris 10) to query the X server for the
-       exact cursor shape, this works pretty well except that cursors
-       with transparency (alpha channel) need to approximated to solid
-       RGB values (some cursors look worse than others.)
-     * Audio from applications is of course not redirected (separate
-       redirectors do exist, e.g. esd, see the FAQ on this below.) The
-       XBell() "beeps" will work if the X server supports the XKEYBOARD
-       extension. (Note that on Solaris XKEYBOARD is disabled by default.
-       Passing +kb to Xsun enables it.)
-     * The scroll detection algorithm for the -scrollcopyrect option can
-       give choppy or bunched up transient output and occasionally
-       painting errors.
-     * Using -threads can expose some bugs/crashes in libvncserver.
-
-   Please feel free to contact me if you have any questions, problems, or
-   comments about x11vnc, etc. Please be polite, thorough, and not
-   demanding (sadly, the number of people contacting me that are rude and
-   demanding is increasing dramatically.)
-   Also, some people ask if they can make a donation, see this link for
-   that.
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/faq.html:
-
-
-   x11vnc Home    Donations
-     _________________________________________________________________
-
-    x11vnc FAQ:
-
-
-   [Building and Starting]
-
-   Q-1: I can't get x11vnc to start up. It says "XOpenDisplay failed
-   (null)" or "Xlib: connection to ":0.0" refused by server Xlib: No
-   protocol specified" and then exits. What do I need to do? 
-
-   Q-2: I can't get x11vnc and/or libvncserver to compile. 
-
-   Q-3: I just built x11vnc successfully, but when I use it my keystrokes
-   and mouse button clicks are ignored  (I am able to move the mouse
-   though.) 
-
-   Q-4: Help, I need to run x11vnc on Solaris 2.5.1 (or other old
-   Unix/Linux) and it doesn't compile! 
-
-   Q-5: Where can I get a precompiled x11vnc binary for my Operating
-   System? 
-
-   Q-6: Where can I get a VNC Viewer binary (or source code) for the
-   Operating System I will be viewing from? 
-
-   Q-7: How can I see all of x11vnc's command line options and
-   documentation on how to use them? 
-
-   Q-8: I don't like typing arcane command line options every time I
-   start x11vnc. What can I do? Is there a config file? Or a GUI? 
-
-   Q-9: How can I get the GUI to run in the System Tray, or at least be a
-   smaller, simpler icon? 
-
-   Q-10: How can I get x11vnc to listen on a different port besides the
-   default VNC port (5900)? 
-
-   Q-11: My Firewall/Router doesn't allow VNC Viewers to connect to
-   x11vnc. 
-
-   Q-12: Is it possible for a VNC Viewer and a VNC Server to connect to
-   each other even though both are behind Firewalls that block all
-   incoming connections? 
-
-   Q-13: Can I make x11vnc more quiet and also go into the background
-   after starting up? 
-
-   Q-14: Sometimes when a VNC viewer dies abruptly, x11vnc also dies with
-   the error message like: "Broken pipe". I'm using the -forever mode and
-   I want x11vnc to keep running. 
-
-   Q-15: The Windows TightVNC 1.3.9 Viewer cannot connect to x11vnc. 
-
-   Q-16: KDE's krdc VNC viewer cannot connect to x11vnc. 
-
-   Q-17: When I start x11vnc on an Alpha Tru64 workstation the X server
-   crashes! 
-
-   Q-18: When running x11vnc on an IBM AIX workstation after a few
-   minutes the VNC connection freezes. 
-
-   Q-19: Are there any build-time customizations possible, e.g. change
-   defaults, create a smaller binary, etc? 
-
-   [Win2VNC Related]
-
-   Q-20: I have two separate machine displays in front of me, one Windows
-   the other X11: can I use x11vnc in combination with Win2VNC in
-   dual-screen mode to pass the keystrokes and mouse motions to the X11
-   display? 
-
-   Q-21: I am running Win2VNC on my Windows machine and "x11vnc -nofb" on
-   Unix to pass keyboard and mouse to the Unix monitor. Whenever I start
-   Win2VNC it quickly disconnects and x11vnc says:
-   rfbProcessClientNormalMessage: read: Connection reset by peer 
-
-   Q-22: Can I run "x11vnc -nofb" on a Mac OS X machine to redirect mouse
-   and keyboard input to it from Windows and X11 machines via Win2VNC and
-   x2vnc, respectively? 
-
-   [Color Issues]
-
-   Q-23: The X display I run x11vnc on is only 8 bits per pixel (bpp)
-   PseudoColor (i.e. only 256 distinct colors.) The x11vnc colors may
-   start out OK, but after a while they are incorrect in certain windows.
-   
-   Q-24: Color problems: Why are the colors for some windows incorrect in
-   x11vnc? BTW, my X display has nice overlay/multi-depth visuals of
-   different color depths: e.g. there are both depth 8 and 24 visuals
-   available at the same time. 
-
-   Q-25: I am on a high color system (depth >= 24) but I seem to have
-   colormap problems. They either flash or everything is very dark. 
-
-   Q-26: How do I figure out the window id to supply to the -id windowid
-   option? 
-
-   Q-27: Why don't menus or other transient windows come up when I am
-   using the -id windowid option to view a single application window? 
-
-   Q-28: My X display is depth 24 at 24bpp (instead of the normal depth
-   24 at 32bpp.) I'm having lots of color and visual problems with x11vnc
-   and/or vncviewer. What's up? 
-
-   [Xterminals]
-
-   Q-29: Can I use x11vnc to view and interact with an Xterminal (e.g.
-   NCD) that is not running UNIX and so x11vnc cannot be run on it
-   directly? 
-
-   Q-30: How do I get my X permissions (MIT-MAGIC-COOKIE file) correct
-   for a Unix/Linux machine acting as an Xterminal? 
-
-   [Sun Rays]
-
-   Q-31: I'm having trouble using x11vnc with my Sun Ray session. 
-
-   [Remote Control]
-
-   Q-32: How do I stop x11vnc once it is running in the background? 
-
-   Q-33: Can I change settings in x11vnc without having to restart it?
-   Can I remote control it? 
-
-   [Security and Permissions]
-
-   Q-34: How do I create a VNC password for use with x11vnc? 
-
-   Q-35: Can I make it so -storepasswd doesn't show my password on the
-   screen? 
-
-   Q-36: Can I have two passwords for VNC viewers, one for full access
-   and the other for view-only access to the display? 
-
-   Q-37: Can I have as many full-access and view-only passwords as I
-   like? 
-
-   Q-38: Does x11vnc support Unix usernames and passwords? Can I further
-   limit the set of Unix usernames who can connect to the VNC desktop? 
-
-   Q-39: Can I supply an external program to provide my own custom login
-   method (e.g. Dynamic/One-time passwords or non-Unix (LDAP) usernames
-   and passwords)? 
-
-   Q-40: Why does x11vnc exit as soon as the VNC viewer disconnects? And
-   why doesn't it allow more than one VNC viewer to connect at the same
-   time? 
-
-   Q-41: Can I limit which machines incoming VNC clients can connect
-   from? 
-
-   Q-42: How do I build x11vnc/libvncserver with libwrap (tcp_wrappers)
-   support? 
-
-   Q-43: Can I have x11vnc only listen on one network interface (e.g.
-   internal LAN) rather than having it listen on all network interfaces
-   and relying on -allow to filter unwanted connections out? 
-
-   Q-44: Now that -localhost implies listening only on the loopback
-   interface, how I can occasionally allow in a non-localhost via the -R
-   allowonce remote control command? 
-
-   Q-45: Can I fine tune what types of user input are allowed? E.g. have
-   some users just be able to move the mouse, but not click or type
-   anything? 
-
-   Q-46: Can I prompt the user at the local X display whether the
-   incoming VNC client should be accepted or not? Can I decide to make
-   some clients view-only? How about running an arbitrary program to make
-   the decisions? 
-
-   Q-47: I start x11vnc as root because it is launched via inetd(8) or a
-   display manager like gdm(1). Can I have x11vnc later switch to a
-   different user? 
-
-   Q-48: I use a screen-lock when I leave my workstation (e.g.
-   xscreensaver or xlock.) When I remotely access my workstation desktop
-   via x11vnc I can unlock the desktop fine, but I am worried people will
-   see my activities on the physical monitor. What can I do to prevent
-   this, or at least make it more difficult? 
-
-   Q-49: Can I have x11vnc automatically lock the screen when I
-   disconnect the VNC viewer? 
-
-   [Encrypted Connections]
-
-   Q-50: How can I tunnel my connection to x11vnc via an encrypted SSH
-   channel between two Unix machines? 
-
-   Q-51: How can I tunnel my connection to x11vnc via an encrypted SSH
-   channel from Windows using an SSH client like Putty? 
-
-   Q-52: How can I tunnel my connection to x11vnc via an encrypted SSL
-   channel using an external tool like stunnel? 
-
-   Q-53: Does x11vnc have built-in SSL tunneling? 
-
-   Q-54: How do I use VNC Viewers with built-in SSL tunneling? 
-
-   Q-55: How do I use the Java applet VNC Viewer with built-in SSL
-   tunneling when going through a Web Proxy? 
-
-   Q-56: Can Apache web server act as a gateway for users to connect via
-   SSL from the Internet with a Web browser to x11vnc running on their
-   workstations behind a firewall? 
-
-   Q-57: Can I create and use my own SSL Certificate Authority (CA) with
-   x11vnc? 
-
-   [Display Managers and Services]
-
-   Q-58: How can I run x11vnc as a "service" that is always available? 
-
-   Q-59: How can I use x11vnc to connect to an X login screen like xdm,
-   GNOME gdm, KDE kdm, or CDE dtlogin? (i.e. nobody is logged into an X
-   session yet.) 
-
-   Q-60: Can I run x11vnc out of inetd(8)? How about xinetd(8)? 
-
-   Q-61: Can I have x11vnc advertise its VNC service and port via mDNS /
-   Zeroconf (e.g. Avahi) so VNC viewers on the local network can detect
-   it automatically? 
-
-   Q-62: Can I have x11vnc allow a user to log in with her UNIX username
-   and password and then have it find her X session display on that
-   machine and then attach to it? How about starting an X session if one
-   cannot be found? 
-
-   Q-63: Can I have x11vnc restart itself after it terminates? 
-
-   Q-64: How do I make x11vnc work with the Java VNC viewer applet in a
-   web browser? 
-
-   Q-65: Are reverse connections (i.e. the VNC server connecting to the
-   VNC viewer) using "vncviewer -listen" and vncconnect(1) supported? 
-
-   Q-66: Can reverse connections be made to go through a Web or SOCKS
-   proxy or SSH? 
-
-   Q-67: Can x11vnc provide a multi-user desktop web login service as an
-   Apache CGI or PHP script? 
-
-   Q-68: Can I use x11vnc as a replacement for Xvnc? (i.e. not for a real
-   display, but for a virtual one I keep around.) 
-
-   Q-69: How can I use x11vnc on "headless" machines? Why might I want
-   to? 
-
-   [Resource Usage and Performance]
-
-   Q-70: I have lots of memory, but why does x11vnc fail with    shmget:
-   No space left on device    or    Minor opcode of failed request: 1
-   (X_ShmAttach)? 
-
-   Q-71: How can I make x11vnc use less system resources? 
-
-   Q-72: How can I make x11vnc use MORE system resources? 
-
-   Q-73: I use x11vnc over a slow link with high latency (e.g. dialup
-   modem or broadband), is there anything I can do to speed things up? 
-
-   Q-74: Does x11vnc support the X DAMAGE Xserver extension to find
-   modified regions of the screen quickly and efficiently? 
-
-   Q-75: My OpenGL application shows no screen updates unless I supply
-   the -noxdamage option to x11vnc. 
-
-   Q-76: When I drag windows around with the mouse or scroll up and down
-   things really bog down (unless I do the drag in a single, quick
-   motion.) Is there anything to do to improve things? 
-
-   Q-77: Why not do something like wireframe animations to avoid the
-   windows "lurching" when being moved or resized? 
-
-   Q-78: Can x11vnc try to apply heuristics to detect when a window is
-   scrolling its contents and use the CopyRect encoding for a speedup? 
-
-   Q-79: Can x11vnc do client-side caching of pixel data? I.e. so when
-   that pixel data is needed again it does not have to be retransmitted
-   over the network. 
-
-   Q-80: Does x11vnc support TurboVNC? 
-
-   [Mouse Cursor Shapes]
-
-   Q-81: Why isn't the mouse cursor shape (the little icon shape where
-   the mouse pointer is) correct as I move from window to window? 
-
-   Q-82: When using XFIXES cursorshape mode, some of the cursors look
-   really bad with extra black borders around the cursor and other cruft.
-   How can I improve their appearance? 
-
-   Q-83: In XFIXES mode, are there any hacks to handle cursor
-   transparency ("alpha channel") exactly? 
-
-   [Mouse Pointer]
-
-   Q-84: Why does the mouse arrow just stay in one corner in my
-   vncviewer, whereas my cursor (that does move) is just a dot? 
-
-   Q-85: Can I take advantage of the TightVNC extension to the VNC
-   protocol where Cursor Positions Updates are sent back to all connected
-   clients (i.e. passive viewers can see the mouse cursor being moved
-   around by another viewer)? 
-
-   Q-86: Is it possible to swap the mouse buttons (e.g. left-handed
-   operation), or arbitrarily remap them? How about mapping button clicks
-   to keystrokes, e.g. to partially emulate Mouse wheel scrolling? 
-
-   [Keyboard Issues]
-
-   Q-87: How can I get my AltGr and Shift modifiers to work between
-   keyboards for different languages? 
-
-   Q-88: When I try to type a "<" (i.e. less than) instead I get ">"
-   (i.e. greater than)! Strangely, typing ">" works OK!! 
-
-   Q-89: Extra Character Inserted, E.g.: When I try to type a "<" (i.e.
-   less than) instead I get "<," (i.e. an extra comma.) 
-
-   Q-90: I'm using an "international" keyboard (e.g. German "de", or
-   Danish "dk") and the -modtweak mode works well if the VNC viewer is
-   run on a Unix/Linux machine with a similar keyboard.   But if I run
-   the VNC viewer on Unix/Linux with a different keyboard (e.g. "us") or
-   Windows with any keyboard, I can't type some keys like:   "@", "$",
-   "<", ">", etc. How can I fix this? 
-
-   Q-91: When typing I sometimes get double, triple, or more of my
-   keystrokes repeated. I'm sure I only typed them once, what can I do? 
-
-   Q-92: The x11vnc -norepeat mode is in effect, but I still get repeated
-   keystrokes!! 
-
-   Q-93: After using x11vnc for a while, I find that I cannot type some
-   (or any) characters or my mouse clicks and drags no longer have any
-   effect, or they lead to strange effects. What happened? 
-
-   Q-94: The machine where I run x11vnc has an AltGr key, but the local
-   machine where I run the VNC viewer does not. Is there a way I can map
-   a local unused key to send an AltGr? How about a Compose key as well? 
-
-   Q-95: I have a Sun machine I run x11vnc on. Its Sun keyboard has just
-   one Alt key labelled "Alt" and two Meta keys labelled with little
-   diamonds. The machine where I run the VNC viewer only has Alt keys.
-   How can I send a Meta keypress? (e.g. emacs needs this) 
-
-   Q-96: Running x11vnc on HP-UX I cannot type "#" I just get a "3"
-   instead. 
-
-   Q-97: Can I map a keystroke to a mouse button click on the remote
-   machine? 
-
-   Q-98: How can I get Caps_Lock to work between my VNC viewer and
-   x11vnc? 
-
-   [Screen Related Issues and Features]
-
-   Q-99: The remote display is larger (in number of pixels) than the
-   local display I am running the vncviewer on. I don't like the
-   vncviewer scrollbars, what I can do? 
-
-   Q-100: Does x11vnc support server-side framebuffer scaling? (E.g. to
-   make the desktop smaller.) 
-
-   Q-101: Does x11vnc work with Xinerama? (i.e. multiple monitors joined
-   together to form one big, single screen.) 
-
-   Q-102: Can I use x11vnc on a multi-headed display that is not Xinerama
-   (i.e. separate screens :0.0, :0.1, ... for each monitor)? 
-
-   Q-103: Can x11vnc show only a portion of the display? (E.g. for a
-   special purpose application or a very large screen.) 
-
-   Q-104: Does x11vnc support the XRANDR (X Resize, Rotate and
-   Reflection) extension? Whenever I rotate or resize the screen x11vnc
-   just seems to crash. 
-
-   Q-105: Independent of any XRANDR, can I have x11vnc rotate and/or
-   reflect the screen that the VNC viewers see? (e.g. for a handheld
-   whose screen is rotated 90 degrees.) 
-
-   Q-106: Why is the view in my VNC viewer completely black? Or why is
-   everything flashing around randomly? 
-
-   Q-107: I use Linux Virtual Terminals (VT's) to implement 'Fast User
-   Switching' between users' sessions (e.g. Betty is on Ctrl-Alt-F7,
-   Bobby is on Ctrl-Alt-F8, and Sid is on Ctrl-Alt-F1: they use those
-   keystrokes to switch between their sessions.)   How come the view in a
-   VNC viewer connecting to x11vnc is either completely black or
-   otherwise all messed up unless the X session x11vnc is attached to is
-   in the active VT? 
-
-   Q-108: I am using x11vnc where my local machine has "popup/hidden
-   taskbars" and the remote display where x11vnc runs also has
-   "popup/hidden taskbars" and they interfere and fight with each other.
-   What can I do? 
-
-   Q-109: Help! x11vnc and my KDE screensaver keep switching each other
-   on and off every few seconds. 
-
-   Q-110: I am running the compiz 3D window manager (or beryl, MythTv,
-   Google Earth, or some other OpenGL app) and I do not get screen
-   updates in x11vnc. 
-
-   Q-111: Can I use x11vnc to view my VMWare session remotely? 
-
-   [Exporting non-X11 devices via VNC]
-
-   Q-112: Can non-X devices (e.g. a raw framebuffer) be viewed (and even
-   controlled) via VNC with x11vnc? 
-
-   Q-113: Can I export the Linux Console (Virtual Terminals) via VNC
-   using x11vnc? 
-
-   Q-114: Can I export via VNC a Webcam or TV tuner framebuffer using
-   x11vnc? 
-
-   Q-115: Can I connect via VNC to a Qt-embedded/Qt-enhanced/Qtopia
-   application running on my handheld, cell phone, or PC using the Linux
-   console framebuffer (i.e. not X11)? 
-
-   Q-116: How do I inject touch screen input into an
-   Qt-embedded/Qt-enhanced/Qtopia cell phone such as openmoko/qtmoko Neo
-   Freerunner? 
-
-   Q-117: Now that non-X11 devices can be exported via VNC using x11vnc,
-   can I build it with no dependencies on X11 header files and libraries?
-   
-   Q-118: How do I cross compile x11vnc for a different architecture than
-   my Linux i386 or amd64 PC? 
-
-   Q-119: Does x11vnc support Mac OS X Aqua/Quartz displays natively
-   (i.e. no X11 involved)? 
-
-   Q-120: Can x11vnc be used as a VNC reflector/repeater to improve
-   performance for the case of a large number of simultaneous VNC viewers
-   (e.g. classroom broadcasting or a large demo)? 
-
-   Q-121: Can x11vnc be used during a Linux, Solaris, etc. system
-   Installation so the Installation can be done remotely? 
-
-   [Misc: Clipboard, File Transfer/Sharing, Printing, Sound, Beeps,
-   Thanks, etc.]
-
-   Q-122: Does the Clipboard/Selection get transferred between the
-   vncviewer and the X display? 
-
-   Q-123: Can I use x11vnc to record a Shock Wave Flash (or other format)
-   video of my desktop, e.g. to record a tutorial or demo? 
-
-   Q-124: Can I transfer files back and forth with x11vnc? 
-
-   Q-125: Which UltraVNC extensions are supported? 
-
-   Q-126: Can x11vnc emulate UltraVNC's Single Click helpdesk mode for
-   Unix? I.e. something very simple for a naive user to initiate a
-   reverse vnc connection from their Unix desktop to a helpdesk
-   operator's VNC Viewer. 
-
-   Q-127: Can I (temporarily) mount my local (viewer-side) Windows/Samba
-   File share on the machine where x11vnc is running? 
-
-   Q-128: Can I redirect CUPS print jobs from the remote desktop where
-   x11vnc is running to a printer on my local (viewer-side) machine? 
-
-   Q-129: How can I hear the sound (audio) from the remote applications
-   on the desktop I am viewing via x11vnc? 
-
-   Q-130: Why don't I hear the "Beeps" in my X session (e.g. when typing
-   tput bel in an xterm)? 
-
-   Q-131: Does x11vnc work with IPv6? 
-
-   Q-132: Thanks for your program or for your help! Can I make a
-   donation? 
-     _________________________________________________________________
-
-
-   [Building and Starting]
-
-   Q-1: I can't get x11vnc to start up. It says "XOpenDisplay failed
-   (null)" or "Xlib: connection to ":0.0" refused by server Xlib: No
-   protocol specified" and then exits. What do I need to do?
-
-   For the former error, you need to specify the X display to connect to
-   (it also needs to be on the same machine the x11vnc process is to run
-   on.) Set your DISPLAY environment variable (or use the -display
-   option) to specify it. Nearly always the correct value will be ":0"
-   (in fact, x11vnc will now assume :0 if given no other information.)
-
-
-   For the latter error, you need to set up the X11 permissions
-   correctly.
-
-   To make sure X11 permissions are the problem do this simple test:
-   while sitting at the physical X display open a terminal window
-   (gnome-terminal, xterm, etc.) You should be able to run x11vnc
-   successfully without any need for special steps or command line
-   options in that terminal (i.e. just type "x11vnc".) If that works OK
-   then you know X11 permissions are the only thing preventing it from
-   working when you try to start x11vnc via, say, a remote shell.
-
-   How to Solve:  See the xauth(1), Xsecurity(7), and xhost(1) man pages
-   or this Howto for much info on X11 permissions. For example, you may
-   need to set your XAUTHORITY environment variable (or use the -auth
-   option) to point to the correct MIT-MAGIC-COOKIE file (e.g.
-   /home/joe/.Xauthority or /var/gdm/:0.Xauth or /var/lib/kdm/A:0-crWk72K
-   or /tmp/.gdmzndVlR, etc, etc.), or simply be sure you run x11vnc as
-   the correct user (i.e. the user who is logged into the X session you
-   wish to view.)
-
-   Note: The MIT cookie file contains the secret key that allows x11vnc
-   to connect to the desired X display.
-
-   If, say, sshd has set XAUTHORITY to point to a random file it has
-   created for X forwarding that will cause problems. (Under some
-   circumstances even su(1) and telnet(1) can set XAUTHORITY. See also
-   the gdm parameter NeverPlaceCookiesOnNFS that sets XAUTHORITY to a
-   random filename in /tmp for the whole X session.)
-
-   Running x11vnc as root is often not enough: you need to know where the
-   MIT-MAGIC-COOKIE file for the desired X display is.
-
-   Example solution:
-  x11vnc -display :0 -auth /var/gdm/:0.Xauth
-
-   (this is for the display manager gdm and requires root permission to
-   read the gdm cookie file, see this faq for other display manager
-   cookie file names.)
-
-   Note as of Feb/2007 you can also try the -find option instead of
-   "-display ..." and see if that finds your display and Xauthority.
-
-   Less safe, but to avoid figuring out where the correct XAUTHORITY file
-   is, if the person sitting at the physical X session types "xhost
-   +localhost" then one should be able to attach x11vnc to the session
-   (from the same machine.) The person could then type "xhost -localhost"
-   after x11vnc has connected to go back to the default permissions.
-   Also, for some situations the "-users lurk=" option may soon be of use
-   (please read the documentation on the -users option.)
-
-   To test out your X11 permissions from a remote shell, set DISPLAY and
-   possibly XAUTHORITY (see your shell's man page, bash(1), tcsh(1), on
-   how to set environment variables) and type xdpyinfo in the same place
-   you will be typing (or otherwise running) x11vnc. If information is
-   printed out about the X display (screen sizes, supported extensions,
-   color visuals info) that means the X11 permissions are set up
-   properly: xdpyinfo successfully connected to DISPLAY! You could also
-   type xclock and make sure no errors are reported (a clock should
-   appear on the X display, press Ctrl-C to stop it.) If these work, then
-   typing "x11vnc" in the same environment should also work.
-
-   Important: if you cannot get your X11 permissions so that the xdpyinfo
-   or xclock tests work, x11vnc also will not work (all of these X
-   clients must be allowed to connect to the X server to function
-   properly.)
-
-   Firewalls: Speaking of permissions, it should go without saying that
-   the host-level firewall will need to be configured to allow
-   connections in on a port. E.g. 5900 (default VNC port) or 22 (default
-   SSH port for tunnelling VNC.) Most systems these days have firewalls
-   turned on by default, so you will actively have to do something to
-   poke a hole in the firewall at the desired port number. See your
-   system administration tool for Firewall settings (Yast, Firestarter,
-   etc.)
-
-
-   Q-2: I can't get x11vnc and/or libvncserver to compile.
-
-   Make sure you have gcc (or other C compiler) and all of the required
-   libraries and the corresponding -dev/-devel packages installed. These
-   include Xorg/XFree86, libX11, libjpeg, libz, libssl, ... and don't
-   forget the devs: libjpeg-dev, libssl-dev ...
-
-   The most common build problem that people encounter is that the
-   necessary X11 libraries are installed on their system however it does
-   not have the corresponding -dev/-devel packages installed. These dev
-   packages include C header files and build-time .so symlink. It is a
-   shame the current trend in distros is to not install the dev package
-   by default when the the library runtime package is installed... (it
-   diminishes the power of open source)
-
-   As of Nov/2006 here is a list of libraries that x11vnc usually likes
-   to use:
-libc.so        libX11.so       libXtst.so       libXext.so
-libXfixes.so   libXdamage.so   libXinerama.so   libXrandr.so
-libz.so        libjpeg.so      libpthread.so
-libssl.so      libcrypto.so    libcrypt.so
-
-   although x11vnc will be pretty usable with the subset: libc.so,
-   libX11.so, libXtst.so, libXext.so, libz.so, and libjpeg.so.
-
-   After running the libvncserver configure, carefully examine the output
-   and the messages in the config.log file looking for missing
-   components. For example, if the configure output looks like:
-  checking how to run the C preprocessor... gcc -E
-  checking for X... no
-  checking for XkbSelectEvents in -lX11... no
-  checking for XineramaQueryScreens in -lXinerama... no
-  checking for XTestFakeKeyEvent in -lXtst... no
-
-   or even worse:
-  checking for C compiler default output file name... configure: error:
-  C compiler cannot create executables
-  See `config.log' for more details.
-
-   there is quite a bit wrong with the build environment. Hopefully
-   simply adding -dev packages and/or gcc or make will fix it.
-
-   For Debian the list seems to be:
-  gcc
-  make
-  libc6-dev
-  libjpeg8-dev           (formerly libjpeg62-dev)
-  libx11-dev
-  x11proto-core-dev      (formerly x-dev)
-  libxext-dev
-  libxtst-dev
-  libxdamage-dev
-  libxfixes-dev
-  libxrandr-dev
-  libxinerama-dev
-  libxss-dev             (formerly xlibs-static-dev)
-  zlib1g-dev
-  libssl-dev
-  libavahi-client-dev
-  linux-libc-dev         (only needed for linux console rawfb support)
-
-   Note that depending on your OS version the above names may have been
-   changed and/or additional packages may be needed.
-
-   For Redhat the list seems to be:
-  gcc
-  make
-  glibc-devel
-  libjpeg-devel
-  libX11-devel
-  xorg-x11-proto-devel
-  libXdamage-devel
-  libXfixes-devel
-  libXrandr-devel
-  zlib-devel
-  openssl-devel
-  avahi-devel
-  kernel-headers         (only needed for linux console rawfb support)
-
-   For other distros or OS's the package names may not be the same but
-   will look similar. Also, distros tend to rename packages as well so
-   the above list may be out of date. So only use the above lists as
-   hints for the package names that are needed.
-
-   Have a look at Misc. Build Problems for additional fixes.
-
-   Note: there is growing trend in Linux and other distros to slice up
-   core X11 software into more and smaller packages. So be prepared for
-   more headaches compiling software...
-
-
-   Q-3: I just built x11vnc successfully, but when I use it my keystrokes
-   and mouse button clicks are ignored  (I am able to move the mouse
-   though.)
-
-   This is most likely due to you not having a working build environment
-   for the XTEST client library libXtst.so. The library is probably
-   present on your system, but the package installing the build header
-   file is missing.
-
-   If you were watching carefully while configure was running you would
-   have seen:
-  checking for XTestFakeKeyEvent in -lXtst... no
-
-   The solution is to add the necessary build environment package (and
-   the library package if that is missing too.) On Debian the build
-   package is libxtst-dev. Other distros/OS's may have it in another
-   package.
-
-   x11vnc will build without support for this library (e.g. perhaps one
-   wants a view-only x11vnc on a stripped down or embedded system...) And
-   at runtime it will also continue to run even if the X server it
-   connects to does not support XTEST. In both cases it cannot inject
-   keystrokes or button clicks since XTEST is needed for that (it can
-   still move the mouse pointer using the X API XWarpPointer().)
-
-   You will see a warning message something like this at run time:
-  20/03/2005 22:33:09 WARNING: XTEST extension not available (either missing fr
-om
-  20/03/2005 22:33:09   display or client library libXtst missing at build time
-.)
-  20/03/2005 22:33:09   MOST user input (pointer and keyboard) will be DISCARDE
-D.
-  20/03/2005 22:33:09   If display does have XTEST, be sure to build x11vnc wit
-h
-  20/03/2005 22:33:09   a working libXtst build environment (e.g. libxtst-dev,
-  20/03/2005 22:33:09   or other packages.)
-  20/03/2005 22:33:09 No XTEST extension, switching to -xwarppointer mode for
-  20/03/2005 22:33:09   pointer motion input.
-
-   Also, as of Nov/2006 there will be a configure build time warning as
-   well:
-  ...
-  checking for XFixesGetCursorImage in -lXfixes... yes
-  checking for XDamageQueryExtension in -lXdamage... yes
-  configure: WARNING:
-  ==========================================================================
-  A working build environment for the XTEST extension was not found (libXtst).
-  An x11vnc built this way will be only barely usable.  You will be able to
-  move the mouse but not click or type.  There can also be deadlocks if an
-  application grabs the X server.
-
-  It is recommended that you install the necessary development packages
-  for XTEST (perhaps it is named something like libxtst-dev) and run
-  configure again.
-  ==========================================================================
-
-
-   Q-4: Help, I need to run x11vnc on Solaris 2.5.1 (or other old
-   Unix/Linux) and it doesn't compile!
-
-   We apologize that x11vnc does not build cleanly on older versions of
-   Solaris, Linux, etc.: very few users are on these old releases.
-
-   We have heard that since Dec/2004 a Solaris 2.6 built x11vnc will run
-   on Solaris Solaris 2.5 and 2.5.1 (since a workaround for XConvertCase
-   is provided.)
-
-   In any event, here is a workaround for Solaris 2.5.1 (and perhaps
-   earlier and perhaps non-Solaris):
-
-   First use the environment settings (CPPFLAGS, LDFLAGS, etc.) in the
-   above Solaris build script to run the configure command. That should
-   succeed without failure. Then you have to hand edit the autogenerated
-   rfb/rfbconfig.h file in the source tree, and just before the last
-   #endif at the bottom of that file insert these workaround lines:
-struct timeval _tmp_usleep_tv;
-#define usleep(x) \
-    _tmp_usleep_tv.tv_sec  = (x) / 1000000; \
-    _tmp_usleep_tv.tv_usec = (x) % 1000000; \
-    select(0, NULL, NULL, NULL, &_tmp_usleep_tv);
-int gethostname(char *name, int namelen);
-long random();
-int srandom(unsigned int seed);
-#undef LIBVNCSERVER_HAVE_LIBPTHREAD
-#define SHUT_RDWR 2
-typedef unsigned int in_addr_t;
-#define snprintf(a, n, args...) sprintf((a), ## args)
-
-   Then run make with the Solaris build script environment, everything
-   should compile without problems, and the resulting x11vnc binary
-   should work OK. If some non-x11vnc related programs fail (e.g. test
-   programs) and the x11vnc binary is not created try "make -k" to have
-   it keep going. Similar sorts of kludges in rfb/rfbconfig.h can be done
-   on other older OS (Solaris, Linux, ...) releases.
-
-   Here are some notes for similar steps that need to be done to build on
-   SunOS 4.x
-
-   Please let us know if you had to use the above workaround (and whether
-   it worked or not.) If there is enough demand we will try to push clean
-   compilations back to earlier Solaris, Linux, etc, releases.
-
-
-   Q-5: Where can I get a precompiled x11vnc binary for my Operating
-   System?
-
-   Hopefully the build steps above and FAQ provide enough info for a
-   painless compile for most environments. Please report problems with
-   the x11vnc configure, make, etc. on your system (if your system is
-   known to compile other GNU packages successfully.)
-
-   There are precompiled x11vnc binaries built by other groups that are
-   available at the following locations:
-    Slackware:      (.tgz)  http://www.linuxpackages.net/
-
-   SuSE: (.rpm) http:/software.opensuse.org/ Gentoo: (info)
-   http://gentoo-wiki.com/ and http://gentoo-portage.com/ FreeBSD: (.tbz)
-   http://www.freebsd.org/ http://www.freshports.org/net/x11vnc NetBSD:
-   (src) http://pkgsrc.se/x11/x11vnc OpenBSD: (.tgz) http://openports.se/
-   Arch Linux: (.tgz) http://www.archlinux.org/ Nokia 770 (.deb)
-   http://mike.saunby.googlepages.com/x11vncfornokia7702 Sharp Zaurus
-   http://www.focv.com/ Debian: (.deb) http://packages.debian.org/x11vnc
-   Redhat/Fedora: (.rpm) http://packages.sw.be/x11vnc RPMforge
-   http://dag.wieers.com/rpm/packages/x11vnc/ (N.B.: unmaintained after
-   0.9.3) Solaris: (pkg) http://www.sunfreeware.com/
-
-   If the above binaries don't work and building x11vnc on your OS fails
-   (and all else fails!) you can try one of My Collection of x11vnc
-   Binaries for various OS's and x11vnc releases.
-
-   As a general note, the x11vnc program is simple enough you don't
-   really need to install a package: the binary will in most cases work
-   as is and from any location (as long as your system libraries are not
-   too old, etc.) So, for Linux distributions that are not one of the
-   above, the x11vnc binary from the above packages has a good chance of
-   working. You can "install" it by just copying the x11vnc binary to the
-   desired directory in your PATH. Tip on extracting files from a Debian
-   package: extract the archive via a command like: "ar x
-   x11vnc_0.6-2_i386.deb" and then you can find the binary in the
-   resulting data.tar.gz tar file. Also, rpm2cpio(1) is useful in
-   extracting files from rpm packages.
-
-   If you use a standalone binary like this and also want x11vnc to serve
-   up the Java VNC Viewer jar file (either SSL enabled or regular one),
-   then you will need to extract the classes subdirectory from the source
-   tarball and point x11vnc to it via the -httpdir option. E.g.:
-    x11vnc -httpdir /path/to/x11vnc-0.9.9/classes/ssl ...
-
-
-   Q-6: Where can I get a VNC Viewer binary (or source code) for the
-   Operating System I will be viewing from?
-
-   To obtain VNC viewers for the viewing side (Windows, Mac OS, or Unix)
-   try here:
-     * http://www.tightvnc.com/download.html
-     * http://www.realvnc.com/download-free.html
-     * http://sourceforge.net/projects/cotvnc/
-     * http://www.ultravnc.com/
-     * Our Enhanced TightVNC Viewer (SSVNC)
-
-       [ssvnc.gif]
-
-
-   Q-7: How can I see all of x11vnc's command line options and
-   documentation on how to use them?
-
-   Run:  x11vnc -opts   to list just the option names or run:  x11vnc
-   -help   for long descriptions about each option. The output is listed
-   here as well. Yes, x11vnc does have a lot of options, doesn't it...
-
-
-   Q-8: I don't like typing arcane command line options every time I
-   start x11vnc. What can I do? Is there a config file? Or a GUI?
-
-   You could create a shell script that calls x11vnc with your options:
-#!/bin/sh
-#
-# filename: X11vnc  (i.e. not "x11vnc")
-# It resides in a directory in $PATH. "chmod 755 X11vnc" has been run on it.
-#
-x11vnc -wait 50 -localhost -rfbauth $HOME/.vnc/passwd -display :0 $*
-
-   a similar thing can be done via aliases in your shell (bash, tcsh,
-   csh, etc..)
-
-   Or as of Jun/2004 you can use the simple $HOME/.x11vncrc config file
-   support. If that file exists, each line is taken as a command line
-   option. E.g. the above would be:
-# this is a comment in my ~/.x11vncrc file
-wait 50        # this is a comment to the end of the line.
--localhost     # note: the leading "-" is optional.
-rfbauth  /home/fred/.vnc/passwd
-display :0
-
-   As of Dec/2004 there is now a simple Tcl/Tk GUI based on the
-   remote-control functionality ("-R") that was added. The /usr/bin/wish
-   program is needed for operation. The gui is not particularly
-   user-friendly, it just provides a point and click mode to set all the
-   many x11vnc parameters and obtain help on them. It is also very useful
-   for testing. See the -gui option for more info. Examples: "x11vnc ...
-   -gui" and "x11vnc ... -gui other:0" in the latter case the gui is
-   displayed on other:0, not the X display x11vnc is polling. There is
-   also a "-gui tray" system tray mode.
-
-   [tkx11vnc.gif]
-
-   NOTE: You may need to install the "wish" or "tk" or "tk8.4" package
-   for the gui mode to work (the package name depends on your OS/distro.)
-   The tcl/tk "wish" interpreter is used. In debian (and so ubuntu too)
-   one would run "apt-get install tk" or perhaps "apt-get install tk8.4"
-
-
-   Q-9: How can I get the GUI to run in the System Tray, or at least be a
-   smaller, simpler icon?
-
-   As of Jul/2005 the gui can run in a more friendly small icon mode
-   "-gui icon" or in the system tray: "-gui tray". It has balloon status,
-   a simple menu, and a Properities dialog. The full, complicated, gui is
-   only available under "Advanced". Other improvements were added as
-   well. Try "Misc -> simple_gui" for a gui with fewer esoteric menu
-   items.
-
-   If the gui fails to embed itself in the system tray, do a retry via
-   "Window View -> icon" followed by "Window View -> tray" with the popup
-   menu.
-
-   For inexperienced users starting up x11vnc and the GUI while sitting
-   at the physical X display (not remotely), using something like "x11vnc
-   -display :0 -gui tray=setpass" might be something for them that they
-   are accustomed to in a Desktop environment (it prompts for an initial
-   password, etc.) This is a basic "Share My Desktop" usage mode.
-
-   As of Nov/2008 in x11vnc 0.9.6 there is a desktop menu item
-   (x11vnc.desktop) that runs this command:
-   x11vnc -gui tray=setpass -rfbport PROMPT -logfile %HOME/.x11vnc.log.%VNCDISP
-LAY
-
-   which also prompts for which VNC port to use and a couple other
-   parameters.
-
-
-   Q-10: How can I get x11vnc to listen on a different port besides the
-   default VNC port (5900)?
-
-   Use something like, e.g., "x11vnc -rfbport 5901" to force it to use
-   port 5901 (this is VNC display :1.) If something else is using that
-   port x11vnc will exit immediately. If you do not supply the -rfbport
-   option, it will autoprobe starting at 5900 and work its way up to 5999
-   looking for a free port to listen on. In that case, watch for the
-   PORT=59xx line to see which port it found, then subtract 5900 from it
-   for the VNC display number to enter into the VNC Viewer(s).
-
-   The "-N" option will try to match the VNC display number to the X
-   display (e.g. X11 DISPLAY of :5 (port 6005) will have VNC display :5
-   (port 5905).)
-
-   Also see the "-autoport n" option to indicated at which value the auto
-   probing should start at.
-
-
-   Q-11: My Firewall/Router doesn't allow VNC Viewers to connect to
-   x11vnc.
-
-   See the Firewalls/Routers discussion.
-
-
-   Q-12: Is it possible for a VNC Viewer and a VNC Server to connect to
-   each other even though both are behind Firewalls that block all
-   incoming connections?
-
-   This is very difficult or impossible to do unless a third machine,
-   reachable by both, is used as a relay. So we assume a third machine is
-   somehow being used as a relay.
-
-   (Update: It may be possible to do "NAT-2-NAT" without a relay machine
-   by using a UDP tunnel such as http://samy.pl/pwnat/. All that is
-   required is that both NAT firewalls allow in UDP packets from an IP
-   address to which a UDP packet has recently been sent to. If you try it
-   out let us know how it went.)
-
-   In the following discussion, we will suppose port 5950 is being used
-   on the relay machine as the VNC port for the rendezvous.
-
-   A way to rendezvous is to have the VNC Server start a reverse
-   connection to the relay machine:
-   x11vnc -connect third-machine.net:5950 ...
-
-   and the VNC viewer forward connects as usual:
-   vncviewer third-machine.net:50
-
-   Or maybe two ports would be involved, e.g. the viewer goes to display
-   :51 (5951.) It depends on the relay software being used.
-
-   What software to run on third-machine? A TCP relay of some sort could
-   be used... Try a google search on "tcp relay" or "ip relay". However,
-   note that this isn't a simple redirection because it hooks up two
-   incoming connections. You can look at our UltraVNC repeater
-   implementation ultravnc_repeater.pl for ideas and possibly to
-   customize.
-
-   Also, if you are not the admin of third-machine you'd have to convince
-   the owner to allow you to install this software (and he would likely
-   need to open his server's firewall to allow the port through.)
-
-   It is recommended that SSL is used for encryption (e.g. "-ssl SAVE")
-   when going over the internet.
-
-   We have a prototype for performing a rendezvous via a Web Server
-   acting as the relay machine. Download the vncxfer CGI script and see
-   the instructions at the top.
-
-   Once that CGI script is set up on the website, both users go to, say,
-   http://somesite.com/vncxfer (or maybe a "/cgi-bin" directory or ".cgi"
-   suffix must be used.) Previously, both have agreed on the same session
-   name (say by phone or email) , e.g. "5cows", and put that into the
-   entry form on the vncxfer starting page (hopefully separated by a few
-   seconds, so the relay helper can fully start up at the first request.)
-
-   The page returned tells them the hostname and port number and possible
-   command to use for forward (VNC Viewer) and reverse (VNC Server, i.e.
-   x11vnc) connections as described above.
-
-   Also since Oct/2007, x11vnc can connect directly (no web browser),
-   like this:
-   x11vnc ... -connect localhost:0 -proxy 'http://somesite.com/vncxfer?session=
-5cows&'
-
-   Unfortunately the prototype requires that the Web server's firewall
-   allow in the port (e.g. 5950) used for the rendezvous. Most web
-   servers are not configured to do this, so you would need to ask the
-   admin to do this for you. Nearly all free webspace sites, e.g.
-   www.zendurl.com, will not allow your CGI script to be an open relay
-   like this. (If you find one that does allow this, let me know!)
-
-   Maybe someday a clever trick will be thought up to relax the listening
-   port requirement (e.g. use HTTP/CGI itself for the transfer... it is
-   difficult to emulate a full-duplex TCP connection with them.)
-
-   See also the Firewalls/Routers discussion and Reverse Connection Proxy
-   discussion.
-
-
-   SSH method: If both users (i.e. one on Viewer-side and the other on
-   x11vnc server side) have SSH access to a common machine on the
-   internet (or otherwise mutually reachable), then SSH plumbing can be
-   used to solve this problem. The users create SSH tunnels going through
-   the SSH login machine.
-
-   Instead of assuming port 5900 is free on the SSH machine, we will
-   assume both users agreed to use 5933. This will illustrate how to use
-   a different port for the redir. It could be any port, what matters is
-   that both parties refer to the same one.
-
-   Set up the Tunnel from the VNC Server side:
-   ssh -t -R 5933:localhost:5900 user at third-machine.net
-
-   Set up the Tunnel from the VNC Viewer side:
-   ssh -t -L 5900:localhost:5933 user at third-machine.net
-
-   Run Server on the VNC Server side:
-   x11vnc -rfbport 5900 -localhost ...
-
-   Run Viewer on the VNC Viewer side:
-   vncviewer -encodings "copyrect tight zrle hextile" localhost:0
-
-   (we assume the old-style -encodings option needs to be used. See here
-   for details.)
-
-   If the SSH machine has been configured (see sshd_config(5)) with the
-   option GatewayPorts=yes, then the tunnel set up by the VNC Server will
-   be reachable directly by the VNC viewer (as long as the SSH machine's
-   firewall does not block the port, 5933 in this example.) So in that
-   case the Viewer side does not need to run any ssh command, but rather
-   only runs:
-   vncviewer third-machine.net:33
-
-   In this case we recommend SSL be used for encryption.
-
-   The creation of both tunnels can be automated. As of Oct/2007 the -ssh
-   x11vnc option is available and so only this command needs to be run on
-   the VNC Server side:
-   x11vnc -ssh user at third-machine.net:33 ...
-
-   (the SSH passphrase may need to be supplied.)
-
-   To automate on the VNC Viewer side, the user can use the Enhanced
-   TightVNC Viewer (SSVNC) by:
-     * Clicking on 'Use SSH'
-     * Entering user at third-machine.net:33 into 'VNC Host:Display' entry
-       box
-     * Clicking on 'Connect'
-
-   As above, if the SSH GatewayPorts=yes setting is configured the Viewer
-   side doesn't need to create a SSH tunnel. In SSVNC the Viewer user
-   could instead select 'Use SSL' and then, e.g., on the Server side
-   supply "-ssl SAVE" to x11vnc. Then end-to-end SSL encryption would be
-   used (in addition to the SSH encryption on the Server-side leg.)
-
-
-   Q-13: Can I make x11vnc more quiet and also go into the background
-   after starting up?
-
-   Use the -q and -bg options, respectively.  (also: -quiet is an alias
-   for -q)
-
-   Note that under -bg the stderr messages will be lost unless you use
-   the "-o logfile" option.
-
-
-   Q-14: Sometimes when a VNC viewer dies abruptly, x11vnc also dies with
-   the error message like: "Broken pipe". I'm using the -forever mode and
-   I want x11vnc to keep running.
-
-   As of Jan/2004 the SIGPIPE signal is ignored. So if a viewer client
-   terminates abruptly, libvncserver will notice on the next I/O
-   operation and will close the connection and continue on.
-
-   Up until of Apr/2004 the above fix only works for BSD signal systems
-   (Linux, FreeBSD, ...) For SYSV systems there is a workaround in place
-   since about Jun/2004.
-
-
-   Q-15: The Windows TightVNC 1.3.9 Viewer cannot connect to x11vnc.
-
-   This appears to be fixed in x11vnc version 0.9 and later. If you need
-   to use an earlier version of x11vnc, try using the "-rfbversion 3.7"
-   option. In general sometimes one can get a misbehaving viewer to work
-   by supplying rfb versions 3.7 or 3.3.
-
-
-   Q-16: KDE's krdc VNC viewer cannot connect to x11vnc.
-
-   This has been fixed in x11vnc version 0.8.4. More info here, here, and
-   here.
-
-
-   Q-17: When I start x11vnc on an Alpha Tru64 workstation the X server
-   crashes!
-
-   This is a bug in the X server obviously; an X client should never be
-   able to crash it.
-
-   The problem seems to be with the RECORD X extension and so a
-   workaround is to use the "-noxrecord" x11vnc command line option.
-
-
-   Q-18: When running x11vnc on an IBM AIX workstation after a few
-   minutes the VNC connection freezes.
-
-   One user reports when running x11vnc on AIX 5.3 in his CDE session
-   after a few minutes or seconds x11vnc will "freeze" (no more updates
-   being sent, etc.) The freezing appeared to be worse for versions later
-   than 0.9.2.
-
-   The problem seems to be with the RECORD X extension on AIX and so a
-   workaround is to use the "-noxrecord" x11vnc command line option. The
-   user found no freezes occurred when using that option.
-
-
-   Q-19: Are there any build-time customizations possible, e.g. change
-   defaults, create a smaller binary, etc?
-
-   There are some options. They are enabled by adding something like
-   -Dxxxx=1 to the CPPFLAGS environment variable before running configure
-   (see the build notes for general background.)
-/*
- * Mar/2006
- * Build-time customization via CPPFLAGS.
- *
- * Summary of options to include in CPPFLAGS for custom builds:
- *
- * -DVNCSHARED  to have the vnc display shared by default.
- * -DFOREVER  to have -forever on by default.
- * -DNOREPEAT=0  to have -repeat on by default.
- * -DADDKEYSYMS=0  to have -noadd_keysyms the default.
- *
- * -DREMOTE_DEFAULT=0  to disable remote-control on by default (-yesremote.)
- * -DREMOTE_CONTROL=0  to disable remote-control mechanism completely.
- * -DEXTERNAL_COMMANDS=0  to disable the running of all external commands.
- * -DFILEXFER=0  disable filexfer.
- *
- * -DHARDWIRE_PASSWD=...      hardwired passwords, quoting necessary.
- * -DHARDWIRE_VIEWPASSWD=...
- * -DNOPW=1                   make -nopw the default (skip warning)
- * -DUSEPW=1                  make -usepw the default
- * -DPASSWD_REQUIRED=1        exit unless a password is supplied.
- * -DPASSWD_UNLESS_NOPW=1     exit unless a password is supplied and no -nopw.
- *
- * -DWIREFRAME=0  to have -nowireframe as the default.
- * -DWIREFRAME_COPYRECT=0  to have -nowirecopyrect as the default.
- * -DWIREFRAME_PARMS=...   set default -wirecopyrect parameters.
- * -DSCROLL_COPYRECT=0     to have -noscrollcopyrect as the default.
- * -DSCROLL_COPYRECT_PARMS=...  set default -scrollcopyrect parameters.
- * -DSCALING_COPYRECT=0
- * -DXDAMAGE=0    to have -noxdamage as the default.
- * -DSKIPDUPS=0   to have -noskip_dups as the default or vice versa.
- *
- * -DPOINTER_MODE_DEFAULT={0,1,2,3,4}  set default -pointer_mode.
- * -DBOLDLY_CLOSE_DISPLAY=0  to not close X DISPLAY under -rawfb.
- * -DSMALL_FOOTPRINT=1  for smaller binary size (no help, no gui, etc)
- *                      use 2 or 3 for even smaller footprint.
- * -DNOGUI  do not include the gui tkx11vnc.
- * -DPOLL_8TO24_DELAY=N
- * -DDEBUG_XEVENTS=1  enable printout for X events.
- *
- * Set these in CPPFLAGS before running configure. E.g.:
- *
- *   % env CPPFLAGS="-DFOREVER -DREMOTE_CONTROL=0" ./configure
- *   % make
- */
-
-   If other things (e.g. "-I ...") are needed in CPPFLAGS add them as
-   well.
-
-   On some systems is seems you need to set LC_ALL=C for configure to
-   work properly...
-
-   Be careful the following two variables: HARDWIRE_PASSWD and
-   HARDWIRE_VIEWPASSWD. If set (remember to include the double quotes
-   around the string), they will be used as default values for the
-   -passwd and -viewpasswd options. Of course the strings will exist
-   unobscured in the x11vnc binary: it better not be readable by
-   unintendeds. Perhaps this is of use in remote access for an embedded
-   application, etc...
-
-   Let us know if more build-time customizations would be useful.
-
-
-   [Win2VNC Related]
-
-   Q-20: I have two separate machine displays in front of me, one Windows
-   the other X11: can I use x11vnc in combination with Win2VNC in
-   dual-screen mode to pass the keystrokes and mouse motions to the X11
-   display?
-
-   Yes, for best response start up x11vnc with the "-nofb" option
-   (disables framebuffer polling, and does other optimizations) on the
-   secondary display (X11) machine. Then start up Win2VNC on the primary
-   display (Windows) referring it to the secondary display.
-
-   This will also work X11 to X11 using x2vnc, however you would probably
-   just want to avoid VNC and use x2x for that.
-
-   For reference, here are some links to Win2VNC-like programs for
-   multiple monitor setups:
-     * Original Win2VNC
-     * Enhanced Win2VNC (broken?) and sourceforge link
-     * x2vnc
-     * x2x
-     * zvnc (MorphOS)
-
-   All of them will work with x11vnc (except x2x where it is not needed.)
-
-
-   Q-21: I am running Win2VNC on my Windows machine and "x11vnc -nofb" on
-   Unix to pass keyboard and mouse to the Unix monitor. Whenever I start
-   Win2VNC it quickly disconnects and x11vnc says:
-   rfbProcessClientNormalMessage: read: Connection reset by peer
-
-   Is the default visual of the X display you run x11vnc on low color
-   (e.g. 8 bit per pixel PseudoColor)? (you can run xdpyinfo to check,
-   look in the "screen" section.) There seems to be a bug in Win2VNC in
-   that it cannot deal correctly with colormaps (PseudoColor is the most
-   common example of a visual with a colormap.)
-
-   If so, there are a couple options. 1) Can you set the default visual
-   on your display to be depth 24 TrueColor? Sun machines often have 8+24
-   overlay/multi-depth visuals, and you can make the default visual depth
-   24 TrueColor (see fbconfig(1) and Xsun(1).) 2) As of Feb/2004 x11vnc
-   has the -visual option to allow you to force the framebuffer visual to
-   whatever you want (this usually messes up the colors unless you are
-   very clever.) In this case, the option provides a convenient
-   workaround for the Win2VNC bug:
-  x11vnc -nofb -visual TrueColor -display :0 ...
-
-   So the visual will be set to 8bpp TrueColor and Win2VNC can handle
-   this. Since Win2VNC does not use the framebuffer data there should be
-   no problems in doing this.
-
-   Q-22: Can I run "x11vnc -nofb" on a Mac OS X machine to redirect mouse
-   and keyboard input to it from Windows and X11 machines via Win2VNC and
-   x2vnc, respectively?
-
-   Yes, as of Nov/2006 you can. There may be a trick or two you'll need
-   to do to get the Clipboard exchange between the machines to work.
-
-
-
-   [Color Issues]
-
-   Q-23: The X display I run x11vnc on is only 8 bits per pixel (bpp)
-   PseudoColor (i.e. only 256 distinct colors.) The x11vnc colors may
-   start out OK, but after a while they are incorrect in certain windows.
-
-   Use the -flashcmap option to have x11vnc watch for changes in the
-   colormap, and propagate those changes back to connected clients. This
-   can be slow (since the whole screen must be updated over the network
-   whenever the colormap changes.) This flashing colormap behavior often
-   happens if an application installs its own private colormap when the
-   mouse is in its window. "netscape -install" is a well-known historical
-   example of this. Consider reconfiguring the system to 16 bpp or depth
-   24 TrueColor if at all possible.
-
-   Also note the option -8to24 (Jan/2006) can often remove the need for
-   flashing the colormap. Everything is dynamically transformed to depth
-   24 at 32 bpp using the colormaps. There may be painting errors however
-   (see the following FAQ for tips on reducing and correcting them.)
-
-   In some rare cases (SCO unixware) the -notruecolor option has
-   corrected colors on 8bpp displays. The red, green, and blue masks were
-   non-zero in 8bpp PseudoColor on an obscure setup, and this option
-   corrected the problems.
-
-
-   Q-24: Color problems: Why are the colors for some windows incorrect in
-   x11vnc? BTW, my X display has nice overlay/multi-depth visuals of
-   different color depths: e.g. there are both depth 8 and 24 visuals
-   available at the same time.
-
-   You may want to review the previous question regarding 8 bpp
-   PseudoColor.
-
-   On some hardware (Sun/SPARC and SGI), the -overlay option discussed a
-   couple paragraphs down may solve this for you (you may want to skip to
-   it directly.) On other hardware the less robust -8to24 option may help
-   (also discussed below.)
-
-   Run xdpyinfo(1) to see what the default visual is and what the depths
-   of the other visuals are. Does the default visual have a depth of 8
-   but there are other visuals of depth 24? If it does, can you possibly
-   re-configure your X server to make a depth 24 visual the default? If
-   you can do it, this will save you a lot of grief WRT colors and x11vnc
-   (and for general usage too!) Here is how I do this on an old
-   Sparcstation 20 running Solaris 9 with SX graphics
-  xinit -- -dev /dev/fb defclass TrueColor defdepth 24
-
-   and it works nicely (note: to log into console from the dtlogin
-   window, select "Options -> Command Line Login", then login and enter
-   the above command.) See the -dev section of the Xsun(1) manpage for a
-   description of the above arguments. If you have root permission, a
-   more permanent and convenient thing to do is to record the arguments
-   in a line like:
-  :0  Local local_uid at console root /usr/openwin/bin/Xsun -dev /dev/fb defclass
-TrueColor defdepth 24
-
-   in /etc/dt/config/Xservers (copy /usr/dt/config/Xservers.) Also look
-   at the fbconfig(1) and related manpages (e.g. ffbconfig, m64config,
-   pgxconfig, SUNWjfb_config, etc ...) for hardware framebuffer settings
-   that may achieve the same effect.
-
-   In general for non-Sun machines, look at the "-cc class" and related
-   options in your X server manpage (perhaps Xserver(1)), it may allow
-   modifying the default visual (e.g. "-cc 4", see <X11/X.h> for the
-   visual class numbers.) On XFree86 some video card drivers (e.g. Matrox
-   mga) have settings like Option "Overlay" "24,8" to support multi-depth
-   overlays. For these, use the "-cc 4" X server command line option to
-   get a depth 24 default visual.
-
-
-   The -overlay mode: Another option is if the system with overlay
-   visuals is a Sun system running Solaris or SGI running IRIX you can
-   use the -overlay x11vnc option (Aug/2004) to have x11vnc use the
-   Solaris XReadScreen(3X11) function to poll the "true view" of the
-   whole screen at depth 24 TrueColor. XReadDisplay(3X11) is used on
-   IRIX. This is useful for Legacy applications (older versions of
-   Cadence CAD apps are mentioned by x11vnc users) that require the
-   default depth be 8bpp, or the app will use a 8bpp visual even if depth
-   24 visuals are available, and so the default depth workaround
-   described in the previous paragraph is not sufficient for these apps.
-
-   It seems that Xorg is working toward supporting XReadDisplay(3X11) as
-   part of the RENDER extension work. When it does support it and
-   provides a library API x11vnc will be modified to take advantage of
-   the feature to support -overlay on Linux, *BSD, etc. Until then see
-   the -8to24 mode below.
-
-   Misc. notes on -overlay mode: An amusing by-product of -overlay mode
-   is that the mouse cursor shape is correct! (i.e. XFIXES is not
-   needed.) The -overlay mode may be somewhat slower than normal mode due
-   to the extra framebuffer manipulations that must be performed. Also,
-   on Solaris there is a bug in that for some popup menus, the windows
-   they overlap will have painting errors (flashing colors) while the
-   popup is up (a workaround is to disable SaveUnders by passing -su to
-   Xsun, e.g. in your /etc/dt/config/Xservers file.)
-
-
-   The -8to24 mode: The -8to24 x11vnc option (Jan/2006) is a kludge to
-   try to dynamically rewrite the pixel values so that the 8bpp part of
-   the screen is mapped onto depth 24 TrueColor. This is less robust than
-   the -overlay mode because it is done by x11vnc outside of the X
-   server. So only use it on OS's that do not support -overlay. The
-   -8to24 mode will work if the default visual is depth 24 or depth 8. It
-   scans for any windows within 3 levels of the root window that are 8bpp
-   (i.e. legacy application), or in general ones that are not using the
-   default visual. For the windows it finds it uses XGetSubImage() to
-   retrieve the pixels values and uses the correct indexed colormap to
-   create a depth 24 TrueColor view of the whole screen. This depth 24,
-   32bpp view is exported via VNC.
-
-   Even on pure 8bpp displays it can be used as an alternative to
-   -flashcmap to avoid color flashing completely.
-
-   This scheme is approximate and can often lead to painting errors. You
-   can manually correct most painting errors by pressing 3 Alt_L's in a
-   row, or by using something like: -fixscreen V=3.0 to automatically
-   refresh the screen every 3 seconds. Also -fixscreen 8=3.0 has been
-   added to just refresh the non-default visual parts of the screen.
-
-   In general the scheme uses many resources and may give rise to
-   sluggish behavior. If multiple windows are using different 8bpp
-   indexed colormaps all but one window may need to be iconified for the
-   colors to be correct. There are a number of tunable parameters to try
-   to adjust performance and painting accuracy. The option -8to24
-   nogetimage can give a nice speedup if the default depth 24 X server
-   supports hiding the 8bpp bits in bits 25-32 of the framebuffer data.
-   On very slow machines -8to24 poll=0.2,cachewin=5.0 gives an useful
-   speedup. See the -8to24 help description for information on tunable
-   parameters, etc.
-
-
-   Colors still not working correctly? Run xwininfo on the application
-   with the incorrect colors to verify that the depth of its visual is
-   different from the default visual depth (gotten from xdpyinfo.) One
-   possible workaround in this case is to use the -id option to point
-   x11vnc at the application window itself. If the application is
-   complicated (lots of toplevel windows and popup menus) this may not be
-   acceptable, and may even crash x11vnc (but not the application.) See
-   also -appshare.
-
-   It is theoretically possible to solve this problem in general (see
-   xwd(1) for example), but it does not seem trivial or sufficiently fast
-   for x11vnc to be able to do so in real time. The -8to24 method does
-   this approximately and is somewhat usable. Fortunately the -overlay
-   option works for Solaris machines with overlay visuals where most of
-   this problem occurs.
-
-
-   Q-25: I am on a high color system (depth >= 24) but I seem to have
-   colormap problems. They either flash or everything is very dark.
-
-   This can happen if the default Visual (use xdpyinfo to list them) is
-   DirectColor instead of TrueColor. These are both usually used in high
-   color modes, but whereas TrueColor uses static ramps for the Red,
-   Green, and Blue components, DirectColor has arbitrary colormaps for
-   the Red, Green, and Blue Components. Currently x11vnc cannot decode
-   these colormaps and treats them just like TrueColor.
-
-   The only workaround so far is to restart the X server with the "-cc 4"
-   option to force TrueColor as the default visual (DirectColor is "-cc
-   5"; see /usr/include/X11/X.h.) The only place we have seen this is
-   with the virtual framebuffer server Xvfb on Xorg 7.2. So in that case
-   you probably should restart it with something like this: "Xvfb :1 -cc
-   4 -screen 0 1280x1024x24". It should be possible for x11vnc to handle
-   DirectColor, but this hasn't been implemented due to its rare usage.
-
-   You may also see this problem on an X display with a TrueColor default
-   visual where an application chooses a DirectColor visual for its
-   window(s). It seems the application also needs to install its own
-   colormap for the visual for the colors to be messed up in x11vnc. One
-   can make xwud do this for example.
-
-
-   Q-26: How do I figure out the window id to supply to the -id windowid
-   option?
-
-   Run the xwininfo program in a terminal. It will ask you to click on
-   the desired application window. After clicking, it will print out much
-   information, including the window id (e.g. 0x6000010.) Also, the
-   visual and depth of the window printed out is often useful in
-   debugging x11vnc color problems.
-
-   Also, as of Dec/2004 you can use "-id pick" to have x11vnc run
-   xwininfo(1) for you and after you click the window it extracts the
-   windowid. Besides "pick" there is also "id:root" to allow you to go
-   back to root window when doing remote-control.
-
-
-   Q-27: Why don't menus or other transient windows come up when I am
-   using the -id windowid option to view a single application window?
-
-   This is related to the behavior of the XGetImage(3X11) and
-   XShmGetImage() interfaces regarding backingstore, saveunders, etc. The
-   way the image is retrieved depends on some aspects of how the X server
-   maintains the display image data and whether other windows are
-   clipping or obscuring it. See the XGetImage(3X11) man page for more
-   details. If you disable BackingStore and SaveUnders in the X server
-   you should be able to see these transient windows.
-
-   If things are not working and you still want to do the single window
-   polling, try the -sid windowid option ("shifted" windowid.)
-
-   Update: as of Nov/2009 in the 0.9.9 x11vnc development tarball, there
-   is an experimental Application Sharing mode that improves upon the
-   -id/-sid single window sharing: -appshare (run "x11vnc -appshare
-   -help" for more info.) It is still very primitive and approximate, but
-   at least it displays multiple top-level windows.
-
-
-   Q-28: My X display is depth 24 at 24bpp (instead of the normal depth
-   24 at 32bpp.) I'm having lots of color and visual problems with x11vnc
-   and/or vncviewer. What's up?
-
-   First off, depth 24 at 24bpp (bpp=bits-per-pixel) is fairly uncommon
-   and can cause problems in general. It also can be slower than depth 24
-   at 32bpp. You might want to switch to 32bpp (for XFree86 see the
-   "-fbbpp 32", DefaultFbBpp, FbBpp and related options.) Perhaps you
-   have 24bpp because the video memory of the machine is low and the
-   screen wouldn't fit in video RAM at 32bpp. For this case depth 16 at
-   16bpp might be an acceptable option.
-
-   In any event x11vnc should handle depth 24 at 24bpp (although
-   performance may be slower, and you may need to use the ZRLE encoding
-   instead of Tight.) There are some caveats involving the viewer
-   however:
-
-   The RealVNC Unix viewer cannot handle 24bpp from the server, it will
-   say: "main: setPF: not 8, 16 or 32 bpp?" and exit. I have not checked
-   the RealVNC Windows viewer.
-
-   So you need to use the TightVNC Unix viewer. However there are some
-   problems with that too. It seems libvncserver does not do 24bpp
-   correctly with the Tight encoding. The colors and screen ultimately
-   get messed up. So you have to use a different encoding with the
-   TightVNC vncviewer, try "zlib", "hextile", or one of the other
-   encodings (e.g. vncviewer -encodings "zlib hextile" ....) I have not
-   checked the TightVNC or UltraVNC Windows viewers.
-
-   It appears the older RealVNC Unix viewers (e.g. 3.3.3 and 3.3.7) can
-   handle 24bpp from the server, so you may want to use those. They
-   evidently request 32 bpp and libvncserver obliges.
-
-   Update: as of Apr/2006 you can use the -24to32 option to have x11vnc
-   dynamically transform the 24bpp pixel data to 32bpp. This extra
-   transformation could slow things down further however.
-
-   Now coming the opposite direction if you are running the vncviewer on
-   the 24bpp display, TightVNC will fail with "Can't cope with 24
-   bits-per-pixel. Sorry." and RealVNC will fail with "main: Error:
-   couldn't find suitable pixmap format" so evidently you cannot use
-   24bpp for the vncviewers to work on that X display.
-
-   Note, however, that the Unix viewer in the Enhanced TightVNC Viewer
-   (SSVNC) project can handle 24bpp X displays. It does this by
-   requesting a 16bpp pixel format (or 8bpp if the -bgr233 option has
-   been supplied) from the VNC server, and translates that to 24bpp
-   locally.
-   [Xterminals]
-
-   Q-29: Can I use x11vnc to view and interact with an Xterminal (e.g.
-   NCD) that is not running UNIX and so x11vnc cannot be run on it
-   directly?
-
-   You can, but it will likely be very wasteful of network bandwidth
-   since you will be polling the X display over the network as opposed to
-   over the local hardware. To do this, run x11vnc on a UNIX machine as
-   close as possible network-wise (e.g. same switch) to the Xterminal
-   machine. Use the -display option to point the display to that of the
-   Xterminal (you'll of course need basic X11 permission to do that) and
-   finally supply the -noshm option (this enables the polling over the
-   network.)
-
-   If the Xterminal's X display is open to the network for connections,
-   you might use something like "-display xterm123:0". If you are trying
-   to do this via an SSH tunnel (assuming you can actually ssh into the
-   Xterminal) it will be a little tricky (either use the ssh "-R" option
-   or consider ssh-ing in the other direction.) In all cases the X11
-   permissions need to allow the connection.
-
-   The response will likely be sluggish (maybe only one "frame" per
-   second.) This mode is not recommended except for "quick checks" of
-   hard to get to X servers. Use something like "-wait 150" to cut down
-   on the polling rate. You may also need -flipbyteorder if the colors
-   get messed up due to endian byte order differences.
-
-   Q-30: How do I get my X permissions (MIT-MAGIC-COOKIE file) correct
-   for a Unix/Linux machine acting as an Xterminal?
-
-   If the X display machine is a traditional Xterminal (where the X
-   server process runs on the Xterminal box, but all of the X client
-   applications (firefox, etc) run on a central server (aka "terminal
-   server")), you will need to log into the Xterminal machine (i.e. get a
-   shell running there) and then start the x11vnc program. If the
-   Xterminal Linux/Unix machine is stripped down (e.g. no users besides
-   root) that may be difficult.
-
-   The next problem is the login Display Manager (e.g. gdm, kdm), and
-   hence the MIT-MAGIC-COOKIE auth files, are on the central server and
-   not on the Xterminal box where the X server and x11vnc processes are.
-
-   So unless X permissions are completely turned off (e.g. "xhost +"), to
-   run the x11vnc process on the Xterminal box the MIT-MAGIC-COOKIE auth
-   file data (XAUTHORITY or $HOME/.Xauthority) must be accessible by or
-   copied to the Xterminal. If $HOME/.Xauthority is exported via NFS
-   (this is insecure of course, but has been going on for decades), then
-   x11vnc can simply pick it up via NFS (you may need to use the -auth
-   option to point to the correct file.) Other options include copying
-   the auth file using scp, or something like:
-  central-server>  xauth nextract - xterm123:0 | ssh xterm123 xauth nmerge -
-
-   and then, say, ssh from central-server to xterm123 to start x11vnc.
-   Here "xterm123" refers to the computer acting as the Xterminal and
-   "central-server" is the terminal server. You can use "xauth -f
-   /path/to/cookie-file list" to examine the contents of the cookie(s) in
-   a file "/path/to/cookie-file". See the xauth(1) manpage for more
-   details.
-
-   If the display name in the cookie file needs to be changed between the
-   two hosts, see this note on the "xauth add ..." command.
-
-   A less secure option is to run something like "xhost +127.0.0.1" while
-   sitting at the Xterminal box to allow cookie-free local access for
-   x11vnc. You can run "xhost -127.0.0.1" after x11vnc connects if you
-   want to go back to the original permissions.
-
-   If the Xterminal is really stripped down and doesn't have any user
-   accounts, NFS, etc. you'll need to contact your system administrator
-   to set something up. It can be done!!!  Some Xterminal projects have
-   actually enabled "run locally" facilities for the running of an
-   occasional app more efficiently locally on the Xterminal box (e.g.
-   realplayer.)
-
-   Not recommended, but as a last resort, you could have x11vnc poll the
-   Xterminal Display over the network. For this you would run a "x11vnc
-   -noshm ..." process on the central-server (and hope the network admin
-   doesn't get angry...)
-
-   Note: use of Display Manager (gdm, kdm, ...) auth cookie files (i.e.
-   from /var/...,  /tmp/..., or elsewhere) may require modification via
-   xauth(1) to correctly include the display x11vnc refers to (e.g.
-   "xauth -f cookie-file add :0 . 45be51ae2ce9dfbacd882ab3ef8e96b1",
-   where the "45be51..." cookie value was found from an "xauth -f
-   /path/to/original/cookie-file list") or other reasons. See xauth(1)
-   manpage for full details on how to transfer an MIT-MAGIC-COOKIE
-   between machines and displays.
-
-   VNCviewer performance on Xterminals:  This isn't related to x11vnc on
-   Xterminals, but we mention it here anyway because of the similar
-   issues. If you are on an Xterminal and want to use vncviewer to
-   connect to a VNC server somewhere, then performance would be best if
-   you ran the viewer on the Xterminal box. Otherwise, (i.e. running the
-   viewer process on the central-server) all of the vncviewer screen
-   drawing is done more inefficiently over the network. Something to
-   consider, especially on a busy network. (BTW, this has all of the
-   above permission, etc, problems: both vncviewer and x11vnc are X
-   client apps desired to be run on the Xterminal box.)
-
-   [Sun Rays]
-
-   Q-31: I'm having trouble using x11vnc with my Sun Ray session.
-
-   The Sun Ray technology is a bit like "VNC done in hardware" (the Sun
-   Ray terminal device, DTU, playing the role of the vncviewer.)
-   Completely independent of that, the SunRay user's session is still an
-   X server that speaks the X11 protocol and so x11vnc simply talks to
-   the X server part to export the SunRay desktop to any place in the
-   world (i.e. not only to a Sun Ray terminal device), creating a sort of
-   "Soft Ray". Please see this discussion of Sun Ray issues for solutions
-   to problems.
-
-   Also see the Sun Ray Remote Control Toolkit that uses x11vnc.
-
-   [Remote Control]
-
-   Q-32: How do I stop x11vnc once it is running in the background?
-
-   As of Dec/2004 there is a remote control feature. It can change a huge
-   number of parameters on the fly: see the -remote and -query options.
-   To shut down the running x11vnc server just type "x11vnc -R stop". To
-   disconnect all clients do "x11vnc -R disconnect:all", etc.
-
-   If the -forever option has not been supplied, x11vnc will
-   automatically exit after the first client disconnects. In general if
-   you cannot use the remote control, then you will have to kill the
-   x11vnc process This can be done via: "kill NNNNN" (where NNNNN is the
-   x11vnc process id number found from ps(1)), or "pkill x11vnc", or
-   "killall x11vnc" (Linux only.)
-
-   If you have not put x11vnc in the background via the -bg option or
-   shell & operator, then simply press Ctrl-C in the shell where x11vnc
-   is running to stop it.
-
-   Potential Gotcha: If somehow your Keypress of Ctrl-C went through
-   x11vnc to the Xserver that then delivered it to x11vnc it is possible
-   one or both of the Ctrl or C keys will be left stuck in the pressed
-   down state in the Xserver. Tapping the stuck key (either via a new
-   x11vnc or at the physical console) will release it from the stuck
-   state. If the keyboard seems to be acting strangely it is often fixed
-   by tapping Ctrl, Shift, and Alt. Alternatively, the -clear_mods option
-   and -clear_keys option can be used to release pressed keys at startup
-   and exit. The option -clear_all will also try to unset Caps_Lock,
-   Num_Lock, etc.
-
-
-   Q-33: Can I change settings in x11vnc without having to restart it?
-   Can I remote control it?
-
-   Look at the -remote (an alias is -R) and -query (an alias is -Q)
-   options added in Dec/2004. They allow nearly everything to be changed
-   dynamically and settings to be queried. Examples: "x11vnc -R shared",
-   "x11vnc -R forever", "x11vnc -R scale:3/4", "x11vnc -Q modtweak",
-   "x11vnc -R stop", "x11vnc -R disconnect:all", etc..
-
-   These commands do not start a x11vnc server, but rather communicate
-   with one that is already running. The X display (X11VNC_REMOTE
-   property) is used as the communication channel, so the X permissions
-   and DISPLAY must be set up correctly for communication to be possible.
-
-   There is also a simple Tcl/Tk gui based on this remote control
-   mechanism. See the -gui option for more info. You will need to have
-   Tcl/Tk (i.e. /usr/bin/wish) installed for it to work. It can also run
-   in the system tray: "-gui tray" or as a standalone small icon window:
-   "-gui icon". Use "-gui tray=setpass" for a naive user "Share My
-   Desktop" mode.
-
-   [Security and Permissions]
-
-   Q-34: How do I create a VNC password for use with x11vnc?
-
-   You may already have one in $HOME/.vnc/passwd if you have used, say,
-   the vncserver program from the regular RealVNC or TightVNC packages
-   (i.e. launching the Xvnc server.) Otherwise, you could use the
-   vncpasswd(1) program from those packages.
-
-   As of Jun/2004 x11vnc supports the -storepasswd "pass" "file" option,
-   which is the same functionality of storepasswd. Be sure to quote the
-   "pass" if it contains shell meta characters, spaces, etc. Example:
-  x11vnc -storepasswd 'sword*fish' $HOME/myvncpasswd
-
-   You then use the password via the x11vnc option: "-rfbauth
-   $HOME/myvncpasswd"
-
-   As of Jan/2006 if you do not supply any arguments:
-  x11vnc -storepasswd
-
-   you will be prompted for a password to save to ~/.vnc/passwd (your
-   keystrokes when entering the password will not be echoed to the
-   screen.) If you supply one argument, e.g. "x11vnc -storepasswd
-   ~/.mypass", the password you are prompted for will be stored in that
-   file.
-
-   x11vnc also has the -passwdfile and -passwd/-viewpasswd plain text
-   (i.e. not obscured like the -rfbauth VNC passwords) password options.
-
-   You can use the -usepw option to automatically use any password file
-   you have in ~/.vnc/passwd or ~/.vnc/passwdfile (the latter is used
-   with the -passwdfile option.)
-
-  x11vnc -usepw -display :0 ...
-
-   If neither file exists you are prompted to store a password in
-   ~/.vnc/passwd. If a password file cannot be found or created x11vnc
-   exits immediately. An admin may want to set it up this way for users
-   who do not know better.
-
-
-   Q-35: Can I make it so -storepasswd doesn't show my password on the
-   screen?
-
-   You can use the vncpasswd program from RealVNC or TightVNC mentioned
-   above. As of Jan/2006 the -storepasswd option without any arguments
-   will not echo your password as you type it and save the file to
-   ~/.vnc/passwd:
-  # x11vnc -storepasswd
-  Enter VNC password:
-  Verify password:
-  Write password to /home/myname/.vnc/passwd?  [y]/n
-  Password written to: /home/myname/.vnc/passwd
-
-   You can also give it an alternate filename, e.g. "x11vnc -storepasswd
-   ~/.mypass"
-
-
-   Q-36: Can I have two passwords for VNC viewers, one for full access
-   and the other for view-only access to the display?
-
-   Yes, as of May/2004 there is the -viewpasswd option to supply the
-   view-only password. Note the full-access password option -passwd must
-   be supplied at the same time. E.g.: -passwd sword -viewpasswd fish.
-
-   To avoid specifying the passwords on the command line (where they
-   could be observed via the ps(1) command by any user) you can use the
-   -passwdfile option to specify a file containing plain text passwords.
-   Presumably this file is readable only by you, and ideally it is
-   located on the machine x11vnc is run on (to avoid being snooped on
-   over the network.) The first line of this file is the full-access
-   password. If there is a second line in the file and it is non-blank,
-   it is taken as the view-only password. (use "__EMPTY__" to supply an
-   empty one.)
-
-   View-only passwords currently do not work for the -rfbauth password
-   option (standard VNC password storing mechanism.) FWIW, note that
-   although the output (usually placed in $HOME/.vnc/passwd) by the
-   vncpasswd or storepasswd programs (or from x11vnc -storepasswd) looks
-   encrypted they are really just obscured to avoid "casual" password
-   stealing. It takes almost no skill to figure out how to extract the
-   plain text passwords from $HOME/.vnc/passwd since it is very
-   straight-forward to work out what to do from the VNC source code.
-
-
-   Q-37: Can I have as many full-access and view-only passwords as I
-   like?
-
-   Yes, as of Jan/2006 in the libvncserver CVS the -passwdfile option has
-   been extended to handle as many passwords as you like. You put the
-   view-only passwords after a line __BEGIN_VIEWONLY__.
-
-   You can also easily annotate and comment out passwords in the file.
-   You can have x11vnc re-read the file dynamically when it is modified.
-
-
-   Q-38: Does x11vnc support Unix usernames and passwords? Can I further
-   limit the set of Unix usernames who can connect to the VNC desktop?
-   Update: as of Feb/2006 x11vnc has the -unixpw option that does this
-   outside of the VNC protocol and libvncserver. The standard su(1)
-   program is used to validate the user's password. A familiar "login:"
-   and "Password:" dialog is presented to the user on a black screen
-   inside the vncviewer. The connection is dropped if the user fails to
-   supply the correct password in 3 tries or does not send one before a
-   25 second timeout. Existing clients are view-only during this period.
-   A list of allowed Unix usernames may also be supplied along with
-   per-user settings.
-
-   There is also the -unixpw_nis option for non-shadow-password
-   (typically NIS environments, hence the name) systems where the
-   traditional getpwnam() and crypt() functions are used instead of
-   su(1). The encrypted user passwords must be accessible to the user
-   running x11vnc in -unixpw_nis mode, otherwise the logins will always
-   fail even when the correct password is supplied. See ypcat(1) and
-   shadow(5).
-
-   Two settings are enforced in the -unixpw and -unixpw_nis modes to
-   provide extra security: the 1) -localhost and 2) -stunnel or -ssl
-   options. Without these one might send the Unix username and password
-   data in clear text over the network which is a very bad idea. They can
-   be relaxed if you want to provide encryption other than stunnel or
-   -ssl (the constraint is automatically relaxed if SSH_CONNECTION is set
-   and indicates you have ssh-ed in, however the -localhost requirement
-   is still enforced.)
-
-   The two -unixpw modes have been tested on Linux, Solaris, Mac OS X,
-   HP-UX, AIX, Tru64, FreeBSD, OpenBSD, and NetBSD. Additional testing is
-   appreciated. For the last 4 it appears that su(1) will not prompt for
-   a password if su-ing to oneself. Since x11vnc requires a password
-   prompt from su, x11vnc forces those logins to fail even when the
-   correct password is supplied. On *BSD it appears this can be corrected
-   by removing the pam_self.so entry in /etc/pam.d/su.
-
-
-   Previous older discussion (prior to the -unixpw option):
-
-   Until the VNC protocol and libvncserver support this things will be
-   approximate at best.
-
-   One approximate method involves starting x11vnc with the -localhost
-   option. This basically requires the viewer user to log into the
-   workstation where x11vnc is running via their Unix username and
-   password, and then somehow set up a port redirection of his vncviewer
-   connection to make it appear to emanate from the local machine. As
-   discussed above, ssh is useful for this: "ssh -L 5900:localhost:5900
-   user at hostname ..." See the ssh wrapper scripts mentioned elsewhere on
-   this page. stunnel does this as well.
-
-   Of course a malicious user could allow other users to get in through
-   his channel, but that is a problem with every method. Another thing to
-   watch out for is a malicious user on the viewer side (where ssh is
-   running) trying to sneak in through the ssh port redirection there.
-
-   Regarding limiting the set of Unix usernames who can connect, the
-   traditional way would be to further require a VNC password to supplied
-   (-rfbauth, -passwd, etc) and only tell the people allowed in what the
-   VNC password is. A scheme that avoids a second password involves using
-   the -accept option that runs a program to examine the connection
-   information to determine which user is connecting from the local
-   machine. That may be difficult to do, but, for example, the program
-   could use the ident service on the local machine (normally ident
-   should not be trusted over the network, but on the local machine it
-   should be accurate: otherwise root has been compromised and so there
-   are more serious problems! Unfortunately recent Linux distros seem to
-   provide a random string (MD5 hash?) instead of the username.) An
-   example script passed in via -accept scriptname that deduces the Unix
-   username and limits who can be accepted might look something like
-   this:
-#!/bin/sh
-if [ "$RFB_CLIENT_IP" != "127.0.0.1" -o "$RFB_SERVER_IP" != "127.0.0.1" ]; then
-        exit 1  # something fishy... reject it.
-fi
-user=`echo "$RFB_CLIENT_PORT, $RFB_SERVER_PORT" | nc -w 1 $RFB_CLIENT_IP 113 \
-        | grep 'USERID.*UNIX' | head -n 1 | sed -e 's/[\r ]//g' | awk -F: '{pri
-nt $4}'`
-
-for okuser in fred barney wilma betty
-do
-        if [ "X$user" = "X$okuser" ]; then
-                exit 0  # accept it
-        fi
-done
-exit 1  # reject it
-
-   For this to work with ssh port redirection, the ssh option
-   UsePrivilegeSeparation must be enabled otherwise the userid will
-   always be "root".
-
-   Here is a similar example based on Linux netstat(1) output:
-#!/bin/sh
-#
-# accept_local_netstat:  x11vnc -accept command to accept a local
-# vncviewer connection from acceptable users.  Linux netstat -nte is used.
-
-PATH=/bin:/usr/bin:$PATH; export PATH;  # set to get system utils
-
-allowed="`id -u fred`";                 # add more user numbers if desired.
-
-# check required settings
-ok=1
-if [ "X$allowed" = "X" ]; then
-        ok=0;   # something wrong with allowed list
-fi
-if [ "X$RFB_CLIENT_IP" != "X127.0.0.1" -o "X$RFB_SERVER_IP" != "X127.0.0.1" ];
-then
-        ok=0;   # connection not over localhost
-fi
-if [ "$RFB_CLIENT_PORT" -le 0 -o "$RFB_SERVER_PORT" -le 0 ]; then
-        ok=0;   # something wrong with tcp port numbers
-fi
-if [ "$ok" = 0 ]; then
-        echo "$0: invalid setting:" 1>&2
-        env | grep ^RFB | sort 1>&2
-        exit 1
-fi
-
-# Linux netstat -nte:
-# Proto Recv-Q Send-Q Local Address           Foreign Address         State
-   User       Inode
-# 0     0      0      RFB_CLIENT              RFB_SERVER           ESTABLISHED
-   nnnn       ....
-#
-user=`netstat -nte | grep ESTABLISHED \
-        | grep " $RFB_CLIENT_IP:$RFB_CLIENT_PORT  *$RFB_SERVER_IP:$RFB_SERVER_P
-ORT "`
-
-echo "netstat match: $user" 1>&2
-user=`echo "$user" | head -n 1 | sed -e 's/^.*ESTABLISHED/ /' | awk '{print $1}
-'`
-
-ok=0
-for u in $allowed
-do
-        if [ "X$user" = "X$u" ]; then
-                ok=1
-                break
-        fi
-done
-
-if [ "X$ok" = "X1" ]; then
-        echo "$0: user accepted: '$user'" 1>&2
-        exit 0
-else
-        echo "$0: user '$user' invalid:" 1>&2
-        echo "$0: allowed: $allowed" 1>&2
-        env | grep ^RFB | sort 1>&2
-        exit 1
-fi
-
-
-   Q-39: Can I supply an external program to provide my own custom login
-   method (e.g. Dynamic/One-time passwords or non-Unix (LDAP) usernames
-   and passwords)?
-   Yes, there are several possibilities. For background see the FAQ on
-   the -accept where an external program may be run to decide if a VNC
-   client should be allowed to try to connect and log in. If the program
-   (or local user prompted by a popup) answers "yes", then -accept
-   proceeds to the normal VNC and x11vnc authentication methods,
-   otherwise the connection is dropped.
-
-   To provide more direct coupling to the VNC client's username and/or
-   supplied password the following options were added in Sep/2006:
-     * -unixpw_cmd command
-     * -passwdfile cmd:command
-     * -passwdfile custom:command
-
-   In each case "command" is an external command run by x11vnc. You
-   supply it. For example, it may couple to your LDAP system or other
-   servers you set up.
-
-   For -unixpw_cmd the normal -unixpw Login: and Password: prompts are
-   supplied to the VNC viewer and the strings the client returns are then
-   piped into "command" as the first two lines of its standard input. If
-   the command returns success, i.e. exit(0), the VNC client is accepted,
-   otherwise it is rejected.
-
-   For "-passwdfile cmd:command" the command is run and it returns a
-   password list (like a password file, see the -passwdfile read:filename
-   mode.) Perhaps a dynamic, one-time password is retrieved from a server
-   this way.
-
-   For "-passwdfile custom:command" one gets complete control over the
-   VNC challenge-response dialog with the VNC client. x11vnc sends out a
-   string of random bytes (16 by the VNC spec) and the client returns the
-   same number of bytes in a way the server can verify only the
-   authorized user could have created. The VNC protocol specifies DES
-   encryption with a password. If you are willing to modify the VNC
-   viewers, you can have it be anything you want, perhaps a less
-   crackable MD5 hash scheme or one-time pad. Your program will read from
-   its standard input the size of the challenge-response followed by a
-   newline, then the challenge bytes followed by the response bytes. If
-   your command then returns success, i.e. exit(0), the VNC client is
-   accepted, otherwise it is rejected.
-
-   In all cases the "RFB_*" environment variables are set as under
-   -accept. These variables can provide useful information for the
-   externally supplied program to use.
-
-
-   Q-40: Why does x11vnc exit as soon as the VNC viewer disconnects? And
-   why doesn't it allow more than one VNC viewer to connect at the same
-   time?
-
-   These defaults are simple safety measures to avoid someone unknowingly
-   leaving his X11 desktop exposed (to the internet, say) for long
-   periods of time. Use the -forever option (aka -many) to have x11vnc
-   wait for more connections after the first client disconnects. Use the
-   -shared option to have x11vnc allow multiple clients to connect
-   simultaneously.
-
-   Recommended additional safety measures include using ssh (see above),
-   stunnel, -ssl, or a VPN to authenticate and encrypt the viewer
-   connections or to at least use the -rfbauth passwd-file option to use
-   VNC password protection (or -passwdfile) It is up to YOU to apply
-   these security measures, they will not be done for you automatically.
-
-
-   Q-41: Can I limit which machines incoming VNC clients can connect
-   from?
-
-   Yes, look at the -allow and -localhost options to limit connections by
-   hostname or IP address. E.g.
-  x11vnc -allow 192.168.0.1,192.168.0.2
-
-   for those two hosts or
-  x11vnc -allow 192.168.0.
-
-   for a subnet. For individual hosts you can use the hostname instead of
-   the IP number, e.g.: "-allow snoopy", and "-allow darkstar,wombat".
-   Note that -localhost achieves the same thing as "-allow 127.0.0.1"
-
-   For more control, build libvncserver with libwrap support
-   (tcp_wrappers) and then use /etc/hosts.allow See hosts_access(5) for
-   complete details.
-
-
-   Q-42: How do I build x11vnc/libvncserver with libwrap (tcp_wrappers)
-   support?
-
-   Here is one way to pass this information to the configure script:
-  env CPPFLAGS=-DUSE_LIBWRAP LDFLAGS=-lwrap ./configure
-
-   then run make as usual. This requires libwrap and its development
-   package (tcpd.h) to be installed on the build machine. If additional
-   CPPFLAGS or LDFLAGS options are needed supply them as well using
-   quotes.
-
-   The resulting x11vnc then uses libwrap/tcp_wrappers for connections.
-   The service name you will use in /etc/hosts.allow and /etc/hosts.deny
-   is "vnc", e.g.:
-  vnc: 192.168.100.3 .example.com
-
-   Note that if you run x11vnc out of inetd you do not need to build
-   x11vnc with libwrap support because the /usr/sbin/tcpd reference in
-   /etc/inetd.conf handles the tcp_wrappers stuff.
-
-
-   Q-43: Can I have x11vnc only listen on one network interface (e.g.
-   internal LAN) rather than having it listen on all network interfaces
-   and relying on -allow to filter unwanted connections out?
-
-   As of Mar/2005 there is the "-listen ipaddr" option that enables this.
-   For ipaddr either supply the desired network interface's IP address
-   (or use a hostname that resolves to it) or use the string "localhost".
-   For additional filtering simultaneously use the "-allow host1,..."
-   option to allow only specific hosts in.
-
-   This option is useful if you want to insure that no one can even begin
-   a dialog with x11vnc from untrusted network interfaces (e.g. ppp0.)
-   The option -localhost now implies "-listen localhost" since that is
-   what most people expect it to do.
-
-
-   Q-44: Now that -localhost implies listening only on the loopback
-   interface, how I can occasionally allow in a non-localhost via the -R
-   allowonce remote control command?
-
-   To do this specify "-allow localhost". Unlike -localhost this will
-   leave x11vnc listening on all interfaces (but of course only allowing
-   in local connections, e.g. ssh redirs.) Then you can later run "x11vnc
-   -R allowonce:somehost" or use to gui to permit a one-shot connection
-   from a remote host.
-
-
-   Q-45: Can I fine tune what types of user input are allowed? E.g. have
-   some users just be able to move the mouse, but not click or type
-   anything?
-
-   As of Feb/2005, the -input option allows you to do this. "K", "M",
-   "B", "C", and "F" stand for Keystroke, Mouse-motion, Button-clicks,
-   Clipboard, and File-Transfer, respectively. The setting: "-input M"
-   makes attached viewers only able to move the mouse. "-input KMBC,M"
-   lets normal clients do everything and enables view-only clients to
-   move the mouse.
-
-   These settings can also be applied on a per-viewer basis via the
-   remote control mechanism or the GUI. E.g. x11vnc -R input:hostname:M
-
-
-   Q-46: Can I prompt the user at the local X display whether the
-   incoming VNC client should be accepted or not? Can I decide to make
-   some clients view-only? How about running an arbitrary program to make
-   the decisions?
-
-   Yes, look at the "-accept command" option, it allows you to specify an
-   external command that is run for each new client. (use quotes around
-   the command if it contains spaces, etc.) If the external command
-   returns 0 (success) the client is accepted, otherwise with any other
-   return code the client is rejected. See below how to also accept
-   clients view-only.
-
-   The external command will have the RFB_CLIENT_IP environment variable
-   set to the client's numerical IP address, RFB_CLIENT_PORT its port
-   number. Similarly for RFB_SERVER_IP and RFB_SERVER_PORT to allow
-   identification of the tcp virtual circuit. DISPLAY will be set to that
-   of the X11 display being polled. Also, RFB_X11VNC_PID is set to the
-   x11vnc process id (e.g. in case you decided to kill it), RFB_CLIENT_ID
-   will be an id number, and RFB_CLIENT_COUNT the number of other clients
-   currently connected. RFB_MODE will be "accept".
-
-   Built-in Popup Window: As a special case, "-accept popup" will
-   instruct x11vnc to create its own simple popup window. To accept the
-   client press "y" or click mouse on the "Yes" button. To reject the
-   client press "n" or click mouse on the "No" button. To accept the
-   client View-only, press "v" or click mouse on the "View" button. If
-   the -viewonly option has been supplied, the "View" action will not be
-   present: the whole display is view only in that case.
-
-   The popup window times out after 120 seconds, to change this behavior
-   use "-accept popup:N" where N is the number of seconds (use 0 for no
-   timeout.) More tricks: "-accept popupmouse" will only take mouse click
-   responses, while "-accept popupkey" will only take keystroke responses
-   (popup takes both.) After any of the 3 popup keywords you can supply a
-   position of the window: +N+M, (the default is to center the window)
-   e.g. -accept popupmouse+10+10.
-
-   Also as a special case "-accept xmessage" will run the xmessage(1)
-   program to prompt the user whether the client should be accepted or
-   not. This requires that you have xmessage installed and available via
-   PATH. In case it is not already on your system, the xmessage program
-   is available at ftp://ftp.x.org/
-   (End of Built-in Popup Window:)
-
-   To include view-only decisions for the external commands, prefix the
-   command something like this: "yes:0,no:*,view:3 mycommand ..." This
-   associates the three actions: yes(accept), no(reject), and
-   view(accept-view-only), with the numerical return (i.e. exit()) codes.
-   Use "*" instead of a number to set the default action (e.g. in case
-   the external command returns an unexpected return code.)
-
-   Here is an example -accept script called accept_or_lock. It uses
-   xmessage and xlock (replace with your screen lock command, maybe it is
-   "xscreensaver-command -lock", or kdesktop_lock, or "dtaction
-   LockDisplay".) It will prompt the user at the X display whether to
-   accept, reject, or accept view-only the client, but if the prompt
-   times out after 60 seconds the screen is locked and the VNC client is
-   accepted. This allows the remote access when no one is at the display.
-#!/bin/sh
-#
-# accept_or_lock: prompt user at X display whether to accept an incoming
-#                 VNC connection.  If timeout expires, screen is locked
-#                 and the VNC viewer is accepted (allows remote access
-#                 when no one is sitting at the display.)
-#
-# usage: x11vnc ... -forever -accept 'yes:0,no:*,view:4 accept_or_lock'
-#
-xmessage -buttons yes:2,no:3,view-only:4 -center \
-         -timeout 60 "x11vnc: accept connection from $RFB_CLIENT_IP?"
-rc=$?
-if [ $rc = 0 ]; then
-        xlock & # or "xlock -mode blank" for no animations.
-        sleep 5
-        exit 0
-elif [ $rc = 2 ]; then
-        exit 0
-elif [ $rc = 4 ]; then
-        exit 4
-fi
-exit 1
-
-   Stefan Radman has written a nice dtksh script dtVncPopup for use in
-   CDE environments to do the same sort of thing. Information on how to
-   use it is found at the top of the file. He encourages you to provide
-   feedback to him to help improve the script.
-
-   Note that in all cases x11vnc will block while the external command or
-   popup is being run, so attached clients will not receive screen
-   updates, etc during this period.
-
-   To run a command when a client disconnects, use the "-gone command"
-   option. This is for the user's convenience only: the return code of
-   the command is not interpreted by x11vnc. The same environment
-   variables are set as in "-accept command" (except that RFB_MODE will
-   be "gone".)
-
-   As of Jan/2006 the "-afteraccept command" option will run the command
-   only after the VNC client has been accepted and authenticated. Like
-   -gone the return code is not interpreted. RFB_MODE will be
-   "afteraccept".)
-
-
-   Q-47: I start x11vnc as root because it is launched via inetd(8) or a
-   display manager like gdm(1). Can I have x11vnc later switch to a
-   different user?
-
-   As of Feb/2005 x11vnc has the -users option that allows things like
-   this. Please read the documentation on it (also in the x11vnc -help
-   output) carefully for features and caveats. It's use can often
-   decrease security unless care is taken.
-
-   BTW, a nice use of it is "-users +nobody" that switches to the Unix
-   user nobody right after connections to the X display are established.
-
-   In any event, while running x11vnc as root, remember it comes with no
-   warranty ;-).
-
-
-   Q-48: I use a screen-lock when I leave my workstation (e.g.
-   xscreensaver or xlock.) When I remotely access my workstation desktop
-   via x11vnc I can unlock the desktop fine, but I am worried people will
-   see my activities on the physical monitor. What can I do to prevent
-   this, or at least make it more difficult?
-
-   Probably most work environments would respect your privacy if you
-   powered off the monitor. Also remember if people have physical access
-   to your workstation they basically can do anything they want with it
-   (e.g. install a backdoor for later use, etc.)
-
-   In any event, as of Jun/2004 there is an experimental utility to make
-   it more difficult for nosey people to see your x11vnc activities. The
-   source for it is blockdpy.c The idea behind it is simple (but
-   obviously not bulletproof): when a VNC client attaches to x11vnc put
-   the display monitor in the DPMS "off" state, if the DPMS state ever
-   changes immediately start up the screen-lock program. The x11vnc user
-   will notice something is happening and think about what to do next
-   (while the screen is in a locked state.)
-
-   This works (or at least has a chance of working) because if the
-   intruder moves the mouse or presses a key on the keyboard, the monitor
-   wakes up out of the DPMS off state, and this induces the screen lock
-   program to activate as soon as possible. Of course there are cracks in
-   this, the eavesdropper could detach your monitor and insert a non-DPMS
-   one, and there are race conditions. As mentioned above this is not
-   bulletproof. A really robust solution would likely require X server
-   and perhaps even video hardware support.
-
-   The blockdpy utility is launched by the -accept option and told to
-   exit via the -gone option (the vnc client user should obviously
-   re-lock the screen before disconnecting!) Instructions can be found in
-   the source code for the utility at the above link. Roughly it is
-   something like this:
-  x11vnc ... -accept "blockdpy -bg -f $HOME/.bdpy" -gone "touch $HOME/.bdpy"
-
-   but please read the top of the file.
-
-   Update: As of Feb/2007 there is some builtin support for this:
-   -forcedpms and -clientdpms however, they are probably less robust than
-   the above blockdpy.c scheme, since if the person floods the physical
-   machine with mouse or pointer input he can usually see flashes of the
-   screen before the monitor is powered off again. See also the -grabkbd,
-   -grabptr, and -grabalways options.
-
-
-   Q-49: Can I have x11vnc automatically lock the screen when I
-   disconnect the VNC viewer?
-
-   Yes, a user mentions he uses the -gone option under CDE to run a
-   screen lock program:
-  x11vnc -display :0 -forever -gone 'dtaction LockDisplay'
-
-   Other possibilities are:
-  x11vnc -display :0 -forever -gone 'xscreensaver-command -lock'
-  x11vnc -display :0 -forever -gone 'kdesktop_lock'
-  x11vnc -display :0 -forever -gone 'xlock &'
-  x11vnc -display :0 -forever -gone 'xlock -mode blank &'
-
-   Here is a scheme using the -afteraccept option (in version 0.8) to
-   unlock the screen after the first valid VNC login and to lock the
-   screen after the last valid VNC login disconnects:
-  x11vnc -display :0 -forever -shared -afteraccept ./myxlocker -gone ./myxlocke
-r
-
-   Where the script ./myxlocker is:
-#!/bin/sh
-
-#/usr/bin/env | grep RFB_ | sort        # for viewing RFB_* settings.
-
-if [ "X$RFB_MODE" = "Xafteraccept" ]; then
-        if [ "X$RFB_STATE" = "XNORMAL" ]; then  # require valid login
-                if [ "X$RFB_CLIENT_COUNT" = "X1" ]; then
-                        killall xlock   # Linux only.
-                fi
-        fi
-elif [ "X$RFB_MODE" = "Xgone" ]; then
-        if [ "X$RFB_STATE" = "XNORMAL" ]; then  # require valid login
-                if [ "X$RFB_CLIENT_COUNT" = "X0" ]; then
-                        xlock -mode blank &
-                fi
-        fi
-fi
-
-   Note the xlock option "-mode blank" to avoid animations.
-
-   There is a problem if you have x11vnc running this way in -forever
-   mode and you hit Ctrl-C to stop it. The xlock (or other program) will
-   get killed too. To work around this make a little script called
-   setpgrp that looks like:
-#!/usr/bin/perl
-setpgrp(0, 0);
-exec @ARGV;
-
-   then use -gone "setpgrp xlock &", etc.
-   [Encrypted Connections]
-
-   Q-50: How can I tunnel my connection to x11vnc via an encrypted SSH
-   channel between two Unix machines?
-
-   See the description earlier on this page on how to tunnel VNC via SSH
-   from Unix to Unix. A number of ways are described along with some
-   issues you may encounter.
-
-   Other secure encrypted methods exists, e.g. stunnel, IPSEC, various
-   VPNs, etc.
-
-   See also the Enhanced TightVNC Viewer (SSVNC) page where much of this
-   is now automated.
-
-
-   Q-51: How can I tunnel my connection to x11vnc via an encrypted SSH
-   channel from Windows using an SSH client like Putty?
-
-   Above we described how to tunnel VNC via SSH from Unix to Unix, you
-   may want to review it. To do this from Windows using Putty it would go
-   something like this:
-     * In the Putty dialog window under 'Session' enter the hostname or
-       IP number of the Unix machine with display to be viewed.
-     * Make sure the SSH protocol is selected and the server port is
-       correct.
-     * Under 'Connections/SSH/Tunnels' Add a Local connection with
-       'Source port:  5900' and 'Destination:  localhost:5900'
-     * Log into the remote machine by pressing 'Open' and supplying
-       username, password, etc.
-     * In that SSH shell, start up x11vnc by typing the command: x11vnc
-       -display :0 plus any other desired options (e.g. -localhost.)
-     * Finally, start up your VNC Viewer in Windows and enter
-       'localhost:0' as the VNC server.
-
-   You can keep all of the settings in a Putty 'Saved Session'. Also,
-   once everything is working, you can consider putting x11vnc -display
-   :0 (plus other cmdline options) in the 'Remote command' Putty setting
-   under 'Connections/SSH'.
-
-   See also the Enhanced TightVNC Viewer (SSVNC) page where much of this
-   is now automated via the Putty plink utility.
-
-   For extra protection feel free to run x11vnc with the -localhost and
-   -rfbauth/-passwdfile options.
-
-   If the machine you SSH into via Putty is not the same machine with the
-   X display you wish to view (e.g. your company provides incoming SSH
-   access to a gateway machine), then you need to change the above Putty
-   dialog setting to: 'Destination: otherhost:5900', Once logged in,
-   you'll need to do a second login (ssh or rsh) to the workstation
-   machine 'otherhost' and then start up x11vnc on it. This can also be
-   automated by Chaining SSH's.
-
-   As discussed above another option is to first start the VNC viewer in
-   "listen" mode, and then launch x11vnc with the "-connect localhost"
-   option to establish the reverse connection. In this case a Remote port
-   redirection (not Local) is needed for port 5500 instead of 5900 (i.e.
-   'Source port:  5500' and 'Destination:  localhost:5500' for a Remote
-   connection.)
-
-
-   Q-52: How can I tunnel my connection to x11vnc via an encrypted SSL
-   channel using an external tool like stunnel?
-
-   It is possible to use a "lighter weight" encryption setup than SSH or
-   IPSEC. SSL tunnels such as stunnel (also stunnel.org) provide an
-   encrypted channel without the need for Unix users, passwords, and key
-   passphrases required for ssh (and at the other extreme SSL can also
-   provide a complete signed certificate chain of trust.) On the other
-   hand, since SSH is usually installed everywhere and firewalls often
-   let its port through, ssh is frequently the path of least resistance
-   (it also nicely manages public keys for you.)
-
-   Update: As of Feb/2006 x11vnc has the options -ssl, -stunnel, and
-   -sslverify to provide integrated SSL schemes. They are discussed in
-   the Next FAQ (you probably want to skip to it now.)
-
-   We include these non-built-in method descriptions below for historical
-   reference. They are handy because can be used to create SSL tunnels to
-   any VNC (or other type of) server.
-
-
-   Here are some basic examples using stunnel but the general idea for
-   any SSL tunnel utility is the same:
-     * Start up x11vnc and constrain it to listen on localhost.
-     * Then start up the SSL tunnel running on the same machine to
-       forward incoming connections to that x11vnc.
-     * Set up and run a similar SSL tunnel for the outgoing connection on
-       the VNC viewer machine pointing it to the SSL/x11vnc server.
-     * Optionally, set up server (or even client) public/private keys for
-       use in authenticating one side to the other.
-     * Finally, start the VNC Viewer and tell it to connect to the local
-       port (e.g. a vnc display localhost:0) where its outgoing SSL
-       tunnel is listening.
-
-   We'll first use the stunnel version 3 syntax since it is the most
-   concise and Unixy.
-
-   Start up x11vnc listening on port 5900:
-  x11vnc -display :0 -rfbport 5900 -localhost -bg -passwdfile ~/mypass
-
-   Then start stunnel (version 3, not 4) with this command:
-  stunnel -d 5901 -r 5900 -p /path/to/stunnel.pem
-
-   The above two commands are run on host "far-away.east". The
-   stunnel.pem is the self-signed PEM file certificate created when
-   stunnel is built. One can also create certificates signed by
-   Certificate Authorities or self-signed if desired using the x11vnc
-   utilities described there.
-
-   SSL Viewers:  Next, on the VNC viewer side we need an SSL tunnel to
-   encrypt the outgoing connection. The nice thing is any SSL tunnel can
-   be used because the protocol is a standard. For this example we'll
-   also use stunnel on the viewer side on Unix. First start up the
-   client-side stunnel (version 3, not 4):
-  stunnel -c -d localhost:5902 -r far-away.east:5901
-
-   Then point the viewer to the local tunnel on port 5902:
-  vncviewer -encodings "copyrect tight zrle hextile" localhost:2
-
-   That's it.  Note that the ss_vncviewer script can automate this
-   easily, and so can the Enhanced TightVNC Viewer (SSVNC) package.
-
-   Be sure to use a VNC password because unlike ssh by default the
-   encrypted SSL channel provides no authentication (only privacy.) With
-   some extra configuration one could also set up certificates to provide
-   authentication of either or both sides as well (and hence avoid
-   man-in-the-middle attacks.) See the stunnel and openssl documentation
-   and also the key management section for details.
-
-   stunnel has also been ported to Windows, and there are likely others
-   to choose from for that OS. Much info for using it on Windows can be
-   found at the stunnel site and in this article The article also shows
-   the detailed steps to set up all the authentication certificates. (for
-   both server and clients, see also the x11vnc utilities that do this.)
-   The default Windows client setup (no certs) is simpler and only 4
-   files are needed in a folder: stunnel.exe, stunnel.conf, libssl32.dll,
-   libeay32.dll. We used an stunnel.conf containing:
-# stunnel.conf:
-client = yes
-options = ALL
-[myvncssl]
-accept = localhost:5902
-connect = far-away.east:5901
-
-   then double click on the stunnel.exe icon to launch it (followed by
-   pointing the VNC viewer to localhost:2).
-
-
-   stunnel inetd-like mode:
-
-   As an aside, if you don't like the little "gap" of unencrypted TCP
-   traffic (and a localhost listening socket) on the local machine
-   between stunnel and x11vnc it can actually be closed by having stunnel
-   start up x11vnc in -inetd mode:
-  stunnel -p /path/to/stunnel.pem -P none -d 5900 -l ./x11vnc_sh
-
-   Where the script x11vnc_sh starts up x11vnc:
-#!/bin/sh
-x11vnc -q -inetd -display :0 -passwdfile ~/mypass
-
-   Note that this creates a separate x11vnc process for each incoming
-   connection (as any inetd x11vnc usage would), but for the case of
-   normally just one viewer at a time it should not be a big problem.
-
-
-   stunnel 4 syntax:
-
-   Somewhat sadly, the stunnel version 4 syntax is not so amenable to the
-   command line or scripts. You need to create a config file with the
-   parameters. E.g.:
-  stunnel x11vnc.cfg
-
-   Where the file x11vnc.cfg contains:
-foreground = yes
-pid =
-cert = /path/to/stunnel.pem
-[x11vnc_stunnel]
-accept  = 5901
-connect = 5900
-
-   One nice thing about version 4 is often the PEM file does not need to
-   be specified because stunnel finds it in its installed area. One other
-   gotcha the PEM file is usually only readable by root (it has the
-   private key afterall), so you'll need to relax the permissions or make
-   a copy that the user running x11vnc/stunnel can read.
-
-
-   SSL VNC Viewers:
-
-   Regarding VNC viewers that "natively" do SSL unfortunately there do
-   not seem to be many. The SingleClick UltraVNC Java Viewer is SSL and
-   is compatible with x11vnc's -ssl option and stunnel.) Commercial
-   versions of VNC seem to have some SSL-like encryption built in, but we
-   haven't tried those either and they probably wouldn't work since their
-   (proprietary) SSL-like negotiation is likely embedded in the VNC
-   protocol unlike our case where it is external.
-
-   Note: as of Mar/2006 libvncserver/x11vnc provides a SSL-enabled Java
-   applet that can be served up via the -httpdir or -http options when
-   -ssl is enabled. It will also be served via HTTPS via either the VNC
-   port (e.g. https://host:5900/) or a 2nd port via the -https option.
-
-   In general current SSL VNC solutions are not particularly "seemless".
-   But it can be done, and with a wrapper script on the viewer side and
-   the -stunnel or -ssl option on the server side it works well and is
-   convenient. Here is a simple script ss_vncviewer that automates
-   running stunnel on the VNC viewer side on Unix a little more carefully
-   than the commands printed above. (One could probably do a similar
-   thing with a .BAT file on Windows in the stunnel folder.)
-
-   Update Jul/2006: we now provide an Enhanced TightVNC Viewer (SSVNC)
-   package that starts up STUNNEL automatically along with some other
-   features. All binaries (stunnel, vncviewer, and some utilities) are
-   provided in the package. It works on Unix, Mac OS X, and Windows.
-
-
-   Q-53: Does x11vnc have built-in SSL tunneling?
-
-   You can read about non-built-in methods in the Previous FAQ for
-   background.
-
-   SSL tunnels provide an encrypted channel without the need for Unix
-   users, passwords, and key passphrases required for ssh (and at the
-   other extreme SSL can also provide a complete signed certificate chain
-   of trust.) On the other hand, since SSH is usually installed
-   everywhere and firewalls often let its port through, ssh is frequently
-   the path of least resistance.
-
-   Built-in SSL x11vnc options:
-
-   As of Feb/2006 the x11vnc -ssl option automates the SSL tunnel
-   creation on the x11vnc server side. An SSL-enabled Java Viewer applet
-   is also provided that can be served via HTTP or HTTPS to automate SSL
-   on the client side.
-
-   The -ssl mode uses the www.openssl.org library if available at build
-   time.
-
-   The mode requires an SSL certificate and key (i.e. .pem file.) These
-   are usually created via the openssl(1) program (in fact in for "-ssl"
-   (same as "-ssl SAVE") it will run openssl for you automatically.) So
-   the SSL is not completely "built-in" since this external tool needs to
-   be installed, but at least x11vnc runs it for you automatically.
-
-   An -ssl example:
-  x11vnc -display :0 -ssl -passwdfile ~/mypass
-
-   You'll get output like this:
-  09/04/2006 19:27:35 Creating a self-signed PEM certificate...
-  09/04/2006 19:27:35
-  ...
-
-  The SSL VNC desktop is:  far-away.east:0
-  PORT=5900
-  SSLPORT=5900
-
-   In this case openssl(1) was used to create a PEM automatically. It
-   will prompt you if you want to protect it with with a passphrase. Use
-   "-ssl SAVE_NOPROMPT" to not be prompted. Use "-ssl TMP" to create a
-   temporary self-signed cert that will be discarded when x11vnc exits.
-
-   Update: As of Nov/2008 x11vnc also supports the VeNCrypt SSL/TLS
-   tunnel extension to the VNC protocol. The older ANONTLS method (vino)
-   is also supported. This support is on by default when the -ssl option
-   is in use and can be fine-tuned using these options: -vencrypt,
-   -anontls, and -sslonly.
-
-   The normal x11vnc -ssl operation is somewhat like a URL method
-   vncs://hostname if vnc://hostname indicates a standard unencrypted VNC
-   connection. Just as https://hostname is an SSL encrypted version of
-   http://hostname. The entire VNC session goes through the SSL tunnel.
-   VeNCrypt, on the other hand, switches to SSL/TLS early in the VNC
-   protocol handshake. x11vnc 0.9.6 supports both simultaneously when
-   -ssl is active.
-
-
-   SSL VNC Viewers:. Viewer-side will need to use SSL as well. See the
-   next FAQ and here for SSL enabled VNC Viewers, including SSVNC, to
-   connect to the above x11vnc via SSL.
-
-
-   As seen above, the PEM (privacy enhanced mail) file does not need to
-   be supplied if the openssl(1) command is available in PATH, in that
-   case a self-signed, certificate good the current and subsequent x11vnc
-   sessions is created (this may take a while on very slow machines.)
-
-   In general, the PEM file contains both the Certificate (i.e. public
-   key) and the Private Key. Because of the latter, the file should be
-   protected from being read by untrusted users. The best way to do this
-   is to encrypt the key with a passphrase (note however this requires
-   supplying the passphrase each time x11vnc is started up.)
-
-   See the discussion on x11vnc Key Management for some utilities
-   provided for creating and managing certificates and keys and even for
-   creating your own Certificate Authority (CA) for signing VNC server
-   and client certificates. This may be done by importing the certificate
-   into Web Browser or Java plugin keystores, or pointing stunnel to it.
-   The wrapper script ss_vncviewer provides an example on unix (see the
-   -verify option.)
-
-   Here are some notes on the simpler default (non-CA) operation. To have
-   x11vnc save the generated certificate and key, use the "SAVE" keyword
-   like this:
-  x11vnc -ssl SAVE -display :0 ...
-
-   (this is the same as the default: "-ssl".) This way it will be saved
-   in the default directory ~/.vnc/certs/ as server.crt (the certificate
-   only) and server.pem (both certificate and private key.) This opens up
-   the possibility of copying the server.crt to machines where the VNC
-   Viewer will be run to enable authenticating the x11vnc SSL VNC server
-   to the clients. When authentication takes place this way (or via the
-   more sophisticated CA signing described here), then
-   Man-In-The-Middle-Attacks are prevented. Otherwise, the SSL encryption
-   only provides protection against passive network traffic "sniffing"
-   (i.e. you are not protected against M-I-T-M attacks.) Nowadays, most
-   people seem mostly concerned mainly about passive sniffing (and the
-   default x11vnc SSL mode protects against it.) Note that there are
-   hacker tools like dsniff/webmitm and cain that implement SSL
-   Man-In-The-Middle attacks. They rely on the client not bothering to
-   check the cert.
-
-
-   One can test to some degree that SSL is working after starting x11vnc
-   with the -stunnel or -ssl option. From another machine one can use the
-   openssl command something like this:
- openssl s_client -debug -msg -showcerts -connect far-away.east:5900
-
-   After all of the debugging output and informational messages you'll
-   see the string "RFB 003.008" that came from x11vnc. Pointing a web
-   browser connecting to: https://far-away.east:5900/ and then viewing
-   the SSL certificate information about the connection in the panels
-   will also work.
-
-   Note: If you serve up the SSL enabled Java VNC Viewer via something
-   like:
- x11vnc -ssl -httpdir /usr/local/share/x11vnc/classes/ssl
-
-   (or just the -http option), you can test it out completely using that,
-   including using https to download it into the browser and connect to
-   x11vnc.
-
-
-   The older -stunnel option: Before the -ssl option there was a
-   convenience option -stunnel that would start an external SSL tunnel
-   for you using stunnel. The -ssl method is the preferred way, but for
-   historical reference we keep the -stunnel info here.
-
-   The -stunnel mode requires the stunnel.mirt.net command stunnel(8) to
-   be installed on the system.
-
-   Some -stunnel examples:
-  x11vnc -display :0 -stunnel /path/to/stunnel.pem -passwdfile ~/mypass
-
-  x11vnc -display :0 -stunnel SAVE ...
-
-   You'll get output like this:
-  The VNC desktop is:      localhost:50
-  The SSL VNC desktop is:  far-away.east:0
-  PORT=5950
-  SSLPORT=5900
-
-   That indicates stunnel is listening on port 5900 for incoming
-   SSL-wrapped VNC connections from viewers. x11vnc is listening for
-   local connections on port 5950 in this case (remote viewers cannot
-   connect to it directly.) For -stunnel to work the stunnel command must
-   be installed on the machine and available in PATH (note stunnel is
-   often installed in sbin directories rather than bin.) Note that the
-   default "-stunnel" by itself creates a temporary cert (as in "-ssl
-   TMP".)
-
-
-   Q-54: How do I use VNC Viewers with built-in SSL tunneling?
-
-   Notes on using "native" VNC Viewers with SSL:
-
-   There aren't any native VNC Viewers that do SSL (ask your VNC viewer
-   developer to add the feature.) So a tunnel must be setup that you
-   point the VNC Viewer to. This is often STUNNEL. You can do this
-   manually, or use the ss_vncviewer script on Unix, or our Enhanced
-   TightVNC Viewer (SSVNC) package on Unix, Windows, or MacOSX. See the
-   next section for Java Web browser SSL VNC Viewers (you only need a
-   Java-enabled Web browser for it to work.)
-
-   Notes on the SSL enabled Java VNC Viewer provided in x11vnc
-   classes/ssl/VncViewer.jar:
-
-   A Java applet VNC Viewer allows you to connect to a VNC Server from a
-   Java-enabled Web browser.
-
-   The SSL enabled Java VNC Viewer (VncViewer.jar) in the x11vnc package
-   supports only SSL based connections by default. As mentioned above the
-   -httpdir can be used to specify the path to .../classes/ssl. A typical
-   location might be /usr/local/share/x11vnc/classes/ssl. Or -http can be
-   used to try to have it find the directory automatically.
-
-   Also note that the SingleClick UltraVNC Java Viewer is compatible with
-   x11vnc's -ssl SSL mode. (We tested it this way: "java -cp
-   ./VncViewer.jar VncViewer HOST far-away.east PORT 5900 USESSL 1
-   TRUSTALL 1")
-
-   The Java viewer uses SSL to communicate securely with x11vnc. Note
-   that the applet can optionally also be downloaded into your web
-   browser via HTTPS (which is HTTP over SSL.) This way the HTML page and
-   the Java applet itself are also delivered securely with SSL (as
-   opposed to only the VNC traffic being encrypted with SSL.)
-
-   For this case the output will be something like this:
-  x11vnc -ssl SAVE -http
-  ...
-  The SSL VNC desktop is:  far-away.east:0
-  Java SSL viewer URL:     https://far-away.east:5900/
-  Java SSL viewer URL:     http://far-away.east:5800/
-  PORT=5900
-  SSLPORT=5900
-
-   Indicating the two URLs (the first one encrypted, the second not) one
-   could point the web browser at to get the VNC viewer applet. E.g. put
-   this
-   http://far-away.east:5800/
-
-   or:
-   https://far-away.east:5900/
-
-   into your Java-enabled Web browser.
-
-   Note that KDE's Konqueror web browser seems to have problems with
-   https Java applets, so you'll have to use the http/5800 with it (if
-   you get https/5900 working let us know how you did it.)
-
-   If you are using a router/firewall with port-redirection, and you are
-   redirecting ports other than the default ones (5800, 5900) listed
-   above see here.
-
-   The https service provided thru the actual VNC port (5900 in the above
-   example) can occasionally be slow or unreliable (it has to read some
-   input and try to guess if the connection is VNC or HTTP.) If it is
-   unreliable for you and you still want to serve the Java applet via
-   https, use the -https option to get an additional port dedicated to
-   https (its URL will also be printed in the output.)
-
-   Another possibility is to add the GET applet parameter:
-  https://far-away.east:5900/?GET=1
-
-   This will have the VNC Viewer send a special HTTP GET string "GET
-   /request.https.vnc.connection HTTP/1.0" that x11vnc will notice more
-   quickly as a request for a VNC connection. Otherwise it must wait for
-   a timeout to expire before it assumes a VNC connection.
-
-   You may also use "urlPrefix=somestring" to have /somestring prepended
-   to /request.https.vnc.connection". Perhaps you are using a web server
-   proxy scheme to enter a firewall or otherwise have rules applied to
-   the URL. If you need to have any slashes "/" in "somestring" use
-   "_2F_" (a deficiency in libvncserver prevents using the more natural
-   "%2F".)
-
-   You apply multiple applet parameters in the regular URL way, e.g.:
-  https://far-away.east:5900/?GET=1&urlPrefix=mysubdir&...
-
-   All of the x11vnc Java Viewer applet parameters are described in the
-   file classes/ssl/README
-
-
-   Tips on Getting the SSL Java Applet Working the First Time:
-   Unfortunately, it can be a little tricky getting the SSL VNC Java
-   Viewer working with x11vnc. Here are some tips to getting working the
-   first time (afterwards you can incrementally customize with more
-   complex settings.)
-     * First try it on the LAN: Do NOT try to have it work the first time
-       going through firewalls, Web proxies, home router port
-       redirections, or Apache portal. Just try a direct connection over
-       your LAN first (if you only have 1 machine and no LAN, just do a
-       direct connection to the same machine: localhost.) If the LAN
-       machine you run x11vnc on has its own host-level firewall (most
-       linux machine come with that on by default), disable it or at
-       least let tcp ports 5800-6000 through.
-     * First try HTTP to download the Java Applet: x11vnc can serve both
-       the Java Applet jar file and VNC out of the same port (both
-       tunneled through SSL, see below.) But it can lead to timing and
-       other problems. So first try HTTP instead of HTTPS to download the
-       Applet jar file (VncViewer.jar.) That is to say try
-       http://hostname:5800 in your web browser first before trying
-       https://hostname:5900. x11vnc will print out the ports and URLs it
-       is using, so use the HTTP one it prints out.
-     * Always Restart the Browser: If you are having failures and have to
-       repeatedly retry things ALWAYS restart the browser (i.e.
-       completely exit it and then start a new browser process) each
-       time. Otherwise as you are changing things the browser may
-       "remember" failed applet downloads, etc. and just add to the
-       confusion and irreproducibility. If you see it trying to download
-       VncViewer.class (instead of VncViewer.jar) you know it is really
-       confused and needs to be restarted.
-     * Step Lively: If you get Browser or Java VM or VNC Viewer applet
-       dialog boxes saying things like "Do you want to trust this
-       certificate?" or "The hostname does not match the one on the
-       certificate", etc. just go through them as quickly as possible.
-       x11vnc cannot wait forever for each SSL connection, and so if you
-       dawdle too long inspecting the certs, etc it can lead to problems.
-       Get it working first before taking your time to read the details
-       in the dialogs, etc.
-     * No inetd, Please: Even if you intend to deploy via inetd or xinetd
-       eventually, get that working later (and remember do not use
-       something like "-ssl TMP" that creates a new temporary SSL
-       certificate for every new socket connection.)
-     * Nothing Fancy: Do not try fancy stuff like -svc, -create, -unixpw,
-       "-users unixpw=", "-users sslpeer=", -sslverify, etc. Just get the
-       simplest connection working first and then incrementally add what
-       you need.
-
-   So the recommended test command lines are:
-   x11vnc -ssl SAVE -http
-   x11vnc -ssl SAVE -httpdir /path/to/x11vnc/classes/ssl
-
-   Use the latter if x11vnc cannot automatically find the classes/ssl
-   directory (this what the -http option instructs it to do.) Then point
-   your browser to the HTTP (not HTTPS) URL it prints out.
-
-   Following the above guidelines, did it work? If so, Congratulations!!
-   you created an SSL encrypted connection between the SSL Java applet
-   running in your web browser and x11vnc. The fact that you used HTTP
-   instead of HTTPS to download the applet is not the end of the world
-   (some users do it this way), the main thing is that the VNC traffic is
-   encrypted with SSL. If you are having trouble even with the above
-   baseline test case feel free to contact me (please send the Full
-   x11vnc output, not just part of it; the complete x11vnc command line;
-   the URL(s) entered in the browser; the full Java Console output; and
-   anything else you can think of.)
-
-   Next, you can add the features you want one by one testing it still
-   works each time. I suggest first turning on the HTTPS applet download
-   (https://hostname:5900) if that is what you intend to use. That one
-   gives the most trouble because of the ambiguity of passing two
-   different protocols (HTTP and VNC) through the same SSL service port.
-
-   Next, turn on inetd if you intend to use that (this can be tricky too,
-   be sure to use -oa logfile and inspect it carefully if there are
-   problems.) If you are going to use non-standard ports (e.g. "-rfbport
-   443" as root), work on that next. Then enable the firewall, router
-   port redirection channel (you will somehow need to be outside to do
-   that, maybe test that through another VNC session.)
-
-   Then, if you plan to use them, enable "fancy stuff" like "-svc" or
-   "-unixpw", etc, etc. Be sure to add a password either "-rfbauth" or
-   "-unixpw" or both. If you need to have the web browser use a corporate
-   Web Proxy (i.e. it cannot connect directly) work on that last. Ditto
-   for the Apache portal.
-
-
-   Router/Firewall port redirs:  If you are doing port redirection at
-   your router to an internal machine running x11vnc AND the internet
-   facing port is different from the internal machine's VNC port, you
-   will need to apply the PORT applet parameter to indicate to the applet
-   the Internet facing port number (otherwise by default the internal
-   machine's port, say 5900, is sent and that of course is rejected at
-   the firewall/router.) For example:
-  https://far-away.east:443/?GET=1&PORT=443
-
-   So in this example the user configures his router to redirect
-   connections to port 443 on his Internet side to, say, port 5900 on the
-   internal machine running x11vnc. See also the -httpsredir option that
-   will try to automate this for you.
-
-   To configure your router to do port redirection, see its instructions.
-   Typically, from the inside you point a web browser to a special URL
-   (e.g. http://192.168.1.1) and you get a web interface to configure it.
-   Look for something like "Port Redirection" or "Port Forwarding",
-   probably under "Advanced" or something like that. If you have a Linux
-   or Unix system acting as your firewall/router, see its firewall
-   configuration.
-
-   You can also use x11vnc options -rfbport NNNNN and -httpport NNNNN to
-   match the ports that your firewall will be redirecting to the machine
-   where x11vnc is run.
-
-
-   Tedious Dialogs: If you do serve the SSL enabled Java viewer via https
-   be prepared for quite a number of "are you sure you trust this site?"
-   dialogs:
-     * First from the Web browser that cannot verify the self-signed
-       certificate when it downloads index.vnc.
-     * From the Web browser again noting that the common name on the
-       certificate does not match the hostname of the remote machine.
-     * Next from the Java VM that cannot verify the self-signed
-       certificate when it downloads VncViewer.jar.
-     * And also from the Java VM again noting that the common name on the
-       certificate does not match the hostname of the remote machine.
-     * Finally from the Java VncViewer applet itself saying it cannot
-       verify the certificate! (or a popup asking you if you want to see
-       the certificate.)
-
-   Note that sometimes if you pause too long at one of the above dialogs
-   then x11vnc may exceed a timeout and assume the current socket
-   connection is VNC instead of the HTTPS it actually is (but since you
-   have paused too long at the dialog the GET request comes too late.)
-   Often hitting Reload and going through the dialogs more quickly will
-   let you connect. The Java VM dialogs are the most important ones to
-   NOT linger at. If you see in the x11vnc output a request for
-   VncViewer.class instead of VncViewer.jar it is too late... you will
-   need to completely restart the Web browser to get it to try for the
-   jar again. You can use the -https option if you want a dedicated port
-   for HTTPS connections instead of sharing the VNC port.
-
-   To see example x11vnc output for a successful https://host:5900/
-   connection with the Java Applet see This Page. And here is a newer
-   example including the Java Console output.
-
-   All of the x11vnc Java Viewer applet parameters are described in the
-   file classes/ssl/README
-
-
-   Notes on the VNC Viewer ss_vncviewer wrapper script:
-
-   If you want to use a native VNC Viewer with the SSL enabled x11vnc you
-   will need to run an external SSL tunnel on the Viewer side. There do
-   not seem to be any native SSL VNC Viewers outside of our x11vnc and
-   SSVNC packages. The basic ideas of doing this were discussed for
-   external tunnel utilities here.
-
-   The ss_vncviewer script provided with x11vnc and SSVNC can set up the
-   stunnel tunnel automatically on unix as long as the stunnel command is
-   installed on the Viewer machine and available in PATH (and vncviewer
-   too of course.) Note that on a Debian based system you will need to
-   install the package stunnel4 not stunnel. You can set the environment
-   variables STUNNEL and VNCVIEWERCMD to point to the correct programs if
-   you want to override the defaults.
-
-   Here are some examples:
-  1)  ss_vncviewer far-away.east:0
-
-  2)  ss_vncviewer far-away.east:0 -encodings "copyrect tight zrle hextile"
-
-  3)  ss_vncviewer -verify ./server.crt far-away.east:0
-
-  4)  ss_vncviewer -mycert ./client.pem far-away.east:0
-
-  5)  ss_vncviewer -proxy far-away.east:8080 myworkstation:0
-
-   The first one is the default mode and accepts the x11vnc certificate
-   without question. The second one is as the first, but adds the
-   -encodings options to the vncviewer command line.
-
-   The third one requires that the x11vnc server authenticate itself to
-   the client against the certificate in the file ./server.crt (e.g. one
-   created by "x11vnc -ssl SAVE" and safely copied to the VNC viewer
-   machine.)
-
-   The fourth one is for VNC Viewer authentication, it uses ./client.pem
-   to authenticate itself to x11vnc. One can supply both -verify and
-   -mycert simultaneously.
-
-   The fifth one shows that Web proxies can be used if that is the only
-   way to get out of the firewall. If the "double proxy" situation arises
-   separate the two by commas. See this page for more information on how
-   Web proxies come into play.
-
-   If one uses a Certificate Authority (CA) scheme described here, the
-   wrapper script would use the CA cert instead of the server cert:
-  3')  ss_vncviewer -verify ./cacert.crt far-away.east:0
-
-   Update Jul/2006: we now provide an Enhanced TightVNC Viewer (SSVNC)
-   package that starts up STUNNEL automatically along with some other
-   features. All binaries (stunnel, vncviewer, and some utilities) are
-   provided in the package. It works on Unix, Mac OS X, and Windows.
-
-
-   Q-55: How do I use the Java applet VNC Viewer with built-in SSL
-   tunneling when going through a Web Proxy?
-   The SSL enabled Java VNC Viewer and firewall Proxies:
-
-   SSL and HTTPS aside, there is a general problem with Firewall Proxies
-   and Java Applets that open sockets. The applet is downloaded
-   successfully (through the browser) using HTTP and the proxy, but when
-   the applet tries to reconnect to the originating host (the only one
-   allowed by security) it does not use the proxy channel. So it cannot
-   reconnect to the server the applet came from!
-
-   We have found a convenient workaround: in the directory where
-   VncViewer.jar resides there is a digitally signed version of the same
-   applet called SignedVncViewer.jar. Since the applet is digitally
-   signed, there will be an additional dialog from the Java VM plugin
-   asking you if you want to trust the applet fully.
-
-   You should say "Yes". If you do, the applet will be run in a mode
-   where it can try to determine the firewall proxy host name and port
-   (it will ask you for them if it cannot find them.) This way it can
-   connect directly to the Proxy and then request the CONNECT method to
-   be redirected to the originating host (the x11vnc VNC Server.) SSL is
-   then layered over this socket.
-
-   To do this you should use the proxy.vnc HTML file like via this URL in
-   your browser:
-  https://yourmachine.com:5900/proxy.vnc
-
-   (instead of the unsigned one in https://yourmachine.com:5900/ that
-   gives the default index.vnc)
-
-   Proxies that limit CONNECT to ports 443 and 563:
-
-   Things become trickier if the Web proxy restricts which CONNECT ports
-   can be redirected to. For security, some (most?) proxies only allow
-   port 443 (HTTPS) and 563 (SNEWS) by default. In this case, the only
-   thing to do is run x11vnc on that low port, e.g. "-rfbport 443", (or
-   use a port redirection on, say, a firewall or router port 443 to the
-   internal machine.)
-
-   If you do such a redirection to an internal machine and x11vnc is not
-   listening on port 443, you will probably need to edit proxy.vnc.
-   Suppose the SSL x11vnc server was listening on port 5901. You should
-   change the line in proxy.vnc from:
-  <param name=PORT value=$PORT>
-
-   to:
-  <param name=PORT value=443>
-
-   Since otherwise $PORT will be expanded to 5901 by x11vnc and the
-   viewer applet will fail to connect to that port on the firewall.
-
-   Another way to achieve the same thing is to use the applet PORT
-   parameter:
-  https://yourmachine.com/proxy.vnc?PORT=443
-
-   this is cleaner because it avoids editing the file, but requires more
-   parameters in the URL. See also the -httpsredir x11vnc option that
-   will try to automate this for you. To use the GET trick discussed
-   above, do:
-  https://yourmachine.com/proxy.vnc?GET=1&PORT=443
-
-   All of the x11vnc Java Viewer applet parameters are described in the
-   file classes/ssl/README
-
-   Here is an example of Java Console and x11vnc output for the Web proxy
-   case.
-
-
-   Note that both the ss_vncviewer stunnel Unix wrapper script and
-   Enhanced TightVNC Viewer (SSVNC) can use Web proxies as well even
-   though they do not involve a Web browser.
-
-
-   Q-56: Can Apache web server act as a gateway for users to connect via
-   SSL from the Internet with a Web browser to x11vnc running on their
-   workstations behind a firewall?
-   Yes. You will need to configure apache to forward these connections.
-   It is discussed here. This SSL VNC portal provides a clean alternative
-   to the traditional method where the user uses SSH to log in through
-   the gateway to create the encrypted port redirection to x11vnc running
-   on her desktop.
-
-   Also see the desktop.cgi CGI script method that achieves much of what
-   this Apache VNC SSL portal method does (as long as desktop.cgi's 'port
-   redirection' mode is enabled.)
-
-
-   Q-57: Can I create and use my own SSL Certificate Authority (CA) with
-   x11vnc?
-   Yes, see this page for how to do this and the utility commands x11vnc
-   provides to create and manage many types of certificates and private
-   keys.
-
-
-
-   [Display Managers and Services]
-
-   Q-58: How can I run x11vnc as a "service" that is always available?
-
-   There are a number of ways to do this. The primary thing you need to
-   decide is whether you want x11vnc to connect to the X session on the
-   machine 1) regardless of who (or if anyone) has the X session, or 2)
-   only if a certain user has the X session. Because X sessions are
-   protected by X permissions (MIT-MAGIC-COOKIE files XAUTHORITY and
-   $HOME/.Xauthority) the automatically started x11vnc will of course
-   need to have sufficient permissions to connect to the X display.
-
-   Here are some ideas:
-     * Use the description under "Continuously" in the FAQ on x11vnc and
-       Display Managers
-     * Use the description in the FAQ on x11vnc and inetd(8)
-     * Use the description in the FAQ on Unix user logins and inetd(8)
-     * Start x11vnc from your $HOME/.xsession (or $HOME/.xinitrc or
-       autostart script or ...)
-     * Although less reliable, see the x11vnc_loop rc.local hack below.
-
-   The display manager scheme will not be specific to which user has the
-   X session unless a test is specifically put into the display startup
-   script (often named Xsetup.) The inetd(8) scheme may or may not be
-   specific to which user has the X session (and it may not be able to do
-   all users via the XAUTHORITY permission issues.)
-
-   The .xsession/.xinitrc scheme is obviously is specific to a particular
-   user and only when they are logged into X. If you do not know what a
-   $HOME/.xsession script is or how to use one, perhaps your desktop has
-   a "session startup commands" configuration option. The command to be
-   run in the .xsession or .xinitrc file may look like this:
-x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg
-
-   plus any other options you desire.
-
-   Depending on your desktop and/or OS/distribution the automatically run
-   X startup scripts (traditionally .xsession/.xinitrc) may have to be in
-   a different directory or have a different basename. One user
-   recommends the description under 'Running Scripts Automatically' at
-   this link.
-
-   Firewalls: note all methods will require the host-level firewall to be
-   configured to allow connections in on a port. E.g. 5900 (default VNC
-   port) or 22 (default SSH port for tunnelling VNC.) Most systems these
-   days have firewalls turned on by default, so you will actively have to
-   do something to poke a hole in the firewall at the desired port
-   number. See your system administration tool for Firewall settings
-   (Yast, Firestarter, etc.)
-
-
-   Q-59: How can I use x11vnc to connect to an X login screen like xdm,
-   GNOME gdm, KDE kdm, or CDE dtlogin? (i.e. nobody is logged into an X
-   session yet.)
-
-   We describe two scenarios here. The first is called 'One time only'
-   meaning you just need to do it quickly once and don't want to repeat;
-   and the second is called 'Continuously' meaning you want the access to
-   be available after every reboot and after every desktop logout.
-     _________________________________________________________________
-
-   One time only:   If the X login screen is running and you just want to
-   connect to it once (i.e. a one-shot):
-
-   It is usually possible to do this by just adjusting the XAUTHORITY
-   environment variable to point to the correct MIT-COOKIE auth file
-   while running x11vnc as root, e.g. for the gnome display manager, GDM:
-  x11vnc -auth /var/gdm/:0.Xauth -display :0
-
-   (the -auth option sets the XAUTHORITY variable for you.)
-
-   There will be a similar thing to do for xdm using however a different
-   auth directory path (perhaps something like
-   /var/lib/xdm/authdir/authfiles/A:0-XQvaJk) for the xdm greeter or
-   /var/lib/kdm/A:0-crWk72 (or /var/run/xauth/A:0-qQPftr, etc. etc) for
-   the kdm greeter. Of course, the random characters in the file basename
-   will vary and you will need to use the actual filename on your system.
-   Read your system docs to find out where the display manager cookie
-   files are kept.
-
-   Trick: sometimes ps(1) can reveal the X server process -auth argument
-   (e.g. "ps wwaux | grep auth") and hence the path to the auth file.
-
-   x11vnc must be run as root for this because the /var/gdm/:0.Xauth,
-   /var/lib/kdm/A:0-crWk72, etc. auth files are only readable by root. If
-   you do not want to run x11vnc as root, you can copy (as root or sudo)
-   the auth file to some location and make it readable by your userid.
-   Then run x11vnc as your userid with -auth pointed to the copied file.
-
-   Update Dec/2009: use "-auth guess" to have x11vnc try to guess the
-   location of the auth file for you.
-
-   You next connect to x11vnc with a VNC viewer, give your username and
-   password to the X login prompt to start your session.
-
-   Note:  GDM: gdm seems to have an annoying setting that causes x11vnc
-   (and any other X clients) to be killed after the user logs in. Setting
-   KillInitClients=false in the [daemon] section of /etc/X11/gdm/gdm.conf
-   (or /etc/gdm/gdm.conf, etc.) avoids this. Otherwise, just restart
-   x11vnc and then reconnect your viewer. Other display managers (kdm,
-   etc) may also have a similar problem. One user reports having to alter
-   "gdm.conf-custom" as well.
-
-   Note:  Solaris: For dtlogin in addition to the above sort of trick
-   (BTW, the auth file should be in /var/dt), you'll also need to add
-   something like Dtlogin*grabServer:False to the Xconfig file
-   (/etc/dt/config/Xconfig or /usr/dt/config/Xconfig on Solaris, see the
-   example at the end of this FAQ.) Then restart dtlogin, e.g.:
-   /etc/init.d/dtlogin stop; /etc/init.d/dtlogin start or reboot.
-
-   Update Nov/2008: Regarding GDM KillInitClients: see the -reopen option
-   for another possible workaround.
-
-   Update Oct/2009: Regarding GDM KillInitClients: starting with x11vnc
-   0.9.9 it will try to apply heuristics to detect if a window manager is
-   not running (i.e. whether the Display Manager Greeter Login panel is
-   still up.) If it thinks the display manager login is still up it will
-   delay creating windows or using XFIXES. The former is what GDM uses to
-   kill the initial clients, use of the latter can cause a different
-   problem: an Xorg server crash. So with 0.9.9 and later it should all
-   work without needing to set KillInitClients=false (which is a good
-   because recent GDM, v2.24, has removed this option) or use -noxfixes.
-   To disable the heuristics and delaying set X11VNC_AVOID_WINDOWS=never;
-   to set the delay time explicitly use, e.g., X11VNC_AVOID_WINDOWS=120
-   (delays for 120 seconds after the VNC connection; you have that long
-   to log in.)
-     _________________________________________________________________
-
-   Continuously:   Have x11vnc reattach each time the X server is
-   restarted (i.e. after each logout and reboot):
-
-   To make x11vnc always attached to the X server including the login
-   screen you will need to add a command to a display manager startup
-   script.
-
-   Please consider the security implications of this! The VNC display for
-   the X session always accessible (but hopefully password protected.)
-   Add -localhost if you only plan to access via a SSH tunnel.
-
-   The name of the display manager startup script file depends on desktop
-   used and seem to be:
-     GDM (GNOME)  /etc/X11/gdm/Init/Default
-                  /etc/gdm/Init/Default
-     KDM (KDE)    /etc/kde*/kdm/Xsetup
-     XDM          /etc/X11/xdm/Xsetup          (or sometimes xdm/Xsetup_0)
-     CDE          /etc/dt/config/Xsetup
-
-   although the exact location can be operating system, distribution, and
-   time dependent. See the documentation for your display manager:
-   gdm(1), kdm(1), xdm(1), dtlogin(1) for additional details. There may
-   also be display number specific scripts: e.g. Xsetup_0 vs. Xsetup, you
-   need to watch out for.
-
-   Note:  You should read and understand all of the Note's and Update's
-   in the 'One time only' section above. All of the GDM topics apply here
-   as well:
-
-   Note:  GDM: The above (in 'One time only') gdm setting of
-   KillInitClients=false in /etc/X11/gdm/gdm.conf (or /etc/gdm/gdm.conf,
-   etc.) for GDM is needed here as well. Other display managers (KDM,
-   etc) may also have a similar problem.
-
-   Also see the Update Oct/2009 above where x11vnc 0.9.9 and later
-   automatically avoids being killed.
-
-   Note:  DtLogin: The above (in 'One time only')
-   Dtlogin*grabServer:False step for Solaris will be needed for dtlogin
-   here as well.
-
-   In any event, the line you will add to the display manager script
-   (Xsetup, Default, or whatever) will look something like:
-  /usr/local/bin/x11vnc -rfbauth /path/to/the/vnc/passwd -o /var/log/x11vnc.log
- -forever -bg
-
-   where you should customize the exact command to your needs (e.g.
-   -localhost for SSH tunnel-only access; -ssl SAVE for SSL access; etc.)
-
-   Happy, happy, joy, joy:  Note that we do not need to specify -display
-   or -auth because happily they are already set for us in the DISPLAY
-   and XAUTHORITY environment variables for the Xsetup script!!!
-
-   You may also want to force the VNC port with something like "-rfbport
-   5900" (or -N) to avoid autoselecting one if 5900 is already taken.
-     _________________________________________________________________
-
-   Fedora/gdm: Here is an example of what we did on a vanilla install of
-   Fedora-C3 (seems to use gdm by default.) Add a line like this to
-   /etc/X11/gdm/Init/:0
-  /usr/local/bin/x11vnc -rfbauth /etc/x11vnc.passwd -forever -bg -o /var/log/x1
-1vnc.log
-
-   And then add this line to /etc/X11/gdm/gdm.conf (or /etc/gdm/gdm.conf,
-   etc.) in the [daemon] section:
-  KillInitClients=false
-
-   Then restart: /usr/sbin/gdm-restart (or reboot.) The
-   KillInitClients=false setting is important: without it x11vnc will be
-   killed immediately after the user logs in. Here are full details on
-   how to configure gdm
-     _________________________________________________________________
-
-   Solaris/dtlogin: Here is an example of what we did on a vanilla
-   install of Solaris:
-   Make the directory /etc/dt/config:
-  mkdir -p /etc/dt/config
-
-   Copy over the Xconfig file for customization:
-  cp /usr/dt/config/Xconfig /etc/dt/config/Xconfig
-
-   Edit /etc/dt/config/Xconfig and uncomment the line:
-  Dtlogin*grabServer:        False
-
-   Next, copy over Xsetup for customization:
-  cp /usr/dt/config/Xsetup /etc/dt/config/Xsetup
-
-   Edit /etc/dt/config/Xsetup and at the bottom put a line like:
-  /usr/local/bin/x11vnc -forever -o /var/log/x11vnc.log -bg
-
-   (tweaked to your local setup and preferences, a password via -rfbauth,
-   etc. would be a very good idea.)
-
-   Restart the X server and dtlogin:
-  /etc/init.d/dtlogin stop
-  /etc/init.d/dtlogin start
-
-   (or reboot or maybe just restart the X session.)
-     _________________________________________________________________
-
-   KDM: One user running the kdm display manager reports putting this
-   line:
-  x11vnc -forever -rfbauth /home/xyz/.vnc/passwd -bg -o /var/log/x11vnc.log
-
-   in /etc/kde/kdm/Xsetup. After rebooting the system it all seemed to
-   work fine.
-     _________________________________________________________________
-
-
-   If you do not want to deal with any display manager startup scripts,
-   here is a kludgey script that can be run manually or out of a boot
-   file like rc.local: x11vnc_loop It will need some local customization
-   before running. Because the XAUTHORITY auth file must be guessed by
-   this script, use of the display manager script method described above
-   is greatly preferred. There is also the -loop option that does
-   something similar.
-
-   If the machine is a traditional Xterminal you may want to read this
-   FAQ.
-
-   Firewalls: note all methods will require the host-level firewall to be
-   configured to allow connections in on a port. E.g. 5900 (default VNC
-   port) or 22 (default SSH port for tunnelling VNC.) Most systems these
-   days have firewalls turned on by default, so you will actively have to
-   do something to poke a hole in the firewall at the desired port
-   number. See your system administration tool for Firewall settings
-   (Yast, Firestarter, etc.)
-
-
-   Q-60: Can I run x11vnc out of inetd(8)? How about xinetd(8)?
-
-   Yes, perhaps a line something like this in /etc/inetd.conf will do it
-   for you:
-
-  5900 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc_sh
-
-   where the shell script /usr/local/bin/x11vnc_sh uses the -inetd option
-   and looks something like (you'll need to customize to your settings.)
-#!/bin/sh
-/usr/local/bin/x11vnc -inetd -display :0 -auth /home/fred/.Xauthority \
-        -rfbauth /home/fred/.vnc/passwd -o /var/log/x11vnc_sh.log
-
-   Important:  Note that you must redirect the standard error output to a
-   log file (e.g. -o logfile) or "2>/dev/null" for proper operation via
-   inetd (otherwise the standard error also goes to the VNC vncviewer,
-   and that confuses it greatly, causing it to abort.) If you do not use
-   a wrapper script as above but rather call x11vnc directly in
-   /etc/inetd.conf and do not redirect stderr to a file, then you must
-   specify the -q (aka -quiet) option: "/usr/local/bin/x11vnc -q -inetd
-   ...". When you supply both -q and -inet and no "-o logfile" then
-   stderr will automatically be closed (to prevent, e.g. library stderr
-   messages leaking out to the viewer.) The recommended practice is to
-   use "-o logfile" to collect the output in a file or wrapper script
-   with "2>logfile" redirection because the errors and warnings printed
-   out are very useful in troubleshooting problems.
-
-   Note also the need to set XAUTHORITY via -auth to point to the
-   MIT-COOKIE auth file to get permission to connect to the X display
-   (setting and exporting the XAUTHORITY variable accomplishes the same
-   thing.) See the x11vnc_loop file in the previous question for more
-   ideas on what that auth file may be, etc. The scheme described in the
-   FAQ on Unix user logins and inetd(8) works around the XAUTHORITY issue
-   nicely.
-
-   Note:  On Solaris you cannot have the bare number 5900 in
-   /etc/inetd.conf, you'll need to replace it with a word like x11vnc an
-   then put something like "x11vnc 5900/tcp" in /etc/services.
-
-   Since the process runs as root, it might be a bad idea to have the
-   logfile in a world-writable area like /tmp if there are untrustworthy
-   users on the machine. Perhaps /var/log is a better place.
-
-   Be sure to look at your /etc/hosts.allow and /etc/hosts.deny settings
-   to limit the machines that can connect to this service (your desktop!)
-   For the above example with /etc/hosts.allow:
-  x11vnc_sh : 123.45.67.89
-
-   A really safe way to do things is to limit the above inetd to
-   localhost only (via /etc/hosts.allow) and use ssh to tunnel the
-   incoming connection. Using inetd for this prevents there being a tiny
-   window of opportunity between x11vnc starting up and your vncviewer
-   connecting to it. Always use a VNC password to further protect against
-   unwanted access.
-
-   For xinetd(8), one user reports he created the file
-   /etc/xinetd.d/x11vncservice containing the following:
-# default: off
-# description:
-service x11vncservice
-{
-        flags           = REUSE NAMEINARGS
-        port            = 5900
-        type            = UNLISTED
-        socket_type     = stream
-        protocol        = tcp
-        wait            = no
-        user            = root
-        server          = /usr/sbin/tcpd
-        server_args     = /usr/local/bin/x11vnc_sh
-        disable         = no
-}
-
-   With the contents of /usr/local/bin/x11vnc_sh similar to the example
-   given above. One user reports this works with avoiding the wrapper
-   script:
-service x11vncservice
-{
-        port            = 5900
-        type            = UNLISTED
-        socket_type     = stream
-        protocol        = tcp
-        wait            = no
-        user            = root
-        server          = /usr/local/bin/x11vnc
-        server_args     = -inetd -q -display :0 -auth /var/gdm/:0.Xauth
-        disable         = no
-}
-
-   (or one can replace the -q with say "-o /var/log/x11vnc.log" to
-   capture a log)
-
-   The above works nicely for GDM because the -auth file is a fixed name.
-   For KDM or XDM the filename varies. Here is one idea for a x11vnc_sh
-   wrapper to try to guess the name:
-#!/bin/sh
-COLUMNS=256
-export COLUMNS
-authfile=`ps wwaux | grep '/X.*-auth' | grep -v grep | sed -e 's/^.*-auth *//'
--e 's/ .*$//' | head -n 1`
-
-if [ -r "$authfile" ]; then
-        exec /usr/local/bin/x11vnc -inetd -o /var/log/x11vnc.log -display :0 -a
-uth "$authfile"
-fi
-exit 1
-
-   Starting with x11vnc 0.9.3 this can be automated by:
-#!/bin/sh
-exec /usr/local/bin/x11vnc -inetd -o /var/log/x11vnc.log -find -env FD_XDM=1
-
-
-   Q-61: Can I have x11vnc advertise its VNC service and port via mDNS /
-   Zeroconf (e.g. Avahi) so VNC viewers on the local network can detect
-   it automatically?
-
-   Yes, as of Feb/2007 x11vnc supports mDNS / Zeroconf advertising of its
-   service via the Avahi client library. Use the option -avahi (same as
-   -mdns or -zeroconf) to enable it. Depending on your setup you may need
-   to install Avahi (including the development/build packages), enable
-   the server: avahi-daemon and avahi-dnsconfd, and possibly open up UDP
-   port 5353 on your firewall.
-
-   If the Avahi client library or build environment is not available at
-   build-time, then at run-time x11vnc will try to look for external
-   helper programs, avahi-browse(1) or dns-sd(1), to do the work.
-
-   The service was tested with Chicken of the VNC ("Use Bonjour"
-   selected) on a Mac on the same network and the service was noted and
-   listed in the servers list. Clicking on it and then "Connect"
-   connected automatically w/o having to enter any hostnames or port
-   numbers.
-
-   It appears SuSE 10.1 comes with avahi (or you can add packages, e.g.
-   avahi-0.6.5-27) but not the development package (you can use the
-   OpenSuSE avahi-devel rpm.) Unfortunately, you may need to disable
-   another Zeroconf daemon "/etc/init.d/mdnsd stop", before doing
-   "/etc/init.d/avahi-daemon start" and "/etc/init.d/avahi-dnsconfd
-   start". We also had to comment out the browse-domains line in
-   /etc/avahi/avahi-daemon.conf. Hopefully there is "LessConf" to do on
-   other distros/OS's...
-
-
-   Q-62: Can I have x11vnc allow a user to log in with her UNIX username
-   and password and then have it find her X session display on that
-   machine and then attach to it? How about starting an X session if one
-   cannot be found?
-
-   The easiest way to do this is via inetd(8) using the -unixpw and
-   -display WAIT options. The reason inetd(8) makes this easier is that
-   it starts a new x11vnc process for each new user connection. Otherwise
-   a wrapper would have to listen for connections and spawn new x11vnc's
-   (see this example and also the -loopbg option.) inetd(8) is not
-   required for this, but it makes some aspects more general.
-
-   Also with inetd(8) users always connect to a fixed VNC display, say
-   hostname:0, and do not need to memorize a special VNC display number
-   just for their personal use, etc.
-
-   Update: Use the -find, -create, -svc, and -xdmsvc options that are
-   shorthand for common FINDCREATEDISPLAY usage modes (e.g. terminal
-   services) described below. (i.e. simply use "-svc" instead of the
-   cumbersome "-display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users
-   unixpw= -ssl SAVE")
-
-   The -display WAIT option makes x11vnc wait until a VNC viewer is
-   connected before attaching to the X display.
-
-   Additionally it can be used to run an external command that returns
-   the DISPLAY and XAUTHORITY data. We provide some useful builtin ones
-   (FINDDISPLAY and FINDCREATEDISPLAY below), but in principle one could
-   supply his own script: "-display WAIT:cmd=/path/to/find_display" where
-   the script find_display might look something like this.
-
-   A default script somewhat like the above is used under "-display
-   WAIT:cmd=FINDDISPLAY" (same as -find) The format for any such command
-   is that it returns DISPLAY=:disp as the first line and any remaining
-   lines are either XAUTHORITY=file or raw xauth data (the above example
-   does the latter.) If applicable (-unixpw mode), the program is run as
-   the Unix user name who logged in.
-
-   On Linux if the virtual terminal is known the program appends ",VT=n"
-   to the DISPLAY line; a chvt n will be attempted automatically. Or if
-   only the X server process ID is known it appends ",XPID=n" (a chvt
-   will be attempted by x11vnc.)
-
-   Tip: Note that the -find option is an alias for "-display
-   WAIT:cmd=FINDDISPLAY". Use it!
-
-   The -unixpw option allows UNIX password logins. It conveniently knows
-   the Unix username whose X display should be found. Here are a couple
-   /etc/inetd.conf examples of this usage:
-5900  stream  tcp  nowait  nobody  /usr/sbin/tcpd /usr/local/bin/x11vnc -inetd
--unixpw \
-      -find -o /var/log/x11vnc.log -ssl SAVE -ssldir /usr/local/certs
-5900  stream  tcp  nowait  root    /usr/sbin/tcpd /usr/local/bin/x11vnc -inetd
--unixpw \
-      -find -o /var/log/x11vnc.log -ssl SAVE -users unixpw=
-
-   Note we have used the -find alias and the very long lines have been
-   split. An alternative is to use a wrapper script, e.g.
-   /usr/local/bin/x11vnc.sh that has all of the options. (see also the
-   -svc alias.)
-
-   In the first inetd line x11vnc is run as user "nobody" and stays user
-   nobody during the whole session. The permissions of the log files and
-   certs directory will need to be set up to allow "nobody" to use them.
-
-   In the second one x11vnc is run as root and switches to the user that
-   logs in due to the "-users unixpw=" option.
-
-   Note that SSL is required for this mode because otherwise the Unix
-   password would be passed in clear text over the network. In general
-   -unixpw is not required for this sort of scheme, but it is convenient
-   because it determines exactly who the Unix user is whose display
-   should be sought. Otherwise the find_display script would have to use
-   some method to work out DISPLAY, XAUTHORITY, etc (perhaps you use
-   multiple inetd ports and hardwire usernames for different ports.)
-
-   If you really want to disable the SSL or SSH -localhost constraints
-   (this is not recommended unless you really know what you are doing:
-   Unix passwords sent in clear text is a very bad idea...) read the
-   -unixpw documentation.
-
-   A inetd(8) scheme for a fixed user that doesn't use SSL or unix
-   passwds could be:
-  /usr/local/bin/x11vnc -inetd -users =fred -find -rfbauth /home/fred/.vnc/pass
-wd -o /var/log/x11vnc.log
-
-   The "-users =fred" option will cause x11vnc to switch to user fred and
-   then find his X display. The VNC password (-rfbauth) as opposed to
-   Unix password (-unixpw) is used to authenticate the VNC client.
-
-   Similar looking commands to the above examples can be run directly and
-   do not use inetd (just remove the -inetd option and run from the
-   cmdline, etc.)
-
-
-   X Session Creation: An added (Nov/2006) extension to FINDDISPLAY is
-   FINDCREATEDISPLAY where if it does not find an X display via the
-   FINDDISPLAY method it will create an X server session for the user
-   (i.e. desktop/terminal server.) This is the only time x11vnc actually
-   tries to start up an X server (normally it just attaches to an
-   existing one.)
-
-   For virtual sessions you will need to install the Xvfb program (e.g.
-   apt-get install xvfb) or our Xdummy program (see below.)
-
-   By default it will only try to start up virtual (non-hardware) X
-   servers: first Xvfb and if that is not available then Xdummy (included
-   in the x11vnc source code.) Note that Xdummy only works on Linux
-   whereas Xvfb works just about everywhere (and in some situations
-   Xdummy must be run as root.) An advantage of Xdummy over Xvfb is that
-   Xdummy supports RANDR dynamic screen resizing, which can be handy if
-   the user accesses the desktop from different sized screens (e.g.
-   workstation and laptop.)
-
-   So an inetd(8) example might look like:
-5900 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc -inetd \
-      -o /var/log/x11vnc.log -http -prog /usr/local/bin/x11vnc \
-      -ssl SAVE -unixpw -users unixpw= -display WAIT:cmd=FINDCREATEDISPLAY
-
-   Where the very long lines have been split. See below where that long
-   and cumbersome last line is replaced by the -svc alias.
-
-   The above mode will allow direct SSL (e.g. ss_vncviewer or SSVNC)
-   access and also Java Web browers access via: https://hostname:5900/.
-
-   Tip: Note that the -create option is an alias for "-display
-   WAIT:cmd=FINDCREATEDISPLAY-Xvfb".
-
-   Tip: Note that -svc is a short hand for the long "-ssl SAVE -unixpw
-   -users unixpw= -display WAIT:cmd=FINDCREATEDISPLAY" part. Unlike
-   -create, this alias also sets up SSL encryption and Unix password
-   login.
-
-   The above inetd example then simplifies to:
-5900 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc -inetd \
-      -o /var/log/x11vnc.log -http -prog /usr/local/bin/x11vnc \
-      -svc
-
-   Tip: In addition to the usual unixpw parameters, inside the VNC viewer
-   the user can specify after his username (following a ":" see -display
-   WAIT for details) for FINDCREATEDISPLAY they can add "geom=WxH" or
-   "geom=WxHxD" to specify the width, height, and optionally the color
-   depth. E.g. "fred:geom=800x600" at the login: prompt. Also if the env.
-   var X11VNC_CREATE_GEOM is set to the desired WxH or WxHxD that will be
-   used by x11vnc.
-
-   You can set the env. var X11VNC_SKIP_DISPLAY to a comma separated list
-   of displays to ignore in the FINDDISPLAY process (to force creation of
-   new displays in some cases.) The user logging in via the vncviewer can
-   also set this via username:nodisplay=...)
-
-   If you do not plan on using the Java Web browser applet you can remove
-   the -http (and -prog) option since this will speed up logging-in by a
-   few seconds (x11vnc will not have to wait to see if a connection is
-   HTTPS or VNC.)
-
-   For reference, xinetd format in the file, say, /etc/xinetd.d/x11vnc:
-service x11vnc
-{
-        type            = UNLISTED
-        port            = 5900
-        socket_type     = stream
-        protocol        = tcp
-        wait            = no
-        user            = root
-        server          = /usr/local/bin/x11vnc
-        server_args     = -inetd -o /var/log/x11vnc.log -http -prog /usr/local/
-bin/x11vnc -svc
-        disable         = no
-}
-
-   To print out the script in this case use "-display
-   WAIT:cmd=FINDCREATEDISPLAY-print". To change the preference of
-   Xservers and which to try list them, e.g.: "-display
-   WAIT:cmd=FINDCREATEDISPLAY-X,Xvfb,Xdummy" or use "-create_xsrv
-   X,Xvfb,Xdummy". The "X" one means to try to start up a real, hardware
-   X server, e.g. startx(1) (if there is already a real X server running
-   this may only work on Linux and the chvt program may need to be run to
-   switch to the correct Linux virtual terminal.) x11vnc will try to run
-   chvt automatically if it can determine which VT should be switched to.
-
-   XDM/GDM/KDM Login Greeter Panel: If you want to present the user with
-   a xdm/gdm/kdm display manager "greeter" login you can use Xvfb.xdmcp
-   instead of Xvfb, etc in the above list. However, you need to configure
-   xdm/gdm/kdm to accept localhost XDMCP messages, this can be done by
-   (from -help output):
-      If you want the FINDCREATEDISPLAY session to contact an XDMCP login
-      manager (xdm/gdm/kdm) on the same machine, then use "Xvfb.xdmcp"
-      instead of "Xvfb", etc.  The user will have to supply his username
-      and password one more time (but he gets to select his desktop
-      type so that can be useful.)  For this to work, you will need to
-      enable localhost XDMCP (udp port 177) for the display manager.
-      This seems to be:
-
-       for gdm in gdm.conf:   Enable=true in section [xdmcp]
-       for kdm in kdmrc:      Enable=true in section [Xdmcp]
-       for xdm in xdm-config: DisplayManager.requestPort: 177
-
-   Unless you are also providing XDMCP service to xterminals or other
-   machines, make sure that the host access list only allows local
-   connections (the name of this file is often Xaccess and it is usually
-   setup by default to do just that.) Nowadays, host level firewalling
-   will also typically block UDP (port 177 for XDMCP) by default
-   effectively limiting the UDP connections to localhost.
-
-   Tip: Note that -xdmsvc is a short hand alias for the long "-ssl SAVE
-   -unixpw -users unixpw= -display
-   WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp". So we simply use:
-service x11vnc
-{
-        type            = UNLISTED
-        port            = 5900
-        socket_type     = stream
-        protocol        = tcp
-        wait            = no
-        user            = root
-        server          = /usr/local/bin/x11vnc
-        server_args     = -inetd -o /var/log/x11vnc.log -xdmsvc
-        disable         = no
-}
-
-   (Note: use "-svc" instead of "-xdmsvc" for no XDMCP login greeter.)
-
-
-   Local access (VNC Server and VNC Viewer on the same machine): To
-   access your virtual X display session locally (i.e. while sitting at
-   the same machine it is running on) one can perhaps have something like
-   this in their $HOME/.xinitrc
-#!/bin/sh
-x11vnc -create -rfbport 5905 -env WAITBG=1
-vncviewer -geometry +0+0 -encodings raw -passwd $HOME/.vnc/passwd localhost:5
-
-   You may not need the -passwd. Recent RealVNC viewers might be this:
-#!/bin/sh
-x11vnc -create -rfbport 5905 -env WAITBG=1
-vncviewer -FullScreen -PreferredEncoding raw -passwd $HOME/.vnc/passwd localhos
-t:5
-
-   This way a bare X server is run with no window manager or desktop; it
-   simply runs only the VNC Viewer on the real X server. The Viewer then
-   draws the virtual X session on to the real one. On your system it
-   might not be $HOME/.xinitrc, but rather .xsession, .Xclients, or
-   something else. You will need to figure out what it is for your system
-   and configuration.
-
-   There may be a problem if the resolution (WxH) of the virtual X
-   display does not match that of the physical X display.
-
-   If you do not want to or cannot figure out the X startup script name
-   (.xinitrc, etc) you could save the above commands to a shell script,
-   say "vnclocal", and the log in via the normal KDM or GDM greeter
-   program using the "Failsafe" option. Then in the lone xterm that comes
-   up type "vnclocal" to connect to your virtual X display via x11vnc and
-   vncviewer.
-
-     _________________________________________________________________
-
-   Summary: The "-display WAIT:cmd=FINDCREATEDISPLAY" scheme can be used
-   to provide a "desktop service" (i.e. terminal service) on the server
-   machine: you always get some desktop there, either a real hardware X
-   server or a virtual one (depending on how you set things up.)
-
-   So it provides simple "terminal services" based on Unix username and
-   password. The created X server sessions (virtual or real hardware)
-   will remain running after you disconnect the VNC viewer and will be
-   found again on reconnecting via VNC and logging in. To terminate them
-   use the normal way to Exit/LogOut from inside your X session. The user
-   does not have to memorize which VNC display number is his. They all go
-   the same one (e.g. hostname:0) and it switches based on username.
-
-
-   Q-63: Can I have x11vnc restart itself after it terminates?
-
-   One could do this in a shell script, but now there is an option -loop
-   that makes it easier. Of course when x11vnc restarts it needs to have
-   permissions to connect to the (potentially new) X display. This mode
-   could be useful if the X server restarts often. Use e.g. "-loop5000"
-   to sleep 5000 ms between restarts. Also "-loop2000,5" to sleep 2000 ms
-   and only restart 5 times.
-
-   One can also use the -loopbg to emulate inetd(8) to some degree, where
-   each connected process runs in the background. It could be combined,
-   say, with the -svc option to provide simple terminal services without
-   using inetd(8).
-
-
-   Q-64: How do I make x11vnc work with the Java VNC viewer applet in a
-   web browser?
-
-   To have x11vnc serve up a Java VNC viewer applet to any web browsers
-   that connect to it, run x11vnc with this option:
-  -httpdir /path/to/the/java/classes/dir
-
-   (this directory will contain the files index.vnc and, for example,
-   VncViewer.jar) Note that libvncserver contains the TightVNC Java
-   classes jar file for your convenience. (it is the file
-   classes/VncViewer.jar in the source tree.)
-
-   You will see output something like this:
-  14/05/2004 11:13:56 Autoprobing selected port 5900
-  14/05/2004 11:13:56 Listening for HTTP connections on TCP port 5800
-  14/05/2004 11:13:56   URL http://walnut:5800
-  14/05/2004 11:13:56 screen setup finished.
-  14/05/2004 11:13:56 The VNC desktop is walnut:0
-  PORT=5900
-
-   then you can connect to that URL with any Java enabled browser. Feel
-   free to customize the default index.vnc file in the classes directory.
-
-   As of May/2005 the -http option will try to guess where the Java
-   classes jar file is by looking in expected locations and ones relative
-   to the x11vnc binary.
-
-   Also note that if you wanted to, you could also start the Java viewer
-   entirely from the viewer-side by having the jar file there and using
-   either the java or appletviewer commands to run the program.
-  java -cp ./VncViewer.jar VncViewer HOST far-away.east PORT 5900
-
-   Proxies: See the discussion here if the web browser must use a web
-   proxy to connect to the internet. It is tricky to get Java applets to
-   work in this case: a signed applet must be used so it can connect to
-   the proxy and ask for the redirection to the VNC server. One way to do
-   this is to use the signed SSL one referred to in classes/ssl/proxy.vnc
-   and set disableSSL=yes (note that this has no encryption; please use
-   SSL or SSH as discuss elsewhere on this page) in the URL or the file.
-
-
-   Q-65: Are reverse connections (i.e. the VNC server connecting to the
-   VNC viewer) using "vncviewer -listen" and vncconnect(1) supported?
-
-   As of Mar/2004 x11vnc supports reverse connections. On Unix one starts
-   the VNC viewer in listen mode: "vncviewer -listen" (see your
-   documentation for Windows, etc), and then starts up x11vnc with the
-   -connect option. To connect immediately at x11vnc startup time use the
-   "-connect host:port" option (use commas for a list of hosts to connect
-   to.) The ":port" is optional (default is VNC listening port is 5500.)
-
-   If a file is specified instead: -connect /path/to/some/file then that
-   file is checked periodically (about once a second) for new hosts to
-   connect to.
-
-   The -remote control option (aka -R) can also be used to do this during
-   an active x11vnc session, e.g.:
-x11vnc -display :0 -R connect:hostname.domain
-
-   Use the "-connect_or_exit" option to have x11vnc exit if the reverse
-   connection fails. Also, note the "-rfbport 0" option disables TCP
-   listening for connections (potentially useful for reverse connection
-   mode, assuming you do not want any "forward" connections.)
-
-   Note that as of Mar/2006 x11vnc requires password authentication for
-   reverse connections as well as for forward ones (assuming password
-   auth has been enabled, e.g. via -rfbauth, -passwdfile, etc.) Many VNC
-   servers do not require any password for reverse connections. To regain
-   the old behavior supply this option "-env
-   X11VNC_REVERSE_CONNECTION_NO_AUTH=1" to x11vnc.
-
-   Vncconnect command: To use the vncconnect(1) program (from the core
-   VNC package at www.realvnc.com) specify the -vncconnect option to
-   x11vnc (Note: as of Dec/2004 -vncconnect is now the default.)
-   vncconnect(1) must be pointed to the same X11 DISPLAY as x11vnc (since
-   it uses X properties to communicate with x11vnc.) If you do not have
-   or do not want to get the vncconnect(1) program, the following script
-   (named "Vncconnect") may work if your xprop(1) supports the -set
-   option:
-#!/bin/sh
-# usage: Vncconnect <host>
-#        Vncconnect <host:port>
-# note: not all xprop(1) support -set.
-#
-xprop -root -f VNC_CONNECT 8s -set VNC_CONNECT "$1"
-
-
-   Q-66: Can reverse connections be made to go through a Web or SOCKS
-   proxy or SSH?
-
-   Yes, as of Oct/2007 x11vnc supports reverse connections through
-   proxies: use the "-proxy host:port" option. The default is to assume
-   the proxy is a Web proxy. Note that most Web proxies only allow proxy
-   destination connections to ports 443 (HTTPS) and 563 (SNEWS) and so
-   this might not be too useful unless the proxy has been modified
-   (AllowCONNECT apache setting) or the VNC viewer listens on one of
-   those ports (or the router does a port redir.) A web proxy may also be
-   specified via "-proxy http://host:port"
-
-   For SOCKS4 and SOCKS4a proxies use this format "-proxy
-   socks://host:port". If the reverse connection hostname is a numerical
-   IP or "localhost" then SOCKS4 (no host lookup) is used, otherwise
-   SOCKS4a will be used. For SOCKS5 (proxy will do lookup and many other
-   things) use "-proxy socks5://host:port". Note that the SSH builtin
-   SOCKS proxy "ssh -D port" only does SOCKS4 or SOCKS5, so use socks5://
-   for a ssh -D proxy.
-
-   The proxying works for both SSL encrypted and normal reverse
-   connections.
-
-   An experimental mode is "-proxy http://host:port/..." where the URL
-   (e.g. a CGI script) is retrieved via the GET method. See -proxy for
-   more info.
-
-   Another experimental mode is "-proxy ssh://user@host" in which case a
-   SSH tunnel is used for the proxying. See -proxy for more info.
-
-   Up to 3 proxies may be chained together by listing them by commas
-   e.g.: "-proxy http://host1:port1,socks5://host2:port2" in case one
-   needs to ricochet off of several machines to ultimately reach the
-   listening viewer.
-
-
-   Q-67: Can x11vnc provide a multi-user desktop web login service as an
-   Apache CGI or PHP script?
-   Yes. See the example script desktop.cgi for ideas. It is in the source
-   tree in the directory x11vnc/misc. It serves x11vnc's SSL enabled Java
-   Applet to the web browser with the correct connection information for
-   the user's virtual desktop (an Xvfb session via -create; be sure to
-   add the Xvfb package.) HTTPS/SSL enabled Apache should be used to
-   serve the script to avoid unix and vnc passwords from being sent in
-   cleartext and sniffed.
-
-   By default it uses a separate VNC port for each user desktop (either
-   by autoprobing in a range of ports or using a port based on the userid
-   number.) The web server's firewall must allow incoming connections to
-   these ports.
-
-   It is somewhat difficult to do all of this with x11vnc listening on a
-   single port, however there is also a 'fixed port' scheme described in
-   the script based on -loopbg that works fairly well (but more
-   experience is needed to see what problems contention for the same port
-   causes; however at worst one user may need to re-login.)
-
-   There is also an optional 'port redirection' mode for desktop.cgi that
-   allows redirection to other machines inside the firewall already
-   running SSL enabled VNC servers. This provides much of the
-   functionality as the SSL Portal and is easier to set up.
-
-
-   Q-68: Can I use x11vnc as a replacement for Xvnc? (i.e. not for a real
-   display, but for a virtual one I keep around.)
-
-   You can, but you would not be doing this for performance reasons (for
-   virtual X sessions via VNC, Xvnc should give the fastest response.)
-   You may want to do this because Xvnc is buggy and crashes, does not
-   support an X server extension you desire, or you want to take
-   advantage of one of x11vnc's unending number of options and features.
-
-   One way to achieve this is to have a Xvfb(1) virtual framebuffer X
-   server running in the background and have x11vnc attached to it.
-   Another method, faster and more accurate, is to use the "dummy" Device
-   Driver in XFree86/Xorg (see below.)
-
-   For these virtual sessions you will need to install the Xvfb program
-   (e.g. apt-get install xvfb) or our Xdummy program (see below.)
-
-   In either case, one can view this desktop both remotely and also
-   locally using vncviewer. Make sure vncviewer's "-encodings raw" is in
-   effect for local viewing (compression seems to slow things down
-   locally.) For local viewing you set up a "bare" window manager that
-   just starts up vncviewer and nothing else (See how below.)
-
-   Here is one way to start up Xvfb:
-  xinit -- /usr/bin/Xvfb :1 -cc 4 -screen 0 1024x768x16
-
-   This starts up a 16bpp virtual display. To export it via VNC use
-  x11vnc -display :1 ...
-
-   Then have the remote vncviewer attach to x11vnc's VNC display (e.g. :0
-   which is port 5900.)
-
-   The "-cc 4" Xvfb option is to force it to use a TrueColor visual
-   instead of DirectColor (this works around a recent bug in the Xorg
-   Xvfb server.)
-
-   One good thing about Xvfb is that the virtual framebuffer exists in
-   main memory (rather than in the video hardware), and so x11vnc can
-   "screen scrape" it very efficiently (more than, say, 100X faster than
-   normal video hardware.)
-
-   Update Nov/2006: See the FINDCREATEDISPLAY discussion of the "-display
-   WAIT:cmd=FINDDISPLAY" option where virtual (Xvfb or Xdummy, or even
-   real ones by changing an option) X servers are started automatically
-   for new users connecting. This provides a "desktop service" for the
-   machine. You either get your real X session or your virtual
-   (Xvfb/Xdummy) one whenever you connect to the machine (inetd(8) is a
-   nice way to provide this service.) The -find, -create, -svc, and
-   -xdmsvc aliases can also come in handy here.
-
-   There are some annoyances WRT Xvfb however. The default keyboard
-   mapping seems to be very poor. One should run x11vnc with -add_keysyms
-   option to have keysyms added automatically. Also, to add the Shift_R
-   and Control_R modifiers something like this is needed:
-#!/bin/sh
-xmodmap -e "keycode any = Shift_R"
-xmodmap -e "add Shift = Shift_L Shift_R"
-xmodmap -e "keycode any = Control_R"
-xmodmap -e "add Control = Control_L Control_R"
-xmodmap -e "keycode any = Alt_L"
-xmodmap -e "keycode any = Alt_R"
-xmodmap -e "keycode any = Meta_L"
-xmodmap -e "add Mod1 = Alt_L Alt_R Meta_L"
-
-   (note: these are applied automatically in the FINDCREATEDISPLAY mode
-   of x11vnc.) Perhaps the Xvfb options -xkbdb or -xkbmap could be used
-   to get a better default keyboard mapping...
-
-   Dummy Driver:  A user points out a faster and more accurate method is
-   to use the "dummy" Device Driver of XFree86/Xorg instead of Xvfb. He
-   uses this to create a persistent and resizable desktop accessible from
-   anywhere. In the Device Section of the config file set Driver "dummy".
-   You may also need to set VideoRam NNN to be large enough to hold the
-   framebuffer. The framebuffer is kept in main memory like Xvfb except
-   that the server code is closely correlated with the real XFree86/Xorg
-   Xserver unlike Xvfb.
-
-   The main drawback to this method (besides requiring extra
-   configuration and possibly root permission) is that it also does the
-   Linux Virtual Console/Terminal (VC/VT) switching even though it does
-   not need to (since it doesn't use a real framebuffer.) There are some
-   "dual headed" (actually multi-headed/multi-user) patches to the X
-   server that turn off the VT usage in the X server. Update: As of
-   Jul/2005 we have an LD_PRELOAD script Xdummy that allows you to use a
-   stock (i.e. unpatched) Xorg or XFree86 server with the "dummy" driver
-   and not have any VT switching problems! An advantage of Xdummy over
-   Xvfb is that Xdummy supports RANDR dynamic screen resizing.
-
-   The standard way to start the "dummy" driver would be:
-startx -- :1 -config /etc/X11/xorg.conf.dummy
-
-   where the file /etc/X11/xorg.conf.dummy has its Device Section
-   modified as described above. To use the LD_PRELOAD wrapper script:
-startx -- /path/to/Xdummy :1
-
-   An xdm(1) example is also provided.
-
-   In general, one can use these sorts of schemes to use x11vnc to export
-   other virtual X sessions, say Xnest or even Xvnc itself (useful for
-   testing x11vnc.)
-
-   Local access (VNC Server and VNC Viewer on the same machine): You use
-   a VNC viewer to access the display remotely; to access your virtual X
-   display locally (i.e. while sitting at the same machine it is running
-   on) one can perhaps have something like this in their $HOME/.xinitrc
-#!/bin/sh
-x11vnc -display :5 -rfbport 5905 -bg
-vncviewer -geometry +0+0 -encodings raw -passwd $HOME/.vnc/passwd localhost:5
-
-   The display numbers (VNC and X) will likely be different (you could
-   also try -find), and you may not need the -passwd. Recent RealVNC
-   viewers might be this:
-#!/bin/sh
-x11vnc -display :5 -rfbport 5905 -bg
-vncviewer -FullScreen -PreferredEncoding raw -passwd $HOME/.vnc/passwd localhos
-t:5
-
-   This way a bare X server is run with no window manager or desktop; it
-   simply runs only the VNC Viewer on the real X server. The Viewer then
-   draws the virtual X session on to the real one. On your system it
-   might not be $HOME/.xinitrc, but rather .xsession, .Xclients, or
-   something else. You will need to figure out what it is for your system
-   and configuration.
-
-
-   XDM/GDM/KDM One-Shot X sessions: For the general replacement of Xvnc
-   by Xvfb+x11vnc, one user describes a similar setup he created where
-   the X sessions are one-shot's (destroyed after the vncviewer
-   disconnects) and it uses the XDM/GDM/KDM login greeter here.
-
-
-   Q-69: How can I use x11vnc on "headless" machines? Why might I want
-   to?
-
-   An interesting application of x11vnc is to let it export displays of
-   "headless" machines. For example, you may have some lab or server
-   machines with no keyboard, mouse, or monitor, but each one still has a
-   video card. One can use x11vnc to provide a simple "desktop service"
-   from these server machines.
-
-   An X server can be started on the headless machine (sometimes this
-   requires configuring the X server to not fail if it cannot detect a
-   keyboard or mouse, see the next paragraph.) Then you can export that X
-   display via x11vnc (e.g. see this FAQ) and access it from anywhere on
-   the network via a VNC viewer.
-
-   Some tips on getting X servers to start on machines without keyboard
-   or mouse: For XFree86/Xorg the Option "AllowMouseOpenFail" "true"
-   "ServerFlags" config file option is useful. On Solaris Xsun the
-   +nkeyboard and +nmouse options are useful (put them in the server
-   command line args in /etc/dt/config/Xservers.) There are patches
-   available for Xsun at lease back to Solaris 8 that support this. See
-   Xserver(1) for more info.
-
-   Although this usage may sound strange it can be quite useful for a GUI
-   (or other) testing or QA setups: the engineers do not need to walk to
-   lab machines running different hardware, OS's, versions, etc (or have
-   many different machines in their office.) They just connect to the
-   various test machines over the network via VNC. The advantage to
-   testing this way instead of using Xvnc or even Xvfb is that the test
-   is done using the real X server, fonts, video hardware, etc. that will
-   be used in the field.
-
-   One can imagine a single server machine crammed with as many video
-   cards as it can hold to provide multiple simultaneous access or
-   testing on different kinds of video hardware.
-
-   See also the FINDCREATEDISPLAY discussion of the "-display
-   WAIT:cmd=FINDDISPLAY" option where virtual Xvfb or Xdummy, or real X
-   servers are started automatically for new users connecting. The -find,
-   -create, -svc, and -xdmsvc aliases can also come in handy here.
-
-   [Resource Usage and Performance]
-
-   Q-70: I have lots of memory, but why does x11vnc fail with    shmget:
-   No space left on device    or    Minor opcode of failed request: 1
-   (X_ShmAttach)?
-
-   It is not a matter of free memory, but rather free shared memory (shm)
-   slots, also known as shm segments. This often occurs on a public
-   Solaris machine using the default of only 100 slots. You (or the owner
-   or root) can clean them out with ipcrm(1). x11vnc tries hard to
-   release its slots, but it, and other programs, are not always able to
-   (e.g. if kill -9'd.)
-
-   Sometimes x11vnc will notice the problem with shm segments and tries
-   to get by with fewer, only giving a warning like this:
-  19/03/2004 10:10:58 shmat(tile_row) failed.
-  shmat: Too many open files
-  19/03/2004 10:10:58 error creating tile-row shm for len=4
-  19/03/2004 10:10:58 reverting to single_copytile mode
-
-   Here is a shell script shm_clear to list and prompt for removal of
-   your unattached shm segments (attached ones are skipped.) I use it
-   while debugging x11vnc (I use "shm_clear -y" to assume "yes" for each
-   prompt.) If x11vnc is regularly not cleaning up its shm segments,
-   please contact me so we can work to improve the situation.
-
-   Longer term, on Solaris you can put something like this in
-   /etc/system:
-  set shmsys:shminfo_shmmax = 0x2000000
-  set shmsys:shminfo_shmmni = 0x1000
-
-   to sweep the problem under the rug (4096 slots.) On Linux, examine
-   /proc/sys/kernel/shmmni; you can modify the value by writing to that
-   file.
-
-   Things are even more tight on Solaris 8 and earlier, there is a
-   default maximum number of shm segments per process of 6. The error is
-   the X server (not x11vnc) being unable to attach to the segments, and
-   looks something like this:
-  30/04/2004 14:04:26 Got connection from client 192.168.1.23
-  30/04/2004 14:04:26   other clients:
-  X Error of failed request:  BadAccess (attempt to access private resource den
-ied)
-     Major opcode of failed request:  131 (MIT-SHM)
-     Minor opcode of failed request:  1 (X_ShmAttach)
-     Serial number of failed request:  14
-     Current serial number in output stream:  17
-
-   This tight limit on Solaris 8 can be increased via:
-  set shmsys:shminfo_shmseg = 100
-
-   in /etc/system. See the next paragraph for more workarounds.
-
-   To minimize the number of shm segments used by x11vnc try using the
-   -onetile option (corresponds to only 3 shm segments used, and adding
-   -fs 1.0 knocks it down to 2.) If you are having much trouble with shm
-   segments, consider disabling shm completely via the -noshm option.
-   Performance will be somewhat degraded but when done over local machine
-   sockets it should be acceptable (see an earlier question discussing
-   -noshm.)
-
-
-   Q-71: How can I make x11vnc use less system resources?
-
-   The -nap (now on by default; use -nonap to disable) and "-wait n"
-   (where n is the sleep between polls in milliseconds, the default is 30
-   or so) option are good places to start. In addition, something like
-   "-sb 15" will cause x11vnc to go into a deep-sleep mode after 15
-   seconds of no activity (instead of the default 60.)
-
-   Reducing the X server bits per pixel depth (e.g. to 16bpp or even
-   8bpp) will further decrease memory I/O and network I/O. The ShadowFB X
-   server setting will make x11vnc's screen polling less severe. Using
-   the -onetile option will use less memory and use fewer shared memory
-   slots (add -fs 1.0 for one less slot.)
-
-
-   Q-72: How can I make x11vnc use MORE system resources?
-
-   You can try -threads (note this mode can be unstable and/or crash; and
-   as of May/2008 is strongly discouraged, see the option description) or
-   dial down the wait time (e.g. -wait 1) and possibly dial down -defer
-   as well. Note that if you try to increase the "frame rate" too much
-   you can bog down the server end with the extra work it needs to do
-   compressing the framebuffer data, etc.
-
-   That said, it is possible to "stream" video via x11vnc if the video
-   window is small enough. E.g. a 256x192 xawtv TV capture window (using
-   the x11vnc -id option) can be streamed over a LAN or wireless at a
-   reasonable frame rate. If the graphics card's framebuffer read rate is
-   faster than normal then the video window size and frame rate can be
-   much higher. The use of TurboVNC and/or TurboJPEG can make the frame
-   rate somewhat higher still (but most of this hinges on the graphics
-   card's read rate.)
-
-
-   Q-73: I use x11vnc over a slow link with high latency (e.g. dialup
-   modem or broadband), is there anything I can do to speed things up?
-
-   Some things you might want to experiment with (many of which will help
-   performance on faster links as well):
-
-     X server/session parameters:
-     * Configure the X server bits per pixel to be 16bpp or even 8bpp.
-       (reduces amount of data needed to be polled, compressed, and sent)
-     * Use a smaller desktop size (e.g. 1024x768 instead of 1280x1024)
-     * Make sure the desktop background is a solid color (the background
-       is resent every time it is re-exposed.) Consider using the -solid
-       [color] option to try to do this automatically.
-     * Configure your window manager or desktop "theme" to not use fancy
-       images, shading, and gradients for the window decorations, etc.
-       Disable window animations, etc. Maybe your desktop has a "low
-       bandwidth" theme you can easily switch into and out of. Also in
-       Firefox disable eye-candy, e.g.: Edit -> Preferences -> Advanced
-       -> Use Smooth Scrolling (deselect it.)
-     * Avoid small scrolls of large windows using the Arrow keys or
-       scrollbar. Try to use PageUp/PageDown instead. (not so much of a
-       problem in x11vnc 0.7.2 if -scrollcopyrect is active and detecting
-       scrolls for the application.)
-     * If the -wireframe option is not available (earlier than x11vnc
-       0.7.2 or you have disabled it via -nowireframe) then Disable
-       Opaque Moves and Resizes in the window manager/desktop.
-     * However if -wireframe is active (on by default in x11vnc 0.7.2)
-       then you should Enable Opaque Moves and Resizes in the window
-       manager! This seems counter-intuitive, but because x11vnc detects
-       the move/resize events early there is a huge speedup over a slow
-       link when Opaque Moves and Resizes are enabled. (e.g. CopyRect
-       encoding will be used.)
-     * Turn off Anti-aliased fonts on your system, web browser, terminal
-       windows, etc. AA fonts do not compress as well as traditional
-       fonts (sometimes 10X less.)
-     * On Firefox/Mozilla (and anything else) turn off "Smooth Scroll"
-       animations. In Firefox put in the URL "about:config" and set
-       general.smoothScroll to false.
-     * On Xorg/XFree86 turn on the Shadow Framebuffer to speed up
-       reading. (Option "ShadowFB" "true" in the Device section of
-       /etc/X11/XF86Config) This disables 2D acceleration on the physical
-       display and so may not be worth it (if you play games, etc), but
-       could be of use in some situations. Note: If the network link is
-       very slow, this speedup may not be noticed.
-
-     VNC viewer parameters:
-     * Use a TightVNC enabled viewer! (Actually, RealVNC 4.x viewer with
-       ZRLE encoding is not too bad either; some claim it is faster.)
-     * Make sure the tight (or zrle) encoding is being used (look at
-       vncviewer and x11vnc outputs)
-     * Request 8 bits per pixel using -bgr233 (up to 4X speedup over
-       depth 24 TrueColor (32bpp), but colors will be off)
-     * RealVNC 4.x viewer has some extremely low color modes (only 64 and
-       even 8 colors.) SSVNC does too. The colors are poor, but it is
-       usually noticeably faster than bgr233 (256 colors.)
-     * Try increasing the TightVNC -compresslevel (compresses more on
-       server side before sending, but uses more CPU)
-     * Try reducing the TightVNC -quality (increases JPEG compression,
-       but is lossy with painting artifacts)
-     * Try other VNC encodings via -encodings (tight may be the fastest,
-       but you should compare it to zrle and maybe some of the others)
-     * On the machine where vncviewer is run, make sure Backing Store is
-       enabled (Xorg/XFree86 disables it by default causing re-exposures
-       of vncviewer to be very slow) Option "backingstore" in config
-       file.
-
-     x11vnc parameters:
-     * Make sure the -wireframe option is active (it should be on by
-       default) and you have Opaque Moves/Resizes Enabled in the window
-       manager.
-     * Make sure the -scrollcopyrect option is active (it should be on by
-       default.) This detects scrolls in many (but not all) applications
-       an applies the CopyRect encoding for a big speedup.
-     * Enforce a solid background when VNC viewers are connected via
-       -solid
-     * Try x11vnc's client-side caching client-side caching scheme:
-       -ncache
-     * Specify -speeds modem to force the wireframe and scrollcopyrect
-       heuristic parameters (and any future ones) to those of a dialup
-       modem connection (or supply the rd,bw,lat numerical values that
-       characterize your link.)
-     * If wireframe and scrollcopyrect aren't working, try using the more
-       drastic -nodragging (no screen updates when dragging mouse, but
-       sometimes you miss visual feedback)
-     * Set -fs 1.0 (disables fullscreen updates)
-     * Try increasing -wait or -defer (reduces the maximum "frame rate",
-       but won't help much for large screen changes)
-     * Try the -progressive pixelheight mode with the block pixelheight
-       100 or so (delays sending vertical blocks since they may change
-       while viewer is receiving earlier ones)
-     * If you just want to watch one (simple) window use -id or -appshare
-       (cuts down extraneous polling and updates, but can be buggy or
-       insufficient)
-     * Set -nosel (disables all clipboard selection exchange)
-     * Use -nocursor and -nocursorpos (repainting the remote cursor
-       position and shape takes resources and round trips)
-     * On very slow links (e.g. <= 28.8) you may need to increase the
-       -readtimeout n setting if it sometimes takes more than 20sec to
-       paint the full screen, etc.
-     * Do not use -fixscreen to automatically refresh the whole screen,
-       tap three Alt_L's then the screen has painting errors (rare
-       problem.)
-
-
-   Example for the KDE desktop:
-
-   Launch the "KDE Control Center" utility. Sometimes this is called
-   "Personal Settings".
-
-   Select "Desktop".
-
-    Then Select "Window Behavior". In the "Moving" Tab set these:
-     * YES - Display content in moving windows
-     * YES - Display content in resizing windows
-     * NO   - Display window geometry when moving or resizing
-     * NO   - Animate minimize and restore
-
-    In the "Translucency" Tab set:
-     * NO   - Use translucency/shadows
-
-   Next hit "Back" and then select "Panels".
-
-    In the "Appearance" Tab set:
-     * NO   - Enable icon mouseover effects
-     * NO   - Enable transparency
-
-   Now go all the way back up to the top and Select "Appearance &
-   Themes".
-
-    Select "Background" and set:
-     * YES - No picture
-     * Colors: Single Color
-
-    Select "Fonts" and disable anti-aliased fonts if you are bold enough.
-
-    Select "Launch Feedback" and set:
-     * Busy Cursor: No Busy Cursor
-     * NO   - Enable taskbar notification
-
-    Select "Screen Saver" and set:
-     * Screen Saver: Blank Screen
-
-    Select "Style" and in the "Effects" Tab set:
-     * NO   - Enable GUI effects
-
-
-   Example for the GNOME desktop:
-     * TBD.
-
-
-   Q-74: Does x11vnc support the X DAMAGE Xserver extension to find
-   modified regions of the screen quickly and efficiently?
-
-   Yes, as of Mar/2005 x11vnc will use the X DAMAGE extension by default
-   if it is available on the display. This requires libXdamage to be
-   available in the build environment as well (recent Linux distros and
-   Solaris 10 have it.)
-
-   The DAMAGE extension enables the X server to report changed regions of
-   the screen back to x11vnc. So x11vnc doesn't have to guess where the
-   changes are (by polling every pixel of the entire screen every 2-4
-   seconds.) The use of X DAMAGE dramatically reduces the load when the
-   screen is not changing very much (i.e. most of the time.) It also
-   noticeably improves updates, especially for very small changed areas
-   (e.g. clock ticking, cursor flashing, typing, etc.)
-
-   Note that the DAMAGE extension does not speed up the actual reading of
-   pixels from the video card framebuffer memory, by, say, mirroring them
-   in main memory. So reading the fb is still painfully slow (e.g.
-   5MB/sec), and so even using X DAMAGE when large changes occur on the
-   screen the bulk of the time is still spent retrieving them. Not ideal,
-   but use of the ShadowFB XFree86/Xorg option speeds up the reading
-   considerably (at the cost of h/w acceleration.)
-
-   Unfortunately the current Xorg DAMAGE extension implementation can at
-   times be overly conservative and report very large rectangles as
-   "damaged" even though only a small portion of the pixels have actually
-   been modified. This behavior is often the fault of the window manager
-   (e.g. it redraws the entire, unseen, frame window underneath the
-   application window when it gains focus), or the application itself
-   (e.g. does large, unnecessary repaints.)
-
-   To work around this deficiency, x11vnc currently only trusts small
-   DAMAGE rectangles to contain real damage. The larger rectangles are
-   only used as hints to focus the traditional scanline polling (i.e. if
-   a scanline doesn't intersect a recent DAMAGE rectangle, the scan is
-   skipped.) You can use the "-xd_area A" option to adjust the size of
-   the trusted DAMAGE rectangles. The default is 20000 pixels (e.g. a
-   140x140 square, etc.) Use "-xd_area 0" to disable the cutoff and trust
-   all DAMAGE rectangles.
-
-   The option "-xd_mem f" may also be of use in tuning the algorithm. To
-   disable using DAMAGE entirely use "-noxdamage".
-
-
-   Q-75: My OpenGL application shows no screen updates unless I supply
-   the -noxdamage option to x11vnc.
-   One user reports in his environment (MythTV using the NVIDIA OpenGL
-   drivers) he gets no updates after the initial screen is drawn unless
-   he uses the "-noxdamage" option.
-
-   This seems to be a bug in the X DAMAGE implementation of that driver.
-   You may have to use -noxdamage as well. A way to autodetect this will
-   be tried, probably the best it will do is automatically stop using X
-   DAMAGE.
-
-   A developer for MiniMyth reports that the 'alphapulse' tag of the
-   theme G.A.N.T. can also cause problems, and should be avoided when
-   using VNC.
-
-   Update: see this FAQ too.
-
-
-   Q-76: When I drag windows around with the mouse or scroll up and down
-   things really bog down (unless I do the drag in a single, quick
-   motion.) Is there anything to do to improve things?
-
-   This problem is primarily due to slow hardware read rates from video
-   cards: as you scroll or move a large window around the screen changes
-   are much too rapid for x11vnc to keep up them (it can usually only
-   read the video card at about 5-10 MB/sec, so it can take a good
-   fraction of a second to read the changes induce from moving a large
-   window, if this to be done a number of times in succession the window
-   or scroll appears to "lurch" forward.) See the description in the
-   -pointer_mode option for more info. The next bottleneck is compressing
-   all of these changes and sending them out to connected viewers,
-   however the VNC protocol is pretty much self-adapting with respect to
-   that (updates are only packaged and sent when viewers ask for them.)
-
-   As of Jan/2004 there are some improvements to libvncserver. The
-   default should now be much better than before and dragging small
-   windows around should no longer be a huge pain. If for some reason
-   these changes make matters worse, you can go back to the old way via
-   the "-pointer_mode 1" option.
-
-   Also added was the -nodragging option that disables all screen updates
-   while dragging with the mouse (i.e. mouse motion with a button held
-   down.) This gives the snappiest response, but might be undesired in
-   some circumstances when you want to see the visual feedback while
-   dragging (e.g. menu traversal or text selection.)
-
-   As of Dec/2004 the -pointer_mode n option was introduced. n=1 is the
-   original mode, n=2 an improvement, etc.. See the -pointer_mode n help
-   for more info.
-
-   Also, in some circumstances the -threads option can improve response
-   considerably. Be forewarned that if more than one vncviewer is
-   connected at the same time then libvncserver may not be thread safe
-   (try to get the viewers to use different VNC encodings, e.g. tight and
-   ZRLE.) This option can be unstable and so as of Feb/2008 it is
-   disabled by default. Set env. X11VNC_THREADED=1 to re-enable.
-
-   As of Apr/2005 two new options (see the wireframe FAQ and
-   scrollcopyrect FAQ below) provide schemes to sweep this problem under
-   the rug for window moves or resizes and for some (but not all) window
-   scrolls. These are the preferred way of avoiding the "lurching"
-   problem, contact me if they are not working. Note on SuSE and some
-   other distros the RECORD X extension used by scrollcopyrect is not
-   enabled by default, turn it on in xorg.conf:
-Section "Module"
-        ...
-        Load  "record"
-        ...
-EndSection
-
-
-   Q-77: Why not do something like wireframe animations to avoid the
-   windows "lurching" when being moved or resized?
-
-   Nice idea for a hack! As of Apr/2005 x11vnc by default will apply
-   heuristics to try to guess if a window is being (opaquely) moved or
-   resized. If such a change is detected framebuffer polling and updates
-   will be suspended and only an animated "wireframe" (a rectangle
-   outline drawn where the moved/resized window would be) is shown. When
-   the window move/resize stops, it returns to normal processing: you
-   should only see the window appear in the new position. This spares you
-   from interacting with a "lurching" window between all of the
-   intermediate steps. BTW the lurching is due to slow video card read
-   rates (see here too.) A displacement, even a small one, of a large
-   window requires a non-negligible amount of time, a good fraction of a
-   second, to read in from the hardware framebuffer.
-
-   Note that Opaque Moves/Resizes must be Enabled by your window manager
-   for -wireframe to do any good.
-
-   The mode is currently on by default because most people are afflicted
-   with the problem. It can be disabled with the -nowireframe option (aka
-   -nowf.) Why might one want to turn off the wireframing? Since x11vnc
-   is merely guessing when windows are being moved/resized, it may guess
-   poorly for your window-manager or desktop, or even for the way you
-   move the pointer. If your window-manager or desktop already does its
-   own wireframing then this mode is a waste of time and could do the
-   wrong thing occasionally. There may be other reasons the new mode
-   feels unnatural. If you have very expensive video hardware (SGI, well
-   now even proprietary Xorg drivers are fast at reading) or are using an
-   in-RAM video framebuffer (SunRay, ShadowFB, Xvfb), the read rate from
-   that framebuffer may be very fast (100's of MB/sec) and so you don't
-   really see much lurching (at least over a fast LAN): opaque moves look
-   smooth in x11vnc. Note: ShadowFB is often turned on when you are using
-   the vesafb or fbdev XFree86 video driver instead of a native one so
-   you might be using it already and not know.
-
-   The heuristics used to guess window motion or resizing are simple, but
-   are not fool proof: x11vnc is sometimes tricked and so you'll
-   occasionally see the lurching opaque move and rarely something even
-   worse.
-
-   First it assumes that the move/resize will occur with a mouse button
-   pressed, held down and dragged (of course this is only mostly true.)
-   Next it will only consider a window for wireframing if the mouse
-   pointer is initially "close enough" to the edges of the window frame,
-   e.g. you have grabbed the title bar or a resizer edge (this
-   requirement can be disabled and it also not applied if a modifier key,
-   e.g. Alt, is pressed.) If these are true, it will wait an amount of
-   time to see if the window starts moving or resizing. If it does, it
-   starts drawing the wireframe "outline" of where the window would be.
-   When the mouse button is released, or a timeout occurs, it goes back
-   to the standard mode to allow the actual framebuffer changes to
-   propagate to the viewers.
-
-   These parameters can be tweaked:
-     * Color/Shade of the wireframe.
-     * Linewidth of the outline frame.
-     * Cutoff size of windows to not apply wireframing to.
-     * Cutoffs for closeness to Top, Bottom, Left, and Right edges of
-       window.
-     * Modifier keys to enable interior window grabbing.
-     * Maximum time to wait for dragging pointer events.
-     * Maximum time to wait for the window to start moving/resizing.
-     * Maximum time to show a wireframe animation.
-     * Minimum time between sending wireframe outlines.
-
-   See the "-wireframe tweaks" option for more details. On a slow link,
-   e.g. dialup modem, the parameters may be automatically adjusted for
-   better response.
-
-
-   CopyRect encoding:  In addition to the above there is the
-   "-wirecopyrect mode" option. It is also on by default. This instructs
-   x11vnc to not only show the wireframe animation, but to also instruct
-   all connected VNC viewers to locally translate the window image data
-   from the original position to the new position on the screen when the
-   animation is done. This speedup is the VNC CopyRect encoding: the
-   framebuffer update doesn't need to send the actual new image data.
-   This is nice in general, and very convenient over a slow link, but
-   since it is based on heuristics you may need to disable it with the
-   -nowirecopyrect option (aka -nowcr) if it works incorrectly or
-   unnaturally for you.
-
-   The -wirecopyrect modes are: "never" (same as -nowirecopyrect); "top",
-   only apply the CopyRect if the window is appears to be on the top of
-   the window stack and is not obstructed by other windows; and "always"
-   to always try to apply the CopyRect (obstructed regions are usually
-   clipped off and not translated.)
-
-   Note that some desktops (KDE and xfce) appear to mess with the window
-   stacking in ways that are not yet clear. In these cases x11vnc works
-   around the problem by applying the CopyRect even if obscuring windows'
-   data is translated! Use -nowirecopyrect if this yields undesirable
-   effects for your desktop.
-
-   Also, the CopyRect encoding may give incorrect results under -scale
-   (depending on the scale factor the CopyRect operation is often only
-   approximate: the correctly scaled framebuffer will be slightly
-   different from the translated one.) x11vnc will try to push a
-   "cleanup" update after the CopyRect if -scale is in effect. Use
-   -nowirecopyrect if this or other painting errors are unacceptable.
-
-
-   Q-78: Can x11vnc try to apply heuristics to detect when a window is
-   scrolling its contents and use the CopyRect encoding for a speedup?
-
-   Another nice idea for a hack! As of May/2005 x11vnc will by default
-   apply heuristics to try to detect if the window that has the input
-   focus is scrolling its contents (but only when x11vnc is feeding user
-   input, keystroke or pointer, to the X server.) So, when detected,
-   scrolls induced by dragging on a scrollbar or by typing (e.g. Up or
-   Down arrows, hitting Return in a terminal window, etc), will show up
-   much more quickly than via the standard x11vnc screen polling update
-   mechanism.
-
-   There will be a speedup for both slow and fast links to viewers. For
-   slow links the speedup is mostly due to the CopyRect encoding not
-   requiring the image data to be transmitted over the network. For fast
-   links the speedup is primarily due to x11vnc not having to read the
-   scrolled framebuffer data from the X server (recall that reading from
-   the hardware framebuffer is slow.)
-
-   To do this x11vnc uses the RECORD X extension to snoop the X11
-   protocol between the X client with the focus window and the X server.
-   This extension is usually present on most X servers (but SuSE disables
-   it for some reason.) On XFree86/Xorg it can be enabled via Load
-   "record" in the Module section of the config file if it isn't already:
-Section "Module"
-        ...
-        Load  "record"
-        ...
-EndSection
-
-   Currently the RECORD extension is used as little as possible so as to
-   not slow down regular use. Only simple heuristics are applied to
-   detect XCopyArea and XConfigureWindow calls from the application.
-   These catch a lot of scrolls, e.g. in mozilla/firefox and in terminal
-   windows like gnome-terminal and xterm. Unfortunately the toolkits KDE
-   applications use make scroll detection less effective (only rarely are
-   they detected: i.e. Konqueror and Konsole don't work.) An interesting
-   project, that may be the direction x11vnc takes, is to record all of
-   the X11 protocol from all clients and try to "tee" the stream into a
-   modified Xvfb watching for CopyRect and other VNC speedups. A
-   potential issue is the RECORD stream is delayed from actual view on
-   the X server display: if one falls too far behind it could become a
-   mess...
-
-   The initial implementation of -scrollcopyrect option is useful in that
-   it detects many scrolls and thus gives a much nicer working
-   environment (especially when combined with the -wireframe
-   -wirecopyrect options, which are also on by default; and if you are
-   willing to enable the ShadowFB things are very fast.) The fact that
-   there aren't long delays or lurches during scrolling is the primary
-   improvement.
-
-   But there are some drawbacks:
-     * Not all scrolls are detected. Some apps scroll windows in ways
-       that cannot currently be detected, and other times x11vnc "misses"
-       the scroll due to timeouts, etc. Sometimes it is more distracting
-       that a speedup occasionally doesn't work as opposed to being
-       consistently slow!
-     * For rapid scrolling (i.e. sequence of many scrolls over a short
-       period) there can be painting errors (tearing, bunching up, etc.)
-       during the scroll. These will repair themselves after the scroll
-       is over, but when they are severe it can be distracting. Try to
-       think of the approximate window contents as a quicker and more
-       useful "animation" compared to the slower polling scheme...
-     * Scrolling inside shells in terminal windows (gnome-terminal,
-       xterm), can lead to odd painting errors. This is because x11vnc
-       did not have time to detect a screen change just before the scroll
-       (most common is the terminal undraws the block cursor before
-       scrolling the text up: in the viewer you temporarily see multiple
-       block cursors.) Another issue is with things like more(1): scroll
-       detection for 5-6 lines happens nicely, but then it can't keep up
-       and so there is a long pause for the standard polling method to
-       deliver the remaining updates.
-     * More rarely sometimes painting errors are not repaired after the
-       scroll is over. This may be a bug in x11vnc or libvncserver, or it
-       may be an inescapable fact of the CopyRect encoding and the delay
-       between RECORD callbacks and what is actually on the X display.
-       One can tap the Alt_L key (Left "Alt" key) 3 times in a row to
-       signal x11vnc to refresh the screen to all viewers. Your
-       VNC-viewer may have its own screen refresh hot-key or button. See
-       also: -fixscreen
-     * Some applications, notably OpenOffice, do XCopyArea scrolls in
-       weird ways that assume ancestor window clipping is taking place.
-       See the -scr_skip option for ways to tweak this on a
-       per-application basis.
-     * Selecting text while dragging the mouse may be slower, especially
-       if the Button-down event happens near the window's edge. This is
-       because the scrollcopyrect scheme is watching for scrolls via
-       RECORD and has to wait for a timeout to occur before it does the
-       update.
-     * For reasons not yet understood the RECORD extension can stop
-       responding (and hence scrolls are missed.) As a workaround x11vnc
-       attempts to reset the RECORD connection every 60 seconds or so.
-       Another workaround is to type 4 Super_L (Left Super/Windows-Flag
-       key) in a row to reset RECORD. Work is in progress to try to fix
-       this bug.
-     * Sometimes you need to "retrain" x11vnc for a certain window
-       because it fails to detect scrolls in it. Sometimes clicking
-       inside the application window or selecting some text in it to
-       force the focus helps.
-     * When using the -scale option there will be a quick CopyRect
-       scroll, but it needs to be followed by a slower "cleanup" update.
-       This is because for a fixed finite screen resolution (e.g. 75 dpi)
-       scaling and copyrect-ing are not exactly independent. Scaling
-       involves a blending of nearby pixels and if you translate a pixel
-       the neighbor pixel weighting may be different. So you have to wait
-       a bit for the cleanup update to finish. On slow links x11vnc may
-       automatically decide to not detect scrolls when -scale is in
-       effect. In general it will also try to defer the cleanup update if
-       possible.
-
-   If you find the -scrollcopyrect behavior too approximate or
-   distracting you can go back to the standard polling-only update method
-   with the -noscrollcopyrect (or -noscr for short.) If you find some
-   extremely bad and repeatable behavior for -scrollcopyrect please
-   report a bug.
-
-   Alternatively, as with -wireframe, there are many tuning parameters to
-   try to improve the situation. You can also access these parameters
-   inside the gui under "Tuning". These parameters can be tweaked:
-     * The minimum pixel area of a rectangle to be watched for scrolls.
-     * A list if application names to skip scroll detection.
-     * Which keystrokes should trigger scroll detection.
-     * Which applications should have a "terminal" tweak applied to them.
-     * When repeating keys (e.g. Up arrow) should be discarded to
-       preserve a scroll.
-     * Cutoffs for closeness to Top, Bottom, Left, and Right edges of
-       window for mouse induced scrolls.
-     * Set timeout parameters for keystroke induced scrolls.
-     * Set timeout parameters for mouse pointer induced scrolls.
-     * Have the full screen be periodically refreshed to fix painting
-       errors.
-
-
-   Q-79: Can x11vnc do client-side caching of pixel data? I.e. so when
-   that pixel data is needed again it does not have to be retransmitted
-   over the network.
-
-   As of Dec/2006 in the 0.9 development tarball there is an experimental
-   client-side caching implementation enabled by the "-ncache n" option.
-   In fact, during the test period it was on by default with n set to 10.
-   To disable it use "-noncache".
-
-   It is a simple scheme where a (very large) lower portion of the
-   framebuffer (i.e. starting just below the user's actual desktop
-   display) is used for storing pixel data. CopyRect; a fast, essentially
-   local viewer-side VNC encoding; is used to swap the pixel data in and
-   out of the actual display area. It gives an excellent speedup for
-   iconifying/deiconifying and moving windows and re-posting of menus
-   (often it doesn't feel like VNC at all: there is no delay waiting for
-   the pixel data to fill in.)
-
-   This scheme is nice because it does all of this within the existing
-   VNC protocol, and so it works with all VNC viewers.
-
-   A challenge to doing more sophisticated (e.g. compressed and/or
-   shared) client-side caching is that one needs to extend the VNC
-   protocol, modify a viewer and then also convince users to adopt your
-   modified VNC Viewer (or get the new features to be folded into the
-   main VNC viewers, patches accepted, etc... likely takes many years
-   before they might be deployed in the field.) So it is convenient that
-   the "-ncache n" works with any unaltered VNC viewer.
-
-   A drawback of the "-ncache n" method is that in the VNC Viewer you can
-   scroll down and actually see the cached pixel data. So it looks like
-   there is a bug: you can scroll down in your viewer and see a strange
-   "history" of windows on your desktop. This is working as intended. One
-   will need to try to adjust the size of his VNC Viewer window so the
-   cache area cannot be seen. SSVNC (see below) can do this
-   automatically.
-
-   At some point LibVNCServer may implement a "rfbFBCrop" pseudoencoding
-   that viewers can use to learn which portion of the framebuffer to
-   actually show to the users (with the hidden part used for caching, or
-   perhaps something else, maybe double buffering or other offscreen
-   rendering...)
-
-   The Enhanced TightVNC Viewer (SSVNC) Unix viewer has a nice -ycrop
-   option to help hide the pixel cache area from view. It will turn on
-   automatically if the framebuffer appears to be very tall (height more
-   than twice the width), or you can supply the actual value for the
-   height. If the screen is resized by scaling, etc, the ycrop value is
-   scaled as well. In fullscreen mode you cannot scroll past the end of
-   the actual screen, and in non-fullscreen mode the window manager frame
-   is adjusted to fit the actual display (so you don't see the pixel
-   cache region) and the scrollbars are very thin to avoid distraction
-   and trouble fitting inside your display. Use the "-sbwidth n" viewer
-   option to make the scrollbars thicker if you like.
-
-   Another drawback of the scheme is that it is VERY memory intensive,
-   the n in "-ncache n" is the factor of increase over the base
-   framebuffer size to use for caching. It is an even integer and should
-   be fairly large, 6-12, to achieve good response. This usually requires
-   about 50-100MB of additional RAM on both the client and server sides.
-   For example with n=6 a 1280x1024 display will use a framebuffer that
-   is 1280x7168: everything below row 1024 is the pixel buffer cache. If
-   you are running on low memory machines or memory is tight because of
-   other running applications you should not use -ncache.
-
-   The reason for so much memory is because the pixel data is not
-   compressed and so the whole window to be saved must be stored
-   "offscreen". E.g. for a large web browser window this can be nearly 1
-   million pixels, and that is only for a single window! One typically
-   wants to cycle between 5-10 large active windows. Also because both
-   backing-store (the window's actual contents) and save-unders (the
-   pixels covered up by the window) are cached offscreen that introduces
-   an additional factor of 2 in memory use.
-
-   However, even in the smallest usage mode with n equal 2 and
-   -ncache_no_rootpixmap set (this requires only 2X additional
-   framebuffer memory) there is still a noticable improvement for many
-   activities, although it is not as dramatic as with, say n equal 12 and
-   rootpixmap (desktop background) caching enabled.
-
-   The large memory consumption of the current implementation can be
-   thought of as a tradeoff to providing caching and being compatible
-   with all VNC viewers and also ease of implementing. Hopefully it can
-   be tuned to use less, or the VNC community will extend the protocol to
-   allow caching and replaying of compressed blobs of data.
-
-   Another option to experiment with is "-ncache_cr". By specifying it,
-   x11vnc will try to do smooth opaque window moves instead of its
-   wireframe. This can give a very nice effect (note: on Unix the realvnc
-   viewer seems to be smoother than the tightvnc viewer), but can lead to
-   some painting problems, and can be jerky in some circumstances.
-
-   Surprisingly, for very slow connections, e.g. modem, the -ncache_cr
-   option can actually improve window drags. This is probably because no
-   pixel data (only CopyRect instructions) are sent when dragging a
-   window. Normally, the wireframe must be sent and this involves
-   compressing and sending the lines that give rise to the moving box
-   effect (note that real framebuffer data is sent to "erase" the white
-   lines of the box.)
-
-   If you experience painting errors you can can tap the Alt_L key (Left
-   "Alt" key) 3 times in a row to signal x11vnc to refresh the screen to
-   all viewers. You may also need to iconify and then deiconify any
-   damaged windows to correct their cache data as well. Note that if you
-   change color viewer depth (e.g. 8bpp to full color) dynamically that
-   will usually lead to the entire extended framebuffer being resent
-   which can take a long time over very slow links: it may be better to
-   reconnect and reset the format right after doing so. x11vnc will try
-   to detect the format change and clear (make completely black) the
-   cache region.
-
-   Gotcha for older Unix VNC Viewers: The older Unix VNC viewers (e.g.
-   current TightVNC Unix Viewer) require X server backingstore to keep
-   off-viewer screen data local. If the viewer-side X server has
-   backingstore disabled (sadly, currently the default on Linux, etc),
-   then to get the offscreen pixels the viewer has to ask for a refresh
-   over the network, thereby defeating the caching. Use something like
-   this in your viewer-side /etc/X11/xorg.conf file (or otherwise get
-   your viewer-side system to do it)
-Section "Device"
-        ...
-        Option  "backingstore"
-        ...
-EndSection
-
-   No problems like this have been observed with Windows VNC Viewers:
-   they all seem to keep their entire framebuffer in local memory.
-
-   Gotcha for KDE krdc VNC Viewer: One user found that KDE's krdc viewer
-   has some sort of hardwired limit on the maximum size of the
-   framebuffer (64MB?). It fails quickly saying "The connection to the
-   host has been interrupted." The workaround for his 1280x1024
-   x11vnc-side display was to run with "-ncache 10", i.e. a smaller value
-   to be under the krdc threshold.
-
-   Although this scheme is not as quick (nor as compressed) as
-   nx/nomachine, say, it does provide a good step in the direction of
-   improving VNC performance by client side caching.
-
-
-   Q-80: Does x11vnc support TurboVNC?
-
-   As of Feb/2009 (development tarball) there is an experimental kludge
-   to let you build x11vnc using TurboVNC's modified TightVNC encoding.
-   TurboVNC is part of the VirtualGL project. It does two main things to
-   speed up the TightVNC encoding:
-     * It eliminates bottlenecks, overheads, wait-times in the TightVNC
-       encoding implementation and instead only worries about sending
-       very well (and quickly) compressed JPEG data.
-     * A fast proprietary JPEG implemention is used (Intel IPP on x86)
-       instead of the usual libjpeg implementation. TurboJPEG is an
-       interface library, libturbojpeg, provided by the project that
-       achieves this.
-
-   TurboVNC works very well over LAN and evidently fast Broadband too.
-   When using it with x11vnc in such a situation you may want to dial
-   down the delays, e.g. "-wait 5" and "-defer 5" (or even a smaller
-   setting) to poll and pump things out more quickly.
-
-   See the instructions in "x11vnc/misc/turbovnc/README" for how to build
-   x11vnc with TurboVNC support. You will also need to download the
-   TurboJPEG software.
-
-   In brief, the steps look like this:
-  cd x11vnc-x.y.z/x11vnc/misc/turbovnc
-  ./apply_turbovnc
-  cd ../../..
-  env LDFLAGS='-L/DIR -Xlinker --rpath=/DIR' ./configure
-  make AM_LDFLAGS='-lturbojpeg'
-
-   where you replace "/DIR" with the directory containing libturbojpeg.so
-   you downloaded separately. If it works out well enough TurboVNC
-   support will be integrated into x11vnc and more of its tuning features
-   will be implemented. Support for TurboVNC in SSVNC viewer has been
-   added as an experiment as well. If you try either one, let us know how
-   it went.
-
-   There also may be some Linux.i686 and Darwin.i386 x11vnc binaries with
-   TurboVNC support in the misc. bins directory. For other platforms you
-   will need to compile yourself.
-
-   On relatively cheap and old hardware (Althon64 X2 5000+ / GeForce
-   6200) x11vnc and SSVNC, both TurboVNC enabled, were able to sustain
-   13.5 frames/sec (fps) and 15 Megapixels/sec using the VirtualGL
-   supplied OpenGL benchmark program glxspheres. VirtualGL on higher-end
-   hardware can sustain 20-30 fps with the glxspheres benchmark.
-
-   Potential Slowdown: As we describe elsewhere, unless you use x11vnc
-   with an X server using, say, NVidia proprietary drivers (or a virtual
-   X server like Xvfb or Xdummy, or in ShadowFB mode), then the read rate
-   from the graphics card can be rather slow (e.g. 10 MB/sec) and becomes
-   the bottleneck when using x11vnc over fast networks. Note that all of
-   Xorg's drivers currently (2009) have slow read rates (only proprietary
-   drivers appear to have optimized reads.)
-
-   So under these (more or less typical) conditions, the speed
-   improvement provided by TurboVNC may only be marginal. Look for this
-   output to see your read rate:
-  28/02/2009 11:11:07 Autoprobing TCP port
-  28/02/2009 11:11:07 Autoprobing selected port 5900
-  28/02/2009 11:11:08 fb read rate: 10 MB/sec
-  28/02/2009 11:11:08 screen setup finished.
-
-   A rate of 10 MB/sec means a 1280x1024x24 screen takes 0.5 seconds to
-   read in. TurboVNC compresses that to JPEG in a much shorter time. On
-   the other hand, an NVidia driver may have a read rate of 250 MB/sec
-   and so only takes 0.02 seconds to read the entire screen in.
-
-
-
-   [Mouse Cursor Shapes]
-
-   Q-81: Why isn't the mouse cursor shape (the little icon shape where
-   the mouse pointer is) correct as I move from window to window?
-
-   On X servers supporting XFIXES or Solaris/IRIX Overlay extensions it
-   is possible for x11vnc to do this correctly. See a few paragraphs down
-   for the answer.
-
-   Historically, the X11 mouse cursor shape (i.e. little picture: an
-   arrow, X, I-beam, resizer, etc) is one of the few WRITE-only objects
-   in X11. That is, an application can tell the X server what the cursor
-   shape should be when the pointer is in a given window, but a program
-   (like x11vnc) unfortunately cannot read this information. I believe
-   this is because the cursor shape is often downloaded to the graphics
-   hardware (video card), but I could be mistaken.
-
-   A simple kludge is provided by the "-cursor X" option that changes the
-   cursor when the mouse is on the root background (or any window has the
-   same cursor as the root background.) Note that desktops like GNOME or
-   KDE often cover up the root background, so this won't work for those
-   cases. Also see the "-cursor some" option for additional kludges.
-
-   Note that as of Aug/2004 on Solaris using the SUN_OVL overlay
-   extension and IRIX, x11vnc can show the correct mouse cursor when the
-   -overlay option is supplied. See this FAQ for more info.
-
-   Also as of Dec/2004 XFIXES X extension support has been added to allow
-   exact extraction of the mouse cursor shape. XFIXES fixes the problem
-   of the cursor-shape being write-only: x11vnc can now query the X
-   server for the current shape and send it back to the connected
-   viewers. XFIXES is available on recent Linux Xorg based distros and
-   Solaris 10.
-
-   The only XFIXES issue is the handling of alpha channel transparency in
-   cursors. If a cursor has any translucency then in general it must be
-   approximated to opaque RGB values for use in VNC. There are some
-   situations where the cursor transparency can also handled exactly:
-   when the VNC Viewer requires the cursor shape be drawn into the VNC
-   framebuffer or if you apply a patch to your VNC Viewer to extract
-   hidden alpha channel data under 32bpp. Details can be found here.
-
-
-   Q-82: When using XFIXES cursorshape mode, some of the cursors look
-   really bad with extra black borders around the cursor and other cruft.
-   How can I improve their appearance?
-
-   This happens for cursors with transparency ("alpha channel"); regular
-   X cursors (bitmaps) should be correct. Unfortunately x11vnc 0.7 was
-   released with a very poor algorithm for approximating the
-   transparency, which led to the ugly black borders.
-
-   The problem is as follows: XFIXES allows x11vnc to retrieve the
-   current X server cursor shape, including the alpha channel for
-   transparency. For traditional bitmap cursors the alpha value will be 0
-   for completely transparent pixels and 255 for completely opaque
-   pixels; whereas for modern, eye-candy cursors an alpha value between 0
-   and 255 means to blend in the background colors to that degree with
-   the cursor colors. The pixel color blending formula is something like
-   this: Red = Red_cursor * a + Red_background * (1 - a), (where here 0
-   =< a =< 1), with similar for Green and Blue. The VNC protocol does not
-   currently support an alpha channel in cursors: it only supports
-   regular X bitmap cursors and Rich Cursors that have RGB (Red, Green,
-   Blue) color data, but no "A" = alpha data. So in general x11vnc has to
-   approximate a cursor with transparency to create a Rich Cursor. This
-   is easier said than done: some cursor themes have cursors with
-   complicated drop shadows and other forms of translucency.
-
-   Anyway, for the x11vnc 0.7.1 release the algorithm for approximating
-   transparency is much improved and hopefully gives decent cursor shapes
-   for most cursor themes and you don't have to worry about it.
-
-   In case it still looks bad for your cursor theme, there are (of
-   course!) some tunable parameters. The "-alphacut n" option lets you
-   set the threshold "n" (between 0 and 255): cursor pixels with alpha
-   values below n will be considered completely transparent while values
-   equal to or above n will be completely opaque. The default is 240. The
-   "-alphafrac f" option tries to correct individual cursors that did not
-   fare well with the default -alphacut value: if a cursor has less than
-   fraction f (between 0.0 and 1.0) of its pixels selected by the default
-   -alphacut, the threshold is lowered until f of its pixels are
-   selected. The default fraction is 0.33.
-
-   Finally, there is an option -alpharemove that is useful for themes
-   where many cursors are light colored (e.g. "whiteglass".) XFIXES
-   returns the cursor data with the RGB values pre-multiplied by the
-   alpha value. If the white cursors look too grey, specify -alpharemove
-   to brighten them by having x11vnc divide out the alpha value.
-
-   One user played with these parameters and reported back:
- Of the cursor themes present on my system:
-
-   gentoo and gentoo-blue:   alphacut:192 - noalpharemove
-
-   gentoo-silver:            alphacut:127 and alpharemove
-
-   whiteglass and redglass (presumably also handhelds, which is based
-   heavily on redglass) look fine with the apparent default of alphacut:255.
-
-
-   Q-83: In XFIXES mode, are there any hacks to handle cursor
-   transparency ("alpha channel") exactly?
-
-   As of Jan/2005 libvncserver has been modified to allow an alpha
-   channel (i.e. RGBA data) for Rich Cursors. So x11vnc can now send the
-   alpha channel data to libvncserver. However, this data will only be
-   used for VNC clients that do not support the CursorShapeUpdates VNC
-   extension (or have disabled it.) It can be disabled for all clients
-   with the -nocursorshape x11vnc option. In this case the cursor is
-   drawn, correctly blended with the background, into the VNC framebuffer
-   before being sent out to the client. So the alpha blending is done on
-   the x11vnc side. Use the -noalphablend option to disable this behavior
-   (always approximate transparent cursors with opaque RGB values.)
-
-   The CursorShapeUpdates VNC extension complicates matters because the
-   cursor shape is sent to the VNC viewers supporting it, and the viewers
-   draw the cursor locally. This improves response over slow links. Alpha
-   channel data for these locally drawn cursors is not supported by the
-   VNC protocol.
-
-   However, in the libvncserver CVS there is a patch to the TightVNC
-   viewer to make this work for CursorShapeUpdates under some
-   circumstances. This hack is outside of the VNC protocol. It requires
-   the screens on both sides to be depth 24 at 32bpp (it uses the extra 8
-   bits to secretly hide the cursor alpha channel data.) Not only does it
-   require depth 24 at 32bpp, but it also currently requires the client
-   and server to be of the same endianness (otherwise the hidden alpha
-   data gets reset to zero by a libvncserver translation function; we can
-   fix this at some point if there is interest.) The patch is for the
-   TightVNC 1.3dev5 Unix vncviewer and it enables the TightVNC viewer to
-   do the cursor alpha blending locally. The patch code should give an
-   example on how to change the Windows TightVNC viewer to achieve the
-   same thing (send me the patch if you get that working.)
-
-   This patch is applied to the Enhanced TightVNC Viewer (SSVNC) package
-   we provide.
-
-   [Mouse Pointer]
-
-   Q-84: Why does the mouse arrow just stay in one corner in my
-   vncviewer, whereas my cursor (that does move) is just a dot?
-
-   This default takes advantage of a tightvnc extension
-   (CursorShapeUpdates) that allows specifying a cursor image shape for
-   the local VNC viewer. You may disable it with the -nocursor option to
-   x11vnc if your viewer does not have this extension.
-
-   Note: as of Aug/2004 this should be fixed: the default for
-   non-tightvnc viewers (or ones that do not support CursorShapeUpdates)
-   will be to draw the moving cursor into the x11vnc framebuffer. This
-   can also be disabled via -nocursor.
-
-
-   Q-85: Can I take advantage of the TightVNC extension to the VNC
-   protocol where Cursor Positions Updates are sent back to all connected
-   clients (i.e. passive viewers can see the mouse cursor being moved
-   around by another viewer)?
-
-   Use the -cursorpos option when starting x11vnc. A VNC viewer must
-   support the Cursor Positions Updates for the user to see the mouse
-   motions (the TightVNC viewers support this.) As of Aug/2004 -cursorpos
-   is the default. See also -nocursorpos and -nocursorshape.
-
-
-   Q-86: Is it possible to swap the mouse buttons (e.g. left-handed
-   operation), or arbitrarily remap them? How about mapping button clicks
-   to keystrokes, e.g. to partially emulate Mouse wheel scrolling?
-
-   You can remap the mouse buttons via something like: -buttonmap 13-31
-   (or perhaps 12-21.) Also, note that xmodmap(1) lets you directly
-   adjust the X server's button mappings, but in some circumstances it
-   might be more desirable to have x11vnc do it.
-
-   One user had an X server with only one mouse button(!) and was able to
-   map all of the VNC client mouse buttons to it via: -buttonmap 123-111.
-
-   Note that the -debug_pointer option prints out much info for every
-   mouse/pointer event and is handy in solving problems.
-
-   To map mouse button clicks to keystrokes you can use the alternate
-   format where the keystrokes are enclosed between colons like this
-   :<KeySym>: in place of the mouse button digit. For a sequence of
-   keysyms separate them with "+" signs. Look in the include file
-   <X11/keysymdef.h>, or use xev(1), or -debug_keyboard to find the
-   keysym names. Button clicks can also be included in the sequence via
-   the fake keysyms Button1, etc.
-
-   As an example, suppose the VNC viewer machine has a mouse wheel (these
-   generate button 4 and 5 events), but the machine that x11vnc is run on
-   only has the 3 regular buttons. In normal operation x11vnc will
-   discard the button 4 and 5 events. However, either of the following
-   button maps could possibly be of use emulating the mouse wheel events
-   in this case:
-  -buttonmap 12345-123:Prior::Next:
-  -buttonmap 12345-123:Up+Up+Up::Down+Down+Down:
-
-   Exactly what keystroke "scrolling" events they should be bound to
-   depends on one's taste. If this method is too approximate, one could
-   consider not using -buttonmap but rather configuring the X server to
-   think it has a mouse with 5 buttons even though the physical mouse
-   does not. (e.g. 'Option "ZAxisMapping" "4 5"'.)
-
-   Note that when a keysym-mapped mouse button is clicked down this
-   immediately generates the key-press and key-release events (for each
-   keysym in turn if the mapping has a sequence of keysyms.) When the
-   mouse button goes back up nothing is generated.
-
-   If you include modifier keys like Shift_L instead of key-press
-   immediately followed by key-release the state of the modifier key is
-   toggled (however the initial state of the modifier key is ignored.) So
-   to map the right button to type my name 'Karl Runge' I could use this:
-  -buttonmap 3-:Shift_L+k+Shift_L+a+r+l+space+Shift_L+r+Shift_L+u+n+g+e:
-
-   (yes, this is getting a little silly.)
-
-   BTW, Coming the other way around, if the machine you are sitting at
-   does not have a mouse wheel, but the remote machine does (or at least
-   has 5 buttons configured), this key remapping can be useful:
-  -remap Super_R-Button4,Menu-Button5
-
-   you just tap those two keys to get the mouse wheel scrolls (this is
-   more useful than the Up and Down arrow keys because a mouse wheel
-   "click" usually gives a multi-line scroll.)
-   [Keyboard Issues]
-
-   Q-87: How can I get my AltGr and Shift modifiers to work between
-   keyboards for different languages?
-
-   The option -modtweak should help here. It is a mode that monitors the
-   state of the Shift and AltGr Modifiers and tries to deduce the correct
-   keycode to send, possibly by sending fake modifier key presses and
-   releases in addition to the actual keystroke.
-
-   Update:  As of Jul/2004 -modtweak is now the default (use -nomodtweak
-   to get the old behavior.) This was done because it was noticed on
-   newer XFree86 setups even on bland "us" keyboards like "pc104 us"
-   XFree86 included a "ghost" key with both "<" and ">" it. This key does
-   not exist on the keyboard (see this FAQ for more info.) Without
-   -modtweak there was then an ambiguity in the reverse map keysym =>
-   keycode, making it so the "<" symbol could not be typed.
-
-   Also see the FAQ about the -xkb option for a more powerful method of
-   modifier tweaking for use on X servers with the XKEYBOARD extension.
-
-   When trying to resolve keyboard mapping problems, note that the
-   -debug_keyboard option prints out much info for every keystroke and so
-   can be useful debugging things.
-
-   Note that one user had a strange setup and none of the above helped.
-   His solution was to disable all of the above and use -nomodtweak. This
-   is the simplest form of keystroke insertion and it actually solved the
-   problem. Try it if the other options don't help.
-
-
-   Q-88: When I try to type a "<" (i.e. less than) instead I get ">"
-   (i.e. greater than)! Strangely, typing ">" works OK!!
-
-   Does your keyboard have a single key with both "<" and ">" on it? Even
-   if it doesn't, your X server may think your keyboard has such a key
-   (e.g. pc105 in the XF86Config file when it should be something else,
-   say pc104.)
-
-   Short Cut: Try the -xkb or -sloppy_keys options and see if that helps
-   the situation. The discussion below is a bit outdated (e.g. -modtweak
-   is now the default) but it is useful reference for various tricks and
-   so is kept.
-
-
-   The problem here is that on the Xserver where x11vnc is run there are
-   two keycodes that correspond to the "<" keysym. Run something like
-   this to see:
-
-  xmodmap -pk | egrep -i 'KeyCode|less|greater'
-  There are 4 KeySyms per KeyCode; KeyCodes range from 8 to 255.
-      KeyCode     Keysym (Keysym) ...
-       59         0x002c (comma)  0x003c (less)
-       60         0x002e (period) 0x003e (greater)
-       94         0x003c (less)   0x003e (greater)
-
-   That keycode 94 is the special key with both "<" and ">". When x11vnc
-   receives the "<" keysym over the wire from the remote VNC client, it
-   unfortunately maps it to keycode 94 instead of 59, and sends 94 to the
-   X server. Since Shift is down (i.e. you are Shifting the comma key),
-   the X server interprets this as Shifted-94, which is ">".
-
-   A workaround in the X server configuration is to "deaden" that special
-   key:
-
-  xmodmap -e "keycode 94 = "
-
-   However, one user said he had to do this:
-
-  xmodmap -e "keycode 94 = 0x002c 0x003c"
-
-   (If the numerical values are different for your setup, substitute the
-   ones that correspond to your display. The above xmodmap scheme can
-   often be used to work around other ambiguous keysym to keycode
-   mappings.)
-
-   Alternatively, here are some x11vnc options to try to work around the
-   problem:
-   -modtweak
-
-   and
-   -remap less-comma
-
-   These are convenient in that they do not modify the actual X server
-   settings. The former (-modtweak) is a mode that monitors the state of
-   the Shift and AltGr modifiers and tries to deduce the correct keycode
-   sequence to send. Since Jul/2004 -modtweak is now the default. The
-   latter (-remap less-comma) is an immediate remapping of the keysym
-   less to the keysym comma when it comes in from a client (so when Shift
-   is down the comma press will yield "<".)
-
-   See also the FAQ about the -xkb option as a possible workaround using
-   the XKEYBOARD extension.
-
-   Note that the -debug_keyboard option prints out much info for every
-   keystroke to aid debugging keyboard problems.
-
-
-   Q-89: Extra Character Inserted, E.g.: When I try to type a "<" (i.e.
-   less than) instead I get "<," (i.e. an extra comma.)
-
-   This is likely because you press "Shift" then "<" but then released
-   the Shift key before releasing the "<". Because of a keymapping
-   ambiguity the last event "< up" is interpreted as "," because that key
-   unshifted is the comma.
-
-   This extra character insertion will happen for other combinations of
-   characters: in general it can happen whenever the Shift key is
-   released early.
-
-   This should not happen in -xkb mode, because it works hard to resolve
-   the ambiguities. If you do not want to use -xkb, try the option
-   -sloppy_keys to attempt a similar type of algorithm.
-
-   One user had this problem for Italian and German keyboards with the
-   key containing ":" and "." When he typed ":" he would get an extra "."
-   inserted after the ":". The solution was -sloppy_keys.
-
-
-   Q-90: I'm using an "international" keyboard (e.g. German "de", or
-   Danish "dk") and the -modtweak mode works well if the VNC viewer is
-   run on a Unix/Linux machine with a similar keyboard.   But if I run
-   the VNC viewer on Unix/Linux with a different keyboard (e.g. "us") or
-   Windows with any keyboard, I can't type some keys like:   "@", "$",
-   "<", ">", etc. How can I fix this?
-
-   The problem with Windows is it does not seem to handle AltGr well. It
-   seems to fake it up by sending Control_L+Alt_R to applications. The
-   Windows VNC viewer sends those two down keystrokes out on the wire to
-   the VNC server, but when the user types the next key to get, e.g., "@"
-   the Windows VNC viewer sends events bringing the up the
-   Control_L+Alt_R keys, and then sends the "@" keysym by itself.
-
-   The Unix/Linux VNC viewer on a "us" keyboard does a similar thing
-   since "@" is the Shift of the "2" key. The keysyms Shift and "@" are
-   sent to the VNC server.
-
-   In both cases no AltGr is sent to the VNC server, but we know AltGr is
-   needed on the physical international keyboard to type a "@".
-
-   This all worked fine with x11vnc running with the -modtweak option (it
-   figures out how to adjust the Modifier keys (Shift or AltGr) to get
-   the "@".) However it fails under recent versions of XFree86 (and the
-   X.org fork.) These run the XKEYBOARD extension by default and make
-   heavy use of it to handle international keyboards.
-
-   To make a long story short, on these newer XFree86 setups the
-   traditional X keymap lookup x11vnc uses is no longer accurate. x11vnc
-   can't find the keysym "@" anywhere in the keymapping! (even though it
-   is in the XKEYBOARD extended keymapping.)
-
-   How to Solve: As of Jul/2004 x11vnc has two changes:
-     * -modtweak (tweak Modifier keys) is now the default (use
-       -nomodtweak to go back to the old way)
-     * there is a new option -xkb to use the XKEYBOARD extension API to
-       do the Modifier key tweaking.
-
-   The -xkb option seems to fix all of the missing keys: "@", "<", ">",
-   etc.: it is recommended that you try it if you have this sort of
-   problem. Let us know if there are any remaining problems (see the next
-   paragraph for some known problems.) If you specify the -debug_keyboard
-   (aka -dk) option twice you will get a huge amount of keystroke
-   debugging output (send it along with any problems you report.)
-
-   Update: as of Jun/2005 x11vnc will try to automatically enable -xkb if
-   it appears that would be beneficial (e.g. if it sees any of "@", "<",
-   ">", "[" and similar keys are mapped in a way that needs the -xkb to
-   access them.) To disable this automatic check use -noxkb.
-
-   Known problems:
-     * One user had to disable a "ghost" Mode_switch key that was causing
-       problems under -xkb. His physical AltGr key was bound to
-       ISO_Level3_Shift (which seems to be the XKEYBOARD way of doing
-       things), while there was a ghost key Mode_switch (which seems to
-       be obsolete) in the mapping as well. Both of these keysyms were
-       bound to Mod5 and x11vnc was unfortunately choosing Mode_switch.
-       From the x11vnc -xkb -dk -dk output it was noted that Mode_switch
-       was attached to keycode 93 (no physical key generates this
-       keycode) while ISO_Level3_Shift was attached to keycode 113. The
-       keycode skipping option was used to disable the ghost key:
-       -skip_keycodes 93
-     * In implementing -xkb we noticed that some characters were still
-       not getting through, e.g. "~" and "^". This is not really an
-       XKEYBOARD problem. What was happening was the VNC viewer was
-       sending the keysyms asciitilde and asciicircum to x11vnc, but on
-       the X server with the international keyboard those keysyms were
-       not mapped to any keys. So x11vnc had to skip them (Note: as of
-       May/2005 they are added by default see -add_keysyms below.)
-       The way these characters are typically entered on international
-       keyboards is by "dead" (aka "mute") keys. E.g. to enter "~" at the
-       physical display the keysym dead_tilde is pressed and released
-       (this usually involves holding AltGr down while another key is
-       pressed) and then space is pressed. (this can also be used get
-       characters with the "~" symbol on top, e.g. "�" by typing "a"
-       instead of space.)
-       What to do? In general the VNC protocol has not really solved this
-       problem: what should be done if the VNC viewer sends a keysym not
-       recognized by the VNC server side? Workarounds can possibly be
-       created using the -remap x11vnc option:
-  -remap asciitilde-dead_tilde,asciicircum-dead_circumflex
-       etc. Use -remap filename if the list is long. Please send us your
-       workarounds for this problem on your keyboard. Perhaps we can have
-       x11vnc adjust automatically at some point. Also see the
-       -add_keysyms option in the next paragraph.
-       Update: for convenience "-remap DEAD" does many of these mappings
-       at once.
-     * To complement the above workaround using the -remap, an option
-       -add_keysyms was added. This option instructs x11vnc to bind any
-       unknown Keysyms coming in from VNC viewers to unused Keycodes in
-       the X server. This modifies the global state of the X server. When
-       x11vnc exits it removes the extra keymappings it created. Note
-       that the -remap mappings are applied first, right when the Keysym
-       is received from a VNC viewer, and only after that would
-       -add_keysyms, or anything else, come into play.
-       Update: -add_keysyms is now on by default. Use -noadd_keysyms to
-       disable.
-
-
-   Q-91: When typing I sometimes get double, triple, or more of my
-   keystrokes repeated. I'm sure I only typed them once, what can I do?
-
-   This may be due to an interplay between your X server's key autorepeat
-   delay and the extra time delays caused by x11vnc processing.
-
-   Short answer: disable key autorepeating by running the command "xset r
-   off" on the Xserver where x11vnc is run (restore via "xset r on") or
-   use the new (Jul/2004) -norepeat x11vnc option. You will still have
-   autorepeating because that is taken care of on your VNC viewer side.
-
-   Update: as of Dec/2004 -norepeat is now the default. Use -repeat to
-   disable it.
-
-   Details:
-   suppose you press a key DOWN and it generates changes in large regions
-   of the screen. The CPU and I/O work x11vnc does for the large screen
-   change could be longer than your X server's key autorepeat delay.
-   x11vnc may not get to processing the key UP event until after the
-   screen work is completed. The X server believes the key has been held
-   down all this time, and applies its autorepeat rules.
-
-   Even without inducing changes in large regions of the screen, this
-   problem could arise when accessing x11vnc via a dialup modem or
-   otherwise high latency link (e.g. > 250 ms latency.)
-
-   Look at the output of "xset q" for the "auto repeat delay" setting. Is
-   it low (e.g. < 300 ms)? If you turn off autorepeat completely: "xset r
-   off", does the problem go away?
-
-   The workaround is to manually apply "xset r off" and "xset r on" as
-   needed, or to use the -norepeat (which has since Dec/2004 been made
-   the default.) Note that with X server autorepeat turned off the VNC
-   viewer side of the connection will (nearly always) do its own
-   autorepeating so there is no big loss here, unless someone is also
-   working at the physical display and misses his autorepeating.
-
-
-   Q-92: The x11vnc -norepeat mode is in effect, but I still get repeated
-   keystrokes!!
-
-   Are you using x11vnc to log in to an X session via display manager?
-   (as described in this FAQ) If so, x11vnc is starting before your
-   session and it disables autorepeat when you connect, but then after
-   you log in your session startup (GNOME, KDE, ...) could be resetting
-   the autorepeat to be on. Or it could be something inside your desktop
-   trying to be helpful that decides to turn it back on.
-
-   x11vnc in -norepeat mode will by default reset autorepeat to off 2
-   times (to help get thru the session startup problem), but it will not
-   continue to battle with things turning autorepeat back on. It will
-   also turn autorepeat off whenever it goes from a state of zero clients
-   to one client. You can adjust the number of resets via "-norepeat N",
-   or use "-norepeat -1" to have it keep resetting it whenever autorepeat
-   gets turned back on when clients are connected.
-
-   In general you can manually turn autorepeating off by typing "xset r
-   off", or a using desktop utility/menu, or "x11vnc -R norepeat". If
-   something in your desktop is automatically turning it back on you
-   should figure out how to disable that somehow.
-
-
-   Q-93: After using x11vnc for a while, I find that I cannot type some
-   (or any) characters or my mouse clicks and drags no longer have any
-   effect, or they lead to strange effects. What happened?
-
-   Probably a modifier key, e.g. Control or Alt is "stuck" in a pressed
-   down state.
-
-   This happens for VNC in general by the following mechanism. Suppose on
-   the Viewer side desktop there is some hot-key to switch
-   desktops/rooms/spaces, etc. E.g. suppose Alt+LeftArrow moves to the
-   left desktop/room/space. Or suppose an Alt+hotkey combination
-   iconifies a window. This can leave the Alt key pressed down on the
-   remote side.
-
-   Consider the sequence that happens. The Alt_L key and then the
-   LeftArrow key go down. Since you are inside the viewer the Alt_L key
-   press is sent to the other side (x11vnc) and so it is pressed down in
-   the remote desktop as well. (by "Alt_L" we mean the Alt key on the
-   left-hand side of the keyboard.) Your local desktop (where the VNC
-   Viewer is running) then warps to the new desktop/room/space: Leaving
-   the Alt_L key still pressed down in the remote desktop.
-
-   If someone is sitting at the desktop, or when you return in the viewer
-   it may be very confusing because the Alt_L is still pressed down but
-   you (or the person sitting at the desktop) do not realize this.
-   Depending on which remote desktop (x11vnc side) is used, it can act
-   very strangely.
-
-   A quick workaround when you notice this is to press and release all of
-   the Alt, Shift, Control, Windows-Flag, modifier keys to free the
-   pressed one. You need to do this for both the left and right Shift,
-   Alt, Control, etc. keys to be sure.
-
-   Note that many VNC Viewers try to guard against this when they are
-   notified by the window system that the viewer app has "lost focus".
-   When it receives the "lost focus" event, the viewer sends VNC
-   Key-Release events for all modifier keys that are currently pressed
-   down. This does not always work, however, since it depends on how the
-   desktop manages these "warps". If the viewer is not notified it cannot
-   know it needs to release the modifiers.
-
-   You can also use the -clear_mods option to try to clear all of the
-   modifier keys at x11vnc startup. You will still have to be careful
-   that you do not leave the modifier key pressed down during your
-   session. It is difficult to prevent this problem from occurring (short
-   of using -remap to prevent sending all of the problem modifier keys,
-   which would make the destkop pretty unusable.)
-
-   During a session these x11vnc remote control commands can also help:
-   x11vnc -R clear_mods
-   x11vnc -R clear_keys
-   x11vnc -R clear_locks
-   x11vnc -R clear_all
-
-   A similar problem can occur if you accidentally press the Caps_Lock or
-   Num_Lock down. When these are locked on the remote side it can
-   sometimes lead to strange desktop behavior (e.g. cannot drag or click
-   on windows.) As above you may not notice this because the lock isn't
-   down on the local (Viewer) side. See this FAQ on lock keys problem.
-   These options may help avoid the problem: -skip_lockkeys and
-   -capslock. See also -clear_all.
-
-
-   Q-94: The machine where I run x11vnc has an AltGr key, but the local
-   machine where I run the VNC viewer does not. Is there a way I can map
-   a local unused key to send an AltGr? How about a Compose key as well?
-
-   Something like "-remap Super_R-Mode_switch" x11vnc option may work.
-   Note that Super_R is the "Right Windoze(tm) Flaggie" key; you may want
-   to choose another. The -debug_keyboard option comes in handy in
-   finding keysym names (so does xev(1).)
-
-   For Compose how about "-remap Menu-Multi_key" (note that Multi_key is
-   the official name for Compose.) To do both at the same time: "-remap
-   Super_R-Mode_switch,Menu-Multi_key" or use "-remap filename" to
-   specify remappings from a file.
-
-
-   Q-95: I have a Sun machine I run x11vnc on. Its Sun keyboard has just
-   one Alt key labelled "Alt" and two Meta keys labelled with little
-   diamonds. The machine where I run the VNC viewer only has Alt keys.
-   How can I send a Meta keypress? (e.g. emacs needs this)
-
-   Here are a couple ideas. The first one is to simply use xmodmap(1) to
-   adjust the Sun X server. Perhaps xmodmap -e "keysym Alt_L = Meta_L
-   Alt_L" will do the trick. (there are other ways to do it, one user
-   used: xmodmap -e "keycode 26 = Meta_L" for his setup.)
-
-   Since xmodmap(1) modifies the X server mappings you may not want to do
-   this (because it affects local work on that machine.) Something like
-   the -remap Alt_L-Meta_L to x11vnc may be sufficient for ones needs,
-   and does not modify the X server environment. Note that you cannot
-   send Alt_L in this case, maybe -remap Super_L-Meta_L would be a better
-   choice if the Super_L key is typically unused in Unix.
-
-
-   Q-96: Running x11vnc on HP-UX I cannot type "#" I just get a "3"
-   instead.
-
-   One user reports this problem on HP-UX Rel_B.11.23. The problem was
-   traced to a strange keyboard mapping for the machine (e.g. xmodmap -pk
-   output) that looked like:
-  ...
-  039  2                  at                 at               at
-  ...
-  047  3                  numbersign         numbersign       numbersign
-
-   and similar triple mappings (with two in the AltGr/Mode_switch group)
-   of a keysum to a single keycode.
-
-   Use the -nomodtweak option as a workaround. You can also use xmodmap
-   to correct these mappings in the server, e.g.:
-  xmodmap -e "keycode 47 = 3 numbersign"
-
-   Also, as of Feb/2007, set the environment variable MODTWEAK_LOWEST=1
-   (either in your shell or via "-env MODTWEAK_LOWEST=1" option) to
-   handle these mappings better.
-
-
-   Q-97: Can I map a keystroke to a mouse button click on the remote
-   machine?
-
-   This can be done directly in some X servers using AccessX and
-   Pointer_EnableKeys, but is a bit awkward. It may be more convenient to
-   have x11vnc do the remapping. This can be done via the -remap option
-   using the fake "keysyms" Button1, Button2, etc. as the "to" keys (i.e.
-   the ones after the "-")
-
-   As an example, consider a laptop where the VNC viewer is run that has
-   a touchpad with only two buttons. It is difficult to do a middle
-   button "paste" because (using XFree86/Xorg Emulate3Buttons) you have
-   to click both buttons on the touch pad at the same time. This
-   remapping:
-  -remap Super_R-Button2
-
-   maps the Super_R "flag" key press to the Button2 click, thereby making
-   X pasting a bit easier.
-
-   Note that once the key goes down, the button down and button up events
-   are generated immediately on the x11vnc side. When the key is released
-   (i.e. goes up) no events are generated.
-
-   Q-98: How can I get Caps_Lock to work between my VNC viewer and
-   x11vnc?
-
-   This is a little tricky because it is possible to get the Caps_Lock
-   state out of sync between your viewer-side machine and the x11vnc-side
-   X server. For best results, we recommend not ever letting the
-   Caps_Lock keypresses be processed by x11vnc. That way when you press
-   Caps_Lock in the viewer your local machine goes into the Caps_Lock on
-   state and sends keysym "A" say when you press "a". x11vnc will then
-   fake things up so that Shift is held down to generate "A". The
-   -skip_lockkeys option should help to accomplish this. For finer grain
-   control use something like: "-remap Caps_Lock-None".
-
-   Also try the -nomodtweak and -capslock options.
-
-   Another useful option that turns off any Lock keys on the remote side
-   at startup and end is the -clear_all option. During a session you can
-   run these remote control commands to modify the Lock keys:
-   x11vnc -R clear_locks
-   x11vnc -R clear_all
-
-   the former will try to unset any Lock keys, the latter will do same
-   and also try to make it so no key is pressed down (e.g. "stuck" Alt_L,
-   etc.)
-   [Screen Related Issues and Features]
-
-   Q-99: The remote display is larger (in number of pixels) than the
-   local display I am running the vncviewer on. I don't like the
-   vncviewer scrollbars, what I can do?
-
-   vncviewer has a option (usually accessible via F8 key or -fullscreen
-   option) for vncviewer to run in full screen, where it will
-   automatically scroll when the mouse is near the edge of the current
-   view. For quick scrolling, also make sure Backing Store is enabled on
-   the machine vncviewer is run on. (XFree86/Xorg disables it by default
-   for some reason, add Option "backingstore" to XF86Config on the
-   vncviewer side.)
-
-   BTW, contact me if you are having problems with vncviewer in
-   fullscreen mode with your window manager (i.e. no keyboard response.)
-   I have a workaround for vncviewer using XGrabServer().
-
-   There may also be scaling viewers out there (e.g. TightVNC or UltraVNC
-   on Windows) that automatically shrink or expand the remote framebuffer
-   to fit the local display. Especially for hand-held devices. See also
-   the next FAQ on x11vnc scaling.
-
-
-   Q-100: Does x11vnc support server-side framebuffer scaling? (E.g. to
-   make the desktop smaller.)
-
-   As of Jun/2004 x11vnc provides basic server-side scaling. It is a
-   global scaling of the desktop, not a per-client setting. To enable it
-   use the "-scale fraction" option. "fraction" can either be a floating
-   point number (e.g. -scale 0.75) or the alternative m/n fraction
-   notation (e.g. -scale 3/4.) Note that if fraction is greater than one
-   the display is magnified.
-
-   Extra resources (CPU, memory I/O, and memory) are required to do the
-   scaling. If the machine is slow where x11vnc is run with scaling
-   enabled, the interactive response can be unacceptable. OTOH, if run
-   with scaling on a fast machine the performance degradation is usually
-   not a big issue or even noticeable.
-
-   It may help to compile x11vnc with compiler option -O3 or -O4 to speed
-   up the scaling code. Set the CFLAGS env. var. before running
-   configure.
-
-   Also, if you just want a quick, rough "thumbnail" of the display you
-   can append ":nb" to the fraction to turn on "no blending" mode. E.g.:
-   "-scale 1/3:nb" Fonts will be difficult to read, but the larger
-   features will be recognizable. BTW, "no blending" mode is forced on
-   when scaling 8bpp PseudoColor displays (because blending an indexed
-   colormap is a bad idea and leads to random colors, use :fb to force it
-   on.)
-
-   One can also use the ":nb" with an integer scale factor (say "-scale
-   2:nb") to use x11vnc as a screen magnifier for vision impaired
-   applications. Since with integer scale factors the framebuffers become
-   huge and scaling operations time consuming, be sure to use ":nb" for
-   the fastest response.
-
-   In general for a scaled display if you are using a TightVNC viewer you
-   may want to turn off jpeg encoding (e.g. vncviewer -nojpeg host:0.)
-   There appears to be a noise enhancement effect, especially for regions
-   containing font/text: the scaling can introduce some pixel artifacts
-   that evidently causes the tight encoding algorithm to incorrectly
-   detect the regions as image data and thereby introduce additional
-   pixel artifacts due to the lossiness of the jpeg compression
-   algorithm. Experiment to see if -nojpeg vncviewer option improves the
-   readability of text when using -scale to shrink the display size. Also
-   note that scaling may actually slow down the transfer of text regions
-   because after being scaled they do not compress as well. (this can
-   often be a significant slowdown, e.g. 10X.)
-
-   Another issue is that it appears VNC viewers require the screen width
-   to be a multiple of 4. When scaling x11vnc will round the width to the
-   nearest multiple of 4. To disable this use the ":n4" sub option (like
-   ":nb" in the previous paragraph; to specify both use a comma:
-   ":nb,n4", etc.)
-
-   If one desires per-client scaling for something like 1:1 from a
-   workstation and 1:2 from a smaller device (e.g. handheld), currently
-   the only option is to run two (or more) x11vnc processes with
-   different scalings listening on separate ports (-rfbport option, etc.)
-
-   Update: As of May/2006 x11vnc also supports the UltraVNC server-side
-   scaling. This is a per-client scaling by factors 1/2, 1/3, ... and so
-   may be useful for PDA's ("-scale 1/2", etc. will give similar results
-   except that it applies to all clients.) You may need to supply
-   "-rfbversion 3.6" for this to be recognized by UltraVNC viewers.
-
-   BTW, whenever you run two or more x11vnc's on the same X display and
-   use the GUI, then to avoid all of the x11vnc's simultaneously
-   answering the gui you will need to use something like "-connect file1
-   -gui ..." with different connect files for each x11vnc you want to
-   control via the gui (or remote-control.) The "-connect file1" usage
-   gives separate communication channels between a x11vnc process and the
-   gui process. Otherwise they all share the same X property channels:
-   VNC_CONNECT and X11VNC_REMOTE.
-
-   Update: As of Mar/2005 x11vnc now scales the mouse cursor with the
-   same scale factor as the screen. If you don't want that, use the
-   "-scale_cursor frac" option to set the cursor scaling to a different
-   factor (e.g. use "-scale_cursor 1" to keep the cursor at its natural
-   unscaled size.)
-
-
-   Q-101: Does x11vnc work with Xinerama? (i.e. multiple monitors joined
-   together to form one big, single screen.)
-
-   Yes, it should generally work because it simply polls the big
-   effective screen.
-
-   If the viewing-end monitor is not as big as the remote Xinerama
-   display, then the vncviewer scrollbars, etc, will have to be used to
-   pan across the large area. However one user started two x11vnc's, one
-   with "-clip 1280x1024+0+0" and the other with "-clip 1280x1024+1280+0"
-   to split the big screen into two and used two VNC viewers to access
-   them.
-
-   As of Jun/2008: Use "-clip xinerama0" to clip to the first xinerama
-   sub-screen (if xinerama is active.) xinerama1 for the 2nd sub-screen,
-   etc. This way you don't need to figure out the WxH+X+Y of the desired
-   xinerama sub-screen. screens are sorted in increasing distance from
-   the (0,0) origin (I.e. not the Xserver's order.)
-
-   There are a couple potential issues with Xinerama however. If the
-   screen is not rectangular (e.g. 1280x1024 and 1024x768 monitors joined
-   together), then there will be "non-existent" areas on the screen. The
-   X server will return "garbage" image data for these areas and so they
-   may be distracting to the viewer. The -blackout x11vnc option allows
-   you to blacken-out rectangles by manually specifying their WxH+X+Y
-   geometries. If your system has the libXinerama library, the -xinerama
-   x11vnc option can be used to have it automatically determine the
-   rectangles to be blackened out. (Note on 8bpp PseudoColor displays the
-   fill color may not be black.) Update: -xinerama is now on by default.
-
-   Some users have reported that the mouse does not behave properly for
-   their Xinerama display: i.e. the mouse cannot be moved to all regions
-   of the large display. If this happens try using the -xwarppointer
-   option. This instructs x11vnc to fake mouse pointer motions using the
-   XWarpPointer function instead of the XTestFakeMotionEvent XTEST
-   function. (This may be due to a bug in the X server for XTEST when
-   Xinerama is enabled.) Update: As of Dec/2006 -xwarppointer will be
-   applied automatically if Xinerama is detected. To disable use:
-   -noxwarppointer
-
-
-   Q-102: Can I use x11vnc on a multi-headed display that is not Xinerama
-   (i.e. separate screens :0.0, :0.1, ... for each monitor)?
-
-   You can, but it is a little bit awkward: you must start separate
-   x11vnc processes for each screen, and on the viewing end start up
-   separate VNC viewer processes connecting to them. e.g. on the remote
-   end:
-  x11vnc -display :0.0 -bg -q -rfbport 5900
-  x11vnc -display :0.1 -bg -q -rfbport 5901
-
-   (this could be automated in the display manager Xsetup for example)
-   and then on the local machine where you are sitting:
-  vncviewer somehost:0 &
-  vncviewer somehost:1 &
-
-   Note: if you are running on Solaris 8 or earlier you can easily hit up
-   against the maximum of 6 shm segments per process (for Xsun in this
-   case) from running multiple x11vnc processes. You should modify
-   /etc/system as mentioned in another FAQ to increase the limit. It is
-   probably also a good idea to run with the -onetile option in this case
-   (to limit each x11vnc to 3 shm segments), or even -noshm to use no shm
-   segments.
-
-
-   Q-103: Can x11vnc show only a portion of the display? (E.g. for a
-   special purpose application or a very large screen.)
-
-   As of Mar/2005 x11vnc has the "-clip WxH+X+Y" option to select a
-   rectangle of width W, height H and offset (X, Y). Thus the VNC screen
-   will be the clipped sub-region of the display and be only WxH in size.
-   One user used -clip to split up a large Xinerama screen into two more
-   managable smaller screens.
-
-   This also works to view a sub-region of a single application window if
-   the -id or -sid options are used. The offset is measured from the
-   upper left corner of the selected window.
-
-
-   Q-104: Does x11vnc support the XRANDR (X Resize, Rotate and
-   Reflection) extension? Whenever I rotate or resize the screen x11vnc
-   just seems to crash.
-
-   As of Dec/2004 x11vnc supports XRANDR. You enable it with the -xrandr
-   option to make x11vnc monitor XRANDR events and also trap X server
-   errors if the screen change occurred in the middle of an X call like
-   XGetImage. Once it traps the screen change it will create a new
-   framebuffer using the new screen.
-
-   If the connected vnc viewers support the NewFBSize VNC extension
-   (Windows TightVNC viewer and RealVNC 4.0 windows and Unix viewers do)
-   then the viewer will automatically resize. Otherwise, the new
-   framebuffer is fit as best as possible into the original viewer size
-   (portions of the screen may be clipped, unused, etc.) For these
-   viewers you can try the -padgeom option to make the region big enough
-   to hold all resizes and rotations. We have fixed this problem for the
-   TightVNC Viewer on Unix: SSVNC
-
-   If you specify "-xrandr newfbsize" then vnc viewers that do not
-   support NewFBSize will be disconnected before the resize. If you
-   specify "-xrandr exit" then all will be disconnected and x11vnc will
-   terminate.
-
-
-   Q-105: Independent of any XRANDR, can I have x11vnc rotate and/or
-   reflect the screen that the VNC viewers see? (e.g. for a handheld
-   whose screen is rotated 90 degrees.)
-
-   As of Jul/2006 there is the -rotate option allow this. E.g's: "-rotate
-   +90", "-rotate -90", "-rotate x", etc.
-
-
-   Q-106: Why is the view in my VNC viewer completely black? Or why is
-   everything flashing around randomly?
-
-   See the next FAQ for a possible explanation.
-
-
-   Q-107: I use Linux Virtual Terminals (VT's) to implement 'Fast User
-   Switching' between users' sessions (e.g. Betty is on Ctrl-Alt-F7,
-   Bobby is on Ctrl-Alt-F8, and Sid is on Ctrl-Alt-F1: they use those
-   keystrokes to switch between their sessions.)   How come the view in a
-   VNC viewer connecting to x11vnc is either completely black or
-   otherwise all messed up unless the X session x11vnc is attached to is
-   in the active VT?
-
-   This seems to have to do with how applications (the X server processes
-   in this case) must "play nicely" if they are not on the active VT
-   (sometimes called VC for virtual console.) That is, they should not
-   read from the keyboard or mouse or manage the video display unless
-   they have the active VT. Given that it appears the XGetImage() call
-   must ultimately retrieve the framebuffer data from the video hardware
-   itself, it would make sense x11vnc's polling wouldn't work unless the
-   X session had active control of the VT.
-
-   There does not seem to be an easy way to work around this. Even xwd(1)
-   doesn't work in this case (try it.) Something would need to be done at
-   a lower level, say in the XFree86/Xorg X server. Also, using the
-   Shadow Framebuffer (a copy of the video framebuffer is kept in main
-   memory) does not appear to fix the problem.
-
-   If no one is sitting at the workstation and you just want to remotely
-   switch the VT over to the one associated with your X session (so
-   x11vnc can poll it correctly), one can use the chvt(1) command, e.g.
-   "chvt 7" for VT #7.
-
-
-   Q-108: I am using x11vnc where my local machine has "popup/hidden
-   taskbars" and the remote display where x11vnc runs also has
-   "popup/hidden taskbars" and they interfere and fight with each other.
-   What can I do?
-
-   When you move the mouse to the edge of the screen where the popups
-   happen, the taskbars interfere with each other in strange ways. This
-   sometimes happens where the local machine is GNOME or Mac OS X and the
-   remote machine is GNOME. Is there a way to temporarily disable one or
-   both of these magic desktop taskbars?
-
-   One x11vnc user suggests: it should be straightforward to right mouse
-   click on the task bar panel, and uncheck "enable auto-hide" from the
-   panel properties dialog box. This will make the panel always visible.
-
-   Q-109: Help! x11vnc and my KDE screensaver keep switching each other
-   on and off every few seconds.
-
-   This is a new (Jul/2006) problem seen, say, on the version of KDE that
-   is shipped with SuSE 10.1. It is not yet clear what is causing this...
-   If you move the mouse through x11vnc the screensaver shuts off like it
-   should but then a second or two after you stop moving the mouse the
-   screensaver snaps back on.
-
-   This may be a bug in kdesktop_lock. For now the only workaround is to
-   disable the screensaver. You can try using another one such as
-   straight xscreensaver (see the instructions here for how to disable
-   kdesktop_lock.) If you have more info on this or see it outside of KDE
-   please let us know.
-
-   Update: It appears this is due to kdesktop_lock enabling the screen
-   saver when the Monitor is in DPMS low-power state (e.g. standby,
-   suspend, or off.) In Nov/2006 the x11vnc -nodpms option was added as a
-   workaround. Normally it is a good thing that the monitor powers down
-   (since x11vnc can still poll the framebuffer in this state), but if
-   you experience the kdesktop_lock problem you can specify the "-nodpms"
-   option to keep the Monitor out of low power state while VNC clients
-   are connected. This is basically the same as typing "xset dpms force
-   on" periodically. (if you don't want to do these things just disable
-   the screensaver.) Feel free to file a bug against kdesktop_lock with
-   KDE.
-
-   Q-110: I am running the compiz 3D window manager (or beryl, MythTv,
-   Google Earth, or some other OpenGL app) and I do not get screen
-   updates in x11vnc.
-
-   This appears to be because the 3D OpenGL/GLX hardware screen updates
-   do not get reported via the XDAMAGE mechanism. So this is a bug in
-   compiz/beryl or XDAMAGE/Xorg or the (possibly 3rd party) video card
-   driver.
-
-   As a workaround apply the -noxdamage option. As of Feb/2007 x11vnc
-   will try to autodetect the problem and disable XDAMAGE if is appears
-   to be missing a lot of updates. But if you know you are using compiz
-   you might as well always supply -noxdamage. Thanks to this user who
-   reported the problem and discovered the workaround.
-
-   A developer for MiniMyth reports that the 'alphapulse' tag of the
-   theme G.A.N.T. can also cause problems, and should be avoided when
-   using VNC.
-
-   Please report a bug or complaint to Beryl/Compiz and/or Xorg about
-   this: running x11vnc with -noxdamage disables a nice improvement in
-   responsiveness (especially for typing) and also leads to unnecessary
-   CPU and memory I/O load due to the extra polling.
-
-   Update: as of May/2010 NVIDIA may have fixed this problem in their
-   proprietary drivers. See the NVIDIA Release Notes. (look for
-   'x11vnc'.)
-
-   Q-111: Can I use x11vnc to view my VMWare session remotely?
-
-   Yes, since VMWare usually runs as an X application you can view it via
-   x11vnc in the normal way.
-
-   Note that VMWare has several viewing modes:
-     * Normal X application window  (with window manager frame)
-     * Quick-Switch mode  (with no window manager frame)
-     * Fullscreen mode
-
-   The way VMWare does Fullscreen mode on Linux is to display the Guest
-   desktop in a separate Virtual Terminal (e.g. VT 8) (see this FAQ on
-   VT's for background.) Unfortunately, this Fullscreen VT is not an X
-   server. So x11vnc cannot access it (however, see this discussion of
-   -rawfb for a possible workaround.) x11vnc works fine with "Normal X
-   application window" and "Quick-Switch mode" because these use X.
-
-   Update: It appears the in VMWare 5.x the Fullscreen mode is X, so
-   x11vnc access does work.
-
-   One user reports he left his machine with VMWare in the Fullscreen
-   mode, and even though his X session wasn't in the active VT, he could
-   still connect x11vnc to the X session and pass the keystrokes Ctrl-Alt
-   (typing "blind") to the VMWare X app. This induced VMWare to switch
-   out of Fullscreen into Normal X mode and he could continue working in
-   the Guest desktop remotely.
-
-
-   Aside: Sometimes it is convenient (for performance, etc.) to start
-   VMWare in its own X session using startx(1). This can be used to have
-   a minimal window manger (e.g. twm or even no window manager), to
-   improve response. One can also cut the display depth (e.g. to 16bpp)
-   in this 2nd X session to improve video performance. This 2nd X session
-   emulates Fullscreen mode to some degree and can be viewed via x11vnc
-   as long as the VMWare X session is in the active VT.
-
-   Also note that with a little bit of playing with "xwininfo -all
-   -children" output one can extract the (non-toplevel) window-id of the
-   of the Guest desktop only when VMWare is running as a normal X
-   application. Then one can export just the guest desktop (i.e. without
-   the VMWare menu buttons) by use of the -id windowid option. The
-   caveats are the X session VMWare is in must be in the active VT and
-   the window must be fully visible, so this mode is not terribly
-   convenient, but could be useful in some circumstances (e.g. running
-   VMWare on a very powerful server machine in a server room that happens
-   to have a video card, (but need not have a monitor, Keyboard or
-   mouse).)
-
-
-
-   [Exporting non-X11 devices via VNC]
-
-   Q-112: Can non-X devices (e.g. a raw framebuffer) be viewed (and even
-   controlled) via VNC with x11vnc?
-
-   As of Apr/2005 there is support for this. Two options were added:
-   "-rawfb string" (to indicate the raw frame buffer device, file, etc.
-   and its parameters) and "-pipeinput command" (to provide an external
-   program that will inject or otherwise process mouse and keystroke
-   input.) Some useful -pipeinput schemes, VID, CONSOLE, and UINPUT, have
-   since been built into x11vnc for convenience.
-
-   This non-X mode for x11vnc is somewhat experimental because it is so
-   removed in scope from the intended usage of the tool. Incomplete
-   attempt is made to make all of the other options consistent with non-X
-   framebuffer polling. So all of the X-related options (e.g.
-   -add_keysyms, -xkb) are just ignored or may cause an error if used. Be
-   careful applying such an option via remote control.
-
-   The format for the -rawfb string is:
-    -rawfb <type>:<object>@<W>x<H>x<bpp>[-<BPL>][:<R>/<G>/<B>][+<offset>]
-
-   There are also some useful aliases (e.g. "console".) Some examples:
-    -rawfb shm:210337933 at 800x600x32:ff/ff00/ff0000
-
-    -rawfb map:/dev/fb0 at 1024x768x16
-
-    -rawfb map:/tmp/Xvfb_screen0 at 640x480x8+3232
-
-    -rawfb file:/tmp/my.pnm at 250x200x24+37
-
-    -rawfb file:/dev/urandom at 128x128x8
-
-    -rawfb snap:/dev/video0 at 320x240x24 -24to32
-
-    -rawfb console
-
-    -rawfb vt2
-
-    -rawfb video
-
-    -rawfb setup:mycmd.sh
-
-   So the type can be "shm" for shared memory objects, and "map" or
-   "file" for file objects. "map" uses mmap(2) to map the file into
-   memory and is preferred over "file" (that uses the slower lseek(2)
-   access method.) Only use file if map isn't working. BTW, "mmap" is an
-   alias for "map" and if you do not supply a type and the file exists,
-   map is assumed (see the -help output and below for some exceptions to
-   this.) The "snap:" setting applies the -snapfb option with "file:"
-   type reading (this is useful for exporting webcams or TV tuner video;
-   see the next FAQ for more info.)
-
-   Also, if the string is of the form "setup:cmd" then cmd is run and the
-   first line of its output retrieved and used as the rawfb string. This
-   allows initializing the device, determining WxHxB, etc.
-
-   The object will be the numerical shared memory id for the case of shm.
-   The idea here is some other program has created this shared memory
-   segment and periodically updates it with new framebuffer data. x11vnc
-   polls the area for changes. See shmat(2) and ipcs(8) for more info.
-   The ipcs command will list current shared memory segments on the
-   system. Sometimes you can snoop on a program's framebuffer it did not
-   expect you would be polling!
-
-   The object will be the path to the regular or character special file
-   for the cases of map and file. The idea here is that in the case of a
-   regular file some other program is writing/updating framebuffer image
-   data to it. In the case of a character special (e.g. /dev/fb0) it is
-   the kernel that is "updating" the framebuffer data.
-
-   In most cases x11vnc needs to be told the width, height, and number of
-   bits per pixel (bpp) of the framebuffer. This is the @WxHxB field. For
-   the case of the Linux framebuffer device, /dev/fb0, the fbset(8) may
-   be of use (but may not always be accurate for what is currently
-   viewable.) In general some guessing may be required, especially for
-   the bpp. Update: in "-rawfb console" mode x11vnc will use the linuxfb
-   API to try to guess (it is still not always accurate.) Also try
-   "-rawfb vtN" (on x11vnc 0.9.7 and later) for the N-th Linux text
-   console (aka virtual terminal.) If the number of Bytes Per Line is not
-   WxHxB/8 (i.e. the framebuffer lines are padded) you can specify this
-   information after WxHxB via "-BPL", e.g. @800x600x16-2048
-
-   Based on the bpp x11vnc will try to guess the red, green, and blue
-   masks (these indicate which bits correspond to each color.) It if gets
-   it wrong you can specify them manually via the optional ":R/G/B"
-   field. E.g. ":0xff0000/0x00ff00/0x0000ff" (this is the default for
-   32bpp.)
-
-   Finally, the framebuffer may not begin at the beginning of the memory
-   object, so use the optional "+offset" parameter to indicate where the
-   framebuffer information starts. So as an example, the Xvfb virtual
-   framebuffer has options -shmem and -fbdir for exporting its virtual
-   screen to either shm or a mapped file. The format of these is XWD and
-   so the initial header should be skipped. BTW, since XWD is not
-   strictly RGB the view will only be approximate, but usable. Of course
-   for the case of Xvfb x11vnc can poll it much better via the X API, but
-   you get the idea.
-
-   By default in -rawfb mode x11vnc will actually close any X display it
-   happened to open. This is basically to shake out bugs (e.g it will
-   crash rather than mysteriously interacting with the X display.) If you
-   want x11vnc to keep the X display open while polling the raw
-   framebuffer prefix a "+" sign at the beginning of the string (e.g.
-   +file:/dev/urandom at 64x64x8) This could be convenient for keeping the
-   remote control channel active (it uses X properties.) The "-connect
-   /path/to/file" mechanism could also be used for remote control to
-   avoid the X property channel. Rare usage, but if you also supply
-   -noviewonly in this "+" mode then the mouse and keyboard input are
-   still sent to the X display, presumably for doing something amusing
-   with /dev/fb...
-
-   Interesting Devices:. Here are some aliases for interesting device
-   files that can be polled via -rawfb:
-   -rawfb console               /dev/fb0        Linux Console
-   -rawfb vt2                   /dev/vcsa2      Linux Console (e.g. virtual ter
-minal #2)
-   -rawfb video                 /dev/video0     Video4Linux Capture device
-   -rawfb rand                  /dev/urandom    Random Bytes
-   -rawfb null                  /dev/zero       Zero Bytes (black screen)
-
-   The Linux console, /dev/fb0, etc needs to have its driver enabled in
-   the kernel. Some of the drivers are video card specific and
-   accelerated. The console is either the Text consoles (usually
-   tty1-tty6), or X graphical display (usually starting at tty7.) In
-   addition to the text console other graphical ones may be viewed and
-   interacted with as well, e.g. DirectFB or SVGAlib apps, VMWare non-X
-   fullscreen, or Qt-embedded apps (PDAs/Handhelds.) By default the
-   pipeinput mechanisms UINPUT and CONSOLE (keystrokes only) are
-   automatically attempted in this mode under "-rawfb console".
-
-   The Video4Linux Capture device, /dev/video0, etc is either a Webcam or
-   a TV capture device and needs to have its driver enabled in the
-   kernel. See this FAQ for details. If specified via "-rawfb Video" then
-   the pipeinput method "VID" is applied (it lets you change video
-   parameters dynamically via keystrokes.)
-
-   The last two, /dev/urandom and /dev/zero are just for fun, but are
-   also useful in testing.
-
-
-   All of the above -rawfb options are just for viewing the raw
-   framebuffer (although some of the aliases do imply keystroke and mouse
-   pipeinput methods.) That may be enough for certain applications of
-   this feature (e.g. suppose a video camera mapped its framebuffer into
-   memory and you just wanted to look at it via VNC.)
-   To handle the pointer and keyboard input from the viewer users the
-   "-pipeinput cmd" option was added to indicate a helper program to
-   process the user input. The input is streamed to it and looks
-   something like this:
-   Pointer 1 205 257 0 None
-   Pointer 1 198 253 0 None
-   Pointer 1 198 253 1 ButtonPress-1
-   Pointer 1 198 253 0 ButtonRelease-1
-   Pointer 1 198 252 0 None
-   Keysym 1 1 119 w KeyPress
-   Keysym 1 0 119 w KeyRelease
-   Keysym 1 1 65288 BackSpace KeyPress
-   Keysym 1 0 65288 BackSpace KeyRelease
-   Keysym 1 1 112 p KeyPress
-   Keysym 1 0 112 p KeyRelease
-
-   Run "-pipeinput tee:/bin/cat" to get a description of the format. Note
-   that the -pipeinput option is independent of -rawfb mode and so may
-   have some other interesting uses. The "tee:" prefix means x11vnc will
-   both process the user input and pipe it to the command. The default is
-   to just pipe it to the -pipeinput command.
-
-   Note the -pipeinput helper program could actually control the raw
-   framebuffer. In the libvncserver CVS a simple example program
-   x11vnc/misc/slide.pl is provided that demonstrates a simple jpeg
-   "slideshow" application. Also the builtin "-pipeinput VID" mode does
-   this for webcams and TV capture devices (/dev/video0.)
-
-   The -pipeinput program is run with these environment variables set:
-   X11VNC_PID, X11VNC_PROG, X11VNC_CMDLINE, X11VNC_RAWFB_STR to aid its
-   knowing what is up.
-
-   Another example provided in libvncserver CVS is a script to inject
-   keystrokes into the Linux console (e.g. the virtual consoles:
-   /dev/tty1, /dev/tty2, etc) in x11vnc/misc/vcinject.pl. It is based on
-   the vncterm/LinuxVNC.c program also in the libvncserver CVS. So to
-   view and interact with VT #2 (assuming it is the active VT) one can
-   run something like:
-  x11vnc -rawfb map:/dev/fb0 at 1024x768x16 -pipeinput './vcinject.pl 2'
-
-   This assumes your Linux framebuffer device (/dev/fb0) is properly
-   configured. See fbset(8) and other documentation. Try
-   "file:/dev/fb0 at WxHxB" as a last resort. Starting with x11vnc 0.8.1,
-   the above VT injection is built in, as well as WxHxB determination.
-   Just use something like:
-  x11vnc -rawfb console
-
-   this will try to guess the active virtual console (via /dev/tty0) and
-   also the /dev/fb0 WxHxB and rgb masks automatically. Use, e.g.,
-   "-rawfb console3" to force the VT number. This input method can be
-   used generally via "-pipeinput CONSOLE". Also starting with x11vnc
-   0.8.2 the "-pipeinput UINPUT" mode is tried first (it does both
-   keyboard and mouse input) and then falls back to CONSOLE mode if it is
-   not available. Here is the -help output for this mode:
-
-     If the rawfb string begins with "console" the framebuffer device
-     /dev/fb0 is opened (this requires the appropriate kernel modules to
-     be installed) and so is /dev/tty0. The latter is used to inject
-     keystrokes (not all are supported, but the basic ones are.) You
-     will need to be root to inject keystrokes. /dev/tty0 refers to the
-     active VT, to indicate one explicitly, use "console2", etc. using
-     the VT number.
-
-     If the Linux version seems to be 2.6 or later and the "uinput"
-     module appears to be present, then the uinput method will be used
-     instead of /dev/ttyN. uinput allows insertion of BOTH keystrokes
-     and mouse input and so it preferred when accessing graphical (e.g.
-     Qt-embedded) linux console apps. See -pipeinput UINPUT below for
-     more information on this mode (you may want to also use the
-     -nodragging and -cursor none options.) Use "console0", etc or
-     -pipeinput CONSOLE to force the /dev/ttyN method.
-
-     Note you can change VT remotely using the chvt(1) command.
-     Sometimes switching out and back corrects the framebuffer state.
-
-     To skip input injecting entirely use "consolex".
-
-     The string "/dev/fb0" (1, etc) can be used instead of "console".
-     This can be used to specify a different framebuffer device, e.g.
-     /dev/fb1. As a shortcut the "/dev/" can be dropped. If the name is
-     something nonstandard, use "console:/dev/foofb"
-
-     If you do not want x11vnc to guess the framebuffer's WxHxB and
-     masks automatically (sometimes the kernel gives inaccurate
-     information), specify them with a @WxHxB at the end of the string.
-
-   The above is just an example of what can be done. Note that if you
-   really want to view and interact with the Linux Text console it is
-   better to use the more accurate and faster LinuxVNC program. The
-   advantage x11vnc -rawfb might have is that it can allow interaction
-   with a non-text application, e.g. one based on SVGAlib or Qt-embedded
-   Also, for example the VMWare Fullscreen mode is actually viewable
-   under -rawfb and can be interacted with if uinput is enabled.
-
-   If the Linux uinput driver is available then full keystroke and mouse
-   input into the Linux console can be performed. You may be able to
-   enable uinput via commands like these:
-  modprobe uinput
-  mknod /dev/input/uinput c 10 223
-
-   The -rawfb and -pipeinput features are intended to help one creatively
-   "get out of a jam" (say on a legacy or embedded device) where X is
-   absent or doesn't work properly. Feedback and bug reports are welcome.
-   For more control and less overhead use libvncserver in your own C
-   program that passes the framebuffer to libvncserver.
-
-
-   Q-113: Can I export the Linux Console (Virtual Terminals) via VNC
-   using x11vnc?
-
-   Yes, you may need to be root to access the devices that make up the
-   linux console.
-
-   To access the active Linux console via the computer's framebuffer try
-   something like:
-  x11vnc -rawfb console
-  x11vnc -rawfb console2
-
-   These will try to access the framebuffer through /dev/fb (or /dev/fb0,
-   etc.) and if it succeeds it will show any text or graphics that is
-   currently displayed. Keystrokes will be injected via the device
-   /dev/tty0 (to force an explicit virtual terminal append a number, e.g.
-   "console2" to select /dev/tty2.)
-
-   If your Linux system does not have a framebuffer device (/dev/fb) you
-   can get one by adding, e.g., vga=0x31B boot parameter. This enables
-   the VGA framebuffer device at 1280x1024x24. 0x317 gives 1024x768x16,
-   etc. You can also enable a Linux framebuffer device by modprobing a
-   framebuffer driver specific to your video card.
-
-   Note that this "-rawfb console" mode shows the contents of the
-   hardware framebuffer, and so will show whatever is on the screen. It
-   has no concept of Virtual Terminals WRT what there is to view, it
-   always shows the active virtual terminal.
-
-   Another mode is specific to the Linux text Virtual Terminals, it shows
-   their text and colors (but no graphics) regardless of whether it is
-   the active VT or not. It is available on x11vnc 0.9.7 and later.
-   Enable this mode like this:
-  x11vnc -rawfb vt
-  x11vnc -rawfb vt2
-
-   The former will select the active one, the latter the 2nd VT. x11vnc
-   implements this mode by opening the current console text file
-   "/dev/vcsa2" instead of "/dev/fb". In this way it provides the basic
-   functionality of the LibVNCServer LinuxVNC program.
-
-   The vt mode can be a useful way to try to get a machine's X server
-   working remotely, e.g. you edit /etc/X11/xorg.conf and then type
-   startx (or similar, e.g. gdm) in the virtual terminal. A 2nd x11vnc
-   could be used to see if the X server is now working correctly.
-
-   Q-114: Can I export via VNC a Webcam or TV tuner framebuffer using
-   x11vnc?
-
-   Yes, this is possible to some degree with the -rawfb option. There is
-   no X11 involved: snapshots from the video capture device are used for
-   the screen image data. See the previous FAQ on -rawfb for background.
-   For best results, use x11vnc version 0.8.1 or later.
-
-   Roughly, one would do something like this:
-  x11vnc -rawfb snap:/dev/video at 320x240x32
-
-   This requires that the system allows simple read(2) access to the
-   video device. This is true for video4Linux on Linux kernel 2.6 and
-   later (it won't work for 2.4, you'll need a separate program to
-   snapshot to a file that you point -rawfb to; ask me if it is not clear
-   what to do.)
-
-   The "snap:" enforces -snapfb mode which appears to be necessary. The
-   read pointer for video capture devices cannot be repositioned (which
-   would be needed for scanline polling), but you can read a full frame
-   of data from the device.
-
-   On Linux, if the Video4Linux API is present or the v4l-info(1) program
-   (related to xawtv) exists in in PATH, then x11vnc can be instructed to
-   try it to determine the -rawfb WxHxB parameters for you automatically.
-   In this case one would just type:
-  x11vnc -rawfb video
-
-   or "-rawfb video1" for the 2nd video device, etc.
-
-   x11vnc has also been extended to use the Video4Linux API over v4l-info
-   if it is available at build time. This enables setting parameters
-   (e.g. size and brightness) via x11vnc. See the description below.
-   Without Video4Linux you will need to initialize the settings of the
-   video device using something like xawtv or spcaview (and then hope the
-   settings persist until x11vnc reopens the device.)
-
-   Many video4linux drivers tend to set the framebuffer to be 24bpp (as
-   opposed to 32bpp.) Since this can cause problems with VNC viewers,
-   etc, the -24to32 option will be automatically imposed when in 24bpp.
-
-   Note that by its very nature, video capture involves rapid change in
-   the framebuffer. This is especially true for cameras where slight
-   wavering in brightness is always happening. This can lead to much
-   network bandwidth consumption for the VNC traffic and also local CPU
-   and I/O resource usage. You may want to experiment with "dialing down"
-   the framerate via the -wait, -slow_fb, or -defer options. Decreasing
-   the window size and bpp also helps.
-
-
-   Setting Camera/Tuner parameters via x11vnc:
-
-   There is also some support for setting parameters of the capture
-   device. This is done via "-rawfb video:<settings>". This could be
-   useful for unattended startup at boottime, etc. Here is the -help
-   description:
-
-     A more sophisticated video device scheme allows initializing the
-     device's settings using:
-
-           -rawfb video:<settings>
-
-     The prefix could also be, as above, e.g. "video1:" to specify the
-     device file. The v4l API must be available for this to work.
-     Otherwise, you will need to try to initialize the device with an
-     external program, e.g. xawtv, spcaview, and hope they persist when
-     x11vnc re-opens the device.
-
-     <settings> is a comma separated list of key=value pairs. The
-     device's brightness, color, contrast, and hue can be set to
-     percentages, e.g. br=80,co=50,cn=44,hu=60.
-
-     The device filename can be set too if needed (if it does not start
-     with "video"), e.g. fn=/dev/qcam.
-
-     The width, height and bpp of the framebuffer can be set via, e.g.,
-     w=160,h=120,bpp=16.
-
-     Related to the bpp above, the pixel format can be set via the
-     fmt=XXX, where XXX can be one of: GREY, HI240, RGB555, RGB565,
-     RGB24, and RGB32 (with bpp 8, 8, 16, 16, 24, and 32 respectively.)
-     See http://www.linuxtv.org for more info (V4L api.)
-
-     For TV/rf tuner cards one can set the tuning mode via tun=XXX where
-     XXX can be one of PAL, NTSC, SECAM, or AUTO.
-
-     One can switch the input channel by the inp=XXX setting, where XXX
-     is the name of the input channel (Television, Composite1, S-Video,
-     etc.) Use the name that is in the information about the device that
-     is printed at startup.
-
-     For input channels with tuners (e.g. Television) one can change
-     which station is selected by the sta=XXX setting. XXX is the
-     station number. Currently only the ntsc-cable-us (US cable)
-     channels are built into x11vnc. See the -freqtab option below to
-     supply one from xawtv. If XXX is greater than 500, then it is
-     interpreted as a raw frequency in KHz.
-
-     Example:
-
-     -rawfb video:br=80,w=320,h=240,fmt=RGB32,tun=NTSC,sta=47
-
-     one might need to add inp=Television too for the input channel to
-     be TV if the card doesn't come up by default in that one.
-
-     Note that not all video capture devices will support all of the
-     above settings.
-
-     See the -pipeinput VID option below for a way to control the
-     settings through the VNC Viewer via keystrokes.
-
-     As above, if you specify a "@WxHxB..." after the <settings> string
-     they are used verbatim: the device is not queried for the current
-     values. Otherwise the device will be queried.
-
-   Also, if you supply the "-pipeinput VID" (or use "-rawfb Video")
-   option you can control the settings to some degree via keystroke
-   mappings, e.g. B to increase the brightness or Up arrow to change the
-   TV station:
-
-     For "-pipeinput VID" and you are using the -rawfb for a video
-     capture device, then an internal list of keyboard mappings is used
-     to set parameters of the video. The mappings are:
-
-         "B" and "b" adjust the brightness up and down.
-         "H" and "h" adjust the hue.
-         "C" and "c" adjust the colour.
-         "N" and "n" adjust the contrast.
-         "S" and "s" adjust the size of the capture screen.
-         "I" and "i" cycle through input channels.
-         Up and Down arrows adjust the station (if a tuner)
-         F1, F2, ..., F6 will switch the video capture pixel
-         format to HI240, RGB565, RGB24, RGB32, RGB555, and
-         GREY respectively. See -rawfb video for details.
-
-   See also the -freqtab option to supply your own xawtv channel to
-   frequency mappings for your country (only ntsc-cable-us is built into
-   x11vnc.)
-
-
-   Q-115: Can I connect via VNC to a Qt-embedded/Qt-enhanced/Qtopia
-   application running on my handheld, cell phone, or PC using the Linux
-   console framebuffer (i.e. not X11)?
-
-   Yes, the basic method for this is the -rawfb scheme where the Linux
-   console framebuffer (usually /dev/fb0) is polled and the uinput driver
-   is used to inject keystrokes and mouse input. Often you will just have
-   to type:
-  x11vnc -rawfb console
-
-   (you may need to enable the uinput driver on the system via "modprobe
-   uinput; mknod /dev/input/uinput c 10 223") If this does not find the
-   correct frame buffer properties figure them out or guess them and use
-   something like:
-  x11vnc -rawfb /dev/fb0 at 640x480x16
-
-   Also, to force usage of the uinput injection method use "-pipeinput
-   UINPUT". See the -pipeinput description for tunable parameters, etc.
-
-   One problem with the x11vnc uinput scheme is that it cannot guess the
-   mouse motion "acceleration" used by the windowing application (e.g.
-   QWS or X11.) For X11 and Qt-embedded the acceleration is usually 2
-   (i.e. a dx of 1 from the mouse yields a 2 pixel displacement of the
-   mouse cursor.) The default x11vnc uses is 2, since that is often used.
-   However for one Qt-embedded system we needed to do:
-  x11vnc -rawfb console  -pipeinput UINPUT:accel=4.0
-
-   to get reasonable positioning of the mouse.
-
-   Even with the correct acceleration setting there is still some drift
-   (probably because of the mouse threshold where the acceleration kicks
-   in) and so x11vnc needs to reposition the cursor from 0,0 about 5
-   times a second. See the -pipeinput UINPUT option for tuning parameters
-   that can be set (there are some experimental thresh=N tuning
-   parameters as well)
-
-   Currently, one can expect mouse input to be a little flakey. All in
-   all, the Linux framebuffer input mechanism for Qt-embedded framebuffer
-   apps is not perfect, but it is usable.
-
-   If you need to create a smaller x11vnc binary for a handheld
-   environment be sure to run strip(1) on it and also consider
-   configuring with, e.g. "env CPPFLAGS='-DSMALL_FOOTPRINT=1' ./configure
-   ..." to remove rarely used features and large texts (use 2 or 3
-   instead of 1 to remove more.) Currently (Jul/2006) this can lower the
-   size of the x11vnc from 1.1MB to 0.6-0.7MB.
-
-   The x11vnc uinput method applies to nearly anything on the Linux
-   framebuffer console, not just Qt-embedded/Qtopia. DirectFB, SDL using
-   fbcon driver, SVGAlib applications can also be viewed and interacted
-   with. Even a Linux X session can be viewed and interacted with without
-   using X11 (and x11vnc does not have to terminate when the X server
-   restarts!) The Linux Text consoles (F1-F6) also work.
-
-   Note that Qt-embedded supplies its own VNC graphics driver, but it
-   cannot do both the Linux console framebuffer and VNC at the same time,
-   which is often what is desired from VNC.
-
-   Update: We are finding some setups like Qtopia on the IPAQ do not
-   allow mouse input via uinput. Please help us debug this problem by
-   trying x11vnc on your device and letting us know what does and does
-   not work. See the next FAQ for a possible workaround for touchscreens.
-
-
-   Q-116: How do I inject touch screen input into an
-   Qt-embedded/Qt-enhanced/Qtopia cell phone such as openmoko/qtmoko Neo
-   Freerunner?
-
-   The qtmoko project does not use X11 for the graphical display.
-   Unfortunately the Linux uinput method described in the previous FAQ
-   does not work because Qt is using TSLIB (touch screen library) to
-   process the input and it only reads from one device (often
-   /dev/input/event1) and not from the new UINPUT device that x11vnc
-   creates (under -pipeinput UINPUT)
-
-   So something else needs to be done. It was discovered that by simply
-   writing the touchscreen events directly to /dev/input/event1 then
-   input can be injected into the system. There is no x11vnc builtin mode
-   for this yet (until we understand it better), but there is a working
-   script provided in x11vnc/misc/qt_tslib_inject.pl. So one could use it
-   this way for example:
-  x11vnc ... -rawfb console -pipeinput path/to/qt_tslib_inject.pl -env INJECT_O
-PTIONS=clickonly,cal=/etc/pointercal
-
-   Read the script for how to enable other options and what the above
-   options mean (e.g. /etc/pointercal contains TSLIB's calibration
-   parameters and are necessary to achieve accurate pointing.)
-
-   The x11vnc/misc/qt_tslib_inject.pl script can potentially be modified
-   to handle other devices where the uinput method fails. It could also
-   be modified to create 'hot keys', etc.
-
-   Please let us know how things go if you try this out; there is much to
-   learn about synthetic input injection in handhelds and cell phones. As
-   we learn more we can develop a builtin x11vnc mode for this sort of
-   injection.
-
-   Update Dec/2010: There is experimental built-in UINPUT support in the
-   x11vnc development tarball for qtmoko with touchpad managed by tslib.
-   See -pipeinput UINPUT for more info. Here is an example:
-   x11vnc -rawfb console -pipeinput UINPUT:touch,tslib_cal=/etc/pointercal,dire
-ct_abs=/dev/input/event1,nouinput,dragskip=3
-
-
-   Q-117: Now that non-X11 devices can be exported via VNC using x11vnc,
-   can I build it with no dependencies on X11 header files and libraries?
-
-   Yes, as of Jul/2006 x11vnc enables building for -rawfb only support.
-   Just do something like when building:
-  ./configure --without-x    (plus any other flags)
-  make
-
-   You can then test via "ldd x11vnc" that the binary does not depend on
-   libX11.so, etc. See the previous FAQ's for non-X11 framebuffer usage.
-   If you use this for an interesting non-X11 application please let us
-   know what you did.
-
-
-   Q-118: How do I cross compile x11vnc for a different architecture than
-   my Linux i386 or amd64 PC?
-
-   You will need a cross-compiling toolchain. Perhaps your distro
-   provides these or you can find a HOWTO for your distro. We found a
-   nice one at qtmoko.org for building armel binaries on Debian Linux
-   i386 machines. It includes most of the libraries that x11vnc needs. We
-   use that example here.
-
-   We ran this script to set PATH, configure, and build:
-#!/bin/sh
-
-# toolchain from: qtmoko-debian-toolchain-armv4t-eabi.tar.gz
-
-export PATH=/opt/toolchains/arm920t-eabi/bin:$PATH
-
-env CC=arm-linux-gcc ./configure --host=arm-linux --without-avahi
-
-make
-
-arm-linux-strip ./x11vnc/x11vnc
-ls -l ./x11vnc/x11vnc
-
-   Note we had to include --without-avahi due to lack of
-   libavahi-client.so.3 supplied by the toolchain we used. One would need
-   to add it if it was desired on the target machine. We also stripped
-   the binary to make it smaller.
-
-   For an embedded system one may also want to add --without-x if the
-   embedded system does not use X11 and the -rawfb mechanism must be
-   used.
-
-
-   Q-119: Does x11vnc support Mac OS X Aqua/Quartz displays natively
-   (i.e. no X11 involved)?
-
-   Yes, since Nov/2006 in the development tree (x11vnc-0.8.4 tarball)
-   there is support for native Mac OS X Aqua/Quartz displays using the
-   -rawfb mechanism described above. The mouse and keyboard input is
-   achieved via Mac OS X API's.
-
-   So you can use x11vnc as an alternative to OSXvnc (aka Vine Server),
-   or Apple Remote Desktop (ARD). Perhaps there is some x11vnc feature
-   you'd like to use on Mac OS X, etc. For a number of activities (e.g.
-   window drags) it seems to be faster than OSXvnc.
-
-   Notes:
-
-   X11:  x11vnc will also work (as it has for years) with a X11 server
-   (XDarwin) running on Mac OS X (people often install this software to
-   display remote X11 apps on their Mac OS X system, or use some old
-   favorites locally such as xterm.) However in this case x11vnc will
-   only work reasonably in single window -id windowid mode (and the
-   window may need to have mouse focus.)
-
-   If you do not have the DISPLAY env. variable set, x11vnc will assume
-   native Aqua/Quartz on Mac OS X, however if DISPLAY is set it will
-   assume an X11 connection. Use "-rawfb console" to force the native
-   display (or unset DISPLAY.)
-
-   Update: Leopard sets DISPLAY by default in all sessions. Since it
-   starts with the string "/tmp/" x11vnc will use that to know if it
-   should ignore it. Use "-display :0.0" to force it.
-
-   Building:  If you don't have the X11 build and runtime packages
-   installed you will need to build it like this:
-   (cd to the e.g. x11vnc-0.9, source directory)
-   ./configure --without-x
-   make
-
-   Win2VNC/x2vnc:  One handy use is to use the -nofb mode to redirect
-   mouse and keyboard input to a nearby Mac (i.e. one to the side of your
-   desk) via x2vnc or Win2VNC. See this FAQ for more info.
-
-   Options:  Here are the Mac OS X specific x11vnc options:
-   -macnodim              For the native Mac OS X server, disable dimming.
-   -macnosleep            For the native Mac OS X server, disable display sleep
-.
-   -macnosaver            For the native Mac OS X server, disable screensaver.
-   -macnowait             For the native Mac OS X server, do not wait for the
-                          user to switch back to his display.
-   -macwheel n            For the native Mac OS X server, set the mouse wheel
-                          speed to n (default 5.)
-   -macnoswap             For the native Mac OS X server, do not swap mouse
-                          buttons 2 and 3.
-   -macnoresize           For the native Mac OS X server, do not resize or rese
-t
-                          the framebuffer even if it is detected that the scree
-n
-                          resolution or depth has changed.
-   -maciconanim n         For the native Mac OS X server, set n to the number
-                          of milliseconds that the window iconify/deiconify
-                          animation takes.  In -ncache mode this value will be
-                          used to skip the animation if possible. (default 400)
-   -macmenu               For the native Mac OS X server, in -ncache client-sid
-e
-                          caching mode, try to cache pull down menus (not perfe
-ct
-                          because they have animated fades, etc.)
-
-   PasteBoard/Clipboard:   There is a bug that the Clipboard (called
-   PasteBoard on Mac it appears) exchange will not take place unless
-   x11vnc was started from inside the Aqua display (e.g. started inside a
-   Terminal app window.) Otherwise it cannot connect to the PasteBoard
-   server. So Clipboard exchange won't work for our standard "ssh in"
-   startup scheme.
-
-   Hopefully this deficiency can be removed, but until then for Clipboard
-   exchange to work you will need to start x11vnc inside the desktop
-   session (i.e. either start it running before you leave, or start up a
-   2nd x11vnc inside from a 1st one started outside, or use the apple
-   script below)
-
-   Here also is a osascript trick that seems to work (it opens the
-   Terminal app and instructs it to start x11vnc):
-
-#!/bin/sh
-#
-# start_x11vnc: start x11vnc in a Terminal window
-# (this will allow Clipboard/Pasteboard exchange to work)
-
-tmp=/tmp/start_x11vnc.$$
-
-cat > $tmp <<END
-
-tell application "Terminal"
-        activate
-        do script with command "$HOME/x11vnc -rfbauth .vnc/passwd -ssl SAVE"
-end tell
-
-END
-
-osascript $tmp
-rm -f $tmp
-
-   where you should customize the x11vnc command line to your needs and
-   the full path to the binary. Save it in a file e.g. "start_x11vnc" and
-   then after you SSH in just type "./start_x11vnc" (or have ssh run the
-   command for you.) Then once you are connected via VNC, iconify the
-   Terminal windows (you can't delete them since that will kill x11vnc.)
-
-   Update Aug/2010: A user reports the following useful information:
-This is not a problem on Mac OS X 10.6.x (Snow Leopard) when connecting
-via ssh to start x11vnc.  And, on Mac OS X 10.5.x (Leopard), the problem
-can be permanently eliminated by doing this:
-
-
-sudo /usr/libexec/PlistBuddy -c 'delete :LimitLoadToSessionType' \
-   -c 'add :LimitLoadToSessionType string Background' \
-   /System/Library/LaunchAgents/com.apple.pboard.plist
-# ignore any 'Delete: Entry, ":LimitLoadToSessionType", Does Not Exist' message
-
-and then restarting (yes, you must restart not just log off).  But
-ONLY do that for Mac OS X 10.5.x and NOT for 10.6.x (which doesn't
-need it anyway).
-
-   We recently got access to a MacOSX 10.6.4 (Snow Leopard) macbook and
-   have confirmed that the above is correct.
-
-
-   Q-120: Can x11vnc be used as a VNC reflector/repeater to improve
-   performance for the case of a large number of simultaneous VNC viewers
-   (e.g. classroom broadcasting or a large demo)?
-
-   Yes, as of Feb/2007 there is the "-reflect host:N" option to connect
-   to the VNC server "host:N" (either another x11vnc or any other VNC
-   server) and re-export it. VNC viewers then connect to the x11vnc(s)
-   running -reflect.
-
-   The -reflect option is the same as: "-rawfb vnc:host:N". See the
-   -rawfb description under "VNC HOST" for more details.
-
-   You can replace "host:N" with "listen" or "listen:port" for reverse
-   connections.
-
-   One can set up a number of such reflectors/repeaters to spread the
-   resource usage around, e.g.:
-       C -------<-------|
-       C -------<-------|
-       C -------<-------|---- R -----|
-       C -------<-------|            |
-       C -------<-------|            |
-                                     |
-       C -------<-------|            |
-       C -------<-------|            |
-       C -------<-------|---- R -----|
-       C -------<-------|            |
-       C -------<-------|            |
-                                     |====== S
-       C -------<-------|            |
-       C -------<-------|            |
-       C -------<-------|---- R -----|
-       C -------<-------|            |
-       C -------<-------|            |
-                                     |
-       C -------<-------|            |
-       C -------<-------|            |
-       C -------<-------|---- R -----|
-       C -------<-------|
-       C -------<-------|
-
-   Where "S" is the original VNC Server, "C" denote VNC viewer clients,
-   and "R" denotes an x11vnc running -reflect to "S".
-
-   Ideally, a client "C" will be fairly close network-wise to its "R". It
-   is fine to run the "R" on the same machine as one of its "C's". A nice
-   setup for a large, (e.g. 64-128) viewer classroom broadcast case would
-   be to run R's on areas isolated by network switches, e.g. one R per
-   switch.
-
-   In an extreme case (e.g. 1000 viewers) one might actually need a 2nd
-   layer of R's in the tree. If you try something like that let us know!
-
-   There are many resource savings in doing something like the above. The
-   first obvious one is network bandwidth savings. Another is less CPU
-   load on "S" since it handles many fewer simultaneous connections.
-   Also, if there are a few clients C on very slow links, their presence
-   does not slow down every other client, just the clients on their "R".
-   One way a slow client affects things is if there are some large
-   framebuffer writes (e.g. jpeg image region) then the repeater may
-   block waiting for that large write to finish before going onto the
-   next client (however, if the write is small enough, the kernel will
-   buffer it and the server can go on to service the next client.)
-
-   The x11vnc -reflect implementation uses the libvncclient library in
-   the LibVNCServer project to handle the connection to "S". It is not
-   currently very efficient since it simply does its normal framebuffer
-   polling scheme on the libvncclient framebuffer (which it then
-   re-exports via VNC to its clients C.) However, CopyRect and
-   CursorShape encodings are preserved in the reflection and that helps.
-   Dragging windows with the mouse can be a problem (especially if S is
-   not doing wireframing somehow, consider -nodragging if the problem is
-   severe) For a really fast reflector/repeater it would have to be
-   implemented from scratch with performance in mind. See these other
-   projects:
-    http://sourceforge.net/projects/vnc-reflector/,
-    http://www.tightvnc.com/projector/                (closed source?),
-
-
-   Automation via Reverse Connections:   Instead of having the R's
-   connect directly to S and then the C's connect directly to the R they
-   should use, some convenience can be achieved by using reverse
-   connections (the x11vnc ""-connect host1,host2,..." option.) Suppose
-   all the clients "C" are started up in Listen mode:
-    client1>  vncviewer -listen
-    client2>  vncviewer -listen
-    client3>  vncviewer -listen
-    ...
-    client64> vncviewer -listen
-
-   (e.g. client1> is the cmdline prompt on machine client1 ... etc) and
-   all the repeaters R are started like this:
-    repeater1> x11vnc -reflect listen -connect client1,client2,...client8
-    repeater2> x11vnc -reflect listen -connect client9,client10,...client16
-    ...
-    repeater8> x11vnc -reflect listen -connect client57,client58,...client64
-
-   and finally the main server is started to kick the whole thing into
-   motion:
-    vncserver> x11vnc -display :0 -connect repeater1,repeater2,...repeater8
-
-   (or instruct a non-x11vnc VNC server to reverse connect to the
-   repeaters.) For a classroom broadcasting setup one might have the
-   first two sets of commands start automatically at bootup or when
-   someone logs in, and then start everything up with the S server. One
-   may even be able to script the forward connection bootstrap case, let
-   us know what you did. A really nice thing would be some sort of
-   auto-discovery of your repeater, etc...
-
-   Q-121: Can x11vnc be used during a Linux, Solaris, etc. system
-   Installation so the Installation can be done remotely?
-
-   This can be done, but it doesn't always work because it depends on how
-   the OS does its install. We have to "sneak in" somehow. Note that some
-   OS's have a remote install (ssh etc.) built in and so you might want
-   to use that instead.
-
-   Usually the OS install will have to be a network-install in order to
-   have networking up during the install. Otherwise, you may have a
-   (slim) chance to configure the networking manually (ifconfig(8) and
-   route(8).)
-
-   To avoid library dependencies problems in the typical minimal (e.g.
-   busybox) installation OS it is a good idea to build a statically
-   linked x11vnc binary. A way that often works is to do a normal build
-   and then paste the final x11vnc link line into a shell script. Then
-   change the "gcc" to "gcc -static" and run the shell script. You may
-   need to disable features (e.g. "--without-xfixes") if there is not a
-   static library for the feature available. You may also need to add
-   extra link options (e.g. "-lXrender") to complete library dependencies
-   manually.
-
-   Let's call the binary x11vnc.static. Place it on a webserver
-   somewhere. It may be possible to retrieve it via scp(1) too.
-
-   During the install you need to get a shell to retreive x11vnc.static
-   and run it.
-
-   If the Solaris install is an older X-based one, there will be a menu
-   for you to get a terminal window. From that window you might be able
-   to retrieve x11vnc.static via wget, scp, or ftp. Remember to do "chmod
-   755 ./x11vnc.static" and then find the -auth file as in this FAQ.
-
-   If it is a Linux install that uses an X server (e.g. SuSE and probably
-   Fedora), then you can often get a shell by pressing Ctrl-Alt-F2 or
-   similar. Then get the x11vnc binary via something like this:
-   cd /tmp
-   wget http://192.168.0.22/x11vnc.static
-   chmod 755 ./x11vnc.static
-
-   Find the name of the auth file as in this FAQ. (maybe run "ps wwaux |
-   grep auth".) Then run it like this:
-   ./x11vnc.static -forever -nopw -display :0 -auth /tmp/wherever/the/authfile
-
-   then press Alt-F7 to go back to the X install. You should now be able
-   to connect via a vnc viewer and continue the install. Watch out for
-   the display being :1, etc.
-
-   If there is a firewall blocking incoming connections during the
-   install, use the "-connect hostname" option option for a reverse
-   connection to the hostname running the VNC viewer in listen mode.
-
-   Debian based installs are either console-text or console-framebuffer
-   based. These are install (or expert) and installgui (or expertgui)
-   boot lines, respectively. For the console-text based installs you
-   probably need to add a boot cmd line option like vga=0x314 (which is
-   800x600x16) to get the console-text to use the linux framebuffer
-   device properly.
-
-   For a Debian console-text based install after the network is
-   configured press Ctrl-Alt-F2 to get a shell. Retrieve the binary via
-   wget as above and chmod 755 it. Then run it something like this:
-   sleep 10; ./x11vnc.static -forever -nopw -rawfb console
-
-   then before the sleep is over press Alt-F1 to get back to the install
-   virtual console. You should be able to connect via a VNC viewer and
-   continue with the install.
-
-   For a recent (2009) Debian install we booted with "expert vga=0x301"
-   and "expert vga=0x311" to get console text based installs at 640x480x8
-   and 640x480x16, respectively (replace "expert" with "install" if you
-   like.) Otherwise it was giving a 16 color 640x480x4 (4 bit per pixel)
-   display which x11vnc could not handle.
-
-   For Debian console-framebuffer GUI based installs (installgui or
-   expertgui) we have not be able to enter keystrokes or mouse motions.
-   This may be resolved if the install had the Linux kernel module
-   uinput, but it doesn't; one can wget uinput.ko and then run insmod on
-   it, but the module must match the installation kernel. So, failing
-   that, you can only do the GUI view-only, which can be handy to watch a
-   long network install from your desk instead of in front of the machine
-   being installed. For these, after the network is configured press
-   Ctrl-Alt-F2 to get a shell. Retrieve the binary via wget as above and
-   chmod 755 it. Then run it something like this:
-   sleep 10; ./x11vnc.static -forever -nopw -rawfb console
-
-   then before the sleep is over press Alt-F5 to get back to the GUI
-   install console. You should be able to connect via a VNC viewer and
-   watch the install.
-   [Misc: Clipboard, File Transfer/Sharing, Printing, Sound, Beeps,
-   Thanks, etc.]
-
-   Q-122: Does the Clipboard/Selection get transferred between the
-   vncviewer and the X display?
-
-   As of Jan/2004 x11vnc supports the "CutText" part of the RFB (aka VNC)
-   protocol. When text is selected/copied in the X session that x11vnc is
-   polling it will be sent to connected VNC viewers. And when CutText is
-   received from a VNC viewer then x11vnc will set the X11 selections
-   PRIMARY, CLIPBOARD, and CUTBUFFER0 to it. x11vnc is able to hold the
-   PRIMARY and CLIPBOARD selections (Xvnc does not seem to do this.)
-
-   The X11 selections can be confusing, especially to those coming from
-   Windows or MacOSX where there is just a single 'Clipboard'. The X11
-   CLIPBOARD selection is a lot like that of Windows and MacOSX, e.g.
-   highlighted text is sent to the clipboard when the user activates
-   "Edit -> Copy" or presses "Control+C" (and pasting it via "Edit ->
-   Paste" or "Control+V".) The X11 PRIMARY selection has been described
-   as 'for power users' or 'an Easter Egg'. As soon as text is
-   highlighted it is set to the PRIMARY selection and so it is
-   immediately ready for pasting, usually via the Middle Mouse Button or
-   "Shift+Insert". See this jwz link for more information.
-
-   x11vnc's default behavior is to watch both CLIPBOARD and PRIMARY and
-   whenever one of them changes, it sends the new text to connected
-   viewers. Note that since the RFB protocol only has a single "CutText"
-   then both selections are "merged" to some degree (and this can lead to
-   confusing results.) One user was confused why x11vnc was "forgetting"
-   his CLIPBOARD selection and the reason was he also changed PRIMARY
-   some time after he copied text to the clipboard. Usually an app will
-   set PRIMARY as soon as any text is highlighted so it easy to see how
-   CLIPBOARD was forgotten. Use the -noprimary described below as a
-   workaround. Similarly, by default when x11vnc receives CutText it sets
-   both CLIPBOARD and PRIMARY to it (this is probably less confusing, but
-   could possibly lead to some failure modes as well.)
-
-   You may not like these defaults. Here are ways to change the behavior:
-     * If you don't want the Clipboard/Selection exchanged at all use the
-       -nosel option.
-     * If you want changes in PRIMARY to be ignored use the -noprimary
-       option.
-     * If you want changes in CLIPBOARD to be ignored use the
-       -noclipboard option.
-     * If you don't want x11vnc to set PRIMARY to the "CutText" received
-       from viewers use the -nosetprimary option.
-     * If you don't want x11vnc to set CLIPBOARD to the "CutText"
-       received from viewers use the -nosetclipboard option.
-
-   You can also fine-tune it a bit with the -seldir dir option and also
-   -input.
-
-   You may need to watch out for desktop utilities such as KDE's
-   "Klipper" that do odd things with the selection, clipboard, and
-   cutbuffers.
-
-
-   Q-123: Can I use x11vnc to record a Shock Wave Flash (or other format)
-   video of my desktop, e.g. to record a tutorial or demo?
-
-   Yes, it is possible with a number of tools that record VNC and
-   transform it to swf format or others. One such popular tool is
-   pyvnc2swf. There are a number of tutorials (broken link?) on how to do
-   this. Another option is to use the vnc2mpg that comes in the
-   LibVNCServer package.
-   An important thing to remember when doing this is that tuning
-   parameters should be applied to x11vnc to speed up its polling for
-   this sort of application, e.g. "-wait 10 -defer 10".
-
-   Q-124: Can I transfer files back and forth with x11vnc?
-
-   As of Oct/2005 and May/2006 x11vnc enables, respectively, the TightVNC
-   and UltraVNC file transfer implementations that were added to
-   libvncserver. This currently works with TightVNC and UltraVNC viewers
-   (and Windows viewers only support filetransfer it appears... but they
-   do work to some degree under Wine on Linux.)
-
-   The SSVNC Unix VNC viewer supports UltraVNC file transfer by use of a
-   Java helper program.
-
-   TightVNC file transfer is off by default, if you want to enable it use
-   the -tightfilexfer option.
-
-   UltraVNC file transfer is off by default, to enable it use something
-   like "-rfbversion 3.6 -permitfiletransfer"
-   options (UltraVNC incorrectly uses the RFB protocol version to
-   determine if its features are available, so x11vnc has to pretend to
-   be version 3.6.) As of Sep/2006 "-ultrafilexfer" is an alias for these
-   two options. Note that running as RFB version 3.6 may confuse other
-   VNC Viewers.
-
-   Sadly you cannot do both -tightfilexfer and -ultrafilexfer at the same
-   time because the latter requires setting the version to 3.6 and
-   tightvnc will not do filetransfer when it sees that version number.
-
-   Also, because of the way the LibVNCServer TightVNC file transfer is
-   implemented, you cannot do Tightvnc file transfer in -unixpw mode.
-   However, UltraVNC file transfer does work in -unixpw (but if a client
-   tries it do a filetransfer during the login process it will be
-   disconnected.)
-
-   IMPORTANT: please understand if -ultrafilexfer or -tightfilexfer is
-   specified and you run x11vnc as root for, say, inetd or display
-   manager (gdm, kdm, ...) access and you do not have it switch users via
-   the -users option, then VNC Viewers that connect are able to do
-   filetransfer reads and writes as *root*.
-
-   The UltraVNC and TightVNC settings can be toggled on and off inside
-   the gui or by -R remote control. However for TightVNC the changed
-   setting only applies for NEW clients, current clients retain their
-   TightVNC file transfer ability. For UltraVNC it works better, however
-   if an UltraVNC client has initiated a file transfer dialog it will
-   remain in effect until the dialog is closed. If you want to switch
-   between UltraVNC and TightVNC file transfer in the gui or by remote
-   control you will probably be foiled by the "-rfbversion 3.6" issue.
-
-
-   Q-125: Which UltraVNC extensions are supported?
-
-   Some of them are supported. To get UltraVNC Viewers to attempt to use
-   these extensions you will need to supply this option to x11vnc:
-   -rfbversion 3.6
-
-   Or use -ultrafilexfer which is an alias for the above option and
-   "-permitfiletransfer". UltraVNC evidently treats any other RFB version
-   number as non-UltraVNC.
-
-   Here are a list of the UltraVNC extensions supported by x11vnc:
-     * ServerInput: "Toggle Remote Input and Remote Blank Monitor"
-     * FileTransfer: "Open File Transfer..."
-     * SingleWindow: "Select Single Window..."
-     * TextChat: "Open Chat..."
-     * 1/n Server Scaling
-
-   The SSVNC Unix VNC viewer supports these UltraVNC extensions.
-
-   To disable SingleWindow and ServerInput use -noultraext (the others
-   are managed by LibVNCServer.) See this option too: -noserverdpms.
-
-   Also, the UltraVNC repeater proxy is supported for use with reverse
-   connections: "-connect repeater://host:port+ID:NNNN". Use it for both
-   plaintext and SSL connections. This mode can send any string before
-   switching to the VNC protocol, and so could be used with other
-   proxy/gateway tools. Also, a perl repeater implemention is here:
-   ultravnc_repeater.pl
-
-
-   Q-126: Can x11vnc emulate UltraVNC's Single Click helpdesk mode for
-   Unix? I.e. something very simple for a naive user to initiate a
-   reverse vnc connection from their Unix desktop to a helpdesk
-   operator's VNC Viewer.
-
-   Yes, UltraVNC's Single Click (SC) mode can be emulated fairly well on
-   Unix.
-
-   We use the term "helpdesk" below, but it could be any sort of remote
-   assistance you want to set up, e.g. something for Unix-using friends
-   or family to use. This includes Mac OS X.
-
-   Assume you create a helpdesk directory "hd" on your website:
-   http://www.mysite.com/hd (any website that you can upload files to
-   should work, although remember the user will be running the programs
-   you place there.)
-
-   In that "hd" subdirectory copy an x11vnc binary to be run on the Unix
-   user's machine (e.g. Linux, etc) and also create a file named "vnc"
-   containing the following:
-#!/bin/sh
-
-webhost="http://www.mysite.com/hd"  # Your helpdesk dir URL.
-
-vnchost="ip.someplace.net"          # Your host running 'vncviewer -listen'
-                                    # It could also be your IP number. If it is
-                                    # a router/firewall, you will need to
-                                    # configure it to redirect port 5500 to you
-r
-                                    # workstation running 'vncviewer -listen'
-
-dir=/tmp/vnc_helpdesk.$$            # Make a temporary working dir.
-mkdir $dir || exit 1
-cd $dir || exit 1
-
-trap "cd /tmp; rm -rf $dir" 0 2 15  # Cleans up on exit.
-
-wget $webhost/x11vnc                # Fetch x11vnc binary.  If multi-
-chmod 755 ./x11vnc                  # platform, use $webhost/`uname`/x11vnc
-                                    # or similar.
-
-./x11vnc -connect_or_exit $vnchost -rfbport 0 -nopw
-
-   with the hostnames / IP addresses customized to your case.
-
-   On the helpdesk VNC viewer machine (ip.someplace.net in this example)
-   you have the helpdesk operator running VNC viewer in listen mode:
-   vncviewer -listen
-
-   or if on Windows, etc. somehow have the VNC viewer be in "listen"
-   mode.
-
-   Then, when the naive user needs assistance you instruct him to open up
-   a terminal window on his Unix desktop and paste the following into the
-   shell:
-   wget -qO - http://www.mysite.com/hd/vnc | sh -
-
-   and then press Enter. You could have this instruction on a web page or
-   in an email you send him, etc. This requires that the wget is
-   installed on the user's Unix machine (he might only have curl or lynx,
-   see below for more info.)
-
-
-   So I guess this is about 3-4 clicks (start a terminal and paste) and
-   pressing "Enter" instead of "single click"...
-
-   See this page for some variations on this method, e.g. how to add a
-   password, SSL Certificates, etc.
-
-
-   If you don't have a website (there are many free ones) or don't want
-   to use one you will have to email him all of the ingredients (x11vnc
-   binary and a launcher script) and tell him how to run it. This could
-   be easy or challenging depending on the skill of the naive unix
-   user...
-
-   A bit of obscurity security could be put in with a -passwd, -rfbauth
-   options, etc. (note that x11vnc will require a password even for
-   reverse connections.) More info here.
-
-
-   Firewalls: If the helpdesk (you) with the vncviewer is behind a
-   NAT/Firewall/Router the router will have to be configured to redirect
-   a port (i.e. 5500 or maybe different one if you like) to the vncviewer
-   machine. If the vncviewer machine also has its own host-level
-   firewall, you will have to open up the port there as well.
-
-   NAT-2-NAT: There is currently no way to go "NAT-2-NAT", i.e. both User
-   and Helpdesk workstations behind NAT'ing Firewall/Routers without
-   configuring a router to do a port redirection (i.e. on your side, the
-   HelpDesk.) To avoid modifying either firewall/router, one would need
-   some public (IP address reachable on the internet) redirection/proxy
-   service. Perhaps such a thing exists. http://sc.uvnc.com provides this
-   service for their UltraVNC Single Click users.
-
-   Update: It may be possible to do "NAT-2-NAT" with a UDP tunnel such as
-   http://samy.pl/pwnat/. All that is required is that both NAT firewalls
-   allow in UDP packets from an IP address to which a UDP packet has
-   recently been sent to. If you try it out let us know how it went.
-
-
-   Very Naive Users:
-
-   If it is beyond the user how to open a terminal window and paste in a
-   command (you have my condolences...) you would have to somehow setup
-   his Web browser to download the "vnc" file (or a script containing the
-   above wget line) and prompt the user if he wants to run it. This may
-   be tricky to set up (which is probably a good thing to not have the
-   web browser readily run arbitrary programs downloaded from the
-   internet...)
-
-   One command-line free way, tested with KDE, is to name the file vnc.sh
-   and then instruct the user to right-click on the link and do "Save
-   Link As" to his Desktop. It will appear as an icon, probably one that
-   looks like a terminal or a command line prompt. He next should
-   right-click on the icon and select "Properties" and go to the
-   "Permissions" tab. Then in that dialog select the checkbox "Is
-   executable". He should then be able to click on the icon to launch it.
-   Another option is to right-click on the icon and select "Open With ->
-   Other ..." and for the name of the application type in "/bin/sh".
-   Unfortunately in both cases the command output is lost and so errors
-   cannot be debugged as easily. A similar thing appears to work in GNOME
-   if under "Properties -> Permissions" they click on "Execute" checkbox
-   for "Owner". Then when they click on the icon, they will get a dialog
-   where they can select "Run in Terminal". In general for such cases, if
-   it is feasible, it might be easier to ssh to his machine and set
-   things up yourself...
-
-
-   SSL Encrypted Helpdesk Connections:
-
-   As of Apr/2007 x11vnc supports reverse connections in SSL and so we
-   can do this. On the Helpdesk side (Viewer) you will need STUNNEL or
-   better use the Enhanced TightVNC Viewer (SSVNC) package we provide
-   that automates all of the SSL for you.
-
-   To do this create a file named "vncs" in the website "hd" directory
-   containing the following:
-#!/bin/sh
-
-webhost="http://www.mysite.com/hd"  # Your helpdesk dir URL.
-
-vnchost="ip.someplace.net"          # Your host running 'vncviewer -listen'
-                                    # It could also be your IP number. If it is
-                                    # a router/firewall, you will need to
-                                    # configure it to redirect port 5500 to you
-r
-                                    # workstation running 'vncviewer -listen'
-
-dir=/tmp/vnc_helpdesk.$$            # Make a temporary working dir.
-mkdir $dir || exit 1
-cd $dir || exit 1
-
-trap "cd /tmp; rm -rf $dir" 0 2 15  # Cleans up on exit.
-
-wget $webhost/x11vnc                # Fetch x11vnc binary.  If multi-
-chmod 755 ./x11vnc                  # platform, use $webhost/`uname`/x11vnc
-                                    # or similar.
-
-./x11vnc -connect_or_exit $vnchost -rfbport 0 -nopw -ssl    # Note -ssl option.
-
-   with the hostnames or IP addresses customized to your case.
-
-   The only change from the "vnc" above is the addition of the -ssl
-   option to x11vnc. This will create a temporary SSL cert: openssl(1)
-   will need to be installed on the user's end. A fixed SSL cert file
-   could be used to avoid this (and provide some authentication; more
-   info here.)
-
-   The naive user will be doing this:
-   wget -qO - http://www.mysite.com/hd/vncs | sh -
-
-   (or perhaps even use https:// if available.)
-
-   But before that, the helpdesk operator needs to have "vncviewer
-   -listen" running as before, however he needs an SSL tunnel at his end.
-   The easiest way to do this is use Enhanced TightVNC Viewer (SSVNC).
-   Start it, and select Options -> 'Reverse VNC Connection (-listen)'.
-   Then UN-select 'Verify All Certs' (this can be enabled later if you
-   want; you'll need the x11vnc SSL certificate), and click 'Listen'.
-
-   If you don't want to use SSVNC for the viewer, but rather set up
-   STUNNEL manually instead, make a file "stunnel.cfg" containing:
-foreground = yes
-pid =
-
-[vnc]
-accept = 5500
-connect = localhost:5501
-
-   and run:
-  stunnel ./stunnel.cfg
-
-   and then start the "vncviewer -listen 1" (i.e. 1 to correspond to the
-   5501 port.) Note that this assumes the stunnel install created a
-   Server SSL cert+key, usually /etc/stunnel/stunnel.pem (not all distros
-   will do this.) Also, that file is by default only readable by root, so
-   stunnel needs to be run as root. If your system does not have a key
-   installed or you do not want to run stunnel as root (or change the
-   permissions on the file), you can use x11vnc to create one for you for
-   example:
-  x11vnc -sslGenCert server self:mystunnel
-
-   answer the prompts with whatever you want; you can take the default
-   for all of them if you like. The openssl(1) package must be installed.
-   See this link and this one too for more info on SSL certs. This
-   creates $HOME/.vnc/certs/server-self:mystunnel.pem, then you would
-   change the "stunnel.cfg" to look something like:
-foreground = yes
-pid =
-cert = /home/myusername/.vnc/certs/server-self:mystunnel.pem
-
-[vnc]
-accept = 5500
-connect = localhost:5501
-
-   In any event, with stunnel having been setup, the naive user is
-   instructed to paste in and run:
-   wget -qO - http://www.mysite.com/hd/vncs | sh -
-
-   to pick up the vncs script this time.
-
-   Of course if a man-in-the-middle can alter what the user downloads
-   then all bets are off!.
-
-   More SSL variations and info about certificates can be found here.
-
-
-   OpenSSL libssl.so.0.9.7 problems:
-
-   If you build your own stunnel or x11vnc for deployment, you may want
-   to statically link libssl.a and libcrypto.a into it because Linux
-   distros are currently a bit of a mess regarding which version of
-   libssl is installed.
-
-   You will find the details here.
-
-
-   Q-127: Can I (temporarily) mount my local (viewer-side) Windows/Samba
-   File share on the machine where x11vnc is running?
-
-   You will have to use an external network redirection for this.
-   Filesystem mounting is not part of the VNC protocol.
-
-   We show a simple Samba example here.
-
-   First you will need a tunnel to redirect the SMB requests from the
-   remote machine to the one you sitting at. We use an ssh tunnel:
-  sitting-here> ssh -C -R 1139:localhost:139 far-away.east
-
-   Or one could combine this with the VNC tunnel at the same time, e.g.:
-  sitting-here> ssh -C -R 1139:localhost:139 -t -L 5900:localhost:5900 far-away
-.east 'x11vnc -localhost -display :0'
-
-   Port 139 is the Windows Service port. For Windows systems instead of
-   Samba, you may need to use the actual IP address of the Window machine
-   instead of "localhost" in the -R option (since the Windows service
-   does not listen on localhost by default.)
-
-   Note that we use 1139 instead of 139 on the remote side because 139
-   would require root permission to listen on (and you may have a samba
-   server running on it already.)
-
-   The ssh -C is to enable compression, which might speed up the data
-   transfers.
-
-   Depending on the remote system side configuration, it may or may not
-   be possible to mount the SMB share as a non-root user. Try it first as
-   a non-root user and if that fails you will have to become root.
-
-   We will assume the user name is "fred" and we will try to mount the
-   viewer-side Windows SMB share "//haystack/pub" in
-   /home/fred/smb-haystack-pub.
-  far-away> mkdir -p /home/fred/smb-haystack-pub
-  far-away> smbmount //haystack/pub /home/fred/smb-haystack-pub -o username=fre
-d,ip=127.0.0.1,port=1139
-
-   (The 2nd command may need to be run as root.) Then run "df" or "ls -l
-   /home/fred/smb-haystack-pub" to see if it is mounted properly. Consult
-   the smbmount(8) and related documentation (it may require some
-   fiddling to get write permissions correct, etc.) To unmount:
-  far-away> smbumount /home/fred/smb-haystack-pub
-
-   At some point we hope to fold some automation for SMB ssh redir setup
-   into the Enhanced TightVNC Viewer (SSVNC) package we provide (as of
-   Sep 2006 it is there for testing.)
-
-
-   Q-128: Can I redirect CUPS print jobs from the remote desktop where
-   x11vnc is running to a printer on my local (viewer-side) machine?
-
-   You will have to use an external network redirection for this.
-   Printing is not part of the VNC protocol.
-
-   We show a simple Unix to Unix CUPS example here. Non-CUPS port
-   redirections (e.g. LPD) should also be possible, but may be a bit more
-   tricky. If you are viewing on Windows SMB and don't have a local cups
-   server it may be trickier still (see below.)
-
-   First you will need a tunnel to redirect the print requests from the
-   remote machine to the one you sitting at. We use an ssh tunnel:
-  sitting-here> ssh -C -R 6631:localhost:631 far-away.east
-
-   Or one could combine this with the VNC tunnel at the same time, e.g.:
-  sitting-here> ssh -C -R 6631:localhost:631 -t -L 5900:localhost:5900 far-away
-.east 'x11vnc -localhost -display :0'
-
-   Port 631 is the default CUPS port. The above assumes you have a Cups
-   server running on your viewer machine (localhost:631), if not, use
-   something like my-cups-srv:631 (the viewer-side Cups server) in the -R
-   instead.
-
-   Note that we use 6631 instead of 631 on the remote side because 631
-   would require root permission to listen on (and you likely have a cups
-   server running on it already.)
-
-   Now the tricky part: to get applications to notice your cups
-   server/printer on localhost:6631.
-
-   If you have administrative privilege (i.e. root password) on the
-   x11vnc side where the desktop is running, it should be easy to add the
-   printer through some configuration utility (e.g. in KDE: Utilities ->
-   Printing -> Printing Manager, and then supply admin password, and then
-   Add Printer/Class, and then fill in the inquisitive wizard. Most
-   important is the "Remote IPP server" panel where you put in localhost
-   for Host and 6631 for Port.) The main setting you want to convey is
-   the host is localhost and the port is non-standard (e.g. 6631.) Some
-   configuration utilities will take an Internet Printing Protocol (IPP)
-   URI, e.g. http://localhost:6631/printers/,
-   ipp://localhost:6631/printers/printer-name,
-   ipp://localhost:6631/ipp/printer-name, etc. Check your CUPS
-   documentation and admin interfaces to find what the syntax is and what
-   the "printer name" is.
-
-   If you do not have root or print admin privileges, but are running a
-   recent (version 1.2 or greater) of the Cups client software, then an
-   easy way to temporarily switch Cups servers is to create the directory
-   and file: $HOME/.cups/client.conf on the remote side with a line like:
-  ServerName localhost:6631
-
-   When not using x11vnc for remote access you can comment the above line
-   out with a '#' (or rename the client.conf file), to have normal cups
-   operation.
-
-   Unfortunately, running applications may need to be restarted to notice
-   the new printers (libcups does not track changes in client.conf.)
-   Depending on circumstances, a running application may actually notice
-   the new printers without restarting (e.g. no print dialog has taken
-   place yet, or there are no CUPS printers configured on the remote
-   side.)
-
-   Cups client software that is older (1.1) does not support appending
-   the port number, and for newer ones there is a bug preventing it from
-   always working (fixed in 1.2.3.) Kludges like these at the command
-   line will work:
-  far-away> env CUPS_SERVER=localhost IPP_PORT=6631 lpstat -p -d
-  far-away> env CUPS_SERVER=localhost IPP_PORT=6631 lpr -P myprinter file.ps
-  far-away> env CUPS_SERVER=localhost IPP_PORT=6631 firefox
-
-   but are somewhat awkward since you have to retroactively set the env.
-   var IPP_PORT. Its value cannot be broadcast to already running apps
-   (like the $HOME/.cups/client.conf trick sometimes does.) A common
-   workaround for an already running app is to somehow get it to "Print
-   To File", e.g. file.ps and then use something like the lpr example
-   above. Also, the option "-h host:port" works with CUPS lp(1) and
-   lpr(1).
-
-   You can also print to Windows shares printers in principle. You may do
-   this with the smbspool(8) command, or configure the remote CUPS via
-   lpadmin(8), etc, to use a printer URI something like
-   smb://machine:port/printer (this may have some name resolution
-   problems WRT localhost.) Also, as with SMB mounting, the port redir
-   (-R) to the Windows machine must use the actual IP address instead of
-   "localhost".
-
-   At some point we hope to fold some automation for CUPS ssh redir setup
-   into the Enhanced TightVNC Viewer (SSVNC) package we provide (as of
-   Sep 2006 it is there for testing.)
-
-
-   Q-129: How can I hear the sound (audio) from the remote applications
-   on the desktop I am viewing via x11vnc?
-
-   You will have to use an external network audio mechanism for this.
-   Audio is not part of the VNC protocol.
-
-   We show a simple Unix to Unix esd example here (artsd should be
-   possible too, we have also verified the esd Windows port works for the
-   method described below.)
-
-   First you will need a tunnel to redirect the audio from the remote
-   machine to the one you sitting at. We use an ssh tunnel:
-  sitting-here> ssh -C -R 16001:localhost:16001 far-away.east
-
-   Or one could combine this with the VNC tunnel at the same time, e.g.:
-  sitting-here> ssh -C -R 16001:localhost:16001 -t -L 5900:localhost:5900 far-a
-way.east 'x11vnc -localhost -display :0'
-
-   Port 16001 is the default ESD uses. So when an application on the
-   remote desktop makes a sound it will connect to this tunnel and be
-   redirected to port 16001 on the local machine (sitting-here in this
-   example.) The -C option is an attempt to compress the audio a little
-   bit.
-
-   So we next need a local (sitting-here) esd daemon running that will
-   receive those requests and play them on the local sound device:
-  sitting-here> esd -promiscuous -port 16001 -tcp -bind 127.0.0.1
-
-   See the esd(1) man page for the meaning of the options (the above are
-   not very secure.) (This method also works with the EsounD windows port
-   esd.exe)
-
-   To test this sound tunnel, we use the esdplay program to play a simple
-   .wav file:
-  far-away> esdplay -s localhost:16001 im_so_happy.wav
-
-   If you hear the sound (Captain Kirk in this example), that means you
-   are in great shape.
-
-   To run individual audio applications you can use the esddsp(1)
-   command:
-  far-away> esddsp -s localhost:16001 xmms
-
-   Then you could try playing some sounds inside xmms. You could also set
-   the environment variable ESPEAKER=localhost:16001 to not need to
-   supply the -s option all the time. (for reasons not clear, sometimes
-   esddsp can figure it out on its own.) All the script esddsp does is to
-   set ESPEAKER and LD_PRELOAD for you so that when the application opens
-   the sound device (usually /dev/dsp) its interactions with the device
-   will be intercepted and sent to the esd daemon running on sitting-here
-   (that in turn writes them to the real, local /dev/dsp.)
-
-   Redirecting All sound:
-
-   It does not seem to be possible to switch all of the sound of the
-   remote machine from its sound device to the above esd+ssh tunnel
-   without some preparation. But it can be done reasonably well if you
-   prepare (i.e. restart) the desktop with this in mind.
-
-   Here is one way to redirect all sound. The idea is we run the entire
-   desktop with sound directed to localhost:16001. When we are sitting at
-   far-away.east we run "esd -promiscuous -port 16001 -tcp -bind
-   127.0.0.1" on far-away.east (to be able to hear the sound.) However,
-   when we are sitting at sitting-here.west we kill that esd process and
-   run that same esd command on sitting-here.west and start up the above
-   ssh tunnel. This is a little awkward, but with some scripts one would
-   probably kill and restart the esd processes automatically when x11vnc
-   is used.
-
-   So next we have to run the whole desktop pointing toward our esd. Here
-   is a simple way to test. Log in to the machine via the "FailSafe"
-   desktop. Then in the lone terminal type something like:
-  esddsp -s localhost:16001 gnome-session
-or:
-  esddsp -s localhost:16001 startkde
-
-   where the last part is whatever command starts your desktop (even
-   fvwm2.) This causes the environment variables ESPEAKER and LD_PRELOAD
-   to be set appropriately and every application (processes with the
-   desktop as an ancestor) will use them. If this scheme works well you
-   can make it less klunky by adding the command to your ~/.xsession,
-   etc. file that starts your default desktop. Or you may be able to
-   configure your desktop to use localhost:16001, or whatever is needed,
-   via a gui configuration panel. Some Notes:
-     * Not all audio applications are compatible with the esd and artsd
-       mechanisms, but many are.
-     * The audio is not compressed so you probably need a broadband or
-       faster connection. Listening to music may not be very pleasant...
-       (Although we found streaming music from across the US over cable
-       modem worked OK, but took 200 KB/sec, to use less bandwidth
-       consider something like "ssh far-away.east 'cat favorite.mp3' |
-       mpg123 -b 4000 -")
-     * Linux does not seem to have the concept of LD_PRELOAD_64 so if you
-       run on a mixed 64- and 32-bit ABI system (e.g. AMD x86_64) some of
-       the applications will fail to run because LD_PRELOAD will point to
-       libraries of the wrong wordsize.
-     * At some point we hope to fold some automation for esd or artsd ssh
-       redir setup into the Enhanced TightVNC Viewer (SSVNC) package we
-       provide (as of Sep/2006 it is there for testing.)
-
-
-   Q-130: Why don't I hear the "Beeps" in my X session (e.g. when typing
-   tput bel in an xterm)?
-
-   As of Dec/2003 "Beep" XBell events are tracked by default. The X
-   server must support the XKEYBOARD extension (this is not on by default
-   in Solaris, see Xserver(1) for how to turn it on via +kb), and so you
-   won't hear them if the extension is not present.
-
-   If you don't want to hear the beeps use the -nobell option. If you
-   want to hear the audio from the remote applications, consider trying a
-   redirector such as esd.
-
-
-   Q-131: Does x11vnc work with IPv6?
-
-   Update: as of Apr/2010 in the 0.9.10 x11vnc development tarball, there
-   is now built-in support for IPv6 (128 bit internet addresses.) See the
-   -6 and -connect options for details.
-
-   The remainder of this FAQ entry shows how to do with this with pre
-   0.9.10 x11vnc using IPv6 helper tools.
-     _________________________________________________________________
-
-   Using an external IPv6 helper:
-   A way to do this is via a separate helper program such as inetd (or
-   for encrypted connections: ssh or stunnel.) For example, you configure
-   x11vnc to be run from inetd or xinetd and instruct it to listen on an
-   IPv6 address. For xinetd the setting "flags = IPv6" will be needed.
-   For inetd.conf, an example is:
-  5900 stream tcp6 nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc_wrapper.sh
-
-   We also provide a transitional tool in "x11vnc/misc/inet6to4" that
-   acts as a relay for any IPv4 application to allow connections over
-   IPv6. For example:
-  inet6to4 5900 localhost:5900
-
-   where x11vnc is listening on IPv4 port 5900.
-
-   Also note that not all VNC Viewers are IPv6 enabled, so a redirector
-   may also be needed for them. The tool "inet6to4 -r ..." can do this as
-   well. SSVNC (see below) supports IPv6 without need for the helper.
-
-  # ./inet6to4 -help
-
-  inet6to4:  Act as an ipv6-to-ipv4 relay for tcp applications that
-             do not support ipv6.
-
-  Usage:     inet6to4
-             inet6to4 -r
-
-  Examples:  inet6to4 5900 localhost:5900
-             inet6to4 8080 web1:80
-             inet6to4 -r 5900 fe80::217:f2ff:fee6:6f5a%eth0:5900
-
-  The -r option reverses the direction of translation (e.g. for ipv4
-  clients that need to connect to ipv6 servers.)  Reversing is the default
-  if this script is named 'inet4to6' (e.g. by a symlink.)
-
-  Use Ctrl-C to stop this program.
-
-  You can also set env. vars INET6TO4_LOOP=1 or INET6TO4_LOOP=BG
-  to have an outer loop restarting this program (BG means do that
-  in the background), and INET6TO4_LOGFILE for a log file.
-  Also set INET6TO4_VERBOSE to verbosity level and INET6TO4_WAITTIME
-  and INET6TO4_PIDFILE (see below.)
-
-   The "INET6TO4_LOOP=BG" and "INET6TO4_LOGFILE=..." env. variables make
-   the tool run reliably as a daemon for very long periods. Read the top
-   part of the script for more information.
-     _________________________________________________________________
-
-   Encrypted Tunnels with IPv6 Support:
-   For SSH tunnelled encrypted VNC connections, one can of course use the
-   IPv6 support in ssh(1).
-
-   For SSL encrypted VNC connections, one possibility is to use the IPv6
-   support in stunnel(1). This includes the built-in support via the
-   -stunnel option. For example:
-  x11vnc -stunnel SAVE -env STUNNEL_LISTEN=:: -env STUNNEL_DEBUG=1 ...
-     _________________________________________________________________
-
-   SSH IPv6 Tricks:
-   It is interesting to note that ssh(1) can do basically the same thing
-   as inet6to4 above by:
-  ssh -g -L 5900:localhost:5901 localhost "printf 'Press Enter to Exit: '; read
- x"
-
-   (where we have x11vnc running via "-rfbport 5901" in this case.)
-
-   Note that one can also make a home-brew SOCKS5 ipv4-to-ipv6 gateway
-   proxy using ssh like this:
-  ssh -D '*:1080' localhost "printf 'Press Enter to Exit: '; read x"
-
-   then specify a proxy like socks://hostname:1080 where hostname is the
-   machine running the above ssh command (add -v to ssh for connection
-   logging info.)
-     _________________________________________________________________
-
-   IPv6 SSVNC Viewer:
-   Our SSVNC VNC Viewer is basically a wrapper for ssh(1) and stunnel(1),
-   and so it already has good IPv6 support because these two commands do.
-   On Unix, MacOSX, and Windows nearly all of the the remaining parts of
-   SSVNC (e.g. the built-in proxying and un-encrypted connections) have
-   been modified to support IPv6 in SSVNC 1.0.26.
-
-
-
-
-
-
-    Contributions:
-
-   Q-132: Thanks for your program or for your help! Can I make a
-   donation?
-
-   Please do (any amount is appreciated; very few have donated) and thank
-   you for your support! Click on the PayPal button below for more info.
-
-   [x-click-but04.gif]-Submit
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/chainingssh.html:
-
-
-     _________________________________________________________________
-
-   Chaining ssh's: Note that for use of a ssh gateway and -L redirection
-   to an internal host (e.g. "-L 5900:otherhost:5900") the VNC traffic
-   inside the firewall is not encrypted and you have to manually log into
-   otherhost to start x11vnc. Kyle Amon shows a method where you chain
-   two ssh's together that encrypts all network traffic and also
-   automatically starts up x11vnc on the internal workstation:
-#!/bin/sh
-#
-gateway="example.com"   # or "user at example.com"
-host="labyrinth"        # or "user at hostname"
-user="kyle"
-
-# Need to sleep long enough for all of the passwords and x11vnc to start up.
-# The </dev/null below makes the vncviewer prompt for passwd via popup window.
-#
-(sleep 10; vncviewer -encodings "copyrect tight zrle zlib hextile" \
-    localhost:0 </dev/null >/dev/null) &
-
-# Chain the vnc connection thru 2 ssh's, and connect x11vnc to user's display:
-#
-exec /usr/bin/ssh -t -L 5900:localhost:5900 $gateway \
-     /usr/bin/ssh -t -L 5900:localhost:5900 $host \
-     sudo /usr/bin/x11vnc -localhost -auth /home/$user/.Xauthority \
-         -rfbauth .vnc/passwd -display :0
-
-   Also note the use of sudo(1) to switch to root so that the different
-   user's .Xauthority file can be accessed. See the visudo(8) manpage for
-   details on how to set this up (remove the sudo if you do not want to
-   do this). One can also chain together ssh's for reverse connections
-   with vncviewers using the -listen option. For this case -R would
-   replace the -L (and 5500 the 5900, see the #2 example script above).
-   If the gateway machine's sshd is configured with GatewayPorts=no (the
-   default) then the double chaining of "ssh -R ..." will be required for
-   reverse connections to work.
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/miscbuild.html:
-
-
-     _________________________________________________________________
-
-   Misc. Build problems:   We collect here rare build problems some users
-   have reported and the corresponding workarounds. See also the FAQ's on
-   building.
-     _________________________________________________________________
-
-   ENV parameter: One user had a problem where the build script below was
-   failing because his work environment had the ENV variable set to a
-   script that was resetting his PATH so that gcc could no longer be
-   found. Make sure you do not have any ENV or BASH_ENV in your
-   environment doing things like that. Typing "unset ENV", etc. before
-   configuring and building should clear it.
-     _________________________________________________________________
-
-   Bash xpg: One user had his bash shell compiled with
-   --enable-xpg-echo-default that causes some strange behavior with
-   things like echo "\\1 ..." the configure script executes. In
-   particular instead of getting "\1" the non-printable character "^A" is
-   produced, and causes failures at compile time like:
-  ../rfb/rfbconfig.h:9:22: warning: extra tokens at end of #ifndef directive
-
-   The workaround is to configure like this:
-  env CONFIG_SHELL=/bin/sh /bin/sh ./configure
-
-   i.e. avoid using the bash with the misbehavior. A bug has been filed
-   against autoconf to guard against this.
-     _________________________________________________________________
-
-   AIX: one user had to add the "X11.adt" package to AIX to get build
-   header files like XShm.h, etc.
-     _________________________________________________________________
-
-   Ubuntu Feisty Fawn 7.04: In May/2007 one user said he needed to add
-   these packages to compile x11vnc on that Linux distro and version:
-  apt-get install build-essential make bin86 libjpeg62-dev libssl-dev libxtst-d
-ev
-
-   Note that Ubuntu is based on Debian, so perhaps this is the list
-   needed on Debian (testing?) as well. To build in Avahi (mDNS service
-   advertising) support it would appear that libavahi-client-dev is
-   needed as well.
-     _________________________________________________________________
-
-   Exceedingly slow compilation: x11vnc has a couple of files which
-   contain very large "case statements" (over 100 cases) that on some
-   platforms can take a very long time to compile (in extreme cases over
-   an hour). However on 32bit Linux with intel/amd processor and gcc
-   these files usually take less than 10 seconds to compile. For 64bit
-   systems using gcc the problem appears to be much worse.
-
-   The two files with the large number of cases, remote.c and x11vnc.c,
-   have no real need to be optimized (the code is used only very
-   infrequently). So it is fine to supply "-O0" (disables optimization)
-   to CFLAGS when compiling them. However, it is tricky with
-   autoconf/automake to do this (especially since both the compiler and
-   make versions have a big effect).
-
-   So if the compile times are getting too long for you for these two
-   files you will need to manually change some things. First, run
-   configure and when it has finished, edit the generated file
-   x11vnc/Makefile and put these lines at the very top:
-x11vnc-x11vnc.o :  CFLAGS += -O0
-x11vnc-remote.o :  CFLAGS += -O0
-
-   Those lines assume gnu make (gmake) is being used. If you are using
-   another make, say Solaris make, insert these instead:
-x11vnc-x11vnc.o := CFLAGS += -O0
-x11vnc-remote.o := CFLAGS += -O0
-
-   You could write a build shell script that modified the Makefile this
-   way before running make.
-
-   The "-O0" (note it is "capital Oh" followed by "zero") assumes the gcc
-   compiler. If you are using a different compiler you will need to find
-   the command line option to disable optimization, or otherwise have the
-   lines set CFLAGS to the empty string.
-     _________________________________________________________________
-
-   Broken Thread Local Storage on SuSE 9.2: Starting with x11vnc 0.9.8
-   the bundled libvncserver uses the __thread keyword to make some of the
-   encodings (i.e. tight) thread safe (multiple VNC clients can be using
-   tight at the same time in x11vnc -threads mode.) Evidently on the old
-   SuSE 9.2 system the compiler does not support the thread local storage
-   properly. Here is an example build failure:
-tight.c:1126: error: unrecognizable insn:
-(insn:HI 11 10 13 0 (nil) (set (reg/f:SI 59)
-        (const:SI (plus:SI (symbol_ref:SI ("%lpalette"))
-                (const_int 2048 [0x800])))) -1 (nil)
-    (expr_list:REG_EQUAL (const:SI (plus:SI (symbol_ref:SI ("%lpalette"))
-                (const_int 2048 [0x800])))
-        (nil)))
-tight.c:1126: internal compiler error: in extract_insn, at recog.c:2175
-Please submit a full bug report,
-with preprocessed source if appropriate.
-See URL:http://www.suse.de/feedback for instructions.
-
-   The workaround is to disable thread local storage at configure time
-   like this:
-env CPPFLAGS="-DTLS=''" ./configure
-
-   and then build it.
-     _________________________________________________________________
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/sunray.html:
-
-
-    Sun Ray Notes:
-
-   You can run x11vnc on your (connected or disconnected) SunRay session
-   (Please remember to use settings like -wait 200, -sb 15, and not
-   running a screensaver animation (blank instead) to avoid being a
-   resource hog! x11vnc does induce a lot of memory I/O from polling the
-   X server. It also helps to have a solid background color, e.g.
-   -solid).
-
-   News: Sun Ray Remote Control Toolkit: See the nice set of tools in the
-   Sun Ray Remote Control Toolkit that launch x11vnc automatically for
-   you for certain usage modes.
-
-   You have to know the name of the machine your SunRay session X server
-   is running on (so you can ssh into it and start x11vnc). You also need
-   to know the X11 DISPLAY number for the session: on a SunRay it could
-   be a large number, e.g. :137, since there are many people with X
-   sessions (Xsun processes) on the same machine. If you don't know it,
-   you can get it by running who(1) in a shell on the SunRay server and
-   looking for the dtlocal entry with your username (and if you don't
-   even know which server machine has your session, you could login to
-   all possible ones looking at the who output for your username...).
-
-   I put some code in my ~/.dtprofile script that stores $DISPLAY
-   (including the hostname) in a ~/.sunray_current file at session
-   startup (and deletes it when the X session ends) to make it easy to
-   get at the hostname and X11 display number info for my current X
-   sessions when I ssh in and am about to start x11vnc.
-
-   SunRay Gotcha #1:   Note that even though your SunRay X11 DISPLAY is
-   something like :137, x11vnc still tries for port 5900 as its listening
-   port if it can get it, in which case the VNC display (i.e. the
-   information you supply to the VNC viewer) is something like
-   sunray-server:0   (note the :0 corresponding to port 5900, it is not
-   :137). If it cannot get 5900, it tries for 5901, and so on. You can
-   also try to force the port (and thereby the VNC display) using the
-   -rfbport NNNN option.
-
-   Especially on a busy Sun Ray server it is often difficult to find free
-   ports for both VNC and the HTTP Java applet server to listen on. This
-   script, vnc_findports may be of use for doing this automatically. It
-   suggests x11vnc command line options based on netstat output that
-   lists the occupied ports. It is even more difficult to start
-   vncserver/Xvnc on a busy Sun Ray because then 3 ports (HTTP, VNC, and
-   X11), all separated by 100 are needed! This script, findvncports may
-   be helpful as well. Both scripts start at VNC display :10 and work
-   their way up.
-
-   SunRay Gotcha #2:   If you get an error like:
-        shmget(tile) failed.
-        shmget: No space left on device
-
-   when starting up x11vnc that most likely means all the shared memory
-   (shm) slots are filled up on your machine. The Solaris default is only
-   100, and that can get filled up in a week or so on a SunRay server
-   with lots of users. If the shm slot is orphaned (e.g. creator process
-   dies) the slot is not reclaimed. You can view the shm slots with the
-   "ipcs -mA" command. If there are about 100 then you've probably hit
-   this problem. They can be cleaned out (by the owner or by root) using
-   the ipcrm command. I wrote a script shm_clear that finds the orphans
-   and lists or removes them. Longer term, have your SunRay sysadmin add
-   something like this to /etc/system:
-        set shmsys:shminfo_shmmax = 0x2000000
-        set shmsys:shminfo_shmmni = 0x1000
-
-   SunRay Gotcha #3:   Some SunRay installations have implemented
-   suspending certain applications when a SunRay session is in a
-   disconnected state (e.g. Java Badge pulled out, utdetach, etc). This
-   is a good thing because it limits hoggy or runaway apps from wasting
-   the shared CPU resource. Think how much CPU and memory I/O is wasted
-   by a bunch of Firefox windows running worthless Flash animations while
-   your session is disconnected!
-
-   So some sites have implemented scripts to suspend (e.g. kill -STOP)
-   certain apps when your badge is removed from the SunRay terminal. When
-   you reattach, it kill -CONT them. This causes problems for viewing the
-   detached SunRay session via x11vnc: those suspended apps will not
-   respond (their windows will be blank or otherwise inactive).
-
-   What to do? Well, since you are going to be using the application you
-   might as well unfreeze it rather than starting up a 2nd instance. Here
-   is one way to do it using the kill -CONT mechanism:
-   kill -CONT `ps -ealf | grep ' T ' | grep $LOGNAME | awk '{print $4}'`
-
-   If you want to be a good citizen and re-freeze them before you exit
-   x11vnc this script could be of use:
-#!/bin/sh
-#
-# kill -STOP/-CONT script for x11vnc (or other) SunRay usage ("freezes"
-# certain apps from hogging resources when disconnected).
-#
-# Put here a pattern that matches the apps that are frozen:
-#
-appmatch="java_vm|jre|netscape-bin|firefox-bin|realplay|acroread|mozilla-bin"
-
-if [ "X$1" = "Xfreeze" ]; then
-        pkill -STOP -U $LOGNAME "$appmatch"
-elif [ "X$1" = "Xthaw" ]; then
-        pkill -CONT -U $LOGNAME "$appmatch"
-
-elif [ "$RFB_MODE" = "afteraccept" -a "$RFB_STATE" = "NORMAL" ]; then
-        # a valid x11vnc login.
-        if [ "$RFB_CLIENT_COUNT" = "1" ]; then
-                # only one client present.
-                pkill -CONT -U $LOGNAME "$appmatch"
-        fi
-elif [ "$RFB_MODE" = "gone" -a "$RFB_STATE" = "NORMAL" ]; then
-        # a valid x11vnc login.
-        if [ "$RFB_CLIENT_COUNT" = "0" ]; then
-                # last client present has just left.
-                pkill -STOP -U $LOGNAME "$appmatch"
-        fi
-fi
-exit 0
-
-   If you called the script "goodcitizen" you could type "goodcitizen
-   thaw" to unfreeze them, and then "goodcitizen freeze" to refreeze
-   them. One could also use these x11vnc options "-afteraccept
-   goodcitizen -gone goodcitizen" to do it automatically.
-
-   SunRay Gotcha #4:   Recent versions of the Sun Ray Server Software
-   SRSS (seems to be version 3.0 or 3.1) have a "misfeature" that when
-   the session is disconnected (i.e. badge/smartcard out) the screen
-   locker (xscreensaver) will freeze the X server just when the "Enter
-   Password" dialog box appears. So you cannot unlock the screen remotely
-   via x11vnc!
-
-   Update: please see Bob Doolittle's detailed description of the this
-   issue at the bottom of this section.
-
-   Here "freeze" means "stop other X clients from inserting keyboard and
-   mouse input and from viewing the current contents of the screen". Or
-   something like that; the upshot is x11vnc can't do its normal thing.
-
-   There are several workarounds for this.
-
-   1) The easiest one by far is to put these lines in your
-   $HOME/.dtprofile file:
-SUN_SUNRAY_UTXLOCK_PREF="/usr/openwin/bin/xlock -mode blank"
-export SUN_SUNRAY_UTXLOCK_PREF
-
-   One might argue that xlock isn't particularly "pretty". (Just IMHO,
-   but if something like this not being pretty actually gets in the way
-   of your work I think some introspection may be in order. :-)
-
-   2) The problem has been traced to the pam_sunray.so PAM module.
-   Evidently xscreensaver invokes this pam module and it communicates
-   with utsessiond who in turn instructs the Xsun server to not process
-   any synthetic mouse/keyboard input or to update the screen
-   framebuffer. It is not clear if this is by design (security?) or
-   something else.
-
-   In any event, the problem can be avoided, somewhat drastically, by
-   commenting out the corresponding line in /etc/pam.conf:
-#xscreensaver auth sufficient /opt/SUNWut/lib/pam_sunray.so syncondisplay
-
-   Leave the other xscreensaver pam authentication lines unchanged. The
-   dtsession-SunRay line may also need to be commented out to avoid the
-   problem for CDE sessions. N.B. it is possible the application of a
-   SSRS patch, etc, may re-enable that /etc/pam.conf line. It may be
-   difficult to convince a sysadmin to make this change.
-
-   3) A more forceful way is to kill the xscreensaver process from a
-   shell prompt whenever you connect via x11vnc and the screen is in a
-   locked state:
-pkill -U $LOGNAME '^xscreensaver$'
-
-   And then after you are in be sure to restart it by typing something
-   like:
-xscreensaver &
-
-   You may want to avoid restarting it until you are about to disconnect
-   your VNC viewer (since if it locks the screen while you are working
-   you'll be stuck again).
-
-   3') The above idea can be done a bit more cleanly by having x11vnc do
-   it. Suppose we called the following script xss_killer:
-#!/bin/sh
-#
-# xss_killer: kill xscreensaver after a valid x11vnc client logs in.
-#             Restart xscreensaver and lock it when the last client
-#             disconnects.
-
-PATH=/usr/openwin/bin:/usr/bin:$PATH
-export PATH
-
-if [ "$RFB_MODE" = "afteraccept" -a "$RFB_STATE" = "NORMAL" ]; then
-        # a valid x11vnc login.
-        if [ "$RFB_CLIENT_COUNT" = "1" ]; then
-                # only one client present.
-                pkill -U $LOGNAME '^xscreensaver$'
-                pkill -KILL -U $LOGNAME -f xscreensaver/hacks
-        fi
-elif [ "$RFB_MODE" = "gone" -a "$RFB_STATE" = "NORMAL" ]; then
-        # a valid x11vnc login.
-        if [ "$RFB_CLIENT_COUNT" = "0" ]; then
-                # last client present has just left.
-                xscreensaver -nosplash &
-                sleep 1
-                xscreensaver-command -lock &
-        fi
-fi
-
-   Then we would run x11vnc with these options: "-afteraccept xss_killer
-   -gone xss_killer". The -afteraccept option (introduced in version 0.8)
-   is used to run a command after a vncviewer has successfully logged in
-   (note that this is a VNC login, not a Unix login, so you may not want
-   to do this if you are really paranoid...)
-
-   Note if you use the above script and also plan to Ctrl-C (SIGINT)
-   x11vnc you have to run the xscreensaver in a new process group to
-   avoid killing it as well. One way to do this is via this kludge:
-perl -e 'setpgrp(0,0); exec "xscreensaver -nosplash &"'
-
-   in the above script.
-
-   4) There appears to be a bug in pam_sunray.so in that it doesn't seem
-   to honor the convention that, say, DISPLAY=unix:3 means to use Unix
-   sockets to connect to display 3 on the local machine (this is a bit
-   faster than TCP sockets). Rather, it thinks the display is a non-local
-   one to a machine named "unix" (that usually does not resolve to an IP
-   address).
-
-   Amusingly, this can be used to bypass the pam_sunray.so blocking of
-   Xsun that prevents one from unlocking the screen remotely via x11vnc.
-   One could put something like this in $HOME/.dtprofile to kill any
-   existing xscreensavers and then start up a fresh xscreensaver using
-   DISPLAY=unix:N
-# stop/kill any running xscreensavers (probably not running yet, but to be sure
-)
-xscreensaver-command -exit
-pkill -U $LOGNAME '^xscreensaver$'
-env DISPLAY=`echo $DISPLAY | sed -e 's/^.*:/unix:/'` xscreensaver &
-
-
-   Important: Note that all of the above workarounds side-step the
-   pam_sunray.so PAM module in one way or another. You'll need to see if
-   that is appropriate for your site's SunRay / smartcard usage. Also,
-   these hacks may break other things and so you may want to test various
-   scenarios carefully. E.g. check corner cases like XDMCP/dtremote,
-   NSCM, etc.
-
-
-   Update May 2008: Here is a useful description of this issue from Bob
-   Doolittle who is a developer for Sun Ray at Sun. I don't have the time
-   to digest and distill it and then adjust the above methods to provide
-   a clearer description, so I just include below the description he sent
-   me with the hope that it will help some users:
-
-     In SRSS 4.0 and earlier, the purpose of pam_sunray.so in the "auth"
-     PAM stack of screensavers is to enable NSCM (and, although this is
-     much less commonly used, "SC", which is configured when 3rd-party
-     software is installed to allow smartcards to be used as part of the
-     authentication process) to work. It should have no effect with
-     smartcards. Currently, however, it does block the PAM stack for all
-     sessions, which causes xscreensaver, when it locks a disconnected
-     session, to not process any mouse or keyboard events as you
-     describe (unless xscreensaver does an X server grab, however, other
-     applications should still be able to draw in the session although
-     xscreensaver may be playing tricks like putting a black window on
-     top of everything). In both of the NSCM and SC models,
-     authentication occurs in a separate session before SRSS will
-     reconnect to the user session, in which case pam_sunray.so causes
-     xscreensaver to just unlock the screen without prompting the user
-     to enter their password again. To do this, pam_sunray.so has to
-     block until the session becomes reconnected, so it can query SRSS
-     at that time to determine whether the user has already
-     authenticated or not. In SRSS 4.0 and earlier releases,
-     pam_sunray.so could have been optimized to not block smartcard
-     sessions, although since the session is disconnected this typically
-     isn't important (except in the x11vnc case, as you've observed).
-
-     In SRSS 4.1, however, for increased security the out-of-session
-     authentication model has been extended to *all* session types, so
-     pam_sunray.so will be required in all cases unless users are
-     willing to authenticate twice upon hotdesking (e.g. when their card
-     is inserted). In future, we may do away with pam_sunray.so, and in
-     fact with any traditional screen locker in the user session, since
-     SRSS itself will be providing better security than a screen locker
-     running entirely within the user's X session is capable of
-     providing.
-
-     Your trick of setting DISPLAY to unix:DPY will effectively disable
-     pam_sunray.so (I'm not sure I'd call that a bug - you're going out
-     of your way to do something that wouldn't occur in the normal
-     course of events, and really provides no useful value other than to
-     tickle this behavior in pam_sunray.so). This will mean that, in
-     SRSS 4.0 and earlier releases, users will be prompted for their
-     passwords twice when reconnecting to their sessions for NSCM and SC
-     session types. In 4.1, disabling pam_sunray.so in this way will
-     cause this double-authentication to occur for *all* sessions,
-     including simple smartcard sessions. Users may be willing to pay
-     that price in order to be able to use x11vnc in disconnected
-     sessions. I like this hack, personally. It's a little less
-     convenient than some of the other approaches you describe, but it's
-     lighter-weight and more secure than most of the other approaches,
-     and provides the value of being able to use x11vnc in locked
-     sessions.
-
-     Here are some other minor notes: - I wouldn't recommend storing
-     your display in your .dtprofile, unless you're willing to live with
-     a single session at a time. Personally, I often find myself using
-     several sessions, in several FoGs, for short periods of time so
-     this would certainly break. IMO it's pretty easy to use $DISPLAY to
-     do what you want on the fly, as needed, so I don't think the price
-     of breaking multiple-session functionality would be worth the
-     convenience, to me at least. Here's some ksh/bash syntax to extract
-     the hostname and display number on the fly which you may find
-     useful:
-HOSTNAME=${DISPLAY%:*}
-FULLDPY=${DISPLAY#*:}
-DPYNUM=${FULLDPY%.*}
-
-     A final note may give you some insight into other clever hacks in
-     this area: - Check out utaction. It's a very handy little utility
-     that can be run as a daemon in the user session which will invoke a
-     specified command upon session connects and/or disconnects.
-     Personally, I start one up in my .dtprofile as follows:
-utaction -c $HOME/.srconnectrc -d $HOME/.srdisconnectrc &
-
-     This then allows me to construct a .srconnectrc script containing
-     useful commands I'd like to have run every time I insert my
-     smartcard, and a .srdisconnectrc script of commands to be run every
-     time I remove my smartcard (or, connect/disconnect to my session
-     via NSCM or SC). This can be used for things like notifying a chat
-     client of away status, as well as some of the hacks you've
-     described on your page such as freeze/unfreeze, or perhaps to
-     terminate an xscreensaver and start up a new one with the unix:DPY
-     $DISPLAY specification as you describe (although it probably makes
-     most sense to do this at login time, as opposed to every connect or
-     disconnect event).
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/ssl.html:
-
-
-     _________________________________________________________________
-
-   Notes on x11vnc SSL Certificates and Key Management:
-
-   The simplest scheme ("x11vnc -ssl TMP") is where x11vnc generates a
-   temporary, self-signed certificate each time (automatically using
-   openssl(1)) and the VNC viewer client accepts the certificate without
-   question (e.g. user clicks "Yes" in a dialog box. Perhaps the dialog
-   allows them to view the certificate too). Also note stunnel's default
-   is to quietly accept all certificates.
-
-   The encryption this provides protects against all passive sniffing of
-   the VNC traffic and passwords on the network and so it is quite good,
-   but it does not prevent a Man-In-The-Middle active attack: e.g. an
-   attacker intercepts the VNC client stream and sends it his own Public
-   key for SSL negotiation (pretending to be the server). Then it makes a
-   connection to SSL x11vnc itself and forwards the data back and forth.
-   He can see all the traffic and modify it as well.
-
-   Most people don't seem to worry about Man-In-The-Middle attacks these
-   days; they are more concerned about passive sniffing of passwords,
-   etc. Perhaps someday that will change if attack tools are used more
-   widely to perform the attack. NOTE: There are hacker tools like
-   dsniff/webmitm and cain that implement SSL Man-In-The-Middle attacks.
-   They all rely on the client not bothering to check that the cert is
-   valid.
-
-   If you are not worried about Man-In-The-Middle attacks you do not have
-   to read the techniques described in the rest of this document.
-
-   To prevent Man-In-The-Middle attacks, certificates must somehow be
-   verified. This requires the VNC client side have some piece of
-   information that can be used to verify the SSL x11vnc server.
-   Alternatively, although rarely done, x11vnc can verify VNC Clients'
-   certificates, see the -sslverify option that is discussed below.
-
-   There are a number of ways to have the client authenticate the SSL
-   x11vnc server. The quickest way perhaps would be to copy (safely) the
-   certificate x11vnc prints out:
-26/03/2006 21:12:00 Creating a temporary, self-signed PEM certificate...
-...
------BEGIN CERTIFICATE-----
-MIIC4TCCAkqgAwIBAgIJAMnwCaOjvEKaMA0GCSqGSIb3DQEBBAUAMIGmMQswCQYD
-VQQGEwJBVTEOMAwGA1UEBxMFTGludXgxITAfBgNVBAsTGGFuZ2VsYS0xMTQzNDI1
-NTIwLjQxMTE2OTEPMA0GA1UEChMGeDExdm5jMS4wLAYDVQQDEyV4MTF2bmMtU0VM
-(more lines) ...
------END CERTIFICATE-----
-
-   to the client machine(s) and have the client's SSL machinery (e.g.
-   stunnel, Web Browser, or Java plugin) import the certificate. That way
-   when the connection to x11vnc is made the client can verify that is it
-   the desired server on the other side of the SSL connection.
-
-   So, for example suppose the user is using the SSL enabled Java VNC
-   Viewer and has incorporated the x11vnc certificate into his Web
-   browser on the viewing side. If he gets a dialog that the certificate
-   is not verified he knows something is wrong. It may be a
-   Man-In-The-Middle attack, but more likely x11vnc certificate has
-   changed or expired or his browser was reinstalled and/or lost the
-   certificate, etc, etc.
-
-   As another example, if the user was using stunnel with his VNC viewer
-   (this is mentioned in this FAQ), e.g. STUNNEL.EXE on Windows, then he
-   would have to set the "CAfile = path-to-the-cert" and "verify = 2"
-   options in the stunnel.conf file before starting up the tunnel. If a
-   x11vnc certificate cannot be verified, stunnel will drop the
-   connection (and print a failure message in its log file).
-
-   A third example, using the VNC viewer on Unix with stunnel the wrapper
-   script can be used this way: "ss_vncviewer -verify ./x11vnc.crt
-   far-away.east:0" where ./x11vnc.crt is the copied certificate x11vnc
-   printed out.
-
-   As fourth example, our SSVNC enhanced tightvnc viewer can also use
-   these certificate files for server authentication. You can load them
-   via the SSVNC 'Certs...' dialog and set 'ServerCert' to the
-   certificate file you safely copied there.
-
-   Note that in principle the copying of the certificate to the client
-   machine(s) itself could be altered by a Man-In-The-Middle attack! You
-   can't win; it is very difficult to be completely secure. It is
-   unlikely the attacker could predict how you were going to send it
-   unless you had, say, done it many times before the same way. SSH is a
-   very good way to send it (but of course it too depends on public keys
-   being sent unaltered between the two machines!).
-
-   If you are really paranoid, I'm sure you'll figure out a really good
-   way to transport the certificates. See the Certificate Authority
-   scheme below for a way to make this easier (you just have to do it
-   once).
-
-     _________________________________________________________________
-
-   Saving SSL certificates and keys:
-
-   Now, it would be very inconvenient to copy the new temporary
-   certificate every time x11vnc is run in SSL mode. So for convenience
-   there is the "SAVE" keyword to instruct x11vnc to save the certificate
-   it creates:
-  x11vnc -ssl SAVE -display :0 ...
-
-   This behavior is now the default, you must use "TMP" for a temporary
-   one. It will save the certificate and private key in these files:
-  ~/.vnc/certs/server.crt
-  ~/.vnc/certs/server.pem
-
-   The ".crt" file contains only the certificate and should be safely
-   copied to the VNC Viewer machine(s) that will be authenticating the
-   x11vnc server. The ".pem" file contains both the certificate and the
-   private key and should be kept secret. (If you don't like the default
-   location ~/.vnc/certs, e.g. it is on an NFS share and you are worried
-   about local network sniffing, use the -ssldir dir option to point to a
-   different directory.)
-
-   So the next time you run "x11vnc -ssl SAVE ..." it will read the
-   server.pem file directly instead of creating a new one.
-
-   You can manage multiple SSL x11vnc server keys in this simple way by
-   using:
-  x11vnc -ssl SAVE-key2 -display :0 ...
-
-   etc, where you put whatever name you choose for the key after "SAVE-".
-   E.g. "-ssl SAVE-fred".
-
-   Also, if you want to be prompted to possibly change the made up names,
-   etc. that x11vnc creates (e.g. "x11vnc-SELF-SIGNED-CERT-7762" for the
-   CommonName) for the certificates distinguished name (DN), then use
-   "x11vnc -ssl SAVE_PROMPT ...", "x11vnc -ssl SAVE_PROMPT-fred ..." etc.
-   when you create the key the first time.
-
-   Tip: when prompting, if you choose the CommonName entry to be the full
-   internet hostname of the machine the clients will be connecting to
-   then that will avoid an annoying dialog box in their Web browsers that
-   warn that the CommonName doesn't match the hostname.
-
-     _________________________________________________________________
-
-   Passphrases for server keys:
-
-   Well, since now with the "SAVE" keyword the certificate and key will
-   be longer lived, one can next worry about somebody stealing the
-   private key and pretending to be the x11vnc server! How to guard
-   against this?
-
-   The first is that the file is created with perms 600 (i.e. -rw-------)
-   to make it harder for an untrusted user to copy the file. A better way
-   is to also encrypt the private key with a passphrase. You are prompted
-   whether you want to do this or not when the key is first created under
-   "-ssl SAVE" mode ("Protect key with a passphrase? y/n"). It is
-   suggested that you use a passphrase. The inconvenience is every time
-   you run "x11vnc -ssl SAVE ..." you will need to supply the passphrase
-   to access the private key:
-  06/04/2006 11:39:11 using PEM /home/runge/.vnc/certs/server.pem  0.000s
-
-  A passphrase is needed to unlock an OpenSSL private key (PEM file).
-  Enter passphrase>
-
-   before x11vnc can continue.
-
-     _________________________________________________________________
-
-   Being your own Certificate Authority:
-
-   A very sophisticated way that scales well if the number of users is
-   large is to use a Certificate Authority (CA) whose public certificate
-   is available to all of the VNC clients and whose private key has been
-   used to digitally sign the x11vnc server certificate(s).
-
-   The idea is as follows:
-     * A special CA cert and key is generated.
-     * Its private key is always protected by a good passphrase since it
-       is only used for signing.
-     * The CA cert is (safely) distributed to all machines where VNC
-       clients will run.
-     * One or more x11vnc server certs and keys are generated.
-     * The x11vnc server cert is signed with the CA private key.
-     * x11vnc is run using the server key. (e.g. "-ssl SAVE")
-     * VNC clients (viewers) can now authenticate the x11vnc server
-       because they have the CA certificate.
-
-   The advantage is the CA cert only needs to be distributed once to the
-   various machines, that can be done even before x11vnc server certs are
-   generated.
-
-   As above, it is important the CA private key and the x11vnc server key
-   are kept secret, otherwise someone could steal them and pretend to be
-   the CA or the x11vnc server if they copied the key. It is recommended
-   that the x11vnc server keys are also protected via a passphrase (see
-   the previous section).
-
-   Optionally, VNC viewer certs and keys could also be generated to
-   enable the x11vnc server to authenticate each client. This is not
-   normally done (usually a simple viewer password scheme is used), but
-   this can be useful in some situations. These optional steps go like
-   this:
-     * One or more VNC client certs and keys are generated.
-     * These VNC client certs are signed with the CA private key.
-     * The VNC client certs+keys are safely distributed to the
-       corresponding client machines.
-     * x11vnc is told to verify clients by using the CA cert. (e.g.
-       "-sslverify CA")
-     * When VNC clients (viewers) connect, they must authenticate
-       themselves to x11vnc by using their client key.
-
-   Again, it is a good idea if the client private keys are protected with
-   a passphrase, otherwise if stolen they could be used to gain access to
-   the x11vnc server. Once distributed to the client machines, there is
-   no need to keep the client key on the CA machine that generated and
-   signed it. You can keep the client certs if you like because they are
-   public.
-
-     _________________________________________________________________
-
-   How to do the above CA steps with x11vnc:
-
-   Some utility commands are provided to ease the cert+key creation,
-   signing, and management: -sslGenCA, -sslGenCert, -sslDelCert,
-   -sslEncKey, -sslCertInfo. They basically run the openssl(1) command
-   for you to manage the certs/keys. It is required that openssl(1) is
-   installed on the machine and available in PATH. All commands can be
-   pointed to an alternate toplevel certificate directory via the -ssldir
-   option if you don't want to use the default ~/.vnc/certs.
-
-   1) To generate your Certificate Authority (CA) cert and key run this:
-  x11vnc -sslGenCA
-
-   Follow the prompts, you can modify any informational strings you care
-   to. You will also be required to encrypt the CA private key with a
-   passphrase. This generates these files:
-  ~/.vnc/certs/CA/cacert.pem             (the CA public certificate)
-  ~/.vnc/certs/CA/private/cakey.pem      (the encrypted CA private key)
-
-   If you want to use a different directory use -ssldir It must supplied
-   with all subsequent SSL utility options to point them to the correct
-   directory.
-
-   2) To generate a signed x11vnc server cert and key run this:
-  x11vnc -sslGenCert server
-
-   As with the CA generation, follow the prompts and you can modify any
-   informational strings that you care to. This will create the files:
-  ~/.vnc/certs/server.crt             (the server public certificate)
-  ~/.vnc/certs/server.pem             (the server private key + public cert)
-
-   It is recommended to protect the server private key with a passphrase
-   (you will be prompted whether you want to). You will need to provide
-   it whenever you start x11vnc using this key.
-
-   3) Start up x11vnc using this server key:
-  x11vnc -ssl SAVE -display :0 ...
-
-   (SAVE corresponds to server.pem, see -sslGenCert server somename info
-   on creating additional server keys, server-somename.crt ...)
-
-   4) Next, safely copy the CA certificate to the VNC viewer (client)
-   machine(s). Perhaps:
-  scp ~/.vnc/CA/cacert.pem clientmachine:.
-
-   5) Then the tricky part, make it so the SSL VNC Viewer uses this
-   certificate! There are a number of ways this might be done, it depends
-   on what your client and/or SSL tunnel is. Some examples:
-
-   For the SSL Java VNC viewer supplied with x11vnc in
-   classes/ssl/VncViewer.jar or classes/ssl/SignedVncViewer.jar:
-     * Import the cacert.pem cert into your Web Browser (e.g. Edit ->
-       Preferences -> Privacy & Security -> Manage Certificates ->
-       WebSites -> Import)
-     * Or Import the cacert.pem cert into your Java Plugin (e.g. run
-       ControlPanel, then Security -> Certificates -> Secure Site ->
-       Import)
-
-   When importing, one would give the browser/java-plugin the path to the
-   copied cacert.pem file in some dialog. Note that the Web browser or
-   Java plugin is used for the server authentication. If the user gets a
-   "Site not verified" message while connecting he should investigate
-   further.
-
-   For the use of stunnel (e.g. on Windows) one would add this to the
-   stunnel.conf:
-  # stunnel.conf:
-  client = yes
-  options = ALL
-  CAfile = /path/to/cacert.pem          # or maybe C:\path\to\cacert.pem
-  [myvncssl]
-  accept = 5901
-  connect = far-away.east:5900
-
-   (then point the VNC viewer to localhost:1).
-
-   Here is an example for the Unix stunnel wrapper script ss_vncviewer in
-   our SSVNC package:
-  ss_vncviewer -verify ./cacert.pem far-away.east:0
-
-   Our SSVNC enhanced tightvnc viewer GUI can also use the certificate
-   file for server authentication. You can load it via the SSVNC
-   'Certs...' dialog and set 'ServerCert' to the cacert.pem file you
-   safely copied there.
-
-     _________________________________________________________________
-
-   Tricks for server keys:
-
-   To create additional x11vnc server keys do something like this:
-  x11vnc -sslGenCert server myotherkey
-
-   and use it this way:
-  x11vnc -ssl SAVE-myotherkey ...
-
-   The files will be ~/.vnc/certs/server-myotherkey.{crt,pem}
-
-   You can also create a self-signed server key:
-  x11vnc -sslGenCert server self:third_key
-
-   and use it this way:
-  x11vnc -ssl SAVE-self:third_key ...
-
-   This key is not signed by your CA. This can be handy to have a key set
-   separate from your CA when you do not want to create a 2nd CA
-   cert+key.
-
-     _________________________________________________________________
-
-   Using external CA's:
-
-   You don't have to use your own CA cert+key, you can use a third
-   party's instead. Perhaps you have a company-wide CA or you can even
-   have your x11vnc certificate signed by a professional CA (e.g.
-   www.thawte.com or www.verisign.com or perhaps the free certificate
-   service www.startcom.org or www.cacert.org).
-
-   The advantage to doing this is that the VNC client machines will
-   already have the CA certificates installed and you don't have to
-   install it on each machine.
-
-   To generate an x11vnc server cert+key this way you should generate a
-   "request" for a certicate signing something like this (we use the name
-   "external" in this example, it could be anything you want):
-  x11vnc -sslGenCert server req:external
-
-   This will create the request file:
-  ~/.vnc/certs/server-req:external.req
-
-   Which you should send to the external CA. When you get the signed
-   certificate back from them, save it in the file:
-  ~/.vnc/certs/server-req:external.crt
-
-   and create the .pem this way:
-  mv  ~/.vnc/certs/server-req:external.key    ~/.vnc/certs/server-req:external.
-pem
-  chmod 600 ~/.vnc/certs/server-req:external.pem
-  cat ~/.vnc/certs/server-req:external.crt >> ~/.vnc/certs/server-req:external.
-pem
-
-   You also rename the two files (.crt and .pem) to have a shorter
-   basename if you like. E.g.:
-  mv  ~/.vnc/certs/server-req:external.pem  ~/.vnc/certs/server-ext.pem
-  mv  ~/.vnc/certs/server-req:external.crt  ~/.vnc/certs/server-ext.crt
-
-   and the use via "x11vnc -ssl SAVE-ext ...", etc.
-
-   On the viewer side make sure the external CA's certificate is
-   installed an available for the VNC viewer software you plan to use.
-
-     _________________________________________________________________
-
-   Using Client Keys for Authentication:
-
-   You can optionally create certs+keys for your VNC client machines as
-   well. After distributing them to the client machines you can have
-   x11vnc verify the clients using SSL. Here is how to do this:
-
-  x11vnc -sslGenCert client dilbert
-  x11vnc -sslGenCert client wally
-  x11vnc -sslGenCert client alice
-  ...
-
-   As usual, follow the prompts if you want to change any of the info
-   field values. As always, it is a good idea (although inconvenient) to
-   protect the private keys with a passphrase. These files are created:
-  ~/.vnc/certs/clients/dilbert.crt
-  ~/.vnc/certs/clients/dilbert.pem
-  ...
-
-   Note that these are kept in a clients subdirectory.
-
-   Next, safely copy the .pem files to each corresponding client machine
-   and incorporate them into the VNC viewer / SSL software (see the ideas
-   mentioned above for the CA and server keys). The only difference is
-   these certificates might be referred to as "My Certificates" or
-   "Client Certificates". They are used for client authentication (which
-   is relatively rare for SSL).
-
-   After copying them you can delete the clients/*.pem files for extra
-   safety because the private keys are not needed by the x11vnc server.
-   You don't really need the clients/*.crt files either (because they
-   have been signed by the CA). But they could come in handy for tracking
-   or troubleshooting, etc.
-
-   Now start up x11vnc and instruct it to verify connecting clients via
-   SSL and the CA cert:
-  x11vnc -ssl SAVE -sslverify CA
-
-   The "CA" special token instructs x11vnc to use its CA signed certs for
-   verification.
-
-   For arbitrary self-signed client certificates (no CA) it might be
-   something like this:
-  x11vnc -ssl SAVE -sslverify path/to/client.crt
-  x11vnc -ssl SAVE -sslverify path/to/client-hash-dir
-  x11vnc -ssl SAVE -sslverify path/to/certs.txt
-
-   Where client.crt would be an individual client certificate;
-   client-hash-dir a directory of file names based on md5 hashes of the
-   certs (see -sslverify); and certs.txt signifies a single file full of
-   client certificates.
-
-   Finally, connect with your VNC viewer using the key. Here is an
-   example for the Unix stunnel wrapper script ss_vncviewer: using client
-   authentication (and the standard server authentication with the CA
-   cert):
-  ss_vncviewer -mycert ./dilbert.pem -verify ./cacert.pem far-away.east:0
-
-   Our SSVNC enhanced tightvnc viewer can also use these openssl .pem
-   files (you can load them via Certs... -> MyCert dialog).
-
-   It is also possible to use -sslverify on a per-client key basis, and
-   also using self-signed client keys (x11vnc -sslGenCert client
-   self:dilbert)
-
-   Now a tricky part is to get Web browsers or Java Runtime to import and
-   use the openssl .pem cert+key files. See the next paragraph on how to
-   convert them to pkcs12 format. If you find a robust way to import them
-   and and get them to use the cert please let us know!
-
-   Here is how to convert our openssl crt/pem files to pkcs12 format
-   (contains both the client certificate and key) that can be read by Web
-   browsers and Java for use in client authentication:
-  openssl pkcs12 -export -in mycert.crt -inkey mycert.pem -out mycert.p12
-
-   it will ask for a passphrase to protect mycert.p12. Some software
-   (e.g. Java ControlPanel) may require a non-empty passphrase. Actually,
-   since our .pem contains both the certificate and private key, you
-   could just supply it for the -in and remove the -inkey option. It
-   appears that for certificates only importing, our .crt file is
-   sufficient and can be read by Mozilla/Firefox and Java...
-
-   If you have trouble getting your Java Runtime to import and use the
-   cert+key, there is a workaround for the SSL-enabled Java applet. On
-   the Web browser URL that retrieves the VNC applet, simply add a
-   "/?oneTimeKey=..." applet parameter (see ssl-portal for more details
-   on applet parameters; you don't need to do the full portal setup
-   though). The value of the oneTimeKey will be the very long string that
-   is output of the onetimekey program found in the classes/ssl x11vnc
-   directory. Or you can set oneTimeKey=PROMPT in which case the applet
-   will ask you to paste in the long string. These scheme is pretty ugly,
-   but it works. A nice application of it is to make one time keys for
-   users that have already logged into a secure HTTPS site via password.
-   A cgi program then makes a one time key for the logged in user to use:
-   it is passed back over HTTPS as the applet parameter in the URL and so
-   cannot be sniffed. x11vnc is run to use that key via -sslverify.
-
-   Update: as of Apr 2007 in the 0.9.1 x11vnc tarball there is a new
-   option setting "-users sslpeer=" that will do a switch user much like
-   -unixpw does, but this time using the emailAddress field of the
-   Certificate subject of the verified Client. This mode requires
-   -sslverify turned on to verify the clients via SSL. This mode can be
-   useful in situations using -create or -svc where a new X server needs
-   to be started up as the authenticated user (but unlike in -unixpw
-   mode, the unix username is not obviously known).
-
-     _________________________________________________________________
-
-   Revoking Certificates:
-
-   A large, scaled-up installation may benefit from being able to revoke
-   certificates (e.g. suppose a user's laptop with a vnc client or server
-   key is compromised.) You can use this option with x11vnc: -sslCRL. See
-   the info at that link for a guide on what openssl(1) commands you will
-   need to run to revoke a certificate.
-
-     _________________________________________________________________
-
-   Additional utlities:
-
-   You can get information about your keys via -sslCertInfo. These lists
-   all your keys:
-  x11vnc -sslCertInfo list
-  x11vnc -sslCertInfo ll
-
-   (the latter is long format).
-
-   These print long output, including the public certificate, for
-   individual keys:
-  x11vnc -sslCertInfo server
-  x11vnc -sslCertInfo dilbert
-  x11vnc -sslCertInfo all             (every key, very long)
-
-   If you want to add a protecting passphrase to a key originally created
-   without one:
-  x11vnc -sslEncKey SAVE
-  x11vnc -sslEncKey SAVE-fred
-
-   To delete a cert+key:
-  x11vnc -sslDelCert SAVE
-  x11vnc -sslDelCert SAVE-fred
-  x11vnc -sslDelCert wally
-
-   (but rm(1) will be just as effective).
-
-     _________________________________________________________________
-
-   Chained Certificates:
-
-   There is increasing interest in using chained CA's instead of a single
-   CA. The merits of using chained CA's are not described here besides to
-   say its use may make some things easier when a certificate needs to be
-   revoked.
-
-   x11vnc supports chained CA certificates. We describe a basic use case
-   here.
-
-   Background: Of course the most straight forward way to use SSL with
-   x11vnc is to use no CA at all (see above): a self-signed certificate
-   and key is used and its certificate needs to be safely copied to the
-   client side. This is basically the same as the SSH style of managing
-   keys. Next level up, one can use a single CA to sign server keys: then
-   only the CA's certificate needs to be safely copied to the client
-   side, this can happen even before any server certs are created (again,
-   see all of the discussion above.)
-
-   With a certificate chain there are two or more CA's involved. Perhaps
-   it looks like this:
-  root_CA ---> intermediate_CA ---> server_cert
-
-   Where the arrow basically means "signs".
-
-   In this usage mode the client (viewer-side) will have root_CA's
-   certificate available for verifying (and nothing else.) If the viewer
-   only received server_cert's certificate, it would not have enough info
-   to verify the server. The client needs to have intermediate_CA's cert
-   as well. The way to do this with x11vnc (i.e. an OpenSSL using app) is
-   to concatenate the server_cert's pem and the intermediate_CA's
-   certificate together.
-
-   For example, suppose the file intermediate_CA.crt had
-   intermediate_CA's certificate. And suppose the file server_cert.pem
-   had the server's certificate and private key pair as described above
-   on this page. We need to do this:
-  cat intermediate_CA.crt >> server_cert.pem
-
-   (Note: the order of the items inside the file matters; intermediate_CA
-   must be after the server key and cert) and then we run x11vnc like
-   this:
-  x11vnc -ssl ./server_cert.pem ...
-
-   Then, on the VNC viewer client side, the viewer authenticates the
-   x11vnc server by using root_CA's certificate. Suppose that is in a
-   file named root_CA.crt, then using the SSVNC wrapper script
-   ss_vncviewer (which is also included in the SSVNC package) as our
-   example, we have:
-  ss_vncviewer -verify ./root_CA.crt hostname:0
-
-   (where "hostname" is the machine where x11vnc is running.) One could
-   also use the SSVNC GUI setting Certs -> ServerCert to the root_CA.crt
-   file. Any other SSL enabled VNC viewer would use root_CA.crt in a
-   similar way.
-     _________________________________________________________________
-
-   Creating Chained Certificates:
-
-   Here is a fun example using VeriSign's "Trial Certificate" program.
-   Note that VeriSign has a Root CA and also an Intermediate CA and uses
-   the latter to sign customers certificates. So this provides an easy
-   way to test out the chained certificates mechanism with x11vnc.
-
-   First we created a test x11vnc server key:
-  openssl genrsa -out V1.key 1024
-
-   then we created a certificate signing request (CSR) for it:
-  openssl req -new -key V1.key -out V1.csr
-
-   (we followed the prompts and supplied information for the various
-   fields.)
-
-   Then we went to VeriSign's page http://www.verisign.com/ssl/index.html
-   and clicked on "FREE TRIAL" (the certificate is good for 14 days.) We
-   filled in the forms and got to the point where it asked for the CSR
-   and so we pasted in the contents of the above V1.csr file. Then, after
-   a few more steps, VeriSign signed and emailed us our certificate.
-
-   The VeriSign Trial certificates were found here:
-  http://www.verisign.com/support/verisign-intermediate-ca/Trial_Secure_Server_
-Root/index.html
-  http://www.verisign.com/support/verisign-intermediate-ca/trial-secure-server-
-intermediate/index.html
-
-   The former was pasted into a file V-Root.crt and the latter was pasted
-   into V-Intermediate.crt
-
-   We pasted our Trial certificate that VeriSign signed and emailed to us
-   into a file named V1.crt and then we typed:
-  cat V1.key V1.crt > V1.pem
-  cat V1.pem V-Intermediate.crt > V1-combined.pem
-  chmod 600 V1.pem V1-combined.pem
-
-   So now the file V1-combined.pem has our private key and (VeriSign
-   signed) certificate and VeriSign's Trial Intermediate certificate.
-
-   Next, we start x11vnc:
-  x11vnc -ssl ./V1-combined.pem ...
-
-   and finally, on the viewer side (SSVNC wrapper script example):
-  ss_vncviewer -verify ./V-Root.crt hostname:0
-
-   One will find that only that combination of certs and keys will work,
-   i.e. allow the SSL connection to be established. Every other
-   combination we tried failed (note that ss_vncviewer uses the external
-   stunnel command to handle the SSL so we are really testing stunnel's
-   SSL implementation on the viewer side); and so the system works as
-   expected.
-     _________________________________________________________________
-
-   VNC Client Authentication using Certificate Chains:
-
-   Now, going the other way around with the client authenticating himself
-   via this chain of SSL certificates, x11vnc is run this way:
-  x11vnc -ssl SAVE -sslverify ./V-Root.crt ...
-
-   (note since the server must always supply a cert, we use its normal
-   self-signed, etc., one via "-ssl SAVE" and use the VeriSign root cert
-   for client authentication via -sslverify. The viewer must now supply
-   the combined certificates, e.g.:
-  ss_vncviewer -mycert ./V1-combined.pem hostname:0
-     _________________________________________________________________
-
-   Using OpenSSL and x11vnc to create Certificate Chains:
-
-   Although the x11vnc CA mechanism (-sslGenCA and -sslGenCert; see
-   above) was designed to only handle a single root CA (to sign server
-   and/or client certs) it can be coerced into creating a certificate
-   chain by way of an extra openssl(1) command.
-
-   We will first create two CA's via -sslGenCA; then use one of these CA
-   to sign the other; create a new (non-CA) server cert; and append the
-   intermediate CA's cert to the server cert to have everything needed in
-   the one file.
-
-   Here are the commands we ran to do what the previous paragraph
-   outlines.
-
-   First we create the two CA's, called CA_root and CA_Intermediate here,
-   in separate directories via x11vnc:
-  x11vnc -ssldir ~/CA_Root -sslGenCA
-     (follow the prompts, we included "CA_Root", e.g. Common Name, to aid ident
-ifying it)
-
-  x11vnc -ssldir ~/CA_Intermediate -sslGenCA
-     (follow the prompts, we included "CA_Intermediate", e.g. Common Name, to a
-id identifying it)
-
-   Next backup CA_Intermediate's cert and then sign it with CA_Root:
-  mv ~/CA_Intermediate/CA/cacert.pem ~/CA_Intermediate/CA/cacert.pem.ORIG
-  cd ~/CA_Root
-  openssl ca -config ./CA/ssl.cnf -policy policy_anything -extensions v3_ca -no
-text -ss_cert ~/CA_Intermediate/CA/cacert.pem.ORIG -out ~/CA_Intermediate/CA/ca
-cert.pem
-
-   Note that it is required to cd to the ~/CA_Root directory and run the
-   openssl command from there.
-
-   You can print out info about the cert you just modified by:
-  openssl x509 -noout -text -in ~/CA_Intermediate/CA/cacert.pem
-
-   Now we create an x11vnc server cert named "test_chain" that is signed
-   by CA_Intermediate:
-  x11vnc -ssldir ~/CA_Intermediate -sslGenCert server test_chain
-     (follow the prompts)
-
-   You can print out information about this server cert just created via
-   this command:
-  x11vnc -ssldir ~/CA_Intermediate -sslCertInfo SAVE-test_chain
-
-   This will tell you the full path to the server certificate, which is
-   needed because we need to manually append the CA_Intermediate cert for
-   the chain to work:
-  cat ~/CA_Intermediate/CA/cacert.pem >> ~/CA_Intermediate/server-test_chain.pe
-m
-
-   Now we are finally ready to use it. We can run x11vnc using this
-   server cert+key by either this command:
-  x11vnc -ssldir ~/CA_Intermediate -ssl SAVE-test_chain ...
-
-   or this command:
-  x11vnc -ssl ~/CA_Intermediate/server-test_chain.pem ...
-
-   since they are equivalent (both load the same pem file.)
-
-   Finally we connect via VNC viewer that uses CA_Root to verify the
-   server. As before we use ss_vncviewer:
-  ss_vncviewer -verify ~/CA_Root/CA/cacert.pem hostname:0
-
-   Client Certificates (see above) work in a similar manner.
-
-   So although it is a little awkward with the extra steps (e.g.
-   appending the CA_Intermediate cert) it is possible. If you want to do
-   this entirely with openssl(1) you will have to learn the openssl
-   commands corresponding to -genCA and -genCert. You may be able to find
-   guides on the Internet to do this. Starting with x11vnc 0.9.10, you
-   can have it print out the wrapper scripts it uses via: -sslScripts
-   (you will still need to fill in a few pieces of information; ask if it
-   is not clear from the source code.)
-
-     _________________________________________________________________
-
-   More info:
-
-   See also this article for some some general info and examples using
-   stunnel and openssl on Windows with VNC. Also
-   http://www.stunnel.org/faq/certs.html is a very good source of
-   information on SSL certificate creation and management.
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/ssl-portal.html:
-
-
-     _________________________________________________________________
-
-   Using Apache as an SSL Gateway to multiple x11vnc servers inside a
-   firewall:
-
-   Background:
-
-   The typical way to allow access to x11vnc (or any other VNC server)
-   running on multiple workstations inside a firewall is via SSH. The
-   user somewhere out on the Internet logs in to the SSH gateway machine
-   and uses port forwarding (e.g. ssh -t -L 5900:myworkstation:5900
-   user at gateway) to set up the encrypted channel that VNC is then
-   tunneled through. Next he starts up the VNC viewer on the machine
-   where he is sitting directed to the local tunnel port (e.g.
-   localhost:0).
-
-   The SSH scheme is nice because it is a widely used and well tested
-   login technique for users connecting to machines inside their company
-   or home firewall. For VNC access it is a bit awkward, however, because
-   SSH needs to be installed on the Viewer machine and the user usually
-   has to rig up his own port redirection plumbing (however, see our
-   other tool).
-
-   Also, some users have restrictive work environments where SSH and
-   similar applications are prohibited (i.e. only outgoing connections to
-   standard WWW ports from a browser are allowed, perhaps mediated by a
-   proxy server). These users have successfully used the method described
-   here for remote access.
-
-   With the SSL support in x11vnc and the SSL enabled Java VNC viewer
-   applet, a convenient and secure alternative exists that uses the
-   Apache webserver as a gateway. The idea is that the company or home
-   internet connection is already running apache as a web server (either
-   SSL or non-SSL) and we add to it the ability to act as a gateway for
-   SSL VNC connections. The only thing needed on the Viewer side is a
-   Java enabled Web Browser: the user simply enters a URL that starts the
-   entire VNC connection process. No VNC or SSH specific software needs
-   to be installed on the viewer side machine.
-
-   The stunnel VNC viewer stunnel wrapper script provided (ss_vncviewer)
-   can also take advantage of the method described here with its -proxy
-   option.
-
-     _________________________________________________________________
-
-   Simpler Solutions: This apache SSL VNC portal solution may be too much
-   for you. It is mainly intended for automatically redirecting to
-   MULTIPLE workstations inside the firewall. If you only have one or two
-   inside machines that you want to access, the method described here is
-   overly complicated! See below for some simpler (and still non-SSH)
-   encrypted setups.
-
-   Also see the recent (Mar/2010) desktop.cgi x11vnc desktop web login
-   CGI script that achieves much of what the method describes here
-   (especially if its 'port redirection' feature is enabled.)
-     _________________________________________________________________
-
-
-
-   There are numerous ways to achieve this with Apache. We present one of
-   the simplest ones here.
-
-   Important: these sorts of schemes allow incoming connections from
-   anywhere on the Internet to fixed ports on machines inside the
-   firewall. Care must be taken to implement and test thoroughly. If one
-   is paranoid one can (and should) add extra layers of protection. (e.g.
-   extra passwords, packet filtering, SSL certificate verification, etc).
-
-   Also, it is easy to miss the point that unless precautions are taken
-   to verify SSL Certificates, then the VNC Viewer is vulnerable to
-   man-in-the-middle attacks (but not to the more common passive sniffing
-   attacks). Note that there are hacker tools like dsniff/webmitm and
-   cain that implement SSL Man-In-The-Middle attacks. They rely on the
-   client not bothering to check the cert.
-     _________________________________________________________________
-
-   The Holy Grail: a single https port (443)
-
-   Before we discuss the self-contained apache examples here, we want to
-   mention that many x11vnc users who read this page and implement the
-   apache SSL VNC portal ask for something that (so far) seems difficult
-   or impossible to do entirely inside apache:
-     * A single port, 443 (the default https:// port), is open to the
-       Internet
-     * It is HTTPS/SSL encrypted
-     * It handles both VNC traffic and Java VNC Applet downloads.
-     * And the server can also serve normal HTTPS webpages, CGI, etc.
-
-   It is the last item that makes it tricky (otherwise the method
-   described on this page will work). If you are interested in such a
-   solution and are willing to run a separate helper program
-   (connect_switch) look here. Also, see this apache patch.
-     _________________________________________________________________
-
-   Example:
-
-   The scheme described here sets up apache on the firewall/gateway as a
-   regular Web proxy into the intranet and allows connections to a single
-   fixed port on a limited set of machines.
-
-   The configuration described in this section does not use the mod_ssl
-   apache module (the optional configuration described in the section
-   "Downloading the Java applet to the browser via HTTPS" does take
-   advantage of mod_ssl)
-
-   In this example suppose the gateway machine running apache is named
-   "www.gateway.east" (e.g. it may also provide normal web service). We
-   also choose the Internet-facing port for this VNC service to be port
-   563. One could choose any port, including the default HTTP port 80.
-
-   Detail: We choose 563 because it is the rarely used SNEWS port that is
-   often allowed by Web proxies for the CONNECT method. The idea is the
-   user may be coming out of another firewall using a proxy (not the one
-   we describe here, that is, the case when two proxies are involved,
-   e.g. one at work and another Apache (described here) at home
-   redirecting into our firewall; the "double proxy" or "double firewall"
-   problem). Using port 563 simplifies things because CONNECT's to it are
-   usually allowed by default.
-
-   We also assume all of the x11vnc servers on the internal machines are
-   all listening on port 5915 ("-rfbport 5915") instead of the default
-   5900. This is to limit any unintended proxy redirections to a lesser
-   used port, and also to stay out of the way of normal VNC servers on
-   the same machines. One could obviously implement a scheme that handles
-   different ports, but we just discuss this simple setup here.
-
-   So we basically assume x11vnc has been started this way on all of the
-   workstations to be granted VNC access:
-  x11vnc -ssl SAVE -http -display :0 -forever -rfbauth ~/.vnc/passwd -rfbport 5
-915
-
-   i.e. we force SSL VNC connections, port 5915, serve the Java VNC
-   viewer applet, and require a VNC password (another option would be
-   -unixpw). The above command could also be run out of inetd(8). It can
-   also be used to autodetect the user's display and Xauthority data.
-
-
-   These sections are added to the httpd.conf apache configuration file
-   on www.gateway.east:
-
-# In the global section you need to enable these modules.
-# Note that the ORDER MATTERS! mod_rewrite must be before mod_proxy
-# (so that we can check the allowed host list via rewrite)
-#
-LoadModule rewrite_module modules/mod_rewrite.so
-LoadModule proxy_module modules/mod_proxy.so
-LoadModule proxy_connect_module modules/mod_proxy_connect.so
-LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
-LoadModule proxy_http_module modules/mod_proxy_http.so
-<IfDefine SSL>
-LoadModule ssl_module modules/mod_ssl.so
-</IfDefine>
-
-
-# Near the bottom of httpd.conf you put the port 563 virtual host:
-
-Listen 563
-
-<VirtualHost *:563>
-
-   # Allow proxy CONNECT requests *only* to port 5915.
-   # If the machines use different ports, e.g. 5916 list them here as well:
-   #
-   ProxyRequests On
-   AllowCONNECT 5915
-
-   RewriteEngine On
-
-   # Convenience rules to expand applet parameters.  These do not have a traili
-ng "/"
-   #
-   # /vnc   for http jar file downloading:
-   #
-   RewriteRule /vnc/([^/]+)$               /vnc/$1/index.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1 [R,NE,L]
-   RewriteRule /vnc/trust/([^/]+)$         /vnc/$1/index.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1&trustAllVncCerts=yes [R,NE,L]
-   RewriteRule /vnc/proxy/([^/]+)$         /vnc/$1/proxy.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1&forceProxy=yes [R,NE,L]
-   RewriteRule /vnc/trust/proxy/([^/]+)$   /vnc/$1/proxy.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1&forceProxy=yes&trustAllVncCerts=yes [R,NE,L]
-
-   # Read in the allowed host to vnc display mapping file.  It looks like:
-   #
-   #   host1     15
-   #   host2     15
-   #   ...
-   #
-   # the display "15" means 5815 for http applet download, 5915 for SSL vnc.
-   #
-   RewriteMap vnchosts txt:/dist/apache/conf/vnc.hosts
-
-   # Proxy: check for the CONNECT hostname and port being in the vnc.hosts list
-.
-   #
-   RewriteCond %{THE_REQUEST} ^CONNECT [NC]
-   RewriteCond %{REQUEST_URI} ^(.*):(.*)$
-   RewriteCond ${vnchosts:%1|NOTFOUND} NOTFOUND
-   RewriteRule ^.*$ /VNCFAIL [F,L]
-
-   RewriteCond %{THE_REQUEST} ^CONNECT [NC]
-   RewriteCond %{REQUEST_URI} ^(.*):(.*)$
-   RewriteCond 59${vnchosts:%1}=%2 !^(.*)=(\1)$
-   RewriteRule ^.*$ /VNCFAIL [F,L]
-
-
-   # Remap /vnc to the proxy http download (e.g. http://host:5815)
-   #
-   # First, fail if it starts with the string /vnc0:
-   #
-   RewriteRule ^/vnc0.*            /VNCFAIL [F,L]
-   #
-   # Next, map the prefix to /vnc0/host:protocol:port
-   #
-   RewriteRule ^/vnc/([^/]+)/(.*)  /vnc0/$1:http:58${vnchosts:$1|NOTFOUND}/$2
-[NE]
-   #
-   # Drop any not found:
-   #
-   RewriteRule ^/vnc0.*NOTFOUND.*  /VNCFAIL [F,L]
-
-   # Construct the proxy URL and retrieve it:
-   #
-   RewriteRule ^/vnc0/([^/]+):([^/]+):([^/]+)/(.*) $2://$1:$3/$4 [P,NE,L]
-
-</VirtualHost>
-
-   Then restart apache (perhaps: "apachectl stop; apachectl start").
-
-   Note that the listing of allowed internal workstations is done in an
-   external file (/dist/apache/conf/vnc.hosts in the example above), the
-   format is like this:
-# allowed vnc hosts file:
-hostname1  15
-hostname2  15
-...
-
-   You list the hostname and the VNC display (always 15 in our example).
-   Only to these hosts will the external VNC viewers be able to connect
-   to (via the HTTP CONNECT method).
-
-   The above setup requires mod_rewrite and mod_proxy be enabled in the
-   apache web server. In this example they are loaded as modules (and
-   note that mod_rewrite must be listed before mod_proxy);
-
-   The user at the Java enabled Web browser would simply enter this URL
-   into the browser:
-   http://www.gateway.east:563/vnc/host2
-
-   to connect to internal workstation host2, etc.
-
-   Important: do not put a trailing "/" on the URL, since that will
-   defeat the RewriteRules that look for the hostname at the very end.
-
-   There will be a number of SSL certificate, etc, dialogs he will have
-   to respond to in addition to any passwords he is required to provide
-   (this depends on how you set up user authentication for x11vnc).
-
-   If a second Web proxy is involved (i.e. the user's browser is inside
-   another firewall and policy requires using a Web proxy server) then
-   use this URL:
-   http://www.gateway.east:563/vnc/proxy/host2
-
-   This will involve downloading a signed java viewer applet jar file
-   that is able to interact with the internal proxy for the VNC
-   connection. See this FAQ for more info on how this works. Note:
-   sometimes with the Proxy case if you see 'Bad Gateway' error you will
-   have to wait 10 or so seconds and then hit reload. This seems to be
-   due to having to wait for a Connection Keepalive to terminate...
-
-   For completeness, the "trust" cases that skip a VNC certificate dialog
-   (discussed below) would be entered as:
-   http://www.gateway.east:563/vnc/trust/host2
-   http://www.gateway.east:563/vnc/trust/proxy/host2
-
-   You can of course choose shorter or more easy to remember URL formats.
-   Just change the Convenience RewriteRules in httpd.conf.
-
-     _________________________________________________________________
-
-   Port Variations:
-
-   Note that you can run this on the default HTTP port 80 instead of port
-   563. If you do not expect to have a browser connecting from inside a
-   proxying firewall (where sometimes only connections to ports 443 and
-   563 are allowed) this should be fine. Use "80" instead of "563" in the
-   httpd.conf config file (you may need to merge it with other default
-   port 80 things you have there).
-
-   Then the URL's will be a bit simpler:
-   http://www.gateway.east/vnc/host2
-   http://www.gateway.east/vnc/trust/host2
-
-   etc.
-
-   Besides 80 one could use any other random port number (since there are
-   so many port scans on 80, a little obscurity might be useful).
-
-   One option is to use port "443" (the default https:// port) instead of
-   "563". In this case Apache is not configured for mod_ssl; we just
-   happen to use port "443" in the way any random port would be used.
-   This could be handy if the Viewer side environment is restrictive in
-   that it only allows outgoing connections to ports 80 and 443 (and,
-   say, you didn't want to use port 80, or you wanted to use 80 for
-   something else). Another reason for using 443 would be some web proxy
-   environments only allow the CONNECT method to go to port 443 (and not
-   even the case 563 we use above).
-
-     _________________________________________________________________
-
-   Details:
-
-   Let's go through the httpd.conf additions in detail from the top.
-
-   The LoadModules directives load the necessary apache modules. Note
-   that mod_rewrite must be listed first. If you are compiling from
-   scratch something like this worked for us:
-  ./configure --enable-proxy=shared --enable-proxy-connect=shared --enable-ssl=
-shared --enable-rewrite=shared --prefix=/dist/apache
-
-   Then the VirtualHost *:563 virtual host section starts.
-
-   The "ProxyRequests On" and "AllowCONNECT 5915" enable the web server
-   to forward proxy requests to port 5915 (and only this port) INSIDE the
-   firewall. Think about the implications of this thoroughly and test it
-   carefully.
-
-   The RewriteRule's are for convenience only so that the URL entered
-   into the Web browser does not need the various extra parameters, e.g.:
-   http://www.gateway.east:563/vnc/host2/index.vnc?CONNECT=host2+5915&PORT=563,
-blah,blah...
-
-   (or otherwise make direct edits to index.vnc to set these parameters).
-   The forceProxy=yes parameter is passed to the applet to force the use
-   of a outgoing proxy socket connection. Use it only if the Web browser
-   is inside a separate Web proxying environment (i.e. large corporation)
-
-   The rewrites with parameter urlPrefix are described under Tricks for
-   Better Response. The "trust" ones (also described under Tricks) with
-   trustAllVncCerts tell the Java VNC applet to skip a dialog asking
-   about the VNC Certificate. They are a bit faster and more reliable
-   than the original method. In the best situation they lead to being
-   logged in 20 seconds or less (without them the time to login can be
-   much longer since a number of connections must timeout).
-
-   All of the x11vnc Java Viewer applet parameters are described in the
-   file classes/ssl/README
-
-   The external file /dist/apache/conf/vnc.hosts containing the allowed
-   VNC server hostnames is read in. Its 2nd column contains the VNC
-   display of the host (always 15 in our example; if you make it vary you
-   will need to adjust some lines in the httpd.conf accordingly, e.g.
-   AllowCONNECT). This list is used to constrain both the Jar file
-   download URL and the proxy CONNECT the VNC viewer makes to only the
-   intended VNC servers.
-
-   Limiting the proxy CONNECT is done with the two sets of RewriteCond
-   conditions.
-
-   Limiting the Jar file download URL is done in the remaining 4
-   RewriteRule's.
-
-   Note that these index.vnc and VncViewer.jar downloads to the browser
-   are not encrypted via SSL, and so in principle could be tampered with
-   by a really bad guy. The subsequent VNC connection, however, is
-   encrypted through a single SSL connection (it makes a CONNECT straight
-   to x11vnc). See below for how to have these initial downloads
-   encrypted as well (if the apache web server has SSL/mod_ssl, i.e.
-   https, enabled and configured).
-
-   Unfortunately the Java VNC viewer applet currently is not able to save
-   its own list of Certificates (e.g. the user says trust this VNC
-   certificate 'always'). This is because an applet it cannot open local
-   files, etc. Sadly, the applet cannot even remember certificates in the
-   same browser session because it is completely reinitialized for each
-   connection (see below).
-
-     _________________________________________________________________
-
-   Too Much?
-
-   If these apache rules are a little too much for you, there is a little
-   bit simpler scheme where you have to list each of the individual
-   machines in the httpd.conf and ssl.conf files. It may be a little more
-   typing to maintain, but perhaps being more straight forward (less
-   RewriteRule's) is desirable.
-
-     _________________________________________________________________
-
-   Problems?
-
-   To see example x11vnc output for a successful https://host:5900/
-   connection with the Java Applet see This Page.
-
-     _________________________________________________________________
-
-   Some Ideas for adding extra authentication, etc. for the paranoid:
-     * VNC passwords: -rfbauth, -passwdfile, or -usepw. Even adding a
-       simple company-wide VNC password helps block unwanted access.
-     * Unix passwords: -unixpw
-     * SSL Client certificates: -sslverify
-     * Apache AuthUserFile directive: .htaccess, etc.
-     * Filter connections based on IP address or hostname.
-     * Use Port-knocking on your firewall as described in: Enhanced
-       TightVNC Viewer (ssvnc).
-     * Add proxy password authentication (requires Viewer changes?)
-     * Run a separate instance of Apache that provides this VNC service
-       so it can be brought up and down independently of the normal web
-       server.
-     * How secure is the Client side? Public machines in internet cafes,
-       etc, are often hacked, with backdoors and VNC servers of their
-       own. Prefer using your own firewalled laptop to a public machine.
-
-
-     _________________________________________________________________
-
-   Using non-Java viewers with this scheme:
-
-   The ss_vncviewer stunnel wrapper script for VNC viewers has the -proxy
-   option that can take advantage of this method.
-   ss_vncviewer -proxy www.gateway.east:563   host1:15
-
-   For the case of the "double proxy" situation (see below) supply both
-   separated by a comma.
-   ss_vncviewer -proxy proxy1.foobar.com:8080,www.gateway.east:563   host1:15
-
-   For the Enhanced TightVNC Viewer (ssvnc) GUI (it uses ss_vncviewer on
-   Unix) put 'host1:15' into the 'VNC Server' entry box, and here are
-   possible Proxy/Gateway entries
-   Proxy/Gateway:   www.gateway.east:563
-   Proxy/Gateway:   proxy1.foobar.com:8080,www.gateway.east:563
-
-   then click on the 'Connect' button.
-
-     _________________________________________________________________
-
-   Downloading the Java applet to the browser via HTTPS:
-
-   To have the Java applet downloaded to the user's Web Browser via an
-   encrypted (and evidently safer) SSL connection the Apache webserver
-   should be configured for SSL via mod_ssl.
-
-   It is actually possible to use the x11vnc Key Management utility
-   "-sslGenCert" to generate your Apache/SSL .crt and .key files. (In
-   brief, run something like "x11vnc -sslGenCert server self:apache" then
-   copy the resulting self:apache.crt file to conf/ssl.crt/server.crt and
-   extract the private key part from self:apache.pem and paste it into
-   conf/ssl.key/server.key). Setting the env var REQ_ARGS='-days 1095'
-   before running x11vnc will bump up the expiration date (3 years in
-   this case).
-
-   Or you can use the standard methods described in the Apache mod_ssl
-   documentation to create your keys. Then restart Apache, usually
-   something like "apachectl stop" followed by "apachectl startssl"
-
-   In addition to the above sections in httpd.conf one should add the
-   following to ssl.conf:
-   SSLProxyEngine  On
-
-   RewriteEngine On
-
-   # Convenience rules to expand applet parameters.  These do not have a traili
-ng "/"
-   #
-   # /vnc   http jar file downloading:
-   #
-   RewriteRule /vnc/([^/]+)$                        /vnc/$1/index.vnc?CONNECT=$
-1+5915&PORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vnc_2F_$1 [R,NE,L]
-   RewriteRule /vnc/proxy/([^/]+)$                  /vnc/$1/proxy.vnc?CONNECT=$
-1+5915&PORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vnc_2F_$1&forceProxy=yes [R,N
-E,L]
-   #
-   # (we skipped the "trust" ones above, put them in if you like)
-   #
-   # /vncs  https jar file downloading:
-   #
-   RewriteRule /vncs/([^/]+)$                      /vncs/$1/index.vnc?CONNECT=$
-1+5915&PORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1 [R,NE,L]
-   RewriteRule /vncs/proxy/([^/]+)$                /vncs/$1/proxy.vnc?CONNECT=$
-1+5915&PORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&forceProxy=yes [R,
-NE,l]
-   RewriteRule /vncs/trust/([^/]+)$                /vncs/$1/index.vnc?CONNECT=$
-1+5915&PORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&trustAllVncCerts=y
-es [R,NE,L]
-   RewriteRule /vncs/trust/proxy/([^/]+)$          /vncs/$1/proxy.vnc?CONNECT=$
-1+5915&PORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&forceProxy=yes&tru
-stAllVncCerts=yes [R,NE,L]
-
-   # Convenience rules used for the connect_switch helper (requires Listen 127.
-0.0.1:443 above):
-   #
-   RewriteRule /vnc443/([^/]+)$                    /vncs/$1/index.vnc?CONNECT=$
-1+5915&PORT=443&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1 [R,NE,L]
-   RewriteRule /vnc443/proxy/([^/]+)$              /vncs/$1/proxy.vnc?CONNECT=$
-1+5915&PORT=443&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&forceProxy=yes [R,
-NE,L]
-   RewriteRule /vnc443/trust/([^/]+)$              /vncs/$1/index.vnc?CONNECT=$
-1+5915&PORT=443&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&trustAllVncCerts=y
-es [R,NE,L]
-   RewriteRule /vnc443/trust/proxy/([^/]+)$        /vncs/$1/proxy.vnc?CONNECT=$
-1+5915&PORT=443&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&forceProxy=yes&tru
-stAllVncCerts=yes [R,NE,L]
-
-   # Read in the allowed host to vnc display mapping file.  It looks like:
-   #
-   #   host1     15
-   #   host2     15
-   #   ...
-   #
-   # the display "15" means 5915 for SSL VNC and 5815 for http applet download.
-   #
-   RewriteMap vnchosts txt:/dist/apache/conf/vnc.hosts
-
-
-   # Remap /vnc and /vncs to the proxy http download (e.g. https://host:5915)
-   #
-   # First, fail if it starts with the string /vnc0:
-   #
-   RewriteRule ^/vnc0.*            /VNCFAIL [F,L]
-   #
-   # Next, map the prefix to /vnc0:host:protocol:port
-   #
-   RewriteRule ^/vnc/([^/]+)/(.*)  /vnc0/$1:http:58${vnchosts:$1|NOTFOUND}/$2
-[NE]
-   RewriteRule ^/vncs/([^/]+)/(.*) /vnc0/$1:https:59${vnchosts:$1|NOTFOUND}/$2
-[NE]
-   #
-   # Drop any not found:
-   #
-   RewriteRule ^/vnc0.*NOTFOUND.*  /VNCFAIL [F,L]
-
-   # Construct the proxy URL and retrieve it:
-   #
-   RewriteRule ^/vnc0/([^/]+):([^/]+):([^/]+)/(.*) $2://$1:$3/$4 [P,NE,L]
-
-   This is all in the "<VirtualHost _default_:443>" section of ssl.conf.
-
-   The user could then point the Web Browser to:
-   https://www.gateway.east/vnc/host2
-
-   or
-   https://www.gateway.east/vnc/proxy/host2
-
-   for the "double proxy" case. (Important: do not put a trailing "/" on
-   the URL, since that will defeat the RewriteRules.)
-
-   As with the httpd.conf case, the external file
-   (/dist/apache/conf/vnc.hosts in the above example) contains the
-   hostnames of the allowed VNC servers.
-
-   Note that inside the firewall the Java applet download traffic is not
-   encrypted (only over the Internet is SSL used) for these cases:
-   https://www.gateway.east/vnc/host2
-   https://www.gateway.east/vnc/proxy/host2
-
-   However for the special "vncs" rules above:
-   https://www.gateway.east/vncs/host2
-
-   the Java applet download is encrypted via SSL for both legs. Note that
-   the two legs are two separate SSL sessions. So the data is decrypted
-   inside an apache process and reencrypted by the apache process for the
-   2nd SSL session inside the same apache process (a very small gap one
-   might overlook).
-
-   The "vncs/trust" ones are like the "trust" ones described earlier
-   https://www.gateway.east/vncs/trust/mach2
-
-   and similarly for the httpsPort ones. See Tricks for Better Response.
-
-   In all of the above cases the VNC traffic from Viewer to x11vnc is
-   encrypted end-to-end in a single SSL session, even for the "double
-   proxy" case because the CONNECT method is used (there are actually two
-   CONNECT's for the "double proxy" case). This part (the VNC traffic) is
-   the most important part to have encrypted.
-
-   Note that the Certificate dialogs the user has in his web browser will
-   be for the Apache Certificate, while for the Java applet it will be
-   the x11vnc certificate.
-
-   Note also that you can have Apache serve up the Jar file VncViewer.jar
-   and/or index.vnc/proxy.vnc instead of each x11vnc if you want to.
-
-   The rules in ssl.conf are similar to the ones in httpd.conf and so are
-   not discussed in detail. The only really new thing is the /vncs
-   handling to download the applet jar via HTTPS on port 5915.
-
-   The special entries "/vnc443" are only used for the special helper
-   program (connect_switch) for the https port 443 only mode discussed
-   here.
-
-     _________________________________________________________________
-
-   INETD automation:
-
-   The "single-port" (i.e. 5915) HTTPS applet download and VNC connection
-   aspect shown here is convenient and also enables having x11vnc run out
-   of inetd. That way x11vnc is run on demand instead of being run all
-   the time (the user does not have to remember to start it). The first
-   connections to inetd download index.vnc and the Jar file (via https)
-   and the the last connection to inetd establishes the SSL VNC
-   connection. Since x11vnc is restarted for each connection, this will
-   be a bit slower than the normal process.
-
-   For example, the /etc/inetd.conf line could be:
-  5915 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc_ssl.sh
-
-   where the script x11vnc_ssl.sh looks something like this:
-#!/bin/sh
-
-/usr/local/bin/x11vnc -inetd -oa /var/log/x11vnc-15.log \
-        -ssl SAVE -http -unixpw -localhost \
-        -display :0 -auth /home/THE_USER/.Xauthority
-
-   where, as usual, the inetd launching needs to know which user is
-   typically using the display on that machine. One could imagine giving
-   different users different ports, 5915, 5916, etc. to distinguish (then
-   the script would need to be passed the username). mod_rewrite could be
-   used to automatically map username in the URL to his port number.
-
-   A better way is to use the "-display WAIT:cmd=FINDDISPLAY" feature to
-   autodetect the user and Xauthority data:
-#!/bin/sh
-
-/usr/local/bin/x11vnc -inetd -oa /var/log/x11vnc-15.log \
-        -ssl SAVE -http -unixpw -localhost -users unixpw= \
-        -find
-
-   (we have used the alias -find for "-display WAIT:cmd=FINDDISPLAY".)
-   This way the user must supply his Unix username and password and then
-   his display and Xauthority data on that machine will be located and
-   returned to x11vnc to allow it to attach. If he doesn't have a display
-   running on that machine or he fails to log in correctly, the
-   connection will be dropped.
-
-   The variant "-display WAIT:cmd=FINDCREATEDISPLAY" (aliased by
-   "-create") will actually create a (virtual or real) X server session
-   for the user if one doesn't already exist. See here for details.
-
-   To enable inetd operation for the non-HTTPS Java viewer download (port
-   5815 in the above httpd.conf example) you will need to run x11vnc in
-   HTTPONCE mode on port 5815: For example, the /etc/inetd.conf line
-   could be:
-  5815 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc \
-       -inetd -prog /usr/local/bin/x11vnc -oa /var/log/x11vnc-15.log \
-       -http_ssl -display WAIT:cmd=HTTPONCE
-
-   where the long inetd.conf line has been split. Note how the -http_ssl
-   tries to automatically find the .../classes/ssl subdirectory. This
-   requires the -prog option available in x11vnc 0.8.4 (a shell script
-   wrapper, e.g. /usr/local/bin/x11vnc_http.sh can be used to work around
-   this).
-
-   Also note the use of "-ssl SAVE" above. This way a saved server.pem is
-   used for each inetd invocation (rather generating a new one each time
-   as happens for "-ssl TMP"). Note that it cannot have a protecting
-   passphrase because inetd will not be able to supply it.
-
-   Another option is:
-  5815 stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/x11vnc \
-       -inetd -httpdir /usr/local/share/x11vnc/classes/ssl \
-       -oa /var/log/x11vnc-15.log -display WAIT:cmd=HTTPONCE
-
-   (this also requires a feature found in x11vnc 0.8.4).
-     _________________________________________________________________
-
-   Other Ideas:
-
-   - The above schemes work, but they are a bit complicated with all of
-   the rigging. There should be more elegant ways to configure Apache to
-   do these, but we have not found them (please let us know if you
-   discover something nice). However, once this scheme has been set up
-   and is working it is easy to maintain and add/delete workstations,
-   etc.
-
-   - In general Apache is not required, but it makes things convenient.
-   The firewall itself could do the port redirection via its firewall
-   rules. Evidently different Internet-facing ports would be required for
-   each workstation. This could be set up using iptables rules for
-   example. If there were just one or two machines this would be the
-   easiest method. For example:
-  iptables -t nat -A PREROUTING -p tcp -d 24.35.46.57 --dport 5901 -j DNAT --to
--destination 192.168.1.2:5915
-  iptables -t nat -A PREROUTING -p tcp -d 24.35.46.57 --dport 5902 -j DNAT --to
--destination 192.168.1.3:5915
-
-   Where 24.35.46.57 is the internet IP address of the gateway. In this
-   example 24.35.46.57:5901 is redirected to the internal machine
-   192.168.1.2:5915 and 24.35.46.57:5902 is redirected to another
-   internal machine 192.168.1.3:5915, both running x11vnc -ssl ... in SSL
-   mode. For this example, the user would point the web browser to, e.g.:
-  https://24.35.46.57:5901/?PORT=5901
-
-   or using the stunnel wrapper script:
-  ss_vncviewer 24.35.46.57:1
-
-   One can achieve similar things with dedicated firewall/routers (e.g.
-   Linksys) using the device's web or other interface to configure the
-   firewall.
-
-   If the user may be coming out of a firewall using a proxy it may be
-   better to redirect ports 443 and 563 (instead of 5901 and 5902) to the
-   internal machines so that the user's proxy will allow CONNECTing to
-   them.
-
-   - The redirection could also be done at the application level using a
-   TCP redirect program (e.g. ip_relay or fancier ones). Evidently more
-   careful internal hostname checking, etc., could be performed by the
-   special purpose application to add security. See connect_switch which
-   is somewhat related.
-
-   - One might imagine the ProxyPass could be done for the VNC traffic as
-   well (for the ssl.conf case) to avoid the CONNECT proxying completely
-   (which would be nice to avoid). Unfortunately we were not able to get
-   this to work. Since HTTP is a request-response protocol (as opposed to
-   a full bidirectional link required by VNC that CONNECT provides) this
-   makes it difficult to do. It may be possible, but we haven't found out
-   how yet.
-
-   All of the x11vnc Java Viewer applet parameters are described in the
-   file classes/ssl/README
-
-     _________________________________________________________________
-
-   Tricks for Better Response and reliability:
-
-   The "original scheme" using httpd.conf and ssl.conf rewrites without
-   urlPrefix and trustAllVncCerts above should work OK, but may lead to
-   slow and/or unreliable loading of the applet and final connection to
-   x11vnc. The following are what I do now to get better response and
-   reliability. YMMV.
-
-   The problem with the "original scheme" is that there is a point where
-   the VNC Viewer applet can try up to 3 times to retrieve the x11vnc
-   certificate, since it needs to get it to show it to you and ask you if
-   you accept it. This can add about 45 seconds to the whole process
-   (which takes 1 to 1.5 minutes with all the dialogs) since a couple of
-   those connections must time out. The "trust" items in the config add a
-   parameter trustAllVncCerts=yes similar to the forceProxy=yes
-   parameter. This can cut the total time to the VNC password prompt down
-   to 15 seconds which is pretty good. (Note by ignoring the certificate
-   this does not protect against man-in-the-middle attacks which are
-   rare, but maybe the won't be so rare in the future... see
-   dsniff/webmitm and cain)
-
-   First make sure the x11vnc SSL certificate+key is the same as
-   Apache's. (otherwise you may get one extra dialog and/or one extra
-   connection that has to time out).
-
-   The following RewriteRule's are the same now advocated in the
-   instructions above.
-
-   The httpsPort and urlPrefix= parameters give hints to the applet to
-   improve connecting: This is what goes in httpd.conf:
-   RewriteEngine On
-   RewriteRule /vnc/([^/]+)$               /vnc/$1/index.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1 [R,NE]
-   RewriteRule /vnc/trust/([^/]+)$         /vnc/$1/index.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1&trustAllVncCerts=yes [R,NE]
-   RewriteRule /vnc/proxy/([^/]+)$         /vnc/$1/proxy.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1&forceProxy=yes [R,NE]
-   RewriteRule /vnc/trust/proxy/([^/]+)$   /vnc/$1/proxy.vnc?CONNECT=$1+5915&PO
-RT=563&urlPrefix=_2F_vnc_2F_$1&forceProxy=yes&trustAllVncCerts=yes [R,NE]
-
-   The httpsPort and urlPrefix provide useful hints to the VNC Viewer
-   applet when it connects to x11vnc to glean information about Proxies,
-   certificates, etc.
-
-   This is what goes into ssl.conf:
-   RewriteEngine On
-   RewriteRule /vnc/([^/]+)$                /vnc/$1/index.vnc?CONNECT=$1+5915&P
-ORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vnc_2F_$1 [R,NE]
-   RewriteRule /vnc/proxy/([^/]+)$          /vnc/$1/proxy.vnc?CONNECT=$1+5915&P
-ORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vnc_2F_$1&forceProxy=yes [R,NE]
-   RewriteRule /vncs/([^/]+)$              /vncs/$1/index.vnc?CONNECT=$1+5915&P
-ORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1 [R,NE]
-   RewriteRule /vncs/proxy/([^/]+)$        /vncs/$1/proxy.vnc?CONNECT=$1+5915&P
-ORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&forceProxy=yes [R,NE]
-   RewriteRule /vncs/trust/([^/]+)$        /vncs/$1/index.vnc?CONNECT=$1+5915&P
-ORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&trustAllVncCerts=yes [R,NE
-]
-   RewriteRule /vncs/trust/proxy/([^/]+)$  /vncs/$1/proxy.vnc?CONNECT=$1+5915&P
-ORT=563&httpsPort=443&GET=1&urlPrefix=_2F_vncs_2F_$1&forceProxy=yes&trustAllVnc
-Certs=yes [R,NE]
-
-   The rest is the same.
-
-   The httpsPort and urlPrefix and GET provide useful hints to the VNC
-   Viewer applet when it connects to x11vnc to glean information about
-   Proxies, certificates, etc, and also for the ultimate VNC connection
-   (GET speeds this up by sending a special HTTP GET to cause x11vnc to
-   immediately switch to the VNC protocol).
-
-   To turn these into URLs, as was done above, take the string in the
-   RewriteRule, e.g. /vncs and turn it into
-   https://gateway/vncs/machinename Similarly for non-https:
-   http://gateway:563/vnc/machinename
-
-   If you use the 'trust' ones, you are performing NO checks, visual or
-   otherwise, on the VNC SSL certificate. It is trusted without question.
-   This speeds things up because it avoids a dialog about certificates,
-   but of course has some risk WRT Man in the Middle attacks. I don't
-   recommend them. It is better to use /vnc or /vncs and the first time
-   you connect carefully check the Certificate and then tell your Browser
-   and Java Virtual Machine to trust the certificate 'Always'. Then if
-   you later get an unexpected dialog, you know something is wrong.
-   Nearly always it is just a changed or expired certificate, but better
-   safe than sorry...
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/enhanced_tightvnc_viewer.html:
-
-
-     _________________________________________________________________
-
-Enhanced TightVNC Viewer   (SSVNC:   SSL/SSH VNC viewer)
-
-   (To Downloads)  (To Quick Start)
-
-   [ssvnc.gif] [ssvnc_windows.gif] [ssvnc_macosx.gif] . .
-
-
-   The Enhanced TightVNC Viewer, SSVNC, adds encryption security to VNC
-   connections.
-
-   The package provides a GUI for Windows, Mac OS X, and Unix that
-   automatically starts up an STUNNEL SSL tunnel for SSL or ssh/plink for
-   SSH connections to any VNC server, such as x11vnc, and then launches
-   the VNC Viewer to use the encrypted tunnel.
-
-   The x11vnc server has built-in SSL support, however SSVNC can make SSL
-   encrypted VNC connections to any VNC Server if they are running an SSL
-   tunnel, such as STUNNEL or socat, at their end. SSVNC's SSH tunnel
-   will work to any VNC Server host running sshd that you can log into.
-
-   The Enhanced TightVNC Viewer package started as a project to add some
-   patches to the long neglected Unix TightVNC Viewer. However, now the
-   front-end GUI, encryption, and wrapper scripts features possibly
-   outweigh the Unix TightVNC Viewer improvements (see the lists below to
-   compare).
-
-   The SSVNC Unix vncviewer can also be run without the SSVNC encryption
-   GUI as an enhanced replacement for the xvncviewer, xtightvncviewer,
-   etc., viewers.
-
-   In addition to normal SSL, SSVNC also supports the VeNCrypt SSL/TLS
-   and Vino/ANONTLS encryption extensions to VNC on Unix, Mac OS X, and
-   Windows. Via the provided SSVNC VeNCrypt bridge, VeNCrypt and ANONTLS
-   encryption also works with any third party VNC Viewer (e.g. RealVNC,
-   TightVNC, UltraVNC, etc...) you select via 'Change VNC Viewer'.
-
-   The short name for this project is "ssvnc" for SSL/SSH VNC Viewer.
-   This is the name of the command to start it.
-
-   There is a simplified SSH-Only mode (sshvnc). And an even more
-   simplified Terminal-Services mode (tsvnc) for use with x11vnc on the
-   remote side.
-
-   The tool has many additional features; see the descriptions below.
-
-   It is a self-contained bundle, you could carry it around on, say, a
-   USB memory stick / flash drive for secure VNC viewing from almost any
-   machine, Unix, Mac OS X, and Windows (and if you create a directory
-   named "Home" in the toplevel ssvnc directory on the drive your VNC
-   profiles and certs will be kept there as well). For Unix, there is
-   also a conventional source tarball to build and install in the normal
-   way and not use a pre-built bundle.
-
-     _________________________________________________________________
-
-    Announcements:
-
-   Important: If you created any SSL certificates with SSVNC (or anything
-   else) on a Debian or Ubuntu system from Sept. 2006 through May 2008,
-   then those keys are likely extremely weak and can be easily cracked.
-   The certificate files should be deleted and recreated on a non-Debian
-   system or an updated one. See
-   http://www.debian.org/security/2008/dsa-1571 for details. The same
-   applies to SSH keys.
-
-   Please read this information on using SSVNC on workstations with
-   Untrusted Local Users.
-
-     _________________________________________________________________
-
-    Feature List:
-
-   Wrapper scripts and a tcl/tk GUI were written to create these features
-   for Unix, Mac OS X, and Windows:
-     * SSL support for connections using the bundled stunnel program.
-     * Automatic SSH connections from the GUI (system ssh is used on Unix
-       and MacOS X; bundled plink is used on Windows)
-     * Ability to Save and Load VNC profiles for different hosts.
-     * You can also use your own VNC Viewer, e.g. UltraVNC or RealVNC,
-       with the SSVNC encryption GUI front-end if you prefer.
-     * Create or Import SSL Certificates and Private Keys.
-     * Reverse (viewer listening) VNC connections via SSL and SSH.
-     * VeNCrypt SSL/TLS VNC encryption support (used by VeNCrypt, QEMU,
-       ggi, libvirt/virt-manager/xen, vinagre/gvncviewer/gtk-vnc)
-     * ANONTLS SSL/TLS VNC encryption support (used by Vino)
-     * VeNCrypt and ANONTLS are also enabled for any 3rd party VNC Viewer
-       (e.g. RealVNC, TightVNC, UltraVNC ...) on Unix, MacOSX, and
-       Windows via the provided SSVNC VeNCrypt Viewer Bridge tool (use
-       'Change VNC Viewer' to select the one you want.)
-     * Support for Web Proxies, SOCKS Proxies, and the UltraVNC repeater
-       proxy (e.g. repeater://host:port+ID:1234). Multiple proxies may be
-       chained together (3 max).
-     * Support for SSH Gateway connections and non-standard SSH ports.
-     * Automatic Service tunnelling via SSH for CUPS and SMB Printing,
-       ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting.
-     * Sets up any additional SSH port redirections that you want.
-     * Zeroconf (aka Bonjour) is used on Unix and Mac OS X to find VNC
-       servers on your local network if the avahi-browse or dns-sd
-       program is available and in your PATH.
-     * Port Knocking for "closed port" SSH/SSL connections. In addition
-       to a simple fixed port sequence and one-time-pad implementation, a
-       hook is also provided to run any port knocking client before
-       connecting.
-     * Support for native MacOS X usage with bundled Chicken of the VNC
-       viewer (the Unix X11 viewer is also provided for MacOS X, and is
-       better IMHO. It is now the default on MacOS X.)
-     * Dynamic VNC Server Port determination and redirection (using ssh's
-       builtin SOCKS proxy, ssh -D) for servers like x11vnc that print
-       out PORT= at startup.
-     * Unix Username and Password entry for use with "x11vnc -unixpw"
-       type login dialogs.
-     * Simplified mode launched by command "sshvnc" that is SSH Only.
-     * Simplified mode launched by command "tsvnc" that provides a VNC
-       "Terminal Services" mode (uses x11vnc on the remote side).
-     * IPv6 support for all connection modes on Unix, MacOSX, and
-       Windows.
-
-   Patches to TightVNC 1.3.9 vnc_unixsrc tree were created for Unix
-   TightVNC Viewer improvements (these only apply to the Unix VNC viewer,
-   including MacOSX XQuartz):
-     * rfbNewFBSize VNC support (dynamic screen resizing)
-     * Client-side Scaling of the Desktop in the viewer.
-     * ZRLE VNC encoding support (RealVNC's encoding)
-     * Support for the ZYWRLE encoding, a wavelet based extension to ZRLE
-       to improve compression of motion video and photo regions.
-     * TurboVNC support (VirtualGL's modified TightVNC encoding; requires
-       TurboJPEG library)
-     * Pipelined Updates of the framebuffer as in TurboVNC (asks for the
-       next update before the current one has finished downloading; this
-       gives some speedup on high latency connections.)
-     * Cursor alphablending with x11vnc at 32bpp (-alpha option)
-     * Option "-unixpw ..." for use with "x11vnc -unixpw" type login
-       dialogs.
-     * Support for UltraVNC extensions: 1/n Server side scaling, Text
-       Chat, Single Window, Disable Server-side Input. Both UltraVNC and
-       x11vnc servers support these extensions.
-     * UltraVNC File Transfer via an auxiliary Java helper program (java
-       must be in $PATH). Note that the x11vnc server also supports
-       UltraVNC file transfer.
-     * Connection support for the UltraVNC repeater proxy (-repeater
-       option).
-     * Support for UltraVNC Single Click operation. (both unencrypted: SC
-       I, and SSL encrypted: SC III)
-     * Support for UltraVNC DSM Encryption Plugin symmetric encryption
-       mode. (ARC4, AESV2, MSRC4, and SecureVNC)
-     * Support for UltraVNC MS-Logon authentication (NOTE: the UltraVNC
-       MS-Logon key exchange implementation is very weak; an eavesdropper
-       on the network can recover your Windows password easily in a few
-       seconds; you need to use an additional encrypted tunnel with
-       MS-Logon.)
-     * Support for symmetric encryption (including blowfish and 3des
-       ciphers) to Non-UltraVNC Servers. Any server using the same
-       encryption method will work, e.g.:  x11vnc -enc blowfish:./my.key
-     * Instead of hostname:display one can also supply "exec=command
-       args..." to connect the viewer to the stdio of an external command
-       (e.g. stunnel or socat) rather than using a TCP/IP socket. Unix
-       domain sockets, e.g. /path/to/unix/socket, and a previously opened
-       file descriptor fd=0, work too.
-     * Local Port Protections for STUNNEL and SSH: avoid having for long
-       periods of time a listening port on the the local (VNC viewer)
-       side that redirects to the remote side.
-     * Reverse (viewer listening) VNC connections can show a Popup dialog
-       asking whether to accept the connection or not (-acceptpopup.) The
-       extra info provided by UltraVNC Single Click reverse connections
-       is also supported (-acceptpopupsc)
-     * Extremely low color modes: 64 and 8 colors in 8bpp
-       (-use64/-bgr222, -use8/-bgr111)
-     * Medium color mode: 16bpp mode on a 32bpp Viewer display
-       (-16bpp/-bgr565)
-     * For use with x11vnc's client-side caching -ncache method use the
-       cropping option -ycrop n. This will "hide" the large pixel buffer
-       cache below the actual display. Set to the actual height or use -1
-       for autodetection (also, tall screens, H > 2*W, are autodetected
-       by default).
-     * Escape Keys: specify a set of modifier keys so that when they are
-       all pressed down you can invoke Popup menu actions via keystrokes.
-       I.e., a set of 'Hot Keys'. One can also pan (move) the desktop
-       inside the viewport via Arrow keys or a mouse drag.
-     * Scrollbar width setting: -sbwidth n, the default is very thin, 2
-       pixels, for less distracting -ycrop usage.
-     * Selection text sending and receiving can be fine-tuned with the
-       -sendclipboard, -sendalways, and -recvtext options.
-     * TightVNC compression and quality levels are automatically set
-       based on observed network latency (n.b. not bandwidth.)
-     * Improvements to the Popup menu, all of these can now be changed
-       dynamically via the menu: ViewOnly, Toggle Bell, CursorShape
-       updates, X11 Cursor, Cursor Alphablending, Toggle Tight/ZRLE,
-       Toggle JPEG, FullColor/16bpp/8bpp (256/64/8 colors), Greyscale for
-       low color modes, Scaling the Viewer resolution, Escape Keys,
-       Pipeline Updates, and others, including UltraVNC extensions.
-     * Maintains its own BackingStore if the X server does not.
-     * The default for localhost:0 connections is not raw encoding since
-       same-machine connections are pretty rare. Default assumes you are
-       using a SSL or SSH tunnel. Use -rawlocal to revert.
-     * XGrabServer support for fullscreen mode, for old window managers
-       (-grab/-graball option).
-     * Fix for Popup menu positioning for old window managers (-popupfix
-       option).
-     * The VNC Viewer ssvncviewer supports IPv6 natively (no helpers
-       needed.)
-
-   The list of 3rd party software bundled in the archive files:
-     * TightVNC Viewer  (windows, unix, macosx)
-     * Chicken of the VNC Viewer  (macosx)
-     * Stunnel  (windows, unix, macosx)
-     * Putty/Plink/Pageant  (windows)
-     * OpenSSL  (windows)
-     * esound  (windows)
-
-   These are all self-contained in the bundle directory: they will not be
-   installed on your system. Just un-zip or un-tar the file you
-   downloaded and run the frontend ssvnc straight from its directory.
-   Alternatively, on Unix you can use the conventional source tarball.
-
-     _________________________________________________________________
-
-   Here is the Quick Start info from the README for how to setup and use
-   SSVNC:
-Quick Start:
------------
-
-Unix and Mac OS X:
-
-    Inside a Terminal do something like the following.
-
-    Unpack the archive:
-
-        % gzip -dc ssvnc-1.0.29.tar.gz | tar xvf -
-
-    Run the GUI:
-
-        % ./ssvnc/Unix/ssvnc               (for Unix)
-
-        % ./ssvnc/MacOSX/ssvnc             (for Mac OS X)
-
-    The smaller file "ssvnc_no_windows-1.0.29.tar.gz"
-    could have been used as well.
-
-    On MacOSX you could also click on the SSVNC app icon in the Finder.
-
-    On MacOSX if you don't like the Chicken of the VNC (e.g. no local
-    cursors, no screen size rescaling, and no password prompting), and you
-    have the XDarwin X server installed, you can set DISPLAY before starting
-    ssvnc (or type DISPLAY=... in Host:Disp and hit Return).  Then our
-    enhanced TightVNC viewer will be used instead of COTVNC.
-    Update: there is now a 'Use X11 vncviewer on MacOSX' under Options ...
-
-
-    If you want a SSH-only tool (without the distractions of SSL) run
-    the command:
-
-                sshvnc
-
-    instead of "ssvnc".  Or click "SSH-Only Mode" under Options.
-    Control-h will toggle between the two modes.
-
-
-    If you want a simple VNC Terminal Services only mode (requires x11vnc
-    on the remote server) run the command:
-
-                tsvnc
-
-    instead of "ssvnc".  Or click "Terminal Services" under Options.
-    Control-t will toggle between the two modes.
-
-    "tsvnc profile-name" and "tsvnc user at hostname" work too.
-
-
-Unix/MacOSX Install:
-
-    There is no standard install for the bundles, but you can make
-    symlinks like so:
-
-        cd /a/directory/in/PATH
-        ln -s /path/to/ssvnc/bin/{s,t}* .
-
-    Or put /path/to/ssvnc/bin, /path/to/ssvnc/Unix, or /path/to/ssvnc/MacOSX
-    in your PATH.
-
-    For the conventional source tarball it will compile and install, e.g.:
-
-       gzip -dc ssvnc-1.0.29.src.tar.gz | tar xvf -
-       cd ssvnc-1.0.29
-       make config
-       make all
-       make PREFIX=/my/install/dir install
-
-    then have /my/install/dir/bin in your PATH.
-
-
-
-Windows:
-
-    Unzip, using WinZip or a similar utility, the zip file:
-
-        ssvnc-1.0.29.zip
-
-    Run the GUI, e.g.:
-
-        Start -> Run -> Browse
-
-    and then navigate to
-
-        .../ssvnc/Windows/ssvnc.exe
-
-    select Open, and then OK to launch it.
-
-    The smaller file "ssvnc_windows_only-1.0.29.zip"
-    could have been used as well.
-
-    You can make a Windows shortcut to this program if you want to.
-
-    See the Windows/README.txt for more info.
-
-
-    If you want a SSH-only tool (without the distractions of SSL) run
-    the command:
-
-                sshvnc.bat
-
-    Or click "SSH-Only Mode" under Options.
-
-
-    If you want a simple VNC Terminal Services only mode (requires x11vnc
-    on the remote server) run the command:
-
-                tsvnc.bat
-
-    Or click "Terminal Services" under Options.  Control-t will toggle
-    between the two modes.  "tsvnc profile-name" and "tsvnc user at hostname"
-    work too.
-
-     _________________________________________________________________
-
-   You can read all of the SSVNC GUI's Online Help Text here.
-     _________________________________________________________________
-
-   The bundle unpacks a directory/folder named: ssvnc. It contains these
-   programs to launch the GUI:
-        Windows/ssvnc.exe        for Windows
-        MacOSX/ssvnc             for Mac OS X
-        Unix/ssvnc               for Unix
-
-   (the Mac OS X and Unix launchers are simply links to the bin
-   directory). See the README for more information.
-
-   The SSH-Only mode launcher program has name sshvnc. The Terminal
-   Services mode launcher program (assumes x11vnc 0.8.4 or later and Xvfb
-   installed on the server machine) has name tsvnc.
-
-   The Viewer SSL support is done via a wrapper script (bin/ssvnc_cmd
-   that calls bin/util/ss_vncviewer) that starts up the STUNNEL tunnel
-   first and then starts the TightVNC viewer pointed at that tunnel. The
-   bin/ssvnc program is a GUI front-end to that script. See this FAQ for
-   more details on SSL tunnelling. In SSH connection mode, the wrappers
-   start up SSH appropriately.
-
-
-   Memory Stick Usage: If you create a directory named "Home" in that
-   toplevel ssvnc directory then that will be used as the base for
-   storing VNC profiles and certificates. Also, for convenience, if you
-   first run the command with "." as an argument (e.g. "ssvnc .") it will
-   automatically create the "Home" directory for you. This is handy if
-   you want to place SSVNC on a USB flash drive that you carry around for
-   mobile use and you want the profiles you create to stay with the drive
-   (otherwise you'd have to browse to the drive directory each time you
-   load or save).
-
-   One user on Windows created a BAT file to launch SSVNC and needed to
-   do this to get the Home directory correct:
-cd \ssvnc\Windows
-start \ssvnc\Windows\ssvnc.exe
-
-   (an optional profile name can be supplied to the ssvnc.exe line)
-
-   WARNING: if you use ssvnc from an "Internet Cafe", i.e. some untrusted
-   computer, please be aware that someone may have set up that machine to
-   be capturing your keystrokes, etc.
-
-
-   SSH-Only version: The command "sshvnc" can be run instead of "ssvnc"
-   to get an SSH-only version of the tool:
-
-   [sshvnc.gif]
-
-   These also work: "sshvnc myprofile" and "sshvnc user at hostname". To
-   switch from the regular SSVNC mode, click "SSH-Only Mode" under
-   Options. This mode is less distracting if you never plan to use SSL,
-   manage certificates, etc.
-
-
-   Terminal Services Only: The command "tsvnc" can be run instead of
-   "ssvnc" to get a "Terminal Services" only version of the tool:
-
-   [tsvnc.gif]
-
-   These also work: "tsvnc myprofile" and "tsvnc user at hostname". To
-   switch from the regular SSVNC mode, click "Terminal Services" under
-   Options.
-
-   This mode requires x11vnc (0.9.3 or later) installed on the remote
-   machine to find, create, and manage the user sessions. SSH is used to
-   create the encrypted and authenticated tunnel. The Xvfb (virtual
-   framebuffer X server) program must also be installed on the remote
-   system. However tsvnc will also connect to a real X session (i.e. on
-   the physical hardware) if you are already logged into the X session;
-   this is a useful access mode and does not require Xvfb on the remote
-   system.
-
-   This mode should be very easy for beginner users to understand and
-   use. On the remote end you only need to have x11vnc and Xvfb available
-   in $PATH, and on the local end you just run something like:
-   tsvnc myname at myhost.com
-
-   (or start up the tsvnc GUI first and then enter myname at myhost.com and
-   press "Connect").
-
-   Normally the Terminal Services sessions created are virtual (RAM-only)
-   ones (e.g. Xvfb, Xdummy, or Xvnc), however a nice feature is if you
-   have a regular X session (i.e displaying on the physical hardware) on
-   the remote machine that you are ALREADY logged into, then the x11vnc
-   run from tsvnc will find it for you as well.
-
-   Also, there is setting "X Login" under Advanced Options that allows
-   you to attach to a real X server with no one logged in yet (i.e.
-   XDM/GDM/KDM Login Greeter screen) as long as you have sudo(1)
-   permission on the remote machine.
-
-   Nice features to soon to be added to the tsvnc mode are easy CUPS
-   printing (working fairly well) and Sound redirection (needs much work)
-   of the Terminal Services Desktop session. It is easier in tsvnc mode
-   because the entire desktop session can be started with the correct
-   environment. ssvnc tries to handle the general case of an already
-   started desktop and that is more difficult.
-
-
-   Proxies: Web proxies, SOCKS proxies, and the UltraVNC repeater proxy
-   are supported to allow the SSVNC connection to go through the proxy to
-   the otherwise unreachable VNC Server. SSH gateway machines can be used
-   in the same way. Read more about SSVNC proxy support here.
-
-
-   Dynamic VNC Server Port determination: If you are running SSVNC on
-   Unix and are using SSH to start the remote VNC server and the VNC
-   server prints out the line "PORT=NNNN" to indicate which dynamic port
-   it is using (x11vnc does this), then if you prefix the SSH command
-   with "PORT=" SSVNC will watch for the PORT=NNNN line and uses ssh's
-   built in SOCKS proxy (ssh -D ...) to connect to the dynamic VNC server
-   port through the SSH tunnel. For example:
-        VNC Host:Display     user at somehost.com
-        Remote SSH Command:  PORT= x11vnc -find
-
-   or "PORT= x11vnc -display :0 -localhost", etc. Or use "P= x11vnc ..."
-
-   There is also code to detect the display of the regular Unix
-   vncserver(1). It extracts the display (and hence port) from the lines
-   "New 'X' desktop is hostname:4" and also "VNC server is already
-   running as :4". So you can use something like:
-        PORT= vncserver; sleep 15
-or:     PORT= vncserver :4; sleep 15
-
-   the latter is preferred because when you reconnect with it will find
-   the already running one. The former one will keep creating new X
-   sessions if called repeatedly.
-
-   If you use PORT= on Windows, a large random port is selected instead
-   and the -rfbport option is passed to x11vnc (it does not work with
-   vncserver).
-
-
-
-   Patches for Unix Tightvnc viewer:
-
-   The rfbNewFBSize support allows the enhanced TightVNC Unix viewer to
-   resize when the server does (e.g. "x11vnc -R scale=3/4" remote control
-   command).
-
-   The cursor alphablending is described here.
-
-   The RealVNC ZRLE encoding is supported, in addition to some low colors
-   modes (16bpp and 8bpp at 256, 64, and even 8 colors, for use on very
-   slow connections). Greyscales are also enabled for the low color
-   modes.
-
-   The Popup menu (F8) is enhanced with the ability to change many things
-   on the fly. F9 is added as a shortcut to toggle FullScreen mode.
-
-   Client Side Caching: The x11vnc client-side caching is handled nicely
-   by this viewer. The very large pixel cache below the actual display in
-   this caching method is distracting. Our Unix VNC viewer will
-   automatically try to autodetect the actual display height if the
-   framebuffer is very tall (more than twice as high as it is wide). One
-   can also set the height to the known value via -ycrop n, or use -ycrop
-   -1 to force autodection. In fullscreen mode one is not possible to
-   scroll down to the pixel cache region. In non-fullscreen mode the
-   window manager frame is "shrink-wrapped" around the actual screen
-   display. You can still scroll down to the pixel cache region. The
-   scrollbars are set to be very thin (2 pixels) to be less distracting.
-   Use the -sbwidth n to make them wider.
-
-   Probably nobody is interested in the grabserver patch for old window
-   managers when the viewer is in fullscreen mode... This and some other
-   unfixed bugs have been fixed in our patches (fullscreen toggle works
-   with KDE, -x11cursor has been fixed, and the dot cursor has been made
-   smaller).
-
-   From the -help output:
-SSVNC Viewer (based on TightVNC viewer version 1.3.9)
-
-Usage: vncviewer [<OPTIONS>] [<HOST>][:<DISPLAY#>]
-       vncviewer [<OPTIONS>] [<HOST>][::<PORT#>]
-       vncviewer [<OPTIONS>] exec=[CMD ARGS...]
-       vncviewer [<OPTIONS>] fd=n
-       vncviewer [<OPTIONS>] /path/to/unix/socket
-       vncviewer [<OPTIONS>] -listen [<DISPLAY#>]
-       vncviewer -help
-
-<OPTIONS> are standard Xt options, or:
-        -via <GATEWAY>
-        -shared (set by default)
-        -noshared
-        -viewonly
-        -fullscreen
-        -noraiseonbeep
-        -passwd <PASSWD-FILENAME> (standard VNC authentication)
-        -user <USERNAME> (Unix login authentication)
-        -encodings <ENCODING-LIST> (e.g. "tight,copyrect")
-        -bgr233
-        -owncmap
-        -truecolour
-        -depth <DEPTH>
-        -compresslevel <COMPRESS-VALUE> (0..9: 0-fast, 9-best)
-        -quality <JPEG-QUALITY-VALUE> (0..9: 0-low, 9-high)
-        -nojpeg
-        -nocursorshape
-        -x11cursor
-        -autopass
-
-Option names may be abbreviated, e.g. -bgr instead of -bgr233.
-See the manual page for more information.
-
-
-Enhanced TightVNC viewer (SSVNC) options:
-
-   URL http://www.karlrunge.com/x11vnc/ssvnc.html
-
-   Note: ZRLE and ZYWRLE encodings are now supported.
-
-   Note: F9 is shortcut to Toggle FullScreen mode.
-
-   Note: In -listen mode set the env var. SSVNC_MULTIPLE_LISTEN=1
-         to allow more than one incoming VNC server at a time.
-         This is the same as -multilisten described below.  Set
-         SSVNC_MULTIPLE_LISTEN=MAX:n to allow no more than "n"
-         simultaneous reverse connections.
-
-   Note: If the host:port is specified as "exec=command args..."
-         then instead of making a TCP/IP socket connection to the
-         remote VNC server, "command args..." is executed and the
-         viewer is attached to its stdio.  This enables tunnelling
-         established via an external command, e.g. an stunnel(8)
-         that does not involve a listening socket.  This mode does
-         not work for -listen reverse connections.
-
-         If the host:port is specified as "fd=n" then it is assumed
-         n is an already opened file descriptor to the socket. (i.e
-         the parent did fork+exec)
-
-         If the host:port contains a '/' it is interpreted as a
-         unix-domain socket (AF_LOCAL insead of AF_INET)
-
-        -multilisten  As in -listen (reverse connection listening) except
-                    allow more than one incoming VNC server to be connected
-                    at a time.  The default for -listen of only one at a
-                    time tries to play it safe by not allowing anyone on
-                    the network to put (many) desktops on your screen over
-                    a long window of time. Use -multilisten for no limit.
-
-        -acceptpopup  In -listen (reverse connection listening) mode when
-                    a reverse VNC connection comes in show a popup asking
-                    whether to Accept or Reject the connection.  The IP
-                    address of the connecting host is shown.  Same as
-                    setting the env. var. SSVNC_ACCEPT_POPUP=1.
-
-        -acceptpopupsc  As in -acceptpopup except assume UltraVNC Single
-                    Click (SC) server.  Retrieve User and ComputerName
-                    info from UltraVNC Server and display in the Popup.
-
-        -use64      In -bgr233 mode, use 64 colors instead of 256.
-        -bgr222     Same as -use64.
-
-        -use8       In -bgr233 mode, use 8 colors instead of 256.
-        -bgr111     Same as -use8.
-
-        -16bpp      If the vnc viewer X display is depth 24 at 32bpp
-                    request a 16bpp format from the VNC server to cut
-                    network traffic by up to 2X, then tranlate the
-                    pixels to 32bpp locally.
-        -bgr565     Same as -16bpp.
-
-        -grey       Use a grey scale for the 16- and 8-bpp modes.
-
-        -alpha      Use alphablending transparency for local cursors
-                    requires: x11vnc server, both client and server
-                    must be 32bpp and same endianness.
-
-        -scale str  Scale the desktop locally.  The string "str" can
-                    a floating point ratio, e.g. "0.9", or a fraction,
-                    e.g. "3/4", or WxH, e.g. 1280x1024.  Use "fit"
-                    to fit in the current screen size.  Use "auto" to
-                    fit in the window size.  "str" can also be set by
-                    the env. var. SSVNC_SCALE.
-
-                    If you observe mouse trail painting errors, enable
-                    X11 Cursor mode (either via Popup or -x11cursor.)
-
-                    Note that scaling is done in software and so can be
-                    slow and requires more memory.  Some speedup Tips:
-
-                        ZRLE is faster than Tight in this mode.  When
-                        scaling is first detected, the encoding will
-                        be automatically switched to ZRLE.  Use the
-                        Popup menu if you want to go back to Tight.
-                        Set SSVNC_PRESERVE_ENCODING=1 to disable this.
-
-                        Use a solid background on the remote side.
-                        (e.g. manually or via x11vnc -solid ...)
-
-                        If the remote server is x11vnc, try client
-                        side caching: x11vnc -ncache 10 ...
-
-        -ycrop n    Only show the top n rows of the framebuffer.  For
-                    use with x11vnc -ncache client caching option
-                    to help "hide" the pixel cache region.
-                    Use a negative value (e.g. -1) for autodetection.
-                    Autodetection will always take place if the remote
-                    fb height is more than 2 times the width.
-
-        -sbwidth n  Scrollbar width for x11vnc -ncache mode (-ycrop),
-                    default is very narrow: 2 pixels, it is narrow to
-                    avoid distraction in -ycrop mode.
-
-        -nobell     Disable bell.
-
-        -rawlocal   Prefer raw encoding for localhost, default is
-                    no, i.e. assumes you have a SSH tunnel instead.
-
-        -notty      Try to avoid using the terminal for interactive
-                    responses: use windows for messages and prompting
-                    instead.  Messages will also be printed to terminal.
-
-        -sendclipboard  Send the X CLIPBOARD selection (i.e. Ctrl+C,
-                        Ctrl+V) instead of the X PRIMARY selection (mouse
-                        select and middle button paste.)
-
-        -sendalways     Whenever the mouse enters the VNC viewer main
-                        window, send the selection to the VNC server even if
-                        it has not changed.  This is like the Xt resource
-                        translation SelectionToVNC(always)
-
-        -recvtext str   When cut text is received from the VNC server,
-                        ssvncviewer will set both the X PRIMARY and the
-                        X CLIPBOARD local selections.  To control which
-                        is set, specify 'str' as 'primary', 'clipboard',
-                        or 'both' (the default.)
-
-        -graball    Grab the entire X server when in fullscreen mode,
-                    needed by some old window managers like fvwm2.
-
-        -popupfix   Warp the popup back to the pointer position,
-                    needed by some old window managers like fvwm2.
-        -sendclipboard  Send the X CLIPBOARD selection (i.e. Ctrl+C,
-                        Ctrl+V) instead of the X PRIMARY selection (mouse
-                        select and middle button paste.)
-
-        -sendalways     Whenever the mouse enters the VNC viewer main
-                        window, send the selection to the VNC server even if
-                        it has not changed.  This is like the Xt resource
-                        translation SelectionToVNC(always)
-
-        -recvtext str   When cut text is received from the VNC server,
-                        ssvncviewer will set both the X PRIMARY and the
-                        X CLIPBOARD local selections.  To control which
-                        is set, specify 'str' as 'primary', 'clipboard',
-                        or 'both' (the default.)
-
-        -graball    Grab the entire X server when in fullscreen mode,
-                    needed by some old window managers like fvwm2.
-
-        -popupfix   Warp the popup back to the pointer position,
-                    needed by some old window managers like fvwm2.
-
-        -grabkbd    Grab the X keyboard when in fullscreen mode,
-                    needed by some window managers. Same as -grabkeyboard.
-                    -grabkbd is the default, use -nograbkbd to disable.
-
-        -bs, -nobs  Whether or not to use X server Backingstore for the
-                    main viewer window.  The default is to not, mainly
-                    because most Linux, etc, systems X servers disable
-                    *all* Backingstore by default.  To re-enable it put
-
-                        Option "Backingstore"
-
-                    in the Device section of /etc/X11/xorg.conf.
-                    In -bs mode with no X server backingstore, whenever an
-                    area of the screen is re-exposed it must go out to the
-                    VNC server to retrieve the pixels. This is too slow.
-
-                    In -nobs mode, memory is allocated by the viewer to
-                    provide its own backing of the main viewer window. This
-                    actually makes some activities faster (changes in large
-                    regions) but can appear to "flash" too much.
-
-        -noshm      Disable use of MIT shared memory extension (not recommended
-)
-
-        -termchat   Do the UltraVNC chat in the terminal vncviewer is in
-                    instead of in an independent window.
-
-        -unixpw str Useful for logging into x11vnc in -unixpw mode. "str" is a
-                    string that allows many ways to enter the Unix Username
-                    and Unix Password.  These characters: username, newline,
-                    password, newline are sent to the VNC server after any VNC
-                    authentication has taken place.  Under x11vnc they are
-                    used for the -unixpw login.  Other VNC servers could do
-                    something similar.
-
-                    You can also indicate "str" via the environment
-                    variable SSVNC_UNIXPW.
-
-                    Note that the Escape key is actually sent first to tell
-                    x11vnc to not echo the Unix Username back to the VNC
-                    viewer. Set SSVNC_UNIXPW_NOESC=1 to override this.
-
-                    If str is ".", then you are prompted at the command line
-                    for the username and password in the normal way.  If str is
-                    "-" the stdin is read via getpass(3) for username at password.
-                    Otherwise if str is a file, it is opened and the first line
-                    read is taken as the Unix username and the 2nd as the
-                    password. If str prefixed by "rm:" the file is removed
-                    after reading. Otherwise, if str has a "@" character,
-                    it is taken as username at password. Otherwise, the program
-                    exits with an error. Got all that?
-
-     -repeater str  This is for use with UltraVNC repeater proxy described
-                    here: http://www.uvnc.com/addons/repeater.html.  The "str"
-                    is the ID string to be sent to the repeater.  E.g. ID:1234
-                    It can also be the hostname and port or display of the VNC
-                    server, e.g. 12.34.56.78:0 or snoopy.com:1.  Note that when
-                    using -repeater, the host:dpy on the cmdline is the repeate
-r
-                    server, NOT the VNC server.  The repeater will connect you.
-
-                    Example: vncviewer ... -repeater ID:3333 repeat.host:5900
-                    Example: vncviewer ... -repeater vhost:0 repeat.host:5900
-
-                    Use, e.g., '-repeater SCIII=ID:3210' if the repeater is a
-                    Single Click III (SSL) repeater (repeater_SSL.exe) and you
-                    are passing the SSL part of the connection through stunnel,
-                    socat, etc. This way the magic UltraVNC string 'testB'
-                    needed to work with the repeater is sent to it.
-
-     -rfbversion str Set the advertised RFB version.  E.g.: -rfbversion 3.6
-                    For some servers, e.g. UltraVNC this needs to be done.
-
-     -ultradsm      UltraVNC has symmetric private key encryption DSM plugins:
-                    http://www.uvnc.com/features/encryption.html. It is assumed
-                    you are using a unix program (e.g. our ultravnc_dsm_helper)
-                    to encrypt and decrypt the UltraVNC DSM stream. IN ADDITION
-                    TO THAT supply -ultradsm to tell THIS viewer to modify the
-                    RFB data sent so as to work with the UltraVNC Server. For
-                    some reason, each RFB msg type must be sent twice under DSM
-.
-
-     -mslogon user  Use Windows MS Logon to an UltraVNC server.  Supply the
-                    username or "1" to be prompted.  The default is to
-                    autodetect the UltraVNC MS Logon server and prompt for
-                    the username and password.
-
-                    IMPORTANT NOTE: The UltraVNC MS-Logon Diffie-Hellman
-                    exchange is very weak and can be brute forced to recover
-                    your username and password in a few seconds of CPU time.
-                    To be safe, be sure to use an additional encrypted tunnel
-                    (e.g. SSL or SSH) for the entire VNC session.
-
-     -chatonly      Try to be a client that only does UltraVNC text chat. This
-                    mode is used by x11vnc to present a chat window on the
-                    physical X11 console (i.e. chat with the person at the
-                    display).
-
-     -env VAR=VALUE To save writing a shell script to set environment variables
-,
-                    specify as many as you need on the command line.  For
-                    example, -env SSVNC_MULTIPLE_LISTEN=MAX:5 -env EDITOR=vi
-
-     -noipv6        Disable all IPv6 sockets.  Same as VNCVIEWER_NO_IPV6=1.
-
-     -noipv4        Disable all IPv4 sockets.  Same as VNCVIEWER_NO_IPV4=1.
-
-     -printres      Print out the Ssvnc X resources (appdefaults) and then exit
-                    You can save them to a file and customize them (e.g. the
-                    keybindings and Popup menu)  Then point to the file via
-                    XENVIRONMENT or XAPPLRESDIR.
-
-     -pipeline      Like TurboVNC, request the next framebuffer update as soon
-                    as possible instead of waiting until the end of the current
-                    framebuffer update coming in.  Helps 'pipeline' the updates
-.
-                    This is currently the default, use -nopipeline to disable.
-
-     -appshare      Enable features for use with x11vnc's -appshare mode where
-                    instead of sharing the full desktop only the application's
-                    windows are shared.  Viewer multilisten mode is used to
-                    create the multiple windows: -multilisten is implied.
-                    See 'x11vnc -appshare -help' more information on the mode.
-
-                    Features enabled in the viewer under -appshare are:
-                    Minimum extra text in the title, auto -ycrop is disabled,
-                    x11vnc -remote_prefix X11VNC_APPSHARE_CMD: message channel,
-                    x11vnc initial window position hints.  See also Escape Keys
-                    below for additional key and mouse bindings.
-
-     -escape str    This sets the 'Escape Keys' modifier sequence and enables
-                    escape keys mode.  When the modifier keys escape sequence
-                    is held down, the next keystroke is interpreted locally
-                    to perform a special action instead of being sent to the
-                    remote VNC server.
-
-                    Use '-escape default' for the default modifier sequence.
-                    (Unix: Alt_L,Super_L and MacOSX: Control_L,Meta_L)
-
-    Here are the 'Escape Keys: Help+Set' instructions from the Popup Menu:
-
-    Escape Keys:  Enter a comma separated list of modifier keys to be the
-    'escape sequence'.  When these keys are held down, the next keystroke is
-    interpreted locally to invoke a special action instead of being sent to
-    the remote VNC server.  In other words, a set of 'Hot Keys'.
-
-    To enable or disable this, click on 'Escape Keys: Toggle' in the Popup.
-
-    Here is the list of hot-key mappings to special actions:
-
-       r: refresh desktop  b: toggle bell   c: toggle full-color
-       f: file transfer    x: x11cursor     z: toggle Tight/ZRLE
-       l: full screen      g: graball       e: escape keys dialog
-       s: scale dialog     +: scale up (=)  -: scale down (_)
-       t: text chat                         a: alphablend cursor
-       V: toggle viewonly  Q: quit viewer   1 2 3 4 5 6: UltraVNC scale 1/n
-
-       Arrow keys:         pan the viewport about 10% for each keypress.
-       PageUp / PageDown:  pan the viewport by a screenful vertically.
-       Home   / End:       pan the viewport by a screenful horizontally.
-       KeyPad Arrow keys:  pan the viewport by 1 pixel for each keypress.
-       Dragging the Mouse with Button1 pressed also pans the viewport.
-       Clicking Mouse Button3 brings up the Popup Menu.
-
-    The above mappings are *always* active in ViewOnly mode, unless you set the
-    Escape Keys value to 'never'.
-
-    If the Escape Keys value below is set to 'default' then a default list of
-    of modifier keys is used.  For Unix it is: Alt_L,Super_L and for MacOSX it
-    is Control_L,Meta_L.  Note: the Super_L key usually has a Windows(TM) Flag
-    on it.  Also note the _L and _R mean the key is on the LEFT or RIGHT side
-    of the keyboard.
-
-    On Unix   the default is Alt and Windows keys on Left side of keyboard.
-    On MacOSX the default is Control and Command keys on Left side of keyboard.
-
-    Example: Press and hold the Alt and Windows keys on the LEFT side of the
-    keyboard and then press 'c' to toggle the full-color state.  Or press 't'
-    to toggle the ultravnc Text Chat window, etc.
-
-    To use something besides the default, supply a comma separated list (or a
-    single one) from: Shift_L Shift_R Control_L Control_R Alt_L Alt_R Meta_L
-    Meta_R Super_L Super_R Hyper_L Hyper_R or Mode_switch.
-
-
-   New Popup actions:
-
-        ViewOnly:                ~ -viewonly
-        Disable Bell:            ~ -nobell
-        Cursor Shape:            ~ -nocursorshape
-        X11 Cursor:              ~ -x11cursor
-        Cursor Alphablend:       ~ -alpha
-        Toggle Tight/Hextile:    ~ -encodings hextile...
-        Toggle Tight/ZRLE:       ~ -encodings zrle...
-        Toggle ZRLE/ZYWRLE:      ~ -encodings zywrle...
-        Quality Level            ~ -quality (both Tight and ZYWRLE)
-        Compress Level           ~ -compresslevel
-        Disable JPEG:            ~ -nojpeg  (Tight)
-        Pipeline Updates         ~ -pipeline
-
-        Full Color                 as many colors as local screen allows.
-        Grey scale (16 & 8-bpp)  ~ -grey, for low colors 16/8bpp modes only.
-        16 bit color (BGR565)    ~ -16bpp / -bgr565
-        8  bit color (BGR233)    ~ -bgr233
-        256 colors               ~ -bgr233 default # of colors.
-         64 colors               ~ -bgr222 / -use64
-          8 colors               ~ -bgr111 / -use8
-        Scale Viewer             ~ -scale
-        Escape Keys: Toggle      ~ -escape
-        Escape Keys: Help+Set    ~ -escape
-        Set Y Crop (y-max)       ~ -ycrop
-        Set Scrollbar Width      ~ -sbwidth
-        XGrabServer              ~ -graball
-
-        UltraVNC Extensions:
-
-          Set 1/n Server Scale     Ultravnc ext. Scale desktop by 1/n.
-          Text Chat                Ultravnc ext. Do Text Chat.
-          File Transfer            Ultravnc ext. File xfer via Java helper.
-          Single Window            Ultravnc ext. Grab and view a single window.
-                                   (select then click on the window you want).
-          Disable Remote Input     Ultravnc ext. Try to prevent input and
-                                   viewing of monitor at physical display.
-
-        Note: the Ultravnc extensions only apply to servers that support
-              them.  x11vnc/libvncserver supports some of them.
-
-        Send Clipboard not Primary  ~ -sendclipboard
-        Send Selection Every time   ~ -sendalways
-
-   Nearly all of these can be changed dynamically in the Popup menu
-   (press F8 for it):
-
-   [viewer_menu.gif] [unixviewer.jpg]
-
-     _________________________________________________________________
-
-   Windows:
-
-   For Windows, SSL Viewer support is provided by a GUI Windows/ssvnc.exe
-   that prompts for the VNC display and then starts up STUNNEL followed
-   by the Stock TightVNC Windows Viewer. Both are bundled in the package
-   for your convenience. The GUI has other useful features. When the
-   connection is finished, you will be asked if you want to terminate the
-   STUNNEL program. For SSH connections from Windows the GUI will use
-   PLINK instead of STUNNEL.
-
-   Unix and Mac OS X:
-
-   Run the GUI (ssvnc, see above) and let me know how it goes.
-     _________________________________________________________________
-
-   Hopefully this tool will make it convenient for people to help test
-   and use the built-in SSL support in x11vnc. Extra testing of this
-   feature is much appreciated!! Thanks.
-
-   Please Help Test the newly added features:
-     * Automatic Service tunnelling via SSH for CUPS and SMB Printing
-     * ESD/ARTSD Audio
-     * SMB (Windows/Samba) filesystem mounting
-
-   These allow you to print from the remote (VNC Server) machine to local
-   printers, listen to sounds (with some limitations) from the remote VNC
-   Server machine, and to mount your local Windows or Samba shares on the
-   remote VNC Server machine. Basically these new features try to
-   automate the tricks described here:
-    http://www.karlrunge.com/x11vnc/faq.html#faq-smb-shares
-    http://www.karlrunge.com/x11vnc/faq.html#faq-cups
-    http://www.karlrunge.com/x11vnc/faq.html#faq-sound
-     _________________________________________________________________
-
-   Downloading: Downloads for this project are hosted at Sourceforge.net.
-
-   Choose the archive file bundle that best suits you (e.g. no source
-   code, windows only, unix only, zip, tar etc).
-
-   A quick guide:
-
-      On some flavor of Unix, e.g. Linux or Solaris? Use
-   "ssvnc_unix_only" (or "ssvnc_no_windows" to recompile).
-      On Mac OS X? Use "ssvnc_no_windows".
-      On Windows? Use "ssvnc_windows_only".
-  ssvnc_windows_only-1.0.28.zip      Windows Binaries Only.  No source included
- (6.2MB)
-  ssvnc_no_windows-1.0.28.tar.gz     Unix and Mac OS X Only. No Windows binarie
-s.  Source included. (10.1MB)
-  ssvnc_unix_only-1.0.28.tar.gz      Unix Binaries Only.     No source included
-. (7.2MB)
-  ssvnc_unix_minimal-1.0.28.tar.gz   Unix Minimal.  You must supply your own vn
-cviewer and stunnel. (0.2MB)
-
-  ssvnc-1.0.28.tar.gz                All Unix, Mac OS X, and Windows binaries a
-nd source TGZ. (16.1MB)
-  ssvnc-1.0.28.zip                   All Unix, Mac OS X, and Windows binaries a
-nd source ZIP. (16.4MB)
-  ssvnc_all-1.0.28.zip               All Unix, Mac OS X, and Windows binaries a
-nd source AND full archives in the zip dir. (19.2MB)
-
-
-   Here is a conventional source tarball:
-  ssvnc-1.0.28.src.tar.gz            Conventional Source for SSVNC GUI and Unix
- VNCviewer  (0.5MB)
-
-   it will be of use to those who do not want the SSVNC
-   "one-size-fits-all" bundles. For example, package/distro maintainers
-   will find this more familiar and useful to them (i.e. they run: "make
-   config; make all; make install"). Note that it does not include the
-   stunnel source, and so has a dependency that the system stunnel is
-   installed.
-
-   Read the README.src file for more information on using the
-   conventional source tarball.
-
-
-   Note: even with the Unix bundles, e.g. "ssvnc_no_windows" or
-   "ssvnc_all", you may need to run the "./build.unix" script in the top
-   directory to recompile for your operating system.
-
-   Here are the corresponding 1.0.29 development bundles (Please help
-   test them):
-
-  ssvnc_windows_only-1.0.29.zip
-  ssvnc_no_windows-1.0.29.tar.gz
-  ssvnc_unix_only-1.0.29.tar.gz
-  ssvnc_unix_minimal-1.0.29.tar.gz
-
-  ssvnc-1.0.29.tar.gz
-  ssvnc-1.0.29.zip
-  ssvnc_all-1.0.29.zip
-
-  ssvnc-1.0.29.src.tar.gz            Conventional Source for SSVNC GUI and Unix
- VNCviewer  (0.5MB)
-
-
-   For any Unix system, a self-extracting and running file for the
-   "ssvnc_unix_minimal" package is here: ssvnc. Save it as filename
-   "ssvnc", type "chmod 755 ./ssvnc", and then launch the GUI via typing
-   "./ssvnc". Note that this "ssvnc_unix_minimal" mode requires you
-   install the "stunnel" and "vncviewer" programs externally (for
-   example, install your distros' versions, e.g. on debian: "apt-get
-   install stunnel4 xtightvncviewer".) It will work, but many of the
-   SSVNC features will be missing.
-
-   Previous releases:
-      Release 1.0.18 at Sourceforge.net
-      Release 1.0.19 at Sourceforge.net
-      Release 1.0.20 at Sourceforge.net
-      Release 1.0.21 at Sourceforge.net
-      Release 1.0.22 at Sourceforge.net
-      Release 1.0.23 at Sourceforge.net
-      Release 1.0.24 at Sourceforge.net
-      Release 1.0.25 at Sourceforge.net
-      Release 1.0.26 at Sourceforge.net
-      Release 1.0.27 at Sourceforge.net
-      Release 1.0.28 at Sourceforge.net
-
-
-   Please help test the UltraVNC File Transfer support in the native Unix
-   VNC viewer! Let us know how it went.
-
-   Current Unix binaries in the archives:
-    Linux.i686
-    Linux.x86_64
-    Linux.ppc64    X (removed)
-    Linux.alpha    X (removed)
-    SunOS.sun4u
-    SunOS.sun4m
-    SunOS.i86pc
-    Darwin.Power.Macintosh
-    Darwin.i386
-    HP-UX.9000     X (removed)
-    FreeBSD.i386   X (removed)
-    NetBSD.i386    X (removed)
-    OpenBSD.i386   X (removed)
-
-   (some of these are out of date, marked with 'X' above, because I no
-   longer have access to machines running those OS's. Use the
-   "build.unix" script to recompile on your system).
-
-   Note: some of the above binaries depend on libssl.so.0.9.7, whereas
-   some recent distros only provide libssl.so.0.9.8 by default (for
-   compatibility reasons they should install both by default but not all
-   do). So you may need to instruct your distro to install the 0.9.7
-   library (it is fine to have both runtimes installed simultaneously
-   since the libraries have different names). Update: I now try to
-   statically link libssl.a for all of the binaries in the archive.
-
-   You can also run the included build.unix script to try to
-   automatically build the binaries if your OS is not in the above list
-   or the included binary does not run properly on your system. Let me
-   know how that goes.
-     _________________________________________________________________
-
-   IMPORTANT: there may be restrictions for you to download, use, or
-   redistribute the above because of cryptographic software they contain
-   or for other reasons. Please check out your situation and information
-   at the following and related sites:
-        http://stunnel.mirt.net
-        http://www.stunnel.org
-        http://www.openssl.org
-        http://www.chiark.greenend.org.uk/~sgtatham/putty/
-        http://www.tightvnc.com
-        http://www.realvnc.com
-        http://sourceforge.net/projects/cotvnc/
-     _________________________________________________________________
-
-   README: Here is the toplevel README from the bundle.
-	
-=======================================================================
-http://www.karlrunge.com/x11vnc/x11vnc_opts.html:
-
-
-     _________________________________________________________________
-
-x11vnc: a VNC server for real X displays
-
-   Here are all of x11vnc command line options:
-% x11vnc -opts      (see below for -help long descriptions)
-
-x11vnc: allow VNC connections to real X11 displays. 0.9.13 lastmod: 2010-12-27
-
-x11vnc options:
-  -display disp            -auth file               -N                     
-  -autoport n              -rfbport str             -6                     
-  -no6                     -noipv6                  -noipv4                
-  -reopen                  -reflect host:N          -id windowid           
-  -sid windowid            -appshare                -clip WxH+X+Y          
-  -flashcmap               -shiftcmap n             -notruecolor           
-  -advertise_truecolor     -visual n                -overlay               
-  -overlay_nocursor        -8to24 [opts]            -24to32                
-  -scale fraction          -geometry WxH            -scale_cursor frac     
-  -viewonly                -shared                  -once                  
-  -forever                 -loop                    -timeout n             
-  -sleepin n               -inetd                   -tightfilexfer         
-  -ultrafilexfer           -http                    -http_ssl              
-  -avahi                   -mdns                    -zeroconf              
-  -connect string          -connect_or_exit str     -proxy string          
-  -vncconnect              -novncconnect            -allow host1[,host2..] 
-  -localhost               -unixsock str            -listen6 str           
-  -nolookup                -input string            -grabkbd               
-  -grabptr                 -ungrabboth              -grabalways            
-  -viewpasswd string       -passwdfile filename     -showrfbauth filename  
-  -unixpw [list]           -unixpw_nis [list]       -unixpw_cmd cmd        
-  -find                    -finddpy                 -listdpy               
-  -findauth [disp]         -create                  -xdummy                
-  -xvnc                    -xvnc_redirect           -xdummy_xvfb           
-  -create_xsrv str         -svc                     -svc_xdummy            
-  -svc_xvnc                -svc_xdummy_xvfb         -xdmsvc                
-  -sshxdmsvc               -unixpw_system_greeter   -redirect port         
-  -display WAIT:...        -vencrypt mode           -anontls mode          
-  -sslonly                 -dhparams file           -nossl                 
-  -ssl [pem]               -ssltimeout n            -sslnofail             
-  -ssldir dir              -sslverify path          -sslCRL path           
-  -sslGenCA [dir]          -sslGenCert type name    -sslEncKey pem         
-  -sslCertInfo pem         -sslDelCert pem          -sslScripts            
-  -stunnel [pem]           -stunnel3  [pem]         -enc cipher:keyfile    
-  -https [port]            -httpsredir [port]       -http_oneport          
-  -ssh user at host:disp      -usepw                   -storepasswd pass file 
-  -nopw                    -accept string           -afteraccept string    
-  -gone string             -users list              -noshm                 
-  -flipbyteorder           -onetile                 -solid [color]         
-  -blackout string         -xinerama                -noxinerama            
-  -xtrap                   -xrandr [mode]           -rotate string         
-  -padgeom WxH             -o logfile               -flag file             
-  -rmflag file             -rc filename             -norc                  
-  -env VAR=VALUE           -prog /path/to/x11vnc    -h, -help              
-  -?, -opts                -V, -version             -license               
-  -dbg                     -q, -quiet               -v, -verbose           
-  -bg                      -modtweak                -nomodtweak            
-  -xkb                     -noxkb                   -capslock              
-  -skip_lockkeys           -noskip_lockkeys         -skip_keycodes string  
-  -sloppy_keys             -skip_dups               -noskip_dups           
-  -add_keysyms             -noadd_keysyms           -clear_mods            
-  -clear_keys              -clear_all               -remap string          
-  -norepeat                -repeat                  -nofb                  
-  -nobell                  -nosel                   -noprimary             
-  -nosetprimary            -noclipboard             -nosetclipboard        
-  -seldir string           -cursor [mode]           -nocursor              
-  -cursor_drag             -arrow n                 -noxfixes              
-  -alphacut n              -alphafrac fraction      -alpharemove           
-  -noalphablend            -nocursorshape           -cursorpos             
-  -nocursorpos             -xwarppointer            -noxwarppointer        
-  -always_inject           -buttonmap string        -nodragging            
-  -ncache n                -ncache_cr               -ncache_no_moveraise   
-  -ncache_no_dtchange      -ncache_no_rootpixmap    -ncache_keep_anims     
-  -ncache_old_wm           -ncache_pad n            -debug_ncache          
-  -wireframe [str]         -nowireframe             -nowireframelocal      
-  -wirecopyrect mode       -nowirecopyrect          -debug_wireframe       
-  -scrollcopyrect mode     -noscrollcopyrect        -scr_area n            
-  -scr_skip list           -scr_inc list            -scr_keys list         
-  -scr_term list           -scr_keyrepeat lo-hi     -scr_parms string      
-  -fixscreen string        -debug_scroll            -noxrecord             
-  -grab_buster             -nograb_buster           -debug_grabs           
-  -debug_sel               -pointer_mode n          -input_skip n          
-  -allinput                -input_eagerly           -speeds rd,bw,lat      
-  -wmdt string             -debug_pointer           -debug_keyboard        
-  -defer time              -wait time               -extra_fbur n          
-  -wait_ui factor          -setdefer n              -nowait_bog            
-  -slow_fb time            -xrefresh time           -nap                   
-  -nonap                   -sb time                 -readtimeout n         
-  -ping n                  -nofbpm                  -fbpm                  
-  -nodpms                  -dpms                    -forcedpms             
-  -clientdpms              -noserverdpms            -noultraext            
-  -chatwindow              -noxdamage               -xd_area A             
-  -xd_mem f                -sigpipe string          -threads               
-  -nothreads               -fs f                    -gaps n                
-  -grow n                  -fuzz n                  -debug_tiles           
-  -snapfb                  -rawfb string            -freqtab file          
-  -pipeinput cmd           -macnodim                -macnosleep            
-  -macnosaver              -macnowait               -macwheel n            
-  -macnoswap               -macnoresize             -maciconanim n         
-  -macmenu                 -macuskbd                -macnoopengl           
-  -macnorawfb              -gui [gui-opts]          -remote command        
-  -query variable          -QD variable             -sync                  
-  -query_retries str       -remote_prefix str       -noremote              
-  -yesremote               -unsafe                  -safer                 
-  -privremote              -nocmds                  -allowedcmds list      
-  -deny_all              
-
-LibVNCServer options:
--rfbport port          TCP port for RFB protocol
--rfbwait time          max time in ms to wait for RFB client
--rfbauth passwd-file   use authentication on RFB protocol
-                       (use 'storepasswd' to create a password file)
--rfbversion 3.x        Set the version of the RFB we choose to advertise
--permitfiletransfer    permit file transfer support
--passwd plain-password use authentication 
-                       (use plain-password as password, USE AT YOUR RISK)
--deferupdate time      time in ms to defer updates (default 40)
--deferptrupdate time   time in ms to defer pointer updates (default none)
--desktop name          VNC desktop name (default "LibVNCServer")
--alwaysshared          always treat new clients as shared
--nevershared           never treat new clients as shared
--dontdisconnect        don't disconnect existing clients when a new non-shared
-                       connection comes in (refuse new connection instead)
--httpdir dir-path      enable http server using dir-path home
--httpport portnum      use portnum for http connection
--enablehttpproxy       enable http proxy support
--progressive height    enable progressive updating for slow links
--listen ipaddr         listen for connections only on network interface with
-                       addr ipaddr. '-listen localhost' and hostname work too.
-
-libvncserver-tight-extension options:
--disablefiletransfer   disable file transfer
--ftproot string        set ftp root
-
-
-
-
-% x11vnc -help
-
-x11vnc: allow VNC connections to real X11 displays. 0.9.13 lastmod: 2010-12-27
-
-(type "x11vnc -opts" to just list the options.)
-
-Typical usage is:
-
-   Run this command in a shell on the remote machine "far-host"
-   with X session you wish to view:
-
-       x11vnc -display :0
-
-   Then run this in another window on the machine you are sitting at:
-
-       vncviewer far-host:0
-
-Once x11vnc establishes connections with the X11 server and starts listening
-as a VNC server it will print out a string: PORT=XXXX where XXXX is typically
-5900 (the default VNC server port).  One would next run something like
-this on the local machine: "vncviewer hostname:N" where "hostname" is
-the name of the machine running x11vnc and N is XXXX - 5900, i.e. usually
-"vncviewer hostname:0".
-
-By default x11vnc will not allow the screen to be shared and it will exit
-as soon as the client disconnects.  See -shared and -forever below to override
-these protections.  See the FAQ for details how to tunnel the VNC connection
-through an encrypted channel such as ssh(1).  In brief:
-
-       ssh -t -L 5900:localhost:5900 far-host 'x11vnc -localhost -display :0'
-
-       vncviewer -encodings 'copyrect tight zrle hextile' localhost:0
-
-Also, use of a VNC password (-rfbauth or -passwdfile) is strongly recommended.
-
-For additional info see: http://www.karlrunge.com/x11vnc/
-                    and  http://www.karlrunge.com/x11vnc/faq.html
-
-
-Config file support: if the file $HOME/.x11vncrc exists then each line in
-it is treated as a single command line option.  Disable with -norc.  For
-each option name, the leading character "-" is not required.  E.g. a line
-that is either "forever" or "-forever" may be used and are equivalent.
-Likewise "wait 100" or "-wait 100" are acceptable and equivalent lines.
-The "#" character comments out to the end of the line in the usual way
-(backslash it for a literal).  Leading and trailing whitespace is trimmed off.
-Lines may be continued with a "\" as the last character of a line (it
-becomes a space character).
-
-Options:
-
--display disp          X11 server display to connect to, usually :0.  The X
-                       server process must be running on same machine and
-                       support MIT-SHM.  Equivalent to setting the DISPLAY
-                       environment variable to "disp".
-
-                       See the description below of the "-display WAIT:..."
-                       extensions, where alias "-find" will find the user's
-                       display automatically, and "-create" will create a
-                       Xvfb session if no session is found.
-
--auth file             Set the X authority file to be "file", equivalent to
-                       setting the XAUTHORITY environment variable to "file"
-                       before startup.  Same as -xauth file.  See Xsecurity(7),
-                       xauth(1) man pages for more info.
-
-                       Use '-auth guess' to have x11vnc use its -findauth
-                       mechanism (described below) to try to guess the
-                       XAUTHORITY filename and use it.
-
-                       XDM/GDM/KDM: if you are running x11vnc as root and want
-                       to find the XAUTHORITY before anyone has logged into an
-                       X session yet, use: x11vnc -env FD_XDM=1 -auth guess ...
-                       (This will also find the XAUTHORITY if a user is already
-                       logged into the X session.)  When running as root,
-                       FD_XDM=1 will be tried if the initial -auth guess fails.
-
--N                     If the X display is :N, try to set the VNC display to
-                       also be :N This just sets the -rfbport option to 5900+N
-                       The program will exit immediately if that port is not
-                       available. The -N option only works with normal -display
-                       usage, e.g. :0 or :8, -N is ignored in the -display
-                       WAIT:..., -create, -find, -svc, -redirect, etc modes.
-
--autoport n            Automatically probe for a free VNC port starting at n.
-                       The default is to start probing at 5900.  Use this to
-                       stay away from other VNC servers near 5900.
-
--rfbport str           The VNC port to listen on (a LibVNCServer option), e.g.
-                       5900, 5901, etc.  If specified as "-rfbport PROMPT"
-                       then the x11vnc -gui is used to prompt the user to
-                       enter the port number.
-
--6                     IPv6 listening support.  In addition to IPv4, the
-                       IPv6 address is listened on for incoming connections.
-                       The same port number as IPv4 is used.
-
-                       NOTE:  This x11vnc binary was compiled to have the
-                       "-6" IPv6 listening mode ENABLED by default (CPPFLAGS
-                       -DX11VNC_LISTEN6=1).  So to disable IPv6 listening mode
-                       you MUST supply the "-no6" option (see below.)
-
-                       The "-6" mode works for both normal connections and
-                       -ssl encrypted ones.  Nearly everything is supported
-                       for the IPv6 case, but there are a few exceptions.
-                       See -stunnel for its IPv6 support.
-
-                       Currently, for absolutely everything to work correctly
-                       the machine may need to have some IPv4 support, at the
-                       least for the loopback interface.  However, for nearly
-                       all usage modes no IPv4 support is required. See -nopiv4
-.
-
-                       If you have trouble compiling or running in IPv6 mode,
-                       set -DX11VNC_IPV6=0 in CPPFLAGS when configuring to
-                       disable IPv6 support.
-
--no6                   Disable IPv6 listening support (only useful if the
-                       "-6" mode is compiled in to be the default; see the
-                       X11VNC_LISTEN6 description above under "-6".)
-
--noipv6                Do not try to use IPv6 for any listening or connecting
-                       sockets.  This includes both the listening service
-                       port(s) and outgoing connections from -connect,
-                       -connect_or_exit, or -proxy.  Use this if you are having
-                       problems due to IPv6.
-
--noipv4                Do not try to use IPv4 for any listening or connecting
-                       sockets.  This is mainly for exploring the behavior of
-                       x11vnc on an IPv6-only system, but may have other uses.
-
--reopen                If the X server connection is disconnected, try to
-                       reopen the X display (up to one time.)  This is of use
-                       for display managers like GDM (KillInitClients option)
-                       that kill x11vnc just after the user logs into the
-                       X session.  Note: the reopened state may be unstable.
-                       Set X11VNC_REOPEN_DISPLAY=n to reopen n times and
-                       set X11VNC_REOPEN_SLEEP_MAX to the number of seconds,
-                       default 10, to keep trying to reopen the display (once
-                       per second.)
-
-                       Update: as of 0.9.9, x11vnc tries to automatically avoid
-                       being killed by the display manager by delaying creating
-                       windows or using XFIXES.  So you shouldn't need to use
-                       KillInitClients=false as long as you log in quickly
-                       enough (within 45 seconds of connecting.)  You can
-                       disable this by setting X11VNC_AVOID_WINDOWS=never.
-                       You can also set it to the number of seconds to delay.
-
--reflect host:N        Instead of connecting to and polling an X display,
-                       connect to the remote VNC server host:N and be a
-                       reflector/repeater for it.  This is useful for trying
-                       to manage the case of many simultaneous VNC viewers
-                       (e.g. classroom broadcasting) where, e.g. you put
-                       a repeater on each network switch, etc, to improve
-                       performance by distributing the load and network
-                       traffic.  Implies -shared (use -noshared as a later
-                       option to disable). See the discussion below under
-                       -rawfb vnc:host:N for more details.
-
--id windowid           Show the X window corresponding to "windowid" not
-                       the entire display.  New windows like popup menus,
-                       transient toplevels, etc, may not be seen or may be
-                       clipped.  Disabling SaveUnders or BackingStore in the
-                       X server may help show them.  x11vnc may crash if the
-                       window is initially partially obscured, changes size,
-                       is iconified, etc.  Some steps are taken to avoid this
-                       and the -xrandr mechanism is used to track resizes.  Use
-                       xwininfo(1) to get the window id, or use "-id pick"
-                       to have x11vnc run xwininfo(1) for you and extract
-                       the id.  The -id option is useful for exporting very
-                       simple applications (e.g. the current view on a webcam).
--sid windowid          As -id, but instead of using the window directly it
-                       shifts a root view to it: this shows SaveUnders menus,
-                       etc, although they will be clipped if they extend beyond
-                       the window.
-
--appshare              Simple application sharing based on the -id/-sid
-                       mechanism.  Every new toplevel window that the
-                       application creates induces a new viewer window via
-                       a reverse connection.  The -id/-sid and -connect
-                       options are required.  Run 'x11vnc -appshare -help'
-                       for more info.
-
--clip WxH+X+Y          Only show the sub-region of the full display that
-                       corresponds to the rectangle geometry with size WxH and
-                       offset +X+Y.  The VNC display has size WxH (i.e. smaller
-                       than the full display).  This also works for -id/-sid
-                       mode where the offset is relative to the upper left
-                       corner of the selected window.  An example use of this
-                       option would be to split a large (e.g. Xinerama) display
-                       into two parts to be accessed via separate viewers by
-                       running a separate x11vnc on each part.
-
-                       Use '-clip xinerama0' to clip to the first xinerama
-                       sub-screen (if xinerama is active).  xinerama1 for the
-                       2nd sub-screen, etc.  This way you don't need to figure
-                       out the WxH+X+Y of the desired xinerama sub-screen.
-                       screens are sorted in increasing distance from the
-                       (0,0) origin (I.e. not the Xserver's order).
-
--flashcmap             In 8bpp indexed color, let the installed colormap flash
-                       as the pointer moves from window to window (slow).
-                       Also try the -8to24 option to avoid flash altogether.
--shiftcmap n           Rare problem, but some 8bpp displays use less than 256
-                       colorcells (e.g. 16-color grayscale, perhaps the other
-                       bits are used for double buffering) *and* also need to
-                       shift the pixels values away from 0, .., ncells.  "n"
-                       indicates the shift to be applied to the pixel values.
-                       To see the pixel values set DEBUG_CMAP=1 to print out
-                       a colormap histogram.  Example: -shiftcmap 240
--notruecolor           For 8bpp displays, force indexed color (i.e. a colormap)
-                       even if it looks like 8bpp TrueColor (rare problem).
--advertise_truecolor   If the X11 display is indexed color, lie to clients
-                       when they first connect by telling them it is truecolor.
-                       To workaround RealVNC: inPF has colourMap but not 8bpp
-                       Use '-advertise_truecolor reset' to reset client fb too.
-
--visual n              This option probably does not do what you think.
-                       It simply *forces* the visual used for the framebuffer;
-                       this may be a bad thing... (e.g. messes up colors or
-                       cause a crash). It is useful for testing and for some
-                       workarounds.  n may be a decimal number, or 0x hex.
-                       Run xdpyinfo(1) for the values.  One may also use
-                       "TrueColor", etc. see <X11/X.h> for a list.  If the
-                       string ends in ":m" then for better or for worse
-                       the visual depth is forced to be m.  You may want to
-                       use -noshm when using this option (so XGetImage may
-                       automatically translate the pixel data).
-
--overlay               Handle multiple depth visuals on one screen, e.g. 8+24
-                       and 24+8 overlay visuals (the 32 bits per pixel are
-                       packed with 8 for PseudoColor and 24 for TrueColor).
-
-                       Currently -overlay only works on Solaris via
-                       XReadScreen(3X11) and IRIX using XReadDisplay(3).
-                       On Solaris there is a problem with image "bleeding"
-                       around transient popup menus (but not for the menu
-                       itself): a workaround is to disable SaveUnders
-                       by passing the "-su" argument to Xsun (in
-                       /etc/dt/config/Xservers).
-
-                       Use -overlay as a workaround for situations like these:
-                       Some legacy applications require the default visual to
-                       be 8bpp (8+24), or they will use 8bpp PseudoColor even
-                       when the default visual is depth 24 TrueColor (24+8).
-                       In these cases colors in some windows will be incorrect
-                       in x11vnc unless -overlay is used.  Another use of
-                       -overlay is to enable showing the exact mouse cursor
-                       shape (details below).
-
-                       Under -overlay, performance will be somewhat slower
-                       due to the extra image transformations required.
-                       For optimal performance do not use -overlay, but rather
-                       configure the X server so that the default visual is
-                       depth 24 TrueColor and try to have all apps use that
-                       visual (e.g. some apps have -use24 or -visual options).
--overlay_nocursor      Sets -overlay, but does not try to draw the exact mouse
-                       cursor shape using the overlay mechanism.
-
--8to24 [opts]          Try this option if -overlay is not supported on your
-                       OS, and you have a legacy 8bpp app that you want to
-                       view on a multi-depth display with default depth 24
-                       (and is 32 bpp) OR have a default depth 8 display with
-                       depth 24 overlay windows for some apps.  This option
-                       may not work on all X servers and hardware (tested
-                       on XFree86/Xorg mga driver and Xsun).  The "opts"
-                       string is not required and is described below.
-
-                       This mode enables a hack where x11vnc monitors windows
-                       within 3 levels from the root window.  If it finds
-                       any that are 8bpp it extracts the indexed color
-                       pixel values using XGetImage() and then applies a
-                       transformation using the colormap(s) to create TrueColor
-                       RGB values that it in turn inserts into bits 1-24 of
-                       the framebuffer.  This creates a depth 24 "view"
-                       of the display that is then exported via VNC.
-
-                       Conversely, for default depth 8 displays, the depth
-                       24 regions are read by XGetImage() and everything is
-                       transformed and inserted into a depth 24 TrueColor
-                       framebuffer.
-
-                       Note that even if there are *no* depth 24 visuals or
-                       windows (i.e. pure 8bpp), this mode is potentially
-                       an improvement over -flashcmap because it avoids the
-                       flashing and shows each window in the correct color.
-
-                       This method works OK, but may still have bugs and it
-                       does hog resources.  If there are multiple 8bpp windows
-                       using different colormaps, one may have to iconify all
-                       but one for the colors to be correct.
-
-                       There may be painting errors for clipping and switching
-                       between windows of depths 8 and 24.  Heuristics are
-                       applied to try to minimize the painting errors.  One can
-                       also press 3 Alt_L's in a row to refresh the screen
-                       if the error does not repair itself.  Also the option
-                       -fixscreen 8=3.0 or -fixscreen V=3.0 may be used to
-                       periodically refresh the screen at the cost of bandwidth
-                       (every 3 sec for this example).
-
-                       The [opts] string can contain the following settings.
-                       Multiple settings are separated by commas.
-
-                       For for some X servers with default depth 24 a
-                       speedup may be achieved via the option "nogetimage".
-                       This enables a scheme were XGetImage() is not used
-                       to retrieve the 8bpp data.  Instead, it assumes that
-                       the 8bpp data is in bits 25-32 of the 32bit X pixels.
-                       There is no requirement that the X server should put
-                       the data there for our poll requests, but some do and
-                       so the extra steps to retrieve it can be skipped.
-                       Tested with mga driver with XFree86/Xorg.  For the
-                       default depth 8 case this option is ignored.
-
-                       To adjust how often XGetImage() is used to poll the
-                       non-default visual regions for changes, use the option
-                       "poll=t" where "t" is a floating point time.
-                       (default: 0.05)
-
-                       Setting the option "level2" will limit the search
-                       for non-default visual windows to two levels from the
-                       root window.  Do this on slow machines where you know
-                       the window manager only imposes one extra window between
-                       the app window and the root window.
-
-                       Also for very slow machines use "cachewin=t"
-                       where t is a floating point amount of time to cache
-                       XGetWindowAttributes results.  E.g. cachewin=5.0.
-                       This may lead to the windows being unnoticed for this
-                       amount of time when deiconifying, painting errors, etc.
-
-                       While testing on a very old SS20 these options gave
-                       tolerable response: -8to24 poll=0.2,cachewin=5.0. For
-                       this machine -overlay is supported and gives better
-                       response.
-
-                       Debugging for this mode can be enabled by setting
-                       "dbg=1", "dbg=2", or "dbg=3".
-
--24to32                Very rare problem: if the framebuffer (X display
-                       or -rawfb) is 24bpp instead of the usual 32bpp, then
-                       dynamically transform the pixels to 32bpp.  This will be
-                       slower, but can be used to work around problems where
-                       VNC viewers cannot handle 24bpp (e.g. "main: setPF:
-                       not 8, 16 or 32 bpp?").  See the FAQ for more info.
-
-                       In the case of -rawfb mode, the pixels are directly
-                       modified by inserting a 0 byte to pad them out to 32bpp.
-                       For X displays, a kludge is done that is equivalent to
-                       "-noshm -visual TrueColor:32".  (If better performance
-                       is needed for the latter, feel free to ask).
-
--scale fraction        Scale the framebuffer by factor "fraction".  Values
-                       less than 1 shrink the fb, larger ones expand it. Note:
-                       the image may not be sharp and response may be slower.
-                       If "fraction" contains a decimal point "." it
-                       is taken as a floating point number, alternatively
-                       the notation "m/n" may be used to denote fractions
-                       exactly, e.g. -scale 2/3
-
-                       To scale asymmetrically in the horizontal and vertical
-                       directions, specify a WxH geometry to stretch to:
-                       e.g. '-scale 1024x768', or also '-scale 0.9x0.75'
-
-                       Scaling Options: can be added after "fraction" via
-                       ":", to supply multiple ":" options use commas.
-                       If you just want a quick, rough scaling without
-                       blending, append ":nb" to "fraction" (e.g. -scale
-                       1/3:nb).  No blending is the default for 8bpp indexed
-                       color, to force blending for this case use ":fb".
-
-                       To disable -scrollcopyrect and -wirecopyrect under
-                       -scale use ":nocr".  If you need to to enable them use
-                       ":cr" or specify them explicitly on the command line.
-                       If a slow link is detected, ":nocr" may be applied
-                       automatically.  Default: :cr
-
-                       More esoteric options: for compatibility with vncviewers
-                       the scaled width is adjusted to be a multiple of 4:
-                       to disable this use ":n4".  ":in" use interpolation
-                       scheme even when shrinking, ":pad" pad scaled width
-                       and height to be multiples of scaling denominator
-                       (e.g. 3 for 2/3).
-
--geometry WxH          Same as -scale WxH
-
--scale_cursor frac     By default if -scale is supplied the cursor shape is
-                       scaled by the same factor.  Depending on your usage,
-                       you may want to scale the cursor independently of the
-                       screen or not at all.  If you specify -scale_cursor
-                       the cursor will be scaled by that factor.  When using
-                       -scale mode to keep the cursor at its "natural" size
-                       use "-scale_cursor 1".  Most of the ":" scaling
-                       options apply here as well.
-
--viewonly              All VNC clients can only watch (default off).
--shared                VNC display is shared, i.e. more than one viewer can
-                       connect at the same time (default off).
--once                  Exit after the first successfully connected viewer
-                       disconnects, opposite of -forever. This is the Default.
--forever               Keep listening for more connections rather than exiting
-                       as soon as the first client(s) disconnect. Same as -many
-
-                       To get the standard non-shared VNC behavior where when
-                       a new VNC client connects the existing VNC client is
-                       dropped use:  -nevershared -forever   This method can
-                       also be used to guard against hung TCP connections that
-                       do not go away.
-
--loop                  Create an outer loop restarting the x11vnc process
-                       whenever it terminates.  -bg and -inetd are ignored
-                       in this mode (however see -loopbg below).
-
-                       Useful for continuing even if the X server terminates
-                       and restarts (at that moment the process will need
-                       permission to reconnect to the new X server of course).
-
-                       Use, e.g., -loop100 to sleep 100 millisecs between
-                       restarts, etc.  Default is 2000ms (i.e. 2 secs) Use,
-                       e.g. -loop300,5 to sleep 300 ms and only loop 5 times.
-
-                       If -loopbg (plus any numbers) is specified instead,
-                       the "-bg" option is implied and the mode approximates
-                       inetd(8) usage to some degree.  In this case when
-                       it goes into the background any listening sockets
-                       (i.e. ports 5900, 5800) are closed, so the next one
-                       in the loop can use them.  This mode will only be of
-                       use if a VNC client (the only client for that process)
-                       is already connected before the process goes into the
-                       background, for example, usage of -display WAIT:..,
-                       -svc, and -connect can make use of this "poor man's"
-                       inetd mode.  The default wait time is 500ms in this
-                       mode.  This usage could use useful:  -svc -bg -loopbg
-
--timeout n             Exit unless a client connects within the first n seconds
-                       after startup.
-
-                       If there have been no connection attempts after n
-                       seconds x11vnc exits immediately.  If a client is
-                       trying to connect but has not progressed to the normal
-                       operating state, x11vnc gives it a few more seconds
-                       to finish and exits if it does not make it to the
-                       normal state.
-
-                       For reverse connections via -connect or -connect_or_exit
-                       a timeout of n seconds will be set for all reverse
-                       connects.  If the connect timeout alarm goes off,
-                       x11vnc will exit immediately.
-
--sleepin n             At startup sleep n seconds before proceeding (e.g. to
-                       allow redirs and listening clients to start up)
-
-                       If a range is given: '-sleepin min-max', a random value
-                       between min and max is slept. E.g. '-sleepin 0-20' and
-                       '-sleepin 10-30'.  Floats are allowed too.
-
--inetd                 Launched by inetd(8): stdio instead of listening socket.
-                       Note: if you are not redirecting stderr to a log file
-                       (via shell 2> or -o option) you MUST also specify the -q
-                       option, otherwise the stderr goes to the viewer which
-                       will cause it to abort.  Specifying both -inetd and -q
-                       and no -o will automatically close the stderr.
-
--tightfilexfer         Enable the TightVNC file transfer extension. Note that
-                       that when the -viewonly option is supplied all file
-                       transfers are disabled.  Also clients that log in
-                       viewonly cannot transfer files.  However, if the remote
-                       control mechanism is used to change the global or
-                       per-client viewonly state the filetransfer permissions
-                       will NOT change.
-
-                       IMPORTANT: please understand if -tightfilexfer is
-                       specified and you run x11vnc as root for, say, inetd
-                       or display manager (gdm, kdm, ...) access and you do
-                       not have it switch users via the -users option, then
-                       VNC Viewers that connect are able to do filetransfer
-                       reads and writes as *root*.
-
-                       Also, tightfilexfer is disabled in -unixpw mode.
-
--ultrafilexfer         Note: to enable UltraVNC filetransfer and to get it to
-                       work you probably need to supply these LibVNCServer
-                       options: "-rfbversion 3.6 -permitfiletransfer"
-                       "-ultrafilexfer" is an alias for this combination.
-
-                       IMPORTANT: please understand if -ultrafilexfer is
-                       specified and you run x11vnc as root for, say, inetd
-                       or display manager (gdm, kdm, ...) access and you do
-                       not have it switch users via the -users option, then
-                       VNC Viewers that connect are able to do filetransfer
-                       reads and writes as *root*.
-
-                       Note that sadly you cannot do both -tightfilexfer and
-                       -ultrafilexfer at the same time because the latter
-                       requires setting the version to 3.6 and tightvnc will
-                       not do filetransfer when it sees that version number.
-
--http                  Instead of using -httpdir (see below) to specify
-                       where the Java vncviewer applet is, have x11vnc try
-                       to *guess* where the directory is by looking relative
-                       to the program location and in standard locations
-                       (/usr/local/share/x11vnc/classes, etc).  Under -ssl or
-                       -stunnel the ssl classes subdirectory is sought.
--http_ssl              As -http, but force lookup for ssl classes subdir.
-
-                       Note that for HTTPS, single-port Java applet delivery
-                       you can set X11VNC_HTTPS_DOWNLOAD_WAIT_TIME to the
-                       max number of seconds to wait for the applet download
-                       to finish.  The default is 15.
-
--avahi                 Use the Avahi/mDNS ZeroConf protocol to advertise
-                       this VNC server to the local network. (Related terms:
-                       Rendezvous, Bonjour).  Depending on your setup, you
-                       may need to start avahi-daemon and open udp port 5353
-                       in your firewall.
-
-                       You can set X11VNC_AVAHI_NAME, X11VNC_AVAHI_HOST,
-                       and/or X11VNC_AVAHI_PORT environment variables
-                       to override the default values.  For example:
-                       -env X11VNC_AVAHI_NAME=wally
-
-                       If the avahi API cannot be found at build time, a helper
-                       program like avahi-publish(1) or dns-sd(1) will be tried
-
--mdns                  Same as -avahi.
--zeroconf              Same as -avahi.
-
--connect string        For use with "vncviewer -listen" reverse connections.
-                       If "string" has the form "host" or "host:port"
-                       the connection is made once at startup.
-
-                       Use commas for a list of host's and host:port's.
-                       E.g. -connect host1,host2 or host1:0,host2:5678.
-                       Note that to reverse connect to multiple hosts at the
-                       same time you will likely need to also supply: -shared
-
-                       Note that unlike most vnc servers, x11vnc will require a
-                       password for reverse as well as for forward connections.
-                       (provided password auth has been enabled, -rfbauth, etc)
-                       If you do not want to require a password for reverse
-                       connections set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in
-                       your environment before starting x11vnc.
-
-                       If "string" contains "/" it is instead interpreted
-                       as a file to periodically check for new hosts.
-                       The first line is read and then the file is truncated.
-                       Be careful about the location of this file if x11vnc
-                       is running as root (e.g. via gdm(1), etc).
-
-
-                       Repeater mode: Some services provide an intermediate
-                       "vnc repeater": http://www.uvnc.com/addons/repeater.html
-                       (and also http://koti.mbnet.fi/jtko/ for linux port)
-                       that acts as a proxy/gateway.  Modes like these require
-                       an initial string to be sent for the reverse connection
-                       before the VNC protocol is started.  Here are the ways
-                       to do this:
-
-                         -connect pre=some_string+host:port
-                         -connect pre128=some_string+host:port
-                         -connect repeater=ID:1234+host:port
-                         -connect repeater=23.45.67.89::5501+host:port
-
-                       SSVNC notation is also supported:
-
-                         -connect repeater://host:port+ID:1234
-
-                       As with normal -connect usage, if the repeater port is
-                       not supplied 5500 is assumed.
-
-                       The basic idea is between the special tag, e.g. "pre="
-                       and "+" is the pre-string to be sent.  Note that in
-                       this case host:port is the repeater server, NOT the
-                       vnc viewer.  Somehow the pre-string tells the repeater
-                       server how to find the vnc viewer and connect you to it.
-
-                       In the case pre=some_string+host:port, "some_string"
-                       is simply sent. In the case preNNN=some_string+host:port
-                       "some_string" is sent in a null padded buffer of
-                       length NNN.  repeater= is the same as pre250=, this is
-                       the ultravnc repeater buffer size.
-
-                       Strings like "\n" and "\r", etc. are expanded to
-                       newline and carriage return.  "\c" is expanded to
-                       "," since the connect string is comma separated.
-
-                       See also the -proxy option below for additional ways
-                       to plumb reverse connections.
-
-                       Reverse SSL: using -connect in -ssl mode makes x11vnc
-                       act as an SSL client (initiates SSL connection) rather
-                       than an SSL server.  The idea is x11vnc might be
-                       connecting to stunnel on the viewer side with the
-                       viewer in listening mode.  If you do not want this
-                       behavior, use -env X11VNC_DISABLE_SSL_CLIENT_MODE=1.
-                       With this the viewer side can act as the SSL client
-                       as it normally does for forward connections.
-
-                       Reverse SSL Repeater mode:  This will work, but note
-                       that if the VNC Client does any sort of a 'Fetch Cert'
-                       action before connecting, then the Repeater will
-                       likely drop the connection and both sides will need
-                       to restart.  Consider the use of -connect_or_exit
-                       and -loop300,2 to have x11vnc reconnect once to the
-                       repeater after the fetch.  You will probably also want
-                       to supply -sslonly to avoid x11vnc thinking the delay
-                       in response means the connection is VeNCrypt.  The env
-                       var X11VNC_DISABLE_SSL_CLIENT_MODE=1 discussed above
-                       may also be useful (i.e. the viewer can do a forward
-                       connection as it normally does.)
-
-                       IPv6: as of x11vnc 0.9.10 the -connect option should
-                       connect to IPv6 hosts properly.  If there are problems
-                       you can disable IPv6 by setting -DX11VNC_IPV6=0
-                       in CPPFLAGS when configuring.  If there problems
-                       connecting to IPv6 hosts consider a relay like the
-                       included inet6to4 script or the -proxy option.
-
--connect_or_exit str   As with -connect, except if none of the reverse
-                       connections succeed, then x11vnc shuts down immediately
-
-                       An easier to type alias for this option is '-coe'
-
-                       By the way, if you do not want x11vnc to listen on
-                       ANY interface use -rfbport 0  which is handy for the
-                       -connect_or_exit mode.
-
--proxy string          Use proxy in string (e.g. host:port) as a proxy for
-                       making reverse connections (-connect or -connect_or_exit
-                       options).
-
-                       Web proxies are supported, but note by default most of
-                       them only support destination connections to ports 443
-                       or 563, so this might not be very useful (the viewer
-                       would need to listen on that port or the router would
-                       have to do a port redirection).
-
-                       A web proxy may be specified by either "host:port"
-                       or "http://host:port" (the port is required even if
-                       it is the common choices 80 or 8080)
-
-                       SOCKS4, SOCKS4a, and SOCKS5 are also supported.
-                       SOCKS proxies normally do not have restrictions on the
-                       destination port number.
-
-                       Use a format like this: socks://host:port or
-                       socks5://host:port.  Note that ssh -D does not support
-                       SOCKS4a, so use socks5://.  For socks:// SOCKS4 is used
-                       on a numerical IP and "localhost", otherwise SOCKS4a
-                       is used (and so the proxy tries to do the DNS lookup).
-
-                       An experimental mode is "-proxy http://host:port/..."
-                       Note the "/" after the port that distinguishes it from
-                       a normal web proxy.  The port must be supplied even if
-                       it is the default 80.  For this mode a GET is done to
-                       the supplied URL with the string host=H&port=P appended.
-                       H and P will be the -connect reverse connect host
-                       and port.  Use the string "__END__" to disable the
-                       appending.  The basic idea here is that maybe some cgi
-                       script provides the actual viewer hookup and tunnelling.
-                       How to actually achieve this within cgi, php, etc. is
-                       not clear...  A custom web server or apache module
-                       would be straight-forward.
-
-                       Another experimental mode is "-proxy ssh://user@host"
-                       in which case a SSH tunnel is used for the proxying.
-                       "user@" is not needed unless your unix username is
-                       different on "host".  For a non-standard SSH port
-                       use ssh://user@host:port.  If proxies are chained (see
-                       next paragraph) then the ssh one must be the first one.
-                       If ssh-agent is not active, then the ssh password needs
-                       to be entered in the terminal where x11vnc is running.
-                       Examples:
-
-                         -connect localhost:0 -proxy ssh://me@friends-pc:2222
-
-                         -connect snoopy:0 -proxy ssh://ssh.company.com
-
-                       Multiple proxies may be chained together in case one
-                       needs to ricochet off of a number of hosts to finally
-                       reach the VNC viewer.  Up to 3 may be chained, separate
-                       them by commas in the order they are to be connected to.
-                       E.g.:  http://host1:port1,socks5://host2:port2 or three
-                       like:  first,second,third
-
-                       IPv6: as of x11vnc 0.9.10 the -proxy option should
-                       connect to IPv6 hosts properly.  If there are problems
-                       you can disable IPv6 by setting -DX11VNC_IPV6=0
-                       in CPPFLAGS when configuring.  If there problems
-                       connecting to IPv6 hosts consider a relay like the
-                       included inet6to4 script.
-
--vncconnect            Monitor the VNC_CONNECT X property set by the standard
--novncconnect          VNC program vncconnect(1).  When the property is
-                       set to "host" or "host:port" establish a reverse
-                       connection.  Using xprop(1) instead of vncconnect may
-                       work (see the FAQ).  The -remote control mechanism uses
-                       X11VNC_REMOTE channel, and this option disables/enables
-                       it as well.  Default: -vncconnect
-
-                       To use different names for these X11 properties (e.g. to
-                       have separate communication channels for multiple
-                       x11vnc's on the same display) set the VNC_CONNECT or
-                       X11VNC_REMOTE env. vars. to the string you want, for
-                       example: -env X11VNC_REMOTE=X11VNC_REMOTE_12345
-                       Both sides of the channel must use the same unique name.
-                       The same can be done for the internal X11VNC_TICKER
-                       property (heartbeat and timestamp) if desired.
-
--allow host1[,host2..] Only allow client connections from hosts matching
-                       the comma separated list of hostnames or IP addresses.
-                       Can also be a numerical IP prefix, e.g. "192.168.100."
-                       to match a simple subnet, for more control build
-                       LibVNCServer with libwrap support (See the FAQ).  If the
-                       list contains a "/" it instead is a interpreted
-                       as a file containing addresses or prefixes that is
-                       re-read each time a new client connects.  Lines can be
-                       commented out with the "#" character in the usual way.
-
-                       -allow applies in -ssl mode, but not in -stunnel mode.
-
-                       IPv6: as of x11vnc 0.9.10 a host can be specified
-                       in IPv6 numerical format, e.g. 2001:4860:b009::93.
-
--localhost             Basically the same as "-allow 127.0.0.1".
-
-                       Note: if you want to restrict which network interface
-                       x11vnc listens on, see the -listen option below.
-                       E.g. "-listen localhost" or "-listen 192.168.3.21".
-                       As a special case, the option "-localhost" implies
-                       "-listen localhost".
-
-                       A rare case, but for non-localhost -listen usage, if
-                       you use the remote control mechanism (-R) to change
-                       the -listen interface you may need to manually adjust
-                       the -allow list (and vice versa) to avoid situations
-                       where no connections (or too many) are allowed.
-
-                       If you do not want x11vnc to listen on ANY interface
-                       (evidently you are using -connect or -connect_or_exit,
-                       or plan to use remote control: -R connect:host), use
-                       -rfbport 0
-
-                       IPv6: if IPv6 is supported, this option automatically
-                       implies the IPv6 loopback address '::1' as well.
-
--unixsock str          Listen on the unix socket (AF_UNIX) 'str'
-                       for connections.  This mode is for either local
-                       connections or a tunnel endpoint where one wants the
-                       file permission of the unix socket file to determine
-                       what can connect to it.  (This currently requires an
-                       edit to libvnserver/rfbserver.c: comment out lines 310
-                       and 311, 'close(sock)' and 'return NULL' in rfbserver.c
-                       after the setsockopt() call.) Note that to disable all
-                       tcp listening ports specify '-rfbport 0' and should be
-                       useful with this mode.  Example:
-                           mkdir ~/s; chmod 700 ~/s;
-                           x11vnc -unixsock ~/s/mysock -rfbport 0 ...
-                       The SSVNC unix vncviewer can connect to unix sockets.
-
--listen6 str           When in IPv6 listen mode "-6", listen only on the
-                       network interface with address "str".  It also works
-                       for link scope addresses (fe80::219:dbff:fee5:3f92%eth0)
-                       and IPv6 hostname strings (e.g. ipv6.google.com.)
-                       Use LibVNCServer -listen option for the IPv4 interface.
-
--nolookup              Do not use gethostbyname() or gethostbyaddr() to look up
-                       host names or IP numbers.  Use this if name resolution
-                       is incorrectly set up and leads to long pauses as name
-                       lookups time out, etc.
-
--input string          Fine tuning of allowed user input.  If "string" does
-                       not contain a comma "," the tuning applies only to
-                       normal clients.  Otherwise the part before "," is
-                       for normal clients and the part after for view-only
-                       clients.  "K" is for Keystroke input, "M" for
-                       Mouse-motion input, "B" for Button-click input, "C"
-                       is for Clipboard input, and "F" is for File transfer
-                       (ultravnc only).  Their presence in the string enables
-                       that type of input.  E.g. "-input M" means normal
-                       users can only move the mouse and  "-input KMBCF,M"
-                       lets normal users do anything and enables view-only
-                       users to move the mouse.  This option is ignored when
-                       a global -viewonly is in effect (all input is discarded
-                       in that case).
-
--grabkbd               When VNC viewers are connected, attempt to the grab
-                       the keyboard so a (non-malicious) user sitting at the
-                       physical display is not able to enter keystrokes.
-                       This method uses XGrabKeyboard(3X11) and so it is
-                       not secure and does not rule out the person at the
-                       physical display injecting keystrokes by flooding the
-                       server with them, grabbing the keyboard himself, etc.
-                       Some degree of cooperation from the person at the
-                       display is assumed.  This is intended for remote
-                       help-desk or educational usage modes.
-
-                       Note: on some recent (12/2010) X servers and/or
-                       desktops, -grabkbd no longer works: it prevents the
-                       window manager from resizing windows and similar things.
-                       Try -ungrabboth below (might not work.)
-
--grabptr               As -grabkbd, but for the mouse pointer using
-                       XGrabPointer(3X11).  Unfortunately due to the way the X
-                       server works, the mouse can still be moved around by the
-                       user at the physical display, but he will not be able to
-                       change window focus with it.  Also some window managers
-                       that call XGrabServer(3X11) for resizes, etc, will
-                       act on the local user's input.  Again, some degree of
-                       cooperation from the person at the display is assumed.
-
--ungrabboth            Whenever there is any input (either keyboard or
-                       pointer), ungrab *both* the keyboard and the pointer
-                       while injecting the synthetic input.  This is to allow
-                       window managers, etc. a chance to grab.
-
--grabalways            Apply both -grabkbd and -grabptr even when no VNC
-                       viewers are connected.  If you only want one of them,
-                       use the -R remote control to turn the other back on,
-                       e.g. -R nograbptr.
-
--viewpasswd string     Supply a 2nd password for view-only logins.  The -passwd
-                       (full-access) password must also be supplied.
-
--passwdfile filename   Specify the LibVNCServer password via the first line
-                       of the file "filename" (instead of via -passwd on
-                       the command line where others might see it via ps(1)).
-
-                       See the descriptions below for how to supply multiple
-                       passwords, view-only passwords, to specify external
-                       programs for the authentication, and other features.
-
-                       If the filename is prefixed with "rm:" it will be
-                       removed after being read.  Perhaps this is useful in
-                       limiting the readability of the file.  In general, the
-                       password file should not be readable by untrusted users
-                       (BTW: neither should the VNC -rfbauth file: it is NOT
-                       encrypted, only obscured with a fixed key).
-
-                       If the filename is prefixed with "read:" it will
-                       periodically be checked for changes and reread.  It is
-                       guaranteed to be reread just when a new client connects
-                       so that the latest passwords will be used.
-
-                       If "filename" is prefixed with "cmd:" then the
-                       string after the ":" is run as an external command:
-                       the output of the command will be interpreted as if it
-                       were read from a password file (see below).  If the
-                       command does not exit with 0, then x11vnc terminates
-                       immediately.  To specify more than 1000 passwords this
-                       way set X11VNC_MAX_PASSWDS before starting x11vnc.
-                       The environment variables are set as in -accept.
-
-                       Note that due to the VNC protocol only the first 8
-                       characters of a password are used (DES key).
-
-                       If "filename" is prefixed with "custom:" then a
-                       custom password checker is supplied as an external
-                       command following the ":". The command will be run
-                       when a client authenticates.  If the command exits with
-                       0 the client is accepted, otherwise it is rejected.
-                       The environment variables are set as in -accept.
-
-                       The standard input to the custom command will be a
-                       decimal digit "len" followed by a newline. "len"
-                       specifies the challenge size and is usually 16 (the
-                       VNC spec).  Then follows len bytes which is the random
-                       challenge string that was sent to the client. This is
-                       then followed by len more bytes holding the client's
-                       response (i.e. the challenge string encrypted via DES
-                       with the user password in the standard situation).
-
-                       The "custom:" scheme can be useful to implement
-                       dynamic passwords or to implement methods where longer
-                       passwords and/or different encryption algorithms
-                       are used.  The latter will require customizing the VNC
-                       client as well.  One could create an MD5SUM based scheme
-                       for example.
-
-                       File format for -passwdfile:
-
-                       If multiple non-blank lines exist in the file they are
-                       all taken as valid passwords.  Blank lines are ignored.
-                       Password lines may be "commented out" (ignored) if
-                       they begin with the character "#" or the line contains
-                       the string "__SKIP__".  Lines may be annotated by use
-                       of the "__COMM__" string: from it to the end of the
-                       line is ignored.  An empty password may be specified
-                       via the "__EMPTY__" string on a line by itself (note
-                       your viewer might not accept empty passwords).
-
-                       If the string "__BEGIN_VIEWONLY__" appears on a
-                       line by itself, the remaining passwords are used for
-                       viewonly access.  For compatibility, as a special case
-                       if the file contains only two password lines the 2nd
-                       one is automatically taken as the viewonly password.
-                       Otherwise the "__BEGIN_VIEWONLY__" token must be
-                       used to have viewonly passwords.  (tip: make the 3rd
-                       and last line be "__BEGIN_VIEWONLY__" to have 2
-                       full-access passwords)
-
--showrfbauth filename  Print to the screen the obscured VNC password kept in
-                       the rfbauth file "filename" and then exit.
-
--unixpw [list]         Use Unix username and password authentication.  x11vnc
-                       will use the su(1) program to verify the user's
-                       password.  [list] is an optional comma separated list
-                       of allowed Unix usernames.  If the [list] string begins
-                       with the character "!" then the entire list is taken
-                       as an exclude list.  See below for per-user options
-                       that can be applied.
-
-                       A familiar "login:" and "Password:" dialog is
-                       presented to the user on a black screen inside the
-                       vncviewer.  The connection is dropped if the user fails
-                       to supply the correct password in 3 tries or does not
-                       send one before a 45 second timeout.  Existing clients
-                       are view-only during this period.
-
-                       If the first character received is "Escape" then the
-                       unix username will not be displayed after "login:"
-                       as it is typed.  This could be of use for VNC viewers
-                       that automatically type the username and password.
-
-                       Since the detailed behavior of su(1) can vary from
-                       OS to OS and for local configurations, test the mode
-                       before deployment to make sure it is working properly.
-                       x11vnc will attempt to be conservative and reject a
-                       login if anything abnormal occurs.
-
-                       One case to note: FreeBSD and the other BSD's by
-                       default it is impossible for the user running x11vnc to
-                       validate his *own* password via su(1) (commenting out
-                       the pam_self.so entry in /etc/pam.d/su eliminates this
-                       behavior).  So the x11vnc login will always *FAIL* for
-                       this case (even when the correct password is supplied).
-
-                       A possible workaround for this on *BSD would be to
-                       start x11vnc as root with the "-users +nobody" option
-                       to immediately switch to user nobody where the su'ing
-                       will proceed normally.
-
-                       Another source of potential problems are PAM modules
-                       that prompt for extra info, e.g. password aging modules.
-                       These logins will fail as well even when the correct
-                       password is supplied.
-
-                       **IMPORTANT**: to prevent the Unix password being sent
-                       in *clear text* over the network, one of two schemes
-                       will be enforced: 1) the -ssl builtin SSL mode, or 2)
-                       require both -localhost and -stunnel be enabled.
-
-                       Method 1) ensures the traffic is encrypted between
-                       viewer and server.  A PEM file will be required, see the
-                       discussion under -ssl below (under some circumstances
-                       a temporary one can be automatically generated).
-
-                       Method 2) requires the viewer connection to appear
-                       to come from the same machine x11vnc is running on
-                       (e.g. from a ssh -L port redirection).  And that the
-                       -stunnel SSL mode be used for encryption over the
-                       network. (see the description of -stunnel below).
-
-                       Note: as a convenience, if you ssh(1) in and start
-                       x11vnc it will check if the environment variable
-                       SSH_CONNECTION is set and appears reasonable.  If it
-                       does, then the -ssl or -stunnel requirement will be
-                       dropped since it is assumed you are using ssh for the
-                       encrypted tunnelling.  -localhost is still enforced.
-                       Use -ssl or -stunnel to force SSL usage even if
-                       SSH_CONNECTION is set.
-
-                       To override the above restrictions you can set
-                       environment variables before starting x11vnc:
-
-                       Set UNIXPW_DISABLE_SSL=1 to disable requiring either
-                       -ssl or -stunnel (as under SSH_CONNECTION.)  Evidently
-                       you will be using a different method to encrypt the
-                       data between the vncviewer and x11vnc: perhaps ssh(1)
-                       or an IPSEC VPN. -localhost is still enforced (however,
-                       see the next paragraph.)
-
-                       Set UNIXPW_DISABLE_LOCALHOST=1 to disable the -localhost
-                       requirement in -unixpw modes.  One should never do this
-                       (i.e. allow the Unix passwords to be sniffed on the
-                       network.)  This also disables the localhost requirement
-                       for reverse connections (see below.)
-
-                       Note that use of -localhost with ssh(1) (and no -unixpw)
-                       is roughly the same as requiring a Unix user login
-                       (since a Unix password or the user's public key
-                       authentication is used by sshd on the machine where
-                       x11vnc runs and only local connections from that machine
-                       are accepted).
-
-                       Regarding reverse connections (e.g. -R connect:host
-                       and -connect host), when the -localhost constraint is
-                       in effect then reverse connections can only be used
-                       to connect to the same machine x11vnc is running on
-                       (default port 5500).  Please use a ssh or stunnel port
-                       redirection to the viewer machine to tunnel the reverse
-                       connection over an encrypted channel.
-
-                       In -inetd mode the Method 1) will be enforced (not
-                       Method 2).  With -ssl in effect reverse connections
-                       are disabled.  If you override this via env. var, be
-                       sure to also use encryption from the viewer to inetd.
-                       Tip: you can also have your own stunnel spawn x11vnc
-                       in -inetd mode (thereby bypassing inetd).  See the FAQ
-                       for details.
-
-                       The user names in the comma separated [list] may have
-                       per-user options after a ":", e.g. "fred:opts"
-                       where "opts" is a "+" separated list of
-                       "viewonly", "fullaccess", "input=XXXX", or
-                       "deny", e.g. "karl,wally:viewonly,boss:input=M".
-                       For "input=" it is the K,M,B,C described under -input.
-
-                       If an item in the list is "*" that means those
-                       options apply to all users.  It ALSO implies all users
-                       are allowed to log in after supplying a valid password.
-                       Use "deny" to explicitly deny some users if you use
-                       "*" to set a global option.  If [list] begins with the
-                       "!" character then "*" is ignored for checking if
-                       the user is allowed, but the option values associated
-                       with it do apply as normal.
-
-                       There are also some utilities for checking passwords
-                       if [list] starts with the "%" character.  See the
-                       quick_pw() function for more details.  Description:
-                       "%-" or "%stdin" means read one line from stdin.
-                       "%env" means it is in $UNIXPW env var.  A leading
-                       "%/" or "%." means read the first line from the
-                       filename that follows after the % character. % by
-                       itself means prompt for the username and password.
-                       Otherwise: %user:pass   E.g. -unixpw %fred:swordfish
-                       For the other cases user:pass is read from the indicated
-                       source.  If the password is correct 'Y user' is printed
-                       and the program exit code is 0.  If the password is
-                       incorrect it prints 'N user' and the exit code is 1.
-                       If there is some other error the exit code is 2.
-                       This feature enables x11vnc to be a general unix user
-                       password checking tool; it could be used from scripts
-                       or other programs.  These % password checks also apply
-                       to the -unixpw_nis and -unixpw_cmd options.
-
-                       For the % password check, if the env. var. UNIXPW_CMD
-                       is set to a command then it is run as the user (assuming
-                       the password is correct.)  The output of the command is
-                       not printed, the program or script must manage that by
-                       some other means.  The exit code of x11vnc will depend
-                       on the exit code of the command that is run.
-
-                       Use -nounixpw to disable unixpw mode if it was enabled
-                       earlier in the cmd line (e.g. -svc mode)
-
--unixpw_nis [list]     As -unixpw above, however do not use su(1) but rather
-                       use the traditional getpwnam(3) + crypt(3) method to
-                       verify passwords. All of the above -unixpw options and
-                       constraints apply.
-
-                       This mode requires that the encrypted passwords be
-                       readable.  Encrypted passwords stored in /etc/shadow
-                       will be inaccessible unless x11vnc is run as root.
-
-                       This is called "NIS" mode simply because in most
-                       NIS setups user encrypted passwords are accessible
-                       (e.g. "ypcat passwd") by an ordinary user and so that
-                       user can authenticate ANY user.
-
-                       NIS is not required for this mode to work (only that
-                       getpwnam(3) return the encrypted password is required),
-                       but it is unlikely it will work (as an ordinary user)
-                       for most modern environments unless NIS is available.
-                       On the other hand, when x11vnc is run as root it will
-                       be able to to access /etc/shadow even if NIS is not
-                       available (note running as root is often done when
-                       running x11vnc from inetd and xdm/gdm/kdm).
-
-                       Looked at another way, if you do not want to use the
-                       su(1) method provided by -unixpw (i.e. su_verify()), you
-                       can run x11vnc as root and use -unixpw_nis.  Any users
-                       with passwords in /etc/shadow can then be authenticated.
-
-                       In -unixpw_nis mode, under no circumstances is x11vnc's
-                       user password verifying function based on su called
-                       (i.e. the function su_verify() that runs /bin/su
-                       in a pseudoterminal to verify passwords.)  However,
-                       if -unixpw_nis is used in conjunction with the -find
-                       and -create -display WAIT:... modes then, if x11vnc is
-                       running as root, /bin/su may be called externally to
-                       run the find or create commands.
-
--unixpw_cmd cmd        As -unixpw above, however do not use su(1) but rather
-                       run the externally supplied command "cmd".  The first
-                       line of its stdin will be the username and the second
-                       line the received password.  If the command exits
-                       with status 0 (success) the VNC user will be accepted.
-                       It will be rejected for any other return status.
-
-                       Dynamic passwords and non-unix passwords, e.g. LDAP,
-                       can be implemented this way by providing your own custom
-                       helper program.  Note that the remote viewer is given 3
-                       tries to enter the correct password, and so the program
-                       may be called in a row that many (or more) times.
-
-                       If a list of allowed users is needed to limit who can
-                       log in, use -unixpw [list] in addition to this option.
-
-                       In FINDDISPLAY and FINDCREATEDISPLAY modes the "cmd"
-                       will also be run with the RFB_UNIXPW_CMD_RUN env. var.
-                       non-empty and set to the corresponding display
-                       find/create command.  The first two lines of input are
-                       the username and passwd as in the normal case described
-                       above.  To support FINDDISPLAY and FINDCREATEDISPLAY,
-                       "cmd" should run the requested command as the user
-                       (and most likely refusing to run it if the password is
-                       not correct.)  Here is an example script (note it has
-                       a hardwired bogus password "abc"!)
-
-                         #!/bin/sh
-                         # Example x11vnc -unixpw_cmd script.
-                         # Read the first two lines of stdin (user and passwd)
-                         read user
-                         read pass
-
-                         debug=0
-                         if [ $debug = 1 ]; then
-                                echo "user: $user" 1>&2
-                                echo "pass: $pass" 1>&2
-                                env | egrep -i 'rfb|vnc' 1>&2
-                         fi
-
-                         # Check if the password is valid.
-                         # (A real example would use ldap lookup, etc!)
-                         if [ "X$pass" != "Xabc" ]; then
-                                exit 1  # incorrect password
-                         fi
-
-                         if [ "X$RFB_UNIXPW_CMD_RUN" = "X" ]; then
-                                exit 0  # correct password
-                         else
-                                # Run the requested command (finddisplay)
-                                if [ $debug = 1 ]; then
-                                        echo "run: $RFB_UNIXPW_CMD_RUN" 1>&2
-                                fi
-                                exec /bin/su - "$user" -c "$RFB_UNIXPW_CMD_RUN"
-                         fi
-
-                       In -unixpw_cmd mode, under no circumstances is x11vnc's
-                       user password verifying function based on su called
-                       (i.e. the function su_verify() that runs /bin/su in a
-                       pseudoterminal to verify passwords.)  It is up to the
-                       supplied unixpw_cmd to do user switching if desired
-                       and if it has the permissions to do so.
-
--find                  Find the user's display using FINDDISPLAY. This
-                       is an alias for "-display WAIT:cmd=FINDDISPLAY".
-
-                       Note: if a -display occurs later on the command line
-                       it will override the -find setting.
-
-                       For this and the next few options see -display WAIT:...
-                       below for all of the details.
-
--finddpy               Run the FINDDISPLAY program, print out the found
-                       display (if any) and exit.  Output is like: DISPLAY=:0.0
-                       DISPLAY=:0.0,XPID=12345 or DISPLAY=:0.0,VT=7.  XPID is
-                       the process ID of the found X server.  VT is the Linux
-                       virtual terminal of the X server.
--listdpy               Have the FINDDISPLAY program list all of your displays
-                       (i.e. all the X displays on the local machine that you
-                       have access rights to).  x11vnc then exits.
-
--findauth [disp]       Apply the -find/-finddpy heuristics to try to guess
-                       the XAUTHORITY file for DISPLAY 'disp'.  If 'disp'
-                       is not supplied, then the value in the -display on
-                       the cmdline is used; failing that $DISPLAY is used;
-                       and failing that ":0" is used.  x11vnc then exits.
-
-                       If nothing is printed out, that means no XAUTHORITY was
-                       found for 'disp'; i.e. failure.  If "XAUTHORITY="
-                       is printed out, that means use the default (i.e. do
-                       not set XAUTHORITY).  If "XAUTHORITY=/path/to/file"
-                       is printed out, then use that file.
-
-                       XDM/GDM/KDM: if you are running x11vnc as root and want
-                       to find the XAUTHORITY before anyone has logged into an
-                       X session yet, use: x11vnc -env FD_XDM=1 -findauth ...
-                       (This will also find the XAUTHORITY if a user is already
-                       logged into the X session.)  When running as root,
-                       FD_XDM=1 will be tried if the initial -findauth fails.
-
--create                First try to find the user's display using FINDDISPLAY,
-                       if that doesn't succeed create an X session via the
-                       FINDCREATEDISPLAY method.  This is an alias for
-                       "-display WAIT:cmd=FINDCREATEDISPLAY-Xvfb".
-
-                       Note: if a -display occurs later on the command line
-                       it will override the -create setting.
-
-                       SSH NOTE: for both -find and -create you can (should!)
-                       add the "-localhost" option to force SSH tunnel access.
-
--xdummy                As in -create, except Xdummy instead of Xvfb.
--xvnc                  As in -create, except Xvnc instead of Xvfb.
--xvnc_redirect         As in -create, except Xvnc.redirect instead of Xvfb.
--xdummy_xvfb           Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb
-
--create_xsrv str       Sets WAIT:cmd=FINDCREATEDISPLAY-<str>  Can be on cmdline
-                       after anything that sets WAIT:.. and other things
-                       (e.g. -svc, -xdmsvc) to adjust the X server list.
-                       Example: -svc ... -create_xsrv Xdummy,X
-
--svc                   Terminal services mode based on SSL access.  Alias for
-                       -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users
-                       unixpw= -ssl SAVE   Also "-service".
-
-                       Note: if a -display, -unixpw, -users, or -ssl occurs
-                       later on the command line it will override the -svc
-                       setting.
-
--svc_xdummy            As -svc except Xdummy instead of Xvfb.
--svc_xvnc              As -svc except Xvnc instead of Xvfb.
--svc_xdummy_xvfb       As -svc with Xdummy,Xvfb.
-
--xdmsvc                Display manager Terminal services mode based on SSL.
-                       Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp
-                       -unixpw -users unixpw= -ssl SAVE  Also "-xdm_service".
-
-                       Note: if a -display, -unixpw, -users, or -ssl occurs
-                       later on the command line it will override the -xdmsvc
-                       setting.
-
-                       To create a session a user will have to first log in
-                       to the -unixpw dialog and then log in again to the
-                       XDM/GDM/KDM prompt.  Subsequent re-connections will
-                       only require the -unixpw password.  See the discussion
-                       under -display WAIT:... for more details about XDM,
-                       etc configuration.
-
-                       Remember to enable XDMCP in the xdm-config, gdm.conf,
-                       or kdmrc configuration file.  See -display WAIT: for
-                       more info.
-
--sshxdmsvc             Display manager Terminal services mode based on SSH.
-                       Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp
-                       -localhost.
-
-                       The -localhost option constrains connections to come
-                       in via a SSH tunnel (which will require a login).
-                       To create a session a user will also have to log into
-                       the XDM GDM KDM prompt. Subsequent re-connections will
-                       only only require the SSH login.  See the discussion
-                       under -display WAIT:... for more details about XDM,
-                       etc configuration.
-
-                       Remember to enable XDMCP in the xdm-config, gdm.conf,
-                       or kdmrc configuration file.  See -display WAIT: for
-                       more info.
-
--unixpw_system_greeter Present a "Press 'Escape' for System Greeter" option
-                       to the connecting VNC client in combined -unixpw
-                       and xdmcp FINDCREATEDISPLAY modes (e.g. -xdmsvc).
-
-                       Normally in a -unixpw mode the VNC client must
-                       supply a valid username and password to gain access.
-                       However, if -unixpw_system_greeter is supplied AND
-                       the FINDCREATEDISPLAY command matches 'xdmcp', then
-                       the user has the option to press Escape and then get a
-                       XDM/GDM/KDM login/greeter panel instead. They will then
-                       supply a username and password directly to the greeter.
-
-                       Otherwise, in xdmcp FINDCREATEDISPLAY mode the user
-                       must supply his username and password TWICE.  First to
-                       the initial unixpw login dialog, and second to the
-                       subsequent XDM/GDM/KDM greeter.  Note that if the user
-                       re-connects and supplies his username and password in
-                       the unixpw dialog the xdmcp greeter is skipped and
-                       he is connected directly to his existing X session.
-                       So the -unixpw_system_greeter option avoids the extra
-                       password at X session creation time.
-
-                       Example:  x11vnc -xdmsvc -unixpw_system_greeter
-                       See -unixpw and -display WAIT:... for more info.
-
-                       The special options after a colon at the end of the
-                       username (e.g. user:solid) described under -display
-                       WAIT: are also applied in this mode if they are typed
-                       in before the user hits Escape.  The username is ignored
-                       but the colon options are not.
-
-                       The default message is 2 lines in a small font, set
-                       the env. var. X11VNC_SYSTEM_GREETER1=true for a 1 line
-                       message in a larger font.
-
-                       If the user pressed Escape the FINDCREATEDISPLAY command
-                       will be run with the env. var. X11VNC_XDM_ONLY=1.
-
-                       Remember to enable XDMCP in the xdm-config, gdm.conf,
-                       or kdmrc configuration file.  See -display WAIT: for
-                       more info.
-
--redirect port         As in FINDCREATEDISPLAY-Xvnc.redirect mode except
-                       redirect immediately (i.e. without X session finding
-                       or creation) to a VNC server listening on port. You
-                       can also supply host:port to redirect to a different
-                       machine.
-
-                       If 0 <= port < 200 it is taken as a VNC display (5900 is
-                       added to get the actual port), if port < 0 then -port
-                       is used.
-
-                       Probably the only reason to use the -redirect option
-                       is in conjunction with SSL support, e.g. -ssl SAVE.
-                       This provides an easy way to add SSL encryption to a VNC
-                       server that does not support SSL (e.g. Xvnc or vnc.so)
-                       In fact, the protocol does not even need to be VNC,
-                       and so "-rfbport port1 -ssl SAVE -redirect host:port2"
-                       can act as a replacement for stunnel(1).
-
-                       This mode only allows one redirected connection.
-                       The -forever option does not apply.  Use -inetd or
-                       -loop for persistent service.
-
--display_WAIT :...      A special usage mode for the normal -display option.
-                       Useful with -unixpw, but can be used independently
-                       of it.  If the display string begins with WAIT: then
-                       x11vnc waits until a VNC client connects before opening
-                       the X display (or -rawfb device).
-
-                       This could be useful for delaying opening the display
-                       for certain usage modes (say if x11vnc is started at
-                       boot time and no X server is running or users logged
-                       in yet).
-
-                       If the string is, e.g. WAIT:0.0 or WAIT:1, i.e. "WAIT"
-                       in front of a normal X display, then that indicated
-                       display is used.
-
-                       One can also insert a geometry between colons, e.g.
-                       WAIT:1280x1024:... to set the size of the display the
-                       VNC client first attaches to since some VNC viewers
-                       will not automatically adjust to a new framebuffer size.
-
-                       A more interesting case is like this:
-
-                            WAIT:cmd=/usr/local/bin/find_display
-
-                       in which case the command after "cmd=" is run to
-                       dynamically work out the DISPLAY and optionally the
-                       XAUTHORITY data.  The first line of the command output
-                       must be of the form DISPLAY=<xdisplay>.  On Linux
-                       if the virtual terminal is known append ",VT=n" to
-                       this string and the chvt(1) program will also be run.
-                       Any remaining output is taken as XAUTHORITY data.
-                       It can be either of the form XAUTHORITY=<file> or raw
-                       xauthority data for the display. For example;
-
-                            xauth extract - $DISPLAY"
-
-                       NOTE: As specified in the previous paragraph, you can
-                       supply your own WAIT:cmd=... program or script, BUT
-                       there are two very useful *BUILT-IN* ones: FINDDISPLAY
-                       (alias -find above) and FINDCREATEDISPLAY (alias -create
-                       above.)  Most people use these instead of creating
-                       their own script.  Read the following (especially the
-                       BUILT-IN modes sections) to see how to configure these
-                       two useful builtin -display WAIT: modes.
-
-                       In the case of -unixpw (and -unixpw_nis only if x11vnc
-                       is running as root), then the cmd= command is run
-                       as the user who just authenticated via the login and
-                       password prompt.
-
-                       In the case of -unixpw_cmd, the commands will also be
-                       run as the logged-in user, as long as the user-supplied
-                       helper program supports RFB_UNIXPW_CMD_RUN (see the
-                       -unixpw_cmd option.)
-
-                       Also in the case of -unixpw, the user logging in can
-                       place a colon at the end of her username and supply
-                       a few options: scale=, scale_cursor= (or sc=), solid
-                       (or so), id=, clear_mods (or cm), clear_keys (or
-                       ck), clear_all (or ca), repeat, speeds= (or sp=),
-                       readtimeout= (or rd=), viewonly (or vo), nodisplay=
-                       (or nd=), rotate= (or ro=), or noncache (or nc),
-                       all separated by commas if there is more than one.
-                       After the user logs in successfully, these options will
-                       be applied to the VNC screen.  For example,
-
-                          login: fred:scale=3/4,sc=1,repeat
-                          Password: ...
-
-                          login: runge:sp=modem,rd=120,solid
-
-                       for convenience m/n implies scale= e.g. fred:3/4  If you
-                       type and enter your password incorrectly, to retrieve
-                       your long "login:" line press the Up arrow once
-                       (before typing anything else).
-
-                       Most of these colon options only apply to the builtin
-                       FINDDISPLAY and FINDCREATEDISPLAY modes, but note
-                       that they are passed to the extrenal command in the
-                       environment as well and so could be used.
-
-                       In the login panel, press F1 to get a list of the
-                       available options that you can add after the username.
-
-                       Another option is "geom=WxH" or "geom=WxHxD" (or
-                       ge=). This only has an effect in FINDCREATEDISPLAY
-                       mode when a virtual X server such as Xvfb is going
-                       to be created.  It sets the width and height of
-                       the new display, and optionally the color depth as
-                       well.
-
-                       You can also supply "gnome", "kde", "twm",
-                       "fvwm", "mwm", "dtwm", "wmaker", "xfce",
-                       "lxde", "enlightenment", "Xsession", or
-                       "failsafe" (same as "xterm") to have the created
-                       display use that mode for the user session.
-
-                       Specify "tag=..." to set the unique FD_TAG desktop
-                       session tag described below.  Note: this option will
-                       be ignored if the FD_TAG env. var. is already set or
-                       if the viewer-side supplied value is not completely
-                       composed of alphanumeric or '_' or '-' characters.
-
-                       User preferences file: Instead of having the user type
-                       in geom=WxH,... etc. every time he logs in to find
-                       or create his X session, if you set FD_USERPREFS to
-                       a string that does not contain the "/" character,
-                       then the user's home directory is prepended to that
-                       string and if the file exists its first line is read
-                       and appended to any options he supplied at the login:
-                       prompt.  For example -env FD_USERPREFS=.x11vnc_create
-                       and the user put "geom=1600x1200" in his
-                       ~/.x11vnc_create file.
-
-                       To disable the option setting set the environment
-                       variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
-                       To set any other options, the user can use the gui
-                       (x11vnc -gui connect) or the remote control method
-                       (x11vnc -R opt:val) during his VNC session.
-
-                       So we see the combination of -display WAIT:cmd=... and
-                       -unixpw allows automatic pairing of an unix
-                       authenticated VNC user with his desktop.  This could
-                       be very useful on SunRays and also any system where
-                       multiple users share a given machine.  The user does
-                       not need to remember special ports or passwords set up
-                       for his desktop and VNC.
-
-                       A nice way to use WAIT:cmd=... is out of inetd(8)
-                       (it automatically forks a new x11vnc for each user).
-                       You can have the x11vnc inetd spawned process run as,
-                       say, root or nobody.  When run as root (for either inetd
-                       or display manager), you can also supply the option
-                       "-users unixpw=" to have the x11vnc process switch to
-                       the user as well.  Note: there will be a 2nd SSL helper
-                       process that will not switch, but it is only encoding
-                       and decoding the encrypted stream at that point.
-
-                       BUILT-IN modes:
-
-                       -- Automatic Finding of User X Sessions --
-
-                       As a special case, WAIT:cmd=FINDDISPLAY will run a
-                       script that works on most Unixes to determine a user's
-                       DISPLAY variable and xauthority data (see who(1)).
-
-                       NOTE: The option "-find" is an alias for this mode.
-
-                       To have this default script printed to stdout (e.g. for
-                       customization) run with WAIT:cmd=FINDDISPLAY-print To
-                       have the script run to print what display it would find
-                       use "-finddpy" or WAIT:cmd=FINDDISPLAY-run
-
-                       The standard script runs xdpyinfo(1) run on potential
-                       displays.  If your X server(s) have a login greeter
-                       that exclusively grabs the Xserver, then xdpyinfo
-                       blocks forever and this mode will not work.  See
-                       www.karlrunge.com/x11vnc/faq.html#faq-display-manager
-                       for how to disable this for dtgreet on Solaris and
-                       possibly for other greeters.
-
-                       In -find/cmd=FINDDISPLAY mode, if you set FD_XDM=1,
-                       e.g. 'x11vnc -env FD_XDM=1 -find ...' and x11vnc is
-                       running as root (e.g. inetd) then it will try to find
-                       the XAUTHORITY file of a running XDM/GDM/KDM login
-                       greeter (i.e. no user has logged into an X session yet.)
-
-                       As another special case, WAIT:cmd=HTTPONCE will allow
-                       x11vnc to service one http request and then exit.
-                       This is usually done in -inetd mode to run on, say,
-                       port 5800 and allow the Java vncviewer to be downloaded
-                       by client web browsers.  For example:
-
-                        5815 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc
-\
-                          -inetd -q -http_ssl -prog /.../x11vnc \
-                          -display WAIT:cmd=HTTPONCE
-
-                       Where /.../x11vnc is the full path to x11vnc.
-                       It is used in the Apache SSL-portal example (see FAQ).
-
-                       In this mode you can set X11VNC_SKIP_DISPLAY to a
-                       comma separated list of displays (e.g. ":0,:1") to
-                       ignore in the finding process.  The ":" is optional.
-                       Ranges n-m e.g. 0-20 can also be supplied. This string
-                       can also be set by the connecting user via "nd="
-                       using "+" instead of ","  If "nd=all" or you set
-                       X11VNC_SKIP_DISPLAY=all then all display finding fails
-                       as if you set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below.)
-
-                       On some systems lsof(1) can be very slow.  Set the
-                       env. var. FIND_DISPLAY_NO_LSOF=1 to skip using lsof to
-                       try to find the Linux VT the X server is running on.
-                       set FIND_DISPLAY_NO_VT_FIND=1 to avoid looking at all.
-
-                       -- Automatic Creation of User X Sessions --
-
-                       An interesting option is WAIT:cmd=FINDCREATEDISPLAY
-                       that is like FINDDISPLAY in that is uses the same method
-                       to find an existing display.  However, if it does not
-                       find one it will try to *start* up an X server session
-                       for the user.  This is the only time x11vnc tries to
-                       actually start up an X server.
-
-                       NOTE: The option "-create" is an alias for this mode.
-
-                       It will start looking for an open display number at :20
-                       Override via X11VNC_CREATE_STARTING_DISPLAY_NUMBER=n
-                       By default 80 X displays are allowed (i.e. going to :99)
-                       Override via X11VNC_CREATE_MAX_DISPLAYS=n
-
-                       For its heuristics, the create display script sets
-                       LC_ALL=C so that command output is uniform.  By default
-                       it will try to restore LC_ALL right before starting the
-                       user session.  However, if you don't mind it keeping
-                       LC_ALL=C set the env. var.: X11VNC_CREATE_LC_ALL_C_OK=1
-
-                       By default FINDCREATEDISPLAY will try Xvfb and then
-                       Xdummy:
-
-                       The Xdummy wrapper is part of the x11vnc source code
-                       (x11vnc/misc/Xdummy)  It should be available in PATH
-                       and have run "Xdummy -install" once to create the
-                       shared library.  Xdummy only works on Linux.  As of
-                       12/2009 it no longer needs to be run as root, and the
-                       default is to not run as root.  In some circumstances
-                       permissions may require running it as root, in these
-                       cases specify FD_XDUMMY_RUN_AS_ROOT=1, this is the same
-                       as supplying -root to the Xdummy cmdline.
-
-                       Xvfb is available on most platforms and does not
-                       require root.
-
-                       An advantage of Xdummy over Xvfb is that Xdummy supports
-                       RANDR dynamic screen resizing.
-
-                       When x11vnc exits (i.e. user disconnects) the X
-                       server session stays running in the background.
-                       The FINDDISPLAY will find it directly next time.
-                       The user must exit the X session in the usual way for
-                       it to terminate (or kill the X server process if all
-                       else fails).
-
-                       To troubleshoot the FINDCREATEDISPLAY mechanism,
-                       set the following env. var. to an output log file,
-                       e.g -env CREATE_DISPLAY_OUTPUT=/tmp/mydebug.txt
-
-                       So this is a somewhat odd mode for x11vnc in that it
-                       will start up and poll virtual X servers!  This can
-                       be used from, say, inetd(8) to provide a means of
-                       definitely getting a desktop (either real or virtual)
-                       on the machine.  E.g. a desktop service:
-
-                         5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc
-                          -inetd -q -http -ssl SAVE -unixpw -users unixpw=\
-                          -passwd secret -prog /.../x11vnc \
-                          -display WAIT:cmd=FINDCREATEDISPLAY
-
-                       Where /.../x11vnc is the full path to x11vnc.
-
-                       See the -svc/-service option alias above.
-
-                       If for some reason you do not want x11vnc to ever
-                       try to find an existing display set the env. var
-                       X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (also -env ...)
-                       This is the same as setting X11VNC_SKIP_DISPLAY=all or
-                       supplying "nd=all" after "username:"
-
-                       Use WAIT:cmd=FINDCREATEDISPLAY-print to print out the
-                       script that is used for this.
-
-                       You can specify the preferred X server order via e.g.,
-                       WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X  and/or leave
-                       out ones you do not want.  The the case "X" means try
-                       to start up a real, hardware X server using xinit(1)
-                       or startx(1).  If there is already an X server running
-                       the X case may only work on Linux (see startx(1)).
-
-                       "Xvnc" will start up a VNC X server (real-
-                       or tight-vnc, e.g. use if Xvfb is not available).
-                       "Xsrv" will start up the server program in the
-                       variable "FD_XSRV" if it is non-empty. You can make
-                       this be a wrapper script if you like (it must handle :N,
-                       -geometry, and -depth and other X server options).
-
-                       You can set the environment variable FD_GEOM (or
-                       X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width
-                       and height and optionally the color depth of the
-                       created display.  You can also set FD_SESS to be the
-                       session (short name of the windowmanager: kde, gnome,
-                       twm, failsafe, etc.). FD_OPTS contains extra options
-                       to pass to the X server. You can also set FD_PROG to
-                       be the full path to the session/windowmanager program.
-
-                       More FD tricks:  FD_CUPS=port or FD_CUPS=host:port
-                       will set the cups printing environment.  Similarly for
-                       FD_ESD=port or FD_ESD=host:port for esddsp sound
-                       redirection.  Set FD_EXTRA to a command to be run a
-                       few seconds after the X server starts up.  Set FD_TAG
-                       to be a unique name for the session, it is set as an
-                       X property, that makes FINDDISPLAY only find sessions
-                       with that tag value.
-
-                       Set FD_XDMCP_IF to the network interface that the
-                       display manager is running on; default is 'localhost'
-                       but you may need to set it to '::1' on some IPv6 only
-                       systems or misconfigured display managers.
-
-                       If you want the FINDCREATEDISPLAY session to contact an
-                       XDMCP login manager (xdm/gdm/kdm) on the same machine,
-                       then use "Xvfb.xdmcp" instead of "Xvfb", etc.
-                       The user will have to supply his username and password
-                       one more time (but he gets to select his desktop type
-                       so that can be useful).  For this to work, you will
-                       need to enable localhost XDMCP (udp port 177) for the
-                       display manager.  This seems to be:
-
-                        for gdm in gdm.conf:   Enable=true in section [xdmcp]
-                        for kdm in kdmrc:      Enable=true in section [Xdmcp]
-                        for xdm in xdm-config: DisplayManager.requestPort: 177
-
-                       See the shorthand options above "-svc", "-xdmsvc"
-                       and "-sshxdmsvc" that specify the above options for
-                       some useful cases.
-
-                       If you set the env. var WAITBG=1 x11vnc will go into
-                       the background once listening in wait mode.
-
-                       Another special mode is FINDCREATEDISPLAY-Xvnc.redirect,
-                       (or FINDDISPLAY-Xvnc.redirect).  In this case it will
-                       start up Xvnc as above if needed, but instead of
-                       polling it in its normal way, it simply does a socket
-                       redirection of the connected VNC viewer to the Xvnc.
-
-                       So in Xvnc.redirect x11vnc does no VNC but merely
-                       transfers the data back and forth.  This should be
-                       faster then x11vnc's polling method, but not as fast
-                       as connecting directly to the Xvnc with the VNC Viewer.
-                       The idea here is to take advantage of x11vnc's display
-                       finding/creating scheme, SSL, and perhaps a few others.
-                       Most of x11vnc's options do not apply in this mode.
-
-                       Xvnc.redirect should also work for the vnc.so X server
-                       module for the h/w display however it will work only
-                       for finding the display and the user must already be
-                       logged into the X console.
-
--vencrypt mode         The VeNCrypt extension to the VNC protocol allows
-                       encrypted SSL/TLS connections.  If the -ssl mode is
-                       enabled, then VeNCrypt is enabled as well BY DEFAULT
-                       (they both use a SSL/TLS tunnel, only the protocol
-                       handshake is a little different.)
-
-                       To control when and how VeNCrypt is used, specify the
-                       mode string.  If mode is "never", then VeNCrypt is
-                       not used.  If mode is "support" (the default) then
-                       VeNCrypt is supported.  If mode is "only", then the
-                       similar and older ANONTLS protocol is not simultaneously
-                       supported.  x11vnc's normal SSL mode (vncs://) will be
-                       supported under -ssl unless you set mode to "force".
-
-                       If mode is prefixed with "nodh:", then Diffie Hellman
-                       anonymous key exchange is disabled.  If mode is prefixed
-                       with "nox509:", then X509 key exchange is disabled.
-
-                       To disable all Anonymous Diffie-Hellman access
-                       (susceptible to Man-In-The-Middle attack) you will need
-                       to supply "-vencrypt nodh:support -anontls never"
-                       or "-vencrypt nodh:only"
-
-                       If mode is prefixed with "newdh:", then new Diffie
-                       Hellman parameters are generated for each connection
-                       (this can be time consuming: 1-60 secs; see -dhparams
-                       below for a faster way) rather than using the
-                       fixed values in the program.  Using fixed, publicly
-                       known values is not known to be a security problem.
-                       This setting applies to ANONTLS as well.
-
-                       Long example: -vencrypt newdh:nox509:support
-
-                       Also, if mode is prefixed with "plain:", then
-                       if -unixpw mode is active the VeNCrypt "*Plain"
-                       username+passwd method is enabled for Unix logins.
-                       Otherwise in -unixpw mode the normal login panel is
-                       provided.
-
-                       You *MUST* supply the -ssl option for VeNCrypt to
-                       be active.  The -vencrypt option only fine-tunes its
-                       operation.
-
--anontls mode          The ANONTLS extension to the VNC protocol allows
-                       encrypted SSL/TLS connections.  If the -ssl mode is
-                       enabled, then ANONTLS is enabled as well BY DEFAULT
-                       (they both use a SSL/TLS tunnel, only the protocol
-                       handshake is a little different.)
-
-                       ANONTLS is an older SSL/TLS mode introduced by vino.
-
-                       It is referred to as 'TLS' for its registered VNC
-                       security-type name, but we use the more descriptive
-                       'ANONTLS' here because it provides only Anonymous
-                       Diffie-Hellman encrypted connections, and hence no
-                       possibility for certificate authentication.
-
-                       To control when and how ANONTLS is used, specify the
-                       mode string.  If mode is "never", then ANONTLS is not
-                       used.  If mode is "support" (the default) then ANONTLS
-                       is supported.  If mode is "only", then the similar
-                       VeNCrypt protocol is not simultaneously supported.
-                       x11vnc's normal SSL mode (vncs://) will be supported
-                       under -ssl unless you set mode to "force".
-
-                       If mode is prefixed with "newdh:", then new Diffie
-                       Hellman parameters are generated for each connection
-                       (this can be time consuming: 1-60 secs; see -dhparams
-                       below for a faster way) rather than using the
-                       fixed values in the program.  Using fixed, publicly
-                       known values is not known to be a security problem.
-                       This setting applies to VeNCrypt as well.  See the
-                       description of "plain:" under -vencrypt.
-
-                       Long example: -anontls newdh:plain:support
-
-                       You *MUST* supply the -ssl option for ANONTLS to
-                       be active.  The -anontls option only fine-tunes its
-                       operation.
-
--sslonly               Same as: "-vencrypt never -anontls never"  i.e. it
-                       disables the VeNCrypt and ANONTLS encryption methods
-                       and only allows standard SSL tunneling.  You must also
-                       supply the -ssl ... option (see below.)
-
-
--dhparams file         For some operations a set of Diffie Hellman parameters
-                       (prime and generator) is needed.  If so, use the
-                       parameters in "file". In particular, the VeNCrypt and
-                       ANONTLS anonymous DH mode need them.  By default a
-                       fixed set is used. If you do not want to do that you
-                       can specify "newdh:" to the -vencrypt and -anontls
-                       options to generate a new set each session.  If that
-                       is too slow for you, use -dhparams file to a set you
-                       created manually via "openssl dhparam -out file 1024"
-
--nossl                 Disable the -ssl option (see below). Since -ssl is off
-                       by default -nossl would only be used on the commandline
-                       to unset any *earlier* -ssl option (or -svc...)
-
--ssl [pem]             Use the openssl library (www.openssl.org) to provide a
-                       built-in encrypted SSL/TLS tunnel between VNC viewers
-                       and x11vnc.  This requires libssl support to be
-                       compiled into x11vnc at build time.  If x11vnc is not
-                       built with libssl support it will exit immediately when
-                       -ssl is prescribed.  See the -stunnel option below for
-                       an alternative.
-
-                       The VNC Viewer-side needs to support SSL/TLS as well.
-                       See this URL and also the discussion below for
-                       ideas on how to enable SSL support for the viewer:
-                       http://www.karlrunge.com/x11vnc/faq.html#faq-ssl-tun
-                       nel-viewers .  x11vnc provides an SSL enabled Java
-                       viewer applet in the classes/ssl directory (-http or
-                       -httpdir options.)  The SSVNC viewer package supports
-                       SSL tunnels too.
-
-                       If the VNC Viewer supports VeNCrypt or ANONTLS (vino's
-                       encryption mode) they are also supported by the -ssl
-                       mode (see the -vencrypt and -anontls options for more
-                       info; use -sslonly to disable both of them.)
-
-                       Use "-ssl /path/to/mycert.pem" to specify an SSL
-                       certificate file in PEM format to use to identify and
-                       provide a key for this server.  See openssl(1) for more
-                       info about PEMs and the -sslGenCert and "-ssl SAVE"
-                       options below for how to create them.
-
-                       The connecting VNC viewer SSL tunnel can (at its option)
-                       authenticate this server if it has the public key part
-                       of the certificate (or a common certificate authority,
-                       CA, is a more sophisticated way to verify this server's
-                       cert, see -sslGenCA below).  This authentication is
-                       done to prevent Man-In-The-Middle attacks.  Otherwise,
-                       if the VNC viewer simply accepts this server's key
-                       WITHOUT verification, the traffic is protected from
-                       passive sniffing on the network, but *NOT* from
-                       Man-In-The-Middle attacks. There are hacker tools
-                       like dsniff/webmitm and cain that implement SSL
-                       Man-In-The-Middle attacks.
-
-                       If [pem] is empty or the string "SAVE" then the
-                       openssl(1) command must be available to generate the
-                       certificate the first time.  A self-signed certificate
-                       is generated (see -sslGenCA and -sslGenCert for use
-                       of a Certificate Authority.)  It will be saved to the
-                       file ~/.vnc/certs/server.pem.  On subsequent calls if
-                       that file already exists it will be used directly.
-
-                       Use "SAVE_NOPROMPT" to avoid being prompted to
-                       protect the generated key with a passphrase.  However in
-                       -inetd and -bg modes there will be no prompting for a
-                       passphrase in either case.
-
-                       If [pem] is "SAVE_PROMPT" the server.pem certificate
-                       will be created based on your answers to its prompts for
-                       all info such as OrganizationalName, CommonName, etc.
-
-                       Use "SAVE-<string>" and "SAVE_PROMPT-<string>"
-                       to refer to the file ~/.vnc/certs/server-<string>.pem
-                       instead (it will be generated if it does not already
-                       exist).  E.g. "SAVE-charlie" will store to the file
-                       ~/.vnc/certs/server-charlie.pem
-
-                       Examples: x11vnc -ssl SAVE -display :0 ...
-                                 x11vnc -ssl SAVE-someother -display :0 ...
-
-                       If [pem] is "TMP" and the openssl(1) utility
-                       command exists in PATH, then a temporary, self-signed
-                       certificate will be generated for this session.  If
-                       openssl(1) cannot be used to generate a temporary
-                       certificate x11vnc exits immediately.  The temporary
-                       cert will be discarded when x11vnc exits.
-
-                       If successful in using openssl(1) to generate a
-                       temporary certificate in "SAVE" or "TMP" creation
-                       modes, the public part of it will be displayed to stderr
-                       (e.g. one could copy it to the client-side to provide
-                       authentication of the server to VNC viewers.)
-
-                       NOTE: In "TMP" mode, unless you safely copy the
-                       public part of the temporary Cert to the viewer for
-                       authenticate *every time* (unlikely...), then only
-                       passive sniffing attacks are prevented and you are
-                       still open to Man-In-The-Middle attacks.  This is
-                       why the default "SAVE" mode is preferred (and more
-                       sophisticated CA mode too).  Only with saved keys AND
-                       the VNC viewer authenticating them (via the public
-                       certificate), are Man-In-The-Middle attacks prevented.
-
-                       If [pem] is "ANON" then the Diffie-Hellman anonymous
-                       key exchange method is used.  In this mode there
-                       are *no* SSL certificates and so it is not possible
-                       to authenticate either the VNC server or VNC client.
-                       Thus only passive network sniffing attacks are avoided:
-                       the "ANON" method is susceptible to Man-In-The-Middle
-                       attacks.  "ANON" is not recommended; instead use
-                       a SSL PEM you created or the default "SAVE" method.
-
-                       See -ssldir below to use a directory besides the
-                       default ~/.vnc/certs
-
-                       If your x11vnc binary was not compiled with OpenSSL
-                       library support, use of the -ssl option will induce an
-                       immediate failure and exit.  For such binaries, consider
-                       using the -stunnel option for SSL encrypted connections.
-
-                       Misc Info: In temporary cert creation mode "TMP", set
-                       the env. var. X11VNC_SHOW_TMP_PEM=1 to have x11vnc print
-                       out the entire certificate, including the PRIVATE KEY
-                       part, to stderr.  There are better ways to get/save this
-                       info.  See "SAVE" above and "-sslGenCert" below.
-
--ssltimeout n          Set SSL read timeout to n seconds.  In some situations
-                       (i.e. an iconified viewer in Windows) the viewer stops
-                       talking and the connection is dropped after the default
-                       timeout (25s for about the first minute, 43200s later).
-                       Set to zero to poll forever.  Set to a negative value
-                       to use the builtin setting.
-
-                       Note that this value does NOT apply to the *initial* ssl
-                       init connection.  The default timeout for that is 20sec.
-                       Use -env SSL_INIT_TIMEOUT=n to modify it.
-
--sslnofail             Exit at the first SSL connection failure. Useful when
-                       scripting SSL connections (e.g. x11vnc is started via
-                       ssh) and you do not want x11vnc waiting around for more
-                       connections, tying up ports, etc.
-
--ssldir dir            Use "dir" as an alternate ssl certificate and key
-                       management toplevel directory.  The default is
-                       ~/.vnc/certs
-
-                       This directory is used to store server and other
-                       certificates and keys and also other materials.  E.g. in
-                       the simplest case, "-ssl SAVE" will store the x11vnc
-                       server cert in dir/server.pem
-
-                       Use of alternate directories via -ssldir allows you to
-                       manage multiple VNC Certificate Authority (CA) keys.
-                       Another use is if ~/.vnc/cert is on an NFS share you
-                       might want your certificates and keys to be on a local
-                       filesystem to prevent network snooping (for example
-                       -ssldir /var/lib/x11vnc-certs).
-
-                       -ssldir affects nearly all of the other -ssl* options,
-                       e.g. -ssl SAVE, -sslGenCert, etc..
-
--sslverify path        For either of the -ssl or -stunnel modes, use "path"
-                       to provide certificates to authenticate incoming VNC
-                       *Client* connections (normally only the server is
-                       authenticated in SSL.)  This can be used as a method
-                       to replace standard password authentication of clients.
-
-                       If "path" is a directory it contains the client (or CA)
-                       certificates in separate files.  If path is a file,
-                       it contains one or more certificates. See special tokens
-                       below.  These correspond to the "CApath = dir" and
-                       "CAfile = file" stunnel options.  See the stunnel(8)
-                       manpage for details.
-
-                       Examples:
-                              x11vnc -ssl -sslverify ~/my.crt
-                              x11vnc -ssl -sslverify ~/my_pem_dir/
-
-                       Note that if path is a directory, it must contain
-                       the certs in separate files named like <HASH>.0, where
-                       the value of <HASH> is found by running the command
-                       "openssl x509 -hash -noout -in file.crt". Evidently
-                       one uses <HASH>.1 if there is a collision...
-
-                       The the key-management utility "-sslCertInfo HASHON"
-                       and "-sslCertInfo HASHOFF" will create/delete these
-                       hashes for you automatically (via symlink) in the HASH
-                       subdirs it manages.  Then you can point -sslverify to
-                       the HASH subdir.
-
-                       Special tokens: in -ssl mode, if "path" is not a file or
-                       a directory, it is taken as a comma separated list of
-                       tokens that are interpreted as follows:
-
-                       If a token is "CA" that means load the CA/cacert.pem
-                       file from the ssl directory.  If a token is "clients"
-                       then all the files clients/*.crt in the ssl directory
-                       are loaded.  Otherwise the file clients/token.crt
-                       is attempted to be loaded.  As a kludge, use a token
-                       like ../server-foo to load a server cert if you find
-                       that necessary.
-
-                       Use -ssldir to use a directory different from the
-                       ~/.vnc/certs default.
-
-                       Note that if the "CA" cert is loaded you do not need
-                       to load any of the certs that have been signed by it.
-                       You will need to load any additional self-signed certs
-                       however.
-
-                       Examples:
-                              x11vnc -ssl -sslverify CA
-                              x11vnc -ssl -sslverify self:fred,self:jim
-                              x11vnc -ssl -sslverify CA,clients
-
-                       Usually "-sslverify CA" is the most effective.
-                       See the -sslGenCA and -sslGenCert options below for
-                       how to set up and manage the CA framework.
-
-
-
-                       NOTE: the following utilities, -sslGenCA, -sslGenCert,
-                       -sslEncKey, -sslCertInfo, and -sslCRL are provided for
-                       completeness, but for casual usage they are overkill.
-
-                       They provide VNC Certificate Authority (CA) key creation
-                       and server / client key generation and signing.  So they
-                       provide a basic Public Key management framework for
-                       VNC-ing with x11vnc. (note that they require openssl(1)
-                       be installed on the system)
-
-                       However, the simplest usage mode, "-ssl TMP" (where
-                       x11vnc automatically generates its own, self-signed,
-                       temporary key and the VNC viewers always accept it,
-                       e.g. accepting via a dialog box) is probably safe enough
-                       for most scenarios.  CA management is not needed.
-
-                       To protect against Man-In-The-Middle attacks the "TMP"
-                       mode can be improved by using "-ssl SAVE" (same as
-                       "-ssl", i.e. the default) to have x11vnc create a
-                       longer term self-signed certificate, and then (safely)
-                       copy the corresponding public key cert to the desired
-                       client machines (care must be taken the private key part
-                       is not stolen; you will be prompted for a passphrase).
-
-                       So keep in mind no CA key creation or management
-                       (-sslGenCA and -sslGenCert) is needed for either of
-                       the above two common usage modes.
-
-                       One might want to use -sslGenCA and -sslGenCert
-                       if you had a large number of VNC client and server
-                       workstations.  That way the administrator could generate
-                       a single CA key with -sslGenCA and distribute its
-                       certificate part to all of the workstations.
-
-                       Next, he could create signed VNC server keys
-                       (-sslGenCert server ...) for each workstation or user
-                       that then x11vnc would use to authenticate itself to
-                       any VNC client that has the CA cert.
-
-                       Optionally, the admin could also make it so the
-                       VNC clients themselves are authenticated to x11vnc
-                       (-sslGenCert client ...)  For this -sslverify would be
-                       pointed to the CA cert (and/or self-signed certs).
-
-                       x11vnc will be able to use all of these cert and
-                       key files.  On the VNC client side, they will need to
-                       be "imported" somehow.  Web browsers have "Manage
-                       Certificates" actions as does the Java applet plugin
-                       Control Panel.  stunnel can also use these files (see
-                       the ss_vncviewer example script in the FAQ and SSVNC.)
-
--sslCRL path           Set the Certificate Revocation Lists (CRL) to "path".
-                       This setting applies for both -ssl and -stunnel modes.
-
-                       If path is a file, the file contains one or more CRLs
-                       in PEM format.  If path is a directory, it contains
-                       hash named files of CRLs in the usual OpenSSL manner.
-                       See the OpenSSL and stunnel(8) documentation for
-                       more info.
-
-                       This option only applies if -sslverify has been
-                       supplied: it checks for revocation along the
-                       certificate chain used to verify the VNC client.
-                       The -sslCRL setting will be ignored when -sslverify is
-                       not specified.
-
-                       Note that if a CRL's expiration date has passed, all
-                       SSL connections will fail regardless of if they are
-                       related to the subject of the CRL or not.
-
-                       Only rarely will one's x11vnc -ssl infrastructure be so
-                       large that this option would be useful (since normally
-                       maintaining the contents of the -sslverify file or
-                       directory should be enough.)  However, when using
-                       x11vnc with a Certificate Authority (see -sslGenCA)
-                       to authenticate Clients via SSL/TLS, the -sslCRL option
-                       can be useful to revoke users' certs whose private SSL
-                       keys were lost or stolen (e.g. laptop.)  This way a new
-                       CA cert+key does not need to be created and new signed
-                       client keys generated and distributed to all users.
-
-                       To create a CRL file with revoked certificates the
-                       commands 'openssl ca -revoke ...' and 'openssl ca
-                       -gencrl ...' are useful.  (Run them in ~/.vnc/certs)
-
--sslGenCA [dir]        Generate your own Certificate Authority private key,
-                       certificate, and other files in directory [dir].
-                       x11vnc then exits.
-
-                       If [dir] is not supplied, a -ssldir setting is used,
-                       or otherwise ~/.vnc/certs is used.
-
-                       This command also creates directories where server and
-                       client certs and keys will be stored.  The openssl(1)
-                       program must be installed on the system and available
-                       in PATH.
-
-                       After the CA files and directories are created the
-                       x11vnc command exits; the VNC server is not run.
-
-                       You will be prompted for information to put into the CA
-                       certificate.  The info does not have to be accurate just
-                       as long as clients accept the cert for VNC connections.
-                       You will also need to supply a passphrase of at least
-                       4 characters for the CA private key.
-
-                       Once you have generated the CA you can distribute
-                       its certificate part, [dir]/CA/cacert.pem, to other
-                       workstations where VNC viewers will be run.  One will
-                       need to "import" this certificate in the applications,
-                       e.g. Web browser, Java applet plugin, stunnel, etc.
-                       Next, you can create and sign keys using the CA with
-                       the -sslGenCert option below.
-
-                       Examples:
-                                x11vnc -sslGenCA
-                                x11vnc -sslGenCA  ~/myCAdir
-                                x11vnc -ssldir ~/myCAdir -sslGenCA
-
-                       (the last two lines are equivalent)
-
--sslGenCert type name  Generate a VNC server or client certificate and private
-                       key pair signed by the CA created previously with
-                       -sslGenCA.  The openssl(1) program must be installed
-                       on the system and available in PATH.
-
-                       After the Certificate is generated x11vnc exits; the
-                       VNC server is not run.
-
-                       The type of key to be generated is the string "type".
-                       It is either "server" (i.e. for use by x11vnc) or
-                       "client" (for a VNC viewer).  Note that typically
-                       only "server" is used: the VNC clients authenticate
-                       themselves by a non-public-key method (e.g. VNC or
-                       unix password).  "type" is required.
-
-                       An arbitrary default name you want to associate with
-                       the key is supplied by the "name" string.  You can
-                       change it at the various prompts when creating the key.
-                       "name" is optional.
-
-                       If name is left blank for clients keys then "nobody"
-                       is used.  If left blank for server keys, then the
-                       primary server key: "server.pem" is created (this
-                       is the saved one referenced by "-ssl SAVE" when the
-                       server is started)
-
-                       If "name" begins with the string "self:" then
-                       a self-signed certificate is created instead of one
-                       signed by your CA key.
-
-                       If "name" begins with the string "req:" then only a
-                       key (.key) and a certificate signing *request* (.req)
-                       are generated.  You can then send the .req file to
-                       an external CA (even a professional one, e.g. Thawte)
-                       and then combine the .key and the received cert into
-                       the .pem file with the same basename.
-
-                       The distinction between "server" and "client" is
-                       simply the choice of output filenames and sub-directory.
-                       This makes it so the -ssl SAVE-name option can easily
-                       pick up the x11vnc PEM file this option generates.
-                       And similarly makes it easy for the -sslverify option
-                       to pick up your client certs.
-
-                       There is nothing special about the filename or directory
-                       location of either the "server" and "client" certs.
-                       You can rename the files or move them to wherever
-                       you like.
-
-                       Precede this option with -ssldir [dir] to use a
-                       directory other than the default ~/.vnc/certs You will
-                       need to run -sslGenCA on that directory first before
-                       doing any -sslGenCert key creation.
-
-                       Note you cannot recreate a cert with exactly the same
-                       distiguished name (DN) as an existing one.  To do so,
-                       you will need to edit the [dir]/CA/index.txt file to
-                       delete the line.
-
-                       Similar to -sslGenCA, you will be prompted to fill
-                       in some information that will be recorded in the
-                       certificate when it is created.
-
-                       Tip: if you know the fully-qualified hostname other
-                       people will be connecting to, you can use that as the
-                       CommonName "CN" to avoid some applications (e.g. web
-                       browsers and java plugin) complaining that it does not
-                       match the hostname.
-
-                       You will also need to supply the CA private key
-                       passphrase to unlock the private key created from
-                       -sslGenCA.  This private key is used to sign the server
-                       or client certificate.
-
-                       The "server" certs can be used by x11vnc directly by
-                       pointing to them via the -ssl [pem] option.  The default
-                       file will be ~/.vnc/certs/server.pem.  This one would
-                       be used by simply typing -ssl SAVE.  The pem file
-                       contains both the certificate and the private key.
-                       server.crt file contains the cert only.
-
-                       The "client" cert + private key file will need
-                       to be copied and imported into the VNC viewer
-                       side applications (Web browser, Java plugin,
-                       stunnel, etc.)  Once that is done you can delete the
-                       "client" private key file on this machine since
-                       it is only needed on the VNC viewer side.  The,
-                       e.g. ~/.vnc/certs/clients/<name>.pem contains both
-                       the cert and private key.  The <name>.crt contains the
-                       certificate only.
-
-                       NOTE: It is very important to know one should
-                       generate new keys with a passphrase.  Otherwise if an
-                       untrusted user steals the key file he could use it to
-                       masquerade as the x11vnc server (or VNC viewer client).
-                       You will be prompted whether to encrypt the key with
-                       a passphrase or not.  It is recommended that you do.
-                       One inconvenience to a passphrase is that it must
-                       be typed in EVERY time x11vnc or the client app is
-                       started up.
-
-                       Examples:
-
-                               x11vnc -sslGenCert server
-                               x11vnc -ssl SAVE -display :0 ...
-
-                       and then on viewer using ss_vncviewer stunnel wrapper
-                       (see the FAQ):
-                               ss_vncviewer -verify ./cacert.crt hostname:0
-
-                       (this assumes the cacert.crt cert from -sslGenCA
-                       was safely copied to the VNC viewer machine where
-                       ss_vncviewer is run)
-
-                       Example using a name:
-
-                               x11vnc -sslGenCert server charlie
-                               x11vnc -ssl SAVE-charlie -display :0 ...
-
-                       Example for a client certificate (rarely used):
-
-                               x11vnc -sslGenCert client roger
-                               scp ~/.vnc/certs/clients/roger.pem somehost:.
-                               rm  ~/.vnc/certs/clients/roger.pem
-
-                       x11vnc is then started with the option -sslverify
-                       ~/.vnc/certs/clients/roger.crt (or simply -sslverify
-                       roger), and on the viewer user on somehost could do
-                       for example:
-
-                               ss_vncviewer -mycert ./roger.pem hostname:0
-
-                       If you set the env. var REQ_ARGS='...' it will be
-                       passed to openssl req(1).  A common use would be
-                       REQ_ARGS='-days 1095' to bump up the expiration date
-                       (3 years in this case).
-
--sslEncKey pem         Utility to encrypt an existing PEM file with a
-                       passphrase you supply when prompted.  For that key to be
-                       used (e.g. by x11vnc) the passphrase must be supplied
-                       each time.
-
-                       The "SAVE" notation described under -ssl applies as
-                       well. (precede this option with -ssldir [dir] to refer
-                       a directory besides the default ~/.vnc/certs)
-
-                       The openssl(1) program must be installed on the system
-                       and available in PATH.  After the Key file is encrypted
-                       the x11vnc command exits; the VNC server is not run.
-
-                       Examples:
-                               x11vnc -sslEncKey /path/to/foo.pem
-                               x11vnc -sslEncKey SAVE
-                               x11vnc -sslEncKey SAVE-charlie
-
--sslCertInfo pem       Prints out information about an existing PEM file.
-                       In addition the public certificate is also printed.
-                       The openssl(1) program must be in PATH. Basically the
-                       command "openssl x509 -text" is run on the pem.
-
-                       After the info is printed the x11vnc command exits;
-                       the VNC server is not run.
-
-                       The "SAVE" notation described under -ssl applies
-                       as well.
-
-                       Using  "LIST" will give a list of all certs being
-                       managed (in the ~/.vnc/certs dir, use -ssldir to refer
-                       to another dir).  "ALL" will print out the info for
-                       every managed key (this can be very long).  Giving a
-                       client or server cert shortname will also try a lookup
-                       (e.g. -sslCertInfo charlie).  Use "LISTL" or "LL"
-                       for a long (ls -l style) listing.
-
-                       Using "HASHON" will create subdirs [dir]/HASH and
-                       [dir]/HASH with OpenSSL hash filenames (e.g. 0d5fbbf1.0)
-                       symlinks pointing up to the corresponding *.crt file.
-                       ([dir] is ~/.vnc/certs or one given by -ssldir.)
-                       This is a useful way for other OpenSSL applications
-                       (e.g. stunnel) to access all of the certs without
-                       having to concatenate them.  x11vnc will not use them
-                       unless you specifically reference them.  "HASHOFF"
-                       removes these HASH subdirs.
-
-                       The LIST, LISTL, LL, ALL, HASHON, HASHOFF words can
-                       also be lowercase, e.g. "list".
-
--sslDelCert pem        Prompts you to delete all .crt .pem .key .req files
-                       associated with [pem].  x11vnc then exits. "SAVE"
-                       and lookups as in -sslCertInfo apply as well.
-
--sslScripts            Prints out both the 'genCA' and 'genCert' x11vnc
-                       openssl wrapper scripts for you to examine, modify, etc.
-                       The scripts are printed to stdout and then the x11vnc
-                       program exits.
-
-
--stunnel [pem]         Use the stunnel(8) (stunnel.mirt.net) to provide an
-                       encrypted SSL tunnel between viewers and x11vnc.
-
-                       This external tunnel method was implemented prior to the
-                       integrated -ssl encryption described above.  It still
-                       works well and avoids the requirement of linking with
-                       the OpenSSL libraries.  This mode requires stunnel
-                       to be installed on the system and available via PATH
-                       (n.b. stunnel is often installed in sbin directories).
-                       Version 4.x of stunnel is assumed (but see -stunnel3
-                       below.)
-
-                       [pem] is optional, use "-stunnel /path/to/stunnel.pem"
-                       to specify a PEM certificate file to pass to stunnel.
-                       See the -ssl option for more info on certificate files.
-
-                       Whether or not your stunnel has its own certificate
-                       depends on your stunnel configuration; stunnel often
-                       generates one at install time.  See your stunnel
-                       documentation for details.  In any event, if you want to
-                       use this certificate you must supply the full path to it
-                       as [pem].  Note: the file may only be readable by root.
-
-                       [pem] may also be the special strings "TMP", "SAVE",
-                       and "SAVE..." as described in the -ssl option.
-                       If [pem] is not supplied, "SAVE" is assumed.
-
-                       Note that the VeNCrypt, ANONTLS, and "ANON" modes
-                       are not supported in -stunnel mode.
-
-                       stunnel is started up as a child process of x11vnc and
-                       any SSL connections stunnel receives are decrypted and
-                       sent to x11vnc over a local socket.  The strings
-                       "The SSL VNC desktop is ..." and "SSLPORT=..."
-                       are printed out at startup to indicate this.
-
-                       The -localhost option is enforced by default to avoid
-                       people routing around the SSL channel.  Use -env
-                       STUNNEL_DISABLE_LOCALHOST=1 to disable this security
-                       requirement.
-
-                       Set -env STUNNEL_DEBUG=1 for more debugging printout.
-
-                       Set -env STUNNEL_PROG=xxx to the full path of stunnel
-                       program you want to be used (e.g. /usr/bin/stunnel4).
-
-                       Set -env STUNNEL_LISTEN=xxx to the address of the
-                       network interface to listen on (the default is to listen
-                       on all interfaces), e.g. STUNNEL_LISTEN=192.168.1.100.
-
-                       A simple way to add IPv6 support is STUNNEL_LISTEN=::
-
-                       Your VNC viewer will also need to be able to connect
-                       via SSL.  Unfortunately not too many do this.  See the
-                       information about SSL viewers under the -ssl option.
-                       The x11vnc project's SSVNC is an option.
-
-                       Also, in the x11vnc distribution, patched TightVNC
-                       and UltraVNC Java applet jar files are provided in
-                       the classes/ssl directory that do SSL connections.
-                       Enable serving them with the -http, -http_ssl, or
-                       -httpdir (see the option descriptions for more info.)
-
-                       Note that for the Java viewer applet usage the
-                       "?PORT=xxxx" in the various URLs printed at startup
-                       will need to be supplied to the web browser to connect
-                       properly.
-
-                       Currently the automatic "single port" HTTPS mode of
-                       -ssl is not fully supported in -stunnel mode.  However,
-                       it can be emulated via:
-
-                         % x11vnc -stunnel -http_ssl -http_oneport ...
-
-                       In general, it is also not too difficult to set up
-                       an stunnel or other SSL tunnel on the viewer side.
-                       A simple example on Unix using stunnel 3.x is:
-
-                         % stunnel -c -d localhost:5901 -r remotehost:5900
-                         % vncviewer localhost:1
-
-                       For Windows, stunnel has been ported to it and there
-                       are probably other such tools available.  See the FAQ
-                       and SSVNC for more examples.
-
--stunnel3  [pem]       Use version 3.x stunnel command line syntax instead of
-                       version 4.x.  The -http/-httpdir Java applet serving
-                       is currently not available in this mode.
-
--enc cipher:keyfile    Use symmetric encryption with cipher "cipher"
-                       and secret key data in "keyfile".  If keyfile is
-                       pw=<string> then "string" is used as the key data.
-
-                       NOTE: It is recommended that you use SSL via the -ssl
-                       option instead of this option because SSL is well
-                       understood and takes great care to establish unique
-                       session keys and is more compatible with other software.
-                       Use this option if you do not want to deal with SSL
-                       certificates for authentication and do not want to
-                       use SSH but want some encryption for your VNC session.
-                       Or if you must interface with a symmetric key tunnel
-                       that you do not have control over.
-
-                       Note that this mode will NOT work with the UltraVNC DSM
-                       plugins because they alter the RFB protocol in addition
-                       to tunnelling with the symmetric cipher (an unfortunate
-                       choice of implementation...)
-
-                       cipher can be one of:  arc4, aesv2, aes-cfb, blowfish,
-                       aes256, or 3des.  See the OpenSSL documentation for
-                       more info.  The keysize is 128 bits (except for aes256).
-                       Here is one way to make a keyfile with that many bits:
-
-                            dd if=/dev/random of=./my.key bs=16 count=1
-
-                       you will need to securely share this key with the other
-                       side of the VNC connection (See SSVNC for examples).
-
-                       Example:  -enc blowfish:./my.key
-                       Example:  -enc blowfish:pw=swordfish
-
-                       By default 16 bytes of random salt followed by 16 bytes
-                       of random initialization vector are sent at the very
-                       beginning of the stream.  The other side must read these
-                       and initialize their cipher with them.  These values
-                       make the session key unique (without them the security
-                       is minimal).  Similarly, the other side must send us
-                       its random salt and IV with those same lengths.
-
-                       The salt and key data are combined to create a session
-                       key using an md5 hash as described in EVP_BytesToKey(3).
-
-                       The exact call is: EVP_BytesToKey(Cipher, EVP_md5(),
-                       salt, keydata, len, 1, keystr, NULL);  where salt is
-                       the random data as described above, and keydata is the
-                       shared secret key data.  keystr is the resulting session
-                       key.  The cipher is then seeded with keystr and uses
-                       the random initialization vector as its first block.
-
-                       To modify the amount of random salt and initialization
-                       vector use cipher at n,m where n is the salt length and
-                       m the initialization vector length.  E.g.
-
-                                 -enc aes-cfb at 8,16:./my.key
-
-                       It is not a good idea to set either one to zero,
-                       although you may be forced to if the other side of the
-                       tunnel is not under your control.
-
-                       To skip the salt and EVP_BytesToKey MD5 entirely (no
-                       hashing is done: the keydata is directly inserted into
-                       the cipher) specify "-1" for the salt, e.g.
-
-                                 -enc blowfish at -1,16:./my.key
-
-                       The message digest can also be changed to something
-                       besides the default MD5.  Use cipher at md+n,m where "md"
-                       can be one of sha, sha1, md5, or ripe.  For example:
-
-                                 -enc arc4 at sha+8,16:./my.key
-
-                       The SSVNC vnc viewer project supplies a symmetric
-                       encryption tool named "ultravnc_dsm_helper" that can
-                       be used on the viewer side.  For example:
-
-                       ssvncviewer exec='ultravnc_dsm_helper arc4 my.key 0 h:p'
-
-                       where h:p is the hostname and port of the x11vnc server.
-                       ultravnc_dsm_helper may also be used standalone to
-                       provide a symmetric encryption tunnel for any viewer
-                       or server (VNC or otherwise.) The cipher (1st arg)
-                       is basically the same syntax as we use above.
-
-                       Also see the 'Non-Ultra DSM' SSVNC option for the
-                       'UltraVNC DSM Encryption Plugin' advanced option.
-
-                       For both ways of using the viewer, you can specify the
-                       salt,ivec sizes (in GUI or, e.g. arc4 at 8,16).
-
--https [port]          Use a special, separate HTTPS port (-ssl and
-                       -stunnel modes only) for HTTPS Java viewer applet
-                       downloading. I.e. not 5900 and not 5800 (the defaults.)
-
-                       BACKGROUND: In -ssl mode, it turns out you can use the
-                       single VNC port (e.g. 5900) for both VNC and HTTPS
-                       connections. (HTTPS is used to retrieve a SSL-aware
-                       VncViewer.jar applet that is provided with x11vnc).
-                       Since both use SSL the implementation was extended to
-                       detect if HTTP traffic (i.e. GET) is taking place and
-                       handle it accordingly.  The URL would be, e.g.:
-
-                       https://mymachine.org:5900/
-
-                       This is convenient for firewalls, etc, because only one
-                       port needs to be allowed in.  However, this heuristic
-                       adds a few seconds delay to each connection and can be
-                       unreliable (especially if the user takes much time to
-                       ponder the Certificate dialogs in his browser, Java VM,
-                       or VNC Viewer applet.  That's right 3 separate "Are
-                       you sure you want to connect?" dialogs!)
-
-                       END OF BACKGROUND.
-
-                       USAGE: So use the -https option to provide a separate,
-                       more reliable HTTPS port that x11vnc will listen on.  If
-                       [port] is not provided (or is 0), one is autoselected.
-                       The URL to use is printed out at startup.
-
-                       The SSL Java applet directory is specified via the
-                       -httpdir option.  If not supplied, -https will try
-                       to guess the directory as though the -http option
-                       was supplied.
-
--httpsredir [port]     In -ssl mode with the Java applet retrieved via HTTPS,
-                       when the HTML file containing applet parameters
-                       ('index.vnc' or 'proxy.vnc') is sent do NOT set the
-                       applet PORT parameter to the actual VNC port but set it
-                       to "port" instead.  If "port" is not supplied, then
-                       the port number is guessed from the Host: HTTP header.
-
-                       This is useful when an incoming TCP connection
-                       redirection is performed by a router/gateway/firewall
-                       from one port to an internal machine where x11vnc is
-                       listening on a different port. The Java applet needs to
-                       connect to the firewall/router port, not the VNC port
-                       on the internal workstation. For example, one could
-                       redir from mygateway.com:443 to workstation:5900.
-
-                       This spares the user from having to type in
-                       https://mygateway.com/?PORT=443 into their web
-                       browser. Note that port 443 is the default https port;
-                       other ports must be explicitly indicated, for example:
-                       https://mygateway.com:8000/?PORT=8000.  To avoid having
-                       to include the PORT= in the browser URL, simply supply
-                       "-httpsredir" to x11vnc.
-
-                       This option does not work in -stunnel mode.
-
-                       More tricks: set the env var X11VNC_EXTRA_HTTPS_PARAMS
-                       to be extra URL parameters to use.  This way you do
-                       not need to specify extra PARAMS in the index.vnc file.
-                       E.g. x11vnc -env X11VNC_EXTRA_HTTPS_PARAMS='?GET=1' ...
-
-                       If you do not want to expose the non-SSL HTTP port to
-                       the network (i.e. you just want the single VNC/HTTPS
-                       port, e.g. 5900, open for connections) then specify the
-                       option -env X11VNC_HTTP_LISTEN_LOCALHOST=1  This way
-                       the connection to the LibVNCServer httpd server will
-                       only be available on localhost (note that in -ssl mode,
-                       HTTPS requests are redirected from SSL to the non-SSL
-                       LibVNCServer HTTP server.)
-
--http_oneport          For UN-encrypted connections mode (i.e. no -ssl,
-                       -stunnel, or -enc options), allow the Java VNC Viewer
-                       applet to be downloaded thru the VNC port via HTTP.
-
-                       That is to say, you can use a single port for Java
-                       applet viewer connections by using a URL in your web
-                       browser like this, for example:
-
-                       http://hostname:5900
-
-                       The regular, two-port mode, URL http://hostname:5800
-                       will continue to work as well.
-
-                       As mentioned above, this mode will NOT work with
-                       the -ssl, -stunnel, or -enc encryption options.
-                       Note that is it equivalent to '-enc none' (i.e. it
-                       uses the same detection mechanism as for HTTPS, but
-                       with no encryption.)
-
-                       HTTPS single-port is on by default in -ssl encrypted
-                       mode (and -enc too), so you only need -http_oneport
-                       when doing non-SSL encrypted connections.
-
-                       This mode could also be useful for SSH tunnels since
-                       it means only one port needs to be redirected.
-
-                       The -httpsredir option may also be useful for this
-                       mode when using an SSH tunnel as well as for router
-                       port redirections.
-
-                       Note that the -env X11VNC_HTTP_LISTEN_LOCALHOST=1
-                       option described above under -httpsredir applies for
-                       the LibVNCServer httpd server in all cases (ssl or not.)
-
--ssh user at host:disp    Create a remote listening port on machine "host"
-                       via a SSH tunnel using the -R rport:localhost:lport
-                       method. lport will be the local x11vnc listening port,
-                       so a connection to rport (5900+disp) on "host"
-                       will reach x11vnc.  E.g. fred at snoopy.com:0
-
-                       This could be useful if a firewall/router prevents
-                       incoming connections to the x11vnc machine, but
-                       the ssh machine "host" can be reached by the VNC
-                       viewer. "user@" is not needed unless the remote unix
-                       username differs from the current one.
-
-                       By default the remote sshd is usually configured to
-                       listen only on localhost for rport, so the viewer may
-                       need to ssh -L redir to "host" as well (See SSVNC to
-                       automate this).  The sshd setting GatewayPorts enables
-                       listening on all interfaces for rport; viewers can
-                       reach it more easily.
-
-                       "disp" is the VNC display for the remote SSH side,
-                       e.g. 0 corresponds to port 5900, etc.  If disp is
-                       greater than 200 the value is used as the port.  Use a
-                       negative value to force a low port, e.g. host:-80 will
-                       use port 80.
-
-                       If ssh-agent is not active, then the ssh password needs
-                       to be entered in the terminal where x11vnc is running.
-
-                       By default the remote ssh will issue a 'sleep 300' to
-                       wait for the incoming connection for 5 mins.  To modify
-                       this use user at host:disp+secs.
-
-                       If the remote SSH server is on a non-standard port
-                       (i.e. not 22) use user at host:port:disp+secs.
-
-                       Note that the ssh process MAY NOT be killed when
-                       x11vnc exits.  It tries by looking at ps(1) output.
-
--usepw                 If no other password method was supplied on the command
-                       line, first look for ~/.vnc/passwd and if found use it
-                       with -rfbauth; next, look for ~/.vnc/passwdfile and
-                       use it with -passwdfile; otherwise, prompt the user
-                       for a password to create ~/.vnc/passwd and use it with
-                       the -rfbauth option.  If none of these succeed x11vnc
-                       exits immediately.
-
--storepasswd pass file Store password "pass" as the VNC password in the
-                       file "file".  Once the password is stored the
-                       program exits.  Use the password via "-rfbauth file"
-
-                       If called with no arguments, "x11vnc -storepasswd",
-                       the user is prompted for a password and it is stored
-                       in the file ~/.vnc/passwd.  Called with one argument,
-                       that will be the file to store the prompted password in.
-
--nopw                  Disable the big warning message when you use x11vnc
-                       without some sort of password.
-
--accept string         Run a command (possibly to prompt the user at the
-                       X11 display) to decide whether an incoming client
-                       should be allowed to connect or not.  "string" is
-                       an external command run via system(3) or some special
-                       cases described below.  Be sure to quote "string"
-                       if it contains spaces, shell characters, etc.  If the
-                       external command returns 0 the client is accepted,
-                       otherwise the client is rejected.  See below for an
-                       extension to accept a client view-only.
-
-                       If x11vnc is running as root (say from inetd(8) or from
-                       display managers xdm(1), gdm(1), etc), think about the
-                       security implications carefully before supplying this
-                       option (likewise for the -gone option).
-
-                       Environment: The RFB_CLIENT_IP environment variable will
-                       be set to the incoming client IP number and the port
-                       in RFB_CLIENT_PORT (or -1 if unavailable).  Similarly,
-                       RFB_SERVER_IP and RFB_SERVER_PORT (the x11vnc side
-                       of the connection), are set to allow identification
-                       of the tcp virtual circuit.  The x11vnc process
-                       id will be in RFB_X11VNC_PID, a client id number in
-                       RFB_CLIENT_ID, and the number of other connected clients
-                       in RFB_CLIENT_COUNT.  RFB_MODE will be "accept".
-                       RFB_STATE will be PROTOCOL_VERSION, SECURITY_TYPE,
-                       AUTHENTICATION, INITIALISATION, NORMAL, or UNKNOWN
-                       indicating up to which state the client has achieved.
-                       RFB_LOGIN_VIEWONLY will be 0, 1, or -1 (unknown).
-                       RFB_USERNAME, RFB_LOGIN_TIME, and RFB_CURRENT_TIME may
-                       also be set.
-
-                       If "string" is "popup" then a builtin popup window
-                       is used.  The popup will time out after 120 seconds,
-                       use "popup:N" to modify the timeout to N seconds
-                       (use 0 for no timeout).
-
-                       In the case of "popup" and when the -unixpw option
-                       is specified, then a *second* window will be popped
-                       up after the user successfully logs in via his UNIX
-                       password.  This time the user will be identified as
-                       UNIX:username at hostname, the "UNIX:" prefix indicates
-                       which user the viewer logged as via -unixpw.  The first
-                       popup is only for whether to allow him to even *try*
-                       to login via unix password.
-
-                       If "string" is "xmessage" then an xmessage(1)
-                       invocation is used for the command.  xmessage must be
-                       installed on the machine for this to work.
-
-                       Both "popup" and "xmessage" will present an option
-                       for accepting the client "View-Only" (the client
-                       can only watch).  This option will not be presented if
-                       -viewonly has been specified, in which case the entire
-                       display is view only.
-
-                       If the user supplied command is prefixed with something
-                       like "yes:0,no:*,view:3 mycommand ..." then this
-                       associates the numerical command return code with
-                       the actions: accept, reject, and accept-view-only,
-                       respectively.  Use "*" instead of a number to indicate
-                       the default action (in case the command returns an
-                       unexpected value).  E.g. "no:*" is a good choice.
-
-                       Note that x11vnc blocks while the external command
-                       or popup is running (other clients may see no updates
-                       during this period).  So a person sitting a the physical
-                       display is needed to respond to an popup prompt. (use
-                       a 2nd x11vnc if you lock yourself out).
-
-                       More -accept tricks: use "popupmouse" to only allow
-                       mouse clicks in the builtin popup to be recognized.
-                       Similarly use "popupkey" to only recognize
-                       keystroke responses.  These are to help avoid the
-                       user accidentally accepting a client by typing or
-                       clicking. All 3 of the popup keywords can be followed
-                       by +N+M to supply a position for the popup window.
-                       The default is to center the popup window.
--afteraccept string    As -accept, except to run a user supplied command after
-                       a client has been accepted and authenticated. RFB_MODE
-                       will be set to "afteraccept" and the other RFB_*
-                       variables are as in -accept.  Unlike -accept, the
-                       command return code is not interpreted by x11vnc.
-                       Example: -afteraccept 'killall xlock &'
--gone string           As -accept, except to run a user supplied command when
-                       a client goes away (disconnects).  RFB_MODE will be
-                       set to "gone" and the other RFB_* variables are as
-                       in -accept.  The "popup" actions apply as well.
-                       Unlike -accept, the command return code is not
-                       interpreted by x11vnc.  Example: -gone 'xlock &'
-
--users list            If x11vnc is started as root (say from inetd(8) or from
-                       display managers xdm(1), gdm(1), etc), then as soon
-                       as possible after connections to the X display are
-                       established try to switch to one of the users in the
-                       comma separated "list".  If x11vnc is not running as
-                       root this option is ignored.
-
-                       Why use this option?  In general it is not needed since
-                       x11vnc is already connected to the X display and can
-                       perform its primary functions.  The option was added
-                       to make some of the *external* utility commands x11vnc
-                       occasionally runs work properly.  In particular under
-                       GNOME and KDE to implement the "-solid color" feature
-                       external commands (gconftool-2 and dcop) unfortunately
-                       must be run as the user owning the desktop session.
-                       Since this option switches userid it also affects the
-                       userid used to run the processes for the -accept and
-                       -gone options.  It also affects the ability to read
-                       files for options such as -connect, -allow, and -remap
-                       and also the ultra and tight filetransfer feature if
-                       enabled.  Note that the -connect file is also sometimes
-                       written to.
-
-                       So be careful with this option since in some situations
-                       its use can decrease security.
-
-                       In general the switch to a user will only take place
-                       if the display can still be successfully opened as that
-                       user (this is primarily to try to guess the actual owner
-                       of the session). Example: "-users fred,wilma,betty".
-                       Note that a malicious local user "barney" by
-                       quickly using "xhost +" when logging in may possibly
-                       get the x11vnc process to switch to user "fred".
-                       What happens next?
-
-                       Under display managers it may be a long time before
-                       the switch succeeds (i.e. a user logs in).  To instead
-                       make it switch immediately regardless if the display
-                       can be reopened prefix the username with the "+"
-                       character. E.g. "-users +bob" or "-users +nobody".
-
-                       The latter (i.e. switching immediately to user
-                       "nobody") is the only obvious use of the -users option
-                       that increases security.
-
-                       Use the following notation to associate a group with
-                       a user: user1.group1,user2.group2,...  Note that
-                       initgroups(2) will still be called first to try to
-                       switch to ALL of a user's groups (primary and additional
-                       groups).  Only if that fails or it is not available
-                       then the single group specified as above (or the user's
-                       primary group if not specified) is switched to with
-                       setgid(2).  Use -env X11VNC_SINGLE_GROUP=1 to prevent
-                       trying initgroups(2) and only switch to the single
-                       group.  This sort of setting is only really needed to
-                       make the ultra or tight filetransfer permissions work
-                       properly. This format applies to any comma separated lis
-t
-                       of users, even the special "=" modes described below.
-
-                       In -unixpw mode, if "-users unixpw=" is supplied
-                       then after a user authenticates himself via the
-                       -unixpw mechanism, x11vnc will try to switch to that
-                       user as though "-users +username" had been supplied.
-                       If you want to limit which users this will be done for,
-                       provide them as a comma separated list after "unixpw="
-                       Groups can also be specified as described above.
-
-                       Similarly, in -ssl mode, if "-users sslpeer=" is
-                       supplied then after an SSL client authenticates with his
-                       cert (the -sslverify option is required for this) x11vnc
-                       will extract a UNIX username from the "emailAddress"
-                       field (username at hostname.com) of the "Subject" of the
-                       x509 SSL cert and then try to switch to that user as
-                       though "-users +username" had been supplied.  If you
-                       want to limit which users this will be done for, provide
-                       them as a comma separated list after "sslpeer=".
-                       Set the env. var X11VNC_SSLPEER_CN to use the Common
-                       Name (normally a hostname) instead of the Email field.
-
-                       NOTE: for sslpeer= mode the x11vnc administrator must
-                       take care that any client certs he adds to -sslverify
-                       have the intended UNIX username in the "emailAddress"
-                       field of the cert.  Otherwise a user may be able to
-                       log in as another.  This command can be of use in
-                       checking: "openssl x509 -text -in file.crt", see the
-                       "Subject:" line.  Also, along with the normal RFB_*
-                       env. vars. (see -accept) passed to external cmd=
-                       commands, RFB_SSL_CLIENT_CERT will be set to the
-                       client's x509 certificate string.
-
-                       The sslpeer= mode can aid finding X sessions via the
-                       FINDDISPLAY and FINDCREATEDISPLAY mechanisms.
-
-                       To immediately switch to a user *before* connections
-                       to the X display are made or any files opened use the
-                       "=" character: "-users =bob".  That user needs to
-                       be able to open the X display and any files of course.
-
-                       The special user "guess=" means to examine the utmpx
-                       database (see who(1)) looking for a user attached to
-                       the display number (from DISPLAY or -display option)
-                       and try him/her.  To limit the list of guesses, use:
-                       "-users guess=bob,betty".
-
-                       Even more sinister is the special user "lurk="
-                       that means to try to guess the DISPLAY from the utmpx
-                       login database as well.  So it "lurks" waiting for
-                       anyone to log into an X session and then connects to it.
-                       Specify a list of users after the = to limit which users
-                       will be tried.  To enable a different searching mode, if
-                       the first user in the list is something like ":0" or
-                       ":0-2" that indicates a range of DISPLAY numbers that
-                       will be tried (regardless of whether they are in the
-                       utmpx database) for all users that are logged in.  Also
-                       see the "-display WAIT:..." functionality.  Examples:
-                       "-users lurk=" and also "-users lurk=:0-1,bob,mary"
-
-                       Be especially careful using the "guess=" and "lurk="
-                       modes.  They are not recommended for use on machines
-                       with untrustworthy local users.
-
--noshm                 Do not use the MIT-SHM extension for the polling.
-                       Remote displays can be polled this way: be careful this
-                       can use large amounts of network bandwidth.  This is
-                       also of use if the local machine has a limited number
-                       of shm segments and -onetile is not sufficient.
--flipbyteorder         Sometimes needed if remotely polled host has different
-                       endianness.  Ignored unless -noshm is set.
--onetile               Do not use the new copy_tiles() framebuffer mechanism,
-                       just use 1 shm tile for polling.  Limits shm segments
-                       used to 3.
-
-                       To disable any automatic shm reduction set the
-                       env. var. X11VNC_NO_LIMIT_SHM.
-
--solid [color]         To improve performance, when VNC clients are connected
-                       try to change the desktop background to a solid color.
-                       The [color] is optional: the default color is "cyan4".
-                       For a different one specify the X color (rgb.txt name,
-                       e.g. "darkblue" or numerical "#RRGGBB").
-
-                       Currently this option only works on GNOME, KDE, CDE,
-                       XFCE, and classic X (i.e. with the background image
-                       on the root window).  The "gconftool-2", "dcop"
-                       and "xfconf-query" external commands are run for
-                       GNOME, KDE, and XFCE respectively.  This also works
-                       on native MacOSX.  (There is no color selection for
-                       MacOSX or XFCE.)  Other desktops won't work, (send
-                       us the corresponding commands if you find them).
-                       If x11vnc is running as root (inetd(8) or gdm(1)),
-                       the -users option may be needed for GNOME, KDE, XFCE.
-                       If x11vnc guesses your desktop incorrectly, you can
-                       force it by prefixing color with "gnome:", "kde:",
-                       "cde:", "xfce:", or "root:".
-
-                       Update: -solid no longer works on KDE4.
-
-                       This mode works in a limited way on the Mac OS X Console
-                       with one color ('kelp') using the screensaver writing
-                       to the background.  Look in "~/Library/Screen Savers"
-                       for VncSolidColor.png to change the color.
-
--blackout string       Black out rectangles on the screen. "string" is a
-                       comma separated list of WxH+X+Y type geometries for
-                       each rectangle.  If one of the items on the list is the
-                       string "noptr" the mouse pointer will not be allowed
-                       to go into a blacked out region.
--xinerama              If your screen is composed of multiple monitors
--noxinerama            glued together via XINERAMA, and that screen is
-                       not a rectangle this option will try to guess the
-                       areas to black out (if your system has libXinerama).
-                       default: -xinerama
-
-                       In general, we have noticed on XINERAMA displays you may
-                       need to use the "-xwarppointer" option if the mouse
-                       pointer misbehaves and it is enabled by default. Use
-                       "-noxwarppointer" if you do not want this.
-
--xtrap                 Use the DEC-XTRAP extension for keystroke and mouse
-                       input insertion.  For use on legacy systems, e.g. X11R5,
-                       running an incomplete or missing XTEST extension.
-                       By default DEC-XTRAP will be used if XTEST server grab
-                       control is missing, use -xtrap to do the keystroke and
-                       mouse insertion via DEC-XTRAP as well.
-
--xrandr [mode]         If the display supports the XRANDR (X Resize, Rotate
-                       and Reflection) extension, and you expect XRANDR events
-                       to occur to the display while x11vnc is running, this
-                       options indicates x11vnc should try to respond to
-                       them (as opposed to simply crashing by assuming the
-                       old screen size).  See the xrandr(1) manpage and run
-                       'xrandr -q' for more info.  [mode] is optional and
-                       described below.
-
-                       Since watching for XRANDR events and trapping errors
-                       increases polling overhead, only use this option if
-                       XRANDR changes are expected.  For example on a rotatable
-                       screen PDA or laptop, or using a XRANDR-aware Desktop
-                       where you resize often.  It is best to be viewing with a
-                       vncviewer that supports the NewFBSize encoding, since it
-                       knows how to react to screen size changes.  Otherwise,
-                       LibVNCServer tries to do so something reasonable for
-                       viewers that cannot do this (portions of the screen
-                       may be clipped, unused, etc).
-
-                       Note: the default now is to check for XRANDR events, but
-                       do not trap every X call that may fail due to resize.
-                       If a resize event is received, the full -xrandr mode
-                       is enabled.  To disable even checking for events supply:
-                       -noxrandr.
-
-                       "mode" defaults to "resize", which means create a
-                       new, resized, framebuffer and hope all viewers can cope
-                       with the change.  "newfbsize" means first disconnect
-                       all viewers that do not support the NewFBSize VNC
-                       encoding, and then resize the framebuffer.  "exit"
-                       means disconnect all viewer clients, and then terminate
-                       x11vnc.
-
--rotate string         Rotate and/or flip the framebuffer view exported by VNC.
-                       This transformation is independent of XRANDR and is
-                       done in software in main memory and so may be slower.
-                       This mode could be useful on a handheld with portrait or
-                       landscape modes that do not correspond to the scanline
-                       order of the actual framebuffer.  "string" can be:
-
-                             x     flip along x-axis
-                             y     flip along y-axis
-                            xy     flip along x- and y-axes
-                           +90     rotate 90 degrees clockwise
-                           -90     rotate 90 degrees counter-clockwise
-                          +90x     rotate 90 degrees CW, then flip along x
-                          +90y     rotate 90 degrees CW, then flip along y
-
-                       these give all possible rotations and reflections.
-
-                       Aliases: same as xy:  yx, +180, -180, 180
-                                same as -90: +270, 270
-                                same as +90: 90, (ditto for 90x, 90y)
-
-                       Like -scale, this transformation is applied at the very
-                       end of any chain of framebuffer transformations and so
-                       any options with geometries, e.g. -blackout, -clip, etc.
-                       are relative to the original X (or -rawfb) framebuffer,
-                       not the final one sent to VNC viewers.
-
-                       If you do not want the cursor shape to be rotated
-                       prefix "string" with "nc:", e.g. "nc:+90",
-                       "nc:xy", etc.
-
--padgeom WxH           Whenever a new vncviewer connects, the framebuffer is
-                       replaced with a fake, solid black one of geometry WxH.
-                       Shortly afterwards the framebuffer is replaced with the
-                       real one.  This is intended for use with vncviewers
-                       that do not support NewFBSize and one wants to make
-                       sure the initial viewer geometry will be big enough
-                       to handle all subsequent resizes (e.g. under -xrandr,
-                       -remote id:windowid, rescaling, etc.)
-
-                       In -unixpw mode this sets the size of the login screen.
-                       Use "once:WxH" it ignore padgeom after the login
-                       screen is set up.
-
--o logfile             Write stderr messages to file "logfile" instead of to
-                       the terminal.  Same as "-logfile file".  To append
-                       to the file use "-oa file" or "-logappend file".
-                       If "logfile" contains the string "%VNCDISPLAY"
-                       it is expanded to the vnc display (the name may need
-                       to be guessed at.)  "%HOME" works too.
-
--flag file             Write the "PORT=NNNN" (e.g. PORT=5900) string to
-                       "file" in addition to stdout.  This option could be
-                       useful by wrapper script to detect when x11vnc is ready.
-
--rmflag file           Remove "file" at exit to signal when x11vnc is done.
-                       The file is created at startup if it does not already
-                       exist or if "file" is prefixed with "create:".
-                       If the file is created, the x11vnc PID is placed in
-                       the file.  Otherwise the files contents is not changed.
-                       Use prefix "nocreate:" to prevent creation.
-
--rc filename           Use "filename" instead of $HOME/.x11vncrc for rc file.
--norc                  Do not process any .x11vncrc file for options.
-
--env VAR=VALUE         Set the environment variable 'VAR' to value 'VALUE'
-                       at x11vnc startup.  This is a convenience utility to
-                       avoid shell script wrappers, etc. to set the env. var.
-                       You may specify as many of these as needed on the
-                       command line.
--prog /path/to/x11vnc  Set the full path to the x11vnc program for cases when
-                       it cannot be determined from argv[0] (e.g. tcpd/inetd)
-
--h, -help              Print this help text.
--?, -opts              Only list the x11vnc options.
--V, -version           Print program version and last modification date.
--license               Print out license information.  Same as -copying and
-                       -warranty.
-
--dbg                   Instead of exiting after cleaning up, run a simple
-                       "debug crash shell" when fatal errors are trapped.
-
--q, -quiet             Be quiet by printing less informational output to
-                       stderr. (use -noquiet to undo an earlier -quiet.)
-
-                       The -quiet option does not eliminate all informational
-                       output, it only reduces it.  It is ignored in most
-                       auxiliary usage modes, e.g. -storepasswd.  To eliminate
-                       all output use: 2>/dev/null 1>&2, etc.
-
--v, -verbose           Print out more information to stderr.
-
--bg                    Go into the background after screen setup.  Messages to
-                       stderr are lost unless -o logfile is used.  Something
-                       like this could be useful in a script:
-                        port=`ssh -t $host "x11vnc -display :0 -bg" | grep PORT
-`
-                        port=`echo "$port" | sed -e 's/PORT=//'`
-                        port=`expr $port - 5900`
-                        vncviewer $host:$port
-
--modtweak              Option -modtweak automatically tries to adjust the AltGr
--nomodtweak            and Shift modifiers for differing language keyboards
-                       between client and host.  Otherwise, only a single key
-                       press/release of a Keycode is simulated (i.e. ignoring
-                       the state of the modifiers: this usually works for
-                       identical keyboards).  Also useful in resolving cases
-                       where a Keysym is bound to multiple keys (e.g. "<" + ">"
-                       and "," + "<" keys).  Default: -modtweak
-
-                       If you are having trouble with with keys and -xkb or
-                       -noxkb, and similar things don't help, try -nomodtweak.
-
-                       On some HP-UX systems it is been noted that they have
-                       an odd keymapping where a single keycode will have a
-                       keysym, e.g. "#", up to three times.  You can check
-                       via "xmodmap -pk" or the -dk option.  The failure
-                       is when you try to type "#" it yields "3".  If you
-                       see this problem try setting the environment variable
-                       MODTWEAK_LOWEST=1 to see if it helps.
-
--xkb                   When in modtweak mode, use the XKEYBOARD extension (if
--noxkb                 the X display supports it) to do the modifier tweaking.
-                       This is powerful and should be tried if there are still
-                       keymapping problems when using -modtweak by itself.
-                       The default is to check whether some common keysyms,
-                       e.g. !, @, [, are only accessible via -xkb mode and if
-                       so then automatically enable the mode.  To disable this
-                       automatic detection use -noxkb.
-
-                       When -xkb mode is active you can set these env. vars.
-                       They apply only when there is ambiguity as to which
-                       key to choose (i.e the mapping is not one-to-one).
-                       NOKEYHINTS=1: for up ascii keystrokes do not use score
-                       hints saved when the key was pressed down. NOANYDOWN=1:
-                       for up keystrokes do not resort to searching through
-                       keys that are currently pressed down.  KEYSDOWN=N:
-                       remember the last N keys press down for tie-breaking
-                       when an up keystroke comes in.
-
--capslock              When in -modtweak (the default) or -xkb mode,
-                       if a keysym in the range A-Z comes in check the X
-                       server to see if the Caps_Lock is set.  If it is do
-                       not artificially press Shift to generate the keysym.
-                       This will enable the CapsLock key to behave correctly
-                       in some circumstances: namely *both* the VNC viewer
-                       machine and the x11vnc X server are in the CapsLock
-                       on state.  If one side has CapsLock on and the other
-                       off and the keyboard is not behaving as you think it
-                       should you should correct the CapsLock states (hint:
-                       pressing CapsLock inside and outside of the viewer can
-                       help toggle them both to the correct state).  However,
-                       for best results do not use this option, but rather
-                       *only* enable CapsLock on the VNC viewer side (i.e. by
-                       pressing CapsLock outside of the viewer window, also
-                       -skip_lockkeys below).  Also try -nomodtweak for a
-                       possible workaround.
-
--skip_lockkeys         Have x11vnc ignore all Caps_Lock, Shift_Lock, Num_Lock,
--noskip_lockkeys       Scroll_Lock keysyms received from viewers.  The idea is
-                       you press Caps_Lock on the VNC Viewer side but that does
-                       not change the lock state in the x11vnc-side X server.
-                       Nevertheless your capitalized letters come in over
-                       the wire and are applied correctly to the x11vnc-side
-                       X server.  Note this mode probably won't do what you
-                       want in -nomodtweak mode.  Also, a kludge for KP_n
-                       digits is always done in this mode: they are mapped to
-                       regular digit keysyms.  See also -capslock above.
-                       The default is -noskip_lockkeys.
-
--skip_keycodes string  Ignore the comma separated list of decimal keycodes.
-                       Perhaps these are keycodes not on your keyboard but
-                       your X server thinks exist.  Currently only applies
-                       to -xkb mode.  Use this option to help x11vnc in the
-                       reverse problem it tries to solve: Keysym -> Keycode(s)
-                       when ambiguities exist (more than one Keycode per
-                       Keysym).  Run 'xmodmap -pk' to see your keymapping.
-                       Example: "-skip_keycodes 94,114"
--sloppy_keys           Experimental option that tries to correct some
-                       "sloppy" key behavior.  E.g. if at the viewer you
-                       press Shift+Key but then release the Shift before
-                       Key that could give rise to extra unwanted characters
-                       (usually only between keyboards of different languages).
-                       Only use this option if you observe problems with
-                       some keystrokes.
--skip_dups             Some VNC viewers send impossible repeated key events,
--noskip_dups           e.g. key-down, key-down, key-up, key-up all for the same
-                       key, or 20 downs in a row for the same modifier key!
-                       Setting -skip_dups means to skip these duplicates and
-                       just process the first event. Note: some VNC viewers
-                       assume they can send down's without the corresponding
-                       up's and so you should not set this option for
-                       these viewers (symptom: some keys do not autorepeat)
-                       Default: -noskip_dups
--add_keysyms           If a Keysym is received from a VNC viewer and that
--noadd_keysyms         Keysym does not exist in the X server, then add the
-                       Keysym to the X server's keyboard mapping on an unused
-                       key.  Added Keysyms will be removed periodically and
-                       also when x11vnc exits.  Default: -add_keysyms
--clear_mods            At startup and exit clear the modifier keys by sending
-                       KeyRelease for each one. The Lock modifiers are skipped.
-                       Used to clear the state if the display was accidentally
-                       left with any pressed down.
--clear_keys            As -clear_mods, except try to release ANY pressed key.
-                       Note that this option and -clear_mods can interfere
-                       with a person typing at the physical keyboard.
--clear_all             As -clear_keys, except try to release any CapsLock,
-                       NumLock, etc. locks as well.
-
--remap string          Read Keysym remappings from file named "string".
-                       Format is one pair of Keysyms per line (can be name
-                       or hex value) separated by a space.  If no file named
-                       "string" exists, it is instead interpreted as this
-                       form: key1-key2,key3-key4,...  See <X11/keysymdef.h>
-                       header file for a list of Keysym names, or use xev(1).
-
-                       To map a key to a button click, use the fake Keysyms
-                       "Button1", ..., etc. E.g: "-remap Super_R-Button2"
-                       (useful for pasting on a laptop)
-
-                       I use these if the machine I am viewing from does not
-                       have a scrollwheel or I don't like using the one it has:
-
-                              -remap Super_R-Button4,Menu-Button5
-                              -remap KP_Add-Button4,KP_Enter-Button5
-
-                       the former would be used on a PC, the latter on a
-                       MacBook.  This way those little used keys can be used
-                       to generate bigger hops than the Up and Down arrows
-                       provide.  One can scroll through text or web pages more
-                       quickly this way (especially if x11vnc scroll detection
-                       is active.)
-
-                       Use Button44, Button12, etc. for multiple clicks.
-
-                       To disable a keysym (i.e. make it so it will not be
-                       injected), remap it to "NoSymbol" or "None".
-
-                       Dead keys: "dead" (or silent, mute) keys are keys that
-                       do not produce a character but must be followed by a 2nd
-                       keystroke.  This is often used for accenting characters,
-                       e.g. to put "`" on top of "a" by pressing the dead
-                       key and then "a".  Note that this interpretation
-                       is not part of core X11, it is up to the toolkit or
-                       application to decide how to react to the sequence.
-                       The X11 names for these keysyms are "dead_grave",
-                       "dead_acute", etc.  However some VNC viewers send the
-                       keysyms "grave", "acute" instead thereby disabling
-                       the accenting.  To work around this -remap can be used.
-                       For example "-remap grave-dead_grave,acute-dead_acute"
-                       As a convenience, "-remap DEAD" applies these remaps:
-
-                               g     grave-dead_grave
-                               a     acute-dead_acute
-                               c     asciicircum-dead_circumflex
-                               t     asciitilde-dead_tilde
-                               m     macron-dead_macron
-                               b     breve-dead_breve
-                               D     abovedot-dead_abovedot
-                               d     diaeresis-dead_diaeresis
-                               o     degree-dead_abovering
-                               A     doubleacute-dead_doubleacute
-                               r     caron-dead_caron
-                               e     cedilla-dead_cedilla
-
-                       If you just want a subset use the first letter
-                       label, e.g. "-remap DEAD=ga" to get the first two.
-                       Additional remaps may also be supplied via commas,
-                       e.g.  "-remap DEAD=ga,Super_R-Button2".  Finally,
-                       "DEAD=missing" means to apply all of the above as
-                       long as the left hand member is not already in the
-                       X11 keymap.
-
--norepeat              Option -norepeat disables X server key auto repeat when
--repeat                VNC clients are connected and VNC keyboard input is
-                       not idle for more than 5 minutes.  This works around a
-                       repeating keystrokes bug (triggered by long processing
-                       delays between key down and key up client events:
-                       either from large screen changes or high latency).
-                       Default: -norepeat
-
-                       You can set the env. var. X11VNC_IDLE_TIMEOUT to the
-                       number of idle seconds you want (5min = 300secs).
-
-                       Note: your VNC viewer side will likely do autorepeating,
-                       so this is no loss unless someone is simultaneously at
-                       the real X display.
-
-                       Use "-norepeat N" to set how many times norepeat will
-                       be reset if something else (e.g. X session manager)
-                       undoes it.  The default is 2.  Use a negative value
-                       for unlimited resets.
-
--nofb                  Ignore video framebuffer: only process keyboard and
-                       pointer.  Intended for use with Win2VNC and x2vnc
-                       dual-monitor setups.
--nobell                Do not watch for XBell events. (no beeps will be heard)
-                       Note: XBell monitoring requires the XKEYBOARD extension.
--nosel                 Do not manage exchange of X selection/cutbuffer between
-                       VNC viewers and the X server at all.
--noprimary             Do not poll the PRIMARY selection for changes to send
-                       back to clients.  (PRIMARY is still set on received
-                       changes, however).
--nosetprimary          Do not set the PRIMARY selection for changes received
-                       from VNC clients.
--noclipboard           Do not poll the CLIPBOARD selection for changes to send
-                       back to clients.  (CLIPBOARD is still set on received
-                       changes, however).
--nosetclipboard        Do not set the CLIPBOARD selection for changes
-                       received from VNC clients.
--seldir string         If direction string is "send", only send the selection
-                       to viewers, and if it is "recv" only receive it from
-                       viewers.  To work around apps setting the selection
-                       too frequently and messing up the other end.  You can
-                       actually supply a comma separated list of directions,
-                       including "debug" to turn on debugging output.
-
--cursor [mode]         Sets how the pointer cursor shape (little icon at the
--nocursor              mouse pointer) should be handled.  The "mode" string
-                       is optional and is described below.  The default
-                       is to show some sort of cursor shape(s).  How this
-                       is done depends on the VNC viewer and the X server.
-                       Use -nocursor to disable cursor shapes completely.
-
-                       Some VNC viewers support the TightVNC CursorPosUpdates
-                       and CursorShapeUpdates extensions (cuts down on
-                       network traffic by not having to send the cursor image
-                       every time the pointer is moved), in which case these
-                       extensions are used (see -nocursorshape and -nocursorpos
-                       below to disable).  For other viewers the cursor shape
-                       is written directly to the framebuffer every time the
-                       pointer is moved or changed and gets sent along with
-                       the other framebuffer updates.  In this case, there
-                       will be some lag between the vnc viewer pointer and
-                       the remote cursor position.
-
-                       If the X display supports retrieving the cursor shape
-                       information from the X server, then the default is
-                       to use that mode.  On Solaris this can be done with
-                       the SUN_OVL extension using -overlay (see also the
-                       -overlay_nocursor option).  A similar overlay scheme
-                       is used on IRIX.  Xorg (e.g. Linux) and recent Solaris
-                       Xsun servers support the XFIXES extension to retrieve
-                       the exact cursor shape from the X server.  If XFIXES
-                       is present it is preferred over Overlay and is used by
-                       default (see -noxfixes below).  This can be disabled
-                       with -nocursor, and also some values of the "mode"
-                       option below.
-
-                       Note that under XFIXES cursors with transparency (alpha
-                       channel) will usually not be exactly represented and one
-                       may find Overlay preferable.  See also the -alphacut
-                       and -alphafrac options below as fudge factors to try
-                       to improve the situation for cursors with transparency
-                       for a given theme.
-
-                       The "mode" string can be used to fine-tune the
-                       displaying of cursor shapes.  It can be used the
-                       following ways:
-
-                       "-cursor arrow" - just show the standard arrow
-                       nothing more or nothing less.
-
-                       "-cursor none" - same as "-nocursor"
-
-                       "-cursor X" - when the cursor appears to be on the
-                       root window, draw the familiar X shape.  Some desktops
-                       such as GNOME cover up the root window completely,
-                       and so this will not work, try "X1", etc, to try to
-                       shift the tree depth.  On high latency links or slow
-                       machines there will be a time lag between expected and
-                       the actual cursor shape.
-
-                       "-cursor some" - like "X" but use additional
-                       heuristics to try to guess if the window should have
-                       a windowmanager-like resizer cursor or a text input
-                       I-beam cursor.  This is a complete hack, but may be
-                       useful in some situations because it provides a little
-                       more feedback about the cursor shape.
-
-                       "-cursor most" - try to show as many cursors as
-                       possible.  Often this will only be the same as "some"
-                       unless the display has overlay visuals or XFIXES
-                       extensions available.  On Solaris and IRIX if XFIXES
-                       is not available, -overlay mode will be attempted.
-
--cursor_drag           Show cursor shape changes even when the mouse is being
-                       dragged with a mouse button down.  This is useful if you
-                       want to be able to see Drag-and-Drop cursor icons, etc.
-
--arrow n               Choose an alternate "arrow" cursor from a set of
-                       some common ones.  n can be 1 to 6.  Default is: 1
-                       Ignored when in XFIXES cursor-grabbing mode.
-
--noxfixes              Do not use the XFIXES extension to draw the exact cursor
-                       shape even if it is available.
-
-                       Note: To work around a crash in Xorg 1.5 and later
-                       some people needed to use -noxfixes.  The Xorg crash
-                       occurred right after a Display Manager (e.g. GDM) login.
-                       Starting with x11vnc 0.9.9 it tries to automatically
-                       avoid using XFIXES until it is sure a window manager
-                       is running.  See the -reopen option for more info and
-                       how to use X11VNC_AVOID_WINDOWS=never to disable it.
-
--alphacut n            When using the XFIXES extension for the cursor shape,
-                       cursors with transparency will not usually be displayed
-                       exactly (but opaque ones will).  This option sets n as
-                       a cutoff for cursors that have transparency ("alpha
-                       channel" with values ranging from 0 to 255) Any cursor
-                       pixel with alpha value less than n becomes completely
-                       transparent.  Otherwise the pixel is completely opaque.
-                       Default 240
-
--alphafrac fraction    With the threshold in -alphacut some cursors will become
-                       almost completely transparent because their alpha values
-                       are not high enough.  For those cursors adjust the
-                       alpha threshold until fraction of the non-zero alpha
-                       channel pixels become opaque.  Default 0.33
--alpharemove           By default, XFIXES cursors pixels with transparency have
-                       the alpha factor multiplied into the RGB color values
-                       (i.e. that corresponding to blending the cursor with a
-                       black background).  Specify this option to remove the
-                       alpha factor. (useful for light colored semi-transparent
-                       cursors).
--noalphablend          In XFIXES mode do not send cursor alpha channel data
-                       to LibVNCServer.  The default is to send it.  The
-                       alphablend effect will only be visible in -nocursorshape
-                       mode or for clients with cursorshapeupdates turned
-                       off. (However there is a hack for 32bpp with depth 24,
-                       it uses the extra 8 bits to store cursor transparency
-                       for use with a hacked vncviewer that applies the
-                       transparency locally.  See the FAQ for more info).
-
--nocursorshape         Do not use the TightVNC CursorShapeUpdates extension
-                       even if clients support it.  See -cursor above.
--cursorpos             Option -cursorpos enables sending the X cursor position
--nocursorpos           back to all vnc clients that support the TightVNC
-                       CursorPosUpdates extension.  Other clients will be able
-                       to see the pointer motions. Default: -cursorpos
--xwarppointer          Move the pointer with XWarpPointer(3X) instead of
--noxwarppointer        the XTEST extension.  Use this as a workaround
-                       if the pointer motion behaves incorrectly, e.g.
-                       on touchscreens or other non-standard setups.
-
-                       It is also sometimes needed on XINERAMA displays and is
-                       enabled by default if XINERAMA is found to be active.
-                       To prevent this, use -noxwarppointer.
-
--always_inject         Even if there is no displacement (dx = dy = 0) for a
-                       VNC mouse event force the pointer to the indicated x,y
-                       position anyway.  Recent (2009) gui toolkits (gnome)
-                       have problems with x11vnc's original mouse input
-                       injection method.  So x11vnc's mouse input injection
-                       method has been modified.  To regain the OLD behavior
-                       use this option: -always_inject.  Then x11vnc will
-                       always force positioning the mouse to the x,y position
-                       even if that position has not changed since the previous
-                       VNC input event.
-
-                       The first place this problem was noticed was in gnome
-                       terminal: if you pressed and released mouse button 3, a
-                       menu was posted and then its first element 'New Terminal
-                       Window' was activated.  This was because x11vnc injected
-                       the mouse position twice: once on ButtonPress and again
-                       on ButtonRelease.  The toolkit interpreted the 2nd one
-                       as mouse motion even though the mouse hadn't moved.
-                       So now by default x11vnc tries to avoid injecting the
-                       2nd one.
-
-                       Note that with the new default x11vnc will be oblivious
-                       to applications moving the pointer (warping) or the
-                       user at the physical display moving it.  So it might,
-                       e.g., inject ButtonRelease at the wrong position.
-                       If this (or similar scenarios) causes problems in your
-                       environment, specify -always_inject for the old method.
-
--buttonmap string      String to remap mouse buttons.  Format: IJK-LMN, this
-                       maps buttons I -> L, etc., e.g.  -buttonmap 13-31
-
-                       Button presses can also be mapped to keystrokes: replace
-                       a button digit on the right of the dash with :<sym>:
-                       or :<sym1>+<sym2>: etc. for multiple keys. For example,
-                       if the viewing machine has a mouse-wheel (buttons 4 5)
-                       but the x11vnc side does not, these will do scrolls:
-                              -buttonmap 12345-123:Prior::Next:
-                              -buttonmap 12345-123:Up+Up+Up::Down+Down+Down:
-
-                       See <X11/keysymdef.h> header file for a list of Keysyms,
-                       or use the xev(1) program.  Note: mapping of button
-                       clicks to Keysyms may not work if -modtweak or -xkb is
-                       needed for the Keysym.
-
-                       If you include a modifier like "Shift_L" the
-                       modifier's up/down state is toggled, e.g. to send
-                       "The" use :Shift_L+t+Shift_L+h+e: (the 1st one is
-                       shift down and the 2nd one is shift up). (note: the
-                       initial state of the modifier is ignored and not reset)
-                       To include button events use "Button1", ... etc.
-
-                       -buttonmap currently does not work on MacOSX console
-                       or in -rawfb mode.
-
-                       Workaround: use -buttonmap IJ...-LM...=n to limit the
-                       number of mouse buttons to n, e.g. 123-123=3.  This will
-                       prevent x11vnc from crashing if the X server reports
-                       there are 5 buttons (4/5 scroll wheel), but there are
-                       only really 3.
-
--nodragging            Do not update the display during mouse dragging events
-                       (mouse button held down).  Greatly improves response on
-                       slow setups, but you lose all visual feedback for drags,
-                       text selection, and some menu traversals.  It overrides
-                       any -pointer_mode setting.
-
--ncache n              Client-side caching scheme.  Framebuffer memory "n"
-                       (an integer) times that of the full display is allocated
-                       below the actual framebuffer to cache screen contents
-                       for rapid retrieval.  So a W x H frambuffer is expanded
-                       to a W x (n+1)*H one.  Use 0 to disable.
-
-                       The "n" is actually optional, the default is 10.
-
-                       For this and the other -ncache* options below you can
-                       abbreviate "-ncache" with "-nc".  Also, "-nonc"
-                       is the same as "-ncache 0"
-
-                       This is an experimental option, currently implemented in
-                       an awkward way in that in the VNC Viewer you can see the
-                       pixel cache contents if you scroll down, etc.  So you
-                       will have to set things up so you can't see that region.
-                       If this method is successful, the changes required for
-                       clients to do this less awkwardly will be investigated.
-
-                       The SSVNC viewer does a good job at automatically hiding
-                       the pixel cache region.  Or use SSVNC's -ycrop option
-                       to explicitly hide the region.
-
-                       Note that this mode consumes a huge amount of memory,
-                       both on the x11vnc server side and on the VNC Viewer
-                       side.  If n=2 then the amount of RAM used is roughly
-                       tripled for both x11vnc and the VNC Viewer.  As a rule
-                       of thumb, note that 1280x1024 at depth 24 is about 5MB
-                       of pixel data.
-
-                       For reasonable response when cycling through 4 to 6
-                       large (e.g. web browser) windows a value n of 6 to 12
-                       is recommended. (that's right: ~10X more memory...)
-
-                       Because of the way window backingstore and saveunders
-                       are implemented, n must be even.  It will be incremented
-                       by 1 if it is not.
-
-                       This mode also works for native MacOS X, but may not
-                       be as effective as the X version.  This is due to a
-                       number of things, one is the drop-shadow compositing
-                       that leaves extra areas that need to be repaired (see
-                       -ncache_pad).  Another is the window iconification
-                       animations need to be avoided (see -macicontime).
-                       It appears the that the 'Scale' animation mode gives
-                       better results than the 'Genie' one.  Also, window event
-                       detection not as accurate as the X version.
-
--ncache_cr             In -ncache mode, try to do copyrect opaque window
-                       moves/drags instead of wireframes (this can induce
-                       painting errors).  The wireframe will still be used when
-                       moving a window whose save-unders has not yet been set
-                       or has been invalidated.
-
-                       Some VNC Viewers provide better response than others
-                       with this option.  On Unix, realvnc viewer gives
-                       smoother drags than tightvnc viewer.  Response may also
-                       be choppy if the server side machine is too slow.
-
-                       Sometimes on very slow modem connections, this actually
-                       gives an improvement because no pixel data at all
-                       (not even the box animation) is sent during the drag.
-
--ncache_no_moveraise   In -ncache mode, do not assume that moving a window
-                       will cause the window manager to raise it to the top
-                       of the stack.  The default is to assume it does, and
-                       so at the beginning of any wireframe, etc, window moves
-                       the window will be pushed to top in the VNC viewer.
-
--ncache_no_dtchange    In -ncache mode, do not try to guess when the desktop
-                       (viewport) changes to another one (i.e. another
-                       workarea).  The default is to try to guess and when
-                       detected try to make the transistion more smoothly.
-
--ncache_no_rootpixmap  In -ncache mode, do not try to snapshot the desktop
-                       background to use in guessing or reconstructing window
-                       save-unders.
-
--ncache_keep_anims     In -ncache mode, do not try to disable window
-                       manager animations and other effects (that usually
-                       degrade ncache performance or cause painting errors).
-                       The default is to try to disable them on KDE (but not
-                       GNOME) when VNC clients are connected.
-
-                       For other window managers or desktops that provide
-                       animations, effects, compositing, translucency,
-                       etc. that interfere with the -ncache method you will
-                       have to disable them manually.
-
--ncache_old_wm         In -ncache mode, enable some heuristics for old style
-                       window managers such as fvwm and twm.
-
--ncache_pad n          In -ncache mode, pad each window with n pixels for the
-                       caching rectangles.  This can be used to try to improve
-                       the situation with dropshadows or other compositing
-                       (e.g. MacOS X window manager), although it could make
-                       things worse.  The default is 0 on Unix and 24 on
-                       MacOS X.
--debug_ncache          Turn on debugging and profiling output under -ncache.
-
--wireframe [str]       Try to detect window moves or resizes when a mouse
--nowireframe           button is held down and show a wireframe instead of
-                       the full opaque window.  This is based completely on
-                       heuristics and may not always work: it depends on your
-                       window manager and even how you move things around.
-                       See -pointer_mode below for discussion of the "bogging
-                       down" problem this tries to avoid.
-                       Default: -wireframe
-
-                       Shorter aliases:  -wf [str]  and -nowf
-
-                       The value "str" is optional and, of course, is
-                       packed with many tunable parameters for this scheme:
-
-                       Format: shade,linewidth,percent,T+B+L+R,mod,t1+t2+t3+t4
-                       Default: 0xff,2,0,32+8+8+8,all,0.15+0.30+5.0+0.125
-
-                       If you leave nothing between commas: ",," the default
-                       value is used.  If you don't specify enough commas,
-                       the trailing parameters are set to their defaults.
-
-                       "shade" indicate the "color" for the wireframe,
-                       usually a greyscale: 0-255, however for 16 and 32bpp you
-                       can specify an rgb.txt X color (e.g. "dodgerblue") or
-                       a value > 255 is treated as RGB (e.g. red is 0xff0000).
-                       "linewidth" sets the width of the wireframe in pixels.
-                       "percent" indicates to not apply the wireframe scheme
-                       to windows with area less than this percent of the
-                       full screen.
-
-                       "T+B+L+R" indicates four integers for how close in
-                       pixels the pointer has to be from the Top, Bottom, Left,
-                       or Right edges of the window to consider wireframing.
-                       This is a speedup to quickly exclude a window from being
-                       wireframed: set them all to zero to not try the speedup
-                       (scrolling and selecting text will likely be slower).
-
-                       "mod" specifies if a button down event in the
-                       interior of the window with a modifier key (Alt, Shift,
-                       etc.) down should indicate a wireframe opportunity.
-                       It can be "0" or "none" to skip it, "1" or "all"
-                       to apply it to any modifier, or "Shift", "Alt",
-                       "Control", "Meta", "Super", or "Hyper" to only
-                       apply for that type of modifier key.
-
-                       "t1+t2+t3+t4" specify four floating point times in
-                       seconds: t1 is how long to wait for the pointer to move,
-                       t2 is how long to wait for the window to start moving
-                       or being resized (for some window managers this can be
-                       rather long), t3 is how long to keep a wireframe moving
-                       before repainting the window. t4 is the minimum time
-                       between sending wireframe "animations".  If a slow
-                       link is detected, these values may be automatically
-                       changed to something better for a slow link.
-
--nowireframelocal      By default, mouse motion and button presses of a
-                       user sitting at the LOCAL display are monitored for
-                       wireframing opportunities (so that the changes will be
-                       sent efficiently to the VNC clients).  Use this option
-                       to disable this behavior.
-
--wirecopyrect mode     Since the -wireframe mechanism evidently tracks moving
--nowirecopyrect        windows accurately, a speedup can be obtained by
-                       telling the VNC viewers to locally copy the translated
-                       window region.  This is the VNC CopyRect encoding:
-                       the framebuffer update doesn't need to send the actual
-                       new image data.
-
-                       Shorter aliases:  -wcr [mode]  and -nowcr
-
-                       "mode" can be "never" (same as -nowirecopyrect)
-                       to never try the copyrect, "top" means only do it if
-                       the window was not covered by any other windows, and
-                       "always" means to translate the orginally unobscured
-                       region (this may look odd as the remaining pieces come
-                       in, but helps on a slow link).  Default: "always"
-
-                       Note: there can be painting errors or slow response
-                       when using -scale so you may want to disable CopyRect
-                       in this case "-wirecopyrect never" on the command
-                       line or by remote-control.  Or you can also use the
-                       "-scale xxx:nocr" scale option.
-
--debug_wireframe       Turn on debugging info printout for the wireframe
-                       heuristics.  "-dwf" is an alias.  Specify multiple
-                       times for more output.
-
--scrollcopyrect mode   Like -wirecopyrect, but use heuristics to try to guess
--noscrollcopyrect      if a window has scrolled its contents (either vertically
-                       or horizontally).  This requires the RECORD X extension
-                       to "snoop" on X applications (currently for certain
-                       XCopyArea and XConfigureWindow X protocol requests).
-                       Examples: Hitting <Return> in a terminal window when the
-                       cursor was at the bottom, the text scrolls up one line.
-                       Hitting <Down> arrow in a web browser window, the web
-                       page scrolls up a small amount.  Or scrolling with a
-                       scrollbar or mouse wheel.
-
-                       Shorter aliases:  -scr [mode]  and -noscr
-
-                       This scheme will not always detect scrolls, but when
-                       it does there is a nice speedup from using the VNC
-                       CopyRect encoding (see -wirecopyrect).  The speedup
-                       is both in reduced network traffic and reduced X
-                       framebuffer polling/copying.  On the other hand, it may
-                       induce undesired transients (e.g. a terminal cursor
-                       being scrolled up when it should not be) or other
-                       painting errors (window tearing, bunching-up, etc).
-                       These are automatically repaired in a short period
-                       of time.  If this is unacceptable disable the feature
-                       with -noscrollcopyrect.
-
-                       Screen clearing kludges:  for testing at least, there
-                       are some "magic key sequences" (must be done in less
-                       than 1 second) to aid repairing painting errors that
-                       may be seen when using this mode:
-
-                       3 Alt_L's   in a row: resend whole screen,
-                       4 Alt_L's   in a row: reread and resend whole screen,
-                       3 Super_L's in a row: mark whole screen for polling,
-                       4 Super_L's in a row: reset RECORD context,
-                       5 Super_L's in a row: try to push a black screen
-
-                       note: Alt_L is the Left "Alt" key (a single key)
-                       Super_L is the Left "Super" key (Windows flag).
-                       Both of these are modifier keys, and so should not
-                       generate characters when pressed by themselves.  Also,
-                       your VNC viewer may have its own refresh hot-key
-                       or button.
-
-                       "mode" can be "never" (same as -noscrollcopyrect)
-                       to never try the copyrect, "keys" means to try it
-                       in response to keystrokes only, "mouse" means to
-                       try it in response to mouse events only, "always"
-                       means to do both. Default: "always"
-
-                       Note: there can be painting errors or slow response
-                       when using -scale so you may want to disable CopyRect
-                       in this case "-scrollcopyrect never" on the command
-                       line or by remote-control.  Or you can also use the
-                       "-scale xxx:nocr" scale option.
-
--scr_area n            Set the minimum area in pixels for a rectangle
-                       to be considered for the -scrollcopyrect detection
-                       scheme.  This is to avoid wasting the effort on small
-                       rectangles that would be quickly updated the normal way.
-                       E.g. suppose an app updated the position of its skinny
-                       scrollbar first and then shifted the large panel
-                       it controlled.  We want to be sure to skip the small
-                       scrollbar and get the large panel. Default: 60000
-
--scr_skip list         Skip scroll detection for applications matching
-                       the comma separated list of strings in "list".
-                       Some applications implement their scrolling in
-                       strange ways where the XCopyArea, etc, also applies
-                       to invisible portions of the window: if we CopyRect
-                       those areas it looks awful during the scroll and
-                       there may be painting errors left after the scroll.
-                       Soffice.bin is the worst known offender.
-
-                       Use "##" to denote the start of the application class
-                       (e.g. "##XTerm") and "++" to denote the start
-                       of the application instance name (e.g. "++xterm").
-                       The string your list is matched against is of the form
-                       "^^WM_NAME##Class++Instance<same-for-any-subwindows>"
-                       The "xlsclients -la" command will provide this info.
-
-                       If a pattern is prefixed with "KEY:" it only applies
-                       to Keystroke generated scrolls (e.g. Up arrow).  If it
-                       is prefixed with "MOUSE:" it only applies to Mouse
-                       induced scrolls (e.g. dragging on a scrollbar).
-                       Default: ##Soffice.bin,##StarOffice,##OpenOffice
-
--scr_inc list          Opposite of -scr_skip: this list is consulted first
-                       and if there is a match the window will be monitored
-                       via RECORD for scrolls irrespective of -scr_skip.
-                       Use -scr_skip '*' to skip anything that does not match
-                       your -scr_inc.  Use -scr_inc '*' to include everything.
-
--scr_keys list         For keystroke scroll detection, only apply the RECORD
-                       heuristics to the comma separated list of keysyms in
-                       "list".  You may find the RECORD overhead for every
-                       one of your keystrokes disrupts typing too much, but you
-                       don't want to turn it off completely with "-scr mouse"
-                       and -scr_parms does not work or is too confusing.
-
-                       The listed keysyms can be numeric or the keysym
-                       names in the <X11/keysymdef.h> header file or from the
-                       xev(1) program.  Example: "-scr_keys Up,Down,Return".
-                       One probably wants to have application specific lists
-                       (e.g. for terminals, etc) but that is too icky to think
-                       about for now...
-
-                       If "list" begins with the "-" character the list
-                       is taken as an exclude list: all keysyms except those
-                       list will be considered.  The special string "builtin"
-                       expands to an internal list of keysyms that are likely
-                       to cause scrolls.  BTW, by default modifier keys,
-                       Shift_L, Control_R, etc, are skipped since they almost
-                       never induce scrolling by themselves.
-
--scr_term list         Yet another cosmetic kludge.  Apply shell/terminal
-                       heuristics to applications matching comma separated
-                       list (same as for -scr_skip/-scr_inc).  For example an
-                       annoying transient under scroll detection is if you
-                       hit Enter in a terminal shell with full text window,
-                       the solid text cursor block will be scrolled up.
-                       So for a short time there are two (or more) block
-                       cursors on the screen.  There are similar scenarios,
-                       (e.g. an output line is duplicated).
-
-                       These transients are induced by the approximation of
-                       scroll detection (e.g. it detects the scroll, but not
-                       the fact that the block cursor was cleared just before
-                       the scroll).  In nearly all cases these transient errors
-                       are repaired when the true X framebuffer is consulted
-                       by the normal polling.  But they are distracting, so
-                       what this option provides is extra "padding" near the
-                       bottom of the terminal window: a few extra lines near
-                       the bottom will not be scrolled, but rather updated
-                       from the actual X framebuffer.  This usually reduces
-                       the annoying artifacts.  Use "none" to disable.
-                       Default: "term"
-
--scr_keyrepeat lo-hi   If a key is held down (or otherwise repeats rapidly) and
-                       this induces a rapid sequence of scrolls (e.g. holding
-                       down an Arrow key) the "scrollcopyrect" detection
-                       and overhead may not be able to keep up.  A time per
-                       single scroll estimate is performed and if that estimate
-                       predicts a sustainable scrollrate of keys per second
-                       between "lo" and "hi" then repeated keys will be
-                       DISCARDED to maintain the scrollrate. For example your
-                       key autorepeat may be 25 keys/sec, but for a large
-                       window or slow link only 8 scrolls per second can be
-                       sustained, then roughly 2 out of every 3 repeated keys
-                       will be discarded during this period. Default: "4-20"
-
--scr_parms string      Set various parameters for the scrollcopyrect mode.
-                       The format is similar to that for -wireframe and packed
-                       with lots of parameters:
-
-                       Format: T+B+L+R,t1+t2+t3,s1+s2+s3+s4+s5
-                       Default: 0+64+32+32,0.02+0.10+0.9,0.03+0.06+0.5+0.1+5.0
-
-                       If you leave nothing between commas: ",," the default
-                       value is used.  If you don't specify enough commas,
-                       the trailing parameters are set to their defaults.
-
-                       "T+B+L+R" indicates four integers for how close in
-                       pixels the pointer has to be from the Top, Bottom, Left,
-                       or Right edges of the window to consider scrollcopyrect.
-                       If -wireframe overlaps it takes precedence.  This is a
-                       speedup to quickly exclude a window from being watched
-                       for scrollcopyrect: set them all to zero to not try
-                       the speedup (things like selecting text will likely
-                       be slower).
-
-                       "t1+t2+t3" specify three floating point times in
-                       seconds that apply to scrollcopyrect detection with
-                       *Keystroke* input: t1 is how long to wait after a key
-                       is pressed for the first scroll, t2 is how long to keep
-                       looking after a Keystroke scroll for more scrolls.
-                       t3 is how frequently to try to update surrounding
-                       scrollbars outside of the scrolling area (0.0 to
-                       disable)
-
-                       "s1+s2+s3+s4+s5" specify five floating point times
-                       in seconds that apply to scrollcopyrect detection with
-                       *Mouse* input: s1 is how long to wait after a mouse
-                       button is pressed for the first scroll, s2 is how long
-                       to keep waiting for additional scrolls after the first
-                       Mouse scroll was detected.  s3 is how frequently to
-                       try to update surrounding scrollbars outside of the
-                       scrolling area (0.0 to disable).  s4 is how long to
-                       buffer pointer motion (to try to get fewer, bigger
-                       mouse scrolls). s5 is the maximum time to spend just
-                       updating the scroll window without updating the rest
-                       of the screen.
-
--fixscreen string      Periodically "repair" the screen based on settings
-                       in "string".  Hopefully you won't need this option,
-                       it is intended for cases when the -scrollcopyrect or
-                       -wirecopyrect features leave too many painting errors,
-                       but it can be used for any scenario.  This option
-                       periodically performs costly operations and so
-                       interactive response may be reduced when it is on.
-                       You can use 3 Alt_L's (the Left "Alt" key) taps in
-                       a row (as described under -scrollcopyrect) instead to
-                       manually request a screen repaint when it is needed.
-
-                       "string" is a comma separated list of one or more of
-                       the following: "V=t", "C=t", "X=t", and "8=t".
-                       In these "t" stands for a time in seconds (it is
-                       a floating point even though one should usually use
-                       values > 2 to avoid wasting resources).  V sets how
-                       frequently the entire screen should be sent to viewers
-                       (it is like the 3 Alt_L's).  C sets how long to wait
-                       after a CopyRect to repaint the full screen.  X sets
-                       how frequently to reread the full X11 framebuffer from
-                       the X server and push it out to connected viewers.
-                       Use of X should be rare, please report a bug if you
-                       find you need it. 8= applies only for -8to24 mode: it
-                       sets how often the non-default visual regions of the
-                       screen (e.g. 8bpp windows) are refreshed.  Examples:
-                       -fixscreen V=10 -fixscreen C=10
-
--debug_scroll          Turn on debugging info printout for the scroll
-                       heuristics.  "-ds" is an alias.  Specify it multiple
-                       times for more output.
-
--noxrecord             Disable any use of the RECORD extension.  This is
-                       currently used by the -scrollcopyrect scheme and to
-                       monitor X server grabs.
-
--grab_buster           Some of the use of the RECORD extension can leave a
--nograb_buster         tiny window for XGrabServer deadlock.  This is only if
-                       the whole-server grabbing application expects mouse or
-                       keyboard input before releasing the grab.  It is usually
-                       a window manager that does this.  x11vnc takes care to
-                       avoid the problem, but if caught x11vnc will freeze.
-                       Without -grab_buster, the only solution is to go the
-                       physical display and give it some input to satisfy the
-                       grabbing app.  Or manually kill and restart the window
-                       manager if that is feasible.  With -grab_buster, x11vnc
-                       will fork a helper thread and if x11vnc appears to be
-                       stuck in a grab after a period of time (20-30 sec) then
-                       it will inject some user input: button clicks, Escape,
-                       mouse motion, etc to try to break the grab.  If you
-                       experience a lot of grab deadlock, please report a bug.
-
--debug_grabs           Turn on debugging info printout with respect to
-                       XGrabServer() deadlock for -scrollcopyrect mode.
-
--debug_sel             Turn on debugging info printout with respect to
-                       PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.
-
--pointer_mode n        Various pointer motion update schemes. "-pm" is
-                       an alias.  The problem is pointer motion can cause
-                       rapid changes on the screen: consider the rapid
-                       changes when you drag a large window around opaquely.
-                       Neither x11vnc's screen polling and vnc compression
-                       routines nor the bandwidth to the vncviewers can keep
-                       up these rapid screen changes: everything will bog down
-                       when dragging or scrolling.  So a scheme has to be used
-                       to "eat" much of that pointer input before re-polling
-                       the screen and sending out framebuffer updates. The
-                       mode number "n" can be 0 to 4 and selects one of
-                       the schemes desribed below.
-
-                       Note that the -wireframe and -scrollcopyrect modes
-                       complement -pointer_mode by detecting (and improving)
-                       certain periods of "rapid screen change".
-
-                       n=0: does the same as -nodragging. (all screen polling
-                       is suspended if a mouse button is pressed.)
-
-                       n=1: was the original scheme used to about Jan 2004:
-                       it basically just skips -input_skip keyboard or pointer
-                       events before repolling the screen.
-
-                       n=2 is an improved scheme: by watching the current rate
-                       of input events it tries to detect if it should try to
-                       "eat" additional pointer events before continuing.
-
-                       n=3 is basically a dynamic -nodragging mode: it detects
-                       when the mouse motion has paused and then refreshes
-                       the display.
-
-                       n=4 attempts to measures network rates and latency,
-                       the video card read rate, and how many tiles have been
-                       changed on the screen.  From this, it aggressively tries
-                       to push screen "frames" when it decides it has enough
-                       resources to do so.  NOT FINISHED.
-
-                       The default n is 2. Note that modes 2, 3, 4 will skip
-                       -input_skip keyboard events (but it will not count
-                       pointer events).  Also note that these modes are not
-                       available in -threads mode which has its own pointer
-                       event handling mechanism.
-
-                       To try out the different pointer modes to see which
-                       one gives the best response for your usage, it is
-                       convenient to use the remote control function, for
-                       example "x11vnc -R pm:4" or the tcl/tk gui (Tuning ->
-                       pointer_mode -> n).
-
--input_skip n          For the pointer handling when non-threaded: try to
-                       read n user input events before scanning display. n < 0
-                       means to act as though there is always user input.
-                       Default: 10
-
--allinput              Have x11vnc read and process all available client input
-                       before proceeding.
-
--input_eagerly         Similar to -allinput but use the handleEventsEagerly
-                       mechanism built into LibVNCServer.
-
--speeds rd,bw,lat      x11vnc tries to estimate some speed parameters that
-                       are used to optimize scheduling (e.g. -pointer_mode
-                       4, -wireframe, -scrollcopyrect) and other things.
-                       Use the -speeds option to set these manually.
-                       The triple "rd,bw,lat" corresponds to video h/w
-                       read rate in MB/sec, network bandwidth to clients in
-                       KB/sec, and network latency to clients in milliseconds,
-                       respectively.  If a value is left blank, e.g. "-speeds
-                       ,100,15", then the internal scheme is used to estimate
-                       the empty value(s).
-
-                       Typical PC video cards have read rates of 5-10 MB/sec.
-                       If the framebuffer is in main memory instead of video
-                       h/w (e.g. SunRay, shadowfb, dummy driver, Xvfb), the
-                       read rate may be much faster.  "x11perf -getimage500"
-                       can be used to get a lower bound (remember to factor
-                       in the bytes per pixel).  It is up to you to estimate
-                       the network bandwith and latency to clients.  For the
-                       latency the ping(1) command can be used.
-
-                       For convenience there are some aliases provided,
-                       e.g. "-speeds modem".  The aliases are: "modem" for
-                       6,4,200; "dsl" for 6,100,50; and "lan" for 6,5000,1
-
--wmdt string           For some features, e.g. -wireframe and -scrollcopyrect,
-                       x11vnc has to work around issues for certain window
-                       managers or desktops (currently kde and xfce).
-                       By default it tries to guess which one, but it can
-                       guess incorrectly.  Use this option to indicate which
-                       wm/dt.  "string" can be "gnome", "kde", "cde",
-                       "xfce", or "root" (classic X wm).  Anything else
-                       is interpreted as "root".
-
--debug_pointer         Print debugging output for every pointer event.
--debug_keyboard        Print debugging output for every keyboard event.
-                       Same as -dp and -dk, respectively.  Use multiple
-                       times for more output.
-
--defer time            Time in ms to delay sending updates to connected clients
-                       (deferUpdateTime)  Default: 20
-
--wait time             Time in ms to pause between screen polls.  Used to cut
-                       down on load.  Default: 20
-
--extra_fbur n          Perform extra FrameBufferUpdateRequests checks to
-                       try to be in better sync with the client's requests.
-                       What this does is perform extra polls of the client
-                       socket at critical times (before '-defer' and '-wait'
-                       calls.)  The default is n=1.  Set to a larger number to
-                       insert more checks or set to n=0 to disable.  A downside
-                       of these extra calls is that more mouse input may be
-                       processed than desired.
-
--wait_ui factor        Factor by which to cut the -wait time if there
-                       has been recent user input (pointer or keyboard).
-                       Improves response, but increases the load whenever you
-                       are moving the mouse or typing.  Default: 2.00
--setdefer n            When the -wait_ui mechanism cuts down the wait time ms,
-                       set the defer time to the same ms value. n=1 to enable,
-                       0 to disable, and -1 to set defer to 0 (no delay).
-                       Similarly, 2 and -2 indicate 'urgent_update' mode should
-                       be used to push the updates even sooner.  Default: 1
--nowait_bog            Do not detect if the screen polling is "bogging down"
-                       and sleep more.  Some activities with no user input can
-                       slow things down a lot: consider a large terminal window
-                       with a long build running in it continuously streaming
-                       text output.  By default x11vnc will try to detect this
-                       (3 screen polls in a row each longer than 0.25 sec with
-                       no user input), and sleep up to 1.5 secs to let things
-                       "catch up".  Use this option to disable that detection.
--slow_fb time          Floating point time in seconds to delay all screen
-                       polling.  For special purpose usage where a low frame
-                       rate is acceptable and desirable, but you want the
-                       user input processed at the normal rate so you cannot
-                       use -wait.
--xrefresh time         Floating point time in seconds to indicate how often to
-                       do the equivalent of xrefresh(1) to force all windows
-                       (in the viewable area if -id, -sid, or -clip is used)
-                       to repaint themselves.  Use this only if applications
-                       misbehave by not repainting themselves properly.
-                       See also -noxdamage.
--nap                   Monitor activity and if it is low take longer naps
--nonap                 between screen polls to really cut down load when idle.
-                       Default: take naps
--sb time               Time in seconds after NO activity (e.g. screen blank)
-                       to really throttle down the screen polls (i.e. sleep
-                       for about 1.5 secs). Use 0 to disable.  Default: 60
-                       Set the env. var. X11VNC_SB_FACTOR to scale it.
-
--readtimeout n         Set LibVNCServer rfbMaxClientWait to n seconds. On
-                       slow links that take a long time to paint the first
-                       screen LibVNCServer may hit the timeout and drop the
-                       connection.  Default: 20 seconds.
--ping n                Send a 1x1 framebuffer update to all clients every n
-                       seconds (e.g. to try to keep a network connection alive)
-
--nofbpm                If the system supports the FBPM (Frame Buffer Power
--fbpm                  Management) extension (i.e. some Sun systems), then
-                       prevent the video h/w from going into a reduced power
-                       state when VNC clients are connected.
-
-                       FBPM capable video h/w save energy when the workstation
-                       is idle by going into low power states (similar to DPMS
-                       for monitors).  This interferes with x11vnc's polling
-                       of the framebuffer data.
-
-                       "-nofbpm" means prevent FBPM low power states whenever
-                       VNC clients are connected, while "-fbpm" means to not
-                       monitor the FBPM state at all.  See the xset(1) manpage
-                       for details.  -nofbpm is basically the same as running
-                       "xset fbpm force on" periodically.  Default: -fbpm
-
--nodpms                If the system supports the DPMS (Display Power Managemen
-t
--dpms                  Signaling) extension, then prevent the monitor from
-                       going into a reduced power state when VNC clients
-                       are connected.
-
-                       DPMS reduced power monitor states are a good thing
-                       and you normally want the power down to take place
-                       (usually x11vnc has no problem exporting the display in
-                       this state).  You probably only want to use "-nodpms"
-                       to work around problems with Screen Savers kicking
-                       on in DPMS low power states.  There is known problem
-                       with kdesktop_lock on KDE where the screen saver keeps
-                       kicking in every time user input stops for a second
-                       or two.  Specifying "-nodpms" works around it.
-
-                       "-nodpms" means prevent DPMS low power states whenever
-                       VNC clients are connected, while "-dpms" means to not
-                       monitor the DPMS state at all.  See the xset(1) manpage
-                       for details.  -nodpms is basically the same as running
-                       "xset dpms force on" periodically.  Default: -dpms
-
--forcedpms             If the system supports the DPMS (Display Power
-                       Management Signaling) extension, then try to keep the
-                       monitor in a powered off state.  This is to prevent
-                       nosey people at the physical display from viewing what
-                       is on the screen.  Be sure to lock the screen before
-                       disconnecting.
-
-                       This method is far from bullet proof, e.g. suppose
-                       someone attaches a non-DPMS monitor, or loads the
-                       machine so that there is a gap of time before x11vnc
-                       restores the powered off state?  On many machines if
-                       he floods it with keyboard and mouse input he can see
-                       flashes of what is on the screen before the DPMS off
-                       state is reestablished.  For this to work securely
-                       there would need to be support in the X server to do
-                       this exactly rather than approximately with DPMS.
-
--clientdpms            As -forcedpms but only when VNC clients are connected.
-
--noserverdpms          The UltraVNC ServerInput extension is supported.
-                       This allows the VNC viewer to click a button that will
-                       cause the server (x11vnc) to try to disable keyboard
-                       and mouse input at the physical display and put the
-                       monitor in dpms powered off state.  Use this option to
-                       skip powering off the monitor.
-
--noultraext            Disable the following UltraVNC extensions: SingleWindow
-                       and ServerInput.  The others managed by LibVNCServer
-                       (textchat, 1/n scaling, rfbEncodingUltra) are not.
-
--chatwindow            Place a local UltraVNC chat window on the X11 display
-                       that x11vnc is polling.  That way the person on the VNC
-                       viewer-side can chat with the person at the physical
-                       X11 console. (e.g. helpdesk w/o telephone)
-
-                       For this to work the SSVNC package (version 1.0.21 or
-                       later) MUST BE installed on the system where x11vnc runs
-                       and the 'ssvnc' command must be available in $PATH.
-                       The ssvncviewer is used as a chat window helper.
-                       See http://www.karlrunge.com/x11vnc/ssvnc.html
-
-                       This option implies '-rfbversion 3.6' so as to trick
-                       UltraVNC viewers, otherwise they assume chat is not
-                       available.  To specify a different rfbversion, place
-                       it after the -chatwindow option on the cmdline.
-
-                       See also the remote control 'chaton' and 'chatoff'
-                       actions.  These can also be set from the tkx11vnc GUI.
-
--noxdamage             Do not use the X DAMAGE extension to detect framebuffer
-                       changes even if it is available.  Use -xdamage if your
-                       default is to have it off.
-
-                       x11vnc's use of the DAMAGE extension: 1) significantly
-                       reduces the load when the screen is not changing much,
-                       and 2) detects changed areas (small ones by default)
-                       more quickly.
-
-                       Currently the DAMAGE extension is overly conservative
-                       and often reports large areas (e.g. a whole terminal
-                       or browser window) as damaged even though the actual
-                       changed region is much smaller (sometimes just a few
-                       pixels).  So heuristics were introduced to skip large
-                       areas and use the damage rectangles only as "hints"
-                       for the traditional scanline polling.  The following
-                       tuning parameters are introduced to adjust this
-                       behavior:
-
--xd_area A             Set the largest DAMAGE rectangle area "A" (in
-                       pixels: width * height) to trust as truly damaged:
-                       the rectangle will be copied from the framebuffer
-                       (slow) no matter what.  Set to zero to trust *all*
-                       rectangles. Default: 20000
--xd_mem f              Set how long DAMAGE rectangles should be "remembered",
-                       "f" is a floating point number and is in units of the
-                       scanline repeat cycle time (32 iterations).  The default
-                       (1.0) should give no painting problems. Increase it if
-                       there are problems or decrease it to live on the edge
-                       (perhaps useful on a slow machine).
-
--sigpipe string        Broken pipe (SIGPIPE) handling.  "string" can be
-                       "ignore" or "exit".  For "ignore" LibVNCServer
-                       will handle the abrupt loss of a client and continue,
-                       for "exit" x11vnc will cleanup and exit at the 1st
-                       broken connection.
-
-                       This option is not really needed since LibVNCServer
-                       is doing the correct thing now for quite some time.
-                       However, for convenience you can use it to ignore other
-                       signals, e.g. "-sigpipe ignore:HUP,INT,TERM" in case
-                       that would be useful for some sort of application.
-                       You can also put "exit:.." in the list to have x11vnc
-                       cleanup on the listed signals. "-sig" is an alias
-                       for this option if you don't like the 'pipe'. Example:
-                       -sig ignore:INT,TERM,exit:USR1
-
--threads               Whether or not to use the threaded LibVNCServer
--nothreads             algorithm [rfbRunEventLoop] if libpthread is available.
-                       In this mode new threads (one for input and one
-                       for output) are created to handle each new client.
-                       Default: -nothreads.
-
-                       Thread stability is much improved in version 0.9.8.
-
-                       Multiple clients in threaded mode should be stable
-                       for the ZRLE encoding on all platforms.  The Tight and
-                       Zlib encodings are currently only stable on Linux for
-                       multiple clients.  Compile with -DTLS=__thread if your
-                       OS and compiler and linker support it.
-
-                       For resizes (randr, etc.) set this env. var. to the numb
-er
-                       of milliseconds to sleep: X11VNC_THREADS_NEW_FB_SLEEP
-                       at various places in the do_new_fb() action.  This is to
-                       let various activities settle.  Default is about 500ms.
-
-                       Multiple clients in threaded mode could yield better
-                       performance for 'class-room' broadcasting usage; also in
-                       -appshare broadcast mode.  See also the -reflect option.
-
--fs f                  If the fraction of changed tiles in a poll is greater
-                       than f, the whole screen is updated.  Default: 0.75
--gaps n                Heuristic to fill in gaps in rows or cols of n or
-                       less tiles.  Used to improve text paging.  Default: 4
--grow n                Heuristic to grow islands of changed tiles n or wider
-                       by checking the tile near the boundary.  Default: 3
--fuzz n                Tolerance in pixels to mark a tiles edges as changed.
-                       Default: 2
--debug_tiles           Print debugging output for tiles, fb updates, etc.
-
--snapfb                Instead of polling the X display framebuffer (fb)
-                       for changes, periodically copy all of X display fb
-                       into main memory and examine that copy for changes.
-                       (This setting also applies for non-X -rawfb modes).
-                       Under some circumstances this will improve interactive
-                       response, or at least make things look smoother, but in
-                       others (most!) it will make the response worse.  If the
-                       video h/w fb is such that reading small tiles is very
-                       slow this mode could help.  To keep the "framerate"
-                       up the screen size x bpp cannot be too large.  Note that
-                       this mode is very wasteful of memory I/O resources
-                       (it makes full screen copies even if nothing changes).
-                       It may be of use in video capture-like applications,
-                       webcams, or where window tearing is a problem.
-
--rawfb string          Instead of polling X, poll the memory object specified
-                       in "string".
-
-                       For file polling, to memory map mmap(2) a file use:
-                       "map:/path/to/a/file at WxHxB", with framebuffer Width,
-                       Height, and Bits per pixel.  "mmap:..." is the
-                       same.
-
-                       If there is trouble with mmap, use "file:/..."
-                       for slower lseek(2) based reading.
-
-                       Use "snap:..." to imply -snapfb mode and the "file:"
-                       access (this is for unseekable devices that only provide
-                       the fb all at once, e.g. a video camera provides the
-                       whole frame).
-
-                       For shared memory segments string is of the form:
-                       "shm:N at WxHxB" which specifies a shmid N and with
-                       WxHxB as above.  See shmat(1) and ipcs(1)
-
-                       If you do not supply a type "map" is assumed if
-                       the file exists (see the next paragraphs for some
-                       exceptions to this.)
-
-                       If string is "setup:cmd", then the command "cmd"
-                       is run and the first line from it is read and used
-                       as "string".  This allows initializing the device,
-                       determining WxHxB, etc. These are often done as root
-                       so take care.
-
-                       If the string begins with "video", see the VIDEO4LINUX
-                       discussion below where the device may be queried for
-                       (and possibly set) the framebuffer parameters.
-
-                       If the string begins with "console", "/dev/fb",
-                       "fb", or "vt", see the LINUX CONSOLE discussion
-                       below where the framebuffer device is opened and
-                       keystrokes (and possibly mouse events) are inserted
-                       into the console.
-
-                       If the string begins with "vnc", see the VNC HOST
-                       discussion below where the framebuffer is taken as that
-                       of another remote VNC server.
-
-                       Optional suffixes are ":R/G/B" and "+O" to specify
-                       red, green, and blue masks (in hex) and an offset into
-                       the memory object.  If the masks are not provided x11vnc
-                       guesses them based on the bpp (if the colors look wrong,
-                       you need to provide the masks.)
-
-                       Another optional suffix is the Bytes Per Line which in
-                       some cases is not WxB/8.  Specify it as WxHxB-BPL
-                       e.g. 800x600x16-2048.  This could be a normal width
-                       1024 at 16bpp fb, but only width 800 shows up.
-
-                       So the full format is: mode:file at WxHxB:R/G/B+O-BPL
-
-                       Examples:
-                           -rawfb shm:210337933 at 800x600x32:ff/ff00/ff0000
-                           -rawfb map:/dev/fb0 at 1024x768x32
-                           -rawfb map:/tmp/Xvfb_screen0 at 640x480x8+3232
-                           -rawfb file:/tmp/my.pnm at 250x200x24+37
-                           -rawfb file:/dev/urandom at 128x128x8
-                           -rawfb snap:/dev/video0 at 320x240x24 -24to32
-                           -rawfb video0
-                           -rawfb video -pipeinput VID
-                           -rawfb console
-                           -rawfb vt2
-                           -rawfb vnc:somehost:0
-
-                       (see ipcs(1) and fbset(1) for the first two examples)
-
-                       In general all user input is discarded by default (see
-                       the -pipeinput option for how to use a helper program
-                       to insert).  Most of the X11 (screen, keyboard, mouse)
-                       options do not make sense and many will cause this
-                       mode to crash, so please think twice before setting or
-                       changing them in a running x11vnc.
-
-                       If you DO NOT want x11vnc to close the X DISPLAY in
-                       rawfb mode, prepend a "+" e.g. +file:/dev/fb0...
-                       Keeping the display open enables the default
-                       remote-control channel, which could be useful.
-                       Alternatively, if you specify -noviewonly, then the
-                       mouse and keyboard input are STILL sent to the X
-                       display, this usage should be very rare, i.e. doing
-                       something strange with /dev/fb0.
-
-                       If the device is not "seekable" (e.g. webcam) try
-                       reading it all at once in full snaps via the "snap:"
-                       mode (note: this is a resource hog).  If you are using
-                       file: or map: AND the device needs to be reopened for
-                       *every* snapfb snapshot, set the environment variable:
-                       SNAPFB_RAWFB_RESET=1 as well.
-
-                       If you want x11vnc to dynamically transform a 24bpp
-                       rawfb to 32bpp (note that this will be slower) also
-                       supply the -24to32 option.  This would be useful for,
-                       say, a video camera that delivers the pixel data as
-                       24bpp packed RGB.  This is the default under "video"
-                       mode if the bpp is 24.
-
-                       Normally the bits per pixel, B, is 8, 16, or 32 (or
-                       rarely 24), however there is also some support for
-                       B < 8 (e.g. old graphics displays 4 bpp or 1 bpp).
-                       In this case you certainly must supply the masks as
-                       well: WxHxB:R/G/B.  The pixels will be padded out to
-                       8 bpp using depth 8 truecolor.  The scheme currently
-                       does not work with snap fb (ask if interested.) B=1
-                       monochrome example: file:/dev/urandom at 128x128x1:1/1/1
-                       Some other like this are 128x128x2:3/3/3 128x128x4:7/7/7
-
-                       For B < 8 framebuffers you can also set the env. var
-                       RAWFB_CGA=1 to try a CGA mapping for B=4 (e.g. linux
-                       vga16fb driver.)  Note with low bpp and/or resolution
-                       VGA and VGA16 modes on the Linux console one's attempt
-                       to export them via x11vnc can often be thwarted due to
-                       special color palettes, pixel packings, and even video
-                       painting buffering.  OTOH, often experimenting with the
-                       RGB masks can yield something recognizable.
-
-                       VIDEO4LINUX: on Linux some attempt is made to handle
-                       video devices (webcams or TV tuners) automatically.
-                       The idea is the WxHxB will be extracted from the
-                       device itself.  So if you do not supply "@WxHxB...
-                       parameters x11vnc will try to determine them.  It first
-                       tries the v4l API if that support has been compiled in.
-                       Otherwise it will run the v4l-info(1) external program
-                       if it is available.
-
-                       The simplest examples are "-rawfb video" and "-rawfb
-                       video1" which imply the device file /dev/video and
-                       /dev/video1, respectively.  You can also supply the
-                       /dev if you like, e.g. "-rawfb /dev/video0"
-
-                       Since the video capture device framebuffer usually
-                       changes continuously (e.g. brightness fluctuations),
-                       you may want to use the -wait, -slow_fb, or -defer
-                       options to lower the "framerate" to cut down on
-                       network VNC traffic.
-
-                       A more sophisticated video device scheme allows
-                       initializing the device's settings using:
-
-                           -rawfb video:<settings>
-
-                       The prefix could also be, as above, e.g. "video1:" to
-                       specify the device file.  The v4l API must be available
-                       for this to work.  Otherwise, you will need to try
-                       to initialize the device with an external program,
-                       e.g. xawtv, spcaview, and hope they persist when x11vnc
-                       re-opens the device.
-
-                       <settings> is a comma separated list of key=value pairs.
-                       The device's brightness, color, contrast, and hue can
-                       be set to percentages, e.g. br=80,co=50,cn=44,hu=60.
-
-                       The device filename can be set too if needed (if it
-                       does not start with "video"), e.g. fn=/dev/qcam.
-
-                       The width, height and bpp of the framebuffer can be
-                       set via, e.g., w=160,h=120,bpp=16.
-
-                       Related to the bpp above, the pixel format can be set
-                       via the fmt=XXX, where XXX can be one of: GREY, HI240,
-                       RGB555, RGB565, RGB24, and RGB32 (with bpp 8, 8, 16, 16,
-                       24, and 32 respectively).  See http://www.linuxtv.org
-                       for more info (V4L api).
-
-                       For TV/rf tuner cards one can set the tuning mode
-                       via tun=XXX where XXX can be one of PAL, NTSC, SECAM,
-                       or AUTO.
-
-                       One can switch the input channel by the inp=XXX setting,
-                       where XXX is the name of the input channel (Television,
-                       Composite1, S-Video, etc).  Use the name that is in the
-                       information about the device that is printed at startup.
-
-                       For input channels with tuners (e.g. Television) one
-                       can change which station is selected by the sta=XXX
-                       setting.  XXX is the station number.  Currently only
-                       the ntsc-cable-us (US cable) channels are built into
-                       x11vnc.  See the -freqtab option below to supply one
-                       from xawtv. If XXX is greater than 500, then it is
-                       interpreted as a raw frequency in KHz.
-
-                       Example:
-
-                       -rawfb video:br=80,w=320,h=240,fmt=RGB32,tun=NTSC,sta=47
-
-                       one might need to add inp=Television too for the input
-                       channel to be TV if the card doesn't come up by default
-                       in that one.
-
-                       Note that not all video capture devices will support
-                       all of the above settings.
-
-                       See the -pipeinput VID option below for a way to control
-                       the settings through the VNC Viewer via keystrokes.
-                       As a shortcut, if the string begins "Video.." instead
-                       of "video.." then -pipeinput VID is implied.
-
-                       As above, if you specify a "@WxHxB..." after the
-                       <settings> string they are used verbatim: the device
-                       is not queried for the current values.  Otherwise the
-                       device will be queried.
-
-                       LINUX CONSOLE:  The following describes some ways to
-                       view and possibly interact with the Linux text/graphics
-                       console (i.e. not X11 XFree86/Xorg)
-
-                       Note: If the LibVNCServer LinuxVNC program is on your
-                       system you may want to use that instead of the following
-                       method because it will be faster and more accurate
-                       for the Linux text console and includes mouse support.
-                       There is, however, the basic LinuxVNC functionality in
-                       x11vnc if you replace "console" with "vt" in the
-                       examples below.
-
-                       If the rawfb string begins with "console" the
-                       framebuffer device /dev/fb0 is opened and /dev/tty0 is
-                       opened too.  The latter is used to inject keystrokes
-                       (not all are supported, but the basic ones are).
-                       You will need to be root to inject keystrokes, but
-                       not necessarily to open /dev/fb0.  /dev/tty0 refers to
-                       the active VT, to indicate one explicitly, use, e.g.,
-                       "console2" for /dev/tty2, etc. by indicating the
-                       specific VT number.
-
-                       For the Linux framebuffer device, /dev/fb0, (fb1,
-                       etc) to be enabled the appropriate kernel drivers must
-                       be loaded.  E.g. vesafb or vga16fb and also by setting
-                       the boot parameter vga=0x301 (or 0x314, 0x317, etc.)
-                       (The vga=... method is the preferred way; set your
-                       machines up that way.)  Otherwise there will be a
-                       'No such device' error.  You can also load a Linux
-                       framebuffer driver specific to your make of video card
-                       for more functionality.  Once the machine is booted one
-                       can often 'modprobe' the fb driver as root to obtain
-                       a framebuffer device.
-
-                       If you cannot get /dev/fb0 working on Linux, try
-                       using the LinuxVNC emulation mode by "-rawfb vtN"
-                       where N = 1, ... 6 is the Linux Virtual Terminal (aka
-                       virtual console) you wish to view, e.g. "-rawfb vt2".
-                       Unlike /dev/fb mode, it need not be the active Virtual
-                       Terminal.  Note that this mode can only show text and
-                       not graphics.  x11vnc polls the text in /dev/vcsaN
-
-                       Set the env. var. RAWFB_VCSA_BW=1 to disable colors in
-                       the "vtN" mode (i.e. black and white only.)  If you
-                       do not prefer the default 16bpp set RAWFB_VCSA_BPP to
-                       8 or 32.  If you need to tweak the rawfb parameters by
-                       using the 'console_guess' string printed at startup,
-                       be sure to indicate the snap: method.
-
-                       uinput: If the Linux version appears to be 2.6
-                       or later and the "uinput" module appears to be
-                       present (modprobe uinput), then the uinput method
-                       will be used instead of /dev/ttyN.  uinput allows
-                       insertion of BOTH keystrokes and mouse input and so it
-                       preferred when accessing graphical (e.g. QT-embedded)
-                       linux console apps.  It also provides more accurate
-                       keystroke insertion.  See -pipeinput UINPUT below for
-                       more information on this mode; you will have to use
-                       -pipeinput if you want to tweak any UINPUT parameters.
-                       You may also want to also use the -nodragging and
-                       -cursor none options.  Use "console0", etc  or
-                       -pipeinput CONSOLE to force the /dev/ttyN method.
-
-                       Note you can change the Linux VT remotely using the
-                       chvt(1) command to make the one you want be the active
-                       one (e.g. 'chvt 3').  Sometimes switching out and back
-                       corrects the framebuffer's graphics state.  For the
-                       "-rawfb vtN" mode there is no need to switch the VT's.
-
-                       To skip input injecting entirely use "consolex"
-                       or "vtx".
-
-                       The string "/dev/fb0" (1, etc.) can be used instead
-                       of "console".  This can be used to specify a different
-                       framebuffer device, e.g. /dev/fb1.  As a shortcut the
-                       "/dev/" can be dropped.  If the name is something
-                       nonstandard, use "console:/dev/foofb"
-
-                       If you do not want x11vnc to guess the framebuffer's
-                       WxHxB and masks automatically (sometimes the kernel
-                       gives incorrect information), specify them with a @WxHxB
-                       (and optional :R/G/B masks) at the end of the string.
-
-                       Examples:
-                           -rawfb console
-                           -rawfb /dev/fb0           (same)
-                           -rawfb console3           (force /dev/tty3)
-                           -rawfb consolex           (no keystrokes or mouse)
-                           -rawfb console:/dev/nonstd
-                           -rawfb console -pipeinput UINPUT:accel=4.0
-                           -rawfb vt3                (/dev/tty3 w/o /dev/fb0)
-
-                       VNC HOST: if the -rawfb string is of the form
-                       "vnc:host:N" then the VNC display "N" on the remote
-                       VNC server "host" is connected to (i.e. x11vnc acts as
-                       a VNC client itself) and that framebuffer is exported.
-
-                       This mode is really only of use if you are trying
-                       to improve performance in the case of many (e.g. >
-                       10) simultaneous VNC viewers, and you try a divide
-                       and conquer scheme to reduce bandwidth and improve
-                       responsiveness.  (However, another user found this mode
-                       useful to export a demo display through a slow link:
-                       then multiple demo viewers connected to the reflecting
-                       x11vnc on the fast side of the link, and so avoided
-                       all of the demo viewers going through the slow link.)
-
-                       For example, if there will be 64 simultaneous VNC
-                       viewers this can lead to a lot of redundant VNC traffic
-                       to and from the server host:N, extra CPU usage,
-                       and all viewers response can be reduced by having
-                       to wait for writes to the slowest client to finish.
-                       However, if you set up 8 reflectors/repeaters started
-                       with option -rawfb vnc:host:N, then there are only
-                       8 connections to host:N.  Each repeater then handles
-                       8 vnc viewer connections thereby spreading the load
-                       around.  In classroom broadcast usage, try to put the
-                       repeaters on different switches.  This mode is the same
-                       as -reflect host:N.  Replace "host:N" by "listen"
-                       or "listen:port" for a reverse connection.
-
-                       Overall performance will not be as good as a single
-                       direct connection because, among other things,
-                       there is an additional level of framebuffer polling
-                       and pointer motion can still induce many changes per
-                       second that must be propagated.  Tip: if the remote VNC
-                       is x11vnc doing wireframing, or an X display that does
-                       wireframing that gives much better response than opaque
-                       window dragging.  Consider the -nodragging option if
-                       the problem is severe.
-
-                       The env. var. X11VNC_REFLECT_PASSWORD can be set to
-                       the password needed to log into the vnc host server, or
-                       to "file:path_to_file" to indicate a file containing
-                       the password as its first line.
-
-                       To set the pixel format that x11vnc requests as a VNC
-                       CLIENT set the env. vars: X11VNC_REFLECT_bitsPerSample
-                       X11VNC_REFLECT_samplesPerPixel, and
-                       X11VNC_REFLECT_bytesPerPixel; the defaults are 8, 3, 4.
-                       2, 3, 1 would give a low color mode.  See the function
-                       rfbGetClient() in libvncclient for more info.
-
-                       The VNC HOST mode implies -shared.  Use -noshared as
-                       a subsequent cmdline option to disable sharing.
-
--freqtab file          For use with "-rawfb video" for TV tuner devices to
-                       specify station frequencies.  Instead of using the built
-                       in ntsc-cable-us mapping of station number to frequency,
-                       use the data in file.  For stations that are not
-                       numeric, e.g. SE20, they are placed above the highest
-                       numbered station in the order they are found.  Example:
-                       "-freqtab /usr/X11R6/share/xawtv/europe-west.list"
-                       You can make your own freqtab by copying the xawtv
-                       format.
-
--pipeinput cmd         This option lets you supply an external command in
-                       "cmd" that x11vnc will pipe all of the user input
-                       events to in a simple format.  In -pipeinput mode by
-                       default x11vnc will not process any of the user input
-                       events.  If you prefix "cmd" with "tee:" it will
-                       both send them to the pipe command and process them.
-                       For a description of the format run "-pipeinput
-                       tee:/bin/cat".  Another prefix is "reopen" which
-                       means to reopen pipe if it exits.  Separate multiple
-                       prefixes with commas.
-
-                       In combination with -rawfb one might be able to
-                       do amusing things (e.g. control non-X devices).
-                       To facilitate this, if -rawfb is in effect then the
-                       value is stored in X11VNC_RAWFB_STR for the pipe command
-                       to use if it wants. Do 'env | grep X11VNC' for more.
-
-                       Built-in pipeinput modes (no external program required):
-
-                       If cmd is "VID" and you are using the -rawfb for a
-                       video capture device, then an internal list of keyboard
-                       mappings is used to set parameters of the video.
-                       The mappings are:
-
-                         "B" and "b" adjust the brightness up and down.
-                         "H" and "h" adjust the hue.
-                         "C" and "c" adjust the colour.
-                         "N" and "n" adjust the contrast.
-                         "S" and "s" adjust the size of the capture screen.
-                         "I" and "i" cycle through input channels.
-                         Up and Down arrows adjust the station (if a tuner)
-                         F1, F2, ..., F6 will switch the video capture pixel
-                         format to HI240, RGB565, RGB24, RGB32, RGB555, and
-                         GREY respectively.  See -rawfb video for details.
-
-                       If cmd is "CONSOLE" or "CONSOLEn" where n
-                       is a Linux console number, then the linux console
-                       keystroke insertion to /dev/ttyN (see -rawfb console)
-                       is performed.
-
-                       If cmd begins with "UINPUT" then the Linux uinput
-                       module is used to insert both keystroke and mouse events
-                       to the Linux console (see -rawfb above).  This usually
-                       is the /dev/input/uinput device file (you may need to
-                       create it with "mknod /dev/input/uinput c 10 223"
-                       and insert the module with "modprobe uinput".
-
-                       The UINPUT mode currently only does US keyboards (a
-                       scan code option may be added), and not all keysyms
-                       are supported.  But it is probably more accurate than
-                       the "CONSOLE" method.
-
-                       You may want to use the options -cursor none and
-                       -nodragging in this mode.
-
-                       Additional tuning options may be supplied via:
-                       UINPUT:opt1,opt2,... (a comma separated list). If an
-                       option begins with "/" it is taken as the uinput
-                       device file.
-
-                       Which uinput is injected can be controlled by an option
-                       string made of the characters "K", "M", and "B"
-                       (see the -input option), e.g. "KM" allows keystroke
-                       and motion but not button clicks.
-
-                       A UINPUT option of the form: accel=f, or accel=fx+fy
-                       sets the mouse motion "acceleration".  This is used
-                       to correct raw mouse relative motion into how much the
-                       application cursor moves (x11vnc has no control over,
-                       or knowledge of how the windowing application interprets
-                       the raw mouse motions).  Typically the acceleration
-                       for an X display is 2 (see xset "m" option).  "f"
-                       is a floating point number, e.g. 3.0.  Use "fx+fy"
-                       if you need to supply different corrections for x and y.
-
-                       Note: the default acceleration is 2.0 since it seems
-                       both X and qt-embedded often (but not always) use
-                       this value.
-
-                       Even with a correct accel setting the mouse position
-                       will get out of sync (probably due to a mouse
-                       "threshold" setting where the acceleration doe not
-                       apply, set xset(1)).  The option reset=N sets the
-                       number of ms (default 150) after which the cursor is
-                       attempted to be reset (by forcing the mouse to (0,
-                       0) via small increments and then back out to (x, y)
-                       in 1 jump), This correction seems to be needed but can
-                       cause jerkiness or unexpected behavior with menus, etc.
-                       Use reset=0 to disable.
-
-                       If you set the env. var X11VNC_UINPUT_THRESHOLDS then
-                       the thresh=n mode will be enabled.  It is currently
-                       not working well.  If |dx| <= thresh and |dy| < thresh
-                       no acceleration is applied.  Use "thresh=+n" |dx| +
-                       |dy| < thresh to be used instead (X11?)
-
-                       Example:
-                           -pipeinput UINPUT:accel=4.0 -cursor none
-
-                       If the uinput device has an absolute pointer (as opposed
-                       to a normal mouse that is a relative pointer) you can
-                       specify the option "abs".  Note that a touchpad
-                       on a laptop is an absolute device to some degree.
-                       This (usually) avoids all the problems with mouse
-                       acceleration.  If x11vnc has trouble deducing the
-                       size of the device, use "abs=WxH".  Furthermore,
-                       if the device is a touchscreen (assumed to have an
-                       absolute pointer) use "touch" or "touch=WxH".
-                       For touchscreens, when a mouse button is pressed,
-                       a pressure increase is injected, and when the button
-                       is released a pressure of zero is injected.
-
-                       If touch has been set, use "touch_always=1" to
-                       indicate whenever the mouse moves with no button
-                       pressed, a touch event of zero pressure should be
-                       sent anyway.  Also use "btn_touch=1" to indicate a
-                       BTN_TOUCH keystroke press or release should be sent
-                       instead of a pressure change.  Set "dragskip=n" to
-                       skip n dragged mouse touches (with pressure applied)
-                       before injecting one.  To indicate the pressure that
-                       should be sent when there is a button click for a
-                       touchscreen device, specify pressure=n, e.g. n=5. The
-                       default is n=1.
-
-                       If a touch screen is being used ("touch" above)
-                       and it is having its input processed by tslib, you can
-                       specify the tslib calibration file via tslib_cal=<file>.
-                       For example, tslib_cal=/etc/pointercal.  To get accurate
-                       or even usable positioning this is required when tslib
-                       is in use.
-
-                       The Linux uinput mechanism can be bypassed and one can
-                       write input events DIRECTLY to the devices instead.
-                       To do this, specify one or more of the following
-                       for the input classes: direct_rel=<device>
-                       direct_abs=<device> direct_btn=<device> or
-                       direct_key=<device>.  The <device> file is usually
-                       something like /dev/input/event1 but you can specify
-                       any device file or pipe.  You must specify each one
-                       of the above classes even if they correspond to the
-                       same device file (rel/abs and btn are often the same.)
-                       Look at the file /proc/bus/input/devices to get an idea
-                       what is available and the device filenames.  Note:
-                       The /dev/input/mouse* devices do not seem to work,
-                       use the corresponding /dev/input/event* file instead.
-                       Any input class not directly specified as above will be
-                       handled via the uinput mechanism.  To disable creating a
-                       uinput device (and thereby discarding unhandled input),
-                       specify "nouinput".
-
-                       Examples:
-
-                         -pipeinput UINPUT:direct_abs=/dev/input/event1
-
-                       this was used on a qtmoko Neo freerunner (armel):
-
-                         -pipeinput UINPUT:touch,tslib_cal=/etc/pointercal,
-                          direct_abs=/dev/input/event1,nouinput,dragskip=4
-
-                       (where the long line has been split into two.)
-
-                       You can set the env. var X11VNC_UINPUT_DEBUG=1 or higher
-                       to get debugging output for UINPUT mode.
-
--macnodim              For the native MacOSX server, disable dimming.
--macnosleep            For the native MacOSX server, disable display sleep.
--macnosaver            For the native MacOSX server, disable screensaver.
--macnowait             For the native MacOSX server, do not wait for the
-                       user to switch back to his display.
--macwheel n            For the native MacOSX server, set the mouse wheel
-                       speed to n (default 5).
--macnoswap             For the native MacOSX server, do not swap mouse
-                       buttons 2 and 3.
--macnoresize           For the native MacOSX server, do not resize or reset
-                       the framebuffer even if it is detected that the screen
-                       resolution or depth has changed.
--maciconanim n         For the native MacOSX server, set n to the number
-                       of milliseconds that the window iconify/deiconify
-                       animation takes.  In -ncache mode this value will be
-                       used to skip the animation if possible. (default 400)
--macmenu               For the native MacOSX server, in -ncache client-side
-                       caching mode, try to cache pull down menus (not perfect
-                       because they have animated fades, etc.)
--macuskbd              For the native MacOSX server, use the original
-                       keystroke insertion code based on a US keyboard.
--macnoopengl           For the native MacOSX server, do not use OpenGL for
-                       screen capture, but rather use the original, deprecated
-                       raw memory access method: addr = CGDisplayBaseAddress().
--macnorawfb            For the native MacOSX server, disable the raw memory
-                       address screen capture method.
-
-                       MACOSX NOTE: There are some deprecated MacOSX interfaces
-                       to inject keyboard and mouse events and the raw memory
-                       access method is deprecated as well (however, OpenGL
-                       will be preferred if available because it is faster.)
-                       One can force not using any deprecated interfaces at
-                       compile time by setting -DX11VNC_MACOSX_NO_DEPRECATED=1
-                       in CPPFLAGS.  Or to turn them off one by one:
-                       -DX11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1,
-                       -DX11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or
-                       -DX11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1
-                       At run time, for testing and workarounds, one can
-                       disable them by using:
-                       -env X11VNC_MACOSX_NO_DEPRECATED=1
-                       -env X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1
-                       -env X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or
-                       -env X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1
-                       Note: When doing either of these for the mouse input
-                       not everything works currently, e.g. double clicks and
-                       wireframing.  Also, screen resolution and pixel depth
-                       changes will not be automatically detected unless the
-                       deprecated framebuffer interfaces are allowed.
-
-                       Conversely, if you are compiling on an
-                       older machine that does not have some of
-                       the newer interfaces, you may need to specify
-                       -DX11VNC_MACOSX_NO_CGEVENTCREATESCROLLWHEELEVENT
-                       -DX11VNC_MACOSX_NO_CGEVENTCREATEMOUSEEVENT or
-                       -DX11VNC_MACOSX_NO_CGEVENTCREATEKEYBOARDEVENT.  Use
-                       -DX11VNC_MACOSX_USE_GETMAINDEVICE to regain the very
-                       old QuickDraw GetMainDevice() interface (rare...)
-
--gui [gui-opts]        Start up a simple tcl/tk gui based on the remote
-                       control options -remote/-query described below.
-                       Requires the "wish" program to be installed on the
-                       machine.  "gui-opts" is not required: the default
-                       is to start up both the full gui and x11vnc with the
-                       gui showing up on the X display in the environment
-                       variable DISPLAY.
-
-                       "gui-opts" can be a comma separated list of items.
-                       Currently there are these types of items: 1) a gui
-                       mode, a 2) gui "simplicity", 3) the X display the
-                       gui should display on, 4) a "tray" or "icon" mode,
-                       and 5) a gui geometry.
-
-                       1) The gui mode can be "start", "conn", or "wait"
-                       "start" is the default mode above and is not required.
-                       "conn" means do not automatically start up x11vnc,
-                       but instead just try to connect to an existing x11vnc
-                       process.  "wait" means just start the gui and nothing
-                       else (you will later instruct the gui to start x11vnc
-                       or connect to an existing one.)
-
-                       2) The gui simplicity is off by default (a power-user
-                       gui with all options is presented) To start with
-                       something less daunting supply the string "simple"
-                       ("ez" is an alias for this).  Once the gui is
-                       started you can toggle between the two with "Misc ->
-                       simple_gui".
-
-                       3) Note the possible confusion regarding the potentially
-                       two different X displays: x11vnc polls one, but you
-                       may want the gui to appear on another.  For example, if
-                       you ssh in and x11vnc is not running yet you may want
-                       the gui to come back to you via your ssh redirected X
-                       display (e.g. localhost:10).
-
-                       If you do not specify a gui X display in "gui-opts"
-                       then the DISPLAY environment variable and -display
-                       option are tried (in that order).  Regarding the x11vnc
-                       X display the gui will try to communication with, it
-                       first tries -display and then DISPLAY.  For example,
-                       "x11vnc -display :0 -gui otherhost:0", will remote
-                       control an x11vnc polling :0 and display the gui on
-                       otherhost:0 The "tray/icon" mode below reverses this
-                       preference, preferring to display on the x11vnc display.
-
-                       4) When "tray" or "icon" is specified, the gui
-                       presents itself as a small icon with behavior typical
-                       of a "system tray" or "dock applet".  The color
-                       of the icon indicates status (connected clients) and
-                       there is also a balloon status.  Clicking on the icon
-                       gives a menu from which properties, etc, can be set and
-                       the full gui is available under "Advanced".  To be
-                       fully functional, the gui mode should be "start"
-                       (the default).
-
-                       Note that tray or icon mode will imply the -forever
-                       x11vnc option (if the x11vnc server is started along
-                       with the gui) unless -connect or -connect_or_exit has
-                       been specified.  So x11vnc (and the tray/icon gui)
-                       will wait for more connections after the first client
-                       disconnects.  If you want only one viewer connection
-                       include the -once option.
-
-                       For "icon" the gui just a small standalone window.
-                       For "tray" it will attempt to embed itself in the
-                       "system tray" if possible. If "=setpass" is appended the
-n
-                       at startup the X11 user will be prompted to set the
-                       VNC session password.  If =<hexnumber> is appended
-                       that icon will attempt to embed itself in the window
-                       given by hexnumber.  Use =noadvanced to disable the
-                       full gui. (To supply more than one, use "+" sign).
-                       E.g. -gui tray=setpass and -gui icon=0x3600028
-
-                       Other modes: "full", the default and need not be
-                       specified.  "-gui none", do not show a gui, useful
-                       to override a ~/.x11vncrc setting, etc.
-
-                       5) When "geom=+X+Y" is specified, that geometry
-                       is passed to the gui toplevel.  This is the icon in
-                       icon/tray mode, or the full gui otherwise.  You can
-                       also specify width and height, i.e. WxH+X+Y, but it
-                       is not recommended.  In "tray" mode the geometry is
-                       ignored unless the system tray manager does not seem
-                       to be running.  One could imagine using something like
-                       "-gui tray,geom=+4000+4000" with a display manager
-                       to keep the gui invisible until someone logs in...
-
-                       More icon tricks, "icon=minimal" gives an icon just
-                       with the VNC display number.  You can also set the font
-                       with "iconfont=...".  The following could be useful:
-                       "-gui icon=minimal,iconfont=5x8,geom=24x10+0-0"
-
-                       General examples of the -gui option: "x11vnc -gui",
-                       "x11vnc -gui ez" "x11vnc -gui localhost:10",
-                       "x11vnc -gui conn,host:0", "x11vnc -gui tray,ez"
-                       "x11vnc -gui tray=setpass"
-
-                       If you do not intend to start x11vnc from the gui
-                       (i.e. just remote control an existing one), then the
-                       gui process can run on a different machine from the
-                       x11vnc server as long as X permissions, etc. permit
-                       communication between the two.
-
-                       FONTS: On some systems the tk fonts can be too small,
-                       jagged, or otherwise unreadable.  There are 4 env vars
-                       you can set to be the tk font you prefer:
-
-                       X11VNC_FONT_BOLD   main font for menus and buttons.
-                       X11VNC_FONT_FIXED  font for fixed width text.
-
-                       X11VNC_FONT_BOLD_SMALL  tray icon font.
-                       X11VNC_FONT_REG_SMALL   tray icon menu font.
-
-                       The last two only apply for the tray icon mode.
-
-                       Here are some examples:
-
-                       -env X11VNC_FONT_BOLD='Helvetica -16 bold'
-                       -env X11VNC_FONT_FIXED='Courier -14'
-                       -env X11VNC_FONT_REG_SMALL='Helvetica -12'
-
-                       You can put the lines like the above (without the
-                       quotes) in your ~/.x11vncrc file to avoid having to
-                       specify them on the x11vnc command line.
-
--remote command        Remotely control some aspects of an already running
-                       x11vnc server.  "-R" and "-r" are aliases for
-                       "-remote".  After the remote control command is
-                       sent to the running server the 'x11vnc -remote ...'
-                       x11vnc command exits.  You can often use the -query
-                       command (see below) to see if the x11vnc server
-                       processed your -remote command.
-
-                       The default communication channel is that of X
-                       properties (specifically X11VNC_REMOTE), and so this
-                       command must be run with correct settings for DISPLAY
-                       and possibly XAUTHORITY to connect to the X server
-                       and set the property.  Alternatively, use the -display
-                       and -auth options to set them to the correct values.
-                       The running server cannot use the -novncconnect option
-                       because that disables the communication channel.
-                       See below for alternate channels.
-
-                       For example: 'x11vnc -remote stop' (which is the same as
-                       'x11vnc -R stop') will close down the x11vnc server.
-                       'x11vnc -R shared' will enable shared connections, and
-                       'x11vnc -R scale:3/4' will rescale the desktop.
-
-                       To use a different name for the X11 property (e.g. to
-                       have separate communication channels for multiple
-                       x11vnc's on the same display) set the X11VNC_REMOTE
-                       environment variable to the string you want, for
-                       example: -env X11VNC_REMOTE=X11VNC_REMOTE_12345
-                       Both sides of the channel must use the same unique name.
-
-                       To run a bunch of commands in a sequence use something
-                       like: x11vnc -R 'script:firstcmd;secondcmd;...'
-
-                       Use x11vnc -R script:file=/path/to/file to read commands
-                       from a file (can be multi-line and use the comment '#'
-                       character in the normal way.  The ';' separator must
-                       still be used to separate each command.)
-
-                       To not try to contact another x11vnc process and instead
-                       just run the command (or query) directly, prefix the
-                       command with the string "DIRECT:"
-
-                       The following -remote/-R commands are supported:
-
-                       stop            terminate the server, same as "quit"
-                                       "exit" or "shutdown".
-                       ping            see if the x11vnc server responds.
-                                       return is: ans=ping:<display>
-                       ping:mystring   as above, but use your own unique string
-.
-                                       return is: ans=ping:mystring:<xdisplay>
-                       blacken         try to push a black fb update to all
-                                       clients (due to timings a client
-                                       could miss it). Same as "zero", also
-                                       "zero:x1,y1,x2,y2" for a rectangle.
-                       refresh         send the entire fb to all clients.
-                       reset           recreate the fb, polling memory, etc.
-                       id:windowid     set -id window to "windowid". empty
-                                       or "root" to go back to root window
-                       sid:windowid    set -sid window to "windowid"
-                       id_cmd:cmd      cmds: raise, lower, map, unmap, iconify,
-                                       move:dXdY, resize:dWdH, geom:WxH+X+Y. dX
-                                       dY, dW, and dH must have a leading "+"
-                                       or "-" e.g.: move:-30+10 resize:+20+35
-                                       also: wm_delete, wm_name:string and
-                                       icon_name:string. Also id_cmd:win=N:cmd
-                       waitmapped      wait until subwin is mapped.
-                       nowaitmapped    do not wait until subwin is mapped.
-                       clip:WxH+X+Y    set -clip mode to "WxH+X+Y"
-                       flashcmap       enable  -flashcmap mode.
-                       noflashcmap     disable -flashcmap mode.
-                       shiftcmap:n     set -shiftcmap to n.
-                       notruecolor     enable  -notruecolor mode.
-                       truecolor       disable -notruecolor mode.
-                       overlay         enable  -overlay mode (if applicable).
-                       nooverlay       disable -overlay mode.
-                       overlay_cursor  in -overlay mode, enable cursor drawing.
-                       overlay_nocursor disable cursor drawing. same as
-                                        nooverlay_cursor.
-                       8to24           enable  -8to24 mode (if applicable).
-                       no8to24         disable -8to24 mode.
-                       8to24_opts:str  set the -8to24 opts to "str".
-                       24to32          enable  -24to32 mode (if applicable).
-                       no24to32        disable -24to32 mode.
-                       visual:vis      set -visual to "vis"
-                       scale:frac      set -scale to "frac"
-                       scale_cursor:f  set -scale_cursor to "f"
-                       viewonly        enable  -viewonly mode.
-                       noviewonly      disable -viewonly mode.
-                       shared          enable  -shared mode.
-                       noshared        disable -shared mode.
-                       forever         enable  -forever mode.
-                       noforever       disable -forever mode.
-                       timeout:n       reset -timeout to n, if there are
-                                       currently no clients, exit unless one
-                                       connects in the next n secs.
-                       tightfilexfer   enable  filetransfer for NEW clients.
-                       notightfilexfer disable filetransfer for NEW clients.
-                       ultrafilexfer   enable  filetransfer for clients.
-                       noultrafilexfer disable filetransfer for clients.
-                       rfbversion:n.m  set -rfbversion for new clients.
-                       http            enable  http client connections.
-                       nohttp          disable http client connections.
-                       deny            deny any new connections, same as "lock"
-                       nodeny          allow new connections, same as "unlock"
-                       avahi           enable  avahi service advertising.
-                       noavahi         disable avahi service advertising.
-                       mdns            enable  avahi service advertising.
-                       nomdns          disable avahi service advertising.
-                       zeroconf        enable  avahi service advertising.
-                       nozeroconf      disable avahi service advertising.
-                       connect:host    do reverse connection to host, "host"
-                                       may be a comma separated list of hosts
-                                       or host:ports.  See -connect.  Passwords
-                                       required as with fwd connections.
-                                       See X11VNC_REVERSE_CONNECTION_NO_AUTH=1
-                       disconnect:host disconnect any clients from "host"
-                                       same as "close:host".  Use host
-                                       "all" to close all current clients.
-                                       If you know the client internal hex ID,
-                                       e.g. 0x3 (returned by "-query clients"
-                                       and RFB_CLIENT_ID) you can use that too.
-                       proxy:host:port set reverse connection proxy (empty to
-                                       disable).
-                       allowonce:host  For the next connection only, allow
-                                       connection from "host". In -ssl mode
-                                       two connections are allowed (i.e. Fetch
-                                       Cert) unless X11VNC_NO_SSL_ALLOW_TWICE=1
-                       allow:hostlist  set -allow list to (comma separated)
-                                       "hostlist". See -allow and -localhost.
-                                       Do not use with -allow /path/to/file
-                                       Use "+host" to add a single host, and
-                                       use "-host" to delete a single host
-                       localhost       enable  -localhost mode
-                       nolocalhost     disable -localhost mode
-                       listen:str      set -listen to str, empty to disable.
-                       noipv6          enable  -noipv6 mode.
-                       ipv6            disable -noipv6 mode.
-                       noipv4          enable  -noipv4 mode.
-                       ipv4            disable -noipv4 mode.
-                       6               enable  -6 IPv6 listening mode.
-                       no6             disable -6 IPv6 listening mode.
-                       lookup          disable -nolookup mode.
-                       nolookup        enable  -nolookup mode.
-                       lookup          disable -nolookup mode.
-                       input:str       set -input to "str", empty to disable.
-                       grabkbd         enable  -grabkbd mode.
-                       nograbkbd       disable -grabkbd mode.
-                       grabptr         enable  -grabptr mode.
-                       nograbptr       disable -grabptr mode.
-                       grabalways      enable  -grabalways mode.
-                       nograbalways    disable -grabalways mode.
-                       grablocal:n     set -grablocal to n.
-                       client_input:str set the K, M, B -input on a per-client
-                                       basis.  select which client as for
-                                       disconnect, e.g. client_input:host:MB
-                                       or client_input:0x2:K
-                       accept:cmd      set -accept "cmd" (empty to disable).
-                       afteraccept:cmd set -afteraccept (empty to disable).
-                       gone:cmd        set -gone "cmd" (empty to disable).
-                       noshm           enable  -noshm mode.
-                       shm             disable -noshm mode (i.e. use shm).
-                       flipbyteorder   enable -flipbyteorder mode, you may need
-                                       to set noshm for this to do something.
-                       noflipbyteorder disable -flipbyteorder mode.
-                       onetile         enable  -onetile mode. (you may need to
-                                       set shm for this to do something)
-                       noonetile       disable -onetile mode.
-                       solid           enable  -solid mode
-                       nosolid         disable -solid mode.
-                       solid_color:color set -solid color (and apply it).
-                       blackout:str    set -blackout "str" (empty to disable).
-                                       See -blackout for the form of "str"
-                                       (basically: WxH+X+Y,...)
-                                       Use "+WxH+X+Y" to append a single
-                                       rectangle use "-WxH+X+Y" to delete one
-                       xinerama        enable  -xinerama mode. (if applicable)
-                       noxinerama      disable -xinerama mode.
-                       xtrap           enable  -xtrap input mode(if applicable)
-                       noxtrap         disable -xtrap input mode.
-                       xrandr          enable  -xrandr mode. (if applicable)
-                       noxrandr        disable -xrandr mode.
-                       xrandr_mode:mode set the -xrandr mode to "mode".
-                       rotate:mode     set the -rotate mode to "mode".
-                       padgeom:WxH     set -padgeom to WxH (empty to disable)
-                                       If WxH is "force" or "do" the padded
-                                       geometry fb is immediately applied.
-                       quiet           enable  -quiet mode.
-                       noquiet         disable -quiet mode.
-                       modtweak        enable  -modtweak mode.
-                       nomodtweak      enable  -nomodtweak mode.
-                       xkb             enable  -xkb modtweak mode.
-                       noxkb           disable -xkb modtweak mode.
-                       capslock        enable  -capslock mode.
-                       nocapslock      disable -capslock mode.
-                       skip_lockkeys   enable  -skip_lockkeys mode.
-                       noskip_lockkeys disable -skip_lockkeys mode.
-                       skip_keycodes:str enable -xkb -skip_keycodes "str".
-                       sloppy_keys     enable  -sloppy_keys mode.
-                       nosloppy_keys   disable -sloppy_keys mode.
-                       skip_dups       enable  -skip_dups mode.
-                       noskip_dups     disable -skip_dups mode.
-                       add_keysyms     enable -add_keysyms mode.
-                       noadd_keysyms   stop adding keysyms. those added will
-                                       still be removed at exit.
-                       clear_mods      enable  -clear_mods mode and clear them.
-                       noclear_mods    disable -clear_mods mode.
-                       clear_keys      enable  -clear_keys mode and clear them.
-                       noclear_keys    disable -clear_keys mode.
-                       clear_locks     do the clear_locks action.
-                       clear_all       do the clear_all action.
-                       keystate        have x11vnc print current keystate.
-                       remap:str       set -remap "str" (empty to disable).
-                                       See -remap for the form of "str"
-                                       (basically: key1-key2,key3-key4,...)
-                                       Use "+key1-key2" to append a single
-                                       keymapping, use "-key1-key2" to delete.
-                       norepeat        enable  -norepeat mode.
-                       repeat          disable -norepeat mode.
-                       nofb            enable  -nofb mode.
-                       fb              disable -nofb mode.
-                       bell            enable  bell (if supported).
-                       nobell          disable bell.
-                       sendbell        ring the bell now.
-                       nosel           enable  -nosel mode.
-                       sel             disable -nosel mode.
-                       noprimary       enable  -noprimary mode.
-                       primary         disable -noprimary mode.
-                       nosetprimary    enable  -nosetprimary mode.
-                       setprimary      disable -nosetprimary mode.
-                       noclipboard     enable  -noclipboard mode.
-                       clipboard       disable -noclipboard mode.
-                       nosetclipboard  enable  -nosetclipboard mode.
-                       setclipboard    disable -nosetclipboard mode.
-                       seldir:str      set -seldir to "str"
-                       resend_cutbuffer resend the most recent CUTBUFFER0 copy
-                       resend_clipboard resend the most recent CLIPBOARD copy
-                       resend_primary   resend the most recent PRIMARY copy
-                       cursor:mode     enable  -cursor "mode".
-                       show_cursor     enable  showing a cursor.
-                       noshow_cursor   disable showing a cursor. (same as
-                                       "nocursor")
-                       cursor_drag     enable  cursor changes during drag.
-                       nocursor_drag   disable cursor changes during drag.
-                       arrow:n         set -arrow to alternate n.
-                       xfixes          enable  xfixes cursor shape mode.
-                       noxfixes        disable xfixes cursor shape mode.
-                       alphacut:n      set -alphacut to n.
-                       alphafrac:f     set -alphafrac to f.
-                       alpharemove     enable  -alpharemove mode.
-                       noalpharemove   disable -alpharemove mode.
-                       alphablend      disable -noalphablend mode.
-                       noalphablend    enable  -noalphablend mode.
-                       cursorshape     disable -nocursorshape mode.
-                       nocursorshape   enable  -nocursorshape mode.
-                       cursorpos       disable -nocursorpos mode.
-                       nocursorpos     enable  -nocursorpos mode.
-                       xwarp           enable  -xwarppointer mode.
-                       noxwarp         disable -xwarppointer mode.
-                       always_inject   enable  -always_inject mode.
-                       noalways_inject disable -always_inject mode.
-                       buttonmap:str   set -buttonmap "str", empty to disable
-                       dragging        disable -nodragging mode.
-                       nodragging      enable  -nodragging mode.
-                       ncache          reenable -ncache mode.
-                       noncache        disable  -ncache mode.
-                       ncache_size:n   set -ncache size to n.
-                       ncache_cr       enable  -ncache_cr mode.
-                       noncache_cr     disable -ncache_cr mode.
-                       ncache_no_moveraise     enable  no_moveraise mode.
-                       noncache_no_moveraise   disable no_moveraise mode.
-                       ncache_no_dtchange      enable  ncache_no_dtchange mode.
-                       noncache_no_dtchange    disable ncache_no_dtchange mode.
-                       ncache_old_wm           enable  ncache_old_wm mode.
-                       noncache_old_wm         disable ncache_old_wm mode.
-                       ncache_no_rootpixmap    enable  ncache_no_rootpixmap.
-                       noncache_no_rootpixmap  disable ncache_no_rootpixmap.
-                       ncache_reset_rootpixmap recheck the root pixmap, ncrp
-                       ncache_keep_anims       enable  ncache_keep_anims.
-                       noncache_keep_anims     disable ncache_keep_anims.
-                       ncache_pad:n    set -ncache_pad to n.
-                       wireframe       enable  -wireframe mode. same as "wf"
-                       nowireframe     disable -wireframe mode. same as "nowf"
-                       wireframe:str   enable  -wireframe mode string.
-                       wireframe_mode:str enable  -wireframe mode string.
-                       wireframelocal  enable  wireframelocal. same as "wfl"
-                       nowireframe     disable wireframelocal. same as "nowfl"
-                       wirecopyrect:str set -wirecopyrect string. same as "wcr:
-"
-                       scrollcopyrect:str set -scrollcopyrect string. same "scr
-"
-                       noscrollcopyrect disable -scrollcopyrect mode. "noscr"
-                       scr_area:n      set -scr_area to n
-                       scr_skip:list   set -scr_skip to "list"
-                       scr_inc:list    set -scr_inc to "list"
-                       scr_keys:list   set -scr_keys to "list"
-                       scr_term:list   set -scr_term to "list"
-                       scr_keyrepeat:str set -scr_keyrepeat to "str"
-                       scr_parms:str   set -scr_parms parameters.
-                       fixscreen:str   set -fixscreen to "str".
-                       noxrecord       disable all use of RECORD extension.
-                       xrecord         enable  use of RECORD extension.
-                       reset_record    reset RECORD extension (if avail.)
-                       pointer_mode:n  set -pointer_mode to n. same as "pm"
-                       input_skip:n    set -input_skip to n.
-                       allinput        enable  use of -allinput mode.
-                       noallinput      disable use of -allinput mode.
-                       input_eagerly   enable  use of -input_eagerly mode.
-                       noinput_eagerly disable use of -input_eagerly mode.
-                       ssltimeout:n    set -ssltimeout to n.
-                       speeds:str      set -speeds to str.
-                       wmdt:str        set -wmdt to str.
-                       debug_pointer   enable  -debug_pointer, same as "dp"
-                       nodebug_pointer disable -debug_pointer, same as "nodp"
-                       debug_keyboard   enable  -debug_keyboard, same as "dk"
-                       nodebug_keyboard disable -debug_keyboard, same as "nodk"
-                       keycode:n       inject keystroke 'keycode' (xmodmap -pk)
-                       keycode:n,down  inject 'keycode' (down=0,1)
-                       keysym:str      inject keystroke 'keysym' (number/name)
-                       keysym:str,down inject 'keysym' (down=0,1)
-                       ptr:x,y,mask    inject pointer event x, y, button-mask
-                       fakebuttonevent:button,down direct XTestFakeButtonEvent.
-                       sleep:t         sleep floating point time t.
-                       get_xprop:p     get X property named 'p'.
-                       set_xprop:p:val set X property named 'p' to 'val'.
-                                       p -> id=NNN:p for hex/dec window id.
-                       wininfo:id      get info about X window id.  use 'root'
-                                       for root window, use +id for children.
-                       grab_state      get state of pointer and keyboard grab.
-                       pointer_pos     print XQueryPointer x,y cursor position.
-                       pointer_x       print XQueryPointer x cursor position.
-                       pointer_y       print XQueryPointer y cursor position.
-                       pointer_same    print XQueryPointer ptr on same screen.
-                       pointer_root    print XQueryPointer curr ptr rootwin.
-                       pointer_mask    print XQueryPointer button and mods mask
-                       mouse_x         print x11vnc's idea of cursor position.
-                       mouse_y         print x11vnc's idea of cursor position.
-                       noop            do nothing.
-                       defer:n         set -defer to n ms,same as deferupdate:n
-                       wait:n          set -wait to n ms.
-                       extra_fbur:n    set -extra_fbur to n.
-                       wait_ui:f       set -wait_ui factor to f.
-                       setdefer:n      set -setdefer to -2,-1,0,1, or 2.
-                       wait_bog        disable -nowait_bog mode.
-                       nowait_bog      enable  -nowait_bog mode.
-                       slow_fb:f       set -slow_fb to f seconds.
-                       xrefresh:f      set -xrefresh to f seconds.
-                       readtimeout:n   set read timeout to n seconds.
-                       nap             enable  -nap mode.
-                       nonap           disable -nap mode.
-                       sb:n            set -sb to n s, same as screen_blank:n
-                       fbpm            disable -nofbpm mode.
-                       nofbpm          enable  -nofbpm mode.
-                       dpms            disable -nodpms mode.
-                       nodpms          enable  -nodpms mode.
-                       forcedpms       enable  -forcedpms mode.
-                       noforcedpms     disable -forcedpms mode.
-                       clientdpms      enable  -clientdpms mode.
-                       noclientdpms    disable -clientdpms mode.
-                       noserverdpms    enable  -noserverdpms mode.
-                       serverdpms      disable -noserverdpms mode.
-                       noultraext      enable  -noultraext mode.
-                       ultraext        disable -noultraext mode.
-                       chatwindow      enable  local chatwindow mode.
-                       nochatwindow    disable local chatwindow mode.
-                       chaton          begin chat using local window.
-                       chatoff         end   chat using local window.
-                       xdamage         enable  xdamage polling hints.
-                       noxdamage       disable xdamage polling hints.
-                       xd_area:A       set -xd_area max pixel area to "A"
-                       xd_mem:f        set -xd_mem remembrance to "f"
-                       fs:frac         set -fs fraction to "frac", e.g. 0.5
-                       gaps:n          set -gaps to n.
-                       grow:n          set -grow to n.
-                       fuzz:n          set -fuzz to n.
-                       snapfb          enable  -snapfb mode.
-                       nosnapfb        disable -snapfb mode.
-                       rawfb:str       set -rawfb mode to "str".
-                       uinput_accel:f  set uinput_accel to f.
-                       uinput_thresh:n set uinput_thresh to n.
-                       uinput_reset:n  set uinput_reset to n ms.
-                       uinput_always:n set uinput_always to 1/0.
-                       progressive:n   set LibVNCServer -progressive slice
-                                       height parameter to n.
-                       desktop:str     set -desktop name to str for new clients
-.
-                       rfbport:n       set -rfbport to n.
-                       macnosaver      enable  -macnosaver mode.
-                       macsaver        disable -macnosaver mode.
-                       macnowait       enable  -macnowait  mode.
-                       macwait         disable -macnowait  mode.
-                       macwheel:n      set -macwheel to n.
-                       macnoswap       enable  -macnoswap mouse button mode.
-                       macswap         disable -macnoswap mouse button mode.
-                       macnoresize     enable  -macnoresize mode.
-                       macresize       disable -macnoresize mode.
-                       maciconanim:n   set -maciconanim to n.
-                       macmenu         enable  -macmenu  mode.
-                       macnomenu       disable -macmenu  mode.
-                       macuskbd        enable  -macuskbd mode.
-                       macnouskbd      disable -macuskbd mode.
-                       httpport:n      set -httpport to n.
-                       httpdir:dir     set -httpdir to dir (and enable http).
-                       enablehttpproxy   enable  -enablehttpproxy mode.
-                       noenablehttpproxy disable -enablehttpproxy mode.
-                       alwaysshared     enable  -alwaysshared mode.
-                       noalwaysshared   disable -alwaysshared mode.
-                                        (may interfere with other options)
-                       nevershared      enable  -nevershared mode.
-                       nonevershared    disable -nevershared mode.
-                                        (may interfere with other options)
-                       dontdisconnect   enable  -dontdisconnect mode.
-                       nodontdisconnect disable -dontdisconnect mode.
-                                        (may interfere with other options)
-                       debug_xevents   enable  debugging X events.
-                       nodebug_xevents disable debugging X events.
-                       debug_xdamage   enable  debugging X DAMAGE mechanism.
-                       nodebug_xdamage disable debugging X DAMAGE mechanism.
-                       debug_wireframe enable   debugging wireframe mechanism.
-                       nodebug_wireframe disable debugging wireframe mechanism.
-                       debug_scroll    enable  debugging scrollcopy mechanism.
-                       nodebug_scroll  disable debugging scrollcopy mechanism.
-                       debug_tiles     enable  -debug_tiles
-                       nodebug_tiles   disable -debug_tiles
-                       debug_grabs     enable  -debug_grabs
-                       nodebug_grabs   disable -debug_grabs
-                       debug_sel       enable  -debug_sel
-                       nodebug_sel     disable -debug_sel
-                       debug_ncache    enable  -debug_ncache
-                       nodebug_ncache  disable -debug_ncache
-                       dbg             enable  -dbg crash shell
-                       nodbg           disable -dbg crash shell
-
-                       noremote        disable the -remote command processing,
-                                       it cannot be turned back on.
-
-                       bcx_xattach:str  This remote control command is for
-                       use with the BARCO xattach program or the x2x program.
-                       Both of these programs are for 'pointer and keyboard'
-                       sharing between separate X displays.  In general the
-                       two displays are usually nearby, e.g. on the same desk,
-                       and this allows the user to share a single pointer and
-                       keyboard between them.  The user moves the mouse to
-                       an edge and then the mouse pointer appears to 'jump'
-                       to the other display screen.  Thus it emulates what a
-                       single X server would do for two screens (e.g. :0.0 and
-                       :0.1) The illusion of a single Xserver with multiple
-                       screens is achieved by forwarding events to the 2nd
-                       one via the XTEST extension.
-
-                       What the x11vnc bcx_xattach command does is to perform
-                       some pointer movements to try to INDUCE xattach/x2x
-                       to 'jump' to the other display.  In what follows the
-                       'master' display refers to the one that when it has
-                       'focus' it is basically doing nothing besides watching
-                       for the mouse to go over an edge.  The 'slave'
-                       display refers to the one to which the mouse and
-                       keyboard is redirected to once an edge in the master
-                       has been crossed.  Note that the x11vnc executing the
-                       bcx_xattach command MUST be the one connected to the
-                       *master* display.
-
-                       Also note that when input is being redirected (via
-                       XTEST) from the master display to the slave display,
-                       the master display's pointer and keyboard are *grabbed*
-                       by xattach/x2x.  x11vnc can use this info to verify that
-                       the master/slave mode change has taken place correctly.
-                       If you specify the "ifneeded" option (see below)
-                       and the initial grab state is that of the desired
-                       final state, then no pointer movements are injected
-                       and "DONE,GRAB_OK" is returned.
-
-                       "str" must contain one of "up", "down", "left",
-                       or "right" to indicate the direction of the 'jump'.
-                       "str" must also contain one of "master_to_slave"
-                       or "slave_to_master" to indicate the type of mode
-                       change induced by the jump.  Use "M2S" and "S2M"
-                       as shorter aliases.
-
-                       "str" may be a "+" separated list of additional
-                       tuning options.  The "shift=n" option indicates an
-                       offset shift position away from (0,0) (default 20).
-                       "final=x+y" specifies the final position of the cursor
-                       at the end of the normal move sequence; default 30+30.
-                       "extra_move=x+y" means to do one more pointer move
-                       after "final" to x+y.  "dt=n" sets the sleep time
-                       in milliseconds between pointer moves (default: 40ms)
-                       "retry=n" specifies the maximum number of retries if
-                       the grab state change fails. "ifneeded" means to not
-                       apply the pointer movements if the initial grab state is
-                       that of the desired final state. "nograbcheck" means
-                       to not check if the grab state changed as expected and
-                       only apply the pointer movements (default is to check
-                       the grab states.)
-
-                       If you do not specify "up", etc., to bcx_xattach
-                       nothing will be attempted and the command returns
-                       the string FAIL,NO_DIRECTION_SPECIFIED.  If you do
-                       not specify "master_to_slave" or "M2S", etc., to
-                       bcx_xattach nothing will be attempted and the command
-                       returns the string FAIL,NO_MODE_CHANGE_SPECIFIED.
-
-                       Otherwise, the returned string will contain "DONE".
-                       It will be "DONE,GRAB_OK" if the grab state changed
-                       as expected (or if "ifneeded" was supplied and
-                       the initial grab state was already the desired
-                       one.)  If the initial grab state was incorrect,
-                       but the final grab state was correct then it is
-                       "DONE,GRAB_FAIL_INIT".  If the initial grab state
-                       was correct, but the final grab state was incorrect
-                       then it is "DONE,GRAB_FAIL_FINAL".  If both are
-                       incorrect it will be "DONE,GRAB_FAIL".  Under grab
-                       failure the string will be followed by ":p1,k1-p2,k2"
-                       where  p1,k1 indicates the initial pointer and keyboard
-                       grab states and p2,k2 the final ones. If GRAB_FAIL or
-                       GRAB_FAIL_FINAL occurs, the action will be retried up
-                       to 3 times; trying to reset the state and sleeping a
-                       bit between each try.  Set retry=n to adjust the number
-                       of retries, zero to disable retries.
-
-                       Examples:
-                           -R bcx_xattach:down+M2S
-                           -R bcx_xattach:up+S2M
-                           -R bcx_xattach:up+S2M+nograbcheck+dt=30
-                           -R bcx_xattach:down+M2S+extra_move=100+100
-
-                       or use -Q instead of -R to retrieve the result text.
-
-                       End of the bcx_xattach:str description.
-
-                       The vncconnect(1) command from standard VNC
-                       distributions may also be used if string is prefixed
-                       with "cmd=" E.g. 'vncconnect cmd=stop'.  Under some
-                       circumstances xprop(1) can used if it supports -set
-                       (see the FAQ).
-
-                       If "-connect /path/to/file" has been supplied to the
-                       running x11vnc server then that file can be used as a
-                       communication channel (this is the only way to remote
-                       control one of many x11vnc's polling the same X display)
-                       Simply run: 'x11vnc -connect /path/to/file -remote ...'
-                       or you can directly write to the file via something
-                       like: "echo cmd=stop > /path/to/file", etc.
-
--query variable        Like -remote, except just query the value of
-                       "variable".  "-Q" is an alias for "-query".
-                       Multiple queries can be done by separating variables
-                       by commas, e.g. -query var1,var2. The results come
-                       back in the form ans=var1:value1,ans=var2:value2,...
-                       to the standard output.  If a variable is read-only,
-                       it comes back with prefix "aro=" instead of "ans=".
-
-                       Some -remote commands are pure actions that do not make
-                       sense as variables, e.g. "stop" or "disconnect", in
-                       these cases the value returned is "N/A".  To direct a
-                       query straight to the X11VNC_REMOTE property or connect
-                       file use "qry=..." instead of "cmd=..."
-
-                       ans= stop quit exit shutdown ping resend_cutbuffer
-                       resend_clipboard resend_primary blacken zero refresh
-                       reset close disconnect id_cmd id sid waitmapped
-                       nowaitmapped clip flashcmap noflashcmap shiftcmap
-                       truecolor notruecolor overlay nooverlay overlay_cursor
-                       overlay_yescursor nooverlay_nocursor nooverlay_cursor
-                       nooverlay_yescursor overlay_nocursor 8to24 no8to24
-                       8to24_opts 24to32 no24to32 visual scale scale_cursor
-                       viewonly noviewonly shared noshared forever noforever
-                       once timeout tightfilexfer notightfilexfer ultrafilexfer
-                       noultrafilexfer rfbversion deny lock nodeny unlock avahi
-                       mdns zeroconf noavahi nomdns nozeroconf connect proxy
-                       allowonce allow noipv6 ipv6 noipv4 ipv4 no6 6 localhost
-                       nolocalhost listen lookup nolookup accept afteraccept
-                       gone shm noshm flipbyteorder noflipbyteorder onetile
-                       noonetile solid_color solid nosolid blackout xinerama
-                       noxinerama xtrap noxtrap xrandr noxrandr xrandr_mode
-                       rotate padgeom quiet q noquiet modtweak nomodtweak xkb
-                       noxkb capslock nocapslock skip_lockkeys noskip_lockkeys
-                       skip_keycodes sloppy_keys nosloppy_keys skip_dups
-                       noskip_dups add_keysyms noadd_keysyms clear_mods
-                       noclear_mods clear_keys noclear_keys clear_all
-                       clear_locks keystate remap repeat norepeat fb nofb bell
-                       nobell sendbell sel nosel primary noprimary setprimary
-                       nosetprimary clipboard noclipboard setclipboard
-                       nosetclipboard seldir cursorshape nocursorshape
-                       cursorpos nocursorpos cursor_drag nocursor_drag cursor
-                       show_cursor noshow_cursor nocursor arrow xfixes noxfixes
-                       xdamage noxdamage xd_area xd_mem alphacut alphafrac
-                       alpharemove noalpharemove alphablend noalphablend
-                       xwarppointer xwarp noxwarppointer noxwarp always_inject
-                       noalways_inject buttonmap dragging nodragging ncache_cr
-                       noncache_cr ncache_no_moveraise noncache_no_moveraise
-                       ncache_no_dtchange noncache_no_dtchange
-                       ncache_no_rootpixmap noncache_no_rootpixmap
-                       ncache_reset_rootpixmap ncrp ncache_keep_anims
-                       noncache_keep_anims ncache_old_wm noncache_old_wm
-                       ncache_pad ncache noncache ncache_size debug_ncache
-                       nodebug_ncache wireframe_mode wireframe wf nowireframe
-                       nowf wireframelocal wfl nowireframelocal nowfl
-                       wirecopyrect wcr nowirecopyrect nowcr scr_area
-                       scr_skip scr_inc scr_keys scr_term scr_keyrepeat
-                       scr_parms scrollcopyrect scr noscrollcopyrect
-                       noscr fixscreen noxrecord xrecord reset_record
-                       pointer_mode pm input_skip allinput noallinput
-                       input_eagerly noinput_eagerly input grabkbd nograbkbd
-                       grabptr nograbptr grabalways nograbalways grablocal
-                       client_input ssltimeout speeds wmdt debug_pointer dp
-                       nodebug_pointer nodp debug_keyboard dk nodebug_keyboard
-                       nodk keycode keysym ptr fakebuttonevent sleep get_xprop
-                       set_xprop wininfo bcx_xattach deferupdate defer
-                       setdefer extra_fbur wait_ui wait_bog nowait_bog
-                       slow_fb xrefresh wait readtimeout nap nonap sb
-                       screen_blank fbpm nofbpm dpms nodpms clientdpms
-                       noclientdpms forcedpms noforcedpms noserverdpms
-                       serverdpms noultraext ultraext chatwindow nochatwindow
-                       chaton chatoff fs gaps grow fuzz snapfb nosnapfb
-                       rawfb uinput_accel uinput_thresh uinput_reset
-                       uinput_always progressive rfbport http nohttp httpport
-                       httpdir enablehttpproxy noenablehttpproxy alwaysshared
-                       noalwaysshared nevershared noalwaysshared dontdisconnect
-                       nodontdisconnect desktop debug_xevents nodebug_xevents
-                       debug_xevents debug_xdamage nodebug_xdamage
-                       debug_xdamage debug_wireframe nodebug_wireframe
-                       debug_wireframe debug_scroll nodebug_scroll debug_scroll
-                       debug_tiles dbt nodebug_tiles nodbt debug_tiles
-                       debug_grabs nodebug_grabs debug_sel nodebug_sel dbg
-                       nodbg macnosaver macsaver nomacnosaver macnowait macwait
-                       nomacnowait macwheel macnoswap macswap nomacnoswap
-                       macnoresize macresize nomacnoresize maciconanim macmenu
-                       macnomenu nomacmenu macuskbd nomacuskbd noremote
-
-                       aro=  noop display vncdisplay icon_mode autoport
-                       loop loopbg desktopname guess_desktop guess_dbus
-                       http_url auth xauth users rootshift clipshift scale_str
-                       scaled_x scaled_y scale_numer scale_denom scale_fac_x
-                       scale_fac_y scaling_blend scaling_nomult4 scaling_pad
-                       scaling_interpolate inetd privremote unsafe safer nocmds
-                       passwdfile unixpw unixpw_nis unixpw_list ssl ssl_pem
-                       sslverify stunnel stunnel_pem https httpsredir usepw
-                       using_shm logfile o flag rmflag rc norc h help V version
-                       lastmod bg sigpipe threads readrate netrate netlatency
-                       pipeinput clients client_count pid ext_xtest ext_xtrap
-                       ext_xrecord ext_xkb ext_xshm ext_xinerama ext_overlay
-                       ext_xfixes ext_xdamage ext_xrandr rootwin num_buttons
-                       button_mask mouse_x mouse_y grab_state pointer_pos
-                       pointer_x pointer_y pointer_same pointer_root
-                       pointer_mask bpp depth indexed_color dpy_x dpy_y wdpy_x
-                       wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth
-                       passwd viewpasswd
-
--QD variable           Just like -query variable, but returns the default
-                       value for that parameter (no running x11vnc server
-                       is consulted)
-
--sync                  By default -remote commands are run asynchronously, that
-                       is, the request is posted and the program immediately
-                       exits.  Use -sync to have the program wait for an
-                       acknowledgement from the x11vnc server that command was
-                       processed (somehow).  On the other hand -query requests
-                       are always processed synchronously because they have
-                       to wait for the answer.
-
-                       Also note that if both -remote and -query requests are
-                       supplied on the command line, the -remote is processed
-                       first (synchronously: no need for -sync), and then
-                       the -query request is processed in the normal way.
-                       This allows for a reliable way to see if the -remote
-                       command was processed by querying for any new settings.
-                       Note however that there is timeout of a few seconds
-                       (see the next paragraph) so if the x11vnc takes longer
-                       than that to process the requests the requester will
-                       think that a failure has taken place.
-
-                       The default is to wait 3.5 seconds.  Or if cmd=stop
-                       only 1.0 seconds.  If cmd matches 'script:' then it
-                       will wait up to 10.0 seconds.  Set X11VNC_SYNC_TIMEOUT
-                       to the number of seconds you want it to wait.
-
--query_retries str     If a query fails to get a response from an x11vnc
-                       server, retry up to n times.  "str" is specified as
-                       n[:t][/match]  Optionally the delay between tries may
-                       be specified by "t" a floating point time (default
-                       0.5 seconds.)  Note: the response is not checked for
-                       validity or whether it corresponds to the query sent.
-                       The query "ping:mystring" may be used to help uniquely
-                       identify the query.  Optionally, a matching string after
-                       a "/" will be used to check the result text.  Up to
-                       n retries will take place until the matching string is
-                       found in the output text.  If the match string is never
-                       found the program's exit code is 1; if the match is
-                       found it exits with 0.  Note that there may be stdout
-                       printed for each retry (i.e. multiple lines printed
-                       out to stdout.)
-                       Example: -query_retries 4:1.5/grab_state
-
--remote_prefix str     Enable a remote-control communication channel for
-                       connected VNC clients.  str is a non-empty string. If a
-                       VNC client sends rfbCutText having the prefix "str"
-                       then the part after it is processed as though it were
-                       sent via 'x11vnc -remote ...'.  If it begins with
-                       neither 'cmd=' nor 'qry=' then 'qry=' is assumed.
-                       Any corresponding output text for that remote control
-                       command is sent back to all client as rfbCutText.
-                       The returned output is also prefixed with "str".
-                       Example: -remote_prefix DO_THIS:
-
-                       Note that enabling -remote_prefix allows the remote
-                       VNC viewers to run x11vnc -remote commands.  Do not
-                       use this option if they are not to be trusted.
-
--noremote              Do not process any remote control commands or queries.
--yesremote             Do process remote control commands or queries.
-                       Default: -yesremote
-
-                       A note about security wrt remote control commands.
-                       If someone can connect to the X display and change
-                       the property X11VNC_REMOTE, then they can remotely
-                       control x11vnc.  Normally access to the X display is
-                       protected.  Note that if they can modify X11VNC_REMOTE
-                       on the X server, they have enough permissions to also
-                       run their own x11vnc and thus have complete control
-                       of the desktop.  If the  "-connect /path/to/file"
-                       channel is being used, obviously anyone who can write
-                       to /path/to/file can remotely control x11vnc.  So be
-                       sure to protect the X display and that file's write
-                       permissions.  See -privremote below.
-
-                       If you are paranoid and do not think -noremote is
-                       enough, to disable the X11VNC_REMOTE property channel
-                       completely use -novncconnect, or use the -safer option
-                       that shuts many things off.
-
--unsafe                A few remote commands are disabled by default
-                       (currently: id:pick, accept:<cmd>, gone:<cmd>, and
-                       rawfb:setup:<cmd>) because they are associated with
-                       running external programs.  If you specify -unsafe, then
-                       these remote-control commands are allowed.  Note that
-                       you can still specify these parameters on the command
-                       line, they just cannot be invoked via remote-control.
--safer                 Equivalent to: -novncconnect -noremote and prohibiting
-                       -gui and the -connect file. Shuts off communcation
-                       channels.
--privremote            Perform some sanity checks and disable remote-control
-                       commands if it appears that the X DISPLAY and/or
-                       connectfile can be accessed by other users.  Once
-                       remote-control is disabled it cannot be turned back on.
--nocmds                No external commands (e.g. system(3), popen(3), exec(3))
-                       will be run at all.
--allowedcmds list      "list" contains a comma separated list of the only
-                       external commands that can be run.  The full list of
-                       associated options is:
-
-                        stunnel, ssl, unixpw, WAIT, zeroconf, id, accept,
-                        afteraccept, gone, pipeinput, v4l-info, rawfb-setup,
-                        dt, gui, ssh, storepasswd, passwdfile, custom_passwd,
-                        findauth, crash.
-
-                       See each option's help to learn the associated external
-                       command.  Note that the -nocmds option takes precedence
-                       and disables all external commands.
-
--deny_all              For use with -remote nodeny: start out denying all
-                       incoming clients until "-remote nodeny" is used to
-                       let them in.
-
-
-
-These options are passed to LibVNCServer:
-
--rfbport port          TCP port for RFB protocol
--rfbwait time          max time in ms to wait for RFB client
--rfbauth passwd-file   use authentication on RFB protocol
-                       (use 'storepasswd' to create a password file)
--rfbversion 3.x        Set the version of the RFB we choose to advertise
--permitfiletransfer    permit file transfer support
--passwd plain-password use authentication
-                       (use plain-password as password, USE AT YOUR RISK)
--deferupdate time      time in ms to defer updates (default 40)
--deferptrupdate time   time in ms to defer pointer updates (default none)
--desktop name          VNC desktop name (default "LibVNCServer")
--alwaysshared          always treat new clients as shared
--nevershared           never treat new clients as shared
--dontdisconnect        don't disconnect existing clients when a new non-shared
-                       connection comes in (refuse new connection instead)
--httpdir dir-path      enable http server using dir-path home
--httpport portnum      use portnum for http connection
--enablehttpproxy       enable http proxy support
--progressive height    enable progressive updating for slow links
--listen ipaddr         listen for connections only on network interface with
-                       addr ipaddr. '-listen localhost' and hostname work too.
-
-libvncserver-tight-extension options:
--disablefiletransfer   disable file transfer
--ftproot string        set ftp root
-
-   Pretty wild huh? Contact me if you have any questions or problems.
-
-   Personally, I use:
-x11vnc -rfbauth $HOME/.vnc/passwd -solid
diff --git a/ica/x11/x11vnc/RELEASE-NOTES b/ica/x11/x11vnc/RELEASE-NOTES
deleted file mode 100644
index 0d5c4b9..0000000
--- a/ica/x11/x11vnc/RELEASE-NOTES
+++ /dev/null
@@ -1,1553 +0,0 @@
-
-x11vnc 0.9.13	2010-12-20
-
-New in the 0.9.13 x11vnc release:
-
-	Improved support for non-X11 touchscreen devices (e.g. handheld or
-		cell phone) via Linux uinput input injection.  Additional
-		tuning parameters are added. TSLIB touchscreen calibration
-		is supported. Tested on Qtmoko Neo Freerunner.
-
-		A tool, misc/uinput.pl, is provided to diagnose uinput
-		behavior on new devices.
-
-		The env. vars. X11VNC_UINPUT_BUS and X11VNC_UINPUT_VERSION
-		are available if leaving them unset does not work.
-
-	The Linux uinput non-X11 input injection can now be bypassed:
-		events can be directly written to the /dev/input/event
-		devices specified by the user (direct_abs=..., etc.)
-
-		A -pipeinput input injection helper script,
-		misc/qt_tslib_inject.pl is provided as a tweakable
-		non-builtin direct input injection method.
-
-	The list of new uinput parameters for the above two features is:
-		pressure, tslib_cal, touch_always, dragskip, btn_touch;
-		direct_rel, direct_abs, direct_btn, direct_key.
-
-	The included SSL enabled Java VNC Viewers now handle Mouse
-		Wheel events.
-
-
-  miscellaneous new features and changes:
-
-	In -reflect mode, the libvncclient connection can now have
-		the pixel format modified via the environment
-		variables X11VNC_REFLECT_bitsPerSample,
-		X11VNC_REFLECT_samplesPerPixel, and
-		X11VNC_REFLECT_bytesPerPixel
-
-	In -create mode the following environment variables are added
-		to fine tune the behavior: FIND_DISPLAY_NO_LSOF:
-		do not use lsof(1) to try to determine the Linux VT,
-		FIND_DISPLAY_NO_VT_FIND: do not try to determine the
-		Linux VT at all, X11VNC_CREATE_LC_ALL_C_OK: do not bother
-		undoing the setting LC_ALL=C that the create_display
-		script sets.  The performance of the -create script
-		has been improved for large installations (100's of
-		user sessions on one machine.)
-
-	In -unixpw mode, one can now Tab from login: to Password.
-
-	An environment variable, X11VNC_SB_FACTOR, allows one to scale
-		the -sb screenblank sleep time from the default 2 secs.
-
-	In -rawfb mode, a bug is fixed in setting the number of bits
-		per pixel.
-
-	Documented that -grabkbd is no longer working with some/most
-		window managers (it can prevent resizing and menu posting.)
-
-	The macosx deprecated interface GetMainDevice() call is removed.
-		Compile with -DX11VNC_MACOSX_USE_GETMAINDEVICE if needed
-		for an old macosx version...
-
-	Miscellaneous code cleanup.
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.12	2010-09-10
-
-New in the 0.9.12 x11vnc release:
-
-	One can now specify the maximum number of displays
-		that can be created in -create mode via the
-		env. var. X11VNC_CREATE_MAX_DISPLAYS
-
-	The X11VNC_NO_LIMIT_SHM env. var. is added to skip any
-		automatic shared memory reduction.
-
-	The kdm display manager is now detected when trying not to get
-		killed by the display manager.
-
-  miscellaneous new features and changes:
-
-	A compile error is fixed when using --with-system-libvncserver
-		pointing to LibVNCServer 0.9.7.
-
-	-nevershared -forever usage mode is documented.
-
-	Old SuSE broken thread local storage is documented.
-
-	x11vnc exit cases are documented.
-
-	A compile bug from forced use of Xdefs.h is worked around.
-
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.11	2010-08-08
-
-New in the 0.9.11 x11vnc release:
-
-	The source tree is synchronized with the most recent libvncclient
-		(this only affects -reflect mode.)  The build is fixed
-		for incompatibilities when using an external LibVNCServer
-		(e.g.  ./configure --with-system-libvncserver...)
-
-	The SSL enabled Java VNC Viewer Makefile has been modified so
-		that the jar files that are built are compatible back
-		to Java 1.4.
-
-	In -reflect mode cursor position updates are now handled
-		correctly.
-
-	In -create/-unixpw mode, the env. var. FD_USERPREFS may be set
-		to a filename in the user's home directory that includes
-		default username:options values (so the options do not
-		need to be typed every time at the login prompt.)
-
-  miscellaneous new features and changes:
-
-	An option -always_inject is provided: Even if there is no
-		displacement (dx = dy = 0) for a VNC mouse event force
-		the pointer to the indicated x,y position anyway.
-
-	New java viewer debugging and workaround applet parameters:
-		debugKeyboard mapF5_to_atsign forbid_Ctrl_Alt 
-
-	You can set X11VNC_AVAHI_NAME, X11VNC_AVAHI_HOST, and/or
-		X11VNC_AVAHI_PORT environment variables to override the
-		default values. For example: -env X11VNC_AVAHI_NAME=wally
-
-	When opening the X11 display extra XAUTHLOCALHOSTNAME settings
-		are attempted.
-
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.10	2010-05-03
-
-New in the 0.9.10 x11vnc release:
-
-	IPv6 is now supported for all usage modes: forward and reverse
-		connections, SSL and unencrypted, etc.
-
-	The included SSL enabled Java VNC viewer applet now supports
-		Chained SSL Certificates (x11vnc -ssl always has.)
-		The applet autodects x11vnc and set GET=1 for faster
-		connecting via HTTPS.
-
-	A demo CGI script 'desktop.cgi' shows how to create an
-		SSL encrypted, multi-user x11vnc web login desktop
-		service.  The user logs into a secure web site and gets
-		his/her own virtual desktop and his browser accesses it
-		with the SSL Java VNC Viewer applet.
-
-	A serverCert Java Viewer applet parameter is provided.
-		Use an authenticated HTTPS browser connection to set
-		this parameter (the user could set it locally too.)
-		The onetimekey tool has -certonly option for this scheme.
-
-	The Xdummy script (use Xorg 'dummy' driver instead of Xvfb)
-		no longer requires being run as root.
-
-
-  miscellaneous new features and changes:
-
-	In the Java viewer applet, debugCerts and debugKeyboard parameters
-		are provided.  The debugging output of the applet is more
-		readable.  Some corner-case bugs (e.g. socket exceptions)
-		are now handled gracefully.  Parameters forbid_Ctrl_Alt
-		and mapF5_to_atsign are added.
-
-	The amount of time to wait for HTTPS applet downloads to finish
-		can be set in env. var. X11VNC_HTTPS_DOWNLOAD_WAIT_TIME.
-
-	The -xkb mode is automatically enabled if there are more than
-		4 keysyms per key.
-
-	-coe is now an alias for -connect_or_exit.
-
-	The -input_eagerly option enables this LibVNCServer feature
-		(it is like -allinput.)
-
-	The "%" unix password verification tricks for the -unixpw
-		option are now documented.  They also run a command
-		in UNIXPW_CMD.
-
-	In -create (-svc, etc.) modes, a warning is printed out if Xvfb
-		cannot be found.  Xvfb '+kb' option is checked for.
-		The -env CREATE_DISPLAY_OUTPUT=/tmp/mydebug.txt debugging
-		option is documented.  Try to preserve user's PATH
-		if possible.
-
-		In XDMCP connection mode, a test for GDM listening only
-		on IPv6 (::1) is performed.  The interface can also be
-		specified via FD_XDMCP_IF.
-
-	The example scripts connect_switch, ultravnc_repeater.pl, inet6to4
-		have settings to let them run reliably for long times
-		as daemons.  They also support IPv6.
-
-	IPv6 notes: for some very esoteric cases (e.g. -chatwindow)
-		IPv4 localhost may be required for local IPC.  A demo
-		transition tool 'inet6to4' is also included (can be
-		used for other apps.)  x11vnc options related to IPv6:
-		-listen6, -6, -no6, -noipv4, -noipv6, and -connect,
-		-proxy.
-
-	Use STUNNEL_LISTEN in -stunnel mode to have it listen on a
-		particular interface.  Also STUNNEL_PROG.
-
-	New remote control query options: pointer_x, pointer_y,
-		pointer_same, pointer_root, and pointer_mask. A demo
-		script using them misc/panner.pl is provided.
-
-	Remote control change of -clip option will not create new
-		framebuffer if the size has not changed (for panner.pl)
-
-	The X11VNC_DISABLE_SSL_CLIENT_MODE env. var. can be set to
-		disable SSL client role in reverse connections.  This
-		means the VNC viewer side must be in SSL client role.
-		UltraVNC repeater operation can benefit from this.
-
-		The SSL_INIT_TIMEOUT is increased to 1 hour if 'repeater'
-		is detected in a reverse connect string.
-
-	The X property X11VNC_TRAP_XRANDR can be set on a desktop to
-		force x11vnc to use the -xrandr screen size change
-		trapping code.
-
-	The -sslScripts option prints out the SSL certificate management
-		scripts.
-
-	Suggest '-auth guess' and '-findauth' if X connection fails.
-
-	The TightVNC sercurity type (TightVNC features enabler) now
-		works for RFB version 3.8.
-
-	RECORD scroll detection is now working with the new gtk/gdk scroll
-		mechanism.  Set X11VNC_SCROLL_MUST_EQUAL to disable.
-
-
-For more information:
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.9	2009-12-21
-
-
-
-New in the 0.9.9 x11vnc release:
-
-	A new option -findauth runs the FINDDISPLAY script that applies
-		heuristics to try to determine the correct XAUTHORITY
-		file.  The use of '-auth guess' will use the XAUTHORITY
-		that -findauth reveals.  This can be handy in with
-		the lastest GDM where the ability to store cookies in
-		~/.Xauthority has been removed.
-
-		If x11vnc is running as root (e.g. inetd or XDM/GDM/KDM)
-		the FD_XDM=1 mode will be tried if the above -findauth
-		or '-auth guess' command fails; it will find the
-		correct XAUTHORITY for the given display (this works for
-		XDM/GDM/KDM if the login greeter panel is up or if someone
-		has already logged into an X session.)	You can also
-		set -env FD_XDM=1 to force it to be done on the first try.
-
-	The -unixpw_system_greeter option, when used in combined
-		unixpw and XDMCP FINDCREATEDISPLAY mode (e.g. -xdmsvc),
-		enables the user to press Escape to jump directly to the
-		XDM/GDM/KDM login greeter screen.  This way the user
-		avoids entering his unix password twice at X session
-		creation time.	For subseqent logins to the same session,
-		he uses the regular x11vnc unixpw "login:" prompt.   Also,
-		the unixpw login panel now has a short help displayed
-		if the user presses 'F1' that lists the options.
-
-	The -appshare option enables simple application sharing based on
-		the -id/-sid mechanism.  Every new toplevel window that
-		the application creates induces a new viewer window via
-		a reverse connection.  The -id/-sid and -connect options
-		are required.  Run 'x11vnc -appshare -help' for more info.
-
-	Heuristics are applied to try to determine if the X display
-		is currently in a Display Manager Greeter Login panel
-		(e.g. GDM.)  If so, x11vnc's creation of any windows and
-		use of XFIXES are delayed.
-
-		This is to try to avoid x11vnc being killed after the user
-		logs in if the GDM KillInitClients=true is in effect.
-		So one no longer needs to set KillInitClients=false in
-		gdm.conf.  Note that in recent GDM the KillInitClients
-		option has been removed.
-
-		Also delayed is the use of the XFIXES cursor fetching
-		functionality; this avoids an Xorg bug that causes Xorg
-		to crash right after the user logs in.
-
-	x11vnc now tries to be more aggressive in keeping up with VNC
-		client's framebuffer update requests.  Some broken VNC
-		clients continuously spray these requests at VNC servers
-		(regardless of whether they have received any updates
-		or not.)  The -extra_fbur option allows one to fine tune
-		the setting.
-
-	The "-display WAIT:cmd=...", -find, -create modes now work
-		correctly for the user-supplied login program scheme
-		"-unixpw_cmd ...", as long as the login program supports
-		running commands specified in the environment variable
-		"RFB_UNIXPW_CMD_RUN" as the logged-in user.  The mode
-		"-unixpw_nis ..." has also been made more consistent.
-		The username option "tag=..." can be used to set FD_TAG.
-
-	The -stunnel option (like -ssl but uses stunnel as an external
-		helper program) now works with the -ssl "SAVE" and "TMP"
-		special certificate names.  The -sslverify and -sslCRL
-		options now work correctly in -stunnel mode.  Single port
-		HTTPS connections are also supported for this mode.
-
-	The remote control command -R can be used to instruct x11vnc
-		to resend its most recent copy of the Clipboard,
-		Primary, or Cutbuffer selections: "x11vnc -R
-		resend_clipboard", "x11vnc -R resend_primary", and
-		"x11vnc -R resend_cutbuffer".
-
-  miscellaneous new features and changes:
-
-	The fonts in the GUI (-gui) can now by set via environment
-		variables, e.g. -env X11VNC_FONT_BOLD='Helvetica -16 bold'
-		and -env X11VNC_FONT_FIXED='Courier -14'.
-
-	The value of the -timeout option is now also used for the timing
-		out of reverse connections.  The -timeout exit will
-		occur if no client has made it to normal operating state
-		(instead of merely trying to connect.)
-
-	One can add extra URL parameters to the HTTPS (-ssl) urls
-		via X11VNC_EXTRA_HTTPS_PARAMS without needing to edit
-		index.vnc. E.g.: -env X11VNC_EXTRA_HTTPS_PARAMS='?GET=1'
-
-	One can make the libvncserver HTTP (non-SSL) server listen on
-		localhost: -env X11VNC_HTTP_LISTEN_LOCALHOST=1 (this way
-		only the single-port VNC+HTTPS is exposed to the network.)
-
-	Warnings are printed out at startup if $DISPLAY appears to
-		start with "localhost:" (SSH X11 forwarding) or 
-		"hostname:" (remote X display; will fail w/o -noshm)
-
-	The -solid option now uses the DBUS_SESSION_BUS_ADDRESS env. var
-		if available.  The -solid option now works in xfce.
-		If available, the dbus_launch(1) will be used in
-		FINDCREATEDISPLAY for gnome sessions.
-
-	The bcx_xattach remote control command was added to facilitate
-		xattach and x2x desktop cursor switching.  Other new
-		remote control commands: grab_state, ping:mystring,
-		grablocal, resend_cutbuffer, resend_clipboard,
-		resend_primary, keycode, keysym, fakebuttonevent,
-		ptr, sleep, get_xprop, set_xprop, wininfo, pointer_pos,
-		mouse_xy, noop, guess_dbus, DIRECT:query.  Remote control
-		scripting, -query_retries, and -remote_prefix were
-		also added.
-
-	In -rawfb mode the X display will not be opened at all unless
-		the -rawfb string is prefixed with '+' or -display
-		was specified on the cmdline.
-
-	For multiple, separate x11vnc instances on the same X display,
-		one can rename the X11VNC_REMOTE, X11VNC_TICKER, and
-		VNC_CONNECT property names to unique ones.
-
-	The -showrfbauth option prints out the VNC rfbauth password.
-
-	The XDAMAGE mechanism is now automatically disabled for a
-		period of time if a game or screensaver generates too
-		many XDAMAGE rectangles per second.  This avoids the X11
-		event queue from soaking up too much memory.
-
-	x11vnc does not switch on server autorepeat if any keys are
-		pressed down to work around a recent Xorg server and/or
-		gnome bug where the key will never stop repeating.
-
-	Thse list of current clients is kept more up-to-date in the
-		tkx11vnc gui.  Bugs in the gui setpass mode have been
-		fixed.
-
-	Threads stability is further improved.  See under the -threads
-		option help info about -env X11VNC_THREADS_NEW_FB_SLEEP=ms
-
-	There is an experimental workaround: "-env X11VNC_WATCH_DX_DY=1"
-		that tries to avoid problems with poorly constructed
-		menu themes that place the initial position of the mouse
-		cursor inside a menu item's active zone.
-
-	The crypt(3) function is now declared inside the x11vnc code on
-		all platforms (not just Linux).  To disable this, set
-		CPPFLAGS='-DDO_NOT_DECLARE_CRYPT' while configuring.
-		(crypt is declared to avoid problems with header files.)
-
-	Error reasons are printed for -storepasswd failures.
-
-	Two scripts are added to x11vnc/misc: connect_switch and
-		ultravnc_repeater.pl
-
-For more information:
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
-
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.8	2009-07-08
-
-
-New in the 0.9.8 x11vnc release:
-
-	Better reliability for the Java Viewer applet when connecting
-		through a Web Proxy via HTTPS.	A proxy hostname
-		and port can be specified via applet parameters.
-		Proxy Authentication via Auth-Basic is supported.
-		More x11vnc printout in -ssl is provided to help
-		troubleshoot this mode and other ssl connections.
-
-	Stability improvements to -threads mode. Running x11vnc this
-		way is more reliable now. Threaded operation sometimes
-		gives better interactive response and faster updates. The
-		threaded mode now supports multiple VNC viewers using
-		the same VNC encoding (some only on Linux or enabled
-		at build time.)  The threaded mode can also yield
-		a performance enhancement in the many client case
-		(e.g. class-room broadcast.) We have tested with 30 to
-		50 simultaneous clients.  See also -reflect.
-
-
-  miscellaneous new features and changes:
-
-	x11vnc automatically tries to work around an Xorg server bug
-		involving infinitely repeating keys when turning off key
-		repeating. Use -repeat if the automatic workaround fails.
-		Also, the environment variable X11VNC_IDLE_TIMEOUT
-		(seconds) is provided.
-
-	In -reflect mode the environment variable X11VNC_REFLECT_PASSWORD
-		is provided.
-
-	The -clip mode works under -rawfb.
-
-	The -nounixpw option can disable unixpw mode if an earlier option
-		enables it (e.g. -svc).
-
-	Scroll detection is skipped for windows with 'OpenOffice' in
-		their name.
-
-
-For more information:
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.7	2009-03-31
-
-
-New in the 0.9.7 x11vnc release:
-
-	Basic support for building with VirtualGL's TurboVNC (an
-		enhanced TightVNC for fast LAN high framerate usage)
-		encoding and TightVNC modifications.  More info:
-		http://www.karlrunge.com/x11vnc/faq.html#faq-turbovnc
-		and x11vnc/misc/turbovnc/README.
-
-	The -ncache_cr option has been fixed and so in -ncache mode
-		smooth opaque window motions are now work correctly. Try
-		it out to see how smooth it is even on a slow link.
-
-	Support for Linux text consoles (virtual terminals, e.g. 1-6)
-		is provided via, e.g., 'x11vnc -rawfb vt2' (for virtual
-		terminal #2).
-
-		This is like LinuxVNC (i.e. text only), it avoids using
-		/dev/fb and uses /dev/vcsaN instead (the '-rawfb console'
-		mode uses /dev/fb.)  With /dev/vcsaN the text terminal
-		is accessible even it if is not the currently active one.
-
-	The -rawfb option now supports framebuffers with bits per pixel
-		less than 8 (e.g. 4 or 1 bpp.)
-
-	Reverse connections now work in Anonymous Diffie Hellman SSL/TLS
-		mode.  Reverse connections also work for VeNCrypt and
-		ANONTLS modes.
-
-
-  miscellaneous new features and changes:
-
-	The included SSL enabled UltraVNC java viewer now has a
-		configurable [Home] entry in the drives drop down menu.
-
-	In the -create, -svc, etc. modes one can now specify a
-		range of X displays to ignore in X11VNC_SKIP_DISPLAY.
-		Improvements and bugfixes were made to the find_display
-		and create_display scripts.  FD_EXTRA option is provided.
-
-	The '-rawfb video' option finds the video device file more
-		carefully.
-
-	The -rmflag option allows a new way to indicate to other
-		applications that x11vnc has started.
-
-	All of the java applet parameters are now documented in
-		the classes/ssl/README file.
-
-	There is now a "sendbell" remote control command.
-
-	A one-time -padgeom once:WxH mode is added.
-
-	Improvements to the CUPS Terminal Services helper mode.
-
-	If the X display cannot be opened normally then the env. var.
-		XAUTHLOCALHOSTNAME=localhost is tried.
-
-	Bugfix for selection transfer to a now non-existent X window
-		(Thunderbird can cause this.)  Related, the env. variable
-		LIBXCB_ALLOW_SLOPPY_LOCK is now set by default.
-
-	Bugfix for -8to24 mode due to nonstandard indexed color support.
-
-	The libvncserver and x11vnc autoconf/automake settings have
-		been improved.
-
-	libXrandr include file is now found on Solaris.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.6	2008-12-10
-
-
-New in the 0.9.6 x11vnc release:
-
-	x11vnc's SSL encryption is extended to support the VeNCrypt and
-		TLS (older; vino) SSL/TLS security type extensions to VNC.
-
-	Anonymous Diffie-Hellman key exchange (-ssl ANON) and Certificate
-		Revocation List support (-sslCRL) is added to the SSL
-		encryption mode.
-
-	The Java viewer applet can now be served up through the VNC port
-		(5900) in addition to the normal HTTP port (5800) via
-		the -http_oneport option.  Previously this only worked
-		for SSL connections and HTTPS.
-
-	The "-rfbport PROMPT" mode presents a simple gui for the user
-		to select a port for the x11vnc service and a few other
-		settings.  This enables a menu entry for naive users
-		that is included in x11vnc.desktop.
-
-	If x11vnc is not built with the Avahi Zeroconf library an external
-		helper program (avahi-publish or dns-sd on Mac OS X)
-		is used instead.
-
-  miscellaneous new features and changes:
-
-	The default mode for '-ssl' is now the '-ssl SAVE' mode; i.e.
-		the generated certificate is saved and reused in
-		subsequent sessions rather than being discarded.
-		Use '-ssl TMP' recover the old way.  This change made
-		to for it to be more likely that the VNC Viewer can save
-		the accepted cert for future authentications.
-
-	The solid background color option works on the Mac OS X console.
-
-	The -reopen option enables x11vnc to try to re connect to the X
-		display if GDM (or other display manager) kills it just
-		after the user logs in.
-
-	The -dhparams option can be used to point to your own Diffie
-		Hellman parameters.
-
-	The -setdefer option allows tuning how quickly updates will
-		be sent.  Default setting tuned.
-
-	The option -zeroconf is now an alias for -avahi/-mdns.
-
-	In pipeinput mode, the pipe filehandle is now closed when
-		x11vnc exits.
-
-	The -sshonly option turns off VeNCrypt and TLSVNC (vino) mod
-		leaving only the standard SSL (i.e. vncs://)
-
-	For testing, the option -rand in an alias for -rawfb rand -nopw
-
-	Minor tweaks to improve CUPS Print tunneling.
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.5	2008-10-24
-
-
-New in the 0.9.5 x11vnc release:
-
-	Symmetric key encryption using the RC4, AES, Blowfish, and 3DES
-		ciphers is supported via the -enc cipher:keyfile option.
-		The SSVNC unix viewer 1.0.20 and later supports these
-		encryption methods.
-
-	Server-side scaling can now have different scale factors along
-		the horizontal and vertical axes.  E.g. -scale 1280x1024
-		(same as -geometry 1280x1024) or -scale 0.8x0.75
-
-	The -chatwindow option allows a chat window to appear on the
-		X console during UltraVNC chats (requires the SSVNC
-		viewer package.)
-
-  miscellaneous new features and changes:
-
-	The HTTP Java viewer applet jar, classes/VncViewer.jar, has
-		been updated with an improved implementation based on
-		the code used by the classes/ssl applets.
-
-	A description and instructions are now printed out when
-		X_ShmAttach fails if one tries to attach to a remote
-		$DISPLAY (i.e. $DISPLAY is on a different machine from
-		the machine x11vnc is running on; this often happens
-		with SSH X redirection, X terminal servers, etc).
-
-	The -allow option now works correctly in -ssl mode.
-
-	The -remap option now works on the MacOSX console.
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.4	2008-09-17
-
-
-New in the 0.9.4 x11vnc release:
-
-	Reverse VNC connections (-connect and  -connect_or_exit options)
-		work in the -find and -create X session FINDCREATEDISPLAY
-		modes.
-
-	Reverse VNC connections (either normal or using SSL) can use a
-		Web Proxy, a SOCKS proxy, the UltraVNC repeater proxy,
-		an SSH connection, or even a CGI URL to make the outgoing
-		connection (-proxy option).  Forward connections can
-		use the -ssh option to set up a reachable redirection.
-
-	Support for the ZYWRLE encoding is added, this is the RealVNC ZRLE
-		encoding extended to do motion video and photo regions
-		more efficiently by way of a Wavelet based transformation.
-
-	The session finding and creating modes (-find and -create) have
-		been improved to be more reliable and also provide a new
-		desktop types (xfce) and new service redirection options.
-
-	Support for indexed colormaps (PseudoColor) with depths other
-		than 8 is provided (depths 1 to 16 now work).
-
-	Java viewer applet source code is provided in the x11vnc 0.9.4
-		tarball so now everything can be built from source.  
-
-  miscellaneous new features and changes:
-
-	To unset Caps_Lock, Num_Lock and raise all keys in the X server
-		use -clear_all, or by remote control 'x11vnc -R clear_all'
-
-	The -autoport option gives more control over the server port
-		range that probes.
-
-	The -ping option can be used to help keep idle connections alive.
-
-	The -finddpy and -listdpy utilities help to debug and configure
-		the -find, -create, and -display WAIT:... modes.
-
-	Some automatic detection of screen resizes are handled even if
-		the -xrandr option is not supplied.
-
-	The -advertise_truecolor option can workaround some VNC viewer
-		incompatibilities with PseudoColor.
-
-	The option '-clip xinerama0' can be used to clip to the first
-		Xinerama sub-screen, etc.
-
-	If a fast framebuffer read rate is detected the -wait and -defer
-		parameters are reduced to 10 and 15 msec, respectively.
-
-	Pasting of the selection/clipboard into remote applications
-		(e.g. Java) is improved.
-
-	Usage with dvorak keyboards is improved.  The option -macuskbd is
-		available on MacOSX to use the original US keyboard code.
-
-	Via a compiler option (-DENABLE_GRABLOCAL) one can use the
-		-grablocal n option to filter VNC client input if someone
-		at the console has done mouse or keyboard input n secs ago. 
-
-	The -sleepin option can now sleep a random amount of time between
-		min and max time delays (-sleepin min-max).
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.3	2007-10-04
-
-
-New in the 0.9.3 x11vnc release:
-
-	This release provides client-side caching to improve interactive
-	response.  Almost no VNC viewers implement caching which is why
-	VNC is slow compared to other remote graphics protocols.
-
-	The x11vnc caching will work with any VNC viewer, but they will
-	not hide the pixmap cache region that is below the main desktop
-	(one must adjust the window manually).  The SSVNC Unix VNC viewer,
-	however, automatically detects and hides the region.
-
-	To enable caching, supply "-ncache n" to x11vnc, where the
-	number n, e.g. 10, indicates how much memory to devote to the
-	caching scheme.
-
-	See http://www.karlrunge.com/x11vnc/#faq-client-caching
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.2	2007-06-18
-
-
-New in the 0.9.2 x11vnc release:
-
-	A compile-time bug is fixed for when the OpenSSL library is not
-		available or --without-ssl is supplied; previously the
-		build would fail.
-
-	One can configure x11vnc via "configure --with-system-libvncserver"
-		to use a system installed libvncserver library instead of
-		the one bundled in the release tarball. 
-
-	If UltraVNC file transfer or chat is detected, then VNC clients
-		are "pinged" more often to prevent these side channels
-		from becoming serviced too infrequently.
-
-	In -unixpw mode in the username and password dialog no text will
-		be echoed if the first character sent is "Escape".  This
-		enables a convenience feature in SSVNC to send the username
-		and password automatically.  
-
-  miscellaneous new features and changes:
-
-	When building from the CVS tree --with-x11vnc must be supplied if
-		you want x11vnc to be built.  The LibVNCServer release
-		tarball no longer contains the x11vnc source.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9.1	2007-05-24
-
-
-New in the 0.9.1 x11vnc release:
-
-	A new Unix username identification scheme is provided when
-		SSL client certificates are used to authenticate VNC
-		viewers.  The username is extracted from the 'Subject'
-		section of the cert.  The option is "-users sslpeer="
-		which, like "-users unixpw=" already does, will cause
-		a switch to the Unix user.  This is useful for the
-		-find and -create options that try to find an existing
-		X session associated with the user or create a new one.
-
-	The UltraVNC Java Viewer has been modified to support SSL
-		connections.  Some bugs were also fixed and some
-		improvements added.  A patch file and a compiled jar file
-		(UltraViewerSSL.jar and SignedUltraViewerSSL.jar in the
-		classes/ssl directory) are provided in the x11vnc package.
-
-	For the -user option groups are now handled better by using
-		initgroups(3), or if finer control is needed one can
-		use: "-users user1.group1,..."
-
-	When SSL client certification is being used and external login
-		programs are being used the env. var. RFB_SSL_CLIENT_CERT
-		is set to the clients certificate.  Set X11VNC_SSLPEER_CN
-		to use the Common Name instead of the certificate email
-		address to find the unix username.
-
-  miscellaneous new features and changes:
-
-	The -wait and -defer defaults were lowered from 30 to 20
-		milliseconds, set the values explicitly if this increases
-		the load too much for your liking.
-
-	In -create mode where a Xvfb session is started, mwm was added
-		as a session type.  setpgrp(2) is used for the spawned
-		process if available.  The XKEYBOARD extension is 
-		enabled (+kb, but it doesn't seem to always work).
-		TrueColor is forced to be the default visual (recent
-		Xvfb seem to choose DirectColor, this is likely a bug)
-		One can also force creating a new Xvfb by setting the
-		env. var. X11VNC_FINDDISPLAY_ALWAYS_FAILS (not exactly
-		clear what this would be used for). 
-
-	The WAITBG env. var. enables -display WAIT:... to take place in
-		the background.
-
-	One can specify the X11VNC_SKIP_DISPLAY env. var. for a list of
-		displays to exclude in the FINDDISPLAY action.	This can
-		also be specified via nd=... as a -unixpw login option.
-
-	setsid() or setpgrp() is called for the external command spawned
-		by the -gone option (since it may be long lived, e.g. a
-		screen locker).
-
-	The script "onetimekey" utility is provided in the classes/ssl
-		subdirectory that allows a (very long) string representing
-		a Client SSL certificate to be provided by the authenticating
-		client, or via https cgi script (e.g. after a web login).
-
-	Some bugs were fixed in the libvncserver implementation of
-		UltraVNC file transfer.
-
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.9	2007-04-18
-
-
-New in the 0.9 x11vnc release:
-
-	VNC Service advertising via mDNS / ZeroConf / BonJour with the
-		Avahi client library. Enable via "-avahi".
-
-	Implementations of UltraVNC's TextChat, SingleWindow, and
-		ServerInput extensions (requires ultravnc viewer or ssvnc
-		Unix viewer). They toggle the selection of a single window
-		(-id), and disable (friendly) user input and viewing
-		(monitor blank) at the VNC server.
-
-	Short aliases "-find", "-create", "-svc", and "-xdmsvc" for
-		commonly used FINDCREATEDISPLAY usage modes (to find
-		the user's display or create one, etc).
-
-	Reverse VNC connections (viewer listening) now work in SSL
-		(-ssl) mode.
-
-  miscellaneous new features and changes:
-
-	New options to control the Monitor power state and keyboard/mouse
-		grabbing: -forcedpms, -clientdpms, -noserverdpms,
-		and -grabalways.
-
-	A simple way to emulate inetd(8) to some degree via the "-loopbg"
-		option.
-
-	Monitor the accuracy of XDAMAGE and apply "-noxdamage" if it is
-		not working well. OpenGL applications like like beryl and
-		MythTv have been shown to make XDAMAGE not work properly.
-
-	For Java SSL connections involving a router/firewall port
-		redirection, an option -httpsredir to spare the user
-		from needing to include PORT=NNN in the browser URL.
-
-	A -sleepin n option to delay startup by n seconds to let redirs
-		and listening clients to get started.
-
-	TightVNC file transfer is now off by default; enable via
-		-tightfilexfer
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.8.4	2007-02-01
-
-
-New in the 0.8.4 x11vnc release:
-
-	Native Mac OS X Aqua/Quartz support.  It exports the full
-		display (no X11 server, etc).
-
-		This provides an alternative to OSXvnc; some activities
-		are faster (and see the client-side caching feature
-		-ncache in the 0.8.5 development version for more
-		speedups).
-
-	x11vnc can act as a VNC reflector/repeater using the
-		"-reflect host:N" option.  This is useful for large
-		classroom broadcasting or demos.  You set up a number
-		of reflectors to spread the network and CPU load around
-		for better response.
-
-	A new login mode: "-display WAIT:cmd=FINDCREATEDISPLAY -unixpw ..."
-		that will Create a new X session (Xvfb, Xdummy, or
-		Xorg) for the user if it cannot find the user's X
-		session display via the FINDDISPLAY method.  It will
-		be re-found upon reconnection.
-
-		This enables a simple "terminal services" mode based on
-		Unix username and password and where the user does not
-		have to memorize their VNC display number, etc.
-
-
-  miscellaneous new features and changes:
-
-	Option -nodpms to avoid problems with programs like KDE's
-		kdesktop_lock that keep restarting the screen saver
-		every few seconds even with active VNC clients connected.
-
-	The "-N" option couples the VNC Display number to the X Display
-		number. E.g. if your X DISPLAY is :2 then the VNC display
-		will be :2 (i.e. using port 5902). If that port is taken
-		x11vnc will exit.
-
-	Wireframe copyrect detection for local user activity (e.g. someone
-		sitting at the physical display moving windows).  You
-		can disable this with the -nowireframelocal option.
-
-	To automatically fix the common mouse motion problem on XINERAMA
-		(multi-headed) displays, the -xwarppointer option is
-		enabled by default when XINERAMA is active.  You can
-		disable this with the -noxwarppointer option.
-
-	By default in -reflect mode -shared is implied (it makes sense),
-		use -noshared after the -reflect option to disable this. 
-
-	The -prog option lets you specify the full path (argv[0]) to
-		the program, in case it is spawned by inetd/tcpd and
-		cannot determine its path.  The path is needed for the
-		-http option to guess the http classes directory.
-
-	Usually not needed, but there are many options for tuning the
-		native Mac OS X mode: -macnodim -macnosleep -macnosaver
-		-macnowait -macwheel -macnoswap -macnoresize -maciconanim
-		-macmenu.
-
-	An option -debug_xdamage has been added for debugging and profiling.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.8.3	2006-11-13
-
-
-New in the 0.8.3 x11vnc release:
-
-	The -ssl option provides SSL encryption and authentication
-		natively via the www.openssl.org library.  One can use
-		from a simple self-signed certificate server certificate
-		up to full CA and client certificate authentication schemes.
-
-	The -sslverify option allows for authenticating VNC clients via
-		their certificates in either -ssl or -stunnel modes.
-
-	Certificate creation and management tools are provide in the
-		-sslGenCert, -sslGenCA, and related options.
-
-	An SSL enabled Java applet VNC Viewer applet is provided in
-		classes/ssl/VncViewer.jar.
-
-		The applet may also be loaded into the web
-		browser via HTTPS, i.e one can use the VNC port,
-		e.g. https://host:5900/
-
-		See our "Enhanced TightVNC Viewer" project, for native
-		SSL enabled viewers.
-
-	The -unixpw option supports Unix username and password
-		authentication. The -ssl or -localhost and -stunnel
-		options (or detection of an SSH tunnel) are enforced in
-		this mode to prevent password sniffing.
-
-	Coupling -unixpw with -display WAIT:cmd=FINDDISPLAY provides a
-		way to allow a user to login with their UNIX password
-		and have their display connected to automatically.
-
-	Hooks are provided in the -unixpw_cmd and "-passwdfile cmd:,custom:..."
-		options to allow you to supply your own authentication
-		and password lookup programs (e.g. LDAP).
-
-	The "-ultrafilexfer" alias is provided and improved UltraVNC
-		filetransfer rates have been achieved.
-
-	The -rotate option enables you to rotate or reflect the screen
-		before exporting via VNC. This is intended for use on
-		handhelds and other devices where the rotation orientation
-		is not "natural".
-
-  miscellaneous new features and changes:
-
-	Similar to -ssl, the -stunnel option starts up a SSL tunnel server
-		stunnel (that must be installed separately on the system)
-		to allow only encrypted SSL connections from the network.
-
-	Option -sslnofail to exit immediately if there are any SSL
-		connection failures.
-
-	A simpler variant of -unixpw is the -unixpw_nis option that
-		works in environments where the encrypted passwords are
-		readable, e.g. NIS.
-
-	x11vnc can be configured and built to not depend on X11 libraries
-		"./configure --without-x" for -rawfb only operation
-		(e.g. embedded linux console devices).
-
-	Add -cursor_drag to change the mouse cursor during Drag and Drop, etc.
-
-	Under the "-connect_or_exit host" option x11vnc will exit
-		immediately unless the reverse connection to host
-		succeeds. The "-rfbport 0" option disables TCP listening
-		for connections (useful for this mode).
-
-	The "-rawfb rand" and "-rawfb none" options are useful for
-		testing automation scripts, etc., without requiring a
-		full desktop.
-
-	Reduced spewing of information at startup, use "-verbose" (also
-		"-v") to turn it back on for debugging.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.8.2	2006-07-13
-
-
-New in the 0.8.2 x11vnc release:
-
-	Support for full mouse and keyboard input into the Linux
-		console framebuffer /dev/fb0 in -rawfb mode
-		(i.e. non-X11) by using the Linux "uinput" driver.
-
-		This enables, for example, viewing and interacting
-		with Qt-embedded/Qtopia-Core apps on Linux-based
-		handhelds, etc.
-
-		Options:   -rawfb cons, -pipeinput UINPUT More info:
-		http://www.karlrunge.com/x11vnc/#faq-qt-embedded
-
-	Extension of the display option: -display WAIT:<disp-or-cmd>
-		to delay x11vnc's opening of the X display
-		until a VNC client connects (useful built-in:
-		-display WAIT:cmd=FINDDISPLAY, to find a user's
-		display and Xauthority data).
-
-	Options -grabkbd and -grabptr have x11vnc try to grab
-		the X display when VNC clients are connected to
-		prevent a (non-malicious) user at the physical X
-		display from performing keyboard or mouse input.
-		E.g. remote help-desk support.
-	
-
-  miscellaneous new features and changes:
-
-	-allowedcmds option to fine-tune which external commands
-		may be run by x11vnc, rather than shutting
-		them all off with -nocmds.
-
-	-env VAR=VALUE convenience option to avoid the need of
-		setting environment variables before starting
-		x11vnc.
-
-	-allinput option to enable libvncserver handleEventsEagerly
-		parameter (not clear it yields an improvement).
-
-	-rawfb rand  fun/testing option using /dev/urandom as a fb.
-
-	-license, -copying, -warranty option.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.8.1	2006-06-03
-
-New in the 0.8.1 x11vnc release:
-
-	Improved support for webcams and tv tuners with video4linux
-		/dev/video: see the "-rawfb video" and "-pipeinput VID"
-		options. (the latter gives a simple keyboard control
-		of a tv tuner; see also the -freqtab option for stations).
-
-	FBPM support for hardware that provides framebuffer power
-		management (it needs to be disabled when vnc clients
-		are connected).
-
-	The -usepw option will require x11vnc to use a password of 
-		some sort or otherwise exit immediately.  Put it in
-		your ~/.x11vncrc so you don't forget.
-
-	The command "x11vnc -storepasswd" will prompt for a password
-		without echoing and save it in ~/.vnc/passwd
-
-	The X CLIPBOARD selection is managed in addition to the
-		X PRIMARY selection.
-
-
-  miscellaneous new features and changes:
-
-	Convenience option for accessing the Linux console: -rawfb cons
-		etc. (requires /dev/fb0 to be working).
-
-	clipboard/cut-text input can now be managed on a per-client
-		basis.
-
-	-capslock and -skip_lockkeys options can help make CapsLock work
-		better.
-
-	The Xdummy wrapper script is included in the source tree.
-
-	A mode "-gone popup" as been added.
-
-	-24to32 option to avoid 24bpp problems.
-
-	-xinerama is on by default.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.8	2006-02-13
-
-
-New in the 0.8 x11vnc release:
-
-	TightVNC file transfer support is enabled via the extension to
-		LibVNCServer added by Rohit Kumar.
-
-	The -passwdfile option has been enhanced to handle any number
-		of full-access and view only passwords in an easy to
-		maintain format, and additional features.
-
-	The -8to24 option enables multi-depth viewing on systems that do
-		not support -overlay. The 8bpp regions are transformed
-		to depth 24 TrueColor before exporting via VNC.
-
-	The x11vnc source code has gone through a major reorganization.
-		The build has been enhanced and many bugs fixed.
-
-
-  miscellaneous new features and changes:
-
-	-afteraccept option is like -accept however it enables running
-		a user supplied command after client authentication
-		has taken place. The RFB_* environment variables have
-		been extended.
-	-loop option will run x11vnc in an outer loop restarting each time
-		(useful for situations where the X server restarts often).
-	-slow_fb allows for slow polling for special purpose applications
-		(e.g. video).  -blackout noptr,WxH+X+Y,... will prevent
-	the pointer from going into a blacked out region.
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help | less
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.7.2	2005-07-11
-
-
-New in the 0.7.2 x11vnc release:
-
-	The X DAMAGE extension is supported to dramatically reduce
-		resource consumption when idle: often 20 times less;
-		and to pick up small changed regions more quickly.
-
-		DAMAGE sends events indicating damaged (modified) screen
-		rectangles to x11vnc.  These are used as hints to focus
-		the polling and also if the rectangle is below a size
-		threshold it is accepted unconditionally (i.e. dragged in
-		from the framebuffer).	Tuning is possible with -xd_area.
-
-		DAMAGE is available on recent Xorg servers and Solaris 10.
-
-	-wireframe: Heuristics are used to guess when a window is being
-		moved or resized and during this period show only a
-		moving wireframe outline.  Just like on video cards in
-		the 90's, remember?  This is to avoid window "lurching"
-		when you move or resize one opaquely.
-
-		Also, -wirecopyrect applies the VNC CopyRect encoding
-		for the moved window.  Both are on by default, use
-		-nowireframe or -nowirecopyrect to disable (aka -nowf
-		and -nowcr).
-
-	-scrollcopyrect: Sniff the X11 protocol via the RECORD extension
-		and to try to detect window scrolls (e.g. via scrollbar,
-		Up/Down arrow, etc).  When detected, the VNC CopyRect
-		encoding is applied to the scrolled regions for a speedup.
-
-		The contents of the scrolling window may only be
-		approximate while it is being scrolled: e.g. tearing,
-		bunching-up, etc.  The heuristics will also miss scrolls
-		by certain toolkits or applications, so those will still
-		happen the slow way.  To disable use -noscrollcopyrect
-		(aka -noscr).  Tuning is also available, see the -help
-		entry.
-
-	-listen: Makes x11vnc listen only on a single network interface.
-		-localhost now implies '-listen localhost'.
-
-	-rawfb: Instead of polling an X server framebuffer, poll a raw
-		one (i.e. a mapped file or a shm segment).  E.g. for
-		the linux framebuffer device:
-
-		    -rawfb map:/dev/fb0 at 1024x768x32
-
-		This is a bit out of x11vnc's scope but may have some
-		interesting applications.  Perhaps /dev/video?
-
-	-pipeinput: Pipe the VNC user's pointer and keyboard input events
-		to a helper program you provide.  Two examples are in
-		misc/vcinject.pl and misc/slide.pl.  Primarily intended
-		for use with -rawfb to somehow kludge-up user input,
-		but it can also be used by itself.
-
-	Improvements for the magnification scaling case (e.g. -scale 2)
-		for use in low vision applications.  It is faster and
-		no-blending :nb now works correctly.
-
-	More safety measures are taken WRT remote-control in the
-		default mode.  See the -unsafe, -safer, -privremote,
-		and -nocmds options.
-
-	The GUI has been improved, and running with the options "-gui icon"
-		presents a small, simple gui instead of the full blown one,
-		and "-gui tray" attempts to embed the small icon in the
-		system tray.  Use "-gui tray=setpass" to prompt for
-		session password creation at startup.
-
-
-  miscellaneous new features and changes:
-
-	-xkb: a simple test is performed at startup to see if it is a
-		good idea to apply -xkb mode for the current keyboard
-		keymapping (i.e. if keysyms like !, @, [ are otherwise
-		unavailable).  To disable use -noxkb.
-	 ISO_Level3_Shift vs. Mode_switch:  Set things up in -xkb mode to
-		prefer ISO_Level3_Shift over Mode_switch for modtweaking.
-		No override; let me know if this causes problems.
-	-add_keysyms is now the default, use -noadd_keysyms to disable.
-		the added keysyms are periodically deleted.
-	-remap DEAD: shorthand for mapping many "dead" keysyms to their
-		"un-dead" counterparts, e.g. grave -> dead_grave.  For
-		some VNC viewers that are unable to send the dead keysym.
-	-skip_dups: skip impossible duplicate key events sent by some VNC
-		viewers. -noskip_dups to disable (currently off by default).
-	-sloppy_keys: try to handle sloppy keyboarding (esp. between
-		different language keyboards) where, say, Shift is released
-		before the key.
-	-norepeat N: ping-pong N times if something else on the desktop
-		restores key autorepeating (e.g. session startup). Default
-		2.  Also, If the VNC client is idle for 5 min. autorepeat
-		is restored.
-	-wait_ui: If there is very recent user input, cut the -wait sleep
-		time by the specified factor (default 2.0).
-	-nowait_bog: Detection is now in place to watch for polling "bogging
-		down" (e.g. lots of scrolling text from a long build in a
-		terminal) and to sleep more.  Use -nowait_bog to disable.
-	-flag: write PORT=5900 to a flag file to aid wrapper scripts.
-	-http: try to guess what the -httpdir should be and if found
-		enable http listening.
-	-clip WxH+X+Y: only show the specified rectangle not the
-		entire screen.
-	 cursors are now scaled by default under -scale, use -scale_cursor
-		to modify this behavior.
-	-arrow n: select from some different arrow cursors (ignored under
-		XFIXES cursor grabbing mode).
-	-nolookup: disable DNS lookups for broken environments.
-	-seldir: fine tune and debug selection transfer. 
-	 build-time customization macros: SHARED, FOREVER, NOREPEAT,
-		REMOTE_CONTROL, SMALL_FOOTPRINT, default passwd, etc.
-		see the top of the x11vnc.c for more info.
-	-xtrap: DEC-XTRAP extension is supported for legacy systems
-		with insufficient XTEST extension (X11R5).
-	-shiftcmap: for legacy systems with non-standard colormap values.
-	-noxrecord: do not use the RECORD extension for anything (currently
-		only -scrollcopyrect and grabserver watching use it).
-	-grab_buster: fork a helper thread to watch for XGrabServer deadlock
-		in x11vnc and break the grab.  Under -scrollcopyrect there
-		is a small window where x11vnc is vulnerable to this deadlock.
-	-dbg:   A "crash shell" with tips on debugging will be presented
-		instead of exiting when a fatal error occurs.	
-	-fixscreen: periodically refresh the screen to get rid of painting
-		errors, etc. induced by new features, jpeg compression, etc.
-	-speeds: Tell x11vnc what the network and fb speeds are instead of
-		having it try to measure them.  (these speeds are used by
-		various features, such as -wireframe, -scrollcopyrect, etc.).
-	-wmdt: set the window manager or desktop to spare x11vnc from guessing.
-	-readtimeout: set libvncserver's read timeout parameter, useful on
-		very slow links that take more than 20secs to paint
-		the whole screen.
-	-nopw: If you use x11vnc without a password it now prints out a
-		scary warning message.  Use -nopw to disable the warning.
-	 plugged X event leaks; periodically purge any remaining buildup.
-	
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.7.1	2005-02-24
-
-
-New in the 0.7.1 x11vnc release:
-
-	Improved algorithm for approximating XFIXES cursors with
-		transparency (alpha channel).  No more ugly black fuzz
-		around translucent cursors.  Tuning parameters -alpha*
-		if it is still not right.
-
-	Added mechanisms to handle XFIXES cursors with transparency
-		exactly (i.e. blend in the background).  Works by default
-		under -nocursorshape updates, and also works under limited
-		circumstances for cursorshape updates if the VNC viewer
-		is patched (TightVNC viewer patch provided).
-
-	-solid: to improve performance switch the background to a solid
-		color when clients are connected.  Works on GNOME, KDE,
-		CDE, and classic X.
-
-	-input: allows fine-tuning the type of allowed user input
-		(Keystroke, Mouse-motion, Button-click).  Useful for
-		certain applications of x11vnc, e.g. demos. Also
-		per-client settings via -R input:xyz..
-
-	-users: enables switching to different users if started as root.
-		Please read the description for details.
-
-	-gui ez: less daunting GUI with fewer options via '-gui ez' or
-		"Misc -> simple-gui" once started.
-
-  miscellaneous new features and changes:
-
-	-nap is now the default, use -nonap to disable.
-	-snapfb: snapshot h/w fb to RAM periodically, not clear how useful...
-	-timeout n: for use in certain applications, exit if no client
-		connects after n seconds.
-	-oa and -logappend for appending to logfiles.
-	-opts will just show the options w/o the long -help descriptions.
-	if you forget to set -display, it will beep and try :0 after a bit.
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.7	2004-12-23
-
-
-New in the 0.7 x11vnc release:
-
-	Support for the XFIXES X extension to show the exact mouse cursor
-		shape.  Requires libXfixes.  For approximate cursor
-		shapes also see: -cursor (none|arrow|X|some|most)
-
-	-remote/-R: remote-control support: nearly every setting can be
-		changed dynamically without restarting x11vnc.	For
-		example, "x11vnc -R shared", and "x11vnc -R scale:3/4"
-		will connect to a running x11vnc server to make it shared
-		and re-scaled, respectively.
-
-	-gui: launches a simple tcl/tk GUI based on the remote control
-		function.  Requires the tcl/tk "wish" program.
-
-	-overlay: support for overlay/multi-depth (e.g. 24+8) visuals
-		on Solaris (SUN_OVL extension) and IRIX.
-
-	-xrandr: support for the XRANDR (X Resize, Rotate and Reflection)
-		extension: if the screen changes size or rotates x11vnc
-		creates a new framebuffer to match it.  Useful to have a VNC
-		Viewer that supports NewFBSize extension. (also -padgeom)
-
-	-pointer_mode: Experimental pointer input handling schemes,
-		e.g.: "-pointer_mode 3" (similar to -nodragging)
-
-	man page x11vnc.1 and README files created.
-
-  miscellaneous new features and changes:
-
-	-sb: set screen blank idle timeout
-	-nocursorshape: disable cursor shape VNC extension.
-	RFB_MODE = "accept" or "gone" passed to -accept/-gone commands.
-        -vncconnect is now the default.
-        -norepeat is now the default.
-	"-id pick" to pick a window via xwininfo for the -id option. 
-	-sid option: like -id but crops root window instead.
-	Related to remote-control: -query, -noremote, -sync, 
-		-deny_all, -safer, -unsafe.
-
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help
-
------------------------------------------------------------------------------
-
-
-x11vnc 0.6.2	2004-08-02
-
-New in the 0.6.2 x11vnc release:
-
-	-scale option for server side scaling (e.g. -scale 2/3).
-
-	-storepasswd option to create VNC password files.
-
-	~/.x11vncrc simple config file support.
-
-	-cursorpos now the default (send cursor position updates to clients
-		that understand them, disable with -nocursorpos)
-
-	more connection info sent to the -accept and -gone commands.
-
-  new keyboard related features:
-
-	-modtweak is now the default (it automatically adjusts the modifier
-		keys state to send a Keysym properly, disable -nomodtweak)
-		this works around "ghost" keys like "< >" in XFree86.
-
-	-xkb option to use XKEYBOARD extension for modtweak-ing to further
-		improve the accuracy of sending Keysyms between different
-		language keyboards.
-
-	-skip_keycodes and -add_keysyms options to fine tune stubborn
-		keyboard differences.
-
-	-norepeat option to turn off X server key autorepeat when clients
-		are connected (works around the repeated characters problem)
-
-	-clear_mods and -clear_keys to send key release events at
-		startup and exit.	
-
-  removed options:
-
-	-hints/-nohints: we now always use hints.
-
-For more information: 
-
-	http://www.karlrunge.com/x11vnc/
-	http://www.karlrunge.com/x11vnc/x11vnc_opts.html
-       	x11vnc -help
-
------------------------------------------------------------------------------
-
diff --git a/ica/x11/x11vnc/allowed_input_t.h b/ica/x11/x11vnc/allowed_input_t.h
deleted file mode 100644
index 99e814e..0000000
--- a/ica/x11/x11vnc/allowed_input_t.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_ALLOWED_INPUT_T_H
-#define _X11VNC_ALLOWED_INPUT_T_H
-
-/* -- allowed_input_t.h -- */
-
-typedef struct allowed_input {
-	int keystroke;
-	int motion;
-	int button;
-	int clipboard;
-	int files;
-} allowed_input_t;
-
-#endif /* _X11VNC_ALLOWED_INPUT_T_H */
diff --git a/ica/x11/x11vnc/appshare.c b/ica/x11/x11vnc/appshare.c
deleted file mode 100644
index 71cdf17..0000000
--- a/ica/x11/x11vnc/appshare.c
+++ /dev/null
@@ -1,2124 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- appshare.c -- */
-
-#include "x11vnc.h"
-
-extern int pick_windowid(unsigned long *num);
-extern char *get_xprop(char *prop, Window win);
-extern int set_xprop(char *prop, Window win, char *value);
-extern void set_env(char *name, char *value);
-extern double dnow(void);
-
-static char *usage =
-"\n"
-"  x11vnc -appshare: an experiment in application sharing via x11vnc.\n"
-"\n"
-#if !SMALL_FOOTPRINT
-"  Usage:   x11vnc -appshare -id windowid -connect viewer_host:0\n"
-"           x11vnc -appshare -id pick     -connect viewer_host:0\n"
-"\n"
-"  Both the -connect option and the -id (or -sid) option are required.\n"
-"  (However see the -control option below that can replace -connect.)\n"
-"\n"
-"  The VNC viewer at viewer_host MUST be in 'listen' mode.  This is because\n"
-"  a new VNC connection (and viewer window) is established for each new\n"
-"  toplevel window that the application creates.  For example:\n"
-"\n"
-"       vncviewer -listen 0\n"
-"\n"
-"  The '-connect viewer_host:0' indicates the listening viewer to connect to.\n"
-"\n"
-"  No password should be used, otherwise it will need to be typed for each\n"
-"  new window (or one could use vncviewer -passwd file if the viewer supports\n"
-"  that.)  For security an SSH tunnel can be used:\n"
-"\n"
-"       ssh -R 5500:localhost:5500 user at server_host\n"
-"\n"
-"  (then use -connect localhost:0)\n"
-"\n"
-"  The -id/-sid option is as in x11vnc(1).  It is either a numerical window\n"
-"  id or the string 'pick' which will ask the user to click on an app window.\n"
-"  To track more than one application at the same time, list their window ids\n"
-"  separated by commas (see also the 'add_app' command below.)\n"
-"\n"
-"  Additional options:\n"
-"\n"
-"      -h, -help      Print this help.\n"
-"      -debug         Print debugging output (same as X11VNC_APPSHARE_DEBUG=1)\n"
-"      -showmenus     Create a new viewer window even if a new window is\n"
-"                     completely inside of an existing one.  Default is to\n"
-"                     try to not show them in a new viewer window.\n"
-"      -noexit        Do not exit if the main app (windowid/pick) window\n"
-"                     goes away.  Default is to exit.\n"
-"      -display dpy   X DISPLAY to use.\n"
-"      -trackdir dir  Set tracking directory to 'dir'. x11vnc -appshare does\n"
-"                     better if it can communicate with the x11vnc's via a\n"
-"                     file channel. By default a dir in /tmp is used, -trackdir\n"
-"                     specifies another directory, or use 'none' to disable.\n"
-"      -args 'string' Pass options 'string' to x11vnc (e.g. -scale 3/4,\n"
-"                     -viewonly, -wait, -once, etc.)\n"
-"      -env VAR=VAL   Set environment variables on cmdline as in x11vnc.\n"
-"\n"
-"      -control file  This is a file that one edits to manage the appshare\n"
-"                     mode.  It replaces -connect.  Lines beginning with '#'\n"
-"                     are ignored.  Initially start off with all of the\n"
-"                     desired clients in the file, one per line.  If you add\n"
-"                     a new client-line, that client is connected to. If you\n"
-"                     delete (or comment out) a client-line, that client is\n"
-"                     disconnected (for this to work, do not disable trackdir.)\n"
-"\n"
-"                     You can also put cmd= lines in the control file to perform\n"
-"                     different actions.  These are supported:\n"
-"\n"
-"                         cmd=quit            Disconnect all clients and exit.\n"
-"                         cmd=restart         Restart all of the x11vnc's.\n"
-"                         cmd=noop            Do nothing (e.g. ping)\n"
-"                         cmd=x11vnc          Run ps(1) looking for x11vnc's\n"
-"                         cmd=help            Print out help text.\n"
-"                         cmd=add_window:win  Add a window to be watched.\n"
-"                         cmd=del_window:win  Delete a window.\n"
-"                         cmd=add_app:win     Add an application to be watched.\n"
-"                         cmd=del_app:win     Delete an application.\n"
-"                         cmd=add_client:host Add client ('internal' mode only)\n"
-"                         cmd=del_client:host Del client ('internal' mode only)\n"
-"                         cmd=list_windows    List all tracked windows.\n"
-"                         cmd=list_apps       List all tracked applications.\n"
-"                         cmd=list_clients    List all connected clients.\n"
-"                         cmd=list_all        List all three.\n"
-"                         cmd=print_logs      Print out the x11vnc logfiles.\n"
-"                         cmd=debug:n         Set -debug to n (0 or 1).\n"
-"                         cmd=showmenus:n     Set -showmenus to n (0 or 1).\n"
-"                         cmd=noexit:n        Set -noexit to n (0 or 1).\n"
-"\n"
-"                     See the '-command internal' mode described below for a way\n"
-"                     that tracks connected clients internally (not in a file.)\n"
-"\n"
-"                     In '-shell' mode (see below) you can type in the above\n"
-"                     without the leading 'cmd='.\n"
-"\n"
-"                     For 'add_window' and 'del_window' the 'win' can be a\n"
-"                     numerical window id or 'pick'.  Same for 'add_app'.  Be\n"
-"                     sure to remove or comment out the add/del line quickly\n"
-"                     (e.g. before picking) or it will be re-run the next time\n"
-"                     the file is processed.\n"
-"\n"
-"                     If a file with the same name as the control file but\n"
-"                     ending with suffix '.cmd' is found, then commands in it\n"
-"                     (cmd=...) are processed and then the file is truncated.\n"
-"                     This allows 'one time' command actions to be run.  Any\n"
-"                     client hostnames in the '.cmd' file are ignored.  Also\n"
-"                     see below for the X11VNC_APPSHARE_COMMAND X property\n"
-"                     which is similar to '.cmd'\n"
-"\n"
-"      -control internal   Manage connected clients internally, see below.\n"
-"      -control shell      Same as: -shell -control internal\n"
-"\n"
-"      -delay secs    Maximum timeout delay before re-checking the control file.\n"
-"                     It can be a fraction, e.g. -delay 0.25  Default 0.5\n"
-"\n"
-"      -shell         Simple command line for '-control internal' mode (see the\n"
-"                     details of this mode below.)  Enter '?' for command list.\n"
-"\n"
-"  To stop x11vnc -appshare press Ctrl-C, or (if -noexit not supplied) delete\n"
-"  the initial app window or exit the application. Or cmd=quit in -control mode.\n"
-"\n"
-#if 0
-"  If you want your setup to survive periods of time where there are no clients\n"
-"  connected you will need to supply -args '-forever' otherwise the x11vnc's\n"
-"  will exit when the last client disconnects.  Howerver, _starting_ with no\n"
-"  clients (e.g. empty control file) will work without -args '-forever'.\n"
-"\n"
-#endif
-"  In addition to the '.cmd' file channel, for faster response you can set\n"
-"  X11VNC_APPSHARE_COMMAND X property on the root window to the string that\n"
-"  would go into the '.cmd' file.  For example:\n"
-"\n"
-" xprop -root -f X11VNC_APPSHARE_COMMAND 8s -set X11VNC_APPSHARE_COMMAND cmd=quit\n"
-"\n"
-"  The property value will be set to 'DONE' after the command(s) is processed.\n"
-"\n"
-"  If -control file is specified as 'internal' then no control file is used\n"
-"  and client tracking is done internally.  You must add and delete clients\n"
-"  with the cmd=add_client:<client> and cmd=del_client:<client> commands.\n"
-"  Note that '-control internal' is required for '-shell' mode.  Using\n"
-"  '-control shell' implies internal mode and -shell.\n"
-"\n"
-"  Limitations:\n"
-"\n"
-"     This is a quick lash-up, many things will not work properly.\n"
-"\n"
-"     The main idea is to provide simple application sharing for two or more\n"
-"     parties to collaborate without needing to share the entire desktop.  It\n"
-"     provides an improvement over -id/-sid that only shows a single window.\n"
-"\n"
-"     Only reverse connections can be done.  (Note: one can specify multiple\n"
-"     viewing hosts via: -connect host1,host2,host3 or add/remove them\n"
-"     dynamically as described above.)\n"
-"\n"
-"     If a new window obscures an old one, you will see some or all of the\n"
-"     new window in the old one.  The hope is this is a popup dialog or menu\n"
-"     that will go away soon.  Otherwise a user at the physical display will\n"
-"     need to move it. (See also the SSVNC viewer features described below.) \n"
-"\n"
-"     The viewer side cannot resize or make windows move on the physical\n"
-"     display.  Again, a user at the physical display may need to help, or\n"
-"     use the SSVNC viewer (see Tip below.)\n"
-"\n"
-"     Tip: If the application has its own 'resize corner', then dragging\n"
-"          it may successfully resize the application window.\n"
-"     Tip: Some desktop environments enable moving a window via, say,\n"
-"          Alt+Left-Button-Drag.  One may be able to move a window this way.\n"
-"          Also, e.g., Alt+Right-Button-Drag may resize a window.\n"
-"     Tip: Clicking on part of an obscured window may raise it to the top.\n"
-"          Also, e.g., Alt+Middle-Button may toggle Raise/Lower.\n"
-"\n"
-"     Tip: The SSVNC 1.0.25 unix and macosx vncviewer has 'EscapeKeys' hot\n"
-"          keys that will move, resize, raise, and lower the window via the\n"
-"          x11vnc -remote_prefix X11VNC_APPSHARE_CMD: feature.  So in the\n"
-"          viewer while holding down Shift_L+Super_L+Alt_L the arrow keys\n"
-"          move the window, PageUp/PageDn/Home/End resize it, and - and +\n"
-"          raise and lower it.  Key 'M' or Button1 moves the remote window\n"
-"          to the +X+Y of the viewer window.  Key 'D' or Button3 deletes\n"
-"          the remote window.\n"
-"\n"
-"          You can run the SSVNC vncviewer with options '-escape default',\n"
-"          '-multilisten' and '-env VNCVIEWER_MIN_TITLE=1'; or just run\n"
-"          with option '-appshare' to enable these and automatic placement.\n"
-"\n"
-"     If any part of a window goes off of the display screen, then x11vnc\n"
-"     may be unable to poll it (without crashing), and so the window will\n"
-"     stop updating until the window is completely on-screen again.\n"
-"\n"
-"     The (stock) vnc viewer does not know where to best position each new\n"
-"     viewer window; it likely centers each one (including when resized.)\n"
-"     Note: The SSVNC viewer in '-appshare' mode places them correctly.\n"
-"\n"
-"     Deleting a viewer window does not delete the real window.\n"
-"     Note: The SSVNC viewer Shift+EscapeKeys+Button3 deletes it.\n"
-"\n"
-"     Sometimes new window detection fails.\n"
-"\n"
-"     Sometimes menu/popup detection fails.\n"
-"\n"
-"     Sometimes the contents of a menu/popup window have blacked-out regions.\n"
-"     Try -sid or -showmenus as a workaround.\n"
-"\n"
-"     If the application starts up a new application (a different process)\n"
-"     that new application will not be tracked (but, unfortunately, it may\n"
-"     cover up existing windows that are being tracked.) See cmd=add_window\n"
-"     and cmd=add_app described above.\n"
-"\n"
-#endif
-;
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define WMAX 192
-#define CMAX 128
-#define AMAX 32
-
-static Window root = None;
-static Window watch[WMAX];
-static Window apps[WMAX];
-static int state[WMAX];
-static char *clients[CMAX];
-static XWindowAttributes attr;
-static char *ticker_atom_str = "X11VNC_APPSHARE_TICKER";
-static Atom ticker_atom = None;
-static char *cmd_atom_str = "X11VNC_APPSHARE_COMMAND";
-static Atom cmd_atom = None;
-static char *connect_to = NULL;
-static char *x11vnc_args = "";
-static char *id_opt = "-id";
-static int skip_menus = 1;
-static int exit_no_app_win = 1;
-static int shell = 0;
-static int tree_depth = 3;
-static char *prompt = "appshare> ";
-static char *x11vnc = "x11vnc";
-static char *control = NULL;
-static char *trackdir = "unset";
-static char *trackpre = "/tmp/x11vnc-appshare-trackdir-tmp";
-static char *tracktmp = NULL;
-static char unique_tag[100];
-static int use_forever = 1;
-static int last_event_type = 0;
-static pid_t helper_pid = 0;
-static pid_t parent_pid = 0;
-static double helper_delay = 0.5;
-static int appshare_debug = 0;
-static double start_time = 0.0;
-
-static void get_wm_name(Window win, char **name);
-static int win_attr(Window win);
-static int get_xy(Window win, int *x, int *y);
-static Window check_inside(Window win);
-static int ours(Window win);
-static void destroy_win(Window win);
-static int same_app(Window win, Window app);
-
-static void ff(void) {
-	fflush(stdout);
-	fflush(stderr);
-}
-
-static int find_win(Window win) {
-	int i;
-	for (i=0; i < WMAX; i++) {
-		if (watch[i] == win) {
-			return i;
-		}
-	}
-	return -1;
-}
-
-static int find_app(Window app) {
-	int i;
-	for (i=0; i < AMAX; i++) {
-		if (apps[i] == app) {
-			return i;
-		}
-	}
-	return -1;
-}
-
-static int find_client(char *cl) {
-	int i;
-	for (i=0; i < CMAX; i++) {
-		if (cl == NULL) {
-			if (clients[i] == NULL) {
-				return i;
-			}
-			continue;
-		}
-		if (clients[i] == NULL) {
-			continue;
-		}
-		if (!strcmp(clients[i], cl)) {
-			return i;
-		}
-	}
-	return -1;
-}
-
-static int trackdir_pid(Window win) {
-	FILE *f;
-	int ln = 0, pid = 0;
-	char line[1024];
-
-	if (!trackdir) {
-		return 0;
-	}
-	sprintf(tracktmp, "%s/0x%lx.log", trackdir, win);
-	f = fopen(tracktmp, "r");
-	if (!f) {
-		return 0;
-	}
-	while (fgets(line, sizeof(line), f) != NULL) {
-		if (ln++ > 30) {
-			break;
-		}
-		if (strstr(line, "x11vnc version:")) {
-			char *q = strstr(line, "pid:");
-			if (q) {
-				int p;
-				if (sscanf(q, "pid: %d", &p) == 1) {
-					if (p > 0) {
-						pid = p;
-						break;
-					}
-				}
-			}
-		}
-	}
-	fclose(f);
-	return pid;
-}
-
-static void trackdir_cleanup(Window win) {
-	char *suffix[] = {"log", "connect", NULL};
-	int i=0;
-	if (!trackdir) {
-		return;
-	}
-	while (suffix[i] != NULL) {
-		sprintf(tracktmp, "%s/0x%lx.%s", trackdir, win, suffix[i]);
-		if (appshare_debug && !strcmp(suffix[i], "log")) {
-			fprintf(stderr, "keeping:  %s\n", tracktmp);
-			ff();
-		} else {
-			if (appshare_debug) {
-				fprintf(stderr, "removing: %s\n", tracktmp);
-				ff();
-			}
-			unlink(tracktmp);
-		}
-		i++;
-	}
-}
-
-static void launch(Window win) {
-	char *cmd, *tmp, *connto, *name;
-	int len, timeo = 30, uf = use_forever;
-	int w = 0, h = 0, x = 0, y = 0;
-
-	if (win_attr(win)) {
-		/* maybe switch to debug only. */
-		w = attr.width;
-		h = attr.height;
-		get_xy(win, &x, &y);
-	}
-
-	get_wm_name(win, &name);
-
-	if (strstr(x11vnc_args, "-once")) {
-		uf = 0;
-	}
-
-	if (control) {
-		int i = 0;
-		len = 0;
-		for (i=0; i < CMAX; i++) {
-			if (clients[i] != NULL) {
-				len += strlen(clients[i]) + 2;
-			}
-		}
-		connto = (char *) calloc(len, 1);
-		for (i=0; i < CMAX; i++) {
-			if (clients[i] != NULL) {
-				if (connto[0] != '\0') {
-					strcat(connto, ",");
-				}
-				strcat(connto, clients[i]);
-			}
-		}
-	} else {
-		connto = strdup(connect_to);
-	}
-	if (!strcmp(connto, "")) {
-		timeo = 0;
-	}
-	if (uf) {
-		timeo = 0;
-	}
-	
-	len = 1000 + strlen(x11vnc) + strlen(connto) + strlen(x11vnc_args)
-	    + 3 * (trackdir ? strlen(trackdir) : 100);
-
-	cmd = (char *) calloc(len, 1);
-	tmp = (char *) calloc(len, 1);
-
-	sprintf(cmd, "%s %s 0x%lx -bg -quiet %s -nopw -rfbport 0 "
-	    "-timeout %d -noxdamage -noxinerama -norc -repeat -speeds dsl "
-	    "-env X11VNC_AVOID_WINDOWS=never -env X11VNC_APPSHARE_ACTIVE=1 "
-	    "-env X11VNC_NO_CHECK_PM=1 -env %s -novncconnect -shared -nonap "
-	    "-remote_prefix X11VNC_APPSHARE_CMD:",
-	    x11vnc, id_opt, win, use_forever ? "-forever" : "-once", timeo, unique_tag);
-
-	if (trackdir) {
-		FILE *f;
-		sprintf(tracktmp, " -noquiet -o %s/0x%lx.log", trackdir, win);
-		strcat(cmd, tracktmp);
-		sprintf(tracktmp, "%s/0x%lx.connect", trackdir, win);
-		f = fopen(tracktmp, "w");
-		if (f) {
-			fprintf(f, "%s", connto);
-			fclose(f);
-			sprintf(tmp, " -connect_or_exit '%s'", tracktmp);
-			strcat(cmd, tmp);
-		} else {
-			sprintf(tmp, " -connect_or_exit '%s'", connto);
-			strcat(cmd, tmp);
-		}
-	} else {
-		if (!strcmp(connto, "")) {
-			sprintf(tmp, " -connect '%s'", connto);
-		} else {
-			sprintf(tmp, " -connect_or_exit '%s'", connto);
-		}
-		strcat(cmd, tmp);
-	}
-	if (uf) {
-		char *q = strstr(cmd, "-connect_or_exit");
-		if (q) q = strstr(q, "_or_exit");
-		if (q) {
-			unsigned int i;
-			for (i=0; i < strlen("_or_exit"); i++) {
-				*q = ' ';
-				q++;
-			}
-		}
-	}
-
-	strcat(cmd, " ");
-	strcat(cmd, x11vnc_args);
-
-	fprintf(stdout, "launching: x11vnc for window 0x%08lx %dx%d+%d+%d \"%s\"\n",
-	    win, w, h, x, y, name);
-
-	if (appshare_debug) {
-		fprintf(stderr, "\nrunning:   %s\n\n", cmd);
-	}
-	ff();
-
-	system(cmd);
-
-	free(cmd);
-	free(tmp);
-	free(connto);
-	free(name);
-}
-
-static void stop(Window win) {
-	char *cmd;
-	int pid = -1;
-	int f = find_win(win);
-	if (f < 0 || win == None) {
-		return;
-	}
-	if (state[f] == 0) {
-		return;
-	}
-	if (trackdir) {
-		pid = trackdir_pid(win);
-		if (pid > 0) {
-			if (appshare_debug) {fprintf(stderr,
-			    "sending SIGTERM to: %d\n", pid); ff();}
-			kill((pid_t) pid, SIGTERM);
-		}
-	}
-
-	cmd = (char *) malloc(1000 + strlen(x11vnc));
-	sprintf(cmd, "pkill -TERM -f '%s %s 0x%lx -bg'", x11vnc, id_opt, win);
-	if (appshare_debug) {
-		fprintf(stdout, "stopping:  0x%08lx - %s\n", win, cmd);
-	} else {
-		fprintf(stdout, "stopping:  x11vnc for window 0x%08lx  "
-		    "(pid: %d)\n", win, pid);
-	}
-	ff();
-	system(cmd);
-
-	sprintf(cmd, "(sleep 0.25 2>/dev/null || sleep 1; pkill -KILL -f '%s "
-	    "%s 0x%lx -bg') &", x11vnc, id_opt, win);
-	system(cmd);
-
-	if (trackdir) {
-		trackdir_cleanup(win);
-	}
-
-	free(cmd);
-}
-
-static void kill_helper_pid(void) {
-	int status;
-	if (helper_pid <= 0) {
-		return;
-	}
-	fprintf(stderr, "stopping: helper_pid: %d\n", (int) helper_pid);
-	kill(helper_pid, SIGTERM);
-	usleep(50 * 1000);
-	kill(helper_pid, SIGKILL);
-	usleep(25 * 1000);
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID 
-	waitpid(helper_pid, &status, WNOHANG); 
-#endif
-}
-
-static void be_helper_pid(char *dpy_str) {
-	int cnt = 0;
-	int ms = (int) (1000 * helper_delay);
-	double last_check = 0.0;
-
-	if (ms < 50) ms = 50;
-
-#if NO_X11
-	fprintf(stderr, "be_helper_pid: not compiled with X11.\n");
-#else
-	dpy = XOpenDisplay(dpy_str);
-	ticker_atom = XInternAtom(dpy, ticker_atom_str, False);
-
-	while (1) {
-		char tmp[32];
-		sprintf(tmp, "HELPER_CNT_%08d", cnt++);
-		XChangeProperty(dpy, DefaultRootWindow(dpy), ticker_atom, XA_STRING, 8,
-		    PropModeReplace, (unsigned char *) tmp, strlen(tmp));
-		XFlush(dpy);
-		usleep(ms*1000);
-		if (parent_pid > 0) {
-			if(dnow() > last_check + 1.0) {
-				last_check = dnow();
-				if (kill(parent_pid, 0) != 0) {
-					fprintf(stderr, "be_helper_pid: parent %d is gone.\n", (int) parent_pid);
-					break;
-				}
-			}
-		}
-	}
-#endif
-	exit(0);
-}
-
-static void print_logs(void) {
-	if (trackdir) {
-		DIR *dir = opendir(trackdir);
-		if (dir) {
-			struct dirent *dp;
-			while ( (dp = readdir(dir)) != NULL) {
-				FILE *f;
-				char *name = dp->d_name;
-				if (!strcmp(name, ".") || !strcmp(name, "..")) {
-					continue;
-				}
-				if (strstr(name, "0x") != name) {
-					continue;
-				}
-				if (strstr(name, ".log") == NULL) {
-					continue;
-				}
-				sprintf(tracktmp, "%s/%s", trackdir, name);
-				f = fopen(tracktmp, "r");
-				if (f) {
-					char line[1024];
-					fprintf(stderr, "===== x11vnc log %s =====\n", tracktmp);
-					while (fgets(line, sizeof(line), f) != NULL) {
-						fprintf(stderr, "%s", line);
-					}
-					fprintf(stderr, "\n");
-					ff();
-					fclose(f);
-				}
-			}
-			closedir(dir);
-		}
-	}
-}
-
-static void appshare_cleanup(int s) {
-	int i;
-	if (s) {}
-
-	if (use_forever) {
-		/* launch this backup in case they kill -9 us before we terminate everything */
-		char cmd[1000];
-		sprintf(cmd, "(sleep 3; pkill -TERM -f '%s') &", unique_tag);
-		if (appshare_debug) fprintf(stderr, "%s\n", cmd);
-		system(cmd);
-	}
-
-	for (i=0; i < WMAX; i++) {
-		if (watch[i] != None) {
-			stop(watch[i]);
-		}
-	}
-
-	if (trackdir) {
-		DIR *dir = opendir(trackdir);
-		if (dir) {
-			struct dirent *dp;
-			while ( (dp = readdir(dir)) != NULL) {
-				char *name = dp->d_name;
-				if (!strcmp(name, ".") || !strcmp(name, "..")) {
-					continue;
-				}
-				if (strstr(name, "0x") != name) {
-					fprintf(stderr, "skipping: %s\n", name);
-					continue;
-				}
-				if (!appshare_debug) {
-					fprintf(stderr, "removing: %s\n", name);
-					sprintf(tracktmp, "%s/%s", trackdir, name);
-					unlink(tracktmp);
-				} else {
-					if (appshare_debug) fprintf(stderr, "keeping:  %s\n", name);
-				}
-			}
-			closedir(dir);
-		}
-		if (!appshare_debug) {
-			if (strstr(trackdir, trackpre) == trackdir) {
-				if (appshare_debug) fprintf(stderr, "removing: %s\n", trackdir);
-				rmdir(trackdir);
-			}
-		}
-		ff();
-	}
-
-	kill_helper_pid();
-			
-#if !NO_X11
-	XCloseDisplay(dpy);
-#endif
-	fprintf(stdout, "done.\n");
-	ff();
-	exit(0);
-}
-
-static int trap_xerror(Display *d, XErrorEvent *error) {
-	if (d || error) {}
-	return 0;
-}
-
-#if 0
-typedef struct {
-    int x, y;                   /* location of window */
-    int width, height;          /* width and height of window */
-    int border_width;           /* border width of window */
-    int depth;                  /* depth of window */
-    Visual *visual;             /* the associated visual structure */
-    Window root;                /* root of screen containing window */
-    int class;                  /* InputOutput, InputOnly*/
-    int bit_gravity;            /* one of bit gravity values */
-    int win_gravity;            /* one of the window gravity values */
-    int backing_store;          /* NotUseful, WhenMapped, Always */
-    unsigned long backing_planes;/* planes to be preserved if possible */
-    unsigned long backing_pixel;/* value to be used when restoring planes */
-    Bool save_under;            /* boolean, should bits under be saved? */
-    Colormap colormap;          /* color map to be associated with window */
-    Bool map_installed;         /* boolean, is color map currently installed*/
-    int map_state;              /* IsUnmapped, IsUnviewable, IsViewable */
-    long all_event_masks;       /* set of events all people have interest in*/
-    long your_event_mask;       /* my event mask */
-    long do_not_propagate_mask; /* set of events that should not propagate */
-    Bool override_redirect;     /* boolean value for override-redirect */
-    Screen *screen;             /* back pointer to correct screen */
-} XWindowAttributes;
-#endif
-
-static void get_wm_name(Window win, char **name) {
-	int ok;
-
-#if !NO_X11
-        XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-	ok = XFetchName(dpy, win, name);
-       	XSetErrorHandler(old_handler);
-#endif
-
-	if (!ok || *name == NULL) {
-		*name = strdup("unknown");
-	}
-}
-
-static int win_attr(Window win) {
-	int ok = 0;
-#if !NO_X11
-        XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-	ok = XGetWindowAttributes(dpy, win, &attr);
-       	XSetErrorHandler(old_handler);
-#endif
-
-	if (ok) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-static void win_select(Window win, int ignore) {
-#if !NO_X11
-        XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-	if (ignore) {
-		XSelectInput(dpy, win, 0);
-	} else {
-		XSelectInput(dpy, win, SubstructureNotifyMask);
-	}
-	XSync(dpy, False);
-       	XSetErrorHandler(old_handler);
-#endif
-}
-
-static Window get_parent(Window win) {
-	int ok;
-	Window r, parent = None, *list = NULL;
-	unsigned int nchild;
-
-#if !NO_X11
-        XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-	ok = XQueryTree(dpy, win, &r, &parent, &list, &nchild);
-       	XSetErrorHandler(old_handler);
-
-	if (!ok) {
-		return None;
-	}
-	if (list) {
-		XFree(list);
-	}
-#endif
-	return parent;
-}
-
-static int get_xy(Window win, int *x, int *y) {
-	Window cr;
-	Bool rc = False; 
-#if !NO_X11
-	XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-
-	rc = XTranslateCoordinates(dpy, win, root, 0, 0, x, y, &cr);
-       	XSetErrorHandler(old_handler);
-#endif
-
-	if (!rc) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-static Window check_inside(Window win) {
-	int i, nwin = 0;
-	int w, h, x, y;
-	int Ws[WMAX], Hs[WMAX], Xs[WMAX], Ys[WMAX];
-	Window wins[WMAX];
-
-	if (!win_attr(win)) {
-		return None; 
-	}
-
-	/* store them first to give the win app more time to settle.  */
-	for (i=0; i < WMAX; i++) {
-		int X, Y;
-		Window wchk = watch[i];
-		if (wchk == None) {
-			continue;
-		}
-		if (state[i] == 0) {
-			continue;
-		}
-		if (!win_attr(wchk)) {
-			continue;
-		}
-		if (!get_xy(wchk, &X, &Y)) {
-			continue;
-		}
-
-		Xs[nwin] = X;
-		Ys[nwin] = Y;
-		Ws[nwin] = attr.width;
-		Hs[nwin] = attr.height;
-		wins[nwin] = wchk;
-		nwin++;
-	}
-
-	if (nwin == 0) {
-		return None;
-	}
-
-	if (!win_attr(win)) {
-		return None; 
-	}
-	w = attr.width;
-	h = attr.height;
-
-	get_xy(win, &x, &y);
-	if (!get_xy(win, &x, &y)) {
-		return None;
-	}
-
-	for (i=0; i < nwin; i++) {
-		int X, Y, W, H;
-		Window wchk = wins[i];
-		X = Xs[i];
-		Y = Ys[i];
-		W = Ws[i];
-		H = Hs[i];
-
-		if (appshare_debug) fprintf(stderr, "check inside: 0x%lx  %dx%d+%d+%d %dx%d+%d+%d\n", wchk, w, h, x, y, W, H, X, Y);
-
-		if (X <= x && Y <= y) {
-			if (x + w  <= X + W && y + h < Y + H) {
-				return wchk;
-			}
-		}
-	}
-
-	return None;
-}
-
-static void add_win(Window win) {
-	int idx  = find_win(win);
-	int free = find_win(None);
-	if (idx >= 0) {
-		if (appshare_debug) {fprintf(stderr, "already watching window: 0x%lx\n", win); ff();}
-		return;
-	}
-	if (free < 0) {
-		fprintf(stderr, "ran out of slots for window: 0x%lx\n", win); ff();
-		return;
-	}
-
-	if (appshare_debug) {fprintf(stderr, "watching: 0x%lx at %d\n", win, free); ff();}
-
-	watch[free] = win;
-	state[free] = 0;
-
-	win_select(win, 0);
-}
-
-static void delete_win(Window win) {
-	int i;
-	for (i=0; i < WMAX; i++) {
-		if (watch[i] == win) {
-			watch[i] = None;
-			state[i] = 0;
-			if (appshare_debug) {fprintf(stderr, "deleting: 0x%lx at %d\n", win, i); ff();}
-		}
-	}
-}
-
-static void recurse_search(int level, int level_max, Window top, Window app, int *nw) {
-	Window w, r, parent, *list = NULL;
-	unsigned int nchild;
-	int ok = 0;
-
-	if (appshare_debug > 1) {
-		fprintf(stderr, "level: %d level_max: %d  top: 0x%lx  app: 0x%lx\n", level, level_max, top, app);
-	}
-	if (level >= level_max) {
-		return;
-	}
-	
-#if !NO_X11
-	ok = XQueryTree(dpy, top, &r, &parent, &list, &nchild);
-	if (ok) {
-		int i;
-		for (i=0; i < (int) nchild; i++) {
-			w = list[i];
-			if (w == None || find_win(w) >= 0) {
-				continue;
-			}
-			if (ours(w) && w != app) {
-				if (appshare_debug) fprintf(stderr, "add level %d 0x%lx %d/%d\n",
-				    level, w, i, nchild);
-				add_win(w);
-				(*nw)++;
-			}
-		}
-		for (i=0; i < (int) nchild; i++) {
-			w = list[i];
-			if (w == None || ours(w)) {
-				continue;
-			} 
-			recurse_search(level+1, level_max, w, app, nw);
-		}
-	}
-	if (list) {
-		XFree(list);
-	}
-#endif
-}
-		
-static void add_app(Window app) {
-	int i, nw = 0, free = -1;
-        XErrorHandler old_handler;
-
-#if !NO_X11
-	i = find_app(app);
-	if (i >= 0) {
-		fprintf(stderr, "already tracking app: 0x%lx\n", app);
-		return;
-	}
-	for (i=0; i < AMAX; i++) {
-		if (same_app(apps[i], app)) {
-			fprintf(stderr, "already tracking app: 0x%lx via 0x%lx\n", app, apps[i]);
-			return;
-		}
-	}
-	free = find_app(None);
-	if (free < 0) {
-		fprintf(stderr, "ran out of app slots.\n");
-		return;
-	}
-	apps[free] = app;
-
-	add_win(app);
-
-        old_handler = XSetErrorHandler(trap_xerror);
-	recurse_search(0, tree_depth, root, app, &nw);
-       	XSetErrorHandler(old_handler);
-#endif
-	fprintf(stderr, "tracking %d windows related to app window 0x%lx\n", nw, app);
-}
-
-static void del_app(Window app) {
-	int i;
-	for (i=0; i < WMAX; i++) {
-		Window win = watch[i];
-		if (win != None) {
-			if (same_app(app, win)) {
-				destroy_win(win);
-			}
-		}
-	}
-	for (i=0; i < AMAX; i++) {
-		Window app2 = apps[i];
-		if (app2 != None) {
-			if (same_app(app, app2)) {
-				apps[i] = None;
-			}
-		}
-	}
-}
-
-static void wait_until_empty(char *file) {
-	double t = 0.0, dt = 0.05;
-	while (t < 1.0) {
-		struct stat sb;
-		if (stat(file, &sb) != 0) {
-			return;
-		}
-		if (sb.st_size == 0) {
-			return;
-		}
-		t += dt;
-		usleep( (int) (dt * 1000 * 1000) );
-	}
-}
-
-static void client(char *client, int add) {
-	DIR *dir;
-	struct dirent *dp;
-
-	if (!client) {
-		return;
-	}
-	if (!trackdir) {
-		fprintf(stderr, "no trackdir, cannot %s client: %s\n",
-		    add ? "add" : "disconnect", client);
-		ff();
-		return;
-	}
-	fprintf(stdout, "%s client: %s\n", add ? "adding  " : "deleting", client);
-
-	dir = opendir(trackdir);
-	if (!dir) {
-		fprintf(stderr, "could not opendir trackdir: %s\n", trackdir);
-		return;
-	}
-	while ( (dp = readdir(dir)) != NULL) {
-		char *name = dp->d_name;
-		if (!strcmp(name, ".") || !strcmp(name, "..")) {
-			continue;
-		}
-		if (strstr(name, "0x") != name) {
-			continue;
-		}
-		if (strstr(name, ".connect")) {
-			FILE *f;
-			char *tmp;
-			Window twin;
-
-			if (scan_hexdec(name, &twin)) {
-				int f = find_win(twin);
-				if (appshare_debug) {
-					fprintf(stderr, "twin: 0x%lx name=%s f=%d\n", twin, name, f);
-					ff();
-				}
-				if (f < 0) {
-					continue;
-				}
-			}
-
-			tmp = (char *) calloc(100 + strlen(client), 1);
-			sprintf(tracktmp, "%s/%s", trackdir, name);
-			if (add) {
-				sprintf(tmp, "%s\n", client);
-			} else {
-				sprintf(tmp, "cmd=close:%s\n", client);
-			}
-			wait_until_empty(tracktmp);
-			f = fopen(tracktmp, "w");
-			if (f) {
-				if (appshare_debug) {
-					fprintf(stderr, "%s client: %s + %s",
-					add ? "add" : "disconnect", tracktmp, tmp);
-					ff();
-				}
-				fprintf(f, "%s", tmp);
-				fclose(f);
-			}
-			free(tmp);
-		}
-	}
-	closedir(dir);
-}
-
-static void mapped(Window win) {
-	int f;
-	if (win == None) {
-		return;
-	}
-	f = find_win(win);
-	if (f < 0) {
-		if (win_attr(win)) {
-			if (get_parent(win) == root) {
-				/* XXX more cases? */
-				add_win(win);
-			}
-		}
-	}
-}
-
-static void unmapped(Window win) {
-	int f = find_win(win);
-	if (f < 0 || win == None) {
-		return;
-	}
-	stop(win);	
-	state[f] = 0;
-}
-
-static void destroy_win(Window win) {
-	stop(win);
-	delete_win(win);
-}
-
-static Window parse_win(char *str) {
-	Window win = None;
-	if (!str) {
-		return None;
-	}
-	if (!strcmp(str, "pick") || !strcmp(str, "p")) {
-		static double last_pick = 0.0;
-		if (dnow() < start_time + 15) {
-			;
-		} else if (dnow() < last_pick + 2) {
-			return None;
-		} else {
-			last_pick = dnow();
-		}
-		if (!pick_windowid(&win)) {
-			fprintf(stderr, "parse_win: bad window pick.\n");
-			win = None;
-		}
-		if (win == root) {
-			fprintf(stderr, "parse_win: ignoring pick of rootwin 0x%lx.\n", win);
-			win = None;
-		}
-		ff();
-	} else if (!scan_hexdec(str, &win)) {
-		win = None;
-	}
-	return win;
-}
-
-static void add_or_del_app(char *str, int add) {
-	Window win = parse_win(str);
-
-	if (win != None) {
-		if (add) {
-			add_app(win);
-		} else {
-			del_app(win);
-		}
-	} else if (!strcmp(str, "all")) {
-		if (!add) {
-			int i;
-			for (i=0; i < AMAX; i++) {
-				if (apps[i] != None) {
-					del_app(apps[i]);
-				}
-			}
-		}
-	}
-}
-
-static void add_or_del_win(char *str, int add) {
-	Window win = parse_win(str);
-
-	if (win != None) {
-		int f = find_win(win);
-		if (add) {
-			if (f < 0 && win_attr(win)) {
-				add_win(win);
-			}
-		} else {
-			if (f >= 0) {
-				destroy_win(win);
-			}
-		}
-	} else if (!strcmp(str, "all")) {
-		if (!add) {
-			int i;
-			for (i=0; i < WMAX; i++) {
-				if (watch[i] != None) {
-					destroy_win(watch[i]);
-				}
-			}
-		}
-	} 
-}
-
-static void add_or_del_client(char *str, int add) {
-	int i;
-
-	if (!str) {
-		return;
-	}
-	if (strcmp(control, "internal")) {
-		return;
-	}
-	if (add) {
-		int idx  = find_client(str);
-		int free = find_client(NULL);
-
-		if (idx >=0) {
-			fprintf(stderr, "already tracking client: %s in slot %d\n", str, idx);
-			ff();
-			return;
-		}
-		if (free < 0) {
-			static int cnt = 0;
-			if (cnt++ < 10) {
-				fprintf(stderr, "ran out of client slots.\n");
-				ff();
-			}
-			return;
-		}
-		clients[free] = strdup(str);
-		client(str, 1);
-	} else {
-		if (str[0] == '#' || str[0] == '%') {
-			if (sscanf(str+1, "%d", &i) == 1) {
-				i--;
-				if (0 <= i && i < CMAX) {
-					if (clients[i] != NULL) {
-						client(clients[i], 0);
-						free(clients[i]);
-						clients[i] = NULL;
-						return;
-					}
-				}
-			}
-		} else if (!strcmp(str, "all")) {
-			for (i=0; i < CMAX; i++) {
-				if (clients[i] == NULL) {
-					continue;
-				}
-				client(clients[i], 0);
-				free(clients[i]);
-				clients[i] = NULL;
-			}
-			return;
-		}
-
-		i = find_client(str);
-		if (i >= 0) {
-			free(clients[i]);
-			clients[i] = NULL;
-			client(str, 0);
-		}
-	}
-}
-
-static void restart_x11vnc(void) {
-	int i, n = 0;
-	Window win, active[WMAX];
-	for (i=0; i < WMAX; i++) {
-		win = watch[i];
-		if (win == None) {
-			continue;
-		}
-		if (state[i]) {
-			active[n++] = win;
-			stop(win);
-		}
-	}
-	if (n) {
-		usleep(1500 * 1000);
-	}
-	for (i=0; i < n; i++) {
-		win = active[i];
-		launch(win);
-	}
-}
-
-static unsigned long cmask = 0x3fc00000; /* 00111111110000000000000000000000 */
-
-static void init_cmask(void) {
-	/* dependent on the X server implementation; XmuClientWindow better? */
-	/* xc/programs/Xserver/include/resource.h */
-	int didit = 0, res_cnt = 29, client_bits = 8;
-
-	if (getenv("X11VNC_APPSHARE_CLIENT_MASK")) {
-		unsigned long cr;
-		if (sscanf(getenv("X11VNC_APPSHARE_CLIENT_MASK"), "0x%lx", &cr) == 1) {
-			cmask = cr;
-			didit = 1;
-		}
-	} else if (getenv("X11VNC_APPSHARE_CLIENT_BITS")) {
-		int cr = atoi(getenv("X11VNC_APPSHARE_CLIENT_BITS"));
-		if (cr > 0) {
-			client_bits = cr;
-		}
-	}
-	if (!didit) {
-		cmask = (((1 << client_bits) - 1) << (res_cnt-client_bits));
-	}
-	fprintf(stderr, "client_mask: 0x%08lx\n", cmask);
-}
-
-static int same_app(Window win, Window app) {
-	if ( (win & cmask) == (app & cmask) ) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-static int ours(Window win) {
-	int i;
-	for (i=0; i < AMAX; i++) {
-		if (apps[i] != None) {
-			if (same_app(win, apps[i])) {
-				return 1;
-			}
-		}
-	}
-	return 0;
-}
-
-static void list_clients(void) {
-	int i, n = 0;
-	for (i=0; i < CMAX; i++) {
-		if (clients[i] == NULL) {
-			continue;
-		}
-		fprintf(stdout, "client[%02d] %s\n", ++n, clients[i]);
-	}
-	fprintf(stdout, "total clients: %d\n", n);
-	ff();
-}
-
-static void list_windows(void) {
-	int i, n = 0;
-	for (i=0; i < WMAX; i++) {
-		char *name;
-		Window win = watch[i];
-		if (win == None) {
-			continue;
-		}
-		get_wm_name(win, &name);
-		fprintf(stdout, "window[%02d] 0x%08lx state: %d slot: %03d \"%s\"\n",
-		    ++n, win, state[i], i, name);
-		free(name);
-	}
-	fprintf(stdout, "total windows: %d\n", n);
-	ff();
-}
-
-static void list_apps(void) {
-	int i, n = 0;
-	for (i=0; i < AMAX; i++) {
-		char *name;
-		Window win = apps[i];
-		if (win == None) {
-			continue;
-		}
-		get_wm_name(win, &name);
-		fprintf(stdout, "app[%02d] 0x%08lx state: %d slot: %03d \"%s\"\n",
-		    ++n, win, state[i], i, name);
-		free(name);
-	}
-	fprintf(stdout, "total apps: %d\n", n);
-	ff();
-}
-
-static int process_control(char *file, int check_clients) {
-	int i, nnew = 0, seen[CMAX];
-	char line[1024], *newctl[CMAX];
-	FILE *f;
-
-	f = fopen(file, "r");
-	if (!f) {
-		return 1;
-	}
-	if (check_clients) {
-		for (i=0; i < CMAX; i++) {
-			seen[i] = 0;
-		}
-	}
-	while (fgets(line, sizeof(line), f) != NULL) {
-		char *q = strchr(line, '\n');
-		if (q) *q = '\0';
-
-		if (appshare_debug) {
-			fprintf(stderr, "check_control: %s\n", line);
-			ff();
-		}
-
-		q = lblanks(line);
-		if (q[0] == '#') {
-			continue;
-		}
-		if (!strcmp(q, "")) {
-			continue;
-		}
-		if (strstr(q, "cmd=") == q) {
-			char *cmd = q + strlen("cmd=");
-			if (!strcmp(cmd, "quit")) {
-				if (strcmp(control, file) && strstr(file, ".cmd")) {
-					FILE *f2 = fopen(file, "w");
-					if (f2) fclose(f2);
-				}
-				appshare_cleanup(0);
-			} else if (!strcmp(cmd, "wait")) {
-				return 0;
-			} else if (strstr(cmd, "bcast:") == cmd) {
-				;
-			} else if (strstr(cmd, "del_window:") == cmd) {
-				add_or_del_win(cmd + strlen("del_window:"), 0);
-			} else if (strstr(cmd, "add_window:") == cmd) {
-				add_or_del_win(cmd + strlen("add_window:"), 1);
-			} else if (strstr(cmd, "del:") == cmd) {
-				add_or_del_win(cmd + strlen("del:"), 0);
-			} else if (strstr(cmd, "add:") == cmd) {
-				add_or_del_win(cmd + strlen("add:"), 1);
-			} else if (strstr(cmd, "del_client:") == cmd) {
-				add_or_del_client(cmd + strlen("del_client:"), 0);
-			} else if (strstr(cmd, "add_client:") == cmd) {
-				add_or_del_client(cmd + strlen("add_client:"), 1);
-			} else if (strstr(cmd, "-") == cmd) {
-				add_or_del_client(cmd + strlen("-"), 0);
-			} else if (strstr(cmd, "+") == cmd) {
-				add_or_del_client(cmd + strlen("+"), 1);
-			} else if (strstr(cmd, "del_app:") == cmd) {
-				add_or_del_app(cmd + strlen("del_app:"), 0);
-			} else if (strstr(cmd, "add_app:") == cmd) {
-				add_or_del_app(cmd + strlen("add_app:"), 1);
-			} else if (strstr(cmd, "debug:") == cmd) {
-				appshare_debug = atoi(cmd + strlen("debug:"));
-			} else if (strstr(cmd, "showmenus:") == cmd) {
-				skip_menus = atoi(cmd + strlen("showmenus:"));
-				skip_menus = !(skip_menus);
-			} else if (strstr(cmd, "noexit:") == cmd) {
-				exit_no_app_win = atoi(cmd + strlen("noexit:"));
-				exit_no_app_win = !(exit_no_app_win);
-			} else if (strstr(cmd, "use_forever:") == cmd) {
-				use_forever = atoi(cmd + strlen("use_forever:"));
-			} else if (strstr(cmd, "tree_depth:") == cmd) {
-				tree_depth = atoi(cmd + strlen("tree_depth:"));
-			} else if (strstr(cmd, "x11vnc_args:") == cmd) {
-				x11vnc_args = strdup(cmd + strlen("x11vnc_args:"));
-			} else if (strstr(cmd, "env:") == cmd) {
-				putenv(cmd + strlen("env:"));
-			} else if (strstr(cmd, "noop") == cmd) {
-				;
-			} else if (!strcmp(cmd, "restart")) {
-				restart_x11vnc();
-			} else if (!strcmp(cmd, "list_clients") || !strcmp(cmd, "lc")) {
-				list_clients();
-			} else if (!strcmp(cmd, "list_windows") || !strcmp(cmd, "lw")) {
-				list_windows();
-			} else if (!strcmp(cmd, "list_apps") || !strcmp(cmd, "la")) {
-				list_apps();
-			} else if (!strcmp(cmd, "list_all") || !strcmp(cmd, "ls")) {
-				list_windows();
-				fprintf(stderr, "\n");
-				list_apps();
-				fprintf(stderr, "\n");
-				list_clients();
-			} else if (!strcmp(cmd, "print_logs") || !strcmp(cmd, "pl")) {
-				print_logs();
-			} else if (!strcmp(cmd, "?") || !strcmp(cmd, "h") || !strcmp(cmd, "help")) {
-				fprintf(stderr, "available commands:\n");
-				fprintf(stderr, "\n");
-				fprintf(stderr, "   quit restart noop x11vnc help ? ! !!\n");
-				fprintf(stderr, "\n");
-				fprintf(stderr, "   add_window:win  (add:win, add:pick)\n");
-				fprintf(stderr, "   del_window:win  (del:win, del:pick, del:all)\n");
-				fprintf(stderr, "   add_app:win     (add_app:pick)\n");
-				fprintf(stderr, "   del_app:win     (del_app:pick, del_app:all)\n");
-				fprintf(stderr, "   add_client:host (+host)\n");
-				fprintf(stderr, "   del_client:host (-host, -all)\n");
-				fprintf(stderr, "\n");
-				fprintf(stderr, "   list_windows    (lw)\n");
-				fprintf(stderr, "   list_apps       (la)\n");
-				fprintf(stderr, "   list_clients    (lc)\n");
-				fprintf(stderr, "   list_all        (ls)\n");
-				fprintf(stderr, "   print_logs      (pl)\n");
-				fprintf(stderr, "\n");
-				fprintf(stderr, "   debug:n   showmenus:n   noexit:n\n");
-			} else {
-				fprintf(stderr, "unrecognized %s\n", q);
-			}
-			continue;
-		}
-		if (check_clients) {
-			int idx = find_client(q);
-			if (idx >= 0) {
-				seen[idx] = 1;
-			} else {
-				newctl[nnew++] = strdup(q);
-			}
-		}
-	}
-	fclose(f);
-
-	if (check_clients) {
-		for (i=0; i < CMAX; i++) {
-			if (clients[i] == NULL) {
-				continue;
-			}
-			if (!seen[i]) {
-				client(clients[i], 0);
-				free(clients[i]);
-				clients[i] = NULL;
-			}
-		}
-		for (i=0; i < nnew; i++) {
-			int free = find_client(NULL);
-			if (free < 0) {
-				static int cnt = 0;
-				if (cnt++ < 10) {
-					fprintf(stderr, "ran out of client slots.\n");
-					ff();
-					break;
-				}
-				continue;
-			}
-			clients[free] = newctl[i];
-			client(newctl[i], 1);
-		}
-	}
-	return 1;
-}
-
-static int check_control(void) {
-	static int last_size = -1;
-	static time_t last_mtime = 0;
-	struct stat sb;
-	char *control_cmd;
-
-	if (!control) {
-		return 1;
-	}
-
-	if (!strcmp(control, "internal")) {
-		return 1;
-	}
-		
-	control_cmd = (char *)malloc(strlen(control) + strlen(".cmd") + 1);
-	sprintf(control_cmd, "%s.cmd", control);
-	if (stat(control_cmd, &sb) == 0) {
-		FILE *f;
-		if (sb.st_size > 0) {
-			process_control(control_cmd, 0);
-		}
-		f = fopen(control_cmd, "w");
-		if (f) {
-			fclose(f);
-		}
-	}
-	free(control_cmd);
-
-	if (stat(control, &sb) != 0) {
-		return 1;
-	}
-	if (last_size == (int) sb.st_size && last_mtime == sb.st_mtime) {
-		return 1;
-	}
-	last_size = (int) sb.st_size;
-	last_mtime = sb.st_mtime;
-
-	return process_control(control, 1);
-}
-
-static void update(void) {
-	int i, app_ok = 0;
-	if (last_event_type != PropertyNotify) {
-		if (appshare_debug) fprintf(stderr, "\nupdate ...\n");
-	} else if (appshare_debug > 1) {
-		fprintf(stderr, "update ... propertynotify\n");
-	}
-	if (!check_control()) {
-		return;
-	}
-	for (i=0; i < WMAX; i++) {
-		Window win = watch[i];
-		if (win == None) {
-			continue;
-		}
-		if (!win_attr(win)) {
-			destroy_win(win);
-			continue;
-		}
-		if (find_app(win) >= 0) {
-			app_ok++;
-		}
-		if (state[i] == 0) {
-			if (attr.map_state == IsViewable) {
-				if (skip_menus) {
-					Window inside = check_inside(win);
-					if (inside != None) {
-						if (appshare_debug) {fprintf(stderr, "skip_menus: window 0x%lx is inside of 0x%lx, not tracking it.\n", win, inside); ff();}
-						delete_win(win);
-						continue;
-					}
-				}
-				launch(win);
-				state[i] = 1;
-			}
-		} else if (state[i] == 1) {
-			if (attr.map_state != IsViewable) {
-				stop(win);
-				state[i] = 0;
-			}
-		}
-	}
-	if (exit_no_app_win && !app_ok) {
-		for (i=0; i < AMAX; i++) {
-			if (apps[i] != None) {
-				fprintf(stdout, "main application window is gone: 0x%lx\n", apps[i]);
-			}
-		}
-		ff();
-		appshare_cleanup(0);
-	}
-	if (last_event_type != PropertyNotify) {
-		if (appshare_debug) {fprintf(stderr, "update done.\n"); ff();}
-	}
-}
-
-static void exiter(char *msg, int rc) {
-	fprintf(stderr, "%s", msg);
-	ff();
-	kill_helper_pid();
-	exit(rc);
-}
-
-static void set_trackdir(void) {
-	char tmp[256];
-	struct stat sb;
-	if (!strcmp(trackdir, "none")) {
-		trackdir = NULL;
-		return;
-	}
-	if (!strcmp(trackdir, "unset")) {
-		int fd;
-		sprintf(tmp, "%s.XXXXXX", trackpre);
-		fd = mkstemp(tmp);
-		if (fd < 0) {
-			strcat(tmp, ": failed to create file.\n");
-			exiter(tmp, 1);
-		}
-		/* XXX race */
-		close(fd);
-		unlink(tmp);
-		if (mkdir(tmp, 0700) != 0) {
-			strcat(tmp, ": failed to create dir.\n");
-			exiter(tmp, 1);
-		}
-		trackdir = strdup(tmp);
-	}
-	if (stat(trackdir, &sb) != 0) {
-		if (mkdir(trackdir, 0700) != 0) {
-			exiter("could not make trackdir.\n", 1);
-		}
-	} else if (! S_ISDIR(sb.st_mode)) {
-		exiter("trackdir not a directory.\n", 1);
-	}
-	tracktmp = (char *) calloc(1000 + strlen(trackdir), 1);
-}
-
-static void process_string(char *str) {
-	FILE *f;
-	char *file;
-	if (trackdir) {
-		sprintf(tracktmp, "%s/0xprop.cmd", trackdir);
-		file = strdup(tracktmp);
-	} else {
-		char tmp[] = "/tmp/x11vnc-appshare.cmd.XXXXXX";
-		int fd = mkstemp(tmp);
-		if (fd < 0) {
-			return;
-		}
-		file = strdup(tmp);
-		close(fd);
-	}
-	f = fopen(file, "w");
-	if (f) {
-		fprintf(f, "%s", str);
-		fclose(f);
-		process_control(file, 0);
-	}
-	unlink(file);
-	free(file);
-}
-
-static void handle_shell(void) {
-	struct timeval tv;
-	static char lastline[1000];
-	static int first = 1;
-	fd_set rfds;
-	int fd0 = fileno(stdin);
-
-	if (first) {
-		memset(lastline, 0, sizeof(lastline));
-		first = 0;
-	}
-
-	FD_ZERO(&rfds);
-	FD_SET(fd0, &rfds);
-	tv.tv_sec = 0; 
-	tv.tv_usec = 0; 
-	select(fd0+1, &rfds, NULL, NULL, &tv);
-	if (FD_ISSET(fd0, &rfds)) {
-		char line[1000], line2[1010];
-		if (fgets(line, sizeof(line), stdin) != NULL) {
-			char *str = lblanks(line);
-			char *q = strrchr(str, '\n');
-			if (q) *q = '\0';
-			if (strcmp(str, "")) {
-				if (!strcmp(str, "!!")) {
-					sprintf(line, "%s", lastline);
-					fprintf(stderr, "%s\n", line);
-					str = line;
-				}
-				if (strstr(str, "!") == str) {
-					system(str+1);
-				} else if (!strcmp(str, "x11vnc") || !strcmp(str, "ps")) {
-					char *cmd = "ps -elf | egrep 'PID|x11vnc' | grep -v egrep";
-					fprintf(stderr, "%s\n", cmd);
-					system(cmd);
-				} else {
-					sprintf(line2, "cmd=%s", str);
-					process_string(line2);
-				}
-				sprintf(lastline, "%s", str);
-			}
-		}
-		fprintf(stderr, "\n%s", prompt); ff();
-	}
-}
-
-static void handle_prop_cmd(void) {
-	char *value, *str, *done = "DONE";
-
-	if (cmd_atom == None) {
-		return;
-	}
-
-	value = get_xprop(cmd_atom_str, root);
-	if (value == NULL) {
-		return;
-	}
-
-	str = lblanks(value);
-	if (!strcmp(str, done)) {
-		free(value);
-		return;
-	}
-	if (strstr(str, "cmd=quit") == str || strstr(str, "\ncmd=quit")) {
-		set_xprop(cmd_atom_str, root, done);
-		appshare_cleanup(0);
-	}
-
-	process_string(str);
-
-	free(value);
-	set_xprop(cmd_atom_str, root, done);
-}
-
-#define PREFIX if(appshare_debug) fprintf(stderr, "  %8.2f  0x%08lx : ", dnow() - start, ev.xany.window);
-
-static void monitor(void) {
-#if !NO_X11
-	XEvent ev;
-	double start = dnow();
-	int got_prop_cmd = 0;
-
-	if (shell) {
-		update();
-		fprintf(stderr, "\n\n");
-		process_string("cmd=help");
-		fprintf(stderr, "\n%s", prompt); ff();
-	}
-
-	while (1) {
-		int t;
-
-		if (XEventsQueued(dpy, QueuedAlready) == 0) {
-			update();
-			if (got_prop_cmd) {
-				handle_prop_cmd();
-			}
-			got_prop_cmd = 0;
-			if (shell) {
-				handle_shell();
-			}
-		}
-
-		XNextEvent(dpy, &ev);
-
-		last_event_type = ev.type;
-
-		switch (ev.type) {
-		case Expose:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "Expose %04dx%04d+%04d+%04d\n", ev.xexpose.width, ev.xexpose.height, ev.xexpose.x, ev.xexpose.y);
-			break;
-		case ConfigureNotify:
-#if 0
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "ConfigureNotify %04dx%04d+%04d+%04d  above: 0x%lx\n", ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, ev.xconfigure.above);
-#endif
-			break;
-		case VisibilityNotify:
-			PREFIX
-			if (appshare_debug) {
-			fprintf(stderr, "VisibilityNotify: ");
-			t = ev.xvisibility.state;
-			if (t == VisibilityFullyObscured)     fprintf(stderr, "VisibilityFullyObscured\n");
-			if (t == VisibilityPartiallyObscured) fprintf(stderr, "VisibilityPartiallyObscured\n");
-			if (t == VisibilityUnobscured)        fprintf(stderr, "VisibilityUnobscured\n");
-			}
-			break;
-		case MapNotify:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "MapNotify      win: 0x%lx\n", ev.xmap.window);
-			if (ours(ev.xmap.window)) {
-				mapped(ev.xmap.window);
-			}
-			break;
-		case UnmapNotify:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "UnmapNotify    win: 0x%lx\n", ev.xmap.window);
-			if (ours(ev.xmap.window)) {
-				unmapped(ev.xmap.window);
-			}
-			break;
-		case MapRequest:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "MapRequest\n");
-			break;
-		case CreateNotify:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "CreateNotify parent: 0x%lx  win: 0x%lx\n", ev.xcreatewindow.parent, ev.xcreatewindow.window);
-			if (ev.xcreatewindow.parent == root && ours(ev.xcreatewindow.window)) {
-				if (find_win(ev.xcreatewindow.window) >= 0) {
-					destroy_win(ev.xcreatewindow.window);
-				}
-				add_win(ev.xcreatewindow.window);
-			}
-			break;
-		case DestroyNotify:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "DestroyNotify  win: 0x%lx\n", ev.xdestroywindow.window);
-			if (ours(ev.xdestroywindow.window)) {
-				destroy_win(ev.xdestroywindow.window);
-			}
-			break;
-		case ConfigureRequest:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "ConfigureRequest\n");
-			break;
-		case CirculateRequest:
-#if 0
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "CirculateRequest parent: 0x%lx  win: 0x%lx\n", ev.xcirculaterequest.parent, ev.xcirculaterequest.window);
-#endif
-			break;
-		case CirculateNotify:
-#if 0
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "CirculateNotify\n");
-#endif
-			break;
-		case PropertyNotify:
-#if 0
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "PropertyNotify\n");
-#endif
-			if (cmd_atom != None && ev.xproperty.atom == cmd_atom) {
-				got_prop_cmd++;
-			}
-			break;
-		case ReparentNotify:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "ReparentNotify parent: 0x%lx  win: 0x%lx\n", ev.xreparent.parent, ev.xreparent.window);
-			if (ours(ev.xreparent.window)) {
-				if (ours(ev.xreparent.parent)) {
-					destroy_win(ev.xreparent.window);
-				} else if (ev.xreparent.parent == root) {
-					/* ??? */
-				}
-			}
-			break;
-		default:
-			PREFIX
-			if(appshare_debug) fprintf(stderr, "Unknown: %d\n", ev.type);
-			break;
-		}
-	}
-#endif
-}
-
-int appshare_main(int argc, char *argv[]) {
-	int i;
-	char *app_str = NULL;
-	char *dpy_str = NULL;
-	long xselectinput = 0;
-#if NO_X11
-	exiter("not compiled with X11\n", 1);
-#else
-	for (i=0; i < WMAX; i++) {
-		watch[i] = None;
-		state[i] = 0;
-	}
-	for (i=0; i < AMAX; i++) {
-		apps[i]  = None;
-	}
-	for (i=0; i < CMAX; i++) {
-		clients[i] = NULL;
-	}
-
-	x11vnc = strdup(argv[0]);
-
-	for (i=1; i < argc; i++) {
-		int end = (i == argc-1) ? 1 : 0;
-		char *s = argv[i];
-		if (strstr(s, "--") == s) {
-			s++;
-		}
-
-		if (!strcmp(s, "-h") || !strcmp(s, "-help")) {
-			fprintf(stdout, "%s", usage);
-			exit(0);
-		} else if (!strcmp(s, "-id")) {
-			id_opt = "-id";
-			if (end) exiter("no -id value supplied\n", 1);
-			app_str = strdup(argv[++i]);
-		} else if (!strcmp(s, "-sid")) {
-			id_opt = "-sid";
-			if (end) exiter("no -sid value supplied\n", 1);
-			app_str = strdup(argv[++i]);
-		} else if (!strcmp(s, "-connect") || !strcmp(s, "-connect_or_exit") || !strcmp(s, "-coe")) {
-			if (end) exiter("no -connect value supplied\n", 1);
-			connect_to = strdup(argv[++i]);
-		} else if (!strcmp(s, "-control")) {
-			if (end) exiter("no -control value supplied\n", 1);
-			control = strdup(argv[++i]);
-			if (!strcmp(control, "shell")) {
-				free(control);
-				control = strdup("internal");
-				shell = 1;
-			}
-		} else if (!strcmp(s, "-trackdir")) {
-			if (end) exiter("no -trackdir value supplied\n", 1);
-			trackdir = strdup(argv[++i]);
-		} else if (!strcmp(s, "-display")) {
-			if (end) exiter("no -display value supplied\n", 1);
-			dpy_str = strdup(argv[++i]);
-			set_env("DISPLAY", dpy_str);
-		} else if (!strcmp(s, "-delay")) {
-			if (end) exiter("no -delay value supplied\n", 1);
-			helper_delay = atof(argv[++i]);
-		} else if (!strcmp(s, "-args")) {
-			if (end) exiter("no -args value supplied\n", 1);
-			x11vnc_args = strdup(argv[++i]);
-		} else if (!strcmp(s, "-env")) {
-			if (end) exiter("no -env value supplied\n", 1);
-			putenv(argv[++i]);
-		} else if (!strcmp(s, "-debug")) {
-			appshare_debug++;
-		} else if (!strcmp(s, "-showmenus")) {
-			skip_menus = 0;
-		} else if (!strcmp(s, "-noexit")) {
-			exit_no_app_win = 0;
-		} else if (!strcmp(s, "-shell")) {
-			shell = 1;
-		} else if (!strcmp(s, "-nocmds") || !strcmp(s, "-safer")) {
-			fprintf(stderr, "ignoring %s in -appshare mode.\n", s);
-		} else if (!strcmp(s, "-appshare")) {
-			;
-		} else {
-			fprintf(stderr, "unrecognized 'x11vnc -appshare' option: %s\n", s);
-			exiter("", 1);
-		}
-	}
-
-	if (getenv("X11VNC_APPSHARE_DEBUG")) {
-		appshare_debug = atoi(getenv("X11VNC_APPSHARE_DEBUG"));
-	}
-
-	/* let user override name for multiple instances: */
-	if (getenv("X11VNC_APPSHARE_COMMAND_PROPNAME")) {
-		cmd_atom_str = strdup(getenv("X11VNC_APPSHARE_COMMAND_PROPNAME"));
-	}
-	if (getenv("X11VNC_APPSHARE_TICKER_PROPNAME")) {
-		ticker_atom_str = strdup(getenv("X11VNC_APPSHARE_TICKER_PROPNAME"));
-	}
-
-	if (shell) {
-		if (!control || strcmp(control, "internal")) {
-			exiter("mode -shell requires '-control internal'\n", 1);
-		}
-	}
-
-	if (connect_to == NULL && control != NULL) {
-		struct stat sb;
-		if (stat(control, &sb) == 0) {
-			int len = 100 + sb.st_size;
-			FILE *f = fopen(control, "r");
-
-			if (f) {
-				char *line = (char *) malloc(len);
-				connect_to = (char *) calloc(2 * len, 1);
-				while (fgets(line, len, f) != NULL) {
-					char *q = strchr(line, '\n');
-					if (q) *q = '\0';
-					q = lblanks(line);
-					if (q[0] == '#') {
-						continue;
-					}
-					if (connect_to[0] != '\0') {
-						strcat(connect_to, ",");
-					}
-					strcat(connect_to, q);
-				}
-				fclose(f);
-			}
-			fprintf(stderr, "set -connect to: %s\n", connect_to);
-		}
-	}
-	if (0 && connect_to == NULL && control == NULL) {
-		exiter("no -connect host or -control file specified.\n", 1);
-	}
-
-	if (control) {
-		pid_t pid;
-		parent_pid = getpid();
-		pid = fork();
-		if (pid == (pid_t) -1) {
-			;
-		} else if (pid == 0) {
-			be_helper_pid(dpy_str);
-			exit(0);
-		} else {
-			helper_pid = pid;
-		}
-	}
-
-	dpy = XOpenDisplay(dpy_str);
-	if (!dpy) {
-		exiter("cannot open display\n", 1);
-	}
-
-	root = DefaultRootWindow(dpy);
-
-	xselectinput = SubstructureNotifyMask;
-	if (helper_pid > 0) {
-		ticker_atom = XInternAtom(dpy, ticker_atom_str, False);
-		xselectinput |= PropertyChangeMask;
-	}
-	XSelectInput(dpy, root, xselectinput);
-
-	cmd_atom = XInternAtom(dpy, cmd_atom_str, False);
-
-	init_cmask();
-
-	sprintf(unique_tag, "X11VNC_APPSHARE_TAG=%d-tag", getpid());
-
-	start_time = dnow();
-
-	if (app_str == NULL) {
-		exiter("no -id/-sid window specified.\n", 1);
-	} else {
-		char *p, *str = strdup(app_str);
-		char *alist[AMAX];
-		int i, n = 0;
-
-		p = strtok(str, ",");
-		while (p) {
-			if (n >= AMAX) {
-				fprintf(stderr, "ran out of app slots: %s\n", app_str);
-				exiter("", 1);
-			}
-			alist[n++] = strdup(p);
-			p = strtok(NULL, ",");
-		}
-		free(str);
-
-		for (i=0; i < n; i++) {
-			Window app = None;
-			p = alist[i];
-			app = parse_win(p);
-			free(p);
-
-			if (app != None) {
-				if (!ours(app)) {
-					add_app(app);
-				}
-			}
-		}
-	}
-
-	set_trackdir();
-
-	signal(SIGINT,  appshare_cleanup);
-	signal(SIGTERM, appshare_cleanup);
-
-	rfbLogEnable(0);
-
-	if (connect_to) {
-		char *p, *str = strdup(connect_to);
-		int n = 0;
-		p = strtok(str, ",");
-		while (p) {
-			clients[n++] = strdup(p);
-			p = strtok(NULL, ",");
-		}
-		free(str);
-	} else {
-		connect_to = strdup("");
-	}
-
-	for (i=0; i < AMAX; i++) {
-		if (apps[i] == None) {
-			continue;
-		}
-		fprintf(stdout, "Using app win: 0x%08lx  root: 0x%08lx\n", apps[i], root);
-	}
-	fprintf(stdout, "\n");
-
-	monitor();
-
-	appshare_cleanup(0);
-
-#endif
-	return 0;
-}
-
diff --git a/ica/x11/x11vnc/avahi.c b/ica/x11/x11vnc/avahi.c
deleted file mode 100644
index 939a34f..0000000
--- a/ica/x11/x11vnc/avahi.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- avahi.c -- */
-
-#include "x11vnc.h"
-#include "connections.h"
-#include "cleanup.h"
-
-void avahi_initialise(void);
-void avahi_advertise(char *name, char *host, uint16_t port);
-void avahi_reset(void);
-void avahi_cleanup(void);
-
-static pid_t avahi_pid = 0;
-
-static void kill_avahi_pid(void) {
-	if (avahi_pid != 0) {
-		rfbLog("kill_avahi_pid: %d\n", (int) avahi_pid);
-		kill(avahi_pid, SIGTERM);
-		avahi_pid = 0;
-	}
-}
-
-static int try_avahi_helper(char *name, char *host, uint16_t port) {
-#if LIBVNCSERVER_HAVE_FORK
-	char *cmd, *p, *path = getenv("PATH"), portstr[32];
-	int i;
-
-	if (!name || !host || !port) {}
-
-	/* avahi-publish */
-	if (no_external_cmds || !cmd_ok("zeroconf")) {
-		return 0;
-	}
-
-	if (!path) {
-		return 0;
-	}
-
-	path = strdup(path); 
-	cmd = (char *) malloc(strlen(path) + 100);
-	sprintf(portstr, "%d", (int) port);
-
-	p = strtok(path, ":");
-	while (p) {
-		struct stat sbuf;
-
-		sprintf(cmd, "%s/avahi-publish", p);
-		if (stat(cmd, &sbuf) == 0) {
-			break;
-		}
-		sprintf(cmd, "%s/dns-sd", p);
-		if (stat(cmd, &sbuf) == 0) {
-			break;
-		}
-		sprintf(cmd, "%s/mDNS", p);
-		if (stat(cmd, &sbuf) == 0) {
-			break;
-		}
-		cmd[0] = '\0';
-
-		p = strtok(NULL, ":");
-	}
-	free(path);
-
-	if (!strcmp(cmd, "")) {
-		free(cmd);
-		rfbLog("Could not find an external avahi/zeroconf helper program.\n");
-		return 0;
-	}
-
-	avahi_pid = fork();
-
-	if (avahi_pid < 0) {
-		rfbLogPerror("fork");
-		avahi_pid = 0;
-		free(cmd);
-		return 0;
-	}
-
-	if (avahi_pid != 0) {
-		int status;
-
-		usleep(500 * 1000);
-		waitpid(avahi_pid, &status, WNOHANG); 
-		if (kill(avahi_pid, 0) != 0) {
-			waitpid(avahi_pid, &status, WNOHANG); 
-			avahi_pid = 0;
-			free(cmd);
-			return 0;
-		}
-		if (! quiet) {
-			rfbLog("%s helper pid is: %d\n", cmd, (int) avahi_pid);
-		}
-		free(cmd);
-		return 1;
-	}
-
-	for (i=3; i<256; i++) {
-		close(i);
-	}
-
-	if (strstr(cmd, "/avahi-publish")) {
-		execlp(cmd, cmd, "-s", name, "_rfb._tcp", portstr, (char *) NULL);
-	} else {
-		execlp(cmd, cmd, "-R", name, "_rfb._tcp", ".", portstr, (char *) NULL);
-	}
-	exit(1);
-#else
-	if (!name || !host || !port) {}
-	return 0;
-#endif
-}
-
-#if !defined(LIBVNCSERVER_HAVE_AVAHI) || !defined(LIBVNCSERVER_HAVE_LIBPTHREAD)
-void avahi_initialise(void) {
-	rfbLog("avahi_initialise: no Avahi support at buildtime.\n");
-}
-
-void avahi_advertise(char *name, char *host, uint16_t port) {
-	char *t;
-	t = getenv("X11VNC_AVAHI_NAME"); if (t) name = t;
-	t = getenv("X11VNC_AVAHI_HOST"); if (t) host = t;
-	t = getenv("X11VNC_AVAHI_PORT"); if (t) port = atoi(t);
-
-	if (!try_avahi_helper(name, host, port)) {
-		rfbLog("avahi_advertise:  no Avahi support at buildtime.\n");
-		avahi = 0;
-	}
-}
-
-void avahi_reset(void) {
-	kill_avahi_pid();
-	rfbLog("avahi_reset: no Avahi support at buildtime.\n");
-}
-
-void avahi_cleanup(void) {
-	kill_avahi_pid();
-	rfbLog("avahi_cleanup: no Avahi support at buildtime.\n");
-}
-#else
-
-#include <avahi-common/thread-watch.h>
-#include <avahi-common/alternative.h>
-#include <avahi-client/client.h>
-#include <avahi-client/publish.h>
-
-#include <avahi-common/malloc.h>
-#include <avahi-common/error.h>
-
-
-static AvahiThreadedPoll *_poll = NULL;
-static AvahiClient *_client = NULL;
-static AvahiEntryGroup *_group = NULL;
-
-static int db = 0;
-
-typedef struct {
-	const char *name;
-	const char *host;
-	uint16_t port;
-} avahi_service_t;
-
-typedef struct {
-	char *name;
-	char *host;
-	uint16_t port;
-} avahi_reg_t;
-
-#define NREG 16
-static avahi_reg_t registered[NREG];
-
-void avahi_initialise(void) {
-	int ret;
-	static int first = 1;
-
-	if (getenv("AVAHI_DEBUG")) {
-		db = 1;
-	}
-	if (first) {
-		int i;
-		for (i=0; i<NREG; i++) {
-			registered[i].name = NULL;
-			registered[i].host = NULL;
-		}
-		first = 0;
-	}
-
-if (db) fprintf(stderr, "in  avahi_initialise\n");
-	if (_poll) {
-if (db) fprintf(stderr, "    avahi_initialise: poll not null\n");
-		return;
-	}
-
-	if (! (_poll = avahi_threaded_poll_new()) ) {
-		rfbLog("warning: unable to open Avahi poll.\n");
-		return;
-	}
-
-	_client = avahi_client_new(avahi_threaded_poll_get(_poll),
-	    0, NULL, NULL, &ret);
-	if (! _client) {
-		rfbLog("warning: unable to open Avahi client: %s\n",
-		    avahi_strerror(ret));
-
-		avahi_threaded_poll_free(_poll);
-		_poll = NULL;
-		return;
-	}
-
-	if (avahi_threaded_poll_start(_poll) < 0) {
-		rfbLog("warning: unable to start Avahi poll.\n");
-		avahi_client_free(_client);
-		_client = NULL;
-		avahi_threaded_poll_free(_poll);
-		_poll = NULL;
-		return;
-	}
-if (db) fprintf(stderr, "out avahi_initialise\n");
-}
-
-static void _avahi_create_services(char *name, char *host,
-    uint16_t port);
-
-static void _avahi_entry_group_callback(AvahiEntryGroup *g,
-    AvahiEntryGroupState state, void *userdata) {
-	char *new_name;
-	avahi_service_t *svc = (avahi_service_t *)userdata;
-
-if (db) fprintf(stderr, "in  _avahi_entry_group_callback %d 0x%p\n", state, svc);
-	if (g != _group && _group != NULL) {
-		rfbLog("avahi_entry_group_callback fatal error (group).\n");
-		clean_up_exit(1);
-	}
-	if (userdata == NULL) {
-		rfbLog("avahi_entry_group_callback fatal error (userdata).\n");
-		clean_up_exit(1);
-	}
-
-	switch(state) {
-	case AVAHI_ENTRY_GROUP_ESTABLISHED:
-		rfbLog("Avahi group %s established.\n", svc->name);
-#if 0		/* is this the segv problem? */
-		free(svc);
-#endif
-		break;
-	case AVAHI_ENTRY_GROUP_COLLISION:
-		new_name = avahi_alternative_service_name(svc->name);
-		_avahi_create_services(new_name, svc->host, svc->port);
-		rfbLog("Avahi Entry group collision\n");
-		avahi_free(new_name);
-		break;
-	case AVAHI_ENTRY_GROUP_FAILURE:
-		rfbLog("Avahi Entry group failure: %s\n",
-		    avahi_strerror(avahi_client_errno(
-		    avahi_entry_group_get_client(g))));
-		break;
-	default:
-		break;
-	}
-if (db) fprintf(stderr, "out _avahi_entry_group_callback\n");
-}
-
-static void _avahi_create_services(char *name, char *host, uint16_t port) {
-	avahi_service_t *svc = (avahi_service_t *)malloc(sizeof(avahi_service_t));
-	int ret = 0;
-
-if (db) fprintf(stderr, "in  _avahi_create_services  '%s' '%s' %d\n", name, host, port);
-	svc->name = name;
-	svc->host = host;
-	svc->port = port;
-
-	if (!_group) {
-if (db) fprintf(stderr, "    _avahi_create_services create group\n");
-		_group = avahi_entry_group_new(_client,
-		    _avahi_entry_group_callback, svc);
-	}
-	if (!_group) {
-		rfbLog("avahi_entry_group_new() failed: %s\n",
-		    avahi_strerror(avahi_client_errno(_client)));
-		return;
-	}
-
-	ret = avahi_entry_group_add_service(_group, AVAHI_IF_UNSPEC,
-	    AVAHI_PROTO_UNSPEC, 0, name, "_rfb._tcp", NULL, NULL, port, NULL);
-	if (ret < 0) {
-		rfbLog("Failed to add _rfb._tcp service: %s\n",
-		    avahi_strerror(ret));
-		return;
-	}
-
-	ret = avahi_entry_group_commit(_group);
-	if (ret < 0) {
-		rfbLog("Failed to commit entry_group:: %s\n",
-		    avahi_strerror(ret));
-		return;
-	}
-if (db) fprintf(stderr, "out _avahi_create_services\n");
-}
-
-void avahi_advertise(char *name, char *host, uint16_t port) {
-	int i;
-	char *t;
-	t = getenv("X11VNC_AVAHI_NAME"); if (t) name = t;
-	t = getenv("X11VNC_AVAHI_HOST"); if (t) host = t;
-	t = getenv("X11VNC_AVAHI_PORT"); if (t) port = atoi(t);
-
-if (db) fprintf(stderr, "in  avahi_advertise: '%s' '%s' %d\n", name, host, port);
-	if (!_client) {
-if (db) fprintf(stderr, "    avahi_advertise client null\n");
-		return;
-	}
-	if (_poll == NULL) {
-		rfbLog("Avahi poll not initialized.\n");
-		return;
-	}
-	/* well, we just track it ourselves... */
-	for (i=0; i<NREG; i++) {
-		if (!registered[i].name) {
-			continue;
-		}
-		if (strcmp(registered[i].name, name)) {
-			continue;
-		}
-		if (strcmp(registered[i].host, host)) {
-			continue;
-		}
-		if (registered[i].port != port) {
-			continue;
-		}
-if (db) fprintf(stderr, "    avahi_advertise already did this one\n");
-		return;
-	}
-	for (i=0; i<NREG; i++) {
-		if (!registered[i].name) {
-			registered[i].name = strdup(name);
-			registered[i].host = strdup(host);
-			registered[i].port = port;
-			break;
-		}
-	}
-
-	avahi_threaded_poll_lock(_poll);
-	_avahi_create_services(name, host, port >= 5900 ? port : 5900+port);
-	avahi_threaded_poll_unlock(_poll);
-if (db) fprintf(stderr, "out avahi_advertise\n");
-}
-
-void avahi_reset(void) {
-	int i;
-if (db) fprintf(stderr, "in  avahi_reset\n");
-	for (i=0; i<NREG; i++) {
-		if (registered[i].name) {
-			free(registered[i].name);
-			registered[i].name = NULL;
-		}
-		if (registered[i].host) {
-			free(registered[i].host);
-			registered[i].host = NULL;
-		}
-	}
-	if (!_client || !_group) {
-if (db) fprintf(stderr, "    avahi_reset client/group null\n");
-		return;
-	}
-	avahi_entry_group_reset(_group);
-	rfbLog("Avahi resetting group.\n");
-if (db) fprintf(stderr, "out avahi_reset\n");
-}
-
-static void avahi_timeout (int sig) {
-	rfbLog("sig: %d, avahi_cleanup timed out.\n", sig);
-	exit(1);
-}
-
-
-void avahi_cleanup(void) {
-if (db) fprintf(stderr, "in  avahi_cleanup\n");
-	if (!_client) {
-if (db) fprintf(stderr, "    avahi_cleanup client null\n");
-		return;
-	}
-if (db) fprintf(stderr, "    avahi_cleanup poll_lock\n");
-	avahi_threaded_poll_lock(_poll);
-if (db) fprintf(stderr, "    avahi_cleanup poll_stop\n");
-
-	signal(SIGALRM, avahi_timeout);
-	alarm(3);
-	avahi_threaded_poll_stop(_poll);
-	alarm(0);
-	signal(SIGALRM, SIG_DFL);
-
-if (db) fprintf(stderr, "    avahi_cleanup client_free\n");
-	avahi_client_free(_client);
-	_client = NULL;
-
-if (db) fprintf(stderr, "    avahi_cleanup poll_free\n");
-	avahi_threaded_poll_free(_poll);
-	_poll = NULL;
-if (db) fprintf(stderr, "out avahi_cleanup\n");
-}
-
-#endif
-
diff --git a/ica/x11/x11vnc/avahi.h b/ica/x11/x11vnc/avahi.h
deleted file mode 100644
index 7b7a6bc..0000000
--- a/ica/x11/x11vnc/avahi.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_AVAHI_H
-#define _X11VNC_AVAHI_H
-
-/* -- avahi.h -- */
-
-extern void avahi_initialise(void);
-extern void avahi_advertise(char *name, char *host, uint16_t port);
-extern void avahi_reset(void);
-extern void avahi_cleanup(void);
-
-#endif /* _X11VNC_AVAHI_H */
diff --git a/ica/x11/x11vnc/blackout_t.h b/ica/x11/x11vnc/blackout_t.h
deleted file mode 100644
index 014f5b4..0000000
--- a/ica/x11/x11vnc/blackout_t.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_BLACKOUT_T_H
-#define _X11VNC_BLACKOUT_T_H
-
-/* -- blackout_t.h -- */
-
-typedef struct bout {
-	int x1, y1, x2, y2;
-} blackout_t;
-
-#define BO_MAX 32
-typedef struct tbout {
-	blackout_t bo[BO_MAX];	/* hardwired max rectangles. */
-	int cover;
-	int count;
-} tile_blackout_t;
-
-#endif /* _X11VNC_BLACKOUT_T_H */
diff --git a/ica/x11/x11vnc/cleanup.c b/ica/x11/x11vnc/cleanup.c
deleted file mode 100644
index f179089..0000000
--- a/ica/x11/x11vnc/cleanup.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- cleanup.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "xdamage.h"
-#include "remote.h"
-#include "keyboard.h"
-#include "scan.h"
-#include "gui.h"
-#include "solid.h"
-#include "unixpw.h"
-#include "sslcmds.h"
-#include "sslhelper.h"
-#include "connections.h"
-#include "macosx.h"
-#include "macosxCG.h"
-#include "avahi.h"
-#include "screen.h"
-#include "xrecord.h"
-#include "xevents.h"
-#include "uinput.h"
-
-/*
- * Exiting and error handling routines
- */
-
-int trapped_xerror = 0;
-int trapped_xioerror = 0;
-int trapped_getimage_xerror = 0;
-int trapped_record_xerror = 0;
-XErrorEvent *trapped_xerror_event;
-
-/* XXX CHECK BEFORE RELEASE */
-int crash_debug = 0;
-
-void clean_shm(int quick);
-void clean_up_exit(int ret);
-int trap_xerror(Display *d, XErrorEvent *error);
-int trap_xioerror(Display *d);
-int trap_getimage_xerror(Display *d, XErrorEvent *error);
-char *xerror_string(XErrorEvent *error);
-void initialize_crash_handler(void);
-void initialize_signals(void);
-void unset_signals(void);
-void close_exec_fds(void);
-int known_sigpipe_mode(char *s);
-
-
-static int exit_flag = 0;
-static int exit_sig = 0;
-
-static void clean_icon_mode(void);
-static int Xerror(Display *d, XErrorEvent *error);
-static int XIOerr(Display *d);
-static void crash_shell_help(void);
-static void crash_shell(void);
-static void interrupted (int sig);
-
-
-void clean_shm(int quick) {
-	int i, cnt = 0;
-
-	/*
-	 * to avoid deadlock, etc, under quick=1 we just delete the shm
-	 * areas and leave the X stuff hanging.
-	 */
-	if (quick) {
-		shm_delete(&scanline_shm);
-		shm_delete(&fullscreen_shm);
-		shm_delete(&snaprect_shm);
-	} else {
-		shm_clean(&scanline_shm, scanline);
-		shm_clean(&fullscreen_shm, fullscreen);
-		shm_clean(&snaprect_shm, snaprect);
-	}
-
-	/* 
-	 * Here we have to clean up quite a few shm areas for all
-	 * the possible tile row runs (40 for 1280), not as robust
-	 * as one might like... sometimes need to run ipcrm(1). 
-	 */
-	for(i=1; i<=ntiles_x; i++) {
-		if (i > tile_shm_count) {
-			break;
-		}
-		if (quick) {
-			shm_delete(&tile_row_shm[i]);
-		} else {
-			shm_clean(&tile_row_shm[i], tile_row[i]);
-		}
-		cnt++;
-		if (single_copytile_count && i >= single_copytile_count) {
-			break;
-		}
-	}
-	if (!quiet && cnt > 0) {
-		rfbLog("deleted %d tile_row polling images.\n", cnt);
-	}
-}
-
-static void clean_icon_mode(void) {
-	if (icon_mode && icon_mode_fh) {
-		fprintf(icon_mode_fh, "quit\n");
-		fflush(icon_mode_fh);
-		fclose(icon_mode_fh);
-		icon_mode_fh = NULL;
-		if (icon_mode_file) {
-			unlink(icon_mode_file);
-			icon_mode_file = NULL;
-		}
-	}
-}
-
-/*
- * Normal exiting
- */
-void clean_up_exit(int ret) {
-	static int depth = 0;
-	exit_flag = 1;
-
-	if (depth++ > 2) {
-		return;
-		//exit(ret);
-	}
-
-	if (icon_mode) {
-		clean_icon_mode();
-	}
-
-	/* remove the shm areas: */
-	clean_shm(0);
-
-	stop_stunnel();
-	if (use_openssl) {
-		ssl_helper_pid(0, 0);	/* killall */
-	}
-
-	if (ssh_pid > 0) {
-		kill(ssh_pid, SIGTERM);
-		ssh_pid = 0;
-	}
-
-#ifdef MACOSX
-	if (client_connect_file) {
-		if (strstr(client_connect_file, "/tmp/x11vnc-macosx-remote")
-		    == client_connect_file) {
-			unlink(client_connect_file);
-		}
-	}
-	if (macosx_console) {
-		macosxCG_fini();
-	}
-#endif
-
-	if (pipeinput_fh != NULL) {
-		pclose(pipeinput_fh);
-		pipeinput_fh = NULL;
-	}
-
-	shutdown_uinput();
-
-	if (unix_sock) {
-		if (unix_sock_fd >= 0) {
-			rfbLog("deleting unix sock: %s\n", unix_sock);
-			close(unix_sock_fd);
-			unix_sock_fd = -1;
-			unlink(unix_sock);
-		}
-	}
-
-	if (! dpy) {	/* raw_rb hack */
-		if (rm_flagfile) {
-			unlink(rm_flagfile);
-			rm_flagfile = NULL;
-		}
-		exit(ret);
-	}
-
-	/* X keyboard cleanups */
-	delete_added_keycodes(0);
-
-	if (clear_mods == 1) {
-		clear_modifiers(0);
-	} else if (clear_mods == 2) {
-		clear_keys();
-	} else if (clear_mods == 3) {
-		clear_keys();
-		clear_locks();
-	}
-
-	if (no_autorepeat) {
-		autorepeat(1, 0);
-	}
-	if (use_solid_bg) {
-		solid_bg(1);
-	}
-	if (ncache || ncache0) {
-		kde_no_animate(1);
-	}
-	X_LOCK;
-	XTestDiscard_wr(dpy);
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-	if (xdamage) {
-		XDamageDestroy(dpy, xdamage);
-	}
-#endif
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-	if (trap_ctx) {
-		XEFreeTC(trap_ctx);
-	}
-#endif
-	/* XXX rdpy_ctrl, etc. cannot close w/o blocking */
-	XCloseDisplay_wr(dpy);
-	X_UNLOCK;
-
-	fflush(stderr);
-
-	if (rm_flagfile) {
-		unlink(rm_flagfile);
-		rm_flagfile = NULL;
-	}
-
-	if (avahi) {
-		avahi_cleanup();
-		fflush(stderr);
-	}
-
-	//exit(ret);
-}
-
-/* X11 error handlers */
-
-static XErrorHandler   Xerror_def;
-static XIOErrorHandler XIOerr_def;
-
-int trap_xerror(Display *d, XErrorEvent *error) {
-	trapped_xerror = 1;
-	trapped_xerror_event = error;
-
-	if (d) {} /* unused vars warning: */
-
-	return 0;
-}
-
-int trap_xioerror(Display *d) {
-	trapped_xioerror = 1;
-
-	if (d) {} /* unused vars warning: */
-
-	return 0;
-}
-
-int trap_getimage_xerror(Display *d, XErrorEvent *error) {
-	trapped_getimage_xerror = 1;
-	trapped_xerror_event = error;
-
-	if (d) {} /* unused vars warning: */
-
-	return 0;
-}
-
-/* Are silly Xorg people removing X_ShmAttach from XShm.h? */
-/* INDEED!  What stupid, myopic morons...  */
-/* Maintenance Monkeys busy typing at their keyboards... */
-#ifndef X_ShmAttach
-#define X_ShmAttach 1
-#endif
-
-static int Xerror(Display *d, XErrorEvent *error) {
-	X_UNLOCK;
-
-	if (getenv("X11VNC_PRINT_XERROR")) {
-		fprintf(stderr, "Xerror: major_opcode: %d minor_opcode: %d error_code: %d\n",
-		    error->request_code, error->minor_code, error->error_code);
-	}
-
-	if (xshm_opcode > 0 && error->request_code == xshm_opcode) {
-		if (error->minor_code == X_ShmAttach) {
-			char *dstr = DisplayString(dpy);
-			fprintf(stderr, "\nX11 MIT Shared Memory Attach failed:\n");
-			fprintf(stderr, "  Is your DISPLAY=%s on a remote machine?\n", dstr);
-			if (strstr(dstr, "localhost:")) {
-				fprintf(stderr, "  Note:   DISPLAY=localhost:N suggests a SSH X11 redir to a remote machine.\n");
-			} else if (dstr[0] != ':') {
-				fprintf(stderr, "  Note:   DISPLAY=hostname:N suggests a remote display.\n");
-			}
-			fprintf(stderr, "  Suggestion, use: x11vnc -display :0 ... for local display :0\n\n");
-		}
-	}
-
-	interrupted(0);
-
-	if (d) {} /* unused vars warning: */
-
-	return (*Xerror_def)(d, error);
-}
-
-void watch_loop(void);
-
-static int XIOerr(Display *d) {
-	static int reopen = 0, rmax = 1;
-	X_UNLOCK;
-
-	if (getenv("X11VNC_REOPEN_DISPLAY")) {
-		rmax = atoi(getenv("X11VNC_REOPEN_DISPLAY"));
-	}
-
-#if !NO_X11
-	if (reopen < rmax && getenv("X11VNC_REOPEN_DISPLAY")) {
-		int db = getenv("X11VNC_REOPEN_DEBUG") ? 1 : 0;
-		int sleepmax = 10, i;
-		Display *save_dpy = dpy;
-		char *dstr = strdup(DisplayString(save_dpy));
-		reopen++;	
-		if (getenv("X11VNC_REOPEN_SLEEP_MAX")) {
-			sleepmax = atoi(getenv("X11VNC_REOPEN_SLEEP_MAX"));
-		}
-		rfbLog("*** XIO error: Trying to reopen[%d/%d] display '%s'\n", reopen, rmax, dstr);
-		rfbLog("*** XIO error: Note the reopened state may be unstable.\n");
-		for (i=0; i < sleepmax; i++) {
-			usleep (1000 * 1000);
-			dpy = XOpenDisplay_wr(dstr);
-			rfbLog("dpy[%d/%d]: %p\n", i+1, sleepmax, dpy);
-			if (dpy) {
-				break;
-			}
-		}
-		last_open_xdisplay = time(NULL);
-		if (dpy) {
-			rfbLog("*** XIO error: Reopened display '%s' successfully.\n", dstr);
-			if (db) rfbLog("*** XIO error: '%s' 0x%x\n", dstr, dpy);
-			scr = DefaultScreen(dpy);
-			rootwin = RootWindow(dpy, scr);
-			if (db) rfbLog("*** XIO error: disable_grabserver\n");
-			disable_grabserver(dpy, 0);
-			if (db) rfbLog("*** XIO error: xrecord\n");
-			zerodisp_xrecord();
-			initialize_xrecord();
-			if (db) rfbLog("*** XIO error: xdamage\n");
-			create_xdamage_if_needed(1);
-			if (db) rfbLog("*** XIO error: do_new_fb\n");
-			if (using_shm) {
-				if (db) rfbLog("*** XIO error: clean_shm\n");
-				clean_shm(1);
-			}
-			do_new_fb(1);
-			if (db) rfbLog("*** XIO error: check_xevents\n");
-			check_xevents(1);
-
-			/* sadly, we can never return... */
-			if (db) rfbLog("*** XIO error: watch_loop\n");
-			watch_loop();
-			clean_up_exit(1);	
-		}
-	}
-#endif
-
-	interrupted(-1);
-
-	if (d) {} /* unused vars warning: */
-
-	return (*XIOerr_def)(d);
-}
-
-static char *xerrors[] = {
-	"Success",
-	"BadRequest",
-	"BadValue",
-	"BadWindow",
-	"BadPixmap",
-	"BadAtom",
-	"BadCursor",
-	"BadFont",
-	"BadMatch",
-	"BadDrawable",
-	"BadAccess",
-	"BadAlloc",
-	"BadColor",
-	"BadGC",
-	"BadIDChoice",
-	"BadName",
-	"BadLength",
-	"BadImplementation",
-	"unknown"
-};
-static int xerrors_max = BadImplementation;
-
-char *xerror_string(XErrorEvent *error) {
-	int index = -1;
-	if (error) {
-		index = (int) error->error_code;
-	}
-	if (0 <= index && index <= xerrors_max) {
-		return xerrors[index];
-	} else {
-		return xerrors[xerrors_max+1];
-	}
-}
-
-static char *crash_stack_command1 = NULL;
-static char *crash_stack_command2 = NULL;
-static char *crash_debug_command = NULL;
-
-void initialize_crash_handler(void) {
-	int pid = program_pid;
-	crash_stack_command1 = (char *) malloc(1000);
-	crash_stack_command2 = (char *) malloc(1000);
-	crash_debug_command =  (char *) malloc(1000);
-
-	snprintf(crash_stack_command1, 500, "echo where > /tmp/gdb.%d;"
-	    " env PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/bin"
-	    " gdb -x /tmp/gdb.%d -batch -n %s %d;"
-	    " rm -f /tmp/gdb.%d", pid, pid, program_name, pid, pid);
-	snprintf(crash_stack_command2, 500, "pstack %d", program_pid);
-	
-	snprintf(crash_debug_command, 500, "gdb %s %d", program_name, pid);
-}
-
-static void crash_shell_help(void) {
-	int pid = program_pid;
-	fprintf(stderr, "\n");
-	fprintf(stderr, "   *** Welcome to the x11vnc crash shell! ***\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "PROGRAM: %s  PID: %d\n", program_name, pid);
-	fprintf(stderr, "\n");
-	fprintf(stderr, "POSSIBLE DEBUGGER COMMAND:\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "  %s\n", crash_debug_command);
-	fprintf(stderr, "\n");
-	fprintf(stderr, "Press \"q\" to quit.\n");
-	fprintf(stderr, "Press \"h\" or \"?\" for this help.\n");
-	fprintf(stderr, "Press \"s\" to try to run some commands to"
-	    " show a stack trace (gdb/pstack).\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "Anything else is passed to -Q query function.\n");
-	fprintf(stderr, "\n");
-}
-
-static void crash_shell(void) {
-	char qry[1000], cmd[1000], line[1000];
-	char *str, *p;
-
-	crash_shell_help();
-	fprintf(stderr, "\ncrash> ");
-	while (fgets(line, 1000, stdin) != NULL) {
-		str = lblanks(line);
-
-		p = str;
-		while(*p) {
-			if (*p == '\n') {
-				*p = '\0';
-			}
-			p++;
-		}
-
-		if (*str == 'q' && *(str+1) == '\0') {
-			fprintf(stderr, "quiting.\n");
-			return;
-		} else if (*str == 'h' && *(str+1) == '\0') {
-			crash_shell_help();
-		} else if (*str == '?' && *(str+1) == '\0') {
-			crash_shell_help();
-		} else if (*str == 's' && *(str+1) == '\0') {
-			sprintf(cmd, "sh -c '(%s) &'", crash_stack_command1);
-			/* crash */
-			if (no_external_cmds || !cmd_ok("crash")) {
-				fprintf(stderr, "\nno_external_cmds=%d\n",
-				    no_external_cmds);
-				goto crash_prompt;
-			}
-			fprintf(stderr, "\nrunning:\n\t%s\n\n",
-			    crash_stack_command1);
-			system(cmd);
-			usleep(1000*1000);
-
-			sprintf(cmd, "sh -c '(%s) &'", crash_stack_command2);
-			fprintf(stderr, "\nrunning:\n\t%s\n\n",
-			    crash_stack_command2);
-			system(cmd);
-			usleep(1000*1000);
-		} else {
-			snprintf(qry, 1000, "qry=%s", str);
-			p = process_remote_cmd(qry, 1);
-			fprintf(stderr, "\n\nresult:\n%s\n", p);
-			free(p);
-		}
-		
-crash_prompt:
-		fprintf(stderr, "crash> ");
-	}
-}
-
-/*
- * General problem handler
- */
-static void interrupted (int sig) {
-	exit_sig = sig;
-	if (exit_flag) {
-		fprintf(stderr, "extra[%d] signal: %d\n", exit_flag, sig);
-		exit_flag++;
-		if (use_threads) {
-			usleep2(250 * 1000);
-		} else if (exit_flag <= 2) {
-			return;
-		}
-		if (rm_flagfile) {
-			unlink(rm_flagfile);
-			rm_flagfile = NULL;
-		}
-		exit(4);
-	}
-	exit_flag++;
-	if (sig == 0) {
-		fprintf(stderr, "caught X11 error:\n");
-		if (crash_debug) { crash_shell(); }
-	} else if (sig == -1) {
-		fprintf(stderr, "caught XIO error:\n");
-	} else {
-		fprintf(stderr, "caught signal: %d\n", sig);
-	}
-	if (sig == SIGINT) {
-		shut_down = 1;
-		return;
-	}
-
-	if (crash_debug) {
-		crash_shell();
-	}
-
-	X_UNLOCK;
-
-	if (icon_mode) {
-		clean_icon_mode();
-	}
-	/* remove the shm areas with quick=1: */
-	clean_shm(1);
-
-	if (sig == -1) {
-		/* not worth trying any more cleanup, X server probably gone */
-		if (rm_flagfile) {
-			unlink(rm_flagfile);
-			rm_flagfile = NULL;
-		}
-		exit(3);
-	}
-
-	/* X keyboard cleanups */
-	delete_added_keycodes(0);
-
-	if (clear_mods == 1) {
-		clear_modifiers(0);
-	} else if (clear_mods == 2) {
-		clear_keys();
-	} else if (clear_mods == 3) {
-		clear_keys();
-		clear_locks();
-	}
-	if (no_autorepeat) {
-		autorepeat(1, 0);
-	}
-	if (use_solid_bg) {
-		solid_bg(1);
-	}
-	if (ncache || ncache0) {
-		kde_no_animate(1);
-	}
-	stop_stunnel();
-
-	if (crash_debug) {
-		crash_shell();
-	}
-
-	if (sig) {
-		if (rm_flagfile) {
-			unlink(rm_flagfile);
-			rm_flagfile = NULL;
-		}
-		exit(2);
-	}
-}
-
-static void ignore_sigs(char *list) {
-	char *str, *p;
-	int ignore = 1;
-	if (list == NULL || *list == '\0') {
-		return;
-	}
-	str = strdup(list);
-	p = strtok(str, ":,");
-
-#define SETSIG(x, y) \
-	if (strstr(p, x)) { \
-		if (ignore) { \
-			signal(y, SIG_IGN); \
-		} else { \
-			signal(y, interrupted); \
-		} \
-	}
-
-#ifdef SIG_IGN
-	while (p) {
-		if (!strcmp(p, "ignore")) {
-			ignore = 1;
-		} else if (!strcmp(p, "exit")) {
-			ignore = 0;
-		}
-		/* Take off every 'sig' ;-) */
-#ifdef SIGHUP
-		SETSIG("HUP", SIGHUP);
-#endif
-#ifdef SIGINT
-		SETSIG("INT", SIGINT);
-#endif
-#ifdef SIGQUIT
-		SETSIG("QUIT", SIGQUIT);
-#endif
-#ifdef SIGTRAP
-		SETSIG("TRAP", SIGTRAP);
-#endif
-#ifdef SIGABRT
-		SETSIG("ABRT", SIGABRT);
-#endif
-#ifdef SIGBUS
-		SETSIG("BUS", SIGBUS);
-#endif
-#ifdef SIGFPE
-		SETSIG("FPE", SIGFPE);
-#endif
-#ifdef SIGSEGV
-		SETSIG("SEGV", SIGSEGV);
-#endif
-#ifdef SIGPIPE
-		SETSIG("PIPE", SIGPIPE);
-#endif
-#ifdef SIGTERM
-		SETSIG("TERM", SIGTERM);
-#endif
-#ifdef SIGUSR1
-		SETSIG("USR1", SIGUSR1);
-#endif
-#ifdef SIGUSR2
-		SETSIG("USR2", SIGUSR2);
-#endif
-#ifdef SIGCONT
-		SETSIG("CONT", SIGCONT);
-#endif
-#ifdef SIGSTOP
-		SETSIG("STOP", SIGSTOP);
-#endif
-#ifdef SIGTSTP
-		SETSIG("TSTP", SIGTSTP);
-#endif
-		p = strtok(NULL, ":,");
-	}
-#endif	/* SIG_IGN */
-	free(str);
-}
-
-/* signal handlers */
-void initialize_signals(void) {
-	signal(SIGHUP,  interrupted);
-	signal(SIGINT,  interrupted);
-	signal(SIGQUIT, interrupted);
-	signal(SIGABRT, interrupted);
-	signal(SIGTERM, interrupted);
-	signal(SIGBUS,  interrupted);
-	signal(SIGSEGV, interrupted);
-	signal(SIGFPE,  interrupted);
-
-	if (!sigpipe || *sigpipe == '\0' || !strcmp(sigpipe, "skip")) {
-		;
-	} else if (strstr(sigpipe, "ignore:") == sigpipe) {
-		ignore_sigs(sigpipe);
-	} else if (strstr(sigpipe, "exit:") == sigpipe) {
-		ignore_sigs(sigpipe);
-	} else if (!strcmp(sigpipe, "ignore")) {
-#ifdef SIG_IGN
-		signal(SIGPIPE, SIG_IGN);
-#endif
-	} else if (!strcmp(sigpipe, "exit")) {
-		rfbLog("initialize_signals: will exit on SIGPIPE\n");
-		signal(SIGPIPE, interrupted);
-	}
-
-#if NO_X11
-	return;
-#else
-	X_LOCK;
-	Xerror_def = XSetErrorHandler(Xerror);
-	XIOerr_def = XSetIOErrorHandler(XIOerr);
-	X_UNLOCK;
-#endif	/* NO_X11 */
-}
-
-void unset_signals(void) {
-	signal(SIGHUP,  SIG_DFL);
-	signal(SIGINT,  SIG_DFL);
-	signal(SIGQUIT, SIG_DFL);
-	signal(SIGABRT, SIG_DFL);
-	signal(SIGTERM, SIG_DFL);
-	signal(SIGBUS,  SIG_DFL);
-	signal(SIGSEGV, SIG_DFL);
-	signal(SIGFPE,  SIG_DFL);
-	signal(SIGPIPE, SIG_DFL);
-}
-
-void close_exec_fds(void) {
-	int fd;
-#ifdef FD_CLOEXEC
-	for (fd = 3; fd < 64; fd++) {
-		int flags = fcntl(fd, F_GETFD);
-		if (flags != -1) {
-			flags |= FD_CLOEXEC;
-			fcntl(fd, F_SETFD, flags);
-		}
-	}
-#endif
-}
-
-int known_sigpipe_mode(char *s) {
-/*
- * skip, ignore, exit
- */
-	if (strstr(s, "ignore:") == s) {
-		return 1;
-	}
-	if (strstr(s, "exit:") == s) {
-		return 1;
-	}
-	if (strcmp(s, "skip") && strcmp(s, "ignore") && 
-	    strcmp(s, "exit")) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-
diff --git a/ica/x11/x11vnc/cleanup.h b/ica/x11/x11vnc/cleanup.h
deleted file mode 100644
index 0c4dcea..0000000
--- a/ica/x11/x11vnc/cleanup.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_CLEANUP_H
-#define _X11VNC_CLEANUP_H
-
-/* -- cleanup.h -- */
-
-extern int trapped_xerror;
-extern int trapped_xioerror;
-extern int trapped_getimage_xerror;
-extern int trapped_record_xerror;
-extern XErrorEvent *trapped_xerror_event;
-
-extern int crash_debug;
-
-extern void clean_shm(int quick);
-extern void clean_up_exit(int ret);
-
-extern int trap_xerror(Display *d, XErrorEvent *error);
-extern int trap_xioerror(Display *d);
-extern int trap_getimage_xerror(Display *d, XErrorEvent *error);
-extern char *xerror_string(XErrorEvent *error);
-extern void initialize_crash_handler(void);
-extern void initialize_signals(void);
-extern void unset_signals(void);
-extern void close_exec_fds(void);
-extern int known_sigpipe_mode(char *s);
-
-#endif /* _X11VNC_CLEANUP_H */
diff --git a/ica/x11/x11vnc/connections.c b/ica/x11/x11vnc/connections.c
deleted file mode 100644
index 9e5fd24..0000000
--- a/ica/x11/x11vnc/connections.c
+++ /dev/null
@@ -1,4455 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- connections.c -- */
-
-#include "x11vnc.h"
-#include "inet.h"
-#include "remote.h"
-#include "keyboard.h"
-#include "cleanup.h"
-#include "gui.h"
-#include "solid.h"
-#include "rates.h"
-#include "screen.h"
-#include "unixpw.h"
-#include "user.h"
-#include "scan.h"
-#include "sslcmds.h"
-#include "sslhelper.h"
-#include "xwrappers.h"
-#include "xevents.h"
-#include "win_utils.h"
-#include "macosx.h"
-#include "macosxCG.h"
-#include "userinput.h"
-#include "pointer.h"
-#include "xrandr.h"
-
-/*
- * routines for handling incoming, outgoing, etc connections
- */
-
-/* string for the VNC_CONNECT property */
-char vnc_connect_str[VNC_CONNECT_MAX+1];
-Atom vnc_connect_prop = None;
-char x11vnc_remote_str[X11VNC_REMOTE_MAX+1];
-Atom x11vnc_remote_prop = None;
-rfbClientPtr inetd_client = NULL;
-
-int all_clients_initialized(void);
-char *list_clients(void);
-int new_fb_size_clients(rfbScreenInfoPtr s);
-void close_all_clients(void);
-void close_clients(char *str);
-void set_client_input(char *str);
-void set_child_info(void);
-int cmd_ok(char *cmd);
-void client_gone(rfbClientPtr client);
-void client_gone_chat_helper(rfbClientPtr client);
-void reverse_connect(char *str);
-void set_vnc_connect_prop(char *str);
-void read_vnc_connect_prop(int);
-void set_x11vnc_remote_prop(char *str);
-void read_x11vnc_remote_prop(int);
-void check_connect_inputs(void);
-void check_gui_inputs(void);
-rfbClientPtr create_new_client(int sock, int start_thread);
-enum rfbNewClientAction new_client(rfbClientPtr client);
-enum rfbNewClientAction new_client_chat_helper(rfbClientPtr client);
-rfbBool password_check_chat_helper(rfbClientPtr cl, const char* response, int len);
-void start_client_info_sock(char *host_port_cookie);
-void send_client_info(char *str);
-void adjust_grabs(int grab, int quiet);
-void check_new_clients(void);
-int accept_client(rfbClientPtr client);
-void check_ipv6_listen(long usec);
-void check_unix_sock(long usec);
-int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input,
-    int len, FILE *output);
-int check_access(char *addr);
-void client_set_net(rfbClientPtr client);
-char *get_xprop(char *prop, Window win);
-int set_xprop(char *prop, Window win, char *value);
-char *bcx_xattach(char *str, int *pg_init, int *kg_init);
-void grab_state(int *ptr_grabbed, int *kbd_grabbed);
-char *wininfo(Window win, int show_children);
-
-static rfbClientPtr *client_match(char *str);
-static void free_client_data(rfbClientPtr client);
-static void ugly_geom(char *p, int *x, int *y);
-static int ugly_window(char *addr, char *userhost, int X, int Y,
-    int timeout, char *mode, int accept);
-static int action_match(char *action, int rc);
-static void check_connect_file(char *file);
-static void send_client_connect(void);
-
-
-/*
- * check that all clients are in RFB_NORMAL state
- */
-int all_clients_initialized(void) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int ok = 1;
-
-	if (! screen) {
-		return ok;
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (cl->state != RFB_NORMAL) {
-			ok = 0;
-		} else {
-			client_normal_count++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	return ok;
-}
-
-char *list_clients(void) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	char *list, tmp[256];
-	int count = 0;
-
-	if (!screen) {
-		return strdup("");
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		client_set_net(cl);
-		count++;
-	}
-	rfbReleaseClientIterator(iter);
-
-	/*
-	 * each client:
-         * <id>:<ip>:<port>:<user>:<unix>:<hostname>:<input>:<loginview>:<time>,
-	 * 8+1+64+1+5+1+24+1+24+1+256+1+5+1+1+1+10+1
-	 * 123.123.123.123:60000/0x11111111-rw,
-	 * so count+1 * 1000 must cover it.
-	 */
-	list = (char *) malloc((count+1)*1000);
-	
-	list[0] = '\0';
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd = (ClientData *) cl->clientData;
-		char *tmp_host, *p;
-
-		if (! cd) {
-			continue;
-		}
-		if (*list != '\0') {
-			strcat(list, ",");
-		}
-		sprintf(tmp, "0x%x:", cd->uid);
-		strcat(list, tmp);
-		p = tmp_host = strdup(cl->host);
-		while (*p) {
-			if (*p == ':') *p = '#';
-			p++;
-		}
-		strcat(list, tmp_host);
-		free(tmp_host);
-		strcat(list, ":");
-		sprintf(tmp, "%d:", cd->client_port);
-		strcat(list, tmp);
-		if (cd->username[0] == '\0') {
-			char *s = ident_username(cl);
-			if (s) free(s);
-		}
-		if (strstr(cd->username, "UNIX:") == cd->username) {
-			strcat(list, cd->username + strlen("UNIX:"));
-		} else {
-			strcat(list, cd->username);
-		}
-		strcat(list, ":");
-		if (cd->unixname[0] == '\0') {
-			strcat(list, "none");
-		} else {
-			strcat(list, cd->unixname);
-		}
-		strcat(list, ":");
-		p = tmp_host = strdup(cd->hostname);
-		while (*p) {
-			if (*p == ':') *p = '#';
-			p++;
-		}
-		strcat(list, tmp_host);
-		free(tmp_host);
-		strcat(list, ":");
-		strcat(list, cd->input);
-		strcat(list, ":");
-		sprintf(tmp, "%d", cd->login_viewonly);
-		strcat(list, tmp);
-		strcat(list, ":");
-		sprintf(tmp, "%d", (int) cd->login_time);
-		strcat(list, tmp);
-	}
-	rfbReleaseClientIterator(iter);
-	return list;
-}
-
-/* count number of clients supporting NewFBSize */
-int new_fb_size_clients(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int count = 0;
-
-	if (! s) {
-		return 0;
-	}
-
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (cl->useNewFBSize) {
-			count++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-	return count;
-}
-
-void close_all_clients(void) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-
-	if (! screen) {
-		return;
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		rfbCloseClient(cl);
-		rfbClientConnectionGone(cl);
-	}
-	rfbReleaseClientIterator(iter);
-}
-
-static rfbClientPtr *client_match(char *str) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl, *cl_list;
-	int i, n, host_warn = 0, hex_warn = 0;
-
-	n = client_count + 10;
-	cl_list = (rfbClientPtr *) malloc(n * sizeof(rfbClientPtr));
-	
-	i = 0;
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd = (ClientData *) cl->clientData;
-		if (strstr(str, "0x") == str) {
-			unsigned int in;
-			int id;
-			if (! cd) {
-				continue;
-			}
-			if (sscanf(str, "0x%x", &in) != 1) {
-				if (hex_warn++) {
-					continue;
-				}
-				rfbLog("skipping invalid client hex id: %s\n",
-				    str);
-				continue;
-			}
-			id = (unsigned int) in;
-			if (cd->uid == id) {
-				cl_list[i++] = cl;
-			}
-		} else {
-			int port = -1;
-			char *rstr = strdup(str);
-			char *q = strrchr(rstr, ':');
-			if (q) {
-				port = atoi(q+1);
-				*q = '\0';
-				if (port == 0 && q[1] != '0') {
-					port = -1;
-				} else if (port < 0) {
-					port = -port;
-				} else if (port < 200) {
-					port = 5500 + port;
-				}
-			}
-			if (ipv6_ip(str)) {
-				;
-			} else if (! dotted_ip(str, 0)) {
-				char *orig = rstr;
-				rstr = host2ip(rstr);
-				free(orig);
-				if (rstr == NULL || *rstr == '\0') {
-					if (host_warn++) {
-						continue;
-					}
-					rfbLog("skipping bad lookup: \"%s\"\n", str);
-					continue;
-				}
-				rfbLog("lookup: %s -> %s port=%d\n", str, rstr, port);
-			}
-			if (!strcmp(rstr, cl->host)) {
-				int ok = 1;
-				if (port > 0) {
-					if (cd != NULL && cd->client_port > 0) {
-						if (cd->client_port != port) {
-							ok = 0;
-						}
-					} else {
-						int cport = get_remote_port(cl->sock);
-						if (cport != port) {
-							ok = 0;
-						}
-					}
-				}
-				if (ok) {
-					cl_list[i++] = cl;
-				}
-			}
-			free(rstr);
-		}
-		if (i >= n - 1) {
-			break;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	cl_list[i] = NULL;
-
-	return cl_list;
-}
-
-void close_clients(char *str) {
-	rfbClientPtr *cl_list, *cp;
-
-	if (!strcmp(str, "all") || !strcmp(str, "*")) {
-		close_all_clients();
-		return;
-	}
-
-	if (! screen) {
-		return;
-	}
-	
-	cl_list = client_match(str);
-
-	cp = cl_list;
-	while (*cp) {
-		rfbCloseClient(*cp);
-		rfbClientConnectionGone(*cp);
-		cp++;
-	}
-	free(cl_list);
-}
-
-void set_client_input(char *str) {
-	rfbClientPtr *cl_list, *cp;
-	char *p, *val;
-
-	/* str is "match:value" */
-
-	if (! screen) {
-		return;
-	}
-
-	p = strrchr(str, ':');
-	if (! p) {
-		return;
-	}
-	*p = '\0';
-	p++;
-	val = short_kmbcf(p);
-	
-	cl_list = client_match(str);
-
-	cp = cl_list;
-	while (*cp) {
-		ClientData *cd = (ClientData *) (*cp)->clientData;
-		if (! cd) {
-			continue;
-		}
-		cd->input[0] = '\0';
-		strcat(cd->input, "_");
-		strcat(cd->input, val);
-		cp++;
-	}
-
-	free(val);
-	free(cl_list);
-}
-
-void set_child_info(void) {
-	char pid[16];
-	/* set up useful environment for child process */
-	sprintf(pid, "%d", (int) getpid());
-	set_env("X11VNC_PID", pid);
-	if (program_name) {
-		/* e.g. for remote control -R */
-		set_env("X11VNC_PROG", program_name);
-	}
-	if (program_cmdline) {
-		set_env("X11VNC_CMDLINE", program_cmdline);
-	}
-	if (raw_fb_str) {
-		set_env("X11VNC_RAWFB_STR", raw_fb_str);
-	} else {
-		set_env("X11VNC_RAWFB_STR", "");
-	}
-}
-
-int cmd_ok(char *cmd) {
-	char *p, *str;
-	if (no_external_cmds) {
-		return 0;
-	}
-	if (! cmd || cmd[0] == '\0') {
-		return 0;
-	}
-	if (! allowed_external_cmds) {
-		/* default, allow any (overridden by -nocmds) */
-		return 1;
-	}
-
-	str = strdup(allowed_external_cmds);
-	p = strtok(str, ",");
-	while (p) {
-		if (!strcmp(p, cmd)) {
-			free(str);
-			return 1;
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-	return 0;
-}
-
-/*
- * utility to run a user supplied command setting some RFB_ env vars.
- * used by, e.g., accept_client() and client_gone()
- */
-int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input,
-   int len, FILE *output) {
-	char *old_display = NULL;
-	char *addr = NULL;
-	char str[100];
-	int rc, ok;
-	ClientData *cd = NULL;
-	client_set_net(client);
-	if (client != NULL) {
-		cd = (ClientData *) client->clientData;
-		addr = client->host;
-	}
-
-	if (addr == NULL || addr[0] == '\0') {
-		addr = "unknown-host";
-	}
-
-	/* set RFB_CLIENT_ID to semi unique id for command to use */
-	if (cd && cd->uid) {
-		sprintf(str, "0x%x", cd->uid);
-	} else {
-		/* not accepted yet: */
-		sprintf(str, "0x%x", clients_served);
-	}
-	set_env("RFB_CLIENT_ID", str);
-
-	/* set RFB_CLIENT_IP to IP addr for command to use */
-	set_env("RFB_CLIENT_IP", addr);
-
-	/* set RFB_X11VNC_PID to our pid for command to use */
-	sprintf(str, "%d", (int) getpid());
-	set_env("RFB_X11VNC_PID", str);
-
-	if (client == NULL) {
-		;
-	} else if (client->state == RFB_PROTOCOL_VERSION) {
-		set_env("RFB_STATE", "PROTOCOL_VERSION");
-	} else if (client->state == RFB_SECURITY_TYPE) {
-		set_env("RFB_STATE", "SECURITY_TYPE");
-	} else if (client->state == RFB_AUTHENTICATION) {
-		set_env("RFB_STATE", "AUTHENTICATION");
-	} else if (client->state == RFB_INITIALISATION) {
-		set_env("RFB_STATE", "INITIALISATION");
-	} else if (client->state == RFB_NORMAL) {
-		set_env("RFB_STATE", "NORMAL");
-	} else {
-		set_env("RFB_STATE", "UNKNOWN");
-	}
-	if (certret_str) {
-		set_env("RFB_SSL_CLIENT_CERT", certret_str);
-	} else {
-		set_env("RFB_SSL_CLIENT_CERT", "");
-	}
-
-	/* set RFB_CLIENT_PORT to peer port for command to use */
-	if (cd && cd->client_port > 0) {
-		sprintf(str, "%d", cd->client_port);
-	} else if (client) {
-		sprintf(str, "%d", get_remote_port(client->sock));
-	}
-	set_env("RFB_CLIENT_PORT", str);
-
-	set_env("RFB_MODE", mode);
-
-	/* 
-	 * now do RFB_SERVER_IP and RFB_SERVER_PORT (i.e. us!)
-	 * This will establish a 5-tuple (including tcp) the external
-	 * program can potentially use to work out the virtual circuit
-	 * for this connection.
-	 */
-	if (cd && cd->server_ip) {
-		set_env("RFB_SERVER_IP", cd->server_ip);
-	} else if (client) {
-		char *sip = get_local_host(client->sock);
-		set_env("RFB_SERVER_IP", sip);
-		if (sip) free(sip);
-	}
-
-	if (cd && cd->server_port > 0) {
-		sprintf(str, "%d", cd->server_port);
-	} else if (client) {
-		sprintf(str, "%d", get_local_port(client->sock));
-	}
-	set_env("RFB_SERVER_PORT", str);
-
-	if (cd) {
-		sprintf(str, "%d", cd->login_viewonly);
-	} else {
-		sprintf(str, "%d", -1);
-	}
-	set_env("RFB_LOGIN_VIEWONLY", str);
-
-	if (cd) {
-		sprintf(str, "%d", (int) cd->login_time);
-	} else {
-		sprintf(str, ">%d", (int) time(NULL));
-	}
-	set_env("RFB_LOGIN_TIME", str);
-
-	sprintf(str, "%d", (int) time(NULL));
-	set_env("RFB_CURRENT_TIME", str);
-
-	if (!cd || !cd->username || cd->username[0] == '\0') {
-		set_env("RFB_USERNAME", "unknown-user");
-	} else {
-		set_env("RFB_USERNAME", cd->username);
-	}
-	/* 
-	 * Better set DISPLAY to the one we are polling, if they
-	 * want something trickier, they can handle on their own
-	 * via environment, etc. 
-	 */
-	if (getenv("DISPLAY")) {
-		old_display = strdup(getenv("DISPLAY"));
-	}
-
-	if (raw_fb && ! dpy) {	/* raw_fb hack */
-		set_env("DISPLAY", "rawfb");
-	} else {
-		set_env("DISPLAY", DisplayString(dpy));
-	}
-
-	/*
-	 * work out the number of clients (have to use client_count
-	 * since there is deadlock in rfbGetClientIterator) 
-	 */
-	sprintf(str, "%d", client_count);
-	set_env("RFB_CLIENT_COUNT", str);
-
-	/* gone, accept, afteraccept */
-	ok = 0;
-	if (!strcmp(mode, "env")) {
-		return 1;
-	}
-	if (!strcmp(mode, "accept") && cmd_ok("accept")) {
-		ok = 1;
-	}
-	if (!strcmp(mode, "afteraccept") && cmd_ok("afteraccept")) {
-		ok = 1;
-	}
-	if (!strcmp(mode, "gone") && cmd_ok("gone")) {
-		ok = 1;
-	}
-	if (!strcmp(mode, "cmd_verify") && cmd_ok("unixpw")) {
-		ok = 1;
-	}
-	if (!strcmp(mode, "read_passwds") && cmd_ok("passwdfile")) {
-		ok = 1;
-	}
-	if (!strcmp(mode, "custom_passwd") && cmd_ok("custom_passwd")) {
-		ok = 1;
-	}
-	if (no_external_cmds || !ok) {
-		rfbLogEnable(1);
-		rfbLog("cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", cmd);
-		rfbLog("   exiting.\n");
-		clean_up_exit(1);
-	}
-	rfbLog("running command:\n");
-	if (!quiet) {
-		fprintf(stderr, "\n  %s\n\n", cmd);
-	}
-	close_exec_fds();
-
-	if (output != NULL) {
-		FILE *ph;
-		char line[1024];
-		char *cmd2 = NULL;
-		char tmp[] = "/tmp/x11vnc-tmp.XXXXXX";
-		int deltmp = 0;
-
-		if (input != NULL) {
-			int tmp_fd = mkstemp(tmp);
-			if (tmp_fd < 0) {
-				rfbLog("mkstemp failed on: %s\n", tmp);
-				clean_up_exit(1);
-			}
-			write(tmp_fd, input, len);
-			close(tmp_fd);
-			deltmp = 1;
-			cmd2 = (char *) malloc(100 + strlen(tmp) + strlen(cmd));
-			sprintf(cmd2, "/bin/cat %s | %s", tmp, cmd);
-			
-			ph = popen(cmd2, "r");
-		} else {
-			ph = popen(cmd, "r");
-		}
-		if (ph == NULL) {
-			rfbLog("popen(%s) failed", cmd);
-			rfbLogPerror("popen");
-			clean_up_exit(1);
-		}
-		memset(line, 0, sizeof(line));
-		while (fgets(line, sizeof(line), ph) != NULL) {
-			int j, k = -1;
-			if (0) fprintf(stderr, "line: %s", line);
-			/* take care to handle embedded nulls */
-			for (j=0; j < (int) sizeof(line); j++) {
-				if (line[j] != '\0') {
-					k = j;
-				}
-			}
-			if (k >= 0) {
-				write(fileno(output), line, k+1);
-			}
-			memset(line, 0, sizeof(line));
-		}
-
-		rc = pclose(ph);
-
-		if (cmd2 != NULL) {
-			free(cmd2);
-		}
-		if (deltmp) {
-			unlink(tmp);
-		}
-		goto got_rc;
-	} else if (input != NULL) {
-		FILE *ph = popen(cmd, "w");
-		if (ph == NULL) {
-			rfbLog("popen(%s) failed", cmd);
-			rfbLogPerror("popen");
-			clean_up_exit(1);
-		}
-		write(fileno(ph), input, len);
-		rc = pclose(ph);
-		goto got_rc;
-	}
-
-#if LIBVNCSERVER_HAVE_FORK
-	{
-		pid_t pid, pidw;
-		struct sigaction sa, intr, quit;
-		sigset_t omask;
-
-		sa.sa_handler = SIG_IGN;
-		sa.sa_flags = 0;
-		sigemptyset(&sa.sa_mask);
-		sigaction(SIGINT,  &sa, &intr);
-		sigaction(SIGQUIT, &sa, &quit);
-
-		sigaddset(&sa.sa_mask, SIGCHLD);
-		sigprocmask(SIG_BLOCK, &sa.sa_mask, &omask);
-
-		if ((pid = fork()) > 0 || pid == -1) {
-
-			if (pid != -1) {
-				pidw = waitpid(pid, &rc, 0);
-			}
-
-			sigaction(SIGINT,  &intr, (struct sigaction *) NULL);
-			sigaction(SIGQUIT, &quit, (struct sigaction *) NULL);
-			sigprocmask(SIG_SETMASK, &omask, (sigset_t *) NULL);
-
-			if (pid == -1) {
-				fprintf(stderr, "could not fork\n");
-				rfbLogPerror("fork");
-				rc = system(cmd);
-			}
-		} else {
-			/* this should close port 5900, etc.. */
-			int fd;
-			sigaction(SIGINT,  &intr, (struct sigaction *) NULL);
-			sigaction(SIGQUIT, &quit, (struct sigaction *) NULL);
-			sigprocmask(SIG_SETMASK, &omask, (sigset_t *) NULL);
-			for (fd=3; fd<256; fd++) {
-				close(fd);
-			}
-/* XXX test more */
-			if (!strcmp(mode, "gone")) {
-#if LIBVNCSERVER_HAVE_SETSID
-				setsid();
-#else
-				setpgrp();
-#endif
-			}
-			execlp("/bin/sh", "/bin/sh", "-c", cmd, (char *) NULL);
-			exit(1);
-		}
-	}
-#else
-	rc = system(cmd);
-#endif
-	got_rc:
-
-	if (rc >= 256) {
-		rc = rc/256;
-	}
-	rfbLog("command returned: %d\n", rc);
-
-	if (old_display) {
-		set_env("DISPLAY", old_display);
-		free(old_display);
-	}
-
-	return rc;
-}
-
-static void free_client_data(rfbClientPtr client) {
-	if (! client) {
-		return;
-	}
-	if (client->clientData) {
-		ClientData *cd = (ClientData *) client->clientData;
-		if (cd) {
-			if (cd->server_ip) {
-				free(cd->server_ip);
-				cd->server_ip = NULL;
-			}
-			if (cd->hostname) {
-				free(cd->hostname);
-				cd->hostname = NULL;
-			}
-			if (cd->username) {
-				free(cd->username);
-				cd->username = NULL;
-			}
-			if (cd->unixname) {
-				free(cd->unixname);
-				cd->unixname = NULL;
-			}
-		}
-		free(client->clientData);
-		client->clientData = NULL;
-	}
-}
-
-static int accepted_client = 0;
-
-/*
- * callback for when a client disconnects
- */
-void client_gone(rfbClientPtr client) {
-	ClientData *cd = NULL;
-
-	CLIENT_LOCK;
-
-	client_count--;
-	if (client_count < 0) client_count = 0;
-
-	speeds_net_rate_measured = 0;
-	speeds_net_latency_measured = 0;
-
-	rfbLog("client_count: %d\n", client_count);
-	last_client_gone = dnow();
-
-	if (unixpw_in_progress && unixpw_client) {
-		if (client == unixpw_client) {
-			unixpw_in_progress = 0;
-			/* mutex */
-			screen->permitFileTransfer = unixpw_file_xfer_save;
-			if ((tightfilexfer = unixpw_tightvnc_xfer_save)) {
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-				rfbLog("rfbRegisterTightVNCFileTransferExtension: 3\n");
-				rfbRegisterTightVNCFileTransferExtension();
-#endif
-			}
-			unixpw_client = NULL;
-			copy_screen();
-		}
-	}
-
-
-	if (no_autorepeat && client_count == 0) {
-		autorepeat(1, 0);
-	}
-	if (use_solid_bg && client_count == 0) {
-		solid_bg(1);
-	}
-	if ((ncache || ncache0) && client_count == 0) {
-		kde_no_animate(1);
-	}
-	if (client->clientData) {
-		cd = (ClientData *) client->clientData;
-		if (cd->ssl_helper_pid > 0) {
-			int status;
-			rfbLog("sending SIGTERM to ssl_helper_pid: %d\n",
-			    cd->ssl_helper_pid);
-			kill(cd->ssl_helper_pid, SIGTERM);
-			usleep(200*1000);
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID 
-			waitpid(cd->ssl_helper_pid, &status, WNOHANG); 
-#endif
-			ssl_helper_pid(cd->ssl_helper_pid, -1);	/* delete */
-		}
-	}
-	if (gone_cmd && *gone_cmd != '\0') {
-		if (strstr(gone_cmd, "popup") == gone_cmd) {
-			int x = -64000, y = -64000, timeout = 120;
-			char *userhost = ident_username(client);
-			char *addr, *p, *mode;
-
-			/* extract timeout */
-			if ((p = strchr(gone_cmd, ':')) != NULL) {
-				int in;
-				if (sscanf(p+1, "%d", &in) == 1) {
-					timeout = in;
-				}
-			}
-			/* extract geometry */
-			if ((p = strpbrk(gone_cmd, "+-")) != NULL) {
-				ugly_geom(p, &x, &y);
-			}
-
-			/* find mode: mouse, key, or both */
-			if (strstr(gone_cmd, "popupmouse") == gone_cmd) {
-				mode = "mouse_only";
-			} else if (strstr(gone_cmd, "popupkey") == gone_cmd) {
-				mode = "key_only";
-			} else {
-				mode = "both";
-			}
-
-			addr = client->host;
-
-			ugly_window(addr, userhost, x, y, timeout, mode, 0);
-
-			free(userhost);
-		} else {
-			rfbLog("client_gone: using cmd: %s\n", client->host);
-			run_user_command(gone_cmd, client, "gone", NULL, 0, NULL);
-		}
-	}
-
-	free_client_data(client);
-
-	if (inetd && client == inetd_client) {
-		rfbLog("inetd viewer exited.\n");
-		if (gui_pid > 0) {
-			rfbLog("killing gui_pid %d\n", gui_pid);
-			kill(gui_pid, SIGTERM);
-		}
-		clean_up_exit(0);
-	}
-
-	if (connect_once) {
-		/*
-		 * This non-exit is done for a bad passwd to be consistent
-		 * with our RFB_CLIENT_REFUSE behavior in new_client()  (i.e.
-		 * we disconnect after 1 successful connection).
-		 */
-		if ((client->state == RFB_PROTOCOL_VERSION ||
-		     client->state == RFB_SECURITY_TYPE ||
-		     client->state == RFB_AUTHENTICATION ||
-		     client->state == RFB_INITIALISATION) && accepted_client) {
-			rfbLog("connect_once: invalid password or early "
-			   "disconnect.  %d\n", client->state);
-			rfbLog("connect_once: waiting for next connection.\n"); 
-			accepted_client--;
-			if (accepted_client < 0) {
-				accepted_client = 0;
-			}
-			CLIENT_UNLOCK;
-			if (connect_or_exit) {
-				clean_up_exit(1);
-			}
-			return;
-		}
-		if (shared && client_count > 0)  {
-			rfbLog("connect_once: other shared clients still "
-			    "connected, not exiting.\n");
-			CLIENT_UNLOCK;
-			return;
-		}
-
-		rfbLog("viewer exited.\n");
-		if ((client_connect || connect_or_exit) && gui_pid > 0) {
-			rfbLog("killing gui_pid %d\n", gui_pid);
-			kill(gui_pid, SIGTERM);
-		}
-		CLIENT_UNLOCK;
-		clean_up_exit(0);
-	}
-#ifdef MACOSX
-	if (macosx_console && client_count == 0) {
-		macosxCG_refresh_callback_off();
-	}
-#endif
-	CLIENT_UNLOCK;
-}
-
-/*
- * Simple routine to limit access via string compare.  A power user will
- * want to compile libvncserver with libwrap support and use /etc/hosts.allow.
- */
-int check_access(char *addr) {
-	int allowed = 0;
-	int ssl = 0;
-	char *p, *list;
-
-	if (use_openssl || use_stunnel) {
-		ssl = 1;
-	}
-	if (deny_all) {
-		rfbLog("check_access: new connections are currently "
-		    "blocked.\n");
-		return 0;
-	}
-	if (addr == NULL || *addr == '\0') {
-		rfbLog("check_access: denying empty host IP address string.\n");
-		return 0;
-	}
-
-	if (allow_list == NULL) {
-		/* set to "" to possibly append allow_once */
-		allow_list = strdup("");
-	}
-	if (*allow_list == '\0' && allow_once == NULL) {
-		/* no constraints, accept it */
-		return 1;
-	}
-
-	if (strchr(allow_list, '/')) {
-		/* a file of IP addresess or prefixes */
-		int len, len2 = 0;
-		struct stat sbuf;
-		FILE *in;
-		char line[1024], *q;
-
-		if (stat(allow_list, &sbuf) != 0) {
-			rfbLogEnable(1);
-			rfbLog("check_access: failure stating file: %s\n",
-			    allow_list);
-			rfbLogPerror("stat");
-			clean_up_exit(1);
-		}
-		len = sbuf.st_size + 1;	/* 1 more for '\0' at end */
-		if (allow_once) {
-			len2 = strlen(allow_once) + 2;
-			len += len2;
-		}
-		if (ssl) {
-			len2 = strlen("127.0.0.1") + 2;
-			len += len2;
-		}
-		list = (char *) malloc(len);
-		list[0] = '\0';
-		
-		in = fopen(allow_list, "r");
-		if (in == NULL) {
-			rfbLogEnable(1);
-			rfbLog("check_access: cannot open: %s\n", allow_list);
-			rfbLogPerror("fopen");
-			clean_up_exit(1);
-		}
-		while (fgets(line, 1024, in) != NULL) {
-			if ( (q = strchr(line, '#')) != NULL) {
-				*q = '\0';
-			}
-			if (strlen(list) + strlen(line) >=
-			    (size_t) (len - len2)) {
-				/* file grew since our stat() */
-				break;
-			}
-			strcat(list, line);
-		}
-		fclose(in);
-		if (allow_once) {
-			strcat(list, "\n");
-			strcat(list, allow_once);
-			strcat(list, "\n");
-		}
-		if (ssl) {
-			strcat(list, "\n");
-			strcat(list, "127.0.0.1");
-			strcat(list, "\n");
-		}
-	} else {
-		int len = strlen(allow_list) + 1;
-		if (allow_once) {
-			len += strlen(allow_once) + 1;
-		}
-		if (ssl) {
-			len += strlen("127.0.0.1") + 1;
-		}
-		list = (char *) malloc(len);
-		list[0] = '\0';
-		strcat(list, allow_list);
-		if (allow_once) {
-			strcat(list, ",");
-			strcat(list, allow_once);
-		}
-		if (ssl) {
-			strcat(list, ",");
-			strcat(list, "127.0.0.1");
-		}
-	}
-
-	if (allow_once) {
-		free(allow_once);
-		allow_once = NULL;
-	}
-	
-	p = strtok(list, ", \t\n\r");
-	while (p) {
-		char *chk, *q, *r = NULL;
-		if (*p == '\0') {
-			p = strtok(NULL, ", \t\n\r");
-			continue;	
-		}
-		if (ipv6_ip(p)) {
-			chk = p;
-		} else if (! dotted_ip(p, 1)) {
-			r = host2ip(p);
-			if (r == NULL || *r == '\0') {
-				rfbLog("check_access: bad lookup \"%s\"\n", p);
-				p = strtok(NULL, ", \t\n\r");
-				continue;
-			}
-			rfbLog("check_access: lookup %s -> %s\n", p, r);
-			chk = r;
-		} else {
-			chk = p;
-		}
-		if (getenv("X11VNC_DEBUG_ACCESS")) fprintf(stderr, "chk: %s  part: %s  addr: %s\n", chk, p, addr);
-
-		q = strstr(addr, chk);
-		if (ipv6_ip(addr)) {
-			if (!strcmp(chk, "localhost") && !strcmp(addr, "::1")) {
-				rfbLog("check_access: client addr %s is local.\n", addr);
-				allowed = 1;
-			} else if (!strcmp(chk, "::1") && !strcmp(addr, "::1")) {
-				rfbLog("check_access: client addr %s is local.\n", addr);
-				allowed = 1;
-			} else if (!strcmp(chk, "127.0.0.1") && !strcmp(addr, "::1")) {
-				/* this if for host2ip("localhost") */
-				rfbLog("check_access: client addr %s is local.\n", addr);
-				allowed = 1;
-			} else if (q == addr) {
-				rfbLog("check_access: client %s matches pattern %s\n", addr, chk);
-				allowed = 1;
-			}
-		} else if (chk[strlen(chk)-1] != '.') {
-			if (!strcmp(addr, chk)) {
-				if (chk != p) {
-					rfbLog("check_access: client %s " "matches host %s=%s\n", addr, chk, p);
-				} else {
-					rfbLog("check_access: client %s " "matches host %s\n", addr, chk);
-				}
-				allowed = 1;
-			} else if(!strcmp(chk, "localhost") && !strcmp(addr, "127.0.0.1")) {
-				allowed = 1;
-			}
-		} else if (q == addr) {
-			rfbLog("check_access: client %s matches pattern %s\n", addr, chk);
-			allowed = 1;
-		}
-		p = strtok(NULL, ", \t\n\r");
-		if (r) {
-			free(r);
-		}
-		if (allowed) {
-			break;
-		}
-	}
-	free(list);
-	return allowed;
-}
-
-/*
- * x11vnc's first (and only) visible widget: accept/reject dialog window.
- * We go through this pain to avoid dependency on libXt...
- */
-static int ugly_window(char *addr, char *userhost, int X, int Y,
-    int timeout, char *mode, int accept) {
-#if NO_X11
-	if (!addr || !userhost || !X || !Y || !timeout || !mode || !accept) {}
-	RAWFB_RET(0)
-	nox11_exit(1);
-	return 0;
-#else
-
-#define t2x2_width 16
-#define t2x2_height 16
-static unsigned char t2x2_bits[] = {
-   0xff, 0xff, 0xff, 0xff, 0x33, 0x33, 0x33, 0x33, 0xff, 0xff, 0xff, 0xff,
-   0x33, 0x33, 0x33, 0x33, 0xff, 0xff, 0xff, 0xff, 0x33, 0x33, 0x33, 0x33,
-   0xff, 0xff, 0xff, 0xff, 0x33, 0x33, 0x33, 0x33};
-
-	Window awin;
-	GC gc;
-	XSizeHints hints;
-	XGCValues values;
-	static XFontStruct *font_info = NULL;
-	static Pixmap ico = 0;
-	unsigned long valuemask = 0;
-	static char dash_list[] = {20, 40};
-	int list_length = sizeof(dash_list);
-
-	Atom wm_protocols;
-	Atom wm_delete_window;
-
-	XEvent ev;
-	long evmask = ExposureMask | KeyPressMask | ButtonPressMask
-	    | StructureNotifyMask;
-	double waited = 0.0;
-
-	/* strings and geometries y/n */
-	KeyCode key_y, key_n, key_v;
-	char strh[100];
-	char stri[100];
-	char str1_b[] = "To accept: press \"y\" or click the \"Yes\" button";
-	char str2_b[] = "To reject: press \"n\" or click the \"No\" button";
-	char str3_b[] = "View only: press \"v\" or click the \"View\" button";
-	char str1_m[] = "To accept: click the \"Yes\" button";
-	char str2_m[] = "To reject: click the \"No\" button";
-	char str3_m[] = "View only: click the \"View\" button";
-	char str1_k[] = "To accept: press \"y\"";
-	char str2_k[] = "To reject: press \"n\"";
-	char str3_k[] = "View only: press \"v\"";
-	char *str1, *str2, *str3;
-	char str_y[] = "Yes";
-	char str_n[] = "No";
-	char str_v[] = "View";
-	int x, y, w = 345, h = 175, ret = 0;
-	int X_sh = 20, Y_sh = 30, dY = 20;
-	int Ye_x = 20,  Ye_y = 0, Ye_w = 45, Ye_h = 20;
-	int No_x = 75,  No_y = 0, No_w = 45, No_h = 20; 
-	int Vi_x = 130, Vi_y = 0, Vi_w = 45, Vi_h = 20; 
-	char *sprop = "new x11vnc client";
-
-	KeyCode key_o;
-
-	RAWFB_RET(0)
-
-	if (! accept) {
-		sprintf(str_y, "OK");
-		sprop = "x11vnc client disconnected";
-		h = 110;
-		str1 = "";
-		str2 = "";
-		str3 = "";
-	} else if (!strcmp(mode, "mouse_only")) {
-		str1 = str1_m;
-		str2 = str2_m;
-		str3 = str3_m;
-	} else if (!strcmp(mode, "key_only")) {
-		str1 = str1_k;
-		str2 = str2_k;
-		str3 = str3_k;
-		h -= dY;
-	} else {
-		str1 = str1_b;
-		str2 = str2_b;
-		str3 = str3_b;
-	}
-	if (view_only) {
-		h -= dY;
-	}
-
-	/* XXX handle coff_x/coff_y? */
-	if (X < -dpy_x) {
-		x = (dpy_x - w)/2;	/* large negative: center */
-		if (x < 0) x = 0;
-	} else if (X < 0) {
-		x = dpy_x + X - w;	/* from lower right */
-	} else {
-		x = X;			/* from upper left */
-	}
-	
-	if (Y < -dpy_y) {
-		y = (dpy_y - h)/2;
-		if (y < 0) y = 0;
-	} else if (Y < 0) {
-		y = dpy_y + Y - h;
-	} else {
-		y = Y;
-	}
-
-	X_LOCK;
-
-	awin = XCreateSimpleWindow(dpy, window, x, y, w, h, 4,
-	    BlackPixel(dpy, scr), WhitePixel(dpy, scr));
-
-	wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
-	wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-	XSetWMProtocols(dpy, awin, &wm_delete_window, 1);
-
-	if (! ico) {
-		ico = XCreateBitmapFromData(dpy, awin, (char *) t2x2_bits,
-		    t2x2_width, t2x2_height);
-	}
-
-	hints.flags = PPosition | PSize | PMinSize;
-	hints.x = x;
-	hints.y = y;
-	hints.width = w;
-	hints.height = h;
-	hints.min_width = w;
-	hints.min_height = h;
-
-	XSetStandardProperties(dpy, awin, sprop, "x11vnc query", ico, NULL,
-	    0, &hints);
-
-	XSelectInput_wr(dpy, awin, evmask);
-
-	if (! font_info && (font_info = XLoadQueryFont(dpy, "fixed")) == NULL) {
-		rfbLogEnable(1);
-		rfbLog("ugly_window: cannot locate font fixed.\n");
-		X_UNLOCK;
-		clean_up_exit(1);
-	}
-
-	gc = XCreateGC(dpy, awin, valuemask, &values);
-	XSetFont(dpy, gc, font_info->fid);
-	XSetForeground(dpy, gc, BlackPixel(dpy, scr));
-	XSetLineAttributes(dpy, gc, 1, LineSolid, CapButt, JoinMiter);
-	XSetDashes(dpy, gc, 0, dash_list, list_length);
-
-	XMapWindow(dpy, awin);
-	XFlush_wr(dpy);
-
-	if (accept) {
-		char *ip = addr;
-		char *type = "accept";
-		if (unixpw && strstr(userhost, "UNIX:") != userhost) {
-			type = "UNIXPW";
-			if (openssl_last_ip) {
-				ip = openssl_last_ip;
-			}
-		}
-		snprintf(strh, 100, "x11vnc: %s connection from %s?", type, ip);
-	} else {
-		snprintf(strh, 100, "x11vnc: client disconnected from %s", addr);
-	}
-	snprintf(stri, 100, "        (%s)", userhost);
-
-	key_o = XKeysymToKeycode(dpy, XStringToKeysym("o"));
-	key_y = XKeysymToKeycode(dpy, XStringToKeysym("y"));
-	key_n = XKeysymToKeycode(dpy, XStringToKeysym("n"));
-	key_v = XKeysymToKeycode(dpy, XStringToKeysym("v"));
-
-	while (1) {
-		int out = -1, x, y, tw, k;
-
-		if (XCheckWindowEvent(dpy, awin, evmask, &ev)) {
-			;	/* proceed to handling */
-		} else if (XCheckTypedEvent(dpy, ClientMessage, &ev)) {
-			;	/* proceed to handling */
-		} else {
-			int ms = 100;	/* sleep a bit */
-			usleep(ms * 1000);
-			waited += ((double) ms)/1000.;
-			if (timeout && (int) waited >= timeout) {
-				rfbLog("ugly_window: popup timed out after "
-				    "%d seconds.\n", timeout);
-				out = 0;
-				ev.type = 0;
-			} else {
-				continue;
-			}
-		}
-
-		switch(ev.type) {
-		case Expose:
-			while (XCheckTypedEvent(dpy, Expose, &ev)) {
-				;
-			}
-			k=0;
-
-			/* instructions */
-			XDrawString(dpy, awin, gc, X_sh, Y_sh+(k++)*dY,
-			    strh, strlen(strh));
-			XDrawString(dpy, awin, gc, X_sh, Y_sh+(k++)*dY,
-			    stri, strlen(stri));
-			if (accept) {
-			  XDrawString(dpy, awin, gc, X_sh, Y_sh+(k++)*dY,
-			    str1, strlen(str1));
-			  XDrawString(dpy, awin, gc, X_sh, Y_sh+(k++)*dY,
-			    str2, strlen(str2));
-			  if (! view_only) {
-				XDrawString(dpy, awin, gc, X_sh, Y_sh+(k++)*dY,
-				    str3, strlen(str3));
-			  }
-			}
-
-			if (!strcmp(mode, "key_only")) {
-				break;
-			}
-
-			/* buttons */
-			Ye_y = Y_sh+k*dY;
-			No_y = Y_sh+k*dY;
-			Vi_y = Y_sh+k*dY;
-			XDrawRectangle(dpy, awin, gc, Ye_x, Ye_y, Ye_w, Ye_h);
-
-			if (accept) {
-			  XDrawRectangle(dpy, awin, gc, No_x, No_y, No_w, No_h);
-			  if (! view_only) {
-				XDrawRectangle(dpy, awin, gc, Vi_x, Vi_y,
-				    Vi_w, Vi_h);
-			  }
-			}
-
-			tw = XTextWidth(font_info, str_y, strlen(str_y));
-			tw = (Ye_w - tw)/2;
-			if (tw < 0) tw = 1;
-			XDrawString(dpy, awin, gc, Ye_x+tw, Ye_y+Ye_h-5,
-			    str_y, strlen(str_y));
-
-			if (!accept) {
-				break;
-			}
-			tw = XTextWidth(font_info, str_n, strlen(str_n));
-			tw = (No_w - tw)/2;
-			if (tw < 0) tw = 1;
-			XDrawString(dpy, awin, gc, No_x+tw, No_y+No_h-5,
-			    str_n, strlen(str_n));
-
-			if (! view_only) {
-				tw = XTextWidth(font_info, str_v,
-				    strlen(str_v));
-				tw = (Vi_w - tw)/2;
-				if (tw < 0) tw = 1;
-				XDrawString(dpy, awin, gc, Vi_x+tw,
-				    Vi_y+Vi_h-5, str_v, strlen(str_v));
-			}
-
-			break;
-
-		case ClientMessage:
-			if (ev.xclient.message_type == wm_protocols &&
-			    (Atom) ev.xclient.data.l[0] == wm_delete_window) {
-				out = 0;
-			}
-			break;
-
-		case ButtonPress:
-			x = ev.xbutton.x;
-			y = ev.xbutton.y;
-			if (!strcmp(mode, "key_only")) {
-				;
-			} else if (x > Ye_x && x < Ye_x+Ye_w && y > Ye_y
-			    && y < Ye_y+Ye_h) {
-				out = 1;
-			} else if (! accept) {
-				;
-			} else if (x > No_x && x < No_x+No_w && y > No_y
-			    && y < No_y+No_h) {
-				out = 0;
-			} else if (! view_only && x > Vi_x && x < Vi_x+Vi_w
-			    && y > Vi_y && y < Vi_y+Ye_h) {
-				out = 2;
-			}
-			break;
-
-		case KeyPress:
-			if (!strcmp(mode, "mouse_only")) {
-				;
-			} else if (! accept) {
-				if (ev.xkey.keycode == key_o) {
-					out = 1;
-				}
-				if (ev.xkey.keycode == key_y) {
-					out = 1;
-				}
-			} else if (ev.xkey.keycode == key_y) {
-				out = 1;
-				;
-			} else if (ev.xkey.keycode == key_n) {
-				out = 0;
-			} else if (! view_only && ev.xkey.keycode == key_v) {
-				out = 2;
-			}
-			break;
-		default:
-			break;
-		}
-		if (out != -1) {
-			ret = out;
-			XSelectInput_wr(dpy, awin, 0);
-			XUnmapWindow(dpy, awin);
-			XFree_wr(gc);
-			XDestroyWindow(dpy, awin);
-			XFlush_wr(dpy);
-			break;
-		}
-	}
-	X_UNLOCK;
-
-	return ret;
-#endif	/* NO_X11 */
-}
-
-/*
- * process a "yes:0,no:*,view:3" type action list comparing to command
- * return code rc.  * means the default action with no other match.
- */
-static int action_match(char *action, int rc) {
-	char *p, *q, *s = strdup(action);
-	int cases[4], i, result;
-	char *labels[4];
-
-	labels[1] = "yes";
-	labels[2] = "no";
-	labels[3] = "view";
-
-	rfbLog("accept_client: process action line: %s\n",
-	    action);
-
-	for (i=1; i <= 3; i++) {
-		cases[i] = -2;
-	}
-
-	p = strtok(s, ",");
-	while (p) {
-		if ((q = strchr(p, ':')) != NULL) {
-			int in, k = 1;
-			*q = '\0';
-			q++;
-			if (strstr(p, "yes") == p) {
-				k = 1;
-			} else if (strstr(p, "no") == p) {
-				k = 2;
-			} else if (strstr(p, "view") == p) {
-				k = 3;
-			} else {
-				rfbLogEnable(1);
-				rfbLog("invalid action line: %s\n", action);
-				clean_up_exit(1);
-			}
-			if (*q == '*') {
-				cases[k] = -1;
-			} else if (sscanf(q, "%d", &in) == 1) {
-				if (in < 0) {
-					rfbLogEnable(1);
-					rfbLog("invalid action line: %s\n",
-					    action);
-					clean_up_exit(1);
-				}
-				cases[k] = in;
-			} else {
-				rfbLogEnable(1);
-				rfbLog("invalid action line: %s\n", action);
-				clean_up_exit(1);
-			}
-		} else {
-			rfbLogEnable(1);
-			rfbLog("invalid action line: %s\n", action);
-			clean_up_exit(1);
-		}
-		p = strtok(NULL, ",");
-	}
-	free(s);
-
-	result = -1;
-	for (i=1; i <= 3; i++) {
-		if (cases[i] == -1) {
-			rfbLog("accept_client: default action is case=%d %s\n",
-			    i, labels[i]);
-			result = i;
-			break;
-		}
-	}
-	if (result == -1) {
-		rfbLog("accept_client: no default action\n");
-	}
-	for (i=1; i <= 3; i++) {
-		if (cases[i] >= 0 && cases[i] == rc) {
-			rfbLog("accept_client: matched action is case=%d %s\n",
-			    i, labels[i]);
-			result = i;
-			break;
-		}
-	}
-	if (result < 0) {
-		rfbLog("no action match: %s rc=%d set to no\n", action, rc);
-		result = 2;
-	}
-	return result;
-}
-
-static void ugly_geom(char *p, int *x, int *y) {
-	int x1, y1;
-
-	if (sscanf(p, "+%d+%d", &x1, &y1) == 2) {
-		*x = x1;
-		*y = y1;
-	} else if (sscanf(p, "+%d-%d", &x1, &y1) == 2) {
-		*x = x1;
-		*y = -y1;
-	} else if (sscanf(p, "-%d+%d", &x1, &y1) == 2) {
-		*x = -x1;
-		*y = y1;
-	} else if (sscanf(p, "-%d-%d", &x1, &y1) == 2) {
-		*x = -x1;
-		*y = -y1;
-	}
-}
-
-/*
- * Simple routine to prompt the user on the X display whether an incoming
- * client should be allowed to connect or not.  If a gui is involved it
- * will be running in the environment/context of the X11 DISPLAY.
- *
- * The command supplied via -accept is run as is (i.e. no string
- * substitution) with the RFB_CLIENT_IP environment variable set to the
- * incoming client's numerical IP address.
- * 
- * If the external command exits with 0 the client is accepted, otherwise
- * the client is rejected.
- * 
- * Some builtins are provided:
- *
- *	xmessage:  use homebrew xmessage(1) for the external command.  
- *	popup:     use internal X widgets for prompting.
- * 
- */
-int accept_client(rfbClientPtr client) {
-
-	char xmessage[200], *cmd = NULL;
-	char *addr = client->host;
-	char *action = NULL;
-
-	if (accept_cmd == NULL || *accept_cmd == '\0') {
-		return 1;	/* no command specified, so we accept */
-	}
-
-	if (addr == NULL || addr[0] == '\0') {
-		addr = "unknown-host";
-	}
-
-	if (strstr(accept_cmd, "popup") == accept_cmd) {
-		/* use our builtin popup button */
-
-		/* (popup|popupkey|popupmouse)[+-X+-Y][:timeout] */
-
-		int ret, timeout = 120;
-		int x = -64000, y = -64000;
-		char *p, *mode;
-		char *userhost = ident_username(client);
-
-		/* extract timeout */
-		if ((p = strchr(accept_cmd, ':')) != NULL) {
-			int in;
-			if (sscanf(p+1, "%d", &in) == 1) {
-				timeout = in;
-			}
-		}
-		/* extract geometry */
-		if ((p = strpbrk(accept_cmd, "+-")) != NULL) {
-			ugly_geom(p, &x, &y);
-		}
-
-		/* find mode: mouse, key, or both */
-		if (strstr(accept_cmd, "popupmouse") == accept_cmd) {
-			mode = "mouse_only";
-		} else if (strstr(accept_cmd, "popupkey") == accept_cmd) {
-			mode = "key_only";
-		} else {
-			mode = "both";
-		}
-
-		if (dpy == NULL && use_dpy && strstr(use_dpy, "WAIT:") ==
-		    use_dpy) {
-			rfbLog("accept_client: warning allowing client under conditions:\n");
-			rfbLog("  -display WAIT:, dpy == NULL, -accept popup.\n");
-			rfbLog("   There will be another popup.\n");
-			return 1;
-		}
-
-		rfbLog("accept_client: using builtin popup for: %s\n", addr);
-		if ((ret = ugly_window(addr, userhost, x, y, timeout,
-		    mode, 1))) {
-			free(userhost);
-			if (ret == 2) {
-				rfbLog("accept_client: viewonly: %s\n", addr);
-				client->viewOnly = TRUE;
-			}
-			rfbLog("accept_client: popup accepted: %s\n", addr);
-			return 1;
-		} else {
-			free(userhost);
-			rfbLog("accept_client: popup rejected: %s\n", addr);
-			return 0;
-		}
-
-	} else if (!strcmp(accept_cmd, "xmessage")) {
-		/* make our own command using xmessage(1) */
-
-		if (view_only) {
-			sprintf(xmessage, "xmessage -buttons yes:0,no:2 -center"
-			    " 'x11vnc: accept connection from %s?'", addr);
-		} else {
-			sprintf(xmessage, "xmessage -buttons yes:0,no:2,"
-			    "view-only:3 -center" " 'x11vnc: accept connection"
-			    " from %s?'", addr);
-			action = "yes:0,no:*,view:3";
-		}
-		cmd = xmessage;
-		
-	} else {
-		/* use the user supplied command: */
-
-		cmd = accept_cmd;
-
-		/* extract any action prefix:  yes:N,no:M,view:K */
-		if (strstr(accept_cmd, "yes:") == accept_cmd) {
-			char *p;
-			if ((p = strpbrk(accept_cmd, " \t")) != NULL) {
-				int i;
-				cmd = p;
-				p = accept_cmd;
-				for (i=0; i<200; i++) {
-					if (*p == ' ' || *p == '\t') {
-						xmessage[i] = '\0';
-						break;
-					}
-					xmessage[i] = *p;
-					p++;
-				}
-				xmessage[200-1] = '\0';
-				action = xmessage;
-			}
-		}
-	}
-
-	if (cmd) {
-		int rc;
-
-		rfbLog("accept_client: using cmd for: %s\n", addr);
-		rc = run_user_command(cmd, client, "accept", NULL, 0, NULL);
-
-		if (action) {
-			int result;
-
-			if (rc < 0) {
-				rfbLog("accept_client: cannot use negative "
-				    "rc: %d, action %s\n", rc, action);
-				result = 2;
-			} else {
-				result = action_match(action, rc);
-			}
-
-			if (result == 1) {
-				rc = 0;
-			} else if (result == 2) {
-				rc = 1;
-			} else if (result == 3) {
-				rc = 0;
-				rfbLog("accept_client: viewonly: %s\n", addr);
-				client->viewOnly = TRUE;
-			} else {
-				rc = 1;	/* NOTREACHED */
-			}
-		}
-
-		if (rc == 0) {
-			rfbLog("accept_client: accepted: %s\n", addr);
-			return 1;
-		} else {
-			rfbLog("accept_client: rejected: %s\n", addr);
-			return 0;
-		}
-	} else {
-		rfbLog("accept_client: no command, rejecting %s\n", addr);
-		return 0;
-	}
-
-	/* return 0; NOTREACHED */
-}
-
-void check_ipv6_listen(long usec) {
-#if X11VNC_IPV6
-	fd_set fds;
-	struct timeval tv;
-	int nfds, csock = -1, one = 1;
-	struct sockaddr_in6 addr;
-	socklen_t addrlen = sizeof(addr);
-	rfbClientPtr cl;
-	int nmax = 0;
-	char *name;
-
-	if (!ipv6_listen || noipv6) {
-		return;
-	}
-	if (ipv6_listen_fd < 0 && ipv6_http_fd < 0) {
-		return;
-	}
-
-	FD_ZERO(&fds);
-	if (ipv6_listen_fd >= 0) {
-		FD_SET(ipv6_listen_fd, &fds);
-		nmax = ipv6_listen_fd;
-	}
-	if (ipv6_http_fd >= 0 && screen->httpSock < 0) {
-		FD_SET(ipv6_http_fd, &fds);
-		if (ipv6_http_fd > nmax) {
-			nmax = ipv6_http_fd;
-		}
-	}
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-
-	nfds = select(nmax+1, &fds, NULL, NULL, &tv);
-
-	if (nfds <= 0) {
-		return;
-	}
-
-	if (ipv6_listen_fd >= 0 && FD_ISSET(ipv6_listen_fd, &fds)) {
-
-		csock = accept(ipv6_listen_fd, (struct sockaddr *)&addr, &addrlen);
-		if (csock < 0) {
-			rfbLogPerror("check_ipv6_listen: accept");
-			goto err1;
-		}
-#ifdef WIN32
-		unsigned long block=1;
-		if(ioctlsocket(csock, FIONBIO, &block) == SOCKET_ERROR) {
-			errno=WSAGetLastError();
-#else
-		if (fcntl(csock, F_SETFL, O_NONBLOCK) < 0) {
-#endif
-			rfbLogPerror("check_ipv6_listen: fcntl");
-			close(csock);
-			goto err1;
-		}
-		if (setsockopt(csock, IPPROTO_TCP, TCP_NODELAY,
-		    (char *)&one, sizeof(one)) < 0) {
-			rfbLogPerror("check_ipv6_listen: setsockopt");
-			close(csock);
-			goto err1;
-		}
-
-		name = ipv6_getipaddr((struct sockaddr *) &addr, addrlen);
-
-		ipv6_client_ip_str = name;
-		cl = rfbNewClient(screen, csock);
-		ipv6_client_ip_str = NULL;
-		if (cl == NULL) {
-			close(csock);
-			goto err1;
-		}
-
-		if (name) {
-			if (cl->host) {
-				free(cl->host);
-			}
-			cl->host = name;
-			rfbLog("ipv6 client: %s\n", name);
-		}
-	}
-
-	err1:
-
-	if (ipv6_http_fd >= 0 && FD_ISSET(ipv6_http_fd, &fds)) {
-
-		csock = accept(ipv6_http_fd, (struct sockaddr *)&addr, &addrlen);
-		if (csock < 0) {
-			rfbLogPerror("check_ipv6_listen: accept");
-			return;
-		}
-#ifdef WIN32
-		unsigned long block=1;
-		if(ioctlsocket(csock, FIONBIO, &block) == SOCKET_ERROR) {
-			errno=WSAGetLastError();
-#else
-		if (fcntl(csock, F_SETFL, O_NONBLOCK) < 0) {
-#endif
-			rfbLogPerror("check_ipv6_listen: fcntl");
-			close(csock);
-			return;
-		}
-		if (setsockopt(csock, IPPROTO_TCP, TCP_NODELAY,
-		    (char *)&one, sizeof(one)) < 0) {
-			rfbLogPerror("check_ipv6_listen: setsockopt");
-			close(csock);
-			return;
-		}
-
-		rfbLog("check_ipv6_listen: setting httpSock to %d\n", csock);
-		screen->httpSock = csock;
-
-		if (screen->httpListenSock < 0) {
-			/* this may not always work... */
-			int save = screen->httpListenSock;
-			screen->httpListenSock = ipv6_http_fd;	
-			rfbLog("check_ipv6_listen: no httpListenSock, calling rfbHttpCheckFds()\n");
-			rfbHttpCheckFds(screen);
-			screen->httpListenSock = save;	
-		}
-	}
-#endif
-	if (usec) {}
-}
-
-void check_unix_sock(long usec) {
-	fd_set fds;
-	struct timeval tv;
-	int nfds, csock = -1;
-	rfbClientPtr cl;
-	int nmax = 0;
-	char *name;
-
-	if (!unix_sock || unix_sock_fd < 0) {
-		return;
-	}
-
-	FD_ZERO(&fds);
-	if (unix_sock_fd >= 0) {
-		FD_SET(unix_sock_fd, &fds);
-		nmax = unix_sock_fd;
-	}
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-
-	nfds = select(nmax+1, &fds, NULL, NULL, &tv);
-
-	if (nfds <= 0) {
-		return;
-	}
-
-	if (unix_sock_fd >= 0 && FD_ISSET(unix_sock_fd, &fds)) {
-		csock = accept_unix(unix_sock_fd);
-		if (csock < 0) {
-			return;
-		}
-#ifdef WIN32
-		unsigned long block=1;
-		if(ioctlsocket(csock, FIONBIO, &block) == SOCKET_ERROR) {
-			errno=WSAGetLastError();
-#else
-		if (fcntl(csock, F_SETFL, O_NONBLOCK) < 0) {
-#endif
-			rfbLogPerror("check_unix_sock: fcntl");
-			close(csock);
-			return;
-		}
-
-		/* rfbNewClient() will screw us with setsockopt TCP_NODELAY...
-		   you need to comment out in libvncserver/rfbserver.c:
-			rfbLogPerror("setsockopt failed");
-			close(sock);
-			return NULL;
-		 */
-		cl = rfbNewClient(screen, csock);
-
-		if (cl == NULL) {
-			close(csock);
-			return;
-		}
-
-		name = strdup(unix_sock);
-
-		if (name) {
-			if (cl->host) {
-				free(cl->host);
-			}
-			cl->host = name;
-			rfbLog("unix sock client: %s\n", name);
-		}
-	}
-}
-
-/*
- * For the -connect <file> option: periodically read the file looking for
- * a connect string.  If one is found set client_connect to it.
- */
-static void check_connect_file(char *file) {
-	FILE *in;
-	char line[VNC_CONNECT_MAX], host[VNC_CONNECT_MAX];
-	static int first_warn = 1, truncate_ok = 1;
-	static double last_time = 0.0, delay = 0.5; 
-	double now = dnow();
-	struct stat sbuf;
-
-	if (last_time == 0.0) {
-		if (!getenv("X11VNC_APPSHARE_ACTIVE")) {
-			/* skip first */
-			last_time = now;
-		} else {
-			delay = 0.25;
-		}
-	}
-	if (now - last_time < delay) {
-		/* check only about once a second */
-		return;
-	}
-	last_time = now;
-
-	if (! truncate_ok) {
-		/* check if permissions changed */
-		if (access(file, W_OK) == 0) {
-			truncate_ok = 1;
-		} else {
-			return;
-		}
-	}
-
-	if (stat(file, &sbuf) == 0) {
-		/* skip empty file directly */
-		if (sbuf.st_size == 0) {
-			return;
-		}
-	}
-
-	in = fopen(file, "r");
-	if (in == NULL) {
-		if (first_warn) {
-			rfbLog("check_connect_file: fopen failure: %s\n", file);
-			rfbLogPerror("fopen");
-			first_warn = 0;
-		}
-		return;
-	}
-
-	if (fgets(line, VNC_CONNECT_MAX, in) != NULL) {
-		if (sscanf(line, "%s", host) == 1) {
-			if (strlen(host) > 0) {
-				char *str = strdup(host);
-				if (strlen(str) > 38) {
-					char trim[100]; 
-					trim[0] = '\0';
-					strncat(trim, str, 38);
-					rfbLog("read connect file: %s ...\n",
-					    trim);
-				} else {
-					rfbLog("read connect file: %s\n", str);
-				}
-				if (!strcmp(str, "cmd=stop") &&
-				    dnowx() < 3.0) {
-					rfbLog("ignoring stale cmd=stop\n");
-				} else {
-					client_connect = str;
-				}
-			}
-		}
-	}
-	fclose(in);
-
-	/* truncate file */
-	in = fopen(file, "w");
-	if (in != NULL) {
-		fclose(in);
-	} else {
-		/* disable if we cannot truncate */
-		rfbLog("check_connect_file: could not truncate %s, "
-		   "disabling checking.\n", file);
-		truncate_ok = 0;
-	}
-}
-
-static int socks5_proxy(char *host, int port, int sock) {
-	unsigned char buf[512], tmp[2];
-	char reply[512];
-	int len, n, i, j = 0;
-
-	memset(buf, 0, 512);
-	memset(reply, 0, 512);
-
-	buf[0] = 0x5;
-	buf[1] = 0x1;
-	buf[2] = 0x0;
-
-	write(sock, buf, 3);
-
-	n = read(sock, buf, 2);
-
-	if (n != 2) {
-		rfbLog("socks5_proxy: read error: %d\n", n);
-		close(sock);
-		return 0;
-	}
-	if (buf[0] != 0x5 || buf[1] != 0x0) {
-		rfbLog("socks5_proxy: handshake error: %d %d\n", (int) buf[0], (int) buf[1]);
-		close(sock);
-		return 0;
-	}
-
-	buf[0] = 0x5;
-	buf[1] = 0x1;
-	buf[2] = 0x0;
-	buf[3] = 0x3;
-
-	buf[4] = (unsigned char) strlen(host);
-	strcat((char *) buf+5, host); 
-
-	len = 5 + strlen(host);
-
-	buf[len]   = (unsigned char) (port >> 8);
-	buf[len+1] = (unsigned char) (port & 0xff);
-
-	write(sock, buf, len+2);
-
-	for (i=0; i<4; i++) {
-		int n;
-		n = read(sock, tmp, 1);
-		j++;
-		if (n < 0) {
-			if (errno != EINTR) {
-				break;
-			} else {
-				i--;
-				if (j > 100) {
-					break;
-				}
-				continue;
-			}
-		}
-		if (n == 0) {
-			break;
-		}
-		reply[i] = tmp[0];
-	}
-	if (reply[3] == 0x1) {
-		read(sock, reply+4, 4 + 2);
-	} else if (reply[3] == 0x3) {
-		n = read(sock, tmp, 1);
-		reply[4] = tmp[0];
-		read(sock, reply+5, (int) reply[4] + 2);
-	} else if (reply[3] == 0x4) {
-		read(sock, reply+4, 16 + 2);
-	}
-
-	if (0) {
-		int i;
-		for (i=0; i<len+2; i++) {
-			fprintf(stderr, "b[%d]: %d\n", i, (int) buf[i]);
-		}
-		for (i=0; i<len+2; i++) {
-			fprintf(stderr, "r[%d]: %d\n", i, (int) reply[i]);
-		}
-	}
-	if (reply[0] == 0x5 && reply[1] == 0x0 && reply[2] == 0x0) {
-		rfbLog("SOCKS5 connect OK to %s:%d sock=%d\n", host, port, sock);
-		return 1;
-	} else {
-		rfbLog("SOCKS5 error to %s:%d sock=%d\n", host, port, sock);
-		close(sock);
-		return 0;
-	}
-}
-
-static int socks_proxy(char *host, int port, int sock) {
-	unsigned char buf[512], tmp[2];
-	char reply[16];
-	int socks4a = 0, len, i, j = 0, d1, d2, d3, d4;
-
-	memset(buf, 0, 512);
-
-	buf[0] = 0x4;
-	buf[1] = 0x1;
-	buf[2] = (unsigned char) (port >> 8);
-	buf[3] = (unsigned char) (port & 0xff);
-
-
-	if (strlen(host) > 256)  {
-		rfbLog("socks_proxy: hostname too long: %s\n", host);
-		close(sock);
-		return 0;
-	}
-
-	if (!strcmp(host, "localhost") || !strcmp(host, "127.0.0.1")) {
-		buf[4] = 127;
-		buf[5] = 0;
-		buf[6] = 0;
-		buf[7] = 1;
-	} else if (sscanf(host, "%d.%d.%d.%d", &d1, &d2, &d3, &d4) == 4) {
-		buf[4] = (unsigned char) d1;
-		buf[5] = (unsigned char) d2;
-		buf[6] = (unsigned char) d3;
-		buf[7] = (unsigned char) d4;
-	} else {
-		buf[4] = 0x0;
-		buf[5] = 0x0;
-		buf[6] = 0x0;
-		buf[7] = 0x3;
-		socks4a = 1;
-	}
-	len = 8;
-
-	strcat((char *)buf+8, "nobody"); 
-	len += strlen("nobody") + 1;
-
-	if (socks4a) {
-		strcat((char *) buf+8+strlen("nobody") + 1, host);
-		len += strlen(host) + 1;
-	}
-
-	write(sock, buf, len);
-
-	for (i=0; i<8; i++) {
-		int n;
-		n = read(sock, tmp, 1);
-		j++;
-		if (n < 0) {
-			if (errno != EINTR) {
-				break;
-			} else {
-				i--;
-				if (j > 100) {
-					break;
-				}
-				continue;
-			}
-		}
-		if (n == 0) {
-			break;
-		}
-		reply[i] = tmp[0];
-	}
-	if (0) {
-		int i;
-		for (i=0; i<len; i++) {
-			fprintf(stderr, "b[%d]: %d\n", i, (int) buf[i]);
-		}
-		for (i=0; i<8; i++) {
-			fprintf(stderr, "r[%d]: %d\n", i, (int) reply[i]);
-		}
-	}
-	if (reply[0] == 0x0 && reply[1] == 0x5a) {
-		if (socks4a) {
-			rfbLog("SOCKS4a connect OK to %s:%d sock=%d\n", host, port, sock);
-		} else {
-			rfbLog("SOCKS4  connect OK to %s:%d sock=%d\n", host, port, sock);
-		}
-		return 1;
-	} else {
-		if (socks4a) {
-			rfbLog("SOCKS4a error to %s:%d sock=%d\n", host, port, sock);
-		} else {
-			rfbLog("SOCKS4  error to %s:%d sock=%d\n", host, port, sock);
-		}
-		close(sock);
-		return 0;
-	}
-}
-
-#define PXY_HTTP	1
-#define PXY_GET		2
-#define PXY_SOCKS	3
-#define PXY_SOCKS5	4
-#define PXY_SSH		5
-#define PXY 3
-
-static int pxy_get_sock;
-
-static int pconnect(int psock, char *host, int port, int type, char *http_path, char *gethost, int getport) {
-	char reply[4096];
-	int i, ok, len;
-	char *req;
-
-	pxy_get_sock = -1;
-
-	if (type == PXY_SOCKS) {
-		return socks_proxy(host, port, psock);
-	}
-	if (type == PXY_SOCKS5) {
-		return socks5_proxy(host, port, psock);
-	}
-	if (type == PXY_SSH) {
-		return 1;
-	}
-
-	len = strlen("CONNECT ") + strlen(host);
-	if (type == PXY_GET) {
-		len += strlen(http_path) + strlen(gethost);
-		len += strlen("host=") + 1 + strlen("port=") + 1 + 1;
-	}
-	len += 1 + 20 + strlen("HTTP/1.1\r\n") + 1;
-
-	req = (char *)malloc(len);
-
-	if (type == PXY_GET) {
-		int noquery = 0;
-		char *t = strstr(http_path, "__END__");
-		if (t) {
-			noquery = 1;
-			*t = '\0';
-		}
-
-		if (noquery) {
-			sprintf(req, "GET %s HTTP/1.1\r\n", http_path);
-		} else {
-			sprintf(req, "GET %shost=%s&port=%d HTTP/1.1\r\n", http_path, host, port);
-		}
-	} else {
-		sprintf(req, "CONNECT %s:%d HTTP/1.1\r\n", host, port);
-	}
-	rfbLog("http proxy: %s", req);
-	write(psock, req, strlen(req));
-
-	if (type == PXY_GET) {
-		char *t = "Connection: close\r\n";
-		write(psock, t, strlen(t));
-	}
-
-	if (type == PXY_GET) {
-		sprintf(req, "Host: %s:%d\r\n", gethost, getport);
-		rfbLog("http proxy: %s", req);
-		sprintf(req, "Host: %s:%d\r\n\r\n", gethost, getport);
-	} else {
-		sprintf(req, "Host: %s:%d\r\n", host, port);
-		rfbLog("http proxy: %s", req);
-		sprintf(req, "Host: %s:%d\r\n\r\n", host, port);
-	}
-
-	write(psock, req, strlen(req));
-
-	ok = 0;
-	reply[0] = '\0';
-
-	for (i=0; i<4096; i++) {
-		int n;
-		req[0] = req[1] = '\0';
-		n = read(psock, req, 1);
-		if (n < 0) {
-			if (errno != EINTR) {
-				break;
-			} else {
-				continue;
-			}
-		}
-		if (n == 0) {
-			break;
-		}
-		strcat(reply, req);
-		if (strstr(reply, "\r\n\r\n")) {
-			if (strstr(reply, "HTTP/") == reply) {
-				char *q = strchr(reply, ' ');
-				if (q) {
-					q++;
-					if (q[0] == '2' && q[1] == '0' && q[2] == '0' && q[3] == ' ') {
-						ok = 1;
-					}
-				}
-			}
-			break;
-		}
-	}
-
-	if (type == PXY_GET) {
-		char *t1 = strstr(reply, "VNC-IP-Port: ");
-		char *t2 = strstr(reply, "VNC-Host-Port: ");
-		char *s, *newhost = NULL;
-		int newport = 0;
-		fprintf(stderr, "%s\n", reply);
-		if (t1) {
-			t1 += strlen("VNC-IP-Port: ");
-			s = strstr(t1, ":");
-			if (s) {
-				*s = '\0';
-				newhost = strdup(t1);
-				newport = atoi(s+1);
-			}
-		} else if (t2) {
-			t2 += strlen("VNC-Host-Port: ");
-			s = strstr(t2, ":");
-			if (s) {
-				*s = '\0';
-				newhost = strdup(t2);
-				newport = atoi(s+1);
-			}
-		}
-		if (newhost && newport > 0) {
-			rfbLog("proxy GET reconnect to: %s:%d\n", newhost, newport);
-			pxy_get_sock = connect_tcp(newhost, newport);
-		}
-	}
-	free(req);
-
-	return ok;
-}
-
-static int proxy_connect(char *host, int port) {
-	char *p, *q, *str;
-	int i, n, pxy[PXY],pxy_p[PXY];
-	int psock = -1;
-	char *pxy_h[PXY], *pxy_g[PXY];
-
-	if (! connect_proxy) {
-		return -1;
-	}
-	str = strdup(connect_proxy);
-
-	for (i=0; i<PXY; i++) {
-		pxy[i] = 0;
-		pxy_p[i] = 0;
-		pxy_h[i] = NULL;
-		pxy_g[i] = NULL;
-	}
-
-	n = 0;
-	p = str;
-	while (p) {
-		char *hp, *c, *s = NULL;
-
-		q = strchr(p, ',');
-		if (q) {
-			*q = '\0';
-		}
-
-		if (n==0) fprintf(stderr, "\n");
-		rfbLog("proxy_connect[%d]: %s\n", n+1, p);
-
-		pxy[n] = 0;
-		pxy_p[n] = 0;
-		pxy_h[n] = NULL;
-		pxy_g[n] = NULL;
-
-		if (strstr(p, "socks://") == p)	{
-			hp = strstr(p, "://") + 3;
-			pxy[n] = PXY_SOCKS;
-		} else if (strstr(p, "socks4://") == p) {
-			hp = strstr(p, "://") + 3;
-			pxy[n] = PXY_SOCKS;
-		} else if (strstr(p, "socks5://") == p) {
-			hp = strstr(p, "://") + 3;
-			pxy[n] = PXY_SOCKS5;
-		} else if (strstr(p, "ssh://") == p) {
-			if (n != 0) {
-				rfbLog("ssh:// proxy must be the first one\n");
-				clean_up_exit(1);
-			}
-			hp = strstr(p, "://") + 3;
-			pxy[n] = PXY_SSH;
-		} else if (strstr(p, "http://") == p) {
-			hp = strstr(p, "://") + 3;
-			pxy[n] = PXY_HTTP;
-		} else if (strstr(p, "https://") == p) {
-			hp = strstr(p, "://") + 3;
-			pxy[n] = PXY_HTTP;
-		} else {
-			hp = p;
-			pxy[n] = PXY_HTTP;
-		}
-		c = strstr(hp, ":");
-		if (!c && pxy[n] == PXY_SSH) {
-			char *hp2 = (char *) malloc(strlen(hp) + 5);
-			sprintf(hp2, "%s:1", hp);
-			hp = hp2;
-			c = strstr(hp, ":");
-		}
-		if (!c) {
-			pxy[n] = 0;
-			if (q) {
-				*q = ',';
-				p = q + 1;
-			} else {
-				p = NULL;
-			}
-			continue;
-		}
-	
-		if (pxy[n] == PXY_HTTP) {
-			s = strstr(c, "/");
-			if (s) {
-				pxy[n] = PXY_GET;
-				pxy_g[n] = strdup(s);
-				*s = '\0';
-			}
-		}
-		pxy_p[n] = atoi(c+1);
-
-		if (pxy_p[n] <= 0) {
-			pxy[n] = 0;
-			pxy_p[n] = 0;
-			if (q) {
-				*q = ',';
-				p = q + 1;
-			} else {
-				p = NULL;
-			}
-			continue;
-		}
-		*c = '\0';
-		pxy_h[n] = strdup(hp);
-
-		if (++n >= PXY) {
-			break;
-		}
-
-		if (q) {
-			*q = ',';
-			p = q + 1;
-		} else {
-			p = NULL;
-		}
-	}
-	free(str);
-
-	if (!n) {
-		psock = -1;
-		goto pxy_clean;
-	}
-
-	if (pxy[0] == PXY_SSH) {
-		int rc, len = 0;
-		char *cmd, *ssh;
-		int sport = find_free_port(7300, 8000);
-		if (getenv("SSH")) {
-			ssh = getenv("SSH");
-		} else {
-			ssh = "ssh";
-		}
-		len = 200 + strlen(ssh) + strlen(pxy_h[0]) + strlen(host);
-		cmd = (char *) malloc(len);
-		if (n == 1) {
-			if (pxy_p[0] <= 1) {
-				sprintf(cmd, "%s -f       -L '%d:%s:%d' '%s' 'sleep 20'", ssh,           sport, host, port, pxy_h[0]);
-			} else {
-				sprintf(cmd, "%s -f -p %d -L '%d:%s:%d' '%s' 'sleep 20'", ssh, pxy_p[0], sport, host, port, pxy_h[0]);
-			}
-		} else {
-			if (pxy_p[0] <= 1) {
-				sprintf(cmd, "%s -f       -L '%d:%s:%d' '%s' 'sleep 20'", ssh,           sport, pxy_h[1], pxy_p[1], pxy_h[0]);
-			} else {
-				sprintf(cmd, "%s -f -p %d -L '%d:%s:%d' '%s' 'sleep 20'", ssh, pxy_p[0], sport, pxy_h[1], pxy_p[1], pxy_h[0]);
-			}
-		}
-		if (no_external_cmds || !cmd_ok("ssh")) {
-			rfbLogEnable(1);
-			rfbLog("cannot run external commands in -nocmds mode:\n");
-			rfbLog("   \"%s\"\n", cmd);
-			rfbLog("   exiting.\n");
-			clean_up_exit(1);
-		}
-		close_exec_fds();
-		fprintf(stderr, "\n");
-		rfbLog("running: %s\n", cmd);
-		rc = system(cmd);
-		free(cmd);
-		if (rc != 0) {
-			psock = -1;
-			goto pxy_clean;
-		}
-		psock = connect_tcp("localhost", sport);
-
-	} else {
-		psock = connect_tcp(pxy_h[0], pxy_p[0]);
-	}
-
-	if (psock < 0) {
-		psock = -1;
-		goto pxy_clean;
-	}
-	rfbLog("opened socket to proxy: %s:%d\n", pxy_h[0], pxy_p[0]);
-
-	if (n >= 2) {
-		if (! pconnect(psock, pxy_h[1], pxy_p[1], pxy[0], pxy_g[0], pxy_h[0], pxy_p[0])) {
-			close(psock); psock = -1; goto pxy_clean;
-		}
-		if (pxy_get_sock >= 0) {close(psock); psock = pxy_get_sock;}
-		
-		if (n >= 3) {
-			if (! pconnect(psock, pxy_h[2], pxy_p[2], pxy[1], pxy_g[1], pxy_h[1], pxy_p[1])) {
-				close(psock); psock = -1; goto pxy_clean;
-			}
-			if (pxy_get_sock >= 0) {close(psock); psock = pxy_get_sock;}
-			if (! pconnect(psock, host, port, pxy[2], pxy_g[2], pxy_h[2], pxy_p[2])) {
-				close(psock); psock = -1; goto pxy_clean;
-			}
-			if (pxy_get_sock >= 0) {close(psock); psock = pxy_get_sock;}
-			
-		} else {
-			if (! pconnect(psock, host, port, pxy[1], pxy_g[1], pxy_h[1], pxy_p[1])) {
-				close(psock); psock = -1; goto pxy_clean;
-			}
-			if (pxy_get_sock >= 0) {close(psock); psock = pxy_get_sock;}
-		}
-	} else {
-		if (! pconnect(psock, host, port, pxy[0], pxy_g[0], pxy_h[0], pxy_p[0])) {
-			close(psock); psock = -1; goto pxy_clean;
-		}
-		if (pxy_get_sock >= 0) {close(psock); psock = pxy_get_sock;}
-	}
-
-	pxy_clean:
-	for (i=0; i < PXY; i++) {
-		if (pxy_h[i] != NULL) {
-			free(pxy_h[i]);
-		}
-		if (pxy_g[i] != NULL) {
-			free(pxy_g[i]);
-		}
-	}
-
-	return psock;
-}
-
-char *get_repeater_string(char *str, int *len) {
-	int pren, which = 0;
-	int prestring_len = 0;	
-	char *prestring = NULL, *ptmp = NULL;
-	char *equals = strchr(str, '=');
-	char *plus   = strrchr(str, '+');
-
-	*len = 0;
-	if (!plus || !equals) {
-		return NULL;
-	}
-
-	*plus = '\0';
-	if (strstr(str, "repeater=") == str) {
-		/* ultravnc repeater http://www.uvnc.com/addons/repeater.html */
-		prestring_len = 250;
-		ptmp = (char *) calloc(prestring_len+1, 1);
-		snprintf(ptmp, 250, "%s", str + strlen("repeater="));
-		which = 1;
-	} else if (strstr(str, "pre=") == str) {
-		prestring_len = strlen(str + strlen("pre="));
-		ptmp = (char *) calloc(prestring_len+1, 1);
-		snprintf(ptmp, prestring_len+1, "%s", str + strlen("pre="));
-		which = 2;
-	} else if (sscanf(str, "pre%d=", &pren) == 1) {
-		if (pren > 0 && pren <= 16384) {
-			prestring_len = pren;
-			ptmp = (char *) calloc(prestring_len+1, 1);
-			snprintf(prestring, prestring_len, "%s", equals+1);
-			which = 3;
-		}
-	}
-	if (ptmp != NULL) {
-		int i, k = 0;
-		char *p = ptmp;
-		prestring = (char *)calloc(prestring_len+1, 1);
-		/* translate \n to newline, etc. */
-		for (i=0; i < prestring_len; i++) {
-			if (i < prestring_len-1 && *(p+i) == '\\') {
-				if (*(p+i+1) == 'r') {
-					prestring[k++] = '\r'; i++;
-				} else if (*(p+i+1) == 'n') {
-					prestring[k++] = '\n'; i++;
-				} else if (*(p+i+1) == 't') {
-					prestring[k++] = '\t'; i++;
-				} else if (*(p+i+1) == 'a') {
-					prestring[k++] = '\a'; i++;
-				} else if (*(p+i+1) == 'b') {
-					prestring[k++] = '\b'; i++;
-				} else if (*(p+i+1) == 'v') {
-					prestring[k++] = '\v'; i++;
-				} else if (*(p+i+1) == 'f') {
-					prestring[k++] = '\f'; i++;
-				} else if (*(p+i+1) == '\\') {
-					prestring[k++] = '\\'; i++;
-				} else if (*(p+i+1) == 'c') {
-					prestring[k++] = ','; i++;
-				} else {
-					prestring[k++] = *(p+i);
-				}
-			} else {
-				prestring[k++] = *(p+i);
-			}
-		}
-		if (which == 2) {
-			prestring_len = k;
-		}
-		if (!quiet) {
-			rfbLog("-connect prestring: '%s'\n", prestring);
-		}
-		free(ptmp);
-	}
-	*plus = '+';
-
-	*len = prestring_len;
-	return prestring;
-}
-
-#ifndef USE_TIMEOUT_INTERRUPT
-#define USE_TIMEOUT_INTERRUPT 0
-#endif
-
-static void reverse_connect_timeout (int sig) {
-	rfbLog("sig: %d, reverse_connect_timeout.\n", sig);
-#if USE_TIMEOUT_INTERRUPT
-	rfbLog("reverse_connect_timeout proceeding assuming connect(2) interrupt.\n");
-#else
-	clean_up_exit(0);
-#endif
-}
-
-
-/*
- * Do a reverse connect for a single "host" or "host:port"
- */
-
-static int do_reverse_connect(char *str_in) {
-	rfbClientPtr cl;
-	char *host, *p, *str = str_in, *s = NULL;
-	char *prestring = NULL;
-	int prestring_len = 0;
-	int rport = 5500, len = strlen(str);
-	int set_alarm = 0;
-
-	if (len < 1) {
-		return 0;
-	}
-	if (len > 1024) {
-		rfbLog("reverse_connect: string too long: %d bytes\n", len);
-		return 0;
-	}
-	if (!screen) {
-		rfbLog("reverse_connect: screen not setup yet.\n");
-		return 0;
-	}
-	if (unixpw_in_progress) return 0;
-
-	/* look for repeater pre-string */
-	if (strchr(str, '=') && strrchr(str, '+')
-	    && (strstr(str, "pre") == str || strstr(str, "repeater=") == str)) {
-		prestring = get_repeater_string(str, &prestring_len);
-		str = strrchr(str, '+') + 1;
-	} else if (strrchr(str, '+') && strstr(str, "repeater://") == str) {
-		/* repeater://host:port+string */
-		/*   repeater=string+host:port */
-		char *plus = strrchr(str, '+');
-		str = (char *) malloc(strlen(str_in)+1);
-		s = str;
-		*plus = '\0';
-		sprintf(str, "repeater=%s+%s", plus+1, str_in + strlen("repeater://"));
-		prestring = get_repeater_string(str, &prestring_len);
-		str = strrchr(str, '+') + 1;
-		*plus = '+';
-	}
-
-	/* copy in to host */
-	host = (char *) malloc(len+1);
-	if (! host) {
-		rfbLog("reverse_connect: could not malloc string %d\n", len);
-		return 0;
-	}
-	strncpy(host, str, len);
-	host[len] = '\0';
-
-	/* extract port, if any */
-	if ((p = strrchr(host, ':')) != NULL) {
-		rport = atoi(p+1);
-		if (rport < 0) {
-			rport = -rport;
-		} else if (rport < 20) {
-			rport = 5500 + rport;
-		}
-		*p = '\0';
-	}
-
-	if (ipv6_client_ip_str) {
-		free(ipv6_client_ip_str);
-		ipv6_client_ip_str = NULL;
-	}
-
-	if (use_openssl) {
-		int vncsock;
-		if (connect_proxy) {
-			vncsock = proxy_connect(host, rport);
-		} else {
-			vncsock = connect_tcp(host, rport);
-		}
-		if (vncsock < 0) {
-			rfbLog("reverse_connect: failed to connect to: %s\n", str);
-			return 0;
-		}
-		if (prestring != NULL) {
-			write(vncsock, prestring, prestring_len);
-			free(prestring);
-		}
-/* XXX use header */
-#define OPENSSL_REVERSE 6
-		if (!getenv("X11VNC_DISABLE_SSL_CLIENT_MODE")) {
-			openssl_init(1);
-		}
-
-		if (first_conn_timeout > 0) {
-			set_alarm = 1;
-			signal(SIGALRM, reverse_connect_timeout);
-#if USE_TIMEOUT_INTERRUPT
-			siginterrupt(SIGALRM, 1);
-#endif
-			rfbLog("reverse_connect: using alarm() timeout of %d seconds.\n", first_conn_timeout);
-			alarm(first_conn_timeout);
-		}
-		accept_openssl(OPENSSL_REVERSE, vncsock);
-		if (set_alarm) {alarm(0); signal(SIGALRM, SIG_DFL);}
-
-		openssl_init(0);
-		free(host);
-		return 1;
-	}
-
-	if (use_stunnel) {
-		if(strcmp(host, "localhost") && strcmp(host, "127.0.0.1")) {
-			if (!getenv("STUNNEL_DISABLE_LOCALHOST")) {
-				rfbLog("reverse_connect: error host not localhost in -stunnel mode.\n");
-				return 0;
-			}
-		}
-	}
-
-	if (unixpw) {
-		int is_localhost = 0, user_disabled_it = 0;
-
-		if(!strcmp(host, "localhost") || !strcmp(host, "127.0.0.1")) {
-			is_localhost = 1;
-		}
-		if (getenv("UNIXPW_DISABLE_LOCALHOST")) {
-			user_disabled_it = 1;
-		}
-
-		if (! is_localhost) {
-			if (user_disabled_it) {
-				rfbLog("reverse_connect: warning disabling localhost constraint in -unixpw\n");
-			} else {
-				rfbLog("reverse_connect: error not localhost in -unixpw\n");
-				return 0;
-			}
-		}
-	}
-
-	if (first_conn_timeout > 0) {
-		set_alarm = 1;
-		signal(SIGALRM, reverse_connect_timeout);
-#if USE_TIMEOUT_INTERRUPT
-		siginterrupt(SIGALRM, 1);
-#endif
-		rfbLog("reverse_connect: using alarm() timeout of %d seconds.\n", first_conn_timeout);
-		alarm(first_conn_timeout);
-	}
-
-	if (connect_proxy != NULL) {
-		int sock = proxy_connect(host, rport);
-		if (set_alarm) {alarm(0); signal(SIGALRM, SIG_DFL);}
-		if (sock >= 0) {
-			if (prestring != NULL) {
-				write(sock, prestring, prestring_len);
-				free(prestring);
-			}
-			cl = create_new_client(sock, 1);
-		} else {
-			return 0;
-		}
-	} else if (prestring != NULL) {
-		int sock = connect_tcp(host, rport);
-		if (set_alarm) {alarm(0); signal(SIGALRM, SIG_DFL);}
-		if (sock >= 0) {
-			write(sock, prestring, prestring_len);
-			free(prestring);
-			cl = create_new_client(sock, 1);
-		} else {
-			return 0;
-		}
-	} else {
-		cl = rfbReverseConnection(screen, host, rport);
-		if (cl == NULL) {
-			int sock = connect_tcp(host, rport);
-			if (sock >= 0) {
-				cl = create_new_client(sock, 1);
-			}
-		}
-		if (set_alarm) {alarm(0); signal(SIGALRM, SIG_DFL);}
-		if (cl != NULL && use_threads) {
-			cl->onHold = FALSE;
-			rfbStartOnHoldClient(cl);
-		}
-	}
-
-	free(host);
-
-	if (ipv6_client_ip_str) {
-		free(ipv6_client_ip_str);
-		ipv6_client_ip_str = NULL;
-	}
-
-
-	if (cl == NULL) {
-		if (quiet && connect_or_exit) {
-			rfbLogEnable(1);
-		}
-		rfbLog("reverse_connect: %s failed\n", str);
-		return 0;
-	} else {
-		rfbLog("reverse_connect: %s/%s OK\n", str, cl->host);
-		/* let's see if anyone complains: */
-		if (! getenv("X11VNC_REVERSE_CONNECTION_NO_AUTH")) {
-			rfbLog("reverse_connect: turning on auth for %s\n",
-			    cl->host);
-			cl->reverseConnection = FALSE;
-		}
-		return 1;
-	}
-}
-
-/*
- * Break up comma separated list of hosts and call do_reverse_connect()
- */
-void reverse_connect(char *str) {
-	char *p, *tmp;
-	int sleep_between_host = 300;
-	int sleep_min = 1500, sleep_max = 4500, n_max = 5;
-	int n, tot, t, dt = 100, cnt = 0;
-	int nclients0 = client_count;
-	int lcnt, j;
-	char **list;
-	int do_appshare = 0;
-
-	if (!getenv("X11VNC_REVERSE_USE_OLD_SLEEP")) {
-		sleep_min = 500;
-		sleep_max = 2500;
-	}
-
-	if (unixpw_in_progress) return;
-
-	tmp = strdup(str);
-
-	list = (char **) calloc( (strlen(tmp)+2) * sizeof (char *), 1);
-	lcnt = 0;
-
-	p = strtok(tmp, ", \t\r\n");
-	while (p) {
-		list[lcnt++] = strdup(p);
-		p = strtok(NULL, ", \t\r\n");
-	}
-	free(tmp);
-
-	if (subwin && getenv("X11VNC_APPSHARE_ACTIVE")) {
-		do_appshare = 1;
-		sleep_between_host = 0;	/* too agressive??? */
-	}
-	if (getenv("X11VNC_REVERSE_SLEEP_BETWEEN_HOST")) {
-		sleep_between_host = atoi(getenv("X11VNC_REVERSE_SLEEP_BETWEEN_HOST"));
-	}
-
-	if (do_appshare) {
-		if (screen && dpy) {
-			char *s = choose_title(DisplayString(dpy));
-
-			/* mutex */
-			screen->desktopName = s;
-			if (rfb_desktop_name) {
-				free(rfb_desktop_name);
-			}
-			rfb_desktop_name = strdup(s);
-		}
-	}
-
-	for (j = 0; j < lcnt; j++) {
-		p = list[j];
-		
-		if ((n = do_reverse_connect(p)) != 0) {
-			int i;
-			progress_client();
-			for (i=0; i < 3; i++) {
-				rfbPE(-1);
-			}
-		}
-		cnt += n;
-		if (list[j+1] != NULL) {
-			t = 0;
-			while (t < sleep_between_host) {
-				double t1, t2;
-				int i;
-				t1 = dnow();
-				for (i=0; i < 8; i++) {
-					rfbPE(-1);
-					if (do_appshare && t == 0) {
-						rfbPE(-1);
-					}
-				}
-				t2 = dnow();
-				t += (int) (1000 * (t2 - t1));
-				if (t >= sleep_between_host) {
-					break;
-				}
-				usleep(dt * 1000);
-				t += dt;
-			}
-		}
-	}
-
-	for (j = 0; j < lcnt; j++) {
-		p = list[j];
-		if (p) free(p);
-	}
-	free(list);
-
-	if (cnt == 0) {
-		if (connect_or_exit) {
-			rfbLogEnable(1);
-			rfbLog("exiting under -connect_or_exit\n");
-			if (gui_pid > 0) {
-				rfbLog("killing gui_pid %d\n", gui_pid);
-				kill(gui_pid, SIGTERM);
-			}
-			clean_up_exit(1);
-		}
-		if (xrandr || xrandr_maybe) {
-			check_xrandr_event("reverse_connect1");
-		}
-		return;
-	}
-
-	/*
-	 * XXX: we need to process some of the initial handshaking
-	 * events, otherwise the client can get messed up (why??) 
-	 * so we send rfbProcessEvents() all over the place.
-	 *
-	 * How much is this still needed?
-	 */
-
-	n = cnt;
-	if (n >= n_max) {
-		n = n_max; 
-	}
-	t = sleep_max - sleep_min;
-	tot = sleep_min + ((n-1) * t) / (n_max-1);
-
-	if (do_appshare) {
-		tot /= 3;
-		if (tot < dt) {
-			tot = dt;
-		}
-		tot = 0;	/* too agressive??? */
-	}
-
-	if (getenv("X11VNC_REVERSE_SLEEP_MAX")) {
-		tot = atoi(getenv("X11VNC_REVERSE_SLEEP_MAX"));
-	}
-
-	t = 0;
-	while (t < tot) {
-		int i;
-		double t1, t2;
-		t1 = dnow();
-		for (i=0; i < 8; i++) {
-			rfbPE(-1);
-			if (t == 0) rfbPE(-1);
-		}
-		t2 = dnow();
-		t += (int) (1000 * (t2 - t1));
-		if (t >= tot) {
-			break;
-		}
-		usleep(dt * 1000);
-		t += dt;
-	}
-	if (connect_or_exit) {
-		if (client_count <= nclients0)  {
-			for (t = 0; t < 10; t++) {
-				int i;
-				for (i=0; i < 3; i++) {
-					rfbPE(-1);
-				}
-				usleep(100 * 1000);
-			}
-		}
-		if (client_count <= nclients0)  {
-			rfbLogEnable(1);
-			rfbLog("exiting under -connect_or_exit\n");
-			if (gui_pid > 0) {
-				rfbLog("killing gui_pid %d\n", gui_pid);
-				kill(gui_pid, SIGTERM);
-			}
-			clean_up_exit(1);
-		}
-	}
-	if (xrandr || xrandr_maybe) {
-		check_xrandr_event("reverse_connect2");
-	}
-}
-
-/*
- * Routines for monitoring the VNC_CONNECT and X11VNC_REMOTE properties
- * for changes.  The vncconnect(1) will set it on our X display.
- */
-void set_vnc_connect_prop(char *str) {
-	RAWFB_RET_VOID
-#if !NO_X11
-	if (vnc_connect_prop == None) return;
-	XChangeProperty(dpy, rootwin, vnc_connect_prop, XA_STRING, 8,
-	    PropModeReplace, (unsigned char *)str, strlen(str));
-#else
-	if (!str) {}
-#endif	/* NO_X11 */
-}
-
-void set_x11vnc_remote_prop(char *str) {
-	RAWFB_RET_VOID
-#if !NO_X11
-	if (x11vnc_remote_prop == None) return;
-	XChangeProperty(dpy, rootwin, x11vnc_remote_prop, XA_STRING, 8,
-	    PropModeReplace, (unsigned char *)str, strlen(str));
-#else
-	if (!str) {}
-#endif	/* NO_X11 */
-}
-
-void read_vnc_connect_prop(int nomsg) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!nomsg) {}
-	return;
-#else
-	Atom type;
-	int format, slen, dlen;
-	unsigned long nitems = 0, bytes_after = 0;
-	unsigned char* data = NULL;
-	int db = 1;
-
-	vnc_connect_str[0] = '\0';
-	slen = 0;
-
-	if (! vnc_connect || vnc_connect_prop == None) {
-		/* not active or problem with VNC_CONNECT atom */
-		return;
-	}
-	RAWFB_RET_VOID
-
-	/* read the property value into vnc_connect_str: */
-	do {
-		if (XGetWindowProperty(dpy, DefaultRootWindow(dpy),
-		    vnc_connect_prop, nitems/4, VNC_CONNECT_MAX/16, False,
-		    AnyPropertyType, &type, &format, &nitems, &bytes_after,
-		    &data) == Success) {
-
-			dlen = nitems * (format/8);
-			if (slen + dlen > VNC_CONNECT_MAX) {
-				/* too big */
-				rfbLog("warning: truncating large VNC_CONNECT"
-				   " string > %d bytes.\n", VNC_CONNECT_MAX);
-				XFree_wr(data);
-				break;
-			}
-			memcpy(vnc_connect_str+slen, data, dlen);
-			slen += dlen;
-			vnc_connect_str[slen] = '\0';
-			XFree_wr(data);
-		}
-	} while (bytes_after > 0);
-
-	vnc_connect_str[VNC_CONNECT_MAX] = '\0';
-	if (! db || nomsg) {
-		;
-	} else {
-		rfbLog("read VNC_CONNECT: %s\n", vnc_connect_str);
-	}
-#endif	/* NO_X11 */
-}
-
-void read_x11vnc_remote_prop(int nomsg) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!nomsg) {}
-	return;
-#else
-	Atom type;
-	int format, slen, dlen;
-	unsigned long nitems = 0, bytes_after = 0;
-	unsigned char* data = NULL;
-	int db = 1;
-
-	x11vnc_remote_str[0] = '\0';
-	slen = 0;
-
-	if (! vnc_connect || x11vnc_remote_prop == None) {
-		/* not active or problem with X11VNC_REMOTE atom */
-		return;
-	}
-	RAWFB_RET_VOID
-
-	/* read the property value into x11vnc_remote_str: */
-	do {
-		if (XGetWindowProperty(dpy, DefaultRootWindow(dpy),
-		    x11vnc_remote_prop, nitems/4, X11VNC_REMOTE_MAX/16, False,
-		    AnyPropertyType, &type, &format, &nitems, &bytes_after,
-		    &data) == Success) {
-
-			dlen = nitems * (format/8);
-			if (slen + dlen > X11VNC_REMOTE_MAX) {
-				/* too big */
-				rfbLog("warning: truncating large X11VNC_REMOTE"
-				   " string > %d bytes.\n", X11VNC_REMOTE_MAX);
-				XFree_wr(data);
-				break;
-			}
-			memcpy(x11vnc_remote_str+slen, data, dlen);
-			slen += dlen;
-			x11vnc_remote_str[slen] = '\0';
-			XFree_wr(data);
-		}
-	} while (bytes_after > 0);
-
-	x11vnc_remote_str[X11VNC_REMOTE_MAX] = '\0';
-	if (! db || nomsg) {
-		;
-	} else if (strstr(x11vnc_remote_str, "ans=stop:N/A,ans=quit:N/A,ans=")) {
-		;
-	} else if (strstr(x11vnc_remote_str, "qry=stop,quit,exit")) {
-		;
-	} else if (strstr(x11vnc_remote_str, "ack=") == x11vnc_remote_str) {
-		;
-	} else if (quiet && strstr(x11vnc_remote_str, "qry=ping") ==
-	    x11vnc_remote_str) {
-		;
-	} else if (strstr(x11vnc_remote_str, "cmd=") &&
-	    strstr(x11vnc_remote_str, "passwd")) {
-		rfbLog("read X11VNC_REMOTE: *\n");
-	} else if (strlen(x11vnc_remote_str) > 36) {
-		char trim[100]; 
-		trim[0] = '\0';
-		strncat(trim, x11vnc_remote_str, 36);
-		rfbLog("read X11VNC_REMOTE: %s ...\n", trim);
-		
-	} else {
-		rfbLog("read X11VNC_REMOTE: %s\n", x11vnc_remote_str);
-	}
-#endif	/* NO_X11 */
-}
-
-extern int rc_npieces;
-
-void grab_state(int *ptr_grabbed, int *kbd_grabbed) {
-	int rcp, rck;
-	double t0, t1;
-	double ta, tb, tc;
-	*ptr_grabbed = -1;
-	*kbd_grabbed = -1;
-
-	if (!dpy) {
-		return;
-	}
-	*ptr_grabbed = 0;
-	*kbd_grabbed = 0;
-
-#if !NO_X11
-	X_LOCK;
-
-	XSync(dpy, False);
-
-	ta = t0 = dnow();
-
-	rcp = XGrabPointer(dpy, window, False, 0, GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
-	XUngrabPointer(dpy, CurrentTime);
-
-	tb = dnow();
-	
-	rck = XGrabKeyboard(dpy, window, False, GrabModeAsync, GrabModeAsync, CurrentTime);
-	XUngrabKeyboard(dpy, CurrentTime);
-
-	tc = dnow();
-
-	XSync(dpy, False);
-
-	t1 = dnow();
-
-	X_UNLOCK;
-	if (rcp == AlreadyGrabbed || rcp == GrabFrozen) {
-		*ptr_grabbed = 1;
-	}
-	if (rck == AlreadyGrabbed || rck == GrabFrozen) {
-		*kbd_grabbed = 1;
-	}
-	if (rc_npieces < 10) {
-		rfbLog("grab_state: checked %d,%d in %.6f sec (%.6f %.6f)\n",
-		    *ptr_grabbed, *kbd_grabbed, t1-t0, tb-ta, tc-tb);
-	}
-#endif
-}
-
-static void pmove(int x, int y) {
-	if (x < 0 || y < 0) {
-		rfbLog("pmove: skipping negative x or y: %d %d\n", x, y);
-		return;
-	}
-	rfbLog("pmove: x y: %d %d\n", x, y);
-	pointer_event(0, x, y, NULL);
-	X_LOCK;
-	XFlush_wr(dpy);
-	X_UNLOCK;
-}
-
-
-char *bcx_xattach(char *str, int *pg_init, int *kg_init) {
-	int grab_check = 1;
-	int shift = 20;
-	int final_x = 30, final_y = 30;
-	int extra_x = -1, extra_y = -1;
-	int t1, t2, dt = 40 * 1000;
-	int ifneeded = 0;
-	char *dir = "none", *flip = "none", *q;
-	int pg1, kg1, pg2, kg2;
-	char _bcx_res[128];
-	
-	/* str:[up,down,left,right]+nograbcheck+shift=n+final=x+y+extra_move=x+y+[master_to_slave,slave_to_master,M2S,S2M]+dt=n+retry=n+ifneeded */
-
-	if (strstr(str, "up")) {
-		dir = "up";
-	} else if (strstr(str, "down")) {
-		dir = "down";
-	} else if (strstr(str, "left")) {
-		dir = "left";
-	} else if (strstr(str, "right")) {
-		dir = "right";
-	} else {
-		return strdup("FAIL,NO_DIRECTION_SPECIFIED");
-	}
-
-	if (strstr(str, "master_to_slave") || strstr(str, "M2S")) {
-		flip = "M2S";
-	} else if (strstr(str, "slave_to_master") || strstr(str, "S2M")) {
-		flip = "S2M";
-	} else {
-		return strdup("FAIL,NO_MODE_CHANGE_SPECIFIED");
-	}
-
-	if (strstr(str, "nograbcheck")) {
-		grab_check = 0;
-	}
-	if (strstr(str, "ifneeded")) {
-		ifneeded = 1;
-	}
-	q = strstr(str, "shift=");
-	if (q && sscanf(q, "shift=%d", &t1) == 1) {
-		shift = t1;
-	}
-	q = strstr(str, "final=");
-	if (q && sscanf(q, "final=%d+%d", &t1, &t2) == 2) {
-		final_x = t1;
-		final_y = t2;
-	}
-	q = strstr(str, "extra_move=");
-	if (q && sscanf(q, "extra_move=%d+%d", &t1, &t2) == 2) {
-		extra_x = t1;
-		extra_y = t2;
-	}
-	q = strstr(str, "dt=");
-	if (q && sscanf(q, "dt=%d", &t1) == 1) {
-		dt = t1 * 1000;
-	}
-
-	if (grab_check) {
-		int read_init = 0;
-
-		if (*pg_init >=0 && *kg_init >=0)  {
-			pg1 = *pg_init;
-			kg1 = *kg_init;
-			read_init = 1;
-		} else {
-			grab_state(&pg1, &kg1);
-			read_init = 0;
-		}
-
-		if (!strcmp(flip, "M2S")) {
-			if (ifneeded && pg1 == 1 && kg1 == 1) {
-				rfbLog("bcx_xattach: M2S grab state is already what we want, skipping moves:  %d,%d\n", pg1, kg1);
-				return strdup("DONE,GRAB_OK");
-			}
-		} else if (!strcmp(flip, "S2M")) {
-			if (ifneeded && pg1 == 0 && kg1 == 0) {
-				rfbLog("bcx_xattach: S2M grab state is already what we want, skipping moves:  %d,%d\n", pg1, kg1);
-				return strdup("DONE,GRAB_OK");
-			}
-		}
-
-		if (read_init) {
-			;
-		} else if (!strcmp(flip, "M2S")) {
-			if (pg1 != 0 || kg1 != 0) {
-				rfbLog("bcx_xattach: M2S init grab state incorrect:  %d,%d\n", pg1, kg1);
-				usleep(2*dt);
-				grab_state(&pg1, &kg1);
-				rfbLog("bcx_xattach: slept and retried, grab is now: %d,%d\n", pg1, kg1);
-			}
-		} else if (!strcmp(flip, "S2M")) {
-			if (pg1 != 1 || kg1 != 1) {
-				rfbLog("bcx_xattach: S2M init grab state incorrect:  %d,%d\n", pg1, kg1);
-				usleep(2*dt);
-				grab_state(&pg1, &kg1);
-				rfbLog("bcx_xattach: slept and retried, grab is now: %d,%d\n", pg1, kg1);
-			}
-		}
-		if (!read_init) {
-			*pg_init = pg1;
-			*kg_init = kg1;
-		}
-	}
-
-	/*
-	 * A guide for BARCO xattach:
-	 *
-	 *   For -cursor_rule 'b(0):%:t(1),t(1):%:b(0)'
-	 *	down+M2S  up+S2M
-	 *   For -cursor_rule 'r(0):%:l(1),l(1):%:r(0)'
-	 *	right+M2S  left+S2M
-	 *
-	 *   For -cursor_rule 't(0):%:b(1),b(1):%:t(0)'
-	 *	up+M2S  down+S2M
-	 *   For -cursor_rule 'l(0):%:r(1),r(1):%:l(0)'
-	 *	left+M2S  right+S2M
-	 *   For -cursor_rule 'l(0):%:r(1),r(1):%:l(0),r(0):%:l(1),l(1):%:r(0)'
-	 *	left+M2S  right+S2M  (we used to do both 'right')
-	 */
-
-	if (!strcmp(flip, "M2S")) {
-		if (!strcmp(dir, "up")) {
-			pmove(shift, 0);		/* go to top edge */
-			usleep(dt);
-			pmove(shift+1, 0);		/* move 1 for MotionNotify */
-		} else if (!strcmp(dir, "down")) {
-			pmove(shift,   dpy_y-1);	/* go to bottom edge */
-			usleep(dt);
-			pmove(shift+1, dpy_y-1);	/* move 1 for MotionNotify */
-		} else if (!strcmp(dir, "left")) {
-			pmove(0, shift);		/* go to left edge */
-			usleep(dt);
-			pmove(0, shift+1);		/* move 1 for MotionNotify */
-		} else if (!strcmp(dir, "right")) {
-			pmove(dpy_x-1, shift);		/* go to right edge */
-			usleep(dt);
-			pmove(dpy_x-1, shift+1);	/* move 1 for Motion Notify  */
-		}
-	} else if (!strcmp(flip, "S2M")) {
-		int dts = dt/2;
-		if (!strcmp(dir, "up")) {
-			pmove(shift, 2);		/* Approach top edge in 3 moves.  1st move */
-			usleep(dts);
-			pmove(shift, 1);		/* 2nd move */
-			usleep(dts);
-			pmove(shift, 0);		/* 3rd move */
-			usleep(dts);
-			pmove(shift+1, 0);		/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(shift+1, dpy_y-2);	/* go to height-2 for extra pixel (slave y now == 0?) */
-			usleep(dts);
-			pmove(shift,   dpy_y-2);	/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(shift, 1);		/* go to 1 to be sure slave y == 0 */
-			usleep(dts);
-			pmove(shift+1, 1);		/* move 1 for MotionNotify */
-		} else if (!strcmp(dir, "down")) {
-			pmove(shift,   dpy_y-3);	/* Approach bottom edge in 3 moves.  1st move */
-			usleep(dts);
-			pmove(shift,   dpy_y-2);	/* 2nd move */
-			usleep(dts);
-			pmove(shift,   dpy_y-1);	/* 3rd move */
-			usleep(dts);
-			pmove(shift+1, dpy_y-1);	/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(shift+1, 1);		/* go to 1 for extra pixel (slave y now == dpy_y-1?) */
-			usleep(dts);
-			pmove(shift, 1);		/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(shift,   dpy_y-2);	/* go to dpy_y-2 to be sure slave y == dpy_y-1 */
-			usleep(dts);
-			pmove(shift+1, dpy_y-2);	/* move 1 for MotionNotify */
-		} else if (!strcmp(dir, "left")) {
-			pmove(2, shift);		/* Approach left edge in 3 moves.  1st move */
-			usleep(dts);
-			pmove(1, shift);		/* 2nd move */
-			usleep(dts);
-			pmove(0, shift);		/* 3rd move */
-			usleep(dts);
-			pmove(0, shift+1);		/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(dpy_x-2, shift+1);	/* go to width-2 for extra pixel (slave x now == 0?) */
-			usleep(dts);
-			pmove(dpy_x-2, shift);		/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(1, shift);		/* go to 1 to be sure slave x == 0 */
-			usleep(dts);
-			pmove(1, shift+1);		/* move 1 for MotionNotify */
-		} else if (!strcmp(dir, "right")) {
-			pmove(dpy_x-3, shift);		/* Approach right edge in 3 moves.  1st move */
-			usleep(dts);
-			pmove(dpy_x-2, shift);		/* 2nd move */
-			usleep(dts);
-			pmove(dpy_x-1, shift);		/* 3rd move */
-			usleep(dts);
-			pmove(dpy_x-1, shift+1);	/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(1, shift+1);		/* go to 1 to extra pixel (slave x now == dpy_x-1?) */
-			usleep(dts);
-			pmove(1, shift);		/* move 1 for MotionNotify */
-			usleep(dts);
-			pmove(dpy_x-2, shift);		/* go to dpy_x-2 to be sure slave x == dpy_x-1 */
-			usleep(dts);
-			pmove(dpy_x-2, shift+1);	/* move 1 for MotionNotify */
-		}
-	}
-
-	usleep(dt);
-	pmove(final_x, final_y);
-	usleep(dt);
-
-	if (extra_x >= 0 && extra_y >= 0) {
-		pmove(extra_x, extra_y);
-		usleep(dt);
-	}
-
-	strcpy(_bcx_res, "DONE");
-
-	if (grab_check) {
-		char st[64];
-
-		usleep(3*dt);
-		grab_state(&pg2, &kg2);
-
-		if (!strcmp(flip, "M2S")) {
-			if (pg2 != 1 || kg2 != 1) {
-				rfbLog("bcx_xattach: M2S fini grab state incorrect:  %d,%d\n", pg2, kg2);
-				usleep(2*dt);
-				grab_state(&pg2, &kg2);
-				rfbLog("bcx_xattach: slept and retried, grab is now: %d,%d\n", pg2, kg2);
-			}
-		} else if (!strcmp(flip, "S2M")) {
-			if (pg2 != 0 || kg2 != 0) {
-				rfbLog("bcx_xattach: S2M fini grab state incorrect:  %d,%d\n", pg2, kg2);
-				usleep(2*dt);
-				grab_state(&pg2, &kg2);
-				rfbLog("bcx_xattach: slept and retried, grab is now: %d,%d\n", pg2, kg2);
-			}
-		}
-
-		sprintf(st, ":%d,%d-%d,%d", pg1, kg1, pg2, kg2);
-
-		if (getenv("GRAB_CHECK_LOOP")) {
-			int i, n = atoi(getenv("GRAB_CHECK_LOOP"));
-			rfbLog("grab st: %s\n", st);
-			for (i=0; i < n; i++) {
-				usleep(dt);
-				grab_state(&pg2, &kg2);
-				sprintf(st, ":%d,%d-%d,%d", pg1, kg1, pg2, kg2);
-				rfbLog("grab st: %s\n", st);
-			}
-		}
-
-		if (!strcmp(flip, "M2S")) {
-			if (pg1 == 0 && kg1 == 0 && pg2 == 1 && kg2 == 1) {
-				strcat(_bcx_res, ",GRAB_OK");
-			} else {
-				rfbLog("bcx_xattach: M2S grab state incorrect: %d,%d -> %d,%d\n", pg1, kg1, pg2, kg2);
-				strcat(_bcx_res, ",GRAB_FAIL");
-				if (pg2 == 1 && kg2 == 1) {
-					strcat(_bcx_res, "_INIT");
-				} else if (pg1 == 0 && kg1 == 0) {
-					strcat(_bcx_res, "_FINAL");
-				}
-				strcat(_bcx_res, st);
-			}
-		} else if (!strcmp(flip, "S2M")) {
-			if (pg1 == 1 && kg1 == 1 && pg2 == 0 && kg2 == 0) {
-				strcat(_bcx_res, ",GRAB_OK");
-			} else {
-				rfbLog("bcx_xattach: S2M grab state incorrect: %d,%d -> %d,%d\n", pg1, kg1, pg2, kg2);
-				strcat(_bcx_res, ",GRAB_FAIL");
-				if (pg2 == 0 && kg2 == 0) {
-					strcat(_bcx_res, "_INIT");
-				} else if (pg1 == 1 && kg1 == 1) {
-					strcat(_bcx_res, "_FINAL");
-				}
-				strcat(_bcx_res, st);
-			}
-		}
-	}
-	return strdup(_bcx_res);
-}
-
-int set_xprop(char *prop, Window win, char *value) {
-	int rc = -1;
-#if !NO_X11
-	Atom aprop;
-
-	RAWFB_RET(rc)
-
-	if (!prop || !value) {
-		return rc;
-	}
-	if (win == None) {
-		win = rootwin;
-	}
-	aprop = XInternAtom(dpy, prop, False);
-	if (aprop == None) {
-		return rc;
-	}
-	rc = XChangeProperty(dpy, win, aprop, XA_STRING, 8,
-	    PropModeReplace, (unsigned char *)value, strlen(value));
-	return rc;
-#else
-	RAWFB_RET(rc)
-	if (!prop || !win || !value) {}
-	return rc;
-#endif	/* NO_X11 */
-}
-
-char *get_xprop(char *prop, Window win) {
-#if NO_X11
-	RAWFB_RET(NULL)
-	if (!prop || !win) {}
-	return NULL;
-#else
-	Atom type, aprop;
-	int format, slen, dlen;
-	unsigned long nitems = 0, bytes_after = 0;
-	unsigned char* data = NULL;
-	char get_str[VNC_CONNECT_MAX+1];
-
-	RAWFB_RET(NULL)
-
-	if (prop == NULL || !strcmp(prop, "")) {
-		return NULL;
-	}
-	if (win == None) {
-		win = rootwin;
-	}
-	aprop = XInternAtom(dpy, prop, True);
-	if (aprop == None) {
-		return NULL;
-	}
-
-	get_str[0] = '\0';
-	slen = 0;
-
-	/* read the property value into get_str: */
-	do {
-		if (XGetWindowProperty(dpy, win, aprop, nitems/4,
-		    VNC_CONNECT_MAX/16, False, AnyPropertyType, &type,
-		    &format, &nitems, &bytes_after, &data) == Success) {
-
-			dlen = nitems * (format/8);
-			if (slen + dlen > VNC_CONNECT_MAX) {
-				/* too big */
-				rfbLog("get_xprop: warning: truncating large '%s'"
-				   " string > %d bytes.\n", prop, VNC_CONNECT_MAX);
-				XFree_wr(data);
-				break;
-			}
-			memcpy(get_str+slen, data, dlen);
-			slen += dlen;
-			get_str[slen] = '\0';
-			XFree_wr(data);
-		}
-	} while (bytes_after > 0);
-
-	get_str[VNC_CONNECT_MAX] = '\0';
-	rfbLog("get_prop: read: '%s' = '%s'\n", prop, get_str);
-
-	return strdup(get_str);
-#endif	/* NO_X11 */
-}
-
-static char _win_fmt[1000];
-
-static char *win_fmt(Window win, XWindowAttributes a) {
-	memset(_win_fmt, 0, sizeof(_win_fmt));
-	sprintf(_win_fmt, "0x%lx:%dx%dx%d+%d+%d-map:%d-bw:%d-cl:%d-vis:%d-bs:%d/%d",
-	    win, a.width, a.height, a.depth, a.x, a.y, a.map_state, a.border_width, a.class,
-	    (int) ((a.visual)->visualid), a.backing_store, a.save_under);
-	return _win_fmt;
-}
-
-char *wininfo(Window win, int show_children) {
-#if NO_X11
-	RAWFB_RET(NULL)
-	if (!win || !show_children) {}
-	return NULL;
-#else
-	XWindowAttributes attr;
-	int n, size = X11VNC_REMOTE_MAX;
-	char get_str[X11VNC_REMOTE_MAX+1];
-	unsigned int nchildren;
-	Window rr, pr, *children; 
-
-	RAWFB_RET(NULL)
-
-	if (win == None) {
-		return strdup("None");
-	}
-
-	X_LOCK;
-	if (!valid_window(win, &attr, 1)) {
-		X_UNLOCK;
-		return strdup("Invalid");
-	}
-	get_str[0] = '\0';
-
-	if (show_children) {
-		XQueryTree_wr(dpy, win, &rr, &pr, &children, &nchildren);
-	} else {
-		nchildren = 1;
-		children = (Window *) calloc(2 * sizeof(Window), 1);
-		children[0] = win;
-	}
-	for (n=0; n < (int) nchildren; n++) {
-		char tmp[32];
-		char *str = "Invalid";
-		Window w = children[n];
-		if (valid_window(w, &attr, 1)) {
-			if (!show_children) {
-				str = win_fmt(w, attr);
-			} else {
-				sprintf(tmp, "0x%lx", w);
-				str = tmp;
-			}
-		}
-		if ((int) (strlen(get_str) + 1 + strlen(str)) >= size) {
-			break;
-		}
-		if (n > 0) {
-			strcat(get_str, ",");
-		}
-		strcat(get_str, str);
-	}
-	get_str[size] = '\0';
-	if (!show_children) {
-		free(children);
-	} else if (nchildren) {
-		XFree_wr(children);
-	}
-	rfbLog("wininfo computed: %s\n", get_str);
-	X_UNLOCK;
-
-	return strdup(get_str);
-#endif	/* NO_X11 */
-}
-
-/*
- * check if client_connect has been set, if so make the reverse connections.
- */
-static void send_client_connect(void) {
-	if (client_connect != NULL) {
-		char *str = client_connect;
-		if (strstr(str, "cmd=") == str || strstr(str, "qry=") == str) {
-			process_remote_cmd(client_connect, 0);
-		} else if (strstr(str, "ans=") == str
-		    || strstr(str, "aro=") == str) {
-			;
-		} else if (strstr(str, "ack=") == str) {
-			;
-		} else {
-			reverse_connect(client_connect);
-		}
-		free(client_connect);
-		client_connect = NULL;
-	}
-}
-
-/*
- * monitor the various input methods
- */
-void check_connect_inputs(void) {
-
-	if (unixpw_in_progress) return;
-
-	/* flush any already set: */
-	send_client_connect();
-
-	/* connect file: */
-	if (client_connect_file != NULL) {
-		check_connect_file(client_connect_file);		
-	}
-	send_client_connect();
-
-	/* VNC_CONNECT property (vncconnect program) */
-	if (vnc_connect && *vnc_connect_str != '\0') {
-		client_connect = strdup(vnc_connect_str);
-		vnc_connect_str[0] = '\0';
-	}
-	send_client_connect();
-
-	/* X11VNC_REMOTE property */
-	if (vnc_connect && *x11vnc_remote_str != '\0') {
-		client_connect = strdup(x11vnc_remote_str);
-		x11vnc_remote_str[0] = '\0';
-	}
-	send_client_connect();
-}
-
-void check_gui_inputs(void) {
-	int i, gnmax = 0, n = 0, nfds;
-	int socks[ICON_MODE_SOCKS];
-	fd_set fds;
-	struct timeval tv;
-	char buf[X11VNC_REMOTE_MAX+1];
-	ssize_t nbytes;
-
-	if (unixpw_in_progress) return;
-
-	for (i=0; i<ICON_MODE_SOCKS; i++) {
-		if (icon_mode_socks[i] >= 0) {
-			socks[n++] = i;
-			if (icon_mode_socks[i] > gnmax) {
-				gnmax = icon_mode_socks[i];
-			}
-		}
-	}
-
-	if (! n) {
-		return;
-	}
-
-	FD_ZERO(&fds);
-	for (i=0; i<n; i++) {
-		FD_SET(icon_mode_socks[socks[i]], &fds);
-	}
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-
-	nfds = select(gnmax+1, &fds, NULL, NULL, &tv);
-	if (nfds <= 0) {
-		return;
-	}
-	
-	for (i=0; i<n; i++) {
-		int k, fd = icon_mode_socks[socks[i]];
-		char *p;
-		char **list;
-		int lind;
-
-		if (! FD_ISSET(fd, &fds)) {
-			continue;
-		}
-		for (k=0; k<=X11VNC_REMOTE_MAX; k++) {
-			buf[k] = '\0';
-		}
-		nbytes = read(fd, buf, X11VNC_REMOTE_MAX);
-		if (nbytes <= 0) {
-			close(fd);
-			icon_mode_socks[socks[i]] = -1;
-			continue;
-		}
-
-		list = (char **) calloc((strlen(buf)+2) * sizeof(char *), 1);
-
-		lind = 0;
-		p = strtok(buf, "\r\n");
-		while (p) {
-			list[lind++] = strdup(p);
-			p = strtok(NULL, "\r\n");
-		}
-
-		lind = 0;
-		while (list[lind] != NULL) {
-			p = list[lind++];
-			if (strstr(p, "cmd=") == p ||
-			    strstr(p, "qry=") == p) {
-				char *str = process_remote_cmd(p, 1);
-				if (! str) {
-					str = strdup("");
-				}
-				nbytes = write(fd, str, strlen(str));
-				write(fd, "\n", 1);
-				free(str);
-				if (nbytes < 0) {
-					close(fd);
-					icon_mode_socks[socks[i]] = -1;
-					break;
-				}
-			}
-		}
-
-		lind = 0;
-		while (list[lind] != NULL) {
-			p = list[lind++];
-			if (p) free(p);
-		}
-		free(list);
-	}
-}
-
-rfbClientPtr create_new_client(int sock, int start_thread) {
-	rfbClientPtr cl;
-
-	if (!screen) {
-		return NULL;
-	}
-
-	cl = rfbNewClient(screen, sock);
-
-	if (cl == NULL) {
-		return NULL;	
-	}
-	if (use_threads) {
-		cl->onHold = FALSE;
-		if (start_thread) {
-			rfbStartOnHoldClient(cl);
-		}
-	}
-	return cl;
-}
-
-static int turn_off_truecolor = 0;
-
-static void turn_off_truecolor_ad(rfbClientPtr client) {
-	if (client) {}
-	if (turn_off_truecolor) {
-		rfbLog("turning off truecolor advertising.\n");
-		/* mutex */
-		screen->serverFormat.trueColour = FALSE;
-		screen->displayHook = NULL;
-		screen->serverFormat.redShift   = 0;
-		screen->serverFormat.greenShift = 0;
-		screen->serverFormat.blueShift  = 0;
-		screen->serverFormat.redMax     = 0;
-		screen->serverFormat.greenMax   = 0;
-		screen->serverFormat.blueMax    = 0;
-		turn_off_truecolor = 0;
-	}
-}
-
-/*
- * some overrides for the local console text chat.
- * could be useful in general for local helpers.
- */
-
-rfbBool password_check_chat_helper(rfbClientPtr cl, const char* response, int len) {
-	if (response || len) {}
-	if (cl != chat_window_client) {
-		rfbLog("invalid client during chat_helper login\n");
-		return FALSE;
-	} else {
-		if (!cl->host) {
-			rfbLog("empty cl->host during chat_helper login\n");
-			return FALSE;
-		}
-		if (strcmp(cl->host, "127.0.0.1")) {
-			rfbLog("invalid cl->host during chat_helper login: %s\n", cl->host);
-			return FALSE;
-		}
-		rfbLog("chat_helper login accepted\n");
-		return TRUE;
-	}
-}
-
-enum rfbNewClientAction new_client_chat_helper(rfbClientPtr client) {
-	if (client) {}
-	client->clientGoneHook = client_gone_chat_helper;
-	rfbLog("new chat helper\n");
-	return(RFB_CLIENT_ACCEPT);
-}
-
-void client_gone_chat_helper(rfbClientPtr client) {
-	if (client) {}
-	rfbLog("finished chat helper\n");
-	chat_window_client = NULL;
-}
-
-void client_set_net(rfbClientPtr client) {
-	ClientData *cd; 
-	if (client == NULL) {
-		return;
-	}
-	cd = (ClientData *) client->clientData;
-	if (cd == NULL) {
-		return;
-	}
-	if (cd->client_port < 0) {
-		double dt = dnow();
-		cd->client_port = get_remote_port(client->sock);
-		cd->server_port = get_local_port(client->sock);
-		cd->server_ip   = get_local_host(client->sock);
-		cd->hostname = ip2host(client->host);
-		rfbLog("client_set_net: %s  %.4f\n", client->host, dnow() - dt);
-	}
-}
-/*
- * libvncserver callback for when a new client connects
- */
-enum rfbNewClientAction new_client(rfbClientPtr client) {
-	ClientData *cd; 
-
-	CLIENT_LOCK;
-
-	last_event = last_input = time(NULL);
-
-	latest_client = client;
-
-	if (inetd) {
-		/* 
-		 * Set this so we exit as soon as connection closes,
-		 * otherwise client_gone is only called after RFB_CLIENT_ACCEPT
-		 */
-		if (inetd_client == NULL) {
-			inetd_client = client;
-			client->clientGoneHook = client_gone;
-		}
-	}
-
-	clients_served++;
-
-	if (use_openssl || use_stunnel) {
-		if (! ssl_initialized) {
-			rfbLog("denying additional client: %s ssl not setup"
-			    " yet.\n", client->host);
-			CLIENT_UNLOCK;
-			return(RFB_CLIENT_REFUSE);
-		}
-	}
-	if (unixpw_in_progress) {
-		rfbLog("denying additional client: %s during -unixpw login.\n",
-		     client->host);
-		CLIENT_UNLOCK;
-		return(RFB_CLIENT_REFUSE);
-	}
-	if (connect_once) {
-		if (screen->dontDisconnect && screen->neverShared) {
-			if (! shared && accepted_client) {
-				rfbLog("denying additional client: %s:%d\n",
-				     client->host, get_remote_port(client->sock));
-				CLIENT_UNLOCK;
-				return(RFB_CLIENT_REFUSE);
-			}
-		}
-	}
-
-	if (ipv6_client_ip_str != NULL) {
-		rfbLog("renaming client->host from '%s' to '%s'\n",
-		    client->host ? client->host : "", ipv6_client_ip_str);
-		if (client->host) {
-			free(client->host);
-		}
-		client->host = strdup(ipv6_client_ip_str);
-	}
-
-	if (! check_access(client->host)) {
-		rfbLog("denying client: %s does not match %s\n", client->host,
-		    allow_list ? allow_list : "(null)" );
-		CLIENT_UNLOCK;
-		return(RFB_CLIENT_REFUSE);
-	}
-
-	client->clientData = (void *) calloc(sizeof(ClientData), 1);
-	cd = (ClientData *) client->clientData;
-
-	/* see client_set_net() we delay the DNS lookups during handshake */
-	cd->client_port = -1;
-	cd->username = strdup("");
-	cd->unixname = strdup("");
-
-	cd->input[0] = '-';
-	cd->login_viewonly = -1;
-	cd->login_time = time(NULL);
-	cd->ssl_helper_pid = 0;
-
-	if (use_openssl && openssl_last_helper_pid) {
-		cd->ssl_helper_pid = openssl_last_helper_pid;
-		openssl_last_helper_pid = 0;
-	}
-
-	if (! accept_client(client)) {
-		rfbLog("denying client: %s local user rejected connection.\n",
-		    client->host);
-		rfbLog("denying client: accept_cmd=\"%s\"\n",
-		    accept_cmd ? accept_cmd : "(null)" );
-
-		free_client_data(client);
-
-		CLIENT_UNLOCK;
-		return(RFB_CLIENT_REFUSE);
-	}
-
-	/* We will RFB_CLIENT_ACCEPT or RFB_CLIENT_ON_HOLD from here on. */
-
-	if (passwdfile) {
-		if (strstr(passwdfile, "read:") == passwdfile ||
-		    strstr(passwdfile, "cmd:") == passwdfile) {
-			if (read_passwds(passwdfile)) {
-				install_passwds();
-			} else {
-				rfbLog("problem reading: %s\n", passwdfile);
-				clean_up_exit(1);
-			}
-		} else if (strstr(passwdfile, "custom:") == passwdfile) {
-			if (screen) {
-				/* mutex */
-				screen->passwordCheck = custom_passwd_check;
-			}
-		}
-	}
-
-	cd->uid = clients_served;
-
-	client->clientGoneHook = client_gone;
-
-	if (client_count) {
-		speeds_net_rate_measured = 0;
-		speeds_net_latency_measured = 0;
-	}
-	client_count++;
-
-	last_keyboard_input = last_pointer_input = time(NULL);
-
-	if (no_autorepeat && client_count == 1 && ! view_only) {
-		/*
-		 * first client, turn off X server autorepeat
-		 * XXX handle dynamic change of view_only and per-client.
-		 */
-		autorepeat(0, 0);
-	}
-#ifdef MACOSX
-	if (macosx_console && client_count == 1) {
-		macosxCG_refresh_callback_on();
-	}
-#endif
-	if (use_solid_bg && client_count == 1) {
-		solid_bg(0);
-	}
-
-	if (pad_geometry) {
-		install_padded_fb(pad_geometry);
-	}
-
-	cd->timer = last_new_client = dnow();
-	cd->send_cmp_rate = 0.0;
-	cd->send_raw_rate = 0.0;
-	cd->latency = 0.0;
-	cd->cmp_bytes_sent = 0;
-	cd->raw_bytes_sent = 0;
-
-	accepted_client++;
-	rfbLog("incr accepted_client=%d for %s:%d  sock=%d\n", accepted_client,
-	    client->host, get_remote_port(client->sock), client->sock);
-	last_client = time(NULL);
-
-	if (ncache) {
-		check_ncache(1, 0);
-	}
-
-	if (advertise_truecolor && indexed_color) {
-		int rs = 0, gs = 2, bs = 4;
-		int rm = 3, gm = 3, bm = 3;
-		if (bpp >= 24) {
-			rs = 0, gs = 8, bs = 16;
-			rm = 255, gm = 255, bm = 255;
-		} else if (bpp >= 16) {
-			rs = 0, gs = 5, bs = 10;
-			rm = 31, gm = 31, bm = 31;
-		}
-		rfbLog("advertising truecolor.\n");
-		if (getenv("ADVERT_BMSHIFT")) {
-			bm--;
-		}
-
-		if (use_threads) LOCK(client->updateMutex);
-
-		client->format.trueColour = TRUE;
-		client->format.redShift   = rs;
-		client->format.greenShift = gs;
-		client->format.blueShift  = bs;
-		client->format.redMax     = rm;
-		client->format.greenMax   = gm;
-		client->format.blueMax    = bm;
-
-		if (use_threads) UNLOCK(client->updateMutex);
-
-		rfbSetTranslateFunction(client);
-
-		/* mutex */
-		screen->serverFormat.trueColour = TRUE;
-		screen->serverFormat.redShift   = rs;
-		screen->serverFormat.greenShift = gs;
-		screen->serverFormat.blueShift  = bs;
-		screen->serverFormat.redMax     = rm;
-		screen->serverFormat.greenMax   = gm;
-		screen->serverFormat.blueMax    = bm;
-		screen->displayHook = turn_off_truecolor_ad;
-
-		turn_off_truecolor = 1;
-	}
-
-	if (unixpw) {
-		unixpw_in_progress = 1;
-		unixpw_client = client;
-		unixpw_login_viewonly = 0;
-
-		unixpw_file_xfer_save = screen->permitFileTransfer;
-		screen->permitFileTransfer = FALSE;
-		unixpw_tightvnc_xfer_save = tightfilexfer;
-		tightfilexfer = 0;
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-		rfbLog("rfbUnregisterTightVNCFileTransferExtension: 1\n");
-		rfbUnregisterTightVNCFileTransferExtension();
-#endif
-
-		if (client->viewOnly) {
-			unixpw_login_viewonly = 1;
-			client->viewOnly = FALSE;
-		}
-		unixpw_last_try_time = time(NULL) + 10;
-
-		unixpw_screen(1);
-		unixpw_keystroke(0, 0, 1);
-
-		if (!unixpw_in_rfbPE) {
-			rfbLog("new client: %s in non-unixpw_in_rfbPE.\n",
-			     client->host);
-		}
-		CLIENT_UNLOCK;
-		if (!use_threads) {
-			/* always put client on hold even if unixpw_in_rfbPE is true */
-			return(RFB_CLIENT_ON_HOLD);
-		} else {
-			/* unixpw threads is still in testing mode, disabled by default. See UNIXPW_THREADS */
-			return(RFB_CLIENT_ACCEPT);
-		}
-	}
-
-	CLIENT_UNLOCK;
-	return(RFB_CLIENT_ACCEPT);
-}
-
-void start_client_info_sock(char *host_port_cookie) {
-	char *host = NULL, *cookie = NULL, *p;
-	char *str = strdup(host_port_cookie);
-	int i, port, sock, next = -1;
-	static time_t start_time[ICON_MODE_SOCKS];
-	time_t oldest = 0;
-	int db = 0;
-
-	port = -1;
-
-	for (i = 0; i < ICON_MODE_SOCKS; i++) {
-		if (icon_mode_socks[i] < 0) {
-			next = i;
-			break;
-		}
-		if (oldest == 0 || start_time[i] < oldest) {
-			next = i;
-			oldest = start_time[i];
-		}
-	}
-
-	p = strtok(str, ":");
-	i = 0;
-	while (p) {
-		if (i == 0) {
-			host = strdup(p);
-		} else if (i == 1) {
-			port = atoi(p);
-		} else if (i == 2) {
-			cookie = strdup(p);
-		}
-		i++;
-		p = strtok(NULL, ":");
-	}
-	free(str);
-
-	if (db) fprintf(stderr, "%s/%d/%s next=%d\n", host, port, cookie, next);
-
-	if (host && port && cookie) {
-		if (*host == '\0') {
-			free(host);
-			host = strdup("localhost");
-		}
-		sock = connect_tcp(host, port);
-		if (sock < 0) {
-			usleep(200 * 1000);
-			sock = connect_tcp(host, port);
-		}
-		if (sock >= 0) {
-			char *lst = list_clients();
-			icon_mode_socks[next] = sock;
-			start_time[next] = time(NULL);
-			write(sock, "COOKIE:", strlen("COOKIE:"));
-			write(sock, cookie, strlen(cookie));
-			write(sock, "\n", strlen("\n"));
-			write(sock, "none\n", strlen("none\n"));
-			write(sock, "none\n", strlen("none\n"));
-			write(sock, lst, strlen(lst));
-			write(sock, "\n", strlen("\n"));
-			if (db) {
-				fprintf(stderr, "list: %s\n", lst);
-			}
-			free(lst);
-			rfbLog("client_info_sock to: %s:%d\n", host, port);
-		} else {
-			rfbLog("failed client_info_sock: %s:%d\n", host, port);
-		}
-	} else {
-		rfbLog("malformed client_info_sock: %s\n", host_port_cookie);	
-	}
-
-	if (host) free(host);
-	if (cookie) free(cookie);
-}
-
-void send_client_info(char *str) {
-	int i;
-	static char *pstr = NULL;
-	static int len = 128; 
-
-	if (!str || strlen(str) == 0) {
-		return;
-	}
-
-	if (!pstr)  {
-		pstr = (char *)malloc(len);
-	}
-	if (strlen(str) + 2 > (size_t) len) {
-		free(pstr);
-		len *= 2;
-		pstr = (char *)malloc(len);
-	}
-	strcpy(pstr, str);
-	strcat(pstr, "\n");
-
-	if (icon_mode_fh) {
-		if (0) fprintf(icon_mode_fh, "\n");
-		fprintf(icon_mode_fh, "%s", pstr);
-		fflush(icon_mode_fh);
-	}
-
-	for (i=0; i<ICON_MODE_SOCKS; i++) {
-		int len, n, sock = icon_mode_socks[i];
-		char *buf = pstr;
-
-		if (sock < 0) {
-			continue;
-		}
-
-		len = strlen(pstr);
-		while (len > 0) {
-			if (0) write(sock, "\n", 1);
-			n = write(sock, buf, len);
-			if (n > 0) {
-				buf += n;
-				len -= n;
-				continue;
-			}
-
-			if (n < 0 && errno == EINTR) {
-				continue;
-			}
-			close(sock);
-			icon_mode_socks[i] = -1;
-			break;
-		}
-	}
-}
-
-void adjust_grabs(int grab, int quiet) {
-	RAWFB_RET_VOID
-#if NO_X11
-	if (!grab || !quiet) {}
-	return;
-#else
-	/* n.b. caller decides to X_LOCK or not. */
-	if (grab) {
-		if (grab_kbd) {
-			if (! quiet) {
-				rfbLog("grabbing keyboard with XGrabKeyboard\n");
-			}
-			XGrabKeyboard(dpy, window, False, GrabModeAsync,
-			    GrabModeAsync, CurrentTime);
-		}
-		if (grab_ptr) {
-			if (! quiet) {
-				rfbLog("grabbing pointer with XGrabPointer\n");
-			}
-			XGrabPointer(dpy, window, False, 0, GrabModeAsync,
-			    GrabModeAsync, None, None, CurrentTime);
-		}
-	} else {
-		if (grab_kbd) {
-			if (! quiet) {
-				rfbLog("ungrabbing keyboard with XUngrabKeyboard\n");
-			}
-			XUngrabKeyboard(dpy, CurrentTime);
-		}
-		if (grab_ptr) {
-			if (! quiet) {
-				rfbLog("ungrabbing pointer with XUngrabPointer\n");
-			}
-			XUngrabPointer(dpy, CurrentTime);
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-void check_new_clients(void) {
-	static int last_count = -1;
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int i, send_info = 0;
-	int run_after_accept = 0;
-
-	if (unixpw_in_progress) {
-		static double lping = 0.0;
-		if (lping < dnow() + 5) {
-			mark_rect_as_modified(0, 0, 1, 1, 1);
-			lping = dnow();
-		}
-		if (unixpw_client && unixpw_client->viewOnly) {
-			unixpw_login_viewonly = 1;
-			unixpw_client->viewOnly = FALSE;
-		}
-		if (time(NULL) > unixpw_last_try_time + 45) {
-			rfbLog("unixpw_deny: timed out waiting for reply.\n");
-			unixpw_deny();
-		}
-		return;
-	}
-
-	if (grab_always) {
-		;
-	} else if (grab_kbd || grab_ptr) {
-		static double last_force = 0.0;
-		if (client_count != last_count || dnow() > last_force + 0.25) {
-			int q = (client_count == last_count);
-			last_force = dnow();
-			X_LOCK;
-			if (client_count) {
-				adjust_grabs(1, q);
-			} else {
-				adjust_grabs(0, q);
-			}
-			X_UNLOCK;
-		}
-	}
-	
-	if (last_count == -1) {
-		last_count = 0;
-	} else if (client_count == last_count) {
-		return;
-	}
-
-	if (! all_clients_initialized()) {
-		return;
-	}
-
-	if (client_count > last_count) {
-		if (afteraccept_cmd != NULL && afteraccept_cmd[0] != '\0') {
-			run_after_accept = 1;
-		}
-	}
-
-	last_count = client_count;
-
-	if (! screen) {
-		return;
-	}
-
-	if (! client_count) {
-		send_client_info("clients:none");
-		return;
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd = (ClientData *) cl->clientData;
-		char *s;
-
-		client_set_net(cl);
-		if (! cd) {
-			continue;
-		}
-
-		if (cd->login_viewonly < 0) {
-			/* this is a general trigger to initialize things */
-			if (cl->viewOnly) {
-				cd->login_viewonly = 1;
-				s = allowed_input_view_only;
-				if (s && cd->input[0] == '-') {
-					cl->viewOnly = FALSE;
-					cd->input[0] = '\0';
-					strncpy(cd->input, s, CILEN);
-				}
-			} else {
-				cd->login_viewonly = 0;
-				s = allowed_input_normal;
-				if (s && cd->input[0] == '-') {
-					cd->input[0] = '\0';
-					strncpy(cd->input, s, CILEN);
-				}
-			}
-			if (run_after_accept) {
-				run_user_command(afteraccept_cmd, cl,
-				    "afteraccept", NULL, 0, NULL);
-			}
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (icon_mode_fh) {
-		send_info++;
-	}
-	for (i = 0; i < ICON_MODE_SOCKS; i++) {
-		if (send_info || icon_mode_socks[i] >= 0) {
-			send_info++;
-			break;
-		}
-	}
-	if (send_info) {
-		char *str, *s = list_clients();
-		str = (char *) malloc(strlen("clients:") + strlen(s) + 1);
-		sprintf(str, "clients:%s", s);
-		send_client_info(str);
-		free(str);
-		free(s);
-	}
-}
-
diff --git a/ica/x11/x11vnc/connections.h b/ica/x11/x11vnc/connections.h
deleted file mode 100644
index 3bdeffb..0000000
--- a/ica/x11/x11vnc/connections.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_CONNECTIONS_H
-#define _X11VNC_CONNECTIONS_H
-
-/* -- connections.h -- */
-
-extern char vnc_connect_str[];
-extern Atom vnc_connect_prop;
-extern char x11vnc_remote_str[];
-extern Atom x11vnc_remote_prop;
-extern rfbClientPtr inetd_client;
-
-
-extern int all_clients_initialized(void);
-extern char *list_clients(void);
-extern int new_fb_size_clients(rfbScreenInfoPtr s);
-extern void close_all_clients(void);
-extern void close_clients(char *str);
-extern void set_client_input(char *str);
-extern void set_child_info(void);
-extern int cmd_ok(char *cmd);
-extern void client_gone(rfbClientPtr client);
-extern void client_gone_chat_helper(rfbClientPtr client);
-extern void reverse_connect(char *str);
-extern void set_vnc_connect_prop(char *str);
-extern void read_vnc_connect_prop(int);
-extern void set_x11vnc_remote_prop(char *str);
-extern void read_x11vnc_remote_prop(int);
-extern void check_connect_inputs(void);
-extern void check_gui_inputs(void);
-extern rfbClientPtr create_new_client(int sock, int start_thread);
-extern enum rfbNewClientAction new_client(rfbClientPtr client);
-extern enum rfbNewClientAction new_client_chat_helper(rfbClientPtr client);
-extern rfbBool password_check_chat_helper(rfbClientPtr cl, const char* response, int len);
-extern void start_client_info_sock(char *host_port_cookie);
-extern void send_client_info(char *str);
-extern void adjust_grabs(int grab, int quiet);
-extern void check_new_clients(void);
-extern int accept_client(rfbClientPtr client);
-extern void check_ipv6_listen(long usec);
-extern void check_unix_sock(long usec);
-extern int run_user_command(char *cmd, rfbClientPtr client, char *mode, char *input,
-    int len, FILE *output);
-extern int check_access(char *addr);
-extern void client_set_net(rfbClientPtr client);
-extern char *get_xprop(char *prop, Window win);
-extern int set_xprop(char *prop, Window win, char *value);
-extern char *bcx_xattach(char *str, int *pg_init, int *kg_init);
-extern void grab_state(int *ptr_grabbed, int *kbd_grabbed);
-extern char *wininfo(Window win, int show_children);
-
-#endif /* _X11VNC_CONNECTIONS_H */
diff --git a/ica/x11/x11vnc/cursor.c b/ica/x11/x11vnc/cursor.c
deleted file mode 100644
index 3d613a6..0000000
--- a/ica/x11/x11vnc/cursor.c
+++ /dev/null
@@ -1,2025 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- cursor.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "cleanup.h"
-#include "screen.h"
-#include "scan.h"
-#include "unixpw.h"
-#include "macosx.h"
-
-int xfixes_present = 0;
-int xfixes_first_initialized = 0;
-int use_xfixes = 1;
-int got_xfixes_cursor_notify = 0;
-int cursor_changes = 0;
-int alpha_threshold = 240;
-double alpha_frac = 0.33;
-int alpha_remove = 0;
-int alpha_blend = 1;
-int alt_arrow = 1;
-
-
-void first_cursor(void);
-void setup_cursors_and_push(void);
-void initialize_xfixes(void);
-int known_cursors_mode(char *s);
-void initialize_cursors_mode(void);
-int get_which_cursor(void);
-void restore_cursor_shape_updates(rfbScreenInfoPtr s);
-void disable_cursor_shape_updates(rfbScreenInfoPtr s);
-int cursor_shape_updates_clients(rfbScreenInfoPtr s);
-int cursor_pos_updates_clients(rfbScreenInfoPtr s);
-void cursor_position(int x, int y);
-void set_no_cursor(void);
-void set_warrow_cursor(void);
-int set_cursor(int x, int y, int which);
-int check_x11_pointer(void);
-int store_cursor(int serial, unsigned long *data, int w, int h, int cbpp, int xhot, int yhot);
-unsigned long get_cursor_serial(int mode);
-
-
-typedef struct win_str_info {
-	char *wm_name;
-	char *res_name;
-	char *res_class;
-} win_str_info_t;
-
-typedef struct cursor_info {
-	char *data;	/* data and mask pointers */
-	char *mask;
-	int wx, wy;	/* size of cursor */
-	int sx, sy;	/* shift to its centering point */
-	int reverse;	/* swap black and white */
-	rfbCursorPtr rfb;
-} cursor_info_t;
-
-
-static void curs_copy(cursor_info_t *dest, cursor_info_t *src);
-static void setup_cursors(void);
-static void set_rfb_cursor(int which);
-static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo);
-static rfbCursorPtr pixels2curs(unsigned long *pixels, int w, int h,
-    int xhot, int yhot, int Bpp);
-static int get_exact_cursor(int init);
-static void set_cursor_was_changed(rfbScreenInfoPtr s);
-
-
-/*
- * Here begins a bit of a mess to experiment with multiple cursors 
- * drawn on the remote background ...
- */
-static void curs_copy(cursor_info_t *dest, cursor_info_t *src) {
-	if (src->data != NULL) {
-		dest->data = strdup(src->data);
-	} else {
-		dest->data = NULL;
-	}
-	if (src->mask != NULL) {
-		dest->mask = strdup(src->mask);
-	} else {
-		dest->mask = NULL;
-	}
-	dest->wx = src->wx;
-	dest->wy = src->wy;
-	dest->sx = src->sx;
-	dest->sy = src->sy;
-	dest->reverse = src->reverse;
-	dest->rfb = src->rfb;
-
-	if (rotating && rotating_cursors && dest->data != NULL) {
-		int tx, ty;
-		rotate_curs(dest->data, src->data, src->wx, src->wy, 1);
-		rotate_curs(dest->mask, src->mask, src->wx, src->wy, 1);
-		rotate_coords(dest->sx, dest->sy, &tx, &ty, src->wx, src->wy);
-		dest->sx = tx;
-		dest->sy = ty;
-		if (! rotating_same) {
-			dest->wx = src->wy;
-			dest->wy = src->wx;
-		}
-	}
-}
-
-/* empty cursor */
-static char* curs_empty_data =
-"  "
-"  ";
-
-static char* curs_empty_mask =
-"  "
-"  ";
-static cursor_info_t cur_empty = {NULL, NULL, 2, 2, 0, 0, 0, NULL};
-
-/* dot cursor */
-static char* curs_dot_data =
-"  "
-" x";
-
-static char* curs_dot_mask =
-"  "
-" x";
-static cursor_info_t cur_dot = {NULL, NULL, 2, 2, 0, 0, 0, NULL};
-
-
-/* main cursor */
-static char* curs_arrow_data =
-"                  "
-" x                "
-" xx               "
-" xxx              "
-" xxxx             "
-" xxxxx            "
-" xxxxxx           "
-" xxxxxxx          "
-" xxxxxxxx         "
-" xxxxx            "
-" xx xx            "
-" x   xx           "
-"     xx           "
-"      xx          "
-"      xx          "
-"                  "
-"                  "
-"                  ";
-
-static char* curs_arrow_mask =
-"xx                "
-"xxx               "
-"xxxx              "
-"xxxxx             "
-"xxxxxx            "
-"xxxxxxx           "
-"xxxxxxxx          "
-"xxxxxxxxx         "
-"xxxxxxxxxx        "
-"xxxxxxxxxx        "
-"xxxxxxx           "
-"xxx xxxx          "
-"xx  xxxx          "
-"     xxxx         "
-"     xxxx         "
-"      xx          "
-"                  "
-"                  ";
-static cursor_info_t cur_arrow = {NULL, NULL, 18, 18, 0, 0, 1, NULL};
-
-static char* curs_arrow2_data =
-"                  "
-" x                "
-" xx               "
-" xxx              "
-" xxxx             "
-" xxxxx            "
-" xxxxxx           "
-" xxxxxxx          "
-" xxxxxxxx         "
-" xxxxx            "
-" xx xx            "
-" x   xx           "
-"     xx           "
-"      xx          "
-"      xx          "
-"                  "
-"                  "
-"                  ";
-
-static char* curs_arrow2_mask =
-"xx                "
-"xxx               "
-"xxxx              "
-"xxxxx             "
-"xxxxxx            "
-"xxxxxxx           "
-"xxxxxxxx          "
-"xxxxxxxxx         "
-"xxxxxxxxxx        "
-"xxxxxxxxxx        "
-"xxxxxxx           "
-"xxx xxxx          "
-"xx  xxxx          "
-"     xxxx         "
-"     xxxx         "
-"      xx          "
-"                  "
-"                  ";
-static cursor_info_t cur_arrow2 = {NULL, NULL, 18, 18, 0, 0, 0, NULL};
-
-static char* curs_arrow3_data = 
-"                "
-" xx             "
-" xxxx           "
-"  xxxxx         "
-"  xxxxxxx       "
-"   xxxxxxxx     "
-"   xxxxxxxxxx   "
-"    xxxxx       "
-"    xxxxx       "
-"     xx  x      "
-"     xx   x     "
-"      x    x    "
-"      x     x   "
-"             x  "
-"              x "
-"                ";
-
-static char* curs_arrow3_mask = 
-"xxx             "
-"xxxxx           "
-"xxxxxxx         "
-" xxxxxxxx       "
-" xxxxxxxxxx     "
-"  xxxxxxxxxxxx  "
-"  xxxxxxxxxxxx  "
-"   xxxxxxxxxxx  "
-"   xxxxxxx      "
-"    xxxxxxx     "
-"    xxxx xxx    "
-"     xxx  xxx   "
-"     xxx   xxx  "
-"     xxx    xxx "
-"             xxx"
-"              xx";
-
-static cursor_info_t cur_arrow3 = {NULL, NULL, 16, 16, 0, 0, 1, NULL};
-
-static char* curs_arrow4_data = 
-"                "
-" xx             "
-" xxxx           "
-"  xxxxx         "
-"  xxxxxxx       "
-"   xxxxxxxx     "
-"   xxxxxxxxxx   "
-"    xxxxx       "
-"    xxxxx       "
-"     xx  x      "
-"     xx   x     "
-"      x    x    "
-"      x     x   "
-"             x  "
-"              x "
-"                ";
-
-static char* curs_arrow4_mask = 
-"xxx             "
-"xxxxx           "
-"xxxxxxx         "
-" xxxxxxxx       "
-" xxxxxxxxxx     "
-"  xxxxxxxxxxxx  "
-"  xxxxxxxxxxxx  "
-"   xxxxxxxxxxx  "
-"   xxxxxxx      "
-"    xxxxxxx     "
-"    xxxx xxx    "
-"     xxx  xxx   "
-"     xxx   xxx  "
-"     xxx    xxx "
-"             xxx"
-"              xx";
-
-static cursor_info_t cur_arrow4 = {NULL, NULL, 16, 16, 0, 0, 0, NULL};
-
-static char* curs_arrow5_data = 
-"x              "
-" xx            "
-" xxxx          "
-"  xxxxx        "
-"  xxxxxxx      "
-"   xxx         "
-"   xx x        "
-"    x  x       "
-"    x   x      "
-"         x     "
-"          x    "
-"           x   "
-"            x  "
-"             x "
-"              x";
-
-static char* curs_arrow5_mask = 
-"xx             "
-"xxxx           "
-" xxxxx         "
-" xxxxxxx       "
-"  xxxxxxxx     "
-"  xxxxxxxx     "
-"   xxxxx       "
-"   xxxxxx      "
-"    xx xxx     "
-"     x  xxx    "
-"         xxx   "
-"          xxx  "
-"           xxx "
-"            xxx"
-"             xx";
-
-static cursor_info_t cur_arrow5 = {NULL, NULL, 15, 15, 0, 0, 1, NULL};
-
-static char* curs_arrow6_data = 
-"x              "
-" xx            "
-" xxxx          "
-"  xxxxx        "
-"  xxxxxxx      "
-"   xxx         "
-"   xx x        "
-"    x  x       "
-"    x   x      "
-"         x     "
-"          x    "
-"           x   "
-"            x  "
-"             x "
-"              x";
-
-static char* curs_arrow6_mask = 
-"xx             "
-"xxxx           "
-" xxxxx         "
-" xxxxxxx       "
-"  xxxxxxxx     "
-"  xxxxxxxx     "
-"   xxxxx       "
-"   xxxxxx      "
-"    xx xxx     "
-"     x  xxx    "
-"         xxx   "
-"          xxx  "
-"           xxx "
-"            xxx"
-"             xx";
-
-static cursor_info_t cur_arrow6 = {NULL, NULL, 15, 15, 0, 0, 0, NULL};
-
-int alt_arrow_max = 6;
-/*
- * It turns out we can at least detect mouse is on the root window so 
- * show it (under -cursor X) with this familiar cursor... 
- */
-static char* curs_root_data =
-"                  "
-"                  "
-"  xxx        xxx  "
-"  xxxx      xxxx  "
-"  xxxxx    xxxxx  "
-"   xxxxx  xxxxx   "
-"    xxxxxxxxxx    "
-"     xxxxxxxx     "
-"      xxxxxx      "
-"      xxxxxx      "
-"     xxxxxxxx     "
-"    xxxxxxxxxx    "
-"   xxxxx  xxxxx   "
-"  xxxxx    xxxxx  "
-"  xxxx      xxxx  "
-"  xxx        xxx  "
-"                  "
-"                  ";
-
-static char* curs_root_mask =
-"                  "
-" xxxx        xxxx "
-" xxxxx      xxxxx "
-" xxxxxx    xxxxxx "
-" xxxxxxx  xxxxxxx "
-"  xxxxxxxxxxxxxx  "
-"   xxxxxxxxxxxx   "
-"    xxxxxxxxxx    "
-"     xxxxxxxx     "
-"     xxxxxxxx     "
-"    xxxxxxxxxx    "
-"   xxxxxxxxxxxx   "
-"  xxxxxxxxxxxxxx  "
-" xxxxxxx  xxxxxxx "
-" xxxxxx    xxxxxx "
-" xxxxx      xxxxx "
-" xxxx        xxxx "
-"                  ";
-static cursor_info_t cur_root = {NULL, NULL, 18, 18, 8, 8, 1, NULL};
-
-static char* curs_fleur_data = 
-"                "
-"       xx       "
-"      xxxx      "
-"     xxxxxx     "
-"       xx       "
-"   x   xx   x   "
-"  xx   xx   xx  "
-" xxxxxxxxxxxxxx "
-" xxxxxxxxxxxxxx "
-"  xx   xx   xx  "
-"   x   xx   x   "
-"       xx       "
-"     xxxxxx     "
-"      xxxx      "
-"       xx       "
-"                ";
-
-static char* curs_fleur_mask = 
-"      xxxx      "
-"      xxxxx     "
-"     xxxxxx     "
-"    xxxxxxxx    "
-"   x xxxxxx x   "
-"  xxx xxxx xxx  "
-"xxxxxxxxxxxxxxxx"
-"xxxxxxxxxxxxxxxx"
-"xxxxxxxxxxxxxxxx"
-"xxxxxxxxxxxxxxxx"
-"  xxx xxxx xxx  "
-"   x xxxxxx x   "
-"    xxxxxxxx    "
-"     xxxxxx     "
-"      xxxx      "
-"      xxxx      ";
-
-static cursor_info_t cur_fleur = {NULL, NULL, 16, 16, 8, 8, 1, NULL};
-
-static char* curs_plus_data = 
-"            "
-"     xx     "
-"     xx     "
-"     xx     "
-"     xx     "
-" xxxxxxxxxx "
-" xxxxxxxxxx "
-"     xx     "
-"     xx     "
-"     xx     "
-"     xx     "
-"            ";
-
-static char* curs_plus_mask = 
-"    xxxx    "
-"    xxxx    "
-"    xxxx    "
-"    xxxx    "
-"xxxxxxxxxxxx"
-"xxxxxxxxxxxx"
-"xxxxxxxxxxxx"
-"xxxxxxxxxxxx"
-"    xxxx    "
-"    xxxx    "
-"    xxxx    "
-"    xxxx    ";
-static cursor_info_t cur_plus = {NULL, NULL, 12, 12, 5, 6, 1, NULL};
-
-static char* curs_xterm_data = 
-"                "
-"     xxx xxx    "
-"       xxx      "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"        x       "
-"       xxx      "
-"     xxx xxx    "
-"                ";
-
-static char* curs_xterm_mask = 
-"    xxxx xxxx   "
-"    xxxxxxxxx   "
-"    xxxxxxxxx   "
-"      xxxxx     "
-"       xxx      "
-"       xxx      "
-"       xxx      "
-"       xxx      "
-"       xxx      "
-"       xxx      "
-"       xxx      "
-"       xxx      "
-"      xxxxx     "
-"    xxxxxxxxx   "
-"    xxxxxxxxx   "
-"    xxxx xxxx   ";
-static cursor_info_t cur_xterm = {NULL, NULL, 16, 16, 8, 8, 1, NULL};
-
-enum cursor_names {
-	CURS_EMPTY = 0,
-	CURS_DOT,
-
-	CURS_ARROW,
-	CURS_WARROW,
-	CURS_ROOT,
-	CURS_WM,
-	CURS_TERM,
-	CURS_PLUS,
-
-	CURS_DYN1,
-	CURS_DYN2,
-	CURS_DYN3,
-	CURS_DYN4,
-	CURS_DYN5,
-	CURS_DYN6,
-	CURS_DYN7,
-	CURS_DYN8,
-	CURS_DYN9,
-	CURS_DYN10,
-	CURS_DYN11,
-	CURS_DYN12,
-	CURS_DYN13,
-	CURS_DYN14,
-	CURS_DYN15,
-	CURS_DYN16
-};
-
-#define CURS_DYN_MIN CURS_DYN1
-#define CURS_DYN_MAX CURS_DYN16
-#define CURS_DYN_NUM (CURS_DYN_MAX - CURS_DYN_MIN + 1)
-
-#define CURS_MAX 32
-static cursor_info_t *cursors[CURS_MAX];
-
-void first_cursor(void) {
-	if (! screen) {
-		return;
-	}
-	if (! show_cursor) {
-		LOCK(screen->cursorMutex);
-		screen->cursor = NULL;
-		UNLOCK(screen->cursorMutex);
-	} else {
-		got_xfixes_cursor_notify++;
-		set_rfb_cursor(get_which_cursor());
-		set_cursor_was_changed(screen);
-	}
-}
-
-static void setup_cursors(void) {
-	rfbCursorPtr rfb_curs;
-	char *scale = NULL;
-	int i, j, n = 0;
-	int w_in = 0, h_in = 0;
-	static int first = 1;
-
-	if (verbose || use_threads) {
-		rfbLog("setting up %d cursors...\n", CURS_MAX);
-	}
-
-	if (first) {
-		for (i=0; i<CURS_MAX; i++) {
-			cursors[i] = NULL;
-		}
-	}
-	first = 0;
-
-	if (screen) {
-		LOCK(screen->cursorMutex);
-		screen->cursor = NULL;
-	}
-
-	for (i=0; i<CURS_MAX; i++) {
-		cursor_info_t *ci;
-		if (cursors[i]) {
-			/* clear out any existing ones: */
-			ci = cursors[i];
-			if (ci->rfb) {
-				/* this is the rfbCursor part: */
-				if (ci->rfb->richSource) {
-					free(ci->rfb->richSource);
-					ci->rfb->richSource = NULL;
-				}
-				if (ci->rfb->source) {
-					free(ci->rfb->source);
-					ci->rfb->source = NULL;
-				}
-				if (ci->rfb->mask) {
-					free(ci->rfb->mask);
-					ci->rfb->mask = NULL;
-				}
-				free(ci->rfb);
-				ci->rfb = NULL;
-			}
-			if (ci->data) {
-				free(ci->data);
-				ci->data = NULL;
-			}
-			if (ci->mask) {
-				free(ci->mask);
-				ci->mask = NULL;
-			}
-			free(ci);
-			ci = NULL;
-		}
-
-		/* create new struct: */
-		ci = (cursor_info_t *) malloc(sizeof(cursor_info_t));
-		ci->data = NULL; 
-		ci->mask = NULL; 
-		ci->wx = 0;
-		ci->wy = 0;
-		ci->sx = 0;
-		ci->sy = 0;
-		ci->reverse = 0;
-		ci->rfb = NULL;
-		cursors[i] = ci;
-	}
-
-	/* clear any xfixes cursor cache (no freeing is done) */
-	get_exact_cursor(1);
-
-	/* manually fill in the data+masks: */
-	cur_empty.data	= curs_empty_data;
-	cur_empty.mask	= curs_empty_mask;
-
-	cur_dot.data	= curs_dot_data;
-	cur_dot.mask	= curs_dot_mask;
-
-	cur_arrow.data	= curs_arrow_data;
-	cur_arrow.mask	= curs_arrow_mask;
-	cur_arrow2.data	= curs_arrow2_data;
-	cur_arrow2.mask	= curs_arrow2_mask;
-	cur_arrow3.data	= curs_arrow3_data;
-	cur_arrow3.mask	= curs_arrow3_mask;
-	cur_arrow4.data	= curs_arrow4_data;
-	cur_arrow4.mask	= curs_arrow4_mask;
-	cur_arrow5.data	= curs_arrow5_data;
-	cur_arrow5.mask	= curs_arrow5_mask;
-	cur_arrow6.data	= curs_arrow6_data;
-	cur_arrow6.mask	= curs_arrow6_mask;
-
-	cur_root.data	= curs_root_data;
-	cur_root.mask	= curs_root_mask;
-
-	cur_plus.data	= curs_plus_data;
-	cur_plus.mask	= curs_plus_mask;
-
-	cur_fleur.data	= curs_fleur_data;
-	cur_fleur.mask	= curs_fleur_mask;
-
-	cur_xterm.data	= curs_xterm_data;
-	cur_xterm.mask	= curs_xterm_mask;
-
-	curs_copy(cursors[CURS_EMPTY], &cur_empty);	n++;
-	curs_copy(cursors[CURS_DOT],   &cur_dot);	n++;
-
-	if (alt_arrow < 1 || alt_arrow > alt_arrow_max) {
-		alt_arrow = 1;
-	}
-	if (alt_arrow == 1) {
-		curs_copy(cursors[CURS_ARROW], &cur_arrow);	n++;
-	} else if (alt_arrow == 2) {
-		curs_copy(cursors[CURS_ARROW], &cur_arrow2);	n++;
-	} else if (alt_arrow == 3) {
-		curs_copy(cursors[CURS_ARROW], &cur_arrow3);	n++;
-	} else if (alt_arrow == 4) {
-		curs_copy(cursors[CURS_ARROW], &cur_arrow4);	n++;
-	} else if (alt_arrow == 5) {
-		curs_copy(cursors[CURS_ARROW], &cur_arrow5);	n++;
-	} else if (alt_arrow == 6) {
-		curs_copy(cursors[CURS_ARROW], &cur_arrow6);	n++;
-	} else {
-		alt_arrow = 1;
-		curs_copy(cursors[CURS_ARROW], &cur_arrow);	n++;
-	}
-	curs_copy(cursors[CURS_WARROW], &cur_arrow2);	n++;
-
-	curs_copy(cursors[CURS_ROOT], &cur_root);	n++;
-	curs_copy(cursors[CURS_WM],   &cur_fleur);	n++;
-	curs_copy(cursors[CURS_TERM], &cur_xterm);	n++;
-	curs_copy(cursors[CURS_PLUS], &cur_plus);	n++;
-
-	if (scale_cursor_str) {
-		scale = scale_cursor_str;
-	} else if (scaling && scale_str) {
-		scale = scale_str;
-	}
-	if (scale && sscanf(scale, "%dx%d", &i, &j) == 2) {
-		if (wdpy_x > 0) {
-			w_in = wdpy_x; 
-			h_in = wdpy_y; 
-		} else {
-			w_in = dpy_x; 
-			h_in = dpy_y; 
-		}
-	}
-
-	/* scale = NULL zeroes everything */
-	parse_scale_string(scale, &scale_cursor_fac_x, &scale_cursor_fac_y, &scaling_cursor,
-	    &scaling_cursor_blend, &j, &j, &scaling_cursor_interpolate,
-	    &scale_cursor_numer, &scale_cursor_denom, w_in, h_in);
-
-	for (i=0; i<n; i++) {
-		/* create rfbCursors for the special cursors: */
-
-		cursor_info_t *ci = cursors[i];
-
-		if (scaling_cursor && (scale_cursor_fac_x != 1.0 || scale_cursor_fac_y != 1.0)) {
-			int w, h, x, y, k;
-			unsigned long *pixels;
-
-			w = ci->wx;
-			h = ci->wy;
-
-			pixels = (unsigned long *) malloc(w * h
-			    * sizeof(unsigned long));
-
-			k = 0;
-			for (y=0; y<h; y++) {
-				for (x=0; x<w; x++) {
-					char d = ci->data[k];
-					char m = ci->mask[k];
-					unsigned long *p;
-
-					p = pixels + k;
-
-					/* set alpha on */
-					*p = 0xff000000;
-
-					if (d == ' ' && m == ' ') {
-						/* alpha off */
-						*p = 0x00000000;
-					} else if (d != ' ') {
-						/* body */
-						if (ci->reverse) {
-							*p |= 0x00000000;
-						} else {
-							*p |= 0x00ffffff;
-						}
-					} else if (m != ' ') {
-						/* edge */
-						if (ci->reverse) {
-							*p |= 0x00ffffff;
-						} else {
-							*p |= 0x00000000;
-						}
-					}
-					k++;
-				}
-			}
-
-			rfb_curs = pixels2curs(pixels, w, h, ci->sx, ci->sy,
-			    bpp/8);
-
-			free(pixels);
-
-		} else {
-
-			/* standard X cursor */
-			rfb_curs = rfbMakeXCursor(ci->wx, ci->wy,
-			    ci->data, ci->mask);
-
-			if (ci->reverse) {
-				rfb_curs->foreRed   = 0x0000;
-				rfb_curs->foreGreen = 0x0000;
-				rfb_curs->foreBlue  = 0x0000;
-				rfb_curs->backRed   = 0xffff;
-				rfb_curs->backGreen = 0xffff;
-				rfb_curs->backBlue  = 0xffff;
-			}
-			rfb_curs->alphaSource = NULL;
-
-			rfb_curs->xhot = ci->sx;
-			rfb_curs->yhot = ci->sy;
-			rfb_curs->cleanup = FALSE;
-			rfb_curs->cleanupSource = FALSE;
-			rfb_curs->cleanupMask = FALSE;
-			rfb_curs->cleanupRichSource = FALSE;
-
-			if (bpp == 8 && indexed_color) {
-				/*
-				 * use richsource in PseudoColor for better
-				 * looking cursors (i.e. two-color).
-				 */
-				int x, y, k = 0, bw;
-				int black = 0, white = 1;
-				char d, m;
-
-				if (dpy) {	/* raw_fb hack */
-					black = BlackPixel(dpy, scr);
-					white = WhitePixel(dpy, scr);
-				}
-
-				rfb_curs->richSource = (unsigned char *)
-				    calloc(ci->wx * ci->wy, 1);
-
-				for (y = 0; y < ci->wy; y++) {
-				    for (x = 0; x < ci->wx; x++) {
-					d = *(ci->data + k);
-					m = *(ci->mask + k);
-					if (d == ' ' && m == ' ') {
-						k++;
-						continue;
-					} else if (m != ' ' && d == ' ') {
-						bw = black;
-					} else {
-						bw = white;
-					}
-					if (ci->reverse) {
-						if (bw == black) {
-							bw = white;
-						} else {
-							bw = black;
-						}
-					}
-					*(rfb_curs->richSource+k) =
-					    (unsigned char) bw;
-					k++;
-				    }
-				}
-			}
-		}
-		ci->rfb = rfb_curs;
-	}
-	if (screen) {
-		UNLOCK(screen->cursorMutex);
-	}
-	if (verbose) {
-		rfbLog("  done.\n");
-	}
-	rfbLog("\n");
-}
-
-void setup_cursors_and_push(void) {
-	setup_cursors();
-	first_cursor();
-}
-
-/*
- * Descends window tree at pointer until the window cursor matches the current 
- * cursor.  So far only used to detect if mouse is on root background or not.
- * (returns 0 in that case, 1 otherwise).
- *
- */
-static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!depth || !w || !winfo) {}
-	return;
-#else
-	Window r, c;
-	int i, rx, ry, wx, wy;
-	unsigned int mask;
-	Window wins[10];
-	int descend, maxtries = 10;
-	char *name, *s = multiple_cursors_mode;
-	static XClassHint *classhint = NULL;
-	int nm_info = 1;
-	XErrorHandler old_handler;
-
-	RAWFB_RET_VOID
-
-	if (!strcmp(s, "default") || !strcmp(s, "X") || !strcmp(s, "arrow")) {
-		nm_info = 0;
-	}
-
-	*(winfo->wm_name)   = '\0';
-	*(winfo->res_name)  = '\0';
-	*(winfo->res_class) = '\0';
-
-	for (i=0; i < maxtries; i++) {
-		wins[i] = None;
-	}
-
-	/* some times a window can go away before we get to it */
-	trapped_xerror = 0;
-	old_handler = XSetErrorHandler(trap_xerror);
-
-	c = window;
-	descend = -1;
-
-	while (c) {
-		wins[++descend] = c;
-		if (descend >= maxtries - 1) {
-			break;
-		}
-		if ( XTestCompareCurrentCursorWithWindow_wr(dpy, c) ) {
-			break;
-		}
-		/* TBD: query_pointer() */
-		XQueryPointer_wr(dpy, c, &r, &c, &rx, &ry, &wx, &wy, &mask);
-	}
-
-	if (nm_info) {
-		int got_wm_name = 0, got_res_name = 0, got_res_class = 0;
-
-		if (! classhint) {
-			classhint = XAllocClassHint();
-		}
-
-		for (i = descend; i >=0; i--) {
-			c = wins[i];
-			if (! c) {
-				continue;
-			}
-			
-			if (! got_wm_name && XFetchName(dpy, c, &name)) {
-				if (name) {
-					if (*name != '\0') {
-						strcpy(winfo->wm_name, name);
-						got_wm_name = 1;
-					}
-					XFree_wr(name);
-				}
-			}
-			if (classhint && (! got_res_name || ! got_res_class)) {
-			    if (XGetClassHint(dpy, c, classhint)) {
-				char *p;
-				p = classhint->res_name;
-				if (p) {
-					if (*p != '\0' && ! got_res_name) {
-						strcpy(winfo->res_name, p);
-						got_res_name = 1;
-					}
-					XFree_wr(p);
-					classhint->res_name = NULL;
-				}
-				p = classhint->res_class;
-				if (p) {
-					if (*p != '\0' && ! got_res_class) {
-						strcpy(winfo->res_class, p);
-						got_res_class = 1;
-					}
-					XFree_wr(p);
-					classhint->res_class = NULL;
-				}
-			    }
-			}
-		}
-	}
-
-	XSetErrorHandler(old_handler);
-	trapped_xerror = 0;
-
-	*depth = descend;
-	*w = wins[descend];
-#endif	/* NO_X11 */
-}
-
-void initialize_xfixes(void) {
-#if LIBVNCSERVER_HAVE_LIBXFIXES
-	if (xfixes_present) {
-		X_LOCK;
-		if (use_xfixes) {
-			XFixesSelectCursorInput(dpy, rootwin,
-				XFixesDisplayCursorNotifyMask);
-		} else {
-			XFixesSelectCursorInput(dpy, rootwin, 0);
-		}
-		X_UNLOCK;
-		xfixes_first_initialized = 1;
-	}
-#endif
-}
-
-static rfbCursorPtr pixels2curs(unsigned long *pixels, int w, int h,
-    int xhot, int yhot, int Bpp) {
-	rfbCursorPtr c;
-	static unsigned long black = 0, white = 1;
-	static int first = 1;
-	char *bitmap, *rich, *alpha;
-	char *pixels_new = NULL;
-	int n_opaque, n_trans, n_alpha, len, histo[256];
-	int send_alpha = 0, alpha_shift = 0, thresh;
-	int i, x, y;
-
-	if (first && dpy) {	/* raw_fb hack */
-		X_LOCK;
-		black = BlackPixel(dpy, scr);
-		white = WhitePixel(dpy, scr);
-		X_UNLOCK;
-		first = 0;
-	}
-
-	if (cmap8to24 && cmap8to24_fb && depth <= 16) {
-		if (Bpp <= 2) {
-			Bpp = 4;
-		}
-	}
-
-	if (scaling_cursor && (scale_cursor_fac_x != 1.0 || scale_cursor_fac_y != 1.0)) {
-		int W, H;
-		char *pixels_use = (char *) pixels;
-		unsigned int *pixels32 = NULL;
-
-		W = w;
-		H = h;
-
-		w = scale_round(W, scale_cursor_fac_x);
-		h = scale_round(H, scale_cursor_fac_y);
-
-		pixels_new = (char *) malloc(4*w*h);
-
-		if (sizeof(unsigned long) == 8) {
-			int i, j, k = 0;
-			/*
-			 * to avoid 64bpp code in scale_rect() we knock
-			 * down to unsigned int on 64bit machines:
-			 */
-			pixels32 = (unsigned int*) malloc(4*W*H);
-			for (j=0; j<H; j++) {
-			    for (i=0; i<W; i++) {
-				*(pixels32+k) = 0xffffffff & (*(pixels+k));
-				k++;
-			    }
-			}
-			pixels_use = (char *) pixels32;
-		}
-
-		scale_rect(scale_cursor_fac_x, scale_cursor_fac_y, scaling_cursor_blend,
-		    scaling_cursor_interpolate,
-		    4, pixels_use, 4*W, pixels_new, 4*w,
-		    W, H, w, h, 0, 0, W, H, 0);
-
-		if (sizeof(unsigned long) == 8) {
-			int i, j, k = 0;
-			unsigned long *pixels64;
-			unsigned int* source = (unsigned int*) pixels_new;
-			/*
-			 * now knock it back up to unsigned long:
-			 */
-			pixels64 = (unsigned long*) malloc(8*w*h);
-			for (j=0; j<h; j++) {
-			    for (i=0; i<w; i++) {
-				*(pixels64+k) = (unsigned long) (*(source+k));
-				k++;
-			    }
-			}
-			free(pixels_new);
-			pixels_new = (char *) pixels64;
-			if (pixels32) {
-				free(pixels32);
-				pixels32 = NULL;
-			}
-		}
-			
-		pixels = (unsigned long *) pixels_new;
-
-		xhot = scale_round(xhot, scale_cursor_fac_x);
-		yhot = scale_round(yhot, scale_cursor_fac_y);
-	}
-
-	len = w * h;
-	/* for bitmap data */
-	bitmap = (char *) malloc(len+1);
-	bitmap[len] = '\0';
-
-	/* for rich cursor pixel data */
-	rich  = (char *)calloc(Bpp*len, 1);
-	alpha = (char *)calloc(1*len, 1);
-
-	n_opaque = 0;
-	n_trans = 0;
-	n_alpha = 0;
-	for (i=0; i<256; i++) {
-		histo[i] = 0;
-	}
-
-	i = 0;
-	for (y = 0; y < h; y++) {
-		for (x = 0; x < w; x++) {
-			unsigned long a;
-
-			a = 0xff000000 & (*(pixels+i));
-			a = a >> 24;	/* alpha channel */
-			if (a > 0) {
-				n_alpha++;
-			}
-			histo[a]++;
-			if (a < (unsigned int) alpha_threshold) {
-				n_trans++;
-			} else {
-				n_opaque++;
-			}
-			i++;
-		}
-	}
-	if (alpha_blend) {
-		send_alpha = 0;
-		if (Bpp == 4) {
-			send_alpha = 1;
-		}
-		alpha_shift = 24;
-		if (main_red_shift == 24 || main_green_shift == 24 ||
-		    main_blue_shift == 24)  {
-			alpha_shift = 0;	/* XXX correct? */
-		}
-	}
-	if (n_opaque >= alpha_frac * n_alpha) {
-		thresh = alpha_threshold;
-	} else {
-		n_opaque = 0;
-		for (i=255; i>=0; i--) {
-			n_opaque += histo[i];
-			thresh = i;
-			if (n_opaque >= alpha_frac * n_alpha) {
-				break;
-			}
-		}
-	}
-
-	i = 0;
-	for (y = 0; y < h; y++) {
-		for (x = 0; x < w; x++) {
-			unsigned long r, g, b, a;
-			unsigned int ui;
-			char *p;
-
-			a = 0xff000000 & (*(pixels+i));
-			a = a >> 24;	/* alpha channel */
-
-			if (a < (unsigned int) thresh) {
-				bitmap[i] = ' ';
-			} else {
-				bitmap[i] = 'x';
-			}
-
-			r = 0x00ff0000 & (*(pixels+i));
-			g = 0x0000ff00 & (*(pixels+i));
-			b = 0x000000ff & (*(pixels+i));
-			r = r >> 16;	/* red */
-			g = g >> 8;	/* green */
-			b = b >> 0;	/* blue */
-
-			if (alpha_remove && a != 0) {
-				r = (255 * r) / a;
-				g = (255 * g) / a;
-				b = (255 * b) / a;
-				if (r > 255) r = 255;
-				if (g > 255) g = 255;
-				if (b > 255) b = 255;
-			}
-
-			if (indexed_color) {
-				/*
-				 * Choose black or white for
-				 * PseudoColor case.
-				 */
-				int value = (r+g+b)/3;
-				if (value > 127) {
-					ui = white;
-				} else {
-					ui = black;
-				}
-			} else {
-				/*
-				 * Otherwise map the RGB data onto
-				 * the framebuffer format:
-				 */
-				r = (main_red_max   * r)/255;
-				g = (main_green_max * g)/255;
-				b = (main_blue_max  * b)/255;
-				ui = 0;
-				ui |= (r << main_red_shift);
-				ui |= (g << main_green_shift);
-				ui |= (b << main_blue_shift);
-				if (send_alpha) {
-					ui |= (a << alpha_shift);
-				}
-			}
-
-			/* insert value into rich source: */
-			p = rich + Bpp*i;
-
-			if (Bpp == 1) {
-				*((unsigned char *)p)
-				= (unsigned char) ui;
-			} else if (Bpp == 2) {
-				*((unsigned short *)p)
-				= (unsigned short) ui;
-			} else if (Bpp == 3) {
-				*((unsigned char *)p)
-				= (unsigned char) ((ui & 0x0000ff) >> 0);
-				*((unsigned char *)(p+1))
-				= (unsigned char) ((ui & 0x00ff00) >> 8);
-				*((unsigned char *)(p+2))
-				= (unsigned char) ((ui & 0xff0000) >> 16);
-			} else if (Bpp == 4) {
-				*((unsigned int *)p)
-				= (unsigned int) ui;
-			}
-
-			/* insert alpha value into alpha source: */
-			p = alpha + i;
-			*((unsigned char *)p) = (unsigned char) a;
-
-			i++;
-		}
-	}
-
-	/* create the cursor with the bitmap: */
-	c = rfbMakeXCursor(w, h, bitmap, bitmap);
-	free(bitmap);
-
-	if (pixels_new) {
-		free(pixels_new);
-	}
-
-	/* set up the cursor parameters: */
-	c->xhot = xhot;
-	c->yhot = yhot;
-	c->cleanup = FALSE;
-	c->cleanupSource = FALSE;
-	c->cleanupMask = FALSE;
-	c->cleanupRichSource = FALSE;
-	c->richSource = (unsigned char *) rich;
-
-	/* zeroes mean interpolate the rich cursor somehow and use B+W */
-	c->foreRed   = 0;
-	c->foreGreen = 0;
-	c->foreBlue  = 0;
-	c->backRed   = 0;
-	c->backGreen = 0;
-	c->backBlue  = 0;
-
-	c->source = NULL;
-
-	if (alpha_blend && !indexed_color) {
-		c->alphaSource = (unsigned char *) alpha;
-		c->alphaPreMultiplied = TRUE;
-	} else {
-		free(alpha);
-		c->alphaSource = NULL;
-	}
-	return c;
-}
-
-static unsigned long last_cursor = 0;
-static int last_index = 0;
-static time_t curs_times[CURS_MAX];
-static unsigned long curs_index[CURS_MAX];
-
-unsigned long get_cursor_serial(int mode) {
-	if (mode == 0) {
-		return last_cursor;
-	} else if (mode == 1) {
-		return (unsigned long) last_index;
-	} else {
-		return (unsigned long) last_index;
-	}
-}
-
-static int get_exact_cursor(int init) {
-	int which = CURS_ARROW;
-
-	if (init) {
-		/* zero out our cache (cursors are not freed) */
-		int i;
-		for (i=0; i<CURS_MAX; i++) {
-			curs_times[i] = 0;
-			curs_index[i] = 0;
-		}
-		last_cursor = 0;
-		last_index = 0;
-		return -1;
-	}
-
-#ifdef MACOSX
-	if (macosx_console) {
-		return macosx_get_cursor();
-	}
-#endif
-
-	if (rawfb_vnc_reflect) {
-		int last_idx = (int) get_cursor_serial(1);
-		if (last_idx) {
-			which = last_idx;
-		}
-		return which;
-	}
-	if (xfixes_present && dpy) {
-#if LIBVNCSERVER_HAVE_LIBXFIXES
-		int last_idx = (int) get_cursor_serial(1);
-		XFixesCursorImage *xfc;
-
-		if (last_idx) {
-			which = last_idx;
-		}
-		if (! xfixes_first_initialized) {
-			return which;
-		}
-
-		X_LOCK;
-		if (! got_xfixes_cursor_notify && xfixes_base_event_type) {
-			/* try again for XFixesCursorNotify event */
-			XEvent xev;
-			if (XCheckTypedEvent(dpy, xfixes_base_event_type +
-			    XFixesCursorNotify, &xev)) {
-				got_xfixes_cursor_notify++;
-			}
-		}
-		if (! got_xfixes_cursor_notify) {
-			/* evidently no cursor change, just return last one */
-			X_UNLOCK;
-			return which;
-		}
-		got_xfixes_cursor_notify = 0;
-
-		/* retrieve the cursor info + pixels from server: */
-		xfc = XFixesGetCursorImage(dpy);
-		X_UNLOCK;
-		if (! xfc) {
-			/* failure. */
-			return which;
-		}
-
-		which = store_cursor(xfc->cursor_serial, xfc->pixels,
-		    xfc->width, xfc->height, 32, xfc->xhot, xfc->yhot);
-
-		X_LOCK;
-		XFree_wr(xfc);
-		X_UNLOCK;
-#endif
-	}
-	return(which);
-}
-
-int store_cursor(int serial, unsigned long *data, int w, int h, int cbpp,
-    int xhot, int yhot) {
-	int which = CURS_ARROW;
-	int use, oldest, i;
-	time_t oldtime, now;
-
-#if 0
-fprintf(stderr, "sc: %d  %d/%d %d - %d %d\n", serial, w, h, cbpp, xhot, yhot);
-#endif
-
-	oldest = CURS_DYN_MIN;
-	if (screen && screen->cursor == cursors[oldest]->rfb) {
-		oldest++;
-	}
-	oldtime = curs_times[oldest];
-	now = time(NULL);
-	for (i = CURS_DYN_MIN; i <= CURS_DYN_MAX; i++) {
-		if (screen && screen->cursor == cursors[i]->rfb) {
-			;
-		} else if (curs_times[i] < oldtime) {
-			/* watch for oldest one to overwrite */
-			oldest = i;
-			oldtime = curs_times[i];
-		}
-		if (serial == (int) curs_index[i]) {
-			/*
-			 * got a hit with an existing cursor,
-			 * use that one.
-			 */
-#ifdef MACOSX
-			if (now > curs_times[i] + 1) {
-				continue;
-			}
-#endif
-			last_cursor = curs_index[i];
-			curs_times[i] = now;
-			last_index = i;
-			return last_index;
-		}
-	}
-
-	/* we need to create the cursor and overwrite oldest */
-	use = oldest;
-	if (cursors[use]->rfb) {
-		/* clean up oldest if it exists */
-		if (cursors[use]->rfb->richSource) {
-			free(cursors[use]->rfb->richSource);
-			cursors[use]->rfb->richSource = NULL;
-		}
-		if (cursors[use]->rfb->alphaSource) {
-			free(cursors[use]->rfb->alphaSource);
-			cursors[use]->rfb->alphaSource = NULL;
-		}
-		if (cursors[use]->rfb->source) {
-			free(cursors[use]->rfb->source);
-			cursors[use]->rfb->source = NULL;
-		}
-		if (cursors[use]->rfb->mask) {
-			free(cursors[use]->rfb->mask);
-			cursors[use]->rfb->mask = NULL;
-		}
-		free(cursors[use]->rfb);
-		cursors[use]->rfb = NULL;
-	}
-
-	if (rotating && rotating_cursors) {
-		char *dst;
-		int tx, ty;
-
-		dst = (char *) malloc(w * h * cbpp/8);
-		rotate_curs(dst, (char *) data, w, h, cbpp/8);
-
-		memcpy(data, dst, w * h * cbpp/8);
-		free(dst);
-
-		rotate_coords(xhot, yhot, &tx, &ty, w, h);
-		xhot = tx;
-		yhot = ty;
-		if (! rotating_same) {
-			int tmp = w;
-			w = h;
-			h = tmp;
-		}
-	}
-
-	/* place cursor into our collection */
-	cursors[use]->rfb = pixels2curs(data, w, h, xhot, yhot, bpp/8);
-
-	/* update time and serial index: */
-	curs_times[use] = now;
-	curs_index[use] = serial;
-	last_index = use;
-	last_cursor = serial;
-
-	which = last_index;
-
-	return which;
-}
-
-int known_cursors_mode(char *s) {
-/*
- * default:	see initialize_cursors_mode() for default behavior.
- * arrow:	unchanging white arrow.
- * Xn*:		show X on root background.  Optional n sets treedepth.
- * some:	do the heuristics for root, wm, term detection.
- * most:	if display have overlay or xfixes, show all cursors,
- *		otherwise do the same as "some"
- * none:	show no cursor.
- */
-	if (strcmp(s, "default") && strcmp(s, "arrow") && *s != 'X' &&
-	    strcmp(s, "some") && strcmp(s, "most") && strcmp(s, "none")) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-void initialize_cursors_mode(void) {
-	char *s = multiple_cursors_mode;
-	if (!s || !known_cursors_mode(s)) {
-		rfbLog("unknown cursors mode: %s\n", s);
-		rfbLog("resetting cursors mode to \"default\"\n");
-		if (multiple_cursors_mode) free(multiple_cursors_mode);
-		multiple_cursors_mode = strdup("default");
-		s = multiple_cursors_mode;
-	}
-	if (!strcmp(s, "none")) {
-		show_cursor = 0;
-	} else {
-		/* we do NOT set show_cursor = 1, let the caller do that */
-	}
-
-	show_multiple_cursors = 0;
-	if (show_cursor) {
-		if (!strcmp(s, "default")) {
-			if(multiple_cursors_mode) free(multiple_cursors_mode);
-			multiple_cursors_mode = strdup("X");
-			s = multiple_cursors_mode;
-		}
-		if (*s == 'X' || !strcmp(s, "some") || !strcmp(s, "most")) {
-			show_multiple_cursors = 1;
-		} else {
-			show_multiple_cursors = 0;
-			/* hmmm, some bug going back to arrow mode.. */
-			set_rfb_cursor(CURS_ARROW);
-		}
-		if (screen) {
-			set_cursor_was_changed(screen);
-		}
-	} else {
-		if (screen) {
-			LOCK(screen->cursorMutex);
-			screen->cursor = NULL;
-			UNLOCK(screen->cursorMutex);
-			set_cursor_was_changed(screen);
-		}
-	}
-}
-
-int get_which_cursor(void) {
-	int which = CURS_ARROW;
-	int db = 0;
-
-	if (show_multiple_cursors) {
-		int depth = 0, rint;
-		static win_str_info_t winfo;
-		static int first = 1, depth_cutoff = -1;
-		Window win = None;
-		XErrorHandler old_handler;
-		int mode = 0;
-
-		if (drag_in_progress || button_mask) {
-			/* XXX not exactly what we want for menus */
-			if (! cursor_drag_changes) {
-				return -1;
-			}
-		}
-
-		if (!strcmp(multiple_cursors_mode, "arrow")) {
-			/* should not happen... */
-			return CURS_ARROW;
-		} else if (!strcmp(multiple_cursors_mode, "default")) {
-			mode = 0;
-		} else if (!strcmp(multiple_cursors_mode, "X")) {
-			mode = 1;
-		} else if (!strcmp(multiple_cursors_mode, "some")) {
-			mode = 2;
-		} else if (!strcmp(multiple_cursors_mode, "most")) {
-			mode = 3;
-		}
-
-		if (rawfb_vnc_reflect && mode > -1) {
-			rint = get_exact_cursor(0);
-			return rint;
-		}
-		if (mode == 3) {
-			if ((xfixes_present && use_xfixes) || macosx_console) {
-				if (db) fprintf(stderr, "get_which_cursor call get_exact_cursor\n");
-				rint = get_exact_cursor(0);
-				return rint;
-			}
-		}
-
-		if (depth_cutoff < 0) {
-			int din;
-			if (sscanf(multiple_cursors_mode, "X%d", &din) == 1) {
-				depth_cutoff = din;
-			} else {
-				depth_cutoff = 0;
-			}
-		}
-
-		if (first) {
-			winfo.wm_name   = (char *) malloc(1024);
-			winfo.res_name  = (char *) malloc(1024);
-			winfo.res_class = (char *) malloc(1024);
-		}
-		first = 0;
-		
-		X_LOCK;
-		tree_descend_cursor(&depth, &win, &winfo);
-		X_UNLOCK;
-
-		if (depth <= depth_cutoff && !subwin) {
-			which = CURS_ROOT;
-
-		} else if (mode == 2 || mode == 3) {
-			int which0 = which;
-
-			/* apply crude heuristics to choose a cursor... */
-			if (win && dpy) {
-				int ratio = 10, x, y;
-				unsigned int w, h, bw, d;  
-				Window r;
-
-#if !NO_X11
-				trapped_xerror = 0;
-				X_LOCK;
-				old_handler = XSetErrorHandler(trap_xerror);
-
-				/* "narrow" windows are WM */
-				if (XGetGeometry(dpy, win, &r, &x, &y, &w, &h,
-				    &bw, &d)) {
-					if (w > ratio * h || h > ratio * w) {
-						which = CURS_WM;
-					}
-				}
-				XSetErrorHandler(old_handler);
-				X_UNLOCK;
-				trapped_xerror = 0;
-#else
-				if (!r || !d || !bw || !h || !w || !y || !x || !ratio || !old_handler) {}
-#endif	/* NO_X11 */
-			}
-			if (which == which0) {
-				/* the string "term" means I-beam. */
-				char *name, *class;
-				lowercase(winfo.res_name);
-				lowercase(winfo.res_class);
-				name  = winfo.res_name;
-				class = winfo.res_class;
-				if (strstr(name, "term")) {
-					which = CURS_TERM;
-				} else if (strstr(class, "term")) {
-					which = CURS_TERM;
-				} else if (strstr(name,  "text")) {
-					which = CURS_TERM;
-				} else if (strstr(class, "text")) {
-					which = CURS_TERM;
-				} else if (strstr(name,  "onsole")) {
-					which = CURS_TERM;
-				} else if (strstr(class, "onsole")) {
-					which = CURS_TERM;
-				} else if (strstr(name,  "cmdtool")) {
-					which = CURS_TERM;
-				} else if (strstr(class, "cmdtool")) {
-					which = CURS_TERM;
-				} else if (strstr(name,  "shelltool")) {
-					which = CURS_TERM;
-				} else if (strstr(class, "shelltool")) {
-					which = CURS_TERM;
-				}
-			}
-		}
-	}
-	if (db) fprintf(stderr, "get_which_cursor which: %d\n", which);
-	return which;
-}
-
-static void set_cursor_was_changed(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-
-	if (! s) {
-		return;
-	}
-	iter = rfbGetClientIterator(s);
-	LOCK(screen->cursorMutex);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		cl->cursorWasChanged = TRUE;
-	}
-	UNLOCK(screen->cursorMutex);
-	rfbReleaseClientIterator(iter);
-}
-
-#if 0
-/* not yet used */
-static void set_cursor_was_moved(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-
-	if (! s) {
-		return;
-	}
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		cl->cursorWasMoved = TRUE;
-	}
-	rfbReleaseClientIterator(iter);
-}
-#endif
-
-void restore_cursor_shape_updates(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int count = 0;
-
-	if (! s || ! s->clientHead) {
-		return;
-	}
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		int changed = 0;
-		ClientData *cd = (ClientData *) cl->clientData;
-
-		if (! cd) {
-			continue;
-		}
-		if (cd->had_cursor_shape_updates) {
-			rfbLog("restoring enableCursorShapeUpdates for client"
-			    " 0x%x\n", cl);
-			cl->enableCursorShapeUpdates = TRUE;	
-			changed = 1;
-		}
-		if (cd->had_cursor_pos_updates) {
-			rfbLog("restoring enableCursorPosUpdates for client"
-			    " 0x%x\n", cl);
-			cl->enableCursorPosUpdates = TRUE;	
-			changed = 1;
-		}
-		if (changed) {
-			cl->cursorWasChanged = TRUE;
-			count++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-}
-
-void disable_cursor_shape_updates(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	static int changed = 0;
-	int count = 0;
-
-	if (! s || ! s->clientHead) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd;
-		cd = (ClientData *) cl->clientData;
-
-		if (cl->enableCursorShapeUpdates) {
-			if (cd) {
-				cd->had_cursor_shape_updates = 1;
-			}
-			count++;
-			if (debug_pointer) {
-				rfbLog("%s disable HCSU\n", cl->host);
-			}
-		}
-		if (cl->enableCursorPosUpdates) {
-			if (cd) {
-				cd->had_cursor_pos_updates = 1;
-			}
-			count++;
-			if (debug_pointer) {
-				rfbLog("%s disable HCPU\n", cl->host);
-			}
-		}
-		
-		cl->enableCursorShapeUpdates = FALSE;
-		cl->enableCursorPosUpdates = FALSE;
-		cl->cursorWasChanged = FALSE;
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (count) {
-		changed = 1;
-	}
-}
-
-int cursor_shape_updates_clients(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int count = 0;
-
-	if (! s) {
-		return 0;
-	}
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (cl->enableCursorShapeUpdates) {
-			count++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-	return count;
-}
-
-int cursor_noshape_updates_clients(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int count = 0;
-
-	if (! s) {
-		return 0;
-	}
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (!cl->enableCursorShapeUpdates) {
-			count++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-	return count;
-}
-
-int cursor_pos_updates_clients(rfbScreenInfoPtr s) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int count = 0;
-
-	if (! s) {
-		return 0;
-	}
-	iter = rfbGetClientIterator(s);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (cl->enableCursorPosUpdates) {
-			count++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-	return count;
-}
-
-/*
- * Record rfb cursor position screen->cursorX, etc (a la defaultPtrAddEvent())
- * Then set up for sending rfbCursorPosUpdates back
- * to clients that understand them.  This seems to be TightVNC specific.
- */
-void cursor_position(int x, int y) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int cnt = 0, nonCursorPosUpdates_clients = 0;
-	int x_in = x, y_in = y;
-
-	/* x and y are current positions of X11 pointer on the X11 display */
-	if (!screen) {
-		return;
-	}
-
-	if (scaling) {
-		x = ((double) x / dpy_x) * scaled_x;
-		x = nfix(x, scaled_x);
-		y = ((double) y / dpy_y) * scaled_y;
-		y = nfix(y, scaled_y);
-	}
-
-	if (clipshift) {
-		if (x < 0) x = 0;
-		if (y < 0) y = 0;
-		if (x >= dpy_x) x = dpy_x-1;
-		if (y >= dpy_y) y = dpy_y-1;
-	}
-
-	if (x == screen->cursorX && y == screen->cursorY) {
-		return;
-	}
-
-	LOCK(screen->cursorMutex);
-	screen->cursorX = x;
-	screen->cursorY = y;
-	UNLOCK(screen->cursorMutex);
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (! cl->enableCursorPosUpdates) {
-			nonCursorPosUpdates_clients++;
-			continue;
-		}
-		if (! cursor_pos_updates) {
-			continue;
-		}
-		if (cl == last_pointer_client) {
-			/*
-			 * special case if this client was the last one to
-			 * send a pointer position.
-			 */
-			if (x_in == cursor_x && y_in == cursor_y) {
-				cl->cursorWasMoved = FALSE;
-			} else {
-				/* an X11 app evidently warped the pointer */
-				if (debug_pointer) {
-					rfbLog("cursor_position: warp "
-					    "detected dx=%3d dy=%3d\n",
-					    cursor_x - x, cursor_y - y);
-				}
-				cl->cursorWasMoved = TRUE;
-				cnt++;
-			}
-		} else {
-			cl->cursorWasMoved = TRUE;
-			cnt++;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (debug_pointer && cnt) {
-		rfbLog("cursor_position: sent position x=%3d y=%3d to %d"
-		    " clients\n", x, y, cnt);
-	}
-}
-
-static void set_rfb_cursor(int which) {
-
-	if (! show_cursor) {
-		return;
-	}
-	if (! screen) {
-		return;
-	}
-	
-	if (!cursors[which] || !cursors[which]->rfb) {
-		rfbLog("non-existent cursor: which=%d\n", which);
-		return;
-	} else {
-		rfbSetCursor(screen, cursors[which]->rfb);
-	}
-}
-
-void set_no_cursor(void) {
-	set_rfb_cursor(CURS_EMPTY);
-}
-
-void set_warrow_cursor(void) {
-	set_rfb_cursor(CURS_WARROW);
-}
-
-int set_cursor(int x, int y, int which) {
-	static int last = -1;
-	int changed_cursor = 0;
-
-	if (x || y) {} /* unused vars warning: */
-
-	if (which < 0) {
-		which = last;	
-	}
-	if (last < 0 || which != last) {
-		set_rfb_cursor(which);
-		changed_cursor = 1;
-	}
-	last = which;
-
-	return changed_cursor;
-}
-
-/*
- * routine called periodically to update cursor aspects, this catches
- * warps and cursor shape changes. 
- */
-int check_x11_pointer(void) {
-	Window root_w, child_w;
-	rfbBool ret = 0;
-	int root_x, root_y, win_x, win_y;
-	int x, y, rint;
-	unsigned int mask;
-
-	if (unixpw_in_progress) return 0;
-
-#ifdef MACOSX
-	if (macosx_console) {
-		ret = macosx_get_cursor_pos(&root_x, &root_y);
-	} else {
-		RAWFB_RET(0)
-	}
-#else
-
-	RAWFB_RET(0)
-
-#   if NO_X11
-	return 0;
-#   endif
-
-#endif
-
-
-#if ! NO_X11
-	if (dpy) {
-		X_LOCK;
-		ret = XQueryPointer_wr(dpy, rootwin, &root_w, &child_w, &root_x, &root_y,
-		    &win_x, &win_y, &mask);
-		X_UNLOCK;
-	}
-#else
-	if (!mask || !win_y || !win_x || !child_w || !root_w) {}
-#endif	/* NO_X11 */
-
-if (0) fprintf(stderr, "check_x11_pointer %d %d\n", root_x, root_y);
-	if (! ret) {
-		return 0;
-	}
-	if (debug_pointer) {
-		static int last_x = -1, last_y = -1;
-		if (root_x != last_x || root_y != last_y) {
-			rfbLog("XQueryPointer:     x:%4d, y:%4d)\n",
-			    root_x, root_y);
-		}
-		last_x = root_x;
-		last_y = root_y;
-	}
-
-	/* offset subtracted since XQueryPointer relative to rootwin */
-	x = root_x - off_x - coff_x;
-	y = root_y - off_y - coff_y;
-
-	if (clipshift) {
-		static int cnt = 0;
-		if (x < 0 || y < 0 || x >= dpy_x || y >= dpy_y)  {
-			if (cnt++ % 4 != 0) {
-				if (debug_pointer) {
-					rfbLog("Skipping cursor_position() outside our clipshift\n");
-				}
-				return 0;
-			}
-		}
-	}
-
-	/* record the cursor position in the rfb screen */
-	cursor_position(x, y);
-
-	/* change the cursor shape if necessary */
-	rint = set_cursor(x, y, get_which_cursor());
-	return rint;
-}
-
diff --git a/ica/x11/x11vnc/cursor.h b/ica/x11/x11vnc/cursor.h
deleted file mode 100644
index 9c74944..0000000
--- a/ica/x11/x11vnc/cursor.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_CURSOR_H
-#define _X11VNC_CURSOR_H
-
-/* -- cursor.h -- */
-
-extern int xfixes_present;
-extern int xfixes_first_initialized;
-extern int use_xfixes;
-extern int got_xfixes_cursor_notify;
-extern int cursor_changes;
-extern int alpha_threshold;
-extern double alpha_frac;
-extern int alpha_remove;
-extern int alpha_blend;
-extern int alt_arrow;
-extern int alt_arrow_max;
-
-
-extern void first_cursor(void);
-extern void setup_cursors_and_push(void);
-extern void initialize_xfixes(void);
-extern int known_cursors_mode(char *s);
-extern void initialize_cursors_mode(void);
-extern int get_which_cursor(void);
-extern void restore_cursor_shape_updates(rfbScreenInfoPtr s);
-extern void disable_cursor_shape_updates(rfbScreenInfoPtr s);
-extern int cursor_shape_updates_clients(rfbScreenInfoPtr s);
-extern int cursor_noshape_updates_clients(rfbScreenInfoPtr s);
-extern int cursor_pos_updates_clients(rfbScreenInfoPtr s);
-extern void cursor_position(int x, int y);
-extern void set_no_cursor(void);
-extern void set_warrow_cursor(void);
-extern int set_cursor(int x, int y, int which);
-extern int check_x11_pointer(void);
-extern int store_cursor(int serial, unsigned long *data, int w, int h, int cbpp, int xhot, int yhot);
-extern unsigned long get_cursor_serial(int mode);
-
-#endif /* _X11VNC_CURSOR_H */
diff --git a/ica/x11/x11vnc/enc.h b/ica/x11/x11vnc/enc.h
deleted file mode 100644
index 9f5a520..0000000
--- a/ica/x11/x11vnc/enc.h
+++ /dev/null
@@ -1,2166 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_ENC_H
-#define _X11VNC_ENC_H
-
-/* -- enc.h -- */
-
-#if 0
-:r /home/runge/uvnc/ultraSC/rc4/ultravnc_dsm_helper.c
-#endif
-
-/*
- * ultravnc_dsm_helper.c unix/openssl UltraVNC encryption encoder/decoder. 
- *                       (also a generic symmetric encryption tunnel)
- *                       (also a generic TCP relay and supports IPv6)
- *
- * compile via:
-
-   cc       -O -o ultravnc_dsm_helper ultravnc_dsm_helper.c -lssl -lcrypto
-   cc -DDBG -O -o ultravnc_dsm_helper ultravnc_dsm_helper.c -lssl -lcrypto
-
- *
- * See usage below for how to run it.
- *
- * Note: since the UltraVNC DSM plugin implementation changes the RFB
- * (aka VNC) protocol (extra data is sent), you will *ALSO* need to modify
- * your VNC viewer or server to discard (or insert) this extra data.
- *
- * This tool knows nothing about the RFB protocol: it simply
- * encrypts/decrypts a stream using a symmetric cipher, arc4 and aesv2,
- * (others have been added, see usage).  It could be used as a general
- * encrypted tunnel:
- *
- *   any-client <=> ultravnc_dsm_helper <--network--> ultravnc_dsm_helper(reverse mode) <=> any-server
- *
- * e.g. to connect a non-ultra-dsm-vnc viewer to a non-ultra-dsm-vnc server
- * without using SSH or SSL.
- *
- * It can also be used as a general TCP relay (no encryption.)
- *
- * It supports IPv6 and so can also be used as a IPv6 gateway.
- *
- * -----------------------------------------------------------------------
- * Copyright (C) 2008-2010 Karl J. Runge <runge at karlrunge.com>
- * All rights reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; version 2 of the License, or (at
- *  your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA  or see <http://www.gnu.org/licenses/>.
- *
- *  In addition, as a special exception, Karl J. Runge gives permission
- *  to link the code of its release of ultravnc_dsm_helper with the
- *  OpenSSL project's "OpenSSL" library (or with modified versions of it
- *  that use the same license as the "OpenSSL" library), and distribute
- *  the linked executables.  You must obey the GNU General Public License
- *  in all respects for all of the code used other than "OpenSSL".  If you
- *  modify this file, you may extend this exception to your version of the
- *  file, but you are not obligated to do so.  If you do not wish to do
- *  so, delete this exception statement from your version.
- * -----------------------------------------------------------------------
- */
-
-static char *usage = 
-    "\n"
-    "ultravnc_dsm_helper: a symmetric encryption tunnel. version 0.2\n"
-    "\n"
-    "       Created to enable encrypted VNC connections to UltraVNC, it can act as\n"
-    "       a general encrypted tunnel between any two applications.  It can also\n"
-    "       be used as a general TCP relay (i.e. no encryption) or an IPv6 gateway.\n"
-    "\n"
-    "Usage: ultravnc_dsm_helper cipher keyfile listenport remotehost:port\n"
-    "       ultravnc_dsm_helper relay listenport remotehost:port\n"
-    "       ultravnc_dsm_helper showcert remotehost:port\n"
-    "\n"
-    "e.g.:  ultravnc_dsm_helper arc4 ./arc4.key 5901 snoopy.net:5900\n"
-    "\n"
-    "       IPv6 is supported: both IPv4 and IPv6 are attempted to listen on (port\n"
-    "               'listenport'.)  For connections to remotehost, if IPv4 fails\n"
-    "               then IPv6 is tried.  Set the env. var ULTRAVNC_DSM_HELPER_NOIPV6\n"
-    "               to completely disable the use of IPv6.\n"
-    "\n"
-    "\n"
-    "       cipher: specify 'msrc4', 'msrc4_sc', 'arc4', 'aesv2', 'aes-cfb',\n"
-    "               'aes256', 'blowfish', '3des', 'securevnc'.\n"
-    "\n"
-    "               Also 'none', 'relay', or 'showcert'.  See below for details.\n"
-    "\n"
-    "         'msrc4_sc' enables a workaround for UVNC SC -plugin use.\n"
-    "            (it might not be required in SC circa 2009 and later; try 'msrc4'.)\n"
-    "\n"
-    "         use 'securevnc' for SecureVNCPlugin (RSA key exchange).  'keyfile' is\n"
-    "           used as a server RSA keystore in this mode.  If 'keyfile' does not\n"
-    "           exist the user is prompted whether to save the key or not (a MD5\n"
-    "           hash of it is shown)  If 'keyfile' already exists the server key\n"
-    "           must match its contents or the connection is dropped.\n"
-    "\n"
-    "           HOWEVER, if 'keyfile' ends in the string 'ClientAuth.pkey', then the\n"
-    "           normal SecureVNCPlugin client key authentication is performed.\n"
-    "           If you want to do both have 'keyfile' end with 'ClientAuth.pkey.rsa'\n"
-    "           that file will be used for the RSA keystore, and the '.rsa' will be\n"
-    "           trimmed off and the remaining name used as the Client Auth file.\n"
-    "\n"
-    "         use '.' to have it try to guess the cipher from the keyfile name,\n"
-    "           e.g. 'arc4.key' implies arc4, 'rc4.key' implies msrc4, etc.\n"
-    "\n"
-    "         use 'rev:arc4', etc. to reverse the roles of encrypter and decrypter.\n"
-    "           (i.e. if you want to use it for a vnc server, not vnc viewer)\n"
-    "\n"
-    "         use 'noultra:...' to skip steps involving salt and IV to try to be\n"
-    "           compatible with UltraVNC DSM, i.e. assume a normal symmetric cipher\n"
-    "           at the other end.\n"
-    "\n"
-    "         use 'noultra:rev:...' if both are to be supplied.\n"
-    "\n"
-    "\n"
-    "       keyfile: file holding the key (16 bytes for arc4 and aesv2, 87 for msrc4)\n"
-    "           E.g. dd if=/dev/random of=./my.key bs=16 count=1\n"
-    "           keyfile can also be pw=<string> to use \"string\" for the key.\n"
-    "           Or for 'securevnc' the RSA keystore and/or ClientAuth file.\n"
-    "\n"
-    "\n"
-    "       listenport: port to listen for incoming connection on. (use 0 to connect\n"
-    "                   to stdio, use a negative value to force localhost listening)\n"
-    "\n"
-    "\n"
-    "       remotehost:port: host and port to connect to. (e.g. ultravnc server)\n"
-    "\n"
-    "\n"
-    "       Also: cipher may be cipher at n,m where n is the salt size and m is the\n"
-    "       initialization vector size. E.g. aesv2 at 8,16  Use n=-1 to disable salt\n"
-    "       and the MD5 hash (i.e. insert the keydata directly into the cipher.)\n"
-    "\n"
-    "       Use cipher at md+n,m to change the message digest. E.g. arc4 at sha+8,16\n"
-    "       Supported: 'md5', 'sha', 'sha1', 'ripemd160'.\n"
-    "\n"
-    "\n"
-    "       TCP Relay mode: to connect without any encryption use a cipher type of\n"
-    "       either 'relay' or 'none' (both are the equivalent):\n"
-    "\n"
-    "         ultravnc_dsm_helper relay listenport remotehost:port\n"
-    "         ultravnc_dsm_helper none  listenport remotehost:port\n"
-    "\n"
-    "       where 'relay' or 'none' is a literal string.\n"
-    "       Note that for this mode no keyfile is suppled.\n"
-    "       Note that this mode can act as an IPv4 to IPv6 gateway.\n"
-    "\n"
-    "         ultravnc_dsm_helper relay 8080 ipv6.beijing2008.cn:80\n"
-    "\n"
-    "\n"
-    "       SSL Show Certificate mode:  Set the cipher to 'showcert' to fetch\n"
-    "       the SSL certificate from remotehost:port and print it to the stdout.\n"
-    "       No certificate authentication or verification is performed.  E.g.\n"
-    "\n"
-    "         ultravnc_dsm_helper showcert www.verisign.com:443\n"
-    "\n"
-    "       (the output resembles that of 'openssl s_client ...')  Set the env var\n"
-    "       ULTRAVNC_DSM_HELPER_SHOWCERT_ADH=1 for Anonymous Diffie Hellman mode.\n"
-    "\n"
-    "\n"
-    "       Looping Mode:  Set the env. var. ULTRAVNC_DSM_HELPER_LOOP=1 to have it\n"
-    "       restart itself after every disconnection in an endless loop.  It pauses\n"
-    "       500 msec before restarting.  Use ULTRAVNC_DSM_HELPER_LOOP=N to set the\n"
-    "       pause to N msec.\n"
-    "\n"
-    "       You can also set the env. var. ULTRAVNC_DSM_HELPER_BG to have the\n"
-    "       program fork into the background for each connection, thereby acting\n"
-    "       as a simple daemon.\n"
-;
-
-/*
- * We can also run as a module included into x11vnc (-enc option)
- * The includer must set ENC_MODULE and ENC_HAVE_OPENSSL.
- *
- * Note that when running as a module we still assume we have been
- * forked off of the parent process and are communicating back to it
- * via a socket.  So we *still* exit(3) at the end or on error.  And
- * the global settings won't work.
- */
-#ifdef ENC_MODULE
-#  define main __enc_main
-static char *prog = "enc_helper";
-#else
-#  define ENC_HAVE_OPENSSL 1
-static char *prog = "ultravnc_dsm_helper";
-#endif
-
-/* unix includes */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-
-#ifndef WIN32
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-
-/* Solaris (sysv?) needs INADDR_NONE */
-#ifndef INADDR_NONE
-#define INADDR_NONE ((in_addr_t) 0xffffffff)
-#endif
-
-/* openssl includes */
-#if ENC_HAVE_OPENSSL
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include <openssl/rsa.h>
-#include <openssl/err.h>
-#include <openssl/ssl.h>
-#include <openssl/rsa.h>
-static const EVP_CIPHER *Cipher;
-static const EVP_MD *Digest;
-#endif
-
-static char *cipher = NULL;	/* name of cipher, e.g. "aesv2" */
-static int reverse = 0;		/* listening connection */
-static int msrc4_sc = 0;	/* enables workaround for SC I/II */
-static int noultra = 0;		/* manage salt/iv differently from ultradsm */
-static int nomd = 0;		/* use the keydata directly, no md5 or salt */
-static int pw_in = 0;		/* pw=.... read in */
-
-
-/* The data that was read in from key file (or pw=password) */
-static char keydata[1024];
-static int keydata_len;
-
-/* Size of salt and IV; based on UltraVNC DSM */
-#define SALT 16
-#define MSRC4_SALT 11
-#define IVEC 16
-
-/* Set default values of salt and IV */
-static int salt_size = SALT;
-static int ivec_size = IVEC;
-
-/* To track parent and child pids */
-static pid_t parent, child;
-
-/* transfer buffer size */
-#define BSIZE 8192
-
-/* Some very verbose debugging stuff I enable for testing */
-#ifdef DBG
-#  include "dbg.h"
-#else
-#  define DEC_CT_DBG(p, n)
-#  define DEC_PT_DBG(p, n)
-#  define ENC_CT_DBG(p, n)
-#  define ENC_PT_DBG(p, n)
-#  define PRINT_IVEC
-#  define PRINT_KEYDATA
-#  define PRINT_KEYSTR_AND_FRIENDS
-#  define PRINT_LOOP_DBG1
-#  define PRINT_LOOP_DBG2
-#  define PRINT_LOOP_DBG3
-#endif
-
-/* SecureVNCPlugin from: http://adamwalling.com/SecureVNC/ */
-#define SECUREVNC_RSA_PUBKEY_SIZE 270
-#define SECUREVNC_ENCRYPTED_KEY_SIZE 256
-#define SECUREVNC_SIGNATURE_SIZE 256
-#define SECUREVNC_KEY_SIZE 16
-#define SECUREVNC_RESERVED_SIZE 4
-#define SECUREVNC_RC4_DROP_BYTES 3072
-#define SECUREVNC_RAND_KEY_SOURCE 1024
-static int securevnc = 0;
-static int securevnc_arc4 = 0;
-static char *securevnc_file = NULL;
-
-static void enc_connections(int, char*, int);
-
-#if !ENC_HAVE_OPENSSL
-
-/* In case we are a module and there is no OpenSSL buildtime support */
-
-extern void enc_do(char *ciph, char *keyfile, char *lport, char *rhp) { 
-	fprintf(stderr, "%s: not compiled with OpenSSL\n", prog);
-	exit(1);
-}
-
-#else
-
-#if defined(NO_EVP_aes_256_cfb) || (defined (__SVR4) && defined (__sun) && !defined(EVP_aes_256_cfb) && !defined(ASSUME_EVP_aes_256_cfb))
-/*
- * For Solaris 10 missing 192 & 256 bit crypto.
- * Note that EVP_aes_256_cfb is a macro.
- */
-#undef EVP_aes_256_cfb
-#define EVP_aes_256_cfb() EVP_aes_128_cfb(); {fprintf(stderr, "Not compiled with EVP_aes_256_cfb() 'aes256' support.\n"); exit(1);}
-#endif
-
-/* If we are a module, enc_do() is the only interface we export.  */
-
-
-/* This works out key type & etc., reads key, calls enc_connections */
-
-extern void enc_do(char *ciph, char *keyfile, char *lport, char *rhp) { 
-
-	struct stat sb;
-	char *q, *p, *connect_host;
-	char tmp[16];
-	int fd, len = 0, listen_port = 0, connect_port, mbits;
-
-	q = ciph;
-
-	/* check for noultra mode: */
-	if (strstr(q, "noultra:") == q) {
-		noultra = 1;
-		q += strlen("noultra:");
-	}
-
-	/* check for reverse mode: */
-	if (strstr(q, "rev:") == q) {
-		reverse = 1;
-		q += strlen("rev:");
-	}
-
-	/* work out which cipher and set Cipher to the selected one. */
-	if (!strcasecmp(q, "msrc4")) {
-		Cipher = EVP_rc4();		cipher = "msrc4";
-
-	} else if (!strcasecmp(q, "msrc4_sc")) {
-		Cipher = EVP_rc4();		cipher = "msrc4";
-		msrc4_sc = 1;			/* no salt/iv workaround */
-
-	} else if (strstr(q, "arc4") == q) {
-		Cipher = EVP_rc4();		cipher = "arc4";
-
-	} else if (strstr(q, "aesv2") == q || strstr(q, "aes-ofb") == q) {
-		Cipher = EVP_aes_128_ofb();	cipher = "aesv2";
-
-	} else if (strstr(q, "aes-cfb") == q) {
-		Cipher = EVP_aes_128_cfb();	cipher = "aes-cfb";
-
-	} else if (strstr(q, "aes256") == q) {
-		Cipher = EVP_aes_256_cfb();	cipher = "aes256";
-
-	} else if (strstr(q, "blowfish") == q) {
-		Cipher = EVP_bf_cfb();		cipher = "blowfish";
-
-	} else if (strstr(q, "3des") == q) {
-		Cipher = EVP_des_ede3_cfb();	cipher = "3des";
-
-	} else if (strstr(q, "securevnc") == q) {
-		Cipher = EVP_aes_128_ofb();	cipher = "securevnc";
-		securevnc = 1;
-
-	} else if (strstr(q, "none") == q || strstr(q, "relay") == q) {
-		cipher = "none";
-
-	} else if (strstr(q, "showcert") == q) {
-		cipher = "showcert";
-
-	} else if (strstr(q, ".") == q) {
-		/* otherwise, try to guess cipher from key filename: */
-		if (strstr(keyfile, "arc4.key")) {
-			Cipher = EVP_rc4();		cipher = "arc4";
-
-		} else if (strstr(keyfile, "rc4.key")) {
-			Cipher = EVP_rc4();		cipher = "msrc4";
-
-		} else if (strstr(keyfile, "aesv2.key")) {
-			Cipher = EVP_aes_128_ofb();	cipher = "aesv2";
-
-		} else if (strstr(keyfile, "aes-cfb.key")) {
-			Cipher = EVP_aes_128_cfb();	cipher = "aes-cfb";
-
-		} else if (strstr(keyfile, "aes256.key")) {
-			Cipher = EVP_aes_256_cfb();	cipher = "aes256";
-
-		} else if (strstr(keyfile, "blowfish.key")) {
-			Cipher = EVP_bf_cfb();		cipher = "blowfish";
-
-		} else if (strstr(keyfile, "3des.key")) {
-			Cipher = EVP_des_ede3_cfb();	cipher = "3des";
-
-		} else if (strstr(keyfile, "securevnc.")) {
-			Cipher = EVP_aes_128_ofb();	cipher = "securevnc";
-			securevnc = 1;
-
-		} else {
-			fprintf(stderr, "cannot figure out cipher, supply 'msrc4', 'arc4', or 'aesv2' ...\n");
-			exit(1);
-		}
-	} else {
-		fprintf(stderr, "cannot figure out cipher, supply 'msrc4', 'arc4', or 'aesv2' ...\n");
-		exit(1);
-	}
-
-	/* set the default message digest (md5) */
-	if (!securevnc) {
-		Digest = EVP_md5();
-	} else {
-		Digest = EVP_sha1();
-	}
-
-	/*
-	 * Look for user specified salt and IV sizes at the end
-	 * ( ciph at salt,iv and ciph@[md+]salt,iv ):
-	 */
-	p = strchr(q, '@');
-	if (p) {
-		int s, v;
-		p++;
-		if (strstr(p, "md5+") == p) {
-			Digest = EVP_md5();        p += strlen("md5+");
-		} else if (strstr(p, "sha+") == p) {
-			Digest = EVP_sha();        p += strlen("sha+");
-		} else if (strstr(p, "sha1+") == p) {
-			Digest = EVP_sha1();       p += strlen("sha1+");
-		} else if (strstr(p, "ripe+") == p) {
-			Digest = EVP_ripemd160();  p += strlen("ripe+");
-		} else if (strstr(p, "ripemd160+") == p) {
-			Digest = EVP_ripemd160();  p += strlen("ripemd160+");
-		}
-		if (sscanf(p, "%d,%d", &s, &v) == 2) {
-			/* cipher at n,m */
-			if (-1 <= s && s <= SALT) {
-				salt_size = s;
-			} else {
-				fprintf(stderr, "%s: invalid salt size: %d\n",
-				    prog, s);
-				exit(1);
-			}
-			if (0 <= v && v <= EVP_MAX_IV_LENGTH) {
-				ivec_size = v;
-			} else {
-				fprintf(stderr, "%s: invalid IV size: %d\n",
-				    prog, v);
-				exit(1);
-			}
-		} else if (sscanf(p, "%d", &s) == 1) {
-			/* cipher at n */
-			if (-1 <= s && s <= SALT) {
-				salt_size = s;
-			} else {
-				fprintf(stderr, "%s: invalid salt size: %d\n",
-				    prog, s);
-				exit(1);
-			}
-		}
-		if (salt_size == -1) {
-			/* let salt = -1 mean skip both MD5 and salt */
-			nomd = 1;
-			salt_size = 0;
-		}
-	}
-
-	/* port to listen on (0 => stdio, negative => localhost) */
-	if (lport != NULL) {
-		listen_port = atoi(lport);
-	}
-
-	/* extract remote hostname and port */
-	q = strrchr(rhp, ':');
-	if (q) {
-		connect_port = atoi(q+1);
-		*q = '\0';
-	} else {
-		/* otherwise guess VNC display 0 ... */
-		connect_port = 5900;
-	}
-	connect_host = strdup(rhp);
-
-	/* check for and read in the key file */
-	memset(keydata, 0, sizeof(keydata));
-
-	if (!strcmp(cipher, "none")) {
-		goto readed_in;
-	}
-	if (!strcmp(cipher, "showcert")) {
-		goto readed_in;
-	}
-
-	if (securevnc) {
-		/* note the keyfile for rsa verification later */
-		if (keyfile != NULL && strcasecmp(keyfile, "none")) {
-			securevnc_file = keyfile;
-		}
-		goto readed_in;
-	}
-
-	if (stat(keyfile, &sb) != 0) {
-		if (strstr(keyfile, "pw=") == keyfile) {
-			/* user specified key/password on cmdline */
-			int i;
-			len = 0;
-			pw_in = 1;
-			for (i=0; i < (int) strlen(keyfile); i++) {
-				/* load the string to keydata: */
-				int n = i + strlen("pw=");
-				keydata[i] = keyfile[n];
-				if (keyfile[n] == '\0') break;
-				len++;
-				if (i > 100) break;
-			}
-			goto readed_in;
-		}
-		/* otherwise invalid file */
-		perror("stat");
-		exit(1);
-	}
-	if (sb.st_size > 1024) {
-		fprintf(stderr, "%s: key file too big.\n", prog);
-		exit(1);
-	}
-	fd = open(keyfile, O_RDONLY);
-	if (fd < 0) {
-		perror("open");
-		exit(1);
-	}
-
-	/* read it all in */
-	len = (int) read(fd, keydata, (size_t) sb.st_size);
-	if (len != sb.st_size) {
-		perror("read");
-		fprintf(stderr, "%s, could not read key file.\n", prog);
-		exit(1);
-	}
-	close(fd);
-
-	readed_in:
-
-
-	/* check for ultravnc msrc4 format 'rc4.key' */
-	mbits = 0;
-	if (strstr(keydata, "128 bit") == keydata) {
-		mbits = 128;
-	} else if (strstr(keydata, " 56 bit") == keydata) {
-		mbits = 56;
-	} else if (strstr(keydata, " 40 bit") == keydata) {
-		mbits = 40;
-	}
-	if (mbits > 0) {
-		/* 4 is for int key length, 12 is for BLOBHEADER. */
-		int i, offset = strlen("xxx bit") + 4 + 12;
-
-		/* the key is stored in reverse order! */
-		len = mbits/8;
-		for (i=0; i < len; i++) {
-			tmp[i] = keydata[offset + len - i - 1];
-		}
-
-		/* clear keydata and then copy the reversed bytes there: */
-		memset(keydata, 0, sizeof(keydata));
-		memcpy(keydata, tmp, len);
-	}
-
-	keydata_len = len;
-
-	/* initialize random */
-	RAND_poll();
-
-	/*
-	 * Setup connections, then transfer data when they are all
-	 * hooked up.
-	 */
-	enc_connections(listen_port, connect_host, connect_port);
-}
-#endif
-
-static void enc_raw_xfer(int sock_fr, int sock_to) {
-
-	unsigned char buf[BSIZE];
-	unsigned char *psrc = NULL;
-	int len, m, n = 0;
-	
-	/* zero the buffers */
-	memset(buf, 0, BSIZE);
-
-	/* now loop forever processing the data stream */
-	while (1) {
-		errno = 0;
-
-		/* general case of loop, read some in: */
-		n = read(sock_fr, buf, BSIZE);
-
-		if (n == 0 || (n < 0 && errno != EINTR)) {
-			/* failure to read any data, it is EOF or fatal error */
-			int err = errno;
-
-			/* debug output: */
-			fprintf(stderr, "%s: input stream finished: n=%d, err=%d", prog, n, err);
-
-			/* EOF or fatal error */
-			break;
-
-		} else if (n > 0) {
-
-			/* write data to the other end: */
-			len = n;
-			psrc = buf;
-			while (len > 0) {
-				errno = 0;
-				m = write(sock_to, psrc, len);
-
-				if (m > 0) {
-					/* scoot them by how much was written: */
-					psrc += m;
-					len  -= m;
-				}
-				if (m < 0 && (errno == EINTR || errno == EAGAIN)) {
-					/* interrupted or blocked */
-					continue;
-				}
-				/* EOF or fatal error */
-				break;
-			}
-		} else {
-			/* this is EINTR */
-		}
-	}
-
-	/* transfer done (viewer exited or some error) */
-
-	fprintf(stderr, "\n%s: close sock_to\n", prog);
-	close(sock_to);
-
-	fprintf(stderr,   "%s: close sock_fr\n", prog);
-	close(sock_fr);
-
-	/* kill our partner after 1 secs. */
-	sleep(1);
-	if (child)  {
-		if (kill(child, SIGTERM) == 0) {
-			fprintf(stderr, "%s[%d]: killed my partner: %d\n",
-			    prog, (int) getpid(), (int) child);
-		}
-	} else {
-		if (kill(parent, SIGTERM) == 0) {
-			fprintf(stderr, "%s[%d]: killed my partner: %d\n",
-			    prog, (int) getpid(), (int) parent);
-		}
-	}
-}
-
-#if ENC_HAVE_OPENSSL
-/*
- * Initialize cipher context and then loop till EOF doing transfer &
- * encrypt or decrypt.
- */
-static void enc_xfer(int sock_fr, int sock_to, int encrypt) {
-	/*
-	 * We keep both E and D aspects in case we revert back to a
-	 * single process calling select(2) on all fds...
-	 */
-	unsigned char E_keystr[EVP_MAX_KEY_LENGTH];
-	unsigned char D_keystr[EVP_MAX_KEY_LENGTH];
-	EVP_CIPHER_CTX E_ctx, D_ctx;
-	EVP_CIPHER_CTX *ctx = NULL;
-
-	unsigned char buf[BSIZE], out[BSIZE];
-	unsigned char *psrc = NULL, *keystr;
-	unsigned char salt[SALT+1];
-	unsigned char ivec_real[EVP_MAX_IV_LENGTH];
-	unsigned char *ivec = ivec_real;
-
-	int i, cnt, len, m, n = 0, vb = 0, first = 1;
-	int whoops = 1; /* for the msrc4 problem */
-	char *encstr, *encsym;
-	
-	/* zero the buffers */
-	memset(buf,  0, BSIZE);
-	memset(out,  0, BSIZE);
-	memset(salt, 0, sizeof(salt));
-	memset(ivec_real, 0, sizeof(ivec_real));
-	memset(E_keystr, 0, sizeof(E_keystr));
-	memset(D_keystr, 0, sizeof(D_keystr));
-
-	if (!strcmp(cipher, "msrc4")) {
-		salt_size = MSRC4_SALT; /* 11 vs. 16 */
-	}
-
-	if (msrc4_sc) {
-		whoops = 1;	/* force workaround in SC mode */
-	}
-
-	if (getenv("ENCRYPT_VERBOSE")) {
-		vb = 1;	/* let user turn on some debugging via env. var. */
-	}
-
-	/*
-	 * reverse mode, e.g. we help a vnc server instead of a viewer.
-	 */
-	if (reverse) {
-		encrypt = (!encrypt);
-	}
-	encstr = encrypt ? "encrypt" : "decrypt";  /* string for messages */
-	encsym = encrypt ? "+" : "-";
-
-	/* use the encryption/decryption context variables below */
-	if (encrypt) {
-		ctx = &E_ctx;
-		keystr = E_keystr;
-	} else {
-		ctx = &D_ctx;
-		keystr = D_keystr;
-	}
-
-	if (securevnc) {
-		first = 0;	/* no need for salt+iv on first time */
-		salt_size = 0;	/* we want no salt */
-		n = 0;		/* nothing read */
-		ivec_size = 0;	/* we want no IV. */
-		ivec = NULL;
-	} else if (encrypt) {
-		/* encrypter initializes the salt and initialization vector */
-
-		/*
-		 * Our salt is 16 bytes but I believe only the first 8
-		 * bytes are used by EVP_BytesToKey(3).  Since we send it
-		 * to the other "plugin" we need to keep it 16.  Also,
-		 * the IV size can depend on the cipher type.  Again, 16.
-		 */
-		RAND_bytes(salt, salt_size);
-		RAND_bytes(ivec, ivec_size);
-
-		/* place them in the send buffer: */
-		memcpy(buf, salt, salt_size);
-		memcpy(buf+salt_size, ivec, ivec_size);
-
-		n = salt_size + ivec_size;
-
-		ENC_PT_DBG(buf, n);
-
-	} else {
-		/* decrypter needs to read salt + iv from the wire: */
-
-		/* sleep 100 ms (TODO: select on fd) */
-		struct timeval tv;
-		tv.tv_sec  = 0;
-		tv.tv_usec = 100 * 1000;
-		select(1, NULL, NULL, NULL, &tv);
-
-		if (salt_size+ivec_size == 0) {
-			n = 0;	/* no salt or iv, skip reading. */
-		} else {
-			n = read(sock_fr, buf, salt_size+ivec_size+96);
-		}
-		if (n == 0 && salt_size+ivec_size > 0) {
-			fprintf(stderr, "%s: decrypt finished.\n", prog);
-			goto finished;
-		}
-		if (n < salt_size+ivec_size) {
-		    if (msrc4_sc && n == 12) {
-			fprintf(stderr, "%s: only %d bytes read. Assuming "
-			    "UVNC Single Click server.\n", prog, n);
-		    } else {
-			if (n < 0) perror("read");
-			fprintf(stderr, "%s: could not read enough for salt "
-			    "and ivec: n=%d\n", prog, n);
-			goto finished;
-		    }
-		}
-
-		DEC_CT_DBG(buf, n);
-
-		if (msrc4_sc && n == 12) {
-			; /* send it as is */
-		} else {
-			/* extract them to their buffers: */
-			memcpy(salt, buf, salt_size);
-			memcpy(ivec, buf+salt_size, ivec_size);
-
-			/* the rest is some encrypted data: */
-			n = n - salt_size - ivec_size;
-			psrc = buf + salt_size + ivec_size;
-		
-			if (n > 0) {
-				/*
-				 * copy it down to the start of buf for
-				 * sending below:
-				 */
-				for (i=0; i < n; i++) {
-					buf[i] = psrc[i];
-				}
-			}
-		}
-	}
-
-	/* debug output */
-	PRINT_KEYDATA;
-	PRINT_IVEC;
-
-	if (!strcmp(cipher, "msrc4")) {
-		/* special cases for MSRC4: */
-
-		if (whoops) {
-			fprintf(stderr, "%s: %s - WARNING: MSRC4 mode and IGNORING random salt\n", prog, encstr);
-			fprintf(stderr, "%s: %s - WARNING: and initialization vector!!\n", prog, encstr);
-			EVP_CIPHER_CTX_init(ctx);
-			if (pw_in) {
-			    /* for pw=xxxx a md5 hash is used */
-			    EVP_BytesToKey(Cipher, Digest, NULL, (unsigned char *) keydata,
-			        keydata_len, 1, keystr, NULL);
-			    EVP_CipherInit_ex(ctx, Cipher, NULL, keystr, NULL,
-			        encrypt);
-			} else {
-			    /* otherwise keydata as is */
-			    EVP_CipherInit_ex(ctx, Cipher, NULL,
-			        (unsigned char *) keydata, NULL, encrypt);
-			}
-		} else {
-			/* XXX might not be correct, just exit. */
-			fprintf(stderr, "%s: %s - Not sure about msrc4 && !whoops case, exiting.\n", prog, encstr);
-			exit(1);
-
-			EVP_BytesToKey(Cipher, Digest, NULL, (unsigned char *) keydata,
-			    keydata_len, 1, keystr, ivec); 
-			EVP_CIPHER_CTX_init(ctx);
-			EVP_CipherInit_ex(ctx, Cipher, NULL, keystr, ivec,
-			    encrypt);
-		}
-
-	} else {
-		unsigned char *in_salt = NULL;
-
-		/* check salt and IV source and size. */
-		if (securevnc) {
-			in_salt = NULL;
-		} else if (salt_size <= 0) {
-			/* let salt_size = 0 mean keep it out of the MD5 */
-			fprintf(stderr, "%s: %s - WARNING: no salt\n",
-			    prog, encstr);
-			in_salt = NULL;
-		} else {
-			in_salt = salt;
-		}
-
-		if (ivec_size < Cipher->iv_len && !securevnc) {
-			fprintf(stderr, "%s: %s - WARNING: short IV %d < %d\n",
-			    prog, encstr, ivec_size, Cipher->iv_len);
-		}
-
-		/* make the hashed value and place in keystr */
-
-		/*
-		 * XXX N.B.: DSM plugin had count=0, and overwrote ivec
-		 * by not passing NULL iv.
-		 */
-
-		if (nomd) {
-			/* special mode: no salt or md5, use keydata directly */
-
-			int sz = keydata_len < EVP_MAX_KEY_LENGTH ?
-			    keydata_len : EVP_MAX_KEY_LENGTH; 
-
-			fprintf(stderr, "%s: %s - WARNING: no-md5 specified: ignoring salt & hash\n", prog, encstr);
-			memcpy(keystr, keydata, sz);
-
-		} else if (noultra && ivec_size > 0) {
-			/* "normal" mode, don't overwrite ivec. */
-
-			EVP_BytesToKey(Cipher, Digest, in_salt, (unsigned char *) keydata,
-			    keydata_len, 1, keystr, NULL);
-
-		} else {
-			/* 
-			 * Ultra DSM compatibility mode.  Note that this
-			 * clobbers the ivec we set up above!  Under
-			 * noultra we overwrite ivec only if ivec_size=0.
-			 *
-			 * SecureVNC also goes through here. in_salt and ivec are NULL.
-			 * And ivec is NULL below in the EVP_CipherInit_ex() call.
-			 */
-			EVP_BytesToKey(Cipher, Digest, in_salt, (unsigned char *) keydata,
-			    keydata_len, 1, keystr, ivec);
-		}
-
-
-		/* initialize the context */
-		EVP_CIPHER_CTX_init(ctx);
-
-
-		/* set the cipher & initialize */
-
-		/*
-		 * XXX N.B.: DSM plugin implementation had encrypt=1
-		 * for both (i.e. perfectly symmetric)
-		 */
-
-		EVP_CipherInit_ex(ctx, Cipher, NULL, keystr, ivec, encrypt);
-	}
-
-	if (securevnc && securevnc_arc4) {
-		/* need to discard initial 3072 bytes */
-		unsigned char buf1[SECUREVNC_RC4_DROP_BYTES];
-		unsigned char buf2[SECUREVNC_RC4_DROP_BYTES];
-		int cnt = 0;
-		EVP_CipherUpdate(ctx, buf1, &cnt, buf2, SECUREVNC_RC4_DROP_BYTES);
-	}
-
-	/* debug output */
-	PRINT_KEYSTR_AND_FRIENDS;
-
-	/* now loop forever processing the data stream */
-
-	while (1) {
-		errno = 0;
-		if (first && n > 0) {
-			if (encrypt && msrc4_sc) {
-				/* skip sending salt+iv */
-				first = 0;
-				continue;
-			} else {
-				/* use that first block of data placed in buf */
-			}
-		} else if (first && n == 0 && salt_size + ivec_size == 0) {
-			first = 0;
-			continue;
-		} else {
-			/* general case of loop, read some in: */
-			n = read(sock_fr, buf, BSIZE);
-		}
-
-		/* debug output: */
-		if (vb) fprintf(stderr, "%s%d/%d ", encsym, n, errno);
-		PRINT_LOOP_DBG1;
-
-		if (n == 0 || (n < 0 && errno != EINTR)) {
-			/* failure to read any data, it is EOF or fatal error */
-			int err = errno;
-
-			/* debug output: */
-			PRINT_LOOP_DBG2;
-			fprintf(stderr, "%s: %s - input stream finished: n=%d, err=%d", prog, encstr, n, err);
-
-			/* EOF or fatal error */
-			break;
-
-		} else if (n > 0) {
-			/* we read in some data, now transform it: */
-
-			if (first && encrypt) {
-				/* first time, copy the salt and ivec to out[] for sending */
-				memcpy(out, buf, n);
-				cnt = n;
-
-			} else if (!EVP_CipherUpdate(ctx, out, &cnt, buf, n)) {
-				/* otherwise, we transform the data */
-				fprintf(stderr, "%s: enc_xfer EVP_CipherUpdate failed.\n", prog);
-				break;
-			}
-
-			/* debug output: */
-			if (vb) fprintf(stderr, "%sc%d/%d ", encsym, cnt, n);
-			PRINT_LOOP_DBG3;
-
-			/* write transformed data to the other end: */
-			len = cnt;
-			psrc = out;
-			while (len > 0) {
-				errno = 0;
-				m = write(sock_to, psrc, len);
-
-				/* debug output: */
-				if (vb) fprintf(stderr, "m%s%d/%d ", encsym, m, errno);
-
-				if (m > 0) {
-					/* scoot them by how much was written: */
-					psrc += m;
-					len  -= m;
-				}
-				if (m < 0 && (errno == EINTR || errno == EAGAIN)) {
-					/* interrupted or blocked */
-					continue;
-				}
-				/* EOF or fatal error */
-				break;
-			}
-		} else {
-			/* this is EINTR */
-		}
-		first = 0;
-	}
-
-	/* transfer done (viewer exited or some error) */
-	finished:
-
-	fprintf(stderr, "\n%s: %s - close sock_to\n", prog, encstr);
-	close(sock_to);
-
-	fprintf(stderr,   "%s: %s - close sock_fr\n", prog, encstr);
-	close(sock_fr);
-
-	/* kill our partner after 2 secs. */
-	sleep(2);
-	if (child)  {
-		if (kill(child, SIGTERM) == 0) {
-			fprintf(stderr, "%s[%d]: %s - killed my partner: %d\n",
-			    prog, (int) getpid(), encstr, (int) child);
-		}
-	} else {
-		if (kill(parent, SIGTERM) == 0) {
-			fprintf(stderr, "%s[%d]: %s - killed my partner: %d\n",
-			    prog, (int) getpid(), encstr, (int) parent);
-		}
-	}
-}
-
-static int securevnc_server_rsa_save_dialog(char *file, char *md5str, unsigned char* rsabuf) {
-	/* since we are likely running in the background, use this kludge by running tk */
-	FILE *p;
-	char str[2], *q = file, *cmd = getenv("WISH") ? getenv("WISH") : "wish";
-	int rc;
-
-	memset(str, 0, sizeof(str));
-
-	p = popen(cmd, "w");
-	if (p == NULL) {
-		fprintf(stderr, "checkserver_rsa: could not run: %s\n", cmd); 
-		return 0;
-	}
-
-	/* start piping tk/tcl code to it: */
-	fprintf(p, "wm withdraw .\n");
-	fprintf(p, "set x [expr [winfo screenwidth  .]/2]\n");
-	fprintf(p, "set y [expr [winfo screenheight .]/2]\n");
-	fprintf(p, "wm geometry . +$x+$y; update\n");
-	fprintf(p, "catch {option add *Dialog.msg.font {helvetica -14 bold}}\n");
-	fprintf(p, "catch {option add *Dialog.msg.wrapLength 6i}\n");
-	fprintf(p, "set ans [tk_messageBox -title \"Save and Trust UltraVNC RSA Key?\" -icon question ");
-	fprintf(p, "-type yesno -message \"Save and Trust UltraVNC SecureVNCPlugin RSA Key\\n\\n");
-	fprintf(p, "With MD5 sum: %s\\n\\n", md5str);
-	fprintf(p, "In file: ");
-	while (*q != '\0') {
-		/* sanitize user supplied string: */
-		str[0] = *q;
-		if (strpbrk(str, "[](){}`'\"$&*|<>") == NULL) {
-			fprintf(p, "%s", str);
-		}
-		q++;
-	}
-	fprintf(p, " ?\"]\n");
-	fprintf(p, "if { $ans == \"yes\" } {destroy .; exit 0} else {destroy .; exit 1}\n");
-	rc = pclose(p);
-	if (rc == 0) {
-		fprintf(stderr, "checkserver_rsa: query returned: %d.  saving it.\n", rc);
-		p = fopen(file, "w");
-		if (p == NULL) {
-			fprintf(stderr, "checkserver_rsa: could not open %s\n", file);
-			return 0;
-		}
-		write(fileno(p), rsabuf, SECUREVNC_RSA_PUBKEY_SIZE);
-		fclose(p);
-		return 2;
-	} else {
-		fprintf(stderr, "checkserver_rsa: query returned: %d.  NOT saving it.\n", rc);
-		return -1;
-	}
-}
-
-static char *rsa_md5_sum(unsigned char* rsabuf) {
-	EVP_MD_CTX md;
-	char digest[EVP_MAX_MD_SIZE], tmp[16];
-	char md5str[EVP_MAX_MD_SIZE * 8];
-	unsigned int i, size = 0;
-
-	EVP_DigestInit(&md, EVP_md5());
-	EVP_DigestUpdate(&md, rsabuf, SECUREVNC_RSA_PUBKEY_SIZE);
-	EVP_DigestFinal(&md, (unsigned char *)digest, &size);
-
-	memset(md5str, 0, sizeof(md5str));
-	for (i=0; i < size; i++) {
-		unsigned char uc = (unsigned char) digest[i];
-		sprintf(tmp, "%02x", (int) uc);
-		strcat(md5str, tmp);
-	}
-	return strdup(md5str);
-}
-
-static int securevnc_check_server_rsa(char *file, unsigned char *rsabuf) {
-	struct stat sb;
-	unsigned char filebuf[SECUREVNC_RSA_PUBKEY_SIZE];
-	char *md5str = rsa_md5_sum(rsabuf);
-
-	if (!file) {
-		return 0;
-	}
-
-	memset(filebuf, 0, sizeof(filebuf));
-	if (stat(file, &sb) == 0) {
-		int n, fd, i, ok = 1;
-
-		if (sb.st_size != SECUREVNC_RSA_PUBKEY_SIZE) {
-			fprintf(stderr, "checkserver_rsa: file is wrong size: %d != %d '%s'\n",
-			    (int) sb.st_size, SECUREVNC_RSA_PUBKEY_SIZE, file);
-			return 0;
-		}
-
-		fd = open(file, O_RDONLY);
-		if (fd < 0) {
-			fprintf(stderr, "checkserver_rsa: could not open: '%s'\n", file);
-			return 0;
-		}
-
-		n = (int) read(fd, filebuf, SECUREVNC_RSA_PUBKEY_SIZE);
-		close(fd);
-		if (n != SECUREVNC_RSA_PUBKEY_SIZE) {
-			fprintf(stderr, "checkserver_rsa: could not read all of file: %d != %d '%s'\n",
-			    n, SECUREVNC_RSA_PUBKEY_SIZE, file);
-			return 0;
-		}
-
-		for (i=0; i < SECUREVNC_RSA_PUBKEY_SIZE; i++) {
-			if (filebuf[i] != rsabuf[i]) {
-				ok = 0;
-			}
-		}
-		if (!ok) {
-			char *str1 = rsa_md5_sum(rsabuf);
-			char *str2 = rsa_md5_sum(filebuf);
-			fprintf(stderr, "checkserver_rsa: rsa keystore contents differ for '%s'\n", file);
-			fprintf(stderr, "checkserver_rsa: MD5 sum of server key: %s\n", str1);
-			fprintf(stderr, "checkserver_rsa: MD5 sum of keystore:   %s\n", str2);
-		}
-		return ok;
-	} else {
-
-		fprintf(stderr, "checkserver_rsa: rsa keystore file does not exist: '%s'\n", file);
-		fprintf(stderr, "checkserver_rsa: asking user if we should store rsa key in it.\n\n");
-		fprintf(stderr, "checkserver_rsa: RSA key has MD5 sum: %s\n\n", md5str); 
-
-		return securevnc_server_rsa_save_dialog(file, md5str, rsabuf);
-	}
-}
-
-static RSA *load_client_auth(char *file) {
-	struct stat sb;
-	int fd, n;
-	char *contents;
-	RSA *rsa;
-
-	if (!file) {
-		return NULL;
-	}
-	if (stat(file, &sb) != 0) {
-		return NULL;
-	}
-
-	fd = open(file, O_RDONLY);
-	if (fd < 0) {
-		fprintf(stderr, "load_client_auth: could not open: '%s'\n", file);
-		return NULL;
-	}
-
-	contents = (char *) malloc(sb.st_size);
-	n = (int) read(fd, contents, sb.st_size);
-	close(fd);
-
-	if (n != sb.st_size)  {
-		fprintf(stderr, "load_client_auth: could not read all of: '%s'\n", file);
-		free(contents);
-		return NULL;
-	}
-
-	rsa = d2i_RSAPrivateKey(NULL, (const unsigned char **) ((void *) &contents), sb.st_size);
-	if (!rsa) {
-		fprintf(stderr, "load_client_auth: d2i_RSAPrivateKey failed for: '%s'\n", file);
-		return NULL;
-	}
-
-	if (RSA_check_key(rsa) != 1) {
-		fprintf(stderr, "load_client_auth: rsa key invalid: '%s'\n", file);
-		return NULL;
-	}
-
-	return rsa;
-}
-
-static void sslexit(char *msg) {
-	fprintf(stderr, "%s: %s\n", msg, ERR_error_string(ERR_get_error(), NULL));
-	exit(1);
-}
-
-static void securevnc_setup(int conn1, int conn2) {
-	RSA *rsa = NULL;
-	EVP_CIPHER_CTX init_ctx;
-	unsigned char keystr[EVP_MAX_KEY_LENGTH];
-	unsigned char *rsabuf, *rsasav;
-	unsigned char *encrypted_keybuf;
-	unsigned char *initkey;	
-	unsigned int server_flags = 0;
-	unsigned char one = 1, zero = 0, sig = 16;
-	unsigned char b1, b2, b3, b4;
-	unsigned char buf[BSIZE], to_viewer[BSIZE];
-	int to_viewer_len = 0;
-	int n = 0, len, rc;
-	int server = reverse ? conn1 : conn2;
-	int viewer = reverse ? conn2 : conn1;
-	char *client_auth = NULL;
-	int client_auth_req = 0;
-	int keystore_verified = 0;
-
-	ERR_load_crypto_strings();
-
-	/* alloc and read from server the 270 comprising the rsa public key: */
-	rsabuf = (unsigned char *) calloc(SECUREVNC_RSA_PUBKEY_SIZE, 1);
-	rsasav = (unsigned char *) calloc(SECUREVNC_RSA_PUBKEY_SIZE, 1);
-	len = 0;
-	while (len < SECUREVNC_RSA_PUBKEY_SIZE) {
-		n = read(server, rsabuf + len, SECUREVNC_RSA_PUBKEY_SIZE - len);
-		if (n == 0 || (n < 0 && errno != EINTR)) {
-			fprintf(stderr, "securevnc_setup: fail read rsabuf: n=%d len=%d\n", n, len);
-			exit(1);
-		}
-		len += n;
-	}
-	if (len != SECUREVNC_RSA_PUBKEY_SIZE) {
-		fprintf(stderr, "securevnc_setup: fail final read rsabuf: n=%d len=%d\n", n, len);
-		exit(1);
-	}
-	fprintf(stderr, "securevnc_setup: rsa data read len: %d\n", len);
-	memcpy(rsasav, rsabuf, SECUREVNC_RSA_PUBKEY_SIZE);
-
-	fprintf(stderr, "securevnc_setup: RSA key has MD5 sum: %s\n", rsa_md5_sum(rsabuf)); 
-	fprintf(stderr, "securevnc_setup:\n"); 
-	fprintf(stderr, "securevnc_setup: One way to print out the SecureVNC Server key MD5 sum is:\n\n"); 
-	fprintf(stderr, "openssl rsa -inform DER -outform DER -pubout -in ./Server_SecureVNC.pkey | dd bs=1 skip=24 | md5sum\n\n");
-	if (securevnc_file == NULL) {
-		fprintf(stderr, "securevnc_setup:\n");
-		fprintf(stderr, "securevnc_setup: ** WARNING: ULTRAVNC SERVER RSA KEY NOT VERIFIED.   **\n");
-		fprintf(stderr, "securevnc_setup: ** WARNING: A MAN-IN-THE-MIDDLE ATTACK IS POSSIBLE. **\n");
-		fprintf(stderr, "securevnc_setup:\n");
-	} else {
-		char *q = strrchr(securevnc_file, 'C');
-		int skip = 0;
-		if (q) {
-			if (!strcmp(q, "ClientAuth.pkey")) {
-				client_auth = strdup(securevnc_file);
-				skip = 1;
-			} else if (!strcmp(q, "ClientAuth.pkey.rsa")) {
-				client_auth = strdup(securevnc_file);
-				q = strrchr(client_auth, '.');
-				*q = '\0';
-			}
-		}
-		if (!skip) {
-			rc = securevnc_check_server_rsa(securevnc_file, rsabuf);
-		}
-		if (skip) {
-			;
-		} else if (rc == 0) {
-			fprintf(stderr, "securevnc_setup:\n");
-			fprintf(stderr, "securevnc_setup: VERIFY_ERROR: SERVER RSA KEY DID NOT MATCH:\n");
-			fprintf(stderr, "securevnc_setup:     %s\n", securevnc_file);
-			fprintf(stderr, "securevnc_setup:\n");
-			exit(1);
-		} else if (rc == -1) {
-			fprintf(stderr, "securevnc_setup: User cancelled the save and hence the connection.\n");
-			fprintf(stderr, "securevnc_setup:     %s\n", securevnc_file);
-			exit(1);
-		} else if (rc == 1) {
-			fprintf(stderr, "securevnc_setup: VERIFY SUCCESS: server rsa key matches the contents of:\n");
-			fprintf(stderr, "securevnc_setup:     %s\n", securevnc_file);
-			keystore_verified = 1;
-		} else if (rc == 2) {
-			fprintf(stderr, "securevnc_setup: Server rsa key stored in:\n");
-			fprintf(stderr, "securevnc_setup:     %s\n", securevnc_file);
-			keystore_verified = 2;
-		}
-	}
-
-	/*
-	 * read in the server flags. Note that SecureVNCPlugin sends these
-	 * in little endian and not network order!!
-	 */
-	read(server, (char *) &b1, 1);
-	read(server, (char *) &b2, 1);
-	read(server, (char *) &b3, 1);
-	read(server, (char *) &b4, 1);
-	
-	server_flags = 0;
-	server_flags |= ((unsigned int) b4) << 24;
-	server_flags |= ((unsigned int) b3) << 16;
-	server_flags |= ((unsigned int) b2) << 8;
-	server_flags |= ((unsigned int) b1) << 0;
-	fprintf(stderr, "securevnc_setup: server_flags: 0x%08x\n", server_flags);
-
-	/* check for arc4 usage: */
-	if (server_flags & 0x1) {
-		fprintf(stderr, "securevnc_setup: server uses AES cipher.\n");
-	} else {
-		fprintf(stderr, "securevnc_setup: server uses ARC4 cipher.\n");
-		securevnc_arc4 = 1;
-		Cipher = EVP_rc4();
-	}
-
-	/* check for client auth signature requirement: */
-	if (server_flags & (sig << 24)) {
-		fprintf(stderr, "securevnc_setup: server requires Client Auth signature.\n");
-		client_auth_req = 1;
-		if (!client_auth) {
-			fprintf(stderr, "securevnc_setup: However, NO *ClientAuth.pkey keyfile was supplied on our\n");
-			fprintf(stderr, "securevnc_setup: command line.  Exiting.\n");
-			exit(1);
-		}
-	}
-
-	/*
-	 * The first packet 'RFB 003.006' is obscured with key
-	 * that is a sha1 hash of public key.  So make this tmp key now:
- 	 *
-	 */
-	initkey = (unsigned char *) calloc(SECUREVNC_KEY_SIZE, 1);
-	EVP_BytesToKey(EVP_rc4(), EVP_sha1(), NULL, rsabuf, SECUREVNC_RSA_PUBKEY_SIZE, 1, initkey, NULL);
-
-	/* expand the transported rsabuf into an rsa object */
-	rsa = d2i_RSAPublicKey(NULL, (const unsigned char **) &rsabuf, SECUREVNC_RSA_PUBKEY_SIZE);
-	if (rsa == NULL) {
-		sslexit("securevnc_setup: failed to create rsa");
-	}
-
-	/*
-	 * Back to the work involving the tmp obscuring key:
-	 */
-	EVP_CIPHER_CTX_init(&init_ctx);
-	rc = EVP_CipherInit_ex(&init_ctx, EVP_rc4(), NULL, initkey, NULL, 1);
-	if (rc == 0) {
-		sslexit("securevnc_setup: EVP_CipherInit_ex(init_ctx) failed");
-	}
-
-	/* for the first obscured packet, read what we can... */
-	n = read(server, (char *) buf, BSIZE);
-	fprintf(stderr, "securevnc_setup: data read: %d\n", n);
-	if (n < 0) {
-		exit(1);
-	}
-	fprintf(stderr, "securevnc_setup: initial data[%d]: ", n);
-	
-	/* decode with the tmp key */
-	if (n > 0) {
-		memset(to_viewer, 0, sizeof(to_viewer));
-		if (EVP_CipherUpdate(&init_ctx, to_viewer, &len, buf, n) == 0) {
-			sslexit("securevnc_setup: EVP_CipherUpdate(init_ctx) failed");
-			exit(1);
-		}
-		to_viewer_len = len;
-	}
-	EVP_CIPHER_CTX_cleanup(&init_ctx);
-	free(initkey);
-
-	/* print what we would send to the viewer (sent below): */
-	write(2, to_viewer, 12);	/* and first 12 bytes 'RFB ...' as message */
-
-	/* now create the random session key: */
-	encrypted_keybuf = (unsigned char*) calloc(RSA_size(rsa), 1);
-
-	fprintf(stderr, "securevnc_setup: creating random session key: %d/%d\n",
-	    SECUREVNC_KEY_SIZE, SECUREVNC_RAND_KEY_SOURCE);
-	keydata_len = SECUREVNC_RAND_KEY_SOURCE;
-
-	rc = RAND_bytes((unsigned char *)keydata, SECUREVNC_RAND_KEY_SOURCE);
-	if (rc <= 0) {
-		fprintf(stderr, "securevnc_setup: RAND_bytes() failed: %s\n", ERR_error_string(ERR_get_error(), NULL));
-		rc = RAND_pseudo_bytes((unsigned char *)keydata, SECUREVNC_RAND_KEY_SOURCE);
-		fprintf(stderr, "securevnc_setup: RAND_pseudo_bytes() rc=%d\n", rc);
-		if (getenv("RANDSTR")) {
-			char *s = getenv("RANDSTR"); 
-			fprintf(stderr, "securevnc_setup: seeding with RANDSTR len=%d\n", strlen(s));
-			RAND_add(s, strlen(s), strlen(s));
-		}
-	}
-
-	/* N.B. this will be repeated in enc_xfer() setup. */
-	EVP_BytesToKey(Cipher, Digest, NULL, (unsigned char *) keydata, keydata_len, 1, keystr, NULL);
-
-	/* encrypt the session key with the server's public rsa key: */
-	n = RSA_public_encrypt(SECUREVNC_KEY_SIZE, keystr, encrypted_keybuf, rsa, RSA_PKCS1_PADDING);
-	if (n == -1) {
-		sslexit("securevnc_setup: RSA_public_encrypt() failed");
-		exit(1);
-	}
-	fprintf(stderr, "securevnc_setup: encrypted session key size: %d. sending to server.\n", n);
-
-	/* send it to the server: */
-	write(server, encrypted_keybuf, n);
-	free(encrypted_keybuf);
-
-	/*
-	 * Reply back with flags indicating cipher (same as one sent to
-	 * us) and we do not want client-side auth.
-	 *
-	 * We send it out on the wire in little endian order:
-	 */
-	if (securevnc_arc4) {
-		write(server, (char *)&zero, 1);
-	} else {
-		write(server, (char *)&one, 1);
-	}
-	write(server, (char *)&zero, 1);
-	write(server, (char *)&zero, 1);
-	if (client_auth_req) {
-		write(server, (char *)&sig, 1);
-	} else {
-		write(server, (char *)&zero, 1);
-	}
-
-	if (client_auth_req && client_auth) {
-		RSA *client_rsa = load_client_auth(client_auth);
-		EVP_MD_CTX dctx;
-		unsigned char digest[EVP_MAX_MD_SIZE], *signature;
-		unsigned int ndig = 0, nsig = 0;
-
-		if (0) {
-			/* for testing only, use the wrong RSA key: */
-			client_rsa = RSA_generate_key(2048, 0x10001, NULL, NULL);
-		}
-		
-		if (client_rsa == NULL) {
-			fprintf(stderr, "securevnc_setup: problem reading rsa key from '%s'\n", client_auth);
-			exit(1);
-		}
-
-		EVP_DigestInit(&dctx, EVP_sha1());
-		EVP_DigestUpdate(&dctx, keystr, SECUREVNC_KEY_SIZE);
-		/*
-		 * Without something like the following MITM is still possible.
-		 * This is because the MITM knows keystr and can use it with
-		 * the server connection as well, and then he just forwards our
-		 * signed digest.  The additional information below would be the
-		 * MITM's rsa public key, and so the real VNC server will notice
-		 * the difference.  And MITM can't sign keystr+server_rsa.pub since
-		 * he doesn't have Viewer_ClientAuth.pkey.
-		 */
-		if (0) {
-			EVP_DigestUpdate(&dctx, rsasav, SECUREVNC_RSA_PUBKEY_SIZE);
-			if (!keystore_verified) {
-				fprintf(stderr, "securevnc_setup:\n");
-				fprintf(stderr, "securevnc_setup: Warning: even *WITH* Client Authentication in SecureVNC,\n");
-				fprintf(stderr, "securevnc_setup: an attacker may be able to trick you into connecting to his\n");
-				fprintf(stderr, "securevnc_setup: fake VNC server and supplying VNC or Windows passwords, etc.\n");
-				fprintf(stderr, "securevnc_setup: To increase security manually verify the Server RSA key's MD5\n");
-				fprintf(stderr, "securevnc_setup: checksum and then have SSVNC save the key in its keystore to\n");
-				fprintf(stderr, "securevnc_setup: be used to verify the server in subsequent connections.\n");
-				fprintf(stderr, "securevnc_setup:\n");
-			}
-		} else {
-			if (!keystore_verified) {
-				fprintf(stderr, "securevnc_setup:\n");
-				fprintf(stderr, "securevnc_setup: WARNING: THE FIRST VERSION OF THE SECUREVNC PROTOCOL IS\n");
-				fprintf(stderr, "securevnc_setup: WARNING: BEING USED.  *EVEN* WITH CLIENT AUTHENTICATION IT\n");
-				fprintf(stderr, "securevnc_setup: WARNING: IS SUSCEPTIBLE TO A MAN-IN-THE-MIDDLE ATTACK.\n");
-				fprintf(stderr, "securevnc_setup: To increase security manually verify the Server RSA key's MD5\n");
-				fprintf(stderr, "securevnc_setup: checksum and then have SSVNC save the key in its keystore to\n");
-				fprintf(stderr, "securevnc_setup: be used to verify the server in subsequent connections.\n");
-				fprintf(stderr, "securevnc_setup:\n");
-			}
-		}
-		EVP_DigestFinal(&dctx, (unsigned char *)digest, &ndig);
-
-		signature = (unsigned char *) calloc(RSA_size(client_rsa), 1);
-		RSA_sign(NID_sha1, digest, ndig, signature, &nsig, client_rsa);
-
-		fprintf(stderr, "securevnc_setup: sending ClientAuth.pkey signed data: %d\n", nsig);
-		write(server, signature, nsig);
-		free(signature);
-
-		RSA_free(client_rsa);
-	}
-
-	fprintf(stderr, "securevnc_setup: done.\n");
-
-	/* now send the 'RFB ...' to the viewer */
-	if (to_viewer_len > 0) {
-		write(viewer, to_viewer, to_viewer_len);
-	}
-}
-
-#ifndef ENC_DISABLE_SHOW_CERT
-static void enc_sslerrexit(void) {
-	unsigned long err = ERR_get_error();
-
-	if (err) {
-		char str[256];
-		ERR_error_string(err, str);
-		fprintf(stdout, "ssl error: %s\n", str);
-	}
-	exit(1);
-}
-#endif
-
-static void show_cert(int sock) {
-#ifndef ENC_DISABLE_SHOW_CERT
-	SSL_CTX *ctx;
-	SSL *ssl = NULL;
-	STACK_OF(X509) *sk = NULL;
-	X509 *peer = NULL;
-	SSL_CIPHER *c;
-	BIO *bio;
-	unsigned char *sid =  (unsigned char *) "ultravnc_dsm_helper SID";
-	long mode;
-	int i;
-
-	fprintf(stdout, "CONNECTED(%08X)\n",sock);
-
-	SSL_library_init();
-	SSL_load_error_strings();
-
-	if (!RAND_status()) {
-		RAND_poll();
-	}
-	/* this is not for a secured connection. */
-	for (i=0; i < 100; i++) {
-		if (!RAND_status()) {
-			char tmp[32];
-			sprintf(tmp, "%d", getpid() * (17 + i));
-			RAND_add(tmp, strlen(tmp), 5);
-		} else {
-			break;
-		}
-	}
-
-	ctx = SSL_CTX_new( SSLv23_client_method() );
-	if (ctx == NULL) {
-		fprintf(stdout, "show_cert: SSL_CTX_new failed.\n");
-		close(sock);
-		enc_sslerrexit();
-	}
-
-	mode = 0;
-	mode |= SSL_MODE_ENABLE_PARTIAL_WRITE;
-	mode |= SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
-	SSL_CTX_set_mode(ctx, mode);
-
-	if (getenv("ULTRAVNC_DSM_HELPER_SHOWCERT_ADH")) {
-		SSL_CTX_set_cipher_list(ctx, "ADH:@STRENGTH");
-		SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
-	}
-
-	ssl = SSL_new(ctx);
-
-	if (ssl == NULL) {
-		fprintf(stdout, "show_cert: SSL_new failed.\n");
-		close(sock);
-		enc_sslerrexit();
-	}
-
-	SSL_set_session_id_context(ssl, sid, strlen((char *)sid));
-
-	if (! SSL_set_fd(ssl, sock)) {
-		fprintf(stdout, "show_cert: SSL_set_fd failed.\n");
-		close(sock);
-		enc_sslerrexit();
-	}
-
-	SSL_set_connect_state(ssl);
-
-	if (SSL_connect(ssl) <= 0) {
-		unsigned long err = ERR_get_error();
-		fprintf(stdout, "show_cert: SSL_connect failed.\n");
-		if (err) {
-			char str[256];
-			ERR_error_string(err, str);
-			fprintf(stdout, "ssl error: %s\n", str);
-		}
-	}
-
-	SSL_get_verify_result(ssl);
-
-	sk = SSL_get_peer_cert_chain(ssl);
-	if (sk != NULL) {
-		fprintf(stdout, "---\nCertificate chain\n");
-		for (i=0; i < sk_X509_num(sk); i++) {
-			char buf[2048];
-			X509_NAME_oneline(X509_get_subject_name(sk_X509_value(sk,i)), buf, sizeof buf);
-			fprintf(stdout, "%2d s:%s\n", i, buf);
-			X509_NAME_oneline(X509_get_issuer_name(sk_X509_value(sk,i)), buf, sizeof buf);
-			fprintf(stdout, "   i:%s\n", buf);
-		}
-	} else {
-		fprintf(stdout, "show_cert: SSL_get_peer_cert_chain failed.\n");
-	}
-	fprintf(stdout, "---\n");
-	peer = SSL_get_peer_certificate(ssl);
-	bio = BIO_new_fp(stdout, BIO_NOCLOSE);
-	if (peer != NULL) {
-		char buf[2048];
-		BIO_printf(bio,"Server certificate\n");
-		PEM_write_bio_X509(bio, peer);
-
-		X509_NAME_oneline(X509_get_subject_name(peer), buf, sizeof buf);
-		BIO_printf(bio,"subject=%s\n",buf);
-		X509_NAME_oneline(X509_get_issuer_name(peer), buf, sizeof buf);
-		BIO_printf(bio,"issuer=%s\n",buf);
-	} else {
-		fprintf(stdout, "show_cert: SSL_get_peer_certificate failed.\n");
-	}
-
-	c = SSL_get_current_cipher(ssl);
-	BIO_printf(bio,"---\nNew, %s, Cipher is %s\n", SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c));
-
-	if (peer != NULL) {
-		EVP_PKEY *pktmp;
-		pktmp = X509_get_pubkey(peer);
-		BIO_printf(bio,"Server public key is %d bit\n", EVP_PKEY_bits(pktmp));
-		EVP_PKEY_free(pktmp);
-	}
-	BIO_printf(bio,"---\nDONE\n---\n");
-	
-	fflush(stdout);
-
-#endif
-	close(sock);
-	exit(0);
-}
-
-#ifndef SOL_IPV6
-#ifdef  IPPROTO_IPV6
-#define SOL_IPV6 IPPROTO_IPV6
-#endif
-#endif
-
-/*
- * Listens on incoming port for a client, then connects to remote server.
- * Then forks into two processes one is the encrypter the other the
- * decrypter.
- */
-static void enc_connections(int listen_port, char *connect_host, int connect_port) {
-	int listen_fd = -1, listen_fd6 = -1, conn1 = -1, conn2 = -1, ret, one = 1;
-	socklen_t clen;
-	struct hostent *hp;
-	struct sockaddr_in client, server;
-	fd_set fds;
-	int maxfd = -1;
-
-	/* zero means use stdio (preferably from socketpair()) */
-	if (listen_port == 0) {
-		conn1 = fileno(stdin);
-		goto use_stdio;
-	}
-
-	if (!strcmp(cipher, "showcert")) {
-		goto use_stdio;
-	}
-
-	/* fd=n,m means use the supplied already established sockets */
-	if (sscanf(connect_host, "fd=%d,%d", &conn1, &conn2) == 2) {
-		goto use_input_fds;
-	}
-
-	/* create the listening socket: */
-	memset(&client, 0, sizeof(client));
-	client.sin_family = AF_INET;
-	if (listen_port < 0) {
-		/* negative port means use loopback */
-		client.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-		client.sin_port = htons(-listen_port);
-	} else {
-		client.sin_addr.s_addr = htonl(INADDR_ANY);
-		client.sin_port = htons(listen_port);
-	}
-
-	listen_fd = socket(AF_INET, SOCK_STREAM, 0); 
-	if (listen_fd < 0) {
-		perror("socket");
-		goto try6;
-	}
-
-	ret = setsockopt(listen_fd, SOL_SOCKET, SO_REUSEADDR,
-	    (char *)&one, sizeof(one));
-	if (ret < 0) {
-		perror("setsockopt");
-		close(listen_fd);
-		listen_fd = -1;
-		goto try6;
-	}
-
-	ret = bind(listen_fd, (struct sockaddr *) &client, sizeof(client));
-	if (ret < 0) {
-		perror("bind");
-		close(listen_fd);
-		listen_fd = -1;
-		goto try6;
-	}
-
-	ret = listen(listen_fd, 2);
-	if (ret < 0) {
-		perror("listen");
-		close(listen_fd);
-		listen_fd = -1;
-		goto try6;
-	}
-
-	try6:
-#ifdef AF_INET6
-	if (!getenv("ULTRAVNC_DSM_HELPER_NOIPV6")) {
-		struct sockaddr_in6 sin;
-		int one = 1, sock = -1;
-
-		sock = socket(AF_INET6, SOCK_STREAM, 0);
-		if (sock < 0) {
-			perror("socket6");
-			goto fail;
-		}
-
-		if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)) < 0) {
-			perror("setsockopt6 SO_REUSEADDR");
-			close(sock);
-			sock = -1;
-			goto fail;
-		}
-
-#if defined(SOL_IPV6) && defined(IPV6_V6ONLY)
-		if (setsockopt(sock, SOL_IPV6, IPV6_V6ONLY, (char *)&one, sizeof(one)) < 0) {
-			perror("setsockopt6 IPV6_V6ONLY");
-			close(sock);
-			sock = -1;
-			goto fail;
-		}
-#endif
-
-		memset((char *)&sin, 0, sizeof(sin));
-		sin.sin6_family = AF_INET6;
-
-		if (listen_port < 0) {
-			sin.sin6_addr = in6addr_loopback;
-			sin.sin6_port = htons(-listen_port);
-		} else {
-			sin.sin6_addr = in6addr_any;
-			sin.sin6_port = htons(listen_port);
-		}
-
-		if (bind(sock, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
-			perror("bind6");
-			close(sock);
-			sock = -1;
-			goto fail;
-		}
-
-		if (listen(sock, 2) < 0) {
-			perror("listen6");
-			close(sock);
-			sock = -1;
-			goto fail;
-		}
-
-		fail:
-		listen_fd6 = sock;
-	}
-#endif
-
-	if (listen_fd < 0 && listen_fd6 < 0) {
-		fprintf(stderr, "%s: could not listen on port: %d\n",
-		    prog, listen_port);
-		exit(1);
-	}
-
-	fprintf(stderr, "%s: waiting for connection on port: %d\n",
-	    prog, listen_port);
-
-	/* wait for a connection: */
-	FD_ZERO(&fds);
-	if (listen_fd >= 0) {
-		FD_SET(listen_fd, &fds);
-		if (listen_fd > maxfd) {
-			maxfd = listen_fd;
-		}
-	}
-	if (listen_fd6 >= 0) {
-		FD_SET(listen_fd6, &fds);
-		if (listen_fd6 > maxfd) {
-			maxfd = listen_fd6;
-		}
-	}
-	if (select(maxfd+1, &fds, NULL, NULL, NULL) <= 0) {
-		perror("select");
-		exit(1);
-	}
-
-	if (FD_ISSET(listen_fd, &fds)) {
-		clen = sizeof(client);
-		conn1 = accept(listen_fd, (struct sockaddr *) &client, &clen);
-		if (conn1 < 0) {
-			perror("accept");
-			exit(1);
-		}
-	} else if (FD_ISSET(listen_fd6, &fds)) {
-#ifdef AF_INET6
-		struct sockaddr_in6 addr;
-		socklen_t addrlen = sizeof(addr);
-
-		conn1 = accept(listen_fd6, (struct sockaddr *) &addr, &addrlen);
-		if (conn1 < 0) {
-			perror("accept6");
-			exit(1);
-		}
-#else
-		fprintf(stderr, "No IPv6 / AF_INET6 support.\n");
-		exit(1);
-#endif
-	}
-
-	if (setsockopt(conn1, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof(one)) < 0) {
-		perror("setsockopt TCP_NODELAY");
-		exit(1);
-	}
-
-	/* done with the listening socket(s): */
-	if (listen_fd >= 0) {
-		close(listen_fd);
-	}
-	if (listen_fd6 >= 0) {
-		close(listen_fd6);
-	}
-
-	if (getenv("ULTRAVNC_DSM_HELPER_BG")) {
-		int p, n;
-		if ((p = fork()) > 0)  {
-			fprintf(stderr, "%s: putting child %d in background.\n",
-			    prog, p);
-			exit(0);
-		} else if (p == -1) {
-			fprintf(stderr, "%s: could not fork\n", prog);
-			perror("fork");
-			exit(1);
-		}
-		if (setsid() == -1) {
-			fprintf(stderr, "%s: setsid failed\n", prog);
-			perror("setsid");
-			exit(1);
-		}
-		/* adjust our stdio */
-		n = open("/dev/null", O_RDONLY);
-		dup2(n, 0);
-		dup2(n, 1);
-		dup2(n, 2);
-		if (n > 2) {
-			close(n);
-		}
-	}
-
-	use_stdio:
-
-	fprintf(stderr, "%s: got connection: %d\n", prog, conn1);
-
-	/* now connect to remote server: */
-	memset(&server, 0, sizeof(server));
-	server.sin_family = AF_INET;
-	server.sin_port = htons(connect_port);
-
-	if ((server.sin_addr.s_addr = inet_addr(connect_host)) == htonl(INADDR_NONE)) {
-		if (!(hp = gethostbyname(connect_host))) {
-			perror("gethostbyname");
-			goto tryconn6;
-		}
-		server.sin_addr.s_addr = *(unsigned long *)hp->h_addr;
-	}
-
-	conn2 = socket(AF_INET, SOCK_STREAM, 0);
-	if (conn2 < 0) {
-		perror("socket");
-		goto tryconn6;
-	}
-
-	if (connect(conn2, (struct sockaddr *)&server, (sizeof(server))) < 0) {
-		perror("connect");
-		goto tryconn6;
-	}
-
-	tryconn6:
-#ifdef AF_INET6
-	if (conn2 < 0 && !getenv("ULTRAVNC_DSM_HELPER_NOIPV6")) {
-		int err;
-		struct addrinfo *ai;
-		struct addrinfo hints;
-		char service[32];
-
-		fprintf(stderr, "connect[ipv6]: trying to connect via IPv6 to %s\n", connect_host);
-		conn2 = -1;
-
-		memset(&hints, 0, sizeof(hints));
-		sprintf(service, "%d", connect_port);
-
-		hints.ai_family = AF_UNSPEC;
-		hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
-		hints.ai_flags |= AI_ADDRCONFIG;
-#endif
-#ifdef AI_NUMERICSERV
-		hints.ai_flags |= AI_NUMERICSERV;
-#endif
-
-		err = getaddrinfo(connect_host, service, &hints, &ai);
-		if (err != 0) {
-			fprintf(stderr, "getaddrinfo[%d]: %s\n", err, gai_strerror(err));
-		} else {
-			struct addrinfo *ap = ai;
-			while (ap != NULL) {
-				int fd = -1;
-				fd = socket(ap->ai_family, ap->ai_socktype, ap->ai_protocol);
-				if (fd == -1) {
-					perror("socket6");
-				} else {
-					int dmsg = 0; 
-					int res = connect(fd, ap->ai_addr, ap->ai_addrlen);
-#if defined(SOL_IPV6) && defined(IPV6_V6ONLY)
-					if (res != 0) {
-						int zero = 0;
-						perror("connect6");
-						dmsg = 1;
-						if (setsockopt(fd, SOL_IPV6, IPV6_V6ONLY, (char *)&zero, sizeof(zero)) == 0) {
-							fprintf(stderr, "connect[ipv6]: trying again with IPV6_V6ONLY=0\n");
-							res = connect(fd, ap->ai_addr, ap->ai_addrlen);
-							dmsg = 0;
-						}
-					}
-#endif
-					if (res == 0) {
-						conn2 = fd; 
-						break;
-					} else {
-						if (!dmsg) perror("connect6");
-						close(fd);
-					}
-				}
-				ap = ap->ai_next;
-			}
-			freeaddrinfo(ai);
-		}
-	}
-#endif
-	if (conn2 < 0) {
-		fprintf(stderr, "could not connect to %s\n", connect_host);
-		exit(1);
-	}
-	if (conn2 >= 0 && setsockopt(conn2, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof(one)) < 0) {
-		perror("setsockopt TCP_NODELAY");
-	}
-
-	use_input_fds:
-
-	if (!strcmp(cipher, "showcert")) {
-		show_cert(conn2);
-		close(conn2);
-		exit(0);
-	}
-
-	if (securevnc) {
-		securevnc_setup(conn1, conn2);
-	}
-
-	/* fork into two processes; one for each direction: */
-	parent = getpid();
-	
-	child = fork();
-	
-	if (child == (pid_t) -1) {
-		/* couldn't fork... */
-		perror("fork");
-		close(conn1);
-		close(conn2);
-		exit(1);
-	}
-
-	/* Do transfer/encode/decode loop: */
-
-	if (child == 0) {
-		/* encrypter: local-viewer -> remote-server */
-		if (!strcmp(cipher, "none") || !strcmp(cipher, "relay")) {
-			enc_raw_xfer(conn1, conn2);
-		} else {
-			enc_xfer(conn1, conn2, 1);
-		}
-	} else {
-		/* decrypter: remote-server -> local-viewer */
-		if (!strcmp(cipher, "none") || !strcmp(cipher, "relay")) {
-			enc_raw_xfer(conn2, conn1);
-		} else {
-			enc_xfer(conn2, conn1, 0);
-		}
-	}
-}
-#endif /* ENC_HAVE_OPENSSL */
-
-static void doloop (int argc, char *argv[]) {
-	int ms = atoi(getenv("ULTRAVNC_DSM_HELPER_LOOP"));
-	if (ms > 0) {
-		char *cmd;
-		int i, len = 0;
-		for (i = 0; i < argc; i++) {
-			len += strlen(argv[i]) + 2;
-		}
-		cmd = (char *)malloc(len);
-		cmd[0] = '\0';
-		for (i = 0; i < argc; i++) {
-			strcat(cmd, argv[i]);
-			if (i < argc - 1) {
-				strcat(cmd, " ");
-			}
-		}
-
-		putenv("ULTRAVNC_DSM_HELPER_LOOP_SET=1");
-		if (ms == 1) {
-			ms = 500;
-		}
-		i = 0;
-		while (1) {
-			fprintf(stderr, "loop running[%d]: %s\n", ++i, cmd);
-			system(cmd);
-			usleep(1000 * ms);
-		}
-	}
-}
-
-extern int main (int argc, char *argv[]) {
-	char *kf, *q;
-
-	if (getenv("ULTRAVNC_DSM_HELPER_LOOP")) {
-		if (!getenv("ULTRAVNC_DSM_HELPER_LOOP_SET")) {
-			doloop(argc, argv);
-		}
-	}
-
-	if (argc == 3) {
-		if (!strcmp(argv[1], "showcert")) {
-			enc_do(argv[1], NULL, NULL, argv[2]);
-			return 0;
-		}
-	}
-	if (argc == 4) {
-		if (!strcmp(argv[1], "none") || !strcmp(argv[1], "relay")) {
-			enc_do(argv[1], NULL, argv[2], argv[3]);
-			return 0;
-		}
-	}
-	if (argc < 5) {
-		fprintf(stdout, "%s\n", usage);
-		exit(1);
-	}
-
-	/* guard against pw= on cmdline (e.g. linux) */
-	kf = strdup(argv[2]);
-	q = strstr(argv[2], "pw=");
-	if (q) {
-		while (*q != '\0') {
-			*q = '\0';	/* now ps(1) won't show it */
-			q++;
-		}
-	}
-
-	enc_do(argv[1], kf, argv[3], argv[4]);
-
-	return 0;
-}
-
-/*
- * a crude utility to have this work "keyless" i.e. the vnc password
- * is used instead of a pre-shared key file.
- */
-
-/*
-
-#!/usr/bin/perl
-#
-# md5_to_rc4key.pl
-#
-# This program requires md5sum(1) installed on your machine.
-#
-# It translates a VNC password to a ultravnc dsm plugin 
-# compatible key file.
-#
-# Supply VNC password on cmdline, capture in key file:
-#
-#	md5_to_rc4key.pl swordfish    > rc4.key
-#	md5_to_rc4key.pl -a swordfish > arc4.key
-#
-# Use rc4.key with ultravnc_dsm_helper in msrc4 mode,
-# or arc4.key in either arc4 or aesv4 mode.
-#
-#
-$rfmt = 1;
-if ($ARGV[0] eq '-a') {
-	$rfmt = 0;
-	shift;
-}
-
-# n.b. this is not super secure against bad locals...
-
-$pw = shift;
-$tmp = "/tmp/md5out.$$";
-
-open(MD5, "| md5sum > $tmp");
-print MD5 $pw;
-close MD5;
-
-$md5 = `cat $tmp`;
-unlink $tmp;
-
-($md5, $junk) = split(/\s/, $md5);
-
-print "128 bit" if $rfmt;
-print 'a' x 4	if $rfmt;
-print 'b' x 12	if $rfmt;
-
-$str = '';
-foreach $d (split(//, $md5)) {
-	$str .= $d;
-	if (length($str) == 2) {
-		push @key, $str;
-		$str = '';
-	}
-}
-
- at key = (reverse @key) if $rfmt;
-
-foreach $h (@key) {
-	$c = pack('c', hex("0x$h"));	
-	print $c;
-}
-
-print 'c' x 48	if $rfmt;
-
-*/
-#endif /* _X11VNC_ENC_H */
diff --git a/ica/x11/x11vnc/enums.h b/ica/x11/x11vnc/enums.h
deleted file mode 100644
index d9ce84c..0000000
--- a/ica/x11/x11vnc/enums.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_ENUMS_H
-#define _X11VNC_ENUMS_H
-
-/* -- enums.h -- */
-
-enum {
-	LR_UNSET = 0,
-	LR_UNKNOWN,
-	LR_DIALUP,
-	LR_BROADBAND,
-	LR_LAN
-};
-
-enum scroll_types {
-	SCR_NONE = 0,
-	SCR_MOUSE,
-	SCR_KEY,
-	SCR_FAIL,
-	SCR_SUCCESS
-};
-
-#endif /* _X11VNC_ENUMS_H */
diff --git a/ica/x11/x11vnc/gui.c b/ica/x11/x11vnc/gui.c
deleted file mode 100644
index 6101adb..0000000
--- a/ica/x11/x11vnc/gui.c
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- gui.c -- */
-
-#include "x11vnc.h"
-#include "xevents.h"
-#include "win_utils.h"
-#include "remote.h"
-#include "cleanup.h"
-#include "xwrappers.h"
-#include "connections.h"
-
-#include "tkx11vnc.h"
-
-#define SYSTEM_TRAY_REQUEST_DOCK    0
-#define SYSTEM_TRAY_BEGIN_MESSAGE   1
-#define SYSTEM_TRAY_CANCEL_MESSAGE  2
-#define XEMBED_VERSION 0
-#define XEMBED_MAPPED  (1 << 0)
-
-int icon_mode = 0;		/* hack for -gui tray/icon */
-char *icon_mode_file = NULL;
-FILE *icon_mode_fh = NULL;
-int icon_mode_socks[ICON_MODE_SOCKS];
-int tray_manager_ok = 0;
-Window tray_request = None;
-Window tray_window = None;
-int tray_unembed = 0;
-pid_t run_gui_pid = 0;
-pid_t gui_pid = 0;
-
-
-char *get_gui_code(void);
-int tray_embed(Window iconwin, int remove);
-void do_gui(char *opts, int sleep);
-
-
-static Window tweak_tk_window_id(Window win);
-static int tray_manager_running(Display *d, Window *manager);
-static void run_gui(char *gui_xdisplay, int connect_to_x11vnc, int start_x11vnc,
-    int simple_gui, pid_t parent, char *gui_opts);
-
-
-char *get_gui_code(void) {
-	return gui_code;
-}
-
-static Window tweak_tk_window_id(Window win) {
-#if NO_X11
-	if (!win) {}
-	return None;
-#else
-	char *name = NULL;
-	Window parent, new_win;
-
-	if (getenv("NO_TWEAK_TK_WINDOW_ID")) {
-		return win;
-	}
-
-	/* hack for tk, does not report outermost window */
-	new_win = win;
-	parent = parent_window(win, &name);
-	if (parent && name != NULL) {
-		lowercase(name);
-		if (strstr(name, "wish") || strstr(name, "x11vnc")) {
-			new_win = parent;
-			rfbLog("tray_embed: using parent: %s\n", name);
-		}
-	}
-	if (name != NULL) {
-		XFree_wr(name);
-	}
-	return new_win;
-#endif	/* NO_X11 */
-}
-
-int tray_embed(Window iconwin, int remove) {
-#if NO_X11
-	RAWFB_RET(0)
-	if (!iconwin || !remove) {}
-	return 0;
-#else
-	XEvent ev;
-	XErrorHandler old_handler;
-	Window manager;
-	Atom xembed_info;
-	Atom tatom;
-	XWindowAttributes attr;
-	long info[2] = {XEMBED_VERSION, XEMBED_MAPPED};
-	long data = 0;
-
-	RAWFB_RET(0)
-
-	if (remove) {
-		if (!valid_window(iconwin, &attr, 1)) {
-			return 0;
-		}
-		iconwin = tweak_tk_window_id(iconwin);
-		trapped_xerror = 0;
-		old_handler = XSetErrorHandler(trap_xerror);
-
-		/*
-		 * unfortunately no desktops seem to obey this
-		 * part of the XEMBED spec yet...
-		 */
-		XReparentWindow(dpy, iconwin, rootwin, 0, 0);
-
-		XSetErrorHandler(old_handler);
-		if (trapped_xerror) {
-			trapped_xerror = 0;
-			return 0;
-		}
-		trapped_xerror = 0;
-		return 1;
-	}
-
-	xembed_info = XInternAtom(dpy, "_XEMBED_INFO", False);
-	if (xembed_info == None) {
-		return 0;
-	}
-
-	if (!tray_manager_running(dpy, &manager)) {
-		return 0;
-	}
-
-	memset(&ev, 0, sizeof(ev));
-	ev.xclient.type = ClientMessage;
-	ev.xclient.window = manager;
-	ev.xclient.message_type = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE",
-	    False);
-	ev.xclient.format = 32;
-	ev.xclient.data.l[0] = CurrentTime;
-	ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
-	ev.xclient.data.l[2] = iconwin;
-	ev.xclient.data.l[3] = 0;
-	ev.xclient.data.l[4] = 0;
-
-	if (!valid_window(iconwin, &attr, 1)) {
-		return 0;
-	}
-
-	iconwin = tweak_tk_window_id(iconwin);
-	ev.xclient.data.l[2] = iconwin;
-
-	XUnmapWindow(dpy, iconwin);
-
-	trapped_xerror = 0;
-	old_handler = XSetErrorHandler(trap_xerror);
-
-	XSendEvent(dpy, manager, False, NoEventMask, &ev);
-	XSync(dpy, False);
-
-	if (trapped_xerror) {
-		XSetErrorHandler(old_handler);
-		trapped_xerror = 0;
-		return 0;
-	}
-
-	XChangeProperty(dpy, iconwin, xembed_info, xembed_info, 32,
-	    PropModeReplace, (unsigned char *)&info, 2);
-
-#if 0
-{
-XSizeHints *xszh = XAllocSizeHints();
-xszh->flags = PMinSize;
-xszh->min_width = 24;
-xszh->min_height = 24;
-XSetWMNormalHints(dpy, iconwin, xszh);
-}
-#endif
-
-	/* kludge for KDE evidently needed... */
-	tatom = XInternAtom(dpy, "KWM_DOCKWINDOW", False);
-	XChangeProperty(dpy, iconwin, tatom, tatom, 32, PropModeReplace,
-	    (unsigned char *)&data, 1);
-	tatom = XInternAtom(dpy, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False);
-	XChangeProperty(dpy, iconwin, tatom, XA_WINDOW, 32, PropModeReplace,
-	    (unsigned char *)&data, 1);
-
-	XSetErrorHandler(old_handler);
-	trapped_xerror = 0;
-	return 1;
-#endif	/* NO_X11 */
-}
-
-static int tray_manager_running(Display *d, Window *manager) {
-#if NO_X11
-	RAWFB_RET(0)
-	if (!d || !manager) {}
-	return 0;
-#else
-	char tray_string[100];
-	Atom tray_manager;
-	Window tray_win;
-
-	RAWFB_RET(0)
-
-	if (manager) {
-		*manager = None;
-	}
-	sprintf(tray_string, "_NET_SYSTEM_TRAY_S%d", scr);
-
-	tray_manager = XInternAtom(d, tray_string, True);
-	if (tray_manager == None) {
-		return 0;
-	}
-
-	tray_win = XGetSelectionOwner(d, tray_manager);
-	if (manager) {
-		*manager = tray_win;
-	}
-
-	if (tray_win == None) {
-		return 0;
-	} else {
-		return 1;
-	}
-#endif	/* NO_X11 */
-}
-
-static char *gui_geometry = NULL;
-static int icon_in_tray = 0;
-static char *icon_mode_embed_id = NULL;
-static char *icon_mode_font = NULL;
-static char *icon_mode_params = NULL;
-
-static int got_sigusr1 = 0;
-
-static void sigusr1 (int sig) {
-	got_sigusr1 = 1;
-	if (0) sig = 0;
-}
-
-/* Most of the following mess is for wish on Solaris: */
-
-static char *extra_path = ":/usr/local/bin:/usr/bin/X11:/usr/sfw/bin"
-	    ":/usr/X11R6/bin:/usr/openwin/bin:/usr/dt/bin:/opt/sfw/bin";
-static char *wishes[] = {"wish8.4", "wish", "wish8.3", "wish8.5", "wish8.6", "wish8.7", "wishx", "wish8.0", NULL};
-
-static void run_gui(char *gui_xdisplay, int connect_to_x11vnc, int start_x11vnc,
-    int simple_gui, pid_t parent, char *gui_opts) {
-	char *x11vnc_xdisplay = NULL;
-	char cmd[100];
-	char *wish = NULL, *orig_path, *full_path, *tpath, *p;
-	char *old_xauth = NULL;
-	int try_max = 4, sleep = 300, totms, rc = 0;
-	pid_t mypid = getpid();
-	FILE *pipe, *tmpf;
-
-if (0) fprintf(stderr, "run_gui: %s -- %d %d\n", gui_xdisplay, connect_to_x11vnc, (int) parent);
-	if (*gui_code == '\0') {
-		rfbLog("gui: gui not compiled into this program.\n");
-		exit(0);
-	}
-	if (getenv("DISPLAY") != NULL) {
-		/* worst case */
-		x11vnc_xdisplay = strdup(getenv("DISPLAY"));
-	}
-	if (use_dpy) {
-		/* better */
-		x11vnc_xdisplay = strdup(use_dpy);
-	}
-	if (connect_to_x11vnc) {
-		int i;
-		rfbLogEnable(1);
-		if (! client_connect_file) {
-			if (getenv("XAUTHORITY") != NULL) {
-				old_xauth = strdup(getenv("XAUTHORITY"));
-			} else {
-				old_xauth = strdup("");
-			}
-			dpy = XOpenDisplay_wr(x11vnc_xdisplay); 
-			if (! dpy && auth_file) {
-				set_env("XAUTHORITY", auth_file);
-				dpy = XOpenDisplay_wr(x11vnc_xdisplay);
-			}
-			if (! dpy && ! x11vnc_xdisplay) {
-				/* worstest case */
-				x11vnc_xdisplay = strdup(":0");
-				dpy = XOpenDisplay_wr(x11vnc_xdisplay); 
-			}
-			if (! dpy) {
-				rfbLog("gui: could not open x11vnc "
-				    "display: %s\n", NONUL(x11vnc_xdisplay));
-#ifdef MACOSX
-				goto macjump;
-#endif
-				exit(1);
-			}
-			scr = DefaultScreen(dpy);
-			rootwin = RootWindow(dpy, scr);
-			initialize_vnc_connect_prop();
-			initialize_x11vnc_remote_prop();
-		}
-
-#ifdef MACOSX
-		macjump:
-#endif
-		
-		signal(SIGUSR1, sigusr1);
-		got_sigusr1 = 0;
-		totms = 0;
-		while (totms < 3500) {
-			usleep(50*1000);
-			totms += 50;
-			if (got_sigusr1) {
-				fprintf(stderr, "\n");
-				if (! quiet) rfbLog("gui: got SIGUSR1\n");
-				break;
-			}
-			if (! start_x11vnc && totms >= 150) {
-				break;
-			}
-		}
-		signal(SIGUSR1, SIG_DFL);
-		if (! got_sigusr1) fprintf(stderr, "\n");
-
-		if (!quiet && ! got_sigusr1) {
-			rfbLog("gui: trying to contact a x11vnc server at X"
-			    " display %s ...\n", NONUL(x11vnc_xdisplay));
-		}
-
-		for (i=0; i<try_max; i++) {
-			if (! got_sigusr1) {
-				if (!quiet) {
-					rfbLog("gui: pinging %s try=%d ...\n",
-					    NONUL(x11vnc_xdisplay), i+1);
-				}
-				rc = send_remote_cmd("qry=ping", 1, 1);
-				if (rc == 0) {
-					break;
-				}
-			} else {
-				rc = 0;
-				break;
-			}
-			if (parent && mypid != parent && kill(parent, 0) != 0) {
-				rfbLog("gui: parent process %d has gone"
-				    " away: bailing out.\n", parent);
-				rc = 1;
-				break;
-			}
-			usleep(sleep*1000);
-		}
-		set_env("X11VNC_XDISPLAY", x11vnc_xdisplay);
-		if (getenv("XAUTHORITY") != NULL) {
-			set_env("X11VNC_AUTH_FILE", getenv("XAUTHORITY"));
-		}
-		if (rc == 0) {
-			rfbLog("gui: ping succeeded.\n");
-			set_env("X11VNC_CONNECT", "1");
-		} else {
-			rfbLog("gui: could not connect to: '%s', try"
-			    " again manually.\n", x11vnc_xdisplay);
-		}
-		if (client_connect_file) {
-			set_env("X11VNC_CONNECT_FILE", client_connect_file);
-		}
-		if (dpy)  {
-			XCloseDisplay_wr(dpy);
-			dpy = NULL;
-		}
-		if (old_xauth) {
-			if (*old_xauth == '\0') {
-				/* wasn't set, hack it out if it is now */
-				char *xauth = getenv("XAUTHORITY");
-				if (xauth) {
-					*(xauth-2) = '_';	/* yow */
-				}
-			} else {
-				set_env("XAUTHORITY", old_xauth);
-			}
-			free(old_xauth);
-		}
-		rfbLogEnable(0);
-	}
-
-	orig_path = getenv("PATH");
-	if (! orig_path) {
-		orig_path = strdup("/bin:/usr/bin:/usr/bin/X11");
-	}
-	full_path = (char *) malloc(strlen(orig_path)+strlen(extra_path)+1);
-	strcpy(full_path, orig_path);
-	strcat(full_path, extra_path);
-
-	tpath = strdup(full_path);
-	p = strtok(tpath, ":");
-
-	while (p) {
-		char *try;
-		struct stat sbuf;
-		int i;
-
-		try = (char *) malloc(strlen(p) + 1 + strlen("wish8.4") + 1);
-		i = 0;
-		while (wishes[i] != NULL) {
-			sprintf(try, "%s/%s", p, wishes[i]);
-			if (stat(try, &sbuf) == 0) {
-				/* assume executable, should check mode */
-				wish = wishes[i];
-				break;
-			}
-			i++;
-		}
-		free(try);
-		if (wish) {
-			break;
-		}
-		p = strtok(NULL, ":");
-	}
-	free(tpath);
-	if (!wish) {
-		wish = strdup("wish");
-	}
-	if (getenv("WISH")) {
-		char *w = getenv("WISH");
-		if (strcmp(w, "")) {
-			wish = strdup(w);
-		}
-	}
-	if (getenv("DEBUG_WISH")) {
-		fprintf(stderr, "wish: %s\n", wish);
-	}
-	set_env("PATH", full_path);
-	set_env("DISPLAY", gui_xdisplay);
-	set_env("X11VNC_PROG", program_name);
-	set_env("X11VNC_CMDLINE", program_cmdline);
-	set_env("X11VNC_WISHCMD", wish);
-	if (simple_gui) {
-		set_env("X11VNC_SIMPLE_GUI", "1");
-	}
-	if (gui_opts) {
-		set_env("X11VNC_GUI_PARAMS", gui_opts);
-	}
-	if (gui_geometry) {
-		set_env("X11VNC_GUI_GEOM", gui_geometry);
-	}
-	if (start_x11vnc) {
-		set_env("X11VNC_STARTED", "1");
-	}
-	if (icon_mode) {
-		set_env("X11VNC_ICON_MODE", "1");
-		if (icon_mode_file) {
-			set_env("X11VNC_CLIENT_FILE", icon_mode_file);
-		}
-		if (icon_in_tray) {
-			if (tray_manager_ok) {
-				set_env("X11VNC_ICON_MODE", "TRAY:RUNNING");
-			} else {
-				set_env("X11VNC_ICON_MODE", "TRAY");
-			}
-		} else {
-			set_env("X11VNC_ICON_MODE", "ICON");
-		}
-		if (icon_mode_params) {
-			char *p, *str = strdup(icon_mode_params);
-			p = strtok(str, ":-/,.+");
-			while (p) {
-				if(strstr(p, "setp") == p) {
-					set_env("X11VNC_ICON_SETPASS", "1");
-					if (rc != 0) {
-						set_env("X11VNC_SETPASS_FAIL", "1");
-					}
-				} else if(strstr(p, "noadvanced") == p) {
-					set_env("X11VNC_ICON_NOADVANCED", "1");
-				} else if(strstr(p, "minimal") == p) {
-					set_env("X11VNC_ICON_MINIMAL", "1");
-				} else if (strstr(p, "0x") == p) {
-					set_env("X11VNC_ICON_EMBED_ID", p);
-					icon_mode_embed_id = strdup(p);
-				}
-				p = strtok(NULL, ":-/,.+");
-			}
-			free(str);
-		}
-	}
-	if (icon_mode_font) {
-		set_env("X11VNC_ICON_FONT", icon_mode_font);
-	}
-
-	/* gui */
-	if (no_external_cmds || !cmd_ok("gui")) {
-		fprintf(stderr, "cannot run external commands in -nocmds "
-		    "mode:\n");
-		fprintf(stderr, "   \"%s\"\n", "gui + wish");
-		fprintf(stderr, "   exiting.\n");
-		fflush(stderr);
-		exit(1);
-	}
-
-	tmpf = tmpfile();
-	if (tmpf == NULL) {
-		/* if no tmpfile, use a pipe */
-		if (icon_mode_embed_id) {
-			if (strlen(icon_mode_embed_id) < 20) {
-				strcat(cmd, " -use ");
-				strcat(cmd, icon_mode_embed_id);
-			}
-		}
-		close_exec_fds();
-		pipe = popen(cmd, "w");
-		if (! pipe) {
-			fprintf(stderr, "could not run: %s\n", cmd);
-			perror("popen");
-		}
-		fprintf(pipe, "%s", gui_code);
-		pclose(pipe);
-	} else {
-		/*
-		 * we prefer a tmpfile since then this x11vnc process
-		 * will then be gone, otherwise the x11vnc program text
-		 * will still be in use.
-		 */
-		int n = fileno(tmpf);
-		fprintf(tmpf, "%s", gui_code);
-		fflush(tmpf);
-		rewind(tmpf);
-		dup2(n, 0);
-		close(n);
-		if (icon_mode_embed_id) {
-			execlp(wish, wish, "-", "-use", icon_mode_embed_id,
-			    (char *) NULL); 
-		} else {
-			execlp(wish, wish, "-", (char *) NULL); 
-		}
-		fprintf(stderr, "could not exec wish: %s -\n", wish);
-		perror("execlp");
-	}
-	exit(0);
-}
-
-void do_gui(char *opts, int sleep) {
-	char *s, *p;
-	char *old_xauth = NULL;
-	char *gui_xdisplay = NULL;
-	int got_gui_xdisplay = 0;
-	int start_x11vnc = 1;
-	int connect_to_x11vnc = 0;
-	int simple_gui = 0, none_gui = 0;
-	int portprompt = 0;
-	Display *test_dpy;
-
-	if (opts) {
-		s = strdup(opts);
-	} else {
-		s = strdup("");
-	}
-
-	if (use_dpy) {
-		/* worst case */
-		gui_xdisplay = strdup(use_dpy);
-		
-	}
-	if (getenv("DISPLAY") != NULL) {
-		/* better */
-		gui_xdisplay = strdup(getenv("DISPLAY"));
-	}
-
-	p = strtok(s, ",");
-
-	while(p) {
-		if (*p == '\0') {
-			;
-		} else if (strchr(p, ':') != NULL) {
-			/* best */
-			if (gui_xdisplay) {
-				free(gui_xdisplay);
-			}
-			gui_xdisplay = strdup(p);
-			got_gui_xdisplay = 1;
-		} else if (!strcmp(p, "wait")) {
-			start_x11vnc = 0;
-			connect_to_x11vnc = 0;
-		} else if (!strcmp(p, "none")) {
-			none_gui = 1;
-		} else if (!strcmp(p, "portprompt")) {
-			start_x11vnc = 0;
-			connect_to_x11vnc = 0;
-			portprompt = 1;
-		} else if (!strcmp(p, "conn") || !strcmp(p, "connect")) {
-			start_x11vnc = 0;
-			connect_to_x11vnc = 1;
-		} else if (!strcmp(p, "ez") || !strcmp(p, "simple")) {
-			simple_gui = 1;
-		} else if (strstr(p, "iconfont") == p) {
-			char *q;
-			if ((q = strchr(p, '=')) != NULL) {
-				icon_mode_font = strdup(q+1);
-			}
-		} else if (strstr(p, "full") == p) {
-			if (strstr(p, "setp") && 0) {
-				set_env("X11VNC_ICON_MODE", "2");
-				set_env("X11VNC_ICON_SETPASS", "2");
-			}
-		} else if (strstr(p, "tray") == p || strstr(p, "icon") == p) {
-			char *q;
-			icon_mode = 1;
-			if ((q = strchr(p, '=')) != NULL) {
-				icon_mode_params = strdup(q+1);
-				if (strstr(icon_mode_params, "setp")) {
-					deny_all = 1;
-				}
-			}
-			if (strstr(p, "tray") == p) {
-				icon_in_tray = 1;
-			}
-		} else if (strstr(p, "geom") == p) {
-			char *q;
-			if ((q = strchr(p, '=')) != NULL) {
-				gui_geometry = strdup(q+1);
-			}
-		} else {
-			fprintf(stderr, "unrecognized gui opt: %s\n", p);
-		}
-		
-		p = strtok(NULL, ",");
-	}
-	free(s);
-
-	if (none_gui) {
-		if (!start_x11vnc) {
-			exit(0);
-		}
-		return;
-	}
-	if (start_x11vnc) {
-		connect_to_x11vnc = 1;
-	}
-
-
-#ifdef MACOSX
-	goto startit;
-#endif
-
-	if (icon_mode && !got_gui_xdisplay) {
-		/* for tray mode, prefer the polled DISPLAY */
-		if (use_dpy) {
-			if (gui_xdisplay) {
-				free(gui_xdisplay);
-			}
-			gui_xdisplay = strdup(use_dpy);
-		}
-	}
-
-	if (! gui_xdisplay) {
-		fprintf(stderr, "error: cannot determine X DISPLAY for gui"
-		    " to display on.\n");
-		exit(1);
-	}
-	if (!quiet && !portprompt) {
-		fprintf(stderr, "starting gui, trying display: %s\n",
-		    gui_xdisplay);
-	}
-	test_dpy = XOpenDisplay_wr(gui_xdisplay);
-	if (! test_dpy && auth_file) {
-		if (getenv("XAUTHORITY") != NULL) {
-			old_xauth = strdup(getenv("XAUTHORITY"));
-		}
-		set_env("XAUTHORITY", auth_file);
-		test_dpy = XOpenDisplay_wr(gui_xdisplay);
-	}
-	if (! test_dpy) {
-		if (! old_xauth && getenv("XAUTHORITY") != NULL) {
-			old_xauth = strdup(getenv("XAUTHORITY"));
-		}
-		set_env("XAUTHORITY", "");
-		test_dpy = XOpenDisplay_wr(gui_xdisplay);
-	}
-	if (! test_dpy) {
-		fprintf(stderr, "error: cannot connect to gui X DISPLAY: %s\n",
-		    gui_xdisplay);
-		exit(1);
-	}
-	if (icon_mode && icon_in_tray) {
-		if (tray_manager_running(test_dpy, NULL)) {
-			tray_manager_ok = 1;
-		} else {
-			tray_manager_ok = 0;
-		}
-	}
-	XCloseDisplay_wr(test_dpy);
-
-#ifdef MACOSX
-	startit:
-#endif
-	if (portprompt) {
-		char *cmd, *p, *p2, *p1, *p0 = getenv("PATH");
-		char tf1[] = "/tmp/x11vnc_port_prompt.2XXXXXX";
-		char tf2[] = "/tmp/x11vnc_port_prompt.1XXXXXX";
-		int fd;
-		char *dstr = "", *wish = NULL;
-		char line[128];
-		FILE *fp;
-
-		if (no_external_cmds || !cmd_ok("gui")) {
-			return;
-		}
-
-		if (gui_xdisplay) {
-			dstr = gui_xdisplay;
-			if (strchr(gui_xdisplay, '\'')) {
-				return;
-			}
-		}
-		if (!p0) {
-			p0 = "";
-		}
-		if (strchr(p0, '\'')) {
-			return;
-		}
-
-		fd = mkstemp(tf2);
-		if (fd < 0) {
-			return;
-		}
-		close(fd);
-
-		fd = mkstemp(tf1);
-		if (fd < 0) {
-			unlink(tf2);
-			return;
-		}
-
-		write(fd, gui_code, strlen(gui_code));
-		close(fd);
-
-		p1 = (char *) malloc(10 + strlen(p0) + strlen(extra_path));
-		sprintf(p1, "%s:%s", p0, extra_path);
-		p2 = strdup(p1);
-		p = strtok(p2, ":");
-
-		while (p) {
-			char *try;
-			struct stat sbuf;
-			int i;
-
-			try = (char *) malloc(strlen(p) + 1 + strlen("wish8.4") + 1);
-			i = 0;
-			while (wishes[i] != NULL) {
-				sprintf(try, "%s/%s", p, wishes[i]);
-				if (stat(try, &sbuf) == 0) {
-					/* assume executable, should check mode */
-					wish = wishes[i];
-					break;
-				}
-				i++;
-			}
-			free(try);
-			if (wish) {
-				break;
-			}
-			p = strtok(NULL, ":");
-		}
-		free(p2);
-
-		if (!wish) {
-			wish = "wish";
-		}
-
-		cmd = (char *) malloc(200 + strlen(dstr) + strlen(p1));
-
-		if (!strcmp(dstr, "")) {
-			sprintf(cmd, "env PATH='%s' %s %s -name x11vnc_port_prompt -portprompt > %s", p1, wish, tf1, tf2);
-		} else {
-			sprintf(cmd, "env PATH='%s' DISPLAY='%s' %s %s -name x11vnc_port_prompt -portprompt > %s", p1, dstr, wish, tf1, tf2);
-		}
-		if (getenv("X11VNC_DEBUG_PORTPROMPT")) {
-			fprintf(stderr, "cmd=%s\n", cmd);
-		}
-		if (use_openssl) {
-			set_env("X11VNC_SSL_ENABLED", "1");
-		}
-		if (allow_list && !strcmp(allow_list, "127.0.0.1")) {
-			set_env("X11VNC_LOCALHOST_ENABLED", "1");
-		}
-		if (got_ultrafilexfer) {
-			set_env("X11VNC_FILETRANSFER_ENABLED", "ultra");
-		} else if (tightfilexfer) {
-			set_env("X11VNC_FILETRANSFER_ENABLED", "tight");
-		}
-		system(cmd);
-		free(cmd);
-		free(p1);
-
-		fp = fopen(tf2, "r");
-		memset(line, 0, sizeof(line));
-		if (fp) {
-			fgets(line, 128, fp);
-			fclose(fp);
-			if (line[0] != '\0') {
-				int readport = atoi(line);
-				if (readport > 0) {
-					got_rfbport_val = readport;
-				}
-			}
-		}
-
-		if (strstr(line, "ssl0")) {
-			if (use_openssl) use_openssl = 0;
-		} else if (strstr(line, "ssl1")) {
-			if (!use_openssl) {
-				use_openssl = 1;
-				openssl_pem = strdup("SAVE_NOPROMPT");
-				set_env("X11VNC_GOT_SSL", "1");
-			}
-		}
-
-		if (strstr(line, "localhost0")) {
-			if (allow_list && !strcmp(allow_list, "127.0.0.1")) {
-				allow_list = NULL;
-			}
-		} else if (strstr(line, "localhost1")) {
-			allow_list = strdup("127.0.0.1");
-		}
-
-		if (strstr(line, "ft_ultra")) {
-			got_ultrafilexfer = 1;
-			tightfilexfer = 0;
-		} else if (strstr(line, "ft_tight")) {
-			got_ultrafilexfer = 0;
-			tightfilexfer = 1;
-		} else if (strstr(line, "ft_none")) {
-			got_ultrafilexfer = 0;
-			tightfilexfer = 0;
-		}
-
-		unlink(tf1);
-		unlink(tf2);
-
-		if (old_xauth) {
-			set_env("XAUTHORITY", old_xauth);
-		}
-
-		return;
-	}
-
-	if (start_x11vnc) {
-
-#if LIBVNCSERVER_HAVE_FORK
-		/* fork into the background now */
-		int p;
-		pid_t parent = getpid();
-
-		if (icon_mode) {
-			char tf[] = "/tmp/x11vnc.tray.XXXXXX"; 
-			int fd;
-
-			fd = mkstemp(tf);
-			if (fd < 0) {
-				icon_mode = 0;
-			} else {
-				close(fd);
-				icon_mode_fh = fopen(tf, "w");
-				if (! icon_mode_fh) {
-					icon_mode = 0;
-				} else {
-					chmod(tf, 0400);
-					icon_mode_file = strdup(tf);
-					rfbLog("icon_mode_file=%s\n", icon_mode_file);
-					fprintf(icon_mode_fh, "none\n");
-					fprintf(icon_mode_fh, "none\n");
-					fflush(icon_mode_fh);
-					if (! got_connect_once) {
-						if (!client_connect && !connect_or_exit) {
-							/* want -forever for tray? */
-							connect_once = 0;
-						}
-					}
-				}
-			}
-		}
-
-		if ((p = fork()) > 0)  {
-			;	/* parent */
-		} else if (p == -1) {
-			fprintf(stderr, "could not fork\n");
-			perror("fork");
-			clean_up_exit(1);
-		} else {
-			if (sleep > 0) {
-				usleep(sleep * 1000 * 1000);
-			}
-			run_gui(gui_xdisplay, connect_to_x11vnc, start_x11vnc,
-			    simple_gui, parent, opts);
-			exit(1);
-		}
-		if (connect_to_x11vnc) {
-			run_gui_pid = p;
-			gui_pid = p;
-		}
-#else
-		fprintf(stderr, "system does not support fork: start "
-		    "x11vnc in the gui.\n");
-		start_x11vnc = 0;
-#endif
-	}
-	if (!start_x11vnc) {
-		run_gui(gui_xdisplay, connect_to_x11vnc, start_x11vnc,
-		    simple_gui, 0, opts);
-		exit(1);
-	}
-	if (old_xauth) {
-		set_env("XAUTHORITY", old_xauth);
-	}
-}
-
-
diff --git a/ica/x11/x11vnc/gui.h b/ica/x11/x11vnc/gui.h
deleted file mode 100644
index d097ddb..0000000
--- a/ica/x11/x11vnc/gui.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_GUI_H
-#define _X11VNC_GUI_H
-
-/* -- gui.h -- */
-
-extern int icon_mode;
-extern char *icon_mode_file;
-extern FILE *icon_mode_fh;
-extern int icon_mode_socks[];
-extern int tray_manager_ok;
-extern Window tray_request;
-extern Window tray_window;
-extern int tray_unembed;
-extern pid_t run_gui_pid;
-extern pid_t gui_pid;
-
-extern char *get_gui_code(void);
-extern int tray_embed(Window iconwin, int remove);
-extern void do_gui(char *opts, int sleep);
-
-#endif /* _X11VNC_GUI_H */
diff --git a/ica/x11/x11vnc/help.c b/ica/x11/x11vnc/help.c
deleted file mode 100644
index 5cd5c12..0000000
--- a/ica/x11/x11vnc/help.c
+++ /dev/null
@@ -1,6441 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- help.c -- */
-
-#include "x11vnc.h"
-#include "xdamage.h"
-#include "cursor.h"
-
-/*
- * text printed out under -help option
- */
-
-void print_help(int mode);
-void print_license(void);
-void xopen_display_fail_message(char *disp);
-void nopassword_warning_msg(int gotloc);
-
-
-void print_help(int mode) {
-#if !SKIP_HELP
-	char help[] = 
-"\n"
-"x11vnc: allow VNC connections to real X11 displays. %s\n"
-"\n"
-"(type \"x11vnc -opts\" to just list the options.)\n"
-"\n"
-"Typical usage is:\n"
-"\n"
-"   Run this command in a shell on the remote machine \"far-host\"\n"
-"   with X session you wish to view:\n"
-"\n"
-"       x11vnc -display :0\n"
-"\n"
-"   Then run this in another window on the machine you are sitting at:\n"
-"\n"
-"       vncviewer far-host:0\n"
-"\n"
-"Once x11vnc establishes connections with the X11 server and starts listening\n"
-"as a VNC server it will print out a string: PORT=XXXX where XXXX is typically\n"
-"5900 (the default VNC server port).  One would next run something like\n"
-"this on the local machine: \"vncviewer hostname:N\" where \"hostname\" is\n"
-"the name of the machine running x11vnc and N is XXXX - 5900, i.e. usually\n"
-"\"vncviewer hostname:0\".\n"
-"\n"
-"By default x11vnc will not allow the screen to be shared and it will exit\n"
-"as soon as the client disconnects.  See -shared and -forever below to override\n"
-"these protections.  See the FAQ for details how to tunnel the VNC connection\n"
-"through an encrypted channel such as ssh(1).  In brief:\n"
-"\n"
-"       ssh -t -L 5900:localhost:5900 far-host 'x11vnc -localhost -display :0'\n"
-"\n"
-"       vncviewer -encodings 'copyrect tight zrle hextile' localhost:0\n"
-"\n"
-"Also, use of a VNC password (-rfbauth or -passwdfile) is strongly recommended.\n"
-"\n"
-"For additional info see: http://www.karlrunge.com/x11vnc/\n"
-"                    and  http://www.karlrunge.com/x11vnc/faq.html\n"
-"\n"
-"\n"
-"Config file support: if the file $HOME/.x11vncrc exists then each line in\n"
-"it is treated as a single command line option.  Disable with -norc.  For\n"
-"each option name, the leading character \"-\" is not required.  E.g. a line\n"
-"that is either \"forever\" or \"-forever\" may be used and are equivalent.\n"
-"Likewise \"wait 100\" or \"-wait 100\" are acceptable and equivalent lines.\n"
-"The \"#\" character comments out to the end of the line in the usual way\n"
-"(backslash it for a literal).  Leading and trailing whitespace is trimmed off.\n"
-"Lines may be continued with a \"\\\" as the last character of a line (it\n"
-"becomes a space character).\n"
-"\n"
-"Options:\n"
-"\n"
-"-display disp          X11 server display to connect to, usually :0.  The X\n"
-"                       server process must be running on same machine and\n"
-"                       support MIT-SHM.  Equivalent to setting the DISPLAY\n"
-"                       environment variable to \"disp\".\n"
-"\n"
-"                       See the description below of the \"-display WAIT:...\"\n"
-"                       extensions, where alias \"-find\" will find the user's\n"
-"                       display automatically, and \"-create\" will create a\n"
-"                       Xvfb session if no session is found.\n"
-"\n"
-"-auth file             Set the X authority file to be \"file\", equivalent to\n"
-"                       setting the XAUTHORITY environment variable to \"file\"\n"
-"                       before startup.  Same as -xauth file.  See Xsecurity(7),\n"
-"                       xauth(1) man pages for more info.\n"
-"\n"
-"                       Use '-auth guess' to have x11vnc use its -findauth\n"
-"                       mechanism (described below) to try to guess the\n"
-"                       XAUTHORITY filename and use it.\n"
-"\n"
-"                       XDM/GDM/KDM: if you are running x11vnc as root and want\n"
-"                       to find the XAUTHORITY before anyone has logged into an\n"
-"                       X session yet, use: x11vnc -env FD_XDM=1 -auth guess ...\n"
-"                       (This will also find the XAUTHORITY if a user is already\n"
-"                       logged into the X session.)  When running as root,\n"
-"                       FD_XDM=1 will be tried if the initial -auth guess fails.\n"
-"\n"
-"-N                     If the X display is :N, try to set the VNC display to\n"
-"                       also be :N This just sets the -rfbport option to 5900+N\n"
-"                       The program will exit immediately if that port is not\n"
-"                       available. The -N option only works with normal -display\n"
-"                       usage, e.g. :0 or :8, -N is ignored in the -display\n"
-"                       WAIT:..., -create, -find, -svc, -redirect, etc modes.\n"
-"\n"
-"-autoport n            Automatically probe for a free VNC port starting at n.\n"
-"                       The default is to start probing at 5900.  Use this to\n"
-"                       stay away from other VNC servers near 5900.\n"
-"\n"
-"-rfbport str           The VNC port to listen on (a LibVNCServer option), e.g.\n"
-"                       5900, 5901, etc.  If specified as \"-rfbport PROMPT\"\n"
-"                       then the x11vnc -gui is used to prompt the user to\n"
-"                       enter the port number.\n"
-"\n"
-#if X11VNC_IPV6
-"-6                     IPv6 listening support.  In addition to IPv4, the\n"
-"                       IPv6 address is listened on for incoming connections.\n"
-"                       The same port number as IPv4 is used.\n"
-"\n"
-#if X11VNC_LISTEN6
-"                       NOTE:  This x11vnc binary was compiled to have the\n"
-"                       \"-6\" IPv6 listening mode ENABLED by default (CPPFLAGS\n"
-"                       -DX11VNC_LISTEN6=1).  So to disable IPv6 listening mode\n"
-"                       you MUST supply the \"-no6\" option (see below.)\n"
-#else
-"                       NOTE:  This x11vnc binary was compiled to have\n"
-"                       the \"-6\" IPv6 listening mode DISABLED by default\n"
-"                       (CPPFLAGS -DX11VNC_LISTEN6=0).\n"
-#endif
-"\n"
-"                       The \"-6\" mode works for both normal connections and\n"
-"                       -ssl encrypted ones.  Nearly everything is supported\n"
-"                       for the IPv6 case, but there are a few exceptions.\n"
-"                       See -stunnel for its IPv6 support.\n"
-"\n"
-"                       Currently, for absolutely everything to work correctly\n"
-"                       the machine may need to have some IPv4 support, at the\n"
-"                       least for the loopback interface.  However, for nearly\n"
-"                       all usage modes no IPv4 support is required. See -nopiv4.\n"
-"\n"
-"                       If you have trouble compiling or running in IPv6 mode,\n"
-"                       set -DX11VNC_IPV6=0 in CPPFLAGS when configuring to\n"
-"                       disable IPv6 support.\n"
-"\n"
-"-no6                   Disable IPv6 listening support (only useful if the\n"
-"                       \"-6\" mode is compiled in to be the default; see the\n"
-"                       X11VNC_LISTEN6 description above under \"-6\".)\n"
-"\n"
-"-noipv6                Do not try to use IPv6 for any listening or connecting\n"
-"                       sockets.  This includes both the listening service\n"
-"                       port(s) and outgoing connections from -connect,\n"
-"                       -connect_or_exit, or -proxy.  Use this if you are having\n"
-"                       problems due to IPv6.\n"
-"\n"
-"-noipv4                Do not try to use IPv4 for any listening or connecting\n"
-"                       sockets.  This is mainly for exploring the behavior of\n"
-"                       x11vnc on an IPv6-only system, but may have other uses.\n"
-"\n"
-#endif
-"-reopen                If the X server connection is disconnected, try to\n"
-"                       reopen the X display (up to one time.)  This is of use\n"
-"                       for display managers like GDM (KillInitClients option)\n"
-"                       that kill x11vnc just after the user logs into the\n"
-"                       X session.  Note: the reopened state may be unstable.\n"
-"                       Set X11VNC_REOPEN_DISPLAY=n to reopen n times and\n"
-"                       set X11VNC_REOPEN_SLEEP_MAX to the number of seconds,\n"
-"                       default 10, to keep trying to reopen the display (once\n"
-"                       per second.)\n"
-"\n"
-"                       Update: as of 0.9.9, x11vnc tries to automatically avoid\n"
-"                       being killed by the display manager by delaying creating\n"
-"                       windows or using XFIXES.  So you shouldn't need to use\n"
-"                       KillInitClients=false as long as you log in quickly\n"
-"                       enough (within 45 seconds of connecting.)  You can\n"
-"                       disable this by setting X11VNC_AVOID_WINDOWS=never.\n"
-"                       You can also set it to the number of seconds to delay.\n"
-"\n"
-"-reflect host:N        Instead of connecting to and polling an X display,\n"
-"                       connect to the remote VNC server host:N and be a\n"
-"                       reflector/repeater for it.  This is useful for trying\n"
-"                       to manage the case of many simultaneous VNC viewers\n"
-"                       (e.g. classroom broadcasting) where, e.g. you put\n"
-"                       a repeater on each network switch, etc, to improve\n"
-"                       performance by distributing the load and network\n"
-"                       traffic.  Implies -shared (use -noshared as a later\n"
-"                       option to disable). See the discussion below under\n"
-"                       -rawfb vnc:host:N for more details.\n"
-"\n"
-"-id windowid           Show the X window corresponding to \"windowid\" not\n"
-"                       the entire display.  New windows like popup menus,\n"
-"                       transient toplevels, etc, may not be seen or may be\n"
-"                       clipped.  Disabling SaveUnders or BackingStore in the\n"
-"                       X server may help show them.  x11vnc may crash if the\n"
-"                       window is initially partially obscured, changes size,\n"
-"                       is iconified, etc.  Some steps are taken to avoid this\n"
-"                       and the -xrandr mechanism is used to track resizes.  Use\n"
-"                       xwininfo(1) to get the window id, or use \"-id pick\"\n"
-"                       to have x11vnc run xwininfo(1) for you and extract\n"
-"                       the id.  The -id option is useful for exporting very\n"
-"                       simple applications (e.g. the current view on a webcam).\n"
-"-sid windowid          As -id, but instead of using the window directly it\n"
-"                       shifts a root view to it: this shows SaveUnders menus,\n"
-"                       etc, although they will be clipped if they extend beyond\n"
-"                       the window.\n"
-"\n"
-"-appshare              Simple application sharing based on the -id/-sid\n"
-"                       mechanism.  Every new toplevel window that the\n"
-"                       application creates induces a new viewer window via\n"
-"                       a reverse connection.  The -id/-sid and -connect\n"
-"                       options are required.  Run 'x11vnc -appshare -help'\n"
-"                       for more info.\n"
-"\n"
-#if 0
-"-freeze_when_obscured  Probably only of use in -appshare mode: if the -id/-sid\n"
-"                       window is partially or fully obscured by other windows,\n"
-"                       stop checking for framebuffer updates.  Mouse and\n"
-"                       keyboard events are still processed and injected.\n"
-"\n"
-#endif
-"-clip WxH+X+Y          Only show the sub-region of the full display that\n"
-"                       corresponds to the rectangle geometry with size WxH and\n"
-"                       offset +X+Y.  The VNC display has size WxH (i.e. smaller\n"
-"                       than the full display).  This also works for -id/-sid\n"
-"                       mode where the offset is relative to the upper left\n"
-"                       corner of the selected window.  An example use of this\n"
-"                       option would be to split a large (e.g. Xinerama) display\n"
-"                       into two parts to be accessed via separate viewers by\n"
-"                       running a separate x11vnc on each part.\n"
-"\n"
-"                       Use '-clip xinerama0' to clip to the first xinerama\n"
-"                       sub-screen (if xinerama is active).  xinerama1 for the\n"
-"                       2nd sub-screen, etc.  This way you don't need to figure\n"
-"                       out the WxH+X+Y of the desired xinerama sub-screen.\n"
-"                       screens are sorted in increasing distance from the\n"
-"                       (0,0) origin (I.e. not the Xserver's order).\n"
-"\n"
-"-flashcmap             In 8bpp indexed color, let the installed colormap flash\n"
-"                       as the pointer moves from window to window (slow).\n"
-"                       Also try the -8to24 option to avoid flash altogether.\n"
-"-shiftcmap n           Rare problem, but some 8bpp displays use less than 256\n"
-"                       colorcells (e.g. 16-color grayscale, perhaps the other\n"
-"                       bits are used for double buffering) *and* also need to\n"
-"                       shift the pixels values away from 0, .., ncells.  \"n\"\n"
-"                       indicates the shift to be applied to the pixel values.\n"
-"                       To see the pixel values set DEBUG_CMAP=1 to print out\n"
-"                       a colormap histogram.  Example: -shiftcmap 240\n"
-"-notruecolor           For 8bpp displays, force indexed color (i.e. a colormap)\n"
-"                       even if it looks like 8bpp TrueColor (rare problem).\n"
-"-advertise_truecolor   If the X11 display is indexed color, lie to clients\n"
-"                       when they first connect by telling them it is truecolor.\n"
-"                       To workaround RealVNC: inPF has colourMap but not 8bpp\n"
-"                       Use '-advertise_truecolor reset' to reset client fb too.\n"
-"\n"
-"-visual n              This option probably does not do what you think.\n"
-"                       It simply *forces* the visual used for the framebuffer;\n"
-"                       this may be a bad thing... (e.g. messes up colors or\n"
-"                       cause a crash). It is useful for testing and for some\n"
-"                       workarounds.  n may be a decimal number, or 0x hex.\n"
-"                       Run xdpyinfo(1) for the values.  One may also use\n"
-"                       \"TrueColor\", etc. see <X11/X.h> for a list.  If the\n"
-"                       string ends in \":m\" then for better or for worse\n"
-"                       the visual depth is forced to be m.  You may want to\n"
-"                       use -noshm when using this option (so XGetImage may\n"
-"                       automatically translate the pixel data).\n"
-"\n"
-"-overlay               Handle multiple depth visuals on one screen, e.g. 8+24\n"
-"                       and 24+8 overlay visuals (the 32 bits per pixel are\n"
-"                       packed with 8 for PseudoColor and 24 for TrueColor).\n"
-"\n"
-"                       Currently -overlay only works on Solaris via\n"
-"                       XReadScreen(3X11) and IRIX using XReadDisplay(3).\n"
-"                       On Solaris there is a problem with image \"bleeding\"\n"
-"                       around transient popup menus (but not for the menu\n"
-"                       itself): a workaround is to disable SaveUnders\n"
-"                       by passing the \"-su\" argument to Xsun (in\n"
-"                       /etc/dt/config/Xservers).\n"
-"\n"
-"                       Use -overlay as a workaround for situations like these:\n"
-"                       Some legacy applications require the default visual to\n"
-"                       be 8bpp (8+24), or they will use 8bpp PseudoColor even\n"
-"                       when the default visual is depth 24 TrueColor (24+8).\n"
-"                       In these cases colors in some windows will be incorrect\n"
-"                       in x11vnc unless -overlay is used.  Another use of\n"
-"                       -overlay is to enable showing the exact mouse cursor\n"
-"                       shape (details below).\n"
-"\n"
-"                       Under -overlay, performance will be somewhat slower\n"
-"                       due to the extra image transformations required.\n"
-"                       For optimal performance do not use -overlay, but rather\n"
-"                       configure the X server so that the default visual is\n"
-"                       depth 24 TrueColor and try to have all apps use that\n"
-"                       visual (e.g. some apps have -use24 or -visual options).\n"
-"-overlay_nocursor      Sets -overlay, but does not try to draw the exact mouse\n"
-"                       cursor shape using the overlay mechanism.\n"
-"\n"
-"-8to24 [opts]          Try this option if -overlay is not supported on your\n"
-"                       OS, and you have a legacy 8bpp app that you want to\n"
-"                       view on a multi-depth display with default depth 24\n"
-"                       (and is 32 bpp) OR have a default depth 8 display with\n"
-"                       depth 24 overlay windows for some apps.  This option\n"
-"                       may not work on all X servers and hardware (tested\n"
-"                       on XFree86/Xorg mga driver and Xsun).  The \"opts\"\n"
-"                       string is not required and is described below.\n"
-"\n"
-"                       This mode enables a hack where x11vnc monitors windows\n"
-"                       within 3 levels from the root window.  If it finds\n"
-"                       any that are 8bpp it extracts the indexed color\n"
-"                       pixel values using XGetImage() and then applies a\n"
-"                       transformation using the colormap(s) to create TrueColor\n"
-"                       RGB values that it in turn inserts into bits 1-24 of\n"
-"                       the framebuffer.  This creates a depth 24 \"view\"\n"
-"                       of the display that is then exported via VNC.\n"
-"\n"
-"                       Conversely, for default depth 8 displays, the depth\n"
-"                       24 regions are read by XGetImage() and everything is\n"
-"                       transformed and inserted into a depth 24 TrueColor\n"
-"                       framebuffer.\n"
-"\n"
-"                       Note that even if there are *no* depth 24 visuals or\n"
-"                       windows (i.e. pure 8bpp), this mode is potentially\n"
-"                       an improvement over -flashcmap because it avoids the\n"
-"                       flashing and shows each window in the correct color.\n"
-"\n"
-"                       This method works OK, but may still have bugs and it\n"
-"                       does hog resources.  If there are multiple 8bpp windows\n"
-"                       using different colormaps, one may have to iconify all\n"
-"                       but one for the colors to be correct.\n"
-"\n"
-"                       There may be painting errors for clipping and switching\n"
-"                       between windows of depths 8 and 24.  Heuristics are\n"
-"                       applied to try to minimize the painting errors.  One can\n"
-"                       also press 3 Alt_L's in a row to refresh the screen\n"
-"                       if the error does not repair itself.  Also the option\n"
-"                       -fixscreen 8=3.0 or -fixscreen V=3.0 may be used to\n"
-"                       periodically refresh the screen at the cost of bandwidth\n"
-"                       (every 3 sec for this example).\n"
-"\n"
-"                       The [opts] string can contain the following settings.\n"
-"                       Multiple settings are separated by commas.\n"
-"\n"
-"                       For for some X servers with default depth 24 a\n"
-"                       speedup may be achieved via the option \"nogetimage\".\n"
-"                       This enables a scheme were XGetImage() is not used\n"
-"                       to retrieve the 8bpp data.  Instead, it assumes that\n"
-"                       the 8bpp data is in bits 25-32 of the 32bit X pixels.\n"
-"                       There is no requirement that the X server should put\n"
-"                       the data there for our poll requests, but some do and\n"
-"                       so the extra steps to retrieve it can be skipped.\n"
-"                       Tested with mga driver with XFree86/Xorg.  For the\n"
-"                       default depth 8 case this option is ignored.\n"
-"\n"
-"                       To adjust how often XGetImage() is used to poll the\n"
-"                       non-default visual regions for changes, use the option\n"
-"                       \"poll=t\" where \"t\" is a floating point time.\n"
-"                       (default: %.2f)\n"
-"\n"
-"                       Setting the option \"level2\" will limit the search\n"
-"                       for non-default visual windows to two levels from the\n"
-"                       root window.  Do this on slow machines where you know\n"
-"                       the window manager only imposes one extra window between\n"
-"                       the app window and the root window.\n"
-"\n"
-"                       Also for very slow machines use \"cachewin=t\"\n"
-"                       where t is a floating point amount of time to cache\n"
-"                       XGetWindowAttributes results.  E.g. cachewin=5.0.\n"
-"                       This may lead to the windows being unnoticed for this\n"
-"                       amount of time when deiconifying, painting errors, etc.\n"
-"\n"
-"                       While testing on a very old SS20 these options gave\n"
-"                       tolerable response: -8to24 poll=0.2,cachewin=5.0. For\n"
-"                       this machine -overlay is supported and gives better\n"
-"                       response.\n"
-"\n"
-"                       Debugging for this mode can be enabled by setting\n"
-"                       \"dbg=1\", \"dbg=2\", or \"dbg=3\".\n"
-"\n"
-"-24to32                Very rare problem: if the framebuffer (X display\n"
-"                       or -rawfb) is 24bpp instead of the usual 32bpp, then\n"
-"                       dynamically transform the pixels to 32bpp.  This will be\n"
-"                       slower, but can be used to work around problems where\n"
-"                       VNC viewers cannot handle 24bpp (e.g. \"main: setPF:\n"
-"                       not 8, 16 or 32 bpp?\").  See the FAQ for more info.\n"
-"\n"
-"                       In the case of -rawfb mode, the pixels are directly\n"
-"                       modified by inserting a 0 byte to pad them out to 32bpp.\n"
-"                       For X displays, a kludge is done that is equivalent to\n"
-"                       \"-noshm -visual TrueColor:32\".  (If better performance\n"
-"                       is needed for the latter, feel free to ask).\n"
-"\n"
-"-scale fraction        Scale the framebuffer by factor \"fraction\".  Values\n"
-"                       less than 1 shrink the fb, larger ones expand it. Note:\n"
-"                       the image may not be sharp and response may be slower.\n"
-"                       If \"fraction\" contains a decimal point \".\" it\n"
-"                       is taken as a floating point number, alternatively\n"
-"                       the notation \"m/n\" may be used to denote fractions\n"
-"                       exactly, e.g. -scale 2/3\n"
-"\n"
-"                       To scale asymmetrically in the horizontal and vertical\n"
-"                       directions, specify a WxH geometry to stretch to:\n"
-"                       e.g. '-scale 1024x768', or also '-scale 0.9x0.75'\n"
-"\n"
-"                       Scaling Options: can be added after \"fraction\" via\n"
-"                       \":\", to supply multiple \":\" options use commas.\n"
-"                       If you just want a quick, rough scaling without\n"
-"                       blending, append \":nb\" to \"fraction\" (e.g. -scale\n"
-"                       1/3:nb).  No blending is the default for 8bpp indexed\n"
-"                       color, to force blending for this case use \":fb\".\n"
-"\n"
-"                       To disable -scrollcopyrect and -wirecopyrect under\n"
-"                       -scale use \":nocr\".  If you need to to enable them use\n"
-"                       \":cr\" or specify them explicitly on the command line.\n"
-"                       If a slow link is detected, \":nocr\" may be applied\n"
-"                       automatically.  Default: %s\n"
-"\n"
-"                       More esoteric options: for compatibility with vncviewers\n"
-"                       the scaled width is adjusted to be a multiple of 4:\n"
-"                       to disable this use \":n4\".  \":in\" use interpolation\n"
-"                       scheme even when shrinking, \":pad\" pad scaled width\n"
-"                       and height to be multiples of scaling denominator\n"
-"                       (e.g. 3 for 2/3).\n"
-"\n"
-"-geometry WxH          Same as -scale WxH\n"
-"\n"
-"-scale_cursor frac     By default if -scale is supplied the cursor shape is\n"
-"                       scaled by the same factor.  Depending on your usage,\n"
-"                       you may want to scale the cursor independently of the\n"
-"                       screen or not at all.  If you specify -scale_cursor\n"
-"                       the cursor will be scaled by that factor.  When using\n"
-"                       -scale mode to keep the cursor at its \"natural\" size\n"
-"                       use \"-scale_cursor 1\".  Most of the \":\" scaling\n"
-"                       options apply here as well.\n"
-"\n"
-"-viewonly              All VNC clients can only watch (default %s).\n"
-"-shared                VNC display is shared, i.e. more than one viewer can\n"
-"                       connect at the same time (default %s).\n"
-"-once                  Exit after the first successfully connected viewer\n"
-"                       disconnects, opposite of -forever. This is the Default.\n"
-"-forever               Keep listening for more connections rather than exiting\n"
-"                       as soon as the first client(s) disconnect. Same as -many\n"
-"\n"
-"                       To get the standard non-shared VNC behavior where when\n"
-"                       a new VNC client connects the existing VNC client is\n"
-"                       dropped use:  -nevershared -forever   This method can\n"
-"                       also be used to guard against hung TCP connections that\n"
-"                       do not go away.\n"
-"\n"
-"-loop                  Create an outer loop restarting the x11vnc process\n"
-"                       whenever it terminates.  -bg and -inetd are ignored\n"
-"                       in this mode (however see -loopbg below).\n"
-"\n"
-"                       Useful for continuing even if the X server terminates\n"
-"                       and restarts (at that moment the process will need\n"
-"                       permission to reconnect to the new X server of course).\n"
-"\n"
-"                       Use, e.g., -loop100 to sleep 100 millisecs between\n"
-"                       restarts, etc.  Default is 2000ms (i.e. 2 secs) Use,\n"
-"                       e.g. -loop300,5 to sleep 300 ms and only loop 5 times.\n"
-"\n"
-"                       If -loopbg (plus any numbers) is specified instead,\n"
-"                       the \"-bg\" option is implied and the mode approximates\n"
-"                       inetd(8) usage to some degree.  In this case when\n"
-"                       it goes into the background any listening sockets\n"
-"                       (i.e. ports 5900, 5800) are closed, so the next one\n"
-"                       in the loop can use them.  This mode will only be of\n"
-"                       use if a VNC client (the only client for that process)\n"
-"                       is already connected before the process goes into the\n"
-"                       background, for example, usage of -display WAIT:..,\n"
-"                       -svc, and -connect can make use of this \"poor man's\"\n"
-"                       inetd mode.  The default wait time is 500ms in this\n"
-"                       mode.  This usage could use useful:  -svc -bg -loopbg\n"
-"\n"
-"-timeout n             Exit unless a client connects within the first n seconds\n"
-"                       after startup.\n"
-"\n"
-"                       If there have been no connection attempts after n\n"
-"                       seconds x11vnc exits immediately.  If a client is\n"
-"                       trying to connect but has not progressed to the normal\n"
-"                       operating state, x11vnc gives it a few more seconds\n"
-"                       to finish and exits if it does not make it to the\n"
-"                       normal state.\n"
-"\n"
-"                       For reverse connections via -connect or -connect_or_exit\n"
-"                       a timeout of n seconds will be set for all reverse\n"
-"                       connects.  If the connect timeout alarm goes off,\n"
-"                       x11vnc will exit immediately.\n"
-"\n"
-"-sleepin n             At startup sleep n seconds before proceeding (e.g. to\n"
-"                       allow redirs and listening clients to start up)\n"
-"\n"
-"                       If a range is given: '-sleepin min-max', a random value\n"
-"                       between min and max is slept. E.g. '-sleepin 0-20' and\n"
-"                       '-sleepin 10-30'.  Floats are allowed too.\n"
-"\n"
-"-inetd                 Launched by inetd(8): stdio instead of listening socket.\n"
-"                       Note: if you are not redirecting stderr to a log file\n"
-"                       (via shell 2> or -o option) you MUST also specify the -q\n"
-"                       option, otherwise the stderr goes to the viewer which\n"
-"                       will cause it to abort.  Specifying both -inetd and -q\n"
-"                       and no -o will automatically close the stderr.\n"
-"\n"
-"-tightfilexfer         Enable the TightVNC file transfer extension. Note that\n"
-"                       that when the -viewonly option is supplied all file\n"
-"                       transfers are disabled.  Also clients that log in\n"
-"                       viewonly cannot transfer files.  However, if the remote\n"
-"                       control mechanism is used to change the global or\n"
-"                       per-client viewonly state the filetransfer permissions\n"
-"                       will NOT change.\n"
-"\n"
-"                       IMPORTANT: please understand if -tightfilexfer is\n"
-"                       specified and you run x11vnc as root for, say, inetd\n"
-"                       or display manager (gdm, kdm, ...) access and you do\n"
-"                       not have it switch users via the -users option, then\n"
-"                       VNC Viewers that connect are able to do filetransfer\n"
-"                       reads and writes as *root*.\n"
-"\n"
-"                       Also, tightfilexfer is disabled in -unixpw mode.\n"
-"\n"
-"-ultrafilexfer         Note: to enable UltraVNC filetransfer and to get it to\n"
-"                       work you probably need to supply these LibVNCServer\n"
-"                       options: \"-rfbversion 3.6 -permitfiletransfer\"\n"
-"                       \"-ultrafilexfer\" is an alias for this combination.\n"
-"\n"
-"                       IMPORTANT: please understand if -ultrafilexfer is\n"
-"                       specified and you run x11vnc as root for, say, inetd\n"
-"                       or display manager (gdm, kdm, ...) access and you do\n"
-"                       not have it switch users via the -users option, then\n"
-"                       VNC Viewers that connect are able to do filetransfer\n"
-"                       reads and writes as *root*.\n"
-"\n"
-"                       Note that sadly you cannot do both -tightfilexfer and\n"
-"                       -ultrafilexfer at the same time because the latter\n"
-"                       requires setting the version to 3.6 and tightvnc will\n"
-"                       not do filetransfer when it sees that version number.\n"
-"\n"
-"-http                  Instead of using -httpdir (see below) to specify\n"
-"                       where the Java vncviewer applet is, have x11vnc try\n"
-"                       to *guess* where the directory is by looking relative\n"
-"                       to the program location and in standard locations\n"
-"                       (/usr/local/share/x11vnc/classes, etc).  Under -ssl or\n"
-"                       -stunnel the ssl classes subdirectory is sought.\n"
-"-http_ssl              As -http, but force lookup for ssl classes subdir.\n"
-"\n"
-"                       Note that for HTTPS, single-port Java applet delivery\n"
-"                       you can set X11VNC_HTTPS_DOWNLOAD_WAIT_TIME to the\n"
-"                       max number of seconds to wait for the applet download\n"
-"                       to finish.  The default is 15.\n"
-"\n"
-"-avahi                 Use the Avahi/mDNS ZeroConf protocol to advertise\n"
-"                       this VNC server to the local network. (Related terms:\n"
-"                       Rendezvous, Bonjour).  Depending on your setup, you\n"
-"                       may need to start avahi-daemon and open udp port 5353\n"
-"                       in your firewall.\n"
-"\n"
-"                       You can set X11VNC_AVAHI_NAME, X11VNC_AVAHI_HOST,\n"
-"                       and/or X11VNC_AVAHI_PORT environment variables\n"
-"                       to override the default values.  For example:\n"
-"                       -env X11VNC_AVAHI_NAME=wally\n"
-"\n"
-"                       If the avahi API cannot be found at build time, a helper\n"
-"                       program like avahi-publish(1) or dns-sd(1) will be tried\n"
-"\n"
-"-mdns                  Same as -avahi.\n"
-"-zeroconf              Same as -avahi.\n"
-"\n"
-"-connect string        For use with \"vncviewer -listen\" reverse connections.\n"
-"                       If \"string\" has the form \"host\" or \"host:port\"\n"
-"                       the connection is made once at startup.\n"
-"\n"
-"                       Use commas for a list of host's and host:port's.\n"
-"                       E.g. -connect host1,host2 or host1:0,host2:5678.\n"
-"                       Note that to reverse connect to multiple hosts at the\n"
-"                       same time you will likely need to also supply: -shared\n"
-"\n"
-"                       Note that unlike most vnc servers, x11vnc will require a\n"
-"                       password for reverse as well as for forward connections.\n"
-"                       (provided password auth has been enabled, -rfbauth, etc)\n"
-"                       If you do not want to require a password for reverse\n"
-"                       connections set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in\n"
-"                       your environment before starting x11vnc.\n"
-"\n"
-"                       If \"string\" contains \"/\" it is instead interpreted\n"
-"                       as a file to periodically check for new hosts.\n"
-"                       The first line is read and then the file is truncated.\n"
-"                       Be careful about the location of this file if x11vnc\n"
-"                       is running as root (e.g. via gdm(1), etc).\n"
-"\n"
-"\n"
-"                       Repeater mode: Some services provide an intermediate\n"
-"                       \"vnc repeater\": http://www.uvnc.com/addons/repeater.html\n"
-"                       (and also http://koti.mbnet.fi/jtko/ for linux port)\n"
-"                       that acts as a proxy/gateway.  Modes like these require\n"
-"                       an initial string to be sent for the reverse connection\n"
-"                       before the VNC protocol is started.  Here are the ways\n"
-"                       to do this:\n"
-"\n"
-"                         -connect pre=some_string+host:port\n"
-"                         -connect pre128=some_string+host:port\n"
-"                         -connect repeater=ID:1234+host:port\n"
-"                         -connect repeater=23.45.67.89::5501+host:port\n"
-"\n"
-"                       SSVNC notation is also supported:\n"
-"\n"
-"                         -connect repeater://host:port+ID:1234\n"
-"\n"
-"                       As with normal -connect usage, if the repeater port is\n"
-"                       not supplied 5500 is assumed.\n"
-"\n"
-"                       The basic idea is between the special tag, e.g. \"pre=\"\n"
-"                       and \"+\" is the pre-string to be sent.  Note that in\n"
-"                       this case host:port is the repeater server, NOT the\n"
-"                       vnc viewer.  Somehow the pre-string tells the repeater\n"
-"                       server how to find the vnc viewer and connect you to it.\n"
-"\n"
-"                       In the case pre=some_string+host:port, \"some_string\"\n"
-"                       is simply sent. In the case preNNN=some_string+host:port\n"
-"                       \"some_string\" is sent in a null padded buffer of\n"
-"                       length NNN.  repeater= is the same as pre250=, this is\n"
-"                       the ultravnc repeater buffer size.\n"
-"\n"
-"                       Strings like \"\\n\" and \"\\r\", etc. are expanded to\n"
-"                       newline and carriage return.  \"\\c\" is expanded to\n"
-"                       \",\" since the connect string is comma separated.\n"
-"\n"
-"                       See also the -proxy option below for additional ways\n"
-"                       to plumb reverse connections.\n"
-"\n"
-"                       Reverse SSL: using -connect in -ssl mode makes x11vnc\n"
-"                       act as an SSL client (initiates SSL connection) rather\n"
-"                       than an SSL server.  The idea is x11vnc might be\n"
-"                       connecting to stunnel on the viewer side with the\n"
-"                       viewer in listening mode.  If you do not want this\n"
-"                       behavior, use -env X11VNC_DISABLE_SSL_CLIENT_MODE=1.\n"
-"                       With this the viewer side can act as the SSL client\n"
-"                       as it normally does for forward connections.\n"
-"\n"
-"                       Reverse SSL Repeater mode:  This will work, but note\n"
-"                       that if the VNC Client does any sort of a 'Fetch Cert'\n"
-"                       action before connecting, then the Repeater will\n"
-"                       likely drop the connection and both sides will need\n"
-"                       to restart.  Consider the use of -connect_or_exit\n"
-"                       and -loop300,2 to have x11vnc reconnect once to the\n"
-"                       repeater after the fetch.  You will probably also want\n"
-"                       to supply -sslonly to avoid x11vnc thinking the delay\n"
-"                       in response means the connection is VeNCrypt.  The env\n"
-"                       var X11VNC_DISABLE_SSL_CLIENT_MODE=1 discussed above\n"
-"                       may also be useful (i.e. the viewer can do a forward\n"
-"                       connection as it normally does.)\n"
-"\n"
-"                       IPv6: as of x11vnc 0.9.10 the -connect option should\n"
-"                       connect to IPv6 hosts properly.  If there are problems\n"
-"                       you can disable IPv6 by setting -DX11VNC_IPV6=0\n"
-"                       in CPPFLAGS when configuring.  If there problems\n"
-"                       connecting to IPv6 hosts consider a relay like the\n"
-"                       included inet6to4 script or the -proxy option.\n"
-"\n"
-"-connect_or_exit str   As with -connect, except if none of the reverse\n"
-"                       connections succeed, then x11vnc shuts down immediately\n"
-"\n"
-"                       An easier to type alias for this option is '-coe'\n"
-"\n"
-"                       By the way, if you do not want x11vnc to listen on\n"
-"                       ANY interface use -rfbport 0  which is handy for the\n"
-"                       -connect_or_exit mode.\n"
-"\n"
-"-proxy string          Use proxy in string (e.g. host:port) as a proxy for\n"
-"                       making reverse connections (-connect or -connect_or_exit\n"
-"                       options).\n"
-"\n"
-"                       Web proxies are supported, but note by default most of\n"
-"                       them only support destination connections to ports 443\n"
-"                       or 563, so this might not be very useful (the viewer\n"
-"                       would need to listen on that port or the router would\n"
-"                       have to do a port redirection).\n"
-"\n"
-"                       A web proxy may be specified by either \"host:port\"\n"
-"                       or \"http://host:port\" (the port is required even if\n"
-"                       it is the common choices 80 or 8080)\n"
-"\n"
-"                       SOCKS4, SOCKS4a, and SOCKS5 are also supported.\n"
-"                       SOCKS proxies normally do not have restrictions on the\n"
-"                       destination port number.\n"
-"\n"
-"                       Use a format like this: socks://host:port or\n"
-"                       socks5://host:port.  Note that ssh -D does not support\n"
-"                       SOCKS4a, so use socks5://.  For socks:// SOCKS4 is used\n"
-"                       on a numerical IP and \"localhost\", otherwise SOCKS4a\n"
-"                       is used (and so the proxy tries to do the DNS lookup).\n"
-"\n"
-"                       An experimental mode is \"-proxy http://host:port/...\"\n"
-"                       Note the \"/\" after the port that distinguishes it from\n"
-"                       a normal web proxy.  The port must be supplied even if\n"
-"                       it is the default 80.  For this mode a GET is done to\n"
-"                       the supplied URL with the string host=H&port=P appended.\n"
-"                       H and P will be the -connect reverse connect host\n"
-"                       and port.  Use the string \"__END__\" to disable the\n"
-"                       appending.  The basic idea here is that maybe some cgi\n"
-"                       script provides the actual viewer hookup and tunnelling.\n"
-"                       How to actually achieve this within cgi, php, etc. is\n"
-"                       not clear...  A custom web server or apache module\n"
-"                       would be straight-forward.\n"
-"\n"
-"                       Another experimental mode is \"-proxy ssh://user@host\"\n"
-"                       in which case a SSH tunnel is used for the proxying.\n"
-"                       \"user@\" is not needed unless your unix username is\n"
-"                       different on \"host\".  For a non-standard SSH port\n"
-"                       use ssh://user@host:port.  If proxies are chained (see\n"
-"                       next paragraph) then the ssh one must be the first one.\n"
-"                       If ssh-agent is not active, then the ssh password needs\n"
-"                       to be entered in the terminal where x11vnc is running.\n"
-"                       Examples:\n"
-"\n"
-"                         -connect localhost:0 -proxy ssh://me@friends-pc:2222\n"
-"\n"
-"                         -connect snoopy:0 -proxy ssh://ssh.company.com\n"
-"\n"
-"                       Multiple proxies may be chained together in case one\n"
-"                       needs to ricochet off of a number of hosts to finally\n"
-"                       reach the VNC viewer.  Up to 3 may be chained, separate\n"
-"                       them by commas in the order they are to be connected to.\n"
-"                       E.g.:  http://host1:port1,socks5://host2:port2 or three\n"
-"                       like:  first,second,third\n"
-"\n"
-"                       IPv6: as of x11vnc 0.9.10 the -proxy option should\n"
-"                       connect to IPv6 hosts properly.  If there are problems\n"
-"                       you can disable IPv6 by setting -DX11VNC_IPV6=0\n"
-"                       in CPPFLAGS when configuring.  If there problems\n"
-"                       connecting to IPv6 hosts consider a relay like the\n"
-"                       included inet6to4 script.\n"
-"\n"
-"-vncconnect            Monitor the VNC_CONNECT X property set by the standard\n"
-"-novncconnect          VNC program vncconnect(1).  When the property is\n"
-"                       set to \"host\" or \"host:port\" establish a reverse\n"
-"                       connection.  Using xprop(1) instead of vncconnect may\n"
-"                       work (see the FAQ).  The -remote control mechanism uses\n"
-"                       X11VNC_REMOTE channel, and this option disables/enables\n"
-"                       it as well.  Default: %s\n"
-"\n"
-"                       To use different names for these X11 properties (e.g. to\n"
-"                       have separate communication channels for multiple\n"
-"                       x11vnc's on the same display) set the VNC_CONNECT or\n"
-"                       X11VNC_REMOTE env. vars. to the string you want, for\n"
-"                       example: -env X11VNC_REMOTE=X11VNC_REMOTE_12345\n"
-"                       Both sides of the channel must use the same unique name.\n"
-"                       The same can be done for the internal X11VNC_TICKER\n"
-"                       property (heartbeat and timestamp) if desired.\n"
-"\n"
-"-allow host1[,host2..] Only allow client connections from hosts matching\n"
-"                       the comma separated list of hostnames or IP addresses.\n"
-"                       Can also be a numerical IP prefix, e.g. \"192.168.100.\"\n"
-"                       to match a simple subnet, for more control build\n"
-"                       LibVNCServer with libwrap support (See the FAQ).  If the\n"
-"                       list contains a \"/\" it instead is a interpreted\n"
-"                       as a file containing addresses or prefixes that is\n"
-"                       re-read each time a new client connects.  Lines can be\n"
-"                       commented out with the \"#\" character in the usual way.\n"
-"\n"
-"                       -allow applies in -ssl mode, but not in -stunnel mode.\n"
-"\n"
-"                       IPv6: as of x11vnc 0.9.10 a host can be specified\n"
-"                       in IPv6 numerical format, e.g. 2001:4860:b009::93.\n"
-"\n"
-"-localhost             Basically the same as \"-allow 127.0.0.1\".\n"
-"\n"
-"                       Note: if you want to restrict which network interface\n"
-"                       x11vnc listens on, see the -listen option below.\n"
-"                       E.g. \"-listen localhost\" or \"-listen 192.168.3.21\".\n"
-"                       As a special case, the option \"-localhost\" implies\n"
-"                       \"-listen localhost\".\n"
-"\n"
-"                       A rare case, but for non-localhost -listen usage, if\n"
-"                       you use the remote control mechanism (-R) to change\n"
-"                       the -listen interface you may need to manually adjust\n"
-"                       the -allow list (and vice versa) to avoid situations\n"
-"                       where no connections (or too many) are allowed.\n"
-"\n"
-"                       If you do not want x11vnc to listen on ANY interface\n"
-"                       (evidently you are using -connect or -connect_or_exit,\n"
-"                       or plan to use remote control: -R connect:host), use\n"
-"                       -rfbport 0\n"
-"\n"
-"                       IPv6: if IPv6 is supported, this option automatically\n"
-"                       implies the IPv6 loopback address '::1' as well.\n"
-"\n"
-"-unixsock str          Listen on the unix socket (AF_UNIX) 'str'\n"
-"                       for connections.  This mode is for either local\n"
-"                       connections or a tunnel endpoint where one wants the\n"
-"                       file permission of the unix socket file to determine\n"
-"                       what can connect to it.  (This currently requires an\n"
-"                       edit to libvnserver/rfbserver.c: comment out lines 310\n"
-"                       and 311, 'close(sock)' and 'return NULL' in rfbserver.c\n"
-"                       after the setsockopt() call.) Note that to disable all\n"
-"                       tcp listening ports specify '-rfbport 0' and should be\n"
-"                       useful with this mode.  Example:\n"
-"                           mkdir ~/s; chmod 700 ~/s;\n"
-"                           x11vnc -unixsock ~/s/mysock -rfbport 0 ...\n"
-"                       The SSVNC unix vncviewer can connect to unix sockets.\n"
-"\n"
-#if X11VNC_IPV6
-"-listen6 str           When in IPv6 listen mode \"-6\", listen only on the\n"
-"                       network interface with address \"str\".  It also works\n"
-"                       for link scope addresses (fe80::219:dbff:fee5:3f92%%eth0)\n"
-"                       and IPv6 hostname strings (e.g. ipv6.google.com.)\n"
-"                       Use LibVNCServer -listen option for the IPv4 interface.\n"
-"\n"
-#endif
-"-nolookup              Do not use gethostbyname() or gethostbyaddr() to look up\n"
-"                       host names or IP numbers.  Use this if name resolution\n"
-"                       is incorrectly set up and leads to long pauses as name\n"
-"                       lookups time out, etc.\n"
-"\n"
-"-input string          Fine tuning of allowed user input.  If \"string\" does\n"
-"                       not contain a comma \",\" the tuning applies only to\n"
-"                       normal clients.  Otherwise the part before \",\" is\n"
-"                       for normal clients and the part after for view-only\n"
-"                       clients.  \"K\" is for Keystroke input, \"M\" for\n"
-"                       Mouse-motion input, \"B\" for Button-click input, \"C\"\n"
-"                       is for Clipboard input, and \"F\" is for File transfer\n"
-"                       (ultravnc only).  Their presence in the string enables\n"
-"                       that type of input.  E.g. \"-input M\" means normal\n"
-"                       users can only move the mouse and  \"-input KMBCF,M\"\n"
-"                       lets normal users do anything and enables view-only\n"
-"                       users to move the mouse.  This option is ignored when\n"
-"                       a global -viewonly is in effect (all input is discarded\n"
-"                       in that case).\n"
-"\n"
-"-grabkbd               When VNC viewers are connected, attempt to the grab\n"
-"                       the keyboard so a (non-malicious) user sitting at the\n"
-"                       physical display is not able to enter keystrokes.\n"
-"                       This method uses XGrabKeyboard(3X11) and so it is\n"
-"                       not secure and does not rule out the person at the\n"
-"                       physical display injecting keystrokes by flooding the\n"
-"                       server with them, grabbing the keyboard himself, etc.\n"
-"                       Some degree of cooperation from the person at the\n"
-"                       display is assumed.  This is intended for remote\n"
-"                       help-desk or educational usage modes.\n"
-"\n"
-"                       Note: on some recent (12/2010) X servers and/or\n"
-"                       desktops, -grabkbd no longer works: it prevents the\n"
-"                       window manager from resizing windows and similar things.\n"
-"                       Try -ungrabboth below (might not work.)\n"
-"\n"
-"-grabptr               As -grabkbd, but for the mouse pointer using\n"
-"                       XGrabPointer(3X11).  Unfortunately due to the way the X\n"
-"                       server works, the mouse can still be moved around by the\n"
-"                       user at the physical display, but he will not be able to\n"
-"                       change window focus with it.  Also some window managers\n"
-"                       that call XGrabServer(3X11) for resizes, etc, will\n"
-"                       act on the local user's input.  Again, some degree of\n"
-"                       cooperation from the person at the display is assumed.\n"
-"\n"
-"-ungrabboth            Whenever there is any input (either keyboard or\n"
-"                       pointer), ungrab *both* the keyboard and the pointer\n"
-"                       while injecting the synthetic input.  This is to allow\n"
-"                       window managers, etc. a chance to grab.\n"
-"\n"
-"-grabalways            Apply both -grabkbd and -grabptr even when no VNC\n"
-"                       viewers are connected.  If you only want one of them,\n"
-"                       use the -R remote control to turn the other back on,\n"
-"                       e.g. -R nograbptr.\n"
-"\n"
-#ifdef ENABLE_GRABLOCAL
-"-grablocal n           If it appears that a user sitting at the physical\n"
-"                       display has injected a keystroke or mouse event ignore\n"
-"                       any VNC client inputs for the next n seconds.  The idea\n"
-"                       is that during a demonstration, etc, the local user\n"
-"                       will not be interrupted by viewers accidentally moving\n"
-"                       the mouse, etc.  The detection of local user input is\n"
-"                       approximate and so at times gives unexpected results.\n"
-"\n"
-#endif
-"-viewpasswd string     Supply a 2nd password for view-only logins.  The -passwd\n"
-"                       (full-access) password must also be supplied.\n"
-"\n"
-"-passwdfile filename   Specify the LibVNCServer password via the first line\n"
-"                       of the file \"filename\" (instead of via -passwd on\n"
-"                       the command line where others might see it via ps(1)).\n"
-"\n"
-"                       See the descriptions below for how to supply multiple\n"
-"                       passwords, view-only passwords, to specify external\n"
-"                       programs for the authentication, and other features.\n"
-"\n"
-"                       If the filename is prefixed with \"rm:\" it will be\n"
-"                       removed after being read.  Perhaps this is useful in\n"
-"                       limiting the readability of the file.  In general, the\n"
-"                       password file should not be readable by untrusted users\n"
-"                       (BTW: neither should the VNC -rfbauth file: it is NOT\n"
-"                       encrypted, only obscured with a fixed key).\n"
-"\n"
-"                       If the filename is prefixed with \"read:\" it will\n"
-"                       periodically be checked for changes and reread.  It is\n"
-"                       guaranteed to be reread just when a new client connects\n"
-"                       so that the latest passwords will be used.\n"
-"\n"
-"                       If \"filename\" is prefixed with \"cmd:\" then the\n"
-"                       string after the \":\" is run as an external command:\n"
-"                       the output of the command will be interpreted as if it\n"
-"                       were read from a password file (see below).  If the\n"
-"                       command does not exit with 0, then x11vnc terminates\n"
-"                       immediately.  To specify more than 1000 passwords this\n"
-"                       way set X11VNC_MAX_PASSWDS before starting x11vnc.\n"
-"                       The environment variables are set as in -accept.\n"
-"\n"
-"                       Note that due to the VNC protocol only the first 8\n"
-"                       characters of a password are used (DES key).\n"
-"\n"
-"                       If \"filename\" is prefixed with \"custom:\" then a\n"
-"                       custom password checker is supplied as an external\n"
-"                       command following the \":\". The command will be run\n"
-"                       when a client authenticates.  If the command exits with\n"
-"                       0 the client is accepted, otherwise it is rejected.\n"
-"                       The environment variables are set as in -accept.\n"
-"\n"
-"                       The standard input to the custom command will be a\n"
-"                       decimal digit \"len\" followed by a newline. \"len\"\n"
-"                       specifies the challenge size and is usually 16 (the\n"
-"                       VNC spec).  Then follows len bytes which is the random\n"
-"                       challenge string that was sent to the client. This is\n"
-"                       then followed by len more bytes holding the client's\n"
-"                       response (i.e. the challenge string encrypted via DES\n"
-"                       with the user password in the standard situation).\n"
-"\n"
-"                       The \"custom:\" scheme can be useful to implement\n"
-"                       dynamic passwords or to implement methods where longer\n"
-"                       passwords and/or different encryption algorithms\n"
-"                       are used.  The latter will require customizing the VNC\n"
-"                       client as well.  One could create an MD5SUM based scheme\n"
-"                       for example.\n"
-"\n"
-"                       File format for -passwdfile:\n"
-"\n"
-"                       If multiple non-blank lines exist in the file they are\n"
-"                       all taken as valid passwords.  Blank lines are ignored.\n"
-"                       Password lines may be \"commented out\" (ignored) if\n"
-"                       they begin with the character \"#\" or the line contains\n"
-"                       the string \"__SKIP__\".  Lines may be annotated by use\n"
-"                       of the \"__COMM__\" string: from it to the end of the\n"
-"                       line is ignored.  An empty password may be specified\n"
-"                       via the \"__EMPTY__\" string on a line by itself (note\n"
-"                       your viewer might not accept empty passwords).\n"
-"\n"
-"                       If the string \"__BEGIN_VIEWONLY__\" appears on a\n"
-"                       line by itself, the remaining passwords are used for\n"
-"                       viewonly access.  For compatibility, as a special case\n"
-"                       if the file contains only two password lines the 2nd\n"
-"                       one is automatically taken as the viewonly password.\n"
-"                       Otherwise the \"__BEGIN_VIEWONLY__\" token must be\n"
-"                       used to have viewonly passwords.  (tip: make the 3rd\n"
-"                       and last line be \"__BEGIN_VIEWONLY__\" to have 2\n"
-"                       full-access passwords)\n"
-"\n"
-"-showrfbauth filename  Print to the screen the obscured VNC password kept in\n"
-"                       the rfbauth file \"filename\" and then exit.\n"
-"\n"
-"-unixpw [list]         Use Unix username and password authentication.  x11vnc\n"
-"                       will use the su(1) program to verify the user's\n"
-"                       password.  [list] is an optional comma separated list\n"
-"                       of allowed Unix usernames.  If the [list] string begins\n"
-"                       with the character \"!\" then the entire list is taken\n"
-"                       as an exclude list.  See below for per-user options\n"
-"                       that can be applied.\n"
-"\n"
-"                       A familiar \"login:\" and \"Password:\" dialog is\n"
-"                       presented to the user on a black screen inside the\n"
-"                       vncviewer.  The connection is dropped if the user fails\n"
-"                       to supply the correct password in 3 tries or does not\n"
-"                       send one before a 45 second timeout.  Existing clients\n"
-"                       are view-only during this period.\n"
-"\n"
-"                       If the first character received is \"Escape\" then the\n"
-"                       unix username will not be displayed after \"login:\"\n"
-"                       as it is typed.  This could be of use for VNC viewers\n"
-"                       that automatically type the username and password.\n"
-"\n"
-"                       Since the detailed behavior of su(1) can vary from\n"
-"                       OS to OS and for local configurations, test the mode\n"
-"                       before deployment to make sure it is working properly.\n"
-"                       x11vnc will attempt to be conservative and reject a\n"
-"                       login if anything abnormal occurs.\n"
-"\n"
-"                       One case to note: FreeBSD and the other BSD's by\n"
-"                       default it is impossible for the user running x11vnc to\n"
-"                       validate his *own* password via su(1) (commenting out\n"
-"                       the pam_self.so entry in /etc/pam.d/su eliminates this\n"
-"                       behavior).  So the x11vnc login will always *FAIL* for\n"
-"                       this case (even when the correct password is supplied).\n"
-"\n"
-"                       A possible workaround for this on *BSD would be to\n"
-"                       start x11vnc as root with the \"-users +nobody\" option\n"
-"                       to immediately switch to user nobody where the su'ing\n"
-"                       will proceed normally.\n"
-"\n"
-"                       Another source of potential problems are PAM modules\n"
-"                       that prompt for extra info, e.g. password aging modules.\n"
-"                       These logins will fail as well even when the correct\n"
-"                       password is supplied.\n"
-"\n"
-"                       **IMPORTANT**: to prevent the Unix password being sent\n"
-"                       in *clear text* over the network, one of two schemes\n"
-"                       will be enforced: 1) the -ssl builtin SSL mode, or 2)\n"
-"                       require both -localhost and -stunnel be enabled.\n"
-"\n"
-"                       Method 1) ensures the traffic is encrypted between\n"
-"                       viewer and server.  A PEM file will be required, see the\n"
-"                       discussion under -ssl below (under some circumstances\n"
-"                       a temporary one can be automatically generated).\n"
-"\n"
-"                       Method 2) requires the viewer connection to appear\n"
-"                       to come from the same machine x11vnc is running on\n"
-"                       (e.g. from a ssh -L port redirection).  And that the\n"
-"                       -stunnel SSL mode be used for encryption over the\n"
-"                       network. (see the description of -stunnel below).\n"
-"\n"
-"                       Note: as a convenience, if you ssh(1) in and start\n"
-"                       x11vnc it will check if the environment variable\n"
-"                       SSH_CONNECTION is set and appears reasonable.  If it\n"
-"                       does, then the -ssl or -stunnel requirement will be\n"
-"                       dropped since it is assumed you are using ssh for the\n"
-"                       encrypted tunnelling.  -localhost is still enforced.\n"
-"                       Use -ssl or -stunnel to force SSL usage even if\n"
-"                       SSH_CONNECTION is set.\n"
-"\n"
-"                       To override the above restrictions you can set\n"
-"                       environment variables before starting x11vnc:\n"
-"\n"
-"                       Set UNIXPW_DISABLE_SSL=1 to disable requiring either\n"
-"                       -ssl or -stunnel (as under SSH_CONNECTION.)  Evidently\n"
-"                       you will be using a different method to encrypt the\n"
-"                       data between the vncviewer and x11vnc: perhaps ssh(1)\n"
-"                       or an IPSEC VPN. -localhost is still enforced (however,\n"
-"                       see the next paragraph.)\n"
-"\n"
-"                       Set UNIXPW_DISABLE_LOCALHOST=1 to disable the -localhost\n"
-"                       requirement in -unixpw modes.  One should never do this\n"
-"                       (i.e. allow the Unix passwords to be sniffed on the\n"
-"                       network.)  This also disables the localhost requirement\n"
-"                       for reverse connections (see below.)\n"
-"\n"
-"                       Note that use of -localhost with ssh(1) (and no -unixpw)\n"
-"                       is roughly the same as requiring a Unix user login\n"
-"                       (since a Unix password or the user's public key\n"
-"                       authentication is used by sshd on the machine where\n"
-"                       x11vnc runs and only local connections from that machine\n"
-"                       are accepted).\n"
-"\n"
-"                       Regarding reverse connections (e.g. -R connect:host\n"
-"                       and -connect host), when the -localhost constraint is\n"
-"                       in effect then reverse connections can only be used\n"
-"                       to connect to the same machine x11vnc is running on\n"
-"                       (default port 5500).  Please use a ssh or stunnel port\n"
-"                       redirection to the viewer machine to tunnel the reverse\n"
-"                       connection over an encrypted channel.\n"
-"\n"
-"                       In -inetd mode the Method 1) will be enforced (not\n"
-"                       Method 2).  With -ssl in effect reverse connections\n"
-"                       are disabled.  If you override this via env. var, be\n"
-"                       sure to also use encryption from the viewer to inetd.\n"
-"                       Tip: you can also have your own stunnel spawn x11vnc\n"
-"                       in -inetd mode (thereby bypassing inetd).  See the FAQ\n"
-"                       for details.\n"
-"\n"
-"                       The user names in the comma separated [list] may have\n"
-"                       per-user options after a \":\", e.g. \"fred:opts\"\n"
-"                       where \"opts\" is a \"+\" separated list of\n"
-"                       \"viewonly\", \"fullaccess\", \"input=XXXX\", or\n"
-"                       \"deny\", e.g. \"karl,wally:viewonly,boss:input=M\".\n"
-"                       For \"input=\" it is the K,M,B,C described under -input.\n"
-"\n"
-"                       If an item in the list is \"*\" that means those\n"
-"                       options apply to all users.  It ALSO implies all users\n"
-"                       are allowed to log in after supplying a valid password.\n"
-"                       Use \"deny\" to explicitly deny some users if you use\n"
-"                       \"*\" to set a global option.  If [list] begins with the\n"
-"                       \"!\" character then \"*\" is ignored for checking if\n"
-"                       the user is allowed, but the option values associated\n"
-"                       with it do apply as normal.\n"
-"\n"
-"                       There are also some utilities for checking passwords\n"
-"                       if [list] starts with the \"%%\" character.  See the\n"
-"                       quick_pw() function for more details.  Description:\n"
-"                       \"%%-\" or \"%%stdin\" means read one line from stdin.\n"
-"                       \"%%env\" means it is in $UNIXPW env var.  A leading\n"
-"                       \"%%/\" or \"%%.\" means read the first line from the\n"
-"                       filename that follows after the %% character. %% by\n"
-"                       itself means prompt for the username and password.\n"
-"                       Otherwise: %%user:pass   E.g. -unixpw %%fred:swordfish\n"
-"                       For the other cases user:pass is read from the indicated\n"
-"                       source.  If the password is correct 'Y user' is printed\n"
-"                       and the program exit code is 0.  If the password is\n"
-"                       incorrect it prints 'N user' and the exit code is 1.\n"
-"                       If there is some other error the exit code is 2.\n"
-"                       This feature enables x11vnc to be a general unix user\n"
-"                       password checking tool; it could be used from scripts\n"
-"                       or other programs.  These %% password checks also apply\n"
-"                       to the -unixpw_nis and -unixpw_cmd options.\n"
-"\n"
-"                       For the %% password check, if the env. var. UNIXPW_CMD\n"
-"                       is set to a command then it is run as the user (assuming\n"
-"                       the password is correct.)  The output of the command is\n"
-"                       not printed, the program or script must manage that by\n"
-"                       some other means.  The exit code of x11vnc will depend\n"
-"                       on the exit code of the command that is run.\n"
-"\n"
-"                       Use -nounixpw to disable unixpw mode if it was enabled\n"
-"                       earlier in the cmd line (e.g. -svc mode)\n"
-"\n"
-"-unixpw_nis [list]     As -unixpw above, however do not use su(1) but rather\n"
-"                       use the traditional getpwnam(3) + crypt(3) method to\n"
-"                       verify passwords. All of the above -unixpw options and\n"
-"                       constraints apply.\n"
-"\n"
-"                       This mode requires that the encrypted passwords be\n"
-"                       readable.  Encrypted passwords stored in /etc/shadow\n"
-"                       will be inaccessible unless x11vnc is run as root.\n"
-"\n"
-"                       This is called \"NIS\" mode simply because in most\n"
-"                       NIS setups user encrypted passwords are accessible\n"
-"                       (e.g. \"ypcat passwd\") by an ordinary user and so that\n"
-"                       user can authenticate ANY user.\n"
-"\n"
-"                       NIS is not required for this mode to work (only that\n"
-"                       getpwnam(3) return the encrypted password is required),\n"
-"                       but it is unlikely it will work (as an ordinary user)\n"
-"                       for most modern environments unless NIS is available.\n"
-"                       On the other hand, when x11vnc is run as root it will\n"
-"                       be able to to access /etc/shadow even if NIS is not\n"
-"                       available (note running as root is often done when\n"
-"                       running x11vnc from inetd and xdm/gdm/kdm).\n"
-"\n"
-"                       Looked at another way, if you do not want to use the\n"
-"                       su(1) method provided by -unixpw (i.e. su_verify()), you\n"
-"                       can run x11vnc as root and use -unixpw_nis.  Any users\n"
-"                       with passwords in /etc/shadow can then be authenticated.\n"
-"\n"
-"                       In -unixpw_nis mode, under no circumstances is x11vnc's\n"
-"                       user password verifying function based on su called\n"
-"                       (i.e. the function su_verify() that runs /bin/su\n"
-"                       in a pseudoterminal to verify passwords.)  However,\n"
-"                       if -unixpw_nis is used in conjunction with the -find\n"
-"                       and -create -display WAIT:... modes then, if x11vnc is\n"
-"                       running as root, /bin/su may be called externally to\n"
-"                       run the find or create commands.\n"
-"\n"
-"-unixpw_cmd cmd        As -unixpw above, however do not use su(1) but rather\n"
-"                       run the externally supplied command \"cmd\".  The first\n"
-"                       line of its stdin will be the username and the second\n"
-"                       line the received password.  If the command exits\n"
-"                       with status 0 (success) the VNC user will be accepted.\n"
-"                       It will be rejected for any other return status.\n"
-"\n"
-"                       Dynamic passwords and non-unix passwords, e.g. LDAP,\n"
-"                       can be implemented this way by providing your own custom\n"
-"                       helper program.  Note that the remote viewer is given 3\n"
-"                       tries to enter the correct password, and so the program\n"
-"                       may be called in a row that many (or more) times.\n"
-"\n"
-"                       If a list of allowed users is needed to limit who can\n"
-"                       log in, use -unixpw [list] in addition to this option.\n"
-"\n"
-"                       In FINDDISPLAY and FINDCREATEDISPLAY modes the \"cmd\"\n"
-"                       will also be run with the RFB_UNIXPW_CMD_RUN env. var.\n"
-"                       non-empty and set to the corresponding display\n"
-"                       find/create command.  The first two lines of input are\n"
-"                       the username and passwd as in the normal case described\n"
-"                       above.  To support FINDDISPLAY and FINDCREATEDISPLAY,\n"
-"                       \"cmd\" should run the requested command as the user\n"
-"                       (and most likely refusing to run it if the password is\n"
-"                       not correct.)  Here is an example script (note it has\n"
-"                       a hardwired bogus password \"abc\"!)\n"
-"\n"
-"                         #!/bin/sh\n"
-"                         # Example x11vnc -unixpw_cmd script.\n"
-"                         # Read the first two lines of stdin (user and passwd)\n"
-"                         read user\n"
-"                         read pass\n"
-"                         \n"
-"                         debug=0\n"
-"                         if [ $debug = 1 ]; then\n"
-"                         	echo \"user: $user\" 1>&2\n"
-"                         	echo \"pass: $pass\" 1>&2\n"
-"                         	env | egrep -i 'rfb|vnc' 1>&2\n"
-"                         fi\n"
-"                         \n"
-"                         # Check if the password is valid.\n"
-"                         # (A real example would use ldap lookup, etc!)\n"
-"                         if [ \"X$pass\" != \"Xabc\" ]; then\n"
-"                         	exit 1	# incorrect password\n"
-"                         fi\n"
-"                         \n"
-"                         if [ \"X$RFB_UNIXPW_CMD_RUN\" = \"X\" ]; then\n"
-"                         	exit 0	# correct password\n"
-"                         else\n"
-"                         	# Run the requested command (finddisplay)\n"
-"                         	if [ $debug = 1 ]; then\n"
-"                         		echo \"run: $RFB_UNIXPW_CMD_RUN\" 1>&2\n"
-"                         	fi\n"
-"                         	exec /bin/su - \"$user\" -c \"$RFB_UNIXPW_CMD_RUN\"\n"
-"                         fi\n"
-"\n"
-"                       In -unixpw_cmd mode, under no circumstances is x11vnc's\n"
-"                       user password verifying function based on su called\n"
-"                       (i.e. the function su_verify() that runs /bin/su in a\n"
-"                       pseudoterminal to verify passwords.)  It is up to the\n"
-"                       supplied unixpw_cmd to do user switching if desired\n"
-"                       and if it has the permissions to do so.\n"
-"\n"
-"-find                  Find the user's display using FINDDISPLAY. This\n"
-"                       is an alias for \"-display WAIT:cmd=FINDDISPLAY\".\n"
-"\n"
-"                       Note: if a -display occurs later on the command line\n"
-"                       it will override the -find setting.\n"
-"\n"
-"                       For this and the next few options see -display WAIT:...\n"
-"                       below for all of the details.\n"
-"\n"
-"-finddpy               Run the FINDDISPLAY program, print out the found\n"
-"                       display (if any) and exit.  Output is like: DISPLAY=:0.0\n"
-"                       DISPLAY=:0.0,XPID=12345 or DISPLAY=:0.0,VT=7.  XPID is\n"
-"                       the process ID of the found X server.  VT is the Linux\n"
-"                       virtual terminal of the X server.\n"
-"-listdpy               Have the FINDDISPLAY program list all of your displays\n"
-"                       (i.e. all the X displays on the local machine that you\n"
-"                       have access rights to).  x11vnc then exits.\n"
-"\n"
-"-findauth [disp]       Apply the -find/-finddpy heuristics to try to guess\n"
-"                       the XAUTHORITY file for DISPLAY 'disp'.  If 'disp'\n"
-"                       is not supplied, then the value in the -display on\n"
-"                       the cmdline is used; failing that $DISPLAY is used;\n"
-"                       and failing that \":0\" is used.  x11vnc then exits.\n"
-"\n"
-"                       If nothing is printed out, that means no XAUTHORITY was\n"
-"                       found for 'disp'; i.e. failure.  If \"XAUTHORITY=\"\n"
-"                       is printed out, that means use the default (i.e. do\n"
-"                       not set XAUTHORITY).  If \"XAUTHORITY=/path/to/file\"\n"
-"                       is printed out, then use that file.\n"
-"\n"
-"                       XDM/GDM/KDM: if you are running x11vnc as root and want\n"
-"                       to find the XAUTHORITY before anyone has logged into an\n"
-"                       X session yet, use: x11vnc -env FD_XDM=1 -findauth ...\n"
-"                       (This will also find the XAUTHORITY if a user is already\n"
-"                       logged into the X session.)  When running as root,\n"
-"                       FD_XDM=1 will be tried if the initial -findauth fails.\n"
-"\n"
-"-create                First try to find the user's display using FINDDISPLAY,\n"
-"                       if that doesn't succeed create an X session via the\n"
-"                       FINDCREATEDISPLAY method.  This is an alias for\n"
-"                       \"-display WAIT:cmd=FINDCREATEDISPLAY-Xvfb\".\n"
-"\n"
-"                       Note: if a -display occurs later on the command line\n"
-"                       it will override the -create setting.\n"
-"\n"
-"                       SSH NOTE: for both -find and -create you can (should!)\n"
-"                       add the \"-localhost\" option to force SSH tunnel access.\n"
-"\n"
-"-xdummy                As in -create, except Xdummy instead of Xvfb.\n"
-"-xvnc                  As in -create, except Xvnc instead of Xvfb.\n"
-"-xvnc_redirect         As in -create, except Xvnc.redirect instead of Xvfb.\n"
-"-xdummy_xvfb           Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb\n"
-"\n"
-"-create_xsrv str       Sets WAIT:cmd=FINDCREATEDISPLAY-<str>  Can be on cmdline\n"
-"                       after anything that sets WAIT:.. and other things\n"
-"                       (e.g. -svc, -xdmsvc) to adjust the X server list.\n"
-"                       Example: -svc ... -create_xsrv Xdummy,X\n"
-"\n"
-"-svc                   Terminal services mode based on SSL access.  Alias for\n"
-"                       -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users\n"
-"                       unixpw= -ssl SAVE   Also \"-service\".\n"
-"\n"
-"                       Note: if a -display, -unixpw, -users, or -ssl occurs\n"
-"                       later on the command line it will override the -svc\n"
-"                       setting.\n"
-"\n"
-"-svc_xdummy            As -svc except Xdummy instead of Xvfb.\n"
-"-svc_xvnc              As -svc except Xvnc instead of Xvfb.\n"
-"-svc_xdummy_xvfb       As -svc with Xdummy,Xvfb.\n"
-"\n"
-"-xdmsvc                Display manager Terminal services mode based on SSL.\n"
-"                       Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp\n"
-"                       -unixpw -users unixpw= -ssl SAVE  Also \"-xdm_service\".\n"
-"\n"
-"                       Note: if a -display, -unixpw, -users, or -ssl occurs\n"
-"                       later on the command line it will override the -xdmsvc\n"
-"                       setting.\n"
-"\n"
-"                       To create a session a user will have to first log in\n"
-"                       to the -unixpw dialog and then log in again to the\n"
-"                       XDM/GDM/KDM prompt.  Subsequent re-connections will\n"
-"                       only require the -unixpw password.  See the discussion\n"
-"                       under -display WAIT:... for more details about XDM,\n"
-"                       etc configuration.\n"
-"\n"
-"                       Remember to enable XDMCP in the xdm-config, gdm.conf,\n"
-"                       or kdmrc configuration file.  See -display WAIT: for\n"
-"                       more info.\n"
-"\n"
-"-sshxdmsvc             Display manager Terminal services mode based on SSH.\n"
-"                       Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp\n"
-"                       -localhost.\n"
-"\n"
-"                       The -localhost option constrains connections to come\n"
-"                       in via a SSH tunnel (which will require a login).\n"
-"                       To create a session a user will also have to log into\n"
-"                       the XDM GDM KDM prompt. Subsequent re-connections will\n"
-"                       only only require the SSH login.  See the discussion\n"
-"                       under -display WAIT:... for more details about XDM,\n"
-"                       etc configuration.\n"
-"\n"
-"                       Remember to enable XDMCP in the xdm-config, gdm.conf,\n"
-"                       or kdmrc configuration file.  See -display WAIT: for\n"
-"                       more info.\n"
-"\n"
-"-unixpw_system_greeter Present a \"Press 'Escape' for System Greeter\" option\n"
-"                       to the connecting VNC client in combined -unixpw\n"
-"                       and xdmcp FINDCREATEDISPLAY modes (e.g. -xdmsvc).\n"
-"\n"
-"                       Normally in a -unixpw mode the VNC client must\n"
-"                       supply a valid username and password to gain access.\n"
-"                       However, if -unixpw_system_greeter is supplied AND\n"
-"                       the FINDCREATEDISPLAY command matches 'xdmcp', then\n"
-"                       the user has the option to press Escape and then get a\n"
-"                       XDM/GDM/KDM login/greeter panel instead. They will then\n"
-"                       supply a username and password directly to the greeter.\n"
-"\n"
-"                       Otherwise, in xdmcp FINDCREATEDISPLAY mode the user\n"
-"                       must supply his username and password TWICE.  First to\n"
-"                       the initial unixpw login dialog, and second to the\n"
-"                       subsequent XDM/GDM/KDM greeter.  Note that if the user\n"
-"                       re-connects and supplies his username and password in\n"
-"                       the unixpw dialog the xdmcp greeter is skipped and\n"
-"                       he is connected directly to his existing X session.\n"
-"                       So the -unixpw_system_greeter option avoids the extra\n"
-"                       password at X session creation time.\n"
-"\n"
-"                       Example:  x11vnc -xdmsvc -unixpw_system_greeter\n"
-"                       See -unixpw and -display WAIT:... for more info.\n"
-"\n"
-"                       The special options after a colon at the end of the\n"
-"                       username (e.g. user:solid) described under -display\n"
-"                       WAIT: are also applied in this mode if they are typed\n"
-"                       in before the user hits Escape.  The username is ignored\n"
-"                       but the colon options are not.\n"
-"\n"
-"                       The default message is 2 lines in a small font, set\n"
-"                       the env. var. X11VNC_SYSTEM_GREETER1=true for a 1 line\n"
-"                       message in a larger font.\n"
-"\n"
-"                       If the user pressed Escape the FINDCREATEDISPLAY command\n"
-"                       will be run with the env. var. X11VNC_XDM_ONLY=1.\n"
-"\n"
-"                       Remember to enable XDMCP in the xdm-config, gdm.conf,\n"
-"                       or kdmrc configuration file.  See -display WAIT: for\n"
-"                       more info.\n"
-"\n"
-"-redirect port         As in FINDCREATEDISPLAY-Xvnc.redirect mode except\n"
-"                       redirect immediately (i.e. without X session finding\n"
-"                       or creation) to a VNC server listening on port. You\n"
-"                       can also supply host:port to redirect to a different\n"
-"                       machine.\n"
-"\n"
-"                       If 0 <= port < 200 it is taken as a VNC display (5900 is\n"
-"                       added to get the actual port), if port < 0 then -port\n"
-"                       is used.\n"
-"\n"
-"                       Probably the only reason to use the -redirect option\n"
-"                       is in conjunction with SSL support, e.g. -ssl SAVE.\n"
-"                       This provides an easy way to add SSL encryption to a VNC\n"
-"                       server that does not support SSL (e.g. Xvnc or vnc.so)\n"
-"                       In fact, the protocol does not even need to be VNC,\n"
-"                       and so \"-rfbport port1 -ssl SAVE -redirect host:port2\"\n"
-"                       can act as a replacement for stunnel(1).\n"
-"\n"
-"                       This mode only allows one redirected connection.\n"
-"                       The -forever option does not apply.  Use -inetd or\n"
-"                       -loop for persistent service.\n"
-"\n"
-"-display WAIT:...      A special usage mode for the normal -display option.\n"
-"                       Useful with -unixpw, but can be used independently\n"
-"                       of it.  If the display string begins with WAIT: then\n"
-"                       x11vnc waits until a VNC client connects before opening\n"
-"                       the X display (or -rawfb device).\n"
-"\n"
-"                       This could be useful for delaying opening the display\n"
-"                       for certain usage modes (say if x11vnc is started at\n"
-"                       boot time and no X server is running or users logged\n"
-"                       in yet).\n"
-"\n"
-"                       If the string is, e.g. WAIT:0.0 or WAIT:1, i.e. \"WAIT\"\n"
-"                       in front of a normal X display, then that indicated\n"
-"                       display is used.\n"
-"\n"
-"                       One can also insert a geometry between colons, e.g.\n"
-"                       WAIT:1280x1024:... to set the size of the display the\n"
-"                       VNC client first attaches to since some VNC viewers\n"
-"                       will not automatically adjust to a new framebuffer size.\n"
-"\n"
-"                       A more interesting case is like this:\n"
-"\n"
-"                            WAIT:cmd=/usr/local/bin/find_display\n"
-"\n"
-"                       in which case the command after \"cmd=\" is run to\n"
-"                       dynamically work out the DISPLAY and optionally the\n"
-"                       XAUTHORITY data.  The first line of the command output\n"
-"                       must be of the form DISPLAY=<xdisplay>.  On Linux\n"
-"                       if the virtual terminal is known append \",VT=n\" to\n"
-"                       this string and the chvt(1) program will also be run.\n"
-"                       Any remaining output is taken as XAUTHORITY data.\n"
-"                       It can be either of the form XAUTHORITY=<file> or raw\n"
-"                       xauthority data for the display. For example;\n"
-"\n"
-"                            xauth extract - $DISPLAY\"\n"
-"\n"
-"                       NOTE: As specified in the previous paragraph, you can\n"
-"                       supply your own WAIT:cmd=... program or script, BUT\n"
-"                       there are two very useful *BUILT-IN* ones: FINDDISPLAY\n"
-"                       (alias -find above) and FINDCREATEDISPLAY (alias -create\n"
-"                       above.)  Most people use these instead of creating\n"
-"                       their own script.  Read the following (especially the\n"
-"                       BUILT-IN modes sections) to see how to configure these\n"
-"                       two useful builtin -display WAIT: modes.\n"
-"\n"
-"                       In the case of -unixpw (and -unixpw_nis only if x11vnc\n"
-"                       is running as root), then the cmd= command is run\n"
-"                       as the user who just authenticated via the login and\n"
-"                       password prompt.\n"
-"\n"
-"                       In the case of -unixpw_cmd, the commands will also be\n"
-"                       run as the logged-in user, as long as the user-supplied\n"
-"                       helper program supports RFB_UNIXPW_CMD_RUN (see the\n"
-"                       -unixpw_cmd option.)\n"
-"\n"
-"                       Also in the case of -unixpw, the user logging in can\n"
-"                       place a colon at the end of her username and supply\n"
-"                       a few options: scale=, scale_cursor= (or sc=), solid\n"
-"                       (or so), id=, clear_mods (or cm), clear_keys (or\n"
-"                       ck), clear_all (or ca), repeat, speeds= (or sp=),\n"
-"                       readtimeout= (or rd=), viewonly (or vo), nodisplay=\n"
-"                       (or nd=), rotate= (or ro=), or noncache (or nc),\n"
-"                       all separated by commas if there is more than one.\n"
-"                       After the user logs in successfully, these options will\n"
-"                       be applied to the VNC screen.  For example,\n"
-"\n"
-"                          login: fred:scale=3/4,sc=1,repeat\n"
-"                          Password: ...\n"
-"\n"
-"                          login: runge:sp=modem,rd=120,solid\n"
-"\n"
-"                       for convenience m/n implies scale= e.g. fred:3/4  If you\n"
-"                       type and enter your password incorrectly, to retrieve\n"
-"                       your long \"login:\" line press the Up arrow once\n"
-"                       (before typing anything else).\n"
-"\n"
-"                       Most of these colon options only apply to the builtin\n"
-"                       FINDDISPLAY and FINDCREATEDISPLAY modes, but note\n"
-"                       that they are passed to the extrenal command in the\n"
-"                       environment as well and so could be used.\n"
-"\n"
-"                       In the login panel, press F1 to get a list of the\n"
-"                       available options that you can add after the username.\n"
-"\n"
-"                       Another option is \"geom=WxH\" or \"geom=WxHxD\" (or\n"
-"                       ge=). This only has an effect in FINDCREATEDISPLAY\n"
-"                       mode when a virtual X server such as Xvfb is going\n"
-"                       to be created.  It sets the width and height of\n"
-"                       the new display, and optionally the color depth as\n"
-"                       well.\n"
-"\n"
-"                       You can also supply \"gnome\", \"kde\", \"twm\",\n"
-"                       \"fvwm\", \"mwm\", \"dtwm\", \"wmaker\", \"xfce\",\n"
-"                       \"lxde\", \"enlightenment\", \"Xsession\", or\n"
-"                       \"failsafe\" (same as \"xterm\") to have the created\n"
-"                       display use that mode for the user session.\n"
-"\n"
-"                       Specify \"tag=...\" to set the unique FD_TAG desktop\n"
-"                       session tag described below.  Note: this option will\n"
-"                       be ignored if the FD_TAG env. var. is already set or\n"
-"                       if the viewer-side supplied value is not completely\n"
-"                       composed of alphanumeric or '_' or '-' characters.\n"
-"\n"
-"                       User preferences file: Instead of having the user type\n"
-"                       in geom=WxH,... etc. every time he logs in to find\n"
-"                       or create his X session, if you set FD_USERPREFS to\n"
-"                       a string that does not contain the \"/\" character,\n"
-"                       then the user's home directory is prepended to that\n"
-"                       string and if the file exists its first line is read\n"
-"                       and appended to any options he supplied at the login:\n"
-"                       prompt.  For example -env FD_USERPREFS=.x11vnc_create\n"
-"                       and the user put \"geom=1600x1200\" in his\n"
-"                       ~/.x11vnc_create file.\n"
-"\n"
-"                       To disable the option setting set the environment\n"
-"                       variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n"
-"                       To set any other options, the user can use the gui\n"
-"                       (x11vnc -gui connect) or the remote control method\n"
-"                       (x11vnc -R opt:val) during his VNC session.\n"
-"\n"
-"                       So we see the combination of -display WAIT:cmd=... and\n"
-"                       -unixpw allows automatic pairing of an unix\n"
-"                       authenticated VNC user with his desktop.  This could\n"
-"                       be very useful on SunRays and also any system where\n"
-"                       multiple users share a given machine.  The user does\n"
-"                       not need to remember special ports or passwords set up\n"
-"                       for his desktop and VNC.\n"
-"\n"
-"                       A nice way to use WAIT:cmd=... is out of inetd(8)\n"
-"                       (it automatically forks a new x11vnc for each user).\n"
-"                       You can have the x11vnc inetd spawned process run as,\n"
-"                       say, root or nobody.  When run as root (for either inetd\n"
-"                       or display manager), you can also supply the option\n"
-"                       \"-users unixpw=\" to have the x11vnc process switch to\n"
-"                       the user as well.  Note: there will be a 2nd SSL helper\n"
-"                       process that will not switch, but it is only encoding\n"
-"                       and decoding the encrypted stream at that point.\n"
-"\n"
-"                       BUILT-IN modes:\n"
-"\n"
-"                       -- Automatic Finding of User X Sessions --\n"
-"\n"
-"                       As a special case, WAIT:cmd=FINDDISPLAY will run a\n"
-"                       script that works on most Unixes to determine a user's\n"
-"                       DISPLAY variable and xauthority data (see who(1)).\n"
-"\n"
-"                       NOTE: The option \"-find\" is an alias for this mode.\n"
-"\n"
-"                       To have this default script printed to stdout (e.g. for\n"
-"                       customization) run with WAIT:cmd=FINDDISPLAY-print To\n"
-"                       have the script run to print what display it would find\n"
-"                       use \"-finddpy\" or WAIT:cmd=FINDDISPLAY-run\n"
-"\n"
-"                       The standard script runs xdpyinfo(1) run on potential\n"
-"                       displays.  If your X server(s) have a login greeter\n"
-"                       that exclusively grabs the Xserver, then xdpyinfo\n"
-"                       blocks forever and this mode will not work.  See\n"
-"                       www.karlrunge.com/x11vnc/faq.html#faq-display-manager\n"
-"                       for how to disable this for dtgreet on Solaris and\n"
-"                       possibly for other greeters.\n"
-"\n"
-"                       In -find/cmd=FINDDISPLAY mode, if you set FD_XDM=1,\n"
-"                       e.g. 'x11vnc -env FD_XDM=1 -find ...' and x11vnc is\n"
-"                       running as root (e.g. inetd) then it will try to find\n"
-"                       the XAUTHORITY file of a running XDM/GDM/KDM login\n"
-"                       greeter (i.e. no user has logged into an X session yet.)\n"
-"\n"
-"                       As another special case, WAIT:cmd=HTTPONCE will allow\n"
-"                       x11vnc to service one http request and then exit.\n"
-"                       This is usually done in -inetd mode to run on, say,\n"
-"                       port 5800 and allow the Java vncviewer to be downloaded\n"
-"                       by client web browsers.  For example:\n"
-"\n"
-"                        5815 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc \\\n"
-"                          -inetd -q -http_ssl -prog /.../x11vnc \\\n"
-"                          -display WAIT:cmd=HTTPONCE\n"
-"\n"
-"                       Where /.../x11vnc is the full path to x11vnc.\n"
-"                       It is used in the Apache SSL-portal example (see FAQ).\n"
-"\n"
-"                       In this mode you can set X11VNC_SKIP_DISPLAY to a\n"
-"                       comma separated list of displays (e.g. \":0,:1\") to\n"
-"                       ignore in the finding process.  The \":\" is optional.\n"
-"                       Ranges n-m e.g. 0-20 can also be supplied. This string\n"
-"                       can also be set by the connecting user via \"nd=\"\n"
-"                       using \"+\" instead of \",\"  If \"nd=all\" or you set\n"
-"                       X11VNC_SKIP_DISPLAY=all then all display finding fails\n"
-"                       as if you set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below.)\n"
-"\n"
-"                       On some systems lsof(1) can be very slow.  Set the\n"
-"                       env. var. FIND_DISPLAY_NO_LSOF=1 to skip using lsof to\n"
-"                       try to find the Linux VT the X server is running on.\n"
-"                       set FIND_DISPLAY_NO_VT_FIND=1 to avoid looking at all.\n"
-"\n"
-"                       -- Automatic Creation of User X Sessions --\n"
-"\n"
-"                       An interesting option is WAIT:cmd=FINDCREATEDISPLAY\n"
-"                       that is like FINDDISPLAY in that is uses the same method\n"
-"                       to find an existing display.  However, if it does not\n"
-"                       find one it will try to *start* up an X server session\n"
-"                       for the user.  This is the only time x11vnc tries to\n"
-"                       actually start up an X server.\n"
-"\n"
-"                       NOTE: The option \"-create\" is an alias for this mode.\n"
-"\n"
-"                       It will start looking for an open display number at :20\n"
-"                       Override via X11VNC_CREATE_STARTING_DISPLAY_NUMBER=n\n"
-"                       By default 80 X displays are allowed (i.e. going to :99)\n"
-"                       Override via X11VNC_CREATE_MAX_DISPLAYS=n\n"
-"\n"
-"                       For its heuristics, the create display script sets\n"
-"                       LC_ALL=C so that command output is uniform.  By default\n"
-"                       it will try to restore LC_ALL right before starting the\n"
-"                       user session.  However, if you don't mind it keeping\n"
-"                       LC_ALL=C set the env. var.: X11VNC_CREATE_LC_ALL_C_OK=1\n"
-"\n"
-"                       By default FINDCREATEDISPLAY will try Xvfb and then\n"
-"                       Xdummy:\n"
-"\n"
-"                       The Xdummy wrapper is part of the x11vnc source code\n"
-"                       (x11vnc/misc/Xdummy)  It should be available in PATH\n"
-"                       and have run \"Xdummy -install\" once to create the\n"
-"                       shared library.  Xdummy only works on Linux.  As of\n"
-"                       12/2009 it no longer needs to be run as root, and the\n"
-"                       default is to not run as root.  In some circumstances\n"
-"                       permissions may require running it as root, in these\n"
-"                       cases specify FD_XDUMMY_RUN_AS_ROOT=1, this is the same\n"
-"                       as supplying -root to the Xdummy cmdline.\n"
-"\n"
-"                       Xvfb is available on most platforms and does not\n"
-"                       require root.\n"
-"\n"
-"                       An advantage of Xdummy over Xvfb is that Xdummy supports\n"
-"                       RANDR dynamic screen resizing.\n"
-"\n"
-"                       When x11vnc exits (i.e. user disconnects) the X\n"
-"                       server session stays running in the background.\n"
-"                       The FINDDISPLAY will find it directly next time.\n"
-"                       The user must exit the X session in the usual way for\n"
-"                       it to terminate (or kill the X server process if all\n"
-"                       else fails).\n"
-"\n"
-"                       To troubleshoot the FINDCREATEDISPLAY mechanism,\n"
-"                       set the following env. var. to an output log file,\n"
-"                       e.g -env CREATE_DISPLAY_OUTPUT=/tmp/mydebug.txt\n"
-"\n"
-"                       So this is a somewhat odd mode for x11vnc in that it\n"
-"                       will start up and poll virtual X servers!  This can\n"
-"                       be used from, say, inetd(8) to provide a means of\n"
-"                       definitely getting a desktop (either real or virtual)\n"
-"                       on the machine.  E.g. a desktop service:\n"
-"\n"
-"                         5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc\n"
-"                          -inetd -q -http -ssl SAVE -unixpw -users unixpw=\\\n"
-"                          -passwd secret -prog /.../x11vnc \\\n"
-"                          -display WAIT:cmd=FINDCREATEDISPLAY\n"
-"\n"
-"                       Where /.../x11vnc is the full path to x11vnc.\n"
-"\n"
-"                       See the -svc/-service option alias above.\n"
-"\n"
-"                       If for some reason you do not want x11vnc to ever\n"
-"                       try to find an existing display set the env. var\n"
-"                       X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (also -env ...)\n"
-"                       This is the same as setting X11VNC_SKIP_DISPLAY=all or\n"
-"                       supplying \"nd=all\" after \"username:\"\n"
-"\n"
-"                       Use WAIT:cmd=FINDCREATEDISPLAY-print to print out the\n"
-"                       script that is used for this.\n"
-"\n"
-"                       You can specify the preferred X server order via e.g.,\n"
-"                       WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X  and/or leave\n"
-"                       out ones you do not want.  The the case \"X\" means try\n"
-"                       to start up a real, hardware X server using xinit(1)\n"
-"                       or startx(1).  If there is already an X server running\n"
-"                       the X case may only work on Linux (see startx(1)).\n"
-"\n"
-"                       \"Xvnc\" will start up a VNC X server (real-\n"
-"                       or tight-vnc, e.g. use if Xvfb is not available).\n"
-"                       \"Xsrv\" will start up the server program in the\n"
-"                       variable \"FD_XSRV\" if it is non-empty. You can make\n"
-"                       this be a wrapper script if you like (it must handle :N,\n"
-"                       -geometry, and -depth and other X server options).\n"
-"\n"
-"                       You can set the environment variable FD_GEOM (or\n"
-"                       X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width\n"
-"                       and height and optionally the color depth of the\n"
-"                       created display.  You can also set FD_SESS to be the\n"
-"                       session (short name of the windowmanager: kde, gnome,\n"
-"                       twm, failsafe, etc.). FD_OPTS contains extra options\n"
-"                       to pass to the X server. You can also set FD_PROG to\n"
-"                       be the full path to the session/windowmanager program.\n"
-"\n"
-"                       More FD tricks:  FD_CUPS=port or FD_CUPS=host:port\n"
-"                       will set the cups printing environment.  Similarly for\n"
-"                       FD_ESD=port or FD_ESD=host:port for esddsp sound\n"
-"                       redirection.  Set FD_EXTRA to a command to be run a\n"
-"                       few seconds after the X server starts up.  Set FD_TAG\n"
-"                       to be a unique name for the session, it is set as an\n"
-"                       X property, that makes FINDDISPLAY only find sessions\n"
-"                       with that tag value.\n"
-"\n"
-"                       Set FD_XDMCP_IF to the network interface that the\n"
-"                       display manager is running on; default is 'localhost'\n"
-"                       but you may need to set it to '::1' on some IPv6 only\n"
-"                       systems or misconfigured display managers.\n"
-"\n"
-"                       If you want the FINDCREATEDISPLAY session to contact an\n"
-"                       XDMCP login manager (xdm/gdm/kdm) on the same machine,\n"
-"                       then use \"Xvfb.xdmcp\" instead of \"Xvfb\", etc.\n"
-"                       The user will have to supply his username and password\n"
-"                       one more time (but he gets to select his desktop type\n"
-"                       so that can be useful).  For this to work, you will\n"
-"                       need to enable localhost XDMCP (udp port 177) for the\n"
-"                       display manager.  This seems to be:\n"
-"\n"
-"                        for gdm in gdm.conf:   Enable=true in section [xdmcp]\n"
-"                        for kdm in kdmrc:      Enable=true in section [Xdmcp]\n"
-"                        for xdm in xdm-config: DisplayManager.requestPort: 177\n"
-"\n"
-"                       See the shorthand options above \"-svc\", \"-xdmsvc\"\n"
-"                       and \"-sshxdmsvc\" that specify the above options for\n"
-"                       some useful cases.\n"
-"\n"
-"                       If you set the env. var WAITBG=1 x11vnc will go into\n"
-"                       the background once listening in wait mode.\n"
-"\n"
-"                       Another special mode is FINDCREATEDISPLAY-Xvnc.redirect,\n"
-"                       (or FINDDISPLAY-Xvnc.redirect).  In this case it will\n"
-"                       start up Xvnc as above if needed, but instead of\n"
-"                       polling it in its normal way, it simply does a socket\n"
-"                       redirection of the connected VNC viewer to the Xvnc.\n"
-"\n"
-"                       So in Xvnc.redirect x11vnc does no VNC but merely\n"
-"                       transfers the data back and forth.  This should be\n"
-"                       faster then x11vnc's polling method, but not as fast\n"
-"                       as connecting directly to the Xvnc with the VNC Viewer.\n"
-"                       The idea here is to take advantage of x11vnc's display\n"
-"                       finding/creating scheme, SSL, and perhaps a few others.\n"
-"                       Most of x11vnc's options do not apply in this mode.\n"
-"\n"
-"                       Xvnc.redirect should also work for the vnc.so X server\n"
-"                       module for the h/w display however it will work only\n"
-"                       for finding the display and the user must already be\n"
-"                       logged into the X console.\n"
-"\n"
-"-vencrypt mode         The VeNCrypt extension to the VNC protocol allows\n"
-"                       encrypted SSL/TLS connections.  If the -ssl mode is\n"
-"                       enabled, then VeNCrypt is enabled as well BY DEFAULT\n"
-"                       (they both use a SSL/TLS tunnel, only the protocol\n"
-"                       handshake is a little different.)\n"
-"\n"
-"                       To control when and how VeNCrypt is used, specify the\n"
-"                       mode string.  If mode is \"never\", then VeNCrypt is\n"
-"                       not used.  If mode is \"support\" (the default) then\n"
-"                       VeNCrypt is supported.  If mode is \"only\", then the\n"
-"                       similar and older ANONTLS protocol is not simultaneously\n"
-"                       supported.  x11vnc's normal SSL mode (vncs://) will be\n"
-"                       supported under -ssl unless you set mode to \"force\".\n"
-"\n"
-"                       If mode is prefixed with \"nodh:\", then Diffie Hellman\n"
-"                       anonymous key exchange is disabled.  If mode is prefixed\n"
-"                       with \"nox509:\", then X509 key exchange is disabled.\n"
-"\n"
-"                       To disable all Anonymous Diffie-Hellman access\n"
-"                       (susceptible to Man-In-The-Middle attack) you will need\n"
-"                       to supply \"-vencrypt nodh:support -anontls never\"\n"
-"                       or \"-vencrypt nodh:only\"\n"
-"\n"
-"                       If mode is prefixed with \"newdh:\", then new Diffie\n"
-"                       Hellman parameters are generated for each connection\n"
-"                       (this can be time consuming: 1-60 secs; see -dhparams\n"
-"                       below for a faster way) rather than using the\n"
-"                       fixed values in the program.  Using fixed, publicly\n"
-"                       known values is not known to be a security problem.\n"
-"                       This setting applies to ANONTLS as well.\n"
-"\n"
-"                       Long example: -vencrypt newdh:nox509:support\n"
-"\n"
-"                       Also, if mode is prefixed with \"plain:\", then\n"
-"                       if -unixpw mode is active the VeNCrypt \"*Plain\"\n"
-"                       username+passwd method is enabled for Unix logins.\n"
-"                       Otherwise in -unixpw mode the normal login panel is\n"
-"                       provided.\n"
-"\n"
-"                       You *MUST* supply the -ssl option for VeNCrypt to\n"
-"                       be active.  The -vencrypt option only fine-tunes its\n"
-"                       operation.\n"
-"\n"
-"-anontls mode          The ANONTLS extension to the VNC protocol allows\n"
-"                       encrypted SSL/TLS connections.  If the -ssl mode is\n"
-"                       enabled, then ANONTLS is enabled as well BY DEFAULT\n"
-"                       (they both use a SSL/TLS tunnel, only the protocol\n"
-"                       handshake is a little different.)\n"
-"\n"
-"                       ANONTLS is an older SSL/TLS mode introduced by vino.\n"
-"\n"
-"                       It is referred to as 'TLS' for its registered VNC\n"
-"                       security-type name, but we use the more descriptive\n"
-"                       'ANONTLS' here because it provides only Anonymous\n"
-"                       Diffie-Hellman encrypted connections, and hence no\n"
-"                       possibility for certificate authentication.\n"
-"\n"
-"                       To control when and how ANONTLS is used, specify the\n"
-"                       mode string.  If mode is \"never\", then ANONTLS is not\n"
-"                       used.  If mode is \"support\" (the default) then ANONTLS\n"
-"                       is supported.  If mode is \"only\", then the similar\n"
-"                       VeNCrypt protocol is not simultaneously supported.\n"
-"                       x11vnc's normal SSL mode (vncs://) will be supported\n"
-"                       under -ssl unless you set mode to \"force\".\n"
-"\n"
-"                       If mode is prefixed with \"newdh:\", then new Diffie\n"
-"                       Hellman parameters are generated for each connection\n"
-"                       (this can be time consuming: 1-60 secs; see -dhparams\n"
-"                       below for a faster way) rather than using the\n"
-"                       fixed values in the program.  Using fixed, publicly\n"
-"                       known values is not known to be a security problem.\n"
-"                       This setting applies to VeNCrypt as well.  See the\n"
-"                       description of \"plain:\" under -vencrypt.\n"
-"\n"
-"                       Long example: -anontls newdh:plain:support\n"
-"\n"
-"                       You *MUST* supply the -ssl option for ANONTLS to\n"
-"                       be active.  The -anontls option only fine-tunes its\n"
-"                       operation.\n"
-"\n"
-"-sslonly               Same as: \"-vencrypt never -anontls never\"  i.e. it\n"
-"                       disables the VeNCrypt and ANONTLS encryption methods\n"
-"                       and only allows standard SSL tunneling.  You must also\n"
-"                       supply the -ssl ... option (see below.)\n"
-"\n"
-"\n"
-"-dhparams file         For some operations a set of Diffie Hellman parameters\n"
-"                       (prime and generator) is needed.  If so, use the\n"
-"                       parameters in \"file\". In particular, the VeNCrypt and\n"
-"                       ANONTLS anonymous DH mode need them.  By default a\n"
-"                       fixed set is used. If you do not want to do that you\n"
-"                       can specify \"newdh:\" to the -vencrypt and -anontls\n"
-"                       options to generate a new set each session.  If that\n"
-"                       is too slow for you, use -dhparams file to a set you\n"
-"                       created manually via \"openssl dhparam -out file 1024\"\n"
-"\n"
-"-nossl                 Disable the -ssl option (see below). Since -ssl is off\n"
-"                       by default -nossl would only be used on the commandline\n"
-"                       to unset any *earlier* -ssl option (or -svc...)\n"
-"\n"
-"-ssl [pem]             Use the openssl library (www.openssl.org) to provide a\n"
-"                       built-in encrypted SSL/TLS tunnel between VNC viewers\n"
-"                       and x11vnc.  This requires libssl support to be\n"
-"                       compiled into x11vnc at build time.  If x11vnc is not\n"
-"                       built with libssl support it will exit immediately when\n"
-"                       -ssl is prescribed.  See the -stunnel option below for\n"
-"                       an alternative.\n"
-"\n"
-"                       The VNC Viewer-side needs to support SSL/TLS as well.\n"
-"                       See this URL and also the discussion below for\n"
-"                       ideas on how to enable SSL support for the viewer:\n"
-"                       http://www.karlrunge.com/x11vnc/faq.html#faq-ssl-tun\n"
-"                       nel-viewers .  x11vnc provides an SSL enabled Java\n"
-"                       viewer applet in the classes/ssl directory (-http or\n"
-"                       -httpdir options.)  The SSVNC viewer package supports\n"
-"                       SSL tunnels too.\n"
-"\n"
-"                       If the VNC Viewer supports VeNCrypt or ANONTLS (vino's\n"
-"                       encryption mode) they are also supported by the -ssl\n"
-"                       mode (see the -vencrypt and -anontls options for more\n"
-"                       info; use -sslonly to disable both of them.)\n"
-"\n"
-"                       Use \"-ssl /path/to/mycert.pem\" to specify an SSL\n"
-"                       certificate file in PEM format to use to identify and\n"
-"                       provide a key for this server.  See openssl(1) for more\n"
-"                       info about PEMs and the -sslGenCert and \"-ssl SAVE\"\n"
-"                       options below for how to create them.\n"
-"\n"
-"                       The connecting VNC viewer SSL tunnel can (at its option)\n"
-"                       authenticate this server if it has the public key part\n"
-"                       of the certificate (or a common certificate authority,\n"
-"                       CA, is a more sophisticated way to verify this server's\n"
-"                       cert, see -sslGenCA below).  This authentication is\n"
-"                       done to prevent Man-In-The-Middle attacks.  Otherwise,\n"
-"                       if the VNC viewer simply accepts this server's key\n"
-"                       WITHOUT verification, the traffic is protected from\n"
-"                       passive sniffing on the network, but *NOT* from\n"
-"                       Man-In-The-Middle attacks. There are hacker tools\n"
-"                       like dsniff/webmitm and cain that implement SSL\n"
-"                       Man-In-The-Middle attacks.\n"
-"\n"
-"                       If [pem] is empty or the string \"SAVE\" then the\n"
-"                       openssl(1) command must be available to generate the\n"
-"                       certificate the first time.  A self-signed certificate\n"
-"                       is generated (see -sslGenCA and -sslGenCert for use\n"
-"                       of a Certificate Authority.)  It will be saved to the\n"
-"                       file ~/.vnc/certs/server.pem.  On subsequent calls if\n"
-"                       that file already exists it will be used directly.\n"
-"\n"
-"                       Use \"SAVE_NOPROMPT\" to avoid being prompted to\n"
-"                       protect the generated key with a passphrase.  However in\n"
-"                       -inetd and -bg modes there will be no prompting for a\n"
-"                       passphrase in either case.\n"
-"\n"
-"                       If [pem] is \"SAVE_PROMPT\" the server.pem certificate\n"
-"                       will be created based on your answers to its prompts for\n"
-"                       all info such as OrganizationalName, CommonName, etc.\n"
-"\n"
-"                       Use \"SAVE-<string>\" and \"SAVE_PROMPT-<string>\"\n"
-"                       to refer to the file ~/.vnc/certs/server-<string>.pem\n"
-"                       instead (it will be generated if it does not already\n"
-"                       exist).  E.g. \"SAVE-charlie\" will store to the file\n"
-"                       ~/.vnc/certs/server-charlie.pem\n"
-"\n"
-"                       Examples: x11vnc -ssl SAVE -display :0 ...\n"
-"                                 x11vnc -ssl SAVE-someother -display :0 ...\n"
-"\n"
-"                       If [pem] is \"TMP\" and the openssl(1) utility\n"
-"                       command exists in PATH, then a temporary, self-signed\n"
-"                       certificate will be generated for this session.  If\n"
-"                       openssl(1) cannot be used to generate a temporary\n"
-"                       certificate x11vnc exits immediately.  The temporary\n"
-"                       cert will be discarded when x11vnc exits.\n"
-"\n"
-"                       If successful in using openssl(1) to generate a\n"
-"                       temporary certificate in \"SAVE\" or \"TMP\" creation\n"
-"                       modes, the public part of it will be displayed to stderr\n"
-"                       (e.g. one could copy it to the client-side to provide\n"
-"                       authentication of the server to VNC viewers.)\n"
-"\n"
-"                       NOTE: In \"TMP\" mode, unless you safely copy the\n"
-"                       public part of the temporary Cert to the viewer for\n"
-"                       authenticate *every time* (unlikely...), then only\n"
-"                       passive sniffing attacks are prevented and you are\n"
-"                       still open to Man-In-The-Middle attacks.  This is\n"
-"                       why the default \"SAVE\" mode is preferred (and more\n"
-"                       sophisticated CA mode too).  Only with saved keys AND\n"
-"                       the VNC viewer authenticating them (via the public\n"
-"                       certificate), are Man-In-The-Middle attacks prevented.\n"
-"\n"
-"                       If [pem] is \"ANON\" then the Diffie-Hellman anonymous\n"
-"                       key exchange method is used.  In this mode there\n"
-"                       are *no* SSL certificates and so it is not possible\n"
-"                       to authenticate either the VNC server or VNC client.\n"
-"                       Thus only passive network sniffing attacks are avoided:\n"
-"                       the \"ANON\" method is susceptible to Man-In-The-Middle\n"
-"                       attacks.  \"ANON\" is not recommended; instead use\n"
-"                       a SSL PEM you created or the default \"SAVE\" method.\n"
-"\n"
-"                       See -ssldir below to use a directory besides the\n"
-"                       default ~/.vnc/certs\n"
-"\n"
-"                       If your x11vnc binary was not compiled with OpenSSL\n"
-"                       library support, use of the -ssl option will induce an\n"
-"                       immediate failure and exit.  For such binaries, consider\n"
-"                       using the -stunnel option for SSL encrypted connections.\n"
-"\n"
-"                       Misc Info: In temporary cert creation mode \"TMP\", set\n"
-"                       the env. var. X11VNC_SHOW_TMP_PEM=1 to have x11vnc print\n"
-"                       out the entire certificate, including the PRIVATE KEY\n"
-"                       part, to stderr.  There are better ways to get/save this\n"
-"                       info.  See \"SAVE\" above and \"-sslGenCert\" below.\n"
-"\n"
-"-ssltimeout n          Set SSL read timeout to n seconds.  In some situations\n"
-"                       (i.e. an iconified viewer in Windows) the viewer stops\n"
-"                       talking and the connection is dropped after the default\n"
-"                       timeout (25s for about the first minute, 43200s later).\n"
-"                       Set to zero to poll forever.  Set to a negative value\n"
-"                       to use the builtin setting.\n"
-"\n"
-"                       Note that this value does NOT apply to the *initial* ssl\n"
-"                       init connection.  The default timeout for that is 20sec.\n"
-"                       Use -env SSL_INIT_TIMEOUT=n to modify it.\n"
-"\n"
-"-sslnofail             Exit at the first SSL connection failure. Useful when\n"
-"                       scripting SSL connections (e.g. x11vnc is started via\n"
-"                       ssh) and you do not want x11vnc waiting around for more\n"
-"                       connections, tying up ports, etc.\n"
-"\n"
-"-ssldir dir            Use \"dir\" as an alternate ssl certificate and key\n"
-"                       management toplevel directory.  The default is\n"
-"                       ~/.vnc/certs\n"
-"\n"
-"                       This directory is used to store server and other\n"
-"                       certificates and keys and also other materials.  E.g. in\n"
-"                       the simplest case, \"-ssl SAVE\" will store the x11vnc\n"
-"                       server cert in dir/server.pem\n"
-"\n"
-"                       Use of alternate directories via -ssldir allows you to\n"
-"                       manage multiple VNC Certificate Authority (CA) keys.\n"
-"                       Another use is if ~/.vnc/cert is on an NFS share you\n"
-"                       might want your certificates and keys to be on a local\n"
-"                       filesystem to prevent network snooping (for example\n"
-"                       -ssldir /var/lib/x11vnc-certs).\n"
-"\n"
-"                       -ssldir affects nearly all of the other -ssl* options,\n"
-"                       e.g. -ssl SAVE, -sslGenCert, etc..\n"
-"\n"
-"-sslverify path        For either of the -ssl or -stunnel modes, use \"path\"\n"
-"                       to provide certificates to authenticate incoming VNC\n"
-"                       *Client* connections (normally only the server is\n"
-"                       authenticated in SSL.)  This can be used as a method\n"
-"                       to replace standard password authentication of clients.\n"
-"\n"
-"                       If \"path\" is a directory it contains the client (or CA)\n"
-"                       certificates in separate files.  If path is a file,\n"
-"                       it contains one or more certificates. See special tokens\n"
-"                       below.  These correspond to the \"CApath = dir\" and\n"
-"                       \"CAfile = file\" stunnel options.  See the stunnel(8)\n"
-"                       manpage for details.\n"
-"\n"
-"                       Examples:\n"
-"                              x11vnc -ssl -sslverify ~/my.crt\n"
-"                              x11vnc -ssl -sslverify ~/my_pem_dir/\n"
-"\n"
-"                       Note that if path is a directory, it must contain\n"
-"                       the certs in separate files named like <HASH>.0, where\n"
-"                       the value of <HASH> is found by running the command\n"
-"                       \"openssl x509 -hash -noout -in file.crt\". Evidently\n"
-"                       one uses <HASH>.1 if there is a collision...\n"
-"\n"
-"                       The the key-management utility \"-sslCertInfo HASHON\"\n"
-"                       and \"-sslCertInfo HASHOFF\" will create/delete these\n"
-"                       hashes for you automatically (via symlink) in the HASH\n"
-"                       subdirs it manages.  Then you can point -sslverify to\n"
-"                       the HASH subdir.\n"
-"\n"
-"                       Special tokens: in -ssl mode, if \"path\" is not a file or\n"
-"                       a directory, it is taken as a comma separated list of\n"
-"                       tokens that are interpreted as follows:\n"
-"\n"
-"                       If a token is \"CA\" that means load the CA/cacert.pem\n"
-"                       file from the ssl directory.  If a token is \"clients\"\n"
-"                       then all the files clients/*.crt in the ssl directory\n"
-"                       are loaded.  Otherwise the file clients/token.crt\n"
-"                       is attempted to be loaded.  As a kludge, use a token\n"
-"                       like ../server-foo to load a server cert if you find\n"
-"                       that necessary.\n"
-"\n"
-"                       Use -ssldir to use a directory different from the\n"
-"                       ~/.vnc/certs default.\n"
-"\n"
-"                       Note that if the \"CA\" cert is loaded you do not need\n"
-"                       to load any of the certs that have been signed by it.\n"
-"                       You will need to load any additional self-signed certs\n"
-"                       however.\n"
-"\n"
-"                       Examples:\n"
-"                              x11vnc -ssl -sslverify CA\n"
-"                              x11vnc -ssl -sslverify self:fred,self:jim\n"
-"                              x11vnc -ssl -sslverify CA,clients\n"
-"\n"
-"                       Usually \"-sslverify CA\" is the most effective.\n"
-"                       See the -sslGenCA and -sslGenCert options below for\n"
-"                       how to set up and manage the CA framework.\n"
-"\n"
-"\n"
-"\n"
-"                       NOTE: the following utilities, -sslGenCA, -sslGenCert,\n"
-"                       -sslEncKey, -sslCertInfo, and -sslCRL are provided for\n"
-"                       completeness, but for casual usage they are overkill.\n"
-"\n"
-"                       They provide VNC Certificate Authority (CA) key creation\n"
-"                       and server / client key generation and signing.  So they\n"
-"                       provide a basic Public Key management framework for\n"
-"                       VNC-ing with x11vnc. (note that they require openssl(1)\n"
-"                       be installed on the system)\n"
-"\n"
-"                       However, the simplest usage mode, \"-ssl TMP\" (where\n"
-"                       x11vnc automatically generates its own, self-signed,\n"
-"                       temporary key and the VNC viewers always accept it,\n"
-"                       e.g. accepting via a dialog box) is probably safe enough\n"
-"                       for most scenarios.  CA management is not needed.\n"
-"\n"
-"                       To protect against Man-In-The-Middle attacks the \"TMP\"\n"
-"                       mode can be improved by using \"-ssl SAVE\" (same as\n"
-"                       \"-ssl\", i.e. the default) to have x11vnc create a\n"
-"                       longer term self-signed certificate, and then (safely)\n"
-"                       copy the corresponding public key cert to the desired\n"
-"                       client machines (care must be taken the private key part\n"
-"                       is not stolen; you will be prompted for a passphrase).\n"
-"\n"
-"                       So keep in mind no CA key creation or management\n"
-"                       (-sslGenCA and -sslGenCert) is needed for either of\n"
-"                       the above two common usage modes.\n"
-"\n"
-"                       One might want to use -sslGenCA and -sslGenCert\n"
-"                       if you had a large number of VNC client and server\n"
-"                       workstations.  That way the administrator could generate\n"
-"                       a single CA key with -sslGenCA and distribute its\n"
-"                       certificate part to all of the workstations.\n"
-"\n"
-"                       Next, he could create signed VNC server keys\n"
-"                       (-sslGenCert server ...) for each workstation or user\n"
-"                       that then x11vnc would use to authenticate itself to\n"
-"                       any VNC client that has the CA cert.\n"
-"\n"
-"                       Optionally, the admin could also make it so the\n"
-"                       VNC clients themselves are authenticated to x11vnc\n"
-"                       (-sslGenCert client ...)  For this -sslverify would be\n"
-"                       pointed to the CA cert (and/or self-signed certs).\n"
-"\n"
-"                       x11vnc will be able to use all of these cert and\n"
-"                       key files.  On the VNC client side, they will need to\n"
-"                       be \"imported\" somehow.  Web browsers have \"Manage\n"
-"                       Certificates\" actions as does the Java applet plugin\n"
-"                       Control Panel.  stunnel can also use these files (see\n"
-"                       the ss_vncviewer example script in the FAQ and SSVNC.)\n"
-"\n"
-"-sslCRL path           Set the Certificate Revocation Lists (CRL) to \"path\".\n"
-"                       This setting applies for both -ssl and -stunnel modes.\n"
-"\n"
-"                       If path is a file, the file contains one or more CRLs\n"
-"                       in PEM format.  If path is a directory, it contains\n"
-"                       hash named files of CRLs in the usual OpenSSL manner.\n"
-"                       See the OpenSSL and stunnel(8) documentation for\n"
-"                       more info.\n"
-"\n"
-"                       This option only applies if -sslverify has been\n"
-"                       supplied: it checks for revocation along the\n"
-"                       certificate chain used to verify the VNC client.\n"
-"                       The -sslCRL setting will be ignored when -sslverify is\n"
-"                       not specified.\n"
-"\n"
-"                       Note that if a CRL's expiration date has passed, all\n"
-"                       SSL connections will fail regardless of if they are\n"
-"                       related to the subject of the CRL or not.\n"
-"\n"
-"                       Only rarely will one's x11vnc -ssl infrastructure be so\n"
-"                       large that this option would be useful (since normally\n"
-"                       maintaining the contents of the -sslverify file or\n"
-"                       directory should be enough.)  However, when using\n"
-"                       x11vnc with a Certificate Authority (see -sslGenCA)\n"
-"                       to authenticate Clients via SSL/TLS, the -sslCRL option\n"
-"                       can be useful to revoke users' certs whose private SSL\n"
-"                       keys were lost or stolen (e.g. laptop.)  This way a new\n"
-"                       CA cert+key does not need to be created and new signed\n"
-"                       client keys generated and distributed to all users.\n"
-"\n"
-"                       To create a CRL file with revoked certificates the\n"
-"                       commands 'openssl ca -revoke ...' and 'openssl ca\n"
-"                       -gencrl ...' are useful.  (Run them in ~/.vnc/certs)\n"
-"\n"
-"-sslGenCA [dir]        Generate your own Certificate Authority private key,\n"
-"                       certificate, and other files in directory [dir].\n"
-"                       x11vnc then exits.\n"
-"\n"
-"                       If [dir] is not supplied, a -ssldir setting is used,\n"
-"                       or otherwise ~/.vnc/certs is used.\n"
-"\n"
-"                       This command also creates directories where server and\n"
-"                       client certs and keys will be stored.  The openssl(1)\n"
-"                       program must be installed on the system and available\n"
-"                       in PATH.\n"
-"\n"
-"                       After the CA files and directories are created the\n"
-"                       x11vnc command exits; the VNC server is not run.\n"
-"\n"
-"                       You will be prompted for information to put into the CA\n"
-"                       certificate.  The info does not have to be accurate just\n"
-"                       as long as clients accept the cert for VNC connections.\n"
-"                       You will also need to supply a passphrase of at least\n"
-"                       4 characters for the CA private key.\n"
-"\n"
-"                       Once you have generated the CA you can distribute\n"
-"                       its certificate part, [dir]/CA/cacert.pem, to other\n"
-"                       workstations where VNC viewers will be run.  One will\n"
-"                       need to \"import\" this certificate in the applications,\n"
-"                       e.g. Web browser, Java applet plugin, stunnel, etc.\n"
-"                       Next, you can create and sign keys using the CA with\n"
-"                       the -sslGenCert option below.\n"
-"\n"
-"                       Examples:\n"
-"                                x11vnc -sslGenCA\n"
-"                                x11vnc -sslGenCA  ~/myCAdir\n"
-"                                x11vnc -ssldir ~/myCAdir -sslGenCA\n"
-"\n"
-"                       (the last two lines are equivalent)\n"
-"\n"
-"-sslGenCert type name  Generate a VNC server or client certificate and private\n"
-"                       key pair signed by the CA created previously with\n"
-"                       -sslGenCA.  The openssl(1) program must be installed\n"
-"                       on the system and available in PATH.\n"
-"\n"
-"                       After the Certificate is generated x11vnc exits; the\n"
-"                       VNC server is not run.\n"
-"\n"
-"                       The type of key to be generated is the string \"type\".\n"
-"                       It is either \"server\" (i.e. for use by x11vnc) or\n"
-"                       \"client\" (for a VNC viewer).  Note that typically\n"
-"                       only \"server\" is used: the VNC clients authenticate\n"
-"                       themselves by a non-public-key method (e.g. VNC or\n"
-"                       unix password).  \"type\" is required.\n"
-"\n"
-"                       An arbitrary default name you want to associate with\n"
-"                       the key is supplied by the \"name\" string.  You can\n"
-"                       change it at the various prompts when creating the key.\n"
-"                       \"name\" is optional.\n"
-"\n"
-"                       If name is left blank for clients keys then \"nobody\"\n"
-"                       is used.  If left blank for server keys, then the\n"
-"                       primary server key: \"server.pem\" is created (this\n"
-"                       is the saved one referenced by \"-ssl SAVE\" when the\n"
-"                       server is started)\n"
-"\n"
-"                       If \"name\" begins with the string \"self:\" then\n"
-"                       a self-signed certificate is created instead of one\n"
-"                       signed by your CA key.\n"
-"\n"
-"                       If \"name\" begins with the string \"req:\" then only a\n"
-"                       key (.key) and a certificate signing *request* (.req)\n"
-"                       are generated.  You can then send the .req file to\n"
-"                       an external CA (even a professional one, e.g. Thawte)\n"
-"                       and then combine the .key and the received cert into\n"
-"                       the .pem file with the same basename.\n"
-"\n"
-"                       The distinction between \"server\" and \"client\" is\n"
-"                       simply the choice of output filenames and sub-directory.\n"
-"                       This makes it so the -ssl SAVE-name option can easily\n"
-"                       pick up the x11vnc PEM file this option generates.\n"
-"                       And similarly makes it easy for the -sslverify option\n"
-"                       to pick up your client certs.\n"
-"\n"
-"                       There is nothing special about the filename or directory\n"
-"                       location of either the \"server\" and \"client\" certs.\n"
-"                       You can rename the files or move them to wherever\n"
-"                       you like.\n"
-"\n"
-"                       Precede this option with -ssldir [dir] to use a\n"
-"                       directory other than the default ~/.vnc/certs You will\n"
-"                       need to run -sslGenCA on that directory first before\n"
-"                       doing any -sslGenCert key creation.\n"
-"\n"
-"                       Note you cannot recreate a cert with exactly the same\n"
-"                       distiguished name (DN) as an existing one.  To do so,\n"
-"                       you will need to edit the [dir]/CA/index.txt file to\n"
-"                       delete the line.\n"
-"\n"
-"                       Similar to -sslGenCA, you will be prompted to fill\n"
-"                       in some information that will be recorded in the\n"
-"                       certificate when it is created.\n"
-"\n"
-"                       Tip: if you know the fully-qualified hostname other\n"
-"                       people will be connecting to, you can use that as the\n"
-"                       CommonName \"CN\" to avoid some applications (e.g. web\n"
-"                       browsers and java plugin) complaining that it does not\n"
-"                       match the hostname.\n"
-"\n"
-"                       You will also need to supply the CA private key\n"
-"                       passphrase to unlock the private key created from\n"
-"                       -sslGenCA.  This private key is used to sign the server\n"
-"                       or client certificate.\n"
-"\n"
-"                       The \"server\" certs can be used by x11vnc directly by\n"
-"                       pointing to them via the -ssl [pem] option.  The default\n"
-"                       file will be ~/.vnc/certs/server.pem.  This one would\n"
-"                       be used by simply typing -ssl SAVE.  The pem file\n"
-"                       contains both the certificate and the private key.\n"
-"                       server.crt file contains the cert only.\n"
-"\n"
-"                       The \"client\" cert + private key file will need\n"
-"                       to be copied and imported into the VNC viewer\n"
-"                       side applications (Web browser, Java plugin,\n"
-"                       stunnel, etc.)  Once that is done you can delete the\n"
-"                       \"client\" private key file on this machine since\n"
-"                       it is only needed on the VNC viewer side.  The,\n"
-"                       e.g. ~/.vnc/certs/clients/<name>.pem contains both\n"
-"                       the cert and private key.  The <name>.crt contains the\n"
-"                       certificate only.\n"
-"\n"
-"                       NOTE: It is very important to know one should\n"
-"                       generate new keys with a passphrase.  Otherwise if an\n"
-"                       untrusted user steals the key file he could use it to\n"
-"                       masquerade as the x11vnc server (or VNC viewer client).\n"
-"                       You will be prompted whether to encrypt the key with\n"
-"                       a passphrase or not.  It is recommended that you do.\n"
-"                       One inconvenience to a passphrase is that it must\n"
-"                       be typed in EVERY time x11vnc or the client app is\n"
-"                       started up.\n"
-"\n"
-"                       Examples:\n"
-"\n"
-"                               x11vnc -sslGenCert server\n"
-"                               x11vnc -ssl SAVE -display :0 ...\n"
-"\n"
-"                       and then on viewer using ss_vncviewer stunnel wrapper\n"
-"                       (see the FAQ):\n"
-
-"                               ss_vncviewer -verify ./cacert.crt hostname:0\n"
-"\n"
-"                       (this assumes the cacert.crt cert from -sslGenCA\n"
-"                       was safely copied to the VNC viewer machine where\n"
-"                       ss_vncviewer is run)\n"
-"\n"
-"                       Example using a name:\n"
-"\n"
-"                               x11vnc -sslGenCert server charlie\n"
-"                               x11vnc -ssl SAVE-charlie -display :0 ...\n"
-"\n"
-"                       Example for a client certificate (rarely used):\n"
-"\n"
-"                               x11vnc -sslGenCert client roger\n"
-"                               scp ~/.vnc/certs/clients/roger.pem somehost:.\n"
-"                               rm  ~/.vnc/certs/clients/roger.pem\n"
-"\n"
-"                       x11vnc is then started with the option -sslverify\n"
-"                       ~/.vnc/certs/clients/roger.crt (or simply -sslverify\n"
-"                       roger), and on the viewer user on somehost could do\n"
-"                       for example:\n"
-"\n"
-"                               ss_vncviewer -mycert ./roger.pem hostname:0\n"
-"\n"
-"                       If you set the env. var REQ_ARGS='...' it will be\n"
-"                       passed to openssl req(1).  A common use would be\n"
-"                       REQ_ARGS='-days 1095' to bump up the expiration date\n"
-"                       (3 years in this case).\n"
-"\n"
-"-sslEncKey pem         Utility to encrypt an existing PEM file with a\n"
-"                       passphrase you supply when prompted.  For that key to be\n"
-"                       used (e.g. by x11vnc) the passphrase must be supplied\n"
-"                       each time.\n"
-"\n"
-"                       The \"SAVE\" notation described under -ssl applies as\n"
-"                       well. (precede this option with -ssldir [dir] to refer\n"
-"                       a directory besides the default ~/.vnc/certs)\n"
-"\n"
-"                       The openssl(1) program must be installed on the system\n"
-"                       and available in PATH.  After the Key file is encrypted\n"
-"                       the x11vnc command exits; the VNC server is not run.\n"
-"\n"
-"                       Examples:\n"
-"                               x11vnc -sslEncKey /path/to/foo.pem\n"
-"                               x11vnc -sslEncKey SAVE\n"
-"                               x11vnc -sslEncKey SAVE-charlie\n"
-"\n"
-"-sslCertInfo pem       Prints out information about an existing PEM file.\n"
-"                       In addition the public certificate is also printed.\n"
-"                       The openssl(1) program must be in PATH. Basically the\n"
-"                       command \"openssl x509 -text\" is run on the pem.\n"
-"\n"
-"                       After the info is printed the x11vnc command exits;\n"
-"                       the VNC server is not run.\n"
-"\n"
-"                       The \"SAVE\" notation described under -ssl applies\n"
-"                       as well.\n"
-"\n"
-"                       Using  \"LIST\" will give a list of all certs being\n"
-"                       managed (in the ~/.vnc/certs dir, use -ssldir to refer\n"
-"                       to another dir).  \"ALL\" will print out the info for\n"
-"                       every managed key (this can be very long).  Giving a\n"
-"                       client or server cert shortname will also try a lookup\n"
-"                       (e.g. -sslCertInfo charlie).  Use \"LISTL\" or \"LL\"\n"
-"                       for a long (ls -l style) listing.\n"
-"\n"
-"                       Using \"HASHON\" will create subdirs [dir]/HASH and\n"
-"                       [dir]/HASH with OpenSSL hash filenames (e.g. 0d5fbbf1.0)\n"
-"                       symlinks pointing up to the corresponding *.crt file.\n"
-"                       ([dir] is ~/.vnc/certs or one given by -ssldir.)\n"
-"                       This is a useful way for other OpenSSL applications\n"
-"                       (e.g. stunnel) to access all of the certs without\n"
-"                       having to concatenate them.  x11vnc will not use them\n"
-"                       unless you specifically reference them.  \"HASHOFF\"\n"
-"                       removes these HASH subdirs.\n"
-"\n"
-"                       The LIST, LISTL, LL, ALL, HASHON, HASHOFF words can\n"
-"                       also be lowercase, e.g. \"list\".\n"
-"\n"
-"-sslDelCert pem        Prompts you to delete all .crt .pem .key .req files\n"
-"                       associated with [pem].  x11vnc then exits. \"SAVE\"\n"
-"                       and lookups as in -sslCertInfo apply as well.\n"
-"\n"
-"-sslScripts            Prints out both the 'genCA' and 'genCert' x11vnc\n"
-"                       openssl wrapper scripts for you to examine, modify, etc.\n"
-"                       The scripts are printed to stdout and then the x11vnc\n"
-"                       program exits.\n"
-"\n"
-"\n"
-"-stunnel [pem]         Use the stunnel(8) (stunnel.mirt.net) to provide an\n"
-"                       encrypted SSL tunnel between viewers and x11vnc.\n"
-"\n"
-"                       This external tunnel method was implemented prior to the\n"
-"                       integrated -ssl encryption described above.  It still\n"
-"                       works well and avoids the requirement of linking with\n"
-"                       the OpenSSL libraries.  This mode requires stunnel\n"
-"                       to be installed on the system and available via PATH\n"
-"                       (n.b. stunnel is often installed in sbin directories).\n"
-"                       Version 4.x of stunnel is assumed (but see -stunnel3\n"
-"                       below.)\n"
-"\n"
-"                       [pem] is optional, use \"-stunnel /path/to/stunnel.pem\"\n"
-"                       to specify a PEM certificate file to pass to stunnel.\n"
-"                       See the -ssl option for more info on certificate files.\n"
-"\n"
-"                       Whether or not your stunnel has its own certificate\n"
-"                       depends on your stunnel configuration; stunnel often\n"
-"                       generates one at install time.  See your stunnel\n"
-"                       documentation for details.  In any event, if you want to\n"
-"                       use this certificate you must supply the full path to it\n"
-"                       as [pem].  Note: the file may only be readable by root.\n"
-"\n"
-"                       [pem] may also be the special strings \"TMP\", \"SAVE\",\n"
-"                       and \"SAVE...\" as described in the -ssl option.\n"
-"                       If [pem] is not supplied, \"SAVE\" is assumed.\n"
-"\n"
-"                       Note that the VeNCrypt, ANONTLS, and \"ANON\" modes\n"
-"                       are not supported in -stunnel mode.\n"
-"\n"
-"                       stunnel is started up as a child process of x11vnc and\n"
-"                       any SSL connections stunnel receives are decrypted and\n"
-"                       sent to x11vnc over a local socket.  The strings\n"
-"                       \"The SSL VNC desktop is ...\" and \"SSLPORT=...\"\n"
-"                       are printed out at startup to indicate this.\n"
-"\n"
-"                       The -localhost option is enforced by default to avoid\n"
-"                       people routing around the SSL channel.  Use -env\n"
-"                       STUNNEL_DISABLE_LOCALHOST=1 to disable this security\n"
-"                       requirement.\n"
-"\n"
-"                       Set -env STUNNEL_DEBUG=1 for more debugging printout.\n"
-"\n"
-"                       Set -env STUNNEL_PROG=xxx to the full path of stunnel\n"
-"                       program you want to be used (e.g. /usr/bin/stunnel4).\n"
-"\n"
-"                       Set -env STUNNEL_LISTEN=xxx to the address of the\n"
-"                       network interface to listen on (the default is to listen\n"
-"                       on all interfaces), e.g. STUNNEL_LISTEN=192.168.1.100.\n"
-"\n"
-"                       A simple way to add IPv6 support is STUNNEL_LISTEN=::\n"
-"\n"
-"                       Your VNC viewer will also need to be able to connect\n"
-"                       via SSL.  Unfortunately not too many do this.  See the\n"
-"                       information about SSL viewers under the -ssl option.\n"
-"                       The x11vnc project's SSVNC is an option.\n"
-"\n"
-"                       Also, in the x11vnc distribution, patched TightVNC\n"
-"                       and UltraVNC Java applet jar files are provided in\n"
-"                       the classes/ssl directory that do SSL connections.\n"
-"                       Enable serving them with the -http, -http_ssl, or\n"
-"                       -httpdir (see the option descriptions for more info.)\n"
-"\n"
-"                       Note that for the Java viewer applet usage the\n"
-"                       \"?PORT=xxxx\" in the various URLs printed at startup\n"
-"                       will need to be supplied to the web browser to connect\n"
-"                       properly.\n"
-"\n"
-"                       Currently the automatic \"single port\" HTTPS mode of\n"
-"                       -ssl is not fully supported in -stunnel mode.  However,\n"
-"                       it can be emulated via:\n"
-"\n"
-"                         %% x11vnc -stunnel -http_ssl -http_oneport ...\n"
-"\n"
-"                       In general, it is also not too difficult to set up\n"
-"                       an stunnel or other SSL tunnel on the viewer side.\n"
-"                       A simple example on Unix using stunnel 3.x is:\n"
-"\n"
-"                         %% stunnel -c -d localhost:5901 -r remotehost:5900\n"
-"                         %% vncviewer localhost:1\n"
-"\n"
-"                       For Windows, stunnel has been ported to it and there\n"
-"                       are probably other such tools available.  See the FAQ\n"
-"                       and SSVNC for more examples.\n"
-"\n"
-"-stunnel3  [pem]       Use version 3.x stunnel command line syntax instead of\n"
-"                       version 4.x.  The -http/-httpdir Java applet serving\n"
-"                       is currently not available in this mode.\n"
-"\n"
-"-enc cipher:keyfile    Use symmetric encryption with cipher \"cipher\"\n"
-"                       and secret key data in \"keyfile\".  If keyfile is\n"
-"                       pw=<string> then \"string\" is used as the key data.\n"
-"\n"
-"                       NOTE: It is recommended that you use SSL via the -ssl\n"
-"                       option instead of this option because SSL is well\n"
-"                       understood and takes great care to establish unique\n"
-"                       session keys and is more compatible with other software.\n"
-"                       Use this option if you do not want to deal with SSL\n"
-"                       certificates for authentication and do not want to\n"
-"                       use SSH but want some encryption for your VNC session.\n"
-"                       Or if you must interface with a symmetric key tunnel\n"
-"                       that you do not have control over.\n"
-"\n"
-"                       Note that this mode will NOT work with the UltraVNC DSM\n"
-"                       plugins because they alter the RFB protocol in addition\n"
-"                       to tunnelling with the symmetric cipher (an unfortunate\n"
-"                       choice of implementation...)\n"
-"\n"
-"                       cipher can be one of:  arc4, aesv2, aes-cfb, blowfish,\n"
-"                       aes256, or 3des.  See the OpenSSL documentation for\n"
-"                       more info.  The keysize is 128 bits (except for aes256).\n"
-"                       Here is one way to make a keyfile with that many bits:\n"
-"\n"
-"                            dd if=/dev/random of=./my.key bs=16 count=1\n"
-"\n"
-"                       you will need to securely share this key with the other\n"
-"                       side of the VNC connection (See SSVNC for examples).\n"
-"\n"
-"                       Example:  -enc blowfish:./my.key\n"
-"                       Example:  -enc blowfish:pw=swordfish\n"
-"\n"
-"                       By default 16 bytes of random salt followed by 16 bytes\n"
-"                       of random initialization vector are sent at the very\n"
-"                       beginning of the stream.  The other side must read these\n"
-"                       and initialize their cipher with them.  These values\n"
-"                       make the session key unique (without them the security\n"
-"                       is minimal).  Similarly, the other side must send us\n"
-"                       its random salt and IV with those same lengths.\n"
-"\n"
-"                       The salt and key data are combined to create a session\n"
-"                       key using an md5 hash as described in EVP_BytesToKey(3).\n"
-"\n"
-"                       The exact call is: EVP_BytesToKey(Cipher, EVP_md5(),\n"
-"                       salt, keydata, len, 1, keystr, NULL);  where salt is\n"
-"                       the random data as described above, and keydata is the\n"
-"                       shared secret key data.  keystr is the resulting session\n"
-"                       key.  The cipher is then seeded with keystr and uses\n"
-"                       the random initialization vector as its first block.\n"
-"\n"
-"                       To modify the amount of random salt and initialization\n"
-"                       vector use cipher at n,m where n is the salt length and\n"
-"                       m the initialization vector length.  E.g.\n"
-"\n"
-"                                 -enc aes-cfb at 8,16:./my.key\n"
-"\n"
-"                       It is not a good idea to set either one to zero,\n"
-"                       although you may be forced to if the other side of the\n"
-"                       tunnel is not under your control.\n"
-"\n"
-"                       To skip the salt and EVP_BytesToKey MD5 entirely (no\n"
-"                       hashing is done: the keydata is directly inserted into\n"
-"                       the cipher) specify \"-1\" for the salt, e.g.\n"
-"\n"
-"                                 -enc blowfish at -1,16:./my.key\n"
-"\n"
-"                       The message digest can also be changed to something\n"
-"                       besides the default MD5.  Use cipher at md+n,m where \"md\"\n"
-"                       can be one of sha, sha1, md5, or ripe.  For example:\n"
-"\n"
-"                                 -enc arc4 at sha+8,16:./my.key\n"
-"\n"
-"                       The SSVNC vnc viewer project supplies a symmetric\n"
-"                       encryption tool named \"ultravnc_dsm_helper\" that can\n"
-"                       be used on the viewer side.  For example:\n"
-"\n"
-"                       ssvncviewer exec='ultravnc_dsm_helper arc4 my.key 0 h:p'\n"
-"\n"
-"                       where h:p is the hostname and port of the x11vnc server.\n"
-"                       ultravnc_dsm_helper may also be used standalone to\n"
-"                       provide a symmetric encryption tunnel for any viewer\n"
-"                       or server (VNC or otherwise.) The cipher (1st arg)\n"
-"                       is basically the same syntax as we use above.\n"
-"\n"
-"                       Also see the 'Non-Ultra DSM' SSVNC option for the\n"
-"                       'UltraVNC DSM Encryption Plugin' advanced option.\n"
-"\n"
-"                       For both ways of using the viewer, you can specify the\n"
-"                       salt,ivec sizes (in GUI or, e.g. arc4 at 8,16).\n"
-"\n"
-"-https [port]          Use a special, separate HTTPS port (-ssl and\n"
-"                       -stunnel modes only) for HTTPS Java viewer applet\n"
-"                       downloading. I.e. not 5900 and not 5800 (the defaults.)\n"
-"\n"
-"                       BACKGROUND: In -ssl mode, it turns out you can use the\n"
-"                       single VNC port (e.g. 5900) for both VNC and HTTPS\n"
-"                       connections. (HTTPS is used to retrieve a SSL-aware\n"
-"                       VncViewer.jar applet that is provided with x11vnc).\n"
-"                       Since both use SSL the implementation was extended to\n"
-"                       detect if HTTP traffic (i.e. GET) is taking place and\n"
-"                       handle it accordingly.  The URL would be, e.g.:\n"
-"\n"
-"                       https://mymachine.org:5900/\n"
-"\n"
-"                       This is convenient for firewalls, etc, because only one\n"
-"                       port needs to be allowed in.  However, this heuristic\n"
-"                       adds a few seconds delay to each connection and can be\n"
-"                       unreliable (especially if the user takes much time to\n"
-"                       ponder the Certificate dialogs in his browser, Java VM,\n"
-"                       or VNC Viewer applet.  That's right 3 separate \"Are\n"
-"                       you sure you want to connect?\" dialogs!)\n"
-"\n"
-"                       END OF BACKGROUND.\n"
-"\n"
-"                       USAGE: So use the -https option to provide a separate,\n"
-"                       more reliable HTTPS port that x11vnc will listen on.  If\n"
-"                       [port] is not provided (or is 0), one is autoselected.\n"
-"                       The URL to use is printed out at startup.\n"
-"\n"
-"                       The SSL Java applet directory is specified via the\n"
-"                       -httpdir option.  If not supplied, -https will try\n"
-"                       to guess the directory as though the -http option\n"
-"                       was supplied.\n"
-"\n"
-"-httpsredir [port]     In -ssl mode with the Java applet retrieved via HTTPS,\n"
-"                       when the HTML file containing applet parameters\n"
-"                       ('index.vnc' or 'proxy.vnc') is sent do NOT set the\n"
-"                       applet PORT parameter to the actual VNC port but set it\n"
-"                       to \"port\" instead.  If \"port\" is not supplied, then\n"
-"                       the port number is guessed from the Host: HTTP header.\n"
-"\n"
-"                       This is useful when an incoming TCP connection\n"
-"                       redirection is performed by a router/gateway/firewall\n"
-"                       from one port to an internal machine where x11vnc is\n"
-"                       listening on a different port. The Java applet needs to\n"
-"                       connect to the firewall/router port, not the VNC port\n"
-"                       on the internal workstation. For example, one could\n"
-"                       redir from mygateway.com:443 to workstation:5900.\n"
-"\n"
-"                       This spares the user from having to type in\n"
-"                       https://mygateway.com/?PORT=443 into their web\n"
-"                       browser. Note that port 443 is the default https port;\n"
-"                       other ports must be explicitly indicated, for example:\n"
-"                       https://mygateway.com:8000/?PORT=8000.  To avoid having\n"
-"                       to include the PORT= in the browser URL, simply supply\n"
-"                       \"-httpsredir\" to x11vnc.\n"
-"\n"
-"                       This option does not work in -stunnel mode.\n"
-"\n"
-"                       More tricks: set the env var X11VNC_EXTRA_HTTPS_PARAMS\n"
-"                       to be extra URL parameters to use.  This way you do\n"
-"                       not need to specify extra PARAMS in the index.vnc file.\n"
-"                       E.g. x11vnc -env X11VNC_EXTRA_HTTPS_PARAMS='?GET=1' ...\n"
-"\n"
-"                       If you do not want to expose the non-SSL HTTP port to\n"
-"                       the network (i.e. you just want the single VNC/HTTPS\n"
-"                       port, e.g. 5900, open for connections) then specify the\n"
-"                       option -env X11VNC_HTTP_LISTEN_LOCALHOST=1  This way\n"
-"                       the connection to the LibVNCServer httpd server will\n"
-"                       only be available on localhost (note that in -ssl mode,\n"
-"                       HTTPS requests are redirected from SSL to the non-SSL\n"
-"                       LibVNCServer HTTP server.)\n"
-"\n"
-"-http_oneport          For UN-encrypted connections mode (i.e. no -ssl,\n"
-"                       -stunnel, or -enc options), allow the Java VNC Viewer\n"
-"                       applet to be downloaded thru the VNC port via HTTP.\n"
-"\n"
-"                       That is to say, you can use a single port for Java\n"
-"                       applet viewer connections by using a URL in your web\n"
-"                       browser like this, for example:\n"
-"\n"
-"                       http://hostname:5900\n"
-"\n"
-"                       The regular, two-port mode, URL http://hostname:5800\n"
-"                       will continue to work as well.\n"
-"\n"
-"                       As mentioned above, this mode will NOT work with\n"
-"                       the -ssl, -stunnel, or -enc encryption options.\n"
-"                       Note that is it equivalent to '-enc none' (i.e. it\n"
-"                       uses the same detection mechanism as for HTTPS, but\n"
-"                       with no encryption.)\n"
-"\n"
-"                       HTTPS single-port is on by default in -ssl encrypted\n"
-"                       mode (and -enc too), so you only need -http_oneport\n"
-"                       when doing non-SSL encrypted connections.\n"
-"\n"
-"                       This mode could also be useful for SSH tunnels since\n"
-"                       it means only one port needs to be redirected.\n"
-"\n"
-"                       The -httpsredir option may also be useful for this\n"
-"                       mode when using an SSH tunnel as well as for router\n"
-"                       port redirections.\n"
-"\n"
-"                       Note that the -env X11VNC_HTTP_LISTEN_LOCALHOST=1\n"
-"                       option described above under -httpsredir applies for\n"
-"                       the LibVNCServer httpd server in all cases (ssl or not.)\n"
-"\n"
-"-ssh user at host:disp    Create a remote listening port on machine \"host\"\n"
-"                       via a SSH tunnel using the -R rport:localhost:lport\n"
-"                       method. lport will be the local x11vnc listening port,\n"
-"                       so a connection to rport (5900+disp) on \"host\"\n"
-"                       will reach x11vnc.  E.g. fred at snoopy.com:0\n"
-"\n"
-"                       This could be useful if a firewall/router prevents\n"
-"                       incoming connections to the x11vnc machine, but\n"
-"                       the ssh machine \"host\" can be reached by the VNC\n"
-"                       viewer. \"user@\" is not needed unless the remote unix\n"
-"                       username differs from the current one.\n"
-"\n"
-"                       By default the remote sshd is usually configured to\n"
-"                       listen only on localhost for rport, so the viewer may\n"
-"                       need to ssh -L redir to \"host\" as well (See SSVNC to\n"
-"                       automate this).  The sshd setting GatewayPorts enables\n"
-"                       listening on all interfaces for rport; viewers can\n"
-"                       reach it more easily.\n"
-"\n"
-"                       \"disp\" is the VNC display for the remote SSH side,\n"
-"                       e.g. 0 corresponds to port 5900, etc.  If disp is\n"
-"                       greater than 200 the value is used as the port.  Use a\n"
-"                       negative value to force a low port, e.g. host:-80 will\n"
-"                       use port 80.\n"
-"\n"
-"                       If ssh-agent is not active, then the ssh password needs\n"
-"                       to be entered in the terminal where x11vnc is running.\n"
-"\n"
-"                       By default the remote ssh will issue a 'sleep 300' to\n"
-"                       wait for the incoming connection for 5 mins.  To modify\n"
-"                       this use user at host:disp+secs.\n"
-"\n"
-"                       If the remote SSH server is on a non-standard port\n"
-"                       (i.e. not 22) use user at host:port:disp+secs.\n"
-"\n"
-"                       Note that the ssh process MAY NOT be killed when\n"
-"                       x11vnc exits.  It tries by looking at ps(1) output.\n"
-"\n"
-"-usepw                 If no other password method was supplied on the command\n"
-"                       line, first look for ~/.vnc/passwd and if found use it\n"
-"                       with -rfbauth; next, look for ~/.vnc/passwdfile and\n"
-"                       use it with -passwdfile; otherwise, prompt the user\n"
-"                       for a password to create ~/.vnc/passwd and use it with\n"
-"                       the -rfbauth option.  If none of these succeed x11vnc\n"
-"                       exits immediately.\n"
-"\n"
-"-storepasswd pass file Store password \"pass\" as the VNC password in the\n"
-"                       file \"file\".  Once the password is stored the\n"
-"                       program exits.  Use the password via \"-rfbauth file\"\n"
-"\n"
-"                       If called with no arguments, \"x11vnc -storepasswd\",\n"
-"                       the user is prompted for a password and it is stored\n"
-"                       in the file ~/.vnc/passwd.  Called with one argument,\n"
-"                       that will be the file to store the prompted password in.\n"
-"\n"
-"-nopw                  Disable the big warning message when you use x11vnc\n"
-"                       without some sort of password.\n"
-"\n"
-"-accept string         Run a command (possibly to prompt the user at the\n"
-"                       X11 display) to decide whether an incoming client\n"
-"                       should be allowed to connect or not.  \"string\" is\n"
-"                       an external command run via system(3) or some special\n"
-"                       cases described below.  Be sure to quote \"string\"\n"
-"                       if it contains spaces, shell characters, etc.  If the\n"
-"                       external command returns 0 the client is accepted,\n"
-"                       otherwise the client is rejected.  See below for an\n"
-"                       extension to accept a client view-only.\n"
-"\n"
-"                       If x11vnc is running as root (say from inetd(8) or from\n"
-"                       display managers xdm(1), gdm(1), etc), think about the\n"
-"                       security implications carefully before supplying this\n"
-"                       option (likewise for the -gone option).\n"
-"\n"
-"                       Environment: The RFB_CLIENT_IP environment variable will\n"
-"                       be set to the incoming client IP number and the port\n"
-"                       in RFB_CLIENT_PORT (or -1 if unavailable).  Similarly,\n"
-"                       RFB_SERVER_IP and RFB_SERVER_PORT (the x11vnc side\n"
-"                       of the connection), are set to allow identification\n"
-"                       of the tcp virtual circuit.  The x11vnc process\n"
-"                       id will be in RFB_X11VNC_PID, a client id number in\n"
-"                       RFB_CLIENT_ID, and the number of other connected clients\n"
-"                       in RFB_CLIENT_COUNT.  RFB_MODE will be \"accept\".\n"
-"                       RFB_STATE will be PROTOCOL_VERSION, SECURITY_TYPE,\n"
-"                       AUTHENTICATION, INITIALISATION, NORMAL, or UNKNOWN\n"
-"                       indicating up to which state the client has achieved.\n"
-"                       RFB_LOGIN_VIEWONLY will be 0, 1, or -1 (unknown).\n"
-"                       RFB_USERNAME, RFB_LOGIN_TIME, and RFB_CURRENT_TIME may\n"
-"                       also be set.\n"
-"\n"
-"                       If \"string\" is \"popup\" then a builtin popup window\n"
-"                       is used.  The popup will time out after 120 seconds,\n"
-"                       use \"popup:N\" to modify the timeout to N seconds\n"
-"                       (use 0 for no timeout).\n"
-"\n"
-"                       In the case of \"popup\" and when the -unixpw option\n"
-"                       is specified, then a *second* window will be popped\n"
-"                       up after the user successfully logs in via his UNIX\n"
-"                       password.  This time the user will be identified as\n"
-"                       UNIX:username at hostname, the \"UNIX:\" prefix indicates\n"
-"                       which user the viewer logged as via -unixpw.  The first\n"
-"                       popup is only for whether to allow him to even *try*\n"
-"                       to login via unix password.\n"
-"\n"
-"                       If \"string\" is \"xmessage\" then an xmessage(1)\n"
-"                       invocation is used for the command.  xmessage must be\n"
-"                       installed on the machine for this to work.\n"
-"\n"
-"                       Both \"popup\" and \"xmessage\" will present an option\n"
-"                       for accepting the client \"View-Only\" (the client\n"
-"                       can only watch).  This option will not be presented if\n"
-"                       -viewonly has been specified, in which case the entire\n"
-"                       display is view only.\n"
-"\n"
-"                       If the user supplied command is prefixed with something\n"
-"                       like \"yes:0,no:*,view:3 mycommand ...\" then this\n"
-"                       associates the numerical command return code with\n"
-"                       the actions: accept, reject, and accept-view-only,\n"
-"                       respectively.  Use \"*\" instead of a number to indicate\n"
-"                       the default action (in case the command returns an\n"
-"                       unexpected value).  E.g. \"no:*\" is a good choice.\n"
-"\n"
-"                       Note that x11vnc blocks while the external command\n"
-"                       or popup is running (other clients may see no updates\n"
-"                       during this period).  So a person sitting a the physical\n"
-"                       display is needed to respond to an popup prompt. (use\n"
-"                       a 2nd x11vnc if you lock yourself out).\n"
-"\n"
-"                       More -accept tricks: use \"popupmouse\" to only allow\n"
-"                       mouse clicks in the builtin popup to be recognized.\n"
-"                       Similarly use \"popupkey\" to only recognize\n"
-"                       keystroke responses.  These are to help avoid the\n"
-"                       user accidentally accepting a client by typing or\n"
-"                       clicking. All 3 of the popup keywords can be followed\n"
-"                       by +N+M to supply a position for the popup window.\n"
-"                       The default is to center the popup window.\n"
-"-afteraccept string    As -accept, except to run a user supplied command after\n"
-"                       a client has been accepted and authenticated. RFB_MODE\n"
-"                       will be set to \"afteraccept\" and the other RFB_*\n"
-"                       variables are as in -accept.  Unlike -accept, the\n"
-"                       command return code is not interpreted by x11vnc.\n"
-"                       Example: -afteraccept 'killall xlock &'\n"
-"-gone string           As -accept, except to run a user supplied command when\n"
-"                       a client goes away (disconnects).  RFB_MODE will be\n"
-"                       set to \"gone\" and the other RFB_* variables are as\n"
-"                       in -accept.  The \"popup\" actions apply as well.\n"
-"                       Unlike -accept, the command return code is not\n"
-"                       interpreted by x11vnc.  Example: -gone 'xlock &'\n"
-"\n"
-"-users list            If x11vnc is started as root (say from inetd(8) or from\n"
-"                       display managers xdm(1), gdm(1), etc), then as soon\n"
-"                       as possible after connections to the X display are\n"
-"                       established try to switch to one of the users in the\n"
-"                       comma separated \"list\".  If x11vnc is not running as\n"
-"                       root this option is ignored.\n"
-"\n"
-"                       Why use this option?  In general it is not needed since\n"
-"                       x11vnc is already connected to the X display and can\n"
-"                       perform its primary functions.  The option was added\n"
-"                       to make some of the *external* utility commands x11vnc\n"
-"                       occasionally runs work properly.  In particular under\n"
-"                       GNOME and KDE to implement the \"-solid color\" feature\n"
-"                       external commands (gconftool-2 and dcop) unfortunately\n"
-"                       must be run as the user owning the desktop session.\n"
-"                       Since this option switches userid it also affects the\n"
-"                       userid used to run the processes for the -accept and\n"
-"                       -gone options.  It also affects the ability to read\n"
-"                       files for options such as -connect, -allow, and -remap\n"
-"                       and also the ultra and tight filetransfer feature if\n"
-"                       enabled.  Note that the -connect file is also sometimes\n"
-"                       written to.\n"
-"\n"
-"                       So be careful with this option since in some situations\n"
-"                       its use can decrease security.\n"
-"\n"
-"                       In general the switch to a user will only take place\n"
-"                       if the display can still be successfully opened as that\n"
-"                       user (this is primarily to try to guess the actual owner\n"
-"                       of the session). Example: \"-users fred,wilma,betty\".\n"
-"                       Note that a malicious local user \"barney\" by\n"
-"                       quickly using \"xhost +\" when logging in may possibly\n"
-"                       get the x11vnc process to switch to user \"fred\".\n"
-"                       What happens next?\n"
-"\n"
-"                       Under display managers it may be a long time before\n"
-"                       the switch succeeds (i.e. a user logs in).  To instead\n"
-"                       make it switch immediately regardless if the display\n"
-"                       can be reopened prefix the username with the \"+\"\n"
-"                       character. E.g. \"-users +bob\" or \"-users +nobody\".\n"
-"\n"
-"                       The latter (i.e. switching immediately to user\n"
-"                       \"nobody\") is the only obvious use of the -users option\n"
-"                       that increases security.\n"
-"\n"
-"                       Use the following notation to associate a group with\n"
-"                       a user: user1.group1,user2.group2,...  Note that\n"
-"                       initgroups(2) will still be called first to try to\n"
-"                       switch to ALL of a user's groups (primary and additional\n"
-"                       groups).  Only if that fails or it is not available\n"
-"                       then the single group specified as above (or the user's\n"
-"                       primary group if not specified) is switched to with\n"
-"                       setgid(2).  Use -env X11VNC_SINGLE_GROUP=1 to prevent\n"
-"                       trying initgroups(2) and only switch to the single\n"
-"                       group.  This sort of setting is only really needed to\n"
-"                       make the ultra or tight filetransfer permissions work\n"
-"                       properly. This format applies to any comma separated list\n"
-"                       of users, even the special \"=\" modes described below.\n"
-"\n"
-"                       In -unixpw mode, if \"-users unixpw=\" is supplied\n"
-"                       then after a user authenticates himself via the\n"
-"                       -unixpw mechanism, x11vnc will try to switch to that\n"
-"                       user as though \"-users +username\" had been supplied.\n"
-"                       If you want to limit which users this will be done for,\n"
-"                       provide them as a comma separated list after \"unixpw=\"\n"
-"                       Groups can also be specified as described above.\n"
-"\n"
-"                       Similarly, in -ssl mode, if \"-users sslpeer=\" is\n"
-"                       supplied then after an SSL client authenticates with his\n"
-"                       cert (the -sslverify option is required for this) x11vnc\n"
-"                       will extract a UNIX username from the \"emailAddress\"\n"
-"                       field (username at hostname.com) of the \"Subject\" of the\n"
-"                       x509 SSL cert and then try to switch to that user as\n"
-"                       though \"-users +username\" had been supplied.  If you\n"
-"                       want to limit which users this will be done for, provide\n"
-"                       them as a comma separated list after \"sslpeer=\".\n"
-"                       Set the env. var X11VNC_SSLPEER_CN to use the Common\n"
-"                       Name (normally a hostname) instead of the Email field.\n"
-"\n"
-"                       NOTE: for sslpeer= mode the x11vnc administrator must\n"
-"                       take care that any client certs he adds to -sslverify\n"
-"                       have the intended UNIX username in the \"emailAddress\"\n"
-"                       field of the cert.  Otherwise a user may be able to\n"
-"                       log in as another.  This command can be of use in\n"
-"                       checking: \"openssl x509 -text -in file.crt\", see the\n"
-"                       \"Subject:\" line.  Also, along with the normal RFB_*\n"
-"                       env. vars. (see -accept) passed to external cmd=\n"
-"                       commands, RFB_SSL_CLIENT_CERT will be set to the\n"
-"                       client's x509 certificate string.\n"
-"\n"
-"                       The sslpeer= mode can aid finding X sessions via the\n"
-"                       FINDDISPLAY and FINDCREATEDISPLAY mechanisms.\n"
-"\n"
-"                       To immediately switch to a user *before* connections\n"
-"                       to the X display are made or any files opened use the\n"
-"                       \"=\" character: \"-users =bob\".  That user needs to\n"
-"                       be able to open the X display and any files of course.\n"
-"\n"
-"                       The special user \"guess=\" means to examine the utmpx\n"
-"                       database (see who(1)) looking for a user attached to\n"
-"                       the display number (from DISPLAY or -display option)\n"
-"                       and try him/her.  To limit the list of guesses, use:\n"
-"                       \"-users guess=bob,betty\".\n"
-"\n"
-"                       Even more sinister is the special user \"lurk=\"\n"
-"                       that means to try to guess the DISPLAY from the utmpx\n"
-"                       login database as well.  So it \"lurks\" waiting for\n"
-"                       anyone to log into an X session and then connects to it.\n"
-"                       Specify a list of users after the = to limit which users\n"
-"                       will be tried.  To enable a different searching mode, if\n"
-"                       the first user in the list is something like \":0\" or\n"
-"                       \":0-2\" that indicates a range of DISPLAY numbers that\n"
-"                       will be tried (regardless of whether they are in the\n"
-"                       utmpx database) for all users that are logged in.  Also\n"
-"                       see the \"-display WAIT:...\" functionality.  Examples:\n"
-"                       \"-users lurk=\" and also \"-users lurk=:0-1,bob,mary\"\n"
-"\n"
-"                       Be especially careful using the \"guess=\" and \"lurk=\"\n"
-"                       modes.  They are not recommended for use on machines\n"
-"                       with untrustworthy local users.\n"
-"\n"
-"-noshm                 Do not use the MIT-SHM extension for the polling.\n"
-"                       Remote displays can be polled this way: be careful this\n"
-"                       can use large amounts of network bandwidth.  This is\n"
-"                       also of use if the local machine has a limited number\n"
-"                       of shm segments and -onetile is not sufficient.\n"
-"-flipbyteorder         Sometimes needed if remotely polled host has different\n"
-"                       endianness.  Ignored unless -noshm is set.\n"
-"-onetile               Do not use the new copy_tiles() framebuffer mechanism,\n"
-"                       just use 1 shm tile for polling.  Limits shm segments\n"
-"                       used to 3.\n"
-"\n"
-"                       To disable any automatic shm reduction set the\n"
-"                       env. var. X11VNC_NO_LIMIT_SHM.\n"
-"\n"
-"-solid [color]         To improve performance, when VNC clients are connected\n"
-"                       try to change the desktop background to a solid color.\n"
-"                       The [color] is optional: the default color is \"cyan4\".\n"
-"                       For a different one specify the X color (rgb.txt name,\n"
-"                       e.g. \"darkblue\" or numerical \"#RRGGBB\").\n"
-"\n"
-"                       Currently this option only works on GNOME, KDE, CDE,\n"
-"                       XFCE, and classic X (i.e. with the background image\n"
-"                       on the root window).  The \"gconftool-2\", \"dcop\"\n"
-"                       and \"xfconf-query\" external commands are run for\n"
-"                       GNOME, KDE, and XFCE respectively.  This also works\n"
-"                       on native MacOSX.  (There is no color selection for\n"
-"                       MacOSX or XFCE.)  Other desktops won't work, (send\n"
-"                       us the corresponding commands if you find them).\n"
-"                       If x11vnc is running as root (inetd(8) or gdm(1)),\n"
-"                       the -users option may be needed for GNOME, KDE, XFCE.\n"
-"                       If x11vnc guesses your desktop incorrectly, you can\n"
-"                       force it by prefixing color with \"gnome:\", \"kde:\",\n"
-"                       \"cde:\", \"xfce:\", or \"root:\".\n"
-"\n"
-"                       Update: -solid no longer works on KDE4.\n"
-"\n"
-"                       This mode works in a limited way on the Mac OS X Console\n"
-"                       with one color ('kelp') using the screensaver writing\n"
-"                       to the background.  Look in \"~/Library/Screen Savers\"\n"
-"                       for VncSolidColor.png to change the color.\n"
-"\n"
-"-blackout string       Black out rectangles on the screen. \"string\" is a\n"
-"                       comma separated list of WxH+X+Y type geometries for\n"
-"                       each rectangle.  If one of the items on the list is the\n"
-"                       string \"noptr\" the mouse pointer will not be allowed\n"
-"                       to go into a blacked out region.\n"
-"-xinerama              If your screen is composed of multiple monitors\n"
-"-noxinerama            glued together via XINERAMA, and that screen is\n"
-"                       not a rectangle this option will try to guess the\n"
-"                       areas to black out (if your system has libXinerama).\n"
-"                       default: %s\n"
-"\n"
-"                       In general, we have noticed on XINERAMA displays you may\n"
-"                       need to use the \"-xwarppointer\" option if the mouse\n"
-"                       pointer misbehaves and it is enabled by default. Use\n"
-"                       \"-noxwarppointer\" if you do not want this.\n"
-"\n"
-"-xtrap                 Use the DEC-XTRAP extension for keystroke and mouse\n"
-"                       input insertion.  For use on legacy systems, e.g. X11R5,\n"
-"                       running an incomplete or missing XTEST extension.\n"
-"                       By default DEC-XTRAP will be used if XTEST server grab\n"
-"                       control is missing, use -xtrap to do the keystroke and\n"
-"                       mouse insertion via DEC-XTRAP as well.\n"
-"\n"
-"-xrandr [mode]         If the display supports the XRANDR (X Resize, Rotate\n"
-"                       and Reflection) extension, and you expect XRANDR events\n"
-"                       to occur to the display while x11vnc is running, this\n"
-"                       options indicates x11vnc should try to respond to\n"
-"                       them (as opposed to simply crashing by assuming the\n"
-"                       old screen size).  See the xrandr(1) manpage and run\n"
-"                       'xrandr -q' for more info.  [mode] is optional and\n"
-"                       described below.\n"
-"\n"
-"                       Since watching for XRANDR events and trapping errors\n"
-"                       increases polling overhead, only use this option if\n"
-"                       XRANDR changes are expected.  For example on a rotatable\n"
-"                       screen PDA or laptop, or using a XRANDR-aware Desktop\n"
-"                       where you resize often.  It is best to be viewing with a\n"
-"                       vncviewer that supports the NewFBSize encoding, since it\n"
-"                       knows how to react to screen size changes.  Otherwise,\n"
-"                       LibVNCServer tries to do so something reasonable for\n"
-"                       viewers that cannot do this (portions of the screen\n"
-"                       may be clipped, unused, etc).\n"
-"\n"
-"                       Note: the default now is to check for XRANDR events, but\n"
-"                       do not trap every X call that may fail due to resize.\n"
-"                       If a resize event is received, the full -xrandr mode\n"
-"                       is enabled.  To disable even checking for events supply:\n"
-"                       -noxrandr.\n"
-"\n"
-"                       \"mode\" defaults to \"resize\", which means create a\n"
-"                       new, resized, framebuffer and hope all viewers can cope\n"
-"                       with the change.  \"newfbsize\" means first disconnect\n"
-"                       all viewers that do not support the NewFBSize VNC\n"
-"                       encoding, and then resize the framebuffer.  \"exit\"\n"
-"                       means disconnect all viewer clients, and then terminate\n"
-"                       x11vnc.\n"
-"\n"
-"-rotate string         Rotate and/or flip the framebuffer view exported by VNC.\n"
-"                       This transformation is independent of XRANDR and is\n"
-"                       done in software in main memory and so may be slower.\n"
-"                       This mode could be useful on a handheld with portrait or\n"
-"                       landscape modes that do not correspond to the scanline\n"
-"                       order of the actual framebuffer.  \"string\" can be:\n"
-"\n"
-"                             x     flip along x-axis\n"
-"                             y     flip along y-axis\n"
-"                            xy     flip along x- and y-axes\n"
-"                           +90     rotate 90 degrees clockwise\n"
-"                           -90     rotate 90 degrees counter-clockwise\n"
-"                          +90x     rotate 90 degrees CW, then flip along x\n"
-"                          +90y     rotate 90 degrees CW, then flip along y\n"
-"\n"
-"                       these give all possible rotations and reflections.\n"
-"\n"
-"                       Aliases: same as xy:  yx, +180, -180, 180\n"
-"                                same as -90: +270, 270\n"
-"                                same as +90: 90, (ditto for 90x, 90y)\n"
-"\n"
-"                       Like -scale, this transformation is applied at the very\n"
-"                       end of any chain of framebuffer transformations and so\n"
-"                       any options with geometries, e.g. -blackout, -clip, etc.\n"
-"                       are relative to the original X (or -rawfb) framebuffer,\n"
-"                       not the final one sent to VNC viewers.\n"
-"\n"
-"                       If you do not want the cursor shape to be rotated\n"
-"                       prefix \"string\" with \"nc:\", e.g. \"nc:+90\",\n"
-"                       \"nc:xy\", etc.\n"
-"\n"
-"-padgeom WxH           Whenever a new vncviewer connects, the framebuffer is\n"
-"                       replaced with a fake, solid black one of geometry WxH.\n"
-"                       Shortly afterwards the framebuffer is replaced with the\n"
-"                       real one.  This is intended for use with vncviewers\n"
-"                       that do not support NewFBSize and one wants to make\n"
-"                       sure the initial viewer geometry will be big enough\n"
-"                       to handle all subsequent resizes (e.g. under -xrandr,\n"
-"                       -remote id:windowid, rescaling, etc.)\n"
-"\n"
-"                       In -unixpw mode this sets the size of the login screen.\n"
-"                       Use \"once:WxH\" it ignore padgeom after the login\n"
-"                       screen is set up.\n"
-"\n"
-"-o logfile             Write stderr messages to file \"logfile\" instead of to\n"
-"                       the terminal.  Same as \"-logfile file\".  To append\n"
-"                       to the file use \"-oa file\" or \"-logappend file\".\n"
-"                       If \"logfile\" contains the string \"%%VNCDISPLAY\"\n"
-"                       it is expanded to the vnc display (the name may need\n"
-"                       to be guessed at.)  \"%%HOME\" works too.\n"
-"\n"
-"-flag file             Write the \"PORT=NNNN\" (e.g. PORT=5900) string to\n"
-"                       \"file\" in addition to stdout.  This option could be\n"
-"                       useful by wrapper script to detect when x11vnc is ready.\n"
-"\n"
-"-rmflag file           Remove \"file\" at exit to signal when x11vnc is done.\n"
-"                       The file is created at startup if it does not already\n"
-"                       exist or if \"file\" is prefixed with \"create:\".\n"
-"                       If the file is created, the x11vnc PID is placed in\n"
-"                       the file.  Otherwise the files contents is not changed.\n"
-"                       Use prefix \"nocreate:\" to prevent creation.\n"
-"\n"
-"-rc filename           Use \"filename\" instead of $HOME/.x11vncrc for rc file.\n"
-"-norc                  Do not process any .x11vncrc file for options.\n"
-"\n"
-"-env VAR=VALUE         Set the environment variable 'VAR' to value 'VALUE'\n"
-"                       at x11vnc startup.  This is a convenience utility to\n"
-"                       avoid shell script wrappers, etc. to set the env. var.\n"
-"                       You may specify as many of these as needed on the\n"
-"                       command line.\n"
-"-prog /path/to/x11vnc  Set the full path to the x11vnc program for cases when\n"
-"                       it cannot be determined from argv[0] (e.g. tcpd/inetd)\n"
-"\n"
-"-h, -help              Print this help text.\n"
-"-?, -opts              Only list the x11vnc options.\n"
-"-V, -version           Print program version and last modification date.\n"
-"-license               Print out license information.  Same as -copying and\n"
-"                       -warranty.\n"
-"\n"
-"-dbg                   Instead of exiting after cleaning up, run a simple\n"
-"                       \"debug crash shell\" when fatal errors are trapped.\n"
-"\n"
-"-q, -quiet             Be quiet by printing less informational output to\n"
-"                       stderr. (use -noquiet to undo an earlier -quiet.)\n"
-"\n"
-"                       The -quiet option does not eliminate all informational\n"
-"                       output, it only reduces it.  It is ignored in most\n"
-"                       auxiliary usage modes, e.g. -storepasswd.  To eliminate\n"
-"                       all output use: 2>/dev/null 1>&2, etc.\n"
-"\n"
-"-v, -verbose           Print out more information to stderr.\n"
-"\n"
-"-bg                    Go into the background after screen setup.  Messages to\n"
-"                       stderr are lost unless -o logfile is used.  Something\n"
-"                       like this could be useful in a script:\n"
-"                        port=`ssh -t $host \"x11vnc -display :0 -bg\" | grep PORT`\n"
-"                        port=`echo \"$port\" | sed -e 's/PORT=//'`\n"
-"                        port=`expr $port - 5900`\n"
-"                        vncviewer $host:$port\n"
-"\n"
-"-modtweak              Option -modtweak automatically tries to adjust the AltGr\n"
-"-nomodtweak            and Shift modifiers for differing language keyboards\n"
-"                       between client and host.  Otherwise, only a single key\n"
-"                       press/release of a Keycode is simulated (i.e. ignoring\n"
-"                       the state of the modifiers: this usually works for\n"
-"                       identical keyboards).  Also useful in resolving cases\n"
-"                       where a Keysym is bound to multiple keys (e.g. \"<\" + \">\"\n"
-"                       and \",\" + \"<\" keys).  Default: %s\n"
-"\n"
-"                       If you are having trouble with with keys and -xkb or\n"
-"                       -noxkb, and similar things don't help, try -nomodtweak.\n"
-"\n"
-"                       On some HP-UX systems it is been noted that they have\n"
-"                       an odd keymapping where a single keycode will have a\n"
-"                       keysym, e.g. \"#\", up to three times.  You can check\n"
-"                       via \"xmodmap -pk\" or the -dk option.  The failure\n"
-"                       is when you try to type \"#\" it yields \"3\".  If you\n"
-"                       see this problem try setting the environment variable\n"
-"                       MODTWEAK_LOWEST=1 to see if it helps.\n"
-"\n"
-"-xkb                   When in modtweak mode, use the XKEYBOARD extension (if\n"
-"-noxkb                 the X display supports it) to do the modifier tweaking.\n"
-"                       This is powerful and should be tried if there are still\n"
-"                       keymapping problems when using -modtweak by itself.\n"
-"                       The default is to check whether some common keysyms,\n"
-"                       e.g. !, @, [, are only accessible via -xkb mode and if\n"
-"                       so then automatically enable the mode.  To disable this\n"
-"                       automatic detection use -noxkb.\n"
-"\n"
-"                       When -xkb mode is active you can set these env. vars.\n"
-"                       They apply only when there is ambiguity as to which\n"
-"                       key to choose (i.e the mapping is not one-to-one).\n"
-"                       NOKEYHINTS=1: for up ascii keystrokes do not use score\n"
-"                       hints saved when the key was pressed down. NOANYDOWN=1:\n"
-"                       for up keystrokes do not resort to searching through\n"
-"                       keys that are currently pressed down.  KEYSDOWN=N:\n"
-"                       remember the last N keys press down for tie-breaking\n"
-"                       when an up keystroke comes in.\n"
-"\n"
-"-capslock              When in -modtweak (the default) or -xkb mode,\n"
-"                       if a keysym in the range A-Z comes in check the X\n"
-"                       server to see if the Caps_Lock is set.  If it is do\n"
-"                       not artificially press Shift to generate the keysym.\n"
-"                       This will enable the CapsLock key to behave correctly\n"
-"                       in some circumstances: namely *both* the VNC viewer\n"
-"                       machine and the x11vnc X server are in the CapsLock\n"
-"                       on state.  If one side has CapsLock on and the other\n"
-"                       off and the keyboard is not behaving as you think it\n"
-"                       should you should correct the CapsLock states (hint:\n"
-"                       pressing CapsLock inside and outside of the viewer can\n"
-"                       help toggle them both to the correct state).  However,\n"
-"                       for best results do not use this option, but rather\n"
-"                       *only* enable CapsLock on the VNC viewer side (i.e. by\n"
-"                       pressing CapsLock outside of the viewer window, also\n"
-"                       -skip_lockkeys below).  Also try -nomodtweak for a\n"
-"                       possible workaround.\n"
-"\n"
-"-skip_lockkeys         Have x11vnc ignore all Caps_Lock, Shift_Lock, Num_Lock,\n"
-"-noskip_lockkeys       Scroll_Lock keysyms received from viewers.  The idea is\n"
-"                       you press Caps_Lock on the VNC Viewer side but that does\n"
-"                       not change the lock state in the x11vnc-side X server.\n"
-"                       Nevertheless your capitalized letters come in over\n"
-"                       the wire and are applied correctly to the x11vnc-side\n"
-"                       X server.  Note this mode probably won't do what you\n"
-"                       want in -nomodtweak mode.  Also, a kludge for KP_n\n"
-"                       digits is always done in this mode: they are mapped to\n"
-"                       regular digit keysyms.  See also -capslock above.\n"
-"                       The default is -noskip_lockkeys.\n"
-"\n"
-"-skip_keycodes string  Ignore the comma separated list of decimal keycodes.\n"
-"                       Perhaps these are keycodes not on your keyboard but\n"
-"                       your X server thinks exist.  Currently only applies\n"
-"                       to -xkb mode.  Use this option to help x11vnc in the\n"
-"                       reverse problem it tries to solve: Keysym -> Keycode(s)\n"
-"                       when ambiguities exist (more than one Keycode per\n"
-"                       Keysym).  Run 'xmodmap -pk' to see your keymapping.\n"
-"                       Example: \"-skip_keycodes 94,114\"\n"
-"-sloppy_keys           Experimental option that tries to correct some\n"
-"                       \"sloppy\" key behavior.  E.g. if at the viewer you\n"
-"                       press Shift+Key but then release the Shift before\n"
-"                       Key that could give rise to extra unwanted characters\n"
-"                       (usually only between keyboards of different languages).\n"
-"                       Only use this option if you observe problems with\n"
-"                       some keystrokes.\n"
-"-skip_dups             Some VNC viewers send impossible repeated key events,\n"
-"-noskip_dups           e.g. key-down, key-down, key-up, key-up all for the same\n"
-"                       key, or 20 downs in a row for the same modifier key!\n"
-"                       Setting -skip_dups means to skip these duplicates and\n"
-"                       just process the first event. Note: some VNC viewers\n"
-"                       assume they can send down's without the corresponding\n"
-"                       up's and so you should not set this option for\n"
-"                       these viewers (symptom: some keys do not autorepeat)\n"
-"                       Default: %s\n"
-"-add_keysyms           If a Keysym is received from a VNC viewer and that\n"
-"-noadd_keysyms         Keysym does not exist in the X server, then add the\n"
-"                       Keysym to the X server's keyboard mapping on an unused\n"
-"                       key.  Added Keysyms will be removed periodically and\n"
-"                       also when x11vnc exits.  Default: %s\n"
-"-clear_mods            At startup and exit clear the modifier keys by sending\n"
-"                       KeyRelease for each one. The Lock modifiers are skipped.\n"
-"                       Used to clear the state if the display was accidentally\n"
-"                       left with any pressed down.\n"
-"-clear_keys            As -clear_mods, except try to release ANY pressed key.\n"
-"                       Note that this option and -clear_mods can interfere\n"
-"                       with a person typing at the physical keyboard.\n"
-"-clear_all             As -clear_keys, except try to release any CapsLock,\n"
-"                       NumLock, etc. locks as well.\n"
-"\n"
-"-remap string          Read Keysym remappings from file named \"string\".\n"
-"                       Format is one pair of Keysyms per line (can be name\n"
-"                       or hex value) separated by a space.  If no file named\n"
-"                       \"string\" exists, it is instead interpreted as this\n"
-"                       form: key1-key2,key3-key4,...  See <X11/keysymdef.h>\n"
-"                       header file for a list of Keysym names, or use xev(1).\n"
-"\n"
-"                       To map a key to a button click, use the fake Keysyms\n"
-"                       \"Button1\", ..., etc. E.g: \"-remap Super_R-Button2\"\n"
-"                       (useful for pasting on a laptop)\n"
-"\n"
-"                       I use these if the machine I am viewing from does not\n"
-"                       have a scrollwheel or I don't like using the one it has:\n"
-"\n"
-"                              -remap Super_R-Button4,Menu-Button5\n"
-"                              -remap KP_Add-Button4,KP_Enter-Button5\n"
-"\n"
-"                       the former would be used on a PC, the latter on a\n"
-"                       MacBook.  This way those little used keys can be used\n"
-"                       to generate bigger hops than the Up and Down arrows\n"
-"                       provide.  One can scroll through text or web pages more\n"
-"                       quickly this way (especially if x11vnc scroll detection\n"
-"                       is active.)\n"
-"\n"
-"                       Use Button44, Button12, etc. for multiple clicks.\n"
-"\n"
-"                       To disable a keysym (i.e. make it so it will not be\n"
-"                       injected), remap it to \"NoSymbol\" or \"None\".\n"
-"\n"
-"                       Dead keys: \"dead\" (or silent, mute) keys are keys that\n"
-"                       do not produce a character but must be followed by a 2nd\n"
-"                       keystroke.  This is often used for accenting characters,\n"
-"                       e.g. to put \"`\" on top of \"a\" by pressing the dead\n"
-"                       key and then \"a\".  Note that this interpretation\n"
-"                       is not part of core X11, it is up to the toolkit or\n"
-"                       application to decide how to react to the sequence.\n"
-"                       The X11 names for these keysyms are \"dead_grave\",\n"
-"                       \"dead_acute\", etc.  However some VNC viewers send the\n"
-"                       keysyms \"grave\", \"acute\" instead thereby disabling\n"
-"                       the accenting.  To work around this -remap can be used.\n"
-"                       For example \"-remap grave-dead_grave,acute-dead_acute\"\n"
-"                       As a convenience, \"-remap DEAD\" applies these remaps:\n"
-"\n"
-"                               g     grave-dead_grave\n"
-"                               a     acute-dead_acute\n"
-"                               c     asciicircum-dead_circumflex\n"
-"                               t     asciitilde-dead_tilde\n"
-"                               m     macron-dead_macron\n"
-"                               b     breve-dead_breve\n"
-"                               D     abovedot-dead_abovedot\n"
-"                               d     diaeresis-dead_diaeresis\n"
-"                               o     degree-dead_abovering\n"
-"                               A     doubleacute-dead_doubleacute\n"
-"                               r     caron-dead_caron\n"
-"                               e     cedilla-dead_cedilla\n"
-"\n"
-"                       If you just want a subset use the first letter\n"
-"                       label, e.g. \"-remap DEAD=ga\" to get the first two.\n"
-"                       Additional remaps may also be supplied via commas,\n"
-"                       e.g.  \"-remap DEAD=ga,Super_R-Button2\".  Finally,\n"
-"                       \"DEAD=missing\" means to apply all of the above as\n"
-"                       long as the left hand member is not already in the\n"
-"                       X11 keymap.\n"
-"\n"
-"-norepeat              Option -norepeat disables X server key auto repeat when\n"
-"-repeat                VNC clients are connected and VNC keyboard input is\n"
-"                       not idle for more than 5 minutes.  This works around a\n"
-"                       repeating keystrokes bug (triggered by long processing\n"
-"                       delays between key down and key up client events:\n"
-"                       either from large screen changes or high latency).\n"
-"                       Default: %s\n"
-"\n"
-"                       You can set the env. var. X11VNC_IDLE_TIMEOUT to the\n"
-"                       number of idle seconds you want (5min = 300secs).\n"
-"\n"
-"                       Note: your VNC viewer side will likely do autorepeating,\n"
-"                       so this is no loss unless someone is simultaneously at\n"
-"                       the real X display.\n"
-"\n"
-"                       Use \"-norepeat N\" to set how many times norepeat will\n"
-"                       be reset if something else (e.g. X session manager)\n"
-"                       undoes it.  The default is 2.  Use a negative value\n"
-"                       for unlimited resets.\n"
-"\n"
-"-nofb                  Ignore video framebuffer: only process keyboard and\n"
-"                       pointer.  Intended for use with Win2VNC and x2vnc\n"
-"                       dual-monitor setups.\n"
-"-nobell                Do not watch for XBell events. (no beeps will be heard)\n"
-"                       Note: XBell monitoring requires the XKEYBOARD extension.\n"
-"-nosel                 Do not manage exchange of X selection/cutbuffer between\n"
-"                       VNC viewers and the X server at all.\n"
-"-noprimary             Do not poll the PRIMARY selection for changes to send\n"
-"                       back to clients.  (PRIMARY is still set on received\n"
-"                       changes, however).\n"
-"-nosetprimary          Do not set the PRIMARY selection for changes received\n"
-"                       from VNC clients.\n"
-"-noclipboard           Do not poll the CLIPBOARD selection for changes to send\n"
-"                       back to clients.  (CLIPBOARD is still set on received\n"
-"                       changes, however).\n"
-"-nosetclipboard        Do not set the CLIPBOARD selection for changes\n"
-"                       received from VNC clients.\n"
-"-seldir string         If direction string is \"send\", only send the selection\n"
-"                       to viewers, and if it is \"recv\" only receive it from\n"
-"                       viewers.  To work around apps setting the selection\n"
-"                       too frequently and messing up the other end.  You can\n"
-"                       actually supply a comma separated list of directions,\n"
-"                       including \"debug\" to turn on debugging output.\n"
-"\n"
-"-cursor [mode]         Sets how the pointer cursor shape (little icon at the\n"
-"-nocursor              mouse pointer) should be handled.  The \"mode\" string\n"
-"                       is optional and is described below.  The default\n"
-"                       is to show some sort of cursor shape(s).  How this\n"
-"                       is done depends on the VNC viewer and the X server.\n"
-"                       Use -nocursor to disable cursor shapes completely.\n"
-"\n"
-"                       Some VNC viewers support the TightVNC CursorPosUpdates\n"
-"                       and CursorShapeUpdates extensions (cuts down on\n"
-"                       network traffic by not having to send the cursor image\n"
-"                       every time the pointer is moved), in which case these\n"
-"                       extensions are used (see -nocursorshape and -nocursorpos\n"
-"                       below to disable).  For other viewers the cursor shape\n"
-"                       is written directly to the framebuffer every time the\n"
-"                       pointer is moved or changed and gets sent along with\n"
-"                       the other framebuffer updates.  In this case, there\n"
-"                       will be some lag between the vnc viewer pointer and\n"
-"                       the remote cursor position.\n"
-"\n"
-"                       If the X display supports retrieving the cursor shape\n"
-"                       information from the X server, then the default is\n"
-"                       to use that mode.  On Solaris this can be done with\n"
-"                       the SUN_OVL extension using -overlay (see also the\n"
-"                       -overlay_nocursor option).  A similar overlay scheme\n"
-"                       is used on IRIX.  Xorg (e.g. Linux) and recent Solaris\n"
-"                       Xsun servers support the XFIXES extension to retrieve\n"
-"                       the exact cursor shape from the X server.  If XFIXES\n"
-"                       is present it is preferred over Overlay and is used by\n"
-"                       default (see -noxfixes below).  This can be disabled\n"
-"                       with -nocursor, and also some values of the \"mode\"\n"
-"                       option below.\n"
-"\n"
-"                       Note that under XFIXES cursors with transparency (alpha\n"
-"                       channel) will usually not be exactly represented and one\n"
-"                       may find Overlay preferable.  See also the -alphacut\n"
-"                       and -alphafrac options below as fudge factors to try\n"
-"                       to improve the situation for cursors with transparency\n"
-"                       for a given theme.\n"
-"\n"
-"                       The \"mode\" string can be used to fine-tune the\n"
-"                       displaying of cursor shapes.  It can be used the\n"
-"                       following ways:\n"
-"\n"
-"                       \"-cursor arrow\" - just show the standard arrow\n"
-"                       nothing more or nothing less.\n"
-"\n"
-"                       \"-cursor none\" - same as \"-nocursor\"\n"
-"\n"
-"                       \"-cursor X\" - when the cursor appears to be on the\n"
-"                       root window, draw the familiar X shape.  Some desktops\n"
-"                       such as GNOME cover up the root window completely,\n"
-"                       and so this will not work, try \"X1\", etc, to try to\n"
-"                       shift the tree depth.  On high latency links or slow\n"
-"                       machines there will be a time lag between expected and\n"
-"                       the actual cursor shape.\n"
-"\n"
-"                       \"-cursor some\" - like \"X\" but use additional\n"
-"                       heuristics to try to guess if the window should have\n"
-"                       a windowmanager-like resizer cursor or a text input\n"
-"                       I-beam cursor.  This is a complete hack, but may be\n"
-"                       useful in some situations because it provides a little\n"
-"                       more feedback about the cursor shape.\n"
-"\n"
-"                       \"-cursor most\" - try to show as many cursors as\n"
-"                       possible.  Often this will only be the same as \"some\"\n"
-"                       unless the display has overlay visuals or XFIXES\n"
-"                       extensions available.  On Solaris and IRIX if XFIXES\n"
-"                       is not available, -overlay mode will be attempted.\n"
-"\n"
-"-cursor_drag           Show cursor shape changes even when the mouse is being\n"
-"                       dragged with a mouse button down.  This is useful if you\n"
-"                       want to be able to see Drag-and-Drop cursor icons, etc.\n"
-"\n"
-"-arrow n               Choose an alternate \"arrow\" cursor from a set of\n"
-"                       some common ones.  n can be 1 to %d.  Default is: %d\n"
-"                       Ignored when in XFIXES cursor-grabbing mode.\n"
-"\n"
-"-noxfixes              Do not use the XFIXES extension to draw the exact cursor\n"
-"                       shape even if it is available.\n"
-"\n"
-"                       Note: To work around a crash in Xorg 1.5 and later\n"
-"                       some people needed to use -noxfixes.  The Xorg crash\n"
-"                       occurred right after a Display Manager (e.g. GDM) login.\n"
-"                       Starting with x11vnc 0.9.9 it tries to automatically\n"
-"                       avoid using XFIXES until it is sure a window manager\n"
-"                       is running.  See the -reopen option for more info and\n"
-"                       how to use X11VNC_AVOID_WINDOWS=never to disable it.\n"
-"\n"
-"-alphacut n            When using the XFIXES extension for the cursor shape,\n"
-"                       cursors with transparency will not usually be displayed\n"
-"                       exactly (but opaque ones will).  This option sets n as\n"
-"                       a cutoff for cursors that have transparency (\"alpha\n"
-"                       channel\" with values ranging from 0 to 255) Any cursor\n"
-"                       pixel with alpha value less than n becomes completely\n"
-"                       transparent.  Otherwise the pixel is completely opaque.\n"
-"                       Default %d\n"
-"\n"
-"-alphafrac fraction    With the threshold in -alphacut some cursors will become\n"
-"                       almost completely transparent because their alpha values\n"
-"                       are not high enough.  For those cursors adjust the\n"
-"                       alpha threshold until fraction of the non-zero alpha\n"
-"                       channel pixels become opaque.  Default %.2f\n"
-"-alpharemove           By default, XFIXES cursors pixels with transparency have\n"
-"                       the alpha factor multiplied into the RGB color values\n"
-"                       (i.e. that corresponding to blending the cursor with a\n"
-"                       black background).  Specify this option to remove the\n"
-"                       alpha factor. (useful for light colored semi-transparent\n"
-"                       cursors).\n"
-"-noalphablend          In XFIXES mode do not send cursor alpha channel data\n"
-"                       to LibVNCServer.  The default is to send it.  The\n"
-"                       alphablend effect will only be visible in -nocursorshape\n"
-"                       mode or for clients with cursorshapeupdates turned\n"
-"                       off. (However there is a hack for 32bpp with depth 24,\n"
-"                       it uses the extra 8 bits to store cursor transparency\n"
-"                       for use with a hacked vncviewer that applies the\n"
-"                       transparency locally.  See the FAQ for more info).\n"
-"\n"
-"-nocursorshape         Do not use the TightVNC CursorShapeUpdates extension\n"
-"                       even if clients support it.  See -cursor above.\n"
-"-cursorpos             Option -cursorpos enables sending the X cursor position\n"
-"-nocursorpos           back to all vnc clients that support the TightVNC\n"
-"                       CursorPosUpdates extension.  Other clients will be able\n"
-"                       to see the pointer motions. Default: %s\n"
-"-xwarppointer          Move the pointer with XWarpPointer(3X) instead of\n"
-"-noxwarppointer        the XTEST extension.  Use this as a workaround\n"
-"                       if the pointer motion behaves incorrectly, e.g.\n"
-"                       on touchscreens or other non-standard setups.\n"
-"\n"
-"                       It is also sometimes needed on XINERAMA displays and is\n"
-"                       enabled by default if XINERAMA is found to be active.\n"
-"                       To prevent this, use -noxwarppointer.\n"
-"\n"
-"-always_inject         Even if there is no displacement (dx = dy = 0) for a\n"
-"                       VNC mouse event force the pointer to the indicated x,y\n"
-"                       position anyway.  Recent (2009) gui toolkits (gnome)\n"
-"                       have problems with x11vnc's original mouse input\n"
-"                       injection method.  So x11vnc's mouse input injection\n"
-"                       method has been modified.  To regain the OLD behavior\n"
-"                       use this option: -always_inject.  Then x11vnc will\n"
-"                       always force positioning the mouse to the x,y position\n"
-"                       even if that position has not changed since the previous\n"
-"                       VNC input event.\n"
-"\n"
-"                       The first place this problem was noticed was in gnome\n"
-"                       terminal: if you pressed and released mouse button 3, a\n"
-"                       menu was posted and then its first element 'New Terminal\n"
-"                       Window' was activated.  This was because x11vnc injected\n"
-"                       the mouse position twice: once on ButtonPress and again\n"
-"                       on ButtonRelease.  The toolkit interpreted the 2nd one\n"
-"                       as mouse motion even though the mouse hadn't moved.\n"
-"                       So now by default x11vnc tries to avoid injecting the\n"
-"                       2nd one.\n"
-"\n"
-"                       Note that with the new default x11vnc will be oblivious\n"
-"                       to applications moving the pointer (warping) or the\n"
-"                       user at the physical display moving it.  So it might,\n"
-"                       e.g., inject ButtonRelease at the wrong position.\n"
-"                       If this (or similar scenarios) causes problems in your\n"
-"                       environment, specify -always_inject for the old method.\n"
-"\n"
-"-buttonmap string      String to remap mouse buttons.  Format: IJK-LMN, this\n"
-"                       maps buttons I -> L, etc., e.g.  -buttonmap 13-31\n"
-"\n"
-"                       Button presses can also be mapped to keystrokes: replace\n"
-"                       a button digit on the right of the dash with :<sym>:\n"
-"                       or :<sym1>+<sym2>: etc. for multiple keys. For example,\n"
-"                       if the viewing machine has a mouse-wheel (buttons 4 5)\n"
-"                       but the x11vnc side does not, these will do scrolls:\n"
-"                              -buttonmap 12345-123:Prior::Next:\n"
-"                              -buttonmap 12345-123:Up+Up+Up::Down+Down+Down:\n"
-"\n"
-"                       See <X11/keysymdef.h> header file for a list of Keysyms,\n"
-"                       or use the xev(1) program.  Note: mapping of button\n"
-"                       clicks to Keysyms may not work if -modtweak or -xkb is\n"
-"                       needed for the Keysym.\n"
-"\n"
-"                       If you include a modifier like \"Shift_L\" the\n"
-"                       modifier's up/down state is toggled, e.g. to send\n"
-"                       \"The\" use :Shift_L+t+Shift_L+h+e: (the 1st one is\n"
-"                       shift down and the 2nd one is shift up). (note: the\n"
-"                       initial state of the modifier is ignored and not reset)\n"
-"                       To include button events use \"Button1\", ... etc.\n"
-"\n"
-"                       -buttonmap currently does not work on MacOSX console\n"
-"                       or in -rawfb mode.\n"
-"\n"
-"                       Workaround: use -buttonmap IJ...-LM...=n to limit the\n"
-"                       number of mouse buttons to n, e.g. 123-123=3.  This will\n"
-"                       prevent x11vnc from crashing if the X server reports\n"
-"                       there are 5 buttons (4/5 scroll wheel), but there are\n"
-"                       only really 3.\n"
-"\n"
-"-nodragging            Do not update the display during mouse dragging events\n"
-"                       (mouse button held down).  Greatly improves response on\n"
-"                       slow setups, but you lose all visual feedback for drags,\n"
-"                       text selection, and some menu traversals.  It overrides\n"
-"                       any -pointer_mode setting.\n"
-"\n"
-#ifndef NO_NCACHE
-"-ncache n              Client-side caching scheme.  Framebuffer memory \"n\"\n"
-"                       (an integer) times that of the full display is allocated\n"
-"                       below the actual framebuffer to cache screen contents\n"
-"                       for rapid retrieval.  So a W x H frambuffer is expanded\n"
-"                       to a W x (n+1)*H one.  Use 0 to disable.\n"
-"\n"
-"                       The \"n\" is actually optional, the default is 10.\n"
-"\n"
-"                       For this and the other -ncache* options below you can\n"
-"                       abbreviate \"-ncache\" with \"-nc\".  Also, \"-nonc\"\n"
-"                       is the same as \"-ncache 0\"\n"
-"\n"
-"                       This is an experimental option, currently implemented in\n"
-"                       an awkward way in that in the VNC Viewer you can see the\n"
-"                       pixel cache contents if you scroll down, etc.  So you\n"
-"                       will have to set things up so you can't see that region.\n"
-"                       If this method is successful, the changes required for\n"
-"                       clients to do this less awkwardly will be investigated.\n"
-"\n"
-"                       The SSVNC viewer does a good job at automatically hiding\n"
-"                       the pixel cache region.  Or use SSVNC's -ycrop option\n"
-"                       to explicitly hide the region.\n"
-"\n"
-"                       Note that this mode consumes a huge amount of memory,\n"
-"                       both on the x11vnc server side and on the VNC Viewer\n"
-"                       side.  If n=2 then the amount of RAM used is roughly\n"
-"                       tripled for both x11vnc and the VNC Viewer.  As a rule\n"
-"                       of thumb, note that 1280x1024 at depth 24 is about 5MB\n"
-"                       of pixel data.\n"
-"\n"
-"                       For reasonable response when cycling through 4 to 6\n"
-"                       large (e.g. web browser) windows a value n of 6 to 12\n"
-"                       is recommended. (that's right: ~10X more memory...)\n"
-"\n"
-"                       Because of the way window backingstore and saveunders\n"
-"                       are implemented, n must be even.  It will be incremented\n"
-"                       by 1 if it is not.\n"
-"\n"
-"                       This mode also works for native MacOS X, but may not\n"
-"                       be as effective as the X version.  This is due to a\n"
-"                       number of things, one is the drop-shadow compositing\n"
-"                       that leaves extra areas that need to be repaired (see\n"
-"                       -ncache_pad).  Another is the window iconification\n"
-"                       animations need to be avoided (see -macicontime).\n"
-"                       It appears the that the 'Scale' animation mode gives\n"
-"                       better results than the 'Genie' one.  Also, window event\n"
-"                       detection not as accurate as the X version.\n"
-"\n"
-"-ncache_cr             In -ncache mode, try to do copyrect opaque window\n"
-"                       moves/drags instead of wireframes (this can induce\n"
-"                       painting errors).  The wireframe will still be used when\n"
-"                       moving a window whose save-unders has not yet been set\n"
-"                       or has been invalidated.\n"
-"\n"
-"                       Some VNC Viewers provide better response than others\n"
-"                       with this option.  On Unix, realvnc viewer gives\n"
-"                       smoother drags than tightvnc viewer.  Response may also\n"
-"                       be choppy if the server side machine is too slow.\n"
-"\n"
-"                       Sometimes on very slow modem connections, this actually\n"
-"                       gives an improvement because no pixel data at all\n"
-"                       (not even the box animation) is sent during the drag.\n"
-"\n"
-"-ncache_no_moveraise   In -ncache mode, do not assume that moving a window\n"
-"                       will cause the window manager to raise it to the top\n"
-"                       of the stack.  The default is to assume it does, and\n"
-"                       so at the beginning of any wireframe, etc, window moves\n"
-"                       the window will be pushed to top in the VNC viewer.\n"
-"\n"
-"-ncache_no_dtchange    In -ncache mode, do not try to guess when the desktop\n"
-"                       (viewport) changes to another one (i.e. another\n"
-"                       workarea).  The default is to try to guess and when\n"
-"                       detected try to make the transistion more smoothly.\n"
-"\n"
-"-ncache_no_rootpixmap  In -ncache mode, do not try to snapshot the desktop\n"
-"                       background to use in guessing or reconstructing window\n"
-"                       save-unders.\n"
-"\n"
-"-ncache_keep_anims     In -ncache mode, do not try to disable window\n"
-"                       manager animations and other effects (that usually\n"
-"                       degrade ncache performance or cause painting errors).\n"
-"                       The default is to try to disable them on KDE (but not\n"
-"                       GNOME) when VNC clients are connected.\n"
-"\n"
-"                       For other window managers or desktops that provide\n"
-"                       animations, effects, compositing, translucency,\n"
-"                       etc. that interfere with the -ncache method you will\n"
-"                       have to disable them manually.\n"
-"\n"
-"-ncache_old_wm         In -ncache mode, enable some heuristics for old style\n"
-"                       window managers such as fvwm and twm.\n"
-"\n"
-"-ncache_pad n          In -ncache mode, pad each window with n pixels for the\n"
-"                       caching rectangles.  This can be used to try to improve\n"
-"                       the situation with dropshadows or other compositing\n"
-"                       (e.g. MacOS X window manager), although it could make\n"
-"                       things worse.  The default is 0 on Unix and 24 on\n"
-"                       MacOS X.\n"
-"-debug_ncache          Turn on debugging and profiling output under -ncache.\n"
-"\n"
-#endif
-"-wireframe [str]       Try to detect window moves or resizes when a mouse\n"
-"-nowireframe           button is held down and show a wireframe instead of\n"
-"                       the full opaque window.  This is based completely on\n"
-"                       heuristics and may not always work: it depends on your\n"
-"                       window manager and even how you move things around.\n"
-"                       See -pointer_mode below for discussion of the \"bogging\n"
-"                       down\" problem this tries to avoid.\n"
-"                       Default: %s\n"
-"\n"
-"                       Shorter aliases:  -wf [str]  and -nowf\n"
-"\n"
-"                       The value \"str\" is optional and, of course, is\n"
-"                       packed with many tunable parameters for this scheme:\n"
-"\n"
-"                       Format: shade,linewidth,percent,T+B+L+R,mod,t1+t2+t3+t4\n"
-"                       Default: %s\n"
-"\n"
-"                       If you leave nothing between commas: \",,\" the default\n"
-"                       value is used.  If you don't specify enough commas,\n"
-"                       the trailing parameters are set to their defaults.\n"
-"\n"
-"                       \"shade\" indicate the \"color\" for the wireframe,\n"
-"                       usually a greyscale: 0-255, however for 16 and 32bpp you\n"
-"                       can specify an rgb.txt X color (e.g. \"dodgerblue\") or\n"
-"                       a value > 255 is treated as RGB (e.g. red is 0xff0000).\n"
-"                       \"linewidth\" sets the width of the wireframe in pixels.\n"
-"                       \"percent\" indicates to not apply the wireframe scheme\n"
-"                       to windows with area less than this percent of the\n"
-"                       full screen.\n"
-"\n"
-"                       \"T+B+L+R\" indicates four integers for how close in\n"
-"                       pixels the pointer has to be from the Top, Bottom, Left,\n"
-"                       or Right edges of the window to consider wireframing.\n"
-"                       This is a speedup to quickly exclude a window from being\n"
-"                       wireframed: set them all to zero to not try the speedup\n"
-"                       (scrolling and selecting text will likely be slower).\n"
-"\n"
-"                       \"mod\" specifies if a button down event in the\n"
-"                       interior of the window with a modifier key (Alt, Shift,\n"
-"                       etc.) down should indicate a wireframe opportunity.\n"
-"                       It can be \"0\" or \"none\" to skip it, \"1\" or \"all\"\n"
-"                       to apply it to any modifier, or \"Shift\", \"Alt\",\n"
-"                       \"Control\", \"Meta\", \"Super\", or \"Hyper\" to only\n"
-"                       apply for that type of modifier key.\n"
-"\n"
-"                       \"t1+t2+t3+t4\" specify four floating point times in\n"
-"                       seconds: t1 is how long to wait for the pointer to move,\n"
-"                       t2 is how long to wait for the window to start moving\n"
-"                       or being resized (for some window managers this can be\n"
-"                       rather long), t3 is how long to keep a wireframe moving\n"
-"                       before repainting the window. t4 is the minimum time\n"
-"                       between sending wireframe \"animations\".  If a slow\n"
-"                       link is detected, these values may be automatically\n"
-"                       changed to something better for a slow link.\n"
-"\n"
-"-nowireframelocal      By default, mouse motion and button presses of a\n"
-"                       user sitting at the LOCAL display are monitored for\n"
-"                       wireframing opportunities (so that the changes will be\n"
-"                       sent efficiently to the VNC clients).  Use this option\n"
-"                       to disable this behavior.\n"
-"\n"
-"-wirecopyrect mode     Since the -wireframe mechanism evidently tracks moving\n"
-"-nowirecopyrect        windows accurately, a speedup can be obtained by\n"
-"                       telling the VNC viewers to locally copy the translated\n"
-"                       window region.  This is the VNC CopyRect encoding:\n"
-"                       the framebuffer update doesn't need to send the actual\n"
-"                       new image data.\n"
-"\n"
-"                       Shorter aliases:  -wcr [mode]  and -nowcr\n"
-"\n"
-"                       \"mode\" can be \"never\" (same as -nowirecopyrect)\n"
-"                       to never try the copyrect, \"top\" means only do it if\n"
-"                       the window was not covered by any other windows, and\n"
-"                       \"always\" means to translate the orginally unobscured\n"
-"                       region (this may look odd as the remaining pieces come\n"
-"                       in, but helps on a slow link).  Default: \"%s\"\n"
-"\n"
-"                       Note: there can be painting errors or slow response\n"
-"                       when using -scale so you may want to disable CopyRect\n"
-"                       in this case \"-wirecopyrect never\" on the command\n"
-"                       line or by remote-control.  Or you can also use the\n"
-"                       \"-scale xxx:nocr\" scale option.\n"
-"\n"
-"-debug_wireframe       Turn on debugging info printout for the wireframe\n"
-"                       heuristics.  \"-dwf\" is an alias.  Specify multiple\n"
-"                       times for more output.\n"
-"\n"
-"-scrollcopyrect mode   Like -wirecopyrect, but use heuristics to try to guess\n"
-"-noscrollcopyrect      if a window has scrolled its contents (either vertically\n"
-"                       or horizontally).  This requires the RECORD X extension\n"
-"                       to \"snoop\" on X applications (currently for certain\n"
-"                       XCopyArea and XConfigureWindow X protocol requests).\n"
-"                       Examples: Hitting <Return> in a terminal window when the\n"
-"                       cursor was at the bottom, the text scrolls up one line.\n"
-"                       Hitting <Down> arrow in a web browser window, the web\n"
-"                       page scrolls up a small amount.  Or scrolling with a\n"
-"                       scrollbar or mouse wheel.\n"
-"\n"
-"                       Shorter aliases:  -scr [mode]  and -noscr\n"
-"\n"
-"                       This scheme will not always detect scrolls, but when\n"
-"                       it does there is a nice speedup from using the VNC\n"
-"                       CopyRect encoding (see -wirecopyrect).  The speedup\n"
-"                       is both in reduced network traffic and reduced X\n"
-"                       framebuffer polling/copying.  On the other hand, it may\n"
-"                       induce undesired transients (e.g. a terminal cursor\n"
-"                       being scrolled up when it should not be) or other\n"
-"                       painting errors (window tearing, bunching-up, etc).\n"
-"                       These are automatically repaired in a short period\n"
-"                       of time.  If this is unacceptable disable the feature\n"
-"                       with -noscrollcopyrect.\n"
-"\n"
-"                       Screen clearing kludges:  for testing at least, there\n"
-"                       are some \"magic key sequences\" (must be done in less\n"
-"                       than 1 second) to aid repairing painting errors that\n"
-"                       may be seen when using this mode:\n"
-"\n"
-"                       3 Alt_L's   in a row: resend whole screen,\n"
-"                       4 Alt_L's   in a row: reread and resend whole screen,\n"
-"                       3 Super_L's in a row: mark whole screen for polling,\n"
-"                       4 Super_L's in a row: reset RECORD context,\n"
-"                       5 Super_L's in a row: try to push a black screen\n"
-"\n"
-"                       note: Alt_L is the Left \"Alt\" key (a single key)\n"
-"                       Super_L is the Left \"Super\" key (Windows flag).\n"
-"                       Both of these are modifier keys, and so should not\n"
-"                       generate characters when pressed by themselves.  Also,\n"
-"                       your VNC viewer may have its own refresh hot-key\n"
-"                       or button.\n"
-"\n"
-"                       \"mode\" can be \"never\" (same as -noscrollcopyrect)\n"
-"                       to never try the copyrect, \"keys\" means to try it\n"
-"                       in response to keystrokes only, \"mouse\" means to\n"
-"                       try it in response to mouse events only, \"always\"\n"
-"                       means to do both. Default: \"%s\"\n"
-"\n"
-"                       Note: there can be painting errors or slow response\n"
-"                       when using -scale so you may want to disable CopyRect\n"
-"                       in this case \"-scrollcopyrect never\" on the command\n"
-"                       line or by remote-control.  Or you can also use the\n"
-"                       \"-scale xxx:nocr\" scale option.\n"
-"\n"
-"-scr_area n            Set the minimum area in pixels for a rectangle\n"
-"                       to be considered for the -scrollcopyrect detection\n"
-"                       scheme.  This is to avoid wasting the effort on small\n"
-"                       rectangles that would be quickly updated the normal way.\n"
-"                       E.g. suppose an app updated the position of its skinny\n"
-"                       scrollbar first and then shifted the large panel\n"
-"                       it controlled.  We want to be sure to skip the small\n"
-"                       scrollbar and get the large panel. Default: %d\n"
-"\n"
-"-scr_skip list         Skip scroll detection for applications matching\n"
-"                       the comma separated list of strings in \"list\".\n"
-"                       Some applications implement their scrolling in\n"
-"                       strange ways where the XCopyArea, etc, also applies\n"
-"                       to invisible portions of the window: if we CopyRect\n"
-"                       those areas it looks awful during the scroll and\n"
-"                       there may be painting errors left after the scroll.\n"
-"                       Soffice.bin is the worst known offender.\n"
-"\n"
-"                       Use \"##\" to denote the start of the application class\n"
-"                       (e.g. \"##XTerm\") and \"++\" to denote the start\n"
-"                       of the application instance name (e.g. \"++xterm\").\n"
-"                       The string your list is matched against is of the form\n"
-"                       \"^^WM_NAME##Class++Instance<same-for-any-subwindows>\"\n"
-"                       The \"xlsclients -la\" command will provide this info.\n"
-"\n"
-"                       If a pattern is prefixed with \"KEY:\" it only applies\n"
-"                       to Keystroke generated scrolls (e.g. Up arrow).  If it\n"
-"                       is prefixed with \"MOUSE:\" it only applies to Mouse\n"
-"                       induced scrolls (e.g. dragging on a scrollbar).\n"
-"                       Default: %s\n"
-"\n"
-"-scr_inc list          Opposite of -scr_skip: this list is consulted first\n"
-"                       and if there is a match the window will be monitored\n"
-"                       via RECORD for scrolls irrespective of -scr_skip.\n"
-"                       Use -scr_skip '*' to skip anything that does not match\n"
-"                       your -scr_inc.  Use -scr_inc '*' to include everything.\n"
-"\n"
-"-scr_keys list         For keystroke scroll detection, only apply the RECORD\n"
-"                       heuristics to the comma separated list of keysyms in\n"
-"                       \"list\".  You may find the RECORD overhead for every\n"
-"                       one of your keystrokes disrupts typing too much, but you\n"
-"                       don't want to turn it off completely with \"-scr mouse\"\n"
-"                       and -scr_parms does not work or is too confusing.\n"
-"\n"
-"                       The listed keysyms can be numeric or the keysym\n"
-"                       names in the <X11/keysymdef.h> header file or from the\n"
-"                       xev(1) program.  Example: \"-scr_keys Up,Down,Return\".\n"
-"                       One probably wants to have application specific lists\n"
-"                       (e.g. for terminals, etc) but that is too icky to think\n"
-"                       about for now...\n"
-"\n"
-"                       If \"list\" begins with the \"-\" character the list\n"
-"                       is taken as an exclude list: all keysyms except those\n"
-"                       list will be considered.  The special string \"builtin\"\n"
-"                       expands to an internal list of keysyms that are likely\n"
-"                       to cause scrolls.  BTW, by default modifier keys,\n"
-"                       Shift_L, Control_R, etc, are skipped since they almost\n"
-"                       never induce scrolling by themselves.\n"
-"\n"
-"-scr_term list         Yet another cosmetic kludge.  Apply shell/terminal\n"
-"                       heuristics to applications matching comma separated\n"
-"                       list (same as for -scr_skip/-scr_inc).  For example an\n"
-"                       annoying transient under scroll detection is if you\n"
-"                       hit Enter in a terminal shell with full text window,\n"
-"                       the solid text cursor block will be scrolled up.\n"
-"                       So for a short time there are two (or more) block\n"
-"                       cursors on the screen.  There are similar scenarios,\n"
-"                       (e.g. an output line is duplicated).\n"
-"\n"
-"                       These transients are induced by the approximation of\n"
-"                       scroll detection (e.g. it detects the scroll, but not\n"
-"                       the fact that the block cursor was cleared just before\n"
-"                       the scroll).  In nearly all cases these transient errors\n"
-"                       are repaired when the true X framebuffer is consulted\n"
-"                       by the normal polling.  But they are distracting, so\n"
-"                       what this option provides is extra \"padding\" near the\n"
-"                       bottom of the terminal window: a few extra lines near\n"
-"                       the bottom will not be scrolled, but rather updated\n"
-"                       from the actual X framebuffer.  This usually reduces\n"
-"                       the annoying artifacts.  Use \"none\" to disable.\n"
-"                       Default: \"%s\"\n"
-"\n"
-"-scr_keyrepeat lo-hi   If a key is held down (or otherwise repeats rapidly) and\n"
-"                       this induces a rapid sequence of scrolls (e.g. holding\n"
-"                       down an Arrow key) the \"scrollcopyrect\" detection\n"
-"                       and overhead may not be able to keep up.  A time per\n"
-"                       single scroll estimate is performed and if that estimate\n"
-"                       predicts a sustainable scrollrate of keys per second\n"
-"                       between \"lo\" and \"hi\" then repeated keys will be\n"
-"                       DISCARDED to maintain the scrollrate. For example your\n"
-"                       key autorepeat may be 25 keys/sec, but for a large\n"
-"                       window or slow link only 8 scrolls per second can be\n"
-"                       sustained, then roughly 2 out of every 3 repeated keys\n"
-"                       will be discarded during this period. Default: \"%s\"\n"
-"\n"
-"-scr_parms string      Set various parameters for the scrollcopyrect mode.\n"
-"                       The format is similar to that for -wireframe and packed\n"
-"                       with lots of parameters:\n"
-"\n"
-"                       Format: T+B+L+R,t1+t2+t3,s1+s2+s3+s4+s5\n"
-"                       Default: %s\n"
-"\n"
-"                       If you leave nothing between commas: \",,\" the default\n"
-"                       value is used.  If you don't specify enough commas,\n"
-"                       the trailing parameters are set to their defaults.\n"
-"\n"
-"                       \"T+B+L+R\" indicates four integers for how close in\n"
-"                       pixels the pointer has to be from the Top, Bottom, Left,\n"
-"                       or Right edges of the window to consider scrollcopyrect.\n"
-"                       If -wireframe overlaps it takes precedence.  This is a\n"
-"                       speedup to quickly exclude a window from being watched\n"
-"                       for scrollcopyrect: set them all to zero to not try\n"
-"                       the speedup (things like selecting text will likely\n"
-"                       be slower).\n"
-"\n"
-"                       \"t1+t2+t3\" specify three floating point times in\n"
-"                       seconds that apply to scrollcopyrect detection with\n"
-"                       *Keystroke* input: t1 is how long to wait after a key\n"
-"                       is pressed for the first scroll, t2 is how long to keep\n"
-"                       looking after a Keystroke scroll for more scrolls.\n"
-"                       t3 is how frequently to try to update surrounding\n"
-"                       scrollbars outside of the scrolling area (0.0 to\n"
-"                       disable)\n"
-"\n"
-"                       \"s1+s2+s3+s4+s5\" specify five floating point times\n"
-"                       in seconds that apply to scrollcopyrect detection with\n"
-"                       *Mouse* input: s1 is how long to wait after a mouse\n"
-"                       button is pressed for the first scroll, s2 is how long\n"
-"                       to keep waiting for additional scrolls after the first\n"
-"                       Mouse scroll was detected.  s3 is how frequently to\n"
-"                       try to update surrounding scrollbars outside of the\n"
-"                       scrolling area (0.0 to disable).  s4 is how long to\n"
-"                       buffer pointer motion (to try to get fewer, bigger\n"
-"                       mouse scrolls). s5 is the maximum time to spend just\n"
-"                       updating the scroll window without updating the rest\n"
-"                       of the screen.\n"
-"\n"
-"-fixscreen string      Periodically \"repair\" the screen based on settings\n"
-"                       in \"string\".  Hopefully you won't need this option,\n"
-"                       it is intended for cases when the -scrollcopyrect or\n"
-"                       -wirecopyrect features leave too many painting errors,\n"
-"                       but it can be used for any scenario.  This option\n"
-"                       periodically performs costly operations and so\n"
-"                       interactive response may be reduced when it is on.\n"
-"                       You can use 3 Alt_L's (the Left \"Alt\" key) taps in\n"
-"                       a row (as described under -scrollcopyrect) instead to\n"
-"                       manually request a screen repaint when it is needed.\n"
-"\n"
-"                       \"string\" is a comma separated list of one or more of\n"
-"                       the following: \"V=t\", \"C=t\", \"X=t\", and \"8=t\".\n"
-"                       In these \"t\" stands for a time in seconds (it is\n"
-"                       a floating point even though one should usually use\n"
-"                       values > 2 to avoid wasting resources).  V sets how\n"
-"                       frequently the entire screen should be sent to viewers\n"
-"                       (it is like the 3 Alt_L's).  C sets how long to wait\n"
-"                       after a CopyRect to repaint the full screen.  X sets\n"
-"                       how frequently to reread the full X11 framebuffer from\n"
-"                       the X server and push it out to connected viewers.\n"
-"                       Use of X should be rare, please report a bug if you\n"
-"                       find you need it. 8= applies only for -8to24 mode: it\n"
-"                       sets how often the non-default visual regions of the\n"
-"                       screen (e.g. 8bpp windows) are refreshed.  Examples:\n"
-"                       -fixscreen V=10 -fixscreen C=10\n"
-"\n"
-"-debug_scroll          Turn on debugging info printout for the scroll\n"
-"                       heuristics.  \"-ds\" is an alias.  Specify it multiple\n"
-"                       times for more output.\n"
-"\n"
-"-noxrecord             Disable any use of the RECORD extension.  This is\n"
-"                       currently used by the -scrollcopyrect scheme and to\n"
-"                       monitor X server grabs.\n"
-"\n"
-"-grab_buster           Some of the use of the RECORD extension can leave a\n"
-"-nograb_buster         tiny window for XGrabServer deadlock.  This is only if\n"
-"                       the whole-server grabbing application expects mouse or\n"
-"                       keyboard input before releasing the grab.  It is usually\n"
-"                       a window manager that does this.  x11vnc takes care to\n"
-"                       avoid the problem, but if caught x11vnc will freeze.\n"
-"                       Without -grab_buster, the only solution is to go the\n"
-"                       physical display and give it some input to satisfy the\n"
-"                       grabbing app.  Or manually kill and restart the window\n"
-"                       manager if that is feasible.  With -grab_buster, x11vnc\n"
-"                       will fork a helper thread and if x11vnc appears to be\n"
-"                       stuck in a grab after a period of time (20-30 sec) then\n"
-"                       it will inject some user input: button clicks, Escape,\n"
-"                       mouse motion, etc to try to break the grab.  If you\n"
-"                       experience a lot of grab deadlock, please report a bug.\n"
-"\n"
-"-debug_grabs           Turn on debugging info printout with respect to\n"
-"                       XGrabServer() deadlock for -scrollcopyrect mode.\n"
-"\n"
-"-debug_sel             Turn on debugging info printout with respect to\n"
-"                       PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.\n"
-"\n"
-"-pointer_mode n        Various pointer motion update schemes. \"-pm\" is\n"
-"                       an alias.  The problem is pointer motion can cause\n"
-"                       rapid changes on the screen: consider the rapid\n"
-"                       changes when you drag a large window around opaquely.\n"
-"                       Neither x11vnc's screen polling and vnc compression\n"
-"                       routines nor the bandwidth to the vncviewers can keep\n"
-"                       up these rapid screen changes: everything will bog down\n"
-"                       when dragging or scrolling.  So a scheme has to be used\n"
-"                       to \"eat\" much of that pointer input before re-polling\n"
-"                       the screen and sending out framebuffer updates. The\n"
-"                       mode number \"n\" can be 0 to %d and selects one of\n"
-"                       the schemes desribed below.\n"
-"\n"
-"                       Note that the -wireframe and -scrollcopyrect modes\n"
-"                       complement -pointer_mode by detecting (and improving)\n"
-"                       certain periods of \"rapid screen change\".\n"
-"\n"
-"                       n=0: does the same as -nodragging. (all screen polling\n"
-"                       is suspended if a mouse button is pressed.)\n"
-"\n"
-"                       n=1: was the original scheme used to about Jan 2004:\n"
-"                       it basically just skips -input_skip keyboard or pointer\n"
-"                       events before repolling the screen.\n"
-"\n"
-"                       n=2 is an improved scheme: by watching the current rate\n"
-"                       of input events it tries to detect if it should try to\n"
-"                       \"eat\" additional pointer events before continuing.\n"
-"\n"
-"                       n=3 is basically a dynamic -nodragging mode: it detects\n"
-"                       when the mouse motion has paused and then refreshes\n"
-"                       the display.\n"
-"\n"
-"                       n=4 attempts to measures network rates and latency,\n"
-"                       the video card read rate, and how many tiles have been\n"
-"                       changed on the screen.  From this, it aggressively tries\n"
-"                       to push screen \"frames\" when it decides it has enough\n"
-"                       resources to do so.  NOT FINISHED.\n"
-"\n"
-"                       The default n is %d. Note that modes 2, 3, 4 will skip\n"
-"                       -input_skip keyboard events (but it will not count\n"
-"                       pointer events).  Also note that these modes are not\n"
-"                       available in -threads mode which has its own pointer\n"
-"                       event handling mechanism.\n"
-"\n"
-"                       To try out the different pointer modes to see which\n"
-"                       one gives the best response for your usage, it is\n"
-"                       convenient to use the remote control function, for\n"
-"                       example \"x11vnc -R pm:4\" or the tcl/tk gui (Tuning ->\n"
-"                       pointer_mode -> n).\n"
-"\n"
-"-input_skip n          For the pointer handling when non-threaded: try to\n"
-"                       read n user input events before scanning display. n < 0\n"
-"                       means to act as though there is always user input.\n"
-"                       Default: %d\n"
-"\n"
-"-allinput              Have x11vnc read and process all available client input\n"
-"                       before proceeding.\n"
-"\n"
-"-input_eagerly         Similar to -allinput but use the handleEventsEagerly\n"
-"                       mechanism built into LibVNCServer.\n"
-"\n"
-"-speeds rd,bw,lat      x11vnc tries to estimate some speed parameters that\n"
-"                       are used to optimize scheduling (e.g. -pointer_mode\n"
-"                       4, -wireframe, -scrollcopyrect) and other things.\n"
-"                       Use the -speeds option to set these manually.\n"
-"                       The triple \"rd,bw,lat\" corresponds to video h/w\n"
-"                       read rate in MB/sec, network bandwidth to clients in\n"
-"                       KB/sec, and network latency to clients in milliseconds,\n"
-"                       respectively.  If a value is left blank, e.g. \"-speeds\n"
-"                       ,100,15\", then the internal scheme is used to estimate\n"
-"                       the empty value(s).\n"
-"\n"
-"                       Typical PC video cards have read rates of 5-10 MB/sec.\n"
-"                       If the framebuffer is in main memory instead of video\n"
-"                       h/w (e.g. SunRay, shadowfb, dummy driver, Xvfb), the\n"
-"                       read rate may be much faster.  \"x11perf -getimage500\"\n"
-"                       can be used to get a lower bound (remember to factor\n"
-"                       in the bytes per pixel).  It is up to you to estimate\n"
-"                       the network bandwith and latency to clients.  For the\n"
-"                       latency the ping(1) command can be used.\n"
-"\n"
-"                       For convenience there are some aliases provided,\n"
-"                       e.g. \"-speeds modem\".  The aliases are: \"modem\" for\n"
-"                       6,4,200; \"dsl\" for 6,100,50; and \"lan\" for 6,5000,1\n"
-"\n"
-"-wmdt string           For some features, e.g. -wireframe and -scrollcopyrect,\n"
-"                       x11vnc has to work around issues for certain window\n"
-"                       managers or desktops (currently kde and xfce).\n"
-"                       By default it tries to guess which one, but it can\n"
-"                       guess incorrectly.  Use this option to indicate which\n"
-"                       wm/dt.  \"string\" can be \"gnome\", \"kde\", \"cde\",\n"
-"                       \"xfce\", or \"root\" (classic X wm).  Anything else\n"
-"                       is interpreted as \"root\".\n"
-"\n"
-"-debug_pointer         Print debugging output for every pointer event.\n"
-"-debug_keyboard        Print debugging output for every keyboard event.\n"
-"                       Same as -dp and -dk, respectively.  Use multiple\n"
-"                       times for more output.\n"
-"\n"
-"-defer time            Time in ms to delay sending updates to connected clients\n"
-"                       (deferUpdateTime)  Default: %d\n"
-"\n"
-"-wait time             Time in ms to pause between screen polls.  Used to cut\n"
-"                       down on load.  Default: %d\n"
-"\n"
-"-extra_fbur n          Perform extra FrameBufferUpdateRequests checks to\n"
-"                       try to be in better sync with the client's requests.\n"
-"                       What this does is perform extra polls of the client\n"
-"                       socket at critical times (before '-defer' and '-wait'\n"
-"                       calls.)  The default is n=1.  Set to a larger number to\n"
-"                       insert more checks or set to n=0 to disable.  A downside\n"
-"                       of these extra calls is that more mouse input may be\n"
-"                       processed than desired.\n"
-"\n"
-"-wait_ui factor        Factor by which to cut the -wait time if there\n"
-"                       has been recent user input (pointer or keyboard).\n"
-"                       Improves response, but increases the load whenever you\n"
-"                       are moving the mouse or typing.  Default: %.2f\n"
-"-setdefer n            When the -wait_ui mechanism cuts down the wait time ms,\n"
-"                       set the defer time to the same ms value. n=1 to enable,\n"
-"                       0 to disable, and -1 to set defer to 0 (no delay).\n"
-"                       Similarly, 2 and -2 indicate 'urgent_update' mode should\n"
-"                       be used to push the updates even sooner.  Default: 1\n"
-"-nowait_bog            Do not detect if the screen polling is \"bogging down\"\n"
-"                       and sleep more.  Some activities with no user input can\n"
-"                       slow things down a lot: consider a large terminal window\n"
-"                       with a long build running in it continuously streaming\n"
-"                       text output.  By default x11vnc will try to detect this\n"
-"                       (3 screen polls in a row each longer than 0.25 sec with\n"
-"                       no user input), and sleep up to 1.5 secs to let things\n"
-"                       \"catch up\".  Use this option to disable that detection.\n"
-"-slow_fb time          Floating point time in seconds to delay all screen\n"
-"                       polling.  For special purpose usage where a low frame\n"
-"                       rate is acceptable and desirable, but you want the\n"
-"                       user input processed at the normal rate so you cannot\n"
-"                       use -wait.\n"
-"-xrefresh time         Floating point time in seconds to indicate how often to\n"
-"                       do the equivalent of xrefresh(1) to force all windows\n"
-"                       (in the viewable area if -id, -sid, or -clip is used)\n"
-"                       to repaint themselves.  Use this only if applications\n"
-"                       misbehave by not repainting themselves properly.\n"
-"                       See also -noxdamage.\n"
-"-nap                   Monitor activity and if it is low take longer naps\n"
-"-nonap                 between screen polls to really cut down load when idle.\n"
-"                       Default: %s\n"
-"-sb time               Time in seconds after NO activity (e.g. screen blank)\n"
-"                       to really throttle down the screen polls (i.e. sleep\n"
-"                       for about 1.5 secs). Use 0 to disable.  Default: %d\n"
-"                       Set the env. var. X11VNC_SB_FACTOR to scale it.\n"
-"\n"
-"-readtimeout n         Set LibVNCServer rfbMaxClientWait to n seconds. On\n"
-"                       slow links that take a long time to paint the first\n"
-"                       screen LibVNCServer may hit the timeout and drop the\n"
-"                       connection.  Default: %d seconds.\n"
-"-ping n                Send a 1x1 framebuffer update to all clients every n\n"
-"                       seconds (e.g. to try to keep a network connection alive)\n"
-"\n"
-"-nofbpm                If the system supports the FBPM (Frame Buffer Power\n"
-"-fbpm                  Management) extension (i.e. some Sun systems), then\n"
-"                       prevent the video h/w from going into a reduced power\n"
-"                       state when VNC clients are connected.\n"
-"\n"
-"                       FBPM capable video h/w save energy when the workstation\n"
-"                       is idle by going into low power states (similar to DPMS\n"
-"                       for monitors).  This interferes with x11vnc's polling\n"
-"                       of the framebuffer data.\n"
-"\n"
-"                       \"-nofbpm\" means prevent FBPM low power states whenever\n"
-"                       VNC clients are connected, while \"-fbpm\" means to not\n"
-"                       monitor the FBPM state at all.  See the xset(1) manpage\n"
-"                       for details.  -nofbpm is basically the same as running\n"
-"                       \"xset fbpm force on\" periodically.  Default: %s\n"
-"\n"
-"-nodpms                If the system supports the DPMS (Display Power Management\n"
-"-dpms                  Signaling) extension, then prevent the monitor from\n"
-"                       going into a reduced power state when VNC clients\n"
-"                       are connected.\n"
-"\n"
-"                       DPMS reduced power monitor states are a good thing\n"
-"                       and you normally want the power down to take place\n"
-"                       (usually x11vnc has no problem exporting the display in\n"
-"                       this state).  You probably only want to use \"-nodpms\"\n"
-"                       to work around problems with Screen Savers kicking\n"
-"                       on in DPMS low power states.  There is known problem\n"
-"                       with kdesktop_lock on KDE where the screen saver keeps\n"
-"                       kicking in every time user input stops for a second\n"
-"                       or two.  Specifying \"-nodpms\" works around it.\n"
-"\n"
-"                       \"-nodpms\" means prevent DPMS low power states whenever\n"
-"                       VNC clients are connected, while \"-dpms\" means to not\n"
-"                       monitor the DPMS state at all.  See the xset(1) manpage\n"
-"                       for details.  -nodpms is basically the same as running\n"
-"                       \"xset dpms force on\" periodically.  Default: %s\n"
-"\n"
-"-forcedpms             If the system supports the DPMS (Display Power\n"
-"                       Management Signaling) extension, then try to keep the\n"
-"                       monitor in a powered off state.  This is to prevent\n"
-"                       nosey people at the physical display from viewing what\n"
-"                       is on the screen.  Be sure to lock the screen before\n"
-"                       disconnecting.\n"
-"\n"
-"                       This method is far from bullet proof, e.g. suppose\n"
-"                       someone attaches a non-DPMS monitor, or loads the\n"
-"                       machine so that there is a gap of time before x11vnc\n"
-"                       restores the powered off state?  On many machines if\n"
-"                       he floods it with keyboard and mouse input he can see\n"
-"                       flashes of what is on the screen before the DPMS off\n"
-"                       state is reestablished.  For this to work securely\n"
-"                       there would need to be support in the X server to do\n"
-"                       this exactly rather than approximately with DPMS.\n"
-"\n"
-"-clientdpms            As -forcedpms but only when VNC clients are connected.\n"
-"\n"
-"-noserverdpms          The UltraVNC ServerInput extension is supported.\n"
-"                       This allows the VNC viewer to click a button that will\n"
-"                       cause the server (x11vnc) to try to disable keyboard\n"
-"                       and mouse input at the physical display and put the\n"
-"                       monitor in dpms powered off state.  Use this option to\n"
-"                       skip powering off the monitor.\n"
-"\n"
-"-noultraext            Disable the following UltraVNC extensions: SingleWindow\n"
-"                       and ServerInput.  The others managed by LibVNCServer\n"
-"                       (textchat, 1/n scaling, rfbEncodingUltra) are not.\n"
-"\n"
-"-chatwindow            Place a local UltraVNC chat window on the X11 display\n"
-"                       that x11vnc is polling.  That way the person on the VNC\n"
-"                       viewer-side can chat with the person at the physical\n"
-"                       X11 console. (e.g. helpdesk w/o telephone)\n"
-"\n"
-"                       For this to work the SSVNC package (version 1.0.21 or\n"
-"                       later) MUST BE installed on the system where x11vnc runs\n"
-"                       and the 'ssvnc' command must be available in $PATH.\n"
-"                       The ssvncviewer is used as a chat window helper.\n"
-"                       See http://www.karlrunge.com/x11vnc/ssvnc.html\n"
-"\n"
-"                       This option implies '-rfbversion 3.6' so as to trick\n"
-"                       UltraVNC viewers, otherwise they assume chat is not\n"
-"                       available.  To specify a different rfbversion, place\n"
-"                       it after the -chatwindow option on the cmdline.\n"
-"\n"
-"                       See also the remote control 'chaton' and 'chatoff'\n"
-"                       actions.  These can also be set from the tkx11vnc GUI.\n"
-"\n"
-"-noxdamage             Do not use the X DAMAGE extension to detect framebuffer\n"
-"                       changes even if it is available.  Use -xdamage if your\n"
-"                       default is to have it off.\n"
-"\n"
-"                       x11vnc's use of the DAMAGE extension: 1) significantly\n"
-"                       reduces the load when the screen is not changing much,\n"
-"                       and 2) detects changed areas (small ones by default)\n"
-"                       more quickly.\n"
-"\n"
-"                       Currently the DAMAGE extension is overly conservative\n"
-"                       and often reports large areas (e.g. a whole terminal\n"
-"                       or browser window) as damaged even though the actual\n"
-"                       changed region is much smaller (sometimes just a few\n"
-"                       pixels).  So heuristics were introduced to skip large\n"
-"                       areas and use the damage rectangles only as \"hints\"\n"
-"                       for the traditional scanline polling.  The following\n"
-"                       tuning parameters are introduced to adjust this\n"
-"                       behavior:\n"
-"\n"
-"-xd_area A             Set the largest DAMAGE rectangle area \"A\" (in\n"
-"                       pixels: width * height) to trust as truly damaged:\n"
-"                       the rectangle will be copied from the framebuffer\n"
-"                       (slow) no matter what.  Set to zero to trust *all*\n"
-"                       rectangles. Default: %d\n"
-"-xd_mem f              Set how long DAMAGE rectangles should be \"remembered\",\n"
-"                       \"f\" is a floating point number and is in units of the\n"
-"                       scanline repeat cycle time (%d iterations).  The default\n"
-"                       (%.1f) should give no painting problems. Increase it if\n"
-"                       there are problems or decrease it to live on the edge\n"
-"                       (perhaps useful on a slow machine).\n"
-"\n"
-"-sigpipe string        Broken pipe (SIGPIPE) handling.  \"string\" can be\n"
-"                       \"ignore\" or \"exit\".  For \"ignore\" LibVNCServer\n"
-"                       will handle the abrupt loss of a client and continue,\n"
-"                       for \"exit\" x11vnc will cleanup and exit at the 1st\n"
-"                       broken connection.\n"
-"\n"
-"                       This option is not really needed since LibVNCServer\n"
-"                       is doing the correct thing now for quite some time.\n"
-"                       However, for convenience you can use it to ignore other\n"
-"                       signals, e.g. \"-sigpipe ignore:HUP,INT,TERM\" in case\n"
-"                       that would be useful for some sort of application.\n"
-"                       You can also put \"exit:..\" in the list to have x11vnc\n"
-"                       cleanup on the listed signals. \"-sig\" is an alias\n"
-"                       for this option if you don't like the 'pipe'. Example:\n"
-"                       -sig ignore:INT,TERM,exit:USR1\n"
-"\n"
-"-threads               Whether or not to use the threaded LibVNCServer\n"
-"-nothreads             algorithm [rfbRunEventLoop] if libpthread is available.\n"
-"                       In this mode new threads (one for input and one\n"
-"                       for output) are created to handle each new client.\n"
-"                       Default: %s.\n"
-"\n"
-"                       Thread stability is much improved in version 0.9.8.\n"
-"\n"
-"                       Multiple clients in threaded mode should be stable\n"
-"                       for the ZRLE encoding on all platforms.  The Tight and\n"
-"                       Zlib encodings are currently only stable on Linux for\n"
-"                       multiple clients.  Compile with -DTLS=__thread if your\n"
-"                       OS and compiler and linker support it.\n"
-"\n"
-"                       For resizes (randr, etc.) set this env. var. to the number\n"
-"                       of milliseconds to sleep: X11VNC_THREADS_NEW_FB_SLEEP\n"
-"                       at various places in the do_new_fb() action.  This is to\n"
-"                       let various activities settle.  Default is about 500ms.\n"
-"\n"
-"                       Multiple clients in threaded mode could yield better\n"
-"                       performance for 'class-room' broadcasting usage; also in\n"
-"                       -appshare broadcast mode.  See also the -reflect option.\n"
-"\n"
-"-fs f                  If the fraction of changed tiles in a poll is greater\n"
-"                       than f, the whole screen is updated.  Default: %.2f\n"
-"-gaps n                Heuristic to fill in gaps in rows or cols of n or\n"
-"                       less tiles.  Used to improve text paging.  Default: %d\n"
-"-grow n                Heuristic to grow islands of changed tiles n or wider\n"
-"                       by checking the tile near the boundary.  Default: %d\n"
-"-fuzz n                Tolerance in pixels to mark a tiles edges as changed.\n"
-"                       Default: %d\n"
-"-debug_tiles           Print debugging output for tiles, fb updates, etc.\n"
-"\n"
-"-snapfb                Instead of polling the X display framebuffer (fb)\n"
-"                       for changes, periodically copy all of X display fb\n"
-"                       into main memory and examine that copy for changes.\n"
-"                       (This setting also applies for non-X -rawfb modes).\n"
-"                       Under some circumstances this will improve interactive\n"
-"                       response, or at least make things look smoother, but in\n"
-"                       others (most!) it will make the response worse.  If the\n"
-"                       video h/w fb is such that reading small tiles is very\n"
-"                       slow this mode could help.  To keep the \"framerate\"\n"
-"                       up the screen size x bpp cannot be too large.  Note that\n"
-"                       this mode is very wasteful of memory I/O resources\n"
-"                       (it makes full screen copies even if nothing changes).\n"
-"                       It may be of use in video capture-like applications,\n"
-"                       webcams, or where window tearing is a problem.\n"
-"\n"
-"-rawfb string          Instead of polling X, poll the memory object specified\n"
-"                       in \"string\".\n"
-"\n"
-"                       For file polling, to memory map mmap(2) a file use:\n"
-"                       \"map:/path/to/a/file at WxHxB\", with framebuffer Width,\n"
-"                       Height, and Bits per pixel.  \"mmap:...\" is the\n"
-"                       same.\n"
-"\n"
-"                       If there is trouble with mmap, use \"file:/...\"\n"
-"                       for slower lseek(2) based reading.\n"
-"\n"
-"                       Use \"snap:...\" to imply -snapfb mode and the \"file:\"\n"
-"                       access (this is for unseekable devices that only provide\n"
-"                       the fb all at once, e.g. a video camera provides the\n"
-"                       whole frame).\n"
-"\n"
-"                       For shared memory segments string is of the form:\n"
-"                       \"shm:N at WxHxB\" which specifies a shmid N and with\n"
-"                       WxHxB as above.  See shmat(1) and ipcs(1)\n"
-"\n"
-"                       If you do not supply a type \"map\" is assumed if\n"
-"                       the file exists (see the next paragraphs for some\n"
-"                       exceptions to this.)\n"
-"\n"
-"                       If string is \"setup:cmd\", then the command \"cmd\"\n"
-"                       is run and the first line from it is read and used\n"
-"                       as \"string\".  This allows initializing the device,\n"
-"                       determining WxHxB, etc. These are often done as root\n"
-"                       so take care.\n"
-"\n"
-"                       If the string begins with \"video\", see the VIDEO4LINUX\n"
-"                       discussion below where the device may be queried for\n"
-"                       (and possibly set) the framebuffer parameters.\n"
-"\n"
-"                       If the string begins with \"console\", \"/dev/fb\",\n"
-"                       \"fb\", or \"vt\", see the LINUX CONSOLE discussion\n"
-"                       below where the framebuffer device is opened and\n"
-"                       keystrokes (and possibly mouse events) are inserted\n"
-"                       into the console.\n"
-"\n"
-"                       If the string begins with \"vnc\", see the VNC HOST\n"
-"                       discussion below where the framebuffer is taken as that\n"
-"                       of another remote VNC server.\n"
-"\n"
-"                       Optional suffixes are \":R/G/B\" and \"+O\" to specify\n"
-"                       red, green, and blue masks (in hex) and an offset into\n"
-"                       the memory object.  If the masks are not provided x11vnc\n"
-"                       guesses them based on the bpp (if the colors look wrong,\n"
-"                       you need to provide the masks.)\n"
-"\n"
-"                       Another optional suffix is the Bytes Per Line which in\n"
-"                       some cases is not WxB/8.  Specify it as WxHxB-BPL\n"
-"                       e.g. 800x600x16-2048.  This could be a normal width\n"
-"                       1024 at 16bpp fb, but only width 800 shows up.\n"
-"\n"
-"                       So the full format is: mode:file at WxHxB:R/G/B+O-BPL\n"
-"\n"
-"                       Examples:\n"
-"                           -rawfb shm:210337933 at 800x600x32:ff/ff00/ff0000\n"
-"                           -rawfb map:/dev/fb0 at 1024x768x32\n"
-"                           -rawfb map:/tmp/Xvfb_screen0 at 640x480x8+3232\n"
-"                           -rawfb file:/tmp/my.pnm at 250x200x24+37\n"
-"                           -rawfb file:/dev/urandom at 128x128x8\n"
-"                           -rawfb snap:/dev/video0 at 320x240x24 -24to32\n"
-"                           -rawfb video0\n"
-"                           -rawfb video -pipeinput VID\n"
-"                           -rawfb console\n"
-"                           -rawfb vt2\n"
-"                           -rawfb vnc:somehost:0\n"
-"\n"
-"                       (see ipcs(1) and fbset(1) for the first two examples)\n"
-"\n"
-"                       In general all user input is discarded by default (see\n"
-"                       the -pipeinput option for how to use a helper program\n"
-"                       to insert).  Most of the X11 (screen, keyboard, mouse)\n"
-"                       options do not make sense and many will cause this\n"
-"                       mode to crash, so please think twice before setting or\n"
-"                       changing them in a running x11vnc.\n"
-"\n"
-"                       If you DO NOT want x11vnc to close the X DISPLAY in\n"
-"                       rawfb mode, prepend a \"+\" e.g. +file:/dev/fb0...\n"
-"                       Keeping the display open enables the default\n"
-"                       remote-control channel, which could be useful.\n"
-"                       Alternatively, if you specify -noviewonly, then the\n"
-"                       mouse and keyboard input are STILL sent to the X\n"
-"                       display, this usage should be very rare, i.e. doing\n"
-"                       something strange with /dev/fb0.\n"
-"\n"
-"                       If the device is not \"seekable\" (e.g. webcam) try\n"
-"                       reading it all at once in full snaps via the \"snap:\"\n"
-"                       mode (note: this is a resource hog).  If you are using\n"
-"                       file: or map: AND the device needs to be reopened for\n"
-"                       *every* snapfb snapshot, set the environment variable:\n"
-"                       SNAPFB_RAWFB_RESET=1 as well.\n"
-"\n"
-"                       If you want x11vnc to dynamically transform a 24bpp\n"
-"                       rawfb to 32bpp (note that this will be slower) also\n"
-"                       supply the -24to32 option.  This would be useful for,\n"
-"                       say, a video camera that delivers the pixel data as\n"
-"                       24bpp packed RGB.  This is the default under \"video\"\n"
-"                       mode if the bpp is 24.\n"
-"\n"
-"                       Normally the bits per pixel, B, is 8, 16, or 32 (or\n"
-"                       rarely 24), however there is also some support for\n"
-"                       B < 8 (e.g. old graphics displays 4 bpp or 1 bpp).\n"
-"                       In this case you certainly must supply the masks as\n"
-"                       well: WxHxB:R/G/B.  The pixels will be padded out to\n"
-"                       8 bpp using depth 8 truecolor.  The scheme currently\n"
-"                       does not work with snap fb (ask if interested.) B=1\n"
-"                       monochrome example: file:/dev/urandom at 128x128x1:1/1/1\n"
-"                       Some other like this are 128x128x2:3/3/3 128x128x4:7/7/7\n"
-"\n"
-"                       For B < 8 framebuffers you can also set the env. var\n"
-"                       RAWFB_CGA=1 to try a CGA mapping for B=4 (e.g. linux\n"
-"                       vga16fb driver.)  Note with low bpp and/or resolution\n"
-"                       VGA and VGA16 modes on the Linux console one's attempt\n"
-"                       to export them via x11vnc can often be thwarted due to\n"
-"                       special color palettes, pixel packings, and even video\n"
-"                       painting buffering.  OTOH, often experimenting with the\n"
-"                       RGB masks can yield something recognizable.\n"
-"\n"
-"                       VIDEO4LINUX: on Linux some attempt is made to handle\n"
-"                       video devices (webcams or TV tuners) automatically.\n"
-"                       The idea is the WxHxB will be extracted from the\n"
-"                       device itself.  So if you do not supply \"@WxHxB...\n"
-"                       parameters x11vnc will try to determine them.  It first\n"
-"                       tries the v4l API if that support has been compiled in.\n"
-"                       Otherwise it will run the v4l-info(1) external program\n"
-"                       if it is available.\n"
-"\n"
-"                       The simplest examples are \"-rawfb video\" and \"-rawfb\n"
-"                       video1\" which imply the device file /dev/video and\n"
-"                       /dev/video1, respectively.  You can also supply the\n"
-"                       /dev if you like, e.g. \"-rawfb /dev/video0\"\n"
-"\n"
-"                       Since the video capture device framebuffer usually\n"
-"                       changes continuously (e.g. brightness fluctuations),\n"
-"                       you may want to use the -wait, -slow_fb, or -defer\n"
-"                       options to lower the \"framerate\" to cut down on\n"
-"                       network VNC traffic.\n"
-"\n"
-"                       A more sophisticated video device scheme allows\n"
-"                       initializing the device's settings using:\n"
-"\n"
-"                           -rawfb video:<settings>\n"
-"\n"
-"                       The prefix could also be, as above, e.g. \"video1:\" to\n"
-"                       specify the device file.  The v4l API must be available\n"
-"                       for this to work.  Otherwise, you will need to try\n"
-"                       to initialize the device with an external program,\n"
-"                       e.g. xawtv, spcaview, and hope they persist when x11vnc\n"
-"                       re-opens the device.\n"
-"\n"
-"                       <settings> is a comma separated list of key=value pairs.\n"
-"                       The device's brightness, color, contrast, and hue can\n"
-"                       be set to percentages, e.g. br=80,co=50,cn=44,hu=60.\n"
-"\n"
-"                       The device filename can be set too if needed (if it\n"
-"                       does not start with \"video\"), e.g. fn=/dev/qcam.\n"
-"\n"
-"                       The width, height and bpp of the framebuffer can be\n"
-"                       set via, e.g., w=160,h=120,bpp=16.\n"
-"\n"
-"                       Related to the bpp above, the pixel format can be set\n"
-"                       via the fmt=XXX, where XXX can be one of: GREY, HI240,\n"
-"                       RGB555, RGB565, RGB24, and RGB32 (with bpp 8, 8, 16, 16,\n"
-"                       24, and 32 respectively).  See http://www.linuxtv.org\n"
-"                       for more info (V4L api).\n"
-"\n"
-"                       For TV/rf tuner cards one can set the tuning mode\n"
-"                       via tun=XXX where XXX can be one of PAL, NTSC, SECAM,\n"
-"                       or AUTO.\n"
-"\n"
-"                       One can switch the input channel by the inp=XXX setting,\n"
-"                       where XXX is the name of the input channel (Television,\n"
-"                       Composite1, S-Video, etc).  Use the name that is in the\n"
-"                       information about the device that is printed at startup.\n"
-"\n"
-"                       For input channels with tuners (e.g. Television) one\n"
-"                       can change which station is selected by the sta=XXX\n"
-"                       setting.  XXX is the station number.  Currently only\n"
-"                       the ntsc-cable-us (US cable) channels are built into\n"
-"                       x11vnc.  See the -freqtab option below to supply one\n"
-"                       from xawtv. If XXX is greater than 500, then it is\n"
-"                       interpreted as a raw frequency in KHz.\n"
-"\n"
-"                       Example:\n"
-"\n"
-"                       -rawfb video:br=80,w=320,h=240,fmt=RGB32,tun=NTSC,sta=47\n"
-"\n"
-"                       one might need to add inp=Television too for the input\n"
-"                       channel to be TV if the card doesn't come up by default\n"
-"                       in that one.\n"
-"\n"
-"                       Note that not all video capture devices will support\n"
-"                       all of the above settings.\n"
-"\n"
-"                       See the -pipeinput VID option below for a way to control\n"
-"                       the settings through the VNC Viewer via keystrokes.\n"
-"                       As a shortcut, if the string begins \"Video..\" instead\n"
-"                       of \"video..\" then -pipeinput VID is implied.\n"
-"\n"
-"                       As above, if you specify a \"@WxHxB...\" after the\n"
-"                       <settings> string they are used verbatim: the device\n"
-"                       is not queried for the current values.  Otherwise the\n"
-"                       device will be queried.\n"
-"\n"
-"                       LINUX CONSOLE:  The following describes some ways to\n"
-"                       view and possibly interact with the Linux text/graphics\n"
-"                       console (i.e. not X11 XFree86/Xorg)\n"
-"\n"
-"                       Note: If the LibVNCServer LinuxVNC program is on your\n"
-"                       system you may want to use that instead of the following\n"
-"                       method because it will be faster and more accurate\n"
-"                       for the Linux text console and includes mouse support.\n"
-"                       There is, however, the basic LinuxVNC functionality in\n"
-"                       x11vnc if you replace \"console\" with \"vt\" in the\n"
-"                       examples below.\n"
-"\n"
-"                       If the rawfb string begins with \"console\" the\n"
-"                       framebuffer device /dev/fb0 is opened and /dev/tty0 is\n"
-"                       opened too.  The latter is used to inject keystrokes\n"
-"                       (not all are supported, but the basic ones are).\n"
-"                       You will need to be root to inject keystrokes, but\n"
-"                       not necessarily to open /dev/fb0.  /dev/tty0 refers to\n"
-"                       the active VT, to indicate one explicitly, use, e.g.,\n"
-"                       \"console2\" for /dev/tty2, etc. by indicating the\n"
-"                       specific VT number.\n"
-"\n"
-"                       For the Linux framebuffer device, /dev/fb0, (fb1,\n"
-"                       etc) to be enabled the appropriate kernel drivers must\n"
-"                       be loaded.  E.g. vesafb or vga16fb and also by setting\n"
-"                       the boot parameter vga=0x301 (or 0x314, 0x317, etc.)\n"
-"                       (The vga=... method is the preferred way; set your\n"
-"                       machines up that way.)  Otherwise there will be a\n"
-"                       'No such device' error.  You can also load a Linux\n"
-"                       framebuffer driver specific to your make of video card\n"
-"                       for more functionality.  Once the machine is booted one\n"
-"                       can often 'modprobe' the fb driver as root to obtain\n"
-"                       a framebuffer device.\n"
-"\n"
-"                       If you cannot get /dev/fb0 working on Linux, try\n"
-"                       using the LinuxVNC emulation mode by \"-rawfb vtN\"\n"
-"                       where N = 1, ... 6 is the Linux Virtual Terminal (aka\n"
-"                       virtual console) you wish to view, e.g. \"-rawfb vt2\".\n"
-"                       Unlike /dev/fb mode, it need not be the active Virtual\n"
-"                       Terminal.  Note that this mode can only show text and\n"
-"                       not graphics.  x11vnc polls the text in /dev/vcsaN\n"
-"\n"
-"                       Set the env. var. RAWFB_VCSA_BW=1 to disable colors in\n"
-"                       the \"vtN\" mode (i.e. black and white only.)  If you\n"
-"                       do not prefer the default 16bpp set RAWFB_VCSA_BPP to\n"
-"                       8 or 32.  If you need to tweak the rawfb parameters by\n"
-"                       using the 'console_guess' string printed at startup,\n"
-"                       be sure to indicate the snap: method.\n"
-"\n"
-"                       uinput: If the Linux version appears to be 2.6\n"
-"                       or later and the \"uinput\" module appears to be\n"
-"                       present (modprobe uinput), then the uinput method\n"
-"                       will be used instead of /dev/ttyN.  uinput allows\n"
-"                       insertion of BOTH keystrokes and mouse input and so it\n"
-"                       preferred when accessing graphical (e.g. QT-embedded)\n"
-"                       linux console apps.  It also provides more accurate\n"
-"                       keystroke insertion.  See -pipeinput UINPUT below for\n"
-"                       more information on this mode; you will have to use\n"
-"                       -pipeinput if you want to tweak any UINPUT parameters.\n"
-"                       You may also want to also use the -nodragging and\n"
-"                       -cursor none options.  Use \"console0\", etc  or\n"
-"                       -pipeinput CONSOLE to force the /dev/ttyN method.\n"
-"\n"
-"                       Note you can change the Linux VT remotely using the\n"
-"                       chvt(1) command to make the one you want be the active\n"
-"                       one (e.g. 'chvt 3').  Sometimes switching out and back\n"
-"                       corrects the framebuffer's graphics state.  For the\n"
-"                       \"-rawfb vtN\" mode there is no need to switch the VT's.\n"
-"\n"
-"                       To skip input injecting entirely use \"consolex\"\n"
-"                       or \"vtx\".\n"
-"\n"
-"                       The string \"/dev/fb0\" (1, etc.) can be used instead\n"
-"                       of \"console\".  This can be used to specify a different\n"
-"                       framebuffer device, e.g. /dev/fb1.  As a shortcut the\n"
-"                       \"/dev/\" can be dropped.  If the name is something\n"
-"                       nonstandard, use \"console:/dev/foofb\"\n"
-"\n"
-"                       If you do not want x11vnc to guess the framebuffer's\n"
-"                       WxHxB and masks automatically (sometimes the kernel\n"
-"                       gives incorrect information), specify them with a @WxHxB\n"
-"                       (and optional :R/G/B masks) at the end of the string.\n"
-"\n"
-"                       Examples:\n"
-"                           -rawfb console\n"
-"                           -rawfb /dev/fb0           (same)\n"
-"                           -rawfb console3           (force /dev/tty3)\n"
-"                           -rawfb consolex           (no keystrokes or mouse)\n"
-"                           -rawfb console:/dev/nonstd\n"
-"                           -rawfb console -pipeinput UINPUT:accel=4.0\n"
-"                           -rawfb vt3                (/dev/tty3 w/o /dev/fb0)\n"
-"\n"
-"                       VNC HOST: if the -rawfb string is of the form\n"
-"                       \"vnc:host:N\" then the VNC display \"N\" on the remote\n"
-"                       VNC server \"host\" is connected to (i.e. x11vnc acts as\n"
-"                       a VNC client itself) and that framebuffer is exported.\n"
-"\n"
-"                       This mode is really only of use if you are trying\n"
-"                       to improve performance in the case of many (e.g. >\n"
-"                       10) simultaneous VNC viewers, and you try a divide\n"
-"                       and conquer scheme to reduce bandwidth and improve\n"
-"                       responsiveness.  (However, another user found this mode\n"
-"                       useful to export a demo display through a slow link:\n"
-"                       then multiple demo viewers connected to the reflecting\n"
-"                       x11vnc on the fast side of the link, and so avoided\n"
-"                       all of the demo viewers going through the slow link.)\n"
-"\n"
-"                       For example, if there will be 64 simultaneous VNC\n"
-"                       viewers this can lead to a lot of redundant VNC traffic\n"
-"                       to and from the server host:N, extra CPU usage,\n"
-"                       and all viewers response can be reduced by having\n"
-"                       to wait for writes to the slowest client to finish.\n"
-"                       However, if you set up 8 reflectors/repeaters started\n"
-"                       with option -rawfb vnc:host:N, then there are only\n"
-"                       8 connections to host:N.  Each repeater then handles\n"
-"                       8 vnc viewer connections thereby spreading the load\n"
-"                       around.  In classroom broadcast usage, try to put the\n"
-"                       repeaters on different switches.  This mode is the same\n"
-"                       as -reflect host:N.  Replace \"host:N\" by \"listen\"\n"
-"                       or \"listen:port\" for a reverse connection.\n"
-"\n"
-"                       Overall performance will not be as good as a single\n"
-"                       direct connection because, among other things,\n"
-"                       there is an additional level of framebuffer polling\n"
-"                       and pointer motion can still induce many changes per\n"
-"                       second that must be propagated.  Tip: if the remote VNC\n"
-"                       is x11vnc doing wireframing, or an X display that does\n"
-"                       wireframing that gives much better response than opaque\n"
-"                       window dragging.  Consider the -nodragging option if\n"
-"                       the problem is severe.\n"
-"\n"
-"                       The env. var. X11VNC_REFLECT_PASSWORD can be set to\n"
-"                       the password needed to log into the vnc host server, or\n"
-"                       to \"file:path_to_file\" to indicate a file containing\n"
-"                       the password as its first line.\n"
-"\n"
-"                       To set the pixel format that x11vnc requests as a VNC\n"
-"                       CLIENT set the env. vars: X11VNC_REFLECT_bitsPerSample\n"
-"                       X11VNC_REFLECT_samplesPerPixel, and\n"
-"                       X11VNC_REFLECT_bytesPerPixel; the defaults are 8, 3, 4.\n"
-"                       2, 3, 1 would give a low color mode.  See the function\n"
-"                       rfbGetClient() in libvncclient for more info.\n"
-"\n"
-"                       The VNC HOST mode implies -shared.  Use -noshared as\n"
-"                       a subsequent cmdline option to disable sharing.\n"
-"\n"
-"-freqtab file          For use with \"-rawfb video\" for TV tuner devices to\n"
-"                       specify station frequencies.  Instead of using the built\n"
-"                       in ntsc-cable-us mapping of station number to frequency,\n"
-"                       use the data in file.  For stations that are not\n"
-"                       numeric, e.g. SE20, they are placed above the highest\n"
-"                       numbered station in the order they are found.  Example:\n"
-"                       \"-freqtab /usr/X11R6/share/xawtv/europe-west.list\"\n"
-"                       You can make your own freqtab by copying the xawtv\n"
-"                       format.\n"
-"\n"
-"-pipeinput cmd         This option lets you supply an external command in\n"
-"                       \"cmd\" that x11vnc will pipe all of the user input\n"
-"                       events to in a simple format.  In -pipeinput mode by\n"
-"                       default x11vnc will not process any of the user input\n"
-"                       events.  If you prefix \"cmd\" with \"tee:\" it will\n"
-"                       both send them to the pipe command and process them.\n"
-"                       For a description of the format run \"-pipeinput\n"
-"                       tee:/bin/cat\".  Another prefix is \"reopen\" which\n"
-"                       means to reopen pipe if it exits.  Separate multiple\n"
-"                       prefixes with commas.\n"
-"\n"
-"                       In combination with -rawfb one might be able to\n"
-"                       do amusing things (e.g. control non-X devices).\n"
-"                       To facilitate this, if -rawfb is in effect then the\n"
-"                       value is stored in X11VNC_RAWFB_STR for the pipe command\n"
-"                       to use if it wants. Do 'env | grep X11VNC' for more.\n"
-"\n"
-"                       Built-in pipeinput modes (no external program required):\n"
-"\n"
-"                       If cmd is \"VID\" and you are using the -rawfb for a\n"
-"                       video capture device, then an internal list of keyboard\n"
-"                       mappings is used to set parameters of the video.\n"
-"                       The mappings are:\n"
-"\n"
-"                         \"B\" and \"b\" adjust the brightness up and down.\n"
-"                         \"H\" and \"h\" adjust the hue.\n"
-"                         \"C\" and \"c\" adjust the colour.\n"
-"                         \"N\" and \"n\" adjust the contrast.\n"
-"                         \"S\" and \"s\" adjust the size of the capture screen.\n"
-"                         \"I\" and \"i\" cycle through input channels.\n"
-"                         Up and Down arrows adjust the station (if a tuner)\n"
-"                         F1, F2, ..., F6 will switch the video capture pixel\n"
-"                         format to HI240, RGB565, RGB24, RGB32, RGB555, and\n"
-"                         GREY respectively.  See -rawfb video for details.\n"
-"\n"
-"                       If cmd is \"CONSOLE\" or \"CONSOLEn\" where n\n"
-"                       is a Linux console number, then the linux console\n"
-"                       keystroke insertion to /dev/ttyN (see -rawfb console)\n"
-"                       is performed.\n"
-"\n"
-"                       If cmd begins with \"UINPUT\" then the Linux uinput\n"
-"                       module is used to insert both keystroke and mouse events\n"
-"                       to the Linux console (see -rawfb above).  This usually\n"
-"                       is the /dev/input/uinput device file (you may need to\n"
-"                       create it with \"mknod /dev/input/uinput c 10 223\"\n"
-"                       and insert the module with \"modprobe uinput\".\n"
-"\n"
-"                       The UINPUT mode currently only does US keyboards (a\n"
-"                       scan code option may be added), and not all keysyms\n"
-"                       are supported.  But it is probably more accurate than\n"
-"                       the \"CONSOLE\" method.\n"
-"\n"
-"                       You may want to use the options -cursor none and\n"
-"                       -nodragging in this mode.\n"
-"\n"
-"                       Additional tuning options may be supplied via:\n"
-"                       UINPUT:opt1,opt2,... (a comma separated list). If an\n"
-"                       option begins with \"/\" it is taken as the uinput\n"
-"                       device file.\n"
-"                       \n"
-"                       Which uinput is injected can be controlled by an option\n"
-"                       string made of the characters \"K\", \"M\", and \"B\"\n"
-"                       (see the -input option), e.g. \"KM\" allows keystroke\n"
-"                       and motion but not button clicks.\n"
-"\n"
-"                       A UINPUT option of the form: accel=f, or accel=fx+fy\n"
-"                       sets the mouse motion \"acceleration\".  This is used\n"
-"                       to correct raw mouse relative motion into how much the\n"
-"                       application cursor moves (x11vnc has no control over,\n"
-"                       or knowledge of how the windowing application interprets\n"
-"                       the raw mouse motions).  Typically the acceleration\n"
-"                       for an X display is 2 (see xset \"m\" option).  \"f\"\n"
-"                       is a floating point number, e.g. 3.0.  Use \"fx+fy\"\n"
-"                       if you need to supply different corrections for x and y.\n"
-"\n"
-"                       Note: the default acceleration is 2.0 since it seems\n"
-"                       both X and qt-embedded often (but not always) use\n"
-"                       this value.\n"
-"\n"
-"                       Even with a correct accel setting the mouse position\n"
-"                       will get out of sync (probably due to a mouse\n"
-"                       \"threshold\" setting where the acceleration doe not\n"
-"                       apply, set xset(1)).  The option reset=N sets the\n"
-"                       number of ms (default 150) after which the cursor is\n"
-"                       attempted to be reset (by forcing the mouse to (0,\n"
-"                       0) via small increments and then back out to (x, y)\n"
-"                       in 1 jump), This correction seems to be needed but can\n"
-"                       cause jerkiness or unexpected behavior with menus, etc.\n"
-"                       Use reset=0 to disable.\n"
-"\n"
-"                       If you set the env. var X11VNC_UINPUT_THRESHOLDS then\n"
-"                       the thresh=n mode will be enabled.  It is currently\n"
-"                       not working well.  If |dx| <= thresh and |dy| < thresh\n"
-"                       no acceleration is applied.  Use \"thresh=+n\" |dx| +\n"
-"                       |dy| < thresh to be used instead (X11?)\n"
-"\n"
-"                       Example:\n"
-"                           -pipeinput UINPUT:accel=4.0 -cursor none\n"
-"\n"
-"                       If the uinput device has an absolute pointer (as opposed\n"
-"                       to a normal mouse that is a relative pointer) you can\n"
-"                       specify the option \"abs\".  Note that a touchpad\n"
-"                       on a laptop is an absolute device to some degree.\n"
-"                       This (usually) avoids all the problems with mouse\n"
-"                       acceleration.  If x11vnc has trouble deducing the\n"
-"                       size of the device, use \"abs=WxH\".  Furthermore,\n"
-"                       if the device is a touchscreen (assumed to have an\n"
-"                       absolute pointer) use \"touch\" or \"touch=WxH\".\n"
-"                       For touchscreens, when a mouse button is pressed,\n"
-"                       a pressure increase is injected, and when the button\n"
-"                       is released a pressure of zero is injected.\n"
-"\n"
-"                       If touch has been set, use \"touch_always=1\" to\n"
-"                       indicate whenever the mouse moves with no button\n"
-"                       pressed, a touch event of zero pressure should be\n"
-"                       sent anyway.  Also use \"btn_touch=1\" to indicate a\n"
-"                       BTN_TOUCH keystroke press or release should be sent\n"
-"                       instead of a pressure change.  Set \"dragskip=n\" to\n"
-"                       skip n dragged mouse touches (with pressure applied)\n"
-"                       before injecting one.  To indicate the pressure that\n"
-"                       should be sent when there is a button click for a\n"
-"                       touchscreen device, specify pressure=n, e.g. n=5. The\n"
-"                       default is n=1.\n"
-"\n"
-"                       If a touch screen is being used (\"touch\" above)\n"
-"                       and it is having its input processed by tslib, you can\n"
-"                       specify the tslib calibration file via tslib_cal=<file>.\n"
-"                       For example, tslib_cal=/etc/pointercal.  To get accurate\n"
-"                       or even usable positioning this is required when tslib\n"
-"                       is in use.\n"
-"\n"
-"                       The Linux uinput mechanism can be bypassed and one can\n"
-"                       write input events DIRECTLY to the devices instead.\n"
-"                       To do this, specify one or more of the following\n"
-"                       for the input classes: direct_rel=<device>\n"
-"                       direct_abs=<device> direct_btn=<device> or\n"
-"                       direct_key=<device>.  The <device> file is usually\n"
-"                       something like /dev/input/event1 but you can specify\n"
-"                       any device file or pipe.  You must specify each one\n"
-"                       of the above classes even if they correspond to the\n"
-"                       same device file (rel/abs and btn are often the same.)\n"
-"                       Look at the file /proc/bus/input/devices to get an idea\n"
-"                       what is available and the device filenames.  Note:\n"
-"                       The /dev/input/mouse* devices do not seem to work,\n"
-"                       use the corresponding /dev/input/event* file instead.\n"
-"                       Any input class not directly specified as above will be\n"
-"                       handled via the uinput mechanism.  To disable creating a\n"
-"                       uinput device (and thereby discarding unhandled input),\n"
-"                       specify \"nouinput\".\n"
-"\n"
-"                       Examples:\n"
-"\n"
-"                         -pipeinput UINPUT:direct_abs=/dev/input/event1\n"
-"\n"
-"                       this was used on a qtmoko Neo freerunner (armel):\n"
-"\n"
-"                         -pipeinput UINPUT:touch,tslib_cal=/etc/pointercal,\n"
-"                          direct_abs=/dev/input/event1,nouinput,dragskip=4\n"
-"\n"
-"                       (where the long line has been split into two.)\n"
-"\n"
-"                       You can set the env. var X11VNC_UINPUT_DEBUG=1 or higher\n"
-"                       to get debugging output for UINPUT mode.\n"
-"\n"
-"-macnodim              For the native MacOSX server, disable dimming. \n"
-"-macnosleep            For the native MacOSX server, disable display sleep.\n"
-"-macnosaver            For the native MacOSX server, disable screensaver.\n"
-"-macnowait             For the native MacOSX server, do not wait for the\n"
-"                       user to switch back to his display.\n"
-"-macwheel n            For the native MacOSX server, set the mouse wheel\n"
-"                       speed to n (default 5).\n"
-"-macnoswap             For the native MacOSX server, do not swap mouse\n"
-"                       buttons 2 and 3.\n"
-"-macnoresize           For the native MacOSX server, do not resize or reset\n"
-"                       the framebuffer even if it is detected that the screen\n"
-"                       resolution or depth has changed.\n"
-"-maciconanim n         For the native MacOSX server, set n to the number\n"
-"                       of milliseconds that the window iconify/deiconify\n"
-"                       animation takes.  In -ncache mode this value will be\n"
-"                       used to skip the animation if possible. (default 400)\n"
-"-macmenu               For the native MacOSX server, in -ncache client-side\n"
-"                       caching mode, try to cache pull down menus (not perfect\n"
-"                       because they have animated fades, etc.)\n"
-"-macuskbd              For the native MacOSX server, use the original\n"
-"                       keystroke insertion code based on a US keyboard.\n"
-"-macnoopengl           For the native MacOSX server, do not use OpenGL for\n"
-"                       screen capture, but rather use the original, deprecated\n"
-"                       raw memory access method: addr = CGDisplayBaseAddress().\n"
-"-macnorawfb            For the native MacOSX server, disable the raw memory\n"
-"                       address screen capture method.\n"
-"\n"
-"                       MACOSX NOTE: There are some deprecated MacOSX interfaces\n"
-"                       to inject keyboard and mouse events and the raw memory\n"
-"                       access method is deprecated as well (however, OpenGL\n"
-"                       will be preferred if available because it is faster.)\n"
-"                       One can force not using any deprecated interfaces at\n"
-"                       compile time by setting -DX11VNC_MACOSX_NO_DEPRECATED=1\n"
-"                       in CPPFLAGS.  Or to turn them off one by one:\n"
-"                       -DX11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1,\n"
-"                       -DX11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or\n"
-"                       -DX11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1\n"
-"                       At run time, for testing and workarounds, one can\n"
-"                       disable them by using:\n"
-"                       -env X11VNC_MACOSX_NO_DEPRECATED=1\n"
-"                       -env X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1\n"
-"                       -env X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or\n"
-"                       -env X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1\n"
-"                       Note: When doing either of these for the mouse input\n"
-"                       not everything works currently, e.g. double clicks and\n"
-"                       wireframing.  Also, screen resolution and pixel depth\n"
-"                       changes will not be automatically detected unless the\n"
-"                       deprecated framebuffer interfaces are allowed.\n"
-"\n"
-"                       Conversely, if you are compiling on an\n"
-"                       older machine that does not have some of\n"
-"                       the newer interfaces, you may need to specify\n"
-"                       -DX11VNC_MACOSX_NO_CGEVENTCREATESCROLLWHEELEVENT\n"
-"                       -DX11VNC_MACOSX_NO_CGEVENTCREATEMOUSEEVENT or\n"
-"                       -DX11VNC_MACOSX_NO_CGEVENTCREATEKEYBOARDEVENT.  Use\n"
-"                       -DX11VNC_MACOSX_USE_GETMAINDEVICE to regain the very\n"
-"                       old QuickDraw GetMainDevice() interface (rare...)\n"
-"\n"
-"-gui [gui-opts]        Start up a simple tcl/tk gui based on the remote\n"
-"                       control options -remote/-query described below.\n"
-"                       Requires the \"wish\" program to be installed on the\n"
-"                       machine.  \"gui-opts\" is not required: the default\n"
-"                       is to start up both the full gui and x11vnc with the\n"
-"                       gui showing up on the X display in the environment\n"
-"                       variable DISPLAY.\n"
-"\n"
-"                       \"gui-opts\" can be a comma separated list of items.\n"
-"                       Currently there are these types of items: 1) a gui\n"
-"                       mode, a 2) gui \"simplicity\", 3) the X display the\n"
-"                       gui should display on, 4) a \"tray\" or \"icon\" mode,\n"
-"                       and 5) a gui geometry.\n"
-"\n"
-"                       1) The gui mode can be \"start\", \"conn\", or \"wait\"\n"
-"                       \"start\" is the default mode above and is not required.\n"
-"                       \"conn\" means do not automatically start up x11vnc,\n"
-"                       but instead just try to connect to an existing x11vnc\n"
-"                       process.  \"wait\" means just start the gui and nothing\n"
-"                       else (you will later instruct the gui to start x11vnc\n"
-"                       or connect to an existing one.)\n"
-"\n"
-"                       2) The gui simplicity is off by default (a power-user\n"
-"                       gui with all options is presented) To start with\n"
-"                       something less daunting supply the string \"simple\"\n"
-"                       (\"ez\" is an alias for this).  Once the gui is\n"
-"                       started you can toggle between the two with \"Misc ->\n"
-"                       simple_gui\".\n"
-"\n"
-"                       3) Note the possible confusion regarding the potentially\n"
-"                       two different X displays: x11vnc polls one, but you\n"
-"                       may want the gui to appear on another.  For example, if\n"
-"                       you ssh in and x11vnc is not running yet you may want\n"
-"                       the gui to come back to you via your ssh redirected X\n"
-"                       display (e.g. localhost:10).\n"
-"\n"
-"                       If you do not specify a gui X display in \"gui-opts\"\n"
-"                       then the DISPLAY environment variable and -display\n"
-"                       option are tried (in that order).  Regarding the x11vnc\n"
-"                       X display the gui will try to communication with, it\n"
-"                       first tries -display and then DISPLAY.  For example,\n"
-"                       \"x11vnc -display :0 -gui otherhost:0\", will remote\n"
-"                       control an x11vnc polling :0 and display the gui on\n"
-"                       otherhost:0 The \"tray/icon\" mode below reverses this\n"
-"                       preference, preferring to display on the x11vnc display.\n"
-"\n"
-"                       4) When \"tray\" or \"icon\" is specified, the gui\n"
-"                       presents itself as a small icon with behavior typical\n"
-"                       of a \"system tray\" or \"dock applet\".  The color\n"
-"                       of the icon indicates status (connected clients) and\n"
-"                       there is also a balloon status.  Clicking on the icon\n"
-"                       gives a menu from which properties, etc, can be set and\n"
-"                       the full gui is available under \"Advanced\".  To be\n"
-"                       fully functional, the gui mode should be \"start\"\n"
-"                       (the default).\n"
-"\n"
-"                       Note that tray or icon mode will imply the -forever\n"
-"                       x11vnc option (if the x11vnc server is started along\n"
-"                       with the gui) unless -connect or -connect_or_exit has\n"
-"                       been specified.  So x11vnc (and the tray/icon gui)\n"
-"                       will wait for more connections after the first client\n"
-"                       disconnects.  If you want only one viewer connection\n"
-"                       include the -once option.\n"
-"\n"
-"                       For \"icon\" the gui just a small standalone window.\n"
-"                       For \"tray\" it will attempt to embed itself in the\n"
-"                       \"system tray\" if possible. If \"=setpass\" is appended then\n"
-"                       at startup the X11 user will be prompted to set the\n"
-"                       VNC session password.  If =<hexnumber> is appended\n"
-"                       that icon will attempt to embed itself in the window\n"
-"                       given by hexnumber.  Use =noadvanced to disable the\n"
-"                       full gui. (To supply more than one, use \"+\" sign).\n"
-"                       E.g. -gui tray=setpass and -gui icon=0x3600028\n"
-"\n"
-"                       Other modes: \"full\", the default and need not be\n"
-"                       specified.  \"-gui none\", do not show a gui, useful\n"
-"                       to override a ~/.x11vncrc setting, etc.\n"
-"\n"
-"                       5) When \"geom=+X+Y\" is specified, that geometry\n"
-"                       is passed to the gui toplevel.  This is the icon in\n"
-"                       icon/tray mode, or the full gui otherwise.  You can\n"
-"                       also specify width and height, i.e. WxH+X+Y, but it\n"
-"                       is not recommended.  In \"tray\" mode the geometry is\n"
-"                       ignored unless the system tray manager does not seem\n"
-"                       to be running.  One could imagine using something like\n"
-"                       \"-gui tray,geom=+4000+4000\" with a display manager\n"
-"                       to keep the gui invisible until someone logs in...\n"
-"\n"
-"                       More icon tricks, \"icon=minimal\" gives an icon just\n"
-"                       with the VNC display number.  You can also set the font\n"
-"                       with \"iconfont=...\".  The following could be useful:\n"
-"                       \"-gui icon=minimal,iconfont=5x8,geom=24x10+0-0\"\n"
-"\n"
-"                       General examples of the -gui option: \"x11vnc -gui\",\n"
-"                       \"x11vnc -gui ez\" \"x11vnc -gui localhost:10\",\n"
-"                       \"x11vnc -gui conn,host:0\", \"x11vnc -gui tray,ez\"\n"
-"                       \"x11vnc -gui tray=setpass\"\n"
-"\n"
-"                       If you do not intend to start x11vnc from the gui\n"
-"                       (i.e. just remote control an existing one), then the\n"
-"                       gui process can run on a different machine from the\n"
-"                       x11vnc server as long as X permissions, etc. permit\n"
-"                       communication between the two.\n"
-"\n"
-"                       FONTS: On some systems the tk fonts can be too small,\n"
-"                       jagged, or otherwise unreadable.  There are 4 env vars\n"
-"                       you can set to be the tk font you prefer:\n"
-"\n"
-"                       X11VNC_FONT_BOLD   main font for menus and buttons.\n"
-"                       X11VNC_FONT_FIXED  font for fixed width text.\n"
-"\n"
-"                       X11VNC_FONT_BOLD_SMALL  tray icon font.\n"
-"                       X11VNC_FONT_REG_SMALL   tray icon menu font.\n"
-"\n"
-"                       The last two only apply for the tray icon mode.\n"
-"\n"
-"                       Here are some examples:\n"
-"\n"
-"                       -env X11VNC_FONT_BOLD='Helvetica -16 bold'\n"
-"                       -env X11VNC_FONT_FIXED='Courier -14'\n"
-"                       -env X11VNC_FONT_REG_SMALL='Helvetica -12'\n"
-"\n"
-"                       You can put the lines like the above (without the\n"
-"                       quotes) in your ~/.x11vncrc file to avoid having to\n"
-"                       specify them on the x11vnc command line.\n"
-"\n"
-"-remote command        Remotely control some aspects of an already running\n"
-"                       x11vnc server.  \"-R\" and \"-r\" are aliases for\n"
-"                       \"-remote\".  After the remote control command is\n"
-"                       sent to the running server the 'x11vnc -remote ...'\n"
-"                       x11vnc command exits.  You can often use the -query\n"
-"                       command (see below) to see if the x11vnc server\n"
-"                       processed your -remote command.\n"
-"\n"
-"                       The default communication channel is that of X\n"
-"                       properties (specifically X11VNC_REMOTE), and so this\n"
-"                       command must be run with correct settings for DISPLAY\n"
-"                       and possibly XAUTHORITY to connect to the X server\n"
-"                       and set the property.  Alternatively, use the -display\n"
-"                       and -auth options to set them to the correct values.\n"
-"                       The running server cannot use the -novncconnect option\n"
-"                       because that disables the communication channel.\n"
-"                       See below for alternate channels.\n"
-"\n"
-"                       For example: 'x11vnc -remote stop' (which is the same as\n"
-"                       'x11vnc -R stop') will close down the x11vnc server.\n"
-"                       'x11vnc -R shared' will enable shared connections, and\n"
-"                       'x11vnc -R scale:3/4' will rescale the desktop.\n"
-"\n"
-"                       To use a different name for the X11 property (e.g. to\n"
-"                       have separate communication channels for multiple\n"
-"                       x11vnc's on the same display) set the X11VNC_REMOTE\n"
-"                       environment variable to the string you want, for\n"
-"                       example: -env X11VNC_REMOTE=X11VNC_REMOTE_12345\n"
-"                       Both sides of the channel must use the same unique name.\n"
-"\n"
-"                       To run a bunch of commands in a sequence use something\n"
-"                       like: x11vnc -R 'script:firstcmd;secondcmd;...'\n"
-"\n"
-"                       Use x11vnc -R script:file=/path/to/file to read commands\n"
-"                       from a file (can be multi-line and use the comment '#'\n"
-"                       character in the normal way.  The ';' separator must\n"
-"                       still be used to separate each command.)\n"
-"\n"
-"                       To not try to contact another x11vnc process and instead\n"
-"                       just run the command (or query) directly, prefix the\n"
-"                       command with the string \"DIRECT:\"\n"
-"\n"
-"                       The following -remote/-R commands are supported:\n"
-"\n"
-"                       stop            terminate the server, same as \"quit\"\n"
-"                                       \"exit\" or \"shutdown\".\n"
-"                       ping            see if the x11vnc server responds.\n"
-"                                       return is: ans=ping:<display>\n"
-"                       ping:mystring   as above, but use your own unique string.\n"
-"                                       return is: ans=ping:mystring:<xdisplay>\n"
-"                       blacken         try to push a black fb update to all\n"
-"                                       clients (due to timings a client\n"
-"                                       could miss it). Same as \"zero\", also\n"
-"                                       \"zero:x1,y1,x2,y2\" for a rectangle.\n"
-"                       refresh         send the entire fb to all clients.\n"
-"                       reset           recreate the fb, polling memory, etc.\n"
-/* ext. cmd. */
-"                       id:windowid     set -id window to \"windowid\". empty\n"
-"                                       or \"root\" to go back to root window\n"
-"                       sid:windowid    set -sid window to \"windowid\"\n"
-"                       id_cmd:cmd      cmds: raise, lower, map, unmap, iconify,\n"
-"                                       move:dXdY, resize:dWdH, geom:WxH+X+Y. dX\n"
-"                                       dY, dW, and dH must have a leading \"+\"\n"
-"                                       or \"-\" e.g.: move:-30+10 resize:+20+35\n"
-"                                       also: wm_delete, wm_name:string and\n"
-"                                       icon_name:string. Also id_cmd:win=N:cmd\n"
-"                       waitmapped      wait until subwin is mapped.\n"
-"                       nowaitmapped    do not wait until subwin is mapped.\n"
-"                       clip:WxH+X+Y    set -clip mode to \"WxH+X+Y\"\n"
-"                       flashcmap       enable  -flashcmap mode.\n"
-"                       noflashcmap     disable -flashcmap mode.\n"
-"                       shiftcmap:n     set -shiftcmap to n.\n"
-"                       notruecolor     enable  -notruecolor mode.\n"
-"                       truecolor       disable -notruecolor mode.\n"
-"                       overlay         enable  -overlay mode (if applicable).\n"
-"                       nooverlay       disable -overlay mode.\n"
-"                       overlay_cursor  in -overlay mode, enable cursor drawing.\n"
-"                       overlay_nocursor disable cursor drawing. same as\n"
-"                                        nooverlay_cursor.\n"
-"                       8to24           enable  -8to24 mode (if applicable).\n"
-"                       no8to24         disable -8to24 mode.\n"
-"                       8to24_opts:str  set the -8to24 opts to \"str\".\n"
-"                       24to32          enable  -24to32 mode (if applicable).\n"
-"                       no24to32        disable -24to32 mode.\n"
-"                       visual:vis      set -visual to \"vis\"\n"
-"                       scale:frac      set -scale to \"frac\"\n"
-"                       scale_cursor:f  set -scale_cursor to \"f\"\n"
-"                       viewonly        enable  -viewonly mode.\n"
-/* access view,share,forever */
-"                       noviewonly      disable -viewonly mode.\n"
-"                       shared          enable  -shared mode.\n"
-"                       noshared        disable -shared mode.\n"
-"                       forever         enable  -forever mode.\n"
-"                       noforever       disable -forever mode.\n"
-"                       timeout:n       reset -timeout to n, if there are\n"
-"                                       currently no clients, exit unless one\n"
-"                                       connects in the next n secs.\n"
-"                       tightfilexfer   enable  filetransfer for NEW clients.\n"
-"                       notightfilexfer disable filetransfer for NEW clients.\n"
-"                       ultrafilexfer   enable  filetransfer for clients.\n"
-"                       noultrafilexfer disable filetransfer for clients.\n"
-"                       rfbversion:n.m  set -rfbversion for new clients.\n"
-/* access */
-"                       http            enable  http client connections.\n"
-"                       nohttp          disable http client connections.\n"
-"                       deny            deny any new connections, same as \"lock\"\n"
-"                       nodeny          allow new connections, same as \"unlock\"\n"
-"                       avahi           enable  avahi service advertising.\n"
-"                       noavahi         disable avahi service advertising.\n"
-"                       mdns            enable  avahi service advertising.\n"
-"                       nomdns          disable avahi service advertising.\n"
-"                       zeroconf        enable  avahi service advertising.\n"
-"                       nozeroconf      disable avahi service advertising.\n"
-/* access, filename */
-"                       connect:host    do reverse connection to host, \"host\"\n"
-"                                       may be a comma separated list of hosts\n"
-"                                       or host:ports.  See -connect.  Passwords\n"
-"                                       required as with fwd connections.\n"
-"                                       See X11VNC_REVERSE_CONNECTION_NO_AUTH=1\n"
-"                       disconnect:host disconnect any clients from \"host\"\n"
-"                                       same as \"close:host\".  Use host\n"
-"                                       \"all\" to close all current clients.\n"
-"                                       If you know the client internal hex ID,\n"
-"                                       e.g. 0x3 (returned by \"-query clients\"\n"
-"                                       and RFB_CLIENT_ID) you can use that too.\n"
-"                       proxy:host:port set reverse connection proxy (empty to\n"
-"                                       disable).\n"
-/* access */
-"                       allowonce:host  For the next connection only, allow\n"
-"                                       connection from \"host\". In -ssl mode\n"
-"                                       two connections are allowed (i.e. Fetch\n"
-"                                       Cert) unless X11VNC_NO_SSL_ALLOW_TWICE=1\n"
-/* access */
-"                       allow:hostlist  set -allow list to (comma separated)\n"
-"                                       \"hostlist\". See -allow and -localhost.\n"
-"                                       Do not use with -allow /path/to/file\n"
-"                                       Use \"+host\" to add a single host, and\n"
-"                                       use \"-host\" to delete a single host\n"
-"                       localhost       enable  -localhost mode\n"
-"                       nolocalhost     disable -localhost mode\n"
-"                       listen:str      set -listen to str, empty to disable.\n"
-"                       noipv6          enable  -noipv6 mode.\n"
-"                       ipv6            disable -noipv6 mode.\n"
-"                       noipv4          enable  -noipv4 mode.\n"
-"                       ipv4            disable -noipv4 mode.\n"
-"                       6               enable  -6 IPv6 listening mode.\n"
-"                       no6             disable -6 IPv6 listening mode.\n"
-"                       lookup          disable -nolookup mode.\n"
-"                       nolookup        enable  -nolookup mode.\n"
-"                       lookup          disable -nolookup mode.\n"
-"                       input:str       set -input to \"str\", empty to disable.\n"
-"                       grabkbd         enable  -grabkbd mode.\n"
-"                       nograbkbd       disable -grabkbd mode.\n"
-"                       grabptr         enable  -grabptr mode.\n"
-"                       nograbptr       disable -grabptr mode.\n"
-"                       grabalways      enable  -grabalways mode.\n"
-"                       nograbalways    disable -grabalways mode.\n"
-"                       grablocal:n     set -grablocal to n.\n"
-"                       client_input:str set the K, M, B -input on a per-client\n"
-"                                       basis.  select which client as for\n"
-"                                       disconnect, e.g. client_input:host:MB\n"
-"                                       or client_input:0x2:K\n"
-/* ext. cmd. */
-"                       accept:cmd      set -accept \"cmd\" (empty to disable).\n"
-"                       afteraccept:cmd set -afteraccept (empty to disable).\n"
-"                       gone:cmd        set -gone \"cmd\" (empty to disable).\n"
-"                       noshm           enable  -noshm mode.\n"
-"                       shm             disable -noshm mode (i.e. use shm).\n"
-"                       flipbyteorder   enable -flipbyteorder mode, you may need\n"
-"                                       to set noshm for this to do something.\n"
-"                       noflipbyteorder disable -flipbyteorder mode.\n"
-"                       onetile         enable  -onetile mode. (you may need to\n"
-"                                       set shm for this to do something)\n"
-"                       noonetile       disable -onetile mode.\n"
-/* ext. cmd. */
-"                       solid           enable  -solid mode\n"
-"                       nosolid         disable -solid mode.\n"
-"                       solid_color:color set -solid color (and apply it).\n"
-"                       blackout:str    set -blackout \"str\" (empty to disable).\n"
-"                                       See -blackout for the form of \"str\"\n"
-"                                       (basically: WxH+X+Y,...)\n"
-"                                       Use \"+WxH+X+Y\" to append a single\n"
-"                                       rectangle use \"-WxH+X+Y\" to delete one\n"
-"                       xinerama        enable  -xinerama mode. (if applicable)\n"
-"                       noxinerama      disable -xinerama mode.\n"
-"                       xtrap           enable  -xtrap input mode(if applicable)\n"
-"                       noxtrap         disable -xtrap input mode.\n"
-"                       xrandr          enable  -xrandr mode. (if applicable)\n"
-"                       noxrandr        disable -xrandr mode.\n"
-"                       xrandr_mode:mode set the -xrandr mode to \"mode\".\n"
-"                       rotate:mode     set the -rotate mode to \"mode\".\n"
-"                       padgeom:WxH     set -padgeom to WxH (empty to disable)\n"
-"                                       If WxH is \"force\" or \"do\" the padded\n"
-"                                       geometry fb is immediately applied.\n"
-"                       quiet           enable  -quiet mode.\n"
-"                       noquiet         disable -quiet mode.\n"
-"                       modtweak        enable  -modtweak mode.\n"
-"                       nomodtweak      enable  -nomodtweak mode.\n"
-"                       xkb             enable  -xkb modtweak mode.\n"
-"                       noxkb           disable -xkb modtweak mode.\n"
-"                       capslock        enable  -capslock mode.\n"
-"                       nocapslock      disable -capslock mode.\n"
-"                       skip_lockkeys   enable  -skip_lockkeys mode.\n"
-"                       noskip_lockkeys disable -skip_lockkeys mode.\n"
-"                       skip_keycodes:str enable -xkb -skip_keycodes \"str\".\n"
-"                       sloppy_keys     enable  -sloppy_keys mode.\n"
-"                       nosloppy_keys   disable -sloppy_keys mode.\n"
-"                       skip_dups       enable  -skip_dups mode.\n"
-"                       noskip_dups     disable -skip_dups mode.\n"
-"                       add_keysyms     enable -add_keysyms mode.\n"
-"                       noadd_keysyms   stop adding keysyms. those added will\n"
-"                                       still be removed at exit.\n"
-"                       clear_mods      enable  -clear_mods mode and clear them.\n"
-"                       noclear_mods    disable -clear_mods mode.\n"
-"                       clear_keys      enable  -clear_keys mode and clear them.\n"
-"                       noclear_keys    disable -clear_keys mode.\n"
-"                       clear_locks     do the clear_locks action.\n"
-"                       clear_all       do the clear_all action.\n"
-"                       keystate        have x11vnc print current keystate.\n"
-/* filename */
-"                       remap:str       set -remap \"str\" (empty to disable).\n"
-"                                       See -remap for the form of \"str\"\n"
-"                                       (basically: key1-key2,key3-key4,...)\n"
-"                                       Use \"+key1-key2\" to append a single\n"
-"                                       keymapping, use \"-key1-key2\" to delete.\n"
-"                       norepeat        enable  -norepeat mode.\n"
-"                       repeat          disable -norepeat mode.\n"
-"                       nofb            enable  -nofb mode.\n"
-"                       fb              disable -nofb mode.\n"
-"                       bell            enable  bell (if supported).\n"
-"                       nobell          disable bell.\n"
-"                       sendbell        ring the bell now.\n"
-"                       nosel           enable  -nosel mode.\n"
-"                       sel             disable -nosel mode.\n"
-"                       noprimary       enable  -noprimary mode.\n"
-"                       primary         disable -noprimary mode.\n"
-"                       nosetprimary    enable  -nosetprimary mode.\n"
-"                       setprimary      disable -nosetprimary mode.\n"
-"                       noclipboard     enable  -noclipboard mode.\n"
-"                       clipboard       disable -noclipboard mode.\n"
-"                       nosetclipboard  enable  -nosetclipboard mode.\n"
-"                       setclipboard    disable -nosetclipboard mode.\n"
-"                       seldir:str      set -seldir to \"str\"\n"
-"                       resend_cutbuffer resend the most recent CUTBUFFER0 copy\n"
-"                       resend_clipboard resend the most recent CLIPBOARD copy\n"
-"                       resend_primary   resend the most recent PRIMARY copy\n"
-"                       cursor:mode     enable  -cursor \"mode\".\n"
-"                       show_cursor     enable  showing a cursor.\n"
-"                       noshow_cursor   disable showing a cursor. (same as\n"
-"                                       \"nocursor\")\n"
-"                       cursor_drag     enable  cursor changes during drag.\n"
-"                       nocursor_drag   disable cursor changes during drag.\n"
-"                       arrow:n         set -arrow to alternate n.\n"
-"                       xfixes          enable  xfixes cursor shape mode.\n"
-"                       noxfixes        disable xfixes cursor shape mode.\n"
-"                       alphacut:n      set -alphacut to n.\n"
-"                       alphafrac:f     set -alphafrac to f.\n"
-"                       alpharemove     enable  -alpharemove mode.\n"
-"                       noalpharemove   disable -alpharemove mode.\n"
-"                       alphablend      disable -noalphablend mode.\n"
-"                       noalphablend    enable  -noalphablend mode.\n"
-"                       cursorshape     disable -nocursorshape mode.\n"
-"                       nocursorshape   enable  -nocursorshape mode.\n"
-"                       cursorpos       disable -nocursorpos mode.\n"
-"                       nocursorpos     enable  -nocursorpos mode.\n"
-"                       xwarp           enable  -xwarppointer mode.\n"
-"                       noxwarp         disable -xwarppointer mode.\n"
-"                       always_inject   enable  -always_inject mode.\n"
-"                       noalways_inject disable -always_inject mode.\n"
-"                       buttonmap:str   set -buttonmap \"str\", empty to disable\n"
-"                       dragging        disable -nodragging mode.\n"
-"                       nodragging      enable  -nodragging mode.\n"
-"                       ncache          reenable -ncache mode.\n"
-"                       noncache        disable  -ncache mode.\n"
-"                       ncache_size:n   set -ncache size to n.\n"
-"                       ncache_cr       enable  -ncache_cr mode.\n"
-"                       noncache_cr     disable -ncache_cr mode.\n"
-"                       ncache_no_moveraise     enable  no_moveraise mode.\n"
-"                       noncache_no_moveraise   disable no_moveraise mode.\n"
-"                       ncache_no_dtchange      enable  ncache_no_dtchange mode.\n"
-"                       noncache_no_dtchange    disable ncache_no_dtchange mode.\n"
-"                       ncache_old_wm           enable  ncache_old_wm mode.\n"
-"                       noncache_old_wm         disable ncache_old_wm mode.\n"
-"                       ncache_no_rootpixmap    enable  ncache_no_rootpixmap.\n"
-"                       noncache_no_rootpixmap  disable ncache_no_rootpixmap.\n"
-"                       ncache_reset_rootpixmap recheck the root pixmap, ncrp\n"
-"                       ncache_keep_anims       enable  ncache_keep_anims.\n"
-"                       noncache_keep_anims     disable ncache_keep_anims.\n"
-"                       ncache_pad:n    set -ncache_pad to n.\n"
-"                       wireframe       enable  -wireframe mode. same as \"wf\"\n"
-"                       nowireframe     disable -wireframe mode. same as \"nowf\"\n"
-"                       wireframe:str   enable  -wireframe mode string.\n"
-"                       wireframe_mode:str enable  -wireframe mode string.\n"
-"                       wireframelocal  enable  wireframelocal. same as \"wfl\"\n"
-"                       nowireframe     disable wireframelocal. same as \"nowfl\"\n"
-"                       wirecopyrect:str set -wirecopyrect string. same as \"wcr:\"\n"
-"                       scrollcopyrect:str set -scrollcopyrect string. same \"scr\"\n"
-"                       noscrollcopyrect disable -scrollcopyrect mode. \"noscr\"\n"
-"                       scr_area:n      set -scr_area to n\n"
-"                       scr_skip:list   set -scr_skip to \"list\"\n"
-"                       scr_inc:list    set -scr_inc to \"list\"\n"
-"                       scr_keys:list   set -scr_keys to \"list\"\n"
-"                       scr_term:list   set -scr_term to \"list\"\n"
-"                       scr_keyrepeat:str set -scr_keyrepeat to \"str\"\n"
-"                       scr_parms:str   set -scr_parms parameters.\n"
-"                       fixscreen:str   set -fixscreen to \"str\".\n"
-"                       noxrecord       disable all use of RECORD extension.\n"
-"                       xrecord         enable  use of RECORD extension.\n"
-"                       reset_record    reset RECORD extension (if avail.)\n"
-"                       pointer_mode:n  set -pointer_mode to n. same as \"pm\"\n"
-"                       input_skip:n    set -input_skip to n.\n"
-"                       allinput        enable  use of -allinput mode.\n"
-"                       noallinput      disable use of -allinput mode.\n"
-"                       input_eagerly   enable  use of -input_eagerly mode.\n"
-"                       noinput_eagerly disable use of -input_eagerly mode.\n"
-"                       ssltimeout:n    set -ssltimeout to n.\n"
-"                       speeds:str      set -speeds to str.\n"
-"                       wmdt:str        set -wmdt to str.\n"
-"                       debug_pointer   enable  -debug_pointer, same as \"dp\"\n"
-"                       nodebug_pointer disable -debug_pointer, same as \"nodp\"\n"
-"                       debug_keyboard   enable  -debug_keyboard, same as \"dk\"\n"
-"                       nodebug_keyboard disable -debug_keyboard, same as \"nodk\"\n"
-"                       keycode:n       inject keystroke 'keycode' (xmodmap -pk)\n"
-"                       keycode:n,down  inject 'keycode' (down=0,1)\n"
-"                       keysym:str      inject keystroke 'keysym' (number/name)\n"
-"                       keysym:str,down inject 'keysym' (down=0,1)\n"
-"                       ptr:x,y,mask    inject pointer event x, y, button-mask\n"
-"                       fakebuttonevent:button,down direct XTestFakeButtonEvent.\n"
-"                       sleep:t         sleep floating point time t.\n"
-"                       get_xprop:p     get X property named 'p'.\n"
-"                       set_xprop:p:val set X property named 'p' to 'val'.\n"
-"                                       p -> id=NNN:p for hex/dec window id.\n"
-"                       wininfo:id      get info about X window id.  use 'root'\n"
-"                                       for root window, use +id for children.\n"
-"                       grab_state      get state of pointer and keyboard grab.\n"
-"                       pointer_pos     print XQueryPointer x,y cursor position.\n"
-"                       pointer_x       print XQueryPointer x cursor position.\n"
-"                       pointer_y       print XQueryPointer y cursor position.\n"
-"                       pointer_same    print XQueryPointer ptr on same screen.\n"
-"                       pointer_root    print XQueryPointer curr ptr rootwin.\n"
-"                       pointer_mask    print XQueryPointer button and mods mask\n"
-"                       mouse_x         print x11vnc's idea of cursor position.\n"
-"                       mouse_y         print x11vnc's idea of cursor position.\n"
-"                       noop            do nothing.\n"
-"                       defer:n         set -defer to n ms,same as deferupdate:n\n"
-"                       wait:n          set -wait to n ms.\n"
-"                       extra_fbur:n    set -extra_fbur to n.\n"
-"                       wait_ui:f       set -wait_ui factor to f.\n"
-"                       setdefer:n      set -setdefer to -2,-1,0,1, or 2.\n"
-"                       wait_bog        disable -nowait_bog mode.\n"
-"                       nowait_bog      enable  -nowait_bog mode.\n"
-"                       slow_fb:f       set -slow_fb to f seconds.\n"
-"                       xrefresh:f      set -xrefresh to f seconds.\n"
-"                       readtimeout:n   set read timeout to n seconds.\n"
-"                       nap             enable  -nap mode.\n"
-"                       nonap           disable -nap mode.\n"
-"                       sb:n            set -sb to n s, same as screen_blank:n\n"
-"                       fbpm            disable -nofbpm mode.\n"
-"                       nofbpm          enable  -nofbpm mode.\n"
-"                       dpms            disable -nodpms mode.\n"
-"                       nodpms          enable  -nodpms mode.\n"
-"                       forcedpms       enable  -forcedpms mode.\n"
-"                       noforcedpms     disable -forcedpms mode.\n"
-"                       clientdpms      enable  -clientdpms mode.\n"
-"                       noclientdpms    disable -clientdpms mode.\n"
-"                       noserverdpms    enable  -noserverdpms mode.\n"
-"                       serverdpms      disable -noserverdpms mode.\n"
-"                       noultraext      enable  -noultraext mode.\n"
-"                       ultraext        disable -noultraext mode.\n"
-"                       chatwindow      enable  local chatwindow mode.\n"
-"                       nochatwindow    disable local chatwindow mode.\n"
-"                       chaton          begin chat using local window.\n"
-"                       chatoff         end   chat using local window.\n"
-"                       xdamage         enable  xdamage polling hints.\n"
-"                       noxdamage       disable xdamage polling hints.\n"
-"                       xd_area:A       set -xd_area max pixel area to \"A\"\n"
-"                       xd_mem:f        set -xd_mem remembrance to \"f\"\n"
-"                       fs:frac         set -fs fraction to \"frac\", e.g. 0.5\n"
-"                       gaps:n          set -gaps to n.\n"
-"                       grow:n          set -grow to n.\n"
-"                       fuzz:n          set -fuzz to n.\n"
-"                       snapfb          enable  -snapfb mode.\n"
-"                       nosnapfb        disable -snapfb mode.\n"
-"                       rawfb:str       set -rawfb mode to \"str\".\n"
-"                       uinput_accel:f  set uinput_accel to f.\n"
-"                       uinput_thresh:n set uinput_thresh to n.\n"
-"                       uinput_reset:n  set uinput_reset to n ms.\n"
-"                       uinput_always:n set uinput_always to 1/0.\n"
-"                       progressive:n   set LibVNCServer -progressive slice\n"
-"                                       height parameter to n.\n"
-"                       desktop:str     set -desktop name to str for new clients.\n"
-"                       rfbport:n       set -rfbport to n.\n"
-"                       macnosaver      enable  -macnosaver mode.\n"
-"                       macsaver        disable -macnosaver mode.\n"
-"                       macnowait       enable  -macnowait  mode.\n"
-"                       macwait         disable -macnowait  mode.\n"
-"                       macwheel:n      set -macwheel to n.\n"
-"                       macnoswap       enable  -macnoswap mouse button mode.\n"
-"                       macswap         disable -macnoswap mouse button mode.\n"
-"                       macnoresize     enable  -macnoresize mode.\n"
-"                       macresize       disable -macnoresize mode.\n"
-"                       maciconanim:n   set -maciconanim to n.\n"
-"                       macmenu         enable  -macmenu  mode.\n"
-"                       macnomenu       disable -macmenu  mode.\n"
-"                       macuskbd        enable  -macuskbd mode.\n"
-"                       macnouskbd      disable -macuskbd mode.\n"
-/* access */
-"                       httpport:n      set -httpport to n.\n"
-"                       httpdir:dir     set -httpdir to dir (and enable http).\n"
-"                       enablehttpproxy   enable  -enablehttpproxy mode.\n"
-"                       noenablehttpproxy disable -enablehttpproxy mode.\n"
-"                       alwaysshared     enable  -alwaysshared mode.\n"
-"                       noalwaysshared   disable -alwaysshared mode.\n"
-"                                        (may interfere with other options)\n"
-"                       nevershared      enable  -nevershared mode.\n"
-"                       nonevershared    disable -nevershared mode.\n"
-"                                        (may interfere with other options)\n"
-"                       dontdisconnect   enable  -dontdisconnect mode.\n"
-"                       nodontdisconnect disable -dontdisconnect mode.\n"
-"                                        (may interfere with other options)\n"
-"                       debug_xevents   enable  debugging X events.\n"
-"                       nodebug_xevents disable debugging X events.\n"
-"                       debug_xdamage   enable  debugging X DAMAGE mechanism.\n"
-"                       nodebug_xdamage disable debugging X DAMAGE mechanism.\n"
-"                       debug_wireframe enable   debugging wireframe mechanism.\n"
-"                       nodebug_wireframe disable debugging wireframe mechanism.\n"
-"                       debug_scroll    enable  debugging scrollcopy mechanism.\n"
-"                       nodebug_scroll  disable debugging scrollcopy mechanism.\n"
-"                       debug_tiles     enable  -debug_tiles\n"
-"                       nodebug_tiles   disable -debug_tiles\n"
-"                       debug_grabs     enable  -debug_grabs\n"
-"                       nodebug_grabs   disable -debug_grabs\n"
-"                       debug_sel       enable  -debug_sel\n"
-"                       nodebug_sel     disable -debug_sel\n"
-"                       debug_ncache    enable  -debug_ncache\n"
-"                       nodebug_ncache  disable -debug_ncache\n"
-"                       dbg             enable  -dbg crash shell\n"
-"                       nodbg           disable -dbg crash shell\n"
-"\n"
-"                       noremote        disable the -remote command processing,\n"
-"                                       it cannot be turned back on.\n"
-"\n"
-"                       bcx_xattach:str  This remote control command is for\n"
-"                       use with the BARCO xattach program or the x2x program.\n"
-"                       Both of these programs are for 'pointer and keyboard'\n"
-"                       sharing between separate X displays.  In general the\n"
-"                       two displays are usually nearby, e.g. on the same desk,\n"
-"                       and this allows the user to share a single pointer and\n"
-"                       keyboard between them.  The user moves the mouse to\n"
-"                       an edge and then the mouse pointer appears to 'jump'\n"
-"                       to the other display screen.  Thus it emulates what a\n"
-"                       single X server would do for two screens (e.g. :0.0 and\n"
-"                       :0.1) The illusion of a single Xserver with multiple\n"
-"                       screens is achieved by forwarding events to the 2nd\n"
-"                       one via the XTEST extension.\n"
-"\n"
-"                       What the x11vnc bcx_xattach command does is to perform\n"
-"                       some pointer movements to try to INDUCE xattach/x2x\n"
-"                       to 'jump' to the other display.  In what follows the\n"
-"                       'master' display refers to the one that when it has\n"
-"                       'focus' it is basically doing nothing besides watching\n"
-"                       for the mouse to go over an edge.  The 'slave'\n"
-"                       display refers to the one to which the mouse and\n"
-"                       keyboard is redirected to once an edge in the master\n"
-"                       has been crossed.  Note that the x11vnc executing the\n"
-"                       bcx_xattach command MUST be the one connected to the\n"
-"                       *master* display.\n"
-"\n"
-"                       Also note that when input is being redirected (via\n"
-"                       XTEST) from the master display to the slave display,\n"
-"                       the master display's pointer and keyboard are *grabbed*\n"
-"                       by xattach/x2x.  x11vnc can use this info to verify that\n"
-"                       the master/slave mode change has taken place correctly.\n"
-"                       If you specify the \"ifneeded\" option (see below)\n"
-"                       and the initial grab state is that of the desired\n"
-"                       final state, then no pointer movements are injected\n"
-"                       and \"DONE,GRAB_OK\" is returned.\n"
-"\n"
-"                       \"str\" must contain one of \"up\", \"down\", \"left\",\n"
-"                       or \"right\" to indicate the direction of the 'jump'.\n"
-"                       \"str\" must also contain one of \"master_to_slave\"\n"
-"                       or \"slave_to_master\" to indicate the type of mode\n"
-"                       change induced by the jump.  Use \"M2S\" and \"S2M\"\n"
-"                       as shorter aliases.\n"
-"\n"
-"                       \"str\" may be a \"+\" separated list of additional\n"
-"                       tuning options.  The \"shift=n\" option indicates an\n"
-"                       offset shift position away from (0,0) (default 20).\n"
-"                       \"final=x+y\" specifies the final position of the cursor\n"
-"                       at the end of the normal move sequence; default 30+30.\n"
-"                       \"extra_move=x+y\" means to do one more pointer move\n"
-"                       after \"final\" to x+y.  \"dt=n\" sets the sleep time\n"
-"                       in milliseconds between pointer moves (default: 40ms)\n"
-"                       \"retry=n\" specifies the maximum number of retries if\n"
-"                       the grab state change fails. \"ifneeded\" means to not\n"
-"                       apply the pointer movements if the initial grab state is\n"
-"                       that of the desired final state. \"nograbcheck\" means\n"
-"                       to not check if the grab state changed as expected and\n"
-"                       only apply the pointer movements (default is to check\n"
-"                       the grab states.)\n"
-"\n"
-"                       If you do not specify \"up\", etc., to bcx_xattach\n"
-"                       nothing will be attempted and the command returns\n"
-"                       the string FAIL,NO_DIRECTION_SPECIFIED.  If you do\n"
-"                       not specify \"master_to_slave\" or \"M2S\", etc., to\n"
-"                       bcx_xattach nothing will be attempted and the command\n"
-"                       returns the string FAIL,NO_MODE_CHANGE_SPECIFIED.\n"
-"\n"
-"                       Otherwise, the returned string will contain \"DONE\".\n"
-"                       It will be \"DONE,GRAB_OK\" if the grab state changed\n"
-"                       as expected (or if \"ifneeded\" was supplied and\n"
-"                       the initial grab state was already the desired\n"
-"                       one.)  If the initial grab state was incorrect,\n"
-"                       but the final grab state was correct then it is\n"
-"                       \"DONE,GRAB_FAIL_INIT\".  If the initial grab state\n"
-"                       was correct, but the final grab state was incorrect\n"
-"                       then it is \"DONE,GRAB_FAIL_FINAL\".  If both are\n"
-"                       incorrect it will be \"DONE,GRAB_FAIL\".  Under grab\n"
-"                       failure the string will be followed by \":p1,k1-p2,k2\"\n"
-"                       where  p1,k1 indicates the initial pointer and keyboard\n"
-"                       grab states and p2,k2 the final ones. If GRAB_FAIL or\n"
-"                       GRAB_FAIL_FINAL occurs, the action will be retried up\n"
-"                       to 3 times; trying to reset the state and sleeping a\n"
-"                       bit between each try.  Set retry=n to adjust the number\n"
-"                       of retries, zero to disable retries.\n"
-"\n"
-"                       Examples:\n"
-"                           -R bcx_xattach:down+M2S\n"
-"                           -R bcx_xattach:up+S2M\n"
-"                           -R bcx_xattach:up+S2M+nograbcheck+dt=30\n"
-"                           -R bcx_xattach:down+M2S+extra_move=100+100\n"
-"\n"
-"                       or use -Q instead of -R to retrieve the result text.\n"
-"\n"
-"                       End of the bcx_xattach:str description.\n"
-"\n"
-"                       The vncconnect(1) command from standard VNC\n"
-"                       distributions may also be used if string is prefixed\n"
-"                       with \"cmd=\" E.g. 'vncconnect cmd=stop'.  Under some\n"
-"                       circumstances xprop(1) can used if it supports -set\n"
-"                       (see the FAQ).\n"
-"\n"
-"                       If \"-connect /path/to/file\" has been supplied to the\n"
-"                       running x11vnc server then that file can be used as a\n"
-"                       communication channel (this is the only way to remote\n"
-"                       control one of many x11vnc's polling the same X display)\n"
-"                       Simply run: 'x11vnc -connect /path/to/file -remote ...'\n"
-"                       or you can directly write to the file via something\n"
-"                       like: \"echo cmd=stop > /path/to/file\", etc.\n"
-"\n"
-"-query variable        Like -remote, except just query the value of\n"
-"                       \"variable\".  \"-Q\" is an alias for \"-query\".\n"
-"                       Multiple queries can be done by separating variables\n"
-"                       by commas, e.g. -query var1,var2. The results come\n"
-"                       back in the form ans=var1:value1,ans=var2:value2,...\n"
-"                       to the standard output.  If a variable is read-only,\n"
-"                       it comes back with prefix \"aro=\" instead of \"ans=\".\n"
-"\n"
-"                       Some -remote commands are pure actions that do not make\n"
-"                       sense as variables, e.g. \"stop\" or \"disconnect\", in\n"
-"                       these cases the value returned is \"N/A\".  To direct a\n"
-"                       query straight to the X11VNC_REMOTE property or connect\n"
-"                       file use \"qry=...\" instead of \"cmd=...\"\n"
-"\n"
-"                       ans= stop quit exit shutdown ping resend_cutbuffer\n"
-"                       resend_clipboard resend_primary blacken zero refresh\n"
-"                       reset close disconnect id_cmd id sid waitmapped\n"
-"                       nowaitmapped clip flashcmap noflashcmap shiftcmap\n"
-"                       truecolor notruecolor overlay nooverlay overlay_cursor\n"
-"                       overlay_yescursor nooverlay_nocursor nooverlay_cursor\n"
-"                       nooverlay_yescursor overlay_nocursor 8to24 no8to24\n"
-"                       8to24_opts 24to32 no24to32 visual scale scale_cursor\n"
-"                       viewonly noviewonly shared noshared forever noforever\n"
-"                       once timeout tightfilexfer notightfilexfer ultrafilexfer\n"
-"                       noultrafilexfer rfbversion deny lock nodeny unlock avahi\n"
-"                       mdns zeroconf noavahi nomdns nozeroconf connect proxy\n"
-"                       allowonce allow noipv6 ipv6 noipv4 ipv4 no6 6 localhost\n"
-"                       nolocalhost listen lookup nolookup accept afteraccept\n"
-"                       gone shm noshm flipbyteorder noflipbyteorder onetile\n"
-"                       noonetile solid_color solid nosolid blackout xinerama\n"
-"                       noxinerama xtrap noxtrap xrandr noxrandr xrandr_mode\n"
-"                       rotate padgeom quiet q noquiet modtweak nomodtweak xkb\n"
-"                       noxkb capslock nocapslock skip_lockkeys noskip_lockkeys\n"
-"                       skip_keycodes sloppy_keys nosloppy_keys skip_dups\n"
-"                       noskip_dups add_keysyms noadd_keysyms clear_mods\n"
-"                       noclear_mods clear_keys noclear_keys clear_all\n"
-"                       clear_locks keystate remap repeat norepeat fb nofb bell\n"
-"                       nobell sendbell sel nosel primary noprimary setprimary\n"
-"                       nosetprimary clipboard noclipboard setclipboard\n"
-"                       nosetclipboard seldir cursorshape nocursorshape\n"
-"                       cursorpos nocursorpos cursor_drag nocursor_drag cursor\n"
-"                       show_cursor noshow_cursor nocursor arrow xfixes noxfixes\n"
-"                       xdamage noxdamage xd_area xd_mem alphacut alphafrac\n"
-"                       alpharemove noalpharemove alphablend noalphablend\n"
-"                       xwarppointer xwarp noxwarppointer noxwarp always_inject\n"
-"                       noalways_inject buttonmap dragging nodragging ncache_cr\n"
-"                       noncache_cr ncache_no_moveraise noncache_no_moveraise\n"
-"                       ncache_no_dtchange noncache_no_dtchange\n"
-"                       ncache_no_rootpixmap noncache_no_rootpixmap\n"
-"                       ncache_reset_rootpixmap ncrp ncache_keep_anims\n"
-"                       noncache_keep_anims ncache_old_wm noncache_old_wm\n"
-"                       ncache_pad ncache noncache ncache_size debug_ncache\n"
-"                       nodebug_ncache wireframe_mode wireframe wf nowireframe\n"
-"                       nowf wireframelocal wfl nowireframelocal nowfl\n"
-"                       wirecopyrect wcr nowirecopyrect nowcr scr_area\n"
-"                       scr_skip scr_inc scr_keys scr_term scr_keyrepeat\n"
-"                       scr_parms scrollcopyrect scr noscrollcopyrect\n"
-"                       noscr fixscreen noxrecord xrecord reset_record\n"
-"                       pointer_mode pm input_skip allinput noallinput\n"
-"                       input_eagerly noinput_eagerly input grabkbd nograbkbd\n"
-"                       grabptr nograbptr grabalways nograbalways grablocal\n"
-"                       client_input ssltimeout speeds wmdt debug_pointer dp\n"
-"                       nodebug_pointer nodp debug_keyboard dk nodebug_keyboard\n"
-"                       nodk keycode keysym ptr fakebuttonevent sleep get_xprop\n"
-"                       set_xprop wininfo bcx_xattach deferupdate defer\n"
-"                       setdefer extra_fbur wait_ui wait_bog nowait_bog\n"
-"                       slow_fb xrefresh wait readtimeout nap nonap sb\n"
-"                       screen_blank fbpm nofbpm dpms nodpms clientdpms\n"
-"                       noclientdpms forcedpms noforcedpms noserverdpms\n"
-"                       serverdpms noultraext ultraext chatwindow nochatwindow\n"
-"                       chaton chatoff fs gaps grow fuzz snapfb nosnapfb\n"
-"                       rawfb uinput_accel uinput_thresh uinput_reset\n"
-"                       uinput_always progressive rfbport http nohttp httpport\n"
-"                       httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
-"                       noalwaysshared nevershared noalwaysshared dontdisconnect\n"
-"                       nodontdisconnect desktop debug_xevents nodebug_xevents\n"
-"                       debug_xevents debug_xdamage nodebug_xdamage\n"
-"                       debug_xdamage debug_wireframe nodebug_wireframe\n"
-"                       debug_wireframe debug_scroll nodebug_scroll debug_scroll\n"
-"                       debug_tiles dbt nodebug_tiles nodbt debug_tiles\n"
-"                       debug_grabs nodebug_grabs debug_sel nodebug_sel dbg\n"
-"                       nodbg macnosaver macsaver nomacnosaver macnowait macwait\n"
-"                       nomacnowait macwheel macnoswap macswap nomacnoswap\n"
-"                       macnoresize macresize nomacnoresize maciconanim macmenu\n"
-"                       macnomenu nomacmenu macuskbd nomacuskbd noremote\n"
-"\n"
-"                       aro=  noop display vncdisplay icon_mode autoport\n"
-"                       loop loopbg desktopname guess_desktop guess_dbus\n"
-"                       http_url auth xauth users rootshift clipshift scale_str\n"
-"                       scaled_x scaled_y scale_numer scale_denom scale_fac_x\n"
-"                       scale_fac_y scaling_blend scaling_nomult4 scaling_pad\n"
-"                       scaling_interpolate inetd privremote unsafe safer nocmds\n"
-"                       passwdfile unixpw unixpw_nis unixpw_list ssl ssl_pem\n"
-"                       sslverify stunnel stunnel_pem https httpsredir usepw\n"
-"                       using_shm logfile o flag rmflag rc norc h help V version\n"
-"                       lastmod bg sigpipe threads readrate netrate netlatency\n"
-"                       pipeinput clients client_count pid ext_xtest ext_xtrap\n"
-"                       ext_xrecord ext_xkb ext_xshm ext_xinerama ext_overlay\n"
-"                       ext_xfixes ext_xdamage ext_xrandr rootwin num_buttons\n"
-"                       button_mask mouse_x mouse_y grab_state pointer_pos\n"
-"                       pointer_x pointer_y pointer_same pointer_root\n"
-"                       pointer_mask bpp depth indexed_color dpy_x dpy_y wdpy_x\n"
-"                       wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth\n"
-"                       passwd viewpasswd\n"
-"\n"
-"-QD variable           Just like -query variable, but returns the default\n"
-"                       value for that parameter (no running x11vnc server\n"
-"                       is consulted)\n"
-"\n"
-"-sync                  By default -remote commands are run asynchronously, that\n"
-"                       is, the request is posted and the program immediately\n"
-"                       exits.  Use -sync to have the program wait for an\n"
-"                       acknowledgement from the x11vnc server that command was\n"
-"                       processed (somehow).  On the other hand -query requests\n"
-"                       are always processed synchronously because they have\n"
-"                       to wait for the answer.\n"
-"\n"
-"                       Also note that if both -remote and -query requests are\n"
-"                       supplied on the command line, the -remote is processed\n"
-"                       first (synchronously: no need for -sync), and then\n"
-"                       the -query request is processed in the normal way.\n"
-"                       This allows for a reliable way to see if the -remote\n"
-"                       command was processed by querying for any new settings.\n"
-"                       Note however that there is timeout of a few seconds\n"
-"                       (see the next paragraph) so if the x11vnc takes longer\n"
-"                       than that to process the requests the requester will\n"
-"                       think that a failure has taken place.\n"
-"\n"
-"                       The default is to wait 3.5 seconds.  Or if cmd=stop\n"
-"                       only 1.0 seconds.  If cmd matches 'script:' then it\n"
-"                       will wait up to 10.0 seconds.  Set X11VNC_SYNC_TIMEOUT\n"
-"                       to the number of seconds you want it to wait.\n"
-"\n"
-"-query_retries str     If a query fails to get a response from an x11vnc\n"
-"                       server, retry up to n times.  \"str\" is specified as\n"
-"                       n[:t][/match]  Optionally the delay between tries may\n"
-"                       be specified by \"t\" a floating point time (default\n"
-"                       0.5 seconds.)  Note: the response is not checked for\n"
-"                       validity or whether it corresponds to the query sent.\n"
-"                       The query \"ping:mystring\" may be used to help uniquely\n"
-"                       identify the query.  Optionally, a matching string after\n"
-"                       a \"/\" will be used to check the result text.  Up to\n"
-"                       n retries will take place until the matching string is\n"
-"                       found in the output text.  If the match string is never\n"
-"                       found the program's exit code is 1; if the match is\n"
-"                       found it exits with 0.  Note that there may be stdout\n"
-"                       printed for each retry (i.e. multiple lines printed\n"
-"                       out to stdout.)\n"
-"                       Example: -query_retries 4:1.5/grab_state\n"
-"\n"
-"-remote_prefix str     Enable a remote-control communication channel for\n"
-"                       connected VNC clients.  str is a non-empty string. If a\n"
-"                       VNC client sends rfbCutText having the prefix \"str\"\n"
-"                       then the part after it is processed as though it were\n"
-"                       sent via 'x11vnc -remote ...'.  If it begins with\n"
-"                       neither 'cmd=' nor 'qry=' then 'qry=' is assumed.\n"
-"                       Any corresponding output text for that remote control\n"
-"                       command is sent back to all client as rfbCutText.\n"
-"                       The returned output is also prefixed with \"str\".\n"
-"                       Example: -remote_prefix DO_THIS:\n"
-"\n"
-"                       Note that enabling -remote_prefix allows the remote\n"
-"                       VNC viewers to run x11vnc -remote commands.  Do not\n"
-"                       use this option if they are not to be trusted.\n"
-"\n"
-"-noremote              Do not process any remote control commands or queries.\n"
-"-yesremote             Do process remote control commands or queries.\n"
-"                       Default: %s\n"
-"\n"
-"                       A note about security wrt remote control commands.\n"
-"                       If someone can connect to the X display and change\n"
-"                       the property X11VNC_REMOTE, then they can remotely\n"
-"                       control x11vnc.  Normally access to the X display is\n"
-"                       protected.  Note that if they can modify X11VNC_REMOTE\n"
-"                       on the X server, they have enough permissions to also\n"
-"                       run their own x11vnc and thus have complete control\n"
-"                       of the desktop.  If the  \"-connect /path/to/file\"\n"
-"                       channel is being used, obviously anyone who can write\n"
-"                       to /path/to/file can remotely control x11vnc.  So be\n"
-"                       sure to protect the X display and that file's write\n"
-"                       permissions.  See -privremote below.\n"
-"\n"
-"                       If you are paranoid and do not think -noremote is\n"
-"                       enough, to disable the X11VNC_REMOTE property channel\n"
-"                       completely use -novncconnect, or use the -safer option\n"
-"                       that shuts many things off.\n"
-"\n"
-"-unsafe                A few remote commands are disabled by default\n"
-"                       (currently: id:pick, accept:<cmd>, gone:<cmd>, and\n"
-"                       rawfb:setup:<cmd>) because they are associated with\n"
-"                       running external programs.  If you specify -unsafe, then\n"
-"                       these remote-control commands are allowed.  Note that\n"
-"                       you can still specify these parameters on the command\n"
-"                       line, they just cannot be invoked via remote-control.\n"
-"-safer                 Equivalent to: -novncconnect -noremote and prohibiting\n"
-"                       -gui and the -connect file. Shuts off communcation\n"
-"                       channels.\n"
-"-privremote            Perform some sanity checks and disable remote-control\n"
-"                       commands if it appears that the X DISPLAY and/or\n"
-"                       connectfile can be accessed by other users.  Once\n"
-"                       remote-control is disabled it cannot be turned back on.\n"
-"-nocmds                No external commands (e.g. system(3), popen(3), exec(3))\n"
-"                       will be run at all.\n"
-"-allowedcmds list      \"list\" contains a comma separated list of the only\n"
-"                       external commands that can be run.  The full list of\n"
-"                       associated options is:\n"
-"\n"
-"                        stunnel, ssl, unixpw, WAIT, zeroconf, id, accept,\n"
-"                        afteraccept, gone, pipeinput, v4l-info, rawfb-setup,\n"
-"                        dt, gui, ssh, storepasswd, passwdfile, custom_passwd,\n"
-"                        findauth, crash.\n"
-"\n"
-"                       See each option's help to learn the associated external\n"
-"                       command.  Note that the -nocmds option takes precedence\n"
-"                       and disables all external commands.\n"
-"\n"
-"-deny_all              For use with -remote nodeny: start out denying all\n"
-"                       incoming clients until \"-remote nodeny\" is used to\n"
-"                       let them in.\n"
-"\n"
-"%s\n"
-"\n"
-"These options are passed to LibVNCServer:\n"
-"\n"
-;
-	/* have both our help and rfbUsage to stdout for more(1), etc. */
-	dup2(1, 2);
-
-	/* register extension(s) to get their help output */
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-	rfbRegisterTightVNCFileTransferExtension();
-#endif
-
-	if (mode == 1) {
-		char *p;	
-		int l = 0;
-		fprintf(stderr, "x11vnc: allow VNC connections to real "
-		    "X11 displays. %s\n\nx11vnc options:\n", lastmod);
-		p = strtok(help, "\n");
-		while (p) {
-			int w = 23;
-			char tmp[100];
-			if (p[0] == '-') {
-				memset(tmp, 0, sizeof(tmp));
-				strncpy(tmp, p, w);
-				fprintf(stderr, "  %s", tmp);
-				l++;
-				if (l % 3 == 0) {
-					fprintf(stderr, "\n");
-				}
-			}
-			p = strtok(NULL, "\n");
-		}
-		fprintf(stderr, "\n\nLibVNCServer options:\n");
-		rfbUsage();
-		fprintf(stderr, "\n");
-		exit(1);
-	}
-#if 1
-	fprintf(stderr, help, lastmod,
-		POLL_8TO24_DELAY,
-		scaling_copyrect ? ":cr":":nocr",
-		view_only ? "on":"off",
-		shared ? "on":"off",
-		vnc_connect ? "-vncconnect":"-novncconnect",
-		xinerama ? "-xinerama":"-noxinerama",
-		use_modifier_tweak ? "-modtweak":"-nomodtweak",
-		skip_duplicate_key_events ? "-skip_dups":"-noskip_dups",
-		add_keysyms ? "-add_keysyms":"-noadd_keysyms",
-		no_autorepeat ? "-norepeat":"-repeat",
-		alt_arrow_max, alt_arrow,
-		alpha_threshold,
-		alpha_frac,
-		cursor_pos_updates ? "-cursorpos":"-nocursorpos",
-		wireframe ? "-wireframe":"-nowireframe",
-		WIREFRAME_PARMS,
-		wireframe_copyrect_default,
-		scroll_copyrect_default,
-		scrollcopyrect_min_area,
-		scroll_skip_str0 ? scroll_skip_str0 : "(empty)",
-		scroll_term_str0,
-		max_keyrepeat_str0,
-		SCROLL_COPYRECT_PARMS,
-		pointer_mode_max, pointer_mode,
-		ui_skip,
-		defer_update,
-		waitms,
-		wait_ui,
-		take_naps ? "take naps":"no naps",
-		screen_blank,
-		rfbMaxClientWait/1000,
-		watch_fbpm ? "-nofbpm":"-fbpm",
-		watch_dpms ? "-nodpms":"-dpms",
-		xdamage_max_area, NSCAN, xdamage_memory,
-		use_threads ? "-threads":"-nothreads",
-		fs_frac,
-		gaps_fill,
-		grow_fill,
-		tile_fuzz,
-		accept_remote_cmds ? "-yesremote":"-noremote",
-		""
-	);
-#else
-	fprintf(stderr, "%s", help);
-#endif
-
-	rfbUsage();
-#endif
-	exit(1);
-}
-
-void xopen_display_fail_message(char *disp) {
-	fprintf(stderr, "\n");
-	fprintf(stderr, "*** x11vnc was unable to open the X DISPLAY: \"%s\","
-	    " it cannot continue.\n", disp);
-	fprintf(stderr, "*** There may be \"Xlib:\" error messages above"
-	    " with details about the failure.\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "Some tips and guidelines:\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "** An X server (the one you wish to view) must"
-	    " be running before x11vnc is\n");
-	fprintf(stderr, "   started: x11vnc does not start the X server.  "
-	    "(however, see the -create\n");
-	fprintf(stderr, "   option if that is what you really want).\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "** You must use -display <disp>, -OR- set and"
-	    " export your $DISPLAY\n");
-	fprintf(stderr, "   environment variable to refer to the display of"
-	    " the desired X server.\n");
-	fprintf(stderr, " - Usually the display is simply \":0\" (in fact"
-	    " x11vnc uses this if you forget\n");
-	fprintf(stderr, "   to specify it), but in some multi-user"
-	    " situations it could be \":1\", \":2\",\n"); 
-	fprintf(stderr, "   or even \":137\".  Ask your administrator"
-	    " or a guru if you are having\n");
-	fprintf(stderr, "   difficulty determining what your X DISPLAY is.\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "** Next, you need to have sufficient permissions"
-	    " (Xauthority) \n");
-	fprintf(stderr, "   to connect to the X DISPLAY.   Here are some"
-	    " Tips:\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, " - Often, you just need to run x11vnc as the user"
-	    " logged into the X session.\n");
-	fprintf(stderr, "   So make sure to be that user when you type"
-	    " x11vnc.\n");
-	fprintf(stderr, " - Being root is usually not enough because the"
-	    " incorrect MIT-MAGIC-COOKIE\n");
-	fprintf(stderr, "   file may be accessed.  The cookie file contains"
-	    " the secret key that\n");
-	fprintf(stderr, "   allows x11vnc to connect to the desired"
-	    " X DISPLAY.\n");
-	fprintf(stderr, " - You can explicitly indicate which MIT-MAGIC-COOKIE"
-	    " file should be used\n");
-	fprintf(stderr, "   by the -auth option, e.g.:\n");
-	fprintf(stderr, "       x11vnc -auth /home/someuser/.Xauthority"
-	    " -display :0\n");
-	fprintf(stderr, "       x11vnc -auth /tmp/.gdmzndVlR"
-	    " -display :0\n");
-	fprintf(stderr, "   you must have read permission for the auth file.\n");
-	fprintf(stderr, "   See also '-auth guess' and '-findauth' discussed below.\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "** If NO ONE is logged into an X session yet, but"
-	    " there is a greeter login\n");
-	fprintf(stderr, "   program like \"gdm\", \"kdm\", \"xdm\", or"
-	    " \"dtlogin\" running, you will need\n");
-	fprintf(stderr, "   to find and use the raw display manager"
-	    " MIT-MAGIC-COOKIE file.\n");
-	fprintf(stderr, "   Some examples for various display managers:\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "     gdm:     -auth /var/gdm/:0.Xauth\n");
-	fprintf(stderr, "              -auth /var/lib/gdm/:0.Xauth\n");
-	fprintf(stderr, "     kdm:     -auth /var/lib/kdm/A:0-crWk72\n");
-	fprintf(stderr, "              -auth /var/run/xauth/A:0-crWk72\n");
-	fprintf(stderr, "     xdm:     -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk\n");
-	fprintf(stderr, "     dtlogin: -auth /var/dt/A:0-UgaaXa\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "   Sometimes the command \"ps wwwwaux | grep auth\""
-	    " can reveal the file location.\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "   Starting with x11vnc 0.9.9 you can have it try to guess by using:\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "              -auth guess\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "   (see also the x11vnc -findauth option.)\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "   Only root will have read permission for the"
-	    " file, and so x11vnc must be run\n");
-	fprintf(stderr, "   as root (or copy it).  The random characters in the filenames"
-	    " will of course\n");
-	fprintf(stderr, "   change and the directory the cookie file resides in"
-	    " is system dependent.\n");
-	fprintf(stderr, "\n");
-	fprintf(stderr, "See also: http://www.karlrunge.com/x11vnc/faq.html\n");
-}
-
-void nopassword_warning_msg(int gotloc) {
-
-	char str1[] =
-"###############################################################\n"
-"#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#\n"
-"#@                                                           @#\n"
-"#@  **  WARNING  **  WARNING  **  WARNING  **  WARNING  **   @#\n"
-"#@                                                           @#\n"
-"#@        YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!!        @#\n"
-"#@                                                           @#\n"
-"#@  This means anyone with network access to this computer   @#\n"
-"#@  may be able to view and control your desktop.            @#\n"
-"#@                                                           @#\n"
-"#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#\n"
-"#@                                                           @#\n"
-"#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#\n"
-;
-	char str2[] =
-"#@                                                           @#\n"
-"#@  You can create an x11vnc password file by running:       @#\n"
-"#@                                                           @#\n"
-"#@       x11vnc -storepasswd password /path/to/passfile      @#\n"
-"#@  or   x11vnc -storepasswd /path/to/passfile               @#\n"
-"#@  or   x11vnc -storepasswd                                 @#\n"
-"#@                                                           @#\n"
-"#@  (the last one will use ~/.vnc/passwd)                    @#\n"
-"#@                                                           @#\n"
-"#@  and then starting x11vnc via:                            @#\n"
-"#@                                                           @#\n"
-"#@      x11vnc -rfbauth /path/to/passfile                    @#\n"
-"#@                                                           @#\n"
-"#@  an existing ~/.vnc/passwd file from another VNC          @#\n"
-"#@  application will work fine too.                          @#\n"
-"#@                                                           @#\n"
-"#@  You can also use the -passwdfile or -passwd options.     @#\n"
-"#@  (note -passwd is unsafe if local users are not trusted)  @#\n"
-"#@                                                           @#\n"
-"#@  Make sure any -rfbauth and -passwdfile password files    @#\n"
-"#@  cannot be read by untrusted users.                       @#\n"
-"#@                                                           @#\n"
-"#@  Use x11vnc -usepw to automatically use your              @#\n"
-"#@  ~/.vnc/passwd or ~/.vnc/passwdfile password files.       @#\n"
-"#@  (and prompt you to create ~/.vnc/passwd if neither       @#\n"
-"#@  file exists.)  Under -usepw, x11vnc will exit if it      @#\n"
-"#@  cannot find a password to use.                           @#\n"
-"#@                                                           @#\n"
-"#@                                                           @#\n"
-"#@  Even with a password, the subsequent VNC traffic is      @#\n"
-"#@  sent in the clear.  Consider tunnelling via ssh(1):      @#\n"
-"#@                                                           @#\n"
-"#@    http://www.karlrunge.com/x11vnc/#tunnelling            @#\n"
-"#@                                                           @#\n"
-"#@  Or using the x11vnc SSL options: -ssl and -stunnel       @#\n"
-"#@                                                           @#\n"
-"#@  Please Read the documention for more info about          @#\n"
-"#@  passwords, security, and encryption.                     @#\n"
-"#@                                                           @#\n"
-"#@    http://www.karlrunge.com/x11vnc/faq.html#faq-passwd    @#\n"
-;
-	char str3[] =
-"#@                                                           @#\n"
-"#@  You are using the -localhost option and that is a good   @#\n"
-"#@  thing!! Especially if you ssh(1) into this machine and   @#\n"
-"#@  use port redirection.  Nevertheless, without a password  @#\n"
-"#@  other users could possibly do redirection as well to     @#\n"
-"#@  gain access to your desktop.                             @#\n"
-;
-	char str4[] =
-"#@                                                           @#\n"
-"#@  To disable this warning use the -nopw option, or put     @#\n"
-"#@  'nopw' on a line in your ~/.x11vncrc file.               @#\n"
-"#@                                                           @#\n"
-"#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#\n"
-"###############################################################\n"
-;
-	char str5[] =
-"###############################################################\n\n"
-;
-	if (inetd) {
-		return;
-	}
-
-	fprintf(stderr, "%s", str1);
-	fflush(stderr);
-#if !PASSWD_REQUIRED
-	usleep(750 * 1000);
-#endif
-	if (!quiet) {
-		fprintf(stderr, "%s", str2);
-		if (gotloc) {
-			fprintf(stderr, "%s", str3);
-		}
-		fprintf(stderr, "%s", str4);
-	} else {
-		fprintf(stderr, "%s", str5);
-	}
-	fflush(stderr);
-#if !PASSWD_REQUIRED
-	usleep(250 * 1000);
-#endif
-}
-
-void print_license(void) {
-	char license[] = 
-#if !SKIP_HELP
-"		    GNU GENERAL PUBLIC LICENSE\n"
-"		       Version 2, June 1991\n"
-"\n"
-" Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n"
-"                          59 Temple Place - Suite 330, Boston, MA\n"
-"                          02111-1307, USA.\n"
-" Everyone is permitted to copy and distribute verbatim copies\n"
-" of this license document, but changing it is not allowed.\n"
-"\n"
-"			    Preamble\n"
-"\n"
-"  The licenses for most software are designed to take away your\n"
-"freedom to share and change it.  By contrast, the GNU General Public\n"
-"License is intended to guarantee your freedom to share and change free\n"
-"software--to make sure the software is free for all its users.  This\n"
-"General Public License applies to most of the Free Software\n"
-"Foundation's software and to any other program whose authors commit to\n"
-"using it.  (Some other Free Software Foundation software is covered by\n"
-"the GNU Library General Public License instead.)  You can apply it to\n"
-"your programs, too.\n"
-"\n"
-"  When we speak of free software, we are referring to freedom, not\n"
-"price.  Our General Public Licenses are designed to make sure that you\n"
-"have the freedom to distribute copies of free software (and charge for\n"
-"this service if you wish), that you receive source code or can get it\n"
-"if you want it, that you can change the software or use pieces of it\n"
-"in new free programs; and that you know you can do these things.\n"
-"\n"
-"  To protect your rights, we need to make restrictions that forbid\n"
-"anyone to deny you these rights or to ask you to surrender the rights.\n"
-"These restrictions translate to certain responsibilities for you if you\n"
-"distribute copies of the software, or if you modify it.\n"
-"\n"
-"  For example, if you distribute copies of such a program, whether\n"
-"gratis or for a fee, you must give the recipients all the rights that\n"
-"you have.  You must make sure that they, too, receive or can get the\n"
-"source code.  And you must show them these terms so they know their\n"
-"rights.\n"
-"\n"
-"  We protect your rights with two steps: (1) copyright the software, and\n"
-"(2) offer you this license which gives you legal permission to copy,\n"
-"distribute and/or modify the software.\n"
-"\n"
-"  Also, for each author's protection and ours, we want to make certain\n"
-"that everyone understands that there is no warranty for this free\n"
-"software.  If the software is modified by someone else and passed on, we\n"
-"want its recipients to know that what they have is not the original, so\n"
-"that any problems introduced by others will not reflect on the original\n"
-"authors' reputations.\n"
-"\n"
-"  Finally, any free program is threatened constantly by software\n"
-"patents.  We wish to avoid the danger that redistributors of a free\n"
-"program will individually obtain patent licenses, in effect making the\n"
-"program proprietary.  To prevent this, we have made it clear that any\n"
-"patent must be licensed for everyone's free use or not licensed at all.\n"
-"\n"
-"  The precise terms and conditions for copying, distribution and\n"
-"modification follow.\n"
-"
\n"
-"		    GNU GENERAL PUBLIC LICENSE\n"
-"   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"
-"\n"
-"  0. This License applies to any program or other work which contains\n"
-"a notice placed by the copyright holder saying it may be distributed\n"
-"under the terms of this General Public License.  The \"Program\", below,\n"
-"refers to any such program or work, and a \"work based on the Program\"\n"
-"means either the Program or any derivative work under copyright law:\n"
-"that is to say, a work containing the Program or a portion of it,\n"
-"either verbatim or with modifications and/or translated into another\n"
-"language.  (Hereinafter, translation is included without limitation in\n"
-"the term \"modification\".)  Each licensee is addressed as \"you\".\n"
-"\n"
-"Activities other than copying, distribution and modification are not\n"
-"covered by this License; they are outside its scope.  The act of\n"
-"running the Program is not restricted, and the output from the Program\n"
-"is covered only if its contents constitute a work based on the\n"
-"Program (independent of having been made by running the Program).\n"
-"Whether that is true depends on what the Program does.\n"
-"\n"
-"  1. You may copy and distribute verbatim copies of the Program's\n"
-"source code as you receive it, in any medium, provided that you\n"
-"conspicuously and appropriately publish on each copy an appropriate\n"
-"copyright notice and disclaimer of warranty; keep intact all the\n"
-"notices that refer to this License and to the absence of any warranty;\n"
-"and give any other recipients of the Program a copy of this License\n"
-"along with the Program.\n"
-"\n"
-"You may charge a fee for the physical act of transferring a copy, and\n"
-"you may at your option offer warranty protection in exchange for a fee.\n"
-"\n"
-"  2. You may modify your copy or copies of the Program or any portion\n"
-"of it, thus forming a work based on the Program, and copy and\n"
-"distribute such modifications or work under the terms of Section 1\n"
-"above, provided that you also meet all of these conditions:\n"
-"\n"
-"    a) You must cause the modified files to carry prominent notices\n"
-"    stating that you changed the files and the date of any change.\n"
-"\n"
-"    b) You must cause any work that you distribute or publish, that in\n"
-"    whole or in part contains or is derived from the Program or any\n"
-"    part thereof, to be licensed as a whole at no charge to all third\n"
-"    parties under the terms of this License.\n"
-"\n"
-"    c) If the modified program normally reads commands interactively\n"
-"    when run, you must cause it, when started running for such\n"
-"    interactive use in the most ordinary way, to print or display an\n"
-"    announcement including an appropriate copyright notice and a\n"
-"    notice that there is no warranty (or else, saying that you provide\n"
-"    a warranty) and that users may redistribute the program under\n"
-"    these conditions, and telling the user how to view a copy of this\n"
-"    License.  (Exception: if the Program itself is interactive but\n"
-"    does not normally print such an announcement, your work based on\n"
-"    the Program is not required to print an announcement.)\n"
-"
\n"
-"These requirements apply to the modified work as a whole.  If\n"
-"identifiable sections of that work are not derived from the Program,\n"
-"and can be reasonably considered independent and separate works in\n"
-"themselves, then this License, and its terms, do not apply to those\n"
-"sections when you distribute them as separate works.  But when you\n"
-"distribute the same sections as part of a whole which is a work based\n"
-"on the Program, the distribution of the whole must be on the terms of\n"
-"this License, whose permissions for other licensees extend to the\n"
-"entire whole, and thus to each and every part regardless of who wrote it.\n"
-"\n"
-"Thus, it is not the intent of this section to claim rights or contest\n"
-"your rights to work written entirely by you; rather, the intent is to\n"
-"exercise the right to control the distribution of derivative or\n"
-"collective works based on the Program.\n"
-"\n"
-"In addition, mere aggregation of another work not based on the Program\n"
-"with the Program (or with a work based on the Program) on a volume of\n"
-"a storage or distribution medium does not bring the other work under\n"
-"the scope of this License.\n"
-"\n"
-"  3. You may copy and distribute the Program (or a work based on it,\n"
-"under Section 2) in object code or executable form under the terms of\n"
-"Sections 1 and 2 above provided that you also do one of the following:\n"
-"\n"
-"    a) Accompany it with the complete corresponding machine-readable\n"
-"    source code, which must be distributed under the terms of Sections\n"
-"    1 and 2 above on a medium customarily used for software interchange; or,\n"
-"\n"
-"    b) Accompany it with a written offer, valid for at least three\n"
-"    years, to give any third party, for a charge no more than your\n"
-"    cost of physically performing source distribution, a complete\n"
-"    machine-readable copy of the corresponding source code, to be\n"
-"    distributed under the terms of Sections 1 and 2 above on a medium\n"
-"    customarily used for software interchange; or,\n"
-"\n"
-"    c) Accompany it with the information you received as to the offer\n"
-"    to distribute corresponding source code.  (This alternative is\n"
-"    allowed only for noncommercial distribution and only if you\n"
-"    received the program in object code or executable form with such\n"
-"    an offer, in accord with Subsection b above.)\n"
-"\n"
-"The source code for a work means the preferred form of the work for\n"
-"making modifications to it.  For an executable work, complete source\n"
-"code means all the source code for all modules it contains, plus any\n"
-"associated interface definition files, plus the scripts used to\n"
-"control compilation and installation of the executable.  However, as a\n"
-"special exception, the source code distributed need not include\n"
-"anything that is normally distributed (in either source or binary\n"
-"form) with the major components (compiler, kernel, and so on) of the\n"
-"operating system on which the executable runs, unless that component\n"
-"itself accompanies the executable.\n"
-"\n"
-"If distribution of executable or object code is made by offering\n"
-"access to copy from a designated place, then offering equivalent\n"
-"access to copy the source code from the same place counts as\n"
-"distribution of the source code, even though third parties are not\n"
-"compelled to copy the source along with the object code.\n"
-"
\n"
-"  4. You may not copy, modify, sublicense, or distribute the Program\n"
-"except as expressly provided under this License.  Any attempt\n"
-"otherwise to copy, modify, sublicense or distribute the Program is\n"
-"void, and will automatically terminate your rights under this License.\n"
-"However, parties who have received copies, or rights, from you under\n"
-"this License will not have their licenses terminated so long as such\n"
-"parties remain in full compliance.\n"
-"\n"
-"  5. You are not required to accept this License, since you have not\n"
-"signed it.  However, nothing else grants you permission to modify or\n"
-"distribute the Program or its derivative works.  These actions are\n"
-"prohibited by law if you do not accept this License.  Therefore, by\n"
-"modifying or distributing the Program (or any work based on the\n"
-"Program), you indicate your acceptance of this License to do so, and\n"
-"all its terms and conditions for copying, distributing or modifying\n"
-"the Program or works based on it.\n"
-"\n"
-"  6. Each time you redistribute the Program (or any work based on the\n"
-"Program), the recipient automatically receives a license from the\n"
-"original licensor to copy, distribute or modify the Program subject to\n"
-"these terms and conditions.  You may not impose any further\n"
-"restrictions on the recipients' exercise of the rights granted herein.\n"
-"You are not responsible for enforcing compliance by third parties to\n"
-"this License.\n"
-"\n"
-"  7. If, as a consequence of a court judgment or allegation of patent\n"
-"infringement or for any other reason (not limited to patent issues),\n"
-"conditions are imposed on you (whether by court order, agreement or\n"
-"otherwise) that contradict the conditions of this License, they do not\n"
-"excuse you from the conditions of this License.  If you cannot\n"
-"distribute so as to satisfy simultaneously your obligations under this\n"
-"License and any other pertinent obligations, then as a consequence you\n"
-"may not distribute the Program at all.  For example, if a patent\n"
-"license would not permit royalty-free redistribution of the Program by\n"
-"all those who receive copies directly or indirectly through you, then\n"
-"the only way you could satisfy both it and this License would be to\n"
-"refrain entirely from distribution of the Program.\n"
-"\n"
-"If any portion of this section is held invalid or unenforceable under\n"
-"any particular circumstance, the balance of the section is intended to\n"
-"apply and the section as a whole is intended to apply in other\n"
-"circumstances.\n"
-"\n"
-"It is not the purpose of this section to induce you to infringe any\n"
-"patents or other property right claims or to contest validity of any\n"
-"such claims; this section has the sole purpose of protecting the\n"
-"integrity of the free software distribution system, which is\n"
-"implemented by public license practices.  Many people have made\n"
-"generous contributions to the wide range of software distributed\n"
-"through that system in reliance on consistent application of that\n"
-"system; it is up to the author/donor to decide if he or she is willing\n"
-"to distribute software through any other system and a licensee cannot\n"
-"impose that choice.\n"
-"\n"
-"This section is intended to make thoroughly clear what is believed to\n"
-"be a consequence of the rest of this License.\n"
-"
\n"
-"  8. If the distribution and/or use of the Program is restricted in\n"
-"certain countries either by patents or by copyrighted interfaces, the\n"
-"original copyright holder who places the Program under this License\n"
-"may add an explicit geographical distribution limitation excluding\n"
-"those countries, so that distribution is permitted only in or among\n"
-"countries not thus excluded.  In such case, this License incorporates\n"
-"the limitation as if written in the body of this License.\n"
-"\n"
-"  9. The Free Software Foundation may publish revised and/or new versions\n"
-"of the General Public License from time to time.  Such new versions will\n"
-"be similar in spirit to the present version, but may differ in detail to\n"
-"address new problems or concerns.\n"
-"\n"
-"Each version is given a distinguishing version number.  If the Program\n"
-"specifies a version number of this License which applies to it and \"any\n"
-"later version\", you have the option of following the terms and conditions\n"
-"either of that version or of any later version published by the Free\n"
-"Software Foundation.  If the Program does not specify a version number of\n"
-"this License, you may choose any version ever published by the Free Software\n"
-"Foundation.\n"
-"\n"
-"  10. If you wish to incorporate parts of the Program into other free\n"
-"programs whose distribution conditions are different, write to the author\n"
-"to ask for permission.  For software which is copyrighted by the Free\n"
-"Software Foundation, write to the Free Software Foundation; we sometimes\n"
-"make exceptions for this.  Our decision will be guided by the two goals\n"
-"of preserving the free status of all derivatives of our free software and\n"
-"of promoting the sharing and reuse of software generally.\n"
-"\n"
-#endif
-"			    NO WARRANTY\n"
-"\n"
-"  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"
-"FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\n"
-"OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"
-"PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"
-"OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"
-"MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\n"
-"TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\n"
-"PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"
-"REPAIR OR CORRECTION.\n"
-"\n"
-"  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"
-"WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"
-"REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"
-"INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"
-"OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"
-"TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"
-"YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"
-"PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"
-"POSSIBILITY OF SUCH DAMAGES.\n"
-"\n"
-#if !SKIP_HELP
-"		     END OF TERMS AND CONDITIONS\n"
-"
\n"
-"	Appendix: How to Apply These Terms to Your New Programs\n"
-"\n"
-"  If you develop a new program, and you want it to be of the greatest\n"
-"possible use to the public, the best way to achieve this is to make it\n"
-"free software which everyone can redistribute and change under these terms.\n"
-"\n"
-"  To do so, attach the following notices to the program.  It is safest\n"
-"to attach them to the start of each source file to most effectively\n"
-"convey the exclusion of warranty; and each file should have at least\n"
-"the \"copyright\" line and a pointer to where the full notice is found.\n"
-"\n"
-"    <one line to give the program's name and a brief idea of what it does.>\n"
-"    Copyright (C) 19yy  <name of author>\n"
-"\n"
-"    This program is free software; you can redistribute it and/or modify\n"
-"    it under the terms of the GNU General Public License as published by\n"
-"    the Free Software Foundation; either version 2 of the License, or\n"
-"    (at your option) any later version.\n"
-"\n"
-"    This program is distributed in the hope that it will be useful,\n"
-"    but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-"    GNU General Public License for more details.\n"
-"\n"
-"    You should have received a copy of the GNU General Public License\n"
-"    along with this program; if not, write to the Free Software\n"
-"    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
-"\n"
-"Also add information on how to contact you by electronic and paper mail.\n"
-"\n"
-"If the program is interactive, make it output a short notice like this\n"
-"when it starts in an interactive mode:\n"
-"\n"
-"    Gnomovision version 69, Copyright (C) 19yy name of author\n"
-"    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n"
-"    This is free software, and you are welcome to redistribute it\n"
-"    under certain conditions; type `show c' for details.\n"
-"\n"
-"The hypothetical commands `show w' and `show c' should show the appropriate\n"
-"parts of the General Public License.  Of course, the commands you use may\n"
-"be called something other than `show w' and `show c'; they could even be\n"
-"mouse-clicks or menu items--whatever suits your program.\n"
-"\n"
-"You should also get your employer (if you work as a programmer) or your\n"
-"school, if any, to sign a \"copyright disclaimer\" for the program, if\n"
-"necessary.  Here is a sample; alter the names:\n"
-"\n"
-"  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n"
-"  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n"
-"\n"
-"  <signature of Ty Coon>, 1 April 1989\n"
-"  Ty Coon, President of Vice\n"
-"\n"
-"This General Public License does not permit incorporating your program into\n"
-"proprietary programs.  If your program is a subroutine library, you may\n"
-"consider it more useful to permit linking proprietary applications with the\n"
-"library.  If this is what you want to do, use the GNU Library General\n"
-"Public License instead of this License.\n"
-#endif
-;
-
-	char top[] =
-"\n"
-"x11vnc: a VNC server for X displays.  %s\n"
-"\n"
-"Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com>\n"
-"All rights reserved.\n"
-"\n"
-;
-	dup2(1, 2);
-	fprintf(stderr, top, lastmod);
-	fprintf(stderr, "%s", license);
-	exit(1);
-}
-
diff --git a/ica/x11/x11vnc/help.h b/ica/x11/x11vnc/help.h
deleted file mode 100644
index 4607af8..0000000
--- a/ica/x11/x11vnc/help.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_HELP_H
-#define _X11VNC_HELP_H
-
-/* -- help.h -- */
-
-extern void print_help(int mode);
-extern void print_license(void);
-extern void xopen_display_fail_message(char *disp);
-extern void nopassword_warning_msg(int gotloc);
-
-#endif /* _X11VNC_HELP_H */
diff --git a/ica/x11/x11vnc/inet.c b/ica/x11/x11vnc/inet.c
deleted file mode 100644
index c286d55..0000000
--- a/ica/x11/x11vnc/inet.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- inet.c -- */
-
-#include "x11vnc.h"
-#include "unixpw.h"
-#include "sslhelper.h"
-
-/*
- * Simple utility to map host name to dotted IP address.  Ignores aliases.
- * Up to caller to free returned string.
- */
-char *host2ip(char *host);
-char *raw2host(char *raw, int len);
-char *raw2ip(char *raw);
-char *ip2host(char *ip);
-int ipv6_ip(char *host);
-int dotted_ip(char *host, int partial);
-int get_remote_port(int sock);
-int get_local_port(int sock);
-char *get_remote_host(int sock);
-char *get_local_host(int sock);
-char *ident_username(rfbClientPtr client);
-int find_free_port(int start, int end);
-int find_free_port6(int start, int end);
-int have_ssh_env(void);
-char *ipv6_getnameinfo(struct sockaddr *paddr, int addrlen);
-char *ipv6_getipaddr(struct sockaddr *paddr, int addrlen);
-int listen6(int port);
-int listen_unix(char *file);
-int accept_unix(int s);
-int connect_tcp(char *host, int port);
-int listen_tcp(int port, in_addr_t iface, int try6);
-
-static int get_port(int sock, int remote);
-static char *get_host(int sock, int remote);
-
-char *host2ip(char *host) {
-	struct hostent *hp;
-	struct sockaddr_in addr;
-	char *str;
-
-	if (! host_lookup) {
-		return NULL;
-	}
-
-	hp = gethostbyname(host);
-	if (!hp) {
-		return NULL;
-	}
-	memset(&addr, 0, sizeof(addr));
-	addr.sin_family = AF_INET;
-	addr.sin_addr.s_addr =  *(unsigned long *)hp->h_addr;
-	str = strdup(inet_ntoa(addr.sin_addr));
-	return str;
-}
-
-char *raw2host(char *raw, int len) {
-	char *str;
-#if LIBVNCSERVER_HAVE_NETDB_H && LIBVNCSERVER_HAVE_NETINET_IN_H
-	struct hostent *hp;
-
-	if (! host_lookup) {
-		return strdup("unknown");
-	}
-
-	hp = gethostbyaddr(raw, len, AF_INET);
-	if (!hp) {
-		return strdup(inet_ntoa(*((struct in_addr *)raw)));
-	}
-	str = strdup(hp->h_name);
-#else
-	str = strdup("unknown");
-#endif
-	return str;
-}
-
-char *raw2ip(char *raw) {
-	return strdup(inet_ntoa(*((struct in_addr *)raw)));
-}
-
-char *ip2host(char *ip) {
-	char *str;
-#if LIBVNCSERVER_HAVE_NETDB_H && LIBVNCSERVER_HAVE_NETINET_IN_H
-	struct hostent *hp;
-	in_addr_t iaddr;
-
-	if (! host_lookup) {
-		return strdup("unknown");
-	}
-
-	iaddr = inet_addr(ip);
-	if (iaddr == htonl(INADDR_NONE)) {
-		return strdup("unknown");
-	}
-
-	hp = gethostbyaddr((char *)&iaddr, sizeof(in_addr_t), AF_INET);
-	if (!hp) {
-		return strdup("unknown");
-	}
-	str = strdup(hp->h_name);
-#else
-	str = strdup("unknown");
-#endif
-	return str;
-}
-
-int ipv6_ip(char *host_in) {
-	char *p, *host, a[2];
-	int ncol = 0, nhex = 0;
-
-	if (host_in[0] == '[')  {
-		host = host_in + 1;
-	} else {
-		host = host_in;
-	}
-
-	if (strstr(host, "::ffff:") == host || strstr(host, "::FFFF:") == host) {
-		return dotted_ip(host + strlen("::ffff:"), 0);
-	}
-
-	a[1] = '\0';
-
-	p = host;
-	while (*p != '\0' && *p != '%' && *p != ']') {
-		if (*p == ':') {
-			ncol++;
-		} else {
-			nhex++;
-		}
-		a[0] = *p;
-		if (strpbrk(a, ":abcdef0123456789") == a) {
-			p++;
-			continue;
-		}
-		return 0;
-	}
-	if (ncol < 2 || ncol > 8 || nhex == 0) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-int dotted_ip(char *host, int partial) {
-	int len, dots = 0;
-	char *p = host;
-
-	if (!host) {
-		return 0;
-	}
-
-	if (!isdigit((unsigned char) host[0])) {
-		return 0;
-	}
-
-	len = strlen(host);
-	if (!partial && !isdigit((unsigned char) host[len-1])) {
-		return 0;
-	}
-
-	while (*p != '\0') {
-		if (*p == '.') dots++;
-		if (*p == '.' || isdigit((unsigned char) (*p))) {
-			p++;
-			continue;
-		}
-		return 0;
-	}
-	if (!partial && dots != 3) {
-		return 0;	
-	}
-	return 1;
-}
-
-static int get_port(int sock, int remote) {
-	struct sockaddr_in saddr;
-	unsigned int saddr_len;
-	int saddr_port;
-	
-	saddr_len = sizeof(saddr);
-	memset(&saddr, 0, sizeof(saddr));
-	saddr_port = -1;
-	if (remote) {
-		if (!getpeername(sock, (struct sockaddr *)&saddr, &saddr_len)) {
-			saddr_port = ntohs(saddr.sin_port);
-		}
-	} else {
-		if (!getsockname(sock, (struct sockaddr *)&saddr, &saddr_len)) {
-			saddr_port = ntohs(saddr.sin_port);
-		}
-	}
-	return saddr_port;
-}
-
-int get_remote_port(int sock) {
-	return get_port(sock, 1);
-}
-
-int get_local_port(int sock) {
-	return get_port(sock, 0);
-}
-
-static char *get_host(int sock, int remote) {
-	struct sockaddr_in saddr;
-	unsigned int saddr_len;
-	int saddr_port;
-	char *saddr_ip_str = NULL;
-	
-	saddr_len = sizeof(saddr);
-	memset(&saddr, 0, sizeof(saddr));
-	saddr_port = -1;
-#if LIBVNCSERVER_HAVE_NETINET_IN_H
-	if (remote) {
-		if (!getpeername(sock, (struct sockaddr *)&saddr, &saddr_len)) {
-			saddr_ip_str = inet_ntoa(saddr.sin_addr);
-		}
-	} else {
-		if (!getsockname(sock, (struct sockaddr *)&saddr, &saddr_len)) {
-			saddr_ip_str = inet_ntoa(saddr.sin_addr);
-		}
-	}
-#endif
-	if (! saddr_ip_str) {
-		saddr_ip_str = "unknown";
-	}
-	return strdup(saddr_ip_str);
-}
-
-char *get_remote_host(int sock) {
-	return get_host(sock, 1);
-}
-
-char *get_local_host(int sock) {
-	return get_host(sock, 0);
-}
-
-char *ident_username(rfbClientPtr client) {
-	ClientData *cd = (ClientData *) client->clientData;
-	char *str, *newhost, *user = NULL, *newuser = NULL;
-	int len;
-
-	if (cd) {
-		user = cd->username;
-	}
-	if (!user || *user == '\0') {
-		int n, sock, ok = 0;
-		int block = 0;
-		int refused = 0;
-
-		/*
-		 * need to check to see if the operation will block for
-		 * a long time: a firewall may just ignore our packets.
-		 */
-#if LIBVNCSERVER_HAVE_FORK
-	    {	pid_t pid, pidw;
-		int rc;
-		if ((pid = fork()) > 0) {
-			usleep(100 * 1000);	/* 0.1 sec for quick success or refusal */
-			pidw = waitpid(pid, &rc, WNOHANG);
-			if (pidw <= 0) {
-				usleep(1500 * 1000);	/* 1.5 sec */
-				pidw = waitpid(pid, &rc, WNOHANG);
-				if (pidw <= 0) {
-					int rc2;
-					rfbLog("ident_username: set block=1 (hung)\n");
-					block = 1;
-					kill(pid, SIGTERM);
-					usleep(100 * 1000);
-					waitpid(pid, &rc2, WNOHANG);
-				}
-			}
-			if (pidw > 0 && !block) {
-				if (WIFEXITED(rc) && WEXITSTATUS(rc) == 1) {
-					rfbLog("ident_username: set refused=1 (exit)\n");
-					refused = 1;
-				}
-			}
-		} else if (pid == -1) {
-			;
-		} else {
-			/* child */
-			signal(SIGHUP,  SIG_DFL);
-			signal(SIGINT,  SIG_DFL);
-			signal(SIGQUIT, SIG_DFL);
-			signal(SIGTERM, SIG_DFL);
-
-			if ((sock = connect_tcp(client->host, 113)) < 0) {
-				exit(1);
-			} else {
-				close(sock);
-				exit(0);
-			}
-		}
-	    }
-#endif
-		if (block || refused) {
-			;
-		} else if ((sock = connect_tcp(client->host, 113)) < 0) {
-			rfbLog("ident_username: could not connect to ident: %s:%d\n",
-			    client->host, 113);
-		} else {
-			char msg[128];
-			int ret;
-			fd_set rfds;
-			struct timeval tv;
-			int rport = get_remote_port(client->sock);
-			int lport = get_local_port(client->sock);
-
-			sprintf(msg, "%d, %d\r\n", rport, lport);
-			n = write(sock, msg, strlen(msg));
-
-			FD_ZERO(&rfds);
-			FD_SET(sock, &rfds);
-			tv.tv_sec  = 3;
-			tv.tv_usec = 0;
-			ret = select(sock+1, &rfds, NULL, NULL, &tv); 
-
-			if (ret > 0) {
-				int i;
-				char *q, *p;
-				for (i=0; i < (int) sizeof(msg); i++) {
-					msg[i] = '\0';
-				}
-				usleep(250*1000);
-				n = read(sock, msg, 127);
-				close(sock);
-				if (n <= 0) goto badreply;
-
-				/* 32782 , 6000 : USERID : UNIX :runge */
-				q = strstr(msg, "USERID");
-				if (!q) goto badreply;
-				q = strstr(q, ":");
-				if (!q) goto badreply;
-				q++;
-				q = strstr(q, ":");
-				if (!q) goto badreply;
-				q++;
-				q = lblanks(q);
-				p = q;
-				while (*p) {
-					if (*p == '\r' || *p == '\n') {
-						*p = '\0';
-					}
-					p++;
-				}
-				ok = 1;
-				if (strlen(q) > 24) {
-					*(q+24) = '\0';
-				}
-				newuser = strdup(q);
-
-				badreply:
-				n = 0;	/* avoid syntax error */
-			} else {
-				close(sock);
-			}
-		}
-		if (! ok || !newuser) {
-			newuser = strdup("unknown-user");
-		}
-		if (cd) {
-			if (cd->username) {
-				free(cd->username);
-			}
-			cd->username = newuser;
-		}
-		user = newuser;
-	}
-	if (!strcmp(user, "unknown-user") && cd && cd->unixname[0] != '\0') {
-		user = cd->unixname;
-	}
-	if (unixpw && openssl_last_ip && strstr("UNIX:", user) != user) {
-		newhost = ip2host(openssl_last_ip);
-	} else {
-		newhost = ip2host(client->host);
-	}
-	len = strlen(user) + 1 + strlen(newhost) + 1;
-	str = (char *) malloc(len);
-	sprintf(str, "%s@%s", user, newhost);
-	free(newhost);
-	return str;
-}
-
-int find_free_port(int start, int end) {
-	int port;
-	if (start <= 0) {
-		start = 1024;
-	}
-	if (end <= 0) {
-		end = 65530;
-	}
-	for (port = start; port <= end; port++)  {
-		int sock = listen_tcp(port, htonl(INADDR_ANY), 0);
-		if (sock >= 0) {
-			close(sock);
-			return port;
-		}
-	}
-	return 0;
-}
-
-int find_free_port6(int start, int end) {
-	int port;
-	if (start <= 0) {
-		start = 1024;
-	}
-	if (end <= 0) {
-		end = 65530;
-	}
-	for (port = start; port <= end; port++)  {
-		int sock = listen6(port);
-		if (sock >= 0) {
-			close(sock);
-			return port;
-		}
-	}
-	return 0;
-}
-
-int have_ssh_env(void) {
-	char *str, *p = getenv("SSH_CONNECTION");
-	char *rhost, *rport, *lhost, *lport;
-	
-	if (! p) {
-		char *q = getenv("SSH_CLIENT");
-		if (! q) {
-			return 0;
-		}
-		if (strstr(q, "127.0.0.1") != NULL) {
-			return 0;
-		}
-		return 1;
-	}
-
-	if (strstr(p, "127.0.0.1") != NULL) {
-		return 0;
-	}
-
-	str = strdup(p);
-	
-	p = strtok(str, " ");
-	rhost = p;
-
-	p = strtok(NULL, " ");
-	if (! p) goto fail;
-
-	rport = p;
-
-	p = strtok(NULL, " ");
-	if (! p) goto fail;
-
-	lhost = p;
-	
-	p = strtok(NULL, " ");
-	if (! p) goto fail;
-
-	lport = p;
-
-if (0) fprintf(stderr, "%d/%d - '%s' '%s'\n", atoi(rport), atoi(lport), rhost, lhost);
-
-	if (atoi(rport) <= 16 || atoi(rport) > 65535) {
-		goto fail;
-	}
-	if (atoi(lport) <= 16 || atoi(lport) > 65535) {
-		goto fail;
-	}
-
-	if (!strcmp(rhost, lhost)) {
-		goto fail;
-	}
-
-	free(str);
-
-	return 1;
-	
-	fail:
-
-	free(str);
-
-	return 0;
-}
-
-char *ipv6_getnameinfo(struct sockaddr *paddr, int addrlen) {
-#if X11VNC_IPV6
-	char name[200];
-	if (noipv6) {
-		return strdup("unknown");
-	}
-	if (getnameinfo(paddr, addrlen, name, sizeof(name), NULL, 0, 0) == 0) {
-		return strdup(name);
-	}
-#endif
-	return strdup("unknown");
-}
-
-char *ipv6_getipaddr(struct sockaddr *paddr, int addrlen) {
-#if X11VNC_IPV6 && defined(NI_NUMERICHOST)
-	char name[200];
-	if (noipv6) {
-		return strdup("unknown");
-	}
-	if (getnameinfo(paddr, addrlen, name, sizeof(name), NULL, 0, NI_NUMERICHOST) == 0) {
-		return strdup(name);
-	}
-#endif
-	return strdup("unknown");
-}
-
-int listen6(int port) {
-#if X11VNC_IPV6
-	struct sockaddr_in6 sin;
-	int fd = -1, one = 1;
-
-	if (noipv6) {
-		return -1;
-	}
-	if (port <= 0 || 65535 < port) {
-		/* for us, invalid port means do not listen. */
-		return -1;
-	}
-
-	fd = socket(AF_INET6, SOCK_STREAM, 0);
-	if (fd < 0) {
-		rfbLogPerror("listen6: socket");
-		rfbLog("(Ignore the above error if this system is IPv4-only.)\n");
-		return -1;
-	}
-
-	if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)) < 0) {
-		rfbLogPerror("listen6: setsockopt SO_REUSEADDR"); 
-		close(fd);
-		return -1;
-	}
-
-#if defined(SOL_IPV6) && defined(IPV6_V6ONLY)
-	if (setsockopt(fd, SOL_IPV6, IPV6_V6ONLY, (char *)&one, sizeof(one)) < 0) {
-		rfbLogPerror("listen6: setsockopt IPV6_V6ONLY"); 
-		close(fd);
-		return -1;
-	}
-#endif
-
-	memset((char *)&sin, 0, sizeof(sin));
-	sin.sin6_family = AF_INET6;
-	sin.sin6_port   = htons(port);
-	sin.sin6_addr   = in6addr_any;
-
-	if (listen_str6) {
-		if (!strcmp(listen_str6, "localhost") || !strcmp(listen_str6, "::1")) {
-			sin.sin6_addr = in6addr_loopback;
-		} else {
-			int err;
-			struct addrinfo *ai;
-			struct addrinfo hints;
-			char service[32];
-
-			memset(&hints, 0, sizeof(hints));
-			sprintf(service, "%d", port);
-
-			hints.ai_family = AF_INET6;
-			hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
-			hints.ai_flags |= AI_ADDRCONFIG;
-#endif
-#ifdef AI_NUMERICHOST
-			if(ipv6_ip(listen_str6)) {
-				hints.ai_flags |= AI_NUMERICHOST;
-			}
-#endif
-#ifdef AI_NUMERICSERV
-			hints.ai_flags |= AI_NUMERICSERV;
-#endif
-			err = getaddrinfo(listen_str6, service, &hints, &ai);
-			if (err == 0) {
-				struct addrinfo *ap = ai;
-				err = 1;
-				while (ap != NULL) {
-					char *s = ipv6_getipaddr(ap->ai_addr, ap->ai_addrlen);
-					if (!s) s = strdup("unknown");
-
-					rfbLog("listen6: checking: %s family: %d\n", s, ap->ai_family); 
-					if (ap->ai_family == AF_INET6) {
-						memcpy((char *)&sin, ap->ai_addr, sizeof(sin));
-						rfbLog("listen6: using:    %s scope_id: %d\n", s, sin.sin6_scope_id); 
-						err = 0;
-						free(s);
-						break;
-					}
-					free(s);
-					ap = ap->ai_next;
-				}
-				freeaddrinfo(ai);
-			}
-
-			if (err != 0) {
-				rfbLog("Invalid or Unsupported -listen6 string: %s\n", listen_str6);
-				close(fd);
-				return -1;
-			}
-		}
-	} else if (allow_list && !strcmp(allow_list, "127.0.0.1")) {
-		sin.sin6_addr = in6addr_loopback;
-	} else if (listen_str) {
-		if (!strcmp(listen_str, "localhost")) {
-			sin.sin6_addr = in6addr_loopback;
-		}
-	}
-
-	if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
-		rfbLogPerror("listen6: bind"); 
-		close(fd);
-		return -1;
-	}
-	if (listen(fd, 32) < 0) {
-		rfbLogPerror("listen6: listen");
-		close(fd);
-		return -1;
-	}
-	return fd;
-#else
-	if (port) {}
-	return -1;
-#endif
-}
-
-#ifdef LIBVNCSERVER_HAVE_SYS_SOCKET_H
-#include <sys/un.h>
-#endif
-
-int listen_unix(char *file) {
-#if !defined(AF_UNIX) || !defined(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
-	return -1;
-#else
-	int s, len;
-	struct sockaddr_un saun;
-
-	s = socket(AF_UNIX, SOCK_STREAM, 0);
-	if (s < 0) {
-		rfbLogPerror("listen_unix: socket");
-		return -1;
-	}
-	saun.sun_family = AF_UNIX;
-	strcpy(saun.sun_path, file);
-	unlink(file);
-
-	len = sizeof(saun.sun_family) + strlen(saun.sun_path);
-
-	if (bind(s, (struct sockaddr *)&saun, len) < 0) {
-		rfbLogPerror("listen_unix: bind");
-		close(s);
-		return -1;
-	}
-
-	if (listen(s, 32) < 0) {
-		rfbLogPerror("listen_unix: listen");
-		close(s);
-		return -1;
-	}
-	rfbLog("listening on unix socket: %s fd=%d\n", file, s);
-	return s;
-#endif
-}
-
-int accept_unix(int s) {
-#if !defined(AF_UNIX) || !defined(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
-	if (s) {}
-	return -1;
-#else
-	int fd, fromlen;
-	struct sockaddr_un fsaun;
-
-	fd = accept(s, (struct sockaddr *)&fsaun, &fromlen);
-	if (fd < 0) {
-		rfbLogPerror("accept_unix: accept");
-		return -1;
-	}
-	return fd;
-#endif
-}
-
-int connect_tcp(char *host, int port) {
-	double t0 = dnow();
-	int fd = -1;
-	int fail4 = noipv4;
-	if (getenv("IPV4_FAILS")) {
-		fail4 = 2;
-	}
-
-	rfbLog("connect_tcp: trying:   %s %d\n", host, port);
-
-	if (fail4) {
-		if (fail4 > 1) {
-			rfbLog("TESTING: IPV4_FAILS for connect_tcp.\n");
-		}
-	} else {
-		fd = rfbConnectToTcpAddr(host, port);
-	}
-
-	if (fd >= 0) {
-		return fd;
-	}
-	rfbLogPerror("connect_tcp: connection failed");
-
-	if (dnow() - t0 < 4.0) {
-		rfbLog("connect_tcp: re-trying %s %d\n", host, port);
-		usleep (100 * 1000);
-		if (!fail4) {
-			fd = rfbConnectToTcpAddr(host, port);
-		}
-		if (fd < 0) {
-			rfbLogPerror("connect_tcp: connection failed");
-		}
-	}
-
-	if (fd < 0 && !noipv6) {
-#if X11VNC_IPV6
-		int err;
-		struct addrinfo *ai;
-		struct addrinfo hints;
-		char service[32], *host2, *q;
-
-		rfbLog("connect_tcp: trying IPv6 %s %d\n", host, port);
-
-		memset(&hints, 0, sizeof(hints));
-		sprintf(service, "%d", port);
-
-		hints.ai_family = AF_UNSPEC;
-		hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
-		hints.ai_flags |= AI_ADDRCONFIG;
-#endif
-		if(ipv6_ip(host)) {
-#ifdef AI_NUMERICHOST
-			rfbLog("connect_tcp[ipv6]: setting AI_NUMERICHOST for %s\n", host);
-			hints.ai_flags |= AI_NUMERICHOST;
-#endif
-		}
-#ifdef AI_NUMERICSERV
-		hints.ai_flags |= AI_NUMERICSERV;
-#endif
-
-		if (!strcmp(host, "127.0.0.1")) {
-			host2 = strdup("::1");
-		} else if (host[0] == '[') {
-			host2 = strdup(host+1);
-		} else {
-			host2 = strdup(host);
-		}
-		q = strrchr(host2, ']');
-		if (q) {
-			*q = '\0';
-		}
-
-		err = getaddrinfo(host2, service, &hints, &ai);
-		if (err != 0) {
-			rfbLog("connect_tcp[ipv6]: getaddrinfo[%d]: %s\n", err, gai_strerror(err));
-			usleep(100 * 1000);
-			err = getaddrinfo(host2, service, &hints, &ai);
-		}
-		free(host2);
-
-		if (err != 0) {
-			rfbLog("connect_tcp[ipv6]: getaddrinfo[%d]: %s\n", err, gai_strerror(err));
-		} else {
-			struct addrinfo *ap = ai;
-			while (ap != NULL) {
-				int sock;
-
-				if (fail4) {
-					struct sockaddr_in6 *s6ptr;
-					if (ap->ai_family != AF_INET6) {
-						rfbLog("connect_tcp[ipv6]: skipping AF_INET address under -noipv4\n");
-						ap = ap->ai_next;
-						continue;
-					}
-#ifdef IN6_IS_ADDR_V4MAPPED
-					s6ptr = (struct sockaddr_in6 *) ap->ai_addr;
-					if (IN6_IS_ADDR_V4MAPPED(&(s6ptr->sin6_addr))) {
-						rfbLog("connect_tcp[ipv6]: skipping V4MAPPED address under -noipv4\n");
-						ap = ap->ai_next;
-						continue;
-					}
-#endif
-				}
-
-				sock = socket(ap->ai_family, ap->ai_socktype, ap->ai_protocol);
-
-				if (sock == -1) {
-					rfbLogPerror("connect_tcp[ipv6]: socket");
-					if (0) rfbLog("(Ignore the above error if this system is IPv4-only.)\n");
-				} else {
-					int res = -1, dmsg = 0;
-					char *s = ipv6_getipaddr(ap->ai_addr, ap->ai_addrlen);
-					if (!s) s = strdup("unknown");
-
-					rfbLog("connect_tcp[ipv6]: trying sock=%d fam=%d proto=%d using %s\n",
-					    sock, ap->ai_family, ap->ai_protocol, s);
-					res = connect(sock, ap->ai_addr, ap->ai_addrlen);
-#if defined(SOL_IPV6) && defined(IPV6_V6ONLY)
-					if (res != 0) {
-						int zero = 0;
-						rfbLogPerror("connect_tcp[ipv6]: connect");
-						dmsg = 1;
-						if (setsockopt(sock, SOL_IPV6, IPV6_V6ONLY, (char *)&zero, sizeof(zero)) == 0) {
-							rfbLog("connect_tcp[ipv6]: trying again with IPV6_V6ONLY=0\n");
-							res = connect(sock, ap->ai_addr, ap->ai_addrlen);
-							dmsg = 0;
-						} else {
-							rfbLogPerror("connect_tcp[ipv6]: setsockopt IPV6_V6ONLY");
-						}
-					}
-#endif
-					if (res == 0) {
-						rfbLog("connect_tcp[ipv6]: connect OK\n");
-						fd = sock;
-						if (!ipv6_client_ip_str) {
-							ipv6_client_ip_str = strdup(s);
-						}
-						free(s);
-						break;
-					} else {
-						if (!dmsg) rfbLogPerror("connect_tcp[ipv6]: connect");
-						close(sock);
-					}
-					free(s);
-				}
-				ap = ap->ai_next;
-			}
-			freeaddrinfo(ai);
-		}
-#endif
-	}
-	if (fd < 0 && !fail4) {
-		/* this is a kludge for IPv4-only machines getting v4mapped string. */
-		char *q, *host2;
-		if (host[0] == '[') {
-			host2 = strdup(host+1);
-		} else {
-			host2 = strdup(host);
-		}
-		q = strrchr(host2, ']');
-		if (q) {
-			*q = '\0';
-		}
-		if (strstr(host2, "::ffff:") == host2 || strstr(host2, "::FFFF:") == host2) {
-			char *host3 = host2 + strlen("::ffff:");
-			if (dotted_ip(host3, 0)) {
-				rfbLog("connect_tcp[ipv4]: trying fallback to IPv4 for %s\n", host2);
-				fd = rfbConnectToTcpAddr(host3, port);
-				if (fd < 0) {
-					rfbLogPerror("connect_tcp[ipv4]: connection failed");
-				}
-			}
-		}
-		free(host2);
-	}
-	return fd;
-}
-
-int listen_tcp(int port, in_addr_t iface, int try6) {
-	int fd = -1;
-	int fail4 = noipv4;
-	if (getenv("IPV4_FAILS")) {
-		fail4 = 2;
-	}
-
-	if (port <= 0 || 65535 < port) {
-		/* for us, invalid port means do not listen. */
-		return -1;
-	}
-
-	if (fail4) {
-		if (fail4 > 1) {
-			rfbLog("TESTING: IPV4_FAILS for listen_tcp: port=%d try6=%d\n", port, try6);
-		}
-	} else {
-		fd = rfbListenOnTCPPort(port, iface);
-	}
-
-	if (fd >= 0) {
-		return fd;
-	}
-	if (fail4 > 1) {
-		rfbLogPerror("listen_tcp: listen failed");
-	}
-
-	if (fd < 0 && try6 && ipv6_listen && !noipv6) {
-#if X11VNC_IPV6
-		char *save = listen_str6;
-		if (iface == htonl(INADDR_LOOPBACK)) {
-			listen_str6 = "localhost";
-			rfbLog("listen_tcp: retrying on IPv6 in6addr_loopback ...\n");
-			fd = listen6(port);
-		} else if (iface == htonl(INADDR_ANY)) {
-			listen_str6 = NULL;
-			rfbLog("listen_tcp: retrying on IPv6 in6addr_any ...\n");
-			fd = listen6(port);
-		}
-		listen_str6 = save;
-#endif
-	}
-	return fd;
-}
-
diff --git a/ica/x11/x11vnc/inet.h b/ica/x11/x11vnc/inet.h
deleted file mode 100644
index b76dbb4..0000000
--- a/ica/x11/x11vnc/inet.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_INET_H
-#define _X11VNC_INET_H
-
-/* -- inet.h -- */
-
-extern char *host2ip(char *host);
-extern char *raw2host(char *raw, int len);
-extern char *raw2ip(char *raw);
-extern char *ip2host(char *ip);
-extern int ipv6_ip(char *host);
-extern int dotted_ip(char *host, int partial);
-extern int get_remote_port(int sock);
-extern int get_local_port(int sock);
-extern char *get_remote_host(int sock);
-extern char *get_local_host(int sock);
-extern char *ident_username(rfbClientPtr client);
-extern int find_free_port(int start, int end);
-extern int find_free_port6(int start, int end);
-extern int have_ssh_env(void);
-extern char *ipv6_getnameinfo(struct sockaddr *paddr, int addrlen);
-extern char *ipv6_getipaddr(struct sockaddr *paddr, int addrlen);
-extern int listen6(int port);
-extern int listen_unix(char *file);
-extern int accept_unix(int s);
-extern int connect_tcp(char *host, int port);
-extern int listen_tcp(int port, in_addr_t iface, int try6);
-
-#endif /* _X11VNC_INET_H */
diff --git a/ica/x11/x11vnc/keyboard.c b/ica/x11/x11vnc/keyboard.c
deleted file mode 100644
index 54ff70e..0000000
--- a/ica/x11/x11vnc/keyboard.c
+++ /dev/null
@@ -1,3418 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- keyboard.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "xrecord.h"
-#include "xinerama.h"
-#include "pointer.h"
-#include "userinput.h"
-#include "win_utils.h"
-#include "rates.h"
-#include "cleanup.h"
-#include "allowed_input_t.h"
-#include "unixpw.h"
-#include "v4l.h"
-#include "linuxfb.h"
-#include "uinput.h"
-#include "macosx.h"
-#include "screen.h"
-
-void get_keystate(int *keystate);
-void clear_modifiers(int init);
-int track_mod_state(rfbKeySym keysym, rfbBool down, rfbBool set);
-void clear_keys(void);
-void clear_locks(void);
-int get_autorepeat_state(void);
-int get_initial_autorepeat_state(void);
-void autorepeat(int restore, int bequiet);
-void check_add_keysyms(void);
-int add_keysym(KeySym keysym);
-void delete_added_keycodes(int bequiet);
-void initialize_remap(char *infile);
-int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new_kc);
-void switch_to_xkb_if_better(void);
-char *short_kmbcf(char *str);
-void initialize_allowed_input(void);
-void initialize_modtweak(void);
-void initialize_keyboard_and_pointer(void);
-void get_allowed_input(rfbClientPtr client, allowed_input_t *input);
-double typing_rate(double time_window, int *repeating);
-int skip_cr_when_scaling(char *mode);
-void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-
-
-static void delete_keycode(KeyCode kc, int bequiet);
-static int count_added_keycodes(void);
-static void add_remap(char *line);
-static void add_dead_keysyms(char *str);
-static void initialize_xkb_modtweak(void);
-static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
-    rfbClientPtr client);
-static void tweak_mod(signed char mod, rfbBool down);
-static void modifier_tweak_keyboard(rfbBool down, rfbKeySym keysym,
-    rfbClientPtr client);
-static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-
-
-/*
- * Routine to retreive current state keyboard.  1 means down, 0 up.
- */
-void get_keystate(int *keystate) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!keystate) {}
-	return;
-#else
-	int i, k;
-	char keys[32];
-
-	RAWFB_RET_VOID
-	
-	/* n.b. caller decides to X_LOCK or not. */
-	XQueryKeymap(dpy, keys);
-	for (i=0; i<32; i++) {
-		char c = keys[i];
-
-		for (k=0; k < 8; k++) {
-			if (c & 0x1) {
-				keystate[8*i + k] = 1;
-			} else {
-				keystate[8*i + k] = 0;
-			}
-			c = c >> 1;
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-/*
- * Try to KeyRelease any non-Lock modifiers that are down.
- */
-void clear_modifiers(int init) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!init) {}
-	return;
-#else
-	static KeyCode keycodes[256];
-	static KeySym  keysyms[256];
-	static char *keystrs[256];
-	static int kcount = 0, first = 1;
-	int keystate[256];
-	int i, j, minkey, maxkey, syms_per_keycode;
-	KeySym *keymap;
-	KeySym keysym;
-	KeyCode keycode;
-
-	RAWFB_RET_VOID
-
-	/* n.b. caller decides to X_LOCK or not. */
-	if (first) {
-		/*
-		 * we store results in static arrays, to aid interrupted
-		 * case, but modifiers could have changed during session...
-		 */
-		XDisplayKeycodes(dpy, &minkey, &maxkey);
-
-		keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1),
-		    &syms_per_keycode);
-
-		for (i = minkey; i <= maxkey; i++) {
-		    for (j = 0; j < syms_per_keycode; j++) {
-			char *str;
-			keysym = keymap[ (i - minkey) * syms_per_keycode + j ];
-			if (keysym == NoSymbol || ! ismodkey(keysym)) {
-				continue;
-			}
-			keycode = XKeysymToKeycode(dpy, keysym);
-			if (keycode == NoSymbol) {
-				continue;
-			}
-			keycodes[kcount] = keycode;
-			keysyms[kcount]  = keysym;
-			str = XKeysymToString(keysym);
-			if (! str) str = "null";
-			keystrs[kcount]  = strdup(str);
-			kcount++;
-		    }
-		}
-		XFree_wr((void *) keymap);
-		first = 0;
-	}
-	if (init) {
-		return;
-	}
-	
-	get_keystate(keystate);
-	for (i=0; i < kcount; i++) {
-		keysym  = keysyms[i];
-		keycode = keycodes[i];
-
-		if (! keystate[(int) keycode]) {
-			continue;
-		}
-
-		if (clear_mods) {
-			rfbLog("clear_modifiers: up: %-10s (0x%x) "
-			    "keycode=0x%x\n", keystrs[i], keysym, keycode);
-		}
-		XTestFakeKeyEvent_wr(dpy, keycode, False, CurrentTime);
-	}
-	XFlush_wr(dpy);
-#endif	/* NO_X11 */
-}
-
-static KeySym simple_mods[] = {
-	XK_Shift_L, XK_Shift_R,
-	XK_Control_L, XK_Control_R,
-	XK_Meta_L, XK_Meta_R,
-	XK_Alt_L, XK_Alt_R,
-	XK_Super_L, XK_Super_R,
-	XK_Hyper_L, XK_Hyper_R,
-	XK_Mode_switch,
-	NoSymbol
-};
-#define NSIMPLE_MODS 13
-
-int track_mod_state(rfbKeySym keysym, rfbBool down, rfbBool set) {
-	KeySym sym = (KeySym) keysym;	
-	static rfbBool isdown[NSIMPLE_MODS];
-	static int first = 1;
-	int i, cnt = 0;
-
-	/*
-	 * simple tracking method for the modifier state without
-	 * contacting the Xserver.  Ignores, of course what keys are
-	 * pressed on the physical display.
-	 *
-	 * This is unrelated to our mod_tweak and xkb stuff.
-	 * Just a simple thing for wireframe/scroll heuristics, 
-	 * sloppy keys etc.
-	 */
-
-	if (first) {
-		for (i=0; i<NSIMPLE_MODS; i++) {
-			isdown[i] = FALSE;
-		}
-		first = 0;
-	}
-
-	if (sym != NoSymbol) {
-		for (i=0; i<NSIMPLE_MODS; i++) {
-			if (sym == simple_mods[i]) {
-				if (set) {
-					isdown[i] = down;
-					return 1;
-				} else {
-					if (isdown[i]) {
-						return 1;
-					} else {
-						return 0;
-					}
-				}
-				break;
-			}
-		}
-		/* not a modifier */
-		if (set) {
-			return 0;
-		} else {
-			return -1;
-		}
-	}
-
-	/* called with NoSymbol: return number currently pressed: */
-	for (i=0; i<NSIMPLE_MODS; i++) {
-		if (isdown[i]) {
-			cnt++;
-		}
-	}
-	return cnt;
-}
-
-/*
- * Attempt to set all keys to Up position.  Can mess up typing at the
- * physical keyboard so use with caution.
- */
-void clear_keys(void) {
-	int k, keystate[256];
-
-	RAWFB_RET_VOID
-	
-	/* n.b. caller decides to X_LOCK or not. */
-	get_keystate(keystate);
-	for (k=0; k<256; k++) {
-		if (keystate[k]) {
-			KeyCode keycode = (KeyCode) k;
-			rfbLog("clear_keys: keycode=%d\n", keycode);
-			XTestFakeKeyEvent_wr(dpy, keycode, False, CurrentTime);
-		}
-	}
-	XFlush_wr(dpy);
-}
-		
-
-void clear_locks(void) {
-#if NO_X11
-	RAWFB_RET_VOID
-	return;
-#else
-	XModifierKeymap *map;
-	int i, j, k = 0;
-	unsigned int state = 0;
-
-	RAWFB_RET_VOID
-
-	/* n.b. caller decides to X_LOCK or not. */
-#if LIBVNCSERVER_HAVE_XKEYBOARD
-	if (xkb_present) {
-		XkbStateRec kbstate;
-		XkbGetState(dpy, XkbUseCoreKbd, &kbstate);
-		rfbLog("locked:  0x%x\n", kbstate.locked_mods);
-		rfbLog("latched: 0x%x\n", kbstate.latched_mods);
-		rfbLog("compat:  0x%x\n", kbstate.compat_state);
-		state = kbstate.locked_mods;
-		if (! state) {
-			state = kbstate.compat_state;
-		}
-	} else 
-#endif
-	{
-		state = mask_state();
-		/* this may contain non-locks too... */
-		rfbLog("state:   0x%x\n", state);
-	}
-	if (! state) {
-		return;
-	}
-	map = XGetModifierMapping(dpy);
-	if (! map) {
-		return;
-	}
-	for (i = 0; i < 8; i++) {
-		int did = 0;
-		for (j = 0; j < map->max_keypermod; j++) {
-			if (! did && state & (0x1 << i)) {
-				if (map->modifiermap[k]) {
-					KeyCode key = map->modifiermap[k];
-					KeySym ks = XKeycodeToKeysym(dpy, key, 0);
-					char *nm = XKeysymToString(ks);
-					rfbLog("toggling: %03d / %03d -- %s\n", key, ks, nm ? nm : "BadKey");
-					did = 1;
-					XTestFakeKeyEvent_wr(dpy, key, True, CurrentTime);
-					usleep(10*1000);
-					XTestFakeKeyEvent_wr(dpy, key, False, CurrentTime);
-					XFlush_wr(dpy);
-				}
-			}
-			k++;
-		}
-	}
-	XFreeModifiermap(map);
-	XFlush_wr(dpy);
-	rfbLog("state:   0x%x\n", mask_state());
-#endif
-}
-
-/*
- * Kludge for -norepeat option: we turn off keystroke autorepeat in
- * the X server when clients are connected.  This may annoy people at
- * the physical display.  We do this because 'key down' and 'key up'
- * user input events may be separated by 100s of ms due to screen fb
- * processing or link latency, thereby inducing the X server to apply
- * autorepeat when it should not.  Since the *client* is likely doing
- * keystroke autorepeating as well, it kind of makes sense to shut it
- * off if no one is at the physical display...
- */
-static int save_auto_repeat = -1;
-
-int get_autorepeat_state(void) {
-#if NO_X11
-	RAWFB_RET(0)
-	return 0;
-#else
-	XKeyboardState kstate;
-
-	RAWFB_RET(0)
-
-	X_LOCK;
-	XGetKeyboardControl(dpy, &kstate);
-	X_UNLOCK;
-	return kstate.global_auto_repeat;
-#endif	/* NO_X11 */
-}
-
-int get_initial_autorepeat_state(void) {
-	if (save_auto_repeat < 0) {
-		save_auto_repeat = get_autorepeat_state();
-	}
-	return save_auto_repeat;
-}
-
-void autorepeat(int restore, int bequiet) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!restore || !bequiet) {}
-	return;
-#else
-	int global_auto_repeat;
-	XKeyboardControl kctrl;
-
-	RAWFB_RET_VOID
-
-	if (restore) {
-		if (save_auto_repeat < 0) {
-			return;		/* nothing to restore */
-		}
-		global_auto_repeat = get_autorepeat_state();
-		/* read state and skip restore if equal (e.g. no clients) */
-		if (global_auto_repeat == save_auto_repeat) {
-			return;
-		}
-
-		X_LOCK;
-		kctrl.auto_repeat_mode = save_auto_repeat;
-		XChangeKeyboardControl(dpy, KBAutoRepeatMode, &kctrl);
-		XFlush_wr(dpy);
-		X_UNLOCK;
-
-		if (! bequiet && ! quiet) {
-			rfbLog("Restored X server key autorepeat to: %d\n",
-			    save_auto_repeat);
-		}
-	} else {
-		global_auto_repeat = get_autorepeat_state();
-		if (save_auto_repeat < 0) {
-			/*
-			 * we only remember the state at startup
-			 * to avoid confusing ourselves later on.
-			 */
-			save_auto_repeat = global_auto_repeat;
-		}
-
-		X_LOCK;
-		kctrl.auto_repeat_mode = AutoRepeatModeOff;
-		XChangeKeyboardControl(dpy, KBAutoRepeatMode, &kctrl);
-		XFlush_wr(dpy);
-		X_UNLOCK;
-
-		if (! bequiet && ! quiet) {
-			rfbLog("Disabled X server key autorepeat.\n");
-			if (no_repeat_countdown >= 0) {
-				rfbLog("  to force back on run: 'xset r on' (%d "
-				    "times)\n", no_repeat_countdown+1);
-			}
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-/*
- * We periodically delete any keysyms we have added, this is to
- * lessen our effect on the X server state if we are terminated abruptly
- * and cannot clear them and also to clear out any strange little used
- * ones that would just fill up the keymapping. 
- */
-void check_add_keysyms(void) {
-	static time_t last_check = 0;
-	int clear_freq = 300, quiet = 1, count; 
-	time_t now = time(NULL);
-
-	if (unixpw_in_progress) return;
-
-	if (now > last_check + clear_freq) {
-		count = count_added_keycodes();
-		/*
-		 * only really delete if they have not typed recently
-		 * and we have added 8 or more.
-		 */
-		if (now > last_keyboard_input + 5 && count >= 8) {
-			X_LOCK;
-			delete_added_keycodes(quiet);
-			X_UNLOCK;
-		}
-		last_check = now;
-	}
-}
-
-static KeySym added_keysyms[0x100];
-
-/* these are just for rfbLog messages: */
-static KeySym alltime_added_keysyms[1024];
-static int alltime_len = 1024;
-static int alltime_num = 0;
-
-int add_keysym(KeySym keysym) {
-	static int first = 1;
-	int n;
-#if NO_X11
-	if (first) {
-		for (n=0; n < 0x100; n++) {
-			added_keysyms[n] = NoSymbol;
-		}
-		first = 0;
-	}
-	RAWFB_RET(0)
-	if (!keysym) {}
-	return 0;
-#else
-	int minkey, maxkey, syms_per_keycode;
-	int kc, ret = 0;
-	KeySym *keymap;
-
-	if (first) {
-		for (n=0; n < 0x100; n++) {
-			added_keysyms[n] = NoSymbol;
-		}
-		first = 0;
-	}
-
-	RAWFB_RET(0)
-
-	if (keysym == NoSymbol) {
-		return 0;
-	}
-	/* there can be a race before MappingNotify */
-	for (n=0; n < 0x100; n++) {
-		if (added_keysyms[n] == keysym) {
-			return n;
-		}
-	}
-
-	XDisplayKeycodes(dpy, &minkey, &maxkey);
-	keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1),
-	    &syms_per_keycode);
-
-	for (kc = minkey+1; kc <= maxkey; kc++) {
-		int i, j, didmsg = 0, is_empty = 1;
-		char *str;
-		KeySym newks[8];
-
-		for (n=0; n < syms_per_keycode; n++) {
-			if (keymap[ (kc-minkey) * syms_per_keycode + n]
-			    != NoSymbol) {
-				is_empty = 0;
-				break;
-			}
-		}
-		if (! is_empty) {
-			continue;
-		}
-
-		for (i=0; i<8; i++) {
-			newks[i] = NoSymbol;
-		}
-		if (add_keysyms == 2) {
-			newks[0] = keysym;	/* XXX remove me */
-		} else {
-			for(i=0; i < syms_per_keycode; i++) {
-				newks[i] = keysym;
-				if (i >= 7) break;
-			}
-		}
-
-		XChangeKeyboardMapping(dpy, kc, syms_per_keycode,
-		    newks, 1);
-
-		if (alltime_num >= alltime_len) {
-			didmsg = 1;	/* something weird */
-		} else {
-			for (j=0; j<alltime_num; j++) {
-				if (alltime_added_keysyms[j] == keysym) {
-					didmsg = 1;
-					break;
-				}
-			}
-		}
-		if (! didmsg) {
-			str = XKeysymToString(keysym);
-			rfbLog("added missing keysym to X display: %03d "
-			    "0x%x \"%s\"\n", kc, keysym, str ? str : "null");
-
-			if (alltime_num < alltime_len) {
-				alltime_added_keysyms[alltime_num++] = keysym;
-			}
-		}
-
-		XFlush_wr(dpy);
-		added_keysyms[kc] = keysym;
-		ret = kc;
-		break;
-	}
-	XFree_wr(keymap);
-	return ret;
-#endif	/* NO_X11 */
-}
-
-static void delete_keycode(KeyCode kc, int bequiet) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!kc || !bequiet) {}
-	return;
-#else
-	int minkey, maxkey, syms_per_keycode, i;
-	KeySym *keymap;
-	KeySym ksym, newks[8];
-	char *str;
-
-	RAWFB_RET_VOID
-
-	XDisplayKeycodes(dpy, &minkey, &maxkey);
-	keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1),
-	    &syms_per_keycode);
-
-	for (i=0; i<8; i++) {
-		newks[i] = NoSymbol;
-	}
-
-	XChangeKeyboardMapping(dpy, kc, syms_per_keycode, newks, 1);
-
-	if (! bequiet && ! quiet) {
-		ksym = XKeycodeToKeysym(dpy, kc, 0);
-		str = XKeysymToString(ksym);
-		rfbLog("deleted keycode from X display: %03d 0x%x \"%s\"\n",
-		    kc, ksym, str ? str : "null");
-	}
-
-	XFree_wr(keymap);
-	XFlush_wr(dpy);
-#endif	/* NO_X11 */
-}
-
-static int count_added_keycodes(void) {
-	int kc, count = 0;
-	for (kc = 0; kc < 0x100; kc++) {
-		if (added_keysyms[kc] != NoSymbol) {
-			count++;
-		}
-	}
-	return count;
-}
-
-void delete_added_keycodes(int bequiet) {
-	int kc;
-	for (kc = 0; kc < 0x100; kc++) {
-		if (added_keysyms[kc] != NoSymbol) {
-			delete_keycode(kc, bequiet);
-			added_keysyms[kc] = NoSymbol;
-		}
-	}
-}
-
-/*
- * The following is for an experimental -remap option to allow the user
- * to remap keystrokes.  It is currently confusing wrt modifiers...
- */
-typedef struct keyremap {
-	KeySym before;
-	KeySym after;
-	int isbutton;
-	struct keyremap *next;
-} keyremap_t;
-
-static keyremap_t *keyremaps = NULL;
-
-static void add_remap(char *line) {
-	char str1[256], str2[256];
-	KeySym ksym1, ksym2;
-	int isbtn = 0;
-	unsigned int i;
-	static keyremap_t *current = NULL;
-	keyremap_t *remap;
-
-	if (sscanf(line, "%s %s", str1, str2) != 2) {
-		rfbLogEnable(1);
-		rfbLog("remap: invalid line: %s\n", line);
-		clean_up_exit(1);
-	}
-	if (sscanf(str1, "0x%x", &i) == 1) {
-		ksym1 = (KeySym) i;
-	} else {
-		ksym1 = XStringToKeysym(str1);
-	}
-	if (sscanf(str2, "0x%x", &i) == 1) {
-		ksym2 = (KeySym) i;
-	} else {
-		ksym2 = XStringToKeysym(str2);
-	}
-	if (ksym2 == NoSymbol) {
-		if (sscanf(str2, "Button%u", &i) == 1) {
-			ksym2 = (KeySym) i;
-			isbtn = 1; 
-		}
-	}
-	if (ksym1 == NoSymbol || ksym2 == NoSymbol) {
-		if (strcasecmp(str2, "NoSymbol") && strcasecmp(str2, "None")) {
-			rfbLog("warning: skipping invalid remap line: %s", line);
-			return;
-		}
-	}
-	remap = (keyremap_t *) malloc((size_t) sizeof(keyremap_t));
-	remap->before = ksym1;
-	remap->after  = ksym2;
-	remap->isbutton = isbtn;
-	remap->next   = NULL;
-
-	rfbLog("remapping: (%s, 0x%x) -> (%s, 0x%x) isbtn=%d\n", str1,
-	    ksym1, str2, ksym2, isbtn);
-
-	if (keyremaps == NULL) {
-		keyremaps = remap;
-	} else {
-		current->next = remap;
-	}
-	current = remap;
-}
-
-static void add_dead_keysyms(char *str) {
-	char *p, *q;
-	int i;
-	char *list[] = {
-		"g grave dead_grave",
-		"a acute dead_acute",
-		"c asciicircum dead_circumflex",
-		"t asciitilde dead_tilde",
-		"m macron dead_macron",
-		"b breve dead_breve",
-		"D abovedot dead_abovedot",
-		"d diaeresis dead_diaeresis",
-		"o degree dead_abovering",
-		"A doubleacute dead_doubleacute",
-		"r caron dead_caron",
-		"e cedilla dead_cedilla",
-/*		"x XXX-ogonek dead_ogonek", */
-/*		"x XXX-belowdot dead_belowdot", */
-/*		"x XXX-hook dead_hook", */
-/*		"x XXX-horn dead_horn", */
-		NULL
-	};
-
-	p = str;
-
-	while (*p != '\0') {
-		if (isspace((unsigned char) (*p))) {
-			*p = '\0';
-		}
-		p++;
-	}
-
-	if (!strcmp(str, "DEAD")) {
-		for (i = 0; list[i] != NULL; i++) {
-			p = list[i] + 2;
-			add_remap(p);
-		}
-	} else if (!strcmp(str, "DEAD=missing")) {
-		for (i = 0; list[i] != NULL; i++) {
-			KeySym ksym, ksym2;
-			int inmap = 0;
-
-			p = strdup(list[i] + 2);
-			q = strchr(p, ' ');
-			if (q == NULL) {
-				free(p);
-				continue;
-			}
-			*q = '\0';
-			ksym = XStringToKeysym(p);
-			*q = ' ';
-			if (ksym == NoSymbol) {
-				free(p);
-				continue;
-			}
-			if (XKeysymToKeycode(dpy, ksym)) {
-				inmap = 1;
-			}
-#if LIBVNCSERVER_HAVE_XKEYBOARD
-			if (! inmap && xkb_present && dpy) {
-				int kc, grp, lvl;
-				for (kc = 0; kc < 0x100; kc++) {
-				    for (grp = 0; grp < 4; grp++) {
-					for (lvl = 0; lvl < 8; lvl++) {
-						ksym2 = XkbKeycodeToKeysym(dpy,
-						    kc, grp, lvl);
-						if (ksym2 == NoSymbol) {
-							continue;
-						}
-						if (ksym2 == ksym) {
-							inmap = 1;
-							break;
-						}
-					}
-				    }
-				}
-			}
-#else
-			if ((ksym2 = 0)) {}
-#endif
-			if (! inmap) {
-				add_remap(p);
-			}
-			free(p);
-		}
-	} else if ((p = strchr(str, '=')) != NULL) {
-		while (*p != '\0') {
-			for (i = 0; list[i] != NULL; i++) {
-				q = list[i];
-				if (*p == *q) {
-					q += 2;
-					add_remap(q);
-					break;
-				}
-			}
-			p++;
-		}
-	}
-}
-
-/*
- * process the -remap string (file or mapping string)
- */
-void initialize_remap(char *infile) {
-	FILE *in;
-	char *p, *q, line[256];
-
-	if (keyremaps != NULL) {
-		/* free last remapping */
-		keyremap_t *next_remap, *curr_remap = keyremaps;
-		while (curr_remap != NULL) {
-			next_remap = curr_remap->next;
-			free(curr_remap);
-			curr_remap = next_remap;
-		}
-		keyremaps = NULL;
-	}
-	if (infile == NULL || *infile == '\0') {
-		/* just unset remapping */
-		return;
-	}
-
-	in = fopen(infile, "r"); 
-	if (in == NULL) {
-		/* assume cmd line key1-key2,key3-key4 */
-		if (strstr(infile, "DEAD") == infile) {
-			;
-		} else if (!strchr(infile, '-')) {
-			rfbLogEnable(1);
-			rfbLog("remap: cannot open: %s\n", infile);
-			rfbLogPerror("fopen");
-			clean_up_exit(1);
-		}
-		if ((in = tmpfile()) == NULL) {
-			rfbLogEnable(1);
-			rfbLog("remap: cannot open tmpfile for %s\n", infile);
-			rfbLogPerror("tmpfile");
-			clean_up_exit(1);
-		}
-
-		/* copy in the string to file format */
-		p = infile;
-		while (*p) {
-			if (*p == '-') {
-				fprintf(in, " ");
-			} else if (*p == ',' || *p == ' ' ||  *p == '\t') {
-				fprintf(in, "\n");
-			} else {
-				fprintf(in, "%c", *p);
-			}
-			p++;
-		}
-		fprintf(in, "\n");
-		fflush(in);	
-		rewind(in);
-	}
-
-	while (fgets(line, 256, in) != NULL) {
-		p = lblanks(line);
-		if (*p == '\0') {
-			continue;
-		}
-		if (strchr(line, '#')) {
-			continue;
-		}
-
-		if (strstr(p, "DEAD") == p)  {
-			add_dead_keysyms(p);
-			continue;
-		}
-		if ((q = strchr(line, '-')) != NULL) {
-			/* allow Keysym1-Keysym2 notation */
-			*q = ' ';	
-		}
-		add_remap(p);
-	}
-	fclose(in);
-}
-
-/*
- * preliminary support for using the Xkb (XKEYBOARD) extension for handling
- * user input.  inelegant, slow, and incomplete currently... but initial
- * tests show it is useful for some setups.
- */
-typedef struct keychar {
-	KeyCode code;
-	int group;
-	int level;
-} keychar_t;
-
-/* max number of key groups and shift levels we consider */
-#define GRP 4
-#define LVL 8
-static int lvl_max, grp_max, kc_min, kc_max;
-static KeySym xkbkeysyms[0x100][GRP][LVL];
-static unsigned int xkbstate[0x100][GRP][LVL];
-static unsigned int xkbignore[0x100][GRP][LVL];
-static unsigned int xkbmodifiers[0x100][GRP][LVL];
-static int multi_key[0x100], mode_switch[0x100], skipkeycode[0x100];
-static int shift_keys[0x100];
-
-/*
- * for trying to order the keycodes to avoid problems, note the
- * *first* keycode bound to it.  kc_vec will be a permutation
- * of 1...256 to get them in the preferred order.
- */
-static int kc_vec[0x100];
-static int kc1_shift, kc1_control, kc1_caplock, kc1_alt;
-static int kc1_meta, kc1_numlock, kc1_super, kc1_hyper;
-static int kc1_mode_switch, kc1_iso_level3_shift, kc1_multi_key;
-	
-int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new_kc) {
-	if (!sloppy_keys) {
-		return 0;
-	}
-
-	RAWFB_RET(0)
-#if NO_X11
-	if (!key || !down || !keysym || !new_kc) {}
-	return 0;
-#else
-	
-	if (!down && !keycode_state[key] && !IsModifierKey(keysym)) {
-		int i, cnt = 0, downkey = -1;
-		int nmods_down = track_mod_state(NoSymbol, FALSE, FALSE);
-		int mods_down[256];
-
-		if (nmods_down) {
-			/* tracking to skip down modifier keycodes. */
-			for(i=0; i<256; i++) {
-				mods_down[i] = 0;
-			}
-			i = 0;
-			while (simple_mods[i] != NoSymbol) {
-				KeySym ksym = simple_mods[i];
-				KeyCode k = XKeysymToKeycode(dpy, ksym);
-				if (k != NoSymbol && keycode_state[(int) k]) {
-					mods_down[(int) k] = 1;
-				}
-				
-				i++;
-			}
-		}
-		/*
-		 * the keycode is already up... look for a single one
-		 * (non modifier) that is down
-		 */
-		for (i=0; i<256; i++) {
-			if (keycode_state[i]) {
-				if (nmods_down && mods_down[i]) {
-					continue;
-				}
-				cnt++;
-				downkey = i;
-			}
-		}
-		if (cnt == 1) {
-			if (debug_keyboard) {
-				fprintf(stderr, "    sloppy_keys: %d/0x%x "
-				    "-> %d/0x%x  (nmods: %d)\n", (int) key,
-				    (int) key, downkey, downkey, nmods_down);
-			}
-			*new_kc = downkey;
-			return 1;
-		}
-	}
-	return 0;
-#endif	/* NO_X11 */
-}
-
-#if !LIBVNCSERVER_HAVE_XKEYBOARD || SKIP_XKB
-
-/* empty functions for no xkb */
-static void initialize_xkb_modtweak(void) {}
-static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
-    rfbClientPtr client) {
-	if (!client || !down || !keysym) {} /* unused vars warning: */
-}
-void switch_to_xkb_if_better(void) {}
-
-#else
-
-void switch_to_xkb_if_better(void) {
-	KeySym keysym, *keymap;
-	int miss_noxkb[256], miss_xkb[256], missing_noxkb = 0, missing_xkb = 0;
-	int i, j, k, n, minkey, maxkey, syms_per_keycode;
-	int syms_gt_4 = 0;
-	int kc, grp, lvl;
-
-	/* non-alphanumeric on us keyboard */
-	KeySym must_have[] = {
-		XK_exclam,
-		XK_at,
-		XK_numbersign,
-		XK_dollar,
-		XK_percent,
-/*		XK_asciicircum, */
-		XK_ampersand,
-		XK_asterisk,
-		XK_parenleft,
-		XK_parenright,
-		XK_underscore,
-		XK_plus,
-		XK_minus,
-		XK_equal,
-		XK_bracketleft,
-		XK_bracketright,
-		XK_braceleft,
-		XK_braceright,
-		XK_bar,
-		XK_backslash,
-		XK_semicolon,
-/*		XK_apostrophe, */
-		XK_colon,
-		XK_quotedbl,
-		XK_comma,
-		XK_period,
-		XK_less,
-		XK_greater,
-		XK_slash,
-		XK_question,
-/*		XK_asciitilde, */
-/*		XK_grave, */
-		NoSymbol
-	};
-
-	if (! use_modifier_tweak || got_noxkb) {
-		return;
-	}
-	if (use_xkb_modtweak) {
-		/* already using it */
-		return;
-	}
-	RAWFB_RET_VOID
-
-	XDisplayKeycodes(dpy, &minkey, &maxkey);
-
-	keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1),
-	    &syms_per_keycode);
-
-	/* handle alphabetic char with only one keysym (no upper + lower) */
-	for (i = minkey; i <= maxkey; i++) {
-		KeySym lower, upper;
-		/* 2nd one */
-		keysym = keymap[(i - minkey) * syms_per_keycode + 1];
-		if (keysym != NoSymbol) {
-			continue;
-		}
-		/* 1st one */
-		keysym = keymap[(i - minkey) * syms_per_keycode + 0];
-		if (keysym == NoSymbol) {
-			continue;
-		}
-		XConvertCase(keysym, &lower, &upper);
-		if (lower != upper) {
-			keymap[(i - minkey) * syms_per_keycode + 0] = lower;
-			keymap[(i - minkey) * syms_per_keycode + 1] = upper;
-		}
-	}
-
-	k = 0;
-	while (must_have[k] != NoSymbol) {
-		int gotit = 0;
-		KeySym must = must_have[k];
-		for (i = minkey; i <= maxkey; i++) {
-		    for (j = 0; j < syms_per_keycode; j++) {
-			keysym = keymap[(i-minkey) * syms_per_keycode + j];
-			if (j >= 4) {
-			    if (k == 0 && keysym != NoSymbol) {
-				/* for k=0 count the high keysyms */
-				syms_gt_4++;
-				if (debug_keyboard > 1) {
-					char *str = XKeysymToString(keysym);
-					fprintf(stderr, "- high keysym mapping"
-					    ": at %3d j=%d "
-					    "'%s'\n", i, j, str ? str : "null");
-				}
-			    }
-			    continue;
-			}
-			if (keysym == must) {
-				if (debug_keyboard > 1) {
-					char *str = XKeysymToString(must);
-					fprintf(stderr, "- at %3d j=%d found "
-					    "'%s'\n", i, j, str ? str : "null");
-				}
-				/* n.b. do not break, see syms_gt_4 above. */
-				gotit = 1;
-			}
-		    }
-		}
-		if (! gotit) {
-			if (debug_keyboard > 1) {
-				char *str = XKeysymToString(must);
-				KeyCode kc = XKeysymToKeycode(dpy, must);
-				fprintf(stderr, "- did not find 0x%lx '%s'\t"
-				    "Ks2Kc: %d\n", must, str ? str:"null", kc); 
-				if (kc != None) {
-					int j2;
-					for(j2=0; j2<syms_per_keycode; j2++) {
-						keysym = keymap[(kc-minkey) *
-						    syms_per_keycode + j2];
-						fprintf(stderr, "  %d=0x%lx",
-						    j2, keysym);
-					}
-					fprintf(stderr, "\n");
-				}
-			}
-			missing_noxkb++;
-			miss_noxkb[k] = 1;
-		} else {
-			miss_noxkb[k] = 0;
-		}
-		k++;
-	}
-	n = k;
-
-	XFree_wr(keymap);
-	if (missing_noxkb == 0 && syms_per_keycode > 4 && syms_gt_4 >= 0) {
-		/* we used to have syms_gt_4 >= 8, now always on. */
-		if (! raw_fb_str) {
-			rfbLog("\n");
-			rfbLog("XKEYBOARD: number of keysyms per keycode %d is greater\n", syms_per_keycode);
-			rfbLog("  than 4 and %d keysyms are mapped above 4.\n", syms_gt_4);
-			rfbLog("  Automatically switching to -xkb mode.\n");
-			rfbLog("  If this makes the key mapping worse you can\n");
-			rfbLog("  disable it with the \"-noxkb\" option.\n");
-			rfbLog("  Also, remember \"-remap DEAD\" for accenting characters.\n");
-			rfbLog("\n");
-		}
-
-		use_xkb_modtweak = 1;
-		return;
-
-	} else if (missing_noxkb == 0) {
-		if (! raw_fb_str) {
-			rfbLog("\n");
-			rfbLog("XKEYBOARD: all %d \"must have\" keysyms accounted for.\n", n);
-			rfbLog("  Not automatically switching to -xkb mode.\n");
-			rfbLog("  If some keys still cannot be typed, try using -xkb.\n");
-			rfbLog("  Also, remember \"-remap DEAD\" for accenting characters.\n");
-			rfbLog("\n");
-		}
-		return;
-	}
-
-	for (k=0; k<n; k++) {
-		miss_xkb[k] = 1;
-	}
-
-	for (kc = 0; kc < 0x100; kc++) {
-	    for (grp = 0; grp < GRP; grp++) {
-		for (lvl = 0; lvl < LVL; lvl++) {
-			/* look up the Keysym, if any */
-			keysym = XkbKeycodeToKeysym(dpy, kc, grp, lvl);
-			if (keysym == NoSymbol) {
-				continue;
-			}
-			for (k=0; k<n; k++) {
-				if (keysym == must_have[k]) {
-					miss_xkb[k] = 0;
-				}
-			}
-		}
-	    }
-	}
-
-	for (k=0; k<n; k++) {
-		if (miss_xkb[k]) {
-			missing_xkb++;
-		}
-	}
-
-	rfbLog("\n");
-	if (missing_xkb < missing_noxkb) {
-		rfbLog("XKEYBOARD:\n");
-		rfbLog("Switching to -xkb mode to recover these keysyms:\n");
-	} else {
-		rfbLog("XKEYBOARD: \"must have\" keysyms better accounted"
-		    " for\n");
-		rfbLog("under -noxkb mode: not switching to -xkb mode:\n");
-	}
-
-	rfbLog("   xkb  noxkb   Keysym  (\"X\" means present)\n");
-	rfbLog("   ---  -----   -----------------------------\n");
-	for (k=0; k<n; k++) {
-		char *xx, *xn, *name;
-
-		keysym = must_have[k];
-		if (keysym == NoSymbol) {
-			continue;
-		}
-		if (!miss_xkb[k] && !miss_noxkb[k]) {
-			continue;
-		}
-		if (miss_xkb[k]) {
-			xx = "   ";
-		} else {
-			xx = " X ";
-		}
-		if (miss_noxkb[k]) {
-			xn = "   ";
-		} else {
-			xn = " X ";
-		}
-		name = XKeysymToString(keysym);
-		rfbLog("   %s  %s     0x%lx  %s\n", xx, xn, keysym,
-		    name ? name : "null");
-	}
-	rfbLog("\n");
-
-	if (missing_xkb < missing_noxkb) {
-		rfbLog("  If this makes the key mapping worse you can\n");
-		rfbLog("  disable it with the \"-noxkb\" option.\n");
-		rfbLog("\n");
-
-		use_xkb_modtweak = 1;
-
-	} else {
-		rfbLog("  If some keys still cannot be typed, try using"
-		    " -xkb.\n");
-		rfbLog("  Also, remember \"-remap DEAD\" for accenting"
-		    " characters.\n");
-	}
-	rfbLog("\n");
-}
-
-/* sets up all the keymapping info via Xkb API */
-
-static void initialize_xkb_modtweak(void) {
-	KeySym ks;
-	int kc, grp, lvl, k;
-	unsigned int state;
-
-/*
- * Here is a guide:
-
-Workarounds arrays:
-
-multi_key[]     indicates which keycodes have Multi_key (Compose)
-                bound to them.
-mode_switch[]   indicates which keycodes have Mode_switch (AltGr)
-                bound to them.
-shift_keys[]    indicates which keycodes have Shift bound to them.
-skipkeycode[]   indicates which keycodes are to be skipped
-                for any lookups from -skip_keycodes option. 
-
-Groups and Levels, here is an example:
-                                                                  
-      ^          --------                                      
-      |      L2 | A   AE |                                      
-    shift       |        |                                      
-    level    L1 | a   ae |                                      
-                 --------                                      
-                  G1  G2                                        
-                                                                
-                  group ->                                      
-
-Traditionally this it all a key could do.  L1 vs. L2 selected via Shift
-and G1 vs. G2 selected via Mode_switch.  Up to 4 Keysyms could be bound
-to a key.  See initialize_modtweak() for an example of using that type
-of keymap from XGetKeyboardMapping().
-
-Xkb gives us up to 4 groups and 63 shift levels per key, with the
-situation being potentially different for each key.  This is complicated,
-and I don't claim to understand it all, but in the following we just think
-of ranging over the group and level indices as covering all of the cases.
-This gives us an accurate view of the keymap.  The main tricky part
-is mapping between group+level and modifier state.
-
-On current linux/XFree86 setups (Xkb is enabled by default) the
-information from XGetKeyboardMapping() (evidently the compat map)
-is incomplete and inaccurate, so we are really forced to use the
-Xkb API.
-
-xkbkeysyms[]      For a (keycode,group,level) holds the KeySym (0 for none)
-xkbstate[]        For a (keycode,group,level) holds the corresponding
-                  modifier state needed to get that KeySym
-xkbignore[]       For a (keycode,group,level) which modifiers can be
-                  ignored (the 0 bits can be ignored).
-xkbmodifiers[]    For the KeySym bound to this (keycode,group,level) store
-                  the modifier mask.   
- *
- */
-
-	RAWFB_RET_VOID
-
-	/* initialize all the arrays: */
-	for (kc = 0; kc < 0x100; kc++) {
-		multi_key[kc] = 0;
-		mode_switch[kc] = 0;
-		skipkeycode[kc] = 0;
-		shift_keys[kc] = 0;
-
-		for (grp = 0; grp < GRP; grp++) {
-			for (lvl = 0; lvl < LVL; lvl++) {
-				xkbkeysyms[kc][grp][lvl] = NoSymbol;
-				xkbmodifiers[kc][grp][lvl] = -1;
-				xkbstate[kc][grp][lvl] = -1;
-			}
-		}
-	}
-
-	/*
-	 * the array is 256*LVL*GRP, but we can make the searched region
-	 * smaller by computing the actual ranges.
-	 */
-	lvl_max = 0;
-	grp_max = 0;
-	kc_max = 0;
-	kc_min = 0x100;
-
-	/* first keycode for a modifier type (multi_key too) */
-	kc1_shift = -1;
-	kc1_control = -1;
-	kc1_caplock = -1;
-	kc1_alt = -1;
-	kc1_meta = -1;
-	kc1_numlock = -1;
-	kc1_super = -1;
-	kc1_hyper = -1;
-	kc1_mode_switch = -1;
-	kc1_iso_level3_shift = -1;
-	kc1_multi_key = -1;
-
-	/*
-	 * loop over all possible (keycode, group, level) triples
-	 * and record what we find for it:
-	 */
-	if (debug_keyboard) {
-		rfbLog("initialize_xkb_modtweak: XKB keycode -> keysyms "
-		    "mapping info:\n");
-	}
-	for (kc = 0; kc < 0x100; kc++) {
-	    for (grp = 0; grp < GRP; grp++) {
-		for (lvl = 0; lvl < LVL; lvl++) {
-			unsigned int ms, mods;
-			int state_save = -1, mods_save = -1;
-			KeySym ks2;
-
-			/* look up the Keysym, if any */
-			ks = XkbKeycodeToKeysym(dpy, kc, grp, lvl);
-			xkbkeysyms[kc][grp][lvl] = ks;
-
-			/* if no Keysym, on to next */
-			if (ks == NoSymbol) {
-				continue;
-			}
-			/*
-			 * for various workarounds, note where these special
-			 * keys are bound to.
-			 */
-			if (ks == XK_Multi_key) {
-				multi_key[kc] = lvl+1;
-			}
-			if (ks == XK_Mode_switch) {
-				mode_switch[kc] = lvl+1;
-			}
-			if (ks == XK_Shift_L || ks == XK_Shift_R) {
-				shift_keys[kc] = lvl+1;
-			}
-
-			if (ks == XK_Shift_L || ks == XK_Shift_R) {
-				if (kc1_shift == -1) {
-					kc1_shift = kc;
-				}
-			}
-			if (ks == XK_Control_L || ks == XK_Control_R) {
-				if (kc1_control == -1) {
-					kc1_control = kc;
-				}
-			}
-			if (ks == XK_Caps_Lock || ks == XK_Caps_Lock) {
-				if (kc1_caplock == -1) {
-					kc1_caplock = kc;
-				}
-			}
-			if (ks == XK_Alt_L || ks == XK_Alt_R) {
-				if (kc1_alt == -1) {
-					kc1_alt = kc;
-				}
-			}
-			if (ks == XK_Meta_L || ks == XK_Meta_R) {
-				if (kc1_meta == -1) {
-					kc1_meta = kc;
-				}
-			}
-			if (ks == XK_Num_Lock) {
-				if (kc1_numlock == -1) {
-					kc1_numlock = kc;
-				}
-			}
-			if (ks == XK_Super_L || ks == XK_Super_R) {
-				if (kc1_super == -1) {
-					kc1_super = kc;
-				}
-			}
-			if (ks == XK_Hyper_L || ks == XK_Hyper_R) {
-				if (kc1_hyper == -1) {
-					kc1_hyper = kc;
-				}
-			}
-			if (ks == XK_Mode_switch) {
-				if (kc1_mode_switch == -1) {
-					kc1_mode_switch = kc;
-				}
-			}
-			if (ks == XK_ISO_Level3_Shift) {
-				if (kc1_iso_level3_shift == -1) {
-					kc1_iso_level3_shift = kc;
-				}
-			}
-			if (ks == XK_Multi_key) {	/* not a modifier.. */
-				if (kc1_multi_key == -1) {
-					kc1_multi_key = kc;
-				}
-			}
-
-			/*
-			 * record maximum extent for group/level indices
-			 * and keycode range:
-			 */
-			if (grp > grp_max) {
-				grp_max = grp;
-			}
-			if (lvl > lvl_max) {
-				lvl_max = lvl;
-			}
-			if (kc > kc_max) {
-				kc_max = kc;
-			}
-			if (kc < kc_min) {
-				kc_min = kc;
-			}
-
-			/*
-			 * lookup on *keysym* (i.e. not kc, grp, lvl)
-			 * and get the modifier mask.  this is 0 for
-			 * most keysyms, only non zero for modifiers.
-			 */
-			ms = XkbKeysymToModifiers(dpy, ks);
-			xkbmodifiers[kc][grp][lvl] = ms;
-
-			/*
-			 * Amusing heuristic (may have bugs).  There are
-			 * 8 modifier bits, so 256 possible modifier
-			 * states.  We loop over all of them for this
-			 * keycode (simulating Key "events") and ask
-			 * XkbLookupKeySym to tell us the Keysym.  Once it
-			 * matches the Keysym we have for this (keycode,
-			 * group, level), gotten via XkbKeycodeToKeysym()
-			 * above, we then (hopefully...) know that state
-			 * of modifiers needed to generate this keysym.
-			 *
-			 * Yes... keep your fingers crossed.
-			 *
-			 * Note that many of the 256 states give the
-			 * Keysym, we just need one, and we take the
-			 * first one found.
-			 */
-			state = 0;
-			while(state < 256) {
-				if (XkbLookupKeySym(dpy, kc, state, &mods,
-				    &ks2)) {
-
-					/* save these for workaround below */
-					if (state_save == -1) {
-						state_save = state;
-						mods_save = mods;
-					}
-					if (ks2 == ks) {
-						/*
-						 * zero the irrelevant bits
-						 * by anding with mods.
-						 */
-						xkbstate[kc][grp][lvl]
-						    = state & mods;
-						/*
-						 * also remember the irrelevant
-						 * bits since it is handy.
-						 */
-						xkbignore[kc][grp][lvl] = mods;
-
-						break;
-					}
-				}
-				state++;
-			}
-			if (xkbstate[kc][grp][lvl] == (unsigned int) -1
-			    && grp == 1) {
-				/*
-				 * Hack on Solaris 9 for Mode_switch
-				 * for Group2 characters.  We force the 
-				 * Mode_switch modifier bit on.
-				 * XXX Need to figure out better what is
-				 * happening here.  Is compat on somehow??
-				 */
-				unsigned int ms2;
-				ms2 = XkbKeysymToModifiers(dpy, XK_Mode_switch);
-
-				xkbstate[kc][grp][lvl]
-				    = (state_save & mods_save) | ms2;
-
-				xkbignore[kc][grp][lvl] = mods_save | ms2;
-			}
-
-			if (debug_keyboard) {
-				char *str;
-				fprintf(stderr, "  %03d  G%d L%d  mod=%s ",
-				    kc, grp+1, lvl+1, bitprint(ms, 8));
-				fprintf(stderr, "state=%s ",
-				    bitprint(xkbstate[kc][grp][lvl], 8));
-				fprintf(stderr, "ignore=%s ",
-				    bitprint(xkbignore[kc][grp][lvl], 8));
-				str = XKeysymToString(ks);
-				fprintf(stderr, " ks=0x%08lx \"%s\"\n",
-				    ks, str ? str : "null");
-			}
-		}
-	    }
-	}
-
-	/*
-	 * kc_vec will be used in some places to find modifiers, etc
-	 * we apply some permutations to it as workarounds.
-	 */
-	for (kc = 0; kc < 0x100; kc++) {
-		kc_vec[kc] = kc;
-	}
-
-	if (kc1_mode_switch != -1 && kc1_iso_level3_shift != -1) {
-		if (kc1_mode_switch < kc1_iso_level3_shift) {
-			/* we prefer XK_ISO_Level3_Shift: */
-			kc_vec[kc1_mode_switch] = kc1_iso_level3_shift;
-			kc_vec[kc1_iso_level3_shift] = kc1_mode_switch;
-		}
-	}
-	/* any more? need to watch for undoing the above. */
-
-	/*
-	 * process the user supplied -skip_keycodes string.
-	 * This is presumably a list if "ghost" keycodes, the X server
-	 * thinks they exist, but they do not.  ghosts can lead to
-	 * ambiguities in the reverse map: Keysym -> KeyCode + Modstate,
-	 * so if we can ignore them so much the better.  Presumably the
-	 * user can never generate them from the physical keyboard.
-	 * There may be other reasons to deaden some keys.
-	 */
-	if (skip_keycodes != NULL) {
-		char *p, *str = strdup(skip_keycodes);
-		p = strtok(str, ", \t\n\r");
-		while (p) {
-			k = 1;
-			if (sscanf(p, "%d", &k) != 1 || k < 0 || k >= 0x100) {
-				rfbLogEnable(1);
-				rfbLog("invalid skip_keycodes: %s %s\n",
-				    skip_keycodes, p);
-				clean_up_exit(1);
-			}
-			skipkeycode[k] = 1;
-			p = strtok(NULL, ", \t\n\r");
-		}
-		free(str);
-	}
-	if (debug_keyboard) {
-		fprintf(stderr, "grp_max=%d lvl_max=%d\n", grp_max, lvl_max);
-	}
-}
-
-static short **score_hint = NULL;
-/*
- * Called on user keyboard input.  Try to solve the reverse mapping
- * problem: KeySym (from VNC client) => KeyCode(s) to press to generate
- * it.  The one-to-many KeySym => KeyCode mapping makes it difficult, as
- * does working out what changes to the modifier keypresses are needed.
- */
-static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
-    rfbClientPtr client) {
-
-	int kc, grp, lvl, i, kci;
-	int kc_f[0x100], grp_f[0x100], lvl_f[0x100], state_f[0x100], found;
-	int ignore_f[0x100];
-	unsigned int state = 0;
-
-
-	/* these are used for finding modifiers, etc */
-	XkbStateRec kbstate;
-	int got_kbstate = 0;
-	int Kc_f, Grp_f = 0, Lvl_f = 0;
-#	define KLAST 10
-	static int Kc_last_down[KLAST];
-	static KeySym Ks_last_down[KLAST];
-	static int klast = 0, khints = 1, anydown = 1;
-	static int cnt = 0;
-
-	if (!client || !down || !keysym) {} /* unused vars warning: */
-
-	RAWFB_RET_VOID
-
-	X_LOCK;
-
-	if (klast == 0) {
-		int i, j;
-		for (i=0; i<KLAST; i++) {
-			Kc_last_down[i] = -1;
-			Ks_last_down[i] = NoSymbol;
-		}
-		if (getenv("NOKEYHINTS")) {
-			khints = 0;
-		}
-		if (getenv("NOANYDOWN")) {
-			anydown = 0;
-		}
-		if (getenv("KEYSDOWN")) {
-			klast = atoi(getenv("KEYSDOWN"));
-			if (klast < 1) klast = 1;
-			if (klast > KLAST) klast = KLAST;
-		} else {
-			klast = 3;
-		}
-		if (khints && score_hint == NULL) {
-			score_hint = (short **) malloc(0x100 * sizeof(short *));
-			for (i=0; i<0x100; i++) {
-				score_hint[i] = (short *) malloc(0x100 * sizeof(short));
-			}
-			
-			for (i=0; i<0x100; i++) {
-				for (j=0; j<0x100; j++) {
-					score_hint[i][j] = -1;
-				}
-			}
-		}
-	}
-	cnt++;
-	if (cnt % 100 && khints && score_hint != NULL) {
-		int i, j;
-		for (i=0; i<0x100; i++) {
-			for (j=0; j<0x100; j++) {
-				score_hint[i][j] = -1;
-			}
-		}
-	}
-
-	if (debug_keyboard) {
-		char *str = XKeysymToString(keysym);
-
-		if (debug_keyboard > 1) {
-			rfbLog("----------start-xkb_tweak_keyboard (%s) "
-			    "--------\n", down ? "DOWN" : "UP");
-		}
-
-		rfbLog("xkb_tweak_keyboard: %s keysym=0x%x \"%s\"\n",
-		    down ? "down" : "up", (int) keysym, str ? str : "null");
-	}
-
-	/*
-	 * set everything to not-yet-found.
-	 * these "found" arrays (*_f) let us dynamically consider the
-	 * one-to-many Keysym -> Keycode issue.  we set the size at 256,
-	 * but of course only very few will be found.
-	 */
-	for (i = 0; i < 0x100; i++) {
-		kc_f[i]    = -1;
-		grp_f[i]   = -1;
-		lvl_f[i]   = -1;
-		state_f[i] = -1;
-		ignore_f[i] = -1;
-	}
-	found = 0;
-
-	/*
-	 * loop over all (keycode, group, level) triples looking for
-	 * matching keysyms.  Amazingly this isn't slow (but maybe if
-	 * you type really fast...).  Hash lookup into a linked list of
-	 * (keycode,grp,lvl) triples would be the way to improve this
-	 * in the future if needed.
-	 */
-	for (kc = kc_min; kc <= kc_max; kc++) {
-	    for (grp = 0; grp < grp_max+1; grp++) {
-		for (lvl = 0; lvl < lvl_max+1; lvl++) {
-			if (keysym != xkbkeysyms[kc][grp][lvl]) {
-				continue;
-			}
-			/* got a keysym match */
-			state = xkbstate[kc][grp][lvl];
-
-			if (debug_keyboard > 1) {
-				char *s1, *s2;
-				s1 = XKeysymToString(XKeycodeToKeysym(dpy,
-				    kc, 0));
-				if (! s1) s1 = "null";
-				s2 = XKeysymToString(keysym);
-				if (! s2) s2 = "null";
-				fprintf(stderr, "  got match kc=%03d=0x%02x G%d"
-				    " L%d  ks=0x%x \"%s\"  (basesym: \"%s\")\n",
-				    kc, kc, grp+1, lvl+1, keysym, s2, s1);
-				fprintf(stderr, "    need state: %s\n",
-				    bitprint(state, 8));
-				fprintf(stderr, "    ignorable : %s\n",
-				    bitprint(xkbignore[kc][grp][lvl], 8));
-			}
-
-			/* save it if state is OK and not told to skip */
-			if (state == (unsigned int) -1) {
-				continue;
-			}
-			if (skipkeycode[kc] && debug_keyboard) {
-				fprintf(stderr, "    xxx skipping keycode: %d "
-				   "G%d/L%d\n", kc, grp+1, lvl+1);
-			}
-			if (skipkeycode[kc]) {
-				continue;
-			}
-			if (found > 0 && kc == kc_f[found-1]) {
-				/* ignore repeats for same keycode */
-				continue;
-			}
-			kc_f[found] = kc;
-			grp_f[found] = grp;
-			lvl_f[found] = lvl;
-			state_f[found] = state;
-			ignore_f[found] = xkbignore[kc][grp][lvl];
-			found++;
-		}
-	    }
-	}
-
-#define PKBSTATE  \
-	fprintf(stderr, "    --- current mod state:\n"); \
-	fprintf(stderr, "    mods      : %s\n", bitprint(kbstate.mods, 8)); \
-	fprintf(stderr, "    base_mods : %s\n", bitprint(kbstate.base_mods, 8)); \
-	fprintf(stderr, "    latch_mods: %s\n", bitprint(kbstate.latched_mods, 8)); \
-	fprintf(stderr, "    lock_mods : %s\n", bitprint(kbstate.locked_mods, 8)); \
-	fprintf(stderr, "    compat    : %s\n", bitprint(kbstate.compat_state, 8));
-
-	/*
-	 * Now get the current state of the keyboard from the X server.
-	 * This seems to be the safest way to go as opposed to our
-	 * keeping track of the modifier state on our own.  Again,
-	 * this is fortunately not too slow.
-	 */
-
-	if (debug_keyboard > 1) {
-		/* get state early for debug output */
-		XkbGetState(dpy, XkbUseCoreKbd, &kbstate);
-		got_kbstate = 1;
-		PKBSTATE
-	}
-
-	if (!found && add_keysyms && keysym && ! IsModifierKey(keysym)) {
-		int new_kc = add_keysym(keysym);
-		if (new_kc != 0) {
-			found = 1;
-			kc_f[0] = new_kc;
-			grp_f[0] = 0; 
-			lvl_f[0] = 0; 
-			state_f[0] = 0;
-		}
-	}
-
-	if (!found && debug_keyboard) {
-		char *str = XKeysymToString(keysym);
-		fprintf(stderr, "    *** NO key found for: 0x%x %s  "
-		    "*keystroke ignored*\n", keysym, str ? str : "null");
-	}
-	if (!found) {
-		X_UNLOCK;
-		return;
-	}
-
-	/* 
-	 * we try to optimize here if found > 1
-	 * e.g. minimize lvl or grp, or other things to give
-	 * "safest" scenario to simulate the keystrokes.
-	 */
-
-	if (found > 1) {
-		if (down) {
-			int l, score[0x100];
-			int best = 0, best_score = -1;
-			/* need to break the tie... */
-			if (! got_kbstate) {
-				XkbGetState(dpy, XkbUseCoreKbd, &kbstate);
-				got_kbstate = 1;
-			}
-			if (khints && keysym < 0x100) {
-				int ks = (int) keysym, j;
-				for (j=0; j< 0x100; j++) {
-					score_hint[ks][j] = -1;
-				}
-			}
-			for (l=0; l < found; l++) {
-				int myscore = 0, b = 0x1, i;
-				int curr, curr_state = kbstate.mods;
-				int need, need_state = state_f[l];
-				int ignore_state = ignore_f[l];
-
-				/* see how many modifiers need to be changed */
-				for (i=0; i<8; i++) {
-					curr = b & curr_state;
-					need = b & need_state;
-					if (! (b & ignore_state)) {
-						;
-					} else if (curr == need) {
-						;
-					} else {
-						myscore++;
-					}
-					b = b << 1;
-				}
-				myscore *= 100;
-
-				/* throw in some minimization of lvl too: */
-				myscore += 2*lvl_f[l] + grp_f[l];
-
-				/*
-				 * XXX since we now internally track
-				 * keycode_state[], we could throw that into
-				 * the score as well.  I.e. if it is already
-				 * down, it is pointless to think we can
-				 * press it down further!  E.g.
-				 *   myscore += 1000 * keycode_state[kc_f[l]];
-				 * Also could watch multiple modifier
-				 * problem, e.g. Shift+key -> Alt
-				 * keycode = 125 on my keyboard.
-				 */
-
-				score[l] = myscore;
-				if (debug_keyboard > 1) {
-					fprintf(stderr, "    *** score for "
-					    "keycode %03d: %4d\n",
-					    kc_f[l], myscore);
-				}
-				if (khints && keysym < 0x100 && kc_f[l] < 0x100) {
-					score_hint[(int) keysym][kc_f[l]] = (short) score[l];
-				}
-			}
-			for (l=0; l < found; l++) {
-				int myscore = score[l];
-				if (best_score == -1 || myscore < best_score) {
-					best = l;
-					best_score = myscore;
-				}
-			}
-			Kc_f = kc_f[best];
-			Grp_f = grp_f[best];
-			Lvl_f = lvl_f[best];
-			state = state_f[best];
-			
-		} else {
-			/* up */
-			int i, Kc_loc = -1;
-			Kc_f = -1;
-
-			/* first try the scores we remembered when the key went down: */
-			if (khints && keysym < 0x100) {
-				/* low keysyms, ascii, only */
-				int ks = (int) keysym;
-				int ok = 1, lbest = 0, l;
-				short sbest = -1;
-				for (l=0; l < found; l++) {
-					if (kc_f[l] < 0x100) {
-						int key = (int) kc_f[l];
-						if (! keycode_state[key]) {
-							continue;
-						}
-						if (score_hint[ks][key] < 0) {
-							ok = 0;
-							break;
-						}
-						if (sbest < 0 || score_hint[ks][key] < sbest) {
-							sbest = score_hint[ks][key];
-							lbest = l;
-						}
-					} else {
-						ok = 0;
-						break;
-					}
-				}
-				if (ok && sbest != -1) {
-					Kc_f = kc_f[lbest];
-				}
-				if (debug_keyboard && Kc_f != -1) {
-					fprintf(stderr, "    UP: found via score_hint, s/l=%d/%d\n",
-					    sbest, lbest);
-				}
-			}
-
-			/* next look at our list of recently pressed down keys */
-			if (Kc_f == -1) {
-				for (i=klast-1; i>=0; i--) {
-					/*
-					 * some people type really fast and leave
-					 * lots of keys down before releasing
-					 * them.  this gives problem on weird
-					 * qwerty+dvorak keymappings where each
-					 * alpha character is on TWO keys.
-					 */
-					if (keysym == Ks_last_down[i]) {
-						int l;
-						for (l=0; l < found; l++) {
-							if (Kc_last_down[i] == kc_f[l]) {
-								int key = (int) kc_f[l];
-								if (keycode_state[key]) {
-									Kc_f = Kc_last_down[i];
-									Kc_loc = i;
-									break;
-								}
-							}
-						}
-					}
-					if (Kc_f != -1) {
-						break;
-					}
-				}
-				if (debug_keyboard && Kc_f != -1) {
-					fprintf(stderr, "    UP: found via klast, i=%d\n", Kc_loc);
-				}
-			}
-
-			/* next just check for "best" one that is down */
-			if (Kc_f == -1 && anydown) {
-				int l;
-				int best = -1, lbest = 0;
-				/*
-				 * If it is already down, that is
-				 * a great hint.  Use it.
-				 *
-				 * note: keycode_state is internal and
-				 * ignores someone pressing keys on the
-				 * physical display (but is updated
-				 * periodically to clean out stale info).
-				 */
-				for (l=0; l < found; l++) {
-					int key = (int) kc_f[l];
-					int j, jmatch = -1;
-
-					if (! keycode_state[key]) {
-						continue;
-					}
-					/* break ties based on lowest XKeycodeToKeysym index */
-					for (j=0; j<8; j++) {
-						KeySym ks = XKeycodeToKeysym(dpy, kc_f[l], j);
-						if (ks != NoSymbol && ks == keysym) {
-							jmatch = j;
-							break;
-						}
-					}
-					if (jmatch == -1) {
-						continue;
-					}
-					if (best == -1 || jmatch < best) {
-						best = jmatch;
-						lbest = l;
-					}
-				}
-				if (best != -1) {
-					Kc_f = kc_f[lbest];
-				}
-				if (debug_keyboard && Kc_f != -1) {
-					fprintf(stderr, "    UP: found via downlist, l=%d\n", lbest);
-				}
-			}
-
-			/* next, use the first one found that is down */
-			if (Kc_f == -1) {
-				int l;
-				for (l=0; l < found; l++) {
-					int key = (int) kc_f[l];
-					if (keycode_state[key]) {
-						Kc_f = kc_f[l];
-						break;
-					}
-				}
-				if (debug_keyboard && Kc_f != -1) {
-					fprintf(stderr, "    UP: set to first one down, kc_f[%d]!!\n", l);
-				}
-			}
-
-			/* last, use the first one found */
-			if (Kc_f == -1) {
-				/* hope for the best... XXX check mods */
-				Kc_f = kc_f[0];
-				if (debug_keyboard && Kc_f != -1) {
-					fprintf(stderr, "    UP: set to first one at all, kc_f[0]!!\n");
-				}
-			}
-		}
-	} else {
-		Kc_f = kc_f[0];
-		Grp_f = grp_f[0];
-		Lvl_f = lvl_f[0];
-		state = state_f[0];
-	}
-
-	if (debug_keyboard && found > 1) {
-		int l;
-		char *str;
-		fprintf(stderr, "    *** found more than one keycode: ");
-		for (l = 0; l < found; l++) {
-			fprintf(stderr, "%03d ", kc_f[l]);
-		}
-		for (l = 0; l < found; l++) {
-			str = XKeysymToString(XKeycodeToKeysym(dpy,kc_f[l],0));
-			fprintf(stderr, " \"%s\"", str ? str : "null");
-		}
-		fprintf(stderr, ", picked this one: %03d  (last down: %03d)\n",
-		    Kc_f, Kc_last_down[0]);
-	}
-
-	if (sloppy_keys) {
-		int new_kc;
-		if (sloppy_key_check(Kc_f, down, keysym, &new_kc)) {
-			Kc_f = new_kc;
-		}
-	}
-
-	if (down) {
-		/*
-		 * need to set up the mods for tweaking and other workarounds
-		 */
-		int needmods[8], sentmods[8], Ilist[8], keystate[256];
-		int involves_multi_key, shift_is_down;
-		int i, j, b, curr, need;
-		unsigned int ms;
-		KeySym ks;
-		Bool dn;
-
-		/* remember these to aid the subsequent up case: */
-		for (i=KLAST-1; i >= 1; i--) {
-			Ks_last_down[i] = Ks_last_down[i-1];
-			Kc_last_down[i] = Kc_last_down[i-1];
-		}
-		Ks_last_down[0] = keysym;
-		Kc_last_down[0] = Kc_f;
-
-		if (! got_kbstate) {
-			/* get the current modifier state if we haven't yet */
-			XkbGetState(dpy, XkbUseCoreKbd, &kbstate);
-			got_kbstate = 1;
-		}
-
-		/*
-		 * needmods[] whether or not that modifier bit needs
-		 *            something done to it. 
-		 *            < 0 means no,
-		 *            0   means needs to go up.
-		 *            1   means needs to go down.
-		 *
-		 * -1, -2, -3 are used for debugging info to indicate
-		 * why nothing needs to be done with the modifier, see below.
-		 *
-		 * sentmods[] is the corresponding keycode to use
-		 * to achieve the needmods[] requirement for the bit.
-		 */
-
-		for (i=0; i<8; i++) {
-			needmods[i] = -1;
-			sentmods[i] = 0;
-		}
-
-		/*
-		 * Loop over the 8 modifier bits and check if the current
-		 * setting is what we need it to be or whether it should
-		 * be changed (by us sending some keycode event)
-		 *
-		 * If nothing needs to be done to it record why:
-		 *   -1  the modifier bit is ignored.
-		 *   -2  the modifier bit is ignored, but is correct anyway.
-		 *   -3  the modifier bit is correct.
-		 */
-
-		b = 0x1;
-		for (i=0; i<8; i++) {
-			curr = b & kbstate.mods;
-			need = b & state;
-
-			if (! (b & xkbignore[Kc_f][Grp_f][Lvl_f])) {
-				/* irrelevant modifier bit */
-				needmods[i] = -1;
-				if (curr == need) needmods[i] = -2;
-			} else if (curr == need) {
-				/* already correct */
-				needmods[i] = -3;
-			} else if (! curr && need) {
-				/* need it down */
-				needmods[i] = 1;
-			} else if (curr && ! need) {
-				/* need it up */
-				needmods[i] = 0;
-			}
-
-			b = b << 1;
-		}
-
-		/*
-		 * Again we dynamically probe the X server for information,
-		 * this time for the state of all the keycodes.  Useful
-		 * info, and evidently is not too slow...
-		 */
-		get_keystate(keystate);
-
-		/*
-		 * We try to determine if Shift is down (since that can
-		 * screw up ISO_Level3_Shift manipulations).
-		 */
-		shift_is_down = 0;
-
-		for (kc = kc_min; kc <= kc_max; kc++) {
-			if (skipkeycode[kc] && debug_keyboard) {
-				fprintf(stderr, "    xxx skipping keycode: "
-				    "%d\n", kc);
-			}
-			if (skipkeycode[kc]) {
-				continue;
-			}
-			if (shift_keys[kc] && keystate[kc]) {
-				shift_is_down = kc;
-				break;
-			}
-		}
-
-		/*
-		 * Now loop over the modifier bits and try to deduce the
-		 * keycode presses/release require to match the desired
-		 * state.
-		 */
-		for (i=0; i<8; i++) {
-			if (needmods[i] < 0 && debug_keyboard > 1) {
-				int k = -needmods[i] - 1;
-				char *words[] = {"ignorable",
-				    "bitset+ignorable", "bitset"};
-				fprintf(stderr, "    +++ needmods: mod=%d is "
-				    "OK  (%s)\n", i, words[k]);
-			}
-			if (needmods[i] < 0) {
-				continue;
-			}
-
-			b = 1 << i;
-
-			if (debug_keyboard > 1) {
-				fprintf(stderr, "    +++ needmods: mod=%d %s "
-				    "need it to be: %d %s\n", i, bitprint(b, 8),
-				    needmods[i], needmods[i] ? "down" : "up");
-			}
-
-			/*
-			 * Again, an inefficient loop, this time just
-			 * looking for modifiers...
-			 * 
-			 * note the use of kc_vec to prefer XK_ISO_Level3_Shift
-			 * over XK_Mode_switch.
-			 */
-			for (kci = kc_min; kci <= kc_max; kci++) {
-			  for (grp = 0; grp < grp_max+1; grp++) {
-			    for (lvl = 0; lvl < lvl_max+1; lvl++) {
-				int skip = 1, dbmsg = 0;
-
-				kc = kc_vec[kci];
-
-				ms = xkbmodifiers[kc][grp][lvl];
-				if (! ms || ms != (unsigned int) b) {
-					continue;
-				}
-
-				if (skipkeycode[kc] && debug_keyboard) {
-				    fprintf(stderr, "    xxx skipping keycode:"
-					" %d G%d/L%d\n", kc, grp+1, lvl+1);
-				}
-				if (skipkeycode[kc]) {
-					continue;
-				}
-
-				ks = xkbkeysyms[kc][grp][lvl];
-				if (! ks) {
-					continue;
-				}
-
-				if (ks == XK_Shift_L) {
-					skip = 0;
-				} else if (ks == XK_Shift_R) {
-					skip = 0;
-				} else if (ks == XK_Mode_switch) {
-					skip = 0;
-				} else if (ks == XK_ISO_Level3_Shift) {
-					skip = 0;
-				}
-
-				if (watch_capslock && kbstate.locked_mods & LockMask) {
-				    if (keysym >= 'A' && keysym <= 'Z') {
-					if (ks == XK_Shift_L || ks == XK_Shift_R) {
-						if (debug_keyboard > 1) {
-							fprintf(stderr, "    A-Z caplock skip Shift\n");
-						}
-						skip = 1;
-					} else if (ks == XK_Caps_Lock) {
-						if (debug_keyboard > 1) {
-							fprintf(stderr, "    A-Z caplock noskip CapsLock\n");
-						}
-						skip = 0;
-					}
-				    }
-				}
-				/*
-				 * Alt, Meta, Control, Super,
-				 * Hyper, Num, Caps are skipped.
-				 *
-				 * XXX need more work on Locks,
-				 * and non-standard modifiers.
-				 * (e.g. XF86_Next_VMode using
-				 * Ctrl+Alt)
-				 */
-				if (debug_keyboard > 1) {
-					char *str = XKeysymToString(ks);
-					int kt = keystate[kc];
-					fprintf(stderr, "    === for mod=%s "
-					    "found kc=%03d/G%d/L%d it is %d "
-					    "%s skip=%d (%s)\n", bitprint(b,8),
-					    kc, grp+1, lvl+1, kt, kt ?
-					    "down" : "up  ", skip, str ?
-					    str : "null");
-				}
-
-				if (! skip && needmods[i] !=
-				    keystate[kc] && sentmods[i] == 0) {
-					sentmods[i] = kc;
-					dbmsg = 1;
-				}
-
-				if (debug_keyboard > 1 && dbmsg) {
-					int nm = needmods[i];
-					fprintf(stderr, "    >>> we choose "
-					    "kc=%03d=0x%02x to change it to: "
-					    "%d %s\n", kc, kc, nm, nm ?
-					    "down" : "up");
-				}
-					
-			    }
-			  }
-			}
-		}
-		for (i=0; i<8; i++) {
-			/*
-			 * reverse order is useful for tweaking
-			 * ISO_Level3_Shift before Shift, but assumes they
-			 * are in that order (i.e. Shift is first bit).
-			 */
-			int reverse = 1;
-			if (reverse) {
-				Ilist[i] = 7 - i;
-			} else {
-				Ilist[i] = i;
-			}
-		}
-
-		/*
-		 * check to see if Multi_key is bound to one of the Mods
-		 * we have to tweak
-		 */
-		involves_multi_key = 0;
-		for (j=0; j<8; j++) {
-			i = Ilist[j];
-			if (sentmods[i] == 0) continue;
-			dn = (Bool) needmods[i];
-			if (!dn) continue;
-			if (multi_key[sentmods[i]]) {
-				involves_multi_key = i+1;
-			}
-		}
-
-		if (involves_multi_key && shift_is_down && needmods[0] < 0) {
-			/*
-			 * Workaround for Multi_key and shift.
-			 * Assumes Shift is bit 1 (needmods[0])
-			 */
-			if (debug_keyboard) {
-				fprintf(stderr, "    ^^^ trying to avoid "
-				    "inadvertent Multi_key from Shift "
-				    "(doing %03d up now)\n", shift_is_down);
-			}
-			XTestFakeKeyEvent_wr(dpy, shift_is_down, False,
-			    CurrentTime);
-		} else {
-			involves_multi_key = 0;
-		}
-
-		for (j=0; j<8; j++) {
-			/* do the Mod ups */
-			i = Ilist[j];
-			if (sentmods[i] == 0) continue;
-			dn = (Bool) needmods[i];
-			if (dn) continue;
-			XTestFakeKeyEvent_wr(dpy, sentmods[i], dn, CurrentTime);
-		}
-		for (j=0; j<8; j++) {
-			/* next, do the Mod downs */
-			i = Ilist[j];
-			if (sentmods[i] == 0) continue;
-			dn = (Bool) needmods[i];
-			if (!dn) continue;
-			XTestFakeKeyEvent_wr(dpy, sentmods[i], dn, CurrentTime);
-		}
-
-		if (involves_multi_key) {
-			/*
-			 * Reverse workaround for Multi_key and shift.
-			 */
-			if (debug_keyboard) {
-				fprintf(stderr, "    vvv trying to avoid "
-				    "inadvertent Multi_key from Shift "
-				    "(doing %03d down now)\n", shift_is_down);
-			}
-			XTestFakeKeyEvent_wr(dpy, shift_is_down, True,
-			    CurrentTime);
-		}
-
-		/*
-		 * With the above modifier work done, send the actual keycode:
-		 */
-		XTestFakeKeyEvent_wr(dpy, Kc_f, (Bool) down, CurrentTime);
-
-		/*
-		 * Now undo the modifier work:
-		 */
-		for (j=7; j>=0; j--) {
-			/* reverse Mod downs we did */
-			i = Ilist[j];
-			if (sentmods[i] == 0) continue;
-			dn = (Bool) needmods[i];
-			if (!dn) continue;
-			XTestFakeKeyEvent_wr(dpy, sentmods[i], !dn,
-			    CurrentTime);
-		}
-		for (j=7; j>=0; j--) {
-			/* finally reverse the Mod ups we did */
-			i = Ilist[j];
-			if (sentmods[i] == 0) continue;
-			dn = (Bool) needmods[i];
-			if (dn) continue;
-			XTestFakeKeyEvent_wr(dpy, sentmods[i], !dn,
-			    CurrentTime);
-		}
-
-	} else { /* for up case, hopefully just need to pop it up: */
-
-		XTestFakeKeyEvent_wr(dpy, Kc_f, (Bool) down, CurrentTime);
-	}
-	X_UNLOCK;
-}
-#endif
-
-/*
- * For tweaking modifiers wrt the Alt-Graph key, etc.
- */
-#define LEFTSHIFT 1
-#define RIGHTSHIFT 2
-#define ALTGR 4
-static char mod_state = 0;
-
-static char modifiers[0x100];
-static KeyCode keycodes[0x100];
-static KeyCode left_shift_code, right_shift_code, altgr_code, iso_level3_code;
-
-/* workaround for X11R5, Latin 1 only */
-#ifndef XConvertCase
-#define XConvertCase(sym, lower, upper) \
-*(lower) = sym; \
-*(upper) = sym; \
-if (sym >> 8 == 0) { \
-    if ((sym >= XK_A) && (sym <= XK_Z)) \
-        *(lower) += (XK_a - XK_A); \
-    else if ((sym >= XK_a) && (sym <= XK_z)) \
-        *(upper) -= (XK_a - XK_A); \
-    else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis)) \
-        *(lower) += (XK_agrave - XK_Agrave); \
-    else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis)) \
-        *(upper) -= (XK_agrave - XK_Agrave); \
-    else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn)) \
-        *(lower) += (XK_oslash - XK_Ooblique); \
-    else if ((sym >= XK_oslash) && (sym <= XK_thorn)) \
-        *(upper) -= (XK_oslash - XK_Ooblique); \
-}
-#endif
-
-char *short_kmbcf(char *str) {
-	int i, saw_k = 0, saw_m = 0, saw_b = 0, saw_c = 0, saw_f = 0, n = 10;
-	char *p, tmp[10];
-	
-	for (i=0; i<n; i++) {
-		tmp[i] = '\0';
-	}
-
-	p = str;
-	i = 0;
-	while (*p) {
-		if ((*p == 'K' || *p == 'k') && !saw_k) {
-			tmp[i++] = 'K';
-			saw_k = 1;
-		} else if ((*p == 'M' || *p == 'm') && !saw_m) {
-			tmp[i++] = 'M';
-			saw_m = 1;
-		} else if ((*p == 'B' || *p == 'b') && !saw_b) {
-			tmp[i++] = 'B';
-			saw_b = 1;
-		} else if ((*p == 'C' || *p == 'c') && !saw_c) {
-			tmp[i++] = 'C';
-			saw_c = 1;
-		} else if ((*p == 'F' || *p == 'f') && !saw_f) {
-			tmp[i++] = 'F';
-			saw_f = 1;
-		}
-		p++;
-	}
-	return(strdup(tmp));
-}
-
-void initialize_allowed_input(void) {
-	char *str;
-
-	if (allowed_input_normal) {
-		free(allowed_input_normal);
-		allowed_input_normal = NULL;
-	}
-	if (allowed_input_view_only) {
-		free(allowed_input_view_only);
-		allowed_input_view_only = NULL;
-	}
-
-	if (! allowed_input_str) {
-		allowed_input_normal = strdup("KMBCF");
-		allowed_input_view_only = strdup("");
-	} else {
-		char *p, *str = strdup(allowed_input_str);
-		p = strchr(str, ',');
-		if (p) {
-			allowed_input_view_only = strdup(p+1);
-			*p = '\0';
-			allowed_input_normal = strdup(str);
-		} else {
-			allowed_input_normal = strdup(str);
-			allowed_input_view_only = strdup("");
-		}
-		free(str);
-	}
-
-	/* shorten them */
-	str = short_kmbcf(allowed_input_normal);
-	free(allowed_input_normal);
-	allowed_input_normal = str;
-
-	str = short_kmbcf(allowed_input_view_only);
-	free(allowed_input_view_only);
-	allowed_input_view_only = str;
-
-	if (screen) {
-		rfbClientIteratorPtr iter;
-		rfbClientPtr cl;
-
-		iter = rfbGetClientIterator(screen);
-		while( (cl = rfbClientIteratorNext(iter)) ) {
-			ClientData *cd = (ClientData *) cl->clientData;
-
-			if (! cd) {
-				continue;
-			}
-#if 0
-rfbLog("cd: %p\n", cd);
-rfbLog("cd->input: %s\n", cd->input);
-rfbLog("cd->login_viewonly: %d\n", cd->login_viewonly);
-rfbLog("allowed_input_view_only: %s\n", allowed_input_view_only);
-#endif
-
-			if (cd->input[0] == '=') {
-				;	/* custom setting */
-			} else if (cd->login_viewonly) {
-				if (*allowed_input_view_only != '\0') {
-					cl->viewOnly = FALSE;
-					cd->input[0] = '\0';
-					strncpy(cd->input,
-					    allowed_input_view_only, CILEN);
-				} else {
-					cl->viewOnly = TRUE;
-				}
-			} else {
-				if (allowed_input_normal) {
-					cd->input[0] = '\0';
-					strncpy(cd->input,
-					    allowed_input_normal, CILEN);
-				}
-			}
-		}
-		rfbReleaseClientIterator(iter);
-	}
-}
-
-void initialize_modtweak(void) {
-#if NO_X11
-	RAWFB_RET_VOID
-	return;
-#else
-	KeySym keysym, *keymap;
-	int i, j, minkey, maxkey, syms_per_keycode;
-	int use_lowest_index = 0;
-
-	if (use_xkb_modtweak) {
-		initialize_xkb_modtweak();
-		return;
-	}
-	memset(modifiers, -1, sizeof(modifiers));
-	for (i=0; i<0x100; i++) {
-		keycodes[i] = NoSymbol;
-	}
-
-	RAWFB_RET_VOID
-
-	if (getenv("MODTWEAK_LOWEST")) {
-		use_lowest_index = 1;
-	}
-
-	X_LOCK;
-	XDisplayKeycodes(dpy, &minkey, &maxkey);
-
-	keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1),
-	    &syms_per_keycode);
-
-	/* handle alphabetic char with only one keysym (no upper + lower) */
-	for (i = minkey; i <= maxkey; i++) {
-		KeySym lower, upper;
-		/* 2nd one */
-		keysym = keymap[(i - minkey) * syms_per_keycode + 1];
-		if (keysym != NoSymbol) {
-			continue;
-		}
-		/* 1st one */
-		keysym = keymap[(i - minkey) * syms_per_keycode + 0];
-		if (keysym == NoSymbol) {
-			continue;
-		}
-		XConvertCase(keysym, &lower, &upper);
-		if (lower != upper) {
-			keymap[(i - minkey) * syms_per_keycode + 0] = lower;
-			keymap[(i - minkey) * syms_per_keycode + 1] = upper;
-		}
-	}
-	for (i = minkey; i <= maxkey; i++) {
-		if (debug_keyboard) {
-			if (i == minkey) {
-				rfbLog("initialize_modtweak: keycode -> "
-				    "keysyms mapping info:\n");
-			}
-			fprintf(stderr, "  %03d  ", i);
-		}
-		for (j = 0; j < syms_per_keycode; j++) {
-			if (debug_keyboard) {
-				char *sym;
-#if 0
-				sym =XKeysymToString(XKeycodeToKeysym(dpy,i,j));
-#else
-				keysym = keymap[(i-minkey)*syms_per_keycode+j];
-				sym = XKeysymToString(keysym);
-#endif
-				fprintf(stderr, "%-18s ", sym ? sym : "null");
-				if (j == syms_per_keycode - 1) {
-					fprintf(stderr, "\n");
-				}
-			}
-			if (j >= 4) {
-				/*
-				 * Something wacky in the keymapping.
-				 * Ignore these non Shift/AltGr chords
-				 * for now... n.b. we try to automatically
-				 * switch to -xkb for this case.
-				 */
-				continue;
-			}
-			keysym = keymap[ (i - minkey) * syms_per_keycode + j ];
-			if ( keysym >= ' ' && keysym < 0x100
-			    && i == XKeysymToKeycode(dpy, keysym) ) {
-				if (use_lowest_index && keycodes[keysym] != NoSymbol) {
-					continue;
-				}
-				keycodes[keysym] = i;
-				modifiers[keysym] = j;
-			}
-		}
-	}
-
-	left_shift_code = XKeysymToKeycode(dpy, XK_Shift_L);
-	right_shift_code = XKeysymToKeycode(dpy, XK_Shift_R);
-	altgr_code = XKeysymToKeycode(dpy, XK_Mode_switch);
-	iso_level3_code = NoSymbol;
-#ifdef XK_ISO_Level3_Shift
-	iso_level3_code = XKeysymToKeycode(dpy, XK_ISO_Level3_Shift);
-#endif
-
-	XFree_wr ((void *) keymap);
-
-	X_UNLOCK;
-#endif	/* NO_X11 */
-}
-
-/*
- * does the actual tweak:
- */
-static void tweak_mod(signed char mod, rfbBool down) {
-	rfbBool is_shift = mod_state & (LEFTSHIFT|RIGHTSHIFT);
-	Bool dn = (Bool) down;
-	KeyCode altgr = altgr_code;
-
-	RAWFB_RET_VOID
-
-	if (mod < 0) {
-		if (debug_keyboard) {
-			rfbLog("tweak_mod: Skip:  down=%d index=%d\n", down,
-			    (int) mod);
-		}
-		return;
-	}
-	if (debug_keyboard) {
-		rfbLog("tweak_mod: Start:  down=%d index=%d mod_state=0x%x"
-		    " is_shift=%d\n", down, (int) mod, (int) mod_state,
-		    is_shift);
-	}
-
-	if (use_iso_level3 && iso_level3_code) {
-		altgr = iso_level3_code;
-	}
-
-	X_LOCK;
-	if (is_shift && mod != 1) {
-	    if (mod_state & LEFTSHIFT) {
-		XTestFakeKeyEvent_wr(dpy, left_shift_code, !dn, CurrentTime);
-	    }
-	    if (mod_state & RIGHTSHIFT) {
-		XTestFakeKeyEvent_wr(dpy, right_shift_code, !dn, CurrentTime);
-	    }
-	}
-	if ( ! is_shift && mod == 1 ) {
-	    XTestFakeKeyEvent_wr(dpy, left_shift_code, dn, CurrentTime);
-	}
-	if ( altgr && (mod_state & ALTGR) && mod != 2 ) {
-	    XTestFakeKeyEvent_wr(dpy, altgr, !dn, CurrentTime);
-	}
-	if ( altgr && ! (mod_state & ALTGR) && mod == 2 ) {
-	    XTestFakeKeyEvent_wr(dpy, altgr, dn, CurrentTime);
-	}
-	X_UNLOCK;
-
-	if (debug_keyboard) {
-		rfbLog("tweak_mod: Finish: down=%d index=%d mod_state=0x%x"
-		    " is_shift=%d\n", down, (int) mod, (int) mod_state,
-		    is_shift);
-	}
-}
-
-/*
- * tweak the modifier under -modtweak
- */
-static void modifier_tweak_keyboard(rfbBool down, rfbKeySym keysym,
-    rfbClientPtr client) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!down || !keysym || !client) {}
-	return;
-#else
-	KeyCode k;
-	int tweak = 0;
-
-	RAWFB_RET_VOID
-
-	if (use_xkb_modtweak) {
-		xkb_tweak_keyboard(down, keysym, client);
-		return;
-	}
-	if (debug_keyboard) {
-		rfbLog("modifier_tweak_keyboard: %s keysym=0x%x\n",
-		    down ? "down" : "up", (int) keysym);
-	}
-
-#define ADJUSTMOD(sym, state) \
-	if (keysym == sym) { \
-		if (down) { \
-			mod_state |= state; \
-		} else { \
-			mod_state &= ~state; \
-		} \
-	}
-
-	ADJUSTMOD(XK_Shift_L, LEFTSHIFT)
-	ADJUSTMOD(XK_Shift_R, RIGHTSHIFT)
-	ADJUSTMOD(XK_Mode_switch, ALTGR)
-
-	if ( down && keysym >= ' ' && keysym < 0x100 ) {
-		unsigned int state = 0;
-		tweak = 1;
-		if (watch_capslock && keysym >= 'A' && keysym <= 'Z') {
-			X_LOCK;
-			state = mask_state();
-			X_UNLOCK;
-		}
-		if (state & LockMask) {
-			/* capslock set for A-Z, so no tweak */
-			X_LOCK;
-			k = XKeysymToKeycode(dpy, (KeySym) keysym);
-			X_UNLOCK;
-			tweak = 0;
-		} else {
-			tweak_mod(modifiers[keysym], True);
-			k = keycodes[keysym];
-		}
-	} else {
-		X_LOCK;
-		k = XKeysymToKeycode(dpy, (KeySym) keysym);
-		X_UNLOCK;
-	}
-	if (k == NoSymbol && add_keysyms && ! IsModifierKey(keysym)) {
-		int new_kc = add_keysym(keysym);
-		if (new_kc) {
-			k = new_kc;
-		}
-	}
-
-	if (sloppy_keys) {
-		int new_kc;
-		if (sloppy_key_check((int) k, down, keysym, &new_kc)) {
-			k = (KeyCode) new_kc;
-		}
-	}
-
-	if (debug_keyboard) {
-		char *str = XKeysymToString(keysym);
-		rfbLog("modifier_tweak_keyboard: KeySym 0x%x \"%s\" -> "
-		    "KeyCode 0x%x%s\n", (int) keysym, str ? str : "null",
-		    (int) k, k ? "" : " *ignored*");
-	}
-	if ( k != NoSymbol ) {
-		X_LOCK;
-		XTestFakeKeyEvent_wr(dpy, k, (Bool) down, CurrentTime);
-		X_UNLOCK;
-	}
-
-	if ( tweak ) {
-		tweak_mod(modifiers[keysym], False);
-	}
-#endif	/* NO_X11 */
-}
-
-void initialize_keyboard_and_pointer(void) {
-
-#ifdef MACOSX
-	if (macosx_console) {
-		initialize_remap(remap_file);
-		initialize_pointer_map(pointer_remap);
-	}
-#endif
-
-	RAWFB_RET_VOID
-
-	if (use_modifier_tweak) {
-		initialize_modtweak();
-	}
-
-	initialize_remap(remap_file);
-	initialize_pointer_map(pointer_remap);
-
-	X_LOCK;
-	clear_modifiers(1);
-	if (clear_mods == 1) {
-		clear_modifiers(0);
-	}
-	if (clear_mods == 3) {
-		clear_locks();
-	}
-	X_UNLOCK;
-}
-
-void get_allowed_input(rfbClientPtr client, allowed_input_t *input) {
-	ClientData *cd;
-	char *str;
-
-	input->keystroke = 0;
-	input->motion    = 0;
-	input->button    = 0;
-	input->clipboard = 0;
-	input->files     = 0;
-
-	if (! client) {
-		input->keystroke = 1;
-		input->motion    = 1;
-		input->button    = 1;
-		input->clipboard = 1;
-		input->files     = 1;
-		return;
-	}
-
-	cd = (ClientData *) client->clientData;
-
-	if (! cd) {
-		return;
-	}
-	
-	if (cd->input[0] != '-') {
-		str = cd->input;
-	} else if (client->viewOnly) {
-		if (allowed_input_view_only) {
-			str = allowed_input_view_only;
-		} else {
-			str = "";
-		}
-	} else {
-		if (allowed_input_normal) {
-			str = allowed_input_normal;
-		} else {
-			str = "KMBCF";
-		}
-	}
-if (0) fprintf(stderr, "GAI: %s - %s\n", str, cd->input);
-
-	while (*str) {
-		if (*str == 'K') {
-			input->keystroke = 1;
-		} else if (*str == 'M') {
-			input->motion = 1;
-		} else if (*str == 'B') {
-			input->button = 1;
-		} else if (*str == 'C') {
-			input->clipboard = 1;
-		} else if (*str == 'F') {
-			input->files = 1;
-		}
-		str++;
-	}
-}
-
-static void apply_remap(rfbKeySym *keysym, int *isbutton) {
-	if (keyremaps) {
-		keyremap_t *remap = keyremaps;
-		while (remap != NULL) {
-			if (remap->before == *keysym) {
-				*keysym = remap->after;
-				*isbutton = remap->isbutton;
-				if (debug_keyboard) {
-					char *str1, *str2;
-					X_LOCK;
-					str1 = XKeysymToString(remap->before);
-					str2 = XKeysymToString(remap->after);
-					rfbLog("keyboard(): remapping keysym: "
-					    "0x%x \"%s\" -> 0x%x \"%s\"\n",
-					    (int) remap->before,
-					    str1 ? str1 : "null",
-					    (int) remap->after,
-					    remap->isbutton ? "button" :
-					    str2 ? str2 : "null");
-					X_UNLOCK;
-				}
-				break;
-			}
-			remap = remap->next;
-		}
-	}
-}
-
-/* for -pipeinput mode */
-static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
-	int can_input = 0, uid = 0, isbutton = 0;
-	allowed_input_t input;
-	char *name;
-	ClientData *cd = (ClientData *) client->clientData;
-
-	apply_remap(&keysym, &isbutton);
-
-	if (isbutton) {
-		int mask, button = (int) keysym;
-		int x = cursor_x, y = cursor_y;
-		char *b, bstr[32];
-
-		if (!down) {
-			return;
-		}
-		if (debug_keyboard) {
-			rfbLog("keyboard(): remapping keystroke to button %d"
-			    " click\n", button);
-		}
-		dtime0(&last_key_to_button_remap_time);
-
-		/*
-		 * This in principle can be a little dicey... i.e. even
-		 * remap the button click to keystroke sequences!
-		 * Usually just will simulate the button click.
-		 */
-
-		/* loop over possible multiclicks: Button123 */
-		sprintf(bstr, "%d", button);
-		b = bstr;
-		while (*b != '\0') {
-			char t[2];
-			int butt;
-			t[0] = *b;
-			t[1] = '\0';
-			if (sscanf(t, "%d", &butt) == 1) {
-				mask = 1<<(butt-1);
-				pointer_event(mask, x, y, client);
-				mask = 0;
-				pointer_event(mask, x, y, client);
-			}
-			b++;
-		}
-		return;
-	}
-
-	if (pipeinput_int == PIPEINPUT_VID) {
-		v4l_key_command(down, keysym, client);
-	} else if (pipeinput_int == PIPEINPUT_CONSOLE) {
-		console_key_command(down, keysym, client);
-	} else if (pipeinput_int == PIPEINPUT_UINPUT) {
-		uinput_key_command(down, keysym, client);
-	} else if (pipeinput_int == PIPEINPUT_MACOSX) {
-		macosx_key_command(down, keysym, client);
-	} else if (pipeinput_int == PIPEINPUT_VNC) {
-		vnc_reflect_send_key((uint32_t) keysym, down);
-	}
-	if (pipeinput_fh == NULL) {
-		return;
-	}
-
-	if (! view_only) {
-		get_allowed_input(client, &input);
-		if (input.keystroke) {
-			can_input = 1;	/* XXX distinguish later */
-		}
-	}
-	if (cd) {
-		uid = cd->uid;
-	}
-	if (! can_input) {
-		uid = -uid;
-	}
-
-	X_LOCK;
-	name = XKeysymToString(keysym);
-	X_UNLOCK;
-
-	fprintf(pipeinput_fh, "Keysym %d %d %u %s %s\n", uid, down,
-	    keysym, name ? name : "null", down ? "KeyPress" : "KeyRelease");
-
-	fflush(pipeinput_fh);
-	check_pipeinput();
-}
-
-typedef struct keyevent {
-	rfbKeySym sym;
-	rfbBool down;
-	double time;
-} keyevent_t;
-
-#define KEY_HIST 256
-static int key_history_idx = -1;
-static keyevent_t key_history[KEY_HIST];
-
-double typing_rate(double time_window, int *repeating) {
-	double dt = 1.0, now = dnow();
-	KeySym key = NoSymbol;
-	int i, idx, cnt = 0, repeat_keys = 0;
-
-	if (key_history_idx == -1) {
-		if (repeating) {
-			*repeating = 0;
-		}
-		return 0.0;
-	}
-	if (time_window > 0.0) {
-		dt = time_window;
-	}
-	for (i=0; i<KEY_HIST; i++) {
-		idx = key_history_idx - i;
-		if (idx < 0) {
-			idx += KEY_HIST;
-		}
-		if (! key_history[idx].down) {
-			continue;
-		}
-		if (now > key_history[idx].time + dt) {
-			break;
-		}
-		cnt++;
-		if (key == NoSymbol) {
-			key = key_history[idx].sym;
-			repeat_keys = 1;
-		} else if (key == key_history[idx].sym) {
-			repeat_keys++;
-		}
-	}
-
-	if (repeating) {
-		if (repeat_keys >= 2) {
-			*repeating = repeat_keys;
-		} else {
-			*repeating = 0;
-		}
-	}
-
-	/*
-	 * n.b. keyrate could seem very high with libvncserver buffering them
-	 * so avoid using small dt.
-	 */
-	return ((double) cnt)/dt;
-}
-
-int skip_cr_when_scaling(char *mode) {
-	int got = 0;
-	
-	if (!scaling) {
-		return 0;
-	}
-
-	if (scaling_copyrect != scaling_copyrect0) {
-		/* user override via -scale: */
-		if (! scaling_copyrect) {
-			return 1;
-		} else {
-			return 0;
-		}
-	}
-	if (*mode == 's') {
-		got = got_scrollcopyrect;
-	} else if (*mode == 'w') {
-		got = got_wirecopyrect;
-	}
-	if (scaling_copyrect || got) {
-		int lat, rate;
-		int link = link_rate(&lat, &rate);
-		if (link == LR_DIALUP) {
-			return 1;
-		} else if (rate < 25) {
-			/* the fill-in of the repair may be too slow */
-			return 1;
-		} else {
-			return 0;
-		}
-	} else {
-		return 1;
-	}
-}
-
-/*
- * key event handler.  See the above functions for contortions for
- * running under -modtweak.
- */
-static rfbClientPtr last_keyboard_client = NULL;
-
-void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
-	KeyCode k;
-	int idx, isbutton = 0;
-	allowed_input_t input;
-	time_t now = time(NULL);
-	double tnow;
-	static int skipped_last_down;
-	static rfbBool last_down;
-	static rfbKeySym last_keysym = NoSymbol;
-	static rfbKeySym max_keyrepeat_last_keysym = NoSymbol;
-	static double max_keyrepeat_last_time = 0.0;
-	static double max_keyrepeat_always = -1.0;
-
-	if (threads_drop_input) {
-		return;
-	}
-
-	dtime0(&tnow);
-	got_keyboard_calls++;
-
-	if (debug_keyboard) {
-		char *str;
-		X_LOCK;
-		str = XKeysymToString((KeySym) keysym);
-		X_UNLOCK;
-		rfbLog("# keyboard(%s, 0x%x \"%s\") uip=%d  %.4f\n",
-		    down ? "down":"up", (int) keysym, str ? str : "null",
-		    unixpw_in_progress, tnow - x11vnc_start);
-	}
-
-	if (keysym <= 0) {
-		rfbLog("keyboard: skipping 0x0 keysym\n");
-		return;
-	}
-	
-	if (unixpw_in_progress) {
-		if (unixpw_denied) {
-			rfbLog("keyboard: ignoring keystroke 0x%x in "
-			    "unixpw_denied=1 state\n", (int) keysym);
-			return;
-		}
-		if (client != unixpw_client) {
-			rfbLog("keyboard: skipping other client in unixpw\n");
-			return;
-		}
-
-		unixpw_keystroke(down, keysym, 0);
-
-		return;
-	}
-
-	if (skip_duplicate_key_events) {
-		if (keysym == last_keysym && down == last_down) {
-			if (debug_keyboard) {
-				rfbLog("skipping dup key event: %d 0x%x\n",
-				    down, keysym);
-			}
-			return;
-		}
-	}
-
-	if (skip_lockkeys) {
-		/*  we don't handle XK_ISO*_Lock or XK_Kana_Lock ... */
-		if (keysym == XK_Scroll_Lock || keysym == XK_Num_Lock ||
-		    keysym == XK_Caps_Lock || keysym == XK_Shift_Lock) {
-			if (debug_keyboard) {
-				rfbLog("skipping lock key event: %d 0x%x\n",
-				    down, keysym);
-			}
-			return;
-		} else if (keysym >= XK_KP_0 && keysym <= XK_KP_9) {
-			/* ugh this is probably what they meant... assume NumLock. */
-			if (debug_keyboard) {
-				rfbLog("changed KP digit to regular digit: %d 0x%x\n",
-				    down, keysym);
-			}
-			keysym = (keysym - XK_KP_0) + XK_0;
-		} else if (keysym == XK_KP_Decimal) {
-			if (debug_keyboard) {
-				rfbLog("changed XK_KP_Decimal to XK_period: %d 0x%x\n",
-				    down, keysym);
-			}
-			keysym = XK_period; 
-		}
-	}
-
-	INPUT_LOCK;
-
-	last_down = down;
-	last_keysym = keysym;
-	last_keyboard_time = tnow;
-
-	last_rfb_down = down;
-	last_rfb_keysym = keysym;
-	last_rfb_keytime = tnow;
-	last_rfb_key_accepted = FALSE;
-
-	if (key_history_idx == -1) {
-		for (idx=0; idx<KEY_HIST; idx++) {
-			key_history[idx].sym = NoSymbol;
-			key_history[idx].down = FALSE;
-			key_history[idx].time = 0.0;
-		}
-	}
-	idx = ++key_history_idx;
-	if (key_history_idx >= KEY_HIST) {
-		key_history_idx = 0;
-		idx = 0;
-	}
-	key_history[idx].sym = keysym;
-	key_history[idx].down = down;
-	key_history[idx].time = tnow;
-
-	if (down && (keysym == XK_Alt_L || keysym == XK_Super_L)) {
-		int i, k, run = 0, ups = 0;
-		double delay = 1.0;
-		KeySym ks;
-		for (i=0; i<16; i++) {
-			k = idx - i;
-			if (k < 0) k += KEY_HIST;
-			if (!key_history[k].down) {
-				ups++;
-				continue;
-			}
-			ks = key_history[k].sym;
-			if (key_history[k].time < tnow - delay) {
-				break;
-			} else if (ks == keysym && ks == XK_Alt_L) {
-				run++;
-			} else if (ks == keysym && ks == XK_Super_L) {
-				run++;
-			} else {
-				break;
-			}
-		}
-		if (ups < 2) {
-			;
-		} else if (run == 3 && keysym == XK_Alt_L) {
-			rfbLog("3*Alt_L, calling: refresh_screen(0)\n");
-			refresh_screen(0);
-		} else if (run == 4 && keysym == XK_Alt_L) {
-			rfbLog("4*Alt_L, setting: do_copy_screen\n");
-			do_copy_screen = 1;
-		} else if (run == 5 && keysym == XK_Alt_L) {
-			;
-		} else if (run == 3 && keysym == XK_Super_L) {
-			rfbLog("3*Super_L, calling: set_xdamage_mark()\n");
-			set_xdamage_mark(0, 0, dpy_x, dpy_y);
-		} else if (run == 4 && keysym == XK_Super_L) {
-			rfbLog("4*Super_L, calling: check_xrecord_reset()\n");
-			check_xrecord_reset(1);
-		} else if (run == 5 && keysym == XK_Super_L) {
-			rfbLog("5*Super_L, calling: push_black_screen(0)\n");
-			push_black_screen(0);
-		}
-	}
-
-#ifdef MAX_KEYREPEAT 
-	if (max_keyrepeat_always < 0.0) {
-		if (getenv("MAX_KEYREPEAT")) {
-			max_keyrepeat_always = atof(getenv("MAX_KEYREPEAT"));
-		} else {
-			max_keyrepeat_always = 0.0;
-		}
-	}
-	if (max_keyrepeat_always > 0.0) {
-		max_keyrepeat_time = max_keyrepeat_always;
-	}
-#else
-	if (0) {max_keyrepeat_always=0;}
-#endif
-	if (!down && skipped_last_down) {
-		int db = debug_scroll;
-		if (keysym == max_keyrepeat_last_keysym) {
-			skipped_last_down = 0;
-			if (db) rfbLog("--- scroll keyrate skipping 0x%lx %s "
-			    "%.4f  %.4f\n", keysym, down ? "down":"up  ",
-			    tnow - x11vnc_start, tnow - max_keyrepeat_last_time); 
-			INPUT_UNLOCK;
-			return;
-		}
-	}
-	if (down && max_keyrepeat_time > 0.0) {
-		int skip = 0;
-		int db = debug_scroll;
-
-		if (max_keyrepeat_last_keysym != NoSymbol &&
-		    max_keyrepeat_last_keysym != keysym) {
-			;
-		} else {
-			if (tnow < max_keyrepeat_last_time+max_keyrepeat_time) {
-				skip = 1;
-			}
-		}
-		max_keyrepeat_time = 0.0;
-		if (skip) {
-			if (db) rfbLog("--- scroll keyrate skipping 0x%lx %s "
-			    "%.4f  %.4f\n", keysym, down ? "down":"up  ",
-			    tnow - x11vnc_start, tnow - max_keyrepeat_last_time); 
-			max_keyrepeat_last_keysym = keysym;
-			skipped_last_down = 1;
-			INPUT_UNLOCK;
-			return;
-		} else {
-			if (db) rfbLog("--- scroll keyrate KEEPING  0x%lx %s "
-			    "%.4f  %.4f\n", keysym, down ? "down":"up  ",
-			    tnow - x11vnc_start, tnow - max_keyrepeat_last_time); 
-		}
-	}
-	max_keyrepeat_last_keysym = keysym;
-	max_keyrepeat_last_time = tnow;
-	skipped_last_down = 0;
-	last_rfb_key_accepted = TRUE;
-
-	if (pipeinput_fh != NULL || pipeinput_int) {
-		pipe_keyboard(down, keysym, client);	/* MACOSX here. */
-		if (! pipeinput_tee) {
-			if (! view_only || raw_fb) {	/* raw_fb hack */
-				last_keyboard_client = client;
-				last_event = last_input = now;
-				last_keyboard_input = now;
-		
-				last_keysym = keysym;
-
-				last_rfb_down = down;
-				last_rfb_keysym = keysym;
-				last_rfb_keytime = tnow;
-				last_rfb_key_injected = dnow();
-
-				got_user_input++;
-				got_keyboard_input++;
-			}
-			INPUT_UNLOCK;
-			return;
-		}
-	}
-
-	if (view_only) {
-		INPUT_UNLOCK;
-		return;
-	}
-	get_allowed_input(client, &input);
-	if (! input.keystroke) {
-		INPUT_UNLOCK;
-		return;
-	}
-
-	track_mod_state(keysym, down, TRUE);	/* ignores remaps */
-
-	last_keyboard_client = client;
-	last_event = last_input = now;
-	last_keyboard_input = now;
-
-	last_keysym = keysym;
-
-	last_rfb_down = down;
-	last_rfb_keysym = keysym;
-	last_rfb_keytime = tnow;
-	last_rfb_key_injected = dnow();
-
-	got_user_input++;
-	got_keyboard_input++;
-	
-	RAWFB_RET_VOID
-
-
-	apply_remap(&keysym, &isbutton);
-
-	if (use_xrecord && ! xrecording && down) {
-
-		if (!strcmp(scroll_copyrect, "never")) {
-			;
-		} else if (!strcmp(scroll_copyrect, "mouse")) {
-			;
-		} else if (skip_cr_when_scaling("scroll")) {
-			;
-		} else if (! xrecord_skip_keysym(keysym)) {
-			snapshot_stack_list(0, 0.25);
-			xrecord_watch(1, SCR_KEY);
-			xrecord_set_by_keys = 1;
-			xrecord_keysym = keysym;
-		} else {
-			if (debug_scroll) {
-				char *str = XKeysymToString(keysym);
-				rfbLog("xrecord_skip_keysym: %s\n",
-				    str ? str : "NoSymbol");
-			}
-		}
-	}
-
-	if (isbutton) {
-		int mask, button = (int) keysym;
-		char *b, bstr[32];
-
-		if (! down) {
-			INPUT_UNLOCK;
-			return;	/* nothing to send */
-		}
-		if (debug_keyboard) {
-			rfbLog("keyboard(): remapping keystroke to button %d"
-			    " click\n", button);
-		}
-		dtime0(&last_key_to_button_remap_time);
-
-		X_LOCK;
-		/*
-		 * This in principle can be a little dicey... i.e. even
-		 * remap the button click to keystroke sequences!
-		 * Usually just will simulate the button click.
-		 */
-
-		/* loop over possible multiclicks: Button123 */
-		sprintf(bstr, "%d", button);
-		b = bstr;
-		while (*b != '\0') {
-			char t[2];
-			int butt;
-			t[0] = *b;
-			t[1] = '\0';
-			if (sscanf(t, "%d", &butt) == 1) {
-				mask = 1<<(butt-1);
-				do_button_mask_change(mask, butt);	/* down */
-				mask = 0;
-				do_button_mask_change(mask, butt);	/* up */
-			}
-			b++;
-		}
-		XFlush_wr(dpy);
-		X_UNLOCK;
-		INPUT_UNLOCK;
-		return;
-	}
-
-	if (use_modifier_tweak) {
-		modifier_tweak_keyboard(down, keysym, client);
-		X_LOCK;
-		XFlush_wr(dpy);
-		X_UNLOCK;
-		INPUT_UNLOCK;
-		return;
-	}
-
-	X_LOCK;
-
-	k = XKeysymToKeycode(dpy, (KeySym) keysym);
-
-	if (k == NoSymbol && add_keysyms && ! IsModifierKey(keysym)) {
-		int new_kc = add_keysym(keysym);
-		if (new_kc) {
-			k = new_kc;
-		}
-	}
-	if (debug_keyboard) {
-		char *str = XKeysymToString(keysym);
-		rfbLog("keyboard(): KeySym 0x%x \"%s\" -> KeyCode 0x%x%s\n",
-		    (int) keysym, str ? str : "null", (int) k,
-		    k ? "" : " *ignored*");
-	}
-
-	if ( k != NoSymbol ) {
-		XTestFakeKeyEvent_wr(dpy, k, (Bool) down, CurrentTime);
-		XFlush_wr(dpy);
-	}
-
-	X_UNLOCK;
-	INPUT_UNLOCK;
-}
-
-
diff --git a/ica/x11/x11vnc/keyboard.h b/ica/x11/x11vnc/keyboard.h
deleted file mode 100644
index 39a1a89..0000000
--- a/ica/x11/x11vnc/keyboard.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_KEYBOARD_H
-#define _X11VNC_KEYBOARD_H
-
-/* -- keyboard.h -- */
-#include "allowed_input_t.h"
-
-extern void get_keystate(int *keystate);
-extern void clear_modifiers(int init);
-extern int track_mod_state(rfbKeySym keysym, rfbBool down, rfbBool set);
-extern void clear_keys(void);
-extern void clear_locks(void);
-extern int get_autorepeat_state(void);
-extern int get_initial_autorepeat_state(void);
-extern void autorepeat(int restore, int bequiet);
-extern void check_add_keysyms(void);
-extern int add_keysym(KeySym keysym);
-extern void delete_added_keycodes(int bequiet);
-extern void initialize_remap(char *infile);
-extern int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new_kc);
-extern void switch_to_xkb_if_better(void);
-extern char *short_kmbcf(char *str);
-extern void initialize_allowed_input(void);
-extern void initialize_modtweak(void);
-extern void initialize_keyboard_and_pointer(void);
-extern void get_allowed_input(rfbClientPtr client, allowed_input_t *input);
-extern double typing_rate(double time_window, int *repeating);
-extern int skip_cr_when_scaling(char *mode);
-extern void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-
-#endif /* _X11VNC_KEYBOARD_H */
diff --git a/ica/x11/x11vnc/linuxfb.c b/ica/x11/x11vnc/linuxfb.c
deleted file mode 100644
index 1831c5f..0000000
--- a/ica/x11/x11vnc/linuxfb.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- linuxfb.c -- */
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "scan.h"
-#include "xinerama.h"
-#include "screen.h"
-#include "pointer.h"
-#include "allowed_input_t.h"
-#include "uinput.h"
-#include "keyboard.h"
-#include "macosx.h"
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#if LIBVNCSERVER_HAVE_LINUX_FB_H
-#include <linux/fb.h>
-#endif
-
-char *console_guess(char *str, int *fd);
-void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-void console_pointer_command(int mask, int x, int y, rfbClientPtr client);
-
-
-void linux_dev_fb_msg(char *);
-
-char *console_guess(char *str, int *fd) {
-	char *q, *in = strdup(str);
-	char *atparms = NULL, *file = NULL;
-	int do_input, have_uinput, tty = -1;
-
-#ifdef MACOSX
-	return macosx_console_guess(str, fd);
-#endif
-
-
-	if (strstr(in, "/dev/fb") == in) {
-		free(in);
-		in = (char *) malloc(strlen("console:") + strlen(str) + 1);
-		sprintf(in, "console:%s", str);
-	} else if (strstr(in, "fb") == in) {
-		free(in);
-		in = (char *) malloc(strlen("console:/dev/") + strlen(str) + 1);
-		sprintf(in, "console:/dev/%s", str);
-	} else if (strstr(in, "vt") == in) {
-		free(in);
-		in = (char *) malloc(strlen("console_") + strlen(str) + 1);
-		sprintf(in, "console_%s", str);
-	}
-
-	if (strstr(in, "console") != in) {
-		rfbLog("console_guess: unrecognized console/fb format: %s\n", str);
-		free(in);
-		return NULL;
-	}
-
-	q = strrchr(in, '@');
-	if (q) {
-		atparms = strdup(q+1);
-		*q = '\0';
-	}
-	q = strrchr(in, ':');
-	if (q) {
-		file = strdup(q+1);
-		*q = '\0';
-	}
-	if (! file || file[0] == '\0')  {
-		file = strdup("/dev/fb");
-	}
-	if (strstr(file, "fb") == file) {
-		q = (char *) malloc(strlen("/dev/") + strlen(file) + 1);
-		sprintf(q, "/dev/%s", file);
-		free(file);
-		file = q;
-	}
-	if (!strcmp(file, "/dev/fb")) {
-		/* sometimes no sylink fb -> fb0 */
-		struct stat sbuf;
-		if (stat(file, &sbuf) != 0) {
-			free(file);
-			file = strdup("/dev/fb0");
-		}
-	}
-
-	do_input = 1;
-	if (pipeinput_str) {
-		have_uinput = 0;
-		do_input = 0;
-	} else {
-		have_uinput = check_uinput();
-	}
-	if (strstr(in, "console_vt")) {
-		have_uinput = 0;
-	}
-
-	if (!strcmp(in, "consolex")) {
-		do_input = 0;
-	} else if (strstr(in, "console_vtx")) {
-		have_uinput = 0;
-		do_input = 0;
-	} else if (!strcmp(in, "console")) {
-		/* current active VT: */
-		if (! have_uinput) {
-			tty = 0;
-		}
-	} else {
-		int n;
-		if (sscanf(in, "console%d", &n) == 1)  {
-			tty = n;
-			have_uinput = 0;
-		} else if (sscanf(in, "console_vt%d", &n) == 1)  {
-			tty = n;
-			have_uinput = 0;
-		}
-	}
-	if (strstr(in, "console_vt") == in) {
-		char tmp[100];
-		int fd, rows = 30, cols = 80, w, h;
-		sprintf(tmp, "/dev/vcsa%d", tty);
-		file = strdup(tmp);
-		fd = open(file, O_RDWR);
-		if (fd >= 0) {
-			read(fd, tmp, 4);
-			rows = (unsigned char) tmp[0];
-			cols = (unsigned char) tmp[1];
-			close(fd);
-		}
-		w = cols * 8;
-		h = rows * 16;
-		rfbLog("%s %dx%d\n", file, cols, rows);
-		if (getenv("RAWFB_VCSA_BPP")) {
-			/* 8bpp, etc */
-			int bt = atoi(getenv("RAWFB_VCSA_BPP"));
-			if (bt > 0 && bt <=32) {
-				sprintf(tmp, "%dx%dx%d", w, h, bt);
-			} else {
-				sprintf(tmp, "%dx%dx16", w, h);
-			}
-		} else {
-			/* default 16bpp */
-			sprintf(tmp, "%dx%dx16", w, h);
-		}
-		atparms = strdup(tmp);
-	}
-	rfbLog("console_guess: file is %s\n", file);
-
-	if (! atparms) {
-#if LIBVNCSERVER_HAVE_LINUX_FB_H
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H
-		struct fb_var_screeninfo var_info;
-		int d = open(file, O_RDWR);
-		if (d >= 0) {
-			int w, h, b;
-			unsigned long rm = 0, gm = 0, bm = 0;
-			if (ioctl(d, FBIOGET_VSCREENINFO, &var_info) != -1) {
-				w = (int) var_info.xres;
-				h = (int) var_info.yres;
-				b = (int) var_info.bits_per_pixel;
-
-				rm = (1 << var_info.red.length)   - 1;
-				gm = (1 << var_info.green.length) - 1;
-				bm = (1 << var_info.blue.length)  - 1;
-				rm = rm << var_info.red.offset;
-				gm = gm << var_info.green.offset;
-				bm = bm << var_info.blue.offset;
-
-				if (b == 8 && rm == 0xff && gm == 0xff && bm == 0xff) {
-					/* I don't believe it... */
-					rm = 0x07;
-					gm = 0x38;
-					bm = 0xc0;
-				}
-				if (b <= 8 && (rm == gm && gm == bm)) {
-					if (b == 4) {
-						rm = 0x07;
-						gm = 0x38;
-						bm = 0xc0;
-					}
-				}
-				
-				/* @66666x66666x32:0xffffffff:... */
-				atparms = (char *) malloc(200);
-				sprintf(atparms, "%dx%dx%d:%lx/%lx/%lx",
-				    w, h, b, rm, gm, bm);
-				*fd = d;
-			} else {
-				perror("ioctl");
-				close(d);
-			}
-		} else {
-			rfbLog("could not open: %s\n", file);
-			rfbLogPerror("open");
-			linux_dev_fb_msg(file);
-			close(d);
-		}
-#endif
-#endif
-	}
-
-	if (atparms) {
-		int gw, gh, gb;
-		if (sscanf(atparms, "%dx%dx%d", &gw, &gh, &gb) == 3)  {
-			fb_x = gw;	
-			fb_y = gh;	
-			fb_b = gb;	
-		}
-	}
-
-	if (do_input) {
-		if (tty >=0 && tty < 64) {
-			pipeinput_str = (char *) malloc(10);
-			sprintf(pipeinput_str, "CONSOLE%d", tty);
-			rfbLog("console_guess: file pipeinput %s\n",
-			    pipeinput_str);
-			initialize_pipeinput();
-		} else if (have_uinput) {
-			pipeinput_str = strdup("UINPUT");
-			rfbLog("console_guess: file pipeinput %s\n",
-			    pipeinput_str);
-			initialize_pipeinput();
-		}
-	}
-
-	if (! atparms) {
-		rfbLog("console_guess: could not get @ parameters.\n");
-		return NULL;
-	}
-
-	q = (char *) malloc(strlen("mmap:") + strlen(file) + 1 + strlen(atparms) + 1);
-	if (strstr(in, "console_vt")) {
-		sprintf(q, "snap:%s@%s", file, atparms);
-	} else {
-		sprintf(q, "map:%s@%s", file, atparms);
-	}
-	free(atparms);
-	return q;
-}
-
-void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
-	static int control = 0, alt = 0;
-	allowed_input_t input;
-
-	if (debug_keyboard) fprintf(stderr, "console_key_command: %d %s\n", (int) keysym, down ? "down" : "up");
-
-	if (pipeinput_cons_fd < 0) {
-		return;		
-	}
-	if (view_only) {
-		return;
-	}
-	get_allowed_input(client, &input);
-	if (! input.keystroke) {
-		return;
-	}
-
-	/* From LinuxVNC.c: */
-	if (keysym == XK_Control_L || keysym == XK_Control_R) {
-		if (! down) {
-			if (control > 0) {
-				control--;
-			}
-		} else {
-			control++;
-		}
-		return;
-	}
-	if (keysym == XK_Alt_L || keysym == XK_Alt_R) {
-		if (! down) {
-			if (alt > 0) {
-				alt--;
-			}
-		} else {
-			alt++;
-		}
-		return;
-	}
-	if (!down) {
-		return;
-	}
-	if (keysym == XK_Escape) {
-		keysym = 27;
-	}
-	if (control) {
-		/* shift down to the "control" zone */
-		if (keysym >= 'a' && keysym <= 'z') {
-			keysym -= ('a' - 1);
-		} else if (keysym >= 'A' && keysym <= 'Z') {
-			keysym -= ('A' - 1);
-		} else {
-			keysym = 0xffff;
-		}
-	} else if (alt) {
-		/* shift up to the upper half Latin zone */
-		if (keysym >= '!' && keysym <= '~') {
-			keysym += 128;
-		}
-	}
-	if (debug_keyboard) fprintf(stderr, "keysym now: %d\n", (int) keysym);
-	if (keysym == XK_Tab) {
-		keysym = '\t';
-	} else if (keysym == XK_Return || keysym == XK_KP_Enter) {
-		keysym = '\r';
-	} else if (keysym == XK_BackSpace) {
-		keysym = 8;
-	} else if (keysym == XK_Home || keysym == XK_KP_Home) {
-		keysym = 1;
-	} else if (keysym == XK_End || keysym == XK_KP_End) {
-		keysym = 5;
-	} else if (keysym == XK_Up || keysym == XK_KP_Up) {
-		keysym = 16;
-	} else if (keysym == XK_Down || keysym == XK_KP_Down) {
-		keysym = 14;
-	} else if (keysym == XK_Right || keysym == XK_KP_Right) {
-		keysym = 6;
-	} else if (keysym == XK_Next || keysym == XK_KP_Next) {
-		keysym = 6;
-	} else if (keysym == XK_Left || keysym == XK_KP_Left) {
-		keysym = 2;
-	} else if (keysym == XK_Prior || keysym == XK_KP_Prior) {
-		keysym = 2;
-	} else {
-		if (keysym >= XK_KP_Multiply && keysym <= XK_KP_Equal) {
-			keysym -= 0xFF80;
-		}
-	}
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCSTI)
-	if (keysym < 0x100) {
-		if (ioctl(pipeinput_cons_fd, TIOCSTI, &keysym) != -1) {
-			return;
-		}
-		perror("ioctl");
-		close(pipeinput_cons_fd);
-		pipeinput_cons_fd = -1;
-		if (! pipeinput_cons_dev) {
-			return;
-		}
-		pipeinput_cons_fd = open(pipeinput_cons_dev, O_WRONLY);
-		if (pipeinput_cons_fd < 0) {
-			rfbLog("pipeinput: could not reopen %s\n",
-			    pipeinput_cons_dev);
-			perror("open");
-			return;
-		}
-		if (ioctl(pipeinput_cons_fd, TIOCSTI, &keysym) == -1) {
-			perror("ioctl");
-			close(pipeinput_cons_fd);
-			pipeinput_cons_fd = -1;
-			rfbLog("pipeinput: could not reopen %s\n",
-			    pipeinput_cons_dev);
-		}
-	}
-#endif
-
-	if (client) {}
-}
-
-void console_pointer_command(int mask, int x, int y, rfbClientPtr client) {
-	/* do not forget viewonly perms */
-	if (mask || x || y || client) {}
-}
-
diff --git a/ica/x11/x11vnc/linuxfb.h b/ica/x11/x11vnc/linuxfb.h
deleted file mode 100644
index d3886c9..0000000
--- a/ica/x11/x11vnc/linuxfb.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_LINUXFB_H
-#define _X11VNC_LINUXFB_H
-
-/* -- linuxfb.h -- */
-extern char *console_guess(char *str, int *fd);
-extern void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-extern void console_pointer_command(int mask, int x, int y, rfbClientPtr client);
-
-
-#endif /* _X11VNC_LINUXFB_H */
diff --git a/ica/x11/x11vnc/macosx.c b/ica/x11/x11vnc/macosx.c
deleted file mode 100644
index 34126f4..0000000
--- a/ica/x11/x11vnc/macosx.c
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- macosx.c -- */
-
-#include "rfb/rfbconfig.h"
-#if (defined(__MACH__) && defined(__APPLE__) && defined(LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY))
-
-#define DOMAC 1
-
-#else
-
-#define DOMAC 0
-
-#endif
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "scan.h"
-#include "screen.h"
-#include "pointer.h"
-#include "allowed_input_t.h"
-#include "keyboard.h"
-#include "cursor.h"
-#include "connections.h"
-#include "macosxCG.h"
-#include "macosxCGP.h"
-#include "macosxCGS.h"
-
-void macosx_log(char *);
-char *macosx_console_guess(char *str, int *fd);
-void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-void macosx_pointer_command(int mask, int x, int y, rfbClientPtr client);
-char *macosx_get_fb_addr(void);
-int macosx_get_cursor(void);
-int macosx_get_cursor_pos(int *, int *);
-void macosx_send_sel(char *, int);
-void macosx_set_sel(char *, int);
-int macosx_valid_window(Window, XWindowAttributes*);
-
-Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
-    Window **children_return, unsigned int *nchildren_return);
-int macosx_get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
-    Window *frame, Window *win);
-
-void macosx_add_mapnotify(Window win, int level, int map);
-void macosx_add_create(Window win, int level);
-void macosx_add_destroy(Window win, int level);
-void macosx_add_visnotify(Window win, int level, int obscured);
-int macosx_checkevent(XEvent *ev);
-
-void macosx_log(char *str) {
-	rfbLog(str);
-}
-
-#if (! DOMAC)
-
-void macosx_event_loop(void) {
-	return;
-}
-char *macosx_console_guess(char *str, int *fd) {
-	if (!str || !fd) {}
-	return NULL;
-}
-void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
-	if (!down || !keysym || !client) {}
-	return;
-}
-void macosx_pointer_command(int mask, int x, int y, rfbClientPtr client) {
-	if (!mask || !x || !y || !client) {}
-	return;
-}
-char *macosx_get_fb_addr(void) {
-	return NULL;
-}
-int macosx_get_cursor(void) {
-	return 0;
-}
-int macosx_get_cursor_pos(int *x, int *y) {
-	if (!x || !y) {}
-	return 0;
-}
-void macosx_send_sel(char * str, int len) {
-	if (!str || !len) {}
-	return;
-}
-void macosx_set_sel(char * str, int len) {
-	if (!str || !len) {}
-	return;
-}
-int macosx_valid_window(Window w, XWindowAttributes* a) {
-	if (!w || !a) {}
-	return 0;
-}
-Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
-    Window **children_return, unsigned int *nchildren_return) {
-	if (!w || !root_return || !parent_return || !children_return || !nchildren_return) {}
-	return (Status) 0;
-}
-void macosx_add_mapnotify(Window win, int level, int map) {
-	if (!win || !level || !map) {}
-	return;
-}
-void macosx_add_create(Window win, int level) {
-	if (!win || !level) {}
-	return;
-}
-void macosx_add_destroy(Window win, int level) {
-	if (!win || !level) {}
-	return;
-}
-void macosx_add_visnotify(Window win, int level, int obscured) {
-	if (!win || !level || !obscured) {}
-	return;
-}
-
-int macosx_checkevent(XEvent *ev) {
-	if (!ev) {}
-	return 0;
-}
-
-
-#else 
-
-void macosx_event_loop(void) {
-	macosxCG_event_loop();
-}
-
-char *macosx_get_fb_addr(void) {
-	macosxCG_init();
-	return macosxCG_get_fb_addr();
-}
-
-int macosx_opengl_get_width(void);
-int macosx_opengl_get_height(void);
-int macosx_opengl_get_bpp(void);
-int macosx_opengl_get_bps(void);
-int macosx_opengl_get_spp(void);
-
-char *macosx_console_guess(char *str, int *fd) {
-	char *q, *in = strdup(str);
-	char *atparms = NULL, *file = NULL;
-
-	macosxCG_init();
-
-	if (strstr(in, "console") != in) {
-		rfbLog("console_guess: unrecognized console/fb format: %s\n", str);
-		free(in);
-		return NULL;
-	}
-
-	*fd = -1;
-
-	q = strrchr(in, '@');
-	if (q) {
-		atparms = strdup(q+1);
-		*q = '\0';
-	}
-	q = strrchr(in, ':');
-	if (q) {
-		file = strdup(q+1);
-		*q = '\0';
-	}
-	if (! file || file[0] == '\0')  {
-		file = strdup("/dev/null");
-	}
-	rfbLog("console_guess: file is %s\n", file);
-
-	if (! pipeinput_str) {
-		pipeinput_str = strdup("MACOSX");
-		initialize_pipeinput();
-	}
-
-	if (! atparms) {
-		int w, h, b, bps, dep;
-		unsigned long rm = 0, gm = 0, bm = 0;
-
-		if (macosx_read_opengl) {
-			w = macosx_opengl_get_width();
-			h = macosx_opengl_get_height();
-			b = macosx_opengl_get_bpp();
-
-			bps = macosx_opengl_get_bps();
-			dep = macosx_opengl_get_spp() * bps;
-			
-		} else {
-			w = macosxCG_CGDisplayPixelsWide();
-			h = macosxCG_CGDisplayPixelsHigh();
-			b = macosxCG_CGDisplayBitsPerPixel();
-
-			bps = macosxCG_CGDisplayBitsPerSample();
-			dep = macosxCG_CGDisplaySamplesPerPixel() * bps;
-		}
-
-		rm = (1 << bps) - 1;
-		gm = (1 << bps) - 1;
-		bm = (1 << bps) - 1;
-		rm = rm << 2 * bps;
-		gm = gm << 1 * bps;
-		bm = bm << 0 * bps;
-
-		if (b == 8 && rm == 0xff && gm == 0xff && bm == 0xff) {
-			/* I don't believe it... */
-			rm = 0x07;
-			gm = 0x38;
-			bm = 0xc0;
-		}
-		
-		/* @66666x66666x32:0xffffffff:... */
-		atparms = (char *) malloc(200);
-		sprintf(atparms, "%dx%dx%d:%lx/%lx/%lx", w, h, b, rm, gm, bm);
-	}
-	if (atparms) {
-		int gw, gh, gb;
-		if (sscanf(atparms, "%dx%dx%d", &gw, &gh, &gb) == 3)  {
-			fb_x = gw;	
-			fb_y = gh;	
-			fb_b = gb;	
-		}
-	}
-	if (! atparms) {
-		rfbLog("console_guess: could not get @ parameters.\n");
-		return NULL;
-	}
-
-	q = (char *) malloc(strlen("map:macosx:") + strlen(file) + 1 + strlen(atparms) + 1);
-	sprintf(q, "map:macosx:%s@%s", file, atparms);
-	free(atparms);
-	return q;
-}
-
-Window macosx_click_frame = None;
-
-void macosx_pointer_command(int mask, int x, int y, rfbClientPtr client) {
-	allowed_input_t input;
-	static int last_mask = 0;
-	int rc;
-
-	if (0) fprintf(stderr, "macosx_pointer_command: %d %d - %d\n", x, y, mask);
-
-	if (mask >= 0) {
-		got_pointer_calls++;
-	}
-
-	if (view_only) {
-		return;
-	}
-
-	get_allowed_input(client, &input);
-
-	if (! input.motion || ! input.button) {
-		/* XXX fix me with last_x, last_y, etc. */
-		return;
-	}
-
-	if (mask >= 0) {
-		got_user_input++;
-		got_pointer_input++;
-		last_pointer_client = client;
-		last_pointer_time = time(NULL);
-	}
-	if (last_mask != mask) {
-		if (0) fprintf(stderr, "about to inject mask change %d -> %d: %.4f\n", last_mask, mask, dnowx());
-		if (mask) {
-			int px, py, x, y, w, h;
-			macosx_click_frame = None;
-			if (!macosx_get_wm_frame_pos(&px, &py, &x, &y, &w, &h, &macosx_click_frame, NULL)) {
-				macosx_click_frame = None;
-			}
-		}
-	}
-
-	macosxCG_pointer_inject(mask, x, y);
-
-	if (cursor_x != x || cursor_y != y) {
-		last_pointer_motion_time = dnow();
-	}
-
-	cursor_x = x;
-	cursor_y = y;
-
-	if (last_mask != mask) {
-		last_pointer_click_time = dnow();
-		if (ncache > 0) {
-			/* XXX Y */
-			int i;
-if (0) fprintf(stderr, "about to get all windows:           %.4f\n", dnowx());
-			for (i=0; i < 2; i++) {
-				macosxCGS_get_all_windows();
-				if (0) fprintf(stderr, "!");
-				if (macosx_checkevent(NULL)) {
-					break;
-				}
-			}
-if (0) fprintf(stderr, "\ndone:                               %.4f\n", dnowx());
-		}
-	}
-	last_mask = mask;
-
-	/* record the x, y position for the rfb screen as well. */
-	cursor_position(x, y);
-
-	/* change the cursor shape if necessary */
-	rc = set_cursor(x, y, get_which_cursor());
-	cursor_changes += rc;
-
-	last_event = last_input = last_pointer_input = time(NULL);
-}
-
-void init_key_table(void) {
-	macosxCG_init_key_table();
-}
-
-void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
-	allowed_input_t input;
-	if (debug_keyboard) fprintf(stderr, "macosx_key_command: %d %s\n", (int) keysym, down ? "down" : "up");
-
-	if (view_only) {
-		return;
-	}
-	get_allowed_input(client, &input);
-	if (! input.keystroke) {
-		return;
-	}
-
-	init_key_table();
-	macosxCG_keysym_inject((int) down, (unsigned int) keysym);
-}
-
-extern void macosxGCS_poll_pb(void);
-
-int macosx_get_cursor_pos(int *x, int *y) {
-	macosxCG_get_cursor_pos(x, y);
-	if (nofb) {
-		/* good time to poll the pasteboard */
-		macosxGCS_poll_pb();
-	}
-	return 1;
-}
-
-static char *cuttext = NULL;
-static int cutlen = 0;
-
-void macosx_send_sel(char *str, int len) {
-	if (screen && all_clients_initialized()) {
-		if (cuttext) {
-			int n = cutlen;
-			if (len < n) {
-				n = len;
-			}
-			if (!memcmp(str, cuttext, (size_t) n)) {
-				/* the same text we set pasteboard to ... */
-				return;
-			}
-		}
-		if (debug_sel) {
-			rfbLog("macosx_send_sel: %d\n", len);
-		}
-		rfbSendServerCutText(screen, str, len);
-	}
-}
-
-void macosx_set_sel(char *str, int len) {
-	if (screen && all_clients_initialized()) {
-		if (cutlen <= len) {
-			if (cuttext) {
-				free(cuttext);
-			}
-			cutlen = 2*(len+1);
-			cuttext = (char *) calloc(cutlen, 1);
-		}
-		memcpy(cuttext, str, (size_t) len);
-		cuttext[len] = '\0';
-		if (debug_sel) {
-			rfbLog("macosx_set_sel: %d\n", len);
-		}
-		macosxGCS_set_pasteboard(str, len);
-	}
-}
-
-int macosx_get_cursor(void) {
-	return macosxCG_get_cursor();
-}
-
-typedef struct evdat {
-	int win;
-	int map;
-	int level;
-	int vis;
-	int type;
-} evdat_t;
-
-#define MAX_EVENTS 1024
-evdat_t mac_events[MAX_EVENTS];
-int mac_events_ptr = 0;
-int mac_events_last = 0;
-
-void macosx_add_mapnotify(Window win, int level, int map) {
-	int i = mac_events_last++;
-	mac_events[i].win = win;
-	mac_events[i].level = level;
-
-	if (map) {
-		mac_events[i].type = MapNotify;
-	} else {
-		mac_events[i].type = UnmapNotify;
-	}
-	mac_events[i].map = map;
-	mac_events[i].vis = -1;
-
-	mac_events_last = mac_events_last % MAX_EVENTS;
-
-	return;
-}
-
-void macosx_add_create(Window win, int level) {
-	int i = mac_events_last++;
-	mac_events[i].win = win;
-	mac_events[i].level = level;
-
-	mac_events[i].type = CreateNotify;
-	mac_events[i].map = -1;
-	mac_events[i].vis = -1;
-
-	mac_events_last = mac_events_last % MAX_EVENTS;
-
-	return;
-}
-
-void macosx_add_destroy(Window win, int level) {
-	int i = mac_events_last++;
-	mac_events[i].win = win;
-	mac_events[i].level = level;
-
-	mac_events[i].type = DestroyNotify;
-	mac_events[i].map = -1;
-	mac_events[i].vis = -1;
-
-	mac_events_last = mac_events_last % MAX_EVENTS;
-
-	return;
-}
-
-void macosx_add_visnotify(Window win, int level, int obscured) {
-	int i = mac_events_last++;
-	mac_events[i].win = win;
-	mac_events[i].level = level;
-
-	mac_events[i].type = VisibilityNotify;
-	mac_events[i].map = -1;
-
-	mac_events[i].vis = 1;
-	if (obscured == 0) {
-		mac_events[i].vis = VisibilityUnobscured;
-	} else if (obscured == 1) {
-		mac_events[i].vis = VisibilityPartiallyObscured;
-	} else if (obscured == 2) {
-		mac_events[i].vis = VisibilityFullyObscured; 	/* NI */
-	}
-
-	mac_events_last = mac_events_last % MAX_EVENTS;
-
-	return;
-}
-
-int macosx_checkevent(XEvent *ev) {
-	int i = mac_events_ptr;
-
-	if (mac_events_ptr == mac_events_last) {
-		return 0;
-	}
-	if (ev == NULL) {
-		return mac_events[i].type;
-	}
-
-	ev->xany.window = mac_events[i].win;
-
-	if (mac_events[i].type == CreateNotify) {
-		ev->type = CreateNotify;
-		ev->xany.window = rootwin;
-		ev->xcreatewindow.window = mac_events[i].win;
-	} else if (mac_events[i].type == DestroyNotify) {
-		ev->type = DestroyNotify;
-		ev->xdestroywindow.window = mac_events[i].win;
-	} else if (mac_events[i].type == VisibilityNotify) {
-		ev->type = VisibilityNotify;
-		ev->xvisibility.state = mac_events[i].vis;
-	} else if (mac_events[i].type == MapNotify) {
-		ev->type = MapNotify;
-	} else if (mac_events[i].type == UnmapNotify) {
-		ev->type = UnmapNotify;
-	} else {
-		fprintf(stderr, "unknown macosx_checkevent: %d\n", mac_events[i].type);
-	}
-	mac_events_ptr++;
-	mac_events_ptr = mac_events_ptr % MAX_EVENTS;
-
-	return mac_events[i].type;
-}
-
-typedef struct windat {
-	int win;
-	int x, y;
-	int width, height;
-	int level;
-	int mapped;
-	int clipped;
-	int ncache_only;
-} windat_t;
-
-extern int macwinmax; 
-extern windat_t macwins[]; 
-
-int macosx_get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
-    Window *frame, Window *win) {
-	static int last_idx = -1;
-	int x1, x2, y1, y2;
-	int idx = -1, k;
-	macosxCGS_get_all_windows();
-	macosxCG_get_cursor_pos(px, py);
-
-	for (k = 0; k<macwinmax; k++) {
-		if (! macwins[k].mapped) {
-			continue;
-		}
-		x1 = macwins[k].x;
-		x2 = macwins[k].x + macwins[k].width;
-		y1 = macwins[k].y;
-		y2 = macwins[k].y + macwins[k].height;
-if (debug_wireframe) fprintf(stderr, "%d/%d:	%d %d %d  - %d %d %d\n", k, macwins[k].win, x1, *px, x2, y1, *py, y2);
-		if (x1 <= *px && *px < x2) {
-			if (y1 <= *py && *py < y2) {
-				idx = k;
-				break;
-			}
-		}
-	}
-	if (idx < 0) {
-		return 0;
-	}
-
-	*x = macwins[idx].x;
-	*y = macwins[idx].y;
-	*w = macwins[idx].width;
-	*h = macwins[idx].height;
-	*frame = (Window) macwins[idx].win;
-	if (win != NULL) {
-		*win = *frame;
-	}
-
-	last_idx = idx;
-
-	return 1;
-}
-
-int macosx_valid_window(Window w, XWindowAttributes* a) {
-	static int last_idx = -1;
-	int win = (int) w;
-	int i, k, idx = -1;
-
-	if (last_idx >= 0 && last_idx < macwinmax) {
-		if (macwins[last_idx].win == win) {
-			idx = last_idx;
-		}
-	}
-
-	if (idx < 0) {
-		idx = macosxCGS_get_qlook(w);
-		if (idx >= 0 && idx < macwinmax) {
-			if (macwins[idx].win != win) {
-				idx = -1;
-			}
-		} else {
-			idx = -1;
-		}
-	}
-
-	if (idx < 0) {
-		for (i = 0; i<macwinmax; i++) {
-			k = i;
-			if (i == -1)  {
-				if (last_idx >= 0 && last_idx < macwinmax) {
-					k = last_idx;
-				} else {
-					last_idx = -1;
-					continue;
-				}
-			}
-			if (macwins[k].win == win) {
-				idx = k;
-				break;
-			}
-		}
-	}
-	if (idx < 0) {
-		return 0;
-	}
-
-	a->x = macwins[idx].x;
-	a->y = macwins[idx].y;
-	a->width  = macwins[idx].width;
-	a->height = macwins[idx].height;
-	a->depth = depth;
-	a->border_width = 0;
-	a->backing_store = 0;
-	if (macwins[idx].mapped) {
-		a->map_state = IsViewable;
-	} else {
-		a->map_state = IsUnmapped;
-	}
-
-	last_idx = idx;
-	
-	return 1;
-}
-
-#define QTMAX 2048
-static Window cret[QTMAX];
-
-extern int CGS_levelmax;
-extern int CGS_levels[];
-
-Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
-    Window **children_return, unsigned int *nchildren_return) {
-
-	int i, n, k;
-
-	*root_return = (Window) 0;
-	*parent_return = (Window) 0;
-	if (!w) {}
-
-	macosxCGS_get_all_windows();
-
-	n = 0;
-	for (k = CGS_levelmax - 1; k >= 0; k--) {
-		for (i = macwinmax - 1; i >= 0; i--) {
-			if (n >= QTMAX) break;
-			if (macwins[i].level == CGS_levels[k]) {
-if (0) fprintf(stderr, "k=%d i=%d n=%d\n", k, i, n);
-				cret[n++] = (Window) macwins[i].win;
-			}
-		}
-	}
-	*children_return = cret;
-	*nchildren_return = (unsigned int) macwinmax;
-
-	return (Status) 1;
-}
-
-int macosx_check_offscreen(int win) {
-	sraRegionPtr r0, r1;
-	int x1, y1, x2, y2;
-	int ret;
-	int i = macosxCGS_find_index(win);
-
-	if (i < 0) {
-		return 0;
-	}
-
-	x1 = macwins[i].x;
-	y1 = macwins[i].y;
-	x2 = macwins[i].x + macwins[i].width;
-	y2 = macwins[i].y + macwins[i].height;
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r1 = sraRgnCreateRect(x1, y1, x2, y2);
-
-	if (sraRgnAnd(r1, r0)) {
-		ret = 0;
-	} else {
-		ret = 1;
-	}
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r1);
-
-	return ret;
-}
-
-int macosx_check_clipped(int win, int *list, int n) {
-	sraRegionPtr r0, r1, r2;
-	int x1, y1, x2, y2;
-	int ret = 0;
-	int k, j, i = macosxCGS_find_index(win);
-
-	if (i < 0) {
-		return 0;
-	}
-
-	x1 = macwins[i].x;
-	y1 = macwins[i].y;
-	x2 = macwins[i].x + macwins[i].width;
-	y2 = macwins[i].y + macwins[i].height;
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r1 = sraRgnCreateRect(x1, y1, x2, y2);
-	sraRgnAnd(r1, r0);
-
-	for (k = 0; k < n; k++) {
-		j = macosxCGS_find_index(list[k]);	/* XXX slow? */
-		if (j < 0) {
-			continue;
-		}
-		x1 = macwins[j].x;
-		y1 = macwins[j].y;
-		x2 = macwins[j].x + macwins[j].width;
-		y2 = macwins[j].y + macwins[j].height;
-		r2 = sraRgnCreateRect(x1, y1, x2, y2);
-		if (sraRgnAnd(r2, r1)) {
-			ret = 1;
-			sraRgnDestroy(r2);
-			break;
-		}
-		sraRgnDestroy(r2);
-	}
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r1);
-
-	return ret;
-}
-
-
-#endif 	/* LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY */
-
diff --git a/ica/x11/x11vnc/macosx.h b/ica/x11/x11vnc/macosx.h
deleted file mode 100644
index 60620c8..0000000
--- a/ica/x11/x11vnc/macosx.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_MACOSX_H
-#define _X11VNC_MACOSX_H
-
-/* -- macosx.h -- */
-
-extern void macosx_log(char *);
-extern char *macosx_console_guess(char *str, int *fd);
-extern char *macosx_get_fb_addr(void);
-extern void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-extern void macosx_pointer_command(int mask, int x, int y, rfbClientPtr client);
-extern void macosx_event_loop(void);
-extern int macosx_get_cursor(void);
-extern int macosx_get_cursor_pos(int *, int *);
-extern int macosx_valid_window(Window, XWindowAttributes*);
-extern Status macosx_xquerytree(Window w, Window *root_return, Window *parent_return,
-    Window **children_return, unsigned int *nchildren_return);
-extern int macosx_get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
-    Window *frame, Window *win);
-extern void macosx_send_sel(char *, int);
-extern void macosx_set_sel(char *, int);
-
-extern void macosx_add_mapnotify(Window win, int level, int map);
-extern void macosx_add_create(Window win, int level);
-extern void macosx_add_destroy(Window win, int level);
-extern void macosx_add_visnotify(Window win, int level, int obscured);
-extern int macosx_checkevent(XEvent *ev);
-
-extern Window macosx_click_frame;
-
-
-#endif /* _X11VNC_MACOSX_H */
diff --git a/ica/x11/x11vnc/macosxCG.c b/ica/x11/x11vnc/macosxCG.c
deleted file mode 100644
index 12041e0..0000000
--- a/ica/x11/x11vnc/macosxCG.c
+++ /dev/null
@@ -1,989 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- macosxCG.c -- */
-
-/*
- * We need to keep this separate from nearly everything else, e.g. rfb.h
- * and the other stuff, otherwise it does not work properly, mouse drags
- * will not work!!
- */
-
-void macosxCG_dummy(void) {}
-
-#if (defined(__MACH__) && defined(__APPLE__))
-
-#include <ApplicationServices/ApplicationServices.h>
-#include <Cocoa/Cocoa.h>
-#include <Carbon/Carbon.h>
-
-void macosxCG_init(void);
-void macosxCG_fini(void);
-void macosxCG_event_loop(void);
-char *macosxCG_get_fb_addr(void);
-
-int macosxCG_CGDisplayPixelsWide(void);
-int macosxCG_CGDisplayPixelsHigh(void);
-int macosxCG_CGDisplayBitsPerPixel(void);
-int macosxCG_CGDisplayBitsPerSample(void);
-int macosxCG_CGDisplaySamplesPerPixel(void);
-int macosxCG_CGDisplayBytesPerRow(void);
-
-void macosxCG_pointer_inject(int mask, int x, int y);
-int macosxCG_get_cursor_pos(int *x, int *y);
-int macosxCG_get_cursor(void);
-void macosxCG_init_key_table(void);
-void macosxCG_keysym_inject(int down, unsigned int keysym);
-void macosxCG_keycode_inject(int down, int keycode);
-
-CGDirectDisplayID displayID = 0;
-
-extern void macosx_log(char *);
-extern int collect_non_X_xdamage(int x_in, int y_in, int w_in, int h_in, int call);
-
-static void macosxCG_callback(CGRectCount n, const CGRect *rects, void *dum) {
-	int i, db = 0;
-	if (db) fprintf(stderr, "macosx_callback: n=%d\n", (int) n);
-	if (!dum) {}
-	for (i=0; i < (int) n; i++) {
-		if (db > 1) fprintf(stderr, "               : %g %g - %g %g\n", rects[i].origin.x, rects[i].origin.y, rects[i].size.width, rects[i].size.height);
-		collect_non_X_xdamage( (int) rects[i].origin.x, (int) rects[i].origin.y,
-		    (int) rects[i].size.width, (int) rects[i].size.height, 1);
-	}
-}
-
-#if 0
-> 
-> if gcc -DHAVE_CONFIG_H -I. -I. -I..   -I/opt/local/include   -I/opt/local/include -ObjC -g -O2 -Wall -MT x11vnc-macosxCG.o -MD -MP -MF ".deps/x11vnc-macosxCG.Tpo" -c -o x11vnc-macosxCG.o `test -f 'macosxCG.c' || echo './'`macosxCG.c; \
-> 	then mv -f ".deps/x11vnc-macosxCG.Tpo" ".deps/x11vnc-macosxCG.Po"; else rm -f ".deps/x11vnc-macosxCG.Tpo"; exit 1; fi
-> macosxCG.c:149: warning: CGSetLocalEventsSuppressionInterval is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:373)
-> macosxCG.c:150: warning: CGSetLocalEventsFilterDuringSuppressionState is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:366)
-> macosxCG.c:153: warning: CGSetLocalEventsFilterDuringSuppressionState is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:366)
-> macosxCG.c:244: warning: CGDisplayBaseAddress is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:466)
-> macosxCG.c:254: warning: CGDisplayBitsPerPixel is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:517)
-> macosxCG.c:257: warning: CGDisplayBitsPerSample is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:522)
-> macosxCG.c:260: warning: CGDisplaySamplesPerPixel is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:526)
-> macosxCG.c:263: warning: CGDisplayBytesPerRow is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:476)
-> macosxCG.c:419: warning: CGPostScrollWheelEvent is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:327)
-> macosxCG.c:422: warning: CGPostScrollWheelEvent is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:327)
-> macosxCG.c:425: warning: CGPostMouseEvent is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:307)
-> macosxCG.c:641: warning: CGPostKeyboardEvent is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:333)
-> macosxCG.c:661: warning: CGPostKeyboardEvent is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:333)
->
-
-X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS
-X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS
-X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER
-X11VNC_MACOSX_NO_DEPRECATED
-
-#endif
-
-static int callback_set = 0;
-extern int nofb;
-
-void macosxCG_refresh_callback_on(void) {
-	if (nofb) {
-		return;
-	}
-
-	if (! callback_set) {
-		if (1) macosx_log("macosxCG_refresh_callback: register\n");
-		CGRegisterScreenRefreshCallback(macosxCG_callback, NULL);
-	}
-	callback_set = 1;
-}
-
-void macosxCG_refresh_callback_off(void) {
-	if (callback_set) {
-		if (1) macosx_log("macosxCG_refresh_callback: unregister\n");
-		CGUnregisterScreenRefreshCallback(macosxCG_callback, NULL);
-	}
-	callback_set = 0;
-}
-
-extern int macosx_noscreensaver;
-extern int macosx_read_opengl;
-extern int macosx_read_rawfb;
-
-extern void macosxGCS_initpb(void);
-extern int macosxCGP_init_dimming(void);
-extern int macosxCGP_undim(void);
-extern int macosxCGP_dim_shutdown(void);
-extern void macosxCGP_screensaver_timer_off(void);
-extern void macosxCGP_screensaver_timer_on(void);
-extern void macosx_opengl_init(void);
-extern void macosx_opengl_fini(void);
-
-int x11vnc_macosx_no_deprecated_localevents = 0;
-int x11vnc_macosx_no_deprecated_postevents  = 0;
-int x11vnc_macosx_no_deprecated_framebuffer = 0;
-
-void macosxCG_init(void) {
-
-	x11vnc_macosx_no_deprecated_localevents = 0;
-	x11vnc_macosx_no_deprecated_postevents  = 0;
-	x11vnc_macosx_no_deprecated_framebuffer = 0;
-
-	if (getenv("X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS") || getenv("X11VNC_MACOSX_NO_DEPRECATED")) {
-		x11vnc_macosx_no_deprecated_localevents = 1;
-	}
-	if (getenv("X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS") || getenv("X11VNC_MACOSX_NO_DEPRECATED")) {
-		x11vnc_macosx_no_deprecated_postevents = 1;
-	}
-	if (getenv("X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER") || getenv("X11VNC_MACOSX_NO_DEPRECATED")) {
-		x11vnc_macosx_no_deprecated_framebuffer = 1;
-	}
-
-	if (displayID == 0) {
-		macosx_log("macosxCG_init: initializing display.\n");
-
-		displayID = kCGDirectMainDisplay;
-#ifdef X11VNC_MACOSX_USE_GETMAINDEVICE
-		/* not sure this ever did anything. */
-		(void) GetMainDevice();
-#endif
-		if (displayID == 0) {
-			macosx_log("macosxCG_init: could not get kCGDirectMainDisplay / CGMainDisplayID() display.\n");
-			exit(1);
-		}
-
-#if X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS || X11VNC_MACOSX_NO_DEPRECATED
-		macosx_log("NO_DEPRECATED_LOCALEVENTS: not calling CGSetLocalEventsSuppressionInterval()\n");
-		macosx_log("NO_DEPRECATED_LOCALEVENTS: not calling CGSetLocalEventsFilterDuringSupressionState()\n");
-#else
-		if (!x11vnc_macosx_no_deprecated_localevents) {
-			CGSetLocalEventsSuppressionInterval(0.0);
-			CGSetLocalEventsFilterDuringSupressionState(
-			    kCGEventFilterMaskPermitAllEvents,
-			    kCGEventSupressionStateSupressionInterval);
-			CGSetLocalEventsFilterDuringSupressionState(
-			    kCGEventFilterMaskPermitAllEvents,
-			    kCGEventSupressionStateRemoteMouseDrag);
-		} else {
-			macosx_log("NO_DEPRECATED_LOCALEVENTS: not calling CGSetLocalEventsSuppressionInterval()\n");
-			macosx_log("NO_DEPRECATED_LOCALEVENTS: not calling CGSetLocalEventsFilterDuringSupressionState()\n");
-		}
-#endif
-
-		macosx_opengl_init();
-
-		if (!macosx_read_opengl) {
-			char *addr = macosxCG_get_fb_addr();
-			if (addr == NULL) {
-				macosx_log("macosxCG_init: could not get raw framebuffer address / CGDisplayBaseAddress().\n");
-				exit(1);
-			}
-			macosx_read_rawfb = 1;
-			macosx_log("macosxCG_init: using raw framebuffer address for screen capture.\n");
-		}
-
-		macosxCGP_init_dimming();
-		if (macosx_noscreensaver) {
-			macosxCGP_screensaver_timer_on();
-		}
-
-		macosxGCS_initpb();
-	}
-}
-
-void macosxCG_fini(void) {
-	macosxCGP_dim_shutdown();
-	if (macosx_noscreensaver) {
-		macosxCGP_screensaver_timer_off();
-	}
-	macosxCG_refresh_callback_off();
-	macosx_opengl_fini();
-	displayID = 0;
-}
-
-extern int dpy_x, dpy_y, bpp, wdpy_x, wdpy_y;
-extern int client_count, nofb;
-extern void do_new_fb(int);
-extern int macosx_wait_for_switch, macosx_resize;
-
-extern void macosxGCS_poll_pb(void);
-#if 0
-extern void usleep(unsigned long usec);
-#else
-extern int usleep(useconds_t usec);
-#endif
-extern unsigned int sleep(unsigned int seconds);
-extern void clean_up_exit(int ret);
-
-void macosxCG_event_loop(void) {
-	OSStatus rc;
-	int nbpp;
-	static int nbpp_save = -1;
-
-	macosxGCS_poll_pb();
-	if (nofb) {
-		return;
-	}
-
-	rc = RunCurrentEventLoop(kEventDurationSecond/30);
-
-	if (client_count) {
-		macosxCG_refresh_callback_on();
-	} else {
-		macosxCG_refresh_callback_off();
-	}
-
-	nbpp = macosxCG_CGDisplayBitsPerPixel();
-
-	if (nbpp_save < 0) {
-		nbpp_save = nbpp;
-	}
-		
-	if (nbpp > 0 && nbpp != nbpp_save) {
-		nbpp_save = nbpp;
-		if (macosx_resize) {
-			do_new_fb(1);
-		}
-	} else if (wdpy_x != macosxCG_CGDisplayPixelsWide()) {
-	    if (wdpy_y != macosxCG_CGDisplayPixelsHigh()) {
-		if (macosx_wait_for_switch) {
-			int cnt = 0;
-			while (1) {
-				if(macosxCG_CGDisplayPixelsWide() > 0) {
-					if(macosxCG_CGDisplayPixelsHigh() > 0) {
-						usleep(500*1000);
-						break;
-					}
-				}
-				if ((cnt++ % 120) == 0) {
-					macosx_log("waiting for user to "
-					    "switch back..\n");
-				}
-				sleep(1);
-			}
-			if (wdpy_x == macosxCG_CGDisplayPixelsWide()) {
-				if (wdpy_y == macosxCG_CGDisplayPixelsHigh()) {
-					macosx_log("we're back...\n");
-					return;
-				}
-			}
-		}
-		if (macosx_resize) {
-			do_new_fb(1);
-		}
-	    }
-	}
-	if (nbpp > 0) {
-		nbpp_save = nbpp;
-	}
-}
-
-extern int macosx_no_rawfb;
-extern int macosx_read_opengl;
-extern int macosx_opengl_get_width();
-extern int macosx_opengl_get_height();
-extern int macosx_opengl_get_bpp();
-extern int macosx_opengl_get_bps();
-extern int macosx_opengl_get_spp();
-
-#if X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER || X11VNC_MACOSX_NO_DEPRECATED
-
-char *macosxCG_get_fb_addr(void) {
-	return NULL;
-}
-int macosxCG_CGDisplayPixelsWide(void) {
-	return macosx_opengl_get_width();
-}
-int macosxCG_CGDisplayPixelsHigh(void) {
-	return macosx_opengl_get_height();
-}
-int macosxCG_CGDisplayBitsPerPixel(void) {
-	return macosx_opengl_get_bpp();
-}
-int macosxCG_CGDisplayBitsPerSample(void) {
-	return macosx_opengl_get_bps();
-}
-int macosxCG_CGDisplaySamplesPerPixel(void) {
-	return macosx_opengl_get_spp();
-}
-int macosxCG_CGDisplayBytesPerRow(void) {
-	return macosx_opengl_get_width() * macosx_opengl_get_bpp() / 8;
-}
-
-#else
-
-char *macosxCG_get_fb_addr(void) {
-	if (x11vnc_macosx_no_deprecated_framebuffer) {
-		macosx_log("CGDisplayBaseAddress disabled by env. var\n");
-		return NULL;
-	}
-	if (macosx_no_rawfb) {
-		macosx_log("CGDisplayBaseAddress disabled by user.\n");
-		return NULL;
-	}
-	if (macosx_read_opengl) {
-		macosx_log("CGDisplayBaseAddress disabled by OpenGL.\n");
-		return NULL;
-	}
-	return (char *) CGDisplayBaseAddress(displayID);
-}
-
-int macosxCG_CGDisplayPixelsWide(void) {
-	if ((0 && macosx_read_opengl) || x11vnc_macosx_no_deprecated_framebuffer) {
-		return macosx_opengl_get_width();
-	}
-	return (int) CGDisplayPixelsWide(displayID);
-}
-int macosxCG_CGDisplayPixelsHigh(void) {
-	if ((0 && macosx_read_opengl) || x11vnc_macosx_no_deprecated_framebuffer) {
-		return macosx_opengl_get_height();
-	}
-	return (int) CGDisplayPixelsHigh(displayID);
-}
-int macosxCG_CGDisplayBitsPerPixel(void) {
-	if ((0 && macosx_read_opengl) || x11vnc_macosx_no_deprecated_framebuffer) {
-		return macosx_opengl_get_bpp();
-	}
-	return (int) CGDisplayBitsPerPixel(displayID);
-}
-int macosxCG_CGDisplayBitsPerSample(void) {
-	if (macosx_read_opengl || x11vnc_macosx_no_deprecated_framebuffer) {
-		return macosx_opengl_get_bps();
-	}
-	return (int) CGDisplayBitsPerSample(displayID);
-}
-int macosxCG_CGDisplaySamplesPerPixel(void) {
-	if (macosx_read_opengl || x11vnc_macosx_no_deprecated_framebuffer) {
-		return macosx_opengl_get_spp();
-	}
-	return (int) CGDisplaySamplesPerPixel(displayID);
-}
-int macosxCG_CGDisplayBytesPerRow(void) {
-	if (macosx_read_opengl || x11vnc_macosx_no_deprecated_framebuffer) {
-		return macosx_opengl_get_width() * macosx_opengl_get_bpp()/8;
-	}
-	return (int) CGDisplayBytesPerRow(displayID);;
-}
-
-#endif
-
-typedef int CGSConnectionRef;
-static CGSConnectionRef conn = 0;
-extern CGError CGSNewConnection(void*, CGSConnectionRef*);
-extern CGError CGSReleaseConnection(CGSConnectionRef);
-extern CGError CGSGetGlobalCursorDataSize(CGSConnectionRef, int*);
-extern CGError CGSGetGlobalCursorData(CGSConnectionRef, unsigned char*,
-    int*, int*, CGRect*, CGPoint*, int*, int*, int*);
-extern CGError CGSGetCurrentCursorLocation(CGSConnectionRef, CGPoint*);
-extern int CGSCurrentCursorSeed(void);
-extern int CGSHardwareCursorActive(); 
-
-static unsigned int last_local_button_mask = 0;
-static unsigned int last_local_mod_mask = 0;
-static int last_local_x = 0;
-static int last_local_y = 0;
-
-extern unsigned int display_button_mask;
-extern unsigned int display_mod_mask;
-extern int got_local_pointer_input;
-extern time_t last_local_input;
-
-static CGPoint current_cursor_pos(void) {
-	CGPoint pos;
-	pos.x = 0;
-	pos.y = 0;
-	if (! conn) {
-		if (CGSNewConnection(NULL, &conn) != kCGErrorSuccess) {
-			macosx_log("CGSNewConnection error.\n");
-			if (!dpy_x || !dpy_y || !wdpy_x || !wdpy_y) {
-				clean_up_exit(1);
-			}
-		}
-	}
-	if (CGSGetCurrentCursorLocation(conn, &pos) != kCGErrorSuccess) {
-		macosx_log("CGSGetCurrentCursorLocation error\n");
-	}
-
-	display_button_mask = GetCurrentButtonState();
-#if 0
-/* not used yet */
-	display_mod_mask = GetCurrentKeyModifiers();
-#endif
-
-	if (last_local_button_mask != display_button_mask) {
-		got_local_pointer_input++;
-		last_local_input = time(NULL);
-	} else if (pos.x != last_local_x || pos.y != last_local_y) {
-		got_local_pointer_input++;
-		last_local_input = time(NULL);
-	}
-	last_local_button_mask = display_button_mask;
-	last_local_mod_mask = display_mod_mask;
-	last_local_x = pos.x;
-	last_local_y = pos.y;
-
-	return pos;
-}
-
-int macosxCG_get_cursor_pos(int *x, int *y) {
-	CGPoint pos = current_cursor_pos();
-	*x = pos.x;
-	*y = pos.y;
-	return 1;
-}
-
-extern int get_cursor_serial(int);
-extern int store_cursor(int serial, unsigned long *data, int w, int h, int cbpp, int xhot, int yhot);
-
-int macosxCG_get_cursor(void) {
-	int last_idx = (int) get_cursor_serial(1);
-	int which = 1;
-	CGError err;
-	int datasize, row_bytes, cdepth, comps, bpcomp;
-	CGRect rect;
-	CGPoint hot;
-	unsigned char *data;
-	int cursor_seed;
-	static int last_cursor_seed = -1;
-	static time_t last_fetch = 0;
-	time_t now = time(NULL);
-
-	if (last_idx) {
-		which = last_idx;
-	}
-
-	if (! conn) {
-		if (CGSNewConnection(NULL, &conn) != kCGErrorSuccess) {
-			macosx_log("CGSNewConnection error.\n");
-			if (!dpy_x || !dpy_y || !wdpy_x || !wdpy_y) {
-				clean_up_exit(1);
-			}
-			return which;
-		}
-	}
-
-	/* XXX all of these interfaces are undocumented. */
-
-	cursor_seed = CGSCurrentCursorSeed();
-	if (last_idx && cursor_seed == last_cursor_seed) {
-		if (now < last_fetch + 2) {
-			return which;
-		}
-	}
-	last_cursor_seed = cursor_seed;
-	last_fetch = now;
-
-	if (CGSGetGlobalCursorDataSize(conn, &datasize) != kCGErrorSuccess) {
-		macosx_log("CGSGetGlobalCursorDataSize error\n");
-		return which;
-	}
-
-	data = (unsigned char*) malloc(datasize);
-
-	err = CGSGetGlobalCursorData(conn, data, &datasize, &row_bytes,
-	    &rect, &hot, &cdepth, &comps, &bpcomp);
-#if 0
-	fprintf(stderr, "datasize: %d row_bytes: %d cdepth: %d comps: %d bpcomp: %d w: %d h: %d\n",
-	  datasize, row_bytes, cdepth, comps, bpcomp, (int) rect.size.width, (int) rect.size.height);
-#endif
-	if (err != kCGErrorSuccess) {
-		macosx_log("CGSGetGlobalCursorData error\n");
-		return which;
-	}
-
-	if (cdepth == 24) {
-		cdepth = 32;
-	}
-
-	if (sizeof(long) == 8 && comps * bpcomp <= 32) {
-		/* pad it out to unsigned long array size (like xfixes) */
-		int i;
-		unsigned char *dsave;
-		unsigned char *data64 = (unsigned char*) malloc(2 *datasize);
-		unsigned int  *uI = (unsigned int  *) data;
-		unsigned long *uL = (unsigned long *) data64;
-		for (i=0; i < datasize/4; i++) {
-			uL[i] = uI[i];
-		}
-		dsave = data;
-		data = data64;
-		free(dsave);
-	}
-
-	which = store_cursor(cursor_seed, (unsigned long*) data,
-	    (int) rect.size.width, (int) rect.size.height, cdepth, (int) hot.x, (int) hot.y);
-
-	free(data);
-	return(which);
-}
-
-extern int macosx_mouse_wheel_speed;
-extern int macosx_swap23;
-extern int off_x, coff_x, off_y, coff_y;
-
-extern int debug_pointer;
-
-static void CGPostScrollWheelEvent_wr(CGWheelCount wheel_count, int wheel_distance) {
-	static int post_mode = -1, mcnt = 0;
-
-#if !X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS && !X11VNC_MACOSX_NO_DEPRECATED
-	if (post_mode < 0) {
-		post_mode = 1;
-		if (getenv("X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS") || getenv("X11VNC_MACOSX_NO_DEPRECATED")) {
-			post_mode = 0;
-		}
-	}
-	
-	if (post_mode) {
-		if (mcnt++ < 10 || debug_pointer) fprintf(stderr, "CGPostScrollWheelEvent()\n");
-		CGPostScrollWheelEvent(wheel_count, wheel_distance);
-	} else
-#endif
-	{
-		/* XXX 10.5 and later */
-#ifndef X11VNC_MACOSX_NO_CGEVENTCREATESCROLLWHEELEVENT
-		CGEventRef event;
-		event = CGEventCreateScrollWheelEvent(NULL, kCGScrollEventUnitLine, wheel_count, wheel_distance);
-		if (event != NULL) {
-			CGEventPost(kCGHIDEventTap, event);
-			CFRelease(event);
-		}
-#endif
-		if (mcnt++ < 10 || debug_pointer) fprintf(stderr, "CGEventCreateScrollWheelEvent()\n");
-	}
-}
-
-static void CGPostMouseEvent_wr(CGPoint loc, int update, int count, int d1, int d2, int d3, int p1, int p2, int p3) {
-	static int post_mode = -1, mcnt = 0;
-
-#if !X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS && !X11VNC_MACOSX_NO_DEPRECATED
-	if (post_mode < 0) {
-		post_mode = 1;
-		if (getenv("X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS") || getenv("X11VNC_MACOSX_NO_DEPRECATED")) {
-			post_mode = 0;
-		}
-	}
-	
-	if (post_mode) {
-		if (mcnt++ < 10 || debug_pointer) fprintf(stderr, "CGPostMouseEvent()\n");
-		CGPostMouseEvent(loc, update, count, d1, d2, d3);
-	} else
-#endif
-	{
-		/* XXX 10.4 and later */
-#ifndef X11VNC_MACOSX_NO_CGEVENTCREATEMOUSEEVENT
-		CGEventRef event;
-		static int xp = -1, yp;
-
-		if (xp == -1) {
-			xp = loc.x;
-			yp = loc.y;
-		}
-		if (xp != loc.x || yp != loc.y) {
-			int moved = 0;
-			if (p1 && p1 == d1) {
-				event = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDragged, loc, 0);
-				if (event != NULL) {
-					moved = 1;
-					CGEventPost(kCGHIDEventTap, event);
-					CFRelease(event);
-				}
-			}
-			if (p3 && p3 == d3) {
-				event = CGEventCreateMouseEvent(NULL, kCGEventOtherMouseDragged, loc, 0);
-				if (event != NULL) {
-					moved = 1;
-					CGEventPost(kCGHIDEventTap, event);
-					CFRelease(event);
-				}
-			}
-			if (p2 && p2 == d2) {
-				event = CGEventCreateMouseEvent(NULL, kCGEventRightMouseDragged, loc, 0);
-				if (event != NULL) {
-					moved = 1;
-					CGEventPost(kCGHIDEventTap, event);
-					CFRelease(event);
-				}
-			}
-			if (!moved) {
-				event = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, loc, 0);
-				if (event != NULL) {
-					CGEventPost(kCGHIDEventTap, event);
-					CFRelease(event);
-				}
-			}
-		}
-		xp = loc.x;
-		yp = loc.y;
-		if (p1 != d1) {
-			CGEventType type = (!p1 && d1) ? kCGEventLeftMouseDown : kCGEventLeftMouseUp;
-			event = CGEventCreateMouseEvent(NULL, type, loc, 0);
-			if (event != NULL) {
-				CGEventPost(kCGHIDEventTap, event);
-				CFRelease(event);
-			}
-		}
-		if (p3 != d3) {
-			CGEventType type = (!p3 && d3) ? kCGEventOtherMouseDown : kCGEventOtherMouseUp;
-			event = CGEventCreateMouseEvent(NULL, type, loc, kCGMouseButtonCenter);
-			if (event != NULL) {
-				CGEventPost(kCGHIDEventTap, event);
-				CFRelease(event);
-			}
-		}
-		if (p2 != d2) {
-			CGEventType type = (!p2 && d2) ? kCGEventRightMouseDown : kCGEventRightMouseUp;
-			event = CGEventCreateMouseEvent(NULL, type, loc, 0);
-			if (event != NULL) {
-				CGEventPost(kCGHIDEventTap, event);
-				CFRelease(event);
-			}
-		}
-#endif
-		if (mcnt++ < 10 || debug_pointer) fprintf(stderr, "CGEventCreateMouseEvent()\n");
-	}
-}
-
-void macosxCG_pointer_inject(int mask, int x, int y) {
-	int swap23 = macosx_swap23;
-	int s1 = 0, s2 = 1, s3 = 2, s4 = 3, s5 = 4;
-	CGPoint loc;
-	int wheel_distance = macosx_mouse_wheel_speed;
-	static int cnt = 0;
-	static int first = 1, prev1 = 0, prev2 = 0, prev3 = 0; 
-	int curr1, curr2, curr3;
-
-	if (swap23) {
-		s2 = 2;
-		s3 = 1;
-	}
-
-	loc.x = x + off_x + coff_x;
-	loc.y = y + off_y + coff_y;
-
-	if ((cnt++ % 10) == 0) {
-		macosxCGP_undim();
-	}
-
-	if ((mask & (1 << s4))) {
-		CGPostScrollWheelEvent_wr(1,  wheel_distance);
-	}
-	if ((mask & (1 << s5))) {
-		CGPostScrollWheelEvent_wr(1, -wheel_distance);
-	}
-
-	curr1 = (mask & (1 << s1)) ? TRUE : FALSE;
-	curr2 = (mask & (1 << s2)) ? TRUE : FALSE;
-	curr3 = (mask & (1 << s3)) ? TRUE : FALSE;
-
-	if (first) {
-		prev1 = curr1;
-		prev2 = curr2;
-		prev3 = curr3;
-		first = 0;
-	}
-
-	CGPostMouseEvent_wr(loc, TRUE, 3, curr1, curr2, curr3, prev1, prev2, prev3);
-
-	prev1 = curr1;
-	prev2 = curr2;
-	prev3 = curr3;
-}
-
-#define keyTableSize 0xFFFF
-
-#include <rfb/keysym.h>
-
-static int USKeyCodes[] = {
-    /* The alphabet */
-    XK_A,                  0,      /* A */
-    XK_B,                 11,      /* B */
-    XK_C,                  8,      /* C */
-    XK_D,                  2,      /* D */
-    XK_E,                 14,      /* E */
-    XK_F,                  3,      /* F */
-    XK_G,                  5,      /* G */
-    XK_H,                  4,      /* H */
-    XK_I,                 34,      /* I */
-    XK_J,                 38,      /* J */
-    XK_K,                 40,      /* K */
-    XK_L,                 37,      /* L */
-    XK_M,                 46,      /* M */
-    XK_N,                 45,      /* N */
-    XK_O,                 31,      /* O */
-    XK_P,                 35,      /* P */
-    XK_Q,                 12,      /* Q */
-    XK_R,                 15,      /* R */
-    XK_S,                  1,      /* S */
-    XK_T,                 17,      /* T */
-    XK_U,                 32,      /* U */
-    XK_V,                  9,      /* V */
-    XK_W,                 13,      /* W */
-    XK_X,                  7,      /* X */
-    XK_Y,                 16,      /* Y */
-    XK_Z,                  6,      /* Z */
-    XK_a,                  0,      /* a */
-    XK_b,                 11,      /* b */
-    XK_c,                  8,      /* c */
-    XK_d,                  2,      /* d */
-    XK_e,                 14,      /* e */
-    XK_f,                  3,      /* f */
-    XK_g,                  5,      /* g */
-    XK_h,                  4,      /* h */
-    XK_i,                 34,      /* i */
-    XK_j,                 38,      /* j */
-    XK_k,                 40,      /* k */
-    XK_l,                 37,      /* l */
-    XK_m,                 46,      /* m */
-    XK_n,                 45,      /* n */
-    XK_o,                 31,      /* o */
-    XK_p,                 35,      /* p */
-    XK_q,                 12,      /* q */
-    XK_r,                 15,      /* r */
-    XK_s,                  1,      /* s */
-    XK_t,                 17,      /* t */
-    XK_u,                 32,      /* u */
-    XK_v,                  9,      /* v */
-    XK_w,                 13,      /* w */
-    XK_x,                  7,      /* x */
-    XK_y,                 16,      /* y */
-    XK_z,                  6,      /* z */
-
-    /* Numbers */
-    XK_0,                 29,      /* 0 */
-    XK_1,                 18,      /* 1 */
-    XK_2,                 19,      /* 2 */
-    XK_3,                 20,      /* 3 */
-    XK_4,                 21,      /* 4 */
-    XK_5,                 23,      /* 5 */
-    XK_6,                 22,      /* 6 */
-    XK_7,                 26,      /* 7 */
-    XK_8,                 28,      /* 8 */
-    XK_9,                 25,      /* 9 */
-
-    /* Symbols */
-    XK_exclam,            18,      /* ! */
-    XK_at,                19,      /* @ */
-    XK_numbersign,        20,      /* # */
-    XK_dollar,            21,      /* $ */
-    XK_percent,           23,      /* % */
-    XK_asciicircum,       22,      /* ^ */
-    XK_ampersand,         26,      /* & */
-    XK_asterisk,          28,      /* * */
-    XK_parenleft,         25,      /* ( */
-    XK_parenright,        29,      /* ) */
-    XK_minus,             27,      /* - */
-    XK_underscore,        27,      /* _ */
-    XK_equal,             24,      /* = */
-    XK_plus,              24,      /* + */
-    XK_grave,             50,      /* ` */  /* XXX ? */
-    XK_asciitilde,        50,      /* ~ */
-    XK_bracketleft,       33,      /* [ */
-    XK_braceleft,         33,      /* { */
-    XK_bracketright,      30,      /* ] */
-    XK_braceright,        30,      /* } */
-    XK_semicolon,         41,      /* ; */
-    XK_colon,             41,      /* : */
-    XK_apostrophe,        39,      /* ' */
-    XK_quotedbl,          39,      /* " */
-    XK_comma,             43,      /* , */
-    XK_less,              43,      /* < */
-    XK_period,            47,      /* . */
-    XK_greater,           47,      /* > */
-    XK_slash,             44,      /* / */
-    XK_question,          44,      /* ? */
-    XK_backslash,         42,      /* \ */
-    XK_bar,               42,      /* | */
-    /* OS X Sends this (END OF MEDIUM) for Shift-Tab (with US Keyboard) */
-    0x0019,               48,      /* Tab */
-    XK_space,             49,      /* Space */
-};
-
-static int SpecialKeyCodes[] = {
-    /* "Special" keys */
-    XK_Return,            36,      /* Return */
-    XK_Delete,           117,      /* Delete */
-    XK_Tab,               48,      /* Tab */
-    XK_Escape,            53,      /* Esc */
-    XK_Caps_Lock,         57,      /* Caps Lock */
-    XK_Num_Lock,          71,      /* Num Lock */
-    XK_Scroll_Lock,      107,      /* Scroll Lock */
-    XK_Pause,            113,      /* Pause */
-    XK_BackSpace,         51,      /* Backspace */
-    XK_Insert,           114,      /* Insert */
-
-    /* Cursor movement */
-    XK_Up,               126,      /* Cursor Up */
-    XK_Down,             125,      /* Cursor Down */
-    XK_Left,             123,      /* Cursor Left */
-    XK_Right,            124,      /* Cursor Right */
-    XK_Page_Up,          116,      /* Page Up */
-    XK_Page_Down,        121,      /* Page Down */
-    XK_Home,             115,      /* Home */
-    XK_End,              119,      /* End */
-
-    /* Numeric keypad */
-    XK_KP_0,              82,      /* KP 0 */
-    XK_KP_1,              83,      /* KP 1 */
-    XK_KP_2,              84,      /* KP 2 */
-    XK_KP_3,              85,      /* KP 3 */
-    XK_KP_4,              86,      /* KP 4 */
-    XK_KP_5,              87,      /* KP 5 */
-    XK_KP_6,              88,      /* KP 6 */
-    XK_KP_7,              89,      /* KP 7 */
-    XK_KP_8,              91,      /* KP 8 */
-    XK_KP_9,              92,      /* KP 9 */
-    XK_KP_Enter,          76,      /* KP Enter */
-    XK_KP_Decimal,        65,      /* KP . */
-    XK_KP_Add,            69,      /* KP + */
-    XK_KP_Subtract,       78,      /* KP - */
-    XK_KP_Multiply,       67,      /* KP * */
-    XK_KP_Divide,         75,      /* KP / */
-
-    /* Function keys */
-    XK_F1,               122,      /* F1 */
-    XK_F2,               120,      /* F2 */
-    XK_F3,                99,      /* F3 */
-    XK_F4,               118,      /* F4 */
-    XK_F5,                96,      /* F5 */
-    XK_F6,                97,      /* F6 */
-    XK_F7,                98,      /* F7 */
-    XK_F8,               100,      /* F8 */
-    XK_F9,               101,      /* F9 */
-    XK_F10,              109,      /* F10 */
-    XK_F11,              103,      /* F11 */
-    XK_F12,              111,      /* F12 */
-
-    /* Modifier keys */
-    XK_Alt_L,             55,      /* Alt Left (-> Command) */
-    XK_Alt_R,             55,      /* Alt Right (-> Command) */
-    XK_Shift_L,           56,      /* Shift Left */
-    XK_Shift_R,           56,      /* Shift Right */
-    XK_Meta_L,            58,      /* Option Left (-> Option) */
-    XK_Meta_R,            58,      /* Option Right (-> Option) */
-    XK_Super_L,           58,      /* Option Left (-> Option) */
-    XK_Super_R,           58,      /* Option Right (-> Option) */
-    XK_Control_L,         59,      /* Ctrl Left */
-    XK_Control_R,         59,      /* Ctrl Right */
-};
-
-CGKeyCode keyTable[keyTableSize];
-unsigned char keyTableMods[keyTableSize];
-
-void macosxCG_init_key_table(void) {
-	static int init = 0;
-	int i;
-	if (init) {
-		return;
-	}
-	init = 1;
-
-	for (i=0; i < keyTableSize; i++) {
-		keyTable[i] = 0xFFFF;
-		keyTableMods[i] = 0;
-	}
-	for (i=0; i< (int) (sizeof(USKeyCodes) / sizeof(int)); i += 2) {
-		int j = USKeyCodes[i];
-		keyTable[(unsigned short) j] = (CGKeyCode) USKeyCodes[i+1];
-	}
-	for (i=0; i< (int) (sizeof(SpecialKeyCodes) / sizeof(int)); i += 2) {
-		int j = SpecialKeyCodes[i];
-		keyTable[(unsigned short) j] = (CGKeyCode) SpecialKeyCodes[i+1];
-	}
-}
-
-extern void init_key_table(void);
-extern int macosx_us_kbd;
-
-extern int debug_keyboard;
-
-void CGPostKeyboardEvent_wr(CGCharCode keyChar, CGKeyCode keyCode, int down) {
-	static int post_mode = -1, mcnt = 0;
-
-#if !X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS && !X11VNC_MACOSX_NO_DEPRECATED
-	if (post_mode < 0) {
-		post_mode = 1;
-		if (getenv("X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS") || getenv("X11VNC_MACOSX_NO_DEPRECATED")) {
-			post_mode = 0;
-		}
-	}
-	
-	if (post_mode) {
-		if (mcnt++ < 10 || debug_keyboard) fprintf(stderr, "CGPostKeyboardEvent(keyChar=%d, keyCode=%d, down=%d)\n", keyChar, keyCode, down);
-		CGPostKeyboardEvent(keyChar, keyCode, down);
-	} else
-#endif
-	{
-		/* XXX 10.4 and later */
-#ifndef X11VNC_MACOSX_NO_CGEVENTCREATEKEYBOARDEVENT
-		CGEventRef event;
-		event = CGEventCreateKeyboardEvent(NULL, keyCode, down);
-		if (event != NULL) {
-			CGEventPost(kCGHIDEventTap, event);
-			CFRelease(event);
-		}
-#endif
-		if (mcnt++ < 10 || debug_keyboard) fprintf(stderr, "CGEventCreateKeyboardEvent(NULL, keyCode=%d, down=%d)\n", keyCode, down);
-	}
-}
-
-void macosxCG_keycode_inject(int down, int keycode) {
-	CGKeyCode keyCode = (CGKeyCode) keycode;
-	CGCharCode keyChar = 0;
-
-	if (debug_keyboard) fprintf(stderr, "macosxCG_keycode_inject(down=%d, keycode=%d)\n", down, keycode);
-
-	CGPostKeyboardEvent_wr(keyChar, keyCode, down);
-}
-
-void macosxCG_keysym_inject(int down, unsigned int keysym) {
-	CGKeyCode keyCode = keyTable[(unsigned short)keysym];
-	CGCharCode keyChar = 0;
-#if 0
-	int pressModsForKeys = FALSE;
-	UInt32 modsForKey = keyTableMods[keysym] << 8;
-#endif
-
-	init_key_table();
-
-	if (debug_keyboard) fprintf(stderr, "macosxCG_keysym_inject(down=%d, keysym=%d)\n", down, (int) keysym);
-
-	if (keysym < 0xFF && macosx_us_kbd) {
-		keyChar = (CGCharCode) keysym;
-		if (debug_keyboard) fprintf(stderr, "macosxCG_keysym_inject keyChar=>%d\n", (int) keyChar);
-	}
-	if (keyCode == 0xFFFF) {
-		return;
-	}
-	macosxCGP_undim();
-
-	CGPostKeyboardEvent_wr(keyChar, keyCode, down);
-}
-
-#endif	/* __APPLE__ */
-
-
diff --git a/ica/x11/x11vnc/macosxCG.h b/ica/x11/x11vnc/macosxCG.h
deleted file mode 100644
index fb9e497..0000000
--- a/ica/x11/x11vnc/macosxCG.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_MACOSXCG_H
-#define _X11VNC_MACOSXCG_H
-
-/* -- macosxCG.h -- */
-
-extern void macosxCG_init(void);
-extern void macosxCG_fini(void);
-extern void macosxCG_event_loop(void);
-extern char *macosxCG_get_fb_addr(void);
-
-extern int macosxCG_CGDisplayPixelsWide(void);
-extern int macosxCG_CGDisplayPixelsHigh(void);
-extern int macosxCG_CGDisplayBitsPerPixel(void);
-extern int macosxCG_CGDisplayBitsPerSample(void);
-extern int macosxCG_CGDisplaySamplesPerPixel(void);
-extern int macosxCG_CGDisplayBytesPerRow(void);
-
-extern void macosxCG_pointer_inject(int mask, int x, int y);
-extern int macosxCG_get_cursor_pos(int *x, int *y);
-extern int macosxCG_get_cursor(void);
-extern void macosxCG_init_key_table(void);
-extern void macosxCG_keysym_inject(int down, unsigned int keysym);
-extern void macosxCG_keycode_inject(int down, int keycode);
-
-extern void macosxCG_refresh_callback_off(void);
-extern void macosxCG_refresh_callback_on(void);
-
-
-
-#endif /* _X11VNC_MACOSXCG_H */
diff --git a/ica/x11/x11vnc/macosxCGP.c b/ica/x11/x11vnc/macosxCGP.c
deleted file mode 100644
index 230042c..0000000
--- a/ica/x11/x11vnc/macosxCGP.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- macosxCGP.c -- */
-
-void macosxCGP_unused(void) {}
-
-#if (defined(__MACH__) && defined(__APPLE__))
-
-#include <ApplicationServices/ApplicationServices.h>
-#include <Cocoa/Cocoa.h>
-#include <Carbon/Carbon.h>
-
-int macosxCGP_save_dim(void);
-int macosxCGP_restore_dim(void);
-int macosxCGP_save_sleep(void);
-int macosxCGP_restore_sleep(void);
-int macosxCGP_init_dimming(void);
-int macosxCGP_undim(void);
-int macosxCGP_dim_shutdown(void);
-void macosxCGP_screensaver_timer_off(void);
-void macosxCGP_screensaver_timer_on(void);
-
-#include <IOKit/pwr_mgt/IOPMLib.h>
-#include <IOKit/pwr_mgt/IOPM.h>
-
-extern CGDirectDisplayID displayID;
-
-static unsigned long dim_time;
-static unsigned long sleep_time;
-static int dim_time_saved = 0;
-static int sleep_time_saved = 0;
-static int initialized = 0;
-static mach_port_t master_dev_port;
-static io_connect_t power_mgt;
-
-extern int client_count;
-extern int macosx_nodimming;
-extern int macosx_nosleep;
-extern int macosx_noscreensaver;
-
-static EventLoopTimerUPP  sstimerUPP;
-static EventLoopTimerRef  sstimer;
-
-void macosxCG_screensaver_timer(EventLoopTimerRef timer, void *data) {
-	if (0) fprintf(stderr, "macosxCG_screensaver_timer: %d\n", (int) time(0));
-	if (!timer || !data) {}
-	if (macosx_nosleep && client_count) {
-		if (0) fprintf(stderr, "UpdateSystemActivity: %d\n", (int) time(0));
-		UpdateSystemActivity(IdleActivity);
-	}
-}
-
-void macosxCGP_screensaver_timer_off(void) {
-	if (0) fprintf(stderr, "macosxCGP_screensaver_timer_off: %d\n", (int) time(0));
-	RemoveEventLoopTimer(sstimer);
-	DisposeEventLoopTimerUPP(sstimerUPP);
-}
-
-void macosxCGP_screensaver_timer_on(void) {
-	if (0) fprintf(stderr, "macosxCGP_screensaver_timer_on: %d\n", (int) time(0));
-	sstimerUPP = NewEventLoopTimerUPP(macosxCG_screensaver_timer);
-	InstallEventLoopTimer(GetMainEventLoop(), kEventDurationSecond * 30,
-	    kEventDurationSecond * 30, sstimerUPP, NULL, &sstimer);
-}
-
-int macosxCGP_save_dim(void) {
-	if (IOPMGetAggressiveness(power_mgt, kPMMinutesToDim,
-	    &dim_time) != kIOReturnSuccess) {
-		return 0;
-	}
-	dim_time_saved = 1;
-	return 1;
-}
-
-int macosxCGP_restore_dim(void) {
-	if (! dim_time_saved) {
-		return 0;
-	}
-	if (IOPMSetAggressiveness(power_mgt, kPMMinutesToDim,
-	    dim_time) != kIOReturnSuccess) {
-		return 0;
-	}
-	dim_time_saved = 0;
-	dim_time = 0;
-	return 1;
-}
-
-int macosxCGP_save_sleep(void) {
-	if (IOPMGetAggressiveness(power_mgt, kPMMinutesToSleep,
-	    &sleep_time) != kIOReturnSuccess) {
-		return 0;
-	}
-	sleep_time_saved = 1;
-	return 1;
-}
-
-int macosxCGP_restore_sleep(void) {
-	if (! sleep_time_saved) {
-		return 0;
-	}
-	if (IOPMSetAggressiveness(power_mgt, kPMMinutesToSleep,
-	    dim_time) != kIOReturnSuccess) {
-		return 0;
-	}
-	sleep_time_saved = 0;
-	sleep_time = 0;
-	return 1;
-}
-
-int macosxCGP_init_dimming(void) {
-	if (IOMasterPort(bootstrap_port, &master_dev_port) != 
-	    kIOReturnSuccess) {
-		return 0;
-	}
-	if (!(power_mgt = IOPMFindPowerManagement(master_dev_port))) {
-		return 0;
-	}
-	if (macosx_nodimming) {
-		if (! macosxCGP_save_dim()) {
-			return 0;
-		}
-		if (IOPMSetAggressiveness(power_mgt, kPMMinutesToDim, 0)
-		    != kIOReturnSuccess) {
-			return 0;
-		}
-	}
-	if (macosx_nosleep) {
-		if (! macosxCGP_save_sleep()) {
-			return 0;
-		}
-		if (IOPMSetAggressiveness(power_mgt, kPMMinutesToSleep, 0)
-		    != kIOReturnSuccess) {
-			return 0;
-		}
-	}
-
-	initialized = 1;
-	return 1;
-}
-
-int macosxCGP_undim(void) {
-	if (! initialized) {
-		return 0;
-	}
-	if (! macosx_nodimming) {
-		if (! macosxCGP_save_dim()) {
-			return 0;
-		}
-		if (IOPMSetAggressiveness(power_mgt, kPMMinutesToDim, 0)
-		    != kIOReturnSuccess) {
-			return 0;
-		}
-		if (! macosxCGP_restore_dim()) {
-			return 0;
-		}
-	}
-	if (! macosx_nosleep) {
-		if (! macosxCGP_save_sleep()) {
-			return 0;
-		}
-		if (IOPMSetAggressiveness(power_mgt, kPMMinutesToSleep, 0)
-		    != kIOReturnSuccess) {
-			return 0;
-		}
-		if (! macosxCGP_restore_sleep()) {
-			return 0;
-		}
-	}
-	return 1;
-}
-
-int macosxCGP_dim_shutdown(void) {
-	if (! initialized) {
-		return 0;
-	}
-	if (dim_time_saved) {
-		if (! macosxCGP_restore_dim()) {
-			return 0;
-		}
-	}
-	if (sleep_time_saved) {
-		if (! macosxCGP_restore_sleep()) {
-			return 0;
-		}
-	}
-	return 1;
-}
-
-#endif	/* __APPLE__ */
-
-
diff --git a/ica/x11/x11vnc/macosxCGP.h b/ica/x11/x11vnc/macosxCGP.h
deleted file mode 100644
index 47026b0..0000000
--- a/ica/x11/x11vnc/macosxCGP.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_MACOSXCGP_H
-#define _X11VNC_MACOSXCGP_H
-
-/* -- macosxCGP.h -- */
-
-extern int macosxCGP_save_dim(void);
-extern int macosxCGP_restore_dim(void);
-extern int macosxCGP_save_sleep(void);
-extern int macosxCGP_restore_sleep(void);
-extern int macosxCGP_init_dimming(void);
-extern int macosxCGP_undim(void);
-extern int macosxCGP_dim_shutdown(void);
-extern void macosxCGP_screensaver_timer_off(void);
-extern void macosxCGP_screensaver_timer_on(void);
-
-
-#endif /* _X11VNC_MACOSXCGP_H */
diff --git a/ica/x11/x11vnc/macosxCGS.c b/ica/x11/x11vnc/macosxCGS.c
deleted file mode 100644
index 7680130..0000000
--- a/ica/x11/x11vnc/macosxCGS.c
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- macosxCGS.c -- */
-
-/*
- * We need to keep this separate from nearly everything else, e.g. rfb.h
- * and the other stuff, otherwise it does not work properly, mouse drags
- * will not work!!
- */
-void macosxCGS_unused(void) {}
-
-#if (defined(__MACH__) && defined(__APPLE__))
-
-#include <ApplicationServices/ApplicationServices.h>
-#include <Cocoa/Cocoa.h>
-#include <Carbon/Carbon.h>
-
-extern CGDirectDisplayID displayID;
-
-void macosxCGS_get_all_windows(void);
-int macosxCGS_get_qlook(int);
-void macosxGCS_set_pasteboard(char *str, int len);
-
-typedef CGError       CGSError;
-typedef long          CGSWindowCount;
-typedef void *        CGSConnectionID;
-typedef int           CGSWindowID;
-typedef CGSWindowID*  CGSWindowIDList;
-typedef CGWindowLevel CGSWindowLevel;
-typedef NSRect        CGSRect;
-
-extern CGSConnectionID _CGSDefaultConnection ();
-
-extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid,
-    CGSConnectionID owner, CGSWindowCount listCapacity,
-    CGSWindowIDList list, CGSWindowCount *listCount);
-
-extern CGSError CGSGetWindowList (CGSConnectionID cid,
-    CGSConnectionID owner, CGSWindowCount listCapacity,
-    CGSWindowIDList list, CGSWindowCount *listCount);
-
-extern CGSError CGSGetScreenRectForWindow (CGSConnectionID cid,
-    CGSWindowID wid, CGSRect *rect);
-
-extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid,
-    CGSWindowID wid, CGSWindowLevel *level);
-
-typedef enum _CGSWindowOrderingMode {
-    kCGSOrderAbove                =  1, /* Window is ordered above target. */
-    kCGSOrderBelow                = -1, /* Window is ordered below target. */
-    kCGSOrderOut                  =  0  /* Window is removed from the on-screen window list. */
-} CGSWindowOrderingMode;
-
-extern OSStatus CGSOrderWindow(const CGSConnectionID cid,
-    const CGSWindowID wid, CGSWindowOrderingMode place, CGSWindowID relativeToWindowID);
-
-static CGSConnectionID cid = NULL;
-
-extern void macosx_log(char *);
-
-int macwinmax = 0; 
-typedef struct windat {
-	int win;
-	int x, y;
-	int width, height;
-	int level;
-	int mapped;
-	int clipped;
-	int ncache_only;
-} windat_t;
-
-extern int ncache;
-
-#define MAXWINDAT 4096
-windat_t macwins[MAXWINDAT]; 
-static CGSWindowID _wins_all[MAXWINDAT]; 
-static CGSWindowID _wins_mapped[MAXWINDAT]; 
-static CGSWindowCount _wins_all_cnt, _wins_mapped_cnt; 
-static int _wins_int[MAXWINDAT]; 
-
-#define WINHISTNUM 32768
-#define WINHISTMAX 4
-char whist[WINHISTMAX][WINHISTNUM];
-int whist_idx = -1;
-int qlook[WINHISTNUM];
-
-char is_exist     = 0x1;
-char is_mapped    = 0x2;
-char is_clipped   = 0x4;
-char is_offscreen = 0x8;
-
-extern double dnow(void);
-extern double dnowx(void);
-
-extern int dpy_x, dpy_y;
-extern int macosx_icon_anim_time;
-
-extern void macosx_add_mapnotify(int, int, int);
-extern void macosx_add_create(int, int);
-extern void macosx_add_destroy(int, int);
-extern void macosx_add_visnotify(int, int, int);
-
-int CGS_levelmax;
-int CGS_levels[16];
-
-int macosxCGS_get_qlook(int w) {
-	if (w >= WINHISTNUM) {
-		return -1;
-	}
-	return qlook[w];
-}
-
-int macosxCGS_find_index(int w) {
-	static int last_index = -1;
-	int idx;
-
-	if (last_index >= 0) {
-		if (macwins[last_index].win == w) {
-			return last_index;
-		}
-	}
-
-	idx = macosxCGS_get_qlook(w);
-	if (idx >= 0) {
-		if (macwins[idx].win == w) {
-			last_index = idx;
-			return idx;
-		}
-	}
-
-	for (idx=0; idx < macwinmax; idx++) {
-		if (macwins[idx].win == w) {
-			last_index = idx;
-			return idx;
-		}
-	}
-	return -1;
-}
-
-#if 0
-extern void usleep(unsigned long usec);
-#else
-extern int usleep(useconds_t usec);
-#endif
-
-int macosxCGS_follow_animation_win(int win, int idx, int grow) {
-	double t = dnow();
-	int diffs = 0;
-	int x, y, w, h;
-	int xp = -1, yp = -1, wp = -1, hp = -1;
-	CGSRect rect;
-	CGSError err; 
-
-	int reps = 0;
-
-	if (cid == NULL) {
-		cid = _CGSDefaultConnection();
-		if (cid == NULL) {
-			return 0;
-		}
-	}
-
-	if (idx < 0) {
-		idx = macosxCGS_find_index(win); 
-	}
-	if (idx < 0) {
-		return 0;
-	}
-
-	while (dnow() < t + 0.001 * macosx_icon_anim_time)  {
-		err = CGSGetScreenRectForWindow(cid, win, &rect);
-		if (err != 0) {
-			break;
-		}
-		x = (int) rect.origin.x;
-		y = (int) rect.origin.y;
-		w = (int) rect.size.width;
-		h = (int) rect.size.height;
-
-		if (grow) {
-			macwins[idx].x      = x;
-			macwins[idx].y      = y;
-			macwins[idx].width  = w;
-			macwins[idx].height = h;
-		}
-	
-		if (0) fprintf(stderr, " chase: %03dx%03d+%03d+%03d  %d\n", w, h, x, y, win);
-		if (x == xp && y == yp && w == wp && h == hp)  {
-			reps++;
-			if (reps >= 2) {
-				break;
-			}
-		} else {
-			diffs++;
-			reps = 0;
-		}
-		xp = x;
-		yp = y;
-		wp = w;
-		hp = h;
-		usleep(50 * 1000);
-	}
-	if (diffs >= 2) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-extern int macosx_check_clipped(int win, int *list, int n);
-extern int macosx_check_offscreen(int win);
-
-static int check_clipped(int win) {
-	int i, n = 0, win2;
-	for (i = 0; i < (int) _wins_mapped_cnt; i++) {
-		win2 = (int) _wins_mapped[i];
-		if (win2 == win) {
-			break;
-		}
-		_wins_int[n++] = win2;
-	}
-	return macosx_check_clipped(win, _wins_int, n);
-}
-
-static int check_offscreen(int win) {
-	return macosx_check_offscreen(win);
-}
-
-extern int macosx_ncache_macmenu;
-
-
-void macosxCGS_get_all_windows(void) {
-	static double last = 0.0;
-	static int totcnt = 0;
-	double dt = 0.0, now = dnow();
-	int i, db = 0, whist_prv = 0, maxwin = 0, whist_skip = 0;
-	CGSWindowCount cap = (CGSWindowCount) MAXWINDAT;
-	CGSError err; 
-
-	CGS_levelmax = 0;
-	CGS_levels[CGS_levelmax++] = (int) kCGDraggingWindowLevel;	/* 500 ? */
-	if (0) CGS_levels[CGS_levelmax++] = (int) kCGHelpWindowLevel;		/* 102 ? */
-	if (macosx_ncache_macmenu) CGS_levels[CGS_levelmax++] = (int) kCGPopUpMenuWindowLevel;	/* 101 pulldown menu */
-	CGS_levels[CGS_levelmax++] = (int) kCGMainMenuWindowLevelKey;	/*  24 ? */
-	CGS_levels[CGS_levelmax++] = (int) kCGModalPanelWindowLevel;	/*   8 open dialog box */
-	CGS_levels[CGS_levelmax++] = (int) kCGFloatingWindowLevel;	/*   3 ? */
-	CGS_levels[CGS_levelmax++] = (int) kCGNormalWindowLevel;	/*   0 regular window */
-
-	if (cid == NULL) {
-		cid = _CGSDefaultConnection();
-		if (cid == NULL) {
-			return;
-		}
-	}
-
-	if (dt > 0.0 && now < last + dt) {
-		return;
-	}
-
-	last = now;
-
-	macwinmax = 0; 
-
-	totcnt++;
-
-	if (ncache > 0) {
-		whist_prv = whist_idx++;
-		if (whist_prv < 0) {
-			whist_skip = 1;
-			whist_prv = 0;
-		}
-		whist_idx = whist_idx % WINHISTMAX;
-		for (i=0; i < WINHISTNUM; i++) {
-			whist[whist_idx][i] = 0;
-			qlook[i] = -1;
-		}
-	}
-
-	err = CGSGetWindowList(cid, NULL, cap, _wins_all, &_wins_all_cnt);
-
-if (db) fprintf(stderr, "cnt: %d err: %d\n", (int) _wins_all_cnt, err);
-
-	if (err != 0) {
-		return;
-	}
-	
-	for (i=0; i < (int) _wins_all_cnt; i++) {
-		CGSRect rect;
-		CGSWindowLevel level;
-		int j, keepit = 0;
-		err = CGSGetScreenRectForWindow(cid, _wins_all[i], &rect);
-		if (err != 0) {
-			continue;
-		}
-		if (rect.origin.x == 0 && rect.origin.y == 0) {
-			if (rect.size.width == dpy_x) {
-				if (rect.size.height == dpy_y) {
-					continue;
-				}
-			}
-		}
-		err = CGSGetWindowLevel(cid, _wins_all[i], &level);
-		if (err != 0) {
-			continue;
-		}
-		for (j=0; j<CGS_levelmax; j++) {
-			if ((int) level == CGS_levels[j]) {
-				keepit = 1;
-				break;
-			}
-		}
-		if (! keepit) {
-			continue;
-		}
-
-		macwins[macwinmax].level  = (int) level;
-		macwins[macwinmax].win    = (int) _wins_all[i];
-		macwins[macwinmax].x      = (int) rect.origin.x;
-		macwins[macwinmax].y      = (int) rect.origin.y;
-		macwins[macwinmax].width  = (int) rect.size.width;
-		macwins[macwinmax].height = (int) rect.size.height;
-		macwins[macwinmax].mapped = 0;
-		macwins[macwinmax].clipped = 0;
-		macwins[macwinmax].ncache_only = 0;
-		if (level == kCGPopUpMenuWindowLevel) {
-			macwins[macwinmax].ncache_only = 1;
-		}
-
-if (0 || db) fprintf(stderr, "i=%03d ID: %06d  x: %03d  y: %03d  w: %03d h: %03d level: %d\n", i, _wins_all[i],
-    (int) rect.origin.x, (int) rect.origin.y,(int) rect.size.width, (int) rect.size.height, (int) level);
-
-		if (macwins[macwinmax].win < WINHISTNUM) {
-			qlook[macwins[macwinmax].win] = macwinmax;
-			if (macwins[macwinmax].win > maxwin) {
-				maxwin = macwins[macwinmax].win;
-			}
-		}
-
-		macwinmax++;
-	}
-
-	err = CGSGetOnScreenWindowList(cid, NULL, cap, _wins_mapped, &_wins_mapped_cnt);
-
-if (db) fprintf(stderr, "cnt: %d err: %d\n", (int) _wins_mapped_cnt, err);
-
-	if (err != 0) {
-		return;
-	}
-	
-	for (i=0; i < (int) _wins_mapped_cnt; i++) {
-		int j, idx = -1;
-		int win = (int) _wins_mapped[i];
-
-		if (0 <= win && win < WINHISTNUM) {
-			j = qlook[win];
-			if (j >= 0 && macwins[j].win == win) {
-				idx = j; 
-			}
-		}
-		if (idx < 0) {
-			for (j=0; j < macwinmax; j++) {
-				if (macwins[j].win == win) {
-					idx = j; 
-					break;
-				}
-			}
-		}
-		if (idx >= 0) {
-			macwins[idx].mapped = 1;
-		}
-	}
-
-	if (ncache > 0) {
-		int nv= 0, NBMAX = 64;
-		int nv_win[64];
-		int nv_lvl[64];
-		int nv_vis[64];
-
-		for (i=0; i < macwinmax; i++) {
-			int win = macwins[i].win;
-			char prev, curr;
-
-			if (win >= WINHISTNUM) {
-				continue;
-			}
-
-			whist[whist_idx][win] |= is_exist;
-			if (macwins[i].mapped) {
-				whist[whist_idx][win] |= is_mapped;
-				if (check_clipped(win)) {
-					whist[whist_idx][win] |= is_clipped;
-					macwins[i].clipped = 1;
-				}
-				if (check_offscreen(win)) {
-					whist[whist_idx][win] |= is_offscreen;
-				}
-			} else {
-				whist[whist_idx][win] |= is_offscreen;
-			}
-
-			curr = whist[whist_idx][win];
-			prev = whist[whist_prv][win];
-
-			if (whist_skip) {
-				;
-			} else if ( !(prev & is_mapped) && (curr & is_mapped)) {
-				/* MapNotify */
-				if (0) fprintf(stderr, "MapNotify:   %d/%d  %d               %.4f tot=%d\n", prev, curr, win, dnowx(), totcnt); 
-				macosx_add_mapnotify(win, macwins[i].level, 1);
-				if (0) macosxCGS_follow_animation_win(win, i, 1);
-
-			} else if ( !(curr & is_mapped) && (prev & is_mapped)) {
-				/* UnmapNotify */
-				if (0) fprintf(stderr, "UnmapNotify: %d/%d  %d               %.4f A tot=%d\n", prev, curr, win, dnowx(), totcnt); 
-				macosx_add_mapnotify(win, macwins[i].level, 0);
-			} else if ( !(prev & is_exist) && (curr & is_exist)) {
-				/* CreateNotify */
-				if (0) fprintf(stderr, "CreateNotify:%d/%d  %d               %.4f whist: %d/%d 0x%x tot=%d\n", prev, curr, win, dnowx(), whist_prv, whist_idx, win, totcnt); 
-				macosx_add_create(win, macwins[i].level);
-				if (curr & is_mapped) {
-					if (0) fprintf(stderr, "MapNotify:   %d/%d  %d               %.4f tot=%d\n", prev, curr, win, dnowx(), totcnt); 
-					macosx_add_mapnotify(win, macwins[i].level, 1);
-				}
-			}
-			if (whist_skip) {
-				;
-			} else if (nv >= NBMAX) {
-				;
-			} else if (!(curr & is_mapped)) {
-				;
-			} else if (!(prev & is_mapped)) {
-				if (1) {
-					;
-				} else if (curr & is_clipped) {
-					if (0) fprintf(stderr, "VisibNotify: %d/%d  %d               OBS tot=%d\n", prev, curr, win, totcnt); 
-					nv_win[nv] = win;
-					nv_lvl[nv] = macwins[i].level;
-					nv_vis[nv++] = 1;
-				} else {
-					if (0) fprintf(stderr, "VisibNotify: %d/%d  %d               UNOBS tot=%d\n", prev, curr, win, totcnt); 
-					nv_win[nv] = win;
-					nv_lvl[nv] = macwins[i].level;
-					nv_vis[nv++] = 0;
-				}
-			} else {
-				if        ( !(prev & is_clipped) &&  (curr & is_clipped) ) {
-					if (0) fprintf(stderr, "VisibNotify: %d/%d  %d               OBS tot=%d\n", prev, curr, win, totcnt); 
-					nv_win[nv] = win;
-					nv_lvl[nv] = macwins[i].level;
-					nv_vis[nv++] = 1;
-				} else if (  (prev & is_clipped) && !(curr & is_clipped) ) {
-					if (0) fprintf(stderr, "VisibNotify: %d/%d  %d               UNOBS tot=%d\n", prev, curr, win, totcnt); 
-					nv_win[nv] = win;
-					nv_lvl[nv] = macwins[i].level;
-					nv_vis[nv++] = 0;
-				}
-			}
-		}
-		for (i=0; i < maxwin; i++) {
-			char prev, curr;
-			int win = i;
-			int q = qlook[i];
-			int lvl = 0;
-
-			if (whist_skip) {
-				break;
-			}
-
-			if (q >= 0) {
-				lvl = macwins[q].level;	
-			}
-			curr = whist[whist_idx][win];
-			prev = whist[whist_prv][win];
-			if (!(curr & is_exist) && (prev & is_exist)) {
-				if (prev & is_mapped) {
-					if (0) fprintf(stderr, "UnmapNotify: %d/%d  %d               %.4f B tot=%d\n", prev, curr, win, dnowx(), totcnt); 
-					macosx_add_mapnotify(win, lvl, 0);
-				}
-				/* DestroyNotify */
-				if (0) fprintf(stderr, "DestroNotify:%d/%d  %d               %.4f tot=%d\n", prev, curr, win, dnowx(), totcnt); 
-				macosx_add_destroy(win, lvl);
-			}
-		}
-		if (nv) {
-			int k;
-			for (k = 0; k < nv; k++) {
-				macosx_add_visnotify(nv_win[k], nv_lvl[k], nv_vis[k]);
-			}
-		}
-	}
-}
-
-#if 1
-NSLock *pblock = nil;
-NSString *pbstr = nil;
-NSString *cuttext = nil;
-
-int pbcnt = -1;
-NSStringEncoding pbenc = NSWindowsCP1252StringEncoding;
-
-void macosxGCS_initpb(void) {
-	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-	pblock = [[NSLock alloc] init];
-	if (![NSPasteboard generalPasteboard]) {
-		macosx_log("macosxGCS_initpb: **PASTEBOARD INACCESSIBLE**.\n");
-		macosx_log("macosxGCS_initpb: Clipboard exchange will NOT work.\n");
-		macosx_log("macosxGCS_initpb: Start x11vnc *inside* Aqua for Clipboard.\n");
-		pbcnt = 0;
-		pbstr = [[NSString alloc] initWithString:@"\e<PASTEBOARD INACCESSIBLE>\e"]; 
-	}
-	[pool release];
-}
-
-void macosxGCS_set_pasteboard(char *str, int len) {
-	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-	if (pbcnt != 0) {
-		[pblock lock];
-		[cuttext release];
-		cuttext = [[NSString alloc] initWithData:[NSData dataWithBytes:str length:len] encoding: pbenc];
-		if ([[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]) {
-			NS_DURING
-				[[NSPasteboard generalPasteboard] setString:cuttext forType:NSStringPboardType];
-			NS_HANDLER
-				fprintf(stderr, "macosxGCS_set_pasteboard: problem writing to pasteboard\n");
-			NS_ENDHANDLER
-		} else {
-			fprintf(stderr, "macosxGCS_set_pasteboard: problem writing to pasteboard\n");
-		}
-		[cuttext release];
-		cuttext = nil;
-		[pblock unlock];
-	}
-	[pool release];
-}
-
-extern void macosx_send_sel(char *, int);
-
-void macosxGCS_poll_pb(void) {
-
-	static double dlast = 0.0;
-	double now = dnow();
-
-	if (now < dlast + 0.2) {
-		return;
-	}
-	dlast = now;
-
-   {
-	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-	[pblock lock];
-	if (pbcnt != [[NSPasteboard generalPasteboard] changeCount]) {
-		pbcnt = [[NSPasteboard generalPasteboard] changeCount];
-		[pbstr release];
-		pbstr = nil;
-		if ([[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]]) {
-			pbstr = [[[NSPasteboard generalPasteboard] stringForType:NSStringPboardType] copy];
-			if (pbstr) {
-				NSData *str = [pbstr dataUsingEncoding:pbenc allowLossyConversion:YES];
-				if ([str length]) {
-					macosx_send_sel((char *) [str bytes], [str length]);
-				}
-			}
-		}
-	}
-	[pblock unlock];
-	[pool release];
-   }
-}
-#endif
-
-#endif	/* __APPLE__ */
-
diff --git a/ica/x11/x11vnc/macosxCGS.h b/ica/x11/x11vnc/macosxCGS.h
deleted file mode 100644
index 21bdebd..0000000
--- a/ica/x11/x11vnc/macosxCGS.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_MACOSXCGS_H
-#define _X11VNC_MACOSXCGS_H
-
-/* -- macosxCGS.h -- */
-
-extern void macosxCGS_get_all_windows(void);
-extern int macosxCGS_get_qlook(int);
-extern void macosxGCS_set_pasteboard(char *str, int len);
-extern int macosxCGS_follow_animation_win(int win, int idx, int grow);
-extern int macosxCGS_find_index(int w);
-
-
-#endif /* _X11VNC_MACOSXCGS_H */
diff --git a/ica/x11/x11vnc/macosx_opengl.c b/ica/x11/x11vnc/macosx_opengl.c
deleted file mode 100644
index 9788279..0000000
--- a/ica/x11/x11vnc/macosx_opengl.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- macosx_opengl.c -- */
-
-#if (defined(__MACH__) && defined(__APPLE__))
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <ApplicationServices/ApplicationServices.h>
-
-#include <rfb/rfb.h>
-#if LIBVNCSERVER_HAVE_MACOSX_OPENGL_H
-#include <OpenGL/OpenGL.h>
-#include <OpenGL/gl.h>
-#endif
-
-extern int macosx_no_opengl, macosx_read_opengl;
-extern CGDirectDisplayID displayID;
-
-static CGLContextObj glContextObj;
-
-int macosx_opengl_width = 0;
-int macosx_opengl_height = 0;
-int macosx_opengl_bpp = 0;
-
-int macosx_opengl_get_width(void) {
-	GLint viewport[4];
-
-	glGetIntegerv(GL_VIEWPORT, viewport);
-	return (int) viewport[2];
-}
-
-int macosx_opengl_get_height(void) {
-	GLint viewport[4];
-
-	glGetIntegerv(GL_VIEWPORT, viewport);
-	return (int) viewport[3];
-}
-
-int macosx_opengl_get_bpp(void) {
-	return 32;
-}
-
-int macosx_opengl_get_bps(void) {
-	return 8;
-}
-
-int macosx_opengl_get_spp(void) {
-	return 3;
-}
-
-void macosx_opengl_init(void) {
-	CGLPixelFormatObj pixelFormatObj;
-	GLint numPixelFormats;
-	CGLPixelFormatAttribute attribs[] = {
-		kCGLPFAFullScreen,
-		kCGLPFADisplayMask,
-		0,
-		0
-	};
-
-	if (macosx_no_opengl) {
-		return;
-	}
-
-	attribs[2] = CGDisplayIDToOpenGLDisplayMask(displayID);
-
-	CGLChoosePixelFormat(attribs, &pixelFormatObj, &numPixelFormats);
-	if (pixelFormatObj == NULL) {
-		rfbLog("macosx_opengl_init: CGLChoosePixelFormat failed. Not using OpenGL.\n");
-		return;
-	}
-
-	CGLCreateContext(pixelFormatObj, NULL, &glContextObj);
-	CGLDestroyPixelFormat(pixelFormatObj);
-
-	if (glContextObj == NULL) {
-		rfbLog("macosx_opengl_init: CGLCreateContext failed. Not using OpenGL.\n");
-		return;
-	}
-
-	CGLSetCurrentContext(glContextObj);
-	CGLSetFullScreen(glContextObj);
-
-	macosx_opengl_width  = macosx_opengl_get_width();
-	macosx_opengl_height = macosx_opengl_get_height();
-
-	macosx_opengl_bpp = macosx_opengl_get_bpp();
-
-	glFinish();
-
-	glPixelStorei(GL_PACK_ALIGNMENT, 4);
-	glPixelStorei(GL_PACK_ROW_LENGTH, 0);
-	glPixelStorei(GL_PACK_SKIP_ROWS, 0);
-	glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
-
-	rfbLog("macosx_opengl_init: Using OpenGL for screen capture.\n");
-	macosx_read_opengl = 1;
-}
-
-void macosx_opengl_fini(void) {
-	if (!macosx_read_opengl) {
-		return;
-	}
-	CGLSetCurrentContext(NULL);
-	CGLClearDrawable(glContextObj);
-	CGLDestroyContext(glContextObj);
-}
-
-void macosx_copy_opengl(char *dest, int x, int y, unsigned int w, unsigned int h) {
-	int yflip = macosx_opengl_height - y - h; 
-
-	CGLSetCurrentContext(glContextObj);
-
-	glReadPixels((GLint) x, (GLint) yflip, (int) w, (int) h,
-	    GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, dest);
-
-	if (h > 1) {
-		static char *pbuf = NULL;
-		static int buflen = 0;
-		int top = 0, bot = h - 1, rowlen = w * macosx_opengl_bpp/8;
-		char *ptop, *pbot;
-
-		if (rowlen > buflen || buflen == 0)  {
-			buflen = rowlen + 128;
-			if (pbuf) {
-				free(pbuf);
-			}
-			pbuf = (char *) malloc(buflen);
-		}
-		while (top < bot) {
-			ptop = dest + top * rowlen;
-			pbot = dest + bot * rowlen;
-			memcpy(pbuf, ptop, rowlen);
-			memcpy(ptop, pbot, rowlen);
-			memcpy(pbot, pbuf, rowlen);
-			top++;
-			bot--;
-		}
-	}
-}
-
-
-#else
-
-#endif	/* __APPLE__ */
-
diff --git a/ica/x11/x11vnc/macosx_opengl.h b/ica/x11/x11vnc/macosx_opengl.h
deleted file mode 100644
index 5531a0c..0000000
--- a/ica/x11/x11vnc/macosx_opengl.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_MACOSX_OPENGL_H
-#define _X11VNC_MACOSX_OPENGL_H
-
-/* -- macosx_opengl.h -- */
-
-extern void macosx_opengl_init(void);
-
-
-#endif /* _X11VNC_MACOSX_OPENGL_H */
diff --git a/ica/x11/x11vnc/nox11.h b/ica/x11/x11vnc/nox11.h
deleted file mode 100644
index 1dcc974..0000000
--- a/ica/x11/x11vnc/nox11.h
+++ /dev/null
@@ -1,6671 +0,0 @@
-#undef  LIBVNCSERVER_HAVE_XSHM
-#define LIBVNCSERVER_HAVE_XSHM 0
-#undef  LIBVNCSERVER_HAVE_XTEST
-#define LIBVNCSERVER_HAVE_XTEST 0
-#undef  LIBVNCSERVER_HAVE_XTESTGRABCONTROL
-#define LIBVNCSERVER_HAVE_XTESTGRABCONTROL 0
-#undef  LIBVNCSERVER_HAVE_XKEYBOARD
-#define LIBVNCSERVER_HAVE_XKEYBOARD 0
-#undef  LIBVNCSERVER_HAVE_LIBXINERAMA
-#define LIBVNCSERVER_HAVE_LIBXINERAMA 0
-#undef  LIBVNCSERVER_HAVE_LIBXRANDR
-#define LIBVNCSERVER_HAVE_LIBXRANDR 0
-#undef  LIBVNCSERVER_HAVE_LIBXFIXES
-#define LIBVNCSERVER_HAVE_LIBXFIXES 0
-#undef  LIBVNCSERVER_HAVE_LIBXDAMAGE
-#define LIBVNCSERVER_HAVE_LIBXDAMAGE 0
-#undef  LIBVNCSERVER_HAVE_RECORD
-#define LIBVNCSERVER_HAVE_RECORD 0
-#undef  LIBVNCSERVER_HAVE_LIBXTRAP
-#define LIBVNCSERVER_HAVE_LIBXTRAP 0
-#undef  LIBVNCSERVER_HAVE_SOLARIS_XREADSCREEN
-#define LIBVNCSERVER_HAVE_SOLARIS_XREADSCREEN 0
-#undef  LIBVNCSERVER_HAVE_IRIX_XREADDISPLAY
-#define LIBVNCSERVER_HAVE_IRIX_XREADDISPLAY 0
-#undef  LIBVNCSERVER_HAVE_FBPM
-#define LIBVNCSERVER_HAVE_FBPM 0
-
-/* default keysyms */
-#if 0
-/* XXX go with the subset in rfb/keysym.h for now */
-#define XK_MISCELLANY
-#define XK_XKB_KEYS
-#define XK_LATIN1
-#define XK_LATIN2
-#define XK_LATIN3
-#define XK_LATIN4
-#define XK_LATIN8
-#define XK_LATIN9
-#define XK_CAUCASUS
-#define XK_GREEK
-#define XK_KATAKANA
-#define XK_ARABIC
-#define XK_CYRILLIC
-#define XK_HEBREW
-#define XK_THAI
-#define XK_KOREAN
-#define XK_ARMENIAN
-#define XK_GEORGIAN
-#define XK_VIETNAMESE
-#define XK_CURRENCY
-#endif
-
-/*
- *	$Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
- */
-
-/* Definitions for the X window system likely to be used by applications */
-
-#ifndef X_H
-#define X_H
-
-/***********************************************************
-
-Copyright 1987, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/include/X.h,v 1.5 2001/12/14 19:53:25 dawes Exp $ */
-
-#define X_PROTOCOL	11		/* current protocol version */
-#define X_PROTOCOL_REVISION 0		/* current minor version */
-
-/* Resources */
-
-/*
- * _XSERVER64 must ONLY be defined when compiling X server sources on
- * systems where unsigned long is not 32 bits, must NOT be used in
- * client or library code.
- */
-#ifndef _XSERVER64
-#  ifndef _XTYPEDEF_XID
-#    define _XTYPEDEF_XID
-typedef unsigned long XID;
-#  endif
-#  ifndef _XTYPEDEF_MASK
-#    define _XTYPEDEF_MASK
-typedef unsigned long Mask;
-#  endif
-#  ifndef _XTYPEDEF_ATOM
-#    define _XTYPEDEF_ATOM
-typedef unsigned long Atom;		/* Also in Xdefs.h */
-#  endif
-typedef unsigned long VisualID;
-typedef unsigned long Time;
-#else
-#  include <X11/Xmd.h>
-#  ifndef _XTYPEDEF_XID
-#    define _XTYPEDEF_XID
-typedef CARD32 XID;
-#  endif
-#  ifndef _XTYPEDEF_MASK
-#    define _XTYPEDEF_MASK
-typedef CARD32 Mask;
-#  endif
-#  ifndef _XTYPEDEF_ATOM
-#    define _XTYPEDEF_ATOM
-typedef CARD32 Atom;
-#  endif
-typedef CARD32 VisualID;
-typedef CARD32 Time;
-#endif
-
-typedef XID Window;
-typedef XID Drawable;
-#ifndef _XTYPEDEF_FONT
-#  define _XTYPEDEF_FONT
-typedef XID Font;
-#endif
-typedef XID Pixmap;
-typedef XID Cursor;
-typedef XID Colormap;
-typedef XID GContext;
-typedef XID KeySym;
-
-typedef unsigned char KeyCode;
-
-/*****************************************************************
- * RESERVED RESOURCE AND CONSTANT DEFINITIONS
- *****************************************************************/
-
-#ifndef None
-#define None                 0L	/* universal null resource or null atom */
-#endif
-
-#define ParentRelative       1L	/* background pixmap in CreateWindow
-				    and ChangeWindowAttributes */
-
-#define CopyFromParent       0L	/* border pixmap in CreateWindow
-				       and ChangeWindowAttributes
-				   special VisualID and special window
-				       class passed to CreateWindow */
-
-#define PointerWindow        0L	/* destination window in SendEvent */
-#define InputFocus           1L	/* destination window in SendEvent */
-
-#define PointerRoot          1L	/* focus window in SetInputFocus */
-
-#define AnyPropertyType      0L	/* special Atom, passed to GetProperty */
-
-#define AnyKey		     0L	/* special Key Code, passed to GrabKey */
-
-#define AnyButton            0L	/* special Button Code, passed to GrabButton */
-
-#define AllTemporary         0L	/* special Resource ID passed to KillClient */
-
-#define CurrentTime          0L	/* special Time */
-
-#define NoSymbol	     0L	/* special KeySym */
-
-/***************************************************************** 
- * EVENT DEFINITIONS 
- *****************************************************************/
-
-/* Input Event Masks. Used as event-mask window attribute and as arguments
-   to Grab requests.  Not to be confused with event names.  */
-
-#define NoEventMask			0L
-#define KeyPressMask			(1L<<0)  
-#define KeyReleaseMask			(1L<<1)  
-#define ButtonPressMask			(1L<<2)  
-#define ButtonReleaseMask		(1L<<3)  
-#define EnterWindowMask			(1L<<4)  
-#define LeaveWindowMask			(1L<<5)  
-#define PointerMotionMask		(1L<<6)  
-#define PointerMotionHintMask		(1L<<7)  
-#define Button1MotionMask		(1L<<8)  
-#define Button2MotionMask		(1L<<9)  
-#define Button3MotionMask		(1L<<10) 
-#define Button4MotionMask		(1L<<11) 
-#define Button5MotionMask		(1L<<12) 
-#define ButtonMotionMask		(1L<<13) 
-#define KeymapStateMask			(1L<<14)
-#define ExposureMask			(1L<<15) 
-#define VisibilityChangeMask		(1L<<16) 
-#define StructureNotifyMask		(1L<<17) 
-#define ResizeRedirectMask		(1L<<18) 
-#define SubstructureNotifyMask		(1L<<19) 
-#define SubstructureRedirectMask	(1L<<20) 
-#define FocusChangeMask			(1L<<21) 
-#define PropertyChangeMask		(1L<<22) 
-#define ColormapChangeMask		(1L<<23) 
-#define OwnerGrabButtonMask		(1L<<24) 
-
-/* Event names.  Used in "type" field in XEvent structures.  Not to be
-confused with event masks above.  They start from 2 because 0 and 1
-are reserved in the protocol for errors and replies. */
-
-#define KeyPress		2
-#define KeyRelease		3
-#define ButtonPress		4
-#define ButtonRelease		5
-#define MotionNotify		6
-#define EnterNotify		7
-#define LeaveNotify		8
-#define FocusIn			9
-#define FocusOut		10
-#define KeymapNotify		11
-#define Expose			12
-#define GraphicsExpose		13
-#define NoExpose		14
-#define VisibilityNotify	15
-#define CreateNotify		16
-#define DestroyNotify		17
-#define UnmapNotify		18
-#define MapNotify		19
-#define MapRequest		20
-#define ReparentNotify		21
-#define ConfigureNotify		22
-#define ConfigureRequest	23
-#define GravityNotify		24
-#define ResizeRequest		25
-#define CirculateNotify		26
-#define CirculateRequest	27
-#define PropertyNotify		28
-#define SelectionClear		29
-#define SelectionRequest	30
-#define SelectionNotify		31
-#define ColormapNotify		32
-#define ClientMessage		33
-#define MappingNotify		34
-#define LASTEvent		35	/* must be bigger than any event # */
-
-
-/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
-   state in various key-, mouse-, and button-related events. */
-
-#define ShiftMask		(1<<0)
-#define LockMask		(1<<1)
-#define ControlMask		(1<<2)
-#define Mod1Mask		(1<<3)
-#define Mod2Mask		(1<<4)
-#define Mod3Mask		(1<<5)
-#define Mod4Mask		(1<<6)
-#define Mod5Mask		(1<<7)
-
-/* modifier names.  Used to build a SetModifierMapping request or
-   to read a GetModifierMapping request.  These correspond to the
-   masks defined above. */
-#define ShiftMapIndex		0
-#define LockMapIndex		1
-#define ControlMapIndex		2
-#define Mod1MapIndex		3
-#define Mod2MapIndex		4
-#define Mod3MapIndex		5
-#define Mod4MapIndex		6
-#define Mod5MapIndex		7
-
-
-/* button masks.  Used in same manner as Key masks above. Not to be confused
-   with button names below. */
-
-#define Button1Mask		(1<<8)
-#define Button2Mask		(1<<9)
-#define Button3Mask		(1<<10)
-#define Button4Mask		(1<<11)
-#define Button5Mask		(1<<12)
-
-#define AnyModifier		(1<<15)  /* used in GrabButton, GrabKey */
-
-
-/* button names. Used as arguments to GrabButton and as detail in ButtonPress
-   and ButtonRelease events.  Not to be confused with button masks above.
-   Note that 0 is already defined above as "AnyButton".  */
-
-#define Button1			1
-#define Button2			2
-#define Button3			3
-#define Button4			4
-#define Button5			5
-
-/* Notify modes */
-
-#define NotifyNormal		0
-#define NotifyGrab		1
-#define NotifyUngrab		2
-#define NotifyWhileGrabbed	3
-
-#define NotifyHint		1	/* for MotionNotify events */
-		       
-/* Notify detail */
-
-#define NotifyAncestor		0
-#define NotifyVirtual		1
-#define NotifyInferior		2
-#define NotifyNonlinear		3
-#define NotifyNonlinearVirtual	4
-#define NotifyPointer		5
-#define NotifyPointerRoot	6
-#define NotifyDetailNone	7
-
-/* Visibility notify */
-
-#define VisibilityUnobscured		0
-#define VisibilityPartiallyObscured	1
-#define VisibilityFullyObscured		2
-
-/* Circulation request */
-
-#define PlaceOnTop		0
-#define PlaceOnBottom		1
-
-/* protocol families */
-
-#define FamilyInternet		0
-#define FamilyDECnet		1
-#define FamilyChaos		2
-
-/* Property notification */
-
-#define PropertyNewValue	0
-#define PropertyDelete		1
-
-/* Color Map notification */
-
-#define ColormapUninstalled	0
-#define ColormapInstalled	1
-
-/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
-
-#define GrabModeSync		0
-#define GrabModeAsync		1
-
-/* GrabPointer, GrabKeyboard reply status */
-
-#define GrabSuccess		0
-#define AlreadyGrabbed		1
-#define GrabInvalidTime		2
-#define GrabNotViewable		3
-#define GrabFrozen		4
-
-/* AllowEvents modes */
-
-#define AsyncPointer		0
-#define SyncPointer		1
-#define ReplayPointer		2
-#define AsyncKeyboard		3
-#define SyncKeyboard		4
-#define ReplayKeyboard		5
-#define AsyncBoth		6
-#define SyncBoth		7
-
-/* Used in SetInputFocus, GetInputFocus */
-
-#define RevertToNone		(int)None
-#define RevertToPointerRoot	(int)PointerRoot
-#define RevertToParent		2
-
-/*****************************************************************
- * ERROR CODES 
- *****************************************************************/
-
-#define Success		   0	/* everything's okay */
-#define BadRequest	   1	/* bad request code */
-#define BadValue	   2	/* int parameter out of range */
-#define BadWindow	   3	/* parameter not a Window */
-#define BadPixmap	   4	/* parameter not a Pixmap */
-#define BadAtom		   5	/* parameter not an Atom */
-#define BadCursor	   6	/* parameter not a Cursor */
-#define BadFont		   7	/* parameter not a Font */
-#define BadMatch	   8	/* parameter mismatch */
-#define BadDrawable	   9	/* parameter not a Pixmap or Window */
-#define BadAccess	  10	/* depending on context:
-				 - key/button already grabbed
-				 - attempt to free an illegal 
-				   cmap entry 
-				- attempt to store into a read-only 
-				   color map entry.
- 				- attempt to modify the access control
-				   list from other than the local host.
-				*/
-#define BadAlloc	  11	/* insufficient resources */
-#define BadColor	  12	/* no such colormap */
-#define BadGC		  13	/* parameter not a GC */
-#define BadIDChoice	  14	/* choice not in range or already used */
-#define BadName		  15	/* font or color name doesn't exist */
-#define BadLength	  16	/* Request length incorrect */
-#define BadImplementation 17	/* server is defective */
-
-#define FirstExtensionError	128
-#define LastExtensionError	255
-
-/*****************************************************************
- * WINDOW DEFINITIONS 
- *****************************************************************/
-
-/* Window classes used by CreateWindow */
-/* Note that CopyFromParent is already defined as 0 above */
-
-#define InputOutput		1
-#define InputOnly		2
-
-/* Window attributes for CreateWindow and ChangeWindowAttributes */
-
-#define CWBackPixmap		(1L<<0)
-#define CWBackPixel		(1L<<1)
-#define CWBorderPixmap		(1L<<2)
-#define CWBorderPixel           (1L<<3)
-#define CWBitGravity		(1L<<4)
-#define CWWinGravity		(1L<<5)
-#define CWBackingStore          (1L<<6)
-#define CWBackingPlanes	        (1L<<7)
-#define CWBackingPixel	        (1L<<8)
-#define CWOverrideRedirect	(1L<<9)
-#define CWSaveUnder		(1L<<10)
-#define CWEventMask		(1L<<11)
-#define CWDontPropagate	        (1L<<12)
-#define CWColormap		(1L<<13)
-#define CWCursor	        (1L<<14)
-
-/* ConfigureWindow structure */
-
-#define CWX			(1<<0)
-#define CWY			(1<<1)
-#define CWWidth			(1<<2)
-#define CWHeight		(1<<3)
-#define CWBorderWidth		(1<<4)
-#define CWSibling		(1<<5)
-#define CWStackMode		(1<<6)
-
-
-/* Bit Gravity */
-
-#define ForgetGravity		0
-#define NorthWestGravity	1
-#define NorthGravity		2
-#define NorthEastGravity	3
-#define WestGravity		4
-#define CenterGravity		5
-#define EastGravity		6
-#define SouthWestGravity	7
-#define SouthGravity		8
-#define SouthEastGravity	9
-#define StaticGravity		10
-
-/* Window gravity + bit gravity above */
-
-#define UnmapGravity		0
-
-/* Used in CreateWindow for backing-store hint */
-
-#define NotUseful               0
-#define WhenMapped              1
-#define Always                  2
-
-/* Used in GetWindowAttributes reply */
-
-#define IsUnmapped		0
-#define IsUnviewable		1
-#define IsViewable		2
-
-/* Used in ChangeSaveSet */
-
-#define SetModeInsert           0
-#define SetModeDelete           1
-
-/* Used in ChangeCloseDownMode */
-
-#define DestroyAll              0
-#define RetainPermanent         1
-#define RetainTemporary         2
-
-/* Window stacking method (in configureWindow) */
-
-#define Above                   0
-#define Below                   1
-#define TopIf                   2
-#define BottomIf                3
-#define Opposite                4
-
-/* Circulation direction */
-
-#define RaiseLowest             0
-#define LowerHighest            1
-
-/* Property modes */
-
-#define PropModeReplace         0
-#define PropModePrepend         1
-#define PropModeAppend          2
-
-/*****************************************************************
- * GRAPHICS DEFINITIONS
- *****************************************************************/
-
-/* graphics functions, as in GC.alu */
-
-#define	GXclear			0x0		/* 0 */
-#define GXand			0x1		/* src AND dst */
-#define GXandReverse		0x2		/* src AND NOT dst */
-#define GXcopy			0x3		/* src */
-#define GXandInverted		0x4		/* NOT src AND dst */
-#define	GXnoop			0x5		/* dst */
-#define GXxor			0x6		/* src XOR dst */
-#define GXor			0x7		/* src OR dst */
-#define GXnor			0x8		/* NOT src AND NOT dst */
-#define GXequiv			0x9		/* NOT src XOR dst */
-#define GXinvert		0xa		/* NOT dst */
-#define GXorReverse		0xb		/* src OR NOT dst */
-#define GXcopyInverted		0xc		/* NOT src */
-#define GXorInverted		0xd		/* NOT src OR dst */
-#define GXnand			0xe		/* NOT src OR NOT dst */
-#define GXset			0xf		/* 1 */
-
-/* LineStyle */
-
-#define LineSolid		0
-#define LineOnOffDash		1
-#define LineDoubleDash		2
-
-/* capStyle */
-
-#define CapNotLast		0
-#define CapButt			1
-#define CapRound		2
-#define CapProjecting		3
-
-/* joinStyle */
-
-#define JoinMiter		0
-#define JoinRound		1
-#define JoinBevel		2
-
-/* fillStyle */
-
-#define FillSolid		0
-#define FillTiled		1
-#define FillStippled		2
-#define FillOpaqueStippled	3
-
-/* fillRule */
-
-#define EvenOddRule		0
-#define WindingRule		1
-
-/* subwindow mode */
-
-#define ClipByChildren		0
-#define IncludeInferiors	1
-
-/* SetClipRectangles ordering */
-
-#define Unsorted		0
-#define YSorted			1
-#define YXSorted		2
-#define YXBanded		3
-
-/* CoordinateMode for drawing routines */
-
-#define CoordModeOrigin		0	/* relative to the origin */
-#define CoordModePrevious       1	/* relative to previous point */
-
-/* Polygon shapes */
-
-#define Complex			0	/* paths may intersect */
-#define Nonconvex		1	/* no paths intersect, but not convex */
-#define Convex			2	/* wholly convex */
-
-/* Arc modes for PolyFillArc */
-
-#define ArcChord		0	/* join endpoints of arc */
-#define ArcPieSlice		1	/* join endpoints to center of arc */
-
-/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
-   GC.stateChanges */
-
-#define GCFunction              (1L<<0)
-#define GCPlaneMask             (1L<<1)
-#define GCForeground            (1L<<2)
-#define GCBackground            (1L<<3)
-#define GCLineWidth             (1L<<4)
-#define GCLineStyle             (1L<<5)
-#define GCCapStyle              (1L<<6)
-#define GCJoinStyle		(1L<<7)
-#define GCFillStyle		(1L<<8)
-#define GCFillRule		(1L<<9) 
-#define GCTile			(1L<<10)
-#define GCStipple		(1L<<11)
-#define GCTileStipXOrigin	(1L<<12)
-#define GCTileStipYOrigin	(1L<<13)
-#define GCFont 			(1L<<14)
-#define GCSubwindowMode		(1L<<15)
-#define GCGraphicsExposures     (1L<<16)
-#define GCClipXOrigin		(1L<<17)
-#define GCClipYOrigin		(1L<<18)
-#define GCClipMask		(1L<<19)
-#define GCDashOffset		(1L<<20)
-#define GCDashList		(1L<<21)
-#define GCArcMode		(1L<<22)
-
-#define GCLastBit		22
-/*****************************************************************
- * FONTS 
- *****************************************************************/
-
-/* used in QueryFont -- draw direction */
-
-#define FontLeftToRight		0
-#define FontRightToLeft		1
-
-#define FontChange		255
-
-/*****************************************************************
- *  IMAGING 
- *****************************************************************/
-
-/* ImageFormat -- PutImage, GetImage */
-
-#define XYBitmap		0	/* depth 1, XYFormat */
-#define XYPixmap		1	/* depth == drawable depth */
-#define ZPixmap			2	/* depth == drawable depth */
-
-/*****************************************************************
- *  COLOR MAP STUFF 
- *****************************************************************/
-
-/* For CreateColormap */
-
-#define AllocNone		0	/* create map with no entries */
-#define AllocAll		1	/* allocate entire map writeable */
-
-
-/* Flags used in StoreNamedColor, StoreColors */
-
-#define DoRed			(1<<0)
-#define DoGreen			(1<<1)
-#define DoBlue			(1<<2)
-
-/*****************************************************************
- * CURSOR STUFF
- *****************************************************************/
-
-/* QueryBestSize Class */
-
-#define CursorShape		0	/* largest size that can be displayed */
-#define TileShape		1	/* size tiled fastest */
-#define StippleShape		2	/* size stippled fastest */
-
-/***************************************************************** 
- * KEYBOARD/POINTER STUFF
- *****************************************************************/
-
-#define AutoRepeatModeOff	0
-#define AutoRepeatModeOn	1
-#define AutoRepeatModeDefault	2
-
-#define LedModeOff		0
-#define LedModeOn		1
-
-/* masks for ChangeKeyboardControl */
-
-#define KBKeyClickPercent	(1L<<0)
-#define KBBellPercent		(1L<<1)
-#define KBBellPitch		(1L<<2)
-#define KBBellDuration		(1L<<3)
-#define KBLed			(1L<<4)
-#define KBLedMode		(1L<<5)
-#define KBKey			(1L<<6)
-#define KBAutoRepeatMode	(1L<<7)
-
-#define MappingSuccess     	0
-#define MappingBusy        	1
-#define MappingFailed		2
-
-#define MappingModifier		0
-#define MappingKeyboard		1
-#define MappingPointer		2
-
-/*****************************************************************
- * SCREEN SAVER STUFF 
- *****************************************************************/
-
-#define DontPreferBlanking	0
-#define PreferBlanking		1
-#define DefaultBlanking		2
-
-#define DisableScreenSaver	0
-#define DisableScreenInterval	0
-
-#define DontAllowExposures	0
-#define AllowExposures		1
-#define DefaultExposures	2
-
-/* for ForceScreenSaver */
-
-#define ScreenSaverReset 0
-#define ScreenSaverActive 1
-
-/*****************************************************************
- * HOSTS AND CONNECTIONS
- *****************************************************************/
-
-/* for ChangeHosts */
-
-#define HostInsert		0
-#define HostDelete		1
-
-/* for ChangeAccessControl */
-
-#define EnableAccess		1      
-#define DisableAccess		0
-
-/* Display classes  used in opening the connection 
- * Note that the statically allocated ones are even numbered and the
- * dynamically changeable ones are odd numbered */
-
-#define StaticGray		0
-#define GrayScale		1
-#define StaticColor		2
-#define PseudoColor		3
-#define TrueColor		4
-#define DirectColor		5
-
-
-/* Byte order  used in imageByteOrder and bitmapBitOrder */
-
-#define LSBFirst		0
-#define MSBFirst		1
-
-#endif /* X_H */
-
-
-/* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */
-/* 
-
-Copyright 1985, 1986, 1987, 1991, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-/* $XFree86: xc/lib/X11/Xlib.h,v 3.23 2002/05/31 18:45:42 dawes Exp $ */
-
-
-/*
- *	Xlib.h - Header definition and support file for the C subroutine
- *	interface library (Xlib) to the X Window System Protocol (V11).
- *	Structures and symbols starting with "_" are private to the library.
- */
-#ifndef _XLIB_H_
-#define _XLIB_H_
-
-#define XlibSpecificationRelease 6
-
-#ifdef USG
-#ifndef __TYPES__
-#include <sys/types.h>			/* forgot to protect it... */
-#define __TYPES__
-#endif /* __TYPES__ */
-#else
-#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
-#undef _POSIX_SOURCE
-#include <sys/types.h>
-#define _POSIX_SOURCE
-#else
-#include <sys/types.h>
-#endif
-#endif /* USG */
-
-#if 0
-#include <X11/X.h>
-
-/* applications should not depend on these two headers being included! */
-#include <X11/Xfuncproto.h>
-#include <X11/Xosdefs.h>
-
-#endif /* if 0 */
-
-#ifndef X_WCHAR
-#ifdef X_NOT_STDC_ENV
-#ifndef SCO324
-#ifndef ISC
-#define X_WCHAR
-#endif
-#endif
-#endif
-#endif
-
-#ifndef X_WCHAR
-#include <stddef.h>
-#else
-#ifdef __UNIXOS2__
-#include <stdlib.h>
-#else
-/* replace this with #include or typedef appropriate for your system */
-typedef unsigned long wchar_t;
-#endif
-#endif
-
-#if defined(ISC) && defined(USE_XMBTOWC)
-#define wctomb(a,b)	_Xwctomb(a,b)
-#define mblen(a,b)	_Xmblen(a,b) 
-#ifndef USE_XWCHAR_STRING
-#define mbtowc(a,b,c)	_Xmbtowc(a,b,c)
-#endif
-#endif
-
-/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
-   November 2000. Its presence is indicated through the following macro. */
-#define X_HAVE_UTF8_STRING 1
-
-typedef char *XPointer;
-
-#define Bool int
-#define Status int
-#define True 1
-#define False 0
-
-#define QueuedAlready 0
-#define QueuedAfterReading 1
-#define QueuedAfterFlush 2
-
-#define ConnectionNumber(dpy) 	(((_XPrivDisplay)dpy)->fd)
-#define RootWindow(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root)
-#define DefaultScreen(dpy) 	(((_XPrivDisplay)dpy)->default_screen)
-#define DefaultRootWindow(dpy) 	(ScreenOfDisplay(dpy,DefaultScreen(dpy))->root)
-#define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual)
-#define DefaultGC(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->default_gc)
-#define BlackPixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->black_pixel)
-#define WhitePixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->white_pixel)
-#define AllPlanes 		((unsigned long)~0L)
-#define QLength(dpy) 		(((_XPrivDisplay)dpy)->qlen)
-#define DisplayWidth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->width)
-#define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height)
-#define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth)
-#define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight)
-#define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
-#define DisplayCells(dpy, scr) 	(DefaultVisual(dpy,scr)->map_entries)
-#define ScreenCount(dpy) 	(((_XPrivDisplay)dpy)->nscreens)
-#define ServerVendor(dpy) 	(((_XPrivDisplay)dpy)->vendor)
-#define ProtocolVersion(dpy) 	(((_XPrivDisplay)dpy)->proto_major_version)
-#define ProtocolRevision(dpy) 	(((_XPrivDisplay)dpy)->proto_minor_version)
-#define VendorRelease(dpy) 	(((_XPrivDisplay)dpy)->release)
-#define DisplayString(dpy) 	(((_XPrivDisplay)dpy)->display_name)
-#define DefaultDepth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root_depth)
-#define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
-#define BitmapUnit(dpy) 	(((_XPrivDisplay)dpy)->bitmap_unit)
-#define BitmapBitOrder(dpy) 	(((_XPrivDisplay)dpy)->bitmap_bit_order)
-#define BitmapPad(dpy) 		(((_XPrivDisplay)dpy)->bitmap_pad)
-#define ImageByteOrder(dpy) 	(((_XPrivDisplay)dpy)->byte_order)
-#ifdef CRAY /* unable to get WORD64 without pulling in other symbols */
-#define NextRequest(dpy)	XNextRequest(dpy)
-#else
-#define NextRequest(dpy)	(((_XPrivDisplay)dpy)->request + 1)
-#endif
-#define LastKnownRequestProcessed(dpy)	(((_XPrivDisplay)dpy)->last_request_read)
-
-/* macros for screen oriented applications (toolkit) */
-#define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr])
-#define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
-#define DisplayOfScreen(s)	((s)->display)
-#define RootWindowOfScreen(s)	((s)->root)
-#define BlackPixelOfScreen(s)	((s)->black_pixel)
-#define WhitePixelOfScreen(s)	((s)->white_pixel)
-#define DefaultColormapOfScreen(s)((s)->cmap)
-#define DefaultDepthOfScreen(s)	((s)->root_depth)
-#define DefaultGCOfScreen(s)	((s)->default_gc)
-#define DefaultVisualOfScreen(s)((s)->root_visual)
-#define WidthOfScreen(s)	((s)->width)
-#define HeightOfScreen(s)	((s)->height)
-#define WidthMMOfScreen(s)	((s)->mwidth)
-#define HeightMMOfScreen(s)	((s)->mheight)
-#define PlanesOfScreen(s)	((s)->root_depth)
-#define CellsOfScreen(s)	(DefaultVisualOfScreen((s))->map_entries)
-#define MinCmapsOfScreen(s)	((s)->min_maps)
-#define MaxCmapsOfScreen(s)	((s)->max_maps)
-#define DoesSaveUnders(s)	((s)->save_unders)
-#define DoesBackingStore(s)	((s)->backing_store)
-#define EventMaskOfScreen(s)	((s)->root_input_mask)
-
-/*
- * Extensions need a way to hang private data on some structures.
- */
-typedef struct _XExtData {
-	int number;		/* number returned by XRegisterExtension */
-	struct _XExtData *next;	/* next item on list of data for structure */
-	int (*free_private)(	/* called to free private storage */
-#if NeedFunctionPrototypes
-	struct _XExtData *extension
-#endif
-	);
-	XPointer private_data;	/* data private to this extension. */
-} XExtData;
-
-/*
- * This file contains structures used by the extension mechanism.
- */
-typedef struct {		/* public to extension, cannot be changed */
-	int extension;		/* extension number */
-	int major_opcode;	/* major op-code assigned by server */
-	int first_event;	/* first event number for the extension */
-	int first_error;	/* first error number for the extension */
-} XExtCodes;
-
-/*
- * Data structure for retrieving info about pixmap formats.
- */
-
-typedef struct {
-    int depth;
-    int bits_per_pixel;
-    int scanline_pad;
-} XPixmapFormatValues;
-
-
-/*
- * Data structure for setting graphics context.
- */
-typedef struct {
-	int function;		/* logical operation */
-	unsigned long plane_mask;/* plane mask */
-	unsigned long foreground;/* foreground pixel */
-	unsigned long background;/* background pixel */
-	int line_width;		/* line width */
-	int line_style;	 	/* LineSolid, LineOnOffDash, LineDoubleDash */
-	int cap_style;	  	/* CapNotLast, CapButt, 
-				   CapRound, CapProjecting */
-	int join_style;	 	/* JoinMiter, JoinRound, JoinBevel */
-	int fill_style;	 	/* FillSolid, FillTiled, 
-				   FillStippled, FillOpaeueStippled */
-	int fill_rule;	  	/* EvenOddRule, WindingRule */
-	int arc_mode;		/* ArcChord, ArcPieSlice */
-	Pixmap tile;		/* tile pixmap for tiling operations */
-	Pixmap stipple;		/* stipple 1 plane pixmap for stipping */
-	int ts_x_origin;	/* offset for tile or stipple operations */
-	int ts_y_origin;
-        Font font;	        /* default text font for text operations */
-	int subwindow_mode;     /* ClipByChildren, IncludeInferiors */
-	Bool graphics_exposures;/* boolean, should exposures be generated */
-	int clip_x_origin;	/* origin for clipping */
-	int clip_y_origin;
-	Pixmap clip_mask;	/* bitmap clipping; other calls for rects */
-	int dash_offset;	/* patterned/dashed line information */
-	char dashes;
-} XGCValues;
-
-/*
- * Graphics context.  The contents of this structure are implementation
- * dependent.  A GC should be treated as opaque by application code.
- */
-
-typedef struct _XGC
-#ifdef XLIB_ILLEGAL_ACCESS
-{
-    XExtData *ext_data;	/* hook for extension to hang data */
-    GContext gid;	/* protocol ID for graphics context */
-    /* there is more to this structure, but it is private to Xlib */
-}
-#endif
-*GC;
-
-/*
- * Visual structure; contains information about colormapping possible.
- */
-typedef struct {
-	XExtData *ext_data;	/* hook for extension to hang data */
-	VisualID visualid;	/* visual id of this visual */
-#if defined(__cplusplus) || defined(c_plusplus)
-	int c_class;		/* C++ class of screen (monochrome, etc.) */
-#else
-	int class;		/* class of screen (monochrome, etc.) */
-#endif
-	unsigned long red_mask, green_mask, blue_mask;	/* mask values */
-	int bits_per_rgb;	/* log base 2 of distinct color values */
-	int map_entries;	/* color map entries */
-} Visual;
-
-/*
- * Depth structure; contains information for each possible depth.
- */	
-typedef struct {
-	int depth;		/* this depth (Z) of the depth */
-	int nvisuals;		/* number of Visual types at this depth */
-	Visual *visuals;	/* list of visuals possible at this depth */
-} Depth;
-
-/*
- * Information about the screen.  The contents of this structure are
- * implementation dependent.  A Screen should be treated as opaque
- * by application code.
- */
-
-struct _XDisplay;		/* Forward declare before use for C++ */
-
-typedef struct {
-	XExtData *ext_data;	/* hook for extension to hang data */
-	struct _XDisplay *display;/* back pointer to display structure */
-	Window root;		/* Root window id. */
-	int width, height;	/* width and height of screen */
-	int mwidth, mheight;	/* width and height of  in millimeters */
-	int ndepths;		/* number of depths possible */
-	Depth *depths;		/* list of allowable depths on the screen */
-	int root_depth;		/* bits per pixel */
-	Visual *root_visual;	/* root visual */
-	GC default_gc;		/* GC for the root root visual */
-	Colormap cmap;		/* default color map */
-	unsigned long white_pixel;
-	unsigned long black_pixel;	/* White and Black pixel values */
-	int max_maps, min_maps;	/* max and min color maps */
-	int backing_store;	/* Never, WhenMapped, Always */
-	Bool save_unders;	
-	long root_input_mask;	/* initial root input mask */
-} Screen;
-
-/*
- * Format structure; describes ZFormat data the screen will understand.
- */
-typedef struct {
-	XExtData *ext_data;	/* hook for extension to hang data */
-	int depth;		/* depth of this image format */
-	int bits_per_pixel;	/* bits/pixel at this depth */
-	int scanline_pad;	/* scanline must padded to this multiple */
-} ScreenFormat;
-
-/*
- * Data structure for setting window attributes.
- */
-typedef struct {
-    Pixmap background_pixmap;	/* background or None or ParentRelative */
-    unsigned long background_pixel;	/* background pixel */
-    Pixmap border_pixmap;	/* border of the window */
-    unsigned long border_pixel;	/* border pixel value */
-    int bit_gravity;		/* one of bit gravity values */
-    int win_gravity;		/* one of the window gravity values */
-    int backing_store;		/* NotUseful, WhenMapped, Always */
-    unsigned long backing_planes;/* planes to be preseved if possible */
-    unsigned long backing_pixel;/* value to use in restoring planes */
-    Bool save_under;		/* should bits under be saved? (popups) */
-    long event_mask;		/* set of events that should be saved */
-    long do_not_propagate_mask;	/* set of events that should not propagate */
-    Bool override_redirect;	/* boolean value for override-redirect */
-    Colormap colormap;		/* color map to be associated with window */
-    Cursor cursor;		/* cursor to be displayed (or None) */
-} XSetWindowAttributes;
-
-typedef struct {
-    int x, y;			/* location of window */
-    int width, height;		/* width and height of window */
-    int border_width;		/* border width of window */
-    int depth;          	/* depth of window */
-    Visual *visual;		/* the associated visual structure */
-    Window root;        	/* root of screen containing window */
-#if defined(__cplusplus) || defined(c_plusplus)
-    int c_class;		/* C++ InputOutput, InputOnly*/
-#else
-    int class;			/* InputOutput, InputOnly*/
-#endif
-    int bit_gravity;		/* one of bit gravity values */
-    int win_gravity;		/* one of the window gravity values */
-    int backing_store;		/* NotUseful, WhenMapped, Always */
-    unsigned long backing_planes;/* planes to be preserved if possible */
-    unsigned long backing_pixel;/* value to be used when restoring planes */
-    Bool save_under;		/* boolean, should bits under be saved? */
-    Colormap colormap;		/* color map to be associated with window */
-    Bool map_installed;		/* boolean, is color map currently installed*/
-    int map_state;		/* IsUnmapped, IsUnviewable, IsViewable */
-    long all_event_masks;	/* set of events all people have interest in*/
-    long your_event_mask;	/* my event mask */
-    long do_not_propagate_mask; /* set of events that should not propagate */
-    Bool override_redirect;	/* boolean value for override-redirect */
-    Screen *screen;		/* back pointer to correct screen */
-} XWindowAttributes;
-
-/*
- * Data structure for host setting; getting routines.
- *
- */
-
-typedef struct {
-	int family;		/* for example FamilyInternet */
-	int length;		/* length of address, in bytes */
-	char *address;		/* pointer to where to find the bytes */
-} XHostAddress;
-
-/*
- * Data structure for "image" data, used by image manipulation routines.
- */
-typedef struct _XImage {
-    int width, height;		/* size of image */
-    int xoffset;		/* number of pixels offset in X direction */
-    int format;			/* XYBitmap, XYPixmap, ZPixmap */
-    char *data;			/* pointer to image data */
-    int byte_order;		/* data byte order, LSBFirst, MSBFirst */
-    int bitmap_unit;		/* quant. of scanline 8, 16, 32 */
-    int bitmap_bit_order;	/* LSBFirst, MSBFirst */
-    int bitmap_pad;		/* 8, 16, 32 either XY or ZPixmap */
-    int depth;			/* depth of image */
-    int bytes_per_line;		/* accelarator to next line */
-    int bits_per_pixel;		/* bits per pixel (ZPixmap) */
-    unsigned long red_mask;	/* bits in z arrangment */
-    unsigned long green_mask;
-    unsigned long blue_mask;
-    XPointer obdata;		/* hook for the object routines to hang on */
-    struct funcs {		/* image manipulation routines */
-#if NeedFunctionPrototypes
-	struct _XImage *(*create_image)(
-		struct _XDisplay* /* display */,
-		Visual*		/* visual */,
-		unsigned int	/* depth */,
-		int		/* format */,
-		int		/* offset */,
-		char*		/* data */,
-		unsigned int	/* width */,
-		unsigned int	/* height */,
-		int		/* bitmap_pad */,
-		int		/* bytes_per_line */);
-	int (*destroy_image)        (struct _XImage *);
-	unsigned long (*get_pixel)  (struct _XImage *, int, int);
-	int (*put_pixel)            (struct _XImage *, int, int, unsigned long);
-	struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
-	int (*add_pixel)            (struct _XImage *, long);
-#else
-	struct _XImage *(*create_image)();
-	int (*destroy_image)();
-	unsigned long (*get_pixel)();
-	int (*put_pixel)();
-	struct _XImage *(*sub_image)();
-	int (*add_pixel)();
-#endif
-	} f;
-} XImage;
-
-/* 
- * Data structure for XReconfigureWindow
- */
-typedef struct {
-    int x, y;
-    int width, height;
-    int border_width;
-    Window sibling;
-    int stack_mode;
-} XWindowChanges;
-
-/*
- * Data structure used by color operations
- */
-typedef struct {
-	unsigned long pixel;
-	unsigned short red, green, blue;
-	char flags;  /* do_red, do_green, do_blue */
-	char pad;
-} XColor;
-
-/* 
- * Data structures for graphics operations.  On most machines, these are
- * congruent with the wire protocol structures, so reformatting the data
- * can be avoided on these architectures.
- */
-typedef struct {
-    short x1, y1, x2, y2;
-} XSegment;
-
-typedef struct {
-    short x, y;
-} XPoint;
-    
-typedef struct {
-    short x, y;
-    unsigned short width, height;
-} XRectangle;
-    
-typedef struct {
-    short x, y;
-    unsigned short width, height;
-    short angle1, angle2;
-} XArc;
-
-
-/* Data structure for XChangeKeyboardControl */
-
-typedef struct {
-        int key_click_percent;
-        int bell_percent;
-        int bell_pitch;
-        int bell_duration;
-        int led;
-        int led_mode;
-        int key;
-        int auto_repeat_mode;   /* On, Off, Default */
-} XKeyboardControl;
-
-/* Data structure for XGetKeyboardControl */
-
-typedef struct {
-        int key_click_percent;
-	int bell_percent;
-	unsigned int bell_pitch, bell_duration;
-	unsigned long led_mask;
-	int global_auto_repeat;
-	char auto_repeats[32];
-} XKeyboardState;
-
-/* Data structure for XGetMotionEvents.  */
-
-typedef struct {
-        Time time;
-	short x, y;
-} XTimeCoord;
-
-/* Data structure for X{Set,Get}ModifierMapping */
-
-typedef struct {
- 	int max_keypermod;	/* The server's max # of keys per modifier */
- 	KeyCode *modifiermap;	/* An 8 by max_keypermod array of modifiers */
-} XModifierKeymap;
-
-
-/*
- * Display datatype maintaining display specific data.
- * The contents of this structure are implementation dependent.
- * A Display should be treated as opaque by application code.
- */
-#ifndef XLIB_ILLEGAL_ACCESS
-typedef struct _XDisplay Display;
-#endif
-
-struct _XPrivate;		/* Forward declare before use for C++ */
-struct _XrmHashBucketRec;
-
-typedef struct 
-#ifdef XLIB_ILLEGAL_ACCESS
-_XDisplay
-#endif
-{
-	XExtData *ext_data;	/* hook for extension to hang data */
-	struct _XPrivate *private1;
-	int fd;			/* Network socket. */
-	int private2;
-	int proto_major_version;/* major version of server's X protocol */
-	int proto_minor_version;/* minor version of servers X protocol */
-	char *vendor;		/* vendor of the server hardware */
-        XID private3;
-	XID private4;
-	XID private5;
-	int private6;
-	XID (*resource_alloc)(	/* allocator function */
-#if NeedFunctionPrototypes
-		struct _XDisplay*
-#endif
-	);
-	int byte_order;		/* screen byte order, LSBFirst, MSBFirst */
-	int bitmap_unit;	/* padding and data requirements */
-	int bitmap_pad;		/* padding requirements on bitmaps */
-	int bitmap_bit_order;	/* LeastSignificant or MostSignificant */
-	int nformats;		/* number of pixmap formats in list */
-	ScreenFormat *pixmap_format;	/* pixmap format list */
-	int private8;
-	int release;		/* release of the server */
-	struct _XPrivate *private9, *private10;
-	int qlen;		/* Length of input event queue */
-	unsigned long last_request_read; /* seq number of last event read */
-	unsigned long request;	/* sequence number of last request. */
-	XPointer private11;
-	XPointer private12;
-	XPointer private13;
-	XPointer private14;
-	unsigned max_request_size; /* maximum number 32 bit words in request*/
-	struct _XrmHashBucketRec *db;
-	int (*private15)(
-#if NeedFunctionPrototypes
-		struct _XDisplay*
-#endif
-		);
-	char *display_name;	/* "host:display" string used on this connect*/
-	int default_screen;	/* default screen for operations */
-	int nscreens;		/* number of screens on this server*/
-	Screen *screens;	/* pointer to list of screens */
-	unsigned long motion_buffer;	/* size of motion buffer */
-	unsigned long private16;
-	int min_keycode;	/* minimum defined keycode */
-	int max_keycode;	/* maximum defined keycode */
-	XPointer private17;
-	XPointer private18;
-	int private19;
-	char *xdefaults;	/* contents of defaults from server */
-	/* there is more to this structure, but it is private to Xlib */
-}
-#ifdef XLIB_ILLEGAL_ACCESS
-Display, 
-#endif
-*_XPrivDisplay;
-
-#if NeedFunctionPrototypes	/* prototypes require event type definitions */
-#undef _XEVENT_
-#endif
-#ifndef _XEVENT_
-/*
- * Definitions of specific events.
- */
-typedef struct {
-	int type;		/* of event */
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;	        /* "event" window it is reported relative to */
-	Window root;	        /* root window that the event occurred on */
-	Window subwindow;	/* child window */
-	Time time;		/* milliseconds */
-	int x, y;		/* pointer x, y coordinates in event window */
-	int x_root, y_root;	/* coordinates relative to root */
-	unsigned int state;	/* key or button mask */
-	unsigned int keycode;	/* detail */
-	Bool same_screen;	/* same screen flag */
-} XKeyEvent;
-typedef XKeyEvent XKeyPressedEvent;
-typedef XKeyEvent XKeyReleasedEvent;
-
-typedef struct {
-	int type;		/* of event */
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;	        /* "event" window it is reported relative to */
-	Window root;	        /* root window that the event occurred on */
-	Window subwindow;	/* child window */
-	Time time;		/* milliseconds */
-	int x, y;		/* pointer x, y coordinates in event window */
-	int x_root, y_root;	/* coordinates relative to root */
-	unsigned int state;	/* key or button mask */
-	unsigned int button;	/* detail */
-	Bool same_screen;	/* same screen flag */
-} XButtonEvent;
-typedef XButtonEvent XButtonPressedEvent;
-typedef XButtonEvent XButtonReleasedEvent;
-
-typedef struct {
-	int type;		/* of event */
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;	        /* "event" window reported relative to */
-	Window root;	        /* root window that the event occurred on */
-	Window subwindow;	/* child window */
-	Time time;		/* milliseconds */
-	int x, y;		/* pointer x, y coordinates in event window */
-	int x_root, y_root;	/* coordinates relative to root */
-	unsigned int state;	/* key or button mask */
-	char is_hint;		/* detail */
-	Bool same_screen;	/* same screen flag */
-} XMotionEvent;
-typedef XMotionEvent XPointerMovedEvent;
-
-typedef struct {
-	int type;		/* of event */
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;	        /* "event" window reported relative to */
-	Window root;	        /* root window that the event occurred on */
-	Window subwindow;	/* child window */
-	Time time;		/* milliseconds */
-	int x, y;		/* pointer x, y coordinates in event window */
-	int x_root, y_root;	/* coordinates relative to root */
-	int mode;		/* NotifyNormal, NotifyGrab, NotifyUngrab */
-	int detail;
-	/*
-	 * NotifyAncestor, NotifyVirtual, NotifyInferior, 
-	 * NotifyNonlinear,NotifyNonlinearVirtual
-	 */
-	Bool same_screen;	/* same screen flag */
-	Bool focus;		/* boolean focus */
-	unsigned int state;	/* key or button mask */
-} XCrossingEvent;
-typedef XCrossingEvent XEnterWindowEvent;
-typedef XCrossingEvent XLeaveWindowEvent;
-
-typedef struct {
-	int type;		/* FocusIn or FocusOut */
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;		/* window of event */
-	int mode;		/* NotifyNormal, NotifyGrab, NotifyUngrab */
-	int detail;
-	/*
-	 * NotifyAncestor, NotifyVirtual, NotifyInferior, 
-	 * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
-	 * NotifyPointerRoot, NotifyDetailNone 
-	 */
-} XFocusChangeEvent;
-typedef XFocusChangeEvent XFocusInEvent;
-typedef XFocusChangeEvent XFocusOutEvent;
-
-/* generated on EnterWindow and FocusIn  when KeyMapState selected */
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	char key_vector[32];
-} XKeymapEvent;	
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	int x, y;
-	int width, height;
-	int count;		/* if non-zero, at least this many more */
-} XExposeEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Drawable drawable;
-	int x, y;
-	int width, height;
-	int count;		/* if non-zero, at least this many more */
-	int major_code;		/* core is CopyArea or CopyPlane */
-	int minor_code;		/* not defined in the core */
-} XGraphicsExposeEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Drawable drawable;
-	int major_code;		/* core is CopyArea or CopyPlane */
-	int minor_code;		/* not defined in the core */
-} XNoExposeEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	int state;		/* Visibility state */
-} XVisibilityEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window parent;		/* parent of the window */
-	Window window;		/* window id of window created */
-	int x, y;		/* window location */
-	int width, height;	/* size of window */
-	int border_width;	/* border width */
-	Bool override_redirect;	/* creation should be overridden */
-} XCreateWindowEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-} XDestroyWindowEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-	Bool from_configure;
-} XUnmapEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-	Bool override_redirect;	/* boolean, is override set... */
-} XMapEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window parent;
-	Window window;
-} XMapRequestEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-	Window parent;
-	int x, y;
-	Bool override_redirect;
-} XReparentEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-	int x, y;
-	int width, height;
-	int border_width;
-	Window above;
-	Bool override_redirect;
-} XConfigureEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-	int x, y;
-} XGravityEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	int width, height;
-} XResizeRequestEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window parent;
-	Window window;
-	int x, y;
-	int width, height;
-	int border_width;
-	Window above;
-	int detail;		/* Above, Below, TopIf, BottomIf, Opposite */
-	unsigned long value_mask;
-} XConfigureRequestEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window event;
-	Window window;
-	int place;		/* PlaceOnTop, PlaceOnBottom */
-} XCirculateEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window parent;
-	Window window;
-	int place;		/* PlaceOnTop, PlaceOnBottom */
-} XCirculateRequestEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	Atom atom;
-	Time time;
-	int state;		/* NewValue, Deleted */
-} XPropertyEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	Atom selection;
-	Time time;
-} XSelectionClearEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window owner;
-	Window requestor;
-	Atom selection;
-	Atom target;
-	Atom property;
-	Time time;
-} XSelectionRequestEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window requestor;
-	Atom selection;
-	Atom target;
-	Atom property;		/* ATOM or None */
-	Time time;
-} XSelectionEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	Colormap colormap;	/* COLORMAP or None */
-#if defined(__cplusplus) || defined(c_plusplus)
-	Bool c_new;		/* C++ */
-#else
-	Bool new;
-#endif
-	int state;		/* ColormapInstalled, ColormapUninstalled */
-} XColormapEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;
-	Atom message_type;
-	int format;
-	union {
-		char b[20];
-		short s[10];
-		long l[5];
-		} data;
-} XClientMessageEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;	/* Display the event was read from */
-	Window window;		/* unused */
-	int request;		/* one of MappingModifier, MappingKeyboard,
-				   MappingPointer */
-	int first_keycode;	/* first keycode */
-	int count;		/* defines range of change w. first_keycode*/
-} XMappingEvent;
-
-typedef struct {
-	int type;
-	Display *display;	/* Display the event was read from */
-	XID resourceid;		/* resource id */
-	unsigned long serial;	/* serial number of failed request */
-	unsigned char error_code;	/* error code of failed request */
-	unsigned char request_code;	/* Major op-code of failed request */
-	unsigned char minor_code;	/* Minor op-code of failed request */
-} XErrorEvent;
-
-typedef struct {
-	int type;
-	unsigned long serial;	/* # of last request processed by server */
-	Bool send_event;	/* true if this came from a SendEvent request */
-	Display *display;/* Display the event was read from */
-	Window window;	/* window on which event was requested in event mask */
-} XAnyEvent;
-
-/*
- * this union is defined so Xlib can always use the same sized
- * event structure internally, to avoid memory fragmentation.
- */
-typedef union _XEvent {
-        int type;		/* must not be changed; first element */
-	XAnyEvent xany;
-	XKeyEvent xkey;
-	XButtonEvent xbutton;
-	XMotionEvent xmotion;
-	XCrossingEvent xcrossing;
-	XFocusChangeEvent xfocus;
-	XExposeEvent xexpose;
-	XGraphicsExposeEvent xgraphicsexpose;
-	XNoExposeEvent xnoexpose;
-	XVisibilityEvent xvisibility;
-	XCreateWindowEvent xcreatewindow;
-	XDestroyWindowEvent xdestroywindow;
-	XUnmapEvent xunmap;
-	XMapEvent xmap;
-	XMapRequestEvent xmaprequest;
-	XReparentEvent xreparent;
-	XConfigureEvent xconfigure;
-	XGravityEvent xgravity;
-	XResizeRequestEvent xresizerequest;
-	XConfigureRequestEvent xconfigurerequest;
-	XCirculateEvent xcirculate;
-	XCirculateRequestEvent xcirculaterequest;
-	XPropertyEvent xproperty;
-	XSelectionClearEvent xselectionclear;
-	XSelectionRequestEvent xselectionrequest;
-	XSelectionEvent xselection;
-	XColormapEvent xcolormap;
-	XClientMessageEvent xclient;
-	XMappingEvent xmapping;
-	XErrorEvent xerror;
-	XKeymapEvent xkeymap;
-	long pad[24];
-} XEvent;
-#endif
-
-#define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))
-
-/*
- * per character font metric information.
- */
-typedef struct {
-    short	lbearing;	/* origin to left edge of raster */
-    short	rbearing;	/* origin to right edge of raster */
-    short	width;		/* advance to next char's origin */
-    short	ascent;		/* baseline to top edge of raster */
-    short	descent;	/* baseline to bottom edge of raster */
-    unsigned short attributes;	/* per char flags (not predefined) */
-} XCharStruct;
-
-/*
- * To allow arbitrary information with fonts, there are additional properties
- * returned.
- */
-typedef struct {
-    Atom name;
-    unsigned long card32;
-} XFontProp;
-
-typedef struct {
-    XExtData	*ext_data;	/* hook for extension to hang data */
-    Font        fid;            /* Font id for this font */
-    unsigned	direction;	/* hint about direction the font is painted */
-    unsigned	min_char_or_byte2;/* first character */
-    unsigned	max_char_or_byte2;/* last character */
-    unsigned	min_byte1;	/* first row that exists */
-    unsigned	max_byte1;	/* last row that exists */
-    Bool	all_chars_exist;/* flag if all characters have non-zero size*/
-    unsigned	default_char;	/* char to print for undefined character */
-    int         n_properties;   /* how many properties there are */
-    XFontProp	*properties;	/* pointer to array of additional properties*/
-    XCharStruct	min_bounds;	/* minimum bounds over all existing char*/
-    XCharStruct	max_bounds;	/* maximum bounds over all existing char*/
-    XCharStruct	*per_char;	/* first_char to last_char information */
-    int		ascent;		/* log. extent above baseline for spacing */
-    int		descent;	/* log. descent below baseline for spacing */
-} XFontStruct;
-
-/*
- * PolyText routines take these as arguments.
- */
-typedef struct {
-    char *chars;		/* pointer to string */
-    int nchars;			/* number of characters */
-    int delta;			/* delta between strings */
-    Font font;			/* font to print it in, None don't change */
-} XTextItem;
-
-typedef struct {		/* normal 16 bit characters are two bytes */
-    unsigned char byte1;
-    unsigned char byte2;
-} XChar2b;
-
-typedef struct {
-    XChar2b *chars;		/* two byte characters */
-    int nchars;			/* number of characters */
-    int delta;			/* delta between strings */
-    Font font;			/* font to print it in, None don't change */
-} XTextItem16;
-
-
-typedef union { Display *display;
-		GC gc;
-		Visual *visual;
-		Screen *screen;
-		ScreenFormat *pixmap_format;
-		XFontStruct *font; } XEDataObject;
-
-typedef struct {
-    XRectangle      max_ink_extent;
-    XRectangle      max_logical_extent;
-} XFontSetExtents;
-
-/* unused:
-typedef void (*XOMProc)();
- */
-
-typedef struct _XOM *XOM;
-typedef struct _XOC *XOC, *XFontSet;
-
-typedef struct {
-    char           *chars;
-    int             nchars;
-    int             delta;
-    XFontSet        font_set;
-} XmbTextItem;
-
-typedef struct {
-    wchar_t        *chars;
-    int             nchars;
-    int             delta;
-    XFontSet        font_set;
-} XwcTextItem;
-
-#define XNRequiredCharSet "requiredCharSet"
-#define XNQueryOrientation "queryOrientation"
-#define XNBaseFontName "baseFontName"
-#define XNOMAutomatic "omAutomatic"
-#define XNMissingCharSet "missingCharSet"
-#define XNDefaultString "defaultString"
-#define XNOrientation "orientation"
-#define XNDirectionalDependentDrawing "directionalDependentDrawing"
-#define XNContextualDrawing "contextualDrawing"
-#define XNFontInfo "fontInfo"
-
-typedef struct {
-    int charset_count;
-    char **charset_list;
-} XOMCharSetList;
-
-typedef enum {
-    XOMOrientation_LTR_TTB,
-    XOMOrientation_RTL_TTB,
-    XOMOrientation_TTB_LTR,
-    XOMOrientation_TTB_RTL,
-    XOMOrientation_Context
-} XOrientation;
-
-typedef struct {
-    int num_orientation;
-    XOrientation *orientation;	/* Input Text description */
-} XOMOrientation;
-
-typedef struct {
-    int num_font;
-    XFontStruct **font_struct_list;
-    char **font_name_list;
-} XOMFontInfo;
-
-typedef struct _XIM *XIM;
-typedef struct _XIC *XIC;
-
-typedef void (*XIMProc)(
-#if NeedFunctionPrototypes
-    XIM,
-    XPointer,
-    XPointer
-#endif
-);
-
-typedef Bool (*XICProc)(
-#if NeedFunctionPrototypes
-    XIC,
-    XPointer,
-    XPointer
-#endif
-);
-
-typedef void (*XIDProc)(
-#if NeedFunctionPrototypes
-    Display*,
-    XPointer,
-    XPointer
-#endif
-);
-
-typedef unsigned long XIMStyle;
-
-typedef struct {
-    unsigned short count_styles;
-    XIMStyle *supported_styles;
-} XIMStyles;
-
-#define XIMPreeditArea		0x0001L
-#define XIMPreeditCallbacks	0x0002L
-#define XIMPreeditPosition	0x0004L
-#define XIMPreeditNothing	0x0008L
-#define XIMPreeditNone		0x0010L
-#define XIMStatusArea		0x0100L
-#define XIMStatusCallbacks	0x0200L
-#define XIMStatusNothing	0x0400L
-#define XIMStatusNone		0x0800L
-
-#define XNVaNestedList "XNVaNestedList"
-#define XNQueryInputStyle "queryInputStyle"
-#define XNClientWindow "clientWindow"
-#define XNInputStyle "inputStyle"
-#define XNFocusWindow "focusWindow"
-#define XNResourceName "resourceName"
-#define XNResourceClass "resourceClass"
-#define XNGeometryCallback "geometryCallback"
-#define XNDestroyCallback "destroyCallback"
-#define XNFilterEvents "filterEvents"
-#define XNPreeditStartCallback "preeditStartCallback"
-#define XNPreeditDoneCallback "preeditDoneCallback"
-#define XNPreeditDrawCallback "preeditDrawCallback"
-#define XNPreeditCaretCallback "preeditCaretCallback"
-#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
-#define XNPreeditAttributes "preeditAttributes"
-#define XNStatusStartCallback "statusStartCallback"
-#define XNStatusDoneCallback "statusDoneCallback"
-#define XNStatusDrawCallback "statusDrawCallback"
-#define XNStatusAttributes "statusAttributes"
-#define XNArea "area"
-#define XNAreaNeeded "areaNeeded"
-#define XNSpotLocation "spotLocation"
-#define XNColormap "colorMap"
-#define XNStdColormap "stdColorMap"
-#define XNForeground "foreground"
-#define XNBackground "background"
-#define XNBackgroundPixmap "backgroundPixmap"
-#define XNFontSet "fontSet"
-#define XNLineSpace "lineSpace"
-#define XNCursor "cursor"
-
-#define XNQueryIMValuesList "queryIMValuesList"
-#define XNQueryICValuesList "queryICValuesList"
-#define XNVisiblePosition "visiblePosition"
-#define XNR6PreeditCallback "r6PreeditCallback"
-#define XNStringConversionCallback "stringConversionCallback"
-#define XNStringConversion "stringConversion"
-#define XNResetState "resetState"
-#define XNHotKey "hotKey"
-#define XNHotKeyState "hotKeyState"
-#define XNPreeditState "preeditState"
-#define XNSeparatorofNestedList "separatorofNestedList"
-
-#define XBufferOverflow		-1
-#define XLookupNone		1
-#define XLookupChars		2
-#define XLookupKeySym		3
-#define XLookupBoth		4
-
-#if NeedFunctionPrototypes
-typedef void *XVaNestedList;
-#else
-typedef XPointer XVaNestedList;
-#endif
-
-typedef struct {
-    XPointer client_data;
-    XIMProc callback;
-} XIMCallback;
-
-typedef struct {
-    XPointer client_data;
-    XICProc callback;
-} XICCallback;
-
-typedef unsigned long XIMFeedback;
-
-#define XIMReverse		1L
-#define XIMUnderline		(1L<<1) 
-#define XIMHighlight		(1L<<2)
-#define XIMPrimary	 	(1L<<5)
-#define XIMSecondary		(1L<<6)
-#define XIMTertiary	 	(1L<<7)
-#define XIMVisibleToForward 	(1L<<8)
-#define XIMVisibleToBackword 	(1L<<9)
-#define XIMVisibleToCenter 	(1L<<10)
-
-typedef struct _XIMText {
-    unsigned short length;
-    XIMFeedback *feedback;
-    Bool encoding_is_wchar; 
-    union {
-	char *multi_byte;
-	wchar_t *wide_char;
-    } string; 
-} XIMText;
-
-typedef	unsigned long	 XIMPreeditState;
-
-#define	XIMPreeditUnKnown	0L
-#define	XIMPreeditEnable	1L
-#define	XIMPreeditDisable	(1L<<1)
-
-typedef	struct	_XIMPreeditStateNotifyCallbackStruct {
-    XIMPreeditState state;
-} XIMPreeditStateNotifyCallbackStruct;
-
-typedef	unsigned long	 XIMResetState;
-
-#define	XIMInitialState		1L
-#define	XIMPreserveState	(1L<<1)
-
-typedef unsigned long XIMStringConversionFeedback;
-
-#define	XIMStringConversionLeftEdge	(0x00000001)
-#define	XIMStringConversionRightEdge	(0x00000002)
-#define	XIMStringConversionTopEdge	(0x00000004)
-#define	XIMStringConversionBottomEdge	(0x00000008)
-#define	XIMStringConversionConcealed	(0x00000010)
-#define	XIMStringConversionWrapped	(0x00000020)
-
-typedef struct _XIMStringConversionText {
-    unsigned short length;
-    XIMStringConversionFeedback *feedback;
-    Bool encoding_is_wchar; 
-    union {
-	char *mbs;
-	wchar_t *wcs;
-    } string; 
-} XIMStringConversionText;
-
-typedef	unsigned short	XIMStringConversionPosition;
-
-typedef	unsigned short	XIMStringConversionType;
-
-#define	XIMStringConversionBuffer	(0x0001)
-#define	XIMStringConversionLine		(0x0002)
-#define	XIMStringConversionWord		(0x0003)
-#define	XIMStringConversionChar		(0x0004)
-
-typedef	unsigned short	XIMStringConversionOperation;
-
-#define	XIMStringConversionSubstitution	(0x0001)
-#define	XIMStringConversionRetrieval	(0x0002)
-
-typedef enum {
-    XIMForwardChar, XIMBackwardChar,
-    XIMForwardWord, XIMBackwardWord,
-    XIMCaretUp, XIMCaretDown,
-    XIMNextLine, XIMPreviousLine,
-    XIMLineStart, XIMLineEnd, 
-    XIMAbsolutePosition,
-    XIMDontChange
-} XIMCaretDirection;
-
-typedef struct _XIMStringConversionCallbackStruct {
-    XIMStringConversionPosition position;
-    XIMCaretDirection direction;
-    XIMStringConversionOperation operation;
-    unsigned short factor;
-    XIMStringConversionText *text;
-} XIMStringConversionCallbackStruct;
-
-typedef struct _XIMPreeditDrawCallbackStruct {
-    int caret;		/* Cursor offset within pre-edit string */
-    int chg_first;	/* Starting change position */
-    int chg_length;	/* Length of the change in character count */
-    XIMText *text;
-} XIMPreeditDrawCallbackStruct;
-
-typedef enum {
-    XIMIsInvisible,	/* Disable caret feedback */ 
-    XIMIsPrimary,	/* UI defined caret feedback */
-    XIMIsSecondary	/* UI defined caret feedback */
-} XIMCaretStyle;
-
-typedef struct _XIMPreeditCaretCallbackStruct {
-    int position;		 /* Caret offset within pre-edit string */
-    XIMCaretDirection direction; /* Caret moves direction */
-    XIMCaretStyle style;	 /* Feedback of the caret */
-} XIMPreeditCaretCallbackStruct;
-
-typedef enum {
-    XIMTextType,
-    XIMBitmapType
-} XIMStatusDataType;
-	
-typedef struct _XIMStatusDrawCallbackStruct {
-    XIMStatusDataType type;
-    union {
-	XIMText *text;
-	Pixmap  bitmap;
-    } data;
-} XIMStatusDrawCallbackStruct;
-
-typedef struct _XIMHotKeyTrigger {
-    KeySym	 keysym;
-    int		 modifier;
-    int		 modifier_mask;
-} XIMHotKeyTrigger;
-
-typedef struct _XIMHotKeyTriggers {
-    int			 num_hot_key;
-    XIMHotKeyTrigger	*key;
-} XIMHotKeyTriggers;
-
-typedef	unsigned long	 XIMHotKeyState;
-
-#define	XIMHotKeyStateON	(0x0001L)
-#define	XIMHotKeyStateOFF	(0x0002L)
-
-typedef struct {
-    unsigned short count_values;
-    char **supported_values;
-} XIMValuesList;
-
-#if 0
-_XFUNCPROTOBEGIN
-
-#if defined(WIN32) && !defined(_XLIBINT_)
-#define _Xdebug (*_Xdebug_p)
-#endif
-
-extern int _Xdebug;
-
-extern XFontStruct *XLoadQueryFont(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* name */
-#endif
-);
-
-extern XFontStruct *XQueryFont(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* font_ID */
-#endif
-);
-
-
-extern XTimeCoord *XGetMotionEvents(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Time		/* start */,
-    Time		/* stop */,
-    int*		/* nevents_return */
-#endif
-);
-
-extern XModifierKeymap *XDeleteModifiermapEntry(
-#if NeedFunctionPrototypes
-    XModifierKeymap*	/* modmap */,
-#if NeedWidePrototypes
-    unsigned int	/* keycode_entry */,
-#else
-    KeyCode		/* keycode_entry */,
-#endif
-    int			/* modifier */
-#endif
-);
-
-extern XModifierKeymap	*XGetModifierMapping(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern XModifierKeymap	*XInsertModifiermapEntry(
-#if NeedFunctionPrototypes
-    XModifierKeymap*	/* modmap */,
-#if NeedWidePrototypes
-    unsigned int	/* keycode_entry */,
-#else
-    KeyCode		/* keycode_entry */,
-#endif
-    int			/* modifier */    
-#endif
-);
-
-extern XModifierKeymap *XNewModifiermap(
-#if NeedFunctionPrototypes
-    int			/* max_keys_per_mod */
-#endif
-);
-
-extern XImage *XCreateImage(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Visual*		/* visual */,
-    unsigned int	/* depth */,
-    int			/* format */,
-    int			/* offset */,
-    char*		/* data */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    int			/* bitmap_pad */,
-    int			/* bytes_per_line */
-#endif
-);
-extern Status XInitImage(
-#if NeedFunctionPrototypes
-    XImage*		/* image */
-#endif
-);
-extern XImage *XGetImage(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned long	/* plane_mask */,
-    int			/* format */
-#endif
-);
-extern XImage *XGetSubImage(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned long	/* plane_mask */,
-    int			/* format */,
-    XImage*		/* dest_image */,
-    int			/* dest_x */,
-    int			/* dest_y */
-#endif
-);
-
-/* 
- * X function declarations.
- */
-extern Display *XOpenDisplay(
-#if NeedFunctionPrototypes
-    _Xconst char*	/* display_name */
-#endif
-);
-
-extern void XrmInitialize(
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern char *XFetchBytes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* nbytes_return */
-#endif
-);
-extern char *XFetchBuffer(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* nbytes_return */,
-    int			/* buffer */
-#endif
-);
-extern char *XGetAtomName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Atom		/* atom */
-#endif
-);
-extern Status XGetAtomNames(
-#if NeedFunctionPrototypes
-    Display*		/* dpy */,
-    Atom*		/* atoms */,
-    int			/* count */,
-    char**		/* names_return */
-#endif
-);
-extern char *XGetDefault(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* program */,
-    _Xconst char*	/* option */		  
-#endif
-);
-extern char *XDisplayName(
-#if NeedFunctionPrototypes
-    _Xconst char*	/* string */
-#endif
-);
-extern char *XKeysymToString(
-#if NeedFunctionPrototypes
-    KeySym		/* keysym */
-#endif
-);
-
-extern int (*XSynchronize(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Bool		/* onoff */
-#endif
-))(
-#if NeedNestedPrototypes
-    Display*		/* display */
-#endif
-);
-extern int (*XSetAfterFunction(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int (*) (
-#if NeedNestedPrototypes
-	     Display*	/* display */
-#endif
-            )		/* procedure */
-#endif
-))(
-#if NeedNestedPrototypes
-    Display*		/* display */
-#endif
-);
-extern Atom XInternAtom(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* atom_name */,
-    Bool		/* only_if_exists */		 
-#endif
-);
-extern Status XInternAtoms(
-#if NeedFunctionPrototypes
-    Display*		/* dpy */,
-    char**		/* names */,
-    int			/* count */,
-    Bool		/* onlyIfExists */,
-    Atom*		/* atoms_return */
-#endif
-);
-extern Colormap XCopyColormapAndFree(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */
-#endif
-);
-extern Colormap XCreateColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Visual*		/* visual */,
-    int			/* alloc */			 
-#endif
-);
-extern Cursor XCreatePixmapCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Pixmap		/* source */,
-    Pixmap		/* mask */,
-    XColor*		/* foreground_color */,
-    XColor*		/* background_color */,
-    unsigned int	/* x */,
-    unsigned int	/* y */			   
-#endif
-);
-extern Cursor XCreateGlyphCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Font		/* source_font */,
-    Font		/* mask_font */,
-    unsigned int	/* source_char */,
-    unsigned int	/* mask_char */,
-    XColor _Xconst *	/* foreground_color */,
-    XColor _Xconst *	/* background_color */
-#endif
-);
-extern Cursor XCreateFontCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    unsigned int	/* shape */
-#endif
-);
-extern Font XLoadFont(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* name */
-#endif
-);
-extern GC XCreateGC(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    unsigned long	/* valuemask */,
-    XGCValues*		/* values */
-#endif
-);
-extern GContext XGContextFromGC(
-#if NeedFunctionPrototypes
-    GC			/* gc */
-#endif
-);
-extern void XFlushGC(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */
-#endif
-);
-extern Pixmap XCreatePixmap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned int	/* depth */		        
-#endif
-);
-extern Pixmap XCreateBitmapFromData(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    _Xconst char*	/* data */,
-    unsigned int	/* width */,
-    unsigned int	/* height */
-#endif
-);
-extern Pixmap XCreatePixmapFromBitmapData(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    char*		/* data */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned long	/* fg */,
-    unsigned long	/* bg */,
-    unsigned int	/* depth */
-#endif
-);
-extern Window XCreateSimpleWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* parent */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned int	/* border_width */,
-    unsigned long	/* border */,
-    unsigned long	/* background */
-#endif
-);
-extern Window XGetSelectionOwner(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Atom		/* selection */
-#endif
-);
-extern Window XCreateWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* parent */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned int	/* border_width */,
-    int			/* depth */,
-    unsigned int	/* class */,
-    Visual*		/* visual */,
-    unsigned long	/* valuemask */,
-    XSetWindowAttributes*	/* attributes */
-#endif
-); 
-extern Colormap *XListInstalledColormaps(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int*		/* num_return */
-#endif
-);
-extern char **XListFonts(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* pattern */,
-    int			/* maxnames */,
-    int*		/* actual_count_return */
-#endif
-);
-extern char **XListFontsWithInfo(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* pattern */,
-    int			/* maxnames */,
-    int*		/* count_return */,
-    XFontStruct**	/* info_return */
-#endif
-);
-extern char **XGetFontPath(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* npaths_return */
-#endif
-);
-extern char **XListExtensions(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* nextensions_return */
-#endif
-);
-extern Atom *XListProperties(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int*		/* num_prop_return */
-#endif
-);
-extern XHostAddress *XListHosts(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* nhosts_return */,
-    Bool*		/* state_return */
-#endif
-);
-extern KeySym XKeycodeToKeysym(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-#if NeedWidePrototypes
-    unsigned int	/* keycode */,
-#else
-    KeyCode		/* keycode */,
-#endif
-    int			/* index */
-#endif
-);
-extern KeySym XLookupKeysym(
-#if NeedFunctionPrototypes
-    XKeyEvent*		/* key_event */,
-    int			/* index */
-#endif
-);
-extern KeySym *XGetKeyboardMapping(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-#if NeedWidePrototypes
-    unsigned int	/* first_keycode */,
-#else
-    KeyCode		/* first_keycode */,
-#endif
-    int			/* keycode_count */,
-    int*		/* keysyms_per_keycode_return */
-#endif
-);
-extern KeySym XStringToKeysym(
-#if NeedFunctionPrototypes
-    _Xconst char*	/* string */
-#endif
-);
-extern long XMaxRequestSize(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern long XExtendedMaxRequestSize(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern char *XResourceManagerString(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern char *XScreenResourceString(
-#if NeedFunctionPrototypes
-	Screen*		/* screen */
-#endif
-);
-extern unsigned long XDisplayMotionBufferSize(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern VisualID XVisualIDFromVisual(
-#if NeedFunctionPrototypes
-    Visual*		/* visual */
-#endif
-);
-
-/* multithread routines */
-
-extern Status XInitThreads(
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern void XLockDisplay(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern void XUnlockDisplay(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-/* routines for dealing with extensions */
-
-extern XExtCodes *XInitExtension(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* name */
-#endif
-);
-
-extern XExtCodes *XAddExtension(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern XExtData *XFindOnExtensionList(
-#if NeedFunctionPrototypes
-    XExtData**		/* structure */,
-    int			/* number */
-#endif
-);
-extern XExtData **XEHeadOfExtensionList(
-#if NeedFunctionPrototypes
-    XEDataObject	/* object */
-#endif
-);
-
-/* these are routines for which there are also macros */
-extern Window XRootWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern Window XDefaultRootWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern Window XRootWindowOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern Visual *XDefaultVisual(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern Visual *XDefaultVisualOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern GC XDefaultGC(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern GC XDefaultGCOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern unsigned long XBlackPixel(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern unsigned long XWhitePixel(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern unsigned long XAllPlanes(
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-extern unsigned long XBlackPixelOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern unsigned long XWhitePixelOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern unsigned long XNextRequest(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern unsigned long XLastKnownRequestProcessed(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern char *XServerVendor(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern char *XDisplayString(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern Colormap XDefaultColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern Colormap XDefaultColormapOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern Display *XDisplayOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-extern Screen *XScreenOfDisplay(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-extern Screen *XDefaultScreenOfDisplay(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-extern long XEventMaskOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XScreenNumberOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-typedef int (*XErrorHandler) (	    /* WARNING, this type not in Xlib spec */
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XErrorEvent*	/* error_event */
-#endif
-);
-
-extern XErrorHandler XSetErrorHandler (
-#if NeedFunctionPrototypes
-    XErrorHandler	/* handler */
-#endif
-);
-
-
-typedef int (*XIOErrorHandler) (    /* WARNING, this type not in Xlib spec */
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern XIOErrorHandler XSetIOErrorHandler (
-#if NeedFunctionPrototypes
-    XIOErrorHandler	/* handler */
-#endif
-);
-
-extern XPixmapFormatValues *XListPixmapFormats(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* count_return */
-#endif
-);
-extern int *XListDepths(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */,
-    int*		/* count_return */
-#endif
-);
-
-/* ICCCM routines for things that don't require special include files; */
-/* other declarations are given in Xutil.h                             */
-extern Status XReconfigureWMWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* screen_number */,
-    unsigned int	/* mask */,
-    XWindowChanges*	/* changes */
-#endif
-);
-
-extern Status XGetWMProtocols(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Atom**		/* protocols_return */,
-    int*		/* count_return */
-#endif
-);
-extern Status XSetWMProtocols(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Atom*		/* protocols */,
-    int			/* count */
-#endif
-);
-extern Status XIconifyWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* screen_number */
-#endif
-);
-extern Status XWithdrawWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* screen_number */
-#endif
-);
-extern Status XGetCommand(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    char***		/* argv_return */,
-    int*		/* argc_return */
-#endif
-);
-extern Status XGetWMColormapWindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window**		/* windows_return */,
-    int*		/* count_return */
-#endif
-);
-extern Status XSetWMColormapWindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window*		/* colormap_windows */,
-    int			/* count */
-#endif
-);
-extern void XFreeStringList(
-#if NeedFunctionPrototypes
-    char**		/* list */
-#endif
-);
-extern int XSetTransientForHint(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window		/* prop_window */
-#endif
-);
-
-/* The following are given in alphabetical order */
-
-extern int XActivateScreenSaver(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XAddHost(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XHostAddress*	/* host */
-#endif
-);
-
-extern int XAddHosts(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XHostAddress*	/* hosts */,
-    int			/* num_hosts */    
-#endif
-);
-
-extern int XAddToExtensionList(
-#if NeedFunctionPrototypes
-    struct _XExtData**	/* structure */,
-    XExtData*		/* ext_data */
-#endif
-);
-
-extern int XAddToSaveSet(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern Status XAllocColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    XColor*		/* screen_in_out */
-#endif
-);
-
-extern Status XAllocColorCells(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    Bool	        /* contig */,
-    unsigned long*	/* plane_masks_return */,
-    unsigned int	/* nplanes */,
-    unsigned long*	/* pixels_return */,
-    unsigned int 	/* npixels */
-#endif
-);
-
-extern Status XAllocColorPlanes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    Bool		/* contig */,
-    unsigned long*	/* pixels_return */,
-    int			/* ncolors */,
-    int			/* nreds */,
-    int			/* ngreens */,
-    int			/* nblues */,
-    unsigned long*	/* rmask_return */,
-    unsigned long*	/* gmask_return */,
-    unsigned long*	/* bmask_return */
-#endif
-);
-
-extern Status XAllocNamedColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    _Xconst char*	/* color_name */,
-    XColor*		/* screen_def_return */,
-    XColor*		/* exact_def_return */
-#endif
-);
-
-extern int XAllowEvents(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* event_mode */,
-    Time		/* time */
-#endif
-);
-
-extern int XAutoRepeatOff(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XAutoRepeatOn(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XBell(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* percent */
-#endif
-);
-
-extern int XBitmapBitOrder(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XBitmapPad(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XBitmapUnit(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XCellsOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XChangeActivePointerGrab(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    unsigned int	/* event_mask */,
-    Cursor		/* cursor */,
-    Time		/* time */
-#endif
-);
-
-extern int XChangeGC(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned long	/* valuemask */,
-    XGCValues*		/* values */
-#endif
-);
-
-extern int XChangeKeyboardControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    unsigned long	/* value_mask */,
-    XKeyboardControl*	/* values */
-#endif
-);
-
-extern int XChangeKeyboardMapping(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* first_keycode */,
-    int			/* keysyms_per_keycode */,
-    KeySym*		/* keysyms */,
-    int			/* num_codes */
-#endif
-);
-
-extern int XChangePointerControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Bool		/* do_accel */,
-    Bool		/* do_threshold */,
-    int			/* accel_numerator */,
-    int			/* accel_denominator */,
-    int			/* threshold */
-#endif
-);
-
-extern int XChangeProperty(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Atom		/* property */,
-    Atom		/* type */,
-    int			/* format */,
-    int			/* mode */,
-    _Xconst unsigned char*	/* data */,
-    int			/* nelements */
-#endif
-);
-
-extern int XChangeSaveSet(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* change_mode */
-#endif
-);
-
-extern int XChangeWindowAttributes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    unsigned long	/* valuemask */,
-    XSetWindowAttributes* /* attributes */
-#endif
-);
-
-extern Bool XCheckIfEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XEvent*		/* event_return */,
-    Bool (*) (
-#if NeedNestedPrototypes
-	       Display*			/* display */,
-               XEvent*			/* event */,
-               XPointer			/* arg */
-#endif
-             )		/* predicate */,
-    XPointer		/* arg */
-#endif
-);
-
-extern Bool XCheckMaskEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    long		/* event_mask */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern Bool XCheckTypedEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* event_type */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern Bool XCheckTypedWindowEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* event_type */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern Bool XCheckWindowEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    long		/* event_mask */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern int XCirculateSubwindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* direction */
-#endif
-);
-
-extern int XCirculateSubwindowsDown(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XCirculateSubwindowsUp(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XClearArea(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    Bool		/* exposures */
-#endif
-);
-
-extern int XClearWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XCloseDisplay(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XConfigureWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    unsigned int	/* value_mask */,
-    XWindowChanges*	/* values */		 
-#endif
-);
-
-extern int XConnectionNumber(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XConvertSelection(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Atom		/* selection */,
-    Atom 		/* target */,
-    Atom		/* property */,
-    Window		/* requestor */,
-    Time		/* time */
-#endif
-);
-
-extern int XCopyArea(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* src */,
-    Drawable		/* dest */,
-    GC			/* gc */,
-    int			/* src_x */,
-    int			/* src_y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    int			/* dest_x */,
-    int			/* dest_y */
-#endif
-);
-
-extern int XCopyGC(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* src */,
-    unsigned long	/* valuemask */,
-    GC			/* dest */
-#endif
-);
-
-extern int XCopyPlane(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* src */,
-    Drawable		/* dest */,
-    GC			/* gc */,
-    int			/* src_x */,
-    int			/* src_y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    int			/* dest_x */,
-    int			/* dest_y */,
-    unsigned long	/* plane */
-#endif
-);
-
-extern int XDefaultDepth(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDefaultDepthOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XDefaultScreen(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XDefineCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Cursor		/* cursor */
-#endif
-);
-
-extern int XDeleteProperty(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Atom		/* property */
-#endif
-);
-
-extern int XDestroyWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XDestroySubwindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XDoesBackingStore(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */    
-#endif
-);
-
-extern Bool XDoesSaveUnders(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XDisableAccessControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-
-extern int XDisplayCells(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDisplayHeight(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDisplayHeightMM(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDisplayKeycodes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* min_keycodes_return */,
-    int*		/* max_keycodes_return */
-#endif
-);
-
-extern int XDisplayPlanes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDisplayWidth(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDisplayWidthMM(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */
-#endif
-);
-
-extern int XDrawArc(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    int			/* angle1 */,
-    int			/* angle2 */
-#endif
-);
-
-extern int XDrawArcs(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XArc*		/* arcs */,
-    int			/* narcs */
-#endif
-);
-
-extern int XDrawImageString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst char*	/* string */,
-    int			/* length */
-#endif
-);
-
-extern int XDrawImageString16(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst XChar2b*	/* string */,
-    int			/* length */
-#endif
-);
-
-extern int XDrawLine(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x1 */,
-    int			/* y1 */,
-    int			/* x2 */,
-    int			/* y2 */
-#endif
-);
-
-extern int XDrawLines(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XPoint*		/* points */,
-    int			/* npoints */,
-    int			/* mode */
-#endif
-);
-
-extern int XDrawPoint(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */
-#endif
-);
-
-extern int XDrawPoints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XPoint*		/* points */,
-    int			/* npoints */,
-    int			/* mode */
-#endif
-);
-
-extern int XDrawRectangle(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */
-#endif
-);
-
-extern int XDrawRectangles(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XRectangle*		/* rectangles */,
-    int			/* nrectangles */
-#endif
-);
-
-extern int XDrawSegments(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XSegment*		/* segments */,
-    int			/* nsegments */
-#endif
-);
-
-extern int XDrawString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst char*	/* string */,
-    int			/* length */
-#endif
-);
-
-extern int XDrawString16(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst XChar2b*	/* string */,
-    int			/* length */
-#endif
-);
-
-extern int XDrawText(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    XTextItem*		/* items */,
-    int			/* nitems */
-#endif
-);
-
-extern int XDrawText16(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    XTextItem16*	/* items */,
-    int			/* nitems */
-#endif
-);
-
-extern int XEnableAccessControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XEventsQueued(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* mode */
-#endif
-);
-
-extern Status XFetchName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    char**		/* window_name_return */
-#endif
-);
-
-extern int XFillArc(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    int			/* angle1 */,
-    int			/* angle2 */
-#endif
-);
-
-extern int XFillArcs(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XArc*		/* arcs */,
-    int			/* narcs */
-#endif
-);
-
-extern int XFillPolygon(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XPoint*		/* points */,
-    int			/* npoints */,
-    int			/* shape */,
-    int			/* mode */
-#endif
-);
-
-extern int XFillRectangle(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */
-#endif
-);
-
-extern int XFillRectangles(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XRectangle*		/* rectangles */,
-    int			/* nrectangles */
-#endif
-);
-
-extern int XFlush(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XForceScreenSaver(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* mode */
-#endif
-);
-
-extern int XFree(
-#if NeedFunctionPrototypes
-    void*		/* data */
-#endif
-);
-
-extern int XFreeColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */
-#endif
-);
-
-extern int XFreeColors(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    unsigned long*	/* pixels */,
-    int			/* npixels */,
-    unsigned long	/* planes */
-#endif
-);
-
-extern int XFreeCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Cursor		/* cursor */
-#endif
-);
-
-extern int XFreeExtensionList(
-#if NeedFunctionPrototypes
-    char**		/* list */    
-#endif
-);
-
-extern int XFreeFont(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XFontStruct*	/* font_struct */
-#endif
-);
-
-extern int XFreeFontInfo(
-#if NeedFunctionPrototypes
-    char**		/* names */,
-    XFontStruct*	/* free_info */,
-    int			/* actual_count */
-#endif
-);
-
-extern int XFreeFontNames(
-#if NeedFunctionPrototypes
-    char**		/* list */
-#endif
-);
-
-extern int XFreeFontPath(
-#if NeedFunctionPrototypes
-    char**		/* list */
-#endif
-);
-
-extern int XFreeGC(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */
-#endif
-);
-
-extern int XFreeModifiermap(
-#if NeedFunctionPrototypes
-    XModifierKeymap*	/* modmap */
-#endif
-);
-
-extern int XFreePixmap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Pixmap		/* pixmap */
-#endif
-);
-
-extern int XGeometry(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen */,
-    _Xconst char*	/* position */,
-    _Xconst char*	/* default_position */,
-    unsigned int	/* bwidth */,
-    unsigned int	/* fwidth */,
-    unsigned int	/* fheight */,
-    int			/* xadder */,
-    int			/* yadder */,
-    int*		/* x_return */,
-    int*		/* y_return */,
-    int*		/* width_return */,
-    int*		/* height_return */
-#endif
-);
-
-extern int XGetErrorDatabaseText(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* name */,
-    _Xconst char*	/* message */,
-    _Xconst char*	/* default_string */,
-    char*		/* buffer_return */,
-    int			/* length */
-#endif
-);
-
-extern int XGetErrorText(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* code */,
-    char*		/* buffer_return */,
-    int			/* length */
-#endif
-);
-
-extern Bool XGetFontProperty(
-#if NeedFunctionPrototypes
-    XFontStruct*	/* font_struct */,
-    Atom		/* atom */,
-    unsigned long*	/* value_return */
-#endif
-);
-
-extern Status XGetGCValues(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned long	/* valuemask */,
-    XGCValues*		/* values_return */
-#endif
-);
-
-extern Status XGetGeometry(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    Window*		/* root_return */,
-    int*		/* x_return */,
-    int*		/* y_return */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */,
-    unsigned int*	/* border_width_return */,
-    unsigned int*	/* depth_return */
-#endif
-);
-
-extern Status XGetIconName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    char**		/* icon_name_return */
-#endif
-);
-
-extern int XGetInputFocus(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window*		/* focus_return */,
-    int*		/* revert_to_return */
-#endif
-);
-
-extern int XGetKeyboardControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XKeyboardState*	/* values_return */
-#endif
-);
-
-extern int XGetPointerControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* accel_numerator_return */,
-    int*		/* accel_denominator_return */,
-    int*		/* threshold_return */
-#endif
-);
-
-extern int XGetPointerMapping(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    unsigned char*	/* map_return */,
-    int			/* nmap */
-#endif
-);
-
-extern int XGetScreenSaver(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int*		/* timeout_return */,
-    int*		/* interval_return */,
-    int*		/* prefer_blanking_return */,
-    int*		/* allow_exposures_return */
-#endif
-);
-
-extern Status XGetTransientForHint(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window*		/* prop_window_return */
-#endif
-);
-
-extern int XGetWindowProperty(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Atom		/* property */,
-    long		/* long_offset */,
-    long		/* long_length */,
-    Bool		/* delete */,
-    Atom		/* req_type */,
-    Atom*		/* actual_type_return */,
-    int*		/* actual_format_return */,
-    unsigned long*	/* nitems_return */,
-    unsigned long*	/* bytes_after_return */,
-    unsigned char**	/* prop_return */
-#endif
-);
-
-extern Status XGetWindowAttributes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XWindowAttributes*	/* window_attributes_return */
-#endif
-);
-
-extern int XGrabButton(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    unsigned int	/* button */,
-    unsigned int	/* modifiers */,
-    Window		/* grab_window */,
-    Bool		/* owner_events */,
-    unsigned int	/* event_mask */,
-    int			/* pointer_mode */,
-    int			/* keyboard_mode */,
-    Window		/* confine_to */,
-    Cursor		/* cursor */
-#endif
-);
-
-extern int XGrabKey(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* keycode */,
-    unsigned int	/* modifiers */,
-    Window		/* grab_window */,
-    Bool		/* owner_events */,
-    int			/* pointer_mode */,
-    int			/* keyboard_mode */
-#endif
-);
-
-extern int XGrabKeyboard(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* grab_window */,
-    Bool		/* owner_events */,
-    int			/* pointer_mode */,
-    int			/* keyboard_mode */,
-    Time		/* time */
-#endif
-);
-
-extern int XGrabPointer(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* grab_window */,
-    Bool		/* owner_events */,
-    unsigned int	/* event_mask */,
-    int			/* pointer_mode */,
-    int			/* keyboard_mode */,
-    Window		/* confine_to */,
-    Cursor		/* cursor */,
-    Time		/* time */
-#endif
-);
-
-extern int XGrabServer(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XHeightMMOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XHeightOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XIfEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XEvent*		/* event_return */,
-    Bool (*) (
-#if NeedNestedPrototypes
-	       Display*			/* display */,
-               XEvent*			/* event */,
-               XPointer			/* arg */
-#endif
-             )		/* predicate */,
-    XPointer		/* arg */
-#endif
-);
-
-extern int XImageByteOrder(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XInstallColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */
-#endif
-);
-
-extern KeyCode XKeysymToKeycode(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    KeySym		/* keysym */
-#endif
-);
-
-extern int XKillClient(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* resource */
-#endif
-);
-
-extern Status XLookupColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    _Xconst char*	/* color_name */,
-    XColor*		/* exact_def_return */,
-    XColor*		/* screen_def_return */
-#endif
-);
-
-extern int XLowerWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XMapRaised(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XMapSubwindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XMapWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XMaskEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    long		/* event_mask */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern int XMaxCmapsOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XMinCmapsOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XMoveResizeWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */
-#endif
-);
-
-extern int XMoveWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    int			/* x */,
-    int			/* y */
-#endif
-);
-
-extern int XNextEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern int XNoOp(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern Status XParseColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    _Xconst char*	/* spec */,
-    XColor*		/* exact_def_return */
-#endif
-);
-
-extern int XParseGeometry(
-#if NeedFunctionPrototypes
-    _Xconst char*	/* parsestring */,
-    int*		/* x_return */,
-    int*		/* y_return */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */
-#endif
-);
-
-extern int XPeekEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern int XPeekIfEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XEvent*		/* event_return */,
-    Bool (*) (
-#if NeedNestedPrototypes
-	       Display*		/* display */,
-               XEvent*		/* event */,
-               XPointer		/* arg */
-#endif
-             )		/* predicate */,
-    XPointer		/* arg */
-#endif
-);
-
-extern int XPending(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XPlanesOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-    
-#endif
-);
-
-extern int XProtocolRevision(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XProtocolVersion(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-
-extern int XPutBackEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XEvent*		/* event */
-#endif
-);
-
-extern int XPutImage(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    XImage*		/* image */,
-    int			/* src_x */,
-    int			/* src_y */,
-    int			/* dest_x */,
-    int			/* dest_y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */	  
-#endif
-);
-
-extern int XQLength(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern Status XQueryBestCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    unsigned int        /* width */,
-    unsigned int	/* height */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */
-#endif
-);
-
-extern Status XQueryBestSize(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* class */,
-    Drawable		/* which_screen */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */
-#endif
-);
-
-extern Status XQueryBestStipple(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* which_screen */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */
-#endif
-);
-
-extern Status XQueryBestTile(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* which_screen */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */
-#endif
-);
-
-extern int XQueryColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    XColor*		/* def_in_out */
-#endif
-);
-
-extern int XQueryColors(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    XColor*		/* defs_in_out */,
-    int			/* ncolors */
-#endif
-);
-
-extern Bool XQueryExtension(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* name */,
-    int*		/* major_opcode_return */,
-    int*		/* first_event_return */,
-    int*		/* first_error_return */
-#endif
-);
-
-extern int XQueryKeymap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    char [32]		/* keys_return */
-#endif
-);
-
-extern Bool XQueryPointer(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window*		/* root_return */,
-    Window*		/* child_return */,
-    int*		/* root_x_return */,
-    int*		/* root_y_return */,
-    int*		/* win_x_return */,
-    int*		/* win_y_return */,
-    unsigned int*       /* mask_return */
-#endif
-);
-
-extern int XQueryTextExtents(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* font_ID */,
-    _Xconst char*	/* string */,
-    int			/* nchars */,
-    int*		/* direction_return */,
-    int*		/* font_ascent_return */,
-    int*		/* font_descent_return */,
-    XCharStruct*	/* overall_return */    
-#endif
-);
-
-extern int XQueryTextExtents16(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* font_ID */,
-    _Xconst XChar2b*	/* string */,
-    int			/* nchars */,
-    int*		/* direction_return */,
-    int*		/* font_ascent_return */,
-    int*		/* font_descent_return */,
-    XCharStruct*	/* overall_return */
-#endif
-);
-
-extern Status XQueryTree(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window*		/* root_return */,
-    Window*		/* parent_return */,
-    Window**		/* children_return */,
-    unsigned int*	/* nchildren_return */
-#endif
-);
-
-extern int XRaiseWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XReadBitmapFile(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable 		/* d */,
-    _Xconst char*	/* filename */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */,
-    Pixmap*		/* bitmap_return */,
-    int*		/* x_hot_return */,
-    int*		/* y_hot_return */
-#endif
-);
-
-extern int XReadBitmapFileData(
-#if NeedFunctionPrototypes
-    _Xconst char*	/* filename */,
-    unsigned int*	/* width_return */,
-    unsigned int*	/* height_return */,
-    unsigned char**	/* data_return */,
-    int*		/* x_hot_return */,
-    int*		/* y_hot_return */
-#endif
-);
-
-extern int XRebindKeysym(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    KeySym		/* keysym */,
-    KeySym*		/* list */,
-    int			/* mod_count */,
-    _Xconst unsigned char*	/* string */,
-    int			/* bytes_string */
-#endif
-);
-
-extern int XRecolorCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Cursor		/* cursor */,
-    XColor*		/* foreground_color */,
-    XColor*		/* background_color */
-#endif
-);
-
-extern int XRefreshKeyboardMapping(
-#if NeedFunctionPrototypes
-    XMappingEvent*	/* event_map */    
-#endif
-);
-
-extern int XRemoveFromSaveSet(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XRemoveHost(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XHostAddress*	/* host */
-#endif
-);
-
-extern int XRemoveHosts(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XHostAddress*	/* hosts */,
-    int			/* num_hosts */
-#endif
-);
-
-extern int XReparentWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Window		/* parent */,
-    int			/* x */,
-    int			/* y */
-#endif
-);
-
-extern int XResetScreenSaver(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XResizeWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    unsigned int	/* width */,
-    unsigned int	/* height */
-#endif
-);
-
-extern int XRestackWindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window*		/* windows */,
-    int			/* nwindows */
-#endif
-);
-
-extern int XRotateBuffers(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* rotate */
-#endif
-);
-
-extern int XRotateWindowProperties(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Atom*		/* properties */,
-    int			/* num_prop */,
-    int			/* npositions */
-#endif
-);
-
-extern int XScreenCount(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XSelectInput(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    long		/* event_mask */
-#endif
-);
-
-extern Status XSendEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Bool		/* propagate */,
-    long		/* event_mask */,
-    XEvent*		/* event_send */
-#endif
-);
-
-extern int XSetAccessControl(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* mode */
-#endif
-);
-
-extern int XSetArcMode(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* arc_mode */
-#endif
-);
-
-extern int XSetBackground(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned long	/* background */
-#endif
-);
-
-extern int XSetClipMask(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    Pixmap		/* pixmap */
-#endif
-);
-
-extern int XSetClipOrigin(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* clip_x_origin */,
-    int			/* clip_y_origin */
-#endif
-);
-
-extern int XSetClipRectangles(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* clip_x_origin */,
-    int			/* clip_y_origin */,
-    XRectangle*		/* rectangles */,
-    int			/* n */,
-    int			/* ordering */
-#endif
-);
-
-extern int XSetCloseDownMode(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* close_mode */
-#endif
-);
-
-extern int XSetCommand(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    char**		/* argv */,
-    int			/* argc */
-#endif
-);
-
-extern int XSetDashes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* dash_offset */,
-    _Xconst char*	/* dash_list */,
-    int			/* n */
-#endif
-);
-
-extern int XSetFillRule(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* fill_rule */
-#endif
-);
-
-extern int XSetFillStyle(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* fill_style */
-#endif
-);
-
-extern int XSetFont(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    Font		/* font */
-#endif
-);
-
-extern int XSetFontPath(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    char**		/* directories */,
-    int			/* ndirs */	     
-#endif
-);
-
-extern int XSetForeground(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned long	/* foreground */
-#endif
-);
-
-extern int XSetFunction(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* function */
-#endif
-);
-
-extern int XSetGraphicsExposures(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    Bool		/* graphics_exposures */
-#endif
-);
-
-extern int XSetIconName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    _Xconst char*	/* icon_name */
-#endif
-);
-
-extern int XSetInputFocus(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* focus */,
-    int			/* revert_to */,
-    Time		/* time */
-#endif
-);
-
-extern int XSetLineAttributes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned int	/* line_width */,
-    int			/* line_style */,
-    int			/* cap_style */,
-    int			/* join_style */
-#endif
-);
-
-extern int XSetModifierMapping(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XModifierKeymap*	/* modmap */
-#endif
-);
-
-extern int XSetPlaneMask(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned long	/* plane_mask */
-#endif
-);
-
-extern int XSetPointerMapping(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst unsigned char*	/* map */,
-    int			/* nmap */
-#endif
-);
-
-extern int XSetScreenSaver(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* timeout */,
-    int			/* interval */,
-    int			/* prefer_blanking */,
-    int			/* allow_exposures */
-#endif
-);
-
-extern int XSetSelectionOwner(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Atom	        /* selection */,
-    Window		/* owner */,
-    Time		/* time */
-#endif
-);
-
-extern int XSetState(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    unsigned long 	/* foreground */,
-    unsigned long	/* background */,
-    int			/* function */,
-    unsigned long	/* plane_mask */
-#endif
-);
-
-extern int XSetStipple(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    Pixmap		/* stipple */
-#endif
-);
-
-extern int XSetSubwindowMode(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* subwindow_mode */
-#endif
-);
-
-extern int XSetTSOrigin(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    int			/* ts_x_origin */,
-    int			/* ts_y_origin */
-#endif
-);
-
-extern int XSetTile(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    Pixmap		/* tile */
-#endif
-);
-
-extern int XSetWindowBackground(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    unsigned long	/* background_pixel */
-#endif
-);
-
-extern int XSetWindowBackgroundPixmap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Pixmap		/* background_pixmap */
-#endif
-);
-
-extern int XSetWindowBorder(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    unsigned long	/* border_pixel */
-#endif
-);
-
-extern int XSetWindowBorderPixmap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Pixmap		/* border_pixmap */
-#endif
-);
-
-extern int XSetWindowBorderWidth(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    unsigned int	/* width */
-#endif
-);
-
-extern int XSetWindowColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    Colormap		/* colormap */
-#endif
-);
-
-extern int XStoreBuffer(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* bytes */,
-    int			/* nbytes */,
-    int			/* buffer */
-#endif
-);
-
-extern int XStoreBytes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* bytes */,
-    int			/* nbytes */
-#endif
-);
-
-extern int XStoreColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    XColor*		/* color */
-#endif
-);
-
-extern int XStoreColors(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    XColor*		/* color */,
-    int			/* ncolors */
-#endif
-);
-
-extern int XStoreName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    _Xconst char*	/* window_name */
-#endif
-);
-
-extern int XStoreNamedColor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */,
-    _Xconst char*	/* color */,
-    unsigned long	/* pixel */,
-    int			/* flags */
-#endif
-);
-
-extern int XSync(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Bool		/* discard */
-#endif
-);
-
-extern int XTextExtents(
-#if NeedFunctionPrototypes
-    XFontStruct*	/* font_struct */,
-    _Xconst char*	/* string */,
-    int			/* nchars */,
-    int*		/* direction_return */,
-    int*		/* font_ascent_return */,
-    int*		/* font_descent_return */,
-    XCharStruct*	/* overall_return */
-#endif
-);
-
-extern int XTextExtents16(
-#if NeedFunctionPrototypes
-    XFontStruct*	/* font_struct */,
-    _Xconst XChar2b*	/* string */,
-    int			/* nchars */,
-    int*		/* direction_return */,
-    int*		/* font_ascent_return */,
-    int*		/* font_descent_return */,
-    XCharStruct*	/* overall_return */
-#endif
-);
-
-extern int XTextWidth(
-#if NeedFunctionPrototypes
-    XFontStruct*	/* font_struct */,
-    _Xconst char*	/* string */,
-    int			/* count */
-#endif
-);
-
-extern int XTextWidth16(
-#if NeedFunctionPrototypes
-    XFontStruct*	/* font_struct */,
-    _Xconst XChar2b*	/* string */,
-    int			/* count */
-#endif
-);
-
-extern Bool XTranslateCoordinates(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* src_w */,
-    Window		/* dest_w */,
-    int			/* src_x */,
-    int			/* src_y */,
-    int*		/* dest_x_return */,
-    int*		/* dest_y_return */,
-    Window*		/* child_return */
-#endif
-);
-
-extern int XUndefineCursor(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XUngrabButton(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    unsigned int	/* button */,
-    unsigned int	/* modifiers */,
-    Window		/* grab_window */
-#endif
-);
-
-extern int XUngrabKey(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* keycode */,
-    unsigned int	/* modifiers */,
-    Window		/* grab_window */
-#endif
-);
-
-extern int XUngrabKeyboard(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Time		/* time */
-#endif
-);
-
-extern int XUngrabPointer(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Time		/* time */
-#endif
-);
-
-extern int XUngrabServer(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XUninstallColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Colormap		/* colormap */
-#endif
-);
-
-extern int XUnloadFont(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Font		/* font */
-#endif
-);
-
-extern int XUnmapSubwindows(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XUnmapWindow(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */
-#endif
-);
-
-extern int XVendorRelease(
-#if NeedFunctionPrototypes
-    Display*		/* display */
-#endif
-);
-
-extern int XWarpPointer(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* src_w */,
-    Window		/* dest_w */,
-    int			/* src_x */,
-    int			/* src_y */,
-    unsigned int	/* src_width */,
-    unsigned int	/* src_height */,
-    int			/* dest_x */,
-    int			/* dest_y */	     
-#endif
-);
-
-extern int XWidthMMOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XWidthOfScreen(
-#if NeedFunctionPrototypes
-    Screen*		/* screen */
-#endif
-);
-
-extern int XWindowEvent(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    long		/* event_mask */,
-    XEvent*		/* event_return */
-#endif
-);
-
-extern int XWriteBitmapFile(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* filename */,
-    Pixmap		/* bitmap */,
-    unsigned int	/* width */,
-    unsigned int	/* height */,
-    int			/* x_hot */,
-    int			/* y_hot */		     
-#endif
-);
-
-extern Bool XSupportsLocale (void);
-
-extern char *XSetLocaleModifiers(
-    const char*		/* modifier_list */
-);
-
-extern XOM XOpenOM(
-#if NeedFunctionPrototypes
-    Display*			/* display */,
-    struct _XrmHashBucketRec*	/* rdb */,
-    _Xconst char*		/* res_name */,
-    _Xconst char*		/* res_class */
-#endif
-);
-
-extern Status XCloseOM(
-#if NeedFunctionPrototypes
-    XOM			/* om */
-#endif
-);
-
-extern char *XSetOMValues(
-#if NeedVarargsPrototypes
-    XOM			/* om */,
-    ...
-#endif
-);
-
-extern char *XGetOMValues(
-#if NeedVarargsPrototypes
-    XOM			/* om */,
-    ...
-#endif
-);
-
-extern Display *XDisplayOfOM(
-#if NeedFunctionPrototypes
-    XOM			/* om */
-#endif
-);
-
-extern char *XLocaleOfOM(
-#if NeedFunctionPrototypes
-    XOM			/* om */
-#endif
-);
-
-extern XOC XCreateOC(
-#if NeedVarargsPrototypes
-    XOM			/* om */,
-    ...
-#endif
-);
-
-extern void XDestroyOC(
-#if NeedFunctionPrototypes
-    XOC			/* oc */
-#endif
-);
-
-extern XOM XOMOfOC(
-#if NeedFunctionPrototypes
-    XOC			/* oc */
-#endif
-);
-
-extern char *XSetOCValues(
-#if NeedVarargsPrototypes
-    XOC			/* oc */,
-    ...
-#endif
-);
-
-extern char *XGetOCValues(
-#if NeedVarargsPrototypes
-    XOC			/* oc */,
-    ...
-#endif
-);
-
-extern XFontSet XCreateFontSet(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    _Xconst char*	/* base_font_name_list */,
-    char***		/* missing_charset_list */,
-    int*		/* missing_charset_count */,
-    char**		/* def_string */
-#endif
-);
-
-extern void XFreeFontSet(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XFontSet		/* font_set */
-#endif
-);
-
-extern int XFontsOfFontSet(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    XFontStruct***	/* font_struct_list */,
-    char***		/* font_name_list */
-#endif
-);
-
-extern char *XBaseFontNameListOfFontSet(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */
-#endif
-);
-
-extern char *XLocaleOfFontSet(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */
-#endif
-);
-
-extern Bool XContextDependentDrawing(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */
-#endif
-);
-
-extern Bool XDirectionalDependentDrawing(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */
-#endif
-);
-
-extern Bool XContextualDrawing(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */
-#endif
-);
-
-extern XFontSetExtents *XExtentsOfFontSet(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */
-#endif
-);
-
-extern int XmbTextEscapement(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */
-#endif
-);
-
-extern int XwcTextEscapement(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst wchar_t*	/* text */,
-    int			/* num_wchars */
-#endif
-);
-
-extern int Xutf8TextEscapement(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */
-#endif
-);
-
-extern int XmbTextExtents(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */,
-    XRectangle*		/* overall_ink_return */,
-    XRectangle*		/* overall_logical_return */
-#endif
-);
-
-extern int XwcTextExtents(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst wchar_t*	/* text */,
-    int			/* num_wchars */,
-    XRectangle*		/* overall_ink_return */,
-    XRectangle*		/* overall_logical_return */
-#endif
-);
-
-extern int Xutf8TextExtents(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */,
-    XRectangle*		/* overall_ink_return */,
-    XRectangle*		/* overall_logical_return */
-#endif
-);
-
-extern Status XmbTextPerCharExtents(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */,
-    XRectangle*		/* ink_extents_buffer */,
-    XRectangle*		/* logical_extents_buffer */,
-    int			/* buffer_size */,
-    int*		/* num_chars */,
-    XRectangle*		/* overall_ink_return */,
-    XRectangle*		/* overall_logical_return */
-#endif
-);
-
-extern Status XwcTextPerCharExtents(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst wchar_t*	/* text */,
-    int			/* num_wchars */,
-    XRectangle*		/* ink_extents_buffer */,
-    XRectangle*		/* logical_extents_buffer */,
-    int			/* buffer_size */,
-    int*		/* num_chars */,
-    XRectangle*		/* overall_ink_return */,
-    XRectangle*		/* overall_logical_return */
-#endif
-);
-
-extern Status Xutf8TextPerCharExtents(
-#if NeedFunctionPrototypes
-    XFontSet		/* font_set */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */,
-    XRectangle*		/* ink_extents_buffer */,
-    XRectangle*		/* logical_extents_buffer */,
-    int			/* buffer_size */,
-    int*		/* num_chars */,
-    XRectangle*		/* overall_ink_return */,
-    XRectangle*		/* overall_logical_return */
-#endif
-);
-
-extern void XmbDrawText(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    XmbTextItem*	/* text_items */,
-    int			/* nitems */
-#endif
-);
-
-extern void XwcDrawText(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    XwcTextItem*	/* text_items */,
-    int			/* nitems */
-#endif
-);
-
-extern void Xutf8DrawText(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    XmbTextItem*	/* text_items */,
-    int			/* nitems */
-#endif
-);
-
-extern void XmbDrawString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    XFontSet		/* font_set */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */
-#endif
-);
-
-extern void XwcDrawString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    XFontSet		/* font_set */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst wchar_t*	/* text */,
-    int			/* num_wchars */
-#endif
-);
-
-extern void Xutf8DrawString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    XFontSet		/* font_set */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */
-#endif
-);
-
-extern void XmbDrawImageString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    XFontSet		/* font_set */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */
-#endif
-);
-
-extern void XwcDrawImageString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    XFontSet		/* font_set */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst wchar_t*	/* text */,
-    int			/* num_wchars */
-#endif
-);
-
-extern void Xutf8DrawImageString(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Drawable		/* d */,
-    XFontSet		/* font_set */,
-    GC			/* gc */,
-    int			/* x */,
-    int			/* y */,
-    _Xconst char*	/* text */,
-    int			/* bytes_text */
-#endif
-);
-
-extern XIM XOpenIM(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    struct _XrmHashBucketRec*	/* rdb */,
-    char*			/* res_name */,
-    char*			/* res_class */
-#endif
-);
-
-extern Status XCloseIM(
-#if NeedFunctionPrototypes
-    XIM /* im */
-#endif
-);
-
-extern char *XGetIMValues(
-#if NeedVarargsPrototypes
-    XIM /* im */, ...
-#endif
-);
-
-extern char *XSetIMValues(
-#if NeedVarargsPrototypes
-    XIM /* im */, ...
-#endif
-);
-
-extern Display *XDisplayOfIM(
-#if NeedFunctionPrototypes
-    XIM /* im */
-#endif
-);
-
-extern char *XLocaleOfIM(
-#if NeedFunctionPrototypes
-    XIM /* im*/
-#endif
-);
-
-extern XIC XCreateIC(
-#if NeedVarargsPrototypes
-    XIM /* im */, ...
-#endif
-);
-
-extern void XDestroyIC(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern void XSetICFocus(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern void XUnsetICFocus(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern wchar_t *XwcResetIC(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern char *XmbResetIC(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern char *Xutf8ResetIC(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern char *XSetICValues(
-#if NeedVarargsPrototypes
-    XIC /* ic */, ...
-#endif
-);
-
-extern char *XGetICValues(
-#if NeedVarargsPrototypes
-    XIC /* ic */, ...
-#endif
-);
-
-extern XIM XIMOfIC(
-#if NeedFunctionPrototypes
-    XIC /* ic */
-#endif
-);
-
-extern Bool XFilterEvent(
-#if NeedFunctionPrototypes
-    XEvent*	/* event */,
-    Window	/* window */
-#endif
-);
-
-extern int XmbLookupString(
-#if NeedFunctionPrototypes
-    XIC			/* ic */,
-    XKeyPressedEvent*	/* event */,
-    char*		/* buffer_return */,
-    int			/* bytes_buffer */,
-    KeySym*		/* keysym_return */,
-    Status*		/* status_return */
-#endif
-);
-
-extern int XwcLookupString(
-#if NeedFunctionPrototypes
-    XIC			/* ic */,
-    XKeyPressedEvent*	/* event */,
-    wchar_t*		/* buffer_return */,
-    int			/* wchars_buffer */,
-    KeySym*		/* keysym_return */,
-    Status*		/* status_return */
-#endif
-);
-
-extern int Xutf8LookupString(
-#if NeedFunctionPrototypes
-    XIC			/* ic */,
-    XKeyPressedEvent*	/* event */,
-    char*		/* buffer_return */,
-    int			/* bytes_buffer */,
-    KeySym*		/* keysym_return */,
-    Status*		/* status_return */
-#endif
-);
-
-extern XVaNestedList XVaCreateNestedList(
-#if NeedVarargsPrototypes
-    int /*unused*/, ...
-#endif
-);
-
-/* internal connections for IMs */
-
-extern Bool XRegisterIMInstantiateCallback(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    struct _XrmHashBucketRec*	/* rdb */,
-    char*			/* res_name */,
-    char*			/* res_class */,
-    XIDProc			/* callback */,
-    XPointer			/* client_data */
-#endif
-);
-
-extern Bool XUnregisterIMInstantiateCallback(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    struct _XrmHashBucketRec*	/* rdb */,
-    char*			/* res_name */,
-    char*			/* res_class */,
-    XIDProc			/* callback */,
-    XPointer			/* client_data */
-#endif
-);
-
-typedef void (*XConnectionWatchProc)(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    XPointer			/* client_data */,
-    int				/* fd */,
-    Bool			/* opening */,	 /* open or close flag */
-    XPointer*			/* watch_data */ /* open sets, close uses */
-#endif
-);
-    
-
-extern Status XInternalConnectionNumbers(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    int**			/* fd_return */,
-    int*			/* count_return */
-#endif
-);
-
-extern void XProcessInternalConnection(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    int				/* fd */
-#endif
-);
-
-extern Status XAddConnectionWatch(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    XConnectionWatchProc	/* callback */,
-    XPointer			/* client_data */
-#endif
-);
-
-extern void XRemoveConnectionWatch(
-#if NeedFunctionPrototypes
-    Display*			/* dpy */,
-    XConnectionWatchProc	/* callback */,
-    XPointer			/* client_data */
-#endif
-);
-
-extern void XSetAuthorization(
-#if NeedFunctionPrototypes
-    char *			/* name */,
-    int				/* namelen */, 
-    char *			/* data */,
-    int				/* datalen */
-#endif
-);
-
-extern int _Xmbtowc(
-#if NeedFunctionPrototypes
-    wchar_t *			/* wstr */,
-#ifdef ISC
-    char const *		/* str */,
-    size_t			/* len */
-#else
-    char *			/* str */,
-    int				/* len */
-#endif
-#endif
-);
-
-extern int _Xwctomb(
-#if NeedFunctionPrototypes
-    char *			/* str */,
-    wchar_t			/* wc */
-#endif
-);
-
-_XFUNCPROTOEND
-#endif		/* if 0 */
-
-#endif /* _XLIB_H_ */
-
-
-/* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */
-
-/***********************************************************
-
-Copyright 1987, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/lib/X11/Xutil.h,v 3.5 2003/01/26 02:40:10 dawes Exp $ */
-
-#ifndef _XUTIL_H_
-#define _XUTIL_H_
-
-/* You must include <X11/Xlib.h> before including this file */
-#if 0
-#include <X11/Xlib.h>
-#endif
-
-/* 
- * Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
- * value (x, y, width, height) was found in the parsed string.
- */
-#define NoValue		0x0000
-#define XValue  	0x0001
-#define YValue		0x0002
-#define WidthValue  	0x0004
-#define HeightValue  	0x0008
-#define AllValues 	0x000F
-#define XNegative 	0x0010
-#define YNegative 	0x0020
-
-/*
- * new version containing base_width, base_height, and win_gravity fields;
- * used with WM_NORMAL_HINTS.
- */
-typedef struct {
-    	long flags;	/* marks which fields in this structure are defined */
-	int x, y;		/* obsolete for new window mgrs, but clients */
-	int width, height;	/* should set so old wm's don't mess up */
-	int min_width, min_height;
-	int max_width, max_height;
-    	int width_inc, height_inc;
-	struct {
-		int x;	/* numerator */
-		int y;	/* denominator */
-	} min_aspect, max_aspect;
-	int base_width, base_height;		/* added by ICCCM version 1 */
-	int win_gravity;			/* added by ICCCM version 1 */
-} XSizeHints;
-
-/*
- * The next block of definitions are for window manager properties that
- * clients and applications use for communication.
- */
-
-/* flags argument in size hints */
-#define USPosition	(1L << 0) /* user specified x, y */
-#define USSize		(1L << 1) /* user specified width, height */
-
-#define PPosition	(1L << 2) /* program specified position */
-#define PSize		(1L << 3) /* program specified size */
-#define PMinSize	(1L << 4) /* program specified minimum size */
-#define PMaxSize	(1L << 5) /* program specified maximum size */
-#define PResizeInc	(1L << 6) /* program specified resize increments */
-#define PAspect		(1L << 7) /* program specified min and max aspect ratios */
-#define PBaseSize	(1L << 8) /* program specified base for incrementing */
-#define PWinGravity	(1L << 9) /* program specified window gravity */
-
-/* obsolete */
-#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
-
-
-
-typedef struct {
-	long flags;	/* marks which fields in this structure are defined */
-	Bool input;	/* does this application rely on the window manager to
-			get keyboard input? */
-	int initial_state;	/* see below */
-	Pixmap icon_pixmap;	/* pixmap to be used as icon */
-	Window icon_window; 	/* window to be used as icon */
-	int icon_x, icon_y; 	/* initial position of icon */
-	Pixmap icon_mask;	/* icon mask bitmap */
-	XID window_group;	/* id of related window group */
-	/* this structure may be extended in the future */
-} XWMHints;
-
-/* definition for flags of XWMHints */
-
-#define InputHint 		(1L << 0)
-#define StateHint 		(1L << 1)
-#define IconPixmapHint		(1L << 2)
-#define IconWindowHint		(1L << 3)
-#define IconPositionHint 	(1L << 4)
-#define IconMaskHint		(1L << 5)
-#define WindowGroupHint		(1L << 6)
-#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
-IconPositionHint|IconMaskHint|WindowGroupHint)
-#define XUrgencyHint		(1L << 8)
-
-/* definitions for initial window state */
-#define WithdrawnState 0	/* for windows that are not mapped */
-#define NormalState 1	/* most applications want to start this way */
-#define IconicState 3	/* application wants to start as an icon */
-
-/*
- * Obsolete states no longer defined by ICCCM
- */
-#define DontCareState 0	/* don't know or care */
-#define ZoomState 2	/* application wants to start zoomed */
-#define InactiveState 4	/* application believes it is seldom used; */
-			/* some wm's may put it on inactive menu */
-
-
-/*
- * new structure for manipulating TEXT properties; used with WM_NAME, 
- * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
- */
-typedef struct {
-    unsigned char *value;		/* same as Property routines */
-    Atom encoding;			/* prop type */
-    int format;				/* prop data format: 8, 16, or 32 */
-    unsigned long nitems;		/* number of data items in value */
-} XTextProperty;
-
-#define XNoMemory -1
-#define XLocaleNotSupported -2
-#define XConverterNotFound -3
-
-typedef enum {
-    XStringStyle,		/* STRING */
-    XCompoundTextStyle,		/* COMPOUND_TEXT */
-    XTextStyle,			/* text in owner's encoding (current locale)*/
-    XStdICCTextStyle,		/* STRING, else COMPOUND_TEXT */
-    /* The following is an XFree86 extension, introduced in November 2000 */
-    XUTF8StringStyle		/* UTF8_STRING */
-} XICCEncodingStyle;
-
-typedef struct {
-	int min_width, min_height;
-	int max_width, max_height;
-	int width_inc, height_inc;
-} XIconSize;
-
-typedef struct {
-	char *res_name;
-	char *res_class;
-} XClassHint;
-
-/*
- * These macros are used to give some sugar to the image routines so that
- * naive people are more comfortable with them.
- */
-#define XDestroyImage(ximage) \
-	((*((ximage)->f.destroy_image))((ximage)))
-#define XGetPixel(ximage, x, y) \
-	((*((ximage)->f.get_pixel))((ximage), (x), (y)))
-#define XPutPixel(ximage, x, y, pixel) \
-	((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
-#define XSubImage(ximage, x, y, width, height)  \
-	((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
-#define XAddPixel(ximage, value) \
-	((*((ximage)->f.add_pixel))((ximage), (value)))
-
-/*
- * Compose sequence status structure, used in calling XLookupString.
- */
-typedef struct _XComposeStatus {
-    XPointer compose_ptr;	/* state table pointer */
-    int chars_matched;		/* match state */
-} XComposeStatus;
-
-/*
- * Keysym macros, used on Keysyms to test for classes of symbols
- */
-#define IsKeypadKey(keysym) \
-  (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal))
-
-#define IsPrivateKeypadKey(keysym) \
-  (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF))
-
-#define IsCursorKey(keysym) \
-  (((KeySym)(keysym) >= XK_Home)     && ((KeySym)(keysym) <  XK_Select))
-
-#define IsPFKey(keysym) \
-  (((KeySym)(keysym) >= XK_KP_F1)     && ((KeySym)(keysym) <= XK_KP_F4))
-
-#define IsFunctionKey(keysym) \
-  (((KeySym)(keysym) >= XK_F1)       && ((KeySym)(keysym) <= XK_F35))
-
-#define IsMiscFunctionKey(keysym) \
-  (((KeySym)(keysym) >= XK_Select)   && ((KeySym)(keysym) <= XK_Break))
-
-#define IsModifierKey(keysym) \
-  ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \
-   || (((KeySym)(keysym) >= XK_ISO_Lock) && \
-       ((KeySym)(keysym) <= XK_ISO_Last_Group_Lock)) \
-   || ((KeySym)(keysym) == XK_Mode_switch) \
-   || ((KeySym)(keysym) == XK_Num_Lock))
-/*
- * opaque reference to Region data type 
- */
-typedef struct _XRegion *Region; 
-
-/* Return values from XRectInRegion() */
- 
-#define RectangleOut 0
-#define RectangleIn  1
-#define RectanglePart 2
- 
-
-/*
- * Information used by the visual utility routines to find desired visual
- * type from the many visuals a display may support.
- */
-
-typedef struct {
-  Visual *visual;
-  VisualID visualid;
-  int screen;
-  int depth;
-#if defined(__cplusplus) || defined(c_plusplus)
-  int c_class;					/* C++ */
-#else
-  int class;
-#endif
-  unsigned long red_mask;
-  unsigned long green_mask;
-  unsigned long blue_mask;
-  int colormap_size;
-  int bits_per_rgb;
-} XVisualInfo;
-
-#define VisualNoMask		0x0
-#define VisualIDMask 		0x1
-#define VisualScreenMask	0x2
-#define VisualDepthMask		0x4
-#define VisualClassMask		0x8
-#define VisualRedMaskMask	0x10
-#define VisualGreenMaskMask	0x20
-#define VisualBlueMaskMask	0x40
-#define VisualColormapSizeMask	0x80
-#define VisualBitsPerRGBMask	0x100
-#define VisualAllMask		0x1FF
-
-/*
- * This defines a window manager property that clients may use to
- * share standard color maps of type RGB_COLOR_MAP:
- */
-typedef struct {
-	Colormap colormap;
-	unsigned long red_max;
-	unsigned long red_mult;
-	unsigned long green_max;
-	unsigned long green_mult;
-	unsigned long blue_max;
-	unsigned long blue_mult;
-	unsigned long base_pixel;
-	VisualID visualid;		/* added by ICCCM version 1 */
-	XID killid;			/* added by ICCCM version 1 */
-} XStandardColormap;
-
-#define ReleaseByFreeingColormap ((XID) 1L)  /* for killid field above */
-
-
-/*
- * return codes for XReadBitmapFile and XWriteBitmapFile
- */
-#define BitmapSuccess		0
-#define BitmapOpenFailed 	1
-#define BitmapFileInvalid 	2
-#define BitmapNoMemory		3
-
-/****************************************************************
- *
- * Context Management
- *
- ****************************************************************/
-
-
-/* Associative lookup table return codes */
-
-#define XCSUCCESS 0	/* No error. */
-#define XCNOMEM   1    /* Out of memory */
-#define XCNOENT   2    /* No entry in table */
-
-typedef int XContext;
-
-#define XUniqueContext()       ((XContext) XrmUniqueQuark())
-#define XStringToContext(string)   ((XContext) XrmStringToQuark(string))
-
-#if 0
-_XFUNCPROTOBEGIN
-
-/* The following declarations are alphabetized. */
-
-extern XClassHint *XAllocClassHint (
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern XIconSize *XAllocIconSize (
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern XSizeHints *XAllocSizeHints (
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern XStandardColormap *XAllocStandardColormap (
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern XWMHints *XAllocWMHints (
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern int XClipBox(
-#if NeedFunctionPrototypes
-    Region		/* r */,
-    XRectangle*		/* rect_return */
-#endif
-);
-
-extern Region XCreateRegion(
-#if NeedFunctionPrototypes
-    void
-#endif
-);
-
-extern const char *XDefaultString (void);
-
-extern int XDeleteContext(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* rid */,
-    XContext		/* context */
-#endif
-);
-
-extern int XDestroyRegion(
-#if NeedFunctionPrototypes
-    Region		/* r */
-#endif
-);
-
-extern int XEmptyRegion(
-#if NeedFunctionPrototypes
-    Region		/* r */
-#endif
-);
-
-extern int XEqualRegion(
-#if NeedFunctionPrototypes
-    Region		/* r1 */,
-    Region		/* r2 */
-#endif
-);
-
-extern int XFindContext(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* rid */,
-    XContext		/* context */,
-    XPointer*		/* data_return */
-#endif
-);
-
-extern Status XGetClassHint(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XClassHint*		/* class_hints_return */
-#endif
-);
-
-extern Status XGetIconSizes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XIconSize**		/* size_list_return */,
-    int*		/* count_return */
-#endif
-);
-
-extern Status XGetNormalHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints_return */
-#endif
-);
-
-extern Status XGetRGBColormaps(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XStandardColormap** /* stdcmap_return */,
-    int*		/* count_return */,
-    Atom		/* property */
-#endif
-);
-
-extern Status XGetSizeHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints_return */,
-    Atom		/* property */
-#endif
-);
-
-extern Status XGetStandardColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XStandardColormap*	/* colormap_return */,
-    Atom		/* property */			    
-#endif
-);
-
-extern Status XGetTextProperty(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* window */,
-    XTextProperty*	/* text_prop_return */,
-    Atom		/* property */
-#endif
-);
-
-extern XVisualInfo *XGetVisualInfo(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    long		/* vinfo_mask */,
-    XVisualInfo*	/* vinfo_template */,
-    int*		/* nitems_return */
-#endif
-);
-
-extern Status XGetWMClientMachine(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop_return */
-#endif
-);
-
-extern XWMHints *XGetWMHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */		      
-#endif
-);
-
-extern Status XGetWMIconName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop_return */
-#endif
-);
-
-extern Status XGetWMName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop_return */
-#endif
-);
-
-extern Status XGetWMNormalHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints_return */,
-    long*		/* supplied_return */ 
-#endif
-);
-
-extern Status XGetWMSizeHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints_return */,
-    long*		/* supplied_return */,
-    Atom		/* property */
-#endif
-);
-
-extern Status XGetZoomHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* zhints_return */
-#endif
-);
-
-extern int XIntersectRegion(
-#if NeedFunctionPrototypes
-    Region		/* sra */,
-    Region		/* srb */,
-    Region		/* dr_return */
-#endif
-);
-
-extern void XConvertCase(
-#if NeedFunctionPrototypes
-    KeySym		/* sym */,
-    KeySym*		/* lower */,
-    KeySym*		/* upper */
-#endif
-);
-
-extern int XLookupString(
-#if NeedFunctionPrototypes
-    XKeyEvent*		/* event_struct */,
-    char*		/* buffer_return */,
-    int			/* bytes_buffer */,
-    KeySym*		/* keysym_return */,
-    XComposeStatus*	/* status_in_out */
-#endif
-);
-
-extern Status XMatchVisualInfo(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen */,
-    int			/* depth */,
-    int			/* class */,
-    XVisualInfo*	/* vinfo_return */
-#endif
-);
-
-extern int XOffsetRegion(
-#if NeedFunctionPrototypes
-    Region		/* r */,
-    int			/* dx */,
-    int			/* dy */
-#endif
-);
-
-extern Bool XPointInRegion(
-#if NeedFunctionPrototypes
-    Region		/* r */,
-    int			/* x */,
-    int			/* y */
-#endif
-);
-
-extern Region XPolygonRegion(
-#if NeedFunctionPrototypes
-    XPoint*		/* points */,
-    int			/* n */,
-    int			/* fill_rule */
-#endif
-);
-
-extern int XRectInRegion(
-#if NeedFunctionPrototypes
-    Region		/* r */,
-    int			/* x */,
-    int			/* y */,
-    unsigned int	/* width */,
-    unsigned int	/* height */
-#endif
-);
-
-extern int XSaveContext(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    XID			/* rid */,
-    XContext		/* context */,
-    _Xconst char*	/* data */
-#endif
-);
-
-extern int XSetClassHint(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XClassHint*		/* class_hints */
-#endif
-);
-
-extern int XSetIconSizes(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XIconSize*		/* size_list */,
-    int			/* count */    
-#endif
-);
-
-extern int XSetNormalHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints */
-#endif
-);
-
-extern void XSetRGBColormaps(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XStandardColormap*	/* stdcmaps */,
-    int			/* count */,
-    Atom		/* property */
-#endif
-);
-
-extern int XSetSizeHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints */,
-    Atom		/* property */
-#endif
-);
-
-extern int XSetStandardProperties(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    _Xconst char*	/* window_name */,
-    _Xconst char*	/* icon_name */,
-    Pixmap		/* icon_pixmap */,
-    char**		/* argv */,
-    int			/* argc */,
-    XSizeHints*		/* hints */
-#endif
-);
-
-extern void XSetTextProperty(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop */,
-    Atom		/* property */
-#endif
-);
-
-extern void XSetWMClientMachine(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop */
-#endif
-);
-
-extern int XSetWMHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XWMHints*		/* wm_hints */
-#endif
-);
-
-extern void XSetWMIconName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop */
-#endif
-);
-
-extern void XSetWMName(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* text_prop */
-#endif
-);
-
-extern void XSetWMNormalHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints */
-#endif
-);
-
-extern void XSetWMProperties(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XTextProperty*	/* window_name */,
-    XTextProperty*	/* icon_name */,
-    char**		/* argv */,
-    int			/* argc */,
-    XSizeHints*		/* normal_hints */,
-    XWMHints*		/* wm_hints */,
-    XClassHint*		/* class_hints */
-#endif
-);
-
-extern void XmbSetWMProperties(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    _Xconst char*	/* window_name */,
-    _Xconst char*	/* icon_name */,
-    char**		/* argv */,
-    int			/* argc */,
-    XSizeHints*		/* normal_hints */,
-    XWMHints*		/* wm_hints */,
-    XClassHint*		/* class_hints */
-#endif
-);
-
-extern void Xutf8SetWMProperties(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    _Xconst char*	/* window_name */,
-    _Xconst char*	/* icon_name */,
-    char**		/* argv */,
-    int			/* argc */,
-    XSizeHints*		/* normal_hints */,
-    XWMHints*		/* wm_hints */,
-    XClassHint*		/* class_hints */
-#endif
-);
-
-extern void XSetWMSizeHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* hints */,
-    Atom		/* property */
-#endif
-);
-
-extern int XSetRegion(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    GC			/* gc */,
-    Region		/* r */
-#endif
-);
-
-extern void XSetStandardColormap(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XStandardColormap*	/* colormap */,
-    Atom		/* property */
-#endif
-);
-
-extern int XSetZoomHints(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    Window		/* w */,
-    XSizeHints*		/* zhints */
-#endif
-);
-
-extern int XShrinkRegion(
-#if NeedFunctionPrototypes
-    Region		/* r */,
-    int			/* dx */,
-    int			/* dy */
-#endif
-);
-
-extern Status XStringListToTextProperty(
-#if NeedFunctionPrototypes
-    char**		/* list */,
-    int			/* count */,
-    XTextProperty*	/* text_prop_return */
-#endif
-);
-
-extern int XSubtractRegion(
-#if NeedFunctionPrototypes
-    Region		/* sra */,
-    Region		/* srb */,
-    Region		/* dr_return */
-#endif
-);
-
-extern int XmbTextListToTextProperty(
-    Display*		display,
-    char**		list,
-    int			count,
-    XICCEncodingStyle	style,
-    XTextProperty*	text_prop_return
-);
-
-extern int XwcTextListToTextProperty(
-    Display*		display,
-    wchar_t**		list,
-    int			count,
-    XICCEncodingStyle	style,
-    XTextProperty*	text_prop_return
-);
-
-extern int Xutf8TextListToTextProperty(
-    Display*		display,
-    char**		list,
-    int			count,
-    XICCEncodingStyle	style,
-    XTextProperty*	text_prop_return
-);
-
-extern void XwcFreeStringList(
-    wchar_t**		list
-);
-
-extern Status XTextPropertyToStringList(
-#if NeedFunctionPrototypes
-    XTextProperty*	/* text_prop */,
-    char***		/* list_return */,
-    int*		/* count_return */
-#endif
-);
-
-extern int XmbTextPropertyToTextList(
-    Display*		display,
-    const XTextProperty* text_prop,
-    char***		list_return,
-    int*		count_return
-);
-
-extern int XwcTextPropertyToTextList(
-    Display*		display,
-    const XTextProperty* text_prop,
-    wchar_t***		list_return,
-    int*		count_return
-);
-
-extern int Xutf8TextPropertyToTextList(
-    Display*		display,
-    const XTextProperty* text_prop,
-    char***		list_return,
-    int*		count_return
-);
-
-extern int XUnionRectWithRegion(
-#if NeedFunctionPrototypes
-    XRectangle*		/* rectangle */,
-    Region		/* src_region */,
-    Region		/* dest_region_return */
-#endif
-);
-
-extern int XUnionRegion(
-#if NeedFunctionPrototypes
-    Region		/* sra */,
-    Region		/* srb */,
-    Region		/* dr_return */
-#endif
-);
-
-extern int XWMGeometry(
-#if NeedFunctionPrototypes
-    Display*		/* display */,
-    int			/* screen_number */,
-    _Xconst char*	/* user_geometry */,
-    _Xconst char*	/* default_geometry */,
-    unsigned int	/* border_width */,
-    XSizeHints*		/* hints */,
-    int*		/* x_return */,
-    int*		/* y_return */,
-    int*		/* width_return */,
-    int*		/* height_return */,
-    int*		/* gravity_return */
-#endif
-);
-
-extern int XXorRegion(
-#if NeedFunctionPrototypes
-    Region		/* sra */,
-    Region		/* srb */,
-    Region		/* dr_return */
-#endif
-);
-
-_XFUNCPROTOEND
-#endif /* if 0 */
-
-#ifndef XATOM_H
-#define XATOM_H 1
-
-/* THIS IS A GENERATED FILE
- *
- * Do not change!  Changing this file implies a protocol change!
- */
-
-#define XA_PRIMARY ((Atom) 1)
-#define XA_SECONDARY ((Atom) 2)
-#define XA_ARC ((Atom) 3)
-#define XA_ATOM ((Atom) 4)
-#define XA_BITMAP ((Atom) 5)
-#define XA_CARDINAL ((Atom) 6)
-#define XA_COLORMAP ((Atom) 7)
-#define XA_CURSOR ((Atom) 8)
-#define XA_CUT_BUFFER0 ((Atom) 9)
-#define XA_CUT_BUFFER1 ((Atom) 10)
-#define XA_CUT_BUFFER2 ((Atom) 11)
-#define XA_CUT_BUFFER3 ((Atom) 12)
-#define XA_CUT_BUFFER4 ((Atom) 13)
-#define XA_CUT_BUFFER5 ((Atom) 14)
-#define XA_CUT_BUFFER6 ((Atom) 15)
-#define XA_CUT_BUFFER7 ((Atom) 16)
-#define XA_DRAWABLE ((Atom) 17)
-#define XA_FONT ((Atom) 18)
-#define XA_INTEGER ((Atom) 19)
-#define XA_PIXMAP ((Atom) 20)
-#define XA_POINT ((Atom) 21)
-#define XA_RECTANGLE ((Atom) 22)
-#define XA_RESOURCE_MANAGER ((Atom) 23)
-#define XA_RGB_COLOR_MAP ((Atom) 24)
-#define XA_RGB_BEST_MAP ((Atom) 25)
-#define XA_RGB_BLUE_MAP ((Atom) 26)
-#define XA_RGB_DEFAULT_MAP ((Atom) 27)
-#define XA_RGB_GRAY_MAP ((Atom) 28)
-#define XA_RGB_GREEN_MAP ((Atom) 29)
-#define XA_RGB_RED_MAP ((Atom) 30)
-#define XA_STRING ((Atom) 31)
-#define XA_VISUALID ((Atom) 32)
-#define XA_WINDOW ((Atom) 33)
-#define XA_WM_COMMAND ((Atom) 34)
-#define XA_WM_HINTS ((Atom) 35)
-#define XA_WM_CLIENT_MACHINE ((Atom) 36)
-#define XA_WM_ICON_NAME ((Atom) 37)
-#define XA_WM_ICON_SIZE ((Atom) 38)
-#define XA_WM_NAME ((Atom) 39)
-#define XA_WM_NORMAL_HINTS ((Atom) 40)
-#define XA_WM_SIZE_HINTS ((Atom) 41)
-#define XA_WM_ZOOM_HINTS ((Atom) 42)
-#define XA_MIN_SPACE ((Atom) 43)
-#define XA_NORM_SPACE ((Atom) 44)
-#define XA_MAX_SPACE ((Atom) 45)
-#define XA_END_SPACE ((Atom) 46)
-#define XA_SUPERSCRIPT_X ((Atom) 47)
-#define XA_SUPERSCRIPT_Y ((Atom) 48)
-#define XA_SUBSCRIPT_X ((Atom) 49)
-#define XA_SUBSCRIPT_Y ((Atom) 50)
-#define XA_UNDERLINE_POSITION ((Atom) 51)
-#define XA_UNDERLINE_THICKNESS ((Atom) 52)
-#define XA_STRIKEOUT_ASCENT ((Atom) 53)
-#define XA_STRIKEOUT_DESCENT ((Atom) 54)
-#define XA_ITALIC_ANGLE ((Atom) 55)
-#define XA_X_HEIGHT ((Atom) 56)
-#define XA_QUAD_WIDTH ((Atom) 57)
-#define XA_WEIGHT ((Atom) 58)
-#define XA_POINT_SIZE ((Atom) 59)
-#define XA_RESOLUTION ((Atom) 60)
-#define XA_COPYRIGHT ((Atom) 61)
-#define XA_NOTICE ((Atom) 62)
-#define XA_FONT_NAME ((Atom) 63)
-#define XA_FAMILY_NAME ((Atom) 64)
-#define XA_FULL_NAME ((Atom) 65)
-#define XA_CAP_HEIGHT ((Atom) 66)
-#define XA_WM_CLASS ((Atom) 67)
-#define XA_WM_TRANSIENT_FOR ((Atom) 68)
-
-#define XA_LAST_PREDEFINED ((Atom) 68)
-#endif /* XATOM_H */
-
-#endif /* _XUTIL_H_ */
-
-extern KeyCode XKeysymToKeycode(
-    Display*		/* display */,
-    KeySym		/* keysym */
-);
-extern KeySym XKeycodeToKeysym(
-    Display*		/* display */,
-    KeyCode		/* keycode */,
-    int			/* index */
-);
-extern char *XKeysymToString(
-    KeySym		/* keysym */
-);
-extern KeySym XStringToKeysym(
-    char*	/* string */
-);
-
-typedef int (*XErrorHandler) (	    /* WARNING, this type not in Xlib spec */
-    Display*		/* display */,
-    XErrorEvent*	/* error_event */
-);
-
-extern XErrorHandler XSetErrorHandler (
-    XErrorHandler	/* handler */
-);
-
-typedef int (*XIOErrorHandler) (    /* WARNING, this type not in Xlib spec */
-    Display*		/* display */
-);
-
-extern XIOErrorHandler XSetIOErrorHandler (
-    XIOErrorHandler	/* handler */
-);
-
-#define X_ShmQueryVersion               0
-#define X_ShmAttach                     1
-#define X_ShmDetach                     2
-#define X_ShmPutImage                   3
-#define X_ShmGetImage                   4
-#define X_ShmCreatePixmap               5
diff --git a/ica/x11/x11vnc/nox11_funcs.h b/ica/x11/x11vnc/nox11_funcs.h
deleted file mode 100644
index 6e3ac57..0000000
--- a/ica/x11/x11vnc/nox11_funcs.h
+++ /dev/null
@@ -1,2822 +0,0 @@
-#if 0
-generated by util script makekeysyms.pl:
-
------
-#!/usr/bin/perl
-
-print "#if 0\n";
-print "generated by util script makekeysyms.pl:\n\n";
-print "-----\n";
-system("cat $0");
-print "-----\n";
-print "#endif\n\n";
-
-# probably should use rfb/keysym.h:
-$file = shift;
-$file = "/usr/X11R6/include/X11/keysymdef.h" unless $file;
-
-open(KS, "<$file") || die "$file: $!";
-
-while (<KS>) {
-	chomp;
-	next if /^#define (XK_MISCELLANY|XK_XKB_KEYS|XK_LATIN1|XK_LATIN2|XK_LATIN3|XK_LATIN4|XK_GREEK)/;
-	next if /^#define (XK_LATIN8|XK_LATIN9|XK_CAUCASUS|XK_KATAKANA|XK_ARABIC|XK_CYRILLIC|XK_HEBREW|XK_THAI|XK_KOREAN|XK_ARMENIAN|XK_GEORGIAN|XK_VIETNAMESE|XK_CURRENCY)/;
-	if (/^#define\s+(XK_\w+)/) {
-		push @xk, $1;
-	} elsif (/^#(ifdef|ifndef|endif)/) {
-		$_ =~ s/ifndef XK_0/ifndef XK_0_nosuch/;
-		push @xk, $_;
-	}
-}
-close(KS);
-
-print <<"END";
-
-KeySym XStringToKeysym(char *s) {
-END
-foreach $ks (@xk) {
-	$s = $ks;
-	if ($ks =~ /#/) {
-		print "$ks\n";
-		next;
-	}
-	$s =~ s/^XK_//;
-	print "	if (!strcmp(s, \"$s\")) return $ks;\n";
-}
-print <<"END";
-	return NoSymbol;	
-}
-
-END
-
-print <<"END";
-
-char *XKeysymToString(KeySym k) {
-END
-foreach $ks (@xk) {
-	$s = $ks;
-	if ($ks =~ /#/) {
-		print "$ks\n";
-		next;
-	}
-	$s =~ s/^XK_//;
-	print "	if (k == $ks) return \"$s\";\n";
-}
-print <<"END";
-	return NULL;	
-}
-
-KeySym XKeycodeToKeysym(Display *display, KeyCode keycode, int index) {
-	return NoSymbol;
-}
-
-KeyCode XKeysymToKeycode(Display *display, KeySym keysym) {
-	return NoSymbol;
-}
-
-XErrorHandler XSetErrorHandler (XErrorHandler h) {
-	return h;
-}
-
-END
-
-exit 0;
------
-#endif
-
-
-KeySym XStringToKeysym(char *s) {
-#ifndef XK_0_nosuch
-	if (!strcmp(s, "VoidSymbol")) return XK_VoidSymbol;
-#ifdef XK_MISCELLANY
-	if (!strcmp(s, "BackSpace")) return XK_BackSpace;
-	if (!strcmp(s, "Tab")) return XK_Tab;
-	if (!strcmp(s, "Linefeed")) return XK_Linefeed;
-	if (!strcmp(s, "Clear")) return XK_Clear;
-	if (!strcmp(s, "Return")) return XK_Return;
-	if (!strcmp(s, "Pause")) return XK_Pause;
-	if (!strcmp(s, "Scroll_Lock")) return XK_Scroll_Lock;
-	if (!strcmp(s, "Sys_Req")) return XK_Sys_Req;
-	if (!strcmp(s, "Escape")) return XK_Escape;
-	if (!strcmp(s, "Delete")) return XK_Delete;
-	if (!strcmp(s, "Multi_key")) return XK_Multi_key;
-	if (!strcmp(s, "SingleCandidate")) return XK_SingleCandidate;
-	if (!strcmp(s, "MultipleCandidate")) return XK_MultipleCandidate;
-	if (!strcmp(s, "PreviousCandidate")) return XK_PreviousCandidate;
-	if (!strcmp(s, "Kanji")) return XK_Kanji;
-	if (!strcmp(s, "Muhenkan")) return XK_Muhenkan;
-	if (!strcmp(s, "Henkan_Mode")) return XK_Henkan_Mode;
-	if (!strcmp(s, "Henkan")) return XK_Henkan;
-	if (!strcmp(s, "Romaji")) return XK_Romaji;
-	if (!strcmp(s, "Hiragana")) return XK_Hiragana;
-	if (!strcmp(s, "Katakana")) return XK_Katakana;
-	if (!strcmp(s, "Hiragana_Katakana")) return XK_Hiragana_Katakana;
-	if (!strcmp(s, "Zenkaku")) return XK_Zenkaku;
-	if (!strcmp(s, "Hankaku")) return XK_Hankaku;
-	if (!strcmp(s, "Zenkaku_Hankaku")) return XK_Zenkaku_Hankaku;
-	if (!strcmp(s, "Touroku")) return XK_Touroku;
-	if (!strcmp(s, "Massyo")) return XK_Massyo;
-	if (!strcmp(s, "Kana_Lock")) return XK_Kana_Lock;
-	if (!strcmp(s, "Kana_Shift")) return XK_Kana_Shift;
-	if (!strcmp(s, "Eisu_Shift")) return XK_Eisu_Shift;
-	if (!strcmp(s, "Eisu_toggle")) return XK_Eisu_toggle;
-	if (!strcmp(s, "Zen_Koho")) return XK_Zen_Koho;
-	if (!strcmp(s, "Mae_Koho")) return XK_Mae_Koho;
-	if (!strcmp(s, "Home")) return XK_Home;
-	if (!strcmp(s, "Left")) return XK_Left;
-	if (!strcmp(s, "Up")) return XK_Up;
-	if (!strcmp(s, "Right")) return XK_Right;
-	if (!strcmp(s, "Down")) return XK_Down;
-	if (!strcmp(s, "Prior")) return XK_Prior;
-	if (!strcmp(s, "Page_Up")) return XK_Page_Up;
-	if (!strcmp(s, "Next")) return XK_Next;
-	if (!strcmp(s, "Page_Down")) return XK_Page_Down;
-	if (!strcmp(s, "End")) return XK_End;
-	if (!strcmp(s, "Begin")) return XK_Begin;
-	if (!strcmp(s, "Select")) return XK_Select;
-	if (!strcmp(s, "Print")) return XK_Print;
-	if (!strcmp(s, "Execute")) return XK_Execute;
-	if (!strcmp(s, "Insert")) return XK_Insert;
-	if (!strcmp(s, "Undo")) return XK_Undo;
-	if (!strcmp(s, "Redo")) return XK_Redo;
-	if (!strcmp(s, "Menu")) return XK_Menu;
-	if (!strcmp(s, "Find")) return XK_Find;
-	if (!strcmp(s, "Cancel")) return XK_Cancel;
-	if (!strcmp(s, "Help")) return XK_Help;
-	if (!strcmp(s, "Break")) return XK_Break;
-	if (!strcmp(s, "Mode_switch")) return XK_Mode_switch;
-	if (!strcmp(s, "script_switch")) return XK_script_switch;
-	if (!strcmp(s, "Num_Lock")) return XK_Num_Lock;
-	if (!strcmp(s, "KP_Space")) return XK_KP_Space;
-	if (!strcmp(s, "KP_Tab")) return XK_KP_Tab;
-	if (!strcmp(s, "KP_Enter")) return XK_KP_Enter;
-	if (!strcmp(s, "KP_F1")) return XK_KP_F1;
-	if (!strcmp(s, "KP_F2")) return XK_KP_F2;
-	if (!strcmp(s, "KP_F3")) return XK_KP_F3;
-	if (!strcmp(s, "KP_F4")) return XK_KP_F4;
-	if (!strcmp(s, "KP_Home")) return XK_KP_Home;
-	if (!strcmp(s, "KP_Left")) return XK_KP_Left;
-	if (!strcmp(s, "KP_Up")) return XK_KP_Up;
-	if (!strcmp(s, "KP_Right")) return XK_KP_Right;
-	if (!strcmp(s, "KP_Down")) return XK_KP_Down;
-	if (!strcmp(s, "KP_Prior")) return XK_KP_Prior;
-	if (!strcmp(s, "KP_Page_Up")) return XK_KP_Page_Up;
-	if (!strcmp(s, "KP_Next")) return XK_KP_Next;
-	if (!strcmp(s, "KP_Page_Down")) return XK_KP_Page_Down;
-	if (!strcmp(s, "KP_End")) return XK_KP_End;
-	if (!strcmp(s, "KP_Begin")) return XK_KP_Begin;
-	if (!strcmp(s, "KP_Insert")) return XK_KP_Insert;
-	if (!strcmp(s, "KP_Delete")) return XK_KP_Delete;
-	if (!strcmp(s, "KP_Equal")) return XK_KP_Equal;
-	if (!strcmp(s, "KP_Multiply")) return XK_KP_Multiply;
-	if (!strcmp(s, "KP_Add")) return XK_KP_Add;
-	if (!strcmp(s, "KP_Separator")) return XK_KP_Separator;
-	if (!strcmp(s, "KP_Subtract")) return XK_KP_Subtract;
-	if (!strcmp(s, "KP_Decimal")) return XK_KP_Decimal;
-	if (!strcmp(s, "KP_Divide")) return XK_KP_Divide;
-	if (!strcmp(s, "KP_0")) return XK_KP_0;
-	if (!strcmp(s, "KP_1")) return XK_KP_1;
-	if (!strcmp(s, "KP_2")) return XK_KP_2;
-	if (!strcmp(s, "KP_3")) return XK_KP_3;
-	if (!strcmp(s, "KP_4")) return XK_KP_4;
-	if (!strcmp(s, "KP_5")) return XK_KP_5;
-	if (!strcmp(s, "KP_6")) return XK_KP_6;
-	if (!strcmp(s, "KP_7")) return XK_KP_7;
-	if (!strcmp(s, "KP_8")) return XK_KP_8;
-	if (!strcmp(s, "KP_9")) return XK_KP_9;
-	if (!strcmp(s, "F1")) return XK_F1;
-	if (!strcmp(s, "F2")) return XK_F2;
-	if (!strcmp(s, "F3")) return XK_F3;
-	if (!strcmp(s, "F4")) return XK_F4;
-	if (!strcmp(s, "F5")) return XK_F5;
-	if (!strcmp(s, "F6")) return XK_F6;
-	if (!strcmp(s, "F7")) return XK_F7;
-	if (!strcmp(s, "F8")) return XK_F8;
-	if (!strcmp(s, "F9")) return XK_F9;
-	if (!strcmp(s, "F10")) return XK_F10;
-	if (!strcmp(s, "F11")) return XK_F11;
-	if (!strcmp(s, "L1")) return XK_L1;
-	if (!strcmp(s, "F12")) return XK_F12;
-	if (!strcmp(s, "L2")) return XK_L2;
-	if (!strcmp(s, "F13")) return XK_F13;
-	if (!strcmp(s, "L3")) return XK_L3;
-	if (!strcmp(s, "F14")) return XK_F14;
-	if (!strcmp(s, "L4")) return XK_L4;
-	if (!strcmp(s, "F15")) return XK_F15;
-	if (!strcmp(s, "L5")) return XK_L5;
-	if (!strcmp(s, "F16")) return XK_F16;
-	if (!strcmp(s, "L6")) return XK_L6;
-	if (!strcmp(s, "F17")) return XK_F17;
-	if (!strcmp(s, "L7")) return XK_L7;
-	if (!strcmp(s, "F18")) return XK_F18;
-	if (!strcmp(s, "L8")) return XK_L8;
-	if (!strcmp(s, "F19")) return XK_F19;
-	if (!strcmp(s, "L9")) return XK_L9;
-	if (!strcmp(s, "F20")) return XK_F20;
-	if (!strcmp(s, "L10")) return XK_L10;
-	if (!strcmp(s, "F21")) return XK_F21;
-	if (!strcmp(s, "R1")) return XK_R1;
-	if (!strcmp(s, "F22")) return XK_F22;
-	if (!strcmp(s, "R2")) return XK_R2;
-	if (!strcmp(s, "F23")) return XK_F23;
-	if (!strcmp(s, "R3")) return XK_R3;
-	if (!strcmp(s, "F24")) return XK_F24;
-	if (!strcmp(s, "R4")) return XK_R4;
-	if (!strcmp(s, "F25")) return XK_F25;
-	if (!strcmp(s, "R5")) return XK_R5;
-	if (!strcmp(s, "F26")) return XK_F26;
-	if (!strcmp(s, "R6")) return XK_R6;
-	if (!strcmp(s, "F27")) return XK_F27;
-	if (!strcmp(s, "R7")) return XK_R7;
-	if (!strcmp(s, "F28")) return XK_F28;
-	if (!strcmp(s, "R8")) return XK_R8;
-	if (!strcmp(s, "F29")) return XK_F29;
-	if (!strcmp(s, "R9")) return XK_R9;
-	if (!strcmp(s, "F30")) return XK_F30;
-	if (!strcmp(s, "R10")) return XK_R10;
-	if (!strcmp(s, "F31")) return XK_F31;
-	if (!strcmp(s, "R11")) return XK_R11;
-	if (!strcmp(s, "F32")) return XK_F32;
-	if (!strcmp(s, "R12")) return XK_R12;
-	if (!strcmp(s, "F33")) return XK_F33;
-	if (!strcmp(s, "R13")) return XK_R13;
-	if (!strcmp(s, "F34")) return XK_F34;
-	if (!strcmp(s, "R14")) return XK_R14;
-	if (!strcmp(s, "F35")) return XK_F35;
-	if (!strcmp(s, "R15")) return XK_R15;
-	if (!strcmp(s, "Shift_L")) return XK_Shift_L;
-	if (!strcmp(s, "Shift_R")) return XK_Shift_R;
-	if (!strcmp(s, "Control_L")) return XK_Control_L;
-	if (!strcmp(s, "Control_R")) return XK_Control_R;
-	if (!strcmp(s, "Caps_Lock")) return XK_Caps_Lock;
-	if (!strcmp(s, "Shift_Lock")) return XK_Shift_Lock;
-	if (!strcmp(s, "Meta_L")) return XK_Meta_L;
-	if (!strcmp(s, "Meta_R")) return XK_Meta_R;
-	if (!strcmp(s, "Alt_L")) return XK_Alt_L;
-	if (!strcmp(s, "Alt_R")) return XK_Alt_R;
-	if (!strcmp(s, "Super_L")) return XK_Super_L;
-	if (!strcmp(s, "Super_R")) return XK_Super_R;
-	if (!strcmp(s, "Hyper_L")) return XK_Hyper_L;
-	if (!strcmp(s, "Hyper_R")) return XK_Hyper_R;
-#endif /* XK_MISCELLANY */
-#ifdef XK_XKB_KEYS
-	if (!strcmp(s, "ISO_Lock")) return XK_ISO_Lock;
-	if (!strcmp(s, "ISO_Level2_Latch")) return XK_ISO_Level2_Latch;
-	if (!strcmp(s, "ISO_Level3_Shift")) return XK_ISO_Level3_Shift;
-	if (!strcmp(s, "ISO_Level3_Latch")) return XK_ISO_Level3_Latch;
-	if (!strcmp(s, "ISO_Level3_Lock")) return XK_ISO_Level3_Lock;
-	if (!strcmp(s, "ISO_Group_Shift")) return XK_ISO_Group_Shift;
-	if (!strcmp(s, "ISO_Group_Latch")) return XK_ISO_Group_Latch;
-	if (!strcmp(s, "ISO_Group_Lock")) return XK_ISO_Group_Lock;
-	if (!strcmp(s, "ISO_Next_Group")) return XK_ISO_Next_Group;
-	if (!strcmp(s, "ISO_Next_Group_Lock")) return XK_ISO_Next_Group_Lock;
-	if (!strcmp(s, "ISO_Prev_Group")) return XK_ISO_Prev_Group;
-	if (!strcmp(s, "ISO_Prev_Group_Lock")) return XK_ISO_Prev_Group_Lock;
-	if (!strcmp(s, "ISO_First_Group")) return XK_ISO_First_Group;
-	if (!strcmp(s, "ISO_First_Group_Lock")) return XK_ISO_First_Group_Lock;
-	if (!strcmp(s, "ISO_Last_Group")) return XK_ISO_Last_Group;
-	if (!strcmp(s, "ISO_Last_Group_Lock")) return XK_ISO_Last_Group_Lock;
-	if (!strcmp(s, "ISO_Left_Tab")) return XK_ISO_Left_Tab;
-	if (!strcmp(s, "ISO_Move_Line_Up")) return XK_ISO_Move_Line_Up;
-	if (!strcmp(s, "ISO_Move_Line_Down")) return XK_ISO_Move_Line_Down;
-	if (!strcmp(s, "ISO_Partial_Line_Up")) return XK_ISO_Partial_Line_Up;
-	if (!strcmp(s, "ISO_Partial_Line_Down")) return XK_ISO_Partial_Line_Down;
-	if (!strcmp(s, "ISO_Partial_Space_Left")) return XK_ISO_Partial_Space_Left;
-	if (!strcmp(s, "ISO_Partial_Space_Right")) return XK_ISO_Partial_Space_Right;
-	if (!strcmp(s, "ISO_Set_Margin_Left")) return XK_ISO_Set_Margin_Left;
-	if (!strcmp(s, "ISO_Set_Margin_Right")) return XK_ISO_Set_Margin_Right;
-	if (!strcmp(s, "ISO_Release_Margin_Left")) return XK_ISO_Release_Margin_Left;
-	if (!strcmp(s, "ISO_Release_Margin_Right")) return XK_ISO_Release_Margin_Right;
-	if (!strcmp(s, "ISO_Release_Both_Margins")) return XK_ISO_Release_Both_Margins;
-	if (!strcmp(s, "ISO_Fast_Cursor_Left")) return XK_ISO_Fast_Cursor_Left;
-	if (!strcmp(s, "ISO_Fast_Cursor_Right")) return XK_ISO_Fast_Cursor_Right;
-	if (!strcmp(s, "ISO_Fast_Cursor_Up")) return XK_ISO_Fast_Cursor_Up;
-	if (!strcmp(s, "ISO_Fast_Cursor_Down")) return XK_ISO_Fast_Cursor_Down;
-	if (!strcmp(s, "ISO_Continuous_Underline")) return XK_ISO_Continuous_Underline;
-	if (!strcmp(s, "ISO_Discontinuous_Underline")) return XK_ISO_Discontinuous_Underline;
-	if (!strcmp(s, "ISO_Emphasize")) return XK_ISO_Emphasize;
-	if (!strcmp(s, "ISO_Center_Object")) return XK_ISO_Center_Object;
-	if (!strcmp(s, "ISO_Enter")) return XK_ISO_Enter;
-	if (!strcmp(s, "dead_grave")) return XK_dead_grave;
-	if (!strcmp(s, "dead_acute")) return XK_dead_acute;
-	if (!strcmp(s, "dead_circumflex")) return XK_dead_circumflex;
-	if (!strcmp(s, "dead_tilde")) return XK_dead_tilde;
-	if (!strcmp(s, "dead_macron")) return XK_dead_macron;
-	if (!strcmp(s, "dead_breve")) return XK_dead_breve;
-	if (!strcmp(s, "dead_abovedot")) return XK_dead_abovedot;
-	if (!strcmp(s, "dead_diaeresis")) return XK_dead_diaeresis;
-	if (!strcmp(s, "dead_abovering")) return XK_dead_abovering;
-	if (!strcmp(s, "dead_doubleacute")) return XK_dead_doubleacute;
-	if (!strcmp(s, "dead_caron")) return XK_dead_caron;
-	if (!strcmp(s, "dead_cedilla")) return XK_dead_cedilla;
-	if (!strcmp(s, "dead_ogonek")) return XK_dead_ogonek;
-	if (!strcmp(s, "dead_iota")) return XK_dead_iota;
-	if (!strcmp(s, "dead_voiced_sound")) return XK_dead_voiced_sound;
-	if (!strcmp(s, "dead_semivoiced_sound")) return XK_dead_semivoiced_sound;
-	if (!strcmp(s, "dead_belowdot")) return XK_dead_belowdot;
-	if (!strcmp(s, "First_Virtual_Screen")) return XK_First_Virtual_Screen;
-	if (!strcmp(s, "Prev_Virtual_Screen")) return XK_Prev_Virtual_Screen;
-	if (!strcmp(s, "Next_Virtual_Screen")) return XK_Next_Virtual_Screen;
-	if (!strcmp(s, "Last_Virtual_Screen")) return XK_Last_Virtual_Screen;
-	if (!strcmp(s, "Terminate_Server")) return XK_Terminate_Server;
-	if (!strcmp(s, "AccessX_Enable")) return XK_AccessX_Enable;
-	if (!strcmp(s, "AccessX_Feedback_Enable")) return XK_AccessX_Feedback_Enable;
-	if (!strcmp(s, "RepeatKeys_Enable")) return XK_RepeatKeys_Enable;
-	if (!strcmp(s, "SlowKeys_Enable")) return XK_SlowKeys_Enable;
-	if (!strcmp(s, "BounceKeys_Enable")) return XK_BounceKeys_Enable;
-	if (!strcmp(s, "StickyKeys_Enable")) return XK_StickyKeys_Enable;
-	if (!strcmp(s, "MouseKeys_Enable")) return XK_MouseKeys_Enable;
-	if (!strcmp(s, "MouseKeys_Accel_Enable")) return XK_MouseKeys_Accel_Enable;
-	if (!strcmp(s, "Overlay1_Enable")) return XK_Overlay1_Enable;
-	if (!strcmp(s, "Overlay2_Enable")) return XK_Overlay2_Enable;
-	if (!strcmp(s, "AudibleBell_Enable")) return XK_AudibleBell_Enable;
-	if (!strcmp(s, "Pointer_Left")) return XK_Pointer_Left;
-	if (!strcmp(s, "Pointer_Right")) return XK_Pointer_Right;
-	if (!strcmp(s, "Pointer_Up")) return XK_Pointer_Up;
-	if (!strcmp(s, "Pointer_Down")) return XK_Pointer_Down;
-	if (!strcmp(s, "Pointer_UpLeft")) return XK_Pointer_UpLeft;
-	if (!strcmp(s, "Pointer_UpRight")) return XK_Pointer_UpRight;
-	if (!strcmp(s, "Pointer_DownLeft")) return XK_Pointer_DownLeft;
-	if (!strcmp(s, "Pointer_DownRight")) return XK_Pointer_DownRight;
-	if (!strcmp(s, "Pointer_Button_Dflt")) return XK_Pointer_Button_Dflt;
-	if (!strcmp(s, "Pointer_Button1")) return XK_Pointer_Button1;
-	if (!strcmp(s, "Pointer_Button2")) return XK_Pointer_Button2;
-	if (!strcmp(s, "Pointer_Button3")) return XK_Pointer_Button3;
-	if (!strcmp(s, "Pointer_Button4")) return XK_Pointer_Button4;
-	if (!strcmp(s, "Pointer_Button5")) return XK_Pointer_Button5;
-	if (!strcmp(s, "Pointer_DblClick_Dflt")) return XK_Pointer_DblClick_Dflt;
-	if (!strcmp(s, "Pointer_DblClick1")) return XK_Pointer_DblClick1;
-	if (!strcmp(s, "Pointer_DblClick2")) return XK_Pointer_DblClick2;
-	if (!strcmp(s, "Pointer_DblClick3")) return XK_Pointer_DblClick3;
-	if (!strcmp(s, "Pointer_DblClick4")) return XK_Pointer_DblClick4;
-	if (!strcmp(s, "Pointer_DblClick5")) return XK_Pointer_DblClick5;
-	if (!strcmp(s, "Pointer_Drag_Dflt")) return XK_Pointer_Drag_Dflt;
-	if (!strcmp(s, "Pointer_Drag1")) return XK_Pointer_Drag1;
-	if (!strcmp(s, "Pointer_Drag2")) return XK_Pointer_Drag2;
-	if (!strcmp(s, "Pointer_Drag3")) return XK_Pointer_Drag3;
-	if (!strcmp(s, "Pointer_Drag4")) return XK_Pointer_Drag4;
-	if (!strcmp(s, "Pointer_Drag5")) return XK_Pointer_Drag5;
-	if (!strcmp(s, "Pointer_EnableKeys")) return XK_Pointer_EnableKeys;
-	if (!strcmp(s, "Pointer_Accelerate")) return XK_Pointer_Accelerate;
-	if (!strcmp(s, "Pointer_DfltBtnNext")) return XK_Pointer_DfltBtnNext;
-	if (!strcmp(s, "Pointer_DfltBtnPrev")) return XK_Pointer_DfltBtnPrev;
-#endif
-#ifdef XK_3270
-	if (!strcmp(s, "3270_Duplicate")) return XK_3270_Duplicate;
-	if (!strcmp(s, "3270_FieldMark")) return XK_3270_FieldMark;
-	if (!strcmp(s, "3270_Right2")) return XK_3270_Right2;
-	if (!strcmp(s, "3270_Left2")) return XK_3270_Left2;
-	if (!strcmp(s, "3270_BackTab")) return XK_3270_BackTab;
-	if (!strcmp(s, "3270_EraseEOF")) return XK_3270_EraseEOF;
-	if (!strcmp(s, "3270_EraseInput")) return XK_3270_EraseInput;
-	if (!strcmp(s, "3270_Reset")) return XK_3270_Reset;
-	if (!strcmp(s, "3270_Quit")) return XK_3270_Quit;
-	if (!strcmp(s, "3270_PA1")) return XK_3270_PA1;
-	if (!strcmp(s, "3270_PA2")) return XK_3270_PA2;
-	if (!strcmp(s, "3270_PA3")) return XK_3270_PA3;
-	if (!strcmp(s, "3270_Test")) return XK_3270_Test;
-	if (!strcmp(s, "3270_Attn")) return XK_3270_Attn;
-	if (!strcmp(s, "3270_CursorBlink")) return XK_3270_CursorBlink;
-	if (!strcmp(s, "3270_AltCursor")) return XK_3270_AltCursor;
-	if (!strcmp(s, "3270_KeyClick")) return XK_3270_KeyClick;
-	if (!strcmp(s, "3270_Jump")) return XK_3270_Jump;
-	if (!strcmp(s, "3270_Ident")) return XK_3270_Ident;
-	if (!strcmp(s, "3270_Rule")) return XK_3270_Rule;
-	if (!strcmp(s, "3270_Copy")) return XK_3270_Copy;
-	if (!strcmp(s, "3270_Play")) return XK_3270_Play;
-	if (!strcmp(s, "3270_Setup")) return XK_3270_Setup;
-	if (!strcmp(s, "3270_Record")) return XK_3270_Record;
-	if (!strcmp(s, "3270_ChangeScreen")) return XK_3270_ChangeScreen;
-	if (!strcmp(s, "3270_DeleteWord")) return XK_3270_DeleteWord;
-	if (!strcmp(s, "3270_ExSelect")) return XK_3270_ExSelect;
-	if (!strcmp(s, "3270_CursorSelect")) return XK_3270_CursorSelect;
-	if (!strcmp(s, "3270_PrintScreen")) return XK_3270_PrintScreen;
-	if (!strcmp(s, "3270_Enter")) return XK_3270_Enter;
-#endif
-#ifdef XK_LATIN1
-	if (!strcmp(s, "space")) return XK_space;
-	if (!strcmp(s, "exclam")) return XK_exclam;
-	if (!strcmp(s, "quotedbl")) return XK_quotedbl;
-	if (!strcmp(s, "numbersign")) return XK_numbersign;
-	if (!strcmp(s, "dollar")) return XK_dollar;
-	if (!strcmp(s, "percent")) return XK_percent;
-	if (!strcmp(s, "ampersand")) return XK_ampersand;
-	if (!strcmp(s, "apostrophe")) return XK_apostrophe;
-	if (!strcmp(s, "quoteright")) return XK_quoteright;
-	if (!strcmp(s, "parenleft")) return XK_parenleft;
-	if (!strcmp(s, "parenright")) return XK_parenright;
-	if (!strcmp(s, "asterisk")) return XK_asterisk;
-	if (!strcmp(s, "plus")) return XK_plus;
-	if (!strcmp(s, "comma")) return XK_comma;
-	if (!strcmp(s, "minus")) return XK_minus;
-	if (!strcmp(s, "period")) return XK_period;
-	if (!strcmp(s, "slash")) return XK_slash;
-	if (!strcmp(s, "0")) return XK_0;
-	if (!strcmp(s, "1")) return XK_1;
-	if (!strcmp(s, "2")) return XK_2;
-	if (!strcmp(s, "3")) return XK_3;
-	if (!strcmp(s, "4")) return XK_4;
-	if (!strcmp(s, "5")) return XK_5;
-	if (!strcmp(s, "6")) return XK_6;
-	if (!strcmp(s, "7")) return XK_7;
-	if (!strcmp(s, "8")) return XK_8;
-	if (!strcmp(s, "9")) return XK_9;
-	if (!strcmp(s, "colon")) return XK_colon;
-	if (!strcmp(s, "semicolon")) return XK_semicolon;
-	if (!strcmp(s, "less")) return XK_less;
-	if (!strcmp(s, "equal")) return XK_equal;
-	if (!strcmp(s, "greater")) return XK_greater;
-	if (!strcmp(s, "question")) return XK_question;
-	if (!strcmp(s, "at")) return XK_at;
-	if (!strcmp(s, "A")) return XK_A;
-	if (!strcmp(s, "B")) return XK_B;
-	if (!strcmp(s, "C")) return XK_C;
-	if (!strcmp(s, "D")) return XK_D;
-	if (!strcmp(s, "E")) return XK_E;
-	if (!strcmp(s, "F")) return XK_F;
-	if (!strcmp(s, "G")) return XK_G;
-	if (!strcmp(s, "H")) return XK_H;
-	if (!strcmp(s, "I")) return XK_I;
-	if (!strcmp(s, "J")) return XK_J;
-	if (!strcmp(s, "K")) return XK_K;
-	if (!strcmp(s, "L")) return XK_L;
-	if (!strcmp(s, "M")) return XK_M;
-	if (!strcmp(s, "N")) return XK_N;
-	if (!strcmp(s, "O")) return XK_O;
-	if (!strcmp(s, "P")) return XK_P;
-	if (!strcmp(s, "Q")) return XK_Q;
-	if (!strcmp(s, "R")) return XK_R;
-	if (!strcmp(s, "S")) return XK_S;
-	if (!strcmp(s, "T")) return XK_T;
-	if (!strcmp(s, "U")) return XK_U;
-	if (!strcmp(s, "V")) return XK_V;
-	if (!strcmp(s, "W")) return XK_W;
-	if (!strcmp(s, "X")) return XK_X;
-	if (!strcmp(s, "Y")) return XK_Y;
-	if (!strcmp(s, "Z")) return XK_Z;
-	if (!strcmp(s, "bracketleft")) return XK_bracketleft;
-	if (!strcmp(s, "backslash")) return XK_backslash;
-	if (!strcmp(s, "bracketright")) return XK_bracketright;
-	if (!strcmp(s, "asciicircum")) return XK_asciicircum;
-	if (!strcmp(s, "underscore")) return XK_underscore;
-	if (!strcmp(s, "grave")) return XK_grave;
-	if (!strcmp(s, "quoteleft")) return XK_quoteleft;
-	if (!strcmp(s, "a")) return XK_a;
-	if (!strcmp(s, "b")) return XK_b;
-	if (!strcmp(s, "c")) return XK_c;
-	if (!strcmp(s, "d")) return XK_d;
-	if (!strcmp(s, "e")) return XK_e;
-	if (!strcmp(s, "f")) return XK_f;
-	if (!strcmp(s, "g")) return XK_g;
-	if (!strcmp(s, "h")) return XK_h;
-	if (!strcmp(s, "i")) return XK_i;
-	if (!strcmp(s, "j")) return XK_j;
-	if (!strcmp(s, "k")) return XK_k;
-	if (!strcmp(s, "l")) return XK_l;
-	if (!strcmp(s, "m")) return XK_m;
-	if (!strcmp(s, "n")) return XK_n;
-	if (!strcmp(s, "o")) return XK_o;
-	if (!strcmp(s, "p")) return XK_p;
-	if (!strcmp(s, "q")) return XK_q;
-	if (!strcmp(s, "r")) return XK_r;
-	if (!strcmp(s, "s")) return XK_s;
-	if (!strcmp(s, "t")) return XK_t;
-	if (!strcmp(s, "u")) return XK_u;
-	if (!strcmp(s, "v")) return XK_v;
-	if (!strcmp(s, "w")) return XK_w;
-	if (!strcmp(s, "x")) return XK_x;
-	if (!strcmp(s, "y")) return XK_y;
-	if (!strcmp(s, "z")) return XK_z;
-	if (!strcmp(s, "braceleft")) return XK_braceleft;
-	if (!strcmp(s, "bar")) return XK_bar;
-	if (!strcmp(s, "braceright")) return XK_braceright;
-	if (!strcmp(s, "asciitilde")) return XK_asciitilde;
-	if (!strcmp(s, "nobreakspace")) return XK_nobreakspace;
-	if (!strcmp(s, "exclamdown")) return XK_exclamdown;
-	if (!strcmp(s, "cent")) return XK_cent;
-	if (!strcmp(s, "sterling")) return XK_sterling;
-	if (!strcmp(s, "currency")) return XK_currency;
-	if (!strcmp(s, "yen")) return XK_yen;
-	if (!strcmp(s, "brokenbar")) return XK_brokenbar;
-	if (!strcmp(s, "section")) return XK_section;
-	if (!strcmp(s, "diaeresis")) return XK_diaeresis;
-	if (!strcmp(s, "copyright")) return XK_copyright;
-	if (!strcmp(s, "ordfeminine")) return XK_ordfeminine;
-	if (!strcmp(s, "guillemotleft")) return XK_guillemotleft;
-	if (!strcmp(s, "notsign")) return XK_notsign;
-	if (!strcmp(s, "hyphen")) return XK_hyphen;
-	if (!strcmp(s, "registered")) return XK_registered;
-	if (!strcmp(s, "macron")) return XK_macron;
-	if (!strcmp(s, "degree")) return XK_degree;
-	if (!strcmp(s, "plusminus")) return XK_plusminus;
-	if (!strcmp(s, "twosuperior")) return XK_twosuperior;
-	if (!strcmp(s, "threesuperior")) return XK_threesuperior;
-	if (!strcmp(s, "acute")) return XK_acute;
-	if (!strcmp(s, "mu")) return XK_mu;
-	if (!strcmp(s, "paragraph")) return XK_paragraph;
-	if (!strcmp(s, "periodcentered")) return XK_periodcentered;
-	if (!strcmp(s, "cedilla")) return XK_cedilla;
-	if (!strcmp(s, "onesuperior")) return XK_onesuperior;
-	if (!strcmp(s, "masculine")) return XK_masculine;
-	if (!strcmp(s, "guillemotright")) return XK_guillemotright;
-	if (!strcmp(s, "onequarter")) return XK_onequarter;
-	if (!strcmp(s, "onehalf")) return XK_onehalf;
-	if (!strcmp(s, "threequarters")) return XK_threequarters;
-	if (!strcmp(s, "questiondown")) return XK_questiondown;
-	if (!strcmp(s, "Agrave")) return XK_Agrave;
-	if (!strcmp(s, "Aacute")) return XK_Aacute;
-	if (!strcmp(s, "Acircumflex")) return XK_Acircumflex;
-	if (!strcmp(s, "Atilde")) return XK_Atilde;
-	if (!strcmp(s, "Adiaeresis")) return XK_Adiaeresis;
-	if (!strcmp(s, "Aring")) return XK_Aring;
-	if (!strcmp(s, "AE")) return XK_AE;
-	if (!strcmp(s, "Ccedilla")) return XK_Ccedilla;
-	if (!strcmp(s, "Egrave")) return XK_Egrave;
-	if (!strcmp(s, "Eacute")) return XK_Eacute;
-	if (!strcmp(s, "Ecircumflex")) return XK_Ecircumflex;
-	if (!strcmp(s, "Ediaeresis")) return XK_Ediaeresis;
-	if (!strcmp(s, "Igrave")) return XK_Igrave;
-	if (!strcmp(s, "Iacute")) return XK_Iacute;
-	if (!strcmp(s, "Icircumflex")) return XK_Icircumflex;
-	if (!strcmp(s, "Idiaeresis")) return XK_Idiaeresis;
-	if (!strcmp(s, "ETH")) return XK_ETH;
-	if (!strcmp(s, "Eth")) return XK_Eth;
-	if (!strcmp(s, "Ntilde")) return XK_Ntilde;
-	if (!strcmp(s, "Ograve")) return XK_Ograve;
-	if (!strcmp(s, "Oacute")) return XK_Oacute;
-	if (!strcmp(s, "Ocircumflex")) return XK_Ocircumflex;
-	if (!strcmp(s, "Otilde")) return XK_Otilde;
-	if (!strcmp(s, "Odiaeresis")) return XK_Odiaeresis;
-	if (!strcmp(s, "multiply")) return XK_multiply;
-	if (!strcmp(s, "Ooblique")) return XK_Ooblique;
-	if (!strcmp(s, "Ugrave")) return XK_Ugrave;
-	if (!strcmp(s, "Uacute")) return XK_Uacute;
-	if (!strcmp(s, "Ucircumflex")) return XK_Ucircumflex;
-	if (!strcmp(s, "Udiaeresis")) return XK_Udiaeresis;
-	if (!strcmp(s, "Yacute")) return XK_Yacute;
-	if (!strcmp(s, "THORN")) return XK_THORN;
-	if (!strcmp(s, "Thorn")) return XK_Thorn;
-	if (!strcmp(s, "ssharp")) return XK_ssharp;
-	if (!strcmp(s, "agrave")) return XK_agrave;
-	if (!strcmp(s, "aacute")) return XK_aacute;
-	if (!strcmp(s, "acircumflex")) return XK_acircumflex;
-	if (!strcmp(s, "atilde")) return XK_atilde;
-	if (!strcmp(s, "adiaeresis")) return XK_adiaeresis;
-	if (!strcmp(s, "aring")) return XK_aring;
-	if (!strcmp(s, "ae")) return XK_ae;
-	if (!strcmp(s, "ccedilla")) return XK_ccedilla;
-	if (!strcmp(s, "egrave")) return XK_egrave;
-	if (!strcmp(s, "eacute")) return XK_eacute;
-	if (!strcmp(s, "ecircumflex")) return XK_ecircumflex;
-	if (!strcmp(s, "ediaeresis")) return XK_ediaeresis;
-	if (!strcmp(s, "igrave")) return XK_igrave;
-	if (!strcmp(s, "iacute")) return XK_iacute;
-	if (!strcmp(s, "icircumflex")) return XK_icircumflex;
-	if (!strcmp(s, "idiaeresis")) return XK_idiaeresis;
-	if (!strcmp(s, "eth")) return XK_eth;
-	if (!strcmp(s, "ntilde")) return XK_ntilde;
-	if (!strcmp(s, "ograve")) return XK_ograve;
-	if (!strcmp(s, "oacute")) return XK_oacute;
-	if (!strcmp(s, "ocircumflex")) return XK_ocircumflex;
-	if (!strcmp(s, "otilde")) return XK_otilde;
-	if (!strcmp(s, "odiaeresis")) return XK_odiaeresis;
-	if (!strcmp(s, "division")) return XK_division;
-	if (!strcmp(s, "oslash")) return XK_oslash;
-	if (!strcmp(s, "ugrave")) return XK_ugrave;
-	if (!strcmp(s, "uacute")) return XK_uacute;
-	if (!strcmp(s, "ucircumflex")) return XK_ucircumflex;
-	if (!strcmp(s, "udiaeresis")) return XK_udiaeresis;
-	if (!strcmp(s, "yacute")) return XK_yacute;
-	if (!strcmp(s, "thorn")) return XK_thorn;
-	if (!strcmp(s, "ydiaeresis")) return XK_ydiaeresis;
-#endif /* XK_LATIN1 */
-#ifdef XK_LATIN2
-	if (!strcmp(s, "Aogonek")) return XK_Aogonek;
-	if (!strcmp(s, "breve")) return XK_breve;
-	if (!strcmp(s, "Lstroke")) return XK_Lstroke;
-	if (!strcmp(s, "Lcaron")) return XK_Lcaron;
-	if (!strcmp(s, "Sacute")) return XK_Sacute;
-	if (!strcmp(s, "Scaron")) return XK_Scaron;
-	if (!strcmp(s, "Scedilla")) return XK_Scedilla;
-	if (!strcmp(s, "Tcaron")) return XK_Tcaron;
-	if (!strcmp(s, "Zacute")) return XK_Zacute;
-	if (!strcmp(s, "Zcaron")) return XK_Zcaron;
-	if (!strcmp(s, "Zabovedot")) return XK_Zabovedot;
-	if (!strcmp(s, "aogonek")) return XK_aogonek;
-	if (!strcmp(s, "ogonek")) return XK_ogonek;
-	if (!strcmp(s, "lstroke")) return XK_lstroke;
-	if (!strcmp(s, "lcaron")) return XK_lcaron;
-	if (!strcmp(s, "sacute")) return XK_sacute;
-	if (!strcmp(s, "caron")) return XK_caron;
-	if (!strcmp(s, "scaron")) return XK_scaron;
-	if (!strcmp(s, "scedilla")) return XK_scedilla;
-	if (!strcmp(s, "tcaron")) return XK_tcaron;
-	if (!strcmp(s, "zacute")) return XK_zacute;
-	if (!strcmp(s, "doubleacute")) return XK_doubleacute;
-	if (!strcmp(s, "zcaron")) return XK_zcaron;
-	if (!strcmp(s, "zabovedot")) return XK_zabovedot;
-	if (!strcmp(s, "Racute")) return XK_Racute;
-	if (!strcmp(s, "Abreve")) return XK_Abreve;
-	if (!strcmp(s, "Lacute")) return XK_Lacute;
-	if (!strcmp(s, "Cacute")) return XK_Cacute;
-	if (!strcmp(s, "Ccaron")) return XK_Ccaron;
-	if (!strcmp(s, "Eogonek")) return XK_Eogonek;
-	if (!strcmp(s, "Ecaron")) return XK_Ecaron;
-	if (!strcmp(s, "Dcaron")) return XK_Dcaron;
-	if (!strcmp(s, "Dstroke")) return XK_Dstroke;
-	if (!strcmp(s, "Nacute")) return XK_Nacute;
-	if (!strcmp(s, "Ncaron")) return XK_Ncaron;
-	if (!strcmp(s, "Odoubleacute")) return XK_Odoubleacute;
-	if (!strcmp(s, "Rcaron")) return XK_Rcaron;
-	if (!strcmp(s, "Uring")) return XK_Uring;
-	if (!strcmp(s, "Udoubleacute")) return XK_Udoubleacute;
-	if (!strcmp(s, "Tcedilla")) return XK_Tcedilla;
-	if (!strcmp(s, "racute")) return XK_racute;
-	if (!strcmp(s, "abreve")) return XK_abreve;
-	if (!strcmp(s, "lacute")) return XK_lacute;
-	if (!strcmp(s, "cacute")) return XK_cacute;
-	if (!strcmp(s, "ccaron")) return XK_ccaron;
-	if (!strcmp(s, "eogonek")) return XK_eogonek;
-	if (!strcmp(s, "ecaron")) return XK_ecaron;
-	if (!strcmp(s, "dcaron")) return XK_dcaron;
-	if (!strcmp(s, "dstroke")) return XK_dstroke;
-	if (!strcmp(s, "nacute")) return XK_nacute;
-	if (!strcmp(s, "ncaron")) return XK_ncaron;
-	if (!strcmp(s, "odoubleacute")) return XK_odoubleacute;
-	if (!strcmp(s, "udoubleacute")) return XK_udoubleacute;
-	if (!strcmp(s, "rcaron")) return XK_rcaron;
-	if (!strcmp(s, "uring")) return XK_uring;
-	if (!strcmp(s, "tcedilla")) return XK_tcedilla;
-	if (!strcmp(s, "abovedot")) return XK_abovedot;
-#endif /* XK_LATIN2 */
-#ifdef XK_LATIN3
-	if (!strcmp(s, "Hstroke")) return XK_Hstroke;
-	if (!strcmp(s, "Hcircumflex")) return XK_Hcircumflex;
-	if (!strcmp(s, "Iabovedot")) return XK_Iabovedot;
-	if (!strcmp(s, "Gbreve")) return XK_Gbreve;
-	if (!strcmp(s, "Jcircumflex")) return XK_Jcircumflex;
-	if (!strcmp(s, "hstroke")) return XK_hstroke;
-	if (!strcmp(s, "hcircumflex")) return XK_hcircumflex;
-	if (!strcmp(s, "idotless")) return XK_idotless;
-	if (!strcmp(s, "gbreve")) return XK_gbreve;
-	if (!strcmp(s, "jcircumflex")) return XK_jcircumflex;
-	if (!strcmp(s, "Cabovedot")) return XK_Cabovedot;
-	if (!strcmp(s, "Ccircumflex")) return XK_Ccircumflex;
-	if (!strcmp(s, "Gabovedot")) return XK_Gabovedot;
-	if (!strcmp(s, "Gcircumflex")) return XK_Gcircumflex;
-	if (!strcmp(s, "Ubreve")) return XK_Ubreve;
-	if (!strcmp(s, "Scircumflex")) return XK_Scircumflex;
-	if (!strcmp(s, "cabovedot")) return XK_cabovedot;
-	if (!strcmp(s, "ccircumflex")) return XK_ccircumflex;
-	if (!strcmp(s, "gabovedot")) return XK_gabovedot;
-	if (!strcmp(s, "gcircumflex")) return XK_gcircumflex;
-	if (!strcmp(s, "ubreve")) return XK_ubreve;
-	if (!strcmp(s, "scircumflex")) return XK_scircumflex;
-#endif /* XK_LATIN3 */
-#ifdef XK_LATIN4
-	if (!strcmp(s, "kra")) return XK_kra;
-	if (!strcmp(s, "kappa")) return XK_kappa;
-	if (!strcmp(s, "Rcedilla")) return XK_Rcedilla;
-	if (!strcmp(s, "Itilde")) return XK_Itilde;
-	if (!strcmp(s, "Lcedilla")) return XK_Lcedilla;
-	if (!strcmp(s, "Emacron")) return XK_Emacron;
-	if (!strcmp(s, "Gcedilla")) return XK_Gcedilla;
-	if (!strcmp(s, "Tslash")) return XK_Tslash;
-	if (!strcmp(s, "rcedilla")) return XK_rcedilla;
-	if (!strcmp(s, "itilde")) return XK_itilde;
-	if (!strcmp(s, "lcedilla")) return XK_lcedilla;
-	if (!strcmp(s, "emacron")) return XK_emacron;
-	if (!strcmp(s, "gcedilla")) return XK_gcedilla;
-	if (!strcmp(s, "tslash")) return XK_tslash;
-	if (!strcmp(s, "ENG")) return XK_ENG;
-	if (!strcmp(s, "eng")) return XK_eng;
-	if (!strcmp(s, "Amacron")) return XK_Amacron;
-	if (!strcmp(s, "Iogonek")) return XK_Iogonek;
-	if (!strcmp(s, "Eabovedot")) return XK_Eabovedot;
-	if (!strcmp(s, "Imacron")) return XK_Imacron;
-	if (!strcmp(s, "Ncedilla")) return XK_Ncedilla;
-	if (!strcmp(s, "Omacron")) return XK_Omacron;
-	if (!strcmp(s, "Kcedilla")) return XK_Kcedilla;
-	if (!strcmp(s, "Uogonek")) return XK_Uogonek;
-	if (!strcmp(s, "Utilde")) return XK_Utilde;
-	if (!strcmp(s, "Umacron")) return XK_Umacron;
-	if (!strcmp(s, "amacron")) return XK_amacron;
-	if (!strcmp(s, "iogonek")) return XK_iogonek;
-	if (!strcmp(s, "eabovedot")) return XK_eabovedot;
-	if (!strcmp(s, "imacron")) return XK_imacron;
-	if (!strcmp(s, "ncedilla")) return XK_ncedilla;
-	if (!strcmp(s, "omacron")) return XK_omacron;
-	if (!strcmp(s, "kcedilla")) return XK_kcedilla;
-	if (!strcmp(s, "uogonek")) return XK_uogonek;
-	if (!strcmp(s, "utilde")) return XK_utilde;
-	if (!strcmp(s, "umacron")) return XK_umacron;
-#endif /* XK_LATIN4 */
-#ifdef XK_KATAKANA
-	if (!strcmp(s, "overline")) return XK_overline;
-	if (!strcmp(s, "kana_fullstop")) return XK_kana_fullstop;
-	if (!strcmp(s, "kana_openingbracket")) return XK_kana_openingbracket;
-	if (!strcmp(s, "kana_closingbracket")) return XK_kana_closingbracket;
-	if (!strcmp(s, "kana_comma")) return XK_kana_comma;
-	if (!strcmp(s, "kana_conjunctive")) return XK_kana_conjunctive;
-	if (!strcmp(s, "kana_middledot")) return XK_kana_middledot;
-	if (!strcmp(s, "kana_WO")) return XK_kana_WO;
-	if (!strcmp(s, "kana_a")) return XK_kana_a;
-	if (!strcmp(s, "kana_i")) return XK_kana_i;
-	if (!strcmp(s, "kana_u")) return XK_kana_u;
-	if (!strcmp(s, "kana_e")) return XK_kana_e;
-	if (!strcmp(s, "kana_o")) return XK_kana_o;
-	if (!strcmp(s, "kana_ya")) return XK_kana_ya;
-	if (!strcmp(s, "kana_yu")) return XK_kana_yu;
-	if (!strcmp(s, "kana_yo")) return XK_kana_yo;
-	if (!strcmp(s, "kana_tsu")) return XK_kana_tsu;
-	if (!strcmp(s, "kana_tu")) return XK_kana_tu;
-	if (!strcmp(s, "prolongedsound")) return XK_prolongedsound;
-	if (!strcmp(s, "kana_A")) return XK_kana_A;
-	if (!strcmp(s, "kana_I")) return XK_kana_I;
-	if (!strcmp(s, "kana_U")) return XK_kana_U;
-	if (!strcmp(s, "kana_E")) return XK_kana_E;
-	if (!strcmp(s, "kana_O")) return XK_kana_O;
-	if (!strcmp(s, "kana_KA")) return XK_kana_KA;
-	if (!strcmp(s, "kana_KI")) return XK_kana_KI;
-	if (!strcmp(s, "kana_KU")) return XK_kana_KU;
-	if (!strcmp(s, "kana_KE")) return XK_kana_KE;
-	if (!strcmp(s, "kana_KO")) return XK_kana_KO;
-	if (!strcmp(s, "kana_SA")) return XK_kana_SA;
-	if (!strcmp(s, "kana_SHI")) return XK_kana_SHI;
-	if (!strcmp(s, "kana_SU")) return XK_kana_SU;
-	if (!strcmp(s, "kana_SE")) return XK_kana_SE;
-	if (!strcmp(s, "kana_SO")) return XK_kana_SO;
-	if (!strcmp(s, "kana_TA")) return XK_kana_TA;
-	if (!strcmp(s, "kana_CHI")) return XK_kana_CHI;
-	if (!strcmp(s, "kana_TI")) return XK_kana_TI;
-	if (!strcmp(s, "kana_TSU")) return XK_kana_TSU;
-	if (!strcmp(s, "kana_TU")) return XK_kana_TU;
-	if (!strcmp(s, "kana_TE")) return XK_kana_TE;
-	if (!strcmp(s, "kana_TO")) return XK_kana_TO;
-	if (!strcmp(s, "kana_NA")) return XK_kana_NA;
-	if (!strcmp(s, "kana_NI")) return XK_kana_NI;
-	if (!strcmp(s, "kana_NU")) return XK_kana_NU;
-	if (!strcmp(s, "kana_NE")) return XK_kana_NE;
-	if (!strcmp(s, "kana_NO")) return XK_kana_NO;
-	if (!strcmp(s, "kana_HA")) return XK_kana_HA;
-	if (!strcmp(s, "kana_HI")) return XK_kana_HI;
-	if (!strcmp(s, "kana_FU")) return XK_kana_FU;
-	if (!strcmp(s, "kana_HU")) return XK_kana_HU;
-	if (!strcmp(s, "kana_HE")) return XK_kana_HE;
-	if (!strcmp(s, "kana_HO")) return XK_kana_HO;
-	if (!strcmp(s, "kana_MA")) return XK_kana_MA;
-	if (!strcmp(s, "kana_MI")) return XK_kana_MI;
-	if (!strcmp(s, "kana_MU")) return XK_kana_MU;
-	if (!strcmp(s, "kana_ME")) return XK_kana_ME;
-	if (!strcmp(s, "kana_MO")) return XK_kana_MO;
-	if (!strcmp(s, "kana_YA")) return XK_kana_YA;
-	if (!strcmp(s, "kana_YU")) return XK_kana_YU;
-	if (!strcmp(s, "kana_YO")) return XK_kana_YO;
-	if (!strcmp(s, "kana_RA")) return XK_kana_RA;
-	if (!strcmp(s, "kana_RI")) return XK_kana_RI;
-	if (!strcmp(s, "kana_RU")) return XK_kana_RU;
-	if (!strcmp(s, "kana_RE")) return XK_kana_RE;
-	if (!strcmp(s, "kana_RO")) return XK_kana_RO;
-	if (!strcmp(s, "kana_WA")) return XK_kana_WA;
-	if (!strcmp(s, "kana_N")) return XK_kana_N;
-	if (!strcmp(s, "voicedsound")) return XK_voicedsound;
-	if (!strcmp(s, "semivoicedsound")) return XK_semivoicedsound;
-	if (!strcmp(s, "kana_switch")) return XK_kana_switch;
-#endif /* XK_KATAKANA */
-#ifdef XK_ARABIC
-	if (!strcmp(s, "Arabic_comma")) return XK_Arabic_comma;
-	if (!strcmp(s, "Arabic_semicolon")) return XK_Arabic_semicolon;
-	if (!strcmp(s, "Arabic_question_mark")) return XK_Arabic_question_mark;
-	if (!strcmp(s, "Arabic_hamza")) return XK_Arabic_hamza;
-	if (!strcmp(s, "Arabic_maddaonalef")) return XK_Arabic_maddaonalef;
-	if (!strcmp(s, "Arabic_hamzaonalef")) return XK_Arabic_hamzaonalef;
-	if (!strcmp(s, "Arabic_hamzaonwaw")) return XK_Arabic_hamzaonwaw;
-	if (!strcmp(s, "Arabic_hamzaunderalef")) return XK_Arabic_hamzaunderalef;
-	if (!strcmp(s, "Arabic_hamzaonyeh")) return XK_Arabic_hamzaonyeh;
-	if (!strcmp(s, "Arabic_alef")) return XK_Arabic_alef;
-	if (!strcmp(s, "Arabic_beh")) return XK_Arabic_beh;
-	if (!strcmp(s, "Arabic_tehmarbuta")) return XK_Arabic_tehmarbuta;
-	if (!strcmp(s, "Arabic_teh")) return XK_Arabic_teh;
-	if (!strcmp(s, "Arabic_theh")) return XK_Arabic_theh;
-	if (!strcmp(s, "Arabic_jeem")) return XK_Arabic_jeem;
-	if (!strcmp(s, "Arabic_hah")) return XK_Arabic_hah;
-	if (!strcmp(s, "Arabic_khah")) return XK_Arabic_khah;
-	if (!strcmp(s, "Arabic_dal")) return XK_Arabic_dal;
-	if (!strcmp(s, "Arabic_thal")) return XK_Arabic_thal;
-	if (!strcmp(s, "Arabic_ra")) return XK_Arabic_ra;
-	if (!strcmp(s, "Arabic_zain")) return XK_Arabic_zain;
-	if (!strcmp(s, "Arabic_seen")) return XK_Arabic_seen;
-	if (!strcmp(s, "Arabic_sheen")) return XK_Arabic_sheen;
-	if (!strcmp(s, "Arabic_sad")) return XK_Arabic_sad;
-	if (!strcmp(s, "Arabic_dad")) return XK_Arabic_dad;
-	if (!strcmp(s, "Arabic_tah")) return XK_Arabic_tah;
-	if (!strcmp(s, "Arabic_zah")) return XK_Arabic_zah;
-	if (!strcmp(s, "Arabic_ain")) return XK_Arabic_ain;
-	if (!strcmp(s, "Arabic_ghain")) return XK_Arabic_ghain;
-	if (!strcmp(s, "Arabic_tatweel")) return XK_Arabic_tatweel;
-	if (!strcmp(s, "Arabic_feh")) return XK_Arabic_feh;
-	if (!strcmp(s, "Arabic_qaf")) return XK_Arabic_qaf;
-	if (!strcmp(s, "Arabic_kaf")) return XK_Arabic_kaf;
-	if (!strcmp(s, "Arabic_lam")) return XK_Arabic_lam;
-	if (!strcmp(s, "Arabic_meem")) return XK_Arabic_meem;
-	if (!strcmp(s, "Arabic_noon")) return XK_Arabic_noon;
-	if (!strcmp(s, "Arabic_ha")) return XK_Arabic_ha;
-	if (!strcmp(s, "Arabic_heh")) return XK_Arabic_heh;
-	if (!strcmp(s, "Arabic_waw")) return XK_Arabic_waw;
-	if (!strcmp(s, "Arabic_alefmaksura")) return XK_Arabic_alefmaksura;
-	if (!strcmp(s, "Arabic_yeh")) return XK_Arabic_yeh;
-	if (!strcmp(s, "Arabic_fathatan")) return XK_Arabic_fathatan;
-	if (!strcmp(s, "Arabic_dammatan")) return XK_Arabic_dammatan;
-	if (!strcmp(s, "Arabic_kasratan")) return XK_Arabic_kasratan;
-	if (!strcmp(s, "Arabic_fatha")) return XK_Arabic_fatha;
-	if (!strcmp(s, "Arabic_damma")) return XK_Arabic_damma;
-	if (!strcmp(s, "Arabic_kasra")) return XK_Arabic_kasra;
-	if (!strcmp(s, "Arabic_shadda")) return XK_Arabic_shadda;
-	if (!strcmp(s, "Arabic_sukun")) return XK_Arabic_sukun;
-	if (!strcmp(s, "Arabic_switch")) return XK_Arabic_switch;
-#endif /* XK_ARABIC */
-#ifdef XK_CYRILLIC
-	if (!strcmp(s, "Serbian_dje")) return XK_Serbian_dje;
-	if (!strcmp(s, "Macedonia_gje")) return XK_Macedonia_gje;
-	if (!strcmp(s, "Cyrillic_io")) return XK_Cyrillic_io;
-	if (!strcmp(s, "Ukrainian_ie")) return XK_Ukrainian_ie;
-	if (!strcmp(s, "Ukranian_je")) return XK_Ukranian_je;
-	if (!strcmp(s, "Macedonia_dse")) return XK_Macedonia_dse;
-	if (!strcmp(s, "Ukrainian_i")) return XK_Ukrainian_i;
-	if (!strcmp(s, "Ukranian_i")) return XK_Ukranian_i;
-	if (!strcmp(s, "Ukrainian_yi")) return XK_Ukrainian_yi;
-	if (!strcmp(s, "Ukranian_yi")) return XK_Ukranian_yi;
-	if (!strcmp(s, "Cyrillic_je")) return XK_Cyrillic_je;
-	if (!strcmp(s, "Serbian_je")) return XK_Serbian_je;
-	if (!strcmp(s, "Cyrillic_lje")) return XK_Cyrillic_lje;
-	if (!strcmp(s, "Serbian_lje")) return XK_Serbian_lje;
-	if (!strcmp(s, "Cyrillic_nje")) return XK_Cyrillic_nje;
-	if (!strcmp(s, "Serbian_nje")) return XK_Serbian_nje;
-	if (!strcmp(s, "Serbian_tshe")) return XK_Serbian_tshe;
-	if (!strcmp(s, "Macedonia_kje")) return XK_Macedonia_kje;
-	if (!strcmp(s, "Byelorussian_shortu")) return XK_Byelorussian_shortu;
-	if (!strcmp(s, "Cyrillic_dzhe")) return XK_Cyrillic_dzhe;
-	if (!strcmp(s, "Serbian_dze")) return XK_Serbian_dze;
-	if (!strcmp(s, "numerosign")) return XK_numerosign;
-	if (!strcmp(s, "Serbian_DJE")) return XK_Serbian_DJE;
-	if (!strcmp(s, "Macedonia_GJE")) return XK_Macedonia_GJE;
-	if (!strcmp(s, "Cyrillic_IO")) return XK_Cyrillic_IO;
-	if (!strcmp(s, "Ukrainian_IE")) return XK_Ukrainian_IE;
-	if (!strcmp(s, "Ukranian_JE")) return XK_Ukranian_JE;
-	if (!strcmp(s, "Macedonia_DSE")) return XK_Macedonia_DSE;
-	if (!strcmp(s, "Ukrainian_I")) return XK_Ukrainian_I;
-	if (!strcmp(s, "Ukranian_I")) return XK_Ukranian_I;
-	if (!strcmp(s, "Ukrainian_YI")) return XK_Ukrainian_YI;
-	if (!strcmp(s, "Ukranian_YI")) return XK_Ukranian_YI;
-	if (!strcmp(s, "Cyrillic_JE")) return XK_Cyrillic_JE;
-	if (!strcmp(s, "Serbian_JE")) return XK_Serbian_JE;
-	if (!strcmp(s, "Cyrillic_LJE")) return XK_Cyrillic_LJE;
-	if (!strcmp(s, "Serbian_LJE")) return XK_Serbian_LJE;
-	if (!strcmp(s, "Cyrillic_NJE")) return XK_Cyrillic_NJE;
-	if (!strcmp(s, "Serbian_NJE")) return XK_Serbian_NJE;
-	if (!strcmp(s, "Serbian_TSHE")) return XK_Serbian_TSHE;
-	if (!strcmp(s, "Macedonia_KJE")) return XK_Macedonia_KJE;
-	if (!strcmp(s, "Byelorussian_SHORTU")) return XK_Byelorussian_SHORTU;
-	if (!strcmp(s, "Cyrillic_DZHE")) return XK_Cyrillic_DZHE;
-	if (!strcmp(s, "Serbian_DZE")) return XK_Serbian_DZE;
-	if (!strcmp(s, "Cyrillic_yu")) return XK_Cyrillic_yu;
-	if (!strcmp(s, "Cyrillic_a")) return XK_Cyrillic_a;
-	if (!strcmp(s, "Cyrillic_be")) return XK_Cyrillic_be;
-	if (!strcmp(s, "Cyrillic_tse")) return XK_Cyrillic_tse;
-	if (!strcmp(s, "Cyrillic_de")) return XK_Cyrillic_de;
-	if (!strcmp(s, "Cyrillic_ie")) return XK_Cyrillic_ie;
-	if (!strcmp(s, "Cyrillic_ef")) return XK_Cyrillic_ef;
-	if (!strcmp(s, "Cyrillic_ghe")) return XK_Cyrillic_ghe;
-	if (!strcmp(s, "Cyrillic_ha")) return XK_Cyrillic_ha;
-	if (!strcmp(s, "Cyrillic_i")) return XK_Cyrillic_i;
-	if (!strcmp(s, "Cyrillic_shorti")) return XK_Cyrillic_shorti;
-	if (!strcmp(s, "Cyrillic_ka")) return XK_Cyrillic_ka;
-	if (!strcmp(s, "Cyrillic_el")) return XK_Cyrillic_el;
-	if (!strcmp(s, "Cyrillic_em")) return XK_Cyrillic_em;
-	if (!strcmp(s, "Cyrillic_en")) return XK_Cyrillic_en;
-	if (!strcmp(s, "Cyrillic_o")) return XK_Cyrillic_o;
-	if (!strcmp(s, "Cyrillic_pe")) return XK_Cyrillic_pe;
-	if (!strcmp(s, "Cyrillic_ya")) return XK_Cyrillic_ya;
-	if (!strcmp(s, "Cyrillic_er")) return XK_Cyrillic_er;
-	if (!strcmp(s, "Cyrillic_es")) return XK_Cyrillic_es;
-	if (!strcmp(s, "Cyrillic_te")) return XK_Cyrillic_te;
-	if (!strcmp(s, "Cyrillic_u")) return XK_Cyrillic_u;
-	if (!strcmp(s, "Cyrillic_zhe")) return XK_Cyrillic_zhe;
-	if (!strcmp(s, "Cyrillic_ve")) return XK_Cyrillic_ve;
-	if (!strcmp(s, "Cyrillic_softsign")) return XK_Cyrillic_softsign;
-	if (!strcmp(s, "Cyrillic_yeru")) return XK_Cyrillic_yeru;
-	if (!strcmp(s, "Cyrillic_ze")) return XK_Cyrillic_ze;
-	if (!strcmp(s, "Cyrillic_sha")) return XK_Cyrillic_sha;
-	if (!strcmp(s, "Cyrillic_e")) return XK_Cyrillic_e;
-	if (!strcmp(s, "Cyrillic_shcha")) return XK_Cyrillic_shcha;
-	if (!strcmp(s, "Cyrillic_che")) return XK_Cyrillic_che;
-	if (!strcmp(s, "Cyrillic_hardsign")) return XK_Cyrillic_hardsign;
-	if (!strcmp(s, "Cyrillic_YU")) return XK_Cyrillic_YU;
-	if (!strcmp(s, "Cyrillic_A")) return XK_Cyrillic_A;
-	if (!strcmp(s, "Cyrillic_BE")) return XK_Cyrillic_BE;
-	if (!strcmp(s, "Cyrillic_TSE")) return XK_Cyrillic_TSE;
-	if (!strcmp(s, "Cyrillic_DE")) return XK_Cyrillic_DE;
-	if (!strcmp(s, "Cyrillic_IE")) return XK_Cyrillic_IE;
-	if (!strcmp(s, "Cyrillic_EF")) return XK_Cyrillic_EF;
-	if (!strcmp(s, "Cyrillic_GHE")) return XK_Cyrillic_GHE;
-	if (!strcmp(s, "Cyrillic_HA")) return XK_Cyrillic_HA;
-	if (!strcmp(s, "Cyrillic_I")) return XK_Cyrillic_I;
-	if (!strcmp(s, "Cyrillic_SHORTI")) return XK_Cyrillic_SHORTI;
-	if (!strcmp(s, "Cyrillic_KA")) return XK_Cyrillic_KA;
-	if (!strcmp(s, "Cyrillic_EL")) return XK_Cyrillic_EL;
-	if (!strcmp(s, "Cyrillic_EM")) return XK_Cyrillic_EM;
-	if (!strcmp(s, "Cyrillic_EN")) return XK_Cyrillic_EN;
-	if (!strcmp(s, "Cyrillic_O")) return XK_Cyrillic_O;
-	if (!strcmp(s, "Cyrillic_PE")) return XK_Cyrillic_PE;
-	if (!strcmp(s, "Cyrillic_YA")) return XK_Cyrillic_YA;
-	if (!strcmp(s, "Cyrillic_ER")) return XK_Cyrillic_ER;
-	if (!strcmp(s, "Cyrillic_ES")) return XK_Cyrillic_ES;
-	if (!strcmp(s, "Cyrillic_TE")) return XK_Cyrillic_TE;
-	if (!strcmp(s, "Cyrillic_U")) return XK_Cyrillic_U;
-	if (!strcmp(s, "Cyrillic_ZHE")) return XK_Cyrillic_ZHE;
-	if (!strcmp(s, "Cyrillic_VE")) return XK_Cyrillic_VE;
-	if (!strcmp(s, "Cyrillic_SOFTSIGN")) return XK_Cyrillic_SOFTSIGN;
-	if (!strcmp(s, "Cyrillic_YERU")) return XK_Cyrillic_YERU;
-	if (!strcmp(s, "Cyrillic_ZE")) return XK_Cyrillic_ZE;
-	if (!strcmp(s, "Cyrillic_SHA")) return XK_Cyrillic_SHA;
-	if (!strcmp(s, "Cyrillic_E")) return XK_Cyrillic_E;
-	if (!strcmp(s, "Cyrillic_SHCHA")) return XK_Cyrillic_SHCHA;
-	if (!strcmp(s, "Cyrillic_CHE")) return XK_Cyrillic_CHE;
-	if (!strcmp(s, "Cyrillic_HARDSIGN")) return XK_Cyrillic_HARDSIGN;
-#endif /* XK_CYRILLIC */
-#ifdef XK_GREEK
-	if (!strcmp(s, "Greek_ALPHAaccent")) return XK_Greek_ALPHAaccent;
-	if (!strcmp(s, "Greek_EPSILONaccent")) return XK_Greek_EPSILONaccent;
-	if (!strcmp(s, "Greek_ETAaccent")) return XK_Greek_ETAaccent;
-	if (!strcmp(s, "Greek_IOTAaccent")) return XK_Greek_IOTAaccent;
-	if (!strcmp(s, "Greek_IOTAdieresis")) return XK_Greek_IOTAdieresis;
-	if (!strcmp(s, "Greek_OMICRONaccent")) return XK_Greek_OMICRONaccent;
-	if (!strcmp(s, "Greek_UPSILONaccent")) return XK_Greek_UPSILONaccent;
-	if (!strcmp(s, "Greek_UPSILONdieresis")) return XK_Greek_UPSILONdieresis;
-	if (!strcmp(s, "Greek_OMEGAaccent")) return XK_Greek_OMEGAaccent;
-	if (!strcmp(s, "Greek_accentdieresis")) return XK_Greek_accentdieresis;
-	if (!strcmp(s, "Greek_horizbar")) return XK_Greek_horizbar;
-	if (!strcmp(s, "Greek_alphaaccent")) return XK_Greek_alphaaccent;
-	if (!strcmp(s, "Greek_epsilonaccent")) return XK_Greek_epsilonaccent;
-	if (!strcmp(s, "Greek_etaaccent")) return XK_Greek_etaaccent;
-	if (!strcmp(s, "Greek_iotaaccent")) return XK_Greek_iotaaccent;
-	if (!strcmp(s, "Greek_iotadieresis")) return XK_Greek_iotadieresis;
-	if (!strcmp(s, "Greek_iotaaccentdieresis")) return XK_Greek_iotaaccentdieresis;
-	if (!strcmp(s, "Greek_omicronaccent")) return XK_Greek_omicronaccent;
-	if (!strcmp(s, "Greek_upsilonaccent")) return XK_Greek_upsilonaccent;
-	if (!strcmp(s, "Greek_upsilondieresis")) return XK_Greek_upsilondieresis;
-	if (!strcmp(s, "Greek_upsilonaccentdieresis")) return XK_Greek_upsilonaccentdieresis;
-	if (!strcmp(s, "Greek_omegaaccent")) return XK_Greek_omegaaccent;
-	if (!strcmp(s, "Greek_ALPHA")) return XK_Greek_ALPHA;
-	if (!strcmp(s, "Greek_BETA")) return XK_Greek_BETA;
-	if (!strcmp(s, "Greek_GAMMA")) return XK_Greek_GAMMA;
-	if (!strcmp(s, "Greek_DELTA")) return XK_Greek_DELTA;
-	if (!strcmp(s, "Greek_EPSILON")) return XK_Greek_EPSILON;
-	if (!strcmp(s, "Greek_ZETA")) return XK_Greek_ZETA;
-	if (!strcmp(s, "Greek_ETA")) return XK_Greek_ETA;
-	if (!strcmp(s, "Greek_THETA")) return XK_Greek_THETA;
-	if (!strcmp(s, "Greek_IOTA")) return XK_Greek_IOTA;
-	if (!strcmp(s, "Greek_KAPPA")) return XK_Greek_KAPPA;
-	if (!strcmp(s, "Greek_LAMDA")) return XK_Greek_LAMDA;
-	if (!strcmp(s, "Greek_LAMBDA")) return XK_Greek_LAMBDA;
-	if (!strcmp(s, "Greek_MU")) return XK_Greek_MU;
-	if (!strcmp(s, "Greek_NU")) return XK_Greek_NU;
-	if (!strcmp(s, "Greek_XI")) return XK_Greek_XI;
-	if (!strcmp(s, "Greek_OMICRON")) return XK_Greek_OMICRON;
-	if (!strcmp(s, "Greek_PI")) return XK_Greek_PI;
-	if (!strcmp(s, "Greek_RHO")) return XK_Greek_RHO;
-	if (!strcmp(s, "Greek_SIGMA")) return XK_Greek_SIGMA;
-	if (!strcmp(s, "Greek_TAU")) return XK_Greek_TAU;
-	if (!strcmp(s, "Greek_UPSILON")) return XK_Greek_UPSILON;
-	if (!strcmp(s, "Greek_PHI")) return XK_Greek_PHI;
-	if (!strcmp(s, "Greek_CHI")) return XK_Greek_CHI;
-	if (!strcmp(s, "Greek_PSI")) return XK_Greek_PSI;
-	if (!strcmp(s, "Greek_OMEGA")) return XK_Greek_OMEGA;
-	if (!strcmp(s, "Greek_alpha")) return XK_Greek_alpha;
-	if (!strcmp(s, "Greek_beta")) return XK_Greek_beta;
-	if (!strcmp(s, "Greek_gamma")) return XK_Greek_gamma;
-	if (!strcmp(s, "Greek_delta")) return XK_Greek_delta;
-	if (!strcmp(s, "Greek_epsilon")) return XK_Greek_epsilon;
-	if (!strcmp(s, "Greek_zeta")) return XK_Greek_zeta;
-	if (!strcmp(s, "Greek_eta")) return XK_Greek_eta;
-	if (!strcmp(s, "Greek_theta")) return XK_Greek_theta;
-	if (!strcmp(s, "Greek_iota")) return XK_Greek_iota;
-	if (!strcmp(s, "Greek_kappa")) return XK_Greek_kappa;
-	if (!strcmp(s, "Greek_lamda")) return XK_Greek_lamda;
-	if (!strcmp(s, "Greek_lambda")) return XK_Greek_lambda;
-	if (!strcmp(s, "Greek_mu")) return XK_Greek_mu;
-	if (!strcmp(s, "Greek_nu")) return XK_Greek_nu;
-	if (!strcmp(s, "Greek_xi")) return XK_Greek_xi;
-	if (!strcmp(s, "Greek_omicron")) return XK_Greek_omicron;
-	if (!strcmp(s, "Greek_pi")) return XK_Greek_pi;
-	if (!strcmp(s, "Greek_rho")) return XK_Greek_rho;
-	if (!strcmp(s, "Greek_sigma")) return XK_Greek_sigma;
-	if (!strcmp(s, "Greek_finalsmallsigma")) return XK_Greek_finalsmallsigma;
-	if (!strcmp(s, "Greek_tau")) return XK_Greek_tau;
-	if (!strcmp(s, "Greek_upsilon")) return XK_Greek_upsilon;
-	if (!strcmp(s, "Greek_phi")) return XK_Greek_phi;
-	if (!strcmp(s, "Greek_chi")) return XK_Greek_chi;
-	if (!strcmp(s, "Greek_psi")) return XK_Greek_psi;
-	if (!strcmp(s, "Greek_omega")) return XK_Greek_omega;
-	if (!strcmp(s, "Greek_switch")) return XK_Greek_switch;
-#endif /* XK_GREEK */
-#ifdef XK_TECHNICAL
-	if (!strcmp(s, "leftradical")) return XK_leftradical;
-	if (!strcmp(s, "topleftradical")) return XK_topleftradical;
-	if (!strcmp(s, "horizconnector")) return XK_horizconnector;
-	if (!strcmp(s, "topintegral")) return XK_topintegral;
-	if (!strcmp(s, "botintegral")) return XK_botintegral;
-	if (!strcmp(s, "vertconnector")) return XK_vertconnector;
-	if (!strcmp(s, "topleftsqbracket")) return XK_topleftsqbracket;
-	if (!strcmp(s, "botleftsqbracket")) return XK_botleftsqbracket;
-	if (!strcmp(s, "toprightsqbracket")) return XK_toprightsqbracket;
-	if (!strcmp(s, "botrightsqbracket")) return XK_botrightsqbracket;
-	if (!strcmp(s, "topleftparens")) return XK_topleftparens;
-	if (!strcmp(s, "botleftparens")) return XK_botleftparens;
-	if (!strcmp(s, "toprightparens")) return XK_toprightparens;
-	if (!strcmp(s, "botrightparens")) return XK_botrightparens;
-	if (!strcmp(s, "leftmiddlecurlybrace")) return XK_leftmiddlecurlybrace;
-	if (!strcmp(s, "rightmiddlecurlybrace")) return XK_rightmiddlecurlybrace;
-	if (!strcmp(s, "topleftsummation")) return XK_topleftsummation;
-	if (!strcmp(s, "botleftsummation")) return XK_botleftsummation;
-	if (!strcmp(s, "topvertsummationconnector")) return XK_topvertsummationconnector;
-	if (!strcmp(s, "botvertsummationconnector")) return XK_botvertsummationconnector;
-	if (!strcmp(s, "toprightsummation")) return XK_toprightsummation;
-	if (!strcmp(s, "botrightsummation")) return XK_botrightsummation;
-	if (!strcmp(s, "rightmiddlesummation")) return XK_rightmiddlesummation;
-	if (!strcmp(s, "lessthanequal")) return XK_lessthanequal;
-	if (!strcmp(s, "notequal")) return XK_notequal;
-	if (!strcmp(s, "greaterthanequal")) return XK_greaterthanequal;
-	if (!strcmp(s, "integral")) return XK_integral;
-	if (!strcmp(s, "therefore")) return XK_therefore;
-	if (!strcmp(s, "variation")) return XK_variation;
-	if (!strcmp(s, "infinity")) return XK_infinity;
-	if (!strcmp(s, "nabla")) return XK_nabla;
-	if (!strcmp(s, "approximate")) return XK_approximate;
-	if (!strcmp(s, "similarequal")) return XK_similarequal;
-	if (!strcmp(s, "ifonlyif")) return XK_ifonlyif;
-	if (!strcmp(s, "implies")) return XK_implies;
-	if (!strcmp(s, "identical")) return XK_identical;
-	if (!strcmp(s, "radical")) return XK_radical;
-	if (!strcmp(s, "includedin")) return XK_includedin;
-	if (!strcmp(s, "includes")) return XK_includes;
-	if (!strcmp(s, "intersection")) return XK_intersection;
-	if (!strcmp(s, "union")) return XK_union;
-	if (!strcmp(s, "logicaland")) return XK_logicaland;
-	if (!strcmp(s, "logicalor")) return XK_logicalor;
-	if (!strcmp(s, "partialderivative")) return XK_partialderivative;
-	if (!strcmp(s, "function")) return XK_function;
-	if (!strcmp(s, "leftarrow")) return XK_leftarrow;
-	if (!strcmp(s, "uparrow")) return XK_uparrow;
-	if (!strcmp(s, "rightarrow")) return XK_rightarrow;
-	if (!strcmp(s, "downarrow")) return XK_downarrow;
-#endif /* XK_TECHNICAL */
-#ifdef XK_SPECIAL
-	if (!strcmp(s, "blank")) return XK_blank;
-	if (!strcmp(s, "soliddiamond")) return XK_soliddiamond;
-	if (!strcmp(s, "checkerboard")) return XK_checkerboard;
-	if (!strcmp(s, "ht")) return XK_ht;
-	if (!strcmp(s, "ff")) return XK_ff;
-	if (!strcmp(s, "cr")) return XK_cr;
-	if (!strcmp(s, "lf")) return XK_lf;
-	if (!strcmp(s, "nl")) return XK_nl;
-	if (!strcmp(s, "vt")) return XK_vt;
-	if (!strcmp(s, "lowrightcorner")) return XK_lowrightcorner;
-	if (!strcmp(s, "uprightcorner")) return XK_uprightcorner;
-	if (!strcmp(s, "upleftcorner")) return XK_upleftcorner;
-	if (!strcmp(s, "lowleftcorner")) return XK_lowleftcorner;
-	if (!strcmp(s, "crossinglines")) return XK_crossinglines;
-	if (!strcmp(s, "horizlinescan1")) return XK_horizlinescan1;
-	if (!strcmp(s, "horizlinescan3")) return XK_horizlinescan3;
-	if (!strcmp(s, "horizlinescan5")) return XK_horizlinescan5;
-	if (!strcmp(s, "horizlinescan7")) return XK_horizlinescan7;
-	if (!strcmp(s, "horizlinescan9")) return XK_horizlinescan9;
-	if (!strcmp(s, "leftt")) return XK_leftt;
-	if (!strcmp(s, "rightt")) return XK_rightt;
-	if (!strcmp(s, "bott")) return XK_bott;
-	if (!strcmp(s, "topt")) return XK_topt;
-	if (!strcmp(s, "vertbar")) return XK_vertbar;
-#endif /* XK_SPECIAL */
-#ifdef XK_PUBLISHING
-	if (!strcmp(s, "emspace")) return XK_emspace;
-	if (!strcmp(s, "enspace")) return XK_enspace;
-	if (!strcmp(s, "em3space")) return XK_em3space;
-	if (!strcmp(s, "em4space")) return XK_em4space;
-	if (!strcmp(s, "digitspace")) return XK_digitspace;
-	if (!strcmp(s, "punctspace")) return XK_punctspace;
-	if (!strcmp(s, "thinspace")) return XK_thinspace;
-	if (!strcmp(s, "hairspace")) return XK_hairspace;
-	if (!strcmp(s, "emdash")) return XK_emdash;
-	if (!strcmp(s, "endash")) return XK_endash;
-	if (!strcmp(s, "signifblank")) return XK_signifblank;
-	if (!strcmp(s, "ellipsis")) return XK_ellipsis;
-	if (!strcmp(s, "doubbaselinedot")) return XK_doubbaselinedot;
-	if (!strcmp(s, "onethird")) return XK_onethird;
-	if (!strcmp(s, "twothirds")) return XK_twothirds;
-	if (!strcmp(s, "onefifth")) return XK_onefifth;
-	if (!strcmp(s, "twofifths")) return XK_twofifths;
-	if (!strcmp(s, "threefifths")) return XK_threefifths;
-	if (!strcmp(s, "fourfifths")) return XK_fourfifths;
-	if (!strcmp(s, "onesixth")) return XK_onesixth;
-	if (!strcmp(s, "fivesixths")) return XK_fivesixths;
-	if (!strcmp(s, "careof")) return XK_careof;
-	if (!strcmp(s, "figdash")) return XK_figdash;
-	if (!strcmp(s, "leftanglebracket")) return XK_leftanglebracket;
-	if (!strcmp(s, "decimalpoint")) return XK_decimalpoint;
-	if (!strcmp(s, "rightanglebracket")) return XK_rightanglebracket;
-	if (!strcmp(s, "marker")) return XK_marker;
-	if (!strcmp(s, "oneeighth")) return XK_oneeighth;
-	if (!strcmp(s, "threeeighths")) return XK_threeeighths;
-	if (!strcmp(s, "fiveeighths")) return XK_fiveeighths;
-	if (!strcmp(s, "seveneighths")) return XK_seveneighths;
-	if (!strcmp(s, "trademark")) return XK_trademark;
-	if (!strcmp(s, "signaturemark")) return XK_signaturemark;
-	if (!strcmp(s, "trademarkincircle")) return XK_trademarkincircle;
-	if (!strcmp(s, "leftopentriangle")) return XK_leftopentriangle;
-	if (!strcmp(s, "rightopentriangle")) return XK_rightopentriangle;
-	if (!strcmp(s, "emopencircle")) return XK_emopencircle;
-	if (!strcmp(s, "emopenrectangle")) return XK_emopenrectangle;
-	if (!strcmp(s, "leftsinglequotemark")) return XK_leftsinglequotemark;
-	if (!strcmp(s, "rightsinglequotemark")) return XK_rightsinglequotemark;
-	if (!strcmp(s, "leftdoublequotemark")) return XK_leftdoublequotemark;
-	if (!strcmp(s, "rightdoublequotemark")) return XK_rightdoublequotemark;
-	if (!strcmp(s, "prescription")) return XK_prescription;
-	if (!strcmp(s, "minutes")) return XK_minutes;
-	if (!strcmp(s, "seconds")) return XK_seconds;
-	if (!strcmp(s, "latincross")) return XK_latincross;
-	if (!strcmp(s, "hexagram")) return XK_hexagram;
-	if (!strcmp(s, "filledrectbullet")) return XK_filledrectbullet;
-	if (!strcmp(s, "filledlefttribullet")) return XK_filledlefttribullet;
-	if (!strcmp(s, "filledrighttribullet")) return XK_filledrighttribullet;
-	if (!strcmp(s, "emfilledcircle")) return XK_emfilledcircle;
-	if (!strcmp(s, "emfilledrect")) return XK_emfilledrect;
-	if (!strcmp(s, "enopencircbullet")) return XK_enopencircbullet;
-	if (!strcmp(s, "enopensquarebullet")) return XK_enopensquarebullet;
-	if (!strcmp(s, "openrectbullet")) return XK_openrectbullet;
-	if (!strcmp(s, "opentribulletup")) return XK_opentribulletup;
-	if (!strcmp(s, "opentribulletdown")) return XK_opentribulletdown;
-	if (!strcmp(s, "openstar")) return XK_openstar;
-	if (!strcmp(s, "enfilledcircbullet")) return XK_enfilledcircbullet;
-	if (!strcmp(s, "enfilledsqbullet")) return XK_enfilledsqbullet;
-	if (!strcmp(s, "filledtribulletup")) return XK_filledtribulletup;
-	if (!strcmp(s, "filledtribulletdown")) return XK_filledtribulletdown;
-	if (!strcmp(s, "leftpointer")) return XK_leftpointer;
-	if (!strcmp(s, "rightpointer")) return XK_rightpointer;
-	if (!strcmp(s, "club")) return XK_club;
-	if (!strcmp(s, "diamond")) return XK_diamond;
-	if (!strcmp(s, "heart")) return XK_heart;
-	if (!strcmp(s, "maltesecross")) return XK_maltesecross;
-	if (!strcmp(s, "dagger")) return XK_dagger;
-	if (!strcmp(s, "doubledagger")) return XK_doubledagger;
-	if (!strcmp(s, "checkmark")) return XK_checkmark;
-	if (!strcmp(s, "ballotcross")) return XK_ballotcross;
-	if (!strcmp(s, "musicalsharp")) return XK_musicalsharp;
-	if (!strcmp(s, "musicalflat")) return XK_musicalflat;
-	if (!strcmp(s, "malesymbol")) return XK_malesymbol;
-	if (!strcmp(s, "femalesymbol")) return XK_femalesymbol;
-	if (!strcmp(s, "telephone")) return XK_telephone;
-	if (!strcmp(s, "telephonerecorder")) return XK_telephonerecorder;
-	if (!strcmp(s, "phonographcopyright")) return XK_phonographcopyright;
-	if (!strcmp(s, "caret")) return XK_caret;
-	if (!strcmp(s, "singlelowquotemark")) return XK_singlelowquotemark;
-	if (!strcmp(s, "doublelowquotemark")) return XK_doublelowquotemark;
-	if (!strcmp(s, "cursor")) return XK_cursor;
-#endif /* XK_PUBLISHING */
-#ifdef XK_APL
-	if (!strcmp(s, "leftcaret")) return XK_leftcaret;
-	if (!strcmp(s, "rightcaret")) return XK_rightcaret;
-	if (!strcmp(s, "downcaret")) return XK_downcaret;
-	if (!strcmp(s, "upcaret")) return XK_upcaret;
-	if (!strcmp(s, "overbar")) return XK_overbar;
-	if (!strcmp(s, "downtack")) return XK_downtack;
-	if (!strcmp(s, "upshoe")) return XK_upshoe;
-	if (!strcmp(s, "downstile")) return XK_downstile;
-	if (!strcmp(s, "underbar")) return XK_underbar;
-	if (!strcmp(s, "jot")) return XK_jot;
-	if (!strcmp(s, "quad")) return XK_quad;
-	if (!strcmp(s, "uptack")) return XK_uptack;
-	if (!strcmp(s, "circle")) return XK_circle;
-	if (!strcmp(s, "upstile")) return XK_upstile;
-	if (!strcmp(s, "downshoe")) return XK_downshoe;
-	if (!strcmp(s, "rightshoe")) return XK_rightshoe;
-	if (!strcmp(s, "leftshoe")) return XK_leftshoe;
-	if (!strcmp(s, "lefttack")) return XK_lefttack;
-	if (!strcmp(s, "righttack")) return XK_righttack;
-#endif /* XK_APL */
-#ifdef XK_HEBREW
-	if (!strcmp(s, "hebrew_doublelowline")) return XK_hebrew_doublelowline;
-	if (!strcmp(s, "hebrew_aleph")) return XK_hebrew_aleph;
-	if (!strcmp(s, "hebrew_bet")) return XK_hebrew_bet;
-	if (!strcmp(s, "hebrew_beth")) return XK_hebrew_beth;
-	if (!strcmp(s, "hebrew_gimel")) return XK_hebrew_gimel;
-	if (!strcmp(s, "hebrew_gimmel")) return XK_hebrew_gimmel;
-	if (!strcmp(s, "hebrew_dalet")) return XK_hebrew_dalet;
-	if (!strcmp(s, "hebrew_daleth")) return XK_hebrew_daleth;
-	if (!strcmp(s, "hebrew_he")) return XK_hebrew_he;
-	if (!strcmp(s, "hebrew_waw")) return XK_hebrew_waw;
-	if (!strcmp(s, "hebrew_zain")) return XK_hebrew_zain;
-	if (!strcmp(s, "hebrew_zayin")) return XK_hebrew_zayin;
-	if (!strcmp(s, "hebrew_chet")) return XK_hebrew_chet;
-	if (!strcmp(s, "hebrew_het")) return XK_hebrew_het;
-	if (!strcmp(s, "hebrew_tet")) return XK_hebrew_tet;
-	if (!strcmp(s, "hebrew_teth")) return XK_hebrew_teth;
-	if (!strcmp(s, "hebrew_yod")) return XK_hebrew_yod;
-	if (!strcmp(s, "hebrew_finalkaph")) return XK_hebrew_finalkaph;
-	if (!strcmp(s, "hebrew_kaph")) return XK_hebrew_kaph;
-	if (!strcmp(s, "hebrew_lamed")) return XK_hebrew_lamed;
-	if (!strcmp(s, "hebrew_finalmem")) return XK_hebrew_finalmem;
-	if (!strcmp(s, "hebrew_mem")) return XK_hebrew_mem;
-	if (!strcmp(s, "hebrew_finalnun")) return XK_hebrew_finalnun;
-	if (!strcmp(s, "hebrew_nun")) return XK_hebrew_nun;
-	if (!strcmp(s, "hebrew_samech")) return XK_hebrew_samech;
-	if (!strcmp(s, "hebrew_samekh")) return XK_hebrew_samekh;
-	if (!strcmp(s, "hebrew_ayin")) return XK_hebrew_ayin;
-	if (!strcmp(s, "hebrew_finalpe")) return XK_hebrew_finalpe;
-	if (!strcmp(s, "hebrew_pe")) return XK_hebrew_pe;
-	if (!strcmp(s, "hebrew_finalzade")) return XK_hebrew_finalzade;
-	if (!strcmp(s, "hebrew_finalzadi")) return XK_hebrew_finalzadi;
-	if (!strcmp(s, "hebrew_zade")) return XK_hebrew_zade;
-	if (!strcmp(s, "hebrew_zadi")) return XK_hebrew_zadi;
-	if (!strcmp(s, "hebrew_qoph")) return XK_hebrew_qoph;
-	if (!strcmp(s, "hebrew_kuf")) return XK_hebrew_kuf;
-	if (!strcmp(s, "hebrew_resh")) return XK_hebrew_resh;
-	if (!strcmp(s, "hebrew_shin")) return XK_hebrew_shin;
-	if (!strcmp(s, "hebrew_taw")) return XK_hebrew_taw;
-	if (!strcmp(s, "hebrew_taf")) return XK_hebrew_taf;
-	if (!strcmp(s, "Hebrew_switch")) return XK_Hebrew_switch;
-#endif /* XK_HEBREW */
-#ifdef XK_THAI
-	if (!strcmp(s, "Thai_kokai")) return XK_Thai_kokai;
-	if (!strcmp(s, "Thai_khokhai")) return XK_Thai_khokhai;
-	if (!strcmp(s, "Thai_khokhuat")) return XK_Thai_khokhuat;
-	if (!strcmp(s, "Thai_khokhwai")) return XK_Thai_khokhwai;
-	if (!strcmp(s, "Thai_khokhon")) return XK_Thai_khokhon;
-	if (!strcmp(s, "Thai_khorakhang")) return XK_Thai_khorakhang;
-	if (!strcmp(s, "Thai_ngongu")) return XK_Thai_ngongu;
-	if (!strcmp(s, "Thai_chochan")) return XK_Thai_chochan;
-	if (!strcmp(s, "Thai_choching")) return XK_Thai_choching;
-	if (!strcmp(s, "Thai_chochang")) return XK_Thai_chochang;
-	if (!strcmp(s, "Thai_soso")) return XK_Thai_soso;
-	if (!strcmp(s, "Thai_chochoe")) return XK_Thai_chochoe;
-	if (!strcmp(s, "Thai_yoying")) return XK_Thai_yoying;
-	if (!strcmp(s, "Thai_dochada")) return XK_Thai_dochada;
-	if (!strcmp(s, "Thai_topatak")) return XK_Thai_topatak;
-	if (!strcmp(s, "Thai_thothan")) return XK_Thai_thothan;
-	if (!strcmp(s, "Thai_thonangmontho")) return XK_Thai_thonangmontho;
-	if (!strcmp(s, "Thai_thophuthao")) return XK_Thai_thophuthao;
-	if (!strcmp(s, "Thai_nonen")) return XK_Thai_nonen;
-	if (!strcmp(s, "Thai_dodek")) return XK_Thai_dodek;
-	if (!strcmp(s, "Thai_totao")) return XK_Thai_totao;
-	if (!strcmp(s, "Thai_thothung")) return XK_Thai_thothung;
-	if (!strcmp(s, "Thai_thothahan")) return XK_Thai_thothahan;
-	if (!strcmp(s, "Thai_thothong")) return XK_Thai_thothong;
-	if (!strcmp(s, "Thai_nonu")) return XK_Thai_nonu;
-	if (!strcmp(s, "Thai_bobaimai")) return XK_Thai_bobaimai;
-	if (!strcmp(s, "Thai_popla")) return XK_Thai_popla;
-	if (!strcmp(s, "Thai_phophung")) return XK_Thai_phophung;
-	if (!strcmp(s, "Thai_fofa")) return XK_Thai_fofa;
-	if (!strcmp(s, "Thai_phophan")) return XK_Thai_phophan;
-	if (!strcmp(s, "Thai_fofan")) return XK_Thai_fofan;
-	if (!strcmp(s, "Thai_phosamphao")) return XK_Thai_phosamphao;
-	if (!strcmp(s, "Thai_moma")) return XK_Thai_moma;
-	if (!strcmp(s, "Thai_yoyak")) return XK_Thai_yoyak;
-	if (!strcmp(s, "Thai_rorua")) return XK_Thai_rorua;
-	if (!strcmp(s, "Thai_ru")) return XK_Thai_ru;
-	if (!strcmp(s, "Thai_loling")) return XK_Thai_loling;
-	if (!strcmp(s, "Thai_lu")) return XK_Thai_lu;
-	if (!strcmp(s, "Thai_wowaen")) return XK_Thai_wowaen;
-	if (!strcmp(s, "Thai_sosala")) return XK_Thai_sosala;
-	if (!strcmp(s, "Thai_sorusi")) return XK_Thai_sorusi;
-	if (!strcmp(s, "Thai_sosua")) return XK_Thai_sosua;
-	if (!strcmp(s, "Thai_hohip")) return XK_Thai_hohip;
-	if (!strcmp(s, "Thai_lochula")) return XK_Thai_lochula;
-	if (!strcmp(s, "Thai_oang")) return XK_Thai_oang;
-	if (!strcmp(s, "Thai_honokhuk")) return XK_Thai_honokhuk;
-	if (!strcmp(s, "Thai_paiyannoi")) return XK_Thai_paiyannoi;
-	if (!strcmp(s, "Thai_saraa")) return XK_Thai_saraa;
-	if (!strcmp(s, "Thai_maihanakat")) return XK_Thai_maihanakat;
-	if (!strcmp(s, "Thai_saraaa")) return XK_Thai_saraaa;
-	if (!strcmp(s, "Thai_saraam")) return XK_Thai_saraam;
-	if (!strcmp(s, "Thai_sarai")) return XK_Thai_sarai;
-	if (!strcmp(s, "Thai_saraii")) return XK_Thai_saraii;
-	if (!strcmp(s, "Thai_saraue")) return XK_Thai_saraue;
-	if (!strcmp(s, "Thai_sarauee")) return XK_Thai_sarauee;
-	if (!strcmp(s, "Thai_sarau")) return XK_Thai_sarau;
-	if (!strcmp(s, "Thai_sarauu")) return XK_Thai_sarauu;
-	if (!strcmp(s, "Thai_phinthu")) return XK_Thai_phinthu;
-	if (!strcmp(s, "Thai_maihanakat_maitho")) return XK_Thai_maihanakat_maitho;
-	if (!strcmp(s, "Thai_baht")) return XK_Thai_baht;
-	if (!strcmp(s, "Thai_sarae")) return XK_Thai_sarae;
-	if (!strcmp(s, "Thai_saraae")) return XK_Thai_saraae;
-	if (!strcmp(s, "Thai_sarao")) return XK_Thai_sarao;
-	if (!strcmp(s, "Thai_saraaimaimuan")) return XK_Thai_saraaimaimuan;
-	if (!strcmp(s, "Thai_saraaimaimalai")) return XK_Thai_saraaimaimalai;
-	if (!strcmp(s, "Thai_lakkhangyao")) return XK_Thai_lakkhangyao;
-	if (!strcmp(s, "Thai_maiyamok")) return XK_Thai_maiyamok;
-	if (!strcmp(s, "Thai_maitaikhu")) return XK_Thai_maitaikhu;
-	if (!strcmp(s, "Thai_maiek")) return XK_Thai_maiek;
-	if (!strcmp(s, "Thai_maitho")) return XK_Thai_maitho;
-	if (!strcmp(s, "Thai_maitri")) return XK_Thai_maitri;
-	if (!strcmp(s, "Thai_maichattawa")) return XK_Thai_maichattawa;
-	if (!strcmp(s, "Thai_thanthakhat")) return XK_Thai_thanthakhat;
-	if (!strcmp(s, "Thai_nikhahit")) return XK_Thai_nikhahit;
-	if (!strcmp(s, "Thai_leksun")) return XK_Thai_leksun;
-	if (!strcmp(s, "Thai_leknung")) return XK_Thai_leknung;
-	if (!strcmp(s, "Thai_leksong")) return XK_Thai_leksong;
-	if (!strcmp(s, "Thai_leksam")) return XK_Thai_leksam;
-	if (!strcmp(s, "Thai_leksi")) return XK_Thai_leksi;
-	if (!strcmp(s, "Thai_lekha")) return XK_Thai_lekha;
-	if (!strcmp(s, "Thai_lekhok")) return XK_Thai_lekhok;
-	if (!strcmp(s, "Thai_lekchet")) return XK_Thai_lekchet;
-	if (!strcmp(s, "Thai_lekpaet")) return XK_Thai_lekpaet;
-	if (!strcmp(s, "Thai_lekkao")) return XK_Thai_lekkao;
-#endif /* XK_THAI */
-#ifdef XK_KOREAN
-	if (!strcmp(s, "Hangul")) return XK_Hangul;
-	if (!strcmp(s, "Hangul_Start")) return XK_Hangul_Start;
-	if (!strcmp(s, "Hangul_End")) return XK_Hangul_End;
-	if (!strcmp(s, "Hangul_Hanja")) return XK_Hangul_Hanja;
-	if (!strcmp(s, "Hangul_Jamo")) return XK_Hangul_Jamo;
-	if (!strcmp(s, "Hangul_Romaja")) return XK_Hangul_Romaja;
-	if (!strcmp(s, "Hangul_Codeinput")) return XK_Hangul_Codeinput;
-	if (!strcmp(s, "Hangul_Jeonja")) return XK_Hangul_Jeonja;
-	if (!strcmp(s, "Hangul_Banja")) return XK_Hangul_Banja;
-	if (!strcmp(s, "Hangul_PreHanja")) return XK_Hangul_PreHanja;
-	if (!strcmp(s, "Hangul_PostHanja")) return XK_Hangul_PostHanja;
-	if (!strcmp(s, "Hangul_SingleCandidate")) return XK_Hangul_SingleCandidate;
-	if (!strcmp(s, "Hangul_MultipleCandidate")) return XK_Hangul_MultipleCandidate;
-	if (!strcmp(s, "Hangul_PreviousCandidate")) return XK_Hangul_PreviousCandidate;
-	if (!strcmp(s, "Hangul_Special")) return XK_Hangul_Special;
-	if (!strcmp(s, "Hangul_switch")) return XK_Hangul_switch;
-	if (!strcmp(s, "Hangul_Kiyeog")) return XK_Hangul_Kiyeog;
-	if (!strcmp(s, "Hangul_SsangKiyeog")) return XK_Hangul_SsangKiyeog;
-	if (!strcmp(s, "Hangul_KiyeogSios")) return XK_Hangul_KiyeogSios;
-	if (!strcmp(s, "Hangul_Nieun")) return XK_Hangul_Nieun;
-	if (!strcmp(s, "Hangul_NieunJieuj")) return XK_Hangul_NieunJieuj;
-	if (!strcmp(s, "Hangul_NieunHieuh")) return XK_Hangul_NieunHieuh;
-	if (!strcmp(s, "Hangul_Dikeud")) return XK_Hangul_Dikeud;
-	if (!strcmp(s, "Hangul_SsangDikeud")) return XK_Hangul_SsangDikeud;
-	if (!strcmp(s, "Hangul_Rieul")) return XK_Hangul_Rieul;
-	if (!strcmp(s, "Hangul_RieulKiyeog")) return XK_Hangul_RieulKiyeog;
-	if (!strcmp(s, "Hangul_RieulMieum")) return XK_Hangul_RieulMieum;
-	if (!strcmp(s, "Hangul_RieulPieub")) return XK_Hangul_RieulPieub;
-	if (!strcmp(s, "Hangul_RieulSios")) return XK_Hangul_RieulSios;
-	if (!strcmp(s, "Hangul_RieulTieut")) return XK_Hangul_RieulTieut;
-	if (!strcmp(s, "Hangul_RieulPhieuf")) return XK_Hangul_RieulPhieuf;
-	if (!strcmp(s, "Hangul_RieulHieuh")) return XK_Hangul_RieulHieuh;
-	if (!strcmp(s, "Hangul_Mieum")) return XK_Hangul_Mieum;
-	if (!strcmp(s, "Hangul_Pieub")) return XK_Hangul_Pieub;
-	if (!strcmp(s, "Hangul_SsangPieub")) return XK_Hangul_SsangPieub;
-	if (!strcmp(s, "Hangul_PieubSios")) return XK_Hangul_PieubSios;
-	if (!strcmp(s, "Hangul_Sios")) return XK_Hangul_Sios;
-	if (!strcmp(s, "Hangul_SsangSios")) return XK_Hangul_SsangSios;
-	if (!strcmp(s, "Hangul_Ieung")) return XK_Hangul_Ieung;
-	if (!strcmp(s, "Hangul_Jieuj")) return XK_Hangul_Jieuj;
-	if (!strcmp(s, "Hangul_SsangJieuj")) return XK_Hangul_SsangJieuj;
-	if (!strcmp(s, "Hangul_Cieuc")) return XK_Hangul_Cieuc;
-	if (!strcmp(s, "Hangul_Khieuq")) return XK_Hangul_Khieuq;
-	if (!strcmp(s, "Hangul_Tieut")) return XK_Hangul_Tieut;
-	if (!strcmp(s, "Hangul_Phieuf")) return XK_Hangul_Phieuf;
-	if (!strcmp(s, "Hangul_Hieuh")) return XK_Hangul_Hieuh;
-	if (!strcmp(s, "Hangul_A")) return XK_Hangul_A;
-	if (!strcmp(s, "Hangul_AE")) return XK_Hangul_AE;
-	if (!strcmp(s, "Hangul_YA")) return XK_Hangul_YA;
-	if (!strcmp(s, "Hangul_YAE")) return XK_Hangul_YAE;
-	if (!strcmp(s, "Hangul_EO")) return XK_Hangul_EO;
-	if (!strcmp(s, "Hangul_E")) return XK_Hangul_E;
-	if (!strcmp(s, "Hangul_YEO")) return XK_Hangul_YEO;
-	if (!strcmp(s, "Hangul_YE")) return XK_Hangul_YE;
-	if (!strcmp(s, "Hangul_O")) return XK_Hangul_O;
-	if (!strcmp(s, "Hangul_WA")) return XK_Hangul_WA;
-	if (!strcmp(s, "Hangul_WAE")) return XK_Hangul_WAE;
-	if (!strcmp(s, "Hangul_OE")) return XK_Hangul_OE;
-	if (!strcmp(s, "Hangul_YO")) return XK_Hangul_YO;
-	if (!strcmp(s, "Hangul_U")) return XK_Hangul_U;
-	if (!strcmp(s, "Hangul_WEO")) return XK_Hangul_WEO;
-	if (!strcmp(s, "Hangul_WE")) return XK_Hangul_WE;
-	if (!strcmp(s, "Hangul_WI")) return XK_Hangul_WI;
-	if (!strcmp(s, "Hangul_YU")) return XK_Hangul_YU;
-	if (!strcmp(s, "Hangul_EU")) return XK_Hangul_EU;
-	if (!strcmp(s, "Hangul_YI")) return XK_Hangul_YI;
-	if (!strcmp(s, "Hangul_I")) return XK_Hangul_I;
-	if (!strcmp(s, "Hangul_J_Kiyeog")) return XK_Hangul_J_Kiyeog;
-	if (!strcmp(s, "Hangul_J_SsangKiyeog")) return XK_Hangul_J_SsangKiyeog;
-	if (!strcmp(s, "Hangul_J_KiyeogSios")) return XK_Hangul_J_KiyeogSios;
-	if (!strcmp(s, "Hangul_J_Nieun")) return XK_Hangul_J_Nieun;
-	if (!strcmp(s, "Hangul_J_NieunJieuj")) return XK_Hangul_J_NieunJieuj;
-	if (!strcmp(s, "Hangul_J_NieunHieuh")) return XK_Hangul_J_NieunHieuh;
-	if (!strcmp(s, "Hangul_J_Dikeud")) return XK_Hangul_J_Dikeud;
-	if (!strcmp(s, "Hangul_J_Rieul")) return XK_Hangul_J_Rieul;
-	if (!strcmp(s, "Hangul_J_RieulKiyeog")) return XK_Hangul_J_RieulKiyeog;
-	if (!strcmp(s, "Hangul_J_RieulMieum")) return XK_Hangul_J_RieulMieum;
-	if (!strcmp(s, "Hangul_J_RieulPieub")) return XK_Hangul_J_RieulPieub;
-	if (!strcmp(s, "Hangul_J_RieulSios")) return XK_Hangul_J_RieulSios;
-	if (!strcmp(s, "Hangul_J_RieulTieut")) return XK_Hangul_J_RieulTieut;
-	if (!strcmp(s, "Hangul_J_RieulPhieuf")) return XK_Hangul_J_RieulPhieuf;
-	if (!strcmp(s, "Hangul_J_RieulHieuh")) return XK_Hangul_J_RieulHieuh;
-	if (!strcmp(s, "Hangul_J_Mieum")) return XK_Hangul_J_Mieum;
-	if (!strcmp(s, "Hangul_J_Pieub")) return XK_Hangul_J_Pieub;
-	if (!strcmp(s, "Hangul_J_PieubSios")) return XK_Hangul_J_PieubSios;
-	if (!strcmp(s, "Hangul_J_Sios")) return XK_Hangul_J_Sios;
-	if (!strcmp(s, "Hangul_J_SsangSios")) return XK_Hangul_J_SsangSios;
-	if (!strcmp(s, "Hangul_J_Ieung")) return XK_Hangul_J_Ieung;
-	if (!strcmp(s, "Hangul_J_Jieuj")) return XK_Hangul_J_Jieuj;
-	if (!strcmp(s, "Hangul_J_Cieuc")) return XK_Hangul_J_Cieuc;
-	if (!strcmp(s, "Hangul_J_Khieuq")) return XK_Hangul_J_Khieuq;
-	if (!strcmp(s, "Hangul_J_Tieut")) return XK_Hangul_J_Tieut;
-	if (!strcmp(s, "Hangul_J_Phieuf")) return XK_Hangul_J_Phieuf;
-	if (!strcmp(s, "Hangul_J_Hieuh")) return XK_Hangul_J_Hieuh;
-	if (!strcmp(s, "Hangul_RieulYeorinHieuh")) return XK_Hangul_RieulYeorinHieuh;
-	if (!strcmp(s, "Hangul_SunkyeongeumMieum")) return XK_Hangul_SunkyeongeumMieum;
-	if (!strcmp(s, "Hangul_SunkyeongeumPieub")) return XK_Hangul_SunkyeongeumPieub;
-	if (!strcmp(s, "Hangul_PanSios")) return XK_Hangul_PanSios;
-	if (!strcmp(s, "Hangul_KkogjiDalrinIeung")) return XK_Hangul_KkogjiDalrinIeung;
-	if (!strcmp(s, "Hangul_SunkyeongeumPhieuf")) return XK_Hangul_SunkyeongeumPhieuf;
-	if (!strcmp(s, "Hangul_YeorinHieuh")) return XK_Hangul_YeorinHieuh;
-	if (!strcmp(s, "Hangul_AraeA")) return XK_Hangul_AraeA;
-	if (!strcmp(s, "Hangul_AraeAE")) return XK_Hangul_AraeAE;
-	if (!strcmp(s, "Hangul_J_PanSios")) return XK_Hangul_J_PanSios;
-	if (!strcmp(s, "Hangul_J_KkogjiDalrinIeung")) return XK_Hangul_J_KkogjiDalrinIeung;
-	if (!strcmp(s, "Hangul_J_YeorinHieuh")) return XK_Hangul_J_YeorinHieuh;
-	if (!strcmp(s, "Korean_Won")) return XK_Korean_Won;
-#endif /* XK_KOREAN */
-	if (!strcmp(s, "EuroSign")) return XK_EuroSign;
-#endif
-	return NoSymbol;	
-}
-
-
-char *XKeysymToString(KeySym k) {
-#ifndef XK_0_nosuch
-	if (k == XK_VoidSymbol) return "VoidSymbol";
-#ifdef XK_MISCELLANY
-	if (k == XK_BackSpace) return "BackSpace";
-	if (k == XK_Tab) return "Tab";
-	if (k == XK_Linefeed) return "Linefeed";
-	if (k == XK_Clear) return "Clear";
-	if (k == XK_Return) return "Return";
-	if (k == XK_Pause) return "Pause";
-	if (k == XK_Scroll_Lock) return "Scroll_Lock";
-	if (k == XK_Sys_Req) return "Sys_Req";
-	if (k == XK_Escape) return "Escape";
-	if (k == XK_Delete) return "Delete";
-	if (k == XK_Multi_key) return "Multi_key";
-	if (k == XK_SingleCandidate) return "SingleCandidate";
-	if (k == XK_MultipleCandidate) return "MultipleCandidate";
-	if (k == XK_PreviousCandidate) return "PreviousCandidate";
-	if (k == XK_Kanji) return "Kanji";
-	if (k == XK_Muhenkan) return "Muhenkan";
-	if (k == XK_Henkan_Mode) return "Henkan_Mode";
-	if (k == XK_Henkan) return "Henkan";
-	if (k == XK_Romaji) return "Romaji";
-	if (k == XK_Hiragana) return "Hiragana";
-	if (k == XK_Katakana) return "Katakana";
-	if (k == XK_Hiragana_Katakana) return "Hiragana_Katakana";
-	if (k == XK_Zenkaku) return "Zenkaku";
-	if (k == XK_Hankaku) return "Hankaku";
-	if (k == XK_Zenkaku_Hankaku) return "Zenkaku_Hankaku";
-	if (k == XK_Touroku) return "Touroku";
-	if (k == XK_Massyo) return "Massyo";
-	if (k == XK_Kana_Lock) return "Kana_Lock";
-	if (k == XK_Kana_Shift) return "Kana_Shift";
-	if (k == XK_Eisu_Shift) return "Eisu_Shift";
-	if (k == XK_Eisu_toggle) return "Eisu_toggle";
-	if (k == XK_Zen_Koho) return "Zen_Koho";
-	if (k == XK_Mae_Koho) return "Mae_Koho";
-	if (k == XK_Home) return "Home";
-	if (k == XK_Left) return "Left";
-	if (k == XK_Up) return "Up";
-	if (k == XK_Right) return "Right";
-	if (k == XK_Down) return "Down";
-	if (k == XK_Prior) return "Prior";
-	if (k == XK_Page_Up) return "Page_Up";
-	if (k == XK_Next) return "Next";
-	if (k == XK_Page_Down) return "Page_Down";
-	if (k == XK_End) return "End";
-	if (k == XK_Begin) return "Begin";
-	if (k == XK_Select) return "Select";
-	if (k == XK_Print) return "Print";
-	if (k == XK_Execute) return "Execute";
-	if (k == XK_Insert) return "Insert";
-	if (k == XK_Undo) return "Undo";
-	if (k == XK_Redo) return "Redo";
-	if (k == XK_Menu) return "Menu";
-	if (k == XK_Find) return "Find";
-	if (k == XK_Cancel) return "Cancel";
-	if (k == XK_Help) return "Help";
-	if (k == XK_Break) return "Break";
-	if (k == XK_Mode_switch) return "Mode_switch";
-	if (k == XK_script_switch) return "script_switch";
-	if (k == XK_Num_Lock) return "Num_Lock";
-	if (k == XK_KP_Space) return "KP_Space";
-	if (k == XK_KP_Tab) return "KP_Tab";
-	if (k == XK_KP_Enter) return "KP_Enter";
-	if (k == XK_KP_F1) return "KP_F1";
-	if (k == XK_KP_F2) return "KP_F2";
-	if (k == XK_KP_F3) return "KP_F3";
-	if (k == XK_KP_F4) return "KP_F4";
-	if (k == XK_KP_Home) return "KP_Home";
-	if (k == XK_KP_Left) return "KP_Left";
-	if (k == XK_KP_Up) return "KP_Up";
-	if (k == XK_KP_Right) return "KP_Right";
-	if (k == XK_KP_Down) return "KP_Down";
-	if (k == XK_KP_Prior) return "KP_Prior";
-	if (k == XK_KP_Page_Up) return "KP_Page_Up";
-	if (k == XK_KP_Next) return "KP_Next";
-	if (k == XK_KP_Page_Down) return "KP_Page_Down";
-	if (k == XK_KP_End) return "KP_End";
-	if (k == XK_KP_Begin) return "KP_Begin";
-	if (k == XK_KP_Insert) return "KP_Insert";
-	if (k == XK_KP_Delete) return "KP_Delete";
-	if (k == XK_KP_Equal) return "KP_Equal";
-	if (k == XK_KP_Multiply) return "KP_Multiply";
-	if (k == XK_KP_Add) return "KP_Add";
-	if (k == XK_KP_Separator) return "KP_Separator";
-	if (k == XK_KP_Subtract) return "KP_Subtract";
-	if (k == XK_KP_Decimal) return "KP_Decimal";
-	if (k == XK_KP_Divide) return "KP_Divide";
-	if (k == XK_KP_0) return "KP_0";
-	if (k == XK_KP_1) return "KP_1";
-	if (k == XK_KP_2) return "KP_2";
-	if (k == XK_KP_3) return "KP_3";
-	if (k == XK_KP_4) return "KP_4";
-	if (k == XK_KP_5) return "KP_5";
-	if (k == XK_KP_6) return "KP_6";
-	if (k == XK_KP_7) return "KP_7";
-	if (k == XK_KP_8) return "KP_8";
-	if (k == XK_KP_9) return "KP_9";
-	if (k == XK_F1) return "F1";
-	if (k == XK_F2) return "F2";
-	if (k == XK_F3) return "F3";
-	if (k == XK_F4) return "F4";
-	if (k == XK_F5) return "F5";
-	if (k == XK_F6) return "F6";
-	if (k == XK_F7) return "F7";
-	if (k == XK_F8) return "F8";
-	if (k == XK_F9) return "F9";
-	if (k == XK_F10) return "F10";
-	if (k == XK_F11) return "F11";
-	if (k == XK_L1) return "L1";
-	if (k == XK_F12) return "F12";
-	if (k == XK_L2) return "L2";
-	if (k == XK_F13) return "F13";
-	if (k == XK_L3) return "L3";
-	if (k == XK_F14) return "F14";
-	if (k == XK_L4) return "L4";
-	if (k == XK_F15) return "F15";
-	if (k == XK_L5) return "L5";
-	if (k == XK_F16) return "F16";
-	if (k == XK_L6) return "L6";
-	if (k == XK_F17) return "F17";
-	if (k == XK_L7) return "L7";
-	if (k == XK_F18) return "F18";
-	if (k == XK_L8) return "L8";
-	if (k == XK_F19) return "F19";
-	if (k == XK_L9) return "L9";
-	if (k == XK_F20) return "F20";
-	if (k == XK_L10) return "L10";
-	if (k == XK_F21) return "F21";
-	if (k == XK_R1) return "R1";
-	if (k == XK_F22) return "F22";
-	if (k == XK_R2) return "R2";
-	if (k == XK_F23) return "F23";
-	if (k == XK_R3) return "R3";
-	if (k == XK_F24) return "F24";
-	if (k == XK_R4) return "R4";
-	if (k == XK_F25) return "F25";
-	if (k == XK_R5) return "R5";
-	if (k == XK_F26) return "F26";
-	if (k == XK_R6) return "R6";
-	if (k == XK_F27) return "F27";
-	if (k == XK_R7) return "R7";
-	if (k == XK_F28) return "F28";
-	if (k == XK_R8) return "R8";
-	if (k == XK_F29) return "F29";
-	if (k == XK_R9) return "R9";
-	if (k == XK_F30) return "F30";
-	if (k == XK_R10) return "R10";
-	if (k == XK_F31) return "F31";
-	if (k == XK_R11) return "R11";
-	if (k == XK_F32) return "F32";
-	if (k == XK_R12) return "R12";
-	if (k == XK_F33) return "F33";
-	if (k == XK_R13) return "R13";
-	if (k == XK_F34) return "F34";
-	if (k == XK_R14) return "R14";
-	if (k == XK_F35) return "F35";
-	if (k == XK_R15) return "R15";
-	if (k == XK_Shift_L) return "Shift_L";
-	if (k == XK_Shift_R) return "Shift_R";
-	if (k == XK_Control_L) return "Control_L";
-	if (k == XK_Control_R) return "Control_R";
-	if (k == XK_Caps_Lock) return "Caps_Lock";
-	if (k == XK_Shift_Lock) return "Shift_Lock";
-	if (k == XK_Meta_L) return "Meta_L";
-	if (k == XK_Meta_R) return "Meta_R";
-	if (k == XK_Alt_L) return "Alt_L";
-	if (k == XK_Alt_R) return "Alt_R";
-	if (k == XK_Super_L) return "Super_L";
-	if (k == XK_Super_R) return "Super_R";
-	if (k == XK_Hyper_L) return "Hyper_L";
-	if (k == XK_Hyper_R) return "Hyper_R";
-#endif /* XK_MISCELLANY */
-#ifdef XK_XKB_KEYS
-	if (k == XK_ISO_Lock) return "ISO_Lock";
-	if (k == XK_ISO_Level2_Latch) return "ISO_Level2_Latch";
-	if (k == XK_ISO_Level3_Shift) return "ISO_Level3_Shift";
-	if (k == XK_ISO_Level3_Latch) return "ISO_Level3_Latch";
-	if (k == XK_ISO_Level3_Lock) return "ISO_Level3_Lock";
-	if (k == XK_ISO_Group_Shift) return "ISO_Group_Shift";
-	if (k == XK_ISO_Group_Latch) return "ISO_Group_Latch";
-	if (k == XK_ISO_Group_Lock) return "ISO_Group_Lock";
-	if (k == XK_ISO_Next_Group) return "ISO_Next_Group";
-	if (k == XK_ISO_Next_Group_Lock) return "ISO_Next_Group_Lock";
-	if (k == XK_ISO_Prev_Group) return "ISO_Prev_Group";
-	if (k == XK_ISO_Prev_Group_Lock) return "ISO_Prev_Group_Lock";
-	if (k == XK_ISO_First_Group) return "ISO_First_Group";
-	if (k == XK_ISO_First_Group_Lock) return "ISO_First_Group_Lock";
-	if (k == XK_ISO_Last_Group) return "ISO_Last_Group";
-	if (k == XK_ISO_Last_Group_Lock) return "ISO_Last_Group_Lock";
-	if (k == XK_ISO_Left_Tab) return "ISO_Left_Tab";
-	if (k == XK_ISO_Move_Line_Up) return "ISO_Move_Line_Up";
-	if (k == XK_ISO_Move_Line_Down) return "ISO_Move_Line_Down";
-	if (k == XK_ISO_Partial_Line_Up) return "ISO_Partial_Line_Up";
-	if (k == XK_ISO_Partial_Line_Down) return "ISO_Partial_Line_Down";
-	if (k == XK_ISO_Partial_Space_Left) return "ISO_Partial_Space_Left";
-	if (k == XK_ISO_Partial_Space_Right) return "ISO_Partial_Space_Right";
-	if (k == XK_ISO_Set_Margin_Left) return "ISO_Set_Margin_Left";
-	if (k == XK_ISO_Set_Margin_Right) return "ISO_Set_Margin_Right";
-	if (k == XK_ISO_Release_Margin_Left) return "ISO_Release_Margin_Left";
-	if (k == XK_ISO_Release_Margin_Right) return "ISO_Release_Margin_Right";
-	if (k == XK_ISO_Release_Both_Margins) return "ISO_Release_Both_Margins";
-	if (k == XK_ISO_Fast_Cursor_Left) return "ISO_Fast_Cursor_Left";
-	if (k == XK_ISO_Fast_Cursor_Right) return "ISO_Fast_Cursor_Right";
-	if (k == XK_ISO_Fast_Cursor_Up) return "ISO_Fast_Cursor_Up";
-	if (k == XK_ISO_Fast_Cursor_Down) return "ISO_Fast_Cursor_Down";
-	if (k == XK_ISO_Continuous_Underline) return "ISO_Continuous_Underline";
-	if (k == XK_ISO_Discontinuous_Underline) return "ISO_Discontinuous_Underline";
-	if (k == XK_ISO_Emphasize) return "ISO_Emphasize";
-	if (k == XK_ISO_Center_Object) return "ISO_Center_Object";
-	if (k == XK_ISO_Enter) return "ISO_Enter";
-	if (k == XK_dead_grave) return "dead_grave";
-	if (k == XK_dead_acute) return "dead_acute";
-	if (k == XK_dead_circumflex) return "dead_circumflex";
-	if (k == XK_dead_tilde) return "dead_tilde";
-	if (k == XK_dead_macron) return "dead_macron";
-	if (k == XK_dead_breve) return "dead_breve";
-	if (k == XK_dead_abovedot) return "dead_abovedot";
-	if (k == XK_dead_diaeresis) return "dead_diaeresis";
-	if (k == XK_dead_abovering) return "dead_abovering";
-	if (k == XK_dead_doubleacute) return "dead_doubleacute";
-	if (k == XK_dead_caron) return "dead_caron";
-	if (k == XK_dead_cedilla) return "dead_cedilla";
-	if (k == XK_dead_ogonek) return "dead_ogonek";
-	if (k == XK_dead_iota) return "dead_iota";
-	if (k == XK_dead_voiced_sound) return "dead_voiced_sound";
-	if (k == XK_dead_semivoiced_sound) return "dead_semivoiced_sound";
-	if (k == XK_dead_belowdot) return "dead_belowdot";
-	if (k == XK_First_Virtual_Screen) return "First_Virtual_Screen";
-	if (k == XK_Prev_Virtual_Screen) return "Prev_Virtual_Screen";
-	if (k == XK_Next_Virtual_Screen) return "Next_Virtual_Screen";
-	if (k == XK_Last_Virtual_Screen) return "Last_Virtual_Screen";
-	if (k == XK_Terminate_Server) return "Terminate_Server";
-	if (k == XK_AccessX_Enable) return "AccessX_Enable";
-	if (k == XK_AccessX_Feedback_Enable) return "AccessX_Feedback_Enable";
-	if (k == XK_RepeatKeys_Enable) return "RepeatKeys_Enable";
-	if (k == XK_SlowKeys_Enable) return "SlowKeys_Enable";
-	if (k == XK_BounceKeys_Enable) return "BounceKeys_Enable";
-	if (k == XK_StickyKeys_Enable) return "StickyKeys_Enable";
-	if (k == XK_MouseKeys_Enable) return "MouseKeys_Enable";
-	if (k == XK_MouseKeys_Accel_Enable) return "MouseKeys_Accel_Enable";
-	if (k == XK_Overlay1_Enable) return "Overlay1_Enable";
-	if (k == XK_Overlay2_Enable) return "Overlay2_Enable";
-	if (k == XK_AudibleBell_Enable) return "AudibleBell_Enable";
-	if (k == XK_Pointer_Left) return "Pointer_Left";
-	if (k == XK_Pointer_Right) return "Pointer_Right";
-	if (k == XK_Pointer_Up) return "Pointer_Up";
-	if (k == XK_Pointer_Down) return "Pointer_Down";
-	if (k == XK_Pointer_UpLeft) return "Pointer_UpLeft";
-	if (k == XK_Pointer_UpRight) return "Pointer_UpRight";
-	if (k == XK_Pointer_DownLeft) return "Pointer_DownLeft";
-	if (k == XK_Pointer_DownRight) return "Pointer_DownRight";
-	if (k == XK_Pointer_Button_Dflt) return "Pointer_Button_Dflt";
-	if (k == XK_Pointer_Button1) return "Pointer_Button1";
-	if (k == XK_Pointer_Button2) return "Pointer_Button2";
-	if (k == XK_Pointer_Button3) return "Pointer_Button3";
-	if (k == XK_Pointer_Button4) return "Pointer_Button4";
-	if (k == XK_Pointer_Button5) return "Pointer_Button5";
-	if (k == XK_Pointer_DblClick_Dflt) return "Pointer_DblClick_Dflt";
-	if (k == XK_Pointer_DblClick1) return "Pointer_DblClick1";
-	if (k == XK_Pointer_DblClick2) return "Pointer_DblClick2";
-	if (k == XK_Pointer_DblClick3) return "Pointer_DblClick3";
-	if (k == XK_Pointer_DblClick4) return "Pointer_DblClick4";
-	if (k == XK_Pointer_DblClick5) return "Pointer_DblClick5";
-	if (k == XK_Pointer_Drag_Dflt) return "Pointer_Drag_Dflt";
-	if (k == XK_Pointer_Drag1) return "Pointer_Drag1";
-	if (k == XK_Pointer_Drag2) return "Pointer_Drag2";
-	if (k == XK_Pointer_Drag3) return "Pointer_Drag3";
-	if (k == XK_Pointer_Drag4) return "Pointer_Drag4";
-	if (k == XK_Pointer_Drag5) return "Pointer_Drag5";
-	if (k == XK_Pointer_EnableKeys) return "Pointer_EnableKeys";
-	if (k == XK_Pointer_Accelerate) return "Pointer_Accelerate";
-	if (k == XK_Pointer_DfltBtnNext) return "Pointer_DfltBtnNext";
-	if (k == XK_Pointer_DfltBtnPrev) return "Pointer_DfltBtnPrev";
-#endif
-#ifdef XK_3270
-	if (k == XK_3270_Duplicate) return "3270_Duplicate";
-	if (k == XK_3270_FieldMark) return "3270_FieldMark";
-	if (k == XK_3270_Right2) return "3270_Right2";
-	if (k == XK_3270_Left2) return "3270_Left2";
-	if (k == XK_3270_BackTab) return "3270_BackTab";
-	if (k == XK_3270_EraseEOF) return "3270_EraseEOF";
-	if (k == XK_3270_EraseInput) return "3270_EraseInput";
-	if (k == XK_3270_Reset) return "3270_Reset";
-	if (k == XK_3270_Quit) return "3270_Quit";
-	if (k == XK_3270_PA1) return "3270_PA1";
-	if (k == XK_3270_PA2) return "3270_PA2";
-	if (k == XK_3270_PA3) return "3270_PA3";
-	if (k == XK_3270_Test) return "3270_Test";
-	if (k == XK_3270_Attn) return "3270_Attn";
-	if (k == XK_3270_CursorBlink) return "3270_CursorBlink";
-	if (k == XK_3270_AltCursor) return "3270_AltCursor";
-	if (k == XK_3270_KeyClick) return "3270_KeyClick";
-	if (k == XK_3270_Jump) return "3270_Jump";
-	if (k == XK_3270_Ident) return "3270_Ident";
-	if (k == XK_3270_Rule) return "3270_Rule";
-	if (k == XK_3270_Copy) return "3270_Copy";
-	if (k == XK_3270_Play) return "3270_Play";
-	if (k == XK_3270_Setup) return "3270_Setup";
-	if (k == XK_3270_Record) return "3270_Record";
-	if (k == XK_3270_ChangeScreen) return "3270_ChangeScreen";
-	if (k == XK_3270_DeleteWord) return "3270_DeleteWord";
-	if (k == XK_3270_ExSelect) return "3270_ExSelect";
-	if (k == XK_3270_CursorSelect) return "3270_CursorSelect";
-	if (k == XK_3270_PrintScreen) return "3270_PrintScreen";
-	if (k == XK_3270_Enter) return "3270_Enter";
-#endif
-#ifdef XK_LATIN1
-	if (k == XK_space) return "space";
-	if (k == XK_exclam) return "exclam";
-	if (k == XK_quotedbl) return "quotedbl";
-	if (k == XK_numbersign) return "numbersign";
-	if (k == XK_dollar) return "dollar";
-	if (k == XK_percent) return "percent";
-	if (k == XK_ampersand) return "ampersand";
-	if (k == XK_apostrophe) return "apostrophe";
-	if (k == XK_quoteright) return "quoteright";
-	if (k == XK_parenleft) return "parenleft";
-	if (k == XK_parenright) return "parenright";
-	if (k == XK_asterisk) return "asterisk";
-	if (k == XK_plus) return "plus";
-	if (k == XK_comma) return "comma";
-	if (k == XK_minus) return "minus";
-	if (k == XK_period) return "period";
-	if (k == XK_slash) return "slash";
-	if (k == XK_0) return "0";
-	if (k == XK_1) return "1";
-	if (k == XK_2) return "2";
-	if (k == XK_3) return "3";
-	if (k == XK_4) return "4";
-	if (k == XK_5) return "5";
-	if (k == XK_6) return "6";
-	if (k == XK_7) return "7";
-	if (k == XK_8) return "8";
-	if (k == XK_9) return "9";
-	if (k == XK_colon) return "colon";
-	if (k == XK_semicolon) return "semicolon";
-	if (k == XK_less) return "less";
-	if (k == XK_equal) return "equal";
-	if (k == XK_greater) return "greater";
-	if (k == XK_question) return "question";
-	if (k == XK_at) return "at";
-	if (k == XK_A) return "A";
-	if (k == XK_B) return "B";
-	if (k == XK_C) return "C";
-	if (k == XK_D) return "D";
-	if (k == XK_E) return "E";
-	if (k == XK_F) return "F";
-	if (k == XK_G) return "G";
-	if (k == XK_H) return "H";
-	if (k == XK_I) return "I";
-	if (k == XK_J) return "J";
-	if (k == XK_K) return "K";
-	if (k == XK_L) return "L";
-	if (k == XK_M) return "M";
-	if (k == XK_N) return "N";
-	if (k == XK_O) return "O";
-	if (k == XK_P) return "P";
-	if (k == XK_Q) return "Q";
-	if (k == XK_R) return "R";
-	if (k == XK_S) return "S";
-	if (k == XK_T) return "T";
-	if (k == XK_U) return "U";
-	if (k == XK_V) return "V";
-	if (k == XK_W) return "W";
-	if (k == XK_X) return "X";
-	if (k == XK_Y) return "Y";
-	if (k == XK_Z) return "Z";
-	if (k == XK_bracketleft) return "bracketleft";
-	if (k == XK_backslash) return "backslash";
-	if (k == XK_bracketright) return "bracketright";
-	if (k == XK_asciicircum) return "asciicircum";
-	if (k == XK_underscore) return "underscore";
-	if (k == XK_grave) return "grave";
-	if (k == XK_quoteleft) return "quoteleft";
-	if (k == XK_a) return "a";
-	if (k == XK_b) return "b";
-	if (k == XK_c) return "c";
-	if (k == XK_d) return "d";
-	if (k == XK_e) return "e";
-	if (k == XK_f) return "f";
-	if (k == XK_g) return "g";
-	if (k == XK_h) return "h";
-	if (k == XK_i) return "i";
-	if (k == XK_j) return "j";
-	if (k == XK_k) return "k";
-	if (k == XK_l) return "l";
-	if (k == XK_m) return "m";
-	if (k == XK_n) return "n";
-	if (k == XK_o) return "o";
-	if (k == XK_p) return "p";
-	if (k == XK_q) return "q";
-	if (k == XK_r) return "r";
-	if (k == XK_s) return "s";
-	if (k == XK_t) return "t";
-	if (k == XK_u) return "u";
-	if (k == XK_v) return "v";
-	if (k == XK_w) return "w";
-	if (k == XK_x) return "x";
-	if (k == XK_y) return "y";
-	if (k == XK_z) return "z";
-	if (k == XK_braceleft) return "braceleft";
-	if (k == XK_bar) return "bar";
-	if (k == XK_braceright) return "braceright";
-	if (k == XK_asciitilde) return "asciitilde";
-	if (k == XK_nobreakspace) return "nobreakspace";
-	if (k == XK_exclamdown) return "exclamdown";
-	if (k == XK_cent) return "cent";
-	if (k == XK_sterling) return "sterling";
-	if (k == XK_currency) return "currency";
-	if (k == XK_yen) return "yen";
-	if (k == XK_brokenbar) return "brokenbar";
-	if (k == XK_section) return "section";
-	if (k == XK_diaeresis) return "diaeresis";
-	if (k == XK_copyright) return "copyright";
-	if (k == XK_ordfeminine) return "ordfeminine";
-	if (k == XK_guillemotleft) return "guillemotleft";
-	if (k == XK_notsign) return "notsign";
-	if (k == XK_hyphen) return "hyphen";
-	if (k == XK_registered) return "registered";
-	if (k == XK_macron) return "macron";
-	if (k == XK_degree) return "degree";
-	if (k == XK_plusminus) return "plusminus";
-	if (k == XK_twosuperior) return "twosuperior";
-	if (k == XK_threesuperior) return "threesuperior";
-	if (k == XK_acute) return "acute";
-	if (k == XK_mu) return "mu";
-	if (k == XK_paragraph) return "paragraph";
-	if (k == XK_periodcentered) return "periodcentered";
-	if (k == XK_cedilla) return "cedilla";
-	if (k == XK_onesuperior) return "onesuperior";
-	if (k == XK_masculine) return "masculine";
-	if (k == XK_guillemotright) return "guillemotright";
-	if (k == XK_onequarter) return "onequarter";
-	if (k == XK_onehalf) return "onehalf";
-	if (k == XK_threequarters) return "threequarters";
-	if (k == XK_questiondown) return "questiondown";
-	if (k == XK_Agrave) return "Agrave";
-	if (k == XK_Aacute) return "Aacute";
-	if (k == XK_Acircumflex) return "Acircumflex";
-	if (k == XK_Atilde) return "Atilde";
-	if (k == XK_Adiaeresis) return "Adiaeresis";
-	if (k == XK_Aring) return "Aring";
-	if (k == XK_AE) return "AE";
-	if (k == XK_Ccedilla) return "Ccedilla";
-	if (k == XK_Egrave) return "Egrave";
-	if (k == XK_Eacute) return "Eacute";
-	if (k == XK_Ecircumflex) return "Ecircumflex";
-	if (k == XK_Ediaeresis) return "Ediaeresis";
-	if (k == XK_Igrave) return "Igrave";
-	if (k == XK_Iacute) return "Iacute";
-	if (k == XK_Icircumflex) return "Icircumflex";
-	if (k == XK_Idiaeresis) return "Idiaeresis";
-	if (k == XK_ETH) return "ETH";
-	if (k == XK_Eth) return "Eth";
-	if (k == XK_Ntilde) return "Ntilde";
-	if (k == XK_Ograve) return "Ograve";
-	if (k == XK_Oacute) return "Oacute";
-	if (k == XK_Ocircumflex) return "Ocircumflex";
-	if (k == XK_Otilde) return "Otilde";
-	if (k == XK_Odiaeresis) return "Odiaeresis";
-	if (k == XK_multiply) return "multiply";
-	if (k == XK_Ooblique) return "Ooblique";
-	if (k == XK_Ugrave) return "Ugrave";
-	if (k == XK_Uacute) return "Uacute";
-	if (k == XK_Ucircumflex) return "Ucircumflex";
-	if (k == XK_Udiaeresis) return "Udiaeresis";
-	if (k == XK_Yacute) return "Yacute";
-	if (k == XK_THORN) return "THORN";
-	if (k == XK_Thorn) return "Thorn";
-	if (k == XK_ssharp) return "ssharp";
-	if (k == XK_agrave) return "agrave";
-	if (k == XK_aacute) return "aacute";
-	if (k == XK_acircumflex) return "acircumflex";
-	if (k == XK_atilde) return "atilde";
-	if (k == XK_adiaeresis) return "adiaeresis";
-	if (k == XK_aring) return "aring";
-	if (k == XK_ae) return "ae";
-	if (k == XK_ccedilla) return "ccedilla";
-	if (k == XK_egrave) return "egrave";
-	if (k == XK_eacute) return "eacute";
-	if (k == XK_ecircumflex) return "ecircumflex";
-	if (k == XK_ediaeresis) return "ediaeresis";
-	if (k == XK_igrave) return "igrave";
-	if (k == XK_iacute) return "iacute";
-	if (k == XK_icircumflex) return "icircumflex";
-	if (k == XK_idiaeresis) return "idiaeresis";
-	if (k == XK_eth) return "eth";
-	if (k == XK_ntilde) return "ntilde";
-	if (k == XK_ograve) return "ograve";
-	if (k == XK_oacute) return "oacute";
-	if (k == XK_ocircumflex) return "ocircumflex";
-	if (k == XK_otilde) return "otilde";
-	if (k == XK_odiaeresis) return "odiaeresis";
-	if (k == XK_division) return "division";
-	if (k == XK_oslash) return "oslash";
-	if (k == XK_ugrave) return "ugrave";
-	if (k == XK_uacute) return "uacute";
-	if (k == XK_ucircumflex) return "ucircumflex";
-	if (k == XK_udiaeresis) return "udiaeresis";
-	if (k == XK_yacute) return "yacute";
-	if (k == XK_thorn) return "thorn";
-	if (k == XK_ydiaeresis) return "ydiaeresis";
-#endif /* XK_LATIN1 */
-#ifdef XK_LATIN2
-	if (k == XK_Aogonek) return "Aogonek";
-	if (k == XK_breve) return "breve";
-	if (k == XK_Lstroke) return "Lstroke";
-	if (k == XK_Lcaron) return "Lcaron";
-	if (k == XK_Sacute) return "Sacute";
-	if (k == XK_Scaron) return "Scaron";
-	if (k == XK_Scedilla) return "Scedilla";
-	if (k == XK_Tcaron) return "Tcaron";
-	if (k == XK_Zacute) return "Zacute";
-	if (k == XK_Zcaron) return "Zcaron";
-	if (k == XK_Zabovedot) return "Zabovedot";
-	if (k == XK_aogonek) return "aogonek";
-	if (k == XK_ogonek) return "ogonek";
-	if (k == XK_lstroke) return "lstroke";
-	if (k == XK_lcaron) return "lcaron";
-	if (k == XK_sacute) return "sacute";
-	if (k == XK_caron) return "caron";
-	if (k == XK_scaron) return "scaron";
-	if (k == XK_scedilla) return "scedilla";
-	if (k == XK_tcaron) return "tcaron";
-	if (k == XK_zacute) return "zacute";
-	if (k == XK_doubleacute) return "doubleacute";
-	if (k == XK_zcaron) return "zcaron";
-	if (k == XK_zabovedot) return "zabovedot";
-	if (k == XK_Racute) return "Racute";
-	if (k == XK_Abreve) return "Abreve";
-	if (k == XK_Lacute) return "Lacute";
-	if (k == XK_Cacute) return "Cacute";
-	if (k == XK_Ccaron) return "Ccaron";
-	if (k == XK_Eogonek) return "Eogonek";
-	if (k == XK_Ecaron) return "Ecaron";
-	if (k == XK_Dcaron) return "Dcaron";
-	if (k == XK_Dstroke) return "Dstroke";
-	if (k == XK_Nacute) return "Nacute";
-	if (k == XK_Ncaron) return "Ncaron";
-	if (k == XK_Odoubleacute) return "Odoubleacute";
-	if (k == XK_Rcaron) return "Rcaron";
-	if (k == XK_Uring) return "Uring";
-	if (k == XK_Udoubleacute) return "Udoubleacute";
-	if (k == XK_Tcedilla) return "Tcedilla";
-	if (k == XK_racute) return "racute";
-	if (k == XK_abreve) return "abreve";
-	if (k == XK_lacute) return "lacute";
-	if (k == XK_cacute) return "cacute";
-	if (k == XK_ccaron) return "ccaron";
-	if (k == XK_eogonek) return "eogonek";
-	if (k == XK_ecaron) return "ecaron";
-	if (k == XK_dcaron) return "dcaron";
-	if (k == XK_dstroke) return "dstroke";
-	if (k == XK_nacute) return "nacute";
-	if (k == XK_ncaron) return "ncaron";
-	if (k == XK_odoubleacute) return "odoubleacute";
-	if (k == XK_udoubleacute) return "udoubleacute";
-	if (k == XK_rcaron) return "rcaron";
-	if (k == XK_uring) return "uring";
-	if (k == XK_tcedilla) return "tcedilla";
-	if (k == XK_abovedot) return "abovedot";
-#endif /* XK_LATIN2 */
-#ifdef XK_LATIN3
-	if (k == XK_Hstroke) return "Hstroke";
-	if (k == XK_Hcircumflex) return "Hcircumflex";
-	if (k == XK_Iabovedot) return "Iabovedot";
-	if (k == XK_Gbreve) return "Gbreve";
-	if (k == XK_Jcircumflex) return "Jcircumflex";
-	if (k == XK_hstroke) return "hstroke";
-	if (k == XK_hcircumflex) return "hcircumflex";
-	if (k == XK_idotless) return "idotless";
-	if (k == XK_gbreve) return "gbreve";
-	if (k == XK_jcircumflex) return "jcircumflex";
-	if (k == XK_Cabovedot) return "Cabovedot";
-	if (k == XK_Ccircumflex) return "Ccircumflex";
-	if (k == XK_Gabovedot) return "Gabovedot";
-	if (k == XK_Gcircumflex) return "Gcircumflex";
-	if (k == XK_Ubreve) return "Ubreve";
-	if (k == XK_Scircumflex) return "Scircumflex";
-	if (k == XK_cabovedot) return "cabovedot";
-	if (k == XK_ccircumflex) return "ccircumflex";
-	if (k == XK_gabovedot) return "gabovedot";
-	if (k == XK_gcircumflex) return "gcircumflex";
-	if (k == XK_ubreve) return "ubreve";
-	if (k == XK_scircumflex) return "scircumflex";
-#endif /* XK_LATIN3 */
-#ifdef XK_LATIN4
-	if (k == XK_kra) return "kra";
-	if (k == XK_kappa) return "kappa";
-	if (k == XK_Rcedilla) return "Rcedilla";
-	if (k == XK_Itilde) return "Itilde";
-	if (k == XK_Lcedilla) return "Lcedilla";
-	if (k == XK_Emacron) return "Emacron";
-	if (k == XK_Gcedilla) return "Gcedilla";
-	if (k == XK_Tslash) return "Tslash";
-	if (k == XK_rcedilla) return "rcedilla";
-	if (k == XK_itilde) return "itilde";
-	if (k == XK_lcedilla) return "lcedilla";
-	if (k == XK_emacron) return "emacron";
-	if (k == XK_gcedilla) return "gcedilla";
-	if (k == XK_tslash) return "tslash";
-	if (k == XK_ENG) return "ENG";
-	if (k == XK_eng) return "eng";
-	if (k == XK_Amacron) return "Amacron";
-	if (k == XK_Iogonek) return "Iogonek";
-	if (k == XK_Eabovedot) return "Eabovedot";
-	if (k == XK_Imacron) return "Imacron";
-	if (k == XK_Ncedilla) return "Ncedilla";
-	if (k == XK_Omacron) return "Omacron";
-	if (k == XK_Kcedilla) return "Kcedilla";
-	if (k == XK_Uogonek) return "Uogonek";
-	if (k == XK_Utilde) return "Utilde";
-	if (k == XK_Umacron) return "Umacron";
-	if (k == XK_amacron) return "amacron";
-	if (k == XK_iogonek) return "iogonek";
-	if (k == XK_eabovedot) return "eabovedot";
-	if (k == XK_imacron) return "imacron";
-	if (k == XK_ncedilla) return "ncedilla";
-	if (k == XK_omacron) return "omacron";
-	if (k == XK_kcedilla) return "kcedilla";
-	if (k == XK_uogonek) return "uogonek";
-	if (k == XK_utilde) return "utilde";
-	if (k == XK_umacron) return "umacron";
-#endif /* XK_LATIN4 */
-#ifdef XK_KATAKANA
-	if (k == XK_overline) return "overline";
-	if (k == XK_kana_fullstop) return "kana_fullstop";
-	if (k == XK_kana_openingbracket) return "kana_openingbracket";
-	if (k == XK_kana_closingbracket) return "kana_closingbracket";
-	if (k == XK_kana_comma) return "kana_comma";
-	if (k == XK_kana_conjunctive) return "kana_conjunctive";
-	if (k == XK_kana_middledot) return "kana_middledot";
-	if (k == XK_kana_WO) return "kana_WO";
-	if (k == XK_kana_a) return "kana_a";
-	if (k == XK_kana_i) return "kana_i";
-	if (k == XK_kana_u) return "kana_u";
-	if (k == XK_kana_e) return "kana_e";
-	if (k == XK_kana_o) return "kana_o";
-	if (k == XK_kana_ya) return "kana_ya";
-	if (k == XK_kana_yu) return "kana_yu";
-	if (k == XK_kana_yo) return "kana_yo";
-	if (k == XK_kana_tsu) return "kana_tsu";
-	if (k == XK_kana_tu) return "kana_tu";
-	if (k == XK_prolongedsound) return "prolongedsound";
-	if (k == XK_kana_A) return "kana_A";
-	if (k == XK_kana_I) return "kana_I";
-	if (k == XK_kana_U) return "kana_U";
-	if (k == XK_kana_E) return "kana_E";
-	if (k == XK_kana_O) return "kana_O";
-	if (k == XK_kana_KA) return "kana_KA";
-	if (k == XK_kana_KI) return "kana_KI";
-	if (k == XK_kana_KU) return "kana_KU";
-	if (k == XK_kana_KE) return "kana_KE";
-	if (k == XK_kana_KO) return "kana_KO";
-	if (k == XK_kana_SA) return "kana_SA";
-	if (k == XK_kana_SHI) return "kana_SHI";
-	if (k == XK_kana_SU) return "kana_SU";
-	if (k == XK_kana_SE) return "kana_SE";
-	if (k == XK_kana_SO) return "kana_SO";
-	if (k == XK_kana_TA) return "kana_TA";
-	if (k == XK_kana_CHI) return "kana_CHI";
-	if (k == XK_kana_TI) return "kana_TI";
-	if (k == XK_kana_TSU) return "kana_TSU";
-	if (k == XK_kana_TU) return "kana_TU";
-	if (k == XK_kana_TE) return "kana_TE";
-	if (k == XK_kana_TO) return "kana_TO";
-	if (k == XK_kana_NA) return "kana_NA";
-	if (k == XK_kana_NI) return "kana_NI";
-	if (k == XK_kana_NU) return "kana_NU";
-	if (k == XK_kana_NE) return "kana_NE";
-	if (k == XK_kana_NO) return "kana_NO";
-	if (k == XK_kana_HA) return "kana_HA";
-	if (k == XK_kana_HI) return "kana_HI";
-	if (k == XK_kana_FU) return "kana_FU";
-	if (k == XK_kana_HU) return "kana_HU";
-	if (k == XK_kana_HE) return "kana_HE";
-	if (k == XK_kana_HO) return "kana_HO";
-	if (k == XK_kana_MA) return "kana_MA";
-	if (k == XK_kana_MI) return "kana_MI";
-	if (k == XK_kana_MU) return "kana_MU";
-	if (k == XK_kana_ME) return "kana_ME";
-	if (k == XK_kana_MO) return "kana_MO";
-	if (k == XK_kana_YA) return "kana_YA";
-	if (k == XK_kana_YU) return "kana_YU";
-	if (k == XK_kana_YO) return "kana_YO";
-	if (k == XK_kana_RA) return "kana_RA";
-	if (k == XK_kana_RI) return "kana_RI";
-	if (k == XK_kana_RU) return "kana_RU";
-	if (k == XK_kana_RE) return "kana_RE";
-	if (k == XK_kana_RO) return "kana_RO";
-	if (k == XK_kana_WA) return "kana_WA";
-	if (k == XK_kana_N) return "kana_N";
-	if (k == XK_voicedsound) return "voicedsound";
-	if (k == XK_semivoicedsound) return "semivoicedsound";
-	if (k == XK_kana_switch) return "kana_switch";
-#endif /* XK_KATAKANA */
-#ifdef XK_ARABIC
-	if (k == XK_Arabic_comma) return "Arabic_comma";
-	if (k == XK_Arabic_semicolon) return "Arabic_semicolon";
-	if (k == XK_Arabic_question_mark) return "Arabic_question_mark";
-	if (k == XK_Arabic_hamza) return "Arabic_hamza";
-	if (k == XK_Arabic_maddaonalef) return "Arabic_maddaonalef";
-	if (k == XK_Arabic_hamzaonalef) return "Arabic_hamzaonalef";
-	if (k == XK_Arabic_hamzaonwaw) return "Arabic_hamzaonwaw";
-	if (k == XK_Arabic_hamzaunderalef) return "Arabic_hamzaunderalef";
-	if (k == XK_Arabic_hamzaonyeh) return "Arabic_hamzaonyeh";
-	if (k == XK_Arabic_alef) return "Arabic_alef";
-	if (k == XK_Arabic_beh) return "Arabic_beh";
-	if (k == XK_Arabic_tehmarbuta) return "Arabic_tehmarbuta";
-	if (k == XK_Arabic_teh) return "Arabic_teh";
-	if (k == XK_Arabic_theh) return "Arabic_theh";
-	if (k == XK_Arabic_jeem) return "Arabic_jeem";
-	if (k == XK_Arabic_hah) return "Arabic_hah";
-	if (k == XK_Arabic_khah) return "Arabic_khah";
-	if (k == XK_Arabic_dal) return "Arabic_dal";
-	if (k == XK_Arabic_thal) return "Arabic_thal";
-	if (k == XK_Arabic_ra) return "Arabic_ra";
-	if (k == XK_Arabic_zain) return "Arabic_zain";
-	if (k == XK_Arabic_seen) return "Arabic_seen";
-	if (k == XK_Arabic_sheen) return "Arabic_sheen";
-	if (k == XK_Arabic_sad) return "Arabic_sad";
-	if (k == XK_Arabic_dad) return "Arabic_dad";
-	if (k == XK_Arabic_tah) return "Arabic_tah";
-	if (k == XK_Arabic_zah) return "Arabic_zah";
-	if (k == XK_Arabic_ain) return "Arabic_ain";
-	if (k == XK_Arabic_ghain) return "Arabic_ghain";
-	if (k == XK_Arabic_tatweel) return "Arabic_tatweel";
-	if (k == XK_Arabic_feh) return "Arabic_feh";
-	if (k == XK_Arabic_qaf) return "Arabic_qaf";
-	if (k == XK_Arabic_kaf) return "Arabic_kaf";
-	if (k == XK_Arabic_lam) return "Arabic_lam";
-	if (k == XK_Arabic_meem) return "Arabic_meem";
-	if (k == XK_Arabic_noon) return "Arabic_noon";
-	if (k == XK_Arabic_ha) return "Arabic_ha";
-	if (k == XK_Arabic_heh) return "Arabic_heh";
-	if (k == XK_Arabic_waw) return "Arabic_waw";
-	if (k == XK_Arabic_alefmaksura) return "Arabic_alefmaksura";
-	if (k == XK_Arabic_yeh) return "Arabic_yeh";
-	if (k == XK_Arabic_fathatan) return "Arabic_fathatan";
-	if (k == XK_Arabic_dammatan) return "Arabic_dammatan";
-	if (k == XK_Arabic_kasratan) return "Arabic_kasratan";
-	if (k == XK_Arabic_fatha) return "Arabic_fatha";
-	if (k == XK_Arabic_damma) return "Arabic_damma";
-	if (k == XK_Arabic_kasra) return "Arabic_kasra";
-	if (k == XK_Arabic_shadda) return "Arabic_shadda";
-	if (k == XK_Arabic_sukun) return "Arabic_sukun";
-	if (k == XK_Arabic_switch) return "Arabic_switch";
-#endif /* XK_ARABIC */
-#ifdef XK_CYRILLIC
-	if (k == XK_Serbian_dje) return "Serbian_dje";
-	if (k == XK_Macedonia_gje) return "Macedonia_gje";
-	if (k == XK_Cyrillic_io) return "Cyrillic_io";
-	if (k == XK_Ukrainian_ie) return "Ukrainian_ie";
-	if (k == XK_Ukranian_je) return "Ukranian_je";
-	if (k == XK_Macedonia_dse) return "Macedonia_dse";
-	if (k == XK_Ukrainian_i) return "Ukrainian_i";
-	if (k == XK_Ukranian_i) return "Ukranian_i";
-	if (k == XK_Ukrainian_yi) return "Ukrainian_yi";
-	if (k == XK_Ukranian_yi) return "Ukranian_yi";
-	if (k == XK_Cyrillic_je) return "Cyrillic_je";
-	if (k == XK_Serbian_je) return "Serbian_je";
-	if (k == XK_Cyrillic_lje) return "Cyrillic_lje";
-	if (k == XK_Serbian_lje) return "Serbian_lje";
-	if (k == XK_Cyrillic_nje) return "Cyrillic_nje";
-	if (k == XK_Serbian_nje) return "Serbian_nje";
-	if (k == XK_Serbian_tshe) return "Serbian_tshe";
-	if (k == XK_Macedonia_kje) return "Macedonia_kje";
-	if (k == XK_Byelorussian_shortu) return "Byelorussian_shortu";
-	if (k == XK_Cyrillic_dzhe) return "Cyrillic_dzhe";
-	if (k == XK_Serbian_dze) return "Serbian_dze";
-	if (k == XK_numerosign) return "numerosign";
-	if (k == XK_Serbian_DJE) return "Serbian_DJE";
-	if (k == XK_Macedonia_GJE) return "Macedonia_GJE";
-	if (k == XK_Cyrillic_IO) return "Cyrillic_IO";
-	if (k == XK_Ukrainian_IE) return "Ukrainian_IE";
-	if (k == XK_Ukranian_JE) return "Ukranian_JE";
-	if (k == XK_Macedonia_DSE) return "Macedonia_DSE";
-	if (k == XK_Ukrainian_I) return "Ukrainian_I";
-	if (k == XK_Ukranian_I) return "Ukranian_I";
-	if (k == XK_Ukrainian_YI) return "Ukrainian_YI";
-	if (k == XK_Ukranian_YI) return "Ukranian_YI";
-	if (k == XK_Cyrillic_JE) return "Cyrillic_JE";
-	if (k == XK_Serbian_JE) return "Serbian_JE";
-	if (k == XK_Cyrillic_LJE) return "Cyrillic_LJE";
-	if (k == XK_Serbian_LJE) return "Serbian_LJE";
-	if (k == XK_Cyrillic_NJE) return "Cyrillic_NJE";
-	if (k == XK_Serbian_NJE) return "Serbian_NJE";
-	if (k == XK_Serbian_TSHE) return "Serbian_TSHE";
-	if (k == XK_Macedonia_KJE) return "Macedonia_KJE";
-	if (k == XK_Byelorussian_SHORTU) return "Byelorussian_SHORTU";
-	if (k == XK_Cyrillic_DZHE) return "Cyrillic_DZHE";
-	if (k == XK_Serbian_DZE) return "Serbian_DZE";
-	if (k == XK_Cyrillic_yu) return "Cyrillic_yu";
-	if (k == XK_Cyrillic_a) return "Cyrillic_a";
-	if (k == XK_Cyrillic_be) return "Cyrillic_be";
-	if (k == XK_Cyrillic_tse) return "Cyrillic_tse";
-	if (k == XK_Cyrillic_de) return "Cyrillic_de";
-	if (k == XK_Cyrillic_ie) return "Cyrillic_ie";
-	if (k == XK_Cyrillic_ef) return "Cyrillic_ef";
-	if (k == XK_Cyrillic_ghe) return "Cyrillic_ghe";
-	if (k == XK_Cyrillic_ha) return "Cyrillic_ha";
-	if (k == XK_Cyrillic_i) return "Cyrillic_i";
-	if (k == XK_Cyrillic_shorti) return "Cyrillic_shorti";
-	if (k == XK_Cyrillic_ka) return "Cyrillic_ka";
-	if (k == XK_Cyrillic_el) return "Cyrillic_el";
-	if (k == XK_Cyrillic_em) return "Cyrillic_em";
-	if (k == XK_Cyrillic_en) return "Cyrillic_en";
-	if (k == XK_Cyrillic_o) return "Cyrillic_o";
-	if (k == XK_Cyrillic_pe) return "Cyrillic_pe";
-	if (k == XK_Cyrillic_ya) return "Cyrillic_ya";
-	if (k == XK_Cyrillic_er) return "Cyrillic_er";
-	if (k == XK_Cyrillic_es) return "Cyrillic_es";
-	if (k == XK_Cyrillic_te) return "Cyrillic_te";
-	if (k == XK_Cyrillic_u) return "Cyrillic_u";
-	if (k == XK_Cyrillic_zhe) return "Cyrillic_zhe";
-	if (k == XK_Cyrillic_ve) return "Cyrillic_ve";
-	if (k == XK_Cyrillic_softsign) return "Cyrillic_softsign";
-	if (k == XK_Cyrillic_yeru) return "Cyrillic_yeru";
-	if (k == XK_Cyrillic_ze) return "Cyrillic_ze";
-	if (k == XK_Cyrillic_sha) return "Cyrillic_sha";
-	if (k == XK_Cyrillic_e) return "Cyrillic_e";
-	if (k == XK_Cyrillic_shcha) return "Cyrillic_shcha";
-	if (k == XK_Cyrillic_che) return "Cyrillic_che";
-	if (k == XK_Cyrillic_hardsign) return "Cyrillic_hardsign";
-	if (k == XK_Cyrillic_YU) return "Cyrillic_YU";
-	if (k == XK_Cyrillic_A) return "Cyrillic_A";
-	if (k == XK_Cyrillic_BE) return "Cyrillic_BE";
-	if (k == XK_Cyrillic_TSE) return "Cyrillic_TSE";
-	if (k == XK_Cyrillic_DE) return "Cyrillic_DE";
-	if (k == XK_Cyrillic_IE) return "Cyrillic_IE";
-	if (k == XK_Cyrillic_EF) return "Cyrillic_EF";
-	if (k == XK_Cyrillic_GHE) return "Cyrillic_GHE";
-	if (k == XK_Cyrillic_HA) return "Cyrillic_HA";
-	if (k == XK_Cyrillic_I) return "Cyrillic_I";
-	if (k == XK_Cyrillic_SHORTI) return "Cyrillic_SHORTI";
-	if (k == XK_Cyrillic_KA) return "Cyrillic_KA";
-	if (k == XK_Cyrillic_EL) return "Cyrillic_EL";
-	if (k == XK_Cyrillic_EM) return "Cyrillic_EM";
-	if (k == XK_Cyrillic_EN) return "Cyrillic_EN";
-	if (k == XK_Cyrillic_O) return "Cyrillic_O";
-	if (k == XK_Cyrillic_PE) return "Cyrillic_PE";
-	if (k == XK_Cyrillic_YA) return "Cyrillic_YA";
-	if (k == XK_Cyrillic_ER) return "Cyrillic_ER";
-	if (k == XK_Cyrillic_ES) return "Cyrillic_ES";
-	if (k == XK_Cyrillic_TE) return "Cyrillic_TE";
-	if (k == XK_Cyrillic_U) return "Cyrillic_U";
-	if (k == XK_Cyrillic_ZHE) return "Cyrillic_ZHE";
-	if (k == XK_Cyrillic_VE) return "Cyrillic_VE";
-	if (k == XK_Cyrillic_SOFTSIGN) return "Cyrillic_SOFTSIGN";
-	if (k == XK_Cyrillic_YERU) return "Cyrillic_YERU";
-	if (k == XK_Cyrillic_ZE) return "Cyrillic_ZE";
-	if (k == XK_Cyrillic_SHA) return "Cyrillic_SHA";
-	if (k == XK_Cyrillic_E) return "Cyrillic_E";
-	if (k == XK_Cyrillic_SHCHA) return "Cyrillic_SHCHA";
-	if (k == XK_Cyrillic_CHE) return "Cyrillic_CHE";
-	if (k == XK_Cyrillic_HARDSIGN) return "Cyrillic_HARDSIGN";
-#endif /* XK_CYRILLIC */
-#ifdef XK_GREEK
-	if (k == XK_Greek_ALPHAaccent) return "Greek_ALPHAaccent";
-	if (k == XK_Greek_EPSILONaccent) return "Greek_EPSILONaccent";
-	if (k == XK_Greek_ETAaccent) return "Greek_ETAaccent";
-	if (k == XK_Greek_IOTAaccent) return "Greek_IOTAaccent";
-	if (k == XK_Greek_IOTAdieresis) return "Greek_IOTAdieresis";
-	if (k == XK_Greek_OMICRONaccent) return "Greek_OMICRONaccent";
-	if (k == XK_Greek_UPSILONaccent) return "Greek_UPSILONaccent";
-	if (k == XK_Greek_UPSILONdieresis) return "Greek_UPSILONdieresis";
-	if (k == XK_Greek_OMEGAaccent) return "Greek_OMEGAaccent";
-	if (k == XK_Greek_accentdieresis) return "Greek_accentdieresis";
-	if (k == XK_Greek_horizbar) return "Greek_horizbar";
-	if (k == XK_Greek_alphaaccent) return "Greek_alphaaccent";
-	if (k == XK_Greek_epsilonaccent) return "Greek_epsilonaccent";
-	if (k == XK_Greek_etaaccent) return "Greek_etaaccent";
-	if (k == XK_Greek_iotaaccent) return "Greek_iotaaccent";
-	if (k == XK_Greek_iotadieresis) return "Greek_iotadieresis";
-	if (k == XK_Greek_iotaaccentdieresis) return "Greek_iotaaccentdieresis";
-	if (k == XK_Greek_omicronaccent) return "Greek_omicronaccent";
-	if (k == XK_Greek_upsilonaccent) return "Greek_upsilonaccent";
-	if (k == XK_Greek_upsilondieresis) return "Greek_upsilondieresis";
-	if (k == XK_Greek_upsilonaccentdieresis) return "Greek_upsilonaccentdieresis";
-	if (k == XK_Greek_omegaaccent) return "Greek_omegaaccent";
-	if (k == XK_Greek_ALPHA) return "Greek_ALPHA";
-	if (k == XK_Greek_BETA) return "Greek_BETA";
-	if (k == XK_Greek_GAMMA) return "Greek_GAMMA";
-	if (k == XK_Greek_DELTA) return "Greek_DELTA";
-	if (k == XK_Greek_EPSILON) return "Greek_EPSILON";
-	if (k == XK_Greek_ZETA) return "Greek_ZETA";
-	if (k == XK_Greek_ETA) return "Greek_ETA";
-	if (k == XK_Greek_THETA) return "Greek_THETA";
-	if (k == XK_Greek_IOTA) return "Greek_IOTA";
-	if (k == XK_Greek_KAPPA) return "Greek_KAPPA";
-	if (k == XK_Greek_LAMDA) return "Greek_LAMDA";
-	if (k == XK_Greek_LAMBDA) return "Greek_LAMBDA";
-	if (k == XK_Greek_MU) return "Greek_MU";
-	if (k == XK_Greek_NU) return "Greek_NU";
-	if (k == XK_Greek_XI) return "Greek_XI";
-	if (k == XK_Greek_OMICRON) return "Greek_OMICRON";
-	if (k == XK_Greek_PI) return "Greek_PI";
-	if (k == XK_Greek_RHO) return "Greek_RHO";
-	if (k == XK_Greek_SIGMA) return "Greek_SIGMA";
-	if (k == XK_Greek_TAU) return "Greek_TAU";
-	if (k == XK_Greek_UPSILON) return "Greek_UPSILON";
-	if (k == XK_Greek_PHI) return "Greek_PHI";
-	if (k == XK_Greek_CHI) return "Greek_CHI";
-	if (k == XK_Greek_PSI) return "Greek_PSI";
-	if (k == XK_Greek_OMEGA) return "Greek_OMEGA";
-	if (k == XK_Greek_alpha) return "Greek_alpha";
-	if (k == XK_Greek_beta) return "Greek_beta";
-	if (k == XK_Greek_gamma) return "Greek_gamma";
-	if (k == XK_Greek_delta) return "Greek_delta";
-	if (k == XK_Greek_epsilon) return "Greek_epsilon";
-	if (k == XK_Greek_zeta) return "Greek_zeta";
-	if (k == XK_Greek_eta) return "Greek_eta";
-	if (k == XK_Greek_theta) return "Greek_theta";
-	if (k == XK_Greek_iota) return "Greek_iota";
-	if (k == XK_Greek_kappa) return "Greek_kappa";
-	if (k == XK_Greek_lamda) return "Greek_lamda";
-	if (k == XK_Greek_lambda) return "Greek_lambda";
-	if (k == XK_Greek_mu) return "Greek_mu";
-	if (k == XK_Greek_nu) return "Greek_nu";
-	if (k == XK_Greek_xi) return "Greek_xi";
-	if (k == XK_Greek_omicron) return "Greek_omicron";
-	if (k == XK_Greek_pi) return "Greek_pi";
-	if (k == XK_Greek_rho) return "Greek_rho";
-	if (k == XK_Greek_sigma) return "Greek_sigma";
-	if (k == XK_Greek_finalsmallsigma) return "Greek_finalsmallsigma";
-	if (k == XK_Greek_tau) return "Greek_tau";
-	if (k == XK_Greek_upsilon) return "Greek_upsilon";
-	if (k == XK_Greek_phi) return "Greek_phi";
-	if (k == XK_Greek_chi) return "Greek_chi";
-	if (k == XK_Greek_psi) return "Greek_psi";
-	if (k == XK_Greek_omega) return "Greek_omega";
-	if (k == XK_Greek_switch) return "Greek_switch";
-#endif /* XK_GREEK */
-#ifdef XK_TECHNICAL
-	if (k == XK_leftradical) return "leftradical";
-	if (k == XK_topleftradical) return "topleftradical";
-	if (k == XK_horizconnector) return "horizconnector";
-	if (k == XK_topintegral) return "topintegral";
-	if (k == XK_botintegral) return "botintegral";
-	if (k == XK_vertconnector) return "vertconnector";
-	if (k == XK_topleftsqbracket) return "topleftsqbracket";
-	if (k == XK_botleftsqbracket) return "botleftsqbracket";
-	if (k == XK_toprightsqbracket) return "toprightsqbracket";
-	if (k == XK_botrightsqbracket) return "botrightsqbracket";
-	if (k == XK_topleftparens) return "topleftparens";
-	if (k == XK_botleftparens) return "botleftparens";
-	if (k == XK_toprightparens) return "toprightparens";
-	if (k == XK_botrightparens) return "botrightparens";
-	if (k == XK_leftmiddlecurlybrace) return "leftmiddlecurlybrace";
-	if (k == XK_rightmiddlecurlybrace) return "rightmiddlecurlybrace";
-	if (k == XK_topleftsummation) return "topleftsummation";
-	if (k == XK_botleftsummation) return "botleftsummation";
-	if (k == XK_topvertsummationconnector) return "topvertsummationconnector";
-	if (k == XK_botvertsummationconnector) return "botvertsummationconnector";
-	if (k == XK_toprightsummation) return "toprightsummation";
-	if (k == XK_botrightsummation) return "botrightsummation";
-	if (k == XK_rightmiddlesummation) return "rightmiddlesummation";
-	if (k == XK_lessthanequal) return "lessthanequal";
-	if (k == XK_notequal) return "notequal";
-	if (k == XK_greaterthanequal) return "greaterthanequal";
-	if (k == XK_integral) return "integral";
-	if (k == XK_therefore) return "therefore";
-	if (k == XK_variation) return "variation";
-	if (k == XK_infinity) return "infinity";
-	if (k == XK_nabla) return "nabla";
-	if (k == XK_approximate) return "approximate";
-	if (k == XK_similarequal) return "similarequal";
-	if (k == XK_ifonlyif) return "ifonlyif";
-	if (k == XK_implies) return "implies";
-	if (k == XK_identical) return "identical";
-	if (k == XK_radical) return "radical";
-	if (k == XK_includedin) return "includedin";
-	if (k == XK_includes) return "includes";
-	if (k == XK_intersection) return "intersection";
-	if (k == XK_union) return "union";
-	if (k == XK_logicaland) return "logicaland";
-	if (k == XK_logicalor) return "logicalor";
-	if (k == XK_partialderivative) return "partialderivative";
-	if (k == XK_function) return "function";
-	if (k == XK_leftarrow) return "leftarrow";
-	if (k == XK_uparrow) return "uparrow";
-	if (k == XK_rightarrow) return "rightarrow";
-	if (k == XK_downarrow) return "downarrow";
-#endif /* XK_TECHNICAL */
-#ifdef XK_SPECIAL
-	if (k == XK_blank) return "blank";
-	if (k == XK_soliddiamond) return "soliddiamond";
-	if (k == XK_checkerboard) return "checkerboard";
-	if (k == XK_ht) return "ht";
-	if (k == XK_ff) return "ff";
-	if (k == XK_cr) return "cr";
-	if (k == XK_lf) return "lf";
-	if (k == XK_nl) return "nl";
-	if (k == XK_vt) return "vt";
-	if (k == XK_lowrightcorner) return "lowrightcorner";
-	if (k == XK_uprightcorner) return "uprightcorner";
-	if (k == XK_upleftcorner) return "upleftcorner";
-	if (k == XK_lowleftcorner) return "lowleftcorner";
-	if (k == XK_crossinglines) return "crossinglines";
-	if (k == XK_horizlinescan1) return "horizlinescan1";
-	if (k == XK_horizlinescan3) return "horizlinescan3";
-	if (k == XK_horizlinescan5) return "horizlinescan5";
-	if (k == XK_horizlinescan7) return "horizlinescan7";
-	if (k == XK_horizlinescan9) return "horizlinescan9";
-	if (k == XK_leftt) return "leftt";
-	if (k == XK_rightt) return "rightt";
-	if (k == XK_bott) return "bott";
-	if (k == XK_topt) return "topt";
-	if (k == XK_vertbar) return "vertbar";
-#endif /* XK_SPECIAL */
-#ifdef XK_PUBLISHING
-	if (k == XK_emspace) return "emspace";
-	if (k == XK_enspace) return "enspace";
-	if (k == XK_em3space) return "em3space";
-	if (k == XK_em4space) return "em4space";
-	if (k == XK_digitspace) return "digitspace";
-	if (k == XK_punctspace) return "punctspace";
-	if (k == XK_thinspace) return "thinspace";
-	if (k == XK_hairspace) return "hairspace";
-	if (k == XK_emdash) return "emdash";
-	if (k == XK_endash) return "endash";
-	if (k == XK_signifblank) return "signifblank";
-	if (k == XK_ellipsis) return "ellipsis";
-	if (k == XK_doubbaselinedot) return "doubbaselinedot";
-	if (k == XK_onethird) return "onethird";
-	if (k == XK_twothirds) return "twothirds";
-	if (k == XK_onefifth) return "onefifth";
-	if (k == XK_twofifths) return "twofifths";
-	if (k == XK_threefifths) return "threefifths";
-	if (k == XK_fourfifths) return "fourfifths";
-	if (k == XK_onesixth) return "onesixth";
-	if (k == XK_fivesixths) return "fivesixths";
-	if (k == XK_careof) return "careof";
-	if (k == XK_figdash) return "figdash";
-	if (k == XK_leftanglebracket) return "leftanglebracket";
-	if (k == XK_decimalpoint) return "decimalpoint";
-	if (k == XK_rightanglebracket) return "rightanglebracket";
-	if (k == XK_marker) return "marker";
-	if (k == XK_oneeighth) return "oneeighth";
-	if (k == XK_threeeighths) return "threeeighths";
-	if (k == XK_fiveeighths) return "fiveeighths";
-	if (k == XK_seveneighths) return "seveneighths";
-	if (k == XK_trademark) return "trademark";
-	if (k == XK_signaturemark) return "signaturemark";
-	if (k == XK_trademarkincircle) return "trademarkincircle";
-	if (k == XK_leftopentriangle) return "leftopentriangle";
-	if (k == XK_rightopentriangle) return "rightopentriangle";
-	if (k == XK_emopencircle) return "emopencircle";
-	if (k == XK_emopenrectangle) return "emopenrectangle";
-	if (k == XK_leftsinglequotemark) return "leftsinglequotemark";
-	if (k == XK_rightsinglequotemark) return "rightsinglequotemark";
-	if (k == XK_leftdoublequotemark) return "leftdoublequotemark";
-	if (k == XK_rightdoublequotemark) return "rightdoublequotemark";
-	if (k == XK_prescription) return "prescription";
-	if (k == XK_minutes) return "minutes";
-	if (k == XK_seconds) return "seconds";
-	if (k == XK_latincross) return "latincross";
-	if (k == XK_hexagram) return "hexagram";
-	if (k == XK_filledrectbullet) return "filledrectbullet";
-	if (k == XK_filledlefttribullet) return "filledlefttribullet";
-	if (k == XK_filledrighttribullet) return "filledrighttribullet";
-	if (k == XK_emfilledcircle) return "emfilledcircle";
-	if (k == XK_emfilledrect) return "emfilledrect";
-	if (k == XK_enopencircbullet) return "enopencircbullet";
-	if (k == XK_enopensquarebullet) return "enopensquarebullet";
-	if (k == XK_openrectbullet) return "openrectbullet";
-	if (k == XK_opentribulletup) return "opentribulletup";
-	if (k == XK_opentribulletdown) return "opentribulletdown";
-	if (k == XK_openstar) return "openstar";
-	if (k == XK_enfilledcircbullet) return "enfilledcircbullet";
-	if (k == XK_enfilledsqbullet) return "enfilledsqbullet";
-	if (k == XK_filledtribulletup) return "filledtribulletup";
-	if (k == XK_filledtribulletdown) return "filledtribulletdown";
-	if (k == XK_leftpointer) return "leftpointer";
-	if (k == XK_rightpointer) return "rightpointer";
-	if (k == XK_club) return "club";
-	if (k == XK_diamond) return "diamond";
-	if (k == XK_heart) return "heart";
-	if (k == XK_maltesecross) return "maltesecross";
-	if (k == XK_dagger) return "dagger";
-	if (k == XK_doubledagger) return "doubledagger";
-	if (k == XK_checkmark) return "checkmark";
-	if (k == XK_ballotcross) return "ballotcross";
-	if (k == XK_musicalsharp) return "musicalsharp";
-	if (k == XK_musicalflat) return "musicalflat";
-	if (k == XK_malesymbol) return "malesymbol";
-	if (k == XK_femalesymbol) return "femalesymbol";
-	if (k == XK_telephone) return "telephone";
-	if (k == XK_telephonerecorder) return "telephonerecorder";
-	if (k == XK_phonographcopyright) return "phonographcopyright";
-	if (k == XK_caret) return "caret";
-	if (k == XK_singlelowquotemark) return "singlelowquotemark";
-	if (k == XK_doublelowquotemark) return "doublelowquotemark";
-	if (k == XK_cursor) return "cursor";
-#endif /* XK_PUBLISHING */
-#ifdef XK_APL
-	if (k == XK_leftcaret) return "leftcaret";
-	if (k == XK_rightcaret) return "rightcaret";
-	if (k == XK_downcaret) return "downcaret";
-	if (k == XK_upcaret) return "upcaret";
-	if (k == XK_overbar) return "overbar";
-	if (k == XK_downtack) return "downtack";
-	if (k == XK_upshoe) return "upshoe";
-	if (k == XK_downstile) return "downstile";
-	if (k == XK_underbar) return "underbar";
-	if (k == XK_jot) return "jot";
-	if (k == XK_quad) return "quad";
-	if (k == XK_uptack) return "uptack";
-	if (k == XK_circle) return "circle";
-	if (k == XK_upstile) return "upstile";
-	if (k == XK_downshoe) return "downshoe";
-	if (k == XK_rightshoe) return "rightshoe";
-	if (k == XK_leftshoe) return "leftshoe";
-	if (k == XK_lefttack) return "lefttack";
-	if (k == XK_righttack) return "righttack";
-#endif /* XK_APL */
-#ifdef XK_HEBREW
-	if (k == XK_hebrew_doublelowline) return "hebrew_doublelowline";
-	if (k == XK_hebrew_aleph) return "hebrew_aleph";
-	if (k == XK_hebrew_bet) return "hebrew_bet";
-	if (k == XK_hebrew_beth) return "hebrew_beth";
-	if (k == XK_hebrew_gimel) return "hebrew_gimel";
-	if (k == XK_hebrew_gimmel) return "hebrew_gimmel";
-	if (k == XK_hebrew_dalet) return "hebrew_dalet";
-	if (k == XK_hebrew_daleth) return "hebrew_daleth";
-	if (k == XK_hebrew_he) return "hebrew_he";
-	if (k == XK_hebrew_waw) return "hebrew_waw";
-	if (k == XK_hebrew_zain) return "hebrew_zain";
-	if (k == XK_hebrew_zayin) return "hebrew_zayin";
-	if (k == XK_hebrew_chet) return "hebrew_chet";
-	if (k == XK_hebrew_het) return "hebrew_het";
-	if (k == XK_hebrew_tet) return "hebrew_tet";
-	if (k == XK_hebrew_teth) return "hebrew_teth";
-	if (k == XK_hebrew_yod) return "hebrew_yod";
-	if (k == XK_hebrew_finalkaph) return "hebrew_finalkaph";
-	if (k == XK_hebrew_kaph) return "hebrew_kaph";
-	if (k == XK_hebrew_lamed) return "hebrew_lamed";
-	if (k == XK_hebrew_finalmem) return "hebrew_finalmem";
-	if (k == XK_hebrew_mem) return "hebrew_mem";
-	if (k == XK_hebrew_finalnun) return "hebrew_finalnun";
-	if (k == XK_hebrew_nun) return "hebrew_nun";
-	if (k == XK_hebrew_samech) return "hebrew_samech";
-	if (k == XK_hebrew_samekh) return "hebrew_samekh";
-	if (k == XK_hebrew_ayin) return "hebrew_ayin";
-	if (k == XK_hebrew_finalpe) return "hebrew_finalpe";
-	if (k == XK_hebrew_pe) return "hebrew_pe";
-	if (k == XK_hebrew_finalzade) return "hebrew_finalzade";
-	if (k == XK_hebrew_finalzadi) return "hebrew_finalzadi";
-	if (k == XK_hebrew_zade) return "hebrew_zade";
-	if (k == XK_hebrew_zadi) return "hebrew_zadi";
-	if (k == XK_hebrew_qoph) return "hebrew_qoph";
-	if (k == XK_hebrew_kuf) return "hebrew_kuf";
-	if (k == XK_hebrew_resh) return "hebrew_resh";
-	if (k == XK_hebrew_shin) return "hebrew_shin";
-	if (k == XK_hebrew_taw) return "hebrew_taw";
-	if (k == XK_hebrew_taf) return "hebrew_taf";
-	if (k == XK_Hebrew_switch) return "Hebrew_switch";
-#endif /* XK_HEBREW */
-#ifdef XK_THAI
-	if (k == XK_Thai_kokai) return "Thai_kokai";
-	if (k == XK_Thai_khokhai) return "Thai_khokhai";
-	if (k == XK_Thai_khokhuat) return "Thai_khokhuat";
-	if (k == XK_Thai_khokhwai) return "Thai_khokhwai";
-	if (k == XK_Thai_khokhon) return "Thai_khokhon";
-	if (k == XK_Thai_khorakhang) return "Thai_khorakhang";
-	if (k == XK_Thai_ngongu) return "Thai_ngongu";
-	if (k == XK_Thai_chochan) return "Thai_chochan";
-	if (k == XK_Thai_choching) return "Thai_choching";
-	if (k == XK_Thai_chochang) return "Thai_chochang";
-	if (k == XK_Thai_soso) return "Thai_soso";
-	if (k == XK_Thai_chochoe) return "Thai_chochoe";
-	if (k == XK_Thai_yoying) return "Thai_yoying";
-	if (k == XK_Thai_dochada) return "Thai_dochada";
-	if (k == XK_Thai_topatak) return "Thai_topatak";
-	if (k == XK_Thai_thothan) return "Thai_thothan";
-	if (k == XK_Thai_thonangmontho) return "Thai_thonangmontho";
-	if (k == XK_Thai_thophuthao) return "Thai_thophuthao";
-	if (k == XK_Thai_nonen) return "Thai_nonen";
-	if (k == XK_Thai_dodek) return "Thai_dodek";
-	if (k == XK_Thai_totao) return "Thai_totao";
-	if (k == XK_Thai_thothung) return "Thai_thothung";
-	if (k == XK_Thai_thothahan) return "Thai_thothahan";
-	if (k == XK_Thai_thothong) return "Thai_thothong";
-	if (k == XK_Thai_nonu) return "Thai_nonu";
-	if (k == XK_Thai_bobaimai) return "Thai_bobaimai";
-	if (k == XK_Thai_popla) return "Thai_popla";
-	if (k == XK_Thai_phophung) return "Thai_phophung";
-	if (k == XK_Thai_fofa) return "Thai_fofa";
-	if (k == XK_Thai_phophan) return "Thai_phophan";
-	if (k == XK_Thai_fofan) return "Thai_fofan";
-	if (k == XK_Thai_phosamphao) return "Thai_phosamphao";
-	if (k == XK_Thai_moma) return "Thai_moma";
-	if (k == XK_Thai_yoyak) return "Thai_yoyak";
-	if (k == XK_Thai_rorua) return "Thai_rorua";
-	if (k == XK_Thai_ru) return "Thai_ru";
-	if (k == XK_Thai_loling) return "Thai_loling";
-	if (k == XK_Thai_lu) return "Thai_lu";
-	if (k == XK_Thai_wowaen) return "Thai_wowaen";
-	if (k == XK_Thai_sosala) return "Thai_sosala";
-	if (k == XK_Thai_sorusi) return "Thai_sorusi";
-	if (k == XK_Thai_sosua) return "Thai_sosua";
-	if (k == XK_Thai_hohip) return "Thai_hohip";
-	if (k == XK_Thai_lochula) return "Thai_lochula";
-	if (k == XK_Thai_oang) return "Thai_oang";
-	if (k == XK_Thai_honokhuk) return "Thai_honokhuk";
-	if (k == XK_Thai_paiyannoi) return "Thai_paiyannoi";
-	if (k == XK_Thai_saraa) return "Thai_saraa";
-	if (k == XK_Thai_maihanakat) return "Thai_maihanakat";
-	if (k == XK_Thai_saraaa) return "Thai_saraaa";
-	if (k == XK_Thai_saraam) return "Thai_saraam";
-	if (k == XK_Thai_sarai) return "Thai_sarai";
-	if (k == XK_Thai_saraii) return "Thai_saraii";
-	if (k == XK_Thai_saraue) return "Thai_saraue";
-	if (k == XK_Thai_sarauee) return "Thai_sarauee";
-	if (k == XK_Thai_sarau) return "Thai_sarau";
-	if (k == XK_Thai_sarauu) return "Thai_sarauu";
-	if (k == XK_Thai_phinthu) return "Thai_phinthu";
-	if (k == XK_Thai_maihanakat_maitho) return "Thai_maihanakat_maitho";
-	if (k == XK_Thai_baht) return "Thai_baht";
-	if (k == XK_Thai_sarae) return "Thai_sarae";
-	if (k == XK_Thai_saraae) return "Thai_saraae";
-	if (k == XK_Thai_sarao) return "Thai_sarao";
-	if (k == XK_Thai_saraaimaimuan) return "Thai_saraaimaimuan";
-	if (k == XK_Thai_saraaimaimalai) return "Thai_saraaimaimalai";
-	if (k == XK_Thai_lakkhangyao) return "Thai_lakkhangyao";
-	if (k == XK_Thai_maiyamok) return "Thai_maiyamok";
-	if (k == XK_Thai_maitaikhu) return "Thai_maitaikhu";
-	if (k == XK_Thai_maiek) return "Thai_maiek";
-	if (k == XK_Thai_maitho) return "Thai_maitho";
-	if (k == XK_Thai_maitri) return "Thai_maitri";
-	if (k == XK_Thai_maichattawa) return "Thai_maichattawa";
-	if (k == XK_Thai_thanthakhat) return "Thai_thanthakhat";
-	if (k == XK_Thai_nikhahit) return "Thai_nikhahit";
-	if (k == XK_Thai_leksun) return "Thai_leksun";
-	if (k == XK_Thai_leknung) return "Thai_leknung";
-	if (k == XK_Thai_leksong) return "Thai_leksong";
-	if (k == XK_Thai_leksam) return "Thai_leksam";
-	if (k == XK_Thai_leksi) return "Thai_leksi";
-	if (k == XK_Thai_lekha) return "Thai_lekha";
-	if (k == XK_Thai_lekhok) return "Thai_lekhok";
-	if (k == XK_Thai_lekchet) return "Thai_lekchet";
-	if (k == XK_Thai_lekpaet) return "Thai_lekpaet";
-	if (k == XK_Thai_lekkao) return "Thai_lekkao";
-#endif /* XK_THAI */
-#ifdef XK_KOREAN
-	if (k == XK_Hangul) return "Hangul";
-	if (k == XK_Hangul_Start) return "Hangul_Start";
-	if (k == XK_Hangul_End) return "Hangul_End";
-	if (k == XK_Hangul_Hanja) return "Hangul_Hanja";
-	if (k == XK_Hangul_Jamo) return "Hangul_Jamo";
-	if (k == XK_Hangul_Romaja) return "Hangul_Romaja";
-	if (k == XK_Hangul_Codeinput) return "Hangul_Codeinput";
-	if (k == XK_Hangul_Jeonja) return "Hangul_Jeonja";
-	if (k == XK_Hangul_Banja) return "Hangul_Banja";
-	if (k == XK_Hangul_PreHanja) return "Hangul_PreHanja";
-	if (k == XK_Hangul_PostHanja) return "Hangul_PostHanja";
-	if (k == XK_Hangul_SingleCandidate) return "Hangul_SingleCandidate";
-	if (k == XK_Hangul_MultipleCandidate) return "Hangul_MultipleCandidate";
-	if (k == XK_Hangul_PreviousCandidate) return "Hangul_PreviousCandidate";
-	if (k == XK_Hangul_Special) return "Hangul_Special";
-	if (k == XK_Hangul_switch) return "Hangul_switch";
-	if (k == XK_Hangul_Kiyeog) return "Hangul_Kiyeog";
-	if (k == XK_Hangul_SsangKiyeog) return "Hangul_SsangKiyeog";
-	if (k == XK_Hangul_KiyeogSios) return "Hangul_KiyeogSios";
-	if (k == XK_Hangul_Nieun) return "Hangul_Nieun";
-	if (k == XK_Hangul_NieunJieuj) return "Hangul_NieunJieuj";
-	if (k == XK_Hangul_NieunHieuh) return "Hangul_NieunHieuh";
-	if (k == XK_Hangul_Dikeud) return "Hangul_Dikeud";
-	if (k == XK_Hangul_SsangDikeud) return "Hangul_SsangDikeud";
-	if (k == XK_Hangul_Rieul) return "Hangul_Rieul";
-	if (k == XK_Hangul_RieulKiyeog) return "Hangul_RieulKiyeog";
-	if (k == XK_Hangul_RieulMieum) return "Hangul_RieulMieum";
-	if (k == XK_Hangul_RieulPieub) return "Hangul_RieulPieub";
-	if (k == XK_Hangul_RieulSios) return "Hangul_RieulSios";
-	if (k == XK_Hangul_RieulTieut) return "Hangul_RieulTieut";
-	if (k == XK_Hangul_RieulPhieuf) return "Hangul_RieulPhieuf";
-	if (k == XK_Hangul_RieulHieuh) return "Hangul_RieulHieuh";
-	if (k == XK_Hangul_Mieum) return "Hangul_Mieum";
-	if (k == XK_Hangul_Pieub) return "Hangul_Pieub";
-	if (k == XK_Hangul_SsangPieub) return "Hangul_SsangPieub";
-	if (k == XK_Hangul_PieubSios) return "Hangul_PieubSios";
-	if (k == XK_Hangul_Sios) return "Hangul_Sios";
-	if (k == XK_Hangul_SsangSios) return "Hangul_SsangSios";
-	if (k == XK_Hangul_Ieung) return "Hangul_Ieung";
-	if (k == XK_Hangul_Jieuj) return "Hangul_Jieuj";
-	if (k == XK_Hangul_SsangJieuj) return "Hangul_SsangJieuj";
-	if (k == XK_Hangul_Cieuc) return "Hangul_Cieuc";
-	if (k == XK_Hangul_Khieuq) return "Hangul_Khieuq";
-	if (k == XK_Hangul_Tieut) return "Hangul_Tieut";
-	if (k == XK_Hangul_Phieuf) return "Hangul_Phieuf";
-	if (k == XK_Hangul_Hieuh) return "Hangul_Hieuh";
-	if (k == XK_Hangul_A) return "Hangul_A";
-	if (k == XK_Hangul_AE) return "Hangul_AE";
-	if (k == XK_Hangul_YA) return "Hangul_YA";
-	if (k == XK_Hangul_YAE) return "Hangul_YAE";
-	if (k == XK_Hangul_EO) return "Hangul_EO";
-	if (k == XK_Hangul_E) return "Hangul_E";
-	if (k == XK_Hangul_YEO) return "Hangul_YEO";
-	if (k == XK_Hangul_YE) return "Hangul_YE";
-	if (k == XK_Hangul_O) return "Hangul_O";
-	if (k == XK_Hangul_WA) return "Hangul_WA";
-	if (k == XK_Hangul_WAE) return "Hangul_WAE";
-	if (k == XK_Hangul_OE) return "Hangul_OE";
-	if (k == XK_Hangul_YO) return "Hangul_YO";
-	if (k == XK_Hangul_U) return "Hangul_U";
-	if (k == XK_Hangul_WEO) return "Hangul_WEO";
-	if (k == XK_Hangul_WE) return "Hangul_WE";
-	if (k == XK_Hangul_WI) return "Hangul_WI";
-	if (k == XK_Hangul_YU) return "Hangul_YU";
-	if (k == XK_Hangul_EU) return "Hangul_EU";
-	if (k == XK_Hangul_YI) return "Hangul_YI";
-	if (k == XK_Hangul_I) return "Hangul_I";
-	if (k == XK_Hangul_J_Kiyeog) return "Hangul_J_Kiyeog";
-	if (k == XK_Hangul_J_SsangKiyeog) return "Hangul_J_SsangKiyeog";
-	if (k == XK_Hangul_J_KiyeogSios) return "Hangul_J_KiyeogSios";
-	if (k == XK_Hangul_J_Nieun) return "Hangul_J_Nieun";
-	if (k == XK_Hangul_J_NieunJieuj) return "Hangul_J_NieunJieuj";
-	if (k == XK_Hangul_J_NieunHieuh) return "Hangul_J_NieunHieuh";
-	if (k == XK_Hangul_J_Dikeud) return "Hangul_J_Dikeud";
-	if (k == XK_Hangul_J_Rieul) return "Hangul_J_Rieul";
-	if (k == XK_Hangul_J_RieulKiyeog) return "Hangul_J_RieulKiyeog";
-	if (k == XK_Hangul_J_RieulMieum) return "Hangul_J_RieulMieum";
-	if (k == XK_Hangul_J_RieulPieub) return "Hangul_J_RieulPieub";
-	if (k == XK_Hangul_J_RieulSios) return "Hangul_J_RieulSios";
-	if (k == XK_Hangul_J_RieulTieut) return "Hangul_J_RieulTieut";
-	if (k == XK_Hangul_J_RieulPhieuf) return "Hangul_J_RieulPhieuf";
-	if (k == XK_Hangul_J_RieulHieuh) return "Hangul_J_RieulHieuh";
-	if (k == XK_Hangul_J_Mieum) return "Hangul_J_Mieum";
-	if (k == XK_Hangul_J_Pieub) return "Hangul_J_Pieub";
-	if (k == XK_Hangul_J_PieubSios) return "Hangul_J_PieubSios";
-	if (k == XK_Hangul_J_Sios) return "Hangul_J_Sios";
-	if (k == XK_Hangul_J_SsangSios) return "Hangul_J_SsangSios";
-	if (k == XK_Hangul_J_Ieung) return "Hangul_J_Ieung";
-	if (k == XK_Hangul_J_Jieuj) return "Hangul_J_Jieuj";
-	if (k == XK_Hangul_J_Cieuc) return "Hangul_J_Cieuc";
-	if (k == XK_Hangul_J_Khieuq) return "Hangul_J_Khieuq";
-	if (k == XK_Hangul_J_Tieut) return "Hangul_J_Tieut";
-	if (k == XK_Hangul_J_Phieuf) return "Hangul_J_Phieuf";
-	if (k == XK_Hangul_J_Hieuh) return "Hangul_J_Hieuh";
-	if (k == XK_Hangul_RieulYeorinHieuh) return "Hangul_RieulYeorinHieuh";
-	if (k == XK_Hangul_SunkyeongeumMieum) return "Hangul_SunkyeongeumMieum";
-	if (k == XK_Hangul_SunkyeongeumPieub) return "Hangul_SunkyeongeumPieub";
-	if (k == XK_Hangul_PanSios) return "Hangul_PanSios";
-	if (k == XK_Hangul_KkogjiDalrinIeung) return "Hangul_KkogjiDalrinIeung";
-	if (k == XK_Hangul_SunkyeongeumPhieuf) return "Hangul_SunkyeongeumPhieuf";
-	if (k == XK_Hangul_YeorinHieuh) return "Hangul_YeorinHieuh";
-	if (k == XK_Hangul_AraeA) return "Hangul_AraeA";
-	if (k == XK_Hangul_AraeAE) return "Hangul_AraeAE";
-	if (k == XK_Hangul_J_PanSios) return "Hangul_J_PanSios";
-	if (k == XK_Hangul_J_KkogjiDalrinIeung) return "Hangul_J_KkogjiDalrinIeung";
-	if (k == XK_Hangul_J_YeorinHieuh) return "Hangul_J_YeorinHieuh";
-	if (k == XK_Korean_Won) return "Korean_Won";
-#endif /* XK_KOREAN */
-	if (k == XK_EuroSign) return "EuroSign";
-#endif
-	return NULL;	
-}
-
-KeySym XKeycodeToKeysym(Display *display, KeyCode keycode, int index) {
-	if (!display || !keycode || !index) {}
-	return NoSymbol;
-}
-
-KeyCode XKeysymToKeycode(Display *display, KeySym keysym) {
-	if (!display || !keysym) {}
-	return NoSymbol;
-}
-
-XErrorHandler XSetErrorHandler (XErrorHandler h) {
-	return h;
-}
-
diff --git a/ica/x11/x11vnc/options.c b/ica/x11/x11vnc/options.c
deleted file mode 100644
index ab119b6..0000000
--- a/ica/x11/x11vnc/options.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- options.c -- */
-
-#define _X11VNC_OPTIONS_H
-#include "x11vnc.h"
-
-/* 
- * variables for the command line options
- */
-int debug = 0;
-
-char *use_dpy = NULL;		/* -display */
-int display_N = 0;
-int auto_port = 0;
-char *auth_file = NULL;		/* -auth/-xauth */
-char *visual_str = NULL;	/* -visual */
-int set_visual_str_to_something = 0;
-char *logfile = NULL;		/* -o, -logfile */
-int logfile_append = 0;
-char *flagfile = NULL;		/* -flag */
-char *rm_flagfile = NULL;	/* -rmflag */
-char *passwdfile = NULL;	/* -passwdfile */
-int unixpw = 0;			/* -unixpw */
-int unixpw_nis = 0;		/* -unixpw_nis */
-char *unixpw_list = NULL;
-char *unixpw_cmd = NULL;
-int unixpw_system_greeter = 0;
-int unixpw_system_greeter_active = 0;
-int use_stunnel = 0;		/* -stunnel */
-int stunnel_port = 0;
-char *stunnel_pem = NULL;
-int use_openssl = 0;
-int http_ssl = 0;
-int ssl_no_fail = 0;
-char *openssl_pem = NULL;
-char *ssl_certs_dir = NULL;
-char *enc_str = NULL;
-int vencrypt_mode = VENCRYPT_SUPPORT;
-int vencrypt_kx = VENCRYPT_BOTH;
-int vencrypt_enable_plain_login = 0;
-int anontls_mode = ANONTLS_SUPPORT;
-int create_fresh_dhparams = 0;
-char *dhparams_file = NULL;
-int http_try_it = 0;
-int stunnel_http_port = 0;
-int https_port_num = -1;
-int https_port_redir = 0;
-char *ssl_verify = NULL;
-char *ssl_crl = NULL;
-int ssl_initialized = 0;
-int ssl_timeout_secs = -1;
-char *ssh_str = NULL;
-pid_t ssh_pid = 0;
-int usepw = USEPW;
-char *blackout_str = NULL;	/* -blackout */
-int blackout_ptr = 0;
-char *clip_str = NULL;		/* -clip */
-int use_solid_bg = 0;		/* -solid */
-char *solid_str = NULL;
-char *solid_default = "cyan4";
-
-char *wmdt_str = NULL;		/* -wmdt */
-
-char *speeds_str = NULL;	/* -speeds */
-
-char *rc_rcfile = NULL;		/* -rc */
-int rc_rcfile_default = 0;
-int rc_norc = 0;
-int got_norc = 0;
-int opts_bg = 0;
-
-#ifndef VNCSHARED
-int shared = 0;			/* share vnc display. */
-#else
-int shared = 1;
-#endif
-#ifndef FOREVER
-int connect_once = 1;		/* disconnect after first connection session. */
-#else
-int connect_once = 0;
-#endif
-int got_connect_once = 0;
-int got_findauth = 0;
-int deny_all = 0;		/* global locking of new clients */
-#ifndef REMOTE_DEFAULT
-#define REMOTE_DEFAULT 1
-#endif
-int accept_remote_cmds = REMOTE_DEFAULT;	/* -noremote */
-char *remote_prefix = NULL;
-int remote_direct = 0;
-int query_default = 0;
-int safe_remote_only = 1;	/* -unsafe */
-int priv_remote = 0;		/* -privremote */
-int more_safe = 0;		/* -safer */
-#ifndef EXTERNAL_COMMANDS
-#define EXTERNAL_COMMANDS 1
-#endif
-#if EXTERNAL_COMMANDS
-int no_external_cmds = 0;	/* -nocmds */
-#else
-int no_external_cmds = 1;	/* cannot be turned back on. */
-#endif
-char *allowed_external_cmds = NULL;
-int started_as_root = 0;
-int host_lookup = 1;
-char *unix_sock = NULL;
-int unix_sock_fd = -1;
-#if X11VNC_LISTEN6
-int ipv6_listen = 1;		/* -6 / -no6 */
-int got_ipv6_listen = 1;
-#else
-int ipv6_listen = 0;		/* -6 / -no6 */
-int got_ipv6_listen = 0;
-#endif
-int ipv6_listen_fd = -1;
-int ipv6_http_fd = -1;
-int noipv6 = 0;
-int noipv4 = 0;
-char *ipv6_client_ip_str = NULL;
-char *users_list = NULL;	/* -users */
-char **user2group = NULL;
-char *allow_list = NULL;	/* for -allow and -localhost */
-char *listen_str = NULL;
-char *listen_str6 = NULL;
-char *allow_once = NULL;	/* one time -allow */
-char *accept_cmd = NULL;	/* for -accept */
-char *afteraccept_cmd = NULL;	/* for -afteraccept */
-char *gone_cmd = NULL;		/* for -gone */
-#ifndef VIEWONLY
-#define VIEWONLY 0
-#endif
-int view_only = VIEWONLY;		/* clients can only watch. */
-char *allowed_input_view_only = NULL;
-char *allowed_input_normal = NULL;
-char *allowed_input_str = NULL;
-char *viewonly_passwd = NULL;	/* view only passwd. */
-char **passwd_list = NULL;	/* for -passwdfile */
-int begin_viewonly = -1;
-int inetd = 0;			/* spawned from inetd(8) */
-#ifndef TIGHTFILEXFER
-#define TIGHTFILEXFER 0
-#endif
-int tightfilexfer = TIGHTFILEXFER; 
-int got_ultrafilexfer = 0; 
-int first_conn_timeout = 0;	/* -timeout */
-int ping_interval = 0;		/* -ping */
-int flash_cmap = 0;		/* follow installed colormaps */
-int shift_cmap = 0;		/* ncells < 256 and needs shift of pixel values */
-int force_indexed_color = 0;	/* whether to force indexed color for 8bpp */
-int advertise_truecolor = 0;
-int advertise_truecolor_reset = 0;
-int cmap8to24 = 0;		/* -8to24 */
-int xform24to32 = 0;		/* -24to32 */
-char *cmap8to24_str = NULL;
-int launch_gui = 0;		/* -gui */
-
-#ifndef AVAHI
-#define AVAHI 0
-#endif
-int avahi = AVAHI;		/* -avahi, -mdns */
-int vnc_redirect = 0;
-int vnc_redirect_sock = -1;
-
-int use_modifier_tweak = 1;	/* use the shift/altgr modifier tweak */
-int watch_capslock = 0;		/* -capslock */
-int skip_lockkeys = 0;		/* -skip_lockkeys */
-int use_iso_level3 = 0;		/* ISO_Level3_Shift instead of Mode_switch */
-int clear_mods = 0;		/* -clear_mods (1) and -clear_keys (2) -clear_locks (3) */
-int nofb = 0;			/* do not send any fb updates */
-char *raw_fb_str = NULL;	/* used under -rawfb */
-char *raw_fb_pixfmt = NULL;
-char *raw_fb_full_str = NULL;
-char *freqtab = NULL;
-char *pipeinput_str = NULL;	/* -pipeinput [tee,reopen,keycodes:]cmd */
-char *pipeinput_opts = NULL;
-FILE *pipeinput_fh = NULL;
-int pipeinput_tee = 0;
-int pipeinput_int = 0;
-int pipeinput_cons_fd = -1;
-char *pipeinput_cons_dev = NULL;
-
-int macosx_nodimming = 0;	/* Some native MacOSX server settings. */
-int macosx_nosleep = 0;
-int macosx_noscreensaver = 0;
-int macosx_wait_for_switch = 1;
-int macosx_mouse_wheel_speed = 5;
-int macosx_console = 0;
-int macosx_swap23 = 1;
-int macosx_resize = 1;
-int macosx_icon_anim_time = 450;
-int macosx_no_opengl = 0;
-int macosx_no_rawfb = 0;
-int macosx_read_opengl = 0;
-int macosx_read_rawfb = 0;
-
-unsigned long subwin = 0x0;	/* -id, -sid */
-int subwin_wait_mapped = 0;
-int freeze_when_obscured = 0;
-int subwin_obscured = 0;
-
-int debug_xevents = 0;		/* -R debug_xevents:1 */
-int debug_xdamage = 0;		/* -R debug_xdamage:1 or 2 ... */
-int debug_wireframe = 0;
-int debug_tiles = 0;
-int debug_grabs = 0;
-int debug_sel = 0;
-
-int xtrap_input = 0;		/* -xtrap for user input insertion */
-int xinerama = XINERAMA;	/* -xinerama */
-int xrandr = 0;			/* -xrandr */
-int xrandr_maybe = 1;		/* check for events, but don't trap all calls */
-char *xrandr_mode = NULL;
-char *pad_geometry = NULL;
-time_t pad_geometry_time = 0;
-int use_snapfb = 0;
-
-int use_xrecord = 0;
-int noxrecord = 0;
-
-char *client_connect = NULL;	/* strings for -connect option */
-char *client_connect_file = NULL;
-int connect_or_exit = 0;
-int vnc_connect = 1;		/* -vncconnect option */
-char *connect_proxy = NULL;
-
-int show_cursor = 1;		/* show cursor shapes */
-int show_multiple_cursors = 0;	/* show X when on root background, etc */
-char *multiple_cursors_mode = NULL;
-#ifndef CURSOR_DRAG
-#define CURSOR_DRAG 0
-#endif
-int cursor_drag_changes = CURSOR_DRAG;
-int cursor_pos_updates = 1;	/* cursor position updates -cursorpos */
-int cursor_shape_updates = 1;	/* cursor shape updates -nocursorshape */
-int use_xwarppointer = 0;	/* use XWarpPointer instead of XTestFake... */
-int always_inject = 0;		/* inject new mouse coordinates even if dx=dy=0 */
-int show_dragging = 1;		/* process mouse movement events */
-#ifndef WIREFRAME
-#define WIREFRAME 1
-#endif
-int wireframe = WIREFRAME;	/* try to emulate wireframe wm moves */
-/* shade,linewidth,percent,T+B+L+R,t1+t2+t3+t4 */
-char *wireframe_str = NULL;
-char *wireframe_copyrect = NULL;
-#ifndef WIREFRAME_COPYRECT
-#define WIREFRAME_COPYRECT 1
-#endif
-#if WIREFRAME_COPYRECT
-char *wireframe_copyrect_default = "always";
-#else
-char *wireframe_copyrect_default = "never";
-#endif
-int wireframe_in_progress = 0;
-int wireframe_local = 1;
-
-#ifndef NCACHE
-#ifdef NO_NCACHE
-#define NCACHE 0 
-#else
-#define xxNCACHE -12
-#define NCACHE -1
-#endif
-#endif
-
-#ifdef MACOSX
-int ncache = 0;
-int ncache_pad = 24;
-#else
-int ncache = NCACHE;
-int ncache_pad = 0;
-#endif
-
-#ifndef NCACHE_XROOTPMAP
-#define NCACHE_XROOTPMAP 1
-#endif
-int ncache_xrootpmap = NCACHE_XROOTPMAP;
-int ncache0 = 0;
-int ncache_default = 10;
-int ncache_copyrect = 0;
-int ncache_wf_raises = 1;
-int ncache_dt_change = 1;
-int ncache_keep_anims = 0;
-int ncache_old_wm = 0;
-int macosx_ncache_macmenu = 0;
-int macosx_us_kbd = 0;
-int ncache_beta_tester = 0;
-int ncdb = 0;
-
-Atom atom_NET_ACTIVE_WINDOW = None;
-Atom atom_NET_CURRENT_DESKTOP = None;
-Atom atom_NET_CLIENT_LIST_STACKING = None;
-Atom atom_XROOTPMAP_ID = None;
-double got_NET_ACTIVE_WINDOW = 0.0;
-double got_NET_CURRENT_DESKTOP = 0.0;
-double got_NET_CLIENT_LIST_STACKING = 0.0;
-double got_XROOTPMAP_ID = 0.0;
-
-/* T+B+L+R,tkey+presist_key,tmouse+persist_mouse */
-char *scroll_copyrect_str = NULL;
-#ifndef SCROLL_COPYRECT
-#define SCROLL_COPYRECT 1
-#endif
-char *scroll_copyrect = NULL;
-#if SCROLL_COPYRECT
-#if 1
-char *scroll_copyrect_default = "always";	/* -scrollcopyrect */
-#else
-char *scroll_copyrect_default = "keys";
-#endif
-#else
-char *scroll_copyrect_default = "never";
-#endif
-char *scroll_key_list_str = NULL;
-KeySym *scroll_key_list = NULL;
-
-#ifndef SCALING_COPYRECT
-#define SCALING_COPYRECT 1
-#endif
-int scaling_copyrect0 = SCALING_COPYRECT;
-int scaling_copyrect  = SCALING_COPYRECT;
-
-int scrollcopyrect_min_area = 60000;	/* minimum rectangle area */
-int debug_scroll = 0;
-double pointer_flush_delay = 0.0;
-double last_scroll_event = 0.0;
-int max_scroll_keyrate = 0;
-double max_keyrepeat_time = 0.0;
-char *max_keyrepeat_str = NULL;
-char *max_keyrepeat_str0 = "4-20";
-int max_keyrepeat_lo = 1, max_keyrepeat_hi = 40;
-
-char **scroll_good_all = NULL;
-char **scroll_good_key = NULL;
-char **scroll_good_mouse = NULL;
-char *scroll_good_str = NULL;
-char *scroll_good_str0 = "##Nomatch";
-/*	"##Firefox-bin," */
-/*	"##Gnome-terminal," */
-/*	"##XTerm", */
-
-char **scroll_skip_all = NULL;
-char **scroll_skip_key = NULL;
-char **scroll_skip_mouse = NULL;
-char *scroll_skip_str = NULL;
-char *scroll_skip_str0 = "##Soffice.bin,##StarOffice,##OpenOffice";
-/*	"##Konsole,"	 * no problems, known heuristics do not work */
-
-char **scroll_term = NULL;
-char *scroll_term_str = NULL;
-char *scroll_term_str0 = "term";
-
-char* screen_fixup_str = NULL;
-double screen_fixup_V = 0.0;
-double screen_fixup_C = 0.0;
-double screen_fixup_X = 0.0;
-double screen_fixup_8 = 0.0;
-
-#ifndef NOREPEAT
-#define NOREPEAT 1
-#endif
-int no_autorepeat = NOREPEAT;	/* turn off autorepeat with clients */
-int no_repeat_countdown = 2;
-int watch_bell = 1;		/* watch for the bell using XKEYBOARD */
-int sound_bell = 1;		/* actually send it */
-int xkbcompat = 0;		/* ignore XKEYBOARD extension */
-int use_xkb_modtweak = 0;	/* -xkb */
-#ifndef SKIPDUPS
-#define SKIPDUPS 0
-#endif
-int skip_duplicate_key_events = SKIPDUPS;
-char *skip_keycodes = NULL;
-int sloppy_keys = 0;
-#ifndef ADDKEYSYMS
-#define ADDKEYSYMS 1
-#endif
-int add_keysyms = ADDKEYSYMS;	/* automatically add keysyms to X server */
-
-char *remap_file = NULL;	/* -remap */
-char *pointer_remap = NULL;
-/* use the various ways of updating pointer */
-#ifndef POINTER_MODE_DEFAULT
-#define POINTER_MODE_DEFAULT 2
-#endif
-int pointer_mode = POINTER_MODE_DEFAULT;
-int pointer_mode_max = 4;	
-int single_copytile = 0;	/* use the old way copy_tiles() */
-int single_copytile_orig = 0;
-int single_copytile_count = 0;
-int tile_shm_count = 0;
-
-int using_shm = 1;		/* whether mit-shm is used */
-int flip_byte_order = 0;	/* sometimes needed when using_shm = 0 */
-/*
- * waitms is the msec to wait between screen polls.  Not too old h/w shows
- * poll times of 10-35ms, so maybe this value cuts the idle load by 2 or so.
- */
-int waitms = 20;
-int got_waitms = 0;
-double wait_ui = 2.0;
-double slow_fb = 0.0;
-double xrefresh = 0.0;
-int wait_bog = 1;
-int extra_fbur = 1;
-int defer_update = 20;	/* deferUpdateTime ms to wait before sends. */
-int set_defer = 1;
-int got_defer = 0;
-int got_deferupdate = 0;
-
-int screen_blank = 60;	/* number of seconds of no activity to throttle */
-			/* down the screen polls.  zero to disable. */
-int no_fbu_blank = 30;	/* nap if no client updates in this many secs. */
-int take_naps = 1;	/* -nap/-nonap */
-int naptile = 4;	/* tile change threshold per poll to take a nap */
-int napfac = 4;		/* time = napfac*waitms, cut load with extra waits */
-int napmax = 1500;	/* longest nap in ms. */
-int ui_skip = 10;	/* see watchloop.  negative means ignore input */
-int all_input = 0;
-int handle_events_eagerly = 0;
-
-
-#if LIBVNCSERVER_HAVE_FBPM
-int watch_fbpm = 1;	/* -nofbpm */
-#else
-int watch_fbpm = 0;
-#endif
-
-int watch_dpms = 0;	/* -dpms */
-int force_dpms = 0;
-int client_dpms = 0;
-int no_ultra_dpms = 0;
-int no_ultra_ext = 0;
-int saw_ultra_chat = 0;
-int saw_ultra_file = 0;
-int chat_window = 0;
-rfbClientPtr chat_window_client = NULL;
-
-int watch_selection = 1;	/* normal selection/cutbuffer maintenance */
-int watch_primary = 1;		/* more dicey, poll for changes in PRIMARY */
-int watch_clipboard = 1;
-char *sel_direction = NULL;	/* "send" or "recv" for one-way */
-
-char *sigpipe = NULL;		/* skip, ignore, exit */
-
-/* visual stuff for -visual override or -overlay */
-VisualID visual_id = (VisualID) 0;
-int visual_depth = 0;
-
-/* for -overlay mode on Solaris/IRIX.  X server draws cursor correctly.  */
-int overlay = 0;
-int overlay_cursor = 1;
-
-/* tile heuristics: */
-double fs_frac = 0.75;	/* threshold tile fraction to do fullscreen updates. */
-int tile_fuzz = 2;	/* tolerance for suspecting changed tiles touching */
-			/* a known changed tile. */
-int grow_fill = 3;	/* do the grow islands heuristic with this width. */
-int gaps_fill = 4;	/* do a final pass to try to fill gaps between tiles. */
-
-int debug_pointer = 0;
-int debug_keyboard = 0;
-
-int quiet = 0;
-int verbose = 0;
-
-/* threaded vs. non-threaded (default) */
-int use_threads = 0;
-int started_rfbRunEventLoop = 0;
-int threads_drop_input = 0;
-
-/* info about command line opts */
-int got_noxwarppointer = 0;
-int got_rfbport = 0;
-int got_rfbport_val = -1;
-int got_alwaysshared = 0;
-int got_nevershared = 0;
-int got_cursorpos = 0;
-int got_pointer_mode = -1;
-int got_noviewonly = 0;
-int got_wirecopyrect = 0;
-int got_scrollcopyrect = 0;
-int got_noxkb = 0;
-int got_nomodtweak = 0;
-
diff --git a/ica/x11/x11vnc/options.h b/ica/x11/x11vnc/options.h
deleted file mode 100644
index 609f4ce..0000000
--- a/ica/x11/x11vnc/options.h
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_OPTIONS_H
-#define _X11VNC_OPTIONS_H
-
-/* -- options.h -- */
-
-/* 
- * variables for the command line options
- */
-extern int debug;
-
-extern char *use_dpy;
-extern int display_N;
-extern int auto_port;
-extern char *auth_file;
-extern char *visual_str;
-extern int set_visual_str_to_something;
-extern char *logfile;
-extern int logfile_append;
-extern char *flagfile;
-extern char *rm_flagfile;
-extern char *passwdfile;
-extern int unixpw;
-extern int unixpw_nis;
-extern char *unixpw_list;
-extern char *unixpw_cmd;
-extern int unixpw_system_greeter;
-extern int unixpw_system_greeter_active;
-extern int use_stunnel;
-extern int stunnel_port;
-extern char *stunnel_pem;
-extern int use_openssl;
-extern int http_ssl;
-extern int ssl_no_fail;
-extern char *openssl_pem;
-extern char *ssl_certs_dir;
-extern char *enc_str;
-extern int vencrypt_mode;
-extern int vencrypt_kx;
-extern int vencrypt_enable_plain_login;
-extern int anontls_mode;
-extern int create_fresh_dhparams;
-extern char *dhparams_file;
-extern int http_try_it;
-extern int stunnel_http_port;
-extern int https_port_num;
-extern int https_port_redir;
-extern char *ssl_verify;
-extern char *ssl_crl;
-extern int ssl_initialized;
-extern int ssl_timeout_secs;
-extern char *ssh_str;
-extern pid_t ssh_pid;
-extern int usepw;
-extern char *blackout_str;
-extern int blackout_ptr;
-extern char *clip_str;
-extern int use_solid_bg;
-extern char *solid_str;
-extern char *solid_default;
-
-extern char *wmdt_str;
-
-extern char *speeds_str;
-extern char *rc_rcfile;
-extern int rc_rcfile_default;
-extern int rc_norc;
-extern int got_norc;
-extern int opts_bg;
-
-extern int shared;
-extern int connect_once;
-extern int got_connect_once;
-extern int got_findauth;
-extern int deny_all;
-extern int accept_remote_cmds;
-extern char *remote_prefix;
-extern int remote_direct;
-extern int query_default;
-extern int safe_remote_only;
-extern int priv_remote;
-extern int more_safe;
-extern int no_external_cmds;
-extern char *allowed_external_cmds;
-extern int started_as_root;
-extern int host_lookup;
-extern char *unix_sock;
-extern int unix_sock_fd;
-extern int ipv6_listen;
-extern int got_ipv6_listen;
-extern int ipv6_listen_fd;
-extern int ipv6_http_fd;
-extern int noipv6;
-extern int noipv4;
-extern char *ipv6_client_ip_str;
-extern char *users_list;
-extern char **user2group;
-extern char *allow_list;
-extern char *listen_str;
-extern char *listen_str6;
-extern char *allow_once;
-extern char *accept_cmd;
-extern char *afteraccept_cmd;
-extern char *gone_cmd;
-extern int view_only;
-extern char *allowed_input_view_only;
-extern char *allowed_input_normal;
-extern char *allowed_input_str;
-extern char *viewonly_passwd;
-extern char **passwd_list;
-extern int begin_viewonly;
-extern int inetd;
-extern int tightfilexfer; 
-extern int got_ultrafilexfer; 
-extern int first_conn_timeout;
-extern int ping_interval;
-extern int flash_cmap;
-extern int shift_cmap;
-extern int force_indexed_color;
-extern int advertise_truecolor;
-extern int advertise_truecolor_reset;
-extern int cmap8to24;
-extern char *cmap8to24_str;
-extern int xform24to32;
-extern int launch_gui;
-
-extern int avahi;
-extern int vnc_redirect;
-extern int vnc_redirect_sock;
-
-extern int use_modifier_tweak;
-extern int watch_capslock;
-extern int skip_lockkeys;
-extern int use_iso_level3;
-extern int clear_mods;
-extern int nofb;
-extern char *raw_fb_str;
-extern char *raw_fb_pixfmt;
-extern char *raw_fb_full_str;
-extern char *freqtab;
-extern char *pipeinput_str;
-extern char *pipeinput_opts;
-extern FILE *pipeinput_fh;
-extern int pipeinput_tee;
-extern int pipeinput_int;
-extern int pipeinput_cons_fd;
-extern char *pipeinput_cons_dev;
-
-extern int macosx_nodimming;
-extern int macosx_nosleep;
-extern int macosx_noscreensaver;
-extern int macosx_wait_for_switch;
-extern int macosx_mouse_wheel_speed;
-extern int macosx_console;
-extern int macosx_swap23;
-extern int macosx_resize;
-extern int macosx_icon_anim_time;
-extern int macosx_no_opengl;
-extern int macosx_no_rawfb;
-extern int macosx_read_opengl;
-extern int macosx_read_rawfb;
-
-extern unsigned long subwin;
-extern int subwin_wait_mapped;
-extern int freeze_when_obscured;
-extern int subwin_obscured;
-
-extern int debug_xevents;
-extern int debug_xdamage;
-extern int debug_wireframe;
-extern int debug_tiles;
-extern int debug_grabs;
-extern int debug_sel;
-
-extern int xtrap_input;
-extern int xinerama;
-extern int xrandr;
-extern int xrandr_maybe;
-extern char *xrandr_mode;
-extern char *pad_geometry;
-extern time_t pad_geometry_time;
-extern int use_snapfb;
-
-extern int use_xrecord;
-extern int noxrecord;
-
-extern char *client_connect;
-extern char *client_connect_file;
-extern int connect_or_exit;
-extern int vnc_connect;
-extern char *connect_proxy;
-
-extern int show_cursor;
-extern int show_multiple_cursors;
-extern char *multiple_cursors_mode;
-extern int cursor_drag_changes;
-extern int cursor_pos_updates;
-extern int cursor_shape_updates;
-extern int use_xwarppointer;
-extern int always_inject;
-extern int show_dragging;
-extern int wireframe;
-extern int wireframe_local;
-
-extern char *wireframe_str;
-extern char *wireframe_copyrect;
-extern char *wireframe_copyrect_default;
-extern int wireframe_in_progress;
-
-extern int ncache;
-extern int ncache0;
-extern int ncache_default;
-extern int ncache_copyrect;
-extern int ncache_wf_raises;
-extern int ncache_dt_change;
-extern int ncache_pad;
-extern int ncache_xrootpmap;
-extern int ncache_keep_anims;
-extern int ncache_old_wm;
-extern int macosx_ncache_macmenu;
-extern int macosx_us_kbd;
-extern int ncache_beta_tester;
-extern int ncdb;
-
-extern Atom atom_NET_ACTIVE_WINDOW;
-extern Atom atom_NET_CURRENT_DESKTOP;
-extern Atom atom_NET_CLIENT_LIST_STACKING;
-extern Atom atom_XROOTPMAP_ID;
-extern double got_NET_ACTIVE_WINDOW;
-extern double got_NET_CURRENT_DESKTOP;
-extern double got_NET_CLIENT_LIST_STACKING;
-extern double got_XROOTPMAP_ID;
-
-extern char *scroll_copyrect_str;
-extern char *scroll_copyrect;
-extern char *scroll_copyrect_default;
-extern char *scroll_key_list_str;
-extern KeySym *scroll_key_list;
-
-extern int scaling_copyrect0;
-extern int scaling_copyrect;
-
-extern int scrollcopyrect_min_area;
-extern int debug_scroll;
-extern double pointer_flush_delay;
-extern double last_scroll_event;
-extern int max_scroll_keyrate;
-extern double max_keyrepeat_time;
-extern char *max_keyrepeat_str;
-extern char *max_keyrepeat_str0;
-extern int max_keyrepeat_lo, max_keyrepeat_hi;
-
-extern char **scroll_good_all;
-extern char **scroll_good_key;
-extern char **scroll_good_mouse;
-extern char *scroll_good_str;
-extern char *scroll_good_str0;
-
-extern char **scroll_skip_all;
-extern char **scroll_skip_key;
-extern char **scroll_skip_mouse;
-extern char *scroll_skip_str;
-extern char *scroll_skip_str0;
-
-extern char **scroll_term;
-extern char *scroll_term_str;
-extern char *scroll_term_str0;
-
-extern char* screen_fixup_str;
-extern double screen_fixup_V;
-extern double screen_fixup_C;
-extern double screen_fixup_X;
-extern double screen_fixup_8;
-
-extern int no_autorepeat;
-extern int no_repeat_countdown;
-extern int watch_bell;
-extern int sound_bell;
-extern int xkbcompat;
-extern int use_xkb_modtweak;
-extern int skip_duplicate_key_events;
-extern char *skip_keycodes;
-extern int sloppy_keys;
-extern int add_keysyms;
-
-extern char *remap_file;
-extern char *pointer_remap;
-extern int pointer_mode;
-extern int pointer_mode_max;	
-extern int single_copytile;
-extern int single_copytile_orig;
-extern int single_copytile_count;
-extern int tile_shm_count;
-
-extern int using_shm;
-extern int flip_byte_order;
-extern int waitms;
-extern int got_waitms;
-extern double wait_ui;
-extern double slow_fb;
-extern double xrefresh;
-extern int wait_bog;
-extern int extra_fbur;
-extern int defer_update;
-extern int set_defer;
-extern int got_defer;
-extern int got_deferupdate;
-
-extern int screen_blank;
-
-extern int no_fbu_blank;
-extern int take_naps;
-extern int naptile;
-extern int napfac;
-extern int napmax;
-extern int ui_skip;
-extern int all_input;
-extern int handle_events_eagerly;
-
-extern int watch_fbpm;
-extern int watch_dpms;
-extern int force_dpms;
-extern int client_dpms;
-extern int no_ultra_dpms;
-extern int no_ultra_ext;
-extern int saw_ultra_chat;
-extern int saw_ultra_file;
-extern int chat_window;
-extern rfbClientPtr chat_window_client;
-
-extern int watch_selection;
-extern int watch_primary;
-extern int watch_clipboard;
-extern char *sel_direction;
-
-extern char *sigpipe;
-
-extern VisualID visual_id;
-extern int visual_depth;
-
-extern int overlay;
-extern int overlay_cursor;
-
-extern double fs_frac;
-extern int tile_fuzz;
-
-extern int grow_fill;
-extern int gaps_fill;
-
-extern int debug_pointer;
-extern int debug_keyboard;
-
-extern int quiet;
-extern int verbose;
-
-extern int use_threads;
-extern int started_rfbRunEventLoop;
-extern int threads_drop_input;
-
-extern int got_noxwarppointer;
-extern int got_rfbport;
-extern int got_rfbport_val;
-extern int got_alwaysshared;
-extern int got_nevershared;
-extern int got_cursorpos;
-extern int got_pointer_mode;
-extern int got_noviewonly;
-extern int got_wirecopyrect;
-extern int got_scrollcopyrect;
-extern int got_noxkb;
-extern int got_nomodtweak;
-
-#endif /* _X11VNC_OPTIONS_H */
diff --git a/ica/x11/x11vnc/params.h b/ica/x11/x11vnc/params.h
deleted file mode 100644
index a1690b9..0000000
--- a/ica/x11/x11vnc/params.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_PARAMS_H
-#define _X11VNC_PARAMS_H
-
-/* -- params.h -- */
-
-#define ICON_MODE_SOCKS 16
-
-/* had lw=3 for a long time */
-#ifndef WIREFRAME_PARMS
-#define WIREFRAME_PARMS "0xff,2,0,32+8+8+8,all,0.15+0.30+5.0+0.125"
-#endif
-
-#ifndef SCROLL_COPYRECT_PARMS
-#define SCROLL_COPYRECT_PARMS "0+64+32+32,0.02+0.10+0.9,0.03+0.06+0.5+0.1+5.0"
-#endif
-
-#ifndef POLL_8TO24_DELAY
-#define POLL_8TO24_DELAY 0.05
-#endif
-
-#define LATENCY0 20     /* 20ms */
-#define NETRATE0 20     /* 20KB/sec */
-
-#define POINTER_MODE_NOFB 2
-
-/* scan pattern jitter from x0rfbserver */
-#define NSCAN 32
-
-#define FB_COPY 0x1
-#define FB_MOD  0x2
-#define FB_REQ  0x4
-
-#define VNC_CONNECT_MAX 16384
-#define X11VNC_REMOTE_MAX 65536
-#define PROP_MAX (262144L)
-
-#define MAXN 256
-
-#define PIPEINPUT_NONE		0x0
-#define PIPEINPUT_VID		0x1
-#define PIPEINPUT_CONSOLE	0x2
-#define PIPEINPUT_UINPUT	0x3
-#define PIPEINPUT_MACOSX	0x4
-#define PIPEINPUT_VNC		0x5
-
-#define MAX_BUTTONS 5
-
-#define ROTATE_NONE		0
-#define ROTATE_X		1
-#define ROTATE_Y		2
-#define ROTATE_XY		3
-#define ROTATE_90		4
-#define ROTATE_90X		5
-#define ROTATE_90Y		6
-#define ROTATE_270		7
-
-#define VENCRYPT_NONE		0
-#define VENCRYPT_SUPPORT	1
-#define VENCRYPT_SOLE		2
-#define VENCRYPT_FORCE		3
-
-#define VENCRYPT_BOTH		0
-#define VENCRYPT_NODH		1
-#define VENCRYPT_NOX509		2
-
-#define ANONTLS_NONE		0
-#define ANONTLS_SUPPORT		1
-#define ANONTLS_SOLE		2
-#define ANONTLS_FORCE		3
-
-#endif /* _X11VNC_PARAMS_H */
diff --git a/ica/x11/x11vnc/pm.c b/ica/x11/x11vnc/pm.c
deleted file mode 100644
index 659c272..0000000
--- a/ica/x11/x11vnc/pm.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- pm.c -- */
-#include "x11vnc.h"
-#include "cleanup.h"
-
-void check_pm(void);
-void set_dpms_mode(char *mode);
-static void check_fbpm(void);
-static void check_dpms(void);
-
-#if LIBVNCSERVER_HAVE_FBPM
-#include <X11/Xmd.h>
-#include <X11/extensions/fbpm.h>
-#endif
-
-#if LIBVNCSERVER_HAVE_DPMS
-#include <X11/extensions/dpms.h>
-#endif
-
-void check_pm(void) {
-	static int skip = -1;
-	if (skip < 0) {
-		skip = 0;
-		if (getenv("X11VNC_NO_CHECK_PM")) {
-			skip = 1;
-		}
-	}
-	if (skip) {
-		return;
-	}
-	check_fbpm();
-	check_dpms();
-	/* someday dpms activities? */
-}
-
-static void check_fbpm(void) {
-	static int init_fbpm = 0;
-#if LIBVNCSERVER_HAVE_FBPM
-	static int fbpm_capable = 0;
-	static time_t last_fbpm = 0;
-	int db = 0;
-
-	CARD16 level;
-	BOOL enabled;
-
-	RAWFB_RET_VOID
-
-	if (! init_fbpm) {
-		if (getenv("FBPM_DEBUG")) {
-			db = atoi(getenv("FBPM_DEBUG"));
-		}
-		if (FBPMCapable(dpy)) {
-			fbpm_capable = 1;
-			rfbLog("X display is capable of FBPM.\n");
-			if (watch_fbpm) {
-				rfbLog("Preventing low-power FBPM modes when"
-				    " clients are connected.\n");
-			}
-		} else {
-			if (! raw_fb_str) {
-				rfbLog("X display is not capable of FBPM.\n");
-			}
-			fbpm_capable = 0;
-		}
-		init_fbpm = 1;
-	}
-
-	if (! watch_fbpm) {
-		return;
-	}
-	if (! fbpm_capable) {
-		return;
-	}
-	if (! client_count) {
-		return;
-	}
-	if (time(NULL) < last_fbpm + 5) {
-		return;
-	}
-	last_fbpm = time(NULL);
-
-	if (FBPMInfo(dpy, &level, &enabled)) {
-		if (db) fprintf(stderr, "FBPMInfo level: %d enabled: %d\n", level, enabled);
-
-		if (enabled && level != FBPMModeOn) {
-			char *from = "unknown-fbpm-state";
-			XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-			trapped_xerror = 0;
-
-			if (level == FBPMModeStandby) {
-				from = "FBPMModeStandby";
-			} else if (level == FBPMModeSuspend) {
-				from = "FBPMModeSuspend";
-			} else if (level == FBPMModeOff) {
-				from = "FBPMModeOff";
-			}
-
-			rfbLog("switching FBPM state from %s to FBPMModeOn\n", from);
-			
-			FBPMForceLevel(dpy, FBPMModeOn);
-		
-			XSetErrorHandler(old_handler);
-			trapped_xerror = 0;
-		}
-	} else {
-		if (db) fprintf(stderr, "FBPMInfo failed.\n");
-	}
-#else
-	RAWFB_RET_VOID
-	if (! init_fbpm) {
-		if (! raw_fb_str) {
-			rfbLog("X FBPM extension not supported.\n");
-		}
-		init_fbpm = 1;
-	}
-#endif
-}
-
-void set_dpms_mode(char *mode) {
-#if NO_X11
-	return;
-#else
-	RAWFB_RET_VOID
-#if LIBVNCSERVER_HAVE_DPMS
-	if (dpy && DPMSCapable(dpy)) {
-		CARD16 level;
-		CARD16 want;
-		BOOL enabled;
-		if (!strcmp(mode, "off")) {
-			want = DPMSModeOff;
-		} else if (!strcmp(mode, "on")) {
-			want = DPMSModeOn;
-		} else if (!strcmp(mode, "standby")) {
-			want = DPMSModeStandby;
-		} else if (!strcmp(mode, "suspend")) {
-			want = DPMSModeSuspend;
-		} else if (!strcmp(mode, "enable")) {
-			DPMSEnable(dpy);
-			return;
-		} else if (!strcmp(mode, "disable")) {
-			DPMSDisable(dpy);
-			return;
-		} else {
-			return;
-		}
-		if (DPMSInfo(dpy, &level, &enabled)) {
-			char *from = "unk";
-			if (enabled && level != want) {
-				XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-				trapped_xerror = 0;
-
-				rfbLog("DPMSInfo level: %d enabled: %d\n", level, enabled);
-				if (level == DPMSModeStandby) {
-					from = "DPMSModeStandby";
-				} else if (level == DPMSModeSuspend) {
-					from = "DPMSModeSuspend";
-				} else if (level == DPMSModeOff) {
-					from = "DPMSModeOff";
-				} else if (level == DPMSModeOn) {
-					from = "DPMSModeOn";
-				}
-
-				rfbLog("switching DPMS state from %s to %s\n", from, mode);
-				
-				DPMSForceLevel(dpy, want);
-			
-				XSetErrorHandler(old_handler);
-				trapped_xerror = 0;
-			}
-		}
-	}
-#endif
-#endif
-}
-
-static void check_dpms(void) {
-	static int init_dpms = 0;
-#if LIBVNCSERVER_HAVE_DPMS
-	static int dpms_capable = 0;
-	static time_t last_dpms = 0;
-	int db = 0;
-
-	CARD16 level;
-	BOOL enabled;
-
-	RAWFB_RET_VOID
-
-	if (! init_dpms) {
-		if (getenv("DPMS_DEBUG")) {
-			db = atoi(getenv("DPMS_DEBUG"));
-		}
-		if (DPMSCapable(dpy)) {
-			dpms_capable = 1;
-			rfbLog("X display is capable of DPMS.\n");
-			if (watch_dpms) {
-				rfbLog("Preventing low-power DPMS modes when"
-				    " clients are connected.\n");
-			}
-		} else {
-			if (! raw_fb_str) {
-				rfbLog("X display is not capable of DPMS.\n");
-			}
-			dpms_capable = 0;
-		}
-		init_dpms = 1;
-	}
-
-	if (force_dpms || (client_dpms && client_count)) {
-		static int last_enable = 0;
-		if (time(NULL) > last_enable) {
-			set_dpms_mode("enable");
-			last_enable = time(NULL);
-		}
-		set_dpms_mode("off");
-	}
-	if (! watch_dpms) {
-		return;
-	}
-	if (! dpms_capable) {
-		return;
-	}
-	if (! client_count) {
-		return;
-	}
-	if (time(NULL) < last_dpms + 5) {
-		return;
-	}
-	last_dpms = time(NULL);
-
-	if (DPMSInfo(dpy, &level, &enabled)) {
-		if (db) fprintf(stderr, "DPMSInfo level: %d enabled: %d\n", level, enabled);
-
-		if (enabled && level != DPMSModeOn) {
-			char *from = "unknown-dpms-state";
-			XErrorHandler old_handler = XSetErrorHandler(trap_xerror);
-			trapped_xerror = 0;
-
-			if (level == DPMSModeStandby) {
-				from = "DPMSModeStandby";
-			} else if (level == DPMSModeSuspend) {
-				from = "DPMSModeSuspend";
-			} else if (level == DPMSModeOff) {
-				from = "DPMSModeOff";
-			}
-
-			rfbLog("switching DPMS state from %s to DPMSModeOn\n", from);
-			
-			DPMSForceLevel(dpy, DPMSModeOn);
-		
-			XSetErrorHandler(old_handler);
-			trapped_xerror = 0;
-		}
-	} else {
-		if (db) fprintf(stderr, "DPMSInfo failed.\n");
-	}
-#else
-	RAWFB_RET_VOID
-	if (! init_dpms) {
-		if (! raw_fb_str) {
-			rfbLog("X DPMS extension not supported.\n");
-		}
-		init_dpms = 1;
-	}
-#endif
-}
-
diff --git a/ica/x11/x11vnc/pm.h b/ica/x11/x11vnc/pm.h
deleted file mode 100644
index 01ef9a6..0000000
--- a/ica/x11/x11vnc/pm.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_PM_H
-#define _X11VNC_PM_H
-
-/* -- pm.h -- */
-extern void check_pm(void);
-extern void set_dpms_mode(char *mode);
-
-#endif /* _X11VNC_PM_H */
diff --git a/ica/x11/x11vnc/pointer.c b/ica/x11/x11vnc/pointer.c
deleted file mode 100644
index f2995c3..0000000
--- a/ica/x11/x11vnc/pointer.c
+++ /dev/null
@@ -1,1206 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- pointer.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "keyboard.h"
-#include "xinerama.h"
-#include "xrecord.h"
-#include "win_utils.h"
-#include "cursor.h"
-#include "userinput.h"
-#include "connections.h"
-#include "cleanup.h"
-#include "unixpw.h"
-#include "v4l.h"
-#include "linuxfb.h"
-#include "uinput.h"
-#include "scan.h"
-#include "macosx.h"
-#include "screen.h"
-
-int pointer_queued_sent = 0;
-
-void initialize_pointer_map(char *pointer_remap);
-void do_button_mask_change(int mask, int button);
-void pointer_event(int mask, int x, int y, rfbClientPtr client);
-void initialize_pipeinput(void);
-int check_pipeinput(void);
-void update_x11_pointer_position(int x, int y);
-
-
-static void buttonparse(int from, char **s);
-static void update_x11_pointer_mask(int mask);
-static void pipe_pointer(int mask, int x, int y, rfbClientPtr client);
-
-/*
- * pointer event (motion and button click) handling routines.
- */
-typedef struct ptrremap {
-	KeySym keysym;
-	KeyCode keycode;
-	int end;
-	int button;
-	int down;
-	int up;
-} prtremap_t;
-
-#define MAX_BUTTON_EVENTS 50
-static prtremap_t pointer_map[MAX_BUTTONS+1][MAX_BUTTON_EVENTS];
-
-/*
- * For parsing the -buttonmap sections, e.g. "4" or ":Up+Up+Up:"
- */
-static void buttonparse(int from, char **s) {
-#if (0 && NO_X11)
-	if (!from || !s) {}
-	return;
-#else
-	char *q;
-	int to, i;
-	int modisdown[256];
-
-	q = *s;
-
-	for (i=0; i<256; i++) {
-		modisdown[i] = 0;
-	}
-
-	if (*q == ':') {
-		/* :sym1+sym2+...+symN: format */
-		int l = 0, n = 0;
-		char list[1000];
-		char *t, *kp = q + 1;
-		KeyCode kcode;
-
-		while (*(kp+l) != ':' && *(kp+l) != '\0') {
-			/* loop to the matching ':' */
-			l++;
-			if (l >= 1000) {
-				rfbLog("buttonparse: keysym list too long: "
-				    "%s\n", q);
-				break;
-			}
-		}
-		*(kp+l) = '\0';
-		strncpy(list, kp, l);
-		list[l] = '\0';
-		rfbLog("remap button %d using \"%s\"\n", from, list);
-
-		/* loop over tokens separated by '+' */
-		t = strtok(list, "+");
-		while (t) {
-			KeySym ksym;
-			unsigned int ui;
-			int i;
-			if (n >= MAX_BUTTON_EVENTS - 20) {
-				rfbLog("buttonparse: too many button map "
-					"events: %s\n", list);
-				break;
-			}
-			if (sscanf(t, "0x%x", &ui) == 1) {
-				ksym = (KeySym) ui;	/* hex value */
-			} else {
-				X_LOCK;
-				ksym = XStringToKeysym(t); /* string value */
-				X_UNLOCK;
-			}
-			if (ksym == NoSymbol) {
-				/* see if Button<N> "keysym" was used: */
-				if (sscanf(t, "Button%d", &i) == 1) {
-					rfbLog("   event %d: button %d\n",
-					    from, n+1, i);
-					if (i == 0) i = -1; /* bah */
-					pointer_map[from][n].keysym  = NoSymbol;
-					pointer_map[from][n].keycode = NoSymbol;
-					pointer_map[from][n].button = i;
-					pointer_map[from][n].end    = 0;
-					pointer_map[from][n].down   = 0;
-					pointer_map[from][n].up     = 0;
-				} else {
-					rfbLog("buttonparse: ignoring unknown "
-					    "keysym: %s\n", t);
-					n--;
-				}
-			} else if (dpy) {
-				/*
-				 * XXX may not work with -modtweak or -xkb
-				 */
-				char *str;
-				X_LOCK;
-#if NO_X11
-				kcode = NoSymbol;
-#else
-				kcode = XKeysymToKeycode(dpy, ksym);
-#endif
-
-				pointer_map[from][n].keysym  = ksym;
-				pointer_map[from][n].keycode = kcode;
-				pointer_map[from][n].button = 0;
-				pointer_map[from][n].end    = 0;
-				if (! ismodkey(ksym) ) {
-					/* do both down then up */
-					pointer_map[from][n].down = 1;
-					pointer_map[from][n].up   = 1;
-				} else {
-					if (modisdown[kcode]) {
-						pointer_map[from][n].down = 0;
-						pointer_map[from][n].up   = 1;
-						modisdown[kcode] = 0;
-					} else {
-						pointer_map[from][n].down = 1;
-						pointer_map[from][n].up   = 0;
-						modisdown[kcode] = 1;
-					}
-				}
-				str = XKeysymToString(ksym);
-				rfbLog("   event %d: keysym %s (0x%x) -> "
-				    "keycode 0x%x down=%d up=%d\n", n+1,
-				    str ? str : "null", ksym, kcode,
-				    pointer_map[from][n].down,
-				    pointer_map[from][n].up);
-				X_UNLOCK;
-			}
-			t = strtok(NULL, "+");
-			n++;
-		}
-
-		/* we must release any modifiers that are still down: */
-		for (i=0; i<256; i++) {
-			kcode = (KeyCode) i;
-			if (n >= MAX_BUTTON_EVENTS) {
-				rfbLog("buttonparse: too many button map "
-					"events: %s\n", list);
-				break;
-			}
-			if (modisdown[kcode]) {
-				pointer_map[from][n].keysym  = NoSymbol;
-				pointer_map[from][n].keycode = kcode;
-				pointer_map[from][n].button = 0;
-				pointer_map[from][n].end    = 0;
-				pointer_map[from][n].down = 0;
-				pointer_map[from][n].up   = 1;
-				modisdown[kcode] = 0;
-				n++;
-			}
-		}
-
-		/* advance the source pointer position */
-		(*s) += l+2;
-	} else {
-		/* single digit format */
-		char str[2];
-		str[0] = *q;
-		str[1] = '\0';
-
-		to = atoi(str);
-		if (to < 1) {
-			rfbLog("skipping invalid remap button \"%d\" for button"
-			    " %d from string \"%s\"\n",
-			    to, from, str);
-		} else {
-			rfbLog("remap button %d using \"%s\"\n", from, str);
-			rfbLog("   button: %d -> %d\n", from, to);
-			pointer_map[from][0].keysym  = NoSymbol;
-			pointer_map[from][0].keycode = NoSymbol;
-			pointer_map[from][0].button = to;
-			pointer_map[from][0].end    = 0;
-			pointer_map[from][0].down   = 0;
-			pointer_map[from][0].up     = 0;
-		}
-		/* advance the source pointer position */
-		(*s)++;
-	}
-#endif	/* NO_X11 */
-}
-
-/*
- * process the -buttonmap string
- */
-void initialize_pointer_map(char *pointer_remap) {
-	unsigned char map[MAX_BUTTONS];
-	int i, k;
-	/*
-	 * This routine counts the number of pointer buttons on the X
-	 * server (to avoid problems, even crashes, if a client has more
-	 * buttons).  And also initializes any pointer button remapping
-	 * from -buttonmap option.
-	 */
-	
-	if (!raw_fb_str) {
-#if NO_X11
-		num_buttons = 5;
-#else
-		X_LOCK;
-		num_buttons = XGetPointerMapping(dpy, map, MAX_BUTTONS);
-		X_UNLOCK;
-		rfbLog("The X server says there are %d mouse buttons.\n", num_buttons);
-#endif
-	} else {
-		num_buttons = 5;
-		rfbLog("Manually set num_buttons to: %d\n", num_buttons);
-	}
-
-	if (num_buttons < 0) {
-		num_buttons = 0;
-	}
-
-	/* FIXME: should use info in map[] */
-	for (i=1; i<= MAX_BUTTONS; i++) {
-		for (k=0; k < MAX_BUTTON_EVENTS; k++) {
-			pointer_map[i][k].end = 1;
-		}
-		pointer_map[i][0].keysym  = NoSymbol;
-		pointer_map[i][0].keycode = NoSymbol;
-		pointer_map[i][0].button = i;
-		pointer_map[i][0].end    = 0;
-		pointer_map[i][0].down   = 0;
-		pointer_map[i][0].up     = 0;
-	}
-
-	if (pointer_remap && *pointer_remap != '\0') {
-		/* -buttonmap, format is like: 12-21=2 */
-		char *p, *q, *remap = strdup(pointer_remap);	
-		int n;
-
-		if ((p = strchr(remap, '=')) != NULL) {
-			/* undocumented max button number */
-			n = atoi(p+1);	
-			*p = '\0';
-			if (n < num_buttons || num_buttons == 0) {
-				num_buttons = n;
-			} else {
-				rfbLog("warning: increasing number of mouse "
-				    "buttons from %d to %d\n", num_buttons, n);
-				num_buttons = n;
-			}
-		}
-		if ((q = strchr(remap, '-')) != NULL) {
-			/*
-			 * The '-' separates the 'from' and 'to' lists,
-			 * then it is kind of like tr(1).  
-			 */
-			char str[2];
-			int from;
-
-			rfbLog("remapping pointer buttons using string:\n");
-			rfbLog("   \"%s\"\n", remap);
-
-			p = remap;
-			q++;
-			i = 0;
-			str[1] = '\0';
-			while (*p != '-') {
-				str[0] = *p;
-				from = atoi(str);
-				buttonparse(from, &q);
-				p++;
-			}
-		}
-		free(remap);
-	}
-}
-
-/*
- * Send a pointer position event to the X server.
- */
-void update_x11_pointer_position(int x, int y) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!x || !y) {}
-	return;
-#else
-	int rc;
-
-	RAWFB_RET_VOID
-
-	X_LOCK;
-	if (!always_inject && cursor_x == x && cursor_y == y) {
-		;
-	} else if (use_xwarppointer) {
-		/*
-		 * off_x and off_y not needed with XWarpPointer since
-		 * window is used:
-		 */
-		XWarpPointer(dpy, None, window, 0, 0, 0, 0, x + coff_x,
-		    y + coff_y);
-	} else {
-		XTestFakeMotionEvent_wr(dpy, scr, x + off_x + coff_x,
-		    y + off_y + coff_y, CurrentTime);
-	}
-	X_UNLOCK;
-
-	if (cursor_x != x || cursor_y != y) {
-		last_pointer_motion_time = dnow();
-	}
-
-	cursor_x = x;
-	cursor_y = y;
-
-	/* record the x, y position for the rfb screen as well. */
-	cursor_position(x, y);
-
-	/* change the cursor shape if necessary */
-	rc = set_cursor(x, y, get_which_cursor());
-	cursor_changes += rc;
-
-	last_event = last_input = last_pointer_input = time(NULL);
-#endif	/* NO_X11 */
-}
-
-void do_button_mask_change(int mask, int button) {
-#if NO_X11
-	if (!mask || !button) {}
-	return;
-#else
-	int mb, k, i = button-1;
-
-	/*
-	 * this expands to any pointer_map button -> keystrokes
-	 * remappings.  Usually just k=0 and we send one button event.
-	 */
-	for (k=0; k < MAX_BUTTON_EVENTS; k++) {
-		int bmask = (mask & (1<<i));
-
-		if (pointer_map[i+1][k].end) {
-			break;
-		}
-
-		if (pointer_map[i+1][k].button) {
-			/* send button up or down */
-
-			mb = pointer_map[i+1][k].button;
-			if ((num_buttons && mb > num_buttons) || mb < 1) {
-				rfbLog("ignoring mouse button out of "
-				    "bounds: %d>%d mask: 0x%x -> 0x%x\n",
-				    mb, num_buttons, button_mask, mask);
-				continue;
-			}
-			if (debug_pointer) {
-				rfbLog("pointer(): sending button %d"
-				    " %s (event %d)\n", mb, bmask
-				    ? "down" : "up", k+1);
-			}
-			XTestFakeButtonEvent_wr(dpy, mb, (mask & (1<<i))
-			    ? True : False, CurrentTime);
-		} else {
-			/* send keysym up or down */
-			KeyCode key = pointer_map[i+1][k].keycode;
-			int up   = pointer_map[i+1][k].up;
-			int down = pointer_map[i+1][k].down;
-
-			if (! bmask) {
-				/* do not send keysym on button up */
-				continue; 
-			}
-			if (debug_pointer && dpy) {
-				char *str = XKeysymToString(XKeycodeToKeysym(
-                                    dpy, key, 0));
-				rfbLog("pointer(): sending button %d "
-				    "down as keycode 0x%x (event %d)\n",
-				    i+1, key, k+1);
-				rfbLog("           down=%d up=%d keysym: "
-				    "%s\n", down, up, str ? str : "null");
-			}
-			if (down) {
-				XTestFakeKeyEvent_wr(dpy, key, True,
-				    CurrentTime);
-			}
-			if (up) {
-				XTestFakeKeyEvent_wr(dpy, key, False,
-				    CurrentTime);
-			}
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-/*
- * Send a pointer button event to the X server.
- */
-static void update_x11_pointer_mask(int mask) {
-#if NO_X11
-	last_event = last_input = last_pointer_input = time(NULL);
-
-	RAWFB_RET_VOID
-	if (!mask) {}
-	return;
-#else
-	int snapped = 0, xr_mouse = 1, i;
-	last_event = last_input = last_pointer_input = time(NULL);
-
-	RAWFB_RET_VOID
-
-	if (mask != button_mask) {
-		last_pointer_click_time = dnow();
-	}
-
-	if (nofb) {
-		xr_mouse = 0;
-	} else if (!strcmp(scroll_copyrect, "never")) {
-		xr_mouse = 0;
-	} else if (!strcmp(scroll_copyrect, "keys")) {
-		xr_mouse = 0;
-	} else if (skip_cr_when_scaling("scroll")) {
-		xr_mouse = 0;
-	} else if (xrecord_skip_button(mask, button_mask)) {
-		xr_mouse = 0;
-	}
-
-	if (mask && use_xrecord && ! xrecording && xr_mouse) {
-		static int px, py, x, y, w, h, got_wm_frame;
-		static XWindowAttributes attr;
-		Window frame = None, mwin = None;
-		int skip = 0;
-
-		if (!button_mask) {
-			X_LOCK;
-			if (get_wm_frame_pos(&px, &py, &x, &y, &w, &h,
-			    &frame, &mwin)) {
-				got_wm_frame = 1;
-if (debug_scroll > 1) fprintf(stderr, "wm_win: 0x%lx\n", mwin);
-				if (mwin != None) {
-					if (!valid_window(mwin, &attr, 1)) {
-						mwin = None;
-					}
-				}
-			} else {
-				got_wm_frame = 0;
-			}
-			X_UNLOCK;
-		}
-		if (got_wm_frame) {
-			if (wireframe && near_wm_edge(x, y, w, h, px, py)) {
-				/* step out of wireframe's way */
-				skip = 1;
-			} else {
-				int ok = 0;
-				int btn4 = (1<<3);
-				int btn5 = (1<<4);
-
-				if (near_scrollbar_edge(x, y, w, h, px, py)) {
-					ok = 1;
-				}
-				if (mask & (btn4|btn5)) {
-					/* scroll wheel mouse */
-					ok = 1;
-				}
-				if (mwin != None) {
-					/* skinny internal window */
-					int w = attr.width;
-					int h = attr.height;
-					if (h > 10 * w || w > 10 * h) {
-if (debug_scroll > 1) fprintf(stderr, "internal scrollbar: %dx%d\n", w, h);
-						ok = 1;
-					}
-				}
-				if (! ok) {
-					skip = 1;
-				}
-			}
-		}
-
-		if (! skip) {
-			xrecord_watch(1, SCR_MOUSE);
-			snapshot_stack_list(0, 0.50);
-			snapped = 1;
-			if (button_mask) {
-				xrecord_set_by_mouse = 1;
-			} else {
-				update_stack_list();
-				xrecord_set_by_mouse = 2;
-			}
-		}
-	}
-
-	if (mask && !button_mask) {
-		/* button down, snapshot the stacking list before flushing */
-		if (wireframe && !wireframe_in_progress &&
-		    strcmp(wireframe_copyrect, "never")) {
-			if (! snapped) {
-				snapshot_stack_list(0, 0.0);
-			}
-		}
-	}
-
-	X_LOCK;
-
-	/* look for buttons that have be clicked or released: */
-	for (i=0; i < MAX_BUTTONS; i++) {
-	    if ( (button_mask & (1<<i)) != (mask & (1<<i)) ) {
-		if (debug_pointer) {
-			rfbLog("pointer(): mask change: mask: 0x%x -> "
-			    "0x%x button: %d\n", button_mask, mask,i+1);
-		}
-		do_button_mask_change(mask, i+1);	/* button # is i+1 */
-	    }
-	}
-
-	X_UNLOCK;
-
-	/*
-	 * Remember the button state for next time and also for the
-	 * -nodragging case:
-	 */
-	button_mask_prev = button_mask;
-	button_mask = mask;
-#endif	/* NO_X11 */
-}
-
-/* for -pipeinput */
-
-
-static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) {
-	int can_input = 0, uid = 0;
-	allowed_input_t input;
-	ClientData *cd = (ClientData *) client->clientData;
-	char hint[MAX_BUTTONS * 20];
-
-	if (pipeinput_int == PIPEINPUT_VID) {
-		v4l_pointer_command(mask, x, y, client);
-	} else if (pipeinput_int == PIPEINPUT_CONSOLE) {
-		console_pointer_command(mask, x, y, client);
-	} else if (pipeinput_int == PIPEINPUT_UINPUT) {
-		uinput_pointer_command(mask, x, y, client);
-	} else if (pipeinput_int == PIPEINPUT_MACOSX) {
-		macosx_pointer_command(mask, x, y, client);
-	} else if (pipeinput_int == PIPEINPUT_VNC) {
-		vnc_reflect_send_pointer(x, y, mask);
-	}
-	if (pipeinput_fh == NULL) {
-		return;
-	}
-
-	if (! view_only) {
-		get_allowed_input(client, &input);
-		if (input.motion || input.button) {
-			can_input = 1;	/* XXX distinguish later */
-		}
-	}
-
-	if (cd) {
-		uid = cd->uid;
-	}
-	if (! can_input) {
-		uid = -uid;
-	}
-
-	hint[0] = '\0';
-	if (mask == button_mask) {
-		strcat(hint, "None");
-	} else {
-		int i, old, newb, m = 1, cnt = 0;
-		for (i=0; i<MAX_BUTTONS; i++) {
-			char s[20];
-
-			old = button_mask & m;
-			newb = mask & m;
-			m = m << 1;
-
-			if (old == newb) {
-				continue;
-			}
-			if (hint[0] != '\0') {
-				strcat(hint, ",");
-			}
-			if (newb && ! old) {
-				sprintf(s, "ButtonPress-%d", i+1);
-				cnt++;
-			} else if (! newb && old)  {
-				sprintf(s, "ButtonRelease-%d", i+1);
-				cnt++;
-			}
-			strcat(hint, s);
-		}
-		if (! cnt) {
-			strcpy(hint, "None");
-		}
-	}
-
-	fprintf(pipeinput_fh, "Pointer %d %d %d %d %s\n", uid, x, y,
-	    mask, hint);
-	fflush(pipeinput_fh);
-	check_pipeinput();
-}
-
-/*
- * Actual callback from libvncserver when it gets a pointer event.
- * This may queue pointer events rather than sending them immediately
- * to the X server. (see update_x11_pointer*())
- */
-void pointer_event(int mask, int x, int y, rfbClientPtr client) {
-	allowed_input_t input;
-	int sent = 0, buffer_it = 0;
-	double now;
-
-	if (threads_drop_input) {
-		return;
-	}
-
-	if (mask >= 0) {
-		got_pointer_calls++;
-	}
-
-	if (debug_pointer && mask >= 0) {
-		static int show_motion = -1;
-		static double last_pointer = 0.0;
-		double tnow, dt;
-		static int last_x, last_y;
-		if (show_motion == -1) {
-			if (getenv("X11VNC_DB_NOMOTION")) {
-				show_motion = 0;
-			} else {
-				show_motion = 1;
-			}
-		}
-		dtime0(&tnow);
-		tnow -= x11vnc_start;
-		dt = tnow - last_pointer;
-		last_pointer = tnow;
-		if (show_motion) {
-			rfbLog("# pointer(mask: 0x%x, x:%4d, y:%4d) "
-			    "dx: %3d dy: %3d dt: %.4f t: %.4f\n", mask, x, y,
-			    x - last_x, y - last_y, dt, tnow);
-		}
-		last_x = x;
-		last_y = y;
-	}
-
-	if (unixpw_in_progress) {
-		return;
-	}
-
-	get_allowed_input(client, &input);
-
-	if (rotating) {
-		rotate_coords_inverse(x, y, &x, &y, -1, -1);
-	}
-
-	if (scaling) {
-		/* map from rfb size to X11 size: */
-		x = ((double) x / scaled_x) * dpy_x;
-		x = nfix(x, dpy_x);
-		y = ((double) y / scaled_y) * dpy_y;
-		y = nfix(y, dpy_y);
-	}
-
-	INPUT_LOCK;
-
-	if ((pipeinput_fh != NULL || pipeinput_int) && mask >= 0) {
-		pipe_pointer(mask, x, y, client);	/* MACOSX here. */
-		if (! pipeinput_tee) {
-			if (! view_only || raw_fb) {	/* raw_fb hack */
-				got_user_input++;
-				got_pointer_input++;
-				last_pointer_client = client;
-				last_pointer_time = dnow();
-				last_event = last_input = last_pointer_input = time(NULL);
-			}
-			if (input.motion) {
-				/* raw_fb hack track button state */
-				button_mask_prev = button_mask;
-				button_mask = mask;
-			}
-			if (!view_only && (input.motion || input.button)) {
-				last_rfb_ptr_injected = dnow();
-			}
-			INPUT_UNLOCK;
-			return;
-		}
-	}
-
-	if (view_only) {
-		INPUT_UNLOCK;
-		return;
-	}
-
-	now = dnow();
-
-	if (mask >= 0) {
-		/*
-		 * mask = -1 is a special case call from scan_for_updates()
-		 * to flush the event queue; there is no real pointer event.
-		 */
-		if (! input.motion && ! input.button) {
-			INPUT_UNLOCK;
-			return;
-		}
-
-		got_user_input++;
-		got_pointer_input++;
-		last_pointer_client = client;
-
-		last_pointer_time = now;
-		last_rfb_ptr_injected = dnow();
-
-		if (blackout_ptr && blackouts) {
-			int b, ok = 1;
-			/* see if it goes into the blacked out region */
-			for (b=0; b < blackouts; b++) {
-				if (x < blackr[b].x1 || x > blackr[b].x2) {
-					continue;
-				}
-				if (y < blackr[b].y1 || y > blackr[b].y2) {
-					continue;
-				}
-				/* x1 <= x <= x2 and y1 <= y <= y2 */
-				ok = 0;
-				break;
-			}
-			if (! ok) {
-				if (debug_pointer) {
-				    rfbLog("pointer(): blackout_ptr skipping "
-					"x=%d y=%d in rectangle %d,%d %d,%d\n", x, y,
-					blackr[b].x1, blackr[b].y1,
-					blackr[b].x2, blackr[b].y2);
-				}
-				INPUT_UNLOCK;
-				return;
-			}
-		}
-	}
-
-	/*
-	 * The following is hopefully an improvement wrt response during
-	 * pointer user input (window drags) for the threaded case.
-	 * See check_user_input() for the more complicated things we do
-	 * in the non-threaded case.
-	 */
-	if ((use_threads && pointer_mode != 1) || pointer_flush_delay > 0.0) {
-#		define NEV 32
-		/* storage for the event queue */
-		static int nevents = 0;
-		static int ev[NEV][3];
-		int i;
-		/* timer things */
-		static double dt = 0.0, tmr = 0.0, maxwait = 0.4;
-
-		if (pointer_flush_delay > 0.0) {
-			maxwait = pointer_flush_delay;
-		}
-		if (mask >= 0) {
-			if (fb_copy_in_progress || pointer_flush_delay > 0.0) {
-				buffer_it = 1;
-			}
-		}
-
-		POINTER_LOCK;
-
-		/* 
-		 * If the framebuffer is being copied in another thread
-		 * (scan_for_updates()), we will queue up to 32 pointer
-		 * events for later.  The idea is by delaying these input
-		 * events, the screen is less likely to change during the
-		 * copying period, and so will give rise to less window
-		 * "tearing".
-		 *
-		 * Tearing is not completely eliminated because we do
-		 * not suspend work in the other libvncserver threads.
-		 * Maybe that is a possibility with a mutex...
-		 */
-		if (buffer_it) {
-			/* 
-			 * mask = -1 is an all-clear signal from
-			 * scan_for_updates().
-			 *
-			 * dt is a timer in seconds; we only queue for so long.
-			 */
-			dt += dtime(&tmr);
-
-			if (nevents < NEV && dt < maxwait) {
-				i = nevents++;
-				ev[i][0] = mask;
-				ev[i][1] = x;
-				ev[i][2] = y;
-				if (! input.button) {
-					ev[i][0] = -1;
-				}
-				if (! input.motion) {
-					ev[i][1] = -1;
-					ev[i][2] = -1;
-				}
-				if (debug_pointer) {
-					rfbLog("pointer(): deferring event %d"
-					    " %.4f\n", i, tmr - x11vnc_start);
-				}
-				POINTER_UNLOCK;
-				INPUT_UNLOCK;
-				return;
-			}
-		}
-
-		/* time to send the queue */
-		for (i=0; i<nevents; i++) {
-			int sent = 0;
-			if (mask < 0 && client != NULL) {
-				/* hack to only push the latest event */
-				if (i < nevents - 1) {
-					if (debug_pointer) {
-						rfbLog("- skip deferred event:"
-						    " %d\n", i);
-					}
-					continue;
-				}
-			}
-			if (debug_pointer) {
-				rfbLog("pointer(): sending event %d %.4f\n",
-				    i+1, dnowx());
-			}
-			if (ev[i][1] >= 0) {
-				update_x11_pointer_position(ev[i][1], ev[i][2]);
-				sent = 1;
-			}
-			if (ev[i][0] >= 0) {
-				update_x11_pointer_mask(ev[i][0]);
-				sent = 1;
-			}
-
-			if (sent) {
-				pointer_queued_sent++;
-			}
-		}
-		if (nevents && dt > maxwait) {
-		    if (dpy) {	/* raw_fb hack */
-			if (mask < 0) {
-				if (debug_pointer) {
-					rfbLog("pointer(): calling XFlush "
-					    "%.4f\n", dnowx());
-				}
-				X_LOCK;
-				XFlush_wr(dpy);	
-				X_UNLOCK;
-			}
-		    }
-		}
-		nevents = 0;	/* reset everything */
-		dt = 0.0;
-		dtime0(&tmr);
-
-		POINTER_UNLOCK;
-	}
-	if (mask < 0) {		/* -1 just means flush the event queue */
-		if (debug_pointer) {
-			rfbLog("pointer(): flush only.  %.4f\n",
-			    dnowx());
-		}
-		INPUT_UNLOCK;
-		return;
-	}
-
-	/* update the X display with the event: */
-	if (input.motion) {
-		update_x11_pointer_position(x, y);
-		sent = 1;
-	}
-	if (input.button) {
-		if (mask != button_mask) {
-			button_change_x = cursor_x;
-			button_change_y = cursor_y;
-		}
-		update_x11_pointer_mask(mask);
-		sent = 1;
-	}
-
-	if (! dpy) {
-		;
-	} else if (nofb && sent) {
-		/* 
-		 * nofb is for, e.g. Win2VNC, where fastest pointer
-		 * updates are desired.
-		 */
-		X_LOCK;
-		XFlush_wr(dpy);
-		X_UNLOCK;
-	} else if (buffer_it) {
-		if (debug_pointer) {
-			rfbLog("pointer(): calling XFlush+"
-			    "%.4f\n", dnowx());
-		}
-		X_LOCK;
-		XFlush_wr(dpy);	
-		X_UNLOCK;
-	}
-	INPUT_UNLOCK;
-}
-
-void initialize_pipeinput(void) {
-	char *p = NULL;
-
-	if (pipeinput_fh != NULL) {
-		rfbLog("closing pipeinput stream: %p\n", pipeinput_fh);
-		pclose(pipeinput_fh);
-		pipeinput_fh = NULL;
-	}
-
-	pipeinput_tee = 0;
-	if (pipeinput_opts) {
-		free(pipeinput_opts);
-		pipeinput_opts = NULL;
-	}
-
-	if (! pipeinput_str) {
-		return;
-	}
-
-	/* look for options:  tee, reopen, ... */
-	if (strstr(pipeinput_str, "UINPUT") == pipeinput_str) {
-		;
-	} else {
-		p = strchr(pipeinput_str, ':');
-	}
-	if (p != NULL) {
-		char *str, *opt, *q;
-		int got = 0;
-		*p = '\0';
-		str = strdup(pipeinput_str);
-		opt = strdup(pipeinput_str);
-		*p = ':';
-		q = strtok(str, ",");
-		while (q) {
-			if (!strcmp(q, "key") || !strcmp(q, "keycodes")) {
-				got = 1;
-			}
-			if (!strcmp(q, "reopen")) {
-				got = 1;
-			}
-			if (!strcmp(q, "tee")) {
-				pipeinput_tee = 1;
-				got = 1;
-			}
-			q = strtok(NULL, ",");
-		}
-		if (got) {
-			pipeinput_opts = opt;
-		} else {
-			free(opt);
-		}
-		free(str);
-		p++;
-	} else {
-		p = pipeinput_str;
-	}
-if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
-
-	if (!strcmp(p, "VID")) {
-		pipeinput_int = PIPEINPUT_VID;
-		return;
-	} else if (strstr(p, "CONSOLE") == p) {
-		int tty = 0, n;
-		char dev[32];
-		if (sscanf(p, "CONSOLE%d", &n) == 1) {
-			tty = n;
-		}
-		sprintf(dev, "/dev/tty%d", tty);
-		pipeinput_cons_fd = open(dev, O_WRONLY);
-		if (pipeinput_cons_fd >= 0) {
-			rfbLog("pipeinput: using linux console: %s\n", dev);
-			if (pipeinput_cons_dev) {
-				free(pipeinput_cons_dev);
-			}
-			pipeinput_cons_dev = strdup(dev);
-			pipeinput_int = PIPEINPUT_CONSOLE;
-		} else {
-			rfbLog("pipeinput: could not open: %s\n", dev);
-			rfbLogPerror("open");
-			rfbLog("You may need to be root to open %s.\n", dev);
-			rfbLog("\n");
-		}
-		return;
-	} else if (strstr(p, "UINPUT") == p) {
-		char *q = strchr(p, ':');
-		if (q) {
-			parse_uinput_str(q+1);
-		}
-		pipeinput_int = PIPEINPUT_UINPUT;
-		initialize_uinput();
-		return;
-	} else if (strstr(p, "MACOSX") == p) {
-		pipeinput_int = PIPEINPUT_MACOSX;
-		return;
-	} else if (strstr(p, "VNC") == p) {
-		pipeinput_int = PIPEINPUT_VNC;
-		return;
-	}
-
-	set_child_info();
-	/* pipeinput */
-	if (no_external_cmds || !cmd_ok("pipeinput")) {
-		rfbLogEnable(1);
-		rfbLog("cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", p);
-		rfbLog("   exiting.\n");
-		clean_up_exit(1);
-	}
-	rfbLog("pipeinput: starting: \"%s\"...\n", p);
-	close_exec_fds();
-	pipeinput_fh = popen(p, "w");
-
-	if (! pipeinput_fh) {
-		rfbLog("popen(\"%s\", \"w\") failed.\n", p);
-		rfbLogPerror("popen");
-		rfbLog("Disabling -pipeinput mode.\n");
-		return;
-	}
-
-	fprintf(pipeinput_fh, "%s",
-"# \n"
-"# Format of the -pipeinput stream:\n"
-"# --------------------------------\n"
-"#\n"
-"# Lines like these beginning with '#' are to be ignored.\n"
-"#\n"
-"# Pointer events (mouse motion and button clicks) come in the form:\n"
-"#\n"
-"#\n"
-"# Pointer <client#> <x> <y> <mask> <hint>\n"
-"#\n"
-"#\n"
-"# The <client#> is a decimal integer uniquely identifying the client\n"
-"# that generated the event.  If it is negative that means this event\n"
-"# would have been discarded since the client was viewonly.\n"
-"#\n"
-"# <x> and <y> are decimal integers reflecting the position on the screen\n"
-"# the event took place at.\n"
-"#\n"
-"# <mask> is the button mask indicating the button press state, as normal\n"
-"# 0 means no buttons pressed, 1 means button 1 is down 3 (11) means buttons\n"
-"# 1 and 2 are down, etc.\n"
-"#\n"
-"# <hint> is a string containing no spaces and may be ignored.\n"
-"# It contains some interpretation about what has happened.\n"
-"# It can be:\n"
-"#\n"
-"#	None		(nothing to report)\n"
-"#	ButtonPress-N	(this event will cause button-N to be pressed) \n"
-"#	ButtonRelease-N	(this event will cause button-N to be released) \n"
-"#\n"
-"# if two more more buttons change state in one event they are listed\n"
-"# separated by commas.\n"
-"#\n"
-"# One might parse a Pointer line with:\n"
-"#\n"
-"# int client, x, y, mask; char hint[100];\n"
-"# sscanf(line, \"Pointer %d %d %d %d %s\", &client, &x, &y, &mask, hint);\n"
-"#\n"
-"#\n"
-"# Keysym events (keyboard presses and releases) come in the form:\n"
-"#\n"
-"#\n"
-"# Keysym <client#> <down> <keysym#> <keysym-name> <hint>\n"
-"#\n"
-"#\n"
-"# The <client#> is as with Pointer.\n"
-"#\n"
-"# <down> is a decimal either 1 or 0 indicating KeyPress or KeyRelease,\n"
-"# respectively.\n"
-"#\n"
-"# <keysym#> is a decimal integer incidating the Keysym of the event.\n"
-"#\n"
-"# <keysym-name> is the corresponding Keysym name.\n"
-"#\n"
-"# See the file /usr/include/X11/keysymdef.h for the mappings.\n"
-"# You basically remove the leading 'XK_' prefix from the macro name in\n"
-"# that file to get the Keysym name.\n"
-"#\n"
-"# One might parse a Keysym line with:\n"
-"#\n"
-"# int client, down, keysym; char name[100], hint[100];\n"
-"# sscanf(line, \"Keysym %d %d %d %s %s\", &client, &down, &keysym, name, hint);\n"
-"#\n"
-"# The <hint> value is currently just None, KeyPress, or KeyRelease.\n"
-"#\n"
-"# In the future <hint> will provide a hint for the sequence of KeyCodes\n"
-"# (i.e. keyboard scancodes) that x11vnc would inject to an X display to\n"
-"# simulate the Keysym.\n"
-"#\n"
-"# You see, some Keysyms will require more than one injected Keycode to\n"
-"# generate the symbol.  E.g. the Keysym \"ampersand\" going down usually\n"
-"# requires a Shift key going down, then the key with the \"&\" on it going\n"
-"# down, and, perhaps, the Shift key going up (that is how x11vnc does it).\n"
-"#\n"
-"# The Keysym => Keycode(s) stuff gets pretty messy.  Hopefully the Keysym\n"
-"# info will be enough for most purposes (having identical keyboards on\n"
-"# both sides helps).\n"
-"#\n"
-"# Parsing example for perl:\n"
-"#\n"
-"# while (<>) {\n"
-"#     chomp;\n"
-"#     if (/^Pointer/) {\n"
-"#         my ($p, $client, $x, $y, $mask, $hint) = split(' ', $_, 6);\n"
-"#         do_pointer($client, $x, $y, $mask, $hint);\n"
-"#     } elsif (/^Keysym/) {\n"
-"#         my ($k, $client, $down, $keysym, $name, $hint) = split(' ', $_, 6);\n"
-"#         do_keysym($client, $down, $keysym, $name, $hint);\n"
-"#     }\n"
-"# }\n"
-"#\n"
-"#\n"
-"# Here comes your stream.  The following token will always indicate the\n"
-"# end of this informational text:\n"
-"# END_OF_TOP\n"
-);
-	fflush(pipeinput_fh);
-	if (raw_fb_str) {
-		/* the pipe program may actually create the fb */
-		sleep(1);
-	}
-}
-
-int check_pipeinput(void) {
-	if (! pipeinput_fh) {
-		return 1;
-	}
-	if (ferror(pipeinput_fh)) {
-		rfbLog("pipeinput pipe has ferror. %p\n", pipeinput_fh);
-		
-		if (pipeinput_opts && strstr(pipeinput_opts, "reopen")) {
-			rfbLog("restarting -pipeinput pipe...\n");
-			initialize_pipeinput();
-			if (pipeinput_fh) {
-				return 1;
-			} else {
-				return 0;
-			}
-		} else {
-			rfbLog("closing -pipeinput pipe...\n");
-			pclose(pipeinput_fh);
-			pipeinput_fh = NULL;
-			return 0;
-		}
-	}
-	return 1;
-}
-
-
diff --git a/ica/x11/x11vnc/pointer.h b/ica/x11/x11vnc/pointer.h
deleted file mode 100644
index 1fe5e0b..0000000
--- a/ica/x11/x11vnc/pointer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_POINTER_H
-#define _X11VNC_POINTER_H
-
-/* -- pointer.h -- */
-
-extern int pointer_queued_sent;
-
-extern void initialize_pointer_map(char *pointer_remap);
-extern void do_button_mask_change(int mask, int button);
-extern void pointer_event(int mask, int x, int y, rfbClientPtr client);
-extern int check_pipeinput(void);
-extern void initialize_pipeinput(void);
-extern void update_x11_pointer_position(int x, int y);
-
-#endif /* _X11VNC_POINTER_H */
diff --git a/ica/x11/x11vnc/rates.c b/ica/x11/x11vnc/rates.c
deleted file mode 100644
index ee9ca05..0000000
--- a/ica/x11/x11vnc/rates.c
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- rates.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "scan.h"
-
-int measure_speeds = 1;
-int speeds_net_rate = 0;
-int speeds_net_rate_measured = 0;
-int speeds_net_latency = 0;
-int speeds_net_latency_measured = 0;
-int speeds_read_rate = 0;
-int speeds_read_rate_measured = 0;
-
-
-int get_cmp_rate(void);
-int get_raw_rate(void);
-void initialize_speeds(void);
-int get_read_rate(void);
-int link_rate(int *latency, int *netrate);
-int get_net_rate(void);
-int get_net_latency(void);
-void measure_send_rates(int init);
-
-
-static void measure_display_hook(rfbClientPtr cl);
-static int get_rate(int which);
-static int get_latency(void);
-
-
-static void measure_display_hook(rfbClientPtr cl) {
-	ClientData *cd = (ClientData *) cl->clientData;
-	if (! cd) {
-		return;
-	}
-	dtime0(&cd->timer);
-}
-
-static int get_rate(int which) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int irate, irate_min = 1;	/* 1 KB/sec */
-	int irate_max = 100000;		/* 100 MB/sec */
-	int count = 0;
-	double slowest = -1.0, rate;
-	static double save_rate = 1000 * NETRATE0;
-
-	if (!screen) {
-		return 0;
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd = (ClientData *) cl->clientData;
-
-		if (! cd) {
-			continue;
-		}
-		if (cl->state != RFB_NORMAL) {
-			continue;
-		}
-		if (cd->send_cmp_rate == 0.0 || cd->send_raw_rate == 0.0) {
-			continue;
-		}
-		count++;
-		
-		if (which == 0) {
-			rate = cd->send_cmp_rate;
-		} else {
-			rate = cd->send_raw_rate;
-		}
-		if (slowest == -1.0 || rate < slowest) {
-			slowest = rate;
-		}
-		
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (! count) {
-		return NETRATE0;
-	}
-
-	if (slowest == -1.0) {
-		slowest = save_rate;
-	} else {
-		save_rate = slowest;
-	}
-
-	irate = (int) (slowest/1000.0);
-	if (irate < irate_min) {
-		irate = irate_min;
-	}
-	if (irate > irate_max) {
-		irate = irate_max;
-	}
-if (0) fprintf(stderr, "get_rate(%d) %d %.3f/%.3f\n", which, irate, save_rate, slowest); 
-
-	return irate;
-}
-
-static int get_latency(void) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int ilat, ilat_min = 1;	/* 1 ms */
-	int ilat_max = 2000;	/* 2 sec */
-	double slowest = -1.0, lat;
-	static double save_lat = ((double) LATENCY0)/1000.0;
-	int count = 0;
-	
-	if (!screen) {
-		return 0;
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd = (ClientData *) cl->clientData;
-		
-		if (! cd) {
-			continue;
-		}
-		if (cl->state != RFB_NORMAL) {
-			continue;
-		}
-		if (cd->latency == 0.0) {
-			continue;
-		}
-		count++;
-
-		lat = cd->latency;
-		if (slowest == -1.0 || lat > slowest) {
-			slowest = lat;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (! count) {
-		return LATENCY0;
-	}
-
-	if (slowest == -1.0) {
-		slowest = save_lat;
-	} else {
-		save_lat = slowest;
-	}
-
-	ilat = (int) (slowest * 1000.0);
-	if (ilat < ilat_min) {
-		ilat = ilat_min;
-	}
-	if (ilat > ilat_max) {
-		ilat = ilat_max;
-	}
-
-	return ilat;
-}
-
-int get_cmp_rate(void) {
-	return get_rate(0);
-}
-
-int get_raw_rate(void) {
-	return get_rate(1);
-}
-
-void initialize_speeds(void) {
-	char *s, *s_in, *p;
-	int i;
-
-	speeds_read_rate = 0;
-	speeds_net_rate = 0;
-	speeds_net_latency = 0;
-	if (! speeds_str || *speeds_str == '\0') {
-		s_in = strdup("");
-	} else {
-		s_in = strdup(speeds_str);
-	}
-
-	if (!strcmp(s_in, "modem")) {
-		s = strdup("6,4,200");
-	} else if (!strcmp(s_in, "dsl")) {
-		s = strdup("6,100,50");
-	} else if (!strcmp(s_in, "lan")) {
-		s = strdup("6,5000,1");
-	} else {
-		s = strdup(s_in);
-	}
-
-	p = strtok(s, ",");
-	i = 0;
-	while (p) {
-		double val;
-		if (*p != '\0') {
-			val = atof(p);
-			if (i==0) {
-				speeds_read_rate = (int) 1000000 * val;
-			} else if (i==1) {
-				speeds_net_rate = (int) 1000 * val;
-			} else if (i==2) {
-				speeds_net_latency = (int) val;
-			}
-		}
-		i++;
-		p = strtok(NULL, ",");
-	}
-	free(s);
-	free(s_in);
-
-	if (! speeds_read_rate) {
-		int n = 0;
-		double dt, timer;
-#ifdef MACOSX
-		if (macosx_console && macosx_read_opengl && fullscreen) {
-			copy_image(fullscreen, 0, 0, 0, 0);
-			usleep(10 * 1000);
-		}
-#endif
-
-		dtime0(&timer);
-		if (fullscreen) {
-			copy_image(fullscreen, 0, 0, 0, 0);
-			n = fullscreen->bytes_per_line * fullscreen->height;
-		} else if (scanline) {
-			copy_image(scanline, 0, 0, 0, 0);
-			n = scanline->bytes_per_line * scanline->height;
-		}
-		dt = dtime(&timer);
-		if (n && dt > 0.0) {
-			double rate = ((double) n) / dt;
-			speeds_read_rate_measured = (int) (rate/1000000.0);
-			if (speeds_read_rate_measured < 1) {
-				speeds_read_rate_measured = 1;
-			} else {
-				rfbLog("fb read rate: %d MB/sec\n",
-				    speeds_read_rate_measured);
-			}
-		}
-	}
-}
-
-int get_read_rate(void) {
-	if (speeds_read_rate) {
-		return speeds_read_rate;
-	}
-	if (speeds_read_rate_measured) {
-		return speeds_read_rate_measured;
-	}
-	return 0;
-}
-
-int link_rate(int *latency, int *netrate) {
-	*latency = get_net_latency();
-	*netrate = get_net_rate();
-
-	if (speeds_str) {
-		if (!strcmp(speeds_str, "modem")) {
-			return LR_DIALUP;
-		} else if (!strcmp(speeds_str, "dsl")) {
-			return LR_BROADBAND;
-		} else if (!strcmp(speeds_str, "lan")) {
-			return LR_LAN;
-		}
-	}
-
-	if (*latency == LATENCY0 && *netrate == NETRATE0)  {
-		return LR_UNSET;
-	} else if (*latency > 150 || *netrate < 20) {
-		return LR_DIALUP;
-	} else if (*latency > 50 || *netrate < 150) {
-		return LR_BROADBAND;
-	} else if (*latency < 10 && *netrate > 300) {
-		return LR_LAN;
-	} else {
-		return LR_UNKNOWN;
-	}
-}
-
-int get_net_rate(void) {
-	int spm = speeds_net_rate_measured;
-	if (speeds_net_rate) {
-		return speeds_net_rate;
-	}
-	if (! spm || spm == NETRATE0) {
-		speeds_net_rate_measured = get_cmp_rate();
-	}
-	if (speeds_net_rate_measured) {
-		return speeds_net_rate_measured;
-	}
-	return 0;
-}
-
-int get_net_latency(void) {
-	int spm = speeds_net_latency_measured;
-	if (speeds_net_latency) {
-		return speeds_net_latency;
-	}
-	if (! spm || spm == LATENCY0) {
-		speeds_net_latency_measured = get_latency();
-	}
-	if (speeds_net_latency_measured) {
-		return speeds_net_latency_measured;
-	}
-	return 0;
-}
-
-void measure_send_rates(int init) {
-	double cmp_rate, raw_rate;
-	static double now, start = 0.0;
-	static rfbDisplayHookPtr orig_display_hook = NULL;
-	double cmp_max = 1.0e+08;	/* 100 MB/sec */
-	double cmp_min = 1000.0;	/* 9600baud */
-	double lat_max = 5.0;		/* 5 sec */
-	double lat_min = .0005;		/* 0.5 ms */
-	int min_cmp = 10000, nclients;
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl0, cl;
-	int msg = 0, clcnt0 = 0, cc;
-	int db = 0, ouch_db = 0, ouch = 0;
-
-	if (! measure_speeds) {
-		return;
-	}
-	if (speeds_net_rate && speeds_net_latency) {
-		return;
-	}
-	if (!client_count) {
-		return;
-	}
-
-	if (! orig_display_hook) {
-		orig_display_hook = screen->displayHook;
-	}
-
-	if (start == 0.0) {
-		dtime(&start);
-	}
-
-	dtime0(&now);
-	if (now < last_client_gone+4.0) {
-		return;
-	}
-	now = now - start;
-
-	nclients = 0;
-
-	if (!screen) {
-		return;
-	}
-
-	cl0 = NULL;
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		ClientData *cd = (ClientData *) cl->clientData;
-
-		if (! cd) {
-			continue;
-		}
-		if (cd->send_cmp_rate > 0.0) {
-			continue;
-		}
-		if (cl->onHold) {
-			continue;
-		}
-		nclients++;
-		if (cl0 == NULL)  {
-			cl0 = cl;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	cl = cl0;
-	cc = 0;
-
-	while (cl != NULL && cc++ == 0) {
-		int defer, i, cbs, rbs;
-		char *httpdir;
-		double dt, dt1 = 0.0, dt2, dt3;
-		double tm, spin_max = 15.0, spin_lat_max = 1.5;
-		int got_t2 = 0, got_t3 = 0;
-		ClientData *cd = (ClientData *) cl->clientData;
-
-#if 0
-		for (i=0; i<MAX_ENCODINGS; i++) {
-			cbs += cl->bytesSent[i];
-		}
-		rbs = cl->rawBytesEquivalent;
-#else
-#if LIBVNCSERVER_HAS_STATS
-		cbs = rfbStatGetSentBytes(cl);
-		rbs = rfbStatGetSentBytesIfRaw(cl);
-#endif
-#endif
-
-		if (init) {
-
-if (db) fprintf(stderr, "%d client num rects req: %d  mod: %d  cbs: %d  "
-    "rbs: %d  dt1: %.3f  t: %.3f\n", init,
-    (int) sraRgnCountRects(cl->requestedRegion),
-    (int) sraRgnCountRects(cl->modifiedRegion), cbs, rbs, dt1, now);
-
-			cd->timer = dnow();
-			cd->cmp_bytes_sent = cbs;
-			cd->raw_bytes_sent = rbs;
-			continue;
-		}
-
-		/* first part of the bulk transfer of initial screen */
-		dt1 = dtime(&cd->timer);
-
-if (db) fprintf(stderr, "%d client num rects req: %d  mod: %d  cbs: %d  "
-    "rbs: %d  dt1: %.3f  t: %.3f\n", init,
-    (int) sraRgnCountRects(cl->requestedRegion),
-    (int) sraRgnCountRects(cl->modifiedRegion), cbs, rbs, dt1, now);
-
-		if (dt1 <= 0.0) {
-			continue;
-		}
-
-		cbs = cbs - cd->cmp_bytes_sent;
-		rbs = rbs - cd->raw_bytes_sent;
-
-		if (cbs < min_cmp) {
-			continue;
-		}
-
-		if (ouch_db) fprintf(stderr, "START-OUCH: %d\n", client_count);
-		clcnt0 = client_count;
-#define OUCH ( ouch || (ouch = (!client_count || client_count != clcnt0 || dnow() < last_client_gone+4.0)) )
-
-		rfbPE(1000);
-		if (OUCH && ouch_db) fprintf(stderr, "***OUCH-A\n");
-		if (OUCH) continue;
-
-		if (use_threads) LOCK(cl->updateMutex);
-
-		if (sraRgnCountRects(cl->modifiedRegion)) {
-			rfbPE(1000);
-			if (OUCH && ouch_db) fprintf(stderr, "***OUCH-B\n");
-			if (use_threads) UNLOCK(cl->updateMutex);
-			if (OUCH) continue;
-		}
-
-		if (use_threads) UNLOCK(cl->updateMutex);
-
-		defer = screen->deferUpdateTime;
-		httpdir = screen->httpDir;
-		screen->deferUpdateTime = 0;
-		screen->httpDir = NULL;
-
-		/* mark a small rectangle: */
-		mark_rect_as_modified(0, 0, 16, 16, 1);
-
-		dtime0(&tm);
-
-		dt2 = 0.0;
-		dt3 = 0.0;
-
-		if (dt1 < 0.25) {
-			/* try to cut it down to avoid long pauses. */
-			spin_max = 5.0;
-		}
-
-		/* when req1 = 1 mod1 == 0, end of 2nd part of bulk transfer */
-		while (1) {
-			int req0, req1, mod0, mod1;
-
-			if (OUCH && ouch_db) fprintf(stderr, "***OUCH-C1\n");
-			if (OUCH) break;
-
-			if (use_threads) LOCK(cl->updateMutex);
-
-			req0 = sraRgnCountRects(cl->requestedRegion);
-			mod0 = sraRgnCountRects(cl->modifiedRegion);
-
-			if (use_threads) UNLOCK(cl->updateMutex);
-
-			if (use_threads) {
-				usleep(1000);
-			} else {
-				if (mod0) {
-					rfbPE(1000);
-				} else {
-					rfbCFD(1000);
-				}
-			}
-			dt = dtime(&tm);
-			dt2 += dt;
-			if (dt2 > spin_max) {
-				break;
-			}
-
-			if (OUCH && ouch_db) fprintf(stderr, "***OUCH-C2\n");
-			if (OUCH) break;
-
-			if (use_threads) LOCK(cl->updateMutex);
-
-			req1 = sraRgnCountRects(cl->requestedRegion);
-			mod1 = sraRgnCountRects(cl->modifiedRegion);
-
-			if (use_threads) UNLOCK(cl->updateMutex);
-
-if (db) fprintf(stderr, "dt2 calc: num rects req: %d/%d mod: %d/%d  "
-    "fbu-sent: %d  dt: %.4f dt2: %.4f  tm: %.4f\n",
-    req0, req1, mod0, mod1,
-#if 0
-    cl->framebufferUpdateMessagesSent,
-#else
-#if LIBVNCSERVER_HAS_STATS
-    rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate),
-#endif
-#endif
-    dt, dt2, tm);
-			if (req1 != 0 && mod1 == 0) {
-				got_t2 = 1;
-				break;
-			}
-		}
-		if (OUCH && ouch_db) fprintf(stderr, "***OUCH-D\n");
-		if (OUCH) goto ouch;
-
-		if (! got_t2) {
-			dt2 = 0.0;
-		} else {
-			int tr, trm = 3;
-			double dts[10];
-			
-			/*
-			 * Note: since often select(2) cannot sleep
-			 * less than 1/HZ (e.g. 10ms), the resolution
-			 * of the latency may be messed up by something
-			 * of this order.  Effect may occur on both ends,
-			 * i.e. the viewer may not respond immediately.
-			 */
-		
-			for (tr = 0; tr < trm; tr++) {
-				usleep(5000);
-
-				/* mark a 2nd small rectangle: */
-				mark_rect_as_modified(0, 0, 16, 16, 1);
-				i = 0;
-				dtime0(&tm);
-				dt3 = 0.0;
-
-				/*
-				 * when req1 > 0 and mod1 == 0, we say
-				 * that is the "ping" time.
-				 */
-				while (1) {
-					int req0, req1, mod0, mod1;
-
-					if (use_threads) LOCK(cl->updateMutex);
-
-					req0 = sraRgnCountRects(cl->requestedRegion);
-					mod0 = sraRgnCountRects(cl->modifiedRegion);
-
-					if (use_threads) UNLOCK(cl->updateMutex);
-
-					if (i == 0) {
-						rfbPE(0);
-					} else {
-						if (use_threads) {
-							usleep(1000);
-						} else {
-							/* try to get it all */
-							rfbCFD(1000*1000);
-						}
-					}
-					if (OUCH && ouch_db) fprintf(stderr, "***OUCH-E\n");
-					if (OUCH) goto ouch;
-					dt = dtime(&tm);
-					i++;
-
-					dt3 += dt;
-					if (dt3 > spin_lat_max) {
-						break;
-					}
-
-					if (use_threads) LOCK(cl->updateMutex);
-
-					req1 = sraRgnCountRects(cl->requestedRegion);
-					mod1 = sraRgnCountRects(cl->modifiedRegion);
-
-					if (use_threads) UNLOCK(cl->updateMutex);
-
-if (db) fprintf(stderr, "dt3 calc: num rects req: %d/%d mod: %d/%d  "
-    "fbu-sent: %d  dt: %.4f dt3: %.4f  tm: %.4f\n",
-    req0, req1, mod0, mod1,
-#if 0
-    cl->framebufferUpdateMessagesSent,
-#else
-#if LIBVNCSERVER_HAS_STATS
-    rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate),
-#endif
-#endif
-    dt, dt3, tm);
-
-					if (req1 != 0 && mod1 == 0) {
-						dts[got_t3++] = dt3;
-						break;
-					}
-				}
-			}
-		
-			if (! got_t3) {
-				dt3 = 0.0;
-			} else {
-				if (got_t3 == 1) {
-					dt3 = dts[0];
-				} else if (got_t3 == 2) {
-					dt3 = dts[1];
-				} else {
-					if (dts[2] > 0.0) {
-						double rat = dts[1]/dts[2];
-						if (rat > 0.5 && rat < 2.0) {
-							dt3 = dts[1]+dts[2];
-							dt3 *= 0.5;
-						} else {
-							dt3 = dts[1];
-						}
-					} else {
-						dt3 = dts[1];
-					}
-				}
-			}
-		}
-
-		ouch:
-		
-		screen->deferUpdateTime = defer;
-		screen->httpDir = httpdir;
-
-		if (OUCH && ouch_db) fprintf(stderr, "***OUCH-F\n");
-		if (OUCH) break;
-
-		dt = dt1 + dt2;
-
-
-		if (dt3 <= dt2/2.0) {
-			/* guess only 1/2 a ping for reply... */
-			dt = dt - dt3/2.0;
-		}
-
-		cmp_rate = cbs/dt;
-		raw_rate = rbs/dt;
-
-		if (cmp_rate > cmp_max) {
-			cmp_rate = cmp_max;
-		}
-		if (cmp_rate <= cmp_min) {
-			cmp_rate = cmp_min;
-		}
-
-		cd->send_cmp_rate = cmp_rate;
-		cd->send_raw_rate = raw_rate;
-
-		if (dt3 > lat_max) {
-			dt3 = lat_max;
-		}
-		if (dt3 <= lat_min) {
-			dt3 = lat_min;
-		}
-
-		cd->latency = dt3;
-		
-		rfbLog("client %d network rate %.1f KB/sec (%.1f eff KB/sec)\n",
-		    cd->uid, cmp_rate/1000.0, raw_rate/1000.0);
-		rfbLog("client %d latency:  %.1f ms\n", cd->uid, 1000.0*dt3);
-		rfbLog("dt1: %.4f, dt2: %.4f dt3: %.4f bytes: %d\n",
-		    dt1, dt2, dt3, cbs);
-		msg = 1;
-	}
-
-	if (msg) {
-		int link, latency, netrate;
-		char *str = "error";
-
-		link = link_rate(&latency, &netrate);
-		if (link == LR_UNSET) {
-			str = "LR_UNSET";
-		} else if (link == LR_UNKNOWN) {
-			str = "LR_UNKNOWN";
-		} else if (link == LR_DIALUP) {
-			str = "LR_DIALUP";
-		} else if (link == LR_BROADBAND) {
-			str = "LR_BROADBAND";
-		} else if (link == LR_LAN) {
-			str = "LR_LAN";
-		}
-		rfbLog("link_rate: %s - %d ms, %d KB/s\n", str, latency,
-		    netrate);
-	}
-
-	if (init) {
-		if (nclients) {
-			screen->displayHook = measure_display_hook;
-		}
-	} else {
-		screen->displayHook = orig_display_hook;
-	}
-}
-
diff --git a/ica/x11/x11vnc/rates.h b/ica/x11/x11vnc/rates.h
deleted file mode 100644
index 3de8c4e..0000000
--- a/ica/x11/x11vnc/rates.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_RATES_H
-#define _X11VNC_RATES_H
-
-/* -- rates.h -- */
-
-extern int measure_speeds;
-extern int speeds_net_rate;
-extern int speeds_net_rate_measured;
-extern int speeds_net_latency;
-extern int speeds_net_latency_measured;
-extern int speeds_read_rate;
-extern int speeds_read_rate_measured;
-
-extern int get_cmp_rate(void);
-extern int get_raw_rate(void);
-extern void initialize_speeds(void);
-extern int get_read_rate(void);
-extern int link_rate(int *latency, int *netrate);
-extern int get_net_rate(void);
-extern int get_net_latency(void);
-extern void measure_send_rates(int init);
-
-#endif /* _X11VNC_RATES_H */
diff --git a/ica/x11/x11vnc/remote.c b/ica/x11/x11vnc/remote.c
deleted file mode 100644
index 3e9e5f8..0000000
--- a/ica/x11/x11vnc/remote.c
+++ /dev/null
@@ -1,6323 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- remote.c -- */
-
-#include "x11vnc.h"
-#include "inet.h"
-#include "xwrappers.h"
-#include "xevents.h"
-#include "xinerama.h"
-#include "xrandr.h"
-#include "xdamage.h"
-#include "xrecord.h"
-#include "xkb_bell.h"
-#include "win_utils.h"
-#include "screen.h"
-#include "cleanup.h"
-#include "gui.h"
-#include "solid.h"
-#include "user.h"
-#include "rates.h"
-#include "scan.h"
-#include "connections.h"
-#include "pointer.h"
-#include "cursor.h"
-#include "userinput.h"
-#include "keyboard.h"
-#include "selection.h"
-#include "unixpw.h"
-#include "uinput.h"
-#include "userinput.h"
-#include "avahi.h"
-#include "sslhelper.h"
-
-int send_remote_cmd(char *cmd, int query, int wait);
-int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync,
-    int qdefault);
-void check_black_fb(void);
-int check_httpdir(void);
-void http_connections(int on);
-int remote_control_access_ok(void);
-char *process_remote_cmd(char *cmd, int stringonly);
-
-
-static char *add_item(char *instr, char *item);
-static char *delete_item(char *instr, char *item);
-static void if_8bpp_do_new_fb(void);
-static void reset_httpport(int old, int newp);
-static void reset_rfbport(int old, int newp) ;
-
-char *query_result = NULL;
-
-/*
- * for the wild-n-crazy -remote/-R interface.
- */
-int send_remote_cmd(char *cmd, int query, int wait) {
-	FILE *in = NULL;
-
-	if (query_result != NULL) {
-		free(query_result);
-		query_result = NULL;
-	}
-
-	if (client_connect_file) {
-		umask(077);
-		in = fopen(client_connect_file, "w");
-		if (in == NULL) {
-			fprintf(stderr, "send_remote_cmd: could not open "
-			    "connect file \"%s\" for writing\n",
-			    client_connect_file);
-			perror("fopen");
-			return 1;
-		}
-	} else if (x11vnc_remote_prop == None) {
-		initialize_x11vnc_remote_prop();
-		if (x11vnc_remote_prop == None) {
-			fprintf(stderr, "send_remote_cmd: could not obtain "
-			    "X11VNC_REMOTE X property\n");
-			return 1;
-		}
-	}
-
-	if (in != NULL) {
-		fprintf(stderr, ">>> sending remote command: \"%s\"\n  via"
-		    " connect file: %s\n", cmd, client_connect_file);
-		fprintf(in, "%s\n", cmd);
-		fclose(in);
-	} else {
-		fprintf(stderr, ">>> sending remote command: \"%s\" via"
-		    " X11VNC_REMOTE X property.\n", cmd);
-		set_x11vnc_remote_prop(cmd);
-		if (dpy) {
-			XFlush_wr(dpy);
-		}
-	}
-
-	if (query || wait) {
-		char line[X11VNC_REMOTE_MAX];	
-		int rc=1, i=0, max=140, ms_sl=25;
-
-		if (!strcmp(cmd, "cmd=stop")) {
-			max = 40;
-		}
-		if (strstr(cmd, "script:")) {
-			max = 400;
-		}
-		if (strstr(cmd, "bcx_xattach:")) {
-			max = 400;
-		}
-		if (getenv("X11VNC_SYNC_TIMEOUT")) {
-			max = (int) ((1000. * atof(getenv("X11VNC_SYNC_TIMEOUT")))/ms_sl);
-		}
-		for (i=0; i<max; i++) {
-			if (i==0) {
-				usleep(10 * 1000);
-			} else {
-				usleep(ms_sl * 1000);
-			}
-			if (client_connect_file) {
-				char *q;
-				in = fopen(client_connect_file, "r");
-				if (in == NULL) {
-					fprintf(stderr, "send_remote_cmd: could"
-					    " not open connect file \"%s\" for"
-					    " writing\n", client_connect_file);
-					perror("fopen");
-					return 1;
-				}
-				fgets(line, X11VNC_REMOTE_MAX, in);
-				fclose(in);
-				q = line;
-				while (*q != '\0') {
-					if (*q == '\n') *q = '\0';
-					q++;
-				}
-			} else {
-				read_x11vnc_remote_prop(1);
-				strncpy(line, x11vnc_remote_str,
-				    X11VNC_REMOTE_MAX);
-			}
-			if (strcmp(cmd, line)) {
-				if (query || wait) {
-					query_result = strdup(line);
-					fprintf(stdout, "%s\n", line);
-					fflush(stdout);
-				}
-				rc = 0;
-				break;
-			}
-		}
-		if (rc) {
-			fprintf(stderr, "error: could not connect to "
-			    "an x11vnc server at %s  (rc=%d)\n",
-			    client_connect_file ? client_connect_file
-			    : DisplayString(dpy), rc);
-		}
-		return rc;
-	}
-	return 0;
-}
-
-int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync,
-    int qdefault) {
-	char *rcmd = NULL, *qcmd = NULL;
-	int rc = 1, direct = 0;
-
-	if (qdefault && !query_cmd) {
-		query_cmd = remote_cmd;
-		remote_cmd = NULL;
-	}
-	if (remote_cmd && strstr(remote_cmd, "DIRECT:") == remote_cmd) {
-		direct = 1;
-		remote_cmd += strlen("DIRECT:");
-	}
-	if (query_cmd && strstr(query_cmd, "DIRECT:") == query_cmd) {
-		direct = 1;
-		query_cmd += strlen("DIRECT:");
-	}
-
-	if (remote_cmd) {
-		rcmd = (char *) malloc(strlen(remote_cmd) + 5);
-		strcpy(rcmd, "cmd=");
-		strcat(rcmd, remote_cmd);
-	}
-	if (query_cmd) {
-		qcmd = (char *) malloc(strlen(query_cmd) + 5);
-		strcpy(qcmd, "qry=");
-		strcat(qcmd, query_cmd);
-	}
-	if (direct) {
-		char *res;
-		if (rcmd) {
-			res = process_remote_cmd(rcmd, 1);
-			fprintf(stdout, "%s\n", res);
-		}
-		if (qcmd) {
-			res = process_remote_cmd(qcmd, 1);
-			fprintf(stdout, "%s\n", res);
-		}
-		fflush(stdout);
-		return 0;
-	}
-	if (qdefault) {
-		char *res;
-		if (!qcmd) {
-			return 1;
-		}
-		res = process_remote_cmd(qcmd, 1);
-		fprintf(stdout, "%s\n", res);
-		fflush(stdout);
-		return 0;
-	}
-	
-	if (rcmd && qcmd) {
-		rc = send_remote_cmd(rcmd, 0, 1);
-		if (rc) {
-			free(rcmd);
-			free(qcmd);
-			return(rc);
-		}
-		rc = send_remote_cmd(qcmd, 1, 1);
-	} else if (rcmd) {
-		rc = send_remote_cmd(rcmd, 0, remote_sync);
-		free(rcmd);
-	} else if (qcmd) {
-		rc = send_remote_cmd(qcmd, 1, 1);
-		free(qcmd);
-	}
-	return rc;
-}
-
-static char *add_item(char *instr, char *item) {
-	char *p, *str;
-	int len, saw_item = 0;
-
-	if (! instr || *instr == '\0') {
-		str = strdup(item);
-		return str;
-	}
-	len = strlen(instr) + 1 + strlen(item) + 1;
-	str = (char *) malloc(len);
-	str[0] = '\0';
-
-	/* n.b. instr will be modified; caller replaces with returned string */
-	p = strtok(instr, ",");
-	while (p) {
-		if (!strcmp(p, item)) {
-			if (saw_item) {
-				p = strtok(NULL, ",");
-				continue;
-			}
-			saw_item = 1;
-		} else if (*p == '\0') {
-			p = strtok(NULL, ",");
-			continue;
-		}
-		if (str[0]) {
-			strcat(str, ",");
-		}
-		strcat(str, p);
-		p = strtok(NULL, ",");
-	}
-	if (! saw_item) {
-		if (str[0]) {
-			strcat(str, ",");
-		}
-		strcat(str, item);
-	}
-	return str;
-}
-
-static char *delete_item(char *instr, char *item) {
-	char *p, *str;
-	int len;
-
-	if (! instr || *instr == '\0') {
-		str = strdup("");
-		return str;
-	}
-	len = strlen(instr) + 1;
-	str = (char *) malloc(len);
-	str[0] = '\0';
-
-	/* n.b. instr will be modified; caller replaces with returned string */
-	p = strtok(instr, ",");
-	while (p) {
-		if (!strcmp(p, item) || *p == '\0') {
-			p = strtok(NULL, ",");
-			continue;
-		}
-		if (str[0]) {
-			strcat(str, ",");
-		}
-		strcat(str, p);
-		p = strtok(NULL, ",");
-	}
-	return str;
-}
-
-static void if_8bpp_do_new_fb(void) {
-	if (bpp == 8) {
-		do_new_fb(0);
-	} else {
-		rfbLog("  bpp(%d) is not 8bpp, not resetting fb\n", bpp);
-	}
-}
-
-void check_black_fb(void) {
-	if (!screen) {
-		return;
-	}
-	if (new_fb_size_clients(screen) != client_count) {
-		rfbLog("trying to send a black fb for non-newfbsize"
-		    " clients %d != %d\n", client_count,
-		    new_fb_size_clients(screen));
-		push_black_screen(4);
-	}
-}
-
-int check_httpdir(void) {
-	if (http_dir && http_dir[0] != '\0') {
-		return 1;
-	} else {
-		char *prog = NULL, *httpdir, *q;
-		struct stat sbuf;
-		int len;
-
-		rfbLog("check_httpdir: trying to guess httpdir... %s\n", program_name);
-		if (program_name[0] == '/') {
-			prog = strdup(program_name);
-		} else {
-			char cwd[1024];
-			getcwd(cwd, 1024);
-			len = strlen(cwd) + 1 + strlen(program_name) + 1;
-			prog = (char *) malloc(len);
-			snprintf(prog, len, "%s/%s", cwd, program_name);
-			if (stat(prog, &sbuf) != 0) {
-				char *path = strdup(getenv("PATH"));
-				char *p, *base;
-				base = strrchr(program_name, '/');
-				if (base) {
-					base++;
-				} else {
-					base = program_name;
-				}
-				
-				p = strtok(path, ":");
-				while(p) {
-					if (prog) {
-						free(prog);
-						prog = NULL;
-					}
-					len = strlen(p) + 1 + strlen(base) + 1;
-					prog = (char *) malloc(len);
-					snprintf(prog, len, "%s/%s", p, base);
-					if (stat(prog, &sbuf) == 0) {
-						break;
-					}
-					p = strtok(NULL, ":");
-				}
-				free(path);
-			}
-		}
-		/*
-		 * /path/to/bin/x11vnc
-		 * /path/to/bin/../share/x11vnc/classes
-		 *                    12345678901234567
-		 * /path/to/bin/../share/x11vnc/classes/ssl
-		 *                    123456789012345678901
-		 *                                        21
-		 */
-		if ((q = strrchr(prog, '/')) == NULL) {
-			rfbLog("check_httpdir: bad program path: %s\n", prog);
-			free(prog);
-			rfbLog("check_httpdir: *HTTP disabled*  Use -httpdir path\n");
-			return 0;
-		}
-
-		len = strlen(prog) + 21 + 1;
-		*q = '\0';
-		httpdir = (char *) malloc(len);
-		if (use_stunnel && http_ssl) {
-			snprintf(httpdir, len, "%s/../share/x11vnc/classes/ssl", prog);
-		} else if (!enc_str && (use_openssl || use_stunnel || http_ssl)) {
-			snprintf(httpdir, len, "%s/../share/x11vnc/classes/ssl", prog);
-		} else {
-			snprintf(httpdir, len, "%s/../share/x11vnc/classes", prog);
-		}
-		if (stat(httpdir, &sbuf) != 0) {
-			if (use_stunnel && http_ssl) {
-				snprintf(httpdir, len, "%s/../classes/ssl", prog);
-			} else if (!enc_str && (use_openssl || use_stunnel || http_ssl)) {
-				snprintf(httpdir, len, "%s/../classes/ssl", prog);
-			} else {
-				snprintf(httpdir, len, "%s/../classes", prog);
-			}
-		}
-		free(prog);
-
-		if (stat(httpdir, &sbuf) == 0) {
-			/* good enough for me */
-			rfbLog("check_httpdir: guessed directory:\n");
-			rfbLog("   %s\n", httpdir);
-			http_dir = httpdir;
-			return 1;
-		} else {
-			/* try some hardwires: */
-			int i;
-			char **use;
-			char *list[] = {
-				"/usr/local/share/x11vnc/classes",
-				"/usr/share/x11vnc/classes",
-				NULL
-			};
-			char *ssllist[] = {
-				"/usr/local/share/x11vnc/classes/ssl",
-				"/usr/share/x11vnc/classes/ssl",
-				NULL
-			};
-			if (use_stunnel && http_ssl) {
-				use = ssllist;
-			} else if (!enc_str && (use_openssl || use_stunnel || http_ssl)) {
-				use = ssllist;
-			} else {
-				use = list;
-			}
-			i = 0;
-			while (use[i] != NULL) {
-				if (stat(use[i], &sbuf) == 0) {
-					http_dir = strdup(use[i]);	
-					return 1;
-				}
-				i++;
-			}
-
-			rfbLog("check_httpdir: bad guess:\n");
-			rfbLog("   %s\n", httpdir);
-			rfbLog("check_httpdir: *HTTP disabled*  Use -httpdir path\n");
-			return 0;
-		}
-	}
-}
-
-static void rfb_http_init_sockets(void) {
-	in_addr_t iface;
-	if (!screen) {
-		return;
-	}
-	iface = screen->listenInterface;
-	if (getenv("X11VNC_HTTP_LISTEN_LOCALHOST")) {
-		rfbLog("http_connections: HTTP listen on localhost only. (not HTTPS)\n");
-		screen->listenInterface = htonl(INADDR_LOOPBACK);
-	}
-	rfbHttpInitSockets(screen);
-	if (noipv4 || getenv("IPV4_FAILS")) {
-		if (getenv("IPV4_FAILS")) {
-			rfbLog("TESTING: IPV4_FAILS for rfb_http_init_sockets()\n");
-		}
-		if (screen->httpListenSock > -1) {
-			close(screen->httpListenSock);
-			screen->httpListenSock = -1;
-		}
-	}
-	screen->listenInterface = iface;
-}
-
-void http_connections(int on) {
-	if (!screen) {
-		return;
-	}
-	if (on) {
-		rfbLog("http_connections: turning on http service.\n");
-
-		if (inetd && use_openssl) {
-			/*
-			 * try to work around rapid fire https requests
-			 * in inetd mode... ugh.
-			 */
-			if (screen->httpPort == 0) {
-				int port = find_free_port(5800, 5850);
-				if (port) {
-					/* mutex */
-					screen->httpPort = port;
-				}
-			}
-		}
-		screen->httpInitDone = FALSE;
-		if (check_httpdir()) {
-			int fd6 = -1;
-			char *save = listen_str6;
-
-			screen->httpDir = http_dir;
-
-			rfb_http_init_sockets();
-
-			if (getenv("X11VNC_HTTP_LISTEN_LOCALHOST")) {
-				listen_str6 = "localhost";
-			}
-
-			if (screen->httpPort != 0 && screen->httpListenSock < 0) {
-				rfbLog("http_connections: failed to listen on http port: %d\n", screen->httpPort);
-				if (ipv6_listen) {
-					fd6 = listen6(screen->httpPort);
-				}
-				if (fd6 < 0) {
-					clean_up_exit(1);
-				}
-				rfbLog("http_connections: trying IPv6 only mode.\n");
-			}
-			if (ipv6_listen && screen->httpPort > 0) {
-				if (fd6 < 0) {
-					fd6 = listen6(screen->httpPort);
-				}
-				ipv6_http_fd = fd6;
-				if (ipv6_http_fd >= 0) {
-					rfbLog("http_connections: Listening %s on IPv6 port %d (socket %d)\n",
-					    screen->httpListenSock < 0 ? "only" : "also",
-					    screen->httpPort, ipv6_http_fd);
-				}
-			}
-			listen_str6 = save;
-		}
-	} else {
-		rfbLog("http_connections: turning off http service.\n");
-		if (screen->httpListenSock > -1) {
-			close(screen->httpListenSock);
-			screen->httpListenSock = -1;
-		}
-		screen->httpDir = NULL;
-		if (ipv6_http_fd >= 0) {
-			close(ipv6_http_fd);
-			ipv6_http_fd = -1;
-		}
-	}
-}
-
-static void reset_httpport(int old, int newp) {
-	int hp = newp;
-
-	if (! screen->httpDir) {
-		return;
-	} else if (inetd) {
-		rfbLog("reset_httpport: cannot set httpport: %d in inetd.\n", hp);
-		return;
-	} else if (!screen) {
-		rfbLog("reset_httpport: no screen.\n");
-		return;
-	} else if (hp < 0) {
-		rfbLog("reset_httpport: invalid httpport: %d\n", hp);
-		return;
-	} else if (hp == old) {
-		rfbLog("reset_httpport: unchanged httpport: %d\n", hp);
-		return;
-	}
-
-	if (screen->httpListenSock > -1) {
-		close(screen->httpListenSock);
-		screen->httpListenSock = -1;
-	}
-
-	screen->httpPort = hp;
-	screen->httpInitDone = FALSE;
-
-	rfbLog("reset_httpport: setting httpport %d -> %d.\n",
-	    old == -1 ? hp : old, hp);
-
-	if (noipv4 || getenv("IPV4_FAILS")) {
-		if (getenv("IPV4_FAILS")) {
-			rfbLog("TESTING: IPV4_FAILS for reset_httpport()\n");
-		}
-	} else if (screen->httpPort == 0) {
-		;
-	} else {
-		rfb_http_init_sockets();
-	}
-
-	if (screen->httpPort != 0 && screen->httpListenSock < 0) {
-		rfbLog("reset_httpport: failed to listen on http port: %d\n",
-		    screen->httpPort);
-	}
-
-	if (ipv6_http_fd >= 0) {
-		close(ipv6_http_fd);
-		ipv6_http_fd = -1;
-	}
-	if (ipv6_listen && screen->httpPort > 0) {
-		ipv6_http_fd = listen6(screen->httpPort);
-		rfbLog("reset_httpport: ipv6_http_fd: %d  port: %d\n",
-		    ipv6_http_fd, screen->httpPort);
-	}
-}
-
-static void reset_rfbport(int old, int newp)  {
-	int rp = newp;
-
-	if (inetd) {
-		rfbLog("reset_rfbport: cannot set rfbport: %d in inetd.\n", rp);
-		return;
-	} else if (!screen) {
-		rfbLog("reset_rfbport: no screen.\n");
-		return;
-	} else if (rp < 0) {
-		rfbLog("reset_rfbport: invalid rfbport: %d\n", rp);
-		return;
-	} else if (rp == old) {
-		rfbLog("reset_rfbport: unchanged rfbport: %d\n", rp);
-		return;
-	}
-
-	rfbLog("reset_rfbport: setting rfbport %d -> %d.\n", old == -1 ? rp : old, rp);
-
-	screen->port = rp;
-
-	if (use_openssl) {
-		openssl_port(1);
-		if (openssl_sock < 0 && openssl_sock6 < 0) {
-			rfbLog("reset_rfbport: warning could not listen on port: %d\n",
-			    screen->port);
-		} else {
-			set_vnc_desktop_name();
-		}
-		if (https_port_num >= 0) {
-			https_port(1);
-		}
-		return;
-	}
-
-	if (screen->listenSock >= 0) {
-		FD_CLR(screen->listenSock, &(screen->allFds));
-		close(screen->listenSock);
-		screen->listenSock = -1;
-	}
-
-	if (noipv4 || getenv("IPV4_FAILS")) {
-		if (getenv("IPV4_FAILS")) {
-			rfbLog("TESTING: IPV4_FAILS for reset_rfbport()\n");
-		}
-	} else {
-		screen->listenSock = listen_tcp(screen->port, screen->listenInterface, 0);
-		if (screen->listenSock >= 0) {
-			if (screen->listenSock > screen->maxFd) {
-				screen->maxFd = screen->listenSock;
-			}
-			FD_SET(screen->listenSock, &(screen->allFds));
-		}
-	}
-
-	if (ipv6_listen_fd >= 0) {
-		close(ipv6_listen_fd);
-		ipv6_listen_fd = -1;
-	}
-	if (ipv6_listen && screen->port > 0) {
-		ipv6_listen_fd = listen6(screen->port);
-		rfbLog("reset_rfbport: ipv6_listen_fd: %d  port: %d\n",
-		    ipv6_listen_fd, screen->port);
-	}
-
-	if (screen->listenSock < 0 && ipv6_listen_fd < 0) {
-		rfbLog("reset_rfbport: warning could not listen on port: %d\n", screen->port);
-	} else {
-		set_vnc_desktop_name();
-	}
-}
-
-/*
- * Do some sanity checking of the permissions on the XAUTHORITY and the
- * -connect file.  This is -privremote.  What should be done is check
- * for an empty host access list, currently we lazily do not bring in
- * libXau yet.
- */
-int remote_control_access_ok(void) {
-#if NO_X11
-	return 0;
-#else
-	struct stat sbuf;
-
-	if (client_connect_file) {
-		if (stat(client_connect_file, &sbuf) == 0) {
-			if (sbuf.st_mode & S_IWOTH) {
-				rfbLog("connect file is writable by others.\n");
-				rfbLog("   %s\n", client_connect_file);
-				return 0;
-			}
-			if (sbuf.st_mode & S_IWGRP) {
-				rfbLog("connect file is writable by group.\n");
-				rfbLog("   %s\n", client_connect_file);
-				return 0;
-			}
-		}
-	}
-
-	if (dpy) {
-		char tmp[1000];
-		char *home, *xauth;
-		char *dpy_str = DisplayString(dpy);
-		Display *dpy2;
-		XHostAddress *xha;
-		Bool enabled;
-		int n;
-
-		home = get_home_dir();
-		if (getenv("XAUTHORITY") != NULL) {
-			xauth = getenv("XAUTHORITY");
-		} else if (home) {
-			int len = 1000 - strlen("/.Xauthority") - 1;
-			strncpy(tmp, home, len); 
-			strcat(tmp, "/.Xauthority");
-			xauth = tmp;
-		} else {
-			rfbLog("cannot determine default XAUTHORITY.\n");
-			return 0;
-		}
-		if (home) {
-			free(home);
-		}
-		if (stat(xauth, &sbuf) == 0) {
-			if (sbuf.st_mode & S_IWOTH) {
-				rfbLog("XAUTHORITY is writable by others!!\n");
-				rfbLog("   %s\n", xauth);
-				return 0;
-			}
-			if (sbuf.st_mode & S_IWGRP) {
-				rfbLog("XAUTHORITY is writable by group!!\n");
-				rfbLog("   %s\n", xauth);
-				return 0;
-			}
-			if (sbuf.st_mode & S_IROTH) {
-				rfbLog("XAUTHORITY is readable by others.\n");
-				rfbLog("   %s\n", xauth);
-				return 0;
-			}
-			if (sbuf.st_mode & S_IRGRP) {
-				rfbLog("XAUTHORITY is readable by group.\n");
-				rfbLog("   %s\n", xauth);
-				return 0;
-			}
-		}
-
-		X_LOCK;
-		xha = XListHosts(dpy, &n, &enabled);
-		X_UNLOCK;
-		if (! enabled) {
-			rfbLog("X access control is disabled, X clients can\n");
-			rfbLog("   connect from any host.  Run 'xhost -'\n");
-			return 0;
-		}
-		if (xha) {
-			int i;
-			rfbLog("The following hosts can connect w/o X11 "
-			    "auth:\n");
-			for (i=0; i<n; i++) {
-				if (xha[i].family == FamilyInternet) {
-					char *str = raw2host(xha[i].address,
-					    xha[i].length);
-					char *ip = raw2ip(xha[i].address);
-					rfbLog("  %s/%s\n", str, ip);
-					free(str);
-					free(ip);
-				} else {
-					rfbLog("  unknown-%d\n", i+1);
-				}
-			}
-			XFree_wr(xha);
-			return 0;
-		}
-
-		if (getenv("XAUTHORITY")) {
-			xauth = strdup(getenv("XAUTHORITY"));
-		} else {
-			xauth = NULL;
-		}
-		set_env("XAUTHORITY", "/impossible/xauthfile");
-
-		fprintf(stderr, "\nChecking if display %s requires "
-		    "XAUTHORITY\n", dpy_str);
-		fprintf(stderr, "   -- (ignore any Xlib: errors that"
-		    " follow) --\n");
-		dpy2 = XOpenDisplay_wr(dpy_str); 
-		fflush(stderr);
-		fprintf(stderr, "   -- (done checking) --\n\n");
-
-		if (xauth) {
-			set_env("XAUTHORITY", xauth);
-			free(xauth);
-		} else {
-			xauth = getenv("XAUTHORITY");
-			if (xauth) {
-				*(xauth-2) = '_';	/* yow */
-			}
-		}
-		if (dpy2) {
-			rfbLog("XAUTHORITY is not required on display.\n");
-			rfbLog("   %s\n", DisplayString(dpy));
-			XCloseDisplay_wr(dpy2);
-			dpy2 = NULL;
-			return 0;
-		}
-
-	}
-	return 1;
-#endif	/* NO_X11 */
-}
-
-#ifdef MACOSX
-void macosxCG_keycode_inject(int down, int keycode);
-#endif
-
-int rc_npieces = 0;
-
-/*
- * Huge, ugly switch to handle all remote commands and queries
- * -remote/-R and -query/-Q.
- */
-char *process_remote_cmd(char *cmd, int stringonly) {
-#if REMOTE_CONTROL
-	char *p = cmd;
-	char *co = "";
-	char buf[X11VNC_REMOTE_MAX]; 
-	int bufn = X11VNC_REMOTE_MAX;
-	int query = 0;
-	static char *prev_cursors_mode = NULL;
-
-	if (!query_default && !accept_remote_cmds) {
-		rfbLog("remote commands disabled: %s\n", cmd);
-		return NULL;
-	}
-	if (unixpw_in_progress) {
-		rfbLog("skip remote command: %s unixpw_in_progress.\n", cmd);
-		return NULL;
-	}
-
-	if (!query_default && priv_remote) {
-		if (! remote_control_access_ok()) {
-			rfbLog("** Disabling remote commands in -privremote "
-			    "mode.\n");
-			accept_remote_cmds = 0;
-			return NULL;
-		}
-	}
-
-
-	strcpy(buf, "");
-	if (strstr(cmd, "cmd=") == cmd) {
-		p += strlen("cmd=");
-		if (strstr(p, "script:") == p) {
-			char *s, *q, **pieces, tmp[1024];
-			int k = 0, n = 0, dp = 1;
-
-			p += strlen("script:");
-
-			if (strstr(p, "file=") == p) {
-				FILE *f;
-				struct stat sbuf;
-
-				p += strlen("file=");
-
-				rfbLog("reading script from file '%s'\n", p);
-
-				if (stat(p, &sbuf) != 0) {
-					rfbLogPerror("stat");
-					return NULL;
-				}
-
-				f = fopen(p, "r");
-				if (f == NULL) {
-					rfbLogPerror("fopen");
-					return NULL;
-				}
-
-				p = (char *) calloc(sbuf.st_size + 1, 1);
-				dp = 0;
-				while (fgets(tmp, 1024, f) != NULL) {
-					char *c = strchr(tmp, '#');
-					if (c) *c = '\0';
-					if (strlen(p) + strlen(tmp) > (size_t) sbuf.st_size) {
-						break;
-					}
-					strcat(p, tmp);
-				}
-				fclose(f);
-			}
-
-			pieces = (char **) malloc(strlen(p) * sizeof(char *));
-			if (dp) {
-				s = strdup(p);
-			} else {
-				s = p;
-			}
-			q = strtok(s, ";"); 
-
-			while (q) {
-				char *t = lblanks(q);
-				if (strstr(t, "cmd=") != t && strstr(t, "qry=") != t) {
-					strcpy(tmp, "cmd=");
-				} else {
-					strcpy(tmp, "");
-				}
-				strncat(tmp, t, 1000);
-				pieces[n] = strdup(tmp);
-				n++;
-				q = strtok(NULL, ";");
-			}
-			free(s);
-
-			for (k=0; k < n; k++) {
-				char *c = pieces[k];
-				char *t = c + strlen(c) - 1;	/* shortest is "cmd=" */
-				while (isspace((unsigned char) (*t))) {
-					*t = '\0';
-					if (t <= c) break;
-					t--;
-				}
-				if (k < n - 1) {
-					process_remote_cmd(c, 1);
-				} else {
-					process_remote_cmd(c, 0);
-				}
-			}
-			for (k=0; k<n; k++) {
-				free(pieces[k]);
-			}
-			free(pieces);
-			return NULL;
-		}
-	} else if (strstr(cmd, "qry=") == cmd) {
-		query = 1;
-		if (strchr(cmd, ',')) {
-			/* comma separated batch mode */
-			char *s, *q, *res, **pieces, tmp[1024];
-			int k = 0, n = 0;
-
-			pieces = (char **) malloc(strlen(cmd) * sizeof(char *));
-			s = strdup(cmd + strlen("qry="));
-			q = strtok(s, ","); 
-
-			while (q) {
-				strcpy(tmp, "qry=");
-				strncat(tmp, q, 1000);
-				pieces[n] = strdup(tmp);
-				n++;
-				q = strtok(NULL, ",");
-			}
-			free(s);
-
-			rc_npieces = n;
-			strcpy(buf, "");
-			for (k=0; k < n; k++) {
-				res = process_remote_cmd(pieces[k], 1);
-				if (res && strlen(buf)+strlen(res)
-				    >= X11VNC_REMOTE_MAX - 1) {
-					rfbLog("overflow in process_remote_cmd:"
-					    " %s -- %s\n", buf, res);
-					free(res);
-					break;
-				}
-				if (res) {
-					strcat(buf, res);
-					free(res);
-				}
-				if (k < n - 1) {
-					strcat(buf, ",");
-				}
-			}
-			for (k=0; k<n; k++) {
-				free(pieces[k]);
-			}
-			free(pieces);
-			rc_npieces = 0;
-			goto qry;
-		}
-		p += strlen("qry=");
-	} else {
-		rfbLog("ignoring malformed command: %s\n", cmd);
-		goto done;
-	}
-
-	/* allow var=val usage */
-	if (!strchr(p, ':')) {
-		char *q = strchr(p, '=');
-		if (q) *q = ':';
-	}
-
-	/* always call like: COLON_CHECK("foobar:") */
-#define COLON_CHECK(str) \
-	if (strstr(p, str) != p) { \
-		co = ":"; \
-		if (! query) { \
-			goto done; \
-		} \
-	} else { \
-		char *q = strchr(p, ':'); \
-		if (query && q != NULL) { \
-			*(q+1) = '\0'; \
-		} \
-	}
-
-#define NOTAPP \
-	if (query) { \
-		if (strchr(p, ':')) { \
-			snprintf(buf, bufn, "ans=%sN/A", p); \
-		} else { \
-			snprintf(buf, bufn, "ans=%s:N/A", p); \
-		} \
-		goto qry; \
-	}
-
-#define NOTAPPRO \
-	if (query) { \
-		if (strchr(p, ':')) { \
-			snprintf(buf, bufn, "aro=%sN/A", p); \
-		} else { \
-			snprintf(buf, bufn, "aro=%s:N/A", p); \
-		} \
-		goto qry; \
-	}
-
-/*
- * Maybe add: passwdfile logfile bg rfbauth passwd...
- */
-	if (!strcmp(p, "")) {	/* skip-cmd-list */
-		NOTAPP
-		rfbLog("remote_cmd: empty command.\n");
-		goto done;
-	}
-	if (strstr(p, "CR:") == p) {	/* skip-cmd-list */
-		/* CR:WxH+X+Y,dx,dy */
-		int w, h, x, y, dx, dy;
-		NOTAPP
-		if (sscanf(p+3, "%dx%d+%d+%d,%d,%d", &w, &h, &x, &y, &dx, &dy) == 6) {
-			sraRegionPtr r;
-			rfbLog("rfbDoCopyRect(screen, %d, %d, %d, %d, %d, %d)\n", x, y, x+w, y+h, dx, dy);
-			r = sraRgnCreateRect(x, y, x+w, y+h);
-			do_copyregion(r, dx, dy, 0);
-			fb_push();
-			sraRgnDestroy(r);
-			rfbLog("did\n");
-		} else {
-			rfbLog("remote_cmd: bad CR string: %s\n", p);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "stop") || !strcmp(p, "quit") ||
-	    !strcmp(p, "exit") || !strcmp(p, "shutdown")) {
-		NOTAPP
-		if (client_connect_file) {
-			FILE *in = fopen(client_connect_file, "w");
-			if (in) {
-				fprintf(in, "cmd=noop\n");
-				fclose(in);
-			}
-		}
-		rfbLog("remote_cmd: setting shut_down flag\n");
-		shut_down = 1;
-		close_all_clients();
-		goto done;
-	}
-	if (!strcmp(p, "ping")
-	    || strstr(p, "ping:") == p) { /* skip-cmd-list */
-		query = 1;
-		if (rfb_desktop_name) {
-			snprintf(buf, bufn, "ans=%s:%s", p, rfb_desktop_name);
-		} else {
-			snprintf(buf, bufn, "ans=%s:%s", p, "unknown");
-		}
-		goto qry;
-		goto done;
-	}
-	if (!strcmp(p, "resend_cutbuffer")) {
-		NOTAPP
-		resend_selection("cutbuffer");
-		goto done;
-	}
-	if (!strcmp(p, "resend_clipboard")) {
-		NOTAPP
-		resend_selection("clipboard");
-		goto done;
-	}
-	if (!strcmp(p, "resend_primary")) {
-		NOTAPP
-		resend_selection("primary");
-		goto done;
-	}
-	if (!strcmp(p, "blacken") || !strcmp(p, "zero")) {
-		NOTAPP
-		push_black_screen(4);
-		goto done;
-	}
-	if (!strcmp(p, "refresh")) {
-		NOTAPP
-		refresh_screen(1);
-		goto done;
-	}
-	if (!strcmp(p, "reset")) {
-		NOTAPP
-		do_new_fb(1);
-		goto done;
-	}
-	if (strstr(p, "zero:") == p) { /* skip-cmd-list */
-		int x1, y1, x2, y2;
-		NOTAPP
-		p += strlen("zero:");
-		if (sscanf(p, "%d,%d,%d,%d", &x1, &y1, &x2, &y2) == 4)  {
-			int mark = 1;
-			rfbLog("zeroing rect: %s\n", p);
-			if (x1 < 0 || x2 < 0) {
-				x1 = nabs(x1);
-				x2 = nabs(x2);
-				mark = 0;	/* hack for testing */
-			}
-
-			zero_fb(x1, y1, x2, y2);
-			if (mark) {
-				mark_rect_as_modified(x1, y1, x2, y2, 0);
-			}
-			push_sleep(4);
-		}
-		goto done;
-	}
-	if (strstr(p, "damagefb:") == p) { /* skip-cmd-list */
-		int delay;
-		NOTAPP
-		p += strlen("damagefb:");
-		if (sscanf(p, "%d", &delay) == 1)  {
-			rfbLog("damaging client fb's for %d secs "
-			    "(by not marking rects.)\n", delay);
-			damage_time = time(NULL);
-			damage_delay = delay;
-		}
-		goto done;
-	}
-	if (strstr(p, "close") == p) {
-		NOTAPP
-		COLON_CHECK("close:")
-		p += strlen("close:");
-		close_clients(p);
-		goto done;
-	}
-	if (strstr(p, "disconnect") == p) {
-		NOTAPP
-		COLON_CHECK("disconnect:")
-		p += strlen("disconnect:");
-		close_clients(p);
-		goto done;
-	}
-	if (strstr(p, "id_cmd") == p) {
-		NOTAPP
-		COLON_CHECK("id_cmd:")
-		p += strlen("id_cmd:");
-		id_cmd(p);
-		goto done;
-	}
-	if (strstr(p, "id") == p) {
-		int ok = 0;
-		Window twin;
-		COLON_CHECK("id:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s0x%lx", p, co,
-			    rootshift ? 0 : subwin);
-			goto qry;
-		}
-		p += strlen("id:");
-		if (*p == '\0' || !strcmp("root", p)) { /* skip-cmd-list */
-			/* back to root win */
-			twin = 0x0;
-			ok = 1;
-		} else if (!strcmp("pick", p)) {
-			twin = 0x0;
-			if (safe_remote_only) {
-				rfbLog("unsafe: '-id pick'\n");
-			} else if (pick_windowid(&twin)) {
-				ok = 1;
-			}
-		} else if (! scan_hexdec(p, &twin)) {
-			rfbLog("-id: skipping incorrect hex/dec number:"
-			    " %s\n", p);
-		} else {
-			ok = 1;
-		}
-		if (ok) {
-			X_LOCK;
-			if (twin && ! valid_window(twin, NULL, 0)) {
-				rfbLog("skipping invalid sub-window: 0x%lx\n", twin);
-				X_UNLOCK;
-			} else {
-				subwin = twin;
-				rootshift = 0;
-				X_UNLOCK;
-				check_black_fb();
-				do_new_fb(1);
-			}
-		}
-		goto done;
-	}
-	if (strstr(p, "sid") == p) {
-		int ok = 0;
-		Window twin;
-		COLON_CHECK("sid:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s0x%lx", p, co,
-			    !rootshift ? 0 : subwin);
-			goto qry;
-		}
-		p += strlen("sid:");
-		if (*p == '\0' || !strcmp("root", p)) { /* skip-cmd-list */
-			/* back to root win */
-			twin = 0x0;
-			ok = 1;
-		} else if (!strcmp("pick", p)) {
-			twin = 0x0;
-			if (safe_remote_only) {
-				rfbLog("unsafe: '-sid pick'\n");
-			} else if (pick_windowid(&twin)) {
-				ok = 1;
-			}
-		} else if (! scan_hexdec(p, &twin)) {
-			rfbLog("-sid: skipping incorrect hex/dec number: %s\n", p);
-		} else {
-			ok = 1;
-		}
-		if (ok) {
-			X_LOCK;
-			if (twin && ! valid_window(twin, NULL, 0)) {
-				rfbLog("skipping invalid sub-window: 0x%lx\n", twin);
-				X_UNLOCK;
-			} else {
-				subwin = twin;
-				rootshift = 1;
-				X_UNLOCK;
-				check_black_fb();
-				do_new_fb(1);
-			}
-		}
-		goto done;
-	}
-	if (strstr(p, "waitmapped") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    subwin_wait_mapped);
-			goto qry;
-		}
-		subwin_wait_mapped = 1;
-		goto done;
-	}
-	if (strstr(p, "nowaitmapped") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !subwin_wait_mapped);
-			goto qry;
-		}
-		subwin_wait_mapped = 0;
-		goto done;
-	}
-	if (!strcmp(p, "clip") ||
-	    strstr(p, "clip:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("clip:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(clip_str));
-			goto qry;
-		}
-		p += strlen("clip:");
-		if (clip_str) {
-			int w, h, x, y;
-			free(clip_str);
-			/* try to handle easy case where WxH is unchanged: */
-			if (parse_geom(p, &w, &h, &x, &y, wdpy_x, wdpy_y)) {
-				if (cdpy_x == w && cdpy_y == h) {
-					if (x >= 0 && y >= 0) {
-						if (x + w <= wdpy_x && y + h <= wdpy_y) {
-							coff_x = x;
-							coff_y = y;
-							clip_str = strdup(p);
-							goto done;
-						}
-					}
-				}
-			}
-		}
-		clip_str = strdup(p);
-
-		/* OK, this requires a new fb... */
-		do_new_fb(1);
-		goto done;
-	}
-	if (!strcmp(p, "flashcmap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, flash_cmap);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on flashcmap mode.\n");
-		flash_cmap = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noflashcmap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !flash_cmap);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off flashcmap mode.\n");
-		flash_cmap = 0;
-		goto done;
-	}
-	if (strstr(p, "shiftcmap") == p) {
-		COLON_CHECK("shiftcmap:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, shift_cmap);
-			goto qry;
-		}
-		p += strlen("shiftcmap:");
-		shift_cmap = atoi(p);
-		rfbLog("remote_cmd: set -shiftcmap %d\n", shift_cmap);
-		do_new_fb(1);
-		goto done;
-	}
-	if (!strcmp(p, "truecolor")) {
-		int orig = force_indexed_color;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !force_indexed_color);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off notruecolor mode.\n");
-		force_indexed_color = 0;
-		if (orig != force_indexed_color) {
-			if_8bpp_do_new_fb();
-		}
-		goto done;
-	}
-	if (!strcmp(p, "notruecolor")) {
-		int orig = force_indexed_color;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    force_indexed_color);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on notruecolor mode.\n");
-		force_indexed_color = 1;
-		if (orig != force_indexed_color) {
-			if_8bpp_do_new_fb();
-		}
-		goto done;
-	}
-	if (!strcmp(p, "overlay")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, overlay);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on -overlay mode.\n");
-		if (!overlay_present) {
-			rfbLog("skipping: overlay extension not present.\n");
-		} else if (overlay) {
-			rfbLog("skipping: already in -overlay mode.\n");
-		} else {
-			int reset_mem = 0;
-			/* here we go... */
-			if (using_shm) {
-				rfbLog("setting -noshm mode.\n");
-				using_shm = 0;
-				reset_mem = 1;
-			}
-			overlay = 1;
-			do_new_fb(reset_mem);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "nooverlay")) {
-		int orig = overlay;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !overlay);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off overlay mode\n");
-		overlay = 0;
-		if (!overlay_present) {
-			rfbLog("warning: overlay extension not present.\n");
-		} else if (!orig) {
-			rfbLog("skipping: already not in -overlay mode.\n");
-		} else {
-			/* here we go... */
-			do_new_fb(0);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "overlay_cursor") ||
-	    !strcmp(p, "overlay_yescursor") ||
-	    !strcmp(p, "nooverlay_nocursor")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, overlay_cursor);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on overlay_cursor mode.\n");
-		overlay_cursor = 1;
-		if (!overlay_present) {
-			rfbLog("warning: overlay extension not present.\n");
-		} else if (!overlay) {
-			rfbLog("warning: not in -overlay mode.\n");
-		} else {
-			rfbLog("You may want to run -R noshow_cursor or\n");
-			rfbLog(" -R cursor:none to disable any extra "
-			    "cursors.\n");
-		}
-		goto done;
-	}
-	if (!strcmp(p, "nooverlay_cursor") ||
-	    !strcmp(p, "nooverlay_yescursor") ||
-	    !strcmp(p, "overlay_nocursor")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !overlay_cursor);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off overlay_cursor mode\n");
-		overlay_cursor = 0;
-		if (!overlay_present) {
-			rfbLog("warning: overlay extension not present.\n");
-		} else if (!overlay) {
-			rfbLog("warning: not in -overlay mode.\n");
-		} else {
-			rfbLog("You may want to run -R show_cursor or\n");
-			rfbLog(" -R cursor:... to re-enable any cursors.\n");
-		}
-		goto done;
-	}
-	if (!strcmp(p, "8to24")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, cmap8to24);
-			goto qry;
-		}
-		if (overlay) {
-			rfbLog("disabling -overlay in -8to24 mode.\n");
-			overlay = 0;
-		}
-		rfbLog("remote_cmd: turning on -8to24 mode.\n");
-		cmap8to24 = 1;
-		if (overlay) {
-			rfbLog("disabling -overlay in -8to24 mode.\n");
-			overlay = 0;
-		}
-		do_new_fb(0);
-		goto done;
-	}
-	if (!strcmp(p, "no8to24")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !cmap8to24);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off -8to24 mode.\n");
-		cmap8to24 = 0;
-		do_new_fb(0);
-		goto done;
-	}
-	if (strstr(p, "8to24_opts") == p) {
-		COLON_CHECK("8to24_opts:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(cmap8to24_str));
-			goto qry;
-		}
-		p += strlen("8to24_opts:");
-		if (cmap8to24_str) {
-			free(cmap8to24_str);
-		}
-		cmap8to24_str = strdup(p);
-		if (*p == '\0') {
-			cmap8to24 = 0;
-		} else {
-			cmap8to24 = 1;
-		}
-		rfbLog("remote_cmd: set cmap8to24_str to: %s\n", cmap8to24_str);
-		do_new_fb(0);
-		goto done;
-	}
-	if (!strcmp(p, "24to32")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, xform24to32);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on -24to32 mode.\n");
-		xform24to32 = 1;
-		do_new_fb(1);
-		goto done;
-	}
-	if (!strcmp(p, "no24to32")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !xform24to32);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off -24to32 mode.\n");
-		if (set_visual_str_to_something) {
-			if (visual_str) {
-				rfbLog("unsetting: %d %d/%d\n", visual_str,
-				    (int) visual_id, visual_depth);
-				free(visual_str);
-			}
-			visual_str = NULL;
-			visual_id = (VisualID) 0;
-			visual_depth = 0;
-		}
-		xform24to32 = 0;
-		do_new_fb(1);
-		goto done;
-	}
-	if (strstr(p, "visual") == p) {
-		COLON_CHECK("visual:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(visual_str));
-			goto qry;
-		}
-		p += strlen("visual:");
-		if (visual_str) free(visual_str);
-		visual_str = strdup(p);
-
-		/* OK, this requires a new fb... */
-		do_new_fb(0);
-		goto done;
-	}
-	if (!strcmp(p, "scale") ||
-		    strstr(p, "scale:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("scale:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(scale_str));
-			goto qry;
-		}
-		p += strlen("scale:");
-		if (scale_str) free(scale_str);
-		scale_str = strdup(p);
-
-		/* OK, this requires a new fb... */
-		check_black_fb();
-		do_new_fb(0);
-		goto done;
-	}
-	if (!strcmp(p, "scale_cursor") ||
-		    strstr(p, "scale_cursor:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("scale_cursor:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(scale_cursor_str));
-			goto qry;
-		}
-		p += strlen("scale_cursor:");
-		if (scale_cursor_str) free(scale_cursor_str);
-		if (*p == '\0') {
-			scale_cursor_str = NULL;
-		} else {
-			scale_cursor_str = strdup(p);
-		}
-		setup_cursors_and_push();
-		goto done;
-	}
-	if (!strcmp(p, "viewonly")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, view_only);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable viewonly mode.\n");
-		view_only = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noviewonly")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !view_only);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable viewonly mode.\n");
-		view_only = 0;
-		if (raw_fb) set_raw_fb_params(0);
-		goto done;
-	}
-	if (!strcmp(p, "shared")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, shared); goto qry;
-		}
-		rfbLog("remote_cmd: enable sharing.\n");
-		shared = 1;
-		if (screen) {
-			/* mutex */
-			screen->alwaysShared = TRUE;
-			screen->neverShared = FALSE;
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noshared")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !shared); goto qry;
-		}
-		rfbLog("remote_cmd: disable sharing.\n");
-		shared = 0;
-		if (screen) {
-			/* mutex */
-			screen->alwaysShared = FALSE;
-			screen->neverShared = TRUE;
-		}
-		goto done;
-	}
-	if (!strcmp(p, "forever")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, 1-connect_once);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable -forever mode.\n");
-		connect_once = 0;
-		goto done;
-	}
-	if (!strcmp(p, "noforever") || !strcmp(p, "once")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, connect_once);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable -forever mode.\n");
-		connect_once = 1;
-		goto done;
-	}
-	if (strstr(p, "timeout") == p) {
-		int to;
-		COLON_CHECK("timeout:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    first_conn_timeout);
-			goto qry;
-		}
-		p += strlen("timeout:");
-		to = atoi(p);
-		if (to > 0 ) {
-			to = -to;
-		}
-		first_conn_timeout = to;
-		rfbLog("remote_cmd: set -timeout to %d\n", -to);
-		goto done;
-	}
-	if (!strcmp(p, "tightfilexfer")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, tightfilexfer);
-			goto qry;
-		}
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-		if (! tightfilexfer) {
-			rfbLog("remote_cmd: enabling -tightfilexfer for *NEW* clients.\n");
-			tightfilexfer = 1;
-			rfbLog("rfbRegisterTightVNCFileTransferExtension: 4\n");
-			rfbRegisterTightVNCFileTransferExtension();
-		}
-#else
-		rfbLog("remote_cmd: -tightfilexfer not supported in this binary.\n");
-#endif
-		goto done;
-	}
-	if (!strcmp(p, "notightfilexfer")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !tightfilexfer);
-			goto qry;
-		}
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-		if (tightfilexfer) {
-			rfbLog("remote_cmd: disabling -tightfilexfer for *NEW* clients.\n");
-			tightfilexfer = 0;
-			rfbLog("rfbUnregisterTightVNCFileTransferExtension: 2\n");
-			rfbUnregisterTightVNCFileTransferExtension();
-		}
-#else
-		rfbLog("remote_cmd: -tightfilexfer not supported in this binary.\n");
-#endif
-		goto done;
-	}
-	if (!strcmp(p, "ultrafilexfer")) {
-		if (query) {
-			if (screen) {
-				snprintf(buf, bufn, "ans=%s:%d", p, screen->permitFileTransfer == TRUE);
-			} else {
-				snprintf(buf, bufn, "ans=%s:%d", p, 0);
-			}
-			goto qry;
-		}
-		if (! screen->permitFileTransfer) {
-			rfbLog("remote_cmd: enabling -ultrafilexfer for clients.\n");
-			/* mutex */
-			screen->permitFileTransfer = TRUE;
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noultrafilexfer")) {
-		if (query) {
-			if (screen) {
-				snprintf(buf, bufn, "ans=%s:%d", p, screen->permitFileTransfer == FALSE);
-			} else {
-				snprintf(buf, bufn, "ans=%s:%d", p, 1);
-			}
-			goto qry;
-		}
-		if (screen->permitFileTransfer) {
-			rfbLog("remote_cmd: disabling -ultrafilexfer for clients.\n");
-			/* mutex */
-			screen->permitFileTransfer = FALSE;
-		}
-		goto done;
-	}
-	if (strstr(p, "rfbversion") == p) {
-		int maj, min;
-		COLON_CHECK("rfbversion:")
-		if (query) {
-			if (screen) {
-				snprintf(buf, bufn, "ans=%s:%d.%d", p, screen->protocolMajorVersion, screen->protocolMinorVersion);
-			} else {
-				snprintf(buf, bufn, "ans=%s:%d.%d", p, 3, 8);
-			}
-			goto qry;
-		}
-		p += strlen("rfbversion:");
-
-		if (sscanf(p, "%d.%d", &maj, &min) == 2) {
-			/* mutex */
-			screen->protocolMajorVersion = maj;
-			screen->protocolMinorVersion = min;
-			rfbLog("remote_cmd: set rfbversion to: %d.%d\n", maj, min);
-		} else {
-			rfbLog("remote_cmd: invalid rfbversion: %s\n", p);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "deny") || !strcmp(p, "lock")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, deny_all);
-			goto qry;
-		}
-		rfbLog("remote_cmd: denying new connections.\n");
-		deny_all = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nodeny") || !strcmp(p, "unlock")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !deny_all);
-			goto qry;
-		}
-		rfbLog("remote_cmd: allowing new connections.\n");
-		deny_all = 0;
-		goto done;
-	}
-	if (!strcmp(p, "avahi") || !strcmp(p, "mdns") || !strcmp(p, "zeroconf")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, avahi);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable -avahi mDNS mode.\n");
-		if (!avahi) {
-			avahi = 1;
-			avahi_initialise();
-			avahi_advertise(vnc_desktop_name, this_host(),
-			    screen->port);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noavahi") || !strcmp(p, "nomdns") || !strcmp(p, "nozeroconf")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !avahi);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable -avahi mDNS mode.\n");
-		if (avahi) {
-			avahi = 0;
-			avahi_reset();
-		}
-		goto done;
-	}
-	if (strstr(p, "connect") == p) {
-		NOTAPP
-		COLON_CHECK("connect:")
-		p += strlen("connect:");
-		/* this is a reverse connection */
-		reverse_connect(p);
-		goto done;
-	}
-	if (strstr(p, "proxy") == p) {
-		COLON_CHECK("proxy:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(connect_proxy));
-			goto qry;
-		}
-		p += strlen("proxy:");
-		if (connect_proxy) {
-			free(connect_proxy);
-			connect_proxy = NULL;
-		}
-		if (!strcmp(p, "") || !strcasecmp(p, "none")) { /* skip-cmd-list */
-			rfbLog("remote_cmd: disabled -proxy\n");
-		} else {
-			connect_proxy = strdup(p);
-			rfbLog("remote_cmd: set -proxy %s\n", connect_proxy);
-		}
-		goto done;
-	}
-	if (strstr(p, "allowonce") == p) {
-		COLON_CHECK("allowonce:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(allow_once));
-			goto qry;
-		}
-		p += strlen("allowonce:");
-		allow_once = strdup(p);
-		rfbLog("remote_cmd: set allow_once %s\n", allow_once);
-		goto done;
-	}
-	if (strstr(p, "allow") == p) {
-		char *before, *old;
-		COLON_CHECK("allow:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(allow_list));
-			goto qry;
-		}
-
-		if (unixpw) {
-			rfbLog("remote_cmd: cannot change allow in -unixpw\n");
-			goto done;
-		}
-		p += strlen("allow:");
-		if (allow_list && strchr(allow_list, '/')) {
-			rfbLog("remote_cmd: cannot use allow:host\n");
-			rfbLog("in '-allow %s' mode.\n", allow_list);
-			goto done;
-		}
-		if (allow_list) {
-			before = strdup(allow_list);
-		} else {
-			before = strdup("");
-		}
-
-		old = allow_list;
-		if (*p == '+') {
-			p++;
-			allow_list = add_item(allow_list, p);
-		} else if (*p == '-') {
-			p++;
-			allow_list = delete_item(allow_list, p);
-		} else {
-			allow_list = strdup(p);
-		}
-
-		if (strcmp(before, allow_list)) {
-			rfbLog("remote_cmd: modified allow_list:\n");
-			rfbLog(" from: \"%s\"\n", before);
-			rfbLog(" to:   \"%s\"\n", allow_list);
-		}
-		if (old) free(old);
-		free(before);
-		goto done;
-	}
-	if (!strcmp(p, "noipv6")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, noipv6);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -noipv6 mode for future sockets.\n");
-		noipv6 = 1;
-		goto done;
-	}
-	if (!strcmp(p, "ipv6")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !noipv6);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -noipv6 mode for future sockets.\n");
-		noipv6 = 0;
-		goto done;
-	}
-	if (!strcmp(p, "noipv4")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, noipv4);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -noipv4 mode for future sockets.\n");
-		noipv4 = 1;
-		goto done;
-	}
-	if (!strcmp(p, "ipv4")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !noipv4);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -noipv4 mode for future sockets.\n");
-		noipv4 = 0;
-		goto done;
-	}
-	if (!strcmp(p, "no6")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ipv6_listen);
-			goto qry;
-		}
-		if (ipv6_listen) {
-			ipv6_listen = 0;
-			rfbLog("disabling -6 IPv6 listening mode.\n");
-			reset_rfbport(-1, screen->port);
-			reset_httpport(-1, screen->httpPort);
-			if (https_port_num > 0) {
-				https_port(1);
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "6")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ipv6_listen);
-			goto qry;
-		}
-		if (!ipv6_listen) {
-			ipv6_listen = 1;
-			rfbLog("enabling -6 IPv6 listening mode.\n");
-			reset_rfbport(-1, screen->port);
-			reset_httpport(-1, screen->httpPort);
-			if (https_port_num > 0) {
-				https_port(1);
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "localhost")) {
-		char *before, *old;
-		if (query) {
-			int state = 0;
-			char *s = allow_list;
-			if (s && (!strcmp(s, "127.0.0.1") ||
-			    !strcmp(s, "localhost"))) {
-				state = 1;
-			}
-			snprintf(buf, bufn, "ans=%s:%d", p, state);
-			goto qry;
-		}
-		if (allow_list) {
-			before = strdup(allow_list);
-		} else {
-			before = strdup("");
-		}
-		old = allow_list;
-
-		allow_list = strdup("127.0.0.1");
-
-		if (strcmp(before, allow_list)) {
-			rfbLog("remote_cmd: modified allow_list:\n");
-			rfbLog(" from: \"%s\"\n", before);
-			rfbLog(" to:   \"%s\"\n", allow_list);
-		}
-		if (old) free(old);
-		free(before);
-
-		if (listen_str) {
-			free(listen_str);
-		}
-		listen_str = strdup("localhost");
-
-		/* mutex */
-		screen->listenInterface = htonl(INADDR_LOOPBACK);
-		rfbLog("listening on loopback network only.\n");
-		rfbLog("allow list is: '%s'\n", NONUL(allow_list));
-		reset_rfbport(-1, screen->port);
-		reset_httpport(-1, screen->httpPort);
-		goto done;
-	}
-	if (!strcmp(p, "nolocalhost")) {
-		char *before, *old;
-		if (query) {
-			int state = 0;
-			char *s = allow_list;
-			if (s && (!strcmp(s, "127.0.0.1") ||
-			    !strcmp(s, "localhost"))) {
-				state = 1;
-			}
-			snprintf(buf, bufn, "ans=%s:%d", p, !state);
-			goto qry;
-		}
-		if (unixpw) {
-			rfbLog("remote_cmd: cannot change localhost in -unixpw\n");
-			goto done;
-		}
-		if (allow_list) {
-			before = strdup(allow_list);
-		} else {
-			before = strdup("");
-		}
-		old = allow_list;
-
-		allow_list = strdup("");
-
-		if (strcmp(before, allow_list)) {
-			rfbLog("remote_cmd: modified allow_list:\n");
-			rfbLog(" from: \"%s\"\n", before);
-			rfbLog(" to:   \"%s\"\n", allow_list);
-		}
-		if (old) free(old);
-		free(before);
-
-		if (listen_str) {
-			free(listen_str);
-		}
-		listen_str = NULL;
-
-		/* mutex */
-		screen->listenInterface = htonl(INADDR_ANY);
-		rfbLog("listening on ALL network interfaces.\n");
-		rfbLog("allow list is: '%s'\n", NONUL(allow_list));
-		reset_rfbport(-1, screen->port);
-		reset_httpport(-1, screen->httpPort);
-		goto done;
-	}
-	if (strstr(p, "listen") == p) {
-		char *before;
-		int ok, mod = 0;
-
-		COLON_CHECK("listen:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(listen_str));
-			goto qry;
-		}
-		if (unixpw) {
-			rfbLog("remote_cmd: cannot change listen in -unixpw\n");
-			goto done;
-		}
-		if (listen_str) {
-			before = strdup(listen_str);
-		} else {
-			before = strdup("");
-		}
-		p += strlen("listen:");
-
-		listen_str = strdup(p);
-
-		if (strcmp(before, listen_str)) {
-			rfbLog("remote_cmd: modified listen_str:\n");
-			rfbLog(" from: \"%s\"\n", before);
-			rfbLog(" to:   \"%s\"\n", listen_str);
-			mod = 1;
-		}
-
-		ok = 1;
-		/* mutex */
-		if (listen_str == NULL || *listen_str == '\0' ||
-		    !strcmp(listen_str, "any")) {
-			screen->listenInterface = htonl(INADDR_ANY);
-		} else if (!strcmp(listen_str, "localhost")) {
-			screen->listenInterface = htonl(INADDR_LOOPBACK);
-		} else {
-			struct hostent *hp;
-			in_addr_t iface = inet_addr(listen_str);
-			if (iface == htonl(INADDR_NONE)) {
-				if (!host_lookup) {
-					ok = 0;
-				} else if (!(hp = gethostbyname(listen_str))) {
-					ok = 0;
-				} else {
-					iface = *(unsigned long *)hp->h_addr;
-				}
-			}
-			if (ok) {
-				screen->listenInterface = iface;
-			}
-		}
-
-		if (ok && mod) {
-			int is_loopback = 0;
-			in_addr_t iface = screen->listenInterface;
-
-			if (allow_list) {
-				if (!strcmp(allow_list, "127.0.0.1") ||
-				    !strcmp(allow_list, "localhost")) {
-					is_loopback = 1;
-				}
-			}
-			if (iface != htonl(INADDR_LOOPBACK)) {
-			    if (is_loopback) {
-				rfbLog("re-setting -allow list to all "
-				   "hosts for non-loopback listening.\n");
-				if (allow_list) {
-					free(allow_list);
-				}
-				allow_list = NULL;
-			    }
-			} else {
-			    if (!is_loopback) {
-				if (allow_list) {
-					free(allow_list);
-				}
-				rfbLog("setting -allow list to 127.0.0.1\n");
-				allow_list = strdup("127.0.0.1");
-			    }
-			}
-		}
-		if (ok) {
-			rfbLog("allow list is: '%s'\n", NONUL(allow_list));
-			reset_rfbport(-1, screen->port);
-			reset_httpport(-1, screen->httpPort);
-			free(before);
-		} else {
-			rfbLog("invalid listen string: %s\n", listen_str);
-			free(listen_str);
-			listen_str = before;
-		}
-		goto done;
-	}
-	if (!strcmp(p, "lookup")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, host_lookup);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling hostname lookup.\n");
-		host_lookup = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nolookup")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !host_lookup);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling hostname lookup.\n");
-		host_lookup = 0;
-		goto done;
-	}
-	if (strstr(p, "accept") == p) {
-		int doit = 1, safe = 0;
-		COLON_CHECK("accept:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(accept_cmd));
-			goto qry;
-		}
-		p += strlen("accept:");
-		if (!strcmp(p, "") || strstr(p, "popup") == p) { /* skip-cmd-list */
-			safe = 1;
-		}
-		if (safe_remote_only && ! safe) {
-			rfbLog("unsafe: %s\n", p);
-			doit = 0;
-		}
-
-		if (doit) {
-			if (accept_cmd) free(accept_cmd);
-			accept_cmd = strdup(p);
-		}
-		goto done;
-	}
-	if (strstr(p, "afteraccept") == p) {
-		int safe = 0;
-		COLON_CHECK("afteraccept:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(afteraccept_cmd));
-			goto qry;
-		}
-		p += strlen("afteraccept:");
-		if (!strcmp(p, "")) { /* skip-cmd-list */
-			safe = 1;
-		}
-		if (safe_remote_only && ! safe) {
-			rfbLog("unsafe: %s\n", p);
-		} else {
-			if (afteraccept_cmd) free(afteraccept_cmd);
-			afteraccept_cmd = strdup(p);
-		}
-		goto done;
-	}
-	if (strstr(p, "gone") == p) {
-		int safe = 0;
-		COLON_CHECK("gone:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(gone_cmd));
-			goto qry;
-		}
-		p += strlen("gone:");
-		if (!strcmp(p, "") || strstr(p, "popup") == p) { /* skip-cmd-list */
-			safe = 1;
-		}
-		if (safe_remote_only && ! safe) {
-			rfbLog("unsafe: %s\n", p);
-		} else {
-			if (gone_cmd) free(gone_cmd);
-			gone_cmd = strdup(p);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "shm")) {
-		int orig = using_shm;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, using_shm);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off noshm mode.\n");
-		using_shm = 1;
-		if (raw_fb) set_raw_fb_params(0);
-
-		if (orig != using_shm) {
-			do_new_fb(1);
-		} else {
-			rfbLog(" already in shm mode.\n");
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noshm")) {
-		int orig = using_shm;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !using_shm);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on noshm mode.\n");
-		using_shm = 0;
-		if (orig != using_shm) {
-			do_new_fb(1);
-		} else {
-			rfbLog(" already in noshm mode.\n");
-		}
-		goto done;
-	}
-	if (!strcmp(p, "flipbyteorder")) {
-		int orig = flip_byte_order;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, flip_byte_order);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on flipbyteorder mode.\n");
-		flip_byte_order = 1;
-		if (orig != flip_byte_order) {
-			if (! using_shm || xform24to32) {
-				do_new_fb(1);
-			} else {
-				rfbLog("  using shm, not resetting fb\n");
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noflipbyteorder")) {
-		int orig = flip_byte_order;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !flip_byte_order);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off flipbyteorder mode.\n");
-		flip_byte_order = 0;
-		if (orig != flip_byte_order) {
-			if (! using_shm || xform24to32) {
-				do_new_fb(1);
-			} else {
-				rfbLog("  using shm, not resetting fb\n");
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "onetile")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, single_copytile);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable -onetile mode.\n");
-		single_copytile = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noonetile")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !single_copytile);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable -onetile mode.\n");
-		if (tile_shm_count < ntiles_x) {
-			rfbLog(" this has no effect: tile_shm_count=%d"
-			    " ntiles_x=%d\n", tile_shm_count, ntiles_x);
-			
-		}
-		single_copytile = 0;
-		goto done;
-	}
-	if (strstr(p, "solid_color") == p) {
-		/*
-		 * n.b. this solid stuff perhaps should reflect
-		 * safe_remote_only but at least the command names
-		 * are fixed.
-		 */
-		char *newc;
-		int doit = 1;
-		COLON_CHECK("solid_color:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(solid_str));
-			goto qry;
-		}
-		p += strlen("solid_color:");
-		if (*p != '\0') {
-			newc = strdup(p);
-		} else {
-			newc = strdup(solid_default);
-		}
-		rfbLog("remote_cmd: solid %s -> %s\n", NONUL(solid_str), newc);
-
-		if (solid_str) {
-			if (!strcmp(solid_str, newc)) {
-				doit = 0;
-			}
-			free(solid_str);
-		}
-		solid_str = newc;
-		use_solid_bg = 1;
-		if (raw_fb && !macosx_console) set_raw_fb_params(0);
-
-		if (doit && client_count) {
-			solid_bg(0);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "solid")) {
-		int orig = use_solid_bg;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_solid_bg);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable -solid mode\n");
-		if (! solid_str) {
-			solid_str = strdup(solid_default);
-		}
-		use_solid_bg = 1;
-		if (raw_fb && !macosx_console) set_raw_fb_params(0);
-		if (client_count && !orig) {
-			solid_bg(0);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "nosolid")) {
-		int orig = use_solid_bg;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !use_solid_bg);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable -solid mode\n");
-		use_solid_bg = 0;
-		if (client_count && orig) {
-			solid_bg(1);
-		}
-		goto done;
-	}
-	if (strstr(p, "blackout") == p) {
-		char *before, *old;
-		COLON_CHECK("blackout:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(blackout_str));
-			goto qry;
-		}
-		p += strlen("blackout:");
-		if (blackout_str) {
-			before = strdup(blackout_str);
-		} else {
-			before = strdup("");
-		}
-		old = blackout_str;
-		if (*p == '+') {
-			p++;
-			blackout_str = add_item(blackout_str, p);
-		} else if (*p == '-') {
-			p++;
-			blackout_str = delete_item(blackout_str, p);
-		} else {
-			blackout_str = strdup(p);
-		}
-		if (strcmp(before, blackout_str)) {
-			rfbLog("remote_cmd: changing -blackout\n");
-			rfbLog(" from: %s\n", before);
-			rfbLog(" to:   %s\n", blackout_str);
-			if (0 && !strcmp(blackout_str, "") &&
-			    single_copytile_orig != single_copytile) {
-				rfbLog("resetting single_copytile to: %d\n",
-				    single_copytile_orig);
-				single_copytile = single_copytile_orig;
-			}
-			initialize_blackouts_and_xinerama();
-		}
-		if (old) free(old);
-		free(before);
-		goto done;
-	}
-	if (!strcmp(p, "xinerama")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, xinerama);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable xinerama mode. (if applicable).\n");
-		xinerama = 1;
-		initialize_blackouts_and_xinerama();
-		goto done;
-	}
-	if (!strcmp(p, "noxinerama")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !xinerama);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable xinerama mode. (if applicable).\n");
-		xinerama = 0;
-		initialize_blackouts_and_xinerama();
-		goto done;
-	}
-	if (!strcmp(p, "xtrap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, xtrap_input);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enable xtrap input mode."
-		    "(if applicable).\n");
-		if (! xtrap_input) {
-			xtrap_input = 1;
-			disable_grabserver(dpy, 1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noxtrap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !xtrap_input);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disable xtrap input mode."
-		    "(if applicable).\n");
-		if (xtrap_input) {
-			xtrap_input = 0;
-			disable_grabserver(dpy, 1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "xrandr")) {
-		int orig = xrandr;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, xrandr); goto qry;
-		}
-		if (xrandr_present) {
-			rfbLog("remote_cmd: enable xrandr mode.\n");
-			xrandr = 1;
-			if (raw_fb) set_raw_fb_params(0);
-			if (! xrandr_mode) {
-				xrandr_mode = strdup("default");
-			}
-			if (orig != xrandr) {
-				initialize_xrandr();
-			}
-		} else {
-			rfbLog("remote_cmd: XRANDR ext. not present.\n");
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noxrandr")) {
-		int orig = xrandr;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !xrandr); goto qry;
-		}
-		xrandr = 0;
-		xrandr_maybe = 0;
-		if (xrandr_present) {
-			rfbLog("remote_cmd: disable xrandr mode.\n");
-			if (orig != xrandr) {
-				initialize_xrandr();
-			}
-		} else {
-			rfbLog("remote_cmd: XRANDR ext. not present.\n");
-		}
-		goto done;
-	}
-	if (strstr(p, "xrandr_mode") == p) {
-		int orig = xrandr;
-		COLON_CHECK("xrandr_mode:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(xrandr_mode));
-			goto qry;
-		}
-		p += strlen("xrandr_mode:");
-		if (!strcmp("none", p)) {
-			xrandr = 0;
-			xrandr_maybe = 0;
-		} else {
-			if (known_xrandr_mode(p)) {
-				if (xrandr_mode) free(xrandr_mode);
-				xrandr_mode = strdup(p);
-			} else {
-				rfbLog("skipping unknown xrandr mode: %s\n", p);
-				goto done;
-			}
-			xrandr = 1;
-		}
-		if (xrandr_present) {
-			if (xrandr) {
-				rfbLog("remote_cmd: enable xrandr mode.\n");
-			} else {
-				rfbLog("remote_cmd: disable xrandr mode.\n");
-			}
-			if (! xrandr_mode) {
-				xrandr_mode = strdup("default");
-			}
-			if (orig != xrandr) {
-				initialize_xrandr();
-			}
-		} else {
-			rfbLog("remote_cmd: XRANDR ext. not present.\n");
-		}
-		goto done;
-	}
-	if (strstr(p, "rotate") == p) {
-		COLON_CHECK("rotate:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(rotating_str));
-			goto qry;
-		}
-		p += strlen("rotate:");
-		if (rotating_str) free(rotating_str);
-		rotating_str = strdup(p);
-		rfbLog("remote_cmd: set rotate to \"%s\"\n", rotating_str);
-
-		do_new_fb(0);
-		goto done;
-	}
-	if (strstr(p, "padgeom") == p) {
-		COLON_CHECK("padgeom:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(pad_geometry));
-			goto qry;
-		}
-		p += strlen("padgeom:");
-		if (!strcmp("force", p) || !strcmp("do",p) || !strcmp("go",p)) {
-			rfbLog("remote_cmd: invoking install_padded_fb()\n");
-			install_padded_fb(pad_geometry);
-		} else {
-			if (pad_geometry) free(pad_geometry);
-			pad_geometry = strdup(p);
-			rfbLog("remote_cmd: set padgeom to: %s\n",
-			    pad_geometry);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "quiet") || !strcmp(p, "q")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, quiet); goto qry;
-		}
-		rfbLog("remote_cmd: turning on quiet mode.\n");
-		quiet = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noquiet")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !quiet); goto qry;
-		}
-		rfbLog("remote_cmd: turning off quiet mode.\n");
-		quiet = 0;
-		goto done;
-	}
-	if (!strcmp(p, "modtweak")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_modifier_tweak);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -modtweak mode.\n");
-		if (! use_modifier_tweak) {
-			use_modifier_tweak = 1;
-			initialize_modtweak();
-		}
-		use_modifier_tweak = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nomodtweak")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !use_modifier_tweak);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -nomodtweak mode.\n");
-		got_nomodtweak = 1;
-		use_modifier_tweak = 0;
-		goto done;
-	}
-	if (!strcmp(p, "xkb")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_xkb_modtweak);
-			goto qry;
-		}
-		if (! xkb_present) {
-			rfbLog("remote_cmd: cannot enable -xkb "
-			    "modtweak mode (not supported on X display)\n");
-			goto done;
-		}
-		rfbLog("remote_cmd: enabling -xkb modtweak mode"
-		    " (if supported).\n");
-		if (! use_modifier_tweak || ! use_xkb_modtweak) {
-			use_modifier_tweak = 1;
-			use_xkb_modtweak = 1;
-			initialize_modtweak();
-		}
-		use_modifier_tweak = 1;
-		use_xkb_modtweak = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noxkb")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !use_xkb_modtweak);
-			goto qry;
-		}
-		if (! xkb_present) {
-			rfbLog("remote_cmd: cannot disable -xkb "
-			    "modtweak mode (not supported on X display)\n");
-			goto done;
-		}
-		rfbLog("remote_cmd: disabling -xkb modtweak mode.\n");
-		use_xkb_modtweak = 0;
-		got_noxkb = 1;
-		initialize_modtweak();
-		goto done;
-	}
-	if (!strcmp(p, "capslock")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, watch_capslock);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -capslock mode\n");
-		watch_capslock = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nocapslock")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !watch_capslock);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -capslock mode\n");
-		watch_capslock = 0;
-		goto done;
-	}
-	if (!strcmp(p, "skip_lockkeys")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, skip_lockkeys);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -skip_lockkeys mode\n");
-		skip_lockkeys = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noskip_lockkeys")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !skip_lockkeys);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -skip_lockkeys mode\n");
-		skip_lockkeys = 0;
-		goto done;
-	}
-	if (strstr(p, "skip_keycodes") == p) {
-		COLON_CHECK("skip_keycodes:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(skip_keycodes));
-			goto qry;
-		}
-		p += strlen("skip_keycodes:");
-		rfbLog("remote_cmd: setting xkb -skip_keycodes"
-		    " to:\n\t'%s'\n", p);
-		if (! xkb_present) {
-			rfbLog("remote_cmd: warning xkb not present\n");
-		} else if (! use_xkb_modtweak) {
-			rfbLog("remote_cmd: turning on xkb.\n");
-			use_xkb_modtweak = 1;
-			if (! use_modifier_tweak) {
-				rfbLog("remote_cmd: turning on modtweak.\n");
-				use_modifier_tweak = 1;
-			}
-		}
-		if (skip_keycodes) free(skip_keycodes);
-		skip_keycodes = strdup(p);
-		initialize_modtweak();
-		goto done;
-	}
-	if (!strcmp(p, "sloppy_keys")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, sloppy_keys);
-			goto qry;
-		}
-		sloppy_keys += 1;
-		rfbLog("remote_cmd: set sloppy_keys to: %d\n", sloppy_keys);
-		goto done;
-	}
-	if (!strcmp(p, "nosloppy_keys")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !sloppy_keys);
-			goto qry;
-		}
-		sloppy_keys = 0;
-		rfbLog("remote_cmd: set sloppy_keys to: %d\n", sloppy_keys);
-		goto done;
-	}
-	if (!strcmp(p, "skip_dups")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    skip_duplicate_key_events);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -skip_dups mode\n");
-		skip_duplicate_key_events = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noskip_dups")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !skip_duplicate_key_events);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -skip_dups mode\n");
-		skip_duplicate_key_events = 0;
-		goto done;
-	}
-	if (!strcmp(p, "add_keysyms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, add_keysyms);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -add_keysyms mode.\n");
-		add_keysyms = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noadd_keysyms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !add_keysyms);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -add_keysyms mode.\n");
-		add_keysyms = 0;
-		goto done;
-	}
-	if (!strcmp(p, "clear_mods")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, clear_mods == 1);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -clear_mods mode.\n");
-		clear_mods = 1;
-		if (use_threads) {X_LOCK;}
-		clear_modifiers(0);
-		if (use_threads) {X_UNLOCK;}
-		goto done;
-	}
-	if (!strcmp(p, "noclear_mods")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !(clear_mods == 1));
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -clear_mods mode.\n");
-		clear_mods = 0;
-		goto done;
-	}
-	if (!strcmp(p, "clear_keys")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    clear_mods == 2);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -clear_keys mode.\n");
-		clear_mods = 2;
-		if (use_threads) {X_LOCK;}
-		clear_keys();
-		if (use_threads) {X_UNLOCK;}
-		goto done;
-	}
-	if (!strcmp(p, "noclear_keys")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !(clear_mods == 2));
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling -clear_keys mode.\n");
-		clear_mods = 0;
-		goto done;
-	}
-	if (!strcmp(p, "clear_all")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    clear_mods == 3);
-			goto qry;
-		}
-		rfbLog("remote_cmd: doing clear_all action.\n");
-		clear_mods = 3;
-		if (use_threads) {X_LOCK;}
-		clear_keys();
-		clear_locks();
-		if (use_threads) {X_UNLOCK;}
-		goto done;
-	}
-	if (!strcmp(p, "clear_locks")) {
-		NOTAPP
-		rfbLog("remote_cmd: doing clear_locks action.\n");
-		if (use_threads) {X_LOCK;}
-		clear_locks();
-		if (use_threads) {X_UNLOCK;}
-		goto done;
-	}
-	if (!strcmp(p, "keystate")) {
-		int i, state[256];
-		NOTAPP
-		for (i=0; i<256; i++) {
-			state[i] = 0;
-		}
-		if (use_threads) {X_LOCK;}
-		get_keystate(state);
-		if (use_threads) {X_UNLOCK;}
-		for (i=0; i<256; i++) {
-			fprintf(stderr, "keystate[%03d] %d\n", i, state[i]);
-		}
-		goto done;
-	}
-	if (strstr(p, "remap") == p) {
-		char *before, *old;
-		COLON_CHECK("remap:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(remap_file));
-			goto qry;
-		}
-		p += strlen("remap:");
-		if ((*p == '+' || *p == '-') && remap_file &&
-		    strchr(remap_file, '/')) {
-			rfbLog("remote_cmd: cannot use remap:+/-\n");
-			rfbLog("in '-remap %s' mode.\n", remap_file);
-			goto done;
-		}
-		if (remap_file) {
-			before = strdup(remap_file);
-		} else {
-			before = strdup("");
-		}
-		old = remap_file;
-		if (*p == '+') {
-			p++;
-			remap_file = add_item(remap_file, p);
-		} else if (*p == '-') {
-			p++;
-			remap_file = delete_item(remap_file, p);
-			if (! strchr(remap_file, '-')) {
-				*remap_file = '\0';
-			}
-		} else {
-			remap_file = strdup(p);
-		}
-		if (strcmp(before, remap_file)) {
-			rfbLog("remote_cmd: changed -remap\n");
-			rfbLog(" from: %s\n", before);
-			rfbLog(" to:   %s\n", remap_file);
-			initialize_remap(remap_file);
-		}
-		if (old) free(old);
-		free(before);
-		goto done;
-	}
-	if (!strcmp(p, "repeat")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !no_autorepeat);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -repeat mode.\n");
-		autorepeat(1, 0);	/* restore initial setting */
-		no_autorepeat = 0;
-		goto done;
-	}
-	if (!strcmp(p, "norepeat")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, no_autorepeat);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -norepeat mode.\n");
-		no_autorepeat = 1;
-		if (no_repeat_countdown >= 0) {
-			no_repeat_countdown = 2;
-		}
-		if (client_count && ! view_only) {
-			autorepeat(0, 0);	/* disable if any clients */
-		}
-		goto done;
-	}
-	if (!strcmp(p, "fb")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !nofb);
-			goto qry;
-		}
-		if (nofb) {
-			rfbLog("remote_cmd: disabling nofb mode.\n");
-			rfbLog("  you may need to these turn back on:\n");
-			rfbLog("     xfixes, xdamage, solid, flashcmap\n");
-			rfbLog("     overlay, shm, noonetile, nap, cursor\n");
-			rfbLog("     cursorpos, cursorshape, bell.\n");
-			nofb = 0;
-			set_nofb_params(1);
-			do_new_fb(1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "nofb")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, nofb);
-			goto qry;
-		}
-		if (!nofb) {
-			rfbLog("remote_cmd: enabling nofb mode.\n");
-			if (main_fb) {
-				push_black_screen(4);
-			}
-			nofb = 1;
-			sound_bell = 0;
-			initialize_watch_bell();
-			set_nofb_params(0);
-			do_new_fb(1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "bell")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, sound_bell);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling bell (if supported).\n");
-		initialize_watch_bell();
-		sound_bell = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nobell")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !sound_bell);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling bell.\n");
-		initialize_watch_bell();
-		sound_bell = 0;
-		goto done;
-	}
-	if (!strcmp(p, "sendbell")) {
-		NOTAPP
-		rfbLog("remote_cmd: sendbell.\n");
-		if (screen && client_count) {
-			rfbSendBell(screen);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "sel")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, watch_selection);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling watch selection+primary.\n");
-		watch_selection = 1;
-		watch_primary = 1;
-		watch_clipboard = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nosel")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !watch_selection);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling watch selection+primary.\n");
-		watch_selection = 0;
-		watch_primary = 0;
-		watch_clipboard = 0;
-		goto done;
-	}
-	if (!strcmp(p, "primary")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, watch_primary);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling watch_primary.\n");
-		watch_primary = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noprimary")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !watch_primary);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling watch_primary.\n");
-		watch_primary = 0;
-		goto done;
-	}
-	if (!strcmp(p, "setprimary")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, set_primary);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling set_primary.\n");
-		set_primary = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nosetprimary")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !set_primary);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling set_primary.\n");
-		set_primary = 0;
-		goto done;
-	}
-	if (!strcmp(p, "clipboard")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, watch_clipboard);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling watch_clipboard.\n");
-		watch_clipboard = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noclipboard")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !watch_clipboard);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling watch_clipboard.\n");
-		watch_clipboard = 0;
-		goto done;
-	}
-	if (!strcmp(p, "setclipboard")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, set_clipboard);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling set_clipboard.\n");
-		set_clipboard = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nosetclipboard")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !set_clipboard);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling set_clipboard.\n");
-		set_clipboard = 0;
-		goto done;
-	}
-	if (strstr(p, "seldir") == p) {
-		COLON_CHECK("seldir:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(sel_direction));
-			goto qry;
-		}
-		p += strlen("seldir:");
-		rfbLog("remote_cmd: setting -seldir to %s\n", p);
-		if (sel_direction) free(sel_direction);
-		sel_direction = strdup(p);
-		goto done;
-	}
-	if (!strcmp(p, "set_no_cursor")) { /* skip-cmd-list */
-		rfbLog("remote_cmd: calling set_no_cursor()\n");
-		set_no_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "cursorshape")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    cursor_shape_updates);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on cursorshape mode.\n");
-
-		set_no_cursor();
-		cursor_shape_updates = 1;
-		restore_cursor_shape_updates(screen);
-		first_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "nocursorshape")) {
-		int i, max = 5;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !cursor_shape_updates);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off cursorshape mode.\n");
-		
-		set_no_cursor();
-		for (i=0; i<max; i++) {
-			/* XXX: try to force empty cursor back to client */
-			rfbPE(-1);
-		}
-		cursor_shape_updates = 0;
-		disable_cursor_shape_updates(screen);
-		first_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "cursorpos")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    cursor_pos_updates);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on cursorpos mode.\n");
-		cursor_pos_updates = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nocursorpos")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !cursor_pos_updates);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off cursorpos mode.\n");
-		cursor_pos_updates = 0;
-		goto done;
-	}
-	if (!strcmp(p, "cursor_drag")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, cursor_drag_changes);
-			goto qry;
-		}
-		cursor_drag_changes = 1;
-		rfbLog("remote_cmd: setting cursor_drag_changes: %d.\n", cursor_drag_changes);
-		goto done;
-	}
-	if (!strcmp(p, "nocursor_drag")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !cursor_drag_changes);
-			goto qry;
-		}
-		cursor_drag_changes = 0;
-		rfbLog("remote_cmd: setting cursor_drag_changes: %d.\n", cursor_drag_changes);
-		goto done;
-	}
-	if (strstr(p, "cursor") == p) {
-		COLON_CHECK("cursor:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(multiple_cursors_mode));
-			goto qry;
-		}
-		p += strlen("cursor:");
-		if (multiple_cursors_mode) {
-			if (prev_cursors_mode) free(prev_cursors_mode);
-			prev_cursors_mode = strdup(multiple_cursors_mode);
-			free(multiple_cursors_mode);
-		}
-		multiple_cursors_mode = strdup(p);
-
-		rfbLog("remote_cmd: changed -cursor mode "
-		    "to: %s\n", multiple_cursors_mode);
-
-		if (strcmp(multiple_cursors_mode, "none") && !show_cursor) {
-			show_cursor = 1;
-			rfbLog("remote_cmd: changed show_cursor "
-			    "to: %d\n", show_cursor);
-		}
-		initialize_cursors_mode();
-		first_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "show_cursor")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, show_cursor);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling show_cursor.\n");
-		show_cursor = 1;
-		if (multiple_cursors_mode && !strcmp(multiple_cursors_mode,
-		    "none")) {
-			free(multiple_cursors_mode);
-			if (prev_cursors_mode) {
-				multiple_cursors_mode =
-				    strdup(prev_cursors_mode);
-			} else {
-				multiple_cursors_mode = strdup("default");
-			}
-			rfbLog("remote_cmd: changed -cursor mode "
-			    "to: %s\n", multiple_cursors_mode);
-		}
-		initialize_cursors_mode();
-		first_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "noshow_cursor") || !strcmp(p, "nocursor")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !show_cursor);
-			goto qry;
-		}
-		if (prev_cursors_mode) free(prev_cursors_mode);
-		prev_cursors_mode = strdup(multiple_cursors_mode);
-
-		rfbLog("remote_cmd: disabling show_cursor.\n");
-		show_cursor = 0;
-		initialize_cursors_mode();
-		first_cursor();
-		goto done;
-	}
-	if (strstr(p, "arrow") == p) {
-		COLON_CHECK("arrow:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, alt_arrow);
-			goto qry;
-		}
-		p += strlen("arrow:");
-		alt_arrow = atoi(p);
-		rfbLog("remote_cmd: setting alt_arrow: %d.\n", alt_arrow);
-		setup_cursors_and_push();
-		goto done;
-	}
-	if (!strcmp(p, "xfixes")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_xfixes);
-			goto qry;
-		}
-		if (! xfixes_present) {
-			rfbLog("remote_cmd: cannot enable xfixes "
-			    "(not supported on X display)\n");
-			goto done;
-		}
-		rfbLog("remote_cmd: enabling -xfixes"
-		    " (if supported).\n");
-		use_xfixes = 1;
-		initialize_xfixes();
-		first_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "noxfixes")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !use_xfixes);
-			goto qry;
-		}
-		if (! xfixes_present) {
-			rfbLog("remote_cmd: disabling xfixes  "
-			    "(but not supported on X display)\n");
-			goto done;
-		}
-		rfbLog("remote_cmd: disabling -xfixes.\n");
-		use_xfixes = 0;
-		initialize_xfixes();
-		first_cursor();
-		goto done;
-	}
-	if (!strcmp(p, "xdamage")) {
-		int orig = use_xdamage;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_xdamage);
-			goto qry;
-		}
-		if (! xdamage_present) {
-			rfbLog("remote_cmd: cannot enable xdamage hints "
-			    "(not supported on X display)\n");
-			goto done;
-		}
-		rfbLog("remote_cmd: enabling xdamage hints"
-		    " (if supported).\n");
-		use_xdamage = 1;
-		if (use_xdamage != orig) {
-			initialize_xdamage();
-			create_xdamage_if_needed(0);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noxdamage")) {
-		int orig = use_xdamage;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !use_xdamage);
-			goto qry;
-		}
-		if (! xdamage_present) {
-			rfbLog("remote_cmd: disabling xdamage hints "
-			    "(but not supported on X display)\n");
-			goto done;
-		}
-		rfbLog("remote_cmd: disabling xdamage hints.\n");
-		use_xdamage = 0;
-		if (use_xdamage != orig) {
-			initialize_xdamage();
-			destroy_xdamage_if_needed();
-		}
-		goto done;
-	}
-	if (strstr(p, "xd_area") == p) {
-		int a;
-		COLON_CHECK("xd_area:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    xdamage_max_area);
-			goto qry;
-		}
-		p += strlen("xd_area:");
-		a = atoi(p);
-		if (a >= 0) {
-			rfbLog("remote_cmd: setting xdamage_max_area "
-			    "%d -> %d.\n", xdamage_max_area, a);
-			xdamage_max_area = a;
-		}
-		goto done;
-	}
-	if (strstr(p, "xd_mem") == p) {
-		double a;
-		COLON_CHECK("xd_mem:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%.3f", p, co,
-			    xdamage_memory);
-			goto qry;
-		}
-		p += strlen("xd_mem:");
-		a = atof(p);
-		if (a >= 0.0) {
-			rfbLog("remote_cmd: setting xdamage_memory "
-			    "%.3f -> %.3f.\n", xdamage_memory, a);
-			xdamage_memory = a;
-		}
-		goto done;
-	}
-	if (strstr(p, "alphacut") == p) {
-		int a;
-		COLON_CHECK("alphacut:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    alpha_threshold);
-			goto qry;
-		}
-		p += strlen("alphacut:");
-		a = atoi(p);
-		if (a < 0) a = 0;
-		if (a > 256) a = 256;	/* allow 256 for testing. */
-		if (alpha_threshold != a) {
-			rfbLog("remote_cmd: setting alphacut "
-			    "%d -> %d.\n", alpha_threshold, a);
-			if (a == 256) {
-				rfbLog("note: alphacut=256 leads to completely"
-				    " transparent cursors.\n");
-			}
-			alpha_threshold = a;
-			setup_cursors_and_push();
-		}
-		goto done;
-	}
-	if (strstr(p, "alphafrac") == p) {
-		double a;
-		COLON_CHECK("alphafrac:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%f", p, co,
-			    alpha_frac);
-			goto qry;
-		}
-		p += strlen("alphafrac:");
-		a = atof(p);
-		if (a < 0.0) a = 0.0;
-		if (a > 1.0) a = 1.0;
-		if (alpha_frac != a) {
-			rfbLog("remote_cmd: setting alphafrac "
-			    "%f -> %f.\n", alpha_frac, a);
-			alpha_frac = a;
-			setup_cursors_and_push();
-		}
-		goto done;
-	}
-	if (strstr(p, "alpharemove") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, alpha_remove);
-			goto qry;
-		}
-		if (!alpha_remove) {
-			rfbLog("remote_cmd: enable alpharemove\n");
-			alpha_remove = 1;
-			setup_cursors_and_push();
-		}
-		goto done;
-	}
-	if (strstr(p, "noalpharemove") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !alpha_remove);
-			goto qry;
-		}
-		if (alpha_remove) {
-			rfbLog("remote_cmd: disable alpharemove\n");
-			alpha_remove = 0;
-			setup_cursors_and_push();
-		}
-		goto done;
-	}
-	if (strstr(p, "alphablend") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, alpha_blend);
-			goto qry;
-		}
-		if (!alpha_blend) {
-			rfbLog("remote_cmd: enable alphablend\n");
-			alpha_remove = 0;
-			alpha_blend = 1;
-			setup_cursors_and_push();
-		}
-		goto done;
-	}
-	if (strstr(p, "noalphablend") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !alpha_blend);
-			goto qry;
-		}
-		if (alpha_blend) {
-			rfbLog("remote_cmd: disable alphablend\n");
-			alpha_blend = 0;
-			setup_cursors_and_push();
-		}
-		goto done;
-	}
-	if (strstr(p, "xwarppointer") == p || strstr(p, "xwarp") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_xwarppointer);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on xwarppointer mode.\n");
-		use_xwarppointer = 1;
-		goto done;
-	}
-	if (strstr(p, "noxwarppointer") == p ||
-		    strstr(p, "noxwarp") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !use_xwarppointer);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off xwarppointer mode.\n");
-		use_xwarppointer = 0;
-		goto done;
-	}
-	if (strstr(p, "always_inject") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, always_inject);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on always_inject mode.\n");
-		always_inject = 1;
-		goto done;
-	}
-	if (strstr(p, "noalways_inject") == p) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !always_inject);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off always_inject mode.\n");
-		always_inject = 0;
-		goto done;
-	}
-	if (strstr(p, "buttonmap") == p) {
-		COLON_CHECK("buttonmap:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(pointer_remap));
-			goto qry;
-		}
-		p += strlen("buttonmap:");
-		if (pointer_remap) free(pointer_remap);
-		pointer_remap = strdup(p);
-
-		rfbLog("remote_cmd: setting -buttonmap to:\n\t'%s'\n", p);
-		initialize_pointer_map(p);
-		goto done;
-	}
-	if (!strcmp(p, "dragging")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, show_dragging);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling mouse dragging mode.\n");
-		show_dragging = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nodragging")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !show_dragging);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling mouse nodragging mode.\n");
-		show_dragging = 0;
-		goto done;
-	}
-#ifndef NO_NCACHE
-	if (!strcmp(p, "ncache_cr")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncache_copyrect);
-			goto qry;
-		}
-		ncache_copyrect = 1;
-		rfbLog("remote_cmd: set -ncache_cr %d\n", ncache_copyrect);
-		goto done;
-	}
-	if (!strcmp(p, "noncache_cr")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_copyrect);
-			goto qry;
-		}
-		ncache_copyrect = 0;
-		rfbLog("remote_cmd: disabled -ncache_cr %d\n", ncache_copyrect);
-
-		goto done;
-	}
-	if (!strcmp(p, "ncache_no_moveraise")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_wf_raises);
-			goto qry;
-		}
-		ncache_wf_raises = 0;
-		rfbLog("remote_cmd: set -ncache_no_moveraise\n");
-		goto done;
-	}
-	if (!strcmp(p, "noncache_no_moveraise")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncache_wf_raises);
-			goto qry;
-		}
-		ncache_wf_raises = 1;
-		rfbLog("remote_cmd: disabled -ncache_no_moveraise\n");
-		goto done;
-	}
-	if (!strcmp(p, "ncache_no_dtchange")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_dt_change);
-			goto qry;
-		}
-		ncache_dt_change = 0;
-		rfbLog("remote_cmd: set -ncache_no_dt_change\n");
-		goto done;
-	}
-	if (!strcmp(p, "noncache_no_dtchange")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncache_dt_change);
-			goto qry;
-		}
-		ncache_dt_change = 1;
-		rfbLog("remote_cmd: disabled -ncache_no_dt_change\n");
-		goto done;
-	}
-	if (!strcmp(p, "ncache_no_rootpixmap")) {
-		int orig = ncache_xrootpmap;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_xrootpmap);
-			goto qry;
-		}
-		ncache_xrootpmap = 0;
-		rfbLog("remote_cmd: set -ncache_no_rootpixmap\n");
-		if (orig != ncache_xrootpmap) {
-			do_new_fb(1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noncache_no_rootpixmap")) {
-		int orig = ncache_xrootpmap;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncache_xrootpmap);
-			goto qry;
-		}
-		ncache_xrootpmap = 1;
-		rfbLog("remote_cmd: disabled -ncache_no_rootpixmap\n");
-		if (orig != ncache_xrootpmap) {
-			do_new_fb(1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "ncache_reset_rootpixmap") || !strcmp(p, "ncrp")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_xrootpmap);
-			goto qry;
-		}
-		if (ncache_xrootpmap) {
-			rfbLog("remote_cmd: resetting root pixmap.\n");
-			set_ncache_xrootpmap();
-		}
-		goto done;
-	}
-	if (!strcmp(p, "ncache_keep_anims")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncache_keep_anims);
-			goto qry;
-		}
-		kde_no_animate(0);
-		ncache_keep_anims = 1;
-		rfbLog("remote_cmd: set -ncache_keep_anims\n");
-		goto done;
-	}
-	if (!strcmp(p, "noncache_keep_anims")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_keep_anims);
-			goto qry;
-		}
-		ncache_keep_anims = 0;
-		kde_no_animate(1);
-		rfbLog("remote_cmd: disabled -ncache_keep_anims\n");
-		goto done;
-	}
-	if (!strcmp(p, "ncache_old_wm")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncache_old_wm);
-			goto qry;
-		}
-		ncache_old_wm = 1;
-		rfbLog("remote_cmd: set -ncache_old_wm\n");
-		goto done;
-	}
-	if (!strcmp(p, "noncache_old_wm")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache_old_wm);
-			goto qry;
-		}
-		ncache_old_wm = 0;
-		rfbLog("remote_cmd: disabled -ncache_old_wm\n");
-		goto done;
-	}
-	if (strstr(p, "ncache_pad") == p) {
-		int orig = ncache_pad, n;
-		COLON_CHECK("ncache_pad:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, ncache_pad);
-			goto qry;
-		}
-		p += strlen("ncache_pad:");
-		n = atoi(p);
-
-		rfbLog("remote_cmd: setting ncache_pad %d to: %d\n", orig, n);
-		goto done;
-	}
-	if (!strcmp(p, "ncache")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !!ncache);
-			goto qry;
-		}
-		ncache = ncache0;
-		rfbLog("remote_cmd: set ncache %d\n", ncache);
-		goto done;
-	}
-	if (!strcmp(p, "noncache")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncache);
-			goto qry;
-		}
-		ncache = 0;
-		rfbLog("remote_cmd: disabled ncache %d\n", ncache);
-		goto done;
-	}
-	if (strstr(p, "ncache_size") == p) {
-		int orig = ncache, n;
-		COLON_CHECK("ncache_size:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, ncache);
-			goto qry;
-		}
-		p += strlen("ncache_size:");
-		n = atoi(p);
-
-		if (n >= 0 && n != ncache) {
-			rfbLog("remote_cmd: setting ncache %d to: %d\n", orig, ncache);
-			ncache = n;
-			do_new_fb(1);
-			if (client_count) {
-				check_ncache(1,0);
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "debug_ncache")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ncdb);
-			goto qry;
-		}
-		ncdb = 1;
-		rfbLog("remote_cmd: enabled debug_ncache\n");
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_ncache")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ncdb);
-			goto qry;
-		}
-		ncdb = 0;
-		rfbLog("remote_cmd: disabled debug_ncache\n");
-		goto done;
-	}
-#endif
-	if (strstr(p, "wireframe_mode") == p) {
-		COLON_CHECK("wireframe_mode:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    wireframe_str ? wireframe_str : WIREFRAME_PARMS);
-			goto qry;
-		}
-		p += strlen("wireframe_mode:");
-		if (*p) {
-			if (wireframe_str) {
-				free(wireframe_str);
-			}
-			wireframe_str = strdup(p);
-			parse_wireframe();
-		}
-		rfbLog("remote_cmd: enabling -wireframe mode.\n");
-		wireframe = 1;
-		goto done;
-	}
-	if (strstr(p, "wireframe:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("wireframe:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, wireframe);
-			goto qry;
-		}
-		p += strlen("wireframe:");
-		if (*p) {
-			if (wireframe_str) {
-				free(wireframe_str);
-			}
-			wireframe_str = strdup(p);
-			parse_wireframe();
-		}
-		rfbLog("remote_cmd: enabling -wireframe mode.\n");
-		wireframe = 1;
-		goto done;
-	}
-	if (strstr(p, "wf:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("wf:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, wireframe);
-			goto qry;
-		}
-		p += strlen("wf:");
-		if (*p) {
-			if (wireframe_str) {
-				free(wireframe_str);
-			}
-			wireframe_str = strdup(p);
-			parse_wireframe();
-		}
-		rfbLog("remote_cmd: enabling -wireframe mode.\n");
-		wireframe = 1;
-		goto done;
-	}
-	if (!strcmp(p, "wireframe") || !strcmp(p, "wf")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, wireframe);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -wireframe mode.\n");
-		wireframe = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nowireframe") || !strcmp(p, "nowf")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !wireframe);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -nowireframe mode.\n");
-		wireframe = 0;
-		goto done;
-	}
-	if (!strcmp(p, "wireframelocal") || !strcmp(p, "wfl")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, wireframe_local);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -wireframelocal mode.\n");
-		wireframe_local = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nowireframelocal") || !strcmp(p, "nowfl")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !wireframe_local);
-			goto qry;
-		}
-		rfbLog("remote_cmd: enabling -nowireframelocal mode.\n");
-		wireframe_local = 0;
-		goto done;
-	}
-	if (strstr(p, "wirecopyrect") == p) {
-		COLON_CHECK("wirecopyrect:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(wireframe_copyrect));
-			goto qry;
-		}
-		p += strlen("wirecopyrect:");
-
-		set_wirecopyrect_mode(p);
-		rfbLog("remote_cmd: changed -wirecopyrect mode "
-		    "to: %s\n", NONUL(wireframe_copyrect));
-		got_wirecopyrect = 1;
-		goto done;
-	}
-	if (strstr(p, "wcr") == p) {
-		COLON_CHECK("wcr:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(wireframe_copyrect));
-			goto qry;
-		}
-		p += strlen("wcr:");
-
-		set_wirecopyrect_mode(p);
-		rfbLog("remote_cmd: changed -wirecopyrect mode "
-		    "to: %s\n", NONUL(wireframe_copyrect));
-		got_wirecopyrect = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nowirecopyrect") || !strcmp(p, "nowcr")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%s", p,
-			    NONUL(wireframe_copyrect));
-			goto qry;
-		}
-
-		set_wirecopyrect_mode("never");
-		rfbLog("remote_cmd: changed -wirecopyrect mode "
-		    "to: %s\n", NONUL(wireframe_copyrect));
-		goto done;
-	}
-	if (strstr(p, "scr_area") == p) {
-		COLON_CHECK("scr_area:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    scrollcopyrect_min_area);
-			goto qry;
-		}
-		p += strlen("scr_area:");
-
-		scrollcopyrect_min_area = atoi(p);
-		rfbLog("remote_cmd: changed -scr_area to: %d\n",
-		    scrollcopyrect_min_area);
-		goto done;
-	}
-	if (strstr(p, "scr_skip") == p) {
-		char *s = scroll_skip_str;
-		COLON_CHECK("scr_skip:")
-		if (!s || *s == '\0') s = scroll_skip_str0;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s));
-			goto qry;
-		}
-		p += strlen("scr_skip:");
-		if (scroll_skip_str) {
-			free(scroll_skip_str);
-		}
-
-		scroll_skip_str = strdup(p);
-		rfbLog("remote_cmd: changed -scr_skip to: %s\n",
-		    scroll_skip_str);
-		initialize_scroll_matches();
-		goto done;
-	}
-	if (strstr(p, "scr_inc") == p) {
-		char *s = scroll_good_str;
-		if (!s || *s == '\0') s = scroll_good_str0;
-		COLON_CHECK("scr_inc:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s));
-			goto qry;
-		}
-		p += strlen("scr_inc:");
-		if (scroll_good_str) {
-			free(scroll_good_str);
-		}
-
-		scroll_good_str = strdup(p);
-		rfbLog("remote_cmd: changed -scr_inc to: %s\n",
-		    scroll_good_str);
-		initialize_scroll_matches();
-		goto done;
-	}
-	if (strstr(p, "scr_keys") == p) {
-		COLON_CHECK("scr_keys:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(scroll_key_list_str));
-			goto qry;
-		}
-		p += strlen("scr_keys:");
-		if (scroll_key_list_str) {
-			free(scroll_key_list_str);
-		}
-
-		scroll_key_list_str = strdup(p);
-		rfbLog("remote_cmd: changed -scr_keys to: %s\n",
-		    scroll_key_list_str);
-		initialize_scroll_keys();
-		goto done;
-	}
-	if (strstr(p, "scr_term") == p) {
-		char *s = scroll_term_str;
-		if (!s || *s == '\0') s = scroll_term_str0;
-		COLON_CHECK("scr_term:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s));
-			goto qry;
-		}
-		p += strlen("scr_term:");
-		if (scroll_term_str) {
-			free(scroll_term_str);
-		}
-
-		scroll_term_str = strdup(p);
-		rfbLog("remote_cmd: changed -scr_term to: %s\n",
-		    scroll_term_str);
-		initialize_scroll_term();
-		goto done;
-	}
-	if (strstr(p, "scr_keyrepeat") == p) {
-		char *s = max_keyrepeat_str;
-		if (!s || *s == '\0') s = max_keyrepeat_str0;
-		COLON_CHECK("scr_keyrepeat:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s));
-			goto qry;
-		}
-		p += strlen("scr_keyrepeat:");
-		if (max_keyrepeat_str) {
-			free(max_keyrepeat_str);
-		}
-
-		max_keyrepeat_str = strdup(p);
-		rfbLog("remote_cmd: changed -scr_keyrepeat to: %s\n",
-		    max_keyrepeat_str);
-		initialize_max_keyrepeat();
-		goto done;
-	}
-	if (strstr(p, "scr_parms") == p) {
-		COLON_CHECK("scr_parms:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    scroll_copyrect_str ? scroll_copyrect_str
-			    : SCROLL_COPYRECT_PARMS);
-			goto qry;
-		}
-		p += strlen("scr_parms:");
-		if (*p) {
-			if (scroll_copyrect_str) {
-				free(scroll_copyrect_str);
-			}
-			set_scrollcopyrect_mode("always");
-			scroll_copyrect_str = strdup(p);
-			parse_scroll_copyrect();
-		}
-		rfbLog("remote_cmd: set -scr_parms %s.\n",
-		    NONUL(scroll_copyrect_str));
-		got_scrollcopyrect = 1;
-		goto done;
-	}
-	if (strstr(p, "scrollcopyrect") == p) {
-		COLON_CHECK("scrollcopyrect:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(scroll_copyrect));
-			goto qry;
-		}
-		p += strlen("scrollcopyrect:");
-
-		set_scrollcopyrect_mode(p);
-		rfbLog("remote_cmd: changed -scrollcopyrect mode "
-		    "to: %s\n", NONUL(scroll_copyrect));
-		got_scrollcopyrect = 1;
-		goto done;
-	}
-	if (!strcmp(p, "scr") ||
-	    strstr(p, "scr:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("scr:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(scroll_copyrect));
-			goto qry;
-		}
-		p += strlen("scr:");
-
-		set_scrollcopyrect_mode(p);
-		rfbLog("remote_cmd: changed -scrollcopyrect mode "
-		    "to: %s\n", NONUL(scroll_copyrect));
-		got_scrollcopyrect = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noscrollcopyrect") || !strcmp(p, "noscr")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%s", p,
-			    NONUL(scroll_copyrect));
-			goto qry;
-		}
-
-		set_scrollcopyrect_mode("never");
-		rfbLog("remote_cmd: changed -scrollcopyrect mode "
-		    "to: %s\n", NONUL(scroll_copyrect));
-		goto done;
-	}
-	if (strstr(p, "fixscreen") == p) {
-		COLON_CHECK("fixscreen:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(screen_fixup_str));
-			goto qry;
-		}
-		p += strlen("fixscreen:");
-		if (screen_fixup_str) {
-			free(screen_fixup_str);
-		}
-		screen_fixup_str = strdup(p);
-		parse_fixscreen();
-		rfbLog("remote_cmd: set -fixscreen %s.\n",
-		    NONUL(screen_fixup_str));
-		goto done;
-	}
-	if (!strcmp(p, "noxrecord")) {
-		int orig = noxrecord;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, noxrecord);
-			goto qry;
-		}
-		noxrecord = 1;
-		rfbLog("set noxrecord to: %d\n", noxrecord);
-		if (orig != noxrecord) {
-			shutdown_xrecord();
-		}
-		goto done;
-	}
-	if (!strcmp(p, "xrecord")) {
-		int orig = noxrecord;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !noxrecord);
-			goto qry;
-		}
-		noxrecord = 0;
-		rfbLog("set noxrecord to: %d\n", noxrecord);
-		if (orig != noxrecord) {
-			initialize_xrecord();
-		}
-		goto done;
-	}
-	if (!strcmp(p, "reset_record")) {
-		NOTAPP
-		if (use_xrecord) {
-			rfbLog("resetting RECORD\n");
-			check_xrecord_reset(1);
-		} else {
-			rfbLog("RECORD is disabled, not resetting.\n");
-		}
-		goto done;
-	}
-	if (strstr(p, "pointer_mode") == p) {
-		int pm;
-		COLON_CHECK("pointer_mode:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, pointer_mode);
-			goto qry;
-		}
-		p += strlen("pointer_mode:");
-		pm = atoi(p);
-		if (pm < 0 || pm > pointer_mode_max) {
-			rfbLog("remote_cmd: pointer_mode out of range:"
-			   " 1-%d: %d\n", pointer_mode_max, pm);
-		} else {
-			rfbLog("remote_cmd: setting pointer_mode %d\n", pm);
-			pointer_mode = pm;
-		}
-		goto done;
-	}
-	if (strstr(p, "pm") == p) {
-		int pm;
-		COLON_CHECK("pm:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, pointer_mode);
-			goto qry;
-		}
-		p += strlen("pm:");
-		pm = atoi(p);
-		if (pm < 0 || pm > pointer_mode_max) {
-			rfbLog("remote_cmd: pointer_mode out of range:"
-			   " 1-%d: %d\n", pointer_mode_max, pm);
-		} else {
-			rfbLog("remote_cmd: setting pointer_mode %d\n", pm);
-			pointer_mode = pm;
-		}
-		goto done;
-	}
-	if (strstr(p, "input_skip") == p) {
-		int is;
-		COLON_CHECK("input_skip:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, ui_skip);
-			goto qry;
-		}
-		p += strlen("input_skip:");
-		is = atoi(p);
-		rfbLog("remote_cmd: setting input_skip %d\n", is);
-		ui_skip = is;
-		goto done;
-	}
-	if (!strcmp(p, "allinput")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, all_input);
-			goto qry;
-		}
-		all_input = 1;
-		rfbLog("enabled allinput\n");
-		if (handle_events_eagerly) {
-			rfbLog("disabled input_eagerly\n");
-			handle_events_eagerly = 0;
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noallinput")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !all_input);
-			goto qry;
-		}
-		all_input = 0;
-		rfbLog("disabled allinput\n");
-		goto done;
-	}
-	if (!strcmp(p, "input_eagerly")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, handle_events_eagerly);
-			goto qry;
-		}
-		handle_events_eagerly = 1;
-		rfbLog("enabled input_eagerly\n");
-		if (all_input) {
-			rfbLog("disabled allinput\n");
-			all_input = 0;
-		}
-		goto done;
-	}
-	if (!strcmp(p, "noinput_eagerly")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !handle_events_eagerly);
-			goto qry;
-		}
-		handle_events_eagerly = 0;
-		rfbLog("disabled input_eagerly\n");
-		goto done;
-	}
-	if (strstr(p, "input") == p) {
-		int doit = 1;
-		COLON_CHECK("input:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(allowed_input_str));
-			goto qry;
-		}
-		p += strlen("input:");
-		if (allowed_input_str && !strcmp(p, allowed_input_str)) { /* skip-cmd-list */
-			doit = 0;
-		}
-		rfbLog("remote_cmd: setting input %s\n", p);
-		if (allowed_input_str) free(allowed_input_str);
-		if (*p == '\0') {
-			allowed_input_str = NULL;
-		} else {
-			allowed_input_str = strdup(p);
-		}
-		if (doit) {
-			initialize_allowed_input();
-		}
-		goto done;
-	}
-	if (!strcmp(p, "grabkbd")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, grab_kbd);
-			goto qry;
-		}
-		grab_kbd = 1;
-		if (grab_always) {
-			adjust_grabs(1, 0);
-		}
-		rfbLog("enabled grab_kbd\n");
-		goto done;
-	}
-	if (!strcmp(p, "nograbkbd")) {
-		int orig = grab_kbd;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !grab_kbd);
-			goto qry;
-		}
-		grab_kbd = 0;
-		if (orig && dpy) {
-#if !NO_X11
-			X_LOCK;
-			XUngrabKeyboard(dpy, CurrentTime);
-			X_UNLOCK;
-#endif
-		}
-		rfbLog("disabled grab_kbd\n");
-
-		goto done;
-	}
-	if (!strcmp(p, "grabptr")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, grab_ptr);
-			goto qry;
-		}
-		grab_ptr = 1;
-		if (grab_always) {
-			adjust_grabs(1, 0);
-		}
-		rfbLog("enabled grab_ptr\n");
-		goto done;
-	}
-	if (!strcmp(p, "ungrabboth")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, ungrab_both);
-			goto qry;
-		}
-		ungrab_both = 1;
-		rfbLog("enabled ungrab_both\n");
-		goto done;
-	}
-	if (!strcmp(p, "noungrabboth")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !ungrab_both);
-			goto qry;
-		}
-		ungrab_both = 0;
-		rfbLog("disabled ungrab_both\n");
-		goto done;
-	}
-	if (!strcmp(p, "nograbptr")) {
-		int orig = grab_ptr;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !grab_ptr);
-			goto qry;
-		}
-		grab_ptr = 0;
-		if (orig && dpy) {
-#if !NO_X11
-			X_LOCK;
-			XUngrabPointer(dpy, CurrentTime);
-			X_UNLOCK;
-#endif
-		}
-		rfbLog("disabled grab_ptr\n");
-		goto done;
-	}
-	if (!strcmp(p, "grabalways")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, grab_always);
-			goto qry;
-		}
-		grab_ptr = 1;
-		grab_kbd = 1;
-		grab_always = 1;
-		adjust_grabs(1, 0);
-		rfbLog("enabled grab_always\n");
-		goto done;
-	}
-	if (!strcmp(p, "nograbalways")) {
-		int orig = grab_always;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !grab_always);
-			goto qry;
-		}
-		grab_ptr = 0;
-		grab_kbd = 0;
-		grab_always = 0;
-		if (orig && dpy) {
-#if !NO_X11
-			X_LOCK;
-			XUngrabKeyboard(dpy, CurrentTime);
-			XUngrabPointer(dpy, CurrentTime);
-			X_UNLOCK;
-#endif
-		}
-		adjust_grabs(0, 0);
-		rfbLog("disabled grab_always\n");
-		goto done;
-	}
-	if (strstr(p, "grablocal") == p) {
-		COLON_CHECK("grablocal:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    grab_local);
-			goto qry;
-		}
-		p += strlen("grablocal:");
-
-		grab_local = atoi(p);
-		rfbLog("remote_cmd: changed -grablocal to: %d\n",
-		    grab_local);
-		goto done;
-	}
-	if (strstr(p, "client_input") == p) {
-		NOTAPP
-		COLON_CHECK("client_input:")
-		p += strlen("client_input:");
-		set_client_input(p);
-		goto done;
-	}
-	if (strstr(p, "ssltimeout") == p) {
-		int is;
-		COLON_CHECK("ssltimeout:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    ssl_timeout_secs);
-			goto qry;
-		}
-		p += strlen("ssltimeout:");
-		is = atoi(p);
-		rfbLog("remote_cmd: setting ssltimeout: %d\n", is);
-		ssl_timeout_secs = is;
-		goto done;
-	}
-	if (strstr(p, "speeds") == p) {
-		COLON_CHECK("speeds:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(speeds_str));
-			goto qry;
-		}
-		p += strlen("speeds:");
-		if (speeds_str) free(speeds_str);
-		speeds_str = strdup(p);
-
-		rfbLog("remote_cmd: setting -speeds to:\n\t'%s'\n", p);
-		initialize_speeds();
-		goto done;
-	}
-	if (strstr(p, "wmdt") == p) {
-		COLON_CHECK("wmdt:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(wmdt_str));
-			goto qry;
-		}
-		p += strlen("wmdt:");
-		if (wmdt_str) free(wmdt_str);
-		wmdt_str = strdup(p);
-
-		rfbLog("remote_cmd: setting -wmdt to: %s\n", p);
-		goto done;
-	}
-	if (!strcmp(p, "debug_pointer") || !strcmp(p, "dp")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_pointer);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on debug_pointer.\n");
-		debug_pointer = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_pointer") || !strcmp(p, "nodp")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_pointer);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off debug_pointer.\n");
-		debug_pointer = 0;
-		goto done;
-	}
-	if (!strcmp(p, "debug_keyboard") || !strcmp(p, "dk")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_keyboard);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning on debug_keyboard.\n");
-		debug_keyboard = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_keyboard") || !strcmp(p, "nodk")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_keyboard);
-			goto qry;
-		}
-		rfbLog("remote_cmd: turning off debug_keyboard.\n");
-		debug_keyboard = 0;
-		goto done;
-	}
-	if (strstr(p, "keycode") == p) {
-		int kc, down = -1;
-		char *c;
-		NOTAPP
-		COLON_CHECK("keycode:")
-		p += strlen("keycode:");
-		kc = atoi(p);
-		if (kc < 0) kc = 0;
-		kc = kc % 256;
-		c = strchr(p, ',');
-		if (c) down = atoi(c+1);
-		rfbLog("remote_cmd: insert keycode %d down=%d\n", kc, down);
-
-		if (macosx_console) {
-#ifdef MACOSX
-			if (down == -1) {
-				macosxCG_keycode_inject(1, kc);
-				usleep(50*1000);
-				macosxCG_keycode_inject(0, kc);
-			} else {
-				macosxCG_keycode_inject(down, kc);
-			}
-#endif
-		} else {
-			X_LOCK;
-			if (down == -1) {
-				XTestFakeKeyEvent_wr(dpy, kc, 1, CurrentTime);
-				usleep(50*1000);
-				XTestFakeKeyEvent_wr(dpy, kc, 0, CurrentTime);
-			} else {
-				XTestFakeKeyEvent_wr(dpy, kc, down, CurrentTime);
-			}
-			XFlush_wr(dpy);
-			X_UNLOCK;
-		}
-		goto done;
-	}
-	if (strstr(p, "keysym") == p) {
-		int down = -1;
-		unsigned int in;
-		KeySym ks;
-		char *c, *str;
-		NOTAPP
-		COLON_CHECK("keysym:")
-		p += strlen("keysym:");
-
-		c = strchr(p, ',');
-		if (c) {
-			down = atoi(c+1);
-			*c = '\0';
-		}
-
-		if (sscanf(p, "0x%x", &in) == 1) {
-			ks = (KeySym) in;
-		} else if (sscanf(p, "%u", &in) == 1) {
-			ks = (KeySym) in;
-		} else if ((ks = XStringToKeysym(p)) != NoSymbol) {
-			;
-		} else {
-			rfbLog("remote_cmd: bad keysym: %s\n", p);
-			goto done;
-		}
-		str = XKeysymToString(ks);
-		str = str ? str : "NoSymbol";
-		rfbLog("remote_cmd: insert keysym %s 0x%x '%s' down=%d\n", p, ks, str, down);
-		if (down == -1) {
-			keyboard(1, ks, NULL);
-			usleep(50*1000);
-			keyboard(0, ks, NULL);
-		} else {
-			keyboard(down, ks, NULL);
-		}
-		goto done;
-	}
-	if (strstr(p, "ptr") == p) {
-		int x, y, m = 0;
-		NOTAPP
-		COLON_CHECK("ptr:")
-		p += strlen("ptr:");
-		rfbLog("remote_cmd: insert pointer event: %s\n", p);
-		if (sscanf(p, "%d,%d,%d", &x, &y, &m) == 3) {
-			pointer_event(m, x, y, NULL);
-		} else if (sscanf(p, "%d,%d", &x, &y) == 2) {
-			pointer_event(m, x, y, NULL);
-		} else {
-			rfbLog("remote_cmd: bad ptr:x,y,mask\n");
-		}
-
-		goto done;
-	}
-	if (strstr(p, "fakebuttonevent") == p) {
-		int mb, down = 0;
-		NOTAPP
-		COLON_CHECK("fakebuttonevent:")
-		p += strlen("fakebuttonevent:");
-		rfbLog("remote_cmd: insert fakebuttonevent: %s\n", p);
-		if (sscanf(p, "%d,%d", &mb, &down) == 2) {
-			X_LOCK;
-			rfbLog("remote_cmd: XTestFakeButtonEvent(mb=%d, down=%d)\n", mb, down);
-			XTestFakeButtonEvent_wr(dpy, mb, down ? True : False, CurrentTime);
-			XFlush_wr(dpy);
-			X_UNLOCK;
-		}
-
-		goto done;
-	}
-	if (strstr(p, "sleep") == p) {
-		NOTAPP
-		COLON_CHECK("sleep:")
-		p += strlen("sleep:");
-		rfbLog("remote_cmd: sleeping: %s\n", p);
-		usleep((int) (1.0e+6 * atof(p)));
-		rfbLog("remote_cmd: done sleeping.\n");
-		goto done;
-	}
-	if (strstr(p, "get_xprop") == p) {
-		char *res;
-		unsigned long id;
-		Window win = None;	/* None implies root in get_xprop() */
-
-		/* note we force query and assume the colon is there. */
-		query = 1;
-		if (strstr(p, "get_xprop:") != p) { /* skip-cmd-list */
-			snprintf(buf, bufn, "ans=%s:N/A", p);
-			goto qry;
-		}
-		p += strlen("get_xprop:");
-
-		if (strstr(p, "id=") == p) {	/* skip-cmd-list */
-			p += strlen("id=");
-			if (scan_hexdec(p, &id)) {
-				win = (Window) id;
-			}
-			if (strchr(p, ':')) {
-				p = strchr(p, ':') + 1;
-			}
-		}
-
-		res = get_xprop(p, win);
-		if (res == NULL) {
-			res = strdup("NULL");
-		}
-		snprintf(buf, bufn, "ans=get_xprop:%s:%s", p, res);
-		free(res);
-
-		goto qry;
-	}
-	if (strstr(p, "set_xprop") == p) {
-		char *q;
-		int rc = -2;
-		unsigned long id;
-		Window win = None;	/* None implies root in set_xprop() */
-
-		/* note we force query and assume the colon is there. */
-		query = 1;
-		if (strstr(p, "set_xprop:") != p) { /* skip-cmd-list */
-			snprintf(buf, bufn, "ans=%s:N/A", p);
-			goto qry;
-		}
-		p += strlen("set_xprop:");
-
-		if (strstr(p, "id=") == p) {	/* skip-cmd-list */
-			p += strlen("id=");
-			if (scan_hexdec(p, &id)) {
-				win = (Window) id;
-			}
-			if (strchr(p, ':')) {
-				p = strchr(p, ':') + 1;
-			}
-		}
-
-		q = strchr(p, ':');
-		if (q) {
-			*q = '\0';
-			rc = set_xprop(p, win, q+1);
-			*q = ':';
-		}
-		snprintf(buf, bufn, "ans=set_xprop:%s:%d", p, rc);
-
-		goto qry;
-	}
-	if (strstr(p, "wininfo") == p) {
-		char *res, *t = "";
-		unsigned long id;
-		Window win = None;
-		int show_children = 0;
-
-		/* note we force query and assume the colon is there. */
-		query = 1;
-		if (strstr(p, "wininfo:") != p) { /* skip-cmd-list */
-			snprintf(buf, bufn, "ans=%s:N/A", p);
-			goto qry;
-		}
-		p += strlen("wininfo:");
-
-		if (p[0] == '+') {
-			show_children = 1;
-			t = "+";
-			p++;
-		}
-		if (!strcmp(p, "root")) { /* skip-cmd-list */
-			win = rootwin;
-		} else if (scan_hexdec(p, &id)) {
-			win = (Window) id;
-		}
-
-		res = wininfo(win, show_children);
-		if (res == NULL) {
-			res = strdup("NULL");
-		}
-		snprintf(buf, bufn, "ans=wininfo:%s%s:%s", t, p, res);
-		free(res);
-
-		goto qry;
-	}
-	if (strstr(p, "bcx_xattach") == p) {
-		char *res;
-		int pg_init = -1, kg_init = -1;
-		int try = 0, max_tries = 4;
-
-		/* note we force query and assume the colon is there. */
-		query = 1;
-		if (strstr(p, "bcx_xattach:") != p) { /* skip-cmd-list */
-			snprintf(buf, bufn, "ans=%s:N/A", p);
-			goto qry;
-		}
-		p += strlen("bcx_xattach:");
-
-		if (strstr(p, "retry=")) { /* skip-cmd-list */
-			int n;
-			char *q = strstr(p, "retry="); /* skip-cmd-list */
-			if (sscanf(q, "retry=%d", &n) == 1) {
-				if (n < 0) n = 0;
-				max_tries = 1 + n;
-			}
-		}
-
-		try_again:
-
-		res = bcx_xattach(p, &pg_init, &kg_init);
-		try++;
-		if (res == NULL) {
-			res = strdup("NULL");
-		} else if (strstr(res, "GRAB_FAIL_INIT")) {
-			rfbLog("bcx_xattach: failed grab check for '%s': %s.  Final state OK, not Retrying.\n", p, res);
-		} else if (strstr(res, "GRAB_FAIL") && try < max_tries) {
-			rfbLog("bcx_xattach: failed grab check for '%s': %s.  Retrying[%d]...\n", p, res, try);
-			free(res);
-			pointer_event(0, dpy_x/2 + try, dpy_y/2 + try, NULL);
-#if !NO_X11
-			X_LOCK;
-			XFlush_wr(dpy);
-			if (dpy) {
-				if (try == 2) {
-					XSync(dpy, False);
-				} else if (try == 3) {
-					XSync(dpy, True);
-				}
-			}
-			X_UNLOCK;
-#endif
-			if (try == 1) {
-				usleep(250*1000);
-			} else if (try <= 4) {
-				usleep(try*400*1000);
-			} else {
-				usleep(4*500*1000);
-			}
-			goto try_again;
-		}
-
-		snprintf(buf, bufn, "ans=bcx_xattach:%s:%s", p, res);
-		free(res);
-
-		goto qry;
-	}
-	if (strstr(p, "deferupdate") == p) {
-		int d;
-		COLON_CHECK("deferupdate:")
-		if (query) {
-			if (!screen) {
-				d = defer_update;
-			} else {
-				d = screen->deferUpdateTime;
-			}
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, d);
-			goto qry;
-		}
-		p += strlen("deferupdate:");
-		d = atoi(p);
-		if (d < 0) d = 0;
-		rfbLog("remote_cmd: setting defer to %d ms.\n", d);
-		defer_update = d;
-		/* mutex */
-		screen->deferUpdateTime = d;
-		got_defer = 1;
-		goto done;
-	}
-	if (strstr(p, "defer") == p) {
-		int d;
-		COLON_CHECK("defer:")
-		if (query) {
-			if (!screen) {
-				d = defer_update;
-			} else {
-				d = screen->deferUpdateTime;
-			}
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, d);
-			goto qry;
-		}
-		p += strlen("defer:");
-		d = atoi(p);
-		if (d < 0) d = 0;
-		rfbLog("remote_cmd: setting defer to %d ms.\n", d);
-		defer_update = d;
-		/* mutex */
-		screen->deferUpdateTime = d;
-		got_defer = 1;
-		goto done;
-	}
-	if (strstr(p, "setdefer") == p) {
-		COLON_CHECK("setdefer:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, set_defer);
-			goto qry;
-		}
-		p += strlen("setdefer:");
-		set_defer = atoi(p);
-		rfbLog("remote_cmd: setting set_defer to %d\n", set_defer);
-		goto done;
-	}
-	if (strstr(p, "extra_fbur") == p) {
-		COLON_CHECK("extra_fbur:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, extra_fbur);
-			goto qry;
-		}
-		p += strlen("extra_fbur:");
-		extra_fbur = atoi(p);
-		rfbLog("remote_cmd: setting extra_fbur to %d\n", extra_fbur);
-		goto done;
-	}
-	if (strstr(p, "wait_ui") == p) {
-		double w;
-		COLON_CHECK("wait_ui:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%.2f", p, co, wait_ui);
-			goto qry;
-		}
-		p += strlen("wait_ui:");
-		w = atof(p);
-		if (w <= 0) w = 1.0;
-		rfbLog("remote_cmd: setting wait_ui factor %.2f -> %.2f\n",
-		    wait_ui, w);
-		wait_ui = w;
-		goto done;
-	}
-	if (!strcmp(p, "wait_bog")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, wait_bog);
-			goto qry;
-		}
-		wait_bog = 1;
-		rfbLog("remote_cmd: setting wait_bog to %d\n", wait_bog);
-		goto done;
-	}
-	if (!strcmp(p, "nowait_bog")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !wait_bog);
-			goto qry;
-		}
-		wait_bog = 0;
-		rfbLog("remote_cmd: setting wait_bog to %d\n", wait_bog);
-		goto done;
-	}
-	if (strstr(p, "slow_fb") == p) {
-		double w;
-		COLON_CHECK("slow_fb:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%.2f", p, co, slow_fb);
-			goto qry;
-		}
-		p += strlen("slow_fb:");
-		w = atof(p);
-		if (w <= 0) w = 0.0;
-		rfbLog("remote_cmd: setting slow_fb factor %.2f -> %.2f\n",
-		    slow_fb, w);
-		slow_fb = w;
-		goto done;
-	}
-	if (strstr(p, "xrefresh") == p) {
-		double w;
-		COLON_CHECK("xrefresh:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%.2f", p, co, xrefresh);
-			goto qry;
-		}
-		p += strlen("xrefresh:");
-		w = atof(p);
-		if (w <= 0) w = 0.0;
-		rfbLog("remote_cmd: setting xrefresh delay %.2f -> %.2f\n",
-		    xrefresh, w);
-		xrefresh = w;
-		goto done;
-	}
-	if (strstr(p, "wait") == p) {
-		int w;
-		COLON_CHECK("wait:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, waitms);
-			goto qry;
-		}
-		p += strlen("wait:");
-		w = atoi(p);
-		if (w < 0) w = 0;
-		rfbLog("remote_cmd: setting wait %d -> %d ms.\n", waitms, w);
-		waitms = w;
-		goto done;
-	}
-	if (strstr(p, "readtimeout") == p) {
-		int w, orig = rfbMaxClientWait;
-		COLON_CHECK("readtimeout:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    rfbMaxClientWait/1000);
-			goto qry;
-		}
-		p += strlen("readtimeout:");
-		w = atoi(p) * 1000;
-		if (w <= 0) w = 0;
-		rfbLog("remote_cmd: setting rfbMaxClientWait %d -> "
-		    "%d msec.\n", orig, w);
-		rfbMaxClientWait = w;
-		goto done;
-	}
-	if (!strcmp(p, "nap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, take_naps);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on nap mode.\n");
-		take_naps = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nonap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !take_naps);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off nap mode.\n");
-		take_naps = 0;
-		goto done;
-	}
-	if (strstr(p, "sb") == p) {
-		int w;
-		COLON_CHECK("sb:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, screen_blank);
-			goto qry;
-		}
-		p += strlen("sb:");
-		w = atoi(p);
-		if (w < 0) w = 0;
-		rfbLog("remote_cmd: setting screen_blank %d -> %d sec.\n",
-		    screen_blank, w);
-		screen_blank = w;
-		goto done;
-	}
-	if (strstr(p, "screen_blank") == p) {
-		int w;
-		COLON_CHECK("screen_blank:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, screen_blank);
-			goto qry;
-		}
-		p += strlen("screen_blank:");
-		w = atoi(p);
-		if (w < 0) w = 0;
-		rfbLog("remote_cmd: setting screen_blank %d -> %d sec.\n",
-		    screen_blank, w);
-		screen_blank = w;
-		goto done;
-	}
-	if (!strcmp(p, "fbpm")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !watch_fbpm);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off -nofbpm mode.\n");
-		watch_fbpm = 0;
-		goto done;
-	}
-	if (!strcmp(p, "nofbpm")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, watch_fbpm);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on -nofbpm mode.\n");
-		watch_fbpm = 1;
-		goto done;
-	}
-	if (!strcmp(p, "dpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !watch_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off -nodpms mode.\n");
-		watch_dpms = 0;
-		goto done;
-	}
-	if (!strcmp(p, "nodpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, watch_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on -nodpms mode.\n");
-		watch_dpms = 1;
-		goto done;
-	}
-	if (!strcmp(p, "clientdpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, client_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on -clientdpms mode.\n");
-		client_dpms = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noclientdpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !client_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off -clientdpms mode.\n");
-		client_dpms = 0;
-		goto done;
-	}
-	if (!strcmp(p, "forcedpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, force_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on -forcedpms mode.\n");
-		force_dpms = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noforcedpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !force_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off -forcedpms mode.\n");
-		force_dpms = 0;
-		goto done;
-	}
-	if (!strcmp(p, "noserverdpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, no_ultra_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on -noserverdpms mode.\n");
-		no_ultra_dpms = 1;
-		goto done;
-	}
-	if (!strcmp(p, "serverdpms")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !no_ultra_dpms);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off -noserverdpms mode.\n");
-		no_ultra_dpms = 0;
-		goto done;
-	}
-	if (!strcmp(p, "noultraext")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, no_ultra_ext);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on -noultraext mode.\n");
-		no_ultra_ext = 1;
-		goto done;
-	}
-	if (!strcmp(p, "ultraext")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !no_ultra_ext);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off -noultraext mode.\n");
-		no_ultra_ext = 0;
-		goto done;
-	}
-	if (!strcmp(p, "chatwindow")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, chat_window);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: enabling the local chat window.\n");
-		chat_window = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nochatwindow")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !chat_window);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: disabling the local chat window.\n");
-		chat_window = 0;
-		goto done;
-	}
-	if (!strcmp(p, "chaton")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, (chat_window_client != NULL));
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning local chat window on.\n");
-		chat_window = 1;
-		set_text_chat(NULL, rfbTextChatOpen, "");
-		goto done;
-	}
-	if (!strcmp(p, "chatoff")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, (chat_window_client == NULL));
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning local chat window off.\n");
-		set_text_chat(NULL, rfbTextChatClose, "");
-		set_text_chat(NULL, rfbTextChatFinished, "");
-		goto done;
-	}
-	if (strstr(p, "fs") == p) {
-		COLON_CHECK("fs:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%f", p, co, fs_frac);
-			goto qry;
-		}
-		p += strlen("fs:");
-		fs_frac = atof(p);
-		rfbLog("remote_cmd: setting -fs frac to %f\n", fs_frac);
-		goto done;
-	}
-	if (strstr(p, "gaps") == p) {
-		int g;
-		COLON_CHECK("gaps:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, gaps_fill);
-			goto qry;
-		}
-		p += strlen("gaps:");
-		g = atoi(p);
-		if (g < 0) g = 0;
-		rfbLog("remote_cmd: setting gaps_fill %d -> %d.\n",
-		    gaps_fill, g);
-		gaps_fill = g;
-		goto done;
-	}
-	if (strstr(p, "grow") == p) {
-		int g;
-		COLON_CHECK("grow:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, grow_fill);
-			goto qry;
-		}
-		p += strlen("grow:");
-		g = atoi(p);
-		if (g < 0) g = 0;
-		rfbLog("remote_cmd: setting grow_fill %d -> %d.\n",
-		    grow_fill, g);
-		grow_fill = g;
-		goto done;
-	}
-	if (strstr(p, "fuzz") == p) {
-		int f;
-		COLON_CHECK("fuzz:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, tile_fuzz);
-			goto qry;
-		}
-		p += strlen("fuzz:");
-		f = atoi(p);
-		if (f < 0) f = 0;
-		rfbLog("remote_cmd: setting tile_fuzz %d -> %d.\n",
-		    tile_fuzz, f);
-		grow_fill = f;
-		goto done;
-	}
-	if (!strcmp(p, "snapfb")) {
-		int orig = use_snapfb;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, use_snapfb);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning on snapfb mode.\n");
-		use_snapfb = 1;
-		if (orig != use_snapfb) {
-			do_new_fb(1);
-		}
-		goto done;
-	}
-	if (!strcmp(p, "nosnapfb")) {
-		int orig = use_snapfb;
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !use_snapfb);
-			    goto qry;
-		}
-		rfbLog("remote_cmd: turning off snapfb mode.\n");
-		use_snapfb = 0;
-		if (orig != use_snapfb) {
-			do_new_fb(1);
-		}
-
-		goto done;
-	}
-	if (strstr(p, "rawfb") == p) {
-		COLON_CHECK("rawfb:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(raw_fb_str));
-			goto qry;
-		}
-		p += strlen("rawfb:");
-		if (raw_fb_str) free(raw_fb_str);
-		raw_fb_str = strdup(p);
-		if (safe_remote_only && strstr(p, "setup:") == p) { /* skip-cmd-list */
-			/* n.b. we still allow filename, shm, of rawfb */
-			fprintf(stderr, "unsafe rawfb setup: %s\n", p);
-			exit(1);
-		}
-
-		rfbLog("remote_cmd: setting -rawfb to:\n\t'%s'\n", p);
-
-		if (*raw_fb_str == '\0') {
-			free(raw_fb_str);
-			raw_fb_str = NULL;
-			if (raw_fb_mmap) {
-				munmap(raw_fb_addr, raw_fb_mmap);
-			}
-			if (raw_fb_fd >= 0) {
-				close(raw_fb_fd);
-			}
-			raw_fb_fd = -1;
-			raw_fb = NULL;
-			raw_fb_addr = NULL;
-			raw_fb_offset = 0;
-			raw_fb_shm = 0;
-			raw_fb_mmap = 0;
-			raw_fb_seek = 0;
-			rfbLog("restoring per-rawfb settings...\n");
-			set_raw_fb_params(1);
-		}
-		rfbLog("hang on tight, here we go...\n");
-		raw_fb_back_to_X = 1;
-		do_new_fb(1);
-		raw_fb_back_to_X = 0;
-		goto done;
-	}
-	if (strstr(p, "uinput_accel") == p) {
-		COLON_CHECK("uinput_accel:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(get_uinput_accel()));
-			goto qry;
-		}
-		p += strlen("uinput_accel:");
-		rfbLog("set_uinput_accel: %s\n", p);
-		set_uinput_accel(p);
-		goto done;
-	}
-	if (strstr(p, "uinput_thresh") == p) {
-		COLON_CHECK("uinput_thresh:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(get_uinput_thresh()));
-			goto qry;
-		}
-		p += strlen("uinput_thresh:");
-		rfbLog("set_uinput_thresh: %s\n", p);
-		set_uinput_thresh(p);
-		goto done;
-	}
-	if (strstr(p, "uinput_reset") == p) {
-		COLON_CHECK("uinput_reset:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    get_uinput_reset());
-			goto qry;
-		}
-		p += strlen("uinput_reset:");
-		rfbLog("set_uinput_reset: %s\n", p);
-		set_uinput_reset(atoi(p));
-		goto done;
-	}
-	if (strstr(p, "uinput_always") == p) {
-		COLON_CHECK("uinput_always:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    get_uinput_always());
-			goto qry;
-		}
-		p += strlen("uinput_always:");
-		rfbLog("set_uinput_always: %s\n", p);
-		set_uinput_always(atoi(p));
-		goto done;
-	}
-	if (strstr(p, "progressive") == p) {
-		int f;
-		COLON_CHECK("progressive:")
-		if (query) {
-			if (!screen) {
-				f = 0;
-			} else {
-				f = screen->progressiveSliceHeight;
-			}
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, f);
-			goto qry;
-		}
-		p += strlen("progressive:");
-		f = atoi(p);
-		if (f < 0) f = 0;
-		rfbLog("remote_cmd: setting progressive %d -> %d.\n",
-		    screen->progressiveSliceHeight, f);
-		/* mutex */
-		screen->progressiveSliceHeight = f;
-		goto done;
-	}
-	if (strstr(p, "rfbport") == p) {
-		int rp, orig = screen ? screen->port : 5900;
-		COLON_CHECK("rfbport:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, orig);
-			goto qry;
-		}
-		p += strlen("rfbport:");
-		rp = atoi(p);
-		reset_rfbport(orig, rp);
-		goto done;
-	}
-	if (!strcmp(p, "http")) {
-		if (query) {
-			int ls = screen ? screen->httpListenSock : -1;
-			snprintf(buf, bufn, "ans=%s:%d", p, (ls > -1));
-			goto qry;
-		}
-		if (screen->httpListenSock > -1 || ipv6_http_fd > -1) {
-			rfbLog("already listening for http connections.\n");
-		} else {
-			rfbLog("turning on listening for http connections.\n");
-			if (check_httpdir()) {
-				http_connections(1);
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "nohttp")) {
-		if (query) {
-			int ls = screen ? screen->httpListenSock : -1;
-			snprintf(buf, bufn, "ans=%s:%d", p, !(ls > -1));
-			goto qry;
-		}
-		if (screen->httpListenSock < 0 && ipv6_http_fd < 0) {
-			rfbLog("already not listening for http connections.\n");
-		} else {
-			rfbLog("turning off listening for http connections.\n");
-			if (check_httpdir()) {
-				http_connections(0);
-			}
-		}
-		goto done;
-	}
-	if (strstr(p, "httpport") == p) {
-		int hp, orig = screen ? screen->httpPort : 0;
-		COLON_CHECK("httpport:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, orig);
-			goto qry;
-		}
-		p += strlen("httpport:");
-		hp = atoi(p);
-		reset_httpport(orig, hp);
-		goto done;
-	}
-	if (strstr(p, "httpdir") == p) {
-		COLON_CHECK("httpdir:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(http_dir));
-			goto qry;
-		}
-		p += strlen("httpdir:");
-		if (http_dir && !strcmp(http_dir, p)) {
-			rfbLog("no change in httpdir: %s\n", http_dir);
-		} else {
-			if (http_dir) {
-				free(http_dir);
-			}
-			http_dir = strdup(p);
-			http_connections(0);
-			if (*p != '\0') {
-				http_connections(1);
-			}
-		}
-		goto done;
-	}
-	if (!strcmp(p, "enablehttpproxy")) {
-		if (query) {
-			int ht = screen ? screen->httpEnableProxyConnect : 0;
-			snprintf(buf, bufn, "ans=%s:%d", p, ht != 0);
-			goto qry;
-		}
-		rfbLog("turning on enablehttpproxy.\n");
-		/* mutex */
-		screen->httpEnableProxyConnect = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noenablehttpproxy")) {
-		if (query) {
-			int ht = screen ? screen->httpEnableProxyConnect : 0;
-			snprintf(buf, bufn, "ans=%s:%d", p, ht == 0);
-			goto qry;
-		}
-		rfbLog("turning off enablehttpproxy.\n");
-		screen->httpEnableProxyConnect = 0;
-		goto done;
-	}
-	if (!strcmp(p, "alwaysshared")) {
-		if (query) {
-			int t = screen ? screen->alwaysShared : 0;
-			snprintf(buf, bufn, "ans=%s:%d", p, t != 0);
-			goto qry;
-		}
-		rfbLog("turning on alwaysshared.\n");
-		screen->alwaysShared = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noalwaysshared")) {
-		if (query) {
-			int t = screen ? screen->alwaysShared : 0;
-			snprintf(buf, bufn, "ans=%s:%d", p, t == 0);
-			goto qry;
-		}
-		rfbLog("turning off alwaysshared.\n");
-		screen->alwaysShared = 0;
-		goto done;
-	}
-	if (!strcmp(p, "nevershared")) {
-		if (query) {
-			int t = screen ? screen->neverShared : 1;
-			snprintf(buf, bufn, "ans=%s:%d", p, t != 0);
-			goto qry;
-		}
-		rfbLog("turning on nevershared.\n");
-		screen->neverShared = 1;
-		goto done;
-	}
-	if (!strcmp(p, "noalwaysshared")) {
-		if (query) {
-			int t = screen ? screen->neverShared : 1;
-			snprintf(buf, bufn, "ans=%s:%d", p, t == 0);
-			goto qry;
-		}
-		rfbLog("turning off nevershared.\n");
-		screen->neverShared = 0;
-		goto done;
-	}
-	if (!strcmp(p, "dontdisconnect")) {
-		if (query) {
-			int t = screen ? screen->dontDisconnect : 1;
-			snprintf(buf, bufn, "ans=%s:%d", p, t != 0);
-			goto qry;
-		}
-		rfbLog("turning on dontdisconnect.\n");
-		screen->dontDisconnect = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nodontdisconnect")) {
-		if (query) {
-			int t = screen ? screen->dontDisconnect : 1;
-			snprintf(buf, bufn, "ans=%s:%d", p, t == 0);
-			goto qry;
-		}
-		rfbLog("turning off dontdisconnect.\n");
-		screen->dontDisconnect = 0;
-		goto done;
-	}
-	if (!strcmp(p, "desktop") ||
-	    strstr(p, "desktop:") == p) {	/* skip-cmd-list */
-		COLON_CHECK("desktop:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%s", p, co,
-			    NONUL(rfb_desktop_name));
-			goto qry;
-		}
-		p += strlen("desktop:");
-		if (rfb_desktop_name) {
-			free(rfb_desktop_name);
-		}
-		rfb_desktop_name = strdup(p);
-		/* mutex */
-		screen->desktopName = rfb_desktop_name;
-		rfbLog("remote_cmd: setting desktop name to %s\n",
-		    rfb_desktop_name);
-		goto done;
-	}
-	if (!strcmp(p, "debug_xevents")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_xevents);
-			goto qry;
-		}
-		debug_xevents = 1;
-		rfbLog("set debug_xevents to: %d\n", debug_xevents);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_xevents")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_xevents);
-			goto qry;
-		}
-		debug_xevents = 0;
-		rfbLog("set debug_xevents to: %d\n", debug_xevents);
-		goto done;
-	}
-	if (strstr(p, "debug_xevents") == p) {
-		COLON_CHECK("debug_xevents:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, debug_xevents);
-			goto qry;
-		}
-		p += strlen("debug_xevents:");
-		debug_xevents = atoi(p);
-		rfbLog("set debug_xevents to: %d\n", debug_xevents);
-		goto done;
-	}
-	if (!strcmp(p, "debug_xdamage")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_xdamage);
-			goto qry;
-		}
-		debug_xdamage = 1;
-		rfbLog("set debug_xdamage to: %d\n", debug_xdamage);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_xdamage")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_xdamage);
-			goto qry;
-		}
-		debug_xdamage = 0;
-		rfbLog("set debug_xdamage to: %d\n", debug_xdamage);
-		goto done;
-	}
-	if (strstr(p, "debug_xdamage") == p) {
-		COLON_CHECK("debug_xdamage:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, debug_xdamage);
-			goto qry;
-		}
-		p += strlen("debug_xdamage:");
-		debug_xdamage = atoi(p);
-		rfbLog("set debug_xdamage to: %d\n", debug_xdamage);
-		goto done;
-	}
-	if (!strcmp(p, "debug_wireframe")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_wireframe);
-			goto qry;
-		}
-		debug_wireframe = 1;
-		rfbLog("set debug_wireframe to: %d\n", debug_wireframe);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_wireframe")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_wireframe);
-			goto qry;
-		}
-		debug_wireframe = 0;
-		rfbLog("set debug_wireframe to: %d\n", debug_wireframe);
-		goto done;
-	}
-	if (strstr(p, "debug_wireframe") == p) {
-		COLON_CHECK("debug_wireframe:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    debug_wireframe);
-			goto qry;
-		}
-		p += strlen("debug_wireframe:");
-		debug_wireframe = atoi(p);
-		rfbLog("set debug_wireframe to: %d\n", debug_wireframe);
-		goto done;
-	}
-	if (!strcmp(p, "debug_scroll")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_scroll);
-			goto qry;
-		}
-		debug_scroll = 1;
-		rfbLog("set debug_scroll to: %d\n", debug_scroll);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_scroll")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_scroll);
-			goto qry;
-		}
-		debug_scroll = 0;
-		rfbLog("set debug_scroll to: %d\n", debug_scroll);
-		goto done;
-	}
-	if (strstr(p, "debug_scroll") == p) {
-		COLON_CHECK("debug_scroll:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    debug_scroll);
-			goto qry;
-		}
-		p += strlen("debug_scroll:");
-		debug_scroll = atoi(p);
-		rfbLog("set debug_scroll to: %d\n", debug_scroll);
-		goto done;
-	}
-	if (!strcmp(p, "debug_tiles") || !strcmp(p, "dbt")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_tiles);
-			goto qry;
-		}
-		debug_tiles = 1;
-		rfbLog("set debug_tiles to: %d\n", debug_tiles);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_tiles") || !strcmp(p, "nodbt")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_tiles);
-			goto qry;
-		}
-		debug_tiles = 0;
-		rfbLog("set debug_tiles to: %d\n", debug_tiles);
-		goto done;
-	}
-	if (strstr(p, "debug_tiles") == p) {
-		COLON_CHECK("debug_tiles:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co,
-			    debug_tiles);
-			goto qry;
-		}
-		p += strlen("debug_tiles:");
-		debug_tiles = atoi(p);
-		rfbLog("set debug_tiles to: %d\n", debug_tiles);
-		goto done;
-	}
-	if (!strcmp(p, "debug_grabs")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_grabs);
-			goto qry;
-		}
-		debug_grabs = 1;
-		rfbLog("set debug_grabs to: %d\n", debug_grabs);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_grabs")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_grabs);
-			goto qry;
-		}
-		debug_grabs = 0;
-		rfbLog("set debug_grabs to: %d\n", debug_grabs);
-		goto done;
-	}
-	if (!strcmp(p, "debug_sel")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, debug_sel);
-			goto qry;
-		}
-		debug_sel = 1;
-		rfbLog("set debug_sel to: %d\n", debug_sel);
-		goto done;
-	}
-	if (!strcmp(p, "nodebug_sel")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !debug_sel);
-			goto qry;
-		}
-		debug_sel = 0;
-		rfbLog("set debug_sel to: %d\n", debug_sel);
-		goto done;
-	}
-	if (!strcmp(p, "dbg")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, crash_debug);
-			goto qry;
-		}
-		crash_debug = 1;
-		rfbLog("set crash_debug to: %d\n", crash_debug);
-		goto done;
-	}
-	if (!strcmp(p, "nodbg")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !crash_debug);
-			goto qry;
-		}
-		crash_debug = 0;
-		rfbLog("set crash_debug to: %d\n", crash_debug);
-		goto done;
-	}
-	if (!strcmp(p, "macnosaver")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, macosx_noscreensaver); goto qry;
-		}
-		rfbLog("remote_cmd: turn on macnosaver.\n");
-		macosx_noscreensaver = 1;
-		goto done;
-	}
-	if (!strcmp(p, "macsaver") || !strcmp(p, "nomacnosaver")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !macosx_noscreensaver); goto qry;
-		}
-		rfbLog("remote_cmd: turn off macnosaver.\n");
-		macosx_noscreensaver = 0;
-		goto done;
-	}
-	if (!strcmp(p, "macnowait")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !macosx_wait_for_switch); goto qry;
-		}
-		rfbLog("remote_cmd: disable macosx_wait_for_switch.\n");
-		macosx_wait_for_switch = 0;
-		goto done;
-	}
-	if (!strcmp(p, "macwait") || !strcmp(p, "nomacnowait")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, macosx_wait_for_switch); goto qry;
-		}
-		rfbLog("remote_cmd: enable macosx_wait_for_switch.\n");
-		macosx_wait_for_switch = 1;
-		goto done;
-	}
-	if (strstr(p, "macwheel") == p) {
-		COLON_CHECK("macwheel:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, macosx_mouse_wheel_speed);
-			goto qry;
-		}
-		p += strlen("macwheel:");
-		macosx_mouse_wheel_speed = atoi(p);
-		rfbLog("set macosx_mouse_wheel_speed to: %d\n", macosx_mouse_wheel_speed);
-		goto done;
-	}
-	if (!strcmp(p, "macnoswap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !macosx_swap23); goto qry;
-		}
-		rfbLog("remote_cmd: disable macosx_swap23.\n");
-		macosx_swap23 = 0;
-		goto done;
-	}
-	if (!strcmp(p, "macswap") || !strcmp(p, "nomacnoswap")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, macosx_swap23); goto qry;
-		}
-		rfbLog("remote_cmd: enable macosx_swap23.\n");
-		macosx_swap23 = 1;
-		goto done;
-	}
-	if (!strcmp(p, "macnoresize")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !macosx_resize); goto qry;
-		}
-		rfbLog("remote_cmd: disable macosx_resize.\n");
-		macosx_resize = 0;
-		goto done;
-	}
-	if (!strcmp(p, "macresize") || !strcmp(p, "nomacnoresize")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, macosx_resize); goto qry;
-		}
-		rfbLog("remote_cmd: enable macosx_resize.\n");
-		macosx_resize = 1;
-		goto done;
-	}
-	if (strstr(p, "maciconanim") == p) {
-		COLON_CHECK("maciconanim:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, macosx_icon_anim_time);
-			goto qry;
-		}
-		p += strlen("maciconanim:");
-		macosx_icon_anim_time = atoi(p);
-		rfbLog("set macosx_icon_anim_time to: %d\n", macosx_icon_anim_time);
-		goto done;
-	}
-	if (!strcmp(p, "macmenu")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, macosx_ncache_macmenu); goto qry;
-		}
-		rfbLog("remote_cmd: enable macosx_ncache_macmenu.\n");
-		macosx_ncache_macmenu = 1;
-		goto done;
-	}
-	if (!strcmp(p, "macnomenu") || !strcmp(p, "nomacmenu")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !macosx_ncache_macmenu); goto qry;
-		}
-		rfbLog("remote_cmd: disable macosx_ncache_macmenu.\n");
-		macosx_ncache_macmenu = 0;
-		goto done;
-	}
-	if (!strcmp(p, "macuskbd")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, macosx_us_kbd); goto qry;
-		}
-		rfbLog("remote_cmd: enable macosx_us_kbd.\n");
-		macosx_us_kbd = 1;
-		goto done;
-	}
-	if (!strcmp(p, "nomacuskbd")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p, !macosx_us_kbd); goto qry;
-		}
-		rfbLog("remote_cmd: disable macosx_us_kbd.\n");
-		macosx_us_kbd = 0;
-		goto done;
-	}
-	if (strstr(p, "hack") == p) { /* skip-cmd-list */
-		COLON_CHECK("hack:")
-		if (query) {
-			snprintf(buf, bufn, "ans=%s%s%d", p, co, hack_val);
-			goto qry;
-		}
-		p += strlen("hack:");
-		hack_val = atoi(p);
-		rfbLog("set hack_val to: %d\n", hack_val);
-		goto done;
-	}
-	if (!strcmp(p, "noremote")) {
-		if (query) {
-			snprintf(buf, bufn, "ans=%s:%d", p,
-			    !accept_remote_cmds);
-			goto qry;
-		}
-		rfbLog("remote_cmd: disabling remote commands.\n");
-		accept_remote_cmds = 0; /* cannot be turned back on. */
-		goto done;
-	}
-	if (strstr(p, "client_info_sock") == p) { /* skip-cmd-list */
-		NOTAPP
-		p += strlen("client_info_sock:");
-		if (*p != '\0') {
-			start_client_info_sock(p);
-		}
-		goto done;
-	}
-	if (strstr(p, "noop") == p) {
-		NOTAPP
-		rfbLog("remote_cmd: noop\n");
-		goto done;
-	}
-	if (icon_mode && !query && strstr(p, "passwd") == p) { /* skip-cmd-list */
-		char **passwds_new = (char **) malloc(3*sizeof(char *));
-		char **passwds_old = (char **) screen->authPasswdData;
-
-		COLON_CHECK("passwd:")
-		p += strlen("passwd:");
-
-		passwds_new[0] = strdup(p);
-
-		/* mutex */
-		if (screen->authPasswdData &&
-		    screen->passwordCheck == rfbCheckPasswordByList) {
-				passwds_new[1] = passwds_old[1];
-		} else {
-			passwds_new[1] = NULL;
-			screen->passwordCheck = rfbCheckPasswordByList;
-		}
-		passwds_new[2] = NULL;
-
-		screen->authPasswdData = (void*) passwds_new;
-		if (*p == '\0') {
-			screen->authPasswdData = (void*) NULL;
-		}
-		rfbLog("remote_cmd: changed full access passwd.\n");
-		goto done;
-	}
-	if (icon_mode && !query && strstr(p, "viewpasswd") == p) { /* skip-cmd-list */
-		char **passwds_new = (char **) malloc(3*sizeof(char *));
-		char **passwds_old = (char **) screen->authPasswdData;
-		
-		COLON_CHECK("viewpasswd:")
-		p += strlen("viewpasswd:");
-
-		passwds_new[1] = strdup(p);
-
-		if (screen->authPasswdData &&
-		    screen->passwordCheck == rfbCheckPasswordByList) {
-				passwds_new[0] = passwds_old[0];
-		} else {
-			char *tmp = (char *) malloc(4 + CHALLENGESIZE);
-			rfbRandomBytes((unsigned char*)tmp);
-			passwds_new[0] = tmp;
-			screen->passwordCheck = rfbCheckPasswordByList;
-		}
-		passwds_new[2] = NULL;
-
-		if (*p == '\0') {
-			passwds_new[1] = NULL;
-		}
-
-		screen->authPasswdData = (void*) passwds_new;
-		rfbLog("remote_cmd: changed view only passwd.\n");
-		goto done;
-	}
-	if (strstr(p, "trayembed") == p) { /* skip-cmd-list */
-		unsigned long id;
-		NOTAPP
-
-		COLON_CHECK("trayembed:")
-		p += strlen("trayembed:");
-		if (scan_hexdec(p, &id)) {
-			tray_request = (Window) id;
-			tray_unembed = 0;
-			rfbLog("remote_cmd: will try to embed 0x%x in"
-			    " the system tray.\n", id);
-		}
-		goto done;
-	}
-	if (strstr(p, "trayunembed") == p) { /* skip-cmd-list */
-		unsigned long id;
-		NOTAPP
-
-		COLON_CHECK("trayunembed:")
-		p += strlen("trayunembed:");
-		if (scan_hexdec(p, &id)) {
-			tray_request = (Window) id;
-			tray_unembed = 1;
-			rfbLog("remote_cmd: will try to unembed 0x%x out"
-			    " of the system tray.\n", id);
-		}
-		goto done;
-	}
-	if (query) {
-		/* read-only variables that can only be queried: */
-
-		if (!strcmp(p, "display")) {
-			if (raw_fb) {
-				snprintf(buf, bufn, "aro=%s:rawfb:%p",
-				    p, raw_fb_addr);
-			} else if (! dpy) {
-				snprintf(buf, bufn, "aro=%s:", p);
-			} else {
-				char *d;
-				d = DisplayString(dpy);
-				if (! d) d = "unknown";
-				if (*d == ':') {
-					snprintf(buf, bufn, "aro=%s:%s%s", p,
-					    this_host(), d);
-				} else {
-					snprintf(buf, bufn, "aro=%s:%s", p, d);
-				}
-			}
-			goto qry;
-		}
-		if (!strcmp(p, "vncdisplay")) {
-			snprintf(buf, bufn, "aro=%s:%s", p,
-			    NONUL(vnc_desktop_name));
-			goto qry;
-		}
-		if (!strcmp(p, "icon_mode")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, icon_mode);
-			goto qry;
-		}
-		if (!strcmp(p, "autoport")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, auto_port);
-			goto qry;
-		}
-		if (!strcmp(p, "loop") || !strcmp(p, "loopbg")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, 0);
-			goto qry;
-		}
-		if (!strcmp(p, "desktopname")) {
-			snprintf(buf, bufn, "aro=%s:%s", p,
-			    NONUL(rfb_desktop_name));
-			goto qry;
-		}
-		if (!strcmp(p, "guess_desktop")) {
-			snprintf(buf, bufn, "aro=%s:%s", p,
-			    NONUL(guess_desktop()));
-			goto qry;
-		}
-		if (!strcmp(p, "guess_dbus")) {
-			snprintf(buf, bufn, "aro=%s:%s", p,
-			    NONUL(dbus_session()));
-			goto qry;
-		}
-		if (!strcmp(p, "http_url")) {
-			if (!screen) {
-				snprintf(buf, bufn, "aro=%s:", p);
-			} else if (screen->httpListenSock > -1) {
-				snprintf(buf, bufn, "aro=%s:http://%s:%d", p,
-				    NONUL(screen->thisHost), screen->httpPort);
-			} else {
-				snprintf(buf, bufn, "aro=%s:%s", p,
-				    "http_not_active");
-			}
-			goto qry;
-		}
-		if (!strcmp(p, "auth") || !strcmp(p, "xauth")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(auth_file));
-			goto qry;
-		}
-		if (!strcmp(p, "users")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(users_list));
-			goto qry;
-		}
-		if (!strcmp(p, "rootshift")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, rootshift);
-			goto qry;
-		}
-		if (!strcmp(p, "clipshift")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, clipshift);
-			goto qry;
-		}
-		if (!strcmp(p, "scale_str")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(scale_str));
-			goto qry;
-		}
-		if (!strcmp(p, "scaled_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scaled_x);
-			goto qry;
-		}
-		if (!strcmp(p, "scaled_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scaled_y);
-			goto qry;
-		}
-		if (!strcmp(p, "scale_numer")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scale_numer);
-			goto qry;
-		}
-		if (!strcmp(p, "scale_denom")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scale_denom);
-			goto qry;
-		}
-		if (!strcmp(p, "scale_fac_x")) {
-			snprintf(buf, bufn, "aro=%s:%f", p, scale_fac_x);
-			goto qry;
-		}
-		if (!strcmp(p, "scale_fac_y")) {
-			snprintf(buf, bufn, "aro=%s:%f", p, scale_fac_y);
-			goto qry;
-		}
-		if (!strcmp(p, "scaling_blend")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scaling_blend);
-			goto qry;
-		}
-		if (!strcmp(p, "scaling_nomult4")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scaling_nomult4);
-			goto qry;
-		}
-		if (!strcmp(p, "scaling_pad")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, scaling_pad);
-			goto qry;
-		}
-		if (!strcmp(p, "scaling_interpolate")) {
-			snprintf(buf, bufn, "aro=%s:%d", p,
-			    scaling_interpolate);
-			goto qry;
-		}
-		if (!strcmp(p, "inetd")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, inetd);
-			goto qry;
-		}
-		if (!strcmp(p, "privremote")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, priv_remote);
-			goto qry;
-		}
-		if (!strcmp(p, "unsafe")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, !safe_remote_only);
-			goto qry;
-		}
-		if (!strcmp(p, "safer")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, more_safe);
-			goto qry;
-		}
-		if (!strcmp(p, "nocmds")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, no_external_cmds);
-			goto qry;
-		}
-		if (!strcmp(p, "passwdfile")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(passwdfile));
-			goto qry;
-		}
-		if (!strcmp(p, "unixpw")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, unixpw);
-			goto qry;
-		}
-		if (!strcmp(p, "unixpw_nis")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, unixpw_nis);
-			goto qry;
-		}
-		if (!strcmp(p, "unixpw_list")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(unixpw_list));
-			goto qry;
-		}
-		if (!strcmp(p, "ssl")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, use_openssl);
-			goto qry;
-		}
-		if (!strcmp(p, "ssl_pem")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(openssl_pem));
-			goto qry;
-		}
-		if (!strcmp(p, "sslverify")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(ssl_verify));
-			goto qry;
-		}
-		if (!strcmp(p, "stunnel")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, use_stunnel);
-			goto qry;
-		}
-		if (!strcmp(p, "stunnel_pem")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(stunnel_pem));
-			goto qry;
-		}
-		if (!strcmp(p, "https")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, https_port_num);
-			goto qry;
-		}
-		if (!strcmp(p, "httpsredir")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, https_port_redir);
-			goto qry;
-		}
-		if (!strcmp(p, "usepw")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, usepw);
-			goto qry;
-		}
-		if (!strcmp(p, "using_shm")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, !using_shm);
-			goto qry;
-		}
-		if (!strcmp(p, "logfile") || !strcmp(p, "o")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(logfile));
-			goto qry;
-		}
-		if (!strcmp(p, "flag")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(flagfile));
-			goto qry;
-		}
-		if (!strcmp(p, "rmflag")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(rm_flagfile));
-			goto qry;
-		}
-		if (!strcmp(p, "rc")) {
-			char *s = rc_rcfile;
-			if (rc_rcfile_default) {
-				s = NULL;
-			}
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(s));
-			goto qry;
-		}
-		if (!strcmp(p, "norc")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, got_norc);
-			goto qry;
-		}
-		if (!strcmp(p, "h") || !strcmp(p, "help") ||
-		    !strcmp(p, "V") || !strcmp(p, "version") ||
-		    !strcmp(p, "lastmod")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(lastmod));
-			goto qry;
-		}
-		if (!strcmp(p, "bg")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, opts_bg);
-			goto qry;
-		}
-		if (!strcmp(p, "sigpipe")) {
-			snprintf(buf, bufn, "aro=%s:%s", p, NONUL(sigpipe));
-			goto qry;
-		}
-		if (!strcmp(p, "threads")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, use_threads);
-			goto qry;
-		}
-		if (!strcmp(p, "readrate")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, get_read_rate());
-			goto qry;
-		}
-		if (!strcmp(p, "netrate")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, get_net_rate());
-			goto qry;
-		}
-		if (!strcmp(p, "netlatency")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, get_net_latency());
-			goto qry;
-		}
-		if (!strcmp(p, "pipeinput")) {
-			snprintf(buf, bufn, "aro=%s:%s", p,
-			    NONUL(pipeinput_str));
-			goto qry;
-		}
-		if (!strcmp(p, "clients")) {
-			char *str = list_clients();
-			snprintf(buf, bufn, "aro=%s:%s", p, str);
-			free(str);
-			goto qry;
-		}
-		if (!strcmp(p, "client_count")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, client_count);
-			goto qry;
-		}
-		if (!strcmp(p, "pid")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, (int) getpid());
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xtest")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xtest_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xtrap")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xtrap_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xrecord")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xrecord_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xkb")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xkb_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xshm")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xshm_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xinerama")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xinerama_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_overlay")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, overlay_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xfixes")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xfixes_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xdamage")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xdamage_present);
-			goto qry;
-		}
-		if (!strcmp(p, "ext_xrandr")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, xrandr_present);
-			goto qry;
-		}
-		if (!strcmp(p, "rootwin")) {
-			snprintf(buf, bufn, "aro=%s:0x%x", p,
-			    (unsigned int) rootwin);
-			goto qry;
-		}
-		if (!strcmp(p, "num_buttons")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, num_buttons);
-			goto qry;
-		}
-		if (!strcmp(p, "button_mask")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, button_mask);
-			goto qry;
-		}
-		if (!strcmp(p, "mouse_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, cursor_x);
-			goto qry;
-		}
-		if (!strcmp(p, "mouse_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, cursor_y);
-			goto qry;
-		}
-		if (!strcmp(p, "grab_state")) {
-			int ptr_grabbed, kbd_grabbed;
-
-			grab_state(&ptr_grabbed, &kbd_grabbed);
-			snprintf(buf, bufn, "aro=%s:%d,%d", p, ptr_grabbed, kbd_grabbed);
-			if (dpy && rc_npieces < 10) {
-				rfbLog("remote_cmd: ptr,kbd: %s\n", buf);
-			}
-			goto qry;
-		}
-		if (!strcmp(p, "pointer_pos") || !strcmp(p, "pointer_x") || !strcmp(p, "pointer_y") || !strcmp(p, "pointer_same") || !strcmp(p, "pointer_root") || !strcmp(p, "pointer_mask")) {
-			int px = -1, py = -1; 
-			int wx, wy;
-			unsigned int m = 0;
-			Window r, c;
-			Bool same_screen = True;
-			
-
-			if (!strcmp(p, "pointer_pos")) {			/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d,%d", p, px, py);
-			} else if (!strcmp(p, "pointer_x")) {			/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d", p, px);
-			} else if (!strcmp(p, "pointer_y")) {			/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d", p, py);
-			} else if (!strcmp(p, "pointer_same")) {		/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d", p, same_screen);
-			} else if (!strcmp(p, "pointer_root")) {		/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:0x%x", p, (unsigned int) rootwin);
-			} else if (!strcmp(p, "pointer_mask")) {		/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:0x%x", p, m);
-			} 
-			if (!dpy) {
-				goto qry;
-			}
-#if NO_X11
-			goto qry;
-#else
-			X_LOCK;
-			same_screen = XQueryPointer_wr(dpy, rootwin, &r, &c, &px, &py, &wx, &wy, &m);
-			X_UNLOCK;
-#endif
-
-			if (!strcmp(p, "pointer_pos")) {			/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d,%d", p, px, py);
-			} else if (!strcmp(p, "pointer_x")) {			/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d", p, px);
-			} else if (!strcmp(p, "pointer_y")) {			/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d", p, py);
-			} else if (!strcmp(p, "pointer_same")) {		/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:%d", p, same_screen);
-			} else if (!strcmp(p, "pointer_root")) {		/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:0x%x", p, (unsigned int) r);
-			} else if (!strcmp(p, "pointer_mask")) {		/* skip-cmd-list */
-				snprintf(buf, bufn, "aro=%s:0x%x", p, m);
-			} 
-			if (rc_npieces < 10) {
-				rfbLog("remote_cmd: %s: %s\n", p, buf);
-			}
-			goto qry;
-		}
-		if (!strcmp(p, "bpp")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, bpp);
-			goto qry;
-		}
-		if (!strcmp(p, "depth")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, depth);
-			goto qry;
-		}
-		if (!strcmp(p, "indexed_color")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, indexed_color);
-			goto qry;
-		}
-		if (!strcmp(p, "dpy_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, dpy_x);
-			goto qry;
-		}
-		if (!strcmp(p, "dpy_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, dpy_y);
-			goto qry;
-		}
-		if (!strcmp(p, "wdpy_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, wdpy_x);
-			goto qry;
-		}
-		if (!strcmp(p, "wdpy_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, wdpy_y);
-			goto qry;
-		}
-		if (!strcmp(p, "off_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, off_x);
-			goto qry;
-		}
-		if (!strcmp(p, "off_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, off_y);
-			goto qry;
-		}
-		if (!strcmp(p, "cdpy_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, cdpy_x);
-			goto qry;
-		}
-		if (!strcmp(p, "cdpy_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, cdpy_y);
-			goto qry;
-		}
-		if (!strcmp(p, "coff_x")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, coff_x);
-			goto qry;
-		}
-		if (!strcmp(p, "coff_y")) {
-			snprintf(buf, bufn, "aro=%s:%d", p, coff_y);
-			goto qry;
-		}
-		if (!strcmp(p, "rfbauth")) {
-			NOTAPPRO
-			goto qry;
-		}
-		if (!strcmp(p, "passwd")) {
-			NOTAPPRO
-			goto qry;
-		}
-		if (!strcmp(p, "viewpasswd")) {
-			NOTAPPRO
-			goto qry;
-		}
-		if (1) {
-			NOTAPP
-			goto qry;
-		}
-		goto done;
-	}
-	if (1) {
-		char tmp[100];
-		NOTAPP
-		rfbLog("remote_cmd: warning unknown\n");
-		strncpy(tmp, p, 90);
-		rfbLog("command \"%s\"\n", tmp);
-		goto done;
-	}
-
-	done:
-
-	if (*buf == '\0') {
-		sprintf(buf, "%s", "ack=1");
-	}
-
-	qry:
-
-	if (stringonly) {
-		return strdup(buf);
-	} else if (client_connect_file) {
-		FILE *out = fopen(client_connect_file, "w");
-		if (out != NULL) {
-			fprintf(out, "%s\n", buf);
-			fclose(out);
-			usleep(20*1000);
-		}
-	} else {
-		if (dpy) {	/* raw_fb hack */
-			X_LOCK;
-			set_x11vnc_remote_prop(buf);
-			XFlush_wr(dpy);
-			X_UNLOCK;
-		}
-	}
-#endif	/* REMOTE_CONTROL */
-	return NULL;
-}
-
-
diff --git a/ica/x11/x11vnc/remote.h b/ica/x11/x11vnc/remote.h
deleted file mode 100644
index 3a2dea2..0000000
--- a/ica/x11/x11vnc/remote.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_REMOTE_H
-#define _X11VNC_REMOTE_H
-
-/* -- remote.h -- */
-
-extern int send_remote_cmd(char *cmd, int query, int wait);
-extern int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync,
-    int qdefault);
-extern void check_black_fb(void);
-extern int check_httpdir(void);
-extern void http_connections(int on);
-extern int remote_control_access_ok(void);
-extern char *process_remote_cmd(char *cmd, int stringonly);
-
-extern char *query_result;
-
-
-#endif /* _X11VNC_REMOTE_H */
diff --git a/ica/x11/x11vnc/scan.c b/ica/x11/x11vnc/scan.c
deleted file mode 100644
index b55a0a3..0000000
--- a/ica/x11/x11vnc/scan.c
+++ /dev/null
@@ -1,3691 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- scan.c -- */
-
-#include "x11vnc.h"
-#include "xinerama.h"
-#include "xwrappers.h"
-#include "xdamage.h"
-#include "xrandr.h"
-#include "win_utils.h"
-#include "8to24.h"
-#include "screen.h"
-#include "pointer.h"
-#include "cleanup.h"
-#include "unixpw.h"
-#include "screen.h"
-#include "macosx.h"
-#include "userinput.h"
-
-/*
- * routines for scanning and reading the X11 display for changes, and
- * for doing all the tile work (shm, etc).
- */
-void initialize_tiles(void);
-void free_tiles(void);
-void shm_delete(XShmSegmentInfo *shm);
-void shm_clean(XShmSegmentInfo *shm, XImage *xim);
-void initialize_polling_images(void);
-void scale_rect(double factor_x, double factor_y, int blend, int interpolate, int Bpp,
-    char *src_fb, int src_bytes_per_line, char *dst_fb, int dst_bytes_per_line,
-    int Nx, int Ny, int nx, int ny, int X1, int Y1, int X2, int Y2, int mark);
-void scale_and_mark_rect(int X1, int Y1, int X2, int Y2, int mark);
-void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force);
-int copy_screen(void);
-int copy_snap(void);
-void nap_sleep(int ms, int split);
-void set_offset(void);
-int scan_for_updates(int count_only);
-void rotate_curs(char *dst_0, char *src_0, int Dx, int Dy, int Bpp);
-void rotate_coords(int x, int y, int *xo, int *yo, int dxi, int dyi);
-void rotate_coords_inverse(int x, int y, int *xo, int *yo, int dxi, int dyi);
-
-static void set_fs_factor(int max);
-static char *flip_ximage_byte_order(XImage *xim);
-static int shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
-    char *name);
-static void create_tile_hint(int x, int y, int tw, int th, hint_t *hint);
-static void extend_tile_hint(int x, int y, int tw, int th, hint_t *hint);
-static void save_hint(hint_t hint, int loc);
-static void hint_updates(void);
-static void mark_hint(hint_t hint);
-static int copy_tiles(int tx, int ty, int nt);
-static int copy_all_tiles(void);
-static int copy_all_tile_runs(void);
-static int copy_tiles_backward_pass(void);
-static int copy_tiles_additional_pass(void);
-static int gap_try(int x, int y, int *run, int *saw, int along_x);
-static int fill_tile_gaps(void);
-static int island_try(int x, int y, int u, int v, int *run);
-static int grow_islands(void);
-static void blackout_regions(void);
-static void nap_set(int tile_cnt);
-static void nap_check(int tile_cnt);
-static void ping_clients(int tile_cnt);
-static int blackout_line_skip(int n, int x, int y, int rescan,
-    int *tile_count);
-static int blackout_line_cmpskip(int n, int x, int y, char *dst, char *src,
-    int w, int pixelsize);
-static int scan_display(int ystart, int rescan);
-
-
-/* array to hold the hints: */
-static hint_t *hint_list;
-
-/* nap state */
-int nap_ok = 0;
-static int nap_diff_count = 0;
-
-static int scan_count = 0;	/* indicates which scan pattern we are on  */
-static int scan_in_progress = 0;	
-
-
-typedef struct tile_change_region {
-	/* start and end lines, along y, of the changed area inside a tile. */
-	unsigned short first_line, last_line;
-	short first_x, last_x;
-	/* info about differences along edges. */
-	unsigned short left_diff, right_diff;
-	unsigned short top_diff,  bot_diff;
-} region_t;
-
-/* array to hold the tiles region_t-s. */
-static region_t *tile_region;
-
-
-
-
-/*
- * setup tile numbers and allocate the tile and hint arrays:
- */
-void initialize_tiles(void) {
-
-	ntiles_x = (dpy_x - 1)/tile_x + 1;
-	ntiles_y = (dpy_y - 1)/tile_y + 1;
-	ntiles = ntiles_x * ntiles_y;
-
-	tile_has_diff = (unsigned char *)
-		calloc((size_t) (ntiles * sizeof(unsigned char)), 1);
-	tile_has_xdamage_diff = (unsigned char *)
-		calloc((size_t) (ntiles * sizeof(unsigned char)), 1);
-	tile_row_has_xdamage_diff = (unsigned char *)
-		calloc((size_t) (ntiles_y * sizeof(unsigned char)), 1);
-	tile_tried    = (unsigned char *)
-		calloc((size_t) (ntiles * sizeof(unsigned char)), 1);
-	tile_copied   = (unsigned char *)
-		calloc((size_t) (ntiles * sizeof(unsigned char)), 1);
-	tile_blackout    = (tile_blackout_t *)
-		calloc((size_t) (ntiles * sizeof(tile_blackout_t)), 1);
-	tile_region = (region_t *) calloc((size_t) (ntiles * sizeof(region_t)), 1);
-
-	tile_row = (XImage **)
-		calloc((size_t) ((ntiles_x + 1) * sizeof(XImage *)), 1);
-	tile_row_shm = (XShmSegmentInfo *)
-		calloc((size_t) ((ntiles_x + 1) * sizeof(XShmSegmentInfo)), 1);
-
-	/* there will never be more hints than tiles: */
-	hint_list = (hint_t *) calloc((size_t) (ntiles * sizeof(hint_t)), 1);
-}
-
-void free_tiles(void) {
-	if (tile_has_diff) {
-		free(tile_has_diff);
-		tile_has_diff = NULL;
-	}
-	if (tile_has_xdamage_diff) {
-		free(tile_has_xdamage_diff);
-		tile_has_xdamage_diff = NULL;
-	}
-	if (tile_row_has_xdamage_diff) {
-		free(tile_row_has_xdamage_diff);
-		tile_row_has_xdamage_diff = NULL;
-	}
-	if (tile_tried) {
-		free(tile_tried);
-		tile_tried = NULL;
-	}
-	if (tile_copied) {
-		free(tile_copied);
-		tile_copied = NULL;
-	}
-	if (tile_blackout) {
-		free(tile_blackout);
-		tile_blackout = NULL;
-	}
-	if (tile_region) {
-		free(tile_region);
-		tile_region = NULL;
-	}
-	if (tile_row) {
-		free(tile_row);
-		tile_row = NULL;
-	}
-	if (tile_row_shm) {
-		free(tile_row_shm);
-		tile_row_shm = NULL;
-	}
-	if (hint_list) {
-		free(hint_list);
-		hint_list = NULL;
-	}
-}
-
-/*
- * silly function to factor dpy_y until fullscreen shm is not bigger than max.
- * should always work unless dpy_y is a large prime or something... under
- * failure fs_factor remains 0 and no fullscreen updates will be tried.
- */
-static int fs_factor = 0;
-
-static void set_fs_factor(int max) {
-	int f, fac = 1, n = dpy_y;
-
-	fs_factor = 0;
-	if ((bpp/8) * dpy_x * dpy_y <= max)  {
-		fs_factor = 1;
-		return;
-	}
-	for (f=2; f <= 101; f++) {
-		while (n % f == 0) {
-			n = n / f;
-			fac = fac * f;
-			if ( (bpp/8) * dpy_x * (dpy_y/fac) <= max )  {
-				fs_factor = fac;
-				return;
-			}
-		}
-	}
-}
-
-static char *flip_ximage_byte_order(XImage *xim) {
-	char *order;
-	if (xim->byte_order == LSBFirst) {
-		order = "MSBFirst";
-		xim->byte_order = MSBFirst;
-		xim->bitmap_bit_order = MSBFirst;
-	} else {
-		order = "LSBFirst";
-		xim->byte_order = LSBFirst;
-		xim->bitmap_bit_order = LSBFirst;
-	}
-	return order;
-}
-
-/*
- * set up an XShm image, or if not using shm just create the XImage.
- */
-static int shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
-    char *name) {
-
-	XImage *xim;
-	static int reported_flip = 0;
-	int db = 0;
-
-	shm->shmid = -1;
-	shm->shmaddr = (char *) -1;
-	*ximg_ptr = NULL;
-
-	if (nofb) {
-		return 1;
-	}
-
-	X_LOCK;
-
-	if (! using_shm || xform24to32 || raw_fb) {
-		/* we only need the XImage created */
-		xim = XCreateImage_wr(dpy, default_visual, depth, ZPixmap,
-		    0, NULL, w, h, raw_fb ? 32 : BitmapPad(dpy), 0);
-
-		X_UNLOCK;
-
-		if (xim == NULL) {
-			rfbErr("XCreateImage(%s) failed.\n", name);
-			if (quiet) {
-				fprintf(stderr, "XCreateImage(%s) failed.\n",
-				    name);
-			}
-			return 0;
-		}
-		if (db) fprintf(stderr, "shm_create simple %d %d\t%p %s\n", w, h, (void *)xim, name);
-		xim->data = (char *) malloc(xim->bytes_per_line * xim->height);
-		if (xim->data == NULL) {
-			rfbErr("XCreateImage(%s) data malloc failed.\n", name);
-			if (quiet) {
-				fprintf(stderr, "XCreateImage(%s) data malloc"
-				    " failed.\n", name);
-			}
-			return 0;
-		}
-		if (flip_byte_order) {
-			char *order = flip_ximage_byte_order(xim);
-			if (! reported_flip && ! quiet) {
-				rfbLog("Changing XImage byte order"
-				    " to %s\n", order);
-				reported_flip = 1;
-			}
-		}
-
-		*ximg_ptr = xim;
-		return 1;
-	}
-
-	if (! dpy) {
-		X_UNLOCK;
-		return 0;
-	}
-
-	xim = XShmCreateImage_wr(dpy, default_visual, depth, ZPixmap, NULL,
-	    shm, w, h);
-
-	if (xim == NULL) {
-		rfbErr("XShmCreateImage(%s) failed.\n", name);
-		if (quiet) {
-			fprintf(stderr, "XShmCreateImage(%s) failed.\n", name);
-		}
-		X_UNLOCK;
-		return 0;
-	}
-
-	*ximg_ptr = xim;
-
-#if LIBVNCSERVER_HAVE_XSHM
-	shm->shmid = shmget(IPC_PRIVATE,
-	    xim->bytes_per_line * xim->height, IPC_CREAT | 0777);
-
-	if (shm->shmid == -1) {
-		rfbErr("shmget(%s) failed.\n", name);
-		rfbLogPerror("shmget");
-
-		XDestroyImage(xim);
-		*ximg_ptr = NULL;
-
-		X_UNLOCK;
-		return 0;
-	}
-
-	shm->shmaddr = xim->data = (char *) shmat(shm->shmid, 0, 0);
-
-	if (shm->shmaddr == (char *)-1) {
-		rfbErr("shmat(%s) failed.\n", name);
-		rfbLogPerror("shmat");
-
-		XDestroyImage(xim);
-		*ximg_ptr = NULL;
-
-		shmctl(shm->shmid, IPC_RMID, 0);
-		shm->shmid = -1;
-
-		X_UNLOCK;
-		return 0;
-	}
-
-	shm->readOnly = False;
-
-	if (! XShmAttach_wr(dpy, shm)) {
-		rfbErr("XShmAttach(%s) failed.\n", name);
-		XDestroyImage(xim);
-		*ximg_ptr = NULL;
-
-		shmdt(shm->shmaddr);
-		shm->shmaddr = (char *) -1;
-
-		shmctl(shm->shmid, IPC_RMID, 0);
-		shm->shmid = -1;
-
-		X_UNLOCK;
-		return 0;
-	}
-#endif
-
-	X_UNLOCK;
-	return 1;
-}
-
-void shm_delete(XShmSegmentInfo *shm) {
-#if LIBVNCSERVER_HAVE_XSHM
-	if (getenv("X11VNC_SHM_DEBUG")) fprintf(stderr, "shm_delete:    %p\n", (void *) shm);
-	if (shm != NULL && shm->shmaddr != (char *) -1) {
-		shmdt(shm->shmaddr);
-	}
-	if (shm != NULL && shm->shmid != -1) {
-		shmctl(shm->shmid, IPC_RMID, 0);
-	}
-	if (shm != NULL) {
-		shm->shmaddr = (char *) -1;
-		shm->shmid = -1;
-	}
-#else
-	if (!shm) {}
-#endif
-}
-
-void shm_clean(XShmSegmentInfo *shm, XImage *xim) {
-	int db = 0;
-
-	if (db) fprintf(stderr, "shm_clean: called:  %p\n", (void *)xim);
-	X_LOCK;
-#if LIBVNCSERVER_HAVE_XSHM
-	if (shm != NULL && shm->shmid != -1 && dpy) {
-		if (db) fprintf(stderr, "shm_clean: XShmDetach_wr\n");
-		XShmDetach_wr(dpy, shm);
-	}
-#endif
-	if (xim != NULL) {
-		if (! raw_fb_back_to_X) {	/* raw_fb hack */
-			if (xim->bitmap_unit != -1) {
-				if (db) fprintf(stderr, "shm_clean: XDestroyImage  %p\n", (void *)xim);
-				XDestroyImage(xim);
-			} else {
-				if (xim->data) {
-					if (db) fprintf(stderr, "shm_clean: free xim->data  %p %p\n", (void *)xim, (void *)(xim->data));
-					free(xim->data);
-					xim->data = NULL;
-				}
-			}
-		}
-		xim = NULL;
-	}
-	X_UNLOCK;
-
-	shm_delete(shm);
-}
-
-void initialize_polling_images(void) {
-	int i, MB = 1024 * 1024;
-
-	/* set all shm areas to "none" before trying to create any */
-	scanline_shm.shmid	= -1;
-	scanline_shm.shmaddr	= (char *) -1;
-	scanline		= NULL;
-	fullscreen_shm.shmid	= -1;
-	fullscreen_shm.shmaddr	= (char *) -1;
-	fullscreen		= NULL;
-	snaprect_shm.shmid	= -1;
-	snaprect_shm.shmaddr	= (char *) -1;
-	snaprect		= NULL;
-	for (i=1; i<=ntiles_x; i++) {
-		tile_row_shm[i].shmid	= -1;
-		tile_row_shm[i].shmaddr	= (char *) -1;
-		tile_row[i]		= NULL;
-	}
-
-	/* the scanline (e.g. 1280x1) shared memory area image: */
-
-	if (! shm_create(&scanline_shm, &scanline, dpy_x, 1, "scanline")) {
-		clean_up_exit(1);
-	}
-
-	/*
-	 * the fullscreen (e.g. 1280x1024/fs_factor) shared memory area image:
-	 * (we cut down the size of the shm area to try avoid and shm segment
-	 * limits, e.g. the default 1MB on Solaris)
-	 */
-#ifdef WIN32
-	set_fs_factor(10 * MB);
-#else
-	if (UT.sysname && strstr(UT.sysname, "Linux")) {
-		set_fs_factor(10 * MB);
-	} else {
-		set_fs_factor(1 * MB);
-	}
-#endif
-	if (fs_frac >= 1.0) {
-		fs_frac = 1.1;
-		fs_factor = 0;
-	}
-	if (! fs_factor) {
-		rfbLog("warning: fullscreen updates are disabled.\n");
-	} else {
-		if (! shm_create(&fullscreen_shm, &fullscreen, dpy_x,
-		    dpy_y/fs_factor, "fullscreen")) {
-			clean_up_exit(1);
-		}
-	}
-	if (use_snapfb) {
-		if (! fs_factor) {
-			rfbLog("warning: disabling -snapfb mode.\n");
-			use_snapfb = 0;
-		} else if (! shm_create(&snaprect_shm, &snaprect, dpy_x,
-		    dpy_y/fs_factor, "snaprect")) {
-			clean_up_exit(1);
-		}
-	}
-
-	/*
-	 * for copy_tiles we need a lot of shared memory areas, one for
-	 * each possible run length of changed tiles.  32 for 1024x768
-	 * and 40 for 1280x1024, etc. 
-	 */
-
-	tile_shm_count = 0;
-	for (i=1; i<=ntiles_x; i++) {
-		if (! shm_create(&tile_row_shm[i], &tile_row[i], tile_x * i,
-		    tile_y, "tile_row")) {
-			if (i == 1) {
-				clean_up_exit(1);
-			}
-			rfbLog("shm: Error creating shared memory tile-row for"
-			    " len=%d,\n", i);
-			rfbLog("shm: reverting to -onetile mode. If this"
-			    " problem persists\n");
-			rfbLog("shm: try using the -onetile or -noshm options"
-			    " to limit\n");
-			rfbLog("shm: shared memory usage, or run ipcrm(1)"
-			    " to manually\n");
-			rfbLog("shm: delete unattached shm segments.\n");
-			single_copytile_count = i;
-			single_copytile = 1;
-		}
-		tile_shm_count++;
-		if (single_copytile && i >= 1) {
-			/* only need 1x1 tiles */
-			break;
-		}
-	}
-	if (verbose) {
-		if (using_shm && ! xform24to32) {
-			rfbLog("created %d tile_row shm polling images.\n",
-			    tile_shm_count);
-		} else {
-			rfbLog("created %d tile_row polling images.\n",
-			    tile_shm_count);
-		}
-	}
-}
-
-/*
- * A hint is a rectangular region built from 1 or more adjacent tiles
- * glued together.  Ultimately, this information in a single hint is sent
- * to libvncserver rather than sending each tile separately.
- */
-static void create_tile_hint(int x, int y, int tw, int th, hint_t *hint) {
-	int w = dpy_x - x;
-	int h = dpy_y - y;
-
-	if (w > tw) {
-		w = tw;
-	}
-	if (h > th) {
-		h = th;
-	}
-
-	hint->x = x;
-	hint->y = y;
-	hint->w = w;
-	hint->h = h;
-}
-
-static void extend_tile_hint(int x, int y, int tw, int th, hint_t *hint) {
-	int w = dpy_x - x;
-	int h = dpy_y - y;
-
-	if (w > tw) {
-		w = tw;
-	}
-	if (h > th) {
-		h = th;
-	}
-
-	if (hint->x > x) {			/* extend to the left */
-		hint->w += hint->x - x;
-		hint->x = x;
-	}
-	if (hint->y > y) {			/* extend upward */
-		hint->h += hint->y - y;
-		hint->y = y;
-	}
-
-	if (hint->x + hint->w < x + w) {	/* extend to the right */
-		hint->w = x + w - hint->x;
-	}
-	if (hint->y + hint->h < y + h) {	/* extend downward */
-		hint->h = y + h - hint->y;
-	}
-}
-
-static void save_hint(hint_t hint, int loc) {
-	/* simply copy it to the global array for later use. */
-	hint_list[loc].x = hint.x;
-	hint_list[loc].y = hint.y;
-	hint_list[loc].w = hint.w;
-	hint_list[loc].h = hint.h;
-}
-
-/*
- * Glue together horizontal "runs" of adjacent changed tiles into one big
- * rectangle change "hint" to be passed to the vnc machinery.
- */
-static void hint_updates(void) {
-	hint_t hint;
-	int x, y, i, n, ty, th, tx, tw;
-	int hint_count = 0, in_run = 0;
-
-	hint.x = hint.y = hint.w = hint.h = 0;
-
-	for (y=0; y < ntiles_y; y++) {
-		for (x=0; x < ntiles_x; x++) {
-			n = x + y * ntiles_x;
-
-			if (tile_has_diff[n]) {
-				ty = tile_region[n].first_line;
-				th = tile_region[n].last_line - ty + 1;
-
-				tx = tile_region[n].first_x;
-				tw = tile_region[n].last_x - tx + 1;
-				if (tx < 0) {
-					tx = 0;
-					tw = tile_x;
-				}
-
-				if (! in_run) {
-					create_tile_hint( x * tile_x + tx,
-					    y * tile_y + ty, tw, th, &hint);
-					in_run = 1;
-				} else {
-					extend_tile_hint( x * tile_x + tx,
-					    y * tile_y + ty, tw, th, &hint);
-				}
-			} else {
-				if (in_run) {
-					/* end of a row run of altered tiles: */
-					save_hint(hint, hint_count++);
-					in_run = 0;
-				}
-			}
-		}
-		if (in_run) {	/* save the last row run */
-			save_hint(hint, hint_count++);
-			in_run = 0;
-		}
-	}
-
-	for (i=0; i < hint_count; i++) {
-		/* pass update info to vnc: */
-		mark_hint(hint_list[i]);
-	}
-}
-
-/*
- * kludge, simple ceil+floor for non-negative doubles:
- */
-#define CEIL(x)  ( (double) ((int) (x)) == (x) ? \
-	(double) ((int) (x)) : (double) ((int) (x) + 1) )
-#define FLOOR(x) ( (double) ((int) (x)) )
-
-/*
- * Scaling:
- *
- * For shrinking, a destination (scaled) pixel will correspond to more
- * than one source (i.e. main fb) pixel.  Think of an x-y plane made with
- * graph paper.  Each unit square in the graph paper (i.e. collection of
- * points (x,y) such that N < x < N+1 and M < y < M+1, N and M integers)
- * corresponds to one pixel in the unscaled fb.  There is a solid
- * color filling the inside of such a square.  A scaled pixel has width
- * 1/scale_fac, e.g. for "-scale 3/4" the width of the scaled pixel
- * is 1.333.  The area of this scaled pixel is 1.333 * 1.333 (so it
- * obviously overlaps more than one source pixel, each which have area 1).
- *
- * We take the weight an unscaled pixel (source) contributes to a
- * scaled pixel (destination) as simply proportional to the overlap area
- * between the two pixels.  One can then think of the value of the scaled
- * pixel as an integral over the portion of the graph paper it covers.
- * The thing being integrated is the color value of the unscaled source.
- * That color value is constant over a graph paper square (source pixel),
- * and changes discontinuously from one unit square to the next.
- *
-
-Here is an example for -scale 3/4, the solid lines are the source pixels
-(graph paper unit squares), while the dotted lines denote the scaled
-pixels (destination pixels):
-
-            0         1 4/3     2     8/3 3         4=12/3
-            |---------|--.------|------.--|---------|.                
-            |         |  .      |      .  |         |.                
-            |    A    |  . B    |      .  |         |.                
-            |         |  .      |      .  |         |.                
-            |         |  .      |      .  |         |.                
-          1 |---------|--.------|------.--|---------|.                
-         4/3|.........|.........|.........|.........|.                
-            |         |  .      |      .  |         |.                
-            |    C    |  . D    |      .  |         |.                
-            |         |  .      |      .  |         |.                
-          2 |---------|--.------|------.--|---------|.                
-            |         |  .      |      .  |         |.                
-            |         |  .      |      .  |         |.                
-         8/3|.........|.........|.........|.........|.                
-            |         |  .      |      .  |         |.                
-          3 |---------|--.------|------.--|---------|.                
-
-So we see the first scaled pixel (0 < x < 4/3 and 0 < y < 4/3) mostly
-overlaps with unscaled source pixel "A".  The integration (averaging)
-weights for this scaled pixel are:
-
-			A	 1
-			B	1/3
-			C	1/3
-			D	1/9
-
- *
- * The Red, Green, and Blue color values must be averaged over separately
- * otherwise you can get a complete mess (except in solid regions),
- * because high order bits are averaged differently from the low order bits.
- *
- * So the algorithm is roughly:
- *
- *   - Given as input a rectangle in the unscaled source fb with changes,
- *     find the rectangle of pixels this affects in the scaled destination fb.
- *
- *   - For each of the affected scaled (dest) pixels, determine all of the
- *     unscaled (source) pixels it overlaps with.
- *  
- *   - Average those unscaled source values together, weighted by the area
- *     overlap with the destination pixel.  Average R, G, B separately.
- *
- *   - Take this average value and convert to a valid pixel value if
- *     necessary (e.g. rounding, shifting), and then insert it into the
- *     destination framebuffer as the pixel value.
- *
- *   - On to the next destination pixel...
- *
- * ========================================================================
- *
- * For expanding, e.g. -scale 1.1 (which we don't think people will do
- * very often... or at least so we hope, the framebuffer can become huge)
- * the situation is reversed and the destination pixel is smaller than a
- * "graph paper" unit square (source pixel).  Some destination pixels
- * will be completely within a single unscaled source pixel.
- *
- * What we do here is a simple 4 point interpolation scheme:
- * 
- * Let P00 be the source pixel closest to the destination pixel but with
- * x and y values less than or equal to those of the destination pixel.
- * (for simplicity, think of the upper left corner of a pixel defining the
- * x,y location of the pixel, the center would work just as well).  So it
- * is the source pixel immediately to the upper left of the destination
- * pixel.  Let P10 be the source pixel one to the right of P00.  Let P01
- * be one down from P00.  And let P11 be one down and one to the right
- * of P00.  They form a 2x2 square we will interpolate inside of.
- * 
- * Let V00, V10, V01, and V11 be the color values of those 4 source
- * pixels.  Let dx be the displacement along x the destination pixel is
- * from P00.  Note: 0 <= dx < 1 by definition of P00.  Similarly let
- * dy be the displacement along y.  The weighted average for the
- * interpolation is:
- * 
- * 	V_ave = V00 * (1 - dx) * (1 - dy)
- * 	      + V10 *      dx  * (1 - dy)
- * 	      + V01 * (1 - dx) *      dy
- * 	      + V11 *      dx  *      dy
- * 
- * Note that the weights (1-dx)*(1-dy) + dx*(1-dy) + (1-dx)*dy + dx*dy
- * automatically add up to 1.  It is also nice that all the weights are
- * positive (unsigned char stays unsigned char).  The above formula can
- * be motivated by doing two 1D interpolations along x:
- * 
- * 	VA = V00 * (1 - dx) + V10 * dx
- * 	VB = V01 * (1 - dx) + V11 * dx
- * 
- * and then interpolating VA and VB along y:
- * 
- * 	V_ave = VA * (1 - dy) + VB * dy
- * 
- *                      VA 
- *           v   |<-dx->|
- *           -- V00 ------ V10
- *           dy  |          |  
- *           --  |      o...|...    "o" denotes the position of the desired
- *           ^   |      .   |  .    destination pixel relative to the P00
- *               |      .   |  .    source pixel.
- *              V10 ----.- V11 .
- *                      ........
- *                      |  
- *                      VB 
- *
- * 
- * Of course R, G, B averages are done separately as in the shrinking
- * case.  This gives reasonable results, and the implementation for
- * shrinking can simply be used with different choices for weights for
- * the loop over the 4 pixels.
- */
-
-void scale_rect(double factor_x, double factor_y, int blend, int interpolate, int Bpp,
-    char *src_fb, int src_bytes_per_line, char *dst_fb, int dst_bytes_per_line,
-    int Nx, int Ny, int nx, int ny, int X1, int Y1, int X2, int Y2, int mark) {
-/*
- * Notation:
- * "i" an x pixel index in the destination (scaled) framebuffer
- * "j" a  y pixel index in the destination (scaled) framebuffer
- * "I" an x pixel index in the source (un-scaled, i.e. main) framebuffer
- * "J" a  y pixel index in the source (un-scaled, i.e. main) framebuffer
- *
- *  Similarly for nx, ny, Nx, Ny, etc.  Lowercase: dest, Uppercase: source.
- */
-	int i, j, i1, i2, j1, j2;	/* indices for scaled fb (dest) */
-	int I, J, I1, I2, J1, J2;	/* indices for main fb   (source) */
-
-	double w, wx, wy, wtot;	/* pixel weights */
-
-	double x1, y1, x2, y2;	/* x-y coords for destination pixels edges */
-	double dx, dy;		/* size of destination pixel */
-	double ddx=0, ddy=0;	/* for interpolation expansion */
-
-	char *src, *dest;	/* pointers to the two framebuffers */
-
-
-	unsigned short us = 0;
-	unsigned char  uc = 0;
-	unsigned int   ui = 0;
-
-	int use_noblend_shortcut = 1;
-	int shrink;		/* whether shrinking or expanding */
-	static int constant_weights = -1, mag_int = -1;
-	static int last_Nx = -1, last_Ny = -1, cnt = 0;
-	static double last_factor = -1.0;
-	int b, k;
-	double pixave[4];	/* for averaging pixel values */
-
-	if (factor_x <= 1.0 && factor_y <= 1.0) {
-		shrink = 1;
-	} else {
-		shrink = 0;
-	}
-
-	/*
-	 * N.B. width and height (real numbers) of a scaled pixel.
-	 * both are > 1   (e.g. 1.333 for -scale 3/4)
-	 * they should also be equal but we don't assume it.
-	 *
-	 * This new way is probably the best we can do, take the inverse
-	 * of the scaling factor to double precision.
-	 */
-	dx = 1.0/factor_x;
-	dy = 1.0/factor_y;
-
-	/*
-	 * There is some speedup if the pixel weights are constant, so
-	 * let's special case these.
-	 *
-	 * If scale = 1/n and n divides Nx and Ny, the pixel weights
-	 * are constant (e.g. 1/2 => equal on 2x2 square).
-	 */
-	if (factor_x != last_factor || Nx != last_Nx || Ny != last_Ny) {
-		constant_weights = -1;
-		mag_int = -1;
-		last_Nx = Nx;
-		last_Ny = Ny;
-		last_factor = factor_x;
-	}
-	if (constant_weights < 0 && factor_x != factor_y) {
-		constant_weights = 0;
-		mag_int = 0;
-
-	} else if (constant_weights < 0) {
-		int n = 0;
-
-		constant_weights = 0;
-		mag_int = 0;
-
-		for (i = 2; i<=128; i++) {
-			double test = ((double) 1)/ i;
-			double diff, eps = 1.0e-7;
-			diff = factor_x - test;
-			if (-eps < diff && diff < eps) {
-				n = i;
-				break;
-			}
-		}
-		if (! blend || ! shrink || interpolate) {
-			;
-		} else if (n != 0) {
-			if (Nx % n == 0 && Ny % n == 0) {
-				static int didmsg = 0;
-				if (mark && ! didmsg) {
-					didmsg = 1;
-					rfbLog("scale_and_mark_rect: using "
-					    "constant pixel weight speedup "
-					    "for 1/%d\n", n);
-				}
-				constant_weights = 1;
-			}
-		}
-
-		n = 0;
-		for (i = 2; i<=32; i++) {
-			double test = (double) i;
-			double diff, eps = 1.0e-7;
-			diff = factor_x - test;
-			if (-eps < diff && diff < eps) {
-				n = i;
-				break;
-			}
-		}
-		if (! blend && factor_x > 1.0 && n) {
-			mag_int = n;
-		}
-	}
-
-	if (mark && factor_x > 1.0 && blend) {
-		/*
-		 * kludge: correct for interpolating blurring leaking
-		 * up or left 1 destination pixel.
-		 */
-		if (X1 > 0) X1--;
-		if (Y1 > 0) Y1--;
-	}
-
-	/*
-	 * find the extent of the change the input rectangle induces in
-	 * the scaled framebuffer.
-	 */
-
-	/* Left edges: find largest i such that i * dx <= X1  */
-	i1 = FLOOR(X1/dx);
-
-	/* Right edges: find smallest i such that (i+1) * dx >= X2+1  */
-	i2 = CEIL( (X2+1)/dx ) - 1;
-
-	/* To be safe, correct any overflows: */
-	i1 = nfix(i1, nx);
-	i2 = nfix(i2, nx) + 1;	/* add 1 to make a rectangle upper boundary */
-
-	/* Repeat above for y direction: */
-	j1 = FLOOR(Y1/dy);
-	j2 = CEIL( (Y2+1)/dy ) - 1;
-
-	j1 = nfix(j1, ny);
-	j2 = nfix(j2, ny) + 1;
-
-	/*
-	 * special case integer magnification with no blending.
-	 * vision impaired magnification usage is interested in this case.
-	 */
-	if (mark && ! blend && mag_int && Bpp != 3) {
-		int jmin, jmax, imin, imax;
-
-		/* outer loop over *source* pixels */
-		for (J=Y1; J < Y2; J++) {
-		    jmin = J * mag_int;
-		    jmax = jmin + mag_int;
-		    for (I=X1; I < X2; I++) {
-			/* extract value */
-			src = src_fb + J*src_bytes_per_line + I*Bpp;
-			if (Bpp == 4) {
-				ui = *((unsigned int *)src);
-			} else if (Bpp == 2) {
-				us = *((unsigned short *)src);
-			} else if (Bpp == 1) {
-				uc = *((unsigned char *)src);
-			}
-			imin = I * mag_int;
-			imax = imin + mag_int;
-			/* inner loop over *dest* pixels */
-			for (j=jmin; j<jmax; j++) {
-			    dest = dst_fb + j*dst_bytes_per_line + imin*Bpp;
-			    for (i=imin; i<imax; i++) {
-				if (Bpp == 4) {
-					*((unsigned int *)dest) = ui;
-				} else if (Bpp == 2) {
-					*((unsigned short *)dest) = us;
-				} else if (Bpp == 1) {
-					*((unsigned char *)dest) = uc;
-				}
-				dest += Bpp;
-			    }
-			}
-		    }
-		}
-		goto markit;
-	}
-
-	/* set these all to 1.0 to begin with */
-	wx = 1.0;
-	wy = 1.0;
-	w  = 1.0;
-
-	/*
-	 * Loop over destination pixels in scaled fb:
-	 */
-	for (j=j1; j<j2; j++) {
-		y1 =  j * dy;	/* top edge */
-		if (y1 > Ny - 1) {
-			/* can go over with dy = 1/scale_fac */
-			y1 = Ny - 1;
-		}
-		y2 = y1 + dy;	/* bottom edge */
-
-		/* Find main fb indices covered by this dest pixel: */
-		J1 = (int) FLOOR(y1);
-		J1 = nfix(J1, Ny);
-
-		if (shrink && ! interpolate) {
-			J2 = (int) CEIL(y2) - 1;
-			J2 = nfix(J2, Ny);
-		} else {
-			J2 = J1 + 1;	/* simple interpolation */
-			ddy = y1 - J1;
-		}
-
-		/* destination char* pointer: */
-		dest = dst_fb + j*dst_bytes_per_line + i1*Bpp;
-		
-		for (i=i1; i<i2; i++) {
-
-			x1 =  i * dx;	/* left edge */
-			if (x1 > Nx - 1) {
-				/* can go over with dx = 1/scale_fac */
-				x1 = Nx - 1;
-			}
-			x2 = x1 + dx;	/* right edge */
-
-			cnt++;
-
-			/* Find main fb indices covered by this dest pixel: */
-			I1 = (int) FLOOR(x1);
-			if (I1 >= Nx) I1 = Nx - 1;
-
-			if (! blend && use_noblend_shortcut) {
-				/*
-				 * The noblend case involves no weights,
-				 * and 1 pixel, so just copy the value
-				 * directly.
-				 */
-				src = src_fb + J1*src_bytes_per_line + I1*Bpp;
-				if (Bpp == 4) {
-					*((unsigned int *)dest)
-					    = *((unsigned int *)src);
-				} else if (Bpp == 2) {
-					*((unsigned short *)dest)
-					    = *((unsigned short *)src);
-				} else if (Bpp == 1) {
-					*(dest) = *(src);
-				} else if (Bpp == 3) {
-					/* rare case */
-					for (k=0; k<=2; k++) {
-						*(dest+k) = *(src+k);
-					}
-				}
-				dest += Bpp;
-				continue;
-			}
-			
-			if (shrink && ! interpolate) {
-				I2 = (int) CEIL(x2) - 1;
-				if (I2 >= Nx) I2 = Nx - 1;
-			} else {
-				I2 = I1 + 1;	/* simple interpolation */
-				ddx = x1 - I1;
-			}
-
-			/* Zero out accumulators for next pixel average: */
-			for (b=0; b<4; b++) {
-				pixave[b] = 0.0; /* for RGB weighted sums */
-			}
-
-			/*
-			 * wtot is for accumulating the total weight.
-			 * It should always sum to 1/(scale_fac * scale_fac).
-			 */
-			wtot = 0.0;
-
-			/*
-			 * Loop over source pixels covered by this dest pixel.
-			 * 
-			 * These "extra" loops over "J" and "I" make
-			 * the cache/cacheline performance unclear.
-			 * For example, will the data brought in from
-			 * src for j, i, and J=0 still be in the cache
-			 * after the J > 0 data have been accessed and
-			 * we are at j, i+1, J=0?  The stride in J is
-			 * main_bytes_per_line, and so ~4 KB.
-			 *
-			 * Typical case when shrinking are 2x2 loop, so
-			 * just two lines to worry about.
-			 */
-			for (J=J1; J<=J2; J++) {
-			    /* see comments for I, x1, x2, etc. below */
-			    if (constant_weights) {
-				;
-			    } else if (! blend) {
-				if (J != J1) {
-					continue;
-				}
-				wy = 1.0;
-
-				/* interpolation scheme: */
-			    } else if (! shrink || interpolate) {
-				if (J >= Ny) {
-					continue;
-				} else if (J == J1) {
-					wy = 1.0 - ddy;
-				} else if (J != J1) {
-					wy = ddy;
-				}
-
-				/* integration scheme: */
-			    } else if (J < y1) {
-				wy = J+1 - y1;
-			    } else if (J+1 > y2) {
-				wy = y2 - J;
-			    } else {
-				wy = 1.0;
-			    }
-
-			    src = src_fb + J*src_bytes_per_line + I1*Bpp;
-
-			    for (I=I1; I<=I2; I++) {
-
-				/* Work out the weight: */
-
-				if (constant_weights) {
-					;
-				} else if (! blend) {
-					/*
-					 * Ugh, PseudoColor colormap is
-					 * bad news, to avoid random
-					 * colors just take the first
-					 * pixel.  Or user may have
-					 * specified :nb to fraction.
-					 * The :fb will force blending
-					 * for this case.
-					 */
-					if (I != I1) {
-						continue;
-					}
-					wx = 1.0;
-
-					/* interpolation scheme: */
-				} else if (! shrink || interpolate) {
-					if (I >= Nx) {
-						continue;	/* off edge */
-					} else if (I == I1) {
-						wx = 1.0 - ddx;
-					} else if (I != I1) {
-						wx = ddx;
-					}
-
-					/* integration scheme: */
-				} else if (I < x1) {
-					/* 
-					 * source left edge (I) to the
-					 * left of dest left edge (x1):
-					 * fractional weight
-					 */
-					wx = I+1 - x1;
-				} else if (I+1 > x2) {
-					/* 
-					 * source right edge (I+1) to the
-					 * right of dest right edge (x2):
-					 * fractional weight
-					 */
-					wx = x2 - I;
-				} else {
-					/* 
-					 * source edges (I and I+1) completely
-					 * inside dest edges (x1 and x2):
-					 * full weight
-					 */
-					wx = 1.0;
-				}
-
-				w = wx * wy;
-				wtot += w;
-
-				/* 
-				 * We average the unsigned char value
-				 * instead of char value: otherwise
-				 * the minimum (char 0) is right next
-				 * to the maximum (char -1)!  This way
-				 * they are spread between 0 and 255.
-				 */
-				if (Bpp == 4) {
-					/* unroll the loops, can give 20% */
-					pixave[0] += w * ((unsigned char) *(src  ));
-					pixave[1] += w * ((unsigned char) *(src+1));
-					pixave[2] += w * ((unsigned char) *(src+2));
-					pixave[3] += w * ((unsigned char) *(src+3));
-				} else if (Bpp == 2) {
-					/*
-					 * 16bpp: trickier with green
-					 * split over two bytes, so we
-					 * use the masks:
-					 */
-					us = *((unsigned short *) src);
-					pixave[0] += w*(us & main_red_mask);
-					pixave[1] += w*(us & main_green_mask);
-					pixave[2] += w*(us & main_blue_mask);
-				} else if (Bpp == 1) {
-					pixave[0] += w *
-					    ((unsigned char) *(src));
-				} else {
-					for (b=0; b<Bpp; b++) {
-						pixave[b] += w *
-						    ((unsigned char) *(src+b));
-					}
-				}
-				src += Bpp;
-			    }
-			}
-
-			if (wtot <= 0.0) {
-				wtot = 1.0;
-			}
-			wtot = 1.0/wtot;	/* normalization factor */
-
-			/* place weighted average pixel in the scaled fb: */
-			if (Bpp == 4) {
-				*(dest  ) = (char) (wtot * pixave[0]);
-				*(dest+1) = (char) (wtot * pixave[1]);
-				*(dest+2) = (char) (wtot * pixave[2]);
-				*(dest+3) = (char) (wtot * pixave[3]);
-			} else if (Bpp == 2) {
-				/* 16bpp / 565 case: */
-				pixave[0] *= wtot;
-				pixave[1] *= wtot;
-				pixave[2] *= wtot;
-				us =  (main_red_mask   & (int) pixave[0])
-				    | (main_green_mask & (int) pixave[1])
-				    | (main_blue_mask  & (int) pixave[2]);
-				*( (unsigned short *) dest ) = us;
-			} else if (Bpp == 1) {
-				*(dest) = (char) (wtot * pixave[0]);
-			} else {
-				for (b=0; b<Bpp; b++) {
-					*(dest+b) = (char) (wtot * pixave[b]);
-				}
-			}
-			dest += Bpp;
-		}
-	}
-	markit:
-	if (mark) {
-		mark_rect_as_modified(i1, j1, i2, j2, 1);
-	}
-}
-
-/*
- Framebuffers data flow:
-                                                                             
- General case:
-                --------       --------       --------        --------    
-    -----      |8to24_fb|     |main_fb |     |snap_fb |      | X      |    
-   |rfbfb| <== |        | <== |        | <== |        | <==  | Server |    
-    -----       --------       --------       --------        --------    
-   (to vnc)    (optional)    (usu = rfbfb)   (optional)      (read only)   
-
- 8to24_fb mode will create side fbs: poll24_fb and poll8_fb for
- bookkeepping the different regions (merged into 8to24_fb).
-
- Normal case:
-    --------        --------    
-   |main_fb |      | X      |    
-   |= rfb_fb| <==  | Server |    
-    --------        --------    
-                                                                             
- Scaling case:
-                --------        --------    
-    -----      |main_fb |      | X      |    
-   |rfbfb| <== |        | <==  | Server |    
-    -----       --------        --------    
-
- Webcam/video case:
-    --------        --------        --------    
-   |main_fb |      |snap_fb |      | Video  |    
-   |        | <==  |        | <==  | device |    
-    --------        --------        --------    
-
-If we ever do a -rr rotation/reflection tran, it probably should 
-be done after any scaling (need a rr_fb for intermediate results)
-
--rr option:		transformation:
-
-	none		x -> x;
-			y -> y;
-
-	x		x -> w - x - 1;
-			y -> y;
-
-	y		x -> x;
-			x -> h - y - 1;
-
-	xy		x -> w - x - 1;
-			y -> h - y - 1;
-
-	+90		x -> h - y - 1;
-			y -> x;
-
-	+90x		x -> y;
-			y -> x;
-
-	+90y		x -> h - y - 1;
-			y -> w - x - 1;
-
-	-90		x -> y;
-			y -> w - x - 1;
-
-some aliases:
-
-	xy:	yx, +180, -180, 180
-	+90:	90
-	+90x:	90x
-	+90y:	90y
-	-90:	+270, 270
- */
-
-void scale_and_mark_rect(int X1, int Y1, int X2, int Y2, int mark) {
-	char *dst_fb, *src_fb = main_fb;
-	int dst_bpl, Bpp = bpp/8, fac = 1;
-
-	if (!screen || !rfb_fb || !main_fb) {
-		return;
-	}
-	if (! screen->serverFormat.trueColour) {
-		/*
-		 * PseudoColor colormap... blending leads to random colors.
-		 * User can override with ":fb"
-		 */
-		if (scaling_blend == 1) {
-			/* :fb option sets it to 2 */
-			if (default_visual->class == StaticGray) {
-				/*
-				 * StaticGray can be blended OK, otherwise
-				 * user can disable with :nb
-				 */
-				;
-			} else {
-				scaling_blend = 0;
-			}
-		}
-	}
-
-	if (cmap8to24 && cmap8to24_fb) {
-		src_fb = cmap8to24_fb;
-		if (scaling) {
-			if (depth <= 8) {
-				fac = 4;
-			} else if (depth <= 16) {
-				fac = 2;
-			}
-		}
-	}
-	dst_fb = rfb_fb;
-	dst_bpl = rfb_bytes_per_line;
-
-	scale_rect(scale_fac_x, scale_fac_y, scaling_blend, scaling_interpolate, fac * Bpp,
-	    src_fb, fac * main_bytes_per_line, dst_fb, dst_bpl, dpy_x, dpy_y,
-	    scaled_x, scaled_y, X1, Y1, X2, Y2, mark);
-}
-
-void rotate_coords(int x, int y, int *xo, int *yo, int dxi, int dyi) {
-	int xi = x, yi = y;
-	int Dx, Dy;
-
-	if (dxi >= 0) {
-		Dx = dxi;
-		Dy = dyi;
-	} else if (scaling) {
-		Dx = scaled_x;
-		Dy = scaled_y;
-	} else {
-		Dx = dpy_x;
-		Dy = dpy_y;
-	}
-
-	/* ncache?? */
-
-	if (rotating == ROTATE_NONE) {
-		*xo = xi;
-		*yo = yi;
-	} else if (rotating == ROTATE_X) {
-		*xo = Dx - xi - 1;
-		*yo = yi;
-	} else if (rotating == ROTATE_Y) {
-		*xo = xi;
-		*yo = Dy - yi - 1;
-	} else if (rotating == ROTATE_XY) {
-		*xo = Dx - xi - 1;
-		*yo = Dy - yi - 1;
-	} else if (rotating == ROTATE_90) {
-		*xo = Dy - yi - 1;
-		*yo = xi;
-	} else if (rotating == ROTATE_90X) {
-		*xo = yi;
-		*yo = xi;
-	} else if (rotating == ROTATE_90Y) {
-		*xo = Dy - yi - 1;
-		*yo = Dx - xi - 1;
-	} else if (rotating == ROTATE_270) {
-		*xo = yi;
-		*yo = Dx - xi - 1;
-	}
-}
-
-void rotate_coords_inverse(int x, int y, int *xo, int *yo, int dxi, int dyi) {
-	int xi = x, yi = y;
-
-	int Dx, Dy;
-
-	if (dxi >= 0) {
-		Dx = dxi;
-		Dy = dyi;
-	} else if (scaling) {
-		Dx = scaled_x;
-		Dy = scaled_y;
-	} else {
-		Dx = dpy_x;
-		Dy = dpy_y;
-	}
-	if (! rotating_same) {
-		int t = Dx;
-		Dx = Dy;
-		Dy = t;
-	}
-
-	if (rotating == ROTATE_NONE) {
-		*xo = xi;
-		*yo = yi;
-	} else if (rotating == ROTATE_X) {
-		*xo = Dx - xi - 1;
-		*yo = yi;
-	} else if (rotating == ROTATE_Y) {
-		*xo = xi;
-		*yo = Dy - yi - 1;
-	} else if (rotating == ROTATE_XY) {
-		*xo = Dx - xi - 1;
-		*yo = Dy - yi - 1;
-	} else if (rotating == ROTATE_90) {
-		*xo = yi;
-		*yo = Dx - xi - 1;
-	} else if (rotating == ROTATE_90X) {
-		*xo = yi;
-		*yo = xi;
-	} else if (rotating == ROTATE_90Y) {
-		*xo = Dy - yi - 1;
-		*yo = Dx - xi - 1;
-	} else if (rotating == ROTATE_270) {
-		*xo = Dy - yi - 1;
-		*yo = xi;
-	}
-}
-
-	/* unroll the Bpp loop to be used in each case: */
-#define ROT_COPY \
-	src = src_0 + fbl*y  + Bpp*x;  \
-	dst = dst_0 + rbl*yn + Bpp*xn; \
-	if (Bpp == 1) { \
-		*(dst) = *(src);	 \
-	} else if (Bpp == 2) { \
-		*(dst+0) = *(src+0);	 \
-		*(dst+1) = *(src+1);	 \
-	} else if (Bpp == 3) { \
-		*(dst+0) = *(src+0);	 \
-		*(dst+1) = *(src+1);	 \
-		*(dst+2) = *(src+2);	 \
-	} else if (Bpp == 4) { \
-		*(dst+0) = *(src+0);	 \
-		*(dst+1) = *(src+1);	 \
-		*(dst+2) = *(src+2);	 \
-		*(dst+3) = *(src+3);	 \
-	}
-
-void rotate_fb(int x1, int y1, int x2, int y2) {
-	int x, y, xn, yn, r_x1, r_y1, r_x2, r_y2, Bpp = bpp/8;
-	int fbl = rfb_bytes_per_line;
-	int rbl = rot_bytes_per_line;
-	int Dx, Dy;
-	char *src, *dst;
-	char *src_0 = rfb_fb;
-	char *dst_0 = rot_fb;
-
-	if (! rotating || ! rot_fb) {
-		return;
-	}
-
-	if (scaling) {
-		Dx = scaled_x;
-		Dy = scaled_y;
-	} else {
-		Dx = dpy_x;
-		Dy = dpy_y;
-	}
-	rotate_coords(x1, y1, &r_x1, &r_y1, -1, -1);
-	rotate_coords(x2, y2, &r_x2, &r_y2, -1, -1);
-
-	dst = rot_fb;
-
-	if (rotating == ROTATE_X) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = Dx - x - 1;
-				yn = y;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_Y) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = x;
-				yn = Dy - y - 1;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_XY) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = Dx - x - 1;
-				yn = Dy - y - 1;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_90) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = Dy - y - 1;
-				yn = x;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_90X) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = y;
-				yn = x;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_90Y) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = Dy - y - 1;
-				yn = Dx - x - 1;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_270) {
-		for (y = y1; y < y2; y++)  {
-			for (x = x1; x < x2; x++)  {
-				xn = y;
-				yn = Dx - x - 1;
-				ROT_COPY
-			}
-		}
-	}
-}
-
-void rotate_curs(char *dst_0, char *src_0, int Dx, int Dy, int Bpp) {
-	int x, y, xn, yn;
-	char *src, *dst;
-	int fbl, rbl;
-
-	if (! rotating) {
-		return;
-	}
-
-	fbl = Dx * Bpp;
-	if (rotating_same) {
-		rbl = Dx * Bpp;
-	} else {
-		rbl = Dy * Bpp;
-	}
-
-	if (rotating == ROTATE_X) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = Dx - x - 1;
-				yn = y;
-				ROT_COPY
-if (0) fprintf(stderr, "rcurs: %d %d  %d %d\n", x, y, xn, yn);
-			}
-		}
-	} else if (rotating == ROTATE_Y) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = x;
-				yn = Dy - y - 1;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_XY) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = Dx - x - 1;
-				yn = Dy - y - 1;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_90) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = Dy - y - 1;
-				yn = x;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_90X) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = y;
-				yn = x;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_90Y) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = Dy - y - 1;
-				yn = Dx - x - 1;
-				ROT_COPY
-			}
-		}
-	} else if (rotating == ROTATE_270) {
-		for (y = 0; y < Dy; y++)  {
-			for (x = 0; x < Dx; x++)  {
-				xn = y;
-				yn = Dx - x - 1;
-				ROT_COPY
-			}
-		}
-	}
-}
-
-void mark_wrapper(int x1, int y1, int x2, int y2) {
-	int t, r_x1 = x1, r_y1 = y1, r_x2 = x2, r_y2 = y2;
-
-	if (rotating) {
-		/* well we hope rot_fb will always be the last one... */
-		rotate_coords(x1, y1, &r_x1, &r_y1, -1, -1);
-		rotate_coords(x2, y2, &r_x2, &r_y2, -1, -1);
-		rotate_fb(x1, y1, x2, y2);
-		if (r_x1 > r_x2) {
-			t = r_x1;
-			r_x1 = r_x2;
-			r_x2 = t;
-		}
-		if (r_y1 > r_y2) {
-			t = r_y1;
-			r_y1 = r_y2;
-			r_y2 = t;
-		}
-		/* painting errors  */
-		r_x1--;
-		r_x2++;
-		r_y1--;
-		r_y2++;
-	}
-	rfbMarkRectAsModified(screen, r_x1, r_y1, r_x2, r_y2);
-}
-
-void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force) {
-
-	if (damage_time != 0) {
-		/*
-		 * This is not XDAMAGE, rather a hack for testing
-		 * where we allow the framebuffer to be corrupted for
-		 * damage_delay seconds.
-		 */
-		int debug = 0;
-		if (time(NULL) > damage_time + damage_delay) {
-			if (! quiet) {
-				rfbLog("damaging turned off.\n");
-			}
-			damage_time = 0;
-			damage_delay = 0;
-		} else {
-			if (debug) {
-				rfbLog("damaging viewer fb by not marking "
-				    "rect: %d,%d,%d,%d\n", x1, y1, x2, y2);
-			}
-			return;
-		}
-	}
-
-
-	if (rfb_fb == main_fb || force) {
-		mark_wrapper(x1, y1, x2, y2);
-		return;
-	}
-
-	if (cmap8to24) {
-		bpp8to24(x1, y1, x2, y2);
-	}
-
-	if (scaling) {
-		scale_and_mark_rect(x1, y1, x2, y2, 1);
-	} else {
-		mark_wrapper(x1, y1, x2, y2);
-	}
-}
-
-/*
- * Notifies libvncserver of a changed hint rectangle.
- */
-static void mark_hint(hint_t hint) {
-	int x = hint.x;	
-	int y = hint.y;	
-	int w = hint.w;	
-	int h = hint.h;	
-
-	mark_rect_as_modified(x, y, x + w, y + h, 0);
-}
-
-/*
- * copy_tiles() gives a slight improvement over copy_tile() since
- * adjacent runs of tiles are done all at once there is some savings
- * due to contiguous memory access.  Not a great speedup, but in some
- * cases it can be up to 2X.  Even more on a SunRay or ShadowFB where
- * no graphics hardware is involved in the read.  Generally, graphics
- * devices are optimized for write, not read, so we are limited by the
- * read bandwidth, sometimes only 5 MB/sec on otherwise fast hardware.
- */
-static int *first_line = NULL, *last_line = NULL;
-static unsigned short *left_diff = NULL, *right_diff = NULL;
-
-static int copy_tiles(int tx, int ty, int nt) {
-	int x, y, line;
-	int size_x, size_y, width1, width2;
-	int off, len, n, dw, dx, t;
-	int w1, w2, dx1, dx2;	/* tmps for normal and short tiles */
-	int pixelsize = bpp/8;
-	int first_min, last_max;
-	int first_x = -1, last_x = -1;
-	static int prev_ntiles_x = -1;
-
-	char *src, *dst, *s_src, *s_dst, *m_src, *m_dst;
-	char *h_src, *h_dst;
-	if (unixpw_in_progress) return 0;
-
-	if (ntiles_x != prev_ntiles_x && first_line != NULL) {
-		free(first_line);	first_line = NULL;
-		free(last_line);	last_line = NULL;
-		free(left_diff);	left_diff = NULL;
-		free(right_diff);	right_diff = NULL;
-	}
-
-	if (first_line == NULL) {
-		/* allocate arrays first time in. */
-		int n = ntiles_x + 1;
-		rfbLog("copy_tiles: allocating first_line at size %d\n", n);
-		first_line = (int *) malloc((size_t) (n * sizeof(int)));
-		last_line  = (int *) malloc((size_t) (n * sizeof(int)));
-		left_diff  = (unsigned short *)
-			malloc((size_t) (n * sizeof(unsigned short)));
-		right_diff = (unsigned short *)
-			malloc((size_t) (n * sizeof(unsigned short)));
-	}
-	prev_ntiles_x = ntiles_x;
-
-	x = tx * tile_x;
-	y = ty * tile_y;
-
-	size_x = dpy_x - x;
-	if ( size_x > tile_x * nt ) {
-		size_x = tile_x * nt;
-		width1 = tile_x;
-		width2 = tile_x;
-	} else {
-		/* short tile */
-		width1 = tile_x;	/* internal tile */
-		width2 = size_x - (nt - 1) * tile_x;	/* right hand tile */
-	}
-
-	size_y = dpy_y - y;
-	if ( size_y > tile_y ) {
-		size_y = tile_y;
-	}
-
-	n = tx + ty * ntiles_x;		/* number of the first tile */
-
-	if (blackouts && tile_blackout[n].cover == 2) {
-		/*
-		 * If there are blackouts and this tile is completely covered
-		 * no need to poll screen or do anything else..
-		 * n.b. we are in single copy_tile mode: nt=1
-		 */
-		tile_has_diff[n] = 0;
-		return(0);
-	}
-
-	X_LOCK;
-	XRANDR_SET_TRAP_RET(-1, "copy_tile-set");
-	/* read in the whole tile run at once: */
-	copy_image(tile_row[nt], x, y, size_x, size_y);
-	XRANDR_CHK_TRAP_RET(-1, "copy_tile-chk");
-
-
-	X_UNLOCK;
-
-	if (blackouts && tile_blackout[n].cover == 1) {
-		/*
-		 * If there are blackouts and this tile is partially covered
-		 * we should re-black-out the portion.
-		 * n.b. we are in single copy_tile mode: nt=1
-		 */
-		int x1, x2, y1, y2, b;
-		int w, s, fill = 0;
-
-		for (b=0; b < tile_blackout[n].count; b++) {
-			char *b_dst = tile_row[nt]->data;
-			
-			x1 = tile_blackout[n].bo[b].x1 - x;
-			y1 = tile_blackout[n].bo[b].y1 - y;
-			x2 = tile_blackout[n].bo[b].x2 - x;
-			y2 = tile_blackout[n].bo[b].y2 - y;
-
-			w = (x2 - x1) * pixelsize;
-			s = x1 * pixelsize;
-
-			for (line = 0; line < size_y; line++) {
-				if (y1 <= line && line < y2) {
-					memset(b_dst + s, fill, (size_t) w);
-				}
-				b_dst += tile_row[nt]->bytes_per_line;
-			}
-		}
-	}
-
-	src = tile_row[nt]->data;
-	dst = main_fb + y * main_bytes_per_line + x * pixelsize;
-
-	s_src = src;
-	s_dst = dst;
-
-	for (t=1; t <= nt; t++) {
-		first_line[t] = -1;
-	}
-
-	/* find the first line with difference: */
-	w1 = width1 * pixelsize;
-	w2 = width2 * pixelsize;
-
-	/* foreach line: */
-	for (line = 0; line < size_y; line++) {
-		/* foreach horizontal tile: */
-		for (t=1; t <= nt; t++) {
-			if (first_line[t] != -1) {
-				continue;
-			}
-
-			off = (t-1) * w1;
-			if (t == nt) {
-				len = w2;	/* possible short tile */
-			} else {
-				len = w1;
-			}
-			
-			if (memcmp(s_dst + off, s_src + off, len)) {
-				first_line[t] = line;
-			}
-		}
-		s_src += tile_row[nt]->bytes_per_line;
-		s_dst += main_bytes_per_line;
-	}
-
-	/* see if there were any differences for any tile: */
-	first_min = -1;
-	for (t=1; t <= nt; t++) {
-		tile_tried[n+(t-1)] = 1;
-		if (first_line[t] != -1) {
-			if (first_min == -1 || first_line[t] < first_min) {
-				first_min = first_line[t];
-			}
-		}
-	}
-	if (first_min == -1) {
-		/* no tile has a difference, note this and get out: */
-		for (t=1; t <= nt; t++) {
-			tile_has_diff[n+(t-1)] = 0;
-		}
-		return(0);
-	} else {
-		/*
-		 * at least one tile has a difference.  make sure info
-		 * is recorded (e.g. sometimes we guess tiles and they
-		 * came in with tile_has_diff 0)
-		 */
-		for (t=1; t <= nt; t++) {
-			if (first_line[t] == -1) {
-				tile_has_diff[n+(t-1)] = 0;
-			} else {
-				tile_has_diff[n+(t-1)] = 1;
-			}
-		}
-	}
-
-	m_src = src + (tile_row[nt]->bytes_per_line * size_y);
-	m_dst = dst + (main_bytes_per_line * size_y);
-
-	for (t=1; t <= nt; t++) {
-		last_line[t] = first_line[t];
-	}
-
-	/* find the last line with difference: */
-	w1 = width1 * pixelsize;
-	w2 = width2 * pixelsize;
-
-	/* foreach line: */
-	for (line = size_y - 1; line > first_min; line--) {
-
-		m_src -= tile_row[nt]->bytes_per_line;
-		m_dst -= main_bytes_per_line;
-
-		/* foreach tile: */
-		for (t=1; t <= nt; t++) {
-			if (first_line[t] == -1
-			    || last_line[t] != first_line[t]) {
-				/* tile has no changes or already done */
-				continue;
-			}
-
-			off = (t-1) * w1;
-			if (t == nt) {
-				len = w2;	/* possible short tile */
-			} else {
-				len = w1;
-			}
-			if (memcmp(m_dst + off, m_src + off, len)) {
-				last_line[t] = line;
-			}
-		}
-	}
-	
-	/*
-	 * determine the farthest down last changed line
-	 * will be used below to limit our memcpy() to the framebuffer.
-	 */
-	last_max = -1;
-	for (t=1; t <= nt; t++) {
-		if (first_line[t] == -1) {
-			continue;
-		}
-		if (last_max == -1 || last_line[t] > last_max) {
-			last_max = last_line[t];
-		}
-	}
-
-	/* look for differences on left and right hand edges: */
-	for (t=1; t <= nt; t++) {
-		left_diff[t] = 0;
-		right_diff[t] = 0;
-	}
-
-	h_src = src;
-	h_dst = dst;
-
-	w1 = width1 * pixelsize;
-	w2 = width2 * pixelsize;
-
-	dx1 = (width1 - tile_fuzz) * pixelsize;
-	dx2 = (width2 - tile_fuzz) * pixelsize;
-	dw = tile_fuzz * pixelsize; 
-
-	/* foreach line: */
-	for (line = 0; line < size_y; line++) {
-		/* foreach tile: */
-		for (t=1; t <= nt; t++) {
-			if (first_line[t] == -1) {
-				/* tile has no changes at all */
-				continue;
-			}
-
-			off = (t-1) * w1;
-			if (t == nt) {
-				dx = dx2;	/* possible short tile */
-				if (dx <= 0) {
-					break;
-				}
-			} else {
-				dx = dx1;
-			}
-
-			if (! left_diff[t] && memcmp(h_dst + off,
-			    h_src + off, dw)) {
-				left_diff[t] = 1;
-			}
-			if (! right_diff[t] && memcmp(h_dst + off + dx,
-			    h_src + off + dx, dw) ) {
-				right_diff[t] = 1;
-			}
-		}
-		h_src += tile_row[nt]->bytes_per_line;
-		h_dst += main_bytes_per_line;
-	}
-
-	/* now finally copy the difference to the rfb framebuffer: */
-	s_src = src + tile_row[nt]->bytes_per_line * first_min;
-	s_dst = dst + main_bytes_per_line * first_min;
-
-	for (line = first_min; line <= last_max; line++) {
-		/* for I/O speed we do not do this tile by tile */
-		memcpy(s_dst, s_src, size_x * pixelsize);
-		if (nt == 1) {
-			/*
-			 * optimization for tall skinny lines, e.g. wm
-			 * frame. try to find first_x and last_x to limit
-			 * the size of the hint.  could help for a slow
-			 * link.  Unfortunately we spent a lot of time
-			 * reading in the many tiles.
-			 *
-			 * BTW, we like to think the above memcpy leaves
-			 * the data we use below in the cache... (but
-			 * it could be two 128 byte segments at 32bpp)
-			 * so this inner loop is not as bad as it seems.
-			 */
-			int k, kx;
-			kx = pixelsize;
-			for (k=0; k<size_x; k++) {
-				if (memcmp(s_dst + k*kx, s_src + k*kx, kx))  {
-					if (first_x == -1 || k < first_x) {
-						first_x = k;
-					}
-					if (last_x == -1 || k > last_x) {
-						last_x = k;
-					}
-				}
-			}
-		}
-		s_src += tile_row[nt]->bytes_per_line;
-		s_dst += main_bytes_per_line;
-	}
-
-	/* record all the info in the region array for this tile: */
-	for (t=1; t <= nt; t++) {
-		int s = t - 1;
-
-		if (first_line[t] == -1) {
-			/* tile unchanged */
-			continue;
-		}
-		tile_region[n+s].first_line = first_line[t];
-		tile_region[n+s].last_line  = last_line[t];
-
-		tile_region[n+s].first_x = first_x;
-		tile_region[n+s].last_x  = last_x;
-
-		tile_region[n+s].top_diff = 0;
-		tile_region[n+s].bot_diff = 0;
-		if ( first_line[t] < tile_fuzz ) {
-			tile_region[n+s].top_diff = 1;
-		}
-		if ( last_line[t] > (size_y - 1) - tile_fuzz ) {
-			tile_region[n+s].bot_diff = 1;
-		}
-
-		tile_region[n+s].left_diff  = left_diff[t];
-		tile_region[n+s].right_diff = right_diff[t];
-
-		tile_copied[n+s] = 1;
-	}
-
-	return(1);
-}
-
-/*
- * The copy_tile() call in the loop below copies the changed tile into
- * the rfb framebuffer.  Note that copy_tile() sets the tile_region
- * struct to have info about the y-range of the changed region and also
- * whether the tile edges contain diffs (within distance tile_fuzz).
- *
- * We use this tile_region info to try to guess if the downward and right
- * tiles will have diffs.  These tiles will be checked later in the loop
- * (since y+1 > y and x+1 > x).
- *
- * See copy_tiles_backward_pass() for analogous checking upward and
- * left tiles.
- */
-static int copy_all_tiles(void) {
-	int x, y, n, m;
-	int diffs = 0, ct;
-
-	if (unixpw_in_progress) return 0;
-
-	for (y=0; y < ntiles_y; y++) {
-		for (x=0; x < ntiles_x; x++) {
-			n = x + y * ntiles_x;
-
-			if (tile_has_diff[n]) {
-				ct = copy_tiles(x, y, 1);
-				if (ct < 0) return ct;	/* fatal */
-			}
-			if (! tile_has_diff[n]) {
-				/*
-				 * n.b. copy_tiles() may have detected
-				 * no change and reset tile_has_diff to 0.
-				 */
-				continue;
-			}
-			diffs++;
-
-			/* neighboring tile downward: */
-			if ( (y+1) < ntiles_y && tile_region[n].bot_diff) {
-				m = x + (y+1) * ntiles_x;
-				if (! tile_has_diff[m]) {
-					tile_has_diff[m] = 2;
-				}
-			}
-			/* neighboring tile to right: */
-			if ( (x+1) < ntiles_x && tile_region[n].right_diff) {
-				m = (x+1) + y * ntiles_x;
-				if (! tile_has_diff[m]) {
-					tile_has_diff[m] = 2;
-				}
-			}
-		}
-	}
-	return diffs;
-}
-
-/*
- * Routine analogous to copy_all_tiles() above, but for horizontal runs
- * of adjacent changed tiles.
- */
-static int copy_all_tile_runs(void) {
-	int x, y, n, m, i;
-	int diffs = 0, ct;
-	int in_run = 0, run = 0;
-	int ntave = 0, ntcnt = 0;
-
-	if (unixpw_in_progress) return 0;
-
-	for (y=0; y < ntiles_y; y++) {
-		for (x=0; x < ntiles_x + 1; x++) {
-			n = x + y * ntiles_x;
-
-			if (x != ntiles_x && tile_has_diff[n]) {
-				in_run = 1;
-				run++;
-			} else {
-				if (! in_run) {
-					in_run = 0;
-					run = 0;
-					continue;
-				}
-				ct = copy_tiles(x - run, y, run);
-				if (ct < 0) return ct;	/* fatal */
-
-				ntcnt++;
-				ntave += run;
-				diffs += run;
-
-				/* neighboring tile downward: */
-				for (i=1; i <= run; i++) {
-					if ((y+1) < ntiles_y
-					    && tile_region[n-i].bot_diff) {
-						m = (x-i) + (y+1) * ntiles_x;
-						if (! tile_has_diff[m]) {
-							tile_has_diff[m] = 2;
-						}
-					}
-				}
-
-				/* neighboring tile to right: */
-				if (((x-1)+1) < ntiles_x
-				    && tile_region[n-1].right_diff) {
-					m = ((x-1)+1) + y * ntiles_x;
-					if (! tile_has_diff[m]) {
-						tile_has_diff[m] = 2;
-					}
-					
-					/* note that this starts a new run */
-					in_run = 1;
-					run = 1;
-				} else {
-					in_run = 0;
-					run = 0;
-				}
-			}
-		}
-		/*
-		 * Could some activity go here, to emulate threaded
-		 * behavior by servicing some libvncserver tasks?
-		 */
-	}
-	return diffs;
-}
-
-/*
- * Here starts a bunch of heuristics to guess/detect changed tiles.
- * They are:
- *   copy_tiles_backward_pass, fill_tile_gaps/gap_try, grow_islands/island_try
- */
-
-/*
- * Try to predict whether the upward and/or leftward tile has been modified.
- * copy_all_tiles() has already done downward and rightward tiles.
- */
-static int copy_tiles_backward_pass(void) {
-	int x, y, n, m;
-	int diffs = 0, ct;
-
-	if (unixpw_in_progress) return 0;
-
-	for (y = ntiles_y - 1; y >= 0; y--) {
-	    for (x = ntiles_x - 1; x >= 0; x--) {
-		n = x + y * ntiles_x;		/* number of this tile */
-
-		if (! tile_has_diff[n]) {
-			continue;
-		}
-
-		m = x + (y-1) * ntiles_x;	/* neighboring tile upward */
-
-		if (y >= 1 && ! tile_has_diff[m] && tile_region[n].top_diff) {
-			if (! tile_tried[m]) {
-				tile_has_diff[m] = 2;
-				ct = copy_tiles(x, y-1, 1);
-				if (ct < 0) return ct;	/* fatal */
-			}
-		}
-
-		m = (x-1) + y * ntiles_x;	/* neighboring tile to left */
-
-		if (x >= 1 && ! tile_has_diff[m] && tile_region[n].left_diff) {
-			if (! tile_tried[m]) {
-				tile_has_diff[m] = 2;
-				ct = copy_tiles(x-1, y, 1);
-				if (ct < 0) return ct;	/* fatal */
-			}
-		}
-	    }
-	}
-	for (n=0; n < ntiles; n++) {
-		if (tile_has_diff[n]) {
-			diffs++;
-		}
-	}
-	return diffs;
-}
-
-static int copy_tiles_additional_pass(void) {
-	int x, y, n;
-	int diffs = 0, ct;
-
-	if (unixpw_in_progress) return 0;
-
-	for (y=0; y < ntiles_y; y++) {
-		for (x=0; x < ntiles_x; x++) {
-			n = x + y * ntiles_x;		/* number of this tile */
-
-			if (! tile_has_diff[n]) {
-				continue;
-			}
-			if (tile_copied[n]) {
-				continue;
-			}
-
-			ct = copy_tiles(x, y, 1);
-			if (ct < 0) return ct;	/* fatal */
-		}
-	}
-	for (n=0; n < ntiles; n++) {
-		if (tile_has_diff[n]) {
-			diffs++;
-		}
-	}
-	return diffs;
-}
-
-static int gap_try(int x, int y, int *run, int *saw, int along_x) {
-	int n, m, i, xt, yt, ct;
-
-	n = x + y * ntiles_x;
-
-	if (! tile_has_diff[n]) {
-		if (*saw) {
-			(*run)++;	/* extend the gap run. */
-		}
-		return 0;
-	}
-	if (! *saw || *run == 0 || *run > gaps_fill) {
-		*run = 0;		/* unacceptable run. */
-		*saw = 1;
-		return 0;
-	}
-
-	for (i=1; i <= *run; i++) {	/* iterate thru the run. */
-		if (along_x) {
-			xt = x - i;
-			yt = y;
-		} else {
-			xt = x;
-			yt = y - i;
-		}
-
-		m = xt + yt * ntiles_x;
-		if (tile_tried[m]) {	/* do not repeat tiles */
-			continue;
-		}
-
-		ct = copy_tiles(xt, yt, 1);
-		if (ct < 0) return ct;	/* fatal */
-	}
-	*run = 0;
-	*saw = 1;
-	return 1;
-}
-
-/*
- * Look for small gaps of unchanged tiles that may actually contain changes.
- * E.g. when paging up and down in a web broswer or terminal there can
- * be a distracting delayed filling in of such gaps.  gaps_fill is the
- * tweak parameter that sets the width of the gaps that are checked.
- *
- * BTW, grow_islands() is actually pretty successful at doing this too...
- */
-static int fill_tile_gaps(void) {
-	int x, y, run, saw;
-	int n, diffs = 0, ct;
-
-	/* horizontal: */
-	for (y=0; y < ntiles_y; y++) {
-		run = 0;
-		saw = 0;
-		for (x=0; x < ntiles_x; x++) {
-			ct = gap_try(x, y, &run, &saw, 1);
-			if (ct < 0) return ct;	/* fatal */
-		}
-	}
-
-	/* vertical: */
-	for (x=0; x < ntiles_x; x++) {
-		run = 0;
-		saw = 0;
-		for (y=0; y < ntiles_y; y++) {
-			ct = gap_try(x, y, &run, &saw, 0);
-			if (ct < 0) return ct;	/* fatal */
-		}
-	}
-
-	for (n=0; n < ntiles; n++) {
-		if (tile_has_diff[n]) {
-			diffs++;
-		}
-	}
-	return diffs;
-}
-
-static int island_try(int x, int y, int u, int v, int *run) {
-	int n, m, ct;
-
-	n = x + y * ntiles_x;
-	m = u + v * ntiles_x;
-
-	if (tile_has_diff[n]) {
-		(*run)++;
-	} else {
-		*run = 0;
-	}
-
-	if (tile_has_diff[n] && ! tile_has_diff[m]) {
-		/* found a discontinuity */
-
-		if (tile_tried[m]) {
-			return 0;
-		} else if (*run < grow_fill) {
-			return 0;
-		}
-
-		ct = copy_tiles(u, v, 1);
-		if (ct < 0) return ct;	/* fatal */
-	}
-	return 1;
-}
-
-/*
- * Scan looking for discontinuities in tile_has_diff[].  Try to extend
- * the boundary of the discontinuity (i.e. make the island larger).
- * Vertical scans are skipped since they do not seem to yield much...
- */
-static int grow_islands(void) {
-	int x, y, n, run;
-	int diffs = 0, ct;
-
-	/*
-	 * n.b. the way we scan here should keep an extension going,
-	 * and so also fill in gaps effectively...
-	 */
-
-	/* left to right: */
-	for (y=0; y < ntiles_y; y++) {
-		run = 0;
-		for (x=0; x <= ntiles_x - 2; x++) {
-			ct = island_try(x, y, x+1, y, &run);
-			if (ct < 0) return ct;	/* fatal */
-		}
-	}
-	/* right to left: */
-	for (y=0; y < ntiles_y; y++) {
-		run = 0;
-		for (x = ntiles_x - 1; x >= 1; x--) {
-			ct = island_try(x, y, x-1, y, &run);
-			if (ct < 0) return ct;	/* fatal */
-		}
-	}
-	for (n=0; n < ntiles; n++) {
-		if (tile_has_diff[n]) {
-			diffs++;
-		}
-	}
-	return diffs;
-}
-
-/*
- * Fill the framebuffer with zeros for each blackout region
- */
-static void blackout_regions(void) {
-	int i;
-	for (i=0; i < blackouts; i++) {
-		zero_fb(blackr[i].x1, blackr[i].y1, blackr[i].x2, blackr[i].y2);
-	}
-}
-
-/*
- * copy the whole X screen to the rfb framebuffer.  For a large enough
- * number of changed tiles, this is faster than tiles scheme at retrieving
- * the info from the X server.  Bandwidth to client and compression time
- * are other issues...  use -fs 1.0 to disable.
- */
-int copy_screen(void) {
-	char *fbp;
-	int i, y, block_size;
-
-	if (! fs_factor) {
-		return 0;
-	}
-	if (debug_tiles) fprintf(stderr, "copy_screen\n");
-
-	if (unixpw_in_progress) return 0;
-
-
-	if (! main_fb) {
-		return 0;
-	}
-
-	block_size = ((dpy_y/fs_factor) * main_bytes_per_line);
-
-	fbp = main_fb;
-	y = 0;
-
-	X_LOCK;
-
-	/* screen may be too big for 1 shm area, so broken into fs_factor */
-	for (i=0; i < fs_factor; i++) {
-		XRANDR_SET_TRAP_RET(-1, "copy_screen-set");
-		copy_image(fullscreen, 0, y, 0, 0);
-		XRANDR_CHK_TRAP_RET(-1, "copy_screen-chk");
-
-		memcpy(fbp, fullscreen->data, (size_t) block_size);
-
-		y += dpy_y / fs_factor;
-		fbp += block_size;
-	}
-
-	X_UNLOCK;
-
-	if (blackouts) {
-		blackout_regions();
-	}
-
-	mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
-	return 0;
-}
-
-#include <rfb/default8x16.h>
-
-/*
- * Color values from the vcsadump program.
- * void dumpcss(FILE *fp, char *attribs_used)
- * char *colormap[] = {
- *    "#000000", "#0000AA", "#00AA00", "#00AAAA", "#AA0000", "#AA00AA", "#AA5500", "#AAAAAA",
- *    "#555555", "#5555AA", "#55FF55", "#55FFFF", "#FF5555", "#FF55FF", "#FFFF00", "#FFFFFF" };
- */
-
-static unsigned char console_cmap[16*3]={
-/*  0 */	0x00, 0x00, 0x00,
-/*  1 */	0x00, 0x00, 0xAA,
-/*  2 */	0x00, 0xAA, 0x00,
-/*  3 */	0x00, 0xAA, 0xAA,
-/*  4 */	0xAA, 0x00, 0x00,
-/*  5 */	0xAA, 0x00, 0xAA,
-/*  6 */	0xAA, 0x55, 0x00,
-/*  7 */	0xAA, 0xAA, 0xAA,
-/*  8 */	0x55, 0x55, 0x55,
-/*  9 */	0x55, 0x55, 0xAA,
-/* 10 */	0x55, 0xFF, 0x55,
-/* 11 */	0x55, 0xFF, 0xFF,
-/* 12 */	0xFF, 0x55, 0x55,
-/* 13 */	0xFF, 0x55, 0xFF,
-/* 14 */	0xFF, 0xFF, 0x00,
-/* 15 */	0xFF, 0xFF, 0xFF
-};
-  
-static void snap_vcsa_rawfb(void) {
-	int n;
-	char *dst;
-	char buf[32];
-	int i, len, del;
-	unsigned char rows, cols, xpos, ypos;
-	static int prev_rows = -1, prev_cols = -1;
-	static unsigned char prev_xpos = -1, prev_ypos = -1;
-	static char *vcsabuf  = NULL;
-	static char *vcsabuf0 = NULL;
-	static unsigned int color_tab[16];
-	static int Cw = 8, Ch = 16;
-	static int db = -1, first = 1;
-	int created = 0;
-	rfbScreenInfo s;
-	rfbScreenInfoPtr fake_screen = &s;
-	int Bpp = raw_fb_native_bpp / 8;
-
-	if (db < 0) {
-		if (getenv("X11VNC_DEBUG_VCSA")) {
-			db = atoi(getenv("X11VNC_DEBUG_VCSA"));
-		} else {
-			db = 0;
-		}
-	}
-
-	if (first) {
-		unsigned int rm = raw_fb_native_red_mask;
-		unsigned int gm = raw_fb_native_green_mask;
-		unsigned int bm = raw_fb_native_blue_mask;
-		unsigned int rs = raw_fb_native_red_shift;
-		unsigned int gs = raw_fb_native_green_shift;
-		unsigned int bs = raw_fb_native_blue_shift;
-		unsigned int rx = raw_fb_native_red_max;
-		unsigned int gx = raw_fb_native_green_max;
-		unsigned int bx = raw_fb_native_blue_max;
-
-		for (i=0; i < 16; i++) {
-			int r = console_cmap[3*i+0];
-			int g = console_cmap[3*i+1];
-			int b = console_cmap[3*i+2];
-			r = rx * r / 255;
-			g = gx * g / 255;
-			b = bx * b / 255;
-			color_tab[i] = (r << rs) | (g << gs) | (b << bs);
-			if (db) fprintf(stderr, "cmap[%02d] 0x%08x  %04d %04d %04d\n", i, color_tab[i], r, g, b); 
-			if (i != 0 && getenv("RAWFB_VCSA_BW")) {
-				color_tab[i] = rm | gm | bm;
-			}
-		}
-	}
-	first = 0;
-
-	lseek(raw_fb_fd, 0, SEEK_SET);
-	len = 4;
-	del = 0;
-	memset(buf, 0, sizeof(buf));
-	while (len > 0) {
-		n = read(raw_fb_fd, buf + del, len);
-		if (n > 0) {
-			del += n;
-			len -= n;
-		} else if (n == 0) {
-			break;
-		} else if (errno != EINTR && errno != EAGAIN) {
-			break;
-		}
-	}
-
-	rows = (unsigned char) buf[0];
-	cols = (unsigned char) buf[1];
-	xpos = (unsigned char) buf[2];
-	ypos = (unsigned char) buf[3];
-
-	if (db) fprintf(stderr, "rows=%d cols=%d xpos=%d ypos=%d Bpp=%d\n", rows, cols, xpos, ypos, Bpp);
-	if (rows == 0 || cols == 0) {
-		usleep(100 * 1000);
-		return;
-	}
-
-	if (vcsabuf == NULL || prev_rows != rows || prev_cols != cols) {
-		if (vcsabuf) {
-			free(vcsabuf);
-			free(vcsabuf0);
-		}
-		vcsabuf  = (char *) calloc(2 * rows * cols, 1);
-		vcsabuf0 = (char *) calloc(2 * rows * cols, 1);
-		created = 1;
-
-		if (prev_rows != -1 && prev_cols != -1) {
-			do_new_fb(1);
-		}
-
-		prev_rows = rows;
-		prev_cols = cols;
-	}
-
-	if (!rfbEndianTest) {
-		unsigned char tc = rows;
-		rows = cols;
-		cols = tc;
-
-		tc = xpos;
-		xpos = ypos;
-		ypos = tc;
-	}
-
-	len = 2 * rows * cols;
-	del = 0;
-	memset(vcsabuf, 0, len);
-	while (len > 0) {
-		n = read(raw_fb_fd, vcsabuf + del, len);
-		if (n > 0) {
-			del += n;
-			len -= n;
-		} else if (n == 0) {
-			break;
-		} else if (errno != EINTR && errno != EAGAIN) {
-			break;
-		}
-	}
-
-	fake_screen->frameBuffer = snap->data;
-	fake_screen->paddedWidthInBytes = snap->bytes_per_line;
-	fake_screen->serverFormat.bitsPerPixel = raw_fb_native_bpp;
-	fake_screen->width = snap->width;
-	fake_screen->height = snap->height;
-
-	for (i=0; i < rows * cols; i++) {
-		int ix, iy, x, y, w, h;
-		unsigned char chr = 0;
-		unsigned char attr;
-		unsigned int fore, back;
-		unsigned short *usp;
-		unsigned int *uip;
-		chr  = (unsigned char) vcsabuf[2*i];
-		attr = vcsabuf[2*i+1];
-
-		iy = i / cols;
-		ix = i - iy * cols;
-
-		if (ix == prev_xpos && iy == prev_ypos) {
-			;
-		} else if (ix == xpos && iy == ypos) {
-			;
-		} else if (!created && chr == vcsabuf0[2*i] && attr == vcsabuf0[2*i+1]) {
-			continue;
-		}
-
-		if (!rfbEndianTest) {
-			unsigned char tc = chr;
-			chr = attr;
-			attr = tc;
-		}
-
-		y = iy * Ch;
-		x = ix * Cw;
-		dst = snap->data + y * snap->bytes_per_line + x * Bpp;
-
-		fore = color_tab[attr & 0xf];
-		back = color_tab[(attr >> 4) & 0x7];
-
-		if (ix == xpos && iy == ypos) {
-			unsigned int ti = fore;
-			fore = back;
-			back = ti;
-		}
-
-		for (h = 0; h < Ch; h++) {
-			if (Bpp == 1) {
-				memset(dst, back, Cw);
-			} else if (Bpp == 2) {
-				for (w = 0; w < Cw; w++) {
-					usp = (unsigned short *) (dst + w*Bpp); 
-					*usp = (unsigned short) back;
-				}
-			} else if (Bpp == 4) {
-				for (w = 0; w < Cw; w++) {
-					uip = (unsigned int *) (dst + w*Bpp); 
-					*uip = (unsigned int) back;
-				}
-			}
-			dst += snap->bytes_per_line;
-		}
-		rfbDrawChar(fake_screen, &default8x16Font, x, y + Ch, chr, fore);
-	}
-	memcpy(vcsabuf0, vcsabuf, 2 * rows * cols); 
-	prev_xpos = xpos;
-	prev_ypos = ypos;
-}
-
-static void snap_all_rawfb(void) {
-	int pixelsize = bpp/8;
-	int n, sz;
-	char *dst;
-	static char *unclipped_dst = NULL;
-	static int unclipped_len = 0;
-
-	dst = snap->data;
-
-	if (xform24to32 && bpp == 32) {
-		pixelsize = 3;
-	}
-	sz = dpy_y * snap->bytes_per_line;
-
-	if (wdpy_x > dpy_x || wdpy_y > dpy_y) {
-		sz = wdpy_x * wdpy_y * pixelsize;
-		if (sz > unclipped_len || unclipped_dst == NULL) {
-			if (unclipped_dst) {
-				free(unclipped_dst);
-			}
-			unclipped_dst = (char *) malloc(sz+4);
-			unclipped_len = sz;
-		}
-		dst = unclipped_dst;
-	}
-		
-	if (! raw_fb_seek) {
-		memcpy(dst, raw_fb_addr + raw_fb_offset, sz);
-
-	} else {
-		int len = sz, del = 0;
-		off_t off = (off_t) raw_fb_offset;
-
-		lseek(raw_fb_fd, off, SEEK_SET);
-		while (len > 0) {
-			n = read(raw_fb_fd, dst + del, len);
-			if (n > 0) {
-				del += n;
-				len -= n;
-			} else if (n == 0) {
-				break;
-			} else if (errno != EINTR && errno != EAGAIN) {
-				break;
-			}
-		}
-	}
-
-	if (dst == unclipped_dst) {
-		char *src;
-		int h;
-		int x = off_x + coff_x;
-		int y = off_y + coff_y;
-
-		src = unclipped_dst + y * wdpy_x * pixelsize +
-		    x * pixelsize;
-		dst = snap->data;
-
-		for (h = 0; h < dpy_y; h++) {
-			memcpy(dst, src, dpy_x * pixelsize);
-			src += wdpy_x * pixelsize;
-			dst += snap->bytes_per_line;
-		}
-	}
-}
-
-int copy_snap(void) {
-	int db = 1;
-	char *fbp;
-	int i, y, block_size;
-	double dt;
-	static int first = 1, snapcnt = 0;
-
-	if (raw_fb_str) {
-		int read_all_at_once = 1;
-		double start = dnow();
-		if (rawfb_reset < 0) {
-			if (getenv("SNAPFB_RAWFB_RESET")) {
-				rawfb_reset = 1;
-			} else {
-				rawfb_reset = 0;
-			}
-		}
-		if (snap_fb == NULL || snap == NULL) {
-			rfbLog("copy_snap: rawfb mode and null snap fb\n"); 
-			clean_up_exit(1);
-		}
-		if (rawfb_reset) {
-			initialize_raw_fb(1);
-		}
-		if (raw_fb_bytes_per_line != snap->bytes_per_line) {
-			read_all_at_once = 0;
-		}
-		if (raw_fb_full_str && strstr(raw_fb_full_str, "/dev/vcsa")) {
-			snap_vcsa_rawfb();
-		} else if (read_all_at_once) {
-			snap_all_rawfb();
-		} else {
-			/* this goes line by line, XXX not working for video */
-			copy_raw_fb(snap, 0, 0, dpy_x, dpy_y);
-		}
-if (db && snapcnt++ < 5) rfbLog("rawfb copy_snap took: %.5f secs\n", dnow() - start);
-
-		return 0;
-	}
-	
-	if (! fs_factor) {
-		return 0;
-	}
-
-
-	if (! snap_fb || ! snap || ! snaprect) {
-		return 0;
-	}
-	block_size = ((dpy_y/fs_factor) * snap->bytes_per_line);
-
-	fbp = snap_fb;
-	y = 0;
-
-
-	dtime0(&dt);
-	X_LOCK;
-
-	/* screen may be too big for 1 shm area, so broken into fs_factor */
-	for (i=0; i < fs_factor; i++) {
-		XRANDR_SET_TRAP_RET(-1, "copy_snap-set");
-		copy_image(snaprect, 0, y, 0, 0);
-		XRANDR_CHK_TRAP_RET(-1, "copy_snap-chk");
-
-		memcpy(fbp, snaprect->data, (size_t) block_size);
-
-		y += dpy_y / fs_factor;
-		fbp += block_size;
-	}
-
-	X_UNLOCK;
-
-	dt = dtime(&dt);
-	if (first) {
-		rfbLog("copy_snap: time for -snapfb snapshot: %.3f sec\n", dt);
-		first = 0;
-	}
-
-	return 0;
-}
-
-
-/* 
- * debugging: print out a picture of the tiles.
- */
-static void print_tiles(void) {
-	/* hack for viewing tile diffs on the screen. */
-	static char *prev = NULL;
-	int n, x, y, ms = 1500;
-
-	ms = 1;
-
-	if (! prev) {
-		prev = (char *) malloc((size_t) ntiles);
-		for (n=0; n < ntiles; n++) {
-			prev[n] = 0;
-		}
-	}
-	fprintf(stderr, "   ");
-	for (x=0; x < ntiles_x; x++) {
-		fprintf(stderr, "%1d", x % 10);
-	}
-	fprintf(stderr, "\n");
-	n = 0;
-	for (y=0; y < ntiles_y; y++) {
-		fprintf(stderr, "%2d ", y);
-		for (x=0; x < ntiles_x; x++) {
-			if (tile_has_diff[n]) {
-				fprintf(stderr, "X");
-			} else if (prev[n]) {
-				fprintf(stderr, "o");
-			} else {
-				fprintf(stderr, ".");
-			}
-			n++;
-		}
-		fprintf(stderr, "\n");
-	}
-	for (n=0; n < ntiles; n++) {
-		prev[n] = tile_has_diff[n];
-	}
-	usleep(ms * 1000);
-}
-
-/*
- * Utilities for managing the "naps" to cut down on amount of polling.
- */
-static void nap_set(int tile_cnt) {
-	int nap_in = nap_ok;
-	time_t now = time(NULL);
-
-	if (scan_count == 0) {
-		/* roll up check for all NSCAN scans */
-		nap_ok = 0;
-		if (naptile && nap_diff_count < 2 * NSCAN * naptile) {
-			/* "2" is a fudge to permit a bit of bg drawing */
-			nap_ok = 1;
-		}
-		nap_diff_count = 0;
-	}
-	if (nap_ok && ! nap_in && use_xdamage) {
-		if (XD_skip > 0.8 * XD_tot) 	{
-			/* X DAMAGE is keeping load low, so skip nap */
-			nap_ok = 0;
-		}
-	}
-	if (! nap_ok && client_count) {
-		if(now > last_fb_bytes_sent + no_fbu_blank) {
-			if (debug_tiles > 1) {
-				fprintf(stderr, "nap_set: nap_ok=1: now: %d last: %d\n",
-				    (int) now, (int) last_fb_bytes_sent);
-			}
-			nap_ok = 1;
-		}
-	}
-
-	if (show_cursor) {
-		/* kludge for the up to 4 tiles the mouse patch could occupy */
-		if ( tile_cnt > 4) {
-			last_event = now;
-		}
-	} else if (tile_cnt != 0) {
-		last_event = now;
-	}
-}
-
-/*
- * split up a long nap to improve the wakeup time
- */
-void nap_sleep(int ms, int split) {
-	int i, input = got_user_input;
-	int gd = got_local_pointer_input;
-
-	for (i=0; i<split; i++) {
-		usleep(ms * 1000 / split);
-		if (! use_threads && i != split - 1) {
-			rfbPE(-1);
-		}
-		if (input != got_user_input) {
-			break;
-		}
-		if (gd != got_local_pointer_input) {
-			break;
-		}
-	}
-}
-
-static char *get_load(void) {
-	static char tmp[64];
-	static int count = 0;
-
-	if (count++ % 5 == 0) {
-		struct stat sb;
-		memset(tmp, 0, sizeof(tmp));
-		if (stat("/proc/loadavg", &sb) == 0) {
-			int d = open("/proc/loadavg", O_RDONLY);
-			if (d >= 0) {
-				read(d, tmp, 60);
-				close(d);
-			}
-		}
-		if (tmp[0] == '\0') {
-			strcat(tmp, "unknown");
-		}
-	}
-	return tmp;
-}
-
-/*
- * see if we should take a nap of some sort between polls
- */
-static void nap_check(int tile_cnt) {
-	time_t now;
-
-	nap_diff_count += tile_cnt;
-
-	if (! take_naps) {
-		return;
-	}
-
-	now = time(NULL);
-
-	if (screen_blank > 0) {
-		int dt_ev, dt_fbu;
-		static int ms = 0;
-		if (ms == 0) {
-			ms = 2000;
-			if (getenv("X11VNC_SB_FACTOR")) {
-				ms = ms * atof(getenv("X11VNC_SB_FACTOR"));
-			}
-			if (ms <= 0) {
-				ms = 2000;
-			}
-		}
-
-		/* if no activity, pause here for a second or so. */
-		dt_ev  = (int) (now - last_event);
-		dt_fbu = (int) (now - last_fb_bytes_sent);
-		if (dt_fbu > screen_blank) {
-			/* sleep longer for no fb requests */
-			if (debug_tiles > 1) {
-				fprintf(stderr, "screen blank sleep1: %d ms / 16, load: %s\n", 2 * ms, get_load());
-			}
-			nap_sleep(2 * ms, 16);
-			return;
-		}
-		if (dt_ev > screen_blank) {
-			if (debug_tiles > 1) {
-				fprintf(stderr, "screen blank sleep2: %d ms / 8, load: %s\n", ms, get_load());
-			}
-			nap_sleep(ms, 8);
-			return;
-		}
-	}
-	if (naptile && nap_ok && tile_cnt < naptile) {
-		int ms = napfac * waitms;
-		ms = ms > napmax ? napmax : ms;
-		if (now - last_input <= 3) {
-			nap_ok = 0;
-		} else if (now - last_local_input <= 3) {
-			nap_ok = 0;
-		} else {
-			if (debug_tiles > 1) {
-				fprintf(stderr, "nap_check sleep: %d ms / 1, load: %s\n", ms, get_load());
-			}
-			nap_sleep(ms, 1);
-		}
-	}
-}
-
-/*
- * This is called to avoid a ~20 second timeout in libvncserver.
- * May no longer be needed.
- */
-static void ping_clients(int tile_cnt) {
-	static time_t last_send = 0;
-	time_t now = time(NULL);
-
-	if (rfbMaxClientWait < 20000) {
-		rfbMaxClientWait = 20000;
-		rfbLog("reset rfbMaxClientWait to %d msec.\n",
-		    rfbMaxClientWait);
-	}
-	if (tile_cnt > 0) {
-		last_send = now;
-	} else if (tile_cnt < 0) {
-		/* negative tile_cnt is -ping case */
-		if (now >= last_send - tile_cnt) {
-			mark_rect_as_modified(0, 0, 1, 1, 1);
-			last_send = now;
-		}
-	} else if (now - last_send > 5) {
-		/* Send small heartbeat to client */
-		mark_rect_as_modified(0, 0, 1, 1, 1);
-		last_send = now;
-	}
-}
-
-/*
- * scan_display() wants to know if this tile can be skipped due to
- * blackout regions: (no data compare is done, just a quick geometric test)
- */
-static int blackout_line_skip(int n, int x, int y, int rescan,
-    int *tile_count) {
-	
-	if (tile_blackout[n].cover == 2) {
-		tile_has_diff[n] = 0;
-		return 1;	/* skip it */
-
-	} else if (tile_blackout[n].cover == 1) {
-		int w, x1, y1, x2, y2, b, hit = 0;
-		if (x + NSCAN > dpy_x) {
-			w = dpy_x - x;
-		} else {
-			w = NSCAN;
-		}
-
-		for (b=0; b < tile_blackout[n].count; b++) {
-			
-			/* n.b. these coords are in full display space: */
-			x1 = tile_blackout[n].bo[b].x1;
-			x2 = tile_blackout[n].bo[b].x2;
-			y1 = tile_blackout[n].bo[b].y1;
-			y2 = tile_blackout[n].bo[b].y2;
-
-			if (x2 - x1 < w) {
-				/* need to cover full width */
-				continue;
-			}
-			if (y1 <= y && y < y2) {
-				hit = 1;
-				break;
-			}
-		}
-		if (hit) {
-			if (! rescan) {
-				tile_has_diff[n] = 0;
-			} else {
-				*tile_count += tile_has_diff[n];
-			}
-			return 1;	/* skip */
-		}
-	}
-	return 0;	/* do not skip */
-}
-
-static int blackout_line_cmpskip(int n, int x, int y, char *dst, char *src,
-    int w, int pixelsize) {
-
-	int i, x1, y1, x2, y2, b, hit = 0;
-	int beg = -1, end = -1; 
-
-	if (tile_blackout[n].cover == 0) {
-		return 0;	/* 0 means do not skip it. */
-	} else if (tile_blackout[n].cover == 2) {
-		return 1;	/* 1 means skip it. */
-	}
-
-	/* tile has partial coverage: */
-
-	for (i=0; i < w * pixelsize; i++)  {
-		if (*(dst+i) != *(src+i)) {
-			beg = i/pixelsize;	/* beginning difference */
-			break;
-		}
-	}
-	for (i = w * pixelsize - 1; i >= 0; i--)  {
-		if (*(dst+i) != *(src+i)) {
-			end = i/pixelsize;	/* ending difference */
-			break;
-		}
-	}
-	if (beg < 0 || end < 0) {
-		/* problem finding range... */
-		return 0;
-	}
-
-	/* loop over blackout rectangles: */
-	for (b=0; b < tile_blackout[n].count; b++) {
-		
-		/* y in full display space: */
-		y1 = tile_blackout[n].bo[b].y1;
-		y2 = tile_blackout[n].bo[b].y2;
-
-		/* x relative to tile origin: */
-		x1 = tile_blackout[n].bo[b].x1 - x;
-		x2 = tile_blackout[n].bo[b].x2 - x;
-
-		if (y1 > y || y >= y2) {
-			continue;
-		}
-		if (x1 <= beg && end <= x2) {
-			hit = 1;
-			break;
-		}
-	}
-	if (hit) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-/*
- * For the subwin case follows the window if it is moved.
- */
-void set_offset(void) {
-	Window w;
-	if (! subwin) {
-		return;
-	}
-	X_LOCK;
-	xtranslate(window, rootwin, 0, 0, &off_x, &off_y, &w, 0);
-	X_UNLOCK;
-}
-
-static int xd_samples = 0, xd_misses = 0, xd_do_check = 0;
-
-/*
- * Loop over 1-pixel tall horizontal scanlines looking for changes.  
- * Record the changes in tile_has_diff[].  Scanlines in the loop are
- * equally spaced along y by NSCAN pixels, but have a slightly random
- * starting offset ystart ( < NSCAN ) from scanlines[].
- */
-
-static int scan_display(int ystart, int rescan) {
-	char *src, *dst;
-	int pixelsize = bpp/8;
-	int x, y, w, n;
-	int tile_count = 0;
-	int nodiffs = 0, diff_hint;
-	int xd_check = 0, xd_freq = 1;
-	static int xd_tck = 0;
-
-	y = ystart;
-
-	g_now = dnow();
-
-	if (! main_fb) {
-		rfbLog("scan_display: no main_fb!\n");
-		return 0;
-	}
-
-	X_LOCK;
-
-	while (y < dpy_y) {
-
-		if (use_xdamage) {
-			XD_tot++;
-			xd_check = 0;
-			if (xdamage_hint_skip(y)) {
-				if (xd_do_check && dpy && use_xdamage == 1) {
-					xd_tck++;
-					xd_tck = xd_tck % xd_freq;
-					if (xd_tck == 0) {
-						xd_check = 1;
-						xd_samples++;
-					}
-				}
-				if (!xd_check) {
-					XD_skip++;
-					y += NSCAN;
-					continue;
-				}
-			} else {
-				if (xd_do_check && 0) {
-					fprintf(stderr, "ns y=%d\n", y);
-				}
-			}
-		}
-
-		/* grab the horizontal scanline from the display: */
-
-#ifndef NO_NCACHE
-/* XXX Y test */
-if (ncache > 0) {
-	int gotone = 0;
-	if (macosx_console) {
-		if (macosx_checkevent(NULL)) {
-			gotone = 1;
-		}
-	} else {
-#if !NO_X11
-		XEvent ev;
-		if (raw_fb_str) {
-			;
-		} else if (XEventsQueued(dpy, QueuedAlready) == 0) {
-			;	/* XXX Y resp */
-		} else if (XCheckTypedEvent(dpy, MapNotify, &ev)) {
-			gotone = 1;
-		} else if (XCheckTypedEvent(dpy, UnmapNotify, &ev)) {
-			gotone = 2;
-		} else if (XCheckTypedEvent(dpy, CreateNotify, &ev)) {
-			gotone = 3;
-		} else if (XCheckTypedEvent(dpy, ConfigureNotify, &ev)) {
-			gotone = 4;
-		} else if (XCheckTypedEvent(dpy, VisibilityNotify, &ev)) {
-			gotone = 5;
-		}
-		if (gotone) {
-			XPutBackEvent(dpy, &ev);
-		}
-#endif
-	}
-	if (gotone) {
-		static int nomsg = 1;
-		if (nomsg) {
-			if (dnowx() > 20) {
-				nomsg = 0;
-			}
-		} else {
-if (ncdb) fprintf(stderr, "\n*** SCAN_DISPLAY CHECK_NCACHE/%d *** %d rescan=%d\n", gotone, y, rescan);
-		}
-		X_UNLOCK;
-		check_ncache(0, 1);
-		X_LOCK;
-	}
-}
-#endif
-
-		XRANDR_SET_TRAP_RET(-1, "scan_display-set");
-		copy_image(scanline, 0, y, 0, 0);
-		XRANDR_CHK_TRAP_RET(-1, "scan_display-chk");
-
-		/* for better memory i/o try the whole line at once */
-		src = scanline->data;
-		dst = main_fb + y * main_bytes_per_line;
-
-		if (! memcmp(dst, src, main_bytes_per_line)) {
-			/* no changes anywhere in scan line */
-			nodiffs = 1;
-			if (! rescan) {
-				y += NSCAN;
-				continue;
-			}
-		}
-		if (xd_check) {
-			xd_misses++;
-		}
-
-		x = 0;
-		while (x < dpy_x) {
-			n = (x/tile_x) + (y/tile_y) * ntiles_x;
-			diff_hint = 0;
-
-			if (blackouts) {
-				if (blackout_line_skip(n, x, y, rescan,
-				    &tile_count)) {
-					x += NSCAN;
-					continue;
-				}
-			}
-
-			if (rescan) {
-				if (nodiffs || tile_has_diff[n]) {
-					tile_count += tile_has_diff[n];
-					x += NSCAN;
-					continue;
-				}
-			} else if (xdamage_tile_count &&
-			    tile_has_xdamage_diff[n]) {
-				tile_has_xdamage_diff[n] = 2;
-				diff_hint = 1;
-			}
-
-			/* set ptrs to correspond to the x offset: */
-			src = scanline->data + x * pixelsize;
-			dst = main_fb + y * main_bytes_per_line + x * pixelsize;
-
-			/* compute the width of data to be compared: */
-			if (x + NSCAN > dpy_x) {
-				w = dpy_x - x;
-			} else {
-				w = NSCAN;
-			}
-
-			if (diff_hint || memcmp(dst, src, w * pixelsize)) {
-				/* found a difference, record it: */
-				if (! blackouts) {
-					tile_has_diff[n] = 1;
-					tile_count++;		
-				} else {
-					if (blackout_line_cmpskip(n, x, y,
-					    dst, src, w, pixelsize)) {
-						tile_has_diff[n] = 0;
-					} else {
-						tile_has_diff[n] = 1;
-						tile_count++;		
-					}
-				}
-			}
-			x += NSCAN;
-		}
-		y += NSCAN;
-	}
-
-	X_UNLOCK;
-
-	return tile_count;
-}
-
-
-int scanlines[NSCAN] = {
-	 0, 16,  8, 24,  4, 20, 12, 28,
-	10, 26, 18,  2, 22,  6, 30, 14,
-	 1, 17,  9, 25,  7, 23, 15, 31,
-	19,  3, 27, 11, 29, 13,  5, 21
-};
-
-/*
- * toplevel for the scanning, rescanning, and applying the heuristics.
- * returns number of changed tiles.
- */
-int scan_for_updates(int count_only) {
-	int i, tile_count, tile_diffs;
-	int old_copy_tile;
-	double frac1 = 0.1;   /* tweak parameter to try a 2nd scan_display() */
-	double frac2 = 0.35;  /* or 3rd */
-	double frac3 = 0.02;  /* do scan_display() again after copy_tiles() */
-	static double last_poll = 0.0;
-	double dtmp = 0.0;
-
-	if (unixpw_in_progress) return 0;
- 
-	if (slow_fb > 0.0) {
-		double now = dnow();
-		if (now < last_poll + slow_fb) {
-			return 0;
-		}
-		last_poll = now;
-	}
-
-	for (i=0; i < ntiles; i++) {
-		tile_has_diff[i] = 0;
-		tile_has_xdamage_diff[i] = 0;
-		tile_tried[i] = 0;
-		tile_copied[i] = 0;
-	}
-	for (i=0; i < ntiles_y; i++) {
-		/* could be useful, currently not used */
-		tile_row_has_xdamage_diff[i] = 0;
-	}
-	xdamage_tile_count = 0;
-
-	/*
-	 * n.b. this program has only been tested so far with
-	 * tile_x = tile_y = NSCAN = 32!
-	 */
-
-	if (!count_only) {
-		scan_count++;
-		scan_count %= NSCAN;
-
-		/* some periodic maintenance */
-		if (subwin && scan_count % 4 == 0) {
-			set_offset();	/* follow the subwindow */
-		}
-		if (indexed_color && scan_count % 4 == 0) {
-			/* check for changed colormap */
-			set_colormap(0);
-		}
-		if (cmap8to24 && scan_count % 1 == 0) {
-			check_for_multivis();
-		}
-#ifdef MACOSX
-		if (macosx_console) {
-			macosx_event_loop();
-		}
-#endif
-		if (use_xdamage) {
-			/* first pass collecting DAMAGE events: */
-#ifdef MACOSX
-			if (macosx_console) {
-				collect_non_X_xdamage(-1, -1, -1, -1, 0);
-			} else 
-#endif
-			{
-				if (rawfb_vnc_reflect) {
-					collect_non_X_xdamage(-1, -1, -1, -1, 0);
-				} else {
-					collect_xdamage(scan_count, 0);
-				}
-			}
-		}
-	}
-
-#define SCAN_FATAL(x) \
-	if (x < 0) { \
-		scan_in_progress = 0; \
-		fb_copy_in_progress = 0; \
-		return 0; \
-	}
-
-	/* scan with the initial y to the jitter value from scanlines: */
-	scan_in_progress = 1;
-	tile_count = scan_display(scanlines[scan_count], 0);
-	SCAN_FATAL(tile_count);
-
-	/*
-	 * we do the XDAMAGE here too since after scan_display()
-	 * there is a better chance we have received the events from
-	 * the X server (otherwise the DAMAGE events will be processed
-	 * in the *next* call, usually too late and wasteful since
-	 * the unchanged tiles are read in again).
-	 */
-	if (use_xdamage) {
-#ifdef MACOSX
-		if (macosx_console) {
-			;
-		} else 
-#endif
-		{
-			if (rawfb_vnc_reflect) {
-				;
-			} else {
-				collect_xdamage(scan_count, 1);
-			}
-		}
-	}
-	if (count_only) {
-		scan_in_progress = 0;
-		fb_copy_in_progress = 0;
-		return tile_count;
-	}
-
-	if (xdamage_tile_count) {
-		/* pick up "known" damaged tiles we missed in scan_display() */
-		for (i=0; i < ntiles; i++) {
-			if (tile_has_diff[i]) {
-				continue;
-			}
-			if (tile_has_xdamage_diff[i]) {
-				tile_has_diff[i] = 1;
-				if (tile_has_xdamage_diff[i] == 1) {
-					tile_has_xdamage_diff[i] = 2;
-					tile_count++;
-				}
-			}
-		}
-	}
-	if (dpy && use_xdamage == 1) {
-		static time_t last_xd_check = 0;
-		if (time(NULL) > last_xd_check + 2) {
-			int cp = (scan_count + 3) % NSCAN;
-			xd_do_check = 1;
-			tile_count = scan_display(scanlines[cp], 0);
-			xd_do_check = 0;
-			SCAN_FATAL(tile_count);
-			last_xd_check = time(NULL);
-			if (xd_samples > 200) {
-				static int bad = 0;
-				if (xd_misses > (20 * xd_samples) / 100) {
-					rfbLog("XDAMAGE is not working well... misses: %d/%d\n", xd_misses, xd_samples);
-					rfbLog("Maybe an OpenGL app like Beryl or Compiz is the problem?\n");
-					rfbLog("Use x11vnc -noxdamage or disable the Beryl/Compiz app.\n");
-					rfbLog("To disable this check and warning specify -xdamage twice.\n");
-					if (++bad >= 10) {
-						rfbLog("XDAMAGE appears broken (OpenGL app?), turning it off.\n");
-						use_xdamage = 0;
-						initialize_xdamage();
-						destroy_xdamage_if_needed();
-					}
-				}
-				xd_samples = 0;
-				xd_misses = 0;
-			}
-		}
-	}
-
-	nap_set(tile_count);
-
-	if (fs_factor && frac1 >= fs_frac) {
-		/* make frac1 < fs_frac if fullscreen updates are enabled */
-		frac1 = fs_frac/2.0;
-	}
-
-	if (tile_count > frac1 * ntiles) {
-		/*
-		 * many tiles have changed, so try a rescan (since it should
-		 * be short compared to the many upcoming copy_tiles() calls)
-		 */
-
-		/* this check is done to skip the extra scan_display() call */
-		if (! fs_factor || tile_count <= fs_frac * ntiles) {
-			int cp, tile_count_old = tile_count;
-			
-			/* choose a different y shift for the 2nd scan: */
-			cp = (NSCAN - scan_count) % NSCAN;
-
-			tile_count = scan_display(scanlines[cp], 1);
-			SCAN_FATAL(tile_count);
-
-			if (tile_count >= (1 + frac2) * tile_count_old) {
-				/* on a roll... do a 3rd scan */
-				cp = (NSCAN - scan_count + 7) % NSCAN;
-				tile_count = scan_display(scanlines[cp], 1);
-				SCAN_FATAL(tile_count);
-			}
-		}
-		scan_in_progress = 0;
-
-		/*
-		 * At some number of changed tiles it is better to just
-		 * copy the full screen at once.  I.e. time = c1 + m * r1
-		 * where m is number of tiles, r1 is the copy_tiles()
-		 * time, and c1 is the scan_display() time: for some m
-		 * it crosses the full screen update time.
-		 *
-		 * We try to predict that crossover with the fs_frac
-		 * fudge factor... seems to be about 1/2 the total number
-		 * of tiles.  n.b. this ignores network bandwidth,
-		 * compression time etc...
-		 *
-		 * Use -fs 1.0 to disable on slow links.
-		 */
-		if (fs_factor && tile_count > fs_frac * ntiles) {
-			int cs;
-			fb_copy_in_progress = 1;
-			cs = copy_screen();
-			fb_copy_in_progress = 0;
-			SCAN_FATAL(cs);
-			if (use_threads && pointer_mode != 1) {
-				pointer_event(-1, 0, 0, NULL);
-			}
-			nap_check(tile_count);
-			return tile_count;
-		}
-	}
-	scan_in_progress = 0;
-
-	/* copy all tiles with differences from display to rfb framebuffer: */
-	fb_copy_in_progress = 1;
-
-	if (single_copytile || tile_shm_count < ntiles_x) {
-		/*
-		 * Old way, copy I/O one tile at a time.
-		 */
-		old_copy_tile = 1;
-	} else {
-		/* 
-		 * New way, does runs of horizontal tiles at once.
-		 * Note that below, for simplicity, the extra tile finding
-		 * (e.g. copy_tiles_backward_pass) is done the old way.
-		 */
-		old_copy_tile = 0;
-	}
-
-	if (unixpw_in_progress) return 0;
-
-/* XXX Y */
-if (0 && tile_count > 20) print_tiles();
-#if 0
-dtmp = dnow();
-#else
-dtmp = 0.0;
-#endif
-
-	if (old_copy_tile) {
-		tile_diffs = copy_all_tiles();
-	} else {
-		tile_diffs = copy_all_tile_runs();
-	}
-	SCAN_FATAL(tile_diffs);
-
-#if 0
-if (tile_count) fprintf(stderr, "XX copytile: %.4f  tile_count: %d\n", dnow() - dtmp, tile_count);
-#endif
-
-	/*
-	 * This backward pass for upward and left tiles complements what
-	 * was done in copy_all_tiles() for downward and right tiles.
-	 */
-	tile_diffs = copy_tiles_backward_pass();
-	SCAN_FATAL(tile_diffs);
-
-	if (tile_diffs > frac3 * ntiles) {
-		/*
-		 * we spent a lot of time in those copy_tiles, run
-		 * another scan, maybe more of the screen changed.
-		 */
-		int cp = (NSCAN - scan_count + 13) % NSCAN;
-
-		scan_in_progress = 1;
-		tile_count = scan_display(scanlines[cp], 1);
-		SCAN_FATAL(tile_count);
-		scan_in_progress = 0;
-
-		tile_diffs = copy_tiles_additional_pass();
-		SCAN_FATAL(tile_diffs);
-	}
-
-	/* Given enough tile diffs, try the islands: */
-	if (grow_fill && tile_diffs > 4) {
-		tile_diffs = grow_islands();
-	}
-	SCAN_FATAL(tile_diffs);
-
-	/* Given enough tile diffs, try the gaps: */
-	if (gaps_fill && tile_diffs > 4) {
-		tile_diffs = fill_tile_gaps();
-	}
-	SCAN_FATAL(tile_diffs);
-
-	fb_copy_in_progress = 0;
-	if (use_threads && pointer_mode != 1) {
-		/*
-		 * tell the pointer handler it can process any queued
-		 * pointer events:
-		 */
-		pointer_event(-1, 0, 0, NULL);
-	}
-
-	if (blackouts) {
-		/* ignore any diffs in completely covered tiles */
-		int x, y, n;
-		for (y=0; y < ntiles_y; y++) {
-			for (x=0; x < ntiles_x; x++) {
-				n = x + y * ntiles_x;
-				if (tile_blackout[n].cover == 2) {
-					tile_has_diff[n] = 0;
-				}
-			}
-		}
-	}
-
-	hint_updates();	/* use x0rfbserver hints algorithm */
-
-	/* Work around threaded rfbProcessClientMessage() calls timeouts */
-	if (use_threads) {
-		ping_clients(tile_diffs);
-	} else if (saw_ultra_chat || saw_ultra_file) {
-		ping_clients(-1);
-	} else if (use_openssl && !tile_diffs) {
-		ping_clients(0);
-	}
-	/* -ping option: */
-	if (ping_interval) {
-		int td = ping_interval > 0 ? ping_interval : -ping_interval;
-		ping_clients(-td);
-	}
-
-
-	nap_check(tile_diffs);
-	return tile_diffs;
-}
-
-
diff --git a/ica/x11/x11vnc/scan.h b/ica/x11/x11vnc/scan.h
deleted file mode 100644
index 32cf216..0000000
--- a/ica/x11/x11vnc/scan.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SCAN_H
-#define _X11VNC_SCAN_H
-
-/* -- scan.h -- */
-
-extern int nap_ok;
-extern int scanlines[];
-
-extern void initialize_tiles(void);
-extern void free_tiles(void);
-extern void shm_delete(XShmSegmentInfo *shm);
-extern void shm_clean(XShmSegmentInfo *shm, XImage *xim);
-extern void initialize_polling_images(void);
-extern void scale_rect(double factor_x, double factor_y, int blend, int interpolate, int Bpp,
-    char *src_fb, int src_bytes_per_line, char *dst_fb, int dst_bytes_per_line,
-    int Nx, int Ny, int nx, int ny, int X1, int Y1, int X2, int Y2, int mark);
-extern void scale_and_mark_rect(int X1, int Y1, int X2, int Y2, int mark);
-extern void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force);
-extern int copy_screen(void);
-extern int copy_snap(void);
-extern void nap_sleep(int ms, int split);
-extern void set_offset(void);
-extern int scan_for_updates(int count_only);
-extern void rotate_curs(char *dst_0, char *src_0, int Dx, int Dy, int Bpp);
-extern void rotate_coords(int x, int y, int *xo, int *yo, int dxi, int dyi);
-extern void rotate_coords_inverse(int x, int y, int *xo, int *yo, int dxi, int dyi);
-
-#endif /* _X11VNC_SCAN_H */
diff --git a/ica/x11/x11vnc/screen.c b/ica/x11/x11vnc/screen.c
deleted file mode 100644
index 942d955..0000000
--- a/ica/x11/x11vnc/screen.c
+++ /dev/null
@@ -1,4742 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- screen.c -- */
-
-#include "x11vnc.h"
-#include "xevents.h"
-#include "xwrappers.h"
-#include "xinerama.h"
-#include "xdamage.h"
-#include "win_utils.h"
-#include "cleanup.h"
-#include "userinput.h"
-#include "scan.h"
-#include "user.h"
-#include "rates.h"
-#include "pointer.h"
-#include "keyboard.h"
-#include "cursor.h"
-#include "connections.h"
-#include "remote.h"
-#include "unixpw.h"
-#include "sslcmds.h"
-#include "sslhelper.h"
-#include "v4l.h"
-#include "linuxfb.h"
-#include "macosx.h"
-#include "macosxCG.h"
-#include "avahi.h"
-#include "solid.h"
-#include "inet.h"
-#include "xrandr.h"
-#include "xrecord.h"
-#include "pm.h"
-
-#include <rfb/rfbclient.h>
-
-void set_greyscale_colormap(void);
-void set_hi240_colormap(void);
-void unset_colormap(void);
-void set_colormap(int reset);
-void set_nofb_params(int restore);
-void set_raw_fb_params(int restore);
-void do_new_fb(int reset_mem);
-void free_old_fb(void);
-void check_padded_fb(void);
-void install_padded_fb(char *geom);
-XImage *initialize_xdisplay_fb(void);
-void parse_scale_string(char *str, double *factor_x, double *factor_y, int *scaling, int *blend,
-    int *nomult4, int *pad, int *interpolate, int *numer, int *denom, int w_in, int h_in);
-int parse_rotate_string(char *str, int *mode);
-int scale_round(int len, double fac);
-void initialize_screen(int *argc, char **argv, XImage *fb);
-void set_vnc_desktop_name(void);
-void announce(int lport, int ssl, char *iface);
-
-char *vnc_reflect_guess(char *str, char **raw_fb_addr);
-void vnc_reflect_process_client(void);
-rfbBool vnc_reflect_send_pointer(int x, int y, int mask);
-rfbBool vnc_reflect_send_key(uint32_t key, rfbBool down);
-rfbBool vnc_reflect_send_cuttext(char *str, int len);
-
-static void debug_colormap(XImage *fb);
-static void set_visual(char *str);
-static void nofb_hook(rfbClientPtr cl);
-static void remove_fake_fb(void);
-static void install_fake_fb(int w, int h, int bpp);
-static void initialize_snap_fb(void);
-XImage *initialize_raw_fb(int);
-static void initialize_clipshift(void);
-static int wait_until_mapped(Window win);
-static void setup_scaling(int *width_in, int *height_in);
-
-static void check_filexfer(void);
-static void record_last_fb_update(void);
-static void check_cursor_changes(void);
-static int choose_delay(double dt);
-
-int rawfb_reset = -1;
-int rawfb_dev_video = 0;
-int rawfb_vnc_reflect = 0;
-
-/*
- * X11 and rfb display/screen related routines
- */
-
-/*
- * Some handling of 8bpp PseudoColor colormaps.  Called for initializing
- * the clients and dynamically if -flashcmap is specified.
- */
-#define NCOLOR 256
-
-/* this is only for rawfb */
-void set_greyscale_colormap(void) {
-	int i;
-	if (! screen) {
-		return;
-	}
-	/* mutex */
-	if (screen->colourMap.data.shorts) {
-		free(screen->colourMap.data.shorts);
-		screen->colourMap.data.shorts = NULL;
-	}
-
-if (0) fprintf(stderr, "set_greyscale_colormap: %s\n", raw_fb_pixfmt);
-	screen->colourMap.count = NCOLOR;
-	screen->serverFormat.trueColour = FALSE;
-	screen->colourMap.is16 = TRUE;
-	screen->colourMap.data.shorts = (unsigned short *)
-		malloc(3*sizeof(unsigned short) * NCOLOR);
-
-	for(i = 0; i < NCOLOR; i++) {
-		unsigned short lvl = i * 256;
-
-		screen->colourMap.data.shorts[i*3+0] = lvl;
-		screen->colourMap.data.shorts[i*3+1] = lvl;
-		screen->colourMap.data.shorts[i*3+2] = lvl;
-	}
-
-	rfbSetClientColourMaps(screen, 0, NCOLOR);
-}
-
-/* this is specific to bttv rf tuner card */
-void set_hi240_colormap(void) {
-	int i;
-	if (! screen) {
-		return;
-	}
-	/* mutex */
-if (0) fprintf(stderr, "set_hi240_colormap: %s\n", raw_fb_pixfmt);
-	if (screen->colourMap.data.shorts) {
-		free(screen->colourMap.data.shorts);
-		screen->colourMap.data.shorts = NULL;
-	}
-
-	screen->colourMap.count = 256;
-	screen->serverFormat.trueColour = FALSE;
-	screen->colourMap.is16 = TRUE;
-	screen->colourMap.data.shorts = (unsigned short *)
-		calloc(3*sizeof(unsigned short) * 256, 1);
-
-	for(i = 0; i < 225; i++) {
-		int r, g, b;
-
-		r = ( (i/5) % 5 ) * 255.0 / 4 + 0.5;
-		g = ( (i/25)    ) * 255.0 / 8 + 0.5;
-		b = ( i % 5     ) * 255.0 / 4 + 0.5;
-
-		screen->colourMap.data.shorts[(i+16)*3+0] = (unsigned short) (r * 256);
-		screen->colourMap.data.shorts[(i+16)*3+1] = (unsigned short) (g * 256);
-		screen->colourMap.data.shorts[(i+16)*3+2] = (unsigned short) (b * 256);
-	}
-
-	rfbSetClientColourMaps(screen, 0, 256);
-}
-
-/* this is only for rawfb */
-void unset_colormap(void) {
-	if (! screen) {
-		return;
-	}
-	if (screen->colourMap.data.shorts) {
-		free(screen->colourMap.data.shorts);
-		screen->colourMap.data.shorts = NULL;
-	}
-	screen->serverFormat.trueColour = TRUE;
-if (0) fprintf(stderr, "unset_colormap: %s\n", raw_fb_pixfmt);
-}
-
-/* this is X11 case */
-void set_colormap(int reset) {
-
-#if NO_X11
-	if (!reset) {}
-	return;
-#else
-	static int init = 1;
-	static XColor *color = NULL, *prev = NULL;
-	static int ncolor = 0;
-	Colormap cmap;
-	Visual *vis;
-	int i, ncells, diffs = 0;
-
-	if (reset) {
-		init = 1;
-		ncolor = 0;
-		/* mutex */
-		if (screen->colourMap.data.shorts) {
-			free(screen->colourMap.data.shorts);
-			screen->colourMap.data.shorts = NULL;
-		}
-		if (color) {
-			free(color);
-			color = NULL;
-		}
-		if (prev) {
-			free(prev);
-			prev = NULL;
-		}
-	}
-
-	if (init) {
-		if (depth > 16) {
-			ncolor = NCOLOR;
-		} else if (depth > 8) {
-			ncolor = 1 << depth;
-		} else {
-			ncolor = NCOLOR;
-		}
-		/* mutex */
-		screen->colourMap.count = ncolor;
-		screen->serverFormat.trueColour = FALSE;
-		screen->colourMap.is16 = TRUE;
-		screen->colourMap.data.shorts = (unsigned short *)
-			malloc(3*sizeof(unsigned short) * ncolor);
-	}
-	if (color == NULL) {
-		color = (XColor *) calloc(ncolor * sizeof(XColor), 1);
-		prev  = (XColor *) calloc(ncolor * sizeof(XColor), 1);
-	}
-
-	for (i=0; i < ncolor; i++) {
-		prev[i].red   = color[i].red;
-		prev[i].green = color[i].green;
-		prev[i].blue  = color[i].blue;
-	}
-
-	RAWFB_RET_VOID
-
-	X_LOCK;
-
-	cmap = DefaultColormap(dpy, scr);
-	ncells = CellsOfScreen(ScreenOfDisplay(dpy, scr));
-	vis = default_visual;
-
-	if (subwin) {
-		XWindowAttributes attr;
-
-		if (XGetWindowAttributes(dpy, window, &attr)) {
-			cmap = attr.colormap;
-			vis = attr.visual;
-			ncells = vis->map_entries;
-		}
-	}
-
-	if (ncells != ncolor) {
-		if (! shift_cmap) {
-			screen->colourMap.count = ncells;
-		}
-	}
-	if (init && ! quiet) {
-		rfbLog("set_colormap: number of cells: %d, "
-		    "ncolor(%d) is %d.\n", ncells, depth, ncolor);
-	}
-
-	if (flash_cmap && ! init) {
-		XWindowAttributes attr;
-		Window c;
-		int tries = 0;
-
-		c = window;
-		while (c && tries++ < 16) {
-			c = query_pointer(c);
-			if (valid_window(c, &attr, 0)) {
-				if (attr.colormap && attr.map_installed) {
-					cmap = attr.colormap;
-					vis = attr.visual;
-					ncells = vis->map_entries;
-					break;
-				}
-			} else {
-				break;
-			}
-		}
-	}
-	if (ncells > ncolor && ! quiet) {
-		rfbLog("set_colormap: big problem: ncells=%d > %d\n",
-		    ncells, ncolor);
-	}
-
-	if (vis->class == TrueColor || vis->class == DirectColor) {
-		/*
-		 * Kludge to make 8bpp TrueColor & DirectColor be like
-		 * the StaticColor map.  The ncells = 8 is "8 per subfield"
-		 * mentioned in xdpyinfo.  Looks OK... perhaps fortuitously.
-		 */
-		if (ncells == 8 && ! shift_cmap) {
-			ncells = ncolor;
-		}
-	}
-
-	for (i=0; i < ncells; i++) {
-		color[i].pixel = i;
-		color[i].pad = 0;
-	}
-
-	XQueryColors(dpy, cmap, color, ncells);
-
-	X_UNLOCK;
-
-	for(i = ncells - 1; i >= 0; i--) {
-		int k = i + shift_cmap;
-
-		screen->colourMap.data.shorts[i*3+0] = color[i].red;
-		screen->colourMap.data.shorts[i*3+1] = color[i].green;
-		screen->colourMap.data.shorts[i*3+2] = color[i].blue;
-
-		if (prev[i].red   != color[i].red ||
-		    prev[i].green != color[i].green || 
-		    prev[i].blue  != color[i].blue ) {
-			diffs++;
-		}
-
-		if (shift_cmap && k >= 0 && k < ncolor) {
-			/* kludge to copy the colors to higher pixel values */
-			screen->colourMap.data.shorts[k*3+0] = color[i].red;
-			screen->colourMap.data.shorts[k*3+1] = color[i].green;
-			screen->colourMap.data.shorts[k*3+2] = color[i].blue;
-		}
-	}
-
-	if (diffs && ! init) {
-		if (! all_clients_initialized()) {
-			rfbLog("set_colormap: warning: sending cmap "
-			    "with uninitialized clients.\n");
-		}
-		if (shift_cmap) {
-			rfbSetClientColourMaps(screen, 0, ncolor);
-		} else {
-			rfbSetClientColourMaps(screen, 0, ncells);
-		}
-	}
-
-	init = 0;
-#endif	/* NO_X11 */
-}
-
-static void debug_colormap(XImage *fb) {
-	static int debug_cmap = -1;
-	int i, k, *histo;
-	int ncolor;
-
-	if (debug_cmap < 0) {
-		if (getenv("DEBUG_CMAP") != NULL) {
-			debug_cmap = 1;
-		} else {
-			debug_cmap = 0;
-		}
-	}
-	if (! debug_cmap) {
-		return;
-	}
-	if (! fb) {
-		return;
-	}
-	if (fb->bits_per_pixel > 16) {
-		return;
-	}
-	ncolor = screen->colourMap.count;
-	histo = (int *) calloc(ncolor * sizeof(int), 1);
-
-	for (i=0; i < ncolor; i++) {
-		histo[i] = 0;
-	}
-	for (k = 0; k < fb->width * fb->height; k++) {
-		unsigned char n;
-		char c = *(fb->data + k);
-
-		n = (unsigned char) c;
-		histo[n]++;
-	}
-	fprintf(stderr, "\nColormap histogram for current screen contents:\n");
-	for (i=0; i < ncolor; i++) {
-		unsigned short r = screen->colourMap.data.shorts[i*3+0];
-		unsigned short g = screen->colourMap.data.shorts[i*3+1];
-		unsigned short b = screen->colourMap.data.shorts[i*3+2];
-
-		fprintf(stderr, "   %03d: %7d %04x/%04x/%04x", i, histo[i],
-		    r, g, b);
-		if ((i+1) % 2 == 0)  {
-			fprintf(stderr, "\n");
-		}
-	}
-	free(histo);
-	fprintf(stderr, "\n");
-}
-
-/*
- * Experimental mode to force the visual of the window instead of querying
- * it.  Used for testing, overriding some rare cases (win2vnc), and for
- * -overlay .  Input string can be a decimal or 0x hex or something like
- * TrueColor or TrueColor:24 to force a depth as well.
- *
- * visual_id and possibly visual_depth are set.
- */
-static void set_visual(char *str) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!str) {}
-	return;
-#else
-	int vis, vdepth, defdepth;
-	XVisualInfo vinfo;
-	char *p, *vstring = strdup(str);
-
-	RAWFB_RET_VOID
-
-	defdepth = DefaultDepth(dpy, scr);
-	visual_id = (VisualID) 0;
-	visual_depth = 0;
-
-	if (!strcmp(vstring, "ignore") || !strcmp(vstring, "default")
-	    || !strcmp(vstring, "")) {
-		free(vstring);
-		return;
-	}
-
-	/* set visual depth */
-	if ((p = strchr(vstring, ':')) != NULL) {
-		visual_depth = atoi(p+1);
-		*p = '\0';
-		vdepth = visual_depth;
-	} else {
-		vdepth = defdepth; 
-	}
-	if (! quiet) {
-		fprintf(stderr, "\nVisual Info:\n");
-		fprintf(stderr, " set_visual(\"%s\")\n", str);
-		fprintf(stderr, " visual_depth: %d\n", vdepth);
-	}
-
-	/* set visual id number */
-	if (strcmp(vstring, "StaticGray") == 0) {
-		vis = StaticGray;
-	} else if (strcmp(vstring, "GrayScale") == 0) {
-		vis = GrayScale;
-	} else if (strcmp(vstring, "StaticColor") == 0) {
-		vis = StaticColor;
-	} else if (strcmp(vstring, "PseudoColor") == 0) {
-		vis = PseudoColor;
-	} else if (strcmp(vstring, "TrueColor") == 0) {
-		vis = TrueColor;
-	} else if (strcmp(vstring, "DirectColor") == 0) {
-		vis = DirectColor;
-	} else {
-		unsigned int v_in;
-		if (sscanf(vstring, "0x%x", &v_in) != 1) {
-			if (sscanf(vstring, "%u", &v_in) == 1) {
-				visual_id = (VisualID) v_in;
-				return;
-			}
-			rfbLogEnable(1);
-			rfbLog("invalid -visual arg: %s\n", vstring);
-			X_UNLOCK;
-			clean_up_exit(1);
-		}
-		visual_id = (VisualID) v_in;
-		free(vstring);
-		return;
-	}
-
-	if (! quiet) fprintf(stderr, " visual: %d\n", vis);
-	if (XMatchVisualInfo(dpy, scr, visual_depth, vis, &vinfo)) {
-		;
-	} else if (XMatchVisualInfo(dpy, scr, defdepth, vis, &vinfo)) {
-		;
-	} else {
-		rfbLogEnable(1);
-		rfbLog("could not find visual: %s\n", vstring);
-		X_UNLOCK;
-		clean_up_exit(1);
-	}
-	free(vstring);
-
-	/* set numerical visual id. */
-	visual_id = vinfo.visualid;
-#endif	/* NO_X11 */
-}
-
-void set_nofb_params(int restore) {
-	static int first = 1;
-	static int save[100];
-	static char *scroll = NULL;
-	int i = 0;
-
-	if (first) {
-		first = 0;
-		save[i++] = use_xfixes;
-		save[i++] = use_xdamage;
-		save[i++] = use_xrecord;
-		save[i++] = wireframe;
-		save[i++] = use_solid_bg;
-		save[i++] = overlay;
-		save[i++] = overlay_cursor;
-		save[i++] = using_shm;
-		save[i++] = single_copytile;
-		save[i++] = take_naps;
-		save[i++] = measure_speeds;
-		save[i++] = grab_buster;
-		save[i++] = show_cursor;
-		save[i++] = cursor_shape_updates;
-		save[i++] = cursor_pos_updates;
-		save[i++] = ncache;
-
-		scroll = scroll_copyrect;
-	}
-	if (restore) {
-		i = 0;
-		use_xfixes            = save[i++];
-		use_xdamage           = save[i++];
-		use_xrecord           = save[i++];
-		wireframe             = save[i++];
-		use_solid_bg          = save[i++];
-		overlay               = save[i++];
-		overlay_cursor        = save[i++];
-		using_shm             = save[i++];
-		single_copytile       = save[i++];
-		take_naps             = save[i++];
-		measure_speeds        = save[i++];
-		grab_buster           = save[i++];
-		show_cursor           = save[i++];
-		cursor_shape_updates  = save[i++];
-		cursor_pos_updates    = save[i++];
-		ncache                = save[i++];
-
-		scroll_copyrect = scroll;
-
-		if (cursor_shape_updates) {
-			restore_cursor_shape_updates(screen);
-		}
-		initialize_cursors_mode();
-
-		return;
-	}
-
-	use_xfixes = 0;
-	use_xdamage = 0;
-	use_xrecord = 0;
-	wireframe = 0;
-
-	use_solid_bg = 0;
-	overlay = 0;
-	overlay_cursor = 0;
-
-	using_shm = 0;
-	single_copytile = 1;
-
-	take_naps = 0;
-	measure_speeds = 0;
-
-	/* got_grab_buster? */
-	grab_buster = 0;
-
-	show_cursor = 0;
-	show_multiple_cursors = 0;
-	cursor_shape_updates = 0;
-	if (! got_cursorpos) {
-		cursor_pos_updates = 0;
-	}
-
-	ncache = 0;
-
-	scroll_copyrect = "never";
-
-	if (! quiet) {
-		rfbLog("disabling: xfixes, xdamage, solid, overlay, shm,\n");
-		rfbLog("  wireframe, scrollcopyrect, ncache,\n");
-		rfbLog("  noonetile, nap, cursor, %scursorshape\n",
-		    got_cursorpos ? "" : "cursorpos, " );
-		rfbLog("  in -nofb mode.\n");
-	}
-}
-
-static char *raw_fb_orig_dpy = NULL;
-
-void set_raw_fb_params(int restore) {
-	static int first = 1;
-	static int vo0, us0, sm0, ws0, wp0, wc0, wb0, na0, tn0;  
-	static int xr0, xrm0, sb0, re0;
-	static char *mc0;
-
-	/*
-	 * set turn off a bunch of parameters not compatible with 
-	 * -rawfb mode: 1) ignoring the X server 2) ignoring user input. 
-	 */
-	
-	if (first) {
-		/* at least save the initial settings... */
-		vo0 = view_only;
-		ws0 = watch_selection;
-		wp0 = watch_primary;
-		wc0 = watch_clipboard;
-		wb0 = watch_bell;
-		na0 = no_autorepeat;
-		sb0 = use_solid_bg;
-
-		us0 = use_snapfb;
-		sm0 = using_shm;
-		tn0 = take_naps;
-		xr0 = xrandr;
-		xrm0 = xrandr_maybe;
-		re0 = noxrecord;
-		mc0 = multiple_cursors_mode;
-
-		first = 0;
-	}
-
-	if (restore) {
-		view_only = vo0;
-		watch_selection = ws0;
-		watch_primary = wp0;
-		watch_clipboard = wc0;
-		watch_bell = wb0;
-		no_autorepeat = na0;
-		use_solid_bg = sb0;
-
-		use_snapfb = us0;
-		using_shm = sm0;
-		take_naps = tn0;
-		xrandr = xr0;
-		xrandr_maybe = xrm0;
-		noxrecord = re0;
-		multiple_cursors_mode = mc0;
-
-		if (! dpy && raw_fb_orig_dpy) {
-			dpy = XOpenDisplay_wr(raw_fb_orig_dpy);
-			last_open_xdisplay = time(NULL);
-			if (dpy) {
-				if (! quiet) rfbLog("reopened DISPLAY: %s\n",
-				    raw_fb_orig_dpy);
-				scr = DefaultScreen(dpy);
-				rootwin = RootWindow(dpy, scr);
-				check_xevents(1);
-			} else {
-				if (! quiet) rfbLog("WARNING: failed to reopen "
-				    "DISPLAY: %s\n", raw_fb_orig_dpy);
-			}
-		}
-		return;
-	}
-
-	if (verbose) {
-		rfbLog("set_raw_fb_params: modifying settings for "
-		    "-rawfb mode.\n");
-	}
-
-	if (got_noviewonly) {
-		/*
-		 * The user input parameters are not unset under
-		 * -noviewonly... this usage should be very rare
-		 * (i.e. rawfb but also send user input to the X
-		 * display, most likely using /dev/fb0 for some reason...)
-		 */
-		if (verbose) {
-		   rfbLog("rawfb: -noviewonly mode: still sending mouse and\n");
-		   rfbLog("rawfb:   keyboard input to the X DISPLAY!!\n");
-		}
-	} else {
-		/* Normal case: */
-#if 0
-		if (! view_only && ! pipeinput_str) {
-			if (! quiet) rfbLog("  rawfb: setting view_only\n");
-			view_only = 1;
-		}
-#endif
-		if (raw_fb_str && strstr(raw_fb_str, "vnc") == raw_fb_str) {
-			;
-		} else if (watch_selection) {
-			if (verbose) rfbLog("  rawfb: turning off "
-			    "watch_selection\n");
-			watch_selection = 0;
-		}
-		if (watch_primary) {
-			if (verbose) rfbLog("  rawfb: turning off "
-			    "watch_primary\n");
-			watch_primary = 0;
-		}
-		if (watch_clipboard) {
-			if (verbose) rfbLog("  rawfb: turning off "
-			    "watch_clipboard\n");
-			watch_clipboard = 0;
-		}
-		if (watch_bell) {
-			if (verbose) rfbLog("  rawfb: turning off watch_bell\n");
-			watch_bell = 0;
-		}
-		if (no_autorepeat) {
-			if (verbose) rfbLog("  rawfb: turning off "
-			    "no_autorepeat\n");
-			no_autorepeat = 0;
-		}
-		if (use_solid_bg) {
-			if (verbose) rfbLog("  rawfb: turning off "
-			    "use_solid_bg\n");
-			use_solid_bg = 0;
-		}
-#ifndef MACOSX
-		if (raw_fb_str && strstr(raw_fb_str, "vnc") == raw_fb_str) {
-			;
-		} else {
-			multiple_cursors_mode = strdup("arrow");
-		}
-#endif
-	}
-	if (using_shm) {
-		if (verbose) rfbLog("  rawfb: turning off using_shm\n");
-		using_shm = 0;
-	}
-	if (take_naps) {
-		if (verbose) rfbLog("  rawfb: turning off take_naps\n");
-		take_naps = 0;
-	}
-	if (xrandr) {
-		if (verbose) rfbLog("  rawfb: turning off xrandr\n");
-		xrandr = 0;
-	}
-	if (xrandr_maybe) {
-		if (verbose) rfbLog("  rawfb: turning off xrandr_maybe\n");
-		xrandr_maybe = 0;
-	}
-	if (! noxrecord) {
-		if (verbose) rfbLog("  rawfb: turning off xrecord\n");
-		noxrecord = 1;
-	}
-}
-
-/*
- * Presumably under -nofb the clients will never request the framebuffer.
- * However, we have gotten such a request... so let's just give them
- * the current view on the display.  n.b. x2vnc and perhaps win2vnc
- * requests a 1x1 pixel for some workaround so sadly this evidently
- * nearly always happens.
- */
-static void nofb_hook(rfbClientPtr cl) {
-	XImage *fb;
-	XImage raw;
-
-	rfbLog("framebuffer requested in -nofb mode by client %s\n", cl->host);
-	/* ignore xrandr */
-
-	if (raw_fb && ! dpy) {
-		fb = &raw;
-		fb->data = (char *)malloc(32);
-	} else {
-		int use_real_ximage = 0;
-		if (use_real_ximage) {
-			fb = XGetImage_wr(dpy, window, 0, 0, dpy_x, dpy_y, AllPlanes, ZPixmap);
-		} else {
-			fb = &raw;
-			fb->data = (char *) calloc(dpy_x*dpy_y*bpp/8, 1);
-		}
-	}
-	main_fb = fb->data;
-	rfb_fb = main_fb;
-	/* mutex */
-	screen->frameBuffer = rfb_fb;
-	screen->displayHook = NULL;
-}
-
-void free_old_fb(void) {
-	char *fbs[16];
-	int i, j, nfb = 0, db = 0; 
-
-	fbs[nfb++] = main_fb;		main_fb = NULL;
-	fbs[nfb++] = rfb_fb;		rfb_fb = NULL;
-	fbs[nfb++] = cmap8to24_fb;	cmap8to24_fb = NULL;
-	fbs[nfb++] = snap_fb;		snap_fb = NULL;
-	fbs[nfb++] = rot_fb;		rot_fb = NULL;
-	fbs[nfb++] = raw_fb;		raw_fb = NULL;
-
-	for (i=0; i < nfb; i++) {
-		char *fb = fbs[i];
-		int freeit = 1;
-		if (! fb || fb < (char *) 0x10) {
-			continue;
-		}
-		for (j=0; j < i; j++) {
-			if (fb == fbs[j]) {
-				freeit = 0;
-				break;
-			}
-		}
-		if (freeit) {
-			if (db) fprintf(stderr, "free: %i %p\n", i, fb);
-			free(fb);
-		} else {
-			if (db) fprintf(stderr, "skip: %i %p\n", i, fb);
-		}
-	}
-}
-
-static char _lcs_tmp[128];
-static int _bytes0_size = 128, _bytes0[128];
-
-static char *lcs(rfbClientPtr cl) {
-	sprintf(_lcs_tmp, "%d/%d/%d/%d/%d-%d/%d/%d",
-		!!(cl->newFBSizePending),
-		!!(cl->cursorWasChanged),
-		!!(cl->cursorWasMoved),
-		!!(cl->reverseConnection),
-		cl->state,
-		cl->modifiedRegion  ? !!(sraRgnEmpty(cl->modifiedRegion))  : 2,
-		cl->requestedRegion ? !!(sraRgnEmpty(cl->requestedRegion)) : 2,
-		cl->copyRegion      ? !!(sraRgnEmpty(cl->copyRegion))      : 2
-	);
-	return _lcs_tmp;
-}
-
-static int lock_client_sends(int lock) {
-	static rfbClientPtr *cls = NULL;
-	static int cls_len = 0;
-	static int blocked = 0;
-	static int state = 0;
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	char *s;
-
-	if (!use_threads || !screen) {
-		return 0;
-	}
-	if (lock < 0) {
-		return state;
-	}
-	state = lock;
-
-	if (lock) {
-		if (cls_len < client_count + 128) {
-			if (cls != NULL) {
-				free(cls);
-			}
-			cls_len = client_count + 256;
-			cls = (rfbClientPtr *) calloc(cls_len * sizeof(rfbClientPtr), 1);
-		}
-		
-		iter = rfbGetClientIterator(screen);
-		blocked = 0;
-		while ((cl = rfbClientIteratorNext(iter)) != NULL) {
-			s = lcs(cl);
-			SEND_LOCK(cl);
-			rfbLog("locked client:   %p  %.6f %s\n", cl, dnowx(), s);
-			cls[blocked++] = cl;
-		}
-		rfbReleaseClientIterator(iter);
-	} else {
-		int i;
-		for (i=0; i < blocked; i++) {
-			cl = cls[i];
-			if (cl != NULL) {
-				s = lcs(cl);
-				SEND_UNLOCK(cl)
-				rfbLog("unlocked client: %p  %.6f %s\n", cl, dnowx(), s);
-			}
-			cls[i] = NULL;
-		}
-		blocked = 0;
-	}
-	return state;
-}
-
-static void settle_clients(int init) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int fb_pend, i, ms = 1000;
-	char *s;
-
-	if (!use_threads || !screen) {
-		return;
-	}
-
-	if (init) {
-		iter = rfbGetClientIterator(screen);
-		i = 0;
-		while ((cl = rfbClientIteratorNext(iter)) != NULL) {
-			if (i < _bytes0_size) {
-				_bytes0[i] = rfbStatGetSentBytesIfRaw(cl);
-			}
-			i++;
-		}
-		rfbReleaseClientIterator(iter);
-
-		if (getenv("X11VNC_THREADS_NEW_FB_SLEEP")) {
-			ms = atoi(getenv("X11VNC_THREADS_NEW_FB_SLEEP"));
-		} else if (subwin) {
-			ms = 250;
-		} else {
-			ms = 500;
-		}
-		usleep(ms * 1000);
-		return;
-	}
-
-	if (getenv("X11VNC_THREADS_NEW_FB_SLEEP")) {
-		ms = atoi(getenv("X11VNC_THREADS_NEW_FB_SLEEP"));
-	} else if (subwin) {
-		ms = 500;
-	} else {
-		ms = 1000;
-	}
-	usleep(ms * 1000);
-
-	for (i=0; i < 5; i++) {
-		fb_pend = 0;
-		iter = rfbGetClientIterator(screen);
-		while ((cl = rfbClientIteratorNext(iter)) != NULL) {
-			s = lcs(cl);
-			if (cl->newFBSizePending) {
-				fb_pend++;
-				rfbLog("pending fb size: %p  %.6f %s\n", cl, dnowx(), s);
-			}
-		}
-		rfbReleaseClientIterator(iter);
-		if (fb_pend > 0) {
-			rfbLog("do_new_fb: newFBSizePending extra -threads sleep (%d)\n", i+1); 
-			usleep(ms * 1000);
-		} else {
-			break;
-		}
-	}
-	for (i=0; i < 5; i++) {
-		int stuck = 0, tot = 0, j = 0;
-		iter = rfbGetClientIterator(screen);
-		while ((cl = rfbClientIteratorNext(iter)) != NULL) {
-			if (j < _bytes0_size) {
-				int db = rfbStatGetSentBytesIfRaw(cl) - _bytes0[j];
-				int Bpp = cl->format.bitsPerPixel / 8;
-
-				s = lcs(cl);
-				rfbLog("addl bytes sent: %p  %.6f %s  %d  %d\n",
-				    cl, dnowx(), s, db, _bytes0[j]);
-
-				if (i==0) {
-					if (db < Bpp * dpy_x * dpy_y) {
-						stuck++;
-					}
-				} else if (i==1) {
-					if (db < 0.5 * Bpp * dpy_x * dpy_y) {
-						stuck++;
-					}
-				} else {
-					if (db <= 0) {
-						stuck++;
-					}
-				}
-			}
-			tot++;
-			j++;
-		}
-		rfbReleaseClientIterator(iter);
-		if (stuck > 0) {
-			rfbLog("clients stuck:  %d/%d  sleep(%d)\n", stuck, tot, i);
-			usleep(2 * ms * 1000);
-		} else {
-			break;
-		}
-	}
-}
-
-static void prep_clients_for_new_fb(void) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-
-	if (!use_threads || !screen) {
-		return;
-	}
-	iter = rfbGetClientIterator(screen);
-	while ((cl = rfbClientIteratorNext(iter)) != NULL) {
-		if (!cl->newFBSizePending) {
-			rfbLog("** set_new_fb_size_pending client:   %p\n", cl);
-			cl->newFBSizePending = TRUE;
-		}
-		cl->cursorWasChanged = FALSE;
-		cl->cursorWasMoved = FALSE;
-	}
-	rfbReleaseClientIterator(iter);
-}
-
-void do_new_fb(int reset_mem) {
-	XImage *fb;
-
-	/* for threaded we really should lock libvncserver out. */
-	if (use_threads) {
-		int ms = 1000;
-		if (getenv("X11VNC_THREADS_NEW_FB_SLEEP")) {
-			ms = atoi(getenv("X11VNC_THREADS_NEW_FB_SLEEP"));
-		} else if (subwin) {
-			ms = 500;
-		} else {
-			ms = 1000;
-		}
-		rfbLog("Warning: changing framebuffers in threaded mode may be unstable.\n");
-		threads_drop_input = 1;
-		usleep(ms * 1000);
-	}
-
-	INPUT_LOCK;
-	lock_client_sends(1);
-
-	if (use_threads) {
-		settle_clients(1);
-	}
-
-#ifdef MACOSX
-	if (macosx_console) {
-		macosxCG_fini();
-	}
-#endif
-	if (reset_mem == 1) {
-		/* reset_mem == 2 is a hack for changing users... */
-		clean_shm(0);
-		free_tiles();
-	}
-
-	free_old_fb();
-
-	fb = initialize_xdisplay_fb();
-
-	initialize_screen(NULL, NULL, fb);
-
-	if (reset_mem) {
-		initialize_tiles();
-		initialize_blackouts_and_xinerama();
-		initialize_polling_images();
-	}
-	if (ncache) {
-		check_ncache(1, 0);
-	}
-
-	prep_clients_for_new_fb();
-	lock_client_sends(0);
-	INPUT_UNLOCK;
-
-	if (use_threads) {
-		/* need to let things settle... */
-		settle_clients(0);
-		threads_drop_input = 0;
-	}
-}
-
-static void remove_fake_fb(void) {
-	if (! screen) {
-		return;
-	}
-	rfbLog("removing fake fb: 0x%x\n", fake_fb);
-
-	do_new_fb(1);
-
-	/*
-	 * fake_fb is freed in do_new_fb(), but we set to NULL here to
-	 * indicate it is gone.
-	 */
-	fake_fb = NULL;
-}
-
-static void rfb_new_framebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer,
-    int width,int height, int bitsPerSample,int samplesPerPixel,
-    int bytesPerPixel) {
-
-	rfbNewFramebuffer(rfbScreen, framebuffer, width, height, bitsPerSample,
-	    samplesPerPixel, bytesPerPixel);
-
-}
-
-static void install_fake_fb(int w, int h, int bpp) {
-	int bpc;
-	if (! screen) {
-		return;
-	}
-	lock_client_sends(1);
-	if (fake_fb) {
-		free(fake_fb);
-	}
-	fake_fb = (char *) calloc(w*h*bpp/8, 1);
-	if (! fake_fb) {
-		rfbLog("could not create fake fb: %dx%d %d\n", w, h, bpp);
-		lock_client_sends(0);
-		return;
-	}
-	bpc = guess_bits_per_color(bpp);
-	rfbLog("installing fake fb: %dx%d %d\n", w, h, bpp);
-	rfbLog("rfbNewFramebuffer(0x%x, 0x%x, %d, %d, %d, %d, %d)\n",
-	    screen, fake_fb, w, h, bpc, 1, bpp/8);
-
-	rfb_new_framebuffer(screen, fake_fb, w, h, bpc, 1, bpp/8);
-	lock_client_sends(0);
-}
-
-void check_padded_fb(void) {
-	if (! fake_fb) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	if (time(NULL) > pad_geometry_time+1 && all_clients_initialized()) {
-		remove_fake_fb();
-	}
-}
-
-void install_padded_fb(char *geom) {
-	int w, h;
-	int ok = 1;
-	if (! geom || *geom == '\0') {
-		ok = 0;
-	} else if (sscanf(geom, "%dx%d", &w, &h) != 2)  {
-		ok = 0;
-	}
-	w = nabs(w);
-	h = nabs(h);
-
-	if (w < 5) w = 5;
-	if (h < 5) h = 5;
-
-	if (!ok) {
-		rfbLog("skipping invalid pad geometry: '%s'\n", NONUL(geom));
-		return;
-	}
-	install_fake_fb(w, h, bpp);
-	pad_geometry_time = time(NULL);
-}
-
-static void initialize_snap_fb(void) {
-	RAWFB_RET_VOID
-	if (snap_fb) {
-		free(snap_fb);
-	}
-	snap = XGetImage_wr(dpy, window, 0, 0, dpy_x, dpy_y, AllPlanes,
-	    ZPixmap);
-	snap_fb = snap->data;
-}
-
-static rfbClient* client = NULL;
-
-void vnc_reflect_bell(rfbClient *cl) {
-	if (cl) {}
-	if (sound_bell) {
-		if (unixpw_in_progress) {
-			return;
-		}
-		if (! all_clients_initialized()) {
-			rfbLog("vnc_reflect_bell: not sending bell: "
-			    "uninitialized clients\n");
-		} else {
-			if (screen && client_count) {
-				rfbSendBell(screen);
-			}
-		}
-	}
-}
-
-void vnc_reflect_recv_cuttext(rfbClient *cl, const char *str, int len) {
-	if (cl) {}
-	if (unixpw_in_progress) {
-		return;
-	}
-	if (! watch_selection) {
-		return;
-	}
-	if (! all_clients_initialized()) {
-		rfbLog("vnc_reflect_recv_cuttext: no send: uninitialized clients\n");
-		return; /* some clients initializing, cannot send */ 
-	}
-	rfbSendServerCutText(screen, (char *)str, len);
-}
-
-void vnc_reflect_got_update(rfbClient *cl, int x, int y, int w, int h) {
-	if (cl) {}
-	if (use_xdamage) {
-		static int first = 1;
-		if (first) {
-			collect_non_X_xdamage(-1, -1, -1, -1, 0);
-			first = 0;
-		}
-		collect_non_X_xdamage(x, y, w, h, 1);
-	}
-}
-
-void vnc_reflect_got_cursorshape(rfbClient *cl, int xhot, int yhot, int width, int height, int bytesPerPixel) {
-	static int serial = 1;
-	int i, j;
-	char *pixels = NULL;
-	unsigned long r, g, b;
-	unsigned int ui = 0;
-	unsigned long red_mask, green_mask, blue_mask;
-
-	if (cl) {}
-	if (unixpw_in_progress) {
-		return;
-	}
-	if (! all_clients_initialized()) {
-		rfbLog("vnc_reflect_got_copyshape: no send: uninitialized clients\n");
-		return; /* some clients initializing, cannot send */ 
-	}
-	if (! client->rcSource) {
-		return;
-	}
-	if (bytesPerPixel != 1 && bytesPerPixel != 2 && bytesPerPixel != 4) {
-		return;
-	}
-
-	red_mask   = (client->format.redMax   << client->format.redShift);
-	green_mask = (client->format.greenMax << client->format.greenShift);
-	blue_mask  = (client->format.blueMax  << client->format.blueShift);
-
-	pixels = (char *)malloc(4*width*height);
-	for (j=0; j<height; j++) {
-		for (i=0; i<width; i++) {
-			unsigned int* uip;
-			unsigned char* uic;
-			int m;
-			if (bytesPerPixel == 1) {
-				unsigned char* p = (unsigned char *) client->rcSource;
-				ui = (unsigned long) *(p + j * width + i);
-			} else if (bytesPerPixel == 2) {
-				unsigned short* p = (unsigned short *) client->rcSource;
-				ui = (unsigned long) *(p + j * width + i);
-			} else if (bytesPerPixel == 4) {
-				unsigned int* p = (unsigned int *) client->rcSource;
-				ui = (unsigned long) *(p + j * width + i);
-			}
-			r = (red_mask   & ui) >> client->format.redShift;
-			g = (green_mask & ui) >> client->format.greenShift;
-			b = (blue_mask  & ui) >> client->format.blueShift;
-
-			r = (255 * r) / client->format.redMax;
-			g = (255 * g) / client->format.greenMax;
-			b = (255 * b) / client->format.blueMax;
-
-			ui = (r << 16 | g << 8 | b << 0) ;
-
-			uic = (unsigned char *)client->rcMask;
-			m = (int) *(uic + j * width + i);
-			if (m) {
-				ui |= 0xff000000;
-			}
-			uip = (unsigned int *)pixels;
-			*(uip + j * width + i) = ui;
-		}
-	}
-
-	store_cursor(serial++, (unsigned long*) pixels, width, height, 32, xhot, yhot);
-	free(pixels);
-	set_cursor(cursor_x, cursor_y, get_which_cursor());
-}
-
-rfbBool vnc_reflect_cursor_pos(rfbClient *cl, int x, int y) {
-	if (cl) {}
-	if (debug_pointer) {
-		rfbLog("vnc_reflect_cursor_pos: %d %d\n", x, y);
-	}
-	if (unixpw_in_progress) {
-		if (debug_pointer) {
-			rfbLog("vnc_reflect_cursor_pos: unixpw_in_progress%d\n", unixpw_in_progress);
-		}
-		return TRUE;
-	}
-	if (! all_clients_initialized()) {
-		rfbLog("vnc_reflect_cursor_pos: no send: uninitialized clients\n");
-		return TRUE; /* some clients initializing, cannot send */ 
-	}
-
-	cursor_position(x, y);
-	set_cursor(x, y, get_which_cursor());
-
-	return TRUE;
-}
-
-static void from_libvncclient_CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
-  int i,j;
-
-#define COPY_RECT_FROM_RECT(BPP) \
-  { \
-    uint##BPP##_t* _buffer=((uint##BPP##_t*)client->frameBuffer)+(src_y-dest_y)*client->width+src_x-dest_x; \
-    if (dest_y < src_y) { \
-      for(j = dest_y*client->width; j < (dest_y+h)*client->width; j += client->width) { \
-        if (dest_x < src_x) { \
-          for(i = dest_x; i < dest_x+w; i++) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } else { \
-          for(i = dest_x+w-1; i >= dest_x; i--) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } \
-      } \
-    } else { \
-      for(j = (dest_y+h-1)*client->width; j >= dest_y*client->width; j-=client->width) { \
-        if (dest_x < src_x) { \
-          for(i = dest_x; i < dest_x+w; i++) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } else { \
-          for(i = dest_x+w-1; i >= dest_x; i--) { \
-            ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \
-          } \
-        } \
-      } \
-    } \
-  }
-
-  switch(client->format.bitsPerPixel) {
-  case  8: COPY_RECT_FROM_RECT(8);  break;
-  case 16: COPY_RECT_FROM_RECT(16); break;
-  case 32: COPY_RECT_FROM_RECT(32); break;
-  default:
-    rfbClientLog("Unsupported bitsPerPixel: %d\n",client->format.bitsPerPixel);
-  }
-}
-
-void vnc_reflect_got_copyrect(rfbClient *cl, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
-	sraRegionPtr reg;
-	int dx, dy, rc = -1;
-	static int last_dx = 0, last_dy = 0;
-	if (cl) {}
-	if (unixpw_in_progress) {
-		return;
-	}
-	if (! all_clients_initialized()) {
-		rfbLog("vnc_reflect_got_copyrect: no send: uninitialized clients\n");
-		return; /* some clients initializing, cannot send */ 
-	}
-	dx = dest_x - src_x;
-	dy = dest_y - src_y;
-	if (dx != last_dx || dy != last_dy) {
-		rc = fb_push_wait(0.05, FB_COPY|FB_MOD);
-	}
-	if (0) fprintf(stderr, "vnc_reflect_got_copyrect: %03dx%03d+%03d+%03d   %3d %3d  rc=%d\n", dest_x, dest_y, w, h, dx, dy, rc);
-	reg = sraRgnCreateRect(dest_x, dest_y, dest_x + w, dest_y + h);
-	do_copyregion(reg, dx, dy, 0);
-	sraRgnDestroy(reg);
-
-	last_dx = dx;
-	last_dy = dy;
-
-	from_libvncclient_CopyRectangleFromRectangle(cl, src_x, src_y, w, h, dest_x, dest_y);
-}
-
-rfbBool vnc_reflect_resize(rfbClient *cl)  {
-	static int first = 1;
-	if(cl->frameBuffer) {
-		free(cl->frameBuffer);
-	}
-	cl->frameBuffer= malloc(cl->width * cl->height * cl->format.bitsPerPixel/8);
-	rfbLog("vnc_reflect_resize: %dx%dx%d first=%d\n", cl->width, cl->height,
-	    cl->format.bitsPerPixel, first);
-	if (!first) {
-		do_new_fb(1);
-	}
-	first = 0;
-	return cl->frameBuffer ? TRUE : FALSE;
-}
-
-#ifdef rfbCredentialTypeX509
-static rfbCredential* vnc_reflect_get_credential(rfbClient* client, int type) {
-	char *pass = getenv("X11VNC_REFLECT_PASSWORD");
-	char *user = getenv("X11VNC_REFLECT_USER");
-	char *cert = getenv("X11VNC_REFLECT_CACERT");
-	char *ccrl = getenv("X11VNC_REFLECT_CACRL");
-	char *clic = getenv("X11VNC_REFLECT_CLIENTCERT");
-	char *clik = getenv("X11VNC_REFLECT_CLIENTKEY");
-	int db = 0;
-	if (client) {}
-if (db) fprintf(stderr, "type: %d\n", type);
-#ifdef rfbCredentialTypeUser
-	if (type == rfbCredentialTypeUser) {
-		if (!pass && !user) {
-			return NULL;
-		} else {
-			rfbCredential *rc = (rfbCredential *) calloc(sizeof(rfbCredential), 1);
-			rc->userCredential.username = (user ? strdup(user) : NULL);
-			rc->userCredential.password = (pass ? strdup(pass) : NULL);
-			return rc;
-		}
-	}
-#endif
-	if (type == rfbCredentialTypeX509) {
-if (db) fprintf(stderr, "cert: %s\n", cert);
-if (db) fprintf(stderr, "ccrl: %s\n", ccrl);
-if (db) fprintf(stderr, "clic: %s\n", clic);
-if (db) fprintf(stderr, "clik: %s\n", clik);
-		if (!cert && !ccrl && !clic && !clik) {
-			return NULL;
-		} else {
-			rfbCredential *rc = (rfbCredential *) calloc(sizeof(rfbCredential), 1);
-			rc->x509Credential.x509CACertFile     = (cert ? strdup(cert) : NULL);
-			rc->x509Credential.x509CACrlFile      = (ccrl ? strdup(ccrl) : NULL);
-			rc->x509Credential.x509ClientCertFile = (clic ? strdup(clic) : NULL);
-			rc->x509Credential.x509ClientKeyFile  = (clik ? strdup(clik) : NULL);
-			return rc;
-		}
-	}
-	return NULL;
-}
-#endif
-
-static char* vnc_reflect_get_password(rfbClient* client) {
-	char *q, *p, *str = getenv("X11VNC_REFLECT_PASSWORD");
-	int len = 110;
-
-	if (client) {}
-
-	if (str) {
-		len += 2*strlen(str);	
-	}
-	p = (char *) calloc(len, 1);
-	if (!str || strlen(str) == 0) {
-		fprintf(stderr, "VNC Reflect Password: ");
-		fgets(p, 100, stdin);
-	} else {
-		if (strstr(str, "file:") == str) {
-			FILE *f = fopen(str + strlen("file:"), "r");
-			if (f) {
-				fgets(p, 100, f);
-				fclose(f);
-			}
-		}
-		if (p[0] == '\0') {
-			strncpy(p, str, 100);
-		}
-	}
-	q = p;
-	while (*q != '\0') {
-		if (*q == '\n') {
-			*q = '\0';
-		}
-		q++;
-	}
-	return p;
-}
-
-char *vnc_reflect_guess(char *str, char **raw_fb_addr) {
-
-	static int first = 1;
-	char *hp = str + strlen("vnc:");
-	char *at = NULL;
-	int argc = 0, i;
-	char *argv[16];
-	char str2[256];
-	char *str0 = strdup(str);
-
-	if (client == NULL) {
-		int bitsPerSample = 8;
-		int samplesPerPixel = 3;
-		int bytesPerPixel = 4;
-		char *s;
-		s = getenv("X11VNC_REFLECT_bitsPerSample");
-		if (s) bitsPerSample = atoi(s);
-		s = getenv("X11VNC_REFLECT_samplesPerPixel");
-		if (s) samplesPerPixel = atoi(s);
-		s = getenv("X11VNC_REFLECT_bytesPerPixel");
-		if (s) bytesPerPixel = atoi(s);
-		rfbLog("rfbGetClient(bitsPerSample=%d, samplesPerPixel=%d, bytesPerPixel=%d)\n",
-		    bitsPerSample, samplesPerPixel, bytesPerPixel);
-		client = rfbGetClient(bitsPerSample, samplesPerPixel, bytesPerPixel);
-	}
-
-	rfbLog("rawfb: %s\n", str);
-
-	at = strchr(hp, '@');
-	if (at) {
-		*at = '\0';
-		at++;
-	}
-
-	/* Tobias Doerffel, 2010/10 */
-#define USE_AS_ITALC_DEMO_SERVER
-#ifdef USE_AS_ITALC_DEMO_SERVER
-	client->appData.encodingsString = "raw";
-#endif
-	client->appData.useRemoteCursor = TRUE;
-	client->canHandleNewFBSize = TRUE;
-
-	client->HandleCursorPos = vnc_reflect_cursor_pos;
-	client->GotFrameBufferUpdate = vnc_reflect_got_update;
-	client->MallocFrameBuffer = vnc_reflect_resize;
-	client->Bell = vnc_reflect_bell;
-#if 0
-	client->SoftCursorLockArea = NULL;
-	client->SoftCursorUnlockScreen = NULL;
-	client->FinishedFrameBufferUpdate = NULL;
-	client->HandleKeyboardLedState = NULL;
-	client->HandleTextChat = NULL;
-#endif
-	client->GotXCutText = vnc_reflect_recv_cuttext;
-	client->GotCursorShape = vnc_reflect_got_cursorshape;
-	client->GotCopyRect = vnc_reflect_got_copyrect;
-
-	if (getenv("X11VNC_REFLECT_PASSWORD")) {
-		client->GetPassword = vnc_reflect_get_password;
-	}
-#ifdef rfbCredentialTypeX509
-	client->GetCredential = NULL;
-	if (0 || getenv("LIBVNCCLIENT_GET_CREDENTIAL")) {
-		client->GetCredential = vnc_reflect_get_credential;
-	}
-#endif
-
-	if (first) {
-		argv[argc++] = "x11vnc_rawfb_vnc";
-		if (strstr(hp, "listen") == hp) {
-			char *q = strrchr(hp, ':');
-			argv[argc++] = strdup("-listen");
-			if (q) {
-				client->listenPort = atoi(q+1);
-			} else {
-				client->listenPort = LISTEN_PORT_OFFSET;
-			}
-		} else {
-			argv[argc++] = strdup(hp);
-		}
-
-		if (! rfbInitClient(client, &argc, argv)) {
-			rfbLog("vnc_reflector failed for: %s\n", str0);
-			clean_up_exit(1);
-		}
-	}
-
-	if (at) {
-		sprintf(str2, "map:/dev/null@%s", at);
-	} else {
-		unsigned long red_mask, green_mask, blue_mask;
-		red_mask   = (client->format.redMax   << client->format.redShift);
-		green_mask = (client->format.greenMax << client->format.greenShift);
-		blue_mask  = (client->format.blueMax  << client->format.blueShift);
-		sprintf(str2, "map:/dev/null@%dx%dx%d:0x%lx/0x%lx/0x%lx",
-		    client->width, client->height, client->format.bitsPerPixel,
-		    red_mask, green_mask, blue_mask);
-	}
-	*raw_fb_addr = (char *) client->frameBuffer;
-	free(str0);
-
-	if (first) {
-		setup_cursors_and_push();
-
-		for (i=0; i<10; i++) {
-			vnc_reflect_process_client();
-		}
-	}
-	first = 0;
-
-	return strdup(str2);
-}
-
-rfbBool vnc_reflect_send_pointer(int x, int y, int mask) {
-	int rc;
-	if (mask >= 0) {
-		got_user_input++;
-		got_pointer_input++;
-		last_pointer_time = time(NULL);
-	}
-
-	if (clipshift) {
-		x += coff_x;
-		y += coff_y;
-	}
-
-	if (cursor_x != x || cursor_y != y) {
-		last_pointer_motion_time = dnow();
-	}
-
-	cursor_x = x;
-	cursor_y = y;
-
-	/* record the x, y position for the rfb screen as well. */
-	cursor_position(x, y);
-
-	/* change the cursor shape if necessary */
-	rc = set_cursor(x, y, get_which_cursor());
-	cursor_changes += rc;
-
-	return SendPointerEvent(client, x, y, mask);
-}
-
-rfbBool vnc_reflect_send_key(uint32_t key, rfbBool down) {
-	return SendKeyEvent(client, key, down);
-}
-
-rfbBool vnc_reflect_send_cuttext(char *str, int len) {
-	return SendClientCutText(client, str, len);
-}
-
-void vnc_reflect_process_client(void) {
-	int num;
-	if (client == NULL) {
-		return;
-	}
-	num = WaitForMessage(client, 1000);
-	if (num > 0) {
-		if (!HandleRFBServerMessage(client)) {
-			rfbLog("vnc_reflect_process_client: read failure to server\n");
-			shut_down = 1;
-		}
-	}
-}
-
-void linux_dev_fb_msg(char* q) {
-#ifndef WIN32
-	if (strstr(q, "/dev/fb") && strstr(UT.sysname, "Linux")) {
-		rfbLog("\n");
-		rfbLog("On Linux you may need to load a kernel module to enable\n");
-		rfbLog("the framebuffer device /dev/fb*; e.g.:\n");
-		rfbLog("   vga=0x303 (and others) kernel boot parameter\n");
-		rfbLog("   modprobe uvesafb\n");
-		rfbLog("   modprobe radeonfb (card specific)\n");
-		rfbLog("   modprobe nvidiafb (card specific, others)\n");
-		rfbLog("   modprobe vesafb (?)\n");
-		rfbLog("   modprobe vga16fb\n");
-		rfbLog("\n");
-		rfbLog("You may also need root permission to open /dev/fb*\n");
-		rfbLog("and/or /dev/tty*.\n");
-		rfbLog("\n");
-	}
-#endif
-}
-
-#define RAWFB_MMAP 1
-#define RAWFB_FILE 2
-#define RAWFB_SHM  3
-
-XImage *initialize_raw_fb(int reset) {
-	char *str, *rstr, *q;
-	int w, h, b, shmid = 0;
-	unsigned long rm = 0, gm = 0, bm = 0, tm;
-	static XImage ximage_struct;	/* n.b.: not (XImage *) */
-	static XImage ximage_struct_snap;
-	int closedpy = 1, i, m, db = 0;
-	int do_macosx = 0;
-	int do_reflect = 0;
-	char *unlink_me = NULL;
-
-	static char *last_file = NULL;
-	static int last_mode = 0;
-
-	if (reset && last_mode) {
-		int fd;
-		if (last_mode != RAWFB_MMAP && last_mode != RAWFB_FILE) {
-			return NULL;
-		}
-#if LIBVNCSERVER_HAVE_MMAP
-		if (last_mode == RAWFB_MMAP) {
-			munmap(raw_fb_addr, raw_fb_mmap);
-		}
-#endif
-		if (raw_fb_fd >= 0) {
-			close(raw_fb_fd);
-		}
-		raw_fb_fd = -1;
-if (db) fprintf(stderr, "initialize_raw_fb reset\n");
-			
-		fd = -1;
-		if (rawfb_dev_video) {
-			fd = open(last_file, O_RDWR);
-		}
-		if (fd < 0) {
-			fd = open(last_file, O_RDONLY);
-		}
-		if (fd < 0) {
-			rfbLogEnable(1);
-			rfbLog("failed to rawfb file: %s\n", last_file);
-			rfbLogPerror("open");
-			clean_up_exit(1);
-		}
-		raw_fb_fd = fd;
-#if LIBVNCSERVER_HAVE_MMAP
-		if (last_mode == RAWFB_MMAP) {
-			raw_fb_addr = mmap(0, raw_fb_mmap, PROT_READ,
-			    MAP_SHARED, fd, 0);
-
-			if (raw_fb_addr == MAP_FAILED || raw_fb_addr == NULL) {
-				rfbLogEnable(1);
-				rfbLog("failed to mmap file: %s\n", last_file);
-				rfbLog("   raw_fb_addr: %p\n", raw_fb_addr);
-				rfbLogPerror("mmap");
-				clean_up_exit(1);
-			}
-		}
-#endif
-		return NULL;
-	}
-
-#ifdef MACOSX
-	if (raw_fb_addr != NULL && macosx_console && raw_fb_addr == macosx_get_fb_addr()) {
-		raw_fb_addr = NULL;
-	}
-#endif
-
-	if (raw_fb_addr || raw_fb_seek) {
-		if (raw_fb_shm) {
-#if LIBVNCSERVER_HAVE_XSHM || LIBVNCSERVER_HAVE_SHMAT
-			shmdt(raw_fb_addr);
-#endif
-#if LIBVNCSERVER_HAVE_MMAP
-		} else if (raw_fb_mmap) {
-			munmap(raw_fb_addr, raw_fb_mmap);
-			if (raw_fb_fd >= 0) {
-				close(raw_fb_fd);
-			}
-			raw_fb_fd = -1;
-#endif
-		} else if (raw_fb_seek) {
-			if (raw_fb_fd >= 0) {
-				close(raw_fb_fd);
-			}
-			raw_fb_fd = -1;
-		}
-		raw_fb_addr = NULL;
-		raw_fb_mmap = 0;
-		raw_fb_seek = 0;
-	}
-	if (! raw_fb_str) {
-		return NULL;
-	}
-
-	if (raw_fb_str[0] == '+') {
-		rstr = strdup(raw_fb_str+1);
-		closedpy = 0;
-		if (! window) {
-			window = rootwin;
-		}
-	} else {
-		rstr = strdup(raw_fb_str);
-	}
-
-	/* testing aliases */
-	if (!strcasecmp(rstr, "NULL") || !strcasecmp(rstr, "ZERO")
-	    || !strcasecmp(rstr, "NONE")) {
-		rstr = strdup("map:/dev/zero at 640x480x32");
-	} else if (!strcasecmp(rstr, "NULLBIG") || !strcasecmp(rstr, "NONEBIG")) {
-		rstr = strdup("map:/dev/zero at 1024x768x32");
-	}
-	if (!strcasecmp(rstr, "RAND")) {
-		rstr = strdup("file:/dev/urandom at 128x128x16");
-	} else if (!strcasecmp(rstr, "RANDBIG")) {
-		rstr = strdup("file:/dev/urandom at 640x480x16");
-	} else if (!strcasecmp(rstr, "RANDHUGE")) {
-		rstr = strdup("file:/dev/urandom at 1024x768x16");
-	}
-	if (strstr(rstr, "solid=") == rstr) {
-		char *n = rstr + strlen("solid=");
-		char tmp[] = "/tmp/rawfb_solid.XXXXXX";
-		char str[100];
-		unsigned int vals[1024], val;
-		int x, y, fd, w = 1024, h = 768;
-		if (strstr(n, "0x")) {
-			if (sscanf(n, "0x%x", &val) != 1) {
-				val = 0;
-			}
-		}
-		if (val == 0) {
-			val = get_pixel(n);
-		}
-		if (val == 0) {
-			val = 0xFF00FF;
-		}
-		fd = mkstemp(tmp);
-		for (y = 0; y < h; y++) {
-			for (x = 0; x < w; x++) {
-				vals[x] = val;
-			}
-			write(fd, (char *)vals, 4 * w);
-		}
-		close(fd);
-		fd = open(tmp, O_WRONLY);
-		unlink_me = strdup(tmp);
-		sprintf(str, "map:%s@%dx%dx32", tmp, w, h);
-		rstr = strdup(str);
-	} else if (strstr(rstr, "swirl") == rstr) {
-		char tmp[] = "/tmp/rawfb_swirl.XXXXXX";
-		char str[100];
-		unsigned int val[1024];
-		unsigned int c1, c2, c3, c4;
-		int x, y, fd, w = 1024, h = 768;
-		fd = mkstemp(tmp);
-		for (y = 0; y < h; y++) {
-			for (x = 0; x < w; x++) {
-				c1 = 0;
-				c2 = ((x+y)*128)/(w+h);
-				c3 = (x*128)/w;
-				c4 = (y*256)/h;
-				val[x] = (c1 << 24) | (c2 << 16) | (c3 << 8) | (c4 << 0);
-			}
-			write(fd, (char *)val, 4 * w);
-		}
-		close(fd);
-		fd = open(tmp, O_WRONLY);
-		unlink_me = strdup(tmp);
-		sprintf(str, "map:%s@%dx%dx32", tmp, w, h);
-		rstr = strdup(str);
-	}
-
-
-	if ( (q = strstr(rstr, "setup:")) == rstr) {
-		FILE *pipe;
-		char line[1024], *t;
-
-		set_child_info();
-		q += strlen("setup:");
-		/* rawfb-setup */
-		if (no_external_cmds || !cmd_ok("rawfb-setup")) {
-			rfbLogEnable(1);
-			rfbLog("cannot run external commands in -nocmds "
-			    "mode:\n");
-			rfbLog("   \"%s\"\n", q);
-			rfbLog("   exiting.\n");
-			clean_up_exit(1);
-		}
-		rfbLog("running command to setup rawfb: %s\n", q);
-		close_exec_fds();
-		pipe = popen(q, "r");
-		if (! pipe) {
-			rfbLogEnable(1);
-			rfbLog("popen of setup command failed.\n");
-			rfbLogPerror("popen");
-			clean_up_exit(1);
-		}
-		line[0] = '\0';
-		if (fgets(line, 1024, pipe) == NULL) {
-			rfbLogEnable(1);
-			rfbLog("read of setup command failed.\n");
-			clean_up_exit(1);
-		}
-		pclose(pipe);
-		str = strdup(line);
-		t = str;
-		while (*t != '\0') {
-			if (*t == '\n') {
-				*t = '\0';
-			}
-			t++;
-		}
-		rfbLog("setup command returned: %s\n", str);
-
-	} else {
-		str = strdup(rstr);
-	}
-
-	raw_fb_shm = 0;
-	raw_fb_mmap = 0;
-	raw_fb_seek = 0;
-	raw_fb_fd = -1;
-	raw_fb_addr = NULL;
-	raw_fb_offset = 0;
-	raw_fb_bytes_per_line = 0;
-	rawfb_vnc_reflect = 0;
-
-	last_mode = 0;
-	if (last_file) {
-		free(last_file);
-		last_file = NULL;
-	}
-	if (strstr(str, "Video") == str) {
-		if (pipeinput_str != NULL) {
-			free(pipeinput_str);
-		}
-		pipeinput_str = strdup("VID");
-		initialize_pipeinput();
-		str[0] = 'v';
-	}
-
-	if (strstr(str, "video") == str || strstr(str, "/dev/video") == str) {
-		char *str2 = v4l_guess(str, &raw_fb_fd);
-		if (str2 == NULL) {
-			rfbLog("v4l_guess failed for: %s\n", str);
-			clean_up_exit(1);
-		}
-		str = str2;
-		rfbLog("v4l_guess returned: %s\n", str);
-		rawfb_dev_video = 1;
-	} else if (strstr(str, "dev/video")) {
-		rawfb_dev_video = 1;
-	} else if (strstr(str, "console") == str || strstr(str, "fb") == str ||
-	    strstr(str, "/dev/fb") == str || strstr(str, "vt") == str) {
-		char *str2 = console_guess(str, &raw_fb_fd);
-		if (str2 == NULL) {
-			rfbLog("console_guess failed for: %s\n", str);
-			clean_up_exit(1);
-		}
-		str = str2;
-		rfbLog("console_guess returned: %s\n", str);
-	} else if (strstr(str, "vnc:") == str) {
-		char *str2 = vnc_reflect_guess(str, &raw_fb_addr);
-
-		rawfb_vnc_reflect = 1;
-		do_reflect = 1;
-
-		str = str2;
-		rfbLog("vnc_reflector set rawfb str to: %s\n", str);
-		if (pipeinput_str == NULL) {
-			pipeinput_str = strdup("VNC");
-		}
-		initialize_pipeinput();
-	}
-
-	if (closedpy && !view_only && got_noviewonly) {
-		rfbLog("not closing X DISPLAY under -noviewonly option.\n");
-		closedpy = 0;
-		if (! window) {
-			window = rootwin;
-		}
-	}
-
-	if (! raw_fb_orig_dpy && dpy) {
-		raw_fb_orig_dpy = strdup(DisplayString(dpy));
-	}
-#ifndef BOLDLY_CLOSE_DISPLAY
-#define BOLDLY_CLOSE_DISPLAY 1
-#endif
-#if BOLDLY_CLOSE_DISPLAY
-	if (closedpy) {
-		if (dpy) {
-			rfbLog("closing X DISPLAY: %s in rawfb mode.\n",
-			    DisplayString(dpy));
-			XCloseDisplay_wr(dpy);	/* yow! */
-		}
-		dpy = NULL;
-	}
-#endif
-
-	/*
-	 * -rawfb shm:163938442 at 640x480x32:ff/ff00/ff0000+3000
-	 * -rawfb map:/path/to/file at 640x480x32:ff/ff00/ff0000
-	 * -rawfb file:/path/to/file at 640x480x32:ff/ff00/ff0000
-	 */
-
-	if (raw_fb_full_str) {
-		free(raw_fb_full_str);
-	}
-	raw_fb_full_str = strdup(str);
-
-
-	/* +O offset */
-	if ((q = strrchr(str, '+')) != NULL) {
-		if (sscanf(q, "+%d", &raw_fb_offset) == 1) {
-			*q = '\0';
-		} else {
-			raw_fb_offset = 0;
-		}
-	}
-	/* :R/G/B masks */
-	if ((q = strrchr(str, ':')) != NULL) {
-		if (sscanf(q, ":%lx/%lx/%lx", &rm, &gm, &bm) == 3) {
-			*q = '\0';
-		} else if (sscanf(q, ":0x%lx/0x%lx/0x%lx", &rm, &gm, &bm)== 3) {
-			*q = '\0';
-		} else if (sscanf(q, ":%lu/%lu/%lu", &rm, &gm, &bm) == 3) {
-			*q = '\0';
-		} else {
-			rm = 0;
-			gm = 0;
-			bm = 0;
-		}
-	}
-	if ((q = strrchr(str, '@')) == NULL) {
-		rfbLogEnable(1);
-		rfbLog("invalid rawfb str: %s\n", str);
-		clean_up_exit(1);
-	}
-
-	if (strrchr(q, '-')) {
-		char *q2 = strrchr(q, '-');
-		raw_fb_bytes_per_line = atoi(q2+1);
-		*q2 = '\0';
-	}
-	/* @WxHxB */
-	if (sscanf(q, "@%dx%dx%d", &w, &h, &b) != 3) {
-		rfbLogEnable(1);
-		rfbLog("invalid rawfb str: %s\n", str);
-		clean_up_exit(1);
-	}
-	*q = '\0';
-
-	if (rm == 0 && gm == 0 && bm == 0) {
-		/* guess masks... */
-		if (b == 24 || b == 32) {
-			rm = 0xff0000;
-			gm = 0x00ff00;
-			bm = 0x0000ff;
-		} else if (b == 16) {
-			rm = 0xf800;
-			gm = 0x07e0;
-			bm = 0x001f;
-		} else if (b == 8) {
-			rm = 0x07;
-			gm = 0x38;
-			bm = 0xc0;
-		}
-	}
-	/* we can fake -flipbyteorder to some degree... */
-	if (flip_byte_order) {
-		if (b == 24 || b == 32) {
-			tm = rm;
-			rm = bm;
-			bm = tm;
-		} else if (b == 16) {
-			unsigned short s1, s2;
-			s1 = (unsigned short) rm;
-			s2 = ((0xff & s1) << 8) | ((0xff00 & s1) >> 8);
-			rm = (unsigned long) s2;
-			s1 = (unsigned short) gm;
-			s2 = ((0xff & s1) << 8) | ((0xff00 & s1) >> 8);
-			gm = (unsigned long) s2;
-			s1 = (unsigned short) bm;
-			s2 = ((0xff & s1) << 8) | ((0xff00 & s1) >> 8);
-			bm = (unsigned long) s2;
-		}
-	}
-
-	/* native fb stuff for bpp < 8 only */
-	raw_fb_native_bpp = b;
-	raw_fb_native_red_mask = rm;
-	raw_fb_native_green_mask = gm;
-	raw_fb_native_blue_mask = bm;
-	raw_fb_native_red_shift = 100;
-	raw_fb_native_green_shift = 100;
-	raw_fb_native_blue_shift = 100;
-	raw_fb_native_red_max = 1;
-	raw_fb_native_green_max = 1;
-	raw_fb_native_blue_max = 1;
-	m = 1;
-	for (i=0; i<32; i++)  {
-		if (raw_fb_native_red_mask & m) {
-			if (raw_fb_native_red_shift == 100) {
-				raw_fb_native_red_shift = i;
-			}
-			raw_fb_native_red_max *= 2;
-		}
-		if (raw_fb_native_green_mask & m) {
-			if (raw_fb_native_green_shift == 100) {
-				raw_fb_native_green_shift = i;
-			}
-			raw_fb_native_green_max *= 2;
-		}
-		if (raw_fb_native_blue_mask & m) {
-			if (raw_fb_native_blue_shift == 100) {
-				raw_fb_native_blue_shift = i;
-			}
-			raw_fb_native_blue_max *= 2;
-		}
-		m = m << 1;
-	}
-	raw_fb_native_red_max -= 1;
-	raw_fb_native_green_max -= 1;
-	raw_fb_native_blue_max -= 1;
-
-	if (b < 8) {
-		/* e.g. VGA16 */
-		rfbLog("raw_fb_native_bpp: %d 0x%02lx 0x%02lx 0x%02lx %d/%d/%d %d/%d/%d\n", raw_fb_native_bpp,
-		    raw_fb_native_red_mask, raw_fb_native_green_mask, raw_fb_native_blue_mask,
-		    raw_fb_native_red_max, raw_fb_native_green_max, raw_fb_native_blue_max,
-		    raw_fb_native_red_shift, raw_fb_native_green_shift, raw_fb_native_blue_shift);
-		raw_fb_expand_bytes = 1;
-		b = 8;
-		rm = 0x07;
-		gm = 0x38;
-		bm = 0xc0;
-	}
-	/* end of stuff for bpp < 8 */
-
-	dpy_x = wdpy_x = w;
-	dpy_y = wdpy_y = h;
-	off_x = 0;
-	off_y = 0;
-
-	if (rawfb_dev_video) {
-		if (b == 24) {
-			rfbLog("enabling -24to32 for 24bpp video\n");
-			xform24to32 = 1;
-		} else {
-			if (xform24to32) {
-				rfbLog("disabling -24to32 for 24bpp video\n");
-			}
-			xform24to32 = 0;
-		}
-	}
-
-	if (xform24to32) {
-		if (b != 24) {
-			rfbLog("warning: -24to32 mode and bpp=%d\n", b);
-		}
-		b = 32;
-	}
-	if (strstr(str, "snap:") == str) {
-		use_snapfb = 1;
-		str[0] = 'f'; str[1] = 'i'; str[2] = 'l'; str[3] = 'e';
-	}
-
-	if (strstr(str, "shm:") != str && strstr(str, "mmap:") != str &&
-	    strstr(str, "map:") != str && strstr(str, "file:") != str) {
-		/* hmmm, not following directions, see if map: applies */
-		struct stat sbuf;
-		if (stat(str, &sbuf) == 0) {
-			char *newstr;
-			int len = strlen("map:") + strlen(str) + 1;
-			rfbLog("no type prefix: %s\n", raw_fb_str);
-			rfbLog("  but file exists, so assuming: map:%s\n",
-			    raw_fb_str);
-			newstr = (char *) malloc(len);
-			strcpy(newstr, "map:");
-			strcat(newstr, str);
-			free(str);
-			str = newstr;
-		}
-	}
-
-	if (sscanf(str, "shm:%d", &shmid) == 1) {
-		/* shm:N */
-#if LIBVNCSERVER_HAVE_XSHM || LIBVNCSERVER_HAVE_SHMAT
-		raw_fb_addr = (char *) shmat(shmid, 0, SHM_RDONLY);
-		if (! raw_fb_addr) {
-			rfbLogEnable(1);
-			rfbLog("failed to attach to shm: %d, %s\n", shmid, str);
-			rfbLogPerror("shmat");
-			clean_up_exit(1);
-		}
-		raw_fb_shm = 1;
-		rfbLog("rawfb: shm: %d W: %d H: %d B: %d addr: %p\n",
-		    shmid, w, h, b, raw_fb_addr);
-		last_mode = RAWFB_SHM;
-#else
-		rfbLogEnable(1);
-		rfbLog("x11vnc was compiled without shm support.\n");
-		rfbLogPerror("shmat");
-		clean_up_exit(1);
-#endif
-	} else if (strstr(str, "map:") == str || strstr(str, "mmap:") == str
-	    || strstr(str, "file:") == str) {
-		/* map:/path/... or file:/path  */
-		int fd, do_mmap = 1, size;
-		struct stat sbuf;
-
-		if (*str == 'f') {
-			do_mmap = 0;
-		}
-		q = strchr(str, ':');
-		q++;
-
-		macosx_console = 0;
-		if (strstr(q, "macosx:") == q) {
-			/* mmap:macosx:/dev/null at ... */
-			q += strlen("macosx:");			
-			do_macosx = 1;
-			do_mmap = 0;
-			macosx_console = 1;
-		}
-
-		last_file = strdup(q);
-
-#ifndef WIN32
-		fd = raw_fb_fd;
-		if (fd < 0 && rawfb_dev_video) {
-			fd = open(q, O_RDWR);
-		}
-		if (fd < 0) {
-			fd = open(q, O_RDONLY);
-		}
-		if (fd < 0) {
-			rfbLogEnable(1);
-			rfbLog("failed to open file: %s, %s\n", q, str);
-			rfbLogPerror("open");
-			linux_dev_fb_msg(q);
-			clean_up_exit(1);
-		}
-		raw_fb_fd = fd;
-#endif
-
-		if (raw_fb_native_bpp < 8) {
-			size = w*h*raw_fb_native_bpp/8 + raw_fb_offset;
-		} else if (xform24to32) {
-			size = w*h*24/8 + raw_fb_offset;
-		} else {
-			size = w*h*b/8 + raw_fb_offset;
-		}
-		if (fstat(fd, &sbuf) == 0) {
-			if (S_ISREG(sbuf.st_mode)) {
-				if (0) size = sbuf.st_size;
-			} else {
-				rfbLog("raw fb is non-regular file: %s\n", q);
-			}
-		}
-
-		if (do_macosx) {
-			raw_fb_addr = macosx_get_fb_addr();
-			raw_fb_mmap = size;
-			rfbLog("rawfb: macosx fb: %s\n", q);
-			rfbLog("   w: %d h: %d b: %d addr: %p sz: %d\n", w, h,
-			    b, raw_fb_addr, size);
-			last_mode = 0;
-		} else if (do_reflect) {
-			raw_fb_mmap = size;
-			rfbLog("rawfb: vnc fb: %s\n", q);
-			rfbLog("   w: %d h: %d b: %d addr: %p sz: %d\n", w, h,
-			    b, raw_fb_addr, size);
-			last_mode = 0;
-
-		} else if (do_mmap) {
-#if LIBVNCSERVER_HAVE_MMAP
-			raw_fb_addr = mmap(0, size, PROT_READ, MAP_SHARED,
-			    fd, 0);
-
-			if (raw_fb_addr == MAP_FAILED || raw_fb_addr == NULL) {
-				rfbLogEnable(1);
-				rfbLog("failed to mmap file: %s, %s\n", q, str);
-				rfbLog("   raw_fb_addr: %p\n", raw_fb_addr);
-				rfbLogPerror("mmap");
-
-				raw_fb_addr = NULL;
-				rfbLog("mmap(2) failed, trying slower lseek(2)\n");
-				raw_fb_seek = size;
-				last_mode = RAWFB_FILE;
-
-			} else {
-				raw_fb_mmap = size;
-
-				rfbLog("rawfb: mmap file: %s\n", q);
-				rfbLog("   w: %d h: %d b: %d addr: %p sz: %d\n", w, h,
-				    b, raw_fb_addr, size);
-				last_mode = RAWFB_MMAP;
-			}
-#else
-			rfbLog("mmap(2) not supported on system, using"
-			    " slower lseek(2)\n");
-			raw_fb_seek = size;
-			last_mode = RAWFB_FILE;
-#endif
-		} else {
-			raw_fb_seek = size;
-			last_mode = RAWFB_FILE;
-
-			rfbLog("rawfb: seek file: %s\n", q);
-			rfbLog("   W: %d H: %d B: %d sz: %d\n", w, h, b, size);
-		}
-	} else {
-		rfbLogEnable(1);
-		rfbLog("invalid rawfb str: %s\n", str);
-		clean_up_exit(1);
-	}
-
-	if (unlink_me) {
-		unlink(unlink_me);
-	}
-
-	if (! raw_fb_image) {
-		raw_fb_image = &ximage_struct;
-	}
-
-	initialize_clipshift();
-
-	if (raw_fb_bytes_per_line == 0) {
-		raw_fb_bytes_per_line = dpy_x*b/8;
-
-		/*
-		 * Put cases here were we can determine that
-		 * raw_bytes_per_line != dpy_x*b/8
-		 */
-#ifdef MACOSX
-		if (do_macosx) {
-			raw_fb_bytes_per_line = macosxCG_CGDisplayBytesPerRow();
-		}
-#endif
-	}
-
-	raw_fb_image->bytes_per_line = dpy_x * b/8;
-	raw_fb = (char *) malloc(dpy_y * dpy_x * b/8);
-	raw_fb_image->data = raw_fb;
-	raw_fb_image->format = ZPixmap;
-	raw_fb_image->width  = dpy_x;
-	raw_fb_image->height = dpy_y;
-	raw_fb_image->bits_per_pixel = b;
-	raw_fb_image->bitmap_unit = -1;
-
-
-	if (use_snapfb && (raw_fb_seek || raw_fb_mmap)) {
-		int b_use = b;
-		if (snap_fb) {
-			free(snap_fb);
-		}
-		if (b_use == 32 && xform24to32) {
-			/*
-			 * The actual framebuffer (e.g. mapped addr) and
-			 * snap fb must be the same bpp.  E.g. both 24bpp.
-			 * Reading FROM snap to utility image will be
-			 * transformed 24->32 in copy_raw_fb_24_to_32.
-			 *
-			 * addr -> snap -> (scanline, fullscreen, ...)
-			 */
-			b_use = 24;
-			raw_fb_bytes_per_line = dpy_x * b_use/8;
-		}
-		snap_fb = (char *) malloc(dpy_y * dpy_x * b_use/8);
-		snap = &ximage_struct_snap;
-		snap->data = snap_fb;
-		snap->format = ZPixmap;
-		snap->width  = dpy_x;
-		snap->height = dpy_y;
-		snap->bits_per_pixel = b_use;
-		snap->bytes_per_line = dpy_x * b_use/8;
-		snap->bitmap_unit = -1;
-	}
-
-
-	raw_fb_image->red_mask = rm;
-	raw_fb_image->green_mask = gm;
-	raw_fb_image->blue_mask = bm;
-
-	raw_fb_image->depth = 0;
-	m = 1;
-	for (i=0; i<32; i++)  {
-		if (rm & m) {
-			raw_fb_image->depth++;
-		}
-		if (gm & m) {
-			raw_fb_image->depth++;
-		}
-		if (bm & m) {
-			raw_fb_image->depth++;
-		}
-		m = m << 1;
-	}
-	if (raw_fb_native_bpp < 8) {
-		raw_fb_image->depth = raw_fb_expand_bytes * 8;
-	}
-	if (! raw_fb_image->depth) { 
-		raw_fb_image->depth = (b == 32) ? 24 : b;
-	}
-
-	depth = raw_fb_image->depth;
-
-	if (raw_fb_image->depth == 15) {
-		/* unresolved bug with RGB555... */
-		depth++;
-	}
-
-	if (clipshift || raw_fb_native_bpp < 8) {
-		memset(raw_fb, 0xff, dpy_y * raw_fb_image->bytes_per_line);
-	} else if (raw_fb_addr && ! xform24to32) {
-		memcpy(raw_fb, raw_fb_addr + raw_fb_offset, dpy_y * raw_fb_image->bytes_per_line);
-	} else {
-		memset(raw_fb, 0xff, dpy_y * raw_fb_image->bytes_per_line);
-	}
-
-	if (verbose) {
-		rfbLog("\n");
-		rfbLog("rawfb:  raw_fb  %p\n", raw_fb);
-		rfbLog("        format  %d\n", raw_fb_image->format);
-		rfbLog("        width   %d\n", raw_fb_image->width);
-		rfbLog("        height  %d\n", raw_fb_image->height);
-		rfbLog("        bpp     %d\n", raw_fb_image->bits_per_pixel);
-		rfbLog("        depth   %d\n", raw_fb_image->depth);
-		rfbLog("        bpl     %d\n", raw_fb_image->bytes_per_line);
-		if (use_snapfb && snap_fb) {
-			rfbLog("        snap_fb %p\n", snap_fb);
-		}
-	}
-
-	free(str);
-
-	return raw_fb_image;
-}
-
-static void initialize_clipshift(void) {
-	clipshift = 0;
-	cdpy_x = cdpy_y = coff_x = coff_y = 0;
-	if (clip_str) {
-		int w, h, x, y, bad = 0;
-		if (parse_geom(clip_str, &w, &h, &x, &y, wdpy_x, wdpy_y)) {
-			if (x < 0) {
-				x = 0;
-			}
-			if (y < 0) {
-				y = 0;
-			}
-			if (x + w > wdpy_x) {
-				w = wdpy_x - x;
-			}
-			if (y + h > wdpy_y) {
-				h = wdpy_y - y;
-			}
-			if (w <= 0 || h <= 0) {
-				bad = 1;
-			}
-		} else {
-			bad = 1;
-		}
-		if (bad) {
-			rfbLog("*** ignoring invalid -clip WxH+X+Y: %s\n",
-			    clip_str); 
-		} else {
-			/* OK, change geom behind everyone's back... */
-			cdpy_x = w;
-			cdpy_y = h;
-			coff_x = x;
-			coff_y = y;
-
-			clipshift = 1;
-
-			dpy_x = cdpy_x;
-			dpy_y = cdpy_y;
-		}
-	}
-}
-
-static int wait_until_mapped(Window win) {
-#if NO_X11
-	if (!win) {}
-	return 0;
-#else
-	int ms = 50, waittime = 30;
-	time_t start = time(NULL);
-	XWindowAttributes attr;
-
-	while (1) {
-		if (! valid_window(win, NULL, 0)) {
-			if (time(NULL) > start + waittime) {
-				break;
-			}
-			usleep(ms * 1000);
-			continue;
-		}
-		if (dpy && ! XGetWindowAttributes(dpy, win, &attr)) {
-			return 0;
-		}
-		if (attr.map_state == IsViewable) {
-			return 1;
-		}
-		usleep(ms * 1000);
-	}
-	return 0;
-#endif	/* NO_X11 */
-}
-
-/*
- * initialize a fb for the X display
- */
-XImage *initialize_xdisplay_fb(void) {
-#if NO_X11
-	if (raw_fb_str) {
-		return initialize_raw_fb(0);
-	}
-	return NULL;
-#else
-	XImage *fb;
-	char *vis_str = visual_str;
-	int try = 0, subwin_tries = 3;
-	XErrorHandler old_handler = NULL;
-	int subwin_bs;
-
-	if (raw_fb_str) {
-		return initialize_raw_fb(0);
-	}
-
-	X_LOCK;
-	if (subwin) {
-		if (subwin_wait_mapped) {
-			wait_until_mapped(subwin);
-		}
-		if (!valid_window((Window) subwin, NULL, 0)) {
-			rfbLogEnable(1);
-			rfbLog("invalid sub-window: 0x%lx\n", subwin);
-			X_UNLOCK;
-			clean_up_exit(1);
-		}
-	}
-	
-	if (overlay) {
-		/* 
-		 * ideally we'd like to not have to cook up the
-		 * visual variables but rather let it all come out
-		 * of XReadScreen(), however there is no way to get
-		 * a default visual out of it, so we pretend -visual
-		 * TrueColor:NN was supplied with NN usually 24.
-		 */
-		char str[32];
-		Window twin = subwin ? subwin : rootwin;
-		XImage *xi;
-
-		xi = xreadscreen(dpy, twin, 0, 0, 8, 8, False);
-		sprintf(str, "TrueColor:%d", xi->depth);
-		if (xi->depth != 24 && ! quiet) {
-			rfbLog("warning: overlay image has depth %d "
-			    "instead of 24.\n", xi->depth);
-		}
-		XDestroyImage(xi);
-		if (visual_str != NULL && ! quiet) {
-			rfbLog("warning: replacing '-visual %s' by '%s' "
-			    "for use with -overlay\n", visual_str, str);
-		}
-		vis_str = strdup(str);
-	}
-
-	if (xform24to32) {
-		if (DefaultDepth(dpy, scr) == 24) {
-			vis_str = strdup("TrueColor:32");
-			rfbLog("initialize_xdisplay_fb: vis_str set to: %s\n",
-			    vis_str);
-			visual_id = (VisualID) 0;
-			visual_depth = 0;
-			set_visual_str_to_something = 1;
-		}
-	} else if (DefaultDepth(dpy, scr) < 8) {
-		/* check very low bpp case, e.g. mono or vga16 */
-		Screen *s = DefaultScreenOfDisplay(dpy);
-		XImage *xi = XGetImage_wr(dpy, DefaultRootWindow(dpy), 0, 0, 2, 2, AllPlanes,
-		    ZPixmap);
-		if (xi && xi->bits_per_pixel < 8) {
-			int lowbpp = xi->bits_per_pixel; 
-			if (!vis_str) {
-				char tmp[32];
-				sprintf(tmp, "0x%x:8", (int) s->root_visual->visualid);
-				vis_str = strdup(tmp);
-				rfbLog("initialize_xdisplay_fb: low bpp[%d], vis_str "
-				    "set to: %s\n", lowbpp, vis_str);
-			}
-			if (using_shm) {
-				using_shm = 0;
-				rfbLog("initialize_xdisplay_fb: low bpp[%d], "
-				    "disabling shm\n", lowbpp);
-			}
-			visual_id = (VisualID) 0;
-			visual_depth = 0;
-			set_visual_str_to_something = 1;
-		}
-		if (xi) {
-			XDestroyImage(xi);
-		}
-	}
-
-	if (vis_str != NULL) {
-		set_visual(vis_str);
-		if (vis_str != visual_str) {
-			free(vis_str);
-		}
-	}
-if (0) fprintf(stderr, "vis_str %s\n", vis_str ? vis_str : "notset");
-
-	/* set up parameters for subwin or non-subwin cases: */
-
-	again:
-
-	if (! subwin) {
-		/* full screen */
-		window = rootwin;
-		dpy_x = wdpy_x = DisplayWidth(dpy, scr);
-		dpy_y = wdpy_y = DisplayHeight(dpy, scr);
-		off_x = 0;
-		off_y = 0;
-		/* this may be overridden via visual_id below */
-		default_visual = DefaultVisual(dpy, scr);
-	} else {
-		/* single window */
-		XWindowAttributes attr;
-
-		window = (Window) subwin;
-		if (! XGetWindowAttributes(dpy, window, &attr)) {
-			rfbLogEnable(1);
-			rfbLog("invalid window: 0x%lx\n", window);
-			X_UNLOCK;
-			clean_up_exit(1);
-		}
-		dpy_x = wdpy_x = attr.width;
-		dpy_y = wdpy_y = attr.height;
-
-		subwin_bs = attr.backing_store;
-
-		/* this may be overridden via visual_id below */
-		default_visual = attr.visual;
-
-		X_UNLOCK;
-		set_offset();
-		X_LOCK;
-	}
-
-	initialize_clipshift();
-
-	/* initialize depth to reasonable value, visual_id may override */
-	depth = DefaultDepth(dpy, scr);
-
-if (0) fprintf(stderr, "DefaultDepth: %d  visial_id: %d\n", depth, (int) visual_id);
-
-	if (visual_id) {
-		int n;
-		XVisualInfo vinfo_tmpl, *vinfo;
-
-		/*
-		 * we are in here from -visual or -overlay options
-		 * visual_id and visual_depth were set in set_visual().
-		 */
-
-		vinfo_tmpl.visualid = visual_id; 
-		vinfo = XGetVisualInfo(dpy, VisualIDMask, &vinfo_tmpl, &n);
-		if (vinfo == NULL || n == 0) {
-			rfbLogEnable(1);
-			rfbLog("could not match visual_id: 0x%x\n",
-			    (int) visual_id);
-			X_UNLOCK;
-			clean_up_exit(1);
-		}
-		default_visual = vinfo->visual;
-		depth = vinfo->depth;
-		if (visual_depth) {
-			/* force it from -visual MooColor:NN */
-			depth = visual_depth;
-		}
-		if (! quiet) {
-			fprintf(stderr, " initialize_xdisplay_fb()\n");
-			fprintf(stderr, " Visual*:    %p\n",
-			    (void *) vinfo->visual);
-			fprintf(stderr, " visualid:   0x%x\n",
-			    (int) vinfo->visualid);
-			fprintf(stderr, " screen:     %d\n", vinfo->screen);
-			fprintf(stderr, " depth:      %d\n", vinfo->depth);
-			fprintf(stderr, " class:      %d\n", vinfo->class);
-			fprintf(stderr, " red_mask:   0x%08lx  %s\n",
-			    vinfo->red_mask, bitprint(vinfo->red_mask, 32));
-			fprintf(stderr, " green_mask: 0x%08lx  %s\n",
-			    vinfo->green_mask, bitprint(vinfo->green_mask, 32));
-			fprintf(stderr, " blue_mask:  0x%08lx  %s\n",
-			    vinfo->blue_mask, bitprint(vinfo->blue_mask, 32));
-			fprintf(stderr, " cmap_size:  %d\n",
-			    vinfo->colormap_size);
-			fprintf(stderr, " bits b/rgb: %d\n",
-			    vinfo->bits_per_rgb);
-			fprintf(stderr, "\n");
-		}
-		XFree_wr(vinfo);
-	}
-
-	if (! quiet) {
-		rfbLog("Default visual ID: 0x%x\n",
-		    (int) XVisualIDFromVisual(default_visual));
-	}
-
-	if (subwin) {
-		int shift = 0, resize = 0;
-		int subwin_x, subwin_y;
-		int disp_x = DisplayWidth(dpy, scr);
-		int disp_y = DisplayHeight(dpy, scr);
-		Window twin;
-		/* subwins can be a dicey if they are changing size... */
-		trapped_xerror = 0;
-		old_handler = XSetErrorHandler(trap_xerror);	/* reset in if(subwin) block below */
-		XTranslateCoordinates(dpy, window, rootwin, 0, 0, &subwin_x,
-		    &subwin_y, &twin);
-
-		if (wdpy_x > disp_x) {
-			resize = 1;
-			dpy_x = wdpy_x = disp_x - 4;
-		}
-		if (wdpy_y > disp_y) {
-			resize = 1;
-			dpy_y = wdpy_y = disp_y - 4;
-		}
-
-		if (subwin_x + wdpy_x > disp_x) {
-			shift = 1;
-			subwin_x = disp_x - wdpy_x - 3;
-		}
-		if (subwin_y + wdpy_y > disp_y) {
-			shift = 1;
-			subwin_y = disp_y - wdpy_y - 3;
-		}
-		if (subwin_x < 0) {
-			shift = 1;
-			subwin_x = 1;
-		}
-		if (subwin_y < 0) {
-			shift = 1;
-			subwin_y = 1;
-		}
-
-		if (resize) {
-			XResizeWindow(dpy, window, wdpy_x, wdpy_y);
-		}
-		if (shift) {
-			XMoveWindow(dpy, window, subwin_x, subwin_y);
-			off_x = subwin_x;
-			off_y = subwin_y;
-		}
-		XMapRaised(dpy, window);
-		XRaiseWindow(dpy, window);
-		XSync(dpy, False);
-	}
-	try++;
-
-	if (nofb) {
-		/* 
-		 * For -nofb we do not allocate the framebuffer, so we
-		 * can save a few MB of memory. 
-		 */
-		fb = XCreateImage_wr(dpy, default_visual, depth, ZPixmap,
-		    0, NULL, dpy_x, dpy_y, BitmapPad(dpy), 0);
-
-	} else if (visual_id) {
-		/*
-		 * we need to call XCreateImage to supply the visual
-		 */
-		fb = XCreateImage_wr(dpy, default_visual, depth, ZPixmap,
-		    0, NULL, dpy_x, dpy_y, BitmapPad(dpy), 0);
-		if (fb) {
-			fb->data = (char *) malloc(fb->bytes_per_line * fb->height);
-		}
-
-	} else {
-		fb = XGetImage_wr(dpy, window, 0, 0, dpy_x, dpy_y, AllPlanes,
-		    ZPixmap);
-		if (! quiet) {
-			rfbLog("Read initial data from X display into"
-			    " framebuffer.\n");
-		}
-	}
-
-	if (subwin) {
-		XSetErrorHandler(old_handler);
-		if (trapped_xerror || fb == NULL) {
-		    rfbLog("trapped GetImage at SUBWIN creation.\n");
-		    if (try < subwin_tries) {
-			usleep(250 * 1000);
-			if (!get_window_size(window, &wdpy_x, &wdpy_y)) {
-				rfbLogEnable(1);
-				rfbLog("could not get size of subwin "
-				    "0x%lx\n", subwin);
-				X_UNLOCK;
-				clean_up_exit(1);
-			}
-			goto again;
-		    }
-		}
-		trapped_xerror = 0;
-
-	} else if (fb == NULL) {
-		XEvent xev;
-		rfbLog("initialize_xdisplay_fb: *** fb creation failed: 0x%x try: %d\n", fb, try);
-#if LIBVNCSERVER_HAVE_LIBXRANDR
-		if (xrandr_present && xrandr_base_event_type) {
-			int cnt = 0;
-			while (XCheckTypedEvent(dpy, xrandr_base_event_type + RRScreenChangeNotify, &xev)) {
-				XRRScreenChangeNotifyEvent *rev;
-				rev = (XRRScreenChangeNotifyEvent *) &xev;
-
-				rfbLog("initialize_xdisplay_fb: XRANDR event while redoing fb[%d]:\n", cnt++);
-				rfbLog("  serial:          %d\n", (int) rev->serial);
-				rfbLog("  timestamp:       %d\n", (int) rev->timestamp);
-				rfbLog("  cfg_timestamp:   %d\n", (int) rev->config_timestamp);
-				rfbLog("  size_id:         %d\n", (int) rev->size_index);
-				rfbLog("  sub_pixel:       %d\n", (int) rev->subpixel_order);
-				rfbLog("  rotation:        %d\n", (int) rev->rotation);
-				rfbLog("  width:           %d\n", (int) rev->width);
-				rfbLog("  height:          %d\n", (int) rev->height);
-				rfbLog("  mwidth:          %d mm\n", (int) rev->mwidth);
-				rfbLog("  mheight:         %d mm\n", (int) rev->mheight);
-				rfbLog("\n");
-				rfbLog("previous WxH: %dx%d\n", wdpy_x, wdpy_y);
-
-				xrandr_width  = rev->width;
-				xrandr_height = rev->height;
-				xrandr_timestamp = rev->timestamp;
-				xrandr_cfg_time  = rev->config_timestamp;
-				xrandr_rotation = (int) rev->rotation;
-
-				rfbLog("initialize_xdisplay_fb: updating XRANDR config...\n");
-				XRRUpdateConfiguration(&xev);
-			}
-		}
-#endif
-		if (try < 5)  {
-			XFlush_wr(dpy);
-			usleep(250 * 1000);
-			if (try < 3) {
-				XSync(dpy, False);
-			} else if (try >= 3) {
-				XSync(dpy, True);
-			}
-			goto again;
-		}
-	}
-	if (use_snapfb) {
-		initialize_snap_fb();
-	}
-
-	X_UNLOCK;
-
-	if (fb->bits_per_pixel == 24 && ! quiet) {
-		rfbLog("warning: 24 bpp may have poor performance.\n");
-	}
-	return fb;
-#endif	/* NO_X11 */
-}
-
-void parse_scale_string(char *str, double *factor_x, double *factor_y, int *scaling, int *blend,
-    int *nomult4, int *pad, int *interpolate, int *numer, int *denom, int w_in, int h_in) {
-
-	int m, n;
-	char *p, *tstr;
-	double f, f2;
-
-	*factor_x = 1.0;
-	*factor_y = 1.0;
-	*scaling = 0;
-	*blend = 1;
-	*nomult4 = 0;
-	*pad = 0;
-	*interpolate = 0;
-	*numer = 0, *denom = 0;
-
-	if (str == NULL || str[0] == '\0') {
-		return;
-	}
-	tstr = strdup(str);
-	
-	if ( (p = strchr(tstr, ':')) != NULL) {
-		/* options */
-		if (strstr(p+1, "nb") != NULL) {
-			*blend = 0;
-		}
-		if (strstr(p+1, "fb") != NULL) {
-			*blend = 2;
-		}
-		if (strstr(p+1, "n4") != NULL) {
-			*nomult4 = 1;
-		}
-		if (strstr(p+1, "in") != NULL) {
-			*interpolate = 1;
-		}
-		if (strstr(p+1, "pad") != NULL) {
-			*pad = 1;
-		}
-		if (strstr(p+1, "nocr") != NULL) {
-			/* global */
-			scaling_copyrect = 0;
-		} else if (strstr(p+1, "cr") != NULL) {
-			/* global */
-			scaling_copyrect = 1;
-		}
-		*p = '\0';
-	}
-
-	if (strchr(tstr, '.') != NULL) {
-		double test, diff, eps = 1.0e-7;
-		if (sscanf(tstr, "%lfx%lf", &f, &f2) == 2) {
-			*factor_x = (double) f;
-			*factor_y = (double) f2;
-		} else if (sscanf(tstr, "%lf", &f) != 1) {
-			rfbLogEnable(1);
-			rfbLog("invalid -scale arg: %s\n", tstr);
-			clean_up_exit(1);
-		} else {
-			*factor_x = (double) f;
-			*factor_y = (double) f;
-		}
-		/* look for common fractions from small ints: */
-		if (*factor_x == *factor_y) {
-			for (n=2; n<=10; n++) {
-				for (m=1; m<n; m++) {
-					test = ((double) m)/ n;
-					diff = *factor_x - test;
-					if (-eps < diff && diff < eps) {
-						*numer = m;
-						*denom = n;
-						break;
-					
-					}
-				}
-				if (*denom) {
-					break;
-				}
-			}
-			if (*factor_x < 0.01) {
-				rfbLogEnable(1);
-				rfbLog("-scale factor too small: %f\n", *factor_x);
-				clean_up_exit(1);
-			}
-		}
-	} else if (sscanf(tstr, "%dx%d", &m, &n) == 2 && w_in > 0 && h_in > 0) {
-		*factor_x = ((double) m) / ((double) w_in);
-		*factor_y = ((double) n) / ((double) h_in);
-	} else {
-		if (sscanf(tstr, "%d/%d", &m, &n) != 2) {
-			if (sscanf(tstr, "%d", &m) != 1) {
-				rfbLogEnable(1);
-				rfbLog("invalid -scale arg: %s\n", tstr);
-				clean_up_exit(1);
-			} else {
-				/* e.g. -scale 1 or -scale 2 */
-				n = 1;
-			}
-		}
-		if (n <= 0 || m <=0) {
-			rfbLogEnable(1);
-			rfbLog("invalid -scale arg: %s\n", tstr);
-			clean_up_exit(1);
-		}
-		*factor_x = ((double) m)/ n;
-		*factor_y = ((double) m)/ n;
-		if (*factor_x < 0.01) {
-			rfbLogEnable(1);
-			rfbLog("-scale factor too small: %f\n", *factor_x);
-			clean_up_exit(1);
-		}
-		*numer = m;
-		*denom = n;
-	}
-	if (*factor_x == 1.0 && *factor_y == 1.0) {
-		if (! quiet) {
-			rfbLog("scaling disabled for factor %f %f\n", *factor_x, *factor_y);
-		}
-	} else {
-		*scaling = 1;
-	}
-	free(tstr);
-}
-
-int parse_rotate_string(char *str, int *mode) {
-	int m = ROTATE_NONE;
-	if (str == NULL || !strcmp(str, "") || !strcmp(str, "0")) {
-		m = ROTATE_NONE;
-	} else if (!strcmp(str, "x")) {
-		m = ROTATE_X;
-	} else if (!strcmp(str, "y")) {
-		m = ROTATE_Y;
-	} else if (!strcmp(str, "xy") || !strcmp(str, "yx") ||
-	    !strcmp(str,"+180") || !strcmp(str,"-180") || !strcmp(str,"180")) {
-		m = ROTATE_XY;
-	} else if (!strcmp(str, "+90") || !strcmp(str, "90")) {
-		m = ROTATE_90;
-	} else if (!strcmp(str, "+90x") || !strcmp(str, "90x")) {
-		m = ROTATE_90X;
-	} else if (!strcmp(str, "+90y") || !strcmp(str, "90y")) {
-		m = ROTATE_90Y;
-	} else if (!strcmp(str, "-90") || !strcmp(str, "270") ||
-	    !strcmp(str, "+270")) {
-		m = ROTATE_270;
-	} else {
-		rfbLog("invalid -rotate mode: %s\n", str);
-	}
-	if (mode) {
-		*mode = m;
-	}
-	return m;
-}
-
-int scale_round(int len, double fac) {
-	double eps = 0.000001;
-	
-	len = (int) (len * fac + eps);
-	if (len < 1) {
-		len = 1;
-	}
-	return len;
-}
-
-static void setup_scaling(int *width_in, int *height_in) {
-	int width  = *width_in;
-	int height = *height_in;
-
-	parse_scale_string(scale_str, &scale_fac_x, &scale_fac_y, &scaling, &scaling_blend,
-	    &scaling_nomult4, &scaling_pad, &scaling_interpolate,
-	    &scale_numer, &scale_denom, *width_in, *height_in);
-
-	if (scaling) {
-		width  = scale_round(width,  scale_fac_x);
-		height = scale_round(height, scale_fac_y);
-		if (scale_denom && scaling_pad) {
-			/* it is not clear this padding is useful anymore */
-			rfbLog("width  %% denom: %d %% %d = %d\n", width,
-			    scale_denom, width  % scale_denom);
-			rfbLog("height %% denom: %d %% %d = %d\n", height,
-			    scale_denom, height % scale_denom);
-			if (width % scale_denom != 0) {
-				int w = width;
-				w += scale_denom - (w % scale_denom);
-				if (!scaling_nomult4 && w % 4 != 0) {
-					/* need to make mult of 4 as well */
-					int c = 0;	
-					while (w % 4 != 0 && c++ <= 5) {
-						w += scale_denom;
-					}
-				}
-				width = w;
-				rfbLog("padded width  to: %d (mult of %d%s\n",
-				    width, scale_denom, !scaling_nomult4 ?
-				    " and 4)" : ")");
-			}
-			if (height % scale_denom != 0) {
-				height += scale_denom - (height % scale_denom);
-				rfbLog("padded height to: %d (mult of %d)\n",
-				    height, scale_denom);
-			}
-		}
-		if (!scaling_nomult4 && width % 4 != 0 && width > 2) {
-			/* reset width to be multiple of 4 */
-			int width0 = width;
-			if ((width+1) % 4 == 0) {
-				width = width+1;
-			} else if ((width-1) % 4 == 0) {
-				width = width-1;
-			} else if ((width+2) % 4 == 0) {
-				width = width+2;
-			}
-			rfbLog("reset scaled width %d -> %d to be a multiple of"
-			    " 4 (to\n", width0, width);
-			rfbLog("make vncviewers happy). use -scale m/n:n4 to "
-			    "disable.\n");
-		}
-		scaled_x = width;
-		scaled_y = height;
-
-		*width_in  = width;
-		*height_in = height;
-	}
-}
-
-static void setup_rotating(void) {
-	char *rs = rotating_str;
-
-	rotating_cursors = 1;
-	if (rs && strstr(rs, "nc:") == rs) {
-		rs += strlen("nc:");
-		rotating_cursors = 0;
-	}
-
-	rotating = parse_rotate_string(rs, NULL);
-	if (! rotating) {
-		rotating_cursors = 0;
-	}
-
-	if (rotating == ROTATE_90  || rotating == ROTATE_90X ||
-	    rotating == ROTATE_90Y || rotating == ROTATE_270) {
-		rotating_same = 0;
-	} else {
-		rotating_same = 1;
-	}
-}
-
-static rfbBool set_xlate_wrapper(rfbClientPtr cl) {
-	static int first = 1;
-	if (first) {
-		first = 0;
-	} else if (ncache) {
-		int save = ncache_xrootpmap;
-		rfbLog("set_xlate_wrapper: clearing -ncache for new pixel format.\n");
-		INPUT_LOCK;
-		ncache_xrootpmap = 0;
-		check_ncache(1, 0);
-		ncache_xrootpmap = save;
-		INPUT_UNLOCK;
-	}
-	return rfbSetTranslateFunction(cl);	
-}
-
-/*
- * initialize the rfb framebuffer/screen
- */
-void initialize_screen(int *argc, char **argv, XImage *fb) {
-	int have_masks = 0;
-	int width  = fb->width;
-	int height = fb->height;
-	int create_screen = screen ? 0 : 1;
-	int bits_per_color;
-	int fb_bpp, fb_Bpl, fb_depth;
-	int locked_sends = 0;
-
-	bpp = fb->bits_per_pixel;
-
-	fb_bpp   = (int) fb->bits_per_pixel;
-	fb_Bpl   = (int) fb->bytes_per_line;
-	fb_depth = (int) fb->depth;
-
-	rfbLog("initialize_screen: fb_depth/fb_bpp/fb_Bpl %d/%d/%d\n", fb_depth,
-	    fb_bpp, fb_Bpl);
-
-	main_bytes_per_line = fb->bytes_per_line;
-
-	if (cmap8to24) {
-		if (raw_fb) {
-			if (!quiet) rfbLog("disabling -8to24 mode"
-			    " in raw_fb mode.\n");
-			cmap8to24 = 0;
-		} else if (depth == 24) {
-			if (fb_bpp != 32)  {
-				if (!quiet) rfbLog("disabling -8to24 mode:"
-				    " bpp != 32 with depth == 24\n");
-				cmap8to24 = 0;
-			}
-		} else if (depth <= 16) {
-			/* need to cook up the screen fb to be depth 24 */
-			fb_bpp = 32;
-			fb_depth = 24;
-		} else {
-			if (!quiet) rfbLog("disabling -8to24 mode:"
-			    " default depth not 16 or less\n");
-			cmap8to24 = 0;
-		}
-	}
-
-	setup_scaling(&width, &height);
-
-	if (scaling) {
-		rfbLog("scaling screen: %dx%d -> %dx%d\n", fb->width, fb->height, scaled_x, scaled_y);
-		rfbLog("scaling screen: scale_fac_x=%.5f scale_fac_y=%.5f\n", scale_fac_x, scale_fac_y);
-
-		rfb_bytes_per_line = (main_bytes_per_line / fb->width) * width;
-	} else {
-		rfb_bytes_per_line = main_bytes_per_line;
-	}
-
-	setup_rotating();
-
-	if (rotating) {
-		if (! rotating_same) {
-			int t, b = main_bytes_per_line / fb->width;
-			if (scaling) {
-				rot_bytes_per_line = b * height;
-			} else {
-				rot_bytes_per_line = b * fb->height;
-			}
-			t = width;
-			width = height;		/* The big swap... */
-			height = t;
-		} else {
-			rot_bytes_per_line = rfb_bytes_per_line;
-		}
-	}
-
-#ifndef NO_NCACHE
-	if (ncache > 0 && !nofb) {
-# ifdef MACOSX
-		if (! raw_fb_str || macosx_console) {
-# else
-		if (! raw_fb_str) {
-# endif
-			
-			char *new_fb;
-			int sz = fb->height * fb->bytes_per_line;
-			int ns = 1+ncache;
-
-			if (ncache_xrootpmap) {
-				ns++;
-			}
-
-			new_fb = (char *) calloc((size_t) (sz * ns), 1);
-			if (fb->data) {
-				memcpy(new_fb, fb->data, sz);
-				free(fb->data);
-			}
-			fb->data = new_fb;
-			fb->height *= (ns);
-			height *= (ns);
-			ncache0 = ncache;
-		}
-	}
-#endif
-
-	if (cmap8to24) {
-		if (depth <= 8) {
-			rfb_bytes_per_line *= 4;
-			rot_bytes_per_line *= 4;
-		} else if (depth <= 16) {
-			rfb_bytes_per_line *= 2;
-			rot_bytes_per_line *= 2;
-		}
-	}
-
-	/*
-	 * These are just hints wrt pixel format just to let
-	 * rfbGetScreen/rfbNewFramebuffer proceed with reasonable
-	 * defaults.  We manually set them in painful detail below.
-	 */
-	bits_per_color = guess_bits_per_color(fb_bpp);
-
-	if (lock_client_sends(-1) == 0) {
-		lock_client_sends(1);
-		locked_sends = 1;
-	}
-
-	/* n.b. samplesPerPixel (set = 1 here) seems to be unused. */
-	if (create_screen) {
-		if (use_stunnel) {
-			setup_stunnel(0, argc, argv);
-		}
-		if (use_openssl) {
-			if (use_stunnel && enc_str && !strcmp(enc_str, "none")) {
-				/* emulating HTTPS oneport */
-				;
-			} else {
-				openssl_init(0);
-			}
-		}
-		screen = rfbGetScreen(argc, argv, width, height,
-		    bits_per_color, 1, fb_bpp/8);
-		if (screen && http_dir) {
-			http_connections(1);
-		}
-		if (unix_sock) {
-			unix_sock_fd = listen_unix(unix_sock);
-		}
-	} else {
-		/* set set frameBuffer member below. */
-		rfbLog("rfbNewFramebuffer(0x%x, 0x%x, %d, %d, %d, %d, %d)\n",
-		    screen, NULL, width, height, bits_per_color, 1, fb_bpp/8);
-
-		/* these are probably overwritten, but just to be safe: */
-		screen->bitsPerPixel = fb_bpp;
-		screen->depth = fb_depth;
-
-		rfb_new_framebuffer(screen, NULL, width, height,
-		    bits_per_color, 1, (int) fb_bpp/8);
-	}
-	if (! screen) {
-		int i;
-		rfbLogEnable(1);
-		rfbLog("\n");
-		rfbLog("failed to create rfb screen.\n");
-		for (i=0; i< *argc; i++)  {
-			rfbLog("\t[%d]  %s\n", i, argv[i]);
-		}
-		clean_up_exit(1);
-	}
-
-	if (create_screen && *argc != 1) {
-		int i;
-		rfbLogEnable(1);
-		rfbLog("*** unrecognized option(s) ***\n");
-		for (i=1; i< *argc; i++)  {
-			rfbLog("\t[%d]  %s\n", i, argv[i]);
-		}
-		rfbLog("For a list of options run: x11vnc -opts\n");
-		rfbLog("or for the full help: x11vnc -help\n");
-		rfbLog("\n");
-		rfbLog("Here is a list of removed or obsolete"
-		    " options:\n");
-		rfbLog("\n");
-		rfbLog("removed: -hints, -nohints\n");
-		rfbLog("removed: -cursorposall\n");
-		rfbLog("removed: -nofilexfer, now the default.\n");
-		rfbLog("\n");
-		rfbLog("renamed: -old_copytile, use -onetile\n");
-		rfbLog("renamed: -mouse,   use -cursor\n");
-		rfbLog("renamed: -mouseX,  use -cursor X\n");
-		rfbLog("renamed: -X,       use -cursor X\n");
-		rfbLog("renamed: -nomouse, use -nocursor\n");
-		rfbLog("renamed: -old_pointer, use -pointer_mode 1\n");
-	
-		clean_up_exit(1);
-	}
-
-	/* set up format from scratch: */
-	if (rotating && ! rotating_same) {
-		screen->paddedWidthInBytes = rot_bytes_per_line;
-	} else {
-		screen->paddedWidthInBytes = rfb_bytes_per_line;
-	}
-	screen->serverFormat.bitsPerPixel = fb_bpp;
-	screen->serverFormat.depth = fb_depth;
-	screen->serverFormat.trueColour = TRUE;
-
-	screen->serverFormat.redShift   = 0;
-	screen->serverFormat.greenShift = 0;
-	screen->serverFormat.blueShift  = 0;
-	screen->serverFormat.redMax     = 0;
-	screen->serverFormat.greenMax   = 0;
-	screen->serverFormat.blueMax    = 0;
-
-	/* these main_* formats are used generally. */
-	main_red_shift   = 0;
-	main_green_shift = 0;
-	main_blue_shift  = 0;
-	main_red_max     = 0;
-	main_green_max   = 0;
-	main_blue_max    = 0;
-	main_red_mask    = fb->red_mask;
-	main_green_mask  = fb->green_mask;
-	main_blue_mask   = fb->blue_mask;
-
-	have_masks = ((fb->red_mask|fb->green_mask|fb->blue_mask) != 0);
-	if (force_indexed_color) {
-		have_masks = 0;
-	}
-
-	if (cmap8to24 && depth <= 16 && dpy) {
-		XVisualInfo vinfo;
-		vinfo.red_mask = 0;
-		vinfo.green_mask = 0;
-		vinfo.blue_mask = 0;
-		/* more cooking up... */
-		have_masks = 2;
-		/* need to fetch TrueColor visual */
-		X_LOCK;
-		if (dpy
-#if !NO_X11
-		    && XMatchVisualInfo(dpy, scr, 24, TrueColor, &vinfo)
-#endif
-		    ) {
-			main_red_mask   = vinfo.red_mask;
-			main_green_mask = vinfo.green_mask;
-			main_blue_mask  = vinfo.blue_mask;
-		} else if (fb->byte_order == LSBFirst) {
-			main_red_mask   = 0x00ff0000;
-			main_green_mask = 0x0000ff00;
-			main_blue_mask  = 0x000000ff;
-		} else {
-			main_red_mask   = 0x000000ff;
-			main_green_mask = 0x0000ff00;
-			main_blue_mask  = 0x00ff0000;
-		}
-		X_UNLOCK;
-	}
-
-	if (raw_fb_str && raw_fb_pixfmt) {
-		char *fmt = strdup(raw_fb_pixfmt);
-		uppercase(fmt);
-		if (strstr(fmt, "GREY")) {
-			set_greyscale_colormap();
-		} else if (strstr(fmt, "HI240")) {
-			set_hi240_colormap();
-		} else {
-			unset_colormap();
-		}
-		free(fmt);
-	}
-
-	if (! have_masks && screen->serverFormat.bitsPerPixel <= 16
-	    && dpy && CellsOfScreen(ScreenOfDisplay(dpy, scr))) {
-		/* indexed color. we let 1 <= bpp <= 16, but it is normally 8 */
-		if (!quiet) {
-			rfbLog("\n");
-			rfbLog("X display %s is %dbpp indexed color, depth=%d\n",
-			    DisplayString(dpy), screen->serverFormat.bitsPerPixel,
-			    screen->serverFormat.depth);
-			if (! flash_cmap && ! overlay) {
-				rfbLog("\n");
-				rfbLog("In 8bpp PseudoColor mode if you "
-				    "experience color\n");
-				rfbLog("problems you may want to enable "
-				    "following the\n");
-				rfbLog("changing colormap by using the "
-				    "-flashcmap option.\n");
-				rfbLog("\n");
-			}
-		}
-		if (screen->serverFormat.depth < 8) {
-			rfbLog("resetting serverFormat.depth %d -> 8.\n",
-			    screen->serverFormat.depth);
-			rfbLog("resetting serverFormat.bpp   %d -> 8.\n",
-			    screen->serverFormat.bitsPerPixel);
-			screen->serverFormat.depth = 8;
-			screen->serverFormat.bitsPerPixel = 8;
-		}
-		if (screen->serverFormat.depth > 8) {
-			rfbLog("WARNING: indexed color depth > 8, Tight encoding will crash.\n");
-		}
-
-		screen->serverFormat.trueColour = FALSE;
-		indexed_color = 1;
-		set_colormap(1);
-		debug_colormap(fb);
-	} else {
-		/* 
-		 * general case, we call it truecolor, but could be direct
-		 * color, static color, etc....
-		 */
-		if (! quiet) {
-			if (raw_fb) {
-				rfbLog("\n");
-				rfbLog("Raw fb at addr %p is %dbpp depth=%d "
-				    "true color\n", raw_fb_addr,
-				    fb_bpp, fb_depth);
-			} else if (! dpy) {
-				;
-			} else if (have_masks == 2) {
-				rfbLog("\n");
-				rfbLog("X display %s is %dbpp depth=%d indexed "
-				    "color (-8to24 mode)\n", DisplayString(dpy),
-				    fb->bits_per_pixel, fb->depth);
-			} else {
-				rfbLog("\n");
-				rfbLog("X display %s is %dbpp depth=%d true "
-				    "color\n", DisplayString(dpy),
-				    fb_bpp, fb_depth);
-			}
-		}
-
-		indexed_color = 0;
-
-		if (!have_masks) {
-			int M, B = bits_per_color;
-
-			if (3*B > fb_bpp) B--;
-			if (B < 1) B = 1;
-			M = (1 << B) - 1;
-
-			rfbLog("WARNING: all TrueColor RGB masks are zero!\n");
-			rfbLog("WARNING: cooking something up for VNC fb...  B=%d M=%d\n", B, M);
-			main_red_mask   = M;
-			main_green_mask = M;
-			main_blue_mask  = M;
-			main_red_mask   = main_red_mask   << (2*B);
-			main_green_mask = main_green_mask << (1*B);
-			main_blue_mask  = main_blue_mask  << (0*B);
-			fprintf(stderr, " red_mask:   0x%08lx  %s\n", main_red_mask,
-			    bitprint(main_red_mask, 32));
-			fprintf(stderr, " green_mask: 0x%08lx  %s\n", main_green_mask,
-			    bitprint(main_green_mask, 32));
-			fprintf(stderr, " blue_mask:  0x%08lx  %s\n", main_blue_mask,
-			    bitprint(main_blue_mask, 32));
-		}
-
-		/* convert masks to bit shifts and max # colors */
-		if (main_red_mask) {
-			while (! (main_red_mask
-			    & (1 << screen->serverFormat.redShift))) {
-				    screen->serverFormat.redShift++;
-			}
-		}
-		if (main_green_mask) {
-			while (! (main_green_mask
-			    & (1 << screen->serverFormat.greenShift))) {
-				    screen->serverFormat.greenShift++;
-			}
-		}
-		if (main_blue_mask) {
-			while (! (main_blue_mask
-			    & (1 << screen->serverFormat.blueShift))) {
-				    screen->serverFormat.blueShift++;
-			}
-		}
-		screen->serverFormat.redMax
-		    = main_red_mask   >> screen->serverFormat.redShift;
-		screen->serverFormat.greenMax
-		    = main_green_mask >> screen->serverFormat.greenShift;
-		screen->serverFormat.blueMax
-		    = main_blue_mask  >> screen->serverFormat.blueShift;
-
-		main_red_max     = screen->serverFormat.redMax;
-		main_green_max   = screen->serverFormat.greenMax;
-		main_blue_max    = screen->serverFormat.blueMax;
-
-		main_red_shift   = screen->serverFormat.redShift;
-		main_green_shift = screen->serverFormat.greenShift;
-		main_blue_shift  = screen->serverFormat.blueShift;
-	}
-
-#if !SMALL_FOOTPRINT
-	if (verbose) {
-		fprintf(stderr, "\n");
-		fprintf(stderr, "FrameBuffer Info:\n");
-		fprintf(stderr, " width:            %d\n", fb->width);
-		fprintf(stderr, " height:           %d\n", fb->height);
-		fprintf(stderr, " scaled_width:     %d\n", width);
-		fprintf(stderr, " scaled_height:    %d\n", height);
-		fprintf(stderr, " indexed_color:    %d\n", indexed_color);
-		fprintf(stderr, " bits_per_pixel:   %d\n", fb->bits_per_pixel);
-		fprintf(stderr, " depth:            %d\n", fb->depth);
-		fprintf(stderr, " red_mask:   0x%08lx  %s\n", fb->red_mask,
-		    bitprint(fb->red_mask, 32));
-		fprintf(stderr, " green_mask: 0x%08lx  %s\n", fb->green_mask,
-		    bitprint(fb->green_mask, 32));
-		fprintf(stderr, " blue_mask:  0x%08lx  %s\n", fb->blue_mask,
-		    bitprint(fb->blue_mask, 32));
-		if (cmap8to24) {
-			fprintf(stderr, " 8to24 info:\n");
-			fprintf(stderr, " fb_bpp:           %d\n", fb_bpp);
-			fprintf(stderr, " fb_depth:         %d\n", fb_depth);
-			fprintf(stderr, " red_mask:   0x%08lx  %s\n", main_red_mask,
-			    bitprint(main_red_mask, 32));
-			fprintf(stderr, " green_mask: 0x%08lx  %s\n", main_green_mask,
-			    bitprint(main_green_mask, 32));
-			fprintf(stderr, " blue_mask:  0x%08lx  %s\n", main_blue_mask,
-			    bitprint(main_blue_mask, 32));
-		}
-		fprintf(stderr, " red:   max: %3d  shift: %2d\n",
-			main_red_max, main_red_shift);
-		fprintf(stderr, " green: max: %3d  shift: %2d\n",
-			main_green_max, main_green_shift);
-		fprintf(stderr, " blue:  max: %3d  shift: %2d\n",
-			main_blue_max, main_blue_shift);
-		fprintf(stderr, " mainfb_bytes_per_line: %d\n",
-			main_bytes_per_line);
-		fprintf(stderr, " rfb_fb_bytes_per_line: %d\n",
-			rfb_bytes_per_line);
-		fprintf(stderr, " rot_fb_bytes_per_line: %d\n",
-			rot_bytes_per_line);
-		fprintf(stderr, " raw_fb_bytes_per_line: %d\n",
-			raw_fb_bytes_per_line);
-		switch(fb->format) {
-		case XYBitmap:
-			fprintf(stderr, " format:     XYBitmap\n"); break;
-		case XYPixmap:
-			fprintf(stderr, " format:     XYPixmap\n"); break;
-		case ZPixmap:
-			fprintf(stderr, " format:     ZPixmap\n"); break;
-		default:
-			fprintf(stderr, " format:     %d\n", fb->format); break;
-		}
-		switch(fb->byte_order) {
-		case LSBFirst:
-			fprintf(stderr, " byte_order: LSBFirst\n"); break;
-		case MSBFirst:
-			fprintf(stderr, " byte_order: MSBFirst\n"); break;
-		default:
-			fprintf(stderr, " byte_order: %d\n", fb->byte_order);
-			break;
-		}
-		fprintf(stderr, " bitmap_pad:  %d\n", fb->bitmap_pad);
-		fprintf(stderr, " bitmap_unit: %d\n", fb->bitmap_unit);
-		switch(fb->bitmap_bit_order) {
-		case LSBFirst:
-			fprintf(stderr, " bitmap_bit_order: LSBFirst\n"); break;
-		case MSBFirst:
-			fprintf(stderr, " bitmap_bit_order: MSBFirst\n"); break;
-		default:
-			fprintf(stderr, " bitmap_bit_order: %d\n",
-			fb->bitmap_bit_order); break;
-		}
-	}
-	if (overlay && ! quiet) {
-		rfbLog("\n");
-		rfbLog("Overlay mode enabled:  If you experience color\n");
-		rfbLog("problems when popup menus are on the screen, try\n");
-		rfbLog("disabling SaveUnders in your X server, one way is\n");
-		rfbLog("to start the X server with the '-su' option, e.g.:\n");
-		rfbLog("Xsun -su ... see Xserver(1), xinit(1) for more info.\n");
-		rfbLog("\n");
-	}
-#endif
-	/* nofb is for pointer/keyboard only handling.  */
-	if (nofb) {
-		main_fb = NULL;
-		rfb_fb = main_fb;
-		cmap8to24_fb = NULL;
-		rot_fb = NULL;
-		screen->displayHook = nofb_hook;
-	} else {
-		main_fb = fb->data;
-		rfb_fb = NULL;
-		cmap8to24_fb = NULL;
-		rot_fb = NULL;
-
-		if (cmap8to24) {
-			int n = main_bytes_per_line * fb->height;
-			if (depth <= 8) {
-				n *= 4;
-			} else if (depth <= 16) {
-				n *= 2;
-			}
-			cmap8to24_fb = (char *) malloc(n);
-			memset(cmap8to24_fb, 0, n);
-		}
-
-		if (rotating) {
-			int n = rot_bytes_per_line * height;
-			rot_fb = (char *) malloc(n);
-			memset(rot_fb, 0, n);
-		}
-
-		if (scaling) {
-			int n = rfb_bytes_per_line * height;
-
-			if (rotating && ! rotating_same) {
-				n = rot_bytes_per_line * height;
-			}
-
-			rfb_fb = (char *) malloc(n);
-			memset(rfb_fb, 0, n);
-
-		} else if (cmap8to24) {
-			rfb_fb = cmap8to24_fb;	
-		} else {
-			rfb_fb = main_fb;
-		}
-	}
-	if (rot_fb) {
-		screen->frameBuffer = rot_fb;
-	} else {
-		screen->frameBuffer = rfb_fb;
-	}
-	if (verbose) {
-		fprintf(stderr, " rfb_fb:      %p\n", rfb_fb);
-		fprintf(stderr, " main_fb:     %p\n", main_fb);
-		fprintf(stderr, " 8to24_fb:    %p\n", cmap8to24_fb);
-		fprintf(stderr, " rot_fb:      %p\n", rot_fb);
-		fprintf(stderr, " snap_fb:     %p\n", snap_fb);
-		fprintf(stderr, " raw_fb:      %p\n", raw_fb);
-		fprintf(stderr, " fake_fb:     %p\n", fake_fb);
-		fprintf(stderr, "\n");
-	}
-
-	/* may need, bpp, main_red_max, etc. */
-	parse_wireframe();
-	parse_scroll_copyrect();
-	setup_cursors_and_push();
-
-	if (scaling || rotating || cmap8to24) {
-		mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
-	}
-
-	if (! create_screen) {
-		rfbClientIteratorPtr iter;
-		rfbClientPtr cl;
-
-		/* 
-		 * since bits_per_color above may have been approximate,
-		 * try to reset the individual translation tables...
-		 * we do not seem to need this with rfbGetScreen()...
-		 */
-		if (!quiet) rfbLog("calling setTranslateFunction()...\n");
-		iter = rfbGetClientIterator(screen);
-		while ((cl = rfbClientIteratorNext(iter)) != NULL) {
-			screen->setTranslateFunction(cl);
-		}
-		rfbReleaseClientIterator(iter);
-		if (!quiet) rfbLog("  done.\n");
-		
-		/* done for framebuffer change case */
-		if (locked_sends) {
-			lock_client_sends(0);
-		}
-
-		do_copy_screen = 1;
-		return;
-	}
-
-	/*
-	 * the rest is screen server initialization, etc, only needed
-	 * at screen creation time.
-	 */
-
-	/* event callbacks: */
-	screen->newClientHook = new_client;
-	screen->kbdAddEvent = keyboard;
-	screen->ptrAddEvent = pointer_event;
-	screen->setXCutText = xcut_receive;
-	screen->setTranslateFunction = set_xlate_wrapper;
-
-	screen->kbdReleaseAllKeys = kbd_release_all_keys; 
-	screen->setSingleWindow = set_single_window; 
-	screen->setServerInput = set_server_input; 
-	screen->setTextChat = set_text_chat; 
-	screen->getFileTransferPermission = get_file_transfer_permitted; 
-
-	/* called from inetd, we need to treat stdio as our socket */
-	if (inetd && use_openssl) {
-		/* accept_openssl() called later */
-		screen->port = 0;
-	} else if (inetd) {
-		int fd = dup(0);
-		if (fd < 0) {
-			rfbLogEnable(1);
-			rfbErr("dup(0) = %d failed.\n", fd);
-			rfbLogPerror("dup");
-			clean_up_exit(1);
-		}
-		fclose(stdin);
-		fclose(stdout);
-		/* we keep stderr for logging */
-		screen->inetdSock = fd;
-		screen->port = 0;
-
-	} else if (! got_rfbport && auto_port > 0) {
-		int lport = find_free_port(auto_port, auto_port+200);
-		screen->autoPort = FALSE;
-		screen->port = lport;
-	} else if (! got_rfbport) {
-		screen->autoPort = TRUE;
-	} else if (got_rfbport && got_rfbport_val == 0) {
-		screen->autoPort = FALSE;
-		screen->port = 0;
-	}
-
-	if (! got_nevershared && ! got_alwaysshared) {
-		if (shared) {
-			screen->alwaysShared = TRUE;
-		} else {
-			screen->neverShared = TRUE;
-		}
-		screen->dontDisconnect = TRUE;
-	}
-	if (! got_deferupdate) {
-		screen->deferUpdateTime = defer_update;
-	} else {
-		defer_update = screen->deferUpdateTime;
-	}
-
-	if (noipv4 || getenv("IPV4_FAILS")) {
-		rfbBool ap = screen->autoPort;
-		int port = screen->port;
-
-		if (getenv("IPV4_FAILS")) {
-			rfbLog("TESTING: IPV4_FAILS for rfbInitServer()\n");
-		}
-
-		screen->autoPort = FALSE;
-		screen->port = 0;
-
-		rfbInitServer(screen);
-
-		screen->autoPort = ap;
-		screen->port = port;
-		
-	} else {
-		rfbInitServer(screen);
-	}
-
-	if (use_openssl) {
-		openssl_port(0);
-		if (https_port_num >= 0) {
-			https_port(0);
-		}
-	} else {
-		if (ipv6_listen) {
-			int fd = -1;
-			if (screen->port <= 0) {
-				if (got_rfbport) {
-					screen->port = got_rfbport_val;
-				} else {
-					int ap = 5900;
-					if (auto_port > 0) {
-						ap = auto_port;
-					}
-					screen->port = find_free_port6(ap, ap+200);
-				}
-			}
-			fd = listen6(screen->port);
-			if (fd < 0) {
-				ipv6_listen = 0;
-				rfbLog("Not listening on IPv6 interface.\n");
-			} else {
-				rfbLog("Listening %s on IPv6 port %d (socket %d)\n",
-				    screen->listenSock < 0 ? "only" : "also",
-				    screen->port, fd);
-				ipv6_listen_fd = fd;
-			}
-		}
-	}
-
-	install_passwds();
-
-	if (locked_sends) {
-		lock_client_sends(0);
-	}
-	return;
-}
-
-#define DO_AVAHI \
-	if (avahi) { \
-		avahi_initialise(); \
-		avahi_advertise(vnc_desktop_name, host, lport); \
-		usleep(1000*1000); \
-	}
-
-void announce(int lport, int ssl, char *iface) {
-	
-	char *host = this_host();
-	char *tvdt;
-
-	if (remote_direct) {
-		return;
-	}
-
-	if (! ssl) {
-		tvdt = "The VNC desktop is:     ";
-	} else {
-		if (enc_str && !strcmp(enc_str, "none")) {
-			tvdt = "The VNC desktop is:     ";
-		} else if (enc_str) {
-			tvdt = "The ENC VNC desktop is: ";
-		} else {
-			tvdt = "The SSL VNC desktop is: ";
-		}
-	}
-
-	if (iface != NULL && *iface != '\0' && strcmp(iface, "any")) {
-		host = iface;
-	}
-	if (host != NULL) {
-		/* note that vncviewer special cases 5900-5999 */
-		int sz = 256;
-		if (inetd) {
-			;	/* should not occur (port) */
-		} else if (quiet) {
-			if (lport >= 5900) {
-				snprintf(vnc_desktop_name, sz, "%s:%d",
-				    host, lport - 5900);
-				DO_AVAHI
-				fprintf(stderr, "\n%s %s\n", tvdt,
-				    vnc_desktop_name);
-			} else {
-				snprintf(vnc_desktop_name, sz, "%s:%d",
-				    host, lport);
-				DO_AVAHI
-				fprintf(stderr, "\n%s %s\n", tvdt,
-				    vnc_desktop_name);
-			}
-		} else if (lport >= 5900) {
-			snprintf(vnc_desktop_name, sz, "%s:%d",
-			    host, lport - 5900);
-			DO_AVAHI
-			fprintf(stderr, "\n%s %s\n", tvdt, vnc_desktop_name);
-			if (lport >= 6000) {
-				rfbLog("possible aliases:  %s:%d, "
-				    "%s::%d\n", host, lport,
-				    host, lport);
-			}
-		} else {
-			snprintf(vnc_desktop_name, sz, "%s:%d",
-			    host, lport);
-			DO_AVAHI
-			fprintf(stderr, "\n%s %s\n", tvdt, vnc_desktop_name);
-			rfbLog("possible alias:    %s::%d\n",
-			    host, lport);
-		}
-	}
-}
-
-static void announce_http(int lport, int ssl, char *iface, char *extra) {
-	
-	char *host = this_host();
-	char *jvu;
-	int http = 0;
-
-	if (enc_str && !strcmp(enc_str, "none") && !use_stunnel) {
-		jvu = "Java viewer URL:         http";
-		http = 1;
-	} else if (ssl == 1) {
-		jvu = "Java SSL viewer URL:     https";
-	} else if (ssl == 2) {
-		jvu = "Java SSL viewer URL:     http";
-		http = 1;
-	} else {
-		jvu = "Java viewer URL:         http";
-		http = 1;
-	}
-
-	if (iface != NULL && *iface != '\0' && strcmp(iface, "any")) {
-		host = iface;
-	}
-	if (http && getenv("X11VNC_HTTP_LISTEN_LOCALHOST")) {
-		host = "localhost";
-	}
-	if (host != NULL) {
-		if (! inetd) {
-			fprintf(stderr, "%s://%s:%d/%s\n", jvu, host, lport, extra);
-		}
-	}
-}
-
-void do_announce_http(void) {
-	if (!screen) {
-		return;
-	}
-	if (remote_direct) {
-		return;
-	}
-
-	/* XXX ipv6? */
-	if ((screen->httpListenSock > -1 || ipv6_http_fd > -1) && screen->httpPort) {
-		int enc_none = (enc_str && !strcmp(enc_str, "none"));
-		char *SPORT = "   (single port)";
-		if (use_openssl && ! enc_none) {
-			announce_http(screen->port, 1, listen_str, SPORT);
-			if (https_port_num >= 0) {
-				announce_http(https_port_num, 1,
-				    listen_str, "");
-			}
-			announce_http(screen->httpPort, 2, listen_str, "");
-		} else if (use_stunnel) {
-			char pmsg[100];
-			pmsg[0] = '\0';
-			if (stunnel_port) {
-				sprintf(pmsg, "?PORT=%d", stunnel_port);
-			}
-			announce_http(screen->httpPort, 2, listen_str, pmsg);
-			if (stunnel_http_port > 0) {
-				announce_http(stunnel_http_port, 1, NULL, pmsg);
-			}
-			if (enc_none) {
-				strcat(pmsg, SPORT);
-				announce_http(stunnel_port, 1, NULL, pmsg);
-			}
-		} else {
-			announce_http(screen->httpPort, 0, listen_str, "");
-			if (enc_none) {
-				announce_http(screen->port, 1, NULL, SPORT);
-			}
-		}
-	}
-}
-
-void do_mention_java_urls(void) {
-	if (! quiet && screen) {
-		/* XXX ipv6? */
-		if (screen->httpListenSock > -1 && screen->httpPort) {
-			rfbLog("\n");
-			rfbLog("The URLs printed out below ('Java ... viewer URL') can\n");
-			rfbLog("be used for Java enabled Web browser connections.\n");
-			if (!stunnel_port && enc_str && !strcmp(enc_str, "none")) {
-				;
-			} else if (use_openssl || stunnel_port) {
-				rfbLog("Here are some additional possibilities:\n");
-				rfbLog("\n");
-				rfbLog("https://host:port/proxy.vnc (MUST be used if Web Proxy used)\n");
-				rfbLog("\n");
-				rfbLog("https://host:port/ultra.vnc (Use UltraVNC Java Viewer)\n");
-				rfbLog("https://host:port/ultraproxy.vnc (Web Proxy with UltraVNC)\n");
-				rfbLog("https://host:port/ultrasigned.vnc (Signed UltraVNC Filexfer)\n");
-				rfbLog("\n");
-				rfbLog("Where you replace \"host:port\" with that printed below, or\n");
-				rfbLog("whatever is needed to reach the host e.g. Internet IP number\n");
-				rfbLog("\n");
-				rfbLog("Append ?GET=1 to a URL for faster loading or supply:\n");
-				rfbLog("-env X11VNC_EXTRA_HTTPS_PARAMS='?GET=1' to cmdline.\n");
-			}
-		}
-		rfbLog("\n");
-	}
-}
-
-void set_vnc_desktop_name(void) {
-	sprintf(vnc_desktop_name, "unknown");
-	if (inetd) {
-		sprintf(vnc_desktop_name, "%s/inetd-no-further-clients",
-		    this_host());
-	}
-	if (remote_direct) {
-		return;
-	}
-	if (screen->port) {
-
-		do_mention_java_urls();
-
-		if (use_openssl) {
-			announce(screen->port, 1, listen_str);
-		} else {
-			announce(screen->port, 0, listen_str);
-		}
-		if (stunnel_port) {
-			announce(stunnel_port, 1, NULL);
-		}
-
-		do_announce_http();
-		
-		fflush(stderr);	
-		if (inetd) {
-			;	/* should not occur (port != 0) */
-		} else {
-			fprintf(stdout, "PORT=%d\n", screen->port);
-			if (stunnel_port) {
-				fprintf(stdout, "SSLPORT=%d\n", stunnel_port);
-			} else if (use_openssl) {
-				if (enc_str && !strcmp(enc_str, "none")) {
-					;
-				} else if (enc_str) {
-					fprintf(stdout, "ENCPORT=%d\n", screen->port);
-				} else {
-					fprintf(stdout, "SSLPORT=%d\n", screen->port);
-				}
-			}
-			fflush(stdout);	
-			if (flagfile) {
-				FILE *flag = fopen(flagfile, "w");
-				if (flag) {
-					fprintf(flag, "PORT=%d\n",screen->port);
-					if (stunnel_port) {
-						fprintf(flag, "SSL_PORT=%d\n",
-						    stunnel_port);
-					}
-					fflush(flag);	
-					fclose(flag);
-				} else {
-					rfbLog("could not open flag file: %s\n",
-					    flagfile);
-				}
-			}
-			if (rm_flagfile) {
-				int create = 0;
-				struct stat sb;
-				if (strstr(rm_flagfile, "create:") == rm_flagfile) {
-					char *s = rm_flagfile;
-					create = 1;
-					rm_flagfile = strdup(rm_flagfile + strlen("create:"));
-					free(s);
-				}
-				if (strstr(rm_flagfile, "nocreate:") == rm_flagfile) {
-					char *s = rm_flagfile;
-					create = 0;
-					rm_flagfile = strdup(rm_flagfile + strlen("nocreate:"));
-					free(s);
-				} else if (stat(rm_flagfile, &sb) != 0) {
-					create = 1;
-				}
-				if (create) {
-					FILE *flag = fopen(rm_flagfile, "w");
-					if (flag) {
-						fprintf(flag, "%d\n", getpid());
-						fclose(flag);
-					}
-				}
-			}
-		}
-		fflush(stdout);	
-	}
-}
-
-static void check_cursor_changes(void) {
-	static double last_push = 0.0;
-
-	if (unixpw_in_progress) return;
-
-	cursor_changes += check_x11_pointer();
-
-	if (cursor_changes) {
-		double tm, max_push = 0.125, multi_push = 0.01, wait = 0.02;
-		int cursor_shape, dopush = 0, link, latency, netrate;
-
-		if (! all_clients_initialized()) {
-			/* play it safe */
-			return;
-		}
-
-		if (0) cursor_shape = cursor_shape_updates_clients(screen);
-	
-		dtime0(&tm);
-		link = link_rate(&latency, &netrate);
-		if (link == LR_DIALUP) {
-			max_push = 0.2;
-			wait = 0.05;
-		} else if (link == LR_BROADBAND) {
-			max_push = 0.075;
-			wait = 0.05;
-		} else if (link == LR_LAN) {
-			max_push = 0.01;
-		} else if (latency < 5 && netrate > 200) {
-			max_push = 0.01;
-		}
-		
-		if (tm > last_push + max_push) {
-			dopush = 1;
-		} else if (cursor_changes > 1 && tm > last_push + multi_push) {
-			dopush = 1;
-		}
-
-		if (dopush) { 
-			mark_rect_as_modified(0, 0, 1, 1, 1);
-			fb_push_wait(wait, FB_MOD);
-			last_push = tm;
-		} else {
-			rfbPE(0);
-		}
-	}
-	cursor_changes = 0;
-}
-
-/*
- * These watch_loop() releated were moved from x11vnc.c so we could try
- * to remove -O2 from its compilation.  TDB new file, e.g. watch.c.
- */
-
-static void check_filexfer(void) {
-	static time_t last_check = 0;
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-	int transferring = 0; 
-	
-	if (time(NULL) <= last_check) {
-		return;
-	}
-
-#if 0
-	if (getenv("NOFT")) {
-		return;
-	}
-#endif
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-		if (cl->fileTransfer.receiving) {
-			transferring = 1;
-			break;
-		}
-		if (cl->fileTransfer.sending) {
-			transferring = 1;
-			break;
-		}
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (transferring) {
-		double start = dnow();
-		while (dnow() < start + 0.5) {
-			rfbCFD(5000);
-			rfbCFD(1000);
-			rfbCFD(0);
-		}
-	} else {
-		last_check = time(NULL);
-	}
-}
-
-static void record_last_fb_update(void) {
-	static int rbs0 = -1;
-	static time_t last_call = 0;
-	time_t now = time(NULL);
-	int rbs = -1;
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-
-	if (last_fb_bytes_sent == 0) {
-		last_fb_bytes_sent = now;
-		last_call = now;
-	}
-
-	if (now <= last_call + 1) {
-		/* check every second or so */
-		return;
-	}
-
-	if (unixpw_in_progress) return;
-
-	last_call = now;
-
-	if (! screen) {
-		return;
-	}
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(iter)) ) {
-#if 0
-		rbs += cl->rawBytesEquivalent;
-#else
-#if LIBVNCSERVER_HAS_STATS
-		rbs += rfbStatGetSentBytesIfRaw(cl);
-#endif
-#endif
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (rbs != rbs0) {
-		rbs0 = rbs;
-		if (debug_tiles > 1) {
-			fprintf(stderr, "record_last_fb_update: %d %d\n",
-			    (int) now, (int) last_fb_bytes_sent);
-		}
-		last_fb_bytes_sent = now;
-	}
-}
-
-
-static int choose_delay(double dt) {
-	static double t0 = 0.0, t1 = 0.0, t2 = 0.0, now; 
-	static int x0, y0, x1, y1, x2, y2, first = 1;
-	int dx0, dy0, dx1, dy1, dm, i, msec = waitms;
-	double cut1 = 0.15, cut2 = 0.075, cut3 = 0.25;
-	double bogdown_time = 0.25, bave = 0.0;
-	int bogdown = 1, bcnt = 0;
-	int ndt = 8, nave = 3;
-	double fac = 1.0;
-	static int db = 0, did_set_defer = 0;
-	static double dts[8];
-	static int link = LR_UNSET, latency = -1, netrate = -1;
-	static double last_link = 0.0;
-
-	if (screen && did_set_defer) {
-		/* reset defer in case we changed it */
-		screen->deferUpdateTime = defer_update;
-	}
-	if (waitms == 0) {
-		return waitms;
-	}
-	if (nofb) {
-		return waitms;
-	}
-
-	if (first) {
-		for(i=0; i<ndt; i++) {
-			dts[i] = 0.0;
-		}
-		if (getenv("DEBUG_DELAY")) {
-			db = atoi(getenv("DEBUG_DELAY"));
-		}
-		if (getenv("SET_DEFER")) {
-			set_defer = atoi(getenv("SET_DEFER"));
-		}
-		first = 0;
-	}
-
-	now = dnow();
-
-	if (now > last_link + 30.0 || link == LR_UNSET) {
-		link = link_rate(&latency, &netrate);
-		last_link = now;
-	}
-
-	/*
-	 * first check for bogdown, e.g. lots of activity, scrolling text
-	 * from command output, etc.
-	 */
-	if (nap_ok) {
-		dt = 0.0;
-	}
-	if (! wait_bog) {
-		bogdown = 0;
-
-	} else if (button_mask || now < last_keyboard_time + 2*bogdown_time) {
-		/*
-		 * let scrolls & keyboard input through the normal way
-		 * otherwise, it will likely just annoy them.
-		 */
-		bogdown = 0;
-
-	} else if (dt > 0.0) {
-		/*
-		 * inspect recent dt's:
-		 * 0 1 2 3 4 5 6 7 dt
-		 *             ^ ^ ^
-		 */
-		for (i = ndt - (nave - 1); i < ndt; i++) {
-			bave += dts[i];
-			bcnt++;
-			if (dts[i] < bogdown_time) {
-				bogdown = 0;
-				break;
-			}
-		}
-		bave += dt;
-		bcnt++;
-		bave = bave / bcnt;
-		if (dt < bogdown_time) {
-			bogdown = 0;
-		}
-	} else {
-		bogdown = 0;
-	}
-	/* shift for next time */
-	for (i = 0; i < ndt-1; i++) {
-		dts[i] = dts[i+1];
-	}
-	dts[ndt-1] = dt;
-
-if (0 && dt > 0.0) fprintf(stderr, "dt: %.5f %.4f\n", dt, dnowx());
-	if (bogdown) {
-		if (use_xdamage) {
-			/* DAMAGE can queue ~1000 rectangles for a scroll */
-			clear_xdamage_mark_region(NULL, 0);
-		}
-		msec = (int) (1000 * 1.75 * bave);
-		if (dts[ndt - nave - 1] > 0.75 * bave) {
-			msec = 1.5 * msec;
-			set_xdamage_mark(0, 0, dpy_x, dpy_y);
-		}
-		if (msec > 1500) {
-			msec = 1500;
-		}
-		if (msec < waitms) {
-			msec = waitms;
-		}
-		db = (db || debug_tiles);
-		if (db) fprintf(stderr, "bogg[%d] %.3f %.3f %.3f %.3f\n",
-		    msec, dts[ndt-4], dts[ndt-3], dts[ndt-2], dts[ndt-1]);
-
-		return msec;
-	}
-
-	/* next check for pointer motion, keystrokes, to speed up */
-	t2 = dnow();
-	x2 = cursor_x;
-	y2 = cursor_y;
-
-	dx0 = nabs(x1 - x0);
-	dy0 = nabs(y1 - y0);
-	dx1 = nabs(x2 - x1);
-	dy1 = nabs(y2 - y1);
-
-	/* bigger displacement for most recent dt: */
-	if (dx1 > dy1) {
-		dm = dx1;
-	} else {
-		dm = dy1;
-	}
-
-	if ((dx0 || dy0) && (dx1 || dy1)) {
-		/* if mouse moved the previous two times: */
-		if (t2 < t0 + cut1 || t2 < t1 + cut2 || dm > 20) {
-			/*
-			 * if within 0.15s(0) or 0.075s(1) or mouse
-			 * moved > 20pixels, set and bump up the cut
-			 * down factor.
-			 */
-			fac = wait_ui * 1.5;
-		} else if ((dx1 || dy1) && dm > 40) {
-			fac = wait_ui;
-		} else {
-			/* still 1.0? */
-			if (db > 1) fprintf(stderr, "wait_ui: still 1.0\n");
-		}
-	} else if ((dx1 || dy1) && dm > 40) {
-		/* if mouse moved > 40 last time: */
-		fac = wait_ui;
-	}
-
-	if (fac == 1.0 && t2 < last_keyboard_time + cut3) {
-		/* if typed in last 0.25s set wait_ui */
-		fac = wait_ui;
-	}
-	if (fac != 1.0) {
-		if (link == LR_LAN || latency <= 3) {
-			fac *= 1.5;
-		}
-	}
-
-	msec = (int) (((double) waitms) / fac);
-	if (msec == 0) {
-		msec = 1;
-	}
-
-	if (set_defer && fac != 1.0 && screen) {
-		/* this is wait_ui mode, set defer to match wait: */
-		if (set_defer >= 1) {
-			screen->deferUpdateTime = msec;
-		} else if (set_defer <= -1) {
-			screen->deferUpdateTime = 0;
-		}
-		if (nabs(set_defer) == 2) {
-			urgent_update = 1;
-		}
-		did_set_defer = 1;
-	}
-
-	x0 = x1;
-	y0 = y1;
-	t0 = t1;
-
-	x1 = x2;
-	y1 = y2;
-	t1 = t2;
-
-	if (db > 1) fprintf(stderr, "wait: %2d defer[%02d]: %2d\n", msec, defer_update, screen->deferUpdateTime);
-
-	return msec;
-}
-
-/*
- * main x11vnc loop: polls, checks for events, iterate libvncserver, etc.
- */
-void watch_loop(void) {
-	int cnt = 0, tile_diffs = 0, skip_pe = 0, wait;
-	double tm, dtr, dt = 0.0;
-	time_t start = time(NULL);
-
-	if (use_threads && !started_rfbRunEventLoop) {
-		started_rfbRunEventLoop = 1;
-		rfbRunEventLoop(screen, -1, TRUE);
-	}
-
-	while (1) {
-		char msg[] = "new client: %s taking unixpw client off hold.\n";
-		int skip_scan_for_updates = 0;
-
-		got_user_input = 0;
-		got_pointer_input = 0;
-		got_local_pointer_input = 0;
-		got_pointer_calls = 0;
-		got_keyboard_input = 0;
-		got_keyboard_calls = 0;
-		urgent_update = 0;
-
-		x11vnc_current = dnow();
-
-		if (! use_threads) {
-			dtime0(&tm);
-			if (! skip_pe) {
-				if (unixpw_in_progress) {
-					rfbClientPtr cl = unixpw_client;
-					if (cl && cl->onHold) {
-						rfbLog(msg, cl->host);
-						unixpw_client->onHold = FALSE;
-					}
-				} else {
-					measure_send_rates(1);
-				}
-
-				unixpw_in_rfbPE = 1;
-
-				/*
-				 * do a few more since a key press may
-				 * have induced a small change we want to
-				 * see quickly (just 1 rfbPE will likely
-				 * only process the subsequent "up" event)
-				 */
-				if (tm < last_keyboard_time + 0.20) {
-					rfbPE(0);
-					rfbPE(0);
-					rfbPE(-1);
-					rfbPE(0);
-					rfbPE(0);
-				} else {
-					if (extra_fbur > 0) {
-						int i;
-						for (i=0; i < extra_fbur; i++) {
-							rfbPE(0);
-						}
-					}
-					rfbPE(-1);
-				}
-				if (x11vnc_current < last_new_client + 0.5) {
-					urgent_update = 1;
-				}
-
-				unixpw_in_rfbPE = 0;
-
-				if (unixpw_in_progress) {
-					/* rfbPE loop until logged in. */
-					skip_pe = 0;
-					check_new_clients();
-					continue;
-				} else {
-					measure_send_rates(0);
-					fb_update_sent(NULL);
-				}
-			} else {
-				if (unixpw_in_progress) {
-					skip_pe = 0;
-					check_new_clients();
-					continue;
-				}
-			}
-			dtr = dtime(&tm);
-
-			if (! cursor_shape_updates) {
-				/* undo any cursor shape requests */
-				disable_cursor_shape_updates(screen);
-			}
-			if (screen && screen->clientHead) {
-				int ret = check_user_input(dt, dtr, tile_diffs, &cnt);
-				/* true: loop back for more input */
-				if (ret == 2) {
-					skip_pe = 1;
-				}
-				if (ret) {
-					if (debug_scroll) fprintf(stderr, "watch_loop: LOOP-BACK: %d\n", ret);
-					continue;
-				}
-			}
-			/* watch for viewonly input piling up: */
-			if ((got_pointer_calls > got_pointer_input) ||
-			    (got_keyboard_calls > got_keyboard_input)) {
-				eat_viewonly_input(10, 3);
-			}
-		} else {
-			/* -threads here. */
-			if (unixpw_in_progress) {
-				rfbClientPtr cl = unixpw_client;
-				if (cl && cl->onHold) {
-					rfbLog(msg, cl->host);
-					unixpw_client->onHold = FALSE;
-				}
-			}
-			if (use_xrecord) {
-				check_xrecord();
-			}
-			if (wireframe && button_mask) {
-				check_wireframe();
-			}
-		}
-		skip_pe = 0;
-
-		if (shut_down) {
-			clean_up_exit(0);
-		}
-
-		if (unixpw_in_progress) {
-			check_new_clients();
-			continue;
-		}
-
-		if (! urgent_update) {
-			if (do_copy_screen) {
-				do_copy_screen = 0;
-				copy_screen();
-			}
-
-			check_new_clients();
-			check_ncache(0, 0);
-			check_xevents(0);
-			check_autorepeat();
-			check_pm();
-			check_filexfer();
-			check_keycode_state();
-			check_connect_inputs();
-			check_gui_inputs();
-			check_stunnel();
-			check_openssl();
-			check_https();
-			record_last_fb_update();
-			check_padded_fb();
-			check_fixscreen();
-			check_xdamage_state();
-			check_xrecord_reset(0);
-			check_add_keysyms();
-			check_new_passwds(0);
-#ifdef ENABLE_GRABLOCAL
-			if (grab_local) {
-				check_local_grab();
-			}
-#endif
-			if (started_as_root) {
-				check_switched_user();
-			}
-
-			if (first_conn_timeout < 0) {
-				start = time(NULL);
-				first_conn_timeout = -first_conn_timeout;
-			}
-		}
-
-		if (rawfb_vnc_reflect) {
-			static time_t lastone = 0;
-
-	/* Tobias Doerffel, 2011/11 */
-#ifdef USE_AS_ITALC_DEMO_SERVER
-			if (1)
-#else
-			if (time(NULL) > lastone + 10)
-#endif
-			{
-				lastone = time(NULL);
-				vnc_reflect_process_client();
-			}
-		}
-
-		if (first_conn_timeout) {
-			int t = first_conn_timeout;
-			if (!clients_served) {
-				if (time(NULL) - start > first_conn_timeout) {
-					rfbLog("No client after %d secs.\n", t);
-					shut_down = 1;
-				}
-			} else {
-				if (!client_normal_count) {
-					if (time(NULL) - start > t + 3) {
-						rfbLog("No valid client after %d secs.\n", t + 3);
-						shut_down = 1;
-					}
-				}
-			}
-		}
-
-		if (! screen || ! screen->clientHead) {
-			/* waiting for a client */
-	/* Tobias Doerffel, 2011/11 */
-#ifdef USE_AS_ITALC_DEMO_SERVER
-			/* when running as demo server, increase main loop delay
-				and instead removed delay between vnc_reflect_process_client()
-				calls above */
-			if( rawfb_vnc_reflect )
-			{
-				usleep(400 * 1000);
-			}
-			else
-			{
-				usleep(200 * 1000);
-			}
-#else
-			usleep(200 * 1000);
-#endif
-			continue;
-		}
-
-		if (first_conn_timeout && all_clients_initialized()) {
-			first_conn_timeout = 0;
-		}
-
-		if (nofb) {
-			/* no framebuffer polling needed */
-			if (cursor_pos_updates) {
-				check_x11_pointer();
-			}
-#ifdef MACOSX
-			else check_x11_pointer();
-#endif
-			continue;
-		}
-		if (x11vnc_current < last_new_client + 0.5 && !all_clients_initialized()) {
-			continue;
-		}
-		if (subwin && freeze_when_obscured) {
-			/* XXX not working */
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-			check_xevents(0);
-			if (subwin_obscured) {
-				skip_scan_for_updates = 1;
-			}
-		}
-
-		if (skip_scan_for_updates) {
-			;
-		} else if (button_mask && (!show_dragging || pointer_mode == 0)) {
-			/*
-			 * if any button is pressed in this mode do
-			 * not update rfb screen, but do flush the
-			 * X11 display.
-			 */
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-			dt = 0.0;
-		} else {
-			static double last_dt = 0.0;
-			double xdamage_thrash = 0.4; 
-			static int tilecut = -1;
-
-			check_cursor_changes();
-
-			/* for timing the scan to try to detect thrashing */
-
-			if (use_xdamage && last_dt > xdamage_thrash)  {
-				clear_xdamage_mark_region(NULL, 0);
-			}
-
-			if (unixpw_in_progress) continue;
-
-			if (rawfb_vnc_reflect) {
-				vnc_reflect_process_client();
-			}
-
-			dtime0(&tm);
-
-#if !NO_X11
-			if (xrandr_present && !xrandr && xrandr_maybe) {
-				int delay = 180;
-				/*  there may be xrandr right after xsession start */
-				if (tm < x11vnc_start + delay || tm < last_client + delay) {
-					int tw = 20;
-					if (auth_file != NULL) {
-						tw = 120;
-					}
-					X_LOCK;
-					if (tm < x11vnc_start + tw || tm < last_client + tw) {
-						XSync(dpy, False);
-					} else {
-						XFlush_wr(dpy);
-					}
-					X_UNLOCK;
-				}
-				X_LOCK;
-				check_xrandr_event("before-scan");
-				X_UNLOCK;
-			}
-#endif
-			if (use_snapfb) {
-				int t, tries = 3;
-				copy_snap();
-				for (t=0; t < tries; t++) {
-					tile_diffs = scan_for_updates(0);
-				}
-			} else {
-				tile_diffs = scan_for_updates(0);
-			}
-			dt = dtime(&tm);
-			if (! nap_ok) {
-				last_dt = dt;
-			}
-
-			if (tilecut < 0) {
-				if (getenv("TILECUT")) {
-					tilecut = atoi(getenv("TILECUT"));
-				}
-				if (tilecut < 0) tilecut = 4;
-			}
-
-			if ((debug_tiles || debug_scroll > 1 || debug_wireframe > 1)
-			    && (tile_diffs > tilecut || debug_tiles > 1)) {
-				double rate = (tile_x * tile_y * bpp/8 * tile_diffs) / dt;
-				fprintf(stderr, "============================= TILES: %d  dt: %.4f"
-				    "  t: %.4f  %.2f MB/s nap_ok: %d\n", tile_diffs, dt,
-				    tm - x11vnc_start, rate/1000000.0, nap_ok);
-			}
-
-		}
-
-		/* sleep a bit to lessen load */
-		wait = choose_delay(dt);
-
-		if (urgent_update) {
-			;
-		} else if (wait > 2*waitms) {
-			/* bog case, break it up */
-			nap_sleep(wait, 10);
-		} else {
-			double t1, t2;
-			int idt;
-			if (extra_fbur > 0) {
-				int i;
-				for (i=0; i <= extra_fbur; i++) {
-					int r = rfbPE(0);
-					if (!r) break;
-				}
-			}
-
-			/* sometimes the sleep is too short, so measure it: */
-			t1 = dnow();
-			usleep(wait * 1000);
-			t2 = dnow();
-
-			idt = (int) (1000. * (t2 - t1));
-			if (idt > 0 && idt < wait) {
-				/* try to sleep the remainder */
-				usleep((wait - idt) * 1000);
-			}
-		}
-
-		cnt++;
-	}
-}
-
-
diff --git a/ica/x11/x11vnc/screen.h b/ica/x11/x11vnc/screen.h
deleted file mode 100644
index e7376f4..0000000
--- a/ica/x11/x11vnc/screen.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SCREEN_H
-#define _X11VNC_SCREEN_H
-
-/* -- screen.h -- */
-
-extern void set_greyscale_colormap(void);
-extern void set_hi240_colormap(void);
-extern void unset_colormap(void);
-extern void set_colormap(int reset);
-extern void set_nofb_params(int restore);
-extern void set_raw_fb_params(int restore);
-extern void do_new_fb(int reset_mem);
-extern void free_old_fb(void);
-extern void check_padded_fb(void);
-extern void install_padded_fb(char *geom);
-extern XImage *initialize_xdisplay_fb(void);
-extern XImage *initialize_raw_fb(int);
-extern void parse_scale_string(char *str, double *factor_x, double *factor_y, int *scaling, int *blend,
-    int *nomult4, int *pad, int *interpolate, int *numer, int *denom, int w_in, int h_in);
-extern int parse_rotate_string(char *str, int *mode);
-extern int scale_round(int len, double fac);
-extern void initialize_screen(int *argc, char **argv, XImage *fb);
-extern void set_vnc_desktop_name(void);
-extern void announce(int lport, int ssl, char *iface);
-
-extern char *vnc_reflect_guess(char *str, char **raw_fb_addr);
-extern void vnc_reflect_process_client(void);
-extern rfbBool vnc_reflect_send_pointer(int x, int y, int mask);
-extern rfbBool vnc_reflect_send_key(uint32_t key, rfbBool down);
-extern rfbBool vnc_reflect_send_cuttext(char *str, int len);
-
-extern int rawfb_reset;
-extern int rawfb_dev_video;
-extern int rawfb_vnc_reflect;
-
-#endif /* _X11VNC_SCREEN_H */
diff --git a/ica/x11/x11vnc/scrollevent_t.h b/ica/x11/x11vnc/scrollevent_t.h
deleted file mode 100644
index e0ea951..0000000
--- a/ica/x11/x11vnc/scrollevent_t.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SCROLLEVENT_T_H
-#define _X11VNC_SCROLLEVENT_T_H
-
-/* -- scrollevent_t.h -- */
-
-typedef struct scroll_event {
-	Window win, frame;
-	int dx, dy;
-	int x, y, w, h;
-	double t;
-	int win_x, win_y, win_w, win_h;	
-	int new_x, new_y, new_w, new_h;	
-} scroll_event_t;
-
-#endif /* _X11VNC_SCROLLEVENT_T_H */
diff --git a/ica/x11/x11vnc/selection.c b/ica/x11/x11vnc/selection.c
deleted file mode 100644
index a334586..0000000
--- a/ica/x11/x11vnc/selection.c
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- selection.c -- */
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "connections.h"
-#include "unixpw.h"
-#include "win_utils.h"
-#include "xwrappers.h"
-
-/*
- * Selection/Cutbuffer/Clipboard handlers.
- */
-
-int own_primary = 0;	/* whether we currently own PRIMARY or not */
-int set_primary = 1;
-int own_clipboard = 0;	/* whether we currently own CLIPBOARD or not */
-int set_clipboard = 1;
-int set_cutbuffer = 0;	/* to avoid bouncing the CutText right back */
-int sel_waittime = 15;	/* some seconds to skip before first send */
-Window selwin = None;	/* special window for our selection */
-Atom clipboard_atom = None;
-
-/*
- * This is where we keep our selection: the string sent TO us from VNC
- * clients, and the string sent BY us to requesting X11 clients.
- */
-char *xcut_str_primary = NULL;
-char *xcut_str_clipboard = NULL;
-
-
-void selection_request(XEvent *ev, char *type);
-int check_sel_direction(char *dir, char *label, char *sel, int len);
-void cutbuffer_send(void);
-void selection_send(XEvent *ev);
-void resend_selection(char *type);
-
-
-/*
- * Our callbacks instruct us to check for changes in the cutbuffer
- * and PRIMARY and CLIPBOARD selection on the local X11 display.
- *
- * TODO: check if malloc does not cause performance issues (esp. WRT
- * SelectionNotify handling).
- */
-static char cutbuffer_str[PROP_MAX+1];
-static char primary_str[PROP_MAX+1];
-static char clipboard_str[PROP_MAX+1];
-static int cutbuffer_len = 0;
-static int primary_len   = 0;
-static int clipboard_len = 0;
-
-/*
- * An X11 (not VNC) client on the local display has requested the selection
- * from us (because we are the current owner).
- *
- * n.b.: our caller already has the X_LOCK.
- */
-void selection_request(XEvent *ev, char *type) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!ev || !type) {}
-	return;
-#else
-	XSelectionEvent notify_event;
-	XSelectionRequestEvent *req_event;
-	XErrorHandler old_handler;
-	char *str;
-	unsigned int length;
-	unsigned char *data;
-	static Atom xa_targets = None;
-	static int sync_it = -1;
-# ifndef XA_LENGTH
-	unsigned long XA_LENGTH;
-# endif
-	RAWFB_RET_VOID
-
-# ifndef XA_LENGTH
-	XA_LENGTH = XInternAtom(dpy, "LENGTH", True);
-# endif
-
-	if (sync_it < 0) {
-		if (getenv("X11VNC_SENDEVENT_SYNC")) {
-			sync_it = 1;
-		} else {
-			sync_it = 0;
-		}
-	}
-
-	req_event = &(ev->xselectionrequest);
-	notify_event.type 	= SelectionNotify;
-	notify_event.display	= req_event->display;
-	notify_event.requestor	= req_event->requestor;
-	notify_event.selection	= req_event->selection;
-	notify_event.target	= req_event->target;
-	notify_event.time	= req_event->time;
-
-	if (req_event->property == None) {
-		notify_event.property = req_event->target;
-	} else {
-		notify_event.property = req_event->property;
-	}
-
-	if (!strcmp(type, "PRIMARY")) {
-		str = xcut_str_primary;
-	} else if (!strcmp(type, "CLIPBOARD")) {
-		str = xcut_str_clipboard;
-	} else {
-		return;
-	}
-	if (str) {
-		length = strlen(str);
-	} else {
-		length = 0;
-	}
-	if (debug_sel) {
-		rfbLog("%s\trequest event:   owner=0x%x requestor=0x%x sel=%03d targ=%d prop=%d\n",
-			type, req_event->owner, req_event->requestor, req_event->selection,
-			req_event->target, req_event->property);
-	}
-
-	if (xa_targets == None) {
-		xa_targets = XInternAtom(dpy, "TARGETS", False);
-	}
-
-	/* the window may have gone away, so trap errors */
-	trapped_xerror = 0;
-	old_handler = XSetErrorHandler(trap_xerror);
-
-	if (ev->xselectionrequest.target == XA_LENGTH) {
-		/* length request */
-		int ret;
-		long llength = (long) length;
-
-		ret = XChangeProperty(ev->xselectionrequest.display,
-		    ev->xselectionrequest.requestor,
-		    ev->xselectionrequest.property,
-		    ev->xselectionrequest.target, 32, PropModeReplace,
-		    (unsigned char *) &llength, 1);	/* had sizeof(unsigned int) = 4 before... */
-		if (debug_sel) {
-			rfbLog("LENGTH: XChangeProperty() -> %d\n", ret);
-		}
-
-	} else if (xa_targets != None && ev->xselectionrequest.target == xa_targets) {
-		/* targets request */
-		int ret;
-		Atom targets[2];
-		targets[0] = (Atom) xa_targets;
-		targets[1] = (Atom) XA_STRING;
-
-		ret = XChangeProperty(ev->xselectionrequest.display,
-		    ev->xselectionrequest.requestor,
-		    ev->xselectionrequest.property,
-		    ev->xselectionrequest.target, 32, PropModeReplace,
-		    (unsigned char *) targets, 2);
-		if (debug_sel) {
-			rfbLog("TARGETS: XChangeProperty() -> %d -- sz1: %d  sz2: %d\n",
-			    ret, sizeof(targets[0]), sizeof(targets)/sizeof(targets[0]));
-		}
-
-	} else {
-		/* data request */
-		int ret;
-
-		data = (unsigned char *)str;
-
-		ret = XChangeProperty(ev->xselectionrequest.display,
-		    ev->xselectionrequest.requestor,
-		    ev->xselectionrequest.property,
-		    ev->xselectionrequest.target, 8, PropModeReplace,
-		    data, length);
-		if (debug_sel) {
-			rfbLog("DATA: XChangeProperty() -> %d\n", ret);
-		}
-	}
-
-	if (! trapped_xerror) {
-		int ret = -2, skip_it = 0, ms = 0;
-		double now = dnow();
-		static double last_check = 0.0;
-
-		if (now > last_check + 0.2) {
-			XFlush_wr(dpy);
-			if (!valid_window(req_event->requestor , NULL, 1)) {
-				sync_it = 1;
-				skip_it = 1;
-				if (debug_sel) {
-					rfbLog("selection_request: not a valid window: 0x%x\n",
-					    req_event->requestor);
-				}
-				ms = 10;
-			}
-			if (trapped_xerror) {
-				sync_it = 1;
-				skip_it = 1;
-			}
-			last_check = dnow();
-		}
-
-		if (!skip_it) {
-			ret = XSendEvent(req_event->display, req_event->requestor, False, 0,
-			    (XEvent *)&notify_event);
-		}
-		if (debug_sel) {
-			rfbLog("XSendEvent() -> %d\n", ret);
-		}
-		if (ms > 0) {
-			usleep(ms * 1000);
-		}
-	}
-	if (trapped_xerror) {
-		rfbLog("selection_request: ignored XError while sending "
-		    "%s selection to 0x%x.\n", type, req_event->requestor);
-	}
-
-	XFlush_wr(dpy);
-	if (sync_it) {
-		usleep(10 * 1000);
-		XSync(dpy, False);
-	}
-
-	XSetErrorHandler(old_handler);
-	trapped_xerror = 0;
-
-#endif	/* NO_X11 */
-}
-
-int check_sel_direction(char *dir, char *label, char *sel, int len) {
-	int db = 0, ok = 1;
-	if (debug_sel) {
-		db = 1;
-	}
-	if (sel_direction) {
-		if (strstr(sel_direction, "debug")) {
-			db = 1;
-		}
-		if (strcmp(sel_direction, "debug")) {
-			if (strstr(sel_direction, dir) == NULL) {
-				ok = 0;
-			}
-		}
-	}
-	if (db) {
-		char str[40];
-		int n = 40;
-		strncpy(str, sel, n);
-		str[n-1] = '\0';
-		if (len < n) {
-			str[len] = '\0';
-		}
-		rfbLog("%s: '%s'\n", label, str);
-		if (ok) {
-			rfbLog("%s: %s-ing it.\n", label, dir);
-		} else {
-			rfbLog("%s: NOT %s-ing it.\n", label, dir);
-		}
-	}
-	return ok;
-}
-
-/*
- * CUT_BUFFER0 property on the local display has changed, we read and
- * store it and send it out to any connected VNC clients.
- *
- * n.b.: our caller already has the X_LOCK.
- */
-void cutbuffer_send(void) {
-#if NO_X11
-	RAWFB_RET_VOID
-	return;
-#else
-	Atom type;
-	int format, slen, dlen, len;
-	unsigned long nitems = 0, bytes_after = 0;
-	unsigned char* data = NULL;
-
-	cutbuffer_str[0] = '\0';
-	slen = 0;
-
-	RAWFB_RET_VOID
-
-	/* read the property value into cutbuffer_str: */
-	do {
-		if (XGetWindowProperty(dpy, DefaultRootWindow(dpy),
-		    XA_CUT_BUFFER0, nitems/4, PROP_MAX/16, False,
-		    AnyPropertyType, &type, &format, &nitems, &bytes_after,
-		    &data) == Success) {
-
-			dlen = nitems * (format/8);
-			if (slen + dlen > PROP_MAX) {
-				/* too big */
-				rfbLog("warning: truncating large CUT_BUFFER0"
-				   " selection > %d bytes.\n", PROP_MAX);
-				XFree_wr(data);
-				break;
-			}
-			memcpy(cutbuffer_str+slen, data, dlen);
-			slen += dlen;
-			cutbuffer_str[slen] = '\0';
-			XFree_wr(data);
-		}
-	} while (bytes_after > 0);
-
-	cutbuffer_str[PROP_MAX] = '\0';
-
-	if (debug_sel) {
-		rfbLog("cutbuffer_send: '%s'\n", cutbuffer_str);
-	}
-
-	if (! all_clients_initialized()) {
-		rfbLog("cutbuffer_send: no send: uninitialized clients\n");
-		return; /* some clients initializing, cannot send */ 
-	}
-	if (unixpw_in_progress) {
-		return;
-	}
-
-	/* now send it to any connected VNC clients (rfbServerCutText) */
-	if (!screen) {
-		return;
-	}
-	cutbuffer_len = len = strlen(cutbuffer_str);
-	if (check_sel_direction("send", "cutbuffer_send", cutbuffer_str, len)) {
-		rfbSendServerCutText(screen, cutbuffer_str, len);
-	}
-#endif	/* NO_X11 */
-}
-
-/* 
- * "callback" for our SelectionNotify polling.  We try to determine if
- * the PRIMARY selection has changed (checking length and first CHKSZ bytes)
- * and if it has we store it and send it off to any connected VNC clients.
- *
- * n.b.: our caller already has the X_LOCK.
- *
- * TODO: if we were willing to use libXt, we could perhaps get selection
- * timestamps to speed up the checking... XtGetSelectionValue().
- *
- * Also: XFIXES has XFixesSelectSelectionInput().
- */
-#define CHKSZ 32
-
-void selection_send(XEvent *ev) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!ev) {}
-	return;
-#else
-	Atom type;
-	int format, slen, dlen, oldlen, newlen, toobig = 0, len;
-	static int err = 0, sent_one = 0;
-	char before[CHKSZ], after[CHKSZ];
-	unsigned long nitems = 0, bytes_after = 0;
-	unsigned char* data = NULL;
-	char *selection_str;
-
-	RAWFB_RET_VOID
-	/*
-	 * remember info about our last value of PRIMARY (or CUT_BUFFER0)
-	 * so we can check for any changes below.
-	 */
-	if (ev->xselection.selection == XA_PRIMARY) {
-		if (! watch_primary) {
-			return;
-		}
-		selection_str = primary_str;
-		if (debug_sel) {
-			rfbLog("selection_send: event PRIMARY   prop: %d  requestor: 0x%x  atom: %d\n",
-			    ev->xselection.property, ev->xselection.requestor, ev->xselection.selection);
-		}
-	} else if (clipboard_atom && ev->xselection.selection == clipboard_atom)  {
-		if (! watch_clipboard) {
-			return;
-		}
-		selection_str = clipboard_str;
-		if (debug_sel) {
-			rfbLog("selection_send: event CLIPBOARD prop: %d  requestor: 0x%x atom: %d\n",
-			    ev->xselection.property, ev->xselection.requestor, ev->xselection.selection);
-		}
-	} else {
-		return;
-	}
-	
-	oldlen = strlen(selection_str);
-	strncpy(before, selection_str, CHKSZ);
-
-	selection_str[0] = '\0';
-	slen = 0;
-
-	/* read in the current value of PRIMARY or CLIPBOARD: */
-	do {
-		if (XGetWindowProperty(dpy, ev->xselection.requestor,
-		    ev->xselection.property, nitems/4, PROP_MAX/16, True,
-		    AnyPropertyType, &type, &format, &nitems, &bytes_after,
-		    &data) == Success) {
-
-			dlen = nitems * (format/8);
-			if (slen + dlen > PROP_MAX) {
-				/* too big */
-				toobig = 1;
-				XFree_wr(data);
-				if (err) {	/* cut down on messages */
-					break;
-				} else {
-					err = 5;
-				}
-				rfbLog("warning: truncating large PRIMARY"
-				    "/CLIPBOARD selection > %d bytes.\n",
-				    PROP_MAX);
-				break;
-			}
-if (debug_sel) fprintf(stderr, "selection_send: data: '%s' dlen: %d nitems: %lu ba: %lu\n", data, dlen, nitems, bytes_after);
-			memcpy(selection_str+slen, data, dlen);
-			slen += dlen;
-			selection_str[slen] = '\0';
-			XFree_wr(data);
-		}
-	} while (bytes_after > 0);
-
-	if (! toobig) {
-		err = 0;
-	} else if (err) {
-		err--;
-	}
-
-	if (! sent_one) {
-		/* try to force a send first time in */
-		oldlen = -1;
-		sent_one = 1;
-	}
-	if (debug_sel) {
-		rfbLog("selection_send:  %s '%s'\n",
-		    ev->xselection.selection == XA_PRIMARY ? "PRIMARY  " : "CLIPBOARD",
-		    selection_str);
-	}
-
-	/* look for changes in the new value */
-	newlen = strlen(selection_str);
-	strncpy(after, selection_str, CHKSZ);
-
-	if (oldlen == newlen && strncmp(before, after, CHKSZ) == 0) {
-		/* evidently no change */
-		if (debug_sel) {
-			rfbLog("selection_send:  no change.\n");
-		}
-		return;
-	}
-	if (newlen == 0) {
-		/* do not bother sending a null string out */
-		return;
-	}
-
-	if (! all_clients_initialized()) {
-		rfbLog("selection_send: no send: uninitialized clients\n");
-		return; /* some clients initializing, cannot send */ 
-	}
-
-	if (unixpw_in_progress) {
-		return;
-	}
-
-	/* now send it to any connected VNC clients (rfbServerCutText) */
-	if (!screen) {
-		return;
-	}
-
-	len = newlen;
-	if (ev->xselection.selection == XA_PRIMARY) {
-		primary_len = len;
-	} else if (clipboard_atom && ev->xselection.selection == clipboard_atom)  {
-		clipboard_len = len;
-	}
-	if (check_sel_direction("send", "selection_send", selection_str, len)) {
-		rfbSendServerCutText(screen, selection_str, len);
-	}
-#endif	/* NO_X11 */
-}
-
-void resend_selection(char *type) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!type) {}
-	return;
-#else
-	char *selection_str = "";
-	int len = 0;
-
-	RAWFB_RET_VOID
-
-	if (! all_clients_initialized()) {
-		rfbLog("selection_send: no send: uninitialized clients\n");
-		return; /* some clients initializing, cannot send */ 
-	}
-	if (unixpw_in_progress) {
-		return;
-	}
-	if (!screen) {
-		return;
-	}
-
-	if (!strcmp(type, "cutbuffer")) {
-		selection_str = cutbuffer_str;
-		len = cutbuffer_len;
-	} else if (!strcmp(type, "clipboard")) {
-		selection_str = clipboard_str;
-		len = clipboard_len;
-	} else if (!strcmp(type, "primary")) {
-		selection_str = primary_str;
-		len = primary_len;
-	}
-	if (check_sel_direction("send", "selection_send", selection_str, len)) {
-		rfbSendServerCutText(screen, selection_str, len);
-	}
-#endif	/* NO_X11 */
-}
-
-
diff --git a/ica/x11/x11vnc/selection.h b/ica/x11/x11vnc/selection.h
deleted file mode 100644
index e528540..0000000
--- a/ica/x11/x11vnc/selection.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SELECTION_H
-#define _X11VNC_SELECTION_H
-
-/* -- selection.h -- */
-
-extern char *xcut_str_primary;
-extern char *xcut_str_clipboard;
-extern int own_primary;
-extern int set_primary;
-extern int own_clipboard;
-extern int set_clipboard;
-extern int set_cutbuffer;
-extern int sel_waittime;
-extern Window selwin;
-extern Atom clipboard_atom;
-
-extern void selection_request(XEvent *ev, char *type);
-extern int check_sel_direction(char *dir, char *label, char *sel, int len);
-extern void cutbuffer_send(void);
-extern void selection_send(XEvent *ev);
-extern void resend_selection(char *type);
-
-#endif /* _X11VNC_SELECTION_H */
diff --git a/ica/x11/x11vnc/solid.c b/ica/x11/x11vnc/solid.c
deleted file mode 100644
index c78fb1f..0000000
--- a/ica/x11/x11vnc/solid.c
+++ /dev/null
@@ -1,1429 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- solid.c -- */
-
-#include "x11vnc.h"
-#include "win_utils.h"
-#include "xwrappers.h"
-#include "connections.h"
-#include "cleanup.h"
-#include "xevents.h"
-
-char *guess_desktop(void);
-void solid_bg(int restore);
-char *dbus_session(void);
-
-
-static void usr_bin_path(int restore);
-static int dt_cmd(char *cmd);
-static char *cmd_output(char *cmd);
-XImage *solid_root(char *color);
-static void solid_cde(char *color);
-static void solid_gnome(char *color);
-static void solid_kde(char *color);
-static void solid_macosx(int restore);
-
-static void usr_bin_path(int restore) {
-	static char *oldpath = NULL;
-	char *newpath;
-	char addpath[] = "/usr/bin:/bin:";
-
-	if (restore) {
-		if (oldpath) {
-			set_env("PATH", oldpath);
-			free(oldpath);
-			oldpath = NULL;
-		}
-		return;
-	}
-
-	if (getenv("PATH")) {
-		oldpath = strdup(getenv("PATH"));
-	} else {
-		oldpath = strdup("/usr/bin");
-	}
-	newpath = (char *) malloc(strlen(oldpath) + strlen(addpath) + 1);
-	newpath[0] = '\0';
-	strcat(newpath, addpath);
-	strcat(newpath, oldpath);
-	set_env("PATH", newpath);
-	free(newpath);
-}
-
-static int dt_cmd(char *cmd) {
-	int rc;
-
-	RAWFB_RET(0)
-
-	if (!cmd || *cmd == '\0') {
-		return 0;
-	}
-
-	/* dt */
-	if (no_external_cmds || !cmd_ok("dt")) {
-		rfbLog("cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", cmd);
-		rfbLog("   dt_cmd: returning 1\n");
-		return 1;
-	}
-
-	if (getenv("DISPLAY") == NULL) {
-		set_env("DISPLAY", DisplayString(dpy));
-	}
-
-	rfbLog("running command:\n");
-	if (!quiet) {
-		fprintf(stderr, "\n  %s\n\n", cmd);
-	}
-	usr_bin_path(0);
-	close_exec_fds();
-	rc = system(cmd);
-	usr_bin_path(1);
-
-	if (rc >= 256) {
-		rc = rc/256;
-	}
-	return rc;
-}
-
-static char *cmd_output(char *cmd) {
-	FILE *p;
-	static char output[50000];
-	char line[1024];
-	int rc;
-
-	if (!cmd || *cmd == '\0') {
-		return "";
-	}
-
-	if (no_external_cmds) {
-		rfbLog("cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", cmd);
-		rfbLog("   cmd_output: null string.\n");
-		return "";
-	}
-
-	rfbLog("running pipe:\n");
-	if (!quiet) {
-		fprintf(stderr, "\n  %s\n\n", cmd);
-	}
-	usr_bin_path(0);
-	close_exec_fds();
-	p = popen(cmd, "r");
-	usr_bin_path(1);
-
-	output[0] = '\0';
-
-	while (fgets(line, 1024, p) != NULL) {
-		if (strlen(output) + strlen(line) + 1 < 50000) {
-			strcat(output, line);
-		}
-	}
-	rc = pclose(p);
-	return(output);
-}
-
-static char *last_color = NULL;
-
-unsigned long get_pixel(char *color) {
-#if NO_X11
-	return 0;
-#else
-	XColor cdef;
-	Colormap cmap;
-	unsigned long pixel = BlackPixel(dpy, scr);
-	if (depth > 8 || strcmp(color, solid_default)) {
-		cmap = DefaultColormap (dpy, scr);
-		if (XParseColor(dpy, cmap, color, &cdef) &&
-		    XAllocColor(dpy, cmap, &cdef)) {
-			pixel = cdef.pixel;
-		} else {
-			rfbLog("error parsing/allocing color: %s\n", color);
-		}
-	}
-	return pixel;
-#endif
-}
-
-XImage *solid_root(char *color) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!color) {}
-	return NULL;
-#else
-	Window expose;
-	static XImage *image = NULL;
-	Pixmap pixmap;
-	XGCValues gcv;
-	GC gc;
-	XSetWindowAttributes swa;
-	Visual visual;
-	static unsigned long mask, pixel = 0;
-
-	RAWFB_RET(NULL)
-
-	if (subwin || window != rootwin) {
-		rfbLog("cannot set subwin to solid color, must be rootwin\n");
-		return NULL;
-	}
-
-	/* create the "clear" window just for generating exposures */
-	swa.override_redirect = True;
-	swa.backing_store = NotUseful;
-	swa.save_under = False;
-	swa.background_pixmap = None;
-	visual.visualid = CopyFromParent;
-	mask = (CWOverrideRedirect|CWBackingStore|CWSaveUnder|CWBackPixmap);
-	expose = XCreateWindow(dpy, window, 0, 0, wdpy_x, wdpy_y, 0, depth,
-	    InputOutput, &visual, mask, &swa);
-
-	if (! color) {
-
-		if (! image) {
-			/* whoops */
-			XDestroyWindow(dpy, expose);
-			rfbLog("no root snapshot available.\n");
-			return NULL;
-		}
-
-		/* restore the root window from the XImage snapshot */
-		pixmap = XCreatePixmap(dpy, window, wdpy_x, wdpy_y, depth);
-		
-		/* draw the image to a pixmap: */
-		gcv.function = GXcopy;
-		gcv.plane_mask = AllPlanes;
-		gc = XCreateGC(dpy, window, GCFunction|GCPlaneMask, &gcv);
-
-		XPutImage(dpy, pixmap, gc, image, 0, 0, 0, 0, wdpy_x, wdpy_y);
-
-		gcv.foreground = gcv.background = BlackPixel(dpy, scr);
-		gc = XCreateGC(dpy, window, GCForeground|GCBackground, &gcv);
-
-		rfbLog("restoring root snapshot...\n");
-		/* set the pixmap as the bg: */
-		XSetWindowBackgroundPixmap(dpy, window, pixmap);
-		XFreePixmap(dpy, pixmap);
-		XClearWindow(dpy, window);
-		XFlush_wr(dpy);
-		
-		/* generate exposures */
-		XMapWindow(dpy, expose);
-		XSync(dpy, False);
-		XDestroyWindow(dpy, expose);
-		return NULL;
-	}
-
-	if (! image) {
-		/* need to retrieve a snapshot of the root background: */
-		Window iwin;
-		XSetWindowAttributes iswa;
-
-		/* create image window: */
-		iswa.override_redirect = True;
-		iswa.backing_store = NotUseful;
-		iswa.save_under = False;
-		iswa.background_pixmap = ParentRelative;
-
-		iwin = XCreateWindow(dpy, window, 0, 0, wdpy_x, wdpy_y, 0,
-		    depth, InputOutput, &visual, mask, &iswa);
-
-		rfbLog("snapshotting background...\n");
-
-		XMapWindow(dpy, iwin);
-		XSync(dpy, False);
-		image = XGetImage(dpy, iwin, 0, 0, wdpy_x, wdpy_y, AllPlanes,
-		    ZPixmap);
-		XSync(dpy, False);
-		XDestroyWindow(dpy, iwin);
-		rfbLog("done.\n");
-	}
-	if (color == (char *) 0x1) {
-		/* caller will XDestroyImage it: */
-		XImage *xi = image;
-		image = NULL;
-		return xi;
-	}
-
-	/* use black for low colors or failure */
-	pixel = get_pixel(color);
-
-	rfbLog("setting solid background...\n");
-	XSetWindowBackground(dpy, window, pixel);
-	XMapWindow(dpy, expose);
-	XSync(dpy, False);
-	XDestroyWindow(dpy, expose);
-#endif	/* NO_X11 */
-	return NULL;
-}
-
-static void solid_cde(char *color) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!color) {}
-	return;
-#else
-	int wsmax = 16;
-	static XImage *image[16];
-	static Window ws_wins[16];
-	static int nws = -1;
-
-	Window expose;
-	Pixmap pixmap;
-	XGCValues gcv;
-	GC gc;
-	XSetWindowAttributes swa;
-	Visual visual;
-	unsigned long mask, pixel;
-	XColor cdef;
-	Colormap cmap;
-	int n;
-
-	RAWFB_RET_VOID
-
-	if (subwin || window != rootwin) {
-		rfbLog("cannot set subwin to solid color, must be rootwin\n");
-		return;
-	}
-
-	/* create the "clear" window just for generating exposures */
-	swa.override_redirect = True;
-	swa.backing_store = NotUseful;
-	swa.save_under = False;
-	swa.background_pixmap = None;
-	visual.visualid = CopyFromParent;
-	mask = (CWOverrideRedirect|CWBackingStore|CWSaveUnder|CWBackPixmap);
-	expose = XCreateWindow(dpy, window, 0, 0, wdpy_x, wdpy_y, 0, depth,
-	    InputOutput, &visual, mask, &swa);
-
-	if (! color) {
-		/* restore the backdrop windows from the XImage snapshots */
-
-		for (n=0; n < nws; n++) {
-			Window twin;
-
-			if (! image[n]) {
-				continue;
-			}
-
-			twin = ws_wins[n];
-			if (! twin) {
-				twin = rootwin;
-			}
-			if (! valid_window(twin, NULL, 0)) {
-				continue;
-			}
-
-			pixmap = XCreatePixmap(dpy, twin, wdpy_x, wdpy_y,
-			    depth);
-			
-			/* draw the image to a pixmap: */
-			gcv.function = GXcopy;
-			gcv.plane_mask = AllPlanes;
-			gc = XCreateGC(dpy, twin, GCFunction|GCPlaneMask, &gcv);
-
-			XPutImage(dpy, pixmap, gc, image[n], 0, 0, 0, 0,
-			    wdpy_x, wdpy_y);
-
-			gcv.foreground = gcv.background = BlackPixel(dpy, scr);
-			gc = XCreateGC(dpy, twin, GCForeground|GCBackground,
-			    &gcv);
-
-			rfbLog("restoring CDE ws%d snapshot to 0x%lx\n",
-			    n, twin);
-			/* set the pixmap as the bg: */
-			XSetWindowBackgroundPixmap(dpy, twin, pixmap);
-			XFreePixmap(dpy, pixmap);
-			XClearWindow(dpy, twin);
-			XFlush_wr(dpy);
-		}
-		
-		/* generate exposures */
-		XMapWindow(dpy, expose);
-		XSync(dpy, False);
-		XDestroyWindow(dpy, expose);
-		return;
-	}
-
-	if (nws < 0) {
-		/* need to retrieve snapshots of the ws backgrounds: */
-		Window iwin, wm_win;
-		XSetWindowAttributes iswa;
-		Atom dt_list, wm_info, type;
-		int format;
-		unsigned long length, after;
-		unsigned char *data;
-		unsigned long *dp;	/* crash on 64bit with int */
-
-		nws = 0;
-
-		/* extract the hidden wm properties about backdrops: */
-
-		wm_info = XInternAtom(dpy, "_MOTIF_WM_INFO", True);
-		if (wm_info == None) {
-			return;
-		}
-
-		XGetWindowProperty(dpy, rootwin, wm_info, 0L, 10L, False,
-		    AnyPropertyType, &type, &format, &length, &after, &data);
-
-		/*
-		 * xprop -notype -root _MOTIF_WM_INFO
-		 * _MOTIF_WM_INFO = 0x2, 0x580028
-		 */
-
-		if (length < 2 || format != 32 || after != 0) {
-			return;
-		}
-
-		dp = (unsigned long *) data;
-		wm_win = (Window) *(dp+1);	/* 2nd item. */
-
-
-		dt_list = XInternAtom(dpy, "_DT_WORKSPACE_LIST", True);
-		if (dt_list == None) {
-			return;
-		}
-
-		XGetWindowProperty(dpy, wm_win, dt_list, 0L, 10L, False,
-		   AnyPropertyType, &type, &format, &length, &after, &data);
-
-		nws = length;
-
-		if (nws > wsmax) {
-			nws = wsmax;
-		}
-		if (nws < 0) {
-			nws = 0;
-		}
-
-		rfbLog("special CDE win: 0x%lx, %d workspaces\n", wm_win, nws);
-		if (nws == 0) {
-			return;
-		}
-
-		for (n=0; n<nws; n++) {
-			Atom ws_atom;
-			char tmp[32];
-			Window twin;
-			XWindowAttributes attr;
-			int i, cnt;
-
-			image[n] = NULL;
-			ws_wins[n] = 0x0;
-
-			sprintf(tmp, "_DT_WORKSPACE_INFO_ws%d", n);
-			ws_atom = XInternAtom(dpy, tmp, False);
-			if (ws_atom == None) {
-				continue;
-			}
-			XGetWindowProperty(dpy, wm_win, ws_atom, 0L, 100L,
-			   False, AnyPropertyType, &type, &format, &length,
-			   &after, &data);
-
-			if (format != 8 || after != 0) {
-				continue;
-			}
-			/*
-			 * xprop -notype -id wm_win
-			 * _DT_WORKSPACE_INFO_ws0 = "One", "3", "0x2f2f4a",
-			 * "0x63639c", "0x103", "1", "0x58044e"
-			 */
-
-			cnt = 0;
-			twin = 0x0;
-			for (i=0; i< (int) length; i++) {
-				if (*(data+i) != '\0') {
-					continue;
-				}
-				cnt++;	/* count nulls to indicate field */
-				if (cnt == 6) {
-					/* one past the null: */
-					char *q = (char *) (data+i+1);
-					unsigned long in;
-					if (sscanf(q, "0x%lx", &in) == 1) {
-						twin = (Window) in;
-						break;
-					}
-				}
-			}
-			ws_wins[n] = twin;
-
-			if (! twin) {
-				twin = rootwin;
-			}
-
-			XGetWindowAttributes(dpy, twin, &attr);
-			if (twin != rootwin) {
-				if (attr.map_state != IsViewable) {
-					XMapWindow(dpy, twin);
-				}
-				XRaiseWindow(dpy, twin);
-			}
-			XSync(dpy, False);
-		
-			/* create image window: */
-			iswa.override_redirect = True;
-			iswa.backing_store = NotUseful;
-			iswa.save_under = False;
-			iswa.background_pixmap = ParentRelative;
-			visual.visualid = CopyFromParent;
-
-			iwin = XCreateWindow(dpy, twin, 0, 0, wdpy_x, wdpy_y,
-			    0, depth, InputOutput, &visual, mask, &iswa);
-
-			rfbLog("snapshotting CDE backdrop ws%d 0x%lx -> "
-			    "0x%lx ...\n", n, twin, iwin);
-			XMapWindow(dpy, iwin);
-			XSync(dpy, False);
-
-			image[n] = XGetImage(dpy, iwin, 0, 0, wdpy_x, wdpy_y,
-			    AllPlanes, ZPixmap);
-			XSync(dpy, False);
-			XDestroyWindow(dpy, iwin);
-			if (twin != rootwin) {
-				XLowerWindow(dpy, twin);
-				if (attr.map_state != IsViewable) {
-					XUnmapWindow(dpy, twin);
-				}
-			}
-		}
-	}
-	if (nws == 0) {
-		return;
-	}
-
-	/* use black for low colors or failure */
-	pixel = BlackPixel(dpy, scr);
-	if (depth > 8 || strcmp(color, solid_default)) {
-		cmap = DefaultColormap (dpy, scr);
-		if (XParseColor(dpy, cmap, color, &cdef) &&
-		    XAllocColor(dpy, cmap, &cdef)) {
-			pixel = cdef.pixel;
-		} else {
-			rfbLog("error parsing/allocing color: %s\n", color);
-		}
-	}
-
-	rfbLog("setting solid backgrounds...\n");
-
-	for (n=0; n < nws; n++)  {
-		Window twin = ws_wins[n];
-		if (image[n] == NULL) {
-			continue;
-		}
-		if (! twin)  {
-			twin = rootwin;
-		}
-		XSetWindowBackground(dpy, twin, pixel);
-	}
-	XMapWindow(dpy, expose);
-	XSync(dpy, False);
-	XDestroyWindow(dpy, expose);
-#endif	/* NO_X11 */
-}
-
-static char _dbus_str[1100];
-
-char *dbus_session(void) {
-	char *dbus_env = getenv("DBUS_SESSION_BUS_ADDRESS"); 
-	char tmp[1000];
-
-	if (dbus_env != NULL && strlen(dbus_env) > 0) {
-		return "";
-	}
-	if (!dpy) {
-		return "";
-	}
-#if NO_X11
-	return "";
-#else
-	{
-		Atom dbus_prop, dbus_pid;
-		Window r, w, *children;
-		int sbest = -1;
-		unsigned int ui;
-		int rc, i;
-
-		memset(_dbus_str, 0, sizeof(_dbus_str));
-
-		X_LOCK;
-		dbus_prop = XInternAtom(dpy, "_DBUS_SESSION_BUS_ADDRESS", True);
-		dbus_pid  = XInternAtom(dpy, "_DBUS_SESSION_BUS_PID", True);
-		X_UNLOCK;
-		if (dbus_prop == None) {
-			return "";
-		}
-
-		X_LOCK;
-		memset(tmp, 0, sizeof(tmp));
-		get_prop(tmp, sizeof(tmp)-1, dbus_prop, None);
-		X_UNLOCK;
-		if (strcmp(tmp, "")) {
-			if (!strchr(tmp, '\'')) {
-				sprintf(_dbus_str, "env DBUS_SESSION_BUS_ADDRESS='%s'", tmp);
-				return _dbus_str;
-			}
-		}
-
-		X_LOCK;
-		rc = XQueryTree_wr(dpy, rootwin, &r, &w, &children, &ui);
-		X_UNLOCK;
-		if (!rc || children == NULL || ui == 0) {
-			return "";
-		}
-		for (i=0; i < (int) ui; i++) {
-			int pid = -1;
-	
-			X_LOCK;
-			memset(tmp, 0, sizeof(tmp));
-			get_prop(tmp, sizeof(tmp)-1, dbus_prop, children[i]);
-			if (dbus_pid != None) {
-				Atom atype;
-				int aformat;
-				unsigned long nitems, bafter;
-				unsigned char *prop;
-				if (XGetWindowProperty(dpy, children[i], dbus_pid,
-				    0, 1, False, XA_CARDINAL, &atype, &aformat,
-				    &nitems, &bafter, &prop) == Success
-				    && atype == XA_CARDINAL) {
-					pid = *((int *) prop);
-					XFree_wr(prop);
-				}
-			}
-			X_UNLOCK;
-
-			if (strcmp(tmp, "")  && !strchr(tmp, '\'')) {
-				int score = 0;
-				if (1 < pid && pid < 10000000) {
-					struct stat sb;
-					char procfile[32];
-
-					sprintf(procfile, "/proc/%d", pid);
-					if (stat(procfile, &sb) == 0) {
-						score += 10000000;
-					}
-					score += pid;
-				}
-				if (getenv("X11VNC_DBUS_DEBUG")) fprintf(stderr, "win: 0x%lx  pid: %8d  score: %8d  str: %s\n", children[i], pid, score, tmp);
-				if (score > sbest) {
-					sprintf(_dbus_str, "env DBUS_SESSION_BUS_ADDRESS='%s'", tmp);
-					sbest = score;
-				}
-			}
-		}
-		X_LOCK;
-		XFree_wr(children);
-		X_UNLOCK;
-
-		return _dbus_str;
-	}
-#endif
-}
-
-static void solid_gnome(char *color) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!color) {}
-	return;
-#else
-	char get_color[] = "%s gconftool-2 --get "
-	    "/desktop/gnome/background/primary_color";
-	char set_color[] = "%s gconftool-2 --set --type string "
-	    "/desktop/gnome/background/primary_color '%s'";
-	char get_option[] = "%s gconftool-2 --get "
-	    "/desktop/gnome/background/picture_options";
-	char set_option[] = "%s gconftool-2 --set --type string "
-	    "/desktop/gnome/background/picture_options '%s'";
-#if 0
-	char get_shading[] = "%s gconftool-2 --get "
-	    "/desktop/gnome/background/color_shading_type";
-	char set_shading[] = "%s gconftool-2 --set --type string "
-	    "/desktop/gnome/background/color_shading_type '%s'";
-	char get_filename[] = "%s gconftool-2 --get "
-	    "/desktop/gnome/background/picture_filename";
-	char set_filename[] = "%s gconftool-2 --set --type string "
-	    "/desktop/gnome/background/picture_filename '%s'";
-#endif
-	static char *orig_color = NULL;
-	static char *orig_option = NULL;
-	char *cmd, *dbus = "";
-
-	RAWFB_RET_VOID
-
-	dbus = dbus_session();
-	rfbLog("guessed dbus: %s\n", dbus);
-	
-	if (! color) {
-		if (! orig_color) {
-			orig_color = strdup("#FFFFFF");
-		}
-		if (! orig_option) {
-			orig_option = strdup("stretched");
-		}
-		if (strstr(orig_color, "'") != NULL)  {
-			rfbLog("invalid color: %s\n", orig_color);
-			return;
-		}
-		if (strstr(orig_option, "'") != NULL)  {
-			rfbLog("invalid option: %s\n", orig_option);
-			return;
-		}
-		cmd = (char *) malloc(strlen(set_option) - 2 + strlen(orig_option) + strlen(dbus) + 1);
-		sprintf(cmd, set_option, dbus, orig_option);
-		dt_cmd(cmd);
-		free(cmd);
-		cmd = (char *) malloc(strlen(set_color) - 2 + strlen(orig_color) + strlen(dbus) + 1);
-		sprintf(cmd, set_color, dbus, orig_color);
-		dt_cmd(cmd);
-		free(cmd);
-		return;
-	}
-
-	if (! orig_color) {
-		char *q;
-		if (cmd_ok("dt")) {
-			cmd = (char *) malloc(strlen(get_color) + strlen(dbus) + 1);
-			sprintf(cmd, get_color, dbus);
-			orig_color = strdup(cmd_output(cmd));
-			free(cmd);
-		} else {
-			orig_color = "";
-		}
-		if (*orig_color == '\0') {
-			orig_color = strdup("#FFFFFF");
-		}
-		if ((q = strchr(orig_color, '\n')) != NULL) {
-			*q = '\0';
-		}
-	}
-	if (! orig_option) {
-		char *q;
-		if (cmd_ok("dt")) {
-			cmd = (char *) malloc(strlen(get_option) + strlen(dbus) + 1);
-			sprintf(cmd, get_option, dbus);
-			orig_option = strdup(cmd_output(cmd));
-			free(cmd);
-		} else {
-			orig_color = "";
-		}
-		if (*orig_option == '\0') {
-			orig_option = strdup("stretched");
-		}
-		if ((q = strchr(orig_option, '\n')) != NULL) {
-			*q = '\0';
-		}
-	}
-	if (strstr(color, "'") != NULL)  {
-		rfbLog("invalid color: %s\n", color);
-		return;
-	}
-	cmd = (char *) malloc(strlen(set_color) + strlen(color) + strlen(dbus) + 1);
-	sprintf(cmd, set_color, dbus, color);
-	dt_cmd(cmd);
-	free(cmd);
-
-	cmd = (char *) malloc(strlen(set_option) + strlen("none") + strlen(dbus) + 1);
-	sprintf(cmd, set_option, dbus, "none");
-	dt_cmd(cmd);
-	free(cmd);
-
-#if 0
-	cmd = (char *) malloc(strlen(set_filename) + strlen("none") + 1);
-	sprintf(cmd, set_filename, dbus, "none");
-	dt_cmd(cmd);
-	free(cmd);
-#endif
-
-#endif	/* NO_X11 */
-}
-
-static void solid_xfce(char *color) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!color) {}
-	return;
-#else
-	char get_image_show[]  = "%s xfconf-query -v -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show";
-	char set_image_show[]  = "%s xfconf-query -v -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show -s '%s'";
-	char get_color_style[] = "%s xfconf-query -v -c xfce4-desktop -p /backdrop/screen0/monitor0/color-style";
-	char set_color_style[] = "%s xfconf-query -v -c xfce4-desktop -p /backdrop/screen0/monitor0/color-style -s '%s'";
-
-	static char *orig_image_show = NULL;
-	static char *orig_color_style = NULL;
-	char *cmd, *dbus = "";
-
-	RAWFB_RET_VOID
-
-	dbus = dbus_session();
-	rfbLog("guessed dbus: %s\n", dbus);
-	
-	if (! color) {
-		if (! orig_image_show) {
-			orig_image_show = "true";
-		}
-		if (! orig_color_style) {
-			orig_color_style = "0";
-		}
-		if (strstr(orig_image_show, "'") != NULL)  {
-			rfbLog("invalid image show: %s\n", orig_image_show);
-			return;
-		}
-		if (strstr(orig_color_style, "'") != NULL)  {
-			rfbLog("invalid color style: %s\n", orig_color_style);
-			return;
-		}
-		if (orig_image_show[0] != '\0') {
-			cmd = (char *) malloc(strlen(set_image_show) - 2 + strlen(orig_image_show) + strlen(dbus) + 1);
-			sprintf(cmd, set_image_show, dbus, orig_image_show);
-			dt_cmd(cmd);
-			free(cmd);
-		}
-		if (orig_color_style[0] != '\0') {
-			cmd = (char *) malloc(strlen(set_color_style) - 2 + strlen(orig_color_style) + strlen(dbus) + 1);
-			sprintf(cmd, set_color_style, dbus, orig_color_style);
-			dt_cmd(cmd);
-			free(cmd);
-		}
-		return;
-	}
-
-	if (! orig_image_show) {
-		char *q;
-		orig_image_show = "";
-		if (cmd_ok("dt")) {
-			cmd = (char *) malloc(strlen(get_image_show) + strlen(dbus) + 1);
-			sprintf(cmd, get_image_show, dbus);
-			orig_image_show = strdup(cmd_output(cmd));
-			if ((q = strrchr(orig_image_show, '\n')) != NULL) {
-				*q = '\0';
-			}
-			fprintf(stderr, "get_image_show returned: '%s'\n\n", orig_image_show);
-			free(cmd);
-			if (strcasecmp(orig_image_show, "false") && strcasecmp(orig_image_show, "true")) {
-				fprintf(stderr, "unrecognized image_show, disabling.\n");
-				free(orig_image_show);
-				orig_image_show = "";
-			}
-		}
-	}
-	if (! orig_color_style) {
-		char *q;
-		orig_color_style = "";
-		if (cmd_ok("dt")) {
-			cmd = (char *) malloc(strlen(get_color_style) + strlen(dbus) + 1);
-			sprintf(cmd, get_color_style, dbus);
-			orig_color_style = strdup(cmd_output(cmd));
-			if ((q = strrchr(orig_color_style, '\n')) != NULL) {
-				*q = '\0';
-			}
-			fprintf(stderr, "get_color_style returned: '%s'\n\n", orig_color_style);
-			free(cmd);
-			if (strlen(orig_color_style) > 1 || !isdigit((unsigned char) (*orig_color_style))) {
-				fprintf(stderr, "unrecognized color_style, disabling.\n");
-				free(orig_color_style);
-				orig_color_style = "";
-			}
-		}
-	}
-
-	if (strstr(color, "'") != NULL)  {
-		rfbLog("invalid color: %s\n", color);
-		return;
-	}
-
-	cmd = (char *) malloc(strlen(set_color_style) + strlen("0") + strlen(dbus) + 1);
-	sprintf(cmd, set_color_style, dbus, "0");
-	dt_cmd(cmd);
-	free(cmd);
-
-	cmd = (char *) malloc(strlen(set_image_show) + strlen("false") + strlen(dbus) + 1);
-	sprintf(cmd, set_image_show, dbus, "false");
-	dt_cmd(cmd);
-	free(cmd);
-
-#endif	/* NO_X11 */
-}
-
-
-static char *dcop_session(void) {
-	char *empty = strdup("");
-#if NO_X11
-	RAWFB_RET(empty);
-	return empty;
-#else
-	char list_sessions[] = "dcop --user '%s' --list-sessions";
-	int len;
-	char *cmd, *host, *user = NULL;
-	char *out, *p, *ds, *dsn = NULL, *sess = NULL, *sess2 = NULL;
-	int db = 0;
-
-	RAWFB_RET(empty);
-
-	if (getenv("SESSION_MANAGER")) {
-		return empty;
-	}
-
-	user = get_user_name();
-	if (strstr(user, "'") != NULL)  {
-		rfbLog("invalid user: %s\n", user);
-		free(user);
-		return empty;
-	}
-
-	len = strlen(list_sessions) + strlen(user) + 1;
-	cmd = (char *) malloc(len);
-	sprintf(cmd, list_sessions, user);
-
-	out = strdup(cmd_output(cmd));
-	free(cmd);
-	free(user);
-
-	ds = DisplayString(dpy);
-	if (!ds || !strcmp(ds, "")) {
-		ds = getenv("DISPLAY");
-	}
-	if (!ds) {
-		ds = ":0";
-	}
-	ds = strdup(ds);
-	p = strrchr(ds, '.');
-	if (p) *p = '\0';
-
-	dsn = strchr(ds, ':');
-	if (dsn) {
-		*dsn = '_';
-	} else {
-		free(ds);
-		ds = strdup("_0");
-		dsn = ds;
-	}
-	if (db) fprintf(stderr, "ds:  %s\n", ds);
-	if (db) fprintf(stderr, "dsn: %s\n", dsn);
-
-	host = this_host();
-	if (host) {
-		char *h2 = (char *) malloc(strlen(host) + 2 + 1);
-		sprintf(h2, "_%s_", host);
-		free(host);
-		host = h2;
-	} else {
-		host = strdup("");
-	}
-	if (db) fprintf(stderr, "host: %s\n", host);
-
-	p = strtok(out, "\n");
-	while (p) {
-		char *q = strstr(p, ".DCOP");
-		if (db) fprintf(stderr, "p:  %s\n", p);
-		if (q == NULL) {
-			;
-		} else if (host) {
-			if (strstr(q, host)) {
-				char *r = strstr(p, dsn);
-				int n = strlen(dsn);
-				if(r && !isalnum((int) *(r+n))) {
-					sess = strdup(q);
-					break;
-				} else {
-					if (sess2) {
-						free(sess2);
-					}
-					sess2 = strdup(q);
-				}
-			}
-		} else {
-			char *r = strstr(p, dsn);
-			int n = strlen(dsn);
-			if(r && !isalnum((int) *(r+n))) {
-				sess = strdup(q);
-				break;
-			}
-		}
-		p = strtok(NULL, "\n");
-	}
-	free(ds);
-	free(out);
-	free(host);
-	if (!sess && sess2) {
-		sess = sess2;
-	}
-	if (!sess || strchr(sess, '\'')) {
-		if (sess) free(sess);
-		sess = strdup("--all-sessions");
-	} else {
-		len = strlen("--session ") + 2 + strlen(sess) + 1;
-		cmd = (char *) malloc(len);
-		sprintf(cmd, "--session '%s'", sess);
-		free(sess);
-		sess = cmd;
-	}
-	return sess;
-#endif
-}
-
-static void solid_kde(char *color) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!color) {}
-	return;
-#else
-	char set_color[] =
-	    "dcop --user '%s' %s kdesktop KBackgroundIface setColor '%s' 1";
-	char bg_off[] =
-	    "dcop --user '%s' %s kdesktop KBackgroundIface setBackgroundEnabled 0";
-	char bg_on[] =
-	    "dcop --user '%s' %s kdesktop KBackgroundIface setBackgroundEnabled 1";
-	char *cmd, *user = NULL, *sess;
-	int len;
-
-	RAWFB_RET_VOID
-
-	user = get_user_name();
-	if (strstr(user, "'") != NULL)  {
-		rfbLog("invalid user: %s\n", user);
-		free(user);
-		return;
-	}
-
-	set_env("DISPLAY", DisplayString(dpy));
-
-	if (! color) {
-		sess = dcop_session();
-		len = strlen(bg_on) + strlen(user) + strlen(sess) + 1;
-		cmd = (char *) malloc(len);
-		sprintf(cmd, bg_on, user, sess);
-
-		dt_cmd(cmd);
-
-		free(cmd);
-		free(user);
-		free(sess);
-
-		return;
-	}
-
-	if (strstr(color, "'") != NULL)  {
-		rfbLog("invalid color: %s\n", color);
-		return;
-	}
-
-	sess = dcop_session();
-
-	len = strlen(set_color) + strlen(user) + strlen(sess) + strlen(color) + 1;
-	cmd = (char *) malloc(len);
-	sprintf(cmd, set_color, user, sess, color);
-	dt_cmd(cmd);
-	free(cmd);
-
-	len = strlen(bg_off) + strlen(user) + strlen(sess) + 1;
-	cmd = (char *) malloc(len);
-	sprintf(cmd, bg_off, user, sess);
-	dt_cmd(cmd);
-	free(cmd);
-	free(user);
-#endif	/* NO_X11 */
-}
-
-void kde_no_animate(int restore) {
-#if NO_X11
-	if (!restore) {}
-	RAWFB_RET_VOID
-	return;
-#else
-	char query_setting[] =
-	    "kreadconfig  --file kwinrc --group Windows --key AnimateMinimize";
-	char kwinrc_off[] =
-	    "kwriteconfig --file kwinrc --group Windows --key AnimateMinimize --type bool false";
-	char kwinrc_on[] =
-	    "kwriteconfig --file kwinrc --group Windows --key AnimateMinimize --type bool true";
-	char kwin_reconfigure[] =
-	    "dcop --user '%s' %s kwin KWinInterface reconfigure";
-	char *cmd, *cmd2, *out, *user = NULL, *sess;
-	int len;
-	static int anim_state = 1;
-
-	RAWFB_RET_VOID
-
-	if (ncache_keep_anims) {
-		return;
-	}
-
-	if (restore) {
-		if (anim_state == 1) {
-			return;
-		}
-
-		user = get_user_name();
-		if (strstr(user, "'") != NULL)  {
-			rfbLog("invalid user: %s\n", user);
-			free(user);
-			return;
-		}
-
-		sess = dcop_session();
-
-		len = strlen(kwin_reconfigure) + strlen(user) + strlen(sess) + 1;
-		cmd = (char *) malloc(len);
-		sprintf(cmd, kwin_reconfigure, user, sess);
-		rfbLog("\n");
-		rfbLog("Restoring KDE kwinrc settings.\n");
-		rfbLog("\n");
-		dt_cmd(cmd);
-		free(cmd);
-		free(user);
-		free(sess);
-		anim_state = 1;
-		return;
-	} else {
-		if (anim_state == 0) {
-			return;
-		}
-		anim_state = 0;
-	}
-
-	user = get_user_name();
-	if (strstr(user, "'") != NULL)  {
-		rfbLog("invalid user: %s\n", user);
-		free(user);
-		return;
-	}
-	out = cmd_output(query_setting);
-
-
-	if (!out || strstr(out, "false")) {
-		rfbLog("\n");
-		rfbLog("********************************************************\n");
-		rfbLog("KDE kwinrc AnimateMinimize is false. Good.\n");
-		rfbLog("********************************************************\n");
-		rfbLog("\n");
-		free(user);
-		return;
-	}
-
-	rfbLog("\n");
-	rfbLog("********************************************************\n");
-	rfbLog("To improve the -ncache client-side caching performance\n");
-	rfbLog("temporarily setting KDE kwinrc AnimateMinimize to false.\n");
-	rfbLog("It will be reset for the next session or when VNC client\n");
-	rfbLog("disconnects.  Or you can use the Control Center GUI to\n");
-	rfbLog("change it now (toggle its setting a few times):\n");
-	rfbLog("   Desktop -> Window Behavior -> Moving\n");
-	rfbLog("********************************************************\n");
-	rfbLog("\n");
-
-	set_env("DISPLAY", DisplayString(dpy));
-
-	sess = dcop_session();
-	len = strlen(kwin_reconfigure) + strlen(user) + strlen(sess) + 1;
-	cmd = (char *) malloc(len);
-	sprintf(cmd, kwin_reconfigure, user, sess);
-
-	len = 1 + strlen("sleep 10") + 2 + strlen(kwinrc_off) + 2 + strlen(cmd) + 2 + strlen("sleep 5") + 2 + strlen(kwinrc_on) + 3 + 1;
-	cmd2 = (char *) malloc(len);
-
-	sprintf(cmd2, "(sleep 10; %s; %s; sleep 5; %s) &", kwinrc_off, cmd, kwinrc_on);
-
-	dt_cmd(cmd2);
-	free(cmd);
-	free(cmd2);
-	free(user);
-	free(sess);
-#endif	/* NO_X11 */
-}
-
-void gnome_no_animate(void) {
-	;
-}
-
-static pid_t solid_macosx_pid = 0;
-extern char macosx_solid_background[];
-
-static void solid_macosx(int restore) {
-	char tmp[] = "/tmp/macosx_solid_background.XXXXXX";
-	pid_t pid, parent = getpid();
-
-	if (restore) {
-		rfbLog("restore pid: %d\n", (int) solid_macosx_pid);
-		if (solid_macosx_pid > 0) {
-#if 0
-			int i, status;
-#endif
-			rfbLog("kill -TERM macosx_solid_background helper pid: %d\n", (int) solid_macosx_pid);
-			kill(solid_macosx_pid, SIGTERM);
-#if 0
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H
-#if LIBVNCSERVER_HAVE_WAITPID
-			for (i=0; i < 7; i++) {
-				usleep(1000 * 1000);
-				waitpid(solid_macosx_pid, &status, WNOHANG); 
-				if (kill(solid_macosx_pid, 0) != 0) {
-					break;
-				}
-			}
-#endif
-#endif
-#endif
-			solid_macosx_pid = 0;
-		}
-		return;
-	}
-	if (no_external_cmds || !cmd_ok("dt")) {
-		return;
-	}
-#if LIBVNCSERVER_HAVE_FORK
-	pid = fork();
-
-	if (pid == -1) {
-		perror("fork");
-		return;
-	}
-	if (pid == 0) {
-		int fd = mkstemp(tmp);
-#if LIBVNCSERVER_HAVE_SETSID
-		setsid();
-#else
-		setpgrp();
-#endif
-		if (fd >= 0) {
-			char num[32];
-			write(fd, macosx_solid_background, strlen(macosx_solid_background));
-			close(fd);
-			sprintf(num, "%d", (int) parent);
-			set_env("SS_WATCH_PID", num);
-			execlp("/bin/sh", "/bin/sh", tmp, (char *) NULL);
-		}
-		exit(1);
-	}
-	solid_macosx_pid = pid;
-	rfbLog("macosx_solid_background helper pid: %d\n", (int) solid_macosx_pid);
-	usleep(2750 * 1000);
-	unlink(tmp);
-#endif
-}
-
-char *guess_desktop(void) {
-#if NO_X11
-	RAWFB_RET("root")
-	return "root";
-#else
-	Atom prop;
-
-	RAWFB_RET("root")
-
-	if (wmdt_str && *wmdt_str != '\0') {
-		char *s = wmdt_str;
-		lowercase(s);
-		if (strstr(s, "xfce")) {
-			return "xfce";
-		}
-		if (strstr(s, "gnome") || strstr(s, "metacity")) {
-			return "gnome";
-		}
-		if (strstr(s, "kde") || strstr(s, "kwin")) {
-			return "kde";
-		}
-		if (strstr(s, "cde")) {
-			return "cde";
-		}
-		return "root";
-	}
-
-	if (! dpy) {
-		return "";
-	}
-
-	prop = XInternAtom(dpy, "XFCE_DESKTOP_WINDOW", True);
-	if (prop != None) return "xfce";
-
-	/* special case windowmaker */
-	prop = XInternAtom(dpy, "_WINDOWMAKER_WM_PROTOCOLS", True);
-	if (prop != None)  return "root";
-
-	prop = XInternAtom(dpy, "_WINDOWMAKER_COMMAND", True);
-	if (prop != None) return "root";
-
-	prop = XInternAtom(dpy, "NAUTILUS_DESKTOP_WINDOW_ID", True);
-	if (prop != None) return "gnome";
-
-	prop = XInternAtom(dpy, "KWIN_RUNNING", True);
-	if (prop != None) {
-		prop = XInternAtom(dpy, "_KDE_RUNNING", True);
-		if (prop != None) {
-			prop = XInternAtom(dpy, "KDE_DESKTOP_WINDOW", True);
-			if (prop != None) return "kde";
-		}
-	}
-
-	prop = XInternAtom(dpy, "_MOTIF_WM_INFO", True);
-	if (prop != None) {
-		prop = XInternAtom(dpy, "_DT_WORKSPACE_LIST", True);
-		if (prop != None) return "cde";
-	}
-	return "root";
-#endif	/* NO_X11 */
-}
-
-XImage *solid_image(char *color) {
-#if NO_X11
-	RAWFB_RET(NULL)
-	return NULL;
-#else
-	XImage *image = NULL;
-	unsigned long pixel = 0;
-	int x, y;
-
-	RAWFB_RET(NULL)
-
-	if (!color) {
-		color = last_color;
-	}
-
-	if (!color) {
-		return NULL;
-	}
-
-	image = XGetImage(dpy, rootwin, 0, 0, wdpy_x, wdpy_y, AllPlanes,
-	    ZPixmap);
-
-	if (!image) {
-		return NULL;
-	}
-	pixel = get_pixel(color);
-
-	for (y=0; y<wdpy_y; y++) {
-		for (x=0; x<wdpy_x; x++) {
-			XPutPixel(image, x, y, pixel);
-		}
-	}
-	return image;
-#endif	/* NO_X11 */
-}
-
-void solid_bg(int restore) {
-	static int desktop = -1;
-	static int solid_on = 0;
-	static char *prev_str;
-	char *dtname, *color;
-
-	if (started_as_root == 1 && users_list) {
-		/* we are still root, don't try. */
-		return;
-	}
-
-	if (macosx_console) {
-		solid_macosx(restore);
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-	if (restore) {
-		if (! solid_on) {
-			return;
-		}
-		if (desktop == 0) {
-			solid_root(NULL);
-		} else if (desktop == 1) {
-			solid_gnome(NULL);
-		} else if (desktop == 2) {
-			solid_kde(NULL);
-		} else if (desktop == 3) {
-			solid_cde(NULL);
-		} else if (desktop == 4) {
-			solid_xfce(NULL);
-		}
-		solid_on = 0;
-		return;
-	}
-	if (! solid_str) {
-		return;
-	}
-	if (solid_on && !strcmp(prev_str, solid_str)) {
-		return;
-	}
-	if (strstr(solid_str, "guess:") == solid_str
-	    || !strchr(solid_str, ':')) {
-		dtname = guess_desktop();
-		rfbLog("guessed desktop: %s\n", dtname);
-	} else {
-		if (strstr(solid_str, "gnome:") == solid_str) {
-			dtname = "gnome";
-		} else if (strstr(solid_str, "kde:") == solid_str) {
-			dtname = "kde";
-		} else if (strstr(solid_str, "cde:") == solid_str) {
-			dtname = "cde";
-		} else if (strstr(solid_str, "xfce:") == solid_str) {
-			dtname = "xfce";
-		} else {
-			dtname = "root";
-		}
-	}
-
-	color = strchr(solid_str, ':');
-	if (! color) {
-		color = solid_str;
-	} else {
-		color++;
-		if (*color == '\0') {
-			color = solid_default;
-		}
-	}
-	if (last_color) {
-		free(last_color);
-	}
-	last_color = strdup(color);
-
-	if (!strcmp(dtname, "gnome")) {
-		desktop = 1;
-		solid_gnome(color);
-	} else if (!strcmp(dtname, "kde")) {
-		desktop = 2;
-		solid_kde(color);
-	} else if (!strcmp(dtname, "cde")) {
-		desktop = 3;
-		solid_cde(color);
-	} else if (!strcmp(dtname, "xfce")) {
-		desktop = 4;
-		solid_xfce(color);
-	} else {
-		desktop = 0;
-		solid_root(color);
-	}
-	if (prev_str) {
-		free(prev_str);
-	}
-	prev_str = strdup(solid_str);
-	solid_on = 1;
-}
-
-
diff --git a/ica/x11/x11vnc/solid.h b/ica/x11/x11vnc/solid.h
deleted file mode 100644
index 4d45ace..0000000
--- a/ica/x11/x11vnc/solid.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SOLID_H
-#define _X11VNC_SOLID_H
-
-/* -- solid.h -- */
-
-extern char *guess_desktop(void);
-extern unsigned long get_pixel(char *color);
-extern XImage *solid_image(char *color);
-extern void solid_bg(int restore);
-extern char *dbus_session(void);
-extern XImage *solid_root(char *color);
-extern void kde_no_animate(int restore);
-extern void gnome_no_animate(void);
-
-#endif /* _X11VNC_SOLID_H */
diff --git a/ica/x11/x11vnc/sslcmds.c b/ica/x11/x11vnc/sslcmds.c
deleted file mode 100644
index 52cd231..0000000
--- a/ica/x11/x11vnc/sslcmds.c
+++ /dev/null
@@ -1,916 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- sslcmds.c -- */
-
-#include "x11vnc.h"
-#include "inet.h"
-#include "cleanup.h"
-#include "sslhelper.h"
-#include "ssltools.h"
-#include "connections.h"
-
-#if LIBVNCSERVER_HAVE_FORK
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H
-#if LIBVNCSERVER_HAVE_WAITPID
-#define SSLCMDS
-#endif
-#endif
-#endif
-
-
-void check_stunnel(void);
-int start_stunnel(int stunnel_port, int x11vnc_port, int hport, int x11vnc_hport);
-void stop_stunnel(void);
-void setup_stunnel(int rport, int *argc, char **argv);
-char *get_Cert_dir(char *cdir_in, char **tmp_in);
-void sslScripts(void);
-void sslGenCA(char *cdir);
-void sslGenCert(char *ty, char *nm);
-void sslEncKey(char *path, int info_only);
-
-static pid_t stunnel_pid = 0;
-
-void check_stunnel(void) {
-	static time_t last_check = 0;
-	time_t now = time(NULL);
-
-	if (last_check + 3 >= now) {
-		return;
-	}
-	last_check = now;
-
-	/* double check that stunnel is still running: */
-
-	if (stunnel_pid > 0) {
-		int status;
-#ifdef SSLCMDS
-		waitpid(stunnel_pid, &status, WNOHANG); 
-#endif
-		if (kill(stunnel_pid, 0) != 0) {
-#ifdef SSLCMDS
-			waitpid(stunnel_pid, &status, WNOHANG); 
-#endif
-			rfbLog("stunnel subprocess %d died.\n", stunnel_pid); 
-			stunnel_pid = 0;
-			clean_up_exit(1);
-		}
-	}
-}
-
-int start_stunnel(int stunnel_port, int x11vnc_port, int hport, int x11vnc_hport) {
-#ifdef SSLCMDS
-	char extra[] = ":/usr/sbin:/usr/local/sbin:/dist/sbin";
-	char *path, *p, *exe;
-	char *stunnel_path = NULL;
-	struct stat verify_buf;
-	struct stat crl_buf;
-	int status, tmp_pem = 0;
-
-	if (stunnel_pid) {
-		stop_stunnel();
-	}
-	stunnel_pid = 0;
-
-	path = getenv("PATH");
-	if (! path) {
-		path = strdup(extra+1);
-	} else {
-		char *pt = path;
-		path = (char *) malloc(strlen(path)+strlen(extra)+1);
-		if (! path) {
-			return 0;
-		}
-		strcpy(path, pt);
-		strcat(path, extra);
-	}
-
-	exe = (char *) malloc(strlen(path) + 1 + strlen("stunnel4") + 1);
-
-	p = strtok(path, ":");
-
-	exe[0] = '\0';
-
-	while (p) {
-		struct stat sbuf;
-
-		sprintf(exe, "%s/%s", p, "stunnel4");
-		if (! stunnel_path && stat(exe, &sbuf) == 0) {
-			if (! S_ISDIR(sbuf.st_mode)) {
-				stunnel_path = exe;
-				break;
-			}
-		}
-
-		sprintf(exe, "%s/%s", p, "stunnel");
-		if (! stunnel_path && stat(exe, &sbuf) == 0) {
-			if (! S_ISDIR(sbuf.st_mode)) {
-				stunnel_path = exe;
-				break;
-			}
-		}
-
-		p = strtok(NULL, ":");
-	}
-	if (path) {
-		free(path);
-	}
-
-	if (getenv("STUNNEL_PROG")) {
-		free(exe);
-		exe = strdup(getenv("STUNNEL_PROG"));
-		stunnel_path = exe;
-	}
-
-	if (! stunnel_path) {
-		free(exe);
-		return 0;
-	}
-	if (stunnel_path[0] == '\0') {
-		free(exe);
-		return 0;
-	}
-
-	/* stunnel */
-	if (no_external_cmds || !cmd_ok("stunnel")) {
-		rfbLogEnable(1);
-		rfbLog("start_stunnel: cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", stunnel_path);
-		rfbLog("   exiting.\n");
-		clean_up_exit(1);
-	}
-
-	if (! quiet) {
-		rfbLog("\n");
-		rfbLog("starting ssl tunnel: %s  %d -> %d\n", stunnel_path,
-		    stunnel_port, x11vnc_port);
-	}
-
-	if (stunnel_pem && strstr(stunnel_pem, "SAVE") == stunnel_pem) {
-		stunnel_pem = get_saved_pem(stunnel_pem, 1);
-		if (! stunnel_pem) {
-			rfbLog("start_stunnel: could not create or open"
-			    " saved PEM.\n");	
-			clean_up_exit(1);
-		}
-	} else if (!stunnel_pem) {
-		stunnel_pem = create_tmp_pem(NULL, 0);
-		if (! stunnel_pem) {
-			rfbLog("start_stunnel: could not create temporary,"
-			    " self-signed PEM.\n");	
-			clean_up_exit(1);
-		}
-		tmp_pem = 1;
-		if (getenv("X11VNC_SHOW_TMP_PEM")) {
-			FILE *in = fopen(stunnel_pem, "r");
-			if (in != NULL) {
-				char line[128];
-				fprintf(stderr, "\n");
-				while (fgets(line, 128, in) != NULL) {
-					fprintf(stderr, "%s", line);
-				}
-				fprintf(stderr, "\n");
-				fclose(in);
-			}
-		}
-	}
-
-	if (ssl_verify) {
-		char *file = get_ssl_verify_file(ssl_verify);
-		if (file) {
-			ssl_verify = file;
-		}
-		if (stat(ssl_verify, &verify_buf) != 0) {
-			rfbLog("stunnel: %s does not exist.\n", ssl_verify);
-			clean_up_exit(1);
-		}
-	}
-	if (ssl_crl) {
-		if (stat(ssl_crl, &crl_buf) != 0) {
-			rfbLog("stunnel: %s does not exist.\n", ssl_crl);
-			clean_up_exit(1);
-		}
-	}
-
-	stunnel_pid = fork();
-
-	if (stunnel_pid < 0) {
-		stunnel_pid = 0;
-		free(exe);
-		return 0;
-	}
-
-	if (stunnel_pid == 0) {
-		FILE *in;
-		char fd[20];
-		int i;
-		char *st_if = getenv("STUNNEL_LISTEN");
-
-		if (st_if == NULL) {
-			st_if = "";
-		} else {
-			st_if = (char *) malloc(strlen(st_if) + 2);
-			sprintf(st_if, "%s:", getenv("STUNNEL_LISTEN"));
-		}
-
-
-		for (i=3; i<256; i++) {
-			close(i);
-		}
-
-		if (use_stunnel == 3) {
-			char sp[30], xp[30], *a = NULL;
-			char *st = stunnel_path;
-			char *pm = stunnel_pem;
-			char *sv = ssl_verify;
-
-			sprintf(sp, "%d", stunnel_port);
-			sprintf(xp, "%d", x11vnc_port);
-
-			if (ssl_verify) {
-				if(S_ISDIR(verify_buf.st_mode)) {
-					a = "-a";
-				} else {
-					a = "-A";
-				}
-			}
-
-			if (ssl_crl) {
-				rfbLog("stunnel: stunnel3 does not support CRL. %s\n", ssl_crl);
-				clean_up_exit(1);
-			}
-			
-			if (stunnel_pem && ssl_verify) {
-				/* XXX double check -v 2 */
-				execlp(st, st, "-f", "-d", sp, "-r", xp, "-P",
-				    "none", "-p", pm, a, sv, "-v", "2",
-				    (char *) NULL);
-			} else if (stunnel_pem && !ssl_verify) {
-				execlp(st, st, "-f", "-d", sp, "-r", xp, "-P",
-				    "none", "-p", pm,
-				    (char *) NULL);
-			} else if (!stunnel_pem && ssl_verify) {
-				execlp(st, st, "-f", "-d", sp, "-r", xp, "-P",
-				    "none", a, sv, "-v", "2",
-				    (char *) NULL);
-			} else {
-				execlp(st, st, "-f", "-d", sp, "-r", xp, "-P",
-				    "none", (char *) NULL);
-			}
-			exit(1);
-		}
-
-		in = tmpfile();
-		if (! in) {
-			exit(1);
-		}
-
-		fprintf(in, "foreground = yes\n");
-		fprintf(in, "pid =\n");
-		if (stunnel_pem) {
-			fprintf(in, "cert = %s\n", stunnel_pem);
-		}
-		if (ssl_crl) {
-			if(S_ISDIR(crl_buf.st_mode)) {
-				fprintf(in, "CRLpath = %s\n", ssl_crl);
-			} else {
-				fprintf(in, "CRLfile = %s\n", ssl_crl);
-			}
-		}
-		if (ssl_verify) {
-			if(S_ISDIR(verify_buf.st_mode)) {
-				fprintf(in, "CApath = %s\n", ssl_verify);
-			} else {
-				fprintf(in, "CAfile = %s\n", ssl_verify);
-			}
-			fprintf(in, "verify = 2\n");
-		}
-		fprintf(in, ";debug = 7\n\n");
-		fprintf(in, "[x11vnc_stunnel]\n");
-		fprintf(in, "accept = %s%d\n", st_if, stunnel_port);
-		fprintf(in, "connect = %d\n", x11vnc_port);
-
-		if (hport > 0 && x11vnc_hport > 0) {
-			fprintf(in, "\n[x11vnc_http]\n");
-			fprintf(in, "accept = %s%d\n", st_if, hport);
-			fprintf(in, "connect = %d\n", x11vnc_hport);
-		}
-
-		fflush(in);
-		rewind(in);
-
-		if (getenv("STUNNEL_DEBUG")) {
-			char line[1000];
-			fprintf(stderr, "\nstunnel config contents:\n\n");
-			while (fgets(line, sizeof(line), in) != NULL) {
-				fprintf(stderr, "%s", line);
-			}
-			fprintf(stderr, "\n");
-			rewind(in);
-		}
-		
-		sprintf(fd, "%d", fileno(in));
-		execlp(stunnel_path, stunnel_path, "-fd", fd, (char *) NULL);
-		exit(1);
-	}
-
-	free(exe);
-	usleep(750 * 1000);
-
-	waitpid(stunnel_pid, &status, WNOHANG); 
-
-	if (ssl_verify && strstr(ssl_verify, "/sslverify-tmp-load-")) {
-		/* temporary file */
-		usleep(1000 * 1000);
-		unlink(ssl_verify);
-	}
-	if (tmp_pem) {
-		/* temporary cert */
-		usleep(1500 * 1000);
-		unlink(stunnel_pem);
-	}
-
-	if (kill(stunnel_pid, 0) != 0) {
-		waitpid(stunnel_pid, &status, WNOHANG); 
-		stunnel_pid = 0;
-		return 0;
-	}
-
-	if (! quiet) {
-		rfbLog("stunnel pid is: %d\n", (int) stunnel_pid);
-	}
-
-	return 1;
-#else
-	return 0;
-#endif
-}
-
-void stop_stunnel(void) {
-	int status;
-	if (! stunnel_pid) {
-		return;
-	}
-#ifdef SSLCMDS
-	kill(stunnel_pid, SIGTERM);
-	usleep (150 * 1000);
-	kill(stunnel_pid, SIGKILL);
-	usleep (50 * 1000);
-	waitpid(stunnel_pid, &status, WNOHANG); 
-#endif
-	stunnel_pid = 0;
-}
-
-void setup_stunnel(int rport, int *argc, char **argv) {
-	int i, xport = 0, hport = 0, xhport = 0;
-
-	if (! rport && argc && argv) {
-		for (i=0; i< *argc; i++) {
-			if (argv[i] && !strcmp(argv[i], "-rfbport")) {
-				if (i < *argc - 1) {
-					rport = atoi(argv[i+1]);
-				}
-			}
-		}
-	}
-
-	if (! rport) {
-		/* we do our own autoprobing then... */
-		rport = find_free_port(5900, 5999);
-		if (! rport) {
-			goto stunnel_fail;
-		}
-	}
-
-	xport = find_free_port(5950, 5999);
-	if (! xport) {
-		goto stunnel_fail; 
-	}
-
-	if (https_port_num > 0) {
-		hport = https_port_num;
-	}
-
-	if (! hport && argc && argv) {
-		for (i=0; i< *argc; i++) {
-			if (argv[i] && !strcmp(argv[i], "-httpport")) {
-				if (i < *argc - 1) {
-					hport = atoi(argv[i+1]);
-				}
-			}
-		}
-	}
-
-	if (! hport && http_try_it) {
-		hport = find_free_port(rport-100, rport-1);
-		if (! hport) {
-			goto stunnel_fail;
-		}
-	}
-	if (hport) {
-		xhport = find_free_port(5850, 5899);
-		if (! xhport) {
-			goto stunnel_fail; 
-		}
-		stunnel_http_port = hport;
-	}
-	
-
-	if (start_stunnel(rport, xport, hport, xhport)) {
-		int tweaked = 0;
-		char tmp[30];
-		sprintf(tmp, "%d", xport);
-		if (argc && argv) {
-			for (i=0; i < *argc; i++) {
-				if (argv[i] && !strcmp(argv[i], "-rfbport")) {
-					if (i < *argc - 1) {
-						/* replace orig value */
-						argv[i+i] = strdup(tmp); 
-						tweaked = 1;
-						break;
-					}
-				}
-			}
-			if (! tweaked) {
-				i = *argc;
-				argv[i] = strdup("-rfbport");
-				argv[i+1] = strdup(tmp);
-				*argc += 2;
-				got_rfbport = 1;
-				got_rfbport_val = atoi(tmp);
-			}
-		}
-		stunnel_port = rport;
-		ssl_initialized = 1;
-		return;
-	}
-
-	stunnel_fail:
-	rfbLog("failed to start stunnel.\n");
-	clean_up_exit(1);
-}
-
-char *get_Cert_dir(char *cdir_in, char **tmp_in) {
-	char *cdir, *home, *tmp;
-	struct stat sbuf;
-	int i;
-	char *cases1[] = {"/.vnc", "/.vnc/certs", "/.vnc/certs/CA"};
-	char *cases2[] = {"", "/CA", "/tmp"};
-
-	if (cdir_in != NULL) {
-		cdir = cdir_in;
-	} else {
-		cdir = ssl_certs_dir;
-	}
-
-	if (cdir == NULL) {
-		home = get_home_dir();
-		if (! home) {
-			return NULL;
-		}
-		cdir = (char *) malloc(strlen(home) + strlen("/.vnc/certs/CA") + 1);
-		for (i=0; i<3; i++) {
-			sprintf(cdir, "%s%s", home, cases1[i]);
-			if (stat(cdir, &sbuf) != 0) {
-				rfbLog("creating dir: %s\n", cdir);
-#ifdef WIN32
-				if (mkdir(cdir) != 0) {
-#else
-				if (mkdir(cdir, 0755) != 0) {
-#endif
-					rfbLog("could not create directory %s\n", cdir);
-					rfbLogPerror("mkdir");
-					return NULL;
-				}
-			} else if (! S_ISDIR(sbuf.st_mode)) {
-				rfbLog("not a directory: %s\n", cdir);
-				return NULL;
-			}
-		}
-		sprintf(cdir, "%s%s", home, cases1[1]);
-	}
-
-	tmp = (char *) malloc(strlen(cdir) + strlen("/tmp") + 1);
-	for (i=0; i<3; i++) {
-		int ret;
-		sprintf(tmp, "%s%s", cdir, cases2[i]);
-		if (stat(tmp, &sbuf) != 0) {
-			rfbLog("creating dir: %s\n", tmp);
-#ifdef WIN32
-			ret = mkdir(tmp);
-#else
-			if (! strcmp(cases2[i], "/tmp")) {
-				ret = mkdir(tmp, 0700);
-			} else {
-				ret = mkdir(tmp, 0755);
-			}
-#endif
-				
-			if (ret != 0) {
-				rfbLog("could not create directory %s\n", tmp);
-				rfbLogPerror("mkdir");
-				return NULL;
-			}
-		} else if (! S_ISDIR(sbuf.st_mode)) {
-			rfbLog("not a directory: %s\n", tmp);
-			return NULL;
-		}
-	}
-	sprintf(tmp, "%s/tmp", cdir);
-	*tmp_in = tmp;
-	return cdir;
-}
-
-static char *getsslscript(char *cdir, char *name, char *script) {
-	char *openssl = find_openssl_bin();
-	char *tmp, *scr, *cdir_use;
-	FILE *out;
-
-	if (! openssl || openssl[0] == '\0') {
-		exit(1);
-	}
-
-	if (!name || !script) {
-		exit(1);
-	}
-
-	cdir_use = get_Cert_dir(cdir, &tmp);
-	if (!cdir_use || !tmp) {
-		exit(1);
-	}
-
-	scr = (char *) malloc(strlen(tmp) + 1 + strlen(name) + 30);
-
-	sprintf(scr, "%s/%s.%d.sh", tmp, name, getpid());
-	out = fopen(scr, "w");
-	if (! out) {
-		rfbLog("could not open: %s\n", scr);
-		rfbLogPerror("fopen");
-		exit(1);
-	}
-	fprintf(out, "%s", script);
-	fclose(out);
-
-	rfbLog("Using openssl:   %s\n", openssl);
-	rfbLog("Using certs dir: %s\n", cdir_use);
-	fprintf(stderr, "\n");
-
-	set_env("BASE_DIR", cdir_use);
-	set_env("OPENSSL", openssl);
-
-	return scr;
-}
-
-void sslScripts(void) {
-	fprintf(stdout, "======================================================\n");
-	fprintf(stdout, "genCA script for '-sslGenCA':\n\n");
-	fprintf(stdout, "%s\n", genCA);
-	fprintf(stdout, "======================================================\n");
-	fprintf(stdout, "genCert script for '-sslGenCert', etc.:\n\n");
-	fprintf(stdout, "%s\n", genCert);
-}
-
-void sslGenCA(char *cdir) {
-	char *cmd, *scr = getsslscript(cdir, "genca", genCA);
-
-	if (! scr) {
-		exit(1);
-	}
-
-	cmd = (char *)malloc(strlen("/bin/sh ") + strlen(scr) + 1);
-	sprintf(cmd, "/bin/sh %s", scr);
-
-	system(cmd);
-	unlink(scr);
-
-	free(cmd);
-	free(scr);
-}
-
-void sslGenCert(char *ty, char *nm) {
-	char *cmd, *scr = getsslscript(NULL, "gencert", genCert);
-
-	if (! scr) {
-		exit(1);
-	}
-
-	cmd = (char *)malloc(strlen("/bin/sh ") + strlen(scr) + 1);
-	sprintf(cmd, "/bin/sh %s", scr);
-
-	if (! ty) {
-		set_env("TYPE", "");
-	} else {
-		set_env("TYPE", ty);
-	}
-	if (! nm) {
-		set_env("NAME", "");
-	} else {
-		char *q = strstr(nm, "SAVE-");
-		if (!strcmp(nm, "SAVE")) {
-			set_env("NAME", "");
-		} else if (q == nm) {
-			q += strlen("SAVE-");
-			set_env("NAME", q);
-		} else {
-			set_env("NAME", nm);
-		}
-	}
-
-	system(cmd);
-	unlink(scr);
-
-	free(cmd);
-	free(scr);
-}
-
-void sslEncKey(char *path, int mode) {
-	char *openssl = find_openssl_bin();
-	char *scr, *cert = NULL, *tca, *cdir = NULL;
-	char line[1024], tmp[] = "/tmp/x11vnc-tmp.XXXXXX";
-	int tmp_fd, incert, info_only = 0, delete_only = 0, listlong = 0;
-	struct stat sbuf;
-	FILE *file;
-	static int depth = 0;
-
-	if (depth > 0) {
-		/* get_saved_pem may call us back. */
-		return;
-	}
-
-	if (! path) {
-		return;
-	}
-
-	depth++;
-
-	if (mode == 1) {
-		info_only = 1;
-	} else if (mode == 2) {
-		delete_only = 1;
-	}
-
-	if (! openssl) {
-		exit(1);
-	}
-
-	cdir = get_Cert_dir(NULL, &tca);
-	if (! cdir || ! tca) {
-		fprintf(stderr, "could not find Cert dir\n");
-		exit(1);
-	}
-
-	if (!strcasecmp(path, "LL") || !strcasecmp(path, "LISTL")) {
-		listlong = 1;
-		path = "LIST";
-	}
-
-	if (strstr(path, "SAVE") == path) {
-		char *p = get_saved_pem(path, 0);
-		if (p == NULL) {
-			fprintf(stderr, "could not find saved pem "
-			    "matching: %s\n", path);
-			exit(1);
-		}
-		path = p;
-
-	} else if (!strcmp(path, "CA")) {
-		tca = (char *) malloc(strlen(cdir)+strlen("/CA/cacert.pem")+1);
-		sprintf(tca, "%s/CA/cacert.pem", cdir);
-		path = tca;
-
-	} else if (info_only && (!strcasecmp(path, "LIST") ||
-	    !strcasecmp(path, "LS") || !strcasecmp(path, "ALL"))) {
-
-		if (! program_name || strchr(program_name, ' ')) {
-			fprintf(stderr, "bad program name.\n");
-			exit(1);
-		}
-		if (strchr(cdir, '\'')) {
-			fprintf(stderr, "bad certdir char: %s\n", cdir);
-			exit(1);
-		}
-
-		tca = (char *) malloc(2*strlen(cdir)+strlen(program_name)+1000);
-
-		sprintf(tca, "find '%s' | egrep '/(CA|tmp|clients)$|"
-		    "\\.(crt|pem|key|req)$' | grep -v CA/newcerts", cdir);
-
-		if (!strcasecmp(path, "ALL")) {
-			/* ugh.. */
-			strcat(tca, " | egrep -v 'private/cakey.pem|"
-			    "(CA|tmp|clients)$' | xargs -n1 ");
-			strcat(tca, program_name);
-			strcat(tca, " -ssldir '");
-			strcat(tca, cdir);
-			strcat(tca, "' -sslCertInfo 2>&1 ");
-		} else if (listlong) {
-			strcat(tca, " | xargs ls -ld ");
-		}
-		system(tca);
-		free(tca);
-
-		depth--;
-		return;
-
-	} else if (info_only && (!strcasecmp(path, "HASHON")
-	    || !strcasecmp(path, "HASHOFF"))) {
-
-		tmp_fd = mkstemp(tmp);
-		if (tmp_fd < 0) {
-			exit(1);
-		}
-
-		write(tmp_fd, genCert, strlen(genCert));
-		close(tmp_fd);
-
-		scr = (char *) malloc(strlen("/bin/sh ") + strlen(tmp) + 1);
-		sprintf(scr, "/bin/sh %s", tmp);
-
-		set_env("BASE_DIR", cdir);
-		set_env("OPENSSL", openssl);
-		set_env("TYPE", "server");
-		if (!strcasecmp(path, "HASHON")) {
-			set_env("HASHON", "1");
-		} else {
-			set_env("HASHOFF", "1");
-		}
-		system(scr);
-		unlink(tmp);
-		free(scr);
-
-		depth--;
-		return;
-	}
-
-
-	if (stat(path, &sbuf) != 0) {
-	    if (strstr(path, "client") || strchr(path, '/') == NULL) {
-		int i;
-		tca = (char *) malloc(strlen(cdir) + strlen(path) + 100);
-		for (i = 1; i <= 15; i++)  {
-			tca[0] = '\0';
-			if (       i == 1) {
-			    sprintf(tca, "%s/%s", cdir, path); 
-			} else if (i == 2 && mode > 0) {
-			    sprintf(tca, "%s/%s.crt", cdir, path); 
-			} else if (i == 3) {
-			    sprintf(tca, "%s/%s.pem", cdir, path); 
-			} else if (i == 4 && mode > 1) {
-			    sprintf(tca, "%s/%s.req", cdir, path); 
-			} else if (i == 5 && mode > 1) {
-			    sprintf(tca, "%s/%s.key", cdir, path); 
-			} else if (i == 6) {
-			    sprintf(tca, "%s/clients/%s", cdir, path); 
-			} else if (i == 7 && mode > 0) {
-			    sprintf(tca, "%s/clients/%s.crt", cdir, path); 
-			} else if (i == 8) {
-			    sprintf(tca, "%s/clients/%s.pem", cdir, path); 
-			} else if (i == 9 && mode > 1) {
-			    sprintf(tca, "%s/clients/%s.req", cdir, path); 
-			} else if (i == 10 && mode > 1) {
-			    sprintf(tca, "%s/clients/%s.key", cdir, path); 
-			} else if (i == 11) {
-			    sprintf(tca, "%s/server-%s", cdir, path); 
-			} else if (i == 12 && mode > 0) {
-			    sprintf(tca, "%s/server-%s.crt", cdir, path); 
-			} else if (i == 13) {
-			    sprintf(tca, "%s/server-%s.pem", cdir, path); 
-			} else if (i == 14 && mode > 1) {
-			    sprintf(tca, "%s/server-%s.req", cdir, path); 
-			} else if (i == 15 && mode > 1) {
-			    sprintf(tca, "%s/server-%s.key", cdir, path); 
-			}
-			if (tca[0] == '\0') {
-				continue;
-			}
-			if (stat(tca, &sbuf) == 0) {
-				path = tca;
-				break;
-			}
-		}
-	    }
-	}
-
-	if (stat(path, &sbuf) != 0) {
-		rfbLog("sslEncKey: %s\n", path);
-		rfbLogPerror("stat");
-		exit(1);
-	}
-
-	if (! info_only) {
-		cert = (char *) malloc(2*(sbuf.st_size + 1024));
-		file = fopen(path, "r");
-		if (file == NULL) {
-			rfbLog("sslEncKey: %s\n", path);
-			rfbLogPerror("fopen");
-			exit(1);
-		}
-		incert = 0;
-		cert[0] = '\0';
-		while (fgets(line, 1024, file) != NULL) {
-			if (strstr(line, "-----BEGIN CERTIFICATE-----")
-			    == line) {
-				incert = 1;
-			}
-			if (incert) {
-				if (strlen(cert)+strlen(line) <
-				    2 * (size_t) sbuf.st_size) {
-					strcat(cert, line);
-				}
-			}
-			if (strstr(line, "-----END CERTIFICATE-----")
-			    == line) {
-				incert = 0;
-			}
-		}
-		fclose(file);
-	}
-
-	tmp_fd = mkstemp(tmp);
-	if (tmp_fd < 0) {
-		exit(1);
-	}
-
-	write(tmp_fd, genCert, strlen(genCert));
-	close(tmp_fd);
-
-        scr = (char *) malloc(strlen("/bin/sh ") + strlen(tmp) + 1);
-	sprintf(scr, "/bin/sh %s", tmp);
-
-	set_env("BASE_DIR", "/no/such/dir");
-	set_env("OPENSSL", openssl);
-	set_env("TYPE", "server");
-	if (info_only) {
-		set_env("INFO_ONLY", path);
-	} else if (delete_only) {
-		set_env("DELETE_ONLY", path);
-	} else {
-		set_env("ENCRYPT_ONLY", path);
-	}
-	system(scr);
-	unlink(tmp);
-
-	if (! mode && cert && cert[0] != '\0') {
-		int got_cert = 0;
-		file = fopen(path, "r");
-		if (file == NULL) {
-			rfbLog("sslEncKey: %s\n", path);
-			rfbLogPerror("fopen");
-			exit(1);
-		}
-		while (fgets(line, 1024, file) != NULL) {
-			if (strstr(line, "-----BEGIN CERTIFICATE-----")
-			    == line) {
-				got_cert++;
-			}
-			if (strstr(line, "-----END CERTIFICATE-----")
-			    == line) {
-				got_cert++;
-			}
-		}
-		fclose(file);
-		if (got_cert < 2) {
-			file = fopen(path, "a");
-			if (file == NULL) {
-				rfbLog("sslEncKey: %s\n", path);
-				rfbLogPerror("fopen");
-				exit(1);
-			}
-			fprintf(file, "%s", cert);
-			fclose(file);
-		}
-		free(cert);
-	}
-
-	depth--;
-}
-
diff --git a/ica/x11/x11vnc/sslcmds.h b/ica/x11/x11vnc/sslcmds.h
deleted file mode 100644
index 68a12df..0000000
--- a/ica/x11/x11vnc/sslcmds.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SSLCMDS_H
-#define _X11VNC_SSLCMDS_H
-
-/* -- sslcmds.h -- */
-
-extern void check_stunnel(void);
-extern int start_stunnel(int stunnel_port, int x11vnc_port, int hport, int x11vnc_hport);
-extern void stop_stunnel(void);
-extern void setup_stunnel(int rport, int *argc, char **argv);
-extern char *get_Cert_dir(char *cdir_in, char **tmp_in);
-extern void sslScripts(void);
-extern void sslGenCA(char *cdir);
-extern void sslGenCert(char *ty, char *nm);
-extern void sslEncKey(char *path, int info_only);
-
-
-#endif /* _X11VNC_SSLCMDS_H */
diff --git a/ica/x11/x11vnc/sslhelper.c b/ica/x11/x11vnc/sslhelper.c
deleted file mode 100644
index 45403fa..0000000
--- a/ica/x11/x11vnc/sslhelper.c
+++ /dev/null
@@ -1,4350 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- sslhelper.c -- */
-
-#include "x11vnc.h"
-#include "inet.h"
-#include "cleanup.h"
-#include "screen.h"
-#include "scan.h"
-#include "connections.h"
-#include "sslcmds.h"
-#include "unixpw.h"
-#include "user.h"
-
-#define OPENSSL_INETD   1
-#define OPENSSL_VNC     2
-#define OPENSSL_VNC6    3
-#define OPENSSL_HTTPS   4
-#define OPENSSL_HTTPS6  5
-#define OPENSSL_REVERSE 6
-
-#define DO_DH 0
-
-#if LIBVNCSERVER_HAVE_FORK
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID
-#define FORK_OK
-#endif
-#endif
-
-int openssl_sock = -1;
-int openssl_sock6 = -1;
-int openssl_port_num = 0;
-int https_sock = -1;
-int https_sock6 = -1;
-pid_t openssl_last_helper_pid = 0;
-char *openssl_last_ip = NULL;
-
-static char *certret = NULL;
-static int certret_fd = -1;
-static mode_t omode;
-char *certret_str = NULL;
-
-static char *dhret = NULL;
-static int dhret_fd = -1;
-char *dhret_str = NULL;
-char *new_dh_params = NULL;
-
-void raw_xfer(int csock, int s_in, int s_out);
-
-/* openssl(1) pem related functions: */
-char *get_saved_pem(char *string, int create);
-char *find_openssl_bin(void);
-char *get_ssl_verify_file(char *str_in);
-char *create_tmp_pem(char *path, int prompt);
-
-static char *get_input(char *tag, char **in);
-
-char *get_saved_pem(char *save, int create) {
-	char *s = NULL, *path, *cdir, *tmp;
-	int prompt = 0, len;
-	struct stat sbuf;
-
-	if (! save) {
-		rfbLog("get_saved_pem: save string is null.\n");
-		clean_up_exit(1);
-	}
-
-	if (strstr(save, "SAVE_PROMPT") == save) {
-		prompt = 1;
-		s = save + strlen("SAVE_PROMPT");
-	} else if (strstr(save, "SAVE_NOPROMPT") == save) {
-		set_env("GENCERT_NOPROMPT", "1");
-		s = save + strlen("SAVE_NOPROMPT");
-	} else if (strstr(save, "SAVE") == save) {
-		s = save + strlen("SAVE");
-	} else {
-		rfbLog("get_saved_pem: invalid save string: %s\n", save);
-		clean_up_exit(1);
-	}
-	if (strchr(s, '/')) {
-		rfbLog("get_saved_pem: invalid save string: %s\n", s);
-		clean_up_exit(1);
-	}
-
-
-	cdir = get_Cert_dir(NULL, &tmp);
-	if (! cdir || ! tmp) {
-		rfbLog("get_saved_pem: could not find Cert dir.\n");
-		clean_up_exit(1);
-	}
-
-	len = strlen(cdir) + strlen("/server.pem") + strlen(s) + 1;
-
-	path = (char *) malloc(len);
-	sprintf(path, "%s/server%s.pem", cdir, s);
-
-	if (stat(path, &sbuf) != 0) {
-		char *new_name = NULL;
-		if (create) {
-			if (inetd || opts_bg) {
-				set_env("GENCERT_NOPROMPT", "1");
-			}
-			new_name = create_tmp_pem(path, prompt);
-			if (!getenv("X11VNC_SSL_NO_PASSPHRASE") && !inetd && !opts_bg) {
-				sslEncKey(new_name, 0);
-			}
-		}
-		return new_name;
-	}
-
-	if (! quiet) {
-		char line[1024];
-		int on = 0;
-		FILE *in = fopen(path, "r");
-		if (in != NULL) {
-			rfbLog("\n");
-			rfbLog("Using SSL Certificate:\n");
-			fprintf(stderr, "\n");
-			while (fgets(line, 1024, in) != NULL) {
-				if (strstr(line, "BEGIN CERTIFICATE")) {
-					on = 1;
-				}
-				if (on) {
-					fprintf(stderr, "%s", line);
-				}
-				if (strstr(line, "END CERTIFICATE")) {
-					on = 0;
-				}
-				if (strstr(line, "PRIVATE KEY")) {
-					on = 0;
-				}
-			}
-			fprintf(stderr, "\n");
-			fclose(in);
-		}
-	}
-	return strdup(path);
-}
-
-static char *get_input(char *tag, char **in) {
-	char line[1024], *str;
-
-	if (! tag || ! in || ! *in) {
-		return NULL;
-	}
-
-	fprintf(stderr, "%s:\n     [%s] ", tag, *in);
-	if (fgets(line, 1024, stdin) == NULL) {
-		rfbLog("could not read stdin!\n");
-		rfbLogPerror("fgets");
-		clean_up_exit(1);
-	}
-	if ((str = strrchr(line, '\n')) != NULL) {
-		*str = '\0';
-	}
-	str = lblanks(line);
-	if (!strcmp(str, "")) {
-		return *in;
-	} else {
-		return strdup(line);
-	}
-}
-
-char *find_openssl_bin(void) {
-	char *path, *exe, *p, *gp;
-	struct stat sbuf;
-	int found_openssl = 0;
-	char extra[] = ":/usr/bin:/bin:/usr/sbin:/usr/local/bin"
-	    ":/usr/local/sbin:/usr/sfw/bin";
-	
-	gp = getenv("PATH");
-	if (! gp) {
-		fprintf(stderr, "could not find openssl(1) program in PATH. (null)\n");
-		return NULL;
-	}
-
-	path = (char *) malloc(strlen(gp) + strlen(extra) + 1);
-	strcpy(path, gp);
-	strcat(path, extra);
-
-	/* find openssl binary: */
-	exe = (char *) malloc(strlen(path) + strlen("/openssl") + 1);
-	p = strtok(path, ":");
-
-	while (p) {
-		sprintf(exe, "%s/openssl", p);
-		if (stat(exe, &sbuf) == 0) {
-			if (! S_ISDIR(sbuf.st_mode)) {
-				found_openssl = 1;
-				break;
-			}
-		}
-		p = strtok(NULL, ":");
-	}
-	free(path);
-
-	if (! found_openssl) {
-		fprintf(stderr, "could not find openssl(1) program in PATH.\n");
-		fprintf(stderr, "PATH=%s\n", gp);
-		fprintf(stderr, "(also checked: %s)\n", extra);
-		return NULL;
-	}
-	return exe;
-}
-
-/* uses /usr/bin/openssl to create a tmp cert */
-
-char *create_tmp_pem(char *pathin, int prompt) {
-	pid_t pid, pidw;
-	FILE *in, *out;
-	char cnf[] = "/tmp/x11vnc-cnf.XXXXXX";
-	char pem[] = "/tmp/x11vnc-pem.XXXXXX";
-	char str[8*1024], line[1024], *exe;
-	int cnf_fd, pem_fd, status, show_cert = 1;
-	char *days;
-	char *C, *L, *OU, *O, *CN, *EM;
-	char tmpl[] = 
-"[ req ]\n"
-"prompt = no\n"
-"default_bits = 2048\n"
-"encrypt_key = yes\n"
-"distinguished_name = req_dn\n"
-"x509_extensions = cert_type\n"
-"\n"
-"[ req_dn ]\n"
-"countryName=%s\n"
-"localityName=%s\n"
-"organizationalUnitName=%s\n"
-"organizationName=%s\n"
-"commonName=%s\n"
-"emailAddress=%s\n"
-"\n"
-"[ cert_type ]\n"
-"nsCertType = server\n"
-;
-
-	C = strdup("AU");
-#ifdef WIN32
-	L = strdup("Win32");
-	snprintf(line, 1024, "%s-%f", "unknown-node", dnow());
-#else
-	L = strdup(UT.sysname ? UT.sysname : "unknown-os");
-	snprintf(line, 1024, "%s-%f", UT.nodename ? UT.nodename :
-	    "unknown-node", dnow());
-#endif
-	line[1024-1] = '\0';
-
-	OU = strdup(line);
-	O = strdup("x11vnc");
-	if (pathin) {
-		snprintf(line, 1024, "x11vnc-SELF-SIGNED-CERT-%d", getpid());
-	} else {
-		snprintf(line, 1024, "x11vnc-SELF-SIGNED-TEMPORARY-CERT-%d",
-		    getpid());
-	}
-	line[1024-1] = '\0';
-	CN = strdup(line);
-	EM = strdup("x11vnc at server.nowhere");
-
-	/* ssl */
-	if (no_external_cmds || !cmd_ok("ssl")) {
-		rfbLog("create_tmp_pem: cannot run external commands.\n");	
-		return NULL;
-	}
-
-	rfbLog("\n");	
-	if (pathin) {
-		rfbLog("Creating a self-signed PEM certificate...\n");	
-	} else {
-		rfbLog("Creating a temporary, self-signed PEM certificate...\n");	
-	}
-
-	rfbLog("\n");	
-	rfbLog("This will NOT prevent Man-In-The-Middle attacks UNLESS you\n");	
-	rfbLog("get the certificate information to the VNC viewers SSL\n");	
-	rfbLog("tunnel configuration or you take the extra steps to sign it\n");
-	rfbLog("with a CA key. However, it will prevent passive network\n");
-	rfbLog("sniffing.\n");	
-	rfbLog("\n");	
-	rfbLog("The cert inside -----BEGIN CERTIFICATE-----\n");	
-	rfbLog("                           ....\n");	
-	rfbLog("                -----END CERTIFICATE-----\n");	
-	rfbLog("printed below may be used on the VNC viewer-side to\n");	
-	rfbLog("authenticate this server for this session.  See the -ssl\n");
-	rfbLog("help output and the FAQ for how to create a permanent\n");
-	rfbLog("server certificate.\n");	
-	rfbLog("\n");	
-
-	exe = find_openssl_bin();
-	if (! exe) {
-		return NULL;
-	}
-
-	/* create template file with our made up stuff: */
-	if (prompt) {
-		fprintf(stderr, "\nReply to the following prompts to set"
-		    " your Certificate parameters.\n");
-		fprintf(stderr, "(press Enter to accept the default in [...], "
-		    "or type in the value you want)\n\n");
-		C = get_input("CountryName", &C);
-		L = get_input("LocalityName", &L);
-		OU = get_input("OrganizationalUnitName", &OU);
-		O = get_input("OrganizationalName", &O);
-		CN = get_input("CommonName", &CN);
-		EM = get_input("EmailAddress", &EM);
-	}
-	sprintf(str, tmpl, C, L, OU, O, CN, EM);
-
-	cnf_fd = mkstemp(cnf);
-	if (cnf_fd < 0) {
-		return NULL;
-	}
-	pem_fd = mkstemp(pem);
-	if (pem_fd < 0) {
-		close(cnf_fd);
-		return NULL;
-	}
-
-	close(pem_fd);
-
-	write(cnf_fd, str, strlen(str));
-	close(cnf_fd);
-
-	if (pathin) {
-		days = "365";
-	} else {
-		days = "30";
-	}
-
-#ifndef FORK_OK
-	rfbLog("not compiled with fork(2)\n");
-	clean_up_exit(1);
-#else
-	/* make RSA key */
-	pid = fork();
-	if (pid < 0) {
-		return NULL;
-	} else if (pid == 0) {
-		int i;
-		for (i=0; i<256; i++) {
-			close(i);
-		}
-		execlp(exe, exe, "req", "-new", "-x509", "-nodes",
-		    "-days", days, "-config", cnf, "-out", pem,
-		    "-keyout", pem, (char *)0);
-		exit(1);
-	}
-	pidw = waitpid(pid, &status, 0); 
-	if (pidw != pid) {
-		return NULL;
-	}
-	if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
-		;
-	} else {
-		return NULL;
-	}
-
-#if DO_DH
-	/* make DH parameters */
-	pid = fork();
-	if (pid < 0) {
-		return NULL;
-	} else if (pid == 0) {
-		int i;
-		for (i=0; i<256; i++) {
-			close(i);
-		}
-		/* rather slow at 1024 */
-		execlp(exe, exe, "dhparam", "-out", cnf, "512", (char *)0);
-		exit(1);
-	}
-	pidw = waitpid(pid, &status, 0); 
-	if (pidw != pid) {
-		return NULL;
-	}
-	if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
-		;
-	} else {
-		return NULL;
-	}
-
-	/* append result: */
-	in = fopen(cnf, "r");
-	if (in == NULL) {
-		return NULL;
-	}
-	out = fopen(pem, "a");
-	if (out == NULL) {
-		fclose(in);
-		return NULL;
-	}
-	while (fgets(line, 1024, in) != NULL) {
-		fprintf(out, "%s", line);
-	}
-	fclose(in);
-	fclose(out);
-#endif
-
-#endif	/* FORK_OK */
-
-	unlink(cnf);
-	free(exe);
-
-	if (pathin != NULL) {
-		char *q, *pathcrt = strdup(pathin);
-		FILE *crt = NULL;
-		int on = 0;
-
-		q = strrchr(pathcrt, '/');
-		if (q) {
-			q = strstr(q, ".pem");
-			if (q) {
-				*(q+1) = 'c';
-				*(q+2) = 'r';
-				*(q+3) = 't';
-				crt = fopen(pathcrt, "w");
-			}
-		}
-		if (crt == NULL) {
-			rfbLog("could not open: %s\n", pathcrt);
-			rfbLogPerror("fopen");
-			return NULL;
-		}
-
-		out = fopen(pathin, "w");
-		chmod(pathin,  0600);
-		if (out == NULL) {
-			rfbLog("could not open: %s\n", pathin);
-			rfbLogPerror("fopen");
-			fclose(crt);
-			return NULL;
-		}
-
-		in = fopen(pem, "r");
-		if (in == NULL) {
-			rfbLog("could not open: %s\n", pem);
-			rfbLogPerror("fopen");
-			fclose(out);
-			fclose(crt);
-			unlink(pathin);
-			unlink(pathcrt);
-			return NULL;
-		}
-		while (fgets(line, 1024, in) != NULL) {
-			if (strstr(line, "BEGIN CERTIFICATE")) {
-				on = 1;
-			}
-			fprintf(out, "%s", line);
-			if (on) {
-				fprintf(crt, "%s", line);
-				if (!quiet) {
-					fprintf(stderr, "%s", line);
-				}
-			}
-			if (strstr(line, "END CERTIFICATE")) {
-				on = 0;
-			}
-			if (strstr(line, "PRIVATE KEY")) {
-				on = 0;
-			}
-		}
-		fclose(in);
-		fclose(out);
-		fclose(crt);
-	}
-
-	if (show_cert) {
-		exe = find_openssl_bin();
-		if (!exe) {
-			exe = strdup("openssl");
-		}
-		if (strlen(pem) + strlen(exe) < 4000) {
-			char cmd[5000];
-			if (inetd) {
-				sprintf(cmd, "%s x509 -text -in '%s' 1>&2", exe, pem);
-			} else {
-				sprintf(cmd, "%s x509 -text -in '%s'", exe, pem);
-			}
-			fprintf(stderr, "\n");
-			system(cmd);
-			fprintf(stderr, "\n");
-		}
-		free(exe);
-	}
-
-	if (pathin) {
-		unlink(pem);
-		return strdup(pathin);
-	} else {
-		return strdup(pem);
-	}
-}
-
-static int appendfile(FILE *out, char *infile) {
-	char line[1024];
-	FILE *in;
-
-	if (! infile) {
-		rfbLog("appendfile: null infile.\n");
-		return 0;
-	}
-	if (! out) {
-		rfbLog("appendfile: null out handle.\n");
-		return 0;
-	}
-
-	in = fopen(infile, "r");
-
-	if (in == NULL) {
-		rfbLog("appendfile: %s\n", infile);
-		rfbLogPerror("fopen");
-		return 0;
-	}
-
-	while (fgets(line, 1024, in) != NULL) {
-		fprintf(out, "%s", line);
-	}
-	fclose(in);
-	return 1;
-}
-	
-char *get_ssl_verify_file(char *str_in) {
-	char *p, *str, *cdir, *tmp;
-	char *tfile, *tfile2;
-	FILE *file;
-	struct stat sbuf;
-	int count = 0, fd;
-
-	if (! str_in) {
-		rfbLog("get_ssl_verify_file: no filename\n");
-		exit(1);
-	}
-
-	if (stat(str_in, &sbuf) == 0) {
-		/* assume he knows what he is doing. */
-		return str_in;
-	}
-
-	cdir = get_Cert_dir(NULL, &tmp);
-	if (! cdir || ! tmp) {
-		rfbLog("get_ssl_verify_file: invalid cert-dir.\n");
-		exit(1);
-	}
-
-	tfile  = (char *) malloc(strlen(tmp) + 1024);
-	tfile2 = (char *) malloc(strlen(tmp) + 1024);
-
-	sprintf(tfile, "%s/sslverify-tmp-load-%d.crts.XXXXXX", tmp, getpid());
-
-	fd = mkstemp(tfile);
-	if (fd < 0) {
-		rfbLog("get_ssl_verify_file: %s\n", tfile);
-		rfbLogPerror("mkstemp");
-		exit(1);
-	}
-	close(fd);
-
-	file = fopen(tfile, "w");
-	chmod(tfile, 0600);
-	if (file == NULL) {
-		rfbLog("get_ssl_verify_file: %s\n", tfile);
-		rfbLogPerror("fopen");
-		exit(1);
-	}
-
-	str = strdup(str_in);
-	p = strtok(str, ",");
-
-	while (p) {
-		if (!strcmp(p, "CA")) {
-			sprintf(tfile2, "%s/CA/cacert.pem", cdir);
-			if (! appendfile(file, tfile2)) {
-				unlink(tfile);
-				exit(1);
-			}
-			rfbLog("sslverify: loaded %s\n", tfile2);
-			count++;
-
-		} else if (!strcmp(p, "clients")) {
-			DIR *dir;
-			struct dirent *dp;
-
-			sprintf(tfile2, "%s/clients", cdir);
-			dir = opendir(tfile2);
-			if (! dir) {
-				rfbLog("get_ssl_verify_file: %s\n", tfile2);
-				rfbLogPerror("opendir");
-				unlink(tfile);
-				exit(1);
-			}
-			while ( (dp = readdir(dir)) != NULL) {
-				char *n = dp->d_name;
-				char *q = strstr(n, ".crt");
-
-				if (! q || strlen(q) != strlen(".crt")) {
-					continue;
-				}
-				if (strlen(n) > 512) {
-					continue;
-				}
-
-				sprintf(tfile2, "%s/clients/%s", cdir, n);
-				if (! appendfile(file, tfile2)) {
-					unlink(tfile);
-					exit(1);
-				}
-				rfbLog("sslverify: loaded %s\n",
-				    tfile2);
-				count++;
-			}
-			closedir(dir);
-			
-		} else {
-			if (strlen(p) > 512) {
-				unlink(tfile);
-				exit(1);
-			}
-			sprintf(tfile2, "%s/clients/%s.crt", cdir, p);
-			if (stat(tfile2, &sbuf) != 0) {
-				sprintf(tfile2, "%s/clients/%s", cdir, p);
-			}
-			if (! appendfile(file, tfile2)) {
-				unlink(tfile);
-				exit(1);
-			}
-			rfbLog("sslverify: loaded %s\n", tfile2);
-			count++;
-		}
-		p = strtok(NULL, ",");
-	}
-	fclose(file);
-	free(tfile2);
-	free(str);
-
-	rfbLog("sslverify: using %d client certs in\n", count);
-	rfbLog("sslverify: %s\n", tfile);
-
-	return tfile;
-}
-
-int openssl_present(void);
-void openssl_init(int isclient);
-void openssl_port(int restart);
-void https_port(int restart);
-void check_openssl(void);
-void check_https(void);
-void ssl_helper_pid(pid_t pid, int sock);
-void accept_openssl(int mode, int presock);
-
-static void lose_ram(void);
-#define ABSIZE 16384
-
-static int vencrypt_selected = 0;
-static int anontls_selected = 0;
-
-/* to test no openssl libssl */
-#if 0
-#undef LIBVNCSERVER_HAVE_LIBSSL
-#define LIBVNCSERVER_HAVE_LIBSSL 0
-#endif
-
-#if !LIBVNCSERVER_HAVE_LIBSSL
-
-static void badnews(char *name) {
-	use_openssl = 0;
-	use_stunnel = 0;
-	rfbLog("** %s: not compiled with libssl OpenSSL support **\n", name ? name : "???");
-	clean_up_exit(1);
-}
-
-int openssl_present(void) {return 0;}
-void openssl_init(int isclient) {badnews("openssl_init");}
-
-#define SSL_ERROR_NONE 0
-
-static int ssl_init(int s_in, int s_out, int skip_vnc_tls, double last_https) {
-	if (enc_str != NULL) {
-		return 1;
-	}
-	badnews("ssl_init");
-	return 0;
-}
-
-static void ssl_xfer(int csock, int s_in, int s_out, int is_https) {
-	if (enc_str != NULL && !strcmp(enc_str, "none")) {
-		usleep(250*1000);
-		rfbLog("doing '-enc none' raw transfer (no encryption)\n"); 
-		raw_xfer(csock, s_in, s_out);
-	} else {
-		badnews("ssl_xfer");
-	}
-}
-
-#else 	/* LIBVNCSERVER_HAVE_LIBSSL */
-
-/*
- * This is because on older systems both zlib.h and ssl.h define
- * 'free_func' nothing we do below (currently) induces an external
- * dependency on 'free_func'.
- */
-#define free_func my_jolly_little_free_func
-
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/rand.h>
-
-static SSL_CTX *ctx = NULL;
-static RSA *rsa_512 = NULL;
-static RSA *rsa_1024 = NULL;
-static SSL *ssl = NULL;
-static X509_STORE *revocation_store = NULL;
-
-
-static void init_prng(void);
-static void sslerrexit(void);
-static int  ssl_init(int s_in, int s_out, int skip_vnc_tls, double last_https);
-static void ssl_xfer(int csock, int s_in, int s_out, int is_https);
-
-#ifndef FORK_OK
-void openssl_init(int isclient) {
-	rfbLog("openssl_init: fork is not supported. cannot create"
-	    " ssl helper process.\n");
-	clean_up_exit(1);
-}
-int openssl_present(void) {return 0;}
-
-#else
-
-int openssl_present(void) {return 1;}
-
-static void sslerrexit(void) {
-	unsigned long err = ERR_get_error();
-	
-	if (err) {
-		char str[256];
-		ERR_error_string(err, str);
-		fprintf(stderr, "ssl error: %s\n", str);
-	}
-	clean_up_exit(1);
-}
-
-static int pem_passwd_callback(char *buf, int size, int rwflag,
-    void *userdata) {
-	char *q, line[1024];
-
-	if (! buf) {
-		exit(1);
-	}
-
-	fprintf(stderr, "\nA passphrase is needed to unlock an OpenSSL "
-	    "private key (PEM file).\n");
-	fprintf(stderr, "Enter passphrase> ");
-	system("stty -echo");
-	if(fgets(line, 1024, stdin) == NULL) {
-		fprintf(stdout, "\n");
-		system("stty echo");
-		exit(1);
-	}
-	system("stty echo");
-	fprintf(stdout, "\n\n");
-	q = strrchr(line, '\n');
-	if (q) {
-		*q = '\0';
-	}
-	line[1024 - 1] = '\0';
-	strncpy(buf, line, size);                                  
-	buf[size - 1] = '\0';
-
-	if (0) rwflag = 0;	/* compiler warning. */
-	if (0) userdata = 0;	/* compiler warning. */
-
-	return strlen(buf);
-}
-
-/* based on mod_ssl */
-static int crl_callback(X509_STORE_CTX *callback_ctx) {
-	X509_STORE_CTX store_ctx;
-	X509_OBJECT obj;
-	X509_NAME *subject;
-	X509_NAME *issuer;
-	X509 *xs;
-	X509_CRL *crl;
-	X509_REVOKED *revoked;
-	EVP_PKEY *pubkey;
-	long serial;
-	BIO *bio;
-	int i, n, rc;
-	char *cp, *cp2;
-	ASN1_TIME *t;
-	
-	/* Determine certificate ingredients in advance */
-	xs      = X509_STORE_CTX_get_current_cert(callback_ctx);
-	subject = X509_get_subject_name(xs);
-	issuer  = X509_get_issuer_name(xs);
-	
-	/* Try to retrieve a CRL corresponding to the _subject_ of
-	* the current certificate in order to verify it's integrity. */
-	memset((char *)&obj, 0, sizeof(obj));
-	X509_STORE_CTX_init(&store_ctx, revocation_store, NULL, NULL);
-	rc=X509_STORE_get_by_subject(&store_ctx, X509_LU_CRL, subject, &obj);
-	X509_STORE_CTX_cleanup(&store_ctx);
-	crl=obj.data.crl;
-
-	if(rc>0 && crl) {
-		/* Log information about CRL
-		 * (A little bit complicated because of ASN.1 and BIOs...) */
-		bio=BIO_new(BIO_s_mem());
-		BIO_printf(bio, "lastUpdate: ");
-		ASN1_UTCTIME_print(bio, X509_CRL_get_lastUpdate(crl));
-		BIO_printf(bio, ", nextUpdate: ");
-		ASN1_UTCTIME_print(bio, X509_CRL_get_nextUpdate(crl));
-		n=BIO_pending(bio);
-		cp=malloc(n+1);
-		n=BIO_read(bio, cp, n);
-		cp[n]='\0';
-		BIO_free(bio);
-		cp2=X509_NAME_oneline(subject, NULL, 0);
-		rfbLog("CA CRL: Issuer: %s, %s\n", cp2, cp);
-		OPENSSL_free(cp2);
-		free(cp);
-
-		/* Verify the signature on this CRL */
-		pubkey=X509_get_pubkey(xs);
-		if(X509_CRL_verify(crl, pubkey)<=0) {
-			rfbLog("Invalid signature on CRL\n");
-			X509_STORE_CTX_set_error(callback_ctx,
-				X509_V_ERR_CRL_SIGNATURE_FAILURE);
-			X509_OBJECT_free_contents(&obj);
-			if(pubkey)
-				EVP_PKEY_free(pubkey);
-			return 0; /* Reject connection */
-		}
-		if(pubkey)
-			EVP_PKEY_free(pubkey);
-
-		/* Check date of CRL to make sure it's not expired */
-		t=X509_CRL_get_nextUpdate(crl);
-		if(!t) {
-			rfbLog("Found CRL has invalid nextUpdate field\n");
-			X509_STORE_CTX_set_error(callback_ctx,
-				X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
-			X509_OBJECT_free_contents(&obj);
-			return 0; /* Reject connection */
-		}
-		if(X509_cmp_current_time(t)<0) {
-			rfbLog("Found CRL is expired - "
-				"revoking all certificates until you get updated CRL\n");
-			X509_STORE_CTX_set_error(callback_ctx, X509_V_ERR_CRL_HAS_EXPIRED);
-			X509_OBJECT_free_contents(&obj);
-			return 0; /* Reject connection */
-		}
-		X509_OBJECT_free_contents(&obj);
-	}
-
-	/* Try to retrieve a CRL corresponding to the _issuer_ of
-	 * the current certificate in order to check for revocation. */
-	memset((char *)&obj, 0, sizeof(obj));
-	X509_STORE_CTX_init(&store_ctx, revocation_store, NULL, NULL);
-	rc=X509_STORE_get_by_subject(&store_ctx, X509_LU_CRL, issuer, &obj);
-	X509_STORE_CTX_cleanup(&store_ctx);
-	crl=obj.data.crl;
-
-	if(rc>0 && crl) {
-		/* Check if the current certificate is revoked by this CRL */
-		n=sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl));
-		for(i=0; i<n; i++) {
-			revoked=sk_X509_REVOKED_value(X509_CRL_get_REVOKED(crl), i);
-			if(ASN1_INTEGER_cmp(revoked->serialNumber,
-					X509_get_serialNumber(xs)) == 0) {
-				serial=ASN1_INTEGER_get(revoked->serialNumber);
-				cp=X509_NAME_oneline(issuer, NULL, 0);
-				rfbLog("Certificate with serial %ld (0x%lX) "
-					"revoked per CRL from issuer %s\n", serial, serial, cp);
-				OPENSSL_free(cp);
-				X509_STORE_CTX_set_error(callback_ctx, X509_V_ERR_CERT_REVOKED);
-				X509_OBJECT_free_contents(&obj);
-				return 0; /* Reject connection */
-			}
-		}
-		X509_OBJECT_free_contents(&obj);
-	}
-
-	return 1; /* Accept connection */
-}
-
-static int verify_callback(int ok, X509_STORE_CTX *callback_ctx) {
-	if (!ssl_verify) {
-		rfbLog("CRL_check: skipped.\n");
-		return ok;
-	}
-	if (!ssl_crl) {
-		rfbLog("CRL_check: skipped.\n");
-		return ok;
-	}
-	if (!ok) {
-		rfbLog("CRL_check: client cert is already rejected.\n");
-		return ok;
-	}
-	if (revocation_store) {
-		if (crl_callback(callback_ctx)) {
-			rfbLog("CRL_check: succeeded.\n");
-			return 1;
-		} else {
-			rfbLog("CRL_check: did not pass.\n");
-			return 0;
-		}
-	}
-	/* NOTREACHED */
-	return 1;
-}
-
-#define rfbSecTypeAnonTls  18
-#define rfbSecTypeVencrypt 19
-
-#define rfbVencryptPlain	256
-#define rfbVencryptTlsNone	257
-#define rfbVencryptTlsVnc	258
-#define rfbVencryptTlsPlain	259
-#define rfbVencryptX509None	260
-#define rfbVencryptX509Vnc	261
-#define rfbVencryptX509Plain	262
-
-static int ssl_client_mode = 0;
-
-static int switch_to_anon_dh(void);
-
-void openssl_init(int isclient) {
-	int db = 0, tmp_pem = 0, do_dh;
-	FILE *in;
-	double ds;
-	long mode;
-	static int first = 1;
-
-	do_dh = DO_DH;
-
-	if (enc_str != NULL) {
-		if (first) {
-			init_prng();
-		}
-		first = 0;
-		return;
-	}
-
-	if (! quiet) {
-		rfbLog("\n");
-		rfbLog("Initializing SSL (%s connect mode).\n", isclient ? "client":"server");
-	}
-	if (first) {
-		if (db) fprintf(stderr, "\nSSL_load_error_strings()\n");
-
-		SSL_load_error_strings();
-
-		if (db) fprintf(stderr, "SSL_library_init()\n");
-
-		SSL_library_init();
-
-		if (db) fprintf(stderr, "init_prng()\n");
-
-		init_prng();
-
-		first = 0;
-	}
-
-	if (isclient) {
-		ssl_client_mode = 1;
-	} else {
-		ssl_client_mode = 0;
-	}
-
-	if (ssl_client_mode) {
-		if (db) fprintf(stderr, "SSLv23_client_method()\n");
-		ctx = SSL_CTX_new( SSLv23_client_method() );
-	} else {
-		if (db) fprintf(stderr, "SSLv23_server_method()\n");
-		ctx = SSL_CTX_new( SSLv23_server_method() );
-	}
-
-	if (ctx == NULL) {
-		rfbLog("openssl_init: SSL_CTX_new failed.\n");	
-		sslerrexit();
-	}
-
-	ds = dnow();
-	rsa_512 = RSA_generate_key(512, RSA_F4, NULL, NULL);
-	if (rsa_512 == NULL) {
-		rfbLog("openssl_init: RSA_generate_key(512) failed.\n");	
-		sslerrexit();
-	}
-
-	rfbLog("created  512 bit temporary RSA key: %.3fs\n", dnow() - ds);
-
-	ds = dnow();
-	rsa_1024 = RSA_generate_key(1024, RSA_F4, NULL, NULL);
-	if (rsa_1024 == NULL) {
-		rfbLog("openssl_init: RSA_generate_key(1024) failed.\n");	
-		sslerrexit();
-	}
-
-	rfbLog("created 1024 bit temporary RSA key: %.3fs\n", dnow() - ds);
-
-	if (db) fprintf(stderr, "SSL_CTX_set_tmp_rsa()\n");
-
-	if (! SSL_CTX_set_tmp_rsa(ctx, rsa_1024)) {
-		rfbLog("openssl_init: SSL_CTX_set_tmp_rsa(1024) failed.\n");	
-		sslerrexit();
-	}
-
-	mode = 0;
-	mode |= SSL_MODE_ENABLE_PARTIAL_WRITE;
-	mode |= SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
-	SSL_CTX_set_mode(ctx, mode);
-
-#define ssl_cache 0
-#if ssl_cache
-	SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH);
-	SSL_CTX_set_timeout(ctx, 300);
-#else
-	SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
-	SSL_CTX_set_timeout(ctx, 1);
-#endif
-
-	ds = dnow();
-	if (! openssl_pem) {
-		openssl_pem = create_tmp_pem(NULL, 0);
-		if (! openssl_pem) {
-			rfbLog("openssl_init: could not create temporary,"
-			    " self-signed PEM.\n");	
-			clean_up_exit(1);
-		}
-		tmp_pem = 1;
-
-	} else if (!strcmp(openssl_pem, "ANON")) {
-		if (ssl_verify) {
-			rfbLog("openssl_init: Anonymous Diffie-Hellman cannot"
-			    " be used in -sslverify mode.\n");	
-			clean_up_exit(1);
-		}
-		if (ssl_crl) {
-			rfbLog("openssl_init: Anonymous Diffie-Hellman cannot"
-			    " be used in -sslCRL mode.\n");	
-			clean_up_exit(1);
-		}
-		/* n.b. new ctx */
-		if (!switch_to_anon_dh()) {
-			rfbLog("openssl_init: Anonymous Diffie-Hellman setup"
-			    " failed.\n");	
-			clean_up_exit(1);
-		}
-	} else if (strstr(openssl_pem, "SAVE") == openssl_pem) {
-		openssl_pem = get_saved_pem(openssl_pem, 1);
-		if (! openssl_pem) {
-			rfbLog("openssl_init: could not create or open"
-			    " saved PEM: %s\n", openssl_pem);	
-			clean_up_exit(1);
-		}
-		tmp_pem = 0;
-	}
-
-	rfbLog("using PEM %s  %.3fs\n", openssl_pem, dnow() - ds);
-
-	SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_callback);
-
-	if (do_dh) {
-		DH *dh;
-		BIO *bio;
-
-		ds = dnow();
-		in = fopen(openssl_pem, "r");
-		if (in == NULL) {
-			rfbLogPerror("fopen");
-			clean_up_exit(1);
-		}
-		bio = BIO_new_fp(in, BIO_CLOSE|BIO_FP_TEXT);
-		if (! bio) {
-			rfbLog("openssl_init: BIO_new_fp() failed.\n");	
-			sslerrexit();
-		}
-		dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
-		if (dh == NULL) {
-			rfbLog("openssl_init: PEM_read_bio_DHparams() failed.\n");	
-			BIO_free(bio);
-			sslerrexit();
-		}
-		BIO_free(bio);
-		SSL_CTX_set_tmp_dh(ctx, dh);
-		rfbLog("loaded Diffie Hellman %d bits, %.3fs\n",
-		    8*DH_size(dh), dnow()-ds);
-		DH_free(dh);
-	}
-
-	if (strcmp(openssl_pem, "ANON")) {
-		if (! SSL_CTX_use_certificate_chain_file(ctx, openssl_pem)) {
-			rfbLog("openssl_init: SSL_CTX_use_certificate_chain_file() failed.\n");	
-			sslerrexit();
-		}
-		if (! SSL_CTX_use_RSAPrivateKey_file(ctx, openssl_pem,
-		    SSL_FILETYPE_PEM)) {
-			rfbLog("openssl_init: SSL_CTX_set_tmp_rsa(1024) failed.\n");	
-			sslerrexit();
-		}
-		if (! SSL_CTX_check_private_key(ctx)) {
-			rfbLog("openssl_init: SSL_CTX_set_tmp_rsa(1024) failed.\n");	
-			sslerrexit();
-		}
-	}
-
-	if (tmp_pem && ! getenv("X11VNC_KEEP_TMP_PEM")) {
-		if (getenv("X11VNC_SHOW_TMP_PEM")) {
-			FILE *in = fopen(openssl_pem, "r");
-			if (in != NULL) {
-				char line[128];
-				fprintf(stderr, "\n");
-				while (fgets(line, 128, in) != NULL) {
-					fprintf(stderr, "%s", line);
-				}
-				fprintf(stderr, "\n");
-				fclose(in);
-			}
-		}
-		unlink(openssl_pem);
-		free(openssl_pem);
-		openssl_pem = NULL;
-	}
-
-	if (ssl_crl) {
-		struct stat sbuf;
-		X509_LOOKUP *lookup;
-
-		if (stat(ssl_crl, &sbuf) != 0) {
-			rfbLog("openssl_init: -sslCRL does not exist %s.\n",
-			    ssl_crl ? ssl_crl : "null");	
-			rfbLogPerror("stat");
-			clean_up_exit(1);
-		}
-
-		revocation_store = X509_STORE_new();
-		if (!revocation_store) {
-			rfbLog("openssl_init: X509_STORE_new failed.\n");
-			sslerrexit();
-		}
-		if (! S_ISDIR(sbuf.st_mode)) {
-			lookup = X509_STORE_add_lookup(revocation_store, X509_LOOKUP_file());
-			if (!lookup) {
-				rfbLog("openssl_init: X509_STORE_add_lookup failed.\n");
-				sslerrexit();
-			}
-			if (!X509_LOOKUP_load_file(lookup, ssl_crl, X509_FILETYPE_PEM))  {
-				rfbLog("openssl_init: X509_LOOKUP_load_file failed.\n");
-				sslerrexit();
-			}
-		} else {
-			lookup = X509_STORE_add_lookup(revocation_store, X509_LOOKUP_hash_dir());
-			if (!lookup) {
-				rfbLog("openssl_init: X509_STORE_add_lookup failed.\n");
-				sslerrexit();
-			}
-			if (!X509_LOOKUP_add_dir(lookup, ssl_crl, X509_FILETYPE_PEM))  {
-				rfbLog("openssl_init: X509_LOOKUP_add_dir failed.\n");
-				sslerrexit();
-			}
-		}
-		rfbLog("loaded CRL file: %s\n", ssl_crl);
-	}
-
-	if (ssl_verify) {
-		struct stat sbuf;
-		char *file;
-		int lvl;
-
-		file = get_ssl_verify_file(ssl_verify);
-
-		if (!file || stat(file, &sbuf) != 0) {
-			rfbLog("openssl_init: -sslverify does not exist %s.\n",
-			    file ? file : "null");	
-			rfbLogPerror("stat");
-			clean_up_exit(1);
-		}
-		if (! S_ISDIR(sbuf.st_mode)) {
-			if (! SSL_CTX_load_verify_locations(ctx, file, NULL)) {
-				rfbLog("openssl_init: SSL_CTX_load_verify_"
-				    "locations() failed.\n");	
-				sslerrexit();
-			}
-		} else {
-			if (! SSL_CTX_load_verify_locations(ctx, NULL, file)) {
-				rfbLog("openssl_init: SSL_CTX_load_verify_"
-				    "locations() failed.\n");	
-				sslerrexit();
-			}
-		}
-
-		lvl = SSL_VERIFY_FAIL_IF_NO_PEER_CERT|SSL_VERIFY_PEER;
-		if (ssl_crl == NULL) {
-			SSL_CTX_set_verify(ctx, lvl, NULL);
-		} else {
-			SSL_CTX_set_verify(ctx, lvl, verify_callback);
-		}
-		if (strstr(file, "/sslverify-tmp-load-")) {
-			/* temporary file */
-			unlink(file);
-		}
-	} else {
-		SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
-	}
-
-	rfbLog("\n");
-}
-
-static int read_exact(int sock, char *buf, int len) {
-	int n, fail = 0;
-	if (sock < 0) {
-		return 0;
-	}
-	while (len > 0) {
-		n = read(sock, buf, len);
-		if (n > 0) {
-			buf += n;
-			len -= n;
-		} else if (n == 0) {
-			fail = 1;
-			break;
-		} else if (n < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-			usleep(10*1000);
-		} else if (n < 0 && errno != EINTR) {
-			fail = 1;
-			break;
-		}
-	}
-	if (fail) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-static int write_exact(int sock, char *buf, int len) {
-	int n, fail = 0;
-	if (sock < 0) {
-		return 0;
-	}
-	while (len > 0) {
-		n = write(sock, buf, len);
-		if (n > 0) {
-			buf += n;
-			len -= n;
-		} else if (n == 0) {
-			fail = 1;
-			break;
-		} else if (n < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
-			usleep(10*1000);
-		} else if (n < 0 && errno != EINTR) {
-			fail = 1;
-			break;
-		}
-	}
-	if (fail) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-/* XXX not in rfb.h: */
-void rfbClientSendString(rfbClientPtr cl, char *reason);
-
-static int finish_auth(rfbClientPtr client, char *type) {
-	int security_result, ret;
-
-	ret = 0;
-
-if (getenv("X11VNC_DEBUG_TLSPLAIN")) fprintf(stderr, "finish_auth type=%s\n", type);
-
-	if (!strcmp(type, "None")) {
-		security_result = 0;	/* success */
-		if (write_exact(client->sock, (char *) &security_result, 4)) {
-			ret = 1;
-		}
-		rfbLog("finish_auth: using auth 'None'\n");
-		client->state = RFB_INITIALISATION;
-
-	} else if (!strcmp(type, "Vnc")) {
-		RAND_bytes(client->authChallenge, CHALLENGESIZE);
-		if (write_exact(client->sock, (char *) &client->authChallenge, CHALLENGESIZE)) {
-			ret = 1;
-		}
-		rfbLog("finish_auth: using auth 'Vnc', sent challenge.\n");
-		client->state = RFB_AUTHENTICATION;
-
-	} else if (!strcmp(type, "Plain")) {
-		if (!unixpw) {
-			rfbLog("finish_auth: *Plain not allowed outside unixpw mode.\n");
-			ret = 0;
-		} else {
-			char *un, *pw;
-			int unlen, pwlen;
-
-if (getenv("X11VNC_DEBUG_TLSPLAIN")) fprintf(stderr, "*Plain begin: onHold=%d client=%p unixpw_client=%p\n", client->onHold, (void *) client, (void *) unixpw_client);
-
-			if (!read_exact(client->sock, (char *)&unlen, 4)) goto fail;
-			unlen = Swap32IfLE(unlen);
-
-if (getenv("X11VNC_DEBUG_TLSPLAIN")) fprintf(stderr, "unlen: %d\n", unlen);
-
-			if (!read_exact(client->sock, (char *)&pwlen, 4)) goto fail;
-			pwlen = Swap32IfLE(pwlen);
-
-if (getenv("X11VNC_DEBUG_TLSPLAIN")) fprintf(stderr, "pwlen: %d\n", pwlen);
-
-			un = (char *) malloc(unlen+1);
-			memset(un, 0, unlen+1);
-
-			pw = (char *) malloc(pwlen+2);
-			memset(pw, 0, pwlen+2);
-
-			if (!read_exact(client->sock, un, unlen)) goto fail;
-			if (!read_exact(client->sock, pw, pwlen)) goto fail;
-
-if (getenv("X11VNC_DEBUG_TLSPLAIN")) fprintf(stderr, "*Plain: %d %d '%s' ... \n", unlen, pwlen, un);
-			strcat(pw, "\n");
-
-			if (unixpw_verify(un, pw)) {
-				security_result = 0;	/* success */
-				if (write_exact(client->sock, (char *) &security_result, 4)) {
-					ret = 1;
-					unixpw_verify_screen(un, pw);
-				}
-				client->onHold = FALSE;
-				client->state = RFB_INITIALISATION;
-			}
-			if (ret == 0) {
-				rfbClientSendString(client, "unixpw failed");
-			}
-
-			memset(un, 0, unlen+1);
-			memset(pw, 0, pwlen+2);
-			free(un);
-			free(pw);
-		}
-	} else {
-		rfbLog("finish_auth: unknown sub-type: %s\n", type);
-		ret = 0;
-	}
-
-	fail:
-	return ret;
-}
-
-static int finish_vencrypt_auth(rfbClientPtr client, int subtype) {
-
-	if (subtype == rfbVencryptTlsNone || subtype == rfbVencryptX509None) {
-		return finish_auth(client, "None");
-	} else if (subtype == rfbVencryptTlsVnc || subtype == rfbVencryptX509Vnc) {
-		return finish_auth(client, "Vnc");
-	} else if (subtype == rfbVencryptTlsPlain || subtype == rfbVencryptX509Plain) {
-		return finish_auth(client, "Plain");
-	} else {
-		rfbLog("finish_vencrypt_auth: unknown sub-type: %d\n", subtype);
-		return 0;
-	}
-}
-
-
-static int add_anon_dh(void) {
-	pid_t pid, pidw;
-	char cnf[] = "/tmp/x11vnc-dh.XXXXXX";
-	char *infile = NULL;
-	int status, cnf_fd;
-	DH *dh;
-	BIO *bio;
-	FILE *in;
-	double ds;
-	/*
-	 * These are dh parameters (prime, generator), not dh keys.
-	 * Evidently it is ok for them to be publicly known.
-	 * openssl dhparam -out dh.out 1024
-	 */
-	char *fixed_dh_params = 
-"-----BEGIN DH PARAMETERS-----\n"
-"MIGHAoGBAL28w69ZnLYBvp8R2OeqtAIms+oatY19iBL4WhGI/7H1OMmkJjIe+OHs\n"
-"PXoJfe5ucrnvno7Xm+HJZYa1jnPGQuWoa/VJKXdVjYdJVNzazJKM2daKKcQA4GDc\n"
-"msFS5DxLbzUR5jy1n12K3EcbvpyFqDYVTJJXm7NuNuiWRfz3wTozAgEC\n"
-"-----END DH PARAMETERS-----\n";
-
-	if (dhparams_file != NULL) {
-		infile = dhparams_file;
-		rfbLog("add_anon_dh: using %s\n", dhparams_file);
-		goto readin;
-	}
-
-	cnf_fd = mkstemp(cnf);
-	if (cnf_fd < 0) {
-		return 0;
-	}
-	infile = cnf;
-
-	if (create_fresh_dhparams) {
-
-		if (new_dh_params != NULL) {
-			write(cnf_fd, new_dh_params, strlen(new_dh_params));
-			close(cnf_fd);
-		} else {
-			char *exe = find_openssl_bin();
-			struct stat sbuf;
-
-			if (no_external_cmds || !cmd_ok("ssl")) {
-				rfbLog("add_anon_dh: cannot run external commands.\n");	
-				return 0;
-			}
-
-			close(cnf_fd);
-			if (exe == NULL) {
-				return 0;
-			}
-			ds = dnow();
-			pid = fork();
-			if (pid < 0) {
-				return 0;
-			} else if (pid == 0) {
-				int i;
-				for (i=0; i<256; i++) {
-					if (i == 2) continue;
-					close(i);
-				}
-				/* rather slow at 1024 */
-				execlp(exe, exe, "dhparam", "-out", cnf, "1024", (char *)0);
-				exit(1);
-			}
-			pidw = waitpid(pid, &status, 0); 
-			if (pidw != pid) {
-				return 0;
-			}
-			if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
-				;
-			} else {
-				return 0;
-			}
-			rfbLog("add_anon_dh: created new DH params in %.3f secs\n", dnow() - ds);
-
-			if (stat(cnf, &sbuf) == 0 && sbuf.st_size > 0) {
-				/* save it to reuse during our process's lifetime: */
-				int d = open(cnf, O_RDONLY);
-				if (d >= 0) {
-					int n, len = sbuf.st_size;
-					new_dh_params = (char *) calloc(len+1, 1);
-					n = read(d, new_dh_params, len);
-					close(d);
-					if (n != len) {
-						free(new_dh_params);
-						new_dh_params = NULL;
-					} else if (dhret != NULL) {
-						d = open(dhret, O_WRONLY);
-						if (d >= 0) {
-							write(d, new_dh_params, strlen(new_dh_params));
-							close(d);
-						}
-					}
-				}
-			}
-		}
-	} else {
-		write(cnf_fd, fixed_dh_params, strlen(fixed_dh_params));
-		close(cnf_fd);
-	}
-
-	readin:
-
-	ds = dnow();
-	in = fopen(infile, "r");
-
-	if (in == NULL) {
-		rfbLogPerror("fopen");
-		unlink(cnf);
-		return 0;
-	}
-	bio = BIO_new_fp(in, BIO_CLOSE|BIO_FP_TEXT);
-	if (! bio) {
-		rfbLog("openssl_init: BIO_new_fp() failed.\n");	
-		unlink(cnf);
-		return 0;
-	}
-	dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
-	if (dh == NULL) {
-		rfbLog("openssl_init: PEM_read_bio_DHparams() failed.\n");	
-		unlink(cnf);
-		BIO_free(bio);
-		return 0;
-	}
-	BIO_free(bio);
-	SSL_CTX_set_tmp_dh(ctx, dh);
-	rfbLog("loaded Diffie Hellman %d bits, %.3fs\n", 8*DH_size(dh), dnow()-ds);
-	DH_free(dh);
-
-	unlink(cnf);
-	return 1;
-}
-
-static int switch_to_anon_dh(void) {
-	long mode;
-	
-	rfbLog("Using Anonymous Diffie-Hellman mode.\n");
-	rfbLog("WARNING: Anonymous Diffie-Hellman uses encryption but is\n");
-	rfbLog("WARNING: susceptible to a Man-In-The-Middle attack.\n");
-	if (ssl_client_mode) {
-		ctx = SSL_CTX_new( SSLv23_client_method() );
-	} else {
-		ctx = SSL_CTX_new( SSLv23_server_method() );
-	}
-	if (ctx == NULL) {
-		return 0;
-	}
-	if (ssl_client_mode) {
-		return 1;
-	}
-	if (!SSL_CTX_set_cipher_list(ctx, "ADH:@STRENGTH")) {
-		return 0;
-	}
-	if (!add_anon_dh()) {
-		return 0;
-	}
-
-	mode = 0;
-	mode |= SSL_MODE_ENABLE_PARTIAL_WRITE;
-	mode |= SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
-	SSL_CTX_set_mode(ctx, mode);
-
-	SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH);
-	SSL_CTX_set_timeout(ctx, 300);
-	SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_callback);
-	SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
-
-	return 1;
-}
-
-static int anontls_dialog(int s_in, int s_out) {
-
-	if (s_in || s_out) {}
-	anontls_selected = 1;
-
-	if (!switch_to_anon_dh()) {
-		rfbLog("anontls: Anonymous Diffie-Hellman failed.\n");	
-		return 0;
-	}
-
-	/* continue with SSL/TLS */
-	return 1;
-}
-
-/*
- * Using spec:
- * http://www.mail-archive.com/qemu-devel@nongnu.org/msg08681.html
- */
-static int vencrypt_dialog(int s_in, int s_out) {
-	char buf[256], buf2[256];
-	int subtypes[16];
-	int n, i, ival, ok, nsubtypes = 0;
-
-	vencrypt_selected = 0;
-
-	/* send version 0.2 */
-	buf[0] = 0;
-	buf[1] = 2;
-
-	if (!write_exact(s_out, buf, 2)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	/* read client version 0.2 */
-	memset(buf, 0, sizeof(buf));
-	if (!read_exact(s_in, buf, 2)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-	rfbLog("vencrypt: received %d.%d client version.\n", (int) buf[0], (int) buf[1]);
-
-	/* close 0.0 */
-	if (buf[0] == 0 && buf[1] == 0) {
-		rfbLog("vencrypt: received 0.0 version, closing connection.\n");
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	/* accept only 0.2 */
-	if (buf[0] != 0 || buf[1] != 2) {
-		rfbLog("vencrypt: unsupported VeNCrypt version, closing connection.\n");
-		buf[0] = (char) 255;
-		write_exact(s_out, buf, 1);
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	/* tell them OK */
-	buf[0] = 0;
-	if (!write_exact(s_out, buf, 1)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	if (getenv("X11VNC_ENABLE_VENCRYPT_PLAIN_LOGIN")) {
-		vencrypt_enable_plain_login = atoi(getenv("X11VNC_ENABLE_VENCRYPT_PLAIN_LOGIN"));
-	}
-
-	/* load our list of sub-types: */
-	n = 0;
-	if (!ssl_verify && vencrypt_kx != VENCRYPT_NODH) {
-		if (screen->authPasswdData != NULL) {
-			subtypes[n++] = rfbVencryptTlsVnc;
-		} else {
-			if (vencrypt_enable_plain_login && unixpw) {
-				subtypes[n++] = rfbVencryptTlsPlain;
-			} else {
-				subtypes[n++] = rfbVencryptTlsNone;
-			}
-		}
-	}
-	if (vencrypt_kx != VENCRYPT_NOX509) {
-		if (screen->authPasswdData != NULL) {
-			subtypes[n++] = rfbVencryptX509Vnc;
-		} else {
-			if (vencrypt_enable_plain_login && unixpw) {
-				subtypes[n++] = rfbVencryptX509Plain;
-			} else {
-				subtypes[n++] = rfbVencryptX509None;
-			}
-		}
-	}
-
-	nsubtypes = n;
-	for (i = 0; i < nsubtypes; i++) {
-		((uint32_t *)buf)[i] = Swap32IfLE(subtypes[i]);
-	}
-
-	/* send number first: */
-	buf2[0] = (char) nsubtypes;
-	if (!write_exact(s_out, buf2, 1)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-	/* and now the list: */
-	if (!write_exact(s_out, buf, 4*n)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	/* read client's selection: */
-	if (!read_exact(s_in, (char *)&ival, 4)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-	ival = Swap32IfLE(ival);
-
-	/* zero means no dice: */
-	if (ival == 0) {
-		rfbLog("vencrypt: client selected no sub-type, closing connection.\n");
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	/* check if he selected a valid one: */
-	ok = 0;
-	for (i = 0; i < nsubtypes; i++) {
-		if (ival == subtypes[i]) {
-			ok = 1;
-		}
-	}
-
-	if (!ok) {
-		rfbLog("vencrypt: client selected invalid sub-type: %d\n", ival);
-		close(s_in); close(s_out);
-		return 0;
-	} else {
-		char *st = "unknown!!";
-		if (ival == rfbVencryptTlsNone)	  st = "rfbVencryptTlsNone";
-		if (ival == rfbVencryptTlsVnc)    st = "rfbVencryptTlsVnc";
-		if (ival == rfbVencryptTlsPlain)  st = "rfbVencryptTlsPlain";
-		if (ival == rfbVencryptX509None)  st = "rfbVencryptX509None";
-		if (ival == rfbVencryptX509Vnc)   st = "rfbVencryptX509Vnc";
-		if (ival == rfbVencryptX509Plain) st = "rfbVencryptX509Plain";
-		rfbLog("vencrypt: client selected sub-type: %d (%s)\n", ival, st);
-	}
-
-	vencrypt_selected = ival;
-
-	/* not documented in spec, send OK: */
-	buf[0] = 1;
-	if (!write_exact(s_out, buf, 1)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	if (vencrypt_selected == rfbVencryptTlsNone ||
-	    vencrypt_selected == rfbVencryptTlsVnc  ||
-	    vencrypt_selected == rfbVencryptTlsPlain) {
-		/* these modes are Anonymous Diffie-Hellman */
-		if (!switch_to_anon_dh()) {
-			rfbLog("vencrypt: Anonymous Diffie-Hellman failed.\n");	
-			return 0;
-		}
-	}
-
-	/* continue with SSL/TLS */
-	return 1;
-}
-
-static int check_vnc_tls_mode(int s_in, int s_out, double last_https) {
-	double waited = 0.0, waitmax = 1.4, dt = 0.01, start = dnow();
-	struct timeval tv;
-	int input = 0, i, n, ok;
-	int major, minor, sectype = -1;
-	char *proto = "RFB 003.008\n";
-	char *stype = "unknown";
-	char buf[256];
-	
-	vencrypt_selected = 0;
-	anontls_selected = 0;
-
-	if (vencrypt_mode == VENCRYPT_NONE && anontls_mode == ANONTLS_NONE) {
-		/* only normal SSL */
-		return 1;
-	}
-	if (ssl_client_mode) {
-		if (vencrypt_mode == VENCRYPT_FORCE || anontls_mode == ANONTLS_FORCE) {
-			rfbLog("check_vnc_tls_mode: VENCRYPT_FORCE/ANONTLS_FORCE in client\n");
-			rfbLog("check_vnc_tls_mode: connect mode.\n");
-			/* this is OK, continue on below for dialog. */
-		} else {
-			/* otherwise we must assume normal SSL (we send client hello) */
-			return 1;
-		}
-	}
-	if (ssl_verify && vencrypt_mode != VENCRYPT_FORCE && anontls_mode == ANONTLS_FORCE) {
-		rfbLog("check_vnc_tls_mode: Cannot use ANONTLS_FORCE with -sslverify (Anon DH only)\n");
-		/* fallback to normal SSL */
-		return 1;
-	}
-
-	if (last_https > 0.0) {
-		double now = dnow();
-		if (now < last_https + 5.0) {
-			waitmax = 20.0;
-		} else if (now < last_https + 15.0) {
-			waitmax = 10.0;
-		} else if (now < last_https + 30.0) {
-			waitmax = 5.0;
-		} else if (now < last_https + 60.0) {
-			waitmax = 2.5;
-		}
-	}
-
-	while (waited < waitmax) {
-		fd_set rfds;
-		FD_ZERO(&rfds);
-		FD_SET(s_in, &rfds);
-		tv.tv_sec = 0; 
-		tv.tv_usec = 0; 
-		select(s_in+1, &rfds, NULL, NULL, &tv);
-		if (FD_ISSET(s_in, &rfds)) {
-			input = 1;
-			break;
-		}
-		usleep((int) (1000 * 1000 * dt));
-		waited += dt;
-	}
-	rfbLog("check_vnc_tls_mode: waited: %f / %.2f input: %s\n",
-	    dnow() - start, waitmax, input ? "SSL Handshake" : "(future) RFB Handshake");
-
-	if (input) {
-		/* got SSL client hello, can only assume normal SSL */
-		if (vencrypt_mode == VENCRYPT_FORCE || anontls_mode == ANONTLS_FORCE) {
-			rfbLog("check_vnc_tls_mode: VENCRYPT_FORCE/ANONTLS_FORCE prevents normal SSL\n");
-			return 0;
-		}
-		return 1;
-	}
-
-	/* send RFB 003.008 -- there is no turning back from this point... */
-	if (!write_exact(s_out, proto, strlen(proto))) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	memset(buf, 0, sizeof(buf));
-	if (!read_exact(s_in, buf, 12)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	if (sscanf(buf, "RFB %03d.%03d\n", &major, &minor) != 2) {
-		int i;
-		rfbLog("check_vnc_tls_mode: abnormal handshake: '%s'\nbytes: ", buf);
-		for (i=0; i < 12; i++) {
-			fprintf(stderr, "%d.", (unsigned char) buf[i]);
-		}
-		fprintf(stderr, "\n");
-		close(s_in); close(s_out);
-		return 0;
-	}
-	rfbLog("check_vnc_tls_mode: version: %d.%d\n", major, minor);
-	if (major != 3 || minor < 8) {
-		rfbLog("check_vnc_tls_mode: invalid version: '%s'\n", buf);
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	n = 1;
-	if (vencrypt_mode == VENCRYPT_FORCE) {
-		buf[n++] = rfbSecTypeVencrypt;
-	} else if (anontls_mode == ANONTLS_FORCE && !ssl_verify) {
-		buf[n++] = rfbSecTypeAnonTls;
-	} else if (vencrypt_mode == VENCRYPT_SOLE) {
-		buf[n++] = rfbSecTypeVencrypt;
-	} else if (anontls_mode == ANONTLS_SOLE && !ssl_verify) {
-		buf[n++] = rfbSecTypeAnonTls;
-	} else {
-		if (vencrypt_mode == VENCRYPT_SUPPORT) {
-			buf[n++] = rfbSecTypeVencrypt;
-		}
-		if (anontls_mode == ANONTLS_SUPPORT && !ssl_verify) {
-			buf[n++] = rfbSecTypeAnonTls;
-		}
-	}
-
-	n--;
-	buf[0] = (char) n;
-	if (!write_exact(s_out, buf, n+1)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-	if (0) fprintf(stderr, "wrote[%d] %d %d %d\n", n, buf[0], buf[1], buf[2]);
-
-	buf[0] = 0;
-	if (!read_exact(s_in, buf, 1)) {
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	if (buf[0] == rfbSecTypeVencrypt) stype = "VeNCrypt";
-	if (buf[0] == rfbSecTypeAnonTls)  stype = "ANONTLS";
-
-	rfbLog("check_vnc_tls_mode: reply: %d (%s)\n", (int) buf[0], stype);
-
-	ok = 0;
-	for (i=1; i < n+1; i++) {
-		if (buf[0] == buf[i]) {
-			ok = 1;
-		}
-	}
-	if (!ok) {
-		char *msg = "check_vnc_tls_mode: invalid security-type";
-		int len = strlen(msg);
-		rfbLog("%s: %d\n", msg, (int) buf[0]);
-		((uint32_t *)buf)[0] = Swap32IfLE(len);
-		write_exact(s_out, buf, 4);
-		write_exact(s_out, msg, strlen(msg));
-		close(s_in); close(s_out);
-		return 0;
-	}
-
-	sectype = (int) buf[0];
-
-	if (sectype == rfbSecTypeVencrypt) {
-		return vencrypt_dialog(s_in, s_out);
-	} else if (sectype == rfbSecTypeAnonTls) {
-		return anontls_dialog(s_in, s_out);
-	} else {
-		return 0;
-	}
-}
-
-static void pr_ssl_info(int verb) {
-	SSL_CIPHER *c;
-	SSL_SESSION *s;
-	char *proto = "unknown";
-
-	if (verb) {}
-
-	if (ssl == NULL) {
-		return;
-	}
-	c = SSL_get_current_cipher(ssl);
-	s = SSL_get_session(ssl);
-
-	if (s == NULL) {
-		proto = "nosession";
-	} else if (s->ssl_version == SSL2_VERSION) {
-		proto = "SSLv2";
-	} else if (s->ssl_version == SSL3_VERSION) {
-		proto = "SSLv3";
-	} else if (s->ssl_version == TLS1_VERSION) {
-		proto = "TLSv1";
-	}
-	if (c != NULL) {
-		rfbLog("SSL: ssl_helper[%d]: Cipher: %s %s Proto: %s\n", getpid(),
-		    SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c), proto);
-	} else {
-		rfbLog("SSL: ssl_helper[%d]: Proto: %s\n", getpid(),
-		    proto);
-	}
-}
-
-static void ssl_timeout (int sig) {
-	int i;
-	rfbLog("sig: %d, ssl_init[%d] timed out.\n", sig, getpid());
-	rfbLog("To increase the SSL initialization timeout use, e.g.:\n");
-	rfbLog("   -env SSL_INIT_TIMEOUT=120        (for 120 seconds)\n");
-	for (i=0; i < 256; i++) {
-		close(i);
-	}
-	exit(1);
-}
-
-static int ssl_init(int s_in, int s_out, int skip_vnc_tls, double last_https) {
-	unsigned char *sid = (unsigned char *) "x11vnc SID";
-	char *name = NULL;
-	int peerport = 0;
-	int db = 0, rc, err;
-	int ssock = s_in;
-	double start = dnow();
-	int timeout = 20;
-
-	if (enc_str != NULL) {
-		return 1;
-	}
-	if (getenv("SSL_DEBUG")) {
-		db = atoi(getenv("SSL_DEBUG"));
-	}
-	usleep(100 * 1000);
-	if (getenv("SSL_INIT_TIMEOUT")) {
-		timeout = atoi(getenv("SSL_INIT_TIMEOUT"));
-	} else if (client_connect != NULL && strstr(client_connect, "repeater")) {
-		rfbLog("SSL: ssl_init[%d]: detected 'repeater' in connect string.\n", getpid());
-		rfbLog("SSL: setting timeout to 1 hour: -env SSL_INIT_TIMEOUT=3600\n");
-		rfbLog("SSL: use that option to set a different timeout value,\n");
-		rfbLog("SSL: however note that with Windows UltraVNC repeater it\n");
-		rfbLog("SSL: may timeout before your setting due to other reasons.\n");
-		timeout = 3600;
-	}
-
-	if (skip_vnc_tls) {
-		rfbLog("SSL: ssl_helper[%d]: HTTPS mode, skipping check_vnc_tls_mode()\n",
-		    getpid());
-	} else if (!check_vnc_tls_mode(s_in, s_out, last_https)) {
-		return 0;
-	}
-	rfbLog("SSL: ssl_init[%d]: %d/%d initialization timeout: %d secs.\n",
-	    getpid(), s_in, s_out, timeout);
-
-	ssl = SSL_new(ctx);
-	if (ssl == NULL) {
-		fprintf(stderr, "SSL_new failed\n");
-		return 0;
-	}
-	if (db > 1) fprintf(stderr, "ssl_init: 1\n");
-
-	SSL_set_session_id_context(ssl, sid, strlen((char *)sid));
-
-	if (s_in == s_out) {
-		if (! SSL_set_fd(ssl, ssock)) {
-			fprintf(stderr, "SSL_set_fd failed\n");
-			return 0;
-		}
-	} else {
-		if (! SSL_set_rfd(ssl, s_in)) {
-			fprintf(stderr, "SSL_set_rfd failed\n");
-			return 0;
-		}
-		if (! SSL_set_wfd(ssl, s_out)) {
-			fprintf(stderr, "SSL_set_wfd failed\n");
-			return 0;
-		}
-	}
-	if (db > 1) fprintf(stderr, "ssl_init: 2\n");
-
-	if (ssl_client_mode) {
-		SSL_set_connect_state(ssl);
-	} else {
-		SSL_set_accept_state(ssl);
-	}
-
-	if (db > 1) fprintf(stderr, "ssl_init: 3\n");
-
-	name = get_remote_host(ssock);
-	peerport = get_remote_port(ssock);
-
-	if (!strcmp(name, "0.0.0.0") && openssl_last_ip != NULL) {
-		name = strdup(openssl_last_ip);
-	}
-
-	if (db > 1) fprintf(stderr, "ssl_init: 4\n");
-
-	while (1) {
-
-		signal(SIGALRM, ssl_timeout);
-		alarm(timeout);
-
-		if (ssl_client_mode) {
-			if (db) fprintf(stderr, "calling SSL_connect...\n");
-			rc = SSL_connect(ssl);
-		} else {
-			if (db) fprintf(stderr, "calling SSL_accept...\n");
-			rc = SSL_accept(ssl);
-		}
-		err = SSL_get_error(ssl, rc);
-
-		alarm(0);
-		signal(SIGALRM, SIG_DFL);
-
-		if (ssl_client_mode) {
-			if (db) fprintf(stderr, "SSL_connect %d/%d\n", rc, err);
-		} else {
-			if (db) fprintf(stderr, "SSL_accept %d/%d\n", rc, err);
-		}
-		if (err == SSL_ERROR_NONE) {
-			break;
-		} else if (err == SSL_ERROR_WANT_READ) {
-
-			if (db) fprintf(stderr, "got SSL_ERROR_WANT_READ\n");
-			rfbLog("SSL: ssl_helper[%d]: %s() failed for: %s:%d 1\n",
-			    getpid(), ssl_client_mode ? "SSL_connect" : "SSL_accept", name, peerport);
-			pr_ssl_info(1);
-			return 0;
-			
-		} else if (err == SSL_ERROR_WANT_WRITE) {
-
-			if (db) fprintf(stderr, "got SSL_ERROR_WANT_WRITE\n");
-			rfbLog("SSL: ssl_helper[%d]: %s() failed for: %s:%d 2\n",
-			    getpid(), ssl_client_mode ? "SSL_connect" : "SSL_accept", name, peerport);
-			pr_ssl_info(1);
-			return 0;
-
-		} else if (err == SSL_ERROR_SYSCALL) {
-
-			if (db) fprintf(stderr, "got SSL_ERROR_SYSCALL\n");
-			rfbLog("SSL: ssl_helper[%d]: %s() failed for: %s:%d 3\n",
-			    getpid(), ssl_client_mode ? "SSL_connect" : "SSL_accept", name, peerport);
-			pr_ssl_info(1);
-			return 0;
-
-		} else if (err == SSL_ERROR_ZERO_RETURN) {
-
-			if (db) fprintf(stderr, "got SSL_ERROR_ZERO_RETURN\n");
-			rfbLog("SSL: ssl_helper[%d]: %s() failed for: %s:%d 4\n",
-			    getpid(), ssl_client_mode ? "SSL_connect" : "SSL_accept", name, peerport);
-			pr_ssl_info(1);
-			return 0;
-
-		} else if (rc < 0) {
-			unsigned long err;
-			int cnt = 0;
-
-			rfbLog("SSL: ssl_helper[%d]: %s() *FATAL: %d SSL FAILED\n",
-			    getpid(), ssl_client_mode ? "SSL_connect" : "SSL_accept", rc);
-			while ((err = ERR_get_error()) != 0) {
-				rfbLog("SSL: %s\n", ERR_error_string(err, NULL));
-				if (cnt++ > 100) {
-					break;
-				}
-			}
-			pr_ssl_info(1);
-			return 0;
-
-		} else if (dnow() > start + 3.0) {
-
-			rfbLog("SSL: ssl_helper[%d]: timeout looping %s() "
-			    "fatal.\n", getpid(), ssl_client_mode ? "SSL_connect" : "SSL_accept");
-			pr_ssl_info(1);
-			return 0;
-
-		} else {
-			BIO *bio = SSL_get_rbio(ssl);
-			if (bio == NULL) {
-				rfbLog("SSL: ssl_helper[%d]: ssl BIO is null. "
-				    "fatal.\n", getpid());
-				pr_ssl_info(1);
-				return 0;
-			}
-			if (BIO_eof(bio)) {
-				rfbLog("SSL: ssl_helper[%d]: ssl BIO is EOF. "
-				    "fatal.\n", getpid());
-				pr_ssl_info(1);
-				return 0;
-			}
-		}
-		usleep(10 * 1000);
-	}
-
-	if (ssl_client_mode) {
-		rfbLog("SSL: ssl_helper[%d]: SSL_connect() succeeded for: %s:%d\n", getpid(), name, peerport);
-	} else {
-		rfbLog("SSL: ssl_helper[%d]: SSL_accept() succeeded for: %s:%d\n", getpid(), name, peerport);
-	}
-
-	pr_ssl_info(0);
-
-	if (SSL_get_verify_result(ssl) == X509_V_OK) {
-		X509 *x;
-		FILE *cr = NULL;
-		if (certret != NULL) {
-			cr = fopen(certret, "w");
-		}
-		
-		x = SSL_get_peer_certificate(ssl);	
-		if (x == NULL) {
-			rfbLog("SSL: ssl_helper[%d]: accepted client %s x509 peer cert is null\n", getpid(), name);
-			if (cr != NULL) {
-				fprintf(cr, "NOCERT\n");
-				fclose(cr);
-			}
-		} else {
-			rfbLog("SSL: ssl_helper[%d]: accepted client %s x509 cert is:\n", getpid(), name);
-#if LIBVNCSERVER_HAVE_X509_PRINT_EX_FP
-			X509_print_ex_fp(stderr, x, 0, XN_FLAG_MULTILINE);
-#endif
-			if (cr != NULL) {
-#if LIBVNCSERVER_HAVE_X509_PRINT_EX_FP
-				X509_print_ex_fp(cr, x, 0, XN_FLAG_MULTILINE);
-#else
-				rfbLog("** not compiled with libssl X509_print_ex_fp() function **\n");
-				if (users_list && strstr(users_list, "sslpeer=")) {
-					rfbLog("** -users sslpeer= will not work! **\n");
-				}
-#endif
-				fclose(cr);
-			}
-		}
-	}
-	free(name);
-
-	return 1;
-}
-
-static void symmetric_encryption_xfer(int csock, int s_in, int s_out);
-
-static void ssl_xfer(int csock, int s_in, int s_out, int is_https) {
-	int dbxfer = 0, db = 0, check_pending, fdmax, nfd, n, i, err;
-	char cbuf[ABSIZE], sbuf[ABSIZE];
-	int  cptr, sptr, c_rd, c_wr, s_rd, s_wr;
-	fd_set rd, wr;
-	struct timeval tv;
-	int ssock, cnt = 0, ndata = 0;
-
-	/*
-	 * we want to switch to a longer timeout for long term VNC
-	 * connections (in case the network is not working for periods of
-	 * time), but we also want the timeout shorter at the beginning
-	 * in case the client went away.
-	 */
-	double start, now;
-	int tv_https_early = 60;
-	int tv_https_later = 20;
-	int tv_vnc_early = 40;
-	int tv_vnc_later = 43200;	/* was 300, stunnel: 43200 */
-	int tv_cutover = 70;
-	int tv_closing = 60;
-	int tv_use;
-
-	if (dbxfer) {
-		raw_xfer(csock, s_in, s_out);
-		return;
-	}
-	if (enc_str != NULL) {
-		if (!strcmp(enc_str, "none")) {
-			usleep(250*1000);
-			rfbLog("doing '-enc none' raw transfer (no encryption)\n"); 
-			raw_xfer(csock, s_in, s_out);
-		} else {
-			symmetric_encryption_xfer(csock, s_in, s_out);
-		}
-		return;
-	}
-
-	if (getenv("SSL_DEBUG")) {
-		db = atoi(getenv("SSL_DEBUG"));
-	}
-
-	if (db) fprintf(stderr, "ssl_xfer begin\n");
-
-	start = dnow();
-	if (is_https) {
-		tv_use = tv_https_early;
-	} else {
-		tv_use = tv_vnc_early;
-	}
-	
-
-	/*
-	 * csock: clear text socket with libvncserver.    "C"
-	 * ssock: ssl data socket with remote vnc viewer. "S"
-	 *
-	 * to cover inetd mode, we have s_in and s_out, but in non-inetd
-	 * mode they both ssock.
-	 *
-	 * cbuf[] is data from csock that we have read but not passed on to ssl 
-	 * sbuf[] is data from ssl that we have read but not passed on to csock 
-	 */
-	for (i=0; i<ABSIZE; i++) {
-		cbuf[i] = '\0';
-		sbuf[i] = '\0';
-	}
-		
-	if (s_out > s_in) {
-		ssock = s_out;
-	} else {
-		ssock = s_in;
-	}
-
-	if (csock > ssock) {
-		fdmax = csock; 
-	} else {
-		fdmax = ssock; 
-	}
-
-	c_rd = 1;	/* clear text (libvncserver) socket open for reading */
-	c_wr = 1;	/* clear text (libvncserver) socket open for writing */
-	s_rd = 1;	/* ssl data (remote client)  socket open for reading */
-	s_wr = 1;	/* ssl data (remote client)  socket open for writing */
-
-	cptr = 0;	/* offsets into ABSIZE buffers */
-	sptr = 0;
-
-	if (vencrypt_selected > 0 || anontls_selected > 0) {
-		char tmp[16];
-		/* read and discard the extra RFB version */
-		memset(tmp, 0, sizeof(tmp));
-		read(csock, tmp, 12);
-		if (0) fprintf(stderr, "extra: %s\n", tmp);
-	}
-
-	while (1) {
-		int c_to_s, s_to_c, closing;
-
-		if ( s_wr && (c_rd || cptr > 0) ) {
-			/* 
-			 * S is writable and 
-			 * C is readable or some cbuf data remaining
-			 */
-			c_to_s = 1;
-		} else {
-			c_to_s = 0;
-		}
-
-		if ( c_wr && (s_rd || sptr > 0) ) {
-			/* 
-			 * C is writable and 
-			 * S is readable or some sbuf data remaining
-			 */
-			s_to_c = 1;
-		} else {
-			s_to_c = 0;
-		}
-
-		if (! c_to_s && ! s_to_c) {
-			/*
-			 * nothing can be sent either direction.
-			 * break out of the loop to finish all work.
-			 */
-			break;
-		}
-		cnt++;
-
-		/* set up the fd sets for the two sockets for read & write: */
-
-		FD_ZERO(&rd);
-
-		if (c_rd && cptr < ABSIZE) {
-			/* we could read more from C since cbuf is not full */
-			FD_SET(csock, &rd);
-		}
-		if (s_rd) {
-			/*
-			 * we could read more from S since sbuf not full,
-			 * OR ssl is waiting for more BIO to be able to
-			 * read and we have some C data still buffered.
-			 */
-			if (sptr < ABSIZE || (cptr > 0 && SSL_want_read(ssl))) {
-				FD_SET(s_in, &rd);
-			}
-		}
-		
-		FD_ZERO(&wr);
-
-		if (c_wr && sptr > 0) {
-			/* we could write more to C since sbuf is not empty */
-			FD_SET(csock, &wr);
-		}
-		if (s_wr) {
-			/*
-			 * we could write more to S since cbuf not empty,
-			 * OR ssl is waiting for more BIO to be able
-			 * write and we haven't filled up sbuf yet.
-			 */
-			if (cptr > 0 || (sptr < ABSIZE && SSL_want_write(ssl))) {
-				FD_SET(s_out, &wr);
-			}
-		}
-
-		now = dnow();
-		if (tv_cutover && now > start + tv_cutover) {
-			rfbLog("SSL: ssl_xfer[%d]: tv_cutover: %d\n", getpid(),
-			    tv_cutover);
-			tv_cutover = 0;
-			if (is_https) {
-				tv_use = tv_https_later;
-			} else {
-				tv_use = tv_vnc_later;
-			}
-			/* try to clean out some zombies if we can. */
-			ssl_helper_pid(0, -2);
-		}
-		if (ssl_timeout_secs > 0) {
-			tv_use = ssl_timeout_secs;
-		}
-
-		if ( (s_rd && c_rd) || cptr || sptr) {
-			closing = 0;
-		} else {
-			closing = 1;
-			tv_use = tv_closing;
-		}
-
-		tv.tv_sec  = tv_use;
-		tv.tv_usec = 0;
-
-		/*  do the select, repeat if interrupted */
-		do {
-			if (ssl_timeout_secs == 0) {
-				nfd = select(fdmax+1, &rd, &wr, NULL, NULL);
-			} else {
-				nfd = select(fdmax+1, &rd, &wr, NULL, &tv);
-			}
-		} while (nfd < 0 && errno == EINTR);
-
-		if (db > 1) fprintf(stderr, "nfd: %d\n", nfd);
-
-if (0) fprintf(stderr, "nfd[%d]: %d  w/r csock: %d %d s_in: %d %d\n", getpid(), nfd, FD_ISSET(csock, &wr), FD_ISSET(csock, &rd), FD_ISSET(s_out, &wr), FD_ISSET(s_in, &rd)); 
-
-		if (nfd < 0) {
-			rfbLog("SSL: ssl_xfer[%d]: select error: %d\n", getpid(), nfd);
-			perror("select");
-			/* connection finished */
-			goto done;	
-		}
-
-		if (nfd == 0) {
-			if (!closing && tv_cutover && ndata > 25000) {
-				static int cn = 0;
-				/* probably ok, early windows iconify */
-				if (cn++ < 2) {
-					rfbLog("SSL: ssl_xfer[%d]: early time"
-					    "out: %d\n", getpid(), ndata);
-				}
-				continue;
-			}
-			rfbLog("SSL: ssl_xfer[%d]: connection timedout. %d  tv_use: %d\n",
-			    getpid(), ndata, tv_use);
-			/* connection finished */
-			goto done;
-		}
-
-		/* used to see if SSL_pending() should be checked: */
-		check_pending = 0;
-/* AUDIT */
-
-		if (c_wr && FD_ISSET(csock, &wr)) {
-
-			/* try to write some of our sbuf to C: */
-			n = write(csock, sbuf, sptr); 
-
-			if (n < 0) {
-				if (errno != EINTR) {
-					/* connection finished */
-					goto done;
-				}
-				/* proceed */
-			} else if (n == 0) {
-				/* connection finished XXX double check */
-				goto done;
-			} else {
-				/* shift over the data in sbuf by n */
-				memmove(sbuf, sbuf + n, sptr - n);
-				if (sptr == ABSIZE) {
-					check_pending = 1;
-				}
-				sptr -= n;
-
-				if (! s_rd && sptr == 0) {
-					/* finished sending last of sbuf */
-					shutdown(csock, SHUT_WR);
-					c_wr = 0;
-				}
-				ndata += n;
-			}
-		}
-
-		if (s_wr) {
-			if ((cptr > 0 && FD_ISSET(s_out, &wr)) ||
-			    (SSL_want_read(ssl) && FD_ISSET(s_in, &rd))) {
-
-				/* try to write some of our cbuf to S: */
-
-				n = SSL_write(ssl, cbuf, cptr);
-				err = SSL_get_error(ssl, n);
-
-				if (err == SSL_ERROR_NONE) {
-					/* shift over the data in cbuf by n */
-					memmove(cbuf, cbuf + n, cptr - n);
-					cptr -= n;
-
-					if (! c_rd && cptr == 0 && s_wr) {
-						/* finished sending last cbuf */
-						SSL_shutdown(ssl);
-						s_wr = 0;
-					}
-					ndata += n;
-
-				} else if (err == SSL_ERROR_WANT_WRITE
-					|| err == SSL_ERROR_WANT_READ
-					|| err == SSL_ERROR_WANT_X509_LOOKUP) {
-
-						;	/* proceed */
-
-				} else if (err == SSL_ERROR_SYSCALL) {
-					if (n < 0 && errno != EINTR) {
-						/* connection finished */
-						goto done;
-					}
-					/* proceed */
-				} else if (err == SSL_ERROR_ZERO_RETURN) {
-					/* S finished */
-					s_rd = 0;
-					s_wr = 0;
-				} else if (err == SSL_ERROR_SSL) {
-					/* connection finished */
-					goto done;
-				}
-			}
-		}
-
-		if (c_rd && FD_ISSET(csock, &rd)) {
-
-
-			/* try to read some data from C into our cbuf */
-
-			n = read(csock, cbuf + cptr, ABSIZE - cptr);
-
-			if (n < 0) {
-				if (errno != EINTR) {
-					/* connection finished */
-					goto done;
-				}
-				/* proceed */
-			} else if (n == 0) {
-				/* C is EOF */
-				c_rd = 0;
-				if (cptr == 0 && s_wr) {
-					/* and no more in cbuf to send */
-					SSL_shutdown(ssl);
-					s_wr = 0;
-				}
-			} else {
-				/* good */
-
-				cptr += n;
-				ndata += n;
-			}
-		}
-
-		if (s_rd) {
-			if ((sptr < ABSIZE && FD_ISSET(s_in, &rd)) ||
-			    (SSL_want_write(ssl) && FD_ISSET(s_out, &wr)) ||
-			    (check_pending && SSL_pending(ssl))) {
-
-				/* try to read some data from S into our sbuf */
-
-				n = SSL_read(ssl, sbuf + sptr, ABSIZE - sptr);
-				err = SSL_get_error(ssl, n);
-
-				if (err == SSL_ERROR_NONE) {
-					/* good */
-
-					sptr += n;
-					ndata += n;
-
-				} else if (err == SSL_ERROR_WANT_WRITE
-					|| err == SSL_ERROR_WANT_READ
-					|| err == SSL_ERROR_WANT_X509_LOOKUP) {
-
-						;	/* proceed */
-
-				} else if (err == SSL_ERROR_SYSCALL) {
-					if (n < 0) {
-						if(errno != EINTR) {
-							/* connection finished */
-							goto done;
-						}
-						/* proceed */
-					} else {
-						/* S finished */
-						s_rd = 0;
-						s_wr = 0;
-					}
-				} else if (err == SSL_ERROR_ZERO_RETURN) {
-					/* S is EOF */
-					s_rd = 0;
-					if (cptr == 0 && s_wr) {
-						/* and no more in cbuf to send */
-						SSL_shutdown(ssl);
-						s_wr = 0;
-					}
-					if (sptr == 0 && c_wr) {
-						/* and no more in sbuf to send */
-						shutdown(csock, SHUT_WR);
-						c_wr = 0;
-					}
-				} else if (err == SSL_ERROR_SSL) {
-					/* connection finished */
-					goto done;
-				}
-			}
-		}
-	}
-
-	done:
-	rfbLog("SSL: ssl_xfer[%d]: closing sockets %d, %d, %d\n",
-			    getpid(), csock, s_in, s_out);
-	close(csock);
-	close(s_in);
-	close(s_out);
-	return;
-}
-
-#define MSZ 4096
-static void init_prng(void) {
-	int db = 0, bytes, ubytes, fd;
-	char file[MSZ], dtmp[100];
-	unsigned int sr;
-
-	RAND_file_name(file, MSZ);
-
-	rfbLog("RAND_file_name: %s\n", file);
-
-	bytes = RAND_load_file(file, -1);
-	if (db) fprintf(stderr, "bytes read: %d\n", bytes);
-	
-	ubytes = RAND_load_file("/dev/urandom", 64);
-	bytes += ubytes;
-	if (db) fprintf(stderr, "bytes read: %d / %d\n", bytes, ubytes);
-
-	/* mix in more predictable stuff as well for fallback */
-	sprintf(dtmp, "/tmp/p%.8f.XXXXXX", dnow());
-	fd = mkstemp(dtmp);
-	RAND_add(dtmp, strlen(dtmp), 0);
-	if (fd >= 0) {
-		close(fd);
-		unlink(dtmp);
-	}
-	sprintf(dtmp, "%d-%.8f", (int) getpid(), dnow());
-	RAND_add(dtmp, strlen(dtmp), 0);
-
-	if (!RAND_status()) {
-		ubytes = -1;
-		rfbLog("calling RAND_poll()\n");
-		RAND_poll();
-	}
-	
-	RAND_bytes((unsigned char *)&sr, 4);
-	srand(sr);
-
-	if (bytes > 0) {
-		if (! quiet) {
-			rfbLog("initialized PRNG with %d random bytes.\n",
-			    bytes);
-		}
-		if (ubytes > 32 && rnow() < 0.25) {
-			RAND_write_file(file);
-		}
-		return;
-	}
-
-	bytes += RAND_load_file("/dev/random", 8);
-	if (db) fprintf(stderr, "bytes read: %d\n", bytes);
-	RAND_poll();
-
-	if (! quiet) {
-		rfbLog("initialized PRNG with %d random bytes.\n", bytes);
-	}
-}
-#endif	/* FORK_OK */
-#endif	/* LIBVNCSERVER_HAVE_LIBSSL */
-
-void check_openssl(void) {
-	fd_set fds;
-	struct timeval tv;
-	int nfds, nmax = openssl_sock;
-	static time_t last_waitall = 0;
-	static double last_check = 0.0;
-	double now;
-
-	if (! use_openssl) {
-		return;
-	}
-
-	if (time(NULL) > last_waitall + 120) {
-		last_waitall = time(NULL);
-		ssl_helper_pid(0, -2);	/* waitall */
-	}
-
-	if (openssl_sock < 0 && openssl_sock6 < 0) {
-		return;
-	}
-
-	now = dnow();
-	if (now < last_check + 0.5) {
-		return;
-	}
-	last_check = now;
-
-	FD_ZERO(&fds);
-	if (openssl_sock >= 0) {
-		FD_SET(openssl_sock, &fds);
-	}
-	if (openssl_sock6 >= 0) {
-		FD_SET(openssl_sock6, &fds);
-		if (openssl_sock6 > openssl_sock) {
-			nmax = openssl_sock6;
-		}
-	}
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-
-	nfds = select(nmax+1, &fds, NULL, NULL, &tv);
-
-	if (nfds <= 0) {
-		return;
-	}
-
-	if (openssl_sock >= 0 && FD_ISSET(openssl_sock, &fds)) {
-		rfbLog("SSL: accept_openssl(OPENSSL_VNC)\n");
-		accept_openssl(OPENSSL_VNC, -1);
-	}
-	if (openssl_sock6 >= 0 && FD_ISSET(openssl_sock6, &fds)) {
-		rfbLog("SSL: accept_openssl(OPENSSL_VNC6)\n");
-		accept_openssl(OPENSSL_VNC6, -1);
-	}
-}
-
-void check_https(void) {
-	fd_set fds;
-	struct timeval tv;
-	int nfds, nmax = https_sock;
-	static double last_check = 0.0;
-	double now;
-
-	if (! use_openssl || (https_sock < 0 && https_sock6 < 0)) {
-		return;
-	}
-
-	now = dnow();
-	if (now < last_check + 0.5) {
-		return;
-	}
-	last_check = now;
-
-	FD_ZERO(&fds);
-	if (https_sock >= 0) {
-		FD_SET(https_sock, &fds);
-	}
-	if (https_sock6 >= 0) {
-		FD_SET(https_sock6, &fds);
-		if (https_sock6 > https_sock) {
-			nmax = https_sock6;
-		}
-	}
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
-
-	nfds = select(nmax+1, &fds, NULL, NULL, &tv);
-
-	if (nfds <= 0) {
-		return;
-	}
-
-	if (https_sock >= 0 && FD_ISSET(https_sock, &fds)) {
-		rfbLog("SSL: accept_openssl(OPENSSL_HTTPS)\n");
-		accept_openssl(OPENSSL_HTTPS, -1);
-	}
-	if (https_sock6 >= 0 && FD_ISSET(https_sock6, &fds)) {
-		rfbLog("SSL: accept_openssl(OPENSSL_HTTPS6)\n");
-		accept_openssl(OPENSSL_HTTPS6, -1);
-	}
-}
-
-void openssl_port(int restart) {
-	int sock = -1, shutdown = 0;
-	static int port = -1;
-	static in_addr_t iface = INADDR_ANY;
-	int db = 0, fd6 = -1;
-
-	if (! screen) {
-		rfbLog("openssl_port: no screen!\n");
-		clean_up_exit(1);
-	}
-	if (inetd) {
-		ssl_initialized = 1;
-		return;
-	}
-
-	if (ipv6_listen && screen->port <= 0) {
-		if (got_rfbport) {
-			screen->port = got_rfbport_val;
-		} else {
-			int ap = 5900;
-			if (auto_port > 0) {
-				ap = auto_port;
-			}
-			screen->port = find_free_port6(ap, ap+200);
-		}
-		rfbLog("openssl_port: reset port from 0 => %d\n", screen->port);
-	}
-
-	if (restart) {
-		port = screen->port;
-	} else if (screen->listenSock > -1 && screen->port > 0) {
-		port = screen->port;
-		shutdown = 1;
-	} else if (ipv6_listen && screen->port > 0) {
-		port = screen->port;
-	} else if (screen->port == 0) {
-		port = screen->port;
-	}
-
-	iface = screen->listenInterface;
-
-	if (shutdown) {
-		if (db) fprintf(stderr, "shutting down %d/%d\n",
-		    port, screen->listenSock);
-#if LIBVNCSERVER_HAS_SHUTDOWNSOCKETS
-		rfbShutdownSockets(screen);
-#endif
-	}
-
-	if (openssl_sock >= 0) {
-		close(openssl_sock);
-		openssl_sock = -1;
-	}
-	if (openssl_sock6 >= 0) {
-		close(openssl_sock6);
-		openssl_sock6 = -1;
-	}
-
-	if (port < 0) {
-		rfbLog("openssl_port: could not obtain listening port %d\n", port);
-		if (!got_rfbport && !got_ipv6_listen) {
-			rfbLog("openssl_port: if this system is IPv6-only, use the -6 option\n");
-		}
-		clean_up_exit(1);
-	} else if (port == 0) {
-		/* no listen case, i.e. -connect */
-		sock = -1;
-	} else {
-		sock = listen_tcp(port, iface, 0);
-		if (ipv6_listen) {
-			fd6 = listen6(port);
-		} else if (!got_rfbport && !got_ipv6_listen) {
-			if (sock < 0) {
-				rfbLog("openssl_port: if this system is IPv6-only, use the -6 option\n");
-			}
-		}
-		if (sock < 0) {
-			if (fd6 < 0) {
-				rfbLog("openssl_port: could not reopen port %d\n", port);
-				if (!restart) {
-					clean_up_exit(1);
-				}
-			} else {
-				rfbLog("openssl_port: Info: listening on IPv6 only.\n");
-			}
-		}
-	}
-	rfbLog("openssl_port: listen on port/sock %d/%d\n", port, sock);
-	if (ipv6_listen && port > 0) {
-		if (fd6 < 0) {
-			fd6 = listen6(port);
-		}
-		if (fd6 < 0) {
-			ipv6_listen = 0;
-		} else {
-			rfbLog("openssl_port: listen on port/sock %d/%d (ipv6)\n",
-			    port, fd6);
-			openssl_sock6 = fd6;
-		}
-	}
-	if (!quiet && sock >=0) {
-		announce(port, 1, NULL);
-	}
-	openssl_sock = sock;
-	openssl_port_num = port;
-
-	ssl_initialized = 1;
-}
-
-void https_port(int restart) {
-	int sock, fd6 = -1;
-	static int port = 0;
-	static in_addr_t iface = INADDR_ANY;
-
-	/* as openssl_port above: open a listening socket for pure https: */
-	if (https_port_num < 0) {
-		return;
-	}
-	if (! screen) {
-		rfbLog("https_port: no screen!\n");
-		clean_up_exit(1);
-	}
-	if (! screen->httpDir) {
-		return;
-	}
-	if (screen->listenInterface) {
-		iface = screen->listenInterface;
-	}
-
-	if (https_port_num == 0) {
-		https_port_num = find_free_port(5801, 5851);
-	}
-	if (ipv6_listen && https_port_num <= 0) {
-		https_port_num = find_free_port6(5801, 5851);
-	}
-	if (https_port_num <= 0) {
-		rfbLog("https_port: could not find port %d\n", https_port_num);
-		clean_up_exit(1);
-	}
-	port = https_port_num;
-
-	if (port <= 0) {
-		rfbLog("https_port: could not obtain listening port %d\n", port);
-		if (!restart) {
-			clean_up_exit(1);
-		} else {
-			return;
-		}
-	}
-	if (https_sock >= 0) {
-		close(https_sock);
-		https_sock = -1;
-	}
-	if (https_sock6 >= 0) {
-		close(https_sock6);
-		https_sock6 = -1;
-	}
-	sock = listen_tcp(port, iface, 0);
-	if (sock < 0) {
-		rfbLog("https_port: could not open port %d\n", port);
-		if (ipv6_listen) {
-			fd6 = listen6(port);
-		} 
-		if (fd6 < 0) {
-			if (!restart) {
-				clean_up_exit(1);
-			}
-		}
-		rfbLog("https_port: trying IPv6 only mode.\n");
-	}
-	rfbLog("https_port: listen on port/sock %d/%d\n", port, sock);
-	https_sock = sock;
-
-	if (ipv6_listen) {
-		if (fd6 < 0) {
-			fd6 = listen6(port);
-		}
-		if (fd6 < 0) {
-			;
-		} else {
-			rfbLog("https_port: listen on port/sock %d/%d (ipv6)\n",
-			    port, fd6);
-			https_sock6 = fd6;
-		}
-		if (fd6 < 0 && https_sock < 0) {
-			rfbLog("https_port: could not listen on either IPv4 or IPv6.\n");
-			if (!restart) {
-				clean_up_exit(1);
-			}
-		}
-	}
-}
-
-static void lose_ram(void) {
-	/*
-	 * for a forked child that will be around for a long time
-	 * without doing exec().  we really should re-exec, but a pain
-	 * to redo all SSL ctx.
-	 */
-	free_old_fb();
-
-	free_tiles();
-}
-
-/* utility to keep track of existing helper processes: */
-
-void ssl_helper_pid(pid_t pid, int sock) {
-#	define HPSIZE 256
-	static pid_t helpers[HPSIZE];
-	static int   sockets[HPSIZE], first = 1;
-	int i, empty, set, status;
-	static int db = 0;
-
-	if (first) {
-		for (i=0; i < HPSIZE; i++)  {
-			helpers[i] = 0;
-			sockets[i] = 0;
-		}
-		if (getenv("SSL_HELPER_PID_DB")) {
-			db = 1;
-		}
-		first = 0;
-	}
-
-
-	if (pid == 0) {
-		/* killall or waitall */
-		for (i=0; i < HPSIZE; i++) {
-			if (helpers[i] == 0) {
-				sockets[i] = -1;
-				continue;
-			}
-			if (kill(helpers[i], 0) == 0) {
-				int kret = -2;
-				pid_t wret;
-				if (sock != -2) {
-					if (sockets[i] >= 0) {
-						close(sockets[i]);
-					}
-					kret = kill(helpers[i], SIGTERM);
-					if (kret == 0) {
-						usleep(20 * 1000);
-					}
-				}
-
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID 
-				wret = waitpid(helpers[i], &status, WNOHANG); 
-
-if (db) fprintf(stderr, "waitpid(%d)\n", helpers[i]);
-if (db) fprintf(stderr, "  waitret1=%d\n", wret);
-
-				if (kret == 0 && wret != helpers[i]) {
-					int k;
-					for (k=0; k < 10; k++) {
-						usleep(100 * 1000);
-						wret = waitpid(helpers[i], &status, WNOHANG); 
-if (db) fprintf(stderr, "  waitret2=%d\n", wret);
-						if (wret == helpers[i]) {
-							break;
-						}
-					}
-				}
-#endif
-				if (sock == -2) {
-					continue;
-				}
-			}
-			helpers[i] = 0;
-			sockets[i] = -1;
-		}
-		return;
-	}
-
-if (db) fprintf(stderr, "ssl_helper_pid(%d, %d)\n", pid, sock);
-
-	/* add (or delete for sock == -1) */
-	set = 0;
-	empty = -1;
-	for (i=0; i < HPSIZE; i++) {
-		if (helpers[i] == pid) {
-			if (sock == -1) {
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID 
-				pid_t wret;
-				wret = waitpid(helpers[i], &status, WNOHANG); 
-
-if (db) fprintf(stderr, "waitpid(%d) 2\n", helpers[i]);
-if (db) fprintf(stderr, "  waitret1=%d\n", wret);
-#endif
-				helpers[i] = 0;
-			}
-			sockets[i] = sock;
-			set = 1;
-		} else if (empty == -1 && helpers[i] == 0) {
-			empty = i;
-		}
-	}
-	if (set || sock == -1) {
-		return;	/* done */
-	}
-
-	/* now try to store */
-	if (empty >= 0) {
-		helpers[empty] = pid;
-		sockets[empty] = sock;
-		return;
-	}
-	for (i=0; i < HPSIZE; i++) {
-		if (helpers[i] == 0) {
-			continue;
-		}
-		/* clear out stale pids: */
-		if (kill(helpers[i], 0) != 0) {
-			helpers[i] = 0;
-			sockets[i] = -1;
-			
-			if (empty == -1) {
-				empty = i;
-			}
-		}
-	}
-	if (empty >= 0) {
-		helpers[empty] = pid;
-		sockets[empty] = sock;
-	}
-}
-
-static int is_ssl_readable(int s_in, double last_https, char *last_get,
-    int mode) {
-	int nfd, db = 0;
-	struct timeval tv;
-	fd_set rd;
-
-	if (getenv("ACCEPT_OPENSSL_DEBUG")) {
-		db = atoi(getenv("ACCEPT_OPENSSL_DEBUG"));
-	}
-
-	/*
-	 * we'll do a select() on s_in for reading.  this is not an
-	 * absolute proof that SSL_read is ready (XXX use SSL utility).
-	 */
-	tv.tv_sec  = 2;
-	tv.tv_usec = 0;
-
-	if (mode == OPENSSL_INETD) {
-		/*
-		 * https via inetd is icky because x11vnc is restarted
-		 * for each socket (and some clients send requests
-		 * rapid fire).
-		 */
-		tv.tv_sec = 4;
-	}
-
-	/*
-	 * increase the timeout if we know HTTP traffic has occurred
-	 * recently:
-	 */
-	if (dnow() < last_https + 30.0) {
-		tv.tv_sec = 10;
-		if (last_get && strstr(last_get, "VncViewer")) {
-			tv.tv_sec = 5;
-		}
-	}
-	if (getenv("X11VNC_HTTPS_VS_VNC_TIMEOUT")) {
-		tv.tv_sec  = atoi(getenv("X11VNC_HTTPS_VS_VNC_TIMEOUT"));
-	}
-if (db) fprintf(stderr, "tv_sec: %d - '%s'\n", (int) tv.tv_sec, last_get);
-
-	FD_ZERO(&rd);
-	FD_SET(s_in, &rd);
-
-	if (db) fprintf(stderr, "is_ssl_readable: begin  select(%d secs) %.6f\n", (int) tv.tv_sec, dnow());
-	do {
-		nfd = select(s_in+1, &rd, NULL, NULL, &tv);
-	} while (nfd < 0 && errno == EINTR);
-	if (db) fprintf(stderr, "is_ssl_readable: finish select(%d secs) %.6f\n", (int) tv.tv_sec, dnow());
-
-	if (db) fprintf(stderr, "https nfd: %d\n", nfd);
-
-	if (nfd <= 0 || ! FD_ISSET(s_in, &rd)) {
-		return 0;
-	}
-	return 1;
-}
-
-static int watch_for_http_traffic(char *buf_a, int *n_a, int raw_sock) {
-	int is_http, err, n, n2;
-	char *buf;
-	int db = 0;
-	/*
-	 * sniff the first couple bytes of the stream and try to see
-	 * if it is http or not.  if we read them OK, we must read the
-	 * rest of the available data otherwise we may deadlock.
-	 * what has been read is returned in buf_a and n_a.
-	 * *buf_a is ABSIZE+1 long and zeroed.
-	 */
-	if (getenv("ACCEPT_OPENSSL_DEBUG")) {
-		db = atoi(getenv("ACCEPT_OPENSSL_DEBUG"));
-	}
-	if (! buf_a || ! n_a) {
-		return 0;
-	}
-
-	buf = (char *) calloc((ABSIZE+1), 1);
-	*n_a = 0;
-
-	if (enc_str && !strcmp(enc_str, "none")) {
-		n = read(raw_sock, buf, 2);
-		err = SSL_ERROR_NONE;
-	} else {
-#if LIBVNCSERVER_HAVE_LIBSSL 
-		n = SSL_read(ssl, buf, 2);
-		err = SSL_get_error(ssl, n);
-#else
-		err = n = 0;
-		badnews("1 in watch_for_http_traffic");
-#endif
-	}
-
-	if (err != SSL_ERROR_NONE || n < 2) {
-		if (n > 0) {
-			strncpy(buf_a, buf, n);
-			*n_a = n;
-		}
-		if (db) fprintf(stderr, "watch_for_http_traffic ssl err: %d/%d\n", err, n);
-		return -1;
-	}
-
-	/* look for GET, HEAD, POST, CONNECT */
-	is_http = 0;
-	if (!strncmp("GE", buf, 2)) {
-		is_http = 1;
-	} else if (!strncmp("HE", buf, 2)) {
-		is_http = 1;
-	} else if (!strncmp("PO", buf, 2)) {
-		is_http = 1;
-	} else if (!strncmp("CO", buf, 2)) {
-		is_http = 1;
-	}
-	if (db) fprintf(stderr, "watch_for_http_traffic read: '%s' %d\n", buf, n);
-
-	/*
-	 * better read all we can and fwd it along to avoid blocking
-	 * in ssl_xfer().
-	 */
-
-	if (enc_str && !strcmp(enc_str, "none")) {
-		n2 = read(raw_sock, buf + n, ABSIZE - n);
-	} else {
-#if LIBVNCSERVER_HAVE_LIBSSL 
-		n2 = SSL_read(ssl, buf + n, ABSIZE - n);
-#else
-		n2 = 0;
-		badnews("2 in watch_for_http_traffic");
-#endif
-	}
-	if (n2 >= 0) {
-		n += n2;
-	}
-
-	*n_a = n;
-
-	if (db) fprintf(stderr, "watch_for_http_traffic readmore: %d\n", n2);
-
-	if (n > 0) {
-		memcpy(buf_a, buf, n);
-	}
-	if (db > 1) {
-		fprintf(stderr, "watch_for_http_traffic readmore: ");
-		write(2, buf_a, *n_a);
-		fprintf(stderr, "\n");
-	}
-	if (db) fprintf(stderr, "watch_for_http_traffic return: %d\n", is_http);
-	return is_http;
-}
-
-static int csock_timeout_sock = -1;
-
-static void csock_timeout (int sig) {
-	rfbLog("sig: %d, csock_timeout.\n", sig);
-	if (csock_timeout_sock >= 0) {
-		close(csock_timeout_sock);
-		csock_timeout_sock = -1;
-	}
-}
-
-static int check_ssl_access(char *addr) {
-	static char *save_allow_once = NULL;
-	static time_t time_allow_once = 0;
-
-	/* due to "Fetch Cert" activities for SSL really need to "allow twice" */
-	if (allow_once != NULL) {
-		save_allow_once = strdup(allow_once);
-		time_allow_once = time(NULL);
-	} else if (save_allow_once != NULL) {
-		if (getenv("X11VNC_NO_SSL_ALLOW_TWICE")) {
-			;
-		} else if (time(NULL) < time_allow_once + 30) {
-			/* give them 30 secs to check and save the fetched cert. */
-			allow_once = save_allow_once; 
-			rfbLog("SSL: Permitting 30 sec grace period for allowonce.\n");
-			rfbLog("SSL: Set X11VNC_NO_SSL_ALLOW_TWICE=1 to disable.\n");
-		}
-		save_allow_once = NULL;
-		time_allow_once = 0;
-	}
-
-	return check_access(addr);
-}
-
-void accept_openssl(int mode, int presock) {
-	int sock = -1, listen = -1, cport, csock, vsock;	
-	int peerport = 0;
-	int status, n, i, db = 0;
-	struct sockaddr_in addr;
-#ifdef __hpux
-	int addrlen = sizeof(addr);
-#else
-	socklen_t addrlen = sizeof(addr);
-#endif
-	rfbClientPtr client;
-	pid_t pid;
-	char uniq[] = "_evilrats_";
-	char cookie[256], rcookie[256], *name = NULL;
-	int vencrypt_sel = 0;
-	int anontls_sel = 0;
-	char *ipv6_name = NULL;
-	static double last_https = 0.0;
-	static char last_get[256];
-	static int first = 1;
-	unsigned char *rb;
-
-#if !LIBVNCSERVER_HAVE_LIBSSL 
-	if (enc_str == NULL || strcmp(enc_str, "none")) {
-		badnews("0 accept_openssl");
-	}
-#endif
-
-	openssl_last_helper_pid = 0;
-
-	/* zero buffers for use below. */
-	for (i=0; i<256; i++) {
-		if (first) {
-			last_get[i] = '\0';
-		}
-		cookie[i]  = '\0';
-		rcookie[i] = '\0';
-	}
-	first = 0;
-
-	if (getenv("ACCEPT_OPENSSL_DEBUG")) {
-		db = atoi(getenv("ACCEPT_OPENSSL_DEBUG"));
-	}
-
-	/* do INETD, VNC, or HTTPS cases (result is client socket or pipe) */
-	if (mode == OPENSSL_INETD) {
-		ssl_initialized = 1;
-
-	} else if (mode == OPENSSL_VNC) {
-		sock = accept(openssl_sock, (struct sockaddr *)&addr, &addrlen);
-		if (sock < 0)  {
-			rfbLog("SSL: accept_openssl: accept connection failed\n");
-			rfbLogPerror("accept");
-			if (ssl_no_fail) {
-				clean_up_exit(1);
-			}
-			return;
-		}
-		listen = openssl_sock;
-
-	} else if (mode == OPENSSL_VNC6 || mode == OPENSSL_HTTPS6) {
-#if X11VNC_IPV6
-		struct sockaddr_in6 a6;
-		socklen_t a6len = sizeof(a6);
-		int fd = (mode == OPENSSL_VNC6 ? openssl_sock6 : https_sock6); 
-
-		sock = accept(fd, (struct sockaddr *)&a6, &a6len);
-		if (sock < 0)  {
-			rfbLog("SSL: accept_openssl: accept connection failed\n");
-			rfbLogPerror("accept");
-			if (ssl_no_fail) {
-				clean_up_exit(1);
-			}
-			return;
-		}
-		ipv6_name = ipv6_getipaddr((struct sockaddr *)&a6, a6len);
-		if (!ipv6_name) ipv6_name = strdup("unknown");
-		listen = fd;
-#endif
-	} else if (mode == OPENSSL_REVERSE) {
-		sock = presock;
-		if (sock < 0)  {
-			rfbLog("SSL: accept_openssl: connection failed\n");
-			if (ssl_no_fail) {
-				clean_up_exit(1);
-			}
-			return;
-		}
-		if (getenv("OPENSSL_REVERSE_DEBUG")) fprintf(stderr, "OPENSSL_REVERSE: ipv6_client_ip_str: %s\n", ipv6_client_ip_str);
-		if (ipv6_client_ip_str != NULL) {
-			ipv6_name = strdup(ipv6_client_ip_str);
-		}
-		listen = -1;
-
-	} else if (mode == OPENSSL_HTTPS) {
-		sock = accept(https_sock, (struct sockaddr *)&addr, &addrlen);
-		if (sock < 0)  {
-			rfbLog("SSL: accept_openssl: accept connection failed\n");
-			rfbLogPerror("accept");
-			if (ssl_no_fail) {
-				clean_up_exit(1);
-			}
-			return;
-		}
-		listen = https_sock;
-	}
-	if (db) fprintf(stderr, "SSL: accept_openssl: sock: %d\n", sock);
-
-	if (openssl_last_ip) {
-		free(openssl_last_ip);
-		openssl_last_ip = NULL;
-	}
-	if (mode == OPENSSL_INETD) {
-		openssl_last_ip = get_remote_host(fileno(stdin));
-	} else if (mode == OPENSSL_VNC6 || mode == OPENSSL_HTTPS6) {
-		openssl_last_ip = ipv6_name;
-	} else if (mode == OPENSSL_REVERSE && ipv6_name != NULL) {
-		openssl_last_ip = ipv6_name;
-	} else {
-		openssl_last_ip = get_remote_host(sock);
-	}
-
-	if (!check_ssl_access(openssl_last_ip)) {
-		rfbLog("SSL: accept_openssl: denying client %s\n", openssl_last_ip);
-		rfbLog("SSL: accept_openssl: does not match -allow or other reason.\n");
-		close(sock);
-		sock = -1;
-		if (ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		return;
-	}
-
-	/* now make a listening socket for child to connect back to us by: */
-
-	cport = find_free_port(20000, 22000);
-	if (! cport && ipv6_listen) {
-		rfbLog("SSL: accept_openssl: seeking IPv6 port.\n");
-		cport = find_free_port6(20000, 22000);
-		rfbLog("SSL: accept_openssl: IPv6 port: %d\n", cport);
-	}
-	if (! cport) {
-		rfbLog("SSL: accept_openssl: could not find open port.\n");
-		close(sock);
-		if (mode == OPENSSL_INETD || ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		return;
-	}
-	if (db) fprintf(stderr, "accept_openssl: cport: %d\n", cport);
-
-	csock = listen_tcp(cport, htonl(INADDR_LOOPBACK), 1);
-
-	if (csock < 0) {
-		rfbLog("SSL: accept_openssl: could not listen on port %d.\n",
-		    cport);
-		close(sock);
-		if (mode == OPENSSL_INETD || ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		return;
-	}
-	if (db) fprintf(stderr, "accept_openssl: csock: %d\n", csock);
-
-	fflush(stderr);
-
-	/*
-	 * make a simple cookie to id the child socket, not foolproof
-	 * but hard to guess exactly (just worrying about local lusers
-	 * here, since we use INADDR_LOOPBACK).
-	 */
-	rb = (unsigned char *) calloc(6, 1);
-#if LIBVNCSERVER_HAVE_LIBSSL 
-	RAND_bytes(rb, 6);
-#endif
-	sprintf(cookie, "RB=%d%d%d%d%d%d/%f%f/%p",
-	    rb[0], rb[1], rb[2], rb[3], rb[4], rb[5],
-            dnow() - x11vnc_start, x11vnc_start, (void *)rb);
-
-	if (mode == OPENSSL_VNC6) {
-		name = strdup(ipv6_name);
-		peerport = get_remote_port(sock);
-	} else if (mode == OPENSSL_REVERSE && ipv6_name != NULL) {
-		name = strdup(ipv6_name);
-		peerport = get_remote_port(sock);
-	} else if (mode != OPENSSL_INETD) {
-		name = get_remote_host(sock);
-		peerport = get_remote_port(sock);
-	} else {
-		openssl_last_ip = get_remote_host(fileno(stdin));
-		peerport = get_remote_port(fileno(stdin));
-		if (openssl_last_ip) {
-			name = strdup(openssl_last_ip);
-		} else {
-			name = strdup("unknown");
-		}
-	}
-	if (name) {
-		if (mode == OPENSSL_INETD) {
-			rfbLog("SSL: (inetd) spawning helper process "
-			    "to handle: %s:%d\n", name, peerport);
-		} else {
-			rfbLog("SSL: spawning helper process to handle: "
-			    "%s:%d\n", name, peerport);
-		}
-		free(name);
-		name = NULL;
-	}
-
-	if (certret) {
-		free(certret);
-	}
-	if (certret_str) {
-		free(certret_str);
-		certret_str = NULL;
-	}
-	certret = strdup("/tmp/x11vnc-certret.XXXXXX");
-	omode = umask(077);
-	certret_fd = mkstemp(certret);
-	umask(omode);
-	if (certret_fd < 0) {
-		free(certret);
-		certret = NULL;
-		certret_fd = -1;
-	}
-
-	if (dhret) {
-		free(dhret);
-	}
-	if (dhret_str) {
-		free(dhret_str);
-		dhret_str = NULL;
-	}
-	dhret = strdup("/tmp/x11vnc-dhret.XXXXXX");
-	omode = umask(077);
-	dhret_fd = mkstemp(dhret);
-	umask(omode);
-	if (dhret_fd < 0) {
-		free(dhret);
-		dhret = NULL;
-		dhret_fd = -1;
-	}
-
-	/* now fork the child to handle the SSL: */
-	pid = fork();
-
-	if (pid > 0) {
-		rfbLog("SSL: helper for peerport %d is pid %d: \n",
-		    peerport, (int) pid);
-	}
-
-	if (pid < 0) {
-		rfbLog("SSL: accept_openssl: could not fork.\n");
-		rfbLogPerror("fork");
-		close(sock);
-		close(csock);
-		if (mode == OPENSSL_INETD || ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		return;
-
-	} else if (pid == 0) {
-		int s_in, s_out, httpsock = -1;
-		int vncsock;
-		int i, have_httpd = 0;
-		int f_in  = fileno(stdin);
-		int f_out = fileno(stdout);
-		int skip_vnc_tls = mode == OPENSSL_HTTPS ? 1 : 0;
-
-		if (db) fprintf(stderr, "helper pid in: %d %d %d %d\n", f_in, f_out, sock, listen);
-
-		/* reset all handlers to default (no interrupted() calls) */
-		unset_signals();
-
-		/* close all non-essential fd's */
-		for (i=0; i<256; i++) {
-			if (mode == OPENSSL_INETD) {
-				if (i == f_in || i == f_out) {
-					continue;
-				}
-			}
-			if (i == sock) {
-				continue;
-			}
-			if (i == 2) {
-				continue;
-			}
-			close(i);
-		}
-
-		/*
-		 * sadly, we are a long lived child and so the large
-		 * framebuffer memory areas will soon differ from parent.
-		 * try to free as much as possible.
-		 */
-		lose_ram();
-
-		/* now connect back to parent socket: */
-		vncsock = connect_tcp("127.0.0.1", cport);
-		if (vncsock < 0) {
-			rfbLog("SSL: ssl_helper[%d]: could not connect"
-			    " back to: %d\n", getpid(), cport);
-			rfbLog("SSL: ssl_helper[%d]: exit case 1 (no local vncsock)\n", getpid());
-			exit(1);
-		}
-		if (db) fprintf(stderr, "vncsock %d\n", vncsock);
-
-		/* try to initialize SSL with the remote client */
-
-		if (mode == OPENSSL_INETD) {
-			s_in  = fileno(stdin);
-			s_out = fileno(stdout);
-		} else {
-			s_in = s_out = sock;
-		}
-
-		if (! ssl_init(s_in, s_out, skip_vnc_tls, last_https)) {
-			close(vncsock);
-			rfbLog("SSL: ssl_helper[%d]: exit case 2 (ssl_init failed)\n", getpid());
-			exit(1);
-		}
-
-		if (vencrypt_selected != 0) {
-			char *tbuf;
-			tbuf = (char *) malloc(strlen(cookie) + 100);
-			sprintf(tbuf, "%s,VENCRYPT=%d,%s", uniq, vencrypt_selected, cookie);
-			write(vncsock, tbuf, strlen(cookie));
-			goto wrote_cookie;
-		} else if (anontls_selected != 0) {
-			char *tbuf;
-			tbuf = (char *) malloc(strlen(cookie) + 100);
-			sprintf(tbuf, "%s,ANONTLS=%d,%s", uniq, anontls_selected, cookie);
-			write(vncsock, tbuf, strlen(cookie));
-			goto wrote_cookie;
-		}
-
-		/*
-		 * things get messy below since we are trying to do
-		 * *both* VNC and Java applet httpd through the same
-		 * SSL socket.
-		 */
-
-		if (! screen) {
-			close(vncsock);
-			exit(1);
-		}
-		if (screen->httpListenSock >= 0 && screen->httpPort > 0) {
-			have_httpd = 1;
-		} else if (ipv6_http_fd >= 0) {
-			have_httpd = 1;
-		} else if (screen->httpListenSock == -2) {
-			have_httpd = 1;
-		}
-		if (mode == OPENSSL_HTTPS && ! have_httpd) {
-			rfbLog("SSL: accept_openssl[%d]: no httpd socket for "
-			    "-https mode\n", getpid());
-			close(vncsock);
-			rfbLog("SSL: ssl_helper[%d]: exit case 3 (no httpd sock)\n", getpid());
-			exit(1);
-		}
-
-		if (have_httpd) {
-			int n = 0, is_http = 0;
-			int hport = screen->httpPort; 
-			char *iface = NULL;
-			char *buf, *tbuf;
-
-			buf  = (char *) calloc((ABSIZE+1), 1);
-			tbuf = (char *) calloc((2*ABSIZE+1), 1);
-
-			if (mode == OPENSSL_HTTPS) {
-				/*
-				 * for this mode we know it is HTTP traffic
-				 * so we skip trying to guess.
-				 */
-				is_http = 1;
-				n = 0;
-				goto connect_to_httpd;
-			}
-
-			/*
-			 * Check if there is stuff to read from remote end
-			 * if so it is likely a GET or HEAD.
-			 */
-			if (! is_ssl_readable(s_in, last_https, last_get,
-			    mode)) {
-				goto write_cookie;
-			}
-	
-			/* 
-			 * read first 2 bytes to try to guess.  sadly,
-			 * the user is often pondering a "non-verified
-			 * cert" dialog for a long time before the GET
-			 * is ever sent.  So often we timeout here.
-			 */
-
-			if (db) fprintf(stderr, "watch_for_http_traffic\n");
-
-			is_http = watch_for_http_traffic(buf, &n, s_in);
-
-			if (is_http < 0 || is_http == 0) {
-				/*
-				 * error or http not detected, fall back
-				 * to normal VNC socket.
-				 */
-				if (db) fprintf(stderr, "is_http err: %d n: %d\n", is_http, n);
-				write(vncsock, cookie, strlen(cookie));
-				if (n > 0) {
-					write(vncsock, buf, n);
-				}
-				goto wrote_cookie;
-			}
-
-			if (db) fprintf(stderr, "is_http: %d n: %d\n",
-			    is_http, n);
-			if (db) fprintf(stderr, "buf: '%s'\n", buf);
-
-			if (strstr(buf, "/request.https.vnc.connection")) {
-				char reply[] = "HTTP/1.0 200 OK\r\n"
-				    "Content-Type: octet-stream\r\n"
-				    "Connection: Keep-Alive\r\n"
-				    "VNC-Server: x11vnc\r\n"
-				    "Pragma: no-cache\r\n\r\n";
-				/*
-				 * special case proxy coming thru https
-				 * instead of a direct SSL connection.
-				 */
-				rfbLog("Handling VNC request via https GET. [%d]\n", getpid());
-				rfbLog("-- %s\n", buf);
-
-				if (strstr(buf, "/reverse.proxy")) {
-					char *buf2;
-					int n, ptr;
-#if !LIBVNCSERVER_HAVE_LIBSSL
-					write(s_out, reply, strlen(reply));
-#else
-					SSL_write(ssl, reply, strlen(reply));
-#endif
-				
-					buf2  = (char *) calloc((8192+1), 1);
-					n = 0;
-					ptr = 0;
-					while (ptr < 8192) {
-#if !LIBVNCSERVER_HAVE_LIBSSL
-						n = read(s_in, buf2 + ptr, 1);
-#else
-						n = SSL_read(ssl, buf2 + ptr, 1);
-#endif
-						if (n > 0) {
-							ptr += n;
-						}
-						if (db) fprintf(stderr, "buf2: '%s'\n", buf2);
-
-						if (strstr(buf2, "\r\n\r\n")) {
-							break;
-						}
-					}
-					free(buf2);
-				}
-				goto write_cookie;
-
-			} else if (strstr(buf, "/check.https.proxy.connection")) {
-				char reply[] = "HTTP/1.0 200 OK\r\n"
-				    "Connection: close\r\n"
-				    "Content-Type: octet-stream\r\n"
-				    "VNC-Server: x11vnc\r\n"
-				    "Pragma: no-cache\r\n\r\n";
-
-				rfbLog("Handling Check HTTPS request via https GET. [%d]\n", getpid());
-				rfbLog("-- %s\n", buf);
-
-#if !LIBVNCSERVER_HAVE_LIBSSL
-				write(s_out, reply, strlen(reply));
-#else
-				SSL_write(ssl, reply, strlen(reply));
-				SSL_shutdown(ssl);
-#endif
-
-				strcpy(tbuf, uniq);
-				strcat(tbuf, cookie);
-				write(vncsock, tbuf, strlen(tbuf));
-				close(vncsock);
-
-				rfbLog("SSL: ssl_helper[%d]: exit case 4 (check.https.proxy.connection)\n", getpid());
-				exit(0);
-			}
-			connect_to_httpd:
-
-			/*
-			 * Here we go... no turning back.  we have to
-			 * send failure to parent and close socket to have
-			 * http processed at all in a timely fashion...
-			 */
-
-			/* send the failure tag: */
-			strcpy(tbuf, uniq);
-
-			if (https_port_redir < 0 || (strstr(buf, "PORT=") || strstr(buf, "port="))) {
-				char *q = strstr(buf, "Host:");
-				int fport = 443, match = 0;
-				char num[16];
-
-				if (q && strstr(q, "\n")) {
-				    q += strlen("Host:") + 1;
-				    while (*q != '\n') {
-					int p;
-					if (*q == ':' && sscanf(q, ":%d", &p) == 1) {
-						if (p > 0 && p < 65536) {
-							fport = p;
-							match = 1;
-							break;
-						}
-					}
-					q++;
-				    }
-				}
-				if (!match || !https_port_redir) {
-					int p;
-					if (sscanf(buf, "PORT=%d,", &p) == 1) {
-						if (p > 0 && p < 65536) {
-							fport = p;
-						}
-					} else if (sscanf(buf, "port=%d,", &p) == 1) {
-						if (p > 0 && p < 65536) {
-							fport = p;
-						}
-					}
-				}
-				sprintf(num, "HP=%d,", fport);
-				strcat(tbuf, num);
-			}
-
-			if (strstr(buf, "HTTP/") != NULL)  {
-				char *q, *str;
-				/*
-				 * Also send back the GET line for heuristics.
-				 * (last_https, get file).
-				 */
-				str = strdup(buf);
-				q = strstr(str, "HTTP/");
-				if (q != NULL) {
-					*q = '\0';	
-					strcat(tbuf, str);
-				}
-				free(str);
-			}
-
-			/*
-			 * Also send the cookie to pad out the number of
-			 * bytes to more than the parent wants to read.
-			 * Since this is the failure case, it does not
-			 * matter that we send more than strlen(cookie).
-			 */
-			strcat(tbuf, cookie);
-			write(vncsock, tbuf, strlen(tbuf));
-
-			usleep(150*1000);
-			if (db) fprintf(stderr, "close vncsock: %d\n", vncsock);
-			close(vncsock);
-
-			/* now, finally, connect to the libvncserver httpd: */
-			if (screen->listenInterface == htonl(INADDR_ANY) ||
-			    screen->listenInterface == htonl(INADDR_NONE)) {
-				iface = "127.0.0.1";
-			} else {
-				struct in_addr in;
-				in.s_addr = screen->listenInterface;
-				iface = inet_ntoa(in);
-			}
-			if (iface == NULL || !strcmp(iface, "")) {
-				iface = "127.0.0.1";
-			}
-			if (db) fprintf(stderr, "iface: %s:%d\n", iface, hport);
-			usleep(150*1000);
-
-			httpsock = connect_tcp(iface, hport);
-
-			if (httpsock < 0) {
-				/* UGH, after all of that! */
-				rfbLog("Could not connect to httpd socket!\n");
-				rfbLog("SSL: ssl_helper[%d]: exit case 5.\n", getpid());
-				exit(1);
-			}
-			if (db) fprintf(stderr, "ssl_helper[%d]: httpsock: %d %d\n",
-			    getpid(), httpsock, n);
-
-			/*
-			 * send what we read to httpd, and then connect
-			 * the rest of the SSL session to it:
-			 */
-			if (n > 0) {
-				char *s = getenv("X11VNC_EXTRA_HTTPS_PARAMS");
-				int did_extra = 0;
-
-				if (db) fprintf(stderr, "sending http buffer httpsock: %d n=%d\n'%s'\n", httpsock, n, buf);
-				if (s != NULL) {
-					char *q = strstr(buf, " HTTP/");
-					if (q) {
-						int m;
-						*q = '\0';
-						m = strlen(buf);
-						write(httpsock, buf, m);
-						write(httpsock, s, strlen(s));
-						*q = ' ';
-						write(httpsock, q, n-m);
-						did_extra = 1;
-					}
-				}
-				if (!did_extra) {
-					write(httpsock, buf, n);
-				}
-			}
-			ssl_xfer(httpsock, s_in, s_out, is_http);
-			rfbLog("SSL: ssl_helper[%d]: exit case 6 (https ssl_xfer done)\n", getpid());
-			exit(0);
-		}
-
-		/*
-		 * ok, back from the above https mess, simply send the
-		 * cookie back to the parent (who will attach us to
-		 * libvncserver), and connect the rest of the SSL session
-		 * to it.
-		 */
-		write_cookie:
-		write(vncsock, cookie, strlen(cookie));
-
-		wrote_cookie:
-		ssl_xfer(vncsock, s_in, s_out, 0);
-		rfbLog("SSL: ssl_helper[%d]: exit case 7 (ssl_xfer done)\n", getpid());
-		if (0) usleep(50 * 1000);
-		exit(0);
-	}
-	/* parent here */
-
-	if (mode != OPENSSL_INETD) {
-		close(sock);
-	}
-	if (db) fprintf(stderr, "helper process is: %d\n", pid);
-
-	/* accept connection from our child.  */
-	signal(SIGALRM, csock_timeout);
-	csock_timeout_sock = csock;
-	alarm(20);
-
-	vsock = accept(csock, (struct sockaddr *)&addr, &addrlen);
-
-	alarm(0);
-	signal(SIGALRM, SIG_DFL);
-	close(csock);
-
-
-	if (vsock < 0) {
-		rfbLog("SSL: accept_openssl: connection from ssl_helper[%d] FAILED.\n", pid);
-		rfbLogPerror("accept");
-
-		kill(pid, SIGTERM);
-		waitpid(pid, &status, WNOHANG); 
-		if (mode == OPENSSL_INETD || ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		if (certret_fd >= 0) {
-			close(certret_fd);
-			certret_fd = -1;
-		}
-		if (certret) {
-			unlink(certret);
-		}
-		if (dhret_fd >= 0) {
-			close(dhret_fd);
-			dhret_fd = -1;
-		}
-		if (dhret) {
-			unlink(dhret);
-		}
-		return;
-	}
-	if (db) fprintf(stderr, "accept_openssl: vsock: %d\n", vsock);
-
-	n = read(vsock, rcookie, strlen(cookie));
-	if (n < 0 && errno != 0) {
-		rfbLogPerror("read");
-	}
-
-	if (certret) {
-		struct stat sbuf;
-		sbuf.st_size = 0;
-		if (certret_fd >= 0 && stat(certret, &sbuf) == 0 && sbuf.st_size > 0) {
-			certret_str = (char *) calloc(sbuf.st_size+1, 1);
-			read(certret_fd, certret_str, sbuf.st_size);
-			close(certret_fd);
-			certret_fd = -1;
-		}
-		if (certret_fd >= 0) {
-			close(certret_fd);
-			certret_fd = -1;
-		}
-		unlink(certret);
-		if (certret_str && strstr(certret_str, "NOCERT") == certret_str) {
-			free(certret_str);
-			certret_str = NULL;
-		}
-		if (0 && certret_str) {
-			fprintf(stderr, "certret_str[%d]:\n%s\n", (int) sbuf.st_size, certret_str);
-		}
-	}
-
-	if (dhret) {
-		struct stat sbuf;
-		sbuf.st_size = 0;
-		if (dhret_fd >= 0 && stat(dhret, &sbuf) == 0 && sbuf.st_size > 0) {
-			dhret_str = (char *) calloc(sbuf.st_size+1, 1);
-			read(dhret_fd, dhret_str, sbuf.st_size);
-			close(dhret_fd);
-			dhret_fd = -1;
-		}
-		if (dhret_fd >= 0) {
-			close(dhret_fd);
-			dhret_fd = -1;
-		}
-		unlink(dhret);
-		if (dhret_str && strstr(dhret_str, "NOCERT") == dhret_str) {
-			free(dhret_str);
-			dhret_str = NULL;
-		}
-		if (dhret_str) {
-			if (new_dh_params == NULL) {
-				fprintf(stderr, "dhret_str[%d]:\n%s\n", (int) sbuf.st_size, dhret_str);
-				new_dh_params = strdup(dhret_str);
-			}
-		}
-	}
-
-	if (0) {
-		fprintf(stderr, "rcookie: %s\n", rcookie);
-		fprintf(stderr, "cookie:  %s\n", cookie);
-	}
-
-	if (strstr(rcookie, uniq) == rcookie) {
-		char *q = strstr(rcookie, "RB=");
-		if (q && strstr(cookie, q) == cookie) {
-			vencrypt_sel = 0;
-			anontls_sel = 0;
-			q = strstr(rcookie, "VENCRYPT=");
-			if (q && sscanf(q, "VENCRYPT=%d,", &vencrypt_sel) == 1) {
-				if (vencrypt_sel != 0) {
-					rfbLog("SSL: VENCRYPT mode=%d accepted. helper[%d]\n", vencrypt_sel, pid);
-					goto accept_client;
-				}
-			}
-			q = strstr(rcookie, "ANONTLS=");
-			if (q && sscanf(q, "ANONTLS=%d,", &anontls_sel) == 1) {
-				if (anontls_sel != 0) {
-					rfbLog("SSL: ANONTLS mode=%d accepted. helper[%d]\n", anontls_sel, pid);
-					goto accept_client;
-				}
-			}
-		}
-	}
-
-	if (n != (int) strlen(cookie) || strncmp(cookie, rcookie, n)) {
-		rfbLog("SSL: accept_openssl: cookie from ssl_helper[%d] FAILED. %d\n", pid, n);
-		if (db) fprintf(stderr, "'%s'\n'%s'\n", cookie, rcookie);
-		close(vsock);
-
-		if (strstr(rcookie, uniq) == rcookie) {
-			int i;
-			double https_download_wait_time = 15.0;
-
-			if (getenv("X11VNC_HTTPS_DOWNLOAD_WAIT_TIME")) {
-				https_download_wait_time = atof(getenv("X11VNC_HTTPS_DOWNLOAD_WAIT_TIME"));
-			}
-
-			rfbLog("SSL: BUT WAIT! HTTPS for helper process[%d] succeeded. Good.\n", pid);
-			if (mode != OPENSSL_HTTPS) {
-				last_https = dnow();
-				for (i=0; i<256; i++) {
-					last_get[i] = '\0';
-				}
-				strncpy(last_get, rcookie, 100);
-				if (db) fprintf(stderr, "last_get: '%s'\n", last_get);
-			}
-			if (rcookie && strstr(rcookie, "VncViewer.class")) {
-				rfbLog("\n");
-				rfbLog("helper[%d]:\n", pid);
-				rfbLog("***********************************************************\n");
-				rfbLog("SSL: WARNING CLIENT ASKED FOR NONEXISTENT 'VncViewer.class'\n");
-				rfbLog("SSL: USER NEEDS TO MAKE SURE THE JAVA PLUGIN IS INSTALLED\n");
-				rfbLog("SSL: AND WORKING PROPERLY (e.g. a test-java-plugin page.)\n");
-				rfbLog("SSL: AND/OR USER NEEDS TO **RESTART** HIS WEB BROWSER.\n");
-				rfbLog("SSL: SOMETIMES THE BROWSER 'REMEMBERS' FAILED APPLET DOWN-\n");
-				rfbLog("SSL: LOADS AND RESTARTING IT IS THE ONLY WAY TO FIX THINGS.\n");
-				rfbLog("***********************************************************\n");
-				rfbLog("\n");
-			}
-			ssl_helper_pid(pid, -2);
-
-			if (https_port_redir) {
-				double start;
-				int origport = screen->port;
-				int useport = screen->port;
-				int saw_httpsock = 0;
-				/* to expand $PORT correctly in index.vnc */
-				if (https_port_redir < 0) {
-					char *q = strstr(rcookie, "HP=");
-					if (q) {
-						int p;
-						if (sscanf(q, "HP=%d,", &p) == 1) {
-							useport = p;
-						}
-					}
-				} else {
-					useport = https_port_redir;
-				}
-				screen->port = useport;
-				if (origport != useport) {
-					rfbLog("SSL: -httpsredir guess port: %d  helper[%d]\n", screen->port, pid);
-				}
-
-				start = dnow();
-				while (dnow() < start + https_download_wait_time) {
-					if (screen->httpSock >= 0) saw_httpsock = 1;
-					rfbPE(10000);
-					usleep(10000);
-					if (screen->httpSock >= 0) saw_httpsock = 1;
-					waitpid(pid, &status, WNOHANG); 
-					if (kill(pid, 0) != 0) {
-						rfbLog("SSL: helper[%d] pid finished\n", pid);
-						break;
-					}
-					if (0 && saw_httpsock && screen->httpSock < 0) {
-						/* this check can kill the helper too soon. */
-						rfbLog("SSL: httpSock for helper[%d] went away\n", pid);
-						break;
-					}
-				}
-				rfbLog("SSL: guessing child helper[%d] https finished. dt=%.6f\n",
-				    pid, dnow() - start);
-
-				rfbPE(10000);
-				rfbPE(10000);
-				rfbPE(10000);
-
-				screen->port = origport;
-				ssl_helper_pid(0, -2);
-				if (mode == OPENSSL_INETD) {
-					clean_up_exit(1);
-				}
-			} else if (mode == OPENSSL_INETD) {
-				double start;
-				int saw_httpsock = 0;
-
-				/* to expand $PORT correctly in index.vnc */
-				if (screen->port == 0) {
-					int fd = fileno(stdin);
-					if (getenv("X11VNC_INETD_PORT")) {
-						/* mutex */
-						screen->port = atoi(getenv(
-						    "X11VNC_INETD_PORT"));
-					} else {
-						int tport = get_local_port(fd);
-						if (tport > 0) {
-							screen->port = tport;
-						}
-					}
-				}
-				rfbLog("SSL: screen->port %d for helper[%d]\n", screen->port, pid);
-
-				/* kludge for https fetch via inetd */
-				start = dnow();
-				while (dnow() < start + https_download_wait_time) {
-					if (screen->httpSock >= 0) saw_httpsock = 1;
-					rfbPE(10000);
-					usleep(10000);
-					if (screen->httpSock >= 0) saw_httpsock = 1;
-					waitpid(pid, &status, WNOHANG); 
-					if (kill(pid, 0) != 0) {
-						rfbLog("SSL: helper[%d] pid finished\n", pid);
-						break;
-					}
-					if (0 && saw_httpsock && screen->httpSock < 0) {
-						/* this check can kill the helper too soon. */
-						rfbLog("SSL: httpSock for helper[%d] went away\n", pid);
-						break;
-					}
-				}
-				rfbLog("SSL: OPENSSL_INETD guessing "
-				    "child helper[%d] https finished. dt=%.6f\n",
-				    pid, dnow() - start);
-
-				rfbPE(10000);
-				rfbPE(10000);
-				rfbPE(10000);
-
-				ssl_helper_pid(0, -2);
-				clean_up_exit(1);
-			}
-			/* this will actually only get earlier https */
-			ssl_helper_pid(0, -2);
-			return;
-		}
-		kill(pid, SIGTERM);
-		waitpid(pid, &status, WNOHANG); 
-		if (mode == OPENSSL_INETD || ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		return;
-	}
-
-	accept_client:
-
-	if (db) fprintf(stderr, "accept_openssl: cookie good: %s\n", cookie);
-
-	rfbLog("SSL: handshake with helper process[%d] succeeded.\n", pid);
-
-	openssl_last_helper_pid = pid;
-	ssl_helper_pid(pid, vsock);
-
-	if (vnc_redirect) {
-		vnc_redirect_sock = vsock;
-		openssl_last_helper_pid = 0;
-		return;
-	}
-
-	client = create_new_client(vsock, 0);
-	openssl_last_helper_pid = 0;
-
-	if (client) {
-		int swt = 0;
-		if (mode == OPENSSL_VNC6 && openssl_last_ip != NULL) {
-			swt = 1;
-		} else if (mode == OPENSSL_REVERSE && ipv6_name != NULL && openssl_last_ip != NULL) {
-			swt = 1;
-		}
-		if (swt) {
-			if (client->host) {
-				free(client->host);
-			}
-			client->host = strdup(openssl_last_ip);
-		}
-		if (db) fprintf(stderr, "accept_openssl: client %p\n", (void *) client);
-		if (db) fprintf(stderr, "accept_openssl: new_client %p\n", (void *) screen->newClientHook);
-		if (db) fprintf(stderr, "accept_openssl: new_client %p\n", (void *) new_client);
-		if (mode == OPENSSL_INETD) {
-			inetd_client = client;
-			client->clientGoneHook = client_gone;
-		}
-		if (openssl_last_ip &&
-		    strpbrk(openssl_last_ip, "0123456789") == openssl_last_ip) {
-			client->host = strdup(openssl_last_ip);
-		}
-		if (vencrypt_sel != 0) {
-			client->protocolMajorVersion = 3;
-			client->protocolMinorVersion = 8;
-#if LIBVNCSERVER_HAVE_LIBSSL
-			if (!finish_vencrypt_auth(client, vencrypt_sel)) {
-				rfbCloseClient(client);
-				client = NULL;
-			}
-#else
-			badnews("3 accept_openssl");
-#endif
-		} else if (anontls_sel != 0) {
-			client->protocolMajorVersion = 3;
-			client->protocolMinorVersion = 8;
-			rfbAuthNewClient(client);
-		}
-		if (use_threads && client != NULL) {
-			rfbStartOnHoldClient(client);
-		}
-		/* try to get RFB proto done now. */
-		progress_client();
-	} else {
-		rfbLog("SSL: accept_openssl: rfbNewClient failed.\n");
-		close(vsock);
-
-		kill(pid, SIGTERM);
-		waitpid(pid, &status, WNOHANG); 
-		if (mode == OPENSSL_INETD || ssl_no_fail) {
-			clean_up_exit(1);
-		}
-		return;
-	}
-}
-
-void raw_xfer(int csock, int s_in, int s_out) {
-	char buf0[8192];
-	int sz = 8192, n, m, status, db = 1;
-	char *buf;
-#ifdef FORK_OK
-	pid_t par = getpid();
-	pid_t pid = fork();
-
-	buf = buf0;
-	if (vnc_redirect) {
-		/* change buf size some direction. */
-	}
-
-	if (getenv("X11VNC_DEBUG_RAW_XFER")) {
-		db = atoi(getenv("X11VNC_DEBUG_RAW_XFER"));
-	}
-	if (pid < 0) {
-		exit(1);
-	}
-	/* this is for testing or special helper usage, no SSL just socket redir */
-	if (pid) {
-		if (db) rfbLog("raw_xfer start: %d -> %d/%d\n", csock, s_in, s_out);
-
-		while (1) {
-			n = read(csock, buf, sz);
-			if (n == 0 || (n < 0 && errno != EINTR) ) {
-				break;
-			} else if (n > 0) {
-				int len = n;
-				char *src = buf;
-				if (db > 1) write(2, buf, n);
-				while (len > 0) {
-					m = write(s_out, src, len);
-					if (m > 0) {
-						src += m;
-						len -= m;
-						continue;
-					}
-					if (m < 0 && (errno == EINTR || errno == EAGAIN)) {
-						continue;
-					}
-if (db) rfbLog("raw_xfer bad write:  %d -> %d | %d/%d  errno=%d\n", csock, s_out, m, n, errno);
-					break;
-				}
-			}
-		}
-		usleep(250*1000);
-		kill(pid, SIGTERM);
-		waitpid(pid, &status, WNOHANG); 
-		if (db) rfbLog("raw_xfer done:  %d -> %d\n", csock, s_out);
-
-	} else {
-		if (db) usleep(50*1000);
-		if (db) rfbLog("raw_xfer start: %d <- %d\n", csock, s_in);
-
-		while (1) {
-			n = read(s_in, buf, sz);
-			if (n == 0 || (n < 0 && errno != EINTR) ) {
-				break;
-			} else if (n > 0) {
-				int len = n;
-				char *src = buf;
-				if (db > 1) write(2, buf, n);
-				while (len > 0) {
-					m = write(csock, src, len);
-					if (m > 0) {
-						src += m;
-						len -= m;
-						continue;
-					}
-					if (m < 0 && (errno == EINTR || errno == EAGAIN)) {
-						continue;
-					}
-		if (db) rfbLog("raw_xfer bad write:  %d <- %d | %d/%d errno=%d\n", csock, s_in, m, n, errno);
-					break;
-				}
-			}
-		}
-		usleep(250*1000);
-		kill(par, SIGTERM);
-		waitpid(par, &status, WNOHANG); 
-		if (db) rfbLog("raw_xfer done:  %d <- %d\n", csock, s_in);
-	}
-	close(csock);
-	close(s_in);
-	close(s_out);
-#endif	/* FORK_OK */
-}
-
-/* compile with -DENC_HAVE_OPENSSL=0 to disable enc stuff but still have ssl */
-
-#define ENC_MODULE
-
-#if LIBVNCSERVER_HAVE_LIBSSL
-#ifndef ENC_HAVE_OPENSSL
-#define ENC_HAVE_OPENSSL 1
-#endif
-#else
-#define ENC_HAVE_OPENSSL 0
-#endif
-
-#define ENC_DISABLE_SHOW_CERT 
-
-#include "enc.h"
-
-static void symmetric_encryption_xfer(int csock, int s_in, int s_out) {
-	char tmp[100];
-	char *cipher, *keyfile, *q;
-
-	if (! enc_str) {
-		return;
-	}
-	cipher = (char *) malloc(strlen(enc_str) + 100);
-	q = strchr(enc_str, ':');
-	if (!q) return;
-	*q = '\0';
-	if (getenv("X11VNC_USE_ULTRADSM_IV")) {
-		sprintf(cipher, "rev:%s", enc_str);
-	} else {
-		sprintf(cipher, "noultra:rev:%s", enc_str);
-	}
-	keyfile = strdup(q+1);
-	*q = ':';
-
-
-	/* TBD: s_in != s_out */
-	if (s_out) {}
-
-	sprintf(tmp, "fd=%d,%d", s_in, csock);
-
-	enc_do(cipher, keyfile, "-1", tmp);
-}
-
diff --git a/ica/x11/x11vnc/sslhelper.h b/ica/x11/x11vnc/sslhelper.h
deleted file mode 100644
index 236db73..0000000
--- a/ica/x11/x11vnc/sslhelper.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_SSLHELPER_H
-#define _X11VNC_SSLHELPER_H
-
-/* -- sslhelper.h -- */
-
-
-#define OPENSSL_INETD   1
-#define OPENSSL_VNC     2
-#define OPENSSL_VNC6    3
-#define OPENSSL_HTTPS   4
-#define OPENSSL_HTTPS6  5
-#define OPENSSL_REVERSE 6
-
-extern int openssl_sock;
-extern int openssl_sock6;
-extern int openssl_port_num;
-extern int https_sock;
-extern int https_sock6;
-extern pid_t openssl_last_helper_pid;
-extern char *openssl_last_ip;
-extern char *certret_str;
-extern char *dhret_str;
-extern char *new_dh_params;
-
-extern void raw_xfer(int csock, int s_in, int s_out);
-
-extern int openssl_present(void);
-extern void openssl_init(int);
-extern void openssl_port(int);
-extern void https_port(int);
-extern void check_openssl(void);
-extern void check_https(void);
-extern void ssl_helper_pid(pid_t pid, int sock);
-extern void accept_openssl(int mode, int presock);
-extern char *find_openssl_bin(void);
-extern char *get_saved_pem(char *string, int create);
-extern char *get_ssl_verify_file(char *str_in);
-extern char *create_tmp_pem(char *path, int prompt);
-
-
-#endif /* _X11VNC_SSLHELPER_H */
diff --git a/ica/x11/x11vnc/ssltools.h b/ica/x11/x11vnc/ssltools.h
deleted file mode 100644
index b4ad7d0..0000000
--- a/ica/x11/x11vnc/ssltools.h
+++ /dev/null
@@ -1,2560 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _SSLTOOLS_H
-#define _SSLTOOLS_H
-
-/* quoted scripts, edit source not this file. */
-
-
-char genCA[] = 
-"#!/bin/sh\n"
-"\n"
-"DIR=$BASE_DIR\n"
-"if [ \"x$DIR\" = \"x\" ]; then\n"
-"	DIR=\"$HOME/dotkjr_vnc/certs\"\n"
-"	rm -rf \"$DIR\"\n"
-"fi\n"
-"if echo \"$DIR\" | grep '^/' > /dev/null; then\n"
-"        :\n"
-"else\n"
-"        DIR=\"`pwd`/$DIR\"\n"
-"fi\n"
-"\n"
-"PATH=/usr/bin:/bin:/usr/sbin:$PATH; export PATH\n"
-"if [ \"x$OPENSSL\" = \"x\" ]; then\n"
-"	OPENSSL=\"openssl\"\n"
-"fi\n"
-"\n"
-"type \"$OPENSSL\" > /dev/null	|| exit 1\n"
-"\n"
-"if [ -f \"$DIR/CA/cacert.pem\" ]; then\n"
-"	echo \"Files will be overwritten in $DIR/CA\"\n"
-"	printf \"Continue? [y]/n \"\n"
-"	read x\n"
-"	if [ \"x$x\" = \"xn\" ]; then\n"
-"		exit 1;\n"
-"	fi\n"
-"fi\n"
-"\n"
-"#mkdir -p \"$DIR/HASH\"		|| exit 1\n"
-"mkdir -p \"$DIR/clients\"		|| exit 1\n"
-"#mkdir -p \"$DIR/clients/HASH\"	|| exit 1\n"
-"mkdir -p \"$DIR/CA/certs\"	|| exit 1\n"
-"mkdir -p \"$DIR/CA/crl\"		|| exit 1\n"
-"mkdir -p \"$DIR/CA/newcerts\"	|| exit 1\n"
-"mkdir -p \"$DIR/CA/private\"	|| exit 1\n"
-"chmod go-rwx \"$DIR/CA/private\"	|| exit 1\n"
-"mkdir -p \"$DIR/tmp\"		|| exit 1\n"
-"chmod go-rwx \"$DIR/tmp\"		|| exit 1\n"
-"touch \"$DIR/CA/index.txt\"	|| exit 1\n"
-"if [ ! -f \"$DIR/CA/serial\" ]; then\n"
-"	echo \"01\" > \"$DIR/CA/serial\"	|| exit 1\n"
-"fi\n"
-"\n"
-"cnf='\n"
-"HOME			= .\n"
-"RANDFILE		= $ENV::HOME/.rnd\n"
-"\n"
-"####################################################################\n"
-"[ ca ]\n"
-"default_ca	= CA_default		# The default ca section\n"
-"\n"
-"####################################################################\n"
-"[ CA_default ]\n"
-"\n"
-"dir		= ./CA			# Where everything is kept\n"
-"certs		= $dir/certs		# Where the issued certs are kept\n"
-"crl_dir		= $dir/crl		# Where the issued crl are kept\n"
-"database	= $dir/index.txt	# database index file.\n"
-"new_certs_dir	= $dir/newcerts		# default place for new certs.\n"
-"certificate	= $dir/cacert.pem 	# The CA certificate\n"
-"serial		= $dir/serial 		# The current serial number\n"
-"crl		= $dir/crl.pem 		# The current CRL\n"
-"private_key	= $dir/private/cakey.pem # The private key\n"
-"RANDFILE	= $dir/private/.rand	# private random number file\n"
-"\n"
-"x509_extensions	= usr_cert		# The extentions to add to the cert\n"
-"\n"
-"name_opt 	= ca_default		# Subject Name options\n"
-"cert_opt 	= ca_default		# Certificate field options\n"
-"\n"
-"default_days	= 730			# how long to certify for\n"
-"default_crl_days= 30			# how long before next CRL\n"
-"default_md	= md5			# which md to use.\n"
-"preserve	= no			# keep passed DN ordering\n"
-"\n"
-"policy		= policy_match\n"
-"\n"
-"# For the CA policy\n"
-"[ policy_match ]\n"
-"countryName		= match\n"
-"stateOrProvinceName	= match\n"
-"organizationName	= match\n"
-"organizationalUnitName	= optional\n"
-"commonName		= supplied\n"
-"emailAddress		= optional\n"
-"\n"
-"[ policy_anything ]\n"
-"countryName		= optional\n"
-"stateOrProvinceName	= optional\n"
-"localityName		= optional\n"
-"organizationName	= optional\n"
-"organizationalUnitName	= optional\n"
-"commonName		= supplied\n"
-"emailAddress		= optional\n"
-"\n"
-"####################################################################\n"
-"[ req ]\n"
-"default_bits		= 2048\n"
-"default_keyfile 	= privkey.pem\n"
-"distinguished_name	= req_distinguished_name\n"
-"attributes		= req_attributes\n"
-"x509_extensions	= v3_ca	# The extentions to add to the self signed cert\n"
-"\n"
-"string_mask = nombstr\n"
-"\n"
-"# req_extensions = v3_req # The extensions to add to a certificate request\n"
-"\n"
-"[ req_distinguished_name ]\n"
-"countryName			= Country Name (2 letter code)\n"
-"countryName_default		= AU\n"
-"countryName_min			= 2\n"
-"countryName_max			= 2\n"
-"\n"
-"stateOrProvinceName		= State or Province Name (full name)\n"
-"stateOrProvinceName_default	= mystate\n"
-"\n"
-"localityName			= Locality Name (eg, city)\n"
-"\n"
-"0.organizationName		= Organization Name (eg, company)\n"
-"0.organizationName_default	= x11vnc server CA\n"
-"\n"
-"organizationalUnitName		= Organizational Unit Name (eg, section)\n"
-"\n"
-"commonName			= Common Name (eg, YOUR name)\n"
-"commonName_default		= %USER x11vnc server CA\n"
-"commonName_max			= 64\n"
-"\n"
-"emailAddress			= Email Address\n"
-"emailAddress_default		= x11vnc at CA.nowhere\n"
-"emailAddress_max		= 64\n"
-"\n"
-"[ req_attributes ]\n"
-"challengePassword		= A challenge password\n"
-"challengePassword_min		= 4\n"
-"challengePassword_max		= 20\n"
-"\n"
-"unstructuredName		= An optional company name\n"
-"\n"
-"[ usr_cert ]\n"
-"\n"
-"basicConstraints=CA:FALSE\n"
-"\n"
-"nsComment			= \"OpenSSL Generated Certificate\"\n"
-"\n"
-"subjectKeyIdentifier=hash\n"
-"authorityKeyIdentifier=keyid,issuer:always\n"
-"\n"
-"[ v3_req ]\n"
-"\n"
-"basicConstraints = CA:FALSE\n"
-"keyUsage = nonRepudiation, digitalSignature, keyEncipherment\n"
-"\n"
-"[ v3_ca ]\n"
-"\n"
-"subjectKeyIdentifier=hash\n"
-"\n"
-"authorityKeyIdentifier=keyid:always,issuer:always\n"
-"\n"
-"basicConstraints = CA:true\n"
-"\n"
-"[ crl_ext ]\n"
-"\n"
-"authorityKeyIdentifier=keyid:always,issuer:always\n"
-"\n"
-"'\n"
-"selfcnf='\n"
-"####################################################################\n"
-"[ req ]\n"
-"default_bits		= 2048\n"
-"encrypt_key		= yes\n"
-"distinguished_name	= req_distinguished_name\n"
-"x509_extensions		= cert_type\n"
-"\n"
-"[ req_distinguished_name ]\n"
-"countryName			= Country Name (2 letter code)\n"
-"countryName_default		= AU\n"
-"countryName_min			= 2\n"
-"countryName_max			= 2\n"
-"\n"
-"stateOrProvinceName		= State or Province Name (full name)\n"
-"stateOrProvinceName_default	= mystate\n"
-"\n"
-"localityName			= Locality Name (eg, city)\n"
-"\n"
-"0.organizationName		= Organization Name (eg, company)\n"
-"0.organizationName_default	= x11vnc server self-signed\n"
-"\n"
-"organizationalUnitName		= Organizational Unit Name (eg, section)\n"
-"\n"
-"commonName			= Common Name (eg, YOUR name)\n"
-"commonName_default		= x11vnc server self-signed %NAME\n"
-"commonName_max			= 64\n"
-"\n"
-"emailAddress			= Email Address\n"
-"emailAddress_default		= x11vnc at self-signed.nowhere\n"
-"emailAddress_max		= 64\n"
-"\n"
-"[ cert_type ]\n"
-"nsCertType = server\n"
-"\n"
-"'\n"
-"echo \"$cnf\" | sed -e \"s/%USER/$USER/\" \\\n"
-"	> \"$DIR/CA/ssl.cnf\" || exit 1\n"
-"echo \"$cnf\" | sed -e \"s/%USER *//\" -e 's/server CA/server %NAME/g' -e 's/@CA/@server/' \\\n"
-"	> \"$DIR/CA/ssl.cnf.server\" || exit 1\n"
-"echo \"$cnf\" | sed -e \"s/%USER *//\" -e 's/server CA/client %NAME/g' -e 's/@CA/@client/' \\\n"
-"	> \"$DIR/CA/ssl.cnf.client\" || exit 1\n"
-"\n"
-"echo \"$selfcnf\" > \"$DIR/CA/self.cnf.server\" || exit 1\n"
-"echo \"$selfcnf\" | sed -e 's/ server/ client/g' \\\n"
-"	> \"$DIR/CA/self.cnf.client\" || exit 1\n"
-"\n"
-"cd \"$DIR\"	|| exit 1\n"
-"\n"
-"echo \"\"\n"
-"echo \"----------------------------------------------------------------------\"\n"
-"echo \"Generating your x11vnc CA (certificate authority) key and certificate:\"\n"
-"echo \"\"\n"
-"echo \"Please supply a passphrase and any other information you care to.\"\n"
-"echo \"----------------------------------------------------------------------\"\n"
-"echo \"\"\n"
-"\n"
-"req_args=$REQ_ARGS\n"
-"if echo \"$req_args\" | grep 'days' > /dev/null; then\n"
-"	:\n"
-"else\n"
-"	req_args=\"$req_args -days 730\"\n"
-"fi\n"
-"\n"
-"\"$OPENSSL\" req -config \"$DIR/CA/ssl.cnf\" -new -x509 -days 730 $req_args  \\\n"
-"	-keyout \"$DIR/CA/private/cakey.pem\" \\\n"
-"	-out \"$DIR/CA/cacert.pem\"\n"
-"\n"
-"if [ $? != 0 ]; then\n"
-"	echo \"openssl failed.\"\n"
-"	exit 1\n"
-"fi\n"
-"\n"
-"chmod go-rwx \"$DIR/CA/private/cakey.pem\"\n"
-"\n"
-"echo \"\"\n"
-"echo \"----------------------------------------------------------------------\"\n"
-"echo \"Your public x11vnc CA cert is:\"\n"
-"echo \"\"\n"
-"echo \"        $DIR/CA/cacert.pem\"\n"
-"echo \"\"\n"
-"echo \"   It may be copied to other applications, e.g. Web browser, Java\"\n"
-"echo \"   Applet keystore, or stunnel cfg, to use to verify signed server\"\n"
-"echo \"   or client certs, etc.\"\n"
-"echo \"\"\n"
-"echo \"Your private x11vnc CA key is:\"\n"
-"echo \"\"\n"
-"echo \"        $DIR/CA/private/cakey.pem\"\n"
-"echo \"\"\n"
-"echo \"   It will be used to sign server or client certs, keep it secret.\"\n"
-"echo \"----------------------------------------------------------------------\"\n"
-"echo \"\"\n"
-"printf \"Press Enter to print the cacert.pem certificate to the screen: \"\n"
-"read x\n"
-"echo \"\"\n"
-"cat \"$DIR/CA/cacert.pem\"\n"
-;
-
-char genCert[] = 
-"#!/bin/sh\n"
-"\n"
-"direrror() {\n"
-"	echo \"\"\n"
-"	echo \"You need first to run:\"\n"
-"	echo \"\"\n"
-"	if echo \"$DIR\" | grep '/\\.vnc/certs' > /dev/null; then\n"
-"		echo \"	x11vnc -sslGenCA\"\n"
-"	else\n"
-"		echo \"	x11vnc -sslGenCA $DIR\"\n"
-"	fi\n"
-"	echo \"\"\n"
-"	echo \"to create the CA cert file and other needed config files and directories.\"\n"
-"	echo \"\"\n"
-"	echo \"Then you can run: x11vnc -sslGenCert $type $name0\"\n"
-"	echo \"\"\n"
-"	if [ \"X$1\" != \"X\" ]; then\n"
-"		echo \"(missing file/dir: $1)\"\n"
-"		echo \"\"\n"
-"	fi\n"
-"	exit 1\n"
-"}\n"
-"\n"
-"make_HASH() {\n"
-"	crt=\"$1\"\n"
-"	remove=\"$2\"\n"
-"	if [ ! -f \"$crt\" ]; then\n"
-"		return\n"
-"	fi\n"
-"	dirhash=`dirname \"$crt\"`/HASH\n"
-"	bashash=`basename \"$crt\"`\n"
-"	if [ ! -d \"$dirhash\" ]; then\n"
-"		return\n"
-"	fi\n"
-"	hash=`\"$OPENSSL\" x509 -hash -noout -in \"$crt\" 2>/dev/null | head -1`\n"
-"	if [ \"X$hash\" != \"X\" ]; then\n"
-"		for i in 0 1 2 3 4 5 6 7 8 9\n"
-"		do\n"
-"			lnk=\"$dirhash/$hash.$i\"\n"
-"			if [ \"X$remove\" = \"X1\" ]; then\n"
-"				if [ -h \"$lnk\" ]; then\n"
-"					if cmp \"$lnk\" \"$crt\" > /dev/null 2>&1; then\n"
-"						ls -l \"$lnk\"\n"
-"						rm -i \"$lnk\"\n"
-"					fi\n"
-"				fi\n"
-"			else\n"
-"				if [ -h \"$lnk\" ]; then\n"
-"					if [ ! -f \"$lnk\" ]; then\n"
-"						rm -f \"$lnk\" 1>/dev/null 2>&1\n"
-"					else\n"
-"						continue\n"
-"					fi\n"
-"				fi\n"
-"				if [ \"x$HASH_verbose\" = \"x1\" ]; then\n"
-"					echo \"creating: $lnk -> ../$bashash\"\n"
-"				fi\n"
-"				ln -s \"../$bashash\" \"$lnk\"\n"
-"				break\n"
-"			fi\n"
-"		done\n"
-"	fi\n"
-"}\n"
-"\n"
-"create_key() {\n"
-"	\n"
-"	echo \"----------------------------------------------------------------------\"\n"
-"	echo \"Creating new x11vnc certificate and key for name: $type $name0\"\n"
-"	echo \"\"\n"
-"\n"
-"	req_args=$REQ_ARGS\n"
-"	if echo \"$req_args\" | grep 'days' > /dev/null; then\n"
-"		:\n"
-"	else\n"
-"		req_args=\"$req_args -days 730\"\n"
-"	fi\n"
-"\n"
-"	cnf=\"$DIR/tmp/cnf.$$\"\n"
-"	trap \"rm -f \\\"$cnf\\\"\" 0 1 2 15\n"
-"\n"
-"	rm -f \"$DIR/$dest.key\" \"$DIR/$dest.crt\" \"$DIR/$dest.req\"\n"
-"\n"
-"	if [ \"x$self\" = \"x1\" ]; then\n"
-"		if [ ! -f \"$DIR/CA/self.cnf.$type\" ]; then\n"
-"			direrror \"$DIR/CA/self.cnf.$type\"\n"
-"		fi\n"
-"		cat \"$DIR/CA/self.cnf.$type\" | sed -e \"s/%NAME/$name0/\" > \"$cnf\" || exit 1\n"
-"		\"$OPENSSL\" req -config \"$cnf\" -nodes -new -newkey rsa:2048 -x509 $req_args \\\n"
-"			-keyout \"$DIR/$dest.key\" \\\n"
-"			-out    \"$DIR/$dest.crt\"\n"
-"	else\n"
-"		if [ ! -f \"$DIR/CA/ssl.cnf.$type\" ]; then\n"
-"			direrror \"$DIR/CA/ssl.cnf.$type\"\n"
-"		fi\n"
-"		cat \"$DIR/CA/ssl.cnf.$type\" | sed  -e \"s/%NAME/$name0/\" > \"$cnf\" || exit 1\n"
-"		\"$OPENSSL\" req -config \"$cnf\" -nodes -new -newkey rsa:2048 $req_args \\\n"
-"			-keyout \"$DIR/$dest.key\" \\\n"
-"			-out    \"$DIR/$dest.req\"\n"
-"	fi\n"
-"	rc=$?\n"
-"	if [ -f \"$DIR/$dest.key\" ]; then\n"
-"		chmod go-rwx \"$DIR/$dest.key\"\n"
-"	fi\n"
-"\n"
-"\n"
-"\n"
-"	if [ $rc != 0 ]; then\n"
-"		echo \"openssl 'req' command failed\"\n"
-"		rm -f \"$DIR/$dest.key\" \"$DIR/$dest.crt\" \"$DIR/$dest.req\"\n"
-"		exit 1\n"
-"	fi\n"
-"}\n"
-"\n"
-"enc_key() {\n"
-"	\n"
-"	echo \"\"\n"
-"	echo \"----------------------------------------------------------------------\"\n"
-"	echo \"Do you want to protect the generated private key with a passphrase?\"\n"
-"	echo \"Doing so will significantly decrease the chances someone could steal\"\n"
-"	if [ \"x$type\" = \"xserver\" ]; then\n"
-"	echo \"the key and pretend to be your x11vnc server.  The downside is it is\"\n"
-"	else\n"
-"	echo \"the key and pretend to be your VNC client.  The downside is it is\"\n"
-"	fi\n"
-"	echo \"inconvenient because you will need to supply the passphrase EVERY\"\n"
-"	if [ \"x$type\" = \"xserver\" ]; then\n"
-"	echo \"time you start x11vnc using this key.\"\n"
-"	else\n"
-"	echo \"time you start the VNC viewer SSL tunnel using this key.\"\n"
-"	fi\n"
-"	echo \"\"\n"
-"	if [ \"X$GENCERT_NOPROMPT\" = \"X\" ]; then\n"
-"		x=\"\"\n"
-"		for tp in 1 2 3\n"
-"		do\n"
-"			printf \"Protect key with a passphrase?  y/n \"\n"
-"			read x\n"
-"			x=`echo \"$x\" | tr 'A-Z' 'a-z' | sed -e 's/[ 	]//g'`\n"
-"			if [ \"X$x\" = \"Xy\" -o \"X$x\" = \"Xn\" ]; then\n"
-"				break;\n"
-"			else \n"
-"				echo \"Please reply with \\\"y\\\" or \\\"n\\\".\"\n"
-"			fi\n"
-"		done\n"
-"		if [ \"X$x\" != \"Xy\" -a \"X$x\" != \"Xn\" ]; then\n"
-"			echo \"Assuming reply \\\"n\\\".\"\n"
-"			x=n\n"
-"		fi\n"
-"	else\n"
-"		echo \"NOT protecting private key with passphrase.\"\n"
-"		x=n\n"
-"	fi\n"
-"	estr=\" *unencrypted*\"\n"
-"	if [ \"x$ENCRYPT_ONLY\" != \"x\" ]; then\n"
-"		target=\"$ENCRYPT_ONLY\"\n"
-"	else\n"
-"		target=\"$DIR/$dest.key\"\n"
-"		bdir=`dirname \"$DIR/$dest.key\"`\n"
-"		if [ ! -d \"$bdir\" ]; then\n"
-"			direrror \"$bdir\"\n"
-"		fi\n"
-"	fi\n"
-"	if [ \"x$x\" != \"xn\" ]; then\n"
-"		\"$OPENSSL\" rsa -in \"$target\" -des3 -out \"$target\"\n"
-"		if [ $? != 0 ]; then\n"
-"			echo \"openssl 'rsa' command failed\"\n"
-"			rm -f \"$DIR/$dest.key\" \"$DIR/$dest.crt\" \"$DIR/$dest.req\"\n"
-"			exit 1\n"
-"		fi\n"
-"		estr=\" encrypted\"\n"
-"	fi\n"
-"	echo \"\"\n"
-"}\n"
-"\n"
-"sign_key() {\n"
-"	cd \"$DIR\" || exit 1\n"
-"\n"
-"	if [ \"x$self\" = \"x1\" ]; then\n"
-"		:\n"
-"	else\n"
-"		if echo \"$name0\" | grep '^req:' > /dev/null; then\n"
-"			echo \"\"\n"
-"			echo \"----------------------------------------------------------------------\"\n"
-"			echo \"Your x11vnc $type certificate request is:\"\n"
-"			echo \"\"\n"
-"			echo \"        $DIR/$dest.req\"\n"
-"			echo \"\"\n"
-"			echo \"   It may be sent to an external CA for signing, afterward you can\"\n"
-"			echo \"   save the cert they send you in:\"\n"
-"			echo \"\"\n"
-"			echo \"        $DIR/$dest.crt\"\n"
-"			echo \"\"\n"
-"			echo \"Your$estr private x11vnc $type key is:\"\n"
-"			echo \"\"\n"
-"			echo \"        $DIR/$dest.key\"\n"
-"			echo \"\"\n"
-"			echo \"   You should combine it and the received cert in the file:\"\n"
-"			echo \"\"\n"
-"			echo \"        $DIR/$dest.pem\"\n"
-"			echo \"\"\n"
-"			echo \"   It will be needed by applications to identify themselves.\"\n"
-"			echo \"   This file should be kept secret.\"\n"
-"			echo \"----------------------------------------------------------------------\"\n"
-"			echo \"\"\n"
-"			if [ \"X$GENCERT_NOPROMPT\" = \"X\" ]; then\n"
-"				printf \"Press Enter to print the $dest.req cert request to the screen: \"\n"
-"				read x\n"
-"			fi\n"
-"			echo \"\"\n"
-"			cat \"$DIR/$dest.req\"\n"
-"			exit 0\n"
-"		fi\n"
-"		echo \"\"\n"
-"		echo \"\"\n"
-"		echo \"----------------------------------------------------------------------\"\n"
-"		echo \"Now signing the new key with CA private key.  You will need to supply\"\n"
-"		echo \"the CA key passphrase and reply \\\"y\\\" to sign and commit the key.\"\n"
-"		echo \"\"\n"
-"		\"$OPENSSL\" ca -config \"$cnf\" -policy policy_anything -notext \\\n"
-"			-in  \"$DIR/$dest.req\" \\\n"
-"			-out \"$DIR/$dest.crt\"\n"
-"		if [ $? != 0 ]; then\n"
-"			echo \"\"\n"
-"			echo \"openssl 'ca' command failed\"\n"
-"			echo \"\"\n"
-"			echo \"  You may have a duplicate DN entry for this name in:\"\n"
-"			echo \"\"\n"
-"			echo \"          $DIR/CA/index.txt\"\n"
-"			echo \"\"\n"
-"			echo \"  remove the duplicate in that file and try again.\"\n"
-"			echo \"\"\n"
-"			rm -f \"$DIR/$dest.key\" \"$DIR/$dest.crt\" \"$DIR/$dest.req\"\n"
-"			exit 1\n"
-"		fi\n"
-"	fi\n"
-"\n"
-"	cat  \"$DIR/$dest.key\"  \"$DIR/$dest.crt\" \\\n"
-"		> \"$DIR/$dest.pem\" || exit 1 \n"
-"\n"
-"	make_HASH \"$DIR/$dest.crt\" 0\n"
-"\n"
-"	rm -f \"$DIR/$dest.key\" \"$DIR/$dest.req\" || exit 1\n"
-"	chmod go-rwx \"$DIR/$dest.pem\" || exit 1\n"
-"\n"
-"	if [ \"x$type\" = \"xserver\" -o \"x$type\" = \"xclient\" ]; then\n"
-"		echo \"\"\n"
-"		echo \"----------------------------------------------------------------------\"\n"
-"		echo \"Your public x11vnc $type cert is:\"\n"
-"		echo \"\"\n"
-"		echo \"        $DIR/$dest.crt\"\n"
-"		echo \"\"\n"
-"		echo \"   It may be copied to other machines / applications to be used for\"\n"
-"		echo \"   authentication.  However, since it is signed with the x11vnc CA\"\n"
-"		echo \"   key, all the applications need is the x11vnc CA certificate.\"\n"
-"		echo \"\"\n"
-"		echo \"Your$estr private x11vnc $type key is:\"\n"
-"		echo \"\"\n"
-"		echo \"        $DIR/$dest.pem\"\n"
-"		echo \"\"\n"
-"		echo \"   It will be needed by applications to identify themselves.\"\n"
-"		echo \"   This file should be kept secret.\"\n"
-"		echo \"----------------------------------------------------------------------\"\n"
-"		echo \"\"\n"
-"	fi\n"
-"\n"
-"	if [ \"X$GENCERT_NOPROMPT\" = \"X\" ]; then\n"
-"		printf \"Press Enter to print the $dest.crt certificate to the screen: \"\n"
-"		read x\n"
-"	fi\n"
-"	echo \"\"\n"
-"	cat \"$DIR/$dest.crt\"\n"
-"}\n"
-"\n"
-"DIR=$BASE_DIR\n"
-"if [ \"x$DIR\" = \"x\" ]; then\n"
-"        DIR=\"$HOME/dotkjr_vnc/certs\"\n"
-"fi\n"
-"if echo \"$DIR\" | grep '^/' > /dev/null; then\n"
-"	:\n"
-"else\n"
-"	DIR=\"`pwd`/$DIR\"\n"
-"fi\n"
-"\n"
-"if [ \"x$HASHON\" != \"x\" ]; then\n"
-"	for dir in \"$DIR/HASH\" \"$DIR/clients/HASH\"\n"
-"	do\n"
-"		if [ -d \"$dir\" ]; then\n"
-"			rm -rf \"$dir\"\n"
-"		fi\n"
-"	done\n"
-"	dir=\"$DIR/HASH\"\n"
-"	mkdir -p \"$dir\" || exit 1\n"
-"	dir=\"$DIR/clients/HASH\"\n"
-"	mkdir -p \"$dir\" || exit 1\n"
-"	HASH_verbose=1\n"
-"	for f in \"$DIR\"/*.crt \"$DIR\"/clients/*.crt\n"
-"	do\n"
-"		if [ -f \"$f\" ]; then\n"
-"			make_HASH \"$f\" 0\n"
-"		fi\n"
-"	done\n"
-"	exit\n"
-"fi\n"
-"if [ \"x$HASHOFF\" != \"x\" ]; then\n"
-"	dir=\"$DIR/HASH\"\n"
-"	for dir in \"$DIR/HASH\" \"$DIR/clients/HASH\"\n"
-"	do\n"
-"		if [ -d \"$dir\" ]; then\n"
-"			for f in \"$dir\"/*\n"
-"			do\n"
-"				if [ -f \"$f\" ]; then\n"
-"					echo \"deleting: $f\"\n"
-"					rm -f \"$f\"\n"
-"				fi\n"
-"			done\n"
-"			rm -rf \"$dir\"\n"
-"		fi\n"
-"	done\n"
-"	exit\n"
-"fi\n"
-"\n"
-"PATH=/usr/bin:/bin:/usr/sbin:$PATH; export PATH\n"
-"if [ \"x$OPENSSL\" = \"x\" ]; then\n"
-"        OPENSSL=\"openssl\"\n"
-"fi\n"
-"\n"
-"type \"$OPENSSL\" > /dev/null	|| exit 1\n"
-"\n"
-"self=\"\"\n"
-"if [ \"x$SELF\" != \"x\" ]; then\n"
-"	self=1\n"
-"elif [ \"x$1\" = \"x-self\" ]; then\n"
-"	shift\n"
-"	self=1\n"
-"fi\n"
-"\n"
-"if [ \"x$TYPE\" != \"x\" ]; then\n"
-"	type=\"$TYPE\"\n"
-"else\n"
-"	if [ \"X$1\" != \"X\" ]; then\n"
-"		type=\"$1\"\n"
-"		shift\n"
-"	fi\n"
-"fi\n"
-"if [ \"x$NAME\" != \"x\" ]; then\n"
-"	name=\"$NAME\"\n"
-"else\n"
-"	if [ \"X$1\" != \"X\" ]; then\n"
-"		name=\"$1\"\n"
-"		shift\n"
-"	fi\n"
-"fi\n"
-"\n"
-"if echo \"$name\" | grep '^self:' > /dev/null; then\n"
-"	self=1\n"
-"fi\n"
-"\n"
-"if [ \"x$type\" = \"xserver\" ]; then\n"
-"	name0=\"$name\"\n"
-"	if echo \"$name\" | grep '^-' > /dev/null; then\n"
-"		:\n"
-"	elif [ \"x$name\" != \"x\" ]; then\n"
-"		name=\"-$name\";\n"
-"	fi\n"
-"	dest=\"server$name\"\n"
-"elif [ \"x$type\" = \"xclient\" ]; then\n"
-"	if [ \"x$name\" = \"x\" ]; then\n"
-"		name=\"nobody\"\n"
-"	fi\n"
-"	name0=\"$name\"\n"
-"	dest=\"clients/$name\"\n"
-"else\n"
-"	exit 1\n"
-"fi\n"
-"\n"
-"#set -xv\n"
-"\n"
-"if [ \"x$INFO_ONLY\" != \"x\" ]; then\n"
-"	echo \"\"\n"
-"	echo \"VNC Certificate file:\"\n"
-"	echo \"	$INFO_ONLY\"\n"
-"	echo \"\"\n"
-"	\"$OPENSSL\" x509 -text -in \"$INFO_ONLY\"\n"
-"	exit \n"
-"elif [ \"x$DELETE_ONLY\" != \"x\" ]; then\n"
-"	echo \"\"\n"
-"	echo \"VNC Certificate file:\"\n"
-"	echo \"	$DELETE_ONLY\"\n"
-"	echo \"\"\n"
-"	\n"
-"	base=`echo \"$DELETE_ONLY\" | sed -e 's/\\....$//'`\n"
-"	for suff in crt pem key req\n"
-"	do\n"
-"		try=\"$base.$suff\"\n"
-"		if [ -f \"$try\" ]; then\n"
-"			make_HASH \"$try\" 1\n"
-"			rm -i \"$try\"\n"
-"		fi\n"
-"	done\n"
-"	if echo \"$base\" | grep 'CA/cacert$' > /dev/null; then\n"
-"		base2=`echo \"$base\" | sed -e 's,cacert$,private/cakey,'`\n"
-"	else\n"
-"		echo \"\"\n"
-"		exit\n"
-"	fi\n"
-"	echo \"\"\n"
-"	for suff in crt pem key req\n"
-"	do\n"
-"		try=\"$base2.$suff\"\n"
-"		if [ -f \"$try\" ]; then\n"
-"			make_HASH \"$try\" 1\n"
-"			rm -i \"$try\"\n"
-"		fi\n"
-"	done\n"
-"	echo \"\"\n"
-"	exit \n"
-"elif [ \"x$ENCRYPT_ONLY\" != \"x\" ]; then\n"
-"	if [ \"x$type\" = \"x\" ]; then\n"
-"		type=\"server\"\n"
-"	fi\n"
-"	echo \"\"\n"
-"	echo \"Key PEM file:\"\n"
-"	echo \"	$ENCRYPT_ONLY\"\n"
-"	enc_key\n"
-"	exit\n"
-"fi\n"
-"\n"
-"if [ ! -d \"$DIR/tmp\" ]; then\n"
-"	direrror \"$DIR/tmp\"\n"
-"fi\n"
-"bdir=`dirname \"$DIR/$dest.key\"`\n"
-"if [ ! -d \"$bdir\" ]; then\n"
-"	direrror \"$bdir\"\n"
-"fi\n"
-"if [ ! -f \"$DIR/CA/cacert.pem\" ]; then\n"
-"	direrror \"$DIR/CA/cacert.pem\"\n"
-"fi\n"
-"\n"
-"create_key\n"
-"enc_key\n"
-"sign_key\n"
-;
-
-char find_display[] = 
-"#!/bin/sh\n"
-"#\n"
-"# Script for use in -display WAIT:cmd=FINDDISPLAY -unixpw mode.\n"
-"# Attempts to find 1) DISPLAY and 2) XAUTH data for the user and\n"
-"# returns them to caller.\n"
-"#\n"
-"# The idea is this script is run via su - user -c ... and returns\n"
-"# display + xauth info to caller (x11vnc running as root or nobody).\n"
-"# x11vnc then uses the info to open the display.\n"
-"#\n"
-"# If not called with -unixpw, root, etc. uses current $USER.\n"
-"\n"
-"#FIND_DISPLAY_OUTPUT=/tmp/fdo.$USER.txt\n"
-"\n"
-"if [ \"X$FIND_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"	if [ \"X$FIND_DISPLAY_EXEC\" = \"X\" ]; then\n"
-"		FIND_DISPLAY_EXEC=1\n"
-"		export FIND_DISPLAY_EXEC\n"
-"		# we rerun ourselves with verbose output to a file:\n"
-"		#\n"
-"		if [ \"X$FIND_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"			/bin/sh $0 \"$@\" 2> $FIND_DISPLAY_OUTPUT\n"
-"		else\n"
-"			/bin/sh $0 \"$@\" 2> /dev/null\n"
-"		fi\n"
-"		exit $?\n"
-"	fi\n"
-"fi\n"
-"\n"
-"if [ \"X$FIND_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"	# turn on verbose output\n"
-"	set -xv\n"
-"fi\n"
-"if [ \"X$FIND_DISPLAY_DEBUG\" != \"X\" ]; then\n"
-"	# print environment and turn on verbose output\n"
-"	env\n"
-"	set -xv\n"
-"fi\n"
-"\n"
-"if [ \"X$X11VNC_SKIP_DISPLAY\" = \"Xall\" ]; then\n"
-"	exit 1\n"
-"fi\n"
-"\n"
-"# Set PATH to pick up utilities we use below.\n"
-"PATH=$PATH:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/ucb\n"
-"export PATH\n"
-"\n"
-"# This is to try to trick ps(1) into writing wide lines: \n"
-"COLUMNS=256\n"
-"export COLUMNS\n"
-"\n"
-"# -n means no xauth, -f prescribes file to use.\n"
-"showxauth=1\n"
-"if [ \"X$1\" = \"X-n\" ]; then\n"
-"	showxauth=\"\"\n"
-"	shift\n"
-"fi\n"
-"if [ \"X$FIND_DISPLAY_NO_SHOW_XAUTH\" != \"X\" ]; then\n"
-"	showxauth=\"\"\n"
-"fi\n"
-"\n"
-"# -f means use this xauthority file:\n"
-"if [ \"X$1\" = \"X-f\" ]; then\n"
-"	shift\n"
-"	if [ ! -r $1 ]; then\n"
-"		echo \"\"\n"
-"		exit 1\n"
-"	fi\n"
-"	export XAUTHORITY=\"$1\"\n"
-"	shift\n"
-"fi\n"
-"\n"
-"# we need to set user:\n"
-"#\n"
-"user=\"$1\"			# cmd line arg takes precedence\n"
-"if [ \"X$user\" = \"X\" ]; then\n"
-"	user=$X11VNC_USER	# then X11VNC_USER\n"
-"fi\n"
-"if [ \"X$user\" = \"X\" ]; then\n"
-"	user=$USER		# then USER\n"
-"fi\n"
-"if [ \"X$user\" = \"X\" ]; then\n"
-"	user=$LOGNAME		# then LOGNAME\n"
-"fi\n"
-"if [ \"X$user\" = \"X\" ]; then\n"
-"	user=`whoami 2>/dev/null`	# desperation whoami\n"
-"fi\n"
-"if [ \"X$user\" = \"X\" ]; then\n"
-"	echo \"\"		# failure\n"
-"	exit 1\n"
-"fi\n"
-"\n"
-"LC_ALL=C\n"
-"export LC_ALL\n"
-"\n"
-"# util to try to match a display with a Linux VT and print\n"
-"# disp,VT=... etc.  Otherwise just print out display.\n"
-"#\n"
-"prdpy () {\n"
-"	d1=$1\n"
-"	chvt0=\"\"\n"
-"	if [ \"X$FIND_DISPLAY_NO_VT_FIND\" != \"X\" ]; then\n"
-"		:\n"
-"	# we can only do chvt on Linux:\n"
-"	elif [ \"X$uname\" = \"XLinux\" ]; then\n"
-"		d2=$d1\n"
-"		d3=`echo \"$d2\" | sed -e 's/^.*:/:/' -e 's/\\..*$//'`\n"
-"		d4=\"($d2|$d3)\"\n"
-"\n"
-"		# vt is usually in X server line:\n"
-"		#\n"
-"		ps_tmp=`ps wwaux | grep X`\n"
-"		vt=`echo \"$ps_tmp\" | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | egrep ' vt([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\n"
-"\n"
-"		if [ \"X$vt\" != \"X\" ]; then\n"
-"			# strip it out and add it.\n"
-"			vt=`echo \"$vt\" | sed -e 's/^.* vt\\([0-9][0-9]*\\) .*$/\\1/'`\n"
-"			if echo \"$vt\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"				chvt0=\",VT=$vt\"\n"
-"			fi\n"
-"		else\n"
-"			# otherwise look for tty:\n"
-"			vt=`echo \"$ps_tmp\" | grep X | egrep \" $d4 \" | egrep ' tty([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\n"
-"			if [ \"X$vt\" != \"X\" ]; then\n"
-"				vt=`echo \"$vt\" | sed -e 's/^.* tty\\([0-9][0-9]*\\) .*$/\\1/'`\n"
-"				if echo \"$vt\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"					chvt0=\",VT=$vt\"\n"
-"				fi\n"
-"			else\n"
-"				# otherwise try lsof:\n"
-"				pvt=`echo \"$ps_tmp\" | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | head -n 1 | awk '{print $2}'`\n"
-"				if [ \"X$FIND_DISPLAY_NO_LSOF\" != \"X\" ]; then\n"
-"					if [ \"X$pvt\" != \"X\" ]; then\n"
-"						chvt0=\",XPID=$pvt\"\n"
-"					fi\n"
-"				elif [ \"X$pvt\" != \"X\" ]; then\n"
-"					vt=`lsof -b -p \"$pvt\" 2>/dev/null | egrep '/dev/tty([789]|[1-9][0-9][0-9]*)$' | grep -v grep | head -n 1 | awk '{print $NF}' | sed -e 's,/dev/tty,,'`\n"
-"					if echo \"$vt\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"						chvt0=\",VT=$vt\"\n"
-"					else\n"
-"						# if this fails, at least tell them the XPID:\n"
-"						chvt0=\",XPID=$pvt\"\n"
-"					fi\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"	fi\n"
-"\n"
-"	# return the string, possibly with ,VT=... appended:\n"
-"	#\n"
-"	echo \"$d1$chvt0\"\n"
-"}\n"
-"\n"
-"# save uname, netstat, and ps output:\n"
-"uname=`uname`\n"
-"is_bsd=\"\"\n"
-"if echo \"$uname\" | grep -i bsd > /dev/null; then\n"
-"	is_bsd=1\n"
-"fi\n"
-"\n"
-"if [ \"X$uname\" = \"XDarwin\" ]; then\n"
-"	psout=`ps aux 2>/dev/null              | grep -wv PID | grep -v grep`\n"
-"elif [ \"X$uname\" = \"XLinux\" -o \"X$is_bsd\" = \"X1\" ]; then\n"
-"	psout=`ps wwaux 2>/dev/null           | grep -wv PID | grep -v grep`\n"
-"elif [ \"X$uname\" = \"XSunOS\" -a -x /usr/ucb/ps ]; then\n"
-"	psout=`/usr/ucb/ps wwaux 2>/dev/null  | grep -wv PID | grep -v grep`\n"
-"else\n"
-"	psout=`ps -ef 2>/dev/null | grep -wv PID | grep -v grep`\n"
-"fi\n"
-"pslist=`echo \"$psout\" | awk '{print $2}'`\n"
-"\n"
-"nsout=`netstat -an`\n"
-"\n"
-"rchk() {\n"
-"	rr=rr	\n"
-"}\n"
-"\n"
-"dL=\"-L\"\n"
-"if uname -sr | egrep 'SunOS 5\\.[5-8]' > /dev/null; then\n"
-"	dL=\"-h\"\n"
-"fi\n"
-"\n"
-"# a portable tmp file creator\n"
-"mytmp() {\n"
-"	tf=$1\n"
-"	if type mktemp > /dev/null 2>&1; then\n"
-"		# if we have mktemp(1), use it:\n"
-"		tf2=\"$tf.XXXXXX\"\n"
-"		tf2=`mktemp \"$tf2\"`\n"
-"		if [ \"X$tf2\" != \"X\" -a -f \"$tf2\" ]; then\n"
-"			if [ \"X$DEBUG_MKTEMP\" != \"X\" ]; then\n"
-"				echo \"mytmp-mktemp: $tf2\" 1>&2\n"
-"			fi\n"
-"			echo \"$tf2\"\n"
-"			return\n"
-"		fi\n"
-"	fi\n"
-"	# fallback to multiple cmds:\n"
-"	rm -rf \"$tf\" || exit 1\n"
-"	if [ -d \"$tf\" ]; then\n"
-"		echo \"tmp file $tf still exists as a directory.\"\n"
-"		exit 1\n"
-"	elif [ $dL \"$tf\" ]; then\n"
-"		echo \"tmp file $tf still exists as a symlink.\"\n"
-"		exit 1\n"
-"	elif [ -f \"$tf\" ]; then\n"
-"		echo \"tmp file $tf still exists.\"\n"
-"		exit 1\n"
-"	fi\n"
-"	touch \"$tf\" || exit 1\n"
-"	chmod 600 \"$tf\" || exit 1\n"
-"	rchk\n"
-"	if [ \"X$DEBUG_MKTEMP\" != \"X\" ]; then\n"
-"		echo \"mytmp-touch: $tf\" 1>&2\n"
-"	fi\n"
-"	echo \"$tf\"\n"
-"}\n"
-"\n"
-"skip_display() {\n"
-"	dtry=$1\n"
-"	dtry1=`echo \"$dtry\" | sed -e 's/^://'`\n"
-"	dtry2=`echo \"$dtry\" | sed -e 's/\\.[0-9][0-9]*$//'`\n"
-"\n"
-"	if [ \"X$X11VNC_SKIP_DISPLAY\" = \"X\" ]; then\n"
-"		# no skip list, return display:\n"
-"		echo \"$dtry\"\n"
-"	else\n"
-"		# user supplied skip list:\n"
-"		mat=\"\"\n"
-"		slist=\"\"\n"
-"		for skip in `echo \"$X11VNC_SKIP_DISPLAY\" | tr ',' '\\n'`\n"
-"		do\n"
-"			if echo \"$skip\" | sed -e 's/://g' | grep '^[0-9][0-9]*-[0-9][0-9]*$' > /dev/null; then\n"
-"				# a range n-m\n"
-"				min=`echo \"$skip\" | sed -e 's/://g' | awk -F- '{print $1}'`\n"
-"				max=`echo \"$skip\" | sed -e 's/://g' | awk -F- '{print $2}'`\n"
-"				if [ \"$min\" -le \"$max\" ]; then\n"
-"					while [ $min -le $max ]\n"
-"					do\n"
-"						if [ \"X$slist\" = \"X\" ]; then\n"
-"							slist=\"$min\"\n"
-"						else\n"
-"							slist=\"$slist $min\"\n"
-"						fi\n"
-"						min=`expr $min + 1`\n"
-"					done\n"
-"					continue\n"
-"				fi\n"
-"			fi\n"
-"			# a simple :n or n (or user supplied garbage).\n"
-"			if [ \"X$slist\" = \"X\" ]; then\n"
-"				slist=\"$skip\"\n"
-"			else\n"
-"				slist=\"$slist $skip\"\n"
-"			fi\n"
-"		done\n"
-"\n"
-"		for skip in $slist\n"
-"		do\n"
-"			if echo \"$skip\" | grep \"^:\" > /dev/null; then\n"
-"				:\n"
-"			else\n"
-"				skip=\":$skip\"\n"
-"			fi\n"
-"			skip2=`echo \"$skip\" | sed -e 's/\\.[0-9][0-9]*$//'`\n"
-"\n"
-"			if echo \"$skip\" | grep \":$dtry1\\>\" > /dev/null; then\n"
-"				mat=1\n"
-"				break\n"
-"			elif echo \"$skip\" | grep \":$dtry2\\>\" > /dev/null; then\n"
-"				mat=1\n"
-"				break\n"
-"			elif [ \"X$skip2\" = \"X:$dtry1\" ]; then\n"
-"				mat=1\n"
-"				break\n"
-"			elif [ \"X$skip2\" = \"X:$dtry2\" ]; then\n"
-"				mat=1\n"
-"				break\n"
-"			fi\n"
-"		done\n"
-"		if [ \"X$X11VNC_SKIP_DISPLAY_NEGATE\" = \"X\" ]; then\n"
-"			if [ \"X$mat\" = \"X1\" ]; then\n"
-"				echo \"\"\n"
-"			else\n"
-"				echo \"$dtry\"\n"
-"			fi\n"
-"		else\n"
-"			if [ \"X$mat\" = \"X1\" ]; then\n"
-"				echo \"$dtry\"\n"
-"			else\n"
-"				echo \"\"\n"
-"			fi\n"
-"		fi\n"
-"	fi\n"
-"}\n"
-"\n"
-"am_root=\"\"\n"
-"if id | sed -e 's/ gid.*$//' | grep -w root > /dev/null; then\n"
-"	am_root=1\n"
-"fi\n"
-"am_gdm=\"\"\n"
-"if id | sed -e 's/ gid.*$//' | grep -w gdm > /dev/null; then\n"
-"	am_gdm=1\n"
-"fi\n"
-"\n"
-"# this mode is to try to grab a display manager (gdm, kdm, xdm...) display\n"
-"# when we are run as root (e.g. no one is logged in yet).  We look at the\n"
-"# -auth line in the X/Xorg commandline.\n"
-"#\n"
-"if [ \"X$FD_XDM\" != \"X\" ]; then\n"
-"	list=\"\"\n"
-"	for pair in `echo \"$psout\" | grep '/X.* :[0-9][0-9]* .*-auth' | egrep -v 'startx|xinit' | sed -e 's,^.*/X.* \\(:[0-9][0-9]*\\) .* -auth \\([^ ][^ ]*\\).*$,\\1\\,\\2,' | sort -u`\n"
-"	do\n"
-"		da=`echo \"$pair\" | awk -F, '{print $1}'`\n"
-"		xa=`echo \"$pair\" | awk -F, '{print $2}'`\n"
-"		da=`skip_display \"$da\"`\n"
-"		if [ \"X$da\" = \"X\" ]; then\n"
-"			continue\n"
-"		fi\n"
-"		if [ -f $xa -a -r $xa ]; then\n"
-"			# if we have an xauth file, we proceed to test it:\n"
-"			#\n"
-"			env XAUTHORITY=\"$xa\" xdpyinfo -display \"$da\" >/dev/null 2>&1\n"
-"			if [ $? = 0 ]; then\n"
-"				si_root=\"\"\n"
-"				si_gdm=\"\"\n"
-"				# recent gdm seems to use SI:localuser: for xauth.\n"
-"				if env DISPLAY=\"$da\" xhost 2>/dev/null | grep -i '^SI:localuser:root$' > /dev/null; then\n"
-"					si_root=1\n"
-"				fi\n"
-"				if env DISPLAY=\"$da\" xhost 2>/dev/null | grep -i '^SI:localuser:gdm$'  > /dev/null; then\n"
-"					si_gdm=1\n"
-"				fi\n"
-"				env XAUTHORITY=/dev/null xdpyinfo -display \"$da\" >/dev/null 2>&1\n"
-"				rc=$?\n"
-"				if [ \"X$rc\" = \"X0\" ]; then\n"
-"					# assume it is ok for server interpreted case.\n"
-"					if [ \"X$am_root\" = \"X1\" -a \"X$si_root\" = \"X1\" ]; then\n"
-"						rc=5\n"
-"					elif [ \"X$am_gdm\" = \"X1\" -a \"X$si_gdm\" = \"X1\" ]; then\n"
-"						rc=6\n"
-"					fi\n"
-"				fi\n"
-"				if [ $rc != 0 ]; then\n"
-"					y=`prdpy $da`\n"
-"					if [ \"X$FIND_DISPLAY_NO_SHOW_DISPLAY\" = \"X\" ]; then\n"
-"						echo \"DISPLAY=$y\"\n"
-"					fi\n"
-"					if [ \"X$FIND_DISPLAY_XAUTHORITY_PATH\" != \"X\" ]; then\n"
-"						# caller wants XAUTHORITY printed out too.\n"
-"						if [ \"X$xa\" != \"X\" -a -f \"$xa\" ]; then\n"
-"							echo \"XAUTHORITY=$xa\"\n"
-"						else\n"
-"							echo \"XAUTHORITY=$XAUTHORITY\"\n"
-"						fi\n"
-"					fi\n"
-"					if [ \"X$showxauth\" != \"X\" ]; then\n"
-"						# copy the cookie:\n"
-"						cook=`xauth -f \"$xa\" list | head -n 1 | awk '{print $NF}'`\n"
-"						xtf=$HOME/.xat.$$\n"
-"						xtf=`mytmp \"$xtf\"`\n"
-"						if [ ! -f $xtf ]; then\n"
-"							xtf=/tmp/.xat.$$\n"
-"							xtf=`mytmp \"$xtf\"`\n"
-"						fi\n"
-"						if [ ! -f $xtf ]; then\n"
-"							xtf=/tmp/.xatb.$$\n"
-"							rm -f $xtf\n"
-"							if [ -f $xtf ]; then\n"
-"								exit 1\n"
-"							fi\n"
-"							touch $xtf 2>/dev/null\n"
-"							chmod 600 $xtf 2>/dev/null\n"
-"							if [ ! -f $xtf ]; then\n"
-"								exit 1\n"
-"							fi\n"
-"						fi\n"
-"						xauth -f $xtf add \"$da\" . $cook\n"
-"						xauth -f $xtf extract - \"$da\" 2>/dev/null\n"
-"						rm -f $xtf\n"
-"					fi\n"
-"					# DONE\n"
-"					exit 0\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"	done\n"
-"	if [ \"X$FIND_DISPLAY_XAUTHORITY_PATH\" = \"X\" ]; then\n"
-"		echo \"\"		# failure\n"
-"	fi\n"
-"	if [ \"X$showxauth\" != \"X\" ]; then\n"
-"		echo \"\"\n"
-"	fi\n"
-"	# DONE\n"
-"	exit 1\n"
-"fi\n"
-"\n"
-"# Normal case here (not xdm...).\n"
-"\n"
-"# Try to match X DISPLAY to user:\n"
-"\n"
-"# who(1) output column 2:\n"
-"#gone=`last $user | grep 'gone.*no.logout' | awk '{print $2}' | grep '^:' | sed -e 's,/.*,,' | tr '\\n' '|'`\n"
-"#gone=\"${gone}__quite_impossible__\"\n"
-"#display=`who 2>/dev/null | grep \"^${user}[ 	][ 	]*:[0-9]\" | egrep -v \" ($gone)\\>\" | head -n 1 \\\n"
-"#    | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
-"\n"
-"poss=\"\"\n"
-"list=`who 2>/dev/null | grep \"^${user}[ 	][ 	]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
-"list=\"$list \"`w -h \"$user\" 2>/dev/null | grep \"^${user}[ 	][ 	]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n"
-"list=\"$list \"`who 2>/dev/null | grep \"^${user}[ 	]\" | awk '{print $NF}' | grep '(:[0-9]' | sed -e 's/[()]//g'`\n"
-"host=`hostname 2>/dev/null | sed -e 's/\\..*$//'`\n"
-"\n"
-"got_local_dm_file=\"\"\n"
-"\n"
-"if [ \"X$X11VNC_FINDDISPLAY_SKIP_XAUTH\" = \"X\" ]; then\n"
-"	# do a normal xauth list:\n"
-"	list=\"$list \"`xauth list | awk '{print $1}' | grep /unix | grep \"^${host}\" | sed -e 's/^.*:/:/' | sort -n | uniq`\n"
-"\n"
-"	# check for gdm and kdm non-NFS cookies in /tmp: (and now /var/run/gdm)\n"
-"	for xa in /tmp/.gdm* /tmp/.Xauth* /var/run/gdm*/auth-for-*/database /var/run/gdm*/auth-cookie-*-for-*\n"
-"	do\n"
-"		# try to be somewhat careful about the real owner of the file:\n"
-"		if [ \"X$am_root\" = \"X1\" ]; then\n"
-"			break\n"
-"		fi\n"
-"		if [ -f $xa -a -r $xa ]; then\n"
-"			if ls -l \"$xa\" | sed -e 's,/tmp.*$,,' -e 's,/var.*$,,' | grep -w \"$user\" > /dev/null; then\n"
-"				# append these too:\n"
-"				if find \"$xa\" -user \"$user\" -perm 600 > /dev/null; then\n"
-"					:\n"
-"				else\n"
-"					continue\n"
-"				fi\n"
-"				# it passes the ownership tests, add it:\n"
-"				# since the directory is (evidently) local, \"localhost\" is good too. (but beware XAUTHLOCALHOSTNAME in libxcb)\n"
-"				sav0=\"$list \"\n"
-"				list=\"$list \"`xauth -f \"$xa\" list | awk '{print $1}' | grep /unix | egrep -i \"^${host}|^localhost\" | sed -e 's/^.*:/:/' | sort -n | uniq | sed -e \"s,\\$,\\,$xa,\"`\n"
-"				if [ \"X$sav0\" != \"X$list\" ]; then\n"
-"					got_local_dm_file=1\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"	done\n"
-"fi\n"
-"\n"
-"if [ \"X$uname\" = \"XDarwin\" ]; then\n"
-"	# macosx uses \"console\" string (in leopard X11 runs/launched by default)\n"
-"	if who 2>/dev/null | grep -i \"^${user}[ 	][ 	]*console[ 	]\" > /dev/null; then\n"
-"		echo \"DISPLAY=console\"\n"
-"		if [ \"X$FIND_DISPLAY_ALL\" = \"X\" ]; then\n"
-"			if [ \"X$showxauth\" != \"X\" ]; then\n"
-"				echo \"\"\n"
-"			fi\n"
-"			exit 0\n"
-"		fi\n"
-"	fi\n"
-"fi\n"
-"\n"
-"# try the items in the list:\n"
-"#\n"
-"nsout_trim=`echo \"$nsout\" | grep \"/tmp/.X11-unix/\"`\n"
-"#\n"
-"for p in $list\n"
-"do\n"
-"	xa=`echo \"$p\" | awk -F, '{print $2}'`\n"
-"	d=`echo \"$p\" | sed -e 's/,.*$//' -e 's/://' -e 's/\\..*$//'`\n"
-"	ok=\"\"\n"
-"	d=`skip_display \"$d\"`\n"
-"	if [ \"X$d\" = \"X\" ]; then\n"
-"		continue;\n"
-"	fi\n"
-"\n"
-"	# check for the local X11 files:\n"
-"	xd=\"/tmp/.X11-unix/X$d\"\n"
-"	if [ -r \"$xd\" -o -w \"$xd\" -o -x \"$xd\" ]; then\n"
-"		if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X$d[  ]*\\$\" > /dev/null; then\n"
-"			ok=1\n"
-"		fi\n"
-"	fi\n"
-"	if [ \"X$ok\" = \"X\" ]; then\n"
-"		# instead check for the lock:\n"
-"		if [ -f \"/tmp/.X$d-lock\" ]; then\n"
-"			pid=`cat \"/tmp/.X$d-lock\" | sed -e 's/[ 	]//g'`\n"
-"			if echo \"$pid\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"				if [ \"X$uname\" = \"XLinux\" -o \"X$uname\" = \"XSunOS\" ]; then\n"
-"					if [ -d \"/proc/$pid\" ]; then\n"
-"						ok=1\n"
-"					fi\n"
-"				elif echo \"$pslist\" | grep -w \"$pid\" > /dev/null; then\n"
-"					ok=1\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"	fi\n"
-"\n"
-"	if [ \"X$ok\" = \"X1\" ]; then\n"
-"		# ok, put it on the list\n"
-"		poss=\"$poss $p\"\n"
-"	fi\n"
-"done\n"
-"\n"
-"seenvalues=\"\"\n"
-"\n"
-"seen() {\n"
-"	# simple util to skip repeats\n"
-"	v=$1\n"
-"	if [ \"X$seenvalues\" != \"X\" ]; then\n"
-"		for v2 in $seenvalues\n"
-"		do\n"
-"			if [ \"X$v\" = \"X$v2\" ]; then\n"
-"				seenret=1\n"
-"				return\n"
-"			fi\n"
-"		done\n"
-"	fi\n"
-"	if [ \"X$seenvalues\" = \"X\" ]; then\n"
-"		seenvalues=\"$v\"\n"
-"	else\n"
-"		seenvalues=\"$seenvalues $v\"\n"
-"	fi\n"
-"	seenret=0\n"
-"}\n"
-"\n"
-"# now get read to try each one in $poss\n"
-"#\n"
-"poss=`echo \"$poss\" | sed -e 's/^ *//' -e 's/ *$//'`\n"
-"display=\"\"\n"
-"xauth_use=\"\"\n"
-"\n"
-"if [ \"X$X11VNC_FINDDISPLAY_SKIP_XAUTH\" != \"X\" ]; then\n"
-"	# we are not supposed to call xauth(1), simply report\n"
-"	if [ \"X$FIND_DISPLAY_ALL\" != \"X\" ]; then\n"
-"		for p in $poss\n"
-"		do\n"
-"			if [ \"X$p\" = \"X\" ]; then\n"
-"				continue\n"
-"			fi\n"
-"			seen \"$p\"\n"
-"			if [ \"X$seenret\" = \"X1\" ]; then\n"
-"				continue\n"
-"			fi\n"
-"			# get rid of any ,xauth\n"
-"			p=`echo \"$p\" | sed -e 's/,.*$//'`\n"
-"			y=`prdpy $p`\n"
-"			echo $y\n"
-"		done\n"
-"		exit 0\n"
-"	fi\n"
-"	display=`echo \"$poss\" | tr ' ' '\\n' | head -n 1`\n"
-"else\n"
-"	freebie=\"\"\n"
-"	xauth_freebie=\"\"\n"
-"	for p in $poss\n"
-"	do\n"
-"		if [ \"X$p\" = \"X\" ]; then\n"
-"			continue\n"
-"		fi\n"
-"		seen \"$p\"\n"
-"		if [ \"X$seenret\" = \"X1\" ]; then\n"
-"			continue\n"
-"		fi\n"
-"\n"
-"		# extract ,xauth if any.\n"
-"		xa=\"\"\n"
-"		xa=`echo \"$p\" | awk -F, '{print $2}'`\n"
-"		p=`echo \"$p\" | sed -e 's/,.*$//'`\n"
-"\n"
-"		# check xauth for it:\n"
-"		if [ \"X$xa\" != \"X\" ]; then\n"
-"			myenv=\"XAUTHORITY=$xa\"\n"
-"		else\n"
-"			myenv=\"FOO_BAR_=baz\"\n"
-"		fi\n"
-"		p=`skip_display \"$p\"`\n"
-"		if [ \"X$p\" = \"X\" ]; then\n"
-"			continue\n"
-"		fi\n"
-"\n"
-"		env \"$myenv\" xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
-"		rc=$?\n"
-"\n"
-"		if [ $rc != 0 ]; then\n"
-"			# guard against libxcb/desktop silliness: \n"
-"			xalhn_save=$XAUTHLOCALHOSTNAME\n"
-"\n"
-"			if [ \"X$xalhn_save\" != \"X\" ]; then\n"
-"				# try it again unset\n"
-"				unset XAUTHLOCALHOSTNAME\n"
-"				env \"$myenv\" xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
-"				rc=$?\n"
-"				if [ $rc != 0 ]; then\n"
-"					# did not work; put it back\n"
-"					XAUTHLOCALHOSTNAME=$xalhn_save\n"
-"					export XAUTHLOCALHOSTNAME\n"
-"				fi\n"
-"			fi\n"
-"			if [ $rc != 0 -a \"X$xalhn_save\" != \"Xlocalhost\" ]; then\n"
-"				# try it again with localhost\n"
-"				env \"$myenv\" XAUTHLOCALHOSTNAME=localhost xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
-"				rc=$?\n"
-"				if [ $rc = 0 ]; then\n"
-"					# better export it for cmds below...\n"
-"					XAUTHLOCALHOSTNAME=localhost\n"
-"					export XAUTHLOCALHOSTNAME\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"\n"
-"		if [ $rc = 0 ]; then\n"
-"			if [ \"X$FD_TAG\" != \"X\" ]; then\n"
-"				# look for x11vnc special FD_TAG property:\n"
-"				if [ \"X$xa\" = \"X\" ]; then\n"
-"					if xprop -display \"$p\" -root -len 128 FD_TAG | grep -iv no.such.atom \\\n"
-"					    | grep \"=[ 	][ 	]*\\\"$FD_TAG\\\"\" > /dev/null; then\n"
-"						:\n"
-"					else\n"
-"						continue\n"
-"					fi\n"
-"				else\n"
-"					if env XAUTHORITY=\"$xa\" xprop -display \"$p\" -root -len 128 FD_TAG | grep -iv no.such.atom \\\n"
-"					    | grep \"=[ 	][ 	]*\\\"$FD_TAG\\\"\" > /dev/null; then\n"
-"						:\n"
-"					else\n"
-"						continue\n"
-"					fi\n"
-"				fi\n"
-"			fi\n"
-"\n"
-"			# Now try again with no authority:\n"
-"			env XAUTHORITY=/dev/null xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
-"\n"
-"			# 0 means got in for free... skip it unless we don't find anything else.\n"
-"			if [ $? != 0 ]; then\n"
-"				# keep it\n"
-"				display=\"$p\"\n"
-"				xauth_use=\"$xa\"\n"
-"				if [ \"X$FIND_DISPLAY_ALL\" != \"X\" ]; then\n"
-"					y=`prdpy $p`\n"
-"					echo \"DISPLAY=$y\"\n"
-"					continue\n"
-"				fi\n"
-"				break\n"
-"			else\n"
-"				# store in freebie as fallback\n"
-"				if [ \"X$FIND_DISPLAY_ALL\" != \"X\" ]; then\n"
-"					y=`prdpy $p`\n"
-"					echo \"$y,NOXAUTH\"\n"
-"					continue\n"
-"				fi\n"
-"				if [ \"X$freebie\" = \"X\" ]; then\n"
-"					freebie=\"$p\"\n"
-"					xauth_freebie=\"$xa\"\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"	done\n"
-"	if [ \"X$display\" = \"X\" -a \"X$freebie\" != \"X\" ]; then\n"
-"		# fallback to the freebie (if any)\n"
-"		display=\"$freebie\"\n"
-"		xauth_use=\"$xauth_freebie\"\n"
-"	fi\n"
-"fi\n"
-"\n"
-"if [ \"X$FIND_DISPLAY_ALL\" != \"X\" ]; then\n"
-"	# we have listed everything, get out.\n"
-"	exit\n"
-"fi\n"
-"if [ \"X$display\" = \"X\" ]; then\n"
-"	if [ \"X$FINDDISPLAY_run\" = \"X\" ]; then\n"
-"		echo \"\"		# failure\n"
-"		if [ \"X$showxauth\" != \"X\" ]; then\n"
-"			echo \"\"\n"
-"		fi\n"
-"	fi\n"
-"	exit 1\n"
-"fi\n"
-"\n"
-"# append ,VT=n if applicable:\n"
-"dpy2=`prdpy \"$display\"`\n"
-"\n"
-"if [ \"X$FIND_DISPLAY_NO_SHOW_DISPLAY\" = \"X\" ]; then\n"
-"	echo \"DISPLAY=$dpy2\"\n"
-"fi\n"
-"if [ \"X$FIND_DISPLAY_XAUTHORITY_PATH\" != \"X\" ]; then\n"
-"	# caller wants XAUTHORITY printed out too.\n"
-"	if [ \"X$xauth_use\" != \"X\" -a -f \"$xauth_use\" ]; then\n"
-"		echo \"XAUTHORITY=$xauth_use\"\n"
-"	else\n"
-"		echo \"XAUTHORITY=$XAUTHORITY\"\n"
-"	fi\n"
-"fi\n"
-"if [ \"X$showxauth\" != \"X\" ]; then\n"
-"	# show the (binary) xauth data:\n"
-"	if [ \"X$xauth_use\" != \"X\" -a -f \"$xauth_use\" ]; then\n"
-"		xauth -f \"$xauth_use\" extract - \"$display\" 2>/dev/null\n"
-"	else\n"
-"		xauth extract - \"$display\" 2>/dev/null\n"
-"	fi\n"
-"fi\n"
-"\n"
-"exit 0\n"
-;
-
-char create_display[] = 
-"#!/bin/sh\n"
-"\n"
-"#CREATE_DISPLAY_OUTPUT=/tmp/cdo.txt\n"
-"\n"
-"if echo \"$USER\" | egrep 'runge' > /dev/null ; then\n"
-"	CREATE_DISPLAY_OUTPUT=/tmp/cdo.$USER.txt\n"
-"	if [ -f $CREATE_DISPLAY_OUTPUT -a ! -w $CREATE_DISPLAY_OUTPUT ]; then\n"
-"		CREATE_DISPLAY_OUTPUT=$CREATE_DISPLAY_OUTPUT.$$\n"
-"	fi\n"
-"fi\n"
-"if [ \"X$CREATE_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"	if [ \"X$CREATE_DISPLAY_EXEC\" = \"X\" ]; then\n"
-"		CREATE_DISPLAY_EXEC=1\n"
-"		export CREATE_DISPLAY_EXEC\n"
-"		if [ \"X$CREATE_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"			/bin/sh $0 \"$@\" 2> $CREATE_DISPLAY_OUTPUT\n"
-"		else\n"
-"			/bin/sh $0 \"$@\" 2> /dev/null\n"
-"		fi\n"
-"		exit $?\n"
-"	fi\n"
-"fi\n"
-"if [ \"X$CREATE_DISPLAY_PERL_SETPGRP\" = \"X\" ]; then\n"
-"	CREATE_DISPLAY_PERL_SETPGRP=1\n"
-"	export CREATE_DISPLAY_PERL_SETPGRP\n"
-"	if type perl >/dev/null 2>&1; then\n"
-"		perl -e \"setpgrp(0,0); exec '/bin/sh $0 $*'\";\n"
-"		exit $?\n"
-"	fi\n"
-"fi\n"
-"\n"
-"\n"
-"if [ \"X$CREATE_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"	set -xv\n"
-"fi\n"
-"\n"
-"COLUMNS=256\n"
-"export COLUMNS\n"
-"\n"
-"LC_ALL_save=$LC_ALL\n"
-"LC_ALL=C\n"
-"export LC_ALL\n"
-"\n"
-"findfree() {\n"
-"	try=20\n"
-"	dpymax=79\n"
-"	if [ \"X$X11VNC_CREATE_STARTING_DISPLAY_NUMBER\" != \"X\" ]; then\n"
-"		try=$X11VNC_CREATE_STARTING_DISPLAY_NUMBER\n"
-"	fi\n"
-"	if [ \"X$X11VNC_CREATE_MAX_DISPLAYS\" != \"X\" ]; then\n"
-"		dpymax=$X11VNC_CREATE_MAX_DISPLAYS\n"
-"	fi\n"
-"	sry=`expr $try + $dpymax`\n"
-"	n=\"\"\n"
-"	nsout=\"\"\n"
-"	if [ \"X$have_netstat\" != \"X\" ]; then\n"
-"		nsout=`$have_netstat -an`\n"
-"	fi\n"
-"	nsout_trim=`echo \"$nsout\" | grep \"/tmp/.X11-unix/\"`\n"
-"	while [ $try -lt $sry ]\n"
-"	do\n"
-"		tlock=\"/tmp/.X${try}-lock\"\n"
-"		if [ -r $tlock ]; then\n"
-"			if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X${try}[ 	]*\\$\" > /dev/null; then\n"
-"				:\n"
-"			else\n"
-"				pid=`head -n 1 $tlock 2>/dev/null | sed -e 's/[ 	]//g' | grep '^[0-9][0-9]*$'`\n"
-"				if [ \"X$pid\" != \"X\" ]; then\n"
-"					exists=0\n"
-"					if [ -d /proc/$pid ]; then\n"
-"						exists=1\n"
-"					elif kill -0 $pid 2>/dev/null; then\n"
-"						exists=1\n"
-"					fi\n"
-"					if [ \"X$exists\" = \"X0\" ]; then\n"
-"						rm -f $tlock\n"
-"					fi\n"
-"				fi\n"
-"			fi\n"
-"		fi\n"
-"		if [ ! -f $tlock ]; then\n"
-"			if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X${try}[ 	]*\\$\" > /dev/null; then\n"
-"				:\n"
-"			else\n"
-"				n=$try\n"
-"				break\n"
-"			fi\n"
-"		fi\n"
-"		try=`expr $try + 1`\n"
-"	done\n"
-"	echo \"$n\"\n"
-"}\n"
-"\n"
-"random() {\n"
-"	if [ \"X$RANDOM\" != \"X\" ]; then\n"
-"		echo \"$RANDOM\"\n"
-"	else\n"
-"		r1=`bash -c 'echo $RANDOM' 2>/dev/null`\n"
-"		if echo \"$r1\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"			echo \"$r1\"\n"
-"		else\n"
-"			r2=`sh -c 'echo $$; date; ps -elf' 2>&1 | sum -r 2>/dev/null | awk '{print $1}'`\n"
-"			if echo \"$r2\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"				echo \"$r2\"\n"
-"			else\n"
-"				r3=`sh -c 'echo $$'`\n"
-"				echo \"$r3\"\n"
-"			fi\n"
-"		fi\n"
-"	fi\n"
-"}\n"
-"\n"
-"findsession() {\n"
-"	if [ \"X$FD_PROG\" != \"X\" ]; then\n"
-"		echo \"$FD_PROG\"\n"
-"		return\n"
-"	fi\n"
-"	if [ \"X$have_gnome_session\" != \"X\" -a \"X$FD_SESS\" = \"Xgnome\" ]; then\n"
-"		if [ \"X$have_dbus_launch\" != \"X\" ]; then\n"
-"			echo \"$have_dbus_launch --exit-with-session $have_gnome_session\"\n"
-"		else\n"
-"			echo \"$have_gnome_session\"\n"
-"		fi\n"
-"		return\n"
-"	elif [ \"X$have_startkde\" != \"X\"    -a \"X$FD_SESS\" = \"Xkde\" ]; then\n"
-"		echo \"$have_startkde\"\n"
-"		return\n"
-"	elif [ \"X$have_startlxde\" != \"X\"    -a \"X$FD_SESS\" = \"Xlxde\" ]; then\n"
-"		echo \"$have_startlxde\"\n"
-"		return\n"
-"	elif [ \"X$have_twm\" != \"X\"         -a \"X$FD_SESS\" = \"Xtwm\" ]; then\n"
-"		echo \"$have_twm\"\n"
-"		return\n"
-"	elif [ \"X$have_fvwm2\" != \"X\"       -a \"X$FD_SESS\" = \"Xfvwm\" ]; then\n"
-"		echo \"$have_fvwm2\"\n"
-"		return\n"
-"	elif [ \"X$have_mwm\" != \"X\"         -a \"X$FD_SESS\" = \"Xmwm\" ]; then\n"
-"		echo \"$have_mwm\"\n"
-"		return\n"
-"	elif [ \"X$have_dtwm\" != \"X\"        -a \"X$FD_SESS\" = \"Xdtwm\" ]; then\n"
-"		echo \"$have_dtwm\"\n"
-"		return\n"
-"	elif [ \"X$have_windowmaker\" != \"X\" -a \"X$FD_SESS\" = \"Xwmaker\" ]; then\n"
-"		echo \"$have_windowmaker\"\n"
-"		return\n"
-"	elif [ \"X$have_wmaker\" != \"X\"      -a \"X$FD_SESS\" = \"Xwmaker\" ]; then\n"
-"		echo \"$have_wmaker\"\n"
-"		return\n"
-"	elif [ \"X$have_startxfce\" != \"X\" -a \"X$FD_SESS\" = \"Xxfce\" ]; then\n"
-"		echo \"$have_startxfce\"\n"
-"		return\n"
-"	elif [ \"X$have_startxfce4\" != \"X\" -a \"X$FD_SESS\" = \"Xxfce\" ]; then\n"
-"		echo \"$have_startxfce4\"\n"
-"		return\n"
-"	elif [ \"X$have_enlightenment\" != \"X\" -a \"X$FD_SESS\" = \"Xenlightenment\" ]; then\n"
-"		echo \"$have_enlightenment\"\n"
-"		return\n"
-"	elif [ \"X$have_Xsession\" != \"X\"    -a \"X$FD_SESS\" = \"XXsession\" ]; then\n"
-"		echo \"$have_Xsession\"\n"
-"		return\n"
-"	elif [ \"X$have_Xsession\" != \"X\"    -a \"X$FD_SESS\" = \"Xcde\" ]; then\n"
-"		echo \"$have_Xsession\"\n"
-"		return\n"
-"	elif [ \"X$have_xterm\" != \"X\"       -a \"X$FD_SESS\" = \"Xfailsafe\" ]; then\n"
-"		echo \"$have_xterm\"\n"
-"		return\n"
-"	elif [ \"X$have_xterm\" != \"X\"       -a \"X$FD_SESS\" = \"Xxterm\" ]; then\n"
-"		echo \"$have_xterm\"\n"
-"		return\n"
-"	fi\n"
-"	if type csh > /dev/null 2>&1; then\n"
-"		home=`csh -f -c \"echo ~$USER\"`\n"
-"	elif type tcsh > /dev/null 2>&1; then\n"
-"		home=`tcsh -f -c \"echo ~$USER\"`\n"
-"	elif type bash > /dev/null 2>&1; then\n"
-"		home=`bash -c \"echo ~$USER\"`\n"
-"	else\n"
-"		home=\"\"\n"
-"	fi\n"
-"	if [ \"X$home\" = \"X\" -o ! -d \"$home\" ]; then\n"
-"		if [ \"X$have_root\" != \"X\" -a \"X$USER\" != \"Xroot\" ]; then\n"
-"			home=`su - $USER -c 'echo $HOME'`\n"
-"		fi\n"
-"	fi\n"
-"	if [ \"X$home\" = \"X\" -o ! -d \"$home\" ]; then\n"
-"		if [ -d \"/home/$USER\" ]; then\n"
-"			home=\"/home/$USER\"\n"
-"		else \n"
-"			home=__noplace__\n"
-"		fi\n"
-"	fi\n"
-"	if [ -f \"$home/.dmrc\" ]; then\n"
-"		if [ \"X$have_startkde\" != \"X\" ]; then\n"
-"			if egrep -i 'Session=kde' \"$home/.dmrc\" > /dev/null; then\n"
-"				echo \"$have_startkde\"\n"
-"				return\n"
-"			fi\n"
-"		fi\n"
-"		if [ \"X$have_startlxde\" != \"X\" ]; then\n"
-"			if egrep -i 'Session=lxde' \"$home/.dmrc\" > /dev/null; then\n"
-"				echo \"$have_startlxde\"\n"
-"				return\n"
-"			fi\n"
-"		fi\n"
-"		if [ \"X$have_gnome_session\" != \"X\" ]; then\n"
-"			if egrep -i 'Session=gnome' \"$home/.dmrc\" > /dev/null; then\n"
-"				echo \"$have_gnome_session\"\n"
-"				return\n"
-"			fi\n"
-"		fi\n"
-"		for wm in blackbox fvwm icewm wmw openbox twm mwm windowmaker enlightenment metacity startxfce4 startxfce\n"
-"		do\n"
-"			eval \"have=\\$have_$wm\"\n"
-"			if [ \"X$have\" = \"X\" ]; then\n"
-"				continue\n"
-"			fi\n"
-"			if grep -i \"Session=$wm\" \"$home/.dmrc\" > /dev/null; then\n"
-"				echo \"$have\"\n"
-"				return\n"
-"			fi\n"
-"			\n"
-"		done\n"
-"		if egrep -i 'Session=default' \"$home/.dmrc\" > /dev/null; then\n"
-"			if [ \"X$have_gnome_session\" != \"X\" ]; then\n"
-"				echo \"$have_gnome_session\"\n"
-"				return\n"
-"			elif [ \"X$have_startkde\" != \"X\" ]; then\n"
-"				echo \"$have_startkde\"\n"
-"				return\n"
-"			elif [ \"X$have_startxfce\" != \"X\" ]; then\n"
-"				echo \"$have_startxfce\"\n"
-"				return\n"
-"			fi\n"
-"		fi\n"
-"	fi\n"
-"	if [ -f \"$home/.xsession\" ]; then\n"
-"		echo \"$home/.xsession\"\n"
-"		return\n"
-"	elif [ -f \"$home/.xinitrc\" ]; then\n"
-"		echo \"$home/.xinitrc\"\n"
-"		return\n"
-"	fi\n"
-"	if [ \"X$have_xterm\" != \"X\" ]; then\n"
-"		echo $have_xterm\n"
-"		return\n"
-"	else\n"
-"		echo \".xinitrc\"\n"
-"	fi\n"
-"}\n"
-"\n"
-"check_redir_services() {\n"
-"	redir_daemon=\"\"\n"
-"	need_env=\"\"\n"
-"	if echo \"$sess\" | grep '^env ' > /dev/null; then\n"
-"		sess=`echo \"$sess\" | sed -e 's/^env //'`\n"
-"		need_env=1\n"
-"	fi\n"
-"	if [ \"X$FD_ESD\" != \"X\" -a \"X$have_esddsp\" != \"X\" ]; then\n"
-"		if echo \"$FD_ESD\" | grep '^DAEMON-' > /dev/null; then\n"
-"			FD_ESD=`echo \"$FD_ESD\" | sed -e 's/DAEMON-//'`\n"
-"			rport=`echo \"$FD_ESD\" | sed -e 's/^.*://'`\n"
-"			dport=`expr $rport + 1`\n"
-"			dport=`freeport $dport`\n"
-"			FD_ESD=$dport\n"
-"			redir_daemon=\"$redir_daemon,TS_ESD_REDIR:$dport:$rport\"\n"
-"		fi\n"
-"		if echo \"$FD_ESD\" | grep ':' > /dev/null; then\n"
-"			:\n"
-"		else\n"
-"			FD_ESD=\"localhost:$FD_ESD\"\n"
-"		fi\n"
-"		sess=\"ESPEAKER=$FD_ESD $have_esddsp -s $FD_ESD $sess\"\n"
-"		need_env=1\n"
-"	fi\n"
-"	if [ \"X$FD_CUPS\" != \"X\" ]; then\n"
-"		if echo \"$FD_CUPS\" | grep '^DAEMON-' > /dev/null; then\n"
-"			FD_CUPS=`echo \"$FD_CUPS\" | sed -e 's/DAEMON-//'`\n"
-"			rport=`echo \"$FD_CUPS\" | sed -e 's/^.*://'`\n"
-"			dport=`expr $rport + 1`\n"
-"			dport=`freeport $dport`\n"
-"			FD_CUPS=$dport\n"
-"			redir_daemon=\"$redir_daemon,TS_CUPS_REDIR:$dport:$rport\"\n"
-"		fi\n"
-"		if echo \"$FD_CUPS\" | grep ':' > /dev/null; then\n"
-"			:\n"
-"		else\n"
-"			FD_CUPS=\"localhost:$FD_CUPS\"\n"
-"		fi\n"
-"		csr=`echo \"$FD_CUPS\" | awk -F: '{print $1}'`\n"
-"		ipp=`echo \"$FD_CUPS\" | awk -F: '{print $2}'`\n"
-"		old=`strings -a /usr/sbin/cupsd 2>/dev/null | grep 'CUPS.v1\\.[01]'`\n"
-"		if [ \"X$old\" != \"X\" ]; then\n"
-"			FD_CUPS=`echo \"$FD_CUPS\" | sed -e 's/:.*$//'`\n"
-"		fi\n"
-"		sess=\"CUPS_SERVER=$FD_CUPS IPP_PORT=$ipp $sess\"\n"
-"		need_env=1\n"
-"	fi\n"
-"\n"
-"	if [ \"X$FD_SMB\" != \"X\" ]; then\n"
-"		if echo \"$FD_SMB\" | grep '^DAEMON-' > /dev/null; then\n"
-"			FD_SMB=`echo \"$FD_SMB\" | sed -e 's/DAEMON-//'`\n"
-"			rport=`echo \"$FD_SMB\" | sed -e 's/^.*://'`\n"
-"			dport=`expr $rport + 1`\n"
-"			dport=`freeport $dport`\n"
-"			FD_SMB=$dport\n"
-"			redir_daemon=\"$redir_daemon,TS_SMB_REDIR:$dport:$rport\"\n"
-"		fi\n"
-"		if echo \"$FD_SMB\" | grep ':' > /dev/null; then\n"
-"			:\n"
-"		else\n"
-"			FD_SMB=\"localhost:$FD_SMB\"\n"
-"		fi\n"
-"		smh=`echo \"$FD_SMB\" | awk -F: '{print $1}'`\n"
-"		smp=`echo \"$FD_SMB\" | awk -F: '{print $2}'`\n"
-"		if [ \"X$smh\" = \"X\" ]; then\n"
-"			smh=localhost\n"
-"		fi\n"
-"		sess=\"SMB_SERVER=$FD_SMB SMB_HOST=$smh SMB_PORT=$smp $sess\"\n"
-"		need_env=1\n"
-"	fi\n"
-"\n"
-"	if [ \"X$FD_NAS\" != \"X\" ]; then\n"
-"		if echo \"$FD_NAS\" | grep '^DAEMON-' > /dev/null; then\n"
-"			FD_NAS=`echo \"$FD_NAS\" | sed -e 's/DAEMON-//'`\n"
-"			rport=`echo \"$FD_NAS\" | sed -e 's/^.*://'`\n"
-"			dport=`expr $rport + 1`\n"
-"			dport=`freeport $dport`\n"
-"			FD_NAS=$dport\n"
-"			redir_daemon=\"$redir_daemon,TS_NAS_REDIR:$dport:$rport\"\n"
-"		fi\n"
-"		if echo \"$FD_NAS\" | grep ':' > /dev/null; then\n"
-"			:\n"
-"		else\n"
-"			FD_NAS=\"tcp/localhost:$FD_NAS\"\n"
-"		fi\n"
-"		sess=\"AUDIOSERVER=$FD_NAS $sess\"\n"
-"		need_env=1\n"
-"	fi\n"
-"	if [ \"X$need_env\" != \"X\" ]; then\n"
-"		sess=\"env $sess\"\n"
-"	fi\n"
-"	redir_daemon=`echo \"$redir_daemon\" | sed -e 's/^,*//'`\n"
-"	echo \"redir_daemon=$redir_daemon\" 1>&2\n"
-"}\n"
-"\n"
-"rchk() {\n"
-"	rr=rr\n"
-"}\n"
-"\n"
-"dL=\"-L\"\n"
-"if uname -sr | egrep 'SunOS 5\\.[5-8]' > /dev/null; then\n"
-"	dL=\"-h\"\n"
-"fi\n"
-"\n"
-"# a portable tmp file creator\n"
-"mytmp() {\n"
-"	tf=$1\n"
-"	if type mktemp > /dev/null 2>&1; then\n"
-"		# if we have mktemp(1), use it:\n"
-"		tf2=\"$tf.XXXXXX\"\n"
-"		tf2=`mktemp \"$tf2\"`\n"
-"		if [ \"X$tf2\" != \"X\" -a -f \"$tf2\" ]; then\n"
-"			if [ \"X$DEBUG_MKTEMP\" != \"X\" ]; then\n"
-"				echo \"mytmp-mktemp: $tf2\" 1>&2\n"
-"			fi\n"
-"			echo \"$tf2\"\n"
-"			return\n"
-"		fi\n"
-"	fi\n"
-"	# fallback to multiple cmds:\n"
-"	rm -rf \"$tf\" || exit 1\n"
-"	if [ -d \"$tf\" ]; then\n"
-"		echo \"tmp file $tf still exists as a directory.\"\n"
-"		exit 1\n"
-"	elif [ $dL \"$tf\" ]; then\n"
-"		echo \"tmp file $tf still exists as a symlink.\"\n"
-"		exit 1\n"
-"	elif [ -f \"$tf\" ]; then\n"
-"		echo \"tmp file $tf still exists.\"\n"
-"		exit 1\n"
-"	fi\n"
-"	touch \"$tf\" || exit 1\n"
-"	chmod 600 \"$tf\" || exit 1\n"
-"	rchk\n"
-"	if [ \"X$DEBUG_MKTEMP\" != \"X\" ]; then\n"
-"		echo \"mytmp-touch: $tf\" 1>&2\n"
-"	fi\n"
-"	echo \"$tf\"\n"
-"}\n"
-"\n"
-"missing_mesg() {\n"
-"	echo \"\" 1>&2\n"
-"	echo \"The program \\\"$1\\\" could not be found in PATH and standard locations.\" 1>&2\n"
-"	echo \"You probably need to install a package that provides the \\\"$1\\\" program.\" 1>&2\n"
-"	echo \"\" 1>&2\n"
-"}\n"
-"\n"
-"put_back_LC_ALL() {\n"
-"	if [ \"X$X11VNC_CREATE_LC_ALL_C_OK\" = \"X\" ]; then\n"
-"		if [ \"X$LC_ALL_save\" = \"X\" ]; then\n"
-"			unset LC_ALL\n"
-"		else\n"
-"			LC_ALL=\"$LC_ALL_save\"\n"
-"		fi\n"
-"	fi\n"
-"}\n"
-"\n"
-"server() {\n"
-"	authfile=`auth`\n"
-"	sess=`findsession`\n"
-"	DISPLAY=:$N\n"
-"	export DISPLAY\n"
-"	stmp=\"\"\n"
-"	noxauth=\"\"\n"
-"	if [ \"X$have_root\" != \"X\" -a \"X$USER\" != \"Xroot\" ]; then\n"
-"		sess=\"env DISPLAY=:$N $sess\"\n"
-"		noxauth=\"1\"\n"
-"	fi\n"
-"\n"
-"	redir_daemon=\"\"\n"
-"	check_redir_services\n"
-"\n"
-"	rmf=\"/nosuch\"\n"
-"	if echo \"$sess\" | grep '[ 	]' > /dev/null; then\n"
-"		stmp=/tmp/.cd$$`random`\n"
-"		stmp=`mytmp \"$stmp\"`\n"
-"		touch $stmp\n"
-"		chmod 755 $stmp || exit 1\n"
-"		echo \"#!/bin/sh\" > $stmp\n"
-"		#echo \"(id; env; env | grep XAUTHORITY | sed -e 's/XAUTHORITY=//' | xargs ls -l) > /tmp/ENV.OUT.$$\" >> $stmp\n"
-"		if [ \"X$SAVE_PATH\" != \"X\" ]; then\n"
-"			echo \"PATH=\\\"$SAVE_PATH\\\"\" >> $stmp\n"
-"			echo \"export PATH\" >> $stmp\n"
-"		fi\n"
-"		if [ \"X$noxauth\" = \"X1\" ]; then\n"
-"			echo \"unset XAUTHORITY\"   >> $stmp\n"
-"		fi\n"
-"		echo \"$sess\"   >> $stmp\n"
-"		echo \"sleep 1\"   >> $stmp\n"
-"		echo \"rm -f $stmp\" >> $stmp\n"
-"		sess=$stmp\n"
-"		rmf=\"$stmp\"\n"
-"	fi\n"
-"\n"
-"	if [ \"X$have_root\" != \"X\" -a \"X$USER\" != \"Xroot\" ]; then\n"
-"		ctmp1=/tmp/.xat1_$$`random`\n"
-"		ctmp1=`mytmp \"$ctmp1\"`\n"
-"		ctmp2=/tmp/.xat2_$$`random`\n"
-"		ctmp2=`mytmp \"$ctmp2\"`\n"
-"		touch $ctmp1 $ctmp2\n"
-"		$have_xauth -f $authfile nextract -           :$N > $ctmp1\n"
-"		$have_xauth -f $authfile nextract - `hostname`:$N > $ctmp2\n"
-"		chown $USER $ctmp1 $ctmp2\n"
-"		(unset XAUTHORITY; su - $USER -c \"$have_xauth nmerge - < $ctmp1\" 1>&2)\n"
-"		(unset XAUTHORITY; su - $USER -c \"$have_xauth nmerge - < $ctmp2\" 1>&2)\n"
-"		rm -f $ctmp1 $ctmp2\n"
-"		XAUTHORITY=$authfile\n"
-"		export XAUTHORITY\n"
-"		sess=\"/bin/su - $USER -c $sess\"\n"
-"	else\n"
-"		$have_xauth -f $authfile nextract -           :$N | $have_xauth nmerge -\n"
-"		$have_xauth -f $authfile nextract - `hostname`:$N | $have_xauth nmerge -\n"
-"	fi\n"
-"\n"
-"	result=0\n"
-"	#ns=4\n"
-"	ns=0\n"
-"	ns2=1\n"
-"	#if uname | grep SunOS > /dev/null; then\n"
-"	#	ns=2\n"
-"	#fi\n"
-"\n"
-"\n"
-"	if [ \"X$use_xdmcp_query\" = \"X1\" ]; then\n"
-"		# we cannot use -nolisten tcp\n"
-"		if [ \"X$FD_XDMCP_IF\" != \"X\" ]; then\n"
-"			lhost=$FD_XDMCP_IF\n"
-"		elif [ \"X$have_netstat\" = \"X\" ]; then\n"
-"			lhost=localhost\n"
-"		elif $have_netstat -an | grep -w 177 | grep -w udp > /dev/null; then\n"
-"			lhost=localhost\n"
-"		elif $have_netstat -an | grep -w 177 | grep -w udp6 > /dev/null; then\n"
-"			lhost=::1\n"
-"		else\n"
-"			lhost=localhost\n"
-"		fi\n"
-"		echo \"$* -once -query $lhost $FD_OPTS\" 1>&2\n"
-"		put_back_LC_ALL\n"
-"		if [ \"X$have_root\" != \"X\" ]; then\n"
-"			if [ -r $authfile ]; then\n"
-"				$have_nohup $* -once -query $lhost -auth $authfile $FD_OPTS 1>&2 &\n"
-"			else\n"
-"				# why did we have this?\n"
-"				$have_nohup $* -once -query $lhost $FD_OPTS 1>&2 &\n"
-"			fi\n"
-"		else\n"
-"			if [ \"X$ns\" = \"X0\" ]; then\n"
-"				$have_nohup sh -c \"$* -once -query $lhost -auth $authfile $FD_OPTS\" 1>&2 &\n"
-"			else\n"
-"				$have_nohup sh -c \"(sleep $ns; $* -once -query $lhost -auth $authfile $FD_OPTS)\" 1>&2 &\n"
-"				#result=1\n"
-"			fi\n"
-"		fi\n"
-"		pid=$!\n"
-"		sleep 10\n"
-"	elif [ \"X$have_startx\" != \"X\" -o \"X$have_xinit\" != \"X\" ]; then\n"
-"		if [ \"X$have_xinit\" != \"X\" ]; then\n"
-"			sxcmd=$have_xinit\n"
-"		else\n"
-"			sxcmd=$have_startx\n"
-"		fi\n"
-"		echo \"$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
-"		put_back_LC_ALL\n"
-"		if [ \"X$have_root\" != \"X\" ]; then\n"
-"			$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS 1>&2 &\n"
-"		else\n"
-"			if [ \"X$ns\" = \"X0\" ]; then\n"
-"				$have_nohup sh -c \"$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS\" 1>&2 &\n"
-"			else\n"
-"				# Why did we ever sleep before starting the server??\n"
-"				$have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS)\" 1>&2 &\n"
-"				#result=1\n"
-"			fi\n"
-"		fi\n"
-"		pid=$!\n"
-"	else\n"
-"		# need to emulate startx/xinit ourselves...\n"
-"		echo \"$* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
-"		put_back_LC_ALL\n"
-"		if [ \"X$have_root\" != \"X\" ]; then\n"
-"			$have_nohup $* $nolisten -auth $authfile $FD_OPTS 1>&2 &\n"
-"			pid=$!\n"
-"			sleep 3\n"
-"			$have_nohup $sess 1>&2 &\n"
-"		else\n"
-"			if [ \"X$ns\" = \"X0\" ]; then\n"
-"				$have_nohup sh -c \"$* $nolisten -auth $authfile $FD_OPTS\" 1>&2 &\n"
-"			else\n"
-"				$have_nohup sh -c \"(sleep $ns; $* $nolisten -auth $authfile $FD_OPTS)\" 1>&2 &\n"
-"				#result=1\n"
-"			fi\n"
-"			pid=$!\n"
-"			sleep 3\n"
-"			$have_nohup sh -c \"(sleep 3; $sess)\" 1>&2 &\n"
-"		fi\n"
-"	fi\n"
-"\n"
-"	LC_ALL=C\n"
-"	export LC_ALL\n"
-"\n"
-"	if uname | grep SunOS > /dev/null; then\n"
-"		$have_nohup sh -c \"(sleep 150; rm -f $rmf)\" 1>&2 &\n"
-"	else\n"
-"		$have_nohup sh -c \"(sleep 150; rm -f $rmf $authfile)\" 1>&2 &\n"
-"	fi\n"
-"\n"
-"	t=0\n"
-"	tmax=5\n"
-"	while [ $t -lt $tmax ]\n"
-"	do\n"
-"		t=`expr $t + 1`\n"
-"		sleep $ns2\n"
-"		pid2=`head -n 1 \"/tmp/.X$N-lock\" 2>/dev/null | sed -e 's/[ 	]//g' | grep '^[0-9][0-9]*$'`\n"
-"		if [ \"X$pid2\" = \"X\" ]; then\n"
-"			pid2=9999999\n"
-"		fi\n"
-"		if [ \"X$result\" = \"X1\" ]; then\n"
-"			break\n"
-"		elif [ -d /proc/$pid2 ]; then\n"
-"			result=1\n"
-"			break\n"
-"		elif kill -0 $pid2 2>/dev/null; then\n"
-"			result=1\n"
-"			break\n"
-"		elif [ -d /proc/$pid ]; then\n"
-"			result=1\n"
-"			break\n"
-"		elif kill -0 $pid 2>/dev/null; then\n"
-"			result=1\n"
-"			break\n"
-"		else\n"
-"			result=0\n"
-"		fi\n"
-"		if [ \"X$have_netstat\" != \"X\" ]; then\n"
-"			if $have_netstat -an | grep \"/tmp/.X11-unix/X$N\\$\" > /dev/null; then\n"
-"				result=1\n"
-"			fi\n"
-"		fi\n"
-"	done\n"
-"\n"
-"	if [ \"X$redir_daemon\" != \"X\" -a \"X$result\" = \"X1\" ]; then\n"
-"		redir_daemon=`echo \"$redir_daemon\" | sed -e 's/[~!$&*()|;?<>\"]//g' -e \"s/'//g\"`\n"
-"		xprog=$X11VNC_PROG\n"
-"		if [ \"X$xprog\" = \"X\" ]; then\n"
-"			xprog=x11vnc\n"
-"		fi\n"
-"		echo \"running: $xprog -sleepin 10 -auth $authfile -tsd '$redir_daemon'\" 1>&2\n"
-"		$have_nohup sh -c \"$xprog -sleepin 10 -auth $authfile -tsd '$redir_daemon' &\" 2>.tsd.log.$USER 1>&2 &\n"
-"	fi\n"
-"}\n"
-"\n"
-"try_X() {\n"
-"	if [ \"X$use_xdmcp_query\" = \"X1\" ]; then\n"
-"		if [ \"X$have_X\" != \"X\" ]; then\n"
-"			server $have_X :$N\n"
-"		elif [ \"X$have_Xorg\" != \"X\" ]; then\n"
-"			server $have_Xorg :$N\n"
-"		elif [ \"X$have_XFree86\" != \"X\" ]; then\n"
-"			server $have_XFree86 :$N\n"
-"		elif [ \"X$have_Xsun\" != \"X\" ]; then\n"
-"			server $have_Xsun :$N\n"
-"		fi\n"
-"	elif [ \"X$have_xinit\" != \"X\" ]; then\n"
-"		save_have_startx=$have_startx\n"
-"		have_startx=\"\"\n"
-"		server :$N\n"
-"		have_startx=$save_have_startx\n"
-"	else\n"
-"		server :$N\n"
-"	fi\n"
-"}\n"
-"\n"
-"try_Xvnc() {\n"
-"	if [ \"X$have_Xvnc\" = \"X\" ]; then\n"
-"		missing_mesg Xvnc\n"
-"		return\n"
-"	fi\n"
-"\n"
-"	server $have_Xvnc :$N -geometry $geom -depth $depth\n"
-"}\n"
-"\n"
-"try_Xsrv() {\n"
-"	if [ \"X$FD_XSRV\" = \"X\" ]; then\n"
-"		return\n"
-"	fi\n"
-"\n"
-"	server $FD_XSRV :$N -geometry $geom -depth $depth\n"
-"}\n"
-"\n"
-"add_modmap() {\n"
-"	if [ \"X$have_root\" = \"X\" ]; then\n"
-"	    $have_nohup sh -c \"(\n"
-"		sleep 10;\n"
-"		$have_xmodmap -display :$N -e 'keycode any = Shift_R' \\\n"
-"			-e 'add Shift = Shift_L Shift_R' \\\n"
-"			-e 'keycode any = Control_R' \\\n"
-"			-e 'add Control = Control_L Control_R' \\\n"
-"			-e 'keycode any = Alt_L' \\\n"
-"			-e 'keycode any = Alt_R' \\\n"
-"			-e 'keycode any = Meta_L' \\\n"
-"			-e 'clear Mod1' \\\n"
-"			-e 'add Mod1 = Alt_L Alt_R Meta_L';\n"
-"		if uname | grep SunOS > /dev/null; then\n"
-"			for sym in SunAudioMute SunAudioLowerVolume SunAudioRaiseVolume\n"
-"			do\n"
-"				if $have_xmodmap -pk | grep -w \\$sym > /dev/null; then\n"
-"					:\n"
-"				else\n"
-"					$have_xmodmap -e \\\"keycode any = \\$sym\\\"\n"
-"				fi\n"
-"			done\n"
-"		fi\n"
-"\n"
-"	    )\" 1>&2 &\n"
-"	else\n"
-"	    (\n"
-"		sleep 6;\n"
-"		$have_xmodmap -display :$N -e 'keycode any = Shift_R' \\\n"
-"			-e 'add Shift = Shift_L Shift_R' \\\n"
-"			-e 'keycode any = Control_R' \\\n"
-"			-e 'add Control = Control_L Control_R' \\\n"
-"			-e 'keycode any = Alt_L' \\\n"
-"			-e 'keycode any = Alt_R' \\\n"
-"			-e 'keycode any = Meta_L' \\\n"
-"			-e 'clear Mod1' \\\n"
-"			-e 'add Mod1 = Alt_L Alt_R Meta_L';\n"
-"		# this is to workaround a bug with JDS Solaris 10 gnome-session-daemon.\n"
-"		if uname | grep SunOS > /dev/null; then\n"
-"			for sym in SunAudioMute SunAudioLowerVolume SunAudioRaiseVolume\n"
-"			do\n"
-"				if $have_xmodmap -pk | grep -w $sym > /dev/null; then\n"
-"					:\n"
-"				else\n"
-"					$have_xmodmap -e \"keycode any = $sym\"\n"
-"				fi\n"
-"			done\n"
-"		fi\n"
-"	    ) 1>&2 &\n"
-"	fi\n"
-"}\n"
-"\n"
-"try_Xvfb() {\n"
-"	if [ \"X$have_Xvfb\" = \"X\" ]; then\n"
-"		missing_mesg Xvfb\n"
-"		return\n"
-"	fi\n"
-"\n"
-"	sarg=\"-screen\"\n"
-"	if uname | grep SunOS > /dev/null; then\n"
-"		if grep /usr/openwin/bin/Xsun $have_Xvfb > /dev/null; then\n"
-"			sarg=\"screen\"\n"
-"		fi\n"
-"	fi\n"
-"	margs=\"\"\n"
-"	if $have_Xvfb -help 2>&1 | grep '^\\+kb[ 	].*Keyboard Extension' >/dev/null; then\n"
-"		margs=\"+kb\"\n"
-"	fi\n"
-"\n"
-"	# currently not enabled in Xvfb's we see.\n"
-"#	if $have_Xvfb -extension MOOMOO 2>&1 | grep -w RANDR >/dev/null; then\n"
-"#		margs=\"$margs +extension RANDR\"\n"
-"#	fi\n"
-"\n"
-"	if [ $depth -ge 16 ]; then\n"
-"		# avoid DirectColor for default visual:\n"
-"		margs=\"$margs -cc 4\"\n"
-"	fi\n"
-"	server $have_Xvfb :$N $sarg 0 ${geom}x${depth} $margs\n"
-"\n"
-"	if [ \"X$result\" = \"X1\" -a \"X$have_xmodmap\" != \"X\" ]; then\n"
-"		add_modmap\n"
-"	fi\n"
-"}\n"
-"\n"
-"try_Xdummy() {\n"
-"	if [ \"X$have_Xdummy\" = \"X\" ]; then\n"
-"		missing_mesg Xdummy\n"
-"		return\n"
-"	fi\n"
-"	if [ \"X$FD_XDUMMY_RUN_AS_ROOT\" != \"X\" -a \"X$have_root\" = \"X\" ]; then\n"
-"		return\n"
-"	fi\n"
-"\n"
-"	server $have_Xdummy :$N -geometry $geom -depth $depth\n"
-"	\n"
-"	if [ \"X$result\" = \"X1\" -a \"X$have_xprop\" != \"X\" ]; then\n"
-"		(sleep 1; $have_xprop -display :$N -root -f X11VNC_TRAP_XRANDR 8s -set X11VNC_TRAP_XRANDR 1 >/dev/null 2>&1) &\n"
-"		sleep 1\n"
-"	fi\n"
-"}\n"
-"\n"
-"\n"
-"cookie() {\n"
-"	cookie=\"\"\n"
-"	if [ \"X$have_mcookie\" != \"X\" ]; then\n"
-"		cookie=`mcookie`\n"
-"	elif [ \"X$have_md5sum\" != \"X\" ]; then\n"
-"		if [ -c /dev/urandom ]; then\n"
-"			cookie=`dd if=/dev/urandom count=32 2>/dev/null | md5sum | awk '{print $1}'`\n"
-"		elif [ -c /dev/random ]; then\n"
-"			cookie=`dd if=/dev/random count=32 2>/dev/null | md5sum | awk '{print $1}'`\n"
-"		fi\n"
-"		if [ \"X$cookie\" = \"X\" ]; then\n"
-"			r=`random`\n"
-"			cookie=`(echo $r; date; uptime; ps -ealf 2>&1) | md5sum | awk '{print $1}'`\n"
-"		fi\n"
-"	elif [ \"X$have_xauth\" != \"X\" ]; then\n"
-"		if uname | grep SunOS > /dev/null; then\n"
-"			cookie=`$have_xauth list | awk '{print $NF}' | tail -1`\n"
-"		else\n"
-"			cookie=`$have_xauth list | awk '{print $NF}' | tail -n 1`\n"
-"		fi\n"
-"	fi\n"
-"	if [ \"X$cookie\" = \"X\" ]; then\n"
-"		# oh well..\n"
-"		for k in 1 2 3 4\n"
-"		do\n"
-"			r=`random`\n"
-"			cookie=$cookie`printf \"%08x\" \"${r}$$\"`\n"
-"		done\n"
-"	fi\n"
-"	echo \"$cookie\"\n"
-"}\n"
-"\n"
-"auth() {\n"
-"	if [ \"X$have_xauth\" = \"X\" ]; then\n"
-"		exit 1\n"
-"	fi\n"
-"	tmp=/tmp/.xas$$`random`\n"
-"	tmp=`mytmp \"$tmp\"`\n"
-"	touch $tmp\n"
-"	chmod 600 $tmp || exit 1\n"
-"	if [ ! -f $tmp ]; then\n"
-"		exit 1\n"
-"	fi\n"
-"	cook=`cookie`\n"
-"	$have_xauth -f $tmp add :$N . $cook  1>&2\n"
-"	$have_xauth -f $tmp add `hostname`:$N . $cook  1>&2\n"
-"	if [ \"X$CREATE_DISPLAY_EXEC\" != \"X\" ]; then\n"
-"		ls -l $tmp 1>&2\n"
-"		$have_xauth -f $tmp list 1>&2\n"
-"	fi\n"
-"	echo \"$tmp\"\n"
-"}\n"
-"\n"
-"freeport() {\n"
-"	base=$1\n"
-"	if [ \"X$have_uname\" != \"X\" -a \"X$have_netstat\" != \"X\" ]; then\n"
-"		inuse=\"\"\n"
-"		if $have_uname | grep Linux > /dev/null; then\n"
-"			inuse=`$have_netstat -ant | egrep 'LISTEN|WAIT|ESTABLISH|CLOSE' | awk '{print $4}' | sed 's/^.*://'`\n"
-"		elif $have_uname | grep SunOS > /dev/null; then\n"
-"			inuse=`$have_netstat -an -f inet -P tcp | grep LISTEN | awk '{print $1}' | sed 's/^.*\\.//'`\n"
-"		elif $have_uname | grep -i bsd > /dev/null; then\n"
-"			inuse=`$have_netstat -ant -f inet | grep LISTEN | awk '{print $4}' | sed 's/^.*\\.//'`\n"
-"		# add others...\n"
-"		fi\n"
-"	fi\n"
-"	i=0\n"
-"	ok=\"\"\n"
-"	while [ $i -lt 500 ]\n"
-"	do\n"
-"		tryp=`expr $base + $i`\n"
-"		if echo \"$inuse\" | grep -w \"$tryp\" > /dev/null; then\n"
-"			:\n"
-"		elif echo \"$palloc\" | tr ' ' '\\n' | grep -w \"$tryp\" > /dev/null; then\n"
-"			:\n"
-"		else\n"
-"			ok=$tryp\n"
-"			break\n"
-"		fi\n"
-"		i=`expr $i + 1`\n"
-"	done\n"
-"	if [ \"X$ok\" != \"X\" ]; then\n"
-"		base=$ok\n"
-"	fi\n"
-"	if [ \"X$palloc\" = \"X\" ]; then\n"
-"		palloc=\"$base\"\n"
-"	else\n"
-"		palloc=\"$palloc $base\"\n"
-"	fi\n"
-"	echo \"$base\"\n"
-"}\n"
-"\n"
-"\n"
-"depth0=24\n"
-"geom0=1280x1024\n"
-"depth=${depth:-24}\n"
-"geom=${geom:-1280x1024}\n"
-"\n"
-"nolisten=${FD_NOLISTEN:-\"-nolisten tcp\"}\n"
-"\n"
-"if [ \"X$X11VNC_CREATE_GEOM\" != \"X\" -a \"X$FD_GEOM\" = \"X\" ]; then\n"
-"	FD_GEOM=$X11VNC_CREATE_GEOM\n"
-"fi\n"
-"\n"
-"if [ \"X$FD_GEOM\" != \"X\" -a \"X$FD_GEOM\" != \"XNONE\" ]; then\n"
-"	x1=`echo \"$FD_GEOM\" | awk -Fx '{print $1}'`\n"
-"	y1=`echo \"$FD_GEOM\" | awk -Fx '{print $2}'`\n"
-"	d1=`echo \"$FD_GEOM\" | awk -Fx '{print $3}'`\n"
-"	if [ \"X$x1\" != \"X\" -a \"X$y1\" != \"X\" ]; then\n"
-"		geom=\"${x1}x${y1}\"\n"
-"	fi\n"
-"	if [ \"X$d1\" != \"X\" ]; then\n"
-"		depth=\"${d1}\"\n"
-"	fi\n"
-"fi\n"
-"\n"
-"depth=`echo \"$depth\" | head -n 1`\n"
-"geom=`echo \"$geom\" | head -n 1`\n"
-"\n"
-"if echo \"$depth\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"	:\n"
-"else\n"
-"	depth=$depth0\n"
-"fi\n"
-"if echo \"$geom\" | grep '^[0-9][0-9]*x[0-9][0-9]*$' > /dev/null; then\n"
-"	:\n"
-"else\n"
-"	geom=$geom0\n"
-"fi\n"
-"\n"
-"if [ \"X$USER\" = \"X\" ]; then\n"
-"	USER=$LOGNAME\n"
-"fi\n"
-"if [ \"X$USER\" = \"X\" ]; then\n"
-"	USER=`whoami`\n"
-"fi\n"
-"\n"
-"# Set PATH to have a better chance of finding things:\n"
-"SAVE_PATH=$PATH\n"
-"PATH=$PATH:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/dt/bin:/opt/kde4/bin:/opt/kde3/bin:/opt/gnome/bin:/usr/bin:/bin:/usr/sfw/bin:/usr/local/bin\n"
-"\n"
-"have_root=\"\"\n"
-"id0=`id`\n"
-"if id | sed -e 's/ gid.*$//' | grep -w root > /dev/null; then\n"
-"	have_root=\"1\"\n"
-"fi\n"
-"\n"
-"p_ok=0\n"
-"if [ \"`type -p /bin/sh`\" = \"/bin/sh\" ]; then\n"
-"	p_ok=1\n"
-"fi\n"
-"\n"
-"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth xdpyinfo mcookie md5sum xmodmap startkde startlxde dbus-launch gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker enlightenment metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup esddsp konsole gnome-terminal x-terminal-emulator perl startxfce4 startxfce xprop\n"
-"do\n"
-"	p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
-"	eval \"have_$p2=''\"\n"
-"	if type $prog > /dev/null 2>&1; then\n"
-"		bpath=`which $prog | awk '{print $NF}'`\n"
-"		if [ ! -x \"$bpath\" -o -d \"$bpath\" ]; then\n"
-"			if [ \"X$p_ok\" = \"X1\" ]; then\n"
-"				bpath=`type -p $prog | awk '{print $NF}'`\n"
-"			fi\n"
-"			if [ ! -x \"$bpath\" -o -d \"$bpath\" ]; then\n"
-"				bpath=`type $prog | awk '{print $NF}'`\n"
-"			fi\n"
-"		fi\n"
-"		eval \"have_$p2=$bpath\"\n"
-"	fi\n"
-"done\n"
-"if [ \"X$have_xterm\" = \"X\" ]; then\n"
-"	if [ \"X$have_gnome_terminal\" != \"X\" ]; then\n"
-"		have_xterm=$have_gnome_terminal\n"
-"	elif [ \"X$have_konsole\" != \"X\" ]; then\n"
-"		have_xterm=$have_konsole\n"
-"	elif [ \"X$have_x_terminal_emulator\" != \"X\" ]; then\n"
-"		have_xterm=$have_x_terminal_emulator\n"
-"	fi\n"
-"fi\n"
-"\n"
-"if [ \"X$have_nohup\" = \"X\" ]; then\n"
-"	have_nohup=\"nohup\"\n"
-"fi\n"
-"\n"
-"N=`findfree`\n"
-"\n"
-"if [ \"X$N\" = \"X\" ]; then\n"
-"	exit 1\n"
-"fi\n"
-"echo \"trying N=$N ...\" 1>&2\n"
-"\n"
-"if [ \"X$CREATE_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
-"	set | grep \"^have_\" 1>&2\n"
-"fi\n"
-"\n"
-"TRY=\"$1\"\n"
-"if [ \"X$TRY\" = \"X\" ]; then\n"
-"	TRY=Xvfb,Xdummy\n"
-"fi\n"
-"\n"
-"for curr_try in `echo \"$TRY\" | tr ',' ' '`\n"
-"do\n"
-"	result=0\n"
-"	use_xdmcp_query=0\n"
-"	if echo \"$curr_try\" | egrep '[+.-]xdmcp' > /dev/null; then\n"
-"		use_xdmcp_query=1\n"
-"	fi\n"
-"\n"
-"	if [ \"X$X11VNC_XDM_ONLY\" = \"X1\" -a \"X$use_xdmcp_query\" = \"X0\" ]; then\n"
-"		echo \"SKIPPING NON-XDMCP item '$curr_try' in X11VNC_XDM_ONLY=1 mode.\" 1>&2\n"
-"		continue\n"
-"	fi\n"
-"	\n"
-"	curr_try=`echo \"$curr_try\" | sed -e  's/[+.-]xdmcp//'`\n"
-"	curr_try=`echo \"$curr_try\" | sed -e  's/[+.-]redirect//'`\n"
-"\n"
-"	if echo \"$curr_try\"   | grep -i '^Xdummy\\>' > /dev/null; then\n"
-"		try_Xdummy\n"
-"	elif echo \"$curr_try\" | grep -i '^Xdummy$'  > /dev/null; then\n"
-"		try_Xdummy\n"
-"	elif echo \"$curr_try\" | grep -i '^Xvfb\\>'   > /dev/null; then\n"
-"		try_Xvfb\n"
-"	elif echo \"$curr_try\" | grep -i '^Xvfb$'    > /dev/null; then\n"
-"		try_Xvfb\n"
-"	elif echo \"$curr_try\" | grep -i '^Xvnc\\>'   > /dev/null; then\n"
-"		try_Xvnc\n"
-"	elif echo \"$curr_try\" | grep -i '^Xvnc$'    > /dev/null; then\n"
-"		try_Xvnc\n"
-"	elif echo \"$curr_try\" | grep -i '^Xsrv\\>'   > /dev/null; then\n"
-"		try_Xsrv\n"
-"	elif echo \"$curr_try\" | grep -i '^Xsrv$'    > /dev/null; then\n"
-"		try_Xsrv\n"
-"	elif echo \"$curr_try\" | grep -i '^X\\>'      > /dev/null; then\n"
-"		try_X\n"
-"	elif echo \"$curr_try\" | grep -i '^X$'       > /dev/null; then\n"
-"		try_X\n"
-"	fi\n"
-"	if [ \"X$result\" = \"X1\" ]; then\n"
-"		echo \"DISPLAY=:$N\"\n"
-"		$have_xauth -f $authfile extract - :$N\n"
-"		if [ \"X$FD_EXTRA\" != \"X\" ]; then\n"
-"			$have_nohup env DISPLAY=:$N sh -c \"(sleep 2; $FD_EXTRA) &\" 1>&2 &\n"
-"		fi\n"
-"		exit 0\n"
-"	fi\n"
-"done\n"
-"\n"
-"exit 1\n"
-;
-
-char macosx_solid_background[] = 
-"#!/bin/sh\n"
-"\n"
-"#set -xv\n"
-"\n"
-"# This is where the user's screen/slide savers are stored:\n"
-"#\n"
-"SS_DIR=\"$HOME/Library/Screen Savers\"\n"
-"\n"
-"if [ ! -d \"$SS_DIR\" ]; then\n"
-"	exit\n"
-"fi\n"
-"\n"
-"PATH=/bin:/usr/bin:$PATH; export PATH\n"
-"\n"
-"# Check to see if our tarball has already been unpacked.  If it has been\n"
-"# we don't unpack it again.  This lets the user overwrite the png with\n"
-"# a different color if they want.  At some point we could try to create\n"
-"# or own PPM file or something on the fly...\n"
-"#\n"
-"test_file=\"$SS_DIR/VncSolidColor.slideSaver/Contents/Resources/VncSolidColor01.png\"\n"
-"if [ ! -f \"$test_file\" ]; then\n"
-"	# get the line number the tarball data starts at:\n"
-"	N=`grep -n ^void_func \"$0\" | awk -F: '{print $1}' | head -n 1`\n"
-"	if echo \"$N\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
-"		:\n"
-"	else\n"
-"		exit\n"
-"	fi\n"
-"	N=`expr $N + 1`\n"
-"\n"
-"	# pipe the bottom of this file through uudecode and tar:\n"
-"	tail -n +$N \"$0\" | (cd \"$SS_DIR\" || exit 1; uudecode -o /dev/stdout | tar xzf -)\n"
-"fi\n"
-"if [ ! -f \"$test_file\" ]; then\n"
-"	# some problem unpacking...\n"
-"	exit\n"
-"fi\n"
-"\n"
-"# on exit or interrupt, we kill the screen saver we started:\n"
-"#\n"
-"trap 'kill -CONT $SS_PID >/dev/null 2>&1; kill -TERM $SS_PID >/dev/null 2>&1' 0 2 15\n"
-"SS_PID=9999999\n"
-"\n"
-"# start the screensaver and record its pid:\n"
-"#\n"
-"/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background -module VncSolidColor &\n"
-"SS_PID=$!\n"
-"\n"
-"# wait a bit for it to get started...\n"
-"#\n"
-"sleep 10\n"
-"\n"
-"# loop forever waiting for some change:\n"
-"#\n"
-"while [ 1 ]\n"
-"do\n"
-"	if kill -0 $SS_PID >/dev/null 2>&1; then\n"
-"		:\n"
-"	else\n"
-"		# screen saver is gone, exit.\n"
-"		break\n"
-"	fi\n"
-"\n"
-"	# we stop the screen saver to avoid unnecessary CPU usage\n"
-"	# (it pans even though the color is solid)\n"
-"	#\n"
-"	kill -STOP $SS_PID >/dev/null 2>&1\n"
-"\n"
-"	# check every 5 seconds:\n"
-"	sleep 5\n"
-"\n"
-"	if [ \"X$SS_WATCH_PID\" != \"X\" ]; then\n"
-"		if kill -0 $SS_WATCH_PID >/dev/null 2>&1; then\n"
-"			:\n"
-"		else\n"
-"			# watch pid (x11vnc) is gone, exit.\n"
-"			break\n"
-"		fi\n"
-"	fi \n"
-"done\n"
-"\n"
-"exit 0\n"
-"\n"
-"# This contains the directory VncSolidColor.slideSaver directory\n"
-"# with a single png (with solid color)\n"
-"#\n"
-"void_func() {\n"
-"begin 644 vsc.tar.gz\n"
-"M'XL(`$+,#TD``^V706_32!2`714*%)!6@@, at D*9!2,NAMB=V;+9*4Y(X+1%M\n"
-"M&NJT`B'06O;$]=:QC3UIVA,5)T#\\`M0+?P!QWE-7NQ*'E?;`826N'.\"`]@\\L\n"
-"M%YZ3\"*EI32ATLR#FDYR)Q^^]&<][;^9YR3-UWW6LHN_Z(1_!/Z(;JR04N/U#\n"
-"M!-1,IM.J8KL5TW*G[<!AC$5)E66<D3 at 1RXHJ<RBSCW-(I!E1(T2(\"YN>33XB\n"
-"M!V+U^B`F-%B6DOQ?]#U*/!KM0R#LP?]I6<3@?T56).;_0=#?_V6O[O.!ZT3T\n"
-"M<\\>(':S(<I+_L:2F/_A?4B!.TJ(LJQP2]_-%D_C._9^=6FNX\"!P>.;XWF<*\\\n"
-"MF$+$,WW+\\>S)U&)M>OQ2:BHWFAW3YHNU&]42:D<\"JBX69LM%E!H7A'P0N$00\n"
-"MM)J&JK-EO8;`AB\"4*BF46J8TF!\"$5JO%&[$4;_J-6#`2JJ$?D)\"NSX*Q<5#@\n"
-"M+6JE8)B.]6W3 at 5[+,6EN]$AVA:SGBM.%IF>Y1\".KQ/6#!L3H`K%!.BO$CT$J\n"
-"MHB%,/E?R;#\"VG!6Z]SWZ,X3&D:VW'_;JME,\"F7%.H,@,\"?%0%&<%:OA6TR6H\n"
-"M#OU+E6*2[;(%LW+J#@E[#<,\"=)>B8[9ME=^6A(E&8;8:+`2\\JA&N+W66J->^\n"
-"MPHM)^A6C07K%I_V01#1)HVJ8*X9-:NO!#L5\"19M-4M.7_9!VY[?[\\F(>)RH[\n"
-"MMF?09KACQ\"D at 22EA,;8-DQ4Z4905VC&6&_V_,^_KH/_^OT`BOQF:Y/,K@;W4\n"
-"M?QG<W?\\S[/P?!'OQ_S99$?.!9W_2&'W.?X at -M>M_J`324/]#%2A+[/P?!`^J\n"
-"ME9GCHV?BW?!X^8JV`.U&?!T>@=_?<\\:?T!RP\\W-YCGLY7/A[_ at G<'PFNW(@X\n"
-"M[NB)^!KB'F^>@LXQ6KI.=;].6T9(N&M-QURI.0V\",G\"X*^C'.<.<UR]ROSXL\n"
-"MG07A0[0\\5SKTXL\"9DQ,7+Z2OPEA#U\\I:OK:V^<\\+/+2%N*UG.+K^&_=O?F3F\n"
-"MQ,')B=>WWYQ_>_?<ULV1^]+ES:%7QWZP-RX-_W$:_<7=85V[=]V*IH?//WK^\n"
-"M\\EWLYG*IHCTM_'QOA__[YW^W&/N\"3X\"^^0_??%A4U(R\"TZJD0/[C-*O_!\\,W\n"
-"M5_\\7FHYK)11\\JB3])T7II]27'0UXKU^(27>KM?5V;BW[K:A726^?KPF#_!1G\n"
-"?\"\"MC&0P&@\\%@,!@,!H/!8#`8#,;>>0_24O15`\"@`````\n"
-"`\n"
-"end\n"
-"}\n"
-;
-
-#endif /* _SSLTOOLS_H */
diff --git a/ica/x11/x11vnc/tkx11vnc b/ica/x11/x11vnc/tkx11vnc
deleted file mode 100755
index c87d753..0000000
--- a/ica/x11/x11vnc/tkx11vnc
+++ /dev/null
@@ -1,7335 +0,0 @@
-#!/bin/sh
-# the next line restarts using wish. \
-exec wish "$0" "$@"
-catch {rename send {}}
-#
-# Copyright (C) 2004-2009 Karl J. Runge <runge at karlrunge.com>
-# All rights reserved.
-#
-#  This is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This software is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this software; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-#  USA.
-
-#
-# tkx11vnc v0.2
-# This is a simple frontend to x11vnc.  It uses the remote control
-# and query features (-remote/-query aka -R/-Q) to interact with it. 
-# It is just a quick-n-dirty hack (it parses -help output, etc), but
-# it could be of use playing with or learning about the (way too) many
-# parameters x11vnc has.
-# 
-# It can be used to interact with a running x11vnc (see the x11vnc
-# -gui option), or to set the parameters and then start up x11vnc.  
-# 
-
-#
-# Below is a simple picture of how the gui should be laid out and how
-# the menus should be organized.  Most menu items correspond to remote
-# control commands. A trailing ":" after the item name means it is a string
-# to be set rather than a boolean that can be toggled (e.g. the entry
-# box must be used).
-#
-# Some tweak options may be set in the prefix "=" string.
-#	A means it is an "Action" (not a true variable)
-#	R means it is an action only valid in remote mode.
-#	S means it is an action only valid in startup mode.
-#	Q means it is an action worth querying after running.
-#	P means the string can be +/- appended/deleted (string may not
-#         be the same after the remote command)
-#	G means gui internal item
-#	F means can be set via file browse
-#	D means for simple gui
-#	-C:val1,... means it will be a checkbox (radio button)
-#	   the "-" means no other options follow
-#	0 means to skip the item.
-#	-- means add a separator
-#
-#       The =GAL ... =GAL LOFF stuff is to provide submenus.
-#
-
-global env started time_count
-set started ""
-proc dtime {{msg ""}} {
-	global started time_count
-	if {$started == ""} {
-		return
-	}
-	set diff [expr "[exec gtod.bin] - $started"]
-	set diff [format "%.2f" $diff]
-	incr time_count
-	if {$msg == ""} {
-		set msg $time_count
-	}
-	puts -nonewline stderr "$msg $diff " 
-	puts stderr [clock format [clock seconds]]
-}
-
-if [info exists env(X11VNC_GUI_TIME)] {
-	global started time_count
-	set started [exec gtod.bin]
-	set time_count 0
-	dtime "S"
-}
-
-proc set_template {} {
-	global template
-	set template "
-Row: Actions   Clients   Permissions  Keyboard    Pointer  Help
-Row: Displays  Screen    Tuning       Debugging   Misc
-
-Actions
-	=SA start
-	=RA stop
-	--
-	=DSA attach
-	=DRA detach
-	--
-	=RA ping
-	=RA update-all
-	=GAL Settings::
-	=GA save-settings
-	=SFA load-settings:
-	=SA defaults-all
-	=0SA clear-all
-	--
-	=F rc:
-	norc
-	=GAL LOFF
-	-- D
-	=DRA stop+quit 
-	=DGA Quit 
-
-Help
-	=DGA gui
-	=DGA all
-
-Clients
-	=DRQA current:
-	=DF   connect:
-	=DRQA disconnect:
-	--
-	accept:
-	afteraccept:
-	gone:
-	vncconnect
-	zeroconf
-	-- D
-	tightfilexfer
-	ultrafilexfer
-	proxy:
-	=GAL Chat::
-	chatwindow
-	=DRA chaton
-	=DRA chatoff
-	=GAL LOFF
-	=GAL Java-applet::
-	=D http
-	httpdir:
-	httpport:
-	https:
-	httpsredir:
-	enablehttpproxy
-	=GAL LOFF
-
-Displays
-	=D display:
-	=F auth:
-	=S reflect:
-	=D desktop:
-	=D rfbport:
-	=S autoport:
-	=0 gui:
-
-Screen
-	=DRA refresh
-	=RA reset
-	=RA blacken
-	-- D
-	=D scale:
-	scale_cursor:
-	--
-	=D solid
-	solid_color:
-	--
-	=GAL OverlayVisuals::
-	overlay
-	overlay_nocursor
-	8to24
-	8to24_opts:
-	=GAL LOFF
-	=GAL 8-Bit-Color::
-	flashcmap
-	shiftcmap:
-	notruecolor
-	=GAL LOFF
-	=GAL SubWindow::
-	id:
-	sid:
-	=RA id_cmd:
-	=GAL LOFF
-	=GAL ResizeRotate::
-	= xrandr
-	=-C:resize,newfbsize,exit xrandr_mode:
-	rotate:
-	padgeom:
-	=GAL LOFF
-	=GAL Clipping::
-	=P blackout:
-	xinerama
-	clip:
-	=GAL LOFF
-	=GAL Misc-Screen::
-	fixscreen:
-	visual:
-	rawfb:
-	pipeinput:
-	uinput_accel:
-	uinput_reset:
-	uinput_always:
-	24to32
-	=GAL LOFF
-
-Keyboard
-	=D norepeat
-	=D add_keysyms
-	modtweak
-	xkb
-	--
-	capslock
-	skip_lockkeys
-	--
-	skip_keycodes:
-	skip_dups
-	sloppy_keys
-	--
-	=FP remap:
-	clear_mods
-	clear_keys
-	clear_all
-	=RA clear_locks
-
-Pointer
-	=D-C:none,arrow,X,some,most cursor:
-	=-C:1,2,3,4,5,6 arrow:
-	--
-	cursorpos
-	=D nocursorshape
-	--
-	noxfixes
-	cursor_drag
-	=GAL AlphaBlending::
-	noalphablend
-	alphacut:
-	alphafrac:
-	alpharemove
-	=GAL LOFF
-	--
-	buttonmap:
-	--
-	xwarppointer
-	always_inject
-
-Misc
-	=GD-C:full,icon,tray WindowView:
-	=GD simple-gui
-	-- D
-	=GA all-settings
-	=RA remote-cmd:
-	=GAL Selection::
-	=D nosel
-	noprimary
-	nosetprimary
-	noclipboard
-	nosetclipboard
-	seldir:
-	=GAL LOFF
-	=GAL X-ext::
-	xtrap
-	noxrecord
-	=RQA reset_record
-	=GAL LOFF
-	=GAL MacOSX::
-	macnosaver
-	macnowait
-	macwheel:
-	macnoswap
-	macnoresize
-	maciconanim:
-	macmenu
-	=GAL LOFF
-	--
-	6
-	noipv6
-	noipv4
-	--
-	nofb
-	=D nobell
-	nolookup
-	rfbversion:
-	bg
-	=S loop
-	=S loopbg
-	=S sleepin:
-	=-C:ignore,exit sigpipe:
-	=0 inetd
-
-Debugging
-	debug_pointer
-	debug_keyboard
-	=F logfile:
-	=GA show-logfile
-	=GA tail-logfile
-	quiet
-	--
-	=GA show-start-cmd
-	=DG debug_gui
-	=GAL Misc-Debug::
-	debug_xevents
-	debug_xdamage
-	=-C:0,1,2,3 debug_wireframe:
-	debug_scroll
-	debug_tiles
-	debug_grabs
-	debug_sel
-	debug_ncache
-	dbg
-	=GAL LOFF
-
-Permissions
-	=DRQA lock
-	=DRQA unlock
-	=D shared
-	=D forever
-	--
-	=DFP allow:
-	=D localhost
-	=RA allowonce:
-	listen:
-	-- D
-	=D viewonly
-	input:
-	--
-	=GAL Passwords::
-	passwd:
-	viewpasswd:
-	=F passwdfile:
-	=F rfbauth:
-	usepw
-	--
-	unixpw
-	unixpw_list:
-	unixpw_nis
-	unixpw_nis_list:
-	=0 storepasswd
-	=GAL LOFF
-	=GAL SSL::
-	ssl
-	=F ssl_pem:
-	stunnel
-	=F stunnel_pem:
-	=F ssldir:
-	=F sslverify:
-	ssltimeout:
-	--
-	enc:
-	=GAL LOFF
-	=GAL Misc-Perms::
-	safer
-	unsafe
-	=RA noremote
-	=0S alwaysshared
-	=0S nevershared
-	=0S dontdisconnect
-	=SQA deny_all
-	timeout:
-	grabkbd
-	grabptr
-	grabalways
-	grablocal:
-	forcedpms
-	clientdpms
-	noserverdpms
-	noultraext
-	=GAL LOFF
-
-Tuning
-	=D-C:0,1,2,3,4 pointer_mode:
-	input_skip:
-	allinput
-	=D nodragging
-	-- D
-	speeds:
-	=D wait:
-	defer:
-	=D nap
-	screen_blank:
-	--
-	=GAL WireFrame::
-	wireframe
-	wireframe_mode:
-	=-C:never,top,always wirecopyrect:
-	=GAL LOFF
-	=GAL ScrollCopyRect::
-	=-C:never,keys,mouse,always scrollcopyrect:
-	scr_area:
-	scr_skip:
-	scr_inc:
-	scr_keys:
-	scr_term:
-	scr_keyrepeat:
-	scr_parms:
-	=GAL LOFF
-	=GAL XDAMAGE::
-	xdamage
-	xd_area:
-	xd_mem:
-	=GAL LOFF
-	=GAL Ncache::
-	ncache
-	ncache_size:
-	ncache_cr
-	ncache_no_moveraise
-	ncache_no_dtchange
-	ncache_old_wm
-	ncache_no_rootpixmap
-	ncache_keep_anims
-	ncache_pad:
-	=RA ncache_reset_rootpixmap
-	=GAL LOFF
-	--
-	=GAL SharedMemory::
-	noshm
-	flipbyteorder
-	onetile
-	=GAL LOFF
-	=GAL Misc-Tuning::
-	progressive:
-	fs:
-	gaps:
-	grow:
-	fuzz:
-	extra_fbur:
-	wait_ui:
-	setdefer:
-	nowait_bog
-	slow_fb:
-	xrefresh:
-	readtimeout:
-	snapfb
-	threads
-	wmdt:
-	rfbwait:
-	nodpms
-	nofbpm
-	=GAL LOFF
-"
-}
-
-proc set_internal_help {} {
-	global helptext helpall
-
-	# set some internal item help here:
-	set helptext(start) "
-Launch x11vnc with the settings you have prescribed in the gui.
-The x11vnc process is started in an xterm window so you can see the
-output, kill it, etc.
-
-By viewing this help item, the command built so far will be displayed
-in the gui text area.  Have a look.  If you Press start it will be shown
-as well and you will be asked to confirm running it.
-
-If you want to use a saved profile \"rc file\" you can do \"Misc -> rc\" and
-select the file and simply start x11vnc using the rc file.  Alternatively,
-you could first use the \"Actions -> load-settings\" action to load in
-an \"rc file\" and then press \"Actions -> start\" to start up x11vnc
-based on those values.
-"
-	set helptext(stop) "
-The \"Actions -> stop\" action sends a signal to the running x11vnc
-server indicating it should shutdown all connections and exit.
-
-The GUI stays running in case you want to start a new x11vnc or attach
-to another one.  Use \"Actions -> Quit\" if you then want to have the
-gui exit. Use \"Actions -> stop+quit\" to have both exit at once.
-"
-
-	set helptext(show-start-cmd) "
-Displays in the text area what the x11vnc start command (i.e. the command
-run by \"Actions -> start\") looks like for the current values of the
-settings.  This can be done even in the attached state.  Intended for
-debugging the gui.  The help item for \"Actions -> start\" gives the
-same info.
-
-If you want to load in a saved profile \"rc file\" use \"Misc -> rc\"
-and select the file.  \"Actions -> load-settings\" does a similar thing
-with an rc-file, but reading the file and setting the gui variables to
-its values.
-"
-
-	set helptext(debug_gui) "
-Set debug_gui to get more output printed in the text area.
-"
-
-	set helptext(detach) "
-No longer be associated with the x11vnc server.  Switch to the
-non-connected state.  The x11vnc server keeps running: it does not exit.
-
-You can either later reattach to it \"Actions -> attach\", or start
-up a new x11vnc \"Actions -> start\", or exit \"Actions -> Quit\".
-"
-
-	set helptext(attach) "
-Attach to a running x11vnc server, if possible.  Switches to connected
-state if successful.  Usually the channel used to attach is via the X
-display (VNC_CONNECT rootwin property) being polled by the x11vnc server.
-To change or set the X display to use do \"Displays -> display\".
-
-Sometimes the \"-connect /path/to/filename\" is used as the communcation
-channel.  The running x11vnc has to know that \"/path/to/filename\"
-is the communication channel (i.e. it is using the same -connect option).
-"
-
-	set helptext(ping) "
-Check if x11vnc still responds to \"ping\" remote command.
-"
-
-	set helptext(update-all) "
-Query the x11vnc server for the current values of all variables.
-Populate the values into the gui's database.
-
-Normally the gui will refresh this info every time it interacts with
-the x11vnc server (including after a few minutes of inactivity), so one
-doesn't need to use this action very often (unless something else is
-changing the state of the x11vnc server, or new clients have connected,
-etc).
-"
-
-	set helptext(clear-all) "
-Forget any variable settings either entered in by you or set at the
-default.  Basically sets everything to 0 or the string (unset).
-
-This action is only available in \"startup\" mode, not when connected
-to a running x11vnc server (in that case the variable settings reflect
-the state of the running x11vnc).  To detach from a running x11vnc
-server use \"Actions -> detach\"; to completely stop the x11vnc server
-use \"Actions -> stop\".
-"
-
-	set helptext(defaults-all) "
-Reset all variable settings to the default values.  Basically sets
-everything to the default queries \"x11vnc -QD var\" retrieved at startup.
-
-This action is only available in \"startup\" mode, not when connected
-to a running x11vnc server (in that case the variable settings reflect
-the state of the running x11vnc).  To detach from a running x11vnc
-server use \"Actions -> detach\"; to completely stop the x11vnc server
-use \"Actions -> stop\".
-"
-
-	set helptext(load-settings) "
-Read in the \"rc file\" you prescribe in the dialog and then set the
-variables to those in the rc-file.  Any variables not mentioned in the
-rc-file are set to their default value.
-
-You could then do \"Actions -> start\" to start x11vnc with these
-parameters.  Or you could make some further changes to variables
-using the gui before starting x11vnc.
-
-This action is only available in \"startup\" mode, not when connected
-to a running x11vnc server (in that case the variable settings reflect
-the state of the running x11vnc).  To detach from a running x11vnc
-server use \"Actions -> detach\"; to completely stop the x11vnc server
-use \"Actions -> stop\".
-"
-
-	set helptext(save-settings) "
-Construct a ~/.x11vncrc file based on the current settings and
-offer to save it in a file (default ~/.x11vncrc).  If saved in a
-file other than the default, you can access the profile by using
-the \"-rc <filename>\" option when starting x11vnc.
-
-If an rc file entry begins with \"#d\" that means the current
-setting is at the Default value and so you probably want to leave
-it commented out with the \"#\" character.
-
-If an rc file entry begins with \"#?\" that means we think
-you probably do not really want to force the value to this setting.
-
-In either case, feel free to uncomment the line and/or change any
-of the parameter values in the file. 
-"
-
-	set helptext(all-settings) "
-Displays the gui's database of all of the x11vnc server's current
-settings.  Use \"Actions -> update-all\"  or \"Control+R\" to
-refresh this list if it ever gets out of sync.
-"
-
-	set helptext(remote-cmd) "
-Run a remote command (-R) or query (-Q) directly.  Only a few
-remote commands are not on a menu, but for those few you can
-run the command directly this way.  Just enter the command into
-the Entry box when prompted.  Use the prefix \"Q:\" to indicate
-a -Q query.  Examples: \"zero:20,20,100,100\", \"Q:ext_xfixes\"  
-"
-
-	set helptext(stop+quit) "
-Send the stop command to the x11vnc server, then terminate the tkx11vnc gui.
-"
-
-	set helptext(show-logfile) "
-View the current contents of the logfile (if it exists and is accessible
-by the gui process).
-"
-
-	set helptext(tail-logfile) "
-Run the tail(1) command with -f option on the logfile in an xterm.
-(if it exists and is accessible by the gui process).
-"
-
-	set helptext(Quit) "
-Terminate the tkx11vnc gui.  Any x11vnc server will be left running.
-"
-
-	set helptext(current) "
-Shows a menu of currently connected VNC clients on the x11vnc server.
-
-Allows you to find more information about them, change their input
-permissions, or disconnect them.
-
-Note that the File transfer permission only applies to UltraVNC
-file transfer, not TightVNC file transfer.
-
-You will be prompted to confirm any disconnections.
-"
-
-	set helptext(client) "
-After selecting a VNC client from the \"Clients -> current\" menu,
-you will be presented with a dialog that shows the information
-about the VNC client.
-
-You can choose to disconnect the client by clicking on the 
-\"Disconnect\" checkbox and pressing \"OK\".  There will be a
-confirmation dialog to doublecheck.
-
-Alternatively, you can fine tune the VNC client's input permissions
-by selecting any of the Keystrokes, Mouse-Motion, Button-Click,
-Clipboard-Input, or Files checkboxes and pressing \"OK\".  This is like
-the \"-input\" option but on a per-client basis.
-
-To not change any aspects of the VNC client press \"Cancel\".
-"
-
-	set helptext(solid_color) "
-Set the -solid color value.
-"
-
-	set helptext(xrandr_mode) "
-Set the -xrandr mode value.
-"
-
-	set helptext(unixpw_list) "
-Set the -unixpw usernames list value.
-"
-
-	set helptext(unixpw_nis_list) "
-Set the -unixpw_nis usernames list value.
-"
-
-	set helptext(stunnel_pem) "
-Set the -stunnel pem filename value.
-"
-
-	set helptext(ssl_pem) "
-Set the -ssl pem filename value.
-"
-
-	set helptext(wireframe_mode) "
-Set the -wireframe mode string value.
-"
-
-	set helptext(simple-gui) "
-Toggle between menu items corresponding the most basic ones
-and all possible settings.  I.e. toggle between a simple gui
-and one for power users.
-"
-
-	set helptext(Tray) "
-The tray/icon mode (started with \"x11vnc -gui tray ...\", etc.) presents
-a small icon that indicates the status of the running x11vnc server.
-
-Depending on your environment, this icon may be embedded in a system
-tray or applet dock, or simply be a standalone window.  \"-gui tray\"
-will attempt to embed the icon in the system tray, while \"-gui icon\"
-is for a standalone window.  Use \"-gui tray=setpass\" (or icon=setpass)
-to be prompted to set the session password at startup.
-
-When the icon has a light background, that means no VNC viewers are
-currently connected to the VNC display.
-
-When the icon has a dark background (i.e. reverse-video), that means at
-least one VNC viewer is connected to the VNC display.
-
-Moving the mouse pointer over the icon will popup a \"status balloon\"
-indicating the VNC display name and the names and info of any connected VNC
-viewers.  Press the middle mouse button if the balloon does not appear.
-
-Clicking the left or right mouse button on the icon displays a menu
-of actions:
-
-    Properties      - Brings up the Properties dialog to set some basic
-                      parameters.  The full tkx11vnc GUI may be accessed
-                      via the \"Advanced ...\" button.  Press \"Help\"
-                      in the Properties dialog for more info.
-    
-    Help            - Displays this help text.
-    
-    New Client      - Presents an entry box where you type in the name
-                      of a computer that is running a VNC viewer in
-                      \"listen\" mode (e.g. vncviewer -listen).  For a
-                      non-standard listening port use \"host:port\".
-
-                      Pressing \"OK\" will initiate the reverse
-                      connection.  Use a blank hostname to skip it.
-    
-    Disconnect      - Shows a popup menu of connected clients.  Click on
-                      one to disconnect it, or click on \"All Clients\"
-                      disconnect all clients.
-
-    Window View     - Switch between the \"full\" gui (also known as
-                      \"Advanced\"), \"icon\" mode (small icon window with
-                      popups), or \"tray\" mode (small icon embedded in the
-                      system tray).  This is a shortcut for the action:
-                      \"Properties -> Advanced -> Misc -> WindowView\".
-    
-    Stop x11vnc     - Directs the x11vnc server to disconnect all vncviewers
-                      and then exit.  The tray/icon GUI then exits as well.
-
-    Logfile         - Show the logfile if x11vnc is being run with one.
-
-    Custom          - If you have a \$HOME/.x11vnc.gui file each uncommented
-                      line in it becomes an additional menu item for this
-                      menu.  The remote control command is run directly
-                      via \"x11vnc -R <command>\", or if prefixed with 
-                      \"action:\" runs a gui internal action, or if \"sep\"
-                      adds a separator.  Set X11VNC_CUSTOM_GUI to use
-                      a different filename.  Example file contents:
-
-                             scale:3/4
-                             scale:1
-                             scale_cursor:1
-                             sep
-                             action:all-settings
-                             #debug_keyboard
-                             sep
-                             action:Quit
-
-Termination:
-
-If the x11vnc server stops for any reason, the tray/icon gui will exit.
-
-If you delete the tray/icon (e.g. X out button), that is the same
-as the \"Stop x11vnc\" action in the menu. (This will disconnect any
-VNC viewer you are currently using to access the display since the
-x11vnc server is terminated).
-
-To terminate the tray/icon gui window but not the x11vnc server press
-Control-C on the tray/icon window.  You can also do this (and much
-more) via Properties -> Advanced -> Actions -> Quit
-"
-
-	set helptext(NewClient) "
-    New Client      - Presents an entry box where you type in the name
-                      of a computer that is running a VNC viewer in
-                      \"listen\" mode (e.g. vncviewer -listen).  For a
-                      non-standard listening port use \"host:port\".
-
-                      Pressing \"OK\" will initiate the reverse
-                      connection.  Use a blank hostname to skip it, or
-                      delete (\"X-out\") the window.
-    
-"
-
-	set helptext(Properties) "
-The Properties dialog allows you to set some basic parameters of a
-running x11vnc server.  After modifying them press \"OK\" or \"Apply\"
-to apply the changes, or press \"Cancel\" to skip applying them.
-
- Accept Connections:
-
-   Toggles whether VNC viewers are allowed to connect or not.  It corresponds
-   to the \"-R unlock\" and \"-R lock\" remote-control commands.
-
- Ask for Confirmation:
-
-   Toggles whether a popup menu will be presented at the X display when
-   a new VNC viewer attempts to connect.  The person sitting at the X
-   display can choose to accept or reject the connection or accept the
-   connection in ViewOnly mode.  It corresponds to the \"-R accept:popup\"
-   and \"-R accept:\" remote-control commands.
-   
- All Clients ViewOnly:
-
-   Toggles whether the entire VNC desktop is view only.  All clients
-   will only be able to watch when this is set (regardless of how they
-   logged in).  It corresponds to the \"-R viewonly\" and \"-R noviewonly\"
-   remote-control commands.
-   
- Shared:
-
-   Toggles whether multiple simultaneous viewer connections are allowed
-   or not.  It corresponds to the \"-R shared\" and \"-R noshared\"
-   remote-control commands.
-
- Advertise Service (Zeroconf):
-
-   Toggles whether this VNC server should advertize itself via Zeroconf
-   (also called Bonjour, mDNS, and avahi).  Then VNC viewers can then find
-   this service on the local network.  It corresponds to the \"-R zeroconf\"
-   and \"-R nozeroconf\" remote-control commands.
-
- Serve Java Viewer Applet:
-
-   Toggles whether this VNC server should serve up a Java VNC Viewer
-   applet via HTTP on http://hostname:5800/ (or port 5800+n for VNC
-   port 5900+n).  A java enabled Web Browser can then connect to the
-   desktopby VNC.  If SSL is active then the HTTPS URL https://hostname:5900/
-   (etc.) will work as well.  This requires the x11vnc java viewer jar file
-   (shared/x11vnc/classes) to be installed.  It corresponds to the
-   \"-R http\" and \"-R nohttp\" remote commands.
-
- Solid Background Color:
-
-   To improve VNC performance, if this option is set, then x11vnc will try
-   to make the desktop background a solid color (which compresses extremely
-   well compared to photo images, etc.)  It corresponds to the \"-R solid\"
-   and \"-R nosolid\" remote commands.
-
- Password:
-
-   Lets you set the session password viewers may use to gain full access
-   to the display.  This will only work if x11vnc was started with the
-   -gui icon or -gui tray mode.
-   
- ViewOnly Password:
-
-   Lets you set the session password viewers may use to gain view only
-   access to the display.  This will only work if x11vnc was started with
-   the -gui icon or -gui tray mode.
-
-
- NOTE: These \"session\" passwords only last for the current x11vnc
- session (they are not remembered, see the -storepasswd, -passwdfile,
- and -rfbauth x11vnc options for using stored passwords).
-
- If you set \"Password\" to the empty string that makes the \"ViewOnly
- Password\" empty as well and removes the need for any password to log in.
-
- If you set \"ViewOnly Password\" to the empty string that just removes
- the ViewOnly log in aspect: \"Password\" is still required to log in.
-
- - The \"Help\" button shows this help text.
-   
- - The \"Advanced ...\" button replaces the Properties dialog with the full
-   tkx11vnc GUI.  All dynamic settings can be modified in the full GUI.
-
-
-==========================================================================
-
-Don't Lock Yourself Out:
-
-   If you are sitting at the physical X display you cannot get into too
-   much trouble setting the Properties dialog values.
-
-   However IF you are using a VNC Viewer to REMOTELY access the X display
-   some items in the Properties dialog can lock you out of further access:
-
-      \"Accept Connections\"  if you disable this remotely, and
-      accidentally disconnect your VNC viewer then you will not be
-      able to reconnect.
-   
-      \"Ask for Confirmation\"  if you enable this only someone
-      sitting at the X display can confirm any new VNC connections.
-      Furthermore, any current VNC viewers will be blocked while
-      waiting for the confirmation (times out in 120 sec by default). 
-   
-      \"All Clients ViewOnly\"  if you enable this remotely, well
-      you can no longer provide input to disable it.
-   
-   If you do lock yourself out you could log in remotely and start up
-   a second x11vnc and connect to that one to try to fix things in the
-   first one.
-
-   Note that if there are two or more x11vnc's on the same display the
-   use of the GUI may be ill-behaved.  Terminate the second x11vnc as
-   soon as you have fixed the setting in the first one.  Use of a remote
-   control command, e.g. \"x11vnc -R noviewonly\" or \"x11vnc -R unlock\"
-   is a good way to avoid this problem.
-"
-
-	set helptext(all) $helpall
-
-	set helptext(Misc-Tuning:) "
-x11vnc has what seems like hundreds of tuning parameters!  In this
-sub-menu we place some lesser used ones.  Most likely you'll want to
-leave them at their default values, but you can try them out quickly
-with the gui to see if they improve things.
-"
-
-	set helptext(Passwords:) "
-The items in this sub-menu pertain to setting passwords.  Note that x11vnc
-has two types of password files: RealVNC-style ones (you can create them
-with x11vnc -storepasswd or other VNC utility program) you use these
-via -rfbauth; and plain-text file passwords you use via -passwdfile.
-
-Normally passwords cannot be changed by remote-control (e.g. the gui),
-but for the case of the \"Icon\" and \"Tray\" modes this constraint has
-been relaxed.
-
-In neither the RealVNC-style nor the plain-text file cases should the
-password files be readable by users you do not want to access the VNC
-server.  Contrary to popular belief, the  RealVNC-style passwords are
-not encrypted, merely obscured.
-
-x11vnc has the even less secure -passwd and -viewpasswd supplied on
-the command line.  Be careful with these since they could be read by
-users with something like the ps(1) command.  On some operating systems
-x11vnc tries to quickly overwrite them on the command line but it doesn't
-work everywhere.
-
-Regarding ViewOnly passwords (where a VNC client using that password
-can only watch the screen, not interact with it), this is not available
-with -rfbauth, but only with -passwdfile, -passwd, and -viewpasswd.
-"
-
-	set helptext(SSL:) "
-In this sub-menu we provide the options related to SSL encrpytion
-and authentication.
-
-There is a built-in mode (-ssl) using the OpenSSL library, and a 2nd
-using the external stunnel program (-stunnel, that needs to be installed
-on the system).  Either may require or benefit from having PEM certificate
-files specified.
-
-"
-
-	set helptext(Misc-Perms:) "
-In this sub-menu we provide some lesser used permission options.
-
-Regarding -alwaysshared, -nevershared, and -dontdisconnect, you probably
-should never use them and just use x11vnc's -shared and -forever options
-instead (these give basically the same functionality and if you mixed
-them too much unexpected things may happen).
-"
-#'
-
-	set helptext(AlphaBlending:) "
-In this sub-menu we provide some tweak parameters for cursors (little
-icon at the mouse pointer) that have transparency (i.e. an Alpha channel
-in addition to Red, Green, and Blue RGB channels).  For these cursors,
-some of the graphics underneath the cursor is allowed to be blended in:
-e.g. a drop-shadow (a terrible effect IMNSHO).
-
-AlphaBlending for x11vnc is only available when the XFIXES X extension is
-present (since otherwise it cannot see the cursors at all and so applies
-heuristics to show some fake cursors).  AlphaBlending is only a problem
-with x11vnc when the cursors are not opaque.
-
-Opaque cursors (e.g. bitmap or simply colored cursor) are rendered
-correctly by x11vnc.  Only when there is transparency does x11vnc have
-to make some approximation to transform the cursor to be opaque (the
-VNC protocol does not provide for an alpha channel in cursors, only RGB).
-
-The items in this sub-menu let you tweak x11vnc's approximation scheme
-for cursors with transparency.  Hopefully you won't have to use them.
-Certain cursor \"themes\" may require adjustment however.
-"
-#'
-	set helptext(OverlayVisuals:) "
-In this sub-menu are some options that involve fixing color problems
-for \"Overlay\" or \"Multi-Depth\" visuals.  This problem is rare
-since overlay and multi-depth visual video hardware is rare. 
-Some Sun, SGI, and HP machines are known to have them.
-
-The short answer is if you have a multi-depth visual display (e.g.  8 and
-24 bits), and you see messed up colors in x11vnc try the \"-overlay\"
-option on Solaris or IRIX.
-
-A brief Background on pixels, color, and visuals:
-
-   Pixels (picture elements) are kept in video memory as a certain number
-   of bits-per-pixel (bpp).  Most common are 8bpp, 16bpp, and 32bpp.
-   Less common are 24bpp, 4bpp, and 1bpp (monochrome).
-
-   How pixel values (i.e. values of the bits) are rendered into colors on
-   the screen can be done via different \"Recipes\".  These different
-   recipes are referred to as \"visuals\".  E.g. for 8bpp there is
-   a PseudoColor visual that maintains a mapping (that can be changed
-   dynamically) of the pixel values (256 possible ones) into RGB values.
-   Other 8bpp visuals, e.g. StaticGrey and TrueColor have fixed, regular
-   mappings and so provide less variation in kinds of colors.
-
-   A visual's \"depth\" is how many of the pixels are used in the
-   actual recipe.  This may sound wasteful (i.e. not using some of the
-   bits), but for 32bpp (4 billion colors) that is too much and nearly
-   always only 24 for them are used.  The most common Visual seems to
-   be depth 24 TrueColor at 32bpp.  This provides 16 million colors
-   which is more than the number of pixels on most screens (1280x1024 =
-   1.3 million pixels).  Another sometimes used visual that ignores some
-   bits is depth 15 TrueColor at 16bpp.
-
-OK, now, finally, to the Overlay Visuals.  Some hardware (or software
-emulations) allow different depth visuals to be used on the display
-at the same time.  The pixels of windows using different depth visuals
-may overlap.
-
-The most common seems to be both 8 and 24 depth visuals on a 32bpp setup.
-24 of the pixels can be used for one visual and the remaining 8 for the
-other.  This is sometimes referred to as \"8+24\" mode.  Furthermore,
-a speedup is achieved because writing graphics data to, say, the 8bit
-visual does not destroy the image data in the 24bit visual.  Evidently
-popup menus can be done very quickly this way: they use the 8bit visual
-and when the popup goes away the graphics data in the 24bit visual is
-immediately reexposed without having the application redraw it.
-
-Also, some legacy applications can only use 8bpp visuals.  But in these
-days of high color graphics and web browsers one would like the rest
-of the desktop to use depth 24 visuals.  They often work on the multi
-depth visuals.
-
-How does this effect x11vnc?  x11vnc nearly always polls the root window
-(container of all other windows).  The root window will be one depth,
-e.g. 8 or 24.  Any windows using the *other* depth will appear to have
-messed up colors (or just be black or some other solid color) when viewed
-via x11vnc.
-
-How to fix?  Solaris and IRIX provide an API to extract the full snapshot
-of the display with all the colors correct.  It comes to x11vnc as depth
-24 TrueColor.  To enable this use the \"-overlay\" option.  Performance
-may be slower, but if the colors are correct that is a big improvement.
-"
-
-	set helptext(8-Bit-Color:) "
-Some older displays (e.g. with limited Video RAM) use 8 bits-per-pixel
-color.  This allows for only 256 different colors on the screen at the
-same time.  This sometimes leads to problems with viewing these 8bpp
-displays via x11vnc.  This sub-menu has some options that correspond to
-workarounds for this case.  If you can configure the machine to use 16bpp
-it may be worth it to avoid the color problems (e.g. color flashing
-as the 8bit colormap is switched).
-"
-	set helptext(SubWindow:) "
-This sub-menu has a couple options regarding having x11vnc poll a 
-single window, not the entire display.  This way just the window
-is shared.
-
-Note if the application pops up multiple windows they are not tracked
-and shared.  So this is not application sharing.  The application has to
-be very simple (e.g. a simple terminal or the image window on a webcam)
-for this mode to be usable.
-"
-	set helptext(ResizeRotate:) "
-This sub-menu has some options regarding screens that support the X
-Resize, Reflection, and Rotation Extension (RANDR), and one expects screen
-resizing, reflection, or rotation to take place during the x11vnc session.
-This is pretty rare, but x11vnc seems to handle it reasonably well using
-this X extension.
-
-This mode is on by default in -id mode to try to track the changing
-size of the SubWindow.  It is not on by default for full-screen mode
-because of the extra overhead, etc.
-"
-
-	set helptext(WireFrame:) "
-This sub-menu has some options for the x11vnc wireframing speedup scheme.
-
-For x11vnc, Wireframing means to watch for toplevel windows being Opaquely
-Moved or Resized.  When x11vnc detects this, it stops polling the screen
-and simply shows a \"wireframe\" outline of the window as it is being
-moved or resized.  This avoids \"screen polling thrashing\" when the
-screen is changing so rapidly during this period.  For various reasons
-this is usually much faster then letting the window manager do its
-own wireframing (you are encouraged to do Opaque moves and resizes
-when using x11vnc!)
-
-Also, once a moved window is released in its new position, x11vnc uses
-the VNC CopyRect encoding to very efficiently update the VNC viewers
-(each just copies the image data locally).
-
-This sort of scheme was used much in the 1990's on local displays because
-video hardware was slow at the time.  x11vnc tries to use this same trick
-as a speedup for its activities (the network is much slower than video
-hardware writes, and the video hardware reads that x11vnc uses to poll
-the screen are still slow today).
-"
-#'"
-
-	set helptext(Safe:) "
-In this sub-menu are some options for making x11vnc operations
-more, or less, safe.  E.g. disable the running of external commands, etc.
-
-You can also turn off the Remote control channel (NOTE that doing that
-will disable the GUI from being able to communicate with x11vnc).
-"
-
-	set helptext(X-ext:) "
-In this sub-menu are a few rarely used options regarding some X extensions
-used by x11vnc.
-"
-	set helptext(Clipping:) "
-In this sub-menu are some options regarding clipping or blacking out
-portions of the Screen.  E.g. under XINERAMA when the multiple monitors
-are not the same size.
-
-"
-	set helptext(Misc-Screen:) "
-In this sub-menu are some little used options modifying aspects of
-the screen source.
-"
-
-	set helptext(Settings:) "
-In this sub-menu are some options for saving and loading option settings.
-The default file to store settings in is ~/.x11vncrc, but you can save
-different \"profiles\" in other files for later use.
-
-"
-	set helptext(Java-applet:) "
-In this sub-menu are some options for running the built-in HTTP server
-that delivers the TightVNC Java VNC Viewer applet (VncViewer.jar) to
-clients.  The viewer runs in their Web browser.
-
-The default port listened on is 5800, so the URL is typically:
-
-	http://hostname:5800/
-
-but this can be altered by -httpport, etc.
-"
-
-	set helptext(Chat:) "
-In this sub-menu are some options for enabling a local chat window
-and starting or stopping the current chat.  This is the UltraVNC 
-Text Chat support in x11vnc.
-"
-
-	set helptext(ScrollCopyRect:) "
-This sub-menu has some options for the x11vnc Scroll detection and
-CopyRect speedup scheme.
-
-For this mode, x11vnc \"spies\" on communication between the X server and
-applications using the RECORD extension.  It looks for various patterns
-to detect a scrolled window.  This only works for some applications,
-fortunately some important ones.
-
-Once the scroll is detected it uses the VNC CopyRect encoding for a
-big speedup.  Screen polling is also sped up for this scheme.
-
-There are many tweakable parameters for this mode and they are described
-in the sub-menu items.
-"
-
-	set helptext(XDAMAGE:) "
-The DAMAGE X extension allows the X server to send signals to x11vnc
-telling it which regions of the screen have been changed.  This improves
-x11vnc's performance markedly.  The DAMAGE extension must be available
-on the display for this to work.
-
-Unfortunately DAMAGE cannot be trusted completely for the changed regions,
-because often the reported changed region is much larger than the actual
-changed regions.  Nevertheless, x11vnc uses the DAMAGE information very
-effectively as hints to improve its performance.
-
-The items in the sub-menu allow tweaking x11vnc's DAMAGE algorithm.
-"
-
-	set helptext(Ncache:) "
-A simple client-side (viewer) caching scheme is enabled with the
-\"-ncache n\" option.  It simply uses \"n\" framebuffer sized areas
-below the actual display for caching window pixel data.  
-
-Drawbacks are it uses a lot of RAM (roughly n times more), and the
-pixels cache area is visible in the viewers.
-
-The items in the sub-menu allow tweaking x11vnc's -ncache algorithm.
-"
-
-	set helptext(SharedMemory:) "
-This sub-menu provides some options regarding SYSV shared memory usage
-(shm) by x11vnc.  Usually you want shm turned on because the x11vnc
-process is nearly always running on the same machine the X server process
-is running on.  SharedMemory gives a performance speedup.  However, if you
-need to modify this scenario for special usage these options allow you to.
-"
-
-	set helptext(Misc-Debug:) "
-This sub-menu contains a lot of debugging parameters usually used
-for debugging x11vnc itself.  This is unlike the -debug_pointer and
--debug_keyboard options that are useful in learning information, quirks,
-etc. about your local display and environment.
-"
-
-	set helptext(Selection:) "
-This sub-menu contains some options centering around the Selection
-(also referred to as the Clipboard, Cutbuffers, etc).  x11vnc will try
-to exchange the selections between the VNC viewers and the X server.
-You can adjust that behavior with these options.
-"
-
-	set helptext(WindowView) "
-Set the Window View Mode for the gui.  There are three modes:
-
-  - full:  Presents the full gui (Actions, Clients, etc, buttons,
-           and the Text area and Set/Entry box).
-
-  - icon:  Presents a small icon instead of the full gui.  Moving
-           the mouse over it shows the VNC display name and any
-           connected clients.  Clicking on the icon pops up a menu
-           of actions to perform.  Among them is \"Properties\" that
-           allows setting more parameters.  Clicking on \"Advanced\"
-           in \"Properties\" brings up the full gui.
-
-  - tray:  Attempt to embed the small icon in the system tray.  If
-           this fails it will resort to icon mode where the small icon
-           is a standalone window.
-
-Note that in \"full\" mode if you delete the full gui window the gui
-terminates (but the x11vnc server keeps running).  However under \"icon\"
-or \"tray\" mode if you bring up the full gui window via \"Properties ->
-Advanced\" and then delete it the gui does NOT terminate.
-
-Also note that by default in \"icon\" mode if you delete the icon
-window both the gui *and* the x11vnc server terminate.
-"
-
-	set helptext(gui) "
-tkx11vnc is a simple frontend to x11vnc.  Nothing fancy, it merely
-provides an interface to each of the many x11vnc command line options and
-remote control commands.  See \"Help -> all\" for much info about x11vnc.
-
-For a simplier gui, run x11vnc in \"tray\" or \"icon\" mode such as
-\"-gui tray\", \"-gui icon\", or \"-gui tray=setpass\".  In that
-mode the full gui is only available under \"Advanced ...\".
-
-Also, \"-gui ez\" will show fewer menu items (toggle via Misc -> simple_gui)
-
-All menu items have a (?) button one can click on to get more information
-about the option or command.
-
-There are two states tkx11vnc can be in:
-
-	1) Available to control a running x11vnc process.
-
-	2) Getting ready to start a x11vnc process.
-
-Most people will just use state 1).
-
-In state 1) the Menu items available in the menus are those that
-correspond to the x11vnc \"remote control\" commands.  See the -remote
-entry under \"Help -> all\" for a complete list.  Also available is
-the \"Actions -> stop\" item to shut down the running x11vnc server,
-thereby changing to state 2).  There are other actions available too.
-
-In state 2) the Menu items available in the menus (\"Actions\", \"Clients\",
-etc.) are those that correspond to command line options used in starting
-an x11vnc process, and the \"Actions -> start\" item executes
-x11vnc thereby changing to state 1).  To see what x11vnc startup command
-you have built so far, look at the (?) help for  \"Actions -> start\"
-and it will show you what the command looks like.
-
-There is much overlap between the menu items available in state 1)
-and state 2), but it is worth keeping in mind it is not 100%.
-For example, you cannot set passwords or password files in state 1).
-(update: simple password setting is now allowed in \"tray\" or \"icon\" mode).
-
-
-Also note that there may be *two* separate X displays involved, not just
-one:  1) the X display x11vnc will be polling (and making available to
-VNC viewers), and 2) the X display this GUI is intended to display on.
-
-For example, one might use ssh to access the remote machine where the
-GUI would display on :11 and x11vnc would poll display :0.  By default
-the gui will display on the value in the DISPLAY env. variable followed
-by the value from the -display option.  To override this, use something
-like: \"-gui otherhost:0\", etc.
-
-
-GUI components: 
---- ----------
-
-1) At the top of the gui is a info text label where information will
-   be posted, e.g. when traversing menu items text indicating how to get
-   help on the item and its current value will be displayed.
-
-2) Below the info label is the area where the menu buttons, \"Actions\",
-   \"Clients\", etc., are presented.  If a menu item has a checkbox,
-   it corresponds to a boolean on/off variable.  Otherwise it is
-   either a string variable, or an action not associated with a
-   variable (for the most part).
-
-3) Below the menu button area is a label indicating the current x11vnc
-   X display being polled and the corresponding VNC display name.  Both
-   will be \"(*none*)\" when there is no connection established.
-
-4) Below the x11 and vnc displays label is a text area there scrolling
-   information about actions being taken and commands being run is displayed.
-   To scroll click in the area and use PageUp/PageDown or the arrow keys.
-
-5) At the bottom is an entry area.  When one selects a menu item that
-   requires supplying a string value, the label will be set to the
-   parameter name and one types in the new value.  Then one presses the
-   \"OK\" button or presses \"Enter\" to set the value.  Or you can press
-   \"Cancel\" or \"Escape\" to avoid changing the variable.
-
-   Many variables are boolean toggles (for example, \"Permissions ->
-   viewonly\") or Radio button selections.  Selecting these menu items
-   will NOT activate the entry area but rather toggle the variable
-   immediately.
-
-
-CASCADES BUG: There is a bug not yet worked around for the cascade menus
-where the (?) help button gets in the way.  To get the mouse over to
-the cascade menu click and release mouse to activate the cascade, then
-you can click on its items.  Dragging with a mouse button held down will
-not work (sorry!).
-
-
-Key Bindings:
-
-	In the Text Area: Control-/ selects all of the text.
-	Anywhere: Control-d invokes \"Actions -> detach\"
-	Anywhere: Control-a invokes \"Actions -> attach\"
-	Anywhere: Control-p invokes \"Actions -> ping\"
-	Anywhere: Control-u and Control-r invoke \"Actions -> update-all\"
-"
-
-set under_wally "
-Misc:
-
-Since x11vnc has so many settings and to avoid further confusion,
-the libvncserver options:
-
-	-alwaysshared
-	-nevershared
-	-dontdisconnect
-
-are not available for changing in a running x11vnc (even though it
-is feasible).  These options overlap with the x11vnc options -shared
-and -forever which are hopefully enough for most usage.  They may be
-specified for x11vnc startup if desired.
-
-"
-
-global beginner_mode
-if {$beginner_mode} {
-	set helptext(gui) "
-tkx11vnc is a simple frontend to x11vnc.  It is currently running in
-\"ez\" or \"simple\" mode.  For many more options run it in normal
-mode by toggling \"Misc -> simple_gui\".
-
-All menu items have a (?) button one can click on to get more information
-about the option or command.
-
-GUI components: 
---- ----------
-
-1) At the top of the gui is a info text label where information will
-   be posted, e.g. when traversing menu items text indicating how to get
-   help on the item and its current value will be displayed.
-
-2) Below the info label is the area where the menu buttons, \"Actions\",
-   \"Clients\", etc., are presented.  If a menu item has a checkbox,
-   it corresponds to a boolean on/off variable.  Otherwise it is
-   either a string variable, or an action not associated with a
-   variable (for the most part).
-
-3) Below the menu button area is a label indicating the current x11vnc
-   X display being polled and the corresponding VNC display name.  Both
-   will be \"(*none*)\" when there is no connection established.
-
-4) Below the x11 and vnc displays label is a text area there scrolling
-   information about actions being taken and commands being run is displayed.
-   To scroll click in the area and use PageUp/PageDown or the arrow keys.
-
-5) At the bottom is an entry area.  When one selects a menu item that
-   requires supplying a string value, the label will be set to the
-   parameter name and one types in the new value.  Then one presses the
-   \"OK\" button or presses \"Enter\" to set the value.  Or you can press
-   \"Cancel\" or \"Escape\" to avoid changing the variable.
-
-   Many variables are boolean toggles (for example, \"Permissions ->
-   viewonly\") or Radio button selections.  Selecting these menu items
-   will NOT activate the entry area but rather toggle the variable
-   immediately.
-
-CASCADES BUG: There is a bug not yet worked around for the cascade menus
-where the (?) help button gets in the way.  To get the mouse over to
-the cascade menu click and release mouse to activate the cascade, then
-you can click on its items.  Dragging with a mouse button held down will
-not work (sorry!).
-
-"
-}
-
-}
-
-proc center_win {w} {
-	wm withdraw $w
-	set x [expr [winfo screenwidth  $w]/2 - [winfo reqwidth  $w]/2];
-	set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2];
-	wm geometry $w +$x+$y
-	wm deiconify $w
-	update
-}
-
-proc textwidth {text} {
-	set min 0;
-	foreach line [split $text "\n"] {
-		set n [string length $line]
-		if {$n > $min} {
-			set min $n
-		}
-	}
-	return $min
-}
-
-proc textheight {text} {
-	set count 0;
-	foreach line [split $text "\n"] {
-		incr count
-	}
-	return $count
-}
-
-proc set_name {name} {
-	global full_win icon_mode
-	global saved_set_name
-
-	if {![info exists saved_set_name]} {
-		set saved_set_name "tkx11vnc"
-	}
-	if {$name == "RESTORE"} {
-		set name $saved_set_name
-	} else {
-		set saved_set_name $name
-	}
-	if {![info exists full_win]} {
-		return
-	}
-	set w "."
-	if {$icon_mode} {
-		wm title    $w "$name"
-		wm iconname $w "$name"
-		set w $full_win
-	}
-	wm title    $w "$name"
-	wm iconname $w "$name"
-}
-
-proc make_toplevel {w {title ""}} {
-	catch {destroy $w}
-	toplevel  $w;
-	bind $w <Escape> "destroy $w"
-	if {$title != ""} {
-		wm title    $w $title
-		wm iconname $w $title
-	}
-}
-
-proc textwin {name title text {entry ""}} {
-	global max_text_height max_text_width
-	global bfont ffont
-
-	set width  [textwidth $text]
-	incr width
-	if {$width > $max_text_width} {
-		set width $max_text_width
-	}
-	set height [textheight $text]
-	if {$height > $max_text_height} {
-		set height $max_text_height
-	}
-
-	set w ".text_$name"
-	make_toplevel $w $title
-
-	frame     $w.f -bd 0;
-	pack      $w.f -fill both -expand 1
-	text      $w.f.t -width $width -height $height -setgrid 1 -bd 2 \
-			-yscrollcommand "$w.f.y set" -relief ridge \
-			-font $ffont;
-	scrollbar $w.f.y -orient v -relief sunken -command "$w.f.t yview";
-	button    $w.f.b -text "Dismiss" -command "destroy $w" -font $bfont \
-			-pady 2
-
-	$w.f.t insert 1.0 $text;
-
-	bind $w <Enter> "focus $w.f.t"
-
-	if {$entry != ""} {
-		# varname+Label Name
-		set list [split $entry "+"]
-		set varname [lindex $list 0]
-		set labname [lindex $list 1]
-		frame $w.f.ef -bd 1 -relief groove
-		label $w.f.ef.l -text "$labname" -anchor w -font $bfont
-		entry $w.f.ef.e -relief sunken -font $ffont \
-			-textvariable $varname
-		button $w.f.ef.b -text "OK" -font $bfont \
-			-command "set ${varname}_ok 1; destroy $w" 
-		bind $w.f.ef.e <KeyPress-Return> "set ${varname}_ok 1; destroy $w"
-		
-		pack $w.f.ef.l -side left
-		pack $w.f.ef.e -side left -fill x -expand 1
-		pack $w.f.ef.b -side right
-	}
-
-	wm withdraw $w
-	pack $w.f.b -side bottom -fill x 
-	if {$entry != ""} {
-		pack $w.f.ef -side bottom -fill x 
-		bind $w <Enter> "focus $w.f.ef.e"
-		$w.f.ef.e icursor end
-	} else {
-		bind $w <Enter> "focus $w.f.t"
-	}
-	pack $w.f.y -side right -fill y;
-	pack $w.f.t -side top -fill both -expand 1;
-	update
-
-	center_win $w
-
-	return $w
-}
-
-proc active_when_connected {item} {
-	global helpremote helptext
-	global icon_mode
-
-	if {$icon_mode} {
-		if {$item == "passwd"} {
-			return 1
-		}
-		if {$item == "viewpasswd"} {
-			return 1
-		}
-	}
-
-	if {[opt_match G $item]} {
-		return 1
-	} elseif {[opt_match R $item]} {
-		return 1
-	} elseif {[opt_match S $item]} {
-		return 0
-	} elseif {[is_action $item]} {
-		if {[opt_match R $item]} {
-			return 1
-		} else {
-			return 0
-		}
-	} elseif {[info exists helpremote($item)]} {
-		return 1
-	} else {
-		return 0
-	}
-}
-
-proc active_when_starting {item} {
-	global helpremote helptext beginner_mode
-
-	if {$beginner_mode} {
-		if {[opt_match G $item]} {
-			return 1
-		}
-		if {$item == "display"} {
-			return 1
-		}
-		if {$item == "attach"} {
-			return 1
-		}
-		if {$item == "debug_gui"} {
-			return 1
-		}
-		return 0
-	}
-
-	if {[opt_match G $item]} {
-		return 1
-	} elseif {[opt_match S $item]} {
-		return 1
-	} elseif {[opt_match R $item]} {
-		return 0
-	} elseif {[is_action $item]} {
-		if {[opt_match S $item]} {
-			return 1
-		} else {
-			return 0
-		}
-	} elseif {[info exists helptext($item)]} {
-		return 1
-	} else {
-		return 0
-	}
-}
-
-proc help_win {item} {
-	global helptext helpremote menu_var
-	global query_ans query_aro
-	global beginner_mode
-
-	set ok 0
-	set text "Help on $item:\n\n"
-
-	if {$item == "NewClient"} {
-		;
-	} elseif {[is_gui_internal $item]} {
-		if {$item != "gui" && $item != "all" && $item != "Misc-Tuning:" \
-		    && $item != "Properties" && $item != "Tray"} {
-			append text "    + Is a gui internal Action (cannot be set).\n";
-		}
-	} elseif {[is_action $item]} {
-		append text "    + Is a remote control Action (cannot be set).\n";
-	} elseif {[active_when_connected $item]} {
-		append text "    + Can be changed in a running x11vnc.\n";
-	} else {
-		append text "    - Cannot be changed in a running x11vnc.\n";
-	}
-	if {$item == "NewClient"} {
-		;
-	} elseif {[is_gui_internal $item]} {
-		;
-	} elseif {[active_when_starting $item]} {
-		append text "    + Can be set at x11vnc startup.\n";
-	} else {
-		if {! $beginner_mode} {
-			append text "    - Cannot be set at x11vnc startup.\n";
-		}
-	}
-	append text "\n"
-
-	if {[info exists helptext($item)]} {
-		append text "\n"
-		if {[is_gui_internal $item]} {
-			append text "==== x11vnc help: ====\n";
-		} else {
-			append text "==== x11vnc startup option help: ====\n";
-		}
-		append text "\n"
-		append text $helptext($item)
-		append text "\n"
-		set ok 1
-	}
-
-	if {[info exists helpremote($item)]} {
-		append text "\n"
-		append text "==== x11vnc remote control help: ====\n";
-		append text "\n"
-		append text $helpremote($item)
-		set ok 1
-	}
-
-	if {![is_action $item] && [info exists menu_var($item)]} {
-		global unset_str
-		append text "\n\n"
-		append text "==== current $item value: ====\n";
-		append text "\n"
-
-		if {$item == "passwd" || $item == "viewpasswd"} {
-			;
-		} elseif {$menu_var($item) == ""} {
-			append text "$unset_str\n"
-		} else {
-			append text "$menu_var($item)\n"
-		}
-		if {$item == "http" || $item == "httpdir" || $item == "httpport"} {
-			global vnc_url;
-			append text "\nURL: $vnc_url\n"
-		}
-	}
-
-	if {$item == "start"} {
-		set str [get_start_x11vnc_txt]
-		append_text "$str\n"
-#		append text "\nPossible \$HOME/.x11vncrc settings for this command:\n\n"
-#		set rctxt [get_start_x11vnc_cmd 1]
-#		append text "$rctxt\n"
-	}
-
-	regsub -all { } $item " " name
-
-	if {$ok} {
-		textwin $name "x11vnc help: $item" "$text";
-	}
-	return $ok
-}
-
-proc parse_help {} {
-	global env x11vnc_prog;
-	global helpall helptext;
-
-	set helppipe [open "| $x11vnc_prog -help" "r"];
-	if {$helppipe == ""} {
-		puts stderr "failed to run $x11vnc_prog -help";
-		exit 1;
-	}
-
-	set sawopts 0;
-	set curropt "";
-	while {[gets $helppipe line] > -1} {
-		append helpall "$line\n"	
-
-		# XXX
-		if {[regexp {^Options:} $line]} {
-			set sawopts 1;
-			continue;
-		}
-		# XXX
-		if {[regexp {^These options} $line]} {
-			continue;
-		}
-		# tweak aliases:
-		regsub {^-zeroconf} $line "-zero_conf" line
-		regsub {^-avahi   } $line "-zeroconf" line
-
-		if {! $sawopts} {
-			continue;
-		}
-		if {[regexp {^-([0-9A-z_][0-9A-z_]*)} $line match name]} {
-			set allnames($name) 1;
-			if {"$curropt" != "no$name" && "no$curropt" != "$name"} {
-				set curropt $name;
-				set helptext($curropt) "$line\n";
-			} else {
-				append helptext($curropt) "$line\n";
-			}
-		} elseif {$curropt != ""} {
-			append helptext($curropt) "$line\n";
-		}
-	}
-	foreach name [array names allnames] {
-		if {[regexp {^no} $name]} {
-			regsub {^no} $name "" pair
-		} else {
-			set pair "no$name"
-		}
-		if {[info exists helptext($name)]} {
-			if ![info exists helptext($pair)] {
-				set helptext($pair) $helptext($name);
-			}
-		} elseif {[info exists helptext($pair)]} {
-			if ![info exists helptext($name)] {
-				set helptext($name) $helptext($pair);
-			}
-		}
-	}
-
-	set_internal_help
-}
-
-proc tweak_both {new old} {
-	tweak_help $new $old
-	tweak_remote_help $new $old
-}
-
-proc tweak_remote_help {new old} {
-	global helpremote
-	if ![info exists helpremote($new)] {
-		if {[info exists helpremote($old)]} {
-			set helpremote($new) $helpremote($old)
-		}
-	}
-}
-
-proc tweak_help {new old} {
-	global helptext
-	if ![info exists helptext($new)] {
-		if {[info exists helptext($old)]} {
-			set helptext($new) $helptext($old)
-		}
-	}
-}
-
-proc parse_remote_help {} {
-	global helpremote helptext help_indent remote_name;
-
-	set sawopts 0;
-	set curropt "";
-	set possopts "";
-	set offset [expr $help_indent - 1];
-	foreach line [split $helptext(remote) "\n"] {
-		
-		set line [string range $line $offset end];
-
-		# XXX
-		if {[regexp {^The following -remote/-R commands} $line]} {
-			set sawopts 1;
-			continue;
-		}
-		# XXX
-		if {[regexp {^The vncconnect.*command} $line]} {
-			set sawopts 0;
-		}
-
-		if {! $sawopts} {
-			continue;
-		}
-		if {[regexp {^([0-9A-z_][0-9A-z_:]*)} $line match name]} {
-			regsub {:.*$} $name "" popt
-			lappend possopts $popt
-			if {"$curropt" != "no$name" && "no$curropt" != "$name"} {
-				set curropt $name;
-				regsub {:.*$} $curropt "" curropt
-				set remote_name($curropt) $name
-				set helpremote($curropt) "$line\n";
-			} else {
-				append helpremote($curropt) "$line\n";
-			}
-		} elseif {$curropt != ""} {
-			append helpremote($curropt) "$line\n";
-		}
-	}
-
-	foreach popt $possopts {
-		if {[info exists helpremote($popt)]} {
-			continue
-		}
-		if {[regexp {^no} $popt]} {
-			regsub {^no} $popt "" try
-		} else {
-			set try "no$popt"
-		}
-		if {[info exists helpremote($try)]} {
-			set helpremote($popt) $helpremote($try)
-		}
-	}
-}
-
-proc parse_query_help {} {
-	global query_ans query_aro query_ans_list query_aro_list helptext;
-
-	set sawans 0;
-	set sawaro 0;
-	set ans_str ""
-	set aro_str ""
-
-	foreach line [split $helptext(query) "\n"] {
-
-		if {! $sawans && [regexp {^ *ans=} $line]} {
-			set sawans 1
-		}
-		if {! $sawans} {
-			continue
-		}
-
-		if {[regexp {^ *aro=} $line]} {
-			set sawaro 1
-		}
-		if {$sawaro && [regexp {^[ 	]*$} $line]} {
-			set sawans 0
-			break
-		}
-
-		regsub {ans=} $line "" line
-		regsub {aro=} $line "" line
-		set line [string trim $line]
-
-		if {$sawaro} {
-			set aro_str "$aro_str $line"
-		} else {
-			set ans_str "$ans_str $line"
-		}
-	}
-
-	regsub -all {  *} $ans_str " " ans_str
-	regsub -all {  *} $aro_str " " aro_str
-
-	set ans_str [string trim $ans_str]
-	set aro_str [string trim $aro_str]
-	set query_ans_list [split $ans_str]
-	set query_aro_list [split $aro_str]
-
-	foreach item $query_ans_list {
-		if {[regexp {^[ 	]*$} $item]} {
-			continue
-		}
-		set query_ans($item) 1
-	}
-	foreach item $query_aro_list {
-		if {[regexp {^[ 	]*$} $item]} {
-			continue
-		}
-		set query_aro($item) 1
-	}
-}
-
-proc in_debug_mode {} {
-	global menu_var
-	if {![info exists menu_var(debug_gui)]} {
-		return 0
-	}
-	return $menu_var(debug_gui)
-}
-
-# Menubar utilities:
-proc menus_state {state} {
-	global menu_b
-
-	foreach case [array names menu_b] {
-		set menu_button $menu_b($case)
-		if {![winfo exists $menu_button]} {
-			continue
-		}
-		$menu_button configure -state $state
-	}
-}
-
-proc menus_enable {} {
-	global menus_disabled
-
-	menus_state "normal"
-	set menus_disabled 0
-}
-
-proc menus_disable {} {
-	global menus_disabled
-
-	set menus_disabled 1
-	menus_state "disabled"
-}
-
-# Entry box utilities:
-proc entry_state {x state} {
-	global entry_box entry_label entry_ok entry_help entry_skip entry_browse
-	global old_labels
-	if {$x == "all"} {
-		if {!$old_labels} {
-			$entry_label configure -state $state
-		}
-		$entry_box    configure -state $state
-		$entry_ok     configure -state $state
-		$entry_skip   configure -state $state
-		$entry_help   configure -state $state
-		$entry_browse configure -state $state
-	} elseif {$x == "label"} {
-		if {!$old_labels} {
-			$entry_label configure -state $state
-		}
-	} elseif {$x == "box"} {
-		$entry_box    configure -state $state
-	} elseif {$x == "ok"} {
-		$entry_ok     configure -state $state
-	} elseif {$x == "skip"} {
-		$entry_skip   configure -state $state
-	} elseif {$x == "help"} {
-		$entry_help   configure -state $state
-	} elseif {$x == "browse"} {
-		$entry_browse configure -state $state
-	}
-}
-
-proc entry_enable {{x "all"}} {
-	entry_state $x normal
-}
-
-proc entry_disable {{x "all"}} {
-	entry_state $x disabled
-}
-
-proc entry_browse_button {{show 1}} {
-	global entry_browse
-	if {$show} {
-		pack $entry_browse -side left
-	}  else {
-		pack forget $entry_browse
-	}
-}
-proc entry_focus {} {
-	global entry_box
-	focus $entry_box
-}
-proc entry_select {} {
-	global entry_box
-	$entry_box selection range 0 end
-}
-proc entry_get {} {
-	global entry_box
-	return [$entry_box get]
-}
-proc entry_insert {str} {
-	global entry_box
-	entry_delete
-	$entry_box insert end $str
-	$entry_box icursor end
-}
-proc entry_delete {} {
-	global entry_box
-	$entry_box delete 0 end
-}
-
-
-# Utilities for remote control and updating vars.
-
-proc push_new_value {item name new {query 1}} {
-	global menu_var always_update remote_output query_output
-	global query_result_list
-
-	set debug [in_debug_mode]
-
-	set getout 0
-	set print_getout 0;
-
-	set do_query_all 0
-
-	set newnew ""
-	if {$item == "disconnect"} {
-		set newnew "N/A"
-		set do_query_all 1
-	} elseif {$always_update} {
-		set do_query_all 1
-	}
-
-	if {$item == "remote-cmd"} {
-		# kludge for arbitrary remote command:
-		if {[regexp {^Q:} $new]} {
-			# extra kludge for Q:var to mean -Q var
-			regsub {^Q:} $new "" new
-			set qonly 1
-		} else {
-			set qonly 0
-		}
-		# need to extract item from new:
-		set qtmp $new
-		regsub {:.*$} $qtmp "" qtmp
-		if {$qonly} {
-			set rargs [list "-Q" "$qtmp"]
-			set print_getout 1
-			set qargs ""
-		} else {
-			set rargs [list "-R" "$new"]
-			set qargs ""
-		}
-		set getout 1
-
-	} elseif {[value_is_string $item]} {
-		# string var:
-		set rargs [list "-R" "$name:$new"]
-		set qargs [list "-Q" "$name"]
-	} else {
-		# boolean var:
-		set rargs [list "-R" "$name"]
-		set qargs [list "-Q" "$name"]
-	}
-
-	if {! $query && ! $always_update} {
-		set getout 1
-	} elseif {$item == "noremote"} {
-		set getout 1
-	} elseif {[is_action $item] && ![opt_match Q $item] && $rargs != ""} {
-		set getout 1
-	} elseif {[regexp {^(sid|id)$} $item] && ![regexp {^0x} $new]} {
-		set getout 1
-	}
-
-	set remote_output ""
-	set query_output ""
-
-	if {!$debug} {
-		if [regexp {passwd} $rargs] {
-			append_text "x11vnc ..."
-		} else {
-			append_text "x11vnc $rargs ..."
-		}
-	}
-
-	if {$getout} {
-		set remote_output [run_remote_cmd $rargs]
-		if {$print_getout} {
-			append_text "\t$remote_output"
-		}
-		append_text "\n"
-		return
-	}
-
-	if {$do_query_all} {
-		set all [all_query_vars]
-		set qargs [list "-Q" $all]
-
-		global last_query_all_time
-		set last_query_all_time [clock seconds]
-	}
-
-	set rqargs [concat $rargs $qargs]
-
-	set query [run_remote_cmd $rqargs]
-	set query_output $query
-
-	set query_result_list ""
-
-	if {$newnew != ""} {
-		set new $newnew
-	}
-
-	if {![see_if_ok $query $item "$name:$new"]} {
-		# failed
-		if  {[regexp {^a..=} $query]} {
-			# but some result came back
-			# synchronize everything with a 2nd call.
-			set query_output [query_all 1]
-		} else {
-			# server may be dead
-			if {$item != "ping" && $item != "attach"} {
-				try_connect
-			}
-		}
-	} else {
-		# succeeded
-		# synchronize this variable (or variables)
-		# for a speedup used the list parsed by see_if_ok.
-		update_menu_vars "USE_LIST"
-
-		if {$do_query_all} {
-			global all_settings
-			set all_settings $query
-		}
-	}
-}
-
-proc set_kmbc_str {} {
-	global vl_bk vl_bm vl_bb vl_bc vl_bf vr_bk vr_bm vr_bb vr_bc vr_bf
-
-	set str ""
-	if {$vl_bk} {
-		append str "K"
-	}
-	if {$vl_bm} {
-		append str "M"
-	}
-	if {$vl_bb} {
-		append str "B"
-	}
-	if {$vl_bc} {
-		append str "C"
-	}
-	if {$vl_bf} {
-		append str "F"
-	}
-	if {$vr_bk || $vr_bm || $vr_bb || $vr_bc || $vr_bf} {
-		append str ","
-	}
-	if {$vr_bk} {
-		append str "K"
-	}
-	if {$vr_bm} {
-		append str "M"
-	}
-	if {$vr_bb} {
-		append str "B"
-	}
-	if {$vr_bc} {
-		append str "C"
-	}
-	if {$vr_bf} {
-		append str "F"
-	}
-	entry_insert $str
-}
-
-proc insert_input_window {} {
-	global text_area cleanup_window
-	global ffont menu_var
-	global vl_bk vl_bm vl_bb vl_bc vl_bf vr_bk vr_bm vr_bb vr_bc vr_bf
-
-	append_text "\nUse these checkboxes to set the input permissions, "
-	append_text "or type in the \"KMBCF...\"\n"
-	append_text "-input string manually.  Then press \"OK\" or \"Cancel\".\n"
-	append_text "(note: an empty setting means use the default behavior, "
-	append_text "see viewonly)\n\n"
-	set w "$text_area.wk_f"
-	catch {destroy $w}
-	frame $w -bd 1 -relief ridge -cursor {top_left_arrow}
-	set fl $w.fl
-	frame $fl
-	set fr $w.fr
-	frame $fr
-	label $fl.l -font $ffont -text "Normal clients:   "
-	checkbutton $fl.bk -pady 1 -font $ffont -anchor w -variable vl_bk \
-		-pady 1 -command set_kmbc_str -text "Keystrokes" 
-	checkbutton $fl.bm -font $ffont -anchor w -variable vl_bm \
-		-pady 1 -command set_kmbc_str -text "Mouse-Motion" 
-	checkbutton $fl.bb -font $ffont -anchor w -variable vl_bb \
-		-pady 1 -command set_kmbc_str -text "Button-Click"
-	checkbutton $fl.bc -font $ffont -anchor w -variable vl_bc \
-		-pady 1 -command set_kmbc_str -text "Clipboard-Input"
-	checkbutton $fl.bf -font $ffont -anchor w -variable vl_bf \
-		-pady 1 -command set_kmbc_str -text "Files"
-	label $fr.l -pady 1 -font $ffont -text "View-Only clients:"
-	checkbutton $fr.bk -font $ffont -anchor w -variable vr_bk \
-		-pady 1 -command set_kmbc_str -text "Keystrokes" 
-	checkbutton $fr.bm -font $ffont -anchor w -variable vr_bm \
-		-pady 1 -command set_kmbc_str -text "Mouse-Motion" 
-	checkbutton $fr.bb -font $ffont -anchor w -variable vr_bb \
-		-pady 1 -command set_kmbc_str -text "Button-Click"
-	checkbutton $fr.bc -font $ffont -anchor w -variable vr_bc \
-		-pady 1 -command set_kmbc_str -text "Clipboard-Input"
-	checkbutton $fr.bf -font $ffont -anchor w -variable vr_bf \
-		-pady 1 -command set_kmbc_str -text "Files"
-
-	if {[info exists menu_var(input)]} {
-		set input_str $menu_var(input)
-	} else {
-		set input_str ""
-	}
-
-	if {[regexp {(.*),(.*)} $input_str match normal viewonly]} {
-		;
-	} else {
-		set normal $input_str
-		set viewonly ""
-	}
-	set vl_bk 0
-	set vl_bm 0
-	set vl_bb 0
-	set vl_bc 0
-	set vl_bf 0
-
-	set vr_bk 0
-	set vr_bm 0
-	set vr_bb 0
-	set vr_bc 0
-	set vr_bf 0
-
-	if {[regexp -nocase {K} $normal]} {
-		set vl_bk 1
-	}
-	if {[regexp -nocase {M} $normal]} {
-		set vl_bm 1
-	}
-	if {[regexp -nocase {B} $normal]} {
-		set vl_bb 1
-	}
-	if {[regexp -nocase {C} $normal]} {
-		set vl_bc 1
-	}
-	if {[regexp -nocase {F} $normal]} {
-		set vl_bf 1
-	}
-	if {[regexp -nocase {K} $viewonly]} {
-		set vr_bk 1
-	}
-	if {[regexp -nocase {M} $viewonly]} {
-		set vr_bm 1
-	}
-	if {[regexp -nocase {B} $viewonly]} {
-		set vr_bb 1
-	}
-	if {[regexp -nocase {C} $viewonly]} {
-		set vr_bc 1
-	}
-	if {[regexp -nocase {F} $viewonly]} {
-		set vr_bf 1
-	}
-
-	pack $fl.l $fl.bk $fl.bm $fl.bb $fl.bc $fl.bf -side top -fill x
-	pack $fr.l $fr.bk $fr.bm $fr.bb $fr.bc $fr.bf -side top -fill x
-	pack $fl $fr -side left
-	update
-	update idletasks
-	$text_area window create end -window $w
-	$text_area see end
-	$text_area insert end "\n"
-#	$text_area insert end "\n\n\n\n\n\n\n\n\n"
-
-	set cleanup_window $w
-}
-
-proc set_ca_str {w} {
-	global ca_bk ca_bm ca_bb ca_bc ca_bf ca_di
-
-	if {$ca_di} {
-		entry_insert "disconnect"
-		$w.bk configure -state disabled
-		$w.bm configure -state disabled
-		$w.bb configure -state disabled
-		$w.bc configure -state disabled
-		$w.bf configure -state disabled
-		return
-	}
-
-	$w.bk configure -state normal
-	$w.bm configure -state normal
-	$w.bb configure -state normal
-	$w.bc configure -state normal
-	$w.bf configure -state normal
-
-	set str ""
-	if {$ca_bk} {
-		append str "K"
-	}
-	if {$ca_bm} {
-		append str "M"
-	}
-	if {$ca_bb} {
-		append str "B"
-	}
-	if {$ca_bc} {
-		append str "C"
-	}
-	if {$ca_bf} {
-		append str "F"
-	}
-	entry_insert $str
-}
-
-proc insert_client_action_window {input} {
-	global text_area cleanup_window
-	global ffont menu_var
-	global ca_bk ca_bm ca_bb ca_bc ca_bf ca_di
-
-	append_text "\nUse these checkboxes to set the input permissions "
-	append_text "for this client\n-OR- whether to disconnect it instead.  "
-	append_text "Then press \"OK\" or \"Cancel\".\n\n"
-	set w "$text_area.ca_f"
-	catch {destroy $w}
-	frame $w -bd 1 -relief ridge -cursor {top_left_arrow}
-	checkbutton $w.di -pady 1 -font $ffont -anchor w -variable ca_di \
-		-pady 1 -command "set_ca_str $w" -text "Disconnect  " 
-	checkbutton $w.bk -font $ffont -anchor w -variable ca_bk \
-		-pady 1 -command "set_ca_str $w" -text "Keystrokes" 
-	checkbutton $w.bm -font $ffont -anchor w -variable ca_bm \
-		-pady 1 -command "set_ca_str $w" -text "Mouse-Motion" 
-	checkbutton $w.bb -font $ffont -anchor w -variable ca_bb \
-		-pady 1 -command "set_ca_str $w" -text "Button-Click"
-	checkbutton $w.bc -font $ffont -anchor w -variable ca_bc \
-		-pady 1 -command "set_ca_str $w" -text "Clipboard"
-	checkbutton $w.bf -font $ffont -anchor w -variable ca_bf \
-		-pady 1 -command "set_ca_str $w" -text "Files"
-
-	set ca_di 0
-	set ca_bk 0
-	set ca_bm 0
-	set ca_bb 0
-	set ca_bf 0
-	set ca_bc 0
-
-	if {[regexp -nocase {K} $input]} {
-		set ca_bk 1
-	}
-	if {[regexp -nocase {M} $input]} {
-		set ca_bm 1
-	}
-	if {[regexp -nocase {B} $input]} {
-		set ca_bb 1
-	}
-	if {[regexp -nocase {C} $input]} {
-		set ca_bc 1
-	}
-	if {[regexp -nocase {F} $input]} {
-		set ca_bf 1
-	}
-
-	pack $w.di $w.bk $w.bm $w.bb $w.bc $w.bf -side left
-	update
-	update idletasks
-	$text_area window create end -window $w
-	$text_area see end
-	$text_area insert end "\n"
-
-	set cleanup_window $w
-}
-
-proc cleanup_text_window {} {
-	global cleanup_window
-	if {[info exists cleanup_window]} {
-		catch {destroy $cleanup_window}
-	}
-}
-
-# For updating a string variable.   Also used for simple OK/Cancel dialogs
-# with entry = 0.
-proc entry_dialog {item {entry 1}} {
-	global menu_var entry_str entry_set entry_dialog_item
-	global unset_str connected_to_x11vnc entry_box
-
-	set entry_str "Set $item"
-	set entry_set 0
-	set entry_dialog_item $item
-
-	entry_enable
-	menus_disable
-
-	if {$item == "passwd" || $item == "viewpasswd"} {
-		$entry_box configure -show "*"
-	}
-
-	if {$entry} {
-		entry_insert ""
-		if {[info exists menu_var($item)] &&
-		    $menu_var($item) != $unset_str} {
-			entry_insert $menu_var($item)
-			entry_select
-		}
-
-		if {[is_browse $item]} {
-			entry_browse_button
-		}
-		set_info "Set parameter in entry box, "
-		entry_focus
-	} else {
-		entry_disable box
-	}
-
-	set clean_text_window 0;
-
-	if {$item == "input"} {
-		insert_input_window
-		set clean_text_window 1
-	}
-
-	update
-
-	# wait for user reply:
-	vwait entry_set
-
-	set rc $entry_set
-	set entry_set 0
-
-	set value [entry_get]
-	update
-
-	entry_browse_button 0
-	set entry_str "Set... :"
-
-	entry_delete
-	entry_disable
-	menus_enable
-
-	if {$clean_text_window} {
-		cleanup_text_window;
-	}
-
-	update
-
-	if {! $entry} {
-		;
-	} elseif {$rc} {
-		set menu_var($item) $value
-	} else {
-		if {[in_debug_mode]} {
-			append_text "skipped setting $item\n"
-		}
-	}
-
-	$entry_box configure -show ""
-
-	return $rc
-}
-
-proc warning_dialog {msg {item "gui"} } {
-	append_text $msg
-	# just reuse the entry widgets for a yes/no dialog
-	return [entry_dialog $item 0]
-}
-
-# For updating a boolean toggle:
-proc check_var {item} {
-	global menu_var
-
-	set inval $menu_var($item);
-
-	if {$item == "debug_gui"} {
-		return "";
-	}
-
-	set rname $item
-	if {! $inval} {
-		if {[regexp {^no} $item]} {
-			regsub {^no} $rname "" rname
-		} else {
-			set rname "no$rname"
-		}
-	}
-	return $rname
-}
-
-proc see_if_ok {query item expected} {
-	global query_result_list
-
-	set ok 0
-	set found ""
-
-	set query_result_list [split_query $query]
-
-	foreach q $query_result_list {
-		# XXX following will crash if $item is not a good regexp
-		# need to protect it \Q$item\E style...
-#		if {[regexp "^$item:" $q]} {
-#			set found $q
-#		}
-		if {[string first "$item:" $q] == 0} {
-			set found $q
-		}
-		if {$q == $expected} {
-			set ok 1
-			if {$found != ""} {
-				break;
-			}
-		}
-	}
-	if {$found == ""} {
-		set msg $query
-		regsub {^a..=} $msg {} msg
-		if {[string length $msg] > 60} {
-			set msg [string range $msg 0 60]
-		}
-	} else {
-		set msg $found
-	}
-	if {!$ok && $found != ""} {
-		# check for floating point match:
-		set v1 ""
-		set v2 ""
-		regexp {:([0-9.][0-9.]*)$} $found m0 v1
-		regexp {:([0-9.][0-9.]*)$} $expected m0 v2
-		if {$v1 != "" && $v2 != ""} {
-			set diff ""
-			catch {set diff [expr "$v1 - $v2"]}
-			if {$diff != ""} {
-				if {$diff < 0} {
-					set diff [expr "0.0 - $diff"]
-				}
-				if {$diff < 0.00001} {
-					set ok 1
-				}
-			}
-		}
-	}
-	if {$ok} {
-		append_text "\tSet OK  ($msg)\n"
-		return 1
-
-	} elseif {[opt_match P $item] && [regexp {:(-|\+)} $expected]} {
-		# e.g. blackout:+30x30+20+20
-		append_text "\t($msg)\n"
-		return 1
-	} elseif {[regexp {:[0-9]\.[0-9]} $expected]} {
-		append_text "\t($msg)\n"
-		return 1
-	} elseif {$item == "connect" || $item == "disconnect"
-	    || $item == "client" || $item == "client_input"} {
-		append_text "\t($msg)\n"
-		return 1
-	} elseif {$item == "passwd" || $item == "viewpasswd"} {
-		append_text "\t($msg)\n"
-		return 1
-	} else {
-		append_text "\t*FAILED* $msg\n"
-		return 0
-	}
-}
-
-proc get_default_vars {} {
-	global default_var env
-
-	set qry [all_query_vars]
-
-	append qry ",vncconnect"
-
-	set q ""
-	set i 0
-	set all ""
-	foreach s [split $qry ","] {
-		if {$q != ""} {
-			append q ","
-		}
-		append q $s
-		incr i
-		if {$i > 50} {
-			set qargs [list "-QD" $q]
-			set a [run_remote_cmd $qargs]
-			if [info exists env(TKX11VNC_PRINT_ALL_QD)] {
-				puts $q
-				puts $a
-				puts "---------------"
-			}
-			if {$all != ""} {
-				append all ","
-			}
-			append all $a
-			set q ""
-			set i 0
-		}
-	}
-	if {$q != ""} {
-		set qargs [list "-QD" $q]
-		set a [run_remote_cmd $qargs]
-		if [info exists env(TKX11VNC_PRINT_ALL_QD)] {
-			puts $q
-			puts $a
-			puts "---------------"
-		}
-		if {$all != ""} {
-			append all ","
-		}
-		append all $a
-	}
-
-# old way, qry too long...
-#	set qargs [list "-QD" $qry]
-#	set all [run_remote_cmd $qargs]
-
-	if {[regexp {ans=} $all]} {
-		#append_text "Retrieved all default settings.\n"
-	} else {
-		#append_text "Failed to retrieve default settings.\n"
-	}
-
-	set query_result_list [split_query $all]
-
-	set default_var(gui) ""
-
-	foreach piece $query_result_list {
-		if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {
-			if {$val == "N/A"} {
-				if {$item == "vncconnect"} {
-					set val 1
-				} else {
-					set val ""
-				}
-			}
-			if {$item == "display"} {
-				set val ""
-			} elseif {$item == "desktop"} {
-				set val ""
-			} elseif {$item == "auth"} {
-				set val ""
-			} elseif {$item == "gui"} {
-				continue
-			} 
-			# some hacks we do here for now..
-			if {$item == "cursor" && $val == ""} {
-				set val "most"
-			} elseif {$item == "scrollcopyrect" && $val == ""} {
-				set val "always"
-			} elseif {$item == "wirecopyrect" && $val == ""} {
-				set val "always"
-#			} elseif {$item == "overlay_nocursor" && $val == 0} {
-#				set val 1
-			}
-
-			set default_var($item) $val
-#puts "default: $item -> $val"
-		}
-	}
-}
-
-proc tilde_expand {file} {
-	global env
-	if {[file exists $file]} {
-		return $file
-	}
-
-	set user ""
-	if {[info exists env(USER)]} {
-		set user $env(USER)
-	}
-	if {$user == "" && [info exists env(LOGNAME)]} {
-		set user $env(LOGNAME)
-	}
-
-	set home ""
-	if {[info exists env(HOME)]} {
-		set home $env(HOME)
-	} elseif {$user != ""} {
-		set home "/home/$user"
-	}
-
-	if {[regexp {^~} $file]} {
-		if {[regexp {^~/} $file]} {
-			if {$home != ""} {
-				regsub {^~} $file $home file
-			}
-		} else {
-			regsub {^~} $file "/home/" file
-		}
-	}
-	return $file
-}
-
-proc insert_cmdline_vars {} {
-	global env cmd_var menu_var default_var x11vnc_cmdline
-	if {![info exists x11vnc_cmdline]} {
-		return
-	}
-	if {$x11vnc_cmdline == ""} {
-		return
-	}
-	set cmd_var(novar) 1 
-	set str [string trim $x11vnc_cmdline]
-
-	while {[regexp -- {^-} $str]} {
-		if {[regexp -- {^--*([^ \t][^ \t]*)(.*)$} $str m var rest]} {
-			set rest [string trim $rest]
-			set var [string trim $var]
-			if {[regexp {^\{\{([^\}]*)\}\}(.*)} $rest m val rest]} {
-				set str [string trim $rest]
-				set cmd_var($var) $val
-			} else {
-				set str $rest
-				set cmd_var($var) "boolean"
-			}
-		} else {
-			break
-		}
-	}
-
-	if {[info exists cmd_var(rc)]} {
-		load_settings $cmd_var(rc)
-	} elseif {[info exists cmd_var(norc)]} {
-		;
-	} else {
-		set filex [tilde_expand "~/.x11vncrc"]
-		if {[file exists $filex]} {
-			load_settings $filex
-		}
-	}
-
-	foreach var [array names cmd_var] {
-		if {$var == "novar"} {
-			continue
-		}
-		if {[regexp {^[ \t]*$} $var]} {
-			continue
-		}
-		if {[info exists menu_var($var)]} {
-			if {$cmd_var($var) == "boolean"} {
-				set menu_var($var) 1
-			} else {
-				set menu_var($var) $cmd_var($var)
-			}
-		}
-	}
-}
-
-proc copy_default_vars {} {
-	global menu_var default_var
-	foreach item [array names default_var] {
-		if {[info exists menu_var($item)]} {
-			if {[info exists default_var($item)]} {
-				set menu_var($item) $default_var($item)
-			}
-		}
-	}
-	foreach item [array names menu_var] {
-		if {[info exists default_var($item)]} {
-			set menu_var($item) $default_var($item)
-		}
-	}
-}
-
-proc update_menu_vars {{query ""}} {
-	global all_settings menu_var query_result_list
-	global x11vnc_icon_mode
-
-	set debug [in_debug_mode]
-
-	if {$query == "USE_LIST"} {
-		;
-	} elseif {$query == ""} {
-		set query_result_list [split_query $all_settings]
-	} else {
-		set query_result_list [split_query $query]
-	}
-
-	foreach piece $query_result_list {
-#puts stderr "UMV: $piece"
-		if [regexp {icon_mode:0} $piece] {
-			set x11vnc_icon_mode 0
-			#puts stderr "x11vnc_icon_mode: $x11vnc_icon_mode"
-		}
-		if [regexp {icon_mode:1} $piece] {
-			set x11vnc_icon_mode 1
-			#puts stderr "x11vnc_icon_mode: $x11vnc_icon_mode"
-		}
-		# XXX ipv6
-		if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {
-			if {[info exists menu_var($item)]} {
-				set old $menu_var($item)
-#puts stderr "     $old"
-				if {$val == "N/A"} {
-					continue
-				}
-				set menu_var($item) $val
-			}
-			if {$item == "clients"} {
-				update_clients_menu $val
-			} elseif {$item == "display"} {
-				set_x11_display $val
-			} elseif {$item == "vncdisplay"} {
-				set_vnc_display $val
-			} elseif {$item == "http_url"} {
-				set_vnc_url $val
-			}
-		}
-	}
-}
-
-proc load_settings {{file ""}} {
-	global menu_var default_var env
-
-	if {$file == ""} {
-		if {![info exists menu_var(load-settings)]} {
-			return
-		}
-		set file $menu_var(load-settings)
-	}
-	if {$file == ""} {
-		return
-	}
-
-	set fh ""
-	set filex [tilde_expand $file]
-	catch {set fh [open $filex "r"]}
-
-	if {$fh == ""} {
-		append_text "load_settings: *** failed to open $filex ***\n"
-		return
-	}
-	copy_default_vars
-
-	set str ""
-	while {[gets $fh line] > -1} {
-		regsub -all {\\#} $line {__QUOTED_HASH__} line
-		if {[regexp {^[ \t]*#} $line]} {
-			continue
-		}
-		for {set i 0} {$i < 5} {incr i} {
-			regsub {#.*$} $line "" line
-		}
-		if {[regexp {^[ \t]*$} $line]} {
-			continue
-		}
-		regsub -all {__QUOTED_HASH__} $line {#} line
-		if {[regexp {\\$} $line]} {
-			regsub {\\$} $line " " line
-			append str "$line"
-		} else {
-			append str "$line\n"
-		}
-	}
-	close $fh
-
-	set count 0
-	set parms ""
-
-	foreach line [split $str "\n"] {
-		set line [string trim $line]
-		regsub {^--*} $line "" line
-		regsub -all {[ \t][ \t]*} $line " " line
-		set list [split $line]
-		set item [lindex $list 0]
-		set value [lindex $list 1]
-		if {[regexp {^[ \t]*$} $item]} {
-			continue
-		}
-		if {$item == "gui"} {
-			continue
-		}
-		if {[info exists menu_var($item)]} {
-			if {[value_is_bool $item]} {
-				set menu_var($item) 1
-				incr count
-				append parms "  -$item\n"
-			} elseif {[value_is_string $item]} {
-				if {$value != ""} {
-					set menu_var($item) $value
-					set nitem [get_nitem $item]
-					append parms "  -$nitem $value\n"
-					incr count
-				}
-			}
-		}
-	}
-	append_text "loaded $count parameter settings from $filex"
-	if {$count > 0} {
-		append_text ":\n"
-		append_text $parms
-	} else {
-		append_text ".\n"
-	}
-}
-
-proc save_settings {} {
-	set rc_text [get_settings_rcfile]
-
-	set top "#
-# This file is based on the current x11vnc settings and can be used as
-# as a ~/.x11vncrc defaults file.  If saved to another filename, these
-# settings can be passed to x11vnc at startup via \"-rc <filename>\".
-#
-# The rc file comment character is \"#\".  Use \"\\#\" for the literal char.
-# You can continue lines using \"\\\" as the last character of a line.
-#
-# Lines beginning with \"#d\" indicate the parameter value is at its default
-# setting and you probably want to leave it commented out.
-#
-# Lines beginning with \"#?\" indicate parameters you probably do not
-# want to hardwire to the current setting (uncomment if you want that).
-# 
-# Some parameters are boolean, e.g. -forever, and take no value; while
-# the others, e.g. -wait 50, take a string or numerical value.
-#
-# For booleans, the line will end with comment \"default: on\" or
-# \"default: off\" indicating the default setting.  (Note: often
-# \"-nofoobar\" corresponds to option \"-foobar\" and the former is
-# \"the default\", e.g. -norepeat).
-#
-# For string or numerical options, the value \"\" in a line below
-# means the default is unset and you will need to supply some non-empty
-# value to use the parameter.  For reference, if the default differs
-# from your value it placed at the end of the line as a comment.
-# 
-# Feel free to uncomment or comment any of the lines or to change any
-# of the values of the parameters.  Don't be surprised that most if not
-# all of the lines below are commented out (x11vnc has so many parameters,
-# most of them will be at their default values).
-#-------------------------------------------------------------------------
-
-"
-
-	set rc_text "$top$rc_text"
-
-	global env save_settings_var save_settings_var_ok
-	if {[info exists env(HOME)]} {
-		set save_settings_var "$env(HOME)/.x11vncrc"
-	} else {
-		set save_settings_var ".x11vncrc"
-	}
-	set save_settings_var_ok 0
-
-	set w [textwin "save_settings" "Save Settings..." $rc_text \
-		"save_settings_var+Save as:"]
-
-	tkwait window $w
-
-	if {$save_settings_var_ok == 1} {
-		set file $save_settings_var
-		if {$file == ""} {
-			return
-		}
-		set file [tilde_expand $file]
-		append_text "\nSaving current settings to $file ...\n" 
-		if {[file exists $file]} {
-			set backup "${file}~"
-			append_text "Backing up $file -> $backup ...\n"
-			catch {file delete -force $backup}
-			set emsg "*** Backup to $backup failed. ***\n"
-			if {![file exists $backup]} {
-				catch {file copy -force $file $backup}
-				if {![file exists $backup]} {
-					append_text $emsg
-					bell
-				}
-			} else {
-				append_text $emsg
-				bell
-			}
-		}
-		set fh ""
-		catch {set fh [open $file "w"]}
-		if {$fh != ""} {
-			puts $fh $rc_text
-			close $fh
-			if {![file exists $file]} {
-				append_text "*** Saving to $file failed. ***\n"
-				bell
-			} else {
-				append_text "Done.\n"
-			}
-		} else {
-			append_text "*** Open of $file failed. ***\n"
-			bell
-		}
-	}
-}
-
-proc clear_all {} {
-	global menu_var unset_str
-
-	set debug [in_debug_mode]
-	
-	foreach item [array names menu_var] {
-		if {$item == "debug_gui"} {
-			continue
-		}
-		if {[info exists menu_var($item)]} {
-			if {[is_action $item]} {
-				set menu_var($item) ""
-			} elseif {[value_is_bool $item]} {
-				set menu_var($item) 0
-			} elseif {[value_is_string $item]} {
-				set menu_var($item) $unset_str
-			}
-		}
-	}
-	append_text "Cleared all settings.\n"
-}
-
-proc defaults_all {} {
-	copy_default_vars
-	append_text "Reset all variables to default values.\n"
-}
-
-proc all_query_vars {} {
-	global query_ans_list query_aro_list all_settings
-	global cache_all_query_vars
-	
-	if {$cache_all_query_vars != ""} {
-		return $cache_all_query_vars
-	}
-
-	set qry ""
-	foreach item $query_ans_list {
-		if {$qry == ""} {
-			set qry $item
-		} else {
-			append qry ",$item"
-		}
-	}
-	foreach item $query_aro_list {
-		if {$qry == ""} {
-			set qry $item
-		} else {
-			append qry ",$item"
-		}
-	}
-	set cache_all_query_vars $qry
-
-	global env
-	if [info exists env(TKX11VNC_PRINT_ALL_VARS)] {
-		puts "--------------- BEGIN ALL VARS ---------------"
-		puts $qry
-		puts "--------------- END ALL VARS ---------------"
-	}
-
-	return $qry
-}
-
-proc query_all {{quiet 0}} {
-	global query_ans_list query_aro_list all_settings
-	global last_query_all_time
-
-	dtime 1
-	set qry [all_query_vars]
-
-	set qargs [list "-Q" $qry]
-	set all [run_remote_cmd $qargs]
-
-	if {[regexp {ans=} $all]} {
-		if {! $quiet} {
-			append_text "Retrieved all current settings.\n"
-		}
-		set all_settings $all
-		update_menu_vars $all
-	} else {
-		if {! $quiet} {
-			append_text "Failed to retrieve current settings.\n"
-		}
-	}
-	set last_query_all_time [clock seconds]
-	dtime 2
-	return $all
-}
-
-proc set_info {str} {
-	global info_str info_label
-#set w1 [$info_label cget -width]
-#set w2 [winfo width $info_label]
-#puts "set_info: w=$w1  winfo=$w2"
-#append_text "$str\n"
-	set info_str "$str"
-	update
-}
-
-proc append_text {str} {
-	global text_area text_area_str
-
-	if {![info exists text_area_str]} {
-		set text_area_str ""
-	}
-	append text_area_str $str
-
-	if {![info exists text_area]} {
-		puts stderr $str
-		return
-	}
-	if {$text_area == ""} {
-		puts stderr $str
-		return
-	}
-	if {![winfo exists $text_area]} {
-		puts stderr $str
-		return
-	}
-	
-	$text_area insert end $str
-	$text_area see end
-}
-
-proc show_all_settings {} {
-	global all_settings
-	global client_sock client_tail
-	global x11vnc_client_file
-
-	set txt "\nRead-Write settings:\n\n"
-	foreach item [split_query $all_settings]  {
-		regsub {:} $item {: } item
-		append txt "  $item\n"
-		if {[regexp {noremote} $item]} {
-			append txt "\nRead-Only settings:\n\n"
-		}
-	}
-	append txt "\nInternal settings:\n\n"
-	append txt "x11vnc_client_file: $x11vnc_client_file\n"
-	if {[info exists client_tail]} {
-		append txt "client_tail: $client_tail\n"
-	} else {
-		append txt "client_tail: unset\n"
-	}
-	if {[info exists client_sock]} {
-		append txt "client_sock: $client_sock\n"
-	} else {
-		append txt "client_sock: unset\n"
-	}
-	set estr ""
-	catch {set estr [exec env | grep -i X11VNC]}
-	append txt "$estr\n"
-	textwin "Settings" "All Current Settings" $txt
-}
-
-proc show_logfile {} {
-	global menu_var unset_str
-
-	set logfile [tilde_expand $menu_var(logfile)]
-	
-	if {$logfile == "" || $logfile == $unset_str} {
-		set txt "\nNo logfile was specified at x11vnc startup.\n\n"	
-	} elseif {![file exists $logfile]} {
-		set txt "\nLogfile \"$logfile\" does not exist.\n\n"
-	} else {
-		set fh "-3"
-		set err ""
-		catch {set fh [open $logfile "r"]} err
-		if {$fh == "-3"} {
-			set txt "\nError opening \"$logfile\" $err.\n\n"
-		} else {
-			set txt "\nLogfile \"$logfile\" current contents:\n"
-			while {[gets $fh line] > -1} {
-				append txt "$line\n"
-			}
-			close $fh
-		}
-	}
-	textwin "Logfile" "Logfile" $txt
-}
-
-proc tail_logfile {} {
-	global menu_var unset_str ffont
-	set logfile $menu_var(logfile)
-	
-	set txt ""
-	if {$logfile == "" || $logfile == $unset_str} {
-		set txt "\nNo logfile was specified at x11vnc startup.\n\n"	
-	} elseif {![file exists $logfile]} {
-		set txt "\nLogfile \"$logfile\" does not exist.\n\n"
-	} else {
-		set cmd ""
-		set xterm_cmd "xterm -sb -fn $ffont -geometry 80x45 -title x11vnc-logfile -e"
-		set cmd [split $xterm_cmd]
-		lappend cmd "tail"
-		lappend cmd "-3000f"
-		lappend cmd $logfile
-		lappend cmd "&"
-		catch {[eval exec $cmd]}
-	}
-	if {$txt != ""} {
-		textwin "Logfile" "Logfile" $txt
-	}
-}
-
-proc set_connected {yesno} {
-	global connected_to_x11vnc
-	set orig $connected_to_x11vnc
-	
-	if {$yesno == "yes"} {
-		set connected_to_x11vnc 1
-	} else {
-		set connected_to_x11vnc 0
-		no_x11_display
-		no_vnc_display
-	}
-	if {$orig != $connected_to_x11vnc} {
-		set_widgets
-	}
-}
-
-proc detach_from_display {} {
-	global connected_to_x11vnc reply_xdisplay x11vnc_xdisplay
-	set str "Detaching from X display."
-	if {$reply_xdisplay != ""} {
-		set str "Detaching from $reply_xdisplay."
-	} elseif {$x11vnc_xdisplay != ""} {
-		set str "Detaching from $x11vnc_xdisplay."
-	}
-	if {$connected_to_x11vnc} {
-		append_text "$str\n"
-	}
-	set_connected no
-}
-
-proc do_stop_quit {} {
-	push_new_value "stop" "stop" 1 0
-	set_connected no
-	update
-	after 250
-	destroy .
-}
-
-# Menu item is an action:
-proc do_action {item} {
-	global menu_var connected_to_x11vnc beginner_mode
-
-	if {[in_debug_mode]} {
-		append_text "action: \"$item\"\n"
-	}
-#puts "action: \"$item\"\n"
-
-	if {$item == "ping"} {
-		if {$beginner_mode} {
-			try_connect_and_query_all
-		} else {
-			try_connect
-		}
-		return
-	} elseif {$item == "start"} {
-		start_x11vnc
-		return
-	} elseif {$item == "detach"} {
-		detach_from_display
-		return
-	} elseif {$item == "attach"} {
-		try_connect_and_query_all
-		return
-	} elseif {$item == "update-all"} {
-		query_all
-		return
-	} elseif {$item == "clear-all"} {
-		clear_all
-		return
-	} elseif {$item == "defaults-all"} {
-		defaults_all
-		return
-	} elseif {$item == "save-settings"} {
-		save_settings
-		return
-	} elseif {$item == "show-start-cmd"} {
-		show_start_cmd
-		return
-	} elseif {$item == "all-settings"} {
-		show_all_settings
-		return
-	} elseif {$item == "show-logfile"} {
-		show_logfile
-		return
-	} elseif {$item == "tail-logfile"} {
-		tail_logfile
-		return
-	} elseif {$item == "Misc-Tuning:"} {
-		menu_help "$item"
-		return
-	} elseif {$item == "WindowView"} {
-		change_view_state
-		return
-	} elseif {$item == "quit" || $item == "Quit"} {
-		destroy .
-		exit 0
-	} elseif {$item == "stop+quit"} {
-		do_stop_quit
-	}
-
-	if {[value_is_string $item]} {
-		if {! [entry_dialog $item]} {
-			return
-		}
-		set new $menu_var($item)
-		set name $item
-	} else {
-		set new 1
-		set name $item
-	}
-
-	if {$item == "load-settings"} {
-		load_settings
-		return
-	}
-
-	if {! $connected_to_x11vnc} {
-		;
-	} elseif {[regexp {^(stop|quit|exit|shutdown)$} $item]} {
-		# just do -R
-		append_text "stopping remote x11vnc server...\n"
-		push_new_value $item $name $new 0
-		set_connected no
-		
-	} elseif {[opt_match Q $item]} {
-		push_new_value $item $name $new 1
-	} else {
-		push_new_value $item $name $new 0
-	}
-}
-
-proc ptime {time} {
-	set usec [lindex [split $time] 0]
-	set sec [format "%.3f" [expr "$usec / 1000000.0"]]
-	puts "time: $sec secs."
-}
-
-proc do_var {item} {
-	global connected_to_x11vnc item_cascade menu_var
-
-	set debug [in_debug_mode]
-
-	set string 0
-	if {[is_action $item] || $item == "WindowView"} {
-		# Menu item is action:
-		if {$debug} {
-			ptime [time {do_action $item}]
-		} else {
-			do_action $item
-		}
-		return
-	}
-
-	if {[value_is_string $item]} {
-		# Menu item is a string:
-		if {$item_cascade($item) != ""} {
-			# Cascade sets variable automatically
-		} else {
-			# Otherwise Entry box
-			if {![entry_dialog $item]} {
-				return
-			}
-		}
-		set new $menu_var($item)
-		set name $item
-	} else {
-		# Menu item is a boolean:
-		set name [check_var $item]
-		if {$name == ""} {
-			return
-		}
-		set new 1
-	}
-	if {$connected_to_x11vnc} {
-		if {$debug} {
-			ptime [time {push_new_value $item $name $new 1}]
-		} else {
-			push_new_value $item $name $new 1
-		}
-
-		if {$item == "http"} {
-			global vnc_url
-			append_text "  URL: $vnc_url\n"
-		}
-	}
-}
-
-proc menu_help {item} {
-	if ![help_win $item] {
-		textwin "nohelp" "No help available" \
-			"Sorry, no help avaiable for \"$item\""
-	}
-}
-
-proc opt_match {c item} {
-	global item_opts
-	if {[info exists item_opts($item)]} {
-		if {[regexp "^\[A-z\]*$c" $item_opts($item)]} {
-			return 1
-		}
-	}
-	return 0
-}
-
-proc is_action {item} {
-	return [opt_match A $item]
-}
-
-proc is_gui_internal {item} {
-	if {$item == "Properties"} {
-		return 1
-	}
-	if {$item == "Tray"} {
-		return 1
-	}
-	return [opt_match G $item]
-}
-
-proc is_browse {item} {
-	return [opt_match F $item]
-}
-
-proc value_is_string {item} {
-	global item_bool
-	if {![info exists item_bool($item)]} {
-		return 0
-	}
-	if {! $item_bool($item)} {
-		return 1
-	} else {
-		return 0
-	}
-}
-
-proc value_is_bool {item} {
-	global item_bool
-	if {![info exists item_bool($item)]} {
-		return 0
-	}
-	if {$item_bool($item)} {
-		return 1
-	} else {
-		return 0
-	}
-}
-
-proc split_query0 {query} {
-	# original slower way with regexp/regsub
-	regsub -all {aro=} $query {ans=} query
-	set items {}
-	while {1} {
-		if {! [regexp {^ans=(.*)$} $query m0 m1]} {
-			break
-		}
-		set item $m1
-		set m2 ""
-		regexp {,ans=.*$} $item m2
-		regsub {,ans=.*$} $item "" item
-		if {$item != ""} {
-			lappend items $item
-		}
-		set query $m2
-		regsub {^,} $query "" query
-	}
-	return $items
-}
-
-proc split_query {query} {
-	regsub -all {aro=} $query {ans=} query
-	set items {}
-	while {1} {
-		set n [string first "ans=" $query]
-		if {$n < 0} {
-			break
-		}
-		set from [expr $n+4]
-
-		set m [string first ",ans=" $query]
-		if {$m < 0} {
-			set more 0
-			set item [string range $query $from end]
-		} else {
-			set more 1
-			set to   [expr $m-1]
-			set item [string range $query $from $to]
-		}
-		if {$item != ""} {
-			lappend items $item
-		}
-		if {$more} {
-			incr m
-			set query [string range $query $m end]
-		} else {
-			set query ""
-		}
-	}
-	return $items
-}
-
-proc set_x11_display {name} {
-	global x11_display
-	set x11_display "x11vnc X display: $name"
-	set_name "tkx11vnc - $name"
-}
-proc set_vnc_display {name} {
-	global vnc_display icon_mode
-	set vnc_display "VNC display: $name"
-
-	if {$icon_mode} {
-		set_icon_label
-	}
-}
-proc set_vnc_url {name} {
-	global vnc_url
-	set vnc_url $name
-}
-proc no_x11_display {} {
-	set_x11_display "(*none*)"
-	set_name "tkx11vnc"
-}
-proc no_vnc_display {} {
-	set_vnc_display "(*none*)"
-}
-proc no_vnc_url {} {
-	set_vnc_url "(*none*)"
-}
-
-proc get_vnc_display_number {} {
-	global vnc_display
-	if ![info exists vnc_display] {
-		return "none"
-	}
-	if {$vnc_display == ""} {
-		return "none"
-	}
-	set str $vnc_display
-	regsub {VNC display: *} $str "" str
-	if [regexp {:([0-9][0-9]*)} $str m0 n] {
-		return $n
-	}
-	return "none"
-}
-
-proc fetch_displays {} {
-
-	set qargs [list "-Q" "display,vncdisplay"]
-	set result [run_remote_cmd $qargs]
-
-	set got_x11 0
-	set got_vnc 0
-	set got_url 0
-
-	foreach item [split_query $result] {
-		if {[regexp {^display:(.*)$} $item m0 m1]} {
-			set_x11_display $m1
-			set got_x11 1
-		} elseif {[regexp {^vncdisplay:(.*)$} $item m0 m1]} {
-			set_vnc_display $m1
-			set got_vnc 1
-		} elseif {[regexp {^http_url:(.*)$} $item m0 m1]} {
-			set_vnc_url $m1
-			set got_url 1
-		}
-	}
-	if {! $got_x11} {
-		no_x11_display
-	}
-	if {! $got_vnc} {
-		no_vnc_display
-	}
-	if {! $got_url} {
-		no_vnc_url
-	}
-}
-
-proc client_dialog {client} {
-	set cid ""
-	set host ""
-	set ip ""
-	global menu_var text_area cleanup_window item_bool
-
-	#<id>:<ip>:<port>:<user>:<unix>:<hostname>:<input>:<loginview>:<time>
-	append_text "\nClient info string:\n - $client\n\n"
-	if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \
-	    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {
-		set cid  $m1
-		set ip   $m2
-		set port $m3
-		set user $m4
-		set unix $m5
-		set host $m6
-		regsub {\..*$} $host "" host
-		set input $m7
-		set logvo $m8
-		set ltime $m9
-		append_text "Host: $host, Port: $port, User: $user"
-		if {$unix != "" && $unix != "none"} {
-			append_text ", Unix: $unix"
-		}
-		append_text ", IP: $ip, Id: $cid\n"
-		append_text " - originally logged in as: "
-		if {$logvo == "1" } {
-			append_text "View-Only Client"
-		} else {
-			append_text "Normal Client"
-		}
-		if {$ltime != ""} {
-			set tim [clock format $ltime]
-			append_text ",  $tim"
-		}
-		append_text "\n"
-		append_text " - currently allowed input: "
-		set sk 0
-		set sm 0
-		set sb 0
-		set sc 0
-		set sf 0
-		if {[regexp -nocase {K} $input]} {
-			append_text "Keystrokes"
-			set sk 1
-		}
-		if {[regexp -nocase {M} $input]} {
-			if {$sk} {
-				append_text ", "
-			}
-			append_text "Mouse-Motion"
-			set sm 1
-		}
-		if {[regexp -nocase {B} $input]} {
-			if {$sk || $sm} {
-				append_text ", "
-			}
-			append_text "Button-Click"
-			set sb 1
-		}
-		if {[regexp -nocase {C} $input]} {
-			if {$sk || $sm || $sb} {
-				append_text ", "
-			}
-			append_text "Clipboard"
-			set sm 1
-		}
-		if {[regexp -nocase {F} $input]} {
-			if {$sk || $sm || $sb || $sf} {
-				append_text ", "
-			}
-			append_text "Files"
-			set sf 1
-		}
-		if {! $sk && ! $sm && ! $sb && ! $sm && ! $sf} {
-			append_text "None"
-		}
-		append_text "\n"
-	}
-	if {$cid == ""} {
-		append_text "Invalid client info string: $client\n"
-		return
-	}
-
-	regsub -all {_} $input "" input
-	set menu_var(client) "$input"
-	set item_bool(client) 0
-
-	insert_client_action_window $input
-	set rc [entry_dialog client 1]
-
-	cleanup_text_window
-
-	set val $menu_var(client)
-	#puts "rc: $rc  val: $val"
-
-	if {! $rc} {
-		return;
-	} elseif {[regexp -nocase {(disconnect|close)} $val]} {
-		disconnect_dialog $client
-	} else {
-		regsub -all -nocase {[^KMBCF]} $val "" val
-		set item_bool(client_input) 0
-		push_new_value "client_input" "client_input" "$cid:$val" 0
-	}
-}
-
-proc disconnect_dialog {client} {
-	set cid ""
-	set host ""
-	set msg "\n"
-	append msg "*** Client info string:\n    $client\n"
-	if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \
-	    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {
-		set cid  $m1
-		set ip   $m2
-		set port $m3
-		set user $m4
-		set unix $m5
-		set host $m6
-		regsub {\..*$} $host "" host
-		set input $m7
-		set logvo $m8
-		set ltime $m9
-		append_text "Host: $host, Port: $port, IP: $ip, User: $user"
-		if {$unix != "" && $unix != "none"} {
-			append_text ", Unix: $unix"
-		}
-		append_text ", Id: $cid\n"
-	}
-	if {$cid == ""} {
-		append_text "Invalid client info string: $client\n"
-		return
-	}
-	append msg "*** To *DISCONNECT* this client press \"OK\" again, otherwise press \"Cancel\"\n"
-	bell
-	if {[warning_dialog $msg "current"]} {
-		push_new_value "disconnect" "disconnect" $cid 1
-	} else {
-		append_text "disconnect cancelled.\n"
-	}
-}
-
-proc update_clients_and_repost {} {
-	global item_cascade menu_m menu_b
-
-	append_text "Refreshing connected clients list... "
-	query_all 1
-	update
-
-	set saw 0
-	set casc $item_cascade(current)
-	set last [$casc index end]
-	for {set i 0} {$i <= $last} {incr i} {
-		if {[$casc type $i] == "separator"} {
-			continue
-		}
-		set name [$casc entrycget $i -label]
-		if {[regexp {^num-clients} $name]} {
-			continue
-		}
-		if {[regexp {^refresh-list} $name]} {
-			continue
-		}
-		if {! $saw} {
-			append_text "\n"
-		}
-		set saw 1
-		append_text "client: $name\n"
-	}
-	if {! $saw} {
-		append_text "done.\n"
-	}
-}
-
-proc update_clients_menu {list} {
-	global item_cascade ffont
-	global saved_clients_str
-
-	if {![info exists saved_clients_str]} {
-		set saved_clients_str ""
-	}
-	if {$list == "INIT"} {
-		set list $saved_clients_str
-	} else {
-		set saved_clients_str $list
-	}
-
-	set subm $item_cascade(current);
-	catch {destroy $subm}
-	menu $subm -tearoff 0 -font $ffont
-	$subm add command
-	$subm add command -label "refresh-list" \
-		-command "update_clients_and_repost"
-	$subm add separator
-	set count 0
-	foreach client [split $list ","] {
-		if {![regexp {^[a-z0-9]*[a-z0-9]:} $client]} {
-			#append_text "Skipping client line: "
-			#append_text $client
-			#append_text "\n"
-			continue
-		}
-		regsub -all {[{}()~!$&*|;'"`{}<>\[\]]} $client "" client
-		#'
-		if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \
-		    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {
-			set id   $m1
-			set user $m4
-			set unix $m5
-			set host $m6
-			regsub {\..*$} $host "" host
-			set clabel "$host $id"
-			if {$unix != "" && $unix != "none"} {
-				set clabel "$unix@$clabel"
-			} elseif {$user != "unknown-user"} {
-				set clabel "$user@$clabel"
-			}
-		} else {
-			regsub {:.*$} $client "" clabel
-		}
-		$subm add command -label "$clabel" \
-			-command "client_dialog \{$client\}"
-		incr count
-	}
-	$subm entryconfigure 0 -label "num-clients: $count"
-}
-
-proc set_widgets {} {
-	global connected_to_x11vnc item_case item_menu item_entry menu_m
-
-	foreach item [array names item_case] {
-		if ![info exists item_case($item)] { continue; }
-		set case $item_case($item)
-		if ![info exists item_menu($item)] { continue; }
-		set menu $item_menu($item)
-		if ![info exists item_entry($item)] { continue; }
-		set entry $item_entry($item)
-		if {$entry < 0} {
-			# skip case under beginner_mode 
-			continue
-		}
-		set type [$menu type $entry]
-		if {$type == "separator" || $type == "tearoff"} {
-			continue
-		}
-		if {![winfo exists $menu]} {
-			continue
-		}
-		if {$connected_to_x11vnc} {
-			if {[active_when_connected $item]} {
-				$menu entryconfigure $entry -state normal
-			} else {
-				$menu entryconfigure $entry -state disabled
-			}
-		} else {
-			if {[active_when_starting $item]} {
-				$menu entryconfigure $entry -state normal
-			} else {
-				$menu entryconfigure $entry -state disabled
-			}
-		}
-	}
-}
-
-proc toggle_simple_gui {} {
-	global beginner_mode simple_gui_created
-	global connected_to_x11vnc make_gui_count
-
-	if {$beginner_mode} {
-		append_text "\nSwitching to simple-gui mode.\n"
-	} else {
-		append_text "\nSwitching to power-user gui mode.\n"
-	}
-
-	if {$make_gui_count == 1} {
-		incr make_gui_count
-	}
-	set simple_gui_created 1
-	make_menu_items
-	set_widgets
-	set_internal_help
-	append_text "\n"
-}
-
-proc little_qs {m} {
-	global bfont ffont beginner_mode
-	global helpremote helptext helplabel
-	global tk_version osname
-
-	if {$tk_version < 8.0} {
-		return
-	}
-	if {$osname == "Darwin"} {
-		return
-	}
-
-	set n [$m index end]
-
-	for {set i 0} {$i <= $n} {incr i} {
-		set type [$m type $i]
-#puts "$m - $i - $type"
-		if {$type == "separator"} {
-			$m add separator
-		} elseif {$type == "tearoff"} {
-			continue;
-		} else {
-			set label [$m entrycget $i -label]
-			set str ""
-			if {[info exists helpremote($label)]} {
-				set str "(?)"
-			} elseif {[info exists helptext($label)]} {
-				set str "(?)"
-			}
-			$m add command -label $str \
-				-font $ffont \
-				-command "menu_help $label";
-
-			if {$str == ""} {
-				$m entryconfigure end -state disabled
-			}
-			set arg "$m,$i"
-#puts "helplabel: $arg -> $label"
-			set helplabel($arg) $label
-			set j [$m index end]
-			set arg "$m,$j"
-			set helplabel($arg) $label
-		}
-		if {$i == 0} {
-			$m entryconfigure end -columnbreak 1
-		}
-	}
-
-	menu_bindings $m
-}
-
-proc make_menu_items {} {
-	global template 
-	global menu_b menu_m menu_count
-	global item_opts item_bool item_case item_menu item_entry menu_var unset_str
-	global item_cascade
-	global bfont ffont beginner_mode simple_gui_created
-	global helptext helpremote helplabel
-
-	# some tweaks...
-	if {![info exists menu_var(deny)]} {
-		set menu_var(deny) 0
-	}
-
-	set case "";
-	set L_casc ""
-	set L_casc_count 0
-	set L_menus [list]
-
-	# Extract the menu items:
-	foreach line [split $template "\n"] {
-		if {[regexp {^Row:} $line]} {
-			continue
-		}
-		if {[regexp {^[A-z]} $line]} {
-			set case [string trim $line]
-
-			if {$simple_gui_created} {
-				set i0 0
-				#if {$case == "Misc"} { # kludge for simple_gui
-				#	set i0 1
-				#}
-				catch {$menu_m($case) delete $i0 end}
-			}
-			set menu_count($case) 0
-			continue;
-		}
-
-		set item [string trim $line]
-		regsub -all {  *} $item " " item
-		if {$item == ""} {
-			continue;
-		}
-		set opts ""
-		if {[regexp {^=} $item]} {
-			set opts [lindex [split $item] 0]
-			regsub {^=} $opts "" opts
-			set item [lindex [split $item] 1]
-		}
-		if {[regexp {^0} $opts]} {
-			continue;
-		}
-		if {[regexp {:$} $item]} {
-			set bool 0
-		} else {
-			set bool 1
-		}
-		regsub {:$} $item {} item
-
-		if {$item == "LOFF"} {
-			set L_casc ""
-			continue
-		}
-
-		if {$item == "-- D"} {
-			set beginner_sep 1
-			set item "--"
-		} else {
-			set beginner_sep 0
-		}
-
-		set item_opts($item) $opts
-		set item_case($item) $case
-		set item_bool($item) $bool
-		set item_cascade($item) ""
-
-		if {$L_casc == ""} {
-			set item_entry($item) $menu_count($case)
-			set m $menu_m($case)
-		} else {
-			# hack for cascades for crowded menus.  See =GAL opts.
-			set item_entry($item) $L_casc_count
-			set m $L_casc
-		}
-
-		set mvar 0 
-
-		if {$beginner_mode && ! $beginner_sep && ![opt_match D $item]} {
-			set item_entry($item) "-1"
-			continue;
-		}
-
-		set item_menu($item) $m
-
-		if {0} { puts "ITEM: $item\t- $opts\t- $case\t- \
-			$bool\t- $menu_count($case)" }
-
-		# Create the menu items, its variables, etc., etc.
-
-		if {$item == "--"} {
-			$m add separator
-
-		} elseif {$item == "Quit"} {
-			# Quit item must shut us down:
-			$m add command -label "$item" -underline 0 \
-				-font $ffont \
-				-command {destroy .; exit 0}
-
-		} elseif {$case == "Help"} {
-			# Help is simple help:
-			$m add command -label "$item" \
-				-font $ffont \
-				-command "menu_help $item"
-
-		} elseif {[opt_match L $item]} {
-			# Special sub-menu cascade (=GAL ends with LOFF)
-			set subm $m.casc_L$menu_count($case)
-			catch {destroy $subm}
-			menu $subm -tearoff 0 -font $ffont
-			set item_cascade($item) $subm
-			$m add cascade -label "$item" \
-				-font $ffont \
-				-menu $subm
-			set L_casc $subm
-			set L_casc_count -1
-			lappend L_menus $L_casc
-
-		} elseif {$item == "current"} {
-			# Current clients cascade
-			set subm $m.current_cascade
-			catch {destroy $subm}
-			set item_cascade($item) $subm
-			update_clients_menu "INIT"
-			$m add cascade -label "$item" \
-				-font $ffont \
-				-menu $subm
-
-		} elseif {[is_action $item]} {
-			# Action
-			$m add command -label "$item" \
-				-font $ffont \
-				-command "do_var $item"
-			if {![info exists menu_var($item)]} {
-				set menu_var($item) "";	# for convenience
-			}
-
-		} elseif {! $item_bool($item)} {
-			# String
-			if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {
-				# Radiobutton select
-				set subm $m.radio_cascade$menu_count($case)
-				catch {destroy $subm}
-				menu $subm -tearoff 0 -font $ffont
-				foreach val [split $m1 ","] {
-					$subm add radiobutton -label "$val" \
-						-command "do_var $item" \
-						-value "$val" \
-						-font $ffont \
-						-variable menu_var($item)
-				}
-				$m add cascade -label "$item" \
-					-font $ffont \
-					-menu $subm
-				set item_cascade($item) $subm
-			} else {
-				# Arbitrary_string
-				$m add command -label "$item" \
-					-font $ffont \
-					-command "do_var $item"
-			}
-			set mvar 1
-
-		} elseif {$item == "simple-gui"} {
-			$m add checkbutton -label "$item" \
-				-command "toggle_simple_gui" \
-				-font $ffont \
-				-variable beginner_mode
-		} else {
-			# Boolean
-			$m add checkbutton -label "$item" \
-				-command "do_var $item" \
-				-font $ffont \
-				-variable menu_var($item)
-			if {![info exists menu_var($item)]} {
-				set menu_var($item) 0
-			}
-		}
-
-		if {$L_casc_count == -1} {
-			incr menu_count($case)
-			incr L_casc_count
-		} elseif {$L_casc != ""} {
-			incr L_casc_count
-		} else {
-			incr menu_count($case)
-		}
-
-		if {$mvar} {
-			if {![info exists menu_var($item)]} {
-				set menu_var($item) $unset_str
-			}
-		}
-	}
-
-	# Now make the little "(?)" help buttons
-	global osname
-	foreach case [array names menu_m] {
-		if {$case == "Help"} {
-			continue;
-		}
-		little_qs $menu_m($case);
-	}
-	foreach m $L_menus {
-		little_qs $m
-	}
-}
-
-proc check_update_vars {} {
-	global last_query_all_time query_all_freq icon_mode
-	global connected_to_x11vnc client_tail client_sock
-
-	set now [clock seconds]
-
-	set delay $query_all_freq
-	if {$client_tail != "" && $client_sock == ""} {
-		set delay [expr 2 * $query_all_freq]
-	}
-
-	if {$connected_to_x11vnc} {
-		set quiet 0
-		set refresh [expr "$last_query_all_time + $delay"]
-
-		# puts "menu_posted $now $last_query_all_time"
-		# puts "menu_posted $refresh"
-
-		if {$now > $refresh} {
-			append_text "Refreshing current settings... "
-			query_all $quiet
-			if {$quiet} {
-				append_text "done\n"
-			}
-		}
-	}
-}
-
-proc menu_posted {} {
-	check_update_vars
-}
-
-proc props_widgets {state} {
-	global props_buttons
-	foreach w $props_buttons {
-		$w configure -state $state	
-	}
-	update
-}
-
-proc props_apply {} {
-	global props_accept props_confirm props_viewonly props_shared 
-	global props_zeroconf props_javaview props_solid
-	global props_passwd props_viewpasswd
-	global prop0_accept prop0_confirm prop0_viewonly prop0_shared
-	global prop0_zeroconf prop0_javaview prop0_solid
-	global prop0_passwd prop0_viewpasswd
-	global menu_var
-	global client_sock
-
-	props_widgets disabled
-
-	set aft 500
-	if {[info exists client_sock]} {
-		if {$client_sock != ""} {
-			set aft 150
-		}
-	}
-	set did 0
-
-	set fail 0
-
-	if {$props_confirm != $prop0_confirm} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_confirm} {
-			push_new_value "accept" "accept" "popup" 1
-		} else {
-			push_new_value "accept" "accept" "" 1
-		}
-		if {$menu_var(accept) == "popup"} {
-			set props_confirm 1
-		} elseif {$menu_var(accept) == ""} {
-			set props_confirm 0
-		}
-		if {$props_confirm == $prop0_confirm} {incr fail}
-		set prop0_confirm $props_confirm
-	}
-
-	if {$props_viewonly != $prop0_viewonly} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_viewonly} {
-			push_new_value "viewonly" "viewonly" 1 1
-		} else {
-			push_new_value "viewonly" "noviewonly" 1 1
-		}
-		if {$menu_var(viewonly)} {
-			set props_viewonly 1
-		} else {
-			set props_viewonly 0
-		}
-		if {$props_viewonly == $prop0_viewonly} {incr fail}
-		set prop0_viewonly $props_viewonly
-	}
-
-	if {$props_shared != $prop0_shared} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_shared} {
-			push_new_value "shared" "shared" 1 1
-		} else {
-			push_new_value "shared" "noshared" 1 1
-		}
-		if {$menu_var(shared)} {
-			set props_shared 1
-		} else {
-			set props_shared 0
-		}
-		if {$props_shared == $prop0_shared} {incr fail}
-		set prop0_shared $props_shared
-	}
-
-	if {$props_zeroconf != $prop0_zeroconf} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_zeroconf} {
-			push_new_value "zeroconf" "zeroconf" 1 1
-		} else {
-			push_new_value "zeroconf" "nozeroconf" 1 1
-		}
-		if {$menu_var(zeroconf)} {
-			set props_zeroconf 1
-		} else {
-			set props_zeroconf 0
-		}
-		if {$props_zeroconf == $prop0_zeroconf} {incr fail}
-		set prop0_zeroconf $props_zeroconf
-	}
-
-	if {$props_javaview != $prop0_javaview} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_javaview} {
-			push_new_value "http" "http" 1 1
-		} else {
-			push_new_value "http" "nohttp" 1 1
-		}
-		if {$menu_var(http)} {
-			set props_javaview 1
-		} else {
-			set props_javaview 0
-		}
-		if {$props_javaview == $prop0_javaview} {incr fail}
-		set prop0_javaview $props_javaview
-	}
-
-	if {$props_solid != $prop0_solid} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_solid} {
-			push_new_value "solid" "solid" 1 1
-		} else {
-			push_new_value "solid" "nosolid" 1 1
-		}
-		if {$menu_var(solid)} {
-			set props_solid 1
-		} else {
-			set props_solid 0
-		}
-		if {$props_solid == $prop0_solid} {incr fail}
-		set prop0_solid $props_solid
-	}
-
-	set fpw 0
-	if {$props_passwd != $prop0_passwd} {
-		set fpw 1
-	}
-	set vpw 0
-	if {$props_viewpasswd != $prop0_viewpasswd} {
-		set vpw 1
-	}
-
-	set pw_ord [list]
-	if {!$fpw && !$vpw } {
-		# neither change
-		;
-	} elseif {$fpw && !$vpw} {
-		# full password change
-		if {$props_passwd == ""} {
-			if {$prop0_viewpasswd != ""} {
-				# set view to "" as well and first
-				set props_viewpasswd ""
-				set pw_ord [list vpw fpw]
-			} else {
-				set pw_ord [list fpw]
-			}
-		} else {
-			# assume view state OK
-			set pw_ord [list fpw]
-		}
-		
-	} elseif {!$fpw && $vpw} {
-		# view password change
-		if {$props_viewpasswd == ""} {
-			# assume full state OK
-			set pw_ord [list vpw]
-		} else {
-			if {$prop0_passwd == ""} {
-				# could be trouble, x11vnc makes random
-				# full passwd...
-				set pw_ord [list vpw]
-			} else {
-				# OK, full non-null.
-				set pw_ord [list vpw]
-			}
-		}
-	} elseif {$fpw && $vpw} {
-		# both full and view password change
-		if {$props_passwd == "" && $props_viewpasswd == ""} {
-			# OK, do view first
-			set pw_ord [list vpw fpw]
-		} elseif {$props_passwd == "" && $props_viewpasswd != ""} {
-			# Not good, do view first anyway x11vnc will fix.
-			set pw_ord [list vpw fpw]
-		} elseif {$props_passwd != "" && $props_viewpasswd == ""} {
-			# OK, view first
-			set pw_ord [list vpw fpw]
-		} elseif {$props_passwd != "" && $props_viewpasswd != ""} {
-			# OK, full first
-			set pw_ord [list fpw vpw]
-		}
-	}
-
-	foreach case $pw_ord {
-		if {$case == "fpw"} {
-			if {$did > 0} {after $aft}; incr did
-			push_new_value "passwd" "passwd" "$props_passwd" 1
-			if {$props_passwd == $prop0_passwd} {incr fail}
-			set prop0_passwd $props_passwd
-		}
-		if {$case == "vpw"} {
-			if {$did > 0} {after $aft}; incr did
-			push_new_value "viewpasswd" "viewpasswd" "$props_viewpasswd" 1
-			if {$props_viewpasswd == $prop0_viewpasswd} {incr fail}
-			set prop0_viewpasswd $props_viewpasswd
-		}
-	}
-
-	if {$props_accept != $prop0_accept} {
-		if {$did > 0} {after $aft}; incr did
-		if {$props_accept} {
-			push_new_value "unlock" "unlock" 1 0
-		} else {
-			push_new_value "lock" "lock" 1 0
-		}
-		if {$props_accept == $prop0_accept} {incr fail}
-		set prop0_accept $props_accept
-	}
-
-	props_widgets normal
-	if {$fail > 0} {
-		return 0
-	} else {
-		return 1
-	}
-}
-
-proc props_advanced {} {
-	global icon_mode props_win full_win
-	global props_advanced_first
-
-	if ![info exists props_advanced_first] {
-		center_win $full_win
-		set props_advanced_first 1
-		set first 1
-	} else {
-		set first 0
-	}
-	update
-	wm deiconify $full_win
-	update
-
-	if {$first} {
-		set w $full_win
-		wm minsize $w [winfo width $w] [winfo height $w]
-	}
-	push_new_value "remote-cmd" "remote-cmd" "Q:clients" 1
-}
-
-proc do_props {} {
-	global props_accept props_confirm props_viewonly props_shared
-	global props_zeroconf props_javaview props_solid
-	global props_passwd props_viewpasswd
-	global prop0_accept prop0_confirm prop0_viewonly prop0_shared
-	global prop0_zeroconf prop0_javaview prop0_solid
-	global prop0_passwd prop0_viewpasswd
-	global menu_var unset_str
-	global have_labelframes ffont bfont
-	global props_buttons icon_noadvanced
-	global icon_mode icon_mode_at_startup
-	global screen_height screen_width
-	global do_props_msg
-
-	set msg ""
-	if {[info exists do_props_msg]} {
-		set msg $do_props_msg
-	}
-
-	check_update_vars
-
-	set pady 0.5m
-	set pady 0.3m
-	if {$screen_height <= 360} {
-		set pady 0m
-	}
-
-	if [info exists menu_var(deny)] {
-		if {$menu_var(deny) == $unset_str || $menu_var(deny) == 0} {
-			set props_accept 1
-		} else {
-			set props_accept 0
-		}
-	} else {
-		set menu_var(deny) 0
-		set props_accept 1
-	}
-	set prop0_accept $props_accept
-
-	if [info exists menu_var(accept)] {
-		if {$menu_var(accept) == $unset_str || $menu_var(accept) == ""} {
-			set props_confirm 0
-		} else {
-			set props_confirm 1
-		}
-	} else {
-		set menu_var(accept) ""
-		set props_confirm 0
-	}
-	set prop0_confirm $props_confirm
-
-	if [info exists menu_var(viewonly)] {
-		if {$menu_var(viewonly) == $unset_str || $menu_var(viewonly) == ""} {
-			set props_viewonly 0
-		} elseif ($menu_var(viewonly)) {
-			set props_viewonly 1
-		} else {
-			set props_viewonly 0
-		}
-	} else {
-		set menu_var(viewonly) 0
-		set props_viewonly 0
-	}
-	set prop0_viewonly $props_viewonly
-
-	if [info exists menu_var(shared)] {
-		if {$menu_var(shared) == $unset_str || $menu_var(shared) == ""} {
-			set props_shared 0
-		} elseif ($menu_var(shared)) {
-			set props_shared 1
-		} else {
-			set props_shared 0
-		}
-	} else {
-		set menu_var(shared) 0
-		set props_shared 0
-	}
-	set prop0_shared $props_shared
-
-	if [info exists menu_var(zeroconf)] {
-		if {$menu_var(zeroconf) == $unset_str || $menu_var(zeroconf) == ""} {
-			set props_zeroconf 0
-		} elseif ($menu_var(zeroconf)) {
-			set props_zeroconf 1
-		} else {
-			set props_zeroconf 0
-		}
-	} else {
-		set menu_var(zeroconf) 0
-		set props_zeroconf 0
-	}
-	set prop0_zeroconf $props_zeroconf
-
-	if [info exists menu_var(http)] {
-		if {$menu_var(http) == $unset_str || $menu_var(http) == ""} {
-			set props_javaview 0
-		} elseif ($menu_var(http)) {
-			set props_javaview 1
-		} else {
-			set props_javaview 0
-		}
-	} else {
-		set menu_var(http) 0
-		set props_javaview 0
-	}
-	set prop0_javaview $props_javaview
-
-	if [info exists menu_var(solid)] {
-		if {$menu_var(solid) == $unset_str || $menu_var(solid) == ""} {
-			set props_solid 0
-		} elseif ($menu_var(solid)) {
-			set props_solid 1
-		} else {
-			set props_solid 0
-		}
-	} else {
-		set menu_var(solid) 0
-		set props_solid 0
-	}
-	set prop0_solid $props_solid
-
-	if ![info exists props_passwd] {
-		set props_passwd ""
-	}
-	set prop0_passwd $props_passwd
-
-	if ![info exists props_viewpasswd] {
-		set props_viewpasswd ""
-	}
-	set prop0_viewpasswd $props_viewpasswd
-
-	if [info exists props_buttons] {
-		catch {unset props_buttons}
-	}
-	set props_buttons [list]
-
-	set wp .props
-	set w $wp
-	catch {destroy $wp}
-	toplevel $wp
-	wm title $wp "x11vnc Properties"
-	frame $w.lf
-	set w $w.lf
-	set b1 "$w.buttons1"
-	frame $b1
-	button $b1.ok -text OK -command "if {\[props_apply\]} {destroy $wp}" -font $bfont
-	button $b1.cancel -text Cancel -command "destroy $wp" -font $bfont
-	button $b1.apply  -text Apply -command "props_apply" -font $bfont
-
-	bind $w <KeyPress-Escape> "destroy $wp"
-
-	pack $b1.ok $b1.cancel $b1.apply -side left -expand 0
-	lappend props_buttons $b1.apply $b1.cancel $b1.ok
-
-	set b2 "$w.buttons2"
-	frame $b2
-
-	button $b2.advanced -text " Advanced ... " \
-		-command "destroy $wp; props_advanced" -font $bfont
-	if {! $icon_noadvanced} {
-		lappend props_buttons $b2.advanced
-		pack $b2.advanced -side left -expand 0
-	}
-
-	button $b2.help -text "  Help  " -command "menu_help Properties" -font $bfont
-	lappend props_buttons $b2.help
-	pack $b2.help -side left -expand 0
-
-	set pw "$w.passwd"
-	if {$have_labelframes} {
-		labelframe $pw -text "Password" -font $bfont
-	} else {
-		frame $pw
-		set l $pw.l
-		label $l -text "Password:" -justify left -anchor w -font $bfont
-		pack $pw.l -fill x -expand 1 -padx 1m -pady 0m -side top
-	}
-	entry $pw.e -show "*" -textvariable props_passwd -font $bfont
-	pack $pw.e -fill x -expand 1 -padx 1m -pady $pady -side top
-
-	global x11vnc_icon_mode
-	if {! $x11vnc_icon_mode} {
-		catch { $pw.e configure -state disabled}
-		if {! $have_labelframes} {
-			catch { $pw.l configure -state disabled}
-		}
-	} else {
-		lappend props_buttons $pw.e
-	}
-
-
-	set vp "$w.viewpw"
-	if {$have_labelframes} {
-		labelframe $vp -text "ViewOnly Password" -font $bfont
-	} else {
-		frame $vp
-		set l $vp.l
-		label $l -text "ViewOnly Password:" -justify left -anchor w -font $bfont
-		pack $vp.l -fill x -expand 1 -padx 1m -pady 0m -side top
-	}
-	entry $vp.e -show "*" -textvariable props_viewpasswd -font $bfont
-	pack $vp.e -fill x -expand 1 -padx 1m -pady $pady -side top
-
-	if {! $x11vnc_icon_mode} {
-		catch { $vp.e configure -state disabled}
-		if {! $have_labelframes} {
-			catch { $vp.l configure -state disabled}
-		}
-	} else {
-		lappend props_buttons $vp.e
-	}
-
-	if {! $icon_mode_at_startup} {
-		$vp.e configure -state disabled
-		catch {$vp.l configure -state disabled}
-		catch {$vp configure -state disabled}
-		catch {$vp configure -foreground grey60}
-		$pw.e configure -state disabled
-		catch {$pw.l configure -state disabled}
-		catch {$pw configure -state disabled}
-		catch {$pw configure -foreground grey60}
-	}
-
-	set sb "$w.solid"
-	frame $sb
-	checkbutton $sb.button -text "Solid Background Color" \
-		-variable props_solid -anchor w -font $bfont
-	pack $sb.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set jv "$w.javaview"
-	frame $jv
-	checkbutton $jv.button -text "Serve Java Viewer Applet" \
-		-variable props_javaview -anchor w -font $bfont
-	pack $jv.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set zc "$w.zeroconf"
-	frame $zc
-	checkbutton $zc.button -text "Advertise Service (Zeroconf)" \
-		-variable props_zeroconf -anchor w -font $bfont
-	pack $zc.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set sh "$w.shared"
-	frame $sh
-	checkbutton $sh.button -text "Shared" \
-		-variable props_shared -anchor w -font $bfont
-	pack $sh.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set vo "$w.viewonly"
-	frame $vo
-	checkbutton $vo.button -text "All Clients ViewOnly" \
-		-variable props_viewonly -anchor w -font $bfont
-	pack $vo.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set cf "$w.confirm"
-	frame $cf
-	checkbutton $cf.button -text "Ask for Confirmation" \
-		-variable props_confirm -anchor w -font $bfont
-	pack $cf.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set ac "$w.accept"
-	frame $ac
-	checkbutton $ac.button -text "Accept Connections" \
-		-variable props_accept -anchor w -font $bfont
-	pack $ac.button -fill x -expand 1 -padx 1m -pady $pady
-
-	set px "6m"
-	pack $b1 -side bottom -fill x -pady $pady -padx $px
-	pack $b2 -side bottom -fill x -pady $pady -padx $px
-	pack $vp -side bottom -fill x -pady $pady -padx $px
-	pack $pw -side bottom -fill x -pady $pady -padx $px
-	pack $sb -side bottom -fill x -pady 0m -padx $px
-	pack $jv -side bottom -fill x -pady 0m -padx $px
-	pack $zc -side bottom -fill x -pady 0m -padx $px
-	pack $sh -side bottom -fill x -pady 0m -padx $px
-	pack $vo -side bottom -fill x -pady 0m -padx $px
-	pack $cf -side bottom -fill x -pady 0m -padx $px
-	pack $ac -side bottom -fill x -pady 0m -padx $px
-
-	global show_props_instructions
-	if {![info exists show_props_instructions]} {
-		set show_props_instructions 1
-	}
-
-	wm withdraw .props
-
-	set wl $w
-
-	pack $wl -side left
-
-	if {$msg != ""} {
-		set tw [textwidth $msg]
-		set th [textheight $msg]
-		set th [expr $th - 1]
-		set ms ".props.msg"
-		text $ms -font $ffont -relief ridge -width $tw -height $th
-		$ms insert 1.0 $msg
-
-		set si "$wl.instructions"
-		frame $si
-		checkbutton $si.button -text "Show Instructions" \
-			-variable show_props_instructions -anchor w -font $bfont \
-			-command "toggle_instructions $ms $pady $px"
-
-		pack $si.button -fill x -expand 1 -padx 1m -pady $pady
-		pack $si -side bottom -fill x -pady 0m -padx $px
-
-		if {$show_props_instructions} {
-			pack $ms -side left -fill both
-		}
-
-		update
-	}
-
-
-	lappend props_buttons $ac.button $cf.button $vo.button $sh.button $zc.button $jv.button $sb.button
-
-	
-	set w .props
-	update
-	wm resizable $w 1 0
-	center_win $w
-	update
-
-	#wm minsize $w [winfo width $w] [winfo height $w]
-
-	tkwait window $w
-	set show_props_instructions 0
-}
-
-proc toggle_instructions {ms pady px} {
-	global show_props_instructions
-	if {$show_props_instructions} {
-		pack $ms -side left -fill both
-	} else {
-		pack forget $ms
-	}
-	catch {pack .props}
-	update
-}
-
-proc do_new_client {} {
-	global newclient ffont bfont
-
-	set w .newclient
-	catch {destroy $w}
-	toplevel $w
-	label $w.l -text "Hostname: " -font $bfont
-	set newclient ""
-	entry $w.e -width 16 -textvariable newclient -font $bfont 
-	button $w.b -text OK -command "destroy $w" -font $bfont
-	button $w.h -text Help -command "menu_help NewClient" -font $bfont
-	bind $w.e <Return> "update; after 100; destroy $w"
-
-	wm title $w "New Client"
-
-	pack $w.l $w.e $w.h $w.b -side left -pady 1m -padx 0.5m
-	focus $w.e
-	center_win $w
-	update 
-	
-	tkwait window $w
-
-	regsub -all {[{}()~!$&*|;'"`{}<>\[\]]} $newclient "" newclient
-	#'
-	if {$newclient != ""} {
-		push_new_value "connect" "connect" "$newclient" 1
-	}
-}
-
-proc do_disconnect_all {} {
-	push_new_value "disconnect" "disconnect" "all" 1
-}
-
-proc do_disconnect_client {id} {
-	push_new_value "disconnect" "disconnect" "$id" 1
-}
-
-proc popup_post {m} {
-	global popup_cascade_posted client_balloon
-	global client_id_list
-
-	set popup_cascade_posted 0
-	
-	set wd "$m.disconnect"
-
-	if {![winfo exists $wd]} {
-		return
-	}
-
-	catch {$wd delete 0 end}
-
-	$wd add command -label "Disconnect client:"
-	$wd add separator
-	$wd add command -label "All Clients" -command do_disconnect_all
-
-	if {![info exists client_id_list]} {
-		return
-	}
-
-	foreach client $client_id_list {
-		if {$client == ""} {
-			continue
-		}
-		if {[regexp {^([^:]*):(.*)$} $client mat id lab]} {
-			set nid [expr "$id + 0"]
-			$wd add command -label "$nid $lab" \
-				-command "do_disconnect_client $id"
-		}
-	}
-}
-
-proc pmenu {m x y} {
-	if {![winfo exists $m]} {
-		return
-	}
-	set x [expr $x-10]
-	set y [expr $y-10]
-	$m post $x $y
-	# XXX more care needed
-	grab set -global $m
-}
-
-proc set_client_balloon {str} {
-	global client_balloon vnc_display
-	global client_id_list
-
-	set client_id_list [list]
-	
-	set client_balloon "$vnc_display"
-	set count 0
-	regsub -all {^.*aro=clients:} $str "" str
-	regsub -all {aro=.*$} $str "" str
-	regsub -all {ans=.*$} $str "" str
-	foreach client [split $str ","] {
-		#puts "client: $client"
-		if [regexp {^[ 	]*$} $client] {
-			continue
-		}
-		if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \
-		    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {
-			set id    $m1
-			set nid   [expr "$m1 + 0"]
-			set ip    $m2
-			set port  $m3
-			set user  $m4
-			set unix  $m5
-			if {[string length $user] >= 24} {
-				# weird identd hash...
-				set user [string range $user 0 8]
-				set user "${user}..."
-			}
-			if {$unix != "" && $unix != "none"} {
-				set user $unix
-			}
-			set host  $m6
-			set input $m7
-			set vo    $m8
-			set ltime $m9
-			if [regexp {^[ 	]*$} $host] {
-				set host $ip
-			}
-			set client_balloon "${client_balloon}\n$nid $user\@$host"
-			if {$vo == "1"} {
-				set client_balloon "${client_balloon} - view"
-				lappend client_id_list "$id:$user\@$host - view"
-			} else {
-				set client_balloon "${client_balloon} - full"
-				lappend client_id_list "$id:$user\@$host - full"
-			}
-		} else {
-			set i [expr $count+1]
-			if {$i == 1} {
-				set client_balloon "${client_balloon}\nunknown-host$i"
-			}
-		}
-		incr count
-	}
-	if {$count == 0} {
-		set client_balloon "${client_balloon}\nNo connections."
-	}
-	icon_win_cfg $count
-}
-
-proc read_client_info {channel} {
-	global x11vnc_client_file client_str client_info_read
-	global read_client_info_lock
-	global read_clients
-	set db 0
-
-	set read_clients 0
-
-	if {![info exists read_client_info_lock]} {
-		set read_client_info_lock 0
-	}
-
-	if {$channel != ""} {
-
-		if {$read_client_info_lock} {
-			return
-		}
-		set read_client_info_lock 1
-		after 100
-		set str ""
-		set count [gets $channel str]
-		if {$db} {puts stderr "read_client_info-$channel: $str"}
-
-		if {$count == -1 || [eof $channel]} {
-			close $channel
-			catch {file delete $x11vnc_client_file}
-			set read_client_info_lock 0
-			clean_icon_exit
-		}
-		if {$count > 0 && ![regexp {^[ 	]*$} $str]} {
-			set client_info_read 1
-			if {$str == "quit"} {
-				catch {file delete $x11vnc_client_file}
-				set read_client_info_lock 0
-				clean_icon_exit
-			} elseif {$str == "skip"} {
-				;
-			} elseif [regexp {^clients:} $str] {
-				regsub {^clients:} $str "" str
-				set read_clients 1
-				if {$str == "none"} {
-					set str ""
-				}
-				update_clients_menu $str
-				set client_str $str
-				set_client_balloon $str
-			}
-		}
-		set read_client_info_lock 0
-	}
-}
-
-proc check_set_vnc_display {} {
-	
-	global read_clients check_set_vnc_display_done
-
-	if {[info exists check_set_vnc_display_done]} {
-		return
-	}
-	if {[info exists read_clients]} {
-		if {$read_clients} {
-			after 250
-			query_all
-			global client_str
-			set_client_balloon $client_str
-			set check_set_vnc_display_done 1
-		}
-	}
-}
-
-proc read_client_tail {} {
-	global client_tail
-
-	if {$client_tail != ""} {
-		read_client_info $client_tail
-		check_set_vnc_display
-	}
-}
-
-proc read_client_sock {} {
-	global client_sock
-
-	if {$client_sock != ""} {
-		read_client_info $client_sock
-		check_set_vnc_display
-	}
-}
-
-proc show_client_balloon {} {
-	global icon_mode icon_win props_win full_win
-	global client_balloon ffont connected_to_x11vnc
-
-	set noinfo "tkx11vnc: no client information"
-	set noinfo "$noinfo\navailable from x11vnc ..."
-	if ![info exists client_balloon] {
-		set client_balloon $noinfo
-	}
-	if {$client_balloon == ""} {
-		set client_balloon $noinfo
-	}
-	if {! [info exists icon_win]} {
-		return
-	} elseif {$icon_win == ""} {
-		return
-	} elseif {! [winfo exists $icon_win]} {
-		return
-	}
-
-	set x [expr [winfo rootx $icon_win] + ([winfo width $icon_win]/2)]
-	set y [expr [winfo rooty $icon_win] + [winfo height $icon_win] + 4]
-
-	set infotext $client_balloon
-	if {!$connected_to_x11vnc} {
-		set infotext "Not currently attached to x11vnc\nLast available info:\n$infotext"
-	}
-
-	set w .client_balloon
-	catch {destroy $w}
-	toplevel $w -bg black -screen [winfo screen $icon_win]
-	wm overrideredirect $w 1
-	label $w.l -text "$infotext" -relief flat -bg "#ffffaa" -fg black \
-		-padx 2 -pady 0 -anchor w -justify left -font $ffont
-	pack $w.l -side left -padx 1 -pady 1
-
-	set w2 [winfo reqwidth  $w.l]
-	set h2 [winfo reqheight $w.l]
-
-	set W [winfo screenwidth  $w]
-	set H [winfo screenheight $w]
-
-	if {[expr $x+$w2] > $W} {
-		set w3 [winfo width $icon_win]
-		set x [expr "$W - $w2 - $w3 - 4"] 
-	}
-	if {[expr $y+$h2] > $H} {
-		set h3 [winfo height $icon_win]
-		set y [expr "$H - $h2 - $h3 - 4"] 
-	}
-
-	wm geometry $w +${x}+${y}
-}
-
-proc kill_client_balloon {} {
-	global client_balloon_id client_balloon_win
-	if [info exists client_balloon_id] {
-		catch {after cancel $client_balloon_id}
-	}
-	if [winfo exists .client_balloon] {
-		destroy .client_balloon
-	}
-}
-
-proc icon_win_cfg {clients} {
-	global icon_win client_tail client_sock client_info_read
-
-	if {! [info exists icon_win]} {
-		return
-	} elseif {$icon_win == ""} {
-		return
-	} elseif {! [winfo exists $icon_win]} {
-		return
-	}
-	if {$clients > 0} {
-		$icon_win configure -bg black -fg white
-	} else {
-		$icon_win configure -bg white -fg black
-	}
-
-	if {$client_tail == "" || !$client_info_read} {
-		if {$client_sock == ""} {
-			$icon_win configure -fg red
-		}
-	}
-}
-
-proc server_accept {sock addr port} {
-	global socket_cookie server socket_got_callback
-	global client_tail client_sock
-	set db 0
-
-	if {$db} {puts stderr "sock=$sock addr=$addr port=$port"}
-
-	update; update idletasks
-	after 50
-	update; update idletasks
-	set count [gets $sock str]
-
-	if {$count >= 0} {
-		set str [string trim $str]
-		if {$db} {puts stderr "server_accept: \"$str\""}
-		if {$str == "COOKIE:$socket_cookie"} {
-			set client_sock $sock
-			if {$db} {puts stderr "cookie matched. $client_sock"}
-		} else {
-			if {$db} {puts stderr "cookie NO matched."}
-		}
-	}
-	catch {close $server}
-	set socket_got_callback 1
-	if {$db} {puts stderr "socket_got_callback $socket_got_callback"}
-}
-
-proc try_client_info_sock {} {
-	global socket_cookie server socket_got_callback
-	global x11vnc_started x11vnc_xdisplay hostname client_sock
-	global x11vnc_xdisplay0 menu_var
-
-	set db 0
-#dtime t1
-	set start 13037
-	set tries 100
-	set socket_got_callback 0
-
-	set xd $x11vnc_xdisplay
-	if {$xd == "" && $x11vnc_xdisplay0 != ""} {
-		set xd $x11vnc_xdisplay0
-	}
-	if {$xd == "" && [info exists menu_var(display)]} {
-		set xd $menu_var(display)
-	}
-
-	set myaddr ""
-	regsub {\..*$} $hostname "" shost
-	if {$x11vnc_started} {
-		set myaddr "127.0.0.1"
-	} elseif {$xd != ""} {
-		if {[regexp {^:} $xd]} {
-			set myaddr "127.0.0.1"
-		} elseif {[regexp -nocase "^$shost" $xd]} {
-			set myaddr "127.0.0.1"
-		} elseif {[regexp -nocase "^localhost" $xd]} {
-			set myaddr "127.0.0.1"
-		} else {
-			set myaddr $hostname
-		}
-	} else {
-		set myaddr $hostname
-	}
-	
-	for {set i 0} {$i <= $tries} {incr i} {
-		set port [expr $start + $i]
-		set server [socket -server server_accept -myaddr $myaddr $port]
-		if {$server == ""} {
-			continue
-		}
-		if {[eof $server]} {
-			continue
-		}
-		set err ""
-		catch {set err [fconfigure $server -error]}
-		#puts "err: $server: $err"
-		if {$err == ""} {
-			break
-		}
-	}
-	if {$server == ""} {
-		append_text "try_client_info_sock: server socket failed.\n"
-		return
-	}
-	if {! $x11vnc_started} {
-		run_remote_cmd [list "-nosync" "-R" "noop"]
-		if {$db} {dtime A}
-		after 250
-		if {$db} {dtime A}
-	}
-
-	# set the cookie to some obscured randomness
-	set socket_cookie [clock clicks]
-	set r [expr rand()]
-	if {$r != ""} {
-		append socket_cookie $r
-	}
-	set r ""
-	catch {set r [winfo id .]}
-	if {$r != ""} {
-		append socket_cookie $r
-	}
-	if {[regexp {([0-9])([0-9])$} [clock clicks] m m1 m2]} {
-		regsub -all {\.} $socket_cookie $m1 socket_cookie
-		regsub -all {x}  $socket_cookie $m2 socket_cookie
-	}
-	run_remote_cmd [list "-nosync" "-R" \
-		"client_info_sock:$myaddr:$port:$socket_cookie"]
-#dtime t2
-	if {$db} {puts "client_info_sock:$myaddr:$port:$socket_cookie"}
-	for {set i 0} {$i < 10} {incr i} {
-		after 50
-		update; update idletasks
-#dtime aa
-		if {$socket_got_callback != 0} {
-#puts "break-"
-			break
-		}
-	}
-#dtime t3
-
-	set aftid ""
-	if {$socket_got_callback == 0} {
-		set aftid [after 10000 {set socket_got_callback 2}]
-		tkwait variable socket_got_callback
-	}
-
-	if {$aftid != ""} {
-		catch {after cancel $aftid}
-	}
-
-	if {$socket_got_callback != 1} {
-		puts stderr "try_client_info_sock failed: no callback\n"
-		catch {close $server}
-	} else {
-		setup_client_sock 1
-	}
-#dtime t4
-}
-
-proc set_icon_label {} {
-	global icon_win
-
-	set lab [get_icon_label]
-
-	if {! [info exists icon_win]} {
-		return
-	} elseif {$icon_win == ""} {
-		return
-	} elseif {! [winfo exists $icon_win]} {
-		return
-	}
-	
-	if {[info exists icon_win]} {
-		$icon_win configure -text $lab
-	}
-}
-
-proc get_icon_label {{set 0}} {
-	global icon_minimal 
-
-	set lab0 "x11\nvnc"
-	
-	if {$icon_minimal} {
-		set lab [get_vnc_display_number]
-		if {$lab != "none"} {
-			#set lab "  :$lab"
-			set lab ":$lab"
-		} else {
-			set lab "-"
-		}
-	} else {
-		set lab $lab0
-	}
-	return $lab
-}
-
-# currently unused
-proc lmenu {menu} {
-	global popup_cascade_posted
-	global left_iconwin_menu
-	set left_iconwin_menu 1
-	after 100
-	update
-	if {!$popup_cascade_posted && $left_iconwin_menu} {
-		for {set i 0} {$i < 3} {incr i} {
-			after 100
-			update
-		}
-		if {!$popup_cascade_posted && $left_iconwin_menu} {
-			$menu unpost
-			return
-		}
-	}
-	# kludge for WindowView
-	if {$popup_cascade_posted} {
-		focus $menu
-	}
-}
-
-proc old_balloon {} {
-	global client_str saved_clients_str
-	set str ""
-	if {[info exists client_str]} {
-		if {$client_str != ""} {
-			set str $client_str
-		}
-	}
-	if {$str == ""} {
-		if {[info exists saved_clients_str]} {
-			set str $saved_clients_str
-		}
-	}
-	if {$str != ""} {
-		set_client_balloon $str
-	}
-}
-
-proc get_custom_menu_items {} {
-	global env custom_last_read
-
-	if {![info exists custom_last_read]} {
-		set custom_last_read 0
-	}
-	if {[info exists env(X11VNC_CUSTOM_GUI)]} {
-		set custom "$env(X11VNC_CUSTOM_GUI)"
-	} elseif {![info exists env(HOME)]} {
-		return [list "none"]
-	} else {
-		set custom "$env(HOME)/.x11vnc.gui"
-	}
-	if {![file exists $custom]} {
-		return [list "none"]
-	}
-
-#	if {[file mtime $custom] <= $custom_last_read} {
-#		return [list "nochange"]
-#	}
-
-	set in ""
-	catch {set in [open $custom "r"]} 
-	if {$in == ""} {
-		return [list "none"]
-	}
-
-	set custom_last_read [clock seconds]
-
-	set count 0
-	while {[gets $in line] > -1} {
-		if {[regexp {^[ \t]*#} $line]} {
-			continue
-		}
-		set line [string trim $line]
-		if {$line != ""} {
-			lappend items $line
-			incr count
-		}
-	}
-	close $in
-	
-	if {$count > 0} {
-		return $items
-	} else {
-		return [list "none"]
-	}
-}
-
-proc make_custom_menu {menu font} {
-	set items [get_custom_menu_items]
-	set i0 [lindex $items 0]
-	catch {$menu delete 0 end}
-	if {$i0 != "none"} {
-		$menu add command -font $font -label "Custom items:"
-		$menu add separator
-		foreach item $items {
-			if {$item == "sep" || $item == "separator"} {
-				$menu add separator
-				continue
-			}
-			if {[regexp {^action:(.*)$} $item m action]} {
-				$menu add command -font $font -label "$action" \
-				    -command "do_var $action"
-				continue
-			}
-			$menu add command -font $font -label "$item" \
-		 	    -command "run_remote_cmd \[list \"-R\" \"$item\"\]"
-		}
-	}
-}
-
-proc make_icon {} {
-	global icon_mode icon_embed_id icon_win props_win full_win
-	global tray_embed tray_running env
-	global x11vnc_client_file client_tail client_sock client_str saved_clients_str
-	global client_balloon_id
-	global bfont sfont snfont ffont
-	global icon_minimal gui_start_mode
-	global popup_cascade_posted menu_var x11vnc_gui_geom
-	set min_x 24
-	set min_y 24
-	
-	set font $bfont
-	set mfont $font
-
-	if {$tray_embed} {
-		set font $sfont
-		set mfont $snfont
-	}
-	if {[info exists env(X11VNC_ICON_FONT)]} {
-		set font $env(X11VNC_ICON_FONT)
-	}
-	if {[regexp {([0-9][0-9]*)x([0-9][0-9]*)} $x11vnc_gui_geom m mx my]} {
-		if {$mx < $min_x} {
-			set min_x $mx
-		}
-		if {$my < $min_y} {
-			set min_y $my
-		}
-	}
-	wm minsize . $min_x $min_y
-
-	if {$tray_embed && $tray_running} {
-		wm withdraw .
-	}
-
-	set l .icon
-	set icon_win $l
-	catch destroy {$icon_win}
-	if {$icon_minimal} {
-		set bw 1
-	} else {
-		set bw 5
-	}
-	set lab [get_icon_label]
-	label $l -text $lab -borderwidth $bw -font $font
-	icon_win_cfg 0
-
-
-	set popup_cascade_posted 0
-	pack $l -fill both -expand 1
-	set menu "$l.menu"
-	menu $menu -tearoff 0 -postcommand "popup_post $menu"
-	$menu add command -font $mfont -label "Properties" -command do_props
-	$menu add command -font $mfont -label "Help" -command "menu_help Tray"
-	$menu add command -font $mfont -label "Logfile" -command show_logfile
-	$menu add separator
-	$menu add command -font $mfont -label "New Client" -command do_new_client
-
-	set wd "$menu.disconnect"
-	catch {destroy $wd}
-	menu $wd -tearoff 0 -font $ffont \
-		-postcommand {set popup_cascade_posted 1}
-	$wd add command -label "Disconnect client:"
-	$wd add separator
-	$wd add command -label "All Clients" -command do_disconnect_all
-	$menu add cascade -font $mfont -label "Disconnect:" -menu $wd
-
-	$menu add separator
-
-	set wv "$menu.windowview"
-	catch {destroy $wv}
-	menu $wv -tearoff 0 -font $ffont \
-		-postcommand {set popup_cascade_posted 1}
-	foreach val {full icon tray} {
-		$wv add radiobutton -label "$val" \
-			-value "$val" -font $ffont \
-			-command "do_var WindowView" \
-			-variable menu_var(WindowView)
-	}
-	$menu add cascade -font $mfont -label "Window View:" -menu $wv
-
-	$menu add command -font $mfont -label "Dismiss" -command "$menu unpost"
-	$menu add command -font $mfont -label "Stop x11vnc" -command clean_icon_exit
-
-	set items [get_custom_menu_items]
-	set i0 [lindex $items 0]
-	if {$i0 != "none" && $i0 != "nochange"} {
-		$menu add separator
-		set cm "$menu.custom"
-		catch {destroy $cm}
-		menu $cm -tearoff 0 -font $ffont \
-			-postcommand "set popup_cascade_posted 1; make_custom_menu $cm $ffont"
-		$menu add cascade -font $mfont -label "Custom:" -menu $cm
-	}
-
-	bind $icon_win <ButtonRelease-1> "pmenu $menu %X %Y"
-	bind $icon_win <ButtonRelease-3> "pmenu $menu %X %Y"
-	bind $icon_win <Enter> {set client_balloon_id [after 500 show_client_balloon]}
-	bind $icon_win <Button> {kill_client_balloon}
-	bind $icon_win <Leave>  {kill_client_balloon}
-	bind $icon_win <Shift-ButtonRelease-1> {kill_client_balloon; show_client_balloon}
-	bind $icon_win <ButtonRelease-2> {kill_client_balloon; show_client_balloon}
-#	bind $menu <Leave> "lmenu $menu"
-#	bind $menu <Enter> "set left_iconwin_menu 0"
-#	bind $menu <KeyPress-Escape> "$menu unpost"
-
-	bind . <Control-KeyPress-c> {destroy .; exit 0}
-
-	if {!$tray_embed || !$tray_running} {
-		global x11vnc_gui_geom
-		if {$x11vnc_gui_geom != ""} {
-			set doit 1
-			if {[regexp {x} $x11vnc_gui_geom]} {
-				if {$gui_start_mode == "full"} {
-					set doit 0
-				}
-			} 
-			if {$doit} {
-				wm geometry . $x11vnc_gui_geom
-			}
-		}
-	}
-	wm iconname . "tkx11vnc"
-	wm title . "tkx11vnc"
-	update
-	if {$tray_embed && $tray_running} {
-		#wm deiconify .;   #  why did we have this???
-		#after 10000 {wm deiconify .; puts "reqheight [winfo reqheight .]"; puts "reqwidth  [winfo reqwidth  .]"; puts "height [winfo height .]"; puts "width  [winfo width  .]"}
-	} else {
-		wm deiconify .
-	}
-	update
-
-#puts "reqheight [winfo reqheight .]"
-#puts "reqwidth  [winfo reqwidth  .]"
-#puts "height [winfo height .]"
-#puts "width  [winfo width  .]"
-#puts "AAA"
-
-	old_balloon
-}
-
-proc setup_client_channel {} {
-	global client_sock client_tail
-
-# XXX/setup_client_channel
-	if {$client_sock == "" } {
-		stop_watch on
-		try_client_info_sock
-		if {$client_sock == "" } {
-			after 500
-			try_client_info_sock
-		}
-		stop_watch off
-	}
-	if {$client_tail == "" && $client_sock == ""} {
-		set m "\n"
-		set m "${m}tkx11vnc:\n"
-		set m "${m}\n"
-		set m "${m}    Warning -- running in icon/tray mode but the\n"
-		set m "${m}    connected client info channel from x11vnc is\n"
-		set m "${m}    not working.  The viewer client list and icon\n"
-		set m "${m}    color indicator will not be accurate.\n"
-		set m "${m}\n"
-		set m "${m}    You may need to restart \"x11vnc -gui tray ...\"\n"
-		set m "${m}    for this to work properly.\n"
-		set m "${m}\n"
-		textwin "Warning" "Warning" $m
-		update
-	}
-	dtime C
-}
-
-proc clean_client_tail {} {
-	global client_tail client_info_read
-	if [info exists client_tail] {
-		if {$client_tail != ""} {
-			set p ""
-			catch {set p [pid $client_tail]}
-			if {$p != ""} {
-				catch {exec kill -TERM $p >/dev/null 2>/dev/null}
-			}
-			catch {close $client_tail}
-			set client_tail ""
-		}
-	}
-	set client_info_read 0
-}
-
-proc clean_icon_exit {} {
-	clean_client_tail
-	push_new_value "stop" "stop" 1 0
-	set_connected no
-	update
-	destroy .
-	exit
-}
-
-proc make_gui {mode} {
-	global icon_mode tray_embed tray_running full_win icon_win
-	global top_widget_names x11vnc_gui_geom
-	global gui_current_state make_gui_count
-	global x11vnc_connect connected_to_x11vnc
-	global x11_display
-	global gui_start_mode
-
-	incr make_gui_count
-
-	if {$gui_start_mode == ""} {
-		set gui_start_mode $mode
-	}
-
-	wm withdraw .
-
-	set full_geom ""
-	if {[winfo exists .full]} {
-		catch {set full_geom [wm geometry .full]}
-	}
-
-	set fw .full
-	set full_win $fw
-	catch {pack forget $full_win}
-	catch {pack forget $icon_win}
-	catch {destroy $full_win}
-	catch {destroy $icon_win}
-
-	wm minsize . 1 1
-
-	set gui_current_state ""
-
-	if {$mode == "full"} {
-		frame $fw
-		set icon_mode 0
-
-		wm protocol .     WM_DELETE_WINDOW "destroy .; exit"
-		make_widgets $fw
-
-		set w "."
-		wm geometry $w ""
-		if {$x11vnc_gui_geom != ""} {
-			set doit 1
-			if {[regexp {x} $x11vnc_gui_geom]} {
-				if {$gui_start_mode != $mode} {
-					set doit 0
-				}
-			}
-			if {$doit} {
-				wm geometry $w $x11vnc_gui_geom
-			}
-		}
-		pack $fw -fill both -expand 1
-
-	} elseif {$mode == "icon" || $mode == "tray"} {
-
-		toplevel $fw
-		wm withdraw $fw
-
-		wm protocol $fw WM_DELETE_WINDOW "wm withdraw .full"
-		wm protocol .   WM_DELETE_WINDOW "clean_icon_exit"
-		
-		if {$mode == "icon"} {
-			set tray_embed 0
-		} elseif {$mode == "tray"} {
-			set tray_embed 1
-		}
-		set icon_mode 1
-		make_widgets $fw
-		set w $fw
-		make_icon
-		wm geometry $fw ""
-		wm geometry .   ""
-	} else {
-		return
-	}
-	set_view_variable $mode
-	set gui_current_state $mode
-
-
-	update
-	if {!$tray_embed || !$tray_running} {
-		wm deiconify .
-	}
-	update idletasks
-	wm minsize $w [winfo width $w] [winfo height $w]
-	if {$mode == "full" && $make_gui_count > 1} {
-		center_win .
-	}
-
-
-	if {$make_gui_count == 1} {
-		copy_default_vars
-		if {$x11vnc_connect} {
-			try_connect_and_query_all
-		} else {
-			insert_cmdline_vars
-		}
-	} else {
-		set_name "RESTORE"
-	}
-
-	setup_client_tail
-
-	set_widgets
-
-	if {$mode == "tray"} {
-		setup_tray_embed
-	}
-}
-
-proc make_widgets {top} {
-	global template make_gui_count
-	global menu_b menu_m menu_count
-	global item_opts item_bool item_case item_menu item_entry menu_var unset_str
-	global item_cascade
-	global info_label info_str x11_display vnc_display
-	global text_area text_area_str
-	global entry_box entry_str entry_set entry_label entry_ok entry_browse
-	global entry_help entry_skip
-	global bfont ffont beginner_mode
-	global helptext helpremote helplabel
-	global icon_mode icon_win props_win full_win
-	global top_widget_names
-	global screen_height screen_width
-
-
-	# Make the top label
-	set label_width 84
-	if {$screen_width <= 400} {
-		set label_width 64
-	}
-	set info_label "$top.info"
-	label $info_label -textvariable info_str -bd 2 -relief groove \
-		-anchor w -width $label_width -font $ffont
-	pack $info_label -side top -fill x -expand 0
-
-	set top_widget_names(info) $info_label
-
-	# Extract the Rows:
-	set row 0;
-	set colmax 0;
-	foreach line [split $template "\n"] {
-		if {[regexp {^Row: (.*)} $line rest]} {
-			set col 0
-			foreach case [split $rest] {
-				if {$case == "" || $case == "Row:"} {
-					continue
-				}
-				set menu_row($case) $row
-				set menu_col($case) $col
-
-				lappend cases($col) $case;
-				set len [string length $case]
-				if {[info exists max_len($col)]} {
-					if {$len > $max_len($col)} {
-						set max_len($col) $len
-					}
-				} else {
-					set max_len($col) $len
-				}
-				incr col
-				if {$col > $colmax} {
-					set colmax $col
-				}
-			}
-			incr row;
-		}
-	}
-
-	# Make frames for the rows and make the menu buttons.
-	set f "$top.menuframe"
-	frame $f
-	for {set c 0} {$c < $colmax} {incr c} {
-		set colf "$f.menuframe$c"
-		frame $colf
-		pack $colf -side left -fill y
-		set fbg [$colf cget -background]
-		foreach case $cases($c) {
-			set menub "$colf.menu$case";
-			set menu "$colf.menu$case.menu";
-			set menu_b($case) $menub
-			set menu_m($case) $menu
-			set ul 0
-			foreach char [split $case ""] {
-				set char [string tolower $char]
-				if {![info exists underlined($char)]} {
-					set underlined($char) 1
-					break
-				}
-				incr ul
-			}
-			global osname
-			set tstr "$case"
-			if {$osname == "Darwin"} {
-				#set tstr " $case   "
-			}
-			menubutton $menub -text "$tstr" -underline $ul \
-				-anchor w -menu $menu -background $fbg \
-				-font $bfont
-			pack $menub -side top -fill x
-			menu $menu -tearoff 0 -postcommand menu_posted
-		}
-	}
-	pack $f -side top -fill x
-	set top_widget_names(menuframe) $f
-
-	make_menu_items
-
-	# Make the x11 and vnc display label bar:
-	set df "$top.displayframe"
-	frame $df -bd 1 -relief groove
-	set top_widget_names(displayframe) $df
-
-	set df_x11 "$df.xdisplay"
-
-	if {$make_gui_count == 1} {
-		no_x11_display
-	}
-	set lw [expr {$label_width / 2}]
-	label $df_x11 -textvariable x11_display -width $lw -anchor w \
-		-font $ffont
-
-	set df_vnc "$df.vdisplay"
-
-	if {$make_gui_count == 1} {
-		no_vnc_display
-	}
-	label $df_vnc -textvariable vnc_display -width $lw -anchor w \
-		-font $ffont
-
-	pack $df_x11 $df_vnc -side left 
-	pack $df -side top -fill x
-
-	# text area
-	global text_height
-	set text_area "$top.text"
-	if {$screen_width <= 400} {
-		text $text_area -height $text_height -width $label_width \
-			-relief ridge -font $ffont
-	} else {
-		text $text_area -height $text_height -relief ridge -font $ffont
-	}
-	pack $text_area -side top -fill both -expand 1
-	set top_widget_names(text) $text_area
-
-
-	if {$text_area_str == ""} {
-		set str "Click Help -> gui for overview."
-		append_text "\n$str\n\n"
-	} else {
-		append_text $text_area_str
-	}
-
-	# Make entry box stuff
-	set ef "$top.entryframe"
-	frame $ef -bd 1 -relief groove
-	set top_widget_names(entryframe) $ef
-
-	# Entry Label
-	set ef_label "$ef.label"
-	label $ef_label -textvariable entry_str -anchor w -font $bfont
-
-	set entry_str "Set... : "
-	set ef_entry "$ef.entry"
-	entry $ef_entry -relief sunken -font $ffont
-	bind $ef_entry <KeyPress-Return> {set entry_set 1}
-	bind $ef_entry <KeyPress-Escape> {set entry_set 0}
-
-	set ok_s "OK"
-	set cancel_s "Cancel"
-	set help_s "Help"
-	set browse_s "Browse..."
-	global osname
-	if {$osname == "Darwin"} {
-		set ok_s " OK   "
-		set cancel_s " Cancel   "
-		set help_s " Help   "
-		set browse_s " Browse...   "
-	}
-
-	# Entry OK button
-	set bpx "1m"
-	set bpy "1"
-	set hlt "0"
-	set ef_ok "$ef.ok"
-	button $ef_ok -text $ok_s -pady $bpy -padx $bpx -command {set entry_set 1} \
-		-highlightthickness $hlt \
-		-font $bfont
-
-	# Entry Skip button
-	set ef_skip "$ef.skip"
-	button $ef_skip -text $cancel_s -pady $bpy -padx $bpx -command {set entry_set 0} \
-		-highlightthickness $hlt \
-		-font $bfont
-
-	# Entry Help button
-	set ef_help "$ef.help"
-	button $ef_help -text $help_s -pady $bpy -padx $bpx -command \
-		{menu_help $entry_dialog_item} -font $bfont \
-		-highlightthickness $hlt
-
-	# Entry Browse button
-	set ef_browse "$ef.browse"
-	button $ef_browse -text $browse_s -pady $bpy -padx $bpx -font $bfont \
-		-highlightthickness $hlt \
-		-command {entry_insert [tk_getOpenFile]} 
-
-	pack $ef_label -side left
-	pack $ef_entry -side left -fill x -expand 1
-	pack $ef_ok   -side right
-	pack $ef_skip -side right
-	pack $ef_help -side right
-	pack $ef -side bottom -fill x
-
-	set entry_ok $ef_ok
-	set entry_skip $ef_skip
-	set entry_help $ef_help
-	set entry_box $ef_entry
-	set entry_browse $ef_browse
-	set entry_label $ef_label
-	entry_disable
-
-}
-
-proc menu_bindings {m} {
-	set db 0
-	if {$db} {puts "menu_bindings $m"}
-
-	bind $m <<MenuSelect>> {
-#syntax hilite bug \
-MenuSelect>>
-		set n [%W index active]
-		set db 0
-		if {$db} {puts stderr "menu_bindings %W $n"}
-		set label "    "
-		if {$n != "none"} {
-			set str %W,$n
-			set which ""
-
-			if {$db} {puts "menu_bindings $str"}
-			if {[info exists helplabel($str)]} {
-				set vname [format %%-16s $helplabel($str)]
-				set label "Click (?) for help on: $vname"
-				set which $helplabel($str)
-			}
-			if {$which == ""} {
-				;
-			} elseif {$which == "passwd" || $which == "viewpasswd"} {
-				;
-			} elseif {[is_action $which]} {
-				if {[info exists menu_var($which)] 
-				    && $menu_var($which) != ""} {
-					set label "$label value: $menu_var($which)"
-				} else {
-					set label "$label (is action)"
-				}
-			} elseif {[info exists menu_var($which)]} {
-				set label "$label value: $menu_var($which)"
-				if {$which == "http"} {
-					global vnc_url
-					set label "$label  URL: $vnc_url"
-				}
-			}
-		}
-		set_info $label
-	}
-}
-
-proc key_bindings {} {
-	global env menus_disabled
-	if {[info exists env(USER)] && $env(USER) == "runge"} {
-		# quick restart
-		bind . <Control-KeyPress-k> {exec $argv0 $argv &; destroy .}
-	}
-	bind . <Control-KeyPress-p> { \
-		global menus_disabled; \
-		if {!$menus_disabled} {try_connect_and_query_all} \
-	}
-	bind . <Control-KeyPress-u> { \
-		global menus_disabled; \
-		if {!$menus_disabled} {query_all 0} \
-	}
-	bind . <Control-KeyPress-r> { \
-		global menus_disabled; \
-		if {!$menus_disabled} {query_all 0} \
-	}
-	bind . <Control-KeyPress-d> { \
-		global menus_disabled; \
-		if {!$menus_disabled} {detach_from_display} \
-	}
-	bind . <Control-KeyPress-a> { \
-		global menus_disabled; \
-		if {!$menus_disabled} {try_connect_and_query_all} \
-	}
-}
-
-proc stop_watch {onoff} {
-	global orig_cursor text_area entry_box
-
-	set widgets [list .]
-	if [info exists text_area] {
-		if {$text_area != ""} {
-			lappend widgets $text_area
-		}
-	}
-	if [info exists entry_box] {
-		if {$entry_box != ""} {
-			lappend widgets $entry_box
-		}
-	}
-
-	if {$onoff == "on"} {
-		foreach item $widgets {
-			if {![winfo exists $item]} {
-				continue
-			}
-			$item config -cursor {watch}
-		}
-	} else {
-		foreach item $widgets {
-			if {![winfo exists $item]} {
-				continue
-			}
-			$item config -cursor {}
-		}
-	}
-	update
-}
-
-proc double_check_noremote {} {
-	set msg "\n\n"
-	append msg "*** WARNING: setting \"noremote\" will disable ALL remote control commands (i.e.\n"
-	append msg "*** WARNING: *this* gui will be locked out). Do you really want to do this?\n"
-	append msg "*** WARNING: If so, press \"OK\", otherwise press \"Cancel\"\n"
-	append msg "\n"
-	bell
-	return [warning_dialog $msg "noremote"]
-}
-
-proc get_settings_rcfile {} {
-	global menu_var default_var unset_str
-	global x11vnc_gui_params
-
-	set rc_txt ""
-
-	set menu_var(gui) $x11vnc_gui_params
-
-	foreach item [lsort [array names menu_var]] {
-		if {$item == "gui"} {
-			;
-		} elseif {![active_when_starting $item]} {
-			continue
-		} elseif {[is_action $item]} {
-			continue
-		}
-		if {$item == "debug_gui"} {
-			continue
-		} elseif {$item == "WindowView"} {
-			continue
-		} elseif {$item == "rc" || $item == "norc"} {
-			continue
-		} elseif {$item == "loop"} {
-			continue
-		} elseif {$item == "loopbg"} {
-			continue
-		}
-
-		set def ""
-		if {[info exists default_var($item)]} {
-			set def $default_var($item)
-		}
-
-
-		set qst ""
-		set hmm "#? "
-		if {$item == "display"} {
-			set qst $hmm
-		} elseif {$item == "desktop"} {
-			set qst $hmm
-		} elseif {$item == "dontdisconnect"} {
-			set qst $hmm
-		} elseif {$item == "alwaysshared"} {
-			set qst $hmm
-		} elseif {$item == "nevershared"} {
-			set qst $hmm
-		} elseif {$item == "gui"} {
-			set qst $hmm
-		}
-
-		if {![info exists menu_var($item)]} {
-			set mv $def
-		} else {
-			set mv $menu_var($item)
-		}
-#puts "item=$item def=$def mv=$mv"
-		if {$mv == $unset_str} {
-			set mv ""
-		}
-		set ntab 3
-
-		if {$item == "gui" || [value_is_string $item]} {
-			set nitem [get_nitem $item]
-
-			if {$mv == "" && $def != ""}  {
-				set qst $hmm
-			}
-			set n 0
-			if {$qst != ""} {
-				append rc_txt $qst
-				incr n [string length $qst]
-			} elseif {$mv == $def} {
-				append rc_txt "#d "
-				incr n [string length "#d "]
-			}
-			set mt $mv
-			regsub -all {#} $mt {\#} mt
-			if {$mt == ""} {
-				set mt {""}
-			}
-			append rc_txt "-$nitem $mt"
-
-			if {$mv != $def} {
-				set m [string length "-$nitem $mt"]
-				incr n $m
-				set n [expr $n / 8]
-				set c 0
-				for {set i $n} {$i <= $ntab} {incr i} {
-					append rc_txt "\t"
-					incr c
-				}
-				if {$c == 0} {
-					append rc_txt "\t"
-				}
-				regsub -all {#} $def {\#} def
-				if {$def == ""} {
-					set def {""}
-				}
-				append rc_txt "# default:  $def"
-			}
-			append rc_txt "\n"
-
-		} elseif {[value_is_bool $item]} {
-			set n 0
-			if {$qst != ""} {
-				append rc_txt $qst
-				incr n [string length $qst]
-			} elseif {$mv == $def} {
-				append rc_txt "#d "
-				incr n [string length "#d "]
-			}
-			if {$def == 1} {
-				set dv "on"
-			} else {
-				set dv "off"
-			}
-			append rc_txt "-$item"
-			set m [string length "-$item"]
-			incr n $m
-			set n [expr $n / 8]
-			for {set i $n} {$i <= $ntab} {incr i} {
-				append rc_txt "\t"
-			}
-			append rc_txt "# default: $dv"
-			append rc_txt "\n"
-
-		}
-	}
-	return $rc_txt
-}
-
-proc double_check_start_x11vnc {} {
-	global hostname
-	set msg [get_start_x11vnc_txt]
-	bell
-	append msg "\n"
-	append msg "*** To run the above command on machine \"$hostname\" (thereby\n"
-	append msg "*** starting x11vnc) press \"OK\", otherwise press \"Cancel\".\n"
-	return [warning_dialog $msg "start"]
-}
-
-proc get_start_x11vnc_txt {} {
-	set cmd [get_start_x11vnc_cmd]
-	set str [join $cmd]
-	set msg ""
-	append msg "\n"
-	append msg "==== The command built so far is: ====\n";
-	append msg "\n"
-	append msg "$str\n"
-	return $msg
-}
-
-proc show_start_cmd {} {
-	set msg [get_start_x11vnc_txt]
-	append_text "$msg\n"
-}
-
-proc get_nitem {item} {
-	set nitem $item
-	if {$nitem == "screen_blank"} {
-		set nitem "sb"
-	} elseif {$nitem == "xrandr_mode"} {
-		set nitem "xrandr"
-	} elseif {$nitem == "unixpw_list"} {
-		set nitem "unixpw"
-	} elseif {$nitem == "unixpw_nis_list"} {
-		set nitem "unixpw_nis"
-	} elseif {$nitem == "stunnel_pem"} {
-		set nitem "stunnel"
-	} elseif {$nitem == "ssl_pem"} {
-		set nitem "ssl"
-	} elseif {$nitem == "wireframe_mode"} {
-		set nitem "wireframe"
-	} elseif {$nitem == "solid_color"} {
-		set nitem "solid"
-	}
-	return $nitem
-}
-
-proc get_start_x11vnc_cmd {{show_rc 0}} {
-	global cmd_var menu_var default_var unset_str x11vnc_prog
-
-	set xterm_cmd "xterm -iconic -geometry 80x35 -title x11vnc-console -e"
-
-	set cmd [split $xterm_cmd]
-
-	lappend cmd $x11vnc_prog
-
-	lappend cmd "-gui"
-	lappend cmd "none"
-
-	set rc_txt ""
-
-	set saw_id 0
-
-	foreach item [lsort [array names menu_var]] {
-		if {$item == "gui"} {
-			continue
-		} elseif {![active_when_starting $item]} {
-			continue
-		} elseif {[is_action $item]} {
-			continue
-		} elseif {$item == "debug_gui"} {
-			continue
-		} elseif {$item == "WindowView"} {
-			continue
-		}
-
-		if {$item == "id" || $item == "sid"} {
-			set val $menu_var($item);
-			if {$val == "0x0" || $val == "root"} {
-				continue
-			}
-		}
-		if {$item == "sid" && $saw_id} {
-			continue
-		}
-		if {$item == "id"} {
-			set saw_id 1
-		} elseif {$item == "httpport" && $menu_var($item) == "0"} {
-			continue
-		} elseif {$item == "progressive" && $menu_var($item) == "0"} {
-			continue
-		} elseif {$item == "dontdisconnect" && $menu_var($item) == "-1"} {
-			continue
-		} elseif {$item == "alwaysshared" && $menu_var($item) == "-1"} {
-			continue
-		}
-
-		if {[value_is_bool $item]} {
-			if {[info exists menu_var($item)]} {
-				set add 1
-				if {[info exists default_var($item)]} {
-					if {$menu_var($item) == $default_var($item)} {
-						set add 0;
-					}
-				} elseif {! $menu_var($item)} {
-					set add 0
-				}
-				if {$add} {
-					lappend cmd "-$item"
-					append rc_txt "-$item\n"
-				}
-			}
-		} elseif {[value_is_string $item]} {
-			if {![info exists menu_var($item)]} {
-				continue
-			}
-			if {$menu_var($item) != "" && $menu_var($item) != $unset_str} {
-				set add 1
-				set nitem [get_nitem $item]
-
-				if {[info exists default_var($item)]} {
-					if {$menu_var($item) == $default_var($item)} {
-						set add 0;
-					}
-				}
-				if {$add} {
-					lappend cmd "-$nitem"
-					set mv $menu_var($item)
-
-					if {[regexp {^~} $mv]}  {
-						if {$item == "auth" ||
-						    $item == "rc" ||
-						    $item == "accept" || 
-						    $item == "connect" || 
-						    $item == "allow" || 
-						    $item == "passwdfile" || 
-						    $item == "o" || 
-						    $item == "logfile" || 
-						    $item == "remap" || 
-						    $item == "httpdir"} { 
-							set mv [tilde_expand $mv]
-						}
-					}
-					
-					lappend cmd $mv
-					set mt $mv
-					regsub -all {#} $mt {\#} mt
-					append rc_txt "-$nitem $mt\n"
-				}
-			}
-		}
-	}
-	lappend cmd "2>"
-	lappend cmd "/dev/null"
-	lappend cmd "&"
-	
-	if {$show_rc} {
-		return $rc_txt
-	} else {
-		return $cmd
-	}
-}
-
-proc start_x11vnc {} {
-	global menu_var unset_str
-	global x11vnc_prog x11vnc_xdisplay
-	global connected_to_x11vnc
-
-	if {$connected_to_x11vnc} {
-		append_text "\n"
-		append_text "WARNING: Still connected to an x11vnc server.\n"
-		append_text "WARNING: Use \"stop\" or \"detach\" first.\n"
-		return 0
-	}
-
-	if {![double_check_start_x11vnc]} {
-		return
-	}
-
-	set x11vnc_xdisplay ""
-	if {[info exists menu_var(display)]} {
-		if {$menu_var(display) != "" && $menu_var(display) != $unset_str} {
-			set x11vnc_xdisplay $menu_var(display)
-		}
-	}
-
-	set cmd [get_start_x11vnc_cmd]
-
-	set str [join $cmd]
-	regsub { -e} $str " -e \\\n   " str
-
-	if {0} {
-		puts "running: $str"
-		foreach word $cmd {
-			puts "   word: $word"
-		}
-	}
-
-	append_text "Starting x11vnc in an iconified xterm with command:\n"
-	append_text "  $str\n\n"
-	catch {[eval exec $cmd]}
-	after 500
-	try_connect_and_query_all 3
-	if {!$connected_to_x11vnc} {
-		append_text "\nStarting x11vnc seems to have failed.\n"
-		if {[regexp -- {-o } $str] || [regexp -- {-logfile} $str]} {
-			append_text "Examine the logfile (Debugging -> show-logfile) for error messages.\n"
-		} else {
-			append_text "Rerun with a logfile (if needed) and examine the logfile\n"
-			append_text "(Debugging -> show-logfile) for error messages.\n"
-		}
-	}
-}
-
-proc run_remote_cmd_via_sock {opts} {
-	global client_sock
-
-	set db 0
-	if {[file channels $client_sock] == ""} {
-		set client_sock ""
-		return "fail"
-	}
-	if {[eof $client_sock]} {
-		catch {close $client_sock}
-		set client_sock ""
-		return "fail"
-	}
-	set result ""
-		
-	setup_client_sock 0
-
-	set docmd ""
-	foreach opt $opts {
-		if {$opt == "-R"} {
-			set docmd "-R"
-			continue
-		} elseif {$opt == "-Q"} {
-			set docmd "-Q"
-			continue
-		}
-
-		if {$docmd == ""} {
-			continue
-		} elseif {$docmd == "-R"} {
-			set str "cmd=$opt"
-		} elseif {$docmd == "-Q"} {
-			set str "qry=$opt"
-		} else {
-			set docmd ""
-			continue
-		}
-
-		if {$db} {puts stderr "run_remote_cmd_via_sock: $docmd \"$str\""}
-		catch {puts $client_sock $str}
-		if {$db} {puts stderr "run_remote_cmd_via_sock: flush"}
-		catch {flush $client_sock}
-		if {$db} {puts stderr "run_remote_cmd_via_sock: gets"}
-		catch {gets $client_sock res}
-		if {$db} {puts stderr "run_remote_cmd_via_sock: \"$res\""}
-		set res [string trim $res]
-
-		if [regexp {=clients:} $res] {
-			regsub {^.*=clients:} $res "" cres
-			regsub {,aro=.*$} $cres "" cres
-			regsub {,ans=.*$} $cres "" cres
-			if {$cres == "none"} {
-				set cres ""
-			}
-			update_clients_menu $cres
-			set client_str $cres
-			set_client_balloon $cres
-		}
-
-		if [regexp {^clients:} $res] {
-			regsub {^clients:} $res "" tmp
-			if {$tmp == "none"} {
-				set tmp ""
-			}
-			update_clients_menu $tmp
-			set client_str $tmp
-			set_client_balloon $tmp
-
-			if ![regexp {^clients} $opt] {
-				# we could block here...
-				if {$db} {puts stderr "run_remote_cmd_via_sock: gets"}
-				gets $client_sock res
-				if {$db} {puts stderr "run_remote_cmd_via_sock: \"$res\""}
-				set res [string trim $res]
-			}
-		}
-
-		set docmd ""
-
-		if {$res != ""} {
-			append result "$res\n"
-		}
-	}
-	
-	setup_client_sock 1
-
-	set result [string trim $result]
-
-	return $result
-}
-
-proc run_remote_cmd {opts} {
-	global menu_var x11vnc_prog x11vnc_cmdline x11vnc_xdisplay
-	global x11vnc_auth_file x11vnc_connect_file
-	global client_sock
-
-	set debug [in_debug_mode]
-
-	if {[lindex $opts 0] == "-R" && [lindex $opts 1] == "noremote"} {
-		set str [join $opts]
-		if ![double_check_noremote] {
-			append_text "skipping: x11vnc $str"
-			return ""
-		} else {
-			append_text "running: x11vnc $str (please do \"Actions -> detach\" to clean things up)\n"
-			append_text "subsequent -R/-Q commands should fail..."
-		}
-	}
-
-	if {$client_sock != ""} {
-		menus_disable
-		stop_watch on
-		set result [run_remote_cmd_via_sock $opts]
-		stop_watch off
-		menus_enable
-		if {$result != "fail"} {
-			return $result
-		}
-	}
-
-	set cmd ""
-
-	lappend cmd $x11vnc_prog;
-
-	if {$x11vnc_connect_file != ""} {
-		lappend cmd "-connect"
-		lappend cmd $x11vnc_connect_file
-	} else {
-		if {$x11vnc_xdisplay != ""} {
-			lappend cmd "-display"
-			lappend cmd $x11vnc_xdisplay
-		}
-		if {$x11vnc_auth_file != ""} {
-			lappend cmd "-auth"
-			lappend cmd $x11vnc_auth_file
-		}
-	}
-	lappend cmd "-sync"
-	foreach word $opts {
-		lappend cmd $word
-	}
-	lappend cmd "2>"
-	lappend cmd "/dev/null"
-
-	if {0 || $debug} {
-		set str [join $cmd]
-		puts "running: $str"
-		foreach word $cmd {
-			puts "   word: $word"
-		}
-	}
-
-	set output ""
-	menus_disable
-
-	stop_watch on
-	catch {set output [eval exec $cmd]}
-	stop_watch off
-
-	menus_enable
-	if {$debug} {
-		if {[string length $output] > 100} {
-			set str [string range $output 0 100]
-			append_text "output: $str ...\n"
-		} else {
-			append_text "output: $output\n"
-		}
-	}
-	return $output
-}
-
-proc try_connect_and_query_all {{n 2}} {
-	for {set i 0} {$i < $n} {incr i} {
-		if {$i > 0} {
-			after 500
-			append_text "trying again ...\n"
-		}
-		if {[try_connect]} {
-			query_all
-			break
-		}
-	}
-}
-
-proc try_connect {} {
-	global x11vnc_xdisplay connected_to_x11vnc reply_xdisplay
-	global menu_var unset_str
-
-	set db 0
-#dtime c1
-
-	if {! $connected_to_x11vnc} {
-		if {[info exists menu_var(display)]} {
-			set d $menu_var(display)
-			if {$d != "" && $d != $unset_str && $d != $x11vnc_xdisplay} {
-				set x11vnc_xdisplay $menu_var(display)
-				append_text "Setting X display to: $x11vnc_xdisplay\n"
-			}
-		}
-	}
-
-	set_info "Pinging $x11vnc_xdisplay ..."
-	set rargs [list "-Q" "ping"]
-	set result [run_remote_cmd $rargs]
-#dtime c2a
-
-	if {$db} {puts "try_connect: \"$result\""}
-
-	if {[regexp {^ans=ping:} $result]} {
-		regsub {^ans=ping:} $result {} reply_xdisplay
-		set msg "Connected to $reply_xdisplay"
-		set_info $msg
-		append_text "$msg\n"
-		set_connected yes
-
-		setup_client_channel
-#dtime c2b
-		setup_client_sock 1
-		setup_client_tail
-
-		fetch_displays
-#dtime c3a
-		return 1
-	} else {
-		set str "x11vnc server."
-		if {$x11vnc_xdisplay != ""} {
-			set str $x11vnc_xdisplay
-		}
-		set msg "No reply from $str"
-		set_info $msg
-		append_text "$msg\n"
-		set_connected no
-		return 0
-	}
-}
-
-proc set_view_variable {val} {
-	global menu_var
-	set menu_var(WindowView) $val
-}
-proc get_view_variable {} {
-	global menu_var
-	if {![info exists menu_var(WindowView)]} {
-		set menu_var(WindowView) "none"
-	}
-	return $menu_var(WindowView)
-}
-
-proc dono {a b c} {
-	exit 1;
-}
-
-proc do_port_prompt {} {
-	global bfont ffont
-	global port_reply port_set
-
-	set guess 5900
-	for {set i 0} {$i < 50} {incr i} {
-		set fh ""
-		set try [expr $guess + $i]
-		catch {set fh [socket -server dono $try]}
-		if {$fh != ""} {
-			catch {close $fh}
-			set guess $try
-			break;
-		}
-	}
-	set hn ""
-	catch {set hn [exec uname -n]}
-	if {$hn == ""} {
-		set hn "hostname"
-	}
-
-	set text " Set the x11vnc Listening Port:
-
-    VNC Display :0 corresponds to TCP port 5900
-    VNC Display :1 corresponds to TCP port 5901
-    etc.
-
- In the Entry below, indicate a Port for x11vnc to listen on. 
-
- Note that to connect to x11vnc, a VNC Viewer will need to
- know your selection, for example:
-
-    vncviewer $hn:0
-    vncviewer $hn:1
-    etc.
-
- Your firewall may block incoming connections to TCP ports;
- if it does you may need to reconfigure it. 
-    
- You can also set some additional parameters:
-
-    - Enable SSL encryption.
-      (requires an SSL enabled vncviewer, such as SSVNC)  
-    - Listen only on localhost. (e.g. for an SSH tunnel)
-    - Enable UltraVNC or TightVNC File transfer.
-"
-	set port_set $guess
-	set port_reply ""
-
-	toplevel .pp
-	wm title .pp "Select x11vnc port"
-
-	wm protocol .   WM_DELETE_WINDOW "destroy .; exit"
-	wm protocol .pp WM_DELETE_WINDOW "destroy .pp; exit"
-
-	label .pp.m -text "$text" -relief ridge -justify left -font $ffont
-
-	global tk_version
-	set tkold 0
-	if [info exists tk_version] {
-		if [regexp {^8\.[0-3]$} $tk_version] {
-			set tkold 1
-		}
-		if [regexp {^[3-7]\.} $tk_version] {
-			set tkold 1
-		}
-	}
-
-	if {$tkold} {
-		frame .pp.f -bd 1 -relief ridge
-	} else {
-		frame .pp.f -bd 1 -relief ridge -pady 2
-	}
-	label .pp.f.l -text "Port: " -font $bfont
-	entry .pp.f.e -width 8 -textvariable port_set -font $ffont
-	global enable_ssl; set enable_ssl 0
-	if [info exists env(X11VNC_SSL_ENABLED)] {
-		set enable_ssl 1
-	}
-	checkbutton .pp.f.ssl -relief raised -pady 3 -padx 3 -text "Enable SSL" -variable enable_ssl -font $bfont
-	global localhost; set localhost 0
-	if [info exists env(X11VNC_LOCALHOST_ENABLED)] {
-		set localhost 1
-	}
-	checkbutton .pp.f.loc -relief raised -pady 3 -padx 3 -text "Listen on localhost" -variable localhost -font $bfont
-	pack .pp.f.l .pp.f.e -side left
-	pack .pp.f.loc .pp.f.ssl -side right
-
-	if {$tkold} {
-		frame .pp.t -bd 1 -relief ridge
-	} else {
-		frame .pp.t -bd 1 -relief ridge -pady 2
-	}
-	global file_transfer; set file_transfer "none"
-	if [info exists env(X11VNC_FILETRANSFER_ENABLED)] {
-		set file_transfer $env(X11VNC_FILETRANSFER_ENABLED)
-	}
-	label .pp.t.l -text "File Transfer: " -font $bfont
-	radiobutton .pp.t.none  -text "None" -variable file_transfer -value "none" -font $bfont
-	radiobutton .pp.t.ultra -text "UltraVNC" -variable file_transfer -value "ultra" -font $bfont
-	radiobutton .pp.t.tight -text "TightVNC" -variable file_transfer -value "tight" -font $bfont
-	pack .pp.t.l .pp.t.none .pp.t.ultra .pp.t.tight -side left
-
-	frame .pp.o -bd 1 -relief ridge
-	button .pp.o.ok -text "OK" -command "set port_reply 1; destroy .pp" -font $bfont
-	button .pp.o.cancel -text "Cancel" -command "set port_reply 0; destroy .pp" -font $bfont
-	pack .pp.o.ok .pp.o.cancel -side left -fill x -expand 1
-	pack .pp.m -side top -fill x -expand 1 
-	pack .pp.f .pp.t .pp.o -side top -fill x
-
-	focus .pp.f.e
-	.pp.f.e icursor end
-
-	wm withdraw .pp
-	update
-	center_win .pp
-
-	wm minsize .pp [winfo width .pp] [winfo height .pp]
-
-	bind .pp.f.e <KeyPress-Return> "set port_reply 1; destroy .pp"
-
-	vwait port_reply
-
-	if {$port_reply} {
-		regsub -all {^:} $port_set "" port_set
-		regsub -all {[ \t]} $port_set "" port_set
-		if {[regexp {^[0-9][0-9]*$} $port_set]} {
-			if {$port_set < 0} {
-				set port_set [expr 0 - $port_set]
-			} elseif {$port_set < 200} {
-				set port_set [expr $port_set + 5900]
-			} 
-			puts "$port_set:ssl${enable_ssl}:localhost$localhost:ft_$file_transfer"
-		}
-	}
-}
-
-proc change_view_state {} {
-	global menu_var gui_current_state
-
-	set new [get_view_variable]
-
-	if {![info exists gui_current_state]} {
-		set gui_current_state ""
-	}
-	set old $gui_current_state
-	#puts "$old -> $new"
-
-	if {$old == $new} {
-		return
-	}
-
-	if {$old == "full" || $old == "icon" || $old == "tray"} {
-		;
-	} else {
-		set old "none"
-	}
-
-	if {$new == "full" || $new == "icon" || $new == "tray"} {
-		if {$old == "tray"} {
-			# sigh XReparentWindow would be too easy...
-			# undo_tray_embed
-			restart_everything $new
-			destroy .
-			exit
-		}
-		make_gui $new
-		if {$new == "tray"} {
-			wm withdraw .
-		}
-	} else {
-		set_view_variable $old
-	}
-}
-
-proc setup_client_tail {} {
-	global client_tail
-	if {$client_tail != ""} {
-		fileevent $client_tail readable read_client_tail
-	}
-}
-
-proc setup_client_sock {{enable 1}} {
-	global client_sock
-	if {$client_sock != ""} {
-		if {$enable} {
-			fileevent $client_sock readable read_client_sock
-		} else {
-			fileevent $client_sock readable ""
-		}
-	}
-}
-
-proc setup_tray_embed {} {
-	update
-	set w [winfo width .]
-	set h [winfo height .]
-	if {$w < 24} {
-		set w 24
-	}
-	if {$h < 24} {
-		set h 24
-	}
-	wm minsize . $w $h
-	set wid [winfo id .]	
-	push_new_value "remote-cmd" "remote-cmd" "trayembed:$wid" 0
-}
-
-proc restart_everything {gui_mode} {
-	global env gui_argv0 x11vnc_prog full_win
-	global icon_mode_at_startup
-	global tray_embed tray_running
-	if {$gui_mode == "full"} {
-		set env(X11VNC_ICON_MODE) 0
-	} elseif {$gui_mode == "icon"} {
-		set env(X11VNC_ICON_MODE) 1
-	} elseif {$gui_mode == "tray"} {
-		if {$tray_running} {
-			set env(X11VNC_ICON_MODE) "RUNNING"
-		} else {
-			set env(X11VNC_ICON_MODE) "TRAY"
-		}
-	}
-	puts stderr ""
-	puts stderr "tkx11vnc: restarting gui to leave tray mode."
-	puts stderr "  new gui will be running in the background."
-	puts stderr "  use kill(1) rather than Ctrl-C to kill it."
-	puts stderr ""
-	if {[info exists env(X11VNC_RESTART_DEPTH)]} {
-		set n $env(X11VNC_RESTART_DEPTH)
-		incr n
-		set env(X11VNC_RESTART_DEPTH) $n
-	} else {
-		set env(X11VNC_RESTART_DEPTH) 0
-	}
-	set env(X11VNC_ICON_SETPASS) ""
-
-	if {![info exists env(X11VNC_WISHCMD)]} {
-		puts stderr "failure in restart_everything."
-		exit 1;
-	}
-
-	set code [exec $x11vnc_prog -printgui]
-	if {[string length $code] < 20000} {
-		puts stderr "failure in restart_everything."
-		exit 1;
-	}
-	set tmp "/tmp/x11vnc[pid]"
-	append tmp [clock clicks]
-	set tmp2 ""
-	catch {set tmp2 [exec mktemp $tmp.XXXXXX 2>/dev/null]}
-	if {$tmp2 != "" && [file exists $tmp2]} {
-		set tmp $tmp2
-	} else {
-		file delete -force $tmp
-		if {[file exists $tmp]} {
-			puts stderr "failure in restart_everything."
-			exit 1;
-		}
-	}
-	set fh [open $tmp "a"]
-	if {![file owned $tmp]}  {
-		puts stderr "failure in restart_everything."
-		exit 1;
-	}
-	file attributes $tmp -permissions "0400"
-	puts $fh $code
-	close $fh
-
-	#puts stderr [exec ls -l $tmp]
-
-	wm withdraw .
-	catch {wm withdraw $full_win}
-	update
-
-	exec $env(X11VNC_WISHCMD) $tmp &
-	after 2000
-	file delete -force $tmp
-	
-	destroy .
-	exit
-}
-
-proc undo_tray_embed {} {
-	set wid [winfo id .]	
-	push_new_value "remote-cmd" "remote-cmd" "trayunembed:$wid" 0
-}
-
-############################################################################
-# main:
-
-if [info exists env(X11VNC_GUI_TIME)] {
-	dtime M
-}
-
-wm withdraw .
-
-global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;
-global x11vnc_xdisplay0
-global x11vnc_client_file x11vnc_gui_geom x11vnc_started vnc_url
-global x11vnc_gui_params
-global x11vnc_auth_file x11vnc_connect_file beginner_mode simple_gui_created
-global helpall helptext helpremote helplabel hostname osname
-global all_settings reply_xdisplay always_update
-global max_text_height max_text_width
-global text_height
-global menu_var unset_str menus_disabled
-global bfont ffont sfont snfont old_labels have_labelframes
-global connected_to_x11vnc
-global cache_all_query_vars
-global last_query_all_time query_all_freq client_tail client_sock client_info_read
-global icon_mode icon_mode_at_startup x11vnc_icon_mode
-global tray_embed tray_running icon_setpasswd icon_embed_id
-global icon_noadvanced icon_minimal
-global make_gui_count text_area_str
-global gui_argv0 gui_start_mode
-global screen_height screen_width
-
-set unset_str "(unset)"
-set vnc_url $unset_str
-set connected_to_x11vnc 0
-set menus_disabled 0
-set max_text_height 40
-set max_text_width 90
-set text_height 14
-set bfont "-adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*"
-set sfont "-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*"
-set snfont "-adobe-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*"
-set ffont "fixed"
-
-set got_helv 0
-catch {
-	foreach fam [font families]  {
-		if {$fam == "helvetica"} {
-			set got_helv 1
-		}
-		if {$fam == "Helvetica"} {
-			set got_helv 1
-		}
-	}
-}
-
-if {$got_helv} {
-	set bfont  "Helvetica -12 bold"
-	set sfont  "Helvetica -10 bold"
-	set snfont "Helvetica -10"
-}
-
-set ls ""
-catch {set ls [font metrics $bfont -linespace]}
-if {$ls != "" && $ls > 14} {
-	# some recent setups have BIG rendering for the above fonts.
-	# on recent (8/08) debian these are really ragged:
-	set bfont "-adobe-helvetica-bold-r-*-*-*-90-*-*-*-*-*-*"
-	set sfont "-adobe-helvetica-bold-r-*-*-*-75-*-*-*-*-*-*"
-	set snfont "-adobe-helvetica-medium-r-*-*-*-75-*-*-*-*-*-*"
-
-	set ls ""
-	catch {set ls [font metrics $bfont -linespace]}
-	if {$ls != "" && $ls < 14} {
-		# these are bigger but look better... but for how long?
-		set bfont "-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*"
-		set sfont "-adobe-helvetica-bold-r-*-*-*-80-*-*-*-*-*-*"
-		set snfont "-adobe-helvetica-medium-r-*-*-*-80-*-*-*-*-*-*"
-
-		# maybe consider... {-font font Font {Helvetica -12 bold} {Helvetica -12 bold}}
-		# or stick with system font like ssvnc.
-	}
-}
-
-# need to check if "fixed" font under XFT on tk8.5 is actually fixed width!!
-set ls ""
-catch {set ls [font metrics $ffont -linespace]}
-set fs ""
-catch {set fs [font metrics $ffont -fixed]}
-set redo 0
-if {$fs != "" && $fs != "1"} {
-	set redo 1
-}
-if {$ls != "" && $ls > 14} {
-	set redo 1
-}
-if {$redo} {
-	foreach fn [font names] {
-		if {$fn == "TkFixedFont"} {
-			set ffont $fn
-			break
-		}
-	}
-}
-
-set help_indent 24;
-set reply_xdisplay ""
-set all_settings "None so far."
-set always_update 1
-set cache_all_query_vars ""
-set query_all_freq 120
-set last_query_all_time [clock seconds]
-set client_tail ""
-set client_sock ""
-set client_info_read 0
-set make_gui_count 0
-set text_area_str ""
-set gui_argv0 $argv0
-set gui_start_mode ""
-
-if {$tk_version < 8.0} {
-	puts stderr ""
-	puts stderr "*** tkx11vnc: tk version is old $tk_version, please use 8.0 or higher."
-	puts stderr "***           will try to continue with reduced functionality..."
-	puts stderr ""
-}
-if {[regexp {^[34]} $tk_version] || $tk_version == "8.0"} {
-	set old_labels 1
-} else {
-	set old_labels 0
-}
-set have_labelframes 1
-if {$tk_version < 8.4} {
-	set have_labelframes 0
-}
-
-set screen_height [winfo screenheight .]
-set screen_width  [winfo screenwidth  .]
-if {$screen_height < 700} {
-	# short screen, netbook?
-	set max_text_height 30
-	if {$screen_height < 500} {
-		# short screen, PDA?
-		set max_text_height 22
-		set text_height 13
-		if {$screen_height <= 360} {
-			# very short.
-			set max_text_height 16
-			set max_text_width  60
-			set text_height 11
-		}
-	}
-}
-if {[info exists env(X11VNC_GUI_TEXT_HEIGHT)]} {
-	set max_text_height $env(X11VNC_GUI_TEXT_HEIGHT)
-}
-if {[info exists env(X11VNC_GUI_TEXT_WIDTH)]} {
-	set max_text_width  $env(X11VNC_GUI_TEXT_WIDTH)
-}
-
-if {"$argv" == "-spit"} {
-	set fh [open $argv0 r]
-	puts "#ifndef _TKX11VNC_H"
-	puts "#define _TKX11VNC_H"
-	puts "#ifdef NOGUI"
-	puts "char gui_code\[\] = \"\";"
-	puts "#else"
-	puts "/*"
-	puts " * tkx11vnc.h: generated by 'tkx11vnc -spit'"
-	puts " * Abandon all hope, ye who enter here..."
-	puts " * ...edit tkx11vnc instead."
-	puts " */"
-	puts "	char gui_code\[\] ="
-	while {[gets $fh line] > -1} {
-		regsub -all {\\} $line {\\\\} line
-		regsub -all {"} $line {\\"} line
-		puts "\"$line\\n\""
-	}
-	puts "#endif"
-	puts "/* ifdef NOGUI */"
-	puts "#endif"
-	puts "/* ifndef _TKX11VNC_H */"
-	close $fh
-	puts ";"
-	exit 0
-}
-
-set_view_variable "full"
-
-#puts [exec env | grep X11VNC]
-
-# Read environment for clues:
-
-set x11vnc_client_file "";
-if {[info exists env(X11VNC_CLIENT_FILE)]} {
-	set x11vnc_client_file $env(X11VNC_CLIENT_FILE);
-	set file $x11vnc_client_file
-
-	set client_tail ""
-	if {[file exists $file] && [file isfile $file]} {
-		if {[file readable $file] && [file owned $file]} {
-			set client_tail [open "|tail -f $x11vnc_client_file" "r"]
-		}
-	}
-	if {$client_tail != ""} {
-		gets $client_tail tmp
-		if [eof $client_tail] {
-#puts "eof $client_tail"
-			clean_client_tail
-			set client_tail ""
-		}
-	}
-	catch {file delete -force $x11vnc_client_file}
-}
-
-if {[info exists env(X11VNC_PROG)]} {
-	set x11vnc_prog $env(X11VNC_PROG);
-} else {
-	set x11vnc_prog "x11vnc";
-}
-
-if {[info exists env(X11VNC_CMDLINE)]} {
-	set x11vnc_cmdline $env(X11VNC_CMDLINE);
-} else {
-	set x11vnc_cmdline "";
-}
-
-if {[info exists env(X11VNC_CONNECT)]} {
-	set x11vnc_connect 1
-} else {
-	set x11vnc_connect 0;
-}
-
-if {[info exists env(X11VNC_GUI_GEOM)]} {
-	set x11vnc_gui_geom $env(X11VNC_GUI_GEOM);
-} else {
-	set x11vnc_gui_geom ""
-}
-if {[info exists env(X11VNC_GUI_PARAMS)]} {
-	set x11vnc_gui_params $env(X11VNC_GUI_PARAMS);
-} else {
-	set x11vnc_gui_params ""
-}
-
-if {[info exists env(X11VNC_FONT_BOLD)]} {
-	set bfont $env(X11VNC_FONT_BOLD)
-}
-if {[info exists env(X11VNC_FONT_BOLD_SMALL)]} {
-	set sfont $env(X11VNC_FONT_BOLD_SMALL)
-}
-if {[info exists env(X11VNC_FONT_REG_SMALL)]} {
-	set snfont $env(X11VNC_FONT_REG_SMALL)
-}
-if {[info exists env(X11VNC_FONT_FIXED)]} {
-	set ffont $env(X11VNC_FONT_FIXED)
-}
-
-if {[info exists env(X11VNC_CONNECT_FILE)]} {
-	set x11vnc_connect_file $env(X11VNC_CONNECT_FILE);
-} else {
-	set x11vnc_connect_file "";
-}
-
-set x11vnc_started 0
-if {[info exists env(X11VNC_STARTED)]} {
-	set x11vnc_started 1
-}
-
-set x11vnc_xdisplay ""
-if {[info exists env(X11VNC_XDISPLAY)]} {
-	set x11vnc_xdisplay $env(X11VNC_XDISPLAY);
-	set x11vnc_connect 1
-
-} elseif {$argv != "" && [regexp {:[0-9]} $argv]} {
-	set env(X11VNC_XDISPLAY) "$argv"
-	set x11vnc_xdisplay "$argv"
-	set x11vnc_connect 1
-
-} elseif {[info exists env(DISPLAY)]} {
-	set x11vnc_xdisplay $env(DISPLAY);
-} else {
-	set x11vnc_xdisplay ":0";
-}
-set x11vnc_xdisplay0 $x11vnc_xdisplay
-
-if {[info exists env(X11VNC_AUTH_FILE)]} {
-	set x11vnc_auth_file $env(X11VNC_AUTH_FILE)
-} else {
-	set x11vnc_auth_file ""
-}
-
-set simple_gui_created 0
-if {[info exists env(X11VNC_SIMPLE_GUI)]} {
-	set beginner_mode 1
-} else {
-	set beginner_mode 0
-}
-
-set icon_mode 0
-set x11vnc_icon_mode 0
-set tray_embed 0
-set tray_running 0
-
-if {![info exists env(X11VNC_ICON_MODE_AT_STARTUP)]} {
-	if {[info exists env(X11VNC_ICON_MODE)]} {
-		if {$env(X11VNC_ICON_MODE) != 0} {
-			set env(X11VNC_ICON_MODE_AT_STARTUP) 1
-		} else {
-			set env(X11VNC_ICON_MODE_AT_STARTUP) 0
-		}
-	} else {
-		set env(X11VNC_ICON_MODE_AT_STARTUP) 0
-	}
-}
-set icon_mode_at_startup $env(X11VNC_ICON_MODE_AT_STARTUP)
-
-if {![info exists env(X11VNC_ICON_MODE)]} {
-	set icon_mode 0
-} elseif {$env(X11VNC_ICON_MODE) == "" || $env(X11VNC_ICON_MODE) == "0"} {
-	set icon_mode 0
-} else {
-	set icon_mode 1
-	set_view_variable "icon"
-	if [regexp -nocase {TRAY} $env(X11VNC_ICON_MODE)] {
-		set tray_embed 1
-	}
-	if [regexp -nocase {RUNNING} $env(X11VNC_ICON_MODE)] {
-		set tray_running 1
-	}
-}
-
-set icon_setpasswd 0
-if {[info exists env(X11VNC_ICON_SETPASS)]} {
-	if {$env(X11VNC_ICON_SETPASS) != ""} {
-		set icon_setpasswd 1
-	}
-}
-
-set icon_noadvanced 0
-if {[info exists env(X11VNC_ICON_NOADVANCED)]} {
-	set icon_noadvanced 1
-}
-
-set icon_minimal 0
-if {[info exists env(X11VNC_ICON_MINIMAL)]} {
-	set icon_minimal 1
-}
-
-if {[info exists env(X11VNC_ICON_EMBED_ID)]} {
-	set icon_embed_id $env(X11VNC_ICON_EMBED_ID)
-} else {
-	set icon_embed_id ""
-}
-
-
-set hostname [exec uname -n]
-set osname [exec uname]
-
-if {[regexp -nocase {IRIX} $osname]} {
-	# IRIX "fixed" font is huge and doublespaced... 
-	set ffont $snfont
-}
-if {[regexp -nocase {Darwin} $osname]} {
-	set ffont {Monaco 10}
-	set bfont {system}
-}
-
-if {"$argv" == "-portprompt"} {
-	do_port_prompt
-	exit 0
-}
-
-#puts [exec env]
-#puts "x11vnc_xdisplay: $x11vnc_xdisplay"
-
-set env(X11VNC_STD_HELP) 1
-
-# scrape the help output for the text and remote control vars:
-parse_help;
-parse_remote_help;
-parse_query_help;
-
-# tweaks to duplicate help text:
-tweak_remote_help lock deny
-tweak_remote_help unlock deny
-
-tweak_both quiet q
-tweak_help logfile o
-tweak_both xwarppointer xwarp
-tweak_both screen_blank sb
-
-set_template
-
-set_name "tkx11vnc"
-
-key_bindings;
-
-get_default_vars
-
-dtime D
-
-proc check_setpasswd {} {
-	global env icon_setpasswd
-	global do_props_msg
-	set do_props_msg ""
-	if {$icon_setpasswd} {
-		set m "\n"
-		set m "${m} Note the x11vnc icon in the system tray.\n" 
-		set m "${m} This panel is its 'Properties' dialog.\n" 
-		set m "${m}\n" 
-		set m "${m} To specify a Session Password and to\n" 
-		set m "${m} allow VNC viewers to connect, follow\n" 
-		set m "${m} these steps:\n" 
-		set m "${m}\n" 
-		set m "${m} Enter a passwd in the Password field\n" 
-		set m "${m} (it can be left blank.)  You can also\n" 
-		set m "${m} supply a ViewOnly passwd if desired.\n" 
-		set m "${m}\n" 
-		set m "${m} Set 'Accept Connections' and then Press \n" 
-		set m "${m} 'Apply' to allow incoming connections.\n" 
-		set m "${m}\n" 
-		set m "${m} No Viewer can connect until you do this.\n" 
-		set m "${m}\n" 
-		set m "${m} The passwords are only for this x11vnc\n" 
-		set m "${m} session and are not saved.  Run x11vnc\n" 
-		set m "${m} manually for more control (e.g. -rfbauth \n" 
-		set m "${m} for a saved password.)\n" 
-		set m "${m}\n" 
-		set m "${m} See 'Help' for details on each option.\n" 
-
-		global x11vnc_cmdline
-
-		set dossl 0
-		if {[info exists x11vnc_cmdline]} {
-			if [regexp -- {-ssl} $x11vnc_cmdline] {
-				set dossl 1
-			}
-		}
-		if {$dossl || [info exists env(X11VNC_GOT_SSL)]} {
-			set m "${m}\n" 
-			set m "${m} SSL encryption mode active.  You can\n" 
-			set m "${m} find your Public Cert in the Logfile\n" 
-			set m "${m} and also the ~/.vnc/certs directory.\n" 
-		}
-
-		if {[info exists env(X11VNC_SETPASS_FAIL)]} {
-			set pp 5900
-			if {[info exists env(X11VNC_GOT_RFBPORT_VAL)]} {
-				if {$env(X11VNC_GOT_RFBPORT_VAL) > 0} {
-					set pp $env(X11VNC_GOT_RFBPORT_VAL)
-				}
-			}
-			
-			set m     " The x11vnc program failed to start! \n"
-			set m "${m}\n" 
-			set m "${m} Maybe there is another VNC server\n"
-			set m "${m} already listening on port $pp?\n"
-			set m "${m}\n" 
-			set m "${m} You will need to start over after\n"
-			set m "${m} you make sure x11vnc can start.\n"
-		}
-		
-		set do_props_msg $m
-		do_props
-	}
-}
-
-if {0} {
-	if {[info exists env(X11VNC_ICON_SETPASS)]} {
-		if {$env(X11VNC_ICON_SETPASS) == "2"} {
-			global icon_mode_at_startup icon_mode
-			set icon_mode_at_startup 1
-			set icon_mode 2
-		}
-	}
-}
-
-if {$icon_mode} {
-	if {$icon_mode == 2} {
-		make_gui "full"
-	} elseif {$tray_embed} {
-		make_gui "tray"
-	} else {
-		make_gui "icon"
-	}
-	dtime G
-	old_balloon
-	check_setpasswd
-	push_new_value "remote-cmd" "remote-cmd" "Q:clients" 1
-} else {
-	make_gui "full"
-	dtime G
-	check_setpasswd
-}
-
-
-# main loop.
diff --git a/ica/x11/x11vnc/tkx11vnc.h b/ica/x11/x11vnc/tkx11vnc.h
deleted file mode 100644
index 46f4bbc..0000000
--- a/ica/x11/x11vnc/tkx11vnc.h
+++ /dev/null
@@ -1,7351 +0,0 @@
-#ifndef _TKX11VNC_H
-#define _TKX11VNC_H
-#ifdef NOGUI
-char gui_code[] = "";
-#else
-/*
- * tkx11vnc.h: generated by 'tkx11vnc -spit'
- * Abandon all hope, ye who enter here...
- * ...edit tkx11vnc instead.
- */
-	char gui_code[] =
-"#!/bin/sh\n"
-"# the next line restarts using wish. \\\n"
-"exec wish \"$0\" \"$@\"\n"
-"catch {rename send {}}\n"
-"#\n"
-"# Copyright (C) 2004-2009 Karl J. Runge <runge at karlrunge.com>\n"
-"# All rights reserved.\n"
-"#\n"
-"#  This is free software; you can redistribute it and/or modify\n"
-"#  it under the terms of the GNU General Public License as published by\n"
-"#  the Free Software Foundation; either version 2 of the License, or\n"
-"#  (at your option) any later version.\n"
-"#\n"
-"#  This software is distributed in the hope that it will be useful,\n"
-"#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-"#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-"#  GNU General Public License for more details.\n"
-"#\n"
-"#  You should have received a copy of the GNU General Public License\n"
-"#  along with this software; if not, write to the Free Software\n"
-"#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,\n"
-"#  USA.\n"
-"\n"
-"#\n"
-"# tkx11vnc v0.2\n"
-"# This is a simple frontend to x11vnc.  It uses the remote control\n"
-"# and query features (-remote/-query aka -R/-Q) to interact with it. \n"
-"# It is just a quick-n-dirty hack (it parses -help output, etc), but\n"
-"# it could be of use playing with or learning about the (way too) many\n"
-"# parameters x11vnc has.\n"
-"# \n"
-"# It can be used to interact with a running x11vnc (see the x11vnc\n"
-"# -gui option), or to set the parameters and then start up x11vnc.  \n"
-"# \n"
-"\n"
-"#\n"
-"# Below is a simple picture of how the gui should be laid out and how\n"
-"# the menus should be organized.  Most menu items correspond to remote\n"
-"# control commands. A trailing \":\" after the item name means it is a string\n"
-"# to be set rather than a boolean that can be toggled (e.g. the entry\n"
-"# box must be used).\n"
-"#\n"
-"# Some tweak options may be set in the prefix \"=\" string.\n"
-"#	A means it is an \"Action\" (not a true variable)\n"
-"#	R means it is an action only valid in remote mode.\n"
-"#	S means it is an action only valid in startup mode.\n"
-"#	Q means it is an action worth querying after running.\n"
-"#	P means the string can be +/- appended/deleted (string may not\n"
-"#         be the same after the remote command)\n"
-"#	G means gui internal item\n"
-"#	F means can be set via file browse\n"
-"#	D means for simple gui\n"
-"#	-C:val1,... means it will be a checkbox (radio button)\n"
-"#	   the \"-\" means no other options follow\n"
-"#	0 means to skip the item.\n"
-"#	-- means add a separator\n"
-"#\n"
-"#       The =GAL ... =GAL LOFF stuff is to provide submenus.\n"
-"#\n"
-"\n"
-"global env started time_count\n"
-"set started \"\"\n"
-"proc dtime {{msg \"\"}} {\n"
-"	global started time_count\n"
-"	if {$started == \"\"} {\n"
-"		return\n"
-"	}\n"
-"	set diff [expr \"[exec gtod.bin] - $started\"]\n"
-"	set diff [format \"%.2f\" $diff]\n"
-"	incr time_count\n"
-"	if {$msg == \"\"} {\n"
-"		set msg $time_count\n"
-"	}\n"
-"	puts -nonewline stderr \"$msg $diff \" \n"
-"	puts stderr [clock format [clock seconds]]\n"
-"}\n"
-"\n"
-"if [info exists env(X11VNC_GUI_TIME)] {\n"
-"	global started time_count\n"
-"	set started [exec gtod.bin]\n"
-"	set time_count 0\n"
-"	dtime \"S\"\n"
-"}\n"
-"\n"
-"proc set_template {} {\n"
-"	global template\n"
-"	set template \"\n"
-"Row: Actions   Clients   Permissions  Keyboard    Pointer  Help\n"
-"Row: Displays  Screen    Tuning       Debugging   Misc\n"
-"\n"
-"Actions\n"
-"	=SA start\n"
-"	=RA stop\n"
-"	--\n"
-"	=DSA attach\n"
-"	=DRA detach\n"
-"	--\n"
-"	=RA ping\n"
-"	=RA update-all\n"
-"	=GAL Settings::\n"
-"	=GA save-settings\n"
-"	=SFA load-settings:\n"
-"	=SA defaults-all\n"
-"	=0SA clear-all\n"
-"	--\n"
-"	=F rc:\n"
-"	norc\n"
-"	=GAL LOFF\n"
-"	-- D\n"
-"	=DRA stop+quit \n"
-"	=DGA Quit \n"
-"\n"
-"Help\n"
-"	=DGA gui\n"
-"	=DGA all\n"
-"\n"
-"Clients\n"
-"	=DRQA current:\n"
-"	=DF   connect:\n"
-"	=DRQA disconnect:\n"
-"	--\n"
-"	accept:\n"
-"	afteraccept:\n"
-"	gone:\n"
-"	vncconnect\n"
-"	zeroconf\n"
-"	-- D\n"
-"	tightfilexfer\n"
-"	ultrafilexfer\n"
-"	proxy:\n"
-"	=GAL Chat::\n"
-"	chatwindow\n"
-"	=DRA chaton\n"
-"	=DRA chatoff\n"
-"	=GAL LOFF\n"
-"	=GAL Java-applet::\n"
-"	=D http\n"
-"	httpdir:\n"
-"	httpport:\n"
-"	https:\n"
-"	httpsredir:\n"
-"	enablehttpproxy\n"
-"	=GAL LOFF\n"
-"\n"
-"Displays\n"
-"	=D display:\n"
-"	=F auth:\n"
-"	=S reflect:\n"
-"	=D desktop:\n"
-"	=D rfbport:\n"
-"	=S autoport:\n"
-"	=0 gui:\n"
-"\n"
-"Screen\n"
-"	=DRA refresh\n"
-"	=RA reset\n"
-"	=RA blacken\n"
-"	-- D\n"
-"	=D scale:\n"
-"	scale_cursor:\n"
-"	--\n"
-"	=D solid\n"
-"	solid_color:\n"
-"	--\n"
-"	=GAL OverlayVisuals::\n"
-"	overlay\n"
-"	overlay_nocursor\n"
-"	8to24\n"
-"	8to24_opts:\n"
-"	=GAL LOFF\n"
-"	=GAL 8-Bit-Color::\n"
-"	flashcmap\n"
-"	shiftcmap:\n"
-"	notruecolor\n"
-"	=GAL LOFF\n"
-"	=GAL SubWindow::\n"
-"	id:\n"
-"	sid:\n"
-"	=RA id_cmd:\n"
-"	=GAL LOFF\n"
-"	=GAL ResizeRotate::\n"
-"	= xrandr\n"
-"	=-C:resize,newfbsize,exit xrandr_mode:\n"
-"	rotate:\n"
-"	padgeom:\n"
-"	=GAL LOFF\n"
-"	=GAL Clipping::\n"
-"	=P blackout:\n"
-"	xinerama\n"
-"	clip:\n"
-"	=GAL LOFF\n"
-"	=GAL Misc-Screen::\n"
-"	fixscreen:\n"
-"	visual:\n"
-"	rawfb:\n"
-"	pipeinput:\n"
-"	uinput_accel:\n"
-"	uinput_reset:\n"
-"	uinput_always:\n"
-"	24to32\n"
-"	=GAL LOFF\n"
-"\n"
-"Keyboard\n"
-"	=D norepeat\n"
-"	=D add_keysyms\n"
-"	modtweak\n"
-"	xkb\n"
-"	--\n"
-"	capslock\n"
-"	skip_lockkeys\n"
-"	--\n"
-"	skip_keycodes:\n"
-"	skip_dups\n"
-"	sloppy_keys\n"
-"	--\n"
-"	=FP remap:\n"
-"	clear_mods\n"
-"	clear_keys\n"
-"	clear_all\n"
-"	=RA clear_locks\n"
-"\n"
-"Pointer\n"
-"	=D-C:none,arrow,X,some,most cursor:\n"
-"	=-C:1,2,3,4,5,6 arrow:\n"
-"	--\n"
-"	cursorpos\n"
-"	=D nocursorshape\n"
-"	--\n"
-"	noxfixes\n"
-"	cursor_drag\n"
-"	=GAL AlphaBlending::\n"
-"	noalphablend\n"
-"	alphacut:\n"
-"	alphafrac:\n"
-"	alpharemove\n"
-"	=GAL LOFF\n"
-"	--\n"
-"	buttonmap:\n"
-"	--\n"
-"	xwarppointer\n"
-"	always_inject\n"
-"\n"
-"Misc\n"
-"	=GD-C:full,icon,tray WindowView:\n"
-"	=GD simple-gui\n"
-"	-- D\n"
-"	=GA all-settings\n"
-"	=RA remote-cmd:\n"
-"	=GAL Selection::\n"
-"	=D nosel\n"
-"	noprimary\n"
-"	nosetprimary\n"
-"	noclipboard\n"
-"	nosetclipboard\n"
-"	seldir:\n"
-"	=GAL LOFF\n"
-"	=GAL X-ext::\n"
-"	xtrap\n"
-"	noxrecord\n"
-"	=RQA reset_record\n"
-"	=GAL LOFF\n"
-"	=GAL MacOSX::\n"
-"	macnosaver\n"
-"	macnowait\n"
-"	macwheel:\n"
-"	macnoswap\n"
-"	macnoresize\n"
-"	maciconanim:\n"
-"	macmenu\n"
-"	=GAL LOFF\n"
-"	--\n"
-"	6\n"
-"	noipv6\n"
-"	noipv4\n"
-"	--\n"
-"	nofb\n"
-"	=D nobell\n"
-"	nolookup\n"
-"	rfbversion:\n"
-"	bg\n"
-"	=S loop\n"
-"	=S loopbg\n"
-"	=S sleepin:\n"
-"	=-C:ignore,exit sigpipe:\n"
-"	=0 inetd\n"
-"\n"
-"Debugging\n"
-"	debug_pointer\n"
-"	debug_keyboard\n"
-"	=F logfile:\n"
-"	=GA show-logfile\n"
-"	=GA tail-logfile\n"
-"	quiet\n"
-"	--\n"
-"	=GA show-start-cmd\n"
-"	=DG debug_gui\n"
-"	=GAL Misc-Debug::\n"
-"	debug_xevents\n"
-"	debug_xdamage\n"
-"	=-C:0,1,2,3 debug_wireframe:\n"
-"	debug_scroll\n"
-"	debug_tiles\n"
-"	debug_grabs\n"
-"	debug_sel\n"
-"	debug_ncache\n"
-"	dbg\n"
-"	=GAL LOFF\n"
-"\n"
-"Permissions\n"
-"	=DRQA lock\n"
-"	=DRQA unlock\n"
-"	=D shared\n"
-"	=D forever\n"
-"	--\n"
-"	=DFP allow:\n"
-"	=D localhost\n"
-"	=RA allowonce:\n"
-"	listen:\n"
-"	-- D\n"
-"	=D viewonly\n"
-"	input:\n"
-"	--\n"
-"	=GAL Passwords::\n"
-"	passwd:\n"
-"	viewpasswd:\n"
-"	=F passwdfile:\n"
-"	=F rfbauth:\n"
-"	usepw\n"
-"	--\n"
-"	unixpw\n"
-"	unixpw_list:\n"
-"	unixpw_nis\n"
-"	unixpw_nis_list:\n"
-"	=0 storepasswd\n"
-"	=GAL LOFF\n"
-"	=GAL SSL::\n"
-"	ssl\n"
-"	=F ssl_pem:\n"
-"	stunnel\n"
-"	=F stunnel_pem:\n"
-"	=F ssldir:\n"
-"	=F sslverify:\n"
-"	ssltimeout:\n"
-"	--\n"
-"	enc:\n"
-"	=GAL LOFF\n"
-"	=GAL Misc-Perms::\n"
-"	safer\n"
-"	unsafe\n"
-"	=RA noremote\n"
-"	=0S alwaysshared\n"
-"	=0S nevershared\n"
-"	=0S dontdisconnect\n"
-"	=SQA deny_all\n"
-"	timeout:\n"
-"	grabkbd\n"
-"	grabptr\n"
-"	grabalways\n"
-"	grablocal:\n"
-"	forcedpms\n"
-"	clientdpms\n"
-"	noserverdpms\n"
-"	noultraext\n"
-"	=GAL LOFF\n"
-"\n"
-"Tuning\n"
-"	=D-C:0,1,2,3,4 pointer_mode:\n"
-"	input_skip:\n"
-"	allinput\n"
-"	=D nodragging\n"
-"	-- D\n"
-"	speeds:\n"
-"	=D wait:\n"
-"	defer:\n"
-"	=D nap\n"
-"	screen_blank:\n"
-"	--\n"
-"	=GAL WireFrame::\n"
-"	wireframe\n"
-"	wireframe_mode:\n"
-"	=-C:never,top,always wirecopyrect:\n"
-"	=GAL LOFF\n"
-"	=GAL ScrollCopyRect::\n"
-"	=-C:never,keys,mouse,always scrollcopyrect:\n"
-"	scr_area:\n"
-"	scr_skip:\n"
-"	scr_inc:\n"
-"	scr_keys:\n"
-"	scr_term:\n"
-"	scr_keyrepeat:\n"
-"	scr_parms:\n"
-"	=GAL LOFF\n"
-"	=GAL XDAMAGE::\n"
-"	xdamage\n"
-"	xd_area:\n"
-"	xd_mem:\n"
-"	=GAL LOFF\n"
-"	=GAL Ncache::\n"
-"	ncache\n"
-"	ncache_size:\n"
-"	ncache_cr\n"
-"	ncache_no_moveraise\n"
-"	ncache_no_dtchange\n"
-"	ncache_old_wm\n"
-"	ncache_no_rootpixmap\n"
-"	ncache_keep_anims\n"
-"	ncache_pad:\n"
-"	=RA ncache_reset_rootpixmap\n"
-"	=GAL LOFF\n"
-"	--\n"
-"	=GAL SharedMemory::\n"
-"	noshm\n"
-"	flipbyteorder\n"
-"	onetile\n"
-"	=GAL LOFF\n"
-"	=GAL Misc-Tuning::\n"
-"	progressive:\n"
-"	fs:\n"
-"	gaps:\n"
-"	grow:\n"
-"	fuzz:\n"
-"	extra_fbur:\n"
-"	wait_ui:\n"
-"	setdefer:\n"
-"	nowait_bog\n"
-"	slow_fb:\n"
-"	xrefresh:\n"
-"	readtimeout:\n"
-"	snapfb\n"
-"	threads\n"
-"	wmdt:\n"
-"	rfbwait:\n"
-"	nodpms\n"
-"	nofbpm\n"
-"	=GAL LOFF\n"
-"\"\n"
-"}\n"
-"\n"
-"proc set_internal_help {} {\n"
-"	global helptext helpall\n"
-"\n"
-"	# set some internal item help here:\n"
-"	set helptext(start) \"\n"
-"Launch x11vnc with the settings you have prescribed in the gui.\n"
-"The x11vnc process is started in an xterm window so you can see the\n"
-"output, kill it, etc.\n"
-"\n"
-"By viewing this help item, the command built so far will be displayed\n"
-"in the gui text area.  Have a look.  If you Press start it will be shown\n"
-"as well and you will be asked to confirm running it.\n"
-"\n"
-"If you want to use a saved profile \\\"rc file\\\" you can do \\\"Misc -> rc\\\" and\n"
-"select the file and simply start x11vnc using the rc file.  Alternatively,\n"
-"you could first use the \\\"Actions -> load-settings\\\" action to load in\n"
-"an \\\"rc file\\\" and then press \\\"Actions -> start\\\" to start up x11vnc\n"
-"based on those values.\n"
-"\"\n"
-"	set helptext(stop) \"\n"
-"The \\\"Actions -> stop\\\" action sends a signal to the running x11vnc\n"
-"server indicating it should shutdown all connections and exit.\n"
-"\n"
-"The GUI stays running in case you want to start a new x11vnc or attach\n"
-"to another one.  Use \\\"Actions -> Quit\\\" if you then want to have the\n"
-"gui exit. Use \\\"Actions -> stop+quit\\\" to have both exit at once.\n"
-"\"\n"
-"\n"
-"	set helptext(show-start-cmd) \"\n"
-"Displays in the text area what the x11vnc start command (i.e. the command\n"
-"run by \\\"Actions -> start\\\") looks like for the current values of the\n"
-"settings.  This can be done even in the attached state.  Intended for\n"
-"debugging the gui.  The help item for \\\"Actions -> start\\\" gives the\n"
-"same info.\n"
-"\n"
-"If you want to load in a saved profile \\\"rc file\\\" use \\\"Misc -> rc\\\"\n"
-"and select the file.  \\\"Actions -> load-settings\\\" does a similar thing\n"
-"with an rc-file, but reading the file and setting the gui variables to\n"
-"its values.\n"
-"\"\n"
-"\n"
-"	set helptext(debug_gui) \"\n"
-"Set debug_gui to get more output printed in the text area.\n"
-"\"\n"
-"\n"
-"	set helptext(detach) \"\n"
-"No longer be associated with the x11vnc server.  Switch to the\n"
-"non-connected state.  The x11vnc server keeps running: it does not exit.\n"
-"\n"
-"You can either later reattach to it \\\"Actions -> attach\\\", or start\n"
-"up a new x11vnc \\\"Actions -> start\\\", or exit \\\"Actions -> Quit\\\".\n"
-"\"\n"
-"\n"
-"	set helptext(attach) \"\n"
-"Attach to a running x11vnc server, if possible.  Switches to connected\n"
-"state if successful.  Usually the channel used to attach is via the X\n"
-"display (VNC_CONNECT rootwin property) being polled by the x11vnc server.\n"
-"To change or set the X display to use do \\\"Displays -> display\\\".\n"
-"\n"
-"Sometimes the \\\"-connect /path/to/filename\\\" is used as the communcation\n"
-"channel.  The running x11vnc has to know that \\\"/path/to/filename\\\"\n"
-"is the communication channel (i.e. it is using the same -connect option).\n"
-"\"\n"
-"\n"
-"	set helptext(ping) \"\n"
-"Check if x11vnc still responds to \\\"ping\\\" remote command.\n"
-"\"\n"
-"\n"
-"	set helptext(update-all) \"\n"
-"Query the x11vnc server for the current values of all variables.\n"
-"Populate the values into the gui's database.\n"
-"\n"
-"Normally the gui will refresh this info every time it interacts with\n"
-"the x11vnc server (including after a few minutes of inactivity), so one\n"
-"doesn't need to use this action very often (unless something else is\n"
-"changing the state of the x11vnc server, or new clients have connected,\n"
-"etc).\n"
-"\"\n"
-"\n"
-"	set helptext(clear-all) \"\n"
-"Forget any variable settings either entered in by you or set at the\n"
-"default.  Basically sets everything to 0 or the string (unset).\n"
-"\n"
-"This action is only available in \\\"startup\\\" mode, not when connected\n"
-"to a running x11vnc server (in that case the variable settings reflect\n"
-"the state of the running x11vnc).  To detach from a running x11vnc\n"
-"server use \\\"Actions -> detach\\\"; to completely stop the x11vnc server\n"
-"use \\\"Actions -> stop\\\".\n"
-"\"\n"
-"\n"
-"	set helptext(defaults-all) \"\n"
-"Reset all variable settings to the default values.  Basically sets\n"
-"everything to the default queries \\\"x11vnc -QD var\\\" retrieved at startup.\n"
-"\n"
-"This action is only available in \\\"startup\\\" mode, not when connected\n"
-"to a running x11vnc server (in that case the variable settings reflect\n"
-"the state of the running x11vnc).  To detach from a running x11vnc\n"
-"server use \\\"Actions -> detach\\\"; to completely stop the x11vnc server\n"
-"use \\\"Actions -> stop\\\".\n"
-"\"\n"
-"\n"
-"	set helptext(load-settings) \"\n"
-"Read in the \\\"rc file\\\" you prescribe in the dialog and then set the\n"
-"variables to those in the rc-file.  Any variables not mentioned in the\n"
-"rc-file are set to their default value.\n"
-"\n"
-"You could then do \\\"Actions -> start\\\" to start x11vnc with these\n"
-"parameters.  Or you could make some further changes to variables\n"
-"using the gui before starting x11vnc.\n"
-"\n"
-"This action is only available in \\\"startup\\\" mode, not when connected\n"
-"to a running x11vnc server (in that case the variable settings reflect\n"
-"the state of the running x11vnc).  To detach from a running x11vnc\n"
-"server use \\\"Actions -> detach\\\"; to completely stop the x11vnc server\n"
-"use \\\"Actions -> stop\\\".\n"
-"\"\n"
-"\n"
-"	set helptext(save-settings) \"\n"
-"Construct a ~/.x11vncrc file based on the current settings and\n"
-"offer to save it in a file (default ~/.x11vncrc).  If saved in a\n"
-"file other than the default, you can access the profile by using\n"
-"the \\\"-rc <filename>\\\" option when starting x11vnc.\n"
-"\n"
-"If an rc file entry begins with \\\"#d\\\" that means the current\n"
-"setting is at the Default value and so you probably want to leave\n"
-"it commented out with the \\\"#\\\" character.\n"
-"\n"
-"If an rc file entry begins with \\\"#?\\\" that means we think\n"
-"you probably do not really want to force the value to this setting.\n"
-"\n"
-"In either case, feel free to uncomment the line and/or change any\n"
-"of the parameter values in the file. \n"
-"\"\n"
-"\n"
-"	set helptext(all-settings) \"\n"
-"Displays the gui's database of all of the x11vnc server's current\n"
-"settings.  Use \\\"Actions -> update-all\\\"  or \\\"Control+R\\\" to\n"
-"refresh this list if it ever gets out of sync.\n"
-"\"\n"
-"\n"
-"	set helptext(remote-cmd) \"\n"
-"Run a remote command (-R) or query (-Q) directly.  Only a few\n"
-"remote commands are not on a menu, but for those few you can\n"
-"run the command directly this way.  Just enter the command into\n"
-"the Entry box when prompted.  Use the prefix \\\"Q:\\\" to indicate\n"
-"a -Q query.  Examples: \\\"zero:20,20,100,100\\\", \\\"Q:ext_xfixes\\\"  \n"
-"\"\n"
-"\n"
-"	set helptext(stop+quit) \"\n"
-"Send the stop command to the x11vnc server, then terminate the tkx11vnc gui.\n"
-"\"\n"
-"\n"
-"	set helptext(show-logfile) \"\n"
-"View the current contents of the logfile (if it exists and is accessible\n"
-"by the gui process).\n"
-"\"\n"
-"\n"
-"	set helptext(tail-logfile) \"\n"
-"Run the tail(1) command with -f option on the logfile in an xterm.\n"
-"(if it exists and is accessible by the gui process).\n"
-"\"\n"
-"\n"
-"	set helptext(Quit) \"\n"
-"Terminate the tkx11vnc gui.  Any x11vnc server will be left running.\n"
-"\"\n"
-"\n"
-"	set helptext(current) \"\n"
-"Shows a menu of currently connected VNC clients on the x11vnc server.\n"
-"\n"
-"Allows you to find more information about them, change their input\n"
-"permissions, or disconnect them.\n"
-"\n"
-"Note that the File transfer permission only applies to UltraVNC\n"
-"file transfer, not TightVNC file transfer.\n"
-"\n"
-"You will be prompted to confirm any disconnections.\n"
-"\"\n"
-"\n"
-"	set helptext(client) \"\n"
-"After selecting a VNC client from the \\\"Clients -> current\\\" menu,\n"
-"you will be presented with a dialog that shows the information\n"
-"about the VNC client.\n"
-"\n"
-"You can choose to disconnect the client by clicking on the \n"
-"\\\"Disconnect\\\" checkbox and pressing \\\"OK\\\".  There will be a\n"
-"confirmation dialog to doublecheck.\n"
-"\n"
-"Alternatively, you can fine tune the VNC client's input permissions\n"
-"by selecting any of the Keystrokes, Mouse-Motion, Button-Click,\n"
-"Clipboard-Input, or Files checkboxes and pressing \\\"OK\\\".  This is like\n"
-"the \\\"-input\\\" option but on a per-client basis.\n"
-"\n"
-"To not change any aspects of the VNC client press \\\"Cancel\\\".\n"
-"\"\n"
-"\n"
-"	set helptext(solid_color) \"\n"
-"Set the -solid color value.\n"
-"\"\n"
-"\n"
-"	set helptext(xrandr_mode) \"\n"
-"Set the -xrandr mode value.\n"
-"\"\n"
-"\n"
-"	set helptext(unixpw_list) \"\n"
-"Set the -unixpw usernames list value.\n"
-"\"\n"
-"\n"
-"	set helptext(unixpw_nis_list) \"\n"
-"Set the -unixpw_nis usernames list value.\n"
-"\"\n"
-"\n"
-"	set helptext(stunnel_pem) \"\n"
-"Set the -stunnel pem filename value.\n"
-"\"\n"
-"\n"
-"	set helptext(ssl_pem) \"\n"
-"Set the -ssl pem filename value.\n"
-"\"\n"
-"\n"
-"	set helptext(wireframe_mode) \"\n"
-"Set the -wireframe mode string value.\n"
-"\"\n"
-"\n"
-"	set helptext(simple-gui) \"\n"
-"Toggle between menu items corresponding the most basic ones\n"
-"and all possible settings.  I.e. toggle between a simple gui\n"
-"and one for power users.\n"
-"\"\n"
-"\n"
-"	set helptext(Tray) \"\n"
-"The tray/icon mode (started with \\\"x11vnc -gui tray ...\\\", etc.) presents\n"
-"a small icon that indicates the status of the running x11vnc server.\n"
-"\n"
-"Depending on your environment, this icon may be embedded in a system\n"
-"tray or applet dock, or simply be a standalone window.  \\\"-gui tray\\\"\n"
-"will attempt to embed the icon in the system tray, while \\\"-gui icon\\\"\n"
-"is for a standalone window.  Use \\\"-gui tray=setpass\\\" (or icon=setpass)\n"
-"to be prompted to set the session password at startup.\n"
-"\n"
-"When the icon has a light background, that means no VNC viewers are\n"
-"currently connected to the VNC display.\n"
-"\n"
-"When the icon has a dark background (i.e. reverse-video), that means at\n"
-"least one VNC viewer is connected to the VNC display.\n"
-"\n"
-"Moving the mouse pointer over the icon will popup a \\\"status balloon\\\"\n"
-"indicating the VNC display name and the names and info of any connected VNC\n"
-"viewers.  Press the middle mouse button if the balloon does not appear.\n"
-"\n"
-"Clicking the left or right mouse button on the icon displays a menu\n"
-"of actions:\n"
-"\n"
-"    Properties      - Brings up the Properties dialog to set some basic\n"
-"                      parameters.  The full tkx11vnc GUI may be accessed\n"
-"                      via the \\\"Advanced ...\\\" button.  Press \\\"Help\\\"\n"
-"                      in the Properties dialog for more info.\n"
-"    \n"
-"    Help            - Displays this help text.\n"
-"    \n"
-"    New Client      - Presents an entry box where you type in the name\n"
-"                      of a computer that is running a VNC viewer in\n"
-"                      \\\"listen\\\" mode (e.g. vncviewer -listen).  For a\n"
-"                      non-standard listening port use \\\"host:port\\\".\n"
-"\n"
-"                      Pressing \\\"OK\\\" will initiate the reverse\n"
-"                      connection.  Use a blank hostname to skip it.\n"
-"    \n"
-"    Disconnect      - Shows a popup menu of connected clients.  Click on\n"
-"                      one to disconnect it, or click on \\\"All Clients\\\"\n"
-"                      disconnect all clients.\n"
-"\n"
-"    Window View     - Switch between the \\\"full\\\" gui (also known as\n"
-"                      \\\"Advanced\\\"), \\\"icon\\\" mode (small icon window with\n"
-"                      popups), or \\\"tray\\\" mode (small icon embedded in the\n"
-"                      system tray).  This is a shortcut for the action:\n"
-"                      \\\"Properties -> Advanced -> Misc -> WindowView\\\".\n"
-"    \n"
-"    Stop x11vnc     - Directs the x11vnc server to disconnect all vncviewers\n"
-"                      and then exit.  The tray/icon GUI then exits as well.\n"
-"\n"
-"    Logfile         - Show the logfile if x11vnc is being run with one.\n"
-"\n"
-"    Custom          - If you have a \\$HOME/.x11vnc.gui file each uncommented\n"
-"                      line in it becomes an additional menu item for this\n"
-"                      menu.  The remote control command is run directly\n"
-"                      via \\\"x11vnc -R <command>\\\", or if prefixed with \n"
-"                      \\\"action:\\\" runs a gui internal action, or if \\\"sep\\\"\n"
-"                      adds a separator.  Set X11VNC_CUSTOM_GUI to use\n"
-"                      a different filename.  Example file contents:\n"
-"\n"
-"                             scale:3/4\n"
-"                             scale:1\n"
-"                             scale_cursor:1\n"
-"                             sep\n"
-"                             action:all-settings\n"
-"                             #debug_keyboard\n"
-"                             sep\n"
-"                             action:Quit\n"
-"\n"
-"Termination:\n"
-"\n"
-"If the x11vnc server stops for any reason, the tray/icon gui will exit.\n"
-"\n"
-"If you delete the tray/icon (e.g. X out button), that is the same\n"
-"as the \\\"Stop x11vnc\\\" action in the menu. (This will disconnect any\n"
-"VNC viewer you are currently using to access the display since the\n"
-"x11vnc server is terminated).\n"
-"\n"
-"To terminate the tray/icon gui window but not the x11vnc server press\n"
-"Control-C on the tray/icon window.  You can also do this (and much\n"
-"more) via Properties -> Advanced -> Actions -> Quit\n"
-"\"\n"
-"\n"
-"	set helptext(NewClient) \"\n"
-"    New Client      - Presents an entry box where you type in the name\n"
-"                      of a computer that is running a VNC viewer in\n"
-"                      \\\"listen\\\" mode (e.g. vncviewer -listen).  For a\n"
-"                      non-standard listening port use \\\"host:port\\\".\n"
-"\n"
-"                      Pressing \\\"OK\\\" will initiate the reverse\n"
-"                      connection.  Use a blank hostname to skip it, or\n"
-"                      delete (\\\"X-out\\\") the window.\n"
-"    \n"
-"\"\n"
-"\n"
-"	set helptext(Properties) \"\n"
-"The Properties dialog allows you to set some basic parameters of a\n"
-"running x11vnc server.  After modifying them press \\\"OK\\\" or \\\"Apply\\\"\n"
-"to apply the changes, or press \\\"Cancel\\\" to skip applying them.\n"
-"\n"
-" Accept Connections:\n"
-"\n"
-"   Toggles whether VNC viewers are allowed to connect or not.  It corresponds\n"
-"   to the \\\"-R unlock\\\" and \\\"-R lock\\\" remote-control commands.\n"
-"\n"
-" Ask for Confirmation:\n"
-"\n"
-"   Toggles whether a popup menu will be presented at the X display when\n"
-"   a new VNC viewer attempts to connect.  The person sitting at the X\n"
-"   display can choose to accept or reject the connection or accept the\n"
-"   connection in ViewOnly mode.  It corresponds to the \\\"-R accept:popup\\\"\n"
-"   and \\\"-R accept:\\\" remote-control commands.\n"
-"   \n"
-" All Clients ViewOnly:\n"
-"\n"
-"   Toggles whether the entire VNC desktop is view only.  All clients\n"
-"   will only be able to watch when this is set (regardless of how they\n"
-"   logged in).  It corresponds to the \\\"-R viewonly\\\" and \\\"-R noviewonly\\\"\n"
-"   remote-control commands.\n"
-"   \n"
-" Shared:\n"
-"\n"
-"   Toggles whether multiple simultaneous viewer connections are allowed\n"
-"   or not.  It corresponds to the \\\"-R shared\\\" and \\\"-R noshared\\\"\n"
-"   remote-control commands.\n"
-"\n"
-" Advertise Service (Zeroconf):\n"
-"\n"
-"   Toggles whether this VNC server should advertize itself via Zeroconf\n"
-"   (also called Bonjour, mDNS, and avahi).  Then VNC viewers can then find\n"
-"   this service on the local network.  It corresponds to the \\\"-R zeroconf\\\"\n"
-"   and \\\"-R nozeroconf\\\" remote-control commands.\n"
-"\n"
-" Serve Java Viewer Applet:\n"
-"\n"
-"   Toggles whether this VNC server should serve up a Java VNC Viewer\n"
-"   applet via HTTP on http://hostname:5800/ (or port 5800+n for VNC\n"
-"   port 5900+n).  A java enabled Web Browser can then connect to the\n"
-"   desktopby VNC.  If SSL is active then the HTTPS URL https://hostname:5900/\n"
-"   (etc.) will work as well.  This requires the x11vnc java viewer jar file\n"
-"   (shared/x11vnc/classes) to be installed.  It corresponds to the\n"
-"   \\\"-R http\\\" and \\\"-R nohttp\\\" remote commands.\n"
-"\n"
-" Solid Background Color:\n"
-"\n"
-"   To improve VNC performance, if this option is set, then x11vnc will try\n"
-"   to make the desktop background a solid color (which compresses extremely\n"
-"   well compared to photo images, etc.)  It corresponds to the \\\"-R solid\\\"\n"
-"   and \\\"-R nosolid\\\" remote commands.\n"
-"\n"
-" Password:\n"
-"\n"
-"   Lets you set the session password viewers may use to gain full access\n"
-"   to the display.  This will only work if x11vnc was started with the\n"
-"   -gui icon or -gui tray mode.\n"
-"   \n"
-" ViewOnly Password:\n"
-"\n"
-"   Lets you set the session password viewers may use to gain view only\n"
-"   access to the display.  This will only work if x11vnc was started with\n"
-"   the -gui icon or -gui tray mode.\n"
-"\n"
-"\n"
-" NOTE: These \\\"session\\\" passwords only last for the current x11vnc\n"
-" session (they are not remembered, see the -storepasswd, -passwdfile,\n"
-" and -rfbauth x11vnc options for using stored passwords).\n"
-"\n"
-" If you set \\\"Password\\\" to the empty string that makes the \\\"ViewOnly\n"
-" Password\\\" empty as well and removes the need for any password to log in.\n"
-"\n"
-" If you set \\\"ViewOnly Password\\\" to the empty string that just removes\n"
-" the ViewOnly log in aspect: \\\"Password\\\" is still required to log in.\n"
-"\n"
-" - The \\\"Help\\\" button shows this help text.\n"
-"   \n"
-" - The \\\"Advanced ...\\\" button replaces the Properties dialog with the full\n"
-"   tkx11vnc GUI.  All dynamic settings can be modified in the full GUI.\n"
-"\n"
-"\n"
-"==========================================================================\n"
-"\n"
-"Don't Lock Yourself Out:\n"
-"\n"
-"   If you are sitting at the physical X display you cannot get into too\n"
-"   much trouble setting the Properties dialog values.\n"
-"\n"
-"   However IF you are using a VNC Viewer to REMOTELY access the X display\n"
-"   some items in the Properties dialog can lock you out of further access:\n"
-"\n"
-"      \\\"Accept Connections\\\"  if you disable this remotely, and\n"
-"      accidentally disconnect your VNC viewer then you will not be\n"
-"      able to reconnect.\n"
-"   \n"
-"      \\\"Ask for Confirmation\\\"  if you enable this only someone\n"
-"      sitting at the X display can confirm any new VNC connections.\n"
-"      Furthermore, any current VNC viewers will be blocked while\n"
-"      waiting for the confirmation (times out in 120 sec by default). \n"
-"   \n"
-"      \\\"All Clients ViewOnly\\\"  if you enable this remotely, well\n"
-"      you can no longer provide input to disable it.\n"
-"   \n"
-"   If you do lock yourself out you could log in remotely and start up\n"
-"   a second x11vnc and connect to that one to try to fix things in the\n"
-"   first one.\n"
-"\n"
-"   Note that if there are two or more x11vnc's on the same display the\n"
-"   use of the GUI may be ill-behaved.  Terminate the second x11vnc as\n"
-"   soon as you have fixed the setting in the first one.  Use of a remote\n"
-"   control command, e.g. \\\"x11vnc -R noviewonly\\\" or \\\"x11vnc -R unlock\\\"\n"
-"   is a good way to avoid this problem.\n"
-"\"\n"
-"\n"
-"	set helptext(all) $helpall\n"
-"\n"
-"	set helptext(Misc-Tuning:) \"\n"
-"x11vnc has what seems like hundreds of tuning parameters!  In this\n"
-"sub-menu we place some lesser used ones.  Most likely you'll want to\n"
-"leave them at their default values, but you can try them out quickly\n"
-"with the gui to see if they improve things.\n"
-"\"\n"
-"\n"
-"	set helptext(Passwords:) \"\n"
-"The items in this sub-menu pertain to setting passwords.  Note that x11vnc\n"
-"has two types of password files: RealVNC-style ones (you can create them\n"
-"with x11vnc -storepasswd or other VNC utility program) you use these\n"
-"via -rfbauth; and plain-text file passwords you use via -passwdfile.\n"
-"\n"
-"Normally passwords cannot be changed by remote-control (e.g. the gui),\n"
-"but for the case of the \\\"Icon\\\" and \\\"Tray\\\" modes this constraint has\n"
-"been relaxed.\n"
-"\n"
-"In neither the RealVNC-style nor the plain-text file cases should the\n"
-"password files be readable by users you do not want to access the VNC\n"
-"server.  Contrary to popular belief, the  RealVNC-style passwords are\n"
-"not encrypted, merely obscured.\n"
-"\n"
-"x11vnc has the even less secure -passwd and -viewpasswd supplied on\n"
-"the command line.  Be careful with these since they could be read by\n"
-"users with something like the ps(1) command.  On some operating systems\n"
-"x11vnc tries to quickly overwrite them on the command line but it doesn't\n"
-"work everywhere.\n"
-"\n"
-"Regarding ViewOnly passwords (where a VNC client using that password\n"
-"can only watch the screen, not interact with it), this is not available\n"
-"with -rfbauth, but only with -passwdfile, -passwd, and -viewpasswd.\n"
-"\"\n"
-"\n"
-"	set helptext(SSL:) \"\n"
-"In this sub-menu we provide the options related to SSL encrpytion\n"
-"and authentication.\n"
-"\n"
-"There is a built-in mode (-ssl) using the OpenSSL library, and a 2nd\n"
-"using the external stunnel program (-stunnel, that needs to be installed\n"
-"on the system).  Either may require or benefit from having PEM certificate\n"
-"files specified.\n"
-"\n"
-"\"\n"
-"\n"
-"	set helptext(Misc-Perms:) \"\n"
-"In this sub-menu we provide some lesser used permission options.\n"
-"\n"
-"Regarding -alwaysshared, -nevershared, and -dontdisconnect, you probably\n"
-"should never use them and just use x11vnc's -shared and -forever options\n"
-"instead (these give basically the same functionality and if you mixed\n"
-"them too much unexpected things may happen).\n"
-"\"\n"
-"#'\n"
-"\n"
-"	set helptext(AlphaBlending:) \"\n"
-"In this sub-menu we provide some tweak parameters for cursors (little\n"
-"icon at the mouse pointer) that have transparency (i.e. an Alpha channel\n"
-"in addition to Red, Green, and Blue RGB channels).  For these cursors,\n"
-"some of the graphics underneath the cursor is allowed to be blended in:\n"
-"e.g. a drop-shadow (a terrible effect IMNSHO).\n"
-"\n"
-"AlphaBlending for x11vnc is only available when the XFIXES X extension is\n"
-"present (since otherwise it cannot see the cursors at all and so applies\n"
-"heuristics to show some fake cursors).  AlphaBlending is only a problem\n"
-"with x11vnc when the cursors are not opaque.\n"
-"\n"
-"Opaque cursors (e.g. bitmap or simply colored cursor) are rendered\n"
-"correctly by x11vnc.  Only when there is transparency does x11vnc have\n"
-"to make some approximation to transform the cursor to be opaque (the\n"
-"VNC protocol does not provide for an alpha channel in cursors, only RGB).\n"
-"\n"
-"The items in this sub-menu let you tweak x11vnc's approximation scheme\n"
-"for cursors with transparency.  Hopefully you won't have to use them.\n"
-"Certain cursor \\\"themes\\\" may require adjustment however.\n"
-"\"\n"
-"#'\n"
-"	set helptext(OverlayVisuals:) \"\n"
-"In this sub-menu are some options that involve fixing color problems\n"
-"for \\\"Overlay\\\" or \\\"Multi-Depth\\\" visuals.  This problem is rare\n"
-"since overlay and multi-depth visual video hardware is rare. \n"
-"Some Sun, SGI, and HP machines are known to have them.\n"
-"\n"
-"The short answer is if you have a multi-depth visual display (e.g.  8 and\n"
-"24 bits), and you see messed up colors in x11vnc try the \\\"-overlay\\\"\n"
-"option on Solaris or IRIX.\n"
-"\n"
-"A brief Background on pixels, color, and visuals:\n"
-"\n"
-"   Pixels (picture elements) are kept in video memory as a certain number\n"
-"   of bits-per-pixel (bpp).  Most common are 8bpp, 16bpp, and 32bpp.\n"
-"   Less common are 24bpp, 4bpp, and 1bpp (monochrome).\n"
-"\n"
-"   How pixel values (i.e. values of the bits) are rendered into colors on\n"
-"   the screen can be done via different \\\"Recipes\\\".  These different\n"
-"   recipes are referred to as \\\"visuals\\\".  E.g. for 8bpp there is\n"
-"   a PseudoColor visual that maintains a mapping (that can be changed\n"
-"   dynamically) of the pixel values (256 possible ones) into RGB values.\n"
-"   Other 8bpp visuals, e.g. StaticGrey and TrueColor have fixed, regular\n"
-"   mappings and so provide less variation in kinds of colors.\n"
-"\n"
-"   A visual's \\\"depth\\\" is how many of the pixels are used in the\n"
-"   actual recipe.  This may sound wasteful (i.e. not using some of the\n"
-"   bits), but for 32bpp (4 billion colors) that is too much and nearly\n"
-"   always only 24 for them are used.  The most common Visual seems to\n"
-"   be depth 24 TrueColor at 32bpp.  This provides 16 million colors\n"
-"   which is more than the number of pixels on most screens (1280x1024 =\n"
-"   1.3 million pixels).  Another sometimes used visual that ignores some\n"
-"   bits is depth 15 TrueColor at 16bpp.\n"
-"\n"
-"OK, now, finally, to the Overlay Visuals.  Some hardware (or software\n"
-"emulations) allow different depth visuals to be used on the display\n"
-"at the same time.  The pixels of windows using different depth visuals\n"
-"may overlap.\n"
-"\n"
-"The most common seems to be both 8 and 24 depth visuals on a 32bpp setup.\n"
-"24 of the pixels can be used for one visual and the remaining 8 for the\n"
-"other.  This is sometimes referred to as \\\"8+24\\\" mode.  Furthermore,\n"
-"a speedup is achieved because writing graphics data to, say, the 8bit\n"
-"visual does not destroy the image data in the 24bit visual.  Evidently\n"
-"popup menus can be done very quickly this way: they use the 8bit visual\n"
-"and when the popup goes away the graphics data in the 24bit visual is\n"
-"immediately reexposed without having the application redraw it.\n"
-"\n"
-"Also, some legacy applications can only use 8bpp visuals.  But in these\n"
-"days of high color graphics and web browsers one would like the rest\n"
-"of the desktop to use depth 24 visuals.  They often work on the multi\n"
-"depth visuals.\n"
-"\n"
-"How does this effect x11vnc?  x11vnc nearly always polls the root window\n"
-"(container of all other windows).  The root window will be one depth,\n"
-"e.g. 8 or 24.  Any windows using the *other* depth will appear to have\n"
-"messed up colors (or just be black or some other solid color) when viewed\n"
-"via x11vnc.\n"
-"\n"
-"How to fix?  Solaris and IRIX provide an API to extract the full snapshot\n"
-"of the display with all the colors correct.  It comes to x11vnc as depth\n"
-"24 TrueColor.  To enable this use the \\\"-overlay\\\" option.  Performance\n"
-"may be slower, but if the colors are correct that is a big improvement.\n"
-"\"\n"
-"\n"
-"	set helptext(8-Bit-Color:) \"\n"
-"Some older displays (e.g. with limited Video RAM) use 8 bits-per-pixel\n"
-"color.  This allows for only 256 different colors on the screen at the\n"
-"same time.  This sometimes leads to problems with viewing these 8bpp\n"
-"displays via x11vnc.  This sub-menu has some options that correspond to\n"
-"workarounds for this case.  If you can configure the machine to use 16bpp\n"
-"it may be worth it to avoid the color problems (e.g. color flashing\n"
-"as the 8bit colormap is switched).\n"
-"\"\n"
-"	set helptext(SubWindow:) \"\n"
-"This sub-menu has a couple options regarding having x11vnc poll a \n"
-"single window, not the entire display.  This way just the window\n"
-"is shared.\n"
-"\n"
-"Note if the application pops up multiple windows they are not tracked\n"
-"and shared.  So this is not application sharing.  The application has to\n"
-"be very simple (e.g. a simple terminal or the image window on a webcam)\n"
-"for this mode to be usable.\n"
-"\"\n"
-"	set helptext(ResizeRotate:) \"\n"
-"This sub-menu has some options regarding screens that support the X\n"
-"Resize, Reflection, and Rotation Extension (RANDR), and one expects screen\n"
-"resizing, reflection, or rotation to take place during the x11vnc session.\n"
-"This is pretty rare, but x11vnc seems to handle it reasonably well using\n"
-"this X extension.\n"
-"\n"
-"This mode is on by default in -id mode to try to track the changing\n"
-"size of the SubWindow.  It is not on by default for full-screen mode\n"
-"because of the extra overhead, etc.\n"
-"\"\n"
-"\n"
-"	set helptext(WireFrame:) \"\n"
-"This sub-menu has some options for the x11vnc wireframing speedup scheme.\n"
-"\n"
-"For x11vnc, Wireframing means to watch for toplevel windows being Opaquely\n"
-"Moved or Resized.  When x11vnc detects this, it stops polling the screen\n"
-"and simply shows a \\\"wireframe\\\" outline of the window as it is being\n"
-"moved or resized.  This avoids \\\"screen polling thrashing\\\" when the\n"
-"screen is changing so rapidly during this period.  For various reasons\n"
-"this is usually much faster then letting the window manager do its\n"
-"own wireframing (you are encouraged to do Opaque moves and resizes\n"
-"when using x11vnc!)\n"
-"\n"
-"Also, once a moved window is released in its new position, x11vnc uses\n"
-"the VNC CopyRect encoding to very efficiently update the VNC viewers\n"
-"(each just copies the image data locally).\n"
-"\n"
-"This sort of scheme was used much in the 1990's on local displays because\n"
-"video hardware was slow at the time.  x11vnc tries to use this same trick\n"
-"as a speedup for its activities (the network is much slower than video\n"
-"hardware writes, and the video hardware reads that x11vnc uses to poll\n"
-"the screen are still slow today).\n"
-"\"\n"
-"#'\"\n"
-"\n"
-"	set helptext(Safe:) \"\n"
-"In this sub-menu are some options for making x11vnc operations\n"
-"more, or less, safe.  E.g. disable the running of external commands, etc.\n"
-"\n"
-"You can also turn off the Remote control channel (NOTE that doing that\n"
-"will disable the GUI from being able to communicate with x11vnc).\n"
-"\"\n"
-"\n"
-"	set helptext(X-ext:) \"\n"
-"In this sub-menu are a few rarely used options regarding some X extensions\n"
-"used by x11vnc.\n"
-"\"\n"
-"	set helptext(Clipping:) \"\n"
-"In this sub-menu are some options regarding clipping or blacking out\n"
-"portions of the Screen.  E.g. under XINERAMA when the multiple monitors\n"
-"are not the same size.\n"
-"\n"
-"\"\n"
-"	set helptext(Misc-Screen:) \"\n"
-"In this sub-menu are some little used options modifying aspects of\n"
-"the screen source.\n"
-"\"\n"
-"\n"
-"	set helptext(Settings:) \"\n"
-"In this sub-menu are some options for saving and loading option settings.\n"
-"The default file to store settings in is ~/.x11vncrc, but you can save\n"
-"different \\\"profiles\\\" in other files for later use.\n"
-"\n"
-"\"\n"
-"	set helptext(Java-applet:) \"\n"
-"In this sub-menu are some options for running the built-in HTTP server\n"
-"that delivers the TightVNC Java VNC Viewer applet (VncViewer.jar) to\n"
-"clients.  The viewer runs in their Web browser.\n"
-"\n"
-"The default port listened on is 5800, so the URL is typically:\n"
-"\n"
-"	http://hostname:5800/\n"
-"\n"
-"but this can be altered by -httpport, etc.\n"
-"\"\n"
-"\n"
-"	set helptext(Chat:) \"\n"
-"In this sub-menu are some options for enabling a local chat window\n"
-"and starting or stopping the current chat.  This is the UltraVNC \n"
-"Text Chat support in x11vnc.\n"
-"\"\n"
-"\n"
-"	set helptext(ScrollCopyRect:) \"\n"
-"This sub-menu has some options for the x11vnc Scroll detection and\n"
-"CopyRect speedup scheme.\n"
-"\n"
-"For this mode, x11vnc \\\"spies\\\" on communication between the X server and\n"
-"applications using the RECORD extension.  It looks for various patterns\n"
-"to detect a scrolled window.  This only works for some applications,\n"
-"fortunately some important ones.\n"
-"\n"
-"Once the scroll is detected it uses the VNC CopyRect encoding for a\n"
-"big speedup.  Screen polling is also sped up for this scheme.\n"
-"\n"
-"There are many tweakable parameters for this mode and they are described\n"
-"in the sub-menu items.\n"
-"\"\n"
-"\n"
-"	set helptext(XDAMAGE:) \"\n"
-"The DAMAGE X extension allows the X server to send signals to x11vnc\n"
-"telling it which regions of the screen have been changed.  This improves\n"
-"x11vnc's performance markedly.  The DAMAGE extension must be available\n"
-"on the display for this to work.\n"
-"\n"
-"Unfortunately DAMAGE cannot be trusted completely for the changed regions,\n"
-"because often the reported changed region is much larger than the actual\n"
-"changed regions.  Nevertheless, x11vnc uses the DAMAGE information very\n"
-"effectively as hints to improve its performance.\n"
-"\n"
-"The items in the sub-menu allow tweaking x11vnc's DAMAGE algorithm.\n"
-"\"\n"
-"\n"
-"	set helptext(Ncache:) \"\n"
-"A simple client-side (viewer) caching scheme is enabled with the\n"
-"\\\"-ncache n\\\" option.  It simply uses \\\"n\\\" framebuffer sized areas\n"
-"below the actual display for caching window pixel data.  \n"
-"\n"
-"Drawbacks are it uses a lot of RAM (roughly n times more), and the\n"
-"pixels cache area is visible in the viewers.\n"
-"\n"
-"The items in the sub-menu allow tweaking x11vnc's -ncache algorithm.\n"
-"\"\n"
-"\n"
-"	set helptext(SharedMemory:) \"\n"
-"This sub-menu provides some options regarding SYSV shared memory usage\n"
-"(shm) by x11vnc.  Usually you want shm turned on because the x11vnc\n"
-"process is nearly always running on the same machine the X server process\n"
-"is running on.  SharedMemory gives a performance speedup.  However, if you\n"
-"need to modify this scenario for special usage these options allow you to.\n"
-"\"\n"
-"\n"
-"	set helptext(Misc-Debug:) \"\n"
-"This sub-menu contains a lot of debugging parameters usually used\n"
-"for debugging x11vnc itself.  This is unlike the -debug_pointer and\n"
-"-debug_keyboard options that are useful in learning information, quirks,\n"
-"etc. about your local display and environment.\n"
-"\"\n"
-"\n"
-"	set helptext(Selection:) \"\n"
-"This sub-menu contains some options centering around the Selection\n"
-"(also referred to as the Clipboard, Cutbuffers, etc).  x11vnc will try\n"
-"to exchange the selections between the VNC viewers and the X server.\n"
-"You can adjust that behavior with these options.\n"
-"\"\n"
-"\n"
-"	set helptext(WindowView) \"\n"
-"Set the Window View Mode for the gui.  There are three modes:\n"
-"\n"
-"  - full:  Presents the full gui (Actions, Clients, etc, buttons,\n"
-"           and the Text area and Set/Entry box).\n"
-"\n"
-"  - icon:  Presents a small icon instead of the full gui.  Moving\n"
-"           the mouse over it shows the VNC display name and any\n"
-"           connected clients.  Clicking on the icon pops up a menu\n"
-"           of actions to perform.  Among them is \\\"Properties\\\" that\n"
-"           allows setting more parameters.  Clicking on \\\"Advanced\\\"\n"
-"           in \\\"Properties\\\" brings up the full gui.\n"
-"\n"
-"  - tray:  Attempt to embed the small icon in the system tray.  If\n"
-"           this fails it will resort to icon mode where the small icon\n"
-"           is a standalone window.\n"
-"\n"
-"Note that in \\\"full\\\" mode if you delete the full gui window the gui\n"
-"terminates (but the x11vnc server keeps running).  However under \\\"icon\\\"\n"
-"or \\\"tray\\\" mode if you bring up the full gui window via \\\"Properties ->\n"
-"Advanced\\\" and then delete it the gui does NOT terminate.\n"
-"\n"
-"Also note that by default in \\\"icon\\\" mode if you delete the icon\n"
-"window both the gui *and* the x11vnc server terminate.\n"
-"\"\n"
-"\n"
-"	set helptext(gui) \"\n"
-"tkx11vnc is a simple frontend to x11vnc.  Nothing fancy, it merely\n"
-"provides an interface to each of the many x11vnc command line options and\n"
-"remote control commands.  See \\\"Help -> all\\\" for much info about x11vnc.\n"
-"\n"
-"For a simplier gui, run x11vnc in \\\"tray\\\" or \\\"icon\\\" mode such as\n"
-"\\\"-gui tray\\\", \\\"-gui icon\\\", or \\\"-gui tray=setpass\\\".  In that\n"
-"mode the full gui is only available under \\\"Advanced ...\\\".\n"
-"\n"
-"Also, \\\"-gui ez\\\" will show fewer menu items (toggle via Misc -> simple_gui)\n"
-"\n"
-"All menu items have a (?) button one can click on to get more information\n"
-"about the option or command.\n"
-"\n"
-"There are two states tkx11vnc can be in:\n"
-"\n"
-"	1) Available to control a running x11vnc process.\n"
-"\n"
-"	2) Getting ready to start a x11vnc process.\n"
-"\n"
-"Most people will just use state 1).\n"
-"\n"
-"In state 1) the Menu items available in the menus are those that\n"
-"correspond to the x11vnc \\\"remote control\\\" commands.  See the -remote\n"
-"entry under \\\"Help -> all\\\" for a complete list.  Also available is\n"
-"the \\\"Actions -> stop\\\" item to shut down the running x11vnc server,\n"
-"thereby changing to state 2).  There are other actions available too.\n"
-"\n"
-"In state 2) the Menu items available in the menus (\\\"Actions\\\", \\\"Clients\\\",\n"
-"etc.) are those that correspond to command line options used in starting\n"
-"an x11vnc process, and the \\\"Actions -> start\\\" item executes\n"
-"x11vnc thereby changing to state 1).  To see what x11vnc startup command\n"
-"you have built so far, look at the (?) help for  \\\"Actions -> start\\\"\n"
-"and it will show you what the command looks like.\n"
-"\n"
-"There is much overlap between the menu items available in state 1)\n"
-"and state 2), but it is worth keeping in mind it is not 100%.\n"
-"For example, you cannot set passwords or password files in state 1).\n"
-"(update: simple password setting is now allowed in \\\"tray\\\" or \\\"icon\\\" mode).\n"
-"\n"
-"\n"
-"Also note that there may be *two* separate X displays involved, not just\n"
-"one:  1) the X display x11vnc will be polling (and making available to\n"
-"VNC viewers), and 2) the X display this GUI is intended to display on.\n"
-"\n"
-"For example, one might use ssh to access the remote machine where the\n"
-"GUI would display on :11 and x11vnc would poll display :0.  By default\n"
-"the gui will display on the value in the DISPLAY env. variable followed\n"
-"by the value from the -display option.  To override this, use something\n"
-"like: \\\"-gui otherhost:0\\\", etc.\n"
-"\n"
-"\n"
-"GUI components: \n"
-"--- ----------\n"
-"\n"
-"1) At the top of the gui is a info text label where information will\n"
-"   be posted, e.g. when traversing menu items text indicating how to get\n"
-"   help on the item and its current value will be displayed.\n"
-"\n"
-"2) Below the info label is the area where the menu buttons, \\\"Actions\\\",\n"
-"   \\\"Clients\\\", etc., are presented.  If a menu item has a checkbox,\n"
-"   it corresponds to a boolean on/off variable.  Otherwise it is\n"
-"   either a string variable, or an action not associated with a\n"
-"   variable (for the most part).\n"
-"\n"
-"3) Below the menu button area is a label indicating the current x11vnc\n"
-"   X display being polled and the corresponding VNC display name.  Both\n"
-"   will be \\\"(*none*)\\\" when there is no connection established.\n"
-"\n"
-"4) Below the x11 and vnc displays label is a text area there scrolling\n"
-"   information about actions being taken and commands being run is displayed.\n"
-"   To scroll click in the area and use PageUp/PageDown or the arrow keys.\n"
-"\n"
-"5) At the bottom is an entry area.  When one selects a menu item that\n"
-"   requires supplying a string value, the label will be set to the\n"
-"   parameter name and one types in the new value.  Then one presses the\n"
-"   \\\"OK\\\" button or presses \\\"Enter\\\" to set the value.  Or you can press\n"
-"   \\\"Cancel\\\" or \\\"Escape\\\" to avoid changing the variable.\n"
-"\n"
-"   Many variables are boolean toggles (for example, \\\"Permissions ->\n"
-"   viewonly\\\") or Radio button selections.  Selecting these menu items\n"
-"   will NOT activate the entry area but rather toggle the variable\n"
-"   immediately.\n"
-"\n"
-"\n"
-"CASCADES BUG: There is a bug not yet worked around for the cascade menus\n"
-"where the (?) help button gets in the way.  To get the mouse over to\n"
-"the cascade menu click and release mouse to activate the cascade, then\n"
-"you can click on its items.  Dragging with a mouse button held down will\n"
-"not work (sorry!).\n"
-"\n"
-"\n"
-"Key Bindings:\n"
-"\n"
-"	In the Text Area: Control-/ selects all of the text.\n"
-"	Anywhere: Control-d invokes \\\"Actions -> detach\\\"\n"
-"	Anywhere: Control-a invokes \\\"Actions -> attach\\\"\n"
-"	Anywhere: Control-p invokes \\\"Actions -> ping\\\"\n"
-"	Anywhere: Control-u and Control-r invoke \\\"Actions -> update-all\\\"\n"
-"\"\n"
-"\n"
-"set under_wally \"\n"
-"Misc:\n"
-"\n"
-"Since x11vnc has so many settings and to avoid further confusion,\n"
-"the libvncserver options:\n"
-"\n"
-"	-alwaysshared\n"
-"	-nevershared\n"
-"	-dontdisconnect\n"
-"\n"
-"are not available for changing in a running x11vnc (even though it\n"
-"is feasible).  These options overlap with the x11vnc options -shared\n"
-"and -forever which are hopefully enough for most usage.  They may be\n"
-"specified for x11vnc startup if desired.\n"
-"\n"
-"\"\n"
-"\n"
-"global beginner_mode\n"
-"if {$beginner_mode} {\n"
-"	set helptext(gui) \"\n"
-"tkx11vnc is a simple frontend to x11vnc.  It is currently running in\n"
-"\\\"ez\\\" or \\\"simple\\\" mode.  For many more options run it in normal\n"
-"mode by toggling \\\"Misc -> simple_gui\\\".\n"
-"\n"
-"All menu items have a (?) button one can click on to get more information\n"
-"about the option or command.\n"
-"\n"
-"GUI components: \n"
-"--- ----------\n"
-"\n"
-"1) At the top of the gui is a info text label where information will\n"
-"   be posted, e.g. when traversing menu items text indicating how to get\n"
-"   help on the item and its current value will be displayed.\n"
-"\n"
-"2) Below the info label is the area where the menu buttons, \\\"Actions\\\",\n"
-"   \\\"Clients\\\", etc., are presented.  If a menu item has a checkbox,\n"
-"   it corresponds to a boolean on/off variable.  Otherwise it is\n"
-"   either a string variable, or an action not associated with a\n"
-"   variable (for the most part).\n"
-"\n"
-"3) Below the menu button area is a label indicating the current x11vnc\n"
-"   X display being polled and the corresponding VNC display name.  Both\n"
-"   will be \\\"(*none*)\\\" when there is no connection established.\n"
-"\n"
-"4) Below the x11 and vnc displays label is a text area there scrolling\n"
-"   information about actions being taken and commands being run is displayed.\n"
-"   To scroll click in the area and use PageUp/PageDown or the arrow keys.\n"
-"\n"
-"5) At the bottom is an entry area.  When one selects a menu item that\n"
-"   requires supplying a string value, the label will be set to the\n"
-"   parameter name and one types in the new value.  Then one presses the\n"
-"   \\\"OK\\\" button or presses \\\"Enter\\\" to set the value.  Or you can press\n"
-"   \\\"Cancel\\\" or \\\"Escape\\\" to avoid changing the variable.\n"
-"\n"
-"   Many variables are boolean toggles (for example, \\\"Permissions ->\n"
-"   viewonly\\\") or Radio button selections.  Selecting these menu items\n"
-"   will NOT activate the entry area but rather toggle the variable\n"
-"   immediately.\n"
-"\n"
-"CASCADES BUG: There is a bug not yet worked around for the cascade menus\n"
-"where the (?) help button gets in the way.  To get the mouse over to\n"
-"the cascade menu click and release mouse to activate the cascade, then\n"
-"you can click on its items.  Dragging with a mouse button held down will\n"
-"not work (sorry!).\n"
-"\n"
-"\"\n"
-"}\n"
-"\n"
-"}\n"
-"\n"
-"proc center_win {w} {\n"
-"	wm withdraw $w\n"
-"	set x [expr [winfo screenwidth  $w]/2 - [winfo reqwidth  $w]/2];\n"
-"	set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2];\n"
-"	wm geometry $w +$x+$y\n"
-"	wm deiconify $w\n"
-"	update\n"
-"}\n"
-"\n"
-"proc textwidth {text} {\n"
-"	set min 0;\n"
-"	foreach line [split $text \"\\n\"] {\n"
-"		set n [string length $line]\n"
-"		if {$n > $min} {\n"
-"			set min $n\n"
-"		}\n"
-"	}\n"
-"	return $min\n"
-"}\n"
-"\n"
-"proc textheight {text} {\n"
-"	set count 0;\n"
-"	foreach line [split $text \"\\n\"] {\n"
-"		incr count\n"
-"	}\n"
-"	return $count\n"
-"}\n"
-"\n"
-"proc set_name {name} {\n"
-"	global full_win icon_mode\n"
-"	global saved_set_name\n"
-"\n"
-"	if {![info exists saved_set_name]} {\n"
-"		set saved_set_name \"tkx11vnc\"\n"
-"	}\n"
-"	if {$name == \"RESTORE\"} {\n"
-"		set name $saved_set_name\n"
-"	} else {\n"
-"		set saved_set_name $name\n"
-"	}\n"
-"	if {![info exists full_win]} {\n"
-"		return\n"
-"	}\n"
-"	set w \".\"\n"
-"	if {$icon_mode} {\n"
-"		wm title    $w \"$name\"\n"
-"		wm iconname $w \"$name\"\n"
-"		set w $full_win\n"
-"	}\n"
-"	wm title    $w \"$name\"\n"
-"	wm iconname $w \"$name\"\n"
-"}\n"
-"\n"
-"proc make_toplevel {w {title \"\"}} {\n"
-"	catch {destroy $w}\n"
-"	toplevel  $w;\n"
-"	bind $w <Escape> \"destroy $w\"\n"
-"	if {$title != \"\"} {\n"
-"		wm title    $w $title\n"
-"		wm iconname $w $title\n"
-"	}\n"
-"}\n"
-"\n"
-"proc textwin {name title text {entry \"\"}} {\n"
-"	global max_text_height max_text_width\n"
-"	global bfont ffont\n"
-"\n"
-"	set width  [textwidth $text]\n"
-"	incr width\n"
-"	if {$width > $max_text_width} {\n"
-"		set width $max_text_width\n"
-"	}\n"
-"	set height [textheight $text]\n"
-"	if {$height > $max_text_height} {\n"
-"		set height $max_text_height\n"
-"	}\n"
-"\n"
-"	set w \".text_$name\"\n"
-"	make_toplevel $w $title\n"
-"\n"
-"	frame     $w.f -bd 0;\n"
-"	pack      $w.f -fill both -expand 1\n"
-"	text      $w.f.t -width $width -height $height -setgrid 1 -bd 2 \\\n"
-"			-yscrollcommand \"$w.f.y set\" -relief ridge \\\n"
-"			-font $ffont;\n"
-"	scrollbar $w.f.y -orient v -relief sunken -command \"$w.f.t yview\";\n"
-"	button    $w.f.b -text \"Dismiss\" -command \"destroy $w\" -font $bfont \\\n"
-"			-pady 2\n"
-"\n"
-"	$w.f.t insert 1.0 $text;\n"
-"\n"
-"	bind $w <Enter> \"focus $w.f.t\"\n"
-"\n"
-"	if {$entry != \"\"} {\n"
-"		# varname+Label Name\n"
-"		set list [split $entry \"+\"]\n"
-"		set varname [lindex $list 0]\n"
-"		set labname [lindex $list 1]\n"
-"		frame $w.f.ef -bd 1 -relief groove\n"
-"		label $w.f.ef.l -text \"$labname\" -anchor w -font $bfont\n"
-"		entry $w.f.ef.e -relief sunken -font $ffont \\\n"
-"			-textvariable $varname\n"
-"		button $w.f.ef.b -text \"OK\" -font $bfont \\\n"
-"			-command \"set ${varname}_ok 1; destroy $w\" \n"
-"		bind $w.f.ef.e <KeyPress-Return> \"set ${varname}_ok 1; destroy $w\"\n"
-"		\n"
-"		pack $w.f.ef.l -side left\n"
-"		pack $w.f.ef.e -side left -fill x -expand 1\n"
-"		pack $w.f.ef.b -side right\n"
-"	}\n"
-"\n"
-"	wm withdraw $w\n"
-"	pack $w.f.b -side bottom -fill x \n"
-"	if {$entry != \"\"} {\n"
-"		pack $w.f.ef -side bottom -fill x \n"
-"		bind $w <Enter> \"focus $w.f.ef.e\"\n"
-"		$w.f.ef.e icursor end\n"
-"	} else {\n"
-"		bind $w <Enter> \"focus $w.f.t\"\n"
-"	}\n"
-"	pack $w.f.y -side right -fill y;\n"
-"	pack $w.f.t -side top -fill both -expand 1;\n"
-"	update\n"
-"\n"
-"	center_win $w\n"
-"\n"
-"	return $w\n"
-"}\n"
-"\n"
-"proc active_when_connected {item} {\n"
-"	global helpremote helptext\n"
-"	global icon_mode\n"
-"\n"
-"	if {$icon_mode} {\n"
-"		if {$item == \"passwd\"} {\n"
-"			return 1\n"
-"		}\n"
-"		if {$item == \"viewpasswd\"} {\n"
-"			return 1\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {[opt_match G $item]} {\n"
-"		return 1\n"
-"	} elseif {[opt_match R $item]} {\n"
-"		return 1\n"
-"	} elseif {[opt_match S $item]} {\n"
-"		return 0\n"
-"	} elseif {[is_action $item]} {\n"
-"		if {[opt_match R $item]} {\n"
-"			return 1\n"
-"		} else {\n"
-"			return 0\n"
-"		}\n"
-"	} elseif {[info exists helpremote($item)]} {\n"
-"		return 1\n"
-"	} else {\n"
-"		return 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc active_when_starting {item} {\n"
-"	global helpremote helptext beginner_mode\n"
-"\n"
-"	if {$beginner_mode} {\n"
-"		if {[opt_match G $item]} {\n"
-"			return 1\n"
-"		}\n"
-"		if {$item == \"display\"} {\n"
-"			return 1\n"
-"		}\n"
-"		if {$item == \"attach\"} {\n"
-"			return 1\n"
-"		}\n"
-"		if {$item == \"debug_gui\"} {\n"
-"			return 1\n"
-"		}\n"
-"		return 0\n"
-"	}\n"
-"\n"
-"	if {[opt_match G $item]} {\n"
-"		return 1\n"
-"	} elseif {[opt_match S $item]} {\n"
-"		return 1\n"
-"	} elseif {[opt_match R $item]} {\n"
-"		return 0\n"
-"	} elseif {[is_action $item]} {\n"
-"		if {[opt_match S $item]} {\n"
-"			return 1\n"
-"		} else {\n"
-"			return 0\n"
-"		}\n"
-"	} elseif {[info exists helptext($item)]} {\n"
-"		return 1\n"
-"	} else {\n"
-"		return 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc help_win {item} {\n"
-"	global helptext helpremote menu_var\n"
-"	global query_ans query_aro\n"
-"	global beginner_mode\n"
-"\n"
-"	set ok 0\n"
-"	set text \"Help on $item:\\n\\n\"\n"
-"\n"
-"	if {$item == \"NewClient\"} {\n"
-"		;\n"
-"	} elseif {[is_gui_internal $item]} {\n"
-"		if {$item != \"gui\" && $item != \"all\" && $item != \"Misc-Tuning:\" \\\n"
-"		    && $item != \"Properties\" && $item != \"Tray\"} {\n"
-"			append text \"    + Is a gui internal Action (cannot be set).\\n\";\n"
-"		}\n"
-"	} elseif {[is_action $item]} {\n"
-"		append text \"    + Is a remote control Action (cannot be set).\\n\";\n"
-"	} elseif {[active_when_connected $item]} {\n"
-"		append text \"    + Can be changed in a running x11vnc.\\n\";\n"
-"	} else {\n"
-"		append text \"    - Cannot be changed in a running x11vnc.\\n\";\n"
-"	}\n"
-"	if {$item == \"NewClient\"} {\n"
-"		;\n"
-"	} elseif {[is_gui_internal $item]} {\n"
-"		;\n"
-"	} elseif {[active_when_starting $item]} {\n"
-"		append text \"    + Can be set at x11vnc startup.\\n\";\n"
-"	} else {\n"
-"		if {! $beginner_mode} {\n"
-"			append text \"    - Cannot be set at x11vnc startup.\\n\";\n"
-"		}\n"
-"	}\n"
-"	append text \"\\n\"\n"
-"\n"
-"	if {[info exists helptext($item)]} {\n"
-"		append text \"\\n\"\n"
-"		if {[is_gui_internal $item]} {\n"
-"			append text \"==== x11vnc help: ====\\n\";\n"
-"		} else {\n"
-"			append text \"==== x11vnc startup option help: ====\\n\";\n"
-"		}\n"
-"		append text \"\\n\"\n"
-"		append text $helptext($item)\n"
-"		append text \"\\n\"\n"
-"		set ok 1\n"
-"	}\n"
-"\n"
-"	if {[info exists helpremote($item)]} {\n"
-"		append text \"\\n\"\n"
-"		append text \"==== x11vnc remote control help: ====\\n\";\n"
-"		append text \"\\n\"\n"
-"		append text $helpremote($item)\n"
-"		set ok 1\n"
-"	}\n"
-"\n"
-"	if {![is_action $item] && [info exists menu_var($item)]} {\n"
-"		global unset_str\n"
-"		append text \"\\n\\n\"\n"
-"		append text \"==== current $item value: ====\\n\";\n"
-"		append text \"\\n\"\n"
-"\n"
-"		if {$item == \"passwd\" || $item == \"viewpasswd\"} {\n"
-"			;\n"
-"		} elseif {$menu_var($item) == \"\"} {\n"
-"			append text \"$unset_str\\n\"\n"
-"		} else {\n"
-"			append text \"$menu_var($item)\\n\"\n"
-"		}\n"
-"		if {$item == \"http\" || $item == \"httpdir\" || $item == \"httpport\"} {\n"
-"			global vnc_url;\n"
-"			append text \"\\nURL: $vnc_url\\n\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {$item == \"start\"} {\n"
-"		set str [get_start_x11vnc_txt]\n"
-"		append_text \"$str\\n\"\n"
-"#		append text \"\\nPossible \\$HOME/.x11vncrc settings for this command:\\n\\n\"\n"
-"#		set rctxt [get_start_x11vnc_cmd 1]\n"
-"#		append text \"$rctxt\\n\"\n"
-"	}\n"
-"\n"
-"	regsub -all { } $item \" \" name\n"
-"\n"
-"	if {$ok} {\n"
-"		textwin $name \"x11vnc help: $item\" \"$text\";\n"
-"	}\n"
-"	return $ok\n"
-"}\n"
-"\n"
-"proc parse_help {} {\n"
-"	global env x11vnc_prog;\n"
-"	global helpall helptext;\n"
-"\n"
-"	set helppipe [open \"| $x11vnc_prog -help\" \"r\"];\n"
-"	if {$helppipe == \"\"} {\n"
-"		puts stderr \"failed to run $x11vnc_prog -help\";\n"
-"		exit 1;\n"
-"	}\n"
-"\n"
-"	set sawopts 0;\n"
-"	set curropt \"\";\n"
-"	while {[gets $helppipe line] > -1} {\n"
-"		append helpall \"$line\\n\"	\n"
-"\n"
-"		# XXX\n"
-"		if {[regexp {^Options:} $line]} {\n"
-"			set sawopts 1;\n"
-"			continue;\n"
-"		}\n"
-"		# XXX\n"
-"		if {[regexp {^These options} $line]} {\n"
-"			continue;\n"
-"		}\n"
-"		# tweak aliases:\n"
-"		regsub {^-zeroconf} $line \"-zero_conf\" line\n"
-"		regsub {^-avahi   } $line \"-zeroconf\" line\n"
-"\n"
-"		if {! $sawopts} {\n"
-"			continue;\n"
-"		}\n"
-"		if {[regexp {^-([0-9A-z_][0-9A-z_]*)} $line match name]} {\n"
-"			set allnames($name) 1;\n"
-"			if {\"$curropt\" != \"no$name\" && \"no$curropt\" != \"$name\"} {\n"
-"				set curropt $name;\n"
-"				set helptext($curropt) \"$line\\n\";\n"
-"			} else {\n"
-"				append helptext($curropt) \"$line\\n\";\n"
-"			}\n"
-"		} elseif {$curropt != \"\"} {\n"
-"			append helptext($curropt) \"$line\\n\";\n"
-"		}\n"
-"	}\n"
-"	foreach name [array names allnames] {\n"
-"		if {[regexp {^no} $name]} {\n"
-"			regsub {^no} $name \"\" pair\n"
-"		} else {\n"
-"			set pair \"no$name\"\n"
-"		}\n"
-"		if {[info exists helptext($name)]} {\n"
-"			if ![info exists helptext($pair)] {\n"
-"				set helptext($pair) $helptext($name);\n"
-"			}\n"
-"		} elseif {[info exists helptext($pair)]} {\n"
-"			if ![info exists helptext($name)] {\n"
-"				set helptext($name) $helptext($pair);\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"\n"
-"	set_internal_help\n"
-"}\n"
-"\n"
-"proc tweak_both {new old} {\n"
-"	tweak_help $new $old\n"
-"	tweak_remote_help $new $old\n"
-"}\n"
-"\n"
-"proc tweak_remote_help {new old} {\n"
-"	global helpremote\n"
-"	if ![info exists helpremote($new)] {\n"
-"		if {[info exists helpremote($old)]} {\n"
-"			set helpremote($new) $helpremote($old)\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc tweak_help {new old} {\n"
-"	global helptext\n"
-"	if ![info exists helptext($new)] {\n"
-"		if {[info exists helptext($old)]} {\n"
-"			set helptext($new) $helptext($old)\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc parse_remote_help {} {\n"
-"	global helpremote helptext help_indent remote_name;\n"
-"\n"
-"	set sawopts 0;\n"
-"	set curropt \"\";\n"
-"	set possopts \"\";\n"
-"	set offset [expr $help_indent - 1];\n"
-"	foreach line [split $helptext(remote) \"\\n\"] {\n"
-"		\n"
-"		set line [string range $line $offset end];\n"
-"\n"
-"		# XXX\n"
-"		if {[regexp {^The following -remote/-R commands} $line]} {\n"
-"			set sawopts 1;\n"
-"			continue;\n"
-"		}\n"
-"		# XXX\n"
-"		if {[regexp {^The vncconnect.*command} $line]} {\n"
-"			set sawopts 0;\n"
-"		}\n"
-"\n"
-"		if {! $sawopts} {\n"
-"			continue;\n"
-"		}\n"
-"		if {[regexp {^([0-9A-z_][0-9A-z_:]*)} $line match name]} {\n"
-"			regsub {:.*$} $name \"\" popt\n"
-"			lappend possopts $popt\n"
-"			if {\"$curropt\" != \"no$name\" && \"no$curropt\" != \"$name\"} {\n"
-"				set curropt $name;\n"
-"				regsub {:.*$} $curropt \"\" curropt\n"
-"				set remote_name($curropt) $name\n"
-"				set helpremote($curropt) \"$line\\n\";\n"
-"			} else {\n"
-"				append helpremote($curropt) \"$line\\n\";\n"
-"			}\n"
-"		} elseif {$curropt != \"\"} {\n"
-"			append helpremote($curropt) \"$line\\n\";\n"
-"		}\n"
-"	}\n"
-"\n"
-"	foreach popt $possopts {\n"
-"		if {[info exists helpremote($popt)]} {\n"
-"			continue\n"
-"		}\n"
-"		if {[regexp {^no} $popt]} {\n"
-"			regsub {^no} $popt \"\" try\n"
-"		} else {\n"
-"			set try \"no$popt\"\n"
-"		}\n"
-"		if {[info exists helpremote($try)]} {\n"
-"			set helpremote($popt) $helpremote($try)\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc parse_query_help {} {\n"
-"	global query_ans query_aro query_ans_list query_aro_list helptext;\n"
-"\n"
-"	set sawans 0;\n"
-"	set sawaro 0;\n"
-"	set ans_str \"\"\n"
-"	set aro_str \"\"\n"
-"\n"
-"	foreach line [split $helptext(query) \"\\n\"] {\n"
-"\n"
-"		if {! $sawans && [regexp {^ *ans=} $line]} {\n"
-"			set sawans 1\n"
-"		}\n"
-"		if {! $sawans} {\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		if {[regexp {^ *aro=} $line]} {\n"
-"			set sawaro 1\n"
-"		}\n"
-"		if {$sawaro && [regexp {^[ 	]*$} $line]} {\n"
-"			set sawans 0\n"
-"			break\n"
-"		}\n"
-"\n"
-"		regsub {ans=} $line \"\" line\n"
-"		regsub {aro=} $line \"\" line\n"
-"		set line [string trim $line]\n"
-"\n"
-"		if {$sawaro} {\n"
-"			set aro_str \"$aro_str $line\"\n"
-"		} else {\n"
-"			set ans_str \"$ans_str $line\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	regsub -all {  *} $ans_str \" \" ans_str\n"
-"	regsub -all {  *} $aro_str \" \" aro_str\n"
-"\n"
-"	set ans_str [string trim $ans_str]\n"
-"	set aro_str [string trim $aro_str]\n"
-"	set query_ans_list [split $ans_str]\n"
-"	set query_aro_list [split $aro_str]\n"
-"\n"
-"	foreach item $query_ans_list {\n"
-"		if {[regexp {^[ 	]*$} $item]} {\n"
-"			continue\n"
-"		}\n"
-"		set query_ans($item) 1\n"
-"	}\n"
-"	foreach item $query_aro_list {\n"
-"		if {[regexp {^[ 	]*$} $item]} {\n"
-"			continue\n"
-"		}\n"
-"		set query_aro($item) 1\n"
-"	}\n"
-"}\n"
-"\n"
-"proc in_debug_mode {} {\n"
-"	global menu_var\n"
-"	if {![info exists menu_var(debug_gui)]} {\n"
-"		return 0\n"
-"	}\n"
-"	return $menu_var(debug_gui)\n"
-"}\n"
-"\n"
-"# Menubar utilities:\n"
-"proc menus_state {state} {\n"
-"	global menu_b\n"
-"\n"
-"	foreach case [array names menu_b] {\n"
-"		set menu_button $menu_b($case)\n"
-"		if {![winfo exists $menu_button]} {\n"
-"			continue\n"
-"		}\n"
-"		$menu_button configure -state $state\n"
-"	}\n"
-"}\n"
-"\n"
-"proc menus_enable {} {\n"
-"	global menus_disabled\n"
-"\n"
-"	menus_state \"normal\"\n"
-"	set menus_disabled 0\n"
-"}\n"
-"\n"
-"proc menus_disable {} {\n"
-"	global menus_disabled\n"
-"\n"
-"	set menus_disabled 1\n"
-"	menus_state \"disabled\"\n"
-"}\n"
-"\n"
-"# Entry box utilities:\n"
-"proc entry_state {x state} {\n"
-"	global entry_box entry_label entry_ok entry_help entry_skip entry_browse\n"
-"	global old_labels\n"
-"	if {$x == \"all\"} {\n"
-"		if {!$old_labels} {\n"
-"			$entry_label configure -state $state\n"
-"		}\n"
-"		$entry_box    configure -state $state\n"
-"		$entry_ok     configure -state $state\n"
-"		$entry_skip   configure -state $state\n"
-"		$entry_help   configure -state $state\n"
-"		$entry_browse configure -state $state\n"
-"	} elseif {$x == \"label\"} {\n"
-"		if {!$old_labels} {\n"
-"			$entry_label configure -state $state\n"
-"		}\n"
-"	} elseif {$x == \"box\"} {\n"
-"		$entry_box    configure -state $state\n"
-"	} elseif {$x == \"ok\"} {\n"
-"		$entry_ok     configure -state $state\n"
-"	} elseif {$x == \"skip\"} {\n"
-"		$entry_skip   configure -state $state\n"
-"	} elseif {$x == \"help\"} {\n"
-"		$entry_help   configure -state $state\n"
-"	} elseif {$x == \"browse\"} {\n"
-"		$entry_browse configure -state $state\n"
-"	}\n"
-"}\n"
-"\n"
-"proc entry_enable {{x \"all\"}} {\n"
-"	entry_state $x normal\n"
-"}\n"
-"\n"
-"proc entry_disable {{x \"all\"}} {\n"
-"	entry_state $x disabled\n"
-"}\n"
-"\n"
-"proc entry_browse_button {{show 1}} {\n"
-"	global entry_browse\n"
-"	if {$show} {\n"
-"		pack $entry_browse -side left\n"
-"	}  else {\n"
-"		pack forget $entry_browse\n"
-"	}\n"
-"}\n"
-"proc entry_focus {} {\n"
-"	global entry_box\n"
-"	focus $entry_box\n"
-"}\n"
-"proc entry_select {} {\n"
-"	global entry_box\n"
-"	$entry_box selection range 0 end\n"
-"}\n"
-"proc entry_get {} {\n"
-"	global entry_box\n"
-"	return [$entry_box get]\n"
-"}\n"
-"proc entry_insert {str} {\n"
-"	global entry_box\n"
-"	entry_delete\n"
-"	$entry_box insert end $str\n"
-"	$entry_box icursor end\n"
-"}\n"
-"proc entry_delete {} {\n"
-"	global entry_box\n"
-"	$entry_box delete 0 end\n"
-"}\n"
-"\n"
-"\n"
-"# Utilities for remote control and updating vars.\n"
-"\n"
-"proc push_new_value {item name new {query 1}} {\n"
-"	global menu_var always_update remote_output query_output\n"
-"	global query_result_list\n"
-"\n"
-"	set debug [in_debug_mode]\n"
-"\n"
-"	set getout 0\n"
-"	set print_getout 0;\n"
-"\n"
-"	set do_query_all 0\n"
-"\n"
-"	set newnew \"\"\n"
-"	if {$item == \"disconnect\"} {\n"
-"		set newnew \"N/A\"\n"
-"		set do_query_all 1\n"
-"	} elseif {$always_update} {\n"
-"		set do_query_all 1\n"
-"	}\n"
-"\n"
-"	if {$item == \"remote-cmd\"} {\n"
-"		# kludge for arbitrary remote command:\n"
-"		if {[regexp {^Q:} $new]} {\n"
-"			# extra kludge for Q:var to mean -Q var\n"
-"			regsub {^Q:} $new \"\" new\n"
-"			set qonly 1\n"
-"		} else {\n"
-"			set qonly 0\n"
-"		}\n"
-"		# need to extract item from new:\n"
-"		set qtmp $new\n"
-"		regsub {:.*$} $qtmp \"\" qtmp\n"
-"		if {$qonly} {\n"
-"			set rargs [list \"-Q\" \"$qtmp\"]\n"
-"			set print_getout 1\n"
-"			set qargs \"\"\n"
-"		} else {\n"
-"			set rargs [list \"-R\" \"$new\"]\n"
-"			set qargs \"\"\n"
-"		}\n"
-"		set getout 1\n"
-"\n"
-"	} elseif {[value_is_string $item]} {\n"
-"		# string var:\n"
-"		set rargs [list \"-R\" \"$name:$new\"]\n"
-"		set qargs [list \"-Q\" \"$name\"]\n"
-"	} else {\n"
-"		# boolean var:\n"
-"		set rargs [list \"-R\" \"$name\"]\n"
-"		set qargs [list \"-Q\" \"$name\"]\n"
-"	}\n"
-"\n"
-"	if {! $query && ! $always_update} {\n"
-"		set getout 1\n"
-"	} elseif {$item == \"noremote\"} {\n"
-"		set getout 1\n"
-"	} elseif {[is_action $item] && ![opt_match Q $item] && $rargs != \"\"} {\n"
-"		set getout 1\n"
-"	} elseif {[regexp {^(sid|id)$} $item] && ![regexp {^0x} $new]} {\n"
-"		set getout 1\n"
-"	}\n"
-"\n"
-"	set remote_output \"\"\n"
-"	set query_output \"\"\n"
-"\n"
-"	if {!$debug} {\n"
-"		if [regexp {passwd} $rargs] {\n"
-"			append_text \"x11vnc ...\"\n"
-"		} else {\n"
-"			append_text \"x11vnc $rargs ...\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {$getout} {\n"
-"		set remote_output [run_remote_cmd $rargs]\n"
-"		if {$print_getout} {\n"
-"			append_text \"\\t$remote_output\"\n"
-"		}\n"
-"		append_text \"\\n\"\n"
-"		return\n"
-"	}\n"
-"\n"
-"	if {$do_query_all} {\n"
-"		set all [all_query_vars]\n"
-"		set qargs [list \"-Q\" $all]\n"
-"\n"
-"		global last_query_all_time\n"
-"		set last_query_all_time [clock seconds]\n"
-"	}\n"
-"\n"
-"	set rqargs [concat $rargs $qargs]\n"
-"\n"
-"	set query [run_remote_cmd $rqargs]\n"
-"	set query_output $query\n"
-"\n"
-"	set query_result_list \"\"\n"
-"\n"
-"	if {$newnew != \"\"} {\n"
-"		set new $newnew\n"
-"	}\n"
-"\n"
-"	if {![see_if_ok $query $item \"$name:$new\"]} {\n"
-"		# failed\n"
-"		if  {[regexp {^a..=} $query]} {\n"
-"			# but some result came back\n"
-"			# synchronize everything with a 2nd call.\n"
-"			set query_output [query_all 1]\n"
-"		} else {\n"
-"			# server may be dead\n"
-"			if {$item != \"ping\" && $item != \"attach\"} {\n"
-"				try_connect\n"
-"			}\n"
-"		}\n"
-"	} else {\n"
-"		# succeeded\n"
-"		# synchronize this variable (or variables)\n"
-"		# for a speedup used the list parsed by see_if_ok.\n"
-"		update_menu_vars \"USE_LIST\"\n"
-"\n"
-"		if {$do_query_all} {\n"
-"			global all_settings\n"
-"			set all_settings $query\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc set_kmbc_str {} {\n"
-"	global vl_bk vl_bm vl_bb vl_bc vl_bf vr_bk vr_bm vr_bb vr_bc vr_bf\n"
-"\n"
-"	set str \"\"\n"
-"	if {$vl_bk} {\n"
-"		append str \"K\"\n"
-"	}\n"
-"	if {$vl_bm} {\n"
-"		append str \"M\"\n"
-"	}\n"
-"	if {$vl_bb} {\n"
-"		append str \"B\"\n"
-"	}\n"
-"	if {$vl_bc} {\n"
-"		append str \"C\"\n"
-"	}\n"
-"	if {$vl_bf} {\n"
-"		append str \"F\"\n"
-"	}\n"
-"	if {$vr_bk || $vr_bm || $vr_bb || $vr_bc || $vr_bf} {\n"
-"		append str \",\"\n"
-"	}\n"
-"	if {$vr_bk} {\n"
-"		append str \"K\"\n"
-"	}\n"
-"	if {$vr_bm} {\n"
-"		append str \"M\"\n"
-"	}\n"
-"	if {$vr_bb} {\n"
-"		append str \"B\"\n"
-"	}\n"
-"	if {$vr_bc} {\n"
-"		append str \"C\"\n"
-"	}\n"
-"	if {$vr_bf} {\n"
-"		append str \"F\"\n"
-"	}\n"
-"	entry_insert $str\n"
-"}\n"
-"\n"
-"proc insert_input_window {} {\n"
-"	global text_area cleanup_window\n"
-"	global ffont menu_var\n"
-"	global vl_bk vl_bm vl_bb vl_bc vl_bf vr_bk vr_bm vr_bb vr_bc vr_bf\n"
-"\n"
-"	append_text \"\\nUse these checkboxes to set the input permissions, \"\n"
-"	append_text \"or type in the \\\"KMBCF...\\\"\\n\"\n"
-"	append_text \"-input string manually.  Then press \\\"OK\\\" or \\\"Cancel\\\".\\n\"\n"
-"	append_text \"(note: an empty setting means use the default behavior, \"\n"
-"	append_text \"see viewonly)\\n\\n\"\n"
-"	set w \"$text_area.wk_f\"\n"
-"	catch {destroy $w}\n"
-"	frame $w -bd 1 -relief ridge -cursor {top_left_arrow}\n"
-"	set fl $w.fl\n"
-"	frame $fl\n"
-"	set fr $w.fr\n"
-"	frame $fr\n"
-"	label $fl.l -font $ffont -text \"Normal clients:   \"\n"
-"	checkbutton $fl.bk -pady 1 -font $ffont -anchor w -variable vl_bk \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Keystrokes\" \n"
-"	checkbutton $fl.bm -font $ffont -anchor w -variable vl_bm \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Mouse-Motion\" \n"
-"	checkbutton $fl.bb -font $ffont -anchor w -variable vl_bb \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Button-Click\"\n"
-"	checkbutton $fl.bc -font $ffont -anchor w -variable vl_bc \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Clipboard-Input\"\n"
-"	checkbutton $fl.bf -font $ffont -anchor w -variable vl_bf \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Files\"\n"
-"	label $fr.l -pady 1 -font $ffont -text \"View-Only clients:\"\n"
-"	checkbutton $fr.bk -font $ffont -anchor w -variable vr_bk \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Keystrokes\" \n"
-"	checkbutton $fr.bm -font $ffont -anchor w -variable vr_bm \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Mouse-Motion\" \n"
-"	checkbutton $fr.bb -font $ffont -anchor w -variable vr_bb \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Button-Click\"\n"
-"	checkbutton $fr.bc -font $ffont -anchor w -variable vr_bc \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Clipboard-Input\"\n"
-"	checkbutton $fr.bf -font $ffont -anchor w -variable vr_bf \\\n"
-"		-pady 1 -command set_kmbc_str -text \"Files\"\n"
-"\n"
-"	if {[info exists menu_var(input)]} {\n"
-"		set input_str $menu_var(input)\n"
-"	} else {\n"
-"		set input_str \"\"\n"
-"	}\n"
-"\n"
-"	if {[regexp {(.*),(.*)} $input_str match normal viewonly]} {\n"
-"		;\n"
-"	} else {\n"
-"		set normal $input_str\n"
-"		set viewonly \"\"\n"
-"	}\n"
-"	set vl_bk 0\n"
-"	set vl_bm 0\n"
-"	set vl_bb 0\n"
-"	set vl_bc 0\n"
-"	set vl_bf 0\n"
-"\n"
-"	set vr_bk 0\n"
-"	set vr_bm 0\n"
-"	set vr_bb 0\n"
-"	set vr_bc 0\n"
-"	set vr_bf 0\n"
-"\n"
-"	if {[regexp -nocase {K} $normal]} {\n"
-"		set vl_bk 1\n"
-"	}\n"
-"	if {[regexp -nocase {M} $normal]} {\n"
-"		set vl_bm 1\n"
-"	}\n"
-"	if {[regexp -nocase {B} $normal]} {\n"
-"		set vl_bb 1\n"
-"	}\n"
-"	if {[regexp -nocase {C} $normal]} {\n"
-"		set vl_bc 1\n"
-"	}\n"
-"	if {[regexp -nocase {F} $normal]} {\n"
-"		set vl_bf 1\n"
-"	}\n"
-"	if {[regexp -nocase {K} $viewonly]} {\n"
-"		set vr_bk 1\n"
-"	}\n"
-"	if {[regexp -nocase {M} $viewonly]} {\n"
-"		set vr_bm 1\n"
-"	}\n"
-"	if {[regexp -nocase {B} $viewonly]} {\n"
-"		set vr_bb 1\n"
-"	}\n"
-"	if {[regexp -nocase {C} $viewonly]} {\n"
-"		set vr_bc 1\n"
-"	}\n"
-"	if {[regexp -nocase {F} $viewonly]} {\n"
-"		set vr_bf 1\n"
-"	}\n"
-"\n"
-"	pack $fl.l $fl.bk $fl.bm $fl.bb $fl.bc $fl.bf -side top -fill x\n"
-"	pack $fr.l $fr.bk $fr.bm $fr.bb $fr.bc $fr.bf -side top -fill x\n"
-"	pack $fl $fr -side left\n"
-"	update\n"
-"	update idletasks\n"
-"	$text_area window create end -window $w\n"
-"	$text_area see end\n"
-"	$text_area insert end \"\\n\"\n"
-"#	$text_area insert end \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\"\n"
-"\n"
-"	set cleanup_window $w\n"
-"}\n"
-"\n"
-"proc set_ca_str {w} {\n"
-"	global ca_bk ca_bm ca_bb ca_bc ca_bf ca_di\n"
-"\n"
-"	if {$ca_di} {\n"
-"		entry_insert \"disconnect\"\n"
-"		$w.bk configure -state disabled\n"
-"		$w.bm configure -state disabled\n"
-"		$w.bb configure -state disabled\n"
-"		$w.bc configure -state disabled\n"
-"		$w.bf configure -state disabled\n"
-"		return\n"
-"	}\n"
-"\n"
-"	$w.bk configure -state normal\n"
-"	$w.bm configure -state normal\n"
-"	$w.bb configure -state normal\n"
-"	$w.bc configure -state normal\n"
-"	$w.bf configure -state normal\n"
-"\n"
-"	set str \"\"\n"
-"	if {$ca_bk} {\n"
-"		append str \"K\"\n"
-"	}\n"
-"	if {$ca_bm} {\n"
-"		append str \"M\"\n"
-"	}\n"
-"	if {$ca_bb} {\n"
-"		append str \"B\"\n"
-"	}\n"
-"	if {$ca_bc} {\n"
-"		append str \"C\"\n"
-"	}\n"
-"	if {$ca_bf} {\n"
-"		append str \"F\"\n"
-"	}\n"
-"	entry_insert $str\n"
-"}\n"
-"\n"
-"proc insert_client_action_window {input} {\n"
-"	global text_area cleanup_window\n"
-"	global ffont menu_var\n"
-"	global ca_bk ca_bm ca_bb ca_bc ca_bf ca_di\n"
-"\n"
-"	append_text \"\\nUse these checkboxes to set the input permissions \"\n"
-"	append_text \"for this client\\n-OR- whether to disconnect it instead.  \"\n"
-"	append_text \"Then press \\\"OK\\\" or \\\"Cancel\\\".\\n\\n\"\n"
-"	set w \"$text_area.ca_f\"\n"
-"	catch {destroy $w}\n"
-"	frame $w -bd 1 -relief ridge -cursor {top_left_arrow}\n"
-"	checkbutton $w.di -pady 1 -font $ffont -anchor w -variable ca_di \\\n"
-"		-pady 1 -command \"set_ca_str $w\" -text \"Disconnect  \" \n"
-"	checkbutton $w.bk -font $ffont -anchor w -variable ca_bk \\\n"
-"		-pady 1 -command \"set_ca_str $w\" -text \"Keystrokes\" \n"
-"	checkbutton $w.bm -font $ffont -anchor w -variable ca_bm \\\n"
-"		-pady 1 -command \"set_ca_str $w\" -text \"Mouse-Motion\" \n"
-"	checkbutton $w.bb -font $ffont -anchor w -variable ca_bb \\\n"
-"		-pady 1 -command \"set_ca_str $w\" -text \"Button-Click\"\n"
-"	checkbutton $w.bc -font $ffont -anchor w -variable ca_bc \\\n"
-"		-pady 1 -command \"set_ca_str $w\" -text \"Clipboard\"\n"
-"	checkbutton $w.bf -font $ffont -anchor w -variable ca_bf \\\n"
-"		-pady 1 -command \"set_ca_str $w\" -text \"Files\"\n"
-"\n"
-"	set ca_di 0\n"
-"	set ca_bk 0\n"
-"	set ca_bm 0\n"
-"	set ca_bb 0\n"
-"	set ca_bf 0\n"
-"	set ca_bc 0\n"
-"\n"
-"	if {[regexp -nocase {K} $input]} {\n"
-"		set ca_bk 1\n"
-"	}\n"
-"	if {[regexp -nocase {M} $input]} {\n"
-"		set ca_bm 1\n"
-"	}\n"
-"	if {[regexp -nocase {B} $input]} {\n"
-"		set ca_bb 1\n"
-"	}\n"
-"	if {[regexp -nocase {C} $input]} {\n"
-"		set ca_bc 1\n"
-"	}\n"
-"	if {[regexp -nocase {F} $input]} {\n"
-"		set ca_bf 1\n"
-"	}\n"
-"\n"
-"	pack $w.di $w.bk $w.bm $w.bb $w.bc $w.bf -side left\n"
-"	update\n"
-"	update idletasks\n"
-"	$text_area window create end -window $w\n"
-"	$text_area see end\n"
-"	$text_area insert end \"\\n\"\n"
-"\n"
-"	set cleanup_window $w\n"
-"}\n"
-"\n"
-"proc cleanup_text_window {} {\n"
-"	global cleanup_window\n"
-"	if {[info exists cleanup_window]} {\n"
-"		catch {destroy $cleanup_window}\n"
-"	}\n"
-"}\n"
-"\n"
-"# For updating a string variable.   Also used for simple OK/Cancel dialogs\n"
-"# with entry = 0.\n"
-"proc entry_dialog {item {entry 1}} {\n"
-"	global menu_var entry_str entry_set entry_dialog_item\n"
-"	global unset_str connected_to_x11vnc entry_box\n"
-"\n"
-"	set entry_str \"Set $item\"\n"
-"	set entry_set 0\n"
-"	set entry_dialog_item $item\n"
-"\n"
-"	entry_enable\n"
-"	menus_disable\n"
-"\n"
-"	if {$item == \"passwd\" || $item == \"viewpasswd\"} {\n"
-"		$entry_box configure -show \"*\"\n"
-"	}\n"
-"\n"
-"	if {$entry} {\n"
-"		entry_insert \"\"\n"
-"		if {[info exists menu_var($item)] &&\n"
-"		    $menu_var($item) != $unset_str} {\n"
-"			entry_insert $menu_var($item)\n"
-"			entry_select\n"
-"		}\n"
-"\n"
-"		if {[is_browse $item]} {\n"
-"			entry_browse_button\n"
-"		}\n"
-"		set_info \"Set parameter in entry box, \"\n"
-"		entry_focus\n"
-"	} else {\n"
-"		entry_disable box\n"
-"	}\n"
-"\n"
-"	set clean_text_window 0;\n"
-"\n"
-"	if {$item == \"input\"} {\n"
-"		insert_input_window\n"
-"		set clean_text_window 1\n"
-"	}\n"
-"\n"
-"	update\n"
-"\n"
-"	# wait for user reply:\n"
-"	vwait entry_set\n"
-"\n"
-"	set rc $entry_set\n"
-"	set entry_set 0\n"
-"\n"
-"	set value [entry_get]\n"
-"	update\n"
-"\n"
-"	entry_browse_button 0\n"
-"	set entry_str \"Set... :\"\n"
-"\n"
-"	entry_delete\n"
-"	entry_disable\n"
-"	menus_enable\n"
-"\n"
-"	if {$clean_text_window} {\n"
-"		cleanup_text_window;\n"
-"	}\n"
-"\n"
-"	update\n"
-"\n"
-"	if {! $entry} {\n"
-"		;\n"
-"	} elseif {$rc} {\n"
-"		set menu_var($item) $value\n"
-"	} else {\n"
-"		if {[in_debug_mode]} {\n"
-"			append_text \"skipped setting $item\\n\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	$entry_box configure -show \"\"\n"
-"\n"
-"	return $rc\n"
-"}\n"
-"\n"
-"proc warning_dialog {msg {item \"gui\"} } {\n"
-"	append_text $msg\n"
-"	# just reuse the entry widgets for a yes/no dialog\n"
-"	return [entry_dialog $item 0]\n"
-"}\n"
-"\n"
-"# For updating a boolean toggle:\n"
-"proc check_var {item} {\n"
-"	global menu_var\n"
-"\n"
-"	set inval $menu_var($item);\n"
-"\n"
-"	if {$item == \"debug_gui\"} {\n"
-"		return \"\";\n"
-"	}\n"
-"\n"
-"	set rname $item\n"
-"	if {! $inval} {\n"
-"		if {[regexp {^no} $item]} {\n"
-"			regsub {^no} $rname \"\" rname\n"
-"		} else {\n"
-"			set rname \"no$rname\"\n"
-"		}\n"
-"	}\n"
-"	return $rname\n"
-"}\n"
-"\n"
-"proc see_if_ok {query item expected} {\n"
-"	global query_result_list\n"
-"\n"
-"	set ok 0\n"
-"	set found \"\"\n"
-"\n"
-"	set query_result_list [split_query $query]\n"
-"\n"
-"	foreach q $query_result_list {\n"
-"		# XXX following will crash if $item is not a good regexp\n"
-"		# need to protect it \\Q$item\\E style...\n"
-"#		if {[regexp \"^$item:\" $q]} {\n"
-"#			set found $q\n"
-"#		}\n"
-"		if {[string first \"$item:\" $q] == 0} {\n"
-"			set found $q\n"
-"		}\n"
-"		if {$q == $expected} {\n"
-"			set ok 1\n"
-"			if {$found != \"\"} {\n"
-"				break;\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	if {$found == \"\"} {\n"
-"		set msg $query\n"
-"		regsub {^a..=} $msg {} msg\n"
-"		if {[string length $msg] > 60} {\n"
-"			set msg [string range $msg 0 60]\n"
-"		}\n"
-"	} else {\n"
-"		set msg $found\n"
-"	}\n"
-"	if {!$ok && $found != \"\"} {\n"
-"		# check for floating point match:\n"
-"		set v1 \"\"\n"
-"		set v2 \"\"\n"
-"		regexp {:([0-9.][0-9.]*)$} $found m0 v1\n"
-"		regexp {:([0-9.][0-9.]*)$} $expected m0 v2\n"
-"		if {$v1 != \"\" && $v2 != \"\"} {\n"
-"			set diff \"\"\n"
-"			catch {set diff [expr \"$v1 - $v2\"]}\n"
-"			if {$diff != \"\"} {\n"
-"				if {$diff < 0} {\n"
-"					set diff [expr \"0.0 - $diff\"]\n"
-"				}\n"
-"				if {$diff < 0.00001} {\n"
-"					set ok 1\n"
-"				}\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	if {$ok} {\n"
-"		append_text \"\\tSet OK  ($msg)\\n\"\n"
-"		return 1\n"
-"\n"
-"	} elseif {[opt_match P $item] && [regexp {:(-|\\+)} $expected]} {\n"
-"		# e.g. blackout:+30x30+20+20\n"
-"		append_text \"\\t($msg)\\n\"\n"
-"		return 1\n"
-"	} elseif {[regexp {:[0-9]\\.[0-9]} $expected]} {\n"
-"		append_text \"\\t($msg)\\n\"\n"
-"		return 1\n"
-"	} elseif {$item == \"connect\" || $item == \"disconnect\"\n"
-"	    || $item == \"client\" || $item == \"client_input\"} {\n"
-"		append_text \"\\t($msg)\\n\"\n"
-"		return 1\n"
-"	} elseif {$item == \"passwd\" || $item == \"viewpasswd\"} {\n"
-"		append_text \"\\t($msg)\\n\"\n"
-"		return 1\n"
-"	} else {\n"
-"		append_text \"\\t*FAILED* $msg\\n\"\n"
-"		return 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc get_default_vars {} {\n"
-"	global default_var env\n"
-"\n"
-"	set qry [all_query_vars]\n"
-"\n"
-"	append qry \",vncconnect\"\n"
-"\n"
-"	set q \"\"\n"
-"	set i 0\n"
-"	set all \"\"\n"
-"	foreach s [split $qry \",\"] {\n"
-"		if {$q != \"\"} {\n"
-"			append q \",\"\n"
-"		}\n"
-"		append q $s\n"
-"		incr i\n"
-"		if {$i > 50} {\n"
-"			set qargs [list \"-QD\" $q]\n"
-"			set a [run_remote_cmd $qargs]\n"
-"			if [info exists env(TKX11VNC_PRINT_ALL_QD)] {\n"
-"				puts $q\n"
-"				puts $a\n"
-"				puts \"---------------\"\n"
-"			}\n"
-"			if {$all != \"\"} {\n"
-"				append all \",\"\n"
-"			}\n"
-"			append all $a\n"
-"			set q \"\"\n"
-"			set i 0\n"
-"		}\n"
-"	}\n"
-"	if {$q != \"\"} {\n"
-"		set qargs [list \"-QD\" $q]\n"
-"		set a [run_remote_cmd $qargs]\n"
-"		if [info exists env(TKX11VNC_PRINT_ALL_QD)] {\n"
-"			puts $q\n"
-"			puts $a\n"
-"			puts \"---------------\"\n"
-"		}\n"
-"		if {$all != \"\"} {\n"
-"			append all \",\"\n"
-"		}\n"
-"		append all $a\n"
-"	}\n"
-"\n"
-"# old way, qry too long...\n"
-"#	set qargs [list \"-QD\" $qry]\n"
-"#	set all [run_remote_cmd $qargs]\n"
-"\n"
-"	if {[regexp {ans=} $all]} {\n"
-"		#append_text \"Retrieved all default settings.\\n\"\n"
-"	} else {\n"
-"		#append_text \"Failed to retrieve default settings.\\n\"\n"
-"	}\n"
-"\n"
-"	set query_result_list [split_query $all]\n"
-"\n"
-"	set default_var(gui) \"\"\n"
-"\n"
-"	foreach piece $query_result_list {\n"
-"		if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {\n"
-"			if {$val == \"N/A\"} {\n"
-"				if {$item == \"vncconnect\"} {\n"
-"					set val 1\n"
-"				} else {\n"
-"					set val \"\"\n"
-"				}\n"
-"			}\n"
-"			if {$item == \"display\"} {\n"
-"				set val \"\"\n"
-"			} elseif {$item == \"desktop\"} {\n"
-"				set val \"\"\n"
-"			} elseif {$item == \"auth\"} {\n"
-"				set val \"\"\n"
-"			} elseif {$item == \"gui\"} {\n"
-"				continue\n"
-"			} \n"
-"			# some hacks we do here for now..\n"
-"			if {$item == \"cursor\" && $val == \"\"} {\n"
-"				set val \"most\"\n"
-"			} elseif {$item == \"scrollcopyrect\" && $val == \"\"} {\n"
-"				set val \"always\"\n"
-"			} elseif {$item == \"wirecopyrect\" && $val == \"\"} {\n"
-"				set val \"always\"\n"
-"#			} elseif {$item == \"overlay_nocursor\" && $val == 0} {\n"
-"#				set val 1\n"
-"			}\n"
-"\n"
-"			set default_var($item) $val\n"
-"#puts \"default: $item -> $val\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc tilde_expand {file} {\n"
-"	global env\n"
-"	if {[file exists $file]} {\n"
-"		return $file\n"
-"	}\n"
-"\n"
-"	set user \"\"\n"
-"	if {[info exists env(USER)]} {\n"
-"		set user $env(USER)\n"
-"	}\n"
-"	if {$user == \"\" && [info exists env(LOGNAME)]} {\n"
-"		set user $env(LOGNAME)\n"
-"	}\n"
-"\n"
-"	set home \"\"\n"
-"	if {[info exists env(HOME)]} {\n"
-"		set home $env(HOME)\n"
-"	} elseif {$user != \"\"} {\n"
-"		set home \"/home/$user\"\n"
-"	}\n"
-"\n"
-"	if {[regexp {^~} $file]} {\n"
-"		if {[regexp {^~/} $file]} {\n"
-"			if {$home != \"\"} {\n"
-"				regsub {^~} $file $home file\n"
-"			}\n"
-"		} else {\n"
-"			regsub {^~} $file \"/home/\" file\n"
-"		}\n"
-"	}\n"
-"	return $file\n"
-"}\n"
-"\n"
-"proc insert_cmdline_vars {} {\n"
-"	global env cmd_var menu_var default_var x11vnc_cmdline\n"
-"	if {![info exists x11vnc_cmdline]} {\n"
-"		return\n"
-"	}\n"
-"	if {$x11vnc_cmdline == \"\"} {\n"
-"		return\n"
-"	}\n"
-"	set cmd_var(novar) 1 \n"
-"	set str [string trim $x11vnc_cmdline]\n"
-"\n"
-"	while {[regexp -- {^-} $str]} {\n"
-"		if {[regexp -- {^--*([^ \\t][^ \\t]*)(.*)$} $str m var rest]} {\n"
-"			set rest [string trim $rest]\n"
-"			set var [string trim $var]\n"
-"			if {[regexp {^\\{\\{([^\\}]*)\\}\\}(.*)} $rest m val rest]} {\n"
-"				set str [string trim $rest]\n"
-"				set cmd_var($var) $val\n"
-"			} else {\n"
-"				set str $rest\n"
-"				set cmd_var($var) \"boolean\"\n"
-"			}\n"
-"		} else {\n"
-"			break\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {[info exists cmd_var(rc)]} {\n"
-"		load_settings $cmd_var(rc)\n"
-"	} elseif {[info exists cmd_var(norc)]} {\n"
-"		;\n"
-"	} else {\n"
-"		set filex [tilde_expand \"~/.x11vncrc\"]\n"
-"		if {[file exists $filex]} {\n"
-"			load_settings $filex\n"
-"		}\n"
-"	}\n"
-"\n"
-"	foreach var [array names cmd_var] {\n"
-"		if {$var == \"novar\"} {\n"
-"			continue\n"
-"		}\n"
-"		if {[regexp {^[ \\t]*$} $var]} {\n"
-"			continue\n"
-"		}\n"
-"		if {[info exists menu_var($var)]} {\n"
-"			if {$cmd_var($var) == \"boolean\"} {\n"
-"				set menu_var($var) 1\n"
-"			} else {\n"
-"				set menu_var($var) $cmd_var($var)\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc copy_default_vars {} {\n"
-"	global menu_var default_var\n"
-"	foreach item [array names default_var] {\n"
-"		if {[info exists menu_var($item)]} {\n"
-"			if {[info exists default_var($item)]} {\n"
-"				set menu_var($item) $default_var($item)\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	foreach item [array names menu_var] {\n"
-"		if {[info exists default_var($item)]} {\n"
-"			set menu_var($item) $default_var($item)\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc update_menu_vars {{query \"\"}} {\n"
-"	global all_settings menu_var query_result_list\n"
-"	global x11vnc_icon_mode\n"
-"\n"
-"	set debug [in_debug_mode]\n"
-"\n"
-"	if {$query == \"USE_LIST\"} {\n"
-"		;\n"
-"	} elseif {$query == \"\"} {\n"
-"		set query_result_list [split_query $all_settings]\n"
-"	} else {\n"
-"		set query_result_list [split_query $query]\n"
-"	}\n"
-"\n"
-"	foreach piece $query_result_list {\n"
-"#puts stderr \"UMV: $piece\"\n"
-"		if [regexp {icon_mode:0} $piece] {\n"
-"			set x11vnc_icon_mode 0\n"
-"			#puts stderr \"x11vnc_icon_mode: $x11vnc_icon_mode\"\n"
-"		}\n"
-"		if [regexp {icon_mode:1} $piece] {\n"
-"			set x11vnc_icon_mode 1\n"
-"			#puts stderr \"x11vnc_icon_mode: $x11vnc_icon_mode\"\n"
-"		}\n"
-"		# XXX ipv6\n"
-"		if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} {\n"
-"			if {[info exists menu_var($item)]} {\n"
-"				set old $menu_var($item)\n"
-"#puts stderr \"     $old\"\n"
-"				if {$val == \"N/A\"} {\n"
-"					continue\n"
-"				}\n"
-"				set menu_var($item) $val\n"
-"			}\n"
-"			if {$item == \"clients\"} {\n"
-"				update_clients_menu $val\n"
-"			} elseif {$item == \"display\"} {\n"
-"				set_x11_display $val\n"
-"			} elseif {$item == \"vncdisplay\"} {\n"
-"				set_vnc_display $val\n"
-"			} elseif {$item == \"http_url\"} {\n"
-"				set_vnc_url $val\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc load_settings {{file \"\"}} {\n"
-"	global menu_var default_var env\n"
-"\n"
-"	if {$file == \"\"} {\n"
-"		if {![info exists menu_var(load-settings)]} {\n"
-"			return\n"
-"		}\n"
-"		set file $menu_var(load-settings)\n"
-"	}\n"
-"	if {$file == \"\"} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	set fh \"\"\n"
-"	set filex [tilde_expand $file]\n"
-"	catch {set fh [open $filex \"r\"]}\n"
-"\n"
-"	if {$fh == \"\"} {\n"
-"		append_text \"load_settings: *** failed to open $filex ***\\n\"\n"
-"		return\n"
-"	}\n"
-"	copy_default_vars\n"
-"\n"
-"	set str \"\"\n"
-"	while {[gets $fh line] > -1} {\n"
-"		regsub -all {\\\\#} $line {__QUOTED_HASH__} line\n"
-"		if {[regexp {^[ \\t]*#} $line]} {\n"
-"			continue\n"
-"		}\n"
-"		for {set i 0} {$i < 5} {incr i} {\n"
-"			regsub {#.*$} $line \"\" line\n"
-"		}\n"
-"		if {[regexp {^[ \\t]*$} $line]} {\n"
-"			continue\n"
-"		}\n"
-"		regsub -all {__QUOTED_HASH__} $line {#} line\n"
-"		if {[regexp {\\\\$} $line]} {\n"
-"			regsub {\\\\$} $line \" \" line\n"
-"			append str \"$line\"\n"
-"		} else {\n"
-"			append str \"$line\\n\"\n"
-"		}\n"
-"	}\n"
-"	close $fh\n"
-"\n"
-"	set count 0\n"
-"	set parms \"\"\n"
-"\n"
-"	foreach line [split $str \"\\n\"] {\n"
-"		set line [string trim $line]\n"
-"		regsub {^--*} $line \"\" line\n"
-"		regsub -all {[ \\t][ \\t]*} $line \" \" line\n"
-"		set list [split $line]\n"
-"		set item [lindex $list 0]\n"
-"		set value [lindex $list 1]\n"
-"		if {[regexp {^[ \\t]*$} $item]} {\n"
-"			continue\n"
-"		}\n"
-"		if {$item == \"gui\"} {\n"
-"			continue\n"
-"		}\n"
-"		if {[info exists menu_var($item)]} {\n"
-"			if {[value_is_bool $item]} {\n"
-"				set menu_var($item) 1\n"
-"				incr count\n"
-"				append parms \"  -$item\\n\"\n"
-"			} elseif {[value_is_string $item]} {\n"
-"				if {$value != \"\"} {\n"
-"					set menu_var($item) $value\n"
-"					set nitem [get_nitem $item]\n"
-"					append parms \"  -$nitem $value\\n\"\n"
-"					incr count\n"
-"				}\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	append_text \"loaded $count parameter settings from $filex\"\n"
-"	if {$count > 0} {\n"
-"		append_text \":\\n\"\n"
-"		append_text $parms\n"
-"	} else {\n"
-"		append_text \".\\n\"\n"
-"	}\n"
-"}\n"
-"\n"
-"proc save_settings {} {\n"
-"	set rc_text [get_settings_rcfile]\n"
-"\n"
-"	set top \"#\n"
-"# This file is based on the current x11vnc settings and can be used as\n"
-"# as a ~/.x11vncrc defaults file.  If saved to another filename, these\n"
-"# settings can be passed to x11vnc at startup via \\\"-rc <filename>\\\".\n"
-"#\n"
-"# The rc file comment character is \\\"#\\\".  Use \\\"\\\\#\\\" for the literal char.\n"
-"# You can continue lines using \\\"\\\\\\\" as the last character of a line.\n"
-"#\n"
-"# Lines beginning with \\\"#d\\\" indicate the parameter value is at its default\n"
-"# setting and you probably want to leave it commented out.\n"
-"#\n"
-"# Lines beginning with \\\"#?\\\" indicate parameters you probably do not\n"
-"# want to hardwire to the current setting (uncomment if you want that).\n"
-"# \n"
-"# Some parameters are boolean, e.g. -forever, and take no value; while\n"
-"# the others, e.g. -wait 50, take a string or numerical value.\n"
-"#\n"
-"# For booleans, the line will end with comment \\\"default: on\\\" or\n"
-"# \\\"default: off\\\" indicating the default setting.  (Note: often\n"
-"# \\\"-nofoobar\\\" corresponds to option \\\"-foobar\\\" and the former is\n"
-"# \\\"the default\\\", e.g. -norepeat).\n"
-"#\n"
-"# For string or numerical options, the value \\\"\\\" in a line below\n"
-"# means the default is unset and you will need to supply some non-empty\n"
-"# value to use the parameter.  For reference, if the default differs\n"
-"# from your value it placed at the end of the line as a comment.\n"
-"# \n"
-"# Feel free to uncomment or comment any of the lines or to change any\n"
-"# of the values of the parameters.  Don't be surprised that most if not\n"
-"# all of the lines below are commented out (x11vnc has so many parameters,\n"
-"# most of them will be at their default values).\n"
-"#-------------------------------------------------------------------------\n"
-"\n"
-"\"\n"
-"\n"
-"	set rc_text \"$top$rc_text\"\n"
-"\n"
-"	global env save_settings_var save_settings_var_ok\n"
-"	if {[info exists env(HOME)]} {\n"
-"		set save_settings_var \"$env(HOME)/.x11vncrc\"\n"
-"	} else {\n"
-"		set save_settings_var \".x11vncrc\"\n"
-"	}\n"
-"	set save_settings_var_ok 0\n"
-"\n"
-"	set w [textwin \"save_settings\" \"Save Settings...\" $rc_text \\\n"
-"		\"save_settings_var+Save as:\"]\n"
-"\n"
-"	tkwait window $w\n"
-"\n"
-"	if {$save_settings_var_ok == 1} {\n"
-"		set file $save_settings_var\n"
-"		if {$file == \"\"} {\n"
-"			return\n"
-"		}\n"
-"		set file [tilde_expand $file]\n"
-"		append_text \"\\nSaving current settings to $file ...\\n\" \n"
-"		if {[file exists $file]} {\n"
-"			set backup \"${file}~\"\n"
-"			append_text \"Backing up $file -> $backup ...\\n\"\n"
-"			catch {file delete -force $backup}\n"
-"			set emsg \"*** Backup to $backup failed. ***\\n\"\n"
-"			if {![file exists $backup]} {\n"
-"				catch {file copy -force $file $backup}\n"
-"				if {![file exists $backup]} {\n"
-"					append_text $emsg\n"
-"					bell\n"
-"				}\n"
-"			} else {\n"
-"				append_text $emsg\n"
-"				bell\n"
-"			}\n"
-"		}\n"
-"		set fh \"\"\n"
-"		catch {set fh [open $file \"w\"]}\n"
-"		if {$fh != \"\"} {\n"
-"			puts $fh $rc_text\n"
-"			close $fh\n"
-"			if {![file exists $file]} {\n"
-"				append_text \"*** Saving to $file failed. ***\\n\"\n"
-"				bell\n"
-"			} else {\n"
-"				append_text \"Done.\\n\"\n"
-"			}\n"
-"		} else {\n"
-"			append_text \"*** Open of $file failed. ***\\n\"\n"
-"			bell\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc clear_all {} {\n"
-"	global menu_var unset_str\n"
-"\n"
-"	set debug [in_debug_mode]\n"
-"	\n"
-"	foreach item [array names menu_var] {\n"
-"		if {$item == \"debug_gui\"} {\n"
-"			continue\n"
-"		}\n"
-"		if {[info exists menu_var($item)]} {\n"
-"			if {[is_action $item]} {\n"
-"				set menu_var($item) \"\"\n"
-"			} elseif {[value_is_bool $item]} {\n"
-"				set menu_var($item) 0\n"
-"			} elseif {[value_is_string $item]} {\n"
-"				set menu_var($item) $unset_str\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	append_text \"Cleared all settings.\\n\"\n"
-"}\n"
-"\n"
-"proc defaults_all {} {\n"
-"	copy_default_vars\n"
-"	append_text \"Reset all variables to default values.\\n\"\n"
-"}\n"
-"\n"
-"proc all_query_vars {} {\n"
-"	global query_ans_list query_aro_list all_settings\n"
-"	global cache_all_query_vars\n"
-"	\n"
-"	if {$cache_all_query_vars != \"\"} {\n"
-"		return $cache_all_query_vars\n"
-"	}\n"
-"\n"
-"	set qry \"\"\n"
-"	foreach item $query_ans_list {\n"
-"		if {$qry == \"\"} {\n"
-"			set qry $item\n"
-"		} else {\n"
-"			append qry \",$item\"\n"
-"		}\n"
-"	}\n"
-"	foreach item $query_aro_list {\n"
-"		if {$qry == \"\"} {\n"
-"			set qry $item\n"
-"		} else {\n"
-"			append qry \",$item\"\n"
-"		}\n"
-"	}\n"
-"	set cache_all_query_vars $qry\n"
-"\n"
-"	global env\n"
-"	if [info exists env(TKX11VNC_PRINT_ALL_VARS)] {\n"
-"		puts \"--------------- BEGIN ALL VARS ---------------\"\n"
-"		puts $qry\n"
-"		puts \"--------------- END ALL VARS ---------------\"\n"
-"	}\n"
-"\n"
-"	return $qry\n"
-"}\n"
-"\n"
-"proc query_all {{quiet 0}} {\n"
-"	global query_ans_list query_aro_list all_settings\n"
-"	global last_query_all_time\n"
-"\n"
-"	dtime 1\n"
-"	set qry [all_query_vars]\n"
-"\n"
-"	set qargs [list \"-Q\" $qry]\n"
-"	set all [run_remote_cmd $qargs]\n"
-"\n"
-"	if {[regexp {ans=} $all]} {\n"
-"		if {! $quiet} {\n"
-"			append_text \"Retrieved all current settings.\\n\"\n"
-"		}\n"
-"		set all_settings $all\n"
-"		update_menu_vars $all\n"
-"	} else {\n"
-"		if {! $quiet} {\n"
-"			append_text \"Failed to retrieve current settings.\\n\"\n"
-"		}\n"
-"	}\n"
-"	set last_query_all_time [clock seconds]\n"
-"	dtime 2\n"
-"	return $all\n"
-"}\n"
-"\n"
-"proc set_info {str} {\n"
-"	global info_str info_label\n"
-"#set w1 [$info_label cget -width]\n"
-"#set w2 [winfo width $info_label]\n"
-"#puts \"set_info: w=$w1  winfo=$w2\"\n"
-"#append_text \"$str\\n\"\n"
-"	set info_str \"$str\"\n"
-"	update\n"
-"}\n"
-"\n"
-"proc append_text {str} {\n"
-"	global text_area text_area_str\n"
-"\n"
-"	if {![info exists text_area_str]} {\n"
-"		set text_area_str \"\"\n"
-"	}\n"
-"	append text_area_str $str\n"
-"\n"
-"	if {![info exists text_area]} {\n"
-"		puts stderr $str\n"
-"		return\n"
-"	}\n"
-"	if {$text_area == \"\"} {\n"
-"		puts stderr $str\n"
-"		return\n"
-"	}\n"
-"	if {![winfo exists $text_area]} {\n"
-"		puts stderr $str\n"
-"		return\n"
-"	}\n"
-"	\n"
-"	$text_area insert end $str\n"
-"	$text_area see end\n"
-"}\n"
-"\n"
-"proc show_all_settings {} {\n"
-"	global all_settings\n"
-"	global client_sock client_tail\n"
-"	global x11vnc_client_file\n"
-"\n"
-"	set txt \"\\nRead-Write settings:\\n\\n\"\n"
-"	foreach item [split_query $all_settings]  {\n"
-"		regsub {:} $item {: } item\n"
-"		append txt \"  $item\\n\"\n"
-"		if {[regexp {noremote} $item]} {\n"
-"			append txt \"\\nRead-Only settings:\\n\\n\"\n"
-"		}\n"
-"	}\n"
-"	append txt \"\\nInternal settings:\\n\\n\"\n"
-"	append txt \"x11vnc_client_file: $x11vnc_client_file\\n\"\n"
-"	if {[info exists client_tail]} {\n"
-"		append txt \"client_tail: $client_tail\\n\"\n"
-"	} else {\n"
-"		append txt \"client_tail: unset\\n\"\n"
-"	}\n"
-"	if {[info exists client_sock]} {\n"
-"		append txt \"client_sock: $client_sock\\n\"\n"
-"	} else {\n"
-"		append txt \"client_sock: unset\\n\"\n"
-"	}\n"
-"	set estr \"\"\n"
-"	catch {set estr [exec env | grep -i X11VNC]}\n"
-"	append txt \"$estr\\n\"\n"
-"	textwin \"Settings\" \"All Current Settings\" $txt\n"
-"}\n"
-"\n"
-"proc show_logfile {} {\n"
-"	global menu_var unset_str\n"
-"\n"
-"	set logfile [tilde_expand $menu_var(logfile)]\n"
-"	\n"
-"	if {$logfile == \"\" || $logfile == $unset_str} {\n"
-"		set txt \"\\nNo logfile was specified at x11vnc startup.\\n\\n\"	\n"
-"	} elseif {![file exists $logfile]} {\n"
-"		set txt \"\\nLogfile \\\"$logfile\\\" does not exist.\\n\\n\"\n"
-"	} else {\n"
-"		set fh \"-3\"\n"
-"		set err \"\"\n"
-"		catch {set fh [open $logfile \"r\"]} err\n"
-"		if {$fh == \"-3\"} {\n"
-"			set txt \"\\nError opening \\\"$logfile\\\" $err.\\n\\n\"\n"
-"		} else {\n"
-"			set txt \"\\nLogfile \\\"$logfile\\\" current contents:\\n\"\n"
-"			while {[gets $fh line] > -1} {\n"
-"				append txt \"$line\\n\"\n"
-"			}\n"
-"			close $fh\n"
-"		}\n"
-"	}\n"
-"	textwin \"Logfile\" \"Logfile\" $txt\n"
-"}\n"
-"\n"
-"proc tail_logfile {} {\n"
-"	global menu_var unset_str ffont\n"
-"	set logfile $menu_var(logfile)\n"
-"	\n"
-"	set txt \"\"\n"
-"	if {$logfile == \"\" || $logfile == $unset_str} {\n"
-"		set txt \"\\nNo logfile was specified at x11vnc startup.\\n\\n\"	\n"
-"	} elseif {![file exists $logfile]} {\n"
-"		set txt \"\\nLogfile \\\"$logfile\\\" does not exist.\\n\\n\"\n"
-"	} else {\n"
-"		set cmd \"\"\n"
-"		set xterm_cmd \"xterm -sb -fn $ffont -geometry 80x45 -title x11vnc-logfile -e\"\n"
-"		set cmd [split $xterm_cmd]\n"
-"		lappend cmd \"tail\"\n"
-"		lappend cmd \"-3000f\"\n"
-"		lappend cmd $logfile\n"
-"		lappend cmd \"&\"\n"
-"		catch {[eval exec $cmd]}\n"
-"	}\n"
-"	if {$txt != \"\"} {\n"
-"		textwin \"Logfile\" \"Logfile\" $txt\n"
-"	}\n"
-"}\n"
-"\n"
-"proc set_connected {yesno} {\n"
-"	global connected_to_x11vnc\n"
-"	set orig $connected_to_x11vnc\n"
-"	\n"
-"	if {$yesno == \"yes\"} {\n"
-"		set connected_to_x11vnc 1\n"
-"	} else {\n"
-"		set connected_to_x11vnc 0\n"
-"		no_x11_display\n"
-"		no_vnc_display\n"
-"	}\n"
-"	if {$orig != $connected_to_x11vnc} {\n"
-"		set_widgets\n"
-"	}\n"
-"}\n"
-"\n"
-"proc detach_from_display {} {\n"
-"	global connected_to_x11vnc reply_xdisplay x11vnc_xdisplay\n"
-"	set str \"Detaching from X display.\"\n"
-"	if {$reply_xdisplay != \"\"} {\n"
-"		set str \"Detaching from $reply_xdisplay.\"\n"
-"	} elseif {$x11vnc_xdisplay != \"\"} {\n"
-"		set str \"Detaching from $x11vnc_xdisplay.\"\n"
-"	}\n"
-"	if {$connected_to_x11vnc} {\n"
-"		append_text \"$str\\n\"\n"
-"	}\n"
-"	set_connected no\n"
-"}\n"
-"\n"
-"proc do_stop_quit {} {\n"
-"	push_new_value \"stop\" \"stop\" 1 0\n"
-"	set_connected no\n"
-"	update\n"
-"	after 250\n"
-"	destroy .\n"
-"}\n"
-"\n"
-"# Menu item is an action:\n"
-"proc do_action {item} {\n"
-"	global menu_var connected_to_x11vnc beginner_mode\n"
-"\n"
-"	if {[in_debug_mode]} {\n"
-"		append_text \"action: \\\"$item\\\"\\n\"\n"
-"	}\n"
-"#puts \"action: \\\"$item\\\"\\n\"\n"
-"\n"
-"	if {$item == \"ping\"} {\n"
-"		if {$beginner_mode} {\n"
-"			try_connect_and_query_all\n"
-"		} else {\n"
-"			try_connect\n"
-"		}\n"
-"		return\n"
-"	} elseif {$item == \"start\"} {\n"
-"		start_x11vnc\n"
-"		return\n"
-"	} elseif {$item == \"detach\"} {\n"
-"		detach_from_display\n"
-"		return\n"
-"	} elseif {$item == \"attach\"} {\n"
-"		try_connect_and_query_all\n"
-"		return\n"
-"	} elseif {$item == \"update-all\"} {\n"
-"		query_all\n"
-"		return\n"
-"	} elseif {$item == \"clear-all\"} {\n"
-"		clear_all\n"
-"		return\n"
-"	} elseif {$item == \"defaults-all\"} {\n"
-"		defaults_all\n"
-"		return\n"
-"	} elseif {$item == \"save-settings\"} {\n"
-"		save_settings\n"
-"		return\n"
-"	} elseif {$item == \"show-start-cmd\"} {\n"
-"		show_start_cmd\n"
-"		return\n"
-"	} elseif {$item == \"all-settings\"} {\n"
-"		show_all_settings\n"
-"		return\n"
-"	} elseif {$item == \"show-logfile\"} {\n"
-"		show_logfile\n"
-"		return\n"
-"	} elseif {$item == \"tail-logfile\"} {\n"
-"		tail_logfile\n"
-"		return\n"
-"	} elseif {$item == \"Misc-Tuning:\"} {\n"
-"		menu_help \"$item\"\n"
-"		return\n"
-"	} elseif {$item == \"WindowView\"} {\n"
-"		change_view_state\n"
-"		return\n"
-"	} elseif {$item == \"quit\" || $item == \"Quit\"} {\n"
-"		destroy .\n"
-"		exit 0\n"
-"	} elseif {$item == \"stop+quit\"} {\n"
-"		do_stop_quit\n"
-"	}\n"
-"\n"
-"	if {[value_is_string $item]} {\n"
-"		if {! [entry_dialog $item]} {\n"
-"			return\n"
-"		}\n"
-"		set new $menu_var($item)\n"
-"		set name $item\n"
-"	} else {\n"
-"		set new 1\n"
-"		set name $item\n"
-"	}\n"
-"\n"
-"	if {$item == \"load-settings\"} {\n"
-"		load_settings\n"
-"		return\n"
-"	}\n"
-"\n"
-"	if {! $connected_to_x11vnc} {\n"
-"		;\n"
-"	} elseif {[regexp {^(stop|quit|exit|shutdown)$} $item]} {\n"
-"		# just do -R\n"
-"		append_text \"stopping remote x11vnc server...\\n\"\n"
-"		push_new_value $item $name $new 0\n"
-"		set_connected no\n"
-"		\n"
-"	} elseif {[opt_match Q $item]} {\n"
-"		push_new_value $item $name $new 1\n"
-"	} else {\n"
-"		push_new_value $item $name $new 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc ptime {time} {\n"
-"	set usec [lindex [split $time] 0]\n"
-"	set sec [format \"%.3f\" [expr \"$usec / 1000000.0\"]]\n"
-"	puts \"time: $sec secs.\"\n"
-"}\n"
-"\n"
-"proc do_var {item} {\n"
-"	global connected_to_x11vnc item_cascade menu_var\n"
-"\n"
-"	set debug [in_debug_mode]\n"
-"\n"
-"	set string 0\n"
-"	if {[is_action $item] || $item == \"WindowView\"} {\n"
-"		# Menu item is action:\n"
-"		if {$debug} {\n"
-"			ptime [time {do_action $item}]\n"
-"		} else {\n"
-"			do_action $item\n"
-"		}\n"
-"		return\n"
-"	}\n"
-"\n"
-"	if {[value_is_string $item]} {\n"
-"		# Menu item is a string:\n"
-"		if {$item_cascade($item) != \"\"} {\n"
-"			# Cascade sets variable automatically\n"
-"		} else {\n"
-"			# Otherwise Entry box\n"
-"			if {![entry_dialog $item]} {\n"
-"				return\n"
-"			}\n"
-"		}\n"
-"		set new $menu_var($item)\n"
-"		set name $item\n"
-"	} else {\n"
-"		# Menu item is a boolean:\n"
-"		set name [check_var $item]\n"
-"		if {$name == \"\"} {\n"
-"			return\n"
-"		}\n"
-"		set new 1\n"
-"	}\n"
-"	if {$connected_to_x11vnc} {\n"
-"		if {$debug} {\n"
-"			ptime [time {push_new_value $item $name $new 1}]\n"
-"		} else {\n"
-"			push_new_value $item $name $new 1\n"
-"		}\n"
-"\n"
-"		if {$item == \"http\"} {\n"
-"			global vnc_url\n"
-"			append_text \"  URL: $vnc_url\\n\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc menu_help {item} {\n"
-"	if ![help_win $item] {\n"
-"		textwin \"nohelp\" \"No help available\" \\\n"
-"			\"Sorry, no help avaiable for \\\"$item\\\"\"\n"
-"	}\n"
-"}\n"
-"\n"
-"proc opt_match {c item} {\n"
-"	global item_opts\n"
-"	if {[info exists item_opts($item)]} {\n"
-"		if {[regexp \"^\\[A-z\\]*$c\" $item_opts($item)]} {\n"
-"			return 1\n"
-"		}\n"
-"	}\n"
-"	return 0\n"
-"}\n"
-"\n"
-"proc is_action {item} {\n"
-"	return [opt_match A $item]\n"
-"}\n"
-"\n"
-"proc is_gui_internal {item} {\n"
-"	if {$item == \"Properties\"} {\n"
-"		return 1\n"
-"	}\n"
-"	if {$item == \"Tray\"} {\n"
-"		return 1\n"
-"	}\n"
-"	return [opt_match G $item]\n"
-"}\n"
-"\n"
-"proc is_browse {item} {\n"
-"	return [opt_match F $item]\n"
-"}\n"
-"\n"
-"proc value_is_string {item} {\n"
-"	global item_bool\n"
-"	if {![info exists item_bool($item)]} {\n"
-"		return 0\n"
-"	}\n"
-"	if {! $item_bool($item)} {\n"
-"		return 1\n"
-"	} else {\n"
-"		return 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc value_is_bool {item} {\n"
-"	global item_bool\n"
-"	if {![info exists item_bool($item)]} {\n"
-"		return 0\n"
-"	}\n"
-"	if {$item_bool($item)} {\n"
-"		return 1\n"
-"	} else {\n"
-"		return 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc split_query0 {query} {\n"
-"	# original slower way with regexp/regsub\n"
-"	regsub -all {aro=} $query {ans=} query\n"
-"	set items {}\n"
-"	while {1} {\n"
-"		if {! [regexp {^ans=(.*)$} $query m0 m1]} {\n"
-"			break\n"
-"		}\n"
-"		set item $m1\n"
-"		set m2 \"\"\n"
-"		regexp {,ans=.*$} $item m2\n"
-"		regsub {,ans=.*$} $item \"\" item\n"
-"		if {$item != \"\"} {\n"
-"			lappend items $item\n"
-"		}\n"
-"		set query $m2\n"
-"		regsub {^,} $query \"\" query\n"
-"	}\n"
-"	return $items\n"
-"}\n"
-"\n"
-"proc split_query {query} {\n"
-"	regsub -all {aro=} $query {ans=} query\n"
-"	set items {}\n"
-"	while {1} {\n"
-"		set n [string first \"ans=\" $query]\n"
-"		if {$n < 0} {\n"
-"			break\n"
-"		}\n"
-"		set from [expr $n+4]\n"
-"\n"
-"		set m [string first \",ans=\" $query]\n"
-"		if {$m < 0} {\n"
-"			set more 0\n"
-"			set item [string range $query $from end]\n"
-"		} else {\n"
-"			set more 1\n"
-"			set to   [expr $m-1]\n"
-"			set item [string range $query $from $to]\n"
-"		}\n"
-"		if {$item != \"\"} {\n"
-"			lappend items $item\n"
-"		}\n"
-"		if {$more} {\n"
-"			incr m\n"
-"			set query [string range $query $m end]\n"
-"		} else {\n"
-"			set query \"\"\n"
-"		}\n"
-"	}\n"
-"	return $items\n"
-"}\n"
-"\n"
-"proc set_x11_display {name} {\n"
-"	global x11_display\n"
-"	set x11_display \"x11vnc X display: $name\"\n"
-"	set_name \"tkx11vnc - $name\"\n"
-"}\n"
-"proc set_vnc_display {name} {\n"
-"	global vnc_display icon_mode\n"
-"	set vnc_display \"VNC display: $name\"\n"
-"\n"
-"	if {$icon_mode} {\n"
-"		set_icon_label\n"
-"	}\n"
-"}\n"
-"proc set_vnc_url {name} {\n"
-"	global vnc_url\n"
-"	set vnc_url $name\n"
-"}\n"
-"proc no_x11_display {} {\n"
-"	set_x11_display \"(*none*)\"\n"
-"	set_name \"tkx11vnc\"\n"
-"}\n"
-"proc no_vnc_display {} {\n"
-"	set_vnc_display \"(*none*)\"\n"
-"}\n"
-"proc no_vnc_url {} {\n"
-"	set_vnc_url \"(*none*)\"\n"
-"}\n"
-"\n"
-"proc get_vnc_display_number {} {\n"
-"	global vnc_display\n"
-"	if ![info exists vnc_display] {\n"
-"		return \"none\"\n"
-"	}\n"
-"	if {$vnc_display == \"\"} {\n"
-"		return \"none\"\n"
-"	}\n"
-"	set str $vnc_display\n"
-"	regsub {VNC display: *} $str \"\" str\n"
-"	if [regexp {:([0-9][0-9]*)} $str m0 n] {\n"
-"		return $n\n"
-"	}\n"
-"	return \"none\"\n"
-"}\n"
-"\n"
-"proc fetch_displays {} {\n"
-"\n"
-"	set qargs [list \"-Q\" \"display,vncdisplay\"]\n"
-"	set result [run_remote_cmd $qargs]\n"
-"\n"
-"	set got_x11 0\n"
-"	set got_vnc 0\n"
-"	set got_url 0\n"
-"\n"
-"	foreach item [split_query $result] {\n"
-"		if {[regexp {^display:(.*)$} $item m0 m1]} {\n"
-"			set_x11_display $m1\n"
-"			set got_x11 1\n"
-"		} elseif {[regexp {^vncdisplay:(.*)$} $item m0 m1]} {\n"
-"			set_vnc_display $m1\n"
-"			set got_vnc 1\n"
-"		} elseif {[regexp {^http_url:(.*)$} $item m0 m1]} {\n"
-"			set_vnc_url $m1\n"
-"			set got_url 1\n"
-"		}\n"
-"	}\n"
-"	if {! $got_x11} {\n"
-"		no_x11_display\n"
-"	}\n"
-"	if {! $got_vnc} {\n"
-"		no_vnc_display\n"
-"	}\n"
-"	if {! $got_url} {\n"
-"		no_vnc_url\n"
-"	}\n"
-"}\n"
-"\n"
-"proc client_dialog {client} {\n"
-"	set cid \"\"\n"
-"	set host \"\"\n"
-"	set ip \"\"\n"
-"	global menu_var text_area cleanup_window item_bool\n"
-"\n"
-"	#<id>:<ip>:<port>:<user>:<unix>:<hostname>:<input>:<loginview>:<time>\n"
-"	append_text \"\\nClient info string:\\n - $client\\n\\n\"\n"
-"	if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \\\n"
-"	    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {\n"
-"		set cid  $m1\n"
-"		set ip   $m2\n"
-"		set port $m3\n"
-"		set user $m4\n"
-"		set unix $m5\n"
-"		set host $m6\n"
-"		regsub {\\..*$} $host \"\" host\n"
-"		set input $m7\n"
-"		set logvo $m8\n"
-"		set ltime $m9\n"
-"		append_text \"Host: $host, Port: $port, User: $user\"\n"
-"		if {$unix != \"\" && $unix != \"none\"} {\n"
-"			append_text \", Unix: $unix\"\n"
-"		}\n"
-"		append_text \", IP: $ip, Id: $cid\\n\"\n"
-"		append_text \" - originally logged in as: \"\n"
-"		if {$logvo == \"1\" } {\n"
-"			append_text \"View-Only Client\"\n"
-"		} else {\n"
-"			append_text \"Normal Client\"\n"
-"		}\n"
-"		if {$ltime != \"\"} {\n"
-"			set tim [clock format $ltime]\n"
-"			append_text \",  $tim\"\n"
-"		}\n"
-"		append_text \"\\n\"\n"
-"		append_text \" - currently allowed input: \"\n"
-"		set sk 0\n"
-"		set sm 0\n"
-"		set sb 0\n"
-"		set sc 0\n"
-"		set sf 0\n"
-"		if {[regexp -nocase {K} $input]} {\n"
-"			append_text \"Keystrokes\"\n"
-"			set sk 1\n"
-"		}\n"
-"		if {[regexp -nocase {M} $input]} {\n"
-"			if {$sk} {\n"
-"				append_text \", \"\n"
-"			}\n"
-"			append_text \"Mouse-Motion\"\n"
-"			set sm 1\n"
-"		}\n"
-"		if {[regexp -nocase {B} $input]} {\n"
-"			if {$sk || $sm} {\n"
-"				append_text \", \"\n"
-"			}\n"
-"			append_text \"Button-Click\"\n"
-"			set sb 1\n"
-"		}\n"
-"		if {[regexp -nocase {C} $input]} {\n"
-"			if {$sk || $sm || $sb} {\n"
-"				append_text \", \"\n"
-"			}\n"
-"			append_text \"Clipboard\"\n"
-"			set sm 1\n"
-"		}\n"
-"		if {[regexp -nocase {F} $input]} {\n"
-"			if {$sk || $sm || $sb || $sf} {\n"
-"				append_text \", \"\n"
-"			}\n"
-"			append_text \"Files\"\n"
-"			set sf 1\n"
-"		}\n"
-"		if {! $sk && ! $sm && ! $sb && ! $sm && ! $sf} {\n"
-"			append_text \"None\"\n"
-"		}\n"
-"		append_text \"\\n\"\n"
-"	}\n"
-"	if {$cid == \"\"} {\n"
-"		append_text \"Invalid client info string: $client\\n\"\n"
-"		return\n"
-"	}\n"
-"\n"
-"	regsub -all {_} $input \"\" input\n"
-"	set menu_var(client) \"$input\"\n"
-"	set item_bool(client) 0\n"
-"\n"
-"	insert_client_action_window $input\n"
-"	set rc [entry_dialog client 1]\n"
-"\n"
-"	cleanup_text_window\n"
-"\n"
-"	set val $menu_var(client)\n"
-"	#puts \"rc: $rc  val: $val\"\n"
-"\n"
-"	if {! $rc} {\n"
-"		return;\n"
-"	} elseif {[regexp -nocase {(disconnect|close)} $val]} {\n"
-"		disconnect_dialog $client\n"
-"	} else {\n"
-"		regsub -all -nocase {[^KMBCF]} $val \"\" val\n"
-"		set item_bool(client_input) 0\n"
-"		push_new_value \"client_input\" \"client_input\" \"$cid:$val\" 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc disconnect_dialog {client} {\n"
-"	set cid \"\"\n"
-"	set host \"\"\n"
-"	set msg \"\\n\"\n"
-"	append msg \"*** Client info string:\\n    $client\\n\"\n"
-"	if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \\\n"
-"	    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {\n"
-"		set cid  $m1\n"
-"		set ip   $m2\n"
-"		set port $m3\n"
-"		set user $m4\n"
-"		set unix $m5\n"
-"		set host $m6\n"
-"		regsub {\\..*$} $host \"\" host\n"
-"		set input $m7\n"
-"		set logvo $m8\n"
-"		set ltime $m9\n"
-"		append_text \"Host: $host, Port: $port, IP: $ip, User: $user\"\n"
-"		if {$unix != \"\" && $unix != \"none\"} {\n"
-"			append_text \", Unix: $unix\"\n"
-"		}\n"
-"		append_text \", Id: $cid\\n\"\n"
-"	}\n"
-"	if {$cid == \"\"} {\n"
-"		append_text \"Invalid client info string: $client\\n\"\n"
-"		return\n"
-"	}\n"
-"	append msg \"*** To *DISCONNECT* this client press \\\"OK\\\" again, otherwise press \\\"Cancel\\\"\\n\"\n"
-"	bell\n"
-"	if {[warning_dialog $msg \"current\"]} {\n"
-"		push_new_value \"disconnect\" \"disconnect\" $cid 1\n"
-"	} else {\n"
-"		append_text \"disconnect cancelled.\\n\"\n"
-"	}\n"
-"}\n"
-"\n"
-"proc update_clients_and_repost {} {\n"
-"	global item_cascade menu_m menu_b\n"
-"\n"
-"	append_text \"Refreshing connected clients list... \"\n"
-"	query_all 1\n"
-"	update\n"
-"\n"
-"	set saw 0\n"
-"	set casc $item_cascade(current)\n"
-"	set last [$casc index end]\n"
-"	for {set i 0} {$i <= $last} {incr i} {\n"
-"		if {[$casc type $i] == \"separator\"} {\n"
-"			continue\n"
-"		}\n"
-"		set name [$casc entrycget $i -label]\n"
-"		if {[regexp {^num-clients} $name]} {\n"
-"			continue\n"
-"		}\n"
-"		if {[regexp {^refresh-list} $name]} {\n"
-"			continue\n"
-"		}\n"
-"		if {! $saw} {\n"
-"			append_text \"\\n\"\n"
-"		}\n"
-"		set saw 1\n"
-"		append_text \"client: $name\\n\"\n"
-"	}\n"
-"	if {! $saw} {\n"
-"		append_text \"done.\\n\"\n"
-"	}\n"
-"}\n"
-"\n"
-"proc update_clients_menu {list} {\n"
-"	global item_cascade ffont\n"
-"	global saved_clients_str\n"
-"\n"
-"	if {![info exists saved_clients_str]} {\n"
-"		set saved_clients_str \"\"\n"
-"	}\n"
-"	if {$list == \"INIT\"} {\n"
-"		set list $saved_clients_str\n"
-"	} else {\n"
-"		set saved_clients_str $list\n"
-"	}\n"
-"\n"
-"	set subm $item_cascade(current);\n"
-"	catch {destroy $subm}\n"
-"	menu $subm -tearoff 0 -font $ffont\n"
-"	$subm add command\n"
-"	$subm add command -label \"refresh-list\" \\\n"
-"		-command \"update_clients_and_repost\"\n"
-"	$subm add separator\n"
-"	set count 0\n"
-"	foreach client [split $list \",\"] {\n"
-"		if {![regexp {^[a-z0-9]*[a-z0-9]:} $client]} {\n"
-"			#append_text \"Skipping client line: \"\n"
-"			#append_text $client\n"
-"			#append_text \"\\n\"\n"
-"			continue\n"
-"		}\n"
-"		regsub -all {[{}()~!$&*|;'\"`{}<>\\[\\]]} $client \"\" client\n"
-"		#'\n"
-"		if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \\\n"
-"		    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {\n"
-"			set id   $m1\n"
-"			set user $m4\n"
-"			set unix $m5\n"
-"			set host $m6\n"
-"			regsub {\\..*$} $host \"\" host\n"
-"			set clabel \"$host $id\"\n"
-"			if {$unix != \"\" && $unix != \"none\"} {\n"
-"				set clabel \"$unix@$clabel\"\n"
-"			} elseif {$user != \"unknown-user\"} {\n"
-"				set clabel \"$user@$clabel\"\n"
-"			}\n"
-"		} else {\n"
-"			regsub {:.*$} $client \"\" clabel\n"
-"		}\n"
-"		$subm add command -label \"$clabel\" \\\n"
-"			-command \"client_dialog \\{$client\\}\"\n"
-"		incr count\n"
-"	}\n"
-"	$subm entryconfigure 0 -label \"num-clients: $count\"\n"
-"}\n"
-"\n"
-"proc set_widgets {} {\n"
-"	global connected_to_x11vnc item_case item_menu item_entry menu_m\n"
-"\n"
-"	foreach item [array names item_case] {\n"
-"		if ![info exists item_case($item)] { continue; }\n"
-"		set case $item_case($item)\n"
-"		if ![info exists item_menu($item)] { continue; }\n"
-"		set menu $item_menu($item)\n"
-"		if ![info exists item_entry($item)] { continue; }\n"
-"		set entry $item_entry($item)\n"
-"		if {$entry < 0} {\n"
-"			# skip case under beginner_mode \n"
-"			continue\n"
-"		}\n"
-"		set type [$menu type $entry]\n"
-"		if {$type == \"separator\" || $type == \"tearoff\"} {\n"
-"			continue\n"
-"		}\n"
-"		if {![winfo exists $menu]} {\n"
-"			continue\n"
-"		}\n"
-"		if {$connected_to_x11vnc} {\n"
-"			if {[active_when_connected $item]} {\n"
-"				$menu entryconfigure $entry -state normal\n"
-"			} else {\n"
-"				$menu entryconfigure $entry -state disabled\n"
-"			}\n"
-"		} else {\n"
-"			if {[active_when_starting $item]} {\n"
-"				$menu entryconfigure $entry -state normal\n"
-"			} else {\n"
-"				$menu entryconfigure $entry -state disabled\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc toggle_simple_gui {} {\n"
-"	global beginner_mode simple_gui_created\n"
-"	global connected_to_x11vnc make_gui_count\n"
-"\n"
-"	if {$beginner_mode} {\n"
-"		append_text \"\\nSwitching to simple-gui mode.\\n\"\n"
-"	} else {\n"
-"		append_text \"\\nSwitching to power-user gui mode.\\n\"\n"
-"	}\n"
-"\n"
-"	if {$make_gui_count == 1} {\n"
-"		incr make_gui_count\n"
-"	}\n"
-"	set simple_gui_created 1\n"
-"	make_menu_items\n"
-"	set_widgets\n"
-"	set_internal_help\n"
-"	append_text \"\\n\"\n"
-"}\n"
-"\n"
-"proc little_qs {m} {\n"
-"	global bfont ffont beginner_mode\n"
-"	global helpremote helptext helplabel\n"
-"	global tk_version osname\n"
-"\n"
-"	if {$tk_version < 8.0} {\n"
-"		return\n"
-"	}\n"
-"	if {$osname == \"Darwin\"} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	set n [$m index end]\n"
-"\n"
-"	for {set i 0} {$i <= $n} {incr i} {\n"
-"		set type [$m type $i]\n"
-"#puts \"$m - $i - $type\"\n"
-"		if {$type == \"separator\"} {\n"
-"			$m add separator\n"
-"		} elseif {$type == \"tearoff\"} {\n"
-"			continue;\n"
-"		} else {\n"
-"			set label [$m entrycget $i -label]\n"
-"			set str \"\"\n"
-"			if {[info exists helpremote($label)]} {\n"
-"				set str \"(?)\"\n"
-"			} elseif {[info exists helptext($label)]} {\n"
-"				set str \"(?)\"\n"
-"			}\n"
-"			$m add command -label $str \\\n"
-"				-font $ffont \\\n"
-"				-command \"menu_help $label\";\n"
-"\n"
-"			if {$str == \"\"} {\n"
-"				$m entryconfigure end -state disabled\n"
-"			}\n"
-"			set arg \"$m,$i\"\n"
-"#puts \"helplabel: $arg -> $label\"\n"
-"			set helplabel($arg) $label\n"
-"			set j [$m index end]\n"
-"			set arg \"$m,$j\"\n"
-"			set helplabel($arg) $label\n"
-"		}\n"
-"		if {$i == 0} {\n"
-"			$m entryconfigure end -columnbreak 1\n"
-"		}\n"
-"	}\n"
-"\n"
-"	menu_bindings $m\n"
-"}\n"
-"\n"
-"proc make_menu_items {} {\n"
-"	global template \n"
-"	global menu_b menu_m menu_count\n"
-"	global item_opts item_bool item_case item_menu item_entry menu_var unset_str\n"
-"	global item_cascade\n"
-"	global bfont ffont beginner_mode simple_gui_created\n"
-"	global helptext helpremote helplabel\n"
-"\n"
-"	# some tweaks...\n"
-"	if {![info exists menu_var(deny)]} {\n"
-"		set menu_var(deny) 0\n"
-"	}\n"
-"\n"
-"	set case \"\";\n"
-"	set L_casc \"\"\n"
-"	set L_casc_count 0\n"
-"	set L_menus [list]\n"
-"\n"
-"	# Extract the menu items:\n"
-"	foreach line [split $template \"\\n\"] {\n"
-"		if {[regexp {^Row:} $line]} {\n"
-"			continue\n"
-"		}\n"
-"		if {[regexp {^[A-z]} $line]} {\n"
-"			set case [string trim $line]\n"
-"\n"
-"			if {$simple_gui_created} {\n"
-"				set i0 0\n"
-"				#if {$case == \"Misc\"} { # kludge for simple_gui\n"
-"				#	set i0 1\n"
-"				#}\n"
-"				catch {$menu_m($case) delete $i0 end}\n"
-"			}\n"
-"			set menu_count($case) 0\n"
-"			continue;\n"
-"		}\n"
-"\n"
-"		set item [string trim $line]\n"
-"		regsub -all {  *} $item \" \" item\n"
-"		if {$item == \"\"} {\n"
-"			continue;\n"
-"		}\n"
-"		set opts \"\"\n"
-"		if {[regexp {^=} $item]} {\n"
-"			set opts [lindex [split $item] 0]\n"
-"			regsub {^=} $opts \"\" opts\n"
-"			set item [lindex [split $item] 1]\n"
-"		}\n"
-"		if {[regexp {^0} $opts]} {\n"
-"			continue;\n"
-"		}\n"
-"		if {[regexp {:$} $item]} {\n"
-"			set bool 0\n"
-"		} else {\n"
-"			set bool 1\n"
-"		}\n"
-"		regsub {:$} $item {} item\n"
-"\n"
-"		if {$item == \"LOFF\"} {\n"
-"			set L_casc \"\"\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		if {$item == \"-- D\"} {\n"
-"			set beginner_sep 1\n"
-"			set item \"--\"\n"
-"		} else {\n"
-"			set beginner_sep 0\n"
-"		}\n"
-"\n"
-"		set item_opts($item) $opts\n"
-"		set item_case($item) $case\n"
-"		set item_bool($item) $bool\n"
-"		set item_cascade($item) \"\"\n"
-"\n"
-"		if {$L_casc == \"\"} {\n"
-"			set item_entry($item) $menu_count($case)\n"
-"			set m $menu_m($case)\n"
-"		} else {\n"
-"			# hack for cascades for crowded menus.  See =GAL opts.\n"
-"			set item_entry($item) $L_casc_count\n"
-"			set m $L_casc\n"
-"		}\n"
-"\n"
-"		set mvar 0 \n"
-"\n"
-"		if {$beginner_mode && ! $beginner_sep && ![opt_match D $item]} {\n"
-"			set item_entry($item) \"-1\"\n"
-"			continue;\n"
-"		}\n"
-"\n"
-"		set item_menu($item) $m\n"
-"\n"
-"		if {0} { puts \"ITEM: $item\\t- $opts\\t- $case\\t- \\\n"
-"			$bool\\t- $menu_count($case)\" }\n"
-"\n"
-"		# Create the menu items, its variables, etc., etc.\n"
-"\n"
-"		if {$item == \"--\"} {\n"
-"			$m add separator\n"
-"\n"
-"		} elseif {$item == \"Quit\"} {\n"
-"			# Quit item must shut us down:\n"
-"			$m add command -label \"$item\" -underline 0 \\\n"
-"				-font $ffont \\\n"
-"				-command {destroy .; exit 0}\n"
-"\n"
-"		} elseif {$case == \"Help\"} {\n"
-"			# Help is simple help:\n"
-"			$m add command -label \"$item\" \\\n"
-"				-font $ffont \\\n"
-"				-command \"menu_help $item\"\n"
-"\n"
-"		} elseif {[opt_match L $item]} {\n"
-"			# Special sub-menu cascade (=GAL ends with LOFF)\n"
-"			set subm $m.casc_L$menu_count($case)\n"
-"			catch {destroy $subm}\n"
-"			menu $subm -tearoff 0 -font $ffont\n"
-"			set item_cascade($item) $subm\n"
-"			$m add cascade -label \"$item\" \\\n"
-"				-font $ffont \\\n"
-"				-menu $subm\n"
-"			set L_casc $subm\n"
-"			set L_casc_count -1\n"
-"			lappend L_menus $L_casc\n"
-"\n"
-"		} elseif {$item == \"current\"} {\n"
-"			# Current clients cascade\n"
-"			set subm $m.current_cascade\n"
-"			catch {destroy $subm}\n"
-"			set item_cascade($item) $subm\n"
-"			update_clients_menu \"INIT\"\n"
-"			$m add cascade -label \"$item\" \\\n"
-"				-font $ffont \\\n"
-"				-menu $subm\n"
-"\n"
-"		} elseif {[is_action $item]} {\n"
-"			# Action\n"
-"			$m add command -label \"$item\" \\\n"
-"				-font $ffont \\\n"
-"				-command \"do_var $item\"\n"
-"			if {![info exists menu_var($item)]} {\n"
-"				set menu_var($item) \"\";	# for convenience\n"
-"			}\n"
-"\n"
-"		} elseif {! $item_bool($item)} {\n"
-"			# String\n"
-"			if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {\n"
-"				# Radiobutton select\n"
-"				set subm $m.radio_cascade$menu_count($case)\n"
-"				catch {destroy $subm}\n"
-"				menu $subm -tearoff 0 -font $ffont\n"
-"				foreach val [split $m1 \",\"] {\n"
-"					$subm add radiobutton -label \"$val\" \\\n"
-"						-command \"do_var $item\" \\\n"
-"						-value \"$val\" \\\n"
-"						-font $ffont \\\n"
-"						-variable menu_var($item)\n"
-"				}\n"
-"				$m add cascade -label \"$item\" \\\n"
-"					-font $ffont \\\n"
-"					-menu $subm\n"
-"				set item_cascade($item) $subm\n"
-"			} else {\n"
-"				# Arbitrary_string\n"
-"				$m add command -label \"$item\" \\\n"
-"					-font $ffont \\\n"
-"					-command \"do_var $item\"\n"
-"			}\n"
-"			set mvar 1\n"
-"\n"
-"		} elseif {$item == \"simple-gui\"} {\n"
-"			$m add checkbutton -label \"$item\" \\\n"
-"				-command \"toggle_simple_gui\" \\\n"
-"				-font $ffont \\\n"
-"				-variable beginner_mode\n"
-"		} else {\n"
-"			# Boolean\n"
-"			$m add checkbutton -label \"$item\" \\\n"
-"				-command \"do_var $item\" \\\n"
-"				-font $ffont \\\n"
-"				-variable menu_var($item)\n"
-"			if {![info exists menu_var($item)]} {\n"
-"				set menu_var($item) 0\n"
-"			}\n"
-"		}\n"
-"\n"
-"		if {$L_casc_count == -1} {\n"
-"			incr menu_count($case)\n"
-"			incr L_casc_count\n"
-"		} elseif {$L_casc != \"\"} {\n"
-"			incr L_casc_count\n"
-"		} else {\n"
-"			incr menu_count($case)\n"
-"		}\n"
-"\n"
-"		if {$mvar} {\n"
-"			if {![info exists menu_var($item)]} {\n"
-"				set menu_var($item) $unset_str\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"\n"
-"	# Now make the little \"(?)\" help buttons\n"
-"	global osname\n"
-"	foreach case [array names menu_m] {\n"
-"		if {$case == \"Help\"} {\n"
-"			continue;\n"
-"		}\n"
-"		little_qs $menu_m($case);\n"
-"	}\n"
-"	foreach m $L_menus {\n"
-"		little_qs $m\n"
-"	}\n"
-"}\n"
-"\n"
-"proc check_update_vars {} {\n"
-"	global last_query_all_time query_all_freq icon_mode\n"
-"	global connected_to_x11vnc client_tail client_sock\n"
-"\n"
-"	set now [clock seconds]\n"
-"\n"
-"	set delay $query_all_freq\n"
-"	if {$client_tail != \"\" && $client_sock == \"\"} {\n"
-"		set delay [expr 2 * $query_all_freq]\n"
-"	}\n"
-"\n"
-"	if {$connected_to_x11vnc} {\n"
-"		set quiet 0\n"
-"		set refresh [expr \"$last_query_all_time + $delay\"]\n"
-"\n"
-"		# puts \"menu_posted $now $last_query_all_time\"\n"
-"		# puts \"menu_posted $refresh\"\n"
-"\n"
-"		if {$now > $refresh} {\n"
-"			append_text \"Refreshing current settings... \"\n"
-"			query_all $quiet\n"
-"			if {$quiet} {\n"
-"				append_text \"done\\n\"\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc menu_posted {} {\n"
-"	check_update_vars\n"
-"}\n"
-"\n"
-"proc props_widgets {state} {\n"
-"	global props_buttons\n"
-"	foreach w $props_buttons {\n"
-"		$w configure -state $state	\n"
-"	}\n"
-"	update\n"
-"}\n"
-"\n"
-"proc props_apply {} {\n"
-"	global props_accept props_confirm props_viewonly props_shared \n"
-"	global props_zeroconf props_javaview props_solid\n"
-"	global props_passwd props_viewpasswd\n"
-"	global prop0_accept prop0_confirm prop0_viewonly prop0_shared\n"
-"	global prop0_zeroconf prop0_javaview prop0_solid\n"
-"	global prop0_passwd prop0_viewpasswd\n"
-"	global menu_var\n"
-"	global client_sock\n"
-"\n"
-"	props_widgets disabled\n"
-"\n"
-"	set aft 500\n"
-"	if {[info exists client_sock]} {\n"
-"		if {$client_sock != \"\"} {\n"
-"			set aft 150\n"
-"		}\n"
-"	}\n"
-"	set did 0\n"
-"\n"
-"	set fail 0\n"
-"\n"
-"	if {$props_confirm != $prop0_confirm} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_confirm} {\n"
-"			push_new_value \"accept\" \"accept\" \"popup\" 1\n"
-"		} else {\n"
-"			push_new_value \"accept\" \"accept\" \"\" 1\n"
-"		}\n"
-"		if {$menu_var(accept) == \"popup\"} {\n"
-"			set props_confirm 1\n"
-"		} elseif {$menu_var(accept) == \"\"} {\n"
-"			set props_confirm 0\n"
-"		}\n"
-"		if {$props_confirm == $prop0_confirm} {incr fail}\n"
-"		set prop0_confirm $props_confirm\n"
-"	}\n"
-"\n"
-"	if {$props_viewonly != $prop0_viewonly} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_viewonly} {\n"
-"			push_new_value \"viewonly\" \"viewonly\" 1 1\n"
-"		} else {\n"
-"			push_new_value \"viewonly\" \"noviewonly\" 1 1\n"
-"		}\n"
-"		if {$menu_var(viewonly)} {\n"
-"			set props_viewonly 1\n"
-"		} else {\n"
-"			set props_viewonly 0\n"
-"		}\n"
-"		if {$props_viewonly == $prop0_viewonly} {incr fail}\n"
-"		set prop0_viewonly $props_viewonly\n"
-"	}\n"
-"\n"
-"	if {$props_shared != $prop0_shared} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_shared} {\n"
-"			push_new_value \"shared\" \"shared\" 1 1\n"
-"		} else {\n"
-"			push_new_value \"shared\" \"noshared\" 1 1\n"
-"		}\n"
-"		if {$menu_var(shared)} {\n"
-"			set props_shared 1\n"
-"		} else {\n"
-"			set props_shared 0\n"
-"		}\n"
-"		if {$props_shared == $prop0_shared} {incr fail}\n"
-"		set prop0_shared $props_shared\n"
-"	}\n"
-"\n"
-"	if {$props_zeroconf != $prop0_zeroconf} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_zeroconf} {\n"
-"			push_new_value \"zeroconf\" \"zeroconf\" 1 1\n"
-"		} else {\n"
-"			push_new_value \"zeroconf\" \"nozeroconf\" 1 1\n"
-"		}\n"
-"		if {$menu_var(zeroconf)} {\n"
-"			set props_zeroconf 1\n"
-"		} else {\n"
-"			set props_zeroconf 0\n"
-"		}\n"
-"		if {$props_zeroconf == $prop0_zeroconf} {incr fail}\n"
-"		set prop0_zeroconf $props_zeroconf\n"
-"	}\n"
-"\n"
-"	if {$props_javaview != $prop0_javaview} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_javaview} {\n"
-"			push_new_value \"http\" \"http\" 1 1\n"
-"		} else {\n"
-"			push_new_value \"http\" \"nohttp\" 1 1\n"
-"		}\n"
-"		if {$menu_var(http)} {\n"
-"			set props_javaview 1\n"
-"		} else {\n"
-"			set props_javaview 0\n"
-"		}\n"
-"		if {$props_javaview == $prop0_javaview} {incr fail}\n"
-"		set prop0_javaview $props_javaview\n"
-"	}\n"
-"\n"
-"	if {$props_solid != $prop0_solid} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_solid} {\n"
-"			push_new_value \"solid\" \"solid\" 1 1\n"
-"		} else {\n"
-"			push_new_value \"solid\" \"nosolid\" 1 1\n"
-"		}\n"
-"		if {$menu_var(solid)} {\n"
-"			set props_solid 1\n"
-"		} else {\n"
-"			set props_solid 0\n"
-"		}\n"
-"		if {$props_solid == $prop0_solid} {incr fail}\n"
-"		set prop0_solid $props_solid\n"
-"	}\n"
-"\n"
-"	set fpw 0\n"
-"	if {$props_passwd != $prop0_passwd} {\n"
-"		set fpw 1\n"
-"	}\n"
-"	set vpw 0\n"
-"	if {$props_viewpasswd != $prop0_viewpasswd} {\n"
-"		set vpw 1\n"
-"	}\n"
-"\n"
-"	set pw_ord [list]\n"
-"	if {!$fpw && !$vpw } {\n"
-"		# neither change\n"
-"		;\n"
-"	} elseif {$fpw && !$vpw} {\n"
-"		# full password change\n"
-"		if {$props_passwd == \"\"} {\n"
-"			if {$prop0_viewpasswd != \"\"} {\n"
-"				# set view to \"\" as well and first\n"
-"				set props_viewpasswd \"\"\n"
-"				set pw_ord [list vpw fpw]\n"
-"			} else {\n"
-"				set pw_ord [list fpw]\n"
-"			}\n"
-"		} else {\n"
-"			# assume view state OK\n"
-"			set pw_ord [list fpw]\n"
-"		}\n"
-"		\n"
-"	} elseif {!$fpw && $vpw} {\n"
-"		# view password change\n"
-"		if {$props_viewpasswd == \"\"} {\n"
-"			# assume full state OK\n"
-"			set pw_ord [list vpw]\n"
-"		} else {\n"
-"			if {$prop0_passwd == \"\"} {\n"
-"				# could be trouble, x11vnc makes random\n"
-"				# full passwd...\n"
-"				set pw_ord [list vpw]\n"
-"			} else {\n"
-"				# OK, full non-null.\n"
-"				set pw_ord [list vpw]\n"
-"			}\n"
-"		}\n"
-"	} elseif {$fpw && $vpw} {\n"
-"		# both full and view password change\n"
-"		if {$props_passwd == \"\" && $props_viewpasswd == \"\"} {\n"
-"			# OK, do view first\n"
-"			set pw_ord [list vpw fpw]\n"
-"		} elseif {$props_passwd == \"\" && $props_viewpasswd != \"\"} {\n"
-"			# Not good, do view first anyway x11vnc will fix.\n"
-"			set pw_ord [list vpw fpw]\n"
-"		} elseif {$props_passwd != \"\" && $props_viewpasswd == \"\"} {\n"
-"			# OK, view first\n"
-"			set pw_ord [list vpw fpw]\n"
-"		} elseif {$props_passwd != \"\" && $props_viewpasswd != \"\"} {\n"
-"			# OK, full first\n"
-"			set pw_ord [list fpw vpw]\n"
-"		}\n"
-"	}\n"
-"\n"
-"	foreach case $pw_ord {\n"
-"		if {$case == \"fpw\"} {\n"
-"			if {$did > 0} {after $aft}; incr did\n"
-"			push_new_value \"passwd\" \"passwd\" \"$props_passwd\" 1\n"
-"			if {$props_passwd == $prop0_passwd} {incr fail}\n"
-"			set prop0_passwd $props_passwd\n"
-"		}\n"
-"		if {$case == \"vpw\"} {\n"
-"			if {$did > 0} {after $aft}; incr did\n"
-"			push_new_value \"viewpasswd\" \"viewpasswd\" \"$props_viewpasswd\" 1\n"
-"			if {$props_viewpasswd == $prop0_viewpasswd} {incr fail}\n"
-"			set prop0_viewpasswd $props_viewpasswd\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {$props_accept != $prop0_accept} {\n"
-"		if {$did > 0} {after $aft}; incr did\n"
-"		if {$props_accept} {\n"
-"			push_new_value \"unlock\" \"unlock\" 1 0\n"
-"		} else {\n"
-"			push_new_value \"lock\" \"lock\" 1 0\n"
-"		}\n"
-"		if {$props_accept == $prop0_accept} {incr fail}\n"
-"		set prop0_accept $props_accept\n"
-"	}\n"
-"\n"
-"	props_widgets normal\n"
-"	if {$fail > 0} {\n"
-"		return 0\n"
-"	} else {\n"
-"		return 1\n"
-"	}\n"
-"}\n"
-"\n"
-"proc props_advanced {} {\n"
-"	global icon_mode props_win full_win\n"
-"	global props_advanced_first\n"
-"\n"
-"	if ![info exists props_advanced_first] {\n"
-"		center_win $full_win\n"
-"		set props_advanced_first 1\n"
-"		set first 1\n"
-"	} else {\n"
-"		set first 0\n"
-"	}\n"
-"	update\n"
-"	wm deiconify $full_win\n"
-"	update\n"
-"\n"
-"	if {$first} {\n"
-"		set w $full_win\n"
-"		wm minsize $w [winfo width $w] [winfo height $w]\n"
-"	}\n"
-"	push_new_value \"remote-cmd\" \"remote-cmd\" \"Q:clients\" 1\n"
-"}\n"
-"\n"
-"proc do_props {} {\n"
-"	global props_accept props_confirm props_viewonly props_shared\n"
-"	global props_zeroconf props_javaview props_solid\n"
-"	global props_passwd props_viewpasswd\n"
-"	global prop0_accept prop0_confirm prop0_viewonly prop0_shared\n"
-"	global prop0_zeroconf prop0_javaview prop0_solid\n"
-"	global prop0_passwd prop0_viewpasswd\n"
-"	global menu_var unset_str\n"
-"	global have_labelframes ffont bfont\n"
-"	global props_buttons icon_noadvanced\n"
-"	global icon_mode icon_mode_at_startup\n"
-"	global screen_height screen_width\n"
-"	global do_props_msg\n"
-"\n"
-"	set msg \"\"\n"
-"	if {[info exists do_props_msg]} {\n"
-"		set msg $do_props_msg\n"
-"	}\n"
-"\n"
-"	check_update_vars\n"
-"\n"
-"	set pady 0.5m\n"
-"	set pady 0.3m\n"
-"	if {$screen_height <= 360} {\n"
-"		set pady 0m\n"
-"	}\n"
-"\n"
-"	if [info exists menu_var(deny)] {\n"
-"		if {$menu_var(deny) == $unset_str || $menu_var(deny) == 0} {\n"
-"			set props_accept 1\n"
-"		} else {\n"
-"			set props_accept 0\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(deny) 0\n"
-"		set props_accept 1\n"
-"	}\n"
-"	set prop0_accept $props_accept\n"
-"\n"
-"	if [info exists menu_var(accept)] {\n"
-"		if {$menu_var(accept) == $unset_str || $menu_var(accept) == \"\"} {\n"
-"			set props_confirm 0\n"
-"		} else {\n"
-"			set props_confirm 1\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(accept) \"\"\n"
-"		set props_confirm 0\n"
-"	}\n"
-"	set prop0_confirm $props_confirm\n"
-"\n"
-"	if [info exists menu_var(viewonly)] {\n"
-"		if {$menu_var(viewonly) == $unset_str || $menu_var(viewonly) == \"\"} {\n"
-"			set props_viewonly 0\n"
-"		} elseif ($menu_var(viewonly)) {\n"
-"			set props_viewonly 1\n"
-"		} else {\n"
-"			set props_viewonly 0\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(viewonly) 0\n"
-"		set props_viewonly 0\n"
-"	}\n"
-"	set prop0_viewonly $props_viewonly\n"
-"\n"
-"	if [info exists menu_var(shared)] {\n"
-"		if {$menu_var(shared) == $unset_str || $menu_var(shared) == \"\"} {\n"
-"			set props_shared 0\n"
-"		} elseif ($menu_var(shared)) {\n"
-"			set props_shared 1\n"
-"		} else {\n"
-"			set props_shared 0\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(shared) 0\n"
-"		set props_shared 0\n"
-"	}\n"
-"	set prop0_shared $props_shared\n"
-"\n"
-"	if [info exists menu_var(zeroconf)] {\n"
-"		if {$menu_var(zeroconf) == $unset_str || $menu_var(zeroconf) == \"\"} {\n"
-"			set props_zeroconf 0\n"
-"		} elseif ($menu_var(zeroconf)) {\n"
-"			set props_zeroconf 1\n"
-"		} else {\n"
-"			set props_zeroconf 0\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(zeroconf) 0\n"
-"		set props_zeroconf 0\n"
-"	}\n"
-"	set prop0_zeroconf $props_zeroconf\n"
-"\n"
-"	if [info exists menu_var(http)] {\n"
-"		if {$menu_var(http) == $unset_str || $menu_var(http) == \"\"} {\n"
-"			set props_javaview 0\n"
-"		} elseif ($menu_var(http)) {\n"
-"			set props_javaview 1\n"
-"		} else {\n"
-"			set props_javaview 0\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(http) 0\n"
-"		set props_javaview 0\n"
-"	}\n"
-"	set prop0_javaview $props_javaview\n"
-"\n"
-"	if [info exists menu_var(solid)] {\n"
-"		if {$menu_var(solid) == $unset_str || $menu_var(solid) == \"\"} {\n"
-"			set props_solid 0\n"
-"		} elseif ($menu_var(solid)) {\n"
-"			set props_solid 1\n"
-"		} else {\n"
-"			set props_solid 0\n"
-"		}\n"
-"	} else {\n"
-"		set menu_var(solid) 0\n"
-"		set props_solid 0\n"
-"	}\n"
-"	set prop0_solid $props_solid\n"
-"\n"
-"	if ![info exists props_passwd] {\n"
-"		set props_passwd \"\"\n"
-"	}\n"
-"	set prop0_passwd $props_passwd\n"
-"\n"
-"	if ![info exists props_viewpasswd] {\n"
-"		set props_viewpasswd \"\"\n"
-"	}\n"
-"	set prop0_viewpasswd $props_viewpasswd\n"
-"\n"
-"	if [info exists props_buttons] {\n"
-"		catch {unset props_buttons}\n"
-"	}\n"
-"	set props_buttons [list]\n"
-"\n"
-"	set wp .props\n"
-"	set w $wp\n"
-"	catch {destroy $wp}\n"
-"	toplevel $wp\n"
-"	wm title $wp \"x11vnc Properties\"\n"
-"	frame $w.lf\n"
-"	set w $w.lf\n"
-"	set b1 \"$w.buttons1\"\n"
-"	frame $b1\n"
-"	button $b1.ok -text OK -command \"if {\\[props_apply\\]} {destroy $wp}\" -font $bfont\n"
-"	button $b1.cancel -text Cancel -command \"destroy $wp\" -font $bfont\n"
-"	button $b1.apply  -text Apply -command \"props_apply\" -font $bfont\n"
-"\n"
-"	bind $w <KeyPress-Escape> \"destroy $wp\"\n"
-"\n"
-"	pack $b1.ok $b1.cancel $b1.apply -side left -expand 0\n"
-"	lappend props_buttons $b1.apply $b1.cancel $b1.ok\n"
-"\n"
-"	set b2 \"$w.buttons2\"\n"
-"	frame $b2\n"
-"\n"
-"	button $b2.advanced -text \" Advanced ... \" \\\n"
-"		-command \"destroy $wp; props_advanced\" -font $bfont\n"
-"	if {! $icon_noadvanced} {\n"
-"		lappend props_buttons $b2.advanced\n"
-"		pack $b2.advanced -side left -expand 0\n"
-"	}\n"
-"\n"
-"	button $b2.help -text \"  Help  \" -command \"menu_help Properties\" -font $bfont\n"
-"	lappend props_buttons $b2.help\n"
-"	pack $b2.help -side left -expand 0\n"
-"\n"
-"	set pw \"$w.passwd\"\n"
-"	if {$have_labelframes} {\n"
-"		labelframe $pw -text \"Password\" -font $bfont\n"
-"	} else {\n"
-"		frame $pw\n"
-"		set l $pw.l\n"
-"		label $l -text \"Password:\" -justify left -anchor w -font $bfont\n"
-"		pack $pw.l -fill x -expand 1 -padx 1m -pady 0m -side top\n"
-"	}\n"
-"	entry $pw.e -show \"*\" -textvariable props_passwd -font $bfont\n"
-"	pack $pw.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
-"\n"
-"	global x11vnc_icon_mode\n"
-"	if {! $x11vnc_icon_mode} {\n"
-"		catch { $pw.e configure -state disabled}\n"
-"		if {! $have_labelframes} {\n"
-"			catch { $pw.l configure -state disabled}\n"
-"		}\n"
-"	} else {\n"
-"		lappend props_buttons $pw.e\n"
-"	}\n"
-"\n"
-"\n"
-"	set vp \"$w.viewpw\"\n"
-"	if {$have_labelframes} {\n"
-"		labelframe $vp -text \"ViewOnly Password\" -font $bfont\n"
-"	} else {\n"
-"		frame $vp\n"
-"		set l $vp.l\n"
-"		label $l -text \"ViewOnly Password:\" -justify left -anchor w -font $bfont\n"
-"		pack $vp.l -fill x -expand 1 -padx 1m -pady 0m -side top\n"
-"	}\n"
-"	entry $vp.e -show \"*\" -textvariable props_viewpasswd -font $bfont\n"
-"	pack $vp.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
-"\n"
-"	if {! $x11vnc_icon_mode} {\n"
-"		catch { $vp.e configure -state disabled}\n"
-"		if {! $have_labelframes} {\n"
-"			catch { $vp.l configure -state disabled}\n"
-"		}\n"
-"	} else {\n"
-"		lappend props_buttons $vp.e\n"
-"	}\n"
-"\n"
-"	if {! $icon_mode_at_startup} {\n"
-"		$vp.e configure -state disabled\n"
-"		catch {$vp.l configure -state disabled}\n"
-"		catch {$vp configure -state disabled}\n"
-"		catch {$vp configure -foreground grey60}\n"
-"		$pw.e configure -state disabled\n"
-"		catch {$pw.l configure -state disabled}\n"
-"		catch {$pw configure -state disabled}\n"
-"		catch {$pw configure -foreground grey60}\n"
-"	}\n"
-"\n"
-"	set sb \"$w.solid\"\n"
-"	frame $sb\n"
-"	checkbutton $sb.button -text \"Solid Background Color\" \\\n"
-"		-variable props_solid -anchor w -font $bfont\n"
-"	pack $sb.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set jv \"$w.javaview\"\n"
-"	frame $jv\n"
-"	checkbutton $jv.button -text \"Serve Java Viewer Applet\" \\\n"
-"		-variable props_javaview -anchor w -font $bfont\n"
-"	pack $jv.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set zc \"$w.zeroconf\"\n"
-"	frame $zc\n"
-"	checkbutton $zc.button -text \"Advertise Service (Zeroconf)\" \\\n"
-"		-variable props_zeroconf -anchor w -font $bfont\n"
-"	pack $zc.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set sh \"$w.shared\"\n"
-"	frame $sh\n"
-"	checkbutton $sh.button -text \"Shared\" \\\n"
-"		-variable props_shared -anchor w -font $bfont\n"
-"	pack $sh.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set vo \"$w.viewonly\"\n"
-"	frame $vo\n"
-"	checkbutton $vo.button -text \"All Clients ViewOnly\" \\\n"
-"		-variable props_viewonly -anchor w -font $bfont\n"
-"	pack $vo.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set cf \"$w.confirm\"\n"
-"	frame $cf\n"
-"	checkbutton $cf.button -text \"Ask for Confirmation\" \\\n"
-"		-variable props_confirm -anchor w -font $bfont\n"
-"	pack $cf.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set ac \"$w.accept\"\n"
-"	frame $ac\n"
-"	checkbutton $ac.button -text \"Accept Connections\" \\\n"
-"		-variable props_accept -anchor w -font $bfont\n"
-"	pack $ac.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"\n"
-"	set px \"6m\"\n"
-"	pack $b1 -side bottom -fill x -pady $pady -padx $px\n"
-"	pack $b2 -side bottom -fill x -pady $pady -padx $px\n"
-"	pack $vp -side bottom -fill x -pady $pady -padx $px\n"
-"	pack $pw -side bottom -fill x -pady $pady -padx $px\n"
-"	pack $sb -side bottom -fill x -pady 0m -padx $px\n"
-"	pack $jv -side bottom -fill x -pady 0m -padx $px\n"
-"	pack $zc -side bottom -fill x -pady 0m -padx $px\n"
-"	pack $sh -side bottom -fill x -pady 0m -padx $px\n"
-"	pack $vo -side bottom -fill x -pady 0m -padx $px\n"
-"	pack $cf -side bottom -fill x -pady 0m -padx $px\n"
-"	pack $ac -side bottom -fill x -pady 0m -padx $px\n"
-"\n"
-"	global show_props_instructions\n"
-"	if {![info exists show_props_instructions]} {\n"
-"		set show_props_instructions 1\n"
-"	}\n"
-"\n"
-"	wm withdraw .props\n"
-"\n"
-"	set wl $w\n"
-"\n"
-"	pack $wl -side left\n"
-"\n"
-"	if {$msg != \"\"} {\n"
-"		set tw [textwidth $msg]\n"
-"		set th [textheight $msg]\n"
-"		set th [expr $th - 1]\n"
-"		set ms \".props.msg\"\n"
-"		text $ms -font $ffont -relief ridge -width $tw -height $th\n"
-"		$ms insert 1.0 $msg\n"
-"\n"
-"		set si \"$wl.instructions\"\n"
-"		frame $si\n"
-"		checkbutton $si.button -text \"Show Instructions\" \\\n"
-"			-variable show_props_instructions -anchor w -font $bfont \\\n"
-"			-command \"toggle_instructions $ms $pady $px\"\n"
-"\n"
-"		pack $si.button -fill x -expand 1 -padx 1m -pady $pady\n"
-"		pack $si -side bottom -fill x -pady 0m -padx $px\n"
-"\n"
-"		if {$show_props_instructions} {\n"
-"			pack $ms -side left -fill both\n"
-"		}\n"
-"\n"
-"		update\n"
-"	}\n"
-"\n"
-"\n"
-"	lappend props_buttons $ac.button $cf.button $vo.button $sh.button $zc.button $jv.button $sb.button\n"
-"\n"
-"	\n"
-"	set w .props\n"
-"	update\n"
-"	wm resizable $w 1 0\n"
-"	center_win $w\n"
-"	update\n"
-"\n"
-"	#wm minsize $w [winfo width $w] [winfo height $w]\n"
-"\n"
-"	tkwait window $w\n"
-"	set show_props_instructions 0\n"
-"}\n"
-"\n"
-"proc toggle_instructions {ms pady px} {\n"
-"	global show_props_instructions\n"
-"	if {$show_props_instructions} {\n"
-"		pack $ms -side left -fill both\n"
-"	} else {\n"
-"		pack forget $ms\n"
-"	}\n"
-"	catch {pack .props}\n"
-"	update\n"
-"}\n"
-"\n"
-"proc do_new_client {} {\n"
-"	global newclient ffont bfont\n"
-"\n"
-"	set w .newclient\n"
-"	catch {destroy $w}\n"
-"	toplevel $w\n"
-"	label $w.l -text \"Hostname: \" -font $bfont\n"
-"	set newclient \"\"\n"
-"	entry $w.e -width 16 -textvariable newclient -font $bfont \n"
-"	button $w.b -text OK -command \"destroy $w\" -font $bfont\n"
-"	button $w.h -text Help -command \"menu_help NewClient\" -font $bfont\n"
-"	bind $w.e <Return> \"update; after 100; destroy $w\"\n"
-"\n"
-"	wm title $w \"New Client\"\n"
-"\n"
-"	pack $w.l $w.e $w.h $w.b -side left -pady 1m -padx 0.5m\n"
-"	focus $w.e\n"
-"	center_win $w\n"
-"	update \n"
-"	\n"
-"	tkwait window $w\n"
-"\n"
-"	regsub -all {[{}()~!$&*|;'\"`{}<>\\[\\]]} $newclient \"\" newclient\n"
-"	#'\n"
-"	if {$newclient != \"\"} {\n"
-"		push_new_value \"connect\" \"connect\" \"$newclient\" 1\n"
-"	}\n"
-"}\n"
-"\n"
-"proc do_disconnect_all {} {\n"
-"	push_new_value \"disconnect\" \"disconnect\" \"all\" 1\n"
-"}\n"
-"\n"
-"proc do_disconnect_client {id} {\n"
-"	push_new_value \"disconnect\" \"disconnect\" \"$id\" 1\n"
-"}\n"
-"\n"
-"proc popup_post {m} {\n"
-"	global popup_cascade_posted client_balloon\n"
-"	global client_id_list\n"
-"\n"
-"	set popup_cascade_posted 0\n"
-"	\n"
-"	set wd \"$m.disconnect\"\n"
-"\n"
-"	if {![winfo exists $wd]} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	catch {$wd delete 0 end}\n"
-"\n"
-"	$wd add command -label \"Disconnect client:\"\n"
-"	$wd add separator\n"
-"	$wd add command -label \"All Clients\" -command do_disconnect_all\n"
-"\n"
-"	if {![info exists client_id_list]} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	foreach client $client_id_list {\n"
-"		if {$client == \"\"} {\n"
-"			continue\n"
-"		}\n"
-"		if {[regexp {^([^:]*):(.*)$} $client mat id lab]} {\n"
-"			set nid [expr \"$id + 0\"]\n"
-"			$wd add command -label \"$nid $lab\" \\\n"
-"				-command \"do_disconnect_client $id\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc pmenu {m x y} {\n"
-"	if {![winfo exists $m]} {\n"
-"		return\n"
-"	}\n"
-"	set x [expr $x-10]\n"
-"	set y [expr $y-10]\n"
-"	$m post $x $y\n"
-"	# XXX more care needed\n"
-"	grab set -global $m\n"
-"}\n"
-"\n"
-"proc set_client_balloon {str} {\n"
-"	global client_balloon vnc_display\n"
-"	global client_id_list\n"
-"\n"
-"	set client_id_list [list]\n"
-"	\n"
-"	set client_balloon \"$vnc_display\"\n"
-"	set count 0\n"
-"	regsub -all {^.*aro=clients:} $str \"\" str\n"
-"	regsub -all {aro=.*$} $str \"\" str\n"
-"	regsub -all {ans=.*$} $str \"\" str\n"
-"	foreach client [split $str \",\"] {\n"
-"		#puts \"client: $client\"\n"
-"		if [regexp {^[ 	]*$} $client] {\n"
-"			continue\n"
-"		}\n"
-"		if {[regexp {^(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*):(.*)$} \\\n"
-"		    $client m0 m1 m2 m3 m4 m5 m6 m7 m8 m9]} {\n"
-"			set id    $m1\n"
-"			set nid   [expr \"$m1 + 0\"]\n"
-"			set ip    $m2\n"
-"			set port  $m3\n"
-"			set user  $m4\n"
-"			set unix  $m5\n"
-"			if {[string length $user] >= 24} {\n"
-"				# weird identd hash...\n"
-"				set user [string range $user 0 8]\n"
-"				set user \"${user}...\"\n"
-"			}\n"
-"			if {$unix != \"\" && $unix != \"none\"} {\n"
-"				set user $unix\n"
-"			}\n"
-"			set host  $m6\n"
-"			set input $m7\n"
-"			set vo    $m8\n"
-"			set ltime $m9\n"
-"			if [regexp {^[ 	]*$} $host] {\n"
-"				set host $ip\n"
-"			}\n"
-"			set client_balloon \"${client_balloon}\\n$nid $user\\@$host\"\n"
-"			if {$vo == \"1\"} {\n"
-"				set client_balloon \"${client_balloon} - view\"\n"
-"				lappend client_id_list \"$id:$user\\@$host - view\"\n"
-"			} else {\n"
-"				set client_balloon \"${client_balloon} - full\"\n"
-"				lappend client_id_list \"$id:$user\\@$host - full\"\n"
-"			}\n"
-"		} else {\n"
-"			set i [expr $count+1]\n"
-"			if {$i == 1} {\n"
-"				set client_balloon \"${client_balloon}\\nunknown-host$i\"\n"
-"			}\n"
-"		}\n"
-"		incr count\n"
-"	}\n"
-"	if {$count == 0} {\n"
-"		set client_balloon \"${client_balloon}\\nNo connections.\"\n"
-"	}\n"
-"	icon_win_cfg $count\n"
-"}\n"
-"\n"
-"proc read_client_info {channel} {\n"
-"	global x11vnc_client_file client_str client_info_read\n"
-"	global read_client_info_lock\n"
-"	global read_clients\n"
-"	set db 0\n"
-"\n"
-"	set read_clients 0\n"
-"\n"
-"	if {![info exists read_client_info_lock]} {\n"
-"		set read_client_info_lock 0\n"
-"	}\n"
-"\n"
-"	if {$channel != \"\"} {\n"
-"\n"
-"		if {$read_client_info_lock} {\n"
-"			return\n"
-"		}\n"
-"		set read_client_info_lock 1\n"
-"		after 100\n"
-"		set str \"\"\n"
-"		set count [gets $channel str]\n"
-"		if {$db} {puts stderr \"read_client_info-$channel: $str\"}\n"
-"\n"
-"		if {$count == -1 || [eof $channel]} {\n"
-"			close $channel\n"
-"			catch {file delete $x11vnc_client_file}\n"
-"			set read_client_info_lock 0\n"
-"			clean_icon_exit\n"
-"		}\n"
-"		if {$count > 0 && ![regexp {^[ 	]*$} $str]} {\n"
-"			set client_info_read 1\n"
-"			if {$str == \"quit\"} {\n"
-"				catch {file delete $x11vnc_client_file}\n"
-"				set read_client_info_lock 0\n"
-"				clean_icon_exit\n"
-"			} elseif {$str == \"skip\"} {\n"
-"				;\n"
-"			} elseif [regexp {^clients:} $str] {\n"
-"				regsub {^clients:} $str \"\" str\n"
-"				set read_clients 1\n"
-"				if {$str == \"none\"} {\n"
-"					set str \"\"\n"
-"				}\n"
-"				update_clients_menu $str\n"
-"				set client_str $str\n"
-"				set_client_balloon $str\n"
-"			}\n"
-"		}\n"
-"		set read_client_info_lock 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc check_set_vnc_display {} {\n"
-"	\n"
-"	global read_clients check_set_vnc_display_done\n"
-"\n"
-"	if {[info exists check_set_vnc_display_done]} {\n"
-"		return\n"
-"	}\n"
-"	if {[info exists read_clients]} {\n"
-"		if {$read_clients} {\n"
-"			after 250\n"
-"			query_all\n"
-"			global client_str\n"
-"			set_client_balloon $client_str\n"
-"			set check_set_vnc_display_done 1\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc read_client_tail {} {\n"
-"	global client_tail\n"
-"\n"
-"	if {$client_tail != \"\"} {\n"
-"		read_client_info $client_tail\n"
-"		check_set_vnc_display\n"
-"	}\n"
-"}\n"
-"\n"
-"proc read_client_sock {} {\n"
-"	global client_sock\n"
-"\n"
-"	if {$client_sock != \"\"} {\n"
-"		read_client_info $client_sock\n"
-"		check_set_vnc_display\n"
-"	}\n"
-"}\n"
-"\n"
-"proc show_client_balloon {} {\n"
-"	global icon_mode icon_win props_win full_win\n"
-"	global client_balloon ffont connected_to_x11vnc\n"
-"\n"
-"	set noinfo \"tkx11vnc: no client information\"\n"
-"	set noinfo \"$noinfo\\navailable from x11vnc ...\"\n"
-"	if ![info exists client_balloon] {\n"
-"		set client_balloon $noinfo\n"
-"	}\n"
-"	if {$client_balloon == \"\"} {\n"
-"		set client_balloon $noinfo\n"
-"	}\n"
-"	if {! [info exists icon_win]} {\n"
-"		return\n"
-"	} elseif {$icon_win == \"\"} {\n"
-"		return\n"
-"	} elseif {! [winfo exists $icon_win]} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	set x [expr [winfo rootx $icon_win] + ([winfo width $icon_win]/2)]\n"
-"	set y [expr [winfo rooty $icon_win] + [winfo height $icon_win] + 4]\n"
-"\n"
-"	set infotext $client_balloon\n"
-"	if {!$connected_to_x11vnc} {\n"
-"		set infotext \"Not currently attached to x11vnc\\nLast available info:\\n$infotext\"\n"
-"	}\n"
-"\n"
-"	set w .client_balloon\n"
-"	catch {destroy $w}\n"
-"	toplevel $w -bg black -screen [winfo screen $icon_win]\n"
-"	wm overrideredirect $w 1\n"
-"	label $w.l -text \"$infotext\" -relief flat -bg \"#ffffaa\" -fg black \\\n"
-"		-padx 2 -pady 0 -anchor w -justify left -font $ffont\n"
-"	pack $w.l -side left -padx 1 -pady 1\n"
-"\n"
-"	set w2 [winfo reqwidth  $w.l]\n"
-"	set h2 [winfo reqheight $w.l]\n"
-"\n"
-"	set W [winfo screenwidth  $w]\n"
-"	set H [winfo screenheight $w]\n"
-"\n"
-"	if {[expr $x+$w2] > $W} {\n"
-"		set w3 [winfo width $icon_win]\n"
-"		set x [expr \"$W - $w2 - $w3 - 4\"] \n"
-"	}\n"
-"	if {[expr $y+$h2] > $H} {\n"
-"		set h3 [winfo height $icon_win]\n"
-"		set y [expr \"$H - $h2 - $h3 - 4\"] \n"
-"	}\n"
-"\n"
-"	wm geometry $w +${x}+${y}\n"
-"}\n"
-"\n"
-"proc kill_client_balloon {} {\n"
-"	global client_balloon_id client_balloon_win\n"
-"	if [info exists client_balloon_id] {\n"
-"		catch {after cancel $client_balloon_id}\n"
-"	}\n"
-"	if [winfo exists .client_balloon] {\n"
-"		destroy .client_balloon\n"
-"	}\n"
-"}\n"
-"\n"
-"proc icon_win_cfg {clients} {\n"
-"	global icon_win client_tail client_sock client_info_read\n"
-"\n"
-"	if {! [info exists icon_win]} {\n"
-"		return\n"
-"	} elseif {$icon_win == \"\"} {\n"
-"		return\n"
-"	} elseif {! [winfo exists $icon_win]} {\n"
-"		return\n"
-"	}\n"
-"	if {$clients > 0} {\n"
-"		$icon_win configure -bg black -fg white\n"
-"	} else {\n"
-"		$icon_win configure -bg white -fg black\n"
-"	}\n"
-"\n"
-"	if {$client_tail == \"\" || !$client_info_read} {\n"
-"		if {$client_sock == \"\"} {\n"
-"			$icon_win configure -fg red\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc server_accept {sock addr port} {\n"
-"	global socket_cookie server socket_got_callback\n"
-"	global client_tail client_sock\n"
-"	set db 0\n"
-"\n"
-"	if {$db} {puts stderr \"sock=$sock addr=$addr port=$port\"}\n"
-"\n"
-"	update; update idletasks\n"
-"	after 50\n"
-"	update; update idletasks\n"
-"	set count [gets $sock str]\n"
-"\n"
-"	if {$count >= 0} {\n"
-"		set str [string trim $str]\n"
-"		if {$db} {puts stderr \"server_accept: \\\"$str\\\"\"}\n"
-"		if {$str == \"COOKIE:$socket_cookie\"} {\n"
-"			set client_sock $sock\n"
-"			if {$db} {puts stderr \"cookie matched. $client_sock\"}\n"
-"		} else {\n"
-"			if {$db} {puts stderr \"cookie NO matched.\"}\n"
-"		}\n"
-"	}\n"
-"	catch {close $server}\n"
-"	set socket_got_callback 1\n"
-"	if {$db} {puts stderr \"socket_got_callback $socket_got_callback\"}\n"
-"}\n"
-"\n"
-"proc try_client_info_sock {} {\n"
-"	global socket_cookie server socket_got_callback\n"
-"	global x11vnc_started x11vnc_xdisplay hostname client_sock\n"
-"	global x11vnc_xdisplay0 menu_var\n"
-"\n"
-"	set db 0\n"
-"#dtime t1\n"
-"	set start 13037\n"
-"	set tries 100\n"
-"	set socket_got_callback 0\n"
-"\n"
-"	set xd $x11vnc_xdisplay\n"
-"	if {$xd == \"\" && $x11vnc_xdisplay0 != \"\"} {\n"
-"		set xd $x11vnc_xdisplay0\n"
-"	}\n"
-"	if {$xd == \"\" && [info exists menu_var(display)]} {\n"
-"		set xd $menu_var(display)\n"
-"	}\n"
-"\n"
-"	set myaddr \"\"\n"
-"	regsub {\\..*$} $hostname \"\" shost\n"
-"	if {$x11vnc_started} {\n"
-"		set myaddr \"127.0.0.1\"\n"
-"	} elseif {$xd != \"\"} {\n"
-"		if {[regexp {^:} $xd]} {\n"
-"			set myaddr \"127.0.0.1\"\n"
-"		} elseif {[regexp -nocase \"^$shost\" $xd]} {\n"
-"			set myaddr \"127.0.0.1\"\n"
-"		} elseif {[regexp -nocase \"^localhost\" $xd]} {\n"
-"			set myaddr \"127.0.0.1\"\n"
-"		} else {\n"
-"			set myaddr $hostname\n"
-"		}\n"
-"	} else {\n"
-"		set myaddr $hostname\n"
-"	}\n"
-"	\n"
-"	for {set i 0} {$i <= $tries} {incr i} {\n"
-"		set port [expr $start + $i]\n"
-"		set server [socket -server server_accept -myaddr $myaddr $port]\n"
-"		if {$server == \"\"} {\n"
-"			continue\n"
-"		}\n"
-"		if {[eof $server]} {\n"
-"			continue\n"
-"		}\n"
-"		set err \"\"\n"
-"		catch {set err [fconfigure $server -error]}\n"
-"		#puts \"err: $server: $err\"\n"
-"		if {$err == \"\"} {\n"
-"			break\n"
-"		}\n"
-"	}\n"
-"	if {$server == \"\"} {\n"
-"		append_text \"try_client_info_sock: server socket failed.\\n\"\n"
-"		return\n"
-"	}\n"
-"	if {! $x11vnc_started} {\n"
-"		run_remote_cmd [list \"-nosync\" \"-R\" \"noop\"]\n"
-"		if {$db} {dtime A}\n"
-"		after 250\n"
-"		if {$db} {dtime A}\n"
-"	}\n"
-"\n"
-"	# set the cookie to some obscured randomness\n"
-"	set socket_cookie [clock clicks]\n"
-"	set r [expr rand()]\n"
-"	if {$r != \"\"} {\n"
-"		append socket_cookie $r\n"
-"	}\n"
-"	set r \"\"\n"
-"	catch {set r [winfo id .]}\n"
-"	if {$r != \"\"} {\n"
-"		append socket_cookie $r\n"
-"	}\n"
-"	if {[regexp {([0-9])([0-9])$} [clock clicks] m m1 m2]} {\n"
-"		regsub -all {\\.} $socket_cookie $m1 socket_cookie\n"
-"		regsub -all {x}  $socket_cookie $m2 socket_cookie\n"
-"	}\n"
-"	run_remote_cmd [list \"-nosync\" \"-R\" \\\n"
-"		\"client_info_sock:$myaddr:$port:$socket_cookie\"]\n"
-"#dtime t2\n"
-"	if {$db} {puts \"client_info_sock:$myaddr:$port:$socket_cookie\"}\n"
-"	for {set i 0} {$i < 10} {incr i} {\n"
-"		after 50\n"
-"		update; update idletasks\n"
-"#dtime aa\n"
-"		if {$socket_got_callback != 0} {\n"
-"#puts \"break-\"\n"
-"			break\n"
-"		}\n"
-"	}\n"
-"#dtime t3\n"
-"\n"
-"	set aftid \"\"\n"
-"	if {$socket_got_callback == 0} {\n"
-"		set aftid [after 10000 {set socket_got_callback 2}]\n"
-"		tkwait variable socket_got_callback\n"
-"	}\n"
-"\n"
-"	if {$aftid != \"\"} {\n"
-"		catch {after cancel $aftid}\n"
-"	}\n"
-"\n"
-"	if {$socket_got_callback != 1} {\n"
-"		puts stderr \"try_client_info_sock failed: no callback\\n\"\n"
-"		catch {close $server}\n"
-"	} else {\n"
-"		setup_client_sock 1\n"
-"	}\n"
-"#dtime t4\n"
-"}\n"
-"\n"
-"proc set_icon_label {} {\n"
-"	global icon_win\n"
-"\n"
-"	set lab [get_icon_label]\n"
-"\n"
-"	if {! [info exists icon_win]} {\n"
-"		return\n"
-"	} elseif {$icon_win == \"\"} {\n"
-"		return\n"
-"	} elseif {! [winfo exists $icon_win]} {\n"
-"		return\n"
-"	}\n"
-"	\n"
-"	if {[info exists icon_win]} {\n"
-"		$icon_win configure -text $lab\n"
-"	}\n"
-"}\n"
-"\n"
-"proc get_icon_label {{set 0}} {\n"
-"	global icon_minimal \n"
-"\n"
-"	set lab0 \"x11\\nvnc\"\n"
-"	\n"
-"	if {$icon_minimal} {\n"
-"		set lab [get_vnc_display_number]\n"
-"		if {$lab != \"none\"} {\n"
-"			#set lab \"  :$lab\"\n"
-"			set lab \":$lab\"\n"
-"		} else {\n"
-"			set lab \"-\"\n"
-"		}\n"
-"	} else {\n"
-"		set lab $lab0\n"
-"	}\n"
-"	return $lab\n"
-"}\n"
-"\n"
-"# currently unused\n"
-"proc lmenu {menu} {\n"
-"	global popup_cascade_posted\n"
-"	global left_iconwin_menu\n"
-"	set left_iconwin_menu 1\n"
-"	after 100\n"
-"	update\n"
-"	if {!$popup_cascade_posted && $left_iconwin_menu} {\n"
-"		for {set i 0} {$i < 3} {incr i} {\n"
-"			after 100\n"
-"			update\n"
-"		}\n"
-"		if {!$popup_cascade_posted && $left_iconwin_menu} {\n"
-"			$menu unpost\n"
-"			return\n"
-"		}\n"
-"	}\n"
-"	# kludge for WindowView\n"
-"	if {$popup_cascade_posted} {\n"
-"		focus $menu\n"
-"	}\n"
-"}\n"
-"\n"
-"proc old_balloon {} {\n"
-"	global client_str saved_clients_str\n"
-"	set str \"\"\n"
-"	if {[info exists client_str]} {\n"
-"		if {$client_str != \"\"} {\n"
-"			set str $client_str\n"
-"		}\n"
-"	}\n"
-"	if {$str == \"\"} {\n"
-"		if {[info exists saved_clients_str]} {\n"
-"			set str $saved_clients_str\n"
-"		}\n"
-"	}\n"
-"	if {$str != \"\"} {\n"
-"		set_client_balloon $str\n"
-"	}\n"
-"}\n"
-"\n"
-"proc get_custom_menu_items {} {\n"
-"	global env custom_last_read\n"
-"\n"
-"	if {![info exists custom_last_read]} {\n"
-"		set custom_last_read 0\n"
-"	}\n"
-"	if {[info exists env(X11VNC_CUSTOM_GUI)]} {\n"
-"		set custom \"$env(X11VNC_CUSTOM_GUI)\"\n"
-"	} elseif {![info exists env(HOME)]} {\n"
-"		return [list \"none\"]\n"
-"	} else {\n"
-"		set custom \"$env(HOME)/.x11vnc.gui\"\n"
-"	}\n"
-"	if {![file exists $custom]} {\n"
-"		return [list \"none\"]\n"
-"	}\n"
-"\n"
-"#	if {[file mtime $custom] <= $custom_last_read} {\n"
-"#		return [list \"nochange\"]\n"
-"#	}\n"
-"\n"
-"	set in \"\"\n"
-"	catch {set in [open $custom \"r\"]} \n"
-"	if {$in == \"\"} {\n"
-"		return [list \"none\"]\n"
-"	}\n"
-"\n"
-"	set custom_last_read [clock seconds]\n"
-"\n"
-"	set count 0\n"
-"	while {[gets $in line] > -1} {\n"
-"		if {[regexp {^[ \\t]*#} $line]} {\n"
-"			continue\n"
-"		}\n"
-"		set line [string trim $line]\n"
-"		if {$line != \"\"} {\n"
-"			lappend items $line\n"
-"			incr count\n"
-"		}\n"
-"	}\n"
-"	close $in\n"
-"	\n"
-"	if {$count > 0} {\n"
-"		return $items\n"
-"	} else {\n"
-"		return [list \"none\"]\n"
-"	}\n"
-"}\n"
-"\n"
-"proc make_custom_menu {menu font} {\n"
-"	set items [get_custom_menu_items]\n"
-"	set i0 [lindex $items 0]\n"
-"	catch {$menu delete 0 end}\n"
-"	if {$i0 != \"none\"} {\n"
-"		$menu add command -font $font -label \"Custom items:\"\n"
-"		$menu add separator\n"
-"		foreach item $items {\n"
-"			if {$item == \"sep\" || $item == \"separator\"} {\n"
-"				$menu add separator\n"
-"				continue\n"
-"			}\n"
-"			if {[regexp {^action:(.*)$} $item m action]} {\n"
-"				$menu add command -font $font -label \"$action\" \\\n"
-"				    -command \"do_var $action\"\n"
-"				continue\n"
-"			}\n"
-"			$menu add command -font $font -label \"$item\" \\\n"
-"		 	    -command \"run_remote_cmd \\[list \\\"-R\\\" \\\"$item\\\"\\]\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc make_icon {} {\n"
-"	global icon_mode icon_embed_id icon_win props_win full_win\n"
-"	global tray_embed tray_running env\n"
-"	global x11vnc_client_file client_tail client_sock client_str saved_clients_str\n"
-"	global client_balloon_id\n"
-"	global bfont sfont snfont ffont\n"
-"	global icon_minimal gui_start_mode\n"
-"	global popup_cascade_posted menu_var x11vnc_gui_geom\n"
-"	set min_x 24\n"
-"	set min_y 24\n"
-"	\n"
-"	set font $bfont\n"
-"	set mfont $font\n"
-"\n"
-"	if {$tray_embed} {\n"
-"		set font $sfont\n"
-"		set mfont $snfont\n"
-"	}\n"
-"	if {[info exists env(X11VNC_ICON_FONT)]} {\n"
-"		set font $env(X11VNC_ICON_FONT)\n"
-"	}\n"
-"	if {[regexp {([0-9][0-9]*)x([0-9][0-9]*)} $x11vnc_gui_geom m mx my]} {\n"
-"		if {$mx < $min_x} {\n"
-"			set min_x $mx\n"
-"		}\n"
-"		if {$my < $min_y} {\n"
-"			set min_y $my\n"
-"		}\n"
-"	}\n"
-"	wm minsize . $min_x $min_y\n"
-"\n"
-"	if {$tray_embed && $tray_running} {\n"
-"		wm withdraw .\n"
-"	}\n"
-"\n"
-"	set l .icon\n"
-"	set icon_win $l\n"
-"	catch destroy {$icon_win}\n"
-"	if {$icon_minimal} {\n"
-"		set bw 1\n"
-"	} else {\n"
-"		set bw 5\n"
-"	}\n"
-"	set lab [get_icon_label]\n"
-"	label $l -text $lab -borderwidth $bw -font $font\n"
-"	icon_win_cfg 0\n"
-"\n"
-"\n"
-"	set popup_cascade_posted 0\n"
-"	pack $l -fill both -expand 1\n"
-"	set menu \"$l.menu\"\n"
-"	menu $menu -tearoff 0 -postcommand \"popup_post $menu\"\n"
-"	$menu add command -font $mfont -label \"Properties\" -command do_props\n"
-"	$menu add command -font $mfont -label \"Help\" -command \"menu_help Tray\"\n"
-"	$menu add command -font $mfont -label \"Logfile\" -command show_logfile\n"
-"	$menu add separator\n"
-"	$menu add command -font $mfont -label \"New Client\" -command do_new_client\n"
-"\n"
-"	set wd \"$menu.disconnect\"\n"
-"	catch {destroy $wd}\n"
-"	menu $wd -tearoff 0 -font $ffont \\\n"
-"		-postcommand {set popup_cascade_posted 1}\n"
-"	$wd add command -label \"Disconnect client:\"\n"
-"	$wd add separator\n"
-"	$wd add command -label \"All Clients\" -command do_disconnect_all\n"
-"	$menu add cascade -font $mfont -label \"Disconnect:\" -menu $wd\n"
-"\n"
-"	$menu add separator\n"
-"\n"
-"	set wv \"$menu.windowview\"\n"
-"	catch {destroy $wv}\n"
-"	menu $wv -tearoff 0 -font $ffont \\\n"
-"		-postcommand {set popup_cascade_posted 1}\n"
-"	foreach val {full icon tray} {\n"
-"		$wv add radiobutton -label \"$val\" \\\n"
-"			-value \"$val\" -font $ffont \\\n"
-"			-command \"do_var WindowView\" \\\n"
-"			-variable menu_var(WindowView)\n"
-"	}\n"
-"	$menu add cascade -font $mfont -label \"Window View:\" -menu $wv\n"
-"\n"
-"	$menu add command -font $mfont -label \"Dismiss\" -command \"$menu unpost\"\n"
-"	$menu add command -font $mfont -label \"Stop x11vnc\" -command clean_icon_exit\n"
-"\n"
-"	set items [get_custom_menu_items]\n"
-"	set i0 [lindex $items 0]\n"
-"	if {$i0 != \"none\" && $i0 != \"nochange\"} {\n"
-"		$menu add separator\n"
-"		set cm \"$menu.custom\"\n"
-"		catch {destroy $cm}\n"
-"		menu $cm -tearoff 0 -font $ffont \\\n"
-"			-postcommand \"set popup_cascade_posted 1; make_custom_menu $cm $ffont\"\n"
-"		$menu add cascade -font $mfont -label \"Custom:\" -menu $cm\n"
-"	}\n"
-"\n"
-"	bind $icon_win <ButtonRelease-1> \"pmenu $menu %X %Y\"\n"
-"	bind $icon_win <ButtonRelease-3> \"pmenu $menu %X %Y\"\n"
-"	bind $icon_win <Enter> {set client_balloon_id [after 500 show_client_balloon]}\n"
-"	bind $icon_win <Button> {kill_client_balloon}\n"
-"	bind $icon_win <Leave>  {kill_client_balloon}\n"
-"	bind $icon_win <Shift-ButtonRelease-1> {kill_client_balloon; show_client_balloon}\n"
-"	bind $icon_win <ButtonRelease-2> {kill_client_balloon; show_client_balloon}\n"
-"#	bind $menu <Leave> \"lmenu $menu\"\n"
-"#	bind $menu <Enter> \"set left_iconwin_menu 0\"\n"
-"#	bind $menu <KeyPress-Escape> \"$menu unpost\"\n"
-"\n"
-"	bind . <Control-KeyPress-c> {destroy .; exit 0}\n"
-"\n"
-"	if {!$tray_embed || !$tray_running} {\n"
-"		global x11vnc_gui_geom\n"
-"		if {$x11vnc_gui_geom != \"\"} {\n"
-"			set doit 1\n"
-"			if {[regexp {x} $x11vnc_gui_geom]} {\n"
-"				if {$gui_start_mode == \"full\"} {\n"
-"					set doit 0\n"
-"				}\n"
-"			} \n"
-"			if {$doit} {\n"
-"				wm geometry . $x11vnc_gui_geom\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	wm iconname . \"tkx11vnc\"\n"
-"	wm title . \"tkx11vnc\"\n"
-"	update\n"
-"	if {$tray_embed && $tray_running} {\n"
-"		#wm deiconify .;   #  why did we have this???\n"
-"		#after 10000 {wm deiconify .; puts \"reqheight [winfo reqheight .]\"; puts \"reqwidth  [winfo reqwidth  .]\"; puts \"height [winfo height .]\"; puts \"width  [winfo width  .]\"}\n"
-"	} else {\n"
-"		wm deiconify .\n"
-"	}\n"
-"	update\n"
-"\n"
-"#puts \"reqheight [winfo reqheight .]\"\n"
-"#puts \"reqwidth  [winfo reqwidth  .]\"\n"
-"#puts \"height [winfo height .]\"\n"
-"#puts \"width  [winfo width  .]\"\n"
-"#puts \"AAA\"\n"
-"\n"
-"	old_balloon\n"
-"}\n"
-"\n"
-"proc setup_client_channel {} {\n"
-"	global client_sock client_tail\n"
-"\n"
-"# XXX/setup_client_channel\n"
-"	if {$client_sock == \"\" } {\n"
-"		stop_watch on\n"
-"		try_client_info_sock\n"
-"		if {$client_sock == \"\" } {\n"
-"			after 500\n"
-"			try_client_info_sock\n"
-"		}\n"
-"		stop_watch off\n"
-"	}\n"
-"	if {$client_tail == \"\" && $client_sock == \"\"} {\n"
-"		set m \"\\n\"\n"
-"		set m \"${m}tkx11vnc:\\n\"\n"
-"		set m \"${m}\\n\"\n"
-"		set m \"${m}    Warning -- running in icon/tray mode but the\\n\"\n"
-"		set m \"${m}    connected client info channel from x11vnc is\\n\"\n"
-"		set m \"${m}    not working.  The viewer client list and icon\\n\"\n"
-"		set m \"${m}    color indicator will not be accurate.\\n\"\n"
-"		set m \"${m}\\n\"\n"
-"		set m \"${m}    You may need to restart \\\"x11vnc -gui tray ...\\\"\\n\"\n"
-"		set m \"${m}    for this to work properly.\\n\"\n"
-"		set m \"${m}\\n\"\n"
-"		textwin \"Warning\" \"Warning\" $m\n"
-"		update\n"
-"	}\n"
-"	dtime C\n"
-"}\n"
-"\n"
-"proc clean_client_tail {} {\n"
-"	global client_tail client_info_read\n"
-"	if [info exists client_tail] {\n"
-"		if {$client_tail != \"\"} {\n"
-"			set p \"\"\n"
-"			catch {set p [pid $client_tail]}\n"
-"			if {$p != \"\"} {\n"
-"				catch {exec kill -TERM $p >/dev/null 2>/dev/null}\n"
-"			}\n"
-"			catch {close $client_tail}\n"
-"			set client_tail \"\"\n"
-"		}\n"
-"	}\n"
-"	set client_info_read 0\n"
-"}\n"
-"\n"
-"proc clean_icon_exit {} {\n"
-"	clean_client_tail\n"
-"	push_new_value \"stop\" \"stop\" 1 0\n"
-"	set_connected no\n"
-"	update\n"
-"	destroy .\n"
-"	exit\n"
-"}\n"
-"\n"
-"proc make_gui {mode} {\n"
-"	global icon_mode tray_embed tray_running full_win icon_win\n"
-"	global top_widget_names x11vnc_gui_geom\n"
-"	global gui_current_state make_gui_count\n"
-"	global x11vnc_connect connected_to_x11vnc\n"
-"	global x11_display\n"
-"	global gui_start_mode\n"
-"\n"
-"	incr make_gui_count\n"
-"\n"
-"	if {$gui_start_mode == \"\"} {\n"
-"		set gui_start_mode $mode\n"
-"	}\n"
-"\n"
-"	wm withdraw .\n"
-"\n"
-"	set full_geom \"\"\n"
-"	if {[winfo exists .full]} {\n"
-"		catch {set full_geom [wm geometry .full]}\n"
-"	}\n"
-"\n"
-"	set fw .full\n"
-"	set full_win $fw\n"
-"	catch {pack forget $full_win}\n"
-"	catch {pack forget $icon_win}\n"
-"	catch {destroy $full_win}\n"
-"	catch {destroy $icon_win}\n"
-"\n"
-"	wm minsize . 1 1\n"
-"\n"
-"	set gui_current_state \"\"\n"
-"\n"
-"	if {$mode == \"full\"} {\n"
-"		frame $fw\n"
-"		set icon_mode 0\n"
-"\n"
-"		wm protocol .     WM_DELETE_WINDOW \"destroy .; exit\"\n"
-"		make_widgets $fw\n"
-"\n"
-"		set w \".\"\n"
-"		wm geometry $w \"\"\n"
-"		if {$x11vnc_gui_geom != \"\"} {\n"
-"			set doit 1\n"
-"			if {[regexp {x} $x11vnc_gui_geom]} {\n"
-"				if {$gui_start_mode != $mode} {\n"
-"					set doit 0\n"
-"				}\n"
-"			}\n"
-"			if {$doit} {\n"
-"				wm geometry $w $x11vnc_gui_geom\n"
-"			}\n"
-"		}\n"
-"		pack $fw -fill both -expand 1\n"
-"\n"
-"	} elseif {$mode == \"icon\" || $mode == \"tray\"} {\n"
-"\n"
-"		toplevel $fw\n"
-"		wm withdraw $fw\n"
-"\n"
-"		wm protocol $fw WM_DELETE_WINDOW \"wm withdraw .full\"\n"
-"		wm protocol .   WM_DELETE_WINDOW \"clean_icon_exit\"\n"
-"		\n"
-"		if {$mode == \"icon\"} {\n"
-"			set tray_embed 0\n"
-"		} elseif {$mode == \"tray\"} {\n"
-"			set tray_embed 1\n"
-"		}\n"
-"		set icon_mode 1\n"
-"		make_widgets $fw\n"
-"		set w $fw\n"
-"		make_icon\n"
-"		wm geometry $fw \"\"\n"
-"		wm geometry .   \"\"\n"
-"	} else {\n"
-"		return\n"
-"	}\n"
-"	set_view_variable $mode\n"
-"	set gui_current_state $mode\n"
-"\n"
-"\n"
-"	update\n"
-"	if {!$tray_embed || !$tray_running} {\n"
-"		wm deiconify .\n"
-"	}\n"
-"	update idletasks\n"
-"	wm minsize $w [winfo width $w] [winfo height $w]\n"
-"	if {$mode == \"full\" && $make_gui_count > 1} {\n"
-"		center_win .\n"
-"	}\n"
-"\n"
-"\n"
-"	if {$make_gui_count == 1} {\n"
-"		copy_default_vars\n"
-"		if {$x11vnc_connect} {\n"
-"			try_connect_and_query_all\n"
-"		} else {\n"
-"			insert_cmdline_vars\n"
-"		}\n"
-"	} else {\n"
-"		set_name \"RESTORE\"\n"
-"	}\n"
-"\n"
-"	setup_client_tail\n"
-"\n"
-"	set_widgets\n"
-"\n"
-"	if {$mode == \"tray\"} {\n"
-"		setup_tray_embed\n"
-"	}\n"
-"}\n"
-"\n"
-"proc make_widgets {top} {\n"
-"	global template make_gui_count\n"
-"	global menu_b menu_m menu_count\n"
-"	global item_opts item_bool item_case item_menu item_entry menu_var unset_str\n"
-"	global item_cascade\n"
-"	global info_label info_str x11_display vnc_display\n"
-"	global text_area text_area_str\n"
-"	global entry_box entry_str entry_set entry_label entry_ok entry_browse\n"
-"	global entry_help entry_skip\n"
-"	global bfont ffont beginner_mode\n"
-"	global helptext helpremote helplabel\n"
-"	global icon_mode icon_win props_win full_win\n"
-"	global top_widget_names\n"
-"	global screen_height screen_width\n"
-"\n"
-"\n"
-"	# Make the top label\n"
-"	set label_width 84\n"
-"	if {$screen_width <= 400} {\n"
-"		set label_width 64\n"
-"	}\n"
-"	set info_label \"$top.info\"\n"
-"	label $info_label -textvariable info_str -bd 2 -relief groove \\\n"
-"		-anchor w -width $label_width -font $ffont\n"
-"	pack $info_label -side top -fill x -expand 0\n"
-"\n"
-"	set top_widget_names(info) $info_label\n"
-"\n"
-"	# Extract the Rows:\n"
-"	set row 0;\n"
-"	set colmax 0;\n"
-"	foreach line [split $template \"\\n\"] {\n"
-"		if {[regexp {^Row: (.*)} $line rest]} {\n"
-"			set col 0\n"
-"			foreach case [split $rest] {\n"
-"				if {$case == \"\" || $case == \"Row:\"} {\n"
-"					continue\n"
-"				}\n"
-"				set menu_row($case) $row\n"
-"				set menu_col($case) $col\n"
-"\n"
-"				lappend cases($col) $case;\n"
-"				set len [string length $case]\n"
-"				if {[info exists max_len($col)]} {\n"
-"					if {$len > $max_len($col)} {\n"
-"						set max_len($col) $len\n"
-"					}\n"
-"				} else {\n"
-"					set max_len($col) $len\n"
-"				}\n"
-"				incr col\n"
-"				if {$col > $colmax} {\n"
-"					set colmax $col\n"
-"				}\n"
-"			}\n"
-"			incr row;\n"
-"		}\n"
-"	}\n"
-"\n"
-"	# Make frames for the rows and make the menu buttons.\n"
-"	set f \"$top.menuframe\"\n"
-"	frame $f\n"
-"	for {set c 0} {$c < $colmax} {incr c} {\n"
-"		set colf \"$f.menuframe$c\"\n"
-"		frame $colf\n"
-"		pack $colf -side left -fill y\n"
-"		set fbg [$colf cget -background]\n"
-"		foreach case $cases($c) {\n"
-"			set menub \"$colf.menu$case\";\n"
-"			set menu \"$colf.menu$case.menu\";\n"
-"			set menu_b($case) $menub\n"
-"			set menu_m($case) $menu\n"
-"			set ul 0\n"
-"			foreach char [split $case \"\"] {\n"
-"				set char [string tolower $char]\n"
-"				if {![info exists underlined($char)]} {\n"
-"					set underlined($char) 1\n"
-"					break\n"
-"				}\n"
-"				incr ul\n"
-"			}\n"
-"			global osname\n"
-"			set tstr \"$case\"\n"
-"			if {$osname == \"Darwin\"} {\n"
-"				#set tstr \" $case   \"\n"
-"			}\n"
-"			menubutton $menub -text \"$tstr\" -underline $ul \\\n"
-"				-anchor w -menu $menu -background $fbg \\\n"
-"				-font $bfont\n"
-"			pack $menub -side top -fill x\n"
-"			menu $menu -tearoff 0 -postcommand menu_posted\n"
-"		}\n"
-"	}\n"
-"	pack $f -side top -fill x\n"
-"	set top_widget_names(menuframe) $f\n"
-"\n"
-"	make_menu_items\n"
-"\n"
-"	# Make the x11 and vnc display label bar:\n"
-"	set df \"$top.displayframe\"\n"
-"	frame $df -bd 1 -relief groove\n"
-"	set top_widget_names(displayframe) $df\n"
-"\n"
-"	set df_x11 \"$df.xdisplay\"\n"
-"\n"
-"	if {$make_gui_count == 1} {\n"
-"		no_x11_display\n"
-"	}\n"
-"	set lw [expr {$label_width / 2}]\n"
-"	label $df_x11 -textvariable x11_display -width $lw -anchor w \\\n"
-"		-font $ffont\n"
-"\n"
-"	set df_vnc \"$df.vdisplay\"\n"
-"\n"
-"	if {$make_gui_count == 1} {\n"
-"		no_vnc_display\n"
-"	}\n"
-"	label $df_vnc -textvariable vnc_display -width $lw -anchor w \\\n"
-"		-font $ffont\n"
-"\n"
-"	pack $df_x11 $df_vnc -side left \n"
-"	pack $df -side top -fill x\n"
-"\n"
-"	# text area\n"
-"	global text_height\n"
-"	set text_area \"$top.text\"\n"
-"	if {$screen_width <= 400} {\n"
-"		text $text_area -height $text_height -width $label_width \\\n"
-"			-relief ridge -font $ffont\n"
-"	} else {\n"
-"		text $text_area -height $text_height -relief ridge -font $ffont\n"
-"	}\n"
-"	pack $text_area -side top -fill both -expand 1\n"
-"	set top_widget_names(text) $text_area\n"
-"\n"
-"\n"
-"	if {$text_area_str == \"\"} {\n"
-"		set str \"Click Help -> gui for overview.\"\n"
-"		append_text \"\\n$str\\n\\n\"\n"
-"	} else {\n"
-"		append_text $text_area_str\n"
-"	}\n"
-"\n"
-"	# Make entry box stuff\n"
-"	set ef \"$top.entryframe\"\n"
-"	frame $ef -bd 1 -relief groove\n"
-"	set top_widget_names(entryframe) $ef\n"
-"\n"
-"	# Entry Label\n"
-"	set ef_label \"$ef.label\"\n"
-"	label $ef_label -textvariable entry_str -anchor w -font $bfont\n"
-"\n"
-"	set entry_str \"Set... : \"\n"
-"	set ef_entry \"$ef.entry\"\n"
-"	entry $ef_entry -relief sunken -font $ffont\n"
-"	bind $ef_entry <KeyPress-Return> {set entry_set 1}\n"
-"	bind $ef_entry <KeyPress-Escape> {set entry_set 0}\n"
-"\n"
-"	set ok_s \"OK\"\n"
-"	set cancel_s \"Cancel\"\n"
-"	set help_s \"Help\"\n"
-"	set browse_s \"Browse...\"\n"
-"	global osname\n"
-"	if {$osname == \"Darwin\"} {\n"
-"		set ok_s \" OK   \"\n"
-"		set cancel_s \" Cancel   \"\n"
-"		set help_s \" Help   \"\n"
-"		set browse_s \" Browse...   \"\n"
-"	}\n"
-"\n"
-"	# Entry OK button\n"
-"	set bpx \"1m\"\n"
-"	set bpy \"1\"\n"
-"	set hlt \"0\"\n"
-"	set ef_ok \"$ef.ok\"\n"
-"	button $ef_ok -text $ok_s -pady $bpy -padx $bpx -command {set entry_set 1} \\\n"
-"		-highlightthickness $hlt \\\n"
-"		-font $bfont\n"
-"\n"
-"	# Entry Skip button\n"
-"	set ef_skip \"$ef.skip\"\n"
-"	button $ef_skip -text $cancel_s -pady $bpy -padx $bpx -command {set entry_set 0} \\\n"
-"		-highlightthickness $hlt \\\n"
-"		-font $bfont\n"
-"\n"
-"	# Entry Help button\n"
-"	set ef_help \"$ef.help\"\n"
-"	button $ef_help -text $help_s -pady $bpy -padx $bpx -command \\\n"
-"		{menu_help $entry_dialog_item} -font $bfont \\\n"
-"		-highlightthickness $hlt\n"
-"\n"
-"	# Entry Browse button\n"
-"	set ef_browse \"$ef.browse\"\n"
-"	button $ef_browse -text $browse_s -pady $bpy -padx $bpx -font $bfont \\\n"
-"		-highlightthickness $hlt \\\n"
-"		-command {entry_insert [tk_getOpenFile]} \n"
-"\n"
-"	pack $ef_label -side left\n"
-"	pack $ef_entry -side left -fill x -expand 1\n"
-"	pack $ef_ok   -side right\n"
-"	pack $ef_skip -side right\n"
-"	pack $ef_help -side right\n"
-"	pack $ef -side bottom -fill x\n"
-"\n"
-"	set entry_ok $ef_ok\n"
-"	set entry_skip $ef_skip\n"
-"	set entry_help $ef_help\n"
-"	set entry_box $ef_entry\n"
-"	set entry_browse $ef_browse\n"
-"	set entry_label $ef_label\n"
-"	entry_disable\n"
-"\n"
-"}\n"
-"\n"
-"proc menu_bindings {m} {\n"
-"	set db 0\n"
-"	if {$db} {puts \"menu_bindings $m\"}\n"
-"\n"
-"	bind $m <<MenuSelect>> {\n"
-"#syntax hilite bug \\\n"
-"MenuSelect>>\n"
-"		set n [%W index active]\n"
-"		set db 0\n"
-"		if {$db} {puts stderr \"menu_bindings %W $n\"}\n"
-"		set label \"    \"\n"
-"		if {$n != \"none\"} {\n"
-"			set str %W,$n\n"
-"			set which \"\"\n"
-"\n"
-"			if {$db} {puts \"menu_bindings $str\"}\n"
-"			if {[info exists helplabel($str)]} {\n"
-"				set vname [format %%-16s $helplabel($str)]\n"
-"				set label \"Click (?) for help on: $vname\"\n"
-"				set which $helplabel($str)\n"
-"			}\n"
-"			if {$which == \"\"} {\n"
-"				;\n"
-"			} elseif {$which == \"passwd\" || $which == \"viewpasswd\"} {\n"
-"				;\n"
-"			} elseif {[is_action $which]} {\n"
-"				if {[info exists menu_var($which)] \n"
-"				    && $menu_var($which) != \"\"} {\n"
-"					set label \"$label value: $menu_var($which)\"\n"
-"				} else {\n"
-"					set label \"$label (is action)\"\n"
-"				}\n"
-"			} elseif {[info exists menu_var($which)]} {\n"
-"				set label \"$label value: $menu_var($which)\"\n"
-"				if {$which == \"http\"} {\n"
-"					global vnc_url\n"
-"					set label \"$label  URL: $vnc_url\"\n"
-"				}\n"
-"			}\n"
-"		}\n"
-"		set_info $label\n"
-"	}\n"
-"}\n"
-"\n"
-"proc key_bindings {} {\n"
-"	global env menus_disabled\n"
-"	if {[info exists env(USER)] && $env(USER) == \"runge\"} {\n"
-"		# quick restart\n"
-"		bind . <Control-KeyPress-k> {exec $argv0 $argv &; destroy .}\n"
-"	}\n"
-"	bind . <Control-KeyPress-p> { \\\n"
-"		global menus_disabled; \\\n"
-"		if {!$menus_disabled} {try_connect_and_query_all} \\\n"
-"	}\n"
-"	bind . <Control-KeyPress-u> { \\\n"
-"		global menus_disabled; \\\n"
-"		if {!$menus_disabled} {query_all 0} \\\n"
-"	}\n"
-"	bind . <Control-KeyPress-r> { \\\n"
-"		global menus_disabled; \\\n"
-"		if {!$menus_disabled} {query_all 0} \\\n"
-"	}\n"
-"	bind . <Control-KeyPress-d> { \\\n"
-"		global menus_disabled; \\\n"
-"		if {!$menus_disabled} {detach_from_display} \\\n"
-"	}\n"
-"	bind . <Control-KeyPress-a> { \\\n"
-"		global menus_disabled; \\\n"
-"		if {!$menus_disabled} {try_connect_and_query_all} \\\n"
-"	}\n"
-"}\n"
-"\n"
-"proc stop_watch {onoff} {\n"
-"	global orig_cursor text_area entry_box\n"
-"\n"
-"	set widgets [list .]\n"
-"	if [info exists text_area] {\n"
-"		if {$text_area != \"\"} {\n"
-"			lappend widgets $text_area\n"
-"		}\n"
-"	}\n"
-"	if [info exists entry_box] {\n"
-"		if {$entry_box != \"\"} {\n"
-"			lappend widgets $entry_box\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {$onoff == \"on\"} {\n"
-"		foreach item $widgets {\n"
-"			if {![winfo exists $item]} {\n"
-"				continue\n"
-"			}\n"
-"			$item config -cursor {watch}\n"
-"		}\n"
-"	} else {\n"
-"		foreach item $widgets {\n"
-"			if {![winfo exists $item]} {\n"
-"				continue\n"
-"			}\n"
-"			$item config -cursor {}\n"
-"		}\n"
-"	}\n"
-"	update\n"
-"}\n"
-"\n"
-"proc double_check_noremote {} {\n"
-"	set msg \"\\n\\n\"\n"
-"	append msg \"*** WARNING: setting \\\"noremote\\\" will disable ALL remote control commands (i.e.\\n\"\n"
-"	append msg \"*** WARNING: *this* gui will be locked out). Do you really want to do this?\\n\"\n"
-"	append msg \"*** WARNING: If so, press \\\"OK\\\", otherwise press \\\"Cancel\\\"\\n\"\n"
-"	append msg \"\\n\"\n"
-"	bell\n"
-"	return [warning_dialog $msg \"noremote\"]\n"
-"}\n"
-"\n"
-"proc get_settings_rcfile {} {\n"
-"	global menu_var default_var unset_str\n"
-"	global x11vnc_gui_params\n"
-"\n"
-"	set rc_txt \"\"\n"
-"\n"
-"	set menu_var(gui) $x11vnc_gui_params\n"
-"\n"
-"	foreach item [lsort [array names menu_var]] {\n"
-"		if {$item == \"gui\"} {\n"
-"			;\n"
-"		} elseif {![active_when_starting $item]} {\n"
-"			continue\n"
-"		} elseif {[is_action $item]} {\n"
-"			continue\n"
-"		}\n"
-"		if {$item == \"debug_gui\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"WindowView\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"rc\" || $item == \"norc\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"loop\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"loopbg\"} {\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		set def \"\"\n"
-"		if {[info exists default_var($item)]} {\n"
-"			set def $default_var($item)\n"
-"		}\n"
-"\n"
-"\n"
-"		set qst \"\"\n"
-"		set hmm \"#? \"\n"
-"		if {$item == \"display\"} {\n"
-"			set qst $hmm\n"
-"		} elseif {$item == \"desktop\"} {\n"
-"			set qst $hmm\n"
-"		} elseif {$item == \"dontdisconnect\"} {\n"
-"			set qst $hmm\n"
-"		} elseif {$item == \"alwaysshared\"} {\n"
-"			set qst $hmm\n"
-"		} elseif {$item == \"nevershared\"} {\n"
-"			set qst $hmm\n"
-"		} elseif {$item == \"gui\"} {\n"
-"			set qst $hmm\n"
-"		}\n"
-"\n"
-"		if {![info exists menu_var($item)]} {\n"
-"			set mv $def\n"
-"		} else {\n"
-"			set mv $menu_var($item)\n"
-"		}\n"
-"#puts \"item=$item def=$def mv=$mv\"\n"
-"		if {$mv == $unset_str} {\n"
-"			set mv \"\"\n"
-"		}\n"
-"		set ntab 3\n"
-"\n"
-"		if {$item == \"gui\" || [value_is_string $item]} {\n"
-"			set nitem [get_nitem $item]\n"
-"\n"
-"			if {$mv == \"\" && $def != \"\"}  {\n"
-"				set qst $hmm\n"
-"			}\n"
-"			set n 0\n"
-"			if {$qst != \"\"} {\n"
-"				append rc_txt $qst\n"
-"				incr n [string length $qst]\n"
-"			} elseif {$mv == $def} {\n"
-"				append rc_txt \"#d \"\n"
-"				incr n [string length \"#d \"]\n"
-"			}\n"
-"			set mt $mv\n"
-"			regsub -all {#} $mt {\\#} mt\n"
-"			if {$mt == \"\"} {\n"
-"				set mt {\"\"}\n"
-"			}\n"
-"			append rc_txt \"-$nitem $mt\"\n"
-"\n"
-"			if {$mv != $def} {\n"
-"				set m [string length \"-$nitem $mt\"]\n"
-"				incr n $m\n"
-"				set n [expr $n / 8]\n"
-"				set c 0\n"
-"				for {set i $n} {$i <= $ntab} {incr i} {\n"
-"					append rc_txt \"\\t\"\n"
-"					incr c\n"
-"				}\n"
-"				if {$c == 0} {\n"
-"					append rc_txt \"\\t\"\n"
-"				}\n"
-"				regsub -all {#} $def {\\#} def\n"
-"				if {$def == \"\"} {\n"
-"					set def {\"\"}\n"
-"				}\n"
-"				append rc_txt \"# default:  $def\"\n"
-"			}\n"
-"			append rc_txt \"\\n\"\n"
-"\n"
-"		} elseif {[value_is_bool $item]} {\n"
-"			set n 0\n"
-"			if {$qst != \"\"} {\n"
-"				append rc_txt $qst\n"
-"				incr n [string length $qst]\n"
-"			} elseif {$mv == $def} {\n"
-"				append rc_txt \"#d \"\n"
-"				incr n [string length \"#d \"]\n"
-"			}\n"
-"			if {$def == 1} {\n"
-"				set dv \"on\"\n"
-"			} else {\n"
-"				set dv \"off\"\n"
-"			}\n"
-"			append rc_txt \"-$item\"\n"
-"			set m [string length \"-$item\"]\n"
-"			incr n $m\n"
-"			set n [expr $n / 8]\n"
-"			for {set i $n} {$i <= $ntab} {incr i} {\n"
-"				append rc_txt \"\\t\"\n"
-"			}\n"
-"			append rc_txt \"# default: $dv\"\n"
-"			append rc_txt \"\\n\"\n"
-"\n"
-"		}\n"
-"	}\n"
-"	return $rc_txt\n"
-"}\n"
-"\n"
-"proc double_check_start_x11vnc {} {\n"
-"	global hostname\n"
-"	set msg [get_start_x11vnc_txt]\n"
-"	bell\n"
-"	append msg \"\\n\"\n"
-"	append msg \"*** To run the above command on machine \\\"$hostname\\\" (thereby\\n\"\n"
-"	append msg \"*** starting x11vnc) press \\\"OK\\\", otherwise press \\\"Cancel\\\".\\n\"\n"
-"	return [warning_dialog $msg \"start\"]\n"
-"}\n"
-"\n"
-"proc get_start_x11vnc_txt {} {\n"
-"	set cmd [get_start_x11vnc_cmd]\n"
-"	set str [join $cmd]\n"
-"	set msg \"\"\n"
-"	append msg \"\\n\"\n"
-"	append msg \"==== The command built so far is: ====\\n\";\n"
-"	append msg \"\\n\"\n"
-"	append msg \"$str\\n\"\n"
-"	return $msg\n"
-"}\n"
-"\n"
-"proc show_start_cmd {} {\n"
-"	set msg [get_start_x11vnc_txt]\n"
-"	append_text \"$msg\\n\"\n"
-"}\n"
-"\n"
-"proc get_nitem {item} {\n"
-"	set nitem $item\n"
-"	if {$nitem == \"screen_blank\"} {\n"
-"		set nitem \"sb\"\n"
-"	} elseif {$nitem == \"xrandr_mode\"} {\n"
-"		set nitem \"xrandr\"\n"
-"	} elseif {$nitem == \"unixpw_list\"} {\n"
-"		set nitem \"unixpw\"\n"
-"	} elseif {$nitem == \"unixpw_nis_list\"} {\n"
-"		set nitem \"unixpw_nis\"\n"
-"	} elseif {$nitem == \"stunnel_pem\"} {\n"
-"		set nitem \"stunnel\"\n"
-"	} elseif {$nitem == \"ssl_pem\"} {\n"
-"		set nitem \"ssl\"\n"
-"	} elseif {$nitem == \"wireframe_mode\"} {\n"
-"		set nitem \"wireframe\"\n"
-"	} elseif {$nitem == \"solid_color\"} {\n"
-"		set nitem \"solid\"\n"
-"	}\n"
-"	return $nitem\n"
-"}\n"
-"\n"
-"proc get_start_x11vnc_cmd {{show_rc 0}} {\n"
-"	global cmd_var menu_var default_var unset_str x11vnc_prog\n"
-"\n"
-"	set xterm_cmd \"xterm -iconic -geometry 80x35 -title x11vnc-console -e\"\n"
-"\n"
-"	set cmd [split $xterm_cmd]\n"
-"\n"
-"	lappend cmd $x11vnc_prog\n"
-"\n"
-"	lappend cmd \"-gui\"\n"
-"	lappend cmd \"none\"\n"
-"\n"
-"	set rc_txt \"\"\n"
-"\n"
-"	set saw_id 0\n"
-"\n"
-"	foreach item [lsort [array names menu_var]] {\n"
-"		if {$item == \"gui\"} {\n"
-"			continue\n"
-"		} elseif {![active_when_starting $item]} {\n"
-"			continue\n"
-"		} elseif {[is_action $item]} {\n"
-"			continue\n"
-"		} elseif {$item == \"debug_gui\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"WindowView\"} {\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		if {$item == \"id\" || $item == \"sid\"} {\n"
-"			set val $menu_var($item);\n"
-"			if {$val == \"0x0\" || $val == \"root\"} {\n"
-"				continue\n"
-"			}\n"
-"		}\n"
-"		if {$item == \"sid\" && $saw_id} {\n"
-"			continue\n"
-"		}\n"
-"		if {$item == \"id\"} {\n"
-"			set saw_id 1\n"
-"		} elseif {$item == \"httpport\" && $menu_var($item) == \"0\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"progressive\" && $menu_var($item) == \"0\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"dontdisconnect\" && $menu_var($item) == \"-1\"} {\n"
-"			continue\n"
-"		} elseif {$item == \"alwaysshared\" && $menu_var($item) == \"-1\"} {\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		if {[value_is_bool $item]} {\n"
-"			if {[info exists menu_var($item)]} {\n"
-"				set add 1\n"
-"				if {[info exists default_var($item)]} {\n"
-"					if {$menu_var($item) == $default_var($item)} {\n"
-"						set add 0;\n"
-"					}\n"
-"				} elseif {! $menu_var($item)} {\n"
-"					set add 0\n"
-"				}\n"
-"				if {$add} {\n"
-"					lappend cmd \"-$item\"\n"
-"					append rc_txt \"-$item\\n\"\n"
-"				}\n"
-"			}\n"
-"		} elseif {[value_is_string $item]} {\n"
-"			if {![info exists menu_var($item)]} {\n"
-"				continue\n"
-"			}\n"
-"			if {$menu_var($item) != \"\" && $menu_var($item) != $unset_str} {\n"
-"				set add 1\n"
-"				set nitem [get_nitem $item]\n"
-"\n"
-"				if {[info exists default_var($item)]} {\n"
-"					if {$menu_var($item) == $default_var($item)} {\n"
-"						set add 0;\n"
-"					}\n"
-"				}\n"
-"				if {$add} {\n"
-"					lappend cmd \"-$nitem\"\n"
-"					set mv $menu_var($item)\n"
-"\n"
-"					if {[regexp {^~} $mv]}  {\n"
-"						if {$item == \"auth\" ||\n"
-"						    $item == \"rc\" ||\n"
-"						    $item == \"accept\" || \n"
-"						    $item == \"connect\" || \n"
-"						    $item == \"allow\" || \n"
-"						    $item == \"passwdfile\" || \n"
-"						    $item == \"o\" || \n"
-"						    $item == \"logfile\" || \n"
-"						    $item == \"remap\" || \n"
-"						    $item == \"httpdir\"} { \n"
-"							set mv [tilde_expand $mv]\n"
-"						}\n"
-"					}\n"
-"					\n"
-"					lappend cmd $mv\n"
-"					set mt $mv\n"
-"					regsub -all {#} $mt {\\#} mt\n"
-"					append rc_txt \"-$nitem $mt\\n\"\n"
-"				}\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"	lappend cmd \"2>\"\n"
-"	lappend cmd \"/dev/null\"\n"
-"	lappend cmd \"&\"\n"
-"	\n"
-"	if {$show_rc} {\n"
-"		return $rc_txt\n"
-"	} else {\n"
-"		return $cmd\n"
-"	}\n"
-"}\n"
-"\n"
-"proc start_x11vnc {} {\n"
-"	global menu_var unset_str\n"
-"	global x11vnc_prog x11vnc_xdisplay\n"
-"	global connected_to_x11vnc\n"
-"\n"
-"	if {$connected_to_x11vnc} {\n"
-"		append_text \"\\n\"\n"
-"		append_text \"WARNING: Still connected to an x11vnc server.\\n\"\n"
-"		append_text \"WARNING: Use \\\"stop\\\" or \\\"detach\\\" first.\\n\"\n"
-"		return 0\n"
-"	}\n"
-"\n"
-"	if {![double_check_start_x11vnc]} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	set x11vnc_xdisplay \"\"\n"
-"	if {[info exists menu_var(display)]} {\n"
-"		if {$menu_var(display) != \"\" && $menu_var(display) != $unset_str} {\n"
-"			set x11vnc_xdisplay $menu_var(display)\n"
-"		}\n"
-"	}\n"
-"\n"
-"	set cmd [get_start_x11vnc_cmd]\n"
-"\n"
-"	set str [join $cmd]\n"
-"	regsub { -e} $str \" -e \\\\\\n   \" str\n"
-"\n"
-"	if {0} {\n"
-"		puts \"running: $str\"\n"
-"		foreach word $cmd {\n"
-"			puts \"   word: $word\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	append_text \"Starting x11vnc in an iconified xterm with command:\\n\"\n"
-"	append_text \"  $str\\n\\n\"\n"
-"	catch {[eval exec $cmd]}\n"
-"	after 500\n"
-"	try_connect_and_query_all 3\n"
-"	if {!$connected_to_x11vnc} {\n"
-"		append_text \"\\nStarting x11vnc seems to have failed.\\n\"\n"
-"		if {[regexp -- {-o } $str] || [regexp -- {-logfile} $str]} {\n"
-"			append_text \"Examine the logfile (Debugging -> show-logfile) for error messages.\\n\"\n"
-"		} else {\n"
-"			append_text \"Rerun with a logfile (if needed) and examine the logfile\\n\"\n"
-"			append_text \"(Debugging -> show-logfile) for error messages.\\n\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc run_remote_cmd_via_sock {opts} {\n"
-"	global client_sock\n"
-"\n"
-"	set db 0\n"
-"	if {[file channels $client_sock] == \"\"} {\n"
-"		set client_sock \"\"\n"
-"		return \"fail\"\n"
-"	}\n"
-"	if {[eof $client_sock]} {\n"
-"		catch {close $client_sock}\n"
-"		set client_sock \"\"\n"
-"		return \"fail\"\n"
-"	}\n"
-"	set result \"\"\n"
-"		\n"
-"	setup_client_sock 0\n"
-"\n"
-"	set docmd \"\"\n"
-"	foreach opt $opts {\n"
-"		if {$opt == \"-R\"} {\n"
-"			set docmd \"-R\"\n"
-"			continue\n"
-"		} elseif {$opt == \"-Q\"} {\n"
-"			set docmd \"-Q\"\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		if {$docmd == \"\"} {\n"
-"			continue\n"
-"		} elseif {$docmd == \"-R\"} {\n"
-"			set str \"cmd=$opt\"\n"
-"		} elseif {$docmd == \"-Q\"} {\n"
-"			set str \"qry=$opt\"\n"
-"		} else {\n"
-"			set docmd \"\"\n"
-"			continue\n"
-"		}\n"
-"\n"
-"		if {$db} {puts stderr \"run_remote_cmd_via_sock: $docmd \\\"$str\\\"\"}\n"
-"		catch {puts $client_sock $str}\n"
-"		if {$db} {puts stderr \"run_remote_cmd_via_sock: flush\"}\n"
-"		catch {flush $client_sock}\n"
-"		if {$db} {puts stderr \"run_remote_cmd_via_sock: gets\"}\n"
-"		catch {gets $client_sock res}\n"
-"		if {$db} {puts stderr \"run_remote_cmd_via_sock: \\\"$res\\\"\"}\n"
-"		set res [string trim $res]\n"
-"\n"
-"		if [regexp {=clients:} $res] {\n"
-"			regsub {^.*=clients:} $res \"\" cres\n"
-"			regsub {,aro=.*$} $cres \"\" cres\n"
-"			regsub {,ans=.*$} $cres \"\" cres\n"
-"			if {$cres == \"none\"} {\n"
-"				set cres \"\"\n"
-"			}\n"
-"			update_clients_menu $cres\n"
-"			set client_str $cres\n"
-"			set_client_balloon $cres\n"
-"		}\n"
-"\n"
-"		if [regexp {^clients:} $res] {\n"
-"			regsub {^clients:} $res \"\" tmp\n"
-"			if {$tmp == \"none\"} {\n"
-"				set tmp \"\"\n"
-"			}\n"
-"			update_clients_menu $tmp\n"
-"			set client_str $tmp\n"
-"			set_client_balloon $tmp\n"
-"\n"
-"			if ![regexp {^clients} $opt] {\n"
-"				# we could block here...\n"
-"				if {$db} {puts stderr \"run_remote_cmd_via_sock: gets\"}\n"
-"				gets $client_sock res\n"
-"				if {$db} {puts stderr \"run_remote_cmd_via_sock: \\\"$res\\\"\"}\n"
-"				set res [string trim $res]\n"
-"			}\n"
-"		}\n"
-"\n"
-"		set docmd \"\"\n"
-"\n"
-"		if {$res != \"\"} {\n"
-"			append result \"$res\\n\"\n"
-"		}\n"
-"	}\n"
-"	\n"
-"	setup_client_sock 1\n"
-"\n"
-"	set result [string trim $result]\n"
-"\n"
-"	return $result\n"
-"}\n"
-"\n"
-"proc run_remote_cmd {opts} {\n"
-"	global menu_var x11vnc_prog x11vnc_cmdline x11vnc_xdisplay\n"
-"	global x11vnc_auth_file x11vnc_connect_file\n"
-"	global client_sock\n"
-"\n"
-"	set debug [in_debug_mode]\n"
-"\n"
-"	if {[lindex $opts 0] == \"-R\" && [lindex $opts 1] == \"noremote\"} {\n"
-"		set str [join $opts]\n"
-"		if ![double_check_noremote] {\n"
-"			append_text \"skipping: x11vnc $str\"\n"
-"			return \"\"\n"
-"		} else {\n"
-"			append_text \"running: x11vnc $str (please do \\\"Actions -> detach\\\" to clean things up)\\n\"\n"
-"			append_text \"subsequent -R/-Q commands should fail...\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {$client_sock != \"\"} {\n"
-"		menus_disable\n"
-"		stop_watch on\n"
-"		set result [run_remote_cmd_via_sock $opts]\n"
-"		stop_watch off\n"
-"		menus_enable\n"
-"		if {$result != \"fail\"} {\n"
-"			return $result\n"
-"		}\n"
-"	}\n"
-"\n"
-"	set cmd \"\"\n"
-"\n"
-"	lappend cmd $x11vnc_prog;\n"
-"\n"
-"	if {$x11vnc_connect_file != \"\"} {\n"
-"		lappend cmd \"-connect\"\n"
-"		lappend cmd $x11vnc_connect_file\n"
-"	} else {\n"
-"		if {$x11vnc_xdisplay != \"\"} {\n"
-"			lappend cmd \"-display\"\n"
-"			lappend cmd $x11vnc_xdisplay\n"
-"		}\n"
-"		if {$x11vnc_auth_file != \"\"} {\n"
-"			lappend cmd \"-auth\"\n"
-"			lappend cmd $x11vnc_auth_file\n"
-"		}\n"
-"	}\n"
-"	lappend cmd \"-sync\"\n"
-"	foreach word $opts {\n"
-"		lappend cmd $word\n"
-"	}\n"
-"	lappend cmd \"2>\"\n"
-"	lappend cmd \"/dev/null\"\n"
-"\n"
-"	if {0 || $debug} {\n"
-"		set str [join $cmd]\n"
-"		puts \"running: $str\"\n"
-"		foreach word $cmd {\n"
-"			puts \"   word: $word\"\n"
-"		}\n"
-"	}\n"
-"\n"
-"	set output \"\"\n"
-"	menus_disable\n"
-"\n"
-"	stop_watch on\n"
-"	catch {set output [eval exec $cmd]}\n"
-"	stop_watch off\n"
-"\n"
-"	menus_enable\n"
-"	if {$debug} {\n"
-"		if {[string length $output] > 100} {\n"
-"			set str [string range $output 0 100]\n"
-"			append_text \"output: $str ...\\n\"\n"
-"		} else {\n"
-"			append_text \"output: $output\\n\"\n"
-"		}\n"
-"	}\n"
-"	return $output\n"
-"}\n"
-"\n"
-"proc try_connect_and_query_all {{n 2}} {\n"
-"	for {set i 0} {$i < $n} {incr i} {\n"
-"		if {$i > 0} {\n"
-"			after 500\n"
-"			append_text \"trying again ...\\n\"\n"
-"		}\n"
-"		if {[try_connect]} {\n"
-"			query_all\n"
-"			break\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc try_connect {} {\n"
-"	global x11vnc_xdisplay connected_to_x11vnc reply_xdisplay\n"
-"	global menu_var unset_str\n"
-"\n"
-"	set db 0\n"
-"#dtime c1\n"
-"\n"
-"	if {! $connected_to_x11vnc} {\n"
-"		if {[info exists menu_var(display)]} {\n"
-"			set d $menu_var(display)\n"
-"			if {$d != \"\" && $d != $unset_str && $d != $x11vnc_xdisplay} {\n"
-"				set x11vnc_xdisplay $menu_var(display)\n"
-"				append_text \"Setting X display to: $x11vnc_xdisplay\\n\"\n"
-"			}\n"
-"		}\n"
-"	}\n"
-"\n"
-"	set_info \"Pinging $x11vnc_xdisplay ...\"\n"
-"	set rargs [list \"-Q\" \"ping\"]\n"
-"	set result [run_remote_cmd $rargs]\n"
-"#dtime c2a\n"
-"\n"
-"	if {$db} {puts \"try_connect: \\\"$result\\\"\"}\n"
-"\n"
-"	if {[regexp {^ans=ping:} $result]} {\n"
-"		regsub {^ans=ping:} $result {} reply_xdisplay\n"
-"		set msg \"Connected to $reply_xdisplay\"\n"
-"		set_info $msg\n"
-"		append_text \"$msg\\n\"\n"
-"		set_connected yes\n"
-"\n"
-"		setup_client_channel\n"
-"#dtime c2b\n"
-"		setup_client_sock 1\n"
-"		setup_client_tail\n"
-"\n"
-"		fetch_displays\n"
-"#dtime c3a\n"
-"		return 1\n"
-"	} else {\n"
-"		set str \"x11vnc server.\"\n"
-"		if {$x11vnc_xdisplay != \"\"} {\n"
-"			set str $x11vnc_xdisplay\n"
-"		}\n"
-"		set msg \"No reply from $str\"\n"
-"		set_info $msg\n"
-"		append_text \"$msg\\n\"\n"
-"		set_connected no\n"
-"		return 0\n"
-"	}\n"
-"}\n"
-"\n"
-"proc set_view_variable {val} {\n"
-"	global menu_var\n"
-"	set menu_var(WindowView) $val\n"
-"}\n"
-"proc get_view_variable {} {\n"
-"	global menu_var\n"
-"	if {![info exists menu_var(WindowView)]} {\n"
-"		set menu_var(WindowView) \"none\"\n"
-"	}\n"
-"	return $menu_var(WindowView)\n"
-"}\n"
-"\n"
-"proc dono {a b c} {\n"
-"	exit 1;\n"
-"}\n"
-"\n"
-"proc do_port_prompt {} {\n"
-"	global bfont ffont\n"
-"	global port_reply port_set\n"
-"\n"
-"	set guess 5900\n"
-"	for {set i 0} {$i < 50} {incr i} {\n"
-"		set fh \"\"\n"
-"		set try [expr $guess + $i]\n"
-"		catch {set fh [socket -server dono $try]}\n"
-"		if {$fh != \"\"} {\n"
-"			catch {close $fh}\n"
-"			set guess $try\n"
-"			break;\n"
-"		}\n"
-"	}\n"
-"	set hn \"\"\n"
-"	catch {set hn [exec uname -n]}\n"
-"	if {$hn == \"\"} {\n"
-"		set hn \"hostname\"\n"
-"	}\n"
-"\n"
-"	set text \" Set the x11vnc Listening Port:\n"
-"\n"
-"    VNC Display :0 corresponds to TCP port 5900\n"
-"    VNC Display :1 corresponds to TCP port 5901\n"
-"    etc.\n"
-"\n"
-" In the Entry below, indicate a Port for x11vnc to listen on. \n"
-"\n"
-" Note that to connect to x11vnc, a VNC Viewer will need to\n"
-" know your selection, for example:\n"
-"\n"
-"    vncviewer $hn:0\n"
-"    vncviewer $hn:1\n"
-"    etc.\n"
-"\n"
-" Your firewall may block incoming connections to TCP ports;\n"
-" if it does you may need to reconfigure it. \n"
-"    \n"
-" You can also set some additional parameters:\n"
-"\n"
-"    - Enable SSL encryption.\n"
-"      (requires an SSL enabled vncviewer, such as SSVNC)  \n"
-"    - Listen only on localhost. (e.g. for an SSH tunnel)\n"
-"    - Enable UltraVNC or TightVNC File transfer.\n"
-"\"\n"
-"	set port_set $guess\n"
-"	set port_reply \"\"\n"
-"\n"
-"	toplevel .pp\n"
-"	wm title .pp \"Select x11vnc port\"\n"
-"\n"
-"	wm protocol .   WM_DELETE_WINDOW \"destroy .; exit\"\n"
-"	wm protocol .pp WM_DELETE_WINDOW \"destroy .pp; exit\"\n"
-"\n"
-"	label .pp.m -text \"$text\" -relief ridge -justify left -font $ffont\n"
-"\n"
-"	global tk_version\n"
-"	set tkold 0\n"
-"	if [info exists tk_version] {\n"
-"		if [regexp {^8\\.[0-3]$} $tk_version] {\n"
-"			set tkold 1\n"
-"		}\n"
-"		if [regexp {^[3-7]\\.} $tk_version] {\n"
-"			set tkold 1\n"
-"		}\n"
-"	}\n"
-"\n"
-"	if {$tkold} {\n"
-"		frame .pp.f -bd 1 -relief ridge\n"
-"	} else {\n"
-"		frame .pp.f -bd 1 -relief ridge -pady 2\n"
-"	}\n"
-"	label .pp.f.l -text \"Port: \" -font $bfont\n"
-"	entry .pp.f.e -width 8 -textvariable port_set -font $ffont\n"
-"	global enable_ssl; set enable_ssl 0\n"
-"	if [info exists env(X11VNC_SSL_ENABLED)] {\n"
-"		set enable_ssl 1\n"
-"	}\n"
-"	checkbutton .pp.f.ssl -relief raised -pady 3 -padx 3 -text \"Enable SSL\" -variable enable_ssl -font $bfont\n"
-"	global localhost; set localhost 0\n"
-"	if [info exists env(X11VNC_LOCALHOST_ENABLED)] {\n"
-"		set localhost 1\n"
-"	}\n"
-"	checkbutton .pp.f.loc -relief raised -pady 3 -padx 3 -text \"Listen on localhost\" -variable localhost -font $bfont\n"
-"	pack .pp.f.l .pp.f.e -side left\n"
-"	pack .pp.f.loc .pp.f.ssl -side right\n"
-"\n"
-"	if {$tkold} {\n"
-"		frame .pp.t -bd 1 -relief ridge\n"
-"	} else {\n"
-"		frame .pp.t -bd 1 -relief ridge -pady 2\n"
-"	}\n"
-"	global file_transfer; set file_transfer \"none\"\n"
-"	if [info exists env(X11VNC_FILETRANSFER_ENABLED)] {\n"
-"		set file_transfer $env(X11VNC_FILETRANSFER_ENABLED)\n"
-"	}\n"
-"	label .pp.t.l -text \"File Transfer: \" -font $bfont\n"
-"	radiobutton .pp.t.none  -text \"None\" -variable file_transfer -value \"none\" -font $bfont\n"
-"	radiobutton .pp.t.ultra -text \"UltraVNC\" -variable file_transfer -value \"ultra\" -font $bfont\n"
-"	radiobutton .pp.t.tight -text \"TightVNC\" -variable file_transfer -value \"tight\" -font $bfont\n"
-"	pack .pp.t.l .pp.t.none .pp.t.ultra .pp.t.tight -side left\n"
-"\n"
-"	frame .pp.o -bd 1 -relief ridge\n"
-"	button .pp.o.ok -text \"OK\" -command \"set port_reply 1; destroy .pp\" -font $bfont\n"
-"	button .pp.o.cancel -text \"Cancel\" -command \"set port_reply 0; destroy .pp\" -font $bfont\n"
-"	pack .pp.o.ok .pp.o.cancel -side left -fill x -expand 1\n"
-"	pack .pp.m -side top -fill x -expand 1 \n"
-"	pack .pp.f .pp.t .pp.o -side top -fill x\n"
-"\n"
-"	focus .pp.f.e\n"
-"	.pp.f.e icursor end\n"
-"\n"
-"	wm withdraw .pp\n"
-"	update\n"
-"	center_win .pp\n"
-"\n"
-"	wm minsize .pp [winfo width .pp] [winfo height .pp]\n"
-"\n"
-"	bind .pp.f.e <KeyPress-Return> \"set port_reply 1; destroy .pp\"\n"
-"\n"
-"	vwait port_reply\n"
-"\n"
-"	if {$port_reply} {\n"
-"		regsub -all {^:} $port_set \"\" port_set\n"
-"		regsub -all {[ \\t]} $port_set \"\" port_set\n"
-"		if {[regexp {^[0-9][0-9]*$} $port_set]} {\n"
-"			if {$port_set < 0} {\n"
-"				set port_set [expr 0 - $port_set]\n"
-"			} elseif {$port_set < 200} {\n"
-"				set port_set [expr $port_set + 5900]\n"
-"			} \n"
-"			puts \"$port_set:ssl${enable_ssl}:localhost$localhost:ft_$file_transfer\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc change_view_state {} {\n"
-"	global menu_var gui_current_state\n"
-"\n"
-"	set new [get_view_variable]\n"
-"\n"
-"	if {![info exists gui_current_state]} {\n"
-"		set gui_current_state \"\"\n"
-"	}\n"
-"	set old $gui_current_state\n"
-"	#puts \"$old -> $new\"\n"
-"\n"
-"	if {$old == $new} {\n"
-"		return\n"
-"	}\n"
-"\n"
-"	if {$old == \"full\" || $old == \"icon\" || $old == \"tray\"} {\n"
-"		;\n"
-"	} else {\n"
-"		set old \"none\"\n"
-"	}\n"
-"\n"
-"	if {$new == \"full\" || $new == \"icon\" || $new == \"tray\"} {\n"
-"		if {$old == \"tray\"} {\n"
-"			# sigh XReparentWindow would be too easy...\n"
-"			# undo_tray_embed\n"
-"			restart_everything $new\n"
-"			destroy .\n"
-"			exit\n"
-"		}\n"
-"		make_gui $new\n"
-"		if {$new == \"tray\"} {\n"
-"			wm withdraw .\n"
-"		}\n"
-"	} else {\n"
-"		set_view_variable $old\n"
-"	}\n"
-"}\n"
-"\n"
-"proc setup_client_tail {} {\n"
-"	global client_tail\n"
-"	if {$client_tail != \"\"} {\n"
-"		fileevent $client_tail readable read_client_tail\n"
-"	}\n"
-"}\n"
-"\n"
-"proc setup_client_sock {{enable 1}} {\n"
-"	global client_sock\n"
-"	if {$client_sock != \"\"} {\n"
-"		if {$enable} {\n"
-"			fileevent $client_sock readable read_client_sock\n"
-"		} else {\n"
-"			fileevent $client_sock readable \"\"\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"proc setup_tray_embed {} {\n"
-"	update\n"
-"	set w [winfo width .]\n"
-"	set h [winfo height .]\n"
-"	if {$w < 24} {\n"
-"		set w 24\n"
-"	}\n"
-"	if {$h < 24} {\n"
-"		set h 24\n"
-"	}\n"
-"	wm minsize . $w $h\n"
-"	set wid [winfo id .]	\n"
-"	push_new_value \"remote-cmd\" \"remote-cmd\" \"trayembed:$wid\" 0\n"
-"}\n"
-"\n"
-"proc restart_everything {gui_mode} {\n"
-"	global env gui_argv0 x11vnc_prog full_win\n"
-"	global icon_mode_at_startup\n"
-"	global tray_embed tray_running\n"
-"	if {$gui_mode == \"full\"} {\n"
-"		set env(X11VNC_ICON_MODE) 0\n"
-"	} elseif {$gui_mode == \"icon\"} {\n"
-"		set env(X11VNC_ICON_MODE) 1\n"
-"	} elseif {$gui_mode == \"tray\"} {\n"
-"		if {$tray_running} {\n"
-"			set env(X11VNC_ICON_MODE) \"RUNNING\"\n"
-"		} else {\n"
-"			set env(X11VNC_ICON_MODE) \"TRAY\"\n"
-"		}\n"
-"	}\n"
-"	puts stderr \"\"\n"
-"	puts stderr \"tkx11vnc: restarting gui to leave tray mode.\"\n"
-"	puts stderr \"  new gui will be running in the background.\"\n"
-"	puts stderr \"  use kill(1) rather than Ctrl-C to kill it.\"\n"
-"	puts stderr \"\"\n"
-"	if {[info exists env(X11VNC_RESTART_DEPTH)]} {\n"
-"		set n $env(X11VNC_RESTART_DEPTH)\n"
-"		incr n\n"
-"		set env(X11VNC_RESTART_DEPTH) $n\n"
-"	} else {\n"
-"		set env(X11VNC_RESTART_DEPTH) 0\n"
-"	}\n"
-"	set env(X11VNC_ICON_SETPASS) \"\"\n"
-"\n"
-"	if {![info exists env(X11VNC_WISHCMD)]} {\n"
-"		puts stderr \"failure in restart_everything.\"\n"
-"		exit 1;\n"
-"	}\n"
-"\n"
-"	set code [exec $x11vnc_prog -printgui]\n"
-"	if {[string length $code] < 20000} {\n"
-"		puts stderr \"failure in restart_everything.\"\n"
-"		exit 1;\n"
-"	}\n"
-"	set tmp \"/tmp/x11vnc[pid]\"\n"
-"	append tmp [clock clicks]\n"
-"	set tmp2 \"\"\n"
-"	catch {set tmp2 [exec mktemp $tmp.XXXXXX 2>/dev/null]}\n"
-"	if {$tmp2 != \"\" && [file exists $tmp2]} {\n"
-"		set tmp $tmp2\n"
-"	} else {\n"
-"		file delete -force $tmp\n"
-"		if {[file exists $tmp]} {\n"
-"			puts stderr \"failure in restart_everything.\"\n"
-"			exit 1;\n"
-"		}\n"
-"	}\n"
-"	set fh [open $tmp \"a\"]\n"
-"	if {![file owned $tmp]}  {\n"
-"		puts stderr \"failure in restart_everything.\"\n"
-"		exit 1;\n"
-"	}\n"
-"	file attributes $tmp -permissions \"0400\"\n"
-"	puts $fh $code\n"
-"	close $fh\n"
-"\n"
-"	#puts stderr [exec ls -l $tmp]\n"
-"\n"
-"	wm withdraw .\n"
-"	catch {wm withdraw $full_win}\n"
-"	update\n"
-"\n"
-"	exec $env(X11VNC_WISHCMD) $tmp &\n"
-"	after 2000\n"
-"	file delete -force $tmp\n"
-"	\n"
-"	destroy .\n"
-"	exit\n"
-"}\n"
-"\n"
-"proc undo_tray_embed {} {\n"
-"	set wid [winfo id .]	\n"
-"	push_new_value \"remote-cmd\" \"remote-cmd\" \"trayunembed:$wid\" 0\n"
-"}\n"
-"\n"
-"############################################################################\n"
-"# main:\n"
-"\n"
-"if [info exists env(X11VNC_GUI_TIME)] {\n"
-"	dtime M\n"
-"}\n"
-"\n"
-"wm withdraw .\n"
-"\n"
-"global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;\n"
-"global x11vnc_xdisplay0\n"
-"global x11vnc_client_file x11vnc_gui_geom x11vnc_started vnc_url\n"
-"global x11vnc_gui_params\n"
-"global x11vnc_auth_file x11vnc_connect_file beginner_mode simple_gui_created\n"
-"global helpall helptext helpremote helplabel hostname osname\n"
-"global all_settings reply_xdisplay always_update\n"
-"global max_text_height max_text_width\n"
-"global text_height\n"
-"global menu_var unset_str menus_disabled\n"
-"global bfont ffont sfont snfont old_labels have_labelframes\n"
-"global connected_to_x11vnc\n"
-"global cache_all_query_vars\n"
-"global last_query_all_time query_all_freq client_tail client_sock client_info_read\n"
-"global icon_mode icon_mode_at_startup x11vnc_icon_mode\n"
-"global tray_embed tray_running icon_setpasswd icon_embed_id\n"
-"global icon_noadvanced icon_minimal\n"
-"global make_gui_count text_area_str\n"
-"global gui_argv0 gui_start_mode\n"
-"global screen_height screen_width\n"
-"\n"
-"set unset_str \"(unset)\"\n"
-"set vnc_url $unset_str\n"
-"set connected_to_x11vnc 0\n"
-"set menus_disabled 0\n"
-"set max_text_height 40\n"
-"set max_text_width 90\n"
-"set text_height 14\n"
-"set bfont \"-adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*\"\n"
-"set sfont \"-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*\"\n"
-"set snfont \"-adobe-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*\"\n"
-"set ffont \"fixed\"\n"
-"\n"
-"set got_helv 0\n"
-"catch {\n"
-"	foreach fam [font families]  {\n"
-"		if {$fam == \"helvetica\"} {\n"
-"			set got_helv 1\n"
-"		}\n"
-"		if {$fam == \"Helvetica\"} {\n"
-"			set got_helv 1\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"if {$got_helv} {\n"
-"	set bfont  \"Helvetica -12 bold\"\n"
-"	set sfont  \"Helvetica -10 bold\"\n"
-"	set snfont \"Helvetica -10\"\n"
-"}\n"
-"\n"
-"set ls \"\"\n"
-"catch {set ls [font metrics $bfont -linespace]}\n"
-"if {$ls != \"\" && $ls > 14} {\n"
-"	# some recent setups have BIG rendering for the above fonts.\n"
-"	# on recent (8/08) debian these are really ragged:\n"
-"	set bfont \"-adobe-helvetica-bold-r-*-*-*-90-*-*-*-*-*-*\"\n"
-"	set sfont \"-adobe-helvetica-bold-r-*-*-*-75-*-*-*-*-*-*\"\n"
-"	set snfont \"-adobe-helvetica-medium-r-*-*-*-75-*-*-*-*-*-*\"\n"
-"\n"
-"	set ls \"\"\n"
-"	catch {set ls [font metrics $bfont -linespace]}\n"
-"	if {$ls != \"\" && $ls < 14} {\n"
-"		# these are bigger but look better... but for how long?\n"
-"		set bfont \"-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*\"\n"
-"		set sfont \"-adobe-helvetica-bold-r-*-*-*-80-*-*-*-*-*-*\"\n"
-"		set snfont \"-adobe-helvetica-medium-r-*-*-*-80-*-*-*-*-*-*\"\n"
-"\n"
-"		# maybe consider... {-font font Font {Helvetica -12 bold} {Helvetica -12 bold}}\n"
-"		# or stick with system font like ssvnc.\n"
-"	}\n"
-"}\n"
-"\n"
-"# need to check if \"fixed\" font under XFT on tk8.5 is actually fixed width!!\n"
-"set ls \"\"\n"
-"catch {set ls [font metrics $ffont -linespace]}\n"
-"set fs \"\"\n"
-"catch {set fs [font metrics $ffont -fixed]}\n"
-"set redo 0\n"
-"if {$fs != \"\" && $fs != \"1\"} {\n"
-"	set redo 1\n"
-"}\n"
-"if {$ls != \"\" && $ls > 14} {\n"
-"	set redo 1\n"
-"}\n"
-"if {$redo} {\n"
-"	foreach fn [font names] {\n"
-"		if {$fn == \"TkFixedFont\"} {\n"
-"			set ffont $fn\n"
-"			break\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"set help_indent 24;\n"
-"set reply_xdisplay \"\"\n"
-"set all_settings \"None so far.\"\n"
-"set always_update 1\n"
-"set cache_all_query_vars \"\"\n"
-"set query_all_freq 120\n"
-"set last_query_all_time [clock seconds]\n"
-"set client_tail \"\"\n"
-"set client_sock \"\"\n"
-"set client_info_read 0\n"
-"set make_gui_count 0\n"
-"set text_area_str \"\"\n"
-"set gui_argv0 $argv0\n"
-"set gui_start_mode \"\"\n"
-"\n"
-"if {$tk_version < 8.0} {\n"
-"	puts stderr \"\"\n"
-"	puts stderr \"*** tkx11vnc: tk version is old $tk_version, please use 8.0 or higher.\"\n"
-"	puts stderr \"***           will try to continue with reduced functionality...\"\n"
-"	puts stderr \"\"\n"
-"}\n"
-"if {[regexp {^[34]} $tk_version] || $tk_version == \"8.0\"} {\n"
-"	set old_labels 1\n"
-"} else {\n"
-"	set old_labels 0\n"
-"}\n"
-"set have_labelframes 1\n"
-"if {$tk_version < 8.4} {\n"
-"	set have_labelframes 0\n"
-"}\n"
-"\n"
-"set screen_height [winfo screenheight .]\n"
-"set screen_width  [winfo screenwidth  .]\n"
-"if {$screen_height < 700} {\n"
-"	# short screen, netbook?\n"
-"	set max_text_height 30\n"
-"	if {$screen_height < 500} {\n"
-"		# short screen, PDA?\n"
-"		set max_text_height 22\n"
-"		set text_height 13\n"
-"		if {$screen_height <= 360} {\n"
-"			# very short.\n"
-"			set max_text_height 16\n"
-"			set max_text_width  60\n"
-"			set text_height 11\n"
-"		}\n"
-"	}\n"
-"}\n"
-"if {[info exists env(X11VNC_GUI_TEXT_HEIGHT)]} {\n"
-"	set max_text_height $env(X11VNC_GUI_TEXT_HEIGHT)\n"
-"}\n"
-"if {[info exists env(X11VNC_GUI_TEXT_WIDTH)]} {\n"
-"	set max_text_width  $env(X11VNC_GUI_TEXT_WIDTH)\n"
-"}\n"
-"\n"
-"if {\"$argv\" == \"-spit\"} {\n"
-"	set fh [open $argv0 r]\n"
-"	puts \"#ifndef _TKX11VNC_H\"\n"
-"	puts \"#define _TKX11VNC_H\"\n"
-"	puts \"#ifdef NOGUI\"\n"
-"	puts \"char gui_code\\[\\] = \\\"\\\";\"\n"
-"	puts \"#else\"\n"
-"	puts \"/*\"\n"
-"	puts \" * tkx11vnc.h: generated by 'tkx11vnc -spit'\"\n"
-"	puts \" * Abandon all hope, ye who enter here...\"\n"
-"	puts \" * ...edit tkx11vnc instead.\"\n"
-"	puts \" */\"\n"
-"	puts \"	char gui_code\\[\\] =\"\n"
-"	while {[gets $fh line] > -1} {\n"
-"		regsub -all {\\\\} $line {\\\\\\\\} line\n"
-"		regsub -all {\"} $line {\\\\\"} line\n"
-"		puts \"\\\"$line\\\\n\\\"\"\n"
-"	}\n"
-"	puts \"#endif\"\n"
-"	puts \"/* ifdef NOGUI */\"\n"
-"	puts \"#endif\"\n"
-"	puts \"/* ifndef _TKX11VNC_H */\"\n"
-"	close $fh\n"
-"	puts \";\"\n"
-"	exit 0\n"
-"}\n"
-"\n"
-"set_view_variable \"full\"\n"
-"\n"
-"#puts [exec env | grep X11VNC]\n"
-"\n"
-"# Read environment for clues:\n"
-"\n"
-"set x11vnc_client_file \"\";\n"
-"if {[info exists env(X11VNC_CLIENT_FILE)]} {\n"
-"	set x11vnc_client_file $env(X11VNC_CLIENT_FILE);\n"
-"	set file $x11vnc_client_file\n"
-"\n"
-"	set client_tail \"\"\n"
-"	if {[file exists $file] && [file isfile $file]} {\n"
-"		if {[file readable $file] && [file owned $file]} {\n"
-"			set client_tail [open \"|tail -f $x11vnc_client_file\" \"r\"]\n"
-"		}\n"
-"	}\n"
-"	if {$client_tail != \"\"} {\n"
-"		gets $client_tail tmp\n"
-"		if [eof $client_tail] {\n"
-"#puts \"eof $client_tail\"\n"
-"			clean_client_tail\n"
-"			set client_tail \"\"\n"
-"		}\n"
-"	}\n"
-"	catch {file delete -force $x11vnc_client_file}\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_PROG)]} {\n"
-"	set x11vnc_prog $env(X11VNC_PROG);\n"
-"} else {\n"
-"	set x11vnc_prog \"x11vnc\";\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_CMDLINE)]} {\n"
-"	set x11vnc_cmdline $env(X11VNC_CMDLINE);\n"
-"} else {\n"
-"	set x11vnc_cmdline \"\";\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_CONNECT)]} {\n"
-"	set x11vnc_connect 1\n"
-"} else {\n"
-"	set x11vnc_connect 0;\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_GUI_GEOM)]} {\n"
-"	set x11vnc_gui_geom $env(X11VNC_GUI_GEOM);\n"
-"} else {\n"
-"	set x11vnc_gui_geom \"\"\n"
-"}\n"
-"if {[info exists env(X11VNC_GUI_PARAMS)]} {\n"
-"	set x11vnc_gui_params $env(X11VNC_GUI_PARAMS);\n"
-"} else {\n"
-"	set x11vnc_gui_params \"\"\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_FONT_BOLD)]} {\n"
-"	set bfont $env(X11VNC_FONT_BOLD)\n"
-"}\n"
-"if {[info exists env(X11VNC_FONT_BOLD_SMALL)]} {\n"
-"	set sfont $env(X11VNC_FONT_BOLD_SMALL)\n"
-"}\n"
-"if {[info exists env(X11VNC_FONT_REG_SMALL)]} {\n"
-"	set snfont $env(X11VNC_FONT_REG_SMALL)\n"
-"}\n"
-"if {[info exists env(X11VNC_FONT_FIXED)]} {\n"
-"	set ffont $env(X11VNC_FONT_FIXED)\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_CONNECT_FILE)]} {\n"
-"	set x11vnc_connect_file $env(X11VNC_CONNECT_FILE);\n"
-"} else {\n"
-"	set x11vnc_connect_file \"\";\n"
-"}\n"
-"\n"
-"set x11vnc_started 0\n"
-"if {[info exists env(X11VNC_STARTED)]} {\n"
-"	set x11vnc_started 1\n"
-"}\n"
-"\n"
-"set x11vnc_xdisplay \"\"\n"
-"if {[info exists env(X11VNC_XDISPLAY)]} {\n"
-"	set x11vnc_xdisplay $env(X11VNC_XDISPLAY);\n"
-"	set x11vnc_connect 1\n"
-"\n"
-"} elseif {$argv != \"\" && [regexp {:[0-9]} $argv]} {\n"
-"	set env(X11VNC_XDISPLAY) \"$argv\"\n"
-"	set x11vnc_xdisplay \"$argv\"\n"
-"	set x11vnc_connect 1\n"
-"\n"
-"} elseif {[info exists env(DISPLAY)]} {\n"
-"	set x11vnc_xdisplay $env(DISPLAY);\n"
-"} else {\n"
-"	set x11vnc_xdisplay \":0\";\n"
-"}\n"
-"set x11vnc_xdisplay0 $x11vnc_xdisplay\n"
-"\n"
-"if {[info exists env(X11VNC_AUTH_FILE)]} {\n"
-"	set x11vnc_auth_file $env(X11VNC_AUTH_FILE)\n"
-"} else {\n"
-"	set x11vnc_auth_file \"\"\n"
-"}\n"
-"\n"
-"set simple_gui_created 0\n"
-"if {[info exists env(X11VNC_SIMPLE_GUI)]} {\n"
-"	set beginner_mode 1\n"
-"} else {\n"
-"	set beginner_mode 0\n"
-"}\n"
-"\n"
-"set icon_mode 0\n"
-"set x11vnc_icon_mode 0\n"
-"set tray_embed 0\n"
-"set tray_running 0\n"
-"\n"
-"if {![info exists env(X11VNC_ICON_MODE_AT_STARTUP)]} {\n"
-"	if {[info exists env(X11VNC_ICON_MODE)]} {\n"
-"		if {$env(X11VNC_ICON_MODE) != 0} {\n"
-"			set env(X11VNC_ICON_MODE_AT_STARTUP) 1\n"
-"		} else {\n"
-"			set env(X11VNC_ICON_MODE_AT_STARTUP) 0\n"
-"		}\n"
-"	} else {\n"
-"		set env(X11VNC_ICON_MODE_AT_STARTUP) 0\n"
-"	}\n"
-"}\n"
-"set icon_mode_at_startup $env(X11VNC_ICON_MODE_AT_STARTUP)\n"
-"\n"
-"if {![info exists env(X11VNC_ICON_MODE)]} {\n"
-"	set icon_mode 0\n"
-"} elseif {$env(X11VNC_ICON_MODE) == \"\" || $env(X11VNC_ICON_MODE) == \"0\"} {\n"
-"	set icon_mode 0\n"
-"} else {\n"
-"	set icon_mode 1\n"
-"	set_view_variable \"icon\"\n"
-"	if [regexp -nocase {TRAY} $env(X11VNC_ICON_MODE)] {\n"
-"		set tray_embed 1\n"
-"	}\n"
-"	if [regexp -nocase {RUNNING} $env(X11VNC_ICON_MODE)] {\n"
-"		set tray_running 1\n"
-"	}\n"
-"}\n"
-"\n"
-"set icon_setpasswd 0\n"
-"if {[info exists env(X11VNC_ICON_SETPASS)]} {\n"
-"	if {$env(X11VNC_ICON_SETPASS) != \"\"} {\n"
-"		set icon_setpasswd 1\n"
-"	}\n"
-"}\n"
-"\n"
-"set icon_noadvanced 0\n"
-"if {[info exists env(X11VNC_ICON_NOADVANCED)]} {\n"
-"	set icon_noadvanced 1\n"
-"}\n"
-"\n"
-"set icon_minimal 0\n"
-"if {[info exists env(X11VNC_ICON_MINIMAL)]} {\n"
-"	set icon_minimal 1\n"
-"}\n"
-"\n"
-"if {[info exists env(X11VNC_ICON_EMBED_ID)]} {\n"
-"	set icon_embed_id $env(X11VNC_ICON_EMBED_ID)\n"
-"} else {\n"
-"	set icon_embed_id \"\"\n"
-"}\n"
-"\n"
-"\n"
-"set hostname [exec uname -n]\n"
-"set osname [exec uname]\n"
-"\n"
-"if {[regexp -nocase {IRIX} $osname]} {\n"
-"	# IRIX \"fixed\" font is huge and doublespaced... \n"
-"	set ffont $snfont\n"
-"}\n"
-"if {[regexp -nocase {Darwin} $osname]} {\n"
-"	set ffont {Monaco 10}\n"
-"	set bfont {system}\n"
-"}\n"
-"\n"
-"if {\"$argv\" == \"-portprompt\"} {\n"
-"	do_port_prompt\n"
-"	exit 0\n"
-"}\n"
-"\n"
-"#puts [exec env]\n"
-"#puts \"x11vnc_xdisplay: $x11vnc_xdisplay\"\n"
-"\n"
-"set env(X11VNC_STD_HELP) 1\n"
-"\n"
-"# scrape the help output for the text and remote control vars:\n"
-"parse_help;\n"
-"parse_remote_help;\n"
-"parse_query_help;\n"
-"\n"
-"# tweaks to duplicate help text:\n"
-"tweak_remote_help lock deny\n"
-"tweak_remote_help unlock deny\n"
-"\n"
-"tweak_both quiet q\n"
-"tweak_help logfile o\n"
-"tweak_both xwarppointer xwarp\n"
-"tweak_both screen_blank sb\n"
-"\n"
-"set_template\n"
-"\n"
-"set_name \"tkx11vnc\"\n"
-"\n"
-"key_bindings;\n"
-"\n"
-"get_default_vars\n"
-"\n"
-"dtime D\n"
-"\n"
-"proc check_setpasswd {} {\n"
-"	global env icon_setpasswd\n"
-"	global do_props_msg\n"
-"	set do_props_msg \"\"\n"
-"	if {$icon_setpasswd} {\n"
-"		set m \"\\n\"\n"
-"		set m \"${m} Note the x11vnc icon in the system tray.\\n\" \n"
-"		set m \"${m} This panel is its 'Properties' dialog.\\n\" \n"
-"		set m \"${m}\\n\" \n"
-"		set m \"${m} To specify a Session Password and to\\n\" \n"
-"		set m \"${m} allow VNC viewers to connect, follow\\n\" \n"
-"		set m \"${m} these steps:\\n\" \n"
-"		set m \"${m}\\n\" \n"
-"		set m \"${m} Enter a passwd in the Password field\\n\" \n"
-"		set m \"${m} (it can be left blank.)  You can also\\n\" \n"
-"		set m \"${m} supply a ViewOnly passwd if desired.\\n\" \n"
-"		set m \"${m}\\n\" \n"
-"		set m \"${m} Set 'Accept Connections' and then Press \\n\" \n"
-"		set m \"${m} 'Apply' to allow incoming connections.\\n\" \n"
-"		set m \"${m}\\n\" \n"
-"		set m \"${m} No Viewer can connect until you do this.\\n\" \n"
-"		set m \"${m}\\n\" \n"
-"		set m \"${m} The passwords are only for this x11vnc\\n\" \n"
-"		set m \"${m} session and are not saved.  Run x11vnc\\n\" \n"
-"		set m \"${m} manually for more control (e.g. -rfbauth \\n\" \n"
-"		set m \"${m} for a saved password.)\\n\" \n"
-"		set m \"${m}\\n\" \n"
-"		set m \"${m} See 'Help' for details on each option.\\n\" \n"
-"\n"
-"		global x11vnc_cmdline\n"
-"\n"
-"		set dossl 0\n"
-"		if {[info exists x11vnc_cmdline]} {\n"
-"			if [regexp -- {-ssl} $x11vnc_cmdline] {\n"
-"				set dossl 1\n"
-"			}\n"
-"		}\n"
-"		if {$dossl || [info exists env(X11VNC_GOT_SSL)]} {\n"
-"			set m \"${m}\\n\" \n"
-"			set m \"${m} SSL encryption mode active.  You can\\n\" \n"
-"			set m \"${m} find your Public Cert in the Logfile\\n\" \n"
-"			set m \"${m} and also the ~/.vnc/certs directory.\\n\" \n"
-"		}\n"
-"\n"
-"		if {[info exists env(X11VNC_SETPASS_FAIL)]} {\n"
-"			set pp 5900\n"
-"			if {[info exists env(X11VNC_GOT_RFBPORT_VAL)]} {\n"
-"				if {$env(X11VNC_GOT_RFBPORT_VAL) > 0} {\n"
-"					set pp $env(X11VNC_GOT_RFBPORT_VAL)\n"
-"				}\n"
-"			}\n"
-"			\n"
-"			set m     \" The x11vnc program failed to start! \\n\"\n"
-"			set m \"${m}\\n\" \n"
-"			set m \"${m} Maybe there is another VNC server\\n\"\n"
-"			set m \"${m} already listening on port $pp?\\n\"\n"
-"			set m \"${m}\\n\" \n"
-"			set m \"${m} You will need to start over after\\n\"\n"
-"			set m \"${m} you make sure x11vnc can start.\\n\"\n"
-"		}\n"
-"		\n"
-"		set do_props_msg $m\n"
-"		do_props\n"
-"	}\n"
-"}\n"
-"\n"
-"if {0} {\n"
-"	if {[info exists env(X11VNC_ICON_SETPASS)]} {\n"
-"		if {$env(X11VNC_ICON_SETPASS) == \"2\"} {\n"
-"			global icon_mode_at_startup icon_mode\n"
-"			set icon_mode_at_startup 1\n"
-"			set icon_mode 2\n"
-"		}\n"
-"	}\n"
-"}\n"
-"\n"
-"if {$icon_mode} {\n"
-"	if {$icon_mode == 2} {\n"
-"		make_gui \"full\"\n"
-"	} elseif {$tray_embed} {\n"
-"		make_gui \"tray\"\n"
-"	} else {\n"
-"		make_gui \"icon\"\n"
-"	}\n"
-"	dtime G\n"
-"	old_balloon\n"
-"	check_setpasswd\n"
-"	push_new_value \"remote-cmd\" \"remote-cmd\" \"Q:clients\" 1\n"
-"} else {\n"
-"	make_gui \"full\"\n"
-"	dtime G\n"
-"	check_setpasswd\n"
-"}\n"
-"\n"
-"\n"
-"# main loop.\n"
-#endif
-/* ifdef NOGUI */
-#endif
-/* ifndef _TKX11VNC_H */
-;
diff --git a/ica/x11/x11vnc/uinput.c b/ica/x11/x11vnc/uinput.c
deleted file mode 100644
index 92bd1d8..0000000
--- a/ica/x11/x11vnc/uinput.c
+++ /dev/null
@@ -1,1876 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- uinput.c -- */
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "scan.h"
-#include "xinerama.h"
-#include "screen.h"
-#include "pointer.h"
-#include "keyboard.h"
-#include "allowed_input_t.h"
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H
-#if LIBVNCSERVER_HAVE_LINUX_INPUT_H
-#if LIBVNCSERVER_HAVE_LINUX_UINPUT_H
-#define UINPUT_OK
-#endif
-#endif
-#endif
-
-#ifdef UINPUT_OK
-#include <sys/ioctl.h>
-#include <linux/input.h>
-#include <linux/uinput.h>
-
-#if !defined(EV_SYN) || !defined(SYN_REPORT)
-#undef UINPUT_OK
-#endif
-
-#endif
-
-
-int check_uinput(void);
-int initialize_uinput(void);
-void shutdown_uinput(void);
-int set_uinput_accel(char *str);
-int set_uinput_thresh(char *str);
-void set_uinput_reset(int ms);
-void set_uinput_always(int);
-void set_uinput_touchscreen(int);
-void set_uinput_abs(int);
-char *get_uinput_accel();
-char *get_uinput_thresh();
-int get_uinput_reset();
-int get_uinput_always();
-int get_uinput_touchscreen();
-int get_uinput_abs();
-void parse_uinput_str(char *str);
-void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client);
-void uinput_key_command(int down, int keysym, rfbClientPtr client);
-
-static void init_key_tracker(void);
-static int mod_is_down(void);
-static int key_is_down(void);
-static void set_uinput_accel_xy(double fx, double fy);
-static void ptr_move(int dx, int dy);
-static void ptr_rel(int dx, int dy);
-static void button_click(int down, int btn);
-static int lookup_code(int keysym);
-
-static int fd = -1;
-static int direct_rel_fd = -1;
-static int direct_abs_fd = -1;
-static int direct_btn_fd = -1;
-static int direct_key_fd = -1;
-static int bmask = 0;
-static int db = 0;
-
-static char *injectable = NULL;
-static char *uinput_dev = NULL;
-static char *tslib_cal = NULL;
-static double a[7];
-static int uinput_touchscreen = 0;
-static int uinput_abs = 0;
-static int btn_touch = 0;
-static int dragskip = 0;
-static int touch_always = 0;
-static int touch_pressure = 1;
-static int abs_x = 0, abs_y = 0;
-
-static char *devs[] = {
-	"/dev/misc/uinput",
-	"/dev/input/uinput",
-	"/dev/uinput",
-	NULL
-};
-
-#ifndef O_NDELAY
-#ifdef  O_NONBLOCK
-#define O_NDELAY O_NONBLOCK
-#else
-#define O_NDELAY 0
-#endif
-#endif
-
-/* 
- * User may need to do:
- 	modprode uinput
-	mknod /dev/input/uinput c 10 223
- */
-
-int check_uinput(void) {
-#ifndef UINPUT_OK
-	return 0;
-#else
-	int i;
-	if (UT.release) {
-		int maj, min;
-		/* guard against linux 2.4 */
-		if (sscanf(UT.release, "%d.%d.", &maj, &min) == 2) {
-			if (maj < 2) {
-				return 0;
-			} else if (maj == 2) {
-				/* hmmm IPAQ 2.4.19-rmk6-pxa1-hh37 works... */
-#if 0
-				if (min < 6) {
-					return 0;
-				}
-#endif
-			}
-		}
-	}
-	fd = -1;
-	i = 0;
-	while (devs[i] != NULL) {
-		if ( (fd = open(devs[i++], O_WRONLY | O_NDELAY)) >= 0) {
-			break;
-		}
-	}
-	if (fd < 0) {
-		return 0;
-	}
-	close(fd);
-	fd = -1;
-	return 1;
-#endif
-}
-
-static int key_pressed[256];
-static int key_ismod[256];
-
-static void init_key_tracker(void) {
-	int i;
-	for (i = 0; i < 256; i++) {
-		key_pressed[i] = 0;
-		key_ismod[i] = 0;
-	}
-	i = lookup_code(XK_Shift_L);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Shift_R);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Control_L);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Control_R);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Alt_L);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Alt_R);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Meta_L);	if (0<=i && i<256) key_ismod[i] = 1;
-	i = lookup_code(XK_Meta_R);	if (0<=i && i<256) key_ismod[i] = 1;
-}
-
-static int mod_is_down(void) {
-	int i;
-	if (0) {key_is_down();}
-	for (i = 0; i < 256; i++) {
-		if (key_pressed[i] && key_ismod[i]) {
-			return 1;
-		}
-	}
-	return 0;
-}
-
-static int key_is_down(void) {
-	int i;
-	for (i = 0; i < 256; i++) {
-		if (key_pressed[i]) {
-			return 1;
-		}
-	}
-	return 0;
-}
-
-void shutdown_uinput(void) {
-#ifdef UINPUT_OK
-	if (fd >= 0) {
-		if (db) {
-			rfbLog("shutdown_uinput called on fd=%d\n", fd);
-		}
-		ioctl(fd, UI_DEV_DESTROY);
-		close(fd);
-		fd = -1;
-	}
-
-	/* close direct injection files too: */
-	if (direct_rel_fd >= 0) close(direct_rel_fd);
-	if (direct_abs_fd >= 0) close(direct_abs_fd);
-	if (direct_btn_fd >= 0) close(direct_btn_fd);
-	if (direct_key_fd >= 0) close(direct_key_fd);
-	direct_rel_fd = -1;
-	direct_abs_fd = -1;
-	direct_btn_fd = -1;
-	direct_key_fd = -1;
-#endif
-}
-
-/* 
-grep BUS_ /usr/include/linux/input.h | awk '{print $2}' | perl -e 'while (<>) {chomp; print "#ifdef $_\n\t\tif(!strcmp(s, \"$_\"))\tudev.id.bustype = $_\n#endif\n"}'
- */
-static int get_bustype(char *s) {
-#ifdef UINPUT_OK
-
-	if (!s) return 0;
-
-#ifdef BUS_PCI
-	if(!strcmp(s, "BUS_PCI"))	return BUS_PCI;
-#endif
-#ifdef BUS_ISAPNP
-	if(!strcmp(s, "BUS_ISAPNP"))	return BUS_ISAPNP;
-#endif
-#ifdef BUS_USB
-	if(!strcmp(s, "BUS_USB"))	return BUS_USB;
-#endif
-#ifdef BUS_HIL
-	if(!strcmp(s, "BUS_HIL"))	return BUS_HIL;
-#endif
-#ifdef BUS_BLUETOOTH
-	if(!strcmp(s, "BUS_BLUETOOTH"))	return BUS_BLUETOOTH;
-#endif
-#ifdef BUS_VIRTUAL
-	if(!strcmp(s, "BUS_VIRTUAL"))	return BUS_VIRTUAL;
-#endif
-#ifdef BUS_ISA
-	if(!strcmp(s, "BUS_ISA"))	return BUS_ISA;
-#endif
-#ifdef BUS_I8042
-	if(!strcmp(s, "BUS_I8042"))	return BUS_I8042;
-#endif
-#ifdef BUS_XTKBD
-	if(!strcmp(s, "BUS_XTKBD"))	return BUS_XTKBD;
-#endif
-#ifdef BUS_RS232
-	if(!strcmp(s, "BUS_RS232"))	return BUS_RS232;
-#endif
-#ifdef BUS_GAMEPORT
-	if(!strcmp(s, "BUS_GAMEPORT"))	return BUS_GAMEPORT;
-#endif
-#ifdef BUS_PARPORT
-	if(!strcmp(s, "BUS_PARPORT"))	return BUS_PARPORT;
-#endif
-#ifdef BUS_AMIGA
-	if(!strcmp(s, "BUS_AMIGA"))	return BUS_AMIGA;
-#endif
-#ifdef BUS_ADB
-	if(!strcmp(s, "BUS_ADB"))	return BUS_ADB;
-#endif
-#ifdef BUS_I2C
-	if(!strcmp(s, "BUS_I2C"))	return BUS_I2C;
-#endif
-#ifdef BUS_HOST
-	if(!strcmp(s, "BUS_HOST"))	return BUS_HOST;
-#endif
-#ifdef BUS_GSC
-	if(!strcmp(s, "BUS_GSC"))	return BUS_GSC;
-#endif
-#ifdef BUS_ATARI
-	if(!strcmp(s, "BUS_ATARI"))	return BUS_ATARI;
-#endif
-	if (atoi(s) > 0) {
-		return atoi(s);
-	}
-
-#endif
-	return 0;
-}
-
-static void load_tslib_cal(void) {
-	FILE *f;
-	char line[1024], *p;
-	int i;
-
-	/* /etc/pointercal -528 33408 -3417516 -44200 408 40292028 56541 */
-
-	/* this is the identity transformation: */
-	a[0] = 1.0;
-	a[1] = 0.0;
-	a[2] = 0.0;
-	a[3] = 0.0;
-	a[4] = 1.0;
-	a[5] = 0.0;
-	a[6] = 1.0;
-
-	if (tslib_cal == NULL) {
-		return;
-	}
-
-	rfbLog("load_tslib_cal: reading %s\n", tslib_cal);
-	f = fopen(tslib_cal, "r");
-	if (f == NULL) {
-		rfbLogPerror("load_tslib_cal: fopen");
-		clean_up_exit(1);
-	}
-
-	if (fgets(line, sizeof(line), f) == NULL) {
-		rfbLogPerror("load_tslib_cal: fgets");
-		clean_up_exit(1);
-	}
-	fclose(f);
-
-	p = strtok(line, " \t");
-	i = 0;
-	while (p) {
-		a[i] = (double) atoi(p);
-		rfbLog("load_tslib_cal: a[%d] %.3f\n", i, a[i]);
-		p = strtok(NULL, " \t");
-		i++;
-		if (i >= 7) {
-			break;
-		}
-	}
-	if (i != 7) {
-		rfbLog("load_tslib_cal: invalid tslib file format: i=%d %s\n",
-		    i, tslib_cal);
-		clean_up_exit(1);
-	}
-}
-
-
-int initialize_uinput(void) {
-#ifndef UINPUT_OK
-	return 0;
-#else
-	int i;
-	char *s;
-	struct uinput_user_dev udev;
-
-	if (fd >= 0) {
-		shutdown_uinput();
-	}
-	fd = -1;
-
-	if (getenv("X11VNC_UINPUT_DEBUG")) {
-		db = atoi(getenv("X11VNC_UINPUT_DEBUG"));
-		rfbLog("set uinput debug to: %d\n", db);
-	}
-
-	if (tslib_cal) {
-		load_tslib_cal();	
-	}
-
-	init_key_tracker();
-	
-	if (uinput_dev) {
-		if (!strcmp(uinput_dev, "nouinput")) {
-			rfbLog("initialize_uinput: not creating uinput device.\n");
-			return 1;
-		} else {
-			fd = open(uinput_dev, O_WRONLY | O_NDELAY);
-			rfbLog("initialize_uinput: using: %s %d\n", uinput_dev, fd);
-		}
-	} else {
-		i = 0;
-		while (devs[i] != NULL) {
-			if ( (fd = open(devs[i], O_WRONLY | O_NDELAY)) >= 0) {
-				rfbLog("initialize_uinput: using: %s %d\n",
-				    devs[i], fd);
-				break;
-			}
-			i++;
-		}
-	}
-	if (fd < 0) {
-		rfbLog("initialize_uinput: could not open an uinput device.\n");
-		rfbLogPerror("open");
-		if (direct_rel_fd < 0 && direct_abs_fd < 0 && direct_btn_fd < 0 && direct_key_fd < 0) {
-			clean_up_exit(1);
-		}
-		return 1;
-	}
-
-	memset(&udev, 0, sizeof(udev));
-
-	strncpy(udev.name, "x11vnc injector", UINPUT_MAX_NAME_SIZE);
-
-	s = getenv("X11VNC_UINPUT_BUS");
-	if (s) {
-		udev.id.bustype = get_bustype(s);
-	} else if (0) {
-		udev.id.bustype = BUS_USB;
-	}
-
-	s = getenv("X11VNC_UINPUT_VERSION");
-	if (s) {
-		udev.id.version = atoi(s);
-	} else if (0) {
-		udev.id.version = 4;
-	}
-
-	ioctl(fd, UI_SET_EVBIT, EV_REL);
-	ioctl(fd, UI_SET_RELBIT, REL_X);
-	ioctl(fd, UI_SET_RELBIT, REL_Y);
-
-	ioctl(fd, UI_SET_EVBIT, EV_KEY);
-
-	ioctl(fd, UI_SET_EVBIT, EV_SYN);
-
-	for (i=0; i < 256; i++) {
-		ioctl(fd, UI_SET_KEYBIT, i);
-	}
-
-	ioctl(fd, UI_SET_KEYBIT, BTN_MOUSE);
-	ioctl(fd, UI_SET_KEYBIT, BTN_LEFT);
-	ioctl(fd, UI_SET_KEYBIT, BTN_MIDDLE);
-	ioctl(fd, UI_SET_KEYBIT, BTN_RIGHT);
-	ioctl(fd, UI_SET_KEYBIT, BTN_FORWARD);
-	ioctl(fd, UI_SET_KEYBIT, BTN_BACK);
-
-	if (uinput_touchscreen) {
-		ioctl(fd, UI_SET_KEYBIT, BTN_TOUCH);
-		rfbLog("uinput: touchscreen enabled.\n");
-	}
-	if (uinput_touchscreen || uinput_abs) {
-		int gw = abs_x, gh = abs_y;
-		if (! gw || ! gh) {
-			gw = fb_x; gh = fb_y;
-		}
-		if (! gw || ! gh) {
-			gw = dpy_x; gh = dpy_y;
-		}
-		abs_x = gw;
-		abs_y = gh;
-		ioctl(fd, UI_SET_EVBIT, EV_ABS);
-		ioctl(fd, UI_SET_ABSBIT, ABS_X);
-		ioctl(fd, UI_SET_ABSBIT, ABS_Y);
-		udev.absmin[ABS_X] = 0;
-		udev.absmax[ABS_X] = gw;
-		udev.absfuzz[ABS_X] = 0;
-		udev.absflat[ABS_X] = 0;
-		udev.absmin[ABS_Y] = 0;
-		udev.absmax[ABS_Y] = gh;
-		udev.absfuzz[ABS_Y] = 0;
-		udev.absflat[ABS_Y] = 0;
-		rfbLog("uinput: absolute pointer enabled at %dx%d.\n", abs_x, abs_y);
-		set_uinput_accel_xy(1.0, 1.0);
-	}
-
-	if (db) {
-		rfbLog("   udev.name:             %s\n", udev.name);
-		rfbLog("   udev.id.bustype:       %d\n", udev.id.bustype);
-		rfbLog("   udev.id.vendor:        %d\n", udev.id.vendor);
-		rfbLog("   udev.id.product:       %d\n", udev.id.product);
-		rfbLog("   udev.id.version:       %d\n", udev.id.version);
-		rfbLog("   udev.ff_effects_max:   %d\n", udev.ff_effects_max);
-		rfbLog("   udev.absmin[ABS_X]:    %d\n", udev.absmin[ABS_X]);
-		rfbLog("   udev.absmax[ABS_X]:    %d\n", udev.absmax[ABS_X]);
-		rfbLog("   udev.absfuzz[ABS_X]:   %d\n", udev.absfuzz[ABS_X]);
-		rfbLog("   udev.absflat[ABS_X]:   %d\n", udev.absflat[ABS_X]);
-		rfbLog("   udev.absmin[ABS_Y]:    %d\n", udev.absmin[ABS_Y]);
-		rfbLog("   udev.absmax[ABS_Y]:    %d\n", udev.absmax[ABS_Y]);
-		rfbLog("   udev.absfuzz[ABS_Y]:   %d\n", udev.absfuzz[ABS_Y]);
-		rfbLog("   udev.absflat[ABS_Y]:   %d\n", udev.absflat[ABS_Y]);
-	}
-
-	write(fd, &udev, sizeof(udev));
-
-	if (ioctl(fd, UI_DEV_CREATE) != 0) {
-		rfbLog("ioctl(fd, UI_DEV_CREATE) failed.\n");
-		rfbLogPerror("ioctl");
-		close(fd);
-		clean_up_exit(1);
-	}
-	return 1;
-#endif
-}
-
-/* these defaults are based on qt-embedded 7/2006 */
-static double fudge_x = 0.5;	/* accel=2.0 */
-static double fudge_y = 0.5;
-
-static int thresh = 5;
-static int thresh_or = 1;
-
-static double resid_x = 0.0;
-static double resid_y = 0.0;
-
-static double zero_delay = 0.15;
-static double last_button_click = 0.0;
-
-static int uinput_always = 0;
-
-static void set_uinput_accel_xy(double fx, double fy) {
-	fudge_x = 1.0/fx;
-	fudge_y = 1.0/fy;
-	rfbLog("set_uinput_accel:  fx=%.5f fy=%.5f\n", fx, fy);
-	rfbLog("set_uinput_accel:  ix=%.5f iy=%.5f\n", fudge_x, fudge_y);
-}
-
-static char *uinput_accel_str = NULL;
-static char *uinput_thresh_str = NULL;
-
-int set_uinput_accel(char *str) {
-	double fx, fy;
-	rfbLog("set_uinput_accel: str=%s\n", str);
-	if (sscanf(str, "%lf+%lf", &fx, &fy) == 2) {
-		set_uinput_accel_xy(fx, fy);
-	} else if (sscanf(str, "%lf", &fx) == 1) {
-		set_uinput_accel_xy(fx, fx);
-	} else {
-		rfbLog("invalid UINPUT accel= option: %s\n", str);
-		return 0;
-	}
-	if (uinput_accel_str) {
-		free(uinput_accel_str);
-	}
-	uinput_accel_str = strdup(str);
-	return 1;
-}
-
-int set_uinput_thresh(char *str) {
-	rfbLog("set_uinput_thresh: str=%s\n", str);
-	if (str[0] == '+') {
-		thresh_or = 0;
-	}
-	thresh = atoi(str);
-	if (uinput_thresh_str) {
-		free(uinput_thresh_str);
-	}
-	uinput_thresh_str = strdup(str);
-	return 1;
-}
-
-void set_uinput_reset(int ms) {
-	zero_delay = (double) ms/1000.;
-	rfbLog("set_uinput_reset: %d\n", ms);
-}
-
-void set_uinput_always(int a) {
-	uinput_always = a;
-}
-
-void set_uinput_touchscreen(int b) {
-	uinput_touchscreen = b;
-}
-
-void set_uinput_abs(int b) {
-	uinput_abs = b;
-}
-
-char *get_uinput_accel(void) {
-	return uinput_accel_str;
-}
-char *get_uinput_thresh(void) {
-	return uinput_thresh_str;
-}
-int get_uinput_reset(void) {
-	return (int) (1000 * zero_delay);
-}
-
-int get_uinput_always(void) {
-	return uinput_always;
-}
-
-int get_uinput_touchscreen(void) {
-	return uinput_touchscreen;
-}
-
-int get_uinput_abs(void) {
-	return uinput_abs;
-}
-
-void parse_uinput_str(char *in) {
-	char *p, *q, *str = strdup(in);
-
-	if (injectable) {
-		free(injectable);
-		injectable = strdup("KMB");
-	}
-
-	uinput_touchscreen = 0;
-	uinput_abs = 0;
-	abs_x = abs_y = 0;
-
-	if (tslib_cal) {
-		free(tslib_cal);
-		tslib_cal = NULL;
-	}
-
-	p = strtok(str, ",");
-	while (p) {
-		if (p[0] == '/') {
-			if (uinput_dev) {
-				free(uinput_dev);
-			}
-			uinput_dev = strdup(p);
-		} else if (strstr(p, "nouinput") == p) {
-			if (uinput_dev) {
-				free(uinput_dev);
-			}
-			uinput_dev = strdup(p);
-		} else if (strstr(p, "accel=") == p) {
-			q = p + strlen("accel=");
-			if (! set_uinput_accel(q)) {
-				clean_up_exit(1);
-			}
-		} else if (strstr(p, "thresh=") == p) {
-			q = p + strlen("thresh=");
-			set_uinput_thresh(q);
-
-		} else if (strstr(p, "reset=") == p) {
-			int n = atoi(p + strlen("reset="));
-			set_uinput_reset(n);
-		} else if (strstr(p, "always=") == p) {
-			int n = atoi(p + strlen("always="));
-			set_uinput_always(n);
-		} else if (strpbrk(p, "KMB") == p) {
-			if (injectable) {
-				free(injectable);
-			}
-			injectable = strdup(p);
-		} else if (strstr(p, "touch_always=") == p) {
-			touch_always = atoi(p + strlen("touch_always="));
-		} else if (strstr(p, "btn_touch=") == p) {
-			btn_touch = atoi(p + strlen("btn_touch="));
-		} else if (strstr(p, "dragskip=") == p) {
-			dragskip = atoi(p + strlen("dragskip="));
-		} else if (strstr(p, "touch") == p) {
-			int gw, gh;
-			q = strchr(p, '=');
-			set_uinput_touchscreen(1);
-			set_uinput_abs(1);
-			if (q && sscanf(q+1, "%dx%d", &gw, &gh) == 2) {
-				abs_x = gw;
-				abs_y = gh;
-			}
-		} else if (strstr(p, "abs") == p) {
-			int gw, gh;
-			q = strchr(p, '=');
-			set_uinput_abs(1);
-			if (q && sscanf(q+1, "%dx%d", &gw, &gh) == 2) {
-				abs_x = gw;
-				abs_y = gh;
-			}
-		} else if (strstr(p, "pressure=") == p) {
-			touch_pressure = atoi(p + strlen("pressure="));
-		} else if (strstr(p, "direct_rel=") == p) {
-			direct_rel_fd = open(p+strlen("direct_rel="), O_WRONLY);
-			if (direct_rel_fd < 0) {
-				rfbLogPerror("uinput: direct_rel open");
-			} else {
-				rfbLog("uinput: opened: %s fd=%d\n", p, direct_rel_fd);
-			}
-		} else if (strstr(p, "direct_abs=") == p) {
-			direct_abs_fd = open(p+strlen("direct_abs="), O_WRONLY);
-			if (direct_abs_fd < 0) {
-				rfbLogPerror("uinput: direct_abs open");
-			} else {
-				rfbLog("uinput: opened: %s fd=%d\n", p, direct_abs_fd);
-			}
-		} else if (strstr(p, "direct_btn=") == p) {
-			direct_btn_fd = open(p+strlen("direct_btn="), O_WRONLY);
-			if (direct_btn_fd < 0) {
-				rfbLogPerror("uinput: direct_btn open");
-			} else {
-				rfbLog("uinput: opened: %s fd=%d\n", p, direct_btn_fd);
-			}
-		} else if (strstr(p, "direct_key=") == p) {
-			direct_key_fd = open(p+strlen("direct_key="), O_WRONLY);
-			if (direct_key_fd < 0) {
-				rfbLogPerror("uinput: direct_key open");
-			} else {
-				rfbLog("uinput: opened: %s fd=%d\n", p, direct_key_fd);
-			}
-		} else if (strstr(p, "tslib_cal=") == p) {
-			tslib_cal = strdup(p+strlen("tslib_cal="));
-		} else {
-			rfbLog("invalid UINPUT option: %s\n", p);
-			clean_up_exit(1);
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-}
-
-static void ptr_move(int dx, int dy) {
-#ifdef UINPUT_OK
-	struct input_event ev;
-	int d = direct_rel_fd < 0 ? fd : direct_rel_fd;
-
-	if (injectable && strchr(injectable, 'M') == NULL) {
-		return;
-	}
-
-	memset(&ev, 0, sizeof(ev));
-
-	if (db) fprintf(stderr, "ptr_move(%d, %d) fd=%d\n", dx, dy, d);
-
-	gettimeofday(&ev.time, NULL);
-	ev.type = EV_REL;
-	ev.code = REL_Y;
-	ev.value = dy;
-	write(d, &ev, sizeof(ev));
-
-	ev.type = EV_REL;
-	ev.code = REL_X;
-	ev.value = dx;
-	write(d, &ev, sizeof(ev));
-
-	ev.type = EV_SYN;
-	ev.code = SYN_REPORT;
-	ev.value = 0;
-	write(d, &ev, sizeof(ev));
-#else
-	if (!dx || !dy) {}
-#endif
-}
-
-static void apply_tslib(int *x, int *y) {
-	double x1 = *x, y1 = *y, x2, y2;
-
-	/* this is the inverse of the tslib linear transform: */
-	x2 = (a[4] * (a[6] * x1 - a[2]) - a[1] * (a[6] * y1 - a[5]))/(a[4]*a[0] - a[1]*a[3]);
-	y2 = (a[0] * (a[6] * y1 - a[5]) - a[3] * (a[6] * x1 - a[2]))/(a[4]*a[0] - a[1]*a[3]);
-
-	*x = (int) x2;
-	*y = (int) y2;
-}
-	
-
-static void ptr_abs(int x, int y, int p) {
-#ifdef UINPUT_OK
-	struct input_event ev;
-	int x0, y0;
-	int d = direct_abs_fd < 0 ? fd : direct_abs_fd;
-
-	if (injectable && strchr(injectable, 'M') == NULL) {
-		return;
-	}
-
-	memset(&ev, 0, sizeof(ev));
-
-	x0 = x;
-	y0 = y;
-
-	if (tslib_cal) {
-		apply_tslib(&x, &y);
-	}
-
-	if (db) fprintf(stderr, "ptr_abs(%d, %d => %d %d, p=%d) fd=%d\n", x0, y0, x, y, p, d);
-
-	gettimeofday(&ev.time, NULL);
-	ev.type = EV_ABS;
-	ev.code = ABS_Y;
-	ev.value = y;
-	write(d, &ev, sizeof(ev));
-
-	ev.type = EV_ABS;
-	ev.code = ABS_X;
-	ev.value = x;
-	write(d, &ev, sizeof(ev));
-
-	if (p >= 0) {
-		ev.type = EV_ABS;
-		ev.code = ABS_PRESSURE;
-		ev.value = p;
-		write(d, &ev, sizeof(ev));
-	}
-
-	ev.type = EV_SYN;
-	ev.code = SYN_REPORT;
-	ev.value = 0;
-	write(d, &ev, sizeof(ev));
-#else
-	if (!x || !y) {}
-#endif
-}
-
-static int inside_thresh(int dx, int dy, int thr) {
-	if (thresh_or) {
-		/* this is peeking at qt-embedded qmouse_qws.cpp */
-		if (nabs(dx) <= thresh && nabs(dy) <= thr) {
-			return 1;
-		}
-	} else {
-		/* this is peeking at xfree/xorg xf86Xinput.c */
-		if (nabs(dx) + nabs(dy) < thr) {
-			return 1;
-		}
-	}
-	return 0;
-}
-
-static void ptr_rel(int dx, int dy) {
-	int dxf, dyf, nx, ny, k;
-	int accel, thresh_high, thresh_mid;
-	double fx, fy;
-	static int try_threshes = -1;
-
-	if (try_threshes < 0) {
-		if (getenv("X11VNC_UINPUT_THRESHOLDS")) {
-			try_threshes = 1;
-		} else {
-			try_threshes = 0;
-		}
-	}
-
-	if (try_threshes) {
-		thresh_high = (int) ( (double) thresh/fudge_x );
-		thresh_mid =  (int) ( (double) (thresh + thresh_high) / 2.0 );
-
-		if (thresh_mid <= thresh) {
-			thresh_mid = thresh + 1;
-		}
-		if (thresh_high <= thresh_mid) {
-			thresh_high = thresh_mid + 1;
-		}
-
-		if (inside_thresh(dx, dy, thresh)) {
-			accel = 0;
-		} else {
-			accel = 1;
-		}
-		nx = nabs(dx);
-		ny = nabs(dy);
-
-	} else {
-		accel = 1;
-		thresh_high = 0;
-		nx = ny = 1;
-	}
-
-	if (accel && nx + ny > 0 ) {
-		if (thresh_high > 0 && inside_thresh(dx, dy, thresh_high)) {
-			double alpha, t;
-			/* XXX */
-			if (1 || inside_thresh(dx, dy, thresh_mid)) {
-				t = thresh; 
-				accel = 2;
-			} else {
-				accel = 3;
-				t = thresh_high;
-			}
-			if (thresh_or) {
-				if (nx > ny) {
-					fx = t;
-					fy =  ((double) ny / (double) nx) * t;
-				} else {
-					fx =  ((double) nx / (double) ny) * t;
-					fy = t;
-				}
-				dxf = (int) fx;
-				dyf = (int) fy;
-				fx = dx;
-				fy = dy;
-				
-			} else {
-				if (t > 1) {
-					/* XXX */
-					t = t - 1.0;
-				}
-				alpha = t/(nx + ny);
-				fx = alpha * dx;
-				fy = alpha * dy;
-				dxf = (int) fx;
-				dyf = (int) fy;
-				fx = dx;
-				fy = dy;
-			}
-		} else {
-			fx = fudge_x * (double) dx;
-			fy = fudge_y * (double) dy;
-			dxf = (int) fx;
-			dyf = (int) fy;
-		}
-	} else {
-		fx = dx;
-		fy = dy;
-		dxf = dx;
-		dyf = dy;
-	}
-
-	if (db > 1) fprintf(stderr, "old dx dy: %d %d\n", dx, dy);
-	if (db > 1) fprintf(stderr, "new dx dy: %d %d  accel: %d\n", dxf, dyf, accel);
-
-	ptr_move(dxf, dyf);
-
-	resid_x += fx - dxf;
-	resid_y += fy - dyf;
-
-	for (k = 0; k < 4; k++) {
-		if (resid_x <= -1.0 || resid_x >= 1.0 || resid_y <= -1.0 || resid_y >= 1.0) {
-			dxf = 0;
-			dyf = 0;
-			if (resid_x >= 1.0) {
-				dxf = (int) resid_x;
-				dxf = 1;
-			} else if (resid_x <= -1.0)  {
-				dxf = -((int) (-resid_x));
-				dxf = -1;
-			}
-			resid_x -= dxf;
-			if (resid_y >= 1.0) {
-				dyf = (int) resid_y;
-				dyf = 1;
-			} else if (resid_y <= -1.0)  {
-				dyf = -((int) (-resid_y));
-				dyf = -1;
-			}
-			resid_y -= dyf;
-
-			if (db > 1) fprintf(stderr, "*%s resid: dx dy: %d %d  %f %f\n", accel > 1 ? "*" : " ", dxf, dyf, resid_x, resid_y);
-if (0) {usleep(100*1000) ;}
-			ptr_move(dxf, dyf);
-		}
-	}
-}
-
-static void button_click(int down, int btn) {
-#ifdef UINPUT_OK
-	struct input_event ev;
-	int d = direct_btn_fd < 0 ? fd : direct_btn_fd;
-
-	if (injectable && strchr(injectable, 'B') == NULL) {
-		return;
-	}
-
-	if (db) fprintf(stderr, "button_click: btn %d %s fd=%d\n", btn, down ? "down" : "up", d);
-
-	memset(&ev, 0, sizeof(ev));
-	gettimeofday(&ev.time, NULL);
-	ev.type = EV_KEY;
-	ev.value = down;
-
-	if (uinput_touchscreen) {
-		ev.code = BTN_TOUCH;
-		if (db) fprintf(stderr, "set code to BTN_TOUCH\n");
-	} else if (btn == 1) {
-		ev.code = BTN_LEFT;
-	} else if (btn == 2) {
-		ev.code = BTN_MIDDLE;
-	} else if (btn == 3) {
-		ev.code = BTN_RIGHT;
-	} else if (btn == 4) {
-		ev.code = BTN_FORWARD;
-	} else if (btn == 5) {
-		ev.code = BTN_BACK;
-	} else {
-		return;
-	}
-
-	write(d, &ev, sizeof(ev));
-
-	ev.type = EV_SYN;
-	ev.code = SYN_REPORT;
-	ev.value = 0;
-	write(d, &ev, sizeof(ev));
-
-	last_button_click = dnow();
-#else
-	if (!down || !btn) {}
-#endif
-}
-
-
-void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
-	static int last_x = -1, last_y = -1, last_mask = -1;
-	static double last_zero = 0.0;
-	allowed_input_t input;
-	int do_reset, reset_lower_right = 1;
-	double now;
-	static int first = 1;
-
-	if (first) {
-		if (getenv("RESET_ALWAYS")) {
-			set_uinput_always(1);
-		} else {
-			set_uinput_always(0);
-		}
-	}
-	first = 0;
-	
-	if (db) fprintf(stderr, "uinput_pointer_command: %d %d - %d\n", x, y, mask);
-
-	if (view_only) {
-		return;
-	}
-	get_allowed_input(client, &input);
-
-	now = dnow();
-
-	do_reset = 1;
-	if (mask || bmask) {
-		do_reset = 0;	/* do not do reset if mouse button down */
-	} else if (! input.motion) {
-		do_reset = 0;
-	} else if (now < last_zero + zero_delay) {
-		do_reset = 0;
-	}
-	if (do_reset) {
-		if (mod_is_down()) {
-			do_reset = 0;
-		} else if (now < last_button_click + 0.25) {
-			do_reset = 0;
-		}
-	}
-
-	if (uinput_always && !mask && !bmask && input.motion) {
-		do_reset = 1;
-	}
-	if (uinput_abs) {
-		do_reset = 0;
-	}
-
-	if (do_reset) {
-		static int first = 1;
-
-		if (zero_delay > 0.0 || first) {
-			/* try to push it to 0,0 */
-			int tx, ty, bigjump = 1;
-
-			if (reset_lower_right) {
-				tx = fudge_x * (dpy_x - last_x);
-				ty = fudge_y * (dpy_y - last_y);
-			} else {
-				tx = fudge_x * last_x;
-				ty = fudge_y * last_y;
-			}
-
-			tx += 50;
-			ty += 50;
-
-			if (bigjump) {
-				if (reset_lower_right) {
-					ptr_move(0, +ty);
-					usleep(2*1000);
-					ptr_move(+tx, +ty);
-					ptr_move(+tx, +ty);
-				} else {
-					ptr_move(0, -ty);
-					usleep(2*1000);
-					ptr_move(-tx, -ty);
-					ptr_move(-tx, -ty);
-				}
-			} else {
-				int i, step, n = 20;
-				step = dpy_x / n;
-
-				if (step < 100) step = 100;
-
-				for (i=0; i < n; i++)  {
-					if (reset_lower_right) {
-						ptr_move(+step, +step);
-					} else {
-						ptr_move(-step, -step);
-					}
-				}
-				for (i=0; i < n; i++)  {
-					if (reset_lower_right) {
-						ptr_move(+1, +1);
-					} else {
-						ptr_move(-1, -1);
-					}
-				}
-			}
-			if (db) {
-				if (reset_lower_right) {
-					fprintf(stderr, "uinput_pointer_command: reset -> (W,H) (%d,%d)  [%d,%d]\n", x, y, tx, ty);
-				} else {
-					fprintf(stderr, "uinput_pointer_command: reset -> (0,0) (%d,%d)  [%d,%d]\n", x, y, tx, ty);
-				}
-			}
-
-			/* rest a bit for system to absorb the change */
-			if (uinput_always) {
-				static double last_sleep = 0.0;
-				double nw = dnow(), delay = zero_delay;
-				if (delay <= 0.0) delay = 0.1;
-				if (nw > last_sleep + delay) {
-					usleep(10*1000);
-					last_sleep = nw;
-				} else {
-					usleep(1*1000);
-				}
-				
-			} else {
-				usleep(30*1000);
-			}
-
-			/* now jump back out */
-			if (reset_lower_right) {
-				ptr_rel(x - dpy_x, y - dpy_y);
-			} else {
-				ptr_rel(x, y);
-			}
-			if (1) {usleep(10*1000) ;}
-
-			last_x = x;
-			last_y = y;
-			resid_x = 0.0;
-			resid_y = 0.0;
-
-			first = 0;
-		}
-		last_zero = dnow();
-	}
-
-	if (input.motion) {
-		if (x != last_x || y != last_y) {
-			if (uinput_touchscreen) {
-				;
-			} else if (uinput_abs) {
-				ptr_abs(x, y, -1);
-			} else {
-				ptr_rel(x - last_x, y - last_y);
-			}
-			last_x = x;
-			last_y = y;
-		}
-	}
-
-	if (! input.button) {
-		return;
-	}
-
-	if (last_mask < 0) {
-		last_mask = mask;
-	}
-
-	if (db > 2) {
-		fprintf(stderr, "mask:        %s\n", bitprint(mask, 16));
-		fprintf(stderr, "bmask:       %s\n", bitprint(bmask, 16));
-		fprintf(stderr, "last_mask:   %s\n", bitprint(last_mask, 16));
-		fprintf(stderr, "button_mask: %s\n", bitprint(button_mask, 16));
-	}
-
-	if (uinput_touchscreen) {
-		if (!btn_touch) {
-			static int down_count = 0;
-			int p = touch_pressure >=0 ? touch_pressure : 0;
-			if (!last_mask && !mask) {
-				if (touch_always) {
-					ptr_abs(last_x, last_y, 0);
-				}
-			} else if (!last_mask && mask) {
-				ptr_abs(last_x, last_y, p);
-				down_count = 0;
-			} else if (last_mask && !mask) {
-				ptr_abs(last_x, last_y, 0);
-			} else if (last_mask && mask) {
-				down_count++;
-				if (dragskip > 0) {
-					if (down_count % dragskip == 0) {
-						ptr_abs(last_x, last_y, p);
-					}
-				} else {
-					ptr_abs(last_x, last_y, p);
-				}
-			}
-		} else {
-			if (!last_mask && !mask) {
-				if (touch_always) {
-					ptr_abs(last_x, last_y, 0);
-				}
-			} else if (!last_mask && mask) {
-				ptr_abs(last_x, last_y, 0);
-				button_click(1, 0);
-			} else if (last_mask && !mask) {
-				ptr_abs(last_x, last_y, 0);
-				button_click(0, 0);
-			} else if (last_mask && mask) {
-				;
-			}
-		}
-		last_mask = mask;
-	} else if (mask != last_mask) {
-		int i;
-		for (i=1; i <= MAX_BUTTONS; i++) {
-			int down, b = 1 << (i-1);
-			if ( (last_mask & b) == (mask & b)) {
-				continue;
-			}
-			if (mask & b) {
-				down = 1;
-			} else {
-				down = 0;
-			}
-			button_click(down, i);
-		}
-		if (mask && uinput_abs && touch_pressure >= 0) {
-			ptr_abs(last_x, last_y, touch_pressure);
-		}
-		last_mask = mask;
-	}
-	bmask = mask;
-}
-
-void uinput_key_command(int down, int keysym, rfbClientPtr client) {
-#ifdef UINPUT_OK
-	struct input_event ev;
-	int scancode;
-	allowed_input_t input;
-	int d = direct_key_fd < 0 ? fd : direct_key_fd;
-
-	if (injectable && strchr(injectable, 'K') == NULL) {
-		return;
-	}
-	if (view_only) {
-		return;
-	}
-	get_allowed_input(client, &input);
-	if (! input.keystroke) {
-		return;
-	}
-
-	scancode = lookup_code(keysym);
-
-	if (scancode < 0) {
-		return;
-	}
-	if (db) fprintf(stderr, "uinput_key_command: %d -> %d %s fd=%d\n", keysym, scancode, down ? "down" : "up", d);
-
-	memset(&ev, 0, sizeof(ev));
-	gettimeofday(&ev.time, NULL);
-	ev.type = EV_KEY;
-	ev.code = (unsigned char) scancode;
-	ev.value = down;
-
-	write(d, &ev, sizeof(ev));
-
-	ev.type = EV_SYN;
-	ev.code = SYN_REPORT;
-	ev.value = 0;
-	write(d, &ev, sizeof(ev));
-
-	if (0 <= scancode && scancode < 256) {
-		key_pressed[scancode] = down ? 1 : 0;
-	}
-#else
-	if (!down || !keysym || !client) {}
-#endif
-}
-
-#if 0
-  grep 'case XK_' x0vnc.c | sed -e 's/case /$key_lookup{/' -e 's/:/}/' -e 's/return /= $/'
-#endif
-
-static int lookup_code(int keysym) {
-
-	if (keysym == NoSymbol) {
-		return -1;
-	}
-
-	switch(keysym) {
-#ifdef UINPUT_OK
-	case XK_Escape:	return KEY_ESC;
-	case XK_1:		return KEY_1;
-	case XK_2:		return KEY_2;
-	case XK_3:		return KEY_3;
-	case XK_4:		return KEY_4;
-	case XK_5:		return KEY_5;
-	case XK_6:		return KEY_6;
-	case XK_7:		return KEY_7;
-	case XK_8:		return KEY_8;
-	case XK_9:		return KEY_9;
-	case XK_0:		return KEY_0;
-	case XK_exclam:	return KEY_1;
-	case XK_at:		return KEY_2;
-	case XK_numbersign:	return KEY_3;
-	case XK_dollar:	return KEY_4;
-	case XK_percent:	return KEY_5;
-	case XK_asciicircum:	return KEY_6;
-	case XK_ampersand:	return KEY_7;
-	case XK_asterisk:	return KEY_8;
-	case XK_parenleft:	return KEY_9;
-	case XK_parenright:	return KEY_0;
-	case XK_minus:	return KEY_MINUS;
-	case XK_underscore:	return KEY_MINUS;
-	case XK_equal:	return KEY_EQUAL;
-	case XK_plus:	return KEY_EQUAL;
-	case XK_BackSpace:	return KEY_BACKSPACE;
-	case XK_Tab:		return KEY_TAB;
-	case XK_q:		return KEY_Q;
-	case XK_Q:		return KEY_Q;
-	case XK_w:		return KEY_W;
-	case XK_W:		return KEY_W;
-	case XK_e:		return KEY_E;
-	case XK_E:		return KEY_E;
-	case XK_r:		return KEY_R;
-	case XK_R:		return KEY_R;
-	case XK_t:		return KEY_T;
-	case XK_T:		return KEY_T;
-	case XK_y:		return KEY_Y;
-	case XK_Y:		return KEY_Y;
-	case XK_u:		return KEY_U;
-	case XK_U:		return KEY_U;
-	case XK_i:		return KEY_I;
-	case XK_I:		return KEY_I;
-	case XK_o:		return KEY_O;
-	case XK_O:		return KEY_O;
-	case XK_p:		return KEY_P;
-	case XK_P:		return KEY_P;
-	case XK_braceleft:	return KEY_LEFTBRACE;
-	case XK_braceright:	return KEY_RIGHTBRACE;
-	case XK_bracketleft:	return KEY_LEFTBRACE;
-	case XK_bracketright:	return KEY_RIGHTBRACE;
-	case XK_Return:	return KEY_ENTER;
-	case XK_Control_L:	return KEY_LEFTCTRL;
-	case XK_a:		return KEY_A;
-	case XK_A:		return KEY_A;
-	case XK_s:		return KEY_S;
-	case XK_S:		return KEY_S;
-	case XK_d:		return KEY_D;
-	case XK_D:		return KEY_D;
-	case XK_f:		return KEY_F;
-	case XK_F:		return KEY_F;
-	case XK_g:		return KEY_G;
-	case XK_G:		return KEY_G;
-	case XK_h:		return KEY_H;
-	case XK_H:		return KEY_H;
-	case XK_j:		return KEY_J;
-	case XK_J:		return KEY_J;
-	case XK_k:		return KEY_K;
-	case XK_K:		return KEY_K;
-	case XK_l:		return KEY_L;
-	case XK_L:		return KEY_L;
-	case XK_semicolon:	return KEY_SEMICOLON;
-	case XK_colon:	return KEY_SEMICOLON;
-	case XK_apostrophe:	return KEY_APOSTROPHE;
-	case XK_quotedbl:	return KEY_APOSTROPHE;
-	case XK_grave:	return KEY_GRAVE;
-	case XK_asciitilde:	return KEY_GRAVE;
-	case XK_Shift_L:	return KEY_LEFTSHIFT;
-	case XK_backslash:	return KEY_BACKSLASH;
-	case XK_bar:		return KEY_BACKSLASH;
-	case XK_z:		return KEY_Z;
-	case XK_Z:		return KEY_Z;
-	case XK_x:		return KEY_X;
-	case XK_X:		return KEY_X;
-	case XK_c:		return KEY_C;
-	case XK_C:		return KEY_C;
-	case XK_v:		return KEY_V;
-	case XK_V:		return KEY_V;
-	case XK_b:		return KEY_B;
-	case XK_B:		return KEY_B;
-	case XK_n:		return KEY_N;
-	case XK_N:		return KEY_N;
-	case XK_m:		return KEY_M;
-	case XK_M:		return KEY_M;
-	case XK_comma:	return KEY_COMMA;
-	case XK_less:	return KEY_COMMA;
-	case XK_period:	return KEY_DOT;
-	case XK_greater:	return KEY_DOT;
-	case XK_slash:	return KEY_SLASH;
-	case XK_question:	return KEY_SLASH;
-	case XK_Shift_R:	return KEY_RIGHTSHIFT;
-	case XK_KP_Multiply:	return KEY_KPASTERISK;
-	case XK_Alt_L:	return KEY_LEFTALT;
-	case XK_space:	return KEY_SPACE;
-	case XK_Caps_Lock:	return KEY_CAPSLOCK;
-	case XK_F1:		return KEY_F1;
-	case XK_F2:		return KEY_F2;
-	case XK_F3:		return KEY_F3;
-	case XK_F4:		return KEY_F4;
-	case XK_F5:		return KEY_F5;
-	case XK_F6:		return KEY_F6;
-	case XK_F7:		return KEY_F7;
-	case XK_F8:		return KEY_F8;
-	case XK_F9:		return KEY_F9;
-	case XK_F10:		return KEY_F10;
-	case XK_Num_Lock:	return KEY_NUMLOCK;
-	case XK_Scroll_Lock:	return KEY_SCROLLLOCK;
-	case XK_KP_7:		return KEY_KP7;
-	case XK_KP_8:		return KEY_KP8;
-	case XK_KP_9:		return KEY_KP9;
-	case XK_KP_Subtract:	return KEY_KPMINUS;
-	case XK_KP_4:		return KEY_KP4;
-	case XK_KP_5:		return KEY_KP5;
-	case XK_KP_6:		return KEY_KP6;
-	case XK_KP_Add:	return KEY_KPPLUS;
-	case XK_KP_1:		return KEY_KP1;
-	case XK_KP_2:		return KEY_KP2;
-	case XK_KP_3:		return KEY_KP3;
-	case XK_KP_0:		return KEY_KP0;
-	case XK_KP_Decimal:	return KEY_KPDOT;
-	case XK_F13:		return KEY_F13;
-	case XK_F11:		return KEY_F11;
-	case XK_F12:		return KEY_F12;
-	case XK_F14:		return KEY_F14;
-	case XK_F15:		return KEY_F15;
-	case XK_F16:		return KEY_F16;
-	case XK_F17:		return KEY_F17;
-	case XK_F18:		return KEY_F18;
-	case XK_F19:		return KEY_F19;
-	case XK_F20:		return KEY_F20;
-	case XK_KP_Enter:	return KEY_KPENTER;
-	case XK_Control_R:	return KEY_RIGHTCTRL;
-	case XK_KP_Divide:	return KEY_KPSLASH;
-	case XK_Sys_Req:	return KEY_SYSRQ;
-	case XK_Alt_R:	return KEY_RIGHTALT;
-	case XK_Linefeed:	return KEY_LINEFEED;
-	case XK_Home:		return KEY_HOME;
-	case XK_Up:		return KEY_UP;
-	case XK_Page_Up:	return KEY_PAGEUP;
-	case XK_Left:		return KEY_LEFT;
-	case XK_Right:	return KEY_RIGHT;
-	case XK_End:		return KEY_END;
-	case XK_Down:		return KEY_DOWN;
-	case XK_Page_Down:	return KEY_PAGEDOWN;
-	case XK_Insert:	return KEY_INSERT;
-	case XK_Delete:	return KEY_DELETE;
-	case XK_KP_Equal:	return KEY_KPEQUAL;
-	case XK_Pause:	return KEY_PAUSE;
-	case XK_F21:		return KEY_F21;
-	case XK_F22:		return KEY_F22;
-	case XK_F23:		return KEY_F23;
-	case XK_F24:		return KEY_F24;
-	case XK_KP_Separator:	return KEY_KPCOMMA;
-	case XK_Meta_L:	return KEY_LEFTMETA;
-	case XK_Meta_R:	return KEY_RIGHTMETA;
-	case XK_Multi_key:	return KEY_COMPOSE;
-#endif
-	default:		return -1;
-	}
-}
-
-#if 0
-
-From /usr/include/linux/input.h
-
-We maintain it here since it is such a painful mess.
-
-Here is a little script to make it easier:
-
-#!/usr/bin/perl
-while (<>) {
-	$_ =~ s/-XK_/XK_/;
-	next unless /^XK_/;
-	chomp;
-	if (/^(\S+)(\s+)(\S+)/) {
-		$a = $1;
-		$t = $2;
-		$b = $3;
-		print "\tcase $a:${t}return $b;\n";
-		if ($a =~ /XK_[a-z]$/) {
-			$a = uc($a);
-			print "\tcase $a:${t}return $b;\n";
-		}
-	}
-}
-
-This only handles US kbd, we would need a kbd database in general...
-Ugh: parse dumpkeys(1) or -fookeys /usr/share/keymaps/i386/qwerty/dk.kmap.gz
-
-XK_Escape	KEY_ESC
-XK_1		KEY_1
-XK_2		KEY_2
-XK_3		KEY_3
-XK_4		KEY_4
-XK_5		KEY_5
-XK_6		KEY_6
-XK_7		KEY_7
-XK_8		KEY_8
-XK_9		KEY_9
-XK_0		KEY_0
--XK_exclam	KEY_1
--XK_at		KEY_2
--XK_numbersign	KEY_3
--XK_dollar	KEY_4
--XK_percent	KEY_5
--XK_asciicircum	KEY_6
--XK_ampersand	KEY_7
--XK_asterisk	KEY_8
--XK_parenleft	KEY_9
--XK_parenright	KEY_0
-XK_minus	KEY_MINUS
--XK_underscore	KEY_MINUS
-XK_equal	KEY_EQUAL
--XK_plus	KEY_EQUAL
-XK_BackSpace	KEY_BACKSPACE
-XK_Tab		KEY_TAB
-XK_q		KEY_Q
-XK_w		KEY_W
-XK_e		KEY_E
-XK_r		KEY_R
-XK_t		KEY_T
-XK_y		KEY_Y
-XK_u		KEY_U
-XK_i		KEY_I
-XK_o		KEY_O
-XK_p		KEY_P
-XK_braceleft	KEY_LEFTBRACE
-XK_braceright	KEY_RIGHTBRACE
--XK_bracketleft	KEY_LEFTBRACE
--XK_bracketright	KEY_RIGHTBRACE
-XK_Return	KEY_ENTER
-XK_Control_L	KEY_LEFTCTRL
-XK_a		KEY_A
-XK_s		KEY_S
-XK_d		KEY_D
-XK_f		KEY_F
-XK_g		KEY_G
-XK_h		KEY_H
-XK_j		KEY_J
-XK_k		KEY_K
-XK_l		KEY_L
-XK_semicolon	KEY_SEMICOLON
--XK_colon	KEY_SEMICOLON
-XK_apostrophe	KEY_APOSTROPHE
--XK_quotedbl	KEY_APOSTROPHE
-XK_grave	KEY_GRAVE
--XK_asciitilde	KEY_GRAVE
-XK_Shift_L	KEY_LEFTSHIFT
-XK_backslash	KEY_BACKSLASH
--XK_bar		KEY_BACKSLASH
-XK_z		KEY_Z
-XK_x		KEY_X
-XK_c		KEY_C
-XK_v		KEY_V
-XK_b		KEY_B
-XK_n		KEY_N
-XK_m		KEY_M
-XK_comma	KEY_COMMA
--XK_less	KEY_COMMA
-XK_period	KEY_DOT
--XK_greater	KEY_DOT
-XK_slash	KEY_SLASH
--XK_question	KEY_SLASH
-XK_Shift_R	KEY_RIGHTSHIFT
-XK_KP_Multiply	KEY_KPASTERISK
-XK_Alt_L	KEY_LEFTALT
-XK_space	KEY_SPACE
-XK_Caps_Lock	KEY_CAPSLOCK
-XK_F1		KEY_F1
-XK_F2		KEY_F2
-XK_F3		KEY_F3
-XK_F4		KEY_F4
-XK_F5		KEY_F5
-XK_F6		KEY_F6
-XK_F7		KEY_F7
-XK_F8		KEY_F8
-XK_F9		KEY_F9
-XK_F10		KEY_F10
-XK_Num_Lock	KEY_NUMLOCK
-XK_Scroll_Lock	KEY_SCROLLLOCK
-XK_KP_7		KEY_KP7
-XK_KP_8		KEY_KP8
-XK_KP_9		KEY_KP9
-XK_KP_Subtract	KEY_KPMINUS
-XK_KP_4		KEY_KP4
-XK_KP_5		KEY_KP5
-XK_KP_6		KEY_KP6
-XK_KP_Add	KEY_KPPLUS
-XK_KP_1		KEY_KP1
-XK_KP_2		KEY_KP2
-XK_KP_3		KEY_KP3
-XK_KP_0		KEY_KP0
-XK_KP_Decimal	KEY_KPDOT
-NoSymbol	KEY_103RD
-XK_F13		KEY_F13
-NoSymbol	KEY_102ND
-XK_F11		KEY_F11
-XK_F12		KEY_F12
-XK_F14		KEY_F14
-XK_F15		KEY_F15
-XK_F16		KEY_F16
-XK_F17		KEY_F17
-XK_F18		KEY_F18
-XK_F19		KEY_F19
-XK_F20		KEY_F20
-XK_KP_Enter	KEY_KPENTER
-XK_Control_R	KEY_RIGHTCTRL
-XK_KP_Divide	KEY_KPSLASH
-XK_Sys_Req	KEY_SYSRQ
-XK_Alt_R	KEY_RIGHTALT
-XK_Linefeed	KEY_LINEFEED
-XK_Home		KEY_HOME
-XK_Up		KEY_UP
-XK_Page_Up	KEY_PAGEUP
-XK_Left		KEY_LEFT
-XK_Right	KEY_RIGHT
-XK_End		KEY_END
-XK_Down		KEY_DOWN
-XK_Page_Down	KEY_PAGEDOWN
-XK_Insert	KEY_INSERT
-XK_Delete	KEY_DELETE
-NoSymbol	KEY_MACRO
-NoSymbol	KEY_MUTE
-NoSymbol	KEY_VOLUMEDOWN
-NoSymbol	KEY_VOLUMEUP
-NoSymbol	KEY_POWER
-XK_KP_Equal	KEY_KPEQUAL
-NoSymbol	KEY_KPPLUSMINUS
-XK_Pause	KEY_PAUSE
-XK_F21		KEY_F21
-XK_F22		KEY_F22
-XK_F23		KEY_F23
-XK_F24		KEY_F24
-XK_KP_Separator	KEY_KPCOMMA
-XK_Meta_L	KEY_LEFTMETA
-XK_Meta_R	KEY_RIGHTMETA
-XK_Multi_key	KEY_COMPOSE
-
-NoSymbol	KEY_STOP
-NoSymbol	KEY_AGAIN
-NoSymbol	KEY_PROPS
-NoSymbol	KEY_UNDO
-NoSymbol	KEY_FRONT
-NoSymbol	KEY_COPY
-NoSymbol	KEY_OPEN
-NoSymbol	KEY_PASTE
-NoSymbol	KEY_FIND
-NoSymbol	KEY_CUT
-NoSymbol	KEY_HELP
-NoSymbol	KEY_MENU
-NoSymbol	KEY_CALC
-NoSymbol	KEY_SETUP
-NoSymbol	KEY_SLEEP
-NoSymbol	KEY_WAKEUP
-NoSymbol	KEY_FILE
-NoSymbol	KEY_SENDFILE
-NoSymbol	KEY_DELETEFILE
-NoSymbol	KEY_XFER
-NoSymbol	KEY_PROG1
-NoSymbol	KEY_PROG2
-NoSymbol	KEY_WWW
-NoSymbol	KEY_MSDOS
-NoSymbol	KEY_COFFEE
-NoSymbol	KEY_DIRECTION
-NoSymbol	KEY_CYCLEWINDOWS
-NoSymbol	KEY_MAIL
-NoSymbol	KEY_BOOKMARKS
-NoSymbol	KEY_COMPUTER
-NoSymbol	KEY_BACK
-NoSymbol	KEY_FORWARD
-NoSymbol	KEY_CLOSECD
-NoSymbol	KEY_EJECTCD
-NoSymbol	KEY_EJECTCLOSECD
-NoSymbol	KEY_NEXTSONG
-NoSymbol	KEY_PLAYPAUSE
-NoSymbol	KEY_PREVIOUSSONG
-NoSymbol	KEY_STOPCD
-NoSymbol	KEY_RECORD
-NoSymbol	KEY_REWIND
-NoSymbol	KEY_PHONE
-NoSymbol	KEY_ISO
-NoSymbol	KEY_CONFIG
-NoSymbol	KEY_HOMEPAGE
-NoSymbol	KEY_REFRESH
-NoSymbol	KEY_EXIT
-NoSymbol	KEY_MOVE
-NoSymbol	KEY_EDIT
-NoSymbol	KEY_SCROLLUP
-NoSymbol	KEY_SCROLLDOWN
-NoSymbol	KEY_KPLEFTPAREN
-NoSymbol	KEY_KPRIGHTPAREN
-
-NoSymbol	KEY_INTL1
-NoSymbol	KEY_INTL2
-NoSymbol	KEY_INTL3
-NoSymbol	KEY_INTL4
-NoSymbol	KEY_INTL5
-NoSymbol	KEY_INTL6
-NoSymbol	KEY_INTL7
-NoSymbol	KEY_INTL8
-NoSymbol	KEY_INTL9
-NoSymbol	KEY_LANG1
-NoSymbol	KEY_LANG2
-NoSymbol	KEY_LANG3
-NoSymbol	KEY_LANG4
-NoSymbol	KEY_LANG5
-NoSymbol	KEY_LANG6
-NoSymbol	KEY_LANG7
-NoSymbol	KEY_LANG8
-NoSymbol	KEY_LANG9
-
-NoSymbol	KEY_PLAYCD
-NoSymbol	KEY_PAUSECD
-NoSymbol	KEY_PROG3
-NoSymbol	KEY_PROG4
-NoSymbol	KEY_SUSPEND
-NoSymbol	KEY_CLOSE
-NoSymbol	KEY_PLAY
-NoSymbol	KEY_FASTFORWARD
-NoSymbol	KEY_BASSBOOST
-NoSymbol	KEY_PRINT
-NoSymbol	KEY_HP
-NoSymbol	KEY_CAMERA
-NoSymbol	KEY_SOUND
-NoSymbol	KEY_QUESTION
-NoSymbol	KEY_EMAIL
-NoSymbol	KEY_CHAT
-NoSymbol	KEY_SEARCH
-NoSymbol	KEY_CONNECT
-NoSymbol	KEY_FINANCE
-NoSymbol	KEY_SPORT
-NoSymbol	KEY_SHOP
-NoSymbol	KEY_ALTERASE
-NoSymbol	KEY_CANCEL
-NoSymbol	KEY_BRIGHTNESSDOWN
-NoSymbol	KEY_BRIGHTNESSUP
-NoSymbol	KEY_MEDIA
-
-NoSymbol	KEY_UNKNOWN
-NoSymbol	
-NoSymbol	BTN_MISC
-NoSymbol	BTN_0
-NoSymbol	BTN_1
-NoSymbol	BTN_2
-NoSymbol	BTN_3
-NoSymbol	BTN_4
-NoSymbol	BTN_5
-NoSymbol	BTN_6
-NoSymbol	BTN_7
-NoSymbol	BTN_8
-NoSymbol	BTN_9
-NoSymbol	
-NoSymbol	BTN_MOUSE
-NoSymbol	BTN_LEFT
-NoSymbol	BTN_RIGHT
-NoSymbol	BTN_MIDDLE
-NoSymbol	BTN_SIDE
-NoSymbol	BTN_EXTRA
-NoSymbol	BTN_FORWARD
-NoSymbol	BTN_BACK
-NoSymbol	BTN_TASK
-NoSymbol	
-NoSymbol	BTN_JOYSTICK
-NoSymbol	BTN_TRIGGER
-NoSymbol	BTN_THUMB
-NoSymbol	BTN_THUMB2
-NoSymbol	BTN_TOP
-NoSymbol	BTN_TOP2
-NoSymbol	BTN_PINKIE
-NoSymbol	BTN_BASE
-NoSymbol	BTN_BASE2
-NoSymbol	BTN_BASE3
-NoSymbol	BTN_BASE4
-NoSymbol	BTN_BASE5
-NoSymbol	BTN_BASE6
-NoSymbol	BTN_DEAD
-
-NoSymbol	BTN_GAMEPAD
-NoSymbol	BTN_A
-NoSymbol	BTN_B
-NoSymbol	BTN_C
-NoSymbol	BTN_X
-NoSymbol	BTN_Y
-NoSymbol	BTN_Z
-NoSymbol	BTN_TL
-NoSymbol	BTN_TR
-NoSymbol	BTN_TL2
-NoSymbol	BTN_TR2
-NoSymbol	BTN_SELECT
-NoSymbol	BTN_START
-NoSymbol	BTN_MODE
-NoSymbol	BTN_THUMBL
-NoSymbol	BTN_THUMBR
-
-NoSymbol	BTN_DIGI
-NoSymbol	BTN_TOOL_PEN
-NoSymbol	BTN_TOOL_RUBBER
-NoSymbol	BTN_TOOL_BRUSH
-NoSymbol	BTN_TOOL_PENCIL
-NoSymbol	BTN_TOOL_AIRBRUSH
-NoSymbol	BTN_TOOL_FINGER
-NoSymbol	BTN_TOOL_MOUSE
-NoSymbol	BTN_TOOL_LENS
-NoSymbol	BTN_TOUCH
-NoSymbol	BTN_STYLUS
-NoSymbol	BTN_STYLUS2
-NoSymbol	BTN_TOOL_DOUBLETAP
-NoSymbol	BTN_TOOL_TRIPLETAP
-
-NoSymbol	BTN_WHEEL
-NoSymbol	BTN_GEAR_DOWN
-NoSymbol	BTN_GEAR_UP
-
-NoSymbol	KEY_OK
-NoSymbol	KEY_SELECT
-NoSymbol	KEY_GOTO
-NoSymbol	KEY_CLEAR
-NoSymbol	KEY_POWER2
-NoSymbol	KEY_OPTION
-NoSymbol	KEY_INFO
-NoSymbol	KEY_TIME
-NoSymbol	KEY_VENDOR
-NoSymbol	KEY_ARCHIVE
-NoSymbol	KEY_PROGRAM
-NoSymbol	KEY_CHANNEL
-NoSymbol	KEY_FAVORITES
-NoSymbol	KEY_EPG
-NoSymbol	KEY_PVR
-NoSymbol	KEY_MHP
-NoSymbol	KEY_LANGUAGE
-NoSymbol	KEY_TITLE
-NoSymbol	KEY_SUBTITLE
-NoSymbol	KEY_ANGLE
-NoSymbol	KEY_ZOOM
-NoSymbol	KEY_MODE
-NoSymbol	KEY_KEYBOARD
-NoSymbol	KEY_SCREEN
-NoSymbol	KEY_PC
-NoSymbol	KEY_TV
-NoSymbol	KEY_TV2
-NoSymbol	KEY_VCR
-NoSymbol	KEY_VCR2
-NoSymbol	KEY_SAT
-NoSymbol	KEY_SAT2
-NoSymbol	KEY_CD
-NoSymbol	KEY_TAPE
-NoSymbol	KEY_RADIO
-NoSymbol	KEY_TUNER
-NoSymbol	KEY_PLAYER
-NoSymbol	KEY_TEXT
-NoSymbol	KEY_DVD
-NoSymbol	KEY_AUX
-NoSymbol	KEY_MP3
-NoSymbol	KEY_AUDIO
-NoSymbol	KEY_VIDEO
-NoSymbol	KEY_DIRECTORY
-NoSymbol	KEY_LIST
-NoSymbol	KEY_MEMO
-NoSymbol	KEY_CALENDAR
-NoSymbol	KEY_RED
-NoSymbol	KEY_GREEN
-NoSymbol	KEY_YELLOW
-NoSymbol	KEY_BLUE
-NoSymbol	KEY_CHANNELUP
-NoSymbol	KEY_CHANNELDOWN
-NoSymbol	KEY_FIRST
-NoSymbol	KEY_LAST
-NoSymbol	KEY_AB
-NoSymbol	KEY_NEXT
-NoSymbol	KEY_RESTART
-NoSymbol	KEY_SLOW
-NoSymbol	KEY_SHUFFLE
-NoSymbol	KEY_BREAK
-NoSymbol	KEY_PREVIOUS
-NoSymbol	KEY_DIGITS
-NoSymbol	KEY_TEEN
-NoSymbol	KEY_TWEN
-
-NoSymbol	KEY_DEL_EOL
-NoSymbol	KEY_DEL_EOS
-NoSymbol	KEY_INS_LINE
-NoSymbol	KEY_DEL_LINE
-NoSymbol	KEY_MAX
-
-#endif
-
-
diff --git a/ica/x11/x11vnc/uinput.h b/ica/x11/x11vnc/uinput.h
deleted file mode 100644
index 346e97c..0000000
--- a/ica/x11/x11vnc/uinput.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_UINPUT_H
-#define _X11VNC_UINPUT_H
-
-/* -- uinput.h -- */
-
-extern int check_uinput(void);
-extern int initialize_uinput(void);
-extern void shutdown_uinput(void);
-extern int set_uinput_accel(char *str);
-extern int set_uinput_thresh(char *str);
-extern void set_uinput_reset(int ms);
-extern void set_uinput_always(int);
-extern void set_uinput_touchscreen(int);
-extern void set_uinput_abs(int);
-extern char *get_uinput_accel();
-extern char *get_uinput_thresh();
-extern int get_uinput_reset();
-extern int get_uinput_always();
-extern int get_uinput_touchscreen();
-extern int get_uinput_abs();
-extern void parse_uinput_str(char *str);
-extern void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client);
-extern void uinput_key_command(int down, int keysym, rfbClientPtr client);
-
-
-
-#endif /* _X11VNC_UINPUT_H */
diff --git a/ica/x11/x11vnc/unixpw.c b/ica/x11/x11vnc/unixpw.c
deleted file mode 100644
index ccdb195..0000000
--- a/ica/x11/x11vnc/unixpw.c
+++ /dev/null
@@ -1,2281 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- unixpw.c -- */
-
-#ifdef __linux__
-/* some conflict with _XOPEN_SOURCE */
-extern int grantpt(int);
-extern int unlockpt(int);
-extern char *ptsname(int);
-#endif
-
-#ifndef DO_NOT_DECLARE_CRYPT
-extern char *crypt(const char*, const char *);
-#endif
-
-#include "x11vnc.h"
-#include "scan.h"
-#include "cleanup.h"
-#include "xinerama.h"
-#include "connections.h"
-#include "user.h"
-#include "connections.h"
-#include "sslhelper.h"
-#include "cursor.h"
-#include "rates.h"
-#include <rfb/default8x16.h>
-
-#if LIBVNCSERVER_HAVE_FORK
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID
-#define UNIXPW_SU
-#endif
-#endif
-
-#ifdef IGNORE_GETSPNAM
-#undef LIBVNCSERVER_HAVE_GETSPNAM
-#define LIBVNCSERVER_HAVE_GETSPNAM 0
-#endif
-
-#if LIBVNCSERVER_HAVE_PWD_H && LIBVNCSERVER_HAVE_GETPWNAM
-#if LIBVNCSERVER_HAVE_CRYPT || LIBVNCSERVER_HAVE_LIBCRYPT
-#define UNIXPW_CRYPT
-#if LIBVNCSERVER_HAVE_GETSPNAM
-#include <shadow.h>
-#endif
-#endif
-#endif
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#if LIBVNCSERVER_HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-#if LIBVNCSERVER_HAVE_SYS_STROPTS_H
-#include <sys/stropts.h>
-#endif
-
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
-#define IS_BSD
-#endif
-#if (defined(__MACH__) && defined(__APPLE__))
-#define IS_BSD
-#endif
-
-int white_pixel(void);
-void unixpw_screen(int init);
-void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init);
-void unixpw_accept(char *user);
-void unixpw_deny(void);
-void unixpw_msg(char *msg, int delay);
-int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int nodisp);
-int unixpw_cmd_run(char *user, char *pass, char *cmd, char *line, int *n);
-int crypt_verify(char *user, char *pass);
-int cmd_verify(char *user, char *pass);
-void unixpw_verify_screen(char *user, char *pass);
-
-static int text_x(void);
-static int text_y(void);
-static void set_db(void);
-
-int unixpw_in_progress = 0;
-int unixpw_denied = 0;
-int unixpw_in_rfbPE = 0;
-int unixpw_login_viewonly = 0;
-int unixpw_tightvnc_xfer_save = 0;
-rfbBool unixpw_file_xfer_save = FALSE;
-time_t unixpw_last_try_time = 0;
-rfbClientPtr unixpw_client = NULL;
-
-int keep_unixpw = 0;
-char *keep_unixpw_user = NULL;
-char *keep_unixpw_pass = NULL;
-char *keep_unixpw_opts = NULL;
-
-static unsigned char default6x13FontData[2899]={
-0x00,0x00,0xA8,0x00,0x88,0x00,0x88,0x00,0x88,0x00,0xA8,0x00,0x00, /* 0 */
-0x00,0x00,0x00,0x00,0x20,0x70,0xF8,0x70,0x20,0x00,0x00,0x00,0x00, /* 1 */
-0xA8,0x54,0xA8,0x54,0xA8,0x54,0xA8,0x54,0xA8,0x54,0xA8,0x54,0xA8, /* 2 */
-0x00,0x00,0xA0,0xA0,0xE0,0xA0,0xA0,0x38,0x10,0x10,0x10,0x00,0x00, /* 3 */
-0x00,0x00,0xE0,0x80,0xC0,0x80,0xB8,0x20,0x30,0x20,0x20,0x00,0x00, /* 4 */
-0x00,0x00,0x60,0x80,0x80,0x60,0x30,0x28,0x30,0x28,0x28,0x00,0x00, /* 5 */
-0x00,0x00,0x80,0x80,0x80,0xE0,0x38,0x20,0x30,0x20,0x20,0x00,0x00, /* 6 */
-0x00,0x00,0x30,0x48,0x48,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 7 */
-0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0xF8,0x00,0x00,0x00, /* 8 */
-0x00,0x00,0x90,0xD0,0xB0,0x90,0x20,0x20,0x20,0x20,0x38,0x00,0x00, /* 9 */
-0x00,0x00,0xA0,0xA0,0xA0,0x40,0x40,0x38,0x10,0x10,0x10,0x00,0x00, /* 10 */
-0x20,0x20,0x20,0x20,0x20,0x20,0xE0,0x00,0x00,0x00,0x00,0x00,0x00, /* 11 */
-0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x20,0x20,0x20,0x20,0x20,0x20, /* 12 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x20,0x20,0x20,0x20,0x20,0x20, /* 13 */
-0x20,0x20,0x20,0x20,0x20,0x20,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, /* 14 */
-0x20,0x20,0x20,0x20,0x20,0x20,0xFC,0x20,0x20,0x20,0x20,0x20,0x20, /* 15 */
-0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16 */
-0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 17 */
-0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, /* 18 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00, /* 19 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC, /* 20 */
-0x20,0x20,0x20,0x20,0x20,0x20,0x3C,0x20,0x20,0x20,0x20,0x20,0x20, /* 21 */
-0x20,0x20,0x20,0x20,0x20,0x20,0xE0,0x20,0x20,0x20,0x20,0x20,0x20, /* 22 */
-0x20,0x20,0x20,0x20,0x20,0x20,0xFC,0x00,0x00,0x00,0x00,0x00,0x00, /* 23 */
-0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x20,0x20,0x20,0x20,0x20,0x20, /* 24 */
-0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, /* 25 */
-0x00,0x00,0x00,0x18,0x60,0x80,0x60,0x18,0x00,0xF8,0x00,0x00,0x00, /* 26 */
-0x00,0x00,0x00,0xC0,0x30,0x08,0x30,0xC0,0x00,0xF8,0x00,0x00,0x00, /* 27 */
-0x00,0x00,0x00,0x00,0x00,0xF8,0x50,0x50,0x50,0x50,0x50,0x00,0x00, /* 28 */
-0x00,0x00,0x00,0x00,0x00,0x08,0xF8,0x20,0xF8,0x80,0x00,0x00,0x00, /* 29 */
-0x00,0x00,0x30,0x48,0x40,0x40,0xE0,0x40,0x40,0x48,0xB0,0x00,0x00, /* 30 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00, /* 31 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32 */
-0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00, /* 33 */
-0x00,0x00,0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 34 */
-0x00,0x00,0x00,0x50,0x50,0xF8,0x50,0xF8,0x50,0x50,0x00,0x00,0x00, /* 35 */
-0x00,0x00,0x20,0x78,0xA0,0xA0,0x70,0x28,0x28,0xF0,0x20,0x00,0x00, /* 36 */
-0x00,0x00,0x48,0xA8,0x50,0x10,0x20,0x40,0x50,0xA8,0x90,0x00,0x00, /* 37 */
-0x00,0x00,0x00,0x40,0xA0,0xA0,0x40,0xA0,0x98,0x90,0x68,0x00,0x00, /* 38 */
-0x00,0x00,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 39 */
-0x00,0x10,0x20,0x20,0x40,0x40,0x40,0x40,0x40,0x20,0x20,0x10,0x00, /* 40 */
-0x00,0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40,0x00, /* 41 */
-0x00,0x00,0x00,0x20,0xA8,0xF8,0x70,0xF8,0xA8,0x20,0x00,0x00,0x00, /* 42 */
-0x00,0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00,0x00,0x00, /* 43 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x20,0x40,0x00, /* 44 */
-0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, /* 45 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x70,0x20,0x00, /* 46 */
-0x00,0x00,0x08,0x08,0x10,0x10,0x20,0x40,0x40,0x80,0x80,0x00,0x00, /* 47 */
-0x00,0x00,0x20,0x50,0x88,0x88,0x88,0x88,0x88,0x50,0x20,0x00,0x00, /* 48 */
-0x00,0x00,0x20,0x60,0xA0,0x20,0x20,0x20,0x20,0x20,0xF8,0x00,0x00, /* 49 */
-0x00,0x00,0x70,0x88,0x88,0x08,0x10,0x20,0x40,0x80,0xF8,0x00,0x00, /* 50 */
-0x00,0x00,0xF8,0x08,0x10,0x20,0x70,0x08,0x08,0x88,0x70,0x00,0x00, /* 51 */
-0x00,0x00,0x10,0x10,0x30,0x50,0x50,0x90,0xF8,0x10,0x10,0x00,0x00, /* 52 */
-0x00,0x00,0xF8,0x80,0x80,0xB0,0xC8,0x08,0x08,0x88,0x70,0x00,0x00, /* 53 */
-0x00,0x00,0x70,0x88,0x80,0x80,0xF0,0x88,0x88,0x88,0x70,0x00,0x00, /* 54 */
-0x00,0x00,0xF8,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x00,0x00, /* 55 */
-0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x88,0x70,0x00,0x00, /* 56 */
-0x00,0x00,0x70,0x88,0x88,0x88,0x78,0x08,0x08,0x88,0x70,0x00,0x00, /* 57 */
-0x00,0x00,0x00,0x00,0x20,0x70,0x20,0x00,0x00,0x20,0x70,0x20,0x00, /* 58 */
-0x00,0x00,0x00,0x00,0x20,0x70,0x20,0x00,0x00,0x30,0x20,0x40,0x00, /* 59 */
-0x00,0x00,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08,0x00,0x00, /* 60 */
-0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0xF8,0x00,0x00,0x00,0x00, /* 61 */
-0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x80,0x00,0x00, /* 62 */
-0x00,0x00,0x70,0x88,0x88,0x08,0x10,0x20,0x20,0x00,0x20,0x00,0x00, /* 63 */
-0x00,0x00,0x70,0x88,0x88,0x98,0xA8,0xA8,0xB0,0x80,0x78,0x00,0x00, /* 64 */
-0x00,0x00,0x20,0x50,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x00,0x00, /* 65 */
-0x00,0x00,0xF0,0x48,0x48,0x48,0x70,0x48,0x48,0x48,0xF0,0x00,0x00, /* 66 */
-0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x80,0x80,0x88,0x70,0x00,0x00, /* 67 */
-0x00,0x00,0xF0,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0xF0,0x00,0x00, /* 68 */
-0x00,0x00,0xF8,0x80,0x80,0x80,0xF0,0x80,0x80,0x80,0xF8,0x00,0x00, /* 69 */
-0x00,0x00,0xF8,0x80,0x80,0x80,0xF0,0x80,0x80,0x80,0x80,0x00,0x00, /* 70 */
-0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x98,0x88,0x88,0x70,0x00,0x00, /* 71 */
-0x00,0x00,0x88,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x88,0x00,0x00, /* 72 */
-0x00,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 73 */
-0x00,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x60,0x00,0x00, /* 74 */
-0x00,0x00,0x88,0x88,0x90,0xA0,0xC0,0xA0,0x90,0x88,0x88,0x00,0x00, /* 75 */
-0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xF8,0x00,0x00, /* 76 */
-0x00,0x00,0x88,0x88,0xD8,0xA8,0xA8,0x88,0x88,0x88,0x88,0x00,0x00, /* 77 */
-0x00,0x00,0x88,0xC8,0xC8,0xA8,0xA8,0x98,0x98,0x88,0x88,0x00,0x00, /* 78 */
-0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 79 */
-0x00,0x00,0xF0,0x88,0x88,0x88,0xF0,0x80,0x80,0x80,0x80,0x00,0x00, /* 80 */
-0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0xA8,0x70,0x08,0x00, /* 81 */
-0x00,0x00,0xF0,0x88,0x88,0x88,0xF0,0xA0,0x90,0x88,0x88,0x00,0x00, /* 82 */
-0x00,0x00,0x70,0x88,0x80,0x80,0x70,0x08,0x08,0x88,0x70,0x00,0x00, /* 83 */
-0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00, /* 84 */
-0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 85 */
-0x00,0x00,0x88,0x88,0x88,0x88,0x50,0x50,0x50,0x20,0x20,0x00,0x00, /* 86 */
-0x00,0x00,0x88,0x88,0x88,0x88,0xA8,0xA8,0xA8,0xA8,0x50,0x00,0x00, /* 87 */
-0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x50,0x50,0x88,0x88,0x00,0x00, /* 88 */
-0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x20,0x20,0x20,0x20,0x00,0x00, /* 89 */
-0x00,0x00,0xF8,0x08,0x10,0x10,0x20,0x40,0x40,0x80,0xF8,0x00,0x00, /* 90 */
-0x00,0x70,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x00, /* 91 */
-0x00,0x00,0x80,0x80,0x40,0x40,0x20,0x10,0x10,0x08,0x08,0x00,0x00, /* 92 */
-0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00, /* 93 */
-0x00,0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 94 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00, /* 95 */
-0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 96 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 97 */
-0x00,0x00,0x80,0x80,0x80,0xF0,0x88,0x88,0x88,0x88,0xF0,0x00,0x00, /* 98 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x88,0x80,0x80,0x88,0x70,0x00,0x00, /* 99 */
-0x00,0x00,0x08,0x08,0x08,0x78,0x88,0x88,0x88,0x88,0x78,0x00,0x00, /* 100 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x88,0xF8,0x80,0x88,0x70,0x00,0x00, /* 101 */
-0x00,0x00,0x30,0x48,0x40,0x40,0xF0,0x40,0x40,0x40,0x40,0x00,0x00, /* 102 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x78,0x08,0x88,0x70, /* 103 */
-0x00,0x00,0x80,0x80,0x80,0xB0,0xC8,0x88,0x88,0x88,0x88,0x00,0x00, /* 104 */
-0x00,0x00,0x00,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 105 */
-0x00,0x00,0x00,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x90,0x60, /* 106 */
-0x00,0x00,0x80,0x80,0x80,0x90,0xA0,0xC0,0xA0,0x90,0x88,0x00,0x00, /* 107 */
-0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 108 */
-0x00,0x00,0x00,0x00,0x00,0xD0,0xA8,0xA8,0xA8,0xA8,0x88,0x00,0x00, /* 109 */
-0x00,0x00,0x00,0x00,0x00,0xB0,0xC8,0x88,0x88,0x88,0x88,0x00,0x00, /* 110 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 111 */
-0x00,0x00,0x00,0x00,0x00,0xF0,0x88,0x88,0x88,0xF0,0x80,0x80,0x80, /* 112 */
-0x00,0x00,0x00,0x00,0x00,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x08, /* 113 */
-0x00,0x00,0x00,0x00,0x00,0xB0,0xC8,0x80,0x80,0x80,0x80,0x00,0x00, /* 114 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x88,0x60,0x10,0x88,0x70,0x00,0x00, /* 115 */
-0x00,0x00,0x00,0x40,0x40,0xF0,0x40,0x40,0x40,0x48,0x30,0x00,0x00, /* 116 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x98,0x68,0x00,0x00, /* 117 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x50,0x50,0x20,0x00,0x00, /* 118 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x88,0xA8,0xA8,0xA8,0x50,0x00,0x00, /* 119 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x50,0x20,0x20,0x50,0x88,0x00,0x00, /* 120 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x08,0x88,0x70, /* 121 */
-0x00,0x00,0x00,0x00,0x00,0xF8,0x10,0x20,0x40,0x80,0xF8,0x00,0x00, /* 122 */
-0x00,0x18,0x20,0x20,0x20,0x20,0xC0,0x20,0x20,0x20,0x20,0x18,0x00, /* 123 */
-0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00, /* 124 */
-0x00,0xC0,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0xC0,0x00, /* 125 */
-0x00,0x00,0x48,0xA8,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 126 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160 */
-0x00,0x00,0x20,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00, /* 161 */
-0x00,0x00,0x20,0x70,0xA8,0xA0,0xA0,0xA8,0x70,0x20,0x00,0x00,0x00, /* 162 */
-0x00,0x00,0x30,0x48,0x40,0x40,0xE0,0x40,0x40,0x48,0xB0,0x00,0x00, /* 163 */
-0x00,0x00,0x00,0x00,0x88,0x70,0x50,0x50,0x70,0x88,0x00,0x00,0x00, /* 164 */
-0x00,0x00,0x88,0x88,0x50,0x50,0xF8,0x20,0xF8,0x20,0x20,0x00,0x00, /* 165 */
-0x00,0x00,0x20,0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x20,0x00,0x00, /* 166 */
-0x00,0x30,0x48,0x40,0x30,0x48,0x48,0x30,0x08,0x48,0x30,0x00,0x00, /* 167 */
-0x00,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168 */
-0x00,0x70,0x88,0xA8,0xD8,0xC8,0xD8,0xA8,0x88,0x70,0x00,0x00,0x00, /* 169 */
-0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x00,0xF8,0x00,0x00,0x00,0x00, /* 170 */
-0x00,0x00,0x00,0x00,0x28,0x50,0xA0,0xA0,0x50,0x28,0x00,0x00,0x00, /* 171 */
-0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x08,0x08,0x00,0x00,0x00,0x00, /* 172 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00, /* 173 */
-0x00,0x70,0x88,0xE8,0xD8,0xD8,0xE8,0xD8,0x88,0x70,0x00,0x00,0x00, /* 174 */
-0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 175 */
-0x00,0x00,0x30,0x48,0x48,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176 */
-0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0xF8,0x00,0x00,0x00, /* 177 */
-0x00,0x40,0xA0,0x20,0x40,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 178 */
-0x00,0x40,0xA0,0x40,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 179 */
-0x00,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 180 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x98,0xE8,0x80,0x80, /* 181 */
-0x00,0x00,0x78,0xE8,0xE8,0xE8,0xE8,0x68,0x28,0x28,0x28,0x00,0x00, /* 182 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00, /* 183 */
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x20, /* 184 */
-0x00,0x40,0xC0,0x40,0x40,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 185 */
-0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0xF8,0x00,0x00,0x00,0x00, /* 186 */
-0x00,0x00,0x00,0x00,0xA0,0x50,0x28,0x28,0x50,0xA0,0x00,0x00,0x00, /* 187 */
-0x00,0x40,0xC0,0x40,0x40,0xE0,0x08,0x18,0x28,0x38,0x08,0x00,0x00, /* 188 */
-0x00,0x40,0xC0,0x40,0x40,0xE0,0x10,0x28,0x08,0x10,0x38,0x00,0x00, /* 189 */
-0x00,0x40,0xA0,0x40,0x20,0xA0,0x48,0x18,0x28,0x38,0x08,0x00,0x00, /* 190 */
-0x00,0x00,0x20,0x00,0x20,0x20,0x40,0x80,0x88,0x88,0x70,0x00,0x00, /* 191 */
-0x00,0x40,0x20,0x00,0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00,0x00, /* 192 */
-0x00,0x10,0x20,0x00,0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00,0x00, /* 193 */
-0x00,0x30,0x48,0x00,0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00,0x00, /* 194 */
-0x00,0x28,0x50,0x00,0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00,0x00, /* 195 */
-0x00,0x50,0x50,0x00,0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00,0x00, /* 196 */
-0x00,0x20,0x50,0x20,0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00,0x00, /* 197 */
-0x00,0x00,0x58,0xA0,0xA0,0xA0,0xB0,0xE0,0xA0,0xA0,0xB8,0x00,0x00, /* 198 */
-0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x80,0x80,0x88,0x70,0x20,0x40, /* 199 */
-0x00,0x40,0x20,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00,0x00, /* 200 */
-0x00,0x10,0x20,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00,0x00, /* 201 */
-0x00,0x30,0x48,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00,0x00, /* 202 */
-0x00,0x50,0x50,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00,0x00, /* 203 */
-0x00,0x40,0x20,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 204 */
-0x00,0x10,0x20,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 205 */
-0x00,0x30,0x48,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 206 */
-0x00,0x50,0x50,0x00,0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 207 */
-0x00,0x00,0xF0,0x48,0x48,0x48,0xE8,0x48,0x48,0x48,0xF0,0x00,0x00, /* 208 */
-0x00,0x28,0x50,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88,0x00,0x00, /* 209 */
-0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 210 */
-0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 211 */
-0x00,0x30,0x48,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 212 */
-0x00,0x28,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 213 */
-0x00,0x50,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 214 */
-0x00,0x00,0x00,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0x00,0x00, /* 215 */
-0x00,0x08,0x70,0x98,0x98,0xA8,0xA8,0xA8,0xC8,0xC8,0x70,0x80,0x00, /* 216 */
-0x00,0x40,0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 217 */
-0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 218 */
-0x00,0x30,0x48,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 219 */
-0x00,0x50,0x50,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 220 */
-0x00,0x10,0x20,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x00,0x00, /* 221 */
-0x00,0x00,0x80,0xF0,0x88,0x88,0x88,0xF0,0x80,0x80,0x80,0x00,0x00, /* 222 */
-0x00,0x00,0x60,0x90,0x90,0xA0,0xA0,0x90,0x88,0x88,0xB0,0x00,0x00, /* 223 */
-0x00,0x00,0x40,0x20,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 224 */
-0x00,0x00,0x10,0x20,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 225 */
-0x00,0x00,0x30,0x48,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 226 */
-0x00,0x00,0x28,0x50,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 227 */
-0x00,0x00,0x50,0x50,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 228 */
-0x00,0x30,0x48,0x30,0x00,0x70,0x08,0x78,0x88,0x98,0x68,0x00,0x00, /* 229 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x28,0x70,0xA0,0xA8,0x50,0x00,0x00, /* 230 */
-0x00,0x00,0x00,0x00,0x00,0x70,0x88,0x80,0x80,0x88,0x70,0x20,0x40, /* 231 */
-0x00,0x00,0x40,0x20,0x00,0x70,0x88,0xF8,0x80,0x88,0x70,0x00,0x00, /* 232 */
-0x00,0x00,0x10,0x20,0x00,0x70,0x88,0xF8,0x80,0x88,0x70,0x00,0x00, /* 233 */
-0x00,0x00,0x30,0x48,0x00,0x70,0x88,0xF8,0x80,0x88,0x70,0x00,0x00, /* 234 */
-0x00,0x00,0x50,0x50,0x00,0x70,0x88,0xF8,0x80,0x88,0x70,0x00,0x00, /* 235 */
-0x00,0x00,0x40,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 236 */
-0x00,0x00,0x10,0x20,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 237 */
-0x00,0x00,0x30,0x48,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 238 */
-0x00,0x00,0x50,0x50,0x00,0x60,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* 239 */
-0x00,0x50,0x20,0x60,0x10,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 240 */
-0x00,0x00,0x28,0x50,0x00,0xB0,0xC8,0x88,0x88,0x88,0x88,0x00,0x00, /* 241 */
-0x00,0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 242 */
-0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 243 */
-0x00,0x00,0x30,0x48,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 244 */
-0x00,0x00,0x28,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 245 */
-0x00,0x00,0x50,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00, /* 246 */
-0x00,0x00,0x00,0x20,0x20,0x00,0xF8,0x00,0x20,0x20,0x00,0x00,0x00, /* 247 */
-0x00,0x00,0x00,0x00,0x08,0x70,0x98,0xA8,0xA8,0xC8,0x70,0x80,0x00, /* 248 */
-0x00,0x00,0x40,0x20,0x00,0x88,0x88,0x88,0x88,0x98,0x68,0x00,0x00, /* 249 */
-0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x88,0x98,0x68,0x00,0x00, /* 250 */
-0x00,0x00,0x30,0x48,0x00,0x88,0x88,0x88,0x88,0x98,0x68,0x00,0x00, /* 251 */
-0x00,0x00,0x50,0x50,0x00,0x88,0x88,0x88,0x88,0x98,0x68,0x00,0x00, /* 252 */
-0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x98,0x68,0x08,0x88,0x70, /* 253 */
-0x00,0x00,0x00,0x80,0x80,0xB0,0xC8,0x88,0x88,0xC8,0xB0,0x80,0x80, /* 254 */
-0x00,0x00,0x50,0x50,0x00,0x88,0x88,0x88,0x98,0x68,0x08,0x88,0x70, /* 255 */
-};
-static int default6x13FontMetaData[256*5]={
-0,6,13,0,-2,13,6,13,0,-2,26,6,13,0,-2,39,6,13,0,-2,52,6,13,0,-2,65,6,13,0,-2,78,6,13,0,-2,91,6,13,0,-2,104,6,13,0,-2,117,6,13,0,-2,130,6,13,0,-2,143,6,13,0,-2,156,6,13,0,-2,169,6,13,0,-2,182,6,13,0,-2,195,6,13,0,-2,208,6,13,0,-2,221,6,13,0,-2,234,6,13,0,-2,247,6,13,0,-2,260,6,13,0,-2,273,6,13,0,-2,286,6,13,0,-2,299,6,13,0,-2,312,6,13,0,-2,325,6,13,0,-2,338,6,13,0,-2,351,6,13,0,-2,364,6,13,0,-2,377,6,13,0,-2,390,6,13,0,-2,403,6,13,0,-2,416,6,13,0,-2,429,6,13,0,-2,442,6,13,0,-2,455,6,13,0, [...]
-static rfbFontData default6x13Font={default6x13FontData, default6x13FontMetaData};
-
-static int in_login = 0, in_passwd = 0, tries = 0;
-static int char_row = 0, char_col = 0;
-static int char_x = 0, char_y = 0, char_w = 8, char_h = 16;
-
-static int db = 0;
-
-int white_pixel(void) {
-	static unsigned long black_pix = 0, white_pix = 1, set = 0;
-
-	RAWFB_RET(0xffffff)
-
-	if (depth <= 8 && ! set) {
-		X_LOCK;
-		black_pix = BlackPixel(dpy, scr);
-		white_pix = WhitePixel(dpy, scr);
-		X_UNLOCK;
-		set = 1;
-	}
-	if (depth <= 8) {
-		return (int) white_pix;
-	} else if (depth < 24) {
-		return 0xffff;
-	} else {
-		return 0xffffff;
-	}
-}
-
-int black_pixel(void) {
-	static unsigned long black_pix = 0, white_pix = 1, set = 0;
-
-	RAWFB_RET(0x000000)
-
-	if (depth <= 8 && ! set) {
-		X_LOCK;
-		black_pix = BlackPixel(dpy, scr);
-		white_pix = WhitePixel(dpy, scr);
-		X_UNLOCK;
-		set = 1;
-	}
-	if (depth <= 8) {
-		return (int) black_pix;
-	} else if (depth < 24) {
-		return 0x0000;
-	} else {
-		return 0x000000;
-	}
-}
-
-static void unixpw_mark(void) {
-	if (scaling) {
-		mark_rect_as_modified(0, 0, scaled_x, scaled_y, 1);
-	} else {
-		mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
-	}
-}
-
-static int text_x(void) {
-	return char_x + char_col * char_w;
-}
-
-static int text_y(void) {
-	return char_y + char_row * char_h;
-}
-
-static rfbScreenInfo fscreen;
-static rfbScreenInfoPtr pscreen;
-
-static int f1_help = 0;
-
-void unixpw_screen(int init) {
-	if (unixpw_cmd) {
-		;	/* OK */
-	} else if (unixpw_nis) {
-#ifndef UNIXPW_CRYPT
-	rfbLog("-unixpw_nis is not supported on this OS/machine\n");
-	clean_up_exit(1);
-#endif
-	} else {
-#ifndef UNIXPW_SU
-	rfbLog("-unixpw is not supported on this OS/machine\n");
-	clean_up_exit(1);
-#endif
-	}
-	if (init) {
-		int x, y;
-		char log[] = "login: ";
-
-		zero_fb(0, 0, dpy_x, dpy_y);
-
-		mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
-
-		x = nfix(dpy_x / 2 -  strlen(log) * char_w, dpy_x);
-		y = (int) (dpy_y / 3.5);
-		if (unixpw_system_greeter) {
-			y = (int) (dpy_y / 3);
-		}
-
-		if (scaling) {
-			x = (int) (x * scale_fac_x);
-			y = (int) (y * scale_fac_y);
-			x = nfix(x, scaled_x);
-			y = nfix(y, scaled_y);
-		}
-
-		if (rotating) {
-			fscreen.serverFormat.bitsPerPixel = bpp;
-			fscreen.paddedWidthInBytes = rfb_bytes_per_line;
-			fscreen.frameBuffer = rfb_fb;
-			pscreen = &fscreen;
-		} else {
-			pscreen = screen;
-		}
-
-		if (pscreen && pscreen->width >= 640 && pscreen->height >= 480) {
-			rfbDrawString(pscreen, &default6x13Font, 8, 2+1*13, "F1-Help:", white_pixel());
-		}
-		f1_help = 0;
-
-		if (unixpw_system_greeter) {
-			unixpw_system_greeter_active = 0;
-			if (use_dpy && strstr(use_dpy, "xdmcp")) {
-				if (getenv("X11VNC_SYSTEM_GREETER1")) {
-					char moo[] = "Press 'Escape' for System Greeter";
-					rfbDrawString(pscreen, &default8x16Font, x-90, y-30, moo, white_pixel());
-				} else {
-					char moo1[] = "Press 'Escape' for a New Session via System Greeter, or";
-					char moo2[] = "otherwise login here to connect to an Existing Session:";
-					rfbDrawString(pscreen, &default6x13Font, x-110, y-38, moo1, white_pixel());
-					rfbDrawString(pscreen, &default6x13Font, x-110, y-25, moo2, white_pixel());
-				}
-				set_env("X11VNC_XDM_ONLY", "0");
-				unixpw_system_greeter_active = 1;
-			}
-		}
-
-		rfbDrawString(pscreen, &default8x16Font, x, y, log, white_pixel());
-
-		char_x = x;
-		char_y = y;
-		char_col = strlen(log);
-		char_row = 0;
-
-		set_warrow_cursor();
-	}
-
-	unixpw_mark();
-}
-
-	
-#ifdef MAXPATHLEN
-static char slave_str[MAXPATHLEN];
-#else
-static char slave_str[4096];
-#endif
-
-static int used_get_pty_ptmx = 0;
-
-char *get_pty_ptmx(int *fd_p) {
-	char *slave;
-	int fd = -1, i, ndevs = 4, tmp;
-	char *devs[] = { 
-		"/dev/ptmx",
-		"/dev/ptm/clone",
-		"/dev/ptc",
-		"/dev/ptmx_bsd"
-	};
-
-	*fd_p = -1;
-
-#if LIBVNCSERVER_HAVE_GRANTPT
-
-	for (i=0; i < ndevs; i++) {
-#ifdef O_NOCTTY
-		fd = open(devs[i], O_RDWR|O_NOCTTY);
-#else
-		fd = open(devs[i], O_RDWR);
-#endif
-		if (fd >= 0) {
-			break;
-		}
-	}
-
-	if (fd < 0) {
-		rfbLogPerror("open /dev/ptmx");
-		return NULL;
-	}
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCPKT)
-	tmp = 0;
-	ioctl(fd, TIOCPKT, (char *) &tmp);
-#endif
-
-	if (grantpt(fd) != 0) {
-		rfbLogPerror("grantpt");
-		close(fd);
-		return NULL;
-	}
-	if (unlockpt(fd) != 0) {
-		rfbLogPerror("unlockpt");
-		close(fd);
-		return NULL;
-	}
-
-	slave = ptsname(fd);
-	if (! slave)  {
-		rfbLogPerror("ptsname");
-		close(fd);
-		return NULL;
-	}
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCFLUSH)
-	ioctl(fd, TIOCFLUSH, (char *) 0);
-#endif
-
-	if (strlen(slave) > sizeof(slave_str)/2) {
-		rfbLog("get_pty_ptmx: slave string length too long.\n");	
-		close(fd);
-		return NULL;
-	}
-
-	strcpy(slave_str, slave);
-	*fd_p = fd;
-	return slave_str;
-
-#else
-	return NULL;
-
-#endif /* GRANTPT */
-}
-
-
-char *get_pty_loop(int *fd_p) {
-	char master_str[16];
-	int fd = -1, i;
-	char c;
-
-	*fd_p = -1;
-
-	/* for *BSD loop over /dev/ptyXY */
-
-	for (c = 'p'; c <= 'z'; c++) {
-		for (i=0; i < 16; i++) {
-			sprintf(master_str, "/dev/pty%c%x", c, i);
-#ifdef O_NOCTTY
-			fd = open(master_str, O_RDWR|O_NOCTTY);
-#else
-			fd = open(master_str, O_RDWR);
-#endif
-			if (fd >= 0) {
-				break;
-			}
-		}
-		if (fd >= 0) {
-			break;
-		}
-	}
-	if (fd < 0) {
-		return NULL;
-	}
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCFLUSH)
-	ioctl(fd, TIOCFLUSH, (char *) 0);
-#endif
-
-	sprintf(slave_str, "/dev/tty%c%x", c, i);
-	*fd_p = fd;
-	return slave_str;
-}
-
-char *get_pty(int *fd_p) {
-	used_get_pty_ptmx = 0;
-	if (getenv("BSD_PTY")) {
-		return get_pty_loop(fd_p);
-	}
-#ifdef IS_BSD
-	return get_pty_loop(fd_p);
-#else
-#if LIBVNCSERVER_HAVE_GRANTPT
-	used_get_pty_ptmx = 1;
-	return get_pty_ptmx(fd_p);
-#else
-	return get_pty_loop(fd_p);
-#endif
-#endif
-}
-
-void try_to_be_nobody(void) {
-
-#if LIBVNCSERVER_HAVE_PWD_H
-	struct passwd *pw;
-	pw = getpwnam("nobody");
-
-	if (pw) {
-#if LIBVNCSERVER_HAVE_SETUID
-		setuid(pw->pw_uid);
-#endif
-#if LIBVNCSERVER_HAVE_SETEUID
-		seteuid(pw->pw_uid);
-#endif
-#if LIBVNCSERVER_HAVE_SETGID
-		setgid(pw->pw_gid);
-#endif
-#if LIBVNCSERVER_HAVE_SETEGID
-		setegid(pw->pw_gid);
-#endif
-	}
-#endif	/* PWD_H */
-}
-
-
-static int slave_fd = -1, alarm_fired = 0;
-
-static void close_alarm (int sig) {
-	if (slave_fd >= 0) {
-		close(slave_fd);
-	}
-	alarm_fired = 1;
-	if (0) sig = 0;	/* compiler warning */
-}
-
-static void kill_child (pid_t pid, int fd) {
-	int status;
-
-	slave_fd = -1;
-	alarm_fired = 0;
-	if (fd >= 0) {
-		close(fd);
-	}
-	kill(pid, SIGTERM);
-	waitpid(pid, &status, WNOHANG); 
-}
-
-static int scheck(char *str, int n, char *name) {
-	int j, i;
-
-	if (! str) {
-		return 0;
-	}
-	j = 0;
-	for (i=0; i<n; i++) {
-		if (str[i] == '\0') {
-			j = 1;
-			break;
-		}
-		if (!strcmp(name, "password")) {
-			if (str[i] == '\n') {
-				continue;
-			}
-		}
-		if (str[i] < ' ' || str[i] >= 0x7f) {
-			rfbLog("scheck: invalid character in %s.\n", name);	
-			return 0;
-		}
-	}
-	if (j == 0) {
-		rfbLog("scheck: unterminated string in %s.\n", name);	
-		return 0;
-	}
-	return 1;
-}
-
-int unixpw_list_match(char *user) {
-	if (! unixpw_list || unixpw_list[0] == '\0') {
-		return 1;
-	} else {
-		char *p, *q, *str = strdup(unixpw_list);
-		int ok = 0;
-		int notmode = 0;
-
-		if (str[0] == '!') {
-			notmode = 1;
-			ok = 1;
-			p = strtok(str+1, ",");
-		} else {
-			p = strtok(str, ",");
-		}
-		while (p) {
-			if ( (q = strchr(p, ':')) != NULL ) {
-				*q = '\0';	/* get rid of options. */
-			}
-			if (!strcmp(user, p)) {
-				if (notmode) {
-					ok = 0;
-				} else {
-					ok = 1;
-				}
-				break;
-			}
-			if (!notmode && !strcmp("*", p)) {
-				ok = 1;
-				break;
-			}
-			p = strtok(NULL, ",");
-		}
-		free(str);
-		if (! ok) {
-			rfbLog("unixpw_list_match: fail for '%s'\n", user);
-			return 0;
-		} else {
-			rfbLog("unixpw_list_match: OK for '%s'\n", user);
-			return 1;
-		}
-	}
-}
-
-int crypt_verify(char *user, char *pass) {
-#ifndef UNIXPW_CRYPT
-	return 0;
-#else
-	struct passwd *pwd;
-	char *realpw, *cr;
-	int n;
-
-	if (! scheck(user, 100, "username")) {
-		return 0;
-	}
-	if (! scheck(pass, 100, "password")) {
-		return 0;
-	}
-	if (! unixpw_list_match(user)) {
-		return 0;
-	}
-
-	pwd = getpwnam(user);
-	if (! pwd) {
-		return 0;
-	}
-
-	realpw = pwd->pw_passwd;
-	if (realpw == NULL || realpw[0] == '\0') {
-		return 0;
-	}
-
-	if (db > 1) fprintf(stderr, "realpw='%s'\n", realpw);
-
-	if (strlen(realpw) < 12) {
-		/* e.g. "x", try getspnam(), sometimes root for inetd, etc */
-#if LIBVNCSERVER_HAVE_GETSPNAM
-		struct spwd *sp = getspnam(user);
-		if (sp != NULL && sp->sp_pwdp != NULL) {
-			if (db) fprintf(stderr, "using getspnam()\n");
-			realpw = sp->sp_pwdp;
-		} else {
-			if (db) fprintf(stderr, "skipping getspnam()\n");
-		}
-#endif
-	}
-
-	n = strlen(pass);
-	if (pass[n-1] == '\n') {
-		pass[n-1] = '\0';
-	}
-
-	/* XXX remove need for cast */
-	cr = (char *) crypt(pass, realpw);
-	if (db > 1) {
-		fprintf(stderr, "user='%s' pass='%s' realpw='%s' cr='%s'\n",
-		    user, pass, realpw, cr ? cr : "(null)");
-	}
-	if (cr == NULL || cr[0] == '\0') {
-		return 0;
-	}
-	if (!strcmp(cr, realpw)) {
-		return 1;
-	} else {
-		return 0;
-	}
-#endif	/* UNIXPW_CRYPT */
-}
-
-int unixpw_cmd_run(char *user, char *pass, char *cmd, char *line, int *n) {
-	int i, len, rc;
-	char *str;
-	FILE *out;
-
-	if (! user || ! pass) {
-		return 0;
-	}
-	if (! unixpw_cmd || *unixpw_cmd == '\0') {
-		return 0;
-	}
-
-	if (! scheck(user, 100, "username")) {
-		return 0;
-	}
-	if (! scheck(pass, 100, "password")) {
-		return 0;
-	}
-	if (! unixpw_list_match(user)) {
-		return 0;
-	}
-	if (cmd == NULL) {
-		cmd = "";
-	}
-
-	len = strlen(user) + 1 + strlen(pass) + 1 + 1;
-	str = (char *) malloc(len);
-	if (! str) {
-		return 0;
-	}
-	str[0] = '\0';
-	strcat(str, user);
-	strcat(str, "\n");
-	strcat(str, pass);
-	if (!strchr(pass, '\n')) {
-		strcat(str, "\n");
-	}
-
-	out = tmpfile();
-	if (out == NULL) {
-		rfbLog("unixpw_cmd_run tmpfile() failed.\n");
-		clean_up_exit(1);
-	}
-
-	set_env("RFB_UNIXPW_CMD_RUN", cmd);
-
-	rc = run_user_command(unixpw_cmd, unixpw_client, "cmd_verify",
-	    str, strlen(str), out);
-
-	set_env("RFB_UNIXPW_CMD_RUN", "");
-
-	for (i=0; i < len; i++) {
-		str[i] = '\0';
-	}
-	free(str);
-
-	fflush(out);
-	rewind(out);
-	for (i=0; i < (*n) - 1; i++) {
-		int c = fgetc(out);
-		if (c == EOF) {
-			break;
-		}
-		line[i] = (char) c;
-	}
-	fclose(out);
-	*n = i;
-
-	if (rc == 0) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-
-int cmd_verify(char *user, char *pass) {
-	int i, len, rc;
-	char *str;
-
-	if (! user || ! pass) {
-		return 0;
-	}
-	if (! unixpw_cmd || *unixpw_cmd == '\0') {
-		return 0;
-	}
-
-	if (! scheck(user, 100, "username")) {
-		return 0;
-	}
-	if (! scheck(pass, 100, "password")) {
-		return 0;
-	}
-	if (! unixpw_list_match(user)) {
-		return 0;
-	}
-
-	if (unixpw_client) {
-		ClientData *cd = (ClientData *) unixpw_client->clientData;
-		if (cd) {
-			cd->username = strdup(user);
-		}
-	}
-
-	len = strlen(user) + 1 + strlen(pass) + 1 + 1;
-	str = (char *) malloc(len);
-	if (! str) {
-		return 0;
-	}
-	str[0] = '\0';
-	strcat(str, user);
-	strcat(str, "\n");
-	strcat(str, pass);
-	if (!strchr(pass, '\n')) {
-		strcat(str, "\n");
-	}
-
-	rc = run_user_command(unixpw_cmd, unixpw_client, "cmd_verify",
-	    str, strlen(str), NULL);
-
-	for (i=0; i < len; i++) {
-		str[i] = '\0';
-	}
-	free(str);
-
-	if (rc == 0) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int nodisp) {
-#ifndef UNIXPW_SU
-	return 0;
-#else
-	int i, j, status, fd = -1, sfd, tfd, drain_size = 65536, rsize = 0;
-	int slow_pw = 1;
-	char *slave, *bin_true = NULL, *bin_su = NULL;
-	pid_t pid, pidw;
-	struct stat sbuf;
-	static int first = 1;
-	char instr[64], cbuf[10];
-
-	if (first) {
-		set_db();
-		first = 0;
-	}
-	rfbLog("su_verify: '%s' for %s.\n", user, cmd ? "command" : "login");
-	fflush(stderr);
-
-	if (! scheck(user, 100, "username")) {
-		return 0;
-	}
-	if (! scheck(pass, 100, "password")) {
-		return 0;
-	}
-	if (! unixpw_list_match(user)) {
-		return 0;
-	}
-
-	/* unixpw */
-	if (no_external_cmds || !cmd_ok("unixpw")) {
-		rfbLog("su_verify: cannot run external commands.\n");	
-		clean_up_exit(1);
-	}
-
-#define SU_DEBUG 0
-#if SU_DEBUG
-	if (stat("/su", &sbuf) == 0) {
-		bin_su = "/su";	/* Freesbie read-only-fs /bin/su not suid! */
-#else
-	if (0) {
-		;
-#endif
-	} else if (stat("/bin/su", &sbuf) == 0) {
-		bin_su = "/bin/su";
-	} else if (stat("/usr/bin/su", &sbuf) == 0) {
-		bin_su = "/usr/bin/su";
-	}
-	if (bin_su == NULL) {
-		rfbLogPerror("existence /bin/su");
-		fflush(stderr);
-		return 0;
-	}
-
-	if (stat("/bin/true", &sbuf) == 0) {
-		bin_true = "/bin/true";
-	} if (stat("/usr/bin/true", &sbuf) == 0) {
-		bin_true = "/usr/bin/true";
-	}
-	if (cmd != NULL && cmd[0] != '\0') {
-		/* this is for ext. cmd su -c "my cmd" after login */
-		bin_true = cmd;
-	}
-	if (bin_true == NULL) {
-		rfbLogPerror("existence /bin/true");
-		fflush(stderr);
-		return 0;
-	}
-
-	slave = get_pty(&fd);
-
-	if (slave == NULL) {
-		rfbLogPerror("get_pty failed.");
-		fflush(stderr);
-		return 0;
-	}
-
-	if (db) fprintf(stderr, "cmd is: %s\n", cmd);
-	if (db) fprintf(stderr, "slave is: %s fd=%d\n", slave, fd);
-
-	if (fd < 0) {
-		rfbLogPerror("get_pty fd < 0");
-		fflush(stderr);
-		return 0;
-	}
-
-	fcntl(fd, F_SETFD, 1);
-
-	pid = fork();
-	if (pid < 0) {
-		rfbLogPerror("fork");
-		fflush(stderr);
-		close(fd);
-		return 0;
-	}
-
-	if (pid == 0) {
-		/* child */
-
-		int ttyfd;
-		ttyfd = -1;	/* compiler warning */
-
-#if LIBVNCSERVER_HAVE_SETSID
-		if (setsid() == -1) {
-			perror("setsid");
-			exit(1);
-		}
-#else
-		if (setpgrp() == -1) {
-			perror("setpgrp");
-			exit(1);
-		}
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCNOTTY)
-		ttyfd = open("/dev/tty", O_RDWR);
-		if (ttyfd >= 0) {
-			(void) ioctl(ttyfd, TIOCNOTTY, (char *) 0);
-			close(ttyfd);
-		}
-#endif	
-
-#endif	/* SETSID */
-
-		close(0);
-		close(1);
-		close(2);
-
-		sfd = open(slave, O_RDWR);
-		if (sfd < 0) {
-			exit(1);
-		}
-
-/* streams options fixups, handle cases as they are found: */
-#if defined(__hpux)
-#if LIBVNCSERVER_HAVE_SYS_STROPTS_H
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(I_PUSH)
-		if (used_get_pty_ptmx) {
-			ioctl(sfd, I_PUSH, "ptem");
-			ioctl(sfd, I_PUSH, "ldterm");
-			ioctl(sfd, I_PUSH, "ttcompat");
-		}
-#endif
-#endif
-#endif
-
-		/* n.b. sfd will be 0 since we closed 0. so dup it to 1 and 2 */
-		if (fcntl(sfd, F_DUPFD, 1) == -1) {
-			exit(1);
-		}
-		if (fcntl(sfd, F_DUPFD, 2) == -1) {
-			exit(1);
-		}
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCSCTTY)
-		ioctl(sfd, TIOCSCTTY, (char *) 0);
-#endif
-
-		if (db > 2) {
-			char nam[256];
-			unlink("/tmp/isatty");
-			tfd = open("/tmp/isatty", O_CREAT|O_WRONLY, 0600);
-			if (isatty(sfd)) {
-				close(tfd);
-				sprintf(nam, "stty -a < %s > /tmp/isatty 2>&1",
-				    slave);
-				system(nam);
-			} else {
-				write(tfd, "NOTTTY\n", 7);
-				close(tfd);
-			}
-		}
-
-		chdir("/");
-
-		try_to_be_nobody();
-#if LIBVNCSERVER_HAVE_GETUID
-		if (getuid() == 0 || geteuid() == 0) {
-			exit(1);
-		}
-#else
-		exit(1);
-#endif
-
-		set_env("LC_ALL", "C");
-		set_env("LANG", "C");
-		set_env("SHELL", "/bin/sh");
-		if (nodisp) {
-			/* this will cause timeout problems with pam_xauth */
-			int k;
-			for (k=0; k<3; k++) {
-				if (getenv("DISPLAY")) {
-					char *s = getenv("DISPLAY");
-					if (s) *(s-2) = '_';	/* quite... */
-				}
-				if (getenv("XAUTHORITY")) {
-					char *s = getenv("XAUTHORITY");
-					if (s) *(s-2) = '_';	/* quite... */
-				}
-			}
-		}
-
-		/* synchronize with parent: */
-		write(2, "C", 1);
-
-		if (cmd) {
-			execlp(bin_su, bin_su, "-", user, "-c",
-			    bin_true, (char *) NULL);
-		} else {
-			execlp(bin_su, bin_su, user, "-c",
-			    bin_true, (char *) NULL);
-		}
-		exit(1);
-	}
-	/* parent */
-
-	if (db)	fprintf(stderr, "pid: %d\n", pid);
-
-	/*
-	 * set an alarm for blocking read() to close the master
-	 * (presumably terminating the child. SIGTERM too...)
-	 */
-	slave_fd = fd;
-	alarm_fired = 0;
-	signal(SIGALRM, close_alarm);
-	alarm(10);
-
-	/* synchronize with child: */
-	cbuf[0] = '\0';
-	cbuf[1] = '\0';
-	for (i=0; i<10; i++) {
-		int n;
-		cbuf[0] = '\0';
-		cbuf[1] = '\0';
-		n = read(fd, cbuf, 1);
-		if (n < 0 && errno == EINTR) {
-			continue;
-		} else {
-			break;
-		}
-	}
-
-	if (db) {
-		fprintf(stderr, "read from child: '%s'\n", cbuf);
-	}
-
-	alarm(0);
-	signal(SIGALRM, SIG_DFL);
-	if (alarm_fired) {
-		kill_child(pid, fd);
-		return 0;
-	}
-
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCTRAP)
-	{
-		int control = 1;
-		ioctl(fd, TIOCTRAP, &control);
-	}
-#endif
-	
-	/*
-	 * In addition to checking exit code below, we watch for the
-	 * appearance of the string "Password:".  BSD does not seem to
-	 * ask for a password trying to su to yourself.  This is the
-	 * setting in /etc/pam.d/su:
-	 * 	auth      sufficient  pam_self.so
-	 * it may be commented out without problem.
-	 */
-	for (i=0; i< (int) sizeof(instr); i++) {
-		instr[i] = '\0';
-	}
-
-	alarm_fired = 0;
-	signal(SIGALRM, close_alarm);
-	alarm(10);
-
-	j = 0;
-	for (i=0; i < (int) strlen("Password:"); i++) {
-		char pstr[] = "password:";
-		int n, problem;	
-
-		cbuf[0] = '\0';
-		cbuf[1] = '\0';
-
-		n = read(fd, cbuf, 1);
-		if (n < 0 && errno == EINTR) {
-			i--;
-			if (i < -1) i = -1;
-			continue;
-		}
-
-		if (db) {
-			fprintf(stderr, "%s", cbuf);
-			if (db > 3 && n == 1 && cbuf[0] == ':') {
-				char cmd0[32];
-				usleep( 100 * 1000 );
-				fprintf(stderr, "\n\n");
-				sprintf(cmd0, "ps wu %d", pid);
-				system(cmd0);
-				sprintf(cmd0, "stty -a < %s", slave);
-				system(cmd0);
-				fprintf(stderr, "\n\n");
-			}
-		}
-
-		if (n == 1) {
-			if (isspace((unsigned char) cbuf[0])) {
-				i--;
-				if (i < -1) i = -1;
-				continue;
-			}
-			if (j >= (int) sizeof(instr)-1) {
-				rfbLog("su_verify: problem finding Password:\n");	
-				fflush(stderr);
-				return 0;
-			}
-			instr[j++] = tolower((unsigned char)cbuf[0]);
-		}
-
-		problem = 0;
-		if (n <= 0) {
-			problem = 1;
-		} else if (strstr(pstr, instr) != pstr) {
-#ifdef _AIX
-			if (UT.sysname && strstr(UT.sysname, "AIX")) {
-				/* handle: runge's Password: */
-				char *luser = (char *) malloc(strlen(user) + 10);
-
-				sprintf(luser, "%s's", user);
-				lowercase(luser);
-				if (db) fprintf(stderr, "\nAIX luser compare: \"%s\" to \"%s\"\n", luser, instr);
-				if (strstr(luser, instr) == luser) {
-					if (db) fprintf(stderr, "AIX luser compare: strstr OK.\n");
-					if (!strcmp(luser, instr)) {
-						if (db) fprintf(stderr, "AIX luser compare: strings equal.\n");
-						i = -1;	
-						j = 0;
-						memset(instr, 0, sizeof(instr));
-						free(luser);
-						continue;
-					} else {
-						i--;
-						if (i < -1) i = -1;
-						free(luser);
-						continue;
-					}
-				} else {
-					if (db) fprintf(stderr, "AIX luser compare: problem=1\n");
-					problem = 1;
-				}
-				free(luser);
-			} else
-#endif
-			{
-				problem = 1;
-			}
-		}
-
-		if (problem) {
-			if (db) {
-				fprintf(stderr, "\"Password:\" did not "
-				    "appear: '%s'" " n=%d\n", instr, n);
-				if (db > 3 && n == 1 && j < 32) {
-					continue;
-				}
-			}
-			alarm(0);
-			signal(SIGALRM, SIG_DFL);
-			kill_child(pid, fd);
-			return 0;
-		}
-	}
-
-	alarm(0);
-	signal(SIGALRM, SIG_DFL);
-	if (alarm_fired) {
-		kill_child(pid, fd);
-		return 0;
-	}
-
-	if (db) fprintf(stderr, "\nsending passwd: %s\n", db > 2 ? pass : "****");
-	usleep(100 * 1000);
-	if (slow_pw) {
-		unsigned int k;
-		for (k = 0; k < strlen(pass); k++) {
-			write(fd, pass+k, 1); 
-			usleep(100 * 1000);
-		}
-	} else {
-		write(fd, pass, strlen(pass)); 
-	}
-
-	alarm_fired = 0;
-	signal(SIGALRM, close_alarm);
-	alarm(15);
-
-	/*
-	 * try to drain the output, hopefully never as much as 4096 (motd?)
-	 * if we don't drain we may block at waitpid.  If we close(fd), the
-	 * make cause child to die by signal.
-	 */
-	if (rbuf && *rbuf_size > 0) {
-		/* asked to return output of command */
-		drain_size = *rbuf_size;
-		rsize = 0;
-	}
-	if (db) fprintf(stderr, "\ndraining:\n");
-	for (i = 0; i< drain_size; i++) {
-		int n;	
-		
-		cbuf[0] = '\0';
-		cbuf[1] = '\0';
-
-		n = read(fd, cbuf, 1);
-		if (n < 0 && errno == EINTR) {
-			if (db) fprintf(stderr, "\nEINTR n=%d i=%d --", n, i);
-			i--;
-			if (i < 0) i = 0;
-			continue;
-		}
-
-		if (db) fprintf(stderr, "\nn=%d i=%d errno=%d %.6f  '%s'", n, i, errno, dnowx(), cbuf);
-
-		if (n <= 0) {
-			break;
-		}
-		if (rbuf && *rbuf_size > 0) {
-			rbuf[rsize++] = cbuf[0];
-		}
-	}
-	if (db && rbuf) fprintf(stderr, "\nrbuf: '%s'\n", rbuf);
-
-	if (rbuf && *rbuf_size > 0) {
-		char *s = rbuf;
-		char *p = strdup(pass);
-		int n, o = 0;
-		
-		n = strlen(p);
-		if (p[n-1] == '\n') {
-			p[n-1] = '\0';
-		}
-		/*
-		 * usually is: Password: mypassword\r\n\r\n<output-of-command>
-		 * and output will have \n -> \r\n
-		 */
-		if (rbuf[0] == ' ') {
-			s++;
-			o++;
-		}
-		if (strstr(s, p) == s) {
-			s += strlen(p);
-			o += strlen(p);
-			for (n = 0; n < 4; n++) {
-				if (s[0] == '\r' || s[0] == '\n') {
-					s++;
-					o++;
-				}
-			}
-		}
-		if (o > 0) {
-			int i = 0;
-			rsize -= o;
-			while (o < drain_size) {
-				rbuf[i++] = rbuf[o++];
-			}
-		}
-		*rbuf_size = rsize;
-		strzero(p);
-		free(p);
-	}
-
-	if (db) fprintf(stderr, "\n--\n");
-
-	alarm(0);
-	signal(SIGALRM, SIG_DFL);
-	if (alarm_fired) {
-		kill_child(pid, fd);
-		return 0;
-	}
-
-	slave_fd = -1;
-	
-	pidw = waitpid(pid, &status, 0); 
-	close(fd);
-
-	if (pid != pidw) {
-		return 0;
-	}
-
-	if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
-		return 1; /* this is the only return of success. */
-	} else {
-		return 0;
-	}
-#endif	/* UNIXPW_SU */
-}
-
-int unixpw_verify(char *user, char *pass) {
-	int ok = 0;
-	if (unixpw_cmd) {
-		if (cmd_verify(user, pass)) {
-			rfbLog("unixpw_verify: cmd_verify login for '%s'"
-			    " succeeded.\n", user);
-			fflush(stderr);
-			ok = 1;
-		} else {
-			rfbLog("unixpw_verify: cmd_verify login for '%s'"
-			    " failed.\n", user);
-			fflush(stderr);
-			usleep(3000*1000);
-			ok = 0;
-		}
-	} else if (unixpw_nis) {
-		if (crypt_verify(user, pass)) {
-			rfbLog("unixpw_verify: crypt_verify login for '%s'"
-			    " succeeded.\n", user);
-			fflush(stderr);
-			ok = 1;
-		} else {
-			rfbLog("unixpw_verify: crypt_verify login for '%s'"
-			    " failed.\n", user);
-			fflush(stderr);
-			usleep(3000*1000);
-			ok = 0;
-		}
-	} else {
-		if (su_verify(user, pass, NULL, NULL, NULL, 1)) {
-			rfbLog("unixpw_verify: su_verify login for '%s'"
-			    " succeeded.\n", user);
-			fflush(stderr);
-			ok = 1;
-		} else {
-			rfbLog("unixpw_verify: su_verify login for '%s'"
-			    " failed.\n", user);
-			fflush(stderr);
-			/* use su(1)'s sleep */
-			ok = 0;
-		}
-	}
-	return ok;
-}
-
-static int skip_it = 0;
-
-static void progress_skippy(void) {
-	int i, msec = get_net_latency();	/* probabaly not set yet.. */
-
-	if (msec > 300) {
-		msec = 300;
-	} else if (msec <= 100) {
-		msec = 100;
-	}
-
-	skip_it = 1;
-	for (i = 0; i < 5; i++) {
-		if (i == 2) {
-			rfbPE(msec * 1000);
-		} else {
-			rfbPE(-1);
-		}
-		usleep(10*1000);
-	}
-	skip_it = 0;
-
-	usleep(50*1000);
-}
-
-void check_unixpw_userprefs(void) {
-	char *prefs = getenv("FD_USERPREFS");
-	if (keep_unixpw_user == NULL || keep_unixpw_opts == NULL) {
-		return;
-	}
-#if LIBVNCSERVER_HAVE_PWD_H
-	if (prefs != NULL && !strchr(prefs, '/')) {
-		struct passwd *pw = getpwnam(keep_unixpw_user);
-		if (pw != NULL) {
-			char *file;
-			FILE *f;
-
-			file = (char *) malloc(strlen(pw->pw_dir) + 1 + strlen(prefs) + 1);
-			sprintf(file, "%s/%s", pw->pw_dir, prefs);
-
-			f = fopen(file, "r");
-			if (f) {
-				char *t, *q, buf[1024];
-				memset(buf, 0, sizeof(buf));
-
-				fgets(buf, 1024, f);
-				fclose(f);
-
-				q = strchr(buf, '\n');
-				if (q) *q = '\0';
-				q = strchr(buf, '\r');
-				if (q) *q = '\0';
-
-				rfbLog("read user prefs %s: %s\n", file, buf);
-
-				if (buf[0] == '#') buf[0] = '\0';
-
-				t = (char *) malloc(strlen(keep_unixpw_opts) + 1 + strlen(buf) + 1);
-				sprintf(t, "%s,%s", keep_unixpw_opts, buf); 
-				free(keep_unixpw_opts);
-				keep_unixpw_opts = t;
-			} else {
-				rfbLog("could not read user prefs %s\n", file);
-				rfbLogPerror("fopen");
-			}
-			free(file);
-		}
-	}
-#endif
-}
-
-
-void unixpw_verify_screen(char *user, char *pass) {
-	int x, y;
-	char li[] = "Login incorrect";
-	char ls[] = "Login succeeded";
-	char log[] = "login: ";
-	char *colon = NULL;
-	ClientData *cd = NULL;
-	int ok;
-
-if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "********");
-	rfbLog("unixpw_verify: '%s'\n", user ? user : "(null)");
-
-	if (user) {
-		colon = strchr(user, ':');
-	}
-	if (colon) {
-		*colon = '\0';
-		rfbLog("unixpw_verify: colon: '%s'\n", user);
-	}
-	fflush(stderr);
-	if (unixpw_client) {
-		cd = (ClientData *) unixpw_client->clientData;
-		if (cd) {
-			char *str = (char *)malloc(strlen("UNIX:") +
-			    strlen(user) + 1);
-			sprintf(str, "UNIX:%s", user);	
-			if (cd->username) {
-				free(cd->username);
-			}
-			cd->username = str;
-		}
-	}
-
-	ok = unixpw_verify(user, pass);
-
-	if (ok) {
-		char_row++;
-		char_col = 0;
-
-		x = text_x();
-		y = text_y();
-		rfbDrawString(pscreen, &default8x16Font, x, y, ls, white_pixel());
-		unixpw_mark();
-
-		progress_skippy();
-
-		unixpw_accept(user);
-
-		if (keep_unixpw) {
-			keep_unixpw_user = strdup(user);
-			keep_unixpw_pass = strdup(pass);
-			if (colon) {
-				keep_unixpw_opts = strdup(colon+1);
-			} else {
-				keep_unixpw_opts = strdup("");
-			}
-			check_unixpw_userprefs();
-		}
-
-		if (colon) *colon = ':';
-
-		return;
-	}
-	if (colon) *colon = ':';
-
-	if (tries < 2) {
-		char_row++;
-		char_col = 0;
-
-		x = text_x();
-		y = text_y();
-		rfbDrawString(pscreen, &default8x16Font, x, y, li, white_pixel());
-
-		char_row += 2;
-
-		x = text_x();
-		y = text_y();
-		rfbDrawString(pscreen, &default8x16Font, x, y, log, white_pixel());
-
-		char_col = strlen(log);
-
-		unixpw_mark();
-
-		unixpw_last_try_time = time(NULL);
-		unixpw_keystroke(0, 0, 2);
-		tries++;
-	} else {
-		unixpw_deny();
-	}
-}
-
-static void set_db(void) {
-	if (getenv("DEBUG_UNIXPW")) {
-		db = atoi(getenv("DEBUG_UNIXPW"));
-		rfbLog("DEBUG_UNIXPW: %d\n", db);
-	}
-}
-
-void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
-	int x, y, i, rc, nmax = 100;
-	static char user_r[100], user[100], pass[100];
-	static int  u_cnt = 0, p_cnt = 0, t_cnt = 0, first = 1;
-	static int echo = 1;
-	char keystr[100];
-	char *str;
-
-	if (skip_it) {
-		return;
-	}
-
-	if (first) {
-		set_db();
-		first = 0;
-		for (i=0; i < nmax; i++) {
-			user_r[i] = '\0';
-			user[i] = '\0';
-			pass[i] = '\0';
-		}
-	}
-
-	if (init) {
-		in_login = 1;
-		in_passwd = 0;
-		unixpw_denied = 0;
-		echo = 1;
-		if (init == 1) {
-			tries = 0;
-		}
-
-		u_cnt = 0;
-		p_cnt = 0;
-		t_cnt = 0;
-		for (i=0; i<nmax; i++) {
-			user[i] = '\0';
-			pass[i] = '\0';
-		}
-		if (keep_unixpw_user) {
-			free(keep_unixpw_user);
-			keep_unixpw_user = NULL;
-		}
-		if (keep_unixpw_pass) {
-			strzero(keep_unixpw_pass);
-			free(keep_unixpw_pass);
-			keep_unixpw_pass = NULL;
-		}
-		if (keep_unixpw_opts) {
-			strzero(keep_unixpw_opts);
-			free(keep_unixpw_opts);
-			keep_unixpw_opts = NULL;
-		}
-
-		return;
-	}
-
-	if (unixpw_denied) {
-		rfbLog("unixpw_keystroke: unixpw_denied state: 0x%x\n", (int) keysym);
-		return;
-	}
-	if (keysym <= 0) {
-		rfbLog("unixpw_keystroke: bad keysym1: 0x%x\n", (int) keysym);
-		return;
-	}
-
-	/* rfbKeySym = uint32_t */
-	/* KeySym = XID = CARD32 = (unsigned long or unsigned int on LONG64) */
-	X_LOCK;
-	str = XKeysymToString(keysym);
-	X_UNLOCK;
-	if (str == NULL) {
-		rfbLog("unixpw_keystroke: bad keysym2: 0x%x\n", (int) keysym);
-		return;
-	}
-
-	rc = snprintf(keystr, 100, "%s", str);
-	if (rc < 1 || rc > 90) {
-		rfbLog("unixpw_keystroke: bad keysym3: 0x%x\n", (int) keysym);
-		return;
-	}
-
-	if (db > 2) {
-		fprintf(stderr, "%s / %s  0x%x %s\n", in_login ? "login":"pass ",
-		    down ? "down":"up  ", keysym, keystr);
-	}
-
-	if (keysym == XK_Return || keysym == XK_Linefeed || keysym == XK_Tab) {
-		/* let "up" pass down below for Return case */
-		if (down) {
-			return;
-		}
-	} else if (! down) {
-		return;
-	}
-	if (keysym == XK_F1) {
-		char h1[] = "F1-Help:  For 'login:' type in the username and press Enter, then for 'Password:' enter the password.";
-		char hf[] = "  Once logged in, username's X session will be searched for and if found then attached to.";
-		char hc[] = "  Once logged in, username's X session is sought and attached to, otherwise a new session is created.";
-		char hx[] = "  Once logged in, username's X session is sought and attached to, otherwise a login greeter is presented.";
-		char h2[] = "  Specify options after a ':' like this:  username:opt,opt=val,...    Where an opt may be any of:";
-		char h3[] = "    scale=... (n/m); scale_cursor=... (sc=); solid (so); id=; repeat; clear_mods (cm); clear_keys (ck);";
-		char h4[] = "    clear_all (ca); speeds=... (sp=); readtimeout=... (rd=) rotate=... (ro=); noncache (nc) (nc=n);";
-		char h5[] = "    geom=WxHxD (ge=); nodisplay=... (nd=); viewonly (vo); tag=...; gnome kde twm fvwm mwm dtwm wmaker";
-		char h6[] = "    xfce lxde enlightenment Xsession failsafe.   Examples:  fred:3/4,so,cm  wilma:geom=1024x768x16,kde";
-		int ch = 13, p;
-		if (!pscreen || pscreen->width < 640 || pscreen->height < 480) {
-			return;
-		}
-		if (f1_help) {
-			p = black_pixel();
-			f1_help = 0;
-		} else {
-			p = white_pixel();
-			f1_help = 1;
-			unixpw_last_try_time = time(NULL) + 45;
-		}
-		rfbDrawString(pscreen, &default6x13Font, 8, 2+1*ch, h1, p);
-		if (use_dpy == NULL) {
-			;
-		} else if (strstr(use_dpy, "cmd=FINDDISPLAY")) {
-			rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, hf, p);
-		} else if (strstr(use_dpy, "cmd=FINDCREATEDISPLAY")) {
-			if (strstr(use_dpy, "xdmcp")) {
-				rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, hx, p);
-			} else {
-				rfbDrawString(pscreen, &default6x13Font, 8, 2+2*ch, hc, p);
-			}
-		}
-		rfbDrawString(pscreen, &default6x13Font, 8, 2+3*ch, h2, p);
-		rfbDrawString(pscreen, &default6x13Font, 8, 2+4*ch, h3, p);
-		rfbDrawString(pscreen, &default6x13Font, 8, 2+5*ch, h4, p);
-		rfbDrawString(pscreen, &default6x13Font, 8, 2+6*ch, h5, p);
-		rfbDrawString(pscreen, &default6x13Font, 8, 2+7*ch, h6, p);
-		if (!f1_help) {
-			rfbDrawString(pscreen, &default6x13Font, 8, 2+1*ch, "F1-Help:", white_pixel());
-		}
-		unixpw_mark();
-		return;
-	}
-	if (unixpw_system_greeter_active && keysym == XK_Escape) {
-		char *u = get_user_name();
-		if (keep_unixpw) {
-			char *colon = strchr(user, ':');
-			keep_unixpw_user = strdup(u);
-			keep_unixpw_pass = strdup("");
-			if (colon) {
-				keep_unixpw_opts = strdup(colon+1);
-			} else {
-				keep_unixpw_opts = strdup("");
-			}
-			check_unixpw_userprefs();
-		}
-		unixpw_system_greeter_active = 2;
-		set_env("X11VNC_XDM_ONLY", "1");
-		rfbLog("unixpw_system_greeter: VNC client pressed 'Escape'. Allowing\n");
-		rfbLog("unixpw_system_greeter: a *FREE* (no password) connection to\n");
-		rfbLog("unixpw_system_greeter: the system XDM/GDM/KDM login greeter.\n");
-		if (1) {
-			char msg[] = " Please wait... ";
-			rfbDrawString(pscreen, &default8x16Font,
-			    text_x(), text_y(), msg, white_pixel());
-			unixpw_mark();
-
-			progress_skippy();
-		}
-		unixpw_accept(u);
-		free(u);
-		return;
-	}
-
-	if (in_login && keysym == XK_Escape && u_cnt == 0) {
-		echo = 0;	
-		rfbLog("unixpw_keystroke: echo off.\n");
-		return;
-	}
-
-	t_cnt++;
-
-	if (in_login) {
-		if (keysym == XK_BackSpace || keysym == XK_Delete) {
-			if (u_cnt > 0) {
-				user[u_cnt-1] = '\0';
-				u_cnt--;
-
-				x = text_x();
-				y = text_y();
-				if (scaling) {
-					int x2 = x / scale_fac_x;
-					int y2 = y / scale_fac_y;
-					int w2 = char_w / scale_fac_x;
-					int h2 = char_h / scale_fac_y;
-
-					x2 = nfix(x2, dpy_x);
-					y2 = nfix(y2, dpy_y);
-					
-					zero_fb(x2 - w2, y2 - h2, x2, y2);
-					mark_rect_as_modified(x2 - w2,
-					    y2 - h2, x2, y2, 0);
-				} else {
-					zero_fb(x - char_w, y - char_h, x, y);
-					mark_rect_as_modified(x - char_w,
-					    y - char_h, x, y, 0);
-				}
-				char_col--;
-			}
-
-			return;
-		}
-
-		if (keysym == XK_Return || keysym == XK_Linefeed || keysym == XK_Tab) {
-			char pw[] = "Password: ";
-
-			if (down) {
-				/*
-				 * require Up so the Return Up is not processed
-				 * by the normal session after login.
-				 * (actually we already returned above)
-				 */
-				return;
-			}
-
-			if (t_cnt == 1) {
-				/* accidental initial return, e.g. from xterm */
-				return;
-			}
-
-			in_login = 0;
-			in_passwd = 1;
-
-			char_row++;
-			char_col = 0;
-
-			x = text_x();
-			y = text_y();
-			rfbDrawString(pscreen, &default8x16Font, x, y, pw,
-			    white_pixel());
-
-			char_col = strlen(pw);
-			unixpw_mark();
-			return;
-		}
-
-		if (u_cnt == 0 && keysym == XK_Up) {
-			/*
-			 * Allow user to hit Up arrow at beginning to
-			 * regain their username plus any options.
-			 */
-			int i;
-			for (i=0; i < nmax; i++) {
-				user[i] = '\0';
-			}
-			for (i=0; i < nmax; i++) {
-				char str[10];
-				user[u_cnt++] = user_r[i];
-				if (user_r[i] == '\0') {
-					break;
-				}
-				str[0] = (char) user_r[i];
-				str[1] = '\0';
-
-				x = text_x();
-				y = text_y();
-				if (echo) {
-					rfbDrawString(pscreen, &default8x16Font, x, y,
-					    str, white_pixel());
-				}
-				mark_rect_as_modified(x, y-char_h, x+char_w,
-				    y, scaling);
-				char_col++;
-				usleep(10*1000);
-			}
-			return;
-		}
-
-		if (keysym < ' ' || keysym >= 0x7f) {
-			/* require normal keyboard characters for username */
-			rfbLog("unixpw_keystroke: bad keysym4: 0x%x\n", (int) keysym);
-			return;
-		}
-
-		if (u_cnt >= nmax - 1) {
-			/* user[u_cnt=99] will be '\0' */
-			rfbLog("unixpw_deny: username too long: %d\n", u_cnt);
-			for (i=0; i<nmax; i++) {
-				user[i] = '\0';
-				pass[i] = '\0';
-			}
-			unixpw_deny();
-			return;
-		}
-
-#if 0
-		user[u_cnt++] = keystr[0];
-#else
-		user[u_cnt++] = (char) keysym;
-		for (i=0; i < nmax; i++) {
-			/* keep a full copy of username */
-			user_r[i] = user[i];
-		}
-		keystr[0] = (char) keysym;
-#endif
-		keystr[1] = '\0';
-
-		x = text_x();
-		y = text_y();
-
-if (db && db <= 2) fprintf(stderr, "u_cnt: %d %d/%d ks: 0x%x  '%s'\n", u_cnt, x, y, keysym, keystr);
-
-		if (echo ) {
-			rfbDrawString(pscreen, &default8x16Font, x, y, keystr, white_pixel());
-		}
-
-		mark_rect_as_modified(x, y-char_h, x+char_w, y, scaling);
-		char_col++;
-
-		return;
-
-	} else if (in_passwd) {
-		if (keysym == XK_BackSpace || keysym == XK_Delete) {
-			if (p_cnt > 0) {
-				pass[p_cnt-1] = '\0';
-				p_cnt--;
-			}
-			return;
-		}
-		if (keysym == XK_Return || keysym == XK_Linefeed) {
-			if (down) {
-				/*
-				 * require Up so the Return Up is not processed
-				 * by the normal session after login.
-				 * (actually we already returned above)
-				 */
-				return;
-			}
-
-			if (1) {
-				char msg[] = " Please wait... ";
-				rfbDrawString(pscreen, &default8x16Font,
-				    text_x(), text_y(), msg, white_pixel());
-				unixpw_mark();
-
-				progress_skippy();
-			}
-
-			in_login = 0;
-			in_passwd = 0;
-
-			pass[p_cnt++] = '\n';
-			unixpw_verify_screen(user, pass);
-			for (i=0; i<nmax; i++) {
-				user[i] = '\0';
-				pass[i] = '\0';
-			}
-			return;
-		}
-
-		if (keysym < ' ' || keysym >= 0x7f) {
-			/* require normal keyboard characters for password */
-			return;
-		}
-
-		if (p_cnt >= nmax - 2) {
-			/* pass[u_cnt=98] will be '\n' */
-			/* pass[u_cnt=99] will be '\0' */
-			rfbLog("unixpw_deny: password too long: %d\n", p_cnt);
-			for (i=0; i<nmax; i++) {
-				user[i] = '\0';
-				pass[i] = '\0';
-			}
-			unixpw_deny();
-			return;
-		}
-
-		pass[p_cnt++] = (char) keysym;
-
-		return;
-
-	} else {
-		/* should not happen... anyway clean up a bit. */
-		u_cnt = 0;
-		p_cnt = 0;
-		for (i=0; i<nmax; i++) {
-			user_r[i] = '\0';
-			user[i] = '\0';
-			pass[i] = '\0';
-		}
-
-		return;
-	}
-}
-
-static void apply_opts (char *user) {
-	char *p, *q, *str, *opts = NULL, *opts_star = NULL;
-	rfbClientPtr cl;
-	ClientData *cd;
-	int i, notmode = 0;
-
-	if (! unixpw_client) {
-		rfbLog("apply_opts: unixpw_client is NULL\n");
-		clean_up_exit(1);
-	}
-	cd = (ClientData *) unixpw_client->clientData;
-	cl = unixpw_client;
-
-	if (! cd) {
-		rfbLog("apply_opts: no ClientData\n");
-	}
-	
-	if (user && cd) {
-		if (cd->unixname) {
-			free(cd->unixname);
-		}
-		cd->unixname = strdup(user);
-		rfbLog("apply_opts: set unixname to: %s\n", cd->unixname);
-	}
-
-	if (! unixpw_list) {
-		return;
-	}
-	str = strdup(unixpw_list);
-
-	/* apply any per-user options. */
-	if (str[0] == '!') {
-		p = strtok(str+1, ",");
-		notmode = 1;
-	} else {
-		p = strtok(str, ",");
-	}
-	while (p) {
-		if ( (q = strchr(p, ':')) != NULL ) {
-			*q = '\0';	/* get rid of options. */
-		} else {
-			p = strtok(NULL, ",");
-			continue;
-		}
-		if (user && !strcmp(user, p)) {
-			/* will not happen in notmode */
-			opts = strdup(q+1);
-		}
-		if (!strcmp("*", p)) {
-			opts_star = strdup(q+1);
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-
-	for (i=0; i < 2; i++) {
-		char *s = (i == 0) ? opts_star : opts;
-		if (s == NULL) {
-			continue;
-		}
-		p = strtok(s, "+");
-		while (p) {
-			if (!strcmp(p, "viewonly")) {
-				cl->viewOnly = TRUE;
-				if (cd) {
-					strncpy(cd->input, "-", CILEN);
-				}
-			} else if (!strcmp(p, "fullaccess")) {
-				cl->viewOnly = FALSE;
-				if (cd) {
-					strncpy(cd->input, "-", CILEN);
-				}
-			} else if ((q = strstr(p, "input=")) == p) {
-				q += strlen("input=");
-				if (cd) {
-					strncpy(cd->input, q, CILEN);
-				}
-			} else if (!strcmp(p, "deny")) {
-				cl->viewOnly = TRUE;
-				unixpw_deny();
-				break;
-			}
-			p = strtok(NULL, "+");
-		}
-		free(s);
-	}
-}
-
-void unixpw_accept(char *user) {
-	apply_opts(user);
-
-	if (!use_stunnel) {
-		ssl_helper_pid(0, -2);	/* waitall */
-	}
-
-	if (accept_cmd && strstr(accept_cmd, "popup") == accept_cmd) {
-		if (use_dpy && strstr(use_dpy, "WAIT:") == use_dpy &&
-		    dpy == NULL) {
-			/* handled in main() */
-			unixpw_client->onHold = TRUE;
-		} else if (! accept_client(unixpw_client)) {
-			unixpw_deny();
-			return;
-		}
-	}
-
-	if (started_as_root == 1 && users_list
-	    && strstr(users_list, "unixpw=") == users_list) {
-		if (getuid() && geteuid()) {
-			rfbLog("unixpw_accept: unixpw= but not root\n");
-			started_as_root = 2;
-		} else {
-			char *u = (char *)malloc(strlen(user)+1); 
-
-			u[0] = '\0';
-			if (!strcmp(users_list, "unixpw=")) {
-				sprintf(u, "+%s", user);
-			} else {
-				char *p, *str = strdup(users_list);
-				p = strtok(str + strlen("unixpw="), ",");
-				while (p) {
-					if (!strcmp(p, user)) {
-						sprintf(u, "+%s", user);
-						break;
-					}
-					p = strtok(NULL, ",");
-				}
-				free(str);
-			}
-			
-			if (u[0] == '\0') {
-				rfbLog("unixpw_accept skipping switch to user: %s\n", user);
-			} else if (switch_user(u, 0)) {
-				rfbLog("unixpw_accept switched to user: %s\n", user);
-			} else {
-				rfbLog("unixpw_accept failed to switch to user: %s\n", user);
-			}
-			free(u);
-		}
-	}
-
-	if (unixpw_login_viewonly) {
-		unixpw_client->viewOnly = TRUE;
-	}
-	unixpw_in_progress = 0;
-	/* mutex */
-	screen->permitFileTransfer = unixpw_file_xfer_save;
-	if ((tightfilexfer = unixpw_tightvnc_xfer_save)) {
-		/* this doesn't work: the current client is never registered! */
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-		rfbLog("rfbRegisterTightVNCFileTransferExtension: 1\n");
-                rfbRegisterTightVNCFileTransferExtension();
-#endif
-	}
-	unixpw_client = NULL;
-	mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
-	if (macosx_console) {
-		refresh_screen(1);
-	}
-}
-
-void unixpw_deny(void) {
-	int x, y, i;
-	char pd[] = "Permission denied.";
-
-	rfbLog("unixpw_deny: %d, %d\n", unixpw_denied, unixpw_in_progress);
-	if (! unixpw_denied) {
-		unixpw_denied = 1;
-
-		char_row += 2;
-		char_col = 0;
-		x = char_x + char_col * char_w;
-		y = char_y + char_row * char_h;
-
-		rfbDrawString(pscreen, &default8x16Font, x, y, pd, white_pixel());
-		unixpw_mark();
-
-		for (i=0; i<5; i++) {
-			rfbPE(-1);
-			rfbPE(-1);
-			usleep(500 * 1000);
-		}
-	}
-
-	if (unixpw_client) {
-		rfbCloseClient(unixpw_client);
-		rfbClientConnectionGone(unixpw_client);
-		rfbPE(-1);
-	}
-
-	unixpw_in_progress = 0;
-	/* mutex */
-	screen->permitFileTransfer = unixpw_file_xfer_save;
-	if ((tightfilexfer = unixpw_tightvnc_xfer_save)) {
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-		rfbLog("rfbRegisterTightVNCFileTransferExtension: 2\n");
-                rfbRegisterTightVNCFileTransferExtension();
-#endif
-	}
-	unixpw_client = NULL;
-	copy_screen();
-}
-
-void unixpw_msg(char *msg, int delay) {
-	int x, y, i;
-
-	char_row += 2;
-	char_col = 0;
-	x = char_x + char_col * char_w;
-	y = char_y + char_row * char_h;
-
-	rfbDrawString(pscreen, &default8x16Font, x, y, msg, white_pixel());
-	unixpw_mark();
-
-	for (i=0; i<5; i++) {
-		rfbPE(-1);
-		rfbPE(-1);
-		rfbPE(50 * 1000);
-		rfbPE(-1);
-		usleep(500 * 1000);
-		if (i >= delay) {
-			break;
-		}
-	}
-}
diff --git a/ica/x11/x11vnc/unixpw.h b/ica/x11/x11vnc/unixpw.h
deleted file mode 100644
index 7b93d30..0000000
--- a/ica/x11/x11vnc/unixpw.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_UNIXPW_H
-#define _X11VNC_UNIXPW_H
-
-/* -- unixpw.h -- */
-
-extern int white_pixel(void);
-extern void unixpw_screen(int init);
-extern void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init);
-extern void unixpw_accept(char *user);
-extern void unixpw_deny(void);
-extern void unixpw_msg(char *msg, int delay);
-extern int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int nodisp);
-extern int unixpw_cmd_run(char *user, char *pass, char *cmd, char *line, int *n);
-extern int crypt_verify(char *user, char *pass);
-extern int cmd_verify(char *user, char *pass);
-extern int unixpw_verify(char *user, char *pass);
-extern void unixpw_verify_screen(char *user, char *pass);
-
-extern int unixpw_in_progress;
-extern int unixpw_denied;
-extern int unixpw_in_rfbPE;
-extern int unixpw_login_viewonly;
-extern int unixpw_tightvnc_xfer_save;
-extern rfbBool unixpw_file_xfer_save;
-extern time_t unixpw_last_try_time;
-extern rfbClientPtr unixpw_client;
-extern int keep_unixpw;
-extern char *keep_unixpw_user;
-extern char *keep_unixpw_pass;
-extern char *keep_unixpw_opts;
-
-#endif /* _X11VNC_UNIXPW_H */
diff --git a/ica/x11/x11vnc/user.c b/ica/x11/x11vnc/user.c
deleted file mode 100644
index 971618a..0000000
--- a/ica/x11/x11vnc/user.c
+++ /dev/null
@@ -1,3163 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- user.c -- */
-
-#include "x11vnc.h"
-#include "solid.h"
-#include "cleanup.h"
-#include "scan.h"
-#include "screen.h"
-#include "unixpw.h"
-#include "sslhelper.h"
-#include "xwrappers.h"
-#include "connections.h"
-#include "inet.h"
-#include "keyboard.h"
-#include "cursor.h"
-#include "remote.h"
-#include "sslhelper.h"
-#include "avahi.h"
-
-void check_switched_user(void);
-void lurk_loop(char *str);
-int switch_user(char *user, int fb_mode);
-int read_passwds(char *passfile);
-void install_passwds(void);
-void check_new_passwds(int force);
-void progress_client(void);
-int wait_for_client(int *argc, char** argv, int http);
-rfbBool custom_passwd_check(rfbClientPtr cl, const char *response, int len);
-char *xdmcp_insert = NULL;
-
-static void switch_user_task_dummy(void);
-static void switch_user_task_solid_bg(void);
-static char *get_login_list(int with_display);
-static char **user_list(char *user_str);
-#ifdef WIN32
-typedef int uid_t;
-typedef int gid_t;
-#endif
-static void user2uid(char *user, uid_t *uid, gid_t *gid, char **name, char **home);
-static int lurk(char **users);
-static int guess_user_and_switch(char *str, int fb_mode);
-static int try_user_and_display(uid_t uid, gid_t gid, char *dpystr);
-static int switch_user_env(uid_t uid, gid_t gid, char *name, char *home, int fb_mode);
-static void try_to_switch_users(void);
-
-
-/* tasks for after we switch */
-static void switch_user_task_dummy(void) {
-	;	/* dummy does nothing */
-}
-static void switch_user_task_solid_bg(void) {
-	/* we have switched users, some things to do. */
-	if (use_solid_bg && client_count) {
-		solid_bg(0);
-	}
-}
-
-void check_switched_user(void) {
-	static time_t sched_switched_user = 0;
-	static int did_solid = 0;
-	static int did_dummy = 0;
-	int delay = 15;
-	time_t now = time(NULL);
-
-	if (unixpw_in_progress) return;
-
-	if (started_as_root == 1 && users_list) {
-		try_to_switch_users();
-		if (started_as_root == 2) {
-			/*
-			 * schedule the switch_user_tasks() call
-			 * 15 secs is for piggy desktops to start up.
-			 * might not be enough for slow machines...
-			 */
-			sched_switched_user = now;
-			did_dummy = 0;
-			did_solid = 0;
-			/* add other activities */
-		}
-	}
-	if (! sched_switched_user) {
-		return;
-	}
-
-	if (! did_dummy) {
-		switch_user_task_dummy();
-		did_dummy = 1;
-	}
-	if (! did_solid) {
-		int doit = 0;
-		char *ss = solid_str;
-		if (now >= sched_switched_user + delay) {
-			doit = 1;
-		} else if (ss && strstr(ss, "root:") == ss) {
-		    	if (now >= sched_switched_user + 3) {
-				doit = 1;
-			}
-		} else if (strcmp("root", guess_desktop())) {
-			usleep(1000 * 1000);
-			doit = 1;
-		}
-		if (doit) {
-			switch_user_task_solid_bg();
-			did_solid = 1;
-		}
-	}
-
-	if (did_dummy && did_solid) {
-		sched_switched_user = 0;
-	}
-}
-
-/* utilities for switching users */
-static char *get_login_list(int with_display) {
-	char *out;
-#if LIBVNCSERVER_HAVE_UTMPX_H
-	int i, cnt, max = 200, ut_namesize = 32;
-	int dpymax = 1000, sawdpy[1000];
-	struct utmpx *utx;
-
-	/* size based on "username:999," * max */
-	out = (char *) malloc(max * (ut_namesize+1+3+1) + 1);
-	out[0] = '\0';
-
-	for (i=0; i<dpymax; i++) {
-		sawdpy[i] = 0;
-	}
-
-	setutxent();
-	cnt = 0;
-	while (1) {
-		char *user, *line, *host, *id;
-		char tmp[10];
-		int d = -1;
-		utx = getutxent();
-		if (! utx) {
-			break;
-		}
-		if (utx->ut_type != USER_PROCESS) {
-			continue;
-		}
-		user = lblanks(utx->ut_user);
-		if (*user == '\0') {
-			continue;
-		}
-		if (strchr(user, ',')) {
-			continue;	/* unlikely, but comma is our sep. */
-		}
-
-		line = lblanks(utx->ut_line);
-		host = lblanks(utx->ut_host);
-		id   = lblanks(utx->ut_id);
-
-		if (with_display) {
-			if (0 && line[0] != ':' && strcmp(line, "dtlocal")) {
-				/* XXX useful? */
-				continue;
-			}
-
-			if (line[0] == ':') {
-				if (sscanf(line, ":%d", &d) != 1)  {
-					d = -1;
-				}
-			}
-			if (d < 0 && host[0] == ':') {
-				if (sscanf(host, ":%d", &d) != 1)  {
-					d = -1;
-				}
-			}
-			if (d < 0 && id[0] == ':') {
-				if (sscanf(id, ":%d", &d) != 1)  {
-					d = -1;
-				}
-			}
-
-			if (d < 0 || d >= dpymax || sawdpy[d]) {
-				continue;
-			}
-			sawdpy[d] = 1;
-			sprintf(tmp, ":%d", d);
-		} else {
-			/* try to eliminate repeats */
-			int repeat = 0;
-			char *q;
-
-			q = out;
-			while ((q = strstr(q, user)) != NULL) {
-				char *p = q + strlen(user) + strlen(":DPY");
-				if (q == out || *(q-1) == ',') {
-					/* bounded on left. */
-					if (*p == ',' || *p == '\0') {
-						/* bounded on right. */
-						repeat = 1;
-						break;
-					}
-				}
-				q = p;
-			}
-			if (repeat) {
-				continue;
-			}
-			sprintf(tmp, ":DPY");
-		}
-
-		if (*out) {
-			strcat(out, ",");
-		}
-		strcat(out, user);
-		strcat(out, tmp);
-
-		cnt++;
-		if (cnt >= max) {
-			break;
-		}
-	}
-	endutxent();
-#else
-	out = strdup("");
-#endif
-	return out;
-}
-
-static char **user_list(char *user_str) {
-	int n, i;
-	char *p, **list;
-	
-	p = user_str;
-	n = 1;
-	while (*p++) {
-		if (*p == ',') {
-			n++;
-		}
-	}
-	list = (char **) calloc((n+1)*sizeof(char *), 1);
-
-	p = strtok(user_str, ",");
-	i = 0;
-	while (p) {
-		list[i++] = strdup(p);
-		p = strtok(NULL, ",");
-	}
-	list[i] = NULL;
-	return list;
-}
-
-static void user2uid(char *user, uid_t *uid, gid_t *gid, char **name, char **home) {
-	int numerical = 1, gotgroup = 0;
-	char *q;
-
-	*uid = (uid_t) -1;
-	*name = NULL;
-	*home = NULL;
-
-	q = user;
-	while (*q) {
-		if (! isdigit((unsigned char) (*q++))) {
-			numerical = 0;
-			break;
-		}
-	}
-
-	if (user2group != NULL) {
-		static int *did = NULL;
-		int i;
-
-		if (did == NULL) {
-			int n = 0;
-			i = 0;
-			while (user2group[i] != NULL) {
-				n++;
-				i++;
-			}
-			did = (int *) malloc((n+1) * sizeof(int)); 
-			i = 0;
-			for (i=0; i<n; i++) {
-				did[i] = 0;
-			}
-		}
-		i = 0;
-		while (user2group[i] != NULL) {
-			if (strstr(user2group[i], user) == user2group[i]) {
-				char *w = user2group[i] + strlen(user);
-				if (*w == '.') {
-#if (SMALL_FOOTPRINT > 2)
-					gotgroup = 0;
-#else
-					struct group* gr = getgrnam(++w);
-					if (! gr) {
-						rfbLog("Invalid group: %s\n", w);
-						clean_up_exit(1);
-					}
-					*gid = gr->gr_gid;
-					if (! did[i]) {
-						rfbLog("user2uid: using group %s (%d) for %s\n",
-						    w, (int) *gid, user);
-						did[i] = 1;
-					}
-					gotgroup = 1;
-#endif
-				}
-			}
-			i++;
-		}
-	}
-
-	if (numerical) {
-		int u = atoi(user);
-
-		if (u < 0) {
-			return;
-		}
-		*uid = (uid_t) u;
-	}
-
-#if LIBVNCSERVER_HAVE_PWD_H
-	if (1) {
-		struct passwd *pw;
-		if (numerical) {
-			pw = getpwuid(*uid);
-		} else {
-			pw = getpwnam(user);
-		}
-		if (pw) {
-			*uid  = pw->pw_uid;
-			if (! gotgroup) {
-				*gid  = pw->pw_gid;
-			}
-			*name = pw->pw_name;	/* n.b. use immediately */
-			*home = pw->pw_dir;
-		}
-	}
-#endif
-}
-
-
-static int lurk(char **users) {
-	uid_t uid;
-	gid_t gid;
-	int success = 0, dmin = -1, dmax = -1;
-	char *p, *logins, **u;
-	char **list;
-	int lind;
-
-	if ((u = users) != NULL && *u != NULL && *(*u) == ':') {
-		int len;
-		char *tmp;
-
-		/* extract min and max display numbers */
-		tmp = *u;
-		if (strchr(tmp, '-')) {
-			if (sscanf(tmp, ":%d-%d", &dmin, &dmax) != 2) {
-				dmin = -1;
-				dmax = -1;
-			}
-		}
-		if (dmin < 0) {
-			if (sscanf(tmp, ":%d", &dmin) != 1) {
-				dmin = -1;
-				dmax = -1;
-			} else {
-				dmax = dmin;
-			}
-		}
-		if ((dmin < 0 || dmax < 0) || dmin > dmax || dmax > 10000) {
-			dmin = -1;
-			dmax = -1;
-		}
-
-		/* get user logins regardless of having a display: */
-		logins = get_login_list(0);
-
-		/*
-		 * now we append the list in users (might as well try
-		 * them) this will probably allow weird ways of starting
-		 * xservers to work.
-		 */
-		len = strlen(logins);
-		u++;
-		while (*u != NULL) {
-			len += strlen(*u) + strlen(":DPY,");
-			u++;
-		}
-		tmp = (char *) malloc(len+1);
-		strcpy(tmp, logins);
-
-		/* now concatenate them: */
-		u = users+1;
-		while (*u != NULL) {
-			char *q, chk[100];
-			snprintf(chk, 100, "%s:DPY", *u);
-			q = strstr(tmp, chk);
-			if (q) {
-				char *p = q + strlen(chk);
-				
-				if (q == tmp || *(q-1) == ',') {
-					/* bounded on left. */
-					if (*p == ',' || *p == '\0') {
-						/* bounded on right. */
-						u++;
-						continue;
-					}
-				}
-			}
-			
-			if (*tmp) {
-				strcat(tmp, ",");
-			}
-			strcat(tmp, *u);
-			strcat(tmp, ":DPY");
-			u++;
-		}
-		free(logins);
-		logins = tmp;
-		
-	} else {
-		logins = get_login_list(1);
-	}
-
-	list = (char **) calloc((strlen(logins)+2)*sizeof(char *), 1);
-	lind = 0;
-	p = strtok(logins, ",");
-	while (p) {
-		list[lind++] = strdup(p);
-		p = strtok(NULL, ",");
-	}
-	free(logins);
-
-	lind = 0;
-	while (list[lind] != NULL) {
-		char *user, *name, *home, dpystr[10];
-		char *q, *t;
-		int ok = 1, dn;
-
-		p = list[lind++];
-		
-		t = strdup(p);	/* bob:0 */
-		q = strchr(t, ':'); 
-		if (! q) {
-			free(t);
-			break;
-		}
-		*q = '\0';
-		user = t;
-		snprintf(dpystr, 10, ":%s", q+1);
-
-		if (users) {
-			u = users;
-			ok = 0;
-			while (*u != NULL) {
-				if (*(*u) == ':') {
-					u++;
-					continue;
-				}
-				if (!strcmp(user, *u++)) {
-					ok = 1;
-					break;
-				}
-			}
-		}
-
-		user2uid(user, &uid, &gid, &name, &home);
-		free(t);
-
-		if (! uid || ! gid) {
-			ok = 0;
-		}
-
-		if (! ok) {
-			continue;
-		}
-		
-		for (dn = dmin; dn <= dmax; dn++) {
-			if (dn >= 0) {
-				sprintf(dpystr, ":%d", dn);
-			}
-			if (try_user_and_display(uid, gid, dpystr)) {
-				if (switch_user_env(uid, gid, name, home, 0)) {
-					rfbLog("lurk: now user: %s @ %s\n",
-					    name, dpystr);
-					started_as_root = 2;
-					success = 1;
-				}
-				set_env("DISPLAY", dpystr);
-				break;
-			}
-		}
-		if (success) {
-			 break;
-		}
-	}
-
-	lind = 0;
-	while (list[lind] != NULL) {
-		free(list[lind]);
-		lind++;
-	}
-
-	return success;
-}
-
-void lurk_loop(char *str) {
-	char *tstr = NULL, **users = NULL;
-
-	if (strstr(str, "lurk=") != str) {
-		exit(1);
-	}
-	rfbLog("lurking for logins using: '%s'\n", str);
-	if (strlen(str) > strlen("lurk=")) {
-		char *q = strchr(str, '=');
-		tstr = strdup(q+1);
-		users = user_list(tstr);
-	}
-
-	while (1) {
-		if (lurk(users)) {
-			break;
-		}
-		sleep(3);
-	}
-	if (tstr) {
-		free(tstr);
-	}
-	if (users) {
-		free(users);
-	}
-}
-
-static int guess_user_and_switch(char *str, int fb_mode) {
-	char *dstr, *d;
-	char *p, *tstr = NULL, *allowed = NULL, *logins, **users = NULL;
-	int dpy1, ret = 0;
-	char **list;
-	int lind;
-
-	RAWFB_RET(0)
-
-	d = DisplayString(dpy);
-	/* pick out ":N" */
-	dstr = strchr(d, ':');
-	if (! dstr) {
-		return 0;
-	}
-	if (sscanf(dstr, ":%d", &dpy1) != 1) {
-		return 0;
-	}
-	if (dpy1 < 0) {
-		return 0;
-	}
-
-	if (strstr(str, "guess=") == str && strlen(str) > strlen("guess=")) {
-		allowed = strchr(str, '=');
-		allowed++;
-
-		tstr = strdup(allowed);
-		users = user_list(tstr);
-	}
-
-	/* loop over the utmpx entries looking for this display */
-	logins = get_login_list(1);
-
-	list = (char **) calloc((strlen(logins)+2)*sizeof(char *), 1);
-	lind = 0;
-	p = strtok(logins, ",");
-	while (p) {
-		list[lind++] = strdup(p);
-		p = strtok(NULL, ",");
-	}
-
-	lind = 0;
-	while (list[lind] != NULL) {
-		char *user, *q, *t;
-		int dpy2, ok = 1;
-
-		p = list[lind++];
-
-		t = strdup(p);
-		q = strchr(t, ':'); 
-		if (! q) {
-			free(t);
-			break;
-		}
-		*q = '\0';
-		user = t;
-		dpy2 = atoi(q+1);
-
-		if (users) {
-			char **u = users;
-			ok = 0;
-			while (*u != NULL) {
-				if (!strcmp(user, *u++)) {
-					ok = 1;
-					break;
-				}
-			}
-		}
-		if (dpy1 != dpy2) {
-			ok = 0;
-		}
-
-		if (! ok) {
-			free(t);
-			continue;
-		}
-
-		if (switch_user(user, fb_mode)) {
-			rfbLog("switched to guessed user: %s\n", user);
-			free(t);
-			ret = 1;
-			break;
-		}
-	}
-	if (tstr) {
-		free(tstr);
-	}
-	if (users) {
-		free(users);
-	}
-	if (logins) {
-		free(logins);
-	}
-	return ret;
-}
-
-static int try_user_and_display(uid_t uid, gid_t gid, char *dpystr) {
-	/* NO strtoks */
-#if LIBVNCSERVER_HAVE_FORK && LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_PWD_H
-	pid_t pid, pidw;
-	char *home, *name;
-	int st;
-	struct passwd *pw;
-	
-	pw = getpwuid(uid);
-	if (pw) {
-		name = pw->pw_name;
-		home = pw->pw_dir;
-	} else {
-		return 0;
-	}
-
-	/* 
-	 * We fork here and try to open the display again as the
-	 * new user.  Unreadable XAUTHORITY could be a problem...
-	 * This is not really needed since we have DISPLAY open but:
-	 * 1) is a good indicator this user owns the session and  2)
-	 * some activities do spawn new X apps, e.g.  xmessage(1), etc.
-	 */
-	if ((pid = fork()) > 0) {
-		;
-	} else if (pid == -1) {
-		fprintf(stderr, "could not fork\n");
-		rfbLogPerror("fork");
-		return 0;
-	} else {
-		/* child */
-		Display *dpy2 = NULL;
-		int rc;
-
-		signal(SIGHUP,  SIG_DFL);
-		signal(SIGINT,  SIG_DFL);
-		signal(SIGQUIT, SIG_DFL);
-		signal(SIGTERM, SIG_DFL);
-
-		rc = switch_user_env(uid, gid, name, home, 0); 
-		if (! rc) {
-			exit(1);
-		}
-
-		fclose(stderr);
-		dpy2 = XOpenDisplay_wr(dpystr);
-		if (dpy2) {
-			XCloseDisplay_wr(dpy2);
-			exit(0);	/* success */
-		} else {
-			exit(2);	/* fail */
-		}
-	}
-
-	/* see what the child says: */
-	pidw = waitpid(pid, &st, 0);
-	if (pidw == pid && WIFEXITED(st) && WEXITSTATUS(st) == 0) {
-		return 1;
-	}
-#endif	/* LIBVNCSERVER_HAVE_FORK ... */
-	return 0;
-}
-
-int switch_user(char *user, int fb_mode) {
-	/* NO strtoks */
-	int doit = 0;
-	uid_t uid = 0;
-	gid_t gid = 0;
-	char *name, *home;
-
-	if (*user == '+') {
-		doit = 1;
-		user++;
-	}
-
-	ssl_helper_pid(0, -2);	/* waitall */
-
-	if (strstr(user, "guess=") == user) {
-		return guess_user_and_switch(user, fb_mode);
-	}
-
-	user2uid(user, &uid, &gid, &name, &home);
-
-	if (uid == (uid_t) -1 || uid == 0) {
-		return 0;
-	}
-	if (gid == 0) {
-		return 0;
-	}
-
-	if (! doit && dpy) {
-		/* see if this display works: */
-		char *dstr = DisplayString(dpy);
-		doit = try_user_and_display(uid, gid, dstr);
-	}
-
-	if (doit) {
-		int rc = switch_user_env(uid, gid, name, home, fb_mode);
-		if (rc) {
-			started_as_root = 2;
-		}
-		return rc;
-	} else {
-		return 0;
-	}
-}
-
-static int switch_user_env(uid_t uid, gid_t gid, char *name, char *home, int fb_mode) {
-	/* NO strtoks */
-	char *xauth;
-	int reset_fb = 0;
-	int grp_ok = 0;
-
-#if !LIBVNCSERVER_HAVE_SETUID
-	return 0;
-#else
-	/*
-	 * OK, tricky here, we need to free the shm... otherwise
-	 * we won't be able to delete it as the other user...
-	 */
-	if (fb_mode == 1 && (using_shm && ! xform24to32)) {
-		reset_fb = 1;
-		clean_shm(0);
-		free_tiles();
-	}
-#if LIBVNCSERVER_HAVE_INITGROUPS
-#if LIBVNCSERVER_HAVE_PWD_H
-	if (getpwuid(uid) != NULL && getenv("X11VNC_SINGLE_GROUP") == NULL) {
-		struct passwd *p = getpwuid(uid);
-		/* another possibility is p->pw_gid instead of gid */
-		if (setgid(gid) == 0 && initgroups(p->pw_name, gid) == 0)  {
-			grp_ok = 1;
-		} else {
-			rfbLogPerror("initgroups");
-		}
-		endgrent();
-	}
-#endif
-#endif
-	if (! grp_ok) {
-		if (setgid(gid) == 0) {
-			grp_ok = 1;
-		}
-	}
-	if (! grp_ok) {
-		if (reset_fb) {
-			/* 2 means we did clean_shm and free_tiles */
-			do_new_fb(2);
-		}
-		return 0;
-	}
-
-	if (setuid(uid) != 0) {
-		if (reset_fb) {
-			/* 2 means we did clean_shm and free_tiles */
-			do_new_fb(2);
-		}
-		return 0;
-	}
-#endif
-	if (reset_fb) {
-		do_new_fb(2);
-	}
-
-	xauth = getenv("XAUTHORITY");
-	if (xauth && access(xauth, R_OK) != 0) {
-		*(xauth-2) = '_';	/* yow */
-	}
-	
-	set_env("USER", name);
-	set_env("LOGNAME", name);
-	set_env("HOME", home);
-	return 1;
-}
-
-static void try_to_switch_users(void) {
-	static time_t last_try = 0;
-	time_t now = time(NULL);
-	char *users, *p;
-
-	if (getuid() && geteuid()) {
-		rfbLog("try_to_switch_users: not root\n");
-		started_as_root = 2;
-		return;
-	}
-	if (!last_try) {
-		last_try = now;
-	} else if (now <= last_try + 2) {
-		/* try every 3 secs or so */
-		return;
-	}
-	last_try = now;
-
-	users = strdup(users_list);
-
-	if (strstr(users, "guess=") == users) {
-		if (switch_user(users, 1)) {
-			started_as_root = 2;
-		}
-		free(users);
-		return;
-	}
-
-	p = strtok(users, ",");
-	while (p) {
-		if (switch_user(p, 1)) {
-			started_as_root = 2;
-			rfbLog("try_to_switch_users: now %s\n", p);
-			break;
-		}
-		p = strtok(NULL, ",");
-	}
-	free(users);
-}
-
-int read_passwds(char *passfile) {
-	char line[1024];
-	char *filename;
-	char **old_passwd_list = passwd_list;
-	int linecount = 0, i, remove = 0, read_mode = 0, begin_vo = -1;
-	struct stat sbuf;
-	static int max = -1;
-	FILE *in = NULL;
-	static time_t last_read = 0;
-	static int read_cnt = 0;
-	int db_passwd = 0;
-
-	if (max < 0) {
-		max = 1000;
-		if (getenv("X11VNC_MAX_PASSWDS")) {
-			max = atoi(getenv("X11VNC_MAX_PASSWDS"));
-		}
-	}
-
-	filename = passfile;
-	if (strstr(filename, "rm:") == filename) {
-		filename += strlen("rm:");
-		remove = 1;
-	} else if (strstr(filename, "read:") == filename) {
-		filename += strlen("read:");
-		read_mode = 1;
-		if (stat(filename, &sbuf) == 0) {
-			if (sbuf.st_mtime <= last_read) {
-				return 1;
-			}
-			last_read = sbuf.st_mtime;
-		}
-	} else if (strstr(filename, "cmd:") == filename) {
-		int rc;
-
-		filename += strlen("cmd:");
-		read_mode = 1;
-		in = tmpfile();
-		if (in == NULL) {
-			rfbLog("run_user_command tmpfile() failed: %s\n",
-			    filename);
-			clean_up_exit(1);
-		}
-		rc = run_user_command(filename, latest_client, "read_passwds",
-		    NULL, 0, in);
-		if (rc != 0) {
-			rfbLog("run_user_command command failed: %s\n",
-			    filename);
-			clean_up_exit(1);
-		}
-		rewind(in);
-	} else if (strstr(filename, "custom:") == filename) {
-		return 1;
-	}
-
-	if (in == NULL && stat(filename, &sbuf) == 0) {
-		/* (poor...) upper bound to number of lines */
-		max = (int) sbuf.st_size;
-		last_read = sbuf.st_mtime;
-	}
-
-	/* create 1 more than max to have it be the ending NULL */
-	passwd_list = (char **) malloc( (max+1) * (sizeof(char *)) );
-	for (i=0; i<max+1; i++) {
-		passwd_list[i] = NULL;
-	}
-	
-	if (in == NULL) {
-		in = fopen(filename, "r");
-	}
-	if (in == NULL) {
-		rfbLog("cannot open passwdfile: %s\n", passfile);
-		rfbLogPerror("fopen");
-		if (remove) {
-			unlink(filename);
-		}
-		clean_up_exit(1);
-	}
-
-	if (getenv("DEBUG_PASSWDFILE") != NULL) {
-		db_passwd = 1;
-	}
-
-	while (fgets(line, 1024, in) != NULL) {
-		char *p;
-		int blank = 1;
-		int len = strlen(line); 
-
-		if (db_passwd) {
-			fprintf(stderr, "read_passwds: raw line: %s\n", line);
-		}
-
-		if (len == 0) {
-			continue;
-		} else if (line[len-1] == '\n') {
-			line[len-1] = '\0';
-		}
-		if (line[0] == '\0') {
-			continue;
-		}
-		if (strstr(line, "__SKIP__") != NULL) {
-			continue;
-		}
-		if (strstr(line, "__COMM__") == line) {
-			continue;
-		}
-		if (!strcmp(line, "__BEGIN_VIEWONLY__")) {
-			if (begin_vo < 0) {
-				begin_vo = linecount;
-			}
-			continue;
-		}
-		if (line[0] == '#') {
-			/* commented out, cannot have password beginning with # */
-			continue;
-		}
-		p = line;
-		while (*p != '\0') {
-			if (! isspace((unsigned char) (*p))) {
-				blank = 0;
-				break;
-			}
-			p++;
-		}
-		if (blank) {
-			continue;
-		}
-
-		passwd_list[linecount++] = strdup(line);
-		if (db_passwd) {
-			fprintf(stderr, "read_passwds: keepline: %s\n", line);
-			fprintf(stderr, "read_passwds: begin_vo: %d\n", begin_vo);
-		}
-
-		if (linecount >= max) {
-			rfbLog("read_passwds: hit max passwd: %d\n", max);
-			break;
-		}
-	}
-	fclose(in);
-
-	for (i=0; i<1024; i++) {
-		line[i] = '\0';
-	}
-
-	if (remove) {
-		unlink(filename);
-	}
-
-	if (! linecount) {
-		rfbLog("cannot read a valid line from passwdfile: %s\n",
-		    passfile);
-		if (read_cnt == 0) {
-			clean_up_exit(1);
-		} else {
-			return 0;
-		}
-	}
-	read_cnt++;
-
-	for (i=0; i<linecount; i++) {
-		char *q, *p = passwd_list[i];
-		if (!strcmp(p, "__EMPTY__")) {
-			*p = '\0';
-		} else if ((q = strstr(p, "__COMM__")) != NULL) {
-			*q = '\0';
-		}
-		passwd_list[i] = strdup(p);
-		if (db_passwd) {
-			fprintf(stderr, "read_passwds: trimline: %s\n", p);
-		}
-		strzero(p);
-	}
-
-	begin_viewonly = begin_vo;
-	if (read_mode && read_cnt > 1) {
-		if (viewonly_passwd) {
-			free(viewonly_passwd);
-			viewonly_passwd = NULL;
-		}
-	}
-
-	if (begin_viewonly < 0 && linecount == 2) {
-		/* for compatibility with previous 2-line usage: */
-		viewonly_passwd = strdup(passwd_list[1]);
-		if (db_passwd) {
-			fprintf(stderr, "read_passwds: linecount is 2.\n");
-		}
-		if (screen) {
-			char **apd = (char **) screen->authPasswdData;
-			if (apd) {
-				if (apd[0] != NULL) {
-					strzero(apd[0]);
-				}
-				apd[0] = strdup(passwd_list[0]);
-			}
-		}
-		begin_viewonly = 1;
-	}
-
-	if (old_passwd_list != NULL) {
-		char *p;
-		i = 0;
-		while (old_passwd_list[i] != NULL) {
-			p = old_passwd_list[i];
-			strzero(p);
-			free(old_passwd_list[i]);
-			i++;
-		}
-		free(old_passwd_list);
-	}
-	return 1;
-}
-
-void install_passwds(void) {
-	if (viewonly_passwd) {
-		/* append the view only passwd after the normal passwd */
-		char **passwds_new = (char **) malloc(3*sizeof(char *));
-		char **passwds_old = (char **) screen->authPasswdData;
-		passwds_new[0] = passwds_old[0];
-		passwds_new[1] = viewonly_passwd;
-		passwds_new[2] = NULL;
-		/* mutex */
-		screen->authPasswdData = (void*) passwds_new;
-	} else if (passwd_list) {
-		int i = 0;
-		while(passwd_list[i] != NULL) {
-			i++;
-		}
-		if (begin_viewonly < 0) {
-			begin_viewonly = i+1;
-		}
-		/* mutex */
-		screen->authPasswdData = (void*) passwd_list;
-		screen->authPasswdFirstViewOnly = begin_viewonly;
-	}
-}
-
-void check_new_passwds(int force) {
-	static time_t last_check = 0;
-	time_t now;
-
-	if (! passwdfile) {
-		return;
-	}
-	if (strstr(passwdfile, "read:") != passwdfile) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	if (force) {
-		last_check = 0;
-	}
-
-	now = time(NULL);
-	if (now > last_check + 1) {
-		if (read_passwds(passwdfile)) {
-			install_passwds();
-		}
-		last_check = now;
-	}
-}
-
-rfbBool custom_passwd_check(rfbClientPtr cl, const char *response, int len) {
-	char *input, *cmd;
-	char num[16];
-	int j, i, n, rc;
-
-	rfbLog("custom_passwd_check: len=%d\n", len);
-
-	if (!passwdfile || strstr(passwdfile, "custom:") != passwdfile) {
-		return FALSE;
-	}
-	cmd = passwdfile + strlen("custom:");
-
-	sprintf(num, "%d\n", len);
-
-	input = (char *) malloc(2 * len + 16 + 1);
-	
-	input[0] = '\0';
-	strcat(input, num);
-	n = strlen(num);
-
-	j = n;
-	for (i=0; i < len; i++) {
-		input[j] = cl->authChallenge[i];
-		j++;
-	}
-	for (i=0; i < len; i++) {
-		input[j] = response[i];
-		j++;
-	}
-	rc = run_user_command(cmd, cl, "custom_passwd", input, n+2*len, NULL);
-	free(input);
-	if (rc == 0) {
-		return TRUE;
-	} else {
-		return FALSE;
-	}
-}
-
-static void handle_one_http_request(void) {
-	rfbLog("handle_one_http_request: begin.\n");
-	if (inetd || screen->httpPort == 0) {
-		int port = find_free_port(5800, 5860);
-		if (port) {
-			/* mutex */
-			screen->httpPort = port;
-		} else {
-			rfbLog("handle_one_http_request: no http port.\n");
-			clean_up_exit(1);
-		}
-	}
-	screen->autoPort = FALSE;
-	screen->port = 0;
-
-	http_connections(1);
-
-	rfbInitServer(screen);
-
-	if (!inetd) {
-		/* XXX ipv6 */
-		int conn = 0;
-		while (1) {
-			if (0) fprintf(stderr, "%d %d %d  %d\n", conn, screen->listenSock, screen->httpSock, screen->httpListenSock);
-			usleep(10 * 1000);
-			rfbHttpCheckFds(screen);
-			if (conn) {
-				if (screen->httpSock < 0) {
-					break;
-				}
-			} else {
-				if (screen->httpSock >= 0) {
-					conn = 1;
-				}
-			}
-			if (!screen->httpDir) {
-				break;
-			}
-			if (screen->httpListenSock < 0) {
-				break;
-			}
-		}
-		rfbLog("handle_one_http_request: finished.\n");
-		return;
-	} else {
-		/* inetd case: */
-#if LIBVNCSERVER_HAVE_FORK
-		pid_t pid;
-		int s_in = screen->inetdSock;
-		if (s_in < 0) {
-			rfbLog("handle_one_http_request: inetdSock not set up.\n");
-			clean_up_exit(1);
-		}
-		pid = fork();
-		if (pid < 0) {
-			rfbLog("handle_one_http_request: could not fork.\n");
-			clean_up_exit(1);
-		} else if (pid > 0) {
-			int status;
-			pid_t pidw;
-			while (1) {
-				rfbHttpCheckFds(screen);
-				pidw = waitpid(pid, &status, WNOHANG); 
-				if (pidw == pid && WIFEXITED(status)) {
-					break;
-				} else if (pidw < 0) {
-					break;
-				}
-			}
-			rfbLog("handle_one_http_request: finished.\n");
-			return;
-		} else {
-			int sock = connect_tcp("127.0.0.1", screen->httpPort);
-			if (sock < 0) {
-				exit(1);
-			}
-			raw_xfer(sock, s_in, s_in);
-			exit(0);
-		}
-#else
-		rfbLog("handle_one_http_request: fork not supported.\n");
-		clean_up_exit(1);
-#endif
-	}
-}
-
-void user_supplied_opts(char *opts) {
-	char *p, *str;
-	char *allow[] = {
-		"skip-display", "skip-auth", "skip-shared",
-		"scale", "scale_cursor", "sc", "solid", "so", "id",
-		"clear_mods", "cm", "clear_keys", "ck", "repeat",
-		"clear_all", "ca",
-		"speeds", "sp", "readtimeout", "rd",
-		"rotate", "ro",
-		"geometry", "geom", "ge",
-		"noncache", "nc",
-		"nodisplay", "nd",
-		"viewonly", "vo",
-		"tag",
-		NULL
-	};
-
-	if (getenv("X11VNC_NO_UNIXPW_OPTS")) {
-		return;
-	}
-
-	str = strdup(opts);
-
-	p = strtok(str, ",");
-	while (p) {
-		char *q;
-		int i, n, m, ok = 0;
-
-		i = 0;
-		while (allow[i] != NULL) {
-			if (strstr(allow[i], "skip-")) {
-				i++;
-				continue;
-			}
-			if (strstr(p, allow[i]) == p) 	{
-				ok = 1;
-				break;
-			}
-			i++;
-		}
-
-		if (! ok && strpbrk(p, "0123456789") == p &&
-		    sscanf(p, "%d/%d", &n, &m) == 2) {
-			if (scale_str) free(scale_str);
-			scale_str = strdup(p);
-		} else if (ok) {
-			if (0 && strstr(p, "display=") == p) {
-				if (use_dpy) free(use_dpy);
-				use_dpy = strdup(p + strlen("display="));
-			} else if (0 && strstr(p, "auth=") == p) {
-				if (auth_file) free(auth_file);
-				auth_file = strdup(p + strlen("auth="));
-			} else if (0 && !strcmp(p, "shared")) {
-				shared = 1;
-			} else if (strstr(p, "scale=") == p) {
-				if (scale_str) free(scale_str);
-				scale_str = strdup(p + strlen("scale="));
-			} else if (strstr(p, "scale_cursor=") == p ||
-			    strstr(p, "sc=") == p) {
-				if (scale_cursor_str) free(scale_cursor_str);
-				q = strchr(p, '=') + 1;
-				scale_cursor_str = strdup(q);
-			} else if (strstr(p, "rotate=") == p ||
-			    strstr(p, "ro=") == p) {
-				if (rotating_str) free(rotating_str);
-				q = strchr(p, '=') + 1;
-				rotating_str = strdup(q);
-			} else if (!strcmp(p, "solid") || !strcmp(p, "so")) {
-				use_solid_bg = 1;
-				if (!solid_str) {
-					solid_str = strdup(solid_default);
-				}
-			} else if (!strcmp(p, "viewonly") || !strcmp(p, "vo")) {
-				view_only = 1;
-			} else if (strstr(p, "solid=") == p ||
-			    strstr(p, "so=") == p) {
-				use_solid_bg = 1;
-				if (solid_str) free(solid_str);
-				q = strchr(p, '=') + 1;
-				if (!strcmp(q, "R")) {
-					solid_str = strdup("root:");
-				} else {
-					solid_str = strdup(q);
-				}
-			} else if (strstr(p, "id=") == p) {
-				unsigned long win;
-				q = p + strlen("id=");
-				if (strcmp(q, "pick")) {
-					if (scan_hexdec(q, &win)) {
-						subwin = win;
-					}
-				}
-			} else if (!strcmp(p, "clear_mods") ||
-			    !strcmp(p, "cm")) {
-				clear_mods = 1;
-			} else if (!strcmp(p, "clear_keys") ||
-			    !strcmp(p, "ck")) {
-				clear_mods = 2;
-			} else if (!strcmp(p, "clear_all") ||
-			    !strcmp(p, "ca")) {
-				clear_mods = 3;
-			} else if (!strcmp(p, "noncache") ||
-			    !strcmp(p, "nc")) {
-				ncache  = 0;
-				ncache0 = 0;
-			} else if (strstr(p, "nc=") == p) {
-				int n2 = atoi(p + strlen("nc="));
-				if (nabs(n2) < nabs(ncache)) {
-					if (ncache < 0) {
-						ncache = -nabs(n2);
-					} else {
-						ncache = nabs(n2);
-					}
-				}
-			} else if (!strcmp(p, "repeat")) {
-				no_autorepeat = 0;
-			} else if (strstr(p, "speeds=") == p ||
-			    strstr(p, "sp=") == p) {
-				if (speeds_str) free(speeds_str);
-				q = strchr(p, '=') + 1;
-				speeds_str = strdup(q);
-				q = speeds_str;
-				while (*q != '\0') {
-					if (*q == '-') {
-						*q = ',';
-					}
-					q++;
-				}
-			} else if (strstr(p, "readtimeout=") == p ||
-			    strstr(p, "rd=") == p) {
-				q = strchr(p, '=') + 1;
-				rfbMaxClientWait = atoi(q) * 1000;
-			}
-		} else {
-			rfbLog("skipping option: %s\n", p);
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-}
-
-static void vnc_redirect_timeout (int sig) {
-	write(2, "timeout: no clients connected.\n", 31);
-	if (sig) {};
-	exit(0);
-}
-
-static void do_chvt(int vt) {
-	char chvt[100];
-	sprintf(chvt, "chvt %d >/dev/null 2>/dev/null &", vt);
-	rfbLog("running: %s\n", chvt);
-	system(chvt);
-	sleep(2);
-}
-
-static void setup_fake_fb(XImage* fb_image, int w, int h, int b) {
-	if (fake_fb) {
-		free(fake_fb);
-	}
-	fake_fb = (char *) calloc(w*h*b/8, 1);
-
-	fb_image->data = fake_fb;
-	fb_image->format = ZPixmap;
-	fb_image->width  = w;
-	fb_image->height = h;
-	fb_image->bits_per_pixel = b;
-	fb_image->bytes_per_line = w*b/8;
-	fb_image->bitmap_unit = -1;
-	if (b >= 24) {
-		fb_image->depth = 24;
-		fb_image->red_mask   = 0xff0000;
-		fb_image->green_mask = 0x00ff00;
-		fb_image->blue_mask  = 0x0000ff;
-	} else if (b >= 16) {
-		fb_image->depth = 16;
-		fb_image->red_mask   = 0x003f;
-		fb_image->green_mask = 0x07c0;
-		fb_image->blue_mask  = 0xf800;
-	} else if (b >= 2) {
-		fb_image->depth = 8;
-		fb_image->red_mask   = 0x07;
-		fb_image->green_mask = 0x38;
-		fb_image->blue_mask  = 0xc0;
-	} else {
-		fb_image->depth = 1;
-		fb_image->red_mask   = 0x1;
-		fb_image->green_mask = 0x1;
-		fb_image->blue_mask  = 0x1;
-	}
-
-	depth = fb_image->depth;
-
-	dpy_x = wdpy_x = w;
-	dpy_y = wdpy_y = h;
-	off_x = 0;
-	off_y = 0;
-}
-
-void do_announce_http(void);
-void do_mention_java_urls(void);
-
-static void setup_service(void) {
-	if (remote_direct) {
-		return;
-	}
-	if (!inetd) {
-		do_mention_java_urls();
-		do_announce_http();
-		if (!use_openssl) {
-			announce(screen->port, use_openssl, NULL);
-			fprintf(stdout, "PORT=%d\n", screen->port);
-		} else {
-			fprintf(stdout, "PORT=%d\n", screen->port);
-			if (stunnel_port) {
-				fprintf(stdout, "SSLPORT=%d\n", stunnel_port);
-			} else if (use_openssl) {
-				fprintf(stdout, "SSLPORT=%d\n", screen->port);
-			}
-		}
-		fflush(stdout);
-	} else if (!use_openssl && avahi) {
-		char *name = rfb_desktop_name;
-		if (!name) {
-			name = use_dpy;
-		}
-		avahi_initialise();
-		avahi_advertise(name, this_host(), screen->port);
-	}
-}
-
-static void check_waitbg(void) {
-	if (getenv("WAITBG")) {
-#if LIBVNCSERVER_HAVE_FORK && LIBVNCSERVER_HAVE_SETSID
-		int p, n;
-		if ((p = fork()) > 0)  {
-			exit(0);
-		} else if (p == -1) {
-			rfbLogEnable(1);
-			fprintf(stderr, "could not fork\n");
-			perror("fork");
-			clean_up_exit(1);
-		}
-		if (setsid() == -1) {
-			rfbLogEnable(1);
-			fprintf(stderr, "setsid failed\n");
-			perror("setsid");
-			clean_up_exit(1);
-		}
-		/* adjust our stdio */
-		n = open("/dev/null", O_RDONLY);
-		dup2(n, 0);
-		dup2(n, 1);
-		if (! logfile) {
-			dup2(n, 2);
-		}
-		if (n > 2) {
-			close(n);
-		}
-#else
-		clean_up_exit(1);
-#endif
-	}
-}
-
-static void setup_client_connect(int *did_client_connect) {
-	if (client_connect != NULL) {
-		char *remainder = NULL;
-		if (inetd) {
-			rfbLog("wait_for_client: -connect disallowed in inetd mode: %s\n",
-			    client_connect);
-		} else if (screen && screen->clientHead) {
-			rfbLog("wait_for_client: -connect disallowed: client exists: %s\n",
-			    client_connect);
-		} else if (strchr(client_connect, '=')) {
-			rfbLog("wait_for_client: invalid -connect string: %s\n",
-			    client_connect);
-		} else {
-			char *q = strchr(client_connect, ',');
-			if (q) {
-				rfbLog("wait_for_client: only using first"
-				    " connect host in: %s\n", client_connect);
-				remainder = strdup(q+1);
-				*q = '\0';
-			}
-			rfbLog("wait_for_client: reverse_connect(%s)\n",
-			    client_connect);
-			reverse_connect(client_connect);
-			*did_client_connect = 1;
-		}
-		free(client_connect);
-		if (remainder != NULL) {
-			/* reset to host2,host3,... */
-			client_connect = remainder;
-		} else {
-			client_connect = NULL;
-		}
-	}
-}
-
-static void loop_for_connect(int did_client_connect) {
-	int loop = 0;
-	time_t start = time(NULL);
-
-	if (first_conn_timeout < 0) {
-		first_conn_timeout = -first_conn_timeout;
-	}
-
-	while (1) {
-		loop++;
-		if (first_conn_timeout && time(NULL) > start + first_conn_timeout) {
-			rfbLog("no client connect after %d seconds.\n", first_conn_timeout);
-			shut_down = 1;
-		}
-		if (shut_down) {
-			clean_up_exit(0);
-		}
-		if (loop < 2) {
-			if (did_client_connect) {
-				goto screen_check;
-			}
-			if (inetd) {
-				goto screen_check;
-			}
-			if (screen && screen->clientHead) {
-				goto screen_check;
-			}
-		}
-		if ((use_openssl || use_stunnel) && !inetd) {
-			int enc_none = (enc_str && !strcmp(enc_str, "none"));
-			if (!use_stunnel || enc_none) {
-				check_openssl();
-				check_https();
-			}
-			/*
-			 * This is to handle an initial verify cert from viewer,
-			 * they disconnect right after fetching the cert.
-			 */
-			if (use_threads) {
-				usleep(10 * 1000);
-			} else {
-				rfbPE(-1);
-			}
-			if (screen && screen->clientHead) {
-				int i;
-				if (unixpw) {
-					if (! unixpw_in_progress && !vencrypt_enable_plain_login) {
-						rfbLog("unixpw but no unixpw_in_progress\n");
-						clean_up_exit(1);
-					}
-					if (unixpw_client && unixpw_client->onHold) {
-						rfbLog("taking unixpw_client off hold\n");
-						unixpw_client->onHold = FALSE;
-					}
-				}
-				for (i=0; i<10; i++) {
-					if (shut_down) {
-						clean_up_exit(0);
-					}
-					usleep(20 * 1000);
-					if (0) rfbLog("wait_for_client: %d\n", i);
-
-					if (! use_threads) {
-						if (unixpw) {
-							unixpw_in_rfbPE = 1;
-						}
-						rfbPE(-1);
-						if (unixpw) {
-							unixpw_in_rfbPE = 0;
-						}
-					}
-
-					if (unixpw && !unixpw_in_progress) {
-						/* XXX too soon. */
-						goto screen_check;
-					}
-					if (!screen->clientHead) {
-						break;
-					}
-				}
-			}
-		} else if (use_openssl) {
-			check_openssl();
-		}
-
-		if (use_threads) {
-			usleep(10 * 1000);
-		} else {
-			rfbPE(-1);
-		}
-
-		screen_check:
-		if (! screen || ! screen->clientHead) {
-			usleep(100 * 1000);
-			continue;
-		}
-
-		rfbLog("wait_for_client: got client\n");
-		break;
-	}
-}
-
-static void do_unixpw_loop(void) {
-	if (unixpw) {
-		if (! unixpw_in_progress && !vencrypt_enable_plain_login) {
-			rfbLog("unixpw but no unixpw_in_progress\n");
-			clean_up_exit(1);
-		}
-		if (unixpw_client && unixpw_client->onHold) {
-			rfbLog("taking unixpw_client off hold.\n");
-			unixpw_client->onHold = FALSE;
-		}
-		while (1) {
-			if (shut_down) {
-				clean_up_exit(0);
-			}
-			if (! use_threads) {
-				unixpw_in_rfbPE = 1;
-				rfbPE(-1);
-				unixpw_in_rfbPE = 0;
-			}
-			if (unixpw_in_progress) {
-				static double lping = 0.0;
-				if (lping < dnow() + 5) {
-					mark_rect_as_modified(0, 0, 1, 1, 1);
-					lping = dnow();
-				}
-				if (time(NULL) > unixpw_last_try_time + 45) {
-					rfbLog("unixpw_deny: timed out waiting for reply.\n");
-					unixpw_deny();
-				}
-				usleep(20 * 1000);
-				continue;
-			}
-			rfbLog("wait_for_client: unixpw finished.\n");
-			break;
-		}
-	}
-}
-
-static void vnc_redirect_loop(char *vnc_redirect_test, int *vnc_redirect_cnt) {
-	if (unixpw) {
-		rfbLog("wait_for_client: -unixpw and Xvnc.redirect not allowed\n");
-		clean_up_exit(1);
-	}
-	if (client_connect) {
-		rfbLog("wait_for_client: -connect and Xvnc.redirect not allowed\n");
-		clean_up_exit(1);
-	}
-	if (inetd) {
-		if (use_openssl) {
-			accept_openssl(OPENSSL_INETD, -1);
-		}
-	} else {
-		pid_t pid = 0;
-		/* XXX ipv6 */
-		if (screen->httpListenSock >= 0) {
-#if LIBVNCSERVER_HAVE_FORK
-			if ((pid = fork()) > 0) {
-				close(screen->httpListenSock);
-				/* mutex */
-				screen->httpListenSock = -2;
-				usleep(500 * 1000);
-			} else {
-				close(screen->listenSock);
-				screen->listenSock = -1;
-				while (1) {
-					usleep(10 * 1000);
-					rfbHttpCheckFds(screen);
-				}
-				exit(1);
-			}
-#else
-			clean_up_exit(1);
-#endif
-		}
-		if (first_conn_timeout) {
-			if (first_conn_timeout < 0) {
-				first_conn_timeout = -first_conn_timeout;
-			}
-			signal(SIGALRM, vnc_redirect_timeout);
-			alarm(first_conn_timeout);
-		}
-		if (use_openssl) {
-			int i;
-			if (pid == 0) {
-				accept_openssl(OPENSSL_VNC, -1);
-			} else {
-				for (i=0; i < 16; i++) {
-					accept_openssl(OPENSSL_VNC, -1);
-					rfbLog("iter %d: vnc_redirect_sock: %d\n", i, vnc_redirect_sock);
-					if (vnc_redirect_sock >= 0) {
-						break;
-					}
-				}
-			}
-		} else {
-			struct sockaddr_in addr;
-#ifdef __hpux
-			int addrlen = sizeof(addr);
-#else
-			socklen_t addrlen = sizeof(addr);
-#endif
-			if (screen->listenSock < 0) {
-				rfbLog("wait_for_client: Xvnc.redirect not listening... sock=%d port=%d\n", screen->listenSock, screen->port);
-				clean_up_exit(1);
-			}
-			vnc_redirect_sock = accept(screen->listenSock, (struct sockaddr *)&addr, &addrlen);
-		}
-		if (first_conn_timeout) {
-			alarm(0);
-		}
-		if (pid > 0) {
-#if LIBVNCSERVER_HAVE_FORK
-			int rc;
-			pid_t pidw;
-			rfbLog("wait_for_client: kill TERM: %d\n", (int) pid);
-			kill(pid, SIGTERM);
-			usleep(1000 * 1000);	/* 1.0 sec */
-			pidw = waitpid(pid, &rc, WNOHANG);
-			if (pidw <= 0) {
-				usleep(1000 * 1000);	/* 1.0 sec */
-				pidw = waitpid(pid, &rc, WNOHANG);
-			}
-#else
-			clean_up_exit(1);
-#endif
-		}
-	}
-	if (vnc_redirect_sock < 0) {
-		rfbLog("wait_for_client: vnc_redirect failed.\n");
-		clean_up_exit(1);
-	}
-	if (!inetd && use_openssl) {
-		/* check for Fetch Cert closing */
-		fd_set rfds;
-		struct timeval tv;
-		int nfds;
-
-		usleep(300*1000);
-
-		FD_ZERO(&rfds);
-		FD_SET(vnc_redirect_sock, &rfds);
-
-		tv.tv_sec = 0;
-		tv.tv_usec = 200000;
-		nfds = select(vnc_redirect_sock+1, &rfds, NULL, NULL, &tv);
-
-		rfbLog("wait_for_client: vnc_redirect nfds: %d\n", nfds);
-		if (nfds > 0) {
-			int n;
-			n = read(vnc_redirect_sock, vnc_redirect_test, 1);
-			if (n <= 0) {
-				close(vnc_redirect_sock);
-				vnc_redirect_sock = -1;
-				rfbLog("wait_for_client: waiting for 2nd connection (Fetch Cert?)\n");
-				accept_openssl(OPENSSL_VNC, -1);
-				if (vnc_redirect_sock < 0) {
-					rfbLog("wait_for_client: vnc_redirect failed.\n");
-					clean_up_exit(1);
-				}
-			} else {
-				*vnc_redirect_cnt = n;
-			}
-		}
-	}
-}
-
-static void do_vnc_redirect(int created_disp, char *vnc_redirect_host, int vnc_redirect_port,
-    int vnc_redirect_cnt, char *vnc_redirect_test) {
-	char *q = strrchr(use_dpy, ':');
-	int vdpy = -1, sock = -1;
-	int s_in, s_out, i;
-	if (vnc_redirect == 2) {
-		char num[32];	
-		sprintf(num, ":%d", vnc_redirect_port);
-		q = num;
-	}
-	if (!q) {
-		rfbLog("wait_for_client: can't find number in X display: %s\n", use_dpy);
-		clean_up_exit(1);
-	}
-	if (sscanf(q+1, "%d", &vdpy) != 1) {
-		rfbLog("wait_for_client: can't find number in X display: %s\n", q);
-		clean_up_exit(1);
-	}
-	if (vdpy == -1 && vnc_redirect != 2) {
-		rfbLog("wait_for_client: can't find number in X display: %s\n", q);
-		clean_up_exit(1);
-	}
-	if (vnc_redirect == 2) {
-		if (vdpy < 0) {
-			vdpy = -vdpy;
-		} else if (vdpy < 200) {
-			vdpy += 5900;
-		}
-	} else {
-		vdpy += 5900;
-	}
-	if (created_disp) {
-		usleep(1000*1000);
-	}
-	for (i=0; i < 20; i++) {
-		sock = connect_tcp(vnc_redirect_host, vdpy);
-		if (sock >= 0) {
-			break;
-		}
-		rfbLog("wait_for_client: ...\n");
-		usleep(500*1000);
-	}
-	if (sock < 0) {
-		rfbLog("wait_for_client: could not connect to a VNC Server at %s:%d\n", vnc_redirect_host, vdpy);
-		clean_up_exit(1);
-	}
-	if (inetd) {
-		s_in  = fileno(stdin);
-		s_out = fileno(stdout);
-	} else {
-		s_in = s_out = vnc_redirect_sock;
-	}
-	if (vnc_redirect_cnt > 0) {
-		write(vnc_redirect_sock, vnc_redirect_test, vnc_redirect_cnt);
-	}
-	rfbLog("wait_for_client: switching control to VNC Server at %s:%d\n", vnc_redirect_host, vdpy);
-	raw_xfer(sock, s_in, s_out);
-}
-
-extern char find_display[];
-extern char create_display[];
-
-char *setup_cmd(char *str, int *vnc_redirect, char **vnc_redirect_host, int *vnc_redirect_port, int db) {
-	char *cmd = NULL;
-	
-#ifndef WIN32
-	if (no_external_cmds || !cmd_ok("WAIT")) {
-		rfbLog("wait_for_client external cmds not allowed:"
-		    " %s\n", use_dpy);
-		clean_up_exit(1);
-	}
-
-	cmd = str + strlen("cmd=");
-	if (!strcmp(cmd, "FINDDISPLAY-print")) {
-		fprintf(stdout, "%s", find_display);
-		clean_up_exit(0);
-	}
-	if (!strcmp(cmd, "FINDDISPLAY-run")) {
-		char tmp[] = "/tmp/fd.XXXXXX";
-		char com[100];
-		int fd = mkstemp(tmp);
-		if (fd >= 0) {
-			int ret;
-			write(fd, find_display, strlen(find_display));
-			close(fd);
-			set_env("FINDDISPLAY_run", "1");
-			sprintf(com, "/bin/sh %s -n", tmp);
-			ret = system(com);
-			if (WIFEXITED(ret) && WEXITSTATUS(ret) != 0) {
-				if (got_findauth && !getenv("FD_XDM")) {
-					if (getuid() == 0 || geteuid() == 0) {
-						set_env("FD_XDM", "1");
-						system(com);
-					}
-				}
-			}
-		}
-		unlink(tmp);
-		exit(0);
-	}
-	if (!strcmp(str, "FINDCREATEDISPLAY-print")) {
-		fprintf(stdout, "%s", create_display);
-		clean_up_exit(0);
-	}
-	if (db) fprintf(stderr, "cmd: %s\n", cmd);
-	if (strstr(str, "FINDCREATEDISPLAY") || strstr(str, "FINDDISPLAY")) {
-		if (strstr(str, "Xvnc.redirect") || strstr(str, "X.redirect")) {
-			*vnc_redirect = 1;
-		}
-	}
-	if (strstr(cmd, "FINDDISPLAY-vnc_redirect") == cmd) {
-		int p;
-		char h[256];
-		if (strlen(cmd) >= 256) {
-			rfbLog("wait_for_client string too long: %s\n", str);
-			clean_up_exit(1);
-		}
-		h[0] = '\0';
-		if (sscanf(cmd, "FINDDISPLAY-vnc_redirect=%d", &p) == 1) {
-			;
-		} else if (sscanf(cmd, "FINDDISPLAY-vnc_redirect=%s %d", h, &p) == 2) {
-			;
-		} else {
-			rfbLog("wait_for_client bad string: %s\n", cmd);
-			clean_up_exit(1);
-		}
-		*vnc_redirect_port = p;
-		if (strcmp(h, "")) {
-			*vnc_redirect_host = strdup(h);
-		}
-		*vnc_redirect = 2;
-		rfbLog("wait_for_client: vnc_redirect: %s:%d\n", *vnc_redirect_host, *vnc_redirect_port);
-	}
-#endif
-	return cmd;
-}
-
-static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *tmp) {
-	char *create_cmd = NULL;
-	char *opts = strchr(cmd, '-');
-	char st[] = "";
-	char fdgeom[128], fdsess[128], fdopts[128], fdextra[256], fdprog[128];
-	char fdxsrv[128], fdxdum[128], fdcups[128], fdesd[128];
-	char fdnas[128], fdsmb[128], fdtag[128], fdxdmcpif[128];
-	char cdout[128];
-
-	if (opts) {
-		opts++;
-		if (strstr(opts, "xdmcp")) {
-			*saw_xdmcp = 1;
-		}
-	} else {
-		opts = st;
-	}
-	sprintf(fdgeom, "NONE");
-	fdsess[0] = '\0';
-	fdgeom[0] = '\0';
-	fdopts[0] = '\0';
-	fdextra[0] = '\0';
-	fdprog[0] = '\0';
-	fdxsrv[0] = '\0';
-	fdxdum[0] = '\0';
-	fdcups[0] = '\0';
-	fdesd[0]  = '\0';
-	fdnas[0]  = '\0';
-	fdsmb[0]  = '\0';
-	fdtag[0]  = '\0';
-	fdxdmcpif[0]  = '\0';
-	cdout[0]  = '\0';
-
-	if (unixpw && keep_unixpw_opts && !getenv("X11VNC_NO_UNIXPW_OPTS")) {
-		char *q, *p, *t = strdup(keep_unixpw_opts);
-
-		if (strstr(t, "gnome")) {
-			sprintf(fdsess, "gnome");
-		} else if (strstr(t, "kde")) {
-			sprintf(fdsess, "kde");
-		} else if (strstr(t, "lxde")) {
-			sprintf(fdsess, "lxde");
-		} else if (strstr(t, "twm")) {
-			sprintf(fdsess, "twm");
-		} else if (strstr(t, "fvwm")) {
-			sprintf(fdsess, "fvwm");
-		} else if (strstr(t, "mwm")) {
-			sprintf(fdsess, "mwm");
-		} else if (strstr(t, "cde")) {
-			sprintf(fdsess, "cde");
-		} else if (strstr(t, "dtwm")) {
-			sprintf(fdsess, "dtwm");
-		} else if (strstr(t, "xterm")) {
-			sprintf(fdsess, "xterm");
-		} else if (strstr(t, "wmaker")) {
-			sprintf(fdsess, "wmaker");
-		} else if (strstr(t, "xfce")) {
-			sprintf(fdsess, "xfce");
-		} else if (strstr(t, "enlightenment")) {
-			sprintf(fdsess, "enlightenment");
-		} else if (strstr(t, "Xsession")) {
-			sprintf(fdsess, "Xsession");
-		} else if (strstr(t, "failsafe")) {
-			sprintf(fdsess, "failsafe");
-		}
-
-		q = strstr(t, "ge=");
-		if (! q) q = strstr(t, "geom=");
-		if (! q) q = strstr(t, "geometry=");
-		if (q) {
-			int ok = 1;
-			q = strstr(q, "=");
-			q++;
-			p = strstr(q, ",");
-			if (p) *p = '\0';
-			p = q;
-			while (*p) {
-				if (*p == 'x') {
-					;
-				} else if (isdigit((int) *p)) {
-					;
-				} else {
-					ok = 0;
-					break;
-				}
-				p++;
-			}
-			if (ok && strlen(q) < 32) {
-				sprintf(fdgeom, "%s", q);
-				if (!quiet) {
-					rfbLog("set create display geom: %s\n", fdgeom);
-				}
-			}
-		}
-		q = strstr(t, "cups=");
-		if (q) {
-			int p;
-			if (sscanf(q, "cups=%d", &p) == 1) {
-				sprintf(fdcups, "%d", p);
-			}
-		}
-		q = strstr(t, "esd=");
-		if (q) {
-			int p;
-			if (sscanf(q, "esd=%d", &p) == 1) {
-				sprintf(fdesd, "%d", p);
-			}
-		}
-		if (!getenv("FD_TAG")) {
-			char *s = NULL;
-
-			q = strstr(t, "tag=");
-			if (q) s = strchr(q, ',');
-			if (s) *s = '\0';
-
-			if (q && strlen(q) < 120) {
-				char *p;
-				int ok = 1;
-				q = strchr(q, '=') + 1;
-				p = q;
-				while (*p != '\0') {
-					char c = *p;
-					if (*p == '_' || *p == '-') {
-						;
-					} else if (!isalnum((int) c)) {
-						ok = 0;
-						rfbLog("bad tag char: '%c' in '%s'\n", c, q);
-						break;
-					}
-					p++;
-				}
-				if (ok) {
-					sprintf(fdtag, "%s", q);
-				}
-			}
-			if (s) *s = ',';
-		}
-		free(t);
-	}
-	if (fdgeom[0] == '\0' && getenv("FD_GEOM")) {
-		snprintf(fdgeom,  120, "%s", getenv("FD_GEOM"));
-	}
-	if (fdsess[0] == '\0' && getenv("FD_SESS")) {
-		snprintf(fdsess, 120, "%s", getenv("FD_SESS"));
-	}
-	if (fdopts[0] == '\0' && getenv("FD_OPTS")) {
-		snprintf(fdopts, 120, "%s", getenv("FD_OPTS"));
-	}
-	if (fdextra[0] == '\0' && getenv("FD_EXTRA")) {
-		if (!strchr(getenv("FD_EXTRA"), '\'')) {
-			snprintf(fdextra, 250, "%s", getenv("FD_EXTRA"));
-		}
-	}
-	if (fdprog[0] == '\0' && getenv("FD_PROG")) {
-		snprintf(fdprog, 120, "%s", getenv("FD_PROG"));
-	}
-	if (fdxsrv[0] == '\0' && getenv("FD_XSRV")) {
-		snprintf(fdxsrv, 120, "%s", getenv("FD_XSRV"));
-	}
-	if (fdcups[0] == '\0' && getenv("FD_CUPS")) {
-		snprintf(fdcups, 120, "%s", getenv("FD_CUPS"));
-	}
-	if (fdesd[0] == '\0' && getenv("FD_ESD")) {
-		snprintf(fdesd, 120, "%s", getenv("FD_ESD"));
-	}
-	if (fdnas[0] == '\0' && getenv("FD_NAS")) {
-		snprintf(fdnas, 120, "%s", getenv("FD_NAS"));
-	}
-	if (fdsmb[0] == '\0' && getenv("FD_SMB")) {
-		snprintf(fdsmb, 120, "%s", getenv("FD_SMB"));
-	}
-	if (fdtag[0] == '\0' && getenv("FD_TAG")) {
-		snprintf(fdtag, 120, "%s", getenv("FD_TAG"));
-	}
-	if (fdxdmcpif[0] == '\0' && getenv("FD_XDMCP_IF")) {
-		snprintf(fdxdmcpif,  120, "%s", getenv("FD_XDMCP_IF"));
-	}
-	if (fdxdum[0] == '\0' && getenv("FD_XDUMMY_RUN_AS_ROOT")) {
-		snprintf(fdxdum, 120, "%s", getenv("FD_XDUMMY_RUN_AS_ROOT"));
-	}
-	if (getenv("CREATE_DISPLAY_OUTPUT")) {
-		snprintf(cdout, 120, "CREATE_DISPLAY_OUTPUT='%s'", getenv("CREATE_DISPLAY_OUTPUT"));
-	}
-
-	if (strchr(fdgeom, '\''))	fdgeom[0] = '\0';
-	if (strchr(fdopts, '\''))	fdopts[0] = '\0';
-	if (strchr(fdextra, '\''))	fdextra[0] = '\0';
-	if (strchr(fdprog, '\''))	fdprog[0] = '\0';
-	if (strchr(fdxsrv, '\''))	fdxsrv[0] = '\0';
-	if (strchr(fdcups, '\''))	fdcups[0] = '\0';
-	if (strchr(fdesd, '\''))	fdesd[0] = '\0';
-	if (strchr(fdnas, '\''))	fdnas[0] = '\0';
-	if (strchr(fdsmb, '\''))	fdsmb[0] = '\0';
-	if (strchr(fdtag, '\''))	fdtag[0] = '\0';
-	if (strchr(fdxdmcpif, '\''))	fdxdmcpif[0] = '\0';
-	if (strchr(fdxdum, '\''))	fdxdum[0] = '\0';
-	if (strchr(fdsess, '\''))	fdsess[0] = '\0';
-	if (strchr(cdout, '\''))	cdout[0] = '\0';
-
-	set_env("FD_GEOM", fdgeom);
-	set_env("FD_OPTS", fdopts);
-	set_env("FD_EXTRA", fdextra);
-	set_env("FD_PROG", fdprog);
-	set_env("FD_XSRV", fdxsrv);
-	set_env("FD_CUPS", fdcups);
-	set_env("FD_ESD",  fdesd);
-	set_env("FD_NAS",  fdnas);
-	set_env("FD_SMB",  fdsmb);
-	set_env("FD_TAG",  fdtag);
-	set_env("FD_XDMCP_IF",  fdxdmcpif);
-	set_env("FD_XDUMMY_RUN_AS_ROOT", fdxdum);
-	set_env("FD_SESS", fdsess);
-
-	if (usslpeer || (unixpw && keep_unixpw_user)) {
-		char *uu = usslpeer;
-		if (!uu) {
-			uu = keep_unixpw_user;
-		}
-		if (strchr(uu, '\''))  {
-			uu = "";
-		}
-		create_cmd = (char *) malloc(strlen(tmp)+1
-		    + strlen("env USER='' ")
-		    + strlen("FD_GEOM='' ")
-		    + strlen("FD_OPTS='' ")
-		    + strlen("FD_EXTRA='' ")
-		    + strlen("FD_PROG='' ")
-		    + strlen("FD_XSRV='' ")
-		    + strlen("FD_CUPS='' ")
-		    + strlen("FD_ESD='' ")
-		    + strlen("FD_NAS='' ")
-		    + strlen("FD_SMB='' ")
-		    + strlen("FD_TAG='' ")
-		    + strlen("FD_XDMCP_IF='' ")
-		    + strlen("FD_XDUMMY_RUN_AS_ROOT='' ")
-		    + strlen("FD_SESS='' /bin/sh ")
-		    + strlen(uu) + 1
-		    + strlen(fdgeom) + 1
-		    + strlen(fdopts) + 1
-		    + strlen(fdextra) + 1
-		    + strlen(fdprog) + 1
-		    + strlen(fdxsrv) + 1
-		    + strlen(fdcups) + 1
-		    + strlen(fdesd) + 1
-		    + strlen(fdnas) + 1
-		    + strlen(fdsmb) + 1
-		    + strlen(fdtag) + 1
-		    + strlen(fdxdmcpif) + 1
-		    + strlen(fdxdum) + 1
-		    + strlen(fdsess) + 1
-		    + strlen(cdout) + 1
-		    + strlen(opts) + 1);
-		sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' "
-		    "FD_OPTS='%s' FD_EXTRA='%s' FD_PROG='%s' FD_XSRV='%s' FD_CUPS='%s' "
-		    "FD_ESD='%s' FD_NAS='%s' FD_SMB='%s' FD_TAG='%s' FD_XDMCP_IF='%s' "
-		    "FD_XDUMMY_RUN_AS_ROOT='%s' %s /bin/sh %s %s",
-		    uu, fdgeom, fdsess, fdopts, fdextra, fdprog, fdxsrv,
-		    fdcups, fdesd, fdnas, fdsmb, fdtag, fdxdmcpif, fdxdum, cdout, tmp, opts);
-	} else {
-		create_cmd = (char *) malloc(strlen(tmp)
-		    + strlen("/bin/sh ") + 1 + strlen(opts) + 1);
-		sprintf(create_cmd, "/bin/sh %s %s", tmp, opts);
-	}
-	return create_cmd;
-}
-
-static char *certret_extract() {
-	char *q, *p, *str = strdup(certret_str);
-	char *upeer = NULL;
-	int ok = 0;
-
-	q = strstr(str, "Subject: ");
-	if (! q) return NULL;
-
-	p = strstr(q, "\n");
-	if (p) *p = '\0';
-
-	q = strstr(q, "CN=");
-	if (! q) return NULL;
-
-	if (! getenv("X11VNC_SSLPEER_CN")) {
-		p = q;
-		q = strstr(q, "/emailAddress=");
-		if (! q) q = strstr(p, "/Email=");
-		if (! q) return NULL;
-	}
-
-	q = strstr(q, "=");
-	if (! q) return NULL;
-
-	q++;
-	p = strstr(q, " ");
-	if (p) *p = '\0';
-	p = strstr(q, "@");
-	if (p) *p = '\0';
-	p = strstr(q, "/");
-	if (p) *p = '\0';
-
-	upeer = strdup(q);
-
-	if (strcmp(upeer, "")) {
-		p = upeer;
-		while (*p != '\0') {
-			char c = *p;
-			if (!isalnum((int) c)) {
-				*p = '\0';
-				break;
-			}
-			p++;
-		}
-		if (strcmp(upeer, "")) {
-			ok = 1;
-		}
-	}
-	if (! ok) {
-		upeer = NULL;
-	}
-	return upeer;
-}
-
-static void check_nodisplay(char **nd, char **tag) {
-	if (unixpw && !getenv("X11VNC_NO_UNIXPW_OPTS") && keep_unixpw_opts && keep_unixpw_opts[0] != '\0') {
-		char *q, *t2, *t = keep_unixpw_opts;
-		q = strstr(t, "nd=");
-		if (! q) q = strstr(t, "nodisplay=");
-		if (q) {
-			q = strchr(q, '=') + 1;
-			t = strdup(q);
-			q = t;
-			t2 = strchr(t, ',');
-			if (t2) *t2 = '\0';
-
-			while (*t != '\0') {
-				if (*t == '+') {
-					*t = ',';
-				}
-				t++;
-			}
-			if (!strchr(q, '\'') && !strpbrk(q, "[](){}`'\"$&*|<>")) {
-				if (! quiet) rfbLog("set X11VNC_SKIP_DISPLAY: %s\n", q);
-				*nd = q;
-			}
-		}
-
-		q = strstr(keep_unixpw_opts, "tag=");
-		if (getenv("FD_TAG")) {
-			*tag = strdup(getenv("FD_TAG"));
-		} else if (q) {
-			q = strchr(q, '=') + 1;
-			t = strdup(q);
-			q = t;
-			t2 = strchr(t, ',');
-			if (t2) *t2 = '\0';
-
-			if (strlen(q) < 120) {
-				int ok = 1;
-				while (*t != '\0') {
-					char c = *t;
-					if (*t == '_' || *t == '-') {
-						;
-					} else if (!isalnum((int) c)) {
-						ok = 0;
-						rfbLog("bad tag char: '%c' in '%s'\n", c, q);
-						break;
-					}
-					t++;
-				}
-				if (ok) {
-					if (! quiet) rfbLog("set FD_TAG: %s\n", q);
-					*tag = q;
-				}
-			}
-		}
-	}
-	if (unixpw_system_greeter_active == 2) {
-		if (!keep_unixpw_user) {
-			clean_up_exit(1);
-		}
-		*nd = strdup("all");
-	}
-}
-
-static char *get_usslpeer() {
-	char *u = NULL, *upeer = NULL;
-
-	if (certret_str) {
-		upeer = certret_extract();
-	}
-	if (!upeer) {
-		return NULL;
-	}
-	rfbLog("sslpeer unix username extracted from x509 cert: %s\n", upeer);
-
-	u = (char *) malloc(strlen(upeer+2));
-	u[0] = '\0';
-	if (!strcmp(users_list, "sslpeer=")) {
-		sprintf(u, "+%s", upeer);
-	} else {
-		char *p, *str = strdup(users_list);
-		p = strtok(str + strlen("sslpeer="), ",");
-		while (p) {
-			if (!strcmp(p, upeer)) {
-				sprintf(u, "+%s", upeer);
-				break;
-			}
-			p = strtok(NULL, ",");
-		}
-		free(str);
-	}
-	if (u[0] == '\0') {
-		rfbLog("sslpeer cannot determine user: %s\n", upeer);
-		free(u);
-		return NULL;
-	}
-	free(u);
-	return upeer;
-}
-
-static void do_try_switch(char *usslpeer, char *users_list_save) {
-	if (unixpw_system_greeter_active == 2) {
-		rfbLog("unixpw_system_greeter: not trying switch to user '%s'\n", usslpeer ? usslpeer : "");
-		return;
-	}
-	if (usslpeer) {
-		char *u = (char *) malloc(strlen(usslpeer+2));
-		sprintf(u, "+%s", usslpeer);
-		if (switch_user(u, 0)) {
-			rfbLog("sslpeer switched to user: %s\n", usslpeer);
-		} else {
-			rfbLog("sslpeer failed to switch to user: %s\n", usslpeer);
-		}
-		free(u);
-		
-	} else if (users_list_save && keep_unixpw_user) {
-		char *user = keep_unixpw_user;
-		char *u = (char *)malloc(strlen(user)+1); 
-
-		users_list = users_list_save;
-
-		u[0] = '\0';
-		if (!strcmp(users_list, "unixpw=")) {
-			sprintf(u, "+%s", user);
-		} else {
-			char *p, *str = strdup(users_list);
-			p = strtok(str + strlen("unixpw="), ",");
-			while (p) {
-				if (!strcmp(p, user)) {
-					sprintf(u, "+%s", user);
-					break;
-				}
-				p = strtok(NULL, ",");
-			}
-			free(str);
-		}
-		
-		if (u[0] == '\0') {
-			rfbLog("unixpw_accept skipping switch to user: %s (drc)\n", user);
-		} else if (switch_user(u, 0)) {
-			rfbLog("unixpw_accept switched to user: %s (drc)\n", user);
-		} else {
-			rfbLog("unixpw_accept failed to switch to user: %s (drc)\n", user);
-		}
-		free(u);
-	}
-}
-
-static void path_lookup(char *prog) {
-	/* see create_display script */
-	char *create_display_extra = "/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/dt/bin:/opt/kde4/bin:/opt/kde3/bin:/opt/gnome/bin:/usr/bin:/bin:/usr/sfw/bin:/usr/local/bin";
-	char *path, *try, *p;
-	int found = 0, len = strlen(create_display_extra);
-
-	if (getenv("PATH")) {
-		len += strlen(getenv("PATH")) + 1;
-		path = (char *) malloc((len+1) * sizeof(char));
-		sprintf(path, "%s:%s", getenv("PATH"), create_display_extra);
-	} else {
-		path = (char *) malloc((len+1) * sizeof(char));
-		sprintf(path, "%s", create_display_extra);
-	}
-	try = (char *) malloc((len+2+strlen(prog)) * sizeof(char));
-
-	p = strtok(path, ":");
-	while (p) {
-		struct stat sbuf;
-
-		sprintf(try, "%s/%s", p, prog);
-		if (stat(try, &sbuf) == 0) {
-			found = 1;
-			break;
-		}
-		p = strtok(NULL, ":");
-	}
-
-	free(path);
-	free(try);
-
-	if (!found) {
-		fprintf(stderr, "\n");
-		fprintf(stderr, "The program \"%s\" could not be found in PATH and standard locations.\n", prog);
-		fprintf(stderr, "You probably need to install a package that provides the \"%s\" program.\n", prog);
-		fprintf(stderr, "Without it FINDCREATEDISPLAY mode may not be able to create an X display.\n");
-		fprintf(stderr, "\n");
-	}
-}
-
-static int do_run_cmd(char *cmd, char *create_cmd, char *users_list_save, int created_disp, int db) {
-#ifndef WIN32
-	char tmp[] = "/tmp/x11vnc-find_display.XXXXXX";
-	char line1[1024], line2[16384];
-	char *q, *usslpeer = NULL;
-	int n, nodisp = 0, saw_xdmcp = 0;
-	int tmp_fd = -1;
-	int internal_cmd = 0;
-	int tried_switch = 0;
-
-	memset(line1, 0, sizeof(line1));
-	memset(line2, 0, sizeof(line2));
-
-	if (users_list && strstr(users_list, "sslpeer=") == users_list) {
-		usslpeer = get_usslpeer();
-		if (! usslpeer) {
-			return 0;
-		}
-	}
-	if (getenv("DEBUG_RUN_CMD")) db = 1;
-
-	/* only sets environment variables: */
-	run_user_command("", latest_client, "env", NULL, 0, NULL);
-
-	if (program_name) {
-		set_env("X11VNC_PROG", program_name);
-	} else {
-		set_env("X11VNC_PROG", "x11vnc");
-	}
-
-	if (!strcmp(cmd, "FINDDISPLAY") ||
-	    strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
-		char *nd = "";
-		char *tag = "";
-		char fdout[128];
-
-		internal_cmd = 1;
-
-		tmp_fd = mkstemp(tmp);
-
-		if (tmp_fd < 0) {
-			rfbLog("wait_for_client: open failed: %s\n", tmp);
-			rfbLogPerror("mkstemp");
-			clean_up_exit(1);
-		}
-		chmod(tmp, 0644);
-		if (getenv("X11VNC_FINDDISPLAY_ALWAYS_FAILS")) {
-			char *s = "#!/bin/sh\necho _FAIL_\nexit 1\n";
-			write(tmp_fd, s, strlen(s));
-		} else {
-			write(tmp_fd, find_display, strlen(find_display));
-		}
-		close(tmp_fd);
-		nodisp = 1;
-
-		if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
-			create_cmd = build_create_cmd(cmd, &saw_xdmcp, usslpeer, tmp);
-			if (db) fprintf(stderr, "create_cmd: %s\n", create_cmd);
-		}
-		if (getenv("X11VNC_SKIP_DISPLAY")) {
-			nd = strdup(getenv("X11VNC_SKIP_DISPLAY"));
-		}
-		check_nodisplay(&nd, &tag);
-
-		fdout[0] = '\0';
-		if (getenv("FIND_DISPLAY_OUTPUT")) {
-			snprintf(fdout, 120, " FIND_DISPLAY_OUTPUT='%s' ", getenv("FIND_DISPLAY_OUTPUT"));
-		}
-
-		cmd = (char *) malloc(strlen("env X11VNC_SKIP_DISPLAY='' ")
-		    + strlen(nd) + strlen(" FD_TAG='' ") + strlen(tag) + strlen(tmp) + strlen("/bin/sh ") + strlen(fdout) + 1);
-
-		if (strcmp(tag, "")) {
-			sprintf(cmd, "env X11VNC_SKIP_DISPLAY='%s' FD_TAG='%s' %s /bin/sh %s", nd, tag, fdout, tmp);
-		} else {
-			sprintf(cmd, "env X11VNC_SKIP_DISPLAY='%s' %s /bin/sh %s", nd, fdout, tmp);
-		}
-	}
-
-	rfbLog("wait_for_client: running: %s\n", cmd);
-
-	if (create_cmd != NULL) {
-		if (strstr(create_cmd, "Xvfb")) {
-			path_lookup("Xvfb");
-		}
-		if (strstr(create_cmd, "Xvnc")) {
-			path_lookup("Xvnc");
-		}
-		if (strstr(create_cmd, "Xdummy")) {
-			path_lookup("Xdummy");
-		}
-	}
-
-	if (unixpw && !unixpw_nis) {
-		int res = 0, k, j, i;
-		char line[18000];
-
-		memset(line, 0, sizeof(line));
-
-		if (unixpw_system_greeter_active == 2) {
-			rfbLog("unixpw_system_greeter: forcing find display failure.\n");
-			res = 0;
-		} else if (keep_unixpw_user && keep_unixpw_pass) {
-			n = sizeof(line);
-			if (unixpw_cmd != NULL) {
-				res = unixpw_cmd_run(keep_unixpw_user,
-				    keep_unixpw_pass, cmd, line, &n);
-			} else {
-				res = su_verify(keep_unixpw_user,
-				    keep_unixpw_pass, cmd, line, &n, nodisp);
-			}
-		}
-
-if (db) {fprintf(stderr, "line: "); write(2, line, n); write(2, "\n", 1); fprintf(stderr, "res=%d n=%d\n", res, n);}
-		if (! res) {
-			rfbLog("wait_for_client: find display cmd failed.\n");
-		}
-
-		if (! res && create_cmd) {
-			FILE *mt = fopen(tmp, "w");
-			if (! mt) {
-				rfbLog("wait_for_client: open failed: %s\n", tmp);
-				rfbLogPerror("fopen");
-				clean_up_exit(1);
-			}
-			fprintf(mt, "%s", create_display);
-			fclose(mt);
-
-			findcreatedisplay = 1;
-
-			if (unixpw_cmd != NULL) {
-				/* let the external unixpw command do it: */
-				n = sizeof(line);
-				close_exec_fds();
-				res = unixpw_cmd_run(keep_unixpw_user,
-				    keep_unixpw_pass, create_cmd, line, &n);
-			} else if (getuid() != 0 && unixpw_system_greeter_active != 2) {
-				/* if not root, run as the other user... */
-				n = sizeof(line);
-				close_exec_fds();
-				res = su_verify(keep_unixpw_user,
-				    keep_unixpw_pass, create_cmd, line, &n, nodisp);
-if (db) fprintf(stderr, "c-res=%d n=%d line: '%s'\n", res, n, line);
-
-			} else {
-				FILE *p;
-				close_exec_fds();
-				if (unixpw_system_greeter_active == 2) {
-					rfbLog("unixpw_system_greeter: not trying su_verify() to run\n");
-					rfbLog("unixpw_system_greeter: create display command.\n");
-				}
-				rfbLog("wait_for_client: running: %s\n", create_cmd);
-				p = popen(create_cmd, "r");
-				if (! p) {
-					rfbLog("wait_for_client: popen failed: %s\n", create_cmd);
-					res = 0;
-				} else if (fgets(line1, 1024, p) == NULL) {
-					rfbLog("wait_for_client: read failed: %s\n", create_cmd);
-					res = 0;
-				} else {
-					n = fread(line2, 1, 16384, p);
-					if (pclose(p) != 0) {
-						res = 0;
-					} else {
-						strncpy(line, line1, 100);
-						memcpy(line + strlen(line1), line2, n);
-if (db) fprintf(stderr, "line1: '%s'\n", line1);
-						n += strlen(line1);
-						created_disp = 1;
-						res = 1;
-					}
-				}
-			}
-			if (res && saw_xdmcp && unixpw_system_greeter_active != 2) {
-				xdmcp_insert = strdup(keep_unixpw_user);
-			}
-		}
-
-		if (tmp_fd >= 0) {
-			unlink(tmp);
-		}
-
-		if (! res) {
-			rfbLog("wait_for_client: cmd failed: %s\n", cmd);
-			unixpw_msg("No DISPLAY found.", 3);
-			clean_up_exit(1);
-		}
-
-		/*
-		 * we need to hunt for DISPLAY= since there may be
-		 * a login banner or something at the beginning.
-		 */
-		q = strstr(line, "DISPLAY=");
-		if (! q) {
-			q = line;
-		}
-		n -= (q - line);
-
-		for (k = 0; k < 1024; k++) {
-			line1[k] = q[k];
-			if (q[k] == '\n') {
-				k++;
-				break;
-			}
-		}
-		n -= k;
-		i = 0;
-		for (j = 0; j < 16384; j++) {
-			if (j < 16384 - 1) {
-				/* xauth data, assume pty added CR */
-				if (q[k+j] == '\r' && q[k+j+1] == '\n') {
-					continue;
-				}
-			}
-			
-			line2[i] = q[k+j];
-			i++;
-		}
-if (db) write(2, line, 100);
-if (db) fprintf(stderr, "\n");
-
-	} else {
-		FILE *p;
-		int rc;
-		close_exec_fds();
-
-		if (usslpeer) {
-			char *c;
-			if (getuid() == 0) {
-				c = (char *) malloc(strlen("su - '' -c \"")
-				    + strlen(usslpeer) + strlen(cmd) + 1 + 1);
-				sprintf(c, "su - '%s' -c \"%s\"", usslpeer, cmd);
-			} else {
-				c = strdup(cmd);
-			}
-			p = popen(c, "r");
-			free(c);
-			
-		} else if (unixpw_nis && keep_unixpw_user) {
-			char *c;
-			if (getuid() == 0) {
-				c = (char *) malloc(strlen("su - '' -c \"")
-				    + strlen(keep_unixpw_user) + strlen(cmd) + 1 + 1);
-				sprintf(c, "su - '%s' -c \"%s\"", keep_unixpw_user, cmd);
-			} else {
-				c = strdup(cmd);
-			}
-			p = popen(c, "r");
-			free(c);
-			
-		} else {
-			p = popen(cmd, "r");
-		}
-
-		if (! p) {
-			rfbLog("wait_for_client: cmd failed: %s\n", cmd);
-			rfbLogPerror("popen");
-			if (tmp_fd >= 0) {
-				unlink(tmp);
-			}
-			clean_up_exit(1);
-		}
-		if (fgets(line1, 1024, p) == NULL) {
-			rfbLog("wait_for_client: read failed: %s\n", cmd);
-			rfbLogPerror("fgets");
-			if (tmp_fd >= 0) {
-				unlink(tmp);
-			}
-			clean_up_exit(1);
-		}
-		n = fread(line2, 1, 16384, p);
-		rc = pclose(p);
-
-		if (rc != 0) {
-			rfbLog("wait_for_client: find display cmd failed.\n");
-		}
-
-		if (create_cmd && rc != 0) {
-			FILE *mt = fopen(tmp, "w");
-			if (! mt) {
-				rfbLog("wait_for_client: open failed: %s\n", tmp);
-				rfbLogPerror("fopen");
-				if (tmp_fd >= 0) {
-					unlink(tmp);
-				}
-				clean_up_exit(1);
-			}
-			fprintf(mt, "%s", create_display);
-			fclose(mt);
-
-			findcreatedisplay = 1;
-
-			rfbLog("wait_for_client: FINDCREATEDISPLAY cmd: %s\n", create_cmd);
-
-			p = popen(create_cmd, "r");
-			if (! p) {
-				rfbLog("wait_for_client: cmd failed: %s\n", create_cmd);
-				rfbLogPerror("popen");
-				if (tmp_fd >= 0) {
-					unlink(tmp);
-				}
-				clean_up_exit(1);
-			}
-			if (fgets(line1, 1024, p) == NULL) {
-				rfbLog("wait_for_client: read failed: %s\n", create_cmd);
-				rfbLogPerror("fgets");
-				if (tmp_fd >= 0) {
-					unlink(tmp);
-				}
-				clean_up_exit(1);
-			}
-			n = fread(line2, 1, 16384, p);
-			pclose(p);
-		}
-		if (tmp_fd >= 0) {
-			unlink(tmp);
-		}
-	}
-
-if (db) fprintf(stderr, "line1=%s\n", line1);
-
-	if (strstr(line1, "DISPLAY=") != line1) {
-		rfbLog("wait_for_client: bad reply '%s'\n", line1);
-		if (unixpw) {
-			unixpw_msg("No DISPLAY found.", 3);
-		}
-		clean_up_exit(1);
-	}
-
-
-	if (strstr(line1, ",VT=")) {
-		int vt;
-		char *t = strstr(line1, ",VT=");
-		vt = atoi(t + strlen(",VT="));
-		*t = '\0';
-		if (7 <= vt && vt <= 15) {
-			do_chvt(vt);
-		}
-	} else if (strstr(line1, ",XPID=")) {
-		int i, pvt, vt = -1;
-		char *t = strstr(line1, ",XPID=");
-		pvt = atoi(t + strlen(",XPID="));
-		*t = '\0';
-		if (pvt > 0) {
-			for (i=3; i <= 10; i++) {
-				int k;
-				char proc[100];
-				char buf[100];
-				sprintf(proc, "/proc/%d/fd/%d", pvt, i);
-if (db) fprintf(stderr, "%d -- %s\n", i, proc);
-				for (k=0; k < 100; k++) {
-					buf[k] = '\0';
-				}
-	
-				if (readlink(proc, buf, 100) != -1) {
-					buf[100-1] = '\0';
-if (db) fprintf(stderr, "%d -- %s -- %s\n", i, proc, buf);
-					if (strstr(buf, "/dev/tty") == buf) {
-						vt = atoi(buf + strlen("/dev/tty"));
-						if (vt > 0) {
-							break;
-						}
-					}
-				}
-			}
-		}
-		if (7 <= vt && vt <= 12) {
-			do_chvt(vt);
-		}
-	}
-
-	use_dpy = strdup(line1 + strlen("DISPLAY="));
-	q = use_dpy;
-	while (*q != '\0') {
-		if (*q == '\n' || *q == '\r') *q = '\0';
-		q++;
-	}
-	if (line2[0] != '\0') {
-		if (strstr(line2, "XAUTHORITY=") == line2) {
-			q = line2;
-			while (*q != '\0') {
-				if (*q == '\n' || *q == '\r') *q = '\0';
-				q++;
-			}
-			if (auth_file) {
-				free(auth_file);
-			}
-			auth_file = strdup(line2 + strlen("XAUTHORITY="));
-
-		} else {
-			xauth_raw_data = (char *)malloc(n);
-			xauth_raw_len = n;
-			memcpy(xauth_raw_data, line2, n);
-if (db) {fprintf(stderr, "xauth_raw_len: %d\n", n);
-write(2, xauth_raw_data, n);
-fprintf(stderr, "\n");}
-		}
-	}
-
-	if (!tried_switch) {
-		do_try_switch(usslpeer, users_list_save);
-		tried_switch = 1;
-	}
-
-	if (unixpw) {
-		/* Some cleanup and messaging for -unixpw case: */
-		char str[32];
-
-		if (keep_unixpw_user && keep_unixpw_pass) {
-			strzero(keep_unixpw_user);
-			strzero(keep_unixpw_pass);
-			keep_unixpw = 0;
-		}
-
-		if (created_disp) {
-			snprintf(str, 30, "Created DISPLAY %s", use_dpy);
-		} else {
-			snprintf(str, 30, "Using DISPLAY %s", use_dpy);
-		}
-		unixpw_msg(str, 2);
-	}
-#endif
-	return 1;
-}
-
-void ssh_remote_tunnel(char *, int);
-
-static XImage ximage_struct;
-
-void progress_client(void) {
-	int i, j = 0, progressed = 0, db = 0;
-	double start = dnow();
-	if (getenv("PROGRESS_CLIENT_DBG")) {
-		rfbLog("progress_client: begin\n");
-		db = 1;
-	}
-	for (i = 0; i < 15; i++) {
-		if (latest_client) {
-			for (j = 0; j < 10; j++) {
-				if (latest_client->state != RFB_PROTOCOL_VERSION) {
-					progressed = 1;
-					break;
-				}
-				if (db) rfbLog("progress_client: calling-1 rfbCFD(1) %.6f\n", dnow()-start);
-				rfbCFD(1);
-			}
-		}
-		if (progressed) {
-			break;
-		}
-		if (db) rfbLog("progress_client: calling-2 rfbCFD(1) %.6f\n", dnow()-start);
-		rfbCFD(1);
-	}
-	if (!quiet) {
-		rfbLog("client progressed=%d in %d/%d %.6f s\n",
-		    progressed, i, j, dnow() - start);
-	}
-}
-
-int wait_for_client(int *argc, char** argv, int http) {
-	/* ugh, here we go... */
-	XImage* fb_image;
-	int w = 640, h = 480, b = 32;
-	int w0 = -1, h0 = -1, i, chg_raw_fb = 0;
-	char *str, *q, *cmd = NULL;
-	int db = 0, dt = 0;
-	char *create_cmd = NULL;
-	char *users_list_save = NULL;
-	int created_disp = 0, ncache_save;
-	int did_client_connect = 0;
-	char *vnc_redirect_host = "localhost";
-	int vnc_redirect_port = -1, vnc_redirect_cnt = 0;
-	char vnc_redirect_test[10];
-
-	if (getenv("WAIT_FOR_CLIENT_DB")) {
-		db = 1;
-	}
-
-	vnc_redirect = 0;
-
-	if (! use_dpy || strstr(use_dpy, "WAIT:") != use_dpy) {
-		return 0;
-	}
-
-	for (i=0; i < *argc; i++) {
-		if (!strcmp(argv[i], "-desktop")) {
-			dt = 1;
-		}
-		if (db) fprintf(stderr, "args %d %s\n", i, argv[i]);
-	}
-	if (!quiet && !strstr(use_dpy, "FINDDISPLAY-run")) {
-		rfbLog("\n");
-		rfbLog("wait_for_client: %s\n", use_dpy);
-		rfbLog("\n");
-	}
-
-	str = strdup(use_dpy);
-	str += strlen("WAIT");
-
-	xdmcp_insert = NULL;
-
-	/* get any leading geometry: */
-	q = strchr(str+1, ':');
-	if (q) {
-		*q = '\0';
-		if (sscanf(str+1, "%dx%d", &w0, &h0) == 2)  {
-			w = w0;
-			h = h0;
-			rfbLog("wait_for_client set: w=%d h=%d\n", w, h);
-		} else {
-			w0 = -1;
-			h0 = -1;
-		}
-		*q = ':';
-		str = q;
-	}
-	if ((w0 == -1 || h0 == -1) && pad_geometry != NULL) {
-		int b0, del = 0;
-		char *s = pad_geometry;
-		if (strstr(s, "once:") == s) {
-			del = 1;
-			s += strlen("once:");
-		}
-		if (sscanf(s, "%dx%dx%d", &w0, &h0, &b0) == 3)  {
-			w = nabs(w0);
-			h = nabs(h0);
-			b = nabs(b0);
-		} else if (sscanf(s, "%dx%d", &w0, &h0) == 2)  {
-			w = nabs(w0);
-			h = nabs(h0);
-		}
-		if (del) {
-			pad_geometry = NULL;
-		}
-	}
-
-	/* str currently begins with a ':' */
-	if (strstr(str, ":cmd=") == str) {
-		/* cmd=/path/to/mycommand */
-		str++;
-	} else if (strpbrk(str, "0123456789") == str+1) {
-		/* :0.0 */
-		;
-	} else {
-		/* hostname:0.0 */
-		str++;
-	}
-
-	if (db) fprintf(stderr, "str: %s\n", str);
-
-	if (strstr(str, "cmd=") == str) {
-		cmd = setup_cmd(str, &vnc_redirect, &vnc_redirect_host, &vnc_redirect_port, db);
-	}
-	
-	fb_image = &ximage_struct;
-	setup_fake_fb(fb_image, w, h, b);
-
-	if (! dt) {
-		char *s;
-		argv[*argc] = strdup("-desktop");
-		*argc = (*argc) + 1;
-
-		if (cmd) {
-			char *q;
-			s = choose_title(":0");
-			q = strstr(s, ":0");
-			if (q) {
-				*q = '\0';
-			}
-		} else {
-			s = choose_title(str);
-		}
-		rfb_desktop_name = strdup(s);
-		argv[*argc] = s;
-		*argc = (*argc) + 1;
-	}
-
-	ncache_save = ncache;
-	ncache = 0;
-
-	initialize_allowed_input();
-
-	if (! multiple_cursors_mode) {
-		multiple_cursors_mode = strdup("default");
-	}
-	initialize_cursors_mode();
-	
-	initialize_screen(argc, argv, fb_image);
-
-	if (! inetd && ! use_openssl) {
-		if (! screen->port || screen->listenSock < 0) {
-			if (got_rfbport && got_rfbport_val == 0) {
-				;
-			} else if (ipv6_listen && ipv6_listen_fd >= 0) {
-				rfbLog("Info: listening on IPv6 interface only.  (wait for client)\n");
-			} else {
-				rfbLogEnable(1);
-				rfbLog("Error: could not obtain listening port.  (wait for client)\n");
-				if (!got_rfbport && !got_ipv6_listen) {
-					rfbLog("If this system is IPv6-only, use the -6 option.\n");
-				}
-				clean_up_exit(1);
-			}
-		}
-	}
-
-	initialize_signals();
-
-	if (ssh_str != NULL) {
-		ssh_remote_tunnel(ssh_str, screen->port);
-	}
-
-	if (! raw_fb) {
-		chg_raw_fb = 1;
-		/* kludge to get RAWFB_RET with dpy == NULL guards */
-		raw_fb = (char *) 0x1;
-	}
-
-	if (cmd && !strcmp(cmd, "HTTPONCE")) {
-		handle_one_http_request();	
-		clean_up_exit(0);
-	}
-
-	if (http && check_httpdir()) {
-		http_connections(1);
-	}
-
-	if (cmd && unixpw) {
-		keep_unixpw = 1;
-	}
-
-	setup_service();
-
-	check_waitbg();
-
-	if (vnc_redirect) {
-		vnc_redirect_loop(vnc_redirect_test, &vnc_redirect_cnt);
-	} else {
-
-		if (use_threads && !started_rfbRunEventLoop) {
-			started_rfbRunEventLoop = 1;
-			rfbRunEventLoop(screen, -1, TRUE);
-		}
-
-		if (inetd && use_openssl) {
-			accept_openssl(OPENSSL_INETD, -1);
-		}
-
-		setup_client_connect(&did_client_connect);
-
-		loop_for_connect(did_client_connect);
-
-		if (unixpw) {
-			if (cmd && strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
-				if (users_list && strstr(users_list, "unixpw=") == users_list) {
-					users_list_save = users_list;
-					users_list = NULL;
-				}
-			}
-			do_unixpw_loop();
-		} else if (cmd && !use_threads) {
-			/* try to get RFB proto done now. */
-			progress_client();
-		}
-	}
-
-	if (vnc_redirect == 2) {
-		;
-	} else if (cmd) {
-		if (!do_run_cmd(cmd, create_cmd, users_list_save, created_disp, db)) {
-			return 0;
-		}
-	} else {
-		use_dpy = strdup(str);
-	}
-	if (chg_raw_fb) {
-		raw_fb = NULL;
-	}
-
-	ncache = ncache_save;
-
-	if (unixpw && keep_unixpw_opts && keep_unixpw_opts[0] != '\0') {
-		user_supplied_opts(keep_unixpw_opts);
-	}
-	if (create_cmd) {
-		free(create_cmd);
-	}
-
-	if (vnc_redirect) {
-		do_vnc_redirect(created_disp, vnc_redirect_host, vnc_redirect_port,
-		    vnc_redirect_cnt, vnc_redirect_test);
-		clean_up_exit(0);
-	}
-
-	return 1;
-}
-
diff --git a/ica/x11/x11vnc/user.h b/ica/x11/x11vnc/user.h
deleted file mode 100644
index 68c1bb8..0000000
--- a/ica/x11/x11vnc/user.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_USER_H
-#define _X11VNC_USER_H
-
-/* -- user.h -- */
-
-extern void check_switched_user(void);
-extern void lurk_loop(char *str);
-extern int switch_user(char *, int);
-extern int read_passwds(char *passfile);
-extern void install_passwds(void);
-extern void check_new_passwds(int force);
-extern void progress_client(void);
-extern int wait_for_client(int *argc, char** argv, int http);
-extern rfbBool custom_passwd_check(rfbClientPtr cl, const char *response, int len);
-extern char *xdmcp_insert;
-
-#endif /* _X11VNC_USER_H */
diff --git a/ica/x11/x11vnc/userinput.c b/ica/x11/x11vnc/userinput.c
deleted file mode 100644
index 84bcb7b..0000000
--- a/ica/x11/x11vnc/userinput.c
+++ /dev/null
@@ -1,10199 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- userinput.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "xdamage.h"
-#include "xrecord.h"
-#include "xinerama.h"
-#include "win_utils.h"
-#include "xevents.h"
-#include "user.h"
-#include "scan.h"
-#include "cleanup.h"
-#include "pointer.h"
-#include "rates.h"
-#include "keyboard.h"
-#include "solid.h"
-#include "xrandr.h"
-#include "8to24.h"
-#include "unixpw.h"
-#include "macosx.h"
-#include "macosxCGS.h"
-#include "cursor.h"
-#include "screen.h"
-#include "connections.h"
-
-/*
- * user input handling heuristics
- */
-int defer_update_nofb = 4;	/* defer a shorter time under -nofb */
-int last_scroll_type = SCR_NONE;
-
-
-int get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
-    Window *frame, Window *win);
-void parse_scroll_copyrect(void);
-void parse_fixscreen(void);
-void parse_wireframe(void);
-
-void set_wirecopyrect_mode(char *str);
-void set_scrollcopyrect_mode(char *str);
-void initialize_scroll_keys(void);
-void initialize_scroll_matches(void);
-void initialize_scroll_term(void);
-void initialize_max_keyrepeat(void);
-
-int direct_fb_copy(int x1, int y1, int x2, int y2, int mark);
-void fb_push(void);
-int fb_push_wait(double max_wait, int flags);
-void eat_viewonly_input(int max_eat, int keep);
-
-void mark_for_xdamage(int x, int y, int w, int h);
-void mark_region_for_xdamage(sraRegionPtr region);
-void set_xdamage_mark(int x, int y, int w, int h);
-int near_wm_edge(int x, int y, int w, int h, int px, int py);
-int near_scrollbar_edge(int x, int y, int w, int h, int px, int py);
-
-void check_fixscreen(void);
-int check_xrecord(void);
-int check_wireframe(void);
-int fb_update_sent(int *count);
-int check_user_input(double dt, double dtr, int tile_diffs, int *cnt);
-void do_copyregion(sraRegionPtr region, int dx, int dy, int mode);
-
-int check_ncache(int reset, int mode);
-int find_rect(int idx, int x, int y, int w, int h);
-int bs_restore(int idx, int *nbatch, sraRegionPtr rmask, XWindowAttributes *attr, int clip, int nopad, int *valid, int verb);
-int try_to_fix_su(Window win, int idx, Window above, int *nbatch, char *mode);
-int try_to_fix_resize_su(Window orig_frame, int orig_x, int orig_y, int orig_w, int orig_h,
-    int x, int y, int w, int h, int try_batch);
-int lookup_win_index(Window);
-void set_ncache_xrootpmap(void);
-
-static void get_client_regions(int *req, int *mod, int *cpy, int *num) ;
-static void parse_scroll_copyrect_str(char *scr);
-static void parse_wireframe_str(char *wf);
-static void destroy_str_list(char **list);
-static void draw_box(int x, int y, int w, int h, int restore);
-static int do_bdpush(Window wm_win, int x0, int y0, int w0, int h0, int bdx,
-    int bdy, int bdskinny);
-static int set_ypad(void);
-static void scale_mark(int x1, int y1, int x2, int y2, int mark);
-static int push_scr_ev(double *age, int type, int bdpush, int bdx, int bdy,
-    int bdskinny, int first_push);
-static int crfix(int x, int dx, int Lx);
-static int scrollability(Window win, int set);
-static int eat_pointer(int max_ptr_eat, int keep);
-static void set_bdpush(int type, double *last_bdpush, int *pushit);
-static int repeat_check(double last_key_scroll);
-static int check_xrecord_keys(void);
-static int check_xrecord_mouse(void);
-static int try_copyrect(Window orig_frame, Window frame, int x, int y, int w, int h,
-    int dx, int dy, int *obscured, sraRegionPtr extra_clip, double max_wait, int *nbatch);
-static int wireframe_mod_state();
-static void check_user_input2(double dt);
-static void check_user_input3(double dt, double dtr, int tile_diffs);
-static void check_user_input4(double dt, double dtr, int tile_diffs);
-
-winattr_t *cache_list;
-
-/*
- * For -wireframe: find the direct child of rootwin that has the
- * pointer, assume that is the WM frame that contains the application
- * (i.e. wm reparents the app toplevel) return frame position and size
- * if successful.
- */
-int get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
-    Window *frame, Window *win) {
-#if !NO_X11
-	Window r, c;
-	XWindowAttributes attr;
-	Bool ret;
-	int rootx, rooty, wx, wy;
-	unsigned int mask;
-#endif
-
-#ifdef MACOSX
-	if (macosx_console) {
-		return macosx_get_wm_frame_pos(px, py, x, y, w, h, frame, win);
-	}
-#endif
-
-	RAWFB_RET(0)
-
-#if NO_X11
-	if (!px || !py || !x || !y || !w || !h || !frame || !win) {}
-	return 0;
-#else
-
-
-	ret = XQueryPointer_wr(dpy, rootwin, &r, &c, &rootx, &rooty, &wx, &wy,
-	    &mask);
-
-	*frame = c;
-
-	/* current pointer position is returned too */
-	*px = rootx;
-	*py = rooty;
-
-	if (!ret || ! c || c == rootwin) {
-		/* no immediate child */
-		return 0;
-	}
-
-	/* child window position and size */
-	if (! valid_window(c, &attr, 1)) {
-		return 0;
-	}
-
-	*x = attr.x;
-	*y = attr.y;
-	*w = attr.width;
-	*h = attr.height;
-
-#if 0
-	/* more accurate, but the animation is bogus anyway */
-	if (attr.border_width > 0) {
-		*w += 2 * attr.border_width;
-		*h += 2 * attr.border_width;
-	}
-#endif
-
-	if (win != NULL) {
-		*win = descend_pointer(5, c, NULL, 0);
-	}
-
-	return 1;
-#endif	/* NO_X11 */
-}
-
-static int scrollcopyrect_top, scrollcopyrect_bot;
-static int scrollcopyrect_left, scrollcopyrect_right;
-static double scr_key_time, scr_key_persist;
-static double scr_mouse_time, scr_mouse_persist, scr_mouse_maxtime;
-static double scr_mouse_pointer_delay;
-static double scr_key_bdpush_time, scr_mouse_bdpush_time;
-
-static void parse_scroll_copyrect_str(char *scr) {
-	char *p, *str;
-	int i;
-	char *part[16];
-
-	for (i=0; i<16; i++) {
-		part[i] = NULL;
-	}
-
-	if (scr == NULL || *scr == '\0') {
-		return;
-	}
-
-	str = strdup(scr);
-
-	p = strtok(str, ",");
-	i = 0;
-	while (p) {
-		part[i++] = strdup(p);
-		p = strtok(NULL, ",");
-		if (i >= 16) break;
-	}
-	free(str);
-
-
-	/*
-	 * Top, Bottom, Left, Right tolerances for scrollbar locations.
-	 */
-	if ((str = part[0]) != NULL) {
-		int t, b, l, r;
-		if (sscanf(str, "%d+%d+%d+%d", &t, &b, &l, &r) == 4) {
-			scrollcopyrect_top   = t;
-			scrollcopyrect_bot   = b;
-			scrollcopyrect_left  = l;
-			scrollcopyrect_right = r;
-		}
-		free(str);
-	}
-
-	/* key scrolling timing heuristics. */
-	if ((str = part[1]) != NULL) {
-		double t1, t2, t3;
-		if (sscanf(str, "%lf+%lf+%lf", &t1, &t2, &t3) == 3) {
-			scr_key_time = t1;
-			scr_key_persist = t2;
-			scr_key_bdpush_time = t3;
-		}
-		free(str);
-	}
-
-	/* mouse scrolling timing heuristics. */
-	if ((str = part[2]) != NULL) {
-		double t1, t2, t3, t4, t5;
-		if (sscanf(str, "%lf+%lf+%lf+%lf+%lf", &t1, &t2, &t3, &t4,
-		    &t5) == 5) {
-			scr_mouse_time = t1;
-			scr_mouse_persist = t2;
-			scr_mouse_bdpush_time = t3;
-			scr_mouse_pointer_delay = t4;
-			scr_mouse_maxtime = t5;
-		}
-		free(str);
-	}
-}
-
-void parse_scroll_copyrect(void) {
-	parse_scroll_copyrect_str(SCROLL_COPYRECT_PARMS);
-	if (! scroll_copyrect_str) {
-		scroll_copyrect_str = strdup(SCROLL_COPYRECT_PARMS);
-	}
-	parse_scroll_copyrect_str(scroll_copyrect_str);
-}
-
-void parse_fixscreen(void) {
-	char *str, *p;
-
-	screen_fixup_V = 0.0;
-	screen_fixup_C = 0.0;
-	screen_fixup_X = 0.0;
-	screen_fixup_8 = 0.0;
-
-	if (! screen_fixup_str) {
-		return;
-	}
-
-	str = strdup(screen_fixup_str);
-
-	p = strtok(str, ",");
-	while (p) {
-		double t;
-		if (*p == 'V' && sscanf(p, "V=%lf", &t) == 1) {
-			screen_fixup_V = t;
-		} else if (*p == 'C' && sscanf(p, "C=%lf", &t) == 1) {
-			screen_fixup_C = t;
-		} else if (*p == 'X' && sscanf(p, "X=%lf", &t) == 1) {
-			screen_fixup_X = t;
-		} else if (*p == 'X' && sscanf(p, "8=%lf", &t) == 1) {
-			screen_fixup_8 = t;
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-
-	if (screen_fixup_V < 0.0) screen_fixup_V = 0.0;
-	if (screen_fixup_C < 0.0) screen_fixup_C = 0.0;
-	if (screen_fixup_X < 0.0) screen_fixup_X = 0.0;
-	if (screen_fixup_8 < 0.0) screen_fixup_8 = 0.0;
-}
-
-/*
-WIREFRAME_PARMS "0xff,2,0,30+6+6+6,Alt,0.05+0.3+2.0,8"
-                 0xff,2,0,32+8+8+8,all,0.15+0.30+5.0+0.125
-shade,linewidth,percent,T+B+L+R,mods,t1+t2+t3+t4
- */
-#define LW_MAX 8
-static unsigned long wireframe_shade = 0xff;
-static int wireframe_lw;
-static double wireframe_frac;
-static int wireframe_top, wireframe_bot, wireframe_left, wireframe_right;
-static double wireframe_t1, wireframe_t2, wireframe_t3, wireframe_t4;
-static char *wireframe_mods = NULL;
-
-/*
- * Parse the gory -wireframe string for parameters.
- */
-static void parse_wireframe_str(char *wf) {
-	char *p, *str;
-	int i;
-	char *part[16];
-
-	for (i=0; i<16; i++) {
-		part[i] = NULL;
-	}
-
-	if (wf == NULL || *wf == '\0') {
-		return;
-	}
-
-	str = strdup(wf);
-
-	/* leading ",", make it start with ignorable string "z" */
-	if (*str == ',') {
-		char *tmp = (char *) malloc(strlen(str)+2);	
-		strcpy(tmp, "z");
-		strcat(tmp, str);
-		free(str);
-		str = tmp;
-	}
-
-	p = strtok(str, ",");
-	i = 0;
-	while (p) {
-		part[i++] = strdup(p);
-		p = strtok(NULL, ",");
-		if (i >= 16) break;
-	}
-	free(str);
-
-
-	/* Wireframe shade, color, RGB: */
-	if ((str = part[0]) != NULL) {
-		unsigned long n;
-		int r, g, b, ok = 0;
-		XColor cdef;
-		Colormap cmap;
-		if (dpy && (bpp == 32 || bpp == 16)) {
-#if !NO_X11
-			X_LOCK;
-		 	cmap = DefaultColormap (dpy, scr);
-			if (XParseColor(dpy, cmap, str, &cdef) &&
-			    XAllocColor(dpy, cmap, &cdef)) {
-				r = cdef.red   >> 8;
-				g = cdef.green >> 8;
-				b = cdef.blue  >> 8;
-				if (r == 0 && g == 0) {
-					g = 1;	/* need to be > 255 */
-				}
-				n = 0;
-				n |= (r << main_red_shift);
-				n |= (g << main_green_shift);
-				n |= (b << main_blue_shift);
-				wireframe_shade = n;
-				ok = 1;
-			}
-			X_UNLOCK;
-#else
-			r = g = b = 0;
-			cmap = 0;
-			cdef.pixel = 0;
-#endif
-		}
-		if (ok) {
-			;
-		} else if (sscanf(str, "0x%lx", &n) == 1) {
-			wireframe_shade = n;	
-		} else if (sscanf(str, "%lu", &n) == 1) {
-			wireframe_shade = n;	
-		} else if (sscanf(str, "%lx", &n) == 1) {
-			wireframe_shade = n;	
-		}
-		free(str);
-	}
-
-	/* linewidth: # of pixels wide for the wireframe lines */
-	if ((str = part[1]) != NULL) {
-		int n;
-		if (sscanf(str, "%d", &n) == 1) {
-			wireframe_lw = n;	
-			if (wireframe_lw < 1) {
-				wireframe_lw = 1; 
-			}
-			if (wireframe_lw > LW_MAX) {
-				wireframe_lw = LW_MAX; 
-			}
-		}
-		free(str);
-	}
-
-	/* percentage cutoff for opaque move/resize (like WM's) */
-	if ((str = part[2]) != NULL) {
-		if (*str == '\0') {
-			;
-		} else if (strchr(str, '.')) {
-			wireframe_frac = atof(str);
-		} else {
-			wireframe_frac = ((double) atoi(str))/100.0;
-		}
-		free(str);
-	}
-
-	/*
-	 * Top, Bottom, Left, Right tolerances to guess the wm frame is
-	 * being grabbed (Top is traditionally bigger, i.e. titlebar):
-	 */
-	if ((str = part[3]) != NULL) {
-		int t, b, l, r;
-		if (sscanf(str, "%d+%d+%d+%d", &t, &b, &l, &r) == 4) {
-			wireframe_top   = t;
-			wireframe_bot   = b;
-			wireframe_left  = l;
-			wireframe_right = r;
-		}
-		free(str);
-	}
-
-	/*
-	 * wireframe in interior with Modifier down.
-	 * 0 => no mods
-	 * 1 => all mods
-	 * Shift,Alt,Control,Meta,Super,Hyper
-	 */
-	if (wireframe_mods) {
-		free(wireframe_mods);
-	}
-	wireframe_mods = NULL;
-	if ((str = part[4]) != NULL) {
-		if (*str == '0' || !strcmp(str, "none")) {
-			;
-		} else if (*str == '1' || !strcmp(str, "all")) {
-			wireframe_mods = strdup("all");	
-		} else if (!strcmp(str, "Alt") || !strcmp(str, "Shift")
-		    || !strcmp(str, "Control") || !strcmp(str, "Meta")
-		    || !strcmp(str, "Super") || !strcmp(str, "Hyper")) {
-			wireframe_mods = strdup(str);
-		}
-	}
-
-	/* check_wireframe() timing heuristics. */
-	if ((str = part[5]) != NULL) {
-		double t1, t2, t3, t4;
-		if (sscanf(str, "%lf+%lf+%lf+%lf", &t1, &t2, &t3, &t4) == 4) {
-			wireframe_t1 = t1;
-			wireframe_t2 = t2;
-			wireframe_t3 = t3;
-			wireframe_t4 = t4;
-		}
-		free(str);
-	}
-}
-
-/*
- * First parse the defaults and apply any user supplied ones (may be a subset)
- */
-void parse_wireframe(void) {
-	parse_wireframe_str(WIREFRAME_PARMS);
-	if (! wireframe_str) {
-		wireframe_str = strdup(WIREFRAME_PARMS);
-	}
-	parse_wireframe_str(wireframe_str);
-}
-
-/*
- * Set wireframe_copyrect based on desired mode.
- */
-void set_wirecopyrect_mode(char *str) {
-	char *orig = wireframe_copyrect;
-	if (str == NULL || *str == '\0') {
-		wireframe_copyrect = strdup(wireframe_copyrect_default);
-	} else if (!strcmp(str, "always") || !strcmp(str, "all")) {
-		wireframe_copyrect = strdup("always");
-	} else if (!strcmp(str, "top")) {
-		wireframe_copyrect = strdup("top");
-	} else if (!strcmp(str, "never") || !strcmp(str, "none")) {
-		wireframe_copyrect = strdup("never");
-	} else {
-		if (! wireframe_copyrect) {
-			wireframe_copyrect = strdup(wireframe_copyrect_default);
-		} else {
-			orig = NULL;
-		}
-		rfbLog("unknown -wirecopyrect mode: %s, using: %s\n", str,
-		    wireframe_copyrect);
-	}
-	if (orig) {
-		free(orig);
-	}
-}
-
-/*
- * Set scroll_copyrect based on desired mode.
- */
-void set_scrollcopyrect_mode(char *str) {
-	char *orig = scroll_copyrect;
-	if (str == NULL || *str == '\0') {
-		scroll_copyrect = strdup(scroll_copyrect_default);
-	} else if (!strcmp(str, "always") || !strcmp(str, "all") ||
-		    !strcmp(str, "both")) {
-		scroll_copyrect = strdup("always");
-	} else if (!strcmp(str, "keys") || !strcmp(str, "keyboard")) {
-		scroll_copyrect = strdup("keys");
-	} else if (!strcmp(str, "mouse") || !strcmp(str, "pointer")) {
-		scroll_copyrect = strdup("mouse");
-	} else if (!strcmp(str, "never") || !strcmp(str, "none")) {
-		scroll_copyrect = strdup("never");
-	} else {
-		if (! scroll_copyrect) {
-			scroll_copyrect = strdup(scroll_copyrect_default);
-		} else {
-			orig = NULL;
-		}
-		rfbLog("unknown -scrollcopyrect mode: %s, using: %s\n", str,
-		    scroll_copyrect);
-	}
-	if (orig) {
-		free(orig);
-	}
-}
-
-void initialize_scroll_keys(void) {
-	char *str, *p;
-	int i, nkeys = 0, saw_builtin = 0;
-	int ks_max = 2 * 0xFFFF;
-
-	if (scroll_key_list) {
-		free(scroll_key_list);
-		scroll_key_list = NULL;
-	}
-	if (! scroll_key_list_str || *scroll_key_list_str == '\0') {
-		return;
-	}
-
-	if (strstr(scroll_key_list_str, "builtin")) {
-		int k;
-		/* add in number of keysyms builtin gives */
-		for (k=1; k<ks_max; k++)  {
-			if (xrecord_scroll_keysym((rfbKeySym) k)) {
-				nkeys++;
-			}
-		}
-	}
-
-	nkeys++;	/* first key, i.e. no commas. */
-	p = str = strdup(scroll_key_list_str);
-	while(*p) {
-		if (*p == ',') {
-			nkeys++;	/* additional key. */
-		}
-		p++;
-	}
-	
-	nkeys++;	/* exclude/include 0 element */
-	nkeys++;	/* trailing NoSymbol */
-
-	scroll_key_list = (KeySym *) malloc(nkeys*sizeof(KeySym)); 
-	for (i=0; i<nkeys; i++) {
-		scroll_key_list[i] = NoSymbol;
-	}
-	if (*str == '-') {
-		scroll_key_list[0] = 1;
-		p = strtok(str+1, ",");
-	} else {
-		p = strtok(str, ",");
-	}
-	i = 1;
-	while (p) {
-		if (!strcmp(p, "builtin")) {
-			int k;
-			if (saw_builtin) {
-				p = strtok(NULL, ",");
-				continue;
-			}
-			saw_builtin = 1;
-			for (k=1; k<ks_max; k++)  {
-				if (xrecord_scroll_keysym((rfbKeySym) k)) {
-					scroll_key_list[i++] = (rfbKeySym) k;
-				}
-			}
-		} else {
-			unsigned int in;
-			if (sscanf(p, "%u", &in) == 1) {
-				scroll_key_list[i++] = (rfbKeySym) in;
-			} else if (sscanf(p, "0x%x", &in) == 1) {
-				scroll_key_list[i++] = (rfbKeySym) in;
-			} else if (XStringToKeysym(p) != NoSymbol) { 
-				scroll_key_list[i++] = XStringToKeysym(p);
-			} else {
-				rfbLog("initialize_scroll_keys: skip unknown "
-				    "keysym: %s\n", p);
-			}
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-}
-
-static void destroy_str_list(char **list) {
-	int i = 0;
-	if (! list) {
-		return;
-	}
-	while (list[i] != NULL) {
-		free(list[i++]);
-	}
-	free(list);
-}
-
-void initialize_scroll_matches(void) {
-	char *str, *imp = "__IMPOSSIBLE_STR__";
-	int i, n, nkey, nmouse;
-
-	destroy_str_list(scroll_good_all);
-	scroll_good_all = NULL;
-	destroy_str_list(scroll_good_key);
-	scroll_good_key = NULL;
-	destroy_str_list(scroll_good_mouse);
-	scroll_good_mouse = NULL;
-
-	destroy_str_list(scroll_skip_all);
-	scroll_skip_all = NULL;
-	destroy_str_list(scroll_skip_key);
-	scroll_skip_key = NULL;
-	destroy_str_list(scroll_skip_mouse);
-	scroll_skip_mouse = NULL;
-
-	/* scroll_good: */
-	if (scroll_good_str != NULL && *scroll_good_str != '\0') {
-		str = scroll_good_str;
-	} else {
-		str = scroll_good_str0;
-	}
-	scroll_good_all = create_str_list(str);
-
-	nkey = 0;
-	nmouse = 0;
-	n = 0;
-	while (scroll_good_all[n] != NULL) {
-		char *s = scroll_good_all[n++];
-		if (strstr(s, "KEY:") == s) nkey++;
-		if (strstr(s, "MOUSE:") == s) nmouse++;
-	}
-	if (nkey++) {
-		scroll_good_key = (char **) malloc(nkey*sizeof(char *));
-		for (i=0; i<nkey; i++) scroll_good_key[i] = NULL;
-	}
-	if (nmouse++) {
-		scroll_good_mouse = (char **) malloc(nmouse*sizeof(char *));
-		for (i=0; i<nmouse; i++) scroll_good_mouse[i] = NULL;
-	}
-	nkey = 0;
-	nmouse = 0;
-	for (i=0; i<n; i++) {
-		char *s = scroll_good_all[i];
-		if (strstr(s, "KEY:") == s) {
-			scroll_good_key[nkey++] = strdup(s+strlen("KEY:"));
-			free(s);
-			scroll_good_all[i] = strdup(imp);
-		} else if (strstr(s, "MOUSE:") == s) {
-			scroll_good_mouse[nmouse++]=strdup(s+strlen("MOUSE:"));
-			free(s);
-			scroll_good_all[i] = strdup(imp);
-		}
-	}
-
-	/* scroll_skip: */
-	if (scroll_skip_str != NULL && *scroll_skip_str != '\0') {
-		str = scroll_skip_str;
-	} else {
-		str = scroll_skip_str0;
-	}
-	scroll_skip_all = create_str_list(str);
-
-	nkey = 0;
-	nmouse = 0;
-	n = 0;
-	while (scroll_skip_all[n] != NULL) {
-		char *s = scroll_skip_all[n++];
-		if (strstr(s, "KEY:") == s) nkey++;
-		if (strstr(s, "MOUSE:") == s) nmouse++;
-	}
-	if (nkey++) {
-		scroll_skip_key = (char **) malloc(nkey*sizeof(char *));
-		for (i=0; i<nkey; i++) scroll_skip_key[i] = NULL;
-	}
-	if (nmouse++) {
-		scroll_skip_mouse = (char **) malloc(nmouse*sizeof(char *));
-		for (i=0; i<nmouse; i++) scroll_skip_mouse[i] = NULL;
-	}
-	nkey = 0;
-	nmouse = 0;
-	for (i=0; i<n; i++) {
-		char *s = scroll_skip_all[i];
-		if (strstr(s, "KEY:") == s) {
-			scroll_skip_key[nkey++] = strdup(s+strlen("KEY:"));
-			free(s);
-			scroll_skip_all[i] = strdup(imp);
-		} else if (strstr(s, "MOUSE:") == s) {
-			scroll_skip_mouse[nmouse++]=strdup(s+strlen("MOUSE:"));
-			free(s);
-			scroll_skip_all[i] = strdup(imp);
-		}
-	}
-}
-
-void initialize_scroll_term(void) {
-	char *str;
-	int n;
-
-	destroy_str_list(scroll_term);
-	scroll_term = NULL;
-
-	if (scroll_term_str != NULL && *scroll_term_str != '\0') {
-		str = scroll_term_str;
-	} else {
-		str = scroll_term_str0;
-	}
-	if (!strcmp(str, "none")) {
-		return;
-	}
-	scroll_term = create_str_list(str);
-
-	n = 0;
-	while (scroll_term[n] != NULL) {
-		char *s = scroll_good_all[n++];
-		/* pull parameters out at some point */
-		s = NULL;
-	}
-}
-
-void initialize_max_keyrepeat(void) {
-	char *str;
-	int lo, hi;
-
-	if (max_keyrepeat_str != NULL && *max_keyrepeat_str != '\0') {
-		str = max_keyrepeat_str;
-	} else {
-		str = max_keyrepeat_str0;
-	}
-
-	if (sscanf(str, "%d-%d", &lo, &hi) != 2) {
-		rfbLog("skipping invalid -scr_keyrepeat string: %s\n", str);
-		sscanf(max_keyrepeat_str0, "%d-%d", &lo, &hi);
-	}
-	max_keyrepeat_lo = lo;
-	max_keyrepeat_hi = hi;
-	if (max_keyrepeat_lo < 1) {
-		max_keyrepeat_lo = 1;
-	}
-	if (max_keyrepeat_hi > 40) {
-		max_keyrepeat_hi = 40;
-	}
-}
-
-typedef struct saveline {
-	int x0, y0, x1, y1;
-	int shift;
-	int vert;
-	int saved;
-	char *data;
-} saveline_t;
-
-/*
- * Draw the wireframe box onto the framebuffer.  Saves the real
- * framebuffer data to some storage lines.  Restores previous lines.
- * use restore = 1 to clean up (done with animation).
- * This works with -scale.
- */
-static void draw_box(int x, int y, int w, int h, int restore) {
-	int x0, y0, x1, y1, i, pixelsize = bpp/8;
-	char *dst, *src, *use_fb;
-	static saveline_t *save[4];
-	static int first = 1, len = 0;
-	int max = dpy_x > dpy_y ? dpy_x : dpy_y;
-	int use_Bpl, lw = wireframe_lw;
-	unsigned long shade = wireframe_shade;
-	int color = 0;
-	unsigned short us = 0;
-	unsigned long ul = 0;
-
-	if (clipshift) {
-		x -= coff_x;
-		y -= coff_y;
-	}
-
-	/* handle -8to24 mode: use 2nd fb only */
-	use_fb  = main_fb;
-	use_Bpl = main_bytes_per_line; 
-	
-	if (cmap8to24 && cmap8to24_fb) {
-		use_fb = cmap8to24_fb;
-		pixelsize = 4;
-		if (depth <= 8) {
-			use_Bpl *= 4;
-		} else if (depth <= 16) {
-			use_Bpl *= 2;
-		}
-	}
-
-	if (max > len) {
-		/* create/resize storage lines: */
-		for (i=0; i<4; i++) {
-			len = max;
-			if (! first && save[i]) {
-				if (save[i]->data) {
-					free(save[i]->data);
-					save[i]->data = NULL;
-				}
-				free(save[i]);
-			}
-			save[i] = (saveline_t *) malloc(sizeof(saveline_t));
-			save[i]->saved = 0;
-			save[i]->data = (char *) malloc( (LW_MAX+1)*len*4 );
-
-			/* 
-			 * Four types of lines:
-			 *	0) top horizontal
-			 *	1) bottom horizontal
-			 *	2) left vertical
-			 *	3) right vertical
-			 *
-			 * shift means shifted by width or height.
-			 */
-			if (i == 0) {
-				save[i]->vert  = 0;
-				save[i]->shift = 0;
-			} else if (i == 1) {
-				save[i]->vert  = 0;
-				save[i]->shift = 1;
-			} else if (i == 2) {
-				save[i]->vert  = 1;
-				save[i]->shift = 0;
-			} else if (i == 3) {
-				save[i]->vert  = 1;
-				save[i]->shift = 1;
-			}
-		}
-	}
-	first = 0;
-
-	/*
-	 * restore any saved lines. see below for algorithm and
-	 * how x0, etc. are used.  we just reverse those steps.
-	 */
-	for (i=0; i<4; i++) {
-		int s = save[i]->shift;
-		int yu, y_min = -1, y_max = -1;
-		int y_start, y_stop, y_step;
-
-		if (! save[i]->saved) {
-			continue;
-		}
-		x0 = save[i]->x0;
-		y0 = save[i]->y0;
-		x1 = save[i]->x1;
-		y1 = save[i]->y1;
-		if (save[i]->vert) {
-			y_start = y0+lw;
-			y_stop  = y1-lw;
-			y_step  = lw*pixelsize;
-		} else {
-			y_start = y0 - s*lw;
-			y_stop  = y_start + lw;
-			y_step  = max*pixelsize;
-		}
-		for (yu = y_start; yu < y_stop; yu++) {
-			if (x0 == x1) {
-				continue;
-			}
-			if (yu < 0 || yu >= dpy_y) {
-				continue;
-			}
-			if (y_min < 0 || yu < y_min) {
-				y_min = yu;
-			}
-			if (y_max < 0 || yu > y_max) {
-				y_max = yu;
-			}
-			src = save[i]->data + (yu-y_start)*y_step;
-			dst = use_fb + yu*use_Bpl + x0*pixelsize;
-			memcpy(dst, src, (x1-x0)*pixelsize);
-		}
-		if (y_min >= 0) {
-if (0) fprintf(stderr, "Mark-1 %d %d %d %d\n", x0, y_min, x1, y_max+1);
-			mark_rect_as_modified(x0, y_min, x1, y_max+1, 0);
-		}
-		save[i]->saved = 0;
-	}
-
-if (0) fprintf(stderr, "  DrawBox: %04dx%04d+%04d+%04d B=%d rest=%d lw=%d %.4f\n", w, h, x, y, 2*(w+h)*(2-restore)*pixelsize*lw, restore, lw, dnowx());
-
-	if (restore) {
-		return;
-	}
-
-
-	/*
-	 * work out shade/color for the wireframe line, could be a color
-	 * for 16bpp or 24bpp.
-	 */
-	if (shade > 255) {
-		if (pixelsize == 2) {
-			us = (unsigned short) (shade & 0xffff);
-			color = 1;
-		} else if (pixelsize == 4) {
-			ul = (unsigned long) shade;
-			color = 1;
-		} else {
-			shade = shade % 256;
-		}
-	}
-
-	for (i=0; i<4; i++)  {
-		int s = save[i]->shift;
-		int yu, y_min = -1, y_max = -1;
-		int yblack = -1, xblack1 = -1, xblack2 = -1;
-		int y_start, y_stop, y_step;
-
-		if (save[i]->vert) {
-			/*
-			 * make the narrow x's be on the screen, let
-			 * the y's hang off (not drawn).
-			 */
-			save[i]->x0 = x0 = nfix(x + s*w - s*lw, dpy_x);
-			save[i]->y0 = y0 = y;
-			save[i]->x1 = x1 = nfix(x + s*w - s*lw + lw, dpy_x);
-			save[i]->y1 = y1 = y + h;
-
-			/*
-			 * start and stop a linewidth away from true edge,
-			 * to avoid interfering with horizontal lines.
-			 */
-			y_start = y0+lw;
-			y_stop  = y1-lw;
-			y_step  = lw*pixelsize;
-
-			/* draw a black pixel for the border if lw > 1 */
-			if (s) {
-				xblack1 = x1-1;
-			} else {
-				xblack1 = x0;
-			}
-		} else {
-			/*
-			 * make the wide x's be on the screen, let the y's
-			 * hang off (not drawn).
-			 */
-			save[i]->x0 = x0 = nfix(x,     dpy_x);
-			save[i]->y0 = y0 = y + s*h;
-			save[i]->x1 = x1 = nfix(x + w, dpy_x);
-			save[i]->y1 = y1 = y0 + lw;
-			y_start = y0 - s*lw;
-			y_stop  = y_start + lw;
-			y_step  = max*pixelsize;
-
-			/* draw a black pixels for the border if lw > 1 */
-			if (s) {
-				yblack = y_stop - 1;
-			} else {
-				yblack = y_start;
-			}
-			xblack1 = x0;
-			xblack2 = x1-1;
-		}
-
-		/* now loop over the allowed y's for either case */
-		for (yu = y_start; yu < y_stop; yu++) {
-			if (x0 == x1) {
-				continue;
-			}
-			if (yu < 0 || yu >= dpy_y) {
-				continue;
-			}
-
-			/* record min and max y's for marking rectangle: */
-			if (y_min < 0 || yu < y_min) {
-				y_min = yu;
-			}
-			if (y_max < 0 || yu > y_max) {
-				y_max = yu;
-			}
-
-			/* save fb data for this line: */
-			save[i]->saved = 1;
-			src = use_fb + yu*use_Bpl + x0*pixelsize;
-			dst = save[i]->data + (yu-y_start)*y_step;
-			memcpy(dst, src, (x1-x0)*pixelsize);
-
-			/* apply the shade/color to make the wireframe line: */
-			if (! color) {
-				memset(src, shade, (x1-x0)*pixelsize);
-			} else {
-				char *csrc = src;
-				unsigned short *usp;
-				unsigned long *ulp;
-				int k;
-				for (k=0; k < x1 - x0; k++) {
-					if (pixelsize == 4) {
-						ulp = (unsigned long *)csrc;
-						*ulp = ul;
-					} else if (pixelsize == 2) {
-						usp = (unsigned short *)csrc;
-						*usp = us;
-					}
-					csrc += pixelsize;
-				}
-			}
-
-			/* apply black border for lw >= 2 */
-			if (lw > 1) {
-				if (yu == yblack) {
-					memset(src, 0, (x1-x0)*pixelsize);
-				}
-				if (xblack1 >= 0) {
-					src = src + (xblack1 - x0)*pixelsize;
-					memset(src, 0, pixelsize);
-				}
-				if (xblack2 >= 0) {
-					src = src + (xblack2 - x0)*pixelsize;
-					memset(src, 0, pixelsize);
-				}
-			}
-		}
-		/* mark it for sending: */
-		if (save[i]->saved) {
-if (0) fprintf(stderr, "Mark-2 %d %d %d %d\n", x0, y_min, x1, y_max+1);
-			mark_rect_as_modified(x0, y_min, x1, y_max+1, 0);
-		}
-	}
-}
-
-int direct_fb_copy(int x1, int y1, int x2, int y2, int mark) {
-	char *src, *dst;
-	int y, pixelsize = bpp/8;
-	int xmin = -1, xmax = -1, ymin = -1, ymax = -1;
-	int do_cmp = 2;
-	double tm;
-	int db = 0;
-
-if (db) dtime0(&tm);
-
-	x1 = nfix(x1, dpy_x);
-	y1 = nfix(y1, dpy_y);
-	x2 = nfix(x2, dpy_x+1);
-	y2 = nfix(y2, dpy_y+1);
-
-	if (x1 == x2) {
-		return 1;
-	}
-	if (y1 == y2) {
-		return 1;
-	}
-
-	X_LOCK;
-	for (y = y1; y < y2; y++) {
-		XRANDR_SET_TRAP_RET(0, "direct_fb_copy-set");
-		copy_image(scanline, x1, y, x2 - x1, 1);
-		XRANDR_CHK_TRAP_RET(0, "direct_fb_copy-chk");
-		
-		src = scanline->data;
-		dst = main_fb + y * main_bytes_per_line + x1 * pixelsize;
-
-		if (do_cmp == 0 || !mark) {
-			memcpy(dst, src, (x2 - x1)*pixelsize);
-
-		} else if (do_cmp == 1) {
-			if (memcmp(dst, src, (x2 - x1)*pixelsize)) {
-				if (ymin == -1 || y < ymin) {
-					ymin = y;
-				}
-				if (ymax == -1 || y > ymax) {
-					ymax = y;
-				}
-				memcpy(dst, src, (x2 - x1)*pixelsize);
-			}
-
-		} else if (do_cmp == 2) {
-			int n, shift, xlo, xhi, k, block = 32;
-			char *dst2, *src2;
-
-			for (k=0; k*block < (x2 - x1); k++) {
-				shift = k*block;
-				xlo = x1  + shift;
-				xhi = xlo + block;
-				if (xhi > x2) {
-					xhi = x2;
-				}
-				n = xhi - xlo;
-				if (n < 1) {
-					continue;
-				}
-				src2 = src + shift*pixelsize;
-				dst2 = dst + shift*pixelsize;
-				if (memcmp(dst2, src2, n*pixelsize)) {
-					if (ymin == -1 || y < ymin) {
-						ymin = y;
-					}
-					if (ymax == -1 || y > ymax) {
-						ymax = y;
-					}
-					if (xmin == -1 || xlo < xmin) {
-						xmin = xlo;
-					}
-					if (xmax == -1 || xhi > xmax) {
-						xmax = xhi;
-					}
-					memcpy(dst2, src2, n*pixelsize);
-				}
-			}
-		}
-	}
-	X_UNLOCK;
-
-	if (do_cmp == 0) {
-		xmin = x1;
-		ymin = y1;
-		xmax = x2;
-		ymax = y2;
-	} else if (do_cmp == 1) {
-		xmin = x1;
-		xmax = x2;
-	}
-
-	if (xmin < 0 || ymin < 0 || xmax < 0 || xmin < 0) {
-		/* no diffs */
-		return 1;
-	}
-
-	if (xmax < x2) {
-		xmax++;
-	}
-	if (ymax < y2) {
-		ymax++;
-	}
-
-	if (mark) {
-		mark_rect_as_modified(xmin, ymin, xmax, ymax, 0);
-	}
-
- if (db) {
-	fprintf(stderr, "direct_fb_copy: %dx%d+%d+%d - %d  %.4f\n",
-		x2 - x1, y2 - y1, x1, y1, mark, dtime(&tm));
- }
-
-	return 1;
-}
-
-static int do_bdpush(Window wm_win, int x0, int y0, int w0, int h0, int bdx,
-    int bdy, int bdskinny) {
-
-	XWindowAttributes attr;
-	sraRectangleIterator *iter;
-	sraRect rect;
-	sraRegionPtr frame, whole, tmpregion;
-	int tx1, ty1, tx2, ty2;
-	static Window last_wm_win = None;
-	static int last_x, last_y, last_w, last_h;
-	int do_fb_push = 0;
-	int db = debug_scroll;
-
-	if (wm_win == last_wm_win) {
-		attr.x = last_x;
-		attr.y = last_y;
-		attr.width = last_w;
-		attr.height = last_h;
-	} else {
-		if (!valid_window(wm_win, &attr, 1)) {
-			return do_fb_push;
-		}
-		last_wm_win = wm_win;
-		last_x = attr.x;
-		last_y = attr.y;
-		last_w = attr.width;
-		last_h = attr.height;
-	}
-if (db > 1) fprintf(stderr, "BDP  %d %d %d %d  %d %d %d  %d %d %d %d\n",
-	x0, y0, w0, h0, bdx, bdy, bdskinny, last_x, last_y, last_w, last_h);
-
-	/* wm frame: */
-	tx1 = attr.x;
-	ty1 = attr.y;
-	tx2 = attr.x + attr.width;
-	ty2 = attr.y + attr.height;
-
-	whole = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	if (clipshift) {
-		sraRgnOffset(whole, coff_x, coff_y);
-	}
-	if (subwin) {
-		sraRgnOffset(whole, off_x, off_y);
-	}
-	frame = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-	sraRgnAnd(frame, whole);
-
-	/* scrolling window: */
-	tmpregion = sraRgnCreateRect(x0, y0, x0 + w0, y0 + h0);
-	sraRgnAnd(tmpregion, whole);
-
-	sraRgnSubtract(frame, tmpregion);
-	sraRgnDestroy(tmpregion);
-
-	if (!sraRgnEmpty(frame)) {
-		double dt = 0.0, dm;
-		dtime0(&dm);
-		iter = sraRgnGetIterator(frame);
-		while (sraRgnIteratorNext(iter, &rect)) {
-			tx1 = rect.x1;
-			ty1 = rect.y1;
-			tx2 = rect.x2;
-			ty2 = rect.y2;
-
-			if (bdskinny > 0) {
-				int ok = 0;
-				if (nabs(ty2-ty1) <= bdskinny) {
-					ok = 1;
-				}
-				if (nabs(tx2-tx1) <= bdskinny) {
-					ok = 1;
-				}
-				if (! ok) {
-					continue;
-				}
-			}
-
-			if (bdx >= 0) {
-				if (bdx < tx1 || tx2 <= bdx) {
-					continue;
-				}
-			}
-			if (bdy >= 0) {
-				if (bdy < ty1 || ty2 <= bdy) {
-					continue;
-				}
-			}
-			if (clipshift) {
-				tx1 -= coff_x;
-				ty1 -= coff_y;
-				tx2 -= coff_x;
-				ty2 -= coff_y;
-			}
-			if (subwin) {
-				tx1 -= off_x;
-				ty1 -= off_y;
-				tx2 -= off_x;
-				ty2 -= off_y;
-			}
-
-			direct_fb_copy(tx1, ty1, tx2, ty2, 1);
-
-			do_fb_push++;
-			dt += dtime(&dm);
-if (db > 1) fprintf(stderr, "  BDP(%d,%d-%d,%d)  dt: %.4f\n", tx1, ty1, tx2, ty2, dt);
-		}
-		sraRgnReleaseIterator(iter);
-	}
-	sraRgnDestroy(whole);
-	sraRgnDestroy(frame);
-
-	return do_fb_push;
-}
-
-static int set_ypad(void) {
-	int ev, ev_tot = scr_ev_cnt;
-	static Window last_win = None;
-	static double last_time = 0.0;
-	static int y_accum = 0, last_sign = 0;
-	double now, cut = 0.1;
-	int dy_sum = 0, ys = 0, sign;
-	int font_size = 15;
-	int win_y, scr_y, loc_cut = 4*font_size, y_cut = 10*font_size;
-	
-	if (!xrecord_set_by_keys || !xrecord_name_info) {
-		return 0;
-	}
-	if (xrecord_name_info[0] == '\0') {
-		return 0;
-	}
-	if (! ev_tot) {
-		return 0;
-	}
-	if (xrecord_keysym == NoSymbol)  {
-		return 0;
-	}
-	if (!xrecord_scroll_keysym(xrecord_keysym)) {
-		return 0;
-	}
-	if (!scroll_term) {
-		return 0;
-	}
-	if (!match_str_list(xrecord_name_info, scroll_term)) {
-		return 0;
-	}
-
-	for (ev=0; ev < ev_tot; ev++) {
-		dy_sum += nabs(scr_ev[ev].dy);
-		if (scr_ev[ev].dy < 0) {
-			ys--;
-		} else if (scr_ev[ev].dy > 0) {
-			ys++;
-		} else {
-			ys = 0;
-			break;
-		}
-		if (scr_ev[ev].win != scr_ev[0].win) {
-			ys = 0;
-			break;
-		}
-		if (scr_ev[ev].dx != 0) {
-			ys = 0;
-			break;
-		}
-	}
-	if (ys != ev_tot && ys != -ev_tot) {
-		return 0;
-	}
-	if (ys < 0) {
-		sign = -1;
-	} else {
-		sign = 1;
-	}
-
-	if (sign > 0) {
-		/*
-		 * this case is not as useful as scrolling near the
-		 * bottom of a terminal.  But there are problems for it too.
-		 */
-		return 0;
-	}
-
-	win_y = scr_ev[0].win_y + scr_ev[0].win_h;
-	scr_y = scr_ev[0].y + scr_ev[0].h;
-	if (nabs(scr_y - win_y) > loc_cut) {
-		/* require it to be near the bottom. */
-		return 0;
-	}
-
-	now = dnow();
-
-	if (now < last_time + cut) {
-		int ok = 1;
-		if (last_win && scr_ev[0].win != last_win) {
-			ok = 0;
-		}
-		if (last_sign && sign != last_sign) {
-			ok = 0;
-		}
-		if (! ok) {
-			last_win = None;
-			last_sign = 0;
-			y_accum = 0;
-			last_time = 0.0;
-			return 0;
-		}
-	} else {
-		last_win = None;
-		last_sign = 0;
-		last_time = 0.0;
-		y_accum = 0;
-	}
-
-	y_accum += sign * dy_sum;
-
-	if (4 * nabs(y_accum) > scr_ev[0].h && y_cut) {
-		;	/* TBD */
-	}
-
-	last_sign = sign;
-	last_win = scr_ev[0].win;
-	last_time = now;
-
-	return y_accum;
-}
-
-static void scale_mark(int x1, int y1, int x2, int y2, int mark) {
-	int s = 2;
-	x1 = nfix(x1 - s, dpy_x);
-	y1 = nfix(y1 - s, dpy_y);
-	x2 = nfix(x2 + s, dpy_x+1);
-	y2 = nfix(y2 + s, dpy_y+1);
-	scale_and_mark_rect(x1, y1, x2, y2, mark);
-}
-
-#define PUSH_TEST(n)  \
-if (n) { \
-	double dt = 0.0, tm; dtime0(&tm); \
-	fprintf(stderr, "PUSH---\n"); \
-	while (dt < 2.0) { rfbPE(50000); dt += dtime(&tm); } \
-	fprintf(stderr, "---PUSH\n"); \
-}
-
-int batch_dxs[], batch_dys[];
-sraRegionPtr batch_reg[];
-void batch_push(int ncr, double delay);
-
-static int push_scr_ev(double *age, int type, int bdpush, int bdx, int bdy,
-    int bdskinny, int first_push) {
-	Window frame, win, win0;
-	int x, y, w, h, wx, wy, ww, wh, dx, dy;
-	int x0, y0, w0, h0;
-	int nx, ny, nw, nh;
-	int dret = 1, do_fb_push = 0, obscured;
-	int ev, ev_tot = scr_ev_cnt;
-	double tm, dt, st, waittime = 0.125;
-	double max_age = *age;
-	int db = debug_scroll, rrate = get_read_rate();
-	sraRegionPtr backfill, whole, tmpregion, tmpregion2;
-	int link, latency, netrate;
-	int ypad = 0;
-	double last_scroll_event_save = last_scroll_event;
-	int fast_push = 0, rc;
-
-	/* we return the oldest one. */
-	*age = 0.0;
-
-	if (ev_tot == 0) {
-		return dret;
-	}
-
-	link = link_rate(&latency, &netrate);
-
-	if (link == LR_DIALUP) {
-		waittime *= 5;
-	} else if (link == LR_BROADBAND) {
-		waittime *= 3;
-	} else if (latency > 80 || netrate < 40) {
-		waittime *= 3;
-	}
-
-	backfill = sraRgnCreate();
-	whole = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	if (clipshift) {
-		sraRgnOffset(whole, coff_x, coff_y);
-	}
-	if (subwin) {
-		sraRgnOffset(whole, off_x, off_y);
-	}
-
-	win0 = scr_ev[0].win;
-	x0 = scr_ev[0].win_x;
-	y0 = scr_ev[0].win_y;
-	w0 = scr_ev[0].win_w;
-	h0 = scr_ev[0].win_h;
-
-	ypad = set_ypad();
-
-if (db) fprintf(stderr, "ypad: %d  dy[0]: %d ev_tot: %d\n", ypad, scr_ev[0].dy, ev_tot);
-
-	for (ev=0; ev < ev_tot; ev++) {
-		double ag;
-	
-		x   = scr_ev[ev].x;
-		y   = scr_ev[ev].y;
-		w   = scr_ev[ev].w;
-		h   = scr_ev[ev].h;
-		dx  = scr_ev[ev].dx;
-		dy  = scr_ev[ev].dy;
-		win = scr_ev[ev].win;
-		wx  = scr_ev[ev].win_x;
-		wy  = scr_ev[ev].win_y;
-		ww  = scr_ev[ev].win_w;
-		wh  = scr_ev[ev].win_h;
-		nx  = scr_ev[ev].new_x;
-		ny  = scr_ev[ev].new_y;
-		nw  = scr_ev[ev].new_w;
-		nh  = scr_ev[ev].new_h;
-		st  = scr_ev[ev].t;
-
-		ag = (dnow() - servertime_diff) - st;
-		if (ag > *age) {
-			*age = ag;
-		}
-
-		if (dabs(ag) > max_age) {
-if (db) fprintf(stderr, "push_scr_ev: TOO OLD: %.4f :: (%.4f - %.4f) "
-    "- %.4f \n", ag, dnow(), servertime_diff, st);				
-			dret = 0;
-			break;
-		} else {
-if (db) fprintf(stderr, "push_scr_ev: AGE:     %.4f\n", ag);
-		}
-		if (win != win0) {
-if (db) fprintf(stderr, "push_scr_ev: DIFF WIN: 0x%lx != 0x%lx\n", win, win0);
-			dret = 0;
-			break;
-		}
-		if (wx != x0 || wy != y0) {
-if (db) fprintf(stderr, "push_scr_ev: WIN SHIFT: %d %d, %d %d", wx, x0, wy, y0);
-			dret = 0;
-			break;
-		}
-		if (ww != w0 || wh != h0) {
-if (db) fprintf(stderr, "push_scr_ev: WIN RESIZE: %d %d, %d %d", ww, w0, wh, h0);
-			dret = 0;
-			break;
-		}
-		if (w < 1 || h < 1 || ww < 1 || wh < 1) {
-if (db) fprintf(stderr, "push_scr_ev: NEGATIVE h/w: %d %d %d %d\n", w, h, ww, wh);
-			dret = 0;
-			break;
-		}
-
-if (db > 1) fprintf(stderr, "push_scr_ev: got: %d x: %4d y: %3d"
-    " w: %4d h: %3d  dx: %d dy: %d %dx%d+%d+%d   win: 0x%lx\n",
-    ev, x, y, w, h, dx, dy, w, h, x, y, win);
-
-if (db > 1) fprintf(stderr, "------------ got: %d x: %4d y: %3d"
-    " w: %4d h: %3d %dx%d+%d+%d\n",
-    ev, wx, wy, ww, wh, ww, wh, wx, wy);
-
-if (db > 1) fprintf(stderr, "------------ got: %d x: %4d y: %3d"
-    " w: %4d h: %3d %dx%d+%d+%d\n",
-    ev, nx, ny, nw, nh, nw, nh, nx, ny);
-
-		frame = None;
-		if (xrecord_wm_window) {
-			frame = xrecord_wm_window;
-		}
-		if (! frame) {
-			X_LOCK;
-			frame = query_pointer(rootwin);
-			X_UNLOCK;
-		}
-		if (! frame) {
-			frame = win;
-		}
-
-		dtime0(&tm);
-
-		tmpregion = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-		if (clipshift) {
-			sraRgnOffset(tmpregion, coff_x, coff_y);
-		}
-		if (subwin) {
-			sraRgnOffset(tmpregion, off_x, off_y);
-		}
-		tmpregion2 = sraRgnCreateRect(wx, wy, wx+ww, wy+wh);
-		sraRgnAnd(tmpregion2, whole);
-		sraRgnSubtract(tmpregion, tmpregion2);
-		sraRgnDestroy(tmpregion2);
-
-		/* do the wm frame just incase the above is bogus too. */
-		if (frame && frame != win) {
-			int k, gotk = -1;
-			for (k = stack_list_num - 1; k >= 0; k--) {
-				if (stack_list[k].win == frame &&
-				    stack_list[k].fetched && 
-				    stack_list[k].valid && 
-				    stack_list[k].map_state == IsViewable) {
-					gotk = k;
-					break;
-				}
-			}
-			if (gotk != -1) {
-				int tx1, ty1, tx2, ty2;
-				tx1 = stack_list[gotk].x;
-				ty1 = stack_list[gotk].y;
-				tx2 = tx1 + stack_list[gotk].width;
-				ty2 = ty1 + stack_list[gotk].height;
-				tmpregion2 = sraRgnCreateRect(tx1,ty1,tx2,ty2);
-				sraRgnAnd(tmpregion2, whole);
-				sraRgnSubtract(tmpregion, tmpregion2);
-				sraRgnDestroy(tmpregion2);
-			}
-		}
-
-		/*
-		 * XXX Need to also clip:
-		 *	children of win
-		 *	siblings of win higher in stacking order.
-		 * ignore for now... probably will make some apps
-		 * act very strangely.
-		 */
-		if (ypad) {
-			if (ypad < 0) {
-				if (h > -ypad) {
-					h += ypad;
-				} else {
-					ypad = 0;
-				}
-			} else {
-				if (h > ypad) {
-					y += ypad;
-				} else {
-					ypad = 0;
-				}
-			}
-		}
-
-		if (fast_push) {
-			int nbatch = 0; 
-			double delay, d1 = 0.1, d2 = 0.02;
-			rc = try_copyrect(frame, frame, x, y, w, h, dx, dy, &obscured,
-			    tmpregion, waittime, &nbatch);
-
-			if (first_push) {
-				delay = d1;
-			} else {
-				delay = d2;
-			}
-
-			batch_push(nbatch, delay);
-			fb_push();
-		} else {
-			rc = try_copyrect(frame, frame, x, y, w, h, dx, dy, &obscured,
-			    tmpregion, waittime, NULL);
-			if (rc) {
-				last_scroll_type = type;
-				dtime0(&last_scroll_event);
-
-				do_fb_push++;
-				urgent_update = 1;
-				sraRgnDestroy(tmpregion);
-PUSH_TEST(0);
-			}
-		}
-
-		if (! rc) {
-			dret = 0;
-			sraRgnDestroy(tmpregion);
-			break;	
-		}
-		dt = dtime(&tm);
-if (0) fprintf(stderr, "  try_copyrect dt: %.4f\n", dt);
-
-		if (ev > 0) {
-			sraRgnOffset(backfill, dx, dy);
-			sraRgnAnd(backfill, whole);
-		}
-
-		if (ypad) {
-			if (ypad < 0) {
-				ny += ypad;	
-				nh -= ypad;
-			} else {
-				;
-			}
-		}
-
-		tmpregion = sraRgnCreateRect(nx, ny, nx + nw, ny + nh);
-		sraRgnAnd(tmpregion, whole);
-		sraRgnOr(backfill, tmpregion);
-		sraRgnDestroy(tmpregion);
-	}
-
-	/* try to update the backfill region (new window contents) */
-	if (dret != 0) {
-		double est, win_area = 0.0, area = 0.0;
-		sraRectangleIterator *iter;
-		sraRect rect;
-		int tx1, ty1, tx2, ty2;
-
-		tmpregion = sraRgnCreateRect(x0, y0, x0 + w0, y0 + h0);
-		sraRgnAnd(tmpregion, whole);
-
-		sraRgnAnd(backfill, tmpregion);
-
-		iter = sraRgnGetIterator(tmpregion);
-		while (sraRgnIteratorNext(iter, &rect)) {
-			tx1 = rect.x1;
-			ty1 = rect.y1;
-			tx2 = rect.x2;
-			ty2 = rect.y2;
-
-			win_area += (tx2 - tx1)*(ty2 - ty1);
-		}
-		sraRgnReleaseIterator(iter);
-
-		sraRgnDestroy(tmpregion);
-
-
-		iter = sraRgnGetIterator(backfill);
-		while (sraRgnIteratorNext(iter, &rect)) {
-			tx1 = rect.x1;
-			ty1 = rect.y1;
-			tx2 = rect.x2;
-			ty2 = rect.y2;
-
-			area += (tx2 - tx1)*(ty2 - ty1);
-		}
-		sraRgnReleaseIterator(iter);
-
-		est = (area * (bpp/8)) / (1000000.0 * rrate);
-if (db) fprintf(stderr, "  area %.1f win_area %.1f est: %.4f", area, win_area, est);
-		if (area > 0.90 * win_area) {
-if (db) fprintf(stderr, "  AREA_TOO_MUCH");
-			dret = 0;
-		} else if (est > 0.6) {
-if (db) fprintf(stderr, "  EST_TOO_LARGE");
-			dret = 0;
-		} else if (area <= 0.0) {
-			;
-		} else {
-			dtime0(&tm);
-			iter = sraRgnGetIterator(backfill);
-			while (sraRgnIteratorNext(iter, &rect)) {
-				tx1 = rect.x1;
-				ty1 = rect.y1;
-				tx2 = rect.x2;
-				ty2 = rect.y2;
-
-				if (clipshift) {
-					tx1 -= coff_x;
-					ty1 -= coff_y;
-					tx2 -= coff_x;
-					ty2 -= coff_y;
-				}
-				if (subwin) {
-					tx1 -= off_x;
-					ty1 -= off_y;
-					tx2 -= off_x;
-					ty2 -= off_y;
-				}
-				tx1 = nfix(tx1, dpy_x);
-				ty1 = nfix(ty1, dpy_y);
-				tx2 = nfix(tx2, dpy_x+1);
-				ty2 = nfix(ty2, dpy_y+1);
-
-				dtime(&tm);
-if (db) fprintf(stderr, "  DFC(%d,%d-%d,%d)", tx1, ty1, tx2, ty2);
-				direct_fb_copy(tx1, ty1, tx2, ty2, 1);
-				if (fast_push) {
-					fb_push();
-				}
-				do_fb_push++;
-PUSH_TEST(0);
-			}
-			sraRgnReleaseIterator(iter);
-
-			dt = dtime(&tm);
-if (db) fprintf(stderr, "  dfc---- dt: %.4f", dt);
-
-		}
-if (db &&  dret) fprintf(stderr, " **** dret=%d", dret);
-if (db && !dret) fprintf(stderr, " ---- dret=%d", dret);
-if (db) fprintf(stderr, "\n");
-	}
-
-if (db && bdpush) fprintf(stderr, "BDPUSH-TIME:  0x%lx\n", xrecord_wm_window);
-
-	if (bdpush && xrecord_wm_window != None) {
-		int x, y, w, h;
-		x = scr_ev[0].x;
-		y = scr_ev[0].y;
-		w = scr_ev[0].w;
-		h = scr_ev[0].h;
-		do_fb_push += do_bdpush(xrecord_wm_window, x, y, w, h,
-		    bdx, bdy, bdskinny); 
-		if (fast_push) {
-			fb_push();
-		}
-	}
-
-	if (do_fb_push) {
-		dtime0(&tm);
-		fb_push();
-		dt = dtime(&tm);
-if (0) fprintf(stderr, "  fb_push dt: %.4f", dt);
-		if (scaling) {
-			static double last_time = 0.0;
-			double now = dnow(), delay = 0.4, first_wait = 3.0;
-			double trate;
-			int repeating, lat, rate;
-			int link = link_rate(&lat, &rate);
-			int skip_first = 0;
-
-			if (link == LR_DIALUP || rate < 35) {
-				delay *= 4;
-			} else if (link != LR_LAN || rate < 100) {
-				delay *= 2;
-			}
-
-			trate = typing_rate(0.0, &repeating);
-			
-			if (xrecord_set_by_mouse || repeating >= 3) {
-				if (now > last_scroll_event_save + first_wait) {
-					skip_first = 1;
-				}
-			}
-
-			if (skip_first) {
-				/* 
-				 * try not to send the first one, but a
-				 * single keystroke scroll would be OK.
-				 */
-			} else if (now > last_time + delay) {
-
-				scale_mark(x0, y0, x0 + w0, y0 + h0, 1);
-				last_copyrect_fix = now;
-			}
-			last_time = now;
-		}
-	}
-
-	sraRgnDestroy(backfill);
-	sraRgnDestroy(whole);
-	return dret;
-}
-
-static void get_client_regions(int *req, int *mod, int *cpy, int *num)  {
-	
-	rfbClientIteratorPtr i;
-	rfbClientPtr cl;
-
-	*req = 0;
-	*mod = 0;
-	*cpy = 0;
-	*num = 0;
-
-	i = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(i)) ) {
-		if (use_threads) LOCK(cl->updateMutex);
-		*req += sraRgnCountRects(cl->requestedRegion);
-		*mod += sraRgnCountRects(cl->modifiedRegion);
-		*cpy += sraRgnCountRects(cl->copyRegion);
-		*num += 1;
-		if (use_threads) UNLOCK(cl->updateMutex);
-	}
-	rfbReleaseClientIterator(i);
-}
-
-/*
- * Wrapper to apply the rfbDoCopyRegion taking into account if scaling
- * is being done.  Note that copyrect under the scaling case is often
- * only approximate.
- */
-int DCR_Normal = 0;
-int DCR_FBOnly = 1;
-int DCR_Direct = 2;
-
-void do_copyregion(sraRegionPtr region, int dx, int dy, int mode)  {
-	sraRectangleIterator *iter;
-	sraRect rect;
-	int Bpp0 = bpp/8, Bpp;
-	int x1, y1, x2, y2, w, stride, stride0;
-	int sx1, sy1, sx2, sy2, sdx, sdy;
-	int req, mod, cpy, ncli;
-	char *dst = NULL, *src = NULL;
-
-	last_copyrect = dnow();
-
-	if (rfb_fb == main_fb && ! rotating && mode == DCR_Normal) {
-		/* normal case, no -scale or -8to24 */
-		get_client_regions(&req, &mod, &cpy, &ncli);
-if (0 || debug_scroll > 1) fprintf(stderr, ">>>-rfbDoCopyRect req: %d mod: %d cpy: %d\n", req, mod, cpy); 
-
-		rfbDoCopyRegion(screen, region, dx, dy);
-
-		get_client_regions(&req, &mod, &cpy, &ncli);
-if (0 || debug_scroll > 1) fprintf(stderr, "<<<-rfbDoCopyRect req: %d mod: %d cpy: %d\n", req, mod, cpy); 
-
-		return;
-	}
-
-	/* rarer case, we need to call rfbDoCopyRect with scaled xy */
-	stride0 = dpy_x * Bpp0;
-
-	iter = sraRgnGetReverseIterator(region, dx < 0, dy < 0);
-	while(sraRgnIteratorNext(iter, &rect)) {
-		int j, c, t;
-
-		x1 = rect.x1;
-		y1 = rect.y1;
-		x2 = rect.x2;
-		y2 = rect.y2;
-
-		for (c= 0; c < 2; c++) {
-
-			Bpp = Bpp0;
-			stride = stride0;
-
-			if (c == 0) {
-				dst = main_fb + y1*stride + x1*Bpp;
-				src = main_fb + (y1-dy)*stride + (x1-dx)*Bpp;
-
-			} else if (c == 1) {
-				if (!cmap8to24 || !cmap8to24_fb) {
-					continue;
-				}
-				if (cmap8to24_fb == rfb_fb) {
-					if (mode == DCR_FBOnly) {
-						;
-					} else if (mode == DCR_Direct) {
-						;
-					} else if (mode == DCR_Normal) {
-						continue;
-					}
-				}
-if (0) fprintf(stderr, "copyrect: cmap8to24_fb: mode=%d\n", mode);
-				if (cmap8to24) {
-					if (depth <= 8) {
-						Bpp    = 4 * Bpp0;
-						stride = 4 * stride0;
-					} else if (depth <= 16) {
-						Bpp    = 2 * Bpp0;
-						stride = 2 * stride0;
-					}
-				}
-				dst = cmap8to24_fb + y1*stride + x1*Bpp;
-				src = cmap8to24_fb + (y1-dy)*stride + (x1-dx)*Bpp;
-			}
-
-			w = (x2 - x1)*Bpp; 
-			
-			if (dy < 0) {
-				for (j=y1; j<y2; j++) {
-					memmove(dst, src, w);
-					dst += stride;
-					src += stride;
-				}
-			} else {
-				dst += (y2 - y1 - 1)*stride;
-				src += (y2 - y1 - 1)*stride;
-				for (j=y2-1; j>=y1; j--) {
-					memmove(dst, src, w);
-					dst -= stride;
-					src -= stride;
-				}
-			}
-		}
-
-		if (mode == DCR_FBOnly) {
-			continue;
-		}
-
-
-		if (scaling) {
-			sx1 = ((double) x1 / dpy_x) * scaled_x;
-			sy1 = ((double) y1 / dpy_y) * scaled_y;
-			sx2 = ((double) x2 / dpy_x) * scaled_x;
-			sy2 = ((double) y2 / dpy_y) * scaled_y;
-			sdx = ((double) dx / dpy_x) * scaled_x;
-			sdy = ((double) dy / dpy_y) * scaled_y;
-		} else {
-			sx1 = x1;
-			sy1 = y1;
-			sx2 = x2;
-			sy2 = y2;
-			sdx = dx;
-			sdy = dy;
-		}
-if (0) fprintf(stderr, "sa.. %d %d %d %d %d %d\n", sx1, sy1, sx2, sy2, sdx, sdy);
-
-		if (rotating) {
-			rotate_coords(sx1, sy1, &sx1, &sy1, -1, -1);
-			rotate_coords(sx2, sy2, &sx2, &sy2, -1, -1);
-			if (rotating == ROTATE_X) {
-				sdx = -sdx;
-			} else if (rotating == ROTATE_Y) {
-				sdy = -sdy;
-			} else if (rotating == ROTATE_XY) {
-				sdx = -sdx;
-				sdy = -sdy;
-			} else if (rotating == ROTATE_90) {
-				t = sdx;
-				sdx = -sdy;
-				sdy = t;
-			} else if (rotating == ROTATE_90X) {
-				t = sdx;
-				sdx = sdy;
-				sdy = t;
-			} else if (rotating == ROTATE_90Y) {
-				t = sdx;
-				sdx = -sdy;
-				sdy = -t;
-			} else if (rotating == ROTATE_270) {
-				t = sdx;
-				sdx = sdy;
-				sdy = -t;
-			}
-		}
-
-		/* XXX -1? */
-		if (sx2 < 0) sx2 = 0;
-		if (sy2 < 0) sy2 = 0;
-		
-		if (sx2 < sx1) {
-			t = sx1;
-			sx1 = sx2;
-			sx2 = t;
-		}
-		if (sy2 < sy1) {
-			t = sy1;
-			sy1 = sy2;
-			sy2 = t;
-		}
-if (0) fprintf(stderr, "sb.. %d %d %d %d %d %d\n", sx1, sy1, sx2, sy2, sdx, sdy);
-
-		if (mode == DCR_Direct) {
-			rfbClientIteratorPtr i;
-			rfbClientPtr cl;
-			sraRegionPtr r = sraRgnCreateRect(sx1, sy1, sx2, sy2);
-
-			i = rfbGetClientIterator(screen);
-			while( (cl = rfbClientIteratorNext(i)) ) {
-				if (use_threads) LOCK(cl->updateMutex);
-				rfbSendCopyRegion(cl, r, sdx, sdy);
-				if (use_threads) UNLOCK(cl->updateMutex);
-			}
-			rfbReleaseClientIterator(i);
-			sraRgnDestroy(r);
-			
-		} else {
-			rfbDoCopyRect(screen, sx1, sy1, sx2, sy2, sdx, sdy);
-		}
-	}
-	sraRgnReleaseIterator(iter);
-}
-
-void batch_copyregion(sraRegionPtr* region, int *dx, int *dy, int ncr, double delay)  {
-	rfbClientIteratorPtr i;
-	rfbClientPtr cl;
-	int k, direct, mode, nrects = 0, bad = 0;
-	double t1, t2, start = dnow();
-
-	for (k=0; k < ncr; k++) {
-		sraRectangleIterator *iter;
-		sraRect rect;
-
-		iter = sraRgnGetIterator(region[k]);
-		while (sraRgnIteratorNext(iter, &rect)) {
-			int x1 = rect.x1;
-			int y1 = rect.y1;
-			int x2 = rect.x2;
-			int y2 = rect.y2;
-			int ym = dpy_y * (ncache+1);
-			int xm = dpy_x;
-			if (x1 > xm || y1 > ym || x2 > xm || y2 > ym) {
-				if (ncdb) fprintf(stderr, "batch_copyregion: BAD RECTANGLE: %d,%d %d,%d\n", x1, y1, x2, y2);
-				bad = 1;
-			}
-			if (x1 < 0 || y1 < 0 || x2 < 0 || y2 < 0) {
-				if (ncdb) fprintf(stderr, "batch_copyregion: BAD RECTANGLE: %d,%d %d,%d\n", x1, y1, x2, y2);
-				bad = 1;
-			}
-		}
-		sraRgnReleaseIterator(iter);
-		nrects += sraRgnCountRects(region[k]);
-	}
-	if (bad || nrects == 0) {
-		return;
-	}
-
-	if (delay < 0.0) {
-		delay = 0.1;
-	}
-	if (!fb_push_wait(delay, FB_COPY|FB_MOD)) {
-		if (use_threads) usleep(100 * 1000);
-		fb_push_wait(0.75, FB_COPY|FB_MOD);
-	}
-
-	t1 = dnow();
-
-	bad = 0;
-	i = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(i)) ) {
-
-		if (use_threads) LOCK(cl->updateMutex);
-
-		if (cl->ublen != 0) {
-			fprintf(stderr, "batch_copyregion: *** BAD ublen != 0: %d\n", cl->ublen);
-			bad++;
-		}
-
-		if (use_threads) UNLOCK(cl->updateMutex);
-	}
-	rfbReleaseClientIterator(i);
-
-	if (bad) {
-		return;
-	}
-
-	i = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(i)) ) {
-		rfbFramebufferUpdateMsg *fu;
-
-		if (use_threads) LOCK(cl->updateMutex);
-
-		fu = (rfbFramebufferUpdateMsg *)cl->updateBuf;
-		fu->nRects = Swap16IfLE((uint16_t)(nrects));
-		fu->type = rfbFramebufferUpdate;
-
-		if (cl->ublen != 0) fprintf(stderr, "batch_copyregion: *** BAD-2 ublen != 0: %d\n", cl->ublen);
-
-		cl->ublen = sz_rfbFramebufferUpdateMsg;
-
-		if (use_threads) UNLOCK(cl->updateMutex);
-	}
-	rfbReleaseClientIterator(i);
-
-	if (rfb_fb == main_fb && !rotating) {
-		direct = 0;
-		mode = DCR_FBOnly;
-	} else {
-		direct = 1;
-		mode = DCR_Direct;
-	}
-	for (k=0; k < ncr; k++) {
-		do_copyregion(region[k], dx[k], dy[k], mode);
-	}
-
-	t2 = dnow();
-
-	i = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(i)) ) {
-
-		if (use_threads) LOCK(cl->updateMutex);
-
-		if (!direct)  {
-			for (k=0; k < ncr; k++) {
-				rfbSendCopyRegion(cl, region[k], dx[k], dy[k]);
-			}
-		}
-		rfbSendUpdateBuf(cl);
-
-		if (use_threads) UNLOCK(cl->updateMutex);
-	}
-	rfbReleaseClientIterator(i);
-
-	last_copyrect = dnow();
-
-if (0) fprintf(stderr, "batch_copyregion: nrects: %d nregions: %d  tot=%.4f t10=%.4f t21=%.4f t32=%.4f  %.4f\n",
-    nrects, ncr, last_copyrect - start, t1 - start, t2 - t1, last_copyrect - t2, dnowx());
-
-}
-
-void batch_push(int nreg, double delay) {
-	int k;
-	batch_copyregion(batch_reg, batch_dxs, batch_dys, nreg, delay);
-	/* XXX Y */
-	fb_push();
-	for (k=0; k < nreg; k++) {
-		sraRgnDestroy(batch_reg[k]);
-	}
-}
-
-void fb_push(void) {
-	int req0, mod0, cpy0, req1, mod1, cpy1, ncli;
-	int db = (debug_scroll || debug_wireframe);
-	rfbClientIteratorPtr i;
-	rfbClientPtr cl;
-
-	if (use_threads) {
-		return;
-	}
-	
-if (db)	get_client_regions(&req0, &mod0, &cpy0, &ncli);
-
-	i = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(i)) ) {
-		if (use_threads) LOCK(cl->updateMutex);
-		if (cl->sock >= 0 && !cl->onHold && FB_UPDATE_PENDING(cl) &&
-		    !sraRgnEmpty(cl->requestedRegion)) {
-			if (!rfbSendFramebufferUpdate(cl, cl->modifiedRegion)) {
-				fprintf(stderr, "*** rfbSendFramebufferUpdate *FAILED* #1\n");
-				if (cl->ublen) fprintf(stderr, "*** fb_push ublen not zero: %d\n", cl->ublen);
-				if (use_threads) UNLOCK(cl->updateMutex);
-				break;
-			}
-			if (cl->ublen) fprintf(stderr, "*** fb_push ublen NOT ZERO: %d\n", cl->ublen);
-		}
-		if (use_threads) UNLOCK(cl->updateMutex);
-	}
-	rfbReleaseClientIterator(i);
-
-if (db) {
-	get_client_regions(&req1, &mod1, &cpy1, &ncli);
-	fprintf(stderr, "\nFB_push: req: %d/%d  mod: %d/%d  cpy: %d/%d  %.4f\n",
-	req0, req1, mod0, mod1, cpy0, cpy1, dnowx());
-}
-
-}
-
-int fb_push_wait(double max_wait, int flags) {
-	double tm, dt = 0.0;
-	int req, mod, cpy, ncli;
-	int ok = 0, first = 1;
-
-	dtime0(&tm);	
-	while (dt < max_wait) {
-		int done = 1;
-		fb_push();
-		get_client_regions(&req, &mod, &cpy, &ncli);
-		if (flags & FB_COPY && cpy) {
-			done = 0;
-		}
-		if (flags & FB_MOD && mod) {
-			done = 0;
-		}
-		if (flags & FB_REQ && req) {
-			done = 0;
-		}
-		if (done) {
-			ok = 1;
-			break;
-		}
-		if (first) {
-			first = 0;
-			continue;	
-		}
-
-		rfbCFD(0);
-		usleep(1000);
-		dt += dtime(&tm);
-	}
-	return ok;
-}
-
-/* 
- * utility routine for CopyRect of the window (but not CopyRegion)
- */
-static int crfix(int x, int dx, int Lx) {
-	/* adjust x so that copy source is on screen */
-	if (dx > 0) {
-		if (x-dx < 0) {
-			/* off on the left */
-			x = dx;	
-		}
-	} else {
-		if (x-dx >= Lx) {
-			/* off on the right */
-			x = Lx + dx - 1;
-		}
-	}
-	return x;
-}
-
-typedef struct scroll_result {
-	Window win;
-	double time;
-	int result;
-} scroll_result_t;
-
-#define SCR_RESULTS_MAX 256
-static scroll_result_t scroll_results[SCR_RESULTS_MAX];
-
-static int scrollability(Window win, int set) {
-	double oldest = -1.0;
-	int i, index = -1, next_index = -1;
-	static int first = 1;
-
-	if (first) {
-		for (i=0; i<SCR_RESULTS_MAX; i++) {
-			scroll_results[i].win = None;
-			scroll_results[i].time = 0.0;
-			scroll_results[i].result = 0;
-		}
-		first = 0;
-	}
-
-	if (win == None) {
-		return 0;
-	}
-	if (set == SCR_NONE) {
-		/* lookup case */
-		for (i=0; i<SCR_RESULTS_MAX; i++) {
-			if (win == scroll_results[i].win) {
-				return scroll_results[i].result;
-			}
-			if (scroll_results[i].win == None) {
-				break;
-			}
-		}
-		return 0;
-	}
-
-	for (i=0; i<SCR_RESULTS_MAX; i++) {
-		if (oldest == -1.0 || scroll_results[i].time < oldest) {
-			next_index = i;
-			oldest = scroll_results[i].time;
-		}
-		if (win == scroll_results[i].win) {
-			index = i;
-			break;
-		}
-		if (next_index >= 0 && scroll_results[i].win == None) {
-			break;
-		}
-	}
-
-	if (set == SCR_SUCCESS) {
-		set = 1;
-	} else if (set == SCR_FAIL) {
-		set = -1;
-	} else {
-		set = 0;
-	}
-	if (index == -1) {
-		scroll_results[next_index].win = win;
-		scroll_results[next_index].time = dnow();
-		scroll_results[next_index].result = set;
-	} else {
-		if (scroll_results[index].result == 1) {
-			/*
-			 * once a success, always a success, until they
-			 * forget about us...
-			 */
-			set = 1;
-		} else {
-			scroll_results[index].result = set;
-		}
-		scroll_results[index].time = dnow();
-	}
-
-	return set;
-}
-
-void eat_viewonly_input(int max_eat, int keep) {
-	int i, gp, gk;
-	
-	for (i=0; i<max_eat; i++) {
-		int cont = 0;
-		gp = got_pointer_calls;
-		gk = got_keyboard_calls;
-		rfbCFD(0);
-		if (got_pointer_calls > gp)  {
-			if (debug_pointer) {
-				rfbLog("eat_viewonly_input: pointer: %d\n", i);
-			}
-			cont++;
-		}
-		if (got_keyboard_calls > gk)  {
-			if (debug_keyboard) {
-				rfbLog("eat_viewonly_input: keyboard: %d\n", i);
-			}
-			cont++;
-		}
-		if (i >= keep - 1 && ! cont) {
-			break;
-		}
-	}
-}
-
-static int eat_pointer(int max_ptr_eat, int keep) {
-	int i, count = 0,  gp = got_pointer_input;
-
-	for (i=0; i<max_ptr_eat; i++) {
-		rfbCFD(0);
-		if (got_pointer_input > gp)  {
-			count++;
-if (0) fprintf(stderr, "GP*-%d\n", i);
-			gp = got_pointer_input;
-		} else if (i > keep) {
-			break;
-		}
-	}
-	return count;
-}
-
-static void set_bdpush(int type, double *last_bdpush, int *pushit) {
-	double now, delay = 0.0;
-	int link, latency, netrate;
-
-	*pushit = 0;
-
-	if (type == SCR_MOUSE) {
-		delay = scr_mouse_bdpush_time;
-	} else if (type == SCR_KEY) {
-		delay = scr_key_bdpush_time;
-	}
-
-	link = link_rate(&latency, &netrate);
-	if (link == LR_DIALUP) {
-		delay *= 1.5;
-	} else if (link == LR_BROADBAND) {
-		delay *= 1.25;
-	}
-
-	dtime0(&now);
-	if (delay > 0.0 && now > *last_bdpush + delay) {
-		*pushit = 1;
-		*last_bdpush = now;
-	}
-}
-
-void mark_for_xdamage(int x, int y, int w, int h) {
-	int tx1, ty1, tx2, ty2;
-	sraRegionPtr tmpregion;
-
-	if (! use_xdamage) {
-		return;
-	}
-
-	tx1 = nfix(x, dpy_x);
-	ty1 = nfix(y, dpy_y);
-	tx2 = nfix(x + w, dpy_x+1);
-	ty2 = nfix(y + h, dpy_y+1);
-
-	tmpregion = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-	add_region_xdamage(tmpregion);
-	sraRgnDestroy(tmpregion);
-}
-
-void mark_region_for_xdamage(sraRegionPtr region) {
-	sraRectangleIterator *iter;
-	sraRect rect;
-	iter = sraRgnGetIterator(region);
-	while (sraRgnIteratorNext(iter, &rect)) {
-		int x1 = rect.x1;
-		int y1 = rect.y1;
-		int x2 = rect.x2;
-		int y2 = rect.y2;
-		mark_for_xdamage(x1, y1, x2 - x1, y2 - y1);
-	}
-	sraRgnReleaseIterator(iter);
-}
-
-void set_xdamage_mark(int x, int y, int w, int h) {
-	sraRegionPtr region;
-
-	if (! use_xdamage) {
-		return;
-	}
-	mark_for_xdamage(x, y, w, h);
-
-	if (xdamage_scheduled_mark == 0.0) {
-		xdamage_scheduled_mark = dnow() + 2.0;
-	}
-
-	if (xdamage_scheduled_mark_region == NULL) {
-		xdamage_scheduled_mark_region = sraRgnCreate();
-	}
-	region = sraRgnCreateRect(x, y, x + w, y + w);
-	sraRgnOr(xdamage_scheduled_mark_region, region);
-	sraRgnDestroy(region);
-}
-
-static int repeat_check(double last_key_scroll) {
-	int repeating;
-	double rate = typing_rate(0.0, &repeating);
-	double now = dnow(), delay = 0.5;
-	if (rate > 2.0 && repeating && now > last_key_scroll + delay) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-static int check_xrecord_keys(void) {
-	static int last_wx, last_wy, last_ww, last_wh;
-	double spin = 0.0, tm, tnow;
-	int scr_cnt = 0, input = 0, scroll_rep;
-	int get_out, got_one = 0, flush1 = 0, flush2 = 0;
-	int gk, gk0, ret = 0, db = debug_scroll;
-	int fail = 0;
-	int link, latency, netrate;
-
-	static double last_key_scroll = 0.0;
-	static double persist_start = 0.0;
-	static double last_bdpush = 0.0;
-	static int persist_count = 0;
-	int scroll_keysym = 0;
-	double last_scroll, scroll_persist = scr_key_persist;
-	double spin_fac = 1.0, scroll_fac = 2.0, noscroll_fac = 0.75;
-	double max_spin, max_long_spin = 0.3;
-	double set_repeat_in;
-	static double set_repeat = 0.0;
-
-
-	RAWFB_RET(0)
-
-	if (unixpw_in_progress) return 0;
-
-	set_repeat_in = set_repeat;
-	set_repeat = 0.0;
-
-	get_out = 1;
-	if (got_keyboard_input) {
-		get_out = 0;
-	}
-
-	dtime0(&tnow);
-	if (tnow < last_key_scroll + scroll_persist) {
-		get_out = 0;
-	}
-
-	if (set_repeat_in > 0.0 && tnow < last_key_scroll + set_repeat_in) {
-		get_out = 0;
-	}
-
-	if (get_out) {
-		persist_start = 0.0;
-		persist_count = 0;
-		last_bdpush = 0.0;
-		if (xrecording) {
-			xrecord_watch(0, SCR_KEY);
-		}
-		return 0;
-	}
-
-#if 0
-	/* not used for keyboard yet */
-	scroll_rep = scrollability(xrecord_ptr_window, SCR_NONE) + 1;
-	if (scroll_rep == 1) {
-		scroll_rep = 2;		/* if no info, assume the best. */
-	}
-#endif
-
-	scroll_keysym = xrecord_scroll_keysym(last_rfb_keysym);
-
-	max_spin = scr_key_time;
-
-	if (set_repeat_in > 0.0 && tnow < last_key_scroll + 2*set_repeat_in) {
-		max_spin = 2 * set_repeat_in;
-	} else if (tnow < last_key_scroll + scroll_persist) {
-		max_spin = 1.25*(tnow - last_key_scroll);
-	} else if (tnow < last_key_to_button_remap_time + 1.5*scroll_persist) {
-		/* mostly a hack I use for testing -remap key -> btn4/btn5 */
-		max_spin = scroll_persist;
-	} else if (scroll_keysym) {
-		if (repeat_check(last_key_scroll)) {
-			spin_fac = scroll_fac;
-		} else {
-			spin_fac = noscroll_fac;
-		}
-	}
-	if (max_spin > max_long_spin) {
-		max_spin = max_long_spin;
-	}
-
-	/* XXX use this somehow  */
-if (0)	link = link_rate(&latency, &netrate);
-
-	gk = gk0 = got_keyboard_input;
-	dtime0(&tm);
-
-if (db) fprintf(stderr, "check_xrecord_keys: BEGIN LOOP: scr_ev_cnt: "
-    "%d max: %.3f  %.4f\n", scr_ev_cnt, max_spin, tm - x11vnc_start);
-
-	while (1) {
-
-		if (scr_ev_cnt) {
-			got_one = 1;
-
-			scrollability(xrecord_ptr_window, SCR_SUCCESS);
-			scroll_rep = 2;
-
-			dtime0(&last_scroll);
-			last_key_scroll = last_scroll;
-			scr_cnt++;
-			break;
-		}
-
-		X_LOCK;
-		flush1 = 1;
-		XFlush_wr(dpy);
-		X_UNLOCK;
-
-		if (set_repeat_in > 0.0) {
-			max_keyrepeat_time = set_repeat_in;
-		}
-
-		if (use_threads) {
-			usleep(1000);
-		} else {
-			rfbCFD(1000);
-		}
-		spin += dtime(&tm);
-
-		X_LOCK;
-		if (got_keyboard_input > gk) {
-			gk = got_keyboard_input;
-			input++;
-			if (set_repeat_in) {
-				;
-			} else if (xrecord_scroll_keysym(last_rfb_keysym)) {
-				if (repeat_check(last_key_scroll)) {
-					spin_fac = scroll_fac;
-				} else {
-					spin_fac = noscroll_fac;
-				}
-			}
-if (0 || db) fprintf(stderr, "check_xrecord: more keys: %.3f  0x%x "
-    " %.4f  %s  %s\n", spin, last_rfb_keysym, last_rfb_keytime - x11vnc_start,
-    last_rfb_down ? "down":"up  ", last_rfb_key_accepted ? "accept":"skip");
-			flush2 = 1;
-			XFlush_wr(dpy);
-		}
-#if LIBVNCSERVER_HAVE_RECORD
-		SCR_LOCK;
-		XRecordProcessReplies(rdpy_data);
-		SCR_UNLOCK;
-#endif
-		X_UNLOCK;
-
-		if (spin >= max_spin * spin_fac) {
-if (0 || db) fprintf(stderr, "check_xrecord: SPIN-OUT: %.3f/%.3f\n", spin,
-    max_spin * spin_fac);
-			fail = 1;
-			break;
-		}
-	}
-
-	max_keyrepeat_time = 0.0;
-
-	if (scr_ev_cnt) {
-		int dret, ev = scr_ev_cnt - 1;
-		int bdx, bdy, bdskinny, bdpush = 0;
-		double max_age = 0.25, age, tm, dt;
-		static double last_scr_ev = 0.0;
-
-		last_wx = scr_ev[ev].win_x;
-		last_wy = scr_ev[ev].win_y;
-		last_ww = scr_ev[ev].win_w;
-		last_wh = scr_ev[ev].win_h;
-
-		/* assume scrollbar on rhs: */
-		bdx = last_wx + last_ww + 3;
-		bdy = last_wy + last_wh/2;
-		bdskinny = 32;
-			
-		if (persist_start == 0.0) {
-			bdpush = 0;
-		} else {
-			set_bdpush(SCR_KEY, &last_bdpush, &bdpush);
-		}
-
-		dtime0(&tm);
-		age = max_age;
-		dret = push_scr_ev(&age, SCR_KEY, bdpush, bdx, bdy, bdskinny, 1);
-		dt = dtime(&tm);
-
-		ret = 1 + dret;
-		scr_ev_cnt = 0;
-
-		if (ret == 2 && xrecord_scroll_keysym(last_rfb_keysym)) {
-			int repeating;
-			double time_lo = 1.0/max_keyrepeat_lo;
-			double time_hi = 1.0/max_keyrepeat_hi;
-			double rate = typing_rate(0.0, &repeating);
-if (0 || db) fprintf(stderr, "Typing: dt: %.4f rate: %.1f\n", dt, rate);
-			if (repeating) {
-				/* n.b. the "quantum" is about 1/30 sec. */
-				max_keyrepeat_time = 1.0*dt;
-				if (max_keyrepeat_time > time_lo ||
-				    max_keyrepeat_time < time_hi) {
-					max_keyrepeat_time = 0.0;
-				} else {
-					set_repeat = max_keyrepeat_time;
-if (0 || db) fprintf(stderr, "set max_keyrepeat_time: %.2f\n", max_keyrepeat_time);
-				}
-			}
-		}
-
-		last_scr_ev = dnow();
-	}
-
-	if ((got_one && ret < 2) || persist_count) {
-		set_xdamage_mark(last_wx, last_wy, last_ww, last_wh);
-	}
-
-	if (fail) {
-		scrollability(xrecord_ptr_window, SCR_FAIL);
-	}
-
-	if (xrecording) {
-		if (ret < 2) {
-			xrecord_watch(0, SCR_KEY);
-		}
-	}
-
-	if (ret == 2) {
-		if (persist_start == 0.0) {
-			dtime(&persist_start);
-			last_bdpush = persist_start;
-		}
-	} else {
-		persist_start = 0.0;
-		last_bdpush = 0.0;
-	}
-
-	/* since we've flushed it, we might as well avoid -input_skip */
-	if (flush1 || flush2) {
-		got_keyboard_input = 0;
-		got_pointer_input = 0;
-	}
-
-	return ret;
-}
-
-static int check_xrecord_mouse(void) {
-	static int last_wx, last_wy, last_ww, last_wh;
-	double spin = 0.0, tm, tnow;
-	int i, scr_cnt = 0, input = 0, scroll_rep;
-	int get_out, got_one = 0, flush1 = 0, flush2 = 0;
-	int gp, gp0, ret = 0, db = debug_scroll;
-	int gk, gk0;
-	int fail = 0;
-	int link, latency, netrate;
-
-	int start_x, start_y, last_x, last_y;
-	static double last_mouse_scroll = 0.0;
-	double last_scroll;
-	double max_spin[3], max_long[3], persist[3];
-	double flush1_time = 0.01;
-	static double last_flush = 0.0;
-	double last_bdpush = 0.0, button_up_time = 0.0;
-	int button_mask_save;
-	int already_down = 0, max_ptr_eat = 20;
-	static int want_back_in = 0;
-	int came_back_in;
-	int first_push = 1;
-
-	int scroll_wheel = 0;
-	int btn4 = (1<<3);
-	int btn5 = (1<<4);
-
-	RAWFB_RET(0)
-
-	get_out = 1;
-	if (button_mask) {
-		get_out = 0;
-	}
-	if (want_back_in) {
-		get_out = 0;
-	}
-	dtime0(&tnow);
-if (0) fprintf(stderr, "check_xrecord_mouse: IN xrecording: %d\n", xrecording);
-
-	if (get_out) {
-		if (xrecording) {
-			xrecord_watch(0, SCR_MOUSE);
-		}
-		return 0;
-	}
-
-	scroll_rep = scrollability(xrecord_ptr_window, SCR_NONE) + 1;
-	if (scroll_rep == 1) {
-		scroll_rep = 2;		/* if no info, assume the best. */
-	}
-
-	if (button_mask_prev) {
-		already_down = 1;
-	}
-	if (want_back_in) {
-		came_back_in = 1;
-		first_push = 0;
-	} else {
-		came_back_in = 0;
-	}
-	want_back_in = 0;
-
-	if (button_mask & (btn4|btn5)) {
-		scroll_wheel = 1;
-	}
-
-	/*
-	 * set up times for the various "reputations"
-	 *
-	 * 0 => -1, has been tried but never found a scroll.
-	 * 1 =>  0, has not been tried.
-	 * 2 => +1, has been tried and found a scroll.
-	 */
-
-	/* first spin-out time (no events) */
-	max_spin[0] = 1*scr_mouse_time;
-	max_spin[1] = 2*scr_mouse_time;
-	max_spin[2] = 4*scr_mouse_time;
-	if (!already_down) {
-		for (i=0; i<3; i++) {
-			max_spin[i] *= 1.5;
-		}
-	}
-
-	/* max time between events */
-	persist[0] = 1*scr_mouse_persist;
-	persist[1] = 2*scr_mouse_persist;
-	persist[2] = 4*scr_mouse_persist;
-
-	/* absolute max time in the loop */
-	max_long[0] = scr_mouse_maxtime;
-	max_long[1] = scr_mouse_maxtime;
-	max_long[2] = scr_mouse_maxtime;
-
-	pointer_flush_delay = scr_mouse_pointer_delay;
-
-	/* slow links: */
-	link = link_rate(&latency, &netrate);
-	if (link == LR_DIALUP) {
-		for (i=0; i<3; i++) {
-			max_spin[i] *= 2.0;
-		}
-		pointer_flush_delay *= 2;
-	} else if (link == LR_BROADBAND) {
-		pointer_flush_delay *= 2;
-	}
-
-	gp = gp0 = got_pointer_input;
-	gk = gk0 = got_keyboard_input;
-	dtime0(&tm);
-
-	/*
-	 * this is used for border pushes (bdpush) to guess location
-	 * of scrollbar (region rects containing this point are pushed).
-	 */
-	last_x = start_x = cursor_x;
-	last_y = start_y = cursor_y;
-
-if (db) fprintf(stderr, "check_xrecord_mouse: BEGIN LOOP: scr_ev_cnt: "
-    "%d max: %.3f  %.4f\n", scr_ev_cnt, max_spin[scroll_rep], tm - x11vnc_start);
-
-	while (1) {
-		double spin_check;
-		if (scr_ev_cnt) {
-			int dret, ev = scr_ev_cnt - 1;
-			int bdpush = 0, bdx, bdy, bdskinny;
-			double tm, dt, age = 0.35;
-
-			got_one = 1;
-			scrollability(xrecord_ptr_window, SCR_SUCCESS);
-			scroll_rep = 2;
-
-			scr_cnt++;
-
-			dtime0(&last_scroll);
-			last_mouse_scroll = last_scroll;
-
-			if (last_bdpush == 0.0) {
-				last_bdpush = last_scroll;
-			}
-
-			bdx = start_x;
-			bdy = start_y;
-			if (clipshift) {
-				bdx += coff_x;
-				bdy += coff_y;
-			}
-			if (subwin) {
-				bdx += off_x;
-				bdy += off_y;
-			}
-			bdskinny = 32;
-			
-			set_bdpush(SCR_MOUSE, &last_bdpush, &bdpush);
-
-			dtime0(&tm);
-
-			dret = push_scr_ev(&age, SCR_MOUSE, bdpush, bdx,
-			    bdy, bdskinny, first_push);
-			if (first_push) first_push = 0;
-			ret = 1 + dret;
-
-			dt = dtime(&tm);
-
-if (db) fprintf(stderr, "  dret: %d  scr_ev_cnt: %d dt: %.4f\n",
-	dret, scr_ev_cnt, dt);
-
-			last_wx = scr_ev[ev].win_x;
-			last_wy = scr_ev[ev].win_y;
-			last_ww = scr_ev[ev].win_w;
-			last_wh = scr_ev[ev].win_h;
-			scr_ev_cnt = 0;
-
-			if (! dret) {
-				break;
-			}
-			if (0 && button_up_time > 0.0) {
-				/* we only take 1 more event with button up */
-if (db) fprintf(stderr, "check_xrecord: BUTTON_UP_SCROLL: %.3f\n", spin);
-				break;
-			}
-		}
-
-
-		if (! flush1) {
-			if (! already_down || (!scr_cnt && spin>flush1_time)) {
-				flush1 = 1;
-				X_LOCK;
-				XFlush_wr(dpy);
-				X_UNLOCK;
-				dtime0(&last_flush);
-			}
-		}
-
-		if (use_threads) {
-			usleep(1000);
-		} else {
-			rfbCFD(1000);
-			rfbCFD(0);
-		}
-		spin += dtime(&tm);
-
-		if (got_pointer_input > gp) {
-			flush2 = 1;
-			input += eat_pointer(max_ptr_eat, 1);
-			gp = got_pointer_input;
-		}
-		if (got_keyboard_input > gk) {
-			gk = got_keyboard_input;
-			input++;
-		}
-		X_LOCK;
-#if LIBVNCSERVER_HAVE_RECORD
-		SCR_LOCK;
-		XRecordProcessReplies(rdpy_data);
-		SCR_UNLOCK;
-#endif
-		X_UNLOCK;
-
-		if (! input) {
-			spin_check = 1.5 * max_spin[scroll_rep];
-		} else {
-			spin_check = max_spin[scroll_rep];
-		}
-
-		if (button_up_time > 0.0) {
-			if (tm > button_up_time + max_spin[scroll_rep]) {
-if (db) fprintf(stderr, "check_xrecord: SPIN-OUT-BUTTON_UP: %.3f/%.3f\n", spin, tm - button_up_time);
-				break;
-			}
-		} else if (!scr_cnt) {
-			if (spin >= spin_check) {
-
-if (db) fprintf(stderr, "check_xrecord: SPIN-OUT-1: %.3f/%.3f\n", spin, spin_check);
-				fail = 1;
-				break;
-			}
-		} else {
-			if (tm >= last_scroll + persist[scroll_rep]) {
-
-if (db) fprintf(stderr, "check_xrecord: SPIN-OUT-2: %.3f/%.3f\n", spin, tm - last_scroll);
-				break;
-			}
-		}
-		if (spin >= max_long[scroll_rep]) {
-
-if (db) fprintf(stderr, "check_xrecord: SPIN-OUT-3: %.3f/%.3f\n", spin, max_long[scroll_rep]);
-			break;
-		}
-
-		if (! button_mask) {
-			int doflush = 0;
-			if (button_up_time > 0.0) {
-				;
-			} else if (came_back_in) {
-				dtime0(&button_up_time);
-				doflush = 1;
-			} else if (scroll_wheel) {
-if (db) fprintf(stderr, "check_xrecord: SCROLL-WHEEL-BUTTON-UP-KEEP-GOING:  %.3f/%.3f %d/%d %d/%d\n", spin, max_long[scroll_rep], last_x, last_y, cursor_x, cursor_y);
-				doflush = 1;
-				dtime0(&button_up_time);
-			} else if (last_x == cursor_x && last_y == cursor_y) {
-if (db) fprintf(stderr, "check_xrecord: BUTTON-UP:  %.3f/%.3f %d/%d %d/%d\n", spin, max_long[scroll_rep], last_x, last_y, cursor_x, cursor_y);
-				break;
-			} else {
-if (db) fprintf(stderr, "check_xrecord: BUTTON-UP-KEEP-GOING:  %.3f/%.3f %d/%d %d/%d\n", spin, max_long[scroll_rep], last_x, last_y, cursor_x, cursor_y);
-				doflush = 1;
-				dtime0(&button_up_time);
-			}
-			if (doflush) {
-				flush1 = 1;
-				X_LOCK;
-				XFlush_wr(dpy);
-				X_UNLOCK;
-				dtime0(&last_flush);
-			}
-		}
-
-		last_x = cursor_x;
-		last_y = cursor_y;
-	}
-
-	if (got_one) {
-		set_xdamage_mark(last_wx, last_wy, last_ww, last_wh);
-	}
-
-	if (fail) {
-		scrollability(xrecord_ptr_window, SCR_FAIL);
-	}
-
-	/* flush any remaining pointer events. */
-	button_mask_save = button_mask;
-	pointer_queued_sent = 0;
-	last_x = cursor_x;
-	last_y = cursor_y;
-	pointer_event(-1, 0, 0, NULL);
-	pointer_flush_delay = 0.0;
-
-	if (xrecording && pointer_queued_sent && button_mask_save &&
-	    (last_x != cursor_x || last_y != cursor_y) ) {
-if (db) fprintf(stderr, "  pointer() push yields events on: ret=%d\n", ret);
-		if (ret == 2) {
-if (db) fprintf(stderr, "  we decide to send ret=3\n");
-			want_back_in = 1;
-			ret = 3;
-			flush2 = 1;
-		} else {
-			if (ret) {
-				ret = 1;
-			} else {
-				ret = 0;
-			}
-			xrecord_watch(0, SCR_MOUSE);
-		}
-	} else {
-		if (ret) {
-			ret = 1;
-		} else {
-			ret = 0;
-		}
-		if (xrecording) {
-			xrecord_watch(0, SCR_MOUSE);
-		}
-	}
-
-	if (flush2) {
-		X_LOCK;
-		XFlush_wr(dpy);
-		XFlush_wr(rdpy_ctrl);
-		X_UNLOCK;
-
-		flush2 = 1;
-		dtime0(&last_flush);
-
-if (db) fprintf(stderr, "FLUSH-2\n");
-	}
-
-	/* since we've flushed it, we might as well avoid -input_skip */
-	if (flush1 || flush2) {
-		got_keyboard_input = 0;
-		got_pointer_input = 0;
-	}
-
-	if (ret) {
-		return ret;
-	} else if (scr_cnt) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-int check_xrecord(void) {
-	int watch_keys = 0, watch_mouse = 0, consider_mouse;
-	static int mouse_wants_back_in = 0;
-
-	RAWFB_RET(0)
-
-	if (! use_xrecord) {
-		return 0;
-	}
-	if (unixpw_in_progress) return 0;
-
-	if (skip_cr_when_scaling("scroll")) {
-		return 0;
-	}
-
-if (0) fprintf(stderr, "check_xrecord: IN xrecording: %d\n", xrecording);
-
-	if (! xrecording) {
-		return 0;
-	}
-
-	if (!strcmp(scroll_copyrect, "always")) {
-		watch_keys = 1;
-		watch_mouse = 1;
-	} else if (!strcmp(scroll_copyrect, "keys")) {
-		watch_keys = 1;
-	} else if (!strcmp(scroll_copyrect, "mouse")) {
-		watch_mouse = 1;
-	}
-
-	if (button_mask || mouse_wants_back_in) {
-		consider_mouse = 1;
-	} else {
-		consider_mouse = 0;
-	}
-if (0) fprintf(stderr, "check_xrecord: button_mask: %d  mouse_wants_back_in: %d\n", button_mask, mouse_wants_back_in);
-
-	if (watch_mouse && consider_mouse && xrecord_set_by_mouse) {
-		int ret = check_xrecord_mouse();
-		if (ret == 3) {
-			mouse_wants_back_in = 1;
-		} else {
-			mouse_wants_back_in = 0;
-		}
-		return ret;
-	} else if (watch_keys && xrecord_set_by_keys) {
-		mouse_wants_back_in = 0;
-		return check_xrecord_keys();
-	} else {
-		mouse_wants_back_in = 0;
-		return 0;
-	}
-}
-
-#define DB_SET \
-	int db  = 0; \
-	int db2 = 0; \
-	if (debug_wireframe == 1) { \
-		db = 1; \
-	} \
-	if (debug_wireframe == 2) { \
-		db2 = 1; \
-	} \
-	if (debug_wireframe == 3) { \
-		db = 1; \
-		db2 = 1; \
-	}
-
-#define NBATCHMAX 1024
-int batch_dxs[NBATCHMAX], batch_dys[NBATCHMAX];
-sraRegionPtr batch_reg[NBATCHMAX];
-
-static int try_copyrect(Window orig_frame, Window frame, int x, int y, int w, int h,
-    int dx, int dy, int *obscured, sraRegionPtr extra_clip, double max_wait, int *nbatch) {
-
-	static int dt_bad = 0;
-	static time_t dt_bad_check = 0;
-	int x1, y1, x2, y2, sent_copyrect = 0;
-	int req, mod, cpy, ncli;
-	double tm, dt;
-	DB_SET
-
-	if (nbatch == NULL) {
-		get_client_regions(&req, &mod, &cpy, &ncli);
-		if (cpy) {
-			/* one is still pending... try to force it out: */
-			if (!fb_push_wait(max_wait, FB_COPY)) {
-				fb_push_wait(max_wait/2, FB_COPY);
-			}
-
-			get_client_regions(&req, &mod, &cpy, &ncli);
-		}
-		if (cpy) {
-			return 0;
-		}
-	}
-
-	*obscured = 0;
-	/*
-	 * XXX KDE and xfce do some weird things with the 
-	 * stacking, it does not match XQueryTree.  Work around
-	 * it for now by CopyRect-ing the *whole* on-screen 
-	 * rectangle (whether obscured or not!)
-	 */
-	if (time(NULL) > dt_bad_check + 5) {
-		char *dt = guess_desktop();
-		if (!strcmp(dt, "kde_maybe_is_ok_now...")) {
-			dt_bad = 1;
-		} else if (!strcmp(dt, "xfce")) {
-			dt_bad = 1;
-		} else {
-			dt_bad = 0;
-		}
-		dt_bad_check = time(NULL);
-	}
-
-	if (clipshift) {
-		x -= coff_x;
-		y -= coff_y;
-	}
-	if (subwin) {
-		x -= off_x;
-		y -= off_y;
-	}
-if (db2) fprintf(stderr, "try_copyrect: 0x%lx/0x%lx  bad: %d stack_list_num: %d\n", orig_frame, frame, dt_bad, stack_list_num);
-
-/* XXX Y dt_bad = 0 */
-	if (dt_bad && wireframe_in_progress) {
-		sraRegionPtr rect;
-		/* send the whole thing... */
-		x1 = crfix(nfix(x,   dpy_x), dx, dpy_x);
-		y1 = crfix(nfix(y,   dpy_y), dy, dpy_y);
-		x2 = crfix(nfix(x+w, dpy_x+1), dx, dpy_x+1);
-		y2 = crfix(nfix(y+h, dpy_y+1), dy, dpy_y+1);
-
-		rect = sraRgnCreateRect(x1, y1, x2, y2);
-
-		if (blackouts) {
-			int i;
-			sraRegionPtr bo_rect;
-			for (i=0; i<blackouts; i++) {
-				bo_rect = sraRgnCreateRect(blackr[i].x1,
-				    blackr[i].y1, blackr[i].x2, blackr[i].y2);
-				sraRgnSubtract(rect, bo_rect);
-				sraRgnDestroy(bo_rect);
-			}
-		}
-		if (!nbatch) {
-			do_copyregion(rect, dx, dy, 0);
-		} else {
-			batch_dxs[*nbatch] = dx;
-			batch_dys[*nbatch] = dy;
-			batch_reg[*nbatch] = sraRgnCreateRgn(rect);
-			(*nbatch)++;
-		}
-		sraRgnDestroy(rect);
-
-		sent_copyrect = 1;
-		*obscured = 1;	/* set to avoid an aggressive push */
-
-	} else if (stack_list_num || dt_bad) {
-		int k, tx1, tx2, ty1, ty2;
-		sraRegionPtr moved_win, tmp_win, whole;
-		sraRectangleIterator *iter;
-		sraRect rect;
-		int saw_me = 0;
-		int orig_x, orig_y;
-		int boff, bwin;
-		XWindowAttributes attr;
-
-		orig_x = x - dx;
-		orig_y = y - dy;
-
-		tx1 = nfix(orig_x,   dpy_x);
-		ty1 = nfix(orig_y,   dpy_y);
-		tx2 = nfix(orig_x+w, dpy_x+1);
-		ty2 = nfix(orig_y+h, dpy_y+1);
-
-if (db2) fprintf(stderr, "moved_win: %4d %3d, %4d %3d  0x%lx ---\n",
-	tx1, ty1, tx2, ty2, frame);
-
-		moved_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-
-		dtime0(&tm);
-
-		boff = get_boff();
-		bwin = get_bwin();
-
-		X_LOCK;
-
-		/*
-		 * loop over the stack, top to bottom until we
-		 * find our wm frame:
-		 */
-		for (k = stack_list_num - 1; k >= 0; k--) {
-			Window swin;
-
-			if (0 && dt_bad) {
-				break;
-			}
-
-			swin = stack_list[k].win;
-if (db2) fprintf(stderr, "sw: %d/%lx\n", k, swin);
-			if (swin == frame || swin == orig_frame) {
- if (db2) {
- saw_me = 1; fprintf(stderr, "  ----------\n");
- } else {
-				break;	
- }
-			}
-
-			/* skip some unwanted cases: */
-#ifndef MACOSX
-			if (swin == None) {
-				continue;
-			}
-#endif
-			if (boff <= (int) swin && (int) swin < boff + bwin) {
-				;	/* blackouts */
-			} else if (! stack_list[k].fetched ||
-			    stack_list[k].time > tm + 2.0) {
-				if (!valid_window(swin, &attr, 1)) {
-					stack_list[k].valid = 0;
-				} else {
-					stack_list[k].valid = 1;
-					stack_list[k].x = attr.x;
-					stack_list[k].y = attr.y;
-					stack_list[k].width = attr.width;
-					stack_list[k].height = attr.height;
-					stack_list[k].border_width = attr.border_width;
-					stack_list[k].depth = attr.depth;
-					stack_list[k].class = attr.class;
-					stack_list[k].backing_store =
-					    attr.backing_store;
-					stack_list[k].map_state =
-					    attr.map_state;
-				}
-				stack_list[k].fetched = 1;
-				stack_list[k].time = tm;
-			}
-			if (!stack_list[k].valid) {
-				continue;
-			}
-
-			attr.x      = stack_list[k].x;
-			attr.y      = stack_list[k].y;
-			attr.depth  = stack_list[k].depth;
-			attr.width  = stack_list[k].width;
-			attr.height = stack_list[k].height;
-			attr.border_width = stack_list[k].border_width;
-			attr.map_state = stack_list[k].map_state;
-
-			if (attr.map_state != IsViewable) {
-				continue;
-			}
-if (db2) fprintf(stderr, "sw: %d/%lx  %dx%d+%d+%d\n", k, swin, stack_list[k].width, stack_list[k].height, stack_list[k].x, stack_list[k].y);
-
-			if (clipshift) {
-				attr.x -= coff_x;
-				attr.y -= coff_y;
-			}
-			if (subwin) {
-				attr.x -= off_x;
-				attr.y -= off_y;
-			}
-
-			/*
-			 * first subtract any overlap from the initial
-			 * window rectangle
-			 */
-
-			/* clip the window to the visible screen: */
-			tx1 = nfix(attr.x, dpy_x);
-			ty1 = nfix(attr.y, dpy_y);
-			tx2 = nfix(attr.x + attr.width,  dpy_x+1);
-			ty2 = nfix(attr.y + attr.height, dpy_y+1);
-
-if (db2) fprintf(stderr, "  tmp_win-1: %4d %3d, %4d %3d  0x%lx\n",
-	tx1, ty1, tx2, ty2, swin);
-if (db2 && saw_me) continue;
-
-			/* see if window clips us: */
-			tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-			if (sraRgnAnd(tmp_win, moved_win)) {
-				*obscured = 1;
-if (db2) fprintf(stderr, "         : clips it.\n");
-			}
-			sraRgnDestroy(tmp_win);
-
-			/* subtract it from our region: */
-			tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-			sraRgnSubtract(moved_win, tmp_win);
-			sraRgnDestroy(tmp_win);
-
-			/*
-			 * next, subtract from the initial window rectangle
-			 * anything that would clip it.
-			 */
-
-			/* clip the window to the visible screen: */
-			tx1 = nfix(attr.x - dx, dpy_x);
-			ty1 = nfix(attr.y - dy, dpy_y);
-			tx2 = nfix(attr.x - dx + attr.width,  dpy_x+1);
-			ty2 = nfix(attr.y - dy + attr.height, dpy_y+1);
-
-if (db2) fprintf(stderr, "  tmp_win-2: %4d %3d, %4d %3d  0x%lx\n",
-	tx1, ty1, tx2, ty2, swin);
-if (db2 && saw_me) continue;
-
-			/* subtract it from our region: */
-			tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-			sraRgnSubtract(moved_win, tmp_win);
-			sraRgnDestroy(tmp_win);
-		}
-
-		X_UNLOCK;
-
-		if (extra_clip && ! sraRgnEmpty(extra_clip)) {
-		    whole = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-
-		    if (clipshift) {
-			sraRgnOffset(extra_clip, -coff_x, -coff_y);
-		    }
-		    if (subwin) {
-			sraRgnOffset(extra_clip, -off_x, -off_y);
-		    }
-
-		    iter = sraRgnGetIterator(extra_clip);
-		    while (sraRgnIteratorNext(iter, &rect)) {
-			/* clip the window to the visible screen: */
-			tx1 = rect.x1;
-			ty1 = rect.y1;
-			tx2 = rect.x2;
-			ty2 = rect.y2;
-			tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-			sraRgnAnd(tmp_win, whole);
-
-			/* see if window clips us: */
-			if (sraRgnAnd(tmp_win, moved_win)) {
-				*obscured = 1;
-			}
-			sraRgnDestroy(tmp_win);
-
-			/* subtract it from our region: */
-			tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-			sraRgnSubtract(moved_win, tmp_win);
-			sraRgnDestroy(tmp_win);
-
-			/*
-			 * next, subtract from the initial window rectangle
-			 * anything that would clip it.
-			 */
-			tmp_win = sraRgnCreateRect(tx1, ty1, tx2, ty2);
-			sraRgnOffset(tmp_win, -dx, -dy);
-
-			/* clip the window to the visible screen: */
-			sraRgnAnd(tmp_win, whole);
-
-			/* subtract it from our region: */
-			sraRgnSubtract(moved_win, tmp_win);
-			sraRgnDestroy(tmp_win);
-		    }
-		    sraRgnReleaseIterator(iter);
-		    sraRgnDestroy(whole);
-		}
-
-		dt = dtime(&tm);
-if (db2) fprintf(stderr, "  stack_work dt: %.4f\n", dt);
-
-		if (*obscured && !strcmp(wireframe_copyrect, "top")) {
-			;	/* cannot send CopyRegion */
-		} else if (! sraRgnEmpty(moved_win)) {
-			sraRegionPtr whole, shifted_region;
-
-			whole = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-			shifted_region = sraRgnCreateRgn(moved_win);
-			sraRgnOffset(shifted_region, dx, dy);
-			sraRgnAnd(shifted_region, whole);
-
-			sraRgnDestroy(whole);
-
-			/* now send the CopyRegion: */
-			if (! sraRgnEmpty(shifted_region)) {
-				dtime0(&tm);
-				if (!nbatch) {
-					do_copyregion(shifted_region, dx, dy, 0);
-				} else {
-					batch_dxs[*nbatch] = dx;
-					batch_dys[*nbatch] = dy;
-					batch_reg[*nbatch] = sraRgnCreateRgn(shifted_region);
-					(*nbatch)++;
-					
-				}
-				dt = dtime(&tm);
-if (0 || db2) fprintf(stderr, "do_copyregion: %d %d %d %d  dx: %d  dy: %d dt: %.4f\n",
-	tx1, ty1, tx2, ty2, dx, dy, dt);
-				sent_copyrect = 1;
-			}
-			sraRgnDestroy(shifted_region);
-		}
-		sraRgnDestroy(moved_win);
-	}
-	return sent_copyrect;
-}
-		
-int near_wm_edge(int x, int y, int w, int h, int px, int py) {
-	/* heuristics: */
-	int wf_t = wireframe_top;
-	int wf_b = wireframe_bot;
-	int wf_l = wireframe_left;
-	int wf_r = wireframe_right;
-
-	int near_edge = 0;
-	
-	if (wf_t || wf_b || wf_l || wf_r) {
-		if (nabs(y - py) < wf_t) {
-			near_edge = 1;
-		}
-		if (nabs(y + h - py) < wf_b) {
-			near_edge = 1;
-		}
-		if (nabs(x - px) < wf_l) {
-			near_edge = 1;
-		}
-		if (nabs(x + w - px) < wf_r) {
-			near_edge = 1;
-		}
-	} else {
-		/* all zero; always "near" edge: */
-		near_edge = 1;
-	}
-	return near_edge;
-}
-
-int near_scrollbar_edge(int x, int y, int w, int h, int px, int py) {
-	/* heuristics: */
-	int sb_t = scrollcopyrect_top;
-	int sb_b = scrollcopyrect_bot;
-	int sb_l = scrollcopyrect_left;
-	int sb_r = scrollcopyrect_right;
-
-	int near_edge = 0;
-	
-	if (sb_t || sb_b || sb_l || sb_r) {
-		if (nabs(y - py) < sb_t) {
-			near_edge = 1;
-		}
-		if (nabs(y + h - py) < sb_b) {
-			near_edge = 1;
-		}
-		if (nabs(x - px) < sb_l) {
-			near_edge = 1;
-		}
-		if (nabs(x + w - px) < sb_r) {
-			near_edge = 1;
-		}
-	} else {
-		/* all zero; always "near" edge: */
-		near_edge = 1;
-	}
-	return near_edge;
-}
-
-void check_fixscreen(void) {
-	double now = dnow();
-	int didfull = 0, db = 0;
-
-	if (!client_count) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	if (screen_fixup_X > 0.0) {
-		static double last = 0.0;
-		if (now > last + screen_fixup_X) {
-			if (db) rfbLog("doing screen_fixup_X\n");
-			do_copy_screen = 1;
-			last = now;
-			didfull = 1;
-		}
-		
-	}
-	if (screen_fixup_V > 0.0) {
-		static double last = 0.0;
-		if (now > last + screen_fixup_V) {
-			if (! didfull) {
-				refresh_screen(0);
-				if (db) rfbLog("doing screen_fixup_V\n");
-			}
-			last = now;
-			didfull = 1;
-		}
-	}
-	if (screen_fixup_C > 0.0) {
-		static double last = 0.0;
-		if (last_copyrect_fix < last_copyrect &&
-		    now > last_copyrect + screen_fixup_C) {
-			if (! didfull) {
-				refresh_screen(0);
-				if (db) rfbLog("doing screen_fixup_C\n");
-			}
-			last_copyrect_fix = now;
-			last = now;
-			didfull = 1;
-		}
-	}
-	if (scaling && last_copyrect_fix < last_copyrect) {
-		static double last = 0.0;
-		double delay = 3.0;
-		if (now > last + delay) {
-			if (! didfull) {
-				scale_and_mark_rect(0, 0, dpy_x, dpy_y, 1);
-				if (db) rfbLog("doing scale screen_fixup\n");
-			}
-			last_copyrect_fix = now;
-			last = now;
-			didfull = 1;
-		}
-	}
-	if (advertise_truecolor && advertise_truecolor_reset && indexed_color) {
-		/* this will reset framebuffer to correct colors, if needed */
-		static double dlast = 0.0;
-		now = dnow();
-		if (now > last_client + 1.0 && now < last_client + 3.0 && now > dlast + 5.0) {
-			rfbLog("advertise truecolor reset framebuffer\n");
-			do_new_fb(1);
-			dlast = dnow();
-			return;
-		}
-	}
-}
-
-static int wireframe_mod_state() {
-	if (! wireframe_mods) {
-		return 0;
-	}
-	if (!strcmp(wireframe_mods, "all")) {
-		if (track_mod_state(NoSymbol, FALSE, FALSE)) {
-			return 1;
-		} else {
-			return 0;
-		}
-
-	} else if (!strcmp(wireframe_mods, "Alt")) {
-		if (track_mod_state(XK_Alt_L, FALSE, FALSE) == 1) {
-			return 1;
-		} else if (track_mod_state(XK_Alt_R, FALSE, FALSE) == 1) {
-			return 1;
-		}
-	} else if (!strcmp(wireframe_mods, "Shift")) {
-		if (track_mod_state(XK_Shift_L, FALSE, FALSE) == 1) {
-			return 1;
-		} else if (track_mod_state(XK_Shift_R, FALSE, FALSE) == 1) {
-			return 1;
-		}
-	} else if (!strcmp(wireframe_mods, "Control")) {
-		if (track_mod_state(XK_Control_L, FALSE, FALSE) == 1) {
-			return 1;
-		} else if (track_mod_state(XK_Control_R, FALSE, FALSE) == 1) {
-			return 1;
-		}
-	} else if (!strcmp(wireframe_mods, "Meta")) {
-		if (track_mod_state(XK_Meta_L, FALSE, FALSE) == 1) {
-			return 1;
-		} else if (track_mod_state(XK_Meta_R, FALSE, FALSE) == 1) {
-			return 1;
-		}
-	} else if (!strcmp(wireframe_mods, "Super")) {
-		if (track_mod_state(XK_Super_L, FALSE, FALSE) == 1) {
-			return 1;
-		} else if (track_mod_state(XK_Super_R, FALSE, FALSE) == 1) {
-			return 1;
-		}
-	} else if (!strcmp(wireframe_mods, "Hyper")) {
-		if (track_mod_state(XK_Hyper_L, FALSE, FALSE) == 1) {
-			return 1;
-		} else if (track_mod_state(XK_Hyper_R, FALSE, FALSE) == 1) {
-			return 1;
-		}
-	}
-	return 0;
-}
-
-static int NPP_nreg = 0;
-static sraRegionPtr NPP_roffscreen = NULL;
-static sraRegionPtr NPP_r_bs_tmp = NULL;
-static Window NPP_nwin = None;
-
-void clear_win_events(Window win, int vis) {
-#if !NO_X11
-	if (dpy && win != None && ncache) {
-		XEvent ev;
-		XErrorHandler old_handler;
-		old_handler = XSetErrorHandler(trap_xerror);
-		trapped_xerror = 0;
-		while (XCheckTypedWindowEvent(dpy, win, ConfigureNotify, &ev)) {
-			if (ncdb) fprintf(stderr, ".");
-			if (trapped_xerror) {
-				break;
-			}
-			trapped_xerror = 0;
-		}
-/* XXX Y */
-		if (vis) {
-			while (XCheckTypedWindowEvent(dpy, win, VisibilityNotify, &ev)) {
-				if (ncdb) fprintf(stderr, "+");
-				if (trapped_xerror) {
-					break;
-				}
-				trapped_xerror = 0;
-			}
-		}
-		XSetErrorHandler(old_handler);
-		if (ncdb) fprintf(stderr, " 0x%lx\n", win);
-	}
-#endif
-}
-
-void push_borders(sraRect *rects, int nrect) {
-		int i, s = 2;
-		sraRegionPtr r0, r1, r2;
-
-		r0 = sraRgnCreate(); 
-		r1 = sraRgnCreateRect(0, 0, dpy_x, dpy_y); 
-
-		for (i=0; i<nrect; i++) {
-			int x = rects[i].x1;
-			int y = rects[i].y1;
-			int w = rects[i].x2;
-			int h = rects[i].y2;
-
-			if (w > 0 && h > 0 && w * h > 64 * 64) {
-				r2 = sraRgnCreateRect(x - s, y , x , y + h); 
-				sraRgnOr(r0, r2); 
-				sraRgnDestroy(r2);
-				
-				r2 = sraRgnCreateRect(x + w, y , x + w + s, y + h); 
-				sraRgnOr(r0, r2); 
-				sraRgnDestroy(r2);
-
-				r2 = sraRgnCreateRect(x - s, y - s, x + w + s, y + s); 
-				sraRgnOr(r0, r2); 
-				sraRgnDestroy(r2);
-				
-				r2 = sraRgnCreateRect(x - s, y , x + w + s, y + h + s); 
-				sraRgnOr(r0, r2); 
-				sraRgnDestroy(r2);
-			}
-		}
-
-		sraRgnAnd(r0, r1); 
-
-		if (!sraRgnEmpty(r0)) {
-			double d = dnow();
-			sraRectangleIterator *iter;
-			sraRect rect;
-			int db = 0;
-
-			if (db) fprintf(stderr, "SCALE_BORDER\n");
-			fb_push_wait(0.05, FB_MOD|FB_COPY);
-
-			iter = sraRgnGetIterator(r0);
-			while (sraRgnIteratorNext(iter, &rect)) {
-				/* clip the window to the visible screen: */
-				int tx1 = rect.x1;
-				int ty1 = rect.y1;
-				int tx2 = rect.x2;
-				int ty2 = rect.y2;
-				scale_and_mark_rect(tx1, ty1, tx2, ty2, 1);
-			}
-			sraRgnReleaseIterator(iter);
-
-			if (db) fprintf(stderr, "SCALE_BORDER %.4f\n", dnow() - d);
-			fb_push_wait(0.1, FB_MOD|FB_COPY);
-			if (db) fprintf(stderr, "SCALE_BORDER %.4f\n", dnow() - d);
-		}
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r1);
-}
-
-void ncache_pre_portions(Window orig_frame, Window frame, int *nidx_in, int try_batch, int *use_batch,
-    int orig_x, int orig_y, int orig_w, int orig_h, int x, int y, int w, int h, double ntim) {
-	int nidx, np = ncache_pad;
-
-	if (!ntim) {}
-	*use_batch = 0;
-	*nidx_in = -1;
-	NPP_nreg = 0;
-	NPP_roffscreen = NULL;
-	NPP_r_bs_tmp = NULL;
-	NPP_nwin = None;
-	
-	if (ncache <= 0) {
-		return;
-	}
-
-	if (rotating) {
-		try_batch = 0;
-	}
-
-	if (*nidx_in == -1) {
-		nidx = lookup_win_index(orig_frame);
-		NPP_nwin = orig_frame;
-		if (nidx < 0) {
-			nidx = lookup_win_index(frame);
-			NPP_nwin = frame;
-		}
-	} else {
-		nidx = *nidx_in;
-	}
-	if (nidx > 0) {
-		sraRegionPtr r0, r1, r2;
-		int dx, dy;
-		int bs_x = cache_list[nidx].bs_x;	
-		int bs_y = cache_list[nidx].bs_y;	
-		int bs_w = cache_list[nidx].bs_w;	
-		int bs_h = cache_list[nidx].bs_h;	
-
-		*nidx_in = nidx;
-
-		if (bs_x < 0) {
-			if (!find_rect(nidx, x, y, w, h)) {
-				nidx = -1;
-				return;
-			}
-			bs_x = cache_list[nidx].bs_x;
-			bs_y = cache_list[nidx].bs_y;
-			bs_w = cache_list[nidx].bs_w;
-			bs_h = cache_list[nidx].bs_h;
-		}
-		if (bs_x < 0) {
-			nidx = -1;
-			return;
-		}
-
-		if (try_batch) {
-			*use_batch = 1;
-		}
-
-		if (ncache_pad) {
-			orig_x -= np;	
-			orig_y -= np;	
-			orig_w += 2 * np;	
-			orig_h += 2 * np;	
-			x -= np;	
-			y -= np;	
-			w += 2 * np;	
-			h += 2 * np;	
-		}
-
-		if (clipshift) {
-			orig_x -= coff_x;
-			orig_y -= coff_y;
-			x -= coff_x;
-			y -= coff_y;
-		}
-
-		r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y); 
-
-		r2 = sraRgnCreateRect(orig_x, orig_y, orig_x + orig_w, orig_y + orig_h);
-		sraRgnSubtract(r2, r0);
-		if (! sraRgnEmpty(r2) && cache_list[nidx].bs_time > 0.0) {
-			/* some is initially offscreen */
-			dx = bs_x - orig_x;
-			dy = bs_y - orig_y;
-			sraRgnOffset(r2, dx, dy);
-			dx = 0;
-			dy = dpy_y;
-			sraRgnOffset(r2, dx, dy);
-if (ncdb) fprintf(stderr, "FB_COPY: %.4f 1) offscreen:  dx, dy: %d, %d -> %d, %d orig %dx%d+%d+%d bs_xy: %d %d\n",
-    dnow() - ntim, bs_x - orig_x, bs_y - orig_y, dx, dy, orig_w, orig_h, orig_x, orig_y, bs_x, bs_y);
-
-			/* 0) save it in the invalid (offscreen) SU portion */
-			if (! *use_batch) {
-				do_copyregion(r2, dx, dy, 0);
-				if (! fb_push_wait(0.2, FB_COPY)) {
-					fb_push_wait(0.1, FB_COPY);
-				}
-			} else {
-				batch_dxs[NPP_nreg] = dx;
-				batch_dys[NPP_nreg] = dy;
-				batch_reg[NPP_nreg++] = sraRgnCreateRgn(r2);
-			}
-			NPP_roffscreen = sraRgnCreateRgn(r2);
-		}
-		sraRgnDestroy(r2);
-
-		/* 1) use bs for temp storage of the new save under. */
-		r1 = sraRgnCreateRect(x, y, x + w, y + h);
-		sraRgnAnd(r1, r0);
-
-		dx = bs_x - x;
-		dy = bs_y - y;
-		sraRgnOffset(r1, dx, dy);
-
-if (ncdb) fprintf(stderr, "FB_COPY: %.4f 1) use tmp bs:\n", dnow() - ntim);
-		if (! *use_batch) {
-			do_copyregion(r1, dx, dy, 0);
-			if (! fb_push_wait(0.2, FB_COPY)) {
-if (ncdb) fprintf(stderr, "FB_COPY: %.4f 1) FAILED.\n", dnow() - ntim);
-				fb_push_wait(0.1, FB_COPY);
-			}
-		} else {
-			batch_dxs[NPP_nreg] = dx;
-			batch_dys[NPP_nreg] = dy;
-			batch_reg[NPP_nreg++] = sraRgnCreateRgn(r1);
-		}
-		NPP_r_bs_tmp = sraRgnCreateRgn(r1);
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r1);
-	}
-}
-
-void ncache_post_portions(int nidx, int use_batch, int orig_x, int orig_y, int orig_w, int orig_h,
-    int x, int y, int w, int h, double batch_delay, double ntim) {
-	int np = ncache_pad;
-	int db = 0;
-
-	if (ncache > 0 && nidx >= 0) {
-		sraRegionPtr r0, r1, r2, r3;
-		int dx, dy;
-		int su_x = cache_list[nidx].su_x;
-		int su_y = cache_list[nidx].su_y;
-		int su_w = cache_list[nidx].su_w;
-		int su_h = cache_list[nidx].su_h;
-		int bs_x = cache_list[nidx].bs_x;
-		int bs_y = cache_list[nidx].bs_y;
-		int bs_w = cache_list[nidx].bs_w;
-		int bs_h = cache_list[nidx].bs_h;
-		int some_su = 0;
-
-if (db) fprintf(stderr, "su: %dx%d+%d+%d  bs: %dx%d+%d+%d\n", su_w, su_h, su_x, su_y, bs_w, bs_h, bs_x, bs_y);
-
-		if (bs_x < 0) {
-			if (!find_rect(nidx, x, y, w, h)) {
-				return;
-			}
-			su_x = cache_list[nidx].su_x;
-			su_y = cache_list[nidx].su_y;
-			su_w = cache_list[nidx].su_w;
-			su_h = cache_list[nidx].su_h;
-			bs_x = cache_list[nidx].bs_x;
-			bs_y = cache_list[nidx].bs_y;
-			bs_w = cache_list[nidx].bs_w;
-			bs_h = cache_list[nidx].bs_h;
-		}
-		if (bs_x < 0) {
-			return;
-		}
-
-		if (ncache_pad) {
-			orig_x -= np;	
-			orig_y -= np;	
-			orig_w += 2 * np;	
-			orig_h += 2 * np;	
-			x -= np;	
-			y -= np;	
-			w += 2 * np;	
-			h += 2 * np;	
-		}
-
-		if (clipshift) {
-			orig_x -= coff_x;
-			orig_y -= coff_y;
-			x -= coff_x;
-			y -= coff_y;
-		}
-
-		r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y); 
-
-		/* 0b) copy this bs part stored in saveunder */
-		if (NPP_roffscreen != NULL) {
-			dx = x - su_x;
-			dy = y - su_y;
-			sraRgnOffset(NPP_roffscreen, dx, dy);
-			sraRgnAnd(NPP_roffscreen, r0);
-			
-			if (! use_batch) {
-				do_copyregion(NPP_roffscreen, dx, dy, 0);
-				if (!fb_push_wait(0.2, FB_COPY)) {
-					fb_push_wait(0.1, FB_COPY);
-				}
-			} else {
-				batch_dxs[NPP_nreg] = dx;
-				batch_dys[NPP_nreg] = dy;
-				batch_reg[NPP_nreg++] = sraRgnCreateRgn(NPP_roffscreen);
-			}
-			sraRgnDestroy(NPP_roffscreen);
-		}
-
-		/* 3) copy from the saveunder to where orig win was */
-		r1 = sraRgnCreateRect(orig_x, orig_y, orig_x + orig_w, orig_y + orig_h);
-		sraRgnAnd(r1, r0);
-		r2 = sraRgnCreateRect(x+np, y+np, x + w-np, y + h-np);
-		sraRgnAnd(r2, r0);
-		sraRgnSubtract(r1, r2);
-
-		dx = orig_x - su_x;
-		dy = orig_y - su_y;
-if (db && ncdb) fprintf(stderr, "FB_COPY: %.4f 3) sent_copyrect: su_restore: %d %d\n", dnow() - ntim, dx, dy);
-		if (cache_list[nidx].su_time == 0.0) {
-			;
-		} else if (! use_batch) {
-			do_copyregion(r1, dx, dy, 0);
-			if (!fb_push_wait(0.2, FB_COPY)) {
-if (db && ncdb) fprintf(stderr, "FB_COPY: %.4f 3) FAILED.\n", dnow() - ntim);
-				fb_push_wait(0.1, FB_COPY);
-			}
-		} else {
-			batch_dxs[NPP_nreg] = dx;
-			batch_dys[NPP_nreg] = dy;
-			batch_reg[NPP_nreg++] = sraRgnCreateRgn(r1);
-		}
-if (db && ncdb) fprintf(stderr, "sent_copyrect: %.4f su_restore: done.\n", dnow() - ntim);
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r1);
-		sraRgnDestroy(r2);
-
-		/* 4) if overlap between orig and displaced, move the corner that will still be su: */
-		r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y); 
-
-		r1 = sraRgnCreateRect(orig_x, orig_y, orig_x + orig_w, orig_y + orig_h);
-		sraRgnAnd(r1, r0);
-		r2 = sraRgnCreateRect(x, y, x + w, y + h);
-		sraRgnAnd(r2, r0);
-		r3 = NULL;
-		if (sraRgnAnd(r2, r1) && cache_list[nidx].su_time > 0.0) {
-			int dx2 = su_x - orig_x;
-			int dy2 = su_y - orig_y;
-
-			r3 = sraRgnCreateRgn(r2);
-			sraRgnOffset(r2, dx2, dy2); 
-
-			dx = su_x - x;
-			dy = su_y - y;
-			sraRgnOffset(r3, dx, dy); 
-
-			dx = dx - dx2;
-			dy = dy - dy2;
-
-if (db && ncdb) fprintf(stderr, "FB_COPY: %.4f 4) move overlap inside su:\n", dnow() - ntim);
-			if (! use_batch) {
-				do_copyregion(r3, dx, dy, 0);
-				if (!fb_push_wait(0.2, FB_COPY)) {
-if (db) fprintf(stderr, "FB_COPY: %.4f 4) FAILED.\n", dnow() - ntim);
-					fb_push_wait(0.1, FB_COPY);
-				}
-			} else {
-				batch_dxs[NPP_nreg] = dx;
-				batch_dys[NPP_nreg] = dy;
-				batch_reg[NPP_nreg++] = sraRgnCreateRgn(r3);
-			}
-		}
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r1);
-		sraRgnDestroy(r2);
-
-		/* 5) copy our temporary stuff from bs to su: */
-		dx = su_x - bs_x;
-		dy = su_y - bs_y;
-		if (NPP_r_bs_tmp == NULL) {
-			r1 = sraRgnCreateRect(su_x, su_y, su_x + su_w, su_y + su_h); 
-		} else {
-			r1 = sraRgnCreateRgn(NPP_r_bs_tmp);
-			sraRgnOffset(r1, dx, dy);
-			sraRgnDestroy(NPP_r_bs_tmp);
-		}
-		if (r3 != NULL) {
-			sraRgnSubtract(r1, r3);
-			sraRgnDestroy(r3);
-		}
-if (db) fprintf(stderr, "FB_COPY: %.4f 5) move tmp bs to su:\n", dnow() - ntim);
-		if (! use_batch) {
-			do_copyregion(r1, dx, dy, 0);
-			if (!fb_push_wait(0.2, FB_COPY)) {
-if (db) fprintf(stderr, "FB_COPY: %.4f 5) FAILED.\n", dnow() - ntim);
-				fb_push_wait(0.1, FB_COPY);
-			}
-		} else {
-			batch_dxs[NPP_nreg] = dx;
-			batch_dys[NPP_nreg] = dy;
-			batch_reg[NPP_nreg++] = sraRgnCreateRgn(r1);
-		}
-		if (! sraRgnEmpty(r1)) {
-			some_su = 1;
-		}
-		sraRgnDestroy(r1);
-
-		/* 6) not really necessary, update bs with current view: */
-		r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y); 
-		r1 = sraRgnCreateRect(x, y, x + w, y + h);
-		sraRgnAnd(r1, r0);
-		dx = bs_x - x;
-		dy = bs_y - y;
-		sraRgnOffset(r1, dx, dy);
-if (db) fprintf(stderr, "FB_COPY: %.4f 6) snapshot bs:\n", dnow() - ntim);
-		if (! use_batch) {
-			do_copyregion(r1, dx, dy, 0);
-			if (!fb_push_wait(0.2, FB_COPY)) {
-if (db) fprintf(stderr, "FB_COPY: %.4f 6) FAILED.\n", dnow() - ntim);
-				fb_push_wait(0.1, FB_COPY);
-			}
-		} else {
-			batch_dxs[NPP_nreg] = dx;
-			batch_dys[NPP_nreg] = dy;
-			batch_reg[NPP_nreg++] = sraRgnCreateRgn(r1);
-		}
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r1);
-
-		if (use_batch) {
-			batch_push(NPP_nreg, batch_delay);
-if (ncdb) fprintf(stderr, "FB_COPY: %.4f XX did batch 0x%x %3d su: %dx%d+%d+%d  bs: %dx%d+%d+%d\n", dnow() - ntim,
-	(unsigned int) cache_list[nidx].win, nidx, su_w, su_h, su_x, su_y, bs_w, bs_h, bs_x, bs_y);
-		}
-		cache_list[nidx].x = x + np;
-		cache_list[nidx].y = y + np;
-
-		/* XXX Y */
-		cache_list[nidx].bs_time = dnow();
-		if (some_su) {
-			cache_list[nidx].su_time = dnow();
-		}
-	} else {
-		if (use_batch) {
-			batch_push(NPP_nreg, batch_delay);
-		}
-	}
-
-	if (scaling) {
-		sraRect rects[2];	
-
-		rects[0].x1 = orig_x;
-		rects[0].y1 = orig_y;
-		rects[0].x2 = orig_w;
-		rects[0].y2 = orig_h;
-
-		rects[1].x1 = x;
-		rects[1].y1 = y;
-		rects[1].x2 = w;
-		rects[1].y2 = h;
-		push_borders(rects, 2);
-	}
-}
-
-void do_copyrect_drag_move(Window orig_frame, Window frame, int *nidx, int try_batch,
-    int now_x, int now_y, int orig_w, int orig_h, int x, int y, int w, int h, double batch_delay) {
-
-	int sent_copyrect = 1, obscured = 0;
-	int dx, dy;
-	int use_batch = 0;
-	double ntim = dnow();
-	static int nob = -1;
-	sraRegionPtr r0, r1;
-
-	if (nob < 0) {
-		if (getenv("NOCRBATCH")) {
-			nob = 1;
-		} else {
-			nob = 0;
-		}
-	}
-	if (nob) {
-		try_batch = 0;
-	}
-
-	dx = x - now_x;
-	dy = y - now_y;
-	if (dx == 0 && dy == 0) {
-		return;
-	}
-if (ncdb) fprintf(stderr, "do_COPY: now_xy: %d %d, orig_wh: %d %d, xy: %d %d, wh: %d %d\n",now_x, now_y, orig_w, orig_h, x, y, w, h);
-	
-	ncache_pre_portions(orig_frame, frame, nidx, try_batch, &use_batch,
-	    now_x, now_y, orig_w, orig_h, x, y, w, h, ntim);
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y); 
-	r1 = sraRgnCreateRect(x, y, x + w, y + h);
-	sraRgnAnd(r1, r0);
-
-	dx = x - now_x;
-	dy = y - now_y;
-
-	/* make sure the source is on-screen too */
-	sraRgnOffset(r1, -dx, -dy);
-	sraRgnAnd(r1, r0);
-	sraRgnOffset(r1, +dx, +dy);
-	sraRgnAnd(r1, r0);	/* just to be sure, problably not needed */
-
-	if (! use_batch) {
-		do_copyregion(r1, dx, dy, 0);
-		if (!fb_push_wait(0.2, FB_COPY)) {
-if (ncdb) fprintf(stderr, "FB_COPY: %.4f 3) *FAILED*\n", dnow() - ntim);
-			fb_push_wait(0.1, FB_COPY);
-		}
-	} else {
-		batch_dxs[NPP_nreg] = dx;
-		batch_dys[NPP_nreg] = dy;
-		batch_reg[NPP_nreg++] = sraRgnCreateRgn(r1);
-	}
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r1);
-
-	if (sent_copyrect) {
-		if (use_batch) {
-			;
-		} else if (! obscured) {
-			fb_push_wait(0.1, FB_COPY);
-		} else {
-			/* no diff for now... */
-			fb_push_wait(0.1, FB_COPY);
-		}
-		ncache_post_portions(*nidx, use_batch,
-		    now_x, now_y, orig_w, orig_h, x, y, w, h, batch_delay, ntim);
-	}
-if (ncdb) fprintf(stderr, "do_COPY: %.4f -- post_portion done.\n", dnow() - ntim);
-}
-
-void check_macosx_iconify(Window orig_frame, Window frame, int flush) {
-#ifdef MACOSX
-	static double last = 0.0;
-	double now;
-	int j, m = 5, idx = -1, ok = 0, unmapped = 0;
-
-	if (! macosx_console) {
-		return;
-	}
-
-	now = dnow();
-	if (now < last + 0.3) {
-		return;
-	}
-	last = now;
-
-	if (ncache > 0 && orig_frame != None) {
-		idx = lookup_win_index(orig_frame);
-		if (idx >= 0) {
-			if (cache_list[idx].map_state == IsUnmapped) {
-if (0) fprintf(stderr, "FAW orig_frame unmapped.\n");
-				unmapped = 1;
-				m = 3;
-			}
-		}
-	}
-
-	if (unmapped) {
-		;
-	} else if (orig_frame && macosxCGS_follow_animation_win(orig_frame, -1, 0)) {
-		if (0) fprintf(stderr, "FAW orig_frame %d\n", (int) orig_frame);
-	} else if (0 && frame && macosxCGS_follow_animation_win(frame, -1, 0)) {
-		if (0) fprintf(stderr, "FAW frame      %d\n", (int) frame);
-	}
-	for (j=0; j<m; j++) {
-		macosxCGS_get_all_windows();
-		if (macosx_checkevent(NULL)) {
-			ok = 1;
-			if (0) fprintf(stderr, "Check Event    1\n");
-		} else {
-			if (0) fprintf(stderr, "Check Event    0\n");
-		}
-		if (ok) {
-			break;
-		}
-		usleep(10 * 1000);
-	}
-	if (ok) {
-		if (flush) {
-			fb_push_wait(0.1, FB_COPY|FB_MOD);
-		}
-		check_ncache(0, 2);
-	}
-#else
-	if (!orig_frame || !frame || !flush) {}
-#endif
-}
-
-void check_macosx_click_frame(void) {
-#ifdef MACOSX
-	if (macosx_console) {
-if (0) fprintf(stderr, "macosx_click_frame: 0x%x\n", macosx_click_frame);
-		check_macosx_iconify(macosx_click_frame, None, 0);
-		macosx_click_frame = None;
-		if (button_mask && !macosx_checkevent(NULL)) {
-			check_macosx_iconify(None, None, 0);
-		}
-	}
-#endif
-}
-
-int clipped(int idx);
-void snap_old(void);
-
-int check_copyrect_raise(int idx, Window orig_frame, int try_batch) {
-	char *no = "none";
-	int doraise = 1;
-	int valid;
-	XWindowAttributes attr;
-
-	if (! ncache_wf_raises) {
-		doraise = 0;
-		no = "ncache_wf_raises";
-	} else if (cache_list[idx].bs_time == 0.0) {
-		doraise = 0;
-		no = "bs_time";
-	} else if (0 && cache_list[idx].vis_state == VisibilityUnobscured) {
-		doraise = 0;
-		no = "VisibilityUnobscured";
-	} else if (!clipped(idx)) {
-		doraise = 0;
-		no = "!clipped()";
-	}
-	if (doraise) {
-		int nr = 0, *nb = NULL;
-if (ncdb) fprintf(stderr, "--YES, wf_raise\n");
-		if (try_batch) {
-			nb = &nr;
-		}
-		valid = 1;
-		bs_restore(idx, nb, NULL, &attr, 0, 1, &valid, 1);
-		try_to_fix_su(orig_frame, idx, 0x1, nb, NULL);	
-		if (nb && nr) {
-			batch_push(nr, -1.0);
-		}
-		fb_push(); /* XXX Y */
-	} else {
-if (ncdb && no) fprintf(stderr, "--NO,  wf_raise: %s\n", no);
-	}
-	if (ncache_wf_raises) {
-		snapshot_stack_list(0, 0.0);
-		snap_old();
-	}
-	return 1;
-}
-
-int set_copyrect_drag(int idx, Window orig_frame, int try_batch) {
-	if (idx < 0) {
-		return 0;
-	}
-	if (cache_list[idx].su_time > 0.0) {
-		check_copyrect_raise(idx, orig_frame, try_batch);
-		return 1;
-	}
-	return 0;
-}
-
-/*
- * Applied just before any check_user_input() modes.  Look for a
- * ButtonPress; find window it happened in; find the wm frame window
- * for it; watch for that window moving or resizing.  If it does, do the
- * wireframe animation.  Do this until ButtonRelease or timeouts occur.
- * Remove wireframe.
- *
- * Under -nowirecopyrect, return control to base scheme
- * (check_user_input() ...) that will repaint the screen with the window
- * in the new postion or size.  Under -wirecopyrect, apply rfbDoCopyRect
- * or rfbDoCopyRegion: this "pollutes" our framebuffer, but the normal
- * polling will quickly repair it. Under happy circumstances, this
- * reduces actual XShmGetImage work (i.e. if we correctly predicted how
- * the X fb has changed.
- *
- * -scale doesn't always work under -wirecopyrect, but the wireframe does.
- *
- * testing of this mode under -threads is incomplete.
- *
- * returns 1 if it did an animation, 0 if no move/resize triggers
- * went off.
- *
- * TBD: see if we can select StructureNotify ConfigureNotify events for
- * the toplevel windows to get better info on moves and resizes.
- */
-int check_wireframe(void) {
-	Window frame = None, orig_frame = None;
-	XWindowAttributes attr;
-	int dx, dy;
-
-	int orig_px, orig_py, orig_x, orig_y, orig_w, orig_h;
-	int px, py, x, y, w, h;
-	int box_x, box_y, box_w, box_h;
-	int orig_cursor_x, orig_cursor_y, g, gd;
-	int already_down = 0, win_gone = 0, win_unmapped = 0;
-	double spin = 0.0, tm, last_ptr = 0.0, last_draw;
-
-	int frame_changed = 0, drew_box = 0, got_2nd_pointer = 0;
-	int try_copyrect_drag = 1, do_copyrect_drag = -1;
-	int now_x = 0, now_y = 0, nidx = -1;
-	double copyrect_drag_delay = -1.0;
-	int try_batch = 1;	/* XXX Y */
-	int mac_skip = 0;
-
-	int special_t1 = 0, break_reason = 0, last_draw_cnt = 0, gpi = 0;
-	static double first_dt_ave = 0.0;
-	static int first_dt_cnt = 0;
-	static time_t last_save_stacklist = 0;
-	int bdown0, bdown, gotui, cnt = 0;
-	
-	/* heuristics: */
-	double first_event_spin   = wireframe_t1;
-	double frame_changed_spin = wireframe_t2;
-	double max_spin = wireframe_t3;
-	double min_draw = wireframe_t4;
-	int try_it = 0;
-	DB_SET
-
-	if (unixpw_in_progress) return 0;
-	if (copyrect_drag_delay) {}
-
-#ifdef MACOSX
-	if (macosx_console) {
-		;
-	} else {
-		RAWFB_RET(0)
-	}
-#else
-	RAWFB_RET(0)
-#endif
-
-	if (nofb) {
-		return 0;
-	}
-	if (subwin) {
-		return 0;	/* don't even bother for -id case */
-	}
-
-if (db > 1 && button_mask) fprintf(stderr, "check_wireframe: bm: %d  gpi: %d\n", button_mask, got_pointer_input);
-
-	bdown0 = 0;
-	if (button_mask) {
-		bdown0 = 1;
-	} else if (wireframe_local && display_button_mask) {
-		bdown0 = 2;
-	}
-	if (! bdown0) {
-		return 0;	/* no button pressed down */
-	}
-
-	gotui = 0;
-	if (got_pointer_input) {
-		gotui = 1;
-	} else if (wireframe_local && display_button_mask) {
-		gotui = 2;
-	}
-	if (!use_threads && !gotui) {
-		return 0;	/* need ptr input, e.g. button down, motion */
-	}
-
-if (db > 1) fprintf(stderr, "check_wireframe: %d\n", db);
-
-if (db) fprintf(stderr, "\n*** button down!!  x: %d  y: %d\n", cursor_x, cursor_y);
-
-	/*
-	 * Query where the pointer is and which child of the root
-	 * window.  We will assume this is the frame the window manager
-	 * makes when it reparents the toplevel window.
-	 */
-	X_LOCK;
-	if (! get_wm_frame_pos(&px, &py, &x, &y, &w, &h, &frame, NULL)) {
-if (db) fprintf(stderr, "NO get_wm_frame_pos-1: 0x%lx\n", frame);
-		X_UNLOCK;
-#ifdef MACOSX
-		check_macosx_click_frame();
-#endif
-		return 0;
-	}
-	X_UNLOCK;
-
-	last_get_wm_frame_time = dnow();
-	last_get_wm_frame = frame;
-
-if (db) fprintf(stderr, "a: %d  wf: %.3f  A: %d  origfrm: 0x%lx\n", w*h, wireframe_frac, (dpy_x*dpy_y), frame);
-
-	/*
-	 * apply the percentage size criterion (allow opaque moves for
-	 * small windows)
-	 */
-	if ((double) w*h < wireframe_frac * (dpy_x * dpy_y)) {
-if (db) fprintf(stderr, "small window %.3f\n", ((double) w*h)/(dpy_x * dpy_y));
-		return 0;
-	}
-if (db) fprintf(stderr, "  frame: x: %d  y: %d  w: %d  h: %d  px: %d  py: %d  fr: 0x%lx\n", x, y, w, h, px, py, frame);	
-
-	/*
-	 * see if the pointer is within range of the assumed wm frame
-	 * decorations on the edge of the window.
-	 */
-
-	try_it = near_wm_edge(x, y, w, h, px, py);
-
-	/* Often Alt+ButtonDown starts a window move: */
-	if (! try_it && wireframe_mod_state()) {
-		try_it = 1;
-	}
-	if (try_it && clipshift) {
-		sraRegionPtr r1, r2;
-		int xc = off_x + coff_x;
-		int yc = off_y + coff_y;
-		r1 = sraRgnCreateRect(x, y, x+w, y+h);
-		r2 = sraRgnCreateRect(xc, yc, xc+dpy_x, yc+dpy_y);
-		if (!sraRgnAnd(r1, r2)) {
-if (db) fprintf(stderr, "OUTSIDE CLIPSHIFT\n");
-			try_it = 0;
-		}
-		sraRgnDestroy(r1);
-		sraRgnDestroy(r2);
-	}
-	if (! try_it) {
-if (db) fprintf(stderr, "INTERIOR\n");
-#ifdef MACOSX
-		check_macosx_click_frame();
-#endif
-		return 0;
-	}
-
-	wireframe_in_progress = 1;
-
-	if (button_mask_prev) {
-		already_down = 1;
-	}
-	
-	if (! wireframe_str || !strcmp(wireframe_str, WIREFRAME_PARMS)) {
-		int link, latency, netrate;
-		static int didmsg = 0;
-
-		link = link_rate(&latency, &netrate);
-		if (link == LR_DIALUP || link == LR_BROADBAND) {
-			/* slow link, e.g. dialup, increase timeouts: */
-			first_event_spin   *= 2.0;
-			frame_changed_spin *= 2.0;
-			max_spin *= 2.0;
-			min_draw *= 1.5;
-			if (link == LR_DIALUP) {
-				max_spin *= 1.2;
-				min_draw *= 1.7;
-			}
-			if (! didmsg) {
-				rfbLog("increased wireframe timeouts for "
-				    "slow network connection.\n");
-				rfbLog("netrate: %d KB/sec, latency: %d ms\n",
-				    netrate, latency);
-				didmsg = 1;
-			}
-		}
-	}
-
-	/*
-	 * pointer() should have snapped the stacking list for us, if
-	 * not, do it now (if the XFakeButtonEvent has been flushed by
-	 * now the stacking order may be incorrect).
-	 */
-	if (strcmp(wireframe_copyrect, "never")) {
-		if (already_down) {
-			double age = 0.0;
-			/*
-			 * see if we can reuse the stack list (pause
-			 * with button down)
-			 */
-			if (stack_list_num) {
-				int k, got_me = 0;
-				for (k = stack_list_num -1; k >=0; k--) {
-					if (frame == stack_list[k].win) {
-						got_me = 1;
-						break;
-					}
-				}
-				if (got_me) {
-					age = 1.0;
-				}
-				snapshot_stack_list(0, age);
-			}
-		}
-		if (! stack_list_num) {
-			snapshot_stack_list(0, 0.0);
-		}
-	}
-
-
-	/* store initial parameters, we look for changes in them */
-	orig_frame = frame;
-	orig_px = px;		/* pointer position */
-	orig_py = py;
-	orig_x = x;		/* frame position */
-	orig_y = y;
-	orig_w = w;		/* frame size */
-	orig_h = h;
-
-	orig_cursor_x = cursor_x;
-	orig_cursor_y = cursor_y;
-
-	/* this is the box frame we would draw */
-	box_x = x;
-	box_y = y; 
-	box_w = w;
-	box_h = h; 
-
-	dtime0(&tm);
-
-	last_draw = spin;
-
-	/* -threads support for check_wireframe() is rough... crash? */
-	if (use_threads) {
-		/* purge any stored up pointer events: */
-		pointer_event(-1, 0, 0, NULL);
-	}
-
-	if (cursor_noshape_updates_clients(screen)) {
-		try_batch = 0;
-	}
-	if (rotating) {
-		try_batch = 0;
-	}
-	if (use_threads && ncache > 0 && ncache_copyrect) {
-		try_batch = 0;
-	}
-
-	g = got_pointer_input;
-	gd = got_local_pointer_input;
-
-	while (1) {
-
-		X_LOCK;
-		XFlush_wr(dpy);
-		X_UNLOCK;
-
-		/* try to induce/waitfor some more user input */
-		if (use_threads) {
-			usleep(1000);
-		} else if (drew_box && do_copyrect_drag != 1) {
-			rfbPE(1000);
-		} else {
-			rfbCFD(1000);
-		}
-		if (bdown0 == 2) {
-			/*
-			 * This is to just update display_button_mask
-			 * which will also update got_local_pointer_input.
-			 */
-			check_x11_pointer();
-#if 0
-			/* what was this for? */
-			Window frame;
-			int px, py, x, y, w, h;
-#ifdef MACOSX
-			if (macosx_console) {
-				macosx_get_cursor_pos(&x, &y);
-			}
-			else
-#endif
-			get_wm_frame_pos(&px, &py, &x, &y, &w, &h, &frame, NULL);
-#endif
-		}
-
-		cnt++;
-		spin += dtime(&tm);
-
-if (0) fprintf(stderr, "wf-spin: %.3f\n", spin);
-
-		/* check for any timeouts: */
-		if (frame_changed) {
-			double delay;
-			/* max time we play this game: */
-			if (spin > max_spin) {
-if (db || db2) fprintf(stderr, " SPIN-OUT-MAX: %.3f\n", spin);
-				break_reason = 1;
-				break;
-			}
-			/* watch for pointer events slowing down: */
-			if (special_t1) {
-				delay = max_spin;
-			} else {
-				delay = 2.0* frame_changed_spin;
-				if (spin > 3.0 * frame_changed_spin) {
-					delay = 1.5 * delay;
-				}
-			}
-			if (spin > last_ptr + delay) {
-if (db || db2) fprintf(stderr, " SPIN-OUT-NOT-FAST: %.3f\n", spin);
-				break_reason = 2;
-				break;
-			}
-		} else if (got_2nd_pointer) {
-			/*
-			 * pointer is moving, max time we wait for wm
-			 * move or resize to be detected
-			 */
-			if (spin > frame_changed_spin) {
-if (db || db2) fprintf(stderr, " SPIN-OUT-NOFRAME-SPIN: %.3f\n", spin);
-				break_reason = 3;
-				break;
-			}
-		} else {
-			/* max time we wait for any pointer input */
-			if (spin > first_event_spin) {
-if (db || db2) fprintf(stderr, " SPIN-OUT-NO2ND_PTR: %.3f\n", spin);
-				break_reason = 4;
-				break;
-			}
-		}
-
-		gpi = 0;
-		/* see if some pointer input occurred: */
-		if (got_pointer_input > g ||
-		    (wireframe_local && (got_local_pointer_input > gd))) {
-
-if (db) fprintf(stderr, "  ++pointer event!! [%02d]  dt: %.3f  x: %d  y: %d  mask: %d\n",
-    got_2nd_pointer+1, spin, cursor_x, cursor_y, button_mask);	
-
-			g = got_pointer_input;
-			gd = got_local_pointer_input;
-			gpi = 1;
-
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-
-			/* periodically try to let the wm get moving: */
-			if (!frame_changed && got_2nd_pointer % 4 == 0) {
-				if (got_2nd_pointer == 0) {
-					usleep(50 * 1000);
-				} else {
-					usleep(25 * 1000);
-				}
-			}
-			got_2nd_pointer++;
-			last_ptr = spin;
-
-			/*
-			 * see where the pointer currently is.  It may
-			 * not be our starting frame (i.e. mouse now
-			 * outside of the moving window).
-			 */
-			frame = 0x0;
-			X_LOCK;
-
-			if (! get_wm_frame_pos(&px, &py, &x, &y, &w, &h,
-			    &frame, NULL)) {
-				frame = 0x0;
-if (db) fprintf(stderr, "NO get_wm_frame_pos-2: 0x%lx\n", frame);
-			}
-
-			if (frame != orig_frame) {
-				/* see if our original frame is still there */
-				if (!valid_window(orig_frame, &attr, 1)) {
-					X_UNLOCK;
-					/* our window frame went away! */
-					win_gone = 1;
-if (db) fprintf(stderr, "FRAME-GONE: 0x%lx\n", orig_frame);
-					break_reason = 5;
-					break;
-				}
-				if (attr.map_state == IsUnmapped) {
-					X_UNLOCK;
-					/* our window frame is now unmapped! */
-					win_unmapped = 1;
-if (db) fprintf(stderr, "FRAME-UNMAPPED: 0x%lx\n", orig_frame);
-					break_reason = 5;
-					break;
-				}
-
-if (db) fprintf(stderr, "OUT-OF-FRAME: old: x: %d  y: %d  px: %d py: %d 0x%lx\n", x, y, px, py, frame);
-
-				/* new parameters for our frame */
-				x = attr.x;	/* n.b. rootwin is parent */
-				y = attr.y;
-				w = attr.width;
-				h = attr.height;
-			}
-			X_UNLOCK;
-
-if (db) fprintf(stderr, "  frame: x: %d  y: %d  w: %d  h: %d  px: %d  py: %d  fr: 0x%lx\n", x, y, w, h, px, py, frame);	
-if (db) fprintf(stderr, "        MO,PT,FR: %d/%d %d/%d %d/%d\n", cursor_x - orig_cursor_x, cursor_y - orig_cursor_y, px - orig_px, py - orig_py, x - orig_x, y - orig_y);	
-
-			if (frame_changed && frame != orig_frame) {
-if (db) fprintf(stderr, "CHANGED and window switch: 0x%lx\n", frame);
-			}
-			if (frame_changed && px - orig_px != x - orig_x) {
-if (db) fprintf(stderr, "MOVED and diff DX\n");
-			}
-			if (frame_changed && py - orig_py != y - orig_y) {
-if (db) fprintf(stderr, "MOVED and diff DY\n");
-			}
-
-			/* check and see if our frame has been resized: */
-			if (!frame_changed && (w != orig_w || h != orig_h)) {
-				int n;
-				if (!already_down) {
-					first_dt_ave += spin;
-					first_dt_cnt++;
-				}
-				n = first_dt_cnt ? first_dt_cnt : 1;
-				frame_changed = 2;
-
-if (db) fprintf(stderr, "WIN RESIZE  1st-dt: %.3f\n", first_dt_ave/n);
-			}
-
-			/* check and see if our frame has been moved: */
-			if (!frame_changed && (x != orig_x || y != orig_y)) {
-				int n;
-				if (!already_down) {
-					first_dt_ave += spin;
-					first_dt_cnt++;
-				}
-				n = first_dt_cnt ? first_dt_cnt : 1;
-				frame_changed = 1;
-if (db) fprintf(stderr, "FRAME MOVE  1st-dt: %.3f\n", first_dt_ave/n);
-			}
-		}
-
-		/*
-		 * see if it is time to draw any or a new wireframe box
-		 */
-
-		if (frame_changed) {
-			int drawit = 0;
-			if (x != box_x || y != box_y) {
-				/* moved since last */
-if (0) fprintf(stderr, "DRAW1 %d %d\n", x - box_x, y - box_y);
-				drawit = 1;
-			} else if (w != box_w || h != box_h) {
-				/* resize since last */
-				drawit = 1;
-			}
-			if (drawit) {
-				int doit = 0;
-				/*
-				 * check time (to avoid too much
-				 * animations on slow machines
-				 * or links).
-				 */
-				if (gpi) {
-					if (spin > last_draw + min_draw || ! drew_box) {
-						doit = 1;
-					}
-					if (macosx_console && doit && !mac_skip) {
-						if (x != box_x && y != box_y && w != box_w && h != box_h) {
-							doit = 0;
-						} else if (!button_mask) {
-							doit = 0;
-						}
-						mac_skip++;
-					}
-				} else {
-					if (drew_box && cnt > last_draw_cnt) 	{
-						doit = 1;
-if (0) fprintf(stderr, "*** NO GPI DRAW_BOX\n");
-					}
-				}
-		
-				if (doit) {
-					if (try_copyrect_drag && ncache > 0) {
-						if (!ncache_copyrect) {
-							do_copyrect_drag = 0;
-						} else if (w != box_w || h != box_h) {
-							do_copyrect_drag = 0;
-						} else if (do_copyrect_drag < 0) {
-							Window fr = orig_frame;
-							int idx = lookup_win_index(fr);
-							if (idx < 0) {
-								fr = frame;
-								idx = lookup_win_index(fr);
-							}
-							if (idx >= 0) {
-								do_copyrect_drag = set_copyrect_drag(idx, fr, try_batch);
-								if (do_copyrect_drag) {
-									min_draw *= 0.66;
-								}
-								nidx = idx;
-							} else {
-								do_copyrect_drag = 0;
-							}
-							now_x = orig_x;
-							now_y = orig_y;
-						}
-						if (do_copyrect_drag) {
-							if (orig_w != w || orig_h != h) {
-								do_copyrect_drag = 0;
-							}
-						}
-					}
-
-					if (do_copyrect_drag <= 0) {
-						if (ncache <= 0) {
-							;
-						} else if (!drew_box && ncache_wf_raises) {
-							Window fr = orig_frame;
-							int idx = lookup_win_index(fr);
-							if (idx < 0) {
-								fr = frame;
-								idx = lookup_win_index(fr);
-							}
-							if (idx >= 0) {
-								check_copyrect_raise(idx, fr, try_batch);
-							}
-						}
-						draw_box(x, y, w, h, 0);
-						fb_push(); /* XXX Y */
-						rfbPE(1000);
-					} else {
-#ifndef NO_NCACHE
-						int tb = use_threads ? 0 : try_batch;
-						do_copyrect_drag_move(orig_frame, frame, &nidx,
-						    tb, now_x, now_y, orig_w, orig_h, x, y, w, h,
-						    copyrect_drag_delay);
-						now_x = x;
-						now_y = y;
-						if (copyrect_drag_delay == -1.0) {
-							copyrect_drag_delay = 0.04;
-						}
-#endif
-					}
-					drew_box = 1;
-					last_wireframe = dnow();
-
-					last_draw = spin;
-					last_draw_cnt = cnt;
-				}
-			}
-			box_x = x;
-			box_y = y;
-			box_w = w;
-			box_h = h;
-		}
-
-		/* 
-		 * Now (not earlier) check if the button has come back up.
-		 * we check here to get a better location and size of
-		 * the final window.
-		 */
-		bdown = 0;
-		if (button_mask) {
-			bdown = 1;
-		} else if (wireframe_local && display_button_mask) {
-			bdown = 2;
-		}
-		if (! bdown) {
-if (db || db2) fprintf(stderr, "NO button_mask\n");
-			break_reason = 6;
-			break;	
-		}
-	}
-
-	if (! drew_box) {
-		/* nice try, but no move or resize detected.  cleanup. */
-		if (stack_list_num) {
-			stack_list_num = 0;
-		}
-		wireframe_in_progress = 0;
-		if (macosx_console && (break_reason == 6 || break_reason == 5)) {
-			check_macosx_iconify(orig_frame, frame, drew_box);
-		}
-		return 0;
-	}
-
-	/* remove the wireframe */
-	if (do_copyrect_drag <= 0) {
-		draw_box(0, 0, 0, 0, 1);
-		fb_push(); /* XXX Y */
-	} else {
-		int tb = use_threads ? 0 : try_batch;
-		do_copyrect_drag_move(orig_frame, frame, &nidx,
-		    tb, now_x, now_y, orig_w, orig_h, x, y, w, h, -1.0);
-		fb_push_wait(0.15, FB_COPY|FB_MOD);
-	}
-
-	dx = x - orig_x;
-	dy = y - orig_y;
-
-	/*
-	 * see if we can apply CopyRect or CopyRegion to the change:
-	 */
-	if (!strcmp(wireframe_copyrect, "never")) {
-		;
-	} else if (win_gone || win_unmapped) {
-		;
-	} else if (skip_cr_when_scaling("wireframe")) {
-		;
-	} else if (w != orig_w || h != orig_h) {
-		if (ncache > 0) {
-			try_to_fix_resize_su(orig_frame, orig_x, orig_y, orig_w, orig_h, x, y, w, h, try_batch);
-			X_LOCK;
-			clear_win_events(orig_frame, 1);
-			if (frame != orig_frame) {
-				clear_win_events(frame, 1);
-			}
-			X_UNLOCK;
-		}
-	} else if (dx == 0 && dy == 0) {
-		;
-	} else if (do_copyrect_drag > 0) {
-		X_LOCK;
-		clear_win_events(NPP_nwin, 0);
-		X_UNLOCK;
-	} else {
-		int spin_ms = (int) (spin * 1000 * 1000);
-		int obscured, sent_copyrect = 0;
-
-		int nidx = -1;
-		int use_batch = 0;
-		double ntim;
-
-		/*
-		 * set a timescale comparable to the spin time,
-		 * but not too short or too long.
-		 */
-		if (spin_ms < 30) {
-			spin_ms = 30;
-		} else if (spin_ms > 400) {
-			spin_ms = 400;
-		}
-		ntim = dnow();
-
-		/* try to flush the wireframe removal: */
-if (ncdb && ncache) fprintf(stderr, "\nSEND_COPYRECT  %.4f %.4f\n", dnowx(), dnow() - ntim);
-
-		if (! fb_push_wait(0.15, FB_COPY|FB_MOD)) {
-
-if (ncdb && ncache) fprintf(stderr, "FB_COPY *FAILED*, try one more... %.4f", dnow() - ntim);
-
-			if (! fb_push_wait(0.15, FB_COPY|FB_MOD)) {
-
-if (ncdb && ncache) fprintf(stderr, "FB_COPY *FAILED* again! %.4f", dnow() - ntim);
-
-			}
-		}
-
-		ncache_pre_portions(orig_frame, frame, &nidx, try_batch, &use_batch,
-		    orig_x, orig_y, orig_w, orig_h, x, y, w, h, ntim);
-
-		/* 2) try to send a clipped copyrect of translation: */
-
-		if (! try_batch) {
-			sent_copyrect = try_copyrect(orig_frame, frame, x, y, w, h, dx, dy,
-			    &obscured, NULL, 0.15, NULL);
-		} else {
-			try_copyrect(orig_frame, frame, x, y, w, h, dx, dy,
-			    &obscured, NULL, 0.15, &NPP_nreg);	/* XXX */
-			sent_copyrect = 1;
-			use_batch = 1;
-		}
-
-if ((ncache || db) && ncdb) fprintf(stderr, "sent_copyrect: %d - obs: %d  frame: 0x%lx\n", sent_copyrect, obscured, frame);
-		if (sent_copyrect) {
-			/* try to push the changes to viewers: */
-			if (use_batch) {
-				;
-			} else if (! obscured) {
-				fb_push_wait(0.1, FB_COPY);
-			} else {
-				/* no diff for now... */
-				fb_push_wait(0.1, FB_COPY);
-			}
-			ncache_post_portions(nidx, use_batch,
-			    orig_x, orig_y, orig_w, orig_h, x, y, w, h, -1.0, ntim);
-			X_LOCK;
-			clear_win_events(NPP_nwin, 0);
-			X_UNLOCK;
-
-			if (scaling && !use_batch) {
-				static double last_time = 0.0;
-				double now = dnow(), delay = 0.35;
-
-				fb_push_wait(0.1, FB_COPY);
-
-				if (now > last_time + delay) {
-					int xt = x, yt = y;
-
-					if (clipshift) {
-						xt -= coff_x;
-						yt -= coff_y;
-					}
-					if (subwin) {
-						xt -= off_x;
-						yt -= off_y;
-					}
-
-					scale_mark(xt, yt, xt+w, yt+h, 1);
-					last_time = now;
-					last_copyrect_fix = now;
-				}
-			}
-		}
-	}
-
-	if (stack_list_num) {
-		/* clean up stack_list for next time: */
-		if (break_reason == 1 || break_reason == 2) {
-			/*
-			 * save the stack list, perhaps the user has
-			 * paused with button down.
-			 */
-			last_save_stacklist = time(NULL);
-		} else {
-			stack_list_num = 0;
-		}
-	}
-
-	/* final push (for -nowirecopyrect) */
-	rfbPE(1000);
-	wireframe_in_progress = 0;
-
-	if (1) {
-	/* In principle no longer needed...  see draw_box() */
-	    if (frame_changed && cmap8to24 /* && multivis_count */) {
-		/* handle -8to24 kludge, mark area and check 8bpp... */
-		int x1, x2, y1, y2, f = 16;
-		x1 = nmin(box_x, orig_x) - f;
-		y1 = nmin(box_y, orig_y) - f;
-		x2 = nmax(box_x + box_w, orig_x + orig_w) + f;
-		y2 = nmax(box_y + box_h, orig_y + orig_h) + f;
-		x1 = nfix(x1, dpy_x);
-		x2 = nfix(x2, dpy_x+1);
-		y1 = nfix(y1, dpy_y);
-		y2 = nfix(y2, dpy_y+1);
-		if (0) {
-			check_for_multivis();
-			mark_rect_as_modified(x1, y1, x2, y2, 0);
-		} else {
-			if (1) {
-				bpp8to24(x1, y1, x2, y2);
-			} else {
-				bpp8to24(0, 0, dpy_x, dpy_y);
-			}
-		}
-	    }
-	}
-
-	urgent_update = 1;
-	if (use_xdamage) {
-		/* DAMAGE can queue ~1000 rectangles for a move */
-		clear_xdamage_mark_region(NULL, 1);
-		xdamage_scheduled_mark = dnow() + 2.0;
-	}
-
-	if (macosx_console && (break_reason == 6 || break_reason == 5)) {
-		check_macosx_iconify(orig_frame, frame, drew_box);
-	}
-
-	return 1;
-}
-
-/*
- * We need to handle user input, particularly pointer input, carefully.
- * This function is only called when non-threaded.  Note that
- * rfbProcessEvents() only processes *one* pointer event per call,
- * so if we interlace it with scan_for_updates(), we can get swamped
- * with queued up pointer inputs.  And if the pointer inputs are inducing
- * large changes on the screen (e.g. window drags), the whole thing
- * bogs down miserably and only comes back to life at some time after
- * one stops moving the mouse.  So, to first approximation, we are trying
- * to eat as much user input here as we can using some hints from the
- * duration of the previous scan_for_updates() call (in dt).
- *
- * note: we do this even under -nofb
- *
- * return of 1 means watch_loop should short-circuit and reloop,
- * return of 0 means watch_loop should proceed to scan_for_updates().
- * (this is for pointer_mode == 1 mode, the others do it all internally,
- * cnt is also only for that mode).
- */
-
-static void check_user_input2(double dt) {
-
-	int eaten = 0, miss = 0, max_eat = 50, do_flush = 1;
-	int g, g_in;
-	double spin = 0.0, tm;
-	double quick_spin_fac  = 0.40;
-	double grind_spin_time = 0.175;
-
-	dtime0(&tm);
-	g = g_in = got_pointer_input;
-	if (!got_pointer_input) {
-		return;
-	}
-	/*
-	 * Try for some "quick" pointer input processing.
-	 *
-	 * About as fast as we can, we try to process user input calling
-	 * rfbProcessEvents or rfbCheckFds.  We do this for a time on
-	 * order of the last scan_for_updates() time, dt, but if we stop
-	 * getting user input we break out.  We will also break out if
-	 * we have processed max_eat inputs.
-	 *
-	 * Note that rfbCheckFds() does not send any framebuffer updates,
-	 * so is more what we want here, although it is likely they have
-	 * all be sent already.
-	 */
-	while (1) {
-		if (show_multiple_cursors) {
-			rfbPE(1000);
-		} else {
-			rfbCFD(1000);
-		}
-		rfbCFD(0);
-
-		spin += dtime(&tm);
-
-		if (spin > quick_spin_fac * dt) {
-			/* get out if spin time comparable to last scan time */
-			break;
-		}
-		if (got_pointer_input > g) {
-			int i, max_extra = max_eat / 2;
-			g = got_pointer_input;
-			eaten++;
-			for (i=0; i<max_extra; i++)  {
-				rfbCFD(0);
-				if (got_pointer_input > g) {
-					g = got_pointer_input;
-					eaten++;
-				} else if (i > 1) {
-					break;
-				}
-			}
-			X_LOCK;
-			do_flush = 0;
-if (0) fprintf(stderr, "check_user_input2-A: XFlush %.4f\n", tm);
-			XFlush_wr(dpy);
-			X_UNLOCK;
-			if (eaten < max_eat) {
-				continue;
-			}
-		} else {
-			miss++;
-		}
-		if (miss > 1) {	/* 1 means out on 2nd miss */
-			break;
-		}
-	}
-	if (do_flush) {
-		X_LOCK;
-if (0) fprintf(stderr, "check_user_input2-B: XFlush %.4f\n", tm);
-		XFlush_wr(dpy);
-		X_UNLOCK;
-	}
-
-
-	/*
-	 * Probably grinding with a lot of fb I/O if dt is this large.
-	 * (need to do this more elegantly)
-	 *
-	 * Current idea is to spin our wheels here *not* processing any
-	 * fb I/O, but still processing the user input.  This user input
-	 * goes to the X display and changes it, but we don't poll it
-	 * while we "rest" here for a time on order of dt, the previous
-	 * scan_for_updates() time.  We also break out if we miss enough
-	 * user input.
-	 */
-	if (dt > grind_spin_time) {
-		int i, ms, split = 30;
-		double shim;
-
-		/*
-		 * Break up our pause into 'split' steps.  We get at
-		 * most one input per step.
-		 */
-		shim = 0.75 * dt / split;
-
-		ms = (int) (1000 * shim);
-
-		/* cutoff how long the pause can be */
-		if (split * ms > 300) {
-			ms = 300 / split;
-		}
-
-		spin = 0.0;
-		dtime0(&tm);
-
-		g = got_pointer_input;
-		miss = 0;
-		for (i=0; i<split; i++) {
-			usleep(ms * 1000);
-			if (show_multiple_cursors) {
-				rfbPE(1000);
-			} else {
-				rfbCFD(1000);
-			}
-			spin += dtime(&tm);
-			if (got_pointer_input > g) {
-				int i, max_extra = max_eat / 2;
-				for (i=0; i<max_extra; i++)  {
-					rfbCFD(0);
-					if (got_pointer_input > g) {
-						g = got_pointer_input;
-					} else if (i > 1) {
-						break;
-					}
-				}
-				X_LOCK;
-if (0) fprintf(stderr, "check_user_input2-C: XFlush %.4f\n", tm);
-				XFlush_wr(dpy);
-				X_UNLOCK;
-				miss = 0;
-			} else {
-				miss++;
-			}
-			g = got_pointer_input;
-			if (miss > 2) {
-				break;
-			}
-			if (1000 * spin > ms * split)  {
-				break;
-			}
-		}
-	}
-}
-
-static void check_user_input3(double dt, double dtr, int tile_diffs) {
-
-	int allowed_misses, miss_tweak, i, g, g_in;
-	int last_was_miss, consecutive_misses;
-	double spin, spin_max, tm, to, dtm;
-	int rfb_wait_ms = 2;
-	static double dt_cut = 0.075;
-	int gcnt, ginput;
-	static int first = 1;
-
-	if (dtr || tile_diffs) {} /* unused vars warning: */
-
-	if (first) {
-		char *p = getenv("SPIN");
-		if (p) {
-			double junk;
-			sscanf(p, "%lf,%lf", &dt_cut, &junk);
-		}
-		first = 0;
-	}
-
-	if (!got_pointer_input) {
-		return;
-	}
-
-
-	if (dt < dt_cut) {
-		dt = dt_cut;	/* this is to try to avoid early exit */
-	}
-	spin_max = 0.5;
-
-	spin = 0.0;		/* amount of time spinning */
-	allowed_misses = 10;	/* number of ptr inputs we can miss */
-	miss_tweak = 8;
-	last_was_miss = 0;
-	consecutive_misses = 1;
-	gcnt = 0;
-	ginput = 0;
-
-	dtime0(&tm);
-	to = tm;	/* last time we did rfbPE() */
-
-	g = g_in = got_pointer_input;
-
-	while (1) {
-		int got_input = 0;
-
-		gcnt++;
-
-		if (button_mask) {
-			drag_in_progress = 1;
-		}
-
-		rfbCFD(rfb_wait_ms * 1000);
-
-		dtm = dtime(&tm);
-		spin += dtm;
-
-		if (got_pointer_input == g) {
-			if (last_was_miss) {
-				consecutive_misses++;
-			}
-			last_was_miss = 1;
-		} else {
-			ginput++;
-			if (ginput % miss_tweak == 0) {
-				allowed_misses++;
-			}
-			consecutive_misses = 1;
-			last_was_miss = 0;
-		}
-
-		if (spin > spin_max) {
-			/* get out if spin time over limit */
-			break;
-
-		} else if (got_pointer_input > g) {
-			/* received some input, flush to display. */
-			got_input = 1;
-			g = got_pointer_input;
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-		} else if (--allowed_misses <= 0) {
-			/* too many misses */
-			break;
-		} else if (consecutive_misses >=3) {
-			/* too many misses */
-			break;
-		} else {
-			/* these are misses */
-			int wms = 0;
-			if (gcnt == 1 && button_mask) {
-				/*
-				 * missed our first input, wait
-				 * for a defer time. (e.g. on
-				 * slow link) hopefully client
-				 * will batch them.
-				 */
-				wms = 50;
-			} else if (button_mask) {
-				wms = 10;
-			} else {
-			}
-			if (wms) {
-				usleep(wms * 1000);
-			}
-		}
-	}
-
-	if (ginput >= 2) {
-		/* try for a couple more quick ones */
-		for (i=0; i<2; i++) {
-			rfbCFD(rfb_wait_ms * 1000);
-		}
-	}
-
-	drag_in_progress = 0;
-}
-
-int fb_update_sent(int *count) {
-	static int last_count = 0;
-	int sent = 0, rc = 0;
-	rfbClientIteratorPtr i;
-	rfbClientPtr cl;
-
-	if (nofb) {
-		return 0;
-	}
-
-	i = rfbGetClientIterator(screen);
-	while( (cl = rfbClientIteratorNext(i)) ) {
-#if 0
-		sent += cl->framebufferUpdateMessagesSent;
-#else
-#if LIBVNCSERVER_HAS_STATS
-		sent += rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate);
-#endif
-#endif
-	}
-	rfbReleaseClientIterator(i);
-	if (sent != last_count) {
-		rc = 1;
-	}
-	if (count != NULL) {
-		*count = sent;
-	}
-	last_count = sent;
-	return rc; 
-}
-
-static void check_user_input4(double dt, double dtr, int tile_diffs) {
-
-	int g, g_in, i, ginput, gcnt, tmp;
-	int last_was_miss, consecutive_misses;
-	int min_frame_size = 10;	/* 10 tiles */
-	double spin, tm, to, tc, dtm, rpe_last;
-	int rfb_wait_ms = 2;
-	static double dt_cut = 0.050;
-	static int first = 1;
-
-	int Btile = tile_x * tile_y * bpp/8; 	/* Bytes per tile */
-	double Ttile, dt_use;
-	double screen_rate = 6000000.;    /* 5 MB/sec */
-	double vnccpu_rate = 80 * 100000.; /* 20 KB/sec @ 80X compression */
-	double net_rate = 50000.;
-	static double Tfac_r = 1.0, Tfac_v = 1.0, Tfac_n = 1.0, Tdelay = 0.001;
-	static double dt_min = -1.0, dt_max = -1.0;
-	double dt_min_fallback = 0.050;
-	static int ssec = 0, total_calls = 0;
-	static int push_frame = 0, update_count = 0;
-
-	if (first) {
-		char *p = getenv("SPIN");
-		if (p) {
-			sscanf(p, "%lf,%lf,%lf,%lf", &dt_cut, &Tfac_r, &Tfac_v, &Tfac_n);
-		}
-		first = 0;
-		ssec = time(NULL);
-
-		if (dtr) {}	/* unused vars warning: */
-	}
-
-	total_calls++;
-
-	if (dt_min < 0.0 || dt < dt_min) {
-		if (dt > 0.0) {
-			dt_min = dt;
-		}
-	}
-	if (dt_min < 0.0) {
-		/* sensible value for the very 1st call if dt = 0.0 */
-		dt_min = dt_min_fallback;
-	}
-	if (dt_max < 0.0 || dt > dt_max) {
-		dt_max = dt;
-	}
-
-	if (total_calls > 30 && dt_min > 0.0) {
-		static int first = 1;
-		/*
-		 * dt_min will soon be the quickest time to do
-		 * one scan_for_updates with no tiles copied.
-		 * use this (instead of copy_tiles) to estimate
-		 * screen read rate.
-		 */
-		screen_rate = (main_bytes_per_line * ntiles_y) / dt_min;
-		if (first) {
-			rfbLog("measured screen read rate: %.2f Bytes/sec\n",
-			    screen_rate);
-		}
-		first = 0;
-	}
-
-	dtime0(&tm);
-
-	if (dt < dt_cut) {
-		dt_use = dt_cut;
-	} else {
-		dt_use = dt;
-	}
-
-	if (push_frame) {
-		int cnt, iter = 0;
-		double tp, push_spin = 0.0;
-		dtime0(&tp);
-		while (push_spin < dt_use * 0.5) {
-			fb_update_sent(&cnt);
-			if (cnt != update_count) {
-				break;
-			}
-			/* damn, they didn't push our frame! */
-			iter++;
-			rfbPE(rfb_wait_ms * 1000);
-			
-			push_spin += dtime(&tp);
-		}
-		if (iter) {
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-		}
-		push_frame = 0;
-		update_count = 0;
-	}
-
-	/*
-	 * when we first enter we require some pointer input
-	 */
-	if (!got_pointer_input) {
-		return;
-	}
-
-	vnccpu_rate = get_raw_rate();
-
-	if ((tmp = get_read_rate()) != 0) {
-		screen_rate = (double) tmp;
-	}
-	if ((tmp = get_net_rate()) != 0) {
-		net_rate = (double) tmp;
-	}
-	net_rate = (vnccpu_rate/get_cmp_rate()) * net_rate;
-
-	if ((tmp = get_net_latency()) != 0) {
-		Tdelay = 0.5 * ((double) tmp)/1000.;
-	}
-
-	Ttile = Btile * (Tfac_r/screen_rate + Tfac_v/vnccpu_rate + Tfac_n/net_rate);
-
-	spin = 0.0;		/* amount of time spinning */
-	last_was_miss = 0;
-	consecutive_misses = 1;
-	gcnt = 0;
-	ginput = 0;
-
-	rpe_last = to = tc = tm;	/* last time we did rfbPE() */
-	g = g_in = got_pointer_input;
-
-	tile_diffs = 0;	/* reset our knowlegde of tile_diffs to zero */
-
-	while (1) {
-		int got_input = 0;
-
-		gcnt++;
-
-		if (button_mask) {
-			/* this varible is used by our pointer handler */
-			drag_in_progress = 1;
-		}
-
-		/* turn libvncserver crank to process events: */
-		rfbCFD(rfb_wait_ms * 1000);
-
-		dtm = dtime(&tm);
-		spin += dtm;
-
-		if ( (gcnt == 1 && got_pointer_input > g) || tm-tc > 2*dt_min) {
-			tile_diffs = scan_for_updates(1);
-			tc = tm;
-		}
-
-		if (got_pointer_input == g) {
-			if (last_was_miss) {
-				consecutive_misses++;
-			}
-			last_was_miss = 1;
-		} else {
-			ginput++;
-			consecutive_misses = 1;
-			last_was_miss = 0;
-		}
-
-		if (tile_diffs > min_frame_size && spin > Ttile * tile_diffs + Tdelay) {
-			/* we think we can push the frame */
-			push_frame = 1;
-			fb_update_sent(&update_count);
-			break;
-
-		} else if (got_pointer_input > g) {
-			/* received some input, flush it to display. */
-			got_input = 1;
-			g = got_pointer_input;
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-
-		} else if (consecutive_misses >= 2) {
-			/* too many misses in a row */
-			break;
-
-		} else {
-			/* these are pointer input misses */
-			int wms;
-			if (gcnt == 1 && button_mask) {
-				/*
-				 * missed our first input, wait for
-				 * a defer time. (e.g. on slow link)
-				 * hopefully client will batch many
-				 * of them for the next read.
-				 */
-				wms = 50;
-
-			} else if (button_mask) {
-				wms = 10;
-			} else {
-				wms = 0;
-			}
-			if (wms) {
-				usleep(wms * 1000);
-			}
-		}
-	}
-	if (ginput >= 2) {
-		/* try for a couple more quick ones */
-		for (i=0; i<2; i++) {
-			rfbCFD(rfb_wait_ms * 1000);
-		}
-	}
-	drag_in_progress = 0;
-}
-
-int check_user_input(double dt, double dtr, int tile_diffs, int *cnt) {
-
-	if (rawfb_vnc_reflect) {
-		if (got_user_input) {
-			if (0) vnc_reflect_process_client();
-		}
-		if (got_user_input && *cnt % ui_skip != 0) {
-			/* every n-th drops thru to scan */
-			*cnt = *cnt + 1;
-			return 1;	/* short circuit watch_loop */
-		}
-	}
-#ifdef MACOSX
-	if (! macosx_console) {
-		RAWFB_RET(0)
-	}
-#else
-	RAWFB_RET(0)
-#endif
-
-	if (use_xrecord) {
-		int rc = check_xrecord();
-		/*
-		 * 0: nothing found, proceed to other user input schemes.
-		 * 1: events found, want to do a screen update now.
-		 * 2: events found, want to loop back for some more.
-		 * 3: events found, want to loop back for some more,
-		 *    and not have rfbPE() called.
-		 *
-		 * For 0, we precede below, otherwise return rc-1.
-		 */
-if (debug_scroll && rc > 1) fprintf(stderr, "  CXR: check_user_input ret %d\n", rc - 1);
-		if (rc == 0) {
-			;	/* proceed below. */
-		} else {
-			return rc - 1;
-		}
-	}
-
-	if (wireframe) {
-		if (check_wireframe()) {
-			return 0;
-		}
-	}
-
-	if (pointer_mode == 1) {
-		if ((got_user_input || ui_skip < 0) && *cnt % ui_skip != 0) {
-			/* every ui_skip-th drops thru to scan */
-			*cnt = *cnt + 1;
-			X_LOCK;
-			XFlush_wr(dpy);
-			X_UNLOCK;
-			return 1;	/* short circuit watch_loop */
-		} else {
-			return 0;
-		}
-	}
-	if (pointer_mode >= 2 && pointer_mode <= 4) {
-		if (got_keyboard_input) {
-			/*
-			 * for these modes, short circuit watch_loop on
-			 * *keyboard* input.
-			 */
-			if (*cnt % ui_skip != 0) {
-				*cnt = *cnt + 1; 
-				return 1;
-			}
-		}
-		/* otherwise continue below with pointer input method */
-	}
-
-	if (pointer_mode == 2) {
-		check_user_input2(dt);
-	} else if (pointer_mode == 3) {
-		check_user_input3(dt, dtr, tile_diffs);
-	} else if (pointer_mode == 4) {
-		check_user_input4(dt, dtr, tile_diffs);
-	}
-	return 0;
-}
-
-#if defined(NO_NCACHE) || (NO_X11 && !defined(MACOSX))
-int check_ncache(int a, int b) {
-	if (!a || !b) {}
-	ncache = 0;
-	return 0;
-}
-int lookup_win_index(Window win) {
-	if (!win) {}
-	return -1;
-}
-int find_rect(int idx, int x, int y, int w, int h) {
-	if (!idx || !x || !y || !w || !h) {}
-	return 0;
-}
-void snap_old(void) {
-	return;
-}
-int clipped(int idx) {
-	if (!idx) {}
-	return 0;
-}
-int bs_restore(int idx, int *nbatch, sraRegionPtr rmask, XWindowAttributes *attr, int clip, int nopad, int *valid, int verb) {
-	if (!idx || !nbatch || !rmask || !attr || !clip || !nopad || !valid || !verb) {}
-	return 0;
-}
-int try_to_fix_su(Window win, int idx, Window above, int *nbatch, char *mode) {
-	if (!win || !idx || !above || !nbatch || !mode) {}
-	return 0;
-}
-int try_to_fix_resize_su(Window orig_frame, int orig_x, int orig_y, int orig_w, int orig_h,
-    int x, int y, int w, int h, int try_batch) {
-	if (!orig_frame || !orig_x || !orig_y || !orig_w || !orig_h || !x || !y || !w || !h || !try_batch) {}
-	return 0;
-}
-void set_ncache_xrootpmap(void) {
-	return;
-}
-#else
-/* maybe ncache.c it if works */
-
-winattr_t* cache_list = NULL;
-int cache_list_num = 0;
-int cache_list_len = 0;
-
-void snapshot_cache_list(int free_only, double allowed_age) {
-	static double last_snap = 0.0, last_free = 0.0;
-	double now; 
-	int num, rc, i;
-	unsigned int ui;
-	Window r, w;
-	Window *list;
-	int start = 512;
-
-	if (! cache_list) {
-		cache_list = (winattr_t *) calloc(start*sizeof(winattr_t), 1);
-		cache_list_num = 0;
-		cache_list_len = start;
-	}
-
-	dtime0(&now);
-	if (free_only) {
-		/* we really don't free it, just reset to zero windows */
-		cache_list_num = 0;
-		last_free = now;
-		return;
-	}
-
-	if (cache_list_num && now < last_snap + allowed_age) {
-		return;
-	}
-
-	cache_list_num = 0;
-	last_free = now;
-
-#ifdef MACOSX
-	if (! macosx_console) {
-		RAWFB_RET_VOID
-	}
-#else
-	RAWFB_RET_VOID
-#endif
-
-
-#if NO_X11 && !defined(MACOSX)
-	num = rc = i = 0;	/* compiler warnings */
-	ui = 0;
-	r = w = None;
-	list = NULL;
-	return;
-#else
-
-	X_LOCK;
-	/* no need to trap error since rootwin */
-	rc = XQueryTree_wr(dpy, rootwin, &r, &w, &list, &ui);
-	X_UNLOCK;
-	num = (int) ui;
-
-	if (! rc) {
-		cache_list_num = 0;
-		last_free = now;
-		last_snap = 0.0;
-		return;
-	}
-
-	last_snap = now;
-	if (num > cache_list_len) {
-		int n = 2*num;
-		n = num + 3;
-		free(cache_list);
-		cache_list = (winattr_t *) calloc(n*sizeof(winattr_t), 1);
-		cache_list_len = n;
-	}
-	for (i=0; i<num; i++) {
-		cache_list[i].win = list[i];
-		cache_list[i].fetched = 0;
-		cache_list[i].valid = 0;
-		cache_list[i].time = now;
-		cache_list[i].selectinput = 0;
-		cache_list[i].vis_cnt = 0;
-		cache_list[i].map_cnt = 0;
-		cache_list[i].unmap_cnt = 0;
-		cache_list[i].create_cnt = 0;
-		cache_list[i].vis_state = -1;
-		cache_list[i].above = None;
-	}
-	if (num == 0) {
-		cache_list[0].win = None;
-		cache_list[0].fetched = 0;
-		cache_list[0].valid = 0;
-		cache_list[0].time = now;
-		cache_list[0].selectinput = 0;
-		cache_list[0].vis_cnt = 0;
-		cache_list[0].map_cnt = 0;
-		cache_list[0].unmap_cnt = 0;
-		cache_list[0].create_cnt = 0;
-		cache_list[0].vis_state = -1;
-		cache_list[0].above = None;
-		num++;
-	}
-
-	cache_list_num = num;
-
-	if (num) {
-		X_LOCK;
-		XFree_wr(list);
-		X_UNLOCK;
-	}
-#endif	/* NO_X11 */
-}
-
-void quick_snap(Window *wins, int *size) {
-	int num, rc, i;
-	unsigned int ui;
-	Window r, w;
-	Window *list;
-
-#ifdef MACOSX
-	if (1 || ! macosx_console) {
-		RAWFB_RET_VOID
-	}
-#else
-	RAWFB_RET_VOID
-#endif
-
-
-#if NO_X11 && !defined(MACOSX)
-	num = rc = i = 0;	/* compiler warnings */
-	ui = 0;
-	r = w = None;
-	list = NULL;
-	return;
-#else
-
-	X_LOCK;
-	/* no need to trap error since rootwin */
-	rc = XQueryTree_wr(dpy, rootwin, &r, &w, &list, &ui);
-	X_UNLOCK;
-	num = (int) ui;
-
-	if (! rc || num == 0) {
-		*size = 0;
-		return;
-	} else {
-		int m = *size;
-		if (num < m) {
-			m = num;
-		}
-		for (i=0; i < m; i++) {
-			wins[i] = list[i];
-		}
-		if (num) {
-			X_LOCK;
-			XFree_wr(list);
-			X_UNLOCK;
-		}
-		*size = m;
-	}
-#endif	/* NO_X11 */
-}
-
-int get_bs_n(int y) {
-	int n;
-	for (n = 1; n < ncache; n += 2) {
-		if (n*dpy_y <= y && y < (n+1)*dpy_y) {
-			return n;
-		}
-	}
-	return -1;
-}
-
-#define NRECENT 32
-Window recent[NRECENT];
-int    recidx[NRECENT];
-int rlast, rfree;
-
-int lookup_win_index(Window win) {
-	int k, idx = -1;
-	int foundfree = 0;
-	static int s1 = 0, s2 = 0, s3 = 0;
-
-	if (win == rootwin || win == None) {
-		return -1;
-	}
-	for (k = 0; k < NRECENT; k++) {
-		if (recent[k] == win) {
-			int k2 = recidx[k];
-			if (cache_list[k2].win == win) {
-				idx = k2;
-if (0) fprintf(stderr, "recentA(shortcut): %d  0x%lx\n", idx, win);
-				s1++;
-				break;
-			}
-		}
-	}
-	if (idx < 0) {
-		for(k=0; k<cache_list_num; k++) {
-			if (!foundfree && cache_list[k].win == None) {
-				rfree = k;
-				foundfree = 1;
-			}
-			if (cache_list[k].win == win) {
-				idx = k;
-if (0) fprintf(stderr, "recentB(normal): %d  0x%lx\n", idx, win);
-				s2++;
-				break;
-			}
-		}
-		if (idx >= 0) {
-			recent[rlast] = win;
-			recidx[rlast++] = idx;
-			rlast = rlast % NRECENT;
-		}
-	}
-	if (idx < 0) {
-if (ncdb) fprintf(stderr, "recentC(fail): %d  0x%lx\n", idx, win);
-		s3++;
-	}
-	if (s1 + s2 + s3 >= 1000) {
-if (ncdb) fprintf(stderr, "lookup_win_index recent hit stats: %d/%d/%d\n", s1, s2, s3);
-		s1 = s2 = s3 = 0;
-	}
-	return idx;
-}
-
-int lookup_free_index(void) {
-	int k;
-
-	if (rfree >= 0) {
-		if (cache_list[rfree].win == None) {
-if (ncdb) fprintf(stderr, "lookup_freeA: %d\n", rfree);
-			return rfree;
-		}
-	}
-	rfree = -1;
-	for(k=0; k<cache_list_num; k++) {
-		if (cache_list[k].win == None) {
-			rfree = k;
-			break;
-		}
-	}
-	if (rfree < 0) {
-		if (ncdb) fprintf(stderr, "*** LOOKUP_FREE_INDEX: incrementing cache_list_num %d/%d\n", cache_list_num, cache_list_len);
-
-		rfree = cache_list_num++;
-		if (rfree >= cache_list_len)  {
-			int i, n = 2*cache_list_len;
-			winattr_t *cache_new;
-
-			if (ncdb) fprintf(stderr, "lookup_free_index: growing cache_list_len: %d -> %d\n", cache_list_len, n);
-
-			cache_new = (winattr_t *) calloc(n*sizeof(winattr_t), 1);
-			for (i=0; i<cache_list_num-1; i++) {
-				cache_new[i] = cache_list[i]; 
-			}
-			cache_list_len = n;
-			free(cache_list);
-			cache_list = cache_new;
-		}
-		cache_list[rfree].win = None;
-		cache_list[rfree].fetched = 0;
-		cache_list[rfree].valid = 0;
-		cache_list[rfree].time = 0.0;
-		cache_list[rfree].selectinput = 0;
-		cache_list[rfree].vis_cnt = 0;
-		cache_list[rfree].map_cnt = 0;
-		cache_list[rfree].unmap_cnt = 0;
-		cache_list[rfree].create_cnt = 0;
-		cache_list[rfree].vis_state = -1;
-		cache_list[rfree].above = None;
-	}
-
-if (ncdb) fprintf(stderr, "lookup_freeB: %d\n", rfree);
-	return rfree;
-}
-
-#define STACKMAX 4096
-Window old_stack[STACKMAX];
-Window new_stack[STACKMAX];
-Window old_stack_map[STACKMAX];
-Window new_stack_map[STACKMAX];
-int old_stack_index[STACKMAX];
-int old_stack_mapped[STACKMAX];
-int old_stack_n = 0;
-int new_stack_n = 0;
-int old_stack_map_n = 0;
-int new_stack_map_n = 0;
-
-void snap_old(void) {
-	int i;
-	old_stack_n = STACKMAX;
-	quick_snap(old_stack, &old_stack_n);
-if (0) fprintf(stderr, "snap_old: %d  %.4f\n", old_stack_n, dnowx());
-#if 0
-	for (i= old_stack_n - 1; i >= 0; i--) {
-		int idx = lookup_win_index(old_stack[i]);
-		if (idx >= 0) {
-			if (cache_list[idx].map_state == IsViewable) {
-				if (ncdb) fprintf(stderr, "   %03d  0x%x\n", i, old_stack[i]);
-			}
-		}
-	}
-#endif
-	for (i=0; i < old_stack_n; i++) {
-		old_stack_mapped[i] = -1;
-	}
-}
-
-void snap_old_index(void) {
-	int i, idx;
-	for (i=0; i < old_stack_n; i++) {
-		idx = lookup_win_index(old_stack[i]);
-		old_stack_index[i] = idx;
-		if (idx >= 0) {
-			if (cache_list[idx].map_state == IsViewable) {
-				old_stack_mapped[i] = 1;
-			} else {
-				old_stack_mapped[i] = 0;
-			}
-		}
-	}
-}
-
-int lookup_old_stack_index(int ic) {
-	int idx = old_stack_index[ic];
-
-	if (idx < 0) {
-		return -1;
-	}
-	if (cache_list[idx].win != old_stack[ic]) {
-		snap_old_index();
-	}
-	idx = old_stack_index[ic];
-	if (idx < 0 || cache_list[idx].win != old_stack[ic]) {
-		return -1;
-	}
-	if (cache_list[idx].map_state == IsViewable) {
-		old_stack_mapped[ic] = 1;
-	} else {
-		old_stack_mapped[ic] = 0;
-	}
-	return idx;
-}
-
-#define STORE(k, w, attr) \
-	if (0) fprintf(stderr, "STORE(%d) = 0x%lx\n", k, w); \
-	cache_list[k].win = w;  \
-	cache_list[k].fetched = 1;  \
-	cache_list[k].valid = 1;  \
-	cache_list[k].x = attr.x;  \
-	cache_list[k].y = attr.y;  \
-	cache_list[k].width = attr.width;  \
-	cache_list[k].height = attr.height;  \
-	cache_list[k].border_width = attr.border_width;  \
-	cache_list[k].map_state = attr.map_state; \
-	cache_list[k].time = dnow();
-
-#if 0
-	cache_list[k].width = attr.width   + 2*attr.border_width;  \
-	cache_list[k].height = attr.height + 2*attr.border_width;  \
-
-#endif
-
-#define CLEAR(k) \
-	if (0) fprintf(stderr, "CLEAR(%d)\n", k); \
-	cache_list[k].bs_x = -1;  \
-	cache_list[k].bs_y = -1;  \
-	cache_list[k].bs_w = -1;  \
-	cache_list[k].bs_h = -1;  \
-	cache_list[k].su_x = -1;  \
-	cache_list[k].su_y = -1;  \
-	cache_list[k].su_w = -1;  \
-	cache_list[k].su_h = -1;  \
-	cache_list[k].time = 0.0;  \
-	cache_list[k].bs_time = 0.0;  \
-	cache_list[k].su_time = 0.0;  \
-	cache_list[k].vis_obs_time = 0.0;  \
-	cache_list[k].vis_unobs_time = 0.0;
-
-#define DELETE(k) \
-	if (0) fprintf(stderr, "DELETE(%d) = 0x%lx\n", k, cache_list[k].win); \
-	cache_list[k].win = None;  \
-	cache_list[k].fetched = 0;  \
-	cache_list[k].valid = 0; \
-	cache_list[k].selectinput = 0; \
-	cache_list[k].vis_cnt = 0; \
-	cache_list[k].map_cnt = 0; \
-	cache_list[k].unmap_cnt = 0; \
-	cache_list[k].create_cnt = 0; \
-	cache_list[k].vis_state = -1; \
-	cache_list[k].above = None; \
-	free_rect(k);	/* does CLEAR(k) */
-
-static	char unk[32];
-
-char *Etype(int type) {
-	if (type == KeyPress)		return "KeyPress";
-	if (type == KeyRelease)		return "KeyRelease";
-	if (type == ButtonPress)	return "ButtonPress";
-	if (type == ButtonRelease)	return "ButtonRelease";
-	if (type == MotionNotify)	return "MotionNotify";
-	if (type == EnterNotify)	return "EnterNotify";
-	if (type == LeaveNotify)	return "LeaveNotify";
-	if (type == FocusIn)		return "FocusIn";
-	if (type == FocusOut)		return "FocusOut";
-	if (type == KeymapNotify)	return "KeymapNotify";
-	if (type == Expose)		return "Expose";
-	if (type == GraphicsExpose)	return "GraphicsExpose";
-	if (type == NoExpose)		return "NoExpose";
-	if (type == VisibilityNotify)	return "VisibilityNotify";
-	if (type == CreateNotify)	return "CreateNotify";
-	if (type == DestroyNotify)	return "DestroyNotify";
-	if (type == UnmapNotify)	return "UnmapNotify";
-	if (type == MapNotify)		return "MapNotify";
-	if (type == MapRequest)		return "MapRequest";
-	if (type == ReparentNotify)	return "ReparentNotify";
-	if (type == ConfigureNotify)	return "ConfigureNotify";
-	if (type == ConfigureRequest)	return "ConfigureRequest";
-	if (type == GravityNotify)	return "GravityNotify";
-	if (type == ResizeRequest)	return "ResizeRequest";
-	if (type == CirculateNotify)	return "CirculateNotify";
-	if (type == CirculateRequest)	return "CirculateRequest";
-	if (type == PropertyNotify)	return "PropertyNotify";
-	if (type == SelectionClear)	return "SelectionClear";
-	if (type == SelectionRequest)	return "SelectionRequest";
-	if (type == SelectionNotify)	return "SelectionNotify";
-	if (type == ColormapNotify)	return "ColormapNotify";
-	if (type == ClientMessage)	return "ClientMessage";
-	if (type == MappingNotify)	return "MappingNotify";
-	if (type == LASTEvent)		return "LASTEvent";
-	sprintf(unk, "Unknown %d", type);
-	return unk;
-}
-char *VState(int state) {
-	if (state == VisibilityFullyObscured)		return "VisibilityFullyObscured";
-	if (state == VisibilityPartiallyObscured)	return "VisibilityPartiallyObscured";
-	if (state == VisibilityUnobscured)		return "VisibilityUnobscured";
-	sprintf(unk, "Unknown %d", state);
-	return unk;
-}
-char *MState(int state) {
-	if (state == IsViewable)	return "IsViewable";
-	if (state == IsUnmapped)	return "IsUnmapped";
-	sprintf(unk, "Unknown %d", state);
-	return unk;
-}
-sraRegionPtr rect_reg[64];
-sraRegionPtr zero_rects = NULL;
-
-int free_rect(int idx) {
-	int n, ok = 0;
-	sraRegionPtr r1, r2;
-	int x, y, w, h;
-
-	if (idx < 0 || idx >= cache_list_num) {
-if (0) fprintf(stderr, "free_rect: bad index: %d\n", idx);
-		clean_up_exit(1);
-	}
-
-	x = cache_list[idx].bs_x;
-	y = cache_list[idx].bs_y;
-	w = cache_list[idx].bs_w;
-	h = cache_list[idx].bs_h;
-
-	if (x < 0) {
-		CLEAR(idx);
-if (dnow() > last_client + 5 && ncdb) fprintf(stderr, "free_rect: already bs_x invalidated: %d bs_x: %d\n", idx, x);
-		return 1;
-	}
-
-	r2 = sraRgnCreateRect(x, y, x+w, y+h);
-
-	n = get_bs_n(y);
-	if (n >= 0) {
-		r1 = rect_reg[n];
-		sraRgnOr(r1, r2);
-		ok = 1;
-	}
-
-	if (zero_rects) {
-		sraRgnOr(zero_rects, r2);
-		x = cache_list[idx].su_x;
-		y = cache_list[idx].su_y;
-		w = cache_list[idx].su_w;
-		h = cache_list[idx].su_h;
-		if (x >= 0) {
-			sraRgnDestroy(r2);
-			r2 = sraRgnCreateRect(x, y, x+w, y+h);
-			sraRgnOr(zero_rects, r2);
-		}
-	}
-	sraRgnDestroy(r2);
-
-	CLEAR(idx);
-if (! ok && ncdb) fprintf(stderr, "**** free_rect: not-found %d\n", idx);
-	return ok;
-}
-
-int fr_BIG1 = 0;
-int fr_BIG2 = 0;
-int fr_REGION = 0;
-int fr_GRID = 0;
-int fr_EXPIRE = 0;
-int fr_FORCE = 0;
-int fr_FAIL = 0;
-int fr_BIG1t = 0;
-int fr_BIG2t = 0;
-int fr_REGIONt = 0;
-int fr_GRIDt = 0;
-int fr_EXPIREt = 0;
-int fr_FORCEt = 0;
-int fr_FAILt = 0;
-
-void expire_rects1(int idx, int w, int h, int *x_hit, int *y_hit, int big1, int big2, int cram) {
-	sraRegionPtr r1, r2, r3;
-	int x = -1, y = -1, n;
-
-	if (*x_hit < 0) {
-		int i, k, old[10], N = 4;
-		double dold[10], fa, d, d1, d2, d3;
-		int a0 = w * h, a1;
-
-		for (k=1; k<=N; k++) {
-			old[k] = -1;
-			dold[k] = -1.0;
-		}
-		for (i=0; i<cache_list_num; i++) {
-			int wb = cache_list[i].bs_w;
-			int hb = cache_list[i].bs_h;
-			if (cache_list[i].bs_x < 0) {
-				continue;
-			}
-			if (w > wb || h > hb) {
-				continue;
-			}
-			if (wb == 0 || hb == 0) {
-				continue;
-			}
-			if (a0 == 0) {
-				continue;
-			}
-			if (i == idx) {
-				continue;
-			}
-			a1 = wb * hb;
-			fa = ((double) a1) / a0;
-			k = (int) fa;
-
-			if (k < 1) k = 1;
-			if (k > N) continue;
-
-			d1 = cache_list[i].time;
-			d2 = cache_list[i].bs_time;
-			d3 = cache_list[i].su_time;
-
-			d = d1;
-			if (d2 > d) d = d2;
-			if (d3 > d) d = d3;
-
-			if (dold[k] == -1.0 || d < dold[k]) {
-				old[k] = i;
-				dold[k] = d;
-			}
-		}
-
-		for (k=1; k<=N; k++) {
-			if (old[k] >= 0) {
-				int ik = old[k];
-				int k_x = cache_list[ik].bs_x;
-				int k_y = cache_list[ik].bs_y;
-				int k_w = cache_list[ik].bs_w;
-				int k_h = cache_list[ik].bs_h;
-
-if (ncdb) fprintf(stderr, ">>**--**>> found rect via EXPIRE: %d 0x%lx -- %dx%d+%d+%d %d %d --  %dx%d+%d+%d  A: %d/%d\n",
-    ik, cache_list[ik].win, w, h, x, y, *x_hit, *y_hit, k_w, k_h, k_x, k_y, k_w * k_h, w * h);
-
-				free_rect(ik);
-				fr_EXPIRE++;
-				fr_EXPIREt++;
-				*x_hit = k_x;
-				*y_hit = k_y;
-				n = get_bs_n(*y_hit);
-				if (n >= 0) {
-					r1 = rect_reg[n];
-					r2 = sraRgnCreateRect(*x_hit, *y_hit, *x_hit + w, *y_hit + h);
-					sraRgnSubtract(r1, r2);
-					sraRgnDestroy(r2);
-				} else {
-					fprintf(stderr, "failure to find y n in find_rect\n");
-					clean_up_exit(1);
-				}
-				break;
-			}
-		}
-	}
-
-	/* next, force ourselves into some corner, expiring many */
-	if (*x_hit < 0) {
-		int corner_x = (int) (2 * rfac());
-		int corner_y = (int) (2 * rfac());
-		int x0 = 0, y0 = 0, i, nrand, nr = ncache/2;
-		if (nr == 1) {
-			nrand = 1;
-		} else {
-			if (! big1) {
-				nrand = 1;
-			} else {
-				if (big2 && nr > 2) {
-					nrand =  1 + (int) ((nr - 2) * rfac());
-					nrand += 2; 
-				} else {
-					nrand =  1 + (int) ((nr - 1) * rfac());
-					nrand += 1; 
-				}
-			}
-		}
-		if (nrand < 0 || nrand > nr) {
-			nrand = nr;
-		}
-		if (cram && big1) {
-			corner_x = 1;
-		}
-
-		y0 += dpy_y; 
-		if (nrand > 1) {
-			y0 += 2 * (nrand - 1) * dpy_y; 
-		}
-		if (corner_y) {
-			y0 += dpy_y - h; 
-		}
-		if (corner_x) {
-			x0 += dpy_x - w; 
-		}
-		r1 = sraRgnCreateRect(x0, y0, x0+w, y0+h);
-
-		for (i=0; i<cache_list_num; i++) {
-			int xb = cache_list[i].bs_x;
-			int yb = cache_list[i].bs_y;
-			int wb = cache_list[i].bs_w;
-			int hb = cache_list[i].bs_h;
-			if (xb < 0) {
-				continue;
-			}
-			if (nabs(yb - y0) > dpy_y) {
-				continue;
-			}
-			r2 = sraRgnCreateRect(xb, yb, xb+wb, yb+hb);
-			if (sraRgnAnd(r2, r1)) {
-				free_rect(i);
-			}
-			sraRgnDestroy(r2);
-		}
-		*x_hit = x0;
-		*y_hit = y0;
-		r3 = rect_reg[2*nrand-1];
-		sraRgnSubtract(r3, r1);
-		sraRgnDestroy(r1);
-
-if (ncdb) fprintf(stderr, ">>**--**>> found rect via FORCE: %dx%d+%d+%d -- %d %d\n", w, h, x, y, *x_hit, *y_hit);
-
-		fr_FORCE++;
-		fr_FORCEt++;
-	}
-}
-
-void expire_rects2(int idx, int w, int h, int *x_hit, int *y_hit, int big1, int big2, int cram) {
-	sraRegionPtr r1, r2, r3;
-	int x = -1, y = -1, n, i, j, k;
-	int nwgt_max = 128, nwgt = 0;
-	int type[128];
-	int val[4][128];
-	double wgt[128], norm;
-	int Expire = 1, Force = 2;
-	int do_expire = 1;
-	int do_force = 1;
-	double now = dnow(), r;
-	double newest = -1.0, oldest = -1.0, basetime;
-	double map_factor = 0.25;
-
-	for (i=0; i<cache_list_num; i++) {
-		double d, d1, d2;
-
-		d1 = cache_list[i].bs_time;
-		d2 = cache_list[i].su_time;
-
-		d = d1;
-		if (d2 > d) d = d2;
-
-		if (d == 0.0) {
-			continue;
-		}
-
-		if (oldest == -1.0 || d < oldest) {
-			oldest = d;
-		}
-		if (newest == -1.0 || d > newest) {
-			newest = d;
-		}
-	}
-	if (newest == -1.0) {
-		newest = now;
-	}
-	if (oldest == -1.0) {
-		oldest = newest - 1800;
-	}
-
-	basetime = newest + 0.1 * (newest - oldest);
-
-	if (do_expire) {
-		int old[10], N = 4;
-		double dold[10], fa, d, d1, d2;
-		int a0 = w * h, a1;
-
-		for (k=1; k<=N; k++) {
-			old[k] = -1;
-			dold[k] = -1.0;
-		}
-		for (i=0; i<cache_list_num; i++) {
-			int wb = cache_list[i].bs_w;
-			int hb = cache_list[i].bs_h;
-			if (cache_list[i].bs_x < 0) {
-				continue;
-			}
-			if (w > wb || h > hb) {
-				continue;
-			}
-			if (wb == 0 || hb == 0) {
-				continue;
-			}
-			if (a0 == 0) {
-				continue;
-			}
-			if (i == idx) {
-				continue;
-			}
-
-			a1 = wb * hb;
-			fa = ((double) a1) / a0;
-			k = (int) fa;
-
-			if (k < 1) k = 1;
-			if (k > N) continue;
-
-			d1 = cache_list[i].bs_time;
-			d2 = cache_list[i].su_time;
-
-			d = d1;
-			if (d2 > d) d = d2;
-			if (d == 0.0) d = oldest;
-
-			if (dold[k] == -1.0 || d < dold[k]) {
-				old[k] = i;
-				dold[k] = d;
-			}
-		}
-
-		for (k=1; k<=N; k++) {
-			if (old[k] >= 0) {
-				int ik = old[k];
-				int k_w = cache_list[ik].bs_w;
-				int k_h = cache_list[ik].bs_h;
-
-				wgt[nwgt] =  (basetime - dold[k]) / (k_w * k_h);
-				if (cache_list[ik].map_state == IsViewable) {
-					wgt[nwgt] *= map_factor;
-				}
-				type[nwgt] = Expire;
-				val[0][nwgt] = ik;
-if (ncdb) fprintf(stderr, "Expire[%02d]   %9.5f  age=%9.4f  area=%8d  need=%8d\n", nwgt, 10000 * wgt[nwgt], basetime - dold[k], k_w * k_h, w*h);
-				nwgt++;
-				if (nwgt >= nwgt_max) {
-					break;
-				}
-			}
-		}
-	}
-
-	/* next, force ourselves into some corner, expiring many rect */
-	if (do_force) {
-		int corner_x, corner_y;
-		int x0, y0;
-
-		for (n = 1; n < ncache; n += 2) {
-		    if (big1 && ncache > 2 && n == 1) {
-			continue;
-		    }
-		    if (big2 && ncache > 4 && n <= 3) {
-			continue;
-		    }
-		    for (corner_x = 0; corner_x < 2; corner_x++) {
-			if (cram && big1 && corner_x == 0) {
-				continue;
-			}
-			for (corner_y = 0; corner_y < 2; corner_y++) {
-				double age = 0.0, area = 0.0, amap = 0.0, a;
-				double d, d1, d2, score;
-				int nc = 0;
-
-				x0 = 0;
-				y0 = 0;
-				y0 += n * dpy_y; 
-
-				if (corner_y) {
-					y0 += dpy_y - h; 
-				}
-				if (corner_x) {
-					x0 += dpy_x - w; 
-				}
-				r1 = sraRgnCreateRect(x0, y0, x0+w, y0+h);
-
-				for (i=0; i<cache_list_num; i++) {
-					int xb = cache_list[i].bs_x;
-					int yb = cache_list[i].bs_y;
-					int wb = cache_list[i].bs_w;
-					int hb = cache_list[i].bs_h;
-
-					if (xb < 0) {
-						continue;
-					}
-					if (nabs(yb - y0) > dpy_y) {
-						continue;
-					}
-
-					r2 = sraRgnCreateRect(xb, yb, xb+wb, yb+hb);
-					if (! sraRgnAnd(r2, r1)) {
-						sraRgnDestroy(r2);
-						continue;
-					}
-					sraRgnDestroy(r2);
-
-					a = wb * hb;
-
-					d1 = cache_list[i].bs_time;
-					d2 = cache_list[i].su_time;
-
-					d = d1;
-					if (d2 > d) d = d2;
-					if (d == 0.0) d = oldest;
-
-					if (cache_list[i].map_state == IsViewable) {
-						amap += a;
-					}
-					area += a;
-					age += (basetime - d) * a;
-					nc++;
-				}
-				if (nc == 0) {
-					score = 999999.9;
-				} else {
-					double fac;
-					age = age / area;
-					score = age / area;
-					fac = 1.0 * (1.0 - amap/area) + map_factor * (amap/area);
-					score *= fac;
-				}
-
-				wgt[nwgt] =  score;
-				type[nwgt] = Force;
-				val[0][nwgt] = n;
-				val[1][nwgt] = x0;
-				val[2][nwgt] = y0;
-if (ncdb) fprintf(stderr, "Force [%02d]   %9.5f  age=%9.4f  area=%8d  amap=%8d  need=%8d\n", nwgt, 10000 * wgt[nwgt], age, (int) area, (int) amap, w*h);
-				nwgt++;
-				if (nwgt >= nwgt_max) break;
-				sraRgnDestroy(r1);
-			}
-			if (nwgt >= nwgt_max) break;
-		    }
-		    if (nwgt >= nwgt_max) break;
-		}
-	}
-
-	if (nwgt == 0) {
-if (ncdb) fprintf(stderr, "nwgt=0\n");
-		*x_hit = -1;
-		return;
-	}
-
-	norm = 0.0;
-	for (i=0; i < nwgt; i++) {
-		norm += wgt[i];
-	}
-	for (i=0; i < nwgt; i++) {
-		wgt[i] /= norm; 
-	}
-
-	r = rfac();
-
-	norm = 0.0;
-	for (j=0; j < nwgt; j++) {
-		norm += wgt[j];
-if (ncdb) fprintf(stderr, "j=%2d  acc=%.6f r=%.6f\n", j, norm, r); 
-		if (r < norm) {
-			break;
-		}
-	}
-	if (j >= nwgt) {
-		j = nwgt - 1;
-	}
-
-	if (type[j] == Expire) {
-		int ik = val[0][j];
-		int k_x = cache_list[ik].bs_x;
-		int k_y = cache_list[ik].bs_y;
-		int k_w = cache_list[ik].bs_w;
-		int k_h = cache_list[ik].bs_h;
-
-if (ncdb) fprintf(stderr, ">>**--**>> found rect [%d] via RAN EXPIRE: %d 0x%lx -- %dx%d+%d+%d %d %d --  %dx%d+%d+%d  A: %d/%d\n",
-	get_bs_n(*y_hit), ik, cache_list[ik].win, w, h, x, y, *x_hit, *y_hit, k_w, k_h, k_x, k_y, k_w * k_h, w * h);
-
-		free_rect(ik);
-		fr_EXPIRE++;
-		fr_EXPIREt++;
-		*x_hit = k_x;
-		*y_hit = k_y;
-		n = get_bs_n(*y_hit);
-		if (n >= 0) {
-			r1 = rect_reg[n];
-			r2 = sraRgnCreateRect(*x_hit, *y_hit, *x_hit + w, *y_hit + h);
-			sraRgnSubtract(r1, r2);
-			sraRgnDestroy(r2);
-		} else {
-			fprintf(stderr, "failure to find y n in find_rect\n");
-			clean_up_exit(1);
-		}
-		
-	} else if (type[j] == Force) {
-
-		int x0 = val[1][j];
-		int y0 = val[2][j];
-		n = val[0][j];
-		
-		r1 = sraRgnCreateRect(x0, y0, x0+w, y0+h);
-
-		for (i=0; i<cache_list_num; i++) {
-			int xb = cache_list[i].bs_x;
-			int yb = cache_list[i].bs_y;
-			int wb = cache_list[i].bs_w;
-			int hb = cache_list[i].bs_h;
-			if (xb < 0) {
-				continue;
-			}
-			if (nabs(yb - y0) > dpy_y) {
-				continue;
-			}
-			r2 = sraRgnCreateRect(xb, yb, xb+wb, yb+hb);
-			if (sraRgnAnd(r2, r1)) {
-				free_rect(i);
-			}
-			sraRgnDestroy(r2);
-		}
-		*x_hit = x0;
-		*y_hit = y0;
-		r3 = rect_reg[2*n-1];
-		sraRgnSubtract(r3, r1);
-		sraRgnDestroy(r1);
-
-if (ncdb) fprintf(stderr, ">>**--**>> found rect [%d] via RAN FORCE: %dx%d+%d+%d -- %d %d\n", n, w, h, x, y, *x_hit, *y_hit);
-
-		fr_FORCE++;
-		fr_FORCEt++;
-	}
-}
-
-void expire_rects(int idx, int w, int h, int *x_hit, int *y_hit, int big1, int big2, int cram) {
-	int method = 2;
-	if (method == 1) {
-		expire_rects1(idx, w, h, x_hit, y_hit, big1, big2, cram);
-	} else if (method == 2) {
-		expire_rects2(idx, w, h, x_hit, y_hit, big1, big2, cram);
-	}
-}
-
-int find_rect(int idx, int x, int y, int w, int h) {
-	sraRegionPtr r1, r2;
-	sraRectangleIterator *iter;
-	sraRect rt;
-	int n, x_hit = -1, y_hit = -1;
-	int big1 = 0, big2 = 0, cram = 0;
-	double fac1 = 0.1, fac2 = 0.25;
-	double last_clean = 0.0;
-	double now = dnow();
-	static int nobigs = -1;
-
-	if (rect_reg[1] == NULL) {
-		for (n = 1; n <= ncache; n++) {
-			rect_reg[n] = sraRgnCreateRect(0, n * dpy_y, dpy_x, (n+1) * dpy_y);
-		}
-	} else if (now > last_clean + 60) {
-		last_clean = now;
-		for (n = 1; n < ncache; n += 2) {
-			int i, n2 = n+1;
-
-			/* n */
-			sraRgnDestroy(rect_reg[n]);
-			r1 = sraRgnCreateRect(0, n * dpy_y, dpy_x, (n+1) * dpy_y);
-			for (i=0; i<cache_list_num; i++) {
-				int bs_x = cache_list[i].bs_x;
-				int bs_y = cache_list[i].bs_y;
-				int bs_w = cache_list[i].bs_w;
-				int bs_h = cache_list[i].bs_h;
-				if (bs_x < 0) {
-					continue;
-				}
-				if (get_bs_n(bs_y) != n) {
-					continue;
-				}
-				r2 = sraRgnCreateRect(bs_x, bs_y, bs_x+bs_w, bs_y+bs_h);
-				sraRgnSubtract(r1, r2);
-			}
-			rect_reg[n] = r1;
-
-			/* n+1 */
-			sraRgnDestroy(rect_reg[n2]);
-			r1 = sraRgnCreateRect(0, n2 * dpy_y, dpy_x, (n2+1) * dpy_y);
-			for (i=0; i<cache_list_num; i++) {
-				int bs_x = cache_list[i].bs_x;
-				int su_x = cache_list[i].su_x;
-				int su_y = cache_list[i].su_y;
-				int su_w = cache_list[i].su_w;
-				int su_h = cache_list[i].su_h;
-				if (bs_x < 0) {
-					continue;
-				}
-				if (get_bs_n(su_y) != n2) {
-					continue;
-				}
-				r2 = sraRgnCreateRect(su_x, su_y, su_x+su_w, su_y+su_h);
-				sraRgnSubtract(r1, r2);
-			}
-			rect_reg[n2] = r1;
-		}
-	}
-
-	if (idx < 0 || idx >= cache_list_num) {
-if (ncdb) fprintf(stderr, "free_rect: bad index: %d\n", idx);
-		clean_up_exit(1);
-	}
-
-	cache_list[idx].bs_x = -1;
-	cache_list[idx].su_x = -1;
-	cache_list[idx].bs_time = 0.0;
-	cache_list[idx].su_time = 0.0;
-
-	if (ncache_pad) {
-		x -= ncache_pad;	
-		y -= ncache_pad;	
-		w += 2 * ncache_pad;	
-		h += 2 * ncache_pad;	
-	}
-
-	if (ncache <= 2) {
-		cram = 1;
-		fac2 = 0.45;
-	} else if (ncache <= 4) {
-		fac1 = 0.18;
-		fac2 = 0.35;
-	}
-	if (macosx_console && !macosx_ncache_macmenu) {
-		if (cram) {
-			fac1 *= 1.5;	
-			fac2 *= 1.5;	
-		} else {
-			fac1 *= 2.5;	
-			fac2 *= 2.5;	
-		}
-	}
-	if (w * h > fac1 * (dpy_x * dpy_y)) {
-		big1 = 1;
-	}
-	if (w * h > fac2 * (dpy_x * dpy_y)) {
-		big2 = 1;
-	}
-
-	if (nobigs < 0) {
-		if (getenv("NOBIGS")) {
-			nobigs = 1;
-		} else {
-			nobigs = 0;
-		}
-	}
-	if (nobigs) {
-		big1 = big2 = 0;
-	}
-
-	if (w > dpy_x || h > dpy_y) {
-if (ncdb) fprintf(stderr, ">>**--**>> BIG1 rect: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit);
-		fr_BIG1++;
-		fr_BIG1t++;
-		return 0;
-	}
-	if (w == dpy_x && h == dpy_y) {
-if (ncdb) fprintf(stderr, ">>**--**>> BIG1 rect: %dx%d+%d+%d -- %d %d (FULL DISPLAY)\n", w, h, x, y, x_hit, y_hit);
-		fr_BIG1++;
-		fr_BIG1t++;
-		return 0;
-	}
-	if (cram && big2) {
-if (ncdb) fprintf(stderr, ">>**--**>> BIG2 rect: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit);
-		fr_BIG2++;
-		fr_BIG2t++;
-		return 0;
-	}
-
-	/* first try individual rects of unused region */
-	for (n = 1; n < ncache; n += 2) {
-		r1 = rect_reg[n];
-		r2 = NULL;
-		if (big1 && n == 1 && ncache > 2) {
-			continue;
-		}
-		if (big2 && n <= 3 && ncache > 4) {
-			continue;
-		}
-		iter = sraRgnGetIterator(r1);
-		while (sraRgnIteratorNext(iter, &rt)) {
-			int rw = rt.x2 - rt.x1;
-			int rh = rt.y2 - rt.y1;
-			if (cram && big1 && rt.x1 < dpy_x/4) {
-				continue;
-			}
-			if (rw >= w && rh >= h) {
-				x_hit = rt.x1;
-				y_hit = rt.y1;
-				if (cram && big1) {
-					x_hit = rt.x2 - w;
-				}
-				r2 = sraRgnCreateRect(x_hit, y_hit, x_hit + w, y_hit + h);
-				break;
-			}
-		}
-		sraRgnReleaseIterator(iter);
-		if (r2 != NULL) {
-if (ncdb) fprintf(stderr, ">>**--**>> found rect via REGION: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit);
-			fr_REGION++;
-			fr_REGIONt++;
-			sraRgnSubtract(r1, r2);
-			sraRgnDestroy(r2);
-			break;
-		}
-	}
-
-	
-	/* next try moving corner to grid points */
-	if (x_hit < 0) {
-	    for (n = 1; n < ncache; n += 2) {
-		int rx, ry, Nx = 48, Ny = 24, ny = n * dpy_y;
-
-		if (big1 && n == 1 && ncache > 2) {
-			continue;
-		}
-		if (big2 && n == 3 && ncache > 4) {
-			continue;
-		}
-
-		r1 = sraRgnCreateRect(0, n * dpy_y, dpy_x, (n+1) * dpy_y);
-		sraRgnSubtract(r1, rect_reg[n]);
-		r2 = NULL;
-
-		rx = 0;
-		while (rx + w <= dpy_x) {
-		    ry = 0;
-		    if (cram && big1 && rx < dpy_x/4) {
-			rx += dpy_x/Nx;
-		    	continue;
-		    }
-		    while (ry + h <= dpy_y) {
-			r2 = sraRgnCreateRect(rx, ry+ny, rx + w, ry+ny + h);
-			if (sraRgnAnd(r2, r1)) {
-				sraRgnDestroy(r2);
-				r2 = NULL;
-			} else {
-				sraRgnDestroy(r2);
-				r2 = sraRgnCreateRect(rx, ry+ny, rx + w, ry+ny + h);
-				x_hit = rx;
-				y_hit = ry+ny;
-			}
-			ry += dpy_y/Ny;
-			if (r2) break;
-		    }
-		    rx += dpy_x/Nx;
-		    if (r2) break;
-		}
-		sraRgnDestroy(r1);
-		if (r2 != NULL) {
-			sraRgnSubtract(rect_reg[n], r2);
-			sraRgnDestroy(r2);
-if (ncdb) fprintf(stderr, ">>**--**>> found rect via GRID: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit);
-			fr_GRID++;
-			fr_GRIDt++;
-			break;
-		}
-	    }
-	}
-
-	/* next, try expiring the oldest/smallest used bs/su rectangle we fit in */
-
-	if (x_hit < 0) {
-		expire_rects(idx, w, h, &x_hit, &y_hit, big1, big2, cram);
-	}
-
-	cache_list[idx].bs_x = x_hit;
-	cache_list[idx].bs_y = y_hit;
-	cache_list[idx].bs_w = w;
-	cache_list[idx].bs_h = h;
-
-	cache_list[idx].su_x = x_hit;
-	cache_list[idx].su_y = y_hit + dpy_y;
-	cache_list[idx].su_w = w;
-	cache_list[idx].su_h = h;
-
-	if (x_hit < 0) {
-		/* bad news, can it still happen? */
-		if (ncdb) fprintf(stderr, ">>**--**>> *FAIL rect: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit);
-		fr_FAIL++;
-		fr_FAILt++;
-		return 0;
-	} else {
-		if (0) fprintf(stderr, ">>**--**>> found rect: %dx%d+%d+%d -- %d %d\n", w, h, x, y, x_hit, y_hit);
-	}
-
-	if (zero_rects) {
-		r1 = sraRgnCreateRect(x_hit, y_hit, x_hit+w, y_hit+h);
-		sraRgnSubtract(zero_rects, r1);
-		sraRgnDestroy(r1);
-		r1 = sraRgnCreateRect(x_hit, y_hit+dpy_y, x_hit+w, y_hit+dpy_y+h);
-		sraRgnSubtract(zero_rects, r1);
-		sraRgnDestroy(r1);
-	}
-
-	return 1;
-}
-
-static void cache_cr(sraRegionPtr r, int dx, int dy, double d0, double d1, int *nbatch) {
-	if (sraRgnEmpty(r)) {
-		return;
-	}
-	if (nbatch == NULL) {
-		if (!fb_push_wait(d0, FB_COPY)) {
-			fb_push_wait(d0/2, FB_COPY);
-		}
-		do_copyregion(r, dx, dy, 0);
-		if (!fb_push_wait(d1, FB_COPY)) {
-			fb_push_wait(d1/2, FB_COPY);
-		}
-	} else {
-		batch_dxs[*nbatch] = dx;
-		batch_dys[*nbatch] = dy;
-		batch_reg[*nbatch] = sraRgnCreateRgn(r);
-		(*nbatch)++;
-	}
-}
-
-double save_delay0    = 0.02;
-double restore_delay0 = 0.02;
-double save_delay1    = 0.05;
-double restore_delay1 = 0.05;
-static double dtA, dtB;
-
-int valid_wr(int idx, Window win, XWindowAttributes *attr) {
-#ifdef MACOSX
-	if (macosx_console) {
-		/* this is all to avoid animation changing WxH+X+Y... */
-		if (idx >= 0) {
-			int rc = valid_window(win, attr, 1);
-			attr->x = cache_list[idx].x;
-			attr->y = cache_list[idx].y;
-			attr->width = cache_list[idx].width;
-			attr->height = cache_list[idx].height;
-			return rc;
-		} else {
-			return valid_window(win, attr, 1);
-		}
-	}
-#else
-	if (!idx) {}
-#endif
-	return valid_window(win, attr, 1);
-}
-
-int clipped(int idx) {
-	int ic;	
-	sraRegionPtr r0, r1, r2;
-	int x1, y1, w1, h1;
-	Window win;
-	int clip = 0;
-
-	if (idx < 0) {
-		return 0;
-	}
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-
-	x1 = cache_list[idx].x;
-	y1 = cache_list[idx].y;
-	w1 = cache_list[idx].width;
-	h1 = cache_list[idx].height;
-
-	win = cache_list[idx].win;
-
-	r1 = sraRgnCreateRect(x1, y1, x1+w1, y1+h1);
-	sraRgnAnd(r1, r0);
-
-	for (ic = old_stack_n - 1; ic >= 0; ic--) {
-		int xc, yc, wc, hc, idx2;
-
-		if (old_stack[ic] == win) {
-			break;
-		}
-		if (old_stack_mapped[ic] == 0) {
-			continue;
-		}
-		idx2 = lookup_old_stack_index(ic);
-		if (idx2 < 0) {
-			continue;
-		}
-		if (cache_list[idx2].win == win) {
-			break;
-		}
-		if (cache_list[idx2].map_state != IsViewable) {
-			continue;
-		}
-		xc = cache_list[idx2].x;
-		yc = cache_list[idx2].y;
-		wc = cache_list[idx2].width;
-		hc = cache_list[idx2].height;
-
-		r2 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc);
-		sraRgnAnd(r2, r0);
-		if (sraRgnAnd(r2, r1)) {
-if (0) fprintf(stderr, "clip[0x%lx]: 0x%lx, %d/%d\n", win, cache_list[idx2].win, ic, idx2);
-			clip = 1;
-		}
-		sraRgnDestroy(r2);
-		if (clip) {
-			break;
-		}
-	}
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r1);
-if (0) fprintf(stderr, "clip[0x%lx]: %s\n", win, clip ? "clipped" : "no-clipped");
-	return clip;
-}
-
-void clip_region(sraRegionPtr r, Window win) {
-	int ic, idx2;	
-	sraRegionPtr r1;
-	for (ic = old_stack_n - 1; ic >= 0; ic--) {
-		int xc, yc, wc, hc;
-
-if (0) fprintf(stderr, "----[0x%lx]: 0x%lx, %d  %d\n", win, old_stack[ic], ic, old_stack_mapped[ic]);
-		if (old_stack[ic] == win) {
-			break;
-		}
-		if (old_stack_mapped[ic] == 0) {
-			continue;
-		}
-		idx2 = lookup_old_stack_index(ic);
-		if (idx2 < 0) {
-			continue;
-		}
-		if (cache_list[idx2].win == win) {
-			break;
-		}
-		if (cache_list[idx2].map_state != IsViewable) {
-			continue;
-		}
-		xc = cache_list[idx2].x;
-		yc = cache_list[idx2].y;
-		wc = cache_list[idx2].width;
-		hc = cache_list[idx2].height;
-		r1 = sraRgnCreateRect(xc, yc, xc+wc, yc+hc);
-		if (sraRgnAnd(r1, r)) {
-			sraRgnSubtract(r, r1);
-if (0) fprintf(stderr, "clip[0x%lx]: 0x%lx, %d/%d\n", win, cache_list[idx2].win, ic, idx2);
-		}
-		sraRgnDestroy(r1);
-	}
-}
-
-int bs_save(int idx, int *nbatch, XWindowAttributes *attr, int clip, int only_if_tracking, int *valid, int verb) {
-	Window win = cache_list[idx].win;
-	int x1, y1, w1, h1;
-	int x2, y2, w2, h2;
-	int x, y, w, h;
-	int dx, dy, rc = 1;
-	sraRegionPtr r, r0;
-	
-	x1 = cache_list[idx].x;
-	y1 = cache_list[idx].y;
-	w1 = cache_list[idx].width;
-	h1 = cache_list[idx].height;
-
-if (ncdb && verb) fprintf(stderr, "backingstore save:       0x%lx  %3d clip=%d\n", win, idx, clip);
-	
-	X_LOCK;
-	if (*valid) {
-		attr->x = x1;
-		attr->y = y1;
-		attr->width = w1;
-		attr->height = h1;
-	} else if (! valid_wr(idx, win, attr)) {
-if (ncdb) fprintf(stderr, "bs_save:    not a valid X window: 0x%lx\n", win);
-		X_UNLOCK;
-		*valid = 0;
-		cache_list[idx].valid = 0;
-		return 0;
-	} else {
-		*valid = 1;
-	}
-	X_UNLOCK;
-
-	if (only_if_tracking && cache_list[idx].bs_x < 0) {
-		return 0;
-	}
-
-	x2 = attr->x;
-	y2 = attr->y;
-	w2 = attr->width;
-	h2 = attr->height;
-
-	if (cache_list[idx].bs_x < 0) {
-		rc = find_rect(idx, x2, y2, w2, h2);
-	} else if (w2 > cache_list[idx].bs_w || h2 > cache_list[idx].bs_h) {
-		free_rect(idx);
-		rc = find_rect(idx, x2, y2, w2, h2);
-	}
-
-	x = cache_list[idx].bs_x;
-	y = cache_list[idx].bs_y;
-	w = cache_list[idx].bs_w;
-	h = cache_list[idx].bs_h;
-
-	if (x < 0 || ! rc) {
-if (ncdb) fprintf(stderr, "BS_save: FAIL FOR: %d\n", idx);
-		return 0;
-	}
-
-	if (ncache_pad) {
-		x2 -= ncache_pad;	
-		y2 -= ncache_pad;	
-		w2 += 2 * ncache_pad;	
-		h2 += 2 * ncache_pad;	
-	}
-
-	if (clipshift) {
-		x2 -= coff_x;
-		y2 -= coff_y;
-	}
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r = sraRgnCreateRect(x2, y2, x2+w2, y2+h2);
-	sraRgnAnd(r, r0);
-
-	if (clip) {
-		clip_region(r, win);
-	}
-
-	if (sraRgnEmpty(r)) {
-if (ncdb && verb) fprintf(stderr, "BS_save: Region Empty: %d\n", idx);
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r);
-		return 0;
-	}
-
-	dx = x - x2; 
-	dy = y - y2; 
-
-	sraRgnOffset(r, dx, dy);
-
-	dtA =  dnowx();
-if (ncdb && verb) fprintf(stderr, "BS_save: %.4f      %d dx=%d dy=%d\n", dtA, idx, dx, dy);
-	if (w2 > 0 && h2 > 0) {
-		cache_cr(r, dx, dy, save_delay0, save_delay1, nbatch);
-	}
-	dtB =  dnowx();
-if (ncdb && verb) fprintf(stderr, "BS_save: %.4f %.2f %d done.  %dx%d+%d+%d %dx%d+%d+%d  %.2f %.2f\n", dtB, dtB-dtA, idx, w1, h1, x1, y1, w2, h2, x2, y2, cache_list[idx].bs_time - x11vnc_start, dnowx());
-
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r);
-
-	last_bs_save = cache_list[idx].bs_time = dnow();
-
-	return 1;
-}
-
-int su_save(int idx, int *nbatch, XWindowAttributes *attr, int clip, int *valid, int verb) {
-	Window win = cache_list[idx].win;
-	int x1, y1, w1, h1;
-	int x2, y2, w2, h2;
-	int x, y, w, h;
-	int dx, dy, rc = 1;
-	sraRegionPtr r, r0;
-	
-if (ncdb && verb) fprintf(stderr, "save-unders save:        0x%lx  %3d \n", win, idx);
-
-	x1 = cache_list[idx].x;
-	y1 = cache_list[idx].y;
-	w1 = cache_list[idx].width;
-	h1 = cache_list[idx].height;
-	
-	X_LOCK;
-	if (*valid) {
-		attr->x = x1;
-		attr->y = y1;
-		attr->width = w1;
-		attr->height = h1;
-	} else if (! valid_wr(idx, win, attr)) {
-if (ncdb) fprintf(stderr, "su_save:    not a valid X window: 0x%lx\n", win);
-		X_UNLOCK;
-		*valid = 0;
-		cache_list[idx].valid = 0;
-		return 0;
-	} else {
-		*valid = 1;
-	}
-	X_UNLOCK;
-
-	x2 = attr->x;
-	y2 = attr->y;
-	w2 = attr->width;
-	h2 = attr->height;
-
-	if (cache_list[idx].bs_x < 0) {
-		rc = find_rect(idx, x2, y2, w2, h2);
-	} else if (w2 > cache_list[idx].su_w || h2 > cache_list[idx].su_h) {
-		free_rect(idx);
-		rc = find_rect(idx, x2, y2, w2, h2);
-	}
-	x = cache_list[idx].su_x;
-	y = cache_list[idx].su_y;
-	w = cache_list[idx].su_w;
-	h = cache_list[idx].su_h;
-
-	if (x < 0 || ! rc) {
-if (ncdb) fprintf(stderr, "SU_save: FAIL FOR: %d\n", idx);
-		return 0;
-	}
-
-	if (ncache_pad) {
-		x2 -= ncache_pad;	
-		y2 -= ncache_pad;	
-		w2 += 2 * ncache_pad;	
-		h2 += 2 * ncache_pad;	
-	}
-
-	if (clipshift) {
-		x2 -= coff_x;
-		y2 -= coff_y;
-	}
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r = sraRgnCreateRect(x2, y2, x2+w2, y2+h2);
-	sraRgnAnd(r, r0);
-
-	if (clip) {
-		clip_region(r, win);
-	}
-
-	if (sraRgnEmpty(r)) {
-if (ncdb && verb) fprintf(stderr, "SU_save: Region Empty: %d\n", idx);
-		sraRgnDestroy(r0);
-		sraRgnDestroy(r);
-		return 0;
-	}
-
-
-	dx = x - x2; 
-	dy = y - y2; 
-
-	sraRgnOffset(r, dx, dy);
-
-	dtA =  dnowx();
-if (ncdb && verb) fprintf(stderr, "SU_save: %.4f      %d dx=%d dy=%d\n", dtA, idx, dx, dy);
-	if (w2 > 0 && h2 > 0) {
-		cache_cr(r, dx, dy, save_delay0, save_delay1, nbatch);
-	}
-	dtB =  dnowx();
-if (ncdb && verb) fprintf(stderr, "SU_save: %.4f %.2f %d done.  %dx%d+%d+%d %dx%d+%d+%d  %.2f %.2f\n", dtB, dtB-dtA, idx, w1, h1, x1, y1, w2, h2, x2, y2, cache_list[idx].su_time - x11vnc_start, dnowx());
-
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r);
-
-	last_su_save = cache_list[idx].su_time = dnow();
-	
-	return 1;
-}
-
-int bs_restore(int idx, int *nbatch, sraRegionPtr rmask, XWindowAttributes *attr, int clip, int nopad, int *valid, int verb) {
-	Window win = cache_list[idx].win;
-	int x1, y1, w1, h1;
-	int x2, y2, w2, h2;
-	int x, y, w, h;
-	int dx, dy;
-	sraRegionPtr r, r0;
-
-if (ncdb && verb) fprintf(stderr, "backingstore restore:    0x%lx  %3d \n", win, idx);
-
-	x1 = cache_list[idx].x;
-	y1 = cache_list[idx].y;
-	w1 = cache_list[idx].width;
-	h1 = cache_list[idx].height;
-	
-	X_LOCK;
-	if (*valid) {
-		attr->x = x1;
-		attr->y = y1;
-		attr->width = w1;
-		attr->height = h1;
-	} else if (! valid_wr(idx, win, attr)) {
-if (ncdb) fprintf(stderr, "BS_restore: not a valid X window: 0x%lx\n", win);
-		*valid = 0;
-		X_UNLOCK;
-		return 0;
-	} else {
-		*valid = 1;
-	}
-	X_UNLOCK;
-
-	x2 = attr->x;
-	y2 = attr->y;
-	w2 = attr->width;
-	h2 = attr->height;
-
-	x = cache_list[idx].bs_x;
-	y = cache_list[idx].bs_y;
-	w = cache_list[idx].bs_w;
-	h = cache_list[idx].bs_h;
-
-	if (x < 0 || cache_list[idx].bs_time == 0.0) {
-		return 0;
-	}
-
-	if (ncache_pad) {
-		if (nopad) {
-			x += ncache_pad;	
-			y += ncache_pad;	
-			w -= 2 * ncache_pad;	
-			h -= 2 * ncache_pad;	
-		} else {
-			x2 -= ncache_pad;	
-			y2 -= ncache_pad;	
-			w2 += 2 * ncache_pad;	
-			h2 += 2 * ncache_pad;	
-		}
-	}
-
-	if (clipshift) {
-		x2 -= coff_x;
-		y2 -= coff_y;
-	}
-
-	if (w2 > w) {
-		w2 = w;
-	}
-	if (h2 > h) {
-		h2 = h;
-	}
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r = sraRgnCreateRect(x, y, x+w2, y+h2);
-
-	dx = x2 - x; 
-	dy = y2 - y; 
-
-	sraRgnOffset(r, dx, dy);
-	sraRgnAnd(r, r0);
-
-	if (clip) {
-		clip_region(r, win);
-	}
-	if (rmask != NULL) {
-		sraRgnAnd(r, rmask);
-	}
-
-	dtA =  dnowx();
-if (ncdb && verb) fprintf(stderr, "BS_rest: %.4f      %d dx=%d dy=%d\n", dtA, idx, dx, dy);
-	if (w2 > 0 && h2 > 0) {
-		cache_cr(r, dx, dy, restore_delay0, restore_delay1, nbatch);
-	}
-	dtB =  dnowx();
-if (ncdb && verb) fprintf(stderr, "BS_rest: %.4f %.2f %d done.  %dx%d+%d+%d %dx%d+%d+%d  %.2f %.2f\n", dtB, dtB-dtA, idx, w1, h1, x1, y1, w2, h2, x2, y2, cache_list[idx].bs_time - x11vnc_start, dnowx());
-
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r);
-
-	last_bs_restore = dnow();
-	
-	return 1;
-}
-
-int su_restore(int idx, int *nbatch, sraRegionPtr rmask, XWindowAttributes *attr, int clip, int nopad, int *valid, int verb) {
-	Window win = cache_list[idx].win;
-	int x1, y1, w1, h1;
-	int x2 = 0, y2 = 0, w2 = 0, h2 = 0;
-	int x, y, w, h;
-	int dx, dy;
-	sraRegionPtr r, r0;
-
-if (ncdb && verb) fprintf(stderr, "save-unders  restore:    0x%lx  %3d \n", win, idx);
-	
-	x1 = cache_list[idx].x;
-	y1 = cache_list[idx].y;
-	w1 = cache_list[idx].width;
-	h1 = cache_list[idx].height;
-	
-	X_LOCK;
-	if (*valid) {
-		attr->x = x1;
-		attr->y = y1;
-		attr->width = w1;
-		attr->height = h1;
-		x2 = attr->x;
-		y2 = attr->y;
-		w2 = attr->width;
-		h2 = attr->height;
-	} else if (! valid_wr(idx, win, attr)) {
-if (ncdb) fprintf(stderr, "SU_restore: not a valid X window: 0x%lx\n", win);
-		*valid = 0;
-		x2 = x1;
-		y2 = y1;
-		w2 = w1;
-		h2 = h1;
-	} else {
-		x2 = attr->x;
-		y2 = attr->y;
-		w2 = attr->width;
-		h2 = attr->height;
-		*valid = 1;
-	}
-	X_UNLOCK;
-
-	x = cache_list[idx].su_x;
-	y = cache_list[idx].su_y;
-	w = cache_list[idx].su_w;
-	h = cache_list[idx].su_h;
-
-	if (x < 0 || cache_list[idx].bs_x < 0 || cache_list[idx].su_time == 0.0) {
-if (ncdb) fprintf(stderr, "SU_rest: su_x/bs_x/su_time: %d %d %.3f\n", x, cache_list[idx].bs_x, cache_list[idx].su_time);
-		return 0;
-	}
-
-	if (ncache_pad) {
-		if (nopad) {
-			x += ncache_pad;	
-			y += ncache_pad;	
-			w -= 2 * ncache_pad;	
-			h -= 2 * ncache_pad;	
-		} else {
-			x2 -= ncache_pad;	
-			y2 -= ncache_pad;	
-			w2 += 2 * ncache_pad;	
-			h2 += 2 * ncache_pad;	
-		}
-	}
-
-	if (clipshift) {
-		x2 -= coff_x;
-		y2 -= coff_y;
-	}
-
-	if (w2 > w) {
-		w2 = w;
-	}
-	if (h2 > h) {
-		h2 = h;
-	}
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r = sraRgnCreateRect(x, y, x+w2, y+h2);
-
-	dx = x2 - x; 
-	dy = y2 - y; 
-
-	sraRgnOffset(r, dx, dy);
-	sraRgnAnd(r, r0);
-
-	if (clip) {
-		clip_region(r, win);
-	}
-	if (rmask != NULL) {
-		sraRgnAnd(r, rmask);
-	}
-
-	dtA =  dnowx();
-if (ncdb && verb) fprintf(stderr, "SU_rest: %.4f      %d dx=%d dy=%d\n", dtA, idx, dx, dy);
-	if (w2 > 0 && h2 > 0) {
-		cache_cr(r, dx, dy, restore_delay0, restore_delay1, nbatch);
-	}
-	dtB =  dnowx();
-if (ncdb && verb) fprintf(stderr, "SU_rest: %.4f %.2f %d done.  %dx%d+%d+%d %dx%d+%d+%d  %.2f %.2f\n", dtB, dtB-dtA, idx, w1, h1, x1, y1, w2, h2, x2, y2, cache_list[idx].su_time - x11vnc_start, dnowx());
-
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r);
-
-	last_su_restore = dnow();
-
-	return 1;
-}
-
-void check_zero_rects(void) {
-	sraRect rt;
-	sraRectangleIterator *iter;
-	if (! zero_rects) {
-		zero_rects = sraRgnCreate();
-	}
-	if (sraRgnEmpty(zero_rects)) {
-		return;
-	}
-		
-	iter = sraRgnGetIterator(zero_rects);
-	while (sraRgnIteratorNext(iter, &rt)) {
-		zero_fb(rt.x1, rt.y1, rt.x2, rt.y2);
-		mark_rect_as_modified(rt.x1, rt.y1, rt.x2, rt.y2, 0);
-	}
-	sraRgnReleaseIterator(iter);
-	sraRgnMakeEmpty(zero_rects);
-}
-
-void block_stats(void) {
-	int n, k, s1, s2;
-	static int t = -1;
-	int vcnt, icnt, tcnt, vtot = 0, itot = 0, ttot = 0;
-	t++;
-	for (n = 1; n < ncache+1; n += 2) {
-		double area = 0.0, frac;
-		vcnt = 0;
-		icnt = 0;
-		tcnt = 0;
-		for(k=0; k<cache_list_num; k++) {
-			XWindowAttributes attr;
-			int x = cache_list[k].bs_x;
-			int y = cache_list[k].bs_y;
-			int w = cache_list[k].bs_w;
-			int h = cache_list[k].bs_h;
-			int rc = 0;
-			Window win = cache_list[k].win;
-
-			if (win == None) {
-				continue;
-			}
-			if (n == 1) {
-				X_LOCK;
-				rc = valid_window(win, &attr, 1);
-				X_UNLOCK;
-				if (rc) {
-					vtot++;
-				} else {
-					itot++;
-				}
-				if (x >= 0) {
-					ttot++;
-				}
-			}
-			if (y < n*dpy_y || y > (n+1)*dpy_y) {
-				continue;
-			}
-			if (n != 1) {
-				X_LOCK;
-				rc = valid_window(win, &attr, 1);
-				X_UNLOCK;
-			}
-			if (rc) {
-				vcnt++;
-			} else {
-				icnt++;
-			}
-			if (x >= 0) {
-				tcnt++;
-			}
-			if (x < 0) {
-				continue;
-			}
-			area += cache_list[k].width * cache_list[k].height;
-			if (! rc && ! macosx_console) {
-				char *u = getenv("USER");
-				if (u && !strcmp(u, "runge"))	fprintf(stderr, "\a");
-				if (ncdb) fprintf(stderr, "\n   *** UNRECLAIMED WINDOW: 0x%lx  %dx%d+%d+%d\n\n", win, w, h, x, y);
-				DELETE(k);
-			}
-			if (t < 3 || (t % 4) == 0 || hack_val || macosx_console) {
-				double t1 = cache_list[k].su_time;
-				double t2 = cache_list[k].bs_time;
-				if (t1 > 0.0) {t1 = dnow() - t1;} else {t1 = -1.0;}
-				if (t2 > 0.0) {t2 = dnow() - t2;} else {t2 = -1.0;}
-				if (ncdb) fprintf(stderr, "     [%02d] %04d 0x%08lx bs: %04dx%04d+%04d+%05d vw: %04dx%04d+%04d+%04d cl: %04dx%04d+%04d+%04d map=%d su=%9.3f bs=%9.3f cnt=%d/%d\n",
-				    n, k, win, w, h, x, y, attr.width, attr.height, attr.x, attr.y,
-				    cache_list[k].width, cache_list[k].height, cache_list[k].x, cache_list[k].y,
-				    attr.map_state == IsViewable, t1, t2, cache_list[k].create_cnt, cache_list[k].map_cnt); 
-			}
-		}
-		frac = area /(dpy_x * dpy_y);
-		if (ncdb) fprintf(stderr, "block[%02d]  %.3f  %8d  trak/val/inval: %d/%d/%d of %d\n", n, frac, (int) area, tcnt, vcnt, icnt, vcnt+icnt);
-	}
-
-	if (ncdb) fprintf(stderr, "\n");
-	if (ncdb) fprintf(stderr, "block: trak/val/inval %d/%d/%d of %d\n", ttot, vtot, itot, vtot+itot);
-
-	s1 = fr_REGION  + fr_GRID  + fr_EXPIRE  + fr_FORCE  + fr_BIG1  + fr_BIG2  + fr_FAIL;
-	s2 = fr_REGIONt + fr_GRIDt + fr_EXPIREt + fr_FORCEt + fr_BIG1t + fr_BIG2t + fr_FAILt;
-	if (ncdb) fprintf(stderr, "\n");
-	if (ncdb) fprintf(stderr, "find_rect:  REGION/GRID/EXPIRE/FORCE - BIG1/BIG2/FAIL  %d/%d/%d/%d - %d/%d/%d  of %d\n",
-	    fr_REGION,  fr_GRID,  fr_EXPIRE,  fr_FORCE,  fr_BIG1,  fr_BIG2,  fr_FAIL, s1);
-	if (ncdb) fprintf(stderr, "                                       totals:         %d/%d/%d/%d - %d/%d/%d  of %d\n",
-	    fr_REGIONt, fr_GRIDt, fr_EXPIREt, fr_FORCEt, fr_BIG1t, fr_BIG2t, fr_FAILt, s2);
-
-	fr_BIG1 = 0;
-	fr_BIG2 = 0;
-	fr_REGION = 0;
-	fr_GRID = 0;
-	fr_EXPIRE = 0;
-	fr_FORCE = 0;
-	fr_FAIL = 0;
-	if (ncdb) fprintf(stderr, "\n");
-}
-
-#define NSCHED 128
-Window sched_bs[NSCHED];
-double sched_tm[NSCHED];
-double last_sched_bs = 0.0;
-
-#define SCHED(w, v) \
-{ \
-	int k, save = -1, empty = 1; \
-	for (k=0; k < NSCHED; k++) { \
-		if (sched_bs[k] == None) { \
-			save = k; \
-		} \
-		if (sched_bs[k] == w) { \
-			save = k; \
-			empty = 0; \
-			break; \
-		} \
-	} \
-	if (save >= 0) { \
-		sched_bs[save] = w; \
-		if (empty) { \
-			sched_tm[save] = dnow(); \
-			if (v && ncdb) fprintf(stderr, "SCHED: %d %f\n", save, dnowx()); \
-		} \
-	} \
-}
-
-void xselectinput(Window w, unsigned long evmask, int sync) {
-#if NO_X11
-	trapped_xerror = 0;
-	trapped_xioerror = 0;
-	if (!evmask) {}
-#else
-	XErrorHandler   old_handler1;
-	XIOErrorHandler old_handler2;
-
-	if (macosx_console || !dpy) {
-		return;
-	}
-
-	old_handler1 = XSetErrorHandler(trap_xerror);
-	old_handler2 = XSetIOErrorHandler(trap_xioerror);
-	trapped_xerror = 0;
-	trapped_xioerror = 0;
-
-	XSelectInput(dpy, w, evmask);
-
-	/*
-	 * We seem to need to synchronize right away since the window
-	 * might go away quickly.
-	 */
-	if (sync) {
-		XSync(dpy, False);
-	} else {
-		XFlush_wr(dpy);
-	}
-
-	XSetErrorHandler(old_handler1);
-	XSetIOErrorHandler(old_handler2);
-#endif
-
-	if (trapped_xerror) {
-		if (ncdb) fprintf(stderr, "XSELECTINPUT: trapped X Error.");
-	}
-	if (trapped_xioerror) {
-		if (ncdb) fprintf(stderr, "XSELECTINPUT: trapped XIO Error.");
-	}
-if (sync && ncdb) fprintf(stderr, "XSELECTINPUT: 0x%lx  sync=%d err=%d/%d\n", w, sync, trapped_xerror, trapped_xioerror);
-}
-
-Bool xcheckmaskevent(Display *d, long mask, XEvent *ev) {
-#ifdef MACOSX
-	if (macosx_console) {
-		if (macosx_checkevent(ev)) {
-			return True;
-		} else {
-			return False;
-		}
-	}
-#endif
-	RAWFB_RET(False);
-
-#if NO_X11
-	if (!d || !mask) {}
-	return False;
-#else
-	return XCheckMaskEvent(d, mask, ev);
-#endif
-}
-
-#include <rfb/default8x16.h>
-
-#define EVMAX 2048
-XEvent Ev[EVMAX];
-int Ev_done[EVMAX];
-int Ev_order[EVMAX];
-int Ev_area[EVMAX];
-int Ev_tmp[EVMAX];
-int Ev_tmp2[EVMAX];
-Window Ev_tmpwin[EVMAX];
-Window Ev_win[EVMAX];
-Window Ev_map[EVMAX];
-Window Ev_unmap[EVMAX];
-sraRect Ev_rects[EVMAX];
-
-int tmp_stack[STACKMAX];
-sraRegionPtr tmp_reg[STACKMAX];
-
-#define CLEAN_OUT \
-	for (i=0; i < n; i++) { \
-		sraRgnDestroy(tmp_reg[i]); \
-	} \
-	if (r1) sraRgnDestroy(r1); \
-	if (r0) sraRgnDestroy(r0);
-
-int try_to_fix_resize_su(Window orig_frame, int orig_x, int orig_y, int orig_w, int orig_h,
-    int x, int y, int w, int h, int try_batch) {
-
-	int idx = lookup_win_index(orig_frame);
-	sraRegionPtr r0, r1, r2, r3;
-	int sx1, sy1, sw1, sh1, dx, dy;
-	int bx1, by1, bw1, bh1;
-	int nr = 0, *nbat = NULL;
-
-	if (idx < 0) {
-		return 0;
-	}
-	if (cache_list[idx].bs_x < 0 || cache_list[idx].su_time == 0.0) {
-		return 0;
-	}
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	r1 = sraRgnCreateRect(orig_x, orig_y, orig_x+orig_w, orig_y+orig_h);
-	r2 = sraRgnCreateRect(x, y, x+w, y+h);
-
-	sraRgnAnd(r1, r0);
-	sraRgnAnd(r2, r0);
-
-	if (try_batch) {
-		nbat = &nr;
-	}
-	
-	if (orig_w >= w && orig_h >= h) {
-
-if (0) fprintf(stderr, "Shrinking resize %d  %dx%d+%d+%d -> %dx%d+%d+%d\n", idx, orig_w, orig_h, orig_x, orig_y, w, h, x, y);
-		r3 = sraRgnCreateRgn(r1);
-		sraRgnSubtract(r3, r2);
-
-		sx1 = cache_list[idx].su_x;
-		sy1 = cache_list[idx].su_y;
-		sw1 = cache_list[idx].su_w;
-		sh1 = cache_list[idx].su_h;
-
-		dx = orig_x - sx1;
-		dy = orig_y - sy1;
-
-		cache_cr(r3, dx, dy, 0.075, 0.05, nbat);
-		sraRgnDestroy(r3);
-
-		r3 = sraRgnCreateRgn(r1);
-		sraRgnAnd(r3, r2);
-
-		dx = sx1 - orig_x;
-		dy = sy1 - orig_y;
-		sraRgnOffset(r3, dx, dy);
-
-		dx = orig_x - x;
-		dy = orig_y - y;
-		sraRgnOffset(r3, dx, dy);
-
-		cache_cr(r3, dx, dy, 0.075, 0.05, nbat);
-		sraRgnDestroy(r3);
-
-		if (nr) {
-			batch_push(nr, -1.0);
-		}
-
-		cache_list[idx].x = x;
-		cache_list[idx].y = y;
-		cache_list[idx].width = w;
-		cache_list[idx].height = h;
-
-		cache_list[idx].bs_w = w;
-		cache_list[idx].bs_h = h;
-		cache_list[idx].su_w = w;
-		cache_list[idx].su_h = h;
-
-		cache_list[idx].bs_time = 0.0;
-		/* XXX Y */
-		if (0) cache_list[idx].su_time = dnow();
-	} else {
-if (0) fprintf(stderr, "Growing resize %d  %dx%d+%d+%d -> %dx%d+%d+%d\n", idx, orig_w, orig_h, orig_x, orig_y, w, h, x, y);
-
-		sx1 = cache_list[idx].su_x;
-		sy1 = cache_list[idx].su_y;
-		sw1 = cache_list[idx].su_w;
-		sh1 = cache_list[idx].su_h;
-
-		bx1 = cache_list[idx].bs_x;
-		by1 = cache_list[idx].bs_y;
-		bw1 = cache_list[idx].bs_w;
-		bh1 = cache_list[idx].bs_h;
-		
-		if (find_rect(idx, x, y, w, h)) {
-			r3 = sraRgnCreateRgn(r2);
-			sraRgnAnd(r3, r1);
-
-			dx = cache_list[idx].su_x - x;
-			dy = cache_list[idx].su_y - y;
-	
-			sraRgnOffset(r3, dx, dy);
-
-			dx = dx - (sx1 - orig_x);
-			dy = dy - (sy1 - orig_y);
-			
-			cache_cr(r3, dx, dy, 0.075, 0.05, nbat);
-			sraRgnDestroy(r3);
-
-			r3 = sraRgnCreateRgn(r2);
-			sraRgnSubtract(r3, r1);
-
-			dx = cache_list[idx].su_x - x;
-			dy = cache_list[idx].su_y - y;
-	
-			sraRgnOffset(r3, dx, dy);
-
-			cache_cr(r3, dx, dy, 0.075, 0.05, nbat);
-			sraRgnDestroy(r3);
-
-			if (nr) {
-				batch_push(nr, -1.0);
-			}
-
-			cache_list[idx].bs_time = 0.0;
-			/* XXX Y */
-			if (0) cache_list[idx].su_time = dnow();
-		}
-	}
-	
-	sraRgnDestroy(r0);
-	sraRgnDestroy(r1);
-	sraRgnDestroy(r2);
-
-	return 1;
-}
-
-int try_to_fix_su(Window win, int idx, Window above, int *nbatch, char *mode) {
-	int i, idx2, n = 0, found = 0, found_above = 0; 	
-	sraRegionPtr r0, r1, r2;
-	Window win2;
-	int x, y, w, h, on = 0;
-	int x0, y0, w0, h0;
-	int x1, y1, w1, h1;
-	int x2, y2, w2, h2;
-	int unmapped = 0;
-	int moved = 0;
-
-
-	if (mode && !strcmp(mode, "unmapped")) {
-		unmapped = 1;
-	} else if (mode && !strcmp(mode, "moved")) {
-		moved = 1;
-	}
-	if (idx < 0) {
-		return 0;
-	}
-if (ncdb) fprintf(stderr, "TRY_TO_FIX_SU(%d)  0x%lx  0x%lx was_unmapped=%d map_state=%s\n", idx, win, above, unmapped, MState(cache_list[idx].map_state));
-
-	if (cache_list[idx].map_state != IsViewable && !unmapped) {
-		return 0;
-	}
-	if (cache_list[idx].su_time == 0.0) {
-		return 0;
-	}
-	if (cache_list[idx].bs_x < 0) {
-		return 0;
-	}
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-
-	x = cache_list[idx].x;
-	y = cache_list[idx].y;
-	w = cache_list[idx].width;
-	h = cache_list[idx].height;
-
-	r1 = sraRgnCreateRect(x, y, x+w, y+h);
-
-	sraRgnAnd(r1, r0);
-
-	if (sraRgnEmpty(r1)) {
-		CLEAN_OUT
-		return 0;
-	}
-
-	if (unmapped) {
-		on = 1;
-	}
-	if (above == 0x1) {
-		on = 1;
-	}
-	for (i = old_stack_n - 1; i >= 0; i--) {
-		win2 = old_stack[i];
-		if (win2 == above) {
-if (0) fprintf(stderr, "0x%lx turn on:  0x%lx  i=%d\n", win, win2, i);
-			on = 1;
-			found_above = 1;
-		}
-		if (win2 == win) {
-if (0) fprintf(stderr, "0x%lx turn off: 0x%lx  i=%d\n", win, win2, i);
-			found = 1;
-			on = 0;
-			break;
-		}
-		if (! on) {
-			continue;
-		}
-		idx2 = lookup_win_index(win2);
-		if (idx2 < 0) {
-			continue;
-		}
-		if (cache_list[idx2].map_state != IsViewable) {
-			continue;
-		}
-		if (cache_list[idx2].bs_x < 0) {
-			continue;
-		}
-		/* XXX Invalidate? */
-
-		x2 = cache_list[idx2].x;
-		y2 = cache_list[idx2].y;
-		w2 = cache_list[idx2].width;
-		h2 = cache_list[idx2].height;
-
-		r2 = sraRgnCreateRect(x2, y2, x2+w2, y2+h2);
-		sraRgnAnd(r2, r0);
-		if (! sraRgnAnd(r2, r1)) {
-			sraRgnDestroy(r2);
-			continue;
-		}
-
-		tmp_reg[n] = r2;
-		tmp_stack[n++] = idx2;
-	}
-
-	if (! found) {
-		CLEAN_OUT
-		return 0;
-	}
-
-	for (i = n - 1; i >= 0; i--) {
-		int i2;
-		r2 = sraRgnCreateRgn(tmp_reg[i]);
-		for (i2 = i + 1; i2 < n; i2++)  {
-			sraRgnSubtract(r2, tmp_reg[i2]);
-		}
-		idx2 = tmp_stack[i];
-		if (!sraRgnEmpty(r2)) {
-			int dx, dy;
-			int dx2, dy2;
-
-			x0 = cache_list[idx2].x;
-			y0 = cache_list[idx2].y;
-			w0 = cache_list[idx2].width;
-			h0 = cache_list[idx2].height;
-
-			x1 = cache_list[idx].su_x;	/* SU -> SU */
-			y1 = cache_list[idx].su_y;
-			w1 = cache_list[idx].su_w;
-			h1 = cache_list[idx].su_h;
-
-			x2 = cache_list[idx2].su_x;
-			y2 = cache_list[idx2].su_y;
-			w2 = cache_list[idx2].su_w;
-			h2 = cache_list[idx2].su_h;
-
-			dx = x2 - x0;
-			dy = y2 - y0;
-			sraRgnOffset(r2, dx, dy);
-
-			dx2 = x1 - x;
-			dy2 = y1 - y;
-			dx = dx - dx2;
-			dy = dy - dy2;
-			cache_cr(r2, dx, dy, save_delay0, save_delay1, nbatch);
-		}
-		sraRgnDestroy(r2);
-	}
-
-	if (unmapped) {
-		CLEAN_OUT
-		return found_above;
-	}
-
-	for (i = n - 1; i >= 0; i--) {
-		r2 = sraRgnCreateRgn(tmp_reg[i]);
-		idx2 = tmp_stack[i];
-		if (!sraRgnEmpty(r2)) {
-			int dx, dy;
-			int dx2, dy2;
-
-			x0 = cache_list[idx2].x;
-			y0 = cache_list[idx2].y;
-			w0 = cache_list[idx2].width;
-			h0 = cache_list[idx2].height;
-
-			x1 = cache_list[idx].su_x;	/* BS -> SU */
-			y1 = cache_list[idx].su_y;
-			w1 = cache_list[idx].su_w;
-			h1 = cache_list[idx].su_h;
-
-			x2 = cache_list[idx2].bs_x;
-			y2 = cache_list[idx2].bs_y;
-			w2 = cache_list[idx2].bs_w;
-			h2 = cache_list[idx2].bs_h;
-
-			dx = x1 - x;
-			dy = y1 - y;
-			sraRgnOffset(r2, dx, dy);
-
-			dx2 = x2 - x0;
-			dy2 = y2 - y0;
-			dx = dx - dx2;
-			dy = dy - dy2;
-			cache_cr(r2, dx, dy, save_delay0, save_delay1, nbatch);
-		}
-		sraRgnDestroy(r2);
-	}
-
-	CLEAN_OUT
-	return found_above;
-}
-
-void idx_add_rgn(sraRegionPtr r, sraRegionPtr r0, int idx) {
-	int x, y, w, h;
-	sraRegionPtr rtmp;
-	
-	if (idx < 0) {
-		return;
-	}
-	x = cache_list[idx].x;
-	y = cache_list[idx].y;
-	w = cache_list[idx].width;
-	h = cache_list[idx].height;
-
-	rtmp = sraRgnCreateRect(x, y, w, h);
-	if (r0) {
-		sraRgnAnd(rtmp, r0);
-	}
-	sraRgnOr(r, rtmp);
-	sraRgnDestroy(rtmp);
-}
-
-sraRegionPtr idx_create_rgn(sraRegionPtr r0, int idx) {
-	int x, y, w, h;
-	sraRegionPtr rtmp;
-	
-	if (idx < 0) {
-		return NULL;
-	}
-	x = cache_list[idx].x;
-	y = cache_list[idx].y;
-	w = cache_list[idx].width;
-	h = cache_list[idx].height;
-
-	rtmp = sraRgnCreateRect(x, y, w, h);
-	if (r0) {
-		sraRgnAnd(rtmp, r0);
-	}
-	return rtmp;
-}
-
-void scale_mark_xrootpmap(void) {
-	char *dst_fb, *src_fb = main_fb;
-	int dst_bpl, Bpp = bpp/8, fac = 1;
-	int yn = (ncache+1) * dpy_y;
-	int yfac = (ncache+2);
-	int mark = 1;
-
-	if (!scaling || !rfb_fb || rfb_fb == main_fb) {
-		mark_rect_as_modified(0, yn, dpy_x, yn + dpy_y, 0);
-		return;
-	}
-
-	if (cmap8to24 && cmap8to24_fb) {
-		src_fb = cmap8to24_fb;
-		if (scaling) {
-			if (depth <= 8) {
-				fac = 4;
-			} else if (depth <= 16) {
-				fac = 2;
-			}
-		}
-	}
-	dst_fb = rfb_fb;
-	dst_bpl = rfb_bytes_per_line;
-
-	scale_rect(scale_fac_x, scale_fac_y, scaling_blend, scaling_interpolate, fac * Bpp,
-	    src_fb, fac * main_bytes_per_line, dst_fb, dst_bpl, dpy_x, yfac * dpy_y,
-	    scaled_x, yfac * scaled_y, 0, yn, dpy_x, yn + dpy_y, mark);
-}
-
-void set_ncache_xrootpmap(void) {
-	Atom pmap, type;
-	int format;
-	unsigned long length, after;
-	XImage *image = NULL;
-	XErrorHandler old_handler;
-
-	RAWFB_RET_VOID
-#if !NO_X11
-	if (!ncache) {
-		return;
-	}
-	X_LOCK;
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-	pmap = XInternAtom(dpy, "_XROOTPMAP_ID", True);
-
-	if (use_solid_bg) {
-		image = solid_image(NULL);
-		if (!quiet) {
-			rfbLog("set_ncache_xrootpmap: solid_image\n");
-		}
-	} else if (pmap != None) {
-		Pixmap pixmap = None;
-		unsigned char *d_pmap;
-
-		XGetWindowProperty(dpy, rootwin, pmap, 0L, 1L, False,
-		    AnyPropertyType, &type, &format, &length, &after, &d_pmap);
-
-		if (length != 0) {
-			pixmap = *((Pixmap *) d_pmap);
-			if (pixmap != None) {
-				image = XGetImage(dpy, pixmap, 0, 0, dpy_x, dpy_y, AllPlanes, ZPixmap);
-			}
-		}
-		if (!quiet) {
-			rfbLog("set_ncache_xrootpmap: loading background pixmap: 0x%lx\n", pixmap);
-		}
-	} else {
-		if (!quiet) {
-			rfbLog("set_ncache_xrootpmap: trying root background\n");
-		}
-	}
-	if (image == NULL) {
-		image = solid_root((char *) 0x1);
-	}
-	if (image != NULL) {
-		char *src, *dst;
-		int line;
-		int pixelsize = bpp/8;
-		int y1 = dpy_y * (ncache+1);
-
-		src = image->data;
-		dst = main_fb + y1 * main_bytes_per_line;
-		line = 0;
-		while (line++ < dpy_y) {
-			memcpy(dst, src, dpy_x * pixelsize);
-			src += image->bytes_per_line;
-			dst += main_bytes_per_line;
-		}
-		XDestroyImage(image);
-		X_UNLOCK;
-		scale_mark_xrootpmap();
-		X_LOCK;
-	} else {
-		int yn = (ncache+1) * dpy_y;
-		zero_fb(0, yn, dpy_x, yn + dpy_y);
-	}
-	XSetErrorHandler(old_handler);
-	X_UNLOCK;
-#endif
-}
-
-#define EVLISTMAX 256
-#define EV_RESET		0
-#define EV_CREATE		1
-#define EV_DESTROY		2
-#define EV_UNMAP		3
-#define EV_MAP			4
-#define EV_REPARENT		5
-#define EV_CONFIGURE		6
-#define EV_CONFIGURE_SIZE	7
-#define EV_CONFIGURE_POS	8
-#define EV_CONFIGURE_STACK	9
-#define EV_VISIBILITY_UNOBS	10
-#define EV_VISIBILITY_OBS	11
-#define EV_PROPERTY		12
-#define EV_OLD_WM_MAP		13
-#define EV_OLD_WM_UNMAP		14
-#define EV_OLD_WM_OFF		15
-#define EV_OLD_WM_NOTMAPPED	16
-Window _ev_list[EVLISTMAX];
-int _ev_case[EVLISTMAX];
-int _ev_list_cnt;
-
-int n_CN = 0, n_RN = 0, n_DN = 0, n_ON = 0, n_MN = 0, n_UN = 0;
-int n_VN = 0, n_VN_p = 0, n_VN_u = 0, n_ST = 0, n_PN = 0, n_DC = 0;
-int n_ON_sz = 0, n_ON_po = 0, n_ON_st = 0;
-
-int ev_store(Window win, int type) {
-	if (type == EV_RESET)  {
-		n_CN = 0; n_RN = 0; n_DN = 0; n_ON = 0; n_MN = 0; n_UN = 0;
-		n_VN = 0; n_VN_p = 0; n_VN_u = 0; n_ST = 0; n_PN = 0; n_DC = 0;
-		n_ON_sz = 0; n_ON_po = 0; n_ON_st = 0;
-		_ev_list_cnt = 0;
-		return 1;
-	}
-	if (_ev_list_cnt >= EVLISTMAX) {
-		return 0;
-	}
-	_ev_list[_ev_list_cnt] = win;
-	_ev_case[_ev_list_cnt++] = type;
-	return 1;
-}
-
-int ev_lookup(Window win, int type) {
-	int i;
-	for(i=0; i < _ev_list_cnt; i++) {
-		if (_ev_list[i] == win && _ev_case[i] == type) 	{
-			return 1;
-		}
-	}
-	return 0;
-}
-
-unsigned long all_ev = SubstructureNotifyMask|StructureNotifyMask|VisibilityChangeMask;
-unsigned long win_ev = StructureNotifyMask|VisibilityChangeMask;
-
-void read_events(int *n_in) {
-	int n = *n_in;
-	Window win, win2;
-	XEvent ev;
-	
-	while (xcheckmaskevent(dpy, all_ev, &Ev[n])) {
-		int cfg_size = 0;
-		int cfg_pos = 0;
-		int cfg_stack = 0;
-		int type = Ev[n].type; 
-		Window w = None;
-
-		win = Ev[n].xany.window;
-		Ev_done[n] = 0;
-		Ev_area[n] = 0;
-		Ev_win[n] = win;
-		Ev_map[n] = None;
-		Ev_unmap[n] = None;
-		Ev_order[n] = n;
-
-		ev = Ev[n];
-
-		if (type == DestroyNotify)  w = Ev[n].xcreatewindow.window;
-		if (type == CreateNotify)   w = Ev[n].xdestroywindow.window;
-		if (type == ReparentNotify) w = Ev[n].xreparent.window;
-		if (type == UnmapNotify)    w = Ev[n].xunmap.window;
-		if (type == MapNotify)      w = Ev[n].xmap.window;
-		if (type == Expose)         w = Ev[n].xexpose.window;
-		if (type == ConfigureNotify) w = Ev[n].xconfigure.window;
-		if (type == VisibilityNotify) w = win;
-		if (n == *n_in && ncdb) fprintf(stderr, "\n");
-		if (1) {
-			char *msg = "";
-			int idx = -1, x = 0, y = 0, wd = 0, ht = 0;
-			if (w != None) {
-				idx = lookup_win_index(w);
-				if (idx >= 0) {
-					x = cache_list[idx].x;
-					y = cache_list[idx].y;
-					wd = cache_list[idx].width;
-					ht = cache_list[idx].height;
-				}
-			}
-			if (type == VisibilityNotify) {
-				msg = VState(Ev[n].xvisibility.state);
-			} else if (type == ConfigureNotify) {
-				int x_new = Ev[n].xconfigure.x; 
-				int y_new = Ev[n].xconfigure.y; 
-				int w_new = Ev[n].xconfigure.width; 
-				int h_new = Ev[n].xconfigure.height; 
-				if (idx >= 0) {
-					if (w_new != wd || h_new != ht) {
-						msg = "change size";
-						cfg_size = 1;
-					}
-					if (x_new != x || y_new != y) {
-						if (!strcmp(msg, "")) {
-							msg = "change position";
-						}
-						cfg_pos = 1;
-					} else if (! cfg_size) {
-						msg = "change stacking";
-						cfg_stack = 1;
-					}
-				}
-			}
-			
-			if (ncdb) fprintf(stderr, "----- %02d inputev 0x%08lx w: 0x%08lx %04dx%04d+%04d+%04d %s  %s\n", n, win, w, wd, ht, x, y, Etype(type), msg);
-		}
-
-		if (win == rootwin) {
-			if (type == CreateNotify) {
-				win2 = ev.xcreatewindow.window;
-				ev_store(win2, EV_CREATE);
-				n++;
-				n_CN++;
-			} else if (type == ReparentNotify) {
-				if (ev.xreparent.parent != rootwin) {
-					win2 = ev.xreparent.window;
-					if (win2 != rootwin) {
-						ev_store(win2, EV_REPARENT);
-					}
-				}
-				n++;
-				n_RN++;
-			} else if (type == PropertyNotify) {
-				set_prop_atom(Ev[n].xproperty.atom);
-				n++;
-				n_PN++;
-			} else if (type == MapNotify) {
-				win2 = ev.xmap.window;
-				ev_store(win2, EV_MAP);
-				n++;
-				n_CN++;
-			} else {
-				/* skip rest */
-#if 0
-				Window w = None;
-if (type == DestroyNotify) w = Ev[n].xdestroywindow.window;
-if (type == UnmapNotify)   w = Ev[n].xunmap.window;
-if (type == MapNotify)     w = Ev[n].xmap.window;
-if (type == Expose)        w = Ev[n].xexpose.window;
-if (type == ConfigureNotify) w = Ev[n].xconfigure.window;
-if (type != ConfigureNotify) fprintf(stderr, "root: skip %s  for 0x%lx\n", Etype(type), w);
-#endif
-
-			}
-		} else {
-			if (type == ReparentNotify) {
-				ev_store(win, EV_REPARENT);
-				n++;
-				n_RN++;
-			} else if (type == DestroyNotify) {
-				ev_store(win, EV_DESTROY);
-				n++;
-				n_DN++;
-			} else if (type == ConfigureNotify) {
-				ev_store(win, EV_CONFIGURE);
-				if (cfg_size) {
-					ev_store(win, EV_CONFIGURE_SIZE);
-					n_ON_sz++;
-				}
-				if (cfg_pos) {
-					ev_store(win, EV_CONFIGURE_POS);
-					n_ON_po++;
-				}
-				if (cfg_stack) {
-					ev_store(win, EV_CONFIGURE_STACK);
-					n_ON_st++;
-				}
-				n++;
-				n_ON++;
-			} else if (type == VisibilityNotify) {
-				if (Ev[n].xvisibility.state == VisibilityUnobscured) {
-					ev_store(win, EV_VISIBILITY_UNOBS);
-					n_VN_u++;
-				} else {
-					ev_store(win, EV_VISIBILITY_OBS);
-					n_VN_p++;
-				}
-				n++;
-				n_VN++;
-			} else if (type == MapNotify) {
-				ev_store(win, EV_MAP);
-				Ev_map[n] = win;
-				n++;
-				n_MN++;
-			} else if (type == UnmapNotify) {
-				ev_store(win, EV_UNMAP);
-				Ev_unmap[n] = win;
-				n++;
-				n_UN++;
-			} else {
-				/* skip rest */
-if (ncdb) fprintf(stderr, "----- skip %s\n", Etype(type));
-			}
-		}
-		if (n >= EVMAX) {
-			break;
-		}
-	}
-	*n_in = n;
-}
-
-int try_to_synthesize_su(int force, int urgent, int *nbatch) {
-	int i, idx, idx2, n = 0; 	
-	sraRegionPtr r0, r1, r2;
-	Window win = None;
-	int x0, y0, w0, h0;
-	int x1, y1, w1, h1;
-	int x2, y2, w2, h2;
-	int x3, y3, w3, h3;
-	XWindowAttributes attr;
-
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-
-	snap_old();
-
-	X_LOCK;
-	for (i = old_stack_n - 1; i >= 0; i--) {
-		win = old_stack[i];
-		if (urgent) {	/* XXX Y resp */
-			if (!valid_window(win, &attr, 1)) {
-				continue;
-			}
-			idx = lookup_win_index(win);
-			if (idx >= 0) {
-				STORE(idx, win, attr);
-			}
-		} else {
-			idx = lookup_win_index(win);
-			if (idx >= 0) {
-				attr.map_state = cache_list[idx].map_state;
-				attr.x = cache_list[idx].x;
-				attr.y = cache_list[idx].y;
-				attr.width = cache_list[idx].width;
-				attr.height = cache_list[idx].height;
-			} else {
-				attr.map_state = IsUnmapped;
-				attr.x = 0;
-				attr.y = 0;
-				attr.width = 0;
-				attr.height = 0;
-			}
-			
-		}
-		if (attr.map_state != IsViewable) {
-			continue;
-		}
-if (0) fprintf(stderr, "win: 0x%lx %d  idx=%d\n", win, i, idx);
-
-		x2 = attr.x;
-		y2 = attr.y;
-		w2 = attr.width;
-		h2 = attr.height;
-
-		r2 = sraRgnCreateRect(x2, y2, x2+w2, y2+h2);
-		sraRgnAnd(r2, r0);
-
-		tmp_reg[n] = r2;
-		tmp_stack[n++] = idx;
-	}
-	X_UNLOCK;
-
-	if (! n) {
-		r1 = NULL;
-		CLEAN_OUT
-		return 0;
-	}
-
-	for (i = 0; i < n; i++) {
-		int i2, cnt = 0;
-		idx = tmp_stack[i];
-		if (idx < 0 || cache_list[idx].bs_x < 0) {
-			continue;
-		}
-		r1 = tmp_reg[i];
-		if (r1 == NULL || sraRgnEmpty(r1)) {
-			continue;
-		}
-		if (cache_list[idx].su_time > 0.0) {
-			if (force) {
-if (ncdb) fprintf(stderr, "forcing synth: 0x%lx %d\n", cache_list[idx].win, idx);
-			} else {
-				continue;
-			}
-		}
-		if (ncache_xrootpmap) {
-			int dx, dy;
-
-			x0 = cache_list[idx].x;
-			y0 = cache_list[idx].y;
-			w0 = cache_list[idx].width;
-			h0 = cache_list[idx].height;
-
-			x1 = cache_list[idx].su_x;
-			y1 = cache_list[idx].su_y;
-			w1 = cache_list[idx].su_w;
-			h1 = cache_list[idx].su_h;
-
-			r2 = sraRgnCreateRgn(tmp_reg[i]);
-			dx = x1 - x0;
-			dy = y1 - y0;
-
-			sraRgnOffset(r2, dx, dy);
-
-			x2 = x0;
-			y2 = y0 + (ncache+1) * dpy_y;
-
-			dx = x1 - x2;
-			dy = y1 - y2;
-			cache_cr(r2, dx, dy, save_delay0, save_delay1, nbatch);
-			cnt++;
-
-			sraRgnDestroy(r2);
-		}
-
-		for (i2 = n - 1; i2 > i; i2--) {
-			r2 = sraRgnCreateRgn(tmp_reg[i2]);
-			if (sraRgnAnd(r2, r1)) {
-				int dx, dy;
-				int dx2, dy2;
-
-				idx2 = tmp_stack[i2];
-				/* XXX Y */
-				if (idx2 < 0 || cache_list[idx2].bs_x < 0 || cache_list[idx2].bs_time == 0.0) {
-					continue;
-				}
-
-				x0 = cache_list[idx].x;
-				y0 = cache_list[idx].y;
-				w0 = cache_list[idx].width;
-				h0 = cache_list[idx].height;
-
-				x1 = cache_list[idx].su_x;
-				y1 = cache_list[idx].su_y;
-				w1 = cache_list[idx].su_w;
-				h1 = cache_list[idx].su_h;
-
-				x2 = cache_list[idx2].x;
-				y2 = cache_list[idx2].y;
-				w2 = cache_list[idx2].width;
-				h2 = cache_list[idx2].height;
-
-				x3 = cache_list[idx2].bs_x;
-				y3 = cache_list[idx2].bs_y;
-				w3 = cache_list[idx2].bs_w;
-				h3 = cache_list[idx2].bs_h;
-
-				dx = x1 - x0;
-				dy = y1 - y0;
-				sraRgnOffset(r2, dx, dy);
-
-				dx2 = x3 - x2;
-				dy2 = y3 - y2;
-				dx = dx - dx2;
-				dy = dy - dy2;
-				cache_cr(r2, dx, dy, save_delay0, save_delay1, nbatch);
-				cnt++;
-			}
-			sraRgnDestroy(r2);
-		}
-		if (cnt) {
-			cache_list[idx].su_time = dnow();
-		}
-if (ncdb) fprintf(stderr, "  try_to_synth_su: 0x%lx %d  idx=%d cnt=%d\n", win, i, idx, cnt);
-	}
-
-	r1 = NULL;
-	CLEAN_OUT
-	return 1;
-}
-
-static double last_vis_unobs_time = 0.0;
-static double last_vis_obs_time = 0.0;
-
-static int saw_desktop_change = 0;
-
-void check_sched(int try_batch, int *did_sched) {
-	static double last_root = 0.0;
-	static double last_pixmap = 0.0;
-	double refresh = 60.0;
-	int i, k, valid;
-	Window win;
-	XWindowAttributes attr;
-	double now = dnow();
-
-	if (now > last_root + refresh) {
-
-if (ncdb) fprintf(stderr, "\n**** checking cache_list[%d]\n\n", cache_list_num);
-		block_stats();
-
-		for(k=0; k<cache_list_num; k++) {
-			valid = 0;
-			win = cache_list[k].win; 
-			X_LOCK;
-			if (win == None) {
-				;
-			} else if (cache_list[k].selectinput && cache_list[k].time > now - refresh) {
-				valid = 1;
-			} else if (valid_window(win, &attr, 1)) {
-				STORE(k, win, attr);
-				if (! cache_list[k].selectinput) {
-					xselectinput(win, win_ev, 0);
-					CLEAR(k);
-					cache_list[k].selectinput = 1;
-				}
-				valid = 1;
-			} else {
-if (ncdb) fprintf(stderr, "DELETE(%d) %dx%d+%d+%d\n", k, cache_list[k].width, cache_list[k].height, cache_list[k].x, cache_list[k].y);
-				DELETE(k);
-			}
-			X_UNLOCK;
-/* XXX Y */
-			if (valid) {
-				if (cache_list[k].create_cnt && cache_list[k].map_state != IsViewable && cache_list[k].map_cnt == 0) {
-					if (cache_list[k].bs_x >= 0) {
-if (ncdb) fprintf(stderr, "Created window never mapped: freeing(%d) 0x%lx\n", k, win);
-						free_rect(k);
-					}
-				}
-			}
-		}
-		last_root = dnow();
-	}
-
-	if (now > last_sched_bs + 0.30) {
-		static double last_sched_vis = 0.0;
-		int nr = 0, *bat = NULL;
-
-		if (try_batch) {
-			bat = &nr;
-		}
-		if (now < last_wireframe + 2.0) {
-			for (i=0; i < NSCHED; i++) {
-				sched_bs[i] = None;
-			}
-		}
-		if (now < last_get_wm_frame_time + 1.0) {
-			if (last_get_wm_frame != None) {
-				int idx = lookup_win_index(last_get_wm_frame);
-				if (idx >= 0) {
-					if (cache_list[idx].bs_x < 0) {
-						int x = cache_list[idx].x;
-						int y = cache_list[idx].y;
-						int w = cache_list[idx].width;
-						int h = cache_list[idx].height;
-						if (find_rect(idx, x, y, w, h)) {
-							SCHED(last_get_wm_frame, 1);
-						}
-					}
-				}
-			}
-		}
-		
-		for (i=0; i < NSCHED; i++) {
-			if (sched_bs[i] != None) {
-				int idx;
-				win = sched_bs[i];	
-				if (now < sched_tm[i] + 0.55) {
-					continue;
-				}
-				if (n_MN || n_UN || n_ST || n_DC) {
-					sched_tm[i] = now;
-					continue;
-				}
-				idx = lookup_win_index(win);
-				if (idx >= 0) {
-					int aw = cache_list[idx].width; 
-					int ah = cache_list[idx].height; 
-					if (cache_list[idx].map_state != IsViewable) {
-						;
-					} else if (cache_list[idx].vis_state != VisibilityUnobscured) {
-						;
-					} else if (aw * ah < 64 * 64) {
-						;
-					} else {
-if (ncdb) fprintf(stderr, "*SNAP BS_save: 0x%lx %d %d %d\n", win, aw, ah, cache_list[idx].map_state); 
-						valid = 0;
-						bs_save(idx, bat, &attr, 1, 0, &valid, 0);
-						if (valid) {
-							STORE(idx, win, attr);
-						} else {
-							DELETE(idx);
-						}
-					}
-				} else {
-if (ncdb) fprintf(stderr, "*SCHED LOOKUP FAIL: i=%d 0x%lx\n", i, win);
-				}
-			}
-			sched_bs[i] = None;
-		}
-		*did_sched = 1;
-
-		if (n_MN || n_UN || n_ST || n_DC) {
-			if (last_sched_vis < now) {
-				last_sched_vis += 1.0;
-			}
-		} else if (now > last_sched_vis + 3.0 && now > last_wireframe + 2.0) {
-			static double last_vis = 0.0;
-			int vis_now[32], top_now[32];
-			static int vis_prev[32], freq = 0;
-			int diff, nv = 32, vis_now_n = 0;
-			Window win;
-
-			freq++;
-
-			for (i=0; i < cache_list_num; i++) {
-				int ok = 0;
-				int top_only = 1;
-				int aw = cache_list[i].width; 
-				int ah = cache_list[i].height; 
-				int map_prev = cache_list[i].map_state;
-
-				win = cache_list[i].win;
-
-				if (saw_desktop_change) {
-					top_only = 0;
-				}
-
-				if (win == None) {
-					continue;
-				}
-				/* XXX Y resp */
-				if (saw_desktop_change || freq % 5 == 0) {
-					int vret = 0;
-					X_LOCK;
-					vret = valid_window(win, &attr, 1);
-					X_UNLOCK;
-					if (!vret) {
-						continue;
-					}
-					STORE(i, win, attr);
-				}
-				if (!cache_list[i].valid) {
-					continue;
-				}
-				if (cache_list[i].map_state != IsViewable) {
-					continue;
-				}
-				if (cache_list[i].vis_state == VisibilityFullyObscured) {
-					continue;
-				}
-				if (map_prev != IsViewable) {
-					/* we hope to catch it below in the normal event processing */
-					continue;
-				}
-				if (aw * ah < 64 * 64) {
-					continue;
-				}
-				if (top_only) {
-					if (cache_list[i].vis_state == VisibilityUnobscured) {
-						ok = 1;
-					} else if (!clipped(i)) {
-						ok = 1;
-					}
-				} else {
-					ok = 1;
-				}
-				if (ok) {
-					if (vis_now_n < nv) {
-						vis_now[vis_now_n] = i;
-						top_now[vis_now_n++] = top_only;
-					}
-				}
-			}
-			diff = 0;
-			for (k = 0; k < vis_now_n; k++) {
-				if (vis_now[k] != vis_prev[k]) {
-					diff = 1;
-				}
-			}
-			if (diff == 0) {
-				if (now > last_vis + 45.0) {
-					diff = 1;
-				}
-			}
-			if (diff) {
-if (ncdb && vis_now_n) fprintf(stderr, "*VIS  snapshot all %.4f\n", dnowx());
-				for (k = 0; k < vis_now_n; k++) {
-					i = vis_now[k];
-					win = cache_list[i].win;
-					valid = 0;
-if (ncdb) fprintf(stderr, "*VIS  BS_save: 0x%lx %d %d %d\n", win, cache_list[i].width, cache_list[i].height, cache_list[i].map_state); 
-					if (now < cache_list[i].vis_unobs_time + 0.75 && now < cache_list[i].vis_obs_time + 0.75) {
-						continue;
-					}
-					bs_save(i, bat, &attr, !top_now[k], 0, &valid, 1);
-					if (valid) {
-						STORE(i, win, attr);
-					} else {
-						DELETE(i);
-					}
-					vis_prev[k] = vis_now[k];
-				}
-				last_vis = dnow();
-			}
-			last_sched_vis = dnow();
-			if (! n_DC) {
-				saw_desktop_change = 0;
-			}
-			/* XXX Y */
-			try_to_synthesize_su(0, 0, bat);
-		}
-
-		if (nr) {
-			batch_push(nr, -1.0);
-		}
-		last_sched_bs = dnow();
-	}
-#if !NO_X11
-	if (dpy && atom_XROOTPMAP_ID == None && now > last_pixmap + 5.0) {
-		atom_XROOTPMAP_ID = XInternAtom(dpy, "_XROOTPMAP_ID", True);
-		last_pixmap = now;
-	}
-#endif
-	if (got_XROOTPMAP_ID > 0.0) {
-if (ncdb) fprintf(stderr, "got_XROOTPMAP_ID\n");
-		if (ncache_xrootpmap) {
-			set_ncache_xrootpmap();
-		}
-		got_XROOTPMAP_ID = 0.0;
-	}
-}
-
-int check_ncache(int reset, int mode) {
-	static int first = 1;
-	static int last_client_count = -1;
-	int i, k, n; 
-	int did_sched = 0;
-
-	Window win, win2;
-	XWindowAttributes attr;
-	int valid;
-	int try_batch = 1; /* XXX Y */
-	int use_batch = 0;
-	int nreg = 0, *nbatch;
-	int create_cnt;
-	int su_fix_cnt;
-	int pixels = 0, ttot;
-	int desktop_change = 0, n1, n2;
-	int desktop_change_old_wm = 0;
-	int missed_su_restore = 0;
-	int missed_bs_restore = 0;
-	sraRegionPtr r0, r;
-	sraRegionPtr missed_su_restore_rgn;
-	sraRegionPtr missed_bs_restore_rgn;
-	sraRegionPtr unmapped_rgn;
-
-	int nrects = 0;
-	int nsave, nxsel;
-	double now;
-
-	int skipwins_n = 0;
-	int skipwins_max = 256;
-	Window skipwins[256];
-
-	static char *dt_guess = NULL;
-	static double dt_last = 0.0;
-	int dt_gnome = 0, gnome_animation = 0;
-	int dt_kde = 0;
-
-	if (unixpw_in_progress) return -1;
-
-#ifdef MACOSX
-	if (! macosx_console) {
-		RAWFB_RET(-1)
-	}
-	if (! screen) {
-		return -1;
-	}
-#else
-	RAWFB_RET(-1)
-	if (! screen || ! dpy) {
-		return -1;
-	}
-#endif
-
-	now = dnow();
-
-#ifdef NO_NCACHE
-	ncache = 0;
-#endif
-
-	if (reset && (first || cache_list_len == 0)) {
-		return -1;
-	}
-	if (use_threads) {
-		try_batch = 0;
-	}
-
-	if (ncache0) {
-		if (reset) {
-			;
-		} else if (!client_count || !ncache || nofb) {
-			static double last_purge = 0.0;
-			double delay = client_count ? 0.5 : 2.0;
-			if (now > last_purge + delay) {
-				int c = 0;
-				XEvent ev;
-				X_LOCK;
-				while (xcheckmaskevent(dpy, all_ev, &ev)) {
-					c++;
-				}
-				X_UNLOCK;
-				last_purge = dnow();
-if (ncdb && c) fprintf(stderr, "check_ncache purged %d events\n", c); 
-			}
-			if (!client_count && last_client_count >= 0 &&
-			    client_count != last_client_count) {
-				/* this should use less RAM when no clients */
-				do_new_fb(1);
-			}
-			last_client_count = client_count;
-			return -1;
-		}
-	}
-	last_client_count = client_count;
-
-	if (ncache && ! ncache0) {
-		ncache0 = ncache;
-	}
-
-	if (! ncache || ! ncache0) {
-		return -1;
-	}
-	if (subwin) {
-		return -1;
-	}
-	if (nofb) {
-		return -1;
-	}
-	if (now < last_client + 4) {
-		return -1;
-	}
-	if (! all_clients_initialized()) {
-		/* play it safe */
-		return -1;
-	}
-
-
-
-	if (reset) {
-		rfbLog("check_ncache: resetting cache: %d/%d %d %d\n", cache_list_num, cache_list_len, ncache, first);
-		for (i=0; i < cache_list_num; i++) {
-			free_rect(i);
-		}
-		for (n = 1; n <= ncache; n++) {
-			if (rect_reg[n] != NULL) {
-				sraRgnDestroy(rect_reg[n]);
-				rect_reg[n] = NULL;
-			}
-		}
-		zero_fb(0, dpy_y, dpy_x, (ncache+1)*dpy_y);
-		mark_rect_as_modified(0, dpy_y, dpy_x, (ncache+1)*dpy_y, 0);
-
-		if (ncache_xrootpmap) {
-			set_ncache_xrootpmap();
-		}
-
-		snap_old();
-		return -1;
-	}
-
-	if (first) {
-		int dx = 10, dy = 24, ds = 0;
-		int Dx = dpy_x, Dy = dpy_y;
-		first = 0;
-		for (i=0; i < NRECENT; i++) {
-			recent[i] = None;
-		}
-		for (i=0; i < NSCHED; i++) {
-			sched_bs[i] = None;
-		}
-		rlast = 0;
-
-		X_LOCK;
-		/* event leak with client_count == 0 */
-		xselectinput_rootwin |= SubstructureNotifyMask;
-		XSelectInput_wr(dpy, rootwin, xselectinput_rootwin);
-		X_UNLOCK;
-
-		if (scaling) {
-			Dx = scaled_x;
-			Dy = scaled_y;
-		}
-		if (!rotating_same) {
-			int t = Dx;
-			Dx = Dy;
-			Dy = t;
-		}
-
-		for (i = 0; i < 3; i++) {
-			rfbDrawString(screen, &default8x16Font, dx, ds + Dy+1*dy,
-			    "This is the Pixel buffer cache region. Your VNC Viewer is not hiding it from you.",
-			    white_pixel());
-			rfbDrawString(screen, &default8x16Font, dx, ds + Dy+2*dy,
-			    "Try resizing your VNC Viewer so you don't see it!!",
-			    white_pixel());
-			rfbDrawString(screen, &default8x16Font, dx, ds + Dy+3*dy,
-			    "Pay no attention to the man behind the curtain...",
-			    white_pixel());
-			rfbDrawString(screen, &default8x16Font, dx, ds + Dy+4*dy,
-			    "To disable caching run the server with:  x11vnc -noncache ...",
-			    white_pixel());
-			rfbDrawString(screen, &default8x16Font, dx, ds + Dy+5*dy,
-			    "If there are painting errors press 3 Alt_L's (Left \"Alt\" key) in a row to repaint the screen.",
-			    white_pixel());
-			rfbDrawString(screen, &default8x16Font, dx, ds + Dy+6*dy,
-			    "More info:  http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching",
-			    white_pixel());
-
-			ds += 11 * dy;
-		}
-
-		snapshot_cache_list(0, 100.0);
-		for (i=0; i < cache_list_num; i++) {
-			CLEAR(i);
-		}
-		for (n = 1; n <= ncache; n++) {
-			rect_reg[n] = NULL;
-		}
-
-		if (ncache_xrootpmap) {
-			set_ncache_xrootpmap();
-		}
-
-		snap_old();
-	}
-
-	check_zero_rects();
-
-if (hack_val == 2) {
-	block_stats();
-	hack_val = 1;
-}
-#ifdef MACOSX
-	if (macosx_console) {
-		static double last_all_windows = 0.0;
-		if (! macosx_checkevent(NULL)) {
-			if (now > last_all_windows + 0.05) {
-				macosxCGS_get_all_windows();
-				last_all_windows = dnow();
-			}
-		}
-		/* XXX Y */
-		rootwin = -1;
-	}
-#endif
-
-	n = 0;
-	ttot = 0;
-
-	if (dt_guess == NULL || now > dt_last + 60) {
-		static char *dt_prev = NULL;
-		dt_prev = dt_guess;
-		dt_guess = strdup(guess_desktop());
-		if (ncache_xrootpmap && dt_prev && dt_guess) {
-			if (strcmp(dt_prev, dt_guess)) {
-				set_ncache_xrootpmap();
-			}
-		}
-		dt_last = now;
-		if (dt_prev) {
-			free(dt_prev);
-		}
-	}
-	if (dt_guess && !strcmp(dt_guess, "gnome")) {
-		dt_gnome = 1;
-	} else if (dt_guess && !strcmp(dt_guess, "kde")) {
-		dt_kde = 1;
-	}
-	if (dt_kde) {
-		kde_no_animate(0);
-	}
-
-	ev_store(None, EV_RESET);
-
-	X_LOCK;
-	for (k = 1; k <= 3; k++) {
-		int j, retry = 0;
-
-		if (retry) {}
-
-		nsave = n;
-
-		if (k > 1 && ncdb) fprintf(stderr, "read_events-%d\n", k);
-		read_events(&n);
-
-#if 0
-		if (dt_gnome && (n_MN || n_UN)) {
-			retry = 1;
-		} else if (ncache_old_wm && n_ON_po >= 2) {
-			retry = 1;
-		} else if (n > nsave) {
-			/* XXX Y */
-			retry = 1;
-		}
-
-		if (retry) {
-			int n0 = n;
-			usleep(25 * 1000);
-			XFlush_wr(dpy);
-			read_events(&n);
-			if (ncdb) fprintf(stderr, "read_events retry: %d -> %d\n", n0, n);
-		}
-#endif
-
-		if (n > nsave) {
-			int n0 = n;
-
-			for (j=0; j<4; j++) {
-				if (j < 2) {
-					usleep(30 * 1000);
-				} else {
-					usleep(10 * 1000);
-				}
-				XFlush_wr(dpy);
-				read_events(&n);
-				if (ncdb) fprintf(stderr, "read_events retry: %d -> %d\n", n0, n);
-				if (n == n0) {
-					break;
-				}
-				n0 = n;
-			}
-		}
-			
-		nxsel = 0;
-
-		/* handle creates and reparenting: */
-		for (n1 = nsave; n1 < n; n1++) {
-			Window win2;
-			int idx;
-			XEvent ev = Ev[n1];
-			win = Ev_win[n1];
-			if (ev.type == CreateNotify) {
-				win2 = ev.xcreatewindow.window;
-				if (ev_lookup(win2, EV_REPARENT) || ev_lookup(win2, EV_DESTROY)) {
-					if (skipwins_n < skipwins_max) {
-if (ncdb) fprintf(stderr, "SKIPWINS: CreateNotify: 0x%lx %d\n", win2, n1);
-						skipwins[skipwins_n++] = win2;
-					}
-				} else {
-					idx = lookup_win_index(win);
-					if (idx < 0) {
-						idx = lookup_free_index();
-						if (idx < 0) {
-							continue;
-						}
-						CLEAR(idx);
-					}
-if (ncdb) fprintf(stderr, "PRELOOP:  CreateNotify: 0x%lx %d valid_window\n", win2, n1);
-					if (valid_window(win2, &attr, 1)) {
-						STORE(idx, win2, attr);
-						CLEAR(idx);
-						cache_list[idx].selectinput = 1;
-						cache_list[idx].create_cnt = 1;
-if (ncdb) fprintf(stderr, "PRELOOP:  CreateNotify: 0x%lx %d xselectinput\n", win2, n1);
-						xselectinput(win2, win_ev, 1);
-						nxsel++;
-					} else {
-						DELETE(idx);
-					}
-					nxsel++;
-				}
-			} else if (ev.type == ReparentNotify) {
-				if (ev.xreparent.parent != rootwin) {
-					win2 = ev.xreparent.window;
-					if (win2 != rootwin) {
-						idx = lookup_win_index(win2);
-if (ncdb) fprintf(stderr, "PRELOOP:  RepartNotify: 0x%lx %d idx=%d\n", win2, n1, idx);
-						if (idx >= 0) {
-							DELETE(idx);
-						}
-						if (! ev_lookup(win2, EV_CREATE)) {
-							xselectinput(win2, 0, 1);
-							nxsel++;
-						}
-					}
-				}
-			}
-		}
-		if (nxsel == 0) {
-			break;
-		}
-	}
-
-	X_UNLOCK;
-
-	if (got_NET_CURRENT_DESKTOP > 0.0) {
-		if (dnow() < got_NET_CURRENT_DESKTOP + 0.25) {
-			if (ncdb) fprintf(stderr, "***got_NET_CURRENT_DESKTOP n=%d\n", n);
-			desktop_change = 1;
-			n_DC++;
-		} else {
-			if (ncdb) fprintf(stderr, "***got_NET_CURRENT_DESKTOP n=%d STALE\n", n);
-		}
-		got_NET_CURRENT_DESKTOP = 0.0;
-	}
-
-	if (n == 0) {
-		check_sched(try_batch, &did_sched);
-		return 0;
-	}
-if (ncdb) fprintf(stderr, "\n"); if (ncdb) rfbLog("IN  check_ncache() %d events.  %.4f\n", n, now - x11vnc_start);
-
-	if (try_batch) {
-		use_batch = 1;
-	}
-
-	if (rotating) {
-		use_batch = 0;
-	}
-	if (cursor_noshape_updates_clients(screen)) {
-		use_batch = 0;
-	}
-
-	if (! use_batch) {
-		nbatch = NULL;
-	} else {
-		nreg = 0;
-		nbatch = &nreg;
-	}
-
-	/* XXX Y */
-	for (n1 = 0; n1 < n; n1++) {
-		Window twin = Ev_map[n1];
-		if (twin == None || twin == rootwin) {
-			continue;
-		}
-		for (n2 = 0; n2 < n; n2++) {
-			if (Ev_unmap[n2] == twin) {
-				if (skipwins_n < skipwins_max) {
-if (ncdb) fprintf(stderr, "SKIPWINS: Ev_unmap/map: 0x%lx %d\n", twin, n2);
-					skipwins[skipwins_n++] = twin;
-					break;
-				}
-			}
-		}
-	}
-
-	if (!desktop_change) {
-		if (skipwins_n) {
-			if (n_MN + n_UN >= 2 + 2*skipwins_n) {
-				desktop_change = 1;
-				n_DC++;
-			}
-		} else {
-			if (n_MN + n_UN >= 3) {
-				desktop_change = 1;
-				n_DC++;
-			}
-		}
-	}
-	if (ncache_old_wm) {
-		int shifts = 0;
-		for (i=0; i < n; i++) {
-			XEvent ev;
-			int type, idx = -1;
-			int ik = Ev_order[i];
-			int x_new, y_new, w_new, h_new;
-			int x_old, y_old, w_old, h_old;
-			int old_wm = 0;
-
-			if (Ev_done[ik]) continue;
-			win = Ev_win[ik];
-
-			ev = Ev[ik];
-			type = ev.type;
-			if (type != ConfigureNotify) {
-				continue;
-			}
-			if (ev_lookup(win, EV_MAP)) {
-				continue;
-			} else if (ev_lookup(win, EV_UNMAP)) {
-				continue;
-			} else if (ev_lookup(win, EV_DESTROY)) {
-				continue;
-			}
-
-			idx = lookup_win_index(win);
-			if (idx < 0) {
-				continue;
-			}
-			x_new = ev.xconfigure.x; 
-			y_new = ev.xconfigure.y; 
-			w_new = ev.xconfigure.width; 
-			h_new = ev.xconfigure.height; 
-
-			x_old = cache_list[idx].x;
-			y_old = cache_list[idx].y;
-			w_old = cache_list[idx].width;
-			h_old = cache_list[idx].height;
-
-			if (w_new == w_old && h_new == h_old) {
-				if (nabs(x_new - x_old) >= dpy_x || nabs(y_new - y_old) >= dpy_y) {
-					sraRegionPtr r_old, r_new, r0;
-					r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-					r_old = sraRgnCreateRect(x_old, y_old, x_old+w_old, y_old+h_old);
-					sraRgnAnd(r_old, r0);
-					r_new = sraRgnCreateRect(x_new, y_new, x_new+w_new, y_new+h_new);
-					sraRgnAnd(r_new, r0);
-					if (cache_list[idx].map_state != IsViewable) {
-						ev_store(win, EV_OLD_WM_NOTMAPPED);
-					} else if (sraRgnEmpty(r_old) && !sraRgnEmpty(r_new)) {
-						old_wm = 1;
-						ev_store(win, EV_OLD_WM_MAP);
-						Ev_map[i] = win;
-					} else if (!sraRgnEmpty(r_old) && sraRgnEmpty(r_new)) {
-						ev_store(win, EV_OLD_WM_UNMAP);
-						old_wm = -1;
-						Ev_unmap[i] = win;
-					} else {
-						ev_store(win, EV_OLD_WM_OFF);
-					}
-					sraRgnDestroy(r_old);
-					sraRgnDestroy(r_new);
-					sraRgnDestroy(r0);
-					shifts++;
-if (ncdb) fprintf(stderr, "old_wm[%d]  +%04d+%04d  +%04d+%04d  old_wm: %d\n", i, x_old, y_old, x_new, y_new, old_wm);
-				}
-			}
-		}
-		if (shifts >= 3) {
-if (ncdb) fprintf(stderr, "DESKTOP_CHANGE_OLD_WM: %d\n", shifts);
-			desktop_change = 1;
-			desktop_change_old_wm = 1;
-		}
-	}
-
-#define SKIPUMS \
-	ok = 1; \
-	if (twin == None || twin == rootwin) { \
-		continue; \
-	} \
-	for (ns = 0; ns < skipwins_n; ns++) { \
-		if (skipwins[ns] == twin) { \
-			ok = 0; \
-			break; \
-		} \
-	}
-
-	if (desktop_change) {
-		Window twin;
-		int ok, s, k, add, cnt, ns;
-
-		cnt = 0;
-		add = 0;
-		for (i=0; i < n; i++) {
-			twin = Ev_unmap[i];
-			SKIPUMS
-			if (ok) {
-if (ncdb) fprintf(stderr, "U Ev_tmp[%d] = %d\n", cnt, i);
-				Ev_tmp[cnt++] = i;
-			}
-		}
-		for (i=0; i < n; i++) {
-			twin = Ev_map[i];
-			SKIPUMS
-			if (ok) {
-if (ncdb) fprintf(stderr, "M Ev_tmp[%d] = %d\n", cnt, i);
-				Ev_tmp[cnt++] = i;
-			}
-		}
-		for (k = 0; k < cnt; k++) {
-			Ev_tmp2[k] = -1;
-		}
-		/* unmap from top to bottom */
-		for (s = old_stack_n - 1; s >= 0; s--) {
-			twin = old_stack[s];	
-			if (twin == None || twin == rootwin) {
-				continue;
-			}
-			for (k = 0; k < cnt; k++) {
-				i = Ev_tmp[k];
-				if (twin == Ev_unmap[i]) {
-if (ncdb) fprintf(stderr, "U Ev_tmp2[%d] = %d\n", add, i);
-					Ev_tmp2[add++] = i;
-					break;
-				}
-			}
-		}
-		/* map from bottom to top */
-		for (s = 0; s < old_stack_n; s++) {
-			twin = old_stack[s];	
-			if (twin == None || twin == rootwin) {
-				continue;
-			}
-			for (k = 0; k < cnt; k++) {
-				i = Ev_tmp[k];
-				if (twin == Ev_map[i]) {
-if (ncdb) fprintf(stderr, "M Ev_tmp2[%d] = %d\n", add, i);
-					Ev_tmp2[add++] = i;
-					break;
-				}
-			}
-		}
-		k = 0;
-		for (i=0; i < n; i++) {
-			Window wu, wm;
-			int j;
-			int oku = 0, okm = 0;
-			wu = Ev_unmap[i];
-			wm = Ev_map[i];
-			ok = 0;
-			if (wu != None && wu != rootwin) oku = 1;
-			if (wm != None && wm != rootwin) okm = 1;
-			if (!oku && !okm) {
-				continue;
-			}
-			if (oku) {
-				twin = wu;
-				SKIPUMS
-				if (!ok) {
-					oku = 0;
-				}
-			}
-			if (okm) {
-				twin = wm;
-				SKIPUMS
-				if (!ok) {
-					okm = 0;
-				}
-			}
-			if (!oku && !okm) {
-				continue;
-			}
-			j = Ev_tmp2[k++];
-			if (j >= 0) {
-if (ncdb) fprintf(stderr, "UM Ev_order[%d] = %d oku=%d okm=%d\n", i, j, oku, okm);
-				Ev_order[i] = j;
-			}
-		}
-	}
-
-#if 0
-	if (desktop_change) {
-		Window twin;
-		int ok, s, k, add, cnt, ns;
-
-		cnt = 0;
-		add = 0;
-		for (i=0; i < n; i++) {
-			twin = Ev_unmap[i];
-			SKIPUMS
-			if (ok) {
-				Ev_tmp[cnt++] = i;
-			}
-		}
-		for (k = 0; k < cnt; k++) {
-			Ev_tmp2[k] = -1;
-		}
-		/* unmap from top to bottom */
-		for (s = old_stack_n - 1; s >= 0; s--) {
-			twin = old_stack[s];	
-			for (k = 0; k < cnt; k++) {
-				i = Ev_tmp[k];
-				if (twin == Ev_unmap[i]) {
-					Ev_tmp2[add++] = i;
-					break;
-				}
-			}
-		}
-		k = 0;
-		for (i=0; i < n; i++) {
-			int j;
-			twin = Ev_unmap[i];
-			SKIPUMS
-			if (ok) {
-				j = Ev_tmp2[k++];
-				if (j >= 0) {
-					Ev_order[i] = j;
-				}
-			}
-		}
-
-		cnt = 0;
-		add = 0;
-		for (i=0; i < n; i++) {
-			twin = Ev_map[i];
-			SKIPUMS
-			if (ok) {
-				Ev_tmp[cnt++] = i;
-			}
-		}
-		for (k = 0; k < cnt; k++) {
-			Ev_tmp2[k] = -1;
-		}
-		/* map from bottom to top */
-		for (s = 0; s < old_stack_n; s++) {
-			twin = old_stack[s];	
-			for (k = 0; k < cnt; k++) {
-				i = Ev_tmp[k];
-				if (twin == Ev_map[i]) {
-					Ev_tmp2[add++] = i;
-					break;
-				}
-			}
-		}
-		k = 0;
-		for (i=0; i < n; i++) {
-			int j;
-			twin = Ev_map[i];
-			SKIPUMS
-			if (ok) {
-				j = Ev_tmp2[k++];
-				if (j >= 0) {
-					Ev_order[i] = j;
-				}
-			}
-		}
-	}
-#endif
-
-	if (!desktop_change && (n_VN_p && !n_UN && (n_MN || n_ON_st))) {
-		if (now < last_vis_unobs_time + 0.75 || now < last_vis_obs_time + 0.75) {
-			;
-		} else if (n_MN <= 2 && n_ON_st <= 1) {
-			for (i=0; i < n; i++) {
-				XEvent ev;
-				int type, idx = -1, state, valid;
-				int ik = Ev_order[i];
-
-				if (Ev_done[ik]) continue;
-				win = Ev_win[ik];
-
-				ev = Ev[ik];
-				type = ev.type;
-				if (type != VisibilityNotify) {
-					continue;
-				}
-
-				state = ev.xvisibility.state;
-				if (state == VisibilityUnobscured) {
-					continue;
-				}
-				if (ev_lookup(win, EV_MAP)) {
-					continue;
-				} else if (ev_lookup(win, EV_UNMAP)) {
-					continue;
-				} else if (ev_lookup(win, EV_DESTROY)) {
-					continue;
-				}
-				idx = lookup_win_index(win);
-
-				if (idx < 0) {
-					continue;
-				}
-				if (cache_list[idx].vis_state == VisibilityFullyObscured) {
-					continue;
-				}
-				if (now < cache_list[idx].vis_unobs_time + 3.00 || now < cache_list[idx].vis_obs_time + 3.00) {
-					continue;
-				}
-
-if (ncdb) fprintf(stderr, "----%02d: VisibilityNotify 0x%lx  %3d  (*PRELOOP*) state: %s U/P %d/%d\n", ik, win, idx, VState(state), n_VN_u, n_VN_p);
-				valid = 0;
-				bs_save(idx, nbatch, &attr, 1, 0, &valid, 1);
-				if (valid) {
-					STORE(idx, win, attr);
-				} else {
-					DELETE(idx);
-				}
-
-				cache_list[idx].vis_state = state;
-				cache_list[idx].vis_obs_time = last_vis_obs_time = dnow();
-				Ev_done[ik] = 1;
-			}
-		}
-	}
-	if (desktop_change) {
-		if (ncache_dt_change) {
-			if (ncdb) fprintf(stderr, "GUESSED DESKTOP CHANGE.\n");
-			saw_desktop_change = 1;
-		} else {
-			if (ncdb) fprintf(stderr, "GUESSED DESKTOP CHANGE. Skipping.\n");
-			desktop_change = 0;
-		}
-	}
-
-
-	create_cnt = 0;
-	missed_su_restore = 0;
-	missed_bs_restore = 0;
-	missed_su_restore_rgn = sraRgnCreate();
-	missed_bs_restore_rgn = sraRgnCreate();
-	r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-	unmapped_rgn = sraRgnCreate();
-	su_fix_cnt = 0;
-
-for (k = 0; k < skipwins_n; k++) {
-	if (ncdb) fprintf(stderr, "skipwins[%d] 0x%lx\n", k, skipwins[k]);
-}
-
-	X_LOCK;
-	for (i=0; i < n; i++) {
-		XEvent ev;
-		int ns, skip = 0, type, idx = -1;
-		int ik = Ev_order[i];
-
-		if (Ev_done[ik]) continue;
-		win = Ev_win[ik];
-
-		ev = Ev[ik];
-		type = ev.type;
-		Ev_done[ik] = 1;
-
-		win2 = win;
-		if (win == rootwin) {
-			if (type == CreateNotify) {
-				win2 = ev.xcreatewindow.window;
-			} else if (type == ReparentNotify) {
-				win2 = ev.xreparent.window;
-			}
-		}
-		for (ns = 0; ns < skipwins_n; ns++) {
-			if (win2 == skipwins[ns]) {
-				skip = 1;
-				break;
-			}
-		}
-		if (skip) {
-if (ncdb) fprintf(stderr, "skip%02d: ** SpecialSkip   0x%lx/0x%lx type: %s\n", ik, win, win2, Etype(type));
-			continue;
-		}
-		
-		if (win == rootwin) {
-			if (type == CreateNotify) {
-				int x=0, y=0, w=0, h=0;
-				valid = 0;
-				win2 = ev.xcreatewindow.window;
-				idx = lookup_win_index(win2);
-				if (idx < 0) {
-					continue;
-				}
-				if (cache_list[idx].valid) {
-					valid = 1;
-					x=cache_list[idx].x;
-					y=cache_list[idx].y;
-					w=cache_list[idx].width;
-					h=cache_list[idx].height;
-					if (w*h > 64 * 64 && ev_lookup(win2, EV_MAP)) {
-						X_UNLOCK;
-						valid = 1;
-						su_save(idx, nbatch, &attr, 0, &valid, 1);
-						STORE(idx, win2, attr);
-
-						X_LOCK;
-
-						if (! desktop_change) {
-							SCHED(win2, 1) 
-						}
-						create_cnt++;
-					}
-				}
-if (ncdb) fprintf(stderr, "root%02d: ** CreateNotify  0x%lx  %3d  -- %dx%d+%d+%d valid=%d\n", ik, win2, idx, w, h, x, y, valid);
-
-			} else if (type == ReparentNotify) {
-				if (ev.xreparent.parent != rootwin) {
-					win2 = ev.xreparent.window;
-					idx = lookup_win_index(win2);
-if (ncdb) fprintf(stderr, "root%02d: ReparentNotifyRM 0x%lx  %3d\n", ik, win2, idx);
-				}
-			} else {
-if (ncdb) fprintf(stderr, "root%02d: ** IgnoringRoot  0x%lx type: %s\n", ik, win, Etype(type));
-			}
-		} else {
-			if (type == ConfigureNotify) {
-				int x_new, y_new, w_new, h_new;
-				int x_old, y_old, w_old, h_old;
-				int stack_change, old_wm = 0;
-				Window oabove = None;
-
-				idx = lookup_win_index(win);
-
-				if (idx >= 0) {
-					oabove = cache_list[idx].above;
-				}
-
-if (ncdb) fprintf(stderr, "----%02d: ConfigureNotify  0x%lx  %3d  -- above: 0x%lx -> 0x%lx  %dx%d+%d+%d\n", ik, win, idx,
-    oabove, ev.xconfigure.above, ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y);
-
-				if (idx < 0) {
-					continue;
-				}
-
-				x_new = ev.xconfigure.x; 
-				y_new = ev.xconfigure.y; 
-				w_new = ev.xconfigure.width; 
-				h_new = ev.xconfigure.height; 
-
-				x_old = cache_list[idx].x;
-				y_old = cache_list[idx].y;
-				w_old = cache_list[idx].width;
-				h_old = cache_list[idx].height;
-
-				if (desktop_change_old_wm) {
-					if (ev_lookup(win, EV_OLD_WM_MAP)) {
-						if (Ev_map[ik] == win) {
-							old_wm = 1;
-						} else {
-							old_wm = 2;
-						}
-					} else if (ev_lookup(win, EV_OLD_WM_UNMAP)) {
-						if (Ev_unmap[ik] == win) {
-							old_wm = -1;
-						} else {
-							old_wm = 2;
-						}
-					} else if (ev_lookup(win, EV_OLD_WM_OFF)) {
-						old_wm = 2;
-					} else if (ev_lookup(win, EV_OLD_WM_NOTMAPPED)) {
-						old_wm = 3;
-					}
-				}
-
-				if (!old_wm)  {
-					if (x_old != x_new || y_old != y_new) {
-						/* invalidate su */
-						cache_list[idx].su_time = 0.0;
-if (ncdb) fprintf(stderr, "          INVALIDATE su: 0x%lx xy: +%d+%d  +%d+%d \n", win, x_old, y_old, x_new, y_new);
-					}
-					if (w_old != w_new || h_old != h_new) {
-						/* invalidate bs */
-						cache_list[idx].bs_time = 0.0;
-if (ncdb) fprintf(stderr, "          INVALIDATE bs: 0x%lx wh:  %dx%d   %dx%d \n", win, w_old, h_old, w_new, h_new);
-					}
-				} else {
-					int valid;
-					X_UNLOCK;
-					if (old_wm == 1) {
-						/* XXX Y */
-if (ncdb) fprintf(stderr, "          OLD_WM_MAP:    0x%lx wh:  %dx%d+%d+%d   %dx%d+%d+%d \n", win, w_old, h_old, x_old, y_old, w_new, h_new, x_new, y_new);
-						valid = 0;
-						bs_restore(idx, nbatch, NULL, &attr, 0, 0, &valid, 1);
-
-					} else if (old_wm == -1) {
-if (ncdb) fprintf(stderr, "          OLD_WM_UNMAP:  0x%lx wh:  %dx%d+%d+%d   %dx%d+%d+%d \n", win, w_old, h_old, x_old, y_old, w_new, h_new, x_new, y_new);
-						valid = 1;
-						su_restore(idx, nbatch, NULL, &attr, 1, 0, &valid, 1);
-					} else {
-if (ncdb) fprintf(stderr, "          OLD_WM_OFF::   0x%lx wh:  %dx%d+%d+%d   %dx%d+%d+%d  old_wm=%d\n", win, w_old, h_old, x_old, y_old, w_new, h_new, x_new, y_new, old_wm);
-					}
-					X_LOCK;
-				}
-
-				stack_change = 0;
-				if (old_wm) {
-					;
-				} else if (cache_list[idx].above != ev.xconfigure.above) {
-					stack_change = 1;
-				} else if (x_new == x_old && y_new == y_old && w_new == w_old && h_new == h_old) {
-					stack_change = 1;
-				}
-				if (stack_change) {
-					int i2, ok = 1;
-					for (i2=0; i2 < n; i2++)  {
-						if (Ev_map[i2] == win) {
-							ok = 0;
-							break;
-						}
-					}
-					if (ok) {
-						if (n_MN == 0 && n_UN == 0) {
-							if (su_fix_cnt > 0) {
-								ok = 0;
-if (ncdb) fprintf(stderr, "          CONF_IGNORE: Too many stacking changes: 0x%lx\n", win);
-							}
-						}
-						
-					}
-					if (ok) {
-						if (ev_lookup(ev.xconfigure.above, EV_UNMAP)) {
-							if (ncdb) fprintf(stderr, "        skip try_to_fix_su for GNOME deiconify #1\n");
-							if (dt_gnome) {
-								gnome_animation = 1;
-							}
-							ok = 0;
-						}
-					}
-					if (ok && dt_gnome) {
-						if (valid_window(ev.xconfigure.above, &attr, 1)) {
-							if (attr.map_state != IsViewable) {
-								if (ncdb) fprintf(stderr, "        skip try_to_fix_su for GNOME deiconify #2\n");
-								gnome_animation = 1;
-								ok = 0;
-							}
-						}
-					}
-					if (ok) {
-						int rc = try_to_fix_su(win, idx, ev.xconfigure.above, nbatch, NULL);	
-						if (rc == 0 && su_fix_cnt == 0 && n_MN == 0 && n_UN == 0) {
-							X_UNLOCK;
-							try_to_synthesize_su(1, 1, nbatch);
-							X_LOCK;
-						}
-						n_ST++;
-						su_fix_cnt++;
-					}
-				}
-
-				cache_list[idx].x = x_new;
-				cache_list[idx].y = y_new;
-				cache_list[idx].width = w_new;
-				cache_list[idx].height = h_new;
-
-				cache_list[idx].above = ev.xconfigure.above;
-				cache_list[idx].time = dnow();
-
-			} else if (type == VisibilityNotify) {
-				int state = ev.xvisibility.state;
-				idx = lookup_win_index(win);
-if (ncdb) fprintf(stderr, "----%02d: VisibilityNotify 0x%lx  %3d  state: %s U/P %d/%d\n", ik, win, idx, VState(state), n_VN_u, n_VN_p);
-
-				if (idx < 0) {
-					continue;
-				}
-				if (desktop_change) {
-					;
-				} else if (macosx_console && n_VN_p == 0) {
-					;	/* XXXX not working well yet with UnmapNotify ... */
-				} else if (state == VisibilityUnobscured) {
-					int ok = 1;
-					if (ncache <= 2) {
-						ok = 0;
-					} else if (ev_lookup(win, EV_MAP)) {
-						ok = 0;
-					} else if (ev_lookup(win, EV_UNMAP)) {
-						ok = 0;
-					} else if (ev_lookup(win, EV_DESTROY)) {
-						ok = 0;
-					} else if (gnome_animation) {
-						ok = 0;
-					} else {
-						/* this is for gnome iconify */
-						int i2;
-						for (i2=i+1; i2 < n; i2++) {
-							int idx2, ik2 = Ev_order[i2];
-							sraRegionPtr ro1, ro2;
-							Window win2 = Ev_unmap[ik2];
-
-							if (win2 == None) {
-								continue;
-							}
-							idx2 = lookup_win_index(win2);
-							if (idx2 < 0) {
-								continue;
-							}
-
-							ro1 = idx_create_rgn(r0, idx);
-							ro2 = idx_create_rgn(r0, idx2);
-
-							if (sraRgnAnd(ro1, ro2)) {
-								if (ncdb) fprintf(stderr, "        skip VisibilityUnobscured for GNOME iconify.\n");
-								ok = 0;
-							}
-							sraRgnDestroy(ro1);
-							sraRgnDestroy(ro2);
-							if (! ok) {
-								break;
-							}
-						}
-					}
-					if (ok) {
-						int x2, y2, w2, h2;
-						sraRegionPtr rmask = NULL;
-						valid = 0;
-						if (dnow() < cache_list[idx].vis_unobs_time + 3.00 && !sraRgnEmpty(unmapped_rgn)) {
-							x2 = cache_list[idx].x;
-							y2 = cache_list[idx].y;
-							w2 = cache_list[idx].width;
-							h2 = cache_list[idx].height;
-							rmask = sraRgnCreateRect(x2, y2, x2+w2, y2+h2);
-							sraRgnAnd(rmask, unmapped_rgn);
-							if (sraRgnEmpty(rmask)) {
-								sraRgnDestroy(rmask);
-								rmask = NULL;
-							}
-						}
-						if (ev_lookup(win, EV_CONFIGURE_SIZE)) {
-							valid = valid_window(win, &attr, 1);
-						} else {
-							X_UNLOCK;
-							bs_restore(idx, nbatch, rmask, &attr, 0, 1, &valid, 1);
-							X_LOCK;
-						}
-						if (rmask != NULL) {
-							sraRgnDestroy(rmask);
-						}
-						if (valid) {
-							STORE(idx, win, attr);
-
-							cache_list[idx].time = dnow();
-							cache_list[idx].vis_cnt++;
-							Ev_map[ik] = win;
-							Ev_rects[nrects].x1 = cache_list[idx].x;
-							Ev_rects[nrects].y1 = cache_list[idx].y;
-							Ev_rects[nrects].x2 = cache_list[idx].width;
-							Ev_rects[nrects].y2 = cache_list[idx].height;
-							nrects++;
-							SCHED(win, 1) 
-						} else {
-							DELETE(idx);
-						}
-					}
-				}
-				if (state == VisibilityUnobscured) {
-					cache_list[idx].vis_unobs_time = last_vis_unobs_time = dnow();
-				} else if (cache_list[idx].vis_state == VisibilityUnobscured) {
-					cache_list[idx].vis_obs_time = last_vis_obs_time = dnow();
-				}
-				cache_list[idx].vis_state = state;
-
-			} else if (type == MapNotify) {
-				idx = lookup_win_index(win);
-if (ncdb) fprintf(stderr, "----%02d: MapNotify        0x%lx  %3d\n", ik, win, idx);
-
-				if (idx < 0) {
-					continue;
-				}
-
-#if 0
-/*
-				if (cache_list[idx].map_state == IsUnmapped || desktop_change || macosx_console)
- */
-#endif
-				if (1) {
-					X_UNLOCK;
-					if (desktop_change) {
-						/* XXX Y */
-						int save = 1;
-						sraRegionPtr r;
-						if (cache_list[idx].su_time != 0.0) {
-							save = 0;
-						} else if (missed_su_restore) {
-							r = idx_create_rgn(r0, idx);
-							if (sraRgnAnd(r, missed_su_restore_rgn)) {
-								save = 0;
-							}
-							sraRgnDestroy(r);
-						}
-						if (missed_bs_restore) {
-							r = idx_create_rgn(r0, idx);
-							if (sraRgnAnd(r, missed_bs_restore_rgn)) {
-								save = 0;
-							}
-							sraRgnDestroy(r);
-						}
-						if (save) {
-							valid = 0;
-							su_save(idx, nbatch, &attr, 1, &valid, 1);
-							if (valid) {
-								STORE(idx, win, attr);
-							}
-						}
-					} else {
-						valid = 0;
-						su_save(idx, nbatch, &attr, 0, &valid, 1);
-						if (valid) {
-							STORE(idx, win, attr);
-						}
-					}
-					valid = 0;
-					if (ev_lookup(win, EV_CONFIGURE_SIZE)) {
-						X_LOCK;
-						valid = valid_window(win, &attr, 1);
-						X_UNLOCK;
-						idx_add_rgn(missed_bs_restore_rgn, r0, idx);
-						missed_bs_restore++;
-					} else if (bs_restore(idx, nbatch, NULL, &attr, 0, 0, &valid, 1)) { /* XXX clip? */
-						;
-					} else {
-						idx_add_rgn(missed_bs_restore_rgn, r0, idx);
-						missed_bs_restore++;
-					}
-					if (valid) {
-						STORE(idx, win, attr);
-					}
-
-					if (macosx_console) {
-#ifdef MACOSX
-						macosxCGS_follow_animation_win(win, -1, 1);
-						if (valid_window(win, &attr, 1)) {
-							STORE(idx, win, attr);
-							SCHED(win, 1);
-						}
-						/* XXX Y */
-						if (cache_list[idx].vis_state == -1)  {
-							cache_list[idx].vis_state = VisibilityUnobscured;
-						}
-#endif
-					}
-					X_LOCK;
-					pixels += cache_list[idx].width * cache_list[idx].height;
-					cache_list[idx].time = dnow();
-					cache_list[idx].map_cnt++;
-					Ev_map[ik] = win;
-					Ev_rects[nrects].x1 = cache_list[idx].x;
-					Ev_rects[nrects].y1 = cache_list[idx].y;
-					Ev_rects[nrects].x2 = cache_list[idx].width;
-					Ev_rects[nrects].y2 = cache_list[idx].height;
-					nrects++;
-
-					if (! valid) {
-						DELETE(idx);
-					}
-				}
-				cache_list[idx].map_state = IsViewable;
-
-			} else if (type == UnmapNotify) {
-				int x2, y2, w2, h2;
-				idx = lookup_win_index(win);
-if (ncdb) fprintf(stderr, "----%02d: UnmapNotify      0x%lx  %3d\n", ik, win, idx);
-
-				if (idx < 0) {
-					continue;
-				}
-				if (macosx_console) {
-					if (mode == 2) {
-						cache_list[idx].map_state = IsViewable;
-					}
-				}
-
-#if 0
-/*
-				if (cache_list[idx].map_state == IsViewable || desktop_change || macosx_console)
- */
-#endif
-				if (1) {
-					X_UNLOCK;
-					if (desktop_change) {
-						int save = 1;
-						sraRegionPtr r;
-						if (cache_list[idx].bs_time > 0.0) {
-							save = 0;
-						} else if (missed_su_restore) {
-							r = idx_create_rgn(r0, idx);
-							if (sraRgnAnd(r, missed_su_restore_rgn)) {
-								save = 0;
-							}
-							sraRgnDestroy(r);
-						}
-						if (missed_bs_restore) {
-							r = idx_create_rgn(r0, idx);
-							if (sraRgnAnd(r, missed_bs_restore_rgn)) {
-								save = 0;
-							}
-							sraRgnDestroy(r);
-						}
-						if (save) {
-							valid = 0;
-							bs_save(idx, nbatch, &attr, 1, 0, &valid, 1);
-						}
-					} else {
-						valid = 0;
-						bs_save(idx, nbatch, &attr, 1, 0, &valid, 1);
-					}
-					valid = 0;
-					if (su_restore(idx, nbatch, NULL, &attr, 1, 0, &valid, 1)) {
-						try_to_fix_su(win, idx, None, nbatch, "unmapped");	
-						if (valid) {
-							STORE(idx, win, attr);
-						} else {
-							DELETE(idx);
-						}
-					} else {
-						idx_add_rgn(missed_su_restore_rgn, r0, idx);
-						missed_su_restore++;
-					}
-					X_LOCK;
-
-					pixels += cache_list[idx].width * cache_list[idx].height;
-					cache_list[idx].time = dnow();
-					cache_list[idx].unmap_cnt++;
-					Ev_unmap[ik] = win;
-					Ev_rects[nrects].x1 = cache_list[idx].x;
-					Ev_rects[nrects].y1 = cache_list[idx].y;
-					Ev_rects[nrects].x2 = cache_list[idx].width;
-					Ev_rects[nrects].y2 = cache_list[idx].height;
-					nrects++;
-				}
-
-				x2 = cache_list[idx].x;
-				y2 = cache_list[idx].y;
-				w2 = cache_list[idx].width;
-				h2 = cache_list[idx].height;
-				r = sraRgnCreateRect(x2, y2, x2+w2, y2+h2);
-				sraRgnAnd(r, r0); 
-				sraRgnOr(unmapped_rgn, r); 
-				sraRgnDestroy(r);
-
-				cache_list[idx].map_state = IsUnmapped;
-
-			} else if (type == ReparentNotify) {
-				if (ev.xreparent.parent != rootwin) {
-					win2 = ev.xreparent.window;
-					if (win2 != rootwin) {
-						idx = lookup_win_index(win2);
-if (ncdb) fprintf(stderr, "----%02d: ReparentNotifyRM 0x%lx  %3d\n", ik, win2, idx);
-					}
-				}
-
-			} else if (type == DestroyNotify) {
-				win2 = ev.xdestroywindow.window;
-				idx = lookup_win_index(win2);
-if (ncdb) fprintf(stderr, "----%02d: DestroyNotify    0x%lx  %3d\n", ik, win2, idx);
-
-				if (idx >= 0) {
-					DELETE(idx);
-				}
-			} else {
-if (ncdb) fprintf(stderr, "igno%02d: ** Ignoring      0x%lx type: %s\n", ik, win, Etype(type));
-			}
-
-		}
-	}
-	X_UNLOCK;
-
-	if (use_batch && nreg) {
-		batch_push(nreg, -1.0);
-	}
-	if (nrects) {
-		if (scaling) {
-			push_borders(Ev_rects, nrects);
-		}
-	}
-
-	check_sched(try_batch, &did_sched);
-
-	if (n_CN || n_RN || n_DN || n_MN || n_UN || n_ST || n_DC || did_sched) {
-		snap_old();
-	}
-
-	sraRgnDestroy(r0);
-	sraRgnDestroy(missed_su_restore_rgn);
-	sraRgnDestroy(missed_bs_restore_rgn);
-
-if (ncdb) rfbLog("OUT check_ncache(): %.4f %.6f events: %d  pixels: %d\n", dnowx(), dnow() - now, n, pixels);
-if (ncdb) fprintf(stderr, "\n");
-	return pixels;
-}
-#endif
-
diff --git a/ica/x11/x11vnc/userinput.h b/ica/x11/x11vnc/userinput.h
deleted file mode 100644
index a5fd2b3..0000000
--- a/ica/x11/x11vnc/userinput.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_USERINPUT_H
-#define _X11VNC_USERINPUT_H
-
-/* -- userinput.h -- */
-
-extern int defer_update_nofb;
-extern int last_scroll_type;
-
-extern int get_wm_frame_pos(int *px, int *py, int *x, int *y, int *w, int *h,
-    Window *frame, Window *win);
-extern void parse_scroll_copyrect(void);
-extern void parse_fixscreen(void);
-extern void parse_wireframe(void);
-
-extern void set_wirecopyrect_mode(char *str);
-extern void set_scrollcopyrect_mode(char *str);
-extern void initialize_scroll_keys(void);
-extern void initialize_scroll_matches(void);
-extern void initialize_scroll_term(void);
-extern void initialize_max_keyrepeat(void);
-
-extern int direct_fb_copy(int x1, int y1, int x2, int y2, int mark);
-extern void fb_push(void);
-extern int fb_push_wait(double max_wait, int flags);
-extern void eat_viewonly_input(int max_eat, int keep);
-
-extern void mark_for_xdamage(int x, int y, int w, int h);
-extern void mark_region_for_xdamage(sraRegionPtr region);
-extern void set_xdamage_mark(int x, int y, int w, int h);
-extern int near_wm_edge(int x, int y, int w, int h, int px, int py);
-extern int near_scrollbar_edge(int x, int y, int w, int h, int px, int py);
-
-extern void check_fixscreen(void);
-extern int check_xrecord(void);
-extern int check_wireframe(void);
-extern int fb_update_sent(int *count);
-extern int check_user_input(double dt, double dtr, int tile_diffs, int *cnt);
-extern void do_copyregion(sraRegionPtr region, int dx, int dy, int mode);
-
-extern int check_ncache(int reset, int mode);
-extern int find_rect(int idx, int x, int y, int w, int h);
-extern int lookup_win_index(Window);
-extern void set_ncache_xrootpmap(void);
-
-#endif /* _X11VNC_USERINPUT_H */
diff --git a/ica/x11/x11vnc/util.c b/ica/x11/x11vnc/util.c
deleted file mode 100644
index 80b1607..0000000
--- a/ica/x11/x11vnc/util.c
+++ /dev/null
@@ -1,787 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- util.c -- */
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "win_utils.h"
-#include "unixpw.h"
-#include "connections.h"
-
-struct timeval _mysleep;
-
-/* this is only for debugging mutexes. see util.h */
-int hxl = 0;
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-MUTEX(x11Mutex);
-MUTEX(scrollMutex);
-#endif
-
-int nfix(int i, int n);
-int nmin(int n, int m);
-int nmax(int n, int m);
-int nabs(int n);
-double dabs(double x);
-void lowercase(char *str);
-void uppercase(char *str);
-char *lblanks(char *str);
-void strzero(char *str);
-int scan_hexdec(char *str, unsigned long *num);
-int parse_geom(char *str, int *wp, int *hp, int *xp, int *yp, int W, int H);
-void set_env(char *name, char *value);
-char *bitprint(unsigned int st, int nbits);
-char *get_user_name(void);
-char *get_home_dir(void);
-char *get_shell(void);
-char *this_host(void);
-
-int match_str_list(char *str, char **list);
-char **create_str_list(char *cslist);
-
-double dtime(double *);
-double dtime0(double *);
-double dnow(void);
-double dnowx(void);
-double rnow(void);
-double rfac(void);
-
-int rfbPE(long usec);
-void rfbCFD(long usec);
-
-double rect_overlap(int x1, int y1, int x2, int y2, int X1, int Y1,
-    int X2, int Y2);
-
-char *choose_title(char *display);
-
-
-/*
- * routine to keep 0 <= i < n
- */
-int nfix(int i, int n) {
-	if (i < 0) {
-		i = 0;
-	} else if (i >= n) {
-		i = n - 1;
-	}
-	return i;
-}
-
-int nmin(int n, int m) {
-	if (n < m) {
-		return n;
-	} else {
-		return m;
-	}
-}
-
-int nmax(int n, int m) {
-	if (n > m) {
-		return n;
-	} else {
-		return m;
-	}
-}
-
-int nabs(int n) {
-	if (n < 0) {
-		return -n;
-	} else {
-		return n;
-	}
-}
-
-double dabs(double x) {
-	if (x < 0.0) {
-		return -x;
-	} else {
-		return x;
-	}
-}
-
-void lowercase(char *str) {
-	char *p;
-	if (str == NULL) {
-		return;
-	}
-	p = str;
-	while (*p != '\0') {
-		*p = tolower((unsigned char) (*p));
-		p++;
-	}
-}
-
-void uppercase(char *str) {
-	char *p;
-	if (str == NULL) {
-		return;
-	}
-	p = str;
-	while (*p != '\0') {
-		*p = toupper((unsigned char) (*p));
-		p++;
-	}
-}
-
-char *lblanks(char *str) {
-	char *p = str;
-	while (*p != '\0') {
-		if (! isspace((unsigned char) (*p))) {
-			break;
-		}
-		p++;
-	}
-	return p;
-}
-
-void strzero(char *str) {
-	char *p = str;
-	if (p != NULL) {
-		while (*p != '\0') {
-			*p = '\0';
-			p++;
-		}
-	}
-}
-
-int is_decimal(char *str) {
-	char *p = str;
-	if (p != NULL) {
-		int first = 1;
-		while (*p != '\0') {
-			if (first && *p == '-') {
-				;
-			} else if (isdigit((int) *p)) {
-				;
-			} else {
-				return 0;
-			}
-			first = 0;
-			p++;
-		}
-		return 1;
-	}
-	return 0;
-}
-
-int scan_hexdec(char *str, unsigned long *num) {
-	if (sscanf(str, "0x%lx", num) != 1) {
-		if (sscanf(str, "%lu", num) != 1) {
-			return 0;
-		}
-	}
-	return 1;
-}
-
-int parse_geom(char *str, int *wp, int *hp, int *xp, int *yp, int W, int H) {
-	int w, h, x, y;
-	if (! str) {
-		return 0;
-	}
-	/* handle +/-x and +/-y */
-	if (sscanf(str, "%dx%d+%d+%d", &w, &h, &x, &y) == 4) {
-		;
-	} else if (sscanf(str, "%dx%d-%d+%d", &w, &h, &x, &y) == 4) {
-		w = nabs(w);
-		x = W - x - w;
-	} else if (sscanf(str, "%dx%d+%d-%d", &w, &h, &x, &y) == 4) {
-		h = nabs(h);
-		y = H - y - h;
-	} else if (sscanf(str, "%dx%d-%d-%d", &w, &h, &x, &y) == 4) {
-		w = nabs(w);
-		h = nabs(h);
-		x = W - x - w;
-		y = H - y - h;
-	} else {
-		return 0;
-	}
-	*wp = w;
-	*hp = h;
-	*xp = x;
-	*yp = y;
-	return 1;
-}
-
-void set_env(char *name, char *value) {
-	char *str;
-	if (! name) {
-		return;
-	}
-	if (! value) {
-		value = "";
-	}
-	str = (char *) malloc(strlen(name) + 1 + strlen(value) + 1);
-	sprintf(str, "%s=%s", name, value);
-	putenv(str);
-}
-
-char *bitprint(unsigned int st, int nbits) {
-	static char str[33];
-	int i, mask;
-	if (nbits > 32) {
-		nbits = 32;
-	}
-	for (i=0; i<nbits; i++) {
-		str[i] = '0';
-	}
-	str[nbits] = '\0';
-	mask = 1;
-	for (i=nbits-1; i>=0; i--) {
-		if (st & mask) {
-			str[i] = '1';
-		}
-		mask = mask << 1;
-	}
-	return str;	/* take care to use or copy immediately */
-}
-
-char *get_user_name(void) {
-	char *user = NULL;
-
-	user = getenv("USER");
-	if (user == NULL) {
-		user = getenv("LOGNAME");
-	}
-
-#if LIBVNCSERVER_HAVE_PWD_H
-	if (user == NULL) {
-		struct passwd *pw = getpwuid(getuid());
-		if (pw) {
-			user = pw->pw_name;
-		}
-	}
-#endif
-
-	if (user) {
-		return(strdup(user));
-	} else {
-		return(strdup("unknown-user"));
-	}
-}
-
-char *get_home_dir(void) {
-	char *home = NULL;
-
-	home = getenv("HOME");
-
-#if LIBVNCSERVER_HAVE_PWD_H
-	if (home == NULL) {
-		struct passwd *pw = getpwuid(getuid());
-		if (pw) {
-			home = pw->pw_dir;
-		}
-	}
-#endif
-
-	if (home) {
-		return(strdup(home));
-	} else {
-		return(strdup("/"));
-	}
-}
-
-char *get_shell(void) {
-	char *shell = NULL;
-
-	shell = getenv("SHELL");
-
-#if LIBVNCSERVER_HAVE_PWD_H
-	if (shell == NULL) {
-		struct passwd *pw = getpwuid(getuid());
-		if (pw) {
-			shell = pw->pw_shell;
-		}
-	}
-#endif
-
-	if (shell) {
-		return(strdup(shell));
-	} else {
-		return(strdup("/bin/sh"));
-	}
-}
-
-/*
- * utility to get the current host name
- */
-char *this_host(void) {
-	char host[MAXN];
-#if LIBVNCSERVER_HAVE_GETHOSTNAME
-	if (gethostname(host, MAXN) == 0) {
-		host[MAXN-1] = '\0';
-		return strdup(host);
-	} else if (UT.nodename) {
-		return strdup(UT.nodename);
-	}
-#endif
-	return NULL;
-}
-
-int match_str_list(char *str, char **list) {
-	int i = 0, matched = 0;
-
-	if (! str || ! list) {
-		return 0;
-	}
-	while (list[i] != NULL) {
-		if (!strcmp(list[i], "*")) {
-			matched = 1;
-			break;
-		} else if (strstr(str, list[i])) {
-			matched = 1;
-			break;
-		}
-		i++;
-	}
-	return matched;
-}
-
-char **create_str_list(char *cslist) {
-	int i, n;
-	char *p, *str;
-	char **list = NULL;
-
-	if (! cslist) {
-		return NULL;
-	}
-	
-	str = strdup(cslist);
-	n = 1;
-	p = str;
-	while (*p != '\0') {
-		if (*p == ',') {
-			n++;
-		}
-		p++;
-	}
-
-	/* the extra last one holds NULL */
-	list = (char **) calloc((n+1)*sizeof(char *), 1);
-
-	p = strtok(str, ",");
-	i = 0;
-	while (p && i < n) {
-		list[i++] = strdup(p);
-		p = strtok(NULL, ",");
-	}
-	free(str);
-
-	return list;
-}
-
-/*
- * simple function for measuring sub-second time differences, using
- * a double to hold the value.
- */
-double dtime(double *t_old) {
-	/* 
-	 * usage: call with 0.0 to initialize, subsequent calls give
-	 * the time difference since last call.
-	 */
-	double t_now, dt;
-	struct timeval now;
-
-	gettimeofday(&now, NULL);
-	t_now = now.tv_sec + ( (double) now.tv_usec/1000000. );
-	if (*t_old == 0.0) {
-		*t_old = t_now;
-		return t_now;
-	}
-	dt = t_now - *t_old;
-	*t_old = t_now;
-	return(dt);
-}
-
-/* common dtime() activities: */
-double dtime0(double *t_old) {
-	*t_old = 0.0;
-	return dtime(t_old);
-}
-
-double dnow(void) {
-	double t;
-	return dtime0(&t);
-}
-
-double dnowx(void) {
-	return dnow() - x11vnc_start;
-}
-
-double rnow(void) {
-	double t = dnow();
-	t = t - ((int) t); 
-	if (t > 1.0) {
-		t = 1.0;
-	} else if (t < 0.0) {
-		t = 0.0;
-	}
-	return t;
-}
-
-double rfac(void) {
-	double f;
-	static int first = 1;
-
-	if (first) {
-		unsigned int s;
-		if (getenv("RAND_SEED")) {
-			s = (unsigned int) atoi(getenv("RAND_SEED"));
-		} else {
-			s = (unsigned int) ((int) getpid() + 100000 * rnow());
-		}
-		srand(s);
-		first = 0;
-	}
-
-	f = (double) rand();
-	f = f / ((double) RAND_MAX);
-
-	return f;
-}
-
-void check_allinput_rate(void) {
-	static double last_all_input_check = 0.0;
-	static int set = 0, verb = -1;
-
-	if (use_threads) {
-		return;
-	}
-	if (verb < 0) {
-		verb = 0;
-		if (getenv("RATE_VERB")) verb = 1;
-	}
-	if (! set) {
-		set = 1;
-		last_all_input_check = dnow();
-	} else {
-		int dt = 5;
-		if (x11vnc_current > last_all_input_check + dt) {
-			int n, nq = 0;
-			while ((n = rfbCheckFds(screen, 0))) {
-				nq += n;
-			}
-			if (verb) fprintf(stderr, "nqueued: %d\n", nq);
-			if (getenv("CHECK_RATE") && nq > 18 * dt) {
-				double rate = nq / dt;
-				if (verb) rfbLog("check_allinput_rate:\n");
-				if (verb) rfbLog("Client is sending %.1f extra requests per second for the\n", rate);
-				if (verb) rfbLog("past %d seconds! (queued: %d)\n", dt, nq);
-				if (strstr(getenv("CHECK_RATE"), "allinput") && !all_input && !handle_events_eagerly) {
-					rfbLog("Switching to -allpinput mode.\n");
-					all_input = 1;
-				}
-			}
-			set = 0;
-		}
-	}
-}
-
-static void do_allinput(long usec) {
-	static double last = 0.0;
-	static int meas = 0, verb = -1;
-	int n, f = 1, cnt = 0, m = 0;
-	long usec0;
-	double now;
-	if (!screen || !screen->clientHead) {
-		return;
-	}
-	if (use_threads) {
-		return;
-	}
-	if (usec < 0) {
-		usec = 0;
-	}
-	usec0 = usec;
-	if (last == 0.0) {
-		last = dnow();
-	}
-	if (verb < 0) {
-		verb = 0;
-		if (getenv("RATE_VERB")) verb = 1;
-	}
-	while ((n = rfbCheckFds(screen, usec)) > 0) {
-		if (f) {
-			if (verb) fprintf(stderr, " *");
-			f = 0;
-		}
-		if (cnt++ > 30) {
-			break;
-		}
-		meas += n;
-		m += n;
-	}
-	if (verb) fprintf(stderr, "+%d/%d", cnt, m);
-	now = dnow();
-	if (now > last + 2.0) {
-		double rate = meas / (now - last);
-		if (verb) fprintf(stderr, "\n allinput rate: %.2f ", rate);
-		meas = 0;
-		last = dnow();
-	}
-}
-
-/*
- * utility wrapper to call rfbProcessEvents
- * checks that we are not in threaded mode.
- */
-#define USEC_MAX 999999		/* libvncsever assumes < 1 second */
-int rfbPE(long usec) {
-	int uip0 = unixpw_in_progress;
-	static int check_rate = -1;
-	int res = 0;
-	if (! screen) {
-		return res;
-	}
- 	if (unixpw && unixpw_in_progress && !unixpw_in_rfbPE) {
-		rfbLog("unixpw_in_rfbPE: skipping rfbPE\n");
- 		return res;
- 	}
-
-	if (debug_tiles > 2) {
-		double tm = dnow();
-		fprintf(stderr, "rfbPE(%d)  t: %.4f\n",
-		    (int) usec, tm - x11vnc_start);
-	}
-
-	if (usec > USEC_MAX) {
-		usec = USEC_MAX;
-	}
-	if (! use_threads) {
-		rfbBool r;
-		r = rfbProcessEvents(screen, usec);
-		if (r) {
-			res = 1;
-		}
-	}
-
- 	if (unixpw && unixpw_in_progress && !uip0) {
-		if (!unixpw_in_rfbPE) {
-			rfbLog("rfbPE: got new client in non-rfbPE\n");
-			;	/* this is new unixpw client  */
-		}
- 	}
-
-	if (ipv6_listen) {
-		check_ipv6_listen(usec);
-	}
-	if (unix_sock) {
-		check_unix_sock(usec);
-	}
-	if (check_rate != 0) {
-		if (check_rate < 0) {
-			if (getenv("CHECK_RATE")) {
-				check_rate = 1;
-			} else {
-				check_rate = 0;
-			}
-		}
-		if (check_rate && !all_input && x11vnc_current < last_client + 45)  {
-			check_allinput_rate();
-		}
-	}
-	if (all_input) {
-		do_allinput(usec);
-	}
-	return res;
-}
-
-void rfbCFD(long usec) {
-	int uip0 = unixpw_in_progress;
-	if (! screen) {
-		return;
-	}
- 	if (unixpw && unixpw_in_progress && !unixpw_in_rfbPE) {
-		static int msgs = 0;
-		static double last_reset = 0.0;
-		if (dnow() > last_reset + 5.0) {
-			msgs = 0;
-			last_reset = dnow();
-		}
-		if (msgs++ < 10) {
-			rfbLog("unixpw_in_rfbPE: skipping rfbCFD\n");
-			if (msgs == 10) {
-				rfbLog("unixpw_in_rfbPE: skipping rfbCFD ...\n");
-			}
-		}
- 		return;
- 	}
-	if (usec > USEC_MAX) {
-		usec = USEC_MAX;
-	}
-
-	if (debug_tiles > 2) {
-		double tm = dnow();
-		fprintf(stderr, "rfbCFD(%d) t: %.4f\n",
-		    (int) usec, tm - x11vnc_start);
-	}
-
-
-	if (! use_threads) {
-		if (all_input) {
-			do_allinput(usec);
-		} else {
-			if (handle_events_eagerly) {
-				screen->handleEventsEagerly = TRUE;
-			} else {
-				screen->handleEventsEagerly = FALSE;
-			}
-			rfbCheckFds(screen, usec);
-		}
-	}
-
- 	if (unixpw && unixpw_in_progress && !uip0) {
-		if (!unixpw_in_rfbPE) {
-			rfbLog("rfbCFD: got new client in non-rfbPE\n");
-			;	/* this is new unixpw client  */
-		}
- 	}
-}
-
-double rect_overlap(int x1, int y1, int x2, int y2, int X1, int Y1,
-    int X2, int Y2) {
-	double a, A, o;
-	sraRegionPtr r, R;
-	sraRectangleIterator *iter;
-	sraRect rt;
-
-	a = nabs((x2 - x1) * (y2 - y1));
-	A = nabs((X2 - X1) * (Y2 - Y1));
-
-	if (a == 0 || A == 0) {
-		return 0.0;
-	}
-
-	r = sraRgnCreateRect(x1, y1, x2, y2);
-	R = sraRgnCreateRect(X1, Y1, X2, Y2);
-
-	sraRgnAnd(r, R);
-	
-	o = 0.0;
-	iter = sraRgnGetIterator(r);
-	while (sraRgnIteratorNext(iter, &rt)) {
-		o += nabs( (rt.x2 - rt.x1) * (rt.y2 - rt.y1) );
-	}
-	sraRgnReleaseIterator(iter);
-
-	sraRgnDestroy(r);
-	sraRgnDestroy(R);
-
-	if (a < A) {
-		o = o/a;
-	} else {
-		o = o/A;
-	}
-	return o;
-}
-
-/*
- * choose a desktop name
- */
-char *choose_title(char *display) {
-	static char title[(MAXN+10)];	
-
-	memset(title, 0, sizeof(title));
-	strcpy(title, "x11vnc");
-
-	if (display == NULL) {
-		display = getenv("DISPLAY");
-	}
-
-#ifdef MACOSX
-	if (display == NULL || strstr(display, "/tmp/") == display) {
-		char *u = get_user_name();
-		char *th = this_host();
-		if (strlen(u) > MAXN/4)  {
-			u = "someone";
-		}
-		strcpy(title, u);
-		if (th == NULL && UT.nodename) {
-			th = UT.nodename;
-		}
-		if (th) {
-			strcat(title, "@");
-			strncat(title, th, MAXN - strlen(title));
-		}
-		return title;
-	}
-#endif
-
-	if (display == NULL) {
-		return title;
-	}
-
-	/* use display: */
-	title[0] = '\0';
-	if (display[0] == ':') {
-		char *th = this_host();
-		if (th != NULL) {
-			strncpy(title, th, MAXN - strlen(title));
-		}
-	}
-	strncat(title, display, MAXN - strlen(title));
-	X_LOCK;
-	if (subwin && dpy && valid_window(subwin, NULL, 0)) {
-#if !NO_X11
-		char *name = NULL;
-		int do_appshare = getenv("X11VNC_APPSHARE_ACTIVE") ? 1 : 0;
-		if (0 && do_appshare) {
-			title[0] = '\0';
-		}
-		if (XFetchName(dpy, subwin, &name)) {
-			if (name) {
-				if (title[0] != '\0') {
-					strncat(title, " ",  MAXN - strlen(title));
-				}
-				strncat(title, name, MAXN - strlen(title));
-				free(name);
-			}
-		}
-		if (do_appshare) {
-			Window c;
-			int x, y;
-			if (xtranslate(subwin, rootwin, 0, 0, &x, &y, &c, 1)) {
-				char tmp[32];
-				if (scaling) {
-					x *= scale_fac_x;
-					y *= scale_fac_y;
-				}
-				sprintf(tmp, " XY=%d,%d", x, y);
-				strncat(title, tmp, MAXN - strlen(title));
-			}
-			rfbLog("appshare title: %s\n", title);
-		}
-#endif	/* NO_X11 */
-	}
-	X_UNLOCK;
-	return title;
-}
diff --git a/ica/x11/x11vnc/util.h b/ica/x11/x11vnc/util.h
deleted file mode 100644
index 55585cf..0000000
--- a/ica/x11/x11vnc/util.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_UTIL_H
-#define _X11VNC_UTIL_H
-
-/* -- util.h -- */
-
-extern int nfix(int i, int n);
-extern int nmin(int n, int m);
-extern int nmax(int n, int m);
-extern int nabs(int n);
-extern double dabs(double x);
-extern void lowercase(char *str);
-extern void uppercase(char *str);
-extern char *lblanks(char *str);
-extern void strzero(char *str);
-extern int scan_hexdec(char *str, unsigned long *num);
-extern int parse_geom(char *str, int *wp, int *hp, int *xp, int *yp, int W, int H);
-extern void set_env(char *name, char *value);
-extern char *bitprint(unsigned int st, int nbits);
-extern char *get_user_name(void);
-extern char *get_home_dir(void);
-extern char *get_shell(void);
-extern char *this_host(void);
-
-extern int match_str_list(char *str, char **list);
-extern char **create_str_list(char *cslist);
-
-extern double dtime(double *);
-extern double dtime0(double *);
-extern double dnow(void);
-extern double dnowx(void);
-extern double rnow(void);
-extern double rfac(void);
-
-extern int rfbPE(long usec);
-extern void rfbCFD(long usec);
-extern double rect_overlap(int x1, int y1, int x2, int y2, int X1, int Y1,
-    int X2, int Y2);
-extern char *choose_title(char *display);
-
-
-#define NONUL(x) ((x) ? (x) : "")
-
-/*
-	Put this in usleep2() for debug printout.
-	fprintf(stderr, "_mysleep: %08d %10.6f %s:%d\n", (x), dnow() - x11vnc_start, __FILE__, __LINE__); \
- */
-
-/* XXX usleep(3) is not thread safe on some older systems... */
-extern struct timeval _mysleep;
-#define usleep2(x) \
-	_mysleep.tv_sec  = (x) / 1000000; \
-	_mysleep.tv_usec = (x) % 1000000; \
-	select(0, NULL, NULL, NULL, &_mysleep); 
-#if !defined(X11VNC_USLEEP)
-#undef usleep
-#define usleep usleep2
-#endif
-
-/*
- * following is based on IsModifierKey in Xutil.h
-*/
-#define ismodkey(keysym) \
-  ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R) && \
-  ((KeySym)(keysym) != XK_Caps_Lock) && ((KeySym)(keysym) != XK_Shift_Lock)))
-
-/*
- * When threaded we have to mutex our X11 calls to avoid XIO crashes
- * due to callbacks.
- */
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-extern MUTEX(x11Mutex);
-extern MUTEX(scrollMutex);
-MUTEX(clientMutex);
-MUTEX(inputMutex);
-MUTEX(pointerMutex);
-#endif
-
-#define X_INIT INIT_MUTEX(x11Mutex)
-
-#if 1
-#define X_LOCK       LOCK(x11Mutex)
-#define X_UNLOCK   UNLOCK(x11Mutex)
-#else
-extern int hxl;
-#define X_LOCK       fprintf(stderr, "*** X_LOCK**  %d%s  %s:%d\n", \
-	hxl, hxl  ? "  BAD-PRE-LOCK":"",   __FILE__, __LINE__);   LOCK(x11Mutex); hxl = 1;
-#define X_UNLOCK     fprintf(stderr, "    x_unlock  %d%s  %s:%d\n", \
-	hxl, !hxl ? "  BAD-PRE-UNLOCK":"", __FILE__, __LINE__); UNLOCK(x11Mutex); hxl = 0;
-#endif
-
-#define SCR_LOCK   if (use_threads) {LOCK(scrollMutex);}
-#define SCR_UNLOCK if (use_threads) {UNLOCK(scrollMutex);}
-#define SCR_INIT INIT_MUTEX(scrollMutex)
-
-#define CLIENT_LOCK   if (use_threads) {LOCK(clientMutex);}
-#define CLIENT_UNLOCK if (use_threads) {UNLOCK(clientMutex);}
-#define CLIENT_INIT INIT_MUTEX(clientMutex)
-
-#if 1
-#define INPUT_LOCK   if (use_threads) {LOCK(inputMutex);}
-#define INPUT_UNLOCK if (use_threads) {UNLOCK(inputMutex);}
-#else
-#define INPUT_LOCK
-#define INPUT_UNLOCK
-#endif
-#define INPUT_INIT INIT_MUTEX(inputMutex)
-
-#define POINTER_LOCK   if (use_threads) {LOCK(pointerMutex);}
-#define POINTER_UNLOCK if (use_threads) {UNLOCK(pointerMutex);}
-#define POINTER_INIT INIT_MUTEX(pointerMutex)
-
-/*
- * The sendMutex member was added to libvncserver 0.9.8
- * rfb/rfb.h sets LIBVNCSERVER_SEND_MUTEX if present.
- */
-#if LIBVNCSERVER_HAVE_LIBPTHREAD && defined(LIBVNCSERVER_SEND_MUTEX)
-#define SEND_LOCK(cl)   if (use_threads)   LOCK((cl)->sendMutex);
-#define SEND_UNLOCK(cl) if (use_threads) UNLOCK((cl)->sendMutex);
-#else
-#define SEND_LOCK(cl)
-#define SEND_UNLOCK(cl)
-#endif
-
-#endif /* _X11VNC_UTIL_H */
diff --git a/ica/x11/x11vnc/v4l.c b/ica/x11/x11vnc/v4l.c
deleted file mode 100644
index 86c33a6..0000000
--- a/ica/x11/x11vnc/v4l.c
+++ /dev/null
@@ -1,1785 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- v4l.c -- */
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "scan.h"
-#include "xinerama.h"
-#include "screen.h"
-#include "connections.h"
-#include "keyboard.h"
-#include "allowed_input_t.h"
-
-#if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H
-#if LIBVNCSERVER_HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#define CONFIG_VIDEO_V4L1_COMPAT
-#include <linux/videodev.h>
-#ifdef __LINUX_VIDEODEV2_H
-# ifndef HAVE_V4L2
-# define HAVE_V4L2 1
-# endif
-#endif
-#define V4L_OK
-#endif
-#endif
-
-char *v4l_guess(char *str, int *fd);
-void v4l_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-void v4l_pointer_command(int mask, int x, int y, rfbClientPtr client);
-
-static int v4l1_val(int pct);
-static int v4l1_width(int w);
-static int v4l1_height(int h);
-static int v4l1_resize(int fd, int w, int h);
-static void v4l1_setfreq(int fd, unsigned long freq, int verb);
-static void v4l1_set_input(int fd, int which);
-static int v4l1_setfmt(int fd, char *fmt);
-static void apply_settings(char *dev, char *settings, int *fd);
-static int v4l1_dpct(int old, int d);
-static void v4l_requery(void);
-static void v4l_br(int b);
-static void v4l_hu(int b);
-static void v4l_co(int b);
-static void v4l_cn(int b);
-static void v4l_sz(int b);
-static void v4l_sta(int sta);
-static void v4l_inp(int inp);
-static void v4l_fmt(char *fmt);
-static int colon_n(char *line);
-static char *colon_str(char *line);
-static char *colon_tag(char *line);
-static void lookup_rgb(char *g_fmt, int *g_b, int *mask_rev);
-static char *v4l1_lu_palette(unsigned short palette);
-static unsigned short v4l1_lu_palette_str(char *name, int *bits, int *rev);
-static char *v4l2_lu_palette(unsigned int palette);
-static unsigned int v4l2_lu_palette_str(char *name, int *bits, int *rev);
-static int v4l1_query(int fd, int verbose);
-static int v4l2_query(int fd, int verbose);
-static int open_dev(char *dev);
-static char *guess_via_v4l(char *dev, int *fd);
-static char *guess_via_v4l_info(char *dev, int *fd);
-static void parse_str(char *str, char **dev, char **settings, char **atparms);
-static unsigned long lookup_freqtab(int sta);
-static unsigned long lookup_freq(int sta);
-static int lookup_station(unsigned long freq);
-static void init_freqtab(char *file);
-static void init_freqs(void);
-static void init_ntsc_cable(void);
-
-#define C_VIDEO_CAPTURE 1
-#define C_PICTURE       2
-#define C_WINDOW        3 
-
-#ifdef V4L_OK
-static struct video_capability  v4l1_capability;
-static struct video_channel     v4l1_channel;
-static struct video_tuner       v4l1_tuner;
-static struct video_picture     v4l1_picture;
-static struct video_window      v4l1_window;
-
-#if HAVE_V4L2
-static struct v4l2_capability   v4l2_capability;
-static struct v4l2_input        v4l2_input;
-static struct v4l2_tuner        v4l2_tuner;
-static struct v4l2_fmtdesc      v4l2_fmtdesc;
-static struct v4l2_format       v4l2_format;
-/*static struct v4l2_framebuffer  v4l2_fbuf; */
-/*static struct v4l2_queryctrl    v4l2_qctrl; */
-#endif
-#endif
-
-static int v4l1_cap = -1;
-static int v4l2_cap = -1;
-#define V4L1_MAX 65535
-
-#define CHANNEL_MAX 500
-static unsigned long ntsc_cable[CHANNEL_MAX];
-static unsigned long custom_freq[CHANNEL_MAX];
-
-static unsigned long last_freq = 0;
-static int last_channel = 0;
-
-static int v4l1_val(int pct) {
-	/* pct is % */
-	int val, max = V4L1_MAX; 
-	if (pct < 0) {
-		return 0;
-	} else if (pct > 100) {
-		return max;
-	}
-	val = (pct * max)/100;
-
-	return val;
-}
-static int v4l1_width(int w) {
-#ifdef V4L_OK
-	int min = v4l1_capability.minwidth;
-	int max = v4l1_capability.maxwidth;
-	if (w < min) {
-		w = min;
-	}
-	if (w > max) {
-		w = max;
-	}
-#endif
-	return w;
-}
-static int v4l1_height(int h) {
-#ifdef V4L_OK
-	int min = v4l1_capability.minheight;
-	int max = v4l1_capability.maxheight;
-	if (h < min) {
-		h = min;
-	}
-	if (h > max) {
-		h = max;
-	}
-#endif
-	return h;
-}
-
-static int v4l1_resize(int fd, int w, int h) {
-#ifdef V4L_OK
-	int dowin = 0;
-
-	memset(&v4l1_window, 0, sizeof(v4l1_window));
-	if (ioctl(fd, VIDIOCGWIN, &v4l1_window) == -1) {
-		return 0;
-	}
-
-	if (w > 0) w = v4l1_width(w);
-
-	if (w > 0 && w != (int) v4l1_window.width) {
-		dowin = 1;
-	}
-
-	if (h > 0) h = v4l1_height(h);
-
-	if (h > 0 && h != (int) v4l1_window.height) {
-		dowin = 1;
-	}
-
-	if (dowin) {
-		v4l1_window.x = 0;
-		v4l1_window.y = 0;
-		ioctl(fd, VIDIOCSWIN, &v4l1_window);
-		if (w > 0) v4l1_window.width = w;
-		if (h > 0) v4l1_window.height = h;
-		fprintf(stderr, "calling V4L_1: VIDIOCSWIN\n");
-		fprintf(stderr, "trying new size %dx%d\n",
-		    v4l1_window.width, v4l1_window.height);
-		if (ioctl(fd, VIDIOCSWIN, &v4l1_window) == -1) {
-			perror("ioctl VIDIOCSWIN");
-			return 0;
-		}
-	}
-#else
-	if (!fd || !w || !h) {}
-#endif
-	return 1;
-}
-
-static void v4l1_setfreq(int fd, unsigned long freq, int verb) {
-#ifdef V4L_OK
-	unsigned long f0, f1;
-	f1 = (freq * 16) / 1000;
-	ioctl(fd, VIDIOCGFREQ, &f0);
-	if (verb) fprintf(stderr, "read freq: %d\n", (int) f0);
-	if (freq > 0) {
-		if (ioctl(fd, VIDIOCSFREQ, &f1) == -1) {
-			perror("ioctl VIDIOCSFREQ");
-		} else {
-			ioctl(fd, VIDIOCGFREQ, &f0);
-			if (verb) fprintf(stderr, "read freq: %d\n", (int) f0);
-			last_freq = freq;
-		}
-	}
-#else
-	if (!fd || !freq || !verb) {}
-#endif
-}
-
-static void v4l1_set_input(int fd, int which) {
-#ifdef V4L_OK
-	if (which != -1) {
-		memset(&v4l1_channel, 0, sizeof(v4l1_channel));
-		v4l1_channel.channel = which;
-		if (ioctl(fd, VIDIOCGCHAN, &v4l1_channel) != -1) {
-			v4l1_channel.channel = which;
-			fprintf(stderr, "setting input channel to %d: %s\n",
-			    which, v4l1_channel.name);
-			last_channel = which;
-			ioctl(fd, VIDIOCSCHAN, &v4l1_channel);
-		}
-	}
-#else
-	if (!fd || !which) {}
-#endif
-}
-
-static int v4l1_setfmt(int fd, char *fmt) {
-#ifdef V4L_OK
-	unsigned short fnew;
-	int bnew, rnew;
-
-	fnew = v4l1_lu_palette_str(fmt, &bnew, &rnew);
-	if (fnew) {
-		v4l1_picture.depth = bnew; 
-		v4l1_picture.palette = fnew;
-	}
-	fprintf(stderr, "calling V4L_1: VIDIOCSPICT\n");
-	if (ioctl(fd, VIDIOCSPICT, &v4l1_picture) == -1) {
-		perror("ioctl VIDIOCSPICT");
-		return 0;
-	}
-	if (raw_fb_pixfmt) {
-		free(raw_fb_pixfmt);
-	}
-	raw_fb_pixfmt = strdup(fmt);
-#else
-	if (!fd || !fmt) {}
-#endif
-	return 1;
-}
-
-static int ignore_all = 0;
-
-static void apply_settings(char *dev, char *settings, int *fd) {
-#ifdef V4L_OK
-	char *str, *p, *fmt = NULL, *tun = NULL, *inp = NULL;
-	int br = -1, co = -1, cn = -1, hu = -1;
-	int w = -1, h = -1, b = -1;
-	int sta = -1;
-	int setcnt = 0;
-	if (! settings || settings[0] == '\0') {
-		return;
-	}
-	str = strdup(settings);
-	p = strtok(str, ",");
-	while (p) {
-		if (strstr(p, "br=") == p) {
-			br = atoi(p+3);
-			if (br >= 0) setcnt++;
-		} else if (strstr(p, "co=") == p) {
-			co = atoi(p+3);
-			if (co >= 0) setcnt++;
-		} else if (strstr(p, "cn=") == p) {
-			cn = atoi(p+3);
-			if (cn >= 0) setcnt++;
-		} else if (strstr(p, "hu=") == p) {
-			hu = atoi(p+3);
-			if (hu >= 0) setcnt++;
-		} else if (strstr(p, "w=") == p) {
-			w = atoi(p+2);
-			if (w > 0) setcnt++;
-		} else if (strstr(p, "h=") == p) {
-			h = atoi(p+2);
-			if (h > 0) setcnt++;
-		} else if (strstr(p, "bpp=") == p) {
-			b = atoi(p+4);
-			if (b > 0) setcnt++;
-		} else if (strstr(p, "fmt=") == p) {
-			fmt = strdup(p+4);
-			setcnt++;
-		} else if (strstr(p, "tun=") == p) {
-			tun = strdup(p+4);
-			setcnt++;
-		} else if (strstr(p, "inp=") == p) {
-			inp = strdup(p+4);
-			setcnt++;
-		} else if (strstr(p, "sta=") == p) {
-			sta = atoi(p+4);
-			setcnt++;
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-	if (! setcnt) {
-		return;
-	}
-	if (*fd < 0) {
-		*fd = open_dev(dev);
-	}
-	if (*fd < 0) {
-		return;
-	}
-	v4l1_cap = v4l1_query(*fd, 1);
-	v4l2_cap = v4l2_query(*fd, 1);
-
-	if (v4l1_cap && ! ignore_all) {
-		if (br >= 0) v4l1_picture.brightness = v4l1_val(br);
-		if (hu >= 0) v4l1_picture.hue        = v4l1_val(hu);
-		if (co >= 0) v4l1_picture.colour     = v4l1_val(co);
-		if (cn >= 0) v4l1_picture.contrast   = v4l1_val(cn);
-
-		fprintf(stderr, "calling V4L_1: VIDIOCSPICT\n");
-		if (ioctl(*fd, VIDIOCSPICT, &v4l1_picture) == -1) {
-			perror("ioctl VIDIOCSPICT");
-		}
-
-		if (fmt) {
-			v4l1_setfmt(*fd, fmt);
-		} else if (b > 0 && b != v4l1_picture.depth) {
-			if (b == 8) {
-				v4l1_setfmt(*fd, "HI240");
-			} else if (b == 16) {
-				v4l1_setfmt(*fd, "RGB565");
-			} else if (b == 24) {
-				v4l1_setfmt(*fd, "RGB24");
-			} else if (b == 32) {
-				v4l1_setfmt(*fd, "RGB32");
-			}
-		}
-
-		v4l1_resize(*fd, w, h);
-
-		if (tun) {
-			int mode = -1;
-			if (!strcasecmp(tun, "PAL")) {
-				mode = VIDEO_MODE_PAL;
-			} else if (!strcasecmp(tun, "NTSC")) {
-				mode = VIDEO_MODE_NTSC;
-			} else if (!strcasecmp(tun, "SECAM")) {
-				mode = VIDEO_MODE_SECAM;
-			} else if (!strcasecmp(tun, "AUTO")) {
-				mode = VIDEO_MODE_AUTO;
-			}
-			if (mode != -1) {
-				int i;
-				for (i=0; i< v4l1_capability.channels; i++) {
-					memset(&v4l1_channel, 0, sizeof(v4l1_channel));
-					v4l1_channel.channel = i;
-					if (ioctl(*fd, VIDIOCGCHAN, &v4l1_channel) == -1) {
-						continue;
-					}
-					if (! v4l1_channel.tuners) {
-						continue;
-					}
-					if (v4l1_channel.norm == mode) {
-						continue;
-					}
-					v4l1_channel.norm = mode;
-					ioctl(*fd, VIDIOCSCHAN, &v4l1_channel);
-				}
-			}
-		}
-		if (inp) {
-			char s[2];
-			int i, chan = -1;
-
-			s[0] = inp[0];
-			s[1] = '\0';
-			if (strstr("0123456789", s)) {
-				chan = atoi(inp);
-			} else {
-				for (i=0; i< v4l1_capability.channels; i++) {
-					memset(&v4l1_channel, 0, sizeof(v4l1_channel));
-					v4l1_channel.channel = i;
-					if (ioctl(*fd, VIDIOCGCHAN, &v4l1_channel) == -1) {
-						continue;
-					}
-					if (!strcmp(v4l1_channel.name, inp)) {
-						chan = i;
-						break;
-					}
-				}
-			}
-			v4l1_set_input(*fd, chan);
-		}
-		if (sta >= 0) {
-			unsigned long freq = lookup_freq(sta);
-			v4l1_setfreq(*fd, freq, 1);
-		}
-	}
-	v4l1_cap = v4l1_query(*fd, 1);
-	v4l2_cap = v4l2_query(*fd, 1);
-#else
-	if (!dev || !settings || !fd) {}
-	return;
-#endif
-}
-
-static double dval = 0.05;
-
-static int v4l1_dpct(int old, int d) {
-	int newval, max = V4L1_MAX; 
-	
-	/* -1 and 1 are special cases for "small increments" */
-	if (d == -1) {
-		newval = old - (int) (dval * max);
-	} else if (d == 1) {
-		newval = old + (int) (dval * max);
-	} else {
-		newval = (d * max)/100;
-	}
-	if (newval < 0) {
-		newval = 0;
-	}
-	if (newval > max) {
-		newval = max;
-	}
-	return newval;
-}
-
-static void v4l_requery(void) {
-	if (raw_fb_fd < 0) {
-		return;
-	}
-	v4l1_cap = v4l1_query(raw_fb_fd, 1);
-	v4l2_cap = v4l2_query(raw_fb_fd, 1);
-}
-	
-static void v4l_br(int b) {
-#ifdef V4L_OK
-	int old = v4l1_picture.brightness;
-
-	v4l1_picture.brightness = v4l1_dpct(old, b);
-	ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
-	v4l_requery();
-#else
-	if (!b) {}
-#endif
-}
-
-static void v4l_hu(int b) {
-#ifdef V4L_OK
-	int old = v4l1_picture.hue;
-
-	v4l1_picture.hue = v4l1_dpct(old, b);
-	ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
-	v4l_requery();
-#else
-	if (!b) {}
-#endif
-}
-
-static void v4l_co(int b) {
-#ifdef V4L_OK
-	int old = v4l1_picture.colour;
-
-	v4l1_picture.colour = v4l1_dpct(old, b);
-	ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
-	v4l_requery();
-#else
-	if (!b) {}
-#endif
-}
-
-static void v4l_cn(int b) {
-#ifdef V4L_OK
-	int old = v4l1_picture.contrast;
-
-	v4l1_picture.contrast = v4l1_dpct(old, b);
-	ioctl(raw_fb_fd, VIDIOCSPICT, &v4l1_picture);
-	v4l_requery();
-#else
-	if (!b) {}
-#endif
-}
-
-static void v4l_sz(int b) {
-#ifdef V4L_OK
-	int w_old = v4l1_window.width;
-	int h_old = v4l1_window.height;
-	int w, h;
-
-	if (w_old == 0) {
-		w_old = 160;
-	}
-	if (h_old == 0) {
-		h_old = 120;
-	}
-
-	if (b == 1) {
-		w = w_old + (int) (0.15 * w_old); 
-		h = h_old + (int) (0.15 * h_old); 
-	} else if (b == -1) {
-		w = w_old - (int) (0.15 * w_old); 
-		h = h_old - (int) (0.15 * h_old); 
-	} else {
-		return;
-	}
-
-	if (! v4l1_resize(raw_fb_fd, w, h)) {
-		return;
-	}
-
-	v4l_requery();
-
-	push_black_screen(4);
-
-	ignore_all = 1;
-	do_new_fb(1);
-	ignore_all = 0;
-#else
-	if (!b) {}
-#endif
-}
-
-static void v4l_sta(int sta) {
-#ifdef V4L_OK
-	unsigned long freq = 0;
-	int cur = lookup_station(last_freq);
-
-	if (! last_freq) {
-		if (sta == 0 || sta == -1) {
-			sta = 11;
-		}
-	}
-
-	if (sta == -1) {
-		while (cur > 0) {
-			freq = lookup_freq(--cur);
-			if (freq) {
-				break;
-			}
-		}
-	} else if (sta == 0) {
-		while (cur < CHANNEL_MAX - 1) {
-			freq = lookup_freq(++cur);
-			if (freq) {
-				break;
-			}
-		}
-	} else {
-		freq = lookup_freq(sta);
-		cur = sta;
-	}
-	fprintf(stderr, "to station %d / %d\n", cur, (int) freq);
-	v4l1_setfreq(raw_fb_fd, freq, 0);
-#else
-	if (!sta) {}
-#endif
-}
-
-static void v4l_inp(int inp) {
-#ifdef V4L_OK
-	int next = -1;
-	if (inp == -1) {
-		inp = last_channel + 1;
-		if (inp >= v4l1_capability.channels) {
-			inp = 0;
-		}
-		next = inp;
-	} else if (inp == -2) {
-		inp = last_channel - 1;
-		if (inp < 0) {
-			inp = v4l1_capability.channels - 1;
-		}
-		next = inp;
-	} else {
-		next = inp;
-	}
-	v4l1_set_input(raw_fb_fd, next);
-#else
-	if (!inp) {}
-#endif
-}
-
-static void v4l_fmt(char *fmt) {
-	if (v4l1_setfmt(raw_fb_fd, fmt)) {
-		v4l_requery();
-
-		ignore_all = 1;
-		do_new_fb(1);
-		ignore_all = 0;
-	}
-}
-
-void v4l_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
-	allowed_input_t input;
-
-	if (raw_fb_fd < 0) {
-		return;		
-	}
-	if (! down) {
-		return;
-	}
-	if (view_only) {
-		return;
-	}
-	get_allowed_input(client, &input);
-	if (! input.keystroke) {
-		return;
-	}
-
-	if (keysym == XK_b) {
-		v4l_br(-1);
-	} else if (keysym == XK_B) {
-		v4l_br(+1);
-	} else if (keysym == XK_h) {
-		v4l_hu(-1);
-	} else if (keysym == XK_H) {
-		v4l_hu(+1);
-	} else if (keysym == XK_c) {
-		v4l_co(-1);
-	} else if (keysym == XK_C) {
-		v4l_co(+1);
-	} else if (keysym == XK_n) {
-		v4l_cn(-1);
-	} else if (keysym == XK_N) {
-		v4l_cn(+1);
-	} else if (keysym == XK_s) {
-		v4l_sz(-1);
-	} else if (keysym == XK_S) {
-		v4l_sz(+1);
-	} else if (keysym == XK_i) {
-		v4l_inp(-1);
-	} else if (keysym == XK_I) {
-		v4l_inp(-2);
-	} else if (keysym == XK_Up) {
-		v4l_sta(+0);
-	} else if (keysym == XK_Down) {
-		v4l_sta(-1);
-	} else if (keysym == XK_F1) {
-		v4l_fmt("HI240");
-	} else if (keysym == XK_F2) {
-		v4l_fmt("RGB565");
-	} else if (keysym == XK_F3) {
-		v4l_fmt("RGB24");
-	} else if (keysym == XK_F4) {
-		v4l_fmt("RGB32");
-	} else if (keysym == XK_F5) {
-		v4l_fmt("RGB555");
-	} else if (keysym == XK_F6) {
-		v4l_fmt("GREY");
-	}
-	if (client) {}
-}
-
-
-void v4l_pointer_command(int mask, int x, int y, rfbClientPtr client) {
-	/* do not forget viewonly perms */
-	if (mask || x || y || client) {}
-}
-
-static int colon_n(char *line) {
-	char *q;
-	int n;
-	q = strrchr(line, ':');
-	if (! q) {
-		return 0;
-	}
-	q = lblanks(q+1);
-	if (sscanf(q, "%d", &n) == 1) {
-		return n;
-	}
-	return 0;
-}
-
-static char *colon_str(char *line) {
-	char *q, *p, *t;
-	q = strrchr(line, ':');
-	if (! q) {
-		return strdup("");
-	}
-	q = lblanks(q+1);
-	p = strpbrk(q, " \t\n");
-	if (p) {
-		*p = '\0';
-	}
-	t = strdup(q);
-	*p = '\n';
-	return t;
-}
-
-static char *colon_tag(char *line) {
-	char *q, *p, *t;
-	q = strrchr(line, '[');
-	if (! q) {
-		return strdup("");
-	}
-	q++;
-	p = strrchr(q, ']');
-	if (! p) {
-		return strdup("");
-	}
-	*p = '\0';
-	t = strdup(q);
-	*p = ']';
-	return t;
-}
-
-static void lookup_rgb(char *fmt, int *bits, int *rev) {
-	int tb, tr;
-
-	if (v4l2_lu_palette_str(fmt, &tb, &tr)) {
-		*bits = tb;
-		*rev  = tr;
-		return;
-	}
-	if (v4l1_lu_palette_str(fmt, &tb, &tr)) {
-		*bits = tb;
-		*rev  = tr;
-		return;
-	}
-}
-
-static char *v4l1_lu_palette(unsigned short palette) {
-	switch(palette) {
-#ifdef V4L_OK
-		case VIDEO_PALETTE_GREY:	return "GREY";
-		case VIDEO_PALETTE_HI240:	return "HI240";
-		case VIDEO_PALETTE_RGB565:	return "RGB565";
-		case VIDEO_PALETTE_RGB24:	return "RGB24";
-		case VIDEO_PALETTE_RGB32:	return "RGB32";
-		case VIDEO_PALETTE_RGB555:	return "RGB555";
-		case VIDEO_PALETTE_YUV422:	return "YUV422";
-		case VIDEO_PALETTE_YUYV:	return "YUYV";
-		case VIDEO_PALETTE_UYVY:	return "UYVY";
-		case VIDEO_PALETTE_YUV420:	return "YUV420";
-		case VIDEO_PALETTE_YUV411:	return "YUV411";
-		case VIDEO_PALETTE_RAW:		return "RAW";
-		case VIDEO_PALETTE_YUV422P:	return "YUV422P";
-		case VIDEO_PALETTE_YUV411P:	return "YUV411P";
-		case VIDEO_PALETTE_YUV420P:	return "YUV420P";
-		case VIDEO_PALETTE_YUV410P:	return "YUV410P";
-#endif
-		default:			return "unknown";
-	}
-}
-
-static unsigned short v4l1_lu_palette_str(char *name, int *bits, int *rev) {
-#ifdef V4L_OK
-	*rev = 0;
-	if (!strcmp(name, "RGB555")) {
-		*bits = 16;
-		return VIDEO_PALETTE_RGB555;
-	} else if (!strcmp(name, "RGB565")) {
-		*bits = 16;
-		return VIDEO_PALETTE_RGB565;
-	} else if (!strcmp(name, "RGB24")) {
-		*bits = 24;
-		return VIDEO_PALETTE_RGB24;
-	} else if (!strcmp(name, "RGB32")) {
-		*bits = 32;
-		return VIDEO_PALETTE_RGB32;
-	} else if (!strcmp(name, "HI240")) {
-		*bits = 8;
-		return VIDEO_PALETTE_HI240;
-	} else if (!strcmp(name, "GREY")) {
-		*bits = 8;
-		return VIDEO_PALETTE_GREY;
-	}
-#else
-	if (!name || !bits || !rev) {}
-#endif
-	return 0;
-}
-
-static char *v4l2_lu_palette(unsigned int fmt) {
-	switch(fmt) {
-#if defined(V4L_OK) && HAVE_V4L2
-		case V4L2_PIX_FMT_RGB332:	return "RGB332";
-		case V4L2_PIX_FMT_RGB555:	return "RGB555";
-		case V4L2_PIX_FMT_RGB565:	return "RGB565";
-		case V4L2_PIX_FMT_RGB555X:	return "RGB555X";
-		case V4L2_PIX_FMT_RGB565X:	return "RGB565X";
-		case V4L2_PIX_FMT_BGR24:	return "BGR24";
-		case V4L2_PIX_FMT_RGB24:	return "RGB24";
-		case V4L2_PIX_FMT_BGR32:	return "BGR32";
-		case V4L2_PIX_FMT_RGB32:	return "RGB32";
-		case V4L2_PIX_FMT_GREY:		return "GREY";
-		case V4L2_PIX_FMT_YVU410:	return "YVU410";
-		case V4L2_PIX_FMT_YVU420:	return "YVU420";
-		case V4L2_PIX_FMT_YUYV:		return "YUYV";
-		case V4L2_PIX_FMT_UYVY:		return "UYVY";
-		case V4L2_PIX_FMT_YUV422P:	return "YUV422P";
-		case V4L2_PIX_FMT_YUV411P:	return "YUV411P";
-		case V4L2_PIX_FMT_Y41P:		return "Y41P";
-		case V4L2_PIX_FMT_NV12:		return "NV12";
-		case V4L2_PIX_FMT_NV21:		return "NV21";
-		case V4L2_PIX_FMT_YUV410:	return "YUV410";
-		case V4L2_PIX_FMT_YUV420:	return "YUV420";
-		case V4L2_PIX_FMT_YYUV:		return "YYUV";
-		case V4L2_PIX_FMT_HI240:	return "HI240";
-		case V4L2_PIX_FMT_MJPEG:	return "MJPEG";
-		case V4L2_PIX_FMT_JPEG:		return "JPEG";
-		case V4L2_PIX_FMT_DV:		return "DV";
-		case V4L2_PIX_FMT_MPEG:		return "MPEG";
-#endif
-		default:			return "unknown";
-	}
-}
-
-static unsigned int v4l2_lu_palette_str(char *name, int *bits, int *rev) {
-#if defined(V4L_OK) && HAVE_V4L2
-	if (!strcmp(name, "RGB1") || !strcmp(name, "RGB332")) {
-		*bits = 8;
-		*rev = 0;
-		return V4L2_PIX_FMT_RGB332;
-	} else if (!strcmp(name, "RGBO") || !strcmp(name, "RGB555")) {
-		*bits = 16;
-		*rev = 0;
-		return V4L2_PIX_FMT_RGB555;
-	} else if (!strcmp(name, "RGBP") || !strcmp(name, "RGB565")) {
-		*bits = 16;
-		*rev = 0;
-		return V4L2_PIX_FMT_RGB565;
-	} else if (!strcmp(name, "RGBQ") || !strcmp(name, "RGB555X")) {
-		*bits = 16;
-		*rev = 1;
-		return V4L2_PIX_FMT_RGB555X;
-	} else if (!strcmp(name, "RGBR") || !strcmp(name, "RGB565X")) {
-		*bits = 16;
-		*rev = 1;
-		return V4L2_PIX_FMT_RGB565X;
-	} else if (!strcmp(name, "BGR3") || !strcmp(name, "BGR24")) {
-		*bits = 24;
-		*rev = 1;
-		return V4L2_PIX_FMT_BGR24;
-	} else if (!strcmp(name, "RGB3") || !strcmp(name, "RGB24")) {
-		*bits = 24;
-		*rev = 0;
-		return V4L2_PIX_FMT_RGB24;
-	} else if (!strcmp(name, "BGR4") || !strcmp(name, "BGR32")) {
-		*bits = 32;
-		*rev = 1;
-		return V4L2_PIX_FMT_BGR32;
-	} else if (!strcmp(name, "RGB4") || !strcmp(name, "RGB32")) {
-		*bits = 32;
-		*rev = 0;
-		return V4L2_PIX_FMT_RGB32;
-	} else if (!strcmp(name, "GREY")) {
-		*bits = 8;
-		*rev = 0;
-		return V4L2_PIX_FMT_GREY;
-	}
-#else
-	if (!name || !bits || !rev) {}
-#endif
-	return 0;
-}
-
-static int v4l1_query(int fd, int v) {
-#ifdef V4L_OK
-	unsigned int i;
-
-	memset(&v4l1_capability, 0, sizeof(v4l1_capability));
-	memset(&v4l1_channel,    0, sizeof(v4l1_channel));
-	memset(&v4l1_tuner,      0, sizeof(v4l1_tuner));
-	memset(&v4l1_picture,    0, sizeof(v4l1_picture));
-	memset(&v4l1_window,     0, sizeof(v4l1_window));
-
-	if (v) fprintf(stderr, "\nV4L_1 query:\n");
-#ifdef VIDIOCGCAP
-	if (ioctl(fd, VIDIOCGCAP, &v4l1_capability) == -1) {
-		perror("ioctl VIDIOCGCAP");
-		fprintf(stderr, "\n");
-		return 0;
-	}
-#else
-	return 0;
-#endif
-	if (v) fprintf(stderr, "v4l-1 capability:\n");
-	if (v) fprintf(stderr, "     name:      %s\n", v4l1_capability.name);
-	if (v) fprintf(stderr, "     channels:  %d\n", v4l1_capability.channels);
-	if (v) fprintf(stderr, "     audios:    %d\n", v4l1_capability.audios);
-	if (v) fprintf(stderr, "     maxwidth:  %d\n", v4l1_capability.maxwidth);
-	if (v) fprintf(stderr, "     maxheight: %d\n", v4l1_capability.maxheight);
-	if (v) fprintf(stderr, "     minwidth:  %d\n", v4l1_capability.minwidth);
-	if (v) fprintf(stderr, "     minheight: %d\n", v4l1_capability.minheight);
-
-	for (i=0; (int) i < v4l1_capability.channels; i++) {
-		char *type = "unknown";
-		memset(&v4l1_channel, 0, sizeof(v4l1_channel));
-		v4l1_channel.channel = i;
-		if (ioctl(fd, VIDIOCGCHAN, &v4l1_channel) == -1) {
-			perror("ioctl VIDIOCGCHAN");
-			continue;
-		}
-		if (v4l1_channel.type == VIDEO_TYPE_TV) {
-			type = "TV";
-		} else if (v4l1_channel.type == VIDEO_TYPE_CAMERA) {
-			type = "CAMERA";
-		}
-		if (v) fprintf(stderr, "     channel[%d]: %s\ttuners: %d norm: %d type: %d  %s\n",
-		    i, v4l1_channel.name, v4l1_channel.tuners, v4l1_channel.norm,
-		    v4l1_channel.type, type);
-	}
-
-	memset(&v4l1_tuner, 0, sizeof(v4l1_tuner));
-	if (ioctl(fd, VIDIOCGTUNER, &v4l1_tuner) != -1) {
-		char *mode = "unknown";
-		if (v4l1_tuner.mode == VIDEO_MODE_PAL) {
-			mode = "PAL";
-		} else if (v4l1_tuner.mode == VIDEO_MODE_NTSC) {
-			mode = "NTSC";
-		} else if (v4l1_tuner.mode == VIDEO_MODE_SECAM) {
-			mode = "SECAM";
-		} else if (v4l1_tuner.mode == VIDEO_MODE_AUTO) {
-			mode = "AUTO";
-		}
-
-		if (v) fprintf(stderr, "     tuner[%d]:   %s\tflags: 0x%x mode: %s\n",
-		    v4l1_tuner.tuner, v4l1_tuner.name, v4l1_tuner.flags, mode);
-		
-	}
-
-	if (ioctl(fd, VIDIOCGPICT, &v4l1_picture) == -1) {
-		perror("ioctl VIDIOCGCHAN");
-		return 0;
-	}
-	if (v) fprintf(stderr, "v4l-1 picture:\n");
-	if (v) fprintf(stderr, "     brightness:  %d\n", v4l1_picture.brightness);
-	if (v) fprintf(stderr, "     hue:         %d\n", v4l1_picture.hue);
-	if (v) fprintf(stderr, "     colour:      %d\n", v4l1_picture.colour);
-	if (v) fprintf(stderr, "     contrast:    %d\n", v4l1_picture.contrast);
-	if (v) fprintf(stderr, "     whiteness:   %d\n", v4l1_picture.whiteness);
-	if (v) fprintf(stderr, "     depth:       %d\n", v4l1_picture.depth);
-	if (v) fprintf(stderr, "     palette:     %d  %s\n", v4l1_picture.palette,
-	    v4l1_lu_palette(v4l1_picture.palette));
-	
-	if (ioctl(fd, VIDIOCGWIN, &v4l1_window) == -1) {
-		perror("ioctl VIDIOCGWIN");
-		if (v) fprintf(stderr, "\n");
-		return 0;
-	}
-	if (v) fprintf(stderr, "v4l-1 window:\n");
-	if (v) fprintf(stderr, "     x:           %d\n", v4l1_window.x);
-	if (v) fprintf(stderr, "     y:           %d\n", v4l1_window.y);
-	if (v) fprintf(stderr, "     width:       %d\n", v4l1_window.width);
-	if (v) fprintf(stderr, "     height:      %d\n", v4l1_window.height);
-	if (v) fprintf(stderr, "     chromakey:   %d\n", v4l1_window.chromakey);
-	if (v) fprintf(stderr, "\n");
-
-	return 1;
-#else
-	if (!fd || !v) {}
-	return 0;
-#endif	/* V4L_OK */
-
-}
-static int v4l2_query(int fd, int v) {
-#if defined(V4L_OK) && HAVE_V4L2
-	unsigned int i;
-
-	memset(&v4l2_capability, 0, sizeof(v4l2_capability));
-	memset(&v4l2_input,      0, sizeof(v4l2_input));
-	memset(&v4l2_tuner,      0, sizeof(v4l2_tuner));
-	memset(&v4l2_fmtdesc,    0, sizeof(v4l2_fmtdesc));
-	memset(&v4l2_format,     0, sizeof(v4l2_format));
-
-	if (v) fprintf(stderr, "\nV4L_2 query:\n");
-#ifdef VIDIOC_QUERYCAP
-	if (ioctl(fd, VIDIOC_QUERYCAP, &v4l2_capability) == -1) {
-		perror("ioctl VIDIOC_QUERYCAP");
-		if (v) fprintf(stderr, "\n");
-		return 0;
-	}
-#else
-	return 0;
-#endif
-
-	if (v) fprintf(stderr, "v4l-2 capability:\n");
-	if (v) fprintf(stderr, "    driver:       %s\n", v4l2_capability.driver);
-	if (v) fprintf(stderr, "    card:         %s\n", v4l2_capability.card);
-	if (v) fprintf(stderr, "    bus_info:     %s\n", v4l2_capability.bus_info);
-	if (v) fprintf(stderr, "    version:      %d\n", v4l2_capability.version);
-	if (v) fprintf(stderr, "    capabilities: %u\n", v4l2_capability.capabilities);
-
-	for (i=0; ; i++) {
-		memset(&v4l2_input, 0, sizeof(v4l2_input));
-		v4l2_input.index = i;
-		if (ioctl(fd, VIDIOC_ENUMINPUT, &v4l2_input) == -1) {
-			break;
-		}
-		if (v) fprintf(stderr, "    input[%d]: %s\ttype: %d tuner: %d\n",
-		    i, v4l2_input.name, v4l2_input.type, v4l2_input.tuner);
-	}
-	if (v4l2_capability.capabilities & V4L2_CAP_TUNER) {
-		for (i=0; ; i++) {
-			memset(&v4l2_tuner, 0, sizeof(v4l2_tuner));
-			v4l2_tuner.index = i;
-			if (ioctl(fd, VIDIOC_G_TUNER, &v4l2_tuner) == -1) {
-				break;
-			}
-			if (v) fprintf(stderr, "    tuner[%d]: %s\ttype: %d\n",
-			    i, v4l2_tuner.name, v4l2_tuner.type);
-		}
-	}
-	if (v4l2_capability.capabilities & V4L2_CAP_VIDEO_CAPTURE) {
-		for (i=0; ; i++) {
-			memset(&v4l2_fmtdesc, 0, sizeof(v4l2_fmtdesc));
-			v4l2_fmtdesc.index = i;
-			v4l2_fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-			
-			if (ioctl(fd, VIDIOC_ENUM_FMT, &v4l2_fmtdesc) == -1) {
-				break;
-			}
-			if (v) fprintf(stderr, "    fmtdesc[%d]: %s\ttype: %d"
-			    " pixelformat: %d\n",
-			    i, v4l2_fmtdesc.description, v4l2_fmtdesc.type,
-			    v4l2_fmtdesc.pixelformat);
-		}
-		v4l2_format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-		if (ioctl(fd, VIDIOC_G_FMT, &v4l2_format) == -1) {
-			perror("ioctl VIDIOC_G_FMT");
-		} else {
-			if (v) fprintf(stderr, "    width:  %d\n", v4l2_format.fmt.pix.width);
-			if (v) fprintf(stderr, "    height: %d\n", v4l2_format.fmt.pix.height);
-			if (v) fprintf(stderr, "    format: %u %s\n",
-			    v4l2_format.fmt.pix.pixelformat,
-			    v4l2_lu_palette(v4l2_format.fmt.pix.pixelformat));
-		}
-	}
-
-	return 1;
-#else
-	if (!fd || !v) {}
-	return 0;
-#endif	/* V4L_OK && HAVE_V4L2 */
-
-}
-
-static int open_dev(char *dev) {
-	int dfd = -1;
-	if (! dev) {
-		return dfd;
-	}
-	dfd = open(dev, O_RDWR);
-	if (dfd < 0) {
-		rfbLog("failed to rawfb file: %s O_RDWR\n", dev);
-		rfbLogPerror("open");
-		dfd = open(dev, O_RDONLY);
-	}
-	if (dfd < 0) {
-		rfbLog("failed to rawfb file: %s\n", dev);
-		rfbLog("failed to rawfb file: %s O_RDONLY\n", dev);
-		rfbLogPerror("open");
-	}
-	return dfd;
-}
-
-static char *guess_via_v4l(char *dev, int *fd) {
-#ifdef V4L_OK
-	int dfd;
-	
-	if (*fd < 0) {
-		dfd = open_dev(dev);
-		*fd = dfd;
-	}
-	dfd = *fd;
-	if (dfd < 0) {
-		return NULL;
-	}
-	if (v4l1_cap < 0) {
-		v4l1_cap = v4l1_query(dfd, 1);
-	}
-	if (v4l2_cap < 0) {
-		v4l2_cap = v4l2_query(dfd, 1);
-	}
-
-	if (v4l2_cap) {
-#if HAVE_V4L2
-		int g_w = v4l2_format.fmt.pix.width;
-		int g_h = v4l2_format.fmt.pix.height;
-		int g_d = 0, g_rev;
-
-		if (v4l2_format.fmt.pix.pixelformat) {
-			char *str = v4l2_lu_palette(v4l2_format.fmt.pix.pixelformat);
-			if (strcmp(str, "unknown")) {
-				v4l2_lu_palette_str(str, &g_d, &g_rev);
-			}
-		}
-		
-		if (g_w > 0 && g_h > 0 && g_d > 0) {
-			char *atparms = (char *) malloc(200);
-			char *pal = v4l2_lu_palette(v4l2_format.fmt.pix.pixelformat);
-			sprintf(atparms, "%dx%dx%d", g_w, g_h, g_d);
-			if (strstr(pal, "RGB555")) {
-				strcat(atparms, ":7c00/3e0/1f");
-			}
-			*fd = dfd;
-			return atparms;
-		}
-#endif
-	}
-	if (v4l1_cap) {
-		int g_w = v4l1_window.width;
-		int g_h = v4l1_window.height;
-		int g_d = v4l1_picture.depth;
-		int g_rev;
-		if (g_d == 0) {
-			char *str = v4l1_lu_palette(v4l1_picture.palette);
-			if (strcmp(str, "unknown")) {
-				v4l1_lu_palette_str(str, &g_d, &g_rev);
-			}
-		}
-if (0) fprintf(stderr, "v4l1: %d %d %d\n", g_w, g_h, g_d);
-		if (g_w > 0 && g_h > 0 && g_d > 0) {
-			char *atparms = (char *) malloc(200);
-			char *pal = v4l1_lu_palette(v4l1_picture.palette);
-			fprintf(stderr, "palette: %s\n", pal);
-			sprintf(atparms, "%dx%dx%d", g_w, g_h, g_d);
-			if (strstr(pal, "RGB555")) {
-				strcat(atparms, ":7c00/3e0/1f");
-			}
-			*fd = dfd;
-			return atparms;
-		}
-	}
-
-	/* failure */
-	close(dfd);
-	return NULL;
-#else
-	if (!dev || !fd) {}
-	return NULL;
-#endif
-}
-
-static char *guess_via_v4l_info(char *dev, int *fd) {
-	char *atparms, *cmd;
-	char line[1024], tmp[] = "/tmp/x11vnc-tmp.XXXXXX";
-	FILE *out;
-	int tmp_fd, len, rc, curr = 0;
-	int g_w = 0, g_h = 0, g_b = 0, mask_rev = 0;
-	char *g_fmt = NULL;
-
-	if (*fd) {}
-
-	/* v4l-info */
-	if (no_external_cmds || !cmd_ok("v4l-info")) {
-		rfbLog("guess_via_v4l_info: cannot run external "
-		    "command: v4l-info\n");
-		return NULL;
-	}
-
-	if (strchr(dev, '\'')) {
-		rfbLog("guess_via_v4l_info: bad dev string: %s\n", dev);
-		return NULL;
-	}
-
-	tmp_fd = mkstemp(tmp);
-	if (tmp_fd < 0) {
-		return NULL;
-	}
-
-	len =  strlen("v4l-info")+1+1+strlen(dev)+1+1+1+1+strlen(tmp)+1; 
-	cmd = (char *) malloc(len);
-	rfbLog("guess_via_v4l_info running: v4l-info '%s'\n", dev);
-	sprintf(cmd, "v4l-info '%s' > %s", dev, tmp);
-
-	close(tmp_fd);
-	close_exec_fds();
-	rc = system(cmd);
-	if (rc != 0) {
-		unlink(tmp);
-		return NULL;
-	}
-
-	out = fopen(tmp, "r");
-	if (out == NULL) {
-		unlink(tmp);
-		return NULL;
-	}
-	
-	curr = 0;
-	while (fgets(line, 1024, out) != NULL) {
-		char *lb = lblanks(line);
-		if (strstr(line, "video capture") == line) {
-			curr = C_VIDEO_CAPTURE;
-		} else if (strstr(line, "picture") == line) {
-			curr = C_PICTURE;
-		} else if (strstr(line, "window") == line) {
-			curr = C_WINDOW;
-		}
-
-if (0) fprintf(stderr, "lb: %s", lb);
-
-		if (curr == C_VIDEO_CAPTURE) {
-			if (strstr(lb, "pixelformat ") == lb) {
-				fprintf(stderr, "%s", line);
-			} else if (strstr(lb, "fmt.pix.width ") == lb) {
-				if (! g_w) {
-					g_w = colon_n(line);
-				}
-			} else if (strstr(lb, "fmt.pix.height ") == lb) {
-				if (! g_h) {
-					g_h = colon_n(line);
-				}
-			} else if (strstr(lb, "fmt.pix.pixelformat ") == lb) {
-				if (! g_fmt) {
-					g_fmt = colon_tag(line);
-				}
-			}
-		} else if (curr == C_PICTURE) {
-			if (strstr(lb, "depth ") == lb) {
-				if (! g_b) {
-					g_b = colon_n(line);
-				}
-			} else if (strstr(lb, "palette ") == lb) {
-				if (! g_fmt) {
-					g_fmt = colon_str(line);
-				}
-			}
-		} else if (curr == C_WINDOW) {
-			if (strstr(lb, "width ") == lb) {
-				if (! g_w) {
-					g_w = colon_n(line);
-				}
-			} else if (strstr(lb, "height ") == lb) {
-				if (! g_h) {
-					g_h = colon_n(line);
-				}
-			}
-		}
-	}
-	fclose(out);
-	unlink(tmp);
-
-	if (! g_w) {
-		rfbLog("could not guess device width.\n");
-		return NULL;
-	}
-	rfbLog("guessed device width:  %d\n", g_w);
-
-	if (! g_h) {
-		rfbLog("could not guess device height.\n");
-		return NULL;
-	}
-	rfbLog("guessed device height: %d\n", g_h);
-
-	if (g_fmt) {
-		rfbLog("guessed pixel fmt:     %s\n", g_fmt);
-		lookup_rgb(g_fmt, &g_b, &mask_rev);
-	}
-	if (! g_b) {
-		rfbLog("could not guess device bpp.\n");
-		return NULL;
-	}
-	rfbLog("guessed device bpp:    %d\n", g_b);
-
-	atparms = (char *) malloc(100);
-	sprintf(atparms, "%dx%dx%d", g_w, g_h, g_b);
-	return atparms;
-}
-
-static void parse_str(char *str, char **dev, char **settings, char **atparms) {
-	char *p, *q, *s = NULL;
-
-	q = strchr(str, '@');
-	if (q && strlen(q+1) > 0) {
-		/* ends @WxHXB... */
-		*atparms = strdup(q+1);
-		*q = '\0';
-	}
-
-	q = strchr(str, ':');
-	if (q && strlen(q+1) > 0) {
-		/* ends :br=N,w=N... */
-		s = strdup(q+1);
-		*settings = s;
-		*q = '\0';
-	}
-
-	if (s != NULL) {
-		/* see if fn=filename */
-		q = strstr(s, "fn=");
-		if (q) {
-			q += strlen("fn=");
-			p = strchr(q, ',');
-			if (p) {
-				*p = '\0';
-				*dev = strdup(q); 
-				*p = ',';
-			} else {
-				*dev = strdup(q); 
-			}
-			rfbLog("set video device to: '%s'\n", *dev);
-		}
-	}
-
-	if (*dev == NULL) {
-		struct stat sbuf;
-		s = (char *) malloc(strlen("/dev/") + strlen(str) + 2);
-		if (strstr(str, "/dev/") == str) {
-			sprintf(s, "%s", str);
-		} else {
-			sprintf(s, "/dev/%s", str);
-		} 
-		rfbLog("Checking existence of '%s'\n", s);
-                if (stat(s, &sbuf) != 0) {
-			rfbLogPerror("stat");
-			strcat(s, "0");
-			rfbLog("switching to '%s'\n", s);
-		}
-                if (stat(s, &sbuf) != 0) {
-			rfbLogPerror("stat");
-			rfbLog("You will need to specify the video device more explicity.\n");
-		}
-
-		*dev = s;
-		rfbLog("set video device to: '%s'\n", *dev);
-	}
-}
-
-char *v4l_guess(char *str, int *fd) {
-	char *dev = NULL, *settings = NULL, *atparms = NULL;
-
-	parse_str(str, &dev, &settings, &atparms);
-
-	init_freqs();
-
-	v4l1_cap = -1;
-	v4l2_cap = -1;
-	*fd = -1;
-
-	if (dev == NULL) {
-		rfbLog("v4l_guess: could not find device in: %s\n", str);
-		return NULL;
-	}
-
-	if (settings) {
-		apply_settings(dev, settings, fd);
-	}
-
-	if (atparms) {
-		/* use user's parameters. */
-		char *t = (char *) malloc(5+strlen(dev)+1+strlen(atparms)+1);
-		sprintf(t, "snap:%s@%s", dev, atparms);
-		return t;
-	}
-
-	/* try to query the device for parameters. */
-	atparms = guess_via_v4l(dev, fd);
-	if (atparms == NULL) {
-		/* try again with v4l-info(1) */
-		atparms = guess_via_v4l_info(dev, fd);
-	}
-
-	if (atparms == NULL) {
-		/* bad news */
-		if (*fd >= 0) {
-			close(*fd);
-		}
-		*fd = -1;
-		return NULL;
-	} else {
-		char *t = (char *) malloc(5+strlen(dev)+1+strlen(atparms)+1);
-		sprintf(t, "snap:%s@%s", dev, atparms);
-		return t;
-	}
-}
-
-static unsigned long lookup_freqtab(int sta) {
-
-	if (sta >= CHANNEL_MAX) {
-		return (unsigned long) sta;
-	}
-	if (sta < 0 || sta >= CHANNEL_MAX) {
-		return 0;
-	}
-	return custom_freq[sta];
-}
-
-static unsigned long lookup_freq(int sta) {
-	if (freqtab) {
-		return lookup_freqtab(sta);
-	}
-	if (sta >= CHANNEL_MAX) {
-		return (unsigned long) sta;
-	}
-	if (sta < 1 || sta > 125) {
-		return 0;
-	}
-	return ntsc_cable[sta];
-}
-
-static int lookup_station(unsigned long freq) {
-	int i;
-	if (freqtab) {
-		for (i = 0; i < CHANNEL_MAX; i++) {
-if (0) fprintf(stderr, "%lu %lu\n", freq, custom_freq[i]);
-			if (freq == custom_freq[i]) {
-				return i;
-			}
-		}
-	} else {
-		for (i = 1; i <= 125; i++) {
-			if (freq == ntsc_cable[i]) {
-				return i;
-			}
-		}
-	}
-	return 0;
-}
-
-static void init_freqtab(char *file) {
-	char *p, *q, *dir, *file2;
-	char line[1024], inc[1024];
-	char *text, *str;
-	int size = 0, maxn, extra, currn;
-	FILE *in1, *in2;
-	static int v = 1;
-	if (quiet) {
-		v = 0;
-	}
-
-	/* YUCK */
-
-	dir = strdup(file);
-	q = strrchr(dir, '/');
-	if (q) {
-		*(q+1) = '\0';
-	} else {
-		free(dir);
-		dir = strdup("./");
-	}
-	file2 = (char *) malloc(strlen(dir) + 1024 + 1);
-	in1 = fopen(file, "r");
-	if (in1 == NULL) {
-		rfbLog("error opening freqtab: %s\n", file);
-		clean_up_exit(1);
-	}
-	if (v) fprintf(stderr, "loading frequencies from: %s\n", file);
-	while (fgets(line, 1024, in1) != NULL) {
-		char *lb;
-		char line2[1024];
-		size += strlen(line);
-		lb = lblanks(line);
-		if (strstr(lb, "#include") == lb && 
-		    sscanf(lb, "#include %s", inc) == 1) {
-			char *q, *s = inc;
-			if (s[0] == '"') {
-				s++;
-			}
-			q = strrchr(s, '"');
-			if (q) {
-				*q = '\0';
-			}
-			sprintf(file2, "%s%s", dir, s);
-			in2 = fopen(file2, "r");
-			if (in2 == NULL) {
-				rfbLog("error opening freqtab include: %s %s\n", line, file2);
-				clean_up_exit(1);
-			}
-			if (v) fprintf(stderr, "loading frequencies from: %s\n", file2);
-			while (fgets(line2, 1024, in2) != NULL) {
-				size += strlen(line2);
-			}
-			fclose(in2);
-		}
-	}
-	fclose(in1);
-
-	size = 4*(size + 10000);
-
-	text = (char *) malloc(size);
-
-	text[0] = '\0';
-
-	in1 = fopen(file, "r");
-	if (in1 == NULL) {
-		rfbLog("error opening freqtab: %s\n", file);
-		clean_up_exit(1);
-	}
-	while (fgets(line, 1024, in1) != NULL) {
-		char *lb;
-		char line2[1024];
-		lb = lblanks(line);
-		if (lb[0] == '[') {
-			strcat(text, lb);
-		} else if (strstr(lb, "freq")) {
-			strcat(text, lb);
-		} else if (strstr(lb, "#include") == lb && 
-		    sscanf(lb, "#include %s", inc) == 1) {
-			char *lb2;
-			char *q, *s = inc;
-			if (s[0] == '"') {
-				s++;
-			}
-			q = strrchr(s, '"');
-			if (q) {
-				*q = '\0';
-			}
-			sprintf(file2, "%s%s", dir, s);
-			in2 = fopen(file2, "r");
-			if (in2 == NULL) {
-				rfbLog("error opening freqtab include: %s %s\n", line, file2);
-				clean_up_exit(1);
-			}
-			while (fgets(line2, 1024, in2) != NULL) {
-				lb2 = lblanks(line2);
-				if (lb2[0] == '[') {
-					strcat(text, lb2);
-				} else if (strstr(lb2, "freq")) {
-					strcat(text, lb2);
-				}
-				if ((int) strlen(text) > size/2) {
-					break;
-				}
-			}
-			fclose(in2);
-		}
-		if ((int) strlen(text) > size/2) {
-			break;
-		}
-	}
-	fclose(in1);
-
-	if (0) fprintf(stderr, "%s", text);
-
-	str = strdup(text);
-	p = strtok(str, "\n");
-	maxn = -1;
-	extra = 0;
-	while (p) {
-		if (p[0] == '[') {
-			int ok = 1;
-			q = p+1;	
-			while (*q) {
-				if (*q == ']') {
-					break;
-				}
-				if (! isdigit((unsigned char) (*q))) {
-					if (0) fprintf(stderr, "extra: %s\n", p);
-					extra++;
-					ok = 0;
-					break;
-				}
-				q++;
-			}
-			if (ok) {
-				int n;
-				if (sscanf(p, "[%d]", &n) == 1)  {
-					if (n > maxn) {
-						maxn = n;
-					}
-					if (0) fprintf(stderr, "maxn:  %d %d\n", maxn, n);
-				}
-			}
-			
-		}
-		p = strtok(NULL, "\n");
-	}
-	free(str);
-
-	str = strdup(text);
-	p = strtok(str, "\n");
-	extra = 0;
-	currn = 0;
-	if (v) fprintf(stderr, "\nname\tstation\tfreq (KHz)\n");
-	while (p) {
-		if (p[0] == '[') {
-			int ok = 1;
-			strncpy(line, p, 100);
-			q = p+1;	
-			while (*q) {
-				if (*q == ']') {
-					break;
-				}
-				if (! isdigit((unsigned char) (*q))) {
-					extra++;
-					currn = maxn + extra;
-					ok = 0;
-					break;
-				}
-				q++;
-			}
-			if (ok) {
-				int n;
-				if (sscanf(p, "[%d]", &n) == 1)  {
-					currn = n;
-				}
-			}
-		}
-		if (strstr(p, "freq") && (q = strchr(p, '=')) != NULL) {
-			int n;
-			q = lblanks(q+1);
-			if (sscanf(q, "%d", &n) == 1) {
-				if (currn >= 0 && currn < CHANNEL_MAX) {
-					if (v) fprintf(stderr, "%s\t%d\t%d\n", line, currn, n);
-					custom_freq[currn] = (unsigned long) n;
-					if (last_freq == 0) {
-						last_freq = custom_freq[currn];
-					}
-				}
-			}
-		}
-		p = strtok(NULL, "\n");
-	}
-	if (v) fprintf(stderr, "\n");
-	v = 0;
-	free(str);
-	free(text);
-	free(dir);
-	free(file2);
-}
-
-static void init_freqs(void) {
-	int i;
-	for (i=0; i<CHANNEL_MAX; i++) {
-		ntsc_cable[i] = 0;
-		custom_freq[i] = 0;
-	}
-
-	init_ntsc_cable();
-	last_freq = ntsc_cable[1];
-
-	if (freqtab) {
-		init_freqtab(freqtab);
-	}
-}
-
-static void init_ntsc_cable(void) {
-	ntsc_cable[1] = 73250;
-	ntsc_cable[2] = 55250;
-	ntsc_cable[3] = 61250;
-	ntsc_cable[4] = 67250;
-	ntsc_cable[5] = 77250;
-	ntsc_cable[6] = 83250;
-	ntsc_cable[7] = 175250;
-	ntsc_cable[8] = 181250;
-	ntsc_cable[9] = 187250;
-	ntsc_cable[10] = 193250;
-	ntsc_cable[11] = 199250;
-	ntsc_cable[12] = 205250;
-	ntsc_cable[13] = 211250;
-	ntsc_cable[14] = 121250;
-	ntsc_cable[15] = 127250;
-	ntsc_cable[16] = 133250;
-	ntsc_cable[17] = 139250;
-	ntsc_cable[18] = 145250;
-	ntsc_cable[19] = 151250;
-	ntsc_cable[20] = 157250;
-	ntsc_cable[21] = 163250;
-	ntsc_cable[22] = 169250;
-	ntsc_cable[23] = 217250;
-	ntsc_cable[24] = 223250;
-	ntsc_cable[25] = 229250;
-	ntsc_cable[26] = 235250;
-	ntsc_cable[27] = 241250;
-	ntsc_cable[28] = 247250;
-	ntsc_cable[29] = 253250;
-	ntsc_cable[30] = 259250;
-	ntsc_cable[31] = 265250;
-	ntsc_cable[32] = 271250;
-	ntsc_cable[33] = 277250;
-	ntsc_cable[34] = 283250;
-	ntsc_cable[35] = 289250;
-	ntsc_cable[36] = 295250;
-	ntsc_cable[37] = 301250;
-	ntsc_cable[38] = 307250;
-	ntsc_cable[39] = 313250;
-	ntsc_cable[40] = 319250;
-	ntsc_cable[41] = 325250;
-	ntsc_cable[42] = 331250;
-	ntsc_cable[43] = 337250;
-	ntsc_cable[44] = 343250;
-	ntsc_cable[45] = 349250;
-	ntsc_cable[46] = 355250;
-	ntsc_cable[47] = 361250;
-	ntsc_cable[48] = 367250;
-	ntsc_cable[49] = 373250;
-	ntsc_cable[50] = 379250;
-	ntsc_cable[51] = 385250;
-	ntsc_cable[52] = 391250;
-	ntsc_cable[53] = 397250;
-	ntsc_cable[54] = 403250;
-	ntsc_cable[55] = 409250;
-	ntsc_cable[56] = 415250;
-	ntsc_cable[57] = 421250;
-	ntsc_cable[58] = 427250;
-	ntsc_cable[59] = 433250;
-	ntsc_cable[60] = 439250;
-	ntsc_cable[61] = 445250;
-	ntsc_cable[62] = 451250;
-	ntsc_cable[63] = 457250;
-	ntsc_cable[64] = 463250;
-	ntsc_cable[65] = 469250;
-	ntsc_cable[66] = 475250;
-	ntsc_cable[67] = 481250;
-	ntsc_cable[68] = 487250;
-	ntsc_cable[69] = 493250;
-	ntsc_cable[70] = 499250;
-	ntsc_cable[71] = 505250;
-	ntsc_cable[72] = 511250;
-	ntsc_cable[73] = 517250;
-	ntsc_cable[74] = 523250;
-	ntsc_cable[75] = 529250;
-	ntsc_cable[76] = 535250;
-	ntsc_cable[77] = 541250;
-	ntsc_cable[78] = 547250;
-	ntsc_cable[79] = 553250;
-	ntsc_cable[80] = 559250;
-	ntsc_cable[81] = 565250;
-	ntsc_cable[82] = 571250;
-	ntsc_cable[83] = 577250;
-	ntsc_cable[84] = 583250;
-	ntsc_cable[85] = 589250;
-	ntsc_cable[86] = 595250;
-	ntsc_cable[87] = 601250;
-	ntsc_cable[88] = 607250;
-	ntsc_cable[89] = 613250;
-	ntsc_cable[90] = 619250;
-	ntsc_cable[91] = 625250;
-	ntsc_cable[92] = 631250;
-	ntsc_cable[93] = 637250;
-	ntsc_cable[94] = 643250;
-	ntsc_cable[95] = 91250;
-	ntsc_cable[96] = 97250;
-	ntsc_cable[97] = 103250;
-	ntsc_cable[98] = 109250;
-	ntsc_cable[99] = 115250;
-	ntsc_cable[100] = 649250;
-	ntsc_cable[101] = 655250;
-	ntsc_cable[102] = 661250;
-	ntsc_cable[103] = 667250;
-	ntsc_cable[104] = 673250;
-	ntsc_cable[105] = 679250;
-	ntsc_cable[106] = 685250;
-	ntsc_cable[107] = 691250;
-	ntsc_cable[108] = 697250;
-	ntsc_cable[109] = 703250;
-	ntsc_cable[110] = 709250;
-	ntsc_cable[111] = 715250;
-	ntsc_cable[112] = 721250;
-	ntsc_cable[113] = 727250;
-	ntsc_cable[114] = 733250;
-	ntsc_cable[115] = 739250;
-	ntsc_cable[116] = 745250;
-	ntsc_cable[117] = 751250;
-	ntsc_cable[118] = 757250;
-	ntsc_cable[119] = 763250;
-	ntsc_cable[120] = 769250;
-	ntsc_cable[121] = 775250;
-	ntsc_cable[122] = 781250;
-	ntsc_cable[123] = 787250;
-	ntsc_cable[124] = 793250;
-	ntsc_cable[125] = 799250;
-}
-
diff --git a/ica/x11/x11vnc/v4l.h b/ica/x11/x11vnc/v4l.h
deleted file mode 100644
index 1cae722..0000000
--- a/ica/x11/x11vnc/v4l.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_V4L_H
-#define _X11VNC_V4L_H
-
-/* -- v4l.h -- */
-extern char *v4l_guess(char *str, int *fd);
-extern void v4l_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client);
-extern void v4l_pointer_command(int mask, int x, int y, rfbClientPtr client);
-
-
-#endif /* _X11VNC_V4L_H */
diff --git a/ica/x11/x11vnc/win_utils.c b/ica/x11/x11vnc/win_utils.c
deleted file mode 100644
index 7aa9b4c..0000000
--- a/ica/x11/x11vnc/win_utils.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- win_utils.c -- */
-
-#include "x11vnc.h"
-#include "xinerama.h"
-#include "winattr_t.h"
-#include "cleanup.h"
-#include "xwrappers.h"
-#include "connections.h"
-#include "xrandr.h"
-#include "macosx.h"
-
-winattr_t *stack_list = NULL;
-int stack_list_len = 0;
-int stack_list_num = 0;
-
-
-Window parent_window(Window win, char **name);
-int valid_window(Window win, XWindowAttributes *attr_ret, int bequiet);
-Bool xtranslate(Window src, Window dst, int src_x, int src_y, int *dst_x,
-    int *dst_y, Window *child, int bequiet);
-int get_window_size(Window win, int *w, int *h);
-void snapshot_stack_list(int free_only, double allowed_age);
-int get_boff(void);
-int get_bwin(void);
-void update_stack_list(void);
-Window query_pointer(Window start);
-unsigned int mask_state(void);
-int pick_windowid(unsigned long *num);
-Window descend_pointer(int depth, Window start, char *name_info, int len);
-void id_cmd(char *cmd);
-
-
-Window parent_window(Window win, char **name) {
-#if !NO_X11
-	Window r, parent;
-	Window *list;
-	XErrorHandler old_handler;
-	unsigned int nchild;
-	int rc;
-#endif
-
-	if (name != NULL) {
-		*name = NULL;
-	}
-	RAWFB_RET(None)
-#if NO_X11
-	nox11_exit(1);
-	if (!name || !win) {}
-	return None;
-#else
-
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-	rc = XQueryTree_wr(dpy, win, &r, &parent, &list, &nchild);
-	XSetErrorHandler(old_handler);
-
-	if (! rc || trapped_xerror) {
-		trapped_xerror = 0;
-		return None;
-	}
-	trapped_xerror = 0;
-
-	if (list) {
-		XFree_wr(list);
-	}
-	if (parent && name) {
-		XFetchName(dpy, parent, name);
-	}
-	return parent;
-#endif	/* NO_X11 */
-}
-
-/* trapping utility to check for a valid window: */
-int valid_window(Window win, XWindowAttributes *attr_ret, int bequiet) {
-	XWindowAttributes attr, *pattr;
-#if !NO_X11
-	XErrorHandler old_handler;
-	int ok = 0;
-#endif
-
-	if (attr_ret == NULL) {
-		pattr = &attr;
-	} else {
-		pattr = attr_ret;
-	}
-
-	if (win == None) {
-		return 0;
-	}
-
-#ifdef MACOSX
-	if (macosx_console) {
-		return macosx_valid_window(win, attr_ret);
-	}
-#endif
-
-	RAWFB_RET(0)
-
-#if NO_X11
-	nox11_exit(1);
-	if (!win || !attr_ret || !bequiet) {}
-	return 0;
-#else
-
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-	if (XGetWindowAttributes(dpy, win, pattr)) {
-		ok = 1;
-	}
-	if (trapped_xerror && trapped_xerror_event) {
-		if (! quiet && ! bequiet) {
-			rfbLog("valid_window: trapped XError: %s (0x%lx)\n",
-			    xerror_string(trapped_xerror_event), win);
-		}
-		ok = 0;
-	}
-	XSetErrorHandler(old_handler);
-	trapped_xerror = 0;
-	
-	return ok;
-#endif	/* NO_X11 */
-}
-
-Bool xtranslate(Window src, Window dst, int src_x, int src_y, int *dst_x,
-    int *dst_y, Window *child, int bequiet) {
-	XErrorHandler old_handler = NULL;
-	Bool ok = False;
-
-	RAWFB_RET(False)
-#if NO_X11
-	nox11_exit(1);
-	if (!src || !dst || !src_x || !src_y || !dst_x || !dst_y || !child || !bequiet) {}
-	if (!old_handler || !ok) {}
-	return False;
-#else
-
-	trapped_xerror = 0;
-	old_handler = XSetErrorHandler(trap_xerror);
-	if (XTranslateCoordinates(dpy, src, dst, src_x, src_y, dst_x,
-	    dst_y, child)) {
-		ok = True;
-	}
-	if (trapped_xerror && trapped_xerror_event) {
-		if (! quiet && ! bequiet) {
-			rfbLog("xtranslate: trapped XError: %s (0x%lx)\n",
-			    xerror_string(trapped_xerror_event), src);
-		}
-		ok = False;
-	}
-	XSetErrorHandler(old_handler);
-	trapped_xerror = 0;
-	
-	return ok;
-#endif	/* NO_X11 */
-}
-
-int get_window_size(Window win, int *w, int *h) {
-	XWindowAttributes attr;
-	/* valid_window? */
-	if (valid_window(win, &attr, 1)) {
-		*w = attr.width;
-		*h = attr.height;
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-/*
- * For use in the -wireframe stuff, save the stacking order of the direct
- * children of the root window.  Ideally done before we send ButtonPress
- * to the X server.
- */
-void snapshot_stack_list(int free_only, double allowed_age) {
-	static double last_snap = 0.0, last_free = 0.0;
-	double now; 
-	int num, rc, i, j;
-	unsigned int ui;
-	Window r, w;
-	Window *list;
-
-	if (! stack_list) {
-		stack_list = (winattr_t *) malloc(256*sizeof(winattr_t));
-		stack_list_num = 0;
-		stack_list_len = 256;
-	}
-
-	dtime0(&now);
-	if (free_only) {
-		/* we really don't free it, just reset to zero windows */
-		stack_list_num = 0;
-		last_free = now;
-		return;
-	}
-
-	if (stack_list_num && now < last_snap + allowed_age) {
-		return;
-	}
-
-	stack_list_num = 0;
-	last_free = now;
-
-#ifdef MACOSX
-	if (! macosx_console) {
-		RAWFB_RET_VOID
-	}
-#else
-	RAWFB_RET_VOID
-#endif
-
-#if NO_X11 && !defined(MACOSX)
-	num = rc = i = j = 0;	/* compiler warnings */
-	ui = 0;
-	r = w = None;
-	list = NULL;
-	return;
-#else
-
-	X_LOCK;
-	/* no need to trap error since rootwin */
-	rc = XQueryTree_wr(dpy, rootwin, &r, &w, &list, &ui);
-	num = (int) ui;
-
-	if (! rc) {
-		stack_list_num = 0;
-		last_free = now;
-		last_snap = 0.0;
-		X_UNLOCK;
-		return;
-	}
-
-	last_snap = now;
-	if (num > stack_list_len + blackouts) {
-		int n = 2*num;
-		free(stack_list);
-		stack_list = (winattr_t *) malloc(n*sizeof(winattr_t));
-		stack_list_len = n;
-	}
-	j = 0;
-	for (i=0; i<num; i++) {
-		stack_list[j].win = list[i];
-		stack_list[j].fetched = 0;
-		stack_list[j].valid = 0;
-		stack_list[j].time = now;
-		j++;
-	}
-	for (i=0; i<blackouts; i++) {
-		stack_list[j].win = get_boff() + 1;
-		stack_list[j].fetched = 1;
-		stack_list[j].valid = 1;
-		stack_list[j].x = blackr[i].x1;
-		stack_list[j].y = blackr[i].y1;
-		stack_list[j].width  = blackr[i].x2 - blackr[i].x1;
-		stack_list[j].height = blackr[i].y2 - blackr[i].y1;
-		stack_list[j].time = now;
-		stack_list[j].map_state = IsViewable;
-		stack_list[j].rx = -1;
-		stack_list[j].ry = -1;
-		j++;
-
-if (0) fprintf(stderr, "blackr: %d %dx%d+%d+%d\n", i,
-	stack_list[j-1].width, stack_list[j-1].height,
-	stack_list[j-1].x, stack_list[j-1].y);
-
-	}
-	stack_list_num = num + blackouts;
-	if (debug_wireframe > 1) {
-		fprintf(stderr, "snapshot_stack_list: num=%d len=%d\n",
-		    stack_list_num, stack_list_len);
-	}
-
-	XFree_wr(list);
-	X_UNLOCK;
-#endif	/* NO_X11 */
-}
-
-int get_boff(void) {
-	if (macosx_console) {
-		return 0x1000000;
-	} else {
-		return 0;		
-	}
-}
-
-int get_bwin(void) {
-	return 10;		
-}
-
-void update_stack_list(void) {
-	int k;
-	double now;
-	XWindowAttributes attr;
-	int boff, bwin;
-
-	if (! stack_list) {
-		return;
-	}
-	if (! stack_list_num) {
-		return;
-	}
-
-	dtime0(&now);
-
-	boff = get_boff();
-	bwin = get_bwin();
-	
-	X_LOCK;
-	for (k=0; k < stack_list_num; k++) {
-		Window win = stack_list[k].win;
-		if (win != None && boff <= (int) win && (int) win < boff + bwin) {
-			;	/* special, blackout */
-		} else if (!valid_window(win, &attr, 1)) {
-			stack_list[k].valid = 0;
-		} else {
-			stack_list[k].valid = 1;
-			stack_list[k].x = attr.x;
-			stack_list[k].y = attr.y;
-			stack_list[k].width = attr.width;
-			stack_list[k].height = attr.height;
-			stack_list[k].border_width = attr.border_width;
-			stack_list[k].depth = attr.depth;
-			stack_list[k].class = attr.class;
-			stack_list[k].backing_store = attr.backing_store;
-			stack_list[k].map_state = attr.map_state;
-
-			/* root_x, root_y not used for stack_list usage: */
-			stack_list[k].rx = -1;
-			stack_list[k].ry = -1;
-		}
-		stack_list[k].fetched = 1;
-		stack_list[k].time = now;
-	}
-	X_UNLOCK;
-if (0) fprintf(stderr, "update_stack_list[%d]: %.4f  %.4f\n", stack_list_num, now - x11vnc_start, dtime(&now));
-}
-
-Window query_pointer(Window start) {
-	int rx, ry;
-#if !NO_X11
-	Window r, c;	/* compiler warnings */
-	int wx, wy;
-	unsigned int mask;
-#endif
-
-#ifdef MACOSX
-	if (macosx_console) {
-		macosx_get_cursor_pos(&rx, &ry);
-	}
-#endif
-
-	RAWFB_RET(None)
-
-#if NO_X11
-	if (!start) { rx = ry = 0; }
-	return None;
-#else
-	if (start == None) {
-		start = rootwin;
-	}
-	if (XQueryPointer_wr(dpy, start, &r, &c, &rx, &ry, &wx, &wy, &mask)) {
-		return c;
-	} else {
-		return None;
-	}
-#endif	/* NO_X11 */
-}
-
-unsigned int mask_state(void) {
-#if NO_X11
-	RAWFB_RET(0)
-	return 0;
-#else
-	Window r, c;	
-	int rx, ry, wx, wy;
-	unsigned int mask;
-
-	RAWFB_RET(0)
-
-	if (XQueryPointer_wr(dpy, rootwin, &r, &c, &rx, &ry, &wx, &wy, &mask)) {
-		return mask;
-	} else {
-		return 0;
-	}
-#endif	/* NO_X11 */
-}
-
-int pick_windowid(unsigned long *num) {
-	char line[512];
-	int ok = 0, n = 0, msec = 10, secmax = 15;
-	FILE *p;
-
-	RAWFB_RET(0)
-
-	if (use_dpy) {
-		set_env("DISPLAY", use_dpy);
-	}
-	/* id */
-	if (no_external_cmds || !cmd_ok("id")) {
-		rfbLogEnable(1);
-		rfbLog("cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", "xwininfo");
-		rfbLog("   exiting.\n");
-		clean_up_exit(1);
-	}
-	close_exec_fds();
-	p = popen("xwininfo", "r");
-
-	if (! p) {
-		return 0;
-	}
-
-	fprintf(stderr, "\n");
-	fprintf(stderr, "  Please select the window for x11vnc to poll\n");
-	fprintf(stderr, "  by clicking the mouse in that window.\n");
-	fprintf(stderr, "\n");
-
-	while (msec * n++ < 1000 * secmax) {
-		unsigned long tmp;
-		char *q;
-		fd_set set;
-		struct timeval tv;
-
-		if (screen && screen->clientHead) {
-			/* they may be doing the pointer-pick thru vnc: */
-			int nfds;
-			tv.tv_sec = 0;
-			tv.tv_usec = msec * 1000;
-			FD_ZERO(&set);
-			FD_SET(fileno(p), &set);
-
-			nfds = select(fileno(p)+1, &set, NULL, NULL, &tv);
-			
-			if (nfds == 0 || nfds < 0) {
-				/* 
-				 * select timedout or error.
-				 * note this rfbPE takes about 30ms too:
-				 */
-				rfbPE(-1);
-				XFlush_wr(dpy);
-				continue;
-			}
-		}
-		
-		if (fgets(line, 512, p) == NULL) {
-			break;
-		}
-		q = strstr(line, " id: 0x"); 
-		if (q) {
-			q += 5;
-			if (sscanf(q, "0x%lx ", &tmp) == 1) {
-				ok = 1;
-				*num = tmp;
-				fprintf(stderr, "  Picked: 0x%lx\n\n", tmp);
-				break;
-			}
-		}
-	}
-	pclose(p);
-	return ok;
-}
-
-Window descend_pointer(int depth, Window start, char *name_info, int len) {
-#if NO_X11
-	RAWFB_RET(None)
-	if (!depth || !start || !name_info || !len) {}
-	return None;
-#else
-	Window r, c, clast = None;
-	int i, rx, ry, wx, wy;
-	int written = 0, filled = 0;
-	char *store = NULL;
-	unsigned int m;
-	static XClassHint *classhint = NULL;
-	static char *nm_cache = NULL;
-	static int nm_cache_len = 0;
-	static Window prev_start = None;
-
-	RAWFB_RET(None)
-
-	if (! classhint) {
-		classhint = XAllocClassHint();
-	}
-
-	if (! nm_cache) {
-		nm_cache = (char *) malloc(1024);
-		nm_cache_len = 1024;
-		nm_cache[0] = '\0';
-	}
-	if (name_info && nm_cache_len < len) {
-		if (nm_cache) {
-			free(nm_cache);
-		}
-		nm_cache_len = 2*len;
-		nm_cache = (char *) malloc(nm_cache_len);
-	}
-
-	if (name_info) {
-		if (start != None && start == prev_start) {
-			store = NULL;
-			strncpy(name_info, nm_cache, len);
-		} else {
-			store = name_info;
-			name_info[0] = '\0';
-		}
-	}
-
-	if (start != None) {
-		c = start;
-		if (name_info) {
-			prev_start = start;
-		}
-	} else {
-		c = rootwin;	
-	}
-
-	for (i=0; i<depth; i++) {
-		clast = c;
-		if (store && ! filled) {
-			char *name;
-			if (XFetchName(dpy, clast, &name) && name != NULL) {
-				int l = strlen(name);
-				if (written + l+2 < len) {
-					strcat(store, "^^");
-					written += 2;
-					strcat(store, name);
-					written += l;
-				} else {
-					filled = 1;
-				}
-				XFree_wr(name);
-			}
-		}
-		if (store && classhint && ! filled) {
-			classhint->res_name = NULL;
-			classhint->res_class = NULL;
-			if (XGetClassHint(dpy, clast, classhint)) {
-				int l = 0;
-				if (classhint->res_class) {
-					l += strlen(classhint->res_class); 
-				}
-				if (classhint->res_name) {
-					l += strlen(classhint->res_name); 
-				}
-				if (written + l+4 < len) {
-					strcat(store, "##");
-					if (classhint->res_class) {
-						strcat(store,
-						    classhint->res_class);
-					}
-					strcat(store, "++");
-					if (classhint->res_name) {
-						strcat(store,
-						    classhint->res_name);
-					}
-					written += l+4;
-				} else {
-					filled = 1;
-				}
-				if (classhint->res_class) {
-					XFree_wr(classhint->res_class);
-				}
-				if (classhint->res_name) {
-					XFree_wr(classhint->res_name);
-				}
-			}
-		}
-		if (! XQueryPointer_wr(dpy, c, &r, &c, &rx, &ry, &wx, &wy, &m)) {
-			break;
-		}
-		if (! c) {
-			break;
-		}
-	}
-	if (start != None && name_info) {
-		strncpy(nm_cache, name_info, nm_cache_len);
-	}
-
-	return clast;
-#endif	/* NO_X11 */
-}
-
-void id_cmd(char *cmd) {
-	int rc, dx = 0, dy = 0, dw = 0, dh = 0;
-	int x0, y0, w0, h0;
-	int x, y, w, h, do_move = 0, do_resize = 0;
-	int disp_x = DisplayWidth(dpy, scr);
-	int disp_y = DisplayHeight(dpy, scr);
-	Window win = subwin;
-	XWindowAttributes attr;
-	XErrorHandler old_handler = NULL;
-	Window twin;
-
-	if (!cmd || !strcmp(cmd, "")) { 
-		return;
-	}
-	if (strstr(cmd, "win=") == cmd) {
-		if (! scan_hexdec(cmd + strlen("win="), &win)) {
-			rfbLog("id_cmd: incorrect win= hex/dec number: %s\n", cmd);
-			return;
-		} else {
-			char *q = strchr(cmd, ':');
-			if (!q) {
-				rfbLog("id_cmd: incorrect win=...: hex/dec number: %s\n", cmd);
-				return;
-			}
-			rfbLog("id_cmd:%s set window id to 0x%lx\n", cmd, win);
-			cmd = q+1;
-		}
-	}
-	if (!win) {
-		rfbLog("id_cmd:%s not in sub-window mode or no win=0xNNNN.\n", cmd);
-		return;
-	}
-#if !NO_X11
-	X_LOCK;
-	if (!valid_window(win, &attr, 1)) {
-		X_UNLOCK;
-		return;
-	}
-	w0 = w = attr.width;
-	h0 = h = attr.height;
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-	XTranslateCoordinates(dpy, win, rootwin, 0, 0, &x, &y, &twin);
-	x0 = x;
-	y0 = y;
-	if (strstr(cmd, "move:") == cmd) {
-		if (sscanf(cmd, "move:%d%d", &dx, &dy) == 2) {
-			x = x + dx;
-			y = y + dy;
-			do_move = 1;
-		}
-	} else if (strstr(cmd, "resize:") == cmd) {
-		if (sscanf(cmd, "resize:%d%d", &dw, &dh) == 2) {
-			w = w + dw;
-			h = h + dh;
-			do_move = 1;
-			do_resize = 1;
-		}
-	} else if (strstr(cmd, "geom:") == cmd) {
-		if (parse_geom(cmd+strlen("geom:"), &w, &h, &x, &y, disp_x, disp_y)) {
-			do_move = 1;
-			do_resize = 1;
-			if (w <= 0) {
-				w = w0;
-			}
-			if (h <= 0) {
-				h = h0;
-			}
-			if (scaling && getenv("X11VNC_APPSHARE_ACTIVE")) {
-				x /= scale_fac_x;
-				y /= scale_fac_y;
-			}
-		}
-	} else if (!strcmp(cmd, "raise")) {
-		rc = XRaiseWindow(dpy, win);
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (!strcmp(cmd, "lower")) {
-		rc = XLowerWindow(dpy, win);
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (!strcmp(cmd, "map")) {
-		rc= XMapRaised(dpy, win);
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (!strcmp(cmd, "unmap")) {
-		rc= XUnmapWindow(dpy, win);
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (!strcmp(cmd, "iconify")) {
-		rc= XIconifyWindow(dpy, win, scr);
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (strstr(cmd, "wm_name:") == cmd) {
-		rc= XStoreName(dpy, win, cmd+strlen("wm_name:"));
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (strstr(cmd, "icon_name:") == cmd) {
-		rc= XSetIconName(dpy, win, cmd+strlen("icon_name:"));
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else if (!strcmp(cmd, "wm_delete")) {
-		XClientMessageEvent ev;
-		memset(&ev, 0, sizeof(ev));
-		ev.type = ClientMessage;
-		ev.send_event = True;
-		ev.display = dpy;
-		ev.window = win;
-		ev.message_type = XInternAtom(dpy, "WM_PROTOCOLS", False);
-		ev.format = 32;
-		ev.data.l[0] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-		rc = XSendEvent(dpy, win, False, 0, (XEvent *) &ev);
-		rfbLog("id_cmd:%s rc=%d\n", cmd, rc);
-	} else {
-		rfbLog("id_cmd:%s unrecognized command.\n", cmd);
-	}
-	if (do_move || do_resize) {
-		if (w >= disp_x) {
-			w = disp_x - 4;
-		}
-		if (h >= disp_y) {
-			h = disp_y - 4;
-		}
-		if (w < 1) {
-			w = 1;
-		}
-		if (h < 1) {
-			h = 1;
-		}
-		if (x + w > disp_x) {
-			x = disp_x - w - 1;
-		}
-		if (y + h > disp_y) {
-			y = disp_y - h - 1;
-		}
-		if (x < 0) {
-			x = 1;
-		}
-		if (y < 0) {
-			y = 1;
-		}
-		rc = 0;
-		rc += XMoveWindow(dpy, win, x, y);
-		off_x = x;
-		off_y = y;
-
-		rc += XResizeWindow(dpy, win, w, h);
-
-		rfbLog("id_cmd:%s rc=%d dx=%d dy=%d dw=%d dh=%d %dx%d+%d+%d -> %dx%d+%d+%d\n",
-		    cmd, rc, dx, dy, dw, dh, w0, h0, x0, y0, w, h, x, h);
-	}
-	XSync(dpy, False);
-	XSetErrorHandler(old_handler);
-	if (trapped_xerror) {
-		rfbLog("id_cmd:%s trapped_xerror.\n", cmd);
-	}
-	trapped_xerror = 0;
-	if (do_resize) {
-		rfbLog("id_cmd:%s calling check_xrandr_event.\n", cmd);
-		check_xrandr_event("id_cmd");
-	}
-	X_UNLOCK;
-#endif
-}
-
diff --git a/ica/x11/x11vnc/win_utils.h b/ica/x11/x11vnc/win_utils.h
deleted file mode 100644
index 0b99165..0000000
--- a/ica/x11/x11vnc/win_utils.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_WIN_UTILS_H
-#define _X11VNC_WIN_UTILS_H
-
-/* -- win_utils.h -- */
-#include "xinerama.h"
-#include "winattr_t.h"
-
-extern winattr_t *stack_list;
-extern int stack_list_len;
-extern int stack_list_num;
-
-extern Window parent_window(Window win, char **name);
-extern int valid_window(Window win, XWindowAttributes *attr_ret, int bequiet);
-extern Bool xtranslate(Window src, Window dst, int src_x, int src_y, int *dst_x,
-    int *dst_y, Window *child, int bequiet);
-extern int get_window_size(Window win, int *w, int *h);
-extern void snapshot_stack_list(int free_only, double allowed_age);
-extern int get_boff(void);
-extern int get_bwin(void);
-extern void update_stack_list(void);
-extern Window query_pointer(Window start);
-extern unsigned int mask_state(void);
-extern int pick_windowid(unsigned long *num);
-extern Window descend_pointer(int depth, Window start, char *name_info, int len);
-extern void id_cmd(char *cmd);
-
-#endif /* _X11VNC_WIN_UTILS_H */
diff --git a/ica/x11/x11vnc/winattr_t.h b/ica/x11/x11vnc/winattr_t.h
deleted file mode 100644
index 24ea81b..0000000
--- a/ica/x11/x11vnc/winattr_t.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_WINATTR_T_H
-#define _X11VNC_WINATTR_T_H
-
-/* -- winattr_t.h -- */
-
-typedef struct winattr {
-	Window win;
-	int fetched;
-	int valid;
-	int x, y;
-	int width, height;
-	int border_width;
-	int depth;
-	int class;
-	int backing_store;
-	int map_state;
-	int rx, ry;
-	double time; 
-	double bs_time;
-	double su_time;
-	double vis_obs_time;
-	double vis_unobs_time;
-	int bs_x, bs_y, bs_w, bs_h;
-	int su_x, su_y, su_w, su_h;
-	Window above;
-	short vis_state;
-	short selectinput;
-	short map_cnt;
-	short unmap_cnt;
-	short vis_cnt;
-	short create_cnt;
-} winattr_t;
-
-#endif /* _X11VNC_WINATTR_T_H */
diff --git a/ica/x11/x11vnc/x11vnc.1 b/ica/x11/x11vnc/x11vnc.1
deleted file mode 100644
index d4dd0a2..0000000
--- a/ica/x11/x11vnc/x11vnc.1
+++ /dev/null
@@ -1,6962 +0,0 @@
-.\" This file was automatically generated from x11vnc -help output.
-.TH X11VNC "1" "December 2010" "x11vnc " "User Commands"
-.SH NAME
-x11vnc - allow VNC connections to real X11 displays
-         version: 0.9.13, lastmod: 2010-12-27
-.SH SYNOPSIS
-.B x11vnc
-[OPTION]...
-.SH DESCRIPTION
-.PP
-Typical usage is:
-.IP
-Run this command in a shell on the remote machine "far-host"
-with X session you wish to view:
-.IP
-x11vnc -display :0
-.IP
-Then run this in another window on the machine you are sitting at:
-.IP
-vncviewer far-host:0
-.PP
-Once x11vnc establishes connections with the X11 server and starts listening
-as a VNC server it will print out a string: PORT=XXXX where XXXX is typically
-5900 (the default VNC server port).  One would next run something like
-this on the local machine: "vncviewer hostname:N" where "hostname" is
-the name of the machine running x11vnc and N is XXXX - 5900, i.e. usually
-"vncviewer hostname:0".
-.PP
-By default x11vnc will not allow the screen to be shared and it will exit
-as soon as the client disconnects.  See \fB-shared\fR and \fB-forever\fR below to override
-these protections.  See the FAQ for details how to tunnel the VNC connection
-through an encrypted channel such as 
-.IR ssh (1).
-In brief:
-.IP
-ssh \fB-t\fR \fB-L\fR 5900:localhost:5900 far-host 'x11vnc \fB-localhost\fR \fB-display\fR :0'
-.PP
-% vncviewer -encodings 'copyrect tight zrle hextile' localhost:0
-.PP
-Also, use of a VNC password (-rfbauth or \fB-passwdfile)\fR is strongly recommended.
-.PP
-For additional info see: http://www.karlrunge.com/x11vnc/
-and  http://www.karlrunge.com/x11vnc/faq.html
-.PP
-Config file support: if the file $HOME/.x11vncrc exists then each line in
-it is treated as a single command line option.  Disable with \fB-norc.\fR  For
-each option name, the leading character "-" is not required.  E.g. a line
-that is either "forever" or "\fB-forever\fR" may be used and are equivalent.
-Likewise "wait 100" or "\fB-wait\fR \fI100\fR" are acceptable and equivalent lines.
-The "#" character comments out to the end of the line in the usual way
-(backslash it for a literal).  Leading and trailing whitespace is trimmed off.
-Lines may be continued with a "\\" as the last character of a line (it
-becomes a space character).
-.PP
-.SH OPTIONS
-
-.PP
-\fB-display\fR \fIdisp\fR
-.IP
-X11 server display to connect to, usually :0.  The X
-server process must be running on same machine and
-support MIT-SHM.  Equivalent to setting the DISPLAY
-environment variable to \fIdisp\fR.
-.IP
-See the description below of the "\fB-display\fR \fIWAIT:...\fR"
-extensions, where alias "\fB-find\fR" will find the user's
-display automatically, and "\fB-create\fR" will create a
-Xvfb session if no session is found.
-.PP
-\fB-auth\fR \fIfile\fR
-.IP
-Set the X authority file to be \fIfile\fR, equivalent to
-setting the XAUTHORITY environment variable to \fIfile\fR
-before startup.  Same as \fB-xauth\fR file.  See 
-.IR Xsecurity (7)
-,
-.IR xauth (1)
-man pages for more info.
-.IP
-Use '-auth guess' to have x11vnc use its \fB-findauth\fR
-mechanism (described below) to try to guess the
-XAUTHORITY filename and use it.
-.IP
-XDM/GDM/KDM: if you are running x11vnc as root and want
-to find the XAUTHORITY before anyone has logged into an
-X session yet, use: x11vnc \fB-env\fR FD_XDM=1 \fB-auth\fR guess ...
-(This will also find the XAUTHORITY if a user is already
-logged into the X session.)  When running as root,
-FD_XDM=1 will be tried if the initial \fB-auth\fR guess fails.
-.PP
-\fB-N\fR
-.IP
-If the X display is :N, try to set the VNC display to
-also be :N This just sets the \fB-rfbport\fR option to 5900+N
-The program will exit immediately if that port is not
-available. The \fB-N\fR option only works with normal \fB-display\fR
-usage, e.g. :0 or :8, \fB-N\fR is ignored in the \fB-display\fR
-WAIT:..., \fB-create,\fR \fB-find,\fR \fB-svc,\fR \fB-redirect,\fR etc modes.
-.PP
-\fB-autoport\fR \fIn\fR
-.IP
-Automatically probe for a free VNC port starting at n.
-The default is to start probing at 5900.  Use this to
-stay away from other VNC servers near 5900.
-.PP
-\fB-rfbport\fR \fIstr\fR
-.IP
-The VNC port to listen on (a LibVNCServer option), e.g.
-5900, 5901, etc.  If specified as "\fB-rfbport\fR \fIPROMPT\fR"
-then the x11vnc \fB-gui\fR is used to prompt the user to
-enter the port number.
-.PP
-\fB-6\fR
-.IP
-IPv6 listening support.  In addition to IPv4, the
-IPv6 address is listened on for incoming connections.
-The same port number as IPv4 is used.
-.IP
-NOTE:  This x11vnc binary was compiled to have the
-"-6" IPv6 listening mode ENABLED by default (CPPFLAGS
-\fB-DX11VNC_LISTEN6=1).\fR  So to disable IPv6 listening mode
-you MUST supply the "\fB-no6\fR" option (see below.)
-.IP
-The "-6" mode works for both normal connections and
-\fB-ssl\fR encrypted ones.  Nearly everything is supported
-for the IPv6 case, but there are a few exceptions.
-See \fB-stunnel\fR for its IPv6 support.
-.IP
-Currently, for absolutely everything to work correctly
-the machine may need to have some IPv4 support, at the
-least for the loopback interface.  However, for nearly
-all usage modes no IPv4 support is required. See \fB-nopiv4.\fR
-.IP
-If you have trouble compiling or running in IPv6 mode,
-set \fB-DX11VNC_IPV6=0\fR in CPPFLAGS when configuring to
-disable IPv6 support.
-.PP
-\fB-no6\fR
-.IP
-Disable IPv6 listening support (only useful if the
-"-6" mode is compiled in to be the default; see the
-X11VNC_LISTEN6 description above under "-6".)
-.PP
-\fB-noipv6\fR
-.IP
-Do not try to use IPv6 for any listening or connecting
-sockets.  This includes both the listening service
-port(s) and outgoing connections from \fB-connect,\fR
-\fB-connect_or_exit,\fR or \fB-proxy.\fR  Use this if you are having
-problems due to IPv6.
-.PP
-\fB-noipv4\fR
-.IP
-Do not try to use IPv4 for any listening or connecting
-sockets.  This is mainly for exploring the behavior of
-x11vnc on an IPv6-only system, but may have other uses.
-.PP
-\fB-reopen\fR
-.IP
-If the X server connection is disconnected, try to
-reopen the X display (up to one time.)  This is of use
-for display managers like GDM (KillInitClients option)
-that kill x11vnc just after the user logs into the
-X session.  Note: the reopened state may be unstable.
-Set X11VNC_REOPEN_DISPLAY=n to reopen n times and
-set X11VNC_REOPEN_SLEEP_MAX to the number of seconds,
-default 10, to keep trying to reopen the display (once
-per second.)
-.IP
-Update: as of 0.9.9, x11vnc tries to automatically avoid
-being killed by the display manager by delaying creating
-windows or using XFIXES.  So you shouldn't need to use
-KillInitClients=false as long as you log in quickly
-enough (within 45 seconds of connecting.)  You can
-disable this by setting X11VNC_AVOID_WINDOWS=never.
-You can also set it to the number of seconds to delay.
-.PP
-\fB-reflect\fR \fIhost:N\fR
-.IP
-Instead of connecting to and polling an X display,
-connect to the remote VNC server host:N and be a
-reflector/repeater for it.  This is useful for trying
-to manage the case of many simultaneous VNC viewers
-(e.g. classroom broadcasting) where, e.g. you put
-a repeater on each network switch, etc, to improve
-performance by distributing the load and network
-traffic.  Implies \fB-shared\fR (use \fB-noshared\fR as a later
-option to disable). See the discussion below under
-\fB-rawfb\fR vnc:host:N for more details.
-.PP
-\fB-id\fR \fIwindowid\fR
-.IP
-Show the X window corresponding to \fIwindowid\fR not
-the entire display.  New windows like popup menus,
-transient toplevels, etc, may not be seen or may be
-clipped.  Disabling SaveUnders or BackingStore in the
-X server may help show them.  x11vnc may crash if the
-window is initially partially obscured, changes size,
-is iconified, etc.  Some steps are taken to avoid this
-and the \fB-xrandr\fR mechanism is used to track resizes.  Use
-.IR xwininfo (1)
-to get the window id, or use "\fB-id\fR \fIpick\fR"
-to have x11vnc run 
-.IR xwininfo (1)
-for you and extract
-the id.  The \fB-id\fR option is useful for exporting very
-simple applications (e.g. the current view on a webcam).
-.PP
-\fB-sid\fR \fIwindowid\fR
-.IP
-As \fB-id,\fR but instead of using the window directly it
-shifts a root view to it: this shows SaveUnders menus,
-etc, although they will be clipped if they extend beyond
-the window.
-.PP
-\fB-appshare\fR
-.IP
-Simple application sharing based on the \fB-id/-sid\fR
-mechanism.  Every new toplevel window that the
-application creates induces a new viewer window via
-a reverse connection.  The \fB-id/-sid\fR and \fB-connect\fR
-options are required.  Run 'x11vnc \fB-appshare\fR \fB-help'\fR
-for more info.
-.PP
-\fB-clip\fR \fIWxH+X+Y\fR
-.IP
-Only show the sub-region of the full display that
-corresponds to the rectangle geometry with size WxH and
-offset +X+Y.  The VNC display has size WxH (i.e. smaller
-than the full display).  This also works for \fB-id/-sid\fR
-mode where the offset is relative to the upper left
-corner of the selected window.  An example use of this
-option would be to split a large (e.g. Xinerama) display
-into two parts to be accessed via separate viewers by
-running a separate x11vnc on each part.
-.IP
-Use '-clip xinerama0' to clip to the first xinerama
-sub-screen (if xinerama is active).  xinerama1 for the
-2nd sub-screen, etc.  This way you don't need to figure
-out the WxH+X+Y of the desired xinerama sub-screen.
-screens are sorted in increasing distance from the
-(0,0) origin (I.e. not the Xserver's order).
-.PP
-\fB-flashcmap\fR
-.IP
-In 8bpp indexed color, let the installed colormap flash
-as the pointer moves from window to window (slow).
-Also try the \fB-8to24\fR option to avoid flash altogether.
-.PP
-\fB-shiftcmap\fR \fIn\fR
-.IP
-Rare problem, but some 8bpp displays use less than 256
-colorcells (e.g. 16-color grayscale, perhaps the other
-bits are used for double buffering) *and* also need to
-shift the pixels values away from 0, .., ncells.  \fIn\fR
-indicates the shift to be applied to the pixel values.
-To see the pixel values set DEBUG_CMAP=1 to print out
-a colormap histogram.  Example: \fB-shiftcmap\fR 240
-.PP
-\fB-notruecolor\fR
-.IP
-For 8bpp displays, force indexed color (i.e. a colormap)
-even if it looks like 8bpp TrueColor (rare problem).
-.PP
-\fB-advertise_truecolor\fR
-.IP
-If the X11 display is indexed color, lie to clients
-when they first connect by telling them it is truecolor.
-To workaround RealVNC: inPF has colourMap but not 8bpp
-Use '-advertise_truecolor reset' to reset client fb too.
-.PP
-\fB-visual\fR \fIn\fR
-.IP
-This option probably does not do what you think.
-It simply *forces* the visual used for the framebuffer;
-this may be a bad thing... (e.g. messes up colors or
-cause a crash). It is useful for testing and for some
-workarounds.  n may be a decimal number, or 0x hex.
-Run 
-.IR xdpyinfo (1)
-for the values.  One may also use
-"TrueColor", etc. see <X11/X.h> for a list.  If the
-string ends in ":m" then for better or for worse
-the visual depth is forced to be m.  You may want to
-use \fB-noshm\fR when using this option (so XGetImage may
-automatically translate the pixel data).
-.PP
-\fB-overlay\fR
-.IP
-Handle multiple depth visuals on one screen, e.g. 8+24
-and 24+8 overlay visuals (the 32 bits per pixel are
-packed with 8 for PseudoColor and 24 for TrueColor).
-.IP
-Currently \fB-overlay\fR only works on Solaris via
-.IR XReadScreen (3X11)
-and IRIX using 
-.IR XReadDisplay (3).
-On Solaris there is a problem with image "bleeding"
-around transient popup menus (but not for the menu
-itself): a workaround is to disable SaveUnders
-by passing the "\fB-su\fR" argument to Xsun (in
-/etc/dt/config/Xservers).
-.IP
-Use \fB-overlay\fR as a workaround for situations like these:
-Some legacy applications require the default visual to
-be 8bpp (8+24), or they will use 8bpp PseudoColor even
-when the default visual is depth 24 TrueColor (24+8).
-In these cases colors in some windows will be incorrect
-in x11vnc unless \fB-overlay\fR is used.  Another use of
-\fB-overlay\fR is to enable showing the exact mouse cursor
-shape (details below).
-.IP
-Under \fB-overlay,\fR performance will be somewhat slower
-due to the extra image transformations required.
-For optimal performance do not use \fB-overlay,\fR but rather
-configure the X server so that the default visual is
-depth 24 TrueColor and try to have all apps use that
-visual (e.g. some apps have \fB-use24\fR or \fB-visual\fR options).
-.PP
-\fB-overlay_nocursor\fR
-.IP
-Sets \fB-overlay,\fR but does not try to draw the exact mouse
-cursor shape using the overlay mechanism.
-.PP
-\fB-8to24\fR \fI[opts]\fR
-.IP
-Try this option if \fB-overlay\fR is not supported on your
-OS, and you have a legacy 8bpp app that you want to
-view on a multi-depth display with default depth 24
-(and is 32 bpp) OR have a default depth 8 display with
-depth 24 overlay windows for some apps.  This option
-may not work on all X servers and hardware (tested
-on XFree86/Xorg mga driver and Xsun).  The "opts"
-string is not required and is described below.
-.IP
-This mode enables a hack where x11vnc monitors windows
-within 3 levels from the root window.  If it finds
-any that are 8bpp it extracts the indexed color
-pixel values using XGetImage() and then applies a
-transformation using the colormap(s) to create TrueColor
-RGB values that it in turn inserts into bits 1-24 of
-the framebuffer.  This creates a depth 24 "view"
-of the display that is then exported via VNC.
-.IP
-Conversely, for default depth 8 displays, the depth
-24 regions are read by XGetImage() and everything is
-transformed and inserted into a depth 24 TrueColor
-framebuffer.
-.IP
-Note that even if there are *no* depth 24 visuals or
-windows (i.e. pure 8bpp), this mode is potentially
-an improvement over \fB-flashcmap\fR because it avoids the
-flashing and shows each window in the correct color.
-.IP
-This method works OK, but may still have bugs and it
-does hog resources.  If there are multiple 8bpp windows
-using different colormaps, one may have to iconify all
-but one for the colors to be correct.
-.IP
-There may be painting errors for clipping and switching
-between windows of depths 8 and 24.  Heuristics are
-applied to try to minimize the painting errors.  One can
-also press 3 Alt_L's in a row to refresh the screen
-if the error does not repair itself.  Also the option
-\fB-fixscreen\fR 8=3.0 or \fB-fixscreen\fR V=3.0 may be used to
-periodically refresh the screen at the cost of bandwidth
-(every 3 sec for this example).
-.IP
-The [opts] string can contain the following settings.
-Multiple settings are separated by commas.
-.IP
-For for some X servers with default depth 24 a
-speedup may be achieved via the option "nogetimage".
-This enables a scheme were XGetImage() is not used
-to retrieve the 8bpp data.  Instead, it assumes that
-the 8bpp data is in bits 25-32 of the 32bit X pixels.
-There is no requirement that the X server should put
-the data there for our poll requests, but some do and
-so the extra steps to retrieve it can be skipped.
-Tested with mga driver with XFree86/Xorg.  For the
-default depth 8 case this option is ignored.
-.IP
-To adjust how often XGetImage() is used to poll the
-non-default visual regions for changes, use the option
-"poll=t" where "t" is a floating point time.
-(default: 0.05)
-.IP
-Setting the option "level2" will limit the search
-for non-default visual windows to two levels from the
-root window.  Do this on slow machines where you know
-the window manager only imposes one extra window between
-the app window and the root window.
-.IP
-Also for very slow machines use "cachewin=t"
-where t is a floating point amount of time to cache
-XGetWindowAttributes results.  E.g. cachewin=5.0.
-This may lead to the windows being unnoticed for this
-amount of time when deiconifying, painting errors, etc.
-.IP
-While testing on a very old SS20 these options gave
-tolerable response: \fB-8to24\fR poll=0.2,cachewin=5.0. For
-this machine \fB-overlay\fR is supported and gives better
-response.
-.IP
-Debugging for this mode can be enabled by setting
-"dbg=1", "dbg=2", or "dbg=3".
-.PP
-\fB-24to32\fR
-.IP
-Very rare problem: if the framebuffer (X display
-or \fB-rawfb)\fR is 24bpp instead of the usual 32bpp, then
-dynamically transform the pixels to 32bpp.  This will be
-slower, but can be used to work around problems where
-VNC viewers cannot handle 24bpp (e.g. "main: setPF:
-not 8, 16 or 32 bpp?").  See the FAQ for more info.
-.IP
-In the case of \fB-rawfb\fR mode, the pixels are directly
-modified by inserting a 0 byte to pad them out to 32bpp.
-For X displays, a kludge is done that is equivalent to
-"\fB-noshm\fR \fI\fB-visual\fR TrueColor:32\fR".  (If better performance
-is needed for the latter, feel free to ask).
-.PP
-\fB-scale\fR \fIfraction\fR
-.IP
-Scale the framebuffer by factor \fIfraction\fR.  Values
-less than 1 shrink the fb, larger ones expand it. Note:
-the image may not be sharp and response may be slower.
-If \fIfraction\fR contains a decimal point "." it
-is taken as a floating point number, alternatively
-the notation "m/n" may be used to denote fractions
-exactly, e.g. \fB-scale\fR 2/3
-.IP
-To scale asymmetrically in the horizontal and vertical
-directions, specify a WxH geometry to stretch to:
-e.g. '-scale 1024x768', or also '-scale 0.9x0.75'
-.IP
-Scaling Options: can be added after \fIfraction\fR via
-":", to supply multiple ":" options use commas.
-If you just want a quick, rough scaling without
-blending, append ":nb" to \fIfraction\fR (e.g. \fB-scale\fR
-1/3:nb).  No blending is the default for 8bpp indexed
-color, to force blending for this case use ":fb".
-.IP
-To disable \fB-scrollcopyrect\fR and \fB-wirecopyrect\fR under
-\fB-scale\fR use ":nocr".  If you need to to enable them use
-":cr" or specify them explicitly on the command line.
-If a slow link is detected, ":nocr" may be applied
-automatically.  Default: :cr
-.IP
-More esoteric options: for compatibility with vncviewers
-the scaled width is adjusted to be a multiple of 4:
-to disable this use ":n4".  ":in" use interpolation
-scheme even when shrinking, ":pad" pad scaled width
-and height to be multiples of scaling denominator
-(e.g. 3 for 2/3).
-.PP
-\fB-geometry\fR \fIWxH\fR
-.IP
-Same as \fB-scale\fR WxH
-.PP
-\fB-scale_cursor\fR \fIfrac\fR
-.IP
-By default if \fB-scale\fR is supplied the cursor shape is
-scaled by the same factor.  Depending on your usage,
-you may want to scale the cursor independently of the
-screen or not at all.  If you specify \fB-scale_cursor\fR
-the cursor will be scaled by that factor.  When using
-\fB-scale\fR mode to keep the cursor at its "natural" size
-use "\fB-scale_cursor\fR \fI1\fR".  Most of the ":" scaling
-options apply here as well.
-.PP
-\fB-viewonly\fR
-.IP
-All VNC clients can only watch (default off).
-.PP
-\fB-shared\fR
-.IP
-VNC display is shared, i.e. more than one viewer can
-connect at the same time (default off).
-.PP
-\fB-once\fR
-.IP
-Exit after the first successfully connected viewer
-disconnects, opposite of \fB-forever.\fR This is the Default.
-.PP
-\fB-forever\fR
-.IP
-Keep listening for more connections rather than exiting
-as soon as the first client(s) disconnect. Same as \fB-many\fR
-.IP
-To get the standard non-shared VNC behavior where when
-a new VNC client connects the existing VNC client is
-dropped use:  \fB-nevershared\fR \fB-forever\fR   This method can
-also be used to guard against hung TCP connections that
-do not go away.
-.PP
-\fB-loop\fR
-.IP
-Create an outer loop restarting the x11vnc process
-whenever it terminates.  \fB-bg\fR and \fB-inetd\fR are ignored
-in this mode (however see \fB-loopbg\fR below).
-.IP
-Useful for continuing even if the X server terminates
-and restarts (at that moment the process will need
-permission to reconnect to the new X server of course).
-.IP
-Use, e.g., \fB-loop100\fR to sleep 100 millisecs between
-restarts, etc.  Default is 2000ms (i.e. 2 secs) Use,
-e.g. \fB-loop300,5\fR to sleep 300 ms and only loop 5 times.
-.IP
-If \fB-loopbg\fR (plus any numbers) is specified instead,
-the "\fB-bg\fR" option is implied and the mode approximates
-.IR inetd (8)
-usage to some degree.  In this case when
-it goes into the background any listening sockets
-(i.e. ports 5900, 5800) are closed, so the next one
-in the loop can use them.  This mode will only be of
-use if a VNC client (the only client for that process)
-is already connected before the process goes into the
-background, for example, usage of \fB-display\fR WAIT:..,
-\fB-svc,\fR and \fB-connect\fR can make use of this "poor man's"
-inetd mode.  The default wait time is 500ms in this
-mode.  This usage could use useful:  \fB-svc\fR \fB-bg\fR \fB-loopbg\fR
-.PP
-\fB-timeout\fR \fIn\fR
-.IP
-Exit unless a client connects within the first n seconds
-after startup.
-.IP
-If there have been no connection attempts after n
-seconds x11vnc exits immediately.  If a client is
-trying to connect but has not progressed to the normal
-operating state, x11vnc gives it a few more seconds
-to finish and exits if it does not make it to the
-normal state.
-.IP
-For reverse connections via \fB-connect\fR or \fB-connect_or_exit\fR
-a timeout of n seconds will be set for all reverse
-connects.  If the connect timeout alarm goes off,
-x11vnc will exit immediately.
-.PP
-\fB-sleepin\fR \fIn\fR
-.IP
-At startup sleep n seconds before proceeding (e.g. to
-allow redirs and listening clients to start up)
-.IP
-If a range is given: '-sleepin min-max', a random value
-between min and max is slept. E.g. '-sleepin 0-20' and
-\'-sleepin 10-30'.  Floats are allowed too.
-.PP
-\fB-inetd\fR
-.IP
-Launched by 
-.IR inetd (8):
-stdio instead of listening socket.
-Note: if you are not redirecting stderr to a log file
-(via shell 2> or \fB-o\fR option) you MUST also specify the \fB-q\fR
-option, otherwise the stderr goes to the viewer which
-will cause it to abort.  Specifying both \fB-inetd\fR and \fB-q\fR
-and no \fB-o\fR will automatically close the stderr.
-.PP
-\fB-tightfilexfer\fR
-.IP
-Enable the TightVNC file transfer extension. Note that
-that when the \fB-viewonly\fR option is supplied all file
-transfers are disabled.  Also clients that log in
-viewonly cannot transfer files.  However, if the remote
-control mechanism is used to change the global or
-per-client viewonly state the filetransfer permissions
-will NOT change.
-.IP
-IMPORTANT: please understand if \fB-tightfilexfer\fR is
-specified and you run x11vnc as root for, say, inetd
-or display manager (gdm, kdm, ...) access and you do
-not have it switch users via the \fB-users\fR option, then
-VNC Viewers that connect are able to do filetransfer
-reads and writes as *root*.
-.IP
-Also, tightfilexfer is disabled in \fB-unixpw\fR mode.
-.PP
-\fB-ultrafilexfer\fR
-.IP
-Note: to enable UltraVNC filetransfer and to get it to
-work you probably need to supply these LibVNCServer
-options: "\fB-rfbversion\fR \fI3.6 \fB-permitfiletransfer\fR"\fR
-"\fB-ultrafilexfer\fR" is an alias for this combination.
-.IP
-IMPORTANT: please understand if \fB-ultrafilexfer\fR is
-specified and you run x11vnc as root for, say, inetd
-or display manager (gdm, kdm, ...) access and you do
-not have it switch users via the \fB-users\fR option, then
-VNC Viewers that connect are able to do filetransfer
-reads and writes as *root*.
-.IP
-Note that sadly you cannot do both \fB-tightfilexfer\fR and
-\fB-ultrafilexfer\fR at the same time because the latter
-requires setting the version to 3.6 and tightvnc will
-not do filetransfer when it sees that version number.
-.PP
-\fB-http\fR
-.IP
-Instead of using \fB-httpdir\fR (see below) to specify
-where the Java vncviewer applet is, have x11vnc try
-to *guess* where the directory is by looking relative
-to the program location and in standard locations
-(/usr/local/share/x11vnc/classes, etc).  Under \fB-ssl\fR or
-\fB-stunnel\fR the ssl classes subdirectory is sought.
-.PP
-\fB-http_ssl\fR
-.IP
-As \fB-http,\fR but force lookup for ssl classes subdir.
-.IP
-Note that for HTTPS, single-port Java applet delivery
-you can set X11VNC_HTTPS_DOWNLOAD_WAIT_TIME to the
-max number of seconds to wait for the applet download
-to finish.  The default is 15.
-.PP
-\fB-avahi\fR
-.IP
-Use the Avahi/mDNS ZeroConf protocol to advertise
-this VNC server to the local network. (Related terms:
-Rendezvous, Bonjour).  Depending on your setup, you
-may need to start avahi-daemon and open udp port 5353
-in your firewall.
-.IP
-You can set X11VNC_AVAHI_NAME, X11VNC_AVAHI_HOST,
-and/or X11VNC_AVAHI_PORT environment variables
-to override the default values.  For example:
-\fB-env\fR X11VNC_AVAHI_NAME=wally
-.IP
-If the avahi API cannot be found at build time, a helper
-program like avahi-
-.IR publish (1)
-or dns-
-.IR sd (1)
-will be tried
-.PP
-\fB-mdns\fR
-.IP
-Same as \fB-avahi.\fR
-.PP
-\fB-zeroconf\fR
-.IP
-Same as \fB-avahi.\fR
-.PP
-\fB-connect\fR \fIstring\fR
-.IP
-For use with "vncviewer -listen" reverse connections.
-If \fIstring\fR has the form "host" or "host:port"
-the connection is made once at startup.
-.IP
-Use commas for a list of host's and host:port's.
-E.g. \fB-connect\fR host1,host2 or host1:0,host2:5678.
-Note that to reverse connect to multiple hosts at the
-same time you will likely need to also supply: \fB-shared\fR
-.IP
-Note that unlike most vnc servers, x11vnc will require a
-password for reverse as well as for forward connections.
-(provided password auth has been enabled, \fB-rfbauth,\fR etc)
-If you do not want to require a password for reverse
-connections set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in
-your environment before starting x11vnc.
-.IP
-If \fIstring\fR contains "/" it is instead interpreted
-as a file to periodically check for new hosts.
-The first line is read and then the file is truncated.
-Be careful about the location of this file if x11vnc
-is running as root (e.g. via 
-.IR gdm (1)
-, etc).
-.IP
-Repeater mode: Some services provide an intermediate
-"vnc repeater": http://www.uvnc.com/addons/repeater.html
-(and also http://koti.mbnet.fi/jtko/ for linux port)
-that acts as a proxy/gateway.  Modes like these require
-an initial string to be sent for the reverse connection
-before the VNC protocol is started.  Here are the ways
-to do this:
-.IP
-\fB-connect\fR pre=some_string+host:port
-\fB-connect\fR pre128=some_string+host:port
-\fB-connect\fR repeater=ID:1234+host:port
-\fB-connect\fR repeater=23.45.67.89::5501+host:port
-.IP
-SSVNC notation is also supported:
-.IP
-\fB-connect\fR repeater://host:port+ID:1234
-.IP
-As with normal \fB-connect\fR usage, if the repeater port is
-not supplied 5500 is assumed.
-.IP
-The basic idea is between the special tag, e.g. "pre="
-and "+" is the pre-string to be sent.  Note that in
-this case host:port is the repeater server, NOT the
-vnc viewer.  Somehow the pre-string tells the repeater
-server how to find the vnc viewer and connect you to it.
-.IP
-In the case pre=some_string+host:port, "some_string"
-is simply sent. In the case preNNN=some_string+host:port
-"some_string" is sent in a null padded buffer of
-length NNN.  repeater= is the same as pre250=, this is
-the ultravnc repeater buffer size.
-.IP
-Strings like "\\n" and "\\r", etc. are expanded to
-newline and carriage return.  "\\c" is expanded to
-"," since the connect string is comma separated.
-.IP
-See also the \fB-proxy\fR option below for additional ways
-to plumb reverse connections.
-.IP
-Reverse SSL: using \fB-connect\fR in \fB-ssl\fR mode makes x11vnc
-act as an SSL client (initiates SSL connection) rather
-than an SSL server.  The idea is x11vnc might be
-connecting to stunnel on the viewer side with the
-viewer in listening mode.  If you do not want this
-behavior, use \fB-env\fR X11VNC_DISABLE_SSL_CLIENT_MODE=1.
-With this the viewer side can act as the SSL client
-as it normally does for forward connections.
-.IP
-Reverse SSL Repeater mode:  This will work, but note
-that if the VNC Client does any sort of a 'Fetch Cert'
-action before connecting, then the Repeater will
-likely drop the connection and both sides will need
-to restart.  Consider the use of \fB-connect_or_exit\fR
-and \fB-loop300,2\fR to have x11vnc reconnect once to the
-repeater after the fetch.  You will probably also want
-to supply \fB-sslonly\fR to avoid x11vnc thinking the delay
-in response means the connection is VeNCrypt.  The env
-var X11VNC_DISABLE_SSL_CLIENT_MODE=1 discussed above
-may also be useful (i.e. the viewer can do a forward
-connection as it normally does.)
-.IP
-IPv6: as of x11vnc 0.9.10 the \fB-connect\fR option should
-connect to IPv6 hosts properly.  If there are problems
-you can disable IPv6 by setting \fB-DX11VNC_IPV6=0\fR
-in CPPFLAGS when configuring.  If there problems
-connecting to IPv6 hosts consider a relay like the
-included inet6to4 script or the \fB-proxy\fR option.
-.PP
-\fB-connect_or_exit\fR \fIstr\fR
-.IP
-As with \fB-connect,\fR except if none of the reverse
-connections succeed, then x11vnc shuts down immediately
-.IP
-An easier to type alias for this option is '-coe'
-.IP
-By the way, if you do not want x11vnc to listen on
-ANY interface use \fB-rfbport\fR 0  which is handy for the
-\fB-connect_or_exit\fR mode.
-.PP
-\fB-proxy\fR \fIstring\fR
-.IP
-Use proxy in string (e.g. host:port) as a proxy for
-making reverse connections (-connect or \fB-connect_or_exit\fR
-options).
-.IP
-Web proxies are supported, but note by default most of
-them only support destination connections to ports 443
-or 563, so this might not be very useful (the viewer
-would need to listen on that port or the router would
-have to do a port redirection).
-.IP
-A web proxy may be specified by either "host:port"
-or "http://host:port" (the port is required even if
-it is the common choices 80 or 8080)
-.IP
-SOCKS4, SOCKS4a, and SOCKS5 are also supported.
-SOCKS proxies normally do not have restrictions on the
-destination port number.
-.IP
-Use a format like this: socks://host:port or
-socks5://host:port.  Note that ssh \fB-D\fR does not support
-SOCKS4a, so use socks5://.  For socks:// SOCKS4 is used
-on a numerical IP and "localhost", otherwise SOCKS4a
-is used (and so the proxy tries to do the DNS lookup).
-.IP
-An experimental mode is "\fB-proxy\fR \fIhttp://host:port/...\fR"
-Note the "/" after the port that distinguishes it from
-a normal web proxy.  The port must be supplied even if
-it is the default 80.  For this mode a GET is done to
-the supplied URL with the string host=H&port=P appended.
-H and P will be the \fB-connect\fR reverse connect host
-and port.  Use the string "__END__" to disable the
-appending.  The basic idea here is that maybe some cgi
-script provides the actual viewer hookup and tunnelling.
-How to actually achieve this within cgi, php, etc. is
-not clear...  A custom web server or apache module
-would be straight-forward.
-.IP
-Another experimental mode is "\fB-proxy\fR \fIssh://user@host\fR"
-in which case a SSH tunnel is used for the proxying.
-"user@" is not needed unless your unix username is
-different on "host".  For a non-standard SSH port
-use ssh://user@host:port.  If proxies are chained (see
-next paragraph) then the ssh one must be the first one.
-If ssh-agent is not active, then the ssh password needs
-to be entered in the terminal where x11vnc is running.
-Examples:
-.IP
-\fB-connect\fR localhost:0 \fB-proxy\fR ssh://me@friends-pc:2222
-.IP
-\fB-connect\fR snoopy:0 \fB-proxy\fR ssh://ssh.company.com
-.IP
-Multiple proxies may be chained together in case one
-needs to ricochet off of a number of hosts to finally
-reach the VNC viewer.  Up to 3 may be chained, separate
-them by commas in the order they are to be connected to.
-E.g.:  http://host1:port1,socks5://host2:port2 or three
-like:  first,second,third
-.IP
-IPv6: as of x11vnc 0.9.10 the \fB-proxy\fR option should
-connect to IPv6 hosts properly.  If there are problems
-you can disable IPv6 by setting \fB-DX11VNC_IPV6=0\fR
-in CPPFLAGS when configuring.  If there problems
-connecting to IPv6 hosts consider a relay like the
-included inet6to4 script.
-.PP
-\fB-vncconnect,\fR \fB-novncconnect\fR
-.IP
-Monitor the VNC_CONNECT X property set by the standard
-VNC program 
-.IR vncconnect (1).
-When the property is
-set to "host" or "host:port" establish a reverse
-connection.  Using 
-.IR xprop (1)
-instead of vncconnect may
-work (see the FAQ).  The \fB-remote\fR control mechanism uses
-X11VNC_REMOTE channel, and this option disables/enables
-it as well.  Default: \fB-vncconnect\fR
-.IP
-To use different names for these X11 properties (e.g. to
-have separate communication channels for multiple
-x11vnc's on the same display) set the VNC_CONNECT or
-X11VNC_REMOTE env. vars. to the string you want, for
-example: \fB-env\fR X11VNC_REMOTE=X11VNC_REMOTE_12345
-Both sides of the channel must use the same unique name.
-The same can be done for the internal X11VNC_TICKER
-property (heartbeat and timestamp) if desired.
-.PP
-\fB-allow\fR \fIhost1[,host2..]\fR
-.IP
-Only allow client connections from hosts matching
-the comma separated list of hostnames or IP addresses.
-Can also be a numerical IP prefix, e.g. "192.168.100."
-to match a simple subnet, for more control build
-LibVNCServer with libwrap support (See the FAQ).  If the
-list contains a "/" it instead is a interpreted
-as a file containing addresses or prefixes that is
-re-read each time a new client connects.  Lines can be
-commented out with the "#" character in the usual way.
-.IP
-\fB-allow\fR applies in \fB-ssl\fR mode, but not in \fB-stunnel\fR mode.
-.IP
-IPv6: as of x11vnc 0.9.10 a host can be specified
-in IPv6 numerical format, e.g. 2001:4860:b009::93.
-.PP
-\fB-localhost\fR
-.IP
-Basically the same as "\fB-allow\fR \fI127.0.0.1\fR".
-.IP
-Note: if you want to restrict which network interface
-x11vnc listens on, see the \fB-listen\fR option below.
-E.g. "\fB-listen\fR \fIlocalhost\fR" or "\fB-listen\fR \fI192.168.3.21\fR".
-As a special case, the option "\fB-localhost\fR" implies
-"\fB-listen\fR \fIlocalhost\fR".
-.IP
-A rare case, but for non-localhost \fB-listen\fR usage, if
-you use the remote control mechanism (-R) to change
-the \fB-listen\fR interface you may need to manually adjust
-the \fB-allow\fR list (and vice versa) to avoid situations
-where no connections (or too many) are allowed.
-.IP
-If you do not want x11vnc to listen on ANY interface
-(evidently you are using \fB-connect\fR or \fB-connect_or_exit,\fR
-or plan to use remote control: \fB-R\fR connect:host), use
-\fB-rfbport\fR 0
-.IP
-IPv6: if IPv6 is supported, this option automatically
-implies the IPv6 loopback address '::1' as well.
-.PP
-\fB-unixsock\fR \fIstr\fR
-.IP
-Listen on the unix socket (AF_UNIX) 'str'
-for connections.  This mode is for either local
-connections or a tunnel endpoint where one wants the
-file permission of the unix socket file to determine
-what can connect to it.  (This currently requires an
-edit to libvnserver/rfbserver.c: comment out lines 310
-and 311, 'close(sock)' and 'return NULL' in rfbserver.c
-after the setsockopt() call.) Note that to disable all
-tcp listening ports specify '-rfbport 0' and should be
-useful with this mode.  Example:
-mkdir ~/s; chmod 700 ~/s;
-x11vnc \fB-unixsock\fR ~/s/mysock \fB-rfbport\fR 0 ...
-The SSVNC unix vncviewer can connect to unix sockets.
-.PP
-\fB-listen6\fR \fIstr\fR
-.IP
-When in IPv6 listen mode "-6", listen only on the
-network interface with address \fIstr\fR.  It also works
-for link scope addresses (fe80::219:dbff:fee5:3f92%eth0)
-and IPv6 hostname strings (e.g. ipv6.google.com.)
-Use LibVNCServer \fB-listen\fR option for the IPv4 interface.
-.PP
-\fB-nolookup\fR
-.IP
-Do not use gethostbyname() or gethostbyaddr() to look up
-host names or IP numbers.  Use this if name resolution
-is incorrectly set up and leads to long pauses as name
-lookups time out, etc.
-.PP
-\fB-input\fR \fIstring\fR
-.IP
-Fine tuning of allowed user input.  If \fIstring\fR does
-not contain a comma "," the tuning applies only to
-normal clients.  Otherwise the part before "," is
-for normal clients and the part after for view-only
-clients.  "K" is for Keystroke input, "M" for
-Mouse-motion input, "B" for Button-click input, "C"
-is for Clipboard input, and "F" is for File transfer
-(ultravnc only).  Their presence in the string enables
-that type of input.  E.g. "\fB-input\fR \fIM\fR" means normal
-users can only move the mouse and  "\fB-input\fR \fIKMBCF,M\fR"
-lets normal users do anything and enables view-only
-users to move the mouse.  This option is ignored when
-a global \fB-viewonly\fR is in effect (all input is discarded
-in that case).
-.PP
-\fB-grabkbd\fR
-.IP
-When VNC viewers are connected, attempt to the grab
-the keyboard so a (non-malicious) user sitting at the
-physical display is not able to enter keystrokes.
-This method uses 
-.IR XGrabKeyboard (3X11)
-and so it is
-not secure and does not rule out the person at the
-physical display injecting keystrokes by flooding the
-server with them, grabbing the keyboard himself, etc.
-Some degree of cooperation from the person at the
-display is assumed.  This is intended for remote
-help-desk or educational usage modes.
-.IP
-Note: on some recent (12/2010) X servers and/or
-desktops, \fB-grabkbd\fR no longer works: it prevents the
-window manager from resizing windows and similar things.
-Try \fB-ungrabboth\fR below (might not work.)
-.PP
-\fB-grabptr\fR
-.IP
-As \fB-grabkbd,\fR but for the mouse pointer using
-.IR XGrabPointer (3X11).
-Unfortunately due to the way the X
-server works, the mouse can still be moved around by the
-user at the physical display, but he will not be able to
-change window focus with it.  Also some window managers
-that call 
-.IR XGrabServer (3X11)
-for resizes, etc, will
-act on the local user's input.  Again, some degree of
-cooperation from the person at the display is assumed.
-.PP
-\fB-ungrabboth\fR
-.IP
-Whenever there is any input (either keyboard or
-pointer), ungrab *both* the keyboard and the pointer
-while injecting the synthetic input.  This is to allow
-window managers, etc. a chance to grab.
-.PP
-\fB-grabalways\fR
-.IP
-Apply both \fB-grabkbd\fR and \fB-grabptr\fR even when no VNC
-viewers are connected.  If you only want one of them,
-use the \fB-R\fR remote control to turn the other back on,
-e.g. \fB-R\fR nograbptr.
-.PP
-\fB-viewpasswd\fR \fIstring\fR
-.IP
-Supply a 2nd password for view-only logins.  The \fB-passwd\fR
-(full-access) password must also be supplied.
-.PP
-\fB-passwdfile\fR \fIfilename\fR
-.IP
-Specify the LibVNCServer password via the first line
-of the file \fIfilename\fR (instead of via \fB-passwd\fR on
-the command line where others might see it via 
-.IR ps (1)
-).
-.IP
-See the descriptions below for how to supply multiple
-passwords, view-only passwords, to specify external
-programs for the authentication, and other features.
-.IP
-If the filename is prefixed with "rm:" it will be
-removed after being read.  Perhaps this is useful in
-limiting the readability of the file.  In general, the
-password file should not be readable by untrusted users
-(BTW: neither should the VNC \fB-rfbauth\fR file: it is NOT
-encrypted, only obscured with a fixed key).
-.IP
-If the filename is prefixed with "read:" it will
-periodically be checked for changes and reread.  It is
-guaranteed to be reread just when a new client connects
-so that the latest passwords will be used.
-.IP
-If \fIfilename\fR is prefixed with "cmd:" then the
-string after the ":" is run as an external command:
-the output of the command will be interpreted as if it
-were read from a password file (see below).  If the
-command does not exit with 0, then x11vnc terminates
-immediately.  To specify more than 1000 passwords this
-way set X11VNC_MAX_PASSWDS before starting x11vnc.
-The environment variables are set as in \fB-accept.\fR
-.IP
-Note that due to the VNC protocol only the first 8
-characters of a password are used (DES key).
-.IP
-If \fIfilename\fR is prefixed with "custom:" then a
-custom password checker is supplied as an external
-command following the ":". The command will be run
-when a client authenticates.  If the command exits with
-0 the client is accepted, otherwise it is rejected.
-The environment variables are set as in \fB-accept.\fR
-.IP
-The standard input to the custom command will be a
-decimal digit "len" followed by a newline. "len"
-specifies the challenge size and is usually 16 (the
-VNC spec).  Then follows len bytes which is the random
-challenge string that was sent to the client. This is
-then followed by len more bytes holding the client's
-response (i.e. the challenge string encrypted via DES
-with the user password in the standard situation).
-.IP
-The "custom:" scheme can be useful to implement
-dynamic passwords or to implement methods where longer
-passwords and/or different encryption algorithms
-are used.  The latter will require customizing the VNC
-client as well.  One could create an MD5SUM based scheme
-for example.
-.IP
-File format for \fB-passwdfile:\fR
-.IP
-If multiple non-blank lines exist in the file they are
-all taken as valid passwords.  Blank lines are ignored.
-Password lines may be "commented out" (ignored) if
-they begin with the character "#" or the line contains
-the string "__SKIP__".  Lines may be annotated by use
-of the "__COMM__" string: from it to the end of the
-line is ignored.  An empty password may be specified
-via the "__EMPTY__" string on a line by itself (note
-your viewer might not accept empty passwords).
-.IP
-If the string "__BEGIN_VIEWONLY__" appears on a
-line by itself, the remaining passwords are used for
-viewonly access.  For compatibility, as a special case
-if the file contains only two password lines the 2nd
-one is automatically taken as the viewonly password.
-Otherwise the "__BEGIN_VIEWONLY__" token must be
-used to have viewonly passwords.  (tip: make the 3rd
-and last line be "__BEGIN_VIEWONLY__" to have 2
-full-access passwords)
-.PP
-\fB-showrfbauth\fR \fIfilename\fR
-.IP
-Print to the screen the obscured VNC password kept in
-the rfbauth file \fIfilename\fR and then exit.
-.PP
-\fB-unixpw\fR \fI[list]\fR
-.IP
-Use Unix username and password authentication.  x11vnc
-will use the 
-.IR su (1)
-program to verify the user's
-password.  [list] is an optional comma separated list
-of allowed Unix usernames.  If the [list] string begins
-with the character "!" then the entire list is taken
-as an exclude list.  See below for per-user options
-that can be applied.
-.IP
-A familiar "login:" and "Password:" dialog is
-presented to the user on a black screen inside the
-vncviewer.  The connection is dropped if the user fails
-to supply the correct password in 3 tries or does not
-send one before a 45 second timeout.  Existing clients
-are view-only during this period.
-.IP
-If the first character received is "Escape" then the
-unix username will not be displayed after "login:"
-as it is typed.  This could be of use for VNC viewers
-that automatically type the username and password.
-.IP
-Since the detailed behavior of 
-.IR su (1)
-can vary from
-OS to OS and for local configurations, test the mode
-before deployment to make sure it is working properly.
-x11vnc will attempt to be conservative and reject a
-login if anything abnormal occurs.
-.IP
-One case to note: FreeBSD and the other BSD's by
-default it is impossible for the user running x11vnc to
-validate his *own* password via 
-.IR su (1)
-(commenting out
-the pam_self.so entry in /etc/pam.d/su eliminates this
-behavior).  So the x11vnc login will always *FAIL* for
-this case (even when the correct password is supplied).
-.IP
-A possible workaround for this on *BSD would be to
-start x11vnc as root with the "\fB-users\fR \fI+nobody\fR" option
-to immediately switch to user nobody where the su'ing
-will proceed normally.
-.IP
-Another source of potential problems are PAM modules
-that prompt for extra info, e.g. password aging modules.
-These logins will fail as well even when the correct
-password is supplied.
-.IP
-**IMPORTANT**: to prevent the Unix password being sent
-in *clear text* over the network, one of two schemes
-will be enforced: 1) the \fB-ssl\fR builtin SSL mode, or 2)
-require both \fB-localhost\fR and \fB-stunnel\fR be enabled.
-.IP
-Method 1) ensures the traffic is encrypted between
-viewer and server.  A PEM file will be required, see the
-discussion under \fB-ssl\fR below (under some circumstances
-a temporary one can be automatically generated).
-.IP
-Method 2) requires the viewer connection to appear
-to come from the same machine x11vnc is running on
-(e.g. from a ssh \fB-L\fR port redirection).  And that the
-\fB-stunnel\fR SSL mode be used for encryption over the
-network. (see the description of \fB-stunnel\fR below).
-.IP
-Note: as a convenience, if you 
-.IR ssh (1)
-in and start
-x11vnc it will check if the environment variable
-SSH_CONNECTION is set and appears reasonable.  If it
-does, then the \fB-ssl\fR or \fB-stunnel\fR requirement will be
-dropped since it is assumed you are using ssh for the
-encrypted tunnelling.  \fB-localhost\fR is still enforced.
-Use \fB-ssl\fR or \fB-stunnel\fR to force SSL usage even if
-SSH_CONNECTION is set.
-.IP
-To override the above restrictions you can set
-environment variables before starting x11vnc:
-.IP
-Set UNIXPW_DISABLE_SSL=1 to disable requiring either
-\fB-ssl\fR or \fB-stunnel\fR (as under SSH_CONNECTION.)  Evidently
-you will be using a different method to encrypt the
-data between the vncviewer and x11vnc: perhaps 
-.IR ssh (1)
-or an IPSEC VPN. \fB-localhost\fR is still enforced (however,
-see the next paragraph.)
-.IP
-Set UNIXPW_DISABLE_LOCALHOST=1 to disable the \fB-localhost\fR
-requirement in \fB-unixpw\fR modes.  One should never do this
-(i.e. allow the Unix passwords to be sniffed on the
-network.)  This also disables the localhost requirement
-for reverse connections (see below.)
-.IP
-Note that use of \fB-localhost\fR with 
-.IR ssh (1)
-(and no \fB-unixpw)\fR
-is roughly the same as requiring a Unix user login
-(since a Unix password or the user's public key
-authentication is used by sshd on the machine where
-x11vnc runs and only local connections from that machine
-are accepted).
-.IP
-Regarding reverse connections (e.g. \fB-R\fR connect:host
-and \fB-connect\fR host), when the \fB-localhost\fR constraint is
-in effect then reverse connections can only be used
-to connect to the same machine x11vnc is running on
-(default port 5500).  Please use a ssh or stunnel port
-redirection to the viewer machine to tunnel the reverse
-connection over an encrypted channel.
-.IP
-In \fB-inetd\fR mode the Method 1) will be enforced (not
-Method 2).  With \fB-ssl\fR in effect reverse connections
-are disabled.  If you override this via env. var, be
-sure to also use encryption from the viewer to inetd.
-Tip: you can also have your own stunnel spawn x11vnc
-in \fB-inetd\fR mode (thereby bypassing inetd).  See the FAQ
-for details.
-.IP
-The user names in the comma separated [list] may have
-per-user options after a ":", e.g. "fred:opts"
-where "opts" is a "+" separated list of
-"viewonly", "fullaccess", "input=XXXX", or
-"deny", e.g. "karl,wally:viewonly,boss:input=M".
-For "input=" it is the K,M,B,C described under \fB-input.\fR
-.IP
-If an item in the list is "*" that means those
-options apply to all users.  It ALSO implies all users
-are allowed to log in after supplying a valid password.
-Use "deny" to explicitly deny some users if you use
-"*" to set a global option.  If [list] begins with the
-"!" character then "*" is ignored for checking if
-the user is allowed, but the option values associated
-with it do apply as normal.
-.IP
-There are also some utilities for checking passwords
-if [list] starts with the "%" character.  See the
-quick_pw() function for more details.  Description:
-"%-" or "%stdin" means read one line from stdin.
-"%env" means it is in $UNIXPW env var.  A leading
-"%/" or "%." means read the first line from the
-filename that follows after the % character. % by
-itself means prompt for the username and password.
-Otherwise: %user:pass   E.g. \fB-unixpw\fR %fred:swordfish
-For the other cases user:pass is read from the indicated
-source.  If the password is correct 'Y user' is printed
-and the program exit code is 0.  If the password is
-incorrect it prints 'N user' and the exit code is 1.
-If there is some other error the exit code is 2.
-This feature enables x11vnc to be a general unix user
-password checking tool; it could be used from scripts
-or other programs.  These % password checks also apply
-to the \fB-unixpw_nis\fR and \fB-unixpw_cmd\fR options.
-.IP
-For the % password check, if the env. var. UNIXPW_CMD
-is set to a command then it is run as the user (assuming
-the password is correct.)  The output of the command is
-not printed, the program or script must manage that by
-some other means.  The exit code of x11vnc will depend
-on the exit code of the command that is run.
-.IP
-Use \fB-nounixpw\fR to disable unixpw mode if it was enabled
-earlier in the cmd line (e.g. \fB-svc\fR mode)
-.PP
-\fB-unixpw_nis\fR \fI[list]\fR
-.IP
-As \fB-unixpw\fR above, however do not use 
-.IR su (1)
-but rather
-use the traditional 
-.IR getpwnam (3)
-+ 
-.IR crypt (3)
-method to
-verify passwords. All of the above \fB-unixpw\fR options and
-constraints apply.
-.IP
-This mode requires that the encrypted passwords be
-readable.  Encrypted passwords stored in /etc/shadow
-will be inaccessible unless x11vnc is run as root.
-.IP
-This is called "NIS" mode simply because in most
-NIS setups user encrypted passwords are accessible
-(e.g. "ypcat passwd") by an ordinary user and so that
-user can authenticate ANY user.
-.IP
-NIS is not required for this mode to work (only that
-.IR getpwnam (3)
-return the encrypted password is required),
-but it is unlikely it will work (as an ordinary user)
-for most modern environments unless NIS is available.
-On the other hand, when x11vnc is run as root it will
-be able to to access /etc/shadow even if NIS is not
-available (note running as root is often done when
-running x11vnc from inetd and xdm/gdm/kdm).
-.IP
-Looked at another way, if you do not want to use the
-.IR su (1)
-method provided by \fB-unixpw\fR (i.e. su_verify()), you
-can run x11vnc as root and use \fB-unixpw_nis.\fR  Any users
-with passwords in /etc/shadow can then be authenticated.
-.IP
-In \fB-unixpw_nis\fR mode, under no circumstances is x11vnc's
-user password verifying function based on su called
-(i.e. the function su_verify() that runs /bin/su
-in a pseudoterminal to verify passwords.)  However,
-if \fB-unixpw_nis\fR is used in conjunction with the \fB-find\fR
-and \fB-create\fR \fB-display\fR WAIT:... modes then, if x11vnc is
-running as root, /bin/su may be called externally to
-run the find or create commands.
-.PP
-\fB-unixpw_cmd\fR \fIcmd\fR
-.IP
-As \fB-unixpw\fR above, however do not use 
-.IR su (1)
-but rather
-run the externally supplied command \fIcmd\fR.  The first
-line of its stdin will be the username and the second
-line the received password.  If the command exits
-with status 0 (success) the VNC user will be accepted.
-It will be rejected for any other return status.
-.IP
-Dynamic passwords and non-unix passwords, e.g. LDAP,
-can be implemented this way by providing your own custom
-helper program.  Note that the remote viewer is given 3
-tries to enter the correct password, and so the program
-may be called in a row that many (or more) times.
-.IP
-If a list of allowed users is needed to limit who can
-log in, use \fB-unixpw\fR [list] in addition to this option.
-.IP
-In FINDDISPLAY and FINDCREATEDISPLAY modes the \fIcmd\fR
-will also be run with the RFB_UNIXPW_CMD_RUN env. var.
-non-empty and set to the corresponding display
-find/create command.  The first two lines of input are
-the username and passwd as in the normal case described
-above.  To support FINDDISPLAY and FINDCREATEDISPLAY,
-\fIcmd\fR should run the requested command as the user
-(and most likely refusing to run it if the password is
-not correct.)  Here is an example script (note it has
-a hardwired bogus password "abc"!)
-.IP
-#!/bin/sh
-# Example x11vnc \fB-unixpw_cmd\fR script.
-# Read the first two lines of stdin (user and passwd)
-read user
-read pass
-.IP
-debug=0
-if [ $debug = 1 ]; then
-echo "user: $user" 1>&2
-echo "pass: $pass" 1>&2
-env | egrep \fB-i\fR 'rfb|vnc' 1>&2
-fi
-.IP
-# Check if the password is valid.
-# (A real example would use ldap lookup, etc!)
-if [ "X$pass" != "Xabc" ]; then
-exit 1	# incorrect password
-fi
-.IP
-if [ "X$RFB_UNIXPW_CMD_RUN" = "X" ]; then
-exit 0	# correct password
-else
-# Run the requested command (finddisplay)
-if [ $debug = 1 ]; then
-echo "run: $RFB_UNIXPW_CMD_RUN" 1>&2
-fi
-exec /bin/su - "$user" \fB-c\fR "$RFB_UNIXPW_CMD_RUN"
-fi
-.IP
-In \fB-unixpw_cmd\fR mode, under no circumstances is x11vnc's
-user password verifying function based on su called
-(i.e. the function su_verify() that runs /bin/su in a
-pseudoterminal to verify passwords.)  It is up to the
-supplied unixpw_cmd to do user switching if desired
-and if it has the permissions to do so.
-.PP
-\fB-find\fR
-.IP
-Find the user's display using FINDDISPLAY. This
-is an alias for "\fB-display\fR \fIWAIT:cmd=FINDDISPLAY\fR".
-.IP
-Note: if a \fB-display\fR occurs later on the command line
-it will override the \fB-find\fR setting.
-.IP
-For this and the next few options see \fB-display\fR WAIT:...
-below for all of the details.
-.PP
-\fB-finddpy\fR
-.IP
-Run the FINDDISPLAY program, print out the found
-display (if any) and exit.  Output is like: DISPLAY=:0.0
-DISPLAY=:0.0,XPID=12345 or DISPLAY=:0.0,VT=7.  XPID is
-the process ID of the found X server.  VT is the Linux
-virtual terminal of the X server.
-.PP
-\fB-listdpy\fR
-.IP
-Have the FINDDISPLAY program list all of your displays
-(i.e. all the X displays on the local machine that you
-have access rights to).  x11vnc then exits.
-.PP
-\fB-findauth\fR \fI[disp]\fR
-.IP
-Apply the \fB-find/-finddpy\fR heuristics to try to guess
-the XAUTHORITY file for DISPLAY 'disp'.  If 'disp'
-is not supplied, then the value in the \fB-display\fR on
-the cmdline is used; failing that $DISPLAY is used;
-and failing that ":0" is used.  x11vnc then exits.
-.IP
-If nothing is printed out, that means no XAUTHORITY was
-found for 'disp'; i.e. failure.  If "XAUTHORITY="
-is printed out, that means use the default (i.e. do
-not set XAUTHORITY).  If "XAUTHORITY=/path/to/file"
-is printed out, then use that file.
-.IP
-XDM/GDM/KDM: if you are running x11vnc as root and want
-to find the XAUTHORITY before anyone has logged into an
-X session yet, use: x11vnc \fB-env\fR FD_XDM=1 \fB-findauth\fR ...
-(This will also find the XAUTHORITY if a user is already
-logged into the X session.)  When running as root,
-FD_XDM=1 will be tried if the initial \fB-findauth\fR fails.
-.PP
-\fB-create\fR
-.IP
-First try to find the user's display using FINDDISPLAY,
-if that doesn't succeed create an X session via the
-FINDCREATEDISPLAY method.  This is an alias for
-"\fB-display\fR \fIWAIT:cmd=FINDCREATEDISPLAY-Xvfb\fR".
-.IP
-Note: if a \fB-display\fR occurs later on the command line
-it will override the \fB-create\fR setting.
-.IP
-SSH NOTE: for both \fB-find\fR and \fB-create\fR you can (should!)
-add the "\fB-localhost\fR" option to force SSH tunnel access.
-.PP
-\fB-xdummy\fR
-.IP
-As in \fB-create,\fR except Xdummy instead of Xvfb.
-.PP
-\fB-xvnc\fR
-.IP
-As in \fB-create,\fR except Xvnc instead of Xvfb.
-.PP
-\fB-xvnc_redirect\fR
-.IP
-As in \fB-create,\fR except Xvnc.redirect instead of Xvfb.
-.PP
-\fB-xdummy_xvfb\fR
-.IP
-Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb
-.PP
-\fB-create_xsrv\fR \fIstr\fR
-.IP
-Sets WAIT:cmd=FINDCREATEDISPLAY-<str>  Can be on cmdline
-after anything that sets WAIT:.. and other things
-(e.g. \fB-svc,\fR \fB-xdmsvc)\fR to adjust the X server list.
-Example: \fB-svc\fR ... \fB-create_xsrv\fR Xdummy,X
-.PP
-\fB-svc\fR
-.IP
-Terminal services mode based on SSL access.  Alias for
-\fB-display\fR WAIT:cmd=FINDCREATEDISPLAY-Xvfb \fB-unixpw\fR \fB-users\fR
-unixpw= \fB-ssl\fR SAVE   Also "\fB-service\fR".
-.IP
-Note: if a \fB-display,\fR \fB-unixpw,\fR \fB-users,\fR or \fB-ssl\fR occurs
-later on the command line it will override the \fB-svc\fR
-setting.
-.PP
-\fB-svc_xdummy\fR
-.IP
-As \fB-svc\fR except Xdummy instead of Xvfb.
-.PP
-\fB-svc_xvnc\fR
-.IP
-As \fB-svc\fR except Xvnc instead of Xvfb.
-.PP
-\fB-svc_xdummy_xvfb\fR
-.IP
-As \fB-svc\fR with Xdummy,Xvfb.
-.PP
-\fB-xdmsvc\fR
-.IP
-Display manager Terminal services mode based on SSL.
-Alias for \fB-display\fR WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp
-\fB-unixpw\fR \fB-users\fR unixpw= \fB-ssl\fR SAVE  Also "\fB-xdm_service\fR".
-.IP
-Note: if a \fB-display,\fR \fB-unixpw,\fR \fB-users,\fR or \fB-ssl\fR occurs
-later on the command line it will override the \fB-xdmsvc\fR
-setting.
-.IP
-To create a session a user will have to first log in
-to the \fB-unixpw\fR dialog and then log in again to the
-XDM/GDM/KDM prompt.  Subsequent re-connections will
-only require the \fB-unixpw\fR password.  See the discussion
-under \fB-display\fR WAIT:... for more details about XDM,
-etc configuration.
-.IP
-Remember to enable XDMCP in the xdm-config, gdm.conf,
-or kdmrc configuration file.  See \fB-display\fR WAIT: for
-more info.
-.PP
-\fB-sshxdmsvc\fR
-.IP
-Display manager Terminal services mode based on SSH.
-Alias for \fB-display\fR WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp
-\fB-localhost.\fR
-.IP
-The \fB-localhost\fR option constrains connections to come
-in via a SSH tunnel (which will require a login).
-To create a session a user will also have to log into
-the XDM GDM KDM prompt. Subsequent re-connections will
-only only require the SSH login.  See the discussion
-under \fB-display\fR WAIT:... for more details about XDM,
-etc configuration.
-.IP
-Remember to enable XDMCP in the xdm-config, gdm.conf,
-or kdmrc configuration file.  See \fB-display\fR WAIT: for
-more info.
-.PP
-\fB-unixpw_system_greeter\fR
-.IP
-Present a "Press 'Escape' for System Greeter" option
-to the connecting VNC client in combined \fB-unixpw\fR
-and xdmcp FINDCREATEDISPLAY modes (e.g. \fB-xdmsvc).\fR
-.IP
-Normally in a \fB-unixpw\fR mode the VNC client must
-supply a valid username and password to gain access.
-However, if \fB-unixpw_system_greeter\fR is supplied AND
-the FINDCREATEDISPLAY command matches 'xdmcp', then
-the user has the option to press Escape and then get a
-XDM/GDM/KDM login/greeter panel instead. They will then
-supply a username and password directly to the greeter.
-.IP
-Otherwise, in xdmcp FINDCREATEDISPLAY mode the user
-must supply his username and password TWICE.  First to
-the initial unixpw login dialog, and second to the
-subsequent XDM/GDM/KDM greeter.  Note that if the user
-re-connects and supplies his username and password in
-the unixpw dialog the xdmcp greeter is skipped and
-he is connected directly to his existing X session.
-So the \fB-unixpw_system_greeter\fR option avoids the extra
-password at X session creation time.
-.IP
-Example:  x11vnc \fB-xdmsvc\fR \fB-unixpw_system_greeter\fR
-See \fB-unixpw\fR and \fB-display\fR WAIT:... for more info.
-.IP
-The special options after a colon at the end of the
-username (e.g. user:solid) described under \fB-display\fR
-WAIT: are also applied in this mode if they are typed
-in before the user hits Escape.  The username is ignored
-but the colon options are not.
-.IP
-The default message is 2 lines in a small font, set
-the env. var. X11VNC_SYSTEM_GREETER1=true for a 1 line
-message in a larger font.
-.IP
-If the user pressed Escape the FINDCREATEDISPLAY command
-will be run with the env. var. X11VNC_XDM_ONLY=1.
-.IP
-Remember to enable XDMCP in the xdm-config, gdm.conf,
-or kdmrc configuration file.  See \fB-display\fR WAIT: for
-more info.
-.PP
-\fB-redirect\fR \fIport\fR
-.IP
-As in FINDCREATEDISPLAY-Xvnc.redirect mode except
-redirect immediately (i.e. without X session finding
-or creation) to a VNC server listening on port. You
-can also supply host:port to redirect to a different
-machine.
-.IP
-If 0 <= port < 200 it is taken as a VNC display (5900 is
-added to get the actual port), if port < 0 then \fB-port\fR
-is used.
-.IP
-Probably the only reason to use the \fB-redirect\fR option
-is in conjunction with SSL support, e.g. \fB-ssl\fR SAVE.
-This provides an easy way to add SSL encryption to a VNC
-server that does not support SSL (e.g. Xvnc or vnc.so)
-In fact, the protocol does not even need to be VNC,
-and so "\fB-rfbport\fR \fIport1 \fB-ssl\fR SAVE \fB-redirect\fR host:port2\fR"
-can act as a replacement for 
-.IR stunnel (1).
-.IP
-This mode only allows one redirected connection.
-The \fB-forever\fR option does not apply.  Use \fB-inetd\fR or
-\fB-loop\fR for persistent service.
-.PP
-\fB-display\fR \fIWAIT:...\fR
-.IP
-A special usage mode for the normal \fB-display\fR option.
-Useful with \fB-unixpw,\fR but can be used independently
-of it.  If the display string begins with WAIT: then
-x11vnc waits until a VNC client connects before opening
-the X display (or \fB-rawfb\fR device).
-.IP
-This could be useful for delaying opening the display
-for certain usage modes (say if x11vnc is started at
-boot time and no X server is running or users logged
-in yet).
-.IP
-If the string is, e.g. WAIT:0.0 or WAIT:1, i.e. "WAIT"
-in front of a normal X display, then that indicated
-display is used.
-.IP
-One can also insert a geometry between colons, e.g.
-WAIT:1280x1024:... to set the size of the display the
-VNC client first attaches to since some VNC viewers
-will not automatically adjust to a new framebuffer size.
-.IP
-A more interesting case is like this:
-.IP
-WAIT:cmd=/usr/local/bin/find_display
-.IP
-in which case the command after "cmd=" is run to
-dynamically work out the DISPLAY and optionally the
-XAUTHORITY data.  The first line of the command output
-must be of the form DISPLAY=<xdisplay>.  On Linux
-if the virtual terminal is known append ",VT=n" to
-this string and the 
-.IR chvt (1)
-program will also be run.
-Any remaining output is taken as XAUTHORITY data.
-It can be either of the form XAUTHORITY=<file> or raw
-xauthority data for the display. For example;
-.IP
-xauth extract - $DISPLAY"
-.IP
-NOTE: As specified in the previous paragraph, you can
-supply your own WAIT:cmd=... program or script, BUT
-there are two very useful *BUILT-IN* ones: FINDDISPLAY
-(alias \fB-find\fR above) and FINDCREATEDISPLAY (alias \fB-create\fR
-above.)  Most people use these instead of creating
-their own script.  Read the following (especially the
-BUILT-IN modes sections) to see how to configure these
-two useful builtin \fB-display\fR WAIT: modes.
-.IP
-In the case of \fB-unixpw\fR (and \fB-unixpw_nis\fR only if x11vnc
-is running as root), then the cmd= command is run
-as the user who just authenticated via the login and
-password prompt.
-.IP
-In the case of \fB-unixpw_cmd,\fR the commands will also be
-run as the logged-in user, as long as the user-supplied
-helper program supports RFB_UNIXPW_CMD_RUN (see the
-\fB-unixpw_cmd\fR option.)
-.IP
-Also in the case of \fB-unixpw,\fR the user logging in can
-place a colon at the end of her username and supply
-a few options: scale=, scale_cursor= (or sc=), solid
-(or so), id=, clear_mods (or cm), clear_keys (or
-ck), clear_all (or ca), repeat, speeds= (or sp=),
-readtimeout= (or rd=), viewonly (or vo), nodisplay=
-(or nd=), rotate= (or ro=), or noncache (or nc),
-all separated by commas if there is more than one.
-After the user logs in successfully, these options will
-be applied to the VNC screen.  For example,
-.IP
-login: fred:scale=3/4,sc=1,repeat
-Password: ...
-.IP
-login: runge:sp=modem,rd=120,solid
-.IP
-for convenience m/n implies scale= e.g. fred:3/4  If you
-type and enter your password incorrectly, to retrieve
-your long "login:" line press the Up arrow once
-(before typing anything else).
-.IP
-Most of these colon options only apply to the builtin
-FINDDISPLAY and FINDCREATEDISPLAY modes, but note
-that they are passed to the extrenal command in the
-environment as well and so could be used.
-.IP
-In the login panel, press F1 to get a list of the
-available options that you can add after the username.
-.IP
-Another option is "geom=WxH" or "geom=WxHxD" (or
-ge=). This only has an effect in FINDCREATEDISPLAY
-mode when a virtual X server such as Xvfb is going
-to be created.  It sets the width and height of
-the new display, and optionally the color depth as
-well.
-.IP
-You can also supply "gnome", "kde", "twm",
-"fvwm", "mwm", "dtwm", "wmaker", "xfce",
-"lxde", "enlightenment", "Xsession", or
-"failsafe" (same as "xterm") to have the created
-display use that mode for the user session.
-.IP
-Specify "tag=..." to set the unique FD_TAG desktop
-session tag described below.  Note: this option will
-be ignored if the FD_TAG env. var. is already set or
-if the viewer-side supplied value is not completely
-composed of alphanumeric or '_' or '-' characters.
-.IP
-User preferences file: Instead of having the user type
-in geom=WxH,... etc. every time he logs in to find
-or create his X session, if you set FD_USERPREFS to
-a string that does not contain the "/" character,
-then the user's home directory is prepended to that
-string and if the file exists its first line is read
-and appended to any options he supplied at the login:
-prompt.  For example \fB-env\fR FD_USERPREFS=.x11vnc_create
-and the user put "geom=1600x1200" in his
-~/.x11vnc_create file.
-.IP
-To disable the option setting set the environment
-variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
-To set any other options, the user can use the gui
-(x11vnc \fB-gui\fR connect) or the remote control method
-(x11vnc \fB-R\fR opt:val) during his VNC session.
-.IP
-So we see the combination of \fB-display\fR WAIT:cmd=... and
-\fB-unixpw\fR allows automatic pairing of an unix
-authenticated VNC user with his desktop.  This could
-be very useful on SunRays and also any system where
-multiple users share a given machine.  The user does
-not need to remember special ports or passwords set up
-for his desktop and VNC.
-.IP
-A nice way to use WAIT:cmd=... is out of 
-.IR inetd (8)
-(it automatically forks a new x11vnc for each user).
-You can have the x11vnc inetd spawned process run as,
-say, root or nobody.  When run as root (for either inetd
-or display manager), you can also supply the option
-"\fB-users\fR \fIunixpw=\fR" to have the x11vnc process switch to
-the user as well.  Note: there will be a 2nd SSL helper
-process that will not switch, but it is only encoding
-and decoding the encrypted stream at that point.
-.IP
-BUILT-IN modes:
-.IP
-\fB--\fR Automatic Finding of User X Sessions \fB--\fR
-.IP
-As a special case, WAIT:cmd=FINDDISPLAY will run a
-script that works on most Unixes to determine a user's
-DISPLAY variable and xauthority data (see 
-.IR who (1)
-).
-.IP
-NOTE: The option "\fB-find\fR" is an alias for this mode.
-.IP
-To have this default script printed to stdout (e.g. for
-customization) run with WAIT:cmd=FINDDISPLAY-print To
-have the script run to print what display it would find
-use "\fB-finddpy\fR" or WAIT:cmd=FINDDISPLAY-run
-.IP
-The standard script runs 
-.IR xdpyinfo (1)
-run on potential
-displays.  If your X server(s) have a login greeter
-that exclusively grabs the Xserver, then xdpyinfo
-blocks forever and this mode will not work.  See
-www.karlrunge.com/x11vnc/faq.html#faq-display-manager
-for how to disable this for dtgreet on Solaris and
-possibly for other greeters.
-.IP
-In \fB-find/cmd=FINDDISPLAY\fR mode, if you set FD_XDM=1,
-e.g. 'x11vnc \fB-env\fR FD_XDM=1 \fB-find\fR ...' and x11vnc is
-running as root (e.g. inetd) then it will try to find
-the XAUTHORITY file of a running XDM/GDM/KDM login
-greeter (i.e. no user has logged into an X session yet.)
-.IP
-As another special case, WAIT:cmd=HTTPONCE will allow
-x11vnc to service one http request and then exit.
-This is usually done in \fB-inetd\fR mode to run on, say,
-port 5800 and allow the Java vncviewer to be downloaded
-by client web browsers.  For example:
-.IP
-5815 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc \\
-\fB-inetd\fR \fB-q\fR \fB-http_ssl\fR \fB-prog\fR /.../x11vnc \\
-\fB-display\fR WAIT:cmd=HTTPONCE
-.IP
-Where /.../x11vnc is the full path to x11vnc.
-It is used in the Apache SSL-portal example (see FAQ).
-.IP
-In this mode you can set X11VNC_SKIP_DISPLAY to a
-comma separated list of displays (e.g. ":0,:1") to
-ignore in the finding process.  The ":" is optional.
-Ranges n-m e.g. 0-20 can also be supplied. This string
-can also be set by the connecting user via "nd="
-using "+" instead of ","  If "nd=all" or you set
-X11VNC_SKIP_DISPLAY=all then all display finding fails
-as if you set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below.)
-.IP
-On some systems 
-.IR lsof (1)
-can be very slow.  Set the
-env. var. FIND_DISPLAY_NO_LSOF=1 to skip using lsof to
-try to find the Linux VT the X server is running on.
-set FIND_DISPLAY_NO_VT_FIND=1 to avoid looking at all.
-.IP
-\fB--\fR Automatic Creation of User X Sessions \fB--\fR
-.IP
-An interesting option is WAIT:cmd=FINDCREATEDISPLAY
-that is like FINDDISPLAY in that is uses the same method
-to find an existing display.  However, if it does not
-find one it will try to *start* up an X server session
-for the user.  This is the only time x11vnc tries to
-actually start up an X server.
-.IP
-NOTE: The option "\fB-create\fR" is an alias for this mode.
-.IP
-It will start looking for an open display number at :20
-Override via X11VNC_CREATE_STARTING_DISPLAY_NUMBER=n
-By default 80 X displays are allowed (i.e. going to :99)
-Override via X11VNC_CREATE_MAX_DISPLAYS=n
-.IP
-For its heuristics, the create display script sets
-LC_ALL=C so that command output is uniform.  By default
-it will try to restore LC_ALL right before starting the
-user session.  However, if you don't mind it keeping
-LC_ALL=C set the env. var.: X11VNC_CREATE_LC_ALL_C_OK=1
-.IP
-By default FINDCREATEDISPLAY will try Xvfb and then
-Xdummy:
-.IP
-The Xdummy wrapper is part of the x11vnc source code
-(x11vnc/misc/Xdummy)  It should be available in PATH
-and have run "Xdummy \fB-install"\fR once to create the
-shared library.  Xdummy only works on Linux.  As of
-12/2009 it no longer needs to be run as root, and the
-default is to not run as root.  In some circumstances
-permissions may require running it as root, in these
-cases specify FD_XDUMMY_RUN_AS_ROOT=1, this is the same
-as supplying \fB-root\fR to the Xdummy cmdline.
-.IP
-Xvfb is available on most platforms and does not
-require root.
-.IP
-An advantage of Xdummy over Xvfb is that Xdummy supports
-RANDR dynamic screen resizing.
-.IP
-When x11vnc exits (i.e. user disconnects) the X
-server session stays running in the background.
-The FINDDISPLAY will find it directly next time.
-The user must exit the X session in the usual way for
-it to terminate (or kill the X server process if all
-else fails).
-.IP
-To troubleshoot the FINDCREATEDISPLAY mechanism,
-set the following env. var. to an output log file,
-e.g \fB-env\fR CREATE_DISPLAY_OUTPUT=/tmp/mydebug.txt
-.IP
-So this is a somewhat odd mode for x11vnc in that it
-will start up and poll virtual X servers!  This can
-be used from, say, 
-.IR inetd (8)
-to provide a means of
-definitely getting a desktop (either real or virtual)
-on the machine.  E.g. a desktop service:
-.IP
-5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc
-\fB-inetd\fR \fB-q\fR \fB-http\fR \fB-ssl\fR SAVE \fB-unixpw\fR \fB-users\fR unixpw=\\
-\fB-passwd\fR secret \fB-prog\fR /.../x11vnc \\
-\fB-display\fR WAIT:cmd=FINDCREATEDISPLAY
-.IP
-Where /.../x11vnc is the full path to x11vnc.
-.IP
-See the \fB-svc/-service\fR option alias above.
-.IP
-If for some reason you do not want x11vnc to ever
-try to find an existing display set the env. var
-X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (also \fB-env\fR ...)
-This is the same as setting X11VNC_SKIP_DISPLAY=all or
-supplying "nd=all" after "username:"
-.IP
-Use WAIT:cmd=FINDCREATEDISPLAY-print to print out the
-script that is used for this.
-.IP
-You can specify the preferred X server order via e.g.,
-WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X  and/or leave
-out ones you do not want.  The the case "X" means try
-to start up a real, hardware X server using 
-.IR xinit (1)
-or 
-.IR startx (1).
-If there is already an X server running
-the X case may only work on Linux (see 
-.IR startx (1)
-).
-.IP
-"Xvnc" will start up a VNC X server (real-
-or tight-vnc, e.g. use if Xvfb is not available).
-"Xsrv" will start up the server program in the
-variable "FD_XSRV" if it is non-empty. You can make
-this be a wrapper script if you like (it must handle :N,
-\fB-geometry,\fR and \fB-depth\fR and other X server options).
-.IP
-You can set the environment variable FD_GEOM (or
-X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width
-and height and optionally the color depth of the
-created display.  You can also set FD_SESS to be the
-session (short name of the windowmanager: kde, gnome,
-twm, failsafe, etc.). FD_OPTS contains extra options
-to pass to the X server. You can also set FD_PROG to
-be the full path to the session/windowmanager program.
-.IP
-More FD tricks:  FD_CUPS=port or FD_CUPS=host:port
-will set the cups printing environment.  Similarly for
-FD_ESD=port or FD_ESD=host:port for esddsp sound
-redirection.  Set FD_EXTRA to a command to be run a
-few seconds after the X server starts up.  Set FD_TAG
-to be a unique name for the session, it is set as an
-X property, that makes FINDDISPLAY only find sessions
-with that tag value.
-.IP
-Set FD_XDMCP_IF to the network interface that the
-display manager is running on; default is 'localhost'
-but you may need to set it to '::1' on some IPv6 only
-systems or misconfigured display managers.
-.IP
-If you want the FINDCREATEDISPLAY session to contact an
-XDMCP login manager (xdm/gdm/kdm) on the same machine,
-then use "Xvfb.xdmcp" instead of "Xvfb", etc.
-The user will have to supply his username and password
-one more time (but he gets to select his desktop type
-so that can be useful).  For this to work, you will
-need to enable localhost XDMCP (udp port 177) for the
-display manager.  This seems to be:
-.IP
-for gdm in gdm.conf:   Enable=true in section [xdmcp]
-for kdm in kdmrc:      Enable=true in section [Xdmcp]
-for xdm in xdm-config: DisplayManager.requestPort: 177
-.IP
-See the shorthand options above "\fB-svc\fR", "\fB-xdmsvc\fR"
-and "\fB-sshxdmsvc\fR" that specify the above options for
-some useful cases.
-.IP
-If you set the env. var WAITBG=1 x11vnc will go into
-the background once listening in wait mode.
-.IP
-Another special mode is FINDCREATEDISPLAY-Xvnc.redirect,
-(or FINDDISPLAY-Xvnc.redirect).  In this case it will
-start up Xvnc as above if needed, but instead of
-polling it in its normal way, it simply does a socket
-redirection of the connected VNC viewer to the Xvnc.
-.IP
-So in Xvnc.redirect x11vnc does no VNC but merely
-transfers the data back and forth.  This should be
-faster then x11vnc's polling method, but not as fast
-as connecting directly to the Xvnc with the VNC Viewer.
-The idea here is to take advantage of x11vnc's display
-finding/creating scheme, SSL, and perhaps a few others.
-Most of x11vnc's options do not apply in this mode.
-.IP
-Xvnc.redirect should also work for the vnc.so X server
-module for the h/w display however it will work only
-for finding the display and the user must already be
-logged into the X console.
-.PP
-\fB-vencrypt\fR \fImode\fR
-.IP
-The VeNCrypt extension to the VNC protocol allows
-encrypted SSL/TLS connections.  If the \fB-ssl\fR mode is
-enabled, then VeNCrypt is enabled as well BY DEFAULT
-(they both use a SSL/TLS tunnel, only the protocol
-handshake is a little different.)
-.IP
-To control when and how VeNCrypt is used, specify the
-mode string.  If mode is "never", then VeNCrypt is
-not used.  If mode is "support" (the default) then
-VeNCrypt is supported.  If mode is "only", then the
-similar and older ANONTLS protocol is not simultaneously
-supported.  x11vnc's normal SSL mode (vncs://) will be
-supported under \fB-ssl\fR unless you set mode to "force".
-.IP
-If mode is prefixed with "nodh:", then Diffie Hellman
-anonymous key exchange is disabled.  If mode is prefixed
-with "nox509:", then X509 key exchange is disabled.
-.IP
-To disable all Anonymous Diffie-Hellman access
-(susceptible to Man-In-The-Middle attack) you will need
-to supply "\fB-vencrypt\fR \fInodh:support \fB-anontls\fR never\fR"
-or "\fB-vencrypt\fR \fInodh:only\fR"
-.IP
-If mode is prefixed with "newdh:", then new Diffie
-Hellman parameters are generated for each connection
-(this can be time consuming: 1-60 secs; see \fB-dhparams\fR
-below for a faster way) rather than using the
-fixed values in the program.  Using fixed, publicly
-known values is not known to be a security problem.
-This setting applies to ANONTLS as well.
-.IP
-Long example: \fB-vencrypt\fR newdh:nox509:support
-.IP
-Also, if mode is prefixed with "plain:", then
-if \fB-unixpw\fR mode is active the VeNCrypt "*Plain"
-username+passwd method is enabled for Unix logins.
-Otherwise in \fB-unixpw\fR mode the normal login panel is
-provided.
-.IP
-You *MUST* supply the \fB-ssl\fR option for VeNCrypt to
-be active.  The \fB-vencrypt\fR option only fine-tunes its
-operation.
-.PP
-\fB-anontls\fR \fImode\fR
-.IP
-The ANONTLS extension to the VNC protocol allows
-encrypted SSL/TLS connections.  If the \fB-ssl\fR mode is
-enabled, then ANONTLS is enabled as well BY DEFAULT
-(they both use a SSL/TLS tunnel, only the protocol
-handshake is a little different.)
-.IP
-ANONTLS is an older SSL/TLS mode introduced by vino.
-.IP
-It is referred to as 'TLS' for its registered VNC
-security-type name, but we use the more descriptive
-\'ANONTLS' here because it provides only Anonymous
-Diffie-Hellman encrypted connections, and hence no
-possibility for certificate authentication.
-.IP
-To control when and how ANONTLS is used, specify the
-mode string.  If mode is "never", then ANONTLS is not
-used.  If mode is "support" (the default) then ANONTLS
-is supported.  If mode is "only", then the similar
-VeNCrypt protocol is not simultaneously supported.
-x11vnc's normal SSL mode (vncs://) will be supported
-under \fB-ssl\fR unless you set mode to "force".
-.IP
-If mode is prefixed with "newdh:", then new Diffie
-Hellman parameters are generated for each connection
-(this can be time consuming: 1-60 secs; see \fB-dhparams\fR
-below for a faster way) rather than using the
-fixed values in the program.  Using fixed, publicly
-known values is not known to be a security problem.
-This setting applies to VeNCrypt as well.  See the
-description of "plain:" under \fB-vencrypt.\fR
-.IP
-Long example: \fB-anontls\fR newdh:plain:support
-.IP
-You *MUST* supply the \fB-ssl\fR option for ANONTLS to
-be active.  The \fB-anontls\fR option only fine-tunes its
-operation.
-.PP
-\fB-sslonly\fR
-.IP
-Same as: "\fB-vencrypt\fR \fInever \fB-anontls\fR never\fR"  i.e. it
-disables the VeNCrypt and ANONTLS encryption methods
-and only allows standard SSL tunneling.  You must also
-supply the \fB-ssl\fR ... option (see below.)
-.PP
-\fB-dhparams\fR \fIfile\fR
-.IP
-For some operations a set of Diffie Hellman parameters
-(prime and generator) is needed.  If so, use the
-parameters in \fIfile\fR. In particular, the VeNCrypt and
-ANONTLS anonymous DH mode need them.  By default a
-fixed set is used. If you do not want to do that you
-can specify "newdh:" to the \fB-vencrypt\fR and \fB-anontls\fR
-options to generate a new set each session.  If that
-is too slow for you, use \fB-dhparams\fR file to a set you
-created manually via "openssl dhparam \fB-out\fR file 1024"
-.PP
-\fB-nossl\fR
-.IP
-Disable the \fB-ssl\fR option (see below). Since \fB-ssl\fR is off
-by default \fB-nossl\fR would only be used on the commandline
-to unset any *earlier* \fB-ssl\fR option (or \fB-svc...)\fR
-.PP
-\fB-ssl\fR \fI[pem]\fR
-.IP
-Use the openssl library (www.openssl.org) to provide a
-built-in encrypted SSL/TLS tunnel between VNC viewers
-and x11vnc.  This requires libssl support to be
-compiled into x11vnc at build time.  If x11vnc is not
-built with libssl support it will exit immediately when
-\fB-ssl\fR is prescribed.  See the \fB-stunnel\fR option below for
-an alternative.
-.IP
-The VNC Viewer-side needs to support SSL/TLS as well.
-See this URL and also the discussion below for
-ideas on how to enable SSL support for the viewer:
-http://www.karlrunge.com/x11vnc/faq.html#faq-ssl-tun
-nel-viewers .  x11vnc provides an SSL enabled Java
-viewer applet in the classes/ssl directory (-http or
-\fB-httpdir\fR options.)  The SSVNC viewer package supports
-SSL tunnels too.
-.IP
-If the VNC Viewer supports VeNCrypt or ANONTLS (vino's
-encryption mode) they are also supported by the \fB-ssl\fR
-mode (see the \fB-vencrypt\fR and \fB-anontls\fR options for more
-info; use \fB-sslonly\fR to disable both of them.)
-.IP
-Use "\fB-ssl\fR \fI/path/to/mycert.pem\fR" to specify an SSL
-certificate file in PEM format to use to identify and
-provide a key for this server.  See 
-.IR openssl (1)
-for more
-info about PEMs and the \fB-sslGenCert\fR and "\fB-ssl\fR \fISAVE\fR"
-options below for how to create them.
-.IP
-The connecting VNC viewer SSL tunnel can (at its option)
-authenticate this server if it has the public key part
-of the certificate (or a common certificate authority,
-CA, is a more sophisticated way to verify this server's
-cert, see \fB-sslGenCA\fR below).  This authentication is
-done to prevent Man-In-The-Middle attacks.  Otherwise,
-if the VNC viewer simply accepts this server's key
-WITHOUT verification, the traffic is protected from
-passive sniffing on the network, but *NOT* from
-Man-In-The-Middle attacks. There are hacker tools
-like dsniff/webmitm and cain that implement SSL
-Man-In-The-Middle attacks.
-.IP
-If [pem] is empty or the string "SAVE" then the
-.IR openssl (1)
-command must be available to generate the
-certificate the first time.  A self-signed certificate
-is generated (see \fB-sslGenCA\fR and \fB-sslGenCert\fR for use
-of a Certificate Authority.)  It will be saved to the
-file ~/.vnc/certs/server.pem.  On subsequent calls if
-that file already exists it will be used directly.
-.IP
-Use "SAVE_NOPROMPT" to avoid being prompted to
-protect the generated key with a passphrase.  However in
-\fB-inetd\fR and \fB-bg\fR modes there will be no prompting for a
-passphrase in either case.
-.IP
-If [pem] is "SAVE_PROMPT" the server.pem certificate
-will be created based on your answers to its prompts for
-all info such as OrganizationalName, CommonName, etc.
-.IP
-Use "SAVE-<string>" and "SAVE_PROMPT-<string>"
-to refer to the file ~/.vnc/certs/server-<string>.pem
-instead (it will be generated if it does not already
-exist).  E.g. "SAVE-charlie" will store to the file
-~/.vnc/certs/server-charlie.pem
-.IP
-Examples: x11vnc \fB-ssl\fR SAVE \fB-display\fR :0 ...
-x11vnc \fB-ssl\fR SAVE-someother \fB-display\fR :0 ...
-.IP
-If [pem] is "TMP" and the 
-.IR openssl (1)
-utility
-command exists in PATH, then a temporary, self-signed
-certificate will be generated for this session.  If
-.IR openssl (1)
-cannot be used to generate a temporary
-certificate x11vnc exits immediately.  The temporary
-cert will be discarded when x11vnc exits.
-.IP
-If successful in using 
-.IR openssl (1)
-to generate a
-temporary certificate in "SAVE" or "TMP" creation
-modes, the public part of it will be displayed to stderr
-(e.g. one could copy it to the client-side to provide
-authentication of the server to VNC viewers.)
-.IP
-NOTE: In "TMP" mode, unless you safely copy the
-public part of the temporary Cert to the viewer for
-authenticate *every time* (unlikely...), then only
-passive sniffing attacks are prevented and you are
-still open to Man-In-The-Middle attacks.  This is
-why the default "SAVE" mode is preferred (and more
-sophisticated CA mode too).  Only with saved keys AND
-the VNC viewer authenticating them (via the public
-certificate), are Man-In-The-Middle attacks prevented.
-.IP
-If [pem] is "ANON" then the Diffie-Hellman anonymous
-key exchange method is used.  In this mode there
-are *no* SSL certificates and so it is not possible
-to authenticate either the VNC server or VNC client.
-Thus only passive network sniffing attacks are avoided:
-the "ANON" method is susceptible to Man-In-The-Middle
-attacks.  "ANON" is not recommended; instead use
-a SSL PEM you created or the default "SAVE" method.
-.IP
-See \fB-ssldir\fR below to use a directory besides the
-default ~/.vnc/certs
-.IP
-If your x11vnc binary was not compiled with OpenSSL
-library support, use of the \fB-ssl\fR option will induce an
-immediate failure and exit.  For such binaries, consider
-using the \fB-stunnel\fR option for SSL encrypted connections.
-.IP
-Misc Info: In temporary cert creation mode "TMP", set
-the env. var. X11VNC_SHOW_TMP_PEM=1 to have x11vnc print
-out the entire certificate, including the PRIVATE KEY
-part, to stderr.  There are better ways to get/save this
-info.  See "SAVE" above and "\fB-sslGenCert\fR" below.
-.PP
-\fB-ssltimeout\fR \fIn\fR
-.IP
-Set SSL read timeout to n seconds.  In some situations
-(i.e. an iconified viewer in Windows) the viewer stops
-talking and the connection is dropped after the default
-timeout (25s for about the first minute, 43200s later).
-Set to zero to poll forever.  Set to a negative value
-to use the builtin setting.
-.IP
-Note that this value does NOT apply to the *initial* ssl
-init connection.  The default timeout for that is 20sec.
-Use \fB-env\fR SSL_INIT_TIMEOUT=n to modify it.
-.PP
-\fB-sslnofail\fR
-.IP
-Exit at the first SSL connection failure. Useful when
-scripting SSL connections (e.g. x11vnc is started via
-ssh) and you do not want x11vnc waiting around for more
-connections, tying up ports, etc.
-.PP
-\fB-ssldir\fR \fIdir\fR
-.IP
-Use \fIdir\fR as an alternate ssl certificate and key
-management toplevel directory.  The default is
-~/.vnc/certs
-.IP
-This directory is used to store server and other
-certificates and keys and also other materials.  E.g. in
-the simplest case, "\fB-ssl\fR \fISAVE\fR" will store the x11vnc
-server cert in dir/server.pem
-.IP
-Use of alternate directories via \fB-ssldir\fR allows you to
-manage multiple VNC Certificate Authority (CA) keys.
-Another use is if ~/.vnc/cert is on an NFS share you
-might want your certificates and keys to be on a local
-filesystem to prevent network snooping (for example
-\fB-ssldir\fR /var/lib/x11vnc-certs).
-.IP
-\fB-ssldir\fR affects nearly all of the other \fB-ssl*\fR options,
-e.g. \fB-ssl\fR SAVE, \fB-sslGenCert,\fR etc..
-.PP
-\fB-sslverify\fR \fIpath\fR
-.IP
-For either of the \fB-ssl\fR or \fB-stunnel\fR modes, use \fIpath\fR
-to provide certificates to authenticate incoming VNC
-*Client* connections (normally only the server is
-authenticated in SSL.)  This can be used as a method
-to replace standard password authentication of clients.
-.IP
-If \fIpath\fR is a directory it contains the client (or CA)
-certificates in separate files.  If path is a file,
-it contains one or more certificates. See special tokens
-below.  These correspond to the "CApath = dir" and
-"CAfile = file" stunnel options.  See the 
-.IR stunnel (8)
-manpage for details.
-.IP
-Examples:
-x11vnc \fB-ssl\fR \fB-sslverify\fR ~/my.crt
-x11vnc \fB-ssl\fR \fB-sslverify\fR ~/my_pem_dir/
-.IP
-Note that if path is a directory, it must contain
-the certs in separate files named like <HASH>.0, where
-the value of <HASH> is found by running the command
-"openssl x509 \fB-hash\fR \fB-noout\fR \fB-in\fR file.crt". Evidently
-one uses <HASH>.1 if there is a collision...
-.IP
-The the key-management utility "\fB-sslCertInfo\fR \fIHASHON\fR"
-and "\fB-sslCertInfo\fR \fIHASHOFF\fR" will create/delete these
-hashes for you automatically (via symlink) in the HASH
-subdirs it manages.  Then you can point \fB-sslverify\fR to
-the HASH subdir.
-.IP
-Special tokens: in \fB-ssl\fR mode, if \fIpath\fR is not a file or
-a directory, it is taken as a comma separated list of
-tokens that are interpreted as follows:
-.IP
-If a token is "CA" that means load the CA/cacert.pem
-file from the ssl directory.  If a token is "clients"
-then all the files clients/*.crt in the ssl directory
-are loaded.  Otherwise the file clients/token.crt
-is attempted to be loaded.  As a kludge, use a token
-like ../server-foo to load a server cert if you find
-that necessary.
-.IP
-Use \fB-ssldir\fR to use a directory different from the
-~/.vnc/certs default.
-.IP
-Note that if the "CA" cert is loaded you do not need
-to load any of the certs that have been signed by it.
-You will need to load any additional self-signed certs
-however.
-.IP
-Examples:
-x11vnc \fB-ssl\fR \fB-sslverify\fR CA
-x11vnc \fB-ssl\fR \fB-sslverify\fR self:fred,self:jim
-x11vnc \fB-ssl\fR \fB-sslverify\fR CA,clients
-.IP
-Usually "\fB-sslverify\fR \fICA\fR" is the most effective.
-See the \fB-sslGenCA\fR and \fB-sslGenCert\fR options below for
-how to set up and manage the CA framework.
-.IP
-NOTE: the following utilities, \fB-sslGenCA,\fR \fB-sslGenCert,\fR
-\fB-sslEncKey,\fR \fB-sslCertInfo,\fR and \fB-sslCRL\fR are provided for
-completeness, but for casual usage they are overkill.
-.IP
-They provide VNC Certificate Authority (CA) key creation
-and server / client key generation and signing.  So they
-provide a basic Public Key management framework for
-VNC-ing with x11vnc. (note that they require 
-.IR openssl (1)
-be installed on the system)
-.IP
-However, the simplest usage mode, "\fB-ssl\fR \fITMP\fR" (where
-x11vnc automatically generates its own, self-signed,
-temporary key and the VNC viewers always accept it,
-e.g. accepting via a dialog box) is probably safe enough
-for most scenarios.  CA management is not needed.
-.IP
-To protect against Man-In-The-Middle attacks the "TMP"
-mode can be improved by using "\fB-ssl\fR \fISAVE\fR" (same as
-"\fB-ssl\fR", i.e. the default) to have x11vnc create a
-longer term self-signed certificate, and then (safely)
-copy the corresponding public key cert to the desired
-client machines (care must be taken the private key part
-is not stolen; you will be prompted for a passphrase).
-.IP
-So keep in mind no CA key creation or management
-(-sslGenCA and \fB-sslGenCert)\fR is needed for either of
-the above two common usage modes.
-.IP
-One might want to use \fB-sslGenCA\fR and \fB-sslGenCert\fR
-if you had a large number of VNC client and server
-workstations.  That way the administrator could generate
-a single CA key with \fB-sslGenCA\fR and distribute its
-certificate part to all of the workstations.
-.IP
-Next, he could create signed VNC server keys
-(-sslGenCert server ...) for each workstation or user
-that then x11vnc would use to authenticate itself to
-any VNC client that has the CA cert.
-.IP
-Optionally, the admin could also make it so the
-VNC clients themselves are authenticated to x11vnc
-(-sslGenCert client ...)  For this \fB-sslverify\fR would be
-pointed to the CA cert (and/or self-signed certs).
-.IP
-x11vnc will be able to use all of these cert and
-key files.  On the VNC client side, they will need to
-be "imported" somehow.  Web browsers have "Manage
-Certificates" actions as does the Java applet plugin
-Control Panel.  stunnel can also use these files (see
-the ss_vncviewer example script in the FAQ and SSVNC.)
-.PP
-\fB-sslCRL\fR \fIpath\fR
-.IP
-Set the Certificate Revocation Lists (CRL) to \fIpath\fR.
-This setting applies for both \fB-ssl\fR and \fB-stunnel\fR modes.
-.IP
-If path is a file, the file contains one or more CRLs
-in PEM format.  If path is a directory, it contains
-hash named files of CRLs in the usual OpenSSL manner.
-See the OpenSSL and 
-.IR stunnel (8)
-documentation for
-more info.
-.IP
-This option only applies if \fB-sslverify\fR has been
-supplied: it checks for revocation along the
-certificate chain used to verify the VNC client.
-The \fB-sslCRL\fR setting will be ignored when \fB-sslverify\fR is
-not specified.
-.IP
-Note that if a CRL's expiration date has passed, all
-SSL connections will fail regardless of if they are
-related to the subject of the CRL or not.
-.IP
-Only rarely will one's x11vnc \fB-ssl\fR infrastructure be so
-large that this option would be useful (since normally
-maintaining the contents of the \fB-sslverify\fR file or
-directory should be enough.)  However, when using
-x11vnc with a Certificate Authority (see \fB-sslGenCA)\fR
-to authenticate Clients via SSL/TLS, the \fB-sslCRL\fR option
-can be useful to revoke users' certs whose private SSL
-keys were lost or stolen (e.g. laptop.)  This way a new
-CA cert+key does not need to be created and new signed
-client keys generated and distributed to all users.
-.IP
-To create a CRL file with revoked certificates the
-commands 'openssl ca \fB-revoke\fR ...' and 'openssl ca
-\fB-gencrl\fR ...' are useful.  (Run them in ~/.vnc/certs)
-.PP
-\fB-sslGenCA\fR \fI[dir]\fR
-.IP
-Generate your own Certificate Authority private key,
-certificate, and other files in directory [dir].
-x11vnc then exits.
-.IP
-If [dir] is not supplied, a \fB-ssldir\fR setting is used,
-or otherwise ~/.vnc/certs is used.
-.IP
-This command also creates directories where server and
-client certs and keys will be stored.  The 
-.IR openssl (1)
-program must be installed on the system and available
-in PATH.
-.IP
-After the CA files and directories are created the
-x11vnc command exits; the VNC server is not run.
-.IP
-You will be prompted for information to put into the CA
-certificate.  The info does not have to be accurate just
-as long as clients accept the cert for VNC connections.
-You will also need to supply a passphrase of at least
-4 characters for the CA private key.
-.IP
-Once you have generated the CA you can distribute
-its certificate part, [dir]/CA/cacert.pem, to other
-workstations where VNC viewers will be run.  One will
-need to "import" this certificate in the applications,
-e.g. Web browser, Java applet plugin, stunnel, etc.
-Next, you can create and sign keys using the CA with
-the \fB-sslGenCert\fR option below.
-.IP
-Examples:
-x11vnc \fB-sslGenCA\fR
-x11vnc \fB-sslGenCA\fR  ~/myCAdir
-x11vnc \fB-ssldir\fR ~/myCAdir \fB-sslGenCA\fR
-.IP
-(the last two lines are equivalent)
-.PP
-\fB-sslGenCert\fR \fItype\fR \fIname\fR
-.IP
-Generate a VNC server or client certificate and private
-key pair signed by the CA created previously with
-\fB-sslGenCA.\fR  The 
-.IR openssl (1)
-program must be installed
-on the system and available in PATH.
-.IP
-After the Certificate is generated x11vnc exits; the
-VNC server is not run.
-.IP
-The type of key to be generated is the string \fItype\fR.
-It is either "server" (i.e. for use by x11vnc) or
-"client" (for a VNC viewer).  Note that typically
-only "server" is used: the VNC clients authenticate
-themselves by a non-public-key method (e.g. VNC or
-unix password).  \fItype\fR is required.
-.IP
-An arbitrary default name you want to associate with
-the key is supplied by the \fIname\fR string.  You can
-change it at the various prompts when creating the key.
-\fIname\fR is optional.
-.IP
-If name is left blank for clients keys then "nobody"
-is used.  If left blank for server keys, then the
-primary server key: "server.pem" is created (this
-is the saved one referenced by "\fB-ssl\fR \fISAVE\fR" when the
-server is started)
-.IP
-If \fIname\fR begins with the string "self:" then
-a self-signed certificate is created instead of one
-signed by your CA key.
-.IP
-If \fIname\fR begins with the string "req:" then only a
-key (.key) and a certificate signing *request* (.req)
-are generated.  You can then send the .req file to
-an external CA (even a professional one, e.g. Thawte)
-and then combine the .key and the received cert into
-the .pem file with the same basename.
-.IP
-The distinction between "server" and "client" is
-simply the choice of output filenames and sub-directory.
-This makes it so the \fB-ssl\fR SAVE-name option can easily
-pick up the x11vnc PEM file this option generates.
-And similarly makes it easy for the \fB-sslverify\fR option
-to pick up your client certs.
-.IP
-There is nothing special about the filename or directory
-location of either the "server" and "client" certs.
-You can rename the files or move them to wherever
-you like.
-.IP
-Precede this option with \fB-ssldir\fR [dir] to use a
-directory other than the default ~/.vnc/certs You will
-need to run \fB-sslGenCA\fR on that directory first before
-doing any \fB-sslGenCert\fR key creation.
-.IP
-Note you cannot recreate a cert with exactly the same
-distiguished name (DN) as an existing one.  To do so,
-you will need to edit the [dir]/CA/index.txt file to
-delete the line.
-.IP
-Similar to \fB-sslGenCA,\fR you will be prompted to fill
-in some information that will be recorded in the
-certificate when it is created.
-.IP
-Tip: if you know the fully-qualified hostname other
-people will be connecting to, you can use that as the
-CommonName "CN" to avoid some applications (e.g. web
-browsers and java plugin) complaining that it does not
-match the hostname.
-.IP
-You will also need to supply the CA private key
-passphrase to unlock the private key created from
-\fB-sslGenCA.\fR  This private key is used to sign the server
-or client certificate.
-.IP
-The "server" certs can be used by x11vnc directly by
-pointing to them via the \fB-ssl\fR [pem] option.  The default
-file will be ~/.vnc/certs/server.pem.  This one would
-be used by simply typing \fB-ssl\fR SAVE.  The pem file
-contains both the certificate and the private key.
-server.crt file contains the cert only.
-.IP
-The "client" cert + private key file will need
-to be copied and imported into the VNC viewer
-side applications (Web browser, Java plugin,
-stunnel, etc.)  Once that is done you can delete the
-"client" private key file on this machine since
-it is only needed on the VNC viewer side.  The,
-e.g. ~/.vnc/certs/clients/<name>.pem contains both
-the cert and private key.  The <name>.crt contains the
-certificate only.
-.IP
-NOTE: It is very important to know one should
-generate new keys with a passphrase.  Otherwise if an
-untrusted user steals the key file he could use it to
-masquerade as the x11vnc server (or VNC viewer client).
-You will be prompted whether to encrypt the key with
-a passphrase or not.  It is recommended that you do.
-One inconvenience to a passphrase is that it must
-be typed in EVERY time x11vnc or the client app is
-started up.
-.IP
-Examples:
-.IP
-x11vnc \fB-sslGenCert\fR server
-x11vnc \fB-ssl\fR SAVE \fB-display\fR :0 ...
-.IP
-and then on viewer using ss_vncviewer stunnel wrapper
-(see the FAQ):
-ss_vncviewer \fB-verify\fR ./cacert.crt hostname:0
-.IP
-(this assumes the cacert.crt cert from \fB-sslGenCA\fR
-was safely copied to the VNC viewer machine where
-ss_vncviewer is run)
-.IP
-Example using a name:
-.IP
-x11vnc \fB-sslGenCert\fR server charlie
-x11vnc \fB-ssl\fR SAVE-charlie \fB-display\fR :0 ...
-.IP
-Example for a client certificate (rarely used):
-.IP
-x11vnc \fB-sslGenCert\fR client roger
-scp ~/.vnc/certs/clients/roger.pem somehost:.
-rm  ~/.vnc/certs/clients/roger.pem
-.IP
-x11vnc is then started with the option \fB-sslverify\fR
-~/.vnc/certs/clients/roger.crt (or simply \fB-sslverify\fR
-roger), and on the viewer user on somehost could do
-for example:
-.IP
-ss_vncviewer \fB-mycert\fR ./roger.pem hostname:0
-.IP
-If you set the env. var REQ_ARGS='...' it will be
-passed to openssl 
-.IR req (1).
-A common use would be
-REQ_ARGS='-days 1095' to bump up the expiration date
-(3 years in this case).
-.PP
-\fB-sslEncKey\fR \fIpem\fR
-.IP
-Utility to encrypt an existing PEM file with a
-passphrase you supply when prompted.  For that key to be
-used (e.g. by x11vnc) the passphrase must be supplied
-each time.
-.IP
-The "SAVE" notation described under \fB-ssl\fR applies as
-well. (precede this option with \fB-ssldir\fR [dir] to refer
-a directory besides the default ~/.vnc/certs)
-.IP
-The 
-.IR openssl (1)
-program must be installed on the system
-and available in PATH.  After the Key file is encrypted
-the x11vnc command exits; the VNC server is not run.
-.IP
-Examples:
-x11vnc \fB-sslEncKey\fR /path/to/foo.pem
-x11vnc \fB-sslEncKey\fR SAVE
-x11vnc \fB-sslEncKey\fR SAVE-charlie
-.PP
-\fB-sslCertInfo\fR \fIpem\fR
-.IP
-Prints out information about an existing PEM file.
-In addition the public certificate is also printed.
-The 
-.IR openssl (1)
-program must be in PATH. Basically the
-command "openssl x509 \fB-text"\fR is run on the pem.
-.IP
-After the info is printed the x11vnc command exits;
-the VNC server is not run.
-.IP
-The "SAVE" notation described under \fB-ssl\fR applies
-as well.
-.IP
-Using  "LIST" will give a list of all certs being
-managed (in the ~/.vnc/certs dir, use \fB-ssldir\fR to refer
-to another dir).  "ALL" will print out the info for
-every managed key (this can be very long).  Giving a
-client or server cert shortname will also try a lookup
-(e.g. \fB-sslCertInfo\fR charlie).  Use "LISTL" or "LL"
-for a long (ls \fB-l\fR style) listing.
-.IP
-Using "HASHON" will create subdirs [dir]/HASH and
-[dir]/HASH with OpenSSL hash filenames (e.g. 0d5fbbf1.0)
-symlinks pointing up to the corresponding *.crt file.
-([dir] is ~/.vnc/certs or one given by \fB-ssldir.)\fR
-This is a useful way for other OpenSSL applications
-(e.g. stunnel) to access all of the certs without
-having to concatenate them.  x11vnc will not use them
-unless you specifically reference them.  "HASHOFF"
-removes these HASH subdirs.
-.IP
-The LIST, LISTL, LL, ALL, HASHON, HASHOFF words can
-also be lowercase, e.g. "list".
-.PP
-\fB-sslDelCert\fR \fIpem\fR
-.IP
-Prompts you to delete all .crt .pem .key .req files
-associated with [pem].  x11vnc then exits. "SAVE"
-and lookups as in \fB-sslCertInfo\fR apply as well.
-.PP
-\fB-sslScripts\fR
-.IP
-Prints out both the 'genCA' and 'genCert' x11vnc
-openssl wrapper scripts for you to examine, modify, etc.
-The scripts are printed to stdout and then the x11vnc
-program exits.
-.PP
-\fB-stunnel\fR \fI[pem]\fR
-.IP
-Use the 
-.IR stunnel (8)
-(stunnel.mirt.net) to provide an
-encrypted SSL tunnel between viewers and x11vnc.
-.IP
-This external tunnel method was implemented prior to the
-integrated \fB-ssl\fR encryption described above.  It still
-works well and avoids the requirement of linking with
-the OpenSSL libraries.  This mode requires stunnel
-to be installed on the system and available via PATH
-(n.b. stunnel is often installed in sbin directories).
-Version 4.x of stunnel is assumed (but see \fB-stunnel3\fR
-below.)
-.IP
-[pem] is optional, use "\fB-stunnel\fR \fI/path/to/stunnel.pem\fR"
-to specify a PEM certificate file to pass to stunnel.
-See the \fB-ssl\fR option for more info on certificate files.
-.IP
-Whether or not your stunnel has its own certificate
-depends on your stunnel configuration; stunnel often
-generates one at install time.  See your stunnel
-documentation for details.  In any event, if you want to
-use this certificate you must supply the full path to it
-as [pem].  Note: the file may only be readable by root.
-.IP
-[pem] may also be the special strings "TMP", "SAVE",
-and "SAVE..." as described in the \fB-ssl\fR option.
-If [pem] is not supplied, "SAVE" is assumed.
-.IP
-Note that the VeNCrypt, ANONTLS, and "ANON" modes
-are not supported in \fB-stunnel\fR mode.
-.IP
-stunnel is started up as a child process of x11vnc and
-any SSL connections stunnel receives are decrypted and
-sent to x11vnc over a local socket.  The strings
-"The SSL VNC desktop is ..." and "SSLPORT=..."
-are printed out at startup to indicate this.
-.IP
-The \fB-localhost\fR option is enforced by default to avoid
-people routing around the SSL channel.  Use \fB-env\fR
-STUNNEL_DISABLE_LOCALHOST=1 to disable this security
-requirement.
-.IP
-Set \fB-env\fR STUNNEL_DEBUG=1 for more debugging printout.
-.IP
-Set \fB-env\fR STUNNEL_PROG=xxx to the full path of stunnel
-program you want to be used (e.g. /usr/bin/stunnel4).
-.IP
-Set \fB-env\fR STUNNEL_LISTEN=xxx to the address of the
-network interface to listen on (the default is to listen
-on all interfaces), e.g. STUNNEL_LISTEN=192.168.1.100.
-.IP
-A simple way to add IPv6 support is STUNNEL_LISTEN=::
-.IP
-Your VNC viewer will also need to be able to connect
-via SSL.  Unfortunately not too many do this.  See the
-information about SSL viewers under the \fB-ssl\fR option.
-The x11vnc project's SSVNC is an option.
-.IP
-Also, in the x11vnc distribution, patched TightVNC
-and UltraVNC Java applet jar files are provided in
-the classes/ssl directory that do SSL connections.
-Enable serving them with the \fB-http,\fR \fB-http_ssl,\fR or
-\fB-httpdir\fR (see the option descriptions for more info.)
-.IP
-Note that for the Java viewer applet usage the
-"?PORT=xxxx" in the various URLs printed at startup
-will need to be supplied to the web browser to connect
-properly.
-.IP
-Currently the automatic "single port" HTTPS mode of
-\fB-ssl\fR is not fully supported in \fB-stunnel\fR mode.  However,
-it can be emulated via:
-.IP
-% x11vnc \fB-stunnel\fR \fB-http_ssl\fR \fB-http_oneport\fR ...
-.IP
-In general, it is also not too difficult to set up
-an stunnel or other SSL tunnel on the viewer side.
-A simple example on Unix using stunnel 3.x is:
-.IP
-% stunnel \fB-c\fR \fB-d\fR localhost:5901 \fB-r\fR remotehost:5900
-% vncviewer localhost:1
-.IP
-For Windows, stunnel has been ported to it and there
-are probably other such tools available.  See the FAQ
-and SSVNC for more examples.
-.PP
-\fB-stunnel3\fR \fI[pem]\fR
-.IP
-Use version 3.x stunnel command line syntax instead of
-version 4.x.  The \fB-http/-httpdir\fR Java applet serving
-is currently not available in this mode.
-.PP
-\fB-enc\fR \fIcipher:keyfile\fR
-.IP
-Use symmetric encryption with cipher "cipher"
-and secret key data in "keyfile".  If keyfile is
-pw=<string> then "string" is used as the key data.
-.IP
-NOTE: It is recommended that you use SSL via the \fB-ssl\fR
-option instead of this option because SSL is well
-understood and takes great care to establish unique
-session keys and is more compatible with other software.
-Use this option if you do not want to deal with SSL
-certificates for authentication and do not want to
-use SSH but want some encryption for your VNC session.
-Or if you must interface with a symmetric key tunnel
-that you do not have control over.
-.IP
-Note that this mode will NOT work with the UltraVNC DSM
-plugins because they alter the RFB protocol in addition
-to tunnelling with the symmetric cipher (an unfortunate
-choice of implementation...)
-.IP
-cipher can be one of:  arc4, aesv2, aes-cfb, blowfish,
-aes256, or 3des.  See the OpenSSL documentation for
-more info.  The keysize is 128 bits (except for aes256).
-Here is one way to make a keyfile with that many bits:
-.IP
-dd if=/dev/random of=./my.key bs=16 count=1
-.IP
-you will need to securely share this key with the other
-side of the VNC connection (See SSVNC for examples).
-.IP
-Example:  \fB-enc\fR blowfish:./my.key
-Example:  \fB-enc\fR blowfish:pw=swordfish
-.IP
-By default 16 bytes of random salt followed by 16 bytes
-of random initialization vector are sent at the very
-beginning of the stream.  The other side must read these
-and initialize their cipher with them.  These values
-make the session key unique (without them the security
-is minimal).  Similarly, the other side must send us
-its random salt and IV with those same lengths.
-.IP
-The salt and key data are combined to create a session
-key using an md5 hash as described in 
-.IR EVP_BytesToKey (3).
-.IP
-The exact call is: EVP_BytesToKey(Cipher, EVP_md5(),
-salt, keydata, len, 1, keystr, NULL);  where salt is
-the random data as described above, and keydata is the
-shared secret key data.  keystr is the resulting session
-key.  The cipher is then seeded with keystr and uses
-the random initialization vector as its first block.
-.IP
-To modify the amount of random salt and initialization
-vector use cipher at n,m where n is the salt length and
-m the initialization vector length.  E.g.
-.IP
-\fB-enc\fR aes-cfb at 8,16:./my.key
-.IP
-It is not a good idea to set either one to zero,
-although you may be forced to if the other side of the
-tunnel is not under your control.
-.IP
-To skip the salt and EVP_BytesToKey MD5 entirely (no
-hashing is done: the keydata is directly inserted into
-the cipher) specify "-1" for the salt, e.g.
-.IP
-\fB-enc\fR blowfish at -1,16:./my.key
-.IP
-The message digest can also be changed to something
-besides the default MD5.  Use cipher at md+n,m where "md"
-can be one of sha, sha1, md5, or ripe.  For example:
-.IP
-\fB-enc\fR arc4 at sha+8,16:./my.key
-.IP
-The SSVNC vnc viewer project supplies a symmetric
-encryption tool named "ultravnc_dsm_helper" that can
-be used on the viewer side.  For example:
-.IP
-ssvncviewer exec='ultravnc_dsm_helper arc4 my.key 0 h:p'
-.IP
-where h:p is the hostname and port of the x11vnc server.
-ultravnc_dsm_helper may also be used standalone to
-provide a symmetric encryption tunnel for any viewer
-or server (VNC or otherwise.) The cipher (1st arg)
-is basically the same syntax as we use above.
-.IP
-Also see the 'Non-Ultra DSM' SSVNC option for the
-\'UltraVNC DSM Encryption Plugin' advanced option.
-.IP
-For both ways of using the viewer, you can specify the
-salt,ivec sizes (in GUI or, e.g. arc4 at 8,16).
-.PP
-\fB-https\fR \fI[port]\fR
-.IP
-Use a special, separate HTTPS port (-ssl and
-\fB-stunnel\fR modes only) for HTTPS Java viewer applet
-downloading. I.e. not 5900 and not 5800 (the defaults.)
-.IP
-BACKGROUND: In \fB-ssl\fR mode, it turns out you can use the
-single VNC port (e.g. 5900) for both VNC and HTTPS
-connections. (HTTPS is used to retrieve a SSL-aware
-VncViewer.jar applet that is provided with x11vnc).
-Since both use SSL the implementation was extended to
-detect if HTTP traffic (i.e. GET) is taking place and
-handle it accordingly.  The URL would be, e.g.:
-.IP
-https://mymachine.org:5900/
-.IP
-This is convenient for firewalls, etc, because only one
-port needs to be allowed in.  However, this heuristic
-adds a few seconds delay to each connection and can be
-unreliable (especially if the user takes much time to
-ponder the Certificate dialogs in his browser, Java VM,
-or VNC Viewer applet.  That's right 3 separate "Are
-you sure you want to connect?" dialogs!)
-.IP
-END OF BACKGROUND.
-.IP
-USAGE: So use the \fB-https\fR option to provide a separate,
-more reliable HTTPS port that x11vnc will listen on.  If
-[port] is not provided (or is 0), one is autoselected.
-The URL to use is printed out at startup.
-.IP
-The SSL Java applet directory is specified via the
-\fB-httpdir\fR option.  If not supplied, \fB-https\fR will try
-to guess the directory as though the \fB-http\fR option
-was supplied.
-.PP
-\fB-httpsredir\fR \fI[port]\fR
-.IP
-In \fB-ssl\fR mode with the Java applet retrieved via HTTPS,
-when the HTML file containing applet parameters
-('index.vnc' or 'proxy.vnc') is sent do NOT set the
-applet PORT parameter to the actual VNC port but set it
-to "port" instead.  If "port" is not supplied, then
-the port number is guessed from the Host: HTTP header.
-.IP
-This is useful when an incoming TCP connection
-redirection is performed by a router/gateway/firewall
-from one port to an internal machine where x11vnc is
-listening on a different port. The Java applet needs to
-connect to the firewall/router port, not the VNC port
-on the internal workstation. For example, one could
-redir from mygateway.com:443 to workstation:5900.
-.IP
-This spares the user from having to type in
-https://mygateway.com/?PORT=443 into their web
-browser. Note that port 443 is the default https port;
-other ports must be explicitly indicated, for example:
-https://mygateway.com:8000/?PORT=8000.  To avoid having
-to include the PORT= in the browser URL, simply supply
-"\fB-httpsredir\fR" to x11vnc.
-.IP
-This option does not work in \fB-stunnel\fR mode.
-.IP
-More tricks: set the env var X11VNC_EXTRA_HTTPS_PARAMS
-to be extra URL parameters to use.  This way you do
-not need to specify extra PARAMS in the index.vnc file.
-E.g. x11vnc \fB-env\fR X11VNC_EXTRA_HTTPS_PARAMS='?GET=1' ...
-.IP
-If you do not want to expose the non-SSL HTTP port to
-the network (i.e. you just want the single VNC/HTTPS
-port, e.g. 5900, open for connections) then specify the
-option \fB-env\fR X11VNC_HTTP_LISTEN_LOCALHOST=1  This way
-the connection to the LibVNCServer httpd server will
-only be available on localhost (note that in \fB-ssl\fR mode,
-HTTPS requests are redirected from SSL to the non-SSL
-LibVNCServer HTTP server.)
-.PP
-\fB-http_oneport\fR
-.IP
-For UN-encrypted connections mode (i.e. no \fB-ssl,\fR
-\fB-stunnel,\fR or \fB-enc\fR options), allow the Java VNC Viewer
-applet to be downloaded thru the VNC port via HTTP.
-.IP
-That is to say, you can use a single port for Java
-applet viewer connections by using a URL in your web
-browser like this, for example:
-.IP
-http://hostname:5900
-.IP
-The regular, two-port mode, URL http://hostname:5800
-will continue to work as well.
-.IP
-As mentioned above, this mode will NOT work with
-the \fB-ssl,\fR \fB-stunnel,\fR or \fB-enc\fR encryption options.
-Note that is it equivalent to '-enc none' (i.e. it
-uses the same detection mechanism as for HTTPS, but
-with no encryption.)
-.IP
-HTTPS single-port is on by default in \fB-ssl\fR encrypted
-mode (and \fB-enc\fR too), so you only need \fB-http_oneport\fR
-when doing non-SSL encrypted connections.
-.IP
-This mode could also be useful for SSH tunnels since
-it means only one port needs to be redirected.
-.IP
-The \fB-httpsredir\fR option may also be useful for this
-mode when using an SSH tunnel as well as for router
-port redirections.
-.IP
-Note that the \fB-env\fR X11VNC_HTTP_LISTEN_LOCALHOST=1
-option described above under \fB-httpsredir\fR applies for
-the LibVNCServer httpd server in all cases (ssl or not.)
-.PP
-\fB-ssh\fR \fIuser at host:disp\fR
-.IP
-Create a remote listening port on machine "host"
-via a SSH tunnel using the \fB-R\fR rport:localhost:lport
-method. lport will be the local x11vnc listening port,
-so a connection to rport (5900+disp) on "host"
-will reach x11vnc.  E.g. fred at snoopy.com:0
-.IP
-This could be useful if a firewall/router prevents
-incoming connections to the x11vnc machine, but
-the ssh machine "host" can be reached by the VNC
-viewer. "user@" is not needed unless the remote unix
-username differs from the current one.
-.IP
-By default the remote sshd is usually configured to
-listen only on localhost for rport, so the viewer may
-need to ssh \fB-L\fR redir to "host" as well (See SSVNC to
-automate this).  The sshd setting GatewayPorts enables
-listening on all interfaces for rport; viewers can
-reach it more easily.
-.IP
-"disp" is the VNC display for the remote SSH side,
-e.g. 0 corresponds to port 5900, etc.  If disp is
-greater than 200 the value is used as the port.  Use a
-negative value to force a low port, e.g. host:-80 will
-use port 80.
-.IP
-If ssh-agent is not active, then the ssh password needs
-to be entered in the terminal where x11vnc is running.
-.IP
-By default the remote ssh will issue a 'sleep 300' to
-wait for the incoming connection for 5 mins.  To modify
-this use user at host:disp+secs.
-.IP
-If the remote SSH server is on a non-standard port
-(i.e. not 22) use user at host:port:disp+secs.
-.IP
-Note that the ssh process MAY NOT be killed when
-x11vnc exits.  It tries by looking at 
-.IR ps (1)
-output.
-.PP
-\fB-usepw\fR
-.IP
-If no other password method was supplied on the command
-line, first look for ~/.vnc/passwd and if found use it
-with \fB-rfbauth;\fR next, look for ~/.vnc/passwdfile and
-use it with \fB-passwdfile;\fR otherwise, prompt the user
-for a password to create ~/.vnc/passwd and use it with
-the \fB-rfbauth\fR option.  If none of these succeed x11vnc
-exits immediately.
-.PP
-\fB-storepasswd\fR \fIpass\fR \fIfile\fR
-.IP
-Store password \fIpass\fR as the VNC password in the
-file \fIfile\fR.  Once the password is stored the
-program exits.  Use the password via "\fB-rfbauth\fR \fIfile\fR"
-.IP
-If called with no arguments, "x11vnc \fB-storepasswd",\fR
-the user is prompted for a password and it is stored
-in the file ~/.vnc/passwd.  Called with one argument,
-that will be the file to store the prompted password in.
-.PP
-\fB-nopw\fR
-.IP
-Disable the big warning message when you use x11vnc
-without some sort of password.
-.PP
-\fB-accept\fR \fIstring\fR
-.IP
-Run a command (possibly to prompt the user at the
-X11 display) to decide whether an incoming client
-should be allowed to connect or not.  \fIstring\fR is
-an external command run via 
-.IR system (3)
-or some special
-cases described below.  Be sure to quote \fIstring\fR
-if it contains spaces, shell characters, etc.  If the
-external command returns 0 the client is accepted,
-otherwise the client is rejected.  See below for an
-extension to accept a client view-only.
-.IP
-If x11vnc is running as root (say from 
-.IR inetd (8)
-or from
-display managers 
-.IR xdm (1)
-, 
-.IR gdm (1)
-, etc), think about the
-security implications carefully before supplying this
-option (likewise for the \fB-gone\fR option).
-.IP
-Environment: The RFB_CLIENT_IP environment variable will
-be set to the incoming client IP number and the port
-in RFB_CLIENT_PORT (or -1 if unavailable).  Similarly,
-RFB_SERVER_IP and RFB_SERVER_PORT (the x11vnc side
-of the connection), are set to allow identification
-of the tcp virtual circuit.  The x11vnc process
-id will be in RFB_X11VNC_PID, a client id number in
-RFB_CLIENT_ID, and the number of other connected clients
-in RFB_CLIENT_COUNT.  RFB_MODE will be "accept".
-RFB_STATE will be PROTOCOL_VERSION, SECURITY_TYPE,
-AUTHENTICATION, INITIALISATION, NORMAL, or UNKNOWN
-indicating up to which state the client has achieved.
-RFB_LOGIN_VIEWONLY will be 0, 1, or -1 (unknown).
-RFB_USERNAME, RFB_LOGIN_TIME, and RFB_CURRENT_TIME may
-also be set.
-.IP
-If \fIstring\fR is "popup" then a builtin popup window
-is used.  The popup will time out after 120 seconds,
-use "popup:N" to modify the timeout to N seconds
-(use 0 for no timeout).
-.IP
-In the case of "popup" and when the \fB-unixpw\fR option
-is specified, then a *second* window will be popped
-up after the user successfully logs in via his UNIX
-password.  This time the user will be identified as
-UNIX:username at hostname, the "UNIX:" prefix indicates
-which user the viewer logged as via \fB-unixpw.\fR  The first
-popup is only for whether to allow him to even *try*
-to login via unix password.
-.IP
-If \fIstring\fR is "xmessage" then an 
-.IR xmessage (1)
-invocation is used for the command.  xmessage must be
-installed on the machine for this to work.
-.IP
-Both "popup" and "xmessage" will present an option
-for accepting the client "View-Only" (the client
-can only watch).  This option will not be presented if
-\fB-viewonly\fR has been specified, in which case the entire
-display is view only.
-.IP
-If the user supplied command is prefixed with something
-like "yes:0,no:*,view:3 mycommand ..." then this
-associates the numerical command return code with
-the actions: accept, reject, and accept-view-only,
-respectively.  Use "*" instead of a number to indicate
-the default action (in case the command returns an
-unexpected value).  E.g. "no:*" is a good choice.
-.IP
-Note that x11vnc blocks while the external command
-or popup is running (other clients may see no updates
-during this period).  So a person sitting a the physical
-display is needed to respond to an popup prompt. (use
-a 2nd x11vnc if you lock yourself out).
-.IP
-More \fB-accept\fR tricks: use "popupmouse" to only allow
-mouse clicks in the builtin popup to be recognized.
-Similarly use "popupkey" to only recognize
-keystroke responses.  These are to help avoid the
-user accidentally accepting a client by typing or
-clicking. All 3 of the popup keywords can be followed
-by +N+M to supply a position for the popup window.
-The default is to center the popup window.
-.PP
-\fB-afteraccept\fR \fIstring\fR
-.IP
-As \fB-accept,\fR except to run a user supplied command after
-a client has been accepted and authenticated. RFB_MODE
-will be set to "afteraccept" and the other RFB_*
-variables are as in \fB-accept.\fR  Unlike \fB-accept,\fR the
-command return code is not interpreted by x11vnc.
-Example: \fB-afteraccept\fR 'killall xlock &'
-.PP
-\fB-gone\fR \fIstring\fR
-.IP
-As \fB-accept,\fR except to run a user supplied command when
-a client goes away (disconnects).  RFB_MODE will be
-set to "gone" and the other RFB_* variables are as
-in \fB-accept.\fR  The "popup" actions apply as well.
-Unlike \fB-accept,\fR the command return code is not
-interpreted by x11vnc.  Example: \fB-gone\fR 'xlock &'
-.PP
-\fB-users\fR \fIlist\fR
-.IP
-If x11vnc is started as root (say from 
-.IR inetd (8)
-or from
-display managers 
-.IR xdm (1)
-, 
-.IR gdm (1)
-, etc), then as soon
-as possible after connections to the X display are
-established try to switch to one of the users in the
-comma separated \fIlist\fR.  If x11vnc is not running as
-root this option is ignored.
-.IP
-Why use this option?  In general it is not needed since
-x11vnc is already connected to the X display and can
-perform its primary functions.  The option was added
-to make some of the *external* utility commands x11vnc
-occasionally runs work properly.  In particular under
-GNOME and KDE to implement the "\fB-solid\fR \fIcolor\fR" feature
-external commands (gconftool-2 and dcop) unfortunately
-must be run as the user owning the desktop session.
-Since this option switches userid it also affects the
-userid used to run the processes for the \fB-accept\fR and
-\fB-gone\fR options.  It also affects the ability to read
-files for options such as \fB-connect,\fR \fB-allow,\fR and \fB-remap\fR
-and also the ultra and tight filetransfer feature if
-enabled.  Note that the \fB-connect\fR file is also sometimes
-written to.
-.IP
-So be careful with this option since in some situations
-its use can decrease security.
-.IP
-In general the switch to a user will only take place
-if the display can still be successfully opened as that
-user (this is primarily to try to guess the actual owner
-of the session). Example: "\fB-users\fR \fIfred,wilma,betty\fR".
-Note that a malicious local user "barney" by
-quickly using "xhost +" when logging in may possibly
-get the x11vnc process to switch to user "fred".
-What happens next?
-.IP
-Under display managers it may be a long time before
-the switch succeeds (i.e. a user logs in).  To instead
-make it switch immediately regardless if the display
-can be reopened prefix the username with the "+"
-character. E.g. "\fB-users\fR \fI+bob\fR" or "\fB-users\fR \fI+nobody\fR".
-.IP
-The latter (i.e. switching immediately to user
-"nobody") is the only obvious use of the \fB-users\fR option
-that increases security.
-.IP
-Use the following notation to associate a group with
-a user: user1.group1,user2.group2,...  Note that
-.IR initgroups (2)
-will still be called first to try to
-switch to ALL of a user's groups (primary and additional
-groups).  Only if that fails or it is not available
-then the single group specified as above (or the user's
-primary group if not specified) is switched to with
-.IR setgid (2).
-Use \fB-env\fR X11VNC_SINGLE_GROUP=1 to prevent
-trying 
-.IR initgroups (2)
-and only switch to the single
-group.  This sort of setting is only really needed to
-make the ultra or tight filetransfer permissions work
-properly. This format applies to any comma separated list
-of users, even the special "=" modes described below.
-.IP
-In \fB-unixpw\fR mode, if "\fB-users\fR \fIunixpw=\fR" is supplied
-then after a user authenticates himself via the
-\fB-unixpw\fR mechanism, x11vnc will try to switch to that
-user as though "\fB-users\fR \fI+username\fR" had been supplied.
-If you want to limit which users this will be done for,
-provide them as a comma separated list after "unixpw="
-Groups can also be specified as described above.
-.IP
-Similarly, in \fB-ssl\fR mode, if "\fB-users\fR \fIsslpeer=\fR" is
-supplied then after an SSL client authenticates with his
-cert (the \fB-sslverify\fR option is required for this) x11vnc
-will extract a UNIX username from the "emailAddress"
-field (username at hostname.com) of the "Subject" of the
-x509 SSL cert and then try to switch to that user as
-though "\fB-users\fR \fI+username\fR" had been supplied.  If you
-want to limit which users this will be done for, provide
-them as a comma separated list after "sslpeer=".
-Set the env. var X11VNC_SSLPEER_CN to use the Common
-Name (normally a hostname) instead of the Email field.
-.IP
-NOTE: for sslpeer= mode the x11vnc administrator must
-take care that any client certs he adds to \fB-sslverify\fR
-have the intended UNIX username in the "emailAddress"
-field of the cert.  Otherwise a user may be able to
-log in as another.  This command can be of use in
-checking: "openssl x509 \fB-text\fR \fB-in\fR file.crt", see the
-"Subject:" line.  Also, along with the normal RFB_*
-env. vars. (see \fB-accept)\fR passed to external cmd=
-commands, RFB_SSL_CLIENT_CERT will be set to the
-client's x509 certificate string.
-.IP
-The sslpeer= mode can aid finding X sessions via the
-FINDDISPLAY and FINDCREATEDISPLAY mechanisms.
-.IP
-To immediately switch to a user *before* connections
-to the X display are made or any files opened use the
-"=" character: "\fB-users\fR \fI=bob\fR".  That user needs to
-be able to open the X display and any files of course.
-.IP
-The special user "guess=" means to examine the utmpx
-database (see 
-.IR who (1)
-) looking for a user attached to
-the display number (from DISPLAY or \fB-display\fR option)
-and try him/her.  To limit the list of guesses, use:
-"\fB-users\fR \fIguess=bob,betty\fR".
-.IP
-Even more sinister is the special user "lurk="
-that means to try to guess the DISPLAY from the utmpx
-login database as well.  So it "lurks" waiting for
-anyone to log into an X session and then connects to it.
-Specify a list of users after the = to limit which users
-will be tried.  To enable a different searching mode, if
-the first user in the list is something like ":0" or
-":0-2" that indicates a range of DISPLAY numbers that
-will be tried (regardless of whether they are in the
-utmpx database) for all users that are logged in.  Also
-see the "\fB-display\fR \fIWAIT:...\fR" functionality.  Examples:
-"\fB-users\fR \fIlurk=\fR" and also "\fB-users\fR \fIlurk=:0-1,bob,mary\fR"
-.IP
-Be especially careful using the "guess=" and "lurk="
-modes.  They are not recommended for use on machines
-with untrustworthy local users.
-.PP
-\fB-noshm\fR
-.IP
-Do not use the MIT-SHM extension for the polling.
-Remote displays can be polled this way: be careful this
-can use large amounts of network bandwidth.  This is
-also of use if the local machine has a limited number
-of shm segments and \fB-onetile\fR is not sufficient.
-.PP
-\fB-flipbyteorder\fR
-.IP
-Sometimes needed if remotely polled host has different
-endianness.  Ignored unless \fB-noshm\fR is set.
-.PP
-\fB-onetile\fR
-.IP
-Do not use the new copy_tiles() framebuffer mechanism,
-just use 1 shm tile for polling.  Limits shm segments
-used to 3.
-.IP
-To disable any automatic shm reduction set the
-env. var. X11VNC_NO_LIMIT_SHM.
-.PP
-\fB-solid\fR \fI[color]\fR
-.IP
-To improve performance, when VNC clients are connected
-try to change the desktop background to a solid color.
-The [color] is optional: the default color is "cyan4".
-For a different one specify the X color (rgb.txt name,
-e.g. "darkblue" or numerical "#RRGGBB").
-.IP
-Currently this option only works on GNOME, KDE, CDE,
-XFCE, and classic X (i.e. with the background image
-on the root window).  The "gconftool-2", "dcop"
-and "xfconf-query" external commands are run for
-GNOME, KDE, and XFCE respectively.  This also works
-on native MacOSX.  (There is no color selection for
-MacOSX or XFCE.)  Other desktops won't work, (send
-us the corresponding commands if you find them).
-If x11vnc is running as root (
-.IR inetd (8)
-or 
-.IR gdm (1)
-),
-the \fB-users\fR option may be needed for GNOME, KDE, XFCE.
-If x11vnc guesses your desktop incorrectly, you can
-force it by prefixing color with "gnome:", "kde:",
-"cde:", "xfce:", or "root:".
-.IP
-Update: \fB-solid\fR no longer works on KDE4.
-.IP
-This mode works in a limited way on the Mac OS X Console
-with one color ('kelp') using the screensaver writing
-to the background.  Look in "~/Library/Screen Savers"
-for VncSolidColor.png to change the color.
-.PP
-\fB-blackout\fR \fIstring\fR
-.IP
-Black out rectangles on the screen. \fIstring\fR is a
-comma separated list of WxH+X+Y type geometries for
-each rectangle.  If one of the items on the list is the
-string "noptr" the mouse pointer will not be allowed
-to go into a blacked out region.
-.PP
-\fB-xinerama,\fR \fB-noxinerama\fR
-.IP
-If your screen is composed of multiple monitors
-glued together via XINERAMA, and that screen is
-not a rectangle this option will try to guess the
-areas to black out (if your system has libXinerama).
-default: \fB-xinerama\fR
-.IP
-In general, we have noticed on XINERAMA displays you may
-need to use the "\fB-xwarppointer\fR" option if the mouse
-pointer misbehaves and it is enabled by default. Use
-"\fB-noxwarppointer\fR" if you do not want this.
-.PP
-\fB-xtrap\fR
-.IP
-Use the DEC-XTRAP extension for keystroke and mouse
-input insertion.  For use on legacy systems, e.g. X11R5,
-running an incomplete or missing XTEST extension.
-By default DEC-XTRAP will be used if XTEST server grab
-control is missing, use \fB-xtrap\fR to do the keystroke and
-mouse insertion via DEC-XTRAP as well.
-.PP
-\fB-xrandr\fR \fI[mode]\fR
-.IP
-If the display supports the XRANDR (X Resize, Rotate
-and Reflection) extension, and you expect XRANDR events
-to occur to the display while x11vnc is running, this
-options indicates x11vnc should try to respond to
-them (as opposed to simply crashing by assuming the
-old screen size).  See the 
-.IR xrandr (1)
-manpage and run
-\'xrandr \fB-q'\fR for more info.  [mode] is optional and
-described below.
-.IP
-Since watching for XRANDR events and trapping errors
-increases polling overhead, only use this option if
-XRANDR changes are expected.  For example on a rotatable
-screen PDA or laptop, or using a XRANDR-aware Desktop
-where you resize often.  It is best to be viewing with a
-vncviewer that supports the NewFBSize encoding, since it
-knows how to react to screen size changes.  Otherwise,
-LibVNCServer tries to do so something reasonable for
-viewers that cannot do this (portions of the screen
-may be clipped, unused, etc).
-.IP
-Note: the default now is to check for XRANDR events, but
-do not trap every X call that may fail due to resize.
-If a resize event is received, the full \fB-xrandr\fR mode
-is enabled.  To disable even checking for events supply:
-\fB-noxrandr.\fR
-.IP
-"mode" defaults to "resize", which means create a
-new, resized, framebuffer and hope all viewers can cope
-with the change.  "newfbsize" means first disconnect
-all viewers that do not support the NewFBSize VNC
-encoding, and then resize the framebuffer.  "exit"
-means disconnect all viewer clients, and then terminate
-x11vnc.
-.PP
-\fB-rotate\fR \fIstring\fR
-.IP
-Rotate and/or flip the framebuffer view exported by VNC.
-This transformation is independent of XRANDR and is
-done in software in main memory and so may be slower.
-This mode could be useful on a handheld with portrait or
-landscape modes that do not correspond to the scanline
-order of the actual framebuffer.  \fIstring\fR can be:
-.IP
-x     flip along x-axis
-y     flip along y-axis
-xy     flip along x- and y-axes
-+90     rotate 90 degrees clockwise
-\fB-90\fR     rotate 90 degrees counter-clockwise
-+90x     rotate 90 degrees CW, then flip along x
-+90y     rotate 90 degrees CW, then flip along y
-.IP
-these give all possible rotations and reflections.
-.IP
-Aliases: same as xy:  yx, +180, \fB-180,\fR 180
-same as \fB-90:\fR +270, 270
-same as +90: 90, (ditto for 90x, 90y)
-.IP
-Like \fB-scale,\fR this transformation is applied at the very
-end of any chain of framebuffer transformations and so
-any options with geometries, e.g. \fB-blackout,\fR \fB-clip,\fR etc.
-are relative to the original X (or \fB-rawfb)\fR framebuffer,
-not the final one sent to VNC viewers.
-.IP
-If you do not want the cursor shape to be rotated
-prefix \fIstring\fR with "nc:", e.g. "nc:+90",
-"nc:xy", etc.
-.PP
-\fB-padgeom\fR \fIWxH\fR
-.IP
-Whenever a new vncviewer connects, the framebuffer is
-replaced with a fake, solid black one of geometry WxH.
-Shortly afterwards the framebuffer is replaced with the
-real one.  This is intended for use with vncviewers
-that do not support NewFBSize and one wants to make
-sure the initial viewer geometry will be big enough
-to handle all subsequent resizes (e.g. under \fB-xrandr,\fR
-\fB-remote\fR id:windowid, rescaling, etc.)
-.IP
-In \fB-unixpw\fR mode this sets the size of the login screen.
-Use "once:WxH" it ignore padgeom after the login
-screen is set up.
-.PP
-\fB-o\fR \fIlogfile\fR
-.IP
-Write stderr messages to file \fIlogfile\fR instead of to
-the terminal.  Same as "\fB-logfile\fR \fIfile\fR".  To append
-to the file use "\fB-oa\fR \fIfile\fR" or "\fB-logappend\fR \fIfile\fR".
-If \fIlogfile\fR contains the string "%VNCDISPLAY"
-it is expanded to the vnc display (the name may need
-to be guessed at.)  "%HOME" works too.
-.PP
-\fB-flag\fR \fIfile\fR
-.IP
-Write the "PORT=NNNN" (e.g. PORT=5900) string to
-\fIfile\fR in addition to stdout.  This option could be
-useful by wrapper script to detect when x11vnc is ready.
-.PP
-\fB-rmflag\fR \fIfile\fR
-.IP
-Remove \fIfile\fR at exit to signal when x11vnc is done.
-The file is created at startup if it does not already
-exist or if \fIfile\fR is prefixed with "create:".
-If the file is created, the x11vnc PID is placed in
-the file.  Otherwise the files contents is not changed.
-Use prefix "nocreate:" to prevent creation.
-.PP
-\fB-rc\fR \fIfilename\fR
-.IP
-Use \fIfilename\fR instead of $HOME/.x11vncrc for rc file.
-.PP
-\fB-norc\fR
-.IP
-Do not process any .x11vncrc file for options.
-.PP
-\fB-env\fR \fIVAR=VALUE\fR
-.IP
-Set the environment variable 'VAR' to value 'VALUE'
-at x11vnc startup.  This is a convenience utility to
-avoid shell script wrappers, etc. to set the env. var.
-You may specify as many of these as needed on the
-command line.
-.PP
-\fB-prog\fR \fI/path/to/x11vnc\fR
-.IP
-Set the full path to the x11vnc program for cases when
-it cannot be determined from argv[0] (e.g. tcpd/inetd)
-.PP
-\fB-h,\fR \fB-help\fR
-.IP
-Print this help text.
--?, \fB-opts\fR              Only list the x11vnc options.
-.PP
-\fB-V,\fR \fB-version\fR
-.IP
-Print program version and last modification date.
-.PP
-\fB-license\fR
-.IP
-Print out license information.  Same as \fB-copying\fR and
-\fB-warranty.\fR
-.PP
-\fB-dbg\fR
-.IP
-Instead of exiting after cleaning up, run a simple
-"debug crash shell" when fatal errors are trapped.
-.PP
-\fB-q,\fR \fB-quiet\fR
-.IP
-Be quiet by printing less informational output to
-stderr. (use \fB-noquiet\fR to undo an earlier \fB-quiet.)\fR
-.IP
-The \fB-quiet\fR option does not eliminate all informational
-output, it only reduces it.  It is ignored in most
-auxiliary usage modes, e.g. \fB-storepasswd.\fR  To eliminate
-all output use: 2>/dev/null 1>&2, etc.
-.PP
-\fB-v,\fR \fB-verbose\fR
-.IP
-Print out more information to stderr.
-.PP
-\fB-bg\fR
-.IP
-Go into the background after screen setup.  Messages to
-stderr are lost unless \fB-o\fR logfile is used.  Something
-like this could be useful in a script:
-.IP
-port=`ssh -t $host "x11vnc -display :0 -bg" | grep PORT`
-.IP
-port=`echo "$port" | sed -e 's/PORT=//'`
-.IP
-port=`expr $port - 5900`
-.IP
-vncviewer $host:$port
-.PP
-\fB-modtweak,\fR \fB-nomodtweak\fR
-.IP
-Option \fB-modtweak\fR automatically tries to adjust the AltGr
-and Shift modifiers for differing language keyboards
-between client and host.  Otherwise, only a single key
-press/release of a Keycode is simulated (i.e. ignoring
-the state of the modifiers: this usually works for
-identical keyboards).  Also useful in resolving cases
-where a Keysym is bound to multiple keys (e.g. "<" + ">"
-and "," + "<" keys).  Default: \fB-modtweak\fR
-.IP
-If you are having trouble with with keys and \fB-xkb\fR or
-\fB-noxkb,\fR and similar things don't help, try \fB-nomodtweak.\fR
-.IP
-On some HP-UX systems it is been noted that they have
-an odd keymapping where a single keycode will have a
-keysym, e.g. "#", up to three times.  You can check
-via "xmodmap \fB-pk"\fR or the \fB-dk\fR option.  The failure
-is when you try to type "#" it yields "3".  If you
-see this problem try setting the environment variable
-MODTWEAK_LOWEST=1 to see if it helps.
-.PP
-\fB-xkb,\fR \fB-noxkb\fR
-.IP
-When in modtweak mode, use the XKEYBOARD extension (if
-the X display supports it) to do the modifier tweaking.
-This is powerful and should be tried if there are still
-keymapping problems when using \fB-modtweak\fR by itself.
-The default is to check whether some common keysyms,
-e.g. !, @, [, are only accessible via \fB-xkb\fR mode and if
-so then automatically enable the mode.  To disable this
-automatic detection use \fB-noxkb.\fR
-.IP
-When \fB-xkb\fR mode is active you can set these env. vars.
-They apply only when there is ambiguity as to which
-key to choose (i.e the mapping is not one-to-one).
-NOKEYHINTS=1: for up ascii keystrokes do not use score
-hints saved when the key was pressed down. NOANYDOWN=1:
-for up keystrokes do not resort to searching through
-keys that are currently pressed down.  KEYSDOWN=N:
-remember the last N keys press down for tie-breaking
-when an up keystroke comes in.
-.PP
-\fB-capslock\fR
-.IP
-When in \fB-modtweak\fR (the default) or \fB-xkb\fR mode,
-if a keysym in the range A-Z comes in check the X
-server to see if the Caps_Lock is set.  If it is do
-not artificially press Shift to generate the keysym.
-This will enable the CapsLock key to behave correctly
-in some circumstances: namely *both* the VNC viewer
-machine and the x11vnc X server are in the CapsLock
-on state.  If one side has CapsLock on and the other
-off and the keyboard is not behaving as you think it
-should you should correct the CapsLock states (hint:
-pressing CapsLock inside and outside of the viewer can
-help toggle them both to the correct state).  However,
-for best results do not use this option, but rather
-*only* enable CapsLock on the VNC viewer side (i.e. by
-pressing CapsLock outside of the viewer window, also
-\fB-skip_lockkeys\fR below).  Also try \fB-nomodtweak\fR for a
-possible workaround.
-.PP
-\fB-skip_lockkeys,\fR \fB-noskip_lockkeys\fR
-.IP
-Have x11vnc ignore all Caps_Lock, Shift_Lock, Num_Lock,
-Scroll_Lock keysyms received from viewers.  The idea is
-you press Caps_Lock on the VNC Viewer side but that does
-not change the lock state in the x11vnc-side X server.
-Nevertheless your capitalized letters come in over
-the wire and are applied correctly to the x11vnc-side
-X server.  Note this mode probably won't do what you
-want in \fB-nomodtweak\fR mode.  Also, a kludge for KP_n
-digits is always done in this mode: they are mapped to
-regular digit keysyms.  See also \fB-capslock\fR above.
-The default is \fB-noskip_lockkeys.\fR
-.PP
-\fB-skip_keycodes\fR \fIstring\fR
-.IP
-Ignore the comma separated list of decimal keycodes.
-Perhaps these are keycodes not on your keyboard but
-your X server thinks exist.  Currently only applies
-to \fB-xkb\fR mode.  Use this option to help x11vnc in the
-reverse problem it tries to solve: Keysym -> Keycode(s)
-when ambiguities exist (more than one Keycode per
-Keysym).  Run 'xmodmap \fB-pk'\fR to see your keymapping.
-Example: "\fB-skip_keycodes\fR \fI94,114\fR"
-.PP
-\fB-sloppy_keys\fR
-.IP
-Experimental option that tries to correct some
-"sloppy" key behavior.  E.g. if at the viewer you
-press Shift+Key but then release the Shift before
-Key that could give rise to extra unwanted characters
-(usually only between keyboards of different languages).
-Only use this option if you observe problems with
-some keystrokes.
-.PP
-\fB-skip_dups,\fR \fB-noskip_dups\fR
-.IP
-Some VNC viewers send impossible repeated key events,
-e.g. key-down, key-down, key-up, key-up all for the same
-key, or 20 downs in a row for the same modifier key!
-Setting \fB-skip_dups\fR means to skip these duplicates and
-just process the first event. Note: some VNC viewers
-assume they can send down's without the corresponding
-up's and so you should not set this option for
-these viewers (symptom: some keys do not autorepeat)
-Default: \fB-noskip_dups\fR
-.PP
-\fB-add_keysyms,\fR \fB-noadd_keysyms\fR
-.IP
-If a Keysym is received from a VNC viewer and that
-Keysym does not exist in the X server, then add the
-Keysym to the X server's keyboard mapping on an unused
-key.  Added Keysyms will be removed periodically and
-also when x11vnc exits.  Default: \fB-add_keysyms\fR
-.PP
-\fB-clear_mods\fR
-.IP
-At startup and exit clear the modifier keys by sending
-KeyRelease for each one. The Lock modifiers are skipped.
-Used to clear the state if the display was accidentally
-left with any pressed down.
-.PP
-\fB-clear_keys\fR
-.IP
-As \fB-clear_mods,\fR except try to release ANY pressed key.
-Note that this option and \fB-clear_mods\fR can interfere
-with a person typing at the physical keyboard.
-.PP
-\fB-clear_all\fR
-.IP
-As \fB-clear_keys,\fR except try to release any CapsLock,
-NumLock, etc. locks as well.
-.PP
-\fB-remap\fR \fIstring\fR
-.IP
-Read Keysym remappings from file named \fIstring\fR.
-Format is one pair of Keysyms per line (can be name
-or hex value) separated by a space.  If no file named
-\fIstring\fR exists, it is instead interpreted as this
-form: key1-key2,key3-key4,...  See <X11/keysymdef.h>
-header file for a list of Keysym names, or use 
-.IR xev (1).
-.IP
-To map a key to a button click, use the fake Keysyms
-"Button1", ..., etc. E.g: "\fB-remap\fR \fISuper_R-Button2\fR"
-(useful for pasting on a laptop)
-.IP
-I use these if the machine I am viewing from does not
-have a scrollwheel or I don't like using the one it has:
-.IP
-\fB-remap\fR Super_R-Button4,Menu-Button5
-\fB-remap\fR KP_Add-Button4,KP_Enter-Button5
-.IP
-the former would be used on a PC, the latter on a
-MacBook.  This way those little used keys can be used
-to generate bigger hops than the Up and Down arrows
-provide.  One can scroll through text or web pages more
-quickly this way (especially if x11vnc scroll detection
-is active.)
-.IP
-Use Button44, Button12, etc. for multiple clicks.
-.IP
-To disable a keysym (i.e. make it so it will not be
-injected), remap it to "NoSymbol" or "None".
-.IP
-Dead keys: "dead" (or silent, mute) keys are keys that
-do not produce a character but must be followed by a 2nd
-keystroke.  This is often used for accenting characters,
-e.g. to put "`" on top of "a" by pressing the dead
-key and then "a".  Note that this interpretation
-is not part of core X11, it is up to the toolkit or
-application to decide how to react to the sequence.
-The X11 names for these keysyms are "dead_grave",
-"dead_acute", etc.  However some VNC viewers send the
-keysyms "grave", "acute" instead thereby disabling
-the accenting.  To work around this \fB-remap\fR can be used.
-For example "\fB-remap\fR \fIgrave-dead_grave,acute-dead_acute\fR"
-.IP
-As a convenience, "\fB-remap\fR \fIDEAD\fR" applies these remaps:
-.IP
-      g     grave-dead_grave
-      a     acute-dead_acute
-      c     asciicircum-dead_circumflex
-      t     asciitilde-dead_tilde
-      m     macron-dead_macron
-      b     breve-dead_breve
-      D     abovedot-dead_abovedot
-      d     diaeresis-dead_diaeresis
-      o     degree-dead_abovering
-      A     doubleacute-dead_doubleacute
-      r     caron-dead_caron
-      e     cedilla-dead_cedilla
-.IP
-.IP
-If you just want a subset use the first letter
-label, e.g. "\fB-remap\fR \fIDEAD=ga\fR" to get the first two.
-Additional remaps may also be supplied via commas,
-e.g.  "\fB-remap\fR \fIDEAD=ga,Super_R-Button2\fR".  Finally,
-"DEAD=missing" means to apply all of the above as
-long as the left hand member is not already in the
-X11 keymap.
-.PP
-\fB-norepeat,\fR \fB-repeat\fR
-.IP
-Option \fB-norepeat\fR disables X server key auto repeat when
-VNC clients are connected and VNC keyboard input is
-not idle for more than 5 minutes.  This works around a
-repeating keystrokes bug (triggered by long processing
-delays between key down and key up client events:
-either from large screen changes or high latency).
-Default: \fB-norepeat\fR
-.IP
-You can set the env. var. X11VNC_IDLE_TIMEOUT to the
-number of idle seconds you want (5min = 300secs).
-.IP
-Note: your VNC viewer side will likely do autorepeating,
-so this is no loss unless someone is simultaneously at
-the real X display.
-.IP
-Use "\fB-norepeat\fR \fIN\fR" to set how many times norepeat will
-be reset if something else (e.g. X session manager)
-undoes it.  The default is 2.  Use a negative value
-for unlimited resets.
-.PP
-\fB-nofb\fR
-.IP
-Ignore video framebuffer: only process keyboard and
-pointer.  Intended for use with Win2VNC and x2vnc
-dual-monitor setups.
-.PP
-\fB-nobell\fR
-.IP
-Do not watch for XBell events. (no beeps will be heard)
-Note: XBell monitoring requires the XKEYBOARD extension.
-.PP
-\fB-nosel\fR
-.IP
-Do not manage exchange of X selection/cutbuffer between
-VNC viewers and the X server at all.
-.PP
-\fB-noprimary\fR
-.IP
-Do not poll the PRIMARY selection for changes to send
-back to clients.  (PRIMARY is still set on received
-changes, however).
-.PP
-\fB-nosetprimary\fR
-.IP
-Do not set the PRIMARY selection for changes received
-from VNC clients.
-.PP
-\fB-noclipboard\fR
-.IP
-Do not poll the CLIPBOARD selection for changes to send
-back to clients.  (CLIPBOARD is still set on received
-changes, however).
-.PP
-\fB-nosetclipboard\fR
-.IP
-Do not set the CLIPBOARD selection for changes
-received from VNC clients.
-.PP
-\fB-seldir\fR \fIstring\fR
-.IP
-If direction string is "send", only send the selection
-to viewers, and if it is "recv" only receive it from
-viewers.  To work around apps setting the selection
-too frequently and messing up the other end.  You can
-actually supply a comma separated list of directions,
-including "debug" to turn on debugging output.
-.PP
-\fB-cursor\fR \fI[mode],\fR \fB-nocursor\fR
-.IP
-Sets how the pointer cursor shape (little icon at the
-mouse pointer) should be handled.  The "mode" string
-is optional and is described below.  The default
-is to show some sort of cursor shape(s).  How this
-is done depends on the VNC viewer and the X server.
-Use \fB-nocursor\fR to disable cursor shapes completely.
-.IP
-Some VNC viewers support the TightVNC CursorPosUpdates
-and CursorShapeUpdates extensions (cuts down on
-network traffic by not having to send the cursor image
-every time the pointer is moved), in which case these
-extensions are used (see \fB-nocursorshape\fR and \fB-nocursorpos\fR
-below to disable).  For other viewers the cursor shape
-is written directly to the framebuffer every time the
-pointer is moved or changed and gets sent along with
-the other framebuffer updates.  In this case, there
-will be some lag between the vnc viewer pointer and
-the remote cursor position.
-.IP
-If the X display supports retrieving the cursor shape
-information from the X server, then the default is
-to use that mode.  On Solaris this can be done with
-the SUN_OVL extension using \fB-overlay\fR (see also the
-\fB-overlay_nocursor\fR option).  A similar overlay scheme
-is used on IRIX.  Xorg (e.g. Linux) and recent Solaris
-Xsun servers support the XFIXES extension to retrieve
-the exact cursor shape from the X server.  If XFIXES
-is present it is preferred over Overlay and is used by
-default (see \fB-noxfixes\fR below).  This can be disabled
-with \fB-nocursor,\fR and also some values of the "mode"
-option below.
-.IP
-Note that under XFIXES cursors with transparency (alpha
-channel) will usually not be exactly represented and one
-may find Overlay preferable.  See also the \fB-alphacut\fR
-and \fB-alphafrac\fR options below as fudge factors to try
-to improve the situation for cursors with transparency
-for a given theme.
-.IP
-The "mode" string can be used to fine-tune the
-displaying of cursor shapes.  It can be used the
-following ways:
-.IP
-"\fB-cursor\fR \fIarrow\fR" - just show the standard arrow
-nothing more or nothing less.
-.IP
-"\fB-cursor\fR \fInone\fR" - same as "\fB-nocursor\fR"
-.IP
-"\fB-cursor\fR \fIX\fR" - when the cursor appears to be on the
-root window, draw the familiar X shape.  Some desktops
-such as GNOME cover up the root window completely,
-and so this will not work, try "X1", etc, to try to
-shift the tree depth.  On high latency links or slow
-machines there will be a time lag between expected and
-the actual cursor shape.
-.IP
-"\fB-cursor\fR \fIsome\fR" - like "X" but use additional
-heuristics to try to guess if the window should have
-a windowmanager-like resizer cursor or a text input
-I-beam cursor.  This is a complete hack, but may be
-useful in some situations because it provides a little
-more feedback about the cursor shape.
-.IP
-"\fB-cursor\fR \fImost\fR" - try to show as many cursors as
-possible.  Often this will only be the same as "some"
-unless the display has overlay visuals or XFIXES
-extensions available.  On Solaris and IRIX if XFIXES
-is not available, \fB-overlay\fR mode will be attempted.
-.PP
-\fB-cursor_drag\fR
-.IP
-Show cursor shape changes even when the mouse is being
-dragged with a mouse button down.  This is useful if you
-want to be able to see Drag-and-Drop cursor icons, etc.
-.PP
-\fB-arrow\fR \fIn\fR
-.IP
-Choose an alternate "arrow" cursor from a set of
-some common ones.  n can be 1 to 6.  Default is: 1
-Ignored when in XFIXES cursor-grabbing mode.
-.PP
-\fB-noxfixes\fR
-.IP
-Do not use the XFIXES extension to draw the exact cursor
-shape even if it is available.
-.IP
-Note: To work around a crash in Xorg 1.5 and later
-some people needed to use \fB-noxfixes.\fR  The Xorg crash
-occurred right after a Display Manager (e.g. GDM) login.
-Starting with x11vnc 0.9.9 it tries to automatically
-avoid using XFIXES until it is sure a window manager
-is running.  See the \fB-reopen\fR option for more info and
-how to use X11VNC_AVOID_WINDOWS=never to disable it.
-.PP
-\fB-alphacut\fR \fIn\fR
-.IP
-When using the XFIXES extension for the cursor shape,
-cursors with transparency will not usually be displayed
-exactly (but opaque ones will).  This option sets n as
-a cutoff for cursors that have transparency ("alpha
-channel" with values ranging from 0 to 255) Any cursor
-pixel with alpha value less than n becomes completely
-transparent.  Otherwise the pixel is completely opaque.
-Default 240
-.PP
-\fB-alphafrac\fR \fIfraction\fR
-.IP
-With the threshold in \fB-alphacut\fR some cursors will become
-almost completely transparent because their alpha values
-are not high enough.  For those cursors adjust the
-alpha threshold until fraction of the non-zero alpha
-channel pixels become opaque.  Default 0.33
-.PP
-\fB-alpharemove\fR
-.IP
-By default, XFIXES cursors pixels with transparency have
-the alpha factor multiplied into the RGB color values
-(i.e. that corresponding to blending the cursor with a
-black background).  Specify this option to remove the
-alpha factor. (useful for light colored semi-transparent
-cursors).
-.PP
-\fB-noalphablend\fR
-.IP
-In XFIXES mode do not send cursor alpha channel data
-to LibVNCServer.  The default is to send it.  The
-alphablend effect will only be visible in \fB-nocursorshape\fR
-mode or for clients with cursorshapeupdates turned
-off. (However there is a hack for 32bpp with depth 24,
-it uses the extra 8 bits to store cursor transparency
-for use with a hacked vncviewer that applies the
-transparency locally.  See the FAQ for more info).
-.PP
-\fB-nocursorshape\fR
-.IP
-Do not use the TightVNC CursorShapeUpdates extension
-even if clients support it.  See \fB-cursor\fR above.
-.PP
-\fB-cursorpos,\fR \fB-nocursorpos\fR
-.IP
-Option \fB-cursorpos\fR enables sending the X cursor position
-back to all vnc clients that support the TightVNC
-CursorPosUpdates extension.  Other clients will be able
-to see the pointer motions. Default: \fB-cursorpos\fR
-.PP
-\fB-xwarppointer,\fR \fB-noxwarppointer\fR
-.IP
-Move the pointer with 
-.IR XWarpPointer (3X)
-instead of
-the XTEST extension.  Use this as a workaround
-if the pointer motion behaves incorrectly, e.g.
-on touchscreens or other non-standard setups.
-.IP
-It is also sometimes needed on XINERAMA displays and is
-enabled by default if XINERAMA is found to be active.
-To prevent this, use \fB-noxwarppointer.\fR
-.PP
-\fB-always_inject\fR
-.IP
-Even if there is no displacement (dx = dy = 0) for a
-VNC mouse event force the pointer to the indicated x,y
-position anyway.  Recent (2009) gui toolkits (gnome)
-have problems with x11vnc's original mouse input
-injection method.  So x11vnc's mouse input injection
-method has been modified.  To regain the OLD behavior
-use this option: \fB-always_inject.\fR  Then x11vnc will
-always force positioning the mouse to the x,y position
-even if that position has not changed since the previous
-VNC input event.
-.IP
-The first place this problem was noticed was in gnome
-terminal: if you pressed and released mouse button 3, a
-menu was posted and then its first element 'New Terminal
-Window' was activated.  This was because x11vnc injected
-the mouse position twice: once on ButtonPress and again
-on ButtonRelease.  The toolkit interpreted the 2nd one
-as mouse motion even though the mouse hadn't moved.
-So now by default x11vnc tries to avoid injecting the
-2nd one.
-.IP
-Note that with the new default x11vnc will be oblivious
-to applications moving the pointer (warping) or the
-user at the physical display moving it.  So it might,
-e.g., inject ButtonRelease at the wrong position.
-If this (or similar scenarios) causes problems in your
-environment, specify \fB-always_inject\fR for the old method.
-.PP
-\fB-buttonmap\fR \fIstring\fR
-.IP
-String to remap mouse buttons.  Format: IJK-LMN, this
-maps buttons I -> L, etc., e.g.  \fB-buttonmap\fR 13-31
-.IP
-Button presses can also be mapped to keystrokes: replace
-a button digit on the right of the dash with :<sym>:
-or :<sym1>+<sym2>: etc. for multiple keys. For example,
-if the viewing machine has a mouse-wheel (buttons 4 5)
-but the x11vnc side does not, these will do scrolls:
-.IP
-\fB-buttonmap\fR 12345-123:Prior::Next:
-.IP
-\fB-buttonmap\fR 12345-123:Up+Up+Up::Down+Down+Down:
-.IP
-See <X11/keysymdef.h> header file for a list of Keysyms,
-or use the 
-.IR xev (1)
-program.  Note: mapping of button
-clicks to Keysyms may not work if \fB-modtweak\fR or \fB-xkb\fR is
-needed for the Keysym.
-.IP
-If you include a modifier like "Shift_L" the
-modifier's up/down state is toggled, e.g. to send
-"The" use :Shift_L+t+Shift_L+h+e: (the 1st one is
-shift down and the 2nd one is shift up). (note: the
-initial state of the modifier is ignored and not reset)
-To include button events use "Button1", ... etc.
-.IP
-.IP
-\fB-buttonmap\fR currently does not work on MacOSX console
-or in \fB-rawfb\fR mode.
-.IP
-Workaround: use \fB-buttonmap\fR IJ...-LM...=n to limit the
-number of mouse buttons to n, e.g. 123-123=3.  This will
-prevent x11vnc from crashing if the X server reports
-there are 5 buttons (4/5 scroll wheel), but there are
-only really 3.
-.PP
-\fB-nodragging\fR
-.IP
-Do not update the display during mouse dragging events
-(mouse button held down).  Greatly improves response on
-slow setups, but you lose all visual feedback for drags,
-text selection, and some menu traversals.  It overrides
-any \fB-pointer_mode\fR setting.
-.PP
-\fB-ncache\fR \fIn\fR
-.IP
-Client-side caching scheme.  Framebuffer memory \fIn\fR
-(an integer) times that of the full display is allocated
-below the actual framebuffer to cache screen contents
-for rapid retrieval.  So a W x H frambuffer is expanded
-to a W x (n+1)*H one.  Use 0 to disable.
-.IP
-The \fIn\fR is actually optional, the default is 10.
-.IP
-For this and the other \fB-ncache*\fR options below you can
-abbreviate "\fB-ncache\fR" with "\fB-nc\fR".  Also, "\fB-nonc\fR"
-is the same as "\fB-ncache\fR \fI0\fR"
-.IP
-This is an experimental option, currently implemented in
-an awkward way in that in the VNC Viewer you can see the
-pixel cache contents if you scroll down, etc.  So you
-will have to set things up so you can't see that region.
-If this method is successful, the changes required for
-clients to do this less awkwardly will be investigated.
-.IP
-The SSVNC viewer does a good job at automatically hiding
-the pixel cache region.  Or use SSVNC's \fB-ycrop\fR option
-to explicitly hide the region.
-.IP
-Note that this mode consumes a huge amount of memory,
-both on the x11vnc server side and on the VNC Viewer
-side.  If n=2 then the amount of RAM used is roughly
-tripled for both x11vnc and the VNC Viewer.  As a rule
-of thumb, note that 1280x1024 at depth 24 is about 5MB
-of pixel data.
-.IP
-For reasonable response when cycling through 4 to 6
-large (e.g. web browser) windows a value n of 6 to 12
-is recommended. (that's right: ~10X more memory...)
-.IP
-Because of the way window backingstore and saveunders
-are implemented, n must be even.  It will be incremented
-by 1 if it is not.
-.IP
-This mode also works for native MacOS X, but may not
-be as effective as the X version.  This is due to a
-number of things, one is the drop-shadow compositing
-that leaves extra areas that need to be repaired (see
-\fB-ncache_pad).\fR  Another is the window iconification
-animations need to be avoided (see \fB-macicontime).\fR
-It appears the that the 'Scale' animation mode gives
-better results than the 'Genie' one.  Also, window event
-detection not as accurate as the X version.
-.PP
-\fB-ncache_cr\fR
-.IP
-In \fB-ncache\fR mode, try to do copyrect opaque window
-moves/drags instead of wireframes (this can induce
-painting errors).  The wireframe will still be used when
-moving a window whose save-unders has not yet been set
-or has been invalidated.
-.IP
-Some VNC Viewers provide better response than others
-with this option.  On Unix, realvnc viewer gives
-smoother drags than tightvnc viewer.  Response may also
-be choppy if the server side machine is too slow.
-.IP
-Sometimes on very slow modem connections, this actually
-gives an improvement because no pixel data at all
-(not even the box animation) is sent during the drag.
-.PP
-\fB-ncache_no_moveraise\fR
-.IP
-In \fB-ncache\fR mode, do not assume that moving a window
-will cause the window manager to raise it to the top
-of the stack.  The default is to assume it does, and
-so at the beginning of any wireframe, etc, window moves
-the window will be pushed to top in the VNC viewer.
-.PP
-\fB-ncache_no_dtchange\fR
-.IP
-In \fB-ncache\fR mode, do not try to guess when the desktop
-(viewport) changes to another one (i.e. another
-workarea).  The default is to try to guess and when
-detected try to make the transistion more smoothly.
-.PP
-\fB-ncache_no_rootpixmap\fR
-.IP
-In \fB-ncache\fR mode, do not try to snapshot the desktop
-background to use in guessing or reconstructing window
-save-unders.
-.PP
-\fB-ncache_keep_anims\fR
-.IP
-In \fB-ncache\fR mode, do not try to disable window
-manager animations and other effects (that usually
-degrade ncache performance or cause painting errors).
-The default is to try to disable them on KDE (but not
-GNOME) when VNC clients are connected.
-.IP
-For other window managers or desktops that provide
-animations, effects, compositing, translucency,
-etc. that interfere with the \fB-ncache\fR method you will
-have to disable them manually.
-.PP
-\fB-ncache_old_wm\fR
-.IP
-In \fB-ncache\fR mode, enable some heuristics for old style
-window managers such as fvwm and twm.
-.PP
-\fB-ncache_pad\fR \fIn\fR
-.IP
-In \fB-ncache\fR mode, pad each window with n pixels for the
-caching rectangles.  This can be used to try to improve
-the situation with dropshadows or other compositing
-(e.g. MacOS X window manager), although it could make
-things worse.  The default is 0 on Unix and 24 on
-MacOS X.
-.PP
-\fB-debug_ncache\fR
-.IP
-Turn on debugging and profiling output under \fB-ncache.\fR
-.PP
-\fB-wireframe\fR \fI[str],\fR \fB-nowireframe\fR
-.IP
-Try to detect window moves or resizes when a mouse
-button is held down and show a wireframe instead of
-the full opaque window.  This is based completely on
-heuristics and may not always work: it depends on your
-window manager and even how you move things around.
-See \fB-pointer_mode\fR below for discussion of the "bogging
-down" problem this tries to avoid.
-Default: \fB-wireframe\fR
-.IP
-Shorter aliases:  \fB-wf\fR [str]  and \fB-nowf\fR
-.IP
-The value "str" is optional and, of course, is
-packed with many tunable parameters for this scheme:
-.IP
-Format: shade,linewidth,percent,T+B+L+R,mod,t1+t2+t3+t4
-Default: 0xff,2,0,32+8+8+8,all,0.15+0.30+5.0+0.125
-.IP
-If you leave nothing between commas: ",," the default
-value is used.  If you don't specify enough commas,
-the trailing parameters are set to their defaults.
-.IP
-"shade" indicate the "color" for the wireframe,
-usually a greyscale: 0-255, however for 16 and 32bpp you
-can specify an rgb.txt X color (e.g. "dodgerblue") or
-a value > 255 is treated as RGB (e.g. red is 0xff0000).
-"linewidth" sets the width of the wireframe in pixels.
-"percent" indicates to not apply the wireframe scheme
-to windows with area less than this percent of the
-full screen.
-.IP
-"T+B+L+R" indicates four integers for how close in
-pixels the pointer has to be from the Top, Bottom, Left,
-or Right edges of the window to consider wireframing.
-This is a speedup to quickly exclude a window from being
-wireframed: set them all to zero to not try the speedup
-(scrolling and selecting text will likely be slower).
-.IP
-"mod" specifies if a button down event in the
-interior of the window with a modifier key (Alt, Shift,
-etc.) down should indicate a wireframe opportunity.
-It can be "0" or "none" to skip it, "1" or "all"
-to apply it to any modifier, or "Shift", "Alt",
-"Control", "Meta", "Super", or "Hyper" to only
-apply for that type of modifier key.
-.IP
-"t1+t2+t3+t4" specify four floating point times in
-seconds: t1 is how long to wait for the pointer to move,
-t2 is how long to wait for the window to start moving
-or being resized (for some window managers this can be
-rather long), t3 is how long to keep a wireframe moving
-before repainting the window. t4 is the minimum time
-between sending wireframe "animations".  If a slow
-link is detected, these values may be automatically
-changed to something better for a slow link.
-.PP
-\fB-nowireframelocal\fR
-.IP
-By default, mouse motion and button presses of a
-user sitting at the LOCAL display are monitored for
-wireframing opportunities (so that the changes will be
-sent efficiently to the VNC clients).  Use this option
-to disable this behavior.
-.PP
-\fB-wirecopyrect\fR \fImode,\fR \fB-nowirecopyrect\fR
-.IP
-Since the \fB-wireframe\fR mechanism evidently tracks moving
-windows accurately, a speedup can be obtained by
-telling the VNC viewers to locally copy the translated
-window region.  This is the VNC CopyRect encoding:
-the framebuffer update doesn't need to send the actual
-new image data.
-.IP
-Shorter aliases:  \fB-wcr\fR [mode]  and \fB-nowcr\fR
-.IP
-"mode" can be "never" (same as \fB-nowirecopyrect)\fR
-to never try the copyrect, "top" means only do it if
-the window was not covered by any other windows, and
-"always" means to translate the orginally unobscured
-region (this may look odd as the remaining pieces come
-in, but helps on a slow link).  Default: "always"
-.IP
-Note: there can be painting errors or slow response
-when using \fB-scale\fR so you may want to disable CopyRect
-in this case "\fB-wirecopyrect\fR \fInever\fR" on the command
-line or by remote-control.  Or you can also use the
-"\fB-scale\fR \fIxxx:nocr\fR" scale option.
-.PP
-\fB-debug_wireframe\fR
-.IP
-Turn on debugging info printout for the wireframe
-heuristics.  "\fB-dwf\fR" is an alias.  Specify multiple
-times for more output.
-.PP
-\fB-scrollcopyrect\fR \fImode,\fR \fB-noscrollcopyrect\fR
-.IP
-Like \fB-wirecopyrect,\fR but use heuristics to try to guess
-if a window has scrolled its contents (either vertically
-or horizontally).  This requires the RECORD X extension
-to "snoop" on X applications (currently for certain
-XCopyArea and XConfigureWindow X protocol requests).
-Examples: Hitting <Return> in a terminal window when the
-cursor was at the bottom, the text scrolls up one line.
-Hitting <Down> arrow in a web browser window, the web
-page scrolls up a small amount.  Or scrolling with a
-scrollbar or mouse wheel.
-.IP
-Shorter aliases:  \fB-scr\fR [mode]  and \fB-noscr\fR
-.IP
-This scheme will not always detect scrolls, but when
-it does there is a nice speedup from using the VNC
-CopyRect encoding (see \fB-wirecopyrect).\fR  The speedup
-is both in reduced network traffic and reduced X
-framebuffer polling/copying.  On the other hand, it may
-induce undesired transients (e.g. a terminal cursor
-being scrolled up when it should not be) or other
-painting errors (window tearing, bunching-up, etc).
-These are automatically repaired in a short period
-of time.  If this is unacceptable disable the feature
-with \fB-noscrollcopyrect.\fR
-.IP
-Screen clearing kludges:  for testing at least, there
-are some "magic key sequences" (must be done in less
-than 1 second) to aid repairing painting errors that
-may be seen when using this mode:
-.IP
-3 Alt_L's   in a row: resend whole screen,
-4 Alt_L's   in a row: reread and resend whole screen,
-3 Super_L's in a row: mark whole screen for polling,
-4 Super_L's in a row: reset RECORD context,
-5 Super_L's in a row: try to push a black screen
-.IP
-note: Alt_L is the Left "Alt" key (a single key)
-Super_L is the Left "Super" key (Windows flag).
-Both of these are modifier keys, and so should not
-generate characters when pressed by themselves.  Also,
-your VNC viewer may have its own refresh hot-key
-or button.
-.IP
-"mode" can be "never" (same as \fB-noscrollcopyrect)\fR
-to never try the copyrect, "keys" means to try it
-in response to keystrokes only, "mouse" means to
-try it in response to mouse events only, "always"
-means to do both. Default: "always"
-.IP
-Note: there can be painting errors or slow response
-when using \fB-scale\fR so you may want to disable CopyRect
-in this case "\fB-scrollcopyrect\fR \fInever\fR" on the command
-line or by remote-control.  Or you can also use the
-"\fB-scale\fR \fIxxx:nocr\fR" scale option.
-.PP
-\fB-scr_area\fR \fIn\fR
-.IP
-Set the minimum area in pixels for a rectangle
-to be considered for the \fB-scrollcopyrect\fR detection
-scheme.  This is to avoid wasting the effort on small
-rectangles that would be quickly updated the normal way.
-E.g. suppose an app updated the position of its skinny
-scrollbar first and then shifted the large panel
-it controlled.  We want to be sure to skip the small
-scrollbar and get the large panel. Default: 60000
-.PP
-\fB-scr_skip\fR \fIlist\fR
-.IP
-Skip scroll detection for applications matching
-the comma separated list of strings in \fIlist\fR.
-Some applications implement their scrolling in
-strange ways where the XCopyArea, etc, also applies
-to invisible portions of the window: if we CopyRect
-those areas it looks awful during the scroll and
-there may be painting errors left after the scroll.
-Soffice.bin is the worst known offender.
-.IP
-Use "##" to denote the start of the application class
-(e.g. "##XTerm") and "++" to denote the start
-of the application instance name (e.g. "++xterm").
-The string your list is matched against is of the form
-"^^WM_NAME##Class++Instance<same-for-any-subwindows>"
-The "xlsclients \fB-la"\fR command will provide this info.
-.IP
-If a pattern is prefixed with "KEY:" it only applies
-to Keystroke generated scrolls (e.g. Up arrow).  If it
-is prefixed with "MOUSE:" it only applies to Mouse
-induced scrolls (e.g. dragging on a scrollbar).
-Default: ##Soffice.bin,##StarOffice,##OpenOffice
-.PP
-\fB-scr_inc\fR \fIlist\fR
-.IP
-Opposite of \fB-scr_skip:\fR this list is consulted first
-and if there is a match the window will be monitored
-via RECORD for scrolls irrespective of \fB-scr_skip.\fR
-Use \fB-scr_skip\fR '*' to skip anything that does not match
-your \fB-scr_inc.\fR  Use \fB-scr_inc\fR '*' to include everything.
-.PP
-\fB-scr_keys\fR \fIlist\fR
-.IP
-For keystroke scroll detection, only apply the RECORD
-heuristics to the comma separated list of keysyms in
-\fIlist\fR.  You may find the RECORD overhead for every
-one of your keystrokes disrupts typing too much, but you
-don't want to turn it off completely with "\fB-scr\fR \fImouse\fR"
-and \fB-scr_parms\fR does not work or is too confusing.
-.IP
-The listed keysyms can be numeric or the keysym
-names in the <X11/keysymdef.h> header file or from the
-.IR xev (1)
-program.  Example: "\fB-scr_keys\fR \fIUp,Down,Return\fR".
-One probably wants to have application specific lists
-(e.g. for terminals, etc) but that is too icky to think
-about for now...
-.IP
-If \fIlist\fR begins with the "-" character the list
-is taken as an exclude list: all keysyms except those
-list will be considered.  The special string "builtin"
-expands to an internal list of keysyms that are likely
-to cause scrolls.  BTW, by default modifier keys,
-Shift_L, Control_R, etc, are skipped since they almost
-never induce scrolling by themselves.
-.PP
-\fB-scr_term\fR \fIlist\fR
-.IP
-Yet another cosmetic kludge.  Apply shell/terminal
-heuristics to applications matching comma separated
-list (same as for \fB-scr_skip/-scr_inc).\fR  For example an
-annoying transient under scroll detection is if you
-hit Enter in a terminal shell with full text window,
-the solid text cursor block will be scrolled up.
-So for a short time there are two (or more) block
-cursors on the screen.  There are similar scenarios,
-(e.g. an output line is duplicated).
-.IP
-These transients are induced by the approximation of
-scroll detection (e.g. it detects the scroll, but not
-the fact that the block cursor was cleared just before
-the scroll).  In nearly all cases these transient errors
-are repaired when the true X framebuffer is consulted
-by the normal polling.  But they are distracting, so
-what this option provides is extra "padding" near the
-bottom of the terminal window: a few extra lines near
-the bottom will not be scrolled, but rather updated
-from the actual X framebuffer.  This usually reduces
-the annoying artifacts.  Use "none" to disable.
-Default: "term"
-.PP
-\fB-scr_keyrepeat\fR \fIlo-hi\fR
-.IP
-If a key is held down (or otherwise repeats rapidly) and
-this induces a rapid sequence of scrolls (e.g. holding
-down an Arrow key) the "scrollcopyrect" detection
-and overhead may not be able to keep up.  A time per
-single scroll estimate is performed and if that estimate
-predicts a sustainable scrollrate of keys per second
-between "lo" and "hi" then repeated keys will be
-DISCARDED to maintain the scrollrate. For example your
-key autorepeat may be 25 keys/sec, but for a large
-window or slow link only 8 scrolls per second can be
-sustained, then roughly 2 out of every 3 repeated keys
-will be discarded during this period. Default: "4-20"
-.PP
-\fB-scr_parms\fR \fIstring\fR
-.IP
-Set various parameters for the scrollcopyrect mode.
-The format is similar to that for \fB-wireframe\fR and packed
-with lots of parameters:
-.IP
-Format: T+B+L+R,t1+t2+t3,s1+s2+s3+s4+s5
-Default: 0+64+32+32,0.02+0.10+0.9,0.03+0.06+0.5+0.1+5.0
-.IP
-If you leave nothing between commas: ",," the default
-value is used.  If you don't specify enough commas,
-the trailing parameters are set to their defaults.
-.IP
-"T+B+L+R" indicates four integers for how close in
-pixels the pointer has to be from the Top, Bottom, Left,
-or Right edges of the window to consider scrollcopyrect.
-If \fB-wireframe\fR overlaps it takes precedence.  This is a
-speedup to quickly exclude a window from being watched
-for scrollcopyrect: set them all to zero to not try
-the speedup (things like selecting text will likely
-be slower).
-.IP
-"t1+t2+t3" specify three floating point times in
-seconds that apply to scrollcopyrect detection with
-*Keystroke* input: t1 is how long to wait after a key
-is pressed for the first scroll, t2 is how long to keep
-looking after a Keystroke scroll for more scrolls.
-t3 is how frequently to try to update surrounding
-scrollbars outside of the scrolling area (0.0 to
-disable)
-.IP
-"s1+s2+s3+s4+s5" specify five floating point times
-in seconds that apply to scrollcopyrect detection with
-*Mouse* input: s1 is how long to wait after a mouse
-button is pressed for the first scroll, s2 is how long
-to keep waiting for additional scrolls after the first
-Mouse scroll was detected.  s3 is how frequently to
-try to update surrounding scrollbars outside of the
-scrolling area (0.0 to disable).  s4 is how long to
-buffer pointer motion (to try to get fewer, bigger
-mouse scrolls). s5 is the maximum time to spend just
-updating the scroll window without updating the rest
-of the screen.
-.PP
-\fB-fixscreen\fR \fIstring\fR
-.IP
-Periodically "repair" the screen based on settings
-in \fIstring\fR.  Hopefully you won't need this option,
-it is intended for cases when the \fB-scrollcopyrect\fR or
-\fB-wirecopyrect\fR features leave too many painting errors,
-but it can be used for any scenario.  This option
-periodically performs costly operations and so
-interactive response may be reduced when it is on.
-You can use 3 Alt_L's (the Left "Alt" key) taps in
-a row (as described under \fB-scrollcopyrect)\fR instead to
-manually request a screen repaint when it is needed.
-.IP
-\fIstring\fR is a comma separated list of one or more of
-the following: "V=t", "C=t", "X=t", and "8=t".
-In these "t" stands for a time in seconds (it is
-a floating point even though one should usually use
-values > 2 to avoid wasting resources).  V sets how
-frequently the entire screen should be sent to viewers
-(it is like the 3 Alt_L's).  C sets how long to wait
-after a CopyRect to repaint the full screen.  X sets
-how frequently to reread the full X11 framebuffer from
-the X server and push it out to connected viewers.
-Use of X should be rare, please report a bug if you
-find you need it. 8= applies only for \fB-8to24\fR mode: it
-sets how often the non-default visual regions of the
-screen (e.g. 8bpp windows) are refreshed.  Examples:
-\fB-fixscreen\fR V=10 \fB-fixscreen\fR C=10
-.PP
-\fB-debug_scroll\fR
-.IP
-Turn on debugging info printout for the scroll
-heuristics.  "\fB-ds\fR" is an alias.  Specify it multiple
-times for more output.
-.PP
-\fB-noxrecord\fR
-.IP
-Disable any use of the RECORD extension.  This is
-currently used by the \fB-scrollcopyrect\fR scheme and to
-monitor X server grabs.
-.PP
-\fB-grab_buster,\fR \fB-nograb_buster\fR
-.IP
-Some of the use of the RECORD extension can leave a
-tiny window for XGrabServer deadlock.  This is only if
-the whole-server grabbing application expects mouse or
-keyboard input before releasing the grab.  It is usually
-a window manager that does this.  x11vnc takes care to
-avoid the problem, but if caught x11vnc will freeze.
-Without \fB-grab_buster,\fR the only solution is to go the
-physical display and give it some input to satisfy the
-grabbing app.  Or manually kill and restart the window
-manager if that is feasible.  With \fB-grab_buster,\fR x11vnc
-will fork a helper thread and if x11vnc appears to be
-stuck in a grab after a period of time (20-30 sec) then
-it will inject some user input: button clicks, Escape,
-mouse motion, etc to try to break the grab.  If you
-experience a lot of grab deadlock, please report a bug.
-.PP
-\fB-debug_grabs\fR
-.IP
-Turn on debugging info printout with respect to
-XGrabServer() deadlock for \fB-scrollcopyrect__mode_.\fR
-.PP
-\fB-debug_sel\fR
-.IP
-Turn on debugging info printout with respect to
-PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.
-.PP
-\fB-pointer_mode\fR \fIn\fR
-.IP
-Various pointer motion update schemes. "\fB-pm\fR" is
-an alias.  The problem is pointer motion can cause
-rapid changes on the screen: consider the rapid
-changes when you drag a large window around opaquely.
-Neither x11vnc's screen polling and vnc compression
-routines nor the bandwidth to the vncviewers can keep
-up these rapid screen changes: everything will bog down
-when dragging or scrolling.  So a scheme has to be used
-to "eat" much of that pointer input before re-polling
-the screen and sending out framebuffer updates. The
-mode number \fIn\fR can be 0 to 4 and selects one of
-the schemes desribed below.
-.IP
-Note that the \fB-wireframe\fR and \fB-scrollcopyrect__mode_s\fR
-complement \fB-pointer_mode\fR by detecting (and improving)
-certain periods of "rapid screen change".
-.IP
-n=0: does the same as \fB-nodragging.\fR (all screen polling
-is suspended if a mouse button is pressed.)
-.IP
-n=1: was the original scheme used to about Jan 2004:
-it basically just skips \fB-input_skip\fR keyboard or pointer
-events before repolling the screen.
-.IP
-n=2 is an improved scheme: by watching the current rate
-of input events it tries to detect if it should try to
-"eat" additional pointer events before continuing.
-.IP
-n=3 is basically a dynamic \fB-nodragging\fR mode: it detects
-when the mouse motion has paused and then refreshes
-the display.
-.IP
-n=4 attempts to measures network rates and latency,
-the video card read rate, and how many tiles have been
-changed on the screen.  From this, it aggressively tries
-to push screen "frames" when it decides it has enough
-resources to do so.  NOT FINISHED.
-.IP
-The default n is 2. Note that modes 2, 3, 4 will skip
-\fB-input_skip\fR keyboard events (but it will not count
-pointer events).  Also note that these modes are not
-available in \fB-threads\fR mode which has its own pointer
-event handling mechanism.
-.IP
-To try out the different pointer modes to see which
-one gives the best response for your usage, it is
-convenient to use the remote control function, for
-example "x11vnc \fB-R\fR pm:4" or the tcl/tk gui (Tuning ->
-pointer_mode -> n).
-.PP
-\fB-input_skip\fR \fIn\fR
-.IP
-For the pointer handling when non-threaded: try to
-read n user input events before scanning display. n < 0
-means to act as though there is always user input.
-Default: 10
-.PP
-\fB-allinput\fR
-.IP
-Have x11vnc read and process all available client input
-before proceeding.
-.PP
-\fB-input_eagerly\fR
-.IP
-Similar to \fB-allinput\fR but use the handleEventsEagerly
-mechanism built into LibVNCServer.
-.PP
-\fB-speeds\fR \fIrd,bw,lat\fR
-.IP
-x11vnc tries to estimate some speed parameters that
-are used to optimize scheduling (e.g. \fB-pointer_mode\fR
-4, \fB-wireframe,\fR \fB-scrollcopyrect)\fR and other things.
-Use the \fB-speeds\fR option to set these manually.
-The triple \fIrd,bw,lat\fR corresponds to video h/w
-read rate in MB/sec, network bandwidth to clients in
-KB/sec, and network latency to clients in milliseconds,
-respectively.  If a value is left blank, e.g. "-speeds
-,100,15", then the internal scheme is used to estimate
-the empty value(s).
-.IP
-Typical PC video cards have read rates of 5-10 MB/sec.
-If the framebuffer is in main memory instead of video
-h/w (e.g. SunRay, shadowfb, dummy driver, Xvfb), the
-read rate may be much faster.  "x11perf \fB-getimage500"\fR
-can be used to get a lower bound (remember to factor
-in the bytes per pixel).  It is up to you to estimate
-the network bandwith and latency to clients.  For the
-latency the 
-.IR ping (1)
-command can be used.
-.IP
-For convenience there are some aliases provided,
-e.g. "\fB-speeds\fR \fImodem\fR".  The aliases are: "modem" for
-6,4,200; "dsl" for 6,100,50; and "lan" for 6,5000,1
-.PP
-\fB-wmdt\fR \fIstring\fR
-.IP
-For some features, e.g. \fB-wireframe\fR and \fB-scrollcopyrect,\fR
-x11vnc has to work around issues for certain window
-managers or desktops (currently kde and xfce).
-By default it tries to guess which one, but it can
-guess incorrectly.  Use this option to indicate which
-wm/dt.  \fIstring\fR can be "gnome", "kde", "cde",
-"xfce", or "root" (classic X wm).  Anything else
-is interpreted as "root".
-.PP
-\fB-debug_pointer\fR
-.IP
-Print debugging output for every pointer event.
-.PP
-\fB-debug_keyboard\fR
-.IP
-Print debugging output for every keyboard event.
-.PP
-Same as \fB-dp\fR and \fB-dk,\fR respectively.  Use multiple
-times for more output.
-.PP
-\fB-defer\fR \fItime\fR
-.IP
-Time in ms to delay sending updates to connected clients
-(deferUpdateTime)  Default: 20
-.PP
-\fB-wait\fR \fItime\fR
-.IP
-Time in ms to pause between screen polls.  Used to cut
-down on load.  Default: 20
-.PP
-\fB-extra_fbur\fR \fIn\fR
-.IP
-Perform extra FrameBufferUpdateRequests checks to
-try to be in better sync with the client's requests.
-What this does is perform extra polls of the client
-socket at critical times (before '-defer' and '-wait'
-calls.)  The default is n=1.  Set to a larger number to
-insert more checks or set to n=0 to disable.  A downside
-of these extra calls is that more mouse input may be
-processed than desired.
-.PP
-\fB-wait_ui\fR \fIfactor\fR
-.IP
-Factor by which to cut the \fB-wait\fR time if there
-has been recent user input (pointer or keyboard).
-Improves response, but increases the load whenever you
-are moving the mouse or typing.  Default: 2.00
-.PP
-\fB-setdefer\fR \fIn\fR
-.IP
-When the \fB-wait_ui\fR mechanism cuts down the wait time ms,
-set the defer time to the same ms value. n=1 to enable,
-0 to disable, and -1 to set defer to 0 (no delay).
-Similarly, 2 and -2 indicate 'urgent_update' mode should
-be used to push the updates even sooner.  Default: 1
-.PP
-\fB-nowait_bog\fR
-.IP
-Do not detect if the screen polling is "bogging down"
-and sleep more.  Some activities with no user input can
-slow things down a lot: consider a large terminal window
-with a long build running in it continuously streaming
-text output.  By default x11vnc will try to detect this
-(3 screen polls in a row each longer than 0.25 sec with
-no user input), and sleep up to 1.5 secs to let things
-"catch up".  Use this option to disable that detection.
-.PP
-\fB-slow_fb\fR \fItime\fR
-.IP
-Floating point time in seconds to delay all screen
-polling.  For special purpose usage where a low frame
-rate is acceptable and desirable, but you want the
-user input processed at the normal rate so you cannot
-use \fB-wait.\fR
-.PP
-\fB-xrefresh\fR \fItime\fR
-.IP
-Floating point time in seconds to indicate how often to
-do the equivalent of 
-.IR xrefresh (1)
-to force all windows
-(in the viewable area if \fB-id,\fR \fB-sid,\fR or \fB-clip\fR is used)
-to repaint themselves.  Use this only if applications
-misbehave by not repainting themselves properly.
-See also \fB-noxdamage.\fR
-.PP
-\fB-nap,\fR \fB-nonap\fR
-.IP
-Monitor activity and if it is low take longer naps
-between screen polls to really cut down load when idle.
-Default: take naps
-.PP
-\fB-sb\fR \fItime\fR
-.IP
-Time in seconds after NO activity (e.g. screen blank)
-to really throttle down the screen polls (i.e. sleep
-for about 1.5 secs). Use 0 to disable.  Default: 60
-Set the env. var. X11VNC_SB_FACTOR to scale it.
-.PP
-\fB-readtimeout\fR \fIn\fR
-.IP
-Set LibVNCServer rfbMaxClientWait to n seconds. On
-slow links that take a long time to paint the first
-screen LibVNCServer may hit the timeout and drop the
-connection.  Default: 20 seconds.
-.PP
-\fB-ping\fR \fIn\fR
-.IP
-Send a 1x1 framebuffer update to all clients every n
-seconds (e.g. to try to keep a network connection alive)
-.PP
-\fB-nofbpm,\fR \fB-fbpm\fR
-.IP
-If the system supports the FBPM (Frame Buffer Power
-Management) extension (i.e. some Sun systems), then
-prevent the video h/w from going into a reduced power
-state when VNC clients are connected.
-.IP
-FBPM capable video h/w save energy when the workstation
-is idle by going into low power states (similar to DPMS
-for monitors).  This interferes with x11vnc's polling
-of the framebuffer data.
-.IP
-"\fB-nofbpm\fR" means prevent FBPM low power states whenever
-VNC clients are connected, while "\fB-fbpm\fR" means to not
-monitor the FBPM state at all.  See the 
-.IR xset (1)
-manpage
-for details.  \fB-nofbpm\fR is basically the same as running
-"xset fbpm force on" periodically.  Default: \fB-fbpm\fR
-.PP
-\fB-nodpms,\fR \fB-dpms\fR
-.IP
-If the system supports the DPMS (Display Power Management
-Signaling) extension, then prevent the monitor from
-going into a reduced power state when VNC clients
-are connected.
-.IP
-DPMS reduced power monitor states are a good thing
-and you normally want the power down to take place
-(usually x11vnc has no problem exporting the display in
-this state).  You probably only want to use "\fB-nodpms\fR"
-to work around problems with Screen Savers kicking
-on in DPMS low power states.  There is known problem
-with kdesktop_lock on KDE where the screen saver keeps
-kicking in every time user input stops for a second
-or two.  Specifying "\fB-nodpms\fR" works around it.
-.IP
-"\fB-nodpms\fR" means prevent DPMS low power states whenever
-VNC clients are connected, while "\fB-dpms\fR" means to not
-monitor the DPMS state at all.  See the 
-.IR xset (1)
-manpage
-for details.  \fB-nodpms\fR is basically the same as running
-"xset dpms force on" periodically.  Default: \fB-dpms\fR
-.PP
-\fB-forcedpms\fR
-.IP
-If the system supports the DPMS (Display Power
-Management Signaling) extension, then try to keep the
-monitor in a powered off state.  This is to prevent
-nosey people at the physical display from viewing what
-is on the screen.  Be sure to lock the screen before
-disconnecting.
-.IP
-This method is far from bullet proof, e.g. suppose
-someone attaches a non-DPMS monitor, or loads the
-machine so that there is a gap of time before x11vnc
-restores the powered off state?  On many machines if
-he floods it with keyboard and mouse input he can see
-flashes of what is on the screen before the DPMS off
-state is reestablished.  For this to work securely
-there would need to be support in the X server to do
-this exactly rather than approximately with DPMS.
-.PP
-\fB-clientdpms\fR
-.IP
-As \fB-forcedpms\fR but only when VNC clients are connected.
-.PP
-\fB-noserverdpms\fR
-.IP
-The UltraVNC ServerInput extension is supported.
-This allows the VNC viewer to click a button that will
-cause the server (x11vnc) to try to disable keyboard
-and mouse input at the physical display and put the
-monitor in dpms powered off state.  Use this option to
-skip powering off the monitor.
-.PP
-\fB-noultraext\fR
-.IP
-Disable the following UltraVNC extensions: SingleWindow
-and ServerInput.  The others managed by LibVNCServer
-(textchat, 1/n scaling, rfbEncodingUltra) are not.
-.PP
-\fB-chatwindow\fR
-.IP
-Place a local UltraVNC chat window on the X11 display
-that x11vnc is polling.  That way the person on the VNC
-viewer-side can chat with the person at the physical
-X11 console. (e.g. helpdesk w/o telephone)
-.IP
-For this to work the SSVNC package (version 1.0.21 or
-later) MUST BE installed on the system where x11vnc runs
-and the 'ssvnc' command must be available in $PATH.
-The ssvncviewer is used as a chat window helper.
-See http://www.karlrunge.com/x11vnc/ssvnc.html
-.IP
-This option implies '-rfbversion 3.6' so as to trick
-UltraVNC viewers, otherwise they assume chat is not
-available.  To specify a different rfbversion, place
-it after the \fB-chatwindow\fR option on the cmdline.
-.IP
-See also the remote control 'chaton' and 'chatoff'
-actions.  These can also be set from the tkx11vnc GUI.
-.PP
-\fB-noxdamage\fR
-.IP
-Do not use the X DAMAGE extension to detect framebuffer
-changes even if it is available.  Use \fB-xdamage\fR if your
-default is to have it off.
-.IP
-x11vnc's use of the DAMAGE extension: 1) significantly
-reduces the load when the screen is not changing much,
-and 2) detects changed areas (small ones by default)
-more quickly.
-.IP
-Currently the DAMAGE extension is overly conservative
-and often reports large areas (e.g. a whole terminal
-or browser window) as damaged even though the actual
-changed region is much smaller (sometimes just a few
-pixels).  So heuristics were introduced to skip large
-areas and use the damage rectangles only as "hints"
-for the traditional scanline polling.  The following
-tuning parameters are introduced to adjust this
-behavior:
-.PP
-\fB-xd_area\fR \fIA\fR
-.IP
-Set the largest DAMAGE rectangle area \fIA\fR (in
-pixels: width * height) to trust as truly damaged:
-the rectangle will be copied from the framebuffer
-(slow) no matter what.  Set to zero to trust *all*
-rectangles. Default: 20000
-.PP
-\fB-xd_mem\fR \fIf\fR
-.IP
-Set how long DAMAGE rectangles should be "remembered",
-\fIf\fR is a floating point number and is in units of the
-scanline repeat cycle time (32 iterations).  The default
-(1.0) should give no painting problems. Increase it if
-there are problems or decrease it to live on the edge
-(perhaps useful on a slow machine).
-.PP
-\fB-sigpipe\fR \fIstring\fR
-.IP
-Broken pipe (SIGPIPE) handling.  \fIstring\fR can be
-"ignore" or "exit".  For "ignore" LibVNCServer
-will handle the abrupt loss of a client and continue,
-for "exit" x11vnc will cleanup and exit at the 1st
-broken connection.
-.IP
-This option is not really needed since LibVNCServer
-is doing the correct thing now for quite some time.
-However, for convenience you can use it to ignore other
-signals, e.g. "\fB-sigpipe\fR \fIignore:HUP,INT,TERM\fR" in case
-that would be useful for some sort of application.
-You can also put "exit:.." in the list to have x11vnc
-cleanup on the listed signals. "\fB-sig\fR" is an alias
-for this option if you don't like the 'pipe'. Example:
-\fB-sig\fR ignore:INT,TERM,exit:USR1
-.PP
-\fB-threads,\fR \fB-nothreads\fR
-.IP
-Whether or not to use the threaded LibVNCServer
-algorithm [rfbRunEventLoop] if libpthread is available.
-In this mode new threads (one for input and one
-for output) are created to handle each new client.
-Default: \fB-nothreads.\fR
-.IP
-Thread stability is much improved in version 0.9.8.
-.IP
-Multiple clients in threaded mode should be stable
-for the ZRLE encoding on all platforms.  The Tight and
-Zlib encodings are currently only stable on Linux for
-multiple clients.  Compile with \fB-DTLS=__thread\fR if your
-OS and compiler and linker support it.
-.IP
-For resizes (randr, etc.) set this env. var. to the number
-of milliseconds to sleep: X11VNC_THREADS_NEW_FB_SLEEP
-at various places in the do_new_fb() action.  This is to
-let various activities settle.  Default is about 500ms.
-.IP
-Multiple clients in threaded mode could yield better
-performance for 'class-room' broadcasting usage; also in
-\fB-appshare\fR broadcast mode.  See also the \fB-reflect\fR option.
-.PP
-\fB-fs\fR \fIf\fR
-.IP
-If the fraction of changed tiles in a poll is greater
-than f, the whole screen is updated.  Default: 0.75
-.PP
-\fB-gaps\fR \fIn\fR
-.IP
-Heuristic to fill in gaps in rows or cols of n or
-less tiles.  Used to improve text paging.  Default: 4
-.PP
-\fB-grow\fR \fIn\fR
-.IP
-Heuristic to grow islands of changed tiles n or wider
-by checking the tile near the boundary.  Default: 3
-.PP
-\fB-fuzz\fR \fIn\fR
-.IP
-Tolerance in pixels to mark a tiles edges as changed.
-Default: 2
-.PP
-\fB-debug_tiles\fR
-.IP
-Print debugging output for tiles, fb updates, etc.
-.PP
-\fB-snapfb\fR
-.IP
-Instead of polling the X display framebuffer (fb)
-for changes, periodically copy all of X display fb
-into main memory and examine that copy for changes.
-(This setting also applies for non-X \fB-rawfb\fR modes).
-Under some circumstances this will improve interactive
-response, or at least make things look smoother, but in
-others (most!) it will make the response worse.  If the
-video h/w fb is such that reading small tiles is very
-slow this mode could help.  To keep the "framerate"
-up the screen size x bpp cannot be too large.  Note that
-this mode is very wasteful of memory I/O resources
-(it makes full screen copies even if nothing changes).
-It may be of use in video capture-like applications,
-webcams, or where window tearing is a problem.
-.PP
-\fB-rawfb\fR \fIstring\fR
-.IP
-Instead of polling X, poll the memory object specified
-in \fIstring\fR.
-.IP
-For file polling, to memory map 
-.IR mmap (2)
-a file use:
-"map:/path/to/a/file at WxHxB", with framebuffer Width,
-Height, and Bits per pixel.  "mmap:..." is the
-same.
-.IP
-If there is trouble with mmap, use "file:/..."
-for slower 
-.IR lseek (2)
-based reading.
-.IP
-Use "snap:..." to imply \fB-snapfb\fR mode and the "file:"
-access (this is for unseekable devices that only provide
-the fb all at once, e.g. a video camera provides the
-whole frame).
-.IP
-For shared memory segments string is of the form:
-"shm:N at WxHxB" which specifies a shmid N and with
-WxHxB as above.  See 
-.IR shmat (1)
-and 
-.IR ipcs (1)
-.IP
-If you do not supply a type "map" is assumed if
-the file exists (see the next paragraphs for some
-exceptions to this.)
-.IP
-If string is "setup:cmd", then the command "cmd"
-is run and the first line from it is read and used
-as \fIstring\fR.  This allows initializing the device,
-determining WxHxB, etc. These are often done as root
-so take care.
-.IP
-If the string begins with "video", see the VIDEO4LINUX
-discussion below where the device may be queried for
-(and possibly set) the framebuffer parameters.
-.IP
-If the string begins with "console", "/dev/fb",
-"fb", or "vt", see the LINUX CONSOLE discussion
-below where the framebuffer device is opened and
-keystrokes (and possibly mouse events) are inserted
-into the console.
-.IP
-If the string begins with "vnc", see the VNC HOST
-discussion below where the framebuffer is taken as that
-of another remote VNC server.
-.IP
-Optional suffixes are ":R/G/B" and "+O" to specify
-red, green, and blue masks (in hex) and an offset into
-the memory object.  If the masks are not provided x11vnc
-guesses them based on the bpp (if the colors look wrong,
-you need to provide the masks.)
-.IP
-Another optional suffix is the Bytes Per Line which in
-some cases is not WxB/8.  Specify it as WxHxB-BPL
-e.g. 800x600x16-2048.  This could be a normal width
-1024 at 16bpp fb, but only width 800 shows up.
-.IP
-So the full format is: mode:file at WxHxB:R/G/B+O-BPL
-.IP
-Examples:
-.IP
-\fB-rawfb\fR shm:210337933 at 800x600x32:ff/ff00/ff0000
-.IP
-\fB-rawfb\fR map:/dev/fb0 at 1024x768x32
-.IP
-\fB-rawfb\fR map:/tmp/Xvfb_screen0 at 640x480x8+3232
-.IP
-\fB-rawfb\fR file:/tmp/my.pnm at 250x200x24+37
-.IP
-\fB-rawfb\fR file:/dev/urandom at 128x128x8
-\fB-rawfb\fR snap:/dev/video0 at 320x240x24 \fB-24to32\fR
-\fB-rawfb\fR video0
-\fB-rawfb\fR video \fB-pipeinput\fR VID
-\fB-rawfb\fR console
-\fB-rawfb\fR vt2
-\fB-rawfb\fR vnc:somehost:0
-.IP
-(see 
-.IR ipcs (1)
-and 
-.IR fbset (1)
-for the first two examples)
-.IP
-In general all user input is discarded by default (see
-the \fB-pipeinput\fR option for how to use a helper program
-to insert).  Most of the X11 (screen, keyboard, mouse)
-options do not make sense and many will cause this
-mode to crash, so please think twice before setting or
-changing them in a running x11vnc.
-.IP
-If you DO NOT want x11vnc to close the X DISPLAY in
-rawfb mode, prepend a "+" e.g. +file:/dev/fb0...
-Keeping the display open enables the default
-remote-control channel, which could be useful.
-Alternatively, if you specify \fB-noviewonly,\fR then the
-mouse and keyboard input are STILL sent to the X
-display, this usage should be very rare, i.e. doing
-something strange with /dev/fb0.
-.IP
-If the device is not "seekable" (e.g. webcam) try
-reading it all at once in full snaps via the "snap:"
-mode (note: this is a resource hog).  If you are using
-file: or map: AND the device needs to be reopened for
-*every* snapfb snapshot, set the environment variable:
-SNAPFB_RAWFB_RESET=1 as well.
-.IP
-If you want x11vnc to dynamically transform a 24bpp
-rawfb to 32bpp (note that this will be slower) also
-supply the \fB-24to32\fR option.  This would be useful for,
-say, a video camera that delivers the pixel data as
-24bpp packed RGB.  This is the default under "video"
-mode if the bpp is 24.
-.IP
-Normally the bits per pixel, B, is 8, 16, or 32 (or
-rarely 24), however there is also some support for
-B < 8 (e.g. old graphics displays 4 bpp or 1 bpp).
-In this case you certainly must supply the masks as
-well: WxHxB:R/G/B.  The pixels will be padded out to
-8 bpp using depth 8 truecolor.  The scheme currently
-does not work with snap fb (ask if interested.) B=1
-monochrome example: file:/dev/urandom at 128x128x1:1/1/1
-Some other like this are 128x128x2:3/3/3 128x128x4:7/7/7
-.IP
-For B < 8 framebuffers you can also set the env. var
-RAWFB_CGA=1 to try a CGA mapping for B=4 (e.g. linux
-vga16fb driver.)  Note with low bpp and/or resolution
-VGA and VGA16 modes on the Linux console one's attempt
-to export them via x11vnc can often be thwarted due to
-special color palettes, pixel packings, and even video
-painting buffering.  OTOH, often experimenting with the
-RGB masks can yield something recognizable.
-.IP
-VIDEO4LINUX: on Linux some attempt is made to handle
-video devices (webcams or TV tuners) automatically.
-The idea is the WxHxB will be extracted from the
-device itself.  So if you do not supply "@WxHxB...
-parameters x11vnc will try to determine them.  It first
-tries the v4l API if that support has been compiled in.
-Otherwise it will run the v4l-
-.IR info (1)
-external program
-if it is available.
-.IP
-The simplest examples are "\fB-rawfb\fR \fIvideo\fR" and "-rawfb
-video1" which imply the device file /dev/video and
-/dev/video1, respectively.  You can also supply the
-/dev if you like, e.g. "\fB-rawfb\fR \fI/dev/video0\fR"
-.IP
-Since the video capture device framebuffer usually
-changes continuously (e.g. brightness fluctuations),
-you may want to use the \fB-wait,\fR \fB-slow_fb,\fR or \fB-defer\fR
-options to lower the "framerate" to cut down on
-network VNC traffic.
-.IP
-A more sophisticated video device scheme allows
-initializing the device's settings using:
-.IP
-\fB-rawfb\fR video:<settings>
-.IP
-The prefix could also be, as above, e.g. "video1:" to
-specify the device file.  The v4l API must be available
-for this to work.  Otherwise, you will need to try
-to initialize the device with an external program,
-e.g. xawtv, spcaview, and hope they persist when x11vnc
-re-opens the device.
-.IP
-<settings> is a comma separated list of key=value pairs.
-The device's brightness, color, contrast, and hue can
-be set to percentages, e.g. br=80,co=50,cn=44,hu=60.
-.IP
-The device filename can be set too if needed (if it
-does not start with "video"), e.g. fn=/dev/qcam.
-.IP
-The width, height and bpp of the framebuffer can be
-set via, e.g., w=160,h=120,bpp=16.
-.IP
-Related to the bpp above, the pixel format can be set
-via the fmt=XXX, where XXX can be one of: GREY, HI240,
-RGB555, RGB565, RGB24, and RGB32 (with bpp 8, 8, 16, 16,
-24, and 32 respectively).  See http://www.linuxtv.org
-for more info (V4L api).
-.IP
-For TV/rf tuner cards one can set the tuning mode
-via tun=XXX where XXX can be one of PAL, NTSC, SECAM,
-or AUTO.
-.IP
-One can switch the input channel by the inp=XXX setting,
-where XXX is the name of the input channel (Television,
-Composite1, S-Video, etc).  Use the name that is in the
-information about the device that is printed at startup.
-.IP
-For input channels with tuners (e.g. Television) one
-can change which station is selected by the sta=XXX
-setting.  XXX is the station number.  Currently only
-the ntsc-cable-us (US cable) channels are built into
-x11vnc.  See the \fB-freqtab\fR option below to supply one
-from xawtv. If XXX is greater than 500, then it is
-interpreted as a raw frequency in KHz.
-.IP
-Example:
-.IP
-\fB-rawfb\fR video:br=80,w=320,h=240,fmt=RGB32,tun=NTSC,sta=47
-.IP
-one might need to add inp=Television too for the input
-channel to be TV if the card doesn't come up by default
-in that one.
-.IP
-Note that not all video capture devices will support
-all of the above settings.
-.IP
-See the \fB-pipeinput\fR VID option below for a way to control
-the settings through the VNC Viewer via keystrokes.
-As a shortcut, if the string begins "Video.." instead
-of "video.." then \fB-pipeinput\fR VID is implied.
-.IP
-As above, if you specify a "@WxHxB..." after the
-<settings> string they are used verbatim: the device
-is not queried for the current values.  Otherwise the
-device will be queried.
-.IP
-LINUX CONSOLE:  The following describes some ways to
-view and possibly interact with the Linux text/graphics
-console (i.e. not X11 XFree86/Xorg)
-.IP
-Note: If the LibVNCServer LinuxVNC program is on your
-system you may want to use that instead of the following
-method because it will be faster and more accurate
-for the Linux text console and includes mouse support.
-There is, however, the basic LinuxVNC functionality in
-x11vnc if you replace "console" with "vt" in the
-examples below.
-.IP
-If the rawfb string begins with "console" the
-framebuffer device /dev/fb0 is opened and /dev/tty0 is
-opened too.  The latter is used to inject keystrokes
-(not all are supported, but the basic ones are).
-You will need to be root to inject keystrokes, but
-not necessarily to open /dev/fb0.  /dev/tty0 refers to
-the active VT, to indicate one explicitly, use, e.g.,
-"console2" for /dev/tty2, etc. by indicating the
-specific VT number.
-.IP
-For the Linux framebuffer device, /dev/fb0, (fb1,
-etc) to be enabled the appropriate kernel drivers must
-be loaded.  E.g. vesafb or vga16fb and also by setting
-the boot parameter vga=0x301 (or 0x314, 0x317, etc.)
-(The vga=... method is the preferred way; set your
-machines up that way.)  Otherwise there will be a
-\'No such device' error.  You can also load a Linux
-framebuffer driver specific to your make of video card
-for more functionality.  Once the machine is booted one
-can often 'modprobe' the fb driver as root to obtain
-a framebuffer device.
-.IP
-If you cannot get /dev/fb0 working on Linux, try
-using the LinuxVNC emulation mode by "\fB-rawfb\fR \fIvtN\fR"
-where N = 1, ... 6 is the Linux Virtual Terminal (aka
-virtual console) you wish to view, e.g. "\fB-rawfb\fR \fIvt2\fR".
-Unlike /dev/fb mode, it need not be the active Virtual
-Terminal.  Note that this mode can only show text and
-not graphics.  x11vnc polls the text in /dev/vcsaN
-.IP
-Set the env. var. RAWFB_VCSA_BW=1 to disable colors in
-the "vtN" mode (i.e. black and white only.)  If you
-do not prefer the default 16bpp set RAWFB_VCSA_BPP to
-8 or 32.  If you need to tweak the rawfb parameters by
-using the 'console_guess' string printed at startup,
-be sure to indicate the snap: method.
-.IP
-uinput: If the Linux version appears to be 2.6
-or later and the "uinput" module appears to be
-present (modprobe uinput), then the uinput method
-will be used instead of /dev/ttyN.  uinput allows
-insertion of BOTH keystrokes and mouse input and so it
-preferred when accessing graphical (e.g. QT-embedded)
-linux console apps.  It also provides more accurate
-keystroke insertion.  See \fB-pipeinput\fR UINPUT below for
-more information on this mode; you will have to use
-\fB-pipeinput\fR if you want to tweak any UINPUT parameters.
-You may also want to also use the \fB-nodragging\fR and
-\fB-cursor\fR none options.  Use "console0", etc  or
-\fB-pipeinput\fR CONSOLE to force the /dev/ttyN method.
-.IP
-Note you can change the Linux VT remotely using the
-.IR chvt (1)
-command to make the one you want be the active
-one (e.g. 'chvt 3').  Sometimes switching out and back
-corrects the framebuffer's graphics state.  For the
-"\fB-rawfb\fR \fIvtN\fR" mode there is no need to switch the VT's.
-.IP
-To skip input injecting entirely use "consolex"
-or "vtx".
-.IP
-The string "/dev/fb0" (1, etc.) can be used instead
-of "console".  This can be used to specify a different
-framebuffer device, e.g. /dev/fb1.  As a shortcut the
-"/dev/" can be dropped.  If the name is something
-nonstandard, use "console:/dev/foofb"
-.IP
-If you do not want x11vnc to guess the framebuffer's
-WxHxB and masks automatically (sometimes the kernel
-gives incorrect information), specify them with a @WxHxB
-(and optional :R/G/B masks) at the end of the string.
-.IP
-Examples:
-\fB-rawfb\fR console
-\fB-rawfb\fR /dev/fb0           (same)
-\fB-rawfb\fR console3           (force /dev/tty3)
-\fB-rawfb\fR consolex           (no keystrokes or mouse)
-\fB-rawfb\fR console:/dev/nonstd
-\fB-rawfb\fR console \fB-pipeinput\fR UINPUT:accel=4.0
-\fB-rawfb\fR vt3                (/dev/tty3 w/o /dev/fb0)
-.IP
-VNC HOST: if the \fB-rawfb\fR string is of the form
-"vnc:host:N" then the VNC display "N" on the remote
-VNC server "host" is connected to (i.e. x11vnc acts as
-a VNC client itself) and that framebuffer is exported.
-.IP
-This mode is really only of use if you are trying
-to improve performance in the case of many (e.g. >
-10) simultaneous VNC viewers, and you try a divide
-and conquer scheme to reduce bandwidth and improve
-responsiveness.  (However, another user found this mode
-useful to export a demo display through a slow link:
-then multiple demo viewers connected to the reflecting
-x11vnc on the fast side of the link, and so avoided
-all of the demo viewers going through the slow link.)
-.IP
-For example, if there will be 64 simultaneous VNC
-viewers this can lead to a lot of redundant VNC traffic
-to and from the server host:N, extra CPU usage,
-and all viewers response can be reduced by having
-to wait for writes to the slowest client to finish.
-However, if you set up 8 reflectors/repeaters started
-with option \fB-rawfb\fR vnc:host:N, then there are only
-8 connections to host:N.  Each repeater then handles
-8 vnc viewer connections thereby spreading the load
-around.  In classroom broadcast usage, try to put the
-repeaters on different switches.  This mode is the same
-as \fB-reflect\fR host:N.  Replace "host:N" by "listen"
-or "listen:port" for a reverse connection.
-.IP
-Overall performance will not be as good as a single
-direct connection because, among other things,
-there is an additional level of framebuffer polling
-and pointer motion can still induce many changes per
-second that must be propagated.  Tip: if the remote VNC
-is x11vnc doing wireframing, or an X display that does
-wireframing that gives much better response than opaque
-window dragging.  Consider the \fB-nodragging\fR option if
-the problem is severe.
-.IP
-The env. var. X11VNC_REFLECT_PASSWORD can be set to
-the password needed to log into the vnc host server, or
-to "file:path_to_file" to indicate a file containing
-the password as its first line.
-.IP
-To set the pixel format that x11vnc requests as a VNC
-CLIENT set the env. vars: X11VNC_REFLECT_bitsPerSample
-X11VNC_REFLECT_samplesPerPixel, and
-X11VNC_REFLECT_bytesPerPixel; the defaults are 8, 3, 4.
-2, 3, 1 would give a low color mode.  See the function
-rfbGetClient() in libvncclient for more info.
-.IP
-The VNC HOST mode implies \fB-shared.\fR  Use \fB-noshared\fR as
-a subsequent cmdline option to disable sharing.
-.PP
-\fB-freqtab\fR \fIfile\fR
-.IP
-For use with "\fB-rawfb\fR \fIvideo\fR" for TV tuner devices to
-specify station frequencies.  Instead of using the built
-in ntsc-cable-us mapping of station number to frequency,
-use the data in file.  For stations that are not
-numeric, e.g. SE20, they are placed above the highest
-numbered station in the order they are found.  Example:
-"\fB-freqtab\fR \fI/usr/X11R6/share/xawtv/europe-west.list\fR"
-You can make your own freqtab by copying the xawtv
-format.
-.PP
-\fB-pipeinput\fR \fIcmd\fR
-.IP
-This option lets you supply an external command in
-\fIcmd\fR that x11vnc will pipe all of the user input
-events to in a simple format.  In \fB-pipeinput\fR mode by
-default x11vnc will not process any of the user input
-events.  If you prefix \fIcmd\fR with "tee:" it will
-both send them to the pipe command and process them.
-For a description of the format run "-pipeinput
-tee:/bin/cat".  Another prefix is "reopen" which
-means to reopen pipe if it exits.  Separate multiple
-prefixes with commas.
-.IP
-In combination with \fB-rawfb\fR one might be able to
-do amusing things (e.g. control non-X devices).
-To facilitate this, if \fB-rawfb\fR is in effect then the
-value is stored in X11VNC_RAWFB_STR for the pipe command
-to use if it wants. Do 'env | grep X11VNC' for more.
-.IP
-Built-in pipeinput modes (no external program required):
-.IP
-If cmd is "VID" and you are using the \fB-rawfb\fR for a
-video capture device, then an internal list of keyboard
-mappings is used to set parameters of the video.
-The mappings are:
-.IP
-"B" and "b" adjust the brightness up and down.
-"H" and "h" adjust the hue.
-"C" and "c" adjust the colour.
-"N" and "n" adjust the contrast.
-"S" and "s" adjust the size of the capture screen.
-"I" and "i" cycle through input channels.
-Up and Down arrows adjust the station (if a tuner)
-F1, F2, ..., F6 will switch the video capture pixel
-format to HI240, RGB565, RGB24, RGB32, RGB555, and
-GREY respectively.  See \fB-rawfb\fR video for details.
-.IP
-If cmd is "CONSOLE" or "CONSOLEn" where n
-is a Linux console number, then the linux console
-keystroke insertion to /dev/ttyN (see \fB-rawfb\fR console)
-is performed.
-.IP
-If cmd begins with "UINPUT" then the Linux uinput
-module is used to insert both keystroke and mouse events
-to the Linux console (see \fB-rawfb\fR above).  This usually
-is the /dev/input/uinput device file (you may need to
-create it with "mknod /dev/input/uinput c 10 223"
-and insert the module with "modprobe uinput".
-.IP
-The UINPUT mode currently only does US keyboards (a
-scan code option may be added), and not all keysyms
-are supported.  But it is probably more accurate than
-the "CONSOLE" method.
-.IP
-You may want to use the options \fB-cursor\fR none and
-\fB-nodragging\fR in this mode.
-.IP
-Additional tuning options may be supplied via:
-UINPUT:opt1,opt2,... (a comma separated list). If an
-option begins with "/" it is taken as the uinput
-device file.
-.IP
-Which uinput is injected can be controlled by an option
-string made of the characters "K", "M", and "B"
-(see the \fB-input\fR option), e.g. "KM" allows keystroke
-and motion but not button clicks.
-.IP
-A UINPUT option of the form: accel=f, or accel=fx+fy
-sets the mouse motion "acceleration".  This is used
-to correct raw mouse relative motion into how much the
-application cursor moves (x11vnc has no control over,
-or knowledge of how the windowing application interprets
-the raw mouse motions).  Typically the acceleration
-for an X display is 2 (see xset "m" option).  "f"
-is a floating point number, e.g. 3.0.  Use "fx+fy"
-if you need to supply different corrections for x and y.
-.IP
-Note: the default acceleration is 2.0 since it seems
-both X and qt-embedded often (but not always) use
-this value.
-.IP
-Even with a correct accel setting the mouse position
-will get out of sync (probably due to a mouse
-"threshold" setting where the acceleration doe not
-apply, set 
-.IR xset (1)
-).  The option reset=N sets the
-number of ms (default 150) after which the cursor is
-attempted to be reset (by forcing the mouse to (0,
-0) via small increments and then back out to (x, y)
-in 1 jump), This correction seems to be needed but can
-cause jerkiness or unexpected behavior with menus, etc.
-Use reset=0 to disable.
-.IP
-If you set the env. var X11VNC_UINPUT_THRESHOLDS then
-the thresh=n mode will be enabled.  It is currently
-not working well.  If |dx| <= thresh and |dy| < thresh
-no acceleration is applied.  Use "thresh=+n" |dx| +
-|dy| < thresh to be used instead (X11?)
-.IP
-Example:
-\fB-pipeinput\fR UINPUT:accel=4.0 \fB-cursor\fR none
-.IP
-If the uinput device has an absolute pointer (as opposed
-to a normal mouse that is a relative pointer) you can
-specify the option "abs".  Note that a touchpad
-on a laptop is an absolute device to some degree.
-This (usually) avoids all the problems with mouse
-acceleration.  If x11vnc has trouble deducing the
-size of the device, use "abs=WxH".  Furthermore,
-if the device is a touchscreen (assumed to have an
-absolute pointer) use "touch" or "touch=WxH".
-For touchscreens, when a mouse button is pressed,
-a pressure increase is injected, and when the button
-is released a pressure of zero is injected.
-.IP
-If touch has been set, use "touch_always=1" to
-indicate whenever the mouse moves with no button
-pressed, a touch event of zero pressure should be
-sent anyway.  Also use "btn_touch=1" to indicate a
-BTN_TOUCH keystroke press or release should be sent
-instead of a pressure change.  Set "dragskip=n" to
-skip n dragged mouse touches (with pressure applied)
-before injecting one.  To indicate the pressure that
-should be sent when there is a button click for a
-touchscreen device, specify pressure=n, e.g. n=5. The
-default is n=1.
-.IP
-If a touch screen is being used ("touch" above)
-and it is having its input processed by tslib, you can
-specify the tslib calibration file via tslib_cal=<file>.
-For example, tslib_cal=/etc/pointercal.  To get accurate
-or even usable positioning this is required when tslib
-is in use.
-.IP
-The Linux uinput mechanism can be bypassed and one can
-write input events DIRECTLY to the devices instead.
-To do this, specify one or more of the following
-for the input classes: direct_rel=<device>
-direct_abs=<device> direct_btn=<device> or
-direct_key=<device>.  The <device> file is usually
-something like /dev/input/event1 but you can specify
-any device file or pipe.  You must specify each one
-of the above classes even if they correspond to the
-same device file (rel/abs and btn are often the same.)
-Look at the file /proc/bus/input/devices to get an idea
-what is available and the device filenames.  Note:
-The /dev/input/mouse* devices do not seem to work,
-use the corresponding /dev/input/event* file instead.
-Any input class not directly specified as above will be
-handled via the uinput mechanism.  To disable creating a
-uinput device (and thereby discarding unhandled input),
-specify "nouinput".
-.IP
-Examples:
-.IP
-\fB-pipeinput\fR UINPUT:direct_abs=/dev/input/event1
-.IP
-this was used on a qtmoko Neo freerunner (armel):
-.IP
-\fB-pipeinput\fR UINPUT:touch,tslib_cal=/etc/pointercal,
-direct_abs=/dev/input/event1,nouinput,dragskip=4
-.IP
-(where the long line has been split into two.)
-.IP
-You can set the env. var X11VNC_UINPUT_DEBUG=1 or higher
-to get debugging output for UINPUT mode.
-.PP
-\fB-macnodim\fR
-.IP
-For the native MacOSX server, disable dimming.
-.PP
-\fB-macnosleep\fR
-.IP
-For the native MacOSX server, disable display sleep.
-.PP
-\fB-macnosaver\fR
-.IP
-For the native MacOSX server, disable screensaver.
-.PP
-\fB-macnowait\fR
-.IP
-For the native MacOSX server, do not wait for the
-user to switch back to his display.
-.PP
-\fB-macwheel\fR \fIn\fR
-.IP
-For the native MacOSX server, set the mouse wheel
-speed to n (default 5).
-.PP
-\fB-macnoswap\fR
-.IP
-For the native MacOSX server, do not swap mouse
-buttons 2 and 3.
-.PP
-\fB-macnoresize\fR
-.IP
-For the native MacOSX server, do not resize or reset
-the framebuffer even if it is detected that the screen
-resolution or depth has changed.
-.PP
-\fB-maciconanim\fR \fIn\fR
-.IP
-For the native MacOSX server, set n to the number
-of milliseconds that the window iconify/deiconify
-animation takes.  In \fB-ncache\fR mode this value will be
-used to skip the animation if possible. (default 400)
-.PP
-\fB-macmenu\fR
-.IP
-For the native MacOSX server, in \fB-ncache\fR client-side
-caching mode, try to cache pull down menus (not perfect
-because they have animated fades, etc.)
-.PP
-\fB-macuskbd\fR
-.IP
-For the native MacOSX server, use the original
-keystroke insertion code based on a US keyboard.
-.PP
-\fB-macnoopengl\fR
-.IP
-For the native MacOSX server, do not use OpenGL for
-screen capture, but rather use the original, deprecated
-raw memory access method: addr = CGDisplayBaseAddress().
-.PP
-\fB-macnorawfb\fR
-.IP
-For the native MacOSX server, disable the raw memory
-address screen capture method.
-.IP
-MACOSX NOTE: There are some deprecated MacOSX interfaces
-to inject keyboard and mouse events and the raw memory
-access method is deprecated as well (however, OpenGL
-will be preferred if available because it is faster.)
-One can force not using any deprecated interfaces at
-compile time by setting \fB-DX11VNC_MACOSX_NO_DEPRECATED=1\fR
-in CPPFLAGS.  Or to turn them off one by one:
-\fB-DX11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1,\fR
-\fB-DX11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1\fR or
-\fB-DX11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1\fR
-At run time, for testing and workarounds, one can
-disable them by using:
-\fB-env\fR X11VNC_MACOSX_NO_DEPRECATED=1
-\fB-env\fR X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1
-\fB-env\fR X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or
-\fB-env\fR X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1
-Note: When doing either of these for the mouse input
-not everything works currently, e.g. double clicks and
-wireframing.  Also, screen resolution and pixel depth
-changes will not be automatically detected unless the
-deprecated framebuffer interfaces are allowed.
-.IP
-Conversely, if you are compiling on an
-older machine that does not have some of
-the newer interfaces, you may need to specify
-\fB-DX11VNC_MACOSX_NO_CGEVENTCREATESCROLLWHEELEVENT\fR
-\fB-DX11VNC_MACOSX_NO_CGEVENTCREATEMOUSEEVENT\fR or
-\fB-DX11VNC_MACOSX_NO_CGEVENTCREATEKEYBOARDEVENT.\fR  Use
-\fB-DX11VNC_MACOSX_USE_GETMAINDEVICE\fR to regain the very
-old QuickDraw GetMainDevice() interface (rare...)
-.PP
-\fB-gui\fR \fI[gui-opts]\fR
-.IP
-Start up a simple tcl/tk gui based on the remote
-control options \fB-remote/-query\fR described below.
-Requires the "wish" program to be installed on the
-machine.  "gui-opts" is not required: the default
-is to start up both the full gui and x11vnc with the
-gui showing up on the X display in the environment
-variable DISPLAY.
-.IP
-"gui-opts" can be a comma separated list of items.
-Currently there are these types of items: 1) a gui
-mode, a 2) gui "simplicity", 3) the X display the
-gui should display on, 4) a "tray" or "icon" mode,
-and 5) a gui geometry.
-.IP
-1) The gui mode can be "start", "conn", or "wait"
-"start" is the default mode above and is not required.
-"conn" means do not automatically start up x11vnc,
-but instead just try to connect to an existing x11vnc
-process.  "wait" means just start the gui and nothing
-else (you will later instruct the gui to start x11vnc
-or connect to an existing one.)
-.IP
-2) The gui simplicity is off by default (a power-user
-gui with all options is presented) To start with
-something less daunting supply the string "simple"
-("ez" is an alias for this).  Once the gui is
-started you can toggle between the two with "Misc ->
-simple_gui".
-.IP
-3) Note the possible confusion regarding the potentially
-two different X displays: x11vnc polls one, but you
-may want the gui to appear on another.  For example, if
-you ssh in and x11vnc is not running yet you may want
-the gui to come back to you via your ssh redirected X
-display (e.g. localhost:10).
-.IP
-If you do not specify a gui X display in "gui-opts"
-then the DISPLAY environment variable and \fB-display\fR
-option are tried (in that order).  Regarding the x11vnc
-X display the gui will try to communication with, it
-first tries \fB-display\fR and then DISPLAY.  For example,
-"x11vnc \fB-display\fR :0 \fB-gui\fR otherhost:0", will remote
-control an x11vnc polling :0 and display the gui on
-otherhost:0 The "tray/icon" mode below reverses this
-preference, preferring to display on the x11vnc display.
-.IP
-4) When "tray" or "icon" is specified, the gui
-presents itself as a small icon with behavior typical
-of a "system tray" or "dock applet".  The color
-of the icon indicates status (connected clients) and
-there is also a balloon status.  Clicking on the icon
-gives a menu from which properties, etc, can be set and
-the full gui is available under "Advanced".  To be
-fully functional, the gui mode should be "start"
-(the default).
-.IP
-Note that tray or icon mode will imply the \fB-forever\fR
-x11vnc option (if the x11vnc server is started along
-with the gui) unless \fB-connect\fR or \fB-connect_or_exit\fR has
-been specified.  So x11vnc (and the tray/icon gui)
-will wait for more connections after the first client
-disconnects.  If you want only one viewer connection
-include the \fB-once\fR option.
-.IP
-For "icon" the gui just a small standalone window.
-For "tray" it will attempt to embed itself in the
-"system tray" if possible. If "=setpass" is appended then
-at startup the X11 user will be prompted to set the
-VNC session password.  If =<hexnumber> is appended
-that icon will attempt to embed itself in the window
-given by hexnumber.  Use =noadvanced to disable the
-full gui. (To supply more than one, use "+" sign).
-E.g. \fB-gui\fR tray=setpass and \fB-gui\fR icon=0x3600028
-.IP
-Other modes: "full", the default and need not be
-specified.  "\fB-gui\fR \fInone\fR", do not show a gui, useful
-to override a ~/.x11vncrc setting, etc.
-.IP
-5) When "geom=+X+Y" is specified, that geometry
-is passed to the gui toplevel.  This is the icon in
-icon/tray mode, or the full gui otherwise.  You can
-also specify width and height, i.e. WxH+X+Y, but it
-is not recommended.  In "tray" mode the geometry is
-ignored unless the system tray manager does not seem
-to be running.  One could imagine using something like
-"\fB-gui\fR \fItray,geom=+4000+4000\fR" with a display manager
-to keep the gui invisible until someone logs in...
-.IP
-More icon tricks, "icon=minimal" gives an icon just
-with the VNC display number.  You can also set the font
-with "iconfont=...".  The following could be useful:
-"\fB-gui\fR \fIicon=minimal,iconfont=5x8,geom=24x10+0-0\fR"
-.IP
-General examples of the \fB-gui\fR option: "x11vnc \fB-gui",\fR
-"x11vnc \fB-gui\fR ez" "x11vnc \fB-gui\fR localhost:10",
-"x11vnc \fB-gui\fR conn,host:0", "x11vnc \fB-gui\fR tray,ez"
-"x11vnc \fB-gui\fR tray=setpass"
-.IP
-If you do not intend to start x11vnc from the gui
-(i.e. just remote control an existing one), then the
-gui process can run on a different machine from the
-x11vnc server as long as X permissions, etc. permit
-communication between the two.
-.IP
-FONTS: On some systems the tk fonts can be too small,
-jagged, or otherwise unreadable.  There are 4 env vars
-you can set to be the tk font you prefer:
-.IP
-X11VNC_FONT_BOLD   main font for menus and buttons.
-X11VNC_FONT_FIXED  font for fixed width text.
-.IP
-X11VNC_FONT_BOLD_SMALL  tray icon font.
-X11VNC_FONT_REG_SMALL   tray icon menu font.
-.IP
-The last two only apply for the tray icon mode.
-.IP
-Here are some examples:
-.IP
-\fB-env\fR X11VNC_FONT_BOLD='Helvetica \fB-16\fR bold'
-\fB-env\fR X11VNC_FONT_FIXED='Courier \fB-14'\fR
-\fB-env\fR X11VNC_FONT_REG_SMALL='Helvetica \fB-12'\fR
-.IP
-You can put the lines like the above (without the
-quotes) in your ~/.x11vncrc file to avoid having to
-specify them on the x11vnc command line.
-.PP
-\fB-remote\fR \fIcommand\fR
-.IP
-Remotely control some aspects of an already running
-x11vnc server.  "\fB-R\fR" and "\fB-r\fR" are aliases for
-"\fB-remote\fR".  After the remote control command is
-sent to the running server the 'x11vnc \fB-remote\fR ...'
-x11vnc command exits.  You can often use the \fB-query\fR
-command (see below) to see if the x11vnc server
-processed your \fB-remote\fR command.
-.IP
-The default communication channel is that of X
-properties (specifically X11VNC_REMOTE), and so this
-command must be run with correct settings for DISPLAY
-and possibly XAUTHORITY to connect to the X server
-and set the property.  Alternatively, use the \fB-display\fR
-and \fB-auth\fR options to set them to the correct values.
-The running server cannot use the \fB-novncconnect\fR option
-because that disables the communication channel.
-See below for alternate channels.
-.IP
-For example: 'x11vnc \fB-remote\fR stop' (which is the same as
-\'x11vnc \fB-R\fR stop') will close down the x11vnc server.
-\'x11vnc \fB-R\fR shared' will enable shared connections, and
-\'x11vnc \fB-R\fR scale:3/4' will rescale the desktop.
-.IP
-To use a different name for the X11 property (e.g. to
-have separate communication channels for multiple
-x11vnc's on the same display) set the X11VNC_REMOTE
-environment variable to the string you want, for
-example: \fB-env\fR X11VNC_REMOTE=X11VNC_REMOTE_12345
-Both sides of the channel must use the same unique name.
-.IP
-To run a bunch of commands in a sequence use something
-like: x11vnc \fB-R\fR 'script:firstcmd;secondcmd;...'
-.IP
-Use x11vnc \fB-R\fR script:file=/path/to/file to read commands
-from a file (can be multi-line and use the comment '#'
-character in the normal way.  The ';' separator must
-still be used to separate each command.)
-.IP
-To not try to contact another x11vnc process and instead
-just run the command (or query) directly, prefix the
-command with the string "DIRECT:"
-.IP
-.IP
-The following \fB-remote/-R\fR commands are supported:
-.IP
-stop            terminate the server, same as "quit"
-"exit" or "shutdown".
-.IP
-ping            see if the x11vnc server responds.
-return is: ans=ping:<display>
-.IP
-ping:mystring   as above, but use your own unique string.
-return is: ans=ping:mystring:<xdisplay>
-.IP
-blacken         try to push a black fb update to all
-clients (due to timings a client
-could miss it). Same as "zero", also
-"zero:x1,y1,x2,y2" for a rectangle.
-.IP
-refresh         send the entire fb to all clients.
-.IP
-reset           recreate the fb, polling memory, etc.
-.IP
-id:windowid     set \fB-id\fR window to "windowid". empty
-or "root" to go back to root window
-.IP
-sid:windowid    set \fB-sid\fR window to "windowid"
-.IP
-id_cmd:cmd      cmds: raise, lower, map, unmap, iconify,
-move:dXdY, resize:dWdH, geom:WxH+X+Y. dX
-dY, dW, and dH must have a leading "+"
-or "-" e.g.: move:-30+10 resize:+20+35
-also: wm_delete, wm_name:string and
-icon_name:string. Also id_cmd:win=N:cmd
-.IP
-waitmapped      wait until subwin is mapped.
-.IP
-nowaitmapped    do not wait until subwin is mapped.
-.IP
-clip:WxH+X+Y    set \fB-clip\fR mode to "WxH+X+Y"
-.IP
-flashcmap       enable  \fB-flashcmap\fR mode.
-.IP
-noflashcmap     disable \fB-flashcmap\fR mode.
-.IP
-shiftcmap:n     set \fB-shiftcmap\fR to n.
-.IP
-notruecolor     enable  \fB-notruecolor\fR mode.
-.IP
-truecolor       disable \fB-notruecolor\fR mode.
-.IP
-overlay         enable  \fB-overlay\fR mode (if applicable).
-.IP
-nooverlay       disable \fB-overlay\fR mode.
-.IP
-overlay_cursor  in \fB-overlay\fR mode, enable cursor drawing.
-.IP
-overlay_nocursor disable cursor drawing. same as
-nooverlay_cursor.
-.IP
-8to24           enable  \fB-8to24\fR mode (if applicable).
-.IP
-no8to24         disable \fB-8to24\fR mode.
-.IP
-8to24_opts:str  set the \fB-8to24\fR opts to "str".
-.IP
-24to32          enable  \fB-24to32\fR mode (if applicable).
-.IP
-no24to32        disable \fB-24to32\fR mode.
-.IP
-visual:vis      set \fB-visual\fR to "vis"
-.IP
-scale:frac      set \fB-scale\fR to "frac"
-.IP
-scale_cursor:f  set \fB-scale_cursor\fR to "f"
-.IP
-viewonly        enable  \fB-viewonly\fR mode.
-.IP
-noviewonly      disable \fB-viewonly\fR mode.
-.IP
-shared          enable  \fB-shared\fR mode.
-.IP
-noshared        disable \fB-shared\fR mode.
-.IP
-forever         enable  \fB-forever\fR mode.
-.IP
-noforever       disable \fB-forever\fR mode.
-.IP
-timeout:n       reset \fB-timeout\fR to n, if there are
-currently no clients, exit unless one
-connects in the next n secs.
-.IP
-tightfilexfer   enable  filetransfer for NEW clients.
-.IP
-notightfilexfer disable filetransfer for NEW clients.
-.IP
-ultrafilexfer   enable  filetransfer for clients.
-.IP
-noultrafilexfer disable filetransfer for clients.
-.IP
-rfbversion:n.m  set \fB-rfbversion\fR for new clients.
-.IP
-http            enable  http client connections.
-.IP
-nohttp          disable http client connections.
-.IP
-deny            deny any new connections, same as "lock"
-.IP
-nodeny          allow new connections, same as "unlock"
-.IP
-avahi           enable  avahi service advertising.
-.IP
-noavahi         disable avahi service advertising.
-.IP
-mdns            enable  avahi service advertising.
-.IP
-nomdns          disable avahi service advertising.
-.IP
-zeroconf        enable  avahi service advertising.
-.IP
-nozeroconf      disable avahi service advertising.
-.IP
-connect:host    do reverse connection to host, "host"
-may be a comma separated list of hosts
-or host:ports.  See \fB-connect.\fR  Passwords
-required as with fwd connections.
-See X11VNC_REVERSE_CONNECTION_NO_AUTH=1
-.IP
-disconnect:host disconnect any clients from "host"
-same as "close:host".  Use host
-"all" to close all current clients.
-If you know the client internal hex ID,
-e.g. 0x3 (returned by "\fB-query\fR \fIclients\fR"
-and RFB_CLIENT_ID) you can use that too.
-.IP
-proxy:host:port set reverse connection proxy (empty to
-disable).
-.IP
-allowonce:host  For the next connection only, allow
-connection from "host". In \fB-ssl\fR mode
-two connections are allowed (i.e. Fetch
-Cert) unless X11VNC_NO_SSL_ALLOW_TWICE=1
-.IP
-allow:hostlist  set \fB-allow\fR list to (comma separated)
-"hostlist". See \fB-allow\fR and \fB-localhost.\fR
-Do not use with \fB-allow\fR /path/to/file
-Use "+host" to add a single host, and
-use "\fB-host\fR" to delete a single host
-.IP
-localhost       enable  \fB-localhost\fR mode
-.IP
-nolocalhost     disable \fB-localhost\fR mode
-.IP
-listen:str      set \fB-listen\fR to str, empty to disable.
-.IP
-noipv6          enable  \fB-noipv6\fR mode.
-.IP
-ipv6            disable \fB-noipv6\fR mode.
-.IP
-noipv4          enable  \fB-noipv4\fR mode.
-.IP
-ipv4            disable \fB-noipv4\fR mode.
-.IP
-6               enable  -6 IPv6 listening mode.
-.IP
-no6             disable -6 IPv6 listening mode.
-.IP
-lookup          disable \fB-nolookup\fR mode.
-.IP
-nolookup        enable  \fB-nolookup\fR mode.
-.IP
-lookup          disable \fB-nolookup\fR mode.
-.IP
-input:str       set \fB-input\fR to "str", empty to disable.
-.IP
-grabkbd         enable  \fB-grabkbd\fR mode.
-.IP
-nograbkbd       disable \fB-grabkbd\fR mode.
-.IP
-grabptr         enable  \fB-grabptr\fR mode.
-.IP
-nograbptr       disable \fB-grabptr\fR mode.
-.IP
-grabalways      enable  \fB-grabalways\fR mode.
-.IP
-nograbalways    disable \fB-grabalways\fR mode.
-.IP
-grablocal:n     set \fB-grablocal\fR to n.
-.IP
-client_input:str set the K, M, B \fB-input\fR on a per-client
-basis.  select which client as for
-disconnect, e.g. client_input:host:MB
-or client_input:0x2:K
-.IP
-accept:cmd      set \fB-accept\fR "cmd" (empty to disable).
-.IP
-afteraccept:cmd set \fB-afteraccept\fR (empty to disable).
-.IP
-gone:cmd        set \fB-gone\fR "cmd" (empty to disable).
-.IP
-noshm           enable  \fB-noshm\fR mode.
-.IP
-shm             disable \fB-noshm\fR mode (i.e. use shm).
-.IP
-flipbyteorder   enable \fB-flipbyteorder\fR mode, you may need
-to set noshm for this to do something.
-.IP
-noflipbyteorder disable \fB-flipbyteorder\fR mode.
-.IP
-onetile         enable  \fB-onetile\fR mode. (you may need to
-set shm for this to do something)
-.IP
-noonetile       disable \fB-onetile\fR mode.
-.IP
-solid           enable  \fB-solid\fR mode
-.IP
-nosolid         disable \fB-solid\fR mode.
-.IP
-solid_color:color set \fB-solid\fR color (and apply it).
-.IP
-blackout:str    set \fB-blackout\fR "str" (empty to disable).
-See \fB-blackout\fR for the form of "str"
-(basically: WxH+X+Y,...)
-Use "+WxH+X+Y" to append a single
-rectangle use "-WxH+X+Y" to delete one
-.IP
-xinerama        enable  \fB-xinerama\fR mode. (if applicable)
-.IP
-noxinerama      disable \fB-xinerama\fR mode.
-.IP
-xtrap           enable  \fB-xtrap\fR input mode(if applicable)
-.IP
-noxtrap         disable \fB-xtrap\fR input mode.
-.IP
-xrandr          enable  \fB-xrandr\fR mode. (if applicable)
-.IP
-noxrandr        disable \fB-xrandr\fR mode.
-.IP
-xrandr_mode:mode set the \fB-xrandr\fR mode to "mode".
-.IP
-rotate:mode     set the \fB-rotate\fR mode to "mode".
-.IP
-padgeom:WxH     set \fB-padgeom\fR to WxH (empty to disable)
-If WxH is "force" or "do" the padded
-geometry fb is immediately applied.
-.IP
-quiet           enable  \fB-quiet\fR mode.
-.IP
-noquiet         disable \fB-quiet\fR mode.
-.IP
-modtweak        enable  \fB-modtweak\fR mode.
-.IP
-nomodtweak      enable  \fB-nomodtweak\fR mode.
-.IP
-xkb             enable  \fB-xkb\fR modtweak mode.
-.IP
-noxkb           disable \fB-xkb\fR modtweak mode.
-.IP
-capslock        enable  \fB-capslock\fR mode.
-.IP
-nocapslock      disable \fB-capslock\fR mode.
-.IP
-skip_lockkeys   enable  \fB-skip_lockkeys\fR mode.
-.IP
-noskip_lockkeys disable \fB-skip_lockkeys\fR mode.
-.IP
-skip_keycodes:str enable \fB-xkb\fR \fB-skip_keycodes\fR "str".
-.IP
-sloppy_keys     enable  \fB-sloppy_keys\fR mode.
-.IP
-nosloppy_keys   disable \fB-sloppy_keys\fR mode.
-.IP
-skip_dups       enable  \fB-skip_dups\fR mode.
-.IP
-noskip_dups     disable \fB-skip_dups\fR mode.
-.IP
-add_keysyms     enable \fB-add_keysyms\fR mode.
-.IP
-noadd_keysyms   stop adding keysyms. those added will
-still be removed at exit.
-.IP
-clear_mods      enable  \fB-clear_mods\fR mode and clear them.
-.IP
-noclear_mods    disable \fB-clear_mods\fR mode.
-.IP
-clear_keys      enable  \fB-clear_keys\fR mode and clear them.
-.IP
-noclear_keys    disable \fB-clear_keys\fR mode.
-.IP
-clear_locks     do the clear_locks action.
-.IP
-clear_all       do the clear_all action.
-.IP
-keystate        have x11vnc print current keystate.
-.IP
-remap:str       set \fB-remap\fR "str" (empty to disable).
-See \fB-remap\fR for the form of "str"
-(basically: key1-key2,key3-key4,...)
-Use "+key1-key2" to append a single
-keymapping, use "-key1-key2" to delete.
-.IP
-norepeat        enable  \fB-norepeat\fR mode.
-.IP
-repeat          disable \fB-norepeat\fR mode.
-.IP
-nofb            enable  \fB-nofb\fR mode.
-.IP
-fb              disable \fB-nofb\fR mode.
-.IP
-bell            enable  bell (if supported).
-.IP
-nobell          disable bell.
-.IP
-sendbell        ring the bell now.
-.IP
-nosel           enable  \fB-nosel\fR mode.
-.IP
-sel             disable \fB-nosel\fR mode.
-.IP
-noprimary       enable  \fB-noprimary\fR mode.
-.IP
-primary         disable \fB-noprimary\fR mode.
-.IP
-nosetprimary    enable  \fB-nosetprimary\fR mode.
-.IP
-setprimary      disable \fB-nosetprimary\fR mode.
-.IP
-noclipboard     enable  \fB-noclipboard\fR mode.
-.IP
-clipboard       disable \fB-noclipboard\fR mode.
-.IP
-nosetclipboard  enable  \fB-nosetclipboard\fR mode.
-.IP
-setclipboard    disable \fB-nosetclipboard\fR mode.
-.IP
-seldir:str      set \fB-seldir\fR to "str"
-.IP
-resend_cutbuffer resend the most recent CUTBUFFER0 copy
-.IP
-resend_clipboard resend the most recent CLIPBOARD copy
-.IP
-resend_primary   resend the most recent PRIMARY copy
-.IP
-cursor:mode     enable  \fB-cursor\fR "mode".
-.IP
-show_cursor     enable  showing a cursor.
-.IP
-noshow_cursor   disable showing a cursor. (same as
-"nocursor")
-.IP
-cursor_drag     enable  cursor changes during drag.
-.IP
-nocursor_drag   disable cursor changes during drag.
-.IP
-arrow:n         set \fB-arrow\fR to alternate n.
-.IP
-xfixes          enable  xfixes cursor shape mode.
-.IP
-noxfixes        disable xfixes cursor shape mode.
-.IP
-alphacut:n      set \fB-alphacut\fR to n.
-.IP
-alphafrac:f     set \fB-alphafrac\fR to f.
-.IP
-alpharemove     enable  \fB-alpharemove\fR mode.
-.IP
-noalpharemove   disable \fB-alpharemove\fR mode.
-.IP
-alphablend      disable \fB-noalphablend\fR mode.
-.IP
-noalphablend    enable  \fB-noalphablend\fR mode.
-.IP
-cursorshape     disable \fB-nocursorshape\fR mode.
-.IP
-nocursorshape   enable  \fB-nocursorshape\fR mode.
-.IP
-cursorpos       disable \fB-nocursorpos\fR mode.
-.IP
-nocursorpos     enable  \fB-nocursorpos\fR mode.
-.IP
-xwarp           enable  \fB-xwarppointer\fR mode.
-.IP
-noxwarp         disable \fB-xwarppointer\fR mode.
-.IP
-always_inject   enable  \fB-always_inject\fR mode.
-.IP
-noalways_inject disable \fB-always_inject\fR mode.
-.IP
-buttonmap:str   set \fB-buttonmap\fR "str", empty to disable
-.IP
-dragging        disable \fB-nodragging\fR mode.
-.IP
-nodragging      enable  \fB-nodragging\fR mode.
-.IP
-ncache          reenable \fB-ncache\fR mode.
-.IP
-noncache        disable  \fB-ncache\fR mode.
-.IP
-ncache_size:n   set \fB-ncache\fR size to n.
-.IP
-ncache_cr       enable  \fB-ncache_cr\fR mode.
-.IP
-noncache_cr     disable \fB-ncache_cr\fR mode.
-.IP
-ncache_no_moveraise     enable  no_moveraise mode.
-.IP
-noncache_no_moveraise   disable no_moveraise mode.
-.IP
-ncache_no_dtchange      enable  ncache_no_dtchange mode.
-.IP
-noncache_no_dtchange    disable ncache_no_dtchange mode.
-.IP
-ncache_old_wm           enable  ncache_old_wm mode.
-.IP
-noncache_old_wm         disable ncache_old_wm mode.
-.IP
-ncache_no_rootpixmap    enable  ncache_no_rootpixmap.
-.IP
-noncache_no_rootpixmap  disable ncache_no_rootpixmap.
-.IP
-ncache_reset_rootpixmap recheck the root pixmap, ncrp
-.IP
-ncache_keep_anims       enable  ncache_keep_anims.
-.IP
-noncache_keep_anims     disable ncache_keep_anims.
-.IP
-ncache_pad:n    set \fB-ncache_pad\fR to n.
-.IP
-wireframe       enable  \fB-wireframe\fR mode. same as "wf"
-.IP
-nowireframe     disable \fB-wireframe\fR mode. same as "nowf"
-.IP
-wireframe:str   enable  \fB-wireframe\fR mode string.
-.IP
-wireframe_mode:str enable  \fB-wireframe\fR mode string.
-.IP
-wireframelocal  enable  wireframelocal. same as "wfl"
-.IP
-nowireframe     disable wireframelocal. same as "nowfl"
-.IP
-wirecopyrect:str set \fB-wirecopyrect\fR string. same as "wcr:"
-.IP
-scrollcopyrect:str set \fB-scrollcopyrect\fR string. same "scr"
-.IP
-noscrollcopyrect disable \fB-scrollcopyrect__mode_.\fR "noscr"
-.IP
-scr_area:n      set \fB-scr_area\fR to n
-.IP
-scr_skip:list   set \fB-scr_skip\fR to "list"
-.IP
-scr_inc:list    set \fB-scr_inc\fR to "list"
-.IP
-scr_keys:list   set \fB-scr_keys\fR to "list"
-.IP
-scr_term:list   set \fB-scr_term\fR to "list"
-.IP
-scr_keyrepeat:str set \fB-scr_keyrepeat\fR to "str"
-.IP
-scr_parms:str   set \fB-scr_parms\fR parameters.
-.IP
-fixscreen:str   set \fB-fixscreen\fR to "str".
-.IP
-noxrecord       disable all use of RECORD extension.
-.IP
-xrecord         enable  use of RECORD extension.
-.IP
-reset_record    reset RECORD extension (if avail.)
-.IP
-pointer_mode:n  set \fB-pointer_mode\fR to n. same as "pm"
-.IP
-input_skip:n    set \fB-input_skip\fR to n.
-.IP
-allinput        enable  use of \fB-allinput\fR mode.
-.IP
-noallinput      disable use of \fB-allinput\fR mode.
-.IP
-input_eagerly   enable  use of \fB-input_eagerly\fR mode.
-.IP
-noinput_eagerly disable use of \fB-input_eagerly\fR mode.
-.IP
-ssltimeout:n    set \fB-ssltimeout\fR to n.
-.IP
-speeds:str      set \fB-speeds\fR to str.
-.IP
-wmdt:str        set \fB-wmdt\fR to str.
-.IP
-debug_pointer   enable  \fB-debug_pointer,\fR same as "dp"
-.IP
-nodebug_pointer disable \fB-debug_pointer,\fR same as "nodp"
-.IP
-debug_keyboard   enable  \fB-debug_keyboard,\fR same as "dk"
-.IP
-nodebug_keyboard disable \fB-debug_keyboard,\fR same as "nodk"
-.IP
-keycode:n       inject keystroke 'keycode' (xmodmap \fB-pk)\fR
-.IP
-keycode:n,down  inject 'keycode' (down=0,1)
-.IP
-keysym:str      inject keystroke 'keysym' (number/name)
-.IP
-keysym:str,down inject 'keysym' (down=0,1)
-.IP
-ptr:x,y,mask    inject pointer event x, y, button-mask
-.IP
-fakebuttonevent:button,down direct XTestFakeButtonEvent.
-.IP
-sleep:t         sleep floating point time t.
-.IP
-get_xprop:p     get X property named 'p'.
-.IP
-set_xprop:p:val set X property named 'p' to 'val'.
-p -> id=NNN:p for hex/dec window id.
-.IP
-wininfo:id      get info about X window id.  use 'root'
-for root window, use +id for children.
-.IP
-grab_state      get state of pointer and keyboard grab.
-.IP
-pointer_pos     print XQueryPointer x,y cursor position.
-.IP
-pointer_x       print XQueryPointer x cursor position.
-.IP
-pointer_y       print XQueryPointer y cursor position.
-.IP
-pointer_same    print XQueryPointer ptr on same screen.
-.IP
-pointer_root    print XQueryPointer curr ptr rootwin.
-.IP
-pointer_mask    print XQueryPointer button and mods mask
-.IP
-mouse_x         print x11vnc's idea of cursor position.
-.IP
-mouse_y         print x11vnc's idea of cursor position.
-.IP
-noop            do nothing.
-.IP
-defer:n         set \fB-defer\fR to n ms,same as deferupdate:n
-.IP
-wait:n          set \fB-wait\fR to n ms.
-.IP
-extra_fbur:n    set \fB-extra_fbur\fR to n.
-.IP
-wait_ui:f       set \fB-wait_ui\fR factor to f.
-.IP
-setdefer:n      set \fB-setdefer\fR to \fB-2,-1,0,1,\fR or 2.
-.IP
-wait_bog        disable \fB-nowait_bog\fR mode.
-.IP
-nowait_bog      enable  \fB-nowait_bog\fR mode.
-.IP
-slow_fb:f       set \fB-slow_fb\fR to f seconds.
-.IP
-xrefresh:f      set \fB-xrefresh\fR to f seconds.
-.IP
-readtimeout:n   set read timeout to n seconds.
-.IP
-nap             enable  \fB-nap\fR mode.
-.IP
-nonap           disable \fB-nap\fR mode.
-.IP
-sb:n            set \fB-sb\fR to n s, same as screen_blank:n
-.IP
-fbpm            disable \fB-nofbpm\fR mode.
-.IP
-nofbpm          enable  \fB-nofbpm\fR mode.
-.IP
-dpms            disable \fB-nodpms\fR mode.
-.IP
-nodpms          enable  \fB-nodpms\fR mode.
-.IP
-forcedpms       enable  \fB-forcedpms\fR mode.
-.IP
-noforcedpms     disable \fB-forcedpms\fR mode.
-.IP
-clientdpms      enable  \fB-clientdpms\fR mode.
-.IP
-noclientdpms    disable \fB-clientdpms\fR mode.
-.IP
-noserverdpms    enable  \fB-noserverdpms\fR mode.
-.IP
-serverdpms      disable \fB-noserverdpms\fR mode.
-.IP
-noultraext      enable  \fB-noultraext\fR mode.
-.IP
-ultraext        disable \fB-noultraext\fR mode.
-.IP
-chatwindow      enable  local chatwindow mode.
-.IP
-nochatwindow    disable local chatwindow mode.
-.IP
-chaton          begin chat using local window.
-.IP
-chatoff         end   chat using local window.
-.IP
-xdamage         enable  xdamage polling hints.
-.IP
-noxdamage       disable xdamage polling hints.
-.IP
-xd_area:A       set \fB-xd_area\fR max pixel area to "A"
-.IP
-xd_mem:f        set \fB-xd_mem\fR remembrance to "f"
-.IP
-fs:frac         set \fB-fs\fR fraction to "frac", e.g. 0.5
-.IP
-gaps:n          set \fB-gaps\fR to n.
-.IP
-grow:n          set \fB-grow\fR to n.
-.IP
-fuzz:n          set \fB-fuzz\fR to n.
-.IP
-snapfb          enable  \fB-snapfb\fR mode.
-.IP
-nosnapfb        disable \fB-snapfb\fR mode.
-.IP
-rawfb:str       set \fB-rawfb\fR mode to "str".
-.IP
-uinput_accel:f  set uinput_accel to f.
-.IP
-uinput_thresh:n set uinput_thresh to n.
-.IP
-uinput_reset:n  set uinput_reset to n ms.
-.IP
-uinput_always:n set uinput_always to 1/0.
-.IP
-progressive:n   set LibVNCServer \fB-progressive\fR slice
-height parameter to n.
-.IP
-desktop:str     set \fB-desktop\fR name to str for new clients.
-.IP
-rfbport:n       set \fB-rfbport\fR to n.
-.IP
-macnosaver      enable  \fB-macnosaver\fR mode.
-.IP
-macsaver        disable \fB-macnosaver\fR mode.
-.IP
-macnowait       enable  \fB-macnowait\fR  mode.
-.IP
-macwait         disable \fB-macnowait\fR  mode.
-.IP
-macwheel:n      set \fB-macwheel\fR to n.
-.IP
-macnoswap       enable  \fB-macnoswap\fR mouse button mode.
-.IP
-macswap         disable \fB-macnoswap\fR mouse button mode.
-.IP
-macnoresize     enable  \fB-macnoresize\fR mode.
-.IP
-macresize       disable \fB-macnoresize\fR mode.
-.IP
-maciconanim:n   set \fB-maciconanim\fR to n.
-.IP
-macmenu         enable  \fB-macmenu\fR  mode.
-.IP
-macnomenu       disable \fB-macmenu\fR  mode.
-.IP
-macuskbd        enable  \fB-macuskbd\fR mode.
-.IP
-macnouskbd      disable \fB-macuskbd\fR mode.
-.IP
-httpport:n      set \fB-httpport\fR to n.
-.IP
-httpdir:dir     set \fB-httpdir\fR to dir (and enable http).
-.IP
-enablehttpproxy   enable  \fB-enablehttpproxy\fR mode.
-.IP
-noenablehttpproxy disable \fB-enablehttpproxy\fR mode.
-.IP
-alwaysshared     enable  \fB-alwaysshared\fR mode.
-.IP
-noalwaysshared   disable \fB-alwaysshared\fR mode.
-(may interfere with other options)
-.IP
-nevershared      enable  \fB-nevershared\fR mode.
-.IP
-nonevershared    disable \fB-nevershared\fR mode.
-(may interfere with other options)
-.IP
-dontdisconnect   enable  \fB-dontdisconnect\fR mode.
-.IP
-nodontdisconnect disable \fB-dontdisconnect\fR mode.
-(may interfere with other options)
-.IP
-debug_xevents   enable  debugging X events.
-.IP
-nodebug_xevents disable debugging X events.
-.IP
-debug_xdamage   enable  debugging X DAMAGE mechanism.
-.IP
-nodebug_xdamage disable debugging X DAMAGE mechanism.
-.IP
-debug_wireframe enable   debugging wireframe mechanism.
-.IP
-nodebug_wireframe disable debugging wireframe mechanism.
-.IP
-debug_scroll    enable  debugging scrollcopy mechanism.
-.IP
-nodebug_scroll  disable debugging scrollcopy mechanism.
-.IP
-debug_tiles     enable  \fB-debug_tiles\fR
-.IP
-nodebug_tiles   disable \fB-debug_tiles\fR
-.IP
-debug_grabs     enable  \fB-debug_grabs\fR
-.IP
-nodebug_grabs   disable \fB-debug_grabs\fR
-.IP
-debug_sel       enable  \fB-debug_sel\fR
-.IP
-nodebug_sel     disable \fB-debug_sel\fR
-.IP
-debug_ncache    enable  \fB-debug_ncache\fR
-.IP
-nodebug_ncache  disable \fB-debug_ncache\fR
-.IP
-dbg             enable  \fB-dbg\fR crash shell
-.IP
-nodbg           disable \fB-dbg\fR crash shell
-.IP
-.IP
-noremote        disable the \fB-remote\fR command processing,
-it cannot be turned back on.
-.IP
-.IP
-bcx_xattach:str  This remote control command is for
-use with the BARCO xattach program or the x2x program.
-Both of these programs are for 'pointer and keyboard'
-sharing between separate X displays.  In general the
-two displays are usually nearby, e.g. on the same desk,
-and this allows the user to share a single pointer and
-keyboard between them.  The user moves the mouse to
-an edge and then the mouse pointer appears to 'jump'
-to the other display screen.  Thus it emulates what a
-single X server would do for two screens (e.g. :0.0 and
-:0.1) The illusion of a single Xserver with multiple
-screens is achieved by forwarding events to the 2nd
-one via the XTEST extension.
-.IP
-What the x11vnc bcx_xattach command does is to perform
-some pointer movements to try to INDUCE xattach/x2x
-to 'jump' to the other display.  In what follows the
-\'master' display refers to the one that when it has
-\'focus' it is basically doing nothing besides watching
-for the mouse to go over an edge.  The 'slave'
-display refers to the one to which the mouse and
-keyboard is redirected to once an edge in the master
-has been crossed.  Note that the x11vnc executing the
-bcx_xattach command MUST be the one connected to the
-*master* display.
-.IP
-Also note that when input is being redirected (via
-XTEST) from the master display to the slave display,
-the master display's pointer and keyboard are *grabbed*
-by xattach/x2x.  x11vnc can use this info to verify that
-the master/slave mode change has taken place correctly.
-If you specify the "ifneeded" option (see below)
-and the initial grab state is that of the desired
-final state, then no pointer movements are injected
-and "DONE,GRAB_OK" is returned.
-.IP
-"str" must contain one of "up", "down", "left",
-or "right" to indicate the direction of the 'jump'.
-"str" must also contain one of "master_to_slave"
-or "slave_to_master" to indicate the type of mode
-change induced by the jump.  Use "M2S" and "S2M"
-as shorter aliases.
-.IP
-"str" may be a "+" separated list of additional
-tuning options.  The "shift=n" option indicates an
-offset shift position away from (0,0) (default 20).
-"final=x+y" specifies the final position of the cursor
-at the end of the normal move sequence; default 30+30.
-"extra_move=x+y" means to do one more pointer move
-after "final" to x+y.  "dt=n" sets the sleep time
-in milliseconds between pointer moves (default: 40ms)
-"retry=n" specifies the maximum number of retries if
-the grab state change fails. "ifneeded" means to not
-apply the pointer movements if the initial grab state is
-that of the desired final state. "nograbcheck" means
-to not check if the grab state changed as expected and
-only apply the pointer movements (default is to check
-the grab states.)
-.IP
-If you do not specify "up", etc., to bcx_xattach
-nothing will be attempted and the command returns
-the string FAIL,NO_DIRECTION_SPECIFIED.  If you do
-not specify "master_to_slave" or "M2S", etc., to
-bcx_xattach nothing will be attempted and the command
-returns the string FAIL,NO_MODE_CHANGE_SPECIFIED.
-.IP
-Otherwise, the returned string will contain "DONE".
-It will be "DONE,GRAB_OK" if the grab state changed
-as expected (or if "ifneeded" was supplied and
-the initial grab state was already the desired
-one.)  If the initial grab state was incorrect,
-but the final grab state was correct then it is
-"DONE,GRAB_FAIL_INIT".  If the initial grab state
-was correct, but the final grab state was incorrect
-then it is "DONE,GRAB_FAIL_FINAL".  If both are
-incorrect it will be "DONE,GRAB_FAIL".  Under grab
-failure the string will be followed by ":p1,k1-p2,k2"
-where  p1,k1 indicates the initial pointer and keyboard
-grab states and p2,k2 the final ones. If GRAB_FAIL or
-GRAB_FAIL_FINAL occurs, the action will be retried up
-to 3 times; trying to reset the state and sleeping a
-bit between each try.  Set retry=n to adjust the number
-of retries, zero to disable retries.
-.IP
-Examples:
-\fB-R\fR bcx_xattach:down+M2S
-\fB-R\fR bcx_xattach:up+S2M
-\fB-R\fR bcx_xattach:up+S2M+nograbcheck+dt=30
-\fB-R\fR bcx_xattach:down+M2S+extra_move=100+100
-.IP
-or use \fB-Q\fR instead of \fB-R\fR to retrieve the result text.
-.IP
-End of the bcx_xattach:str description.
-.IP
-The 
-.IR vncconnect (1)
-command from standard VNC
-distributions may also be used if string is prefixed
-with "cmd=" E.g. 'vncconnect cmd=stop'.  Under some
-circumstances 
-.IR xprop (1)
-can used if it supports \fB-set\fR
-(see the FAQ).
-.IP
-If "\fB-connect\fR \fI/path/to/file\fR" has been supplied to the
-running x11vnc server then that file can be used as a
-communication channel (this is the only way to remote
-control one of many x11vnc's polling the same X display)
-Simply run: 'x11vnc \fB-connect\fR /path/to/file \fB-remote\fR ...'
-or you can directly write to the file via something
-like: "echo cmd=stop > /path/to/file", etc.
-.PP
-\fB-query\fR \fIvariable\fR
-.IP
-Like \fB-remote,\fR except just query the value of
-\fIvariable\fR.  "\fB-Q\fR" is an alias for "\fB-query\fR".
-Multiple queries can be done by separating variables
-by commas, e.g. \fB-query\fR var1,var2. The results come
-back in the form ans=var1:value1,ans=var2:value2,...
-to the standard output.  If a variable is read-only,
-it comes back with prefix "aro=" instead of "ans=".
-.IP
-Some \fB-remote\fR commands are pure actions that do not make
-sense as variables, e.g. "stop" or "disconnect", in
-these cases the value returned is "N/A".  To direct a
-query straight to the X11VNC_REMOTE property or connect
-file use "qry=..." instead of "cmd=..."
-.IP
-ans= stop quit exit shutdown ping resend_cutbuffer
-resend_clipboard resend_primary blacken zero refresh
-reset close disconnect id_cmd id sid waitmapped
-nowaitmapped clip flashcmap noflashcmap shiftcmap
-truecolor notruecolor overlay nooverlay overlay_cursor
-overlay_yescursor nooverlay_nocursor nooverlay_cursor
-nooverlay_yescursor overlay_nocursor 8to24 no8to24
-8to24_opts 24to32 no24to32 visual scale scale_cursor
-viewonly noviewonly shared noshared forever noforever
-once timeout tightfilexfer notightfilexfer ultrafilexfer
-noultrafilexfer rfbversion deny lock nodeny unlock avahi
-mdns zeroconf noavahi nomdns nozeroconf connect proxy
-allowonce allow noipv6 ipv6 noipv4 ipv4 no6 6 localhost
-nolocalhost listen lookup nolookup accept afteraccept
-gone shm noshm flipbyteorder noflipbyteorder onetile
-noonetile solid_color solid nosolid blackout xinerama
-noxinerama xtrap noxtrap xrandr noxrandr xrandr_mode
-rotate padgeom quiet q noquiet modtweak nomodtweak xkb
-noxkb capslock nocapslock skip_lockkeys noskip_lockkeys
-skip_keycodes sloppy_keys nosloppy_keys skip_dups
-noskip_dups add_keysyms noadd_keysyms clear_mods
-noclear_mods clear_keys noclear_keys clear_all
-clear_locks keystate remap repeat norepeat fb nofb bell
-nobell sendbell sel nosel primary noprimary setprimary
-nosetprimary clipboard noclipboard setclipboard
-nosetclipboard seldir cursorshape nocursorshape
-cursorpos nocursorpos cursor_drag nocursor_drag cursor
-show_cursor noshow_cursor nocursor arrow xfixes noxfixes
-xdamage noxdamage xd_area xd_mem alphacut alphafrac
-alpharemove noalpharemove alphablend noalphablend
-xwarppointer xwarp noxwarppointer noxwarp always_inject
-noalways_inject buttonmap dragging nodragging ncache_cr
-noncache_cr ncache_no_moveraise noncache_no_moveraise
-ncache_no_dtchange noncache_no_dtchange
-ncache_no_rootpixmap noncache_no_rootpixmap
-ncache_reset_rootpixmap ncrp ncache_keep_anims
-noncache_keep_anims ncache_old_wm noncache_old_wm
-ncache_pad ncache noncache ncache_size debug_ncache
-nodebug_ncache wireframe_mode wireframe wf nowireframe
-nowf wireframelocal wfl nowireframelocal nowfl
-wirecopyrect wcr nowirecopyrect nowcr scr_area
-scr_skip scr_inc scr_keys scr_term scr_keyrepeat
-scr_parms scrollcopyrect scr noscrollcopyrect
-noscr fixscreen noxrecord xrecord reset_record
-pointer_mode pm input_skip allinput noallinput
-input_eagerly noinput_eagerly input grabkbd nograbkbd
-grabptr nograbptr grabalways nograbalways grablocal
-client_input ssltimeout speeds wmdt debug_pointer dp
-nodebug_pointer nodp debug_keyboard dk nodebug_keyboard
-nodk keycode keysym ptr fakebuttonevent sleep get_xprop
-set_xprop wininfo bcx_xattach deferupdate defer
-setdefer extra_fbur wait_ui wait_bog nowait_bog
-slow_fb xrefresh wait readtimeout nap nonap sb
-screen_blank fbpm nofbpm dpms nodpms clientdpms
-noclientdpms forcedpms noforcedpms noserverdpms
-serverdpms noultraext ultraext chatwindow nochatwindow
-chaton chatoff fs gaps grow fuzz snapfb nosnapfb
-rawfb uinput_accel uinput_thresh uinput_reset
-uinput_always progressive rfbport http nohttp httpport
-httpdir enablehttpproxy noenablehttpproxy alwaysshared
-noalwaysshared nevershared noalwaysshared dontdisconnect
-nodontdisconnect desktop debug_xevents nodebug_xevents
-debug_xevents debug_xdamage nodebug_xdamage
-debug_xdamage debug_wireframe nodebug_wireframe
-debug_wireframe debug_scroll nodebug_scroll debug_scroll
-debug_tiles dbt nodebug_tiles nodbt debug_tiles
-debug_grabs nodebug_grabs debug_sel nodebug_sel dbg
-nodbg macnosaver macsaver nomacnosaver macnowait macwait
-nomacnowait macwheel macnoswap macswap nomacnoswap
-macnoresize macresize nomacnoresize maciconanim macmenu
-macnomenu nomacmenu macuskbd nomacuskbd noremote
-.IP
-aro=  noop display vncdisplay icon_mode autoport
-loop loopbg desktopname guess_desktop guess_dbus
-http_url auth xauth users rootshift clipshift scale_str
-scaled_x scaled_y scale_numer scale_denom scale_fac_x
-scale_fac_y scaling_blend scaling_nomult4 scaling_pad
-scaling_interpolate inetd privremote unsafe safer nocmds
-passwdfile unixpw unixpw_nis unixpw_list ssl ssl_pem
-sslverify stunnel stunnel_pem https httpsredir usepw
-using_shm logfile o flag rmflag rc norc h help V version
-lastmod bg sigpipe threads readrate netrate netlatency
-pipeinput clients client_count pid ext_xtest ext_xtrap
-ext_xrecord ext_xkb ext_xshm ext_xinerama ext_overlay
-ext_xfixes ext_xdamage ext_xrandr rootwin num_buttons
-button_mask mouse_x mouse_y grab_state pointer_pos
-pointer_x pointer_y pointer_same pointer_root
-pointer_mask bpp depth indexed_color dpy_x dpy_y wdpy_x
-wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth
-passwd viewpasswd
-.PP
-\fB-QD\fR \fIvariable\fR
-.IP
-Just like \fB-query\fR variable, but returns the default
-value for that parameter (no running x11vnc server
-is consulted)
-.PP
-\fB-sync\fR
-.IP
-By default \fB-remote\fR commands are run asynchronously, that
-is, the request is posted and the program immediately
-exits.  Use \fB-sync\fR to have the program wait for an
-acknowledgement from the x11vnc server that command was
-processed (somehow).  On the other hand \fB-query\fR requests
-are always processed synchronously because they have
-to wait for the answer.
-.IP
-Also note that if both \fB-remote\fR and \fB-query\fR requests are
-supplied on the command line, the \fB-remote\fR is processed
-first (synchronously: no need for \fB-sync),\fR and then
-the \fB-query\fR request is processed in the normal way.
-This allows for a reliable way to see if the \fB-remote\fR
-command was processed by querying for any new settings.
-Note however that there is timeout of a few seconds
-(see the next paragraph) so if the x11vnc takes longer
-than that to process the requests the requester will
-think that a failure has taken place.
-.IP
-The default is to wait 3.5 seconds.  Or if cmd=stop
-only 1.0 seconds.  If cmd matches 'script:' then it
-will wait up to 10.0 seconds.  Set X11VNC_SYNC_TIMEOUT
-to the number of seconds you want it to wait.
-.PP
-\fB-query_retries\fR \fIstr\fR
-.IP
-If a query fails to get a response from an x11vnc
-server, retry up to n times.  \fIstr\fR is specified as
-n[:t][/match]  Optionally the delay between tries may
-be specified by "t" a floating point time (default
-0.5 seconds.)  Note: the response is not checked for
-validity or whether it corresponds to the query sent.
-The query "ping:mystring" may be used to help uniquely
-identify the query.  Optionally, a matching string after
-a "/" will be used to check the result text.  Up to
-n retries will take place until the matching string is
-found in the output text.  If the match string is never
-found the program's exit code is 1; if the match is
-found it exits with 0.  Note that there may be stdout
-printed for each retry (i.e. multiple lines printed
-out to stdout.)
-Example: \fB-query_retries\fR 4:1.5/grab_state
-.PP
-\fB-remote_prefix\fR \fIstr\fR
-.IP
-Enable a remote-control communication channel for
-connected VNC clients.  str is a non-empty string. If a
-VNC client sends rfbCutText having the prefix \fIstr\fR
-then the part after it is processed as though it were
-sent via 'x11vnc \fB-remote\fR ...'.  If it begins with
-neither 'cmd=' nor 'qry=' then 'qry=' is assumed.
-Any corresponding output text for that remote control
-command is sent back to all client as rfbCutText.
-The returned output is also prefixed with \fIstr\fR.
-Example: \fB-remote_prefix\fR DO_THIS:
-.IP
-Note that enabling \fB-remote_prefix\fR allows the remote
-VNC viewers to run x11vnc \fB-remote\fR commands.  Do not
-use this option if they are not to be trusted.
-.PP
-\fB-noremote,\fR \fB-yesremote\fR
-.IP
-Do not process any remote control commands or queries.
-Do process remote control commands or queries.
-Default: \fB-yesremote\fR
-.IP
-A note about security wrt remote control commands.
-If someone can connect to the X display and change
-the property X11VNC_REMOTE, then they can remotely
-control x11vnc.  Normally access to the X display is
-protected.  Note that if they can modify X11VNC_REMOTE
-on the X server, they have enough permissions to also
-run their own x11vnc and thus have complete control
-of the desktop.  If the  "\fB-connect\fR \fI/path/to/file\fR"
-channel is being used, obviously anyone who can write
-to /path/to/file can remotely control x11vnc.  So be
-sure to protect the X display and that file's write
-permissions.  See \fB-privremote\fR below.
-.IP
-If you are paranoid and do not think \fB-noremote\fR is
-enough, to disable the X11VNC_REMOTE property channel
-completely use \fB-novncconnect,\fR or use the \fB-safer\fR option
-that shuts many things off.
-.PP
-\fB-unsafe\fR
-.IP
-A few remote commands are disabled by default
-(currently: id:pick, accept:<cmd>, gone:<cmd>, and
-rawfb:setup:<cmd>) because they are associated with
-running external programs.  If you specify \fB-unsafe,\fR then
-these remote-control commands are allowed.  Note that
-you can still specify these parameters on the command
-line, they just cannot be invoked via remote-control.
-.PP
-\fB-safer\fR
-.IP
-Equivalent to: \fB-novncconnect\fR \fB-noremote\fR and prohibiting
-\fB-gui\fR and the \fB-connect\fR file. Shuts off communcation
-channels.
-.PP
-\fB-privremote\fR
-.IP
-Perform some sanity checks and disable remote-control
-commands if it appears that the X DISPLAY and/or
-connectfile can be accessed by other users.  Once
-remote-control is disabled it cannot be turned back on.
-.PP
-\fB-nocmds\fR
-.IP
-No external commands (e.g. 
-.IR system (3)
-, 
-.IR popen (3)
-, 
-.IR exec (3)
-)
-will be run at all.
-.PP
-\fB-allowedcmds\fR \fIlist\fR
-.IP
-\fIlist\fR contains a comma separated list of the only
-external commands that can be run.  The full list of
-associated options is:
-.IP
-stunnel, ssl, unixpw, WAIT, zeroconf, id, accept,
-afteraccept, gone, pipeinput, v4l-info, rawfb-setup,
-dt, gui, ssh, storepasswd, passwdfile, custom_passwd,
-findauth, crash.
-.IP
-See each option's help to learn the associated external
-command.  Note that the \fB-nocmds\fR option takes precedence
-and disables all external commands.
-.PP
-\fB-deny_all\fR
-.IP
-For use with \fB-remote\fR nodeny: start out denying all
-incoming clients until "\fB-remote\fR \fInodeny\fR" is used to
-let them in.
-.PP
-These options are passed to LibVNCServer:
-.PP
-\fB-rfbport\fR \fIport\fR
-.IP
-TCP port for RFB protocol
-.PP
-\fB-rfbwait\fR \fItime\fR
-.IP
-max time in ms to wait for RFB client
-.PP
-\fB-rfbauth\fR \fIpasswd-file\fR
-.IP
-use authentication on RFB protocol
-(use 'x11vnc \fB-storepasswd\fR pass file' to create a password file)
-.PP
-\fB-rfbversion\fR \fI3.x\fR
-.IP
-Set the version of the RFB we choose to advertise
-.PP
-\fB-permitfiletransfer\fR
-.IP
-permit file transfer support
-.PP
-\fB-passwd\fR \fIplain-password\fR
-.IP
-use authentication
-(use plain-password as password, USE AT YOUR RISK)
-.PP
-\fB-deferupdate\fR \fItime\fR
-.IP
-time in ms to defer updates (default 40)
-.PP
-\fB-deferptrupdate\fR \fItime\fR
-.IP
-time in ms to defer pointer updates (default none)
-.PP
-\fB-desktop\fR \fIname\fR
-.IP
-VNC desktop name (default "LibVNCServer")
-.PP
-\fB-alwaysshared\fR
-.IP
-always treat new clients as shared
-.PP
-\fB-nevershared\fR
-.IP
-never treat new clients as shared
-.PP
-\fB-dontdisconnect\fR
-.IP
-don't disconnect existing clients when a new non-shared
-connection comes in (refuse new connection instead)
-.PP
-\fB-httpdir\fR \fIdir-path\fR
-.IP
-enable http server using dir-path home
-.PP
-\fB-httpport\fR \fIportnum\fR
-.IP
-use portnum for http connection
-.PP
-\fB-enablehttpproxy\fR
-.IP
-enable http proxy support
-.PP
-\fB-progressive\fR \fIheight\fR
-.IP
-enable progressive updating for slow links
-.PP
-\fB-listen\fR \fIipaddr\fR
-.IP
-listen for connections only on network interface with
-addr ipaddr. '-listen localhost' and hostname work too.
-.PP
-libvncserver-tight-extension options:
-.PP
-\fB-disablefiletransfer\fR
-.IP
-disable file transfer
-.PP
-\fB-ftproot\fR \fIstring\fR
-.IP
-set ftp root
-.SH "FILES"
-.IR $HOME/.x11vncrc ,
-.IR $HOME/.Xauthority
-.SH "ENVIRONMENT"
-.IR DISPLAY ,
-.IR XAUTHORITY ,
-.IR HOME
-.PP
-The following are set for the auxiliary commands
-run by \fB-accept\fR, \fB-gone\fR and other cases:
-.PP
-.IR RFB_CLIENT_IP ,
-.IR RFB_CLIENT_PORT ,
-.IR RFB_SERVER_IP ,
-.IR RFB_SERVER_PORT ,
-.IR RFB_X11VNC_PID ,
-.IR RFB_CLIENT_ID ,
-.IR RFB_CLIENT_COUNT ,
-.IR RFB_MODE
-.IR RFB_STATE
-.IR RFB_LOGIN_VIEWONLY
-.IR RFB_LOGIN_TIME
-.IR RFB_CURRENT_TIME
-.IR RFB_USERNAME
-.IR RFB_SSL_CLIENT_CERT
-.SH "SEE ALSO"
-.IR vncviewer (1),
-.IR vncpasswd (1),
-.IR vncconnect (1),
-.IR vncserver (1),
-.IR Xvnc (1),
-.IR xev (1),
-.IR xdpyinfo (1),
-.IR xwininfo (1),
-.IR xprop (1),
-.IR xmodmap (1),
-.IR xrandr (1),
-.IR Xserver (1),
-.IR xauth (1),
-.IR xhost (1),
-.IR Xsecurity (7),
-.IR xmessage (1),
-.IR XGetImage (3X11),
-.IR ipcrm (1),
-.IR inetd (1),
-.IR xdm (1),
-.IR gdm (1),
-.IR kdm (1),
-.IR ssh (1),
-.IR stunnel (8),
-.IR su (1),
-.IR http://www.tightvnc.com ,
-.IR http://www.realvnc.com ,
-.IR http://www.karlrunge.com/x11vnc/ ,
-.IR http://www.karlrunge.com/x11vnc/#faq
-.SH AUTHORS
-x11vnc was written by Karl J. Runge <runge at karlrunge.com>,
-it is part of the LibVNCServer project <http://sf.net/projects/libvncserver>.
-This manual page is based one the one written by Ludovic Drolez
-<ldrolez at debian.org>, for the Debian project (both may be used by others).
diff --git a/ica/x11/x11vnc/x11vnc.c b/ica/x11/x11vnc/x11vnc.c
deleted file mode 100644
index 83752bd..0000000
--- a/ica/x11/x11vnc/x11vnc.c
+++ /dev/null
@@ -1,5955 +0,0 @@
-/*
- * x11vnc: a VNC server for X displays.
- *
- * Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com>
- * All rights reserved.
- *
- *  This file is part of x11vnc.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; version 2 of the License, or (at
- *  your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA  or see <http://www.gnu.org/licenses/>.
- *
- *  In addition, as a special exception, Karl J. Runge
- *  gives permission to link the code of its release of x11vnc with the
- *  OpenSSL project's "OpenSSL" library (or with modified versions of it
- *  that use the same license as the "OpenSSL" library), and distribute
- *  the linked executables.  You must obey the GNU General Public License
- *  in all respects for all of the code used other than "OpenSSL".  If you
- *  modify this file, you may extend this exception to your version of the
- *  file, but you are not obligated to do so.  If you do not wish to do
- *  so, delete this exception statement from your version.
- */
-
-/*
- * This program is based on some ideas from the following programs:
- *
- *       the initial x11vnc.c in libvncserver (Johannes E. Schindelin)
- *	 x0rfbserver, the original native X vnc server (Jens Wagner)
- *       krfb, the KDE desktopsharing project (Tim Jansen)
- *
- * Please see http://www.karlrunge.com/x11vnc for the most up-to-date
- * information about x11vnc.  Some of the following text may be out
- * of date.
- *
- * The primary goal of this program is to create a portable and simple
- * command-line server utility that allows a VNC viewer to connect
- * to an actual X display (as the above do).  The only non-standard
- * dependency of this program is the static library libvncserver.a.
- * Although in some environments libjpeg.so or libz.so may not be
- * readily available and needs to be installed, they may be found
- * at ftp://ftp.uu.net/graphics/jpeg/ and http://www.gzip.org/zlib/,
- * respectively.  To increase portability it is written in plain C.
- *
- * Another goal is to improve performance and interactive response.
- * The algorithm of x0rfbserver was used as a base.  Many additional
- * heuristics are also applied.
- *
- * Another goal is to add many features that enable and incourage creative
- * usage and application of the tool.  Apologies for the large number
- * of options!
- *
- * To build:
- *
- * Obtain the libvncserver package (http://libvncserver.sourceforge.net).
- * As of 12/2002 this version of x11vnc.c is contained in the libvncserver
- * CVS tree and released in version 0.5.
- *
- * gcc should be used on all platforms.  To build a threaded version put
- * "-D_REENTRANT -DX11VNC_THREADED" in the environment variable CFLAGS
- * or CPPFLAGS (e.g. before running the libvncserver configure).  The
- * threaded mode is a bit more responsive, but can be unstable (e.g.
- * if more than one client the same tight or zrle encoding).
- *
- * Known shortcomings:
- *
- * The screen updates are good, but of course not perfect since the X
- * display must be continuously polled and read for changes and this is
- * slow for most hardware. This can be contrasted with receiving a change
- * callback from the X server, if that were generally possible... (UPDATE:
- * this is handled now with the X DAMAGE extension, but unfortunately
- * that doesn't seem to address the slow read from the video h/w).  So,
- * e.g., opaque moves and similar window activity can be very painful;
- * one has to modify one's behavior a bit.
- *
- * General audio at the remote display is lost unless one separately
- * sets up some audio side-channel such as esd.
- *
- * It does not appear possible to query the X server for the current
- * cursor shape.  We can use XTest to compare cursor to current window's
- * cursor, but we cannot extract what the cursor is... (UPDATE: we now
- * use XFIXES extension for this.  Also on Solaris and IRIX Overlay
- * extensions exists that allow drawing the mouse into the framebuffer)
- * 
- * The current *position* of the remote X mouse pointer is shown with
- * the -cursor option.  Further, if -cursor X is used, a trick
- * is done to at least show the root window cursor vs non-root cursor.
- * (perhaps some heuristic can be done to further distinguish cases...,
- * currently "-cursor some" is a first hack at this)
- *
- * Under XFIXES mode for showing the cursor shape, the cursor may be
- * poorly approximated if it has transparency (alpha channel).
- *
- * Windows using visuals other than the default X visual may have
- * their colors messed up.  When using 8bpp indexed color, the colormap
- * is attempted to be followed, but may become out of date.  Use the
- * -flashcmap option to have colormap flashing as the pointer moves
- * windows with private colormaps (slow).  Displays with mixed depth 8 and
- * 24 visuals will incorrectly display windows using the non-default one.
- * On Sun and Sgi hardware we can to work around this with -overlay.
- *
- * Feature -id <windowid> can be picky: it can crash for things like
- * the window not sufficiently mapped into server memory, etc (UPDATE:
- * we now use the -xrandr mechanisms to trap errors more robustly for
- * this mode).  SaveUnders menus, popups, etc will not be seen.
- *
- * Under some situations the keysym unmapping is not correct, especially
- * if the two keyboards correspond to different languages.  The -modtweak
- * option is the default and corrects most problems. One can use the
- * -xkb option to try to use the XKEYBOARD extension to clear up any
- * remaining problems.
- *
- * Occasionally, a few tile updates can be missed leaving a patch of
- * color that needs to be refreshed.  This may only be when threaded,
- * which is no longer the default.
- *
- * There seems to be a serious bug with simultaneous clients when
- * threaded, currently the only workaround in this case is -nothreads
- * (which is now the default).
- */
-
-
-/* -- x11vnc.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "xdamage.h"
-#include "xrecord.h"
-#include "xevents.h"
-#include "xinerama.h"
-#include "xrandr.h"
-#include "xkb_bell.h"
-#include "win_utils.h"
-#include "remote.h"
-#include "scan.h"
-#include "gui.h"
-#include "help.h"
-#include "user.h"
-#include "cleanup.h"
-#include "keyboard.h"
-#include "pointer.h"
-#include "cursor.h"
-#include "userinput.h"
-#include "screen.h"
-#include "connections.h"
-#include "rates.h"
-#include "unixpw.h"
-#include "inet.h"
-#include "sslcmds.h"
-#include "sslhelper.h"
-#include "selection.h"
-#include "pm.h"
-#include "solid.h"
-
-/*
- * main routine for the x11vnc program
- */
-void watch_loop(void);
-
-static int limit_shm(void);
-static void check_rcfile(int argc, char **argv);
-static void immediate_switch_user(int argc, char* argv[]);
-static void print_settings(int try_http, int bg, char *gui_str);
-static void check_loop_mode(int argc, char* argv[], int force);
-static void check_appshare_mode(int argc, char* argv[]);
-
-static int tsdo_timeout_flag;
-
-static void tsdo_timeout (int sig) {
-	tsdo_timeout_flag = 1;
-	if (sig) {};
-}
-
-#define TASKMAX 32
-static pid_t ts_tasks[TASKMAX];
-static int ts_taskn = -1;
-
-int tsdo(int port, int lsock, int *conn) {
-	int csock, rsock, i, db = 1;
-	pid_t pid;
-	struct sockaddr_in addr;
-#ifdef __hpux
-	int addrlen = sizeof(addr);
-#else
-	socklen_t addrlen = sizeof(addr);
-#endif
-
-	if (*conn < 0) {
-		signal(SIGALRM, tsdo_timeout);
-		tsdo_timeout_flag = 0;
-
-		alarm(10);
-		csock = accept(lsock, (struct sockaddr *)&addr, &addrlen);
-		alarm(0);
-
-		if (db) rfbLog("tsdo: accept: lsock: %d, csock: %d, port: %d\n", lsock, csock, port);
-
-		if (tsdo_timeout_flag > 0 || csock < 0) {
-			close(csock);
-			*conn = -1;
-			return 1;
-		}
-		*conn = csock;
-	} else {
-		csock = *conn;
-		if (db) rfbLog("tsdo: using existing csock: %d, port: %d\n", csock, port);
-	}
-
-	rsock = connect_tcp("127.0.0.1", port);
-	if (rsock < 0) {
-		if (db) rfbLog("tsdo: connect_tcp(port=%d) failed.\n", port);
-		close(csock);
-		return 2;
-	}
-
-	pid = fork();
-	if (pid < 0) {
-		close(csock);
-		close(rsock);
-		return 3;
-	}
-	if (pid > 0) {
-		ts_taskn = (ts_taskn+1) % TASKMAX;
-		ts_tasks[ts_taskn] = pid;
-		close(csock);
-		close(rsock);
-		*conn = -1;
-		return 0;
-	}
-	if (pid == 0) {
-		for (i=0; i<255; i++) {
-			if (i != csock && i != rsock && i != 2) {
-				close(i);
-			}
-		}
-#if LIBVNCSERVER_HAVE_SETSID
-		if (setsid() == -1) {
-			perror("setsid");
-			close(csock);
-			close(rsock);
-			exit(1);
-		}
-#else
-		if (setpgrp() == -1) {
-			perror("setpgrp");
-			close(csock);
-			close(rsock);
-			exit(1);
-		}
-#endif	/* SETSID */
-		raw_xfer(rsock, csock, csock);
-		close(csock);
-		close(rsock);
-		exit(0);
-	}
-	return 0;
-}
-
-void set_redir_properties(void);
-
-#define TSMAX 32
-#define TSSTK 16
-
-void terminal_services(char *list) {
-	int i, j, n, db = 1;
-	char *p, *q, *r, *str;
-#if !NO_X11
-	char *tag[TSMAX];
-	int listen[TSMAX], redir[TSMAX][TSSTK], socks[TSMAX], tstk[TSSTK];
-	double rate_start;
-	int rate_count;
-	Atom at, atom[TSMAX];
-	fd_set rd;
-	Window rwin;
-	XErrorHandler   old_handler1;
-	XIOErrorHandler old_handler2;
-	char num[32];
-	time_t last_clean = time(NULL);
-
-	if (getenv("TS_REDIR_DEBUG")) {
-		db = 2;
-	}
-
-	if (! dpy) {
-		return;
-	}
-
-	rwin = RootWindow(dpy, DefaultScreen(dpy));
-
-	at = XInternAtom(dpy, "TS_REDIR_LIST", False);
-	if (at != None) {
-		XChangeProperty(dpy, rwin, at, XA_STRING, 8,
-		    PropModeReplace, (unsigned char *)list, strlen(list));
-		XSync(dpy, False);
-	}
-	if (db) fprintf(stderr, "TS_REDIR_LIST Atom: %d.\n", (int) at);
-
-	oh_restart_it_all:
-
-	for (i=0; i<TASKMAX; i++) {
-		ts_tasks[i] = 0;
-	}
-	for (i=0; i<TSMAX; i++) {
-		socks[i] = -1;
-		listen[i] = -1;
-		for (j=0; j<TSSTK; j++) {
-			redir[i][j] = 0;
-		}
-	}
-
-	rate_start = 0.0;
-	rate_count = 0;
-
-	n = 0;
-	str = strdup(list);
-	p = strtok(str, ",");
-	while (p) {
-		int m1, m2;
-		if (db) fprintf(stderr, "item: %s\n", p);
-		q = strrchr(p, ':');
-		if (!q) {
-			p = strtok(NULL, ",");
-			continue;
-		}
-		r = strchr(p, ':');
-		if (!r || r == q) {
-			p = strtok(NULL, ",");
-			continue;
-		}
-
-		m1 = atoi(q+1);
-		*q = '\0';
-		m2 = atoi(r+1);
-		*r = '\0';
-
-		if (m1 <= 0 || m2 <= 0 || m1 >= 0xffff || m2 >= 0xffff) {
-			p = strtok(NULL, ",");
-			continue;
-		}
-
-		redir[n][0] = m1;
-		listen[n] = m2;
-		tag[n] = strdup(p);
-
-		if (db) fprintf(stderr, "     %d %d %s\n", redir[n][0], listen[n], tag[n]);
-
-		*r = ':';
-		*q = ':';
-
-		n++;
-		if (n >= TSMAX) {
-			break;
-		}
-		p = strtok(NULL, ",");
-	}
-	free(str);
-
-	if (n==0) {
-		return;
-	}
-
-	at = XInternAtom(dpy, "TS_REDIR_PID", False);
-	if (at != None) {
-		sprintf(num, "%d", getpid());
-		XChangeProperty(dpy, rwin, at, XA_STRING, 8,
-		    PropModeReplace, (unsigned char *)num, strlen(num));
-		XSync(dpy, False);
-	}
-
-	for (i=0; i<n; i++) {
-		int k;
-		atom[i] = XInternAtom(dpy, tag[i], False);
-		if (db) fprintf(stderr, "tag: %s atom: %d\n", tag[i], (int) atom[i]);
-		if (atom[i] == None) {
-			continue;
-		}
-		sprintf(num, "%d", redir[i][0]);
-		if (db) fprintf(stderr, "     listen: %d  redir: %s\n", listen[i], num);
-		XChangeProperty(dpy, rwin, atom[i], XA_STRING, 8,
-		    PropModeReplace, (unsigned char *)num, strlen(num));
-		XSync(dpy, False);
-
-		for (k=1; k <= 5; k++) {
-			/* XXX ::1 fallback? */
-			socks[i] = listen_tcp(listen[i], htonl(INADDR_LOOPBACK), 1);
-			if (socks[i] >= 0) {
-				if (db) fprintf(stderr, "     listen succeeded: %d\n", listen[i]);
-				break;
-			}
-			if (db) fprintf(stderr, "     listen failed***: %d\n", listen[i]);
-			usleep(k * 2000*1000);
-		}
-	}
-
-	if (getenv("TSD_RESTART")) {
-		if (!strcmp(getenv("TSD_RESTART"), "1")) {
-			set_redir_properties();
-		}
-	}
-
-	while (1) {
-		struct timeval tv;
-		int nfd;
-		int fmax = -1;
-
-		tv.tv_sec  = 3;
-		tv.tv_usec = 0;
-
-		FD_ZERO(&rd);
-		for (i=0; i<n; i++) {
-			if (socks[i] >= 0) {
-				FD_SET(socks[i], &rd);
-				if (socks[i] > fmax) {
-					fmax = socks[i];
-				}
-			}
-		}
-
-		nfd = select(fmax+1, &rd, NULL, NULL, &tv);
-
-		if (db && 0) fprintf(stderr, "nfd=%d\n", nfd);
-		if (nfd < 0 && errno == EINTR) {
-			XSync(dpy, True);
-			continue;
-		}
-		if (nfd > 0) {
-			int did_ts = 0;
-			for(i=0; i<n; i++) {
-				int k = 0;
-				for (j = 0; j < TSSTK; j++) {
-					tstk[j] = 0;
-				}
-				for (j = 0; j < TSSTK; j++) {
-					if (redir[i][j] != 0) {
-						tstk[k++] = redir[i][j];
-					}
-				}
-				for (j = 0; j < TSSTK; j++) {
-					redir[i][j] = tstk[j];
-if (tstk[j] != 0) fprintf(stderr, "B redir[%d][%d] = %d  %s\n", i, j, tstk[j], tag[i]);
-				}
-			}
-			for(i=0; i<n; i++) {
-				int s = socks[i];
-				if (s < 0) {
-					continue;
-				}
-				if (FD_ISSET(s, &rd)) {
-					int p0, p, found = -1, jzero = -1;
-					int conn = -1;
-
-					get_prop(num, 32, atom[i], None);
-					p0 = atoi(num);
-
-					for (j = TSSTK-1; j >= 0; j--) {
-						if (redir[i][j] == 0) {
-							jzero = j;
-							continue;
-						}
-						if (p0 > 0 && p0 < 0xffff) {
-							if (redir[i][j] == p0) {
-								found = j;
-								break;
-							}
-						}
-					}
-					if (jzero < 0) {
-						jzero = TSSTK-1;
-					}
-					if (found < 0) {
-						if (p0 > 0 && p0 < 0xffff) {
-							redir[i][jzero] = p0;
-						}
-					}
-					for (j = TSSTK-1; j >= 0; j--) {
-						int rc;
-						p = redir[i][j];
-						if (p <= 0 || p >= 0xffff) {
-							redir[i][j] = 0;
-							continue;
-						}
-
-						if (dnow() > rate_start + 10.0) {
-							rate_start = dnow();
-							rate_count = 0;
-						}
-						rate_count++;
-
-						rc = tsdo(p, s, &conn);
-						did_ts++;
-
-						if (rc == 0) {
-							/* AOK */
-							if (db) fprintf(stderr, "tsdo[%d] OK: %d\n", i, p);
-							if (p != p0) {
-								sprintf(num, "%d", p);
-								XChangeProperty(dpy, rwin, atom[i], XA_STRING, 8,
-								    PropModeReplace, (unsigned char *)num, strlen(num));
-								XSync(dpy, False);
-							}
-							break;
-						} else if (rc == 1) {
-							/* accept failed */
-							if (db) fprintf(stderr, "tsdo[%d] accept failed: %d, sleep 50ms\n", i, p);
-							usleep(50*1000);
-							break;
-						} else if (rc == 2) {
-							/* connect failed */
-							if (db) fprintf(stderr, "tsdo[%d] connect failed: %d, sleep 50ms  rate: %d/10s\n", i, p, rate_count);
-							redir[i][j] = 0;
-							usleep(50*1000);
-							continue;
-						} else if (rc == 3) {
-							/* fork failed */
-							usleep(500*1000);
-							break;
-						}
-					}
-					for (j = 0; j < TSSTK; j++) {
-						if (redir[i][j] != 0) fprintf(stderr, "A redir[%d][%d] = %d  %s\n", i, j, redir[i][j], tag[i]);
-					}
-				}
-			}
-			if (did_ts && rate_count > 100) {
-				int db_netstat = 1;
-				char dcmd[100];
-
-				if (no_external_cmds) {
-					db_netstat = 0;
-				}
-
-				rfbLog("terminal_services: throttling high connect rate %d/10s\n", rate_count);
-				usleep(2*1000*1000);
-				rfbLog("terminal_services: stopping ts services.\n");
-				for(i=0; i<n; i++) {
-					int s = socks[i];
-					if (s < 0) {
-						continue;
-					}
-					rfbLog("terminal_services: closing listen=%d sock=%d.\n", listen[i], socks[i]);
-					if (listen[i] >= 0 && db_netstat) {
-						sprintf(dcmd, "netstat -an | grep -w '%d'", listen[i]);
-						fprintf(stderr, "#1 %s\n", dcmd);
-						system(dcmd);
-					}
-					close(s);
-					socks[i] = -1;
-					usleep(2*1000*1000);
-					if (listen[i] >= 0 && db_netstat) {
-						fprintf(stderr, "#2 %s\n", dcmd);
-						system(dcmd);
-					}
-				}
-				usleep(10*1000*1000);
-
-				rfbLog("terminal_services: restarting ts services\n");
-				goto oh_restart_it_all;
-			}
-		}
-		for (i=0; i<TASKMAX; i++) {
-			pid_t p = ts_tasks[i];
-			if (p > 0) {
-				int status;
-				pid_t p2 = waitpid(p, &status, WNOHANG); 
-				if (p2 == p) {
-					ts_tasks[i] = 0;
-				}
-			}
-		}
-		/* this is to drop events and exit when X server is gone. */
-		old_handler1 = XSetErrorHandler(trap_xerror);
-		old_handler2 = XSetIOErrorHandler(trap_xioerror);
-		trapped_xerror = 0;
-		trapped_xioerror = 0;
-
-		XSync(dpy, True);
-
-		sprintf(num, "%d", (int) time(NULL));
-		at = XInternAtom(dpy, "TS_REDIR", False);
-		if (at != None) {
-			XChangeProperty(dpy, rwin, at, XA_STRING, 8,
-			    PropModeReplace, (unsigned char *)num, strlen(num));
-			XSync(dpy, False);
-		}
-		if (time(NULL) > last_clean + 20 * 60) {
-			int i, j;
-			for(i=0; i<n; i++) {
-				int first = 1;
-				for (j = TSSTK-1; j >= 0; j--) {
-					int s, p = redir[i][j];
-					if (p <= 0 || p >= 0xffff) {
-						redir[i][j] = 0;
-						continue;
-					}
-					s = connect_tcp("127.0.0.1", p);
-					if (s < 0) {
-						redir[i][j] = 0;
-						if (db) fprintf(stderr, "tsdo[%d][%d] clean: connect failed: %d\n", i, j, p);
-					} else {
-						close(s);
-						if (first) {
-							sprintf(num, "%d", p);
-							XChangeProperty(dpy, rwin, atom[i], XA_STRING, 8,
-							    PropModeReplace, (unsigned char *)num, strlen(num));
-							XSync(dpy, False);
-						}
-						first = 0;
-					}
-					usleep(500*1000);
-				}
-			}
-			last_clean = time(NULL);
-		}
-		if (trapped_xerror || trapped_xioerror) {
-			if (db) fprintf(stderr, "Xerror: %d/%d\n", trapped_xerror, trapped_xioerror);
-			exit(0);
-		}
-		XSetErrorHandler(old_handler1);
-		XSetIOErrorHandler(old_handler2);
-	}
-#endif
-}
-
-char *ts_services[][2] = {
-	{"FD_CUPS", "TS_CUPS_REDIR"},
-	{"FD_SMB",  "TS_SMB_REDIR"},
-	{"FD_ESD",  "TS_ESD_REDIR"},
-	{"FD_NAS",  "TS_NAS_REDIR"},
-	{NULL, NULL}
-};
-
-void do_tsd(void) {
-#if !NO_X11
-	Atom a;
-	char prop[513];
-	pid_t pid;
-	char *cmd;
-	int n, sz = 0;
-	char *disp = DisplayString(dpy);
-	char *logfile = getenv("TS_REDIR_LOGFILE");
-	int db = 0;
-
-	if (getenv("TS_REDIR_DEBUG")) {
-		db = 1;
-	}
-	if (db) fprintf(stderr, "do_tsd() in.\n");
-
-	prop[0] = '\0';
-	a = XInternAtom(dpy, "TS_REDIR_LIST", False);
-	if (a != None) {
-		get_prop(prop, 512, a, None);
-	}
-	if (db) fprintf(stderr, "TS_REDIR_LIST Atom: %d = '%s'\n", (int) a, prop);
-
-	if (prop[0] == '\0') {
-		return;
-	}
-
-	if (! program_name) {
-		program_name = "x11vnc";
-	}
-	sz += strlen(program_name) + 1;
-	sz += strlen("-display") + 1;
-	sz += strlen(disp) + 1;
-	sz += strlen("-tsd") + 1;
-	sz += 1 + strlen(prop) + 1 + 1;
-	sz += strlen("-env TSD_RESTART=1") + 1;
-	sz += strlen("</dev/null 1>/dev/null 2>&1") + 1;
-	sz += strlen(" &") + 1;
-	if (logfile) {
-		sz += strlen(logfile);
-	}
-	if (ipv6_listen) {
-		sz += strlen("-6") + 1;
-	}
-
-	cmd = (char *) malloc(sz);
-
-	if (getenv("XAUTHORITY")) {
-		char *xauth = getenv("XAUTHORITY");
-		if (!strcmp(xauth, "") || access(xauth, R_OK) != 0) {
-			*(xauth-2) = '_';	/* yow */
-		}
-	}
-	sprintf(cmd, "%s -display %s -tsd '%s' -env TSD_RESTART=1 %s </dev/null 1>%s 2>&1 &",
-	    program_name, disp, prop, ipv6_listen ? "-6" : "",
-	    logfile ? logfile : "/dev/null" ); 
-	rfbLog("running: %s\n", cmd);
-
-#if LIBVNCSERVER_HAVE_FORK && LIBVNCSERVER_HAVE_SETSID
-	/* fork into the background now */
-	if ((pid = fork()) > 0)  {
-		pid_t pidw;
-		int status;
-		double s = dnow();
-
-		while (dnow() < s + 1.5) {
-			pidw = waitpid(pid, &status, WNOHANG);
-			if (pidw == pid) {
-				break;
-			}
-			usleep(100*1000);
-		}
-		return;
-
-	} else if (pid == -1) {
-		system(cmd);
-	} else {
-		setsid();
-		/* adjust our stdio */
-		n = open("/dev/null", O_RDONLY);
-		dup2(n, 0);
-		dup2(n, 1);
-		dup2(n, 2);
-		if (n > 2) {
-			close(n);
-		}
-		system(cmd);
-		exit(0);
-	}
-#else
-	system(cmd);
-#endif
-
-#endif
-}
-
-void set_redir_properties(void) {
-#if !NO_X11
-	char *e, *f, *t;
-	Atom a;
-	char num[32];
-	int i, p;
-
-	if (! dpy) {
-		return;
-	}
-
-	i = 0;
-	while (ts_services[i][0] != NULL) {
-		f = ts_services[i][0]; 
-		t = ts_services[i][1]; 
-		e = getenv(f);
-		if (!e || strstr(e, "DAEMON-") != e) {
-			i++;
-			continue;
-		}
-		p = atoi(e + strlen("DAEMON-"));
-		if (p <= 0) {
-			i++;
-			continue;
-		}
-		sprintf(num, "%d", p);
-		a = XInternAtom(dpy, t, False);
-		if (a != None) {
-			Window rwin = RootWindow(dpy, DefaultScreen(dpy));
-fprintf(stderr, "Set: %s %s %s -> %s\n", f, t, e, num);
-			XChangeProperty(dpy, rwin, a, XA_STRING, 8,
-			    PropModeReplace, (unsigned char *) num, strlen(num));
-			XSync(dpy, False);
-		}
-		i++;
-	}
-#endif
-}
-
-static void check_redir_services(void) {
-#if !NO_X11
-	Atom a;
-	char prop[513];
-	time_t tsd_last;
-	int restart = 0;
-	pid_t pid = 0;
-	int db = 0;
-	db = 0;
-
-	if (getenv("TS_REDIR_DEBUG")) {
-		db = 1;
-	}
-	if (db) fprintf(stderr, "check_redir_services in.\n");
-
-	if (! dpy) {
-		return;
-	}
-
-	a = XInternAtom(dpy, "TS_REDIR_PID", False);
-	if (a != None) {
-		prop[0] = '\0';
-		get_prop(prop, 512, a, None);
-		if (prop[0] != '\0') {
-			pid = (pid_t) atoi(prop);
-		}
-	}
-	if (db) fprintf(stderr, "TS_REDIR_PID Atom: %d = '%s'\n", (int) a, prop);
-
-	if (getenv("FD_TAG") && strcmp(getenv("FD_TAG"), "")) {
-		a = XInternAtom(dpy, "FD_TAG", False);
-		if (a != None) {
-			Window rwin = RootWindow(dpy, DefaultScreen(dpy));
-			char *tag = getenv("FD_TAG");
-			XChangeProperty(dpy, rwin, a, XA_STRING, 8,
-			    PropModeReplace, (unsigned char *)tag, strlen(tag));
-			XSync(dpy, False);
-		}
-		if (db) fprintf(stderr, "FD_TAG Atom: %d = '%s'\n", (int) a, prop);
-	}
-
-	prop[0] = '\0';
-	a = XInternAtom(dpy, "TS_REDIR", False);
-	if (a != None) {
-		get_prop(prop, 512, a, None);
-	}
-	if (db) fprintf(stderr, "TS_REDIR Atom: %d = '%s'\n", (int) a, prop);
-	if (prop[0] == '\0') {
-		rfbLog("TS_REDIR is empty, restarting...\n");
-		restart = 1;
-	} else {
-		tsd_last = (time_t) atoi(prop);
-		if (time(NULL) > tsd_last + 30) {
-			rfbLog("TS_REDIR seems dead for: %d sec, restarting...\n",
-			    time(NULL) - tsd_last);
-			restart = 1;
-		} else if (pid > 0 && time(NULL) > tsd_last + 6) {
-			if (kill(pid, 0) != 0) {
-				rfbLog("TS_REDIR seems dead via kill(%d, 0), restarting...\n",
-				    pid);
-				restart = 1;
-			}
-		}
-	}
-	if (restart) {
-
-		if (pid > 1) {
-			rfbLog("killing TS_REDIR_PID: %d\n", pid);
-			kill(pid, SIGTERM);
-			usleep(500*1000);
-			kill(pid, SIGKILL);
-		}
-		do_tsd();
-		if (db) fprintf(stderr, "check_redir_services restarted.\n");
-		return;
-	}
-
-	if (db) fprintf(stderr, "check_redir_services, no restart, calling set_redir_properties.\n");
-	set_redir_properties();
-#endif
-}
-
-void ssh_remote_tunnel(char *instr, int lport) {
-#ifndef WIN32
-	char *q, *cmd, *ssh;
-	char *s = strdup(instr);
-	int sleep = 300, disp = 0, sport = 0;
-	int rc, len, rport;
-
-	/* user at host:port:disp+secs */
-
-	/* +sleep */
-	q = strrchr(s, '+');
-	if (q) {
-		sleep = atoi(q+1);
-		if (sleep <= 0) {
-			sleep = 1;
-		}
-		*q = '\0';
-	}
-	/* :disp */
-	q = strrchr(s, ':');
-	if (q) {
-		disp = atoi(q+1);
-		*q = '\0';
-	}
-	
-	/* :sshport */
-	q = strrchr(s, ':');
-	if (q) {
-		sport = atoi(q+1);
-		*q = '\0';
-	}
-
-	if (getenv("SSH")) {
-		ssh = getenv("SSH");
-	} else {
-		ssh = "ssh";
-	}
-
-	len = 0;
-	len += strlen(ssh) + strlen(s) + 500;
-	cmd = (char *) malloc(len);
-
-	if (disp >= 0 && disp <= 200) {
-		rport = disp + 5900;
-	} else if (disp < 0) {
-		rport = -disp;
-	} else {
-		rport = disp;
-	}
-
-	if (sport > 0) {
-		sprintf(cmd, "%s -f -p %d -R '%d:localhost:%d' '%s' 'sleep %d'", ssh, sport, rport, lport, s, sleep);
-	} else {
-		sprintf(cmd, "%s -f       -R '%d:localhost:%d' '%s' 'sleep %d'", ssh,        rport, lport, s, sleep);
-	}
-
-	if (no_external_cmds || !cmd_ok("ssh")) {
-		rfbLogEnable(1);
-		rfbLog("cannot run external commands in -nocmds mode:\n");
-		rfbLog("   \"%s\"\n", cmd);
-		rfbLog("   exiting.\n");
-		clean_up_exit(1);
-	}
-
-	close_exec_fds();
-	fprintf(stderr, "\n");
-	rfbLog("running: %s\n", cmd);
-	rc = system(cmd);
-
-	if (rc != 0) {
-		free(cmd);
-		free(s);
-		rfbLog("ssh remote listen failed.\n");
-		clean_up_exit(1);
-	}
-
-	if (1) {
-		FILE *pipe;
-		int mypid = (int) getpid();
-		int bestpid = -1;
-		int best = -1;
-		char line[1024];
-		char *psef = "ps -ef";
-		char *psww = "ps wwwwwwaux";
-		char *ps = psef;
-		/* not portable... but it is really good to terminate the ssh when done. */
-		/* ps -ef | egrep 'ssh2.*-R.*5907:localhost:5900.*runge at celias.lbl.gov.*sleep 300' | grep -v grep | awk '{print $2}' */
-		if (strstr(UT.sysname, "Linux")) {
-			ps = psww;
-		} else if (strstr(UT.sysname, "BSD")) {
-			ps = psww;
-		} else if (strstr(UT.sysname, "Darwin")) {
-			ps = psww;
-		}
-		sprintf(cmd, "env COLUMNS=256 %s | egrep '%s.*-R *%d:localhost:%d.*%s.*sleep *%d' | grep -v grep | awk '{print $2}'", ps, ssh, rport, lport, s, sleep);
-		pipe = popen(cmd, "r");
-		if (pipe) {
-			while (fgets(line, 1024, pipe) != NULL) {
-				int p = atoi(line);
-				if (p > 0) {
-					int score;
-					if (p > mypid) 	{
-						score = p - mypid;
-					} else {
-						score = p - mypid + 32768;
-						if (score < 0) {
-							score = 32768;
-						}
-					}
-					if (best < 0 || score < best) {
-						best = score;
-						bestpid = p;
-					}
-				}
-			}
-			pclose(pipe);
-		}
-
-		if (bestpid != -1) {
-			ssh_pid = (pid_t) bestpid;
-			rfbLog("guessed ssh pid=%d, will terminate it on exit.\n", bestpid);
-		}
-	}
-
-	free(cmd);
-	free(s);
-#endif
-}
-
-/* 
- * check blacklist for OSs with tight shm limits.
- */
-static int limit_shm(void) {
-	int limit = 0;
-
-#ifndef WIN32
-	if (UT.sysname == NULL) {
-		return 0;
-	}
-	if (getenv("X11VNC_NO_LIMIT_SHM")) {
-		return 0;
-	}
-	if (!strcmp(UT.sysname, "SunOS")) {
-		char *r = UT.release;
-		if (*r == '5' && *(r+1) == '.') {
-			if (strchr("2345678", *(r+2)) != NULL) {
-				limit = 1;
-			}
-		}
-	} else if (!strcmp(UT.sysname, "Darwin")) {
-		limit = 1;
-	}
-	if (limit && ! quiet) {
-		fprintf(stderr, "reducing shm usage on %s %s (adding "
-		    "-onetile)\n", UT.sysname, UT.release);
-	}
-#endif
-	return limit;
-}
-
-
-/*
- * quick-n-dirty ~/.x11vncrc: each line (except # comments) is a cmdline option.
- */
-static int argc2 = 0;
-static char **argv2;
-
-static void check_rcfile(int argc, char **argv) {
-	int i, j, pwlast, enclast, norc = 0, argmax = 1024;
-	char *infile = NULL;
-	char rcfile[1024];
-	FILE *rc = NULL; 
-
-	for (i=1; i < argc; i++) {
-		if (!strcmp(argv[i], "-printgui")) {
-			fprintf(stdout, "%s", get_gui_code());
-			fflush(stdout);
-			exit(0);
-		}
-		if (!strcmp(argv[i], "-norc")) {
-			norc = 1;
-			got_norc = 1;
-		}
-		if (!strcmp(argv[i], "-QD")) {
-			norc = 1;
-		}
-		if (!strcmp(argv[i], "-rc")) {
-			if (i+1 >= argc) {
-				fprintf(stderr, "-rc option requires a "
-				    "filename\n");
-				exit(1);
-			} else {
-				infile = argv[i+1];
-			}
-		}
-	}
-	rc_norc = norc;
-	rc_rcfile = strdup("");
-	if (norc) {
-		;
-	} else if (infile != NULL) {
-		rc = fopen(infile, "r");
-		rc_rcfile = strdup(infile);
-		if (rc == NULL) {
-			fprintf(stderr, "could not open rcfile: %s\n", infile);
-			perror("fopen");
-			exit(1);
-		}
-	} else {
-		char *home = get_home_dir();
-		if (! home) {
-			norc = 1;
-		} else {
-			memset(rcfile, 0, sizeof(rcfile));
-			strncpy(rcfile, home, 500);
-			free(home);
-
-			strcat(rcfile, "/.x11vncrc");
-			infile = rcfile;
-			rc = fopen(rcfile, "r");
-			if (rc == NULL) {
-				norc = 1;
-			} else {
-				rc_rcfile = strdup(rcfile);
-				rc_rcfile_default = 1;
-			}
-		}
-	}
-
-	argv2 = (char **) malloc(argmax * sizeof(char *));
-	argv2[argc2++] = strdup(argv[0]);
-
-	if (! norc) {
-		char line[4096], parm[400], tmp[401];
-		char *buf, *tbuf;
-		struct stat sbuf;
-		int sz;
-
-		if (fstat(fileno(rc), &sbuf) != 0) {
-			fprintf(stderr, "problem with %s\n", infile);
-			perror("fstat");
-			exit(1);
-		}
-		sz = sbuf.st_size+1;	/* allocate whole file size */
-		if (sz < 1024) {
-			sz = 1024;
-		}
-
-		buf = (char *) malloc(sz);
-		buf[0] = '\0';
-
-		while (fgets(line, 4096, rc) != NULL) {
-			char *q, *p = line;
-			char c;
-			int cont = 0;
-
-			q = p;
-			c = '\0';
-			while (*q) {
-				if (*q == '#') {
-					if (c != '\\') {
-						*q = '\0';
-						break;
-					}
-				}
-				c = *q;
-				q++;
-			}
-
-			q = p;
-			c = '\0';
-			while (*q) {
-				if (*q == '\n') {
-					if (c == '\\') {
-						cont = 1;
-						*q = '\0';
-						*(q-1) = ' ';
-						break;
-					}
-					while (isspace((unsigned char) (*q))) {
-						*q = '\0';
-						if (q == p) {
-							break;
-						}
-						q--;
-					}
-					break;
-				}
-				c = *q;
-				q++;
-			}
-			if (q != p && !cont) {
-				if (*q == '\0') {
-					q--;
-				}
-				while (isspace((unsigned char) (*q))) {
-					*q = '\0';
-					if (q == p) {
-						break;
-					}
-					q--;
-				}
-			}
-
-			p = lblanks(p);
-
-			strncat(buf, p, sz - strlen(buf) - 1);
-			if (cont) {
-				continue;
-			}
-			if (buf[0] == '\0') {
-				continue;
-			}
-
-			i = 0;
-			q = buf;
-			while (*q) {
-				i++;
-				if (*q == '\n' || isspace((unsigned char) (*q))) {
-					break;
-				}
-				q++;
-			}
-
-			if (i >= 400) {
-				fprintf(stderr, "invalid rcfile line: %s/%s\n",
-				    p, buf);
-				exit(1);
-			}
-
-			if (sscanf(buf, "%s", parm) != 1) {
-				fprintf(stderr, "invalid rcfile line: %s\n", p);
-				exit(1);
-			}
-			if (parm[0] == '-') {
-				strncpy(tmp, parm, 400); 
-			} else {
-				tmp[0] = '-';
-				strncpy(tmp+1, parm, 400); 
-			}
-
-			if (strstr(tmp, "-loop") == tmp) {
-				if (! getenv("X11VNC_LOOP_MODE")) {
-					check_loop_mode(argc, argv, 1);
-					exit(0);
-				}
-			}
-
-			argv2[argc2++] = strdup(tmp);
-			if (argc2 >= argmax) {
-				fprintf(stderr, "too many rcfile options\n");
-				exit(1);
-			}
-			
-			p = buf;
-			p += strlen(parm);
-			p = lblanks(p);
-
-			if (*p == '\0') {
-				buf[0] = '\0';
-				continue;
-			}
-
-			tbuf = (char *) calloc(strlen(p) + 1, 1);
-
-			j = 0;
-			while (*p) {
-				if (*p == '\\' && *(p+1) == '#') {
-					;
-				} else {
-					tbuf[j++] = *p;
-				}
-				p++;
-			}
-
-			argv2[argc2++] = strdup(tbuf);
-			free(tbuf);
-			if (argc2 >= argmax) {
-				fprintf(stderr, "too many rcfile options\n");
-				exit(1);
-			}
-			buf[0] = '\0';
-		}
-		fclose(rc);
-		free(buf);
-	}
-	pwlast = 0;
-	enclast = 0;
-	for (i=1; i < argc; i++) {
-		argv2[argc2++] = strdup(argv[i]);
-
-		if (pwlast || !strcmp("-passwd", argv[i])
-		    || !strcmp("-viewpasswd", argv[i])) {
-			char *p = argv[i];		
-			if (pwlast) {
-				pwlast = 0;
-			} else {
-				pwlast = 1;
-			}
-			strzero(p);
-		}
-		if (enclast || !strcmp("-enc", argv[i])) {
-			char *q, *p = argv[i];		
-			if (enclast) {
-				enclast = 0;
-			} else {
-				enclast = 1;
-			}
-			q = strstr(p, "pw=");
-			if (q) {
-				strzero(q);
-			}
-		}
-		if (argc2 >= argmax) {
-			fprintf(stderr, "too many rcfile options\n");
-			exit(1);
-		}
-	}
-}
-
-static void immediate_switch_user(int argc, char* argv[]) {
-	int i, bequiet = 0;
-	for (i=1; i < argc; i++) {
-		if (strcmp(argv[i], "-inetd")) {
-			bequiet = 1;
-		}
-		if (strcmp(argv[i], "-quiet")) {
-			bequiet = 1;
-		}
-		if (strcmp(argv[i], "-q")) {
-			bequiet = 1;
-		}
-	}
-	for (i=1; i < argc; i++) {
-		char *u, *q;
-
-		if (strcmp(argv[i], "-users")) {
-			continue;
-		}
-		if (i == argc - 1) {
-			fprintf(stderr, "not enough arguments for: -users\n");
-			exit(1);
-		}
-		if (*(argv[i+1]) != '=') {
-			break;
-		}
-
-		/* wants an immediate switch: =bob */
-		u = strdup(argv[i+1]);
-		*u = '+';
-		q = strchr(u, '.');
-		if (q) {
-			user2group = (char **) malloc(2*sizeof(char *));
-			user2group[0] = strdup(u+1);
-			user2group[1] = NULL;
-			*q = '\0';
-		}
-		if (strstr(u, "+guess") == u) {
-			fprintf(stderr, "invalid user: %s\n", u+1);
-			exit(1);
-		}
-		if (!switch_user(u, 0)) {
-			fprintf(stderr, "Could not switch to user: %s\n", u+1);
-			exit(1);
-		} else {
-			if (!bequiet) {
-				fprintf(stderr, "Switched to user: %s\n", u+1);
-			}
-			started_as_root = 2;
-		}
-		free(u);
-		break;
-	}
-}
-
-static void quick_pw(char *str) {
-	char *p, *q;
-	char tmp[1024];
-	int db = 0;
-
-	if (db) fprintf(stderr, "quick_pw: %s\n", str);
-
-	if (! str || str[0] == '\0') {
-		exit(2);
-	}
-	if (str[0] != '%') {
-		exit(2);
-	}
-	/*
-	 * "%-" or "%stdin" means read one line from stdin.
-	 *
-	 * "%env" means it is in $UNIXPW env var.
-	 *
-	 * starting "%/" or "%." means read the first line from that file.
-	 *
-	 * "%%" or "%" means prompt user.
-	 *
-	 * otherwise: %user:pass
-	 */
-	if (!strcmp(str, "%-") || !strcmp(str, "%stdin")) {
-		if(fgets(tmp, 1024, stdin) == NULL) {
-			exit(2);
-		}
-		q = strdup(tmp);
-	} else if (!strcmp(str, "%env")) {
-		if (getenv("UNIXPW") == NULL) {
-			exit(2);
-		}
-		q = strdup(getenv("UNIXPW"));
-	} else if (!strcmp(str, "%%") || !strcmp(str, "%")) {
-		char *t, inp[1024];
-		fprintf(stdout, "username: ");
-		if(fgets(tmp, 128, stdin) == NULL) {
-			exit(2);
-		}
-		strcpy(inp, tmp);
-		t = strchr(inp, '\n');
-		if (t) {
-			*t = ':'; 
-		} else {
-			strcat(inp, ":");
-			
-		}
-		fprintf(stdout, "password: ");
-		/* test mode: no_external_cmds does not apply */
-		system("stty -echo");
-		if(fgets(tmp, 128, stdin) == NULL) {
-			fprintf(stdout, "\n");
-			system("stty echo");
-			exit(2);
-		}
-		system("stty echo");
-		fprintf(stdout, "\n");
-		strcat(inp, tmp);
-		q = strdup(inp);
-	} else if (str[1] == '/' || str[1] == '.') {
-		FILE *in = fopen(str+1, "r");
-		if (in == NULL) {
-			exit(2);
-		}
-		if(fgets(tmp, 1024, in) == NULL) {
-			exit(2);
-		}
-		fclose(in);
-		q = strdup(tmp);
-	} else {
-		q = strdup(str+1);
-	}
-	p = (char *) malloc(strlen(q) + 10);
-	strcpy(p, q);
-	if (strchr(p, '\n') == NULL) {
-		strcat(p, "\n");
-	}
-
-	if ((q = strchr(p, ':')) == NULL) {
-		exit(2);
-	}
-	*q = '\0';
-	if (db) fprintf(stderr, "'%s' '%s'\n", p, q+1);
-	if (unixpw_cmd) {
-		if (cmd_verify(p, q+1)) {
-			fprintf(stdout, "Y %s\n", p);
-			exit(0);
-		} else {
-			fprintf(stdout, "N %s\n", p);
-			exit(1);
-		}
-	} else if (unixpw_nis) {
-		if (crypt_verify(p, q+1)) {
-			fprintf(stdout, "Y %s\n", p);
-			exit(0);
-		} else {
-			fprintf(stdout, "N %s\n", p);
-			exit(1);
-		}
-	} else {
-		char *ucmd = getenv("UNIXPW_CMD");
-		if (su_verify(p, q+1, ucmd, NULL, NULL, 1)) {
-			fprintf(stdout, "Y %s\n", p);
-			exit(0);
-		} else {
-			fprintf(stdout, "N %s\n", p);
-			exit(1);
-		}
-	}
-	/* NOTREACHED */
-	exit(2);
-}
-
-static void print_settings(int try_http, int bg, char *gui_str) {
-
-	fprintf(stderr, "\n");
-	fprintf(stderr, "Settings:\n");
-	fprintf(stderr, " display:    %s\n", use_dpy ? use_dpy
-	    : "null");
-#if SMALL_FOOTPRINT < 2
-	fprintf(stderr, " authfile:   %s\n", auth_file ? auth_file
-	    : "null");
-	fprintf(stderr, " subwin:     0x%lx\n", subwin);
-	fprintf(stderr, " -sid mode:  %d\n", rootshift);
-	fprintf(stderr, " clip:       %s\n", clip_str ? clip_str
-	    : "null");
-	fprintf(stderr, " flashcmap:  %d\n", flash_cmap);
-	fprintf(stderr, " shiftcmap:  %d\n", shift_cmap);
-	fprintf(stderr, " force_idx:  %d\n", force_indexed_color);
-	fprintf(stderr, " cmap8to24:  %d\n", cmap8to24);
-	fprintf(stderr, " 8to24_opts: %s\n", cmap8to24_str ? cmap8to24_str
-	    : "null");
-	fprintf(stderr, " 24to32:     %d\n", xform24to32);
-	fprintf(stderr, " visual:     %s\n", visual_str ? visual_str
-	    : "null");
-	fprintf(stderr, " overlay:    %d\n", overlay);
-	fprintf(stderr, " ovl_cursor: %d\n", overlay_cursor);
-	fprintf(stderr, " scaling:    %d %.4f %.4f\n", scaling, scale_fac_x, scale_fac_y);
-	fprintf(stderr, " viewonly:   %d\n", view_only);
-	fprintf(stderr, " shared:     %d\n", shared);
-	fprintf(stderr, " conn_once:  %d\n", connect_once);
-	fprintf(stderr, " timeout:    %d\n", first_conn_timeout);
-	fprintf(stderr, " ping:       %d\n", ping_interval);
-	fprintf(stderr, " inetd:      %d\n", inetd);
-	fprintf(stderr, " tightfilexfer:   %d\n", tightfilexfer);
-	fprintf(stderr, " http:       %d\n", try_http);
-	fprintf(stderr, " connect:    %s\n", client_connect
-	    ? client_connect : "null");
-	fprintf(stderr, " connectfile %s\n", client_connect_file
-	    ? client_connect_file : "null");
-	fprintf(stderr, " vnc_conn:   %d\n", vnc_connect);
-	fprintf(stderr, " allow:      %s\n", allow_list ? allow_list
-	    : "null");
-	fprintf(stderr, " input:      %s\n", allowed_input_str
-	    ? allowed_input_str : "null");
-	fprintf(stderr, " passfile:   %s\n", passwdfile ? passwdfile
-	    : "null");
-	fprintf(stderr, " unixpw:     %d\n", unixpw);
-	fprintf(stderr, " unixpw_lst: %s\n", unixpw_list ? unixpw_list:"null");
-	fprintf(stderr, " ssl:        %s\n", openssl_pem ? openssl_pem:"null");
-	fprintf(stderr, " ssldir:     %s\n", ssl_certs_dir ? ssl_certs_dir:"null");
-	fprintf(stderr, " ssltimeout  %d\n", ssl_timeout_secs);
-	fprintf(stderr, " sslverify:  %s\n", ssl_verify ? ssl_verify:"null");
-	fprintf(stderr, " stunnel:    %d\n", use_stunnel);
-	fprintf(stderr, " accept:     %s\n", accept_cmd ? accept_cmd
-	    : "null");
-	fprintf(stderr, " accept:     %s\n", afteraccept_cmd ? afteraccept_cmd
-	    : "null");
-	fprintf(stderr, " gone:       %s\n", gone_cmd ? gone_cmd
-	    : "null");
-	fprintf(stderr, " users:      %s\n", users_list ? users_list
-	    : "null");
-	fprintf(stderr, " using_shm:  %d\n", using_shm);
-	fprintf(stderr, " flipbytes:  %d\n", flip_byte_order);
-	fprintf(stderr, " onetile:    %d\n", single_copytile);
-	fprintf(stderr, " solid:      %s\n", solid_str
-	    ? solid_str : "null");
-	fprintf(stderr, " blackout:   %s\n", blackout_str
-	    ? blackout_str : "null");
-	fprintf(stderr, " xinerama:   %d\n", xinerama);
-	fprintf(stderr, " xtrap:      %d\n", xtrap_input);
-	fprintf(stderr, " xrandr:     %d\n", xrandr);
-	fprintf(stderr, " xrandrmode: %s\n", xrandr_mode ? xrandr_mode
-	    : "null");
-	fprintf(stderr, " padgeom:    %s\n", pad_geometry
-	    ? pad_geometry : "null");
-	fprintf(stderr, " logfile:    %s\n", logfile ? logfile
-	    : "null");
-	fprintf(stderr, " logappend:  %d\n", logfile_append);
-	fprintf(stderr, " flag:       %s\n", flagfile ? flagfile
-	    : "null");
-	fprintf(stderr, " rm_flag:    %s\n", rm_flagfile ? rm_flagfile
-	    : "null");
-	fprintf(stderr, " rc_file:    \"%s\"\n", rc_rcfile ? rc_rcfile
-	    : "null");
-	fprintf(stderr, " norc:       %d\n", rc_norc);
-	fprintf(stderr, " dbg:        %d\n", crash_debug);
-	fprintf(stderr, " bg:         %d\n", bg);
-	fprintf(stderr, " mod_tweak:  %d\n", use_modifier_tweak);
-	fprintf(stderr, " isolevel3:  %d\n", use_iso_level3);
-	fprintf(stderr, " xkb:        %d\n", use_xkb_modtweak);
-	fprintf(stderr, " skipkeys:   %s\n",
-	    skip_keycodes ? skip_keycodes : "null");
-	fprintf(stderr, " sloppykeys: %d\n", sloppy_keys);
-	fprintf(stderr, " skip_dups:  %d\n", skip_duplicate_key_events);
-	fprintf(stderr, " addkeysyms: %d\n", add_keysyms);
-	fprintf(stderr, " xkbcompat:  %d\n", xkbcompat);
-	fprintf(stderr, " clearmods:  %d\n", clear_mods);
-	fprintf(stderr, " remap:      %s\n", remap_file ? remap_file
-	    : "null");
-	fprintf(stderr, " norepeat:   %d\n", no_autorepeat);
-	fprintf(stderr, " norepeatcnt:%d\n", no_repeat_countdown);
-	fprintf(stderr, " nofb:       %d\n", nofb);
-	fprintf(stderr, " watchbell:  %d\n", watch_bell);
-	fprintf(stderr, " watchsel:   %d\n", watch_selection);
-	fprintf(stderr, " watchprim:  %d\n", watch_primary);
-	fprintf(stderr, " seldir:     %s\n", sel_direction ?
-	    sel_direction : "null");
-	fprintf(stderr, " cursor:     %d\n", show_cursor);
-	fprintf(stderr, " multicurs:  %d\n", show_multiple_cursors);
-	fprintf(stderr, " curs_mode:  %s\n", multiple_cursors_mode
-	    ? multiple_cursors_mode : "null");
-	fprintf(stderr, " arrow:      %d\n", alt_arrow);
-	fprintf(stderr, " xfixes:     %d\n", use_xfixes);
-	fprintf(stderr, " alphacut:   %d\n", alpha_threshold);
-	fprintf(stderr, " alphafrac:  %.2f\n", alpha_frac);
-	fprintf(stderr, " alpharemove:%d\n", alpha_remove);
-	fprintf(stderr, " alphablend: %d\n", alpha_blend);
-	fprintf(stderr, " cursorshape:%d\n", cursor_shape_updates);
-	fprintf(stderr, " cursorpos:  %d\n", cursor_pos_updates);
-	fprintf(stderr, " xwarpptr:   %d\n", use_xwarppointer);
-	fprintf(stderr, " alwaysinj:  %d\n", always_inject);
-	fprintf(stderr, " buttonmap:  %s\n", pointer_remap
-	    ? pointer_remap : "null");
-	fprintf(stderr, " dragging:   %d\n", show_dragging);
-	fprintf(stderr, " ncache:     %d\n", ncache);
-	fprintf(stderr, " wireframe:  %s\n", wireframe_str ?
-	    wireframe_str : WIREFRAME_PARMS);
-	fprintf(stderr, " wirecopy:   %s\n", wireframe_copyrect ?
-	    wireframe_copyrect : wireframe_copyrect_default);
-	fprintf(stderr, " scrollcopy: %s\n", scroll_copyrect ?
-	    scroll_copyrect : scroll_copyrect_default);
-	fprintf(stderr, "  scr_area:  %d\n", scrollcopyrect_min_area);
-	fprintf(stderr, "  scr_skip:  %s\n", scroll_skip_str ?
-	    scroll_skip_str : scroll_skip_str0);
-	fprintf(stderr, "  scr_inc:   %s\n", scroll_good_str ?
-	    scroll_good_str : scroll_good_str0);
-	fprintf(stderr, "  scr_keys:  %s\n", scroll_key_list_str ?
-	    scroll_key_list_str : "null");
-	fprintf(stderr, "  scr_term:  %s\n", scroll_term_str ?
-	    scroll_term_str : "null");
-	fprintf(stderr, "  scr_keyrep: %s\n", max_keyrepeat_str ?
-	    max_keyrepeat_str : "null");
-	fprintf(stderr, "  scr_parms: %s\n", scroll_copyrect_str ?
-	    scroll_copyrect_str : SCROLL_COPYRECT_PARMS);
-	fprintf(stderr, " fixscreen:  %s\n", screen_fixup_str ?
-	    screen_fixup_str : "null");
-	fprintf(stderr, " noxrecord:  %d\n", noxrecord);
-	fprintf(stderr, " grabbuster: %d\n", grab_buster);
-	fprintf(stderr, " ptr_mode:   %d\n", pointer_mode);
-	fprintf(stderr, " inputskip:  %d\n", ui_skip);
-	fprintf(stderr, " speeds:     %s\n", speeds_str
-	    ? speeds_str : "null");
-	fprintf(stderr, " wmdt:       %s\n", wmdt_str
-	    ? wmdt_str : "null");
-	fprintf(stderr, " debug_ptr:  %d\n", debug_pointer);
-	fprintf(stderr, " debug_key:  %d\n", debug_keyboard);
-	fprintf(stderr, " defer:      %d\n", defer_update);
-	fprintf(stderr, " waitms:     %d\n", waitms);
-	fprintf(stderr, " wait_ui:    %.2f\n", wait_ui);
-	fprintf(stderr, " nowait_bog: %d\n", !wait_bog);
-	fprintf(stderr, " slow_fb:    %.2f\n", slow_fb);
-	fprintf(stderr, " xrefresh:   %.2f\n", xrefresh);
-	fprintf(stderr, " readtimeout: %d\n", rfbMaxClientWait/1000);
-	fprintf(stderr, " take_naps:  %d\n", take_naps);
-	fprintf(stderr, " sb:         %d\n", screen_blank);
-	fprintf(stderr, " fbpm:       %d\n", !watch_fbpm);
-	fprintf(stderr, " dpms:       %d\n", !watch_dpms);
-	fprintf(stderr, " xdamage:    %d\n", use_xdamage);
-	fprintf(stderr, "  xd_area:   %d\n", xdamage_max_area);
-	fprintf(stderr, "  xd_mem:    %.3f\n", xdamage_memory);
-	fprintf(stderr, " sigpipe:    %s\n", sigpipe
-	    ? sigpipe : "null");
-	fprintf(stderr, " threads:    %d\n", use_threads);
-	fprintf(stderr, " fs_frac:    %.2f\n", fs_frac);
-	fprintf(stderr, " gaps_fill:  %d\n", gaps_fill);
-	fprintf(stderr, " grow_fill:  %d\n", grow_fill);
-	fprintf(stderr, " tile_fuzz:  %d\n", tile_fuzz);
-	fprintf(stderr, " snapfb:     %d\n", use_snapfb);
-	fprintf(stderr, " rawfb:      %s\n", raw_fb_str
-	    ? raw_fb_str : "null");
-	fprintf(stderr, " pipeinput:  %s\n", pipeinput_str
-	    ? pipeinput_str : "null");
-	fprintf(stderr, " gui:        %d\n", launch_gui);
-	fprintf(stderr, " gui_mode:   %s\n", gui_str
-	    ? gui_str : "null");
-	fprintf(stderr, " noremote:   %d\n", !accept_remote_cmds);
-	fprintf(stderr, " unsafe:     %d\n", !safe_remote_only);
-	fprintf(stderr, " privremote: %d\n", priv_remote);
-	fprintf(stderr, " safer:      %d\n", more_safe);
-	fprintf(stderr, " nocmds:     %d\n", no_external_cmds);
-	fprintf(stderr, " deny_all:   %d\n", deny_all);
-	fprintf(stderr, " pid:        %d\n", getpid());
-	fprintf(stderr, "\n");
-#endif
-}
-
-
-static void check_loop_mode(int argc, char* argv[], int force) {
-	int i;
-	int loop_mode = 0, loop_sleep = 2000, loop_max = 0;
-
-	if (force) {
-		loop_mode = 1;
-	}
-	for (i=1; i < argc; i++) {
-		char *p = argv[i];
-		if (strstr(p, "--") == p) {
-			p++;
-		}
-		if (strstr(p, "-loop") == p) {
-			char *q;
-			loop_mode = 1;
-			if ((q = strchr(p, ',')) != NULL) {
-				loop_max = atoi(q+1);
-				*q = '\0';
-			}
-			if (strstr(p, "-loopbg") == p) {
-				set_env("X11VNC_LOOP_MODE_BG", "1");
-				loop_sleep = 500;
-			}
-			
-			q = strpbrk(p, "0123456789");
-			if (q) {
-				loop_sleep = atoi(q);
-				if (loop_sleep <= 0) {
-					loop_sleep = 20;
-				}
-			}
-		}
-	}
-	if (loop_mode && getenv("X11VNC_LOOP_MODE") == NULL) {
-#if LIBVNCSERVER_HAVE_FORK
-		char **argv2;
-		int k, i = 1;
-
-		set_env("X11VNC_LOOP_MODE", "1");
-		argv2 = (char **) malloc((argc+1)*sizeof(char *));
-
-		for (k=0; k < argc+1; k++) {
-			argv2[k] = NULL;
-			if (k < argc) {
-				argv2[k] = argv[k];
-			}
-		}
-		while (1) {
-			int status;
-			pid_t p;
-			fprintf(stderr, "\n --- x11vnc loop: %d ---\n\n", i++);
-			fflush(stderr);
-			usleep(500 * 1000);
-			if ((p = fork()) > 0)  {
-				fprintf(stderr, " --- x11vnc loop: waiting "
-				    "for: %d\n\n", p);
-				wait(&status);
-			} else if (p == -1) {
-				fprintf(stderr, "could not fork\n");
-				perror("fork");
-				exit(1);
-			} else {
-				/* loop mode: no_external_cmds does not apply */
-				execvp(argv[0], argv2); 
-				exit(1);
-			}
-
-			if (loop_max > 0 && i > loop_max) {
-				fprintf(stderr, "\n --- x11vnc loop: did %d"
-				    " done. ---\n\n", loop_max);
-				break;
-			}
-			
-			fprintf(stderr, "\n --- x11vnc loop: sleeping %d ms "
-			    "---\n\n", loop_sleep);
-			usleep(loop_sleep * 1000);
-		}
-		exit(0);
-#else
-		fprintf(stderr, "fork unavailable, cannot do -loop mode\n");
-		exit(1);
-#endif
-	}
-}
-
-extern int appshare_main(int argc, char* argv[]);
-
-static void check_appshare_mode(int argc, char* argv[]) {
-#ifndef WIN32
-	int i;
-
-	for (i=1; i < argc; i++) {
-		char *p = argv[i];
-		if (strstr(p, "--") == p) {
-			p++;
-		}
-		if (strstr(p, "-appshare") == p) {
-			appshare_main(argc, argv);
-			exit(0);
-		}
-	}
-#endif
-}
-
-static void store_homedir_passwd(char *file) {
-#ifndef WIN32
-	char str1[32], str2[32], *p, *h, *f;
-	struct stat sbuf;
-
-	str1[0] = '\0';
-	str2[0] = '\0';
-
-	/* storepasswd */
-	if (no_external_cmds || !cmd_ok("storepasswd")) {
-		fprintf(stderr, "-nocmds cannot be used with -storepasswd\n");
-		exit(1);
-	}
-
-	fprintf(stderr, "Enter VNC password: ");
-	system("stty -echo");
-	if (fgets(str1, 32, stdin) == NULL) {
-		perror("fgets");
-		system("stty echo");
-		exit(1);
-	}
-	fprintf(stderr, "\n");
-
-	fprintf(stderr, "Verify password:    ");
-	if (fgets(str2, 32, stdin) == NULL) {
-		perror("fgets");
-		system("stty echo");
-		exit(1);
-	}
-	fprintf(stderr, "\n");
-	system("stty echo");
-
-	if ((p = strchr(str1, '\n')) != NULL) {
-		*p = '\0';
-	}
-	if ((p = strchr(str2, '\n')) != NULL) {
-		*p = '\0';
-	}
-	if (strcmp(str1, str2)) {
-		fprintf(stderr, "** passwords differ.\n");
-		exit(1);
-	}
-	if (str1[0] == '\0') {
-		fprintf(stderr, "** no password supplied.\n");
-		exit(1);
-	}
-
-	if (file != NULL) {
-		f = file;
-	} else {
-		
-		h = getenv("HOME");
-		if (! h) {
-			fprintf(stderr, "** $HOME not set.\n");
-			exit(1);
-		}
-
-		f = (char *) malloc(strlen(h) + strlen("/.vnc/passwd") + 1);
-		sprintf(f, "%s/.vnc", h);
-
-		if (stat(f, &sbuf) != 0) {
-			if (mkdir(f, 0755) != 0) {
-				fprintf(stderr, "** could not create directory %s\n", f);
-				perror("mkdir");
-				exit(1);
-			}
-		} else if (! S_ISDIR(sbuf.st_mode)) {
-			fprintf(stderr, "** not a directory %s\n", f);
-			exit(1);
-		}
-
-		sprintf(f, "%s/.vnc/passwd", h);
-	}
-	fprintf(stderr, "Write password to %s?  [y]/n ", f);
-
-	if (fgets(str2, 32, stdin) == NULL) {
-		perror("fgets");
-		exit(1);
-	}
-	if (str2[0] == 'n' || str2[0] == 'N') {
-		fprintf(stderr, "not creating password.\n");
-		exit(1);
-	}
-
-	if (rfbEncryptAndStorePasswd(str1, f) != 0) {
-		fprintf(stderr, "** error creating password: %s\n", f);
-		perror("storepasswd");
-		exit(1);
-	}
-	if (stat(f, &sbuf) != 0) {
-		fprintf(stderr, "** error creating password: %s\n", f);
-		perror("stat");
-		exit(1);
-	}
-	fprintf(stdout, "Password written to: %s\n", f);
-	exit(0);
-#endif
-}
-
-void ncache_beta_tester_message(void) {
-
-char msg[] = 
-"\n"
-"******************************************************************************\n"
-"\n"
-"Hello!  Exciting News!!\n"
-"\n"
-"You have been selected at random to beta-test the x11vnc '-ncache' VNC\n"
-"client-side pixel caching feature!\n"
-"\n"
-"This scheme stores pixel data offscreen on the VNC viewer side for faster\n"
-"retrieval.  It should work with any VNC viewer.\n"
-"\n"
-"This method requires much testing and so we hope you will try it out and\n"
-"perhaps even report back your observations.  However, if you do not want\n"
-"to test or use the feature, run x11vnc like this:\n"
-"\n"
-"    x11vnc -noncache ...\n"
-"\n"
-"Your current setting is: -ncache %d\n"
-"\n"
-"The feature needs additional testing because we want to have x11vnc\n"
-"performance enhancements on by default.  Otherwise, only a relative few\n"
-"would notice and use the -ncache option (e.g. the wireframe and scroll\n"
-"detection features are on by default).  A couple things to note:\n"
-"\n"
-"    1) It uses a large amount of RAM (on both viewer and server sides)\n"
-"\n"
-"    2) You can actually see the cached pixel data if you scroll down\n"
-"       to it in your viewer; adjust your viewer's size to hide it.\n"
-"\n"
-"More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching\n"
-"\n"
-"waiting for connections:\n"
-;
-
-char msg2[] = 
-"\n"
-"******************************************************************************\n"
-"Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?\n"
-"\n"
-"The scheme stores pixel data offscreen on the VNC viewer side for faster\n"
-"retrieval.  It should work with any VNC viewer.  Try it by running:\n"
-"\n"
-"    x11vnc -ncache 10 ...\n"
-"\n"
-"One can also add -ncache_cr for smooth 'copyrect' window motion.\n"
-"More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching\n"
-"\n"
-;
-
-	if (raw_fb_str && !macosx_console) {
-		return;
-	}
-	if (quiet) {
-		return;
-	}
-	if (remote_direct) {
-		return;
-	}
-	if (nofb) {
-		return;
-	}
-#ifdef NO_NCACHE
-	return;
-#endif
-
-	if (ncache == 0) {
-		fprintf(stderr, "%s", msg2);
-		ncache0 = ncache = 0;
-	} else {
-		fprintf(stderr, msg, ncache);
-	}
-}
-
-#define	SHOW_NO_PASSWORD_WARNING \
-	(!got_passwd && !got_rfbauth && (!got_passwdfile || !passwd_list) \
-	    && !query_cmd && !remote_cmd && !unixpw && !got_gui_pw \
-	    && ! ssl_verify && !inetd && !terminal_services_daemon)
-
-static void do_sleepin(char *sleep) {
-	int n1, n2, nt;
-	double f1, f2, ft;
-
-	if (strchr(sleep, '-')) {
-		double s = atof(strchr(sleep, '-')+1); 
-		if (sscanf(sleep, "%d-%d", &n1, &n2) == 2) {
-			if (n1 > n2) {
-				nt = n1;
-				n1 = n2;
-				n2 = nt;
-			}
-			s = n1 + rfac() * (n2 - n1);
-		} else if (sscanf(sleep, "%lf-%lf", &f1, &f2) == 2) {
-			if (f1 > f2) {
-				ft = f1;
-				f1 = f2;
-				f2 = ft;
-			}
-			s = f1 + rfac() * (f2 - f1);
-		}
-		if (getenv("DEBUG_SLEEPIN")) fprintf(stderr, "sleepin: %f secs\n", s);
-		usleep( (int) (1000*1000*s) );
-	} else {
-		n1 = atoi(sleep);
-		if (getenv("DEBUG_SLEEPIN")) fprintf(stderr, "sleepin: %d secs\n", n1);
-		if (n1 > 0) {
-			usleep(1000*1000*n1);
-		}
-	}
-}
-
-static void check_guess_auth_file(void)  {
-	if (!strcasecmp(auth_file, "guess")) {
-		char line[4096], *cmd, *q, *disp = use_dpy ? use_dpy: "";
-		FILE *p;
-		int n;
-		if (!program_name) {
-			rfbLog("-auth guess: no program_name found.\n");
-			clean_up_exit(1);
-		}
-		if (strpbrk(program_name, " \t\r\n")) {
-			rfbLog("-auth guess: whitespace in program_name '%s'\n", program_name);
-			clean_up_exit(1);
-		}
-		if (no_external_cmds || !cmd_ok("findauth")) {
-			rfbLog("-auth guess: cannot run external commands in -nocmds mode:\n");
-			clean_up_exit(1);
-		}
-
-		cmd = (char *)malloc(100 + strlen(program_name) + strlen(disp));
-		sprintf(cmd, "%s -findauth %s -env _D_XDM=1", program_name, disp);
-		p = popen(cmd, "r");
-		if (!p) {
-			rfbLog("-auth guess: could not run cmd '%s'\n", cmd);
-			clean_up_exit(1);
-		}
-		memset(line, 0, sizeof(line));
-		n = fread(line, 1, sizeof(line), p);
-		pclose(p);
-		q = strrchr(line, '\n');
-		if (q) *q = '\0';
-		if (!strcmp(disp, "")) {
-			disp = getenv("DISPLAY");
-			if (!disp) {
-				disp = "unset";
-			}
-		}
-		if (strstr(line, "XAUTHORITY=") != line && !getenv("FD_XDM")) {
-			if (use_dpy == NULL || strstr(use_dpy, "cmd=FIND") == NULL) {
-				if (getuid() == 0 || geteuid() == 0) {
-					char *q = strstr(cmd, "_D_XDM=1");
-					if (q) {
-						*q = 'F';
-						rfbLog("-auth guess: failed for display='%s'\n", disp);
-						rfbLog("-auth guess: since we are root, retrying with FD_XDM=1\n");
-						p = popen(cmd, "r");
-						if (!p) {
-							rfbLog("-auth guess: could not run cmd '%s'\n", cmd);
-							clean_up_exit(1);
-						}
-						memset(line, 0, sizeof(line));
-						n = fread(line, 1, sizeof(line), p);
-						pclose(p);
-						q = strrchr(line, '\n');
-						if (q) *q = '\0';
-					}
-				}
-			}
-		}
-		if (!strcmp(line, "")) {
-			rfbLog("-auth guess: failed for display='%s'\n", disp);
-			clean_up_exit(1);
-		} else if (strstr(line, "XAUTHORITY=") != line) {
-			rfbLog("-auth guess: failed. '%s' for display='%s'\n", line, disp);
-			clean_up_exit(1);
-		} else if (!strcmp(line, "XAUTHORITY=")) {
-			rfbLog("-auth guess: using default XAUTHORITY for display='%s'\n", disp);
-			q = getenv("XAUTHORITY");
-			if (q) {
-				*(q-2) = '_';	/* yow */
-			}
-			auth_file = NULL;
-		} else {
-			rfbLog("-auth guess: using '%s' for disp='%s'\n", line, disp);
-			auth_file = strdup(line + strlen("XAUTHORITY="));
-		}
-	}
-}
-
-extern int is_decimal(char *);
-
-int main(int argc, char* argv[]) {
-
-	int i, len, tmpi;
-	int ev, er, maj, min;
-	char *arg;
-	int remote_sync = 0;
-	char *remote_cmd = NULL;
-	char *query_cmd  = NULL;
-	int query_retries = 0;
-	double query_delay = 0.5;
-	char *query_match  = NULL;
-	char *gui_str = NULL;
-	int got_gui_pw = 0;
-	int pw_loc = -1, got_passwd = 0, got_rfbauth = 0, nopw = NOPW;
-	int got_viewpasswd = 0, got_localhost = 0, got_passwdfile = 0;
-	int vpw_loc = -1;
-	int dt = 0, bg = 0;
-	int got_rfbwait = 0;
-	int got_httpdir = 0, try_http = 0;
-	int orig_use_xdamage = use_xdamage;
-	int http_oneport_msg = 0;
-	XImage *fb0 = NULL;
-	int ncache_msg = 0;
-	char *got_rfbport_str = NULL;
-	int got_rfbport_pos = -1;
-	int got_tls = 0;
-	int got_inetd = 0;
-	int got_noxrandr = 0;
-
-	/* used to pass args we do not know about to rfbGetScreen(): */
-	int argc_vnc_max = 1024;
-	int argc_vnc = 1; char *argv_vnc[2048];
-
-	/* check for -loop mode: */
-	check_loop_mode(argc, argv, 0);
-
-	/* check for -appshare mode: */
-	check_appshare_mode(argc, argv);
-
-	dtime0(&x11vnc_start);
-
-	for (i=1; i < argc; i++) {
-		if (!strcmp(argv[i], "-inetd")) {
-			got_inetd = 1;
-		}
-	}
-
-	if (!getuid() || !geteuid()) {
-		started_as_root = 1;
-		if (0 && !got_inetd) {
-			rfbLog("getuid: %d  geteuid: %d\n", getuid(), geteuid());
-		}
-
-		/* check for '-users =bob' */
-		immediate_switch_user(argc, argv);
-	}
-
-	for (i=0; i < 2048; i++) {
-		argv_vnc[i] = NULL;
-	}
-
-	argv_vnc[0] = strdup(argv[0]);
-	program_name = strdup(argv[0]);
-	program_pid = (int) getpid();
-
-	solid_default = strdup(solid_default);	/* for freeing with -R */
-
-	len = 0;
-	for (i=1; i < argc; i++) {
-		len += strlen(argv[i]) + 4 + 1;
-	}
-	program_cmdline = (char *) malloc(len+1);
-	program_cmdline[0] = '\0';
-	for (i=1; i < argc; i++) {
-		char *s = argv[i];
-		if (program_cmdline[0]) {
-			strcat(program_cmdline, " ");
-		}
-		if (*s == '-') {
-			strcat(program_cmdline, s);
-		} else {
-			strcat(program_cmdline, "{{");
-			strcat(program_cmdline, s);
-			strcat(program_cmdline, "}}");
-		}
-	}
-
-	for (i=0; i<ICON_MODE_SOCKS; i++) {
-		icon_mode_socks[i] = -1;
-	}
-
-	check_rcfile(argc, argv);
-	/* kludge for the new array argv2 set in check_rcfile() */
-#	define argc argc2
-#	define argv argv2
-
-#	define CHECK_ARGC if (i >= argc-1) { \
-		fprintf(stderr, "not enough arguments for: %s\n", arg); \
-		exit(1); \
-	}
-
-	/*
-	 * do a quick check for parameters that apply to "utility"
-	 * commands, i.e. ones that do not run the server.
-	 */
-	for (i=1; i < argc; i++) {
-		arg = argv[i];
-		if (strstr(arg, "--") == arg) {
-			arg++;
-		}
-		if (!strcmp(arg, "-ssldir")) {
-			CHECK_ARGC
-			ssl_certs_dir = strdup(argv[++i]);
-		}
-	}
-
-	/*
-	 * do a quick check for -env parameters
-	 */
-	for (i=1; i < argc; i++) {
-		char *p, *q;
-		arg = argv[i];
-		if (strstr(arg, "--") == arg) {
-			arg++;
-		}
-		if (!strcmp(arg, "-env")) {
-			CHECK_ARGC
-			p = strdup(argv[++i]);
-			q = strchr(p, '=');
-			if (! q) {
-				fprintf(stderr, "no -env '=' found: %s\n", p);
-				exit(1);
-			} else {
-				*q = '\0';
-			}
-			set_env(p, q+1);
-			free(p);
-		}
-	}
-
-	for (i=1; i < argc; i++) {
-		/* quick-n-dirty --option handling. */
-		arg = argv[i];
-		if (strstr(arg, "--") == arg) {
-			arg++;
-		}
-
-		if (!strcmp(arg, "-display")) {
-			CHECK_ARGC
-			use_dpy = strdup(argv[++i]);
-			if (strstr(use_dpy, "WAIT")) {
-				extern char find_display[];
-				extern char create_display[];
-				if (strstr(use_dpy, "cmd=FINDDISPLAY-print")) {
-					fprintf(stdout, "%s", find_display);
-					exit(0);
-				}
-				if (strstr(use_dpy, "cmd=FINDCREATEDISPLAY-print")) {
-					fprintf(stdout, "%s", create_display);
-					exit(0);
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-reopen")) {
-			char *str = getenv("X11VNC_REOPEN_DISPLAY");
-			if (str) {
-				int rmax = atoi(str);
-				if (rmax > 0) {
-					set_env("X11VNC_REOPEN_DISPLAY", str);
-				}
-			} else {
-				set_env("X11VNC_REOPEN_DISPLAY", "1");
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-find")) {
-			use_dpy = strdup("WAIT:cmd=FINDDISPLAY");
-			continue;
-		}
-		if (!strcmp(arg, "-finddpy") || strstr(arg, "-listdpy") == arg) {
-			int ic = 0;
-			use_dpy = strdup("WAIT:cmd=FINDDISPLAY-run");
-			if (argc > i+1) {
-				set_env("X11VNC_USER", argv[i+1]);
-				fprintf(stdout, "X11VNC_USER=%s\n", getenv("X11VNC_USER"));
-			}
-			if (strstr(arg, "-listdpy") == arg) {
-				set_env("FIND_DISPLAY_ALL", "1");
-			}
-			wait_for_client(&ic, NULL, 0);
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-findauth")) {
-			got_findauth = 1;
-			if (argc > i+1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					set_env("FINDAUTH_DISPLAY", argv[i+1]);
-					i++;
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-create")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvfb");
-			continue;
-		}
-		if (!strcmp(arg, "-create_xsrv")) {
-			CHECK_ARGC
-			use_dpy = (char *) malloc(strlen(argv[i+1])+100); 
-			sprintf(use_dpy, "WAIT:cmd=FINDCREATEDISPLAY-%s", argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-xdummy")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy");
-			continue;
-		}
-		if (!strcmp(arg, "-xdummy_xvfb")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb");
-			continue;
-		}
-		if (!strcmp(arg, "-xvnc")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvnc");
-			continue;
-		}
-		if (!strcmp(arg, "-xvnc_redirect")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvnc.redirect");
-			continue;
-		}
-		if (!strcmp(arg, "-redirect")) {
-			char *q, *t, *t0 = "WAIT:cmd=FINDDISPLAY-vnc_redirect";
-			CHECK_ARGC
-			t = (char *) malloc(strlen(t0) + strlen(argv[++i]) + 2);
-			q = strrchr(argv[i], ':');
-			if (q) *q = ' ';
-			sprintf(t, "%s=%s", t0, argv[i]);
-			use_dpy = t;
-			continue;
-		}
-		if (!strcmp(arg, "-auth") || !strcmp(arg, "-xauth")) {
-			CHECK_ARGC
-			auth_file = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-N")) {
-			display_N = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-autoport")) {
-			CHECK_ARGC
-			auto_port = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-reflect")) {
-			CHECK_ARGC
-			raw_fb_str = (char *) malloc(4 + strlen(argv[i+1]) + 1);
-			sprintf(raw_fb_str, "vnc:%s", argv[++i]);
-			shared = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-tsd")) {
-			CHECK_ARGC
-			terminal_services_daemon = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-id") || !strcmp(arg, "-sid")) {
-			CHECK_ARGC
-			if (!strcmp(arg, "-sid")) {
-				rootshift = 1;
-			} else {
-				rootshift = 0;
-			}
-			i++;
-			if (!strcmp("pick", argv[i])) {
-				if (started_as_root) {
-					fprintf(stderr, "unsafe: %s pick\n",
-					    arg);
-					exit(1);
-				} else if (! pick_windowid(&subwin)) {
-					fprintf(stderr, "invalid %s pick\n",
-					    arg);
-					exit(1);
-				}
-			} else if (! scan_hexdec(argv[i], &subwin)) {
-				fprintf(stderr, "invalid %s arg: %s\n", arg,
-				    argv[i]);
-				exit(1);
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-waitmapped")) {
-			subwin_wait_mapped = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-clip")) {
-			CHECK_ARGC
-			clip_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-flashcmap")) {
-			flash_cmap = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-shiftcmap")) {
-			CHECK_ARGC
-			shift_cmap = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-notruecolor")) {
-			force_indexed_color = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-advertise_truecolor")) {
-			advertise_truecolor = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					if (strstr(s, "reset")) {
-						advertise_truecolor_reset = 1;
-					}
-					i++;
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-overlay")) {
-			overlay = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-overlay_nocursor")) {
-			overlay = 1;
-			overlay_cursor = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-overlay_yescursor")) {
-			overlay = 1;
-			overlay_cursor = 2;
-			continue;
-		}
-		if (!strcmp(arg, "-8to24")) {
-#if !SKIP_8TO24
-			cmap8to24 = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					cmap8to24_str = strdup(s);
-					i++;
-				}
-			}
-#endif
-			continue;
-		}
-		if (!strcmp(arg, "-24to32")) {
-			xform24to32 = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-visual")) {
-			CHECK_ARGC
-			visual_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scale")) {
-			CHECK_ARGC
-			scale_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-geometry")) {
-			CHECK_ARGC
-			scale_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scale_cursor")) {
-			CHECK_ARGC
-			scale_cursor_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-viewonly")) {
-			view_only = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noviewonly")) {
-			view_only = 0;
-			got_noviewonly = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-shared")) {
-			shared = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noshared")) {
-			shared = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-once")) {
-			connect_once = 1;
-			got_connect_once = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-many") || !strcmp(arg, "-forever")) {
-			connect_once = 0;
-			continue;
-		}
-		if (strstr(arg, "-loop") == arg) {
-			;	/* handled above */
-			continue;
-		}
-		if (strstr(arg, "-appshare") == arg) {
-			;	/* handled above */
-			continue;
-		}
-		if (strstr(arg, "-freeze_when_obscured") == arg) {
-			freeze_when_obscured = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-timeout")) {
-			CHECK_ARGC
-			first_conn_timeout = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-sleepin")) {
-			CHECK_ARGC
-			do_sleepin(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-users")) {
-			CHECK_ARGC
-			users_list = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-inetd")) {
-			inetd = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-notightfilexfer")) {
-			tightfilexfer = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-tightfilexfer")) {
-			tightfilexfer = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-http")) {
-			try_http = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-http_ssl")) {
-			try_http = 1;
-			http_ssl = 1;
-			got_tls++;
-			continue;
-		}
-		if (!strcmp(arg, "-avahi") || !strcmp(arg, "-mdns") || !strcmp(arg, "-zeroconf")) {
-			avahi = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-connect") ||
-		    !strcmp(arg, "-connect_or_exit") ||
-		    !strcmp(arg, "-coe")) {
-			CHECK_ARGC
-			if (!strcmp(arg, "-connect_or_exit")) {
-				connect_or_exit = 1;
-			} else if (!strcmp(arg, "-coe")) {
-				connect_or_exit = 1;
-			}
-			if (strchr(argv[++i], '/') && !strstr(argv[i], "repeater://")) {
-				struct stat sb;
-				client_connect_file = strdup(argv[i]);
-				if (stat(client_connect_file, &sb) != 0) {
-					FILE* f = fopen(client_connect_file, "w");
-					if (f != NULL) fclose(f);
-				}
-			} else {
-				client_connect = strdup(argv[i]);
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-proxy")) {
-			CHECK_ARGC
-			connect_proxy = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-vncconnect")) {
-			vnc_connect = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-novncconnect")) {
-			vnc_connect = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-allow")) {
-			CHECK_ARGC
-			allow_list = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-localhost")) {
-			allow_list = strdup("127.0.0.1");
-			got_localhost = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-unixsock")) {
-			CHECK_ARGC
-			unix_sock = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-listen6")) {
-			CHECK_ARGC
-#if X11VNC_IPV6
-			listen_str6 = strdup(argv[++i]);
-#else
-			++i;
-#endif
-			continue;
-		}
-		if (!strcmp(arg, "-nolookup")) {
-			host_lookup = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-6")) {
-#if X11VNC_IPV6
-			ipv6_listen = 1;
-			got_ipv6_listen = 1;
-#endif
-			continue;
-		}
-		if (!strcmp(arg, "-no6")) {
-#if X11VNC_IPV6
-			ipv6_listen = 0;
-			got_ipv6_listen = 0;
-#endif
-			continue;
-		}
-		if (!strcmp(arg, "-noipv6")) {
-			noipv6 = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noipv4")) {
-			noipv4 = 1;
-			continue;
-		}
-
-		if (!strcmp(arg, "-input")) {
-			CHECK_ARGC
-			allowed_input_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-grabkbd")) {
-			grab_kbd = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-grabptr")) {
-			grab_ptr = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ungrabboth")) {
-			ungrab_both = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-grabalways")) {
-			grab_kbd = 1;
-			grab_ptr = 1;
-			grab_always = 1;
-			continue;
-		}
-#ifdef ENABLE_GRABLOCAL
-		if (!strcmp(arg, "-grablocal")) {
-			CHECK_ARGC
-			grab_local = atoi(argv[++i]);
-			continue;
-		}
-#endif
-		if (!strcmp(arg, "-viewpasswd")) {
-			vpw_loc = i;
-			CHECK_ARGC
-			viewonly_passwd = strdup(argv[++i]);
-			got_viewpasswd = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-passwdfile")) {
-			CHECK_ARGC
-			passwdfile = strdup(argv[++i]);
-			got_passwdfile = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-svc") || !strcmp(arg, "-service")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvfb");
-			unixpw = 1;
-			users_list = strdup("unixpw=");
-			use_openssl = 1;
-			openssl_pem = strdup("SAVE");
-			continue;
-		}
-		if (!strcmp(arg, "-svc_xdummy")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy");
-			unixpw = 1;
-			users_list = strdup("unixpw=");
-			use_openssl = 1;
-			openssl_pem = strdup("SAVE");
-			continue;
-		}
-		if (!strcmp(arg, "-svc_xdummy_xvfb")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb");
-			unixpw = 1;
-			users_list = strdup("unixpw=");
-			use_openssl = 1;
-			openssl_pem = strdup("SAVE");
-			continue;
-		}
-		if (!strcmp(arg, "-svc_xvnc")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvnc");
-			unixpw = 1;
-			users_list = strdup("unixpw=");
-			use_openssl = 1;
-			openssl_pem = strdup("SAVE");
-			continue;
-		}
-		if (!strcmp(arg, "-xdmsvc") || !strcmp(arg, "-xdm_service")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp");
-			unixpw = 1;
-			users_list = strdup("unixpw=");
-			use_openssl = 1;
-			openssl_pem = strdup("SAVE");
-			continue;
-		}
-		if (!strcmp(arg, "-sshxdmsvc")) {
-			use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp");
-			allow_list = strdup("127.0.0.1");
-			got_localhost = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-unixpw_system_greeter")) {
-			unixpw_system_greeter = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-unixpw_cmd")
-		    || !strcmp(arg, "-unixpw_cmd_unsafe")) {
-			CHECK_ARGC
-			unixpw_cmd = strdup(argv[++i]);
-			unixpw = 1;
-			if (strstr(arg, "_unsafe")) {
-				/* hidden option for testing. */
-				set_env("UNIXPW_DISABLE_SSL", "1");
-				set_env("UNIXPW_DISABLE_LOCALHOST", "1");
-			}
-			continue;
-		}
-		if (strstr(arg, "-unixpw") == arg) {
-			unixpw = 1;
-			if (strstr(arg, "-unixpw_nis")) {
-				unixpw_nis = 1;
-			}
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					unixpw_list = strdup(s);
-					i++;
-				}
-				if (s[0] == '%') {
-					unixpw_list = NULL;
-					quick_pw(s);
-					exit(2);
-				}
-			}
-			if (strstr(arg, "_unsafe")) {
-				/* hidden option for testing. */
-				set_env("UNIXPW_DISABLE_SSL", "1");
-				set_env("UNIXPW_DISABLE_LOCALHOST", "1");
-			}
-			continue;
-		}
-		if (strstr(arg, "-nounixpw") == arg) {
-			unixpw = 0;
-			unixpw_nis = 0;
-			if (unixpw_list) {
-				unixpw_list = NULL;
-			}
-			if (unixpw_cmd) {
-				unixpw_cmd = NULL;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-vencrypt")) {
-			char *s;
-			CHECK_ARGC
-			s = strdup(argv[++i]);
-			got_tls++;
-			if (strstr(s, "never")) {
-				vencrypt_mode = VENCRYPT_NONE;
-			} else if (strstr(s, "support")) {
-				vencrypt_mode = VENCRYPT_SUPPORT;
-			} else if (strstr(s, "only")) {
-				vencrypt_mode = VENCRYPT_SOLE;
-			} else if (strstr(s, "force")) {
-				vencrypt_mode = VENCRYPT_FORCE;
-			} else {
-				fprintf(stderr, "invalid %s arg: %s\n", arg, s);
-				exit(1);
-			}
-			if (strstr(s, "nodh")) {
-				vencrypt_kx = VENCRYPT_NODH;
-			} else if (strstr(s, "nox509")) {
-				vencrypt_kx = VENCRYPT_NOX509;
-			}
-			if (strstr(s, "newdh")) {
-				create_fresh_dhparams = 1;
-			}
-			if (strstr(s, "noplain")) {
-				vencrypt_enable_plain_login = 0;
-			} else if (strstr(s, "plain")) {
-				vencrypt_enable_plain_login = 1;
-			}
-			free(s);
-			continue;
-		}
-		if (!strcmp(arg, "-anontls")) {
-			char *s;
-			CHECK_ARGC
-			s = strdup(argv[++i]);
-			got_tls++;
-			if (strstr(s, "never")) {
-				anontls_mode = ANONTLS_NONE;
-			} else if (strstr(s, "support")) {
-				anontls_mode = ANONTLS_SUPPORT;
-			} else if (strstr(s, "only")) {
-				anontls_mode = ANONTLS_SOLE;
-			} else if (strstr(s, "force")) {
-				anontls_mode = ANONTLS_FORCE;
-			} else {
-				fprintf(stderr, "invalid %s arg: %s\n", arg, s);
-				exit(1);
-			}
-			if (strstr(s, "newdh")) {
-				create_fresh_dhparams = 1;
-			}
-			free(s);
-			continue;
-		}
-		if (!strcmp(arg, "-sslonly")) {
-			vencrypt_mode = VENCRYPT_NONE;
-			anontls_mode = ANONTLS_NONE;
-			got_tls++;
-			continue;
-		}
-		if (!strcmp(arg, "-dhparams")) {
-			CHECK_ARGC
-			dhparams_file = strdup(argv[++i]);
-			got_tls++;
-			continue;
-		}
-		if (!strcmp(arg, "-nossl")) {
-			use_openssl = 0;
-			openssl_pem = NULL;
-			got_tls = -1000;
-			continue;
-		}
-		if (!strcmp(arg, "-ssl")) {
-			use_openssl = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					if (!strcmp(s, "ADH")) {
-						openssl_pem = strdup("ANON");
-					} else if (!strcmp(s, "ANONDH")) {
-						openssl_pem = strdup("ANON");
-					} else if (!strcmp(s, "TMP")) {
-						openssl_pem = NULL;
-					} else {
-						openssl_pem = strdup(s);
-					}
-					i++;
-				} else {
-					openssl_pem = strdup("SAVE");
-				}
-			} else {
-				openssl_pem = strdup("SAVE");
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-enc")) {
-			use_openssl = 1;
-			CHECK_ARGC
-			enc_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-http_oneport")) {
-			http_oneport_msg = 1;
-			use_openssl = 1;
-			enc_str = strdup("none");
-			continue;
-		}
-		if (!strcmp(arg, "-ssltimeout")) {
-			CHECK_ARGC
-			ssl_timeout_secs = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-sslnofail")) {
-			ssl_no_fail = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ssldir")) {
-			CHECK_ARGC
-			ssl_certs_dir = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-sslverify")) {
-			CHECK_ARGC
-			ssl_verify = strdup(argv[++i]);
-			got_tls++;
-			continue;
-		}
-		if (!strcmp(arg, "-sslCRL")) {
-			CHECK_ARGC
-			ssl_crl = strdup(argv[++i]);
-			got_tls++;
-			continue;
-		}
-		if (!strcmp(arg, "-sslGenCA")) {
-			char *cdir = NULL;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					cdir = strdup(s);
-					i++;
-				}
-			}
-			sslGenCA(cdir);
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-sslGenCert")) {
-			char *ty, *nm = NULL;
-			if (i >= argc-1) {
-				fprintf(stderr, "Must be:\n");
-				fprintf(stderr, "          x11vnc -sslGenCert server ...\n");
-				fprintf(stderr, "or        x11vnc -sslGenCert client ...\n");
-				exit(1);
-			}
-			ty = argv[i+1];
-			if (strcmp(ty, "server") && strcmp(ty, "client")) {
-				fprintf(stderr, "Must be:\n");
-				fprintf(stderr, "          x11vnc -sslGenCert server ...\n");
-				fprintf(stderr, "or        x11vnc -sslGenCert client ...\n");
-				exit(1);
-			}
-			if (i < argc-2) {
-				nm = argv[i+2];
-			}
-			sslGenCert(ty, nm);
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-sslEncKey")) {
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				sslEncKey(s, 0);
-			}
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-sslCertInfo")) {
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				sslEncKey(s, 1);
-			}
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-sslDelCert")) {
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				sslEncKey(s, 2);
-			}
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-sslScripts")) {
-			sslScripts();
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-stunnel")) {
-			use_stunnel = 1;
-			got_tls = -1000;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					if (!strcmp(s, "TMP")) {
-						stunnel_pem = NULL;
-					} else {
-						stunnel_pem = strdup(s);
-					}
-					i++;
-				} else {
-					stunnel_pem = strdup("SAVE");
-				}
-			} else {
-				stunnel_pem = strdup("SAVE");
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-stunnel3")) {
-			use_stunnel = 3;
-			got_tls = -1000;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					if (!strcmp(s, "TMP")) {
-						stunnel_pem = NULL;
-					} else {
-						stunnel_pem = strdup(s);
-					}
-					i++;
-				} else {
-					stunnel_pem = strdup("SAVE");
-				}
-			} else {
-				stunnel_pem = strdup("SAVE");
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-https")) {
-			https_port_num = 0;
-			try_http = 1;
-			got_tls++;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					https_port_num = atoi(s);
-					i++;
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-httpsredir")) {
-			https_port_redir = -1;
-			got_tls++;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					https_port_redir = atoi(s);
-					i++;
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-nopw")) {
-			nopw = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ssh")) {
-			CHECK_ARGC
-			ssh_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-usepw")) {
-			usepw = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-storepasswd")) {
-			if (argc == i+1) {
-				store_homedir_passwd(NULL);
-				exit(0);
-			}
-			if (argc == i+2) {
-				store_homedir_passwd(argv[i+1]);
-				exit(0);
-			}
-			if (argc >= i+4 || rfbEncryptAndStorePasswd(argv[i+1],
-			    argv[i+2]) != 0) {
-				perror("storepasswd");
-				fprintf(stderr, "-storepasswd failed for file: %s\n",
-				    argv[i+2]);
-				exit(1);
-			} else {
-				fprintf(stderr, "stored passwd in file: %s\n",
-				    argv[i+2]);
-				exit(0);
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-showrfbauth")) {
-			if (argc >= i+2) {
-				char *f = argv[i+1];
-				char *s = rfbDecryptPasswdFromFile(f);
-				if (!s) {
-					perror("showrfbauth");
-					fprintf(stderr, "rfbDecryptPasswdFromFile failed: %s\n", f);
-					exit(1);
-				}
-				fprintf(stdout, "rfbDecryptPasswdFromFile file: %s\n", f);
-				fprintf(stdout, "rfbDecryptPasswdFromFile pass: %s\n", s);
-			}
-			exit(0);
-		}
-		if (!strcmp(arg, "-accept")) {
-			CHECK_ARGC
-			accept_cmd = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-afteraccept")) {
-			CHECK_ARGC
-			afteraccept_cmd = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-gone")) {
-			CHECK_ARGC
-			gone_cmd = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-noshm")) {
-			using_shm = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-flipbyteorder")) {
-			flip_byte_order = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-onetile")) {
-			single_copytile = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-solid")) {
-			use_solid_bg = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					solid_str = strdup(s);
-					i++;
-				}
-			}
-			if (! solid_str) {
-				solid_str = strdup(solid_default);
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-blackout")) {
-			CHECK_ARGC
-			blackout_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-xinerama")) {
-			xinerama = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noxinerama")) {
-			xinerama = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-xtrap")) {
-			xtrap_input = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-xrandr")) {
-			xrandr = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (known_xrandr_mode(s)) {
-					xrandr_mode = strdup(s);
-					i++;
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-noxrandr")) {
-			xrandr = 0;
-			xrandr_maybe = 0;
-			got_noxrandr = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-rotate")) {
-			CHECK_ARGC
-			rotating_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-padgeom")
-		    || !strcmp(arg, "-padgeometry")) {
-			CHECK_ARGC
-			pad_geometry = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-o") || !strcmp(arg, "-logfile")) {
-			CHECK_ARGC
-			logfile_append = 0;
-			logfile = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-oa") || !strcmp(arg, "-logappend")) {
-			CHECK_ARGC
-			logfile_append = 1;
-			logfile = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-flag")) {
-			CHECK_ARGC
-			flagfile = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-rmflag")) {
-			CHECK_ARGC
-			rm_flagfile = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-rc")) {
-			i++;	/* done above */
-			continue;
-		}
-		if (!strcmp(arg, "-norc")) {
-			;	/* done above */
-			continue;
-		}
-		if (!strcmp(arg, "-env")) {
-			i++;	/* done above */
-			continue;
-		}
-		if (!strcmp(arg, "-prog")) {
-			CHECK_ARGC
-			if (program_name) {
-				free(program_name);
-			}
-			program_name = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-h") || !strcmp(arg, "-help")) {
-			print_help(0);
-			continue;
-		}
-		if (!strcmp(arg, "-?") || !strcmp(arg, "-opts")) {
-			print_help(1);
-			continue;
-		}
-		if (!strcmp(arg, "-V") || !strcmp(arg, "-version")) {
-			fprintf(stdout, "x11vnc: %s\n", lastmod);
-			exit(0);
-			continue;
-		}
-		if (!strcmp(arg, "-license") ||
-		    !strcmp(arg, "-copying") || !strcmp(arg, "-warranty")) {
-			print_license();
-			continue;
-		}
-		if (!strcmp(arg, "-dbg")) {
-			crash_debug = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nodbg")) {
-			crash_debug = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-q") || !strcmp(arg, "-quiet")) {
-			quiet = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noquiet")) {
-			quiet = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-v") || !strcmp(arg, "-verbose")) {
-			verbose = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-bg") || !strcmp(arg, "-background")) {
-#if LIBVNCSERVER_HAVE_SETSID
-			bg = 1;
-			opts_bg = bg;
-#else
-			if (!got_inetd) {
-				fprintf(stderr, "warning: -bg mode not supported.\n");
-			}
-#endif
-			continue;
-		}
-		if (!strcmp(arg, "-modtweak")) {
-			use_modifier_tweak = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nomodtweak")) {
-			use_modifier_tweak = 0;
-			got_nomodtweak = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-isolevel3")) {
-			use_iso_level3 = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-xkb")) {
-			use_modifier_tweak = 1;
-			use_xkb_modtweak = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noxkb")) {
-			use_xkb_modtweak = 0;
-			got_noxkb = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-capslock")) {
-			watch_capslock = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-skip_lockkeys")) {
-			skip_lockkeys = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noskip_lockkeys")) {
-			skip_lockkeys = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-xkbcompat")) {
-			xkbcompat = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-skip_keycodes")) {
-			CHECK_ARGC
-			skip_keycodes = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-sloppy_keys")) {
-			sloppy_keys++;
-			continue;
-		}
-		if (!strcmp(arg, "-skip_dups")) {
-			skip_duplicate_key_events = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noskip_dups")) {
-			skip_duplicate_key_events = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-add_keysyms")) {
-			add_keysyms++;
-			continue;
-		}
-		if (!strcmp(arg, "-noadd_keysyms")) {
-			add_keysyms = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-clear_mods")) {
-			clear_mods = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-clear_keys")) {
-			clear_mods = 2;
-			continue;
-		}
-		if (!strcmp(arg, "-clear_all")) {
-			clear_mods = 3;
-			continue;
-		}
-		if (!strcmp(arg, "-remap")) {
-			CHECK_ARGC
-			remap_file = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-norepeat")) {
-			no_autorepeat = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (*s == '-') {
-					s++;
-				}
-				if (isdigit((unsigned char) (*s))) {
-					no_repeat_countdown = atoi(argv[++i]);
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-repeat")) {
-			no_autorepeat = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nofb")) {
-			nofb = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nobell")) {
-			watch_bell = 0;
-			sound_bell = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nosel")) {
-			watch_selection = 0;
-			watch_primary = 0;
-			watch_clipboard = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-noprimary")) {
-			watch_primary = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nosetprimary")) {
-			set_primary = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-noclipboard")) {
-			watch_clipboard = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nosetclipboard")) {
-			set_clipboard = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-seldir")) {
-			CHECK_ARGC
-			sel_direction = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-cursor")) {
-			show_cursor = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (known_cursors_mode(s)) {
-					multiple_cursors_mode = strdup(s);
-					i++;
-					if (!strcmp(s, "none")) {
-						show_cursor = 0;
-					}
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-nocursor")) { 
-			multiple_cursors_mode = strdup("none");
-			show_cursor = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-cursor_drag")) { 
-			cursor_drag_changes = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nocursor_drag")) { 
-			cursor_drag_changes = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-arrow")) {
-			CHECK_ARGC
-			alt_arrow = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-xfixes")) { 
-			use_xfixes = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noxfixes")) { 
-			use_xfixes = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-alphacut")) {
-			CHECK_ARGC
-			alpha_threshold = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-alphafrac")) {
-			CHECK_ARGC
-			alpha_frac = atof(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-alpharemove")) {
-			alpha_remove = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noalphablend")) {
-			alpha_blend = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nocursorshape")) {
-			cursor_shape_updates = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-cursorpos")) {
-			cursor_pos_updates = 1;
-			got_cursorpos = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nocursorpos")) {
-			cursor_pos_updates = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-xwarppointer")) {
-			use_xwarppointer = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noxwarppointer")) {
-			use_xwarppointer = 0;
-			got_noxwarppointer = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-always_inject")) {
-			always_inject = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-buttonmap")) {
-			CHECK_ARGC
-			pointer_remap = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-nodragging")) {
-			show_dragging = 0;
-			continue;
-		}
-#ifndef NO_NCACHE
-		if (!strcmp(arg, "-ncache") || !strcmp(arg, "-nc")) {
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (s[0] != '-') {
-					ncache = atoi(s);
-					i++;
-				} else {
-					ncache = ncache_default;
-				}
-			} else {
-				ncache = ncache_default;
-			}
-			if (ncache % 2 != 0) {
-				ncache++;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-noncache") || !strcmp(arg, "-nonc")) {
-			ncache = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_cr") || !strcmp(arg, "-nc_cr")) {
-			ncache_copyrect = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_no_moveraise") || !strcmp(arg, "-nc_no_moveraise")) {
-			ncache_wf_raises = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_no_dtchange") || !strcmp(arg, "-nc_no_dtchange")) {
-			ncache_dt_change = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_no_rootpixmap") || !strcmp(arg, "-nc_no_rootpixmap")) {
-			ncache_xrootpmap = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_keep_anims") || !strcmp(arg, "-nc_keep_anims")) {
-			ncache_keep_anims = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_old_wm") || !strcmp(arg, "-nc_old_wm")) {
-			ncache_old_wm = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-ncache_pad") || !strcmp(arg, "-nc_pad")) {
-			CHECK_ARGC
-			ncache_pad = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-debug_ncache")) {
-			ncdb++;
-			continue;
-		}
-#endif
-		if (!strcmp(arg, "-wireframe")
-		    || !strcmp(arg, "-wf")) {
-			wireframe = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (*s != '-') {
-					wireframe_str = strdup(argv[++i]);
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-nowireframe")
-		    || !strcmp(arg, "-nowf")) {
-			wireframe = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nowireframelocal")
-		    || !strcmp(arg, "-nowfl")) {
-			wireframe_local = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-wirecopyrect")
-		    || !strcmp(arg, "-wcr")) {
-			CHECK_ARGC
-			set_wirecopyrect_mode(argv[++i]);
-			got_wirecopyrect = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nowirecopyrect")
-		    || !strcmp(arg, "-nowcr")) {
-			set_wirecopyrect_mode("never");
-			continue;
-		}
-		if (!strcmp(arg, "-debug_wireframe")
-		    || !strcmp(arg, "-dwf")) {
-			debug_wireframe++;
-			continue;
-		}
-		if (!strcmp(arg, "-scrollcopyrect")
-		    || !strcmp(arg, "-scr")) {
-			CHECK_ARGC
-			set_scrollcopyrect_mode(argv[++i]);
-			got_scrollcopyrect = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noscrollcopyrect")
-		    || !strcmp(arg, "-noscr")) {
-			set_scrollcopyrect_mode("never");
-			continue;
-		}
-		if (!strcmp(arg, "-scr_area")) {
-			int tn;
-			CHECK_ARGC
-			tn = atoi(argv[++i]);
-			if (tn >= 0) {
-				scrollcopyrect_min_area = tn;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-scr_skip")) {
-			CHECK_ARGC
-			scroll_skip_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scr_inc")) {
-			CHECK_ARGC
-			scroll_good_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scr_keys")) {
-			CHECK_ARGC
-			scroll_key_list_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scr_term")) {
-			CHECK_ARGC
-			scroll_term_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scr_keyrepeat")) {
-			CHECK_ARGC
-			max_keyrepeat_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-scr_parms")) {
-			CHECK_ARGC
-			scroll_copyrect_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-fixscreen")) {
-			CHECK_ARGC
-			screen_fixup_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-debug_scroll")
-		    || !strcmp(arg, "-ds")) {
-			debug_scroll++;
-			continue;
-		}
-		if (!strcmp(arg, "-noxrecord")) {
-			noxrecord = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-pointer_mode")
-		    || !strcmp(arg, "-pm")) {
-			char *p, *s;
-			CHECK_ARGC
-			s = argv[++i];
-			if ((p = strchr(s, ':')) != NULL) {
-				ui_skip = atoi(p+1);
-				if (! ui_skip) ui_skip = 1;
-				*p = '\0';
-			}
-			if (atoi(s) < 1 || atoi(s) > pointer_mode_max) {
-				if (!got_inetd) {
-					rfbLog("pointer_mode out of range 1-%d: %d\n",
-					    pointer_mode_max, atoi(s));
-				}
-			} else {
-				pointer_mode = atoi(s);
-				got_pointer_mode = pointer_mode;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-input_skip")) {
-			CHECK_ARGC
-			ui_skip = atoi(argv[++i]);
-			if (! ui_skip) ui_skip = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-allinput")) {
-			all_input = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noallinput")) {
-			all_input = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-input_eagerly")) {
-			handle_events_eagerly = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noinput_eagerly")) {
-			handle_events_eagerly = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-speeds")) {
-			CHECK_ARGC
-			speeds_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-wmdt")) {
-			CHECK_ARGC
-			wmdt_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-debug_pointer")
-		    || !strcmp(arg, "-dp")) {
-			debug_pointer++;
-			continue;
-		}
-		if (!strcmp(arg, "-debug_keyboard")
-		    || !strcmp(arg, "-dk")) {
-			debug_keyboard++;
-			continue;
-		}
-		if (!strcmp(arg, "-debug_xdamage")) {
-			debug_xdamage++;
-			continue;
-		}
-		if (!strcmp(arg, "-defer")) {
-			CHECK_ARGC
-			defer_update = atoi(argv[++i]);
-			got_defer = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-setdefer")) {
-			CHECK_ARGC
-			set_defer = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-wait")) {
-			CHECK_ARGC
-			waitms = atoi(argv[++i]);
-			got_waitms = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-extra_fbur")) {
-			CHECK_ARGC
-			extra_fbur = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-wait_ui")) {
-			CHECK_ARGC
-			wait_ui = atof(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-nowait_bog")) {
-			wait_bog = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-slow_fb")) {
-			CHECK_ARGC
-			slow_fb = atof(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-xrefresh")) {
-			CHECK_ARGC
-			xrefresh = atof(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-readtimeout")) {
-			CHECK_ARGC
-			rfbMaxClientWait = atoi(argv[++i]) * 1000;
-			continue;
-		}
-		if (!strcmp(arg, "-ping")) {
-			CHECK_ARGC
-			ping_interval = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-nap")) {
-			take_naps = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nonap")) {
-			take_naps = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-sb")) {
-			CHECK_ARGC
-			screen_blank = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-nofbpm")) {
-			watch_fbpm = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-fbpm")) {
-			watch_fbpm = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-nodpms")) {
-			watch_dpms = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-dpms")) {
-			watch_dpms = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-forcedpms")) {
-			force_dpms = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-clientdpms")) {
-			client_dpms = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noserverdpms")) {
-			no_ultra_dpms = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-noultraext")) {
-			no_ultra_ext = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-chatwindow")) {
-			chat_window = 1;
-			if (argc_vnc + 1 < argc_vnc_max) {
-				if (!got_inetd) {
-					rfbLog("setting '-rfbversion 3.6' for -chatwindow.\n");
-				}
-				argv_vnc[argc_vnc++] = strdup("-rfbversion");
-				argv_vnc[argc_vnc++] = strdup("3.6");
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-xdamage")) {
-			use_xdamage++;
-			continue;
-		}
-		if (!strcmp(arg, "-noxdamage")) {
-			use_xdamage = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-xd_area")) {
-			int tn;
-			CHECK_ARGC
-			tn = atoi(argv[++i]);
-			if (tn >= 0) {
-				xdamage_max_area = tn;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-xd_mem")) {
-			double f;
-			CHECK_ARGC
-			f = atof(argv[++i]);
-			if (f >= 0.0) {
-				xdamage_memory = f;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-sigpipe") || !strcmp(arg, "-sig")) {
-			CHECK_ARGC
-			if (known_sigpipe_mode(argv[++i])) {
-				sigpipe = strdup(argv[i]);
-			} else {
-				fprintf(stderr, "invalid -sigpipe arg: %s, must"
-				    " be \"ignore\" or \"exit\"\n", argv[i]);
-				exit(1);
-			}
-			continue;
-		}
-#if LIBVNCSERVER_HAVE_LIBPTHREAD
-		if (!strcmp(arg, "-threads")) {
-#if defined(X11VNC_THREADED)
-			use_threads = 1;
-#else
-			if (getenv("X11VNC_THREADED")) {
-				use_threads = 1;
-			} else if (1) {
-				/* we re-enable it due to threaded mode bugfixes. */
-				use_threads = 1;
-			} else {
-				if (!got_inetd) {
-					rfbLog("\n");
-					rfbLog("The -threads mode is unstable and not tested or maintained.\n");
-					rfbLog("It is disabled in the source code.  If you really need\n");
-					rfbLog("the feature you can reenable it at build time by setting\n");
-					rfbLog("-DX11VNC_THREADED in CPPFLAGS. Or set X11VNC_THREADED=1\n");
-					rfbLog("in your runtime environment.\n");
-					rfbLog("\n");
-					usleep(500*1000);
-				}
-			}
-#endif
-			continue;
-		}
-		if (!strcmp(arg, "-nothreads")) {
-			use_threads = 0;
-			continue;
-		}
-#endif
-		if (!strcmp(arg, "-fs")) {
-			CHECK_ARGC
-			fs_frac = atof(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-gaps")) {
-			CHECK_ARGC
-			gaps_fill = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-grow")) {
-			CHECK_ARGC
-			grow_fill = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-fuzz")) {
-			CHECK_ARGC
-			tile_fuzz = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-debug_tiles")
-		    || !strcmp(arg, "-dbt")) {
-			debug_tiles++;
-			continue;
-		}
-		if (!strcmp(arg, "-debug_grabs")) {
-			debug_grabs++;
-			continue;
-		}
-		if (!strcmp(arg, "-debug_sel")) {
-			debug_sel++;
-			continue;
-		}
-		if (!strcmp(arg, "-grab_buster")) {
-			grab_buster++;
-			continue;
-		}
-		if (!strcmp(arg, "-nograb_buster")) {
-			grab_buster = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-snapfb")) {
-			use_snapfb = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-rand")) {
-			/* equiv. to -nopw -rawfb rand for quick tests */
-			raw_fb_str = strdup("rand");
-			nopw = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-rawfb")) {
-			CHECK_ARGC
-			raw_fb_str = strdup(argv[++i]);
-			if (strstr(raw_fb_str, "vnc:") == raw_fb_str) {
-				shared = 1;
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-freqtab")) {
-			CHECK_ARGC
-			freqtab = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-pipeinput")) {
-			CHECK_ARGC
-			pipeinput_str = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-macnodim")) {
-			macosx_nodimming = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-macnosleep")) {
-			macosx_nosleep = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-macnosaver")) {
-			macosx_noscreensaver = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-macnowait")) {
-			macosx_wait_for_switch = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-macwheel")) {
-			CHECK_ARGC
-			macosx_mouse_wheel_speed = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-macnoswap")) {
-			macosx_swap23 = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-macnoresize")) {
-			macosx_resize = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-maciconanim")) {
-			CHECK_ARGC
-			macosx_icon_anim_time = atoi(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-macmenu")) {
-			macosx_ncache_macmenu = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-macuskbd")) {
-			macosx_us_kbd = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-macnoopengl")) {
-			macosx_no_opengl = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-macnorawfb")) {
-			macosx_no_rawfb = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-gui")) {
-			launch_gui = 1;
-			if (i < argc-1) {
-				char *s = argv[i+1];
-				if (*s != '-') {
-					gui_str = strdup(s);
-					if (strstr(gui_str, "setp")) {
-						got_gui_pw = 1;
-					}
-					i++;
-				}
-			}
-			continue;
-		}
-		if (!strcmp(arg, "-remote") || !strcmp(arg, "-R")
-		    || !strcmp(arg, "-r") || !strcmp(arg, "-remote-control")) {
-			char *str;
-			CHECK_ARGC
-			i++;
-			str = argv[i];
-			if (*str == '-') {
-				/* accidental leading '-' */
-				str++;
-			}
-			if (!strcmp(str, "ping")) {
-				query_cmd = strdup(str);
-			} else {
-				remote_cmd = strdup(str);
-			}
-			if (remote_cmd && strchr(remote_cmd, ':') == NULL) {
-			    /* interpret -R -scale 3/4 at least */
-		 	    if (i < argc-1 && *(argv[i+1]) != '-') {
-				int n;
-
-				/* it must be the parameter value */
-				i++;
-				n = strlen(remote_cmd) + strlen(argv[i]) + 2;
-
-				str = (char *) malloc(n);
-				sprintf(str, "%s:%s", remote_cmd, argv[i]);
-				free(remote_cmd);
-				remote_cmd = str;
-			    }
-			}
-			if (!getenv("QUERY_VERBOSE")) {
-				quiet = 1;
-			}
-			xkbcompat = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-query") || !strcmp(arg, "-Q")) {
-			CHECK_ARGC
-			query_cmd = strdup(argv[++i]);
-			if (!getenv("QUERY_VERBOSE")) {
-				quiet = 1;
-			}
-			xkbcompat = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-query_retries")) {
-			char *s;
-			CHECK_ARGC
-			s = strdup(argv[++i]);
-			/* n[:t][/match] */
-			if (strchr(s, '/')) {
-				char *q = strchr(s, '/');
-				query_match = strdup(q+1);
-				*q = '\0';
-			}
-			if (strchr(s, ':')) {
-				char *q = strchr(s, ':');
-				query_delay = atof(q+1);
-			}
-			query_retries = atoi(s);
-			free(s);
-			continue;
-		}
-		if (!strcmp(arg, "-QD")) {
-			CHECK_ARGC
-			query_cmd = strdup(argv[++i]);
-			query_default = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-sync")) {
-			remote_sync = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nosync")) {
-			remote_sync = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-remote_prefix")) {
-			CHECK_ARGC
-			remote_prefix = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-noremote")) {
-			accept_remote_cmds = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-yesremote")) {
-			accept_remote_cmds = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-unsafe")) {
-			safe_remote_only = 0;
-			continue;
-		}
-		if (!strcmp(arg, "-privremote")) {
-			priv_remote = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-safer")) {
-			more_safe = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-nocmds")) {
-			no_external_cmds = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-allowedcmds")) {
-			CHECK_ARGC
-			allowed_external_cmds = strdup(argv[++i]);
-			continue;
-		}
-		if (!strcmp(arg, "-deny_all")) {
-			deny_all = 1;
-			continue;
-		}
-		if (!strcmp(arg, "-httpdir")) {
-			CHECK_ARGC
-			http_dir = strdup(argv[++i]);
-			got_httpdir = 1;
-			continue;
-		}
-		if (1) {
-			if (!strcmp(arg, "-desktop") && i < argc-1) {
-				dt = 1;
-				rfb_desktop_name = strdup(argv[i+1]);
-			}
-			if (!strcmp(arg, "-passwd")) {
-				pw_loc = i;
-				got_passwd = 1;
-			}
-			if (!strcmp(arg, "-rfbauth")) {
-				got_rfbauth = 1;
-			}
-			if (!strcmp(arg, "-rfbwait")) {
-				got_rfbwait = 1;
-			}
-			if (!strcmp(arg, "-deferupdate")) {
-				got_deferupdate = 1;
-			}
-			if (!strcmp(arg, "-rfbport") && i < argc-1) {
-				got_rfbport = 1;
-				if (!strcasecmp(argv[i+1], "prompt")) {
-					;
-				} else if (!is_decimal(argv[i+1])) {
-					if (!got_inetd) {
-						rfbLog("Invalid -rfbport value: '%s'\n", argv[i+1]);
-						rfbLog("setting it to '-1' to induce failure.\n");
-						argv[i+1] = strdup("-1");
-					}
-				}
-				got_rfbport_str = strdup(argv[i+1]);
-				got_rfbport_pos = argc_vnc+1;
-				got_rfbport_val = atoi(argv[i+1]);
-			}
-			if (!strcmp(arg, "-httpport") && i < argc-1) {
-				if (!is_decimal(argv[i+1])) {
-					rfbLog("Invalid -httpport value: '%s'\n", argv[i+1]);
-					clean_up_exit(1);
-				}
-			}
-			if (!strcmp(arg, "-alwaysshared ")) {
-				got_alwaysshared = 1;
-			}
-			if (!strcmp(arg, "-nevershared")) {
-				got_nevershared = 1;
-			}
-			if (!strcmp(arg, "-listen") && i < argc-1) {
-				listen_str = strdup(argv[i+1]);
-			}
-			/* otherwise copy it for libvncserver use below. */
-			if (!strcmp(arg, "-ultrafilexfer")) {
-				got_ultrafilexfer = 1;
-			} else if (argc_vnc < argc_vnc_max) {
-				argv_vnc[argc_vnc++] = strdup(arg);
-			} else {
-				rfbLog("too many arguments.\n");
-				exit(1);
-			}
-			continue;
-		}
-	}
-
-	if (! getenv("NO_LIBXCB_ALLOW_SLOPPY_LOCK")) {
-		/* libxcb is a bit too strict for us sometimes... */
-		set_env("LIBXCB_ALLOW_SLOPPY_LOCK", "1");
-	}
-
-	if (getenv("PATH") == NULL || !strcmp(getenv("PATH"), "")) {
-		/* set a minimal PATH, usually only null in inetd. */
-		set_env("PATH", "/bin:/usr/bin");
-	}
-
-	/* handle -findauth case now that cmdline has been read */
-	if (got_findauth) {
-		char *s;
-		int ic = 0;
-		if (use_dpy != NULL) {
-			set_env("DISPLAY", use_dpy);
-		}
-		use_dpy = strdup("WAIT:cmd=FINDDISPLAY-run");
-
-		s = getenv("FINDAUTH_DISPLAY");
-		if (s && strcmp("", s)) {
-			set_env("DISPLAY", s);
-		}
-		s = getenv("DISPLAY");
-		if (s && strcmp("", s)) {
-			set_env("X11VNC_SKIP_DISPLAY", s);
-		} else {
-			set_env("X11VNC_SKIP_DISPLAY", ":0");
-		}
-		set_env("X11VNC_SKIP_DISPLAY_NEGATE", "1");
-		set_env("FIND_DISPLAY_XAUTHORITY_PATH", "1");
-		set_env("FIND_DISPLAY_NO_SHOW_XAUTH", "1");
-		set_env("FIND_DISPLAY_NO_SHOW_DISPLAY", "1");
-		wait_for_client(&ic, NULL, 0);
-		exit(0);
-	}
-
-#ifndef WIN32
-	/* set OS struct UT */
-	uname(&UT);
-#endif
-
-	orig_use_xdamage = use_xdamage;
-
-	if (!auto_port && getenv("AUTO_PORT")) {
-		auto_port = atoi(getenv("AUTO_PORT"));
-	}
-
-	if (getenv("X11VNC_LOOP_MODE")) {
-		if (bg && !getenv("X11VNC_LOOP_MODE_BG")) {
-			if (! quiet) {
-				fprintf(stderr, "disabling -bg in -loop "
-				    "mode\n");
-			}
-			bg = 0;
-		} else if (!bg && getenv("X11VNC_LOOP_MODE_BG")) {
-			if (! quiet) {
-				fprintf(stderr, "enabling -bg in -loopbg "
-				    "mode\n");
-			}
-			bg = 1;
-		}
-		if (inetd) {
-			if (! quiet) {
-				fprintf(stderr, "disabling -inetd in -loop "
-				    "mode\n");
-			}
-			inetd = 0;
-		}
-	}
-
-	if (launch_gui && (query_cmd || remote_cmd)) {
-		launch_gui = 0;
-		gui_str = NULL;
-	}
-	if (more_safe) {
-		launch_gui = 0;
-	}
-
-#ifdef MACOSX
-	if (! use_dpy) {
-		/* we need this for gui since no X properties */
-		if (!client_connect_file && !client_connect) {
-			char *user = get_user_name();
-			char *str = (char *) malloc(strlen(user) + strlen("/tmp/x11vnc-macosx-remote.") + 1);
-			struct stat sb;
-			sprintf(str, "/tmp/x11vnc-macosx-remote.%s", user);
-			if (!remote_cmd && !query_cmd) {
-				unlink(str);
-				if (stat(str, &sb) != 0) {
-					int fd = open(str, O_WRONLY|O_EXCL|O_CREAT, 0600);
-					if (fd >= 0) {
-						close(fd);
-						client_connect_file = str;
-					}
-				}
-			} else {
-				client_connect_file = str;
-			}
-			if (client_connect_file) {
-				if (!got_inetd) {
-					rfbLog("MacOS X: set -connect file to %s\n", client_connect_file);
-				}
-			}
-		}
-	}
-#endif
-	if (got_rfbport_str != NULL && !strcasecmp(got_rfbport_str, "prompt")) {
-		char *opts, tport[32];
-
-		if (gui_str) {
-			opts = (char *) malloc(strlen(gui_str) + 32);
-			sprintf(opts, "%s,portprompt", gui_str);
-		} else {
-			opts = strdup("portprompt");
-		}
-		got_rfbport_val = -1;
-
-		do_gui(opts, 0);
-		if (got_rfbport_val == -1) {
-			rfbLog("Port prompt indicated cancel.\n");
-			clean_up_exit(1);
-		}
-		if (!got_inetd) {
-			rfbLog("Port prompt selected: %d\n", got_rfbport_val);
-		}
-		sprintf(tport, "%d", got_rfbport_val);
-		argv_vnc[got_rfbport_pos] = strdup(tport);
-		free(opts);
-	}
-
-	{
-		char num[32];
-		sprintf(num, "%d", got_rfbport_val);
-		set_env("X11VNC_GOT_RFBPORT_VAL", num);
-	}
-
-	if (got_ultrafilexfer && argc_vnc + 2 < argc_vnc_max) {
-		argv_vnc[argc_vnc++] = strdup("-rfbversion");
-		argv_vnc[argc_vnc++] = strdup("3.6");
-		argv_vnc[argc_vnc++] = strdup("-permitfiletransfer");
-	}
-	
-	if (launch_gui) {
-		int sleep = 0;
-		if (SHOW_NO_PASSWORD_WARNING && !nopw) {
-			sleep = 1;
-		}
-		do_gui(gui_str, sleep);
-	}
-	if (logfile) {
-		int n;
-		char *pstr = "%VNCDISPLAY";
-		if (strstr(logfile, pstr)) {
-			char *h = this_host();
-			char *s, *q, *newlog;
-			int n, p = got_rfbport_val;
-			/* we don't really know the port yet... so guess */
-			if (p < 0) {
-				p = auto_port;
-			}
-			if (p <= 0) {
-				p = 5900;
-			}
-			s = (char *) malloc(strlen(h) + 32);
-			sprintf(s, "%s:%d", h, p);
-			n = 1;
-			q = logfile;
-			while (1) {
-				char *t = strstr(q, pstr);
-				if (!t) break;
-				n++;
-				q = t+1; 
-			}
-			newlog = (char *) malloc(strlen(logfile) + n * strlen(pstr));
-			newlog[0] = '\0';
-
-			q = logfile;
-			while (1) {
-				char *t = strstr(q, pstr);
-				if (!t) {
-					strcat(newlog, q);
-					break;
-				}
-				strncat(newlog, q, t - q);
-				strcat(newlog, s);
-				q = t + strlen(pstr); 
-			}
-			logfile = newlog;
-			if (!quiet && !got_inetd) {
-				rfbLog("Expanded logfile to '%s'\n", newlog);
-				
-			}
-			free(s);
-		}
-		pstr = "%HOME";
-		if (strstr(logfile, pstr)) {
-			char *h = get_home_dir();
-			char *s, *q, *newlog;
-
-			s = (char *) malloc(strlen(h) + 32);
-			sprintf(s, "%s", h);
-			n = 1;
-			q = logfile;
-			while (1) {
-				char *t = strstr(q, pstr);
-				if (!t) break;
-				n++;
-				q = t+1; 
-			}
-			newlog = (char *) malloc(strlen(logfile) + n * strlen(pstr));
-			newlog[0] = '\0';
-
-			q = logfile;
-			while (1) {
-				char *t = strstr(q, pstr);
-				if (!t) {
-					strcat(newlog, q);
-					break;
-				}
-				strncat(newlog, q, t - q);
-				strcat(newlog, s);
-				q = t + strlen(pstr); 
-			}
-			logfile = newlog;
-			if (!quiet && !got_inetd) {
-				rfbLog("Expanded logfile to '%s'\n", newlog);
-			}
-			free(s);
-		}
-
-		if (logfile_append) {
-			n = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0666);
-		} else {
-			n = open(logfile, O_WRONLY|O_CREAT|O_TRUNC, 0666);
-		}
-		if (n < 0) {
-			fprintf(stderr, "error opening logfile: %s\n", logfile);
-			perror("open");
-			exit(1);
-		}
-		if (dup2(n, 2) < 0) {
-			fprintf(stderr, "dup2 failed\n");
-			perror("dup2");
-			exit(1);
-		}
-		if (n > 2) {
-			close(n);
-		}
-	}
-	if (ipv6_listen) {
-		if (inetd) {
-			ipv6_listen = 0;
-		}
-	}
-	if (inetd && quiet && !logfile) {
-		int n;
-		/*
-		 * Redir stderr to /dev/null under -inetd and -quiet
-		 * but no -o logfile.  Typical problem:
-		 *   Xlib:  extension "RECORD" missing on display ":1.0".
-		 * If they want this info, they should use -o logfile,
-		 * or no -q and 2>logfile.
-		 */
-		n = open("/dev/null", O_WRONLY);
-		if (n >= 0) {
-			if (dup2(n, 2) >= 0) {
-				if (n > 2) {
-					close(n);
-				}
-			}
-		}
-	}
-	if (! quiet && ! inetd) {
-		int i;
-		if (http_oneport_msg) {
-			rfbLog("setting '-enc none' for -http_oneport mode.\n");
-		}
-		for (i=1; i < argc_vnc; i++) {
-			rfbLog("passing arg to libvncserver: %s\n", argv_vnc[i]);
-			if (!strcmp(argv_vnc[i], "-passwd")) {
-				i++;
-			}
-		}
-	}
-
-	if (remote_cmd || query_cmd) {
-		/*
-		 * no need to open DISPLAY, just write it to the file now
-		 * similar for query_default.
-		 */
-		if (client_connect_file || query_default) {
-			int i, rc = 1;
-			for (i=0; i <= query_retries; i++) {
-				rc = do_remote_query(remote_cmd, query_cmd,
-				    remote_sync, query_default);
-				if (rc == 0) {
-					if (query_match) {
-						if (query_result && strstr(query_result, query_match)) {
-							break;
-						}
-						rc = 1;
-					} else {
-						break;
-					}
-				}
-				if (i < query_retries) {
-					fprintf(stderr, "sleep: %.3f\n", query_delay);
-					usleep( (int) (query_delay * 1000 * 1000) );
-				}
-			}
-			fflush(stderr);
-			fflush(stdout);
-			exit(rc);
-		}
-	}
-
-	if (usepw && ! got_rfbauth && ! got_passwd && ! got_passwdfile && !unixpw) {
-		char *f, *h = getenv("HOME");
-		struct stat sbuf;
-		int found = 0, set_rfbauth = 0;
-
-		if (!h) {
-			rfbLog("HOME unset in -usepw mode.\n");
-			exit(1);
-		}
-		f = (char *) malloc(strlen(h)+strlen("/.vnc/passwdfile") + 1);
-
-		sprintf(f, "%s/.vnc/passwd", h);
-		if (stat(f, &sbuf) == 0) {
-			found = 1;
-			if (! quiet) {
-				rfbLog("-usepw: found %s\n", f);
-			}
-			got_rfbauth = 1;
-			set_rfbauth = 1;
-		}
-
-		sprintf(f, "%s/.vnc/passwdfile", h);
-		if (! found && stat(f, &sbuf) == 0) {
-			found = 1;
-			if (! quiet) {
-				rfbLog("-usepw: found %s\n", f);
-			}
-			got_passwdfile = 1;
-			passwdfile = strdup(f);
-		}
-
-#if LIBVNCSERVER_HAVE_FORK
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H
-#if LIBVNCSERVER_HAVE_WAITPID
-		if (! found) {
-			pid_t pid = fork();
-			if (pid < 0) {
-				;
-			} else if (pid == 0) {
-				execlp(argv[0], argv[0], "-storepasswd",
-				    (char *) NULL);
-				exit(1);
-			} else {
-				int s;
-				waitpid(pid, &s, 0); 
-				if (WIFEXITED(s) && WEXITSTATUS(s) == 0) {
-					got_rfbauth = 1;
-					set_rfbauth = 1;
-					found = 1;
-				}
-			}
-		}
-#endif
-#endif
-#endif
-
-		if (set_rfbauth) {
-			sprintf(f, "%s/.vnc/passwd", h);
-			if (argc_vnc < 100) {
-				argv_vnc[argc_vnc++] = strdup("-rfbauth");
-			} else {
-				exit(1);
-			}
-			if (argc_vnc < 100) {
-				argv_vnc[argc_vnc++] = strdup(f);
-			} else {
-				exit(1);
-			}
-		}
-		if (! found) {
-			fprintf(stderr, "x11vnc -usepw: could not find"
-			    " a password to use.\n");
-			exit(1);
-		}
-		free(f);
-	}
-
-	if (got_rfbauth && (got_passwd || got_viewpasswd || got_passwdfile)) {
-		fprintf(stderr, "option -rfbauth is incompatible with:\n");
-		fprintf(stderr, "            -passwd, -viewpasswd, and -passwdfile\n");
-		exit(1);
-	}
-	if (got_passwdfile && (got_passwd || got_viewpasswd)) {
-		fprintf(stderr, "option -passwdfile is incompatible with:\n");
-		fprintf(stderr, "            -passwd and -viewpasswd\n");
-		exit(1);
-	}
-
-	/*
-	 * If -passwd was used, clear it out of argv.  This does not
-	 * work on all UNIX, have to use execvp() in general...
-	 */
-	if (pw_loc > 0) {
-		int i;
-		for (i=pw_loc; i <= pw_loc+1; i++) {
-			if (i < argc) {
-				char *p = argv[i];		
-				strzero(p);
-			}
-		}
-	} else if (passwdfile) {
-		/* read passwd(s) from file */
-		if (strstr(passwdfile, "cmd:") == passwdfile ||
-		    strstr(passwdfile, "custom:") == passwdfile) {
-			char tstr[100], *q;
-			sprintf(tstr, "%f", dnow());
-			if ((q = strrchr(tstr, '.')) == NULL) {
-				q = tstr;
-			} else {
-				q++;
-			}
-			/* never used under cmd:, used to force auth */
-			argv_vnc[argc_vnc++] = strdup("-passwd");
-			argv_vnc[argc_vnc++] = strdup(q);
-		} else if (read_passwds(passwdfile)) {
-			argv_vnc[argc_vnc++] = strdup("-passwd");
-			argv_vnc[argc_vnc++] = strdup(passwd_list[0]);
-		}
-		got_passwd = 1;
-		pw_loc = 100;	/* just for pw_loc check below */
-	}
-	if (vpw_loc > 0) {
-		int i;
-		for (i=vpw_loc; i <= vpw_loc+1; i++) {
-			if (i < argc) {
-				char *p = argv[i];		
-				strzero(p);
-			}
-		}
-	}
-#ifdef HARDWIRE_PASSWD
-	if (!got_rfbauth && !got_passwd) {
-		argv_vnc[argc_vnc++] = strdup("-passwd");
-		argv_vnc[argc_vnc++] = strdup(HARDWIRE_PASSWD);
-		got_passwd = 1;
-		pw_loc = 100;
-	}
-#endif
-#ifdef HARDWIRE_VIEWPASSWD
-	if (!got_rfbauth && got_passwd && !viewonly_passwd && !passwd_list) {
-		viewonly_passwd = strdup(HARDWIRE_VIEWPASSWD);
-	}
-#endif
-	if (viewonly_passwd && pw_loc < 0) {
-		rfbLog("-passwd must be supplied when using -viewpasswd\n");
-		exit(1);
-	}
-	if (1) {
-		/* mix things up a little bit */
-		unsigned char buf[CHALLENGESIZE];
-		int k, kmax = (int) (50 * rfac()) + 10;
-		for (k=0; k < kmax; k++) {
-			rfbRandomBytes(buf);
-		}
-	}
-
-	if (SHOW_NO_PASSWORD_WARNING) {
-		char message[] = "-rfbauth, -passwdfile, -passwd password, "
-		    "or -unixpw required.";
-		if (! nopw) {
-			nopassword_warning_msg(got_localhost);
-		}
-#if PASSWD_REQUIRED
-		rfbLog("%s\n", message);
-		exit(1);
-#endif
-#if PASSWD_UNLESS_NOPW
-		if (! nopw) {
-			rfbLog("%s\n", message);
-			exit(1);
-		}
-#endif
-		message[0] = '\0';	/* avoid compiler warning */
-	}
-
-	if (more_safe) {
-		if (! quiet) {
-			rfbLog("-safer mode:\n");
-			rfbLog("   vnc_connect=0\n");
-			rfbLog("   accept_remote_cmds=0\n");
-			rfbLog("   safe_remote_only=1\n");
-			rfbLog("   launch_gui=0\n");
-		}
-		vnc_connect = 0;
-		accept_remote_cmds = 0;
-		safe_remote_only = 1;
-		launch_gui = 0;
-	}
-
-	if (users_list && strchr(users_list, '.')) {
-		char *p, *q, *tmp = (char *) malloc(strlen(users_list)+1);
-		char *str = strdup(users_list);
-		int i, n, db = 1;
-
-		tmp[0] = '\0';
-
-		n = strlen(users_list) + 1;
-		user2group = (char **) malloc(n * sizeof(char *));
-		for (i=0; i<n; i++) {
-			user2group[i] = NULL;
-		}
-
-		i = 0;
-		p = strtok(str, ",");
-		if (db) fprintf(stderr, "users_list: %s\n", users_list);
-		while (p) {
-			if (tmp[0] != '\0') {
-				strcat(tmp, ",");
-			}
-			q = strchr(p, '.');
-			if (q) {
-				char *s = strchr(p, '=');
-				if (! s) {
-					s = p;
-				} else {
-					s++;
-				}
-				if (s[0] == '+') s++;
-				user2group[i++] = strdup(s);
-				if (db) fprintf(stderr, "u2g: %s\n", s);
-				*q = '\0';
-			}
-			strcat(tmp, p);
-			p = strtok(NULL, ",");
-		}
-		free(str);
-		users_list = tmp;
-		if (db) fprintf(stderr, "users_list: %s\n", users_list);
-	}
-
-	if (got_tls > 0 && !use_openssl) {
-		rfbLog("SSL: Error: you did not supply the '-ssl ...' option even\n");
-		rfbLog("SSL: though you supplied one of these related options:\n");
-		rfbLog("SSL:   -sslonly, -sslverify, -sslCRL, -vencrypt, -anontls,\n");
-		rfbLog("SSL:   -dhparams, -https, -http_ssl, or -httpsredir.\n");
-		rfbLog("SSL: Restart with, for example, '-ssl SAVE' on the cmd line.\n");
-		rfbLog("SSL: See the '-ssl' x11vnc -help description for more info.\n");
-		if (!getenv("X11VNC_FORCE_NO_OPENSSL")) {
-			exit(1);
-		}
-	}
-
-	if (unixpw) {
-		if (inetd) {
-			use_stunnel = 0;
-		}
-		if (! use_stunnel && ! use_openssl) {
-			if (getenv("UNIXPW_DISABLE_SSL")) {
-				rfbLog("Skipping -ssl/-stunnel requirement"
-				    " due to\n");
-				rfbLog("UNIXPW_DISABLE_SSL setting.\n");
-
-				if (!getenv("UNIXPW_DISABLE_LOCALHOST")) {
-					if (!got_localhost) {
-						rfbLog("Forcing -localhost mode.\n");
-					}
-					allow_list = strdup("127.0.0.1");
-					got_localhost = 1;
-				}
-			} else if (have_ssh_env()) {
-				char *s = getenv("SSH_CONNECTION");
-				if (! s) s = getenv("SSH_CLIENT");
-				if (! s) s = "SSH_CONNECTION";
-				fprintf(stderr, "\n");
-				rfbLog("Skipping -ssl/-stunnel constraint in"
-				    " -unixpw mode,\n");
-				rfbLog("assuming your SSH encryption"
-				    " is:\n");
-				rfbLog("   %s\n", s);
-
-				if (!getenv("UNIXPW_DISABLE_LOCALHOST")) {
-					if (!got_localhost) {
-						rfbLog("Setting -localhost in SSH + -unixpw mode.\n");
-					}
-					allow_list = strdup("127.0.0.1");
-					got_localhost = 1;
-				}
-
-				rfbLog("If you *actually* want SSL, restart"
-				    " with -ssl on the cmdline\n");
-				if (! nopw) {
-					usleep(2000*1000);
-				}
-			} else {
-				if (openssl_present()) {
-					rfbLog("set -ssl in -unixpw mode.\n");
-					use_openssl = 1;
-				} else if (inetd) {
-					rfbLog("could not set -ssl in -inetd"
-					    " + -unixpw mode.\n");
-					exit(1);
-				} else {
-					rfbLog("set -stunnel in -unixpw mode.\n");
-					use_stunnel = 1;
-				}
-			}
-			rfbLog("\n");
-		}
-		if (use_threads && !getenv("UNIXPW_THREADS")) {
-			if (! quiet) {
-				rfbLog("disabling -threads under -unixpw\n");
-				rfbLog("\n");
-			}
-			use_threads = 0;
-		}
-	}
-	if (use_stunnel && ! got_localhost) {
-		if (! getenv("STUNNEL_DISABLE_LOCALHOST") &&
-		    ! getenv("UNIXPW_DISABLE_LOCALHOST")) {
-			if (! quiet) {
-				rfbLog("Setting -localhost in -stunnel mode.\n");
-			}
-			allow_list = strdup("127.0.0.1");
-			got_localhost = 1;
-		}
-	}
-	if (ssl_verify && ! use_stunnel && ! use_openssl) {
-		rfbLog("-sslverify must be used with -ssl or -stunnel\n");
-		exit(1);
-	}
-	if (https_port_num >= 0 && ! use_openssl) {
-		rfbLog("-https must be used with -ssl\n");
-		exit(1);
-	}
-
-	if (use_threads && !got_noxrandr) {
-		xrandr = 1;
-		if (! quiet) {
-			rfbLog("enabling -xrandr in -threads mode.\n");
-		}
-	}
-
-	/* fixup settings that do not make sense */
-		
-	if (use_threads && nofb && cursor_pos_updates) {
-		if (! quiet) {
-			rfbLog("disabling -threads under -nofb -cursorpos\n");
-		}
-		use_threads = 0;
-	}
-	if (tile_fuzz < 1) {
-		tile_fuzz = 1;
-	}
-	if (waitms < 0) {
-		waitms = 0;
-	}
-
-	if (alpha_threshold < 0) {
-		alpha_threshold = 0;
-	}
-	if (alpha_threshold > 256) {
-		alpha_threshold = 256;
-	}
-	if (alpha_frac < 0.0) {
-		alpha_frac = 0.0;
-	}
-	if (alpha_frac > 1.0) {
-		alpha_frac = 1.0;
-	}
-	if (alpha_blend) {
-		alpha_remove = 0;
-	}
-
-	if (cmap8to24 && overlay) {
-		if (! quiet) {
-			rfbLog("disabling -overlay in -8to24 mode.\n");
-		}
-		overlay = 0;
-	}
-
-	if (tightfilexfer && view_only) {
-		if (! quiet) {
-			rfbLog("setting -notightfilexfer in -viewonly mode.\n");
-		}
-		/* how to undo via -R? */
-		tightfilexfer = 0;
-	}
-
-	if (inetd) {
-		shared = 0;
-		connect_once = 1;
-		bg = 0;
-		if (use_stunnel) {
-			exit(1);
-		}
-	}
-
-	http_try_it = try_http;
-
-	if (flip_byte_order && using_shm && ! quiet) {
-		rfbLog("warning: -flipbyte order only works with -noshm\n");
-	}
-
-	if (! wireframe_copyrect) {
-		set_wirecopyrect_mode(NULL);
-	}
-	if (! scroll_copyrect) {
-		set_scrollcopyrect_mode(NULL);
-	}
-	if (screen_fixup_str) {
-		parse_fixscreen();
-	}
-	initialize_scroll_matches();
-	initialize_scroll_term();
-	initialize_max_keyrepeat();
-
-	/* increase rfbwait if threaded */
-	if (use_threads && ! got_rfbwait) {
-		/* ??? lower this ??? */
-		rfbMaxClientWait = 604800000;
-	}
-
-	/* no framebuffer (Win2VNC) mode */
-
-	if (nofb) {
-		/* disable things that do not make sense with no fb */
-		set_nofb_params(0);
-
-		if (! got_deferupdate && ! got_defer) {
-			/* reduce defer time under -nofb */
-			defer_update = defer_update_nofb;
-		}
-		if (got_pointer_mode < 0) {
-			pointer_mode = POINTER_MODE_NOFB;
-		}
-	}
-
-	if (ncache < 0) {
-		ncache_beta_tester = 1;
-		ncache_msg = 1;
-		if (ncache == -1) {
-			ncache = 0;
-		}
-		ncache = -ncache;
-		if (try_http || got_httpdir) {
-			/* JVM usually not set to handle all the memory */
-			ncache = 0;
-			ncache_msg = 0;
-		}
-		if (subwin) {
-			ncache = 0;
-			ncache_msg = 0;
-		}
-	}
-
-	if (raw_fb_str) {
-		set_raw_fb_params(0);
-	}
-	if (! got_deferupdate) {
-		char tmp[40];
-		sprintf(tmp, "%d", defer_update);
-		argv_vnc[argc_vnc++] = strdup("-deferupdate");
-		argv_vnc[argc_vnc++] = strdup(tmp);
-	}
-
-	if (debug_pointer || debug_keyboard) {
-		if (!logfile) {
-			if (bg || quiet) {
-				rfbLog("disabling -bg/-q under -debug_pointer"
-				    "/-debug_keyboard\n");
-				bg = 0;
-				quiet = 0;
-			}
-		}
-	}
-
-	/* initialize added_keysyms[] array to zeros */
-	add_keysym(NoSymbol);
-
-	/* tie together cases of -localhost vs. -listen localhost */
-	if (! listen_str) {
-		if (allow_list && !strcmp(allow_list, "127.0.0.1")) {
-			listen_str = strdup("localhost");
-			argv_vnc[argc_vnc++] = strdup("-listen");
-			argv_vnc[argc_vnc++] = strdup(listen_str);
-		}
-	} else if (!strcmp(listen_str, "localhost") ||
-	    !strcmp(listen_str, "127.0.0.1")) {
-		allow_list = strdup("127.0.0.1");
-	}
-
-	initialize_crash_handler();
-
-	if (! quiet) {
-		if (verbose) {
-			print_settings(try_http, bg, gui_str);
-		}
-		rfbLog("x11vnc version: %s  pid: %d\n", lastmod, getpid());
-	} else {
-		rfbLogEnable(0);
-	}
-
-	X_INIT;
-	SCR_INIT;
-	CLIENT_INIT;
-	INPUT_INIT;
-	POINTER_INIT;
-	
-	/* open the X display: */
-
-#if LIBVNCSERVER_HAVE_XKEYBOARD
-	/*
-	 * Disable XKEYBOARD before calling XOpenDisplay()
-	 * this should be used if there is ambiguity in the keymapping. 
-	 */
-	if (xkbcompat) {
-		Bool rc = XkbIgnoreExtension(True);
-		if (! quiet) {
-			rfbLog("Disabling xkb XKEYBOARD extension. rc=%d\n",
-			    rc);
-		}
-		if (watch_bell) {
-			watch_bell = 0;
-			if (! quiet) rfbLog("Disabling bell.\n");
-		}
-	}
-#else
-	watch_bell = 0;
-	use_xkb_modtweak = 0;
-#endif
-
-#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-	if (tightfilexfer) {
-		rfbLog("rfbRegisterTightVNCFileTransferExtension: 6\n");
-		rfbRegisterTightVNCFileTransferExtension();
-	} else {
-		if (0) rfbLog("rfbUnregisterTightVNCFileTransferExtension: 3\n");
-		rfbUnregisterTightVNCFileTransferExtension();
-	}
-#endif
-
-	initialize_allowed_input();
-
-	if (display_N && !got_rfbport) {
-		char *ud = use_dpy;
-		if (ud == NULL) {
-			ud = getenv("DISPLAY");
-		}
-		if (ud && strstr(ud, "cmd=") == NULL) {
-			char *p;
-			ud = strdup(ud);
-			p = strrchr(ud, ':');
-			if (p) {
-				int N;	
-				char *q = strchr(p, '.');
-				if (q) {
-					*q = '\0';
-				}
-				N = atoi(p+1);	
-				if (argc_vnc+1 < argc_vnc_max) {
-					char Nstr[16];
-					sprintf(Nstr, "%d", (5900 + N) % 65536); 
-					argv_vnc[argc_vnc++] = strdup("-rfbport");
-					argv_vnc[argc_vnc++] = strdup(Nstr);
-					got_rfbport = 1;
-				}
-			}
-			free(ud);
-		}
-	}
-
-	if (users_list && strstr(users_list, "lurk=")) {
-		if (use_dpy) {
-			rfbLog("warning: -display does not make sense in "
-			    "\"lurk=\" mode...\n");
-		}
-		if (auth_file != NULL && strcmp(auth_file, "guess")) {
-			set_env("XAUTHORITY", auth_file);
-		}
-		lurk_loop(users_list);
-
-	} else if (use_dpy && strstr(use_dpy, "WAIT:") == use_dpy) {
-		char *mcm = multiple_cursors_mode;
-
-		if (strstr(use_dpy, "Xdummy")) {
-			if (!xrandr && !got_noxrandr) {
-				if (! quiet) {
-					rfbLog("Enabling -xrandr for possible use of Xdummy server.\n");
-				}
-				xrandr = 1;
-			}
-		}
-
-		waited_for_client = wait_for_client(&argc_vnc, argv_vnc,
-		    try_http && ! got_httpdir);
-
-		if (!mcm && multiple_cursors_mode) {
-			free(multiple_cursors_mode);
-			multiple_cursors_mode = NULL;
-		}
-	}
-
-
-	if (auth_file) {
-		check_guess_auth_file();
-		if (auth_file != NULL) {
-			set_env("XAUTHORITY", auth_file);
-		}
-	}
-
-#ifdef MACOSX
-	if (use_dpy && !strcmp(use_dpy, "console")) {
-		;
-	} else
-#endif
-	if (use_dpy && strcmp(use_dpy, "")) {
-		dpy = XOpenDisplay_wr(use_dpy);
-#ifdef MACOSX
-	} else if (!subwin && getenv("DISPLAY")
-	    && strstr(getenv("DISPLAY"), "/tmp/") ) {
-		/* e.g. /tmp/launch-XlspvM/:0 on leopard */
-		rfbLog("MacOSX: Ignoring $DISPLAY '%s'\n", getenv("DISPLAY"));
-		rfbLog("MacOSX: Use -display $DISPLAY to force it.\n");
-#endif
-	} else if (raw_fb_str != NULL && raw_fb_str[0] != '+' && !got_noviewonly) {
-		rfbLog("Not opening DISPLAY in -rawfb mode (force via -rawfb +str)\n");
-		dpy = NULL; /* don't open it. */
-	} else if ( (use_dpy = getenv("DISPLAY")) ) {
-		if (strstr(use_dpy, "localhost") == use_dpy) {
-			rfbLog("\n");
-			rfbLog("WARNING: DISPLAY starts with localhost: '%s'\n", use_dpy);
-			rfbLog("WARNING: Is this an SSH X11 port forwarding?  You most\n");
-			rfbLog("WARNING: likely don't want x11vnc to use that DISPLAY.\n");
-			rfbLog("WARNING: You probably should supply something\n");
-			rfbLog("WARNING: like: -display :0  to access the physical\n");
-			rfbLog("WARNING: X display on the machine where x11vnc is running.\n");
-			rfbLog("\n");
-			usleep(500 * 1000);
-		} else if (using_shm && use_dpy[0] != ':') {
-			rfbLog("\n");
-			rfbLog("WARNING: DISPLAY might not be local: '%s'\n", use_dpy);
-			rfbLog("WARNING: Is this the DISPLAY of another machine?  Usually,\n");
-			rfbLog("WARNING: x11vnc is run on the same machine with the\n");
-			rfbLog("WARNING: physical X display to be exported by VNC.  If\n");
-			rfbLog("WARNING: that is what you really meant, supply something\n");
-			rfbLog("WARNING: like: -display :0  on the x11vnc command line.\n");
-			rfbLog("\n");
-			usleep(250 * 1000);
-		}
-		dpy = XOpenDisplay_wr(use_dpy);
-	} else {
-		dpy = XOpenDisplay_wr("");
-	}
-	last_open_xdisplay = time(NULL);
-
-	if (terminal_services_daemon != NULL) {
-		terminal_services(terminal_services_daemon);
-		exit(0);
-	}
-
-	if (dpy && !xrandr && !got_noxrandr) {
-#if !NO_X11
-		Atom trap_xrandr = XInternAtom(dpy, "X11VNC_TRAP_XRANDR", True);
-		if (trap_xrandr != None) {
-			if (! quiet) {
-				rfbLog("Enabling -xrandr due to X11VNC_TRAP_XRANDR atom.\n");
-			}
-			xrandr = 1;
-		}
-#endif
-	}
-
-#ifdef MACOSX
-	if (! dpy && ! raw_fb_str) {
-		raw_fb_str = strdup("console");
-	}
-#endif
-
-	if (! dpy && raw_fb_str) {
-		rfbLog("Continuing without X display in -rawfb mode.\n");
-		goto raw_fb_pass_go_and_collect_200_dollars;
-	}
-
-	if (! dpy && ! use_dpy && ! getenv("DISPLAY")) {
-		int i, s = 4;
-		rfbLogEnable(1);
-		rfbLog("\a\n");
-		rfbLog("*** XOpenDisplay failed. No -display or DISPLAY.\n");
-		rfbLog("*** Trying \":0\" in %d seconds.  Press Ctrl-C to"
-		    " abort.\n", s);
-		rfbLog("*** ");
-		for (i=1; i<=s; i++)  {
-			fprintf(stderr, "%d ", i);
-			sleep(1);
-		}
-		fprintf(stderr, "\n");
-		use_dpy = ":0";
-		dpy = XOpenDisplay_wr(use_dpy);
-		last_open_xdisplay = time(NULL);
-		if (dpy) {
-			rfbLog("*** XOpenDisplay of \":0\" successful.\n");
-		}
-		rfbLog("\n");
-		if (quiet) rfbLogEnable(0);
-	}
-
-	if (! dpy) {
-		char *d = use_dpy;
-		if (!d) d = getenv("DISPLAY");
-		if (!d) d = "null";
-		rfbLogEnable(1);
-		fprintf(stderr, "\n");
-		rfbLog("***************************************\n", d);
-		rfbLog("*** XOpenDisplay failed (%s)\n", d);
-		xopen_display_fail_message(d);
-		exit(1);
-	} else if (use_dpy) {
-		if (! quiet) rfbLog("Using X display %s\n", use_dpy);
-	} else {
-		if (! quiet) rfbLog("Using default X display.\n");
-	}
-
-	if (clip_str != NULL && dpy != NULL) {
-		check_xinerama_clip();
-	}
-
-	scr = DefaultScreen(dpy);
-	rootwin = RootWindow(dpy, scr);
-
-#if !NO_X11
-	if (dpy) {
-		Window w = XCreateSimpleWindow(dpy, rootwin, 0, 0, 1, 1, 0, 0, 0);
-		if (! quiet) rfbLog("rootwin: 0x%lx reswin: 0x%lx dpy: 0x%x\n", rootwin, w, dpy);
-		if (w != None) {
-			XDestroyWindow(dpy, w);
-		}
-		XSync(dpy, False);
-	}
-#endif
-
-	if (ncache_beta_tester) {
-		int h = DisplayHeight(dpy, scr);
-		int w = DisplayWidth(dpy, scr);
-		int mem = (w * h * 4) / (1000 * 1000), MEM = 96;
-		if (mem < 1) mem = 1;
-
-		/* limit poor, unsuspecting beta tester's viewer to 96 MB */
-		if ( (ncache+2) * mem > MEM ) {
-			int n = (MEM/mem) - 2;
-			if (n < 0) n = 0;
-			n = 2 * (n / 2);
-			if (n < ncache) {
-				ncache = n;
-			}
-		}
-	}
-
-	if (grab_always) {
-		Window save = window;
-		window = rootwin;
-		adjust_grabs(1, 0);
-		window = save;
-	}
-
-	if (   (remote_cmd && strstr(remote_cmd, "DIRECT:") == remote_cmd)
-	    || (query_cmd  && strstr(query_cmd,  "DIRECT:") == query_cmd )) {
-		/* handled below after most everything is setup. */
-		if (getenv("QUERY_VERBOSE")) {
-			quiet = 0;
-		} else {
-			quiet = 1;
-			remote_direct = 1;
-		}
-		if (!auto_port) {
-			auto_port = 5970;
-		}
-	} else if (remote_cmd || query_cmd) {
-		int i, rc = 1;
-		for (i=0; i <= query_retries; i++) {
-			rc = do_remote_query(remote_cmd, query_cmd, remote_sync,
-			    query_default);
-			if (rc == 0) {
-				if (query_match) {
-					if (query_result && strstr(query_result, query_match)) {
-						break;
-					}
-					rc = 1;
-				} else {
-					break;
-				}
-			}
-			if (i < query_retries) {
-				fprintf(stderr, "sleep: %.3f\n", query_delay);
-				usleep( (int) (query_delay * 1000 * 1000) );
-			}
-		}
-		XFlush_wr(dpy);
-		fflush(stderr);
-		fflush(stdout);
-		usleep(30 * 1000);	/* still needed? */
-		XCloseDisplay_wr(dpy);
-		exit(rc);
-	}
-
-	if (! quiet && ! raw_fb_str) {
-		rfbLog("\n");
-		rfbLog("------------------ USEFUL INFORMATION ------------------\n");
-	}
-
-	if (priv_remote) {
-		if (! remote_control_access_ok()) {
-			rfbLog("** Disabling remote commands in -privremote mode.\n");
-			accept_remote_cmds = 0;
-		}
-	}
-
-	sync_tod_with_servertime();
-	if (grab_buster) {
-		spawn_grab_buster();
-	}
-
-#if LIBVNCSERVER_HAVE_LIBXFIXES
-	if (! XFixesQueryExtension(dpy, &xfixes_base_event_type, &er)) {
-		if (! quiet && ! raw_fb_str) {
-			rfbLog("Disabling XFIXES mode: display does not support it.\n");
-		}
-		xfixes_base_event_type = 0;
-		xfixes_present = 0;
-	} else {
-		xfixes_present = 1;
-	}
-#endif
-	if (! xfixes_present) {
-		use_xfixes = 0;
-	}
-
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-	if (! XDamageQueryExtension(dpy, &xdamage_base_event_type, &er)) {
-		if (! quiet && ! raw_fb_str) {
-			rfbLog("Disabling X DAMAGE mode: display does not support it.\n");
-		}
-		xdamage_base_event_type = 0;
-		xdamage_present = 0;
-	} else {
-		xdamage_present = 1;
-	}
-#endif
-	if (! xdamage_present) {
-		use_xdamage = 0;
-	}
-	if (! quiet && xdamage_present && use_xdamage && ! raw_fb_str) {
-		rfbLog("X DAMAGE available on display, using it for polling hints.\n");
-		rfbLog("  To disable this behavior use: '-noxdamage'\n");
-		rfbLog("\n");
-		rfbLog("  Most compositing window managers like 'compiz' or 'beryl'\n");
-		rfbLog("  cause X DAMAGE to fail, and so you may not see any screen\n");
-		rfbLog("  updates via VNC.  Either disable 'compiz' (recommended) or\n");
-		rfbLog("  supply the x11vnc '-noxdamage' command line option.\n");
-	}
-
-	if (! quiet && wireframe && ! raw_fb_str) {
-		rfbLog("\n");
-		rfbLog("Wireframing: -wireframe mode is in effect for window moves.\n");
-		rfbLog("  If this yields undesired behavior (poor response, painting\n");
-		rfbLog("  errors, etc) it may be disabled:\n");
-		rfbLog("   - use '-nowf' to disable wireframing completely.\n");
-		rfbLog("   - use '-nowcr' to disable the Copy Rectangle after the\n");
-		rfbLog("     moved window is released in the new position.\n");
-		rfbLog("  Also see the -help entry for tuning parameters.\n");
-		rfbLog("  You can press 3 Alt_L's (Left \"Alt\" key) in a row to \n");
-		rfbLog("  repaint the screen, also see the -fixscreen option for\n");
-		rfbLog("  periodic repaints.\n");
-		if (scale_str && !strstr(scale_str, "nocr")) {
-			rfbLog("  Note: '-scale' is on and this can cause more problems.\n");
-		}
-	}
-
-	overlay_present = 0;
-#if defined(SOLARIS_OVERLAY) && !NO_X11
-	if (! XQueryExtension(dpy, "SUN_OVL", &maj, &ev, &er)) {
-		if (! quiet && overlay && ! raw_fb_str) {
-			rfbLog("Disabling -overlay: SUN_OVL extension not available.\n");
-		}
-	} else {
-		overlay_present = 1;
-	}
-#endif
-#if defined(IRIX_OVERLAY) && !NO_X11
-	if (! XReadDisplayQueryExtension(dpy, &ev, &er)) {
-		if (! quiet && overlay && ! raw_fb_str) {
-			rfbLog("Disabling -overlay: IRIX ReadDisplay extension not available.\n");
-		}
-	} else {
-		overlay_present = 1;
-	}
-#endif
-	if (overlay && !overlay_present) {
-		overlay = 0;
-		overlay_cursor = 0;
-	}
-
-	/* cursor shapes setup */
-	if (! multiple_cursors_mode) {
-		multiple_cursors_mode = strdup("default");
-	}
-	if (show_cursor) {
-		if(!strcmp(multiple_cursors_mode, "default")
-		    && xfixes_present && use_xfixes) {
-			free(multiple_cursors_mode);
-			multiple_cursors_mode = strdup("most");
-
-			if (! quiet && ! raw_fb_str) {
-				rfbLog("\n");
-				rfbLog("XFIXES available on display, resetting cursor mode\n");
-				rfbLog("  to: '-cursor most'.\n");
-				rfbLog("  to disable this behavior use: '-cursor arrow'\n");
-				rfbLog("  or '-noxfixes'.\n");
-			}
-		}
-		if(!strcmp(multiple_cursors_mode, "most")) {
-			if (xfixes_present && use_xfixes &&
-			    overlay_cursor == 1) {
-				if (! quiet && ! raw_fb_str) {
-					rfbLog("using XFIXES for cursor drawing.\n");
-				}
-				overlay_cursor = 0;
-			}
-		}
-	}
-
-	if (overlay) {
-		using_shm = 0;
-		if (flash_cmap && ! quiet && ! raw_fb_str) {
-			rfbLog("warning: -flashcmap may be incompatible with -overlay\n");
-		}
-		if (show_cursor && overlay_cursor) {
-			char *s = multiple_cursors_mode;
-			if (*s == 'X' || !strcmp(s, "some") ||
-			    !strcmp(s, "arrow")) {
-				/*
-				 * user wants these modes, so disable fb cursor
-				 */
-				overlay_cursor = 0;
-			} else {
-				/*
-				 * "default" and "most", we turn off
-				 * show_cursor since it will automatically
-				 * be in the framebuffer.
-				 */
-				show_cursor = 0;
-			}
-		}
-	}
-
-	initialize_cursors_mode();
-
-	/* check for XTEST */
-	if (! XTestQueryExtension_wr(dpy, &ev, &er, &maj, &min)) {
-		if (! quiet && ! raw_fb_str) {
-			rfbLog("\n");
-			rfbLog("WARNING: XTEST extension not available (either missing from\n");
-			rfbLog("  display or client library libXtst missing at build time).\n");
-			rfbLog("  MOST user input (pointer and keyboard) will be DISCARDED.\n");
-			rfbLog("  If display does have XTEST, be sure to build x11vnc with\n");
-			rfbLog("  a working libXtst build environment (e.g. libxtst-dev,\n");
-			rfbLog("  or other packages).\n");
-			rfbLog("No XTEST extension, switching to -xwarppointer mode for\n");
-			rfbLog("  pointer motion input.\n");
-		}
-		xtest_present = 0;
-		use_xwarppointer = 1;
-	} else {
-		xtest_present = 1;
-		xtest_base_event_type = ev;
-		if (maj <= 1 || (maj == 2 && min <= 2)) {
-			/* no events defined as of 2.2 */
-			xtest_base_event_type = 0;
-		}
-	}
-
-	if (! XETrapQueryExtension_wr(dpy, &ev, &er, &maj)) {
-		xtrap_present = 0;
-	} else {
-		xtrap_present = 1;
-		xtrap_base_event_type = ev;
-	}
-
-	/*
-	 * Window managers will often grab the display during resize,
-	 * etc, using XGrabServer().  To avoid deadlock (our user resize
-	 * input is not processed) we tell the server to process our
-	 * requests during all grabs:
-	 */
-	disable_grabserver(dpy, 0);
-
-	/* check for RECORD */
-	if (! XRecordQueryVersion_wr(dpy, &maj, &min)) {
-		xrecord_present = 0;
-		if (! quiet) {
-			rfbLog("\n");
-			rfbLog("The RECORD X extension was not found on the display.\n");
-			rfbLog("If your system has disabled it by default, you can\n");
-			rfbLog("enable it to get a nice x11vnc performance speedup\n");
-			rfbLog("for scrolling by putting this into the \"Module\" section\n");
-			rfbLog("of /etc/X11/xorg.conf or /etc/X11/XF86Config:\n");
-			rfbLog("\n");
-			rfbLog("  Section \"Module\"\n");
-			rfbLog("  ...\n");
-			rfbLog("      Load    \"record\"\n");
-			rfbLog("  ...\n");
-			rfbLog("  EndSection\n");
-			rfbLog("\n");
-		}
-	} else {
-		xrecord_present = 1;
-	}
-
-	initialize_xrecord();
-
-	tmpi = 1;
-	if (scroll_copyrect) {
-		if (strstr(scroll_copyrect, "never")) {
-			tmpi = 0;
-		}
-	} else if (scroll_copyrect_default) {
-		if (strstr(scroll_copyrect_default, "never")) {
-			tmpi = 0;
-		}
-	}
-	if (! xrecord_present) {
-		tmpi = 0;
-	}
-#if !LIBVNCSERVER_HAVE_RECORD
-	tmpi = 0;
-#endif
-	if (! quiet && tmpi && ! raw_fb_str) {
-		rfbLog("\n");
-		rfbLog("Scroll Detection: -scrollcopyrect mode is in effect to\n");
-		rfbLog("  use RECORD extension to try to detect scrolling windows\n");
-		rfbLog("  (induced by either user keystroke or mouse input).\n");
-		rfbLog("  If this yields undesired behavior (poor response, painting\n");
-		rfbLog("  errors, etc) it may be disabled via: '-noscr'\n");
-		rfbLog("  Also see the -help entry for tuning parameters.\n");
-		rfbLog("  You can press 3 Alt_L's (Left \"Alt\" key) in a row to \n");
-		rfbLog("  repaint the screen, also see the -fixscreen option for\n");
-		rfbLog("  periodic repaints.\n");
-		if (scale_str && !strstr(scale_str, "nocr")) {
-			rfbLog("  Note: '-scale' is on and this can cause more problems.\n");
-		}
-	}
-
-	if (! quiet && ncache && ! raw_fb_str) {
-		rfbLog("\n");
-		rfbLog("Client Side Caching: -ncache mode is in effect to provide\n");
-		rfbLog("  client-side pixel data caching.  This speeds up\n");
-		rfbLog("  iconifying/deiconifying windows, moving and raising\n");
-		rfbLog("  windows, and reposting menus.  In the simple CopyRect\n");
-		rfbLog("  encoding scheme used (no compression) a huge amount\n");
-		rfbLog("  of extra memory (20-100MB) is used on both the server and\n");
-		rfbLog("  client sides.  This mode works with any VNC viewer.\n");
-		rfbLog("  However, in most you can actually see the cached pixel\n");
-		rfbLog("  data by scrolling down, so you need to re-adjust its size.\n");
-		rfbLog("  See http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching.\n");
-		rfbLog("  If this mode yields undesired behavior (poor response,\n");
-		rfbLog("  painting errors, etc) it may be disabled via: '-ncache 0'\n");
-		rfbLog("  You can press 3 Alt_L's (Left \"Alt\" key) in a row to \n");
-		rfbLog("  repaint the screen, also see the -fixscreen option for\n");
-		rfbLog("  periodic repaints.\n");
-		if (scale_str) {
-			rfbLog("  Note: '-scale' is on and this can cause more problems.\n");
-		}
-	}
-	if (ncache && getenv("NCACHE_DEBUG")) {
-		ncdb = 1;
-	}
-
-	/* check for OS with small shm limits */
-	if (using_shm && ! single_copytile) {
-		if (limit_shm()) {
-			single_copytile = 1;
-		}
-	}
-
-	single_copytile_orig = single_copytile;
-
-	/* check for MIT-SHM */
-	if (! XShmQueryExtension_wr(dpy)) {
-		xshm_present = 0;
-		if (! using_shm) {
-			if (! quiet && ! raw_fb_str) {
-				rfbLog("info: display does not support XShm.\n");
-			}
-		} else {
-		    if (! quiet && ! raw_fb_str) {
-			rfbLog("\n");
-			rfbLog("warning: XShm extension is not available.\n");
-			rfbLog("For best performance the X Display should be local. (i.e.\n");
-			rfbLog("the x11vnc and X server processes should be running on\n");
-			rfbLog("the same machine.)\n");
-#if LIBVNCSERVER_HAVE_XSHM
-			rfbLog("Restart with -noshm to override this.\n");
-		    }
-		    exit(1);
-#else
-			rfbLog("Switching to -noshm mode.\n");
-		    }
-		    using_shm = 0;
-#endif
-		}
-	} else {
-#if !NO_X11
-		int op, ev, er;
-		if (XQueryExtension(dpy, "MIT-SHM", &op, &ev, &er)) {
-			xshm_opcode = op;
-			if (0) fprintf(stderr, "xshm_opcode: %d %d %d\n", op, ev, er);
-		}
-#endif
-	}
-
-#if LIBVNCSERVER_HAVE_XKEYBOARD
-	/* check for XKEYBOARD */
-	initialize_xkb();
-	initialize_watch_bell();
-	if (!xkb_present && use_xkb_modtweak) {
-		if (! quiet && ! raw_fb_str) {
-			rfbLog("warning: disabling xkb modtweak. XKEYBOARD ext. not present.\n");
-		}
-		use_xkb_modtweak = 0;
-	}
-#endif
-
-	if (xkb_present && !use_xkb_modtweak && !got_noxkb) {
-		if (use_modifier_tweak) {
-			switch_to_xkb_if_better();
-		}
-	}
-
-#if LIBVNCSERVER_HAVE_LIBXRANDR
-	if (! XRRQueryExtension(dpy, &xrandr_base_event_type, &er)) {
-		if (xrandr && ! quiet && ! raw_fb_str) {
-			rfbLog("Disabling -xrandr mode: display does not support X RANDR.\n");
-		}
-		xrandr_base_event_type = 0;
-		xrandr = 0;
-		xrandr_maybe = 0;
-		xrandr_present = 0;
-	} else {
-		xrandr_present = 1;
-	}
-#endif
-
-	check_pm();
-
-	if (! quiet && ! raw_fb_str) {
-		rfbLog("--------------------------------------------------------\n");
-		rfbLog("\n");
-	}
-
-	raw_fb_pass_go_and_collect_200_dollars:
-
-	if (! dpy || raw_fb_str) {
-		int doit = 0;
-		/* XXX this needs improvement (esp. for remote control) */
-		if (! raw_fb_str || strstr(raw_fb_str, "console") == raw_fb_str) {
-#ifdef MACOSX
-			doit = 1;
-#endif
-		}
-		if (raw_fb_str && strstr(raw_fb_str, "vnc") == raw_fb_str) {
-			doit = 1;
-		}
-		if (doit) {
-			if (! multiple_cursors_mode) {
-				multiple_cursors_mode = strdup("most");
-			}
-			initialize_cursors_mode();
-			use_xdamage = orig_use_xdamage;
-			if (use_xdamage) {
-				xdamage_present = 1;
-				initialize_xdamage();
-			}
-		}
-	}
-
-	if (! dt) {
-		static char str[] = "-desktop";
-		argv_vnc[argc_vnc++] = str;
-		argv_vnc[argc_vnc++] = choose_title(use_dpy);
-		rfb_desktop_name = strdup(argv_vnc[argc_vnc-1]);
-	}
-	
-	/*
-	 * Create the XImage corresponding to the display framebuffer.
-	 */
-
-	fb0 = initialize_xdisplay_fb();
-
-	/*
-	 * In some cases (UINPUT touchscreens) we need the dpy_x dpy_y
-	 * to initialize pipeinput. So we do it after fb is created.
-	 */
-	initialize_pipeinput();
-
-	/*
-	 * n.b. we do not have to X_LOCK any X11 calls until watch_loop()
-	 * is called since we are single-threaded until then.
-	 */
-
-	initialize_screen(&argc_vnc, argv_vnc, fb0);
-
-	if (waited_for_client) {
-		if (fake_fb) {
-			free(fake_fb);
-			fake_fb = NULL;
-		}
-		if (use_solid_bg && client_count) {
-			solid_bg(0);
-		}
-		if (accept_cmd && strstr(accept_cmd, "popup") == accept_cmd) {
-			rfbClientIteratorPtr iter;
-			rfbClientPtr cl, cl0 = NULL;
-			int i = 0;
-			iter = rfbGetClientIterator(screen);
-			while( (cl = rfbClientIteratorNext(iter)) ) {
-				i++;	
-				if (i != 1) {
-					rfbLog("WAIT popup: too many clients\n");
-					clean_up_exit(1);
-				}
-				cl0 = cl;
-			}
-			rfbReleaseClientIterator(iter);
-			if (i != 1 || cl0 == NULL) {
-				rfbLog("WAIT popup: no clients.\n");
-				clean_up_exit(1);
-			}
-			if (! accept_client(cl0)) {
-				rfbLog("WAIT popup: denied.\n");
-				clean_up_exit(1);
-			}
-			rfbLog("waited_for_client: popup accepted.\n");
-			cl0->onHold = FALSE;
-		}
-		if (macosx_console) {
-			refresh_screen(1);
-		}
-		if (dpy && xdmcp_insert != NULL) {
-#if !NO_X11
-			char c;
-			int n = strlen(xdmcp_insert);
-			KeyCode k, k2;
-			KeySym sym;
-			int i, ok = 1;
-			for (i = 0; i < n; i++) {
-				c = xdmcp_insert[i];
-				sym = (KeySym) c;
-				if (sym < ' ' || sym > 0x7f) {
-					ok = 0;
-					break;
-				}
-				k = XKeysymToKeycode(dpy, sym);
-				if (k == NoSymbol) {
-					ok = 0;
-					break;
-				}
-			}
-			if (ok) {
-				XFlush_wr(dpy);
-				usleep(2*1000*1000);
-				if (!quiet) {
-					rfbLog("sending XDM '%s'\n", xdmcp_insert);
-				}
-				for (i = 0; i < n; i++) {
-					c = xdmcp_insert[i];
-					sym = (KeySym) c;
-					k = XKeysymToKeycode(dpy, sym);
-					if (isupper(c)) {
-						k2 = XKeysymToKeycode(dpy, XK_Shift_L);
-						XTestFakeKeyEvent_wr(dpy, k2, True, CurrentTime);
-						XFlush_wr(dpy);
-						usleep(100*1000);
-					}
-					if (0) fprintf(stderr, "C/k %c/%x\n", c, k);
-					XTestFakeKeyEvent_wr(dpy, k, True, CurrentTime);
-					XFlush_wr(dpy);
-					usleep(100*1000);
-					XTestFakeKeyEvent_wr(dpy, k, False, CurrentTime);
-					XFlush_wr(dpy);
-					usleep(100*1000);
-					if (isupper(c)) {
-						k2 = XKeysymToKeycode(dpy, XK_Shift_L);
-						XTestFakeKeyEvent_wr(dpy, k2, False, CurrentTime);
-						XFlush_wr(dpy);
-						usleep(100*1000);
-					}
-				}
-				k2 = XKeysymToKeycode(dpy, XK_Tab);
-				XTestFakeKeyEvent_wr(dpy, k2, True, CurrentTime);
-				XFlush_wr(dpy);
-				usleep(100*1000);
-				XTestFakeKeyEvent_wr(dpy, k2, False, CurrentTime);
-				XFlush_wr(dpy);
-				usleep(100*1000);
-			}
-			free(xdmcp_insert);
-#endif
-		}
-		check_redir_services();
-	}
-
-	if (! waited_for_client) {
-		if (try_http && ! got_httpdir && check_httpdir()) {
-			http_connections(1);
-		}
-		if (ssh_str != NULL) {
-			ssh_remote_tunnel(ssh_str, screen->port);
-		}
-	}
-
-	initialize_tiles();
-
-	/* rectangular blackout regions */
-	initialize_blackouts_and_xinerama();
-
-	/* created shm or XImages when using_shm = 0 */
-	initialize_polling_images();
-
-	initialize_signals();
-
-	initialize_speeds();
-
-	if (speeds_read_rate_measured > 80) {
-		/* framebuffer read is fast at > 80 MB/sec */
-		int same = 0;
-		if (waitms == defer_update) {
-			same = 1;
-		}
-		if (! got_waitms) {
-			waitms /= 2;
-			if (waitms < 5) {
-				waitms = 5;
-			}
-			if (!quiet) {
-				rfbLog("fast read: reset -wait  ms to: %d\n", waitms);
-			}
-		}
-		if (! got_deferupdate && ! got_defer) {
-			if (defer_update > 10) {
-				if (same) {
-					defer_update = waitms;
-				} else {
-					defer_update = 10;
-				}
-				if (screen) {
-					screen->deferUpdateTime = defer_update;
-				}
-				rfbLog("fast read: reset -defer ms to: %d\n", defer_update);
-			}
-		}
-	}
-
-	initialize_keyboard_and_pointer();
-
-	if (inetd && use_openssl) {
-		if (! waited_for_client) {
-			accept_openssl(OPENSSL_INETD, -1);
-		}
-	}
-	if (! inetd && ! use_openssl) {
-		if (! screen->port || screen->listenSock < 0) {
-			if (got_rfbport && got_rfbport_val == 0) {
-				;
-			} else if (ipv6_listen && ipv6_listen_fd >= 0) {
-				rfbLog("Info: listening only on IPv6 interface.\n");
-			} else {
-				rfbLogEnable(1);
-				rfbLog("Error: could not obtain listening port.\n");
-				if (!got_rfbport && !got_ipv6_listen) {
-					rfbLog("If this system is IPv6-only, use the -6 option.\n");
-				}
-				clean_up_exit(1);
-			}
-		}
-	}
-
-#ifdef MACOSX
-	if (remote_cmd || query_cmd) {
-		;
-	} else if (macosx_console) {
-		double dt = dnow();
-		copy_screen();
-		dt = dnow() - dt;
-		rfbLog("macosx_console: copied screen in %.3f sec %.1f MB/sec\n",
-		    dt, dpy_x * dpy_y * bpp / (1e+6 * 8 * dt));
-
-	}
-#endif
-
-	if (! quiet) {
-		rfbLog("screen setup finished.\n");
-		if (SHOW_NO_PASSWORD_WARNING && !nopw) {
-			rfbLog("\n");
-			rfbLog("WARNING: You are running x11vnc WITHOUT"
-			    " a password.  See\n");
-			rfbLog("WARNING: the warning message printed above"
-			    " for more info.\n");
-		}
-	}
-	set_vnc_desktop_name();
-
-	if (ncache_beta_tester && (ncache != 0 || ncache_msg)) {
-		ncache_beta_tester_message();
-	}
-
-	if (remote_cmd || query_cmd) {
-		/* This is DIRECT: case */
-		do_remote_query(remote_cmd, query_cmd, remote_sync, query_default);
-		if (getenv("SLEEP")) sleep(atoi(getenv("SLEEP")));
-		clean_up_exit(0);
-	}
-
-#if LIBVNCSERVER_HAVE_FORK && LIBVNCSERVER_HAVE_SETSID
-	if (bg) {
-		int p, n;
-		if (getenv("X11VNC_LOOP_MODE_BG")) {
-			if (screen && screen->listenSock >= 0) {
-				close(screen->listenSock);
-				FD_CLR(screen->listenSock,&screen->allFds);
-				screen->listenSock = -1;
-			}
-			if (screen && screen->httpListenSock >= 0) {
-				close(screen->httpListenSock);
-				screen->httpListenSock = -1;
-			}
-			if (openssl_sock >= 0) {
-				close(openssl_sock);
-				openssl_sock = -1;
-			}
-			if (https_sock >= 0) {
-				close(https_sock);
-				https_sock = -1;
-			}
-			if (openssl_sock6 >= 0) {
-				close(openssl_sock6);
-				openssl_sock6 = -1;
-			}
-			if (https_sock6 >= 0) {
-				close(https_sock6);
-				https_sock6 = -1;
-			}
-			if (ipv6_listen_fd >= 0) {
-				close(ipv6_listen_fd);
-				ipv6_listen_fd = -1;
-			}
-			if (ipv6_http_fd >= 0) {
-				close(ipv6_http_fd);
-				ipv6_http_fd = -1;
-			}
-		}
-		/* fork into the background now */
-		if ((p = fork()) > 0)  {
-			exit(0);
-		} else if (p == -1) {
-			rfbLogEnable(1);
-			fprintf(stderr, "could not fork\n");
-			perror("fork");
-			clean_up_exit(1);
-		}
-		if (setsid() == -1) {
-			rfbLogEnable(1);
-			fprintf(stderr, "setsid failed\n");
-			perror("setsid");
-			clean_up_exit(1);
-		}
-		/* adjust our stdio */
-		n = open("/dev/null", O_RDONLY);
-		dup2(n, 0);
-		dup2(n, 1);
-		if (! logfile) {
-			dup2(n, 2);
-		}
-		if (n > 2) {
-			close(n);
-		}
-	}
-#endif
-
-	watch_loop();
-
-	return(0);
-
-#undef argc
-#undef argv
-
-}
-
diff --git a/ica/x11/x11vnc/x11vnc.h b/ica/x11/x11vnc/x11vnc.h
deleted file mode 100644
index 211f82b..0000000
--- a/ica/x11/x11vnc/x11vnc.h
+++ /dev/null
@@ -1,708 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_X11VNC_H
-#define _X11VNC_X11VNC_H
-
-/* -- x11vnc.h -- */
-/* 
- * These ' -- filename.[ch] -- ' comments represent a partial cleanup:
- * they are an odd way to indicate how this huge file would be split up
- * someday into multiple files.
- *
- * The primary reason we have not broken up this file is for user
- * convenience: those wanting to use the latest version download a single
- * file, x11vnc.c, and off they go...
- */
-
-/****************************************************************************/
-
-/* Standard includes and libvncserver */
-
-#include <unistd.h>
-#ifndef WIN32
-#include <sys/utsname.h>
-#else
-#include <ws2tcpip.h>
-#define _POSIX
-#define __USE_MINGW_ALARM
-#endif
-#include <signal.h>
-#ifdef __hpux
-/* to avoid select() compiler warning */
-#include <sys/time.h>
-#endif
-#include <time.h>
-#include <errno.h>
-
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#include <rfb/rfb.h>
-#include <rfb/rfbregion.h>
-
-
-/* we can now build under --without-x: */
-#if LIBVNCSERVER_HAVE_X11
-
-#define NO_X11 0
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#include <X11/keysym.h>
-#include <X11/Xatom.h>
-
-#else
-
-#define NO_X11 1
-#ifndef SKIP_NO_X11
-#include "nox11.h"
-#endif
-#include <rfb/keysym.h>
-
-#endif
-
-/****************************************************************************/
-
-
-/*
- * Build-time customization via CPPFLAGS.
- *
- * Summary of options to include in CPPFLAGS for custom builds:
- *
- * -DVNCSHARED  to have the vnc display shared by default.
- * -DFOREVER  to have -forever on by default.
- * -DNOREPEAT=0  to have -repeat on by default.
- * -DXINERAMA=0  to have -noxinerama on by default.
- * -DADDKEYSYMS=0  to have -noadd_keysyms the default.
- *
- * -DREMOTE_DEFAULT=0  to disable remote-control on by default (-yesremote).
- * -DREMOTE_CONTROL=0  to disable remote-control mechanism completely.
- * -DEXTERNAL_COMMANDS=0  to disable the running of all external commands.
- * -DTIGHTFILEXFER=0  disable tightfilexfer.
- *
- * -DHARDWIRE_PASSWD=...      hardwired passwords, quoting necessary.
- * -DHARDWIRE_VIEWPASSWD=...
- * -DNOPW=1                   make -nopw the default (skip warning)
- * -DUSEPW=1                  make -usepw the default
- * -DPASSWD_REQUIRED=1        exit unless a password is supplied.
- * -DPASSWD_UNLESS_NOPW=1     exit unless a password is supplied and no -nopw.
- *
- * -DCURSOR_DRAG=1  to have -cursor_drag as the default.
- * -DWIREFRAME=0  to have -nowireframe as the default.
- * -DWIREFRAME_COPYRECT=0  to have -nowirecopyrect as the default.
- * -DWIREFRAME_PARMS=...   set default -wirecopyrect parameters.
- * -DSCROLL_COPYRECT=0     to have -noscrollcopyrect as the default.
- * -DSCROLL_COPYRECT_PARMS=...  set default -scrollcopyrect parameters.
- * -DSCALING_COPYRECT=0
- * -DXDAMAGE=0    to have -noxdamage as the default.
- * -DSKIPDUPS=0   to have -noskip_dups as the default or vice versa.
- *
- * -DPOINTER_MODE_DEFAULT={0,1,2,3,4}  set default -pointer_mode.
- * -DBOLDLY_CLOSE_DISPLAY=0  to not close X DISPLAY under -rawfb.
- * -DSMALL_FOOTPRINT=1  for smaller binary size (no help, no gui, etc) 
- *                      use 2 or 3 for even smaller footprint.
- * -DNOGUI  do not include the gui tkx11vnc.
- * -DSKIP_HELP=1   smaller.
- * -DSKIP_XKB=1    a little smaller.
- * -DSKIP_8to24=1  a little smaller.
- * -DPOLL_8TO24_DELAY=N  
- * -DDEBUG_XEVENTS=1  enable printout for X events.
- *
- * -DX11VNC_MACOSX_USE_GETMAINDEVICE use deprecated GetMainDevice on macosx 
- *
- * -DX11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS={0,1}
- * -DX11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS={0,1}
- * -DX11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER={0,1}
- *
- * or for all:
- *
- * -DX11VNC_MACOSX_NO_DEPRECATED=1
- *
- * env. var. of the same names as above can be set to imply true.
- *
- * Set these in CPPFLAGS before running configure. E.g.:
- *
- *   % env CPPFLAGS="-DFOREVER -DREMOTE_CONTROL=0" ./configure
- *   % make
- */
-
-/*
- * This can be used to disable the remote control mechanism.
- */
-#ifndef REMOTE_CONTROL
-#define REMOTE_CONTROL 1
-#endif
-
-#ifndef XINERAMA
-#define XINERAMA 1
-#endif
-
-#ifndef NOPW
-#define NOPW 0
-#endif
-
-#ifndef USEPW
-#define USEPW 0
-#endif
-
-#ifndef PASSWD_REQUIRED
-#define PASSWD_REQUIRED 0
-#endif
-
-#ifndef PASSWD_UNLESS_NOPW
-#define PASSWD_UNLESS_NOPW 0
-#endif
-
-/* some -D macros for building with old LibVNCServer */
-#ifndef LIBVNCSERVER_HAS_STATS
-#define LIBVNCSERVER_HAS_STATS 1
-#endif
-
-#ifndef LIBVNCSERVER_HAS_SHUTDOWNSOCKETS
-#define LIBVNCSERVER_HAS_SHUTDOWNSOCKETS 1
-#endif
-
-#ifndef LIBVNCSERVER_HAS_TEXTCHAT
-#define LIBVNCSERVER_HAS_TEXTCHAT 1
-#endif
-
-#ifdef PRE_0_8_LIBVNCSERVER
-#undef  LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
-#undef  LIBVNCSERVER_HAS_STATS
-#undef  LIBVNCSERVER_HAS_SHUTDOWNSOCKETS
-#undef  LIBVNCSERVER_HAS_TEXTCHAT 
-#define LIBVNCSERVER_HAS_STATS 0
-#define LIBVNCSERVER_HAS_SHUTDOWNSOCKETS 0
-#define LIBVNCSERVER_HAS_TEXTCHAT 0
-#endif
-
-/* these are for delaying features: */
-#define xxNO_NCACHE
-
-/*
- * Beginning of support for small binary footprint build for embedded
- * systems, PDA's etc.  It currently just cuts out the low-hanging
- * fruit (large text passages).  Set to 2, 3 to cut out some of the
- * more esoteric extensions.  More tedious is to modify LDFLAGS in the
- * Makefile to not link against the extension libraries... but that
- * should be done too (manually for now).
- *
- * If there is interest more of the bloat can be removed...  Currently
- * these shrink the binary from 1100K to about 600K.
- */
-#ifndef SMALL_FOOTPRINT
-#define SMALL_FOOTPRINT 0
-#endif
-
-#ifndef SKIP_XKB
-#define SKIP_XKB 0
-#endif
-#ifndef SKIP_8TO24
-#define SKIP_8TO24 0
-#endif
-#ifndef SKIP_HELP
-#define SKIP_HELP 0
-#endif
-
-#if SMALL_FOOTPRINT
-#undef  NOGUI
-#define NOGUI
-#undef  SKIP_HELP
-#define SKIP_HELP 1
-#endif
-
-#if (SMALL_FOOTPRINT > 1)
-#undef SKIP_XKB
-#undef SKIP_8TO24
-#undef LIBVNCSERVER_HAVE_LIBXINERAMA
-#undef LIBVNCSERVER_HAVE_LIBXFIXES
-#undef LIBVNCSERVER_HAVE_LIBXDAMAGE
-#define SKIP_XKB 1
-#define SKIP_8TO24 1
-#define LIBVNCSERVER_HAVE_LIBXINERAMA 0
-#define LIBVNCSERVER_HAVE_LIBXFIXES 0
-#define LIBVNCSERVER_HAVE_LIBXDAMAGE 0
-#endif
-
-#if (SMALL_FOOTPRINT > 2)
-#undef LIBVNCSERVER_HAVE_UTMPX_H
-#undef LIBVNCSERVER_HAVE_PWD_H
-#undef REMOTE_CONTROL
-#define LIBVNCSERVER_HAVE_UTMPX_H 0
-#define LIBVNCSERVER_HAVE_PWD_H 0
-#define REMOTE_CONTROL 0
-#endif
-
-#ifndef X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS
-#if     X11VNC_MACOSX_NO_DEPRECATED
-#define X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS 1
-#else
-#define X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS 0
-#endif
-#endif
-
-#ifndef X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS
-#if     X11VNC_MACOSX_NO_DEPRECATED
-#define X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS 1
-#else
-#define X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS 0
-#endif
-#endif
-
-#ifndef X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER
-#if     X11VNC_MACOSX_NO_DEPRECATED
-#define X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER 1
-#else
-#define X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER 0
-#endif
-#endif
-
-/*
- * Not recommended unless you know what you are getting into, but if you
- * define the HARDWIRE_PASSWD or HARDWIRE_VIEWPASSWD variables here or in
- * CPPFLAGS you can set a default -passwd and -viewpasswd string values,
- * perhaps this would be better than nothing on an embedded system, etc.
- * These default values will be overridden by the command line.
- * We don't even give an example ;-)
- */
-
-/****************************************************************************/
-
-/* Extensions and related includes: */
-
-#if LIBVNCSERVER_HAVE_XSHM
-#  if defined(__hpux) && defined(__ia64)  /* something weird on hp/itanic */
-#    undef _INCLUDE_HPUX_SOURCE
-#  endif
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-#endif
-#if LIBVNCSERVER_HAVE_SHMAT
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#endif
-
-#include <dirent.h>
-
-#if LIBVNCSERVER_HAVE_XTEST
-#include <X11/extensions/XTest.h>
-#endif
-extern int xtest_base_event_type;
-
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include <X11/extensions/xtraplib.h>
-#include <X11/extensions/xtraplibp.h>
-extern XETC *trap_ctx;
-#endif
-extern int xtrap_base_event_type;
-
-#if LIBVNCSERVER_HAVE_RECORD
-#include <X11/Xproto.h>
-#include <X11/extensions/record.h>
-#endif
-
-#if LIBVNCSERVER_HAVE_XKEYBOARD
-#include <X11/XKBlib.h>
-#endif
-
-#if LIBVNCSERVER_HAVE_LIBXINERAMA
-#include <X11/extensions/Xinerama.h>
-#endif
-
-#if LIBVNCSERVER_HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifndef WIN32
-#include <netdb.h>
-#endif
-
-#if !defined(_AIX) && !defined(WIN32)
-extern int h_errno;
-#endif
-
-#if LIBVNCSERVER_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#endif
-
-#ifndef SOL_IPV6
-#ifdef  IPPROTO_IPV6
-#define SOL_IPV6 IPPROTO_IPV6
-#endif
-#endif
-
-#ifndef IPV6_V6ONLY
-#ifdef  IPV6_BINDV6ONLY
-#define IPV6_V6ONLY IPV6_BINDV6ONLY
-#endif
-#endif
-
-#ifndef X11VNC_IPV6
-#if defined(AF_INET6)
-#define X11VNC_IPV6 1
-#else
-#define X11VNC_IPV6 0
-#endif
-#endif
-
-#ifndef X11VNC_LISTEN6
-#define X11VNC_LISTEN6 1
-#endif
-
-#if !X11VNC_IPV6
-#undef  X11VNC_LISTEN6
-#define X11VNC_LISTEN6 0
-#endif
-
-#if LIBVNCSERVER_HAVE_PWD_H
-#include <pwd.h>
-#include <grp.h>
-#endif
-#if LIBVNCSERVER_HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#if LIBVNCSERVER_HAVE_UTMPX_H
-#include <utmpx.h>
-#endif
-
-#if LIBVNCSERVER_HAVE_MMAP
-#include <sys/mman.h>
-#endif
-
-/*
- * overlay/multi-depth screen reading support
- * undef SOLARIS_OVERLAY or IRIX_OVERLAY if there are problems building.
- */
-
-/* solaris/sun */
-#if defined (__SVR4) && defined (__sun)
-# define SOLARIS
-# ifdef LIBVNCSERVER_HAVE_SOLARIS_XREADSCREEN
-#  define SOLARIS_OVERLAY
-#  define OVERLAY_OS
-# endif
-#endif
-
-#ifdef SOLARIS_OVERLAY
-#include <X11/extensions/transovl.h>
-#endif
-
-/* irix/sgi */
-#if defined(__sgi)
-# define IRIX
-# ifdef LIBVNCSERVER_HAVE_IRIX_XREADDISPLAY
-#  define IRIX_OVERLAY
-#  define OVERLAY_OS
-# endif
-#endif
-
-/*
- * For reference, the OS header defines:
- __SVR4 && __sun   is solaris
- __sgi
- __hpux
- __osf__
- __OpenBSD__
- __FreeBSD__
- __NetBSD__
- __linux__
- (defined(__MACH__) && defined(__APPLE__))
- _AIX
- */
-#if (defined(__MACH__) && defined(__APPLE__))
-#define MACOSX
-#endif
-
-
-#ifdef IRIX_OVERLAY
-#include <X11/extensions/readdisplay.h>
-#endif
-
-extern int overlay_present;
-
-#if LIBVNCSERVER_HAVE_LIBXRANDR
-#include <X11/extensions/Xrandr.h>
-#endif
-extern int xrandr_base_event_type;
-
-#if LIBVNCSERVER_HAVE_LIBXFIXES
-#include <X11/extensions/Xfixes.h>
-#endif
-extern int xfixes_base_event_type;
-
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-#include <X11/extensions/Xdamage.h>
-#endif
-extern int xdamage_base_event_type;
-
-#define RAWFB_RET(y)   if (raw_fb && ! dpy) return y;
-#define RAWFB_RET_VOID if (raw_fb && ! dpy) return;
-
-extern char lastmod[];
-
-/* X display info */
-
-extern Display *dpy;		/* the single display screen we connect to */
-extern int scr;
-extern char *xauth_raw_data;
-extern int xauth_raw_len;
-extern Window window, rootwin;		/* polled window, root window (usu. same) */
-extern Visual *default_visual;		/* the default visual (unless -visual) */
-extern int bpp, depth;
-extern int indexed_color;
-extern int dpy_x, dpy_y;		/* size of display */
-extern int fb_x, fb_y, fb_b;		/* fb size and bpp guesses at display */
-extern int off_x, off_y;		/* offsets for -sid */
-extern int wdpy_x, wdpy_y;		/* for actual sizes in case of -clip */
-extern int cdpy_x, cdpy_y, coff_x, coff_y;	/* the -clip params */
-extern int button_mask;		/* button state and info */
-extern int button_mask_prev;
-extern int num_buttons;
-
-extern long xselectinput_rootwin;
-
-extern unsigned int display_button_mask;
-extern unsigned int display_mod_mask;
-
-/* image structures */
-extern XImage *scanline;
-extern XImage *fullscreen;
-extern XImage **tile_row;	/* for all possible row runs */
-extern XImage *snaprect;	/* for XShmGetImage (fs_factor) */
-extern XImage *snap;		/* the full snap fb */
-extern XImage *raw_fb_image;	/* the raw fb */
-
-#if !LIBVNCSERVER_HAVE_XSHM
-/*
- * for simplicity, define this struct since we'll never use them
- * under using_shm = 0.
- */
-typedef struct {
-	int shmid; char *shmaddr; Bool readOnly;
-} XShmSegmentInfo;
-#endif
-
-/* corresponding shm structures */
-extern XShmSegmentInfo scanline_shm;
-extern XShmSegmentInfo fullscreen_shm;
-extern XShmSegmentInfo *tile_row_shm;	/* for all possible row runs */
-extern XShmSegmentInfo snaprect_shm;
-
-/* rfb screen info */
-extern rfbScreenInfoPtr screen;
-extern char *rfb_desktop_name;
-extern char *http_dir;
-extern char vnc_desktop_name[];
-extern char *main_fb;			/* our copy of the X11 fb */
-extern char *rfb_fb;			/* same as main_fb unless transformation */
-extern char *fake_fb;			/* used under -padgeom */
-extern char *snap_fb;			/* used under -snapfb */
-extern char *cmap8to24_fb;		/* used under -8to24 */
-extern char *rot_fb;			/* used under -rotate */
-extern char *raw_fb;
-extern char *raw_fb_addr;
-extern int raw_fb_offset;
-extern int raw_fb_shm;
-extern int raw_fb_mmap;
-extern int raw_fb_seek;
-extern int raw_fb_fd;
-extern int raw_fb_back_to_X;
-
-extern int raw_fb_native_bpp;
-extern int raw_fb_expand_bytes;
-extern unsigned long  raw_fb_native_red_mask,  raw_fb_native_green_mask,  raw_fb_native_blue_mask;
-extern unsigned short raw_fb_native_red_max,   raw_fb_native_green_max,   raw_fb_native_blue_max;
-extern unsigned short raw_fb_native_red_shift, raw_fb_native_green_shift, raw_fb_native_blue_shift;
-
-extern int rfb_bytes_per_line;
-extern int main_bytes_per_line;
-extern int rot_bytes_per_line;
-extern unsigned long  main_red_mask,  main_green_mask,  main_blue_mask;
-extern unsigned short main_red_max,   main_green_max,   main_blue_max;
-extern unsigned short main_red_shift, main_green_shift, main_blue_shift;
-
-extern int raw_fb_bytes_per_line;	/* of actual raw region we poll, not our raw_fb */
-
-/* scaling parameters */
-extern char *scale_str;
-extern double scale_fac_x;
-extern double scale_fac_y;
-extern int scaling;
-extern int scaling_blend;		/* for no blending option (very course) */
-extern int scaling_nomult4;		/* do not require width = n * 4 */
-extern int scaling_pad;		/* pad out scaled sizes to fit denominator */
-extern int scaling_interpolate;	/* use interpolation scheme when shrinking */
-extern int scaled_x, scaled_y;		/* dimensions of scaled display */
-extern int scale_numer, scale_denom;	/* n/m */
-extern char *rotating_str;
-extern int rotating;
-extern int rotating_same;
-extern int rotating_cursors;
-
-/* scale cursor */
-extern char *scale_cursor_str;
-extern double scale_cursor_fac_x;
-extern double scale_cursor_fac_y;
-extern int scaling_cursor;
-extern int scaling_cursor_blend;
-extern int scaling_cursor_interpolate;
-extern int scale_cursor_numer, scale_cursor_denom;
-
-/* size of the basic tile unit that is polled for changes: */
-extern int tile_x;
-extern int tile_y;
-extern int ntiles, ntiles_x, ntiles_y;
-
-/* arrays that indicate changed or checked tiles. */
-extern unsigned char *tile_has_diff, *tile_tried, *tile_copied;
-extern unsigned char *tile_has_xdamage_diff, *tile_row_has_xdamage_diff;
-
-/* times of recent events */
-extern time_t last_event, last_input, last_client, last_open_xdisplay;
-extern time_t last_keyboard_input, last_pointer_input; 
-extern time_t last_local_input;	/* macosx */
-extern time_t last_fb_bytes_sent;
-extern double last_keyboard_time;
-extern double last_pointer_time;
-extern double last_pointer_click_time;
-extern double last_pointer_motion_time;
-extern double last_key_to_button_remap_time;
-extern double last_copyrect;
-extern double last_copyrect_fix;
-extern double last_wireframe;
-extern double servertime_diff;
-extern double x11vnc_start;
-extern double x11vnc_current;
-extern double g_now;
-
-extern double last_get_wm_frame_time;
-extern Window last_get_wm_frame;
-extern double last_bs_restore;
-extern double last_su_restore;
-extern double last_bs_save;
-extern double last_su_save;
-
-extern int hack_val;
-
-/* last client to move pointer */
-extern rfbClientPtr last_pointer_client;
-extern rfbClientPtr latest_client;
-extern double last_client_gone;
-extern double last_new_client;
-
-extern int waited_for_client;
-extern int findcreatedisplay;
-extern char *terminal_services_daemon;
-
-extern int client_count;
-extern int clients_served;
-extern int client_normal_count;
-
-/* more transient kludge variables: */
-extern int cursor_x, cursor_y;		/* x and y from the viewer(s) */
-extern int button_change_x, button_change_y;
-extern int got_user_input;
-extern int got_pointer_input;
-extern int got_local_pointer_input;
-extern int got_pointer_calls;
-extern int got_keyboard_input;
-extern int got_keyboard_calls;
-extern int urgent_update;
-extern int last_keyboard_keycode;
-extern rfbBool last_rfb_down;
-extern rfbBool last_rfb_key_accepted;
-extern rfbKeySym last_rfb_keysym;
-extern double last_rfb_keytime;
-extern double last_rfb_key_injected;
-extern double last_rfb_ptr_injected;
-extern int fb_copy_in_progress;	
-extern int drag_in_progress;	
-extern int shut_down;	
-extern int do_copy_screen;	
-extern time_t damage_time;
-extern int damage_delay;
-
-extern int program_pid;
-extern char *program_name;
-extern char *program_cmdline;
-
-extern struct utsname UT;
-
-typedef struct hint {
-	/* location x, y, height, and width of a change-rectangle  */
-	/* (grows as adjacent horizontal tiles are glued together) */
-	int x, y, w, h;
-} hint_t;
-
-/* struct with client specific data: */
-#define CILEN 10
-typedef struct _ClientData {
-	int uid;
-	char *hostname;
-	char *username;
-	char *unixname;
-	int client_port;
-	int server_port;
-	char *server_ip;
-	char input[CILEN];
-	int login_viewonly;
-	time_t login_time;
-
-	pid_t ssl_helper_pid;
-
-	int had_cursor_shape_updates;
-	int had_cursor_pos_updates;
-
-	double timer;
-	double send_cmp_rate;
-	double send_raw_rate;
-	double latency;
-	int cmp_bytes_sent;
-	int raw_bytes_sent;
-
-} ClientData;
-
-extern void nox11_exit(int rc);
-
-#include "params.h"
-#include "enums.h"
-#include "options.h"
-#include "util.h"
-
-#endif /* _X11VNC_X11VNC_H */
diff --git a/ica/x11/x11vnc/x11vnc_defs.c b/ica/x11/x11vnc/x11vnc_defs.c
deleted file mode 100644
index 081428d..0000000
--- a/ica/x11/x11vnc/x11vnc_defs.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- x11vnc_defs.c -- */
-
-#include "x11vnc.h"
-
-int overlay_present = 0;
-
-int xrandr_base_event_type = 0;
-
-int xfixes_base_event_type = 0;
-int xtest_base_event_type = 0;
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-XETC *trap_ctx = NULL;
-#endif
-int xtrap_base_event_type = 0;
-int xdamage_base_event_type = 0;
-
-/*               date +'lastmod: %Y-%m-%d' */
-char lastmod[] = "0.9.13 lastmod: 2010-12-27";
-
-/* X display info */
-
-Display *dpy = NULL;		/* the single display screen we connect to */
-int scr = 0;
-char *xauth_raw_data = NULL;
-int xauth_raw_len = 0;
-Window window = None, rootwin = None;	/* polled window, root window (usu. same) */
-Visual *default_visual = NULL;	/* the default visual (unless -visual) */
-int bpp = 0, depth = 0;
-int indexed_color = 0;
-int dpy_x = 0, dpy_y = 0;		/* size of display */
-int fb_x = 0, fb_y = 0, fb_b = 0;	/* fb size and bpp guesses at display */
-int off_x, off_y;		/* offsets for -sid */
-int wdpy_x, wdpy_y;		/* for actual sizes in case of -clip */
-int cdpy_x, cdpy_y, coff_x, coff_y;	/* the -clip params */
-int button_mask = 0;		/* button state and info */
-int button_mask_prev = 0;
-int num_buttons = -1;
-
-long xselectinput_rootwin = 0;
-
-unsigned int display_button_mask = 0;
-unsigned int display_mod_mask = 0;
-
-/* image structures */
-XImage *scanline = NULL;
-XImage *fullscreen = NULL;
-XImage **tile_row = NULL;	/* for all possible row runs */
-XImage *snaprect = NULL;	/* for XShmGetImage (fs_factor) */
-XImage *snap = NULL;		/* the full snap fb */
-XImage *raw_fb_image = NULL;	/* the raw fb */
-
-/* corresponding shm structures */
-XShmSegmentInfo scanline_shm;
-XShmSegmentInfo fullscreen_shm;
-XShmSegmentInfo *tile_row_shm;	/* for all possible row runs */
-XShmSegmentInfo snaprect_shm;
-
-/* rfb screen info */
-rfbScreenInfoPtr screen = NULL;
-char *rfb_desktop_name = NULL;
-char *http_dir = NULL;
-char vnc_desktop_name[256];
-char *main_fb = NULL;		/* our copy of the X11 fb */
-char *rfb_fb = NULL;		/* same as main_fb unless transformation */
-char *fake_fb = NULL;		/* used under -padgeom */
-char *snap_fb = NULL;		/* used under -snapfb */
-char *cmap8to24_fb = NULL;	/* used under -8to24 */
-char *rot_fb = NULL;
-char *raw_fb = NULL;		/* when used should be main_fb */
-char *raw_fb_addr = NULL;
-int raw_fb_offset = 0;
-int raw_fb_shm = 0;
-int raw_fb_mmap = 0;
-int raw_fb_seek = 0;
-int raw_fb_fd = -1;
-int raw_fb_back_to_X = 0;	/* kludge for testing rawfb -> X */
-
-int raw_fb_native_bpp = 0;
-int raw_fb_expand_bytes = 1;
-unsigned long  raw_fb_native_red_mask = 0,  raw_fb_native_green_mask = 0,  raw_fb_native_blue_mask = 0;
-unsigned short raw_fb_native_red_max = 0,   raw_fb_native_green_max = 0,   raw_fb_native_blue_max = 0;
-unsigned short raw_fb_native_red_shift = 0, raw_fb_native_green_shift = 0, raw_fb_native_blue_shift = 0;
-
-int rfb_bytes_per_line = 0;
-int main_bytes_per_line = 0;
-int rot_bytes_per_line = 0;
-unsigned long  main_red_mask = 0,  main_green_mask = 0,  main_blue_mask = 0;
-unsigned short main_red_max = 0,   main_green_max = 0,   main_blue_max = 0;
-unsigned short main_red_shift = 0, main_green_shift = 0, main_blue_shift = 0;
-
-int raw_fb_bytes_per_line = 0;
-
-/* scaling parameters */
-char *scale_str = NULL;
-double scale_fac_x = 1.0;
-double scale_fac_y = 1.0;
-int scaling = 0;
-int scaling_blend = 1;		/* for no blending option (very course) */
-int scaling_nomult4 = 0;	/* do not require width = n * 4 */
-int scaling_pad = 0;		/* pad out scaled sizes to fit denominator */
-int scaling_interpolate = 0;	/* use interpolation scheme when shrinking */
-int scaled_x = 0, scaled_y = 0;	/* dimensions of scaled display */
-int scale_numer = 0, scale_denom = 0;	/* n/m */
-char *rotating_str = NULL;
-int rotating = 0;
-int rotating_same = 0;
-int rotating_cursors = 0;
-
-/* scale cursor */
-char *scale_cursor_str = NULL;
-double scale_cursor_fac_x = 1.0;
-double scale_cursor_fac_y = 1.0;
-int scaling_cursor = 0;
-int scaling_cursor_blend = 1;
-int scaling_cursor_interpolate = 0;
-int scale_cursor_numer = 0, scale_cursor_denom = 0;
-
-/* size of the basic tile unit that is polled for changes: */
-int tile_x = 32;
-int tile_y = 32;
-int ntiles, ntiles_x = 0, ntiles_y = 0;
-
-/* arrays that indicate changed or checked tiles. */
-unsigned char *tile_has_diff = NULL, *tile_tried = NULL, *tile_copied = NULL;
-unsigned char *tile_has_xdamage_diff = NULL, *tile_row_has_xdamage_diff = NULL;
-
-/* times of recent events */
-time_t last_event = 0, last_input = 0, last_client = 0, last_open_xdisplay = 0;
-time_t last_local_input = 0;
-time_t last_keyboard_input = 0, last_pointer_input = 0; 
-time_t last_fb_bytes_sent = 0;
-double last_keyboard_time = 0.0;
-double last_pointer_time = 0.0;
-double last_pointer_click_time = 0.0;
-double last_pointer_motion_time = 0.0;
-double last_key_to_button_remap_time = 0.0;
-double last_copyrect = 0.0;
-double last_copyrect_fix = 0.0;
-double last_wireframe = 0.0;
-double servertime_diff = 0.0;
-double x11vnc_start = 0.0;
-double x11vnc_current = 0.0;
-double g_now = 0.0;
-
-double last_get_wm_frame_time = 0.0;
-Window last_get_wm_frame = None;
-double last_bs_restore = 0.0;
-double last_su_restore = 0.0;
-double last_bs_save = 0.0;
-double last_su_save = 0.0;
-
-int hack_val = 0;
-
-/* last client to move pointer */
-rfbClientPtr last_pointer_client = NULL;
-rfbClientPtr latest_client = NULL;
-double last_client_gone = 0.0;
-double last_new_client = 0.0;
-
-int waited_for_client = 0;
-int findcreatedisplay = 0;
-char *terminal_services_daemon = NULL;
-
-int client_count = 0;
-int clients_served = 0;
-int client_normal_count = 0;
-
-/* more transient kludge variables: */
-int cursor_x = 0, cursor_y = 0;		/* x and y from the viewer(s) */
-int button_change_x = 0, button_change_y = 0;
-int got_user_input = 0;
-int got_pointer_input = 0;
-int got_local_pointer_input = 0;
-int got_pointer_calls = 0;
-int got_keyboard_input = 0;
-int got_keyboard_calls = 0;
-int urgent_update = 0;
-int last_keyboard_keycode = 0;
-rfbBool last_rfb_down = FALSE;
-rfbBool last_rfb_key_accepted = FALSE;
-rfbKeySym last_rfb_keysym = 0;
-double last_rfb_keytime = 0.0;
-double last_rfb_key_injected = 0.0;
-double last_rfb_ptr_injected = 0.0;
-int fb_copy_in_progress = 0;	
-int drag_in_progress = 0;	
-int shut_down = 0;	
-int do_copy_screen = 0;	
-time_t damage_time = 0;
-int damage_delay = 0;
-
-int program_pid = 0;
-char *program_name = NULL;
-char *program_cmdline = NULL;
-
-#ifndef WIN32
-struct utsname UT;
-#endif
-
-
diff --git a/ica/x11/x11vnc/xdamage.c b/ica/x11/x11vnc/xdamage.c
deleted file mode 100644
index 3eb12f5..0000000
--- a/ica/x11/x11vnc/xdamage.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xdamage.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "userinput.h"
-#include "unixpw.h"
-
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-Damage xdamage = 0;
-#endif
-
-#ifndef XDAMAGE
-#define XDAMAGE 1
-#endif
-int use_xdamage = XDAMAGE;	/* use the xdamage rects for scanline hints */
-int xdamage_present = 0;
-
-#ifdef MACOSX
-int xdamage_max_area = 50000;
-#else
-int xdamage_max_area = 20000;	/* pixels */
-#endif
-
-double xdamage_memory = 1.0;	/* in units of NSCAN */
-int xdamage_tile_count = 0, xdamage_direct_count = 0;
-double xdamage_scheduled_mark = 0.0;
-double xdamage_crazy_time = 0.0;
-double xdamage_crazy_delay = 300.0;
-sraRegionPtr xdamage_scheduled_mark_region = NULL;
-sraRegionPtr *xdamage_regions = NULL;
-int xdamage_ticker = 0;
-int XD_skip = 0, XD_tot = 0, XD_des = 0;	/* for stats */
-
-void add_region_xdamage(sraRegionPtr new_region);
-void clear_xdamage_mark_region(sraRegionPtr markregion, int flush);
-int collect_non_X_xdamage(int x_in, int y_in, int w_in, int h_in, int call);
-int collect_xdamage(int scancnt, int call);
-int xdamage_hint_skip(int y);
-void initialize_xdamage(void);
-void create_xdamage_if_needed(int force);
-void destroy_xdamage_if_needed(void);
-void check_xdamage_state(void);
-
-static void record_desired_xdamage_rect(int x, int y, int w, int h);
-
-
-static void record_desired_xdamage_rect(int x, int y, int w, int h) {
-	/*
-	 * Unfortunately we currently can't trust an xdamage event
-	 * to correspond to real screen damage.  E.g. focus-in for
-	 * mozilla (depending on wm) will mark the whole toplevel
-	 * area as damaged, when only the border has changed.
-	 * Similar things for terminal windows.
-	 *
-	 * This routine uses some heuristics to detect small enough
-	 * damage regions that we will not have a performance problem
-	 * if we believe them even though they are wrong.  We record
-	 * the corresponding tiles the damage regions touch.
-	 */
-	int dt_x, dt_y, nt_x1, nt_y1, nt_x2, nt_y2, nt;
-	int ix, iy, cnt = 0;
-	int area = w*h, always_accept = 0;
-	/*
-	 * XXX: not working yet, slow and overlaps with scan_display()
-	 * probably slow because tall skinny rectangles very inefficient
-	 * in general and in direct_fb_copy() (100X slower then horizontal).
-	 */
-	int use_direct_fb_copy = 0;
-	int wh_min, wh_max;
-	static int first = 1, udfb = 0;
-
-	/* compiler warning: */
-	nt_x1 = 0; nt_y1 = 0; nt_x2 = 0; nt_y2 = 0;
-
-	if (first) {
-		if (getenv("XD_DFC")) {
-			udfb = 1;
-		}
-		first = 0;
-	}
-	if (udfb) {
-		use_direct_fb_copy = 1;
-	}
-
-	if (xdamage_max_area <= 0) {
-		always_accept = 1;
-	}
-
-	if (!always_accept && area > xdamage_max_area) {
-		return;
-	}
-
-	dt_x = w / tile_x;
-	dt_y = h / tile_y;
-
-	if (w < h) {
-		wh_min = w;
-		wh_max = h;
-	} else {
-		wh_min = h;
-		wh_max = w;
-	}
-
-	if (!always_accept && dt_y >= 3 && area > 4000)  {
-		/*
-		 * if it is real it should be caught by a normal scanline
-		 * poll, but we might as well keep if small (tall line?).
-		 */
-		return;
-	}
-	
-	if (use_direct_fb_copy) {
-		X_UNLOCK;
-		direct_fb_copy(x, y, x + w, y + h, 1);
-		xdamage_direct_count++;
-		X_LOCK;
-	} else if (0 && wh_min < tile_x/4 && wh_max > 30 * wh_min) {
-		/* try it for long, skinny rects, XXX still no good */
-		X_UNLOCK;
-		direct_fb_copy(x, y, x + w, y + h, 1);
-		xdamage_direct_count++;
-		X_LOCK;
-	} else {
-
-		if (ntiles_x == 0 || ntiles_y == 0) {
-			/* too early. */
-			return;
-		}
-		nt_x1 = nfix(  (x)/tile_x, ntiles_x);
-		nt_x2 = nfix((x+w)/tile_x, ntiles_x);
-		nt_y1 = nfix(  (y)/tile_y, ntiles_y);
-		nt_y2 = nfix((y+h)/tile_y, ntiles_y);
-
-		/*
-		 * loop over the rectangle of tiles (1 tile for a small
-		 * input rect).
-		 */
-		for (ix = nt_x1; ix <= nt_x2; ix++) {
-			for (iy = nt_y1; iy <= nt_y2; iy++) {
-				nt = ix + iy * ntiles_x;
-				cnt++;
-				if (! tile_has_xdamage_diff[nt]) {
-					XD_des++;
-					tile_has_xdamage_diff[nt] = 1;
-				}
-				/* not used: */
-				tile_row_has_xdamage_diff[iy] = 1;
-				xdamage_tile_count++;
-			}
-		}
-	}
-	if (debug_xdamage > 1) {
-		fprintf(stderr, "xdamage: desired: %dx%d+%d+%d\tA: %6d  tiles="
-		    "%02d-%02d/%02d-%02d  tilecnt: %d\n", w, h, x, y,
-		    w * h, nt_x1, nt_x2, nt_y1, nt_y2, cnt);
-	}
-}
-
-void add_region_xdamage(sraRegionPtr new_region) {
-	sraRegionPtr reg;
-	int prev_tick, nreg;
-
-	if (! xdamage_regions) {
-		return;
-	}
-
-	nreg = (xdamage_memory * NSCAN) + 1;
-	prev_tick = xdamage_ticker - 1;
-	if (prev_tick < 0) {
-		prev_tick = nreg - 1;
-	}
-
-	reg = xdamage_regions[prev_tick];  
-	if (reg != NULL && new_region != NULL) {
-if (debug_xdamage > 1) fprintf(stderr, "add_region_xdamage: prev_tick: %d reg %p  new_region %p\n", prev_tick, (void *)reg, (void *)new_region);
-		sraRgnOr(reg, new_region);
-	}
-}
-
-void clear_xdamage_mark_region(sraRegionPtr markregion, int flush) {
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-	XEvent ev;
-	sraRegionPtr tmpregion;
-	int count = 0;
-
-	RAWFB_RET_VOID
-
-	if (! xdamage_present || ! use_xdamage) {
-		return;
-	}
-	if (! xdamage) {
-		return;
-	}
-	if (! xdamage_base_event_type) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	X_LOCK;
-	if (flush) {
-		XFlush_wr(dpy);
-	}
-	while (XCheckTypedEvent(dpy, xdamage_base_event_type+XDamageNotify, &ev)) {
-		count++;
-	}
-	/* clear the whole damage region */
-	XDamageSubtract(dpy, xdamage, None, None);
-	X_UNLOCK;
-
-	if (debug_tiles || debug_xdamage) {
-		fprintf(stderr, "clear_xdamage_mark_region: %d\n", count);
-	}
-
-	if (! markregion) {
-		/* NULL means mark the whole display */
-		tmpregion = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-		add_region_xdamage(tmpregion);
-		sraRgnDestroy(tmpregion);
-	} else {
-		add_region_xdamage(markregion);
-	}
-#else
-	if (0) flush++;        /* compiler warnings */
-	if (0) markregion = NULL;   
-#endif
-}
-
-int collect_non_X_xdamage(int x_in, int y_in, int w_in, int h_in, int call) {
-	sraRegionPtr tmpregion;
-	sraRegionPtr reg;
-	static int rect_count = 0;
-	int nreg, ccount = 0, dcount = 0, ecount = 0;
-	static time_t last_rpt = 0;
-	time_t now;
-	double tm, dt;
-	int x, y, w, h, x2, y2;
-
-if (call && debug_xdamage > 1) fprintf(stderr, "collect_non_X_xdamage: %d %d %d %d - %d / %d\n", x_in, y_in, w_in, h_in, call, use_xdamage);
-
-	if (! use_xdamage) {
-		return 0;
-	}
-	if (! xdamage_regions) {
-		return 0;
-	}
-
-	dtime0(&tm);
-
-	nreg = (xdamage_memory * NSCAN) + 1;
-
-	if (call == 0) {
-		xdamage_ticker = (xdamage_ticker+1) % nreg;
-		xdamage_direct_count = 0;
-		reg = xdamage_regions[xdamage_ticker];  
-		if (reg != NULL) {
-			sraRgnMakeEmpty(reg);
-		}
-	} else {
-		if (xdamage_ticker < 0) {
-			xdamage_ticker = 0;
-		}
-		reg = xdamage_regions[xdamage_ticker];  
-	}
-	if (reg == NULL) {
-		return 0;
-	}
-
-	if (x_in < 0) {
-		return 0;
-	}
-
-
-	x = x_in;
-	y = y_in;
-	w = w_in;
-	h = h_in;
-
-	/* translate if needed */
-	if (clipshift) {
-		/* set coords relative to fb origin */
-		if (0 && rootshift) {
-			/*
-			 * Note: not needed because damage is
-			 * relative to subwin, not rootwin.
-			 */
-			x = x - off_x;
-			y = y - off_y;
-		}
-		if (clipshift) {
-			x = x - coff_x;
-			y = y - coff_y;
-		}
-
-		x2 = x + w;		/* upper point */
-		x  = nfix(x,  dpy_x);	/* place both in fb area */
-		x2 = nfix(x2, dpy_x+1);
-		w = x2 - x;		/* recompute w */
-		
-		y2 = y + h;
-		y  = nfix(y,  dpy_y);
-		y2 = nfix(y2, dpy_y+1);
-		h = y2 - y;
-
-		if (w <= 0 || h <= 0) {
-			return 0;
-		}
-	}
-	if (debug_xdamage > 2) {
-		fprintf(stderr, "xdamage: -> event %dx%d+%d+%d area:"
-		    " %d  dups: %d  %s reg: %p\n", w, h, x, y, w*h, dcount,
-		    (w*h > xdamage_max_area) ? "TOO_BIG" : "", (void *)reg);
-	}
-
-	record_desired_xdamage_rect(x, y, w, h);
-
-	tmpregion = sraRgnCreateRect(x, y, x + w, y + h); 
-	sraRgnOr(reg, tmpregion);
-	sraRgnDestroy(tmpregion);
-	rect_count++;
-	ccount++;
-
-	if (0 && xdamage_direct_count) {
-		fb_push();
-	}
-
-	dt = dtime(&tm);
-	if ((debug_tiles > 1 && ecount) || (debug_tiles && ecount > 200)
-	    || debug_xdamage > 1) {
-		fprintf(stderr, "collect_non_X_xdamage(%d): %.4f t: %.4f ev/dup/accept"
-		    "/direct %d/%d/%d/%d\n", call, dt, tm - x11vnc_start, ecount,
-		    dcount, ccount, xdamage_direct_count); 
-	}
-	now = time(NULL);
-	if (! last_rpt) {
-		last_rpt = now;
-	}
-	if (now > last_rpt + 15) {
-		double rat = -1.0;
-
-		if (XD_tot) {
-			rat = ((double) XD_skip)/XD_tot;
-		}
-		if (debug_tiles || debug_xdamage) {
-			fprintf(stderr, "xdamage: == scanline skip/tot: "
-			    "%04d/%04d =%.3f  rects: %d  desired: %d\n",
-			    XD_skip, XD_tot, rat, rect_count, XD_des);
-		}
-			
-		XD_skip = 0;
-		XD_tot  = 0;
-		XD_des  = 0;
-		rect_count = 0;
-		last_rpt = now;
-	}
-	return 0;
-}
-
-int collect_xdamage(int scancnt, int call) {
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-	XDamageNotifyEvent *dev;
-	XEvent ev;
-	sraRegionPtr tmpregion;
-	sraRegionPtr reg;
-	static int rect_count = 0;
-	int nreg, ccount = 0, dcount = 0, ecount = 0;
-	static time_t last_rpt = 0;
-	time_t now;
-	int x, y, w, h, x2, y2;
-	int i, dup, next = 0, dup_max = 0;
-#define DUPSZ 32
-	int dup_x[DUPSZ], dup_y[DUPSZ], dup_w[DUPSZ], dup_h[DUPSZ];
-	double tm, dt;
-	int mark_all = 0, retries = 0, too_many = 1000, tot_ev = 0;
-
-	RAWFB_RET(0)
-
-	if (scancnt) {} /* unused vars warning: */
-
-	if (! xdamage_present || ! use_xdamage) {
-		return 0;
-	}
-	if (! xdamage) {
-		return 0;
-	}
-	if (! xdamage_base_event_type) {
-		return 0;
-	}
-	if (! xdamage_regions) {
-		return 0;
-	}
-
-	dtime0(&tm);
-
-	nreg = (xdamage_memory * NSCAN) + 1;
-
-	if (call == 0) {
-		xdamage_ticker = (xdamage_ticker+1) % nreg;
-		xdamage_direct_count = 0;
-		reg = xdamage_regions[xdamage_ticker];  
-		if (reg != NULL) {
-			sraRgnMakeEmpty(reg);
-		}
-	} else {
-		if (xdamage_ticker < 0) {
-			xdamage_ticker = 0;
-		}
-		reg = xdamage_regions[xdamage_ticker];  
-	}
-	if (reg == NULL) {
-		return 0;
-	}
-
-
-	X_LOCK;
-if (0)	XFlush_wr(dpy);
-if (0)	XEventsQueued(dpy, QueuedAfterFlush);
-
-	come_back_for_more:
-
-	while (XCheckTypedEvent(dpy, xdamage_base_event_type+XDamageNotify, &ev)) {
-		/*
-		 * TODO max cut off time in this loop?
-		 * Could check QLength and if huge just mark the whole
-		 * screen.
-		 */
-		ecount++;
-		tot_ev++;
-
-		if (mark_all) {
-			continue;
-		}
-		if (ecount == too_many) {
-			int nqa = XEventsQueued(dpy, QueuedAlready);
-			if (nqa >= too_many) {
-				static double last_msg = 0.0;
-				tmpregion = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-				sraRgnOr(reg, tmpregion);
-				sraRgnDestroy(tmpregion);
-				if (dnow() > last_msg + xdamage_crazy_delay) {
-					rfbLog("collect_xdamage: too many xdamage events %d+%d\n", ecount, nqa);
-					last_msg = dnow();
-				}
-				mark_all = 1;
-			}
-		}
-
-		if (ev.type != xdamage_base_event_type + XDamageNotify) {
-			break;
-		}
-		dev = (XDamageNotifyEvent *) &ev;
-		if (dev->damage != xdamage) {
-			continue;	/* not ours! */
-		}
-
-		x = dev->area.x;
-		y = dev->area.y;
-		w = dev->area.width;
-		h = dev->area.height;
-
-		/*
-		 * we try to manually remove some duplicates because
-		 * certain activities can lead to many 10's of dups
-		 * in a row.  The region work can be costly and reg is
-		 * later used in xdamage_hint_skip loops, so it is good
-		 * to skip them if possible.
-		 */
-		dup = 0;
-		for (i=0; i < dup_max; i++) {
-			if (dup_x[i] == x && dup_y[i] == y && dup_w[i] == w &&
-			    dup_h[i] == h) {
-				dup = 1;
-				break;
-			}
-		}
-		if (dup) {
-			dcount++;
-			continue;
-		}
-		if (dup_max < DUPSZ) {
-			next = dup_max;
-			dup_max++;
-		} else {
-			next = (next+1) % DUPSZ;
-		}
-		dup_x[next] = x;
-		dup_y[next] = y;
-		dup_w[next] = w;
-		dup_h[next] = h;
-
-		/* translate if needed */
-		if (clipshift) {
-			/* set coords relative to fb origin */
-			if (0 && rootshift) {
-				/*
-				 * Note: not needed because damage is
-				 * relative to subwin, not rootwin.
-				 */
-				x = x - off_x;
-				y = y - off_y;
-			}
-			if (clipshift) {
-				x = x - coff_x;
-				y = y - coff_y;
-			}
-
-			x2 = x + w;		/* upper point */
-			x  = nfix(x,  dpy_x);	/* place both in fb area */
-			x2 = nfix(x2, dpy_x+1);
-			w = x2 - x;		/* recompute w */
-			
-			y2 = y + h;
-			y  = nfix(y,  dpy_y);
-			y2 = nfix(y2, dpy_y+1);
-			h = y2 - y;
-
-			if (w <= 0 || h <= 0) {
-				continue;
-			}
-		}
-		if (debug_xdamage > 2) {
-			fprintf(stderr, "xdamage: -> event %dx%d+%d+%d area:"
-			    " %d  dups: %d  %s\n", w, h, x, y, w*h, dcount,
-			    (w*h > xdamage_max_area) ? "TOO_BIG" : "");
-		}
-
-		record_desired_xdamage_rect(x, y, w, h);
-
-		tmpregion = sraRgnCreateRect(x, y, x + w, y + h); 
-		sraRgnOr(reg, tmpregion);
-		sraRgnDestroy(tmpregion);
-		rect_count++;
-		ccount++;
-	}
-
-	if (mark_all) {
-		if (ecount + XEventsQueued(dpy, QueuedAlready) >= 3 * too_many && retries < 3) {
-			retries++;
-			XFlush_wr(dpy);
-			usleep(20 * 1000);
-			XFlush_wr(dpy);
-			ecount = 0;
-			goto come_back_for_more;
-		}
-	}
-
-	/* clear the whole damage region for next time. XXX check */
-	if (call == 1) {
-		XDamageSubtract(dpy, xdamage, None, None);
-	}
-	X_UNLOCK;
-
-	if (tot_ev > 20 * too_many) {
-		rfbLog("collect_xdamage: xdamage has gone crazy (screensaver or game?) ev: %d ret: %d\n", tot_ev, retries);
-		rfbLog("collect_xdamage: disabling xdamage for %d seconds.\n", (int) xdamage_crazy_delay);
-		destroy_xdamage_if_needed();
-		X_LOCK;
-		XSync(dpy, False);
-		while (XCheckTypedEvent(dpy, xdamage_base_event_type+XDamageNotify, &ev)) {
-			;
-		}
-		X_UNLOCK;
-		xdamage_crazy_time = dnow();
-	}
-
-	if (0 && xdamage_direct_count) {
-		fb_push();
-	}
-
-	dt = dtime(&tm);
-	if ((debug_tiles > 1 && ecount) || (debug_tiles && ecount > 200)
-	    || debug_xdamage > 1) {
-		fprintf(stderr, "collect_xdamage(%d): %.4f t: %.4f ev/dup/accept"
-		    "/direct %d/%d/%d/%d\n", call, dt, tm - x11vnc_start, ecount,
-		    dcount, ccount, xdamage_direct_count); 
-	}
-	now = time(NULL);
-	if (! last_rpt) {
-		last_rpt = now;
-	}
-	if (now > last_rpt + 15) {
-		double rat = -1.0;
-
-		if (XD_tot) {
-			rat = ((double) XD_skip)/XD_tot;
-		}
-		if (debug_tiles || debug_xdamage) {
-			fprintf(stderr, "xdamage: == scanline skip/tot: "
-			    "%04d/%04d =%.3f  rects: %d  desired: %d\n",
-			    XD_skip, XD_tot, rat, rect_count, XD_des);
-		}
-			
-		XD_skip = 0;
-		XD_tot  = 0;
-		XD_des  = 0;
-		rect_count = 0;
-		last_rpt = now;
-	}
-#else
-	if (0) scancnt++;	/* compiler warnings */
-	if (0) call++;
-	if (0) record_desired_xdamage_rect(0, 0, 0, 0);
-#endif
-	return 0;
-}
-
-int xdamage_hint_skip(int y) {
-	static sraRegionPtr scanline = NULL;
-	static sraRegionPtr tmpl_y = NULL;
-	int fast_tmpl = 1;
-	sraRegionPtr reg, tmpl;
-	int ret, i, n, nreg;
-#ifndef NO_NCACHE
-	static int ncache_no_skip = 0;
-	static double last_ncache_no_skip = 0.0;
-	static double last_ncache_no_skip_long = 0.0, ncache_fac = 0.25;
-#endif
-
-	if (! xdamage_present || ! use_xdamage) {
-		return 0;	/* cannot skip */
-	}
-	if (! xdamage_regions) {
-		return 0;	/* cannot skip */
-	}
-
-	if (! scanline) {
-		/* keep it around to avoid malloc etc, recreate */
-		scanline = sraRgnCreate();
-	}
-	if (! tmpl_y) {
-		tmpl_y = sraRgnCreateRect(0, 0, dpy_x, 1);
-	}
-
-	nreg = (xdamage_memory * NSCAN) + 1;
-
-#ifndef NO_NCACHE
-	if (ncache > 0) {
-		if (ncache_no_skip == 0) {
-			double now = g_now;
-			if (now > last_ncache_no_skip + 8.0) {
-				ncache_no_skip = 1;
-			} else if (now < last_bs_restore + 0.5) {
-				ncache_no_skip = 1;
-			} else if (now < last_su_restore + 0.5) {
-				ncache_no_skip = 1;
-			} else if (now < last_copyrect + 0.5) {
-				ncache_no_skip = 1;
-			}
-			if (ncache_no_skip) {
-				last_ncache_no_skip = dnow();
-				if (now > last_ncache_no_skip_long + 60.0) {
-					ncache_fac = 2.0;
-					last_ncache_no_skip_long = now;
-				} else {
-					ncache_fac = 0.25;
-				}
-				return 0;
-			}
-		} else {
-			if (ncache_no_skip++ >= ncache_fac*nreg + 4) {
-				ncache_no_skip = 0;
-			} else {
-				return 0;
-			}
-		}
-	}
-#endif
-
-	if (fast_tmpl) {
-		sraRgnOffset(tmpl_y, 0, y);
-		tmpl = tmpl_y;
-	} else {
-		tmpl = sraRgnCreateRect(0, y, dpy_x, y+1);
-	}
-
-	ret = 1;
-	for (i=0; i<nreg; i++) {
-		/* go back thru the history starting at most recent */
-		n = (xdamage_ticker + nreg - i) % nreg;
-		reg = xdamage_regions[n];  
-		if (reg == NULL) {
-			continue;
-		}
-		if (sraRgnEmpty(reg)) {
-			/* checking for emptiness is very fast */
-			continue;
-		}
-		sraRgnMakeEmpty(scanline);
-		sraRgnOr(scanline, tmpl);
-		if (sraRgnAnd(scanline, reg)) {
-			ret = 0;
-			break;
-		}
-	}
-	if (fast_tmpl) {
-		sraRgnOffset(tmpl_y, 0, -y);
-	} else {
-		sraRgnDestroy(tmpl);
-	}
-if (0) fprintf(stderr, "xdamage_hint_skip: %d -> %d\n", y, ret);
-
-	return ret;
-}
-
-void initialize_xdamage(void) {
-	sraRegionPtr *ptr;
-	int i, nreg;
-
-	if (! xdamage_present) {
-		use_xdamage = 0;
-	}
-	if (xdamage_regions)  {
-		ptr = xdamage_regions;
-		while (*ptr != NULL) {
-			sraRgnDestroy(*ptr);
-			ptr++;
-		}
-		free(xdamage_regions);
-		xdamage_regions = NULL;
-	}
-	if (use_xdamage) {
-		nreg = (xdamage_memory * NSCAN) + 2;
-		xdamage_regions = (sraRegionPtr *)
-		    malloc(nreg * sizeof(sraRegionPtr));
-		for (i = 0; i < nreg; i++) {
-			ptr = xdamage_regions+i;
-			if (i == nreg - 1) {
-				*ptr = NULL;
-			} else {
-				*ptr = sraRgnCreate();
-				sraRgnMakeEmpty(*ptr);
-			}
-		}
-		/* set so will be 0 in first collect_xdamage call */
-		xdamage_ticker = -1;
-	}
-}
-
-void create_xdamage_if_needed(int force) {
-
-	RAWFB_RET_VOID
-
-	if (force) {}
-
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-	if (! xdamage || force) {
-		X_LOCK;
-		xdamage = XDamageCreate(dpy, window, XDamageReportRawRectangles); 
-		XDamageSubtract(dpy, xdamage, None, None);
-		X_UNLOCK;
-		rfbLog("created   xdamage object: 0x%lx\n", xdamage);
-	}
-#endif
-}
-
-void destroy_xdamage_if_needed(void) {
-
-	RAWFB_RET_VOID
-
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-	if (xdamage) {
-		XEvent ev;
-		X_LOCK;
-		XDamageDestroy(dpy, xdamage);
-		XFlush_wr(dpy);
-		if (xdamage_base_event_type) {
-			while (XCheckTypedEvent(dpy,
-			    xdamage_base_event_type+XDamageNotify, &ev)) {
-				;
-			}
-		}
-		X_UNLOCK;
-		rfbLog("destroyed xdamage object: 0x%lx\n", xdamage);
-		xdamage = 0;
-	}
-#endif
-}
-
-void check_xdamage_state(void) {
-	if (! xdamage_present) {
-		return;
-	}
-	/*
-	 * Create or destroy the Damage object as needed, we don't want
-	 * one if no clients are connected.
-	 */
-	if (xdamage_crazy_time > 0.0 && dnow() < xdamage_crazy_time + xdamage_crazy_delay) {
-		return;
-	}
-	if (client_count && use_xdamage) {
-		create_xdamage_if_needed(0);
-		if (xdamage_scheduled_mark > 0.0 && dnow() >
-		    xdamage_scheduled_mark) {
-			if (xdamage_scheduled_mark_region) {
-				mark_region_for_xdamage(
-				    xdamage_scheduled_mark_region);
-				sraRgnDestroy(xdamage_scheduled_mark_region);
-				xdamage_scheduled_mark_region = NULL;
-			} else {
-				mark_for_xdamage(0, 0, dpy_x, dpy_y);
-			}
-			xdamage_scheduled_mark = 0.0;
-		}
-	} else {
-		destroy_xdamage_if_needed();
-	}
-}
-
-
diff --git a/ica/x11/x11vnc/xdamage.h b/ica/x11/x11vnc/xdamage.h
deleted file mode 100644
index 9919b7d..0000000
--- a/ica/x11/x11vnc/xdamage.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XDAMAGE_H
-#define _X11VNC_XDAMAGE_H
-
-/* -- xdamage.h -- */
-
-#if LIBVNCSERVER_HAVE_LIBXDAMAGE
-extern Damage xdamage;
-#endif
-extern int use_xdamage;
-extern int xdamage_present;
-extern int xdamage_max_area;
-extern double xdamage_memory;
-extern int xdamage_tile_count, xdamage_direct_count;
-extern double xdamage_scheduled_mark;
-extern double xdamage_crazy_time;
-extern double xdamage_crazy_delay;
-extern sraRegionPtr xdamage_scheduled_mark_region;
-extern sraRegionPtr *xdamage_regions;
-extern int xdamage_ticker;
-extern int XD_skip, XD_tot, XD_des;
-
-extern void add_region_xdamage(sraRegionPtr new_region);
-extern void clear_xdamage_mark_region(sraRegionPtr markregion, int flush);
-extern int collect_non_X_xdamage(int x_in, int y_in, int w_in, int h_in, int call);
-extern int collect_xdamage(int scancnt, int call);
-extern int xdamage_hint_skip(int y);
-extern void initialize_xdamage(void);
-extern void create_xdamage_if_needed(int force);
-extern void destroy_xdamage_if_needed(void);
-extern void check_xdamage_state(void);
-
-#endif /* _X11VNC_XDAMAGE_H */
diff --git a/ica/x11/x11vnc/xevents.c b/ica/x11/x11vnc/xevents.c
deleted file mode 100644
index 72b6515..0000000
--- a/ica/x11/x11vnc/xevents.c
+++ /dev/null
@@ -1,2175 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xevents.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "xkb_bell.h"
-#include "xrandr.h"
-#include "xdamage.h"
-#include "xrecord.h"
-#include "selection.h"
-#include "keyboard.h"
-#include "cursor.h"
-#include "gui.h"
-#include "connections.h"
-#include "unixpw.h"
-#include "cleanup.h"
-#include "macosx.h"
-#include "screen.h"
-#include "pm.h"
-#include "pointer.h"
-#include "remote.h"
-#include "inet.h"
-
-/* XXX CHECK BEFORE RELEASE */
-int grab_buster = 0;
-int grab_kbd = 0;
-int grab_ptr = 0;
-int grab_always = 0;
-int ungrab_both = 0;
-int grab_local = 0;
-int sync_tod_delay = 20;
-
-void initialize_vnc_connect_prop(void);
-void initialize_x11vnc_remote_prop(void);
-void initialize_clipboard_atom(void);
-void spawn_grab_buster(void);
-void sync_tod_with_servertime(void);
-void check_keycode_state(void);
-void check_autorepeat(void);
-void set_prop_atom(Atom atom);
-void check_xevents(int reset);
-void xcut_receive(char *text, int len, rfbClientPtr cl);
-
-void kbd_release_all_keys(rfbClientPtr cl);
-void set_single_window(rfbClientPtr cl, int x, int y);
-void set_server_input(rfbClientPtr cl, int s);
-void set_text_chat(rfbClientPtr cl, int l, char *t);
-int get_keyboard_led_state_hook(rfbScreenInfoPtr s);
-int get_file_transfer_permitted(rfbClientPtr cl);
-void get_prop(char *str, int len, Atom prop, Window w);
-int guess_dm_gone(int t1, int t2);
-
-static void initialize_xevents(int reset);
-static void print_xevent_bases(void);
-static void bust_grab(int reset);
-static int process_watch(char *str, int parent, int db);
-static void grab_buster_watch(int parent, char *dstr);
-
-
-void initialize_vnc_connect_prop(void) {
-	char *prop_str;
-	vnc_connect_str[0] = '\0';
-	RAWFB_RET_VOID
-#if !NO_X11
-	prop_str = getenv("VNC_CONNECT");
-	if (prop_str == NULL) {
-		prop_str = "VNC_CONNECT";
-	}
-	vnc_connect_prop = XInternAtom(dpy, "VNC_CONNECT", False);
-#endif
-}
-
-void initialize_x11vnc_remote_prop(void) {
-	char *prop_str;
-	x11vnc_remote_str[0] = '\0';
-	RAWFB_RET_VOID
-#if !NO_X11
-	prop_str = getenv("X11VNC_REMOTE");
-	if (prop_str == NULL) {
-		prop_str = "X11VNC_REMOTE";
-	}
-	x11vnc_remote_prop = XInternAtom(dpy, prop_str, False);
-#endif
-}
-
-void initialize_clipboard_atom(void) {
-	RAWFB_RET_VOID
-#if NO_X11
-	return;
-#else
-	clipboard_atom = XInternAtom(dpy, "CLIPBOARD", False);
-	if (clipboard_atom == None) {
-		if (! quiet) rfbLog("could not find atom CLIPBOARD\n");
-		if (watch_clipboard) {
-			watch_clipboard = 0;
-		}
-		if (set_clipboard) {
-			set_clipboard = 0;
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-/*
-      we observed these strings:
-
-      6 gdm_string: Gnome-power-manager
-      6 gdm_string: Gnome-session
-      6 gdm_string: Gnome-settings-daemon
-      6 gdm_string: Login Window
-      6 gdm_string: Notify-osd
-      6 gdm_string: Panel
-     12 gdm_string: Metacity
-     12 gdm_string: gnome-power-manager
-     12 gdm_string: gnome-session
-     12 gdm_string: gnome-settings-daemon
-     12 gdm_string: notify-osd
-     18 gdm_string: Gdm-simple-greeter
-     24 gdm_string: metacity
-     36 gdm_string: gdm-simple-greeter
-
-	kdmgreet
-	Kdmgreet
- */
-
-static int dm_string(char *str) {
-	char *s = getenv("DEBUG_WM_RUNNING");
-	if (str == NULL) {
-		return 0;
-	}
-	if (str[0] == '\0') {
-		return 0;
-	}
-	if (0) fprintf(stderr, "dm_string: %s\n", str);
-	if (strstr(str, "gdm-") == str || strstr(str, "Gdm-") == str) {
-		if (strstr(str, "-greeter") != NULL) {
-			if (s) rfbLog("dm_string: %s\n", str);
-			return 1;
-		}
-	}
-	if (!strcmp(str, "kdmgreet") || !strcmp(str, "Kdmgreet")) {
-		if (s) rfbLog("dm_string: %s\n", str);
-		return 1;
-	}
-	return 0;
-}
-
-static int dm_still_running(void) {
-#if NO_X11
-	return 0;
-#else
-	Window r, parent;
-	Window *winlist;
-	unsigned int nc;
-	int rc, i;
-	static XClassHint *classhint = NULL;
-	XErrorHandler old_handler;
-	int saw_gdm_name = 0;
-
-	/* some times a window can go away before we get to it */
-	trapped_xerror = 0;
-	old_handler = XSetErrorHandler(trap_xerror);
-
-	if (! classhint) {
-		classhint = XAllocClassHint();
-	}
-
-	/* we are xlocked. */
-	rc = XQueryTree_wr(dpy, DefaultRootWindow(dpy), &r, &parent, &winlist, &nc);
-	if (!rc || winlist == NULL || nc == 0) {
-		nc = 0;
-	}
-	for (i=0; i < (int) nc; i++) {
-		char *name = NULL;
-		Window w = winlist[i];
-		if (XFetchName(dpy, w, &name) && name != NULL) {
-			saw_gdm_name += dm_string(name);
-			XFree_wr(name);
-		}
-		classhint->res_name = NULL;
-		classhint->res_class = NULL;
-		if (XGetClassHint(dpy, w, classhint)) {
-			name = classhint->res_name;
-			if (name != NULL) {
-				saw_gdm_name += dm_string(name);
-				XFree_wr(name);
-			}
-			name = classhint->res_class;
-			if (name != NULL) {
-				saw_gdm_name += dm_string(name);
-				XFree_wr(name);
-			}
-		}
-		if (saw_gdm_name > 0) {
-			break;
-		}
-	}
-	if (winlist != NULL) {
-		XFree_wr(winlist);
-	}
-
-	XSync(dpy, False);
-	XSetErrorHandler(old_handler);
-	trapped_xerror = 0;
-
-	return saw_gdm_name;
-#endif
-}
-
-static int wm_running(void) {
-	char *s = getenv("DEBUG_WM_RUNNING");
-	int ret = 0;
-	RAWFB_RET(0)
-#if NO_X11
-	return 0;
-#else
-	/*
-	 * Unfortunately with recent GDM (v2.28), they run gnome-session,
-	 * dbus-launch, and metacity for the Login greeter!  So the simple
-	 * XInternAtom checks below no longer work.
-         * We also see a similar thing with KDE.
-	 */
-	if (dm_still_running()) {
-		return 0;
-	}
-
-	/* we are xlocked. */
-	if (XInternAtom(dpy, "_NET_SUPPORTED", True) != None) {
-		if (s) rfbLog("wm is running (_NET_SUPPORTED).\n");
-		ret++;
-	}
-	if (XInternAtom(dpy, "_WIN_PROTOCOLS", True) != None) {
-		if (s) rfbLog("wm is running (_WIN_PROTOCOLS).\n");
-		ret++;
-	}
-	if (XInternAtom(dpy, "_XROOTPMAP_ID", True) != None) {
-		if (s) rfbLog("wm is running (_XROOTPMAP_ID).\n");
-		ret++;
-	}
-	if (XInternAtom(dpy, "_MIT_PRIORITY_COLORS", True) != None) {
-		if (s) rfbLog("wm is running (_MIT_PRIORITY_COLORS).\n");
-		ret++;
-	}
-	if (!ret) {
-		if (s) rfbLog("wm is not running.\n");
-		return 0;
-	} else {
-		if (s) rfbLog("wm is running ret=%d.\n", ret);
-		return 1;
-	}
-#endif	/* NO_X11 */
-	
-}
-
-int guess_dm_gone(int t1, int t2) {
-	int wait = t2;
-	char *avoid = getenv("X11VNC_AVOID_WINDOWS");
-	time_t tcheck = last_client;
-
-	if (last_open_xdisplay > last_client) {
-		/* better time for -display WAIT:... */
-		tcheck = last_open_xdisplay;
-	}
-
-	if (avoid && !strcmp(avoid, "never")) {
-		return 1;
-	}
-	if (!screen || !screen->clientHead) {
-		return 0;
-	}
-	if (avoid) {
-		int n = atoi(avoid);
-		if (n > 1) {
-			wait = n;
-		} else {
-			wait = 90;
-		}
-	} else {
-		static time_t saw_wm = 0;
-
-		wait = t2;
-
-		X_LOCK;
-		if (wm_running()) {
-			if (saw_wm == 0) {
-				saw_wm = time(NULL);
-			} else if (time(NULL) <= saw_wm + 2) {
-				/* try to wait a few seconds after transition */
-				;
-			} else {
-				wait = t1;
-			}
-		}
-		X_UNLOCK;
-	}
-	if (getenv("DEBUG_WM_RUNNING")) {
-		rfbLog("guess_dm_gone: wait=%d\n", wait);
-	}
-	/* we assume they've logged in OK after wait seconds... */
-	if (time(NULL) <= tcheck + wait)  {
-		return 0;
-	}
-	return 1;
-}
-
-static void initialize_xevents(int reset) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!reset) {}
-	return;
-#else
-	static int did_xselect_input = 0;
-	static int did_xcreate_simple_window = 0;
-	static int did_vnc_connect_prop = 0;
-	static int did_x11vnc_remote_prop = 0;
-	static int did_clipboard_atom = 0;
-	static int did_xfixes = 0;
-	static int did_xdamage = 0;
-	static int did_xrandr = 0;
-
-	RAWFB_RET_VOID
-
-	if (reset) {
-		did_xselect_input = 0;
-		did_xcreate_simple_window = 0;
-		did_vnc_connect_prop = 0;
-		did_x11vnc_remote_prop = 0;
-		did_clipboard_atom = 0;
-		did_xfixes = 0;
-		did_xdamage = 0;
-		did_xrandr = 0;
-	}
-
-	if ((watch_selection || vnc_connect) && !did_xselect_input) {
-		/*
-		 * register desired event(s) for notification.
-		 * PropertyChangeMask is for CUT_BUFFER0 changes.
-		 * XXX: does this cause a flood of other stuff?
-		 */
-		X_LOCK;
-		xselectinput_rootwin |= PropertyChangeMask;
-		XSelectInput_wr(dpy, rootwin, xselectinput_rootwin);
-
-		if (subwin && freeze_when_obscured) {
-			XSelectInput_wr(dpy, subwin, VisibilityChangeMask);
-		}
-		X_UNLOCK;
-		did_xselect_input = 1;
-	}
-	if (watch_selection && !did_xcreate_simple_window) {
-		/* create fake window for our selection ownership, etc */
-
-		/*
-		 * We try to delay creating selwin until we are past
-		 * any GDM, (or other KillInitClients=true) manager.
-		 */
-		if (guess_dm_gone(8, 45)) {
-			X_LOCK;
-			selwin = XCreateSimpleWindow(dpy, rootwin, 3, 2, 1, 1, 0, 0, 0);
-			X_UNLOCK;
-			did_xcreate_simple_window = 1;
-			if (! quiet) rfbLog("created selwin: 0x%lx\n", selwin);
-		}
-	}
-
-	if ((xrandr || xrandr_maybe) && !did_xrandr) {
-		initialize_xrandr();
-		did_xrandr = 1;
-	}
-	if (vnc_connect && !did_vnc_connect_prop) {
-		initialize_vnc_connect_prop();
-		did_vnc_connect_prop = 1;
-	}
-	if (vnc_connect && !did_x11vnc_remote_prop) {
-		initialize_x11vnc_remote_prop();
-		did_x11vnc_remote_prop = 1;
-	}
-	if (run_gui_pid > 0) {
-		kill(run_gui_pid, SIGUSR1);
-		run_gui_pid = 0;
-	}
-	if (!did_clipboard_atom) {
-		initialize_clipboard_atom();
-		did_clipboard_atom = 1;
-	}
-	if (xfixes_present && use_xfixes && !did_xfixes) {
-		/*
-		 * We try to delay creating initializing xfixes until
-		 * we are past the display manager, due to Xorg bug:
-		 * http://bugs.freedesktop.org/show_bug.cgi?id=18451
-		 */
-		if (guess_dm_gone(8, 45)) {
-			initialize_xfixes();
-			did_xfixes = 1;
-			if (! quiet) rfbLog("called initialize_xfixes()\n");
-		}
-	}
-	if (xdamage_present && !did_xdamage) {
-		initialize_xdamage();
-		did_xdamage = 1;
-	}
-#endif	/* NO_X11 */
-}
-
-static void print_xevent_bases(void) {
-	fprintf(stderr, "X event bases: xkb=%d, xtest=%d, xrandr=%d, "
-	    "xfixes=%d, xdamage=%d, xtrap=%d\n", xkb_base_event_type,
-	    xtest_base_event_type, xrandr_base_event_type,
-	    xfixes_base_event_type, xdamage_base_event_type,
-	    xtrap_base_event_type);
-	fprintf(stderr, "  MapNotify=%d, ClientMsg=%d PropNotify=%d "
-	    "SelNotify=%d, SelRequest=%d\n", MappingNotify, ClientMessage,
-	    PropertyNotify, SelectionNotify, SelectionRequest);
-	fprintf(stderr, "  SelClear=%d, Expose=%d\n", SelectionClear, Expose);
-}
-
-void get_prop(char *str, int len, Atom prop, Window w) {
-	int i;
-#if !NO_X11
-	Atom type;
-	int format, slen, dlen;
-	unsigned long nitems = 0, bytes_after = 0;
-	unsigned char* data = NULL;
-#endif
-
-	for (i=0; i<len; i++) {
-		str[i] = '\0';
-	}
-	if (prop == None) {
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	return;
-#else
-
-	slen = 0;
-	if (w == None) {
-		w = DefaultRootWindow(dpy);
-	}
-
-	do {
-		if (XGetWindowProperty(dpy, w,
-		    prop, nitems/4, len/16, False,
-		    AnyPropertyType, &type, &format, &nitems, &bytes_after,
-		    &data) == Success) {
-
-			dlen = nitems * (format/8);
-			if (slen + dlen > len) {
-				/* too big */
-				XFree_wr(data);
-				break;
-			}
-			memcpy(str+slen, data, dlen);
-			slen += dlen;
-			str[slen] = '\0';
-			XFree_wr(data);
-		}
-	} while (bytes_after > 0);
-#endif	/* NO_X11 */
-}
-
-static void bust_grab(int reset) {
-#if NO_X11
-	if (!reset) {}
-	return;
-#else
-	static int bust_count = 0;
-	static time_t last_bust = 0;
-	time_t now = time(NULL);
-	KeyCode key;
-	int button, x, y, nb;
-
-	if (now > last_bust + 180) {
-		bust_count = 0;
-	}
-	if (reset) {
-		bust_count = 0;
-		return;
-	}
-
-	x = 0;
-	y = 0;
-	button = 0;
-	key = NoSymbol;
-
-	nb = 8;
-	if (bust_count >= 3 * nb)  {
-		fprintf(stderr, "too many bust_grab's %d for me\n", bust_count);
-		exit(0);
-	}
-	if (bust_count % nb == 0) {
-		button = 1;
-	} else if (bust_count % nb == 1) {
-		button = 1;
-	} else if (bust_count % nb == 2) {
-		key = XKeysymToKeycode(dpy, XK_Escape);
-	} else if (bust_count % nb == 3) {
-		button = 3;
-	} else if (bust_count % nb == 4) {
-		key = XKeysymToKeycode(dpy, XK_space);
-	} else if (bust_count % nb == 5) {
-		x = bust_count * 23;
-		y = bust_count * 17;
-	} else if (bust_count % nb == 5) {
-		button = 2;
-	} else if (bust_count % nb == 6) {
-		key = XKeysymToKeycode(dpy, XK_a);
-	}
-
-	if (key == NoSymbol) {
-		key = XKeysymToKeycode(dpy, XK_a);
-		if (key == NoSymbol) {
-			button = 1;
-		}
-	}
-
-	bust_count++;
-
-	if (button) {
-		/* try button press+release */
-		fprintf(stderr, "**bust_grab: button%d  %.4f\n",
-		    button, dnowx());
-		XTestFakeButtonEvent_wr(dpy, button, True, CurrentTime);
-		XFlush_wr(dpy);
-		usleep(50 * 1000);
-		XTestFakeButtonEvent_wr(dpy, button, False, CurrentTime);
-	} else if (x > 0) {
-		/* try button motion*/
-		int scr = DefaultScreen(dpy);
-
-		fprintf(stderr, "**bust_grab: x=%d y=%d  %.4f\n", x, y,
-		    dnowx());
-		XTestFakeMotionEvent_wr(dpy, scr, x, y, CurrentTime);
-		XFlush_wr(dpy);
-		usleep(50 * 1000);
-
-		/* followed by button press */
-		button = 1;
-		fprintf(stderr, "**bust_grab: button%d\n", button);
-		XTestFakeButtonEvent_wr(dpy, button, True, CurrentTime);
-		XFlush_wr(dpy);
-		usleep(50 * 1000);
-		XTestFakeButtonEvent_wr(dpy, button, False, CurrentTime);
-	} else {
-		/* try Escape or Space press+release */
-		fprintf(stderr, "**bust_grab: keycode: %d  %.4f\n",
-		    (int) key, dnowx());
-		XTestFakeKeyEvent_wr(dpy, key, True, CurrentTime);
-		XFlush_wr(dpy);
-		usleep(50 * 1000);
-		XTestFakeKeyEvent_wr(dpy, key, False, CurrentTime);
-	}
-	XFlush_wr(dpy);
-	last_bust = time(NULL);
-#endif	/* NO_X11 */
-}
-
-typedef struct _grabwatch {
-	int pid;
-	int tick;
-	unsigned long time;
-	time_t change;
-} grabwatch_t;
-#define GRABWATCH 16
-
-static int grab_buster_delay = 20;
-static pid_t grab_buster_pid = 0;
-
-static int grab_npids = 1;
-
-static int process_watch(char *str, int parent, int db) {
-	int i, pid, ticker, npids;
-	char diff[128];
-	unsigned long xtime;
-	static grabwatch_t watches[GRABWATCH];
-	static int first = 1;
-	time_t now = time(NULL);
-	static time_t last_bust = 0;
-	int too_long, problems = 0;
-
-	if (first) {
-		for (i=0; i < GRABWATCH; i++) {
-			watches[i].pid = 0;
-			watches[i].tick = 0;
-			watches[i].time = 0;
-			watches[i].change = 0;
-		}
-		first = 0;
-	}
-
-	/* record latest value of prop */
-	if (str && *str != '\0') {
-		if (sscanf(str, "%d/%d/%lu/%s", &pid, &ticker, &xtime, diff)
-		    == 4) {
-			int got = -1, free = -1;
-
-			if (db) fprintf(stderr, "grab_buster %d - %d - %lu - %s"
-			    "\n", pid, ticker, xtime, diff);
-
-			if (pid == parent && !strcmp(diff, "QUIT")) {
-				/* that's it. */
-				return 0;
-			}
-			if (pid == 0 || ticker == 0 || xtime == 0) {
-				/* bad prop read. */
-				goto badtickerstr;
-			}
-			for (i=0; i < GRABWATCH; i++) {
-				if (watches[i].pid == pid) {
-					got = i;
-					break;
-				}
-				if (free == -1 && watches[i].pid == 0) {
-					free = i;
-				}
-			}
-			if (got == -1) {
-				if (free == -1) {
-					/* bad news */;
-					free = GRABWATCH - 1;
-				}
-				watches[free].pid  = pid;
-				watches[free].tick = ticker;
-				watches[free].time = xtime;
-				watches[free].change = now;
-				if (db) fprintf(stderr, "grab_buster free slot: %d\n", free);
-			} else {
-				if (db) fprintf(stderr, "grab_buster got  slot: %d\n", got);
-				if (watches[got].tick != ticker) {
-					watches[got].change = now;
-				}
-				if (watches[got].time != xtime) {
-					watches[got].change = now;
-				}
-				watches[got].tick = ticker;
-				watches[got].time = xtime;
-			}
-		} else {
-			if (db) fprintf(stderr, "grab_buster bad prop str: %s\n", str);
-		}
-	}
-
-	badtickerstr:
-
-	too_long = grab_buster_delay;
-	if (too_long < 3 * sync_tod_delay) {
-		too_long = 3 * sync_tod_delay;
-	}
-
-	npids = 0;
-	for (i=0; i < GRABWATCH; i++) {
-		if (watches[i].pid) {
-			npids++;
-		}
-	}
-	grab_npids = npids;
-	if (npids > 4) {
-		npids = 4;
-	}
-
-	/* now check everyone we are tracking */
-	for (i=0; i < GRABWATCH; i++) {
-		int fac = 1;
-		if (!watches[i].pid) {
-			continue;
-		}
-		if (watches[i].change == 0) {
-			watches[i].change = now;	/* just to be sure */
-			continue;
-		}
-
-		pid = watches[i].pid;
-
-		if (pid != parent) {
-			fac = 2;
-		}
-		if (npids > 0) {
-			fac *= npids;
-		}
-
-		if (now > watches[i].change + fac*too_long) {
-			int process_alive = 1;
-
-			fprintf(stderr, "grab_buster: problem with pid: "
-			    "%d - %d/%d/%d\n", pid, (int) now,
-			    (int) watches[i].change, too_long);
-
-			if (kill((pid_t) pid, 0) != 0) {
-				if (1 || errno == ESRCH) {
-					process_alive = 0;	
-				}
-			}
-
-			if (!process_alive) {
-				watches[i].pid = 0;
-				watches[i].tick = 0;
-				watches[i].time = 0;
-				watches[i].change = 0;
-				fprintf(stderr, "grab_buster: pid gone: %d\n",
-				    pid);
-				if (pid == parent) {
-					/* that's it */
-					return 0;
-				}
-			} else {
-				int sleep = sync_tod_delay * 1000 * 1000;
-
-				bust_grab(0);
-				problems++;
-				last_bust = now;
-				usleep(1 * sleep);
-				break;
-			}
-		}
-	}
-
-	if (!problems) {
-		bust_grab(1);
-	}
-	return 1;
-}
-
-static void grab_buster_watch(int parent, char *dstr) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!parent || !dstr) {}
-	return;
-#else
-	Atom ticker_atom = None;
-	int sleep = sync_tod_delay * 921 * 1000;
-	char propval[200];
-	int ev, er, maj, min;
-	int db = 0;
-	char *ticker_str = "X11VNC_TICKER";
-
-	RAWFB_RET_VOID
-
-	if (grab_buster > 1) {
-		db = 1;
-	}
-
-	/* overwrite original dpy, we let orig connection sit unused. */
-	dpy = XOpenDisplay_wr(dstr);
-	if (!dpy) {
-		fprintf(stderr, "grab_buster_watch: could not reopen: %s\n",
-		    dstr);
-		return;
-	}
-	rfbLogEnable(0);
-
-	/* check for XTEST, etc, and then disable grabs for us */
-	if (! XTestQueryExtension_wr(dpy, &ev, &er, &maj, &min)) {
-		xtest_present = 0;
-	} else {
-		xtest_present = 1;
-	}
-	if (! XETrapQueryExtension_wr(dpy, &ev, &er, &maj)) {
-		xtrap_present = 0;
-	} else {
-		xtrap_present = 1;
-	}
-
-	if (! xtest_present && ! xtrap_present) {
-		fprintf(stderr, "grab_buster_watch: no grabserver "
-		    "protection on display: %s\n", dstr);
-		return;
-	}
-	disable_grabserver(dpy, 0);
-
-	usleep(3 * sleep);
-
-	if (getenv("X11VNC_TICKER")) {
-		ticker_str = getenv("X11VNC_TICKER");
-	}
-	ticker_atom = XInternAtom(dpy, ticker_str, False);
-	if (! ticker_atom) {
-		fprintf(stderr, "grab_buster_watch: no ticker atom\n");
-		return;
-	}
-
-	while(1) {
-		int slp = sleep;
-		if (grab_npids > 1) {
-			slp = slp / 8;	
-		}
-		usleep(slp);
-		usleep((int) (0.60 * rfac() * slp));
-
-		if (kill((pid_t) parent, 0) != 0) {
-			break;
-		}
-
-		get_prop(propval, 128, ticker_atom, None);
-		if (db) fprintf(stderr, "got_prop:   %s\n", propval);
-
-		if (!process_watch(propval, parent, db)) {
-			break;
-		}
-	}
-#endif	/* NO_X11 */
-}
-
-void spawn_grab_buster(void) {
-#if LIBVNCSERVER_HAVE_FORK
-	pid_t pid;
-	int parent = (int) getpid();
-	char *dstr = strdup(DisplayString(dpy));
-
-	RAWFB_RET_VOID
-
-	XCloseDisplay_wr(dpy); 
-	dpy = NULL;
-
-	if ((pid = fork()) > 0) {
-		grab_buster_pid = pid;
-		if (! quiet) {
-			rfbLog("grab_buster pid is: %d\n", (int) pid);
-		}
-	} else if (pid == -1) {
-		fprintf(stderr, "spawn_grab_buster: could not fork\n");
-		rfbLogPerror("fork");
-	} else {
-		signal(SIGHUP,  SIG_DFL);
-		signal(SIGINT,  SIG_DFL);
-		signal(SIGQUIT, SIG_DFL);
-		signal(SIGTERM, SIG_DFL);
-
-		grab_buster_watch(parent, dstr);
-		exit(0);
-	}
-
-	dpy = XOpenDisplay_wr(dstr);
-	if (!dpy) {
-		rfbLog("failed to reopen display %s in spawn_grab_buster\n",
-		    dstr);
-		exit(1);
-	}
-#endif
-}
-
-void sync_tod_with_servertime(void) {
-#if NO_X11
-	RAWFB_RET_VOID
-	return;
-#else
-	static Atom ticker_atom = None;
-	XEvent xev;
-	char diff[128];
-	static int seq = 0;
-	static unsigned long xserver_ticks = 1;
-	int i, db = 0;
-
-	RAWFB_RET_VOID
-
-	if (atom_NET_ACTIVE_WINDOW == None) {
-		atom_NET_ACTIVE_WINDOW = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", True);
-	}
-	if (atom_NET_CURRENT_DESKTOP == None) {
-		atom_NET_CURRENT_DESKTOP = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", True);
-	}
-	if (atom_NET_CLIENT_LIST_STACKING == None) {
-		atom_NET_CLIENT_LIST_STACKING = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", True);
-	}
-	if (atom_XROOTPMAP_ID == None) {
-		atom_XROOTPMAP_ID = XInternAtom(dpy, "_XROOTPMAP_ID", True);
-	}
-
-	if (! ticker_atom) {
-		char *ticker_str = "X11VNC_TICKER";
-		if (getenv("X11VNC_TICKER")) {
-			ticker_str = getenv("X11VNC_TICKER");
-		}
-		ticker_atom = XInternAtom(dpy, ticker_str, False);
-	}
-	if (! ticker_atom) {
-		return;
-	}
-
-	XSync(dpy, False);
-	while (XCheckTypedEvent(dpy, PropertyNotify, &xev)) {
-		set_prop_atom(xev.xproperty.atom);
-	}
-
-	snprintf(diff, 128, "%d/%08d/%lu/%.6f", (int) getpid(), seq++,
-	    xserver_ticks, servertime_diff); 
-	XChangeProperty(dpy, rootwin, ticker_atom, XA_STRING, 8,
-	    PropModeReplace, (unsigned char *) diff, strlen(diff));
-	XSync(dpy, False);
-
-	for (i=0; i < 10; i++) {
-		int k, got = 0;
-		
-		for (k=0; k < 5; k++) {
-			while (XCheckTypedEvent(dpy, PropertyNotify, &xev)) {
-				if (xev.xproperty.atom == ticker_atom) {
-					double stime;
-					
-					xserver_ticks = xev.xproperty.time;
-					stime = (double) xev.xproperty.time;
-					stime = stime/1000.0;
-					servertime_diff = dnow() - stime;
-					if (db) rfbLog("set servertime_diff: "
-					    "%.6f\n", servertime_diff);
-					got = 1;
-				}
-			}
-		}
-		if (got) {
-			break;
-		}
-		usleep(1000);
-	}
-#endif	/* NO_X11 */
-}
-
-void check_keycode_state(void) {
-	static time_t last_check = 0;
-	int delay = 10, noinput = 3;
-	time_t now = time(NULL);
-
-	if (! client_count) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	RAWFB_RET_VOID
-
-	/*
-	 * periodically update our model of the keycode_state[]
-	 * by correlating with the Xserver.  wait for a pause in
-	 * keyboard input to be on the safe side.  the idea here
-	 * is to remove stale keycode state, not to be perfectly
-	 * in sync with the Xserver at every instant of time.
-	 */
-	if (now > last_check + delay && now > last_keyboard_input + noinput) {
-		X_LOCK;
-		init_track_keycode_state();
-		X_UNLOCK;
-		last_check = now;
-	}
-}
-
-/*
- * To use the experimental -grablocal option configure like this:
- * env CPPFLAGS=-DENABLE_GRABLOCAL LDFLAGS=-lXss ./configure
- */
-#ifdef ENABLE_GRABLOCAL
-#include <X11/extensions/scrnsaver.h>
-
-void check_local_grab(void) {
-	static double last_check = 0.0;
-	double now;
-
-	if (grab_local <= 0) {
-		return;
-	}
-	if (! client_count) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	if (last_rfb_key_injected <= 0.0 && last_rfb_ptr_injected <= 0.0) {
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-	now = dnow();
-
-	if (now > last_check + 0.1)   {
-#if !NO_X11
-		int ret;
-		double idle;
-		XScreenSaverInfo info;
-		static int save_viewonly = -1, local_is_idle = -1, db = -1;
-
-		if (debug_keyboard) db = debug_keyboard;
-		if (debug_pointer ) db = debug_pointer;
-
-		if (db < 0) {
-			if (getenv("LOCAL_GRAB_DEBUG")) {
-				db = atoi(getenv("LOCAL_GRAB_DEBUG"));
-			} else {
-				db = 0;
-			}
-		}
-
-		ret = XScreenSaverQueryInfo(dpy, RootWindowOfScreen(
-		    ScreenOfDisplay(dpy, 0)), &info);
-
-		if (ret) {
-			double tlatest_rfb = 0.0;
-
-			idle = ((double) info.idle)/1000.0;
-			now = dnow();
-
-			if (last_rfb_key_injected > 0.0) {
-				tlatest_rfb = last_rfb_key_injected;
-			}
-			if (last_rfb_ptr_injected > tlatest_rfb) {
-				tlatest_rfb = last_rfb_ptr_injected;
-			}
-			if (db > 1) fprintf(stderr, "idle: %.4f latest: %.4f dt: %.4f\n", idle, now - tlatest_rfb, idle - (now - tlatest_rfb));
-
-			if (now - tlatest_rfb <= idle + 0.005) {
-				/* 0.005 is 5ms tolerance */
-			} else if (idle < grab_local) {
-				if (local_is_idle < 0 || local_is_idle) {
-					save_viewonly = view_only;
-					view_only = 1;
-					if (db) {
-						rfbLog("check_local_grab: set viewonly\n");
-					}
-				}
-				
-				local_is_idle = 0;
-			} else {
-				if (!local_is_idle && save_viewonly >= 0) {
-					view_only = save_viewonly;
-					if (db) {
-						rfbLog("check_local_grab: restored viewonly; %d\n", view_only);
-					}
-				}
-				local_is_idle = 1;
-			}
-		}
-#endif
-		last_check = dnow();
-	}
-}
-#endif
-
-void check_autorepeat(void) {
-	static time_t last_check = 0;
-	static int idle_timeout = -300, idle_reset = 0;
-	time_t now = time(NULL);
-	int autorepeat_is_on, autorepeat_initially_on;
-
-	if (! no_autorepeat || ! client_count) {
-		return;
-	}
-	if (now <= last_check + 1) {
-		return;
-	}
-
-	if (unixpw_in_progress) return;
-
-	if (idle_timeout < 0) {
-		if (getenv("X11VNC_IDLE_TIMEOUT")) {
-			idle_timeout = atoi(getenv("X11VNC_IDLE_TIMEOUT"));
-		}
-		if (idle_timeout < 0) {
-			idle_timeout = -idle_timeout;
-		}
-	}
-
-	last_check = now;
-
-	autorepeat_is_on = get_autorepeat_state();
-	autorepeat_initially_on = get_initial_autorepeat_state();
-
-	if (view_only) {
-		if (! autorepeat_is_on) {
-			autorepeat(1, 1);
-		}
-		return;
-	}
-
-	if (now > last_keyboard_input + idle_timeout) {
-		/* autorepeat should be on when idle */
-		if (! autorepeat_is_on && autorepeat_initially_on) {
-			static time_t last_msg = 0;
-			static int cnt = 0;
-			if (now > last_msg + idle_timeout && cnt++ < 10) {
-				rfbLog("idle keyboard:   turning X autorepeat"
-				    " back on.\n");
-				last_msg = now;
-			}
-			autorepeat(1, 1);
-			idle_reset = 1;
-		}
-	} else {
-		if (idle_reset) {
-			int i, state[256], didmsg = 0, pressed = 0;
-			int mwt = 600, mmax = 20;
-			static int msgcnt = 0;
-			static double lastmsg = 0.0;
-
-			for (i=0; i<256; i++) {
-				state[i] = 0;
-			}
-			if (use_threads) {X_LOCK;}
-			get_keystate(state);
-			if (use_threads) {X_UNLOCK;}
-
-			for (i=0; i<256; i++) {
-				if (state[i] != 0) {
-					/* better wait until all keys are up  */
-					pressed++;
-					if (msgcnt < mmax || dnow() > lastmsg + mwt) {
-						char *str = "unset";
-#if !NO_X11
-						if (use_threads) {X_LOCK;}
-						str = XKeysymToString(XKeycodeToKeysym(dpy, i, 0));
-						if (use_threads) {X_UNLOCK;}
-#endif
-						str = str ? str : "nosymbol";
-						didmsg++;
-						rfbLog("active keyboard: waiting until "
-						    "all keys are up. key_down=%d %s.  "
-						    "If the key is inaccessible via keyboard, "
-						    "consider 'x11vnc -R clear_all'\n", i, str);
-					}
-				}
-			}
-			if (didmsg > 0) {
-				msgcnt++;
-				if (msgcnt == mmax) {
-					rfbLog("active keyboard: last such "
-					    "message for %d secs.\n", mwt);
-				}
-				lastmsg = dnow();
-			}
-			if (pressed > 0) {
-				return;
-			}
-		}
-		if (idle_reset) {
-			static time_t last_msg = 0;
-			static int cnt = 0;
-			if (now > last_msg + idle_timeout && cnt++ < 10) {
-				rfbLog("active keyboard: turning X autorepeat"
-				    " off.\n");
-				last_msg = now;
-			}
-			autorepeat(0, 1);
-			idle_reset = 0;
-
-		} else if (no_repeat_countdown && autorepeat_is_on) {
-			int n = no_repeat_countdown - 1;
-			if (n >= 0) {
-				rfbLog("Battling with something for "
-				    "-norepeat!! (%d resets left)\n", n);
-			} else {
-				rfbLog("Battling with something for "
-				    "-norepeat!!\n");
-			}
-			if (no_repeat_countdown > 0) {
-				no_repeat_countdown--;
-			}
-			autorepeat(1, 0);
-			autorepeat(0, 0);
-		}
-	}
-}
-
-void set_prop_atom(Atom atom) {
-	if (atom == None) return;
-	if (atom == atom_NET_ACTIVE_WINDOW) got_NET_ACTIVE_WINDOW = dnow();
-	if (atom == atom_NET_CURRENT_DESKTOP) got_NET_CURRENT_DESKTOP = dnow();
-	if (atom == atom_NET_CLIENT_LIST_STACKING) got_NET_CLIENT_LIST_STACKING = dnow();
-	if (atom == atom_XROOTPMAP_ID) got_XROOTPMAP_ID = dnow();
-}
-
-/*
- * This routine is periodically called to check for selection related
- * and other X11 events and respond to them as needed.
- */
-void check_xevents(int reset) {
-#if NO_X11
-	RAWFB_RET_VOID
-	if (!reset) {}
-	return;
-#else
-	XEvent xev;
-	int tmp, have_clients = 0;
-	static int sent_some_sel = 0;
-	static time_t last_call = 0;
-	static time_t last_bell = 0;
-	static time_t last_init_check = 0;
-	static time_t last_sync = 0;
-	static time_t last_time_sync = 0;
-	time_t now = time(NULL);
-	static double last_request = 0.0;
-	static double last_xrefresh = 0.0;
-	XErrorHandler old_handler;
-
-	if (unixpw_in_progress) return;
-
-	RAWFB_RET_VOID
-
-	if (now > last_init_check+1 || reset) {
-		last_init_check = now;
-		initialize_xevents(reset);
-		if (reset) {
-			return;
-		}
-	}
-
-	if (screen && screen->clientHead) {
-		have_clients = 1;
-	}
-
-	X_LOCK;
-	/*
-	 * There is a bug where we have to wait before sending text to
-	 * the client... so instead of sending right away we wait a
-	 * the few seconds.
-	 */
-
-	if (have_clients && watch_selection && !sent_some_sel
-	    && now > last_client + sel_waittime) {
-		if (XGetSelectionOwner(dpy, XA_PRIMARY) == None) {
-			cutbuffer_send();
-		}
-		sent_some_sel = 1;
-	}
-	if (! have_clients) {
-		/*
-		 * If we don't have clients we can miss the X server
-		 * going away until a client connects.
-		 */
-		static time_t last_X_ping = 0;
-		if (now > last_X_ping + 5) {
-			last_X_ping = now;
-			XGetSelectionOwner(dpy, XA_PRIMARY);
-		}
-	}
-
-	if (have_clients && xrefresh > 0.0 && dnow() > last_xrefresh + xrefresh) {
-		XSetWindowAttributes swa;
-		Visual visual;
-		Window xrf;
-		unsigned long mask;
-
-		swa.override_redirect = True;
-		swa.backing_store = NotUseful;
-		swa.save_under = False;
-		swa.background_pixmap = None;
-		visual.visualid = CopyFromParent;
-		mask = (CWOverrideRedirect|CWBackingStore|CWSaveUnder|CWBackPixmap);
-
-		xrf = XCreateWindow(dpy, window, coff_x, coff_y, dpy_x, dpy_y, 0, CopyFromParent,
-		    InputOutput, &visual, mask, &swa);
-		if (xrf != None) {
-			if (0) fprintf(stderr, "XCreateWindow(%d, %d, %d, %d) 0x%lx\n", coff_x, coff_y, dpy_x, dpy_y, xrf);
-			XMapWindow(dpy, xrf);
-			XFlush_wr(dpy);
-			XDestroyWindow(dpy, xrf);
-			XFlush_wr(dpy);
-		}
-		last_xrefresh = dnow();
-	}
-
-	if (now > last_call+1) {
-		/* we only check these once a second or so. */
-		int n = 0;
-
-		trapped_xerror = 0;
-		old_handler = XSetErrorHandler(trap_xerror);
-
-		while (XCheckTypedEvent(dpy, MappingNotify, &xev)) {
-			XRefreshKeyboardMapping((XMappingEvent *) &xev);
-			n++;
-		}
-		if (n && use_modifier_tweak) {
-			X_UNLOCK;
-			initialize_modtweak();
-			X_LOCK;
-		}
-		if (xtrap_base_event_type) {
-			int base = xtrap_base_event_type;
-			while (XCheckTypedEvent(dpy, base, &xev)) {
-				;
-			}
-		}
-		if (xtest_base_event_type) {
-			int base = xtest_base_event_type;
-			while (XCheckTypedEvent(dpy, base, &xev)) {
-				;
-			}
-		}
-		/*
-		 * we can get ClientMessage from our XSendEvent() call in 
-		 * selection_request().
-		 */
-		while (XCheckTypedEvent(dpy, ClientMessage, &xev)) {
-			;
-		}
-
-		XSetErrorHandler(old_handler);
-		trapped_xerror = 0;
-		last_call = now;
-	}
-
-	if (freeze_when_obscured) {
-		if (XCheckTypedEvent(dpy, VisibilityNotify, &xev)) {
-			if (xev.type == VisibilityNotify && xev.xany.window == subwin) {
-				int prev = subwin_obscured;
-				if (xev.xvisibility.state == VisibilityUnobscured) {
-					subwin_obscured = 0;
-				} else if (xev.xvisibility.state == VisibilityPartiallyObscured) {
-					subwin_obscured = 1;
-				} else {
-					subwin_obscured = 2;
-				}
-				rfbLog("subwin_obscured: %d -> %d\n", prev, subwin_obscured);
-			}
-		}
-	}
-
-	/* check for CUT_BUFFER0, VNC_CONNECT, X11VNC_REMOTE changes: */
-	if (XCheckTypedEvent(dpy, PropertyNotify, &xev)) {
-		int got_cutbuffer = 0;
-		int got_vnc_connect = 0;
-		int got_x11vnc_remote = 0;
-		static int prop_dbg = -1;
-
-		/* to avoid piling up between calls, read all PropertyNotify now */
-		do {
-			if (xev.type == PropertyNotify) {
-				if (xev.xproperty.atom == XA_CUT_BUFFER0) {
-					got_cutbuffer++;
-				} else if (vnc_connect && vnc_connect_prop != None
-				    && xev.xproperty.atom == vnc_connect_prop) {
-					got_vnc_connect++;
-				} else if (vnc_connect && x11vnc_remote_prop != None
-				    && xev.xproperty.atom == x11vnc_remote_prop) {
-					got_x11vnc_remote++;
-				}
-				set_prop_atom(xev.xproperty.atom);
-			}
-		} while (XCheckTypedEvent(dpy, PropertyNotify, &xev));
-
-		if (prop_dbg < 0) {
-			prop_dbg = 0;
-			if (getenv("PROP_DBG")) {
-				prop_dbg = 1;
-			}
-		}
-
-		if (prop_dbg && (got_cutbuffer > 1 || got_vnc_connect > 1 || got_x11vnc_remote > 1)) {
-			static double lastmsg = 0.0;
-			static int count = 0;
-			double now = dnow();
-
-			if (1 && now > lastmsg + 300.0) {
-				if (got_cutbuffer > 1) {
-					rfbLog("check_xevents: warning: %d cutbuffer events since last check.\n", got_cutbuffer);
-				}
-				if (got_vnc_connect > 1) {
-					rfbLog("check_xevents: warning: %d vnc_connect events since last check.\n", got_vnc_connect);
-				}
-				if (got_x11vnc_remote > 1) {
-					rfbLog("check_xevents: warning: %d x11vnc_remote events since last check.\n", got_x11vnc_remote);
-				}
-				count++;
-				if (count >= 3) {
-					lastmsg = now;
-					count = 0;
-				}
-			}
-		}
-
-		if (got_cutbuffer)  {
-			/*
-			 * Go retrieve CUT_BUFFER0 and send it.
-			 *
-			 * set_cutbuffer is a flag to try to avoid
-			 * processing our own cutbuffer changes.
-			 */
-			if (have_clients && watch_selection && !set_cutbuffer) {
-				cutbuffer_send();
-				sent_some_sel = 1;
-			}
-			set_cutbuffer = 0;
-		} 
-		if (got_vnc_connect) {
-			/*
-			 * Go retrieve VNC_CONNECT string.
-			 */
-			read_vnc_connect_prop(0);
-		} 
-		if (got_x11vnc_remote) {
-			/*
-			 * Go retrieve X11VNC_REMOTE string.
-			 */
-			read_x11vnc_remote_prop(0);
-		}
-	}
-
-	/* do this now that we have just cleared PropertyNotify */
-	tmp = 0;
-	if (rfac() < 0.6) {
-		tmp = 1;
-	}
-	if (now > last_time_sync + sync_tod_delay + tmp) {
-		sync_tod_with_servertime();
-		last_time_sync = now;
-	}
-
-#if LIBVNCSERVER_HAVE_LIBXRANDR
-	if (xrandr || xrandr_maybe) {
-		check_xrandr_event("check_xevents");
-	}
-#endif
-#if LIBVNCSERVER_HAVE_LIBXFIXES
-	if (xfixes_present && use_xfixes && xfixes_first_initialized && xfixes_base_event_type) {
-		if (XCheckTypedEvent(dpy, xfixes_base_event_type +
-		    XFixesCursorNotify, &xev)) {
-			got_xfixes_cursor_notify++;
-		}
-	}
-#endif
-
-	/* check for our PRIMARY request notification: */
-	if (watch_primary || watch_clipboard) {
-		int doprimary = 1, doclipboard = 2, which, own = 0;
-		double delay = 1.0;
-		Atom atom;
-		char *req;
-
-		if (XCheckTypedEvent(dpy, SelectionNotify, &xev)) {
-			if (xev.type == SelectionNotify &&
-			    xev.xselection.requestor == selwin &&
-			    xev.xselection.property != None &&
-			    xev.xselection.target == XA_STRING) {
-				Atom s = xev.xselection.selection;
-			        if (s == XA_PRIMARY || s == clipboard_atom) {
-					/* go retrieve it and check it */
-					if (now > last_client + sel_waittime
-					    || sent_some_sel) {
-						selection_send(&xev);
-					}
-				}
-			}
-		}
-		/*
-		 * Every second or so, request PRIMARY or CLIPBOARD,
-		 * unless we already own it or there is no owner or we
-		 * have no clients. 
-		 * TODO: even at this low rate we should look into
-		 * and performance problems in odds cases (large text,
-		 * modem, etc.)
-		 */
-		which = 0;
-		if (watch_primary && watch_clipboard && ! own_clipboard &&
-		    ! own_primary) {
-			delay = 0.6;
-		}
-		if (dnow() > last_request + delay) {
-			/*
-			 * It is not a good idea to do both at the same
-			 * time so we must choose one:
-			 */
-			if (watch_primary && watch_clipboard) {
-				static int count = 0;
-				if (own_clipboard) {
-					which = doprimary;
-				} else if (own_primary) {
-					which = doclipboard;
-				} else if (count++ % 3 == 0) {
-					which = doclipboard;
-				} else {
-					which = doprimary;
-				}
-			} else if (watch_primary) {
-				which = doprimary;
-			} else if (watch_clipboard) {
-				which = doclipboard;
-			}
-			last_request = dnow();
-		}
-		atom = None;
-		req = "none";
-		if (which == doprimary) {
-			own = own_primary;
-			atom = XA_PRIMARY;
-			req = "PRIMARY";
-		} else if (which == doclipboard) {
-			own = own_clipboard;
-			atom = clipboard_atom;
-			req = "CLIPBOARD";
-		}
-		if (which != 0 && ! own && have_clients &&
-		    XGetSelectionOwner(dpy, atom) != None && selwin != None) {
-			XConvertSelection(dpy, atom, XA_STRING, XA_STRING,
-			    selwin, CurrentTime);
-			if (debug_sel) {
-				rfbLog("request %s\n", req);
-			}
-		}
-	}
-
-	if (own_primary || own_clipboard) {
-		/* we own PRIMARY or CLIPBOARD, see if someone requested it: */
-		trapped_xerror = 0;
-		old_handler = XSetErrorHandler(trap_xerror);
-
-		if (XCheckTypedEvent(dpy, SelectionRequest, &xev)) {
-			if (own_primary && xev.type == SelectionRequest &&
-			    xev.xselectionrequest.selection == XA_PRIMARY) {
-				selection_request(&xev, "PRIMARY");
-			}
-			if (own_clipboard && xev.type == SelectionRequest &&
-			    xev.xselectionrequest.selection == clipboard_atom) {
-				selection_request(&xev, "CLIPBOARD");
-			}
-		}
-
-		/* we own PRIMARY or CLIPBOARD, see if we no longer own it: */
-		if (XCheckTypedEvent(dpy, SelectionClear, &xev)) {
-			if (own_primary && xev.type == SelectionClear &&
-			    xev.xselectionclear.selection == XA_PRIMARY) {
-				own_primary = 0;
-				if (xcut_str_primary) {
-					free(xcut_str_primary);
-					xcut_str_primary = NULL;
-				}
-				if (debug_sel) {
-					rfbLog("Released PRIMARY.\n");
-				}
-			}
-			if (own_clipboard && xev.type == SelectionClear &&
-			    xev.xselectionclear.selection == clipboard_atom) {
-				own_clipboard = 0;
-				if (xcut_str_clipboard) {
-					free(xcut_str_clipboard);
-					xcut_str_clipboard = NULL;
-				}
-				if (debug_sel) {
-					rfbLog("Released CLIPBOARD.\n");
-				}
-			}
-		}
-
-		XSetErrorHandler(old_handler);
-		trapped_xerror = 0;
-	}
-
-	if (watch_bell || now > last_bell+1) {
-		last_bell = now;
-		check_bell_event();
-	}
-	if (tray_request != None) {
-		static time_t last_tray_request = 0;
-		if (now > last_tray_request + 2) {
-			last_tray_request = now;
-			if (tray_embed(tray_request, tray_unembed)) {
-				tray_window = tray_request;
-				tray_request = None;
-			}
-		}
-	}
-
-#ifndef DEBUG_XEVENTS
-#define DEBUG_XEVENTS 1
-#endif
-#if DEBUG_XEVENTS
-	if (debug_xevents) {
-		static time_t last_check = 0;
-		static time_t reminder = 0;
-		static int freq = 0;
-
-		if (! freq) {
-			if (getenv("X11VNC_REMINDER_RATE")) {
-				freq = atoi(getenv("X11VNC_REMINDER_RATE"));
-			} else {
-				freq = 300;
-			}
-		}
-
-		if (now > last_check + 1) {
-			int ev_type_max = 300, ev_size = 400;
-			XEvent xevs[400];
-			int i, tot = XEventsQueued(dpy, QueuedAlready);
-
-			if (reminder == 0 || (tot && now > reminder + freq)) {
-				print_xevent_bases();
-				reminder = now;
-			}
-			last_check = now;
-
-			if (tot) {
-		    		fprintf(stderr, "Total events queued: %d\n",
-				    tot);
-			}
-			for (i=1; i<ev_type_max; i++) {
-				int k, n = 0;
-				while (XCheckTypedEvent(dpy, i, xevs+n)) {
-					if (++n >= ev_size) {
-						break;
-					}
-				}
-				if (n) {
-					fprintf(stderr, "  %d%s events of type"
-					    " %d queued\n", n,
-					    (n >= ev_size) ? "+" : "", i);
-				}
-				for (k=n-1; k >= 0; k--) {
-					XPutBackEvent(dpy, xevs+k);
-				}
-			}
-		}
-	}
-#endif
-
-	if (now > last_sync + 1200) {
-		/* kludge for any remaining event leaks */
-		int bugout = use_xdamage ? 500 : 50;
-		int qlen, i;
-		if (last_sync != 0) {
-			qlen = XEventsQueued(dpy, QueuedAlready);
-			if (qlen >= bugout) {
-				rfbLog("event leak: %d queued, "
-				    " calling XSync(dpy, True)\n", qlen);  
-				rfbLog("  for diagnostics run: 'x11vnc -R"
-				    " debug_xevents:1'\n");
-				XSync(dpy, True);
-			}
-		}
-		last_sync = now;
-
-		/* clear these, we don't want any events on them */
-		if (rdpy_ctrl) {
-			qlen = XEventsQueued(rdpy_ctrl, QueuedAlready);
-			for (i=0; i<qlen; i++) {
-				XNextEvent(rdpy_ctrl, &xev);
-			}
-		}
-		if (gdpy_ctrl) {
-			qlen = XEventsQueued(gdpy_ctrl, QueuedAlready);
-			for (i=0; i<qlen; i++) {
-				XNextEvent(gdpy_ctrl, &xev);
-			}
-		}
-	}
-	X_UNLOCK;
-
-#endif	/* NO_X11 */
-}
-
-extern int rawfb_vnc_reflect;
-/*
- * hook called when a VNC client sends us some "XCut" text (rfbClientCutText).
- */
-void xcut_receive(char *text, int len, rfbClientPtr cl) {
-	allowed_input_t input;
-
-	if (threads_drop_input) {
-		return;
-	}
-
-	if (unixpw_in_progress) {
-		rfbLog("xcut_receive: unixpw_in_progress, skipping.\n");
-		return;
-	}
-
-	if (!watch_selection) {
-		return;
-	}
-	if (view_only) {
-		return;
-	}
-	if (text == NULL || len == 0) {
-		return;
-	}
-	get_allowed_input(cl, &input);
-	if (!input.clipboard) {
-		return;
-	}
-	INPUT_LOCK;
-
-	if (remote_prefix != NULL && strstr(text, remote_prefix) == text) {
-		char *result, *rcmd = text + strlen(remote_prefix);
-		char *tmp = (char *) calloc(len + 8, 1);
-
-		if (strstr(rcmd, "cmd=") != rcmd && strstr(rcmd, "qry=") != rcmd) {
-			strcat(tmp, "qry=");
-		}
-		strncat(tmp, rcmd, len - strlen(remote_prefix));
-		rfbLog("remote_prefix command: '%s'\n", tmp);
-
-		if (use_threads) {
-			if (client_connect_file) {
-				FILE *f = fopen(client_connect_file, "w");
-				if (f) {
-					fprintf(f, "%s\n", tmp);
-					fclose(f);
-					free(tmp);
-					INPUT_UNLOCK;
-					return;
-				}
-			}
-			if (vnc_connect) {
-				sprintf(x11vnc_remote_str, "%s", tmp);
-				free(tmp);
-				INPUT_UNLOCK;
-				return;
-			}
-		}
-		INPUT_UNLOCK;
-
-
-		result = process_remote_cmd(tmp, 1);
-		if (result == NULL ) {
-			result = strdup("null");
-		} else if (!strcmp(result, "")) {
-			free(result);
-			result = strdup("none");
-		}
-		rfbLog("remote_prefix result:  '%s'\n", result);
-
-		free(tmp);
-		tmp = (char *) calloc(strlen(remote_prefix) + strlen(result) + 1, 1);
-
-		strcat(tmp, remote_prefix);
-		strcat(tmp, result);
-		free(result);
-
-		rfbSendServerCutText(screen, tmp, strlen(tmp));
-		free(tmp);
-
-		return;
-	}
-
-	if (! check_sel_direction("recv", "xcut_receive", text, len)) {
-		INPUT_UNLOCK;
-		return;
-	}
-
-#ifdef MACOSX
-	if (macosx_console) {
-		macosx_set_sel(text, len);
-		INPUT_UNLOCK;
-		return;
-	}
-#endif
-
-	if (rawfb_vnc_reflect) {
-		vnc_reflect_send_cuttext(text, len);
-		INPUT_UNLOCK;
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	INPUT_UNLOCK;
-	return;
-#else
-
-	X_LOCK;
-
-	/* associate this text with PRIMARY (and SECONDARY...) */
-	if (set_primary && ! own_primary && selwin != None) {
-		own_primary = 1;
-		/* we need to grab the PRIMARY selection */
-		XSetSelectionOwner(dpy, XA_PRIMARY, selwin, CurrentTime);
-		XFlush_wr(dpy);
-		if (debug_sel) {
-			rfbLog("Own PRIMARY.\n");
-		}
-	}
-
-	if (set_clipboard && ! own_clipboard && clipboard_atom != None && selwin != None) {
-		own_clipboard = 1;
-		/* we need to grab the CLIPBOARD selection */
-		XSetSelectionOwner(dpy, clipboard_atom, selwin, CurrentTime);
-		XFlush_wr(dpy);
-		if (debug_sel) {
-			rfbLog("Own CLIPBOARD.\n");
-		}
-	}
-
-	/* duplicate the text string for our own use. */
-	if (set_primary) {
-		if (xcut_str_primary != NULL) {
-			free(xcut_str_primary);
-			xcut_str_primary = NULL;
-		}
-		xcut_str_primary = (char *) malloc((size_t) (len+1));
-		strncpy(xcut_str_primary, text, len);
-		xcut_str_primary[len] = '\0';	/* make sure null terminated */
-		if (debug_sel) {
-			rfbLog("Set PRIMARY   '%s'\n", xcut_str_primary);
-		}
-	}
-	if (set_clipboard) {
-		if (xcut_str_clipboard != NULL) {
-			free(xcut_str_clipboard);
-			xcut_str_clipboard = NULL;
-		}
-		xcut_str_clipboard = (char *) malloc((size_t) (len+1));
-		strncpy(xcut_str_clipboard, text, len);
-		xcut_str_clipboard[len] = '\0';	/* make sure null terminated */
-		if (debug_sel) {
-			rfbLog("Set CLIPBOARD '%s'\n", xcut_str_clipboard);
-		}
-	}
-
-	/* copy this text to CUT_BUFFER0 as well: */
-	XChangeProperty(dpy, rootwin, XA_CUT_BUFFER0, XA_STRING, 8,
-	    PropModeReplace, (unsigned char *) text, len);
-	XFlush_wr(dpy);
-
-	X_UNLOCK;
-	INPUT_UNLOCK;
-
-	set_cutbuffer = 1;
-#endif	/* NO_X11 */
-}
-
-void kbd_release_all_keys(rfbClientPtr cl) {
-	if (unixpw_in_progress) {
-		rfbLog("kbd_release_all_keys: unixpw_in_progress, skipping.\n");
-		return;
-	}
-	if (cl->viewOnly) {
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	return;
-#else
-	if (use_threads) {
-		X_LOCK;
-	}
-
-	clear_keys();
-	clear_modifiers(0);
-
-	if (use_threads) {
-		X_UNLOCK;
-	}
-#endif
-}
-
-void set_single_window(rfbClientPtr cl, int x, int y) {
-	int ok = 0;
-	if (no_ultra_ext) {
-		return;
-	}
-	if (unixpw_in_progress) {
-		rfbLog("set_single_window: unixpw_in_progress, dropping client.\n");
-		rfbCloseClient(cl);
-		return;
-	}
-	if (cl->viewOnly) {
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	return;
-#else
-	if (x==1 && y==1) {
-		if (subwin) {
-			subwin = 0x0;
-			ok = 1;
-		}
-	} else {
-		Window r, c;
-		int rootx, rooty, wx, wy;
-		unsigned int mask;
-
-		update_x11_pointer_position(x, y);
-		XSync(dpy, False);
-
-		if (XQueryPointer_wr(dpy, rootwin, &r, &c, &rootx, &rooty,
-		    &wx, &wy, &mask)) {
-			if (c != None) {
-				subwin = c;
-				ok = 1;
-			}
-		}
-	}
-
-	if (ok) {
-		check_black_fb();
-		do_new_fb(1);	
-	}
-#endif
-
-}
-void set_server_input(rfbClientPtr cl, int grab) {
-	if (no_ultra_ext) {
-		return;
-	}
-	if (unixpw_in_progress) {
-		rfbLog("set_server_input: unixpw_in_progress, dropping client.\n");
-		rfbCloseClient(cl);
-		return;
-	}
-	if (cl->viewOnly) {
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	return;
-#else
-	if (grab) {
-		if (!no_ultra_dpms) {
-			set_dpms_mode("enable");
-			set_dpms_mode("off");
-			force_dpms = 1;
-		}
-
-		process_remote_cmd("cmd=grabkbd", 0);
-		process_remote_cmd("cmd=grabptr", 0);
-
-	} else {
-		process_remote_cmd("cmd=nograbkbd", 0);
-		process_remote_cmd("cmd=nograbptr", 0);
-
-		if (!no_ultra_dpms) {
-			force_dpms = 0;
-		}
-	}
-#endif
-}
-
-static int wsock_timeout_sock = -1;
-
-static void wsock_timeout (int sig) {
-	rfbLog("sig: %d, wsock_timeout.\n", sig);
-	if (wsock_timeout_sock >= 0) {
-		close(wsock_timeout_sock);
-		wsock_timeout_sock = -1;
-	}
-}
-
-static void try_local_chat_window(void) {
-	int i, port, lsock;
-	char cmd[100];
-	struct sockaddr_in addr;
-	pid_t pid = -1;
-#ifdef __hpux
-	int addrlen = sizeof(addr);
-#else
-	socklen_t addrlen = sizeof(addr);
-#endif
-
-	for (i = 0; i < 90; i++)  {
-		/* find an open port */
-		port = 7300 + i;
-		/* XXX ::1 fallback */
-		lsock = listen_tcp(port, htonl(INADDR_LOOPBACK), 0);
-		if (lsock >= 0) {
-			break;
-		}
-		port = 0;
-	}
-
-	if (port == 0) {
-		return;
-	}
-
-	/* have ssvncvncviewer connect back to us (n.b. sockpair fails) */
-
-	sprintf(cmd, "ssvnc -cmd VNC://localhost:%d -chatonly", port);
-
-#if LIBVNCSERVER_HAVE_FORK
-	pid = fork();
-#endif
-
-	if (pid == -1) {
-		perror("fork");
-		return;
-	} else if (pid == 0) {
-		char *args[4];
-		int d;
-		args[0] = "/bin/sh";
-		args[1] = "-c";
-		/* "ssvnc -cmd VNC://fd=0 -chatonly"; not working */
-		args[2] = cmd;
-		args[3] = NULL;
-
-		set_env("VNCVIEWER_PASSWORD", "moo");
-#if !NO_X11
-		if (dpy != NULL) {
-			set_env("DISPLAY", DisplayString(dpy));
-		}
-#endif
-		for (d = 3; d < 256; d++) {
-			close(d);
-		}
-
-		execvp(args[0], args);
-		perror("exec");
-		exit(1);
-	} else {
-		int i, sock = -1;
-		rfbNewClientHookPtr new_save;
-
-		signal(SIGALRM, wsock_timeout);
-		wsock_timeout_sock = lsock;
-		
-		alarm(10);
-		sock = accept(lsock, (struct sockaddr *)&addr, &addrlen);
-		alarm(0);
-
-		signal(SIGALRM, SIG_DFL);
-		close(lsock);
-
-		if (sock < 0) {
-			return;
-		}
-
-		/* mutex */
-		new_save = screen->newClientHook;
-		screen->newClientHook = new_client_chat_helper;
-
-		chat_window_client = create_new_client(sock, 1);
-
-		screen->newClientHook = new_save;
-
-		if (chat_window_client != NULL) {
-			rfbPasswordCheckProcPtr pwchk_save = screen->passwordCheck;
-			rfbBool save_shared1 = screen->alwaysShared;
-			rfbBool save_shared2 = screen->neverShared;
-
-			screen->alwaysShared = TRUE;
-			screen->neverShared  = FALSE;
-
-			screen->passwordCheck = password_check_chat_helper;
-			for (i=0; i<30; i++) {
-				rfbPE(-1);
-				if (!chat_window_client) {
-					break;
-				}
-				if (chat_window_client->state == RFB_NORMAL) {
-					break;
-				}
-			}
-
-			screen->passwordCheck = pwchk_save;
-			screen->alwaysShared  = save_shared1;
-			screen->neverShared   = save_shared2;
-		}
-	}
-}
-
-void set_text_chat(rfbClientPtr cl, int len, char *txt) {
-	int dochat = 1;
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl2;
-	unsigned int ulen = (unsigned int) len;
-
-	if (no_ultra_ext || ! dochat) {
-		return;
-	}
-
-	if (unixpw_in_progress) {
-		rfbLog("set_text_chat: unixpw_in_progress, dropping client.\n");
-		rfbCloseClient(cl);
-		return;
-	}
-#if LIBVNCSERVER_HAS_TEXTCHAT
-
-	if (chat_window && chat_window_client == NULL && ulen == rfbTextChatOpen) {
-		try_local_chat_window();
-	}
-
-	saw_ultra_chat = 1;
-
-	iter = rfbGetClientIterator(screen);
-	while( (cl2 = rfbClientIteratorNext(iter)) ) {
-		unsigned int ulen = (unsigned int) len;
-		if (cl2 == cl) {
-			continue;
-		}
-		if (cl2->state != RFB_NORMAL) {
-			continue;
-		}
-
-		SEND_LOCK(cl2);
-
-		if (ulen == rfbTextChatOpen) {
-			rfbSendTextChatMessage(cl2, rfbTextChatOpen, "");
-		} else if (ulen == rfbTextChatClose) {
-			rfbSendTextChatMessage(cl2, rfbTextChatClose, "");
-			/* not clear what is going on WRT close and finished... */
-			rfbSendTextChatMessage(cl2, rfbTextChatFinished, "");
-		} else if (ulen == rfbTextChatFinished) {
-			rfbSendTextChatMessage(cl2, rfbTextChatFinished, "");
-		} else if (len <= rfbTextMaxSize) {
-			rfbSendTextChatMessage(cl2, len, txt);
-		}
-
-		SEND_UNLOCK(cl2);
-	}
-	rfbReleaseClientIterator(iter);
-
-	if (ulen == rfbTextChatClose && cl != NULL) {
-		/* not clear what is going on WRT close and finished... */
-		SEND_LOCK(cl);
-		rfbSendTextChatMessage(cl, rfbTextChatFinished, "");
-		SEND_UNLOCK(cl);
-	}
-#endif
-}
-
-int get_keyboard_led_state_hook(rfbScreenInfoPtr s) {
-	if (s) {}
-	if (unixpw_in_progress) {
-		rfbLog("get_keyboard_led_state_hook: unixpw_in_progress, skipping.\n");
-		return 0;
-	}
-	return 0;
-}
-int get_file_transfer_permitted(rfbClientPtr cl) {
-	allowed_input_t input;
-	if (unixpw_in_progress) {
-		rfbLog("get_file_transfer_permitted: unixpw_in_progress, dropping client.\n");
-		rfbCloseClient(cl);
-		return FALSE;
-	}
-if (0) fprintf(stderr, "get_file_transfer_permitted called\n");
-	if (view_only) {
-		return FALSE;
-	}
-	if (cl->viewOnly) {
-		return FALSE;
-	}
-	get_allowed_input(cl, &input);
-	if (!input.files) {
-		return FALSE;
-	}
-	if (screen->permitFileTransfer) {
-		saw_ultra_file = 1;
-	}
-	return screen->permitFileTransfer;
-}
-
-
diff --git a/ica/x11/x11vnc/xevents.h b/ica/x11/x11vnc/xevents.h
deleted file mode 100644
index 5b8bdce..0000000
--- a/ica/x11/x11vnc/xevents.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XEVENTS_H
-#define _X11VNC_XEVENTS_H
-
-/* -- xevents.h -- */
-
-extern int grab_buster;
-extern int grab_kbd;
-extern int grab_ptr;
-extern int grab_always;
-extern int ungrab_both;
-extern int grab_local;
-extern int sync_tod_delay;
-
-extern void initialize_vnc_connect_prop(void);
-extern void initialize_x11vnc_remote_prop(void);
-extern void initialize_clipboard_atom(void);
-extern void spawn_grab_buster(void);
-extern void sync_tod_with_servertime(void);
-extern void check_keycode_state(void);
-extern void check_autorepeat(void);
-extern void set_prop_atom(Atom atom);
-extern void check_xevents(int reset);
-extern void xcut_receive(char *text, int len, rfbClientPtr cl);
-
-extern void kbd_release_all_keys(rfbClientPtr cl);
-extern void set_single_window(rfbClientPtr cl, int x, int y);
-extern void set_server_input(rfbClientPtr cl, int s);
-extern void set_text_chat(rfbClientPtr cl, int l, char *t);
-extern int get_keyboard_led_state_hook(rfbScreenInfoPtr s);
-extern int get_file_transfer_permitted(rfbClientPtr cl);
-extern void get_prop(char *str, int len, Atom prop, Window w);
-extern int guess_dm_gone(int t1, int t2);
-
-
-#endif /* _X11VNC_XEVENTS_H */
diff --git a/ica/x11/x11vnc/xinerama.c b/ica/x11/x11vnc/xinerama.c
deleted file mode 100644
index 001e2ca..0000000
--- a/ica/x11/x11vnc/xinerama.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xinerama.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "blackout_t.h"
-#include "scan.h"
-
-/*
- * routines related to xinerama and blacking out rectangles
- */
-
-/* blacked-out region (-blackout, -xinerama) */
-
-#define BLACKR_MAX 100
-blackout_t blackr[BLACKR_MAX];	/* hardwired max blackouts */
-tile_blackout_t *tile_blackout;
-int blackouts = 0;
-
-void initialize_blackouts_and_xinerama(void);
-void push_sleep(int n);
-void push_black_screen(int n);
-void refresh_screen(int push);
-void zero_fb(int x1, int y1, int x2, int y2);
-
-
-static void initialize_blackouts(char *list);
-static void blackout_tiles(void);
-static void initialize_xinerama (void);
-
-
-/*
- * Take a comma separated list of geometries: WxH+X+Y and register them as
- * rectangles to black out from the screen.
- */
-static void initialize_blackouts(char *list) {
-	char *p, *blist = strdup(list);
-	int x, y, X, Y, h, w, t;
-
-	p = strtok(blist, ", \t");
-	while (p) {
-		if (!strcmp("noptr", p)) {
-			blackout_ptr = 1;
-			rfbLog("pointer will be blocked from blackout "
-			    "regions\n");
-			p = strtok(NULL, ", \t");
-			continue;
-		}
-		if (! parse_geom(p, &w, &h, &x, &y, dpy_x, dpy_y)) {
-			if (*p != '\0') {
-				rfbLog("skipping invalid geometry: %s\n", p);
-			}
-			p = strtok(NULL, ", \t");
-			continue;
-		}
-		w = nabs(w);
-		h = nabs(h);
-		x = nfix(x, dpy_x);
-		y = nfix(y, dpy_y);
-		X = x + w;
-		Y = y + h;
-		X = nfix(X, dpy_x+1);
-		Y = nfix(Y, dpy_y+1);
-		if (x > X) {
-			t = X; X = x; x = t;
-		}
-		if (y > Y) {
-			t = Y; Y = y; y = t;
-		}
-		if (x < 0 || x > dpy_x || y < 0 || y > dpy_y ||
-		    X < 0 || X > dpy_x || Y < 0 || Y > dpy_y ||
-		    x == X || y == Y) {
-			rfbLog("skipping invalid blackout geometry: %s x="
-			    "%d-%d,y=%d-%d,w=%d,h=%d\n", p, x, X, y, Y, w, h);
-		} else {
-			rfbLog("blackout rect: %s: x=%d-%d y=%d-%d\n", p,
-			    x, X, y, Y);
-
-			/*
-			 * note that the black out is x1 <= x but x < x2
-			 * for the region. i.e. the x2, y2 are outside
-			 * by 1 pixel. 
-			 */
-			blackr[blackouts].x1 = x;
-			blackr[blackouts].y1 = y;
-			blackr[blackouts].x2 = X;
-			blackr[blackouts].y2 = Y;
-			blackouts++;
-			if (blackouts >= BLACKR_MAX) {
-				rfbLog("too many blackouts: %d\n", blackouts);
-				break;
-			}
-		}
-		p = strtok(NULL, ", \t");
-	}
-	free(blist);
-}
-
-/*
- * Now that all blackout rectangles have been constructed, see what overlap
- * they have with the tiles in the system.  If a tile is touched by a
- * blackout, record information.
- */
-static void blackout_tiles(void) {
-	int tx, ty;
-	int debug_bo = 0;
-	if (! blackouts) {
-		return;
-	}
-	if (getenv("DEBUG_BLACKOUT") != NULL) {
-		debug_bo = 1;
-	}
-
-	/* 
-	 * to simplify things drop down to single copy mode, etc...
-	 */
-	single_copytile = 1;
-	/* loop over all tiles. */
-	for (ty=0; ty < ntiles_y; ty++) {
-		for (tx=0; tx < ntiles_x; tx++) {
-			sraRegionPtr tile_reg, black_reg;
-			sraRect rect;
-			sraRectangleIterator *iter;
-			int n, b, x1, y1, x2, y2, cnt;
-
-			/* tile number and coordinates: */
-			n = tx + ty * ntiles_x;
-			x1 = tx * tile_x;
-			y1 = ty * tile_y;
-			x2 = x1 + tile_x;
-			y2 = y1 + tile_y;
-			if (x2 > dpy_x) {
-				x2 = dpy_x;
-			}
-			if (y2 > dpy_y) {
-				y2 = dpy_y;
-			}
-
-			/* make regions for the tile and the blackouts: */
-			black_reg = (sraRegionPtr) sraRgnCreate();
-			tile_reg  = (sraRegionPtr) sraRgnCreateRect(x1, y1,
-			    x2, y2);
-
-			tile_blackout[n].cover = 0;
-			tile_blackout[n].count = 0;
-
-			/* union of blackouts */
-			for (b=0; b < blackouts; b++) {
-				sraRegionPtr tmp_reg = (sraRegionPtr)
-				    sraRgnCreateRect(blackr[b].x1,
-				    blackr[b].y1, blackr[b].x2, blackr[b].y2);
-
-				sraRgnOr(black_reg, tmp_reg);
-				sraRgnDestroy(tmp_reg);
-			}
-
-			if (! sraRgnAnd(black_reg, tile_reg)) {
-				/*
-				 * no intersection for this tile, so we
-				 * are done.
-				 */
-				sraRgnDestroy(black_reg);
-				sraRgnDestroy(tile_reg);
-				continue;
-			}
-
-			/*
-			 * loop over rectangles that make up the blackout
-			 * region:
-			 */
-			cnt = 0;
-			iter = sraRgnGetIterator(black_reg);
-			while (sraRgnIteratorNext(iter, &rect)) {
-
-				/* make sure x1 < x2 and y1 < y2 */
-				if (rect.x1 > rect.x2) {
-					int tmp = rect.x2;
-					rect.x2 = rect.x1;
-					rect.x1 = tmp;
-				}
-				if (rect.y1 > rect.y2) {
-					int tmp = rect.y2;
-					rect.y2 = rect.y1;
-					rect.y1 = tmp;
-				}
-
-				/* store coordinates */
-				tile_blackout[n].bo[cnt].x1 = rect.x1;
-				tile_blackout[n].bo[cnt].y1 = rect.y1;
-				tile_blackout[n].bo[cnt].x2 = rect.x2;
-				tile_blackout[n].bo[cnt].y2 = rect.y2;
-
-				/* note if the tile is completely obscured */
-				if (rect.x1 == x1 && rect.y1 == y1 &&
-				    rect.x2 == x2 && rect.y2 == y2) {
-					tile_blackout[n].cover = 2;
-					if (debug_bo) {
- 						fprintf(stderr, "full: %d=%d,%d"
-						    "  (%d-%d)  (%d-%d)\n",
-						    n, tx, ty, x1, x2, y1, y2);
-					}
-				} else {
-					tile_blackout[n].cover = 1;
-					if (debug_bo) {
-						fprintf(stderr, "part: %d=%d,%d"
-						    "  (%d-%d)  (%d-%d)\n",
-						    n, tx, ty, x1, x2, y1, y2);
-					}
-				}
-
-				if (++cnt >= BO_MAX) {
-					rfbLog("too many blackout rectangles "
-					    "for tile %d=%d,%d.\n", n, tx, ty);
-					break;
-				}
-			}
-			sraRgnReleaseIterator(iter);
-
-			sraRgnDestroy(black_reg);
-			sraRgnDestroy(tile_reg);
-
-			tile_blackout[n].count = cnt;
-			if (debug_bo && cnt > 1) {
- 				rfbLog("warning: multiple region overlaps[%d] "
-				    "for tile %d=%d,%d.\n", cnt, n, tx, ty);
-			}
-		}
-	}
-}
-
-static int did_xinerama_clip = 0;
-
-void check_xinerama_clip(void) {
-#if LIBVNCSERVER_HAVE_LIBXINERAMA
-	int n, k, i, ev, er, juse = -1;
-	int score[32], is = 0;
-	XineramaScreenInfo *x;
-
-	if (!clip_str || !dpy) {
-		return;
-	}
-	if (sscanf(clip_str, "xinerama%d", &k) == 1) {
-		;
-	} else if (sscanf(clip_str, "screen%d", &k) == 1) {
-		;
-	} else {
-		return;
-	}
-
-	free(clip_str);
-	clip_str = NULL;
-
-	if (! XineramaQueryExtension(dpy, &ev, &er)) {
-		return;
-	}
-	if (! XineramaIsActive(dpy)) {
-		return;
-	}
-	x = XineramaQueryScreens(dpy, &n);
-	if (k < 0 || k >= n) {
-		XFree_wr(x);
-		return;
-	}
-	for (i=0; i < n; i++) {
-		score[is++] = nabs(x[i].x_org) + nabs(x[i].y_org);
-		if (is >= 32) {
-			break;
-		}
-	}
-	for (i=0; i <= k; i++) {
-		int j, jmon = 0, mon = -1, mox = -1;
-		for (j=0; j < is; j++) {
-			if (mon < 0 || score[j] < mon) {
-				mon = score[j];
-				jmon = j;
-			}
-			if (mox < 0 || score[j] > mox) {
-				mox = score[j];
-			}
-		}
-		juse = jmon;
-		score[juse] = mox+1+i;
-	}
-
-	if (juse >= 0 && juse < n) {
-		char str[64];
-		sprintf(str, "%dx%d+%d+%d", x[juse].width, x[juse].height,
-		    x[juse].x_org, x[juse].y_org);
-		clip_str = strdup(str);
-		did_xinerama_clip = 1;
-	} else {
-		clip_str = strdup("");
-	}
-	XFree_wr(x);
-	if (!quiet) {
-		rfbLog("set -clip to '%s' for xinerama%d\n", clip_str, k);
-	}
-#endif
-}
-
-static void initialize_xinerama (void) {
-#if !LIBVNCSERVER_HAVE_LIBXINERAMA
-	if (!raw_fb_str) {
-		rfbLog("Xinerama: Library libXinerama is not available to determine\n");
-		rfbLog("Xinerama: the head geometries, consider using -blackout\n");
-		rfbLog("Xinerama: if the screen is non-rectangular.\n");
-	}
-#else
-	XineramaScreenInfo *sc, *xineramas;
-	sraRegionPtr black_region, tmp_region;
-	sraRectangleIterator *iter;
-	sraRect rect;
-	char *bstr, *tstr;
-	int ev, er, i, n, rcnt;
-
-	RAWFB_RET_VOID
-
-	X_LOCK;
-	if (! XineramaQueryExtension(dpy, &ev, &er)) {
-		if (verbose) {
-			rfbLog("Xinerama: disabling: display does not support it.\n");
-		}
-		xinerama = 0;
-		xinerama_present = 0;
-		X_UNLOCK;
-		return;
-	}
-	if (! XineramaIsActive(dpy)) {
-		/* n.b. change to XineramaActive(dpy, window) someday */
-		if (verbose) {
-			rfbLog("Xinerama: disabling: not active on display.\n");
-		}
-		xinerama = 0;
-		xinerama_present = 0;
-		X_UNLOCK;
-		return;
-	}
-	xinerama_present = 1;
-	rfbLog("\n");
-	rfbLog("Xinerama is present and active (e.g. multi-head).\n");
-
-	/* n.b. change to XineramaGetData() someday */
-	xineramas = XineramaQueryScreens(dpy, &n);
-	rfbLog("Xinerama: number of sub-screens: %d\n", n);
-
-	if (! use_xwarppointer && ! got_noxwarppointer && n > 1) {
-		rfbLog("Xinerama: enabling -xwarppointer mode to try to correct\n");
-		rfbLog("Xinerama: mouse pointer motion. XTEST+XINERAMA bug.\n");
-		rfbLog("Xinerama: Use -noxwarppointer to force XTEST.\n");
-		use_xwarppointer = 1;
-	}
-
-	if (n == 1) {
-		rfbLog("Xinerama: no blackouts needed (only one sub-screen)\n");
-		rfbLog("\n");
-		XFree_wr(xineramas);
-		X_UNLOCK;
-		return;		/* must be OK w/o change */
-	}
-
-	black_region = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
-
-	sc = xineramas;
-	for (i=0; i<n; i++) {
-		int x, y, w, h;
-		
-		x = sc->x_org;
-		y = sc->y_org;
-		w = sc->width;
-		h = sc->height;
-
-		rfbLog("Xinerama: sub-screen[%d]  %dx%d+%d+%d\n", i, w, h, x, y);
-
-		tmp_region = sraRgnCreateRect(x, y, x + w, y + h);
-
-		sraRgnSubtract(black_region, tmp_region);
-		sraRgnDestroy(tmp_region);
-		sc++;
-	}
-	XFree_wr(xineramas);
-	X_UNLOCK;
-
-
-	if (sraRgnEmpty(black_region)) {
-		rfbLog("Xinerama: no blackouts needed (screen fills"
-		    " rectangle)\n");
-		rfbLog("\n");
-		sraRgnDestroy(black_region);
-		return;
-	}
-	if (did_xinerama_clip) {
-		rfbLog("Xinerama: no blackouts due to -clip xinerama.\n");
-		return;
-	}
-
-	/* max len is 10000x10000+10000+10000 (23 chars) per geometry */
-	rcnt = (int) sraRgnCountRects(black_region);
-	bstr = (char *) malloc(30 * (rcnt+1));
-	tstr = (char *) malloc(30);
-	bstr[0] = '\0';
-
-	iter = sraRgnGetIterator(black_region);
-	while (sraRgnIteratorNext(iter, &rect)) {
-		int x, y, w, h;
-
-		/* make sure x1 < x2 and y1 < y2 */
-		if (rect.x1 > rect.x2) {
-			int tmp = rect.x2;
-			rect.x2 = rect.x1;
-			rect.x1 = tmp;
-		}
-		if (rect.y1 > rect.y2) {
-			int tmp = rect.y2;
-			rect.y2 = rect.y1;
-			rect.y1 = tmp;
-		}
-		x = rect.x1;
-		y = rect.y1;
-		w = rect.x2 - x;
-		h = rect.y2 - y;
-		sprintf(tstr, "%dx%d+%d+%d,", w, h, x, y);
-		strcat(bstr, tstr);
-	}
-	sraRgnReleaseIterator(iter);
-	initialize_blackouts(bstr);
-	rfbLog("\n");
-
-	free(bstr);
-	free(tstr);
-#endif
-}
-
-void initialize_blackouts_and_xinerama(void) {
-
-	blackouts = 0;
-	blackout_ptr = 0;
-
-	if (blackout_str != NULL) {
-		initialize_blackouts(blackout_str);
-	}
-	if (xinerama) {
-		initialize_xinerama();
-	}
-	if (blackouts) {
-		blackout_tiles();
-		/* schedule a copy_screen(), now is too early. */
-		do_copy_screen = 1;
-	}
-}
-
-void push_sleep(int n) {
-	int i;
-	for (i=0; i<n; i++) {
-		rfbPE(-1);
-		if (i != n-1 && defer_update) {
-			usleep(defer_update * 1000);
-		}
-	}
-}
-
-/*
- * try to forcefully push a black screen to all connected clients
- */
-void push_black_screen(int n) {
-	int Lx = dpy_x, Ly = dpy_y;
-	if (!screen) {
-		return;
-	}
-#ifndef NO_NCACHE
-	if (ncache > 0) {
-		Ly = dpy_y * (1+ncache);
-	}
-#endif
-	zero_fb(0, 0, Lx, Ly);
-	mark_rect_as_modified(0, 0, Lx, Ly, 0);
-	push_sleep(n);
-}
-
-void refresh_screen(int push) {
-	int i;
-	if (!screen) {
-		return;
-	}
-	mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
-	for (i=0; i<push; i++) {
-		rfbPE(-1);
-	}
-}
-
-/*
- * Fill the framebuffer with zero for the prescribed rectangle
- */
-void zero_fb(int x1, int y1, int x2, int y2) {
-	int pixelsize = bpp/8;
-	int line, fill = 0, yfac = 1;
-	char *dst;
-
-#ifndef NO_NCACHE
-	if (ncache > 0) {
-		yfac = 1+ncache;
-		if (ncache_xrootpmap) {
-			yfac++;
-		}
-	}
-#endif
-	
-	if (x1 < 0 || x2 <= x1 || x2 > dpy_x) {
-		return;
-	}
-	if (y1 < 0 || y2 <= y1 || y2 > yfac * dpy_y) {
-		return;
-	}
-	if (! main_fb) {
-		return;
-	}
-
-	dst = main_fb + y1 * main_bytes_per_line + x1 * pixelsize;
-	line = y1;
-	while (line++ < y2) {
-		memset(dst, fill, (size_t) (x2 - x1) * pixelsize);
-		dst += main_bytes_per_line;
-	}
-}
-
-
diff --git a/ica/x11/x11vnc/xinerama.h b/ica/x11/x11vnc/xinerama.h
deleted file mode 100644
index 6fd00cf..0000000
--- a/ica/x11/x11vnc/xinerama.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XINERAMA_H
-#define _X11VNC_XINERAMA_H
-
-/* -- xinerama.h -- */
-#include "blackout_t.h"
-
-extern blackout_t blackr[];
-extern tile_blackout_t *tile_blackout;
-extern int blackouts;
-
-extern void initialize_blackouts_and_xinerama(void);
-extern void push_sleep(int n);
-extern void push_black_screen(int n);
-extern void refresh_screen(int push);
-extern void zero_fb(int x1, int y1, int x2, int y2);
-extern void check_xinerama_clip(void);
-
-#endif /* _X11VNC_XINERAMA_H */
diff --git a/ica/x11/x11vnc/xkb_bell.c b/ica/x11/x11vnc/xkb_bell.c
deleted file mode 100644
index 71563d6..0000000
--- a/ica/x11/x11vnc/xkb_bell.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xkb_bell.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "connections.h"
-
-/*
- * Bell event handling.  Requires XKEYBOARD extension.
- */
-int xkb_base_event_type = 0;
-
-void initialize_xkb(void);
-void initialize_watch_bell(void);
-void check_bell_event(void);
-
-
-#if LIBVNCSERVER_HAVE_XKEYBOARD
-
-/*
- * check for XKEYBOARD, set up xkb_base_event_type
- */
-void initialize_xkb(void) {
-	int ir, reason;
-	int op, ev, er, maj, min;
-	
-	RAWFB_RET_VOID
-
-	if (xkbcompat) {
-		xkb_present = 0;
-	} else if (! XkbQueryExtension(dpy, &op, &ev, &er, &maj, &min)) {
-		if (! quiet) {
-			rfbLog("warning: XKEYBOARD extension not present.\n");
-		}
-		xkb_present = 0;
-	} else {
-		xkb_present = 1;
-	}
-
-	if (! xkb_present) {
-		return;
-	}
-
-	if (! xauth_raw(1)) {
-		return;
-	}
-
-	if (! XkbOpenDisplay(DisplayString(dpy), &xkb_base_event_type, &ir,
-	    NULL, NULL, &reason) ) {
-		if (! quiet) {
-			rfbLog("warning: disabling XKEYBOARD. XkbOpenDisplay"
-			    " failed.\n");
-		}
-		xkb_base_event_type = 0;
-		xkb_present = 0;
-	}
-	xauth_raw(0);
-}
-
-void initialize_watch_bell(void) {
-	if (! xkb_present) {
-		if (! quiet) {
-			rfbLog("warning: disabling bell. XKEYBOARD ext. "
-			    "not present.\n");
-		}
-		watch_bell = 0;
-		sound_bell = 0;
-		return;
-	}
-
-	RAWFB_RET_VOID
-
-	XkbSelectEvents(dpy, XkbUseCoreKbd, XkbBellNotifyMask, 0);
-
-	if (! watch_bell) {
-		return;
-	}
-	if (! XkbSelectEvents(dpy, XkbUseCoreKbd, XkbBellNotifyMask,
-	    XkbBellNotifyMask) ) {
-		if (! quiet) {
-			rfbLog("warning: disabling bell. XkbSelectEvents"
-			    " failed.\n");
-		}
-		watch_bell = 0;
-		sound_bell = 0;
-	}
-}
-
-/*
- * We call this periodically to process any bell events that have 
- * taken place.
- */
-void check_bell_event(void) {
-	XEvent xev;
-	XkbAnyEvent *xkb_ev;
-	int got_bell = 0;
-
-	if (! xkb_base_event_type) {
-		return;
-	}
-	RAWFB_RET_VOID
-
-	/* caller does X_LOCK */
-	if (! XCheckTypedEvent(dpy, xkb_base_event_type, &xev)) {
-		return;
-	}
-	if (! watch_bell) {
-		/* we return here to avoid xkb events piling up */
-		return;
-	}
-
-	xkb_ev = (XkbAnyEvent *) &xev;
-	if (xkb_ev->xkb_type == XkbBellNotify) {
-		got_bell = 1;
-	}
-
-	if (got_bell && sound_bell) {
-		if (! all_clients_initialized()) {
-			rfbLog("check_bell_event: not sending bell: "
-			    "uninitialized clients\n");
-		} else {
-			if (screen && client_count) {
-				rfbSendBell(screen);
-			}
-		}
-	}
-}
-#else
-void initialize_watch_bell(void) {
-	watch_bell = 0;
-	sound_bell = 0;
-}
-void check_bell_event(void) {}
-#endif
-
-
diff --git a/ica/x11/x11vnc/xkb_bell.h b/ica/x11/x11vnc/xkb_bell.h
deleted file mode 100644
index 16762e7..0000000
--- a/ica/x11/x11vnc/xkb_bell.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XKB_BELL_H
-#define _X11VNC_XKB_BELL_H
-
-/* -- xkb_bell.h -- */
-
-extern int xkb_base_event_type;
-
-extern void initialize_xkb(void);
-extern void initialize_watch_bell(void);
-extern void check_bell_event(void);
-
-#endif /* _X11VNC_XKB_BELL_H */
diff --git a/ica/x11/x11vnc/xrandr.c b/ica/x11/x11vnc/xrandr.c
deleted file mode 100644
index d0d68e1..0000000
--- a/ica/x11/x11vnc/xrandr.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xrandr.c -- */
-
-#include "x11vnc.h"
-#include "cleanup.h"
-#include "connections.h"
-#include "remote.h"
-#include "screen.h"
-#include "win_utils.h"
-
-time_t last_subwin_trap = 0;
-int subwin_trap_count = 0;
-XErrorHandler old_getimage_handler;
-
-int xrandr_present = 0;
-int xrandr_width  = -1;
-int xrandr_height = -1;
-int xrandr_rotation = -1;
-Time xrandr_timestamp = 0;
-Time xrandr_cfg_time = 0;
-
-void initialize_xrandr(void);
-int check_xrandr_event(char *msg);
-int known_xrandr_mode(char *s);
-
-static int handle_subwin_resize(char *msg);
-static void handle_xrandr_change(int new_x, int new_y);
-
-
-void initialize_xrandr(void) {
-	if (xrandr_present && dpy) {
-#if LIBVNCSERVER_HAVE_LIBXRANDR
-		Rotation rot;
-
-		X_LOCK;
-		xrandr_width  = XDisplayWidth(dpy, scr);
-		xrandr_height = XDisplayHeight(dpy, scr);
-		XRRRotations(dpy, scr, &rot);
-		xrandr_rotation = (int) rot;
-		if (xrandr || xrandr_maybe) {
-			XRRSelectInput(dpy, rootwin, RRScreenChangeNotifyMask);
-		} else {
-			XRRSelectInput(dpy, rootwin, 0);
-		}
-		X_UNLOCK;
-#endif
-	} else if (xrandr) {
-		rfbLog("-xrandr mode specified, but no RANDR support on\n");
-		rfbLog(" display or in client library. Disabling -xrandr "
-		    "mode.\n");
-		xrandr = 0;
-	}
-}
-
-static int handle_subwin_resize(char *msg) {
-	int new_x, new_y;
-	int i, check = 10, ms = 250;	/* 2.5 secs total... */
-
-	if (msg) {}	/* unused vars warning: */
-	if (! subwin) {
-		return 0;	/* hmmm... */
-	}
-	if (! valid_window(subwin, NULL, 0)) {
-		rfbLogEnable(1);
-		rfbLog("subwin 0x%lx went away!\n", subwin);
-		X_UNLOCK;
-		clean_up_exit(1);
-	}
-	if (! get_window_size(subwin, &new_x, &new_y)) {
-		rfbLogEnable(1);
-		rfbLog("could not get size of subwin 0x%lx\n", subwin);
-		X_UNLOCK;
-		clean_up_exit(1);
-	}
-	if (wdpy_x == new_x && wdpy_y == new_y) {
-		/* no change */
-		return 0;
-	}
-
-	/* window may still be changing (e.g. drag resize) */
-	for (i=0; i < check; i++) {
-		int newer_x, newer_y;
-		usleep(ms * 1000);
-
-		if (! get_window_size(subwin, &newer_x, &newer_y)) {
-			rfbLogEnable(1);
-			rfbLog("could not get size of subwin 0x%lx\n", subwin);
-			clean_up_exit(1);
-		}
-		if (new_x == newer_x && new_y == newer_y) {
-			/* go for it... */
-			break;
-		} else {
-			rfbLog("subwin 0x%lx still changing size...\n", subwin);
-			new_x = newer_x;
-			new_y = newer_y;
-		}
-	}
-
-	rfbLog("subwin 0x%lx new size: x: %d -> %d, y: %d -> %d\n",
-	    subwin, wdpy_x, new_x, wdpy_y, new_y);
-	rfbLog("calling handle_xrandr_change() for resizing\n");
-
-	X_UNLOCK;
-	handle_xrandr_change(new_x, new_y);
-	return 1;
-}
-
-static void handle_xrandr_change(int new_x, int new_y) {
-	rfbClientIteratorPtr iter;
-	rfbClientPtr cl;
-
-	RAWFB_RET_VOID
-
-	/* assumes no X_LOCK */
-
-	/* sanity check xrandr_mode */
-	if (! xrandr_mode) {
-		xrandr_mode = strdup("default");
-	} else if (! known_xrandr_mode(xrandr_mode)) {
-		free(xrandr_mode);
-		xrandr_mode = strdup("default");
-	}
-	rfbLog("xrandr_mode: %s\n", xrandr_mode);
-	if (!strcmp(xrandr_mode, "exit")) {
-		close_all_clients();
-		rfbLog("  shutting down due to XRANDR event.\n");
-		clean_up_exit(0);
-	}
-	if (!strcmp(xrandr_mode, "newfbsize") && screen) {
-		iter = rfbGetClientIterator(screen);
-		while( (cl = rfbClientIteratorNext(iter)) ) {
-			if (cl->useNewFBSize) {
-				continue;
-			}
-			rfbLog("  closing client %s (no useNewFBSize"
-			    " support).\n", cl->host);
-			rfbCloseClient(cl);
-			rfbClientConnectionGone(cl);
-		}
-		rfbReleaseClientIterator(iter);
-	}
-	
-	/* default, resize, and newfbsize create a new fb: */
-	rfbLog("check_xrandr_event: trying to create new framebuffer...\n");
-	if (new_x < wdpy_x || new_y < wdpy_y) {
-		check_black_fb();
-	}
-	do_new_fb(1);
-	rfbLog("check_xrandr_event: fb       WxH: %dx%d\n", wdpy_x, wdpy_y);
-}
-
-int check_xrandr_event(char *msg) {
-	XEvent xev;
-
-	RAWFB_RET(0)
-
-	/* it is assumed that X_LOCK is on at this point. */
-
-	if (subwin) {
-		return handle_subwin_resize(msg);
-	}
-#if LIBVNCSERVER_HAVE_LIBXRANDR
-	if (! xrandr_present) {
-		return 0;
-	}
-	if (! xrandr && ! xrandr_maybe) {
-		return 0;
-	}
-
-
-	if (xrandr_base_event_type && XCheckTypedEvent(dpy,
-	    xrandr_base_event_type + RRScreenChangeNotify, &xev)) {
-		int do_change, qout = 0;
-		static int first = 1;
-		XRRScreenChangeNotifyEvent *rev;
-
-		rev = (XRRScreenChangeNotifyEvent *) &xev;
-
-		if (first && ! xrandr) {
-			fprintf(stderr, "\n");
-			if (getenv("X11VNC_DEBUG_XRANDR") == NULL) {
-				qout = 1;
-			}
-		}
-		first = 0;
-			
-		rfbLog("check_xrandr_event():\n");
-		rfbLog("Detected XRANDR event at location '%s':\n", msg);
-
-		if (qout) {
-			;
-		} else {
-			rfbLog("  serial:          %d\n", (int) rev->serial);
-			rfbLog("  timestamp:       %d\n", (int) rev->timestamp);
-			rfbLog("  cfg_timestamp:   %d\n", (int) rev->config_timestamp);
-			rfbLog("  size_id:         %d\n", (int) rev->size_index);
-			rfbLog("  sub_pixel:       %d\n", (int) rev->subpixel_order);
-			rfbLog("  rotation:        %d\n", (int) rev->rotation);
-			rfbLog("  width:           %d\n", (int) rev->width);
-			rfbLog("  height:          %d\n", (int) rev->height);
-			rfbLog("  mwidth:          %d mm\n", (int) rev->mwidth);
-			rfbLog("  mheight:         %d mm\n", (int) rev->mheight);
-			rfbLog("\n");
-			rfbLog("check_xrandr_event: previous WxH: %dx%d\n",
-			    wdpy_x, wdpy_y);
-		}
-
-		if (wdpy_x == rev->width && wdpy_y == rev->height &&
-		    xrandr_rotation == (int) rev->rotation) {
-			rfbLog("check_xrandr_event: no change detected.\n");
-			do_change = 0;
-			if (! xrandr) {
-		    		rfbLog("check_xrandr_event: "
-				    "enabling full XRANDR trapping anyway.\n");
-				xrandr = 1;
-			}
-		} else {
-			do_change = 1;
-			if (! xrandr) {
-		    		rfbLog("check_xrandr_event: Resize; "
-				    "enabling full XRANDR trapping.\n");
-				xrandr = 1;
-			}
-		}
-
-		xrandr_width  = rev->width;
-		xrandr_height = rev->height;
-		xrandr_timestamp = rev->timestamp;
-		xrandr_cfg_time  = rev->config_timestamp;
-		xrandr_rotation = (int) rev->rotation;
-
-		if (! qout) rfbLog("check_xrandr_event: updating config...\n");
-		XRRUpdateConfiguration(&xev);
-
-		if (do_change) {
-			/* under do_change caller normally returns before its X_UNLOCK */
-			X_UNLOCK;
-			handle_xrandr_change(rev->width, rev->height);
-		}
-		if (qout) {
-			return do_change;
-		}
-		rfbLog("check_xrandr_event: current  WxH: %dx%d\n",
-		    XDisplayWidth(dpy, scr), XDisplayHeight(dpy, scr));
-		rfbLog("check_xrandr_event(): returning control to"
-		    " caller...\n");
-
-
-		return do_change;
-	}
-#else
-	xev.type = 0;
-#endif
-
-
-	return 0;
-}
-
-int known_xrandr_mode(char *s) {
-/*
- * default:	
- * resize:	the default
- * exit:	shutdown clients and exit.
- * newfbsize:	shutdown clients that do not support NewFBSize encoding.
- */
-	if (strcmp(s, "default") && strcmp(s, "resize") && 
-	    strcmp(s, "exit") && strcmp(s, "newfbsize")) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-
diff --git a/ica/x11/x11vnc/xrandr.h b/ica/x11/x11vnc/xrandr.h
deleted file mode 100644
index 3f898f6..0000000
--- a/ica/x11/x11vnc/xrandr.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XRANDR_H
-#define _X11VNC_XRANDR_H
-
-/* -- xrandr.h -- */
-
-extern time_t last_subwin_trap;
-extern int subwin_trap_count;
-extern XErrorHandler old_getimage_handler;
-
-extern int xrandr_present;
-extern int xrandr_width;
-extern int xrandr_height;
-extern int xrandr_rotation;
-extern Time xrandr_timestamp;
-extern Time xrandr_cfg_time;
-
-extern void initialize_xrandr(void);
-extern int check_xrandr_event(char *msg);
-extern int known_xrandr_mode(char *s);
-
-#define XRANDR_SET_TRAP_RET(x,y)  \
-	if (subwin || xrandr) { \
-		trapped_getimage_xerror = 0; \
-		old_getimage_handler = XSetErrorHandler(trap_getimage_xerror); \
-		if (check_xrandr_event(y)) { \
-			trapped_getimage_xerror = 0; \
-			XSetErrorHandler(old_getimage_handler);	 \
-			X_UNLOCK; \
-			return(x); \
-		} \
-	}
-#define XRANDR_CHK_TRAP_RET(x,y)  \
-	if (subwin || xrandr) { \
-		if (trapped_getimage_xerror) { \
-			if (subwin) { \
-				static int last = 0; \
-				subwin_trap_count++; \
-				if (time(NULL) > last_subwin_trap + 60) { \
-					rfbLog("trapped GetImage xerror" \
-					    " in SUBWIN mode. [%d]\n", \
-					    subwin_trap_count); \
-					last_subwin_trap = time(NULL); \
-					last = subwin_trap_count; \
-				} \
-				if (subwin_trap_count - last > 30) { \
-					/* window probably iconified */ \
-					usleep(1000*1000); \
-				} \
-			} else { \
-				rfbLog("trapped GetImage xerror" \
-				    " in XRANDR mode.\n"); \
-			} \
-			trapped_getimage_xerror = 0; \
-			XSetErrorHandler(old_getimage_handler);	 \
-			XFlush_wr(dpy); \
-			check_xrandr_event(y); \
-			X_UNLOCK; \
-			return(x); \
-		} \
-	}
-
-#endif /* _X11VNC_XRANDR_H */
diff --git a/ica/x11/x11vnc/xrecord.c b/ica/x11/x11vnc/xrecord.c
deleted file mode 100644
index 87e15b9..0000000
--- a/ica/x11/x11vnc/xrecord.c
+++ /dev/null
@@ -1,2084 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xrecord.c -- */
-
-#include "x11vnc.h"
-#include "xwrappers.h"
-#include "win_utils.h"
-#include "cleanup.h"
-#include "userinput.h"
-#include "winattr_t.h"
-#include "scrollevent_t.h"
-#include "unixpw.h"
-
-#define SCR_EV_MAX 128
-scroll_event_t scr_ev[SCR_EV_MAX];
-int scr_ev_cnt;
-
-int xrecording = 0;
-int xrecord_set_by_keys = 0;
-int xrecord_set_by_mouse = 0;
-Window xrecord_focus_window = None;
-Window xrecord_wm_window = None;
-Window xrecord_ptr_window = None;
-KeySym xrecord_keysym = NoSymbol;
-
-#define NAMEINFO 2048
-char xrecord_name_info[NAMEINFO];
-
-#define SCR_ATTR_CACHE 8
-winattr_t scr_attr_cache[SCR_ATTR_CACHE];
-static double attr_cache_max_age = 1.5;
-
-Display *rdpy_data = NULL;		/* Data connection for RECORD */
-Display *rdpy_ctrl = NULL;		/* Control connection for RECORD */
-
-Display *gdpy_ctrl = NULL;
-Display *gdpy_data = NULL;
-int xserver_grabbed = 0;
-
-int trap_record_xerror(Display *, XErrorEvent *);
-
-void initialize_xrecord(void);
-void zerodisp_xrecord(void);
-void shutdown_xrecord(void);
-int xrecord_skip_keysym(rfbKeySym keysym);
-int xrecord_skip_button(int newb, int old);
-int xrecord_scroll_keysym(rfbKeySym keysym);
-void check_xrecord_reset(int force);
-void xrecord_watch(int start, int setby);
-
-
-#if LIBVNCSERVER_HAVE_RECORD
-static XRecordRange *rr_CA = NULL;
-static XRecordRange *rr_CW = NULL;
-static XRecordRange *rr_GS = NULL;
-static XRecordRange *rr_scroll[10];
-static XRecordContext rc_scroll;
-static XRecordClientSpec rcs_scroll;
-static XRecordRange *rr_grab[10];
-static XRecordContext rc_grab;
-static XRecordClientSpec rcs_grab;
-#endif
-static XErrorEvent *trapped_record_xerror_event;
-
-static void xrecord_grabserver(int start);
-static int xrecord_vi_scroll_keysym(rfbKeySym keysym);
-static int xrecord_emacs_scroll_keysym(rfbKeySym keysym);
-static int lookup_attr_cache(Window win, int *cache_index, int *next_index);
-#if LIBVNCSERVER_HAVE_RECORD
-static void record_CA(XPointer ptr, XRecordInterceptData *rec_data);
-static void record_CW(XPointer ptr, XRecordInterceptData *rec_data);
-static void record_switch(XPointer ptr, XRecordInterceptData *rec_data);
-static void record_grab(XPointer ptr, XRecordInterceptData *rec_data);
-static void shutdown_record_context(XRecordContext rc, int bequiet, int reopen);
-#endif
-static void check_xrecord_grabserver(void);
-
-
-int trap_record_xerror(Display *d, XErrorEvent *error) {
-	trapped_record_xerror = 1;
-	trapped_record_xerror_event = error;
-
-	if (d) {} /* unused vars warning: */
-
-	return 0;
-}
-
-static void xrecord_grabserver(int start) {
-	XErrorHandler old_handler = NULL;
-	int rc = 0;
-
-	if (debug_grabs) {
-		fprintf(stderr, "xrecord_grabserver%d/%d %.5f\n",
-			xserver_grabbed, start, dnowx());
-	}
-
-	if (! gdpy_ctrl || ! gdpy_data) {
-		return;
-	}
-#if LIBVNCSERVER_HAVE_RECORD
-	if (!start) {
-		if (! rc_grab) {
-			return;
-		}
-		XRecordDisableContext(gdpy_ctrl, rc_grab);
-		XRecordFreeContext(gdpy_ctrl, rc_grab);
-		XFlush_wr(gdpy_ctrl);
-		rc_grab = 0;
-		return;
-	}
-
-	xserver_grabbed = 0;
-
-	rr_grab[0] = rr_GS;
-	rcs_grab = XRecordAllClients;
-
-	rc_grab = XRecordCreateContext(gdpy_ctrl, 0, &rcs_grab, 1, rr_grab, 1);
-	trapped_record_xerror = 0;
-	old_handler = XSetErrorHandler(trap_record_xerror);
-
-	XSync(gdpy_ctrl, True);
-
-	if (! rc_grab || trapped_record_xerror) {
-		XCloseDisplay_wr(gdpy_ctrl);
-		XCloseDisplay_wr(gdpy_data);
-		gdpy_ctrl = NULL;
-		gdpy_data = NULL;
-		XSetErrorHandler(old_handler);
-		return;
-	}
-	rc = XRecordEnableContextAsync(gdpy_data, rc_grab, record_grab, NULL);
-	if (!rc || trapped_record_xerror) {
-		XCloseDisplay_wr(gdpy_ctrl);
-		XCloseDisplay_wr(gdpy_data);
-		gdpy_ctrl = NULL;
-		gdpy_data = NULL;
-		XSetErrorHandler(old_handler);
-		return;
-	}
-	XFlush_wr(gdpy_data);
-	XSetErrorHandler(old_handler);
-#else
-	if (!rc || !old_handler) {}
-#endif
-	if (debug_grabs) {
-		fprintf(stderr, "xrecord_grabserver-done: %.5f\n", dnowx());
-	}
-}
-
-void zerodisp_xrecord(void) {
-	rdpy_data = NULL;
-	rdpy_ctrl = NULL;
-	gdpy_data = NULL;
-	gdpy_ctrl = NULL;
-}
-
-void initialize_xrecord(void) {
-	use_xrecord = 0;
-	if (! xrecord_present) {
-		return;
-	}
-	if (nofb) {
-		return;
-	}
-	if (noxrecord) {
-		return;
-	}
-	RAWFB_RET_VOID
-#if LIBVNCSERVER_HAVE_RECORD
-
-	if (rr_CA) XFree_wr(rr_CA);
-	if (rr_CW) XFree_wr(rr_CW);
-	if (rr_GS) XFree_wr(rr_GS);
-
-	rr_CA = XRecordAllocRange();
-	rr_CW = XRecordAllocRange();
-	rr_GS = XRecordAllocRange();
-	if (!rr_CA || !rr_CW || !rr_GS) {
-		return;
-	}
-	/* protocol request ranges: */
-	rr_CA->core_requests.first = X_CopyArea;
-	rr_CA->core_requests.last  = X_CopyArea;
-	
-	rr_CW->core_requests.first = X_ConfigureWindow;
-	rr_CW->core_requests.last  = X_ConfigureWindow;
-
-	rr_GS->core_requests.first = X_GrabServer;
-	rr_GS->core_requests.last  = X_UngrabServer;
-
-	X_LOCK;
-	/* open a 2nd control connection to DISPLAY: */
-	if (rdpy_data) {
-		XCloseDisplay_wr(rdpy_data);
-		rdpy_data = NULL;
-	}
-	if (rdpy_ctrl) {
-		XCloseDisplay_wr(rdpy_ctrl);
-		rdpy_ctrl = NULL;
-	}
-	rdpy_ctrl = XOpenDisplay_wr(DisplayString(dpy));
-	if (!rdpy_ctrl) {
-		fprintf(stderr, "rdpy_ctrl open failed: %s / %s / %s / %s\n", getenv("DISPLAY"), DisplayString(dpy), getenv("XAUTHORITY"), getenv("XAUTHORIT_"));
-	}
-	XSync(dpy, True);
-	XSync(rdpy_ctrl, True);
-	/* open datalink connection to DISPLAY: */
-	rdpy_data = XOpenDisplay_wr(DisplayString(dpy));
-	if (!rdpy_data) {
-		fprintf(stderr, "rdpy_data open failed\n");
-	}
-	if (!rdpy_ctrl || ! rdpy_data) {
-		X_UNLOCK;
-		return;
-	}
-	disable_grabserver(rdpy_ctrl, 0);
-	disable_grabserver(rdpy_data, 0);
-
-	use_xrecord = 1;
-
-	/*
-	 * now set up the GrabServer watcher.  We get GrabServer
-	 * deadlock in XRecordCreateContext() even with XTestGrabServer
-	 * in place, why?  Not sure, so we manually watch for grabs...
-	 */
-	if (gdpy_data) {
-		XCloseDisplay_wr(gdpy_data);
-		gdpy_data = NULL;
-	}
-	if (gdpy_ctrl) {
-		XCloseDisplay_wr(gdpy_ctrl);
-		gdpy_ctrl = NULL;
-	}
-	xserver_grabbed = 0;
-
-	gdpy_ctrl = XOpenDisplay_wr(DisplayString(dpy));
-	if (!gdpy_ctrl) {
-		fprintf(stderr, "gdpy_ctrl open failed\n");
-	}
-	XSync(dpy, True);
-	XSync(gdpy_ctrl, True);
-	gdpy_data = XOpenDisplay_wr(DisplayString(dpy));
-	if (!gdpy_data) {
-		fprintf(stderr, "gdpy_data open failed\n");
-	}
-	if (gdpy_ctrl && gdpy_data) {
-		disable_grabserver(gdpy_ctrl, 0);
-		disable_grabserver(gdpy_data, 0);
-		xrecord_grabserver(1);
-	}
-	X_UNLOCK;
-#endif
-}
-
-void shutdown_xrecord(void) {
-#if LIBVNCSERVER_HAVE_RECORD
-
-	if (debug_grabs) {
-		fprintf(stderr, "shutdown_xrecord%d %.5f\n",
-			xserver_grabbed, dnowx());
-	}
-
-	if (rr_CA) XFree_wr(rr_CA);
-	if (rr_CW) XFree_wr(rr_CW);
-	if (rr_GS) XFree_wr(rr_GS);
-
-	rr_CA = NULL;
-	rr_CW = NULL;
-	rr_GS = NULL;
-
-	X_LOCK;
-	if (rdpy_ctrl && rc_scroll) {
-		XRecordDisableContext(rdpy_ctrl, rc_scroll);
-		XRecordFreeContext(rdpy_ctrl, rc_scroll);
-		XSync(rdpy_ctrl, False);
-		rc_scroll = 0;
-	}
-		
-	if (gdpy_ctrl && rc_grab) {
-		XRecordDisableContext(gdpy_ctrl, rc_grab);
-		XRecordFreeContext(gdpy_ctrl, rc_grab);
-		XSync(gdpy_ctrl, False);
-		rc_grab = 0;
-	}
-		
-	if (rdpy_data) {
-		XCloseDisplay_wr(rdpy_data);
-		rdpy_data = NULL;
-	}
-	if (rdpy_ctrl) {
-		XCloseDisplay_wr(rdpy_ctrl);
-		rdpy_ctrl = NULL;
-	}
-	if (gdpy_data) {
-		XCloseDisplay_wr(gdpy_data);
-		gdpy_data = NULL;
-	}
-	if (gdpy_ctrl) {
-		XCloseDisplay_wr(gdpy_ctrl);
-		gdpy_ctrl = NULL;
-	}
-	xserver_grabbed = 0;
-	X_UNLOCK;
-#endif
-	use_xrecord = 0;
-
-	if (debug_grabs) {
-		fprintf(stderr, "shutdown_xrecord-done: %.5f\n", dnowx());
-	}
-}
-
-int xrecord_skip_keysym(rfbKeySym keysym) {
-	KeySym sym = (KeySym) keysym;
-	int ok = -1, matched = 0;
-
-	if (scroll_key_list) {
-		int k, exclude = 0;
-		if (scroll_key_list[0]) {
-			exclude = 1;
-		}
-		k = 1;
-		while (scroll_key_list[k] != NoSymbol) {
-			if (scroll_key_list[k++] == sym) {
-				matched = 1;
-				break;
-			}
-		}
-		if (exclude) {
-			if (matched) {
-				return 1;
-			} else {
-				ok = 1;
-			}
-		} else {
-			if (matched) {
-				ok = 1;
-			} else {
-				ok = 0;
-			}
-		}
-	}
-	if (ok == 1) {
-		return 0;
-	} else if (ok == 0) {
-		return 1;
-	}
-
-	/* apply various heuristics: */
-
-	if (IsModifierKey(sym)) {
-		/* Shift, Control, etc, usu. generate no scrolls */
-		return 1;
-	}
-	if (sym == XK_space && scroll_term) {
-		/* space in a terminal is usu. full page... */
-		Window win;
-		static Window prev_top = None;
-		int size = 256;
-		static char name[256];
-
-		X_LOCK;
-		win = query_pointer(rootwin);
-		X_UNLOCK;
-		if (win != None && win != rootwin) {
-			if (prev_top != None && win == prev_top) {
-				;	/* use cached result */
-			} else {
-				prev_top = win;
-				X_LOCK;
-				win = descend_pointer(6, win, name, size);
-				X_UNLOCK;
-			}
-			if (match_str_list(name, scroll_term)) {
-				return 1;
-			}
-		}
-	}
-
-	/* TBD use typing_rate() so */
-	return 0;
-}
-
-int xrecord_skip_button(int new_button, int old) {
-	/* unused vars warning: */
-	if (new_button || old) {}
-
-	return 0;
-}
-
-static int xrecord_vi_scroll_keysym(rfbKeySym keysym) {
-	KeySym sym = (KeySym) keysym;
-	if (sym == XK_J || sym == XK_j || sym == XK_K || sym == XK_k) {
-		return 1;	/* vi */
-	}
-	if (sym == XK_D || sym == XK_d || sym == XK_U || sym == XK_u) {
-		return 1;	/* Ctrl-d/u */
-	}
-	if (sym == XK_Z || sym == XK_z) {
-		return 1;	/* zz, zt, zb .. */
-	}
-	return 0;
-}
-
-static int xrecord_emacs_scroll_keysym(rfbKeySym keysym) {
-	KeySym sym = (KeySym) keysym;
-	if (sym == XK_N || sym == XK_n || sym == XK_P || sym == XK_p) {
-		return 1;	/* emacs */
-	}
-	/* Must be some more ... */
-	return 0;
-}
-
-int xrecord_scroll_keysym(rfbKeySym keysym) {
-	KeySym sym = (KeySym) keysym;
-	/* X11/keysymdef.h */
-
-	if (sym == XK_Return || sym == XK_KP_Enter || sym == XK_Linefeed) {
-		return 1;	/* Enter */
-	}
-	if (sym==XK_Up || sym==XK_KP_Up || sym==XK_Down || sym==XK_KP_Down) {
-		return 1;	/* U/D arrows */
-	}
-	if (sym == XK_Left || sym == XK_KP_Left || sym == XK_Right ||
-	    sym == XK_KP_Right) {
-		return 1;	/* L/R arrows */
-	}
-	if (xrecord_vi_scroll_keysym(keysym)) {
-		return 1;
-	}
-	if (xrecord_emacs_scroll_keysym(keysym)) {
-		return 1;
-	}
-	return 0;
-}
-
-static int lookup_attr_cache(Window win, int *cache_index, int *next_index) {
-	double now, t, oldest = 0.0;
-	int i, old_index = -1, count = 0;
-	Window cwin;
-
-	*cache_index = -1;
-	*next_index  = -1;
-	
-	if (win == None) {
-		return 0;
-	}
-	if (attr_cache_max_age == 0.0) {
-		return 0;
-	}
-
-	dtime0(&now);
-	for (i=0; i < SCR_ATTR_CACHE; i++) {
-
-		cwin = scr_attr_cache[i].win;
-		t = scr_attr_cache[i].time;
-
-		if (now > t + attr_cache_max_age) {
-			/* expire it even if it is the one we want */
-			scr_attr_cache[i].win = cwin = None;
-			scr_attr_cache[i].fetched = 0;
-			scr_attr_cache[i].valid = 0;
-		}
-
-		if (*next_index == -1 && cwin == None) {
-			*next_index = i;
-		}
-		if (*next_index == -1) {
-			/* record oldest */
-			if (old_index == -1 || t < oldest) {
-				oldest = t;
-				old_index = i;
-			}
-		}
-		if (cwin != None) {
-			count++;
-		}
-		if (cwin == win) {
-			if (*cache_index == -1) {
-				*cache_index = i;
-			} else {
-				/* remove dups */
-				scr_attr_cache[i].win = None;
-				scr_attr_cache[i].fetched = 0;
-				scr_attr_cache[i].valid = 0;
-			}
-		}
-	}
-	if (*next_index == -1) {
-		*next_index = old_index;
-	}
-
-if (0) fprintf(stderr, "lookup_attr_cache count: %d\n", count);
-	if (*cache_index != -1) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-
-static XID xrecord_seq = 0;
-static double xrecord_start = 0.0;
-
-#if LIBVNCSERVER_HAVE_RECORD
-static void record_CA(XPointer ptr, XRecordInterceptData *rec_data) {
-	xCopyAreaReq *req;
-	Window src = None, dst = None, c;
-	XWindowAttributes attr, attr2;
-	int src_x, src_y, dst_x, dst_y, rx, ry, rx2, ry2;
-	int good = 1, dx = 0, dy = 0, k=0, i;
-	unsigned int w, h;
-	int dba = 0, db = debug_scroll;
-	int cache_index, next_index, valid;
-	static int must_equal = -1;
-
-	if (dba || db) {
-		if (rec_data->category == XRecordFromClient) {
-			req = (xCopyAreaReq *) rec_data->data;
-			if (req->reqType == X_CopyArea) {
-				src = req->srcDrawable;
-				dst = req->dstDrawable;
-			}
-		}
-	}
-
-if (dba || db > 1) fprintf(stderr, "record_CA-%d id_base: 0x%lx  ptr: 0x%lx "
-	"seq: 0x%lx rc: 0x%lx  cat: %d  swapped: %d 0x%lx/0x%lx\n", k++,
-	rec_data->id_base, (unsigned long) ptr, xrecord_seq, rc_scroll,
-	rec_data->category, rec_data->client_swapped, src, dst);
-
-	if (! xrecording) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	if (rec_data->id_base == 0) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	if ((XID) ptr != xrecord_seq) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	if (rec_data->category != XRecordFromClient) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	req = (xCopyAreaReq *) rec_data->data;
-
-	if (req->reqType != X_CopyArea) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	if (must_equal < 0) {
-		must_equal = 0;
-		if (getenv("X11VNC_SCROLL_MUST_EQUAL")) {
-			must_equal = 1;
-		}
-	}
-
-/*
-
-xterm, gnome-terminal, others.
-
-Note we miss the X_ImageText8 that clears the block cursor.  So there is a
-short period of time with a painting error: two cursors, one above the other.
-
- X_ImageText8 
-    draw: 0x8c00017 nChars: 1, gc: 0x8c00013, x: 101, y: 585, chars=' '
- X_ClearArea 
-    window: 0x8c00018, x:   2, y: 217, w:  10, h:   5
- X_FillPoly 
-    draw: 0x8c00018 gc: 0x8c0000a, shape: 0, coordMode: 0,
- X_FillPoly 
-    draw: 0x8c00018 gc: 0x8c0000b, shape: 0, coordMode: 0,
- X_CopyArea 
-    src: 0x8c00017, dst: 0x8c00017, gc: 0x8c00013, srcX:  17, srcY:  15, dstX:  17, dstY:   2, w: 480, h: 572
- X_ChangeWindowAttributes 
- X_ClearArea 
-    window: 0x8c00017, x:  17, y: 574, w: 480, h:  13
- X_ChangeWindowAttributes 
-
- */
-
-	src = req->srcDrawable;
-	dst = req->dstDrawable;
-	src_x = req->srcX;
-	src_y = req->srcY;
-	dst_x = req->dstX;
-	dst_y = req->dstY;
-	w = req->width;
-	h = req->height;
-
-	if (w*h < (unsigned int) scrollcopyrect_min_area) {
-		if (db > 1) fprintf(stderr, "record_CA scroll area too small.\n");
-		good = 0;
-	} else if (!src || !dst) {
-		if (db > 1) fprintf(stderr, "record_CA null src or dst.\n");
-		good = 0;
-	} else if (scr_ev_cnt >= SCR_EV_MAX) {
-		if (db > 1) fprintf(stderr, "record_CA null too many scr events.\n");
-		good = 0;
-	} else if (must_equal && src != dst) {
-		if (db > 1) fprintf(stderr, "record_CA src not equal dst.\n");
-		good = 0;
-	}
-
-	if (src == dst) {
-		dx = dst_x - src_x;
-		dy = dst_y - src_y;
-
-		if (dx != 0 && dy != 0) {
-			good = 0;
-		}
-	}
-
-if (!good && (dba || db > 1)) fprintf(stderr, "record_CA-x src_x: %d src_y: %d "
-	"dst_x: %d dst_y: %d w: %d h: %d scr_ev_cnt: %d 0x%lx/0x%lx\n",
-	src_x, src_y, dst_x, dst_y, w, h, scr_ev_cnt, src, dst);
-
-	if (! good) {
-		return;
-	}
-
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	/*
-	 * after all of the above succeeds, now contact X server.
-	 * we try to get away with some caching here.
-	 */
-	if (lookup_attr_cache(src, &cache_index, &next_index)) {
-		i = cache_index;
-		attr.x = scr_attr_cache[i].x;
-		attr.y = scr_attr_cache[i].y;
-		attr.width = scr_attr_cache[i].width;
-		attr.height = scr_attr_cache[i].height;
-		attr.map_state = scr_attr_cache[i].map_state;
-		rx = scr_attr_cache[i].rx;
-		ry = scr_attr_cache[i].ry;
-		valid = scr_attr_cache[i].valid;
-
-	} else {
-		valid = valid_window(src, &attr, 1);
-
-		if (valid) {
-			if (!xtranslate(src, rootwin, 0, 0, &rx, &ry, &c, 1)) {
-				valid = 0;
-			}
-		}
-		if (next_index >= 0) {
-			i = next_index;
-			scr_attr_cache[i].win = src;
-			scr_attr_cache[i].fetched = 1;
-			scr_attr_cache[i].valid = valid;
-			scr_attr_cache[i].time = dnow();
-			if (valid) {
-				scr_attr_cache[i].x = attr.x;
-				scr_attr_cache[i].y = attr.y;
-				scr_attr_cache[i].width = attr.width;
-				scr_attr_cache[i].height = attr.height;
-				scr_attr_cache[i].border_width = attr.border_width;
-				scr_attr_cache[i].depth = attr.depth;
-				scr_attr_cache[i].class = attr.class;
-				scr_attr_cache[i].backing_store =
-				    attr.backing_store;
-				scr_attr_cache[i].map_state = attr.map_state;
-
-				scr_attr_cache[i].rx = rx;
-				scr_attr_cache[i].ry = ry;
-			}
-		}
-	}
-
-	if (! valid) {
-		if (db > 1) fprintf(stderr, "record_CA not valid-1.\n");
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CA-%d\n", k++);
-
-	if (attr.map_state != IsViewable) {
-		if (db > 1) fprintf(stderr, "record_CA not viewable-1.\n");
-		return;
-	}
-
-	/* recent gdk/gtk windows use different src and dst. for compositing? */
-	if (src != dst) {
-	    if (lookup_attr_cache(dst, &cache_index, &next_index)) {
-		i = cache_index;
-		attr2.x = scr_attr_cache[i].x;
-		attr2.y = scr_attr_cache[i].y;
-		attr2.width = scr_attr_cache[i].width;
-		attr2.height = scr_attr_cache[i].height;
-		attr2.map_state = scr_attr_cache[i].map_state;
-		rx2 = scr_attr_cache[i].rx;
-		ry2 = scr_attr_cache[i].ry;
-		valid = scr_attr_cache[i].valid;
-
-	    } else {
-		valid = valid_window(dst, &attr2, 1);
-
-		if (valid) {
-			if (!xtranslate(dst, rootwin, 0, 0, &rx2, &ry2, &c, 1)) {
-				valid = 0;
-			}
-		}
-		if (next_index >= 0) {
-			i = next_index;
-			scr_attr_cache[i].win = dst;
-			scr_attr_cache[i].fetched = 1;
-			scr_attr_cache[i].valid = valid;
-			scr_attr_cache[i].time = dnow();
-			if (valid) {
-				scr_attr_cache[i].x = attr2.x;
-				scr_attr_cache[i].y = attr2.y;
-				scr_attr_cache[i].width = attr2.width;
-				scr_attr_cache[i].height = attr2.height;
-				scr_attr_cache[i].border_width = attr2.border_width;
-				scr_attr_cache[i].depth = attr2.depth;
-				scr_attr_cache[i].class = attr2.class;
-				scr_attr_cache[i].backing_store =
-				    attr2.backing_store;
-				scr_attr_cache[i].map_state = attr2.map_state;
-
-				scr_attr_cache[i].rx = rx2;
-				scr_attr_cache[i].ry = ry2;
-			}
-		}
-	    }
-
-if (dba || db > 1) fprintf(stderr, "record_CA-? src_x: %d src_y: %d "
-	"dst_x: %d dst_y: %d w: %d h: %d scr_ev_cnt: %d 0x%lx/0x%lx\n",
-	src_x, src_y, dst_x, dst_y, w, h, scr_ev_cnt, src, dst);
-
-		if (! valid) {
-			if (db > 1) fprintf(stderr, "record_CA not valid-2.\n");
-			return;
-		}
-		if (attr2.map_state != IsViewable) {
-			if (db > 1) fprintf(stderr, "record_CA not viewable-2.\n");
-			return;
-		}
-		dst_x = dst_x - (rx - rx2);
-		dst_y = dst_y - (ry - ry2);
-
-		dx = dst_x - src_x;
-		dy = dst_y - src_y;
-
-		if (dx != 0 && dy != 0) {
-			return;
-		}
-	}
-
-
- if (0 || dba || db) {
-	double st, dt;
-	st = (double) rec_data->server_time/1000.0;
-	dt = (dnow() - servertime_diff) - st;
-	fprintf(stderr, "record_CA-%d *FOUND_SCROLL: src: 0x%lx dx: %d dy: %d "
-	"x: %d y: %d w: %d h: %d st: %.4f %.4f  %.4f\n", k++, src, dx, dy,
-	src_x, src_y, w, h, st, dt, dnowx());
- }
-
-	i = scr_ev_cnt;
-
-	scr_ev[i].win = src;
-	scr_ev[i].frame = None;
-	scr_ev[i].dx = dx;
-	scr_ev[i].dy = dy;
-	scr_ev[i].x = rx + dst_x;
-	scr_ev[i].y = ry + dst_y;
-	scr_ev[i].w = w;
-	scr_ev[i].h = h;
-	scr_ev[i].t = ((double) rec_data->server_time)/1000.0;
-	scr_ev[i].win_x = rx;
-	scr_ev[i].win_y = ry;
-	scr_ev[i].win_w = attr.width;
-	scr_ev[i].win_h = attr.height;
-	scr_ev[i].new_x = 0;
-	scr_ev[i].new_y = 0;
-	scr_ev[i].new_w = 0;
-	scr_ev[i].new_h = 0;
-
-	if (dx == 0) {
-		if (dy > 0) {
-			scr_ev[i].new_x = rx + src_x;
-			scr_ev[i].new_y = ry + src_y;
-			scr_ev[i].new_w = w;
-			scr_ev[i].new_h = dy;
-		} else {
-			scr_ev[i].new_x = rx + src_x;
-			scr_ev[i].new_y = ry + dst_y + h;
-			scr_ev[i].new_w = w;
-			scr_ev[i].new_h = -dy;
-		}
-	} else if (dy == 0) {
-		if (dx > 0) {
-			scr_ev[i].new_x = rx + src_x;
-			scr_ev[i].new_y = rx + src_y;
-			scr_ev[i].new_w = dx;
-			scr_ev[i].new_h = h;
-		} else {
-			scr_ev[i].new_x = rx + dst_x + w;
-			scr_ev[i].new_y = ry + src_y;
-			scr_ev[i].new_w = -dx;
-			scr_ev[i].new_h = h;
-		}
-	}
-
-	scr_ev_cnt++;
-}
-
-typedef struct cw_event {
-	Window win;
-	int x, y, w, h;
-} cw_event_t;
-
-#define MAX_CW 128
-static cw_event_t cw_events[MAX_CW];
-
-static void record_CW(XPointer ptr, XRecordInterceptData *rec_data) {
-	xConfigureWindowReq *req;
-	Window win = None, c;
-	Window src = None, dst = None;
-	XWindowAttributes attr;
-	int absent = 0x100000;
-	int src_x, src_y, dst_x, dst_y, rx, ry;
-	int good = 1, dx, dy, k=0, i, j, match, list[3];
-	int f_x, f_y, f_w, f_h;
-	int x, y, w, h;
-	int x0, y0, w0, h0, x1, y1, w1, h1, x2, y2, w2, h2;
-	static int index = 0;
-	unsigned int vals[4];
-	unsigned tmask;
-	char *data;
-	int dba = 0, db = debug_scroll;
-	int cache_index, next_index, valid;
-
-	if (db) {
-		if (rec_data->category == XRecordFromClient) {
-			req = (xConfigureWindowReq *) rec_data->data;
-			if (req->reqType == X_ConfigureWindow) {
-				src = req->window;
-			}
-		}
-	}
-
-if (dba || db > 1) fprintf(stderr, "record_CW-%d id_base: 0x%lx  ptr: 0x%lx "
-	"seq: 0x%lx rc: 0x%lx  cat: %d  swapped: %d 0x%lx/0x%lx\n", k++,
-	rec_data->id_base, (unsigned long) ptr, xrecord_seq, rc_scroll,
-	rec_data->category, rec_data->client_swapped, src, dst);
-
-
-	if (! xrecording) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if ((XID) ptr != xrecord_seq) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if (rec_data->id_base == 0) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if (rec_data->category == XRecordStartOfData) {
-		index = 0;
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if (rec_data->category != XRecordFromClient) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if (rec_data->client_swapped) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	req = (xConfigureWindowReq *) rec_data->data;
-
-	if (req->reqType != X_ConfigureWindow) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	tmask = req->mask;
-
-	tmask &= ~CWX;
-	tmask &= ~CWY;
-	tmask &= ~CWWidth;
-	tmask &= ~CWHeight;
-
-	if (tmask) {
-		/* require no more than these 4 flags */
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	f_x = req->mask & CWX;
-	f_y = req->mask & CWY;
-	f_w = req->mask & CWWidth;
-	f_h = req->mask & CWHeight;
-
-	if (! f_x || ! f_y)  {
-		if (f_w && f_h) {
-			;	/* netscape 4.x style */
-		} else {
-			return;
-		}
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if ( (f_w && !f_h) || (!f_w && f_h) ) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-		
-	for (i=0; i<4; i++) {
-		vals[i] = 0;
-	}
-
-	data = (char *)req;
-	data += sz_xConfigureWindowReq;
-
-	for (i=0; i<req->length; i++) {
-		unsigned int v;
-		/*
-		 * We use unsigned int for the values.  There were
-		 * some crashes on 64bit machines with unsigned longs.
-		 * Need to check that X protocol sends 32bit values.
-		 */
-		v = *( (unsigned int *) data);
-if (db > 1) fprintf(stderr, "  vals[%d]  0x%x/%d\n", i, v, v);
-		vals[i] = v;
-		data += sizeof(unsigned int);
-	}
-
-	if (index >= MAX_CW) {
-		int i, j;
-
-		/* FIXME, circular, etc. */
-		for (i=0; i<2; i++) {
-			j = MAX_CW - 2 + i;
-			cw_events[i].win = cw_events[j].win;
-			cw_events[i].x = cw_events[j].x;
-			cw_events[i].y = cw_events[j].y;
-			cw_events[i].w = cw_events[j].w;
-			cw_events[i].h = cw_events[j].h;
-		}
-		index = 2;
-	}
-
-	if (! f_x && ! f_y) {
-		/* netscape 4.x style  CWWidth,CWHeight */
-		vals[2] = vals[0];
-		vals[3] = vals[1];
-		vals[0] = 0;
-		vals[1] = 0;
-	}
-
-	cw_events[index].win = req->window;
-
-	if (! f_x) {
-		cw_events[index].x = absent;
-	} else {
-		cw_events[index].x = (int) vals[0];
-	}
-	if (! f_y) {
-		cw_events[index].y = absent;
-	} else {
-		cw_events[index].y = (int) vals[1];
-	}
-
-	if (! f_w) {
-		cw_events[index].w = absent;
-	} else {
-		cw_events[index].w = (int) vals[2];
-	}
-	if (! f_h) {
-		cw_events[index].h = absent;
-	} else {
-		cw_events[index].h = (int) vals[3];
-	}
-
-	x = cw_events[index].x;
-	y = cw_events[index].y;
-	w = cw_events[index].w;
-	h = cw_events[index].h;
-	win = cw_events[index].win;
-
-if (dba || db) fprintf(stderr, "  record_CW ind: %d win: 0x%lx x: %d y: %d w: %d h: %d\n",
-	index, win, x, y, w, h);
-
-	index++;
-
-	if (index < 3) {
-		good = 0;
-	} else if (w != absent && h != absent &&
-	    w*h < scrollcopyrect_min_area) {
-		good = 0;
-	}
-
-	if (! good) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	match = 0;
-	for (j=index - 1; j >= 0; j--) {
-		if (cw_events[j].win == win) {
-			list[match++] = j;
-		}
-		if (match >= 3) {
-			break;
-		}
-	}
-
-	if (match != 3) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-/*
-
-Mozilla:
-
-Up arrow: window moves down a bit (dy > 0):
-
- X_ConfigureWindow 
-    length: 7, window: 0x2e000cd, mask: 0xf, v0 0,  v1 -18,  v2 760,  v3 906,  v4 327692,  v5 48234701,  v6 3, 
-        CW-mask: CWX,CWY,CWWidth,CWHeight,
- X_ConfigureWindow 
-    length: 5, window: 0x2e000cd, mask: 0x3, v0 0,  v1 0,  v2 506636,  v3 48234701,  v4 48234511, 
-        CW-mask: CWX,CWY,
- X_ConfigureWindow 
-    length: 7, window: 0x2e000cd, mask: 0xf, v0 0,  v1 0,  v2 760,  v3 888,  v4 65579,  v5 0,  v6 108009, 
-        CW-mask: CWX,CWY,CWWidth,CWHeight,
-
-Down arrow: window moves up a bit (dy < 0):
-
- X_ConfigureWindow 
-    length: 7, window: 0x2e000cd, mask: 0xf, v0 0,  v1 0,  v2 760,  v3 906,  v4 327692,  v5 48234701,  v6 262147, 
-        CW-mask: CWX,CWY,CWWidth,CWHeight,
- X_ConfigureWindow 
-    length: 5, window: 0x2e000cd, mask: 0x3, v0 0,  v1 -18,  v2 506636,  v3 48234701,  v4 48234511, 
-        CW-mask: CWX,CWY,
- X_ConfigureWindow 
-    length: 7, window: 0x2e000cd, mask: 0xf, v0 0,  v1 0,  v2 760,  v3 888,  v4 96555,  v5 48265642,  v6 48265262, 
-        CW-mask: CWX,CWY,CWWidth,CWHeight,
-
-
-Netscape 4.x
-
-Up arrow:
-71.76142   0.01984 X_ConfigureWindow
-    length: 7, window: 0x9800488, mask: 0xf, v0 0,  v1 -15,  v2 785,  v3 882,  v4 327692,  v5 159384712,  v6 1769484,
-        CW-mask: CWX,CWY,CWWidth,CWHeight,
-71.76153   0.00011 X_ConfigureWindow
-    length: 5, window: 0x9800488, mask: 0xc, v0 785,  v1 867,  v2 329228,  v3 159384712,  v4 159383555,
-        CW-mask:       CWWidth,CWHeight,
-                XXX,XXX
-71.76157   0.00003 X_ConfigureWindow
-    length: 5, window: 0x9800488, mask: 0x3, v0 0,  v1 0,  v2 131132,  v3 159385313,  v4 328759,
-        CW-mask: CWX,CWY,
-                         XXX,XXX
-
-Down arrow:
-72.93147   0.01990 X_ConfigureWindow
-    length: 5, window: 0x9800488, mask: 0xc, v0 785,  v1 882,  v2 328972,  v3 159384712,  v4 159383555,
-        CW-mask:       CWWidth,CWHeight,
-                XXX,XXX
-72.93156   0.00009 X_ConfigureWindow
-    length: 5, window: 0x9800488, mask: 0x3, v0 0,  v1 -15,  v2 458764,  v3 159384712,  v4 159383567,
-        CW-mask: CWX,CWY,
-72.93160   0.00004 X_ConfigureWindow
-    length: 7, window: 0x9800488, mask: 0xf, v0 0,  v1 0,  v2 785,  v3 867,  v4 131132,  v5 159385335,  v6 328759,
-        CW-mask: CWX,CWY,CWWidth,CWHeight,
-
-
-sadly, probably need to handle some more...
-
- */
-	x0 = cw_events[list[2]].x;
-	y0 = cw_events[list[2]].y;
-	w0 = cw_events[list[2]].w;
-	h0 = cw_events[list[2]].h;
-
-	x1 = cw_events[list[1]].x;
-	y1 = cw_events[list[1]].y;
-	w1 = cw_events[list[1]].w;
-	h1 = cw_events[list[1]].h;
-
-	x2 = cw_events[list[0]].x;
-	y2 = cw_events[list[0]].y;
-	w2 = cw_events[list[0]].w;
-	h2 = cw_events[list[0]].h;
-
-	/* see NS4 XXX's above: */
-	if (w2 == absent || h2 == absent) {
-		/* up arrow */
-		if (w2 == absent) {
-			w2 = w1;
-		}
-		if (h2 == absent) {
-			h2 = h1;
-		}
-	}
-	if (x1 == absent || y1 == absent) {
-		/* up arrow */
-		if (x1 == absent) {
-			x1 = x2;
-		}
-		if (y1 == absent) {
-			y1 = y2;
-		}
-	}
-	if (x0 == absent || y0 == absent) {
-		/* down arrow */
-		if (x0 == absent) {
-			/* hmmm... what to do */
-			x0 = x2;
-		}
-		if (y0 == absent) {
-			y0 = y2;
-		}
-	}
-
-if (dba) fprintf(stderr, "%d/%d/%d/%d  %d/%d/%d/%d  %d/%d/%d/%d\n", x0, y0, w0, h0, x1, y1, w1, h1, x2, y2, w2, h2);
-
-	dy = y1 - y0;
-	dx = x1 - x0;
-
-	src_x = x2;
-	src_y = y2;
-	w = w2;
-	h = h2;
-
-	/* check w and h before we modify them */
-	if (w <= 0 || h <= 0) {
-		good = 0;
-	} else if (w == absent || h == absent) {
-		good = 0;
-	}
-	if (! good) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if (dy > 0) {
-		h -= dy;	
-	} else {
-		h += dy;	
-		src_y -= dy;
-	}
-	if (dx > 0) {
-		w -= dx;	
-	} else {
-		w += dx;	
-		src_x -= dx;
-	}
-
-	dst_x = src_x + dx;
-	dst_y = src_y + dy;
-
-	if (x0 == absent || x1 == absent || x2 == absent) {
-		good = 0;
-	} else if (y0 == absent || y1 == absent || y2 == absent) {
-		good = 0;
-	} else if (dx != 0 && dy != 0) {
-		good = 0;
-	} else if (w0 - w2 != nabs(dx)) {
-		good = 0;
-	} else if (h0 - h2 != nabs(dy)) {
-		good = 0;
-	} else if (scr_ev_cnt >= SCR_EV_MAX) {
-		good = 0;
-	}
-
-	if (! good) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	/*
-	 * geometry OK.
-	 * after all of the above succeeds, now contact X server.
-	 */
-	if (lookup_attr_cache(win, &cache_index, &next_index)) {
-		i = cache_index;
-		attr.x = scr_attr_cache[i].x;
-		attr.y = scr_attr_cache[i].y;
-		attr.width = scr_attr_cache[i].width;
-		attr.height = scr_attr_cache[i].height;
-		attr.map_state = scr_attr_cache[i].map_state;
-		rx = scr_attr_cache[i].rx;
-		ry = scr_attr_cache[i].ry;
-		valid = scr_attr_cache[i].valid;
-
-if (0) fprintf(stderr, "lookup_attr_cache hit:  %2d %2d 0x%lx %d\n",
-    cache_index, next_index, win, valid);
-
-	} else {
-		valid = valid_window(win, &attr, 1);
-
-if (0) fprintf(stderr, "lookup_attr_cache MISS: %2d %2d 0x%lx %d\n",
-    cache_index, next_index, win, valid);
-
-		if (valid) {
-			if (!xtranslate(win, rootwin, 0, 0, &rx, &ry, &c, 1)) {
-				valid = 0;
-			}
-		}
-		if (next_index >= 0) {
-			i = next_index;
-			scr_attr_cache[i].win = win;
-			scr_attr_cache[i].fetched = 1;
-			scr_attr_cache[i].valid = valid;
-			scr_attr_cache[i].time = dnow();
-			if (valid) {
-				scr_attr_cache[i].x = attr.x;
-				scr_attr_cache[i].y = attr.y;
-				scr_attr_cache[i].width = attr.width;
-				scr_attr_cache[i].height = attr.height;
-				scr_attr_cache[i].depth = attr.depth;
-				scr_attr_cache[i].class = attr.class;
-				scr_attr_cache[i].backing_store =
-				    attr.backing_store;
-				scr_attr_cache[i].map_state = attr.map_state;
-
-				scr_attr_cache[i].rx = rx;
-				scr_attr_cache[i].ry = ry;
-			}
-		}
-	}
-
-	if (! valid) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
-	if (attr.map_state != IsViewable) {
-		return;
-	}
-if (db > 1) fprintf(stderr, "record_CW-%d\n", k++);
-
- if (0 || dba || db) {
-	double st, dt;
-	st = (double) rec_data->server_time/1000.0;
-	dt = (dnow() - servertime_diff) - st;
-	fprintf(stderr, "record_CW-%d *FOUND_SCROLL: win: 0x%lx dx: %d dy: %d "
-	"x: %d y: %d w: %d h: %d  st: %.4f  dt: %.4f  %.4f\n", k++, win,
-	dx, dy, src_x, src_y, w, h, st, dt, dnowx());
- }
-
-	i = scr_ev_cnt;
-
-	scr_ev[i].win = win;
-	scr_ev[i].frame = None;
-	scr_ev[i].dx = dx;
-	scr_ev[i].dy = dy;
-	scr_ev[i].x = rx + dst_x;
-	scr_ev[i].y = ry + dst_y;
-	scr_ev[i].w = w;
-	scr_ev[i].h = h;
-	scr_ev[i].t = ((double) rec_data->server_time)/1000.0;
-	scr_ev[i].win_x = rx;
-	scr_ev[i].win_y = ry;
-	scr_ev[i].win_w = attr.width;
-	scr_ev[i].win_h = attr.height;
-	scr_ev[i].new_x = 0;
-	scr_ev[i].new_y = 0;
-	scr_ev[i].new_w = 0;
-	scr_ev[i].new_h = 0;
-
-	if (dx == 0) {
-		if (dy > 0) {
-			scr_ev[i].new_x = rx + src_x;
-			scr_ev[i].new_y = ry + src_y;
-			scr_ev[i].new_w = w;
-			scr_ev[i].new_h = dy;
-		} else {
-			scr_ev[i].new_x = rx + src_x;
-			scr_ev[i].new_y = ry + dst_y + h;
-			scr_ev[i].new_w = w;
-			scr_ev[i].new_h = -dy;
-		}
-	} else if (dy == 0) {
-		if (dx > 0) {
-			scr_ev[i].new_x = rx + src_x;
-			scr_ev[i].new_y = rx + src_y;
-			scr_ev[i].new_w = dx;
-			scr_ev[i].new_h = h;
-		} else {
-			scr_ev[i].new_x = rx + dst_x + w;
-			scr_ev[i].new_y = ry + src_y;
-			scr_ev[i].new_w = -dx;
-			scr_ev[i].new_h = h;
-		}
-	}
-
-	/* indicate we have a new one */
-	scr_ev_cnt++;
-
-	index = 0;
-}
-
-static void record_switch(XPointer ptr, XRecordInterceptData *rec_data) {
-	static int first = 1;
-	xReq *req;
-
-	if (first) {
-		int i;
-		for (i=0; i<SCR_ATTR_CACHE; i++) {
-			scr_attr_cache[i].win = None;
-			scr_attr_cache[i].fetched = 0;
-			scr_attr_cache[i].valid = 0;
-			scr_attr_cache[i].time = 0.0;
-		}
-		first = 0;
-	}
-
-	/* should handle control msgs, start/stop/etc */
-	if (rec_data->category == XRecordStartOfData) {
-		record_CW(ptr, rec_data);
-	} else if (rec_data->category == XRecordEndOfData) {
-		;
-	} else if (rec_data->category == XRecordClientStarted) {
-		;
-	} else if (rec_data->category == XRecordClientDied) {
-		;
-	} else if (rec_data->category == XRecordFromServer) {
-		;
-	}
-
-	if (rec_data->category != XRecordFromClient) {
-		XRecordFreeData(rec_data);
-		return;
-	}
-
-	req = (xReq *) rec_data->data;
-
-	if (req->reqType == X_CopyArea) {
-		record_CA(ptr, rec_data);
-	} else if (req->reqType == X_ConfigureWindow) {
-		record_CW(ptr, rec_data);
-	} else {
-		;
-	}
-	XRecordFreeData(rec_data);
-}
-
-static void record_grab(XPointer ptr, XRecordInterceptData *rec_data) {
-	xReq *req;
-	int db = 0;
-
-	if (debug_grabs) db = 1;
-
-	/* should handle control msgs, start/stop/etc */
-	if (rec_data->category == XRecordStartOfData) {
-		;
-	} else if (rec_data->category == XRecordEndOfData) {
-		;
-	} else if (rec_data->category == XRecordClientStarted) {
-		;
-	} else if (rec_data->category == XRecordClientDied) {
-		;
-	} else if (rec_data->category == XRecordFromServer) {
-		;
-	}
-
-	if (rec_data->category != XRecordFromClient) {
-		XRecordFreeData(rec_data);
-		return;
-	}
-
-	req = (xReq *) rec_data->data;
-
-	if (req->reqType == X_GrabServer) {
-		double now = dnowx();
-		xserver_grabbed++;
-		if (db) rfbLog("X server Grabbed:    %d %.5f\n", xserver_grabbed, now);
-		if (xserver_grabbed > 1) {
-			/* 
-			 * some apps do multiple grabs... very unlikely
-			 * two apps will be doing it at same time.
-			 */
-			xserver_grabbed = 1;
-		}
-	} else if (req->reqType == X_UngrabServer) {
-		double now = dnowx();
-		xserver_grabbed--;
-		if (xserver_grabbed < 0) {
-			xserver_grabbed = 0;
-		}
-		if (db) rfbLog("X server Un-Grabbed: %d %.5f\n", xserver_grabbed, now);
-	} else {
-		;
-	}
-	XRecordFreeData(rec_data);
-
-	/* unused vars warning: */
-	if (ptr) {}
-}
-#endif
-
-static void check_xrecord_grabserver(void) {
-#if LIBVNCSERVER_HAVE_RECORD
-	int last_val, cnt = 0, i, max = 10;
-	double d;
-	if (!gdpy_ctrl || !gdpy_data) {
-		return;
-	}
-	if (unixpw_in_progress) return;
-
-	dtime0(&d);
-	XFlush_wr(gdpy_ctrl);
-	for (i=0; i<max; i++) {
-		last_val = xserver_grabbed;
-		XRecordProcessReplies(gdpy_data);
-		if (xserver_grabbed != last_val) {
-			cnt++;
-		} else if (i > 2) {
-			break;
-		}
-	}
-	if (cnt) {
-		XFlush_wr(gdpy_ctrl);
-	}
- if (debug_grabs && cnt > 0) {
-	d = dtime(&d);
-fprintf(stderr, "check_xrecord_grabserver: cnt=%d i=%d %.4f\n", cnt, i, d);
- }
-#endif
-}
-
-#if LIBVNCSERVER_HAVE_RECORD
-static void shutdown_record_context(XRecordContext rc, int bequiet, int reopen) {
-	int ret1, ret2;
-	int verb = (!bequiet && !quiet);
-
-	RAWFB_RET_VOID
-	if (0 || debug_scroll) {
-		rfbLog("shutdown_record_context(0x%lx, %d, %d)\n", rc,
-		    bequiet, reopen);
-		verb = 1;
-	}
-
-	ret1 = XRecordDisableContext(rdpy_ctrl, rc);
-	if (!ret1 && verb) {
-		rfbLog("XRecordDisableContext(0x%lx) failed.\n", rc);	
-	}
-	ret2 = XRecordFreeContext(rdpy_ctrl, rc);
-	if (!ret2 && verb) {
-		rfbLog("XRecordFreeContext(0x%lx) failed.\n", rc);	
-	}
-	XFlush_wr(rdpy_ctrl);
-
-	if (reopen == 2 && ret1 && ret2) {
-		reopen = 0;	/* 2 means reopen only on failure  */
-	}
-	if (reopen && gdpy_ctrl) {
-		check_xrecord_grabserver();
-		if (xserver_grabbed) {
-			rfbLog("shutdown_record_context: skip reopen,"
-			    " server grabbed\n");	
-			reopen = 0;
-		}
-	}
-	if (reopen) {
-		char *dpystr = DisplayString(dpy);
-
-		if (debug_scroll) {
-			rfbLog("closing RECORD data connection.\n");
-		}
-		XCloseDisplay_wr(rdpy_data);
-		rdpy_data = NULL;
-
-		if (debug_scroll) {
-			rfbLog("closing RECORD control connection.\n");
-		}
-		XCloseDisplay_wr(rdpy_ctrl);
-		rdpy_ctrl = NULL;
-
-		rdpy_ctrl = XOpenDisplay_wr(dpystr);
-
-		if (! rdpy_ctrl) {
-			rfbLog("Failed to reopen RECORD control connection:"
-			    "%s\n", dpystr);
-			rfbLog("  disabling RECORD scroll detection.\n");
-			use_xrecord = 0;
-			return;
-		}
-		XSync(dpy, False);
-
-		disable_grabserver(rdpy_ctrl, 0);
-		XSync(rdpy_ctrl, True);
-
-		rdpy_data = XOpenDisplay_wr(dpystr);
-
-		if (! rdpy_data) {
-			rfbLog("Failed to reopen RECORD data connection:"
-			    "%s\n", dpystr);
-			rfbLog("  disabling RECORD scroll detection.\n");
-			XCloseDisplay_wr(rdpy_ctrl);
-			rdpy_ctrl = NULL;
-			use_xrecord = 0;
-			return;
-		}
-		disable_grabserver(rdpy_data, 0);
-
-		if (debug_scroll || (! bequiet && reopen == 2)) {
-			rfbLog("reopened RECORD data and control display"
-			    " connections: %s\n", dpystr);
-		}
-	}
-}
-#endif
-
-void check_xrecord_reset(int force) {
-	static double last_reset = 0.0;
-	int reset_time  = 60, require_idle  = 10;
-	int reset_time2 = 600, require_idle2 = 40;
-	double now = 0.0;
-	XErrorHandler old_handler = NULL;
-
-	if (gdpy_ctrl) {
-		X_LOCK;
-		check_xrecord_grabserver();
-		X_UNLOCK;
-	} else {
-		/* more dicey if not watching grabserver */
-		reset_time = reset_time2;
-		require_idle = require_idle2;
-	}
-
-	if (!use_xrecord) {
-		return;
-	}
-	if (xrecording) {
-		return;
-	}
-	if (button_mask) {
-		return;
-	}
-	if (xserver_grabbed) {
-		return;
-	}
-
-	if (unixpw_in_progress) return;
-
-#if LIBVNCSERVER_HAVE_RECORD
-	if (! rc_scroll) {
-		return;
-	}
-	now = dnow();
-	if (last_reset == 0.0) {
-		last_reset = now;
-		return;
-	}
-	/*
-	 * try to wait for a break in input to reopen the displays
-	 * this is only to avoid XGrabServer deadlock on the repopens.
-	 */
-	if (force) {
-		;
-	} else if (now < last_reset + reset_time) {
-		return;
-	} else if (now < last_pointer_click_time + require_idle)  {
-		return;
-	} else if (now < last_keyboard_time + require_idle)  {
-		return;
-	}
-	X_LOCK;
-	trapped_record_xerror = 0;
-	old_handler = XSetErrorHandler(trap_record_xerror);
-
-	/* unlikely, but check again since we will definitely be doing it. */
-	if (gdpy_ctrl) {
-		check_xrecord_grabserver();
-		if (xserver_grabbed) {
-			XSetErrorHandler(old_handler);
-			X_UNLOCK;
-			return;
-		}
-	}
-	
-	shutdown_record_context(rc_scroll, 0, 1);
-	rc_scroll = 0;
-
-	XSetErrorHandler(old_handler);
-	X_UNLOCK;
-
-	last_reset = now;
-#else
-	if (!old_handler || now == 0.0 || !last_reset || !force) {}
-#endif
-}
-
-#define RECORD_ERROR_MSG(tag) \
-	if (! quiet) { \
-		static int cnt = 0; \
-		static time_t last = 0; \
-		int show = 0; \
-		cnt++; \
-		if (debug_scroll || cnt < 20) { \
-			show = 1; \
-		} else if (cnt == 20) { \
-			last = time(NULL); \
-			rfbLog("disabling RECORD XError messages for 600s\n"); \
-			show = 1; \
-		} else if (time(NULL) > last + 600) { \
-			cnt = 0; \
-			show = 1; \
-		} \
-		if (show) { \
-			rfbLog("trapped RECORD XError: %s %s %d/%d/%d (0x%lx)\n", \
-			    tag, xerror_string(trapped_record_xerror_event), \
-			    (int) trapped_record_xerror_event->error_code, \
-			    (int) trapped_record_xerror_event->request_code, \
-			    (int) trapped_record_xerror_event->minor_code, \
-			    (int) trapped_record_xerror_event->resourceid); \
-		} \
-	}
-
-void xrecord_watch(int start, int setby) {
-#if LIBVNCSERVER_HAVE_RECORD
-	Window focus, wm, c, clast;
-	static double create_time = 0.0;
-	int rc;
-	int do_shutdown = 0;
-	int reopen_dpys = 1;
-	XErrorHandler old_handler = NULL;
-	static Window last_win = None, last_result = None;
-#endif
-	int db = debug_scroll;
-	double now;
-	static double last_error = 0.0;
-
-if (0) db = 1;
-
-	if (nofb) {
-		xrecording = 0;
-		return;
-	}
-	if (use_threads) {
-		/* XXX not working.  Still?  Painting errors. */
-		static int first = 1;
-		if (first) {
-			if (use_xrecord && !getenv("XRECORD_THREADS")) {
-				rfbLog("xrecord_watch: disabling scroll detection in -threads mode.\n");
-				rfbLog("xrecord_watch: Set -env XRECORD_THREADS=1 to enable it.\n");
-				use_xrecord = 0;
-				xrecording = 0;
-			}
-			first = 0;
-		}
-		if (!use_xrecord && !xrecording) {
-			return;
-		}
-	}
-
-	dtime0(&now);
-	if (now < last_error + 0.5) {
-		return;
-	}
-
-	if (gdpy_ctrl) {
-		X_LOCK;
-		check_xrecord_grabserver();
-		X_UNLOCK;
-		if (xserver_grabbed) {
-if (db || debug_grabs) fprintf(stderr, "xrecord_watch: %d/%d  out xserver_grabbed\n", start, setby);
-			return;
-		}
-	}
-
-#if LIBVNCSERVER_HAVE_RECORD
-	if (! start) {
-		int shut_reopen = 2, shut_time = 25;
-if (db || debug_grabs) fprintf(stderr, "XRECORD OFF: %d/%d  %.4f\n", xrecording, setby, now - x11vnc_start);
-		xrecording = 0;
-		if (! rc_scroll) {
-			xrecord_focus_window = None;
-			xrecord_wm_window = None;
-			xrecord_ptr_window = None;
-			xrecord_keysym = NoSymbol;
-			rcs_scroll = 0;
-			return;
-		}
-
-		if (! do_shutdown && now > create_time + shut_time) {
-			/* XXX unstable if we keep a RECORD going forever */
-			do_shutdown = 1;
-		}
-
-		SCR_LOCK;
-		
-		if (do_shutdown) {
-if (db > 1) fprintf(stderr, "=== shutdown-scroll 0x%lx\n", rc_scroll);
-			X_LOCK;
-			trapped_record_xerror = 0;
-			old_handler = XSetErrorHandler(trap_record_xerror);
-
-			shutdown_record_context(rc_scroll, 0, shut_reopen);
-			rc_scroll = 0;
-
-			/*
-			 * n.b. there is a grabserver issue wrt
-			 * XRecordCreateContext() even though rdpy_ctrl
-			 * is set imprevious to grabs.  Perhaps a bug
-			 * in the X server or library...
-			 *
-			 * If there are further problems, a thought
-			 * to recreate rc_scroll right after the
-			 * reopen.
-			 */
-
-			if (! use_xrecord) {
-				XSetErrorHandler(old_handler);
-				X_UNLOCK;
-				SCR_UNLOCK;
-				return;
-			}
-
-			XRecordProcessReplies(rdpy_data);
-
-			if (trapped_record_xerror) {
-				RECORD_ERROR_MSG("shutdown");
-				last_error = now;
-			}
-
-			XSetErrorHandler(old_handler);
-			X_UNLOCK;
-			SCR_UNLOCK;
-
-		} else {
-			if (rcs_scroll) {
-if (db > 1) fprintf(stderr, "=== disab-scroll 0x%lx 0x%lx\n", rc_scroll, rcs_scroll);
-				X_LOCK;
-				trapped_record_xerror = 0;
-				old_handler =
-				    XSetErrorHandler(trap_record_xerror);
-
-				rcs_scroll = XRecordCurrentClients;
-				XRecordUnregisterClients(rdpy_ctrl, rc_scroll,
-				    &rcs_scroll, 1);
-				XRecordDisableContext(rdpy_ctrl, rc_scroll);
-				XFlush_wr(rdpy_ctrl);
-				XRecordProcessReplies(rdpy_data);
-
-				if (trapped_record_xerror) {
-					RECORD_ERROR_MSG("disable");
-
-					shutdown_record_context(rc_scroll,
-					    0, reopen_dpys);
-					rc_scroll = 0;
-
-					last_error = now;
-
-					if (! use_xrecord) {
-						XSetErrorHandler(old_handler);
-						X_UNLOCK;
-						SCR_UNLOCK;
-						return;
-					}
-				}
-				XSetErrorHandler(old_handler);
-				X_UNLOCK;
-			}
-		}
-
-		SCR_UNLOCK;
-		/*
-		 * XXX if we do a XFlush_wr(rdpy_ctrl) here we get:
-		 *
-
-		X Error of failed request:  XRecordBadContext
-		  Major opcode of failed request:  145 (RECORD)
-		  Minor opcode of failed request:  5 (XRecordEnableContext)
-		  Context in failed request:  0x2200013
-		  Serial number of failed request:  29
-		  Current serial number in output stream:  29
-
-		 *
-		 * need to figure out what is going on... since it may lead
-		 * infrequent failures.
-		 */
-		xrecord_focus_window = None;
-		xrecord_wm_window = None;
-		xrecord_ptr_window = None;
-		xrecord_keysym = NoSymbol;
-		rcs_scroll = 0;
-		return;
-	}
-if (db || debug_grabs) fprintf(stderr, "XRECORD ON:  %d/%d  %.4f\n", xrecording, setby, now - x11vnc_start);
-
-	if (xrecording) {
-		return;
-	}
-
-	if (do_shutdown && rc_scroll) {
-		static int didmsg = 0;
-		/* should not happen... */
-		if (0 || !didmsg) {
-			rfbLog("warning: do_shutdown && rc_scroll\n");
-			didmsg = 1;
-		}
-		xrecord_watch(0, SCR_NONE);
-	}
-
-	xrecording = 0;
-	xrecord_focus_window = None;
-	xrecord_wm_window = None;
-	xrecord_ptr_window = None;
-	xrecord_keysym = NoSymbol;
-	xrecord_set_by_keys  = 0;
-	xrecord_set_by_mouse = 0;
-
-	/* get the window with focus and mouse pointer: */
-	clast = None;
-	focus = None;
-	wm = None;
-
-	X_LOCK;
-	SCR_LOCK;
-#if 0
-	/*
-	 * xrecord_focus_window / focus not currently used... save a
-	 * round trip to the X server for now.
-	 * N.B. our heuristic is inaccurate: if he is scrolling and
-	 * drifts off of the scrollbar onto another application we
-	 * will catch that application, not the starting ones.
-	 * check_xrecord_{keys,mouse} mitigates this somewhat by
-	 * delaying calls to xrecord_watch as much as possible.
-	 */
-	XGetInputFocus(dpy, &focus, &i);
-#endif
-
-	wm = query_pointer(rootwin);
-	if (wm) {
-		c = wm;
-	} else {
-		c = rootwin;
-	}
-
-	/* descend a bit to avoid wm frames: */
-	if (c != rootwin && c == last_win) {
-		/* use cached results to avoid roundtrips: */
-		clast = last_result;
-	} else if (scroll_good_all == NULL && scroll_skip_all == NULL) {
-		/* more efficient if name info not needed. */
-		xrecord_name_info[0] = '\0';
-		clast = descend_pointer(6, c, NULL, 0);
-	} else {
-		char *nm;
-		int matched_good = 0, matched_skip = 0;
-
-		clast = descend_pointer(6, c, xrecord_name_info, NAMEINFO);
-if (db) fprintf(stderr, "name_info: %s\n", xrecord_name_info);
-
-		nm = xrecord_name_info;
-
-		if (scroll_good_all) {
-			matched_good += match_str_list(nm, scroll_good_all);
-		}
-		if (setby == SCR_KEY && scroll_good_key) {
-			matched_good += match_str_list(nm, scroll_good_key);
-		}
-		if (setby == SCR_MOUSE && scroll_good_mouse) {
-			matched_good += match_str_list(nm, scroll_good_mouse);
-		}
-		if (scroll_skip_all) {
-			matched_skip += match_str_list(nm, scroll_skip_all);
-		}
-		if (setby == SCR_KEY && scroll_skip_key) {
-			matched_skip += match_str_list(nm, scroll_skip_key);
-		}
-		if (setby == SCR_MOUSE && scroll_skip_mouse) {
-			matched_skip += match_str_list(nm, scroll_skip_mouse);
-		}
-
-		if (!matched_good && matched_skip) {
-			clast = None;
-		}
-	}
-	if (c != rootwin) {
-		/* cache results for possible use next call */
-		last_win = c;
-		last_result = clast;
-	}
-
-	if (!clast || clast == rootwin) {
-if (db) fprintf(stderr, "--- xrecord_watch: SKIP.\n");
-		X_UNLOCK;
-		SCR_UNLOCK;
-		return;
-	}
-
-	/* set protocol request ranges: */
-	rr_scroll[0] = rr_CA;
-	rr_scroll[1] = rr_CW;
-
-	/*
-	 * start trapping... there still are some occasional failures
-	 * not yet understood, likely some race condition WRT the 
-	 * context being setup.
-	 */
-	trapped_record_xerror = 0;
-	old_handler = XSetErrorHandler(trap_record_xerror);
-
-	if (! rc_scroll) {
-		/* do_shutdown case or first time in */
-
-		if (gdpy_ctrl) {
-			/*
-			 * Even though rdpy_ctrl is impervious to grabs
-			 * at this point, we still get deadlock, why?
-			 * It blocks in the library find_display() call.
-			 */
-			check_xrecord_grabserver();
-			if (xserver_grabbed) {
-				XSetErrorHandler(old_handler);
-				X_UNLOCK;
-				SCR_UNLOCK;
-				return;
-			}
-		}
-		rcs_scroll = (XRecordClientSpec) clast;
-		rc_scroll = XRecordCreateContext(rdpy_ctrl, 0, &rcs_scroll, 1,
-		    rr_scroll, 2);
-
-		if (! do_shutdown) {
-			XSync(rdpy_ctrl, False);
-		}
-if (db) fprintf(stderr, "NEW rc:    0x%lx\n", rc_scroll);
-		if (rc_scroll) {
-			dtime0(&create_time);
-		} else {
-			rcs_scroll = 0;
-		}
-
-	} else if (! do_shutdown) {
-		if (rcs_scroll) {
-			/*
-			 * should have been unregistered in xrecord_watch(0)...
-			 */
-			rcs_scroll = XRecordCurrentClients;
-			XRecordUnregisterClients(rdpy_ctrl, rc_scroll,
-			    &rcs_scroll, 1);
-
-if (db > 1) fprintf(stderr, "=2= unreg-scroll 0x%lx 0x%lx\n", rc_scroll, rcs_scroll);
-
-		}
-		
-		rcs_scroll = (XRecordClientSpec) clast;
-
-if (db > 1) fprintf(stderr, "=-=   reg-scroll 0x%lx 0x%lx\n", rc_scroll, rcs_scroll);
-
-		if (!XRecordRegisterClients(rdpy_ctrl, rc_scroll, 0,
-		    &rcs_scroll, 1, rr_scroll, 2)) {
-			if (1 || now > last_error + 60) {
-				rfbLog("failed to register client 0x%lx with"
-				    " X RECORD context rc_scroll.\n", clast);
-			}
-			last_error = now;
-			rcs_scroll = 0;
-			/* continue on for now... */
-		}
-	}
-
-	XFlush_wr(rdpy_ctrl);
-
-if (db) fprintf(stderr, "rc_scroll: 0x%lx\n", rc_scroll);
-	if (trapped_record_xerror) {
-		RECORD_ERROR_MSG("register");
-	}
-
-	if (! rc_scroll) {
-		XSetErrorHandler(old_handler);
-		X_UNLOCK;
-		SCR_UNLOCK;
-		use_xrecord = 0;
-		rfbLog("failed to create X RECORD context rc_scroll.\n");
-		rfbLog("  switching to -noscrollcopyrect mode.\n");
-		return;
-	} else if (! rcs_scroll || trapped_record_xerror) {
-		/* try again later */
-		shutdown_record_context(rc_scroll, 0, reopen_dpys);
-		rc_scroll = 0;
-		last_error = now;
-
-		XSetErrorHandler(old_handler);
-		X_UNLOCK;
-		SCR_UNLOCK;
-		return;
-	}
-
-	xrecord_focus_window = focus;
-#if 0
-	/* xrecord_focus_window currently unused. */
-	if (! xrecord_focus_window) {
-		xrecord_focus_window = clast;
-	}
-#endif
-	xrecord_wm_window = wm;
-	if (! xrecord_wm_window) {
-		xrecord_wm_window = clast;
-	}
-
-	xrecord_ptr_window = clast;
-
-	xrecording = 1;
-	xrecord_seq++;
-	dtime0(&xrecord_start);
-
-	rc = XRecordEnableContextAsync(rdpy_data, rc_scroll, record_switch,
-	    (XPointer) xrecord_seq);
-
-	if (!rc || trapped_record_xerror) {
-		if (1 || now > last_error + 60) {
-			rfbLog("failed to enable RECORD context "
-			    "rc_scroll: 0x%lx rc: %d\n", rc_scroll, rc);
-			if (trapped_record_xerror) {
-				RECORD_ERROR_MSG("enable-failed");
-			}
-		}
-		shutdown_record_context(rc_scroll, 0, reopen_dpys);
-		rc_scroll = 0;
-		last_error = now;
-		xrecording = 0;
-		/* continue on for now... */
-	}
-	XSetErrorHandler(old_handler);
-
-	/* XXX this may cause more problems than it solves... */
-	if (use_xrecord) {
-		XFlush_wr(rdpy_data);
-	}
-
-	X_UNLOCK;
-	SCR_UNLOCK;
-#endif
-}
-
-
diff --git a/ica/x11/x11vnc/xrecord.h b/ica/x11/x11vnc/xrecord.h
deleted file mode 100644
index 2c1e2d7..0000000
--- a/ica/x11/x11vnc/xrecord.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XRECORD_H
-#define _X11VNC_XRECORD_H
-
-/* -- xrecord.h -- */
-#include "scrollevent_t.h"
-#include "winattr_t.h"
-
-extern scroll_event_t scr_ev[];
-extern int scr_ev_cnt;
-extern int xrecording;
-extern int xrecord_set_by_keys;
-extern int xrecord_set_by_mouse;
-extern Window xrecord_focus_window;
-extern Window xrecord_wm_window;
-extern Window xrecord_ptr_window;
-extern KeySym xrecord_keysym;
-extern char xrecord_name_info[];
-
-extern winattr_t scr_attr_cache[];
-
-extern Display *rdpy_data;
-extern Display *rdpy_ctrl;
-
-extern Display *gdpy_ctrl;
-extern int xserver_grabbed;
-
-extern void initialize_xrecord(void);
-extern void zerodisp_xrecord(void);
-extern void shutdown_xrecord(void);
-extern int xrecord_skip_keysym(rfbKeySym keysym);
-extern int xrecord_skip_button(int newb, int old);
-extern int xrecord_scroll_keysym(rfbKeySym keysym);
-extern void check_xrecord_reset(int force);
-extern void xrecord_watch(int start, int setby);
-
-#endif /* _X11VNC_XRECORD_H */
diff --git a/ica/x11/x11vnc/xwrappers.c b/ica/x11/x11vnc/xwrappers.c
deleted file mode 100644
index e7158cf..0000000
--- a/ica/x11/x11vnc/xwrappers.c
+++ /dev/null
@@ -1,1522 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-/* -- xwrappers.c -- */
-
-#include "x11vnc.h"
-#include "xrecord.h"
-#include "keyboard.h"
-#include "xevents.h"
-#include "connections.h"
-#include "cleanup.h"
-#include "macosx.h"
-
-int xshm_present = 0;
-int xshm_opcode = 0;
-int xtest_present = 0;
-int xtrap_present = 0;
-int xrecord_present = 0;
-int xkb_present = 0;
-int xinerama_present = 0;
-
-int keycode_state[256];
-int rootshift = 0;
-int clipshift = 0;
-
-
-int guess_bits_per_color(int bits_per_pixel);
-
-int XFlush_wr(Display *disp);
-
-Status XShmGetImage_wr(Display *disp, Drawable d, XImage *image, int x, int y,
-    unsigned long mask);
-XImage *XShmCreateImage_wr(Display* disp, Visual* vis, unsigned int depth,
-    int format, char* data, XShmSegmentInfo* shminfo, unsigned int width,
-    unsigned int height);
-Status XShmAttach_wr(Display *disp, XShmSegmentInfo *shminfo);
-Status XShmDetach_wr(Display *disp, XShmSegmentInfo *shminfo);
-Bool XShmQueryExtension_wr(Display *disp);
-int XShmGetEventBase_wr(Display *disp);
-
-XImage *xreadscreen(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, Bool show_cursor);
-XImage *XGetSubImage_wr(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, unsigned long plane_mask,
-    int format, XImage *dest_image, int dest_x, int dest_y);
-XImage *XGetImage_wr(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, unsigned long plane_mask,
-    int format);
-XImage *XCreateImage_wr(Display *disp, Visual *visual, unsigned int depth,
-    int format, int offset, char *data, unsigned int width,
-    unsigned int height, int bitmap_pad, int bytes_per_line);
-void copy_image(XImage *dest, int x, int y, unsigned int w, unsigned int h);
-void init_track_keycode_state(void);
-
-void XTRAP_FakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
-    unsigned long delay);
-void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
-    unsigned long delay);
-void XTRAP_FakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
-    unsigned long delay);
-void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
-    unsigned long delay);
-void XTRAP_FakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
-    unsigned long delay);
-void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
-    unsigned long delay);
-
-Bool XTestCompareCurrentCursorWithWindow_wr(Display* dpy, Window w);
-Bool XTestCompareCursorWithWindow_wr(Display* dpy, Window w, Cursor cursor);
-Bool XTestQueryExtension_wr(Display *dpy, int *ev, int *er, int *maj,
-    int *min);
-void XTestDiscard_wr(Display *dpy);
-Bool XETrapQueryExtension_wr(Display *dpy, int *ev, int *er, int *op);
-int XTestGrabControl_wr(Display *dpy, Bool impervious);
-int XTRAP_GrabControl_wr(Display *dpy, Bool impervious);
-void disable_grabserver(Display *in_dpy, int change);
-
-Bool XRecordQueryVersion_wr(Display *dpy, int *maj, int *min);
-
-int xauth_raw(int on);
-Display *XOpenDisplay_wr(char *display_name);
-int XCloseDisplay_wr(Display *display);
-
-Bool XQueryPointer_wr(Display *display, Window w, Window *root_return,
-    Window *child_return, int *root_x_return, int *root_y_return,
-    int *win_x_return, int *win_y_return, unsigned int *mask_return);
-
-Status XQueryTree_wr(Display *display, Window w, Window *root_return,
-    Window *parent_return, Window **children_return,
-    unsigned int *nchildren_return);
-
-int XFree_wr(void *data);
-int XSelectInput_wr(Display *display, Window w, long event_mask);
-
-void copy_raw_fb(XImage *dest, int x, int y, unsigned int w, unsigned int h);
-static void upup_downdown_warning(KeyCode key, Bool down);
-
-/* 
- * used in rfbGetScreen and rfbNewFramebuffer: and estimate to the number
- * of bits per color, of course for some visuals, e.g. 565, the number
- * is not the same for each color.  This is just a sane default.
- */
-int guess_bits_per_color(int bits_per_pixel) {
-	int bits_per_color;
-	
-	/* first guess, spread them "evenly" over R, G, and B */
-	bits_per_color = bits_per_pixel/3;
-	if (bits_per_color < 1) {
-		bits_per_color = 1;	/* 1bpp, 2bpp... */
-	}
-
-	/* choose safe values for usual cases: */
-	if (bits_per_pixel == 8) {
-		bits_per_color = 2;
-	} else if (bits_per_pixel == 15 || bits_per_pixel == 16) {
-		bits_per_color = 5;
-	} else if (bits_per_pixel == 24 || bits_per_pixel == 32) {
-		bits_per_color = 8;
-	}
-	return bits_per_color;
-}
-
-int XFlush_wr(Display *disp) {
-#if NO_X11
-	if (!disp) {}
-	return 1;
-#else
-	if (disp) {
-		return XFlush(disp);
-	} else {
-		return 1;
-	}
-#endif	/* NO_X11 */
-}
-
-/*
- * Kludge to interpose image gets and limit to a subset rectangle of
- * the rootwin.  This is the -sid option trying to work around invisible
- * saveUnders menu, etc, windows.  Also -clip option.
- */
-
-#define ADJUST_ROOTSHIFT \
-	if (rootshift && subwin) { \
-		d = rootwin; \
-		x += off_x; \
-		y += off_y; \
-	} \
-	if (clipshift) { \
-		x += coff_x; \
-		y += coff_y; \
-	}
-
-/*
- * Wrappers for Image related X calls
- */
-Status XShmGetImage_wr(Display *disp, Drawable d, XImage *image, int x, int y,
-    unsigned long mask) {
-
-	ADJUST_ROOTSHIFT
-
-	/* Note: the Solaris overlay stuff is all non-shm (using_shm = 0) */
-
-#if LIBVNCSERVER_HAVE_XSHM
-	return XShmGetImage(disp, d, image, x, y, mask); 
-#else
-	if (!disp || !d || !image || !x || !y || !mask) {}
-	return (Status) 0;
-#endif
-}
-
-XImage *XShmCreateImage_wr(Display* disp, Visual* vis, unsigned int depth,
-    int format, char* data, XShmSegmentInfo* shminfo, unsigned int width,
-    unsigned int height) {
-
-#if LIBVNCSERVER_HAVE_XSHM
-	return XShmCreateImage(disp, vis, depth, format, data, shminfo,
-	    width, height); 
-#else
-	if (!disp || !vis || !depth || !format || !data || !shminfo || !width || !height) {}
-	return (XImage *) 0;
-#endif
-}
-
-Status XShmAttach_wr(Display *disp, XShmSegmentInfo *shminfo) {
-#if LIBVNCSERVER_HAVE_XSHM
-	return XShmAttach(disp, shminfo);
-#else
-	if (!disp || !shminfo) {}
-	return (Status) 0;
-#endif
-}
-
-Status XShmDetach_wr(Display *disp, XShmSegmentInfo *shminfo) {
-#if LIBVNCSERVER_HAVE_XSHM
-	if (getenv("X11VNC_SHM_DEBUG")) fprintf(stderr, "XShmDetach_wr: %p disp: %p\n", (void *)shminfo, (void *)disp);
-	return XShmDetach(disp, shminfo);
-#else
-	if (!disp || !shminfo) {}
-	return (Status) 0;
-#endif
-}
-
-Bool XShmQueryExtension_wr(Display *disp) {
-#if LIBVNCSERVER_HAVE_XSHM
-	return XShmQueryExtension(disp);
-#else
-	if (!disp) {}
-	return False;
-#endif
-}
-
-int XShmGetEventBase_wr(Display *disp) {
-#if LIBVNCSERVER_HAVE_XSHM
-	return XShmGetEventBase(disp);
-#else
-	if (!disp) {}
-	return 0;
-#endif
-}
-
-/* wrapper for overlay screen reading: */
-
-XImage *xreadscreen(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, Bool show_cursor) {
-#if NO_X11
-	if (!disp || !d || !x || !y || !width || !height || !show_cursor) {}
-	return NULL;
-#else
-
-#ifdef SOLARIS_OVERLAY
-	return XReadScreen(disp, d, x, y, width, height,
-	    show_cursor);
-#else
-#  ifdef IRIX_OVERLAY
-	{	unsigned long hints = 0, hints_ret;
-		if (show_cursor) hints |= XRD_READ_POINTER;
-		return XReadDisplay(disp, d, x, y, width, height,
-		    hints, &hints_ret);
-	}
-#  else
-	/* unused vars warning: */
-	if (disp || d || x || y || width || height || show_cursor) {}
-
-	return NULL;
-#  endif
-#endif
-
-#endif	/* NO_X11 */
-}
-
-XImage *XGetSubImage_wr(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, unsigned long plane_mask,
-    int format, XImage *dest_image, int dest_x, int dest_y) {
-#if NO_X11
-	nox11_exit(1);
-	if (!disp || !d || !x || !y || !width || !height || !plane_mask || !format || !dest_image || !dest_x || !dest_y) {}
-	return NULL;
-#else
-	ADJUST_ROOTSHIFT
-
-	if (overlay && dest_x == 0 && dest_y == 0) {
-		size_t size = dest_image->height * dest_image->bytes_per_line;
-		XImage *xi;
-
-		xi = xreadscreen(disp, d, x, y, width, height,
-		    (Bool) overlay_cursor);
-
-		if (! xi) return NULL;
-
-		/*
-		 * There is extra overhead from memcpy and free...
-		 * this is not like the real XGetSubImage().  We hope
-		 * this significant overhead is still small compared to
-		 * the time to retrieve the fb data.
-		 */
-		memcpy(dest_image->data, xi->data, size);
-
-		XDestroyImage(xi);
-		return (dest_image);
-	}
-	return XGetSubImage(disp, d, x, y, width, height, plane_mask,
-	    format, dest_image, dest_x, dest_y);
-#endif	/* NO_X11 */
-}
-
-XImage *XGetImage_wr(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, unsigned long plane_mask,
-    int format) {
-#if NO_X11
-	if (!disp || !d || !x || !y || !width || !height || !plane_mask || !format) {}
-	nox11_exit(1);
-	return NULL;
-#else
-
-	ADJUST_ROOTSHIFT
-
-	if (overlay) {
-		return xreadscreen(disp, d, x, y, width, height,
-		    (Bool) overlay_cursor);
-	}
-	return XGetImage(disp, d, x, y, width, height, plane_mask, format);
-#endif	/* NO_X11 */
-}
-
-XImage *XCreateImage_wr(Display *disp, Visual *visual, unsigned int depth,
-    int format, int offset, char *data, unsigned int width,
-    unsigned int height, int bitmap_pad, int bytes_per_line) {
-	/*
-	 * This is a kludge to get a created XImage to exactly match what
-	 * XReadScreen returns: we noticed the rgb masks are different
-	 * from XCreateImage with the high color visual (red mask <->
-	 * blue mask).  Note we read from the root window(!) then free
-	 * the data.
-	 */
-
-	if (raw_fb) {	/* raw_fb hack */
-		XImage *xi;
-		xi = (XImage *) malloc(sizeof(XImage));
-		memset(xi, 0, sizeof(XImage));
-		xi->depth = depth;
-		if (depth >= 24) {
-			xi->bits_per_pixel = 32;
-		} else if (depth > 16) {
-			xi->bits_per_pixel = 24;
-		} else if (depth > 8) {
-			xi->bits_per_pixel = 16;
-		} else {
-			xi->bits_per_pixel = 8;
-		}
-		xi->format = format;
-		xi->xoffset = offset;
-		xi->data = data;
-		xi->width = width;
-		xi->height = height;
-		xi->bitmap_pad = bitmap_pad;
-		xi->bytes_per_line = bytes_per_line ? bytes_per_line : 
-		    xi->width * xi->bits_per_pixel / 8;
-		xi->bitmap_unit = -1;	/* hint to not call XDestroyImage */
-		return xi;
-	}
-
-#if NO_X11
-	nox11_exit(1);
-	if (!disp || !visual || !depth || !format || !offset || !data || !width
-	    || !height || !width || !bitmap_pad || !bytes_per_line) {}
-	return NULL;
-#else
-	if (overlay) {
-		XImage *xi;
-		xi = xreadscreen(disp, window, 0, 0, width, height, False);
-		if (xi == NULL) {
-			return xi;
-		}
-		if (xi->data != NULL) {
-			free(xi->data);
-		}
-		xi->data = data;
-		return xi;
-	}
-
-	return XCreateImage(disp, visual, depth, format, offset, data,
-	    width, height, bitmap_pad, bytes_per_line);
-#endif	/* NO_X11 */
-}
-
-static void copy_raw_fb_low_bpp(XImage *dest, int x, int y, unsigned int w,
-    unsigned int h) {
-	char *src, *dst;
-	unsigned int line;
-	static char *buf = NULL;
-	static int buflen = -1;
-	int bpl = wdpy_x * raw_fb_native_bpp / 8;
-	int n, ix, len, del, sz = wdpy_x * raw_fb_expand_bytes;
-
-	unsigned int rm_n = raw_fb_native_red_mask;
-	unsigned int gm_n = raw_fb_native_green_mask;
-	unsigned int bm_n = raw_fb_native_blue_mask;
-	unsigned int rm_f = main_red_mask;
-	unsigned int gm_f = main_green_mask;
-	unsigned int bm_f = main_blue_mask;
-
-	unsigned int rs_n = raw_fb_native_red_shift;
-	unsigned int gs_n = raw_fb_native_green_shift;
-	unsigned int bs_n = raw_fb_native_blue_shift;
-	unsigned int rs_f = main_red_shift;
-	unsigned int gs_f = main_green_shift;
-	unsigned int bs_f = main_blue_shift;
-
-	unsigned int rx_n = raw_fb_native_red_max;
-	unsigned int gx_n = raw_fb_native_green_max;
-	unsigned int bx_n = raw_fb_native_blue_max;
-	unsigned int rx_f = main_red_max;
-	unsigned int gx_f = main_green_max;
-	unsigned int bx_f = main_blue_max;
-
-	static unsigned int msk[8];
-	static int last_bpp = -1;
-	static int cga = -1;
-
-	if (rm_f | gm_f | bm_f) {}
-
-	if (cga < 0) {
-		if (getenv("RAWFB_CGA")) {
-			cga = 1;
-		} else {
-			cga = 0;
-		}
-	}
-
-	if (sz > buflen || buf == NULL) {
-		if (buf) {
-			free(buf);
-		}
-		buflen = sz + 1000;
-		buf = (char *) malloc(buflen);
-	}
-
-	if (clipshift && ! use_snapfb) {
-		x += coff_x;
-		y += coff_y;
-	}
-
-	if (last_bpp != raw_fb_native_bpp) {
-		int br;
-		for (br = 0; br < 8; br++) {
-			unsigned int pbit, k, m = 0;
-			
-			for (k=0; k < (unsigned int) raw_fb_native_bpp; k++) {
-				pbit = 1 << (br+k);
-				m |= pbit;
-			}
-			msk[br] = m;
-		}
-		last_bpp = raw_fb_native_bpp;
-	}
-
-	dst = dest->data;
-if (0) fprintf(stderr, "x=%d y=%d w=%d h=%d bpl=%d d_bpl=%d-%dx%dx%d/%d %p\n",
-    x, y, w, h, bpl, dest->bytes_per_line, dest->width, dest->height, dest->bits_per_pixel, dest->depth, dst);
-
-	for (line = 0; line < h; line++) {
-
-		if (! raw_fb_seek) {
-			/* mmap */
-			src = raw_fb_addr + raw_fb_offset + bpl*(y+line);
-
-			memcpy(buf, src, bpl);
-		} else {
-			/* lseek */
-			off_t off;
-			off = (off_t) (raw_fb_offset + bpl*(y+line));
-
-			lseek(raw_fb_fd, off, SEEK_SET);
-
-			len = bpl;
-			del = 0;
-			while (len > 0) {
-				n = read(raw_fb_fd, buf + del, len);
-
-				if (n > 0) {
-					del += n;
-					len -= n;
-				} else if (n == 0) {
-					break;
-				} else if (errno != EINTR && errno != EAGAIN) {
-					break;
-				}
-			}
-		}
-		for (ix = 0; ix < (int) w; ix++) {
-			int bx = (x + ix) * raw_fb_native_bpp;
-			int ib = bx / 8;
-			int br = bx - ib * 8;
-			unsigned char val;
-
-			val = *((unsigned char*) (buf + ib));
-
-			val = msk[br] & val;
-			val = val >> br;
-
-			if (cga) {
-				/* this is expt for CGA */
-				double r, g, b;
-				int ir, ig, ib;
-				r = (2./3)*(val & 4) + (1./3)*(val & 8);
-				g = (2./3)*(val & 2) + (1./3)*(val & 8);
-				b = (2./3)*(val & 1) + (1./3)*(val & 8);
-				if (val == 6) {
-					g = g/2.;
-				}
-				ir = rx_f * r;
-				ig = gx_f * g;
-				ib = bx_f * b;
-				val = (ib << bs_f) | (ig << gs_f) | (ir << rs_f);
-			} else {
-				unsigned char rval, gval, bval;
-				
-				rval = (val & rm_n) >> rs_n;
-				gval = (val & gm_n) >> gs_n;
-				bval = (val & bm_n) >> bs_n;
-
-				rval = (rx_f * rval) / rx_n;
-				gval = (gx_f * gval) / gx_n;
-				bval = (bx_f * bval) / bx_n;
-
-				rval = rval << rs_f;
-				gval = gval << gs_f;
-				bval = bval << bs_f;
-
-				val = rval | gval | bval;
-			}
-
-			*(dst+ix) = (char) val;
-		}
-
-		dst += dest->bytes_per_line;
-	}
-}
-
-static void copy_raw_fb_24_to_32(XImage *dest, int x, int y, unsigned int w,
-    unsigned int h) {
-	/*
-	 * kludge to read 1 byte at a time and dynamically transform
-	 * 24bpp -> 32bpp by inserting a extra 0 byte into dst.
-	 */
-	char *src, *dst;
-	unsigned int line;
-	static char *buf = NULL;
-	static int buflen = -1;
-	int bpl = wdpy_x * 3;	/* pixelsize == 3 */
-	int LE, n, stp, len, del, sz = w * 3;
-	int insert_zeroes = 1;
-
-#define INSERT_ZEROES  \
-	len = sz; \
-	del = 0; \
-	stp = 0; \
-	while (len > 0) { \
-		if (insert_zeroes && (del - LE) % 4 == 0) { \
-			*(dst + del) = 0; \
-			del++; \
-		} \
-		*(dst + del) = *(buf + stp); \
-		del++; \
-		len--; \
-		stp++; \
-	}
-
-	if (rfbEndianTest) {
-		LE = 3;	/* little endian */
-	} else {
-		LE = 0; /* big endian */
-	}
-
-	if (sz > buflen || buf == NULL) {
-		if (buf) {
-			free(buf);
-		}
-		buf = (char *) malloc(4*(sz + 1000));
-	}
-
-	if (clipshift && ! use_snapfb) {
-		x += coff_x;
-		y += coff_y;
-	}
-
-	if (use_snapfb && dest != snap) {
-		/* snapfb src */
-		src = snap->data + snap->bytes_per_line*y + 3*x;
-		dst = dest->data;
-		for (line = 0; line < h; line++) {
-			memcpy(buf, src, sz);
-
-			INSERT_ZEROES
-
-			src += snap->bytes_per_line;
-			dst += dest->bytes_per_line;
-		}
-
-	} else if (! raw_fb_seek) {
-		/* mmap */
-		bpl = raw_fb_bytes_per_line;
-		if (clipshift && wdpy_x != cdpy_x) {
-			bpl = wdpy_x * 3;
-		}
-		src = raw_fb_addr + raw_fb_offset + bpl*y + 3*x;
-		dst = dest->data;
-
-		if (use_snapfb && dest == snap) {
-			/*
-			 * writing *to* snap_fb: need the x,y offset,
-			 * and also do not do inserts.
-			 */
-			dst += bpl*y + 3*x;
-			insert_zeroes = 0;
-		}
-
-		for (line = 0; line < h; line++) {
-			memcpy(buf, src, sz);
-
-			INSERT_ZEROES
-
-			src += bpl;
-			dst += dest->bytes_per_line;
-		}
-
-	} else {
-		/* lseek */
-		off_t off;
-		bpl = raw_fb_bytes_per_line;
-		if (clipshift && wdpy_x != cdpy_x) {
-			bpl = wdpy_x * 3;
-		}
-		off = (off_t) (raw_fb_offset + bpl*y + 3*x);
-
-		lseek(raw_fb_fd, off, SEEK_SET);
-		dst = dest->data;
-
-		if (use_snapfb && dest == snap) {
-			/*
-			 * writing *to* snap_fb: need the x,y offset,
-			 * and also do not do inserts.
-			 */
-			dst += bpl*y + 3*x;
-			insert_zeroes = 0;
-		}
-
-		for (line = 0; line < h; line++) {
-			len = sz;
-			del = 0;
-			while (len > 0) {
-				n = read(raw_fb_fd, buf + del, len);
-
-				if (n > 0) {
-					del += n;
-					len -= n;
-				} else if (n == 0) {
-					break;
-				} else if (errno != EINTR && errno != EAGAIN) {
-					break;
-				}
-			}
-
-			INSERT_ZEROES
-
-			if (bpl > sz) {
-				off = (off_t) (bpl - sz);
-				lseek(raw_fb_fd, off, SEEK_CUR);
-			}
-			dst += dest->bytes_per_line;
-		}
-	}
-}
-
-#ifdef MACOSX
-void macosx_copy_opengl(char *, int, int, unsigned int, unsigned int);
-#endif
-
-void copy_raw_fb(XImage *dest, int x, int y, unsigned int w, unsigned int h) {
-	char *src, *dst;
-	unsigned int line;
-	int pixelsize = bpp/8;
-	static int db = -1;
-
-#ifdef MACOSX
-	if (macosx_console && macosx_read_opengl) {
-		macosx_copy_opengl(dest->data, x, y, w, h);
-		return;
-	}
-#endif
-
-	if (xform24to32) {
-		copy_raw_fb_24_to_32(dest, x, y, w, h);
-		return;
-	}
-	if (raw_fb_native_bpp < 8) {
-		copy_raw_fb_low_bpp(dest, x, y, w, h);
-		return;
-	}
-	if (db < 0) {
-		if (getenv("DEBUG_COPY_RAW_FB")) {
-			db = atoi(getenv("DEBUG_COPY_RAW_FB"));
-		} else {
-			db = 0;
-		}
-	}
-
-	if (clipshift && ! use_snapfb) {
-		x += coff_x;
-		y += coff_y;
-	}
-
-
-	if (use_snapfb && dest != snap) {
-		/* snapfb src */
-		src = snap->data + snap->bytes_per_line*y + pixelsize*x;
-		dst = dest->data;
-
-if (db) fprintf(stderr, "snap->bytes_per_line: %d, dest->bytes_per_line: %d, w: %d h: %d dpy_x: %d wdpy_x: %d cdpy_x: %d bpp: %d pixelsize: %d\n", snap->bytes_per_line, dest->bytes_per_line, w, h, dpy_x, wdpy_x, cdpy_x, bpp, pixelsize);
-
-		for (line = 0; line < h; line++) {
-			memcpy(dst, src, w * pixelsize);
-			src += snap->bytes_per_line;
-			dst += dest->bytes_per_line;
-		}
-
-	} else if (! raw_fb_seek) {
-		/* mmap */
-		int bpl = raw_fb_bytes_per_line;
-
-		if (clipshift && wdpy_x != cdpy_x) {
-			bpl = wdpy_x * pixelsize;
-		}
-
-		src = raw_fb_addr + raw_fb_offset + bpl*y + pixelsize*x;
-		dst = dest->data;
-
-if (db) fprintf(stderr, "bpl: %d, dest->bytes_per_line: %d, w: %d h: %d dpy_x: %d wdpy_x: %d cdpy_x: %d bpp: %d pixelsize: %d\n", bpl, dest->bytes_per_line, w, h, dpy_x, wdpy_x, cdpy_x, bpp, pixelsize);
-
-		for (line = 0; line < h; line++) {
-			memcpy(dst, src, w * pixelsize);
-			src += bpl;
-			dst += dest->bytes_per_line;
-		}
-
-	} else {
-		/* lseek */
-		int n, len, del, sz = w * pixelsize;
-		off_t off;
-		int bpl = raw_fb_bytes_per_line;
-
-		if (clipshift && wdpy_x != cdpy_x) {
-			bpl = wdpy_x * pixelsize;
-		}
-
-		off = (off_t) (raw_fb_offset + bpl*y + pixelsize*x);
-
-		lseek(raw_fb_fd, off, SEEK_SET);
-		dst = dest->data;
-
-if (db) fprintf(stderr, "lseek 0 ps: %d  sz: %d off: %d bpl: %d\n", pixelsize, sz, (int) off, bpl);
-
-		for (line = 0; line < h; line++) {
-			len = sz;
-			del = 0;
-			while (len > 0) {
-				n = read(raw_fb_fd, dst + del, len);
-
-				if (n > 0) {
-					del += n;
-					len -= n;
-				} else if (n == 0) {
-					break;
-				} else if (errno != EINTR && errno != EAGAIN) {
-					break;
-				}
-			}
-			if (bpl > sz) {
-				off = (off_t) (bpl - sz);
-				lseek(raw_fb_fd, off, SEEK_CUR);
-			}
-			dst += dest->bytes_per_line;
-		}
-	}
-}
-
-void copy_image(XImage *dest, int x, int y, unsigned int w, unsigned int h) {
-	/* default (w=0, h=0) is the fill the entire XImage */
-	if (dest == NULL) {
-		return;
-	}
-	if (w < 1)  {
-		w = dest->width;
-	}
-	if (h < 1)  {
-		h = dest->height;
-	}
-
-	if (raw_fb) {
-		copy_raw_fb(dest, x, y, w, h);
-
-	} else if (use_snapfb && snap_fb && dest != snaprect) {
-		char *src, *dst;
-		unsigned int line;
-		int pixelsize = bpp/8;
-
-		src = snap->data + snap->bytes_per_line*y + pixelsize*x;
-		dst = dest->data;
-		for (line = 0; line < h; line++) {
-			memcpy(dst, src, w * pixelsize);
-			src += snap->bytes_per_line;
-			dst += dest->bytes_per_line;
-		}
-
-	} else if ((using_shm && ! xform24to32) && (int) w == dest->width &&
-	    (int) h == dest->height) {
-		XShmGetImage_wr(dpy, window, dest, x, y, AllPlanes);
-
-	} else {
-		XGetSubImage_wr(dpy, window, x, y, w, h, AllPlanes,
-		    ZPixmap, dest, 0, 0);
-	}
-}
-
-#define DEBUG_SKIPPED_INPUT(dbg, str) \
-	if (dbg) { \
-		rfbLog("skipped input: %s\n", str); \
-	}
-
-void init_track_keycode_state(void) {
-	int i;
-	for (i=0; i<256; i++) {
-		keycode_state[i] = 0;
-	}
-	get_keystate(keycode_state);
-}
-
-static void upup_downdown_warning(KeyCode key, Bool down) {
-	RAWFB_RET_VOID
-#if NO_X11
-	if (!key || !down) {}
-	return;
-#else
-	if ((down ? 1:0) == keycode_state[(int) key]) {
-		char *str = XKeysymToString(XKeycodeToKeysym(dpy, key, 0));
-		rfbLog("XTestFakeKeyEvent: keycode=0x%x \"%s\" is *already* "
-		    "%s\n", key, str ? str : "null", down ? "down":"up");
-	}
-#endif	/* NO_X11 */
-}
-
-/*
- * wrappers for XTestFakeKeyEvent, etc..
- * also for XTrap equivalents XESimulateXEventRequest
- */
-
-void XTRAP_FakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
-    unsigned long delay) {
-
-	RAWFB_RET_VOID
-#if NO_X11
-	nox11_exit(1);
-	if (!dpy || !key || !down || !delay) {}
-	return;
-#else
-
-	if (! xtrap_present) {
-		DEBUG_SKIPPED_INPUT(debug_keyboard, "keyboard: no-XTRAP");
-		return;
-	}
-	/* unused vars warning: */
-	if (key || down || delay) {}
-
-# if LIBVNCSERVER_HAVE_LIBXTRAP
-	XESimulateXEventRequest(trap_ctx, down ? KeyPress : KeyRelease,
-	    key, 0, 0, 0);
-	if (debug_keyboard) {
-		upup_downdown_warning(key, down);
-	}
-	keycode_state[(int) key] = down ? 1 : 0;
-# else
-	DEBUG_SKIPPED_INPUT(debug_keyboard, "keyboard: no-XTRAP-build");
-# endif
-
-#endif	/* NO_X11 */
-}
-
-void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
-    unsigned long delay) {
-	static int first = 1;
-	int regrab = 0;
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	nox11_exit(1);
-	if (!dpy || !key || !down || !delay || !first) {}
-	return;
-#else
-	if (debug_keyboard) {
-		char *str = XKeysymToString(XKeycodeToKeysym(dpy, key, 0));
-		rfbLog("XTestFakeKeyEvent(dpy, keycode=0x%x \"%s\", %s)\n",
-		    key, str ? str : "null", down ? "down":"up");
-	}
-	if (first) { 
-		init_track_keycode_state();
-		first = 0;
-	}
-	if (down) {
-		last_keyboard_keycode = -key;
-	} else {
-		last_keyboard_keycode = key;
-	}
-
-	if (grab_kbd) {
-		XUngrabKeyboard(dpy, CurrentTime);
-		regrab = 1;
-	}
-	if (grab_ptr && ungrab_both) {
-		XUngrabPointer(dpy, CurrentTime);
-		regrab = 1;
-	}
-
-	if (xtrap_input) {
-		XTRAP_FakeKeyEvent_wr(dpy, key, down, delay);
-		if (regrab) {
-			adjust_grabs(1, 1);
-		}
-		return;
-	}
-
-	if (! xtest_present) {
-		DEBUG_SKIPPED_INPUT(debug_keyboard, "keyboard: no-XTEST");
-		return;
-	}
-	if (debug_keyboard) {
-		rfbLog("calling XTestFakeKeyEvent(%d, %d)  %.4f\n",
-		    key, down, dnowx());	
-	}
-#if LIBVNCSERVER_HAVE_XTEST
-	XTestFakeKeyEvent(dpy, key, down, delay);
-	if (regrab) {
-		adjust_grabs(1, 1);
-	}
-	if (debug_keyboard) {
-		upup_downdown_warning(key, down);
-	}
-	keycode_state[(int) key] = down ? 1 : 0;
-#endif
-
-#endif	/* NO_X11 */
-}
-
-void XTRAP_FakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
-    unsigned long delay) {
-
-	RAWFB_RET_VOID
-#if NO_X11
-	nox11_exit(1);
-	if (!dpy || !button || !is_press || !delay) {}
-	return;
-#else
-
-	if (! xtrap_present) {
-		DEBUG_SKIPPED_INPUT(debug_keyboard, "button: no-XTRAP");
-		return;
-	}
-	/* unused vars warning: */
-	if (button || is_press || delay) {}
-
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-	XESimulateXEventRequest(trap_ctx,
-	    is_press ? ButtonPress : ButtonRelease, button, 0, 0, 0);
-#else
-	DEBUG_SKIPPED_INPUT(debug_keyboard, "button: no-XTRAP-build");
-#endif
-
-#endif	/* NO_X11 */
-}
-
-void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
-    unsigned long delay) {
-	int regrab = 0;
-
-	RAWFB_RET_VOID
-#if NO_X11
-	nox11_exit(1);
-	if (!dpy || !button || !is_press || !delay) {}
-	return;
-#else
-
-	if (grab_ptr) {
-		XUngrabPointer(dpy, CurrentTime);
-		regrab = 1;
-	}
-	if (grab_kbd && ungrab_both) {
-		XUngrabKeyboard(dpy, CurrentTime);
-		regrab = 1;
-	}
-
-	if (xtrap_input) {
-		XTRAP_FakeButtonEvent_wr(dpy, button, is_press, delay);
-		if (regrab) {
-			adjust_grabs(1, 1);
-		}
-		return;
-	}
-
-	if (! xtest_present) {
-		DEBUG_SKIPPED_INPUT(debug_keyboard, "button: no-XTEST");
-		return;
-	}
-	if (debug_pointer) {
-		rfbLog("calling XTestFakeButtonEvent(%d, %d)  %.4f\n",
-		    button, is_press, dnowx());	
-	}
-#if LIBVNCSERVER_HAVE_XTEST
-    	XTestFakeButtonEvent(dpy, button, is_press, delay);
-#endif
-	if (regrab) {
-		adjust_grabs(1, 1);
-	}
-#endif	/* NO_X11 */
-}
-
-void XTRAP_FakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
-    unsigned long delay) {
-
-	RAWFB_RET_VOID
-
-#if NO_X11
-	nox11_exit(1);
-	if (!dpy || !screen || !x || !y || !delay) {}
-	return;
-#else
-	if (! xtrap_present) {
-		DEBUG_SKIPPED_INPUT(debug_keyboard, "motion: no-XTRAP");
-		return;
-	}
-	/* unused vars warning: */
-	if (dpy || screen || x || y || delay) {}
-
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-	XESimulateXEventRequest(trap_ctx, MotionNotify, 0, x, y, 0);
-#else
-	DEBUG_SKIPPED_INPUT(debug_keyboard, "motion: no-XTRAP-build");
-#endif
-
-#endif	/* NO_X11 */
-}
-
-void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
-    unsigned long delay) {
-	int regrab = 0;
-
-	RAWFB_RET_VOID
-#if NO_X11
-	nox11_exit(1);
-	if (!dpy || !screen || !x || !y || !delay) {}
-	return;
-#else
-
-	if (grab_ptr) {
-		XUngrabPointer(dpy, CurrentTime);
-		regrab = 1;
-	}
-	if (grab_kbd && ungrab_both) {
-		XUngrabKeyboard(dpy, CurrentTime);
-		regrab = 1;
-	}
-
-	if (xtrap_input) {
-		XTRAP_FakeMotionEvent_wr(dpy, screen, x, y, delay);
-		if (regrab) {
-			adjust_grabs(1, 1);
-		}
-		return;
-	}
-
-	if (debug_pointer) {
-		rfbLog("calling XTestFakeMotionEvent(%d, %d)  %.4f\n",
-		    x, y, dnowx());	
-	}
-#if LIBVNCSERVER_HAVE_XTEST
-	XTestFakeMotionEvent(dpy, screen, x, y, delay);
-#endif
-	if (regrab) {
-		adjust_grabs(1, 1);
-	}
-#endif	/* NO_X11 */
-}
-
-Bool XTestCompareCurrentCursorWithWindow_wr(Display* dpy, Window w) {
-	if (! xtest_present) {
-		return False;
-	}
-	RAWFB_RET(False)
-
-#if LIBVNCSERVER_HAVE_XTEST
-	return XTestCompareCurrentCursorWithWindow(dpy, w);
-#else
-	if (!w) {}
-	return False;
-#endif
-}
-
-Bool XTestCompareCursorWithWindow_wr(Display* dpy, Window w, Cursor cursor) {
-	if (! xtest_present) {
-		return False;
-	}
-	RAWFB_RET(False)
-#if LIBVNCSERVER_HAVE_XTEST
-	return XTestCompareCursorWithWindow(dpy, w, cursor);
-#else
-	if (!dpy || !w || !cursor) {}
-	return False;
-#endif
-}
-
-Bool XTestQueryExtension_wr(Display *dpy, int *ev, int *er, int *maj,
-    int *min) {
-	RAWFB_RET(False)
-#if LIBVNCSERVER_HAVE_XTEST
-	return XTestQueryExtension(dpy, ev, er, maj, min);
-#else
-	if (!dpy || !ev || !er || !maj || !min) {}
-	return False;
-#endif
-}
-
-void XTestDiscard_wr(Display *dpy) {
-	if (! xtest_present) {
-		return;
-	}
-	RAWFB_RET_VOID
-#if LIBVNCSERVER_HAVE_XTEST
-	XTestDiscard(dpy);
-#else
-	if (!dpy) {}
-#endif
-}
-
-Bool XETrapQueryExtension_wr(Display *dpy, int *ev, int *er, int *op) {
-	RAWFB_RET(False)
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-	return XETrapQueryExtension(dpy, (INT32 *)ev, (INT32 *)er,
-	    (INT32 *)op);
-#else
-	/* unused vars warning: */
-	if (ev || er || op) {}
-	return False;
-#endif
-}
-
-int XTestGrabControl_wr(Display *dpy, Bool impervious) {
-	if (! xtest_present) {
-		return 0;
-	}
-	RAWFB_RET(0)
-#if LIBVNCSERVER_HAVE_XTEST && LIBVNCSERVER_HAVE_XTESTGRABCONTROL
-	XTestGrabControl(dpy, impervious);
-	return 1;
-#else
-	if (!dpy || !impervious) {}
-	return 0;
-#endif
-}
-
-int XTRAP_GrabControl_wr(Display *dpy, Bool impervious) {
-	if (! xtrap_present) {
-		/* unused vars warning: */
-		if (dpy || impervious) {}
-		return 0;
-	}
-	RAWFB_RET(0)
-#if LIBVNCSERVER_HAVE_LIBXTRAP
-	  else {
-		ReqFlags requests;
-
-		if (! impervious) {
-			if (trap_ctx) {
-				XEFreeTC(trap_ctx);
-			}
-			trap_ctx = NULL;
-			return 1;
-		}
-
-		if (! trap_ctx) {
-			trap_ctx = XECreateTC(dpy, 0, NULL);
-			if (! trap_ctx) {
-				rfbLog("DEC-XTRAP XECreateTC failed.  Watch "
-				    "out for XGrabServer from wm's\n");
-				return 0;
-			}
-			XEStartTrapRequest(trap_ctx);
-			memset(requests, 0, sizeof(requests));
-			BitTrue(requests, X_GrabServer);
-			BitTrue(requests, X_UngrabServer);
-			XETrapSetRequests(trap_ctx, True, requests);
-			XETrapSetGrabServer(trap_ctx, True);
-		}
-		return 1;
-	}
-#endif
-	return 0;
-}
-
-void disable_grabserver(Display *in_dpy, int change) {
-	int ok = 0;
-	static int didmsg = 0;
-
-	if (debug_grabs) {
-		fprintf(stderr, "disable_grabserver/%d %.5f\n",
-			xserver_grabbed, dnowx());
-		didmsg = 0;
-	}
-
-	if (! xtrap_input) {
-		if (XTestGrabControl_wr(in_dpy, True)) {
-			if (change) {
-				XTRAP_GrabControl_wr(in_dpy, False);
-			}
-			if (! didmsg && ! raw_fb_str) {
-				rfbLog("GrabServer control via XTEST.\n"); 
-				didmsg = 1;
-			}
-			ok = 1;
-		} else {
-			if (XTRAP_GrabControl_wr(in_dpy, True)) {
-				ok = 1;
-				if (! didmsg && ! raw_fb_str) {
-					rfbLog("Using DEC-XTRAP for protection"
-					    " from XGrabServer.\n");
-					didmsg = 1;
-				}
-			}
-		}
-	} else {
-		if (XTRAP_GrabControl_wr(in_dpy, True)) {
-			if (change) {
-				XTestGrabControl_wr(in_dpy, False);
-			}
-			if (! didmsg && ! raw_fb_str) {
-				rfbLog("GrabServer control via DEC-XTRAP.\n"); 
-				didmsg = 1;
-			}
-			ok = 1;
-		} else {
-			if (XTestGrabControl_wr(in_dpy, True)) {
-				ok = 1;
-				if (! didmsg && ! raw_fb_str) {
-					rfbLog("DEC-XTRAP XGrabServer "
-					    "protection not available, "
-					    "using XTEST.\n");
-					didmsg = 1;
-				}
-			}
-		}
-	}
-	if (! ok && ! didmsg) {
-		rfbLog("*********************************************************\n");
-		rfbLog("* No XTEST or DEC-XTRAP protection from XGrabServer !!! *\n");
-		rfbLog("* DEADLOCK if your window manager calls XGrabServer !!! *\n");
-		rfbLog("*********************************************************\n");
-	}
-	XFlush_wr(in_dpy);
-}
-
-Bool XRecordQueryVersion_wr(Display *dpy, int *maj, int *min) {
-	RAWFB_RET(False)
-#if LIBVNCSERVER_HAVE_RECORD
-	return XRecordQueryVersion(dpy, maj, min);
-#else
-	if (!dpy || !maj || !min) {}
-	return False;
-#endif
-}
-
-int xauth_raw(int on) {
-	char tmp[] = "/tmp/x11vnc-xauth.XXXXXX";
-	int tmp_fd = -1;
-	static char *old_xauthority = NULL;
-	static char *old_tmp = NULL;
-	int db = 0;
-
-	if (on) {
-		if (old_xauthority) {
-			free(old_xauthority);
-			old_xauthority = NULL;
-		}
-		if (old_tmp) {
-			free(old_tmp);
-			old_tmp = NULL;
-		}
-		if (xauth_raw_data) {
-			tmp_fd = mkstemp(tmp);
-			if (tmp_fd < 0) {
-				rfbLog("could not create tmp xauth file: %s\n", tmp);	
-				return 0;
-			}
-			if (db) fprintf(stderr, "XAUTHORITY tmp: %s\n", tmp);
-			write(tmp_fd, xauth_raw_data, xauth_raw_len);
-			close(tmp_fd);
-			if (getenv("XAUTHORITY")) {
-				old_xauthority = strdup(getenv("XAUTHORITY"));
-			} else {
-				old_xauthority = strdup("");
-			}
-			set_env("XAUTHORITY", tmp);
-			old_tmp = strdup(tmp);
-		}
-		return 1;
-	} else {
-		if (old_xauthority) {
-			if (!strcmp(old_xauthority, "")) {
-				char *xauth = getenv("XAUTHORITY");
-				if (xauth) {
-					*(xauth-2) = '_';	/* yow */
-				}
-			} else {
-				set_env("XAUTHORITY", old_xauthority);
-			}
-			free(old_xauthority);
-			old_xauthority = NULL;
-		}
-		if (old_tmp) {
-			unlink(old_tmp);
-			free(old_tmp);
-			old_tmp = NULL;
-		}
-		return 1;
-	}
-}
-
-Display *XOpenDisplay_wr(char *display_name) {
-	Display *d = NULL;
-	int db = 0;
-
-	if (! xauth_raw(1)) {
-		return NULL;
-	}
-#if NO_X11
-	rfbLog("This x11vnc was built without X11 support (-rawfb only).\n");
-	if (!display_name || !d || !db) {}
-	return NULL;
-#else
-
-	d = XOpenDisplay(display_name);
-	if (db) fprintf(stderr, "XOpenDisplay_wr: %s  %p\n", display_name, (void *)d);
-
-	if (d == NULL && !getenv("NO_XAUTHLOCALHOSTNAME")) {
-		char *xalhn = getenv("XAUTHLOCALHOSTNAME");
-		if (1 || !xalhn) {
-			rfbLog("XOpenDisplay(\"%s\") failed.\n",
-			    display_name ? display_name : "");
-			rfbLog("Trying again with XAUTHLOCALHOSTNAME=localhost ...\n");
-			set_env("XAUTHLOCALHOSTNAME", "localhost");
-			d = XOpenDisplay(display_name);
-			if (d == NULL && xalhn) {
-				char *ptr = getenv("XAUTHLOCALHOSTNAME");
-				if (ptr) {
-					*(ptr-2) = '_';	/* yow */
-					rfbLog("XOpenDisplay(\"%s\") failed.\n",
-					    display_name ? display_name : "");
-					rfbLog("Trying again with unset XAUTHLOCALHOSTNAME ...\n");
-					d = XOpenDisplay(display_name);
-				}
-			}
-		}
-	}
-
-	xauth_raw(0);
-
-	return d;
-#endif	/* NO_X11 */
-}
-
-int XCloseDisplay_wr(Display *display) {
-	int db = 0;
-	if (db) fprintf(stderr, "XCloseDisplay_wr: %p\n", (void *)display);
-#if NO_X11
-	return 0;
-#else
-	return XCloseDisplay(display);
-#endif	/* NO_X11 */
-}
-
-static unsigned int Bmask = (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask);
-static unsigned int Mmask = (ShiftMask|LockMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask);
-
-static unsigned int last_local_button_mask = 0;
-static unsigned int last_local_mod_mask = 0;
-static int last_local_x = 0;
-static int last_local_y = 0;
-
-Bool XQueryPointer_wr(Display *display, Window w, Window *root_return,
-    Window *child_return, int *root_x_return, int *root_y_return,
-    int *win_x_return, int *win_y_return, unsigned int *mask_return) {
-#if NO_X11
-	if (!display || !w || !root_return || !child_return || !root_x_return
-	    || !root_y_return || !win_x_return || !win_y_return || !mask_return) {}
-	return False;
-#else
-	Bool rc;
-	XErrorHandler old_handler;
-
-
-	if (! display) {
-		return False;
-	}
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-
-	rc = XQueryPointer(display, w, root_return, child_return,
-	    root_x_return, root_y_return, win_x_return, win_y_return,
-	    mask_return);
-
-	XSetErrorHandler(old_handler);
-	if (trapped_xerror) {
-		rc = 0;
-	}
-	if (rc) {
-		display_button_mask = (*mask_return) & Bmask;
-		display_mod_mask    = (*mask_return) & Mmask;
-		if (last_local_button_mask != display_button_mask) {
-			got_local_pointer_input++;
-		} else if (*root_x_return != last_local_x ||
-		    *root_y_return != last_local_y) {
-			got_local_pointer_input++;
-		}
-		last_local_button_mask = display_button_mask;
-		last_local_mod_mask = display_mod_mask;
-		last_local_x = *root_x_return;
-		last_local_y = *root_y_return;
-	}
-	return rc;
-#endif	/* NO_X11 */
-}
- 
-
-Status XQueryTree_wr(Display *display, Window w, Window *root_return,
-    Window *parent_return, Window **children_return,
-    unsigned int *nchildren_return) {
-
-#ifdef MACOSX
-	if (macosx_console) {
-		return macosx_xquerytree(w, root_return, parent_return,
-		    children_return, nchildren_return);
-	}
-#endif
-#if NO_X11
-	if (!display || !w || !root_return || !parent_return
-	    || !children_return || !nchildren_return) {}
-	return (Status) 0;
-#else
-	if (! display) {
-		return (Status) 0;
-	}
-	return XQueryTree(display, w, root_return, parent_return,
-	    children_return, nchildren_return);
-#endif	/* NO_X11 */
-    	
-}
-
-int XFree_wr(void *data) {
-	if (data == NULL) {
-		return 1;
-	}
-	if (! dpy) {
-		return 1;
-	}
-#if NO_X11
-	return 1;
-#else
-	return XFree(data);
-#endif
-}
-
-int XSelectInput_wr(Display *display, Window w, long event_mask) {
-#if NO_X11
-	if (!display || !w || !event_mask) {}
-	return 0;
-#else
-	int rc;
-	XErrorHandler old_handler;
-	if (display == NULL || w == None) {
-		return 0;
-	}
-	old_handler = XSetErrorHandler(trap_xerror);
-	trapped_xerror = 0;
-	rc = XSelectInput(display, w, event_mask);
-	XSetErrorHandler(old_handler);
-	if (trapped_xerror) {
-		rc = 0;
-	}
-	return rc;
-#endif
-}
-
-void nox11_exit(int rc) {
-#if NO_X11
-	rfbLog("This x11vnc was not built with X11 support.\n");
-	clean_up_exit(rc);
-#else
-	if (0) {rc = 0;}
-#endif
-}
-
-
-#if NO_X11
-#include "nox11_funcs.h"
-#endif
-
diff --git a/ica/x11/x11vnc/xwrappers.h b/ica/x11/x11vnc/xwrappers.h
deleted file mode 100644
index f1e0fbf..0000000
--- a/ica/x11/x11vnc/xwrappers.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-   Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com> 
-   All rights reserved.
-
-This file is part of x11vnc.
-
-x11vnc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-x11vnc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with x11vnc; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-or see <http://www.gnu.org/licenses/>.
-
-In addition, as a special exception, Karl J. Runge
-gives permission to link the code of its release of x11vnc with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.
-*/
-
-#ifndef _X11VNC_XWRAPPERS_H
-#define _X11VNC_XWRAPPERS_H
-
-/* -- xwrappers.h -- */
-
-extern int xshm_present;
-extern int xshm_opcode;
-extern int xtest_present;
-extern int xtrap_present;
-extern int xrecord_present;
-extern int xkb_present;
-extern int xinerama_present;
-
-extern int keycode_state[];
-extern int rootshift;
-extern int clipshift;
-
-
-extern int guess_bits_per_color(int bits_per_pixel);
-
-extern int XFlush_wr(Display *disp);
-
-extern Status XShmGetImage_wr(Display *disp, Drawable d, XImage *image, int x, int y,
-    unsigned long mask);
-extern XImage *XShmCreateImage_wr(Display* disp, Visual* vis, unsigned int depth,
-    int format, char* data, XShmSegmentInfo* shminfo, unsigned int width,
-    unsigned int height);
-extern Status XShmAttach_wr(Display *disp, XShmSegmentInfo *shminfo);
-extern Status XShmDetach_wr(Display *disp, XShmSegmentInfo *shminfo);
-extern Bool XShmQueryExtension_wr(Display *disp);
-extern int XShmGetEventBase_wr(Display *disp);
-
-extern XImage *xreadscreen(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, Bool show_cursor);
-extern XImage *XGetSubImage_wr(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, unsigned long plane_mask,
-    int format, XImage *dest_image, int dest_x, int dest_y);
-extern XImage *XGetImage_wr(Display *disp, Drawable d, int x, int y,
-    unsigned int width, unsigned int height, unsigned long plane_mask,
-    int format);
-extern XImage *XCreateImage_wr(Display *disp, Visual *visual, unsigned int depth,
-    int format, int offset, char *data, unsigned int width,
-    unsigned int height, int bitmap_pad, int bytes_per_line);
-extern void copy_image(XImage *dest, int x, int y, unsigned int w, unsigned int h);
-extern void copy_raw_fb(XImage *dest, int x, int y, unsigned int w, unsigned int h);
-extern void init_track_keycode_state(void);
-
-extern void XTRAP_FakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
-    unsigned long delay);
-extern void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
-    unsigned long delay);
-extern void XTRAP_FakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
-    unsigned long delay);
-extern void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
-    unsigned long delay);
-extern void XTRAP_FakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
-    unsigned long delay);
-extern void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
-    unsigned long delay);
-
-extern Bool XTestCompareCurrentCursorWithWindow_wr(Display* dpy, Window w);
-extern Bool XTestCompareCursorWithWindow_wr(Display* dpy, Window w, Cursor cursor);
-extern Bool XTestQueryExtension_wr(Display *dpy, int *ev, int *er, int *maj,
-    int *min);
-extern void XTestDiscard_wr(Display *dpy);
-extern Bool XETrapQueryExtension_wr(Display *dpy, int *ev, int *er, int *op);
-extern int XTestGrabControl_wr(Display *dpy, Bool impervious);
-extern int XTRAP_GrabControl_wr(Display *dpy, Bool impervious);
-extern void disable_grabserver(Display *in_dpy, int change);
-
-extern Bool XRecordQueryVersion_wr(Display *dpy, int *maj, int *min);
-
-extern int xauth_raw(int on);
-extern Display *XOpenDisplay_wr(char *display_name);
-extern int XCloseDisplay_wr(Display *display);
-
-extern Bool XQueryPointer_wr(Display *display, Window w, Window *root_return,
-    Window *child_return, int *root_x_return, int *root_y_return,
-    int *win_x_return, int *win_y_return, unsigned int *mask_return);
-
-extern Status XQueryTree_wr(Display *display, Window w, Window *root_return,
-    Window *parent_return, Window **children_return,
-    unsigned int *nchildren_return);
-
-extern int XFree_wr(void *data);
-extern int XSelectInput_wr(Display *display, Window w, long event_mask);
-
-
-#endif /* _X11VNC_XWRAPPERS_H */
diff --git a/ima/CMakeLists.txt b/ima/CMakeLists.txt
deleted file mode 100644
index 3edeb9e..0000000
--- a/ima/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-FILE(GLOB italc_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
-FILE(GLOB italc_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
-FILE(GLOB italc_UI ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/*.ui)
-SET(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/italc.qrc)
-QT4_WRAP_CPP(italc_MOC_out ${italc_INCLUDES})
-QT4_WRAP_UI(italc_UIC_out ${italc_UI})
-QT4_ADD_RESOURCES(italc_RCC_out ${QRC_FILE})
-QT4_TRANSLATIONS_FOR_QRC(${QRC_FILE} ${italc_SOURCES} ${italc_INCLUDES})
-
-IF(ITALC_BUILD_WIN32)
-	SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/italcrc.obj")
-	ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
-	ADD_CUSTOM_COMMAND(OUTPUT ${WINRC}
-						COMMAND ${WINDRES}
-							-I${CMAKE_CURRENT_SOURCE_DIR}
-							-o${WINRC}
-							-i${CMAKE_CURRENT_BINARY_DIR}/italc.rc
-						DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/italc.rc)
-
-ENDIF(ITALC_BUILD_WIN32)
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
-ADD_EXECUTABLE(italc ${italc_UIC_out} ${italc_SOURCES} ${italc_INCLUDES} ${italc_MOC_out} ${italc_RCC_out} ${WINRC})
-TARGET_LINK_LIBRARIES(italc ItalcCore)
-
-INSTALL(TARGETS italc RUNTIME DESTINATION bin)
-
-IF(ITALC_BUILD_WIN32)
-	SET_TARGET_PROPERTIES(italc PROPERTIES LINK_FLAGS -mwindows)
-ENDIF(ITALC_BUILD_WIN32)
-
diff --git a/ima/data/italc.desktop.in b/ima/data/italc.desktop.in
deleted file mode 100644
index 4a16b41..0000000
--- a/ima/data/italc.desktop.in
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Name=iTALC
-GenericName=View and remote-control clients
-GenericName[de]=Clients überwachen und fernsteuern
-GenericName[ru]=Управление рабочими столами учеников
-Comment=Intelligent Teaching And Learning with Computers
-Icon=italc
-Exec=@CMAKE_INSTALL_PREFIX@/bin/italc
-Type=Application
-Terminal=false
-Categories=Qt;KDE;Education;X-KDE-Edu-Teaching;RemoteAccess;
diff --git a/ima/data/italc.ico b/ima/data/italc.ico
deleted file mode 100644
index eb7364e..0000000
Binary files a/ima/data/italc.ico and /dev/null differ
diff --git a/ima/data/italc.in b/ima/data/italc.in
deleted file mode 100644
index 31ba488..0000000
--- a/ima/data/italc.in
+++ /dev/null
@@ -1,7 +0,0 @@
-?package(italc-master):\
-	needs="X11"\
-	section="Applications/Education"\
-	title="iTALC"\
-	command="@prefix@/bin/italc" \
-	icon32x32="@prefix@/share/pixmaps/italc.png"\
-	hints="KDE"
diff --git a/ima/data/italc.png b/ima/data/italc.png
deleted file mode 100644
index 4bc9140..0000000
Binary files a/ima/data/italc.png and /dev/null differ
diff --git a/ima/data/italc.xpm b/ima/data/italc.xpm
deleted file mode 100644
index 7f10a3a..0000000
--- a/ima/data/italc.xpm
+++ /dev/null
@@ -1,2690 +0,0 @@
-/* XPM */
-static char * italc_xpm[] = {
-"128 128 2559 2",
-"  	c None",
-". 	c #004000",
-"+ 	c #004100",
-"@ 	c #004600",
-"# 	c #004B00",
-"$ 	c #005000",
-"% 	c #005300",
-"& 	c #005500",
-"* 	c #005700",
-"= 	c #005900",
-"- 	c #005B00",
-"; 	c #005E00",
-"> 	c #005F00",
-", 	c #005D00",
-"' 	c #005C00",
-") 	c #005A00",
-"! 	c #005800",
-"~ 	c #004D00",
-"{ 	c #004700",
-"] 	c #004200",
-"^ 	c #004900",
-"/ 	c #005100",
-"( 	c #006000",
-"_ 	c #006100",
-": 	c #006200",
-"< 	c #006300",
-"[ 	c #006400",
-"} 	c #006500",
-"| 	c #006600",
-"1 	c #006700",
-"2 	c #006800",
-"3 	c #006900",
-"4 	c #006A00",
-"5 	c #004C00",
-"6 	c #004800",
-"7 	c #006B00",
-"8 	c #006C00",
-"9 	c #006D00",
-"0 	c #006E00",
-"a 	c #005200",
-"b 	c #0A670A",
-"c 	c #287B28",
-"d 	c #478D47",
-"e 	c #66A166",
-"f 	c #84B484",
-"g 	c #9CC39C",
-"h 	c #A6C9A6",
-"i 	c #B0CFB0",
-"j 	c #BAD6BA",
-"k 	c #C4DCC4",
-"l 	c #CDE1CD",
-"m 	c #C9DFC9",
-"n 	c #BFD9BF",
-"o 	c #B5D4B5",
-"p 	c #ACCEAC",
-"q 	c #A1C8A1",
-"r 	c #93C093",
-"s 	c #76AF76",
-"t 	c #569E56",
-"u 	c #388C38",
-"v 	c #197B19",
-"w 	c #016D01",
-"x 	c #006F00",
-"y 	c #007000",
-"z 	c #007100",
-"A 	c #004A00",
-"B 	c #004300",
-"C 	c #004F00",
-"D 	c #096609",
-"E 	c #418941",
-"F 	c #7FB07F",
-"G 	c #BBD5BB",
-"H 	c #D9E8D9",
-"I 	c #D9E9D9",
-"J 	c #D2E6D2",
-"K 	c #9FC99F",
-"L 	c #62A762",
-"M 	c #248524",
-"N 	c #007200",
-"O 	c #007300",
-"P 	c #007400",
-"Q 	c #007500",
-"R 	c #004500",
-"S 	c #004400",
-"T 	c #237623",
-"U 	c #5F9C5F",
-"V 	c #9BC19B",
-"W 	c #CEE1CE",
-"X 	c #D4E5D4",
-"Y 	c #D4E6D4",
-"Z 	c #D4E7D4",
-"` 	c #BBD9BB",
-" .	c #7FB97F",
-"..	c #439843",
-"+.	c #0B7A0B",
-"@.	c #007600",
-"#.	c #007700",
-"$.	c #005400",
-"%.	c #0B670B",
-"&.	c #7DAE7D",
-"*.	c #B8D3B8",
-"=.	c #D0E2D0",
-"-.	c #D0E3D0",
-";.	c #D0E4D0",
-">.	c #D0E5D0",
-",.	c #D0E6D0",
-"'.	c #CCE4CC",
-").	c #9CCA9C",
-"!.	c #61AB61",
-"~.	c #268B26",
-"{.	c #007800",
-"].	c #007900",
-"^.	c #007A00",
-"/.	c #126B12",
-"(.	c #6EA56E",
-"_.	c #C2D9C2",
-":.	c #CBDFCB",
-"<.	c #CBE0CB",
-"[.	c #CBE1CB",
-"}.	c #CBE2CB",
-"|.	c #CBE3CB",
-"1.	c #CBE4CB",
-"2.	c #A2CEA2",
-"3.	c #3F9B3F",
-"4.	c #017A01",
-"5.	c #007B00",
-"6.	c #007C00",
-"7.	c #007D00",
-"8.	c #004E00",
-"9.	c #146D14",
-"0.	c #6FA56F",
-"a.	c #BFD7BF",
-"b.	c #C6DCC6",
-"c.	c #C6DDC6",
-"d.	c #C6DEC6",
-"e.	c #C6DFC6",
-"f.	c #C6E0C6",
-"g.	c #C6E1C6",
-"h.	c #A2CFA2",
-"i.	c #409D40",
-"j.	c #017D01",
-"k.	c #007E00",
-"l.	c #007F00",
-"m.	c #166E16",
-"n.	c #71A671",
-"o.	c #BDD6BD",
-"p.	c #C2DAC2",
-"q.	c #C2DBC2",
-"r.	c #C2DCC2",
-"s.	c #C2DDC2",
-"t.	c #C2DEC2",
-"u.	c #C2DFC2",
-"v.	c #C2E0C2",
-"w.	c #A1CFA1",
-"x.	c #42A042",
-"y.	c #028002",
-"z.	c #008000",
-"A.	c #008100",
-"B.	c #186F18",
-"C.	c #72A872",
-"D.	c #B9D3B9",
-"E.	c #BDD7BD",
-"F.	c #BDD8BD",
-"G.	c #BDD9BD",
-"H.	c #BDDABD",
-"I.	c #BDDBBD",
-"J.	c #BDDCBD",
-"K.	c #BDDDBD",
-"L.	c #BDDEBD",
-"M.	c #9FD09F",
-"N.	c #44A344",
-"O.	c #028302",
-"P.	c #008200",
-"Q.	c #008300",
-"R.	c #008400",
-"S.	c #0D680D",
-"T.	c #B5D1B5",
-"U.	c #B8D4B8",
-"V.	c #B8D5B8",
-"W.	c #B8D6B8",
-"X.	c #B8D7B8",
-"Y.	c #B8D8B8",
-"Z.	c #B8D9B8",
-"`.	c #B8DAB8",
-" +	c #B8DBB8",
-".+	c #B8DCB8",
-"++	c #9DCF9D",
-"@+	c #3AA03A",
-"#+	c #008500",
-"$+	c #008600",
-"%+	c #277927",
-"&+	c #9EC39E",
-"*+	c #B3D0B3",
-"=+	c #B3D1B3",
-"-+	c #B3D2B3",
-";+	c #B3D3B3",
-">+	c #B3D4B3",
-",+	c #B3D5B3",
-"'+	c #B3D6B3",
-")+	c #B3D7B3",
-"!+	c #B3D8B3",
-"~+	c #B3D9B3",
-"{+	c #B3DAB3",
-"]+	c #B3DBB3",
-"^+	c #67B767",
-"/+	c #048804",
-"(+	c #008700",
-"_+	c #008800",
-":+	c #4E924E",
-"<+	c #ACCCAC",
-"[+	c #AFCEAF",
-"}+	c #AFCFAF",
-"|+	c #AFD0AF",
-"1+	c #AFD1AF",
-"2+	c #AFD2AF",
-"3+	c #AFD3AF",
-"4+	c #AFD4AF",
-"5+	c #AFD5AF",
-"6+	c #9CBEAA",
-"7+	c #7994A0",
-"8+	c #5B6F98",
-"9+	c #718A9E",
-"0+	c #94B4A8",
-"a+	c #AED5AF",
-"b+	c #AFD6AF",
-"c+	c #AFD7AF",
-"d+	c #AFD8AF",
-"e+	c #AFD9AF",
-"f+	c #8BC98B",
-"g+	c #179317",
-"h+	c #008900",
-"i+	c #008A00",
-"j+	c #0B690B",
-"k+	c #75AB75",
-"l+	c #AACBAA",
-"m+	c #AACCAA",
-"n+	c #AACDAA",
-"o+	c #AACEAA",
-"p+	c #AACFAA",
-"q+	c #AAD0AA",
-"r+	c #AAD1AA",
-"s+	c #AAD2AA",
-"t+	c #9CC1A7",
-"u+	c #3F4D90",
-"v+	c #101484",
-"w+	c #000080",
-"x+	c #090C82",
-"y+	c #2F3B8B",
-"z+	c #8DAFA3",
-"A+	c #AAD4AA",
-"B+	c #AAD5AA",
-"C+	c #AAD6AA",
-"D+	c #AAD7AA",
-"E+	c #AAD8AA",
-"F+	c #9FD39F",
-"G+	c #36A336",
-"H+	c #008B00",
-"I+	c #008C00",
-"J+	c #227822",
-"K+	c #90BB90",
-"L+	c #A5C8A5",
-"M+	c #A5C9A5",
-"N+	c #A5CAA5",
-"O+	c #A5CBA5",
-"P+	c #A5CCA5",
-"Q+	c #A5CDA5",
-"R+	c #A5CEA5",
-"S+	c #A5CFA5",
-"T+	c #6F8C99",
-"U+	c #0E1183",
-"V+	c #040581",
-"W+	c #576F93",
-"X+	c #A3D0A5",
-"Y+	c #A5D3A5",
-"Z+	c #A5D4A5",
-"`+	c #A5D5A5",
-" @	c #A5D6A5",
-".@	c #5DB65D",
-"+@	c #038E03",
-"@@	c #008D00",
-"#@	c #008E00",
-"$@	c #468F46",
-"%@	c #9DC49D",
-"&@	c #A1C6A1",
-"*@	c #A1C7A1",
-"=@	c #A1C9A1",
-"-@	c #A1CAA1",
-";@	c #A1CBA1",
-">@	c #A1CCA1",
-",@	c #A1CDA1",
-"'@	c #A1CEA1",
-")@	c #3E4F8D",
-"!@	c #232E87",
-"~@	c #98C69F",
-"{@	c #A1D1A1",
-"]@	c #A1D2A1",
-"^@	c #A1D3A1",
-"/@	c #A1D4A1",
-"(@	c #A1D5A1",
-"_@	c #7FC67F",
-":@	c #149814",
-"<@	c #008F00",
-"[@	c #009000",
-"}@	c #056705",
-"|@	c #6AA46A",
-"1@	c #9CC49C",
-"2@	c #9CC59C",
-"3@	c #9CC69C",
-"4@	c #9CC79C",
-"5@	c #9CC89C",
-"6@	c #9CC99C",
-"7@	c #9CCB9C",
-"8@	c #5E7B91",
-"9@	c #3C508B",
-"0@	c #9CCF9C",
-"a@	c #9CD09C",
-"b@	c #9CD19C",
-"c@	c #9CD29C",
-"d@	c #9CD39C",
-"e@	c #9CD49C",
-"f@	c #92CF92",
-"g@	c #2BA42B",
-"h@	c #009100",
-"i@	c #009200",
-"j@	c #026602",
-"k@	c #68A468",
-"l@	c #97C197",
-"m@	c #97C297",
-"n@	c #97C397",
-"o@	c #97C497",
-"p@	c #97C597",
-"q@	c #97C697",
-"r@	c #97C797",
-"s@	c #97C897",
-"t@	c #97C997",
-"u@	c #85B195",
-"v@	c #080A81",
-"w@	c #6B9290",
-"x@	c #97CE97",
-"y@	c #97CF97",
-"z@	c #97D097",
-"A@	c #97D197",
-"B@	c #97D297",
-"C@	c #92D192",
-"D@	c #24A224",
-"E@	c #009300",
-"F@	c #009400",
-"G@	c #599B59",
-"H@	c #93BE93",
-"I@	c #93BF93",
-"J@	c #93C193",
-"K@	c #93C293",
-"L@	c #93C393",
-"M@	c #93C493",
-"N@	c #93C593",
-"O@	c #93C693",
-"P@	c #93C793",
-"Q@	c #93C893",
-"R@	c #273585",
-"S@	c #0F1582",
-"T@	c #8BC192",
-"U@	c #93CD93",
-"V@	c #93CE93",
-"W@	c #93CF93",
-"X@	c #93D093",
-"Y@	c #93D193",
-"Z@	c #8ACE8A",
-"`@	c #1AA01A",
-" #	c #009500",
-".#	c #009600",
-"+#	c #499249",
-"@#	c #8EBC8E",
-"##	c #8EBD8E",
-"$#	c #8EBE8E",
-"%#	c #8EBF8E",
-"&#	c #8EC08E",
-"*#	c #8EC18E",
-"=#	c #8EC28E",
-"-#	c #8EC38E",
-";#	c #8EC48E",
-">#	c #8EC58E",
-",#	c #82B58D",
-"'#	c #648E8A",
-")#	c #8ECB8E",
-"!#	c #8ECC8E",
-"~#	c #8ECD8E",
-"{#	c #8ECE8E",
-"]#	c #8ECF8E",
-"^#	c #8ED08E",
-"/#	c #80CB80",
-"(#	c #129D12",
-"_#	c #009700",
-":#	c #009800",
-"<#	c #398939",
-"[#	c #89B989",
-"}#	c #89BA89",
-"|#	c #89BB89",
-"1#	c #89BC89",
-"2#	c #89BD89",
-"3#	c #89BE89",
-"4#	c #89BF89",
-"5#	c #89C089",
-"6#	c #89C189",
-"7#	c #89C289",
-"8#	c #89C389",
-"9#	c #638D87",
-"0#	c #446484",
-"a#	c #89C989",
-"b#	c #89CA89",
-"c#	c #89CB89",
-"d#	c #89CC89",
-"e#	c #89CD89",
-"f#	c #89CE89",
-"g#	c #89CF89",
-"h#	c #75C775",
-"i#	c #0B9D0B",
-"j#	c #009900",
-"k#	c #009A00",
-"l#	c #2C822C",
-"m#	c #84B784",
-"n#	c #85B785",
-"o#	c #85B885",
-"p#	c #85B985",
-"q#	c #85BA85",
-"r#	c #85BB85",
-"s#	c #85BC85",
-"t#	c #85BD85",
-"u#	c #85BE85",
-"v#	c #85BF85",
-"w#	c #85C085",
-"x#	c #85C185",
-"y#	c #85C285",
-"z#	c #456483",
-"A#	c #283C82",
-"B#	c #85C885",
-"C#	c #85C985",
-"D#	c #85CA85",
-"E#	c #85CB85",
-"F#	c #85CC85",
-"G#	c #85CD85",
-"H#	c #85CE85",
-"I#	c #6AC46A",
-"J#	c #069C06",
-"K#	c #009B00",
-"L#	c #217C21",
-"M#	c #7DB37D",
-"N#	c #80B580",
-"O#	c #80B680",
-"P#	c #80B780",
-"Q#	c #80B880",
-"R#	c #80B980",
-"S#	c #80BA80",
-"T#	c #80BB80",
-"U#	c #80BC80",
-"V#	c #80BD80",
-"W#	c #80BE80",
-"X#	c #80BF80",
-"Y#	c #80C080",
-"Z#	c #293E80",
-"`#	c #0D1480",
-" $	c #80C680",
-".$	c #80C780",
-"+$	c #80C880",
-"@$	c #80C980",
-"#$	c #80CA80",
-"$$	c #80CC80",
-"%$	c #80CD80",
-"&$	c #5EC05E",
-"*$	c #039D03",
-"=$	c #009D00",
-"-$	c #187818",
-";$	c #74AE74",
-">$	c #7BB27B",
-",$	c #7BB37B",
-"'$	c #7BB47B",
-")$	c #7BB57B",
-"!$	c #7BB67B",
-"~$	c #7BB77B",
-"{$	c #7BB87B",
-"]$	c #7BB97B",
-"^$	c #7BBA7B",
-"/$	c #7BBB7B",
-"($	c #7BBC7B",
-"_$	c #7BBD7B",
-":$	c #7BBE7B",
-"<$	c #2F497E",
-"[$	c #14207F",
-"}$	c #7BC57B",
-"|$	c #7BC67B",
-"1$	c #7BC77B",
-"2$	c #7BC87B",
-"3$	c #7BC97B",
-"4$	c #7BCA7B",
-"5$	c #7BCB7B",
-"6$	c #7BCC7B",
-"7$	c #51BD51",
-"8$	c #019E01",
-"9$	c #009F00",
-"0$	c #066E06",
-"a$	c #68A768",
-"b$	c #77B177",
-"c$	c #77B277",
-"d$	c #77B377",
-"e$	c #77B477",
-"f$	c #77B577",
-"g$	c #77B677",
-"h$	c #77B777",
-"i$	c #77B877",
-"j$	c #77B977",
-"k$	c #77BA77",
-"l$	c #77BB77",
-"m$	c #77BC77",
-"n$	c #77BD77",
-"o$	c #466F7B",
-"p$	c #2B477C",
-"q$	c #77C477",
-"r$	c #77C577",
-"s$	c #77C677",
-"t$	c #77C777",
-"u$	c #77C877",
-"v$	c #77C977",
-"w$	c #77CA77",
-"x$	c #77CB77",
-"y$	c #77CC77",
-"z$	c #35B435",
-"A$	c #00A000",
-"B$	c #00A100",
-"C$	c #449344",
-"D$	c #72AE72",
-"E$	c #72AF72",
-"F$	c #72B072",
-"G$	c #72B172",
-"H$	c #72B272",
-"I$	c #72B372",
-"J$	c #72B472",
-"K$	c #72B572",
-"L$	c #72B672",
-"M$	c #72B772",
-"N$	c #72B872",
-"O$	c #72B972",
-"P$	c #72BA72",
-"Q$	c #72BB72",
-"R$	c #72BC72",
-"S$	c #5B9675",
-"T$	c #416E78",
-"U$	c #72C272",
-"V$	c #72C372",
-"W$	c #72C472",
-"X$	c #72C572",
-"Y$	c #72C672",
-"Z$	c #72C772",
-"`$	c #72C872",
-" %	c #72C972",
-".%	c #72CA72",
-"+%	c #6ECA6E",
-"@%	c #11A811",
-"#%	c #00A200",
-"$%	c #00A300",
-"%%	c #1D7E1D",
-"&%	c #6DAB6D",
-"*%	c #6DAC6D",
-"=%	c #6DAD6D",
-"-%	c #6DAE6D",
-";%	c #6DAF6D",
-">%	c #6DB06D",
-",%	c #6DB16D",
-"'%	c #6DB26D",
-")%	c #6DB36D",
-"!%	c #6DB46D",
-"~%	c #6DB56D",
-"{%	c #6DB66D",
-"]%	c #6DB76D",
-"^%	c #6DB86D",
-"/%	c #6DB96D",
-"(%	c #6DBA6D",
-"_%	c #6AB66D",
-":%	c #03067F",
-"<%	c #549571",
-"[%	c #6DC16D",
-"}%	c #6DC26D",
-"|%	c #6DC36D",
-"1%	c #6DC46D",
-"2%	c #6DC56D",
-"3%	c #6DC66D",
-"4%	c #6DC76D",
-"5%	c #6DC86D",
-"6%	c #6DC96D",
-"7%	c #6DCA6D",
-"8%	c #54C154",
-"9%	c #01A301",
-"0%	c #00A400",
-"a%	c #00A500",
-"b%	c #057105",
-"c%	c #5DA35D",
-"d%	c #69AA69",
-"e%	c #69AB69",
-"f%	c #69AC69",
-"g%	c #69AD69",
-"h%	c #69AE69",
-"i%	c #69AF69",
-"j%	c #69B069",
-"k%	c #69B169",
-"l%	c #69B269",
-"m%	c #69B369",
-"n%	c #69B469",
-"o%	c #69B569",
-"p%	c #69B669",
-"q%	c #69B769",
-"r%	c #69B869",
-"s%	c #69B969",
-"t%	c #386274",
-"u%	c #1C3479",
-"v%	c #69C069",
-"w%	c #69C169",
-"x%	c #69C269",
-"y%	c #69C369",
-"z%	c #69C469",
-"A%	c #69C569",
-"B%	c #69C669",
-"C%	c #69C769",
-"D%	c #69C869",
-"E%	c #69C969",
-"F%	c #2EB52E",
-"G%	c #00A600",
-"H%	c #378E37",
-"I%	c #64A764",
-"J%	c #64A864",
-"K%	c #64A964",
-"L%	c #64AA64",
-"M%	c #64AB64",
-"N%	c #64AC64",
-"O%	c #64AD64",
-"P%	c #64AE64",
-"Q%	c #64AF64",
-"R%	c #64B064",
-"S%	c #64B164",
-"T%	c #64B264",
-"U%	c #64B364",
-"V%	c #64B464",
-"W%	c #64B564",
-"X%	c #64B664",
-"Y%	c #64B764",
-"Z%	c #63B665",
-"`%	c #16287A",
-" &	c #050A7E",
-".&	c #59A868",
-"+&	c #64BF64",
-"@&	c #64C064",
-"#&	c #64C164",
-"$&	c #64C264",
-"%&	c #64C364",
-"&&	c #64C464",
-"*&	c #64C564",
-"=&	c #64C664",
-"-&	c #64C764",
-";&	c #64C864",
-">&	c #64C964",
-",&	c #60C760",
-"'&	c #09AA09",
-")&	c #00A700",
-"!&	c #00A800",
-"~&	c #0A760A",
-"{&	c #5CA45C",
-"]&	c #5FA65F",
-"^&	c #5FA75F",
-"/&	c #5FA85F",
-"(&	c #5FA95F",
-"_&	c #5FAA5F",
-":&	c #5FAB5F",
-"<&	c #5FAC5F",
-"[&	c #5FAD5F",
-"}&	c #5FAE5F",
-"|&	c #5FAF5F",
-"1&	c #5FB05F",
-"2&	c #5FB15F",
-"3&	c #5FB25F",
-"4&	c #5FB35F",
-"5&	c #5FB45F",
-"6&	c #5FB55F",
-"7&	c #5FB65F",
-"8&	c #519C64",
-"9&	c #03067E",
-"0&	c #3B746C",
-"a&	c #5FBD5F",
-"b&	c #5FBE5F",
-"c&	c #5FBF5F",
-"d&	c #5FC05F",
-"e&	c #5FC15F",
-"f&	c #5FC25F",
-"g&	c #5FC35F",
-"h&	c #5FC45F",
-"i&	c #5FC55F",
-"j&	c #5FC65F",
-"k&	c #5FC75F",
-"l&	c #5FC85F",
-"m&	c #37BB37",
-"n&	c #00A900",
-"o&	c #389038",
-"p&	c #5BA45B",
-"q&	c #5BA55B",
-"r&	c #5BA65B",
-"s&	c #5BA75B",
-"t&	c #5BA85B",
-"u&	c #5BA95B",
-"v&	c #5BAA5B",
-"w&	c #5BAB5B",
-"x&	c #5BAC5B",
-"y&	c #5BAD5B",
-"z&	c #5BAE5B",
-"A&	c #5BAF5B",
-"B&	c #5BB05B",
-"C&	c #5BB15B",
-"D&	c #5BB25B",
-"E&	c #5BB35B",
-"F&	c #5BB45B",
-"G&	c #5BB55B",
-"H&	c #5BB65B",
-"I&	c #448865",
-"J&	c #0A157B",
-"K&	c #32676B",
-"L&	c #5BBB5B",
-"M&	c #5BBC5B",
-"N&	c #5BBD5B",
-"O&	c #5BBE5B",
-"P&	c #5BBF5B",
-"Q&	c #5BC05B",
-"R&	c #5BC15B",
-"S&	c #5BC25B",
-"T&	c #5BC35B",
-"U&	c #5BC45B",
-"V&	c #5BC55B",
-"W&	c #5BC65B",
-"X&	c #5BC75B",
-"Y&	c #5BC85B",
-"Z&	c #59C759",
-"`&	c #0CAE0C",
-" *	c #00AB00",
-".*	c #0D790D",
-"+*	c #55A155",
-"@*	c #56A256",
-"#*	c #56A356",
-"$*	c #56A456",
-"%*	c #56A556",
-"&*	c #56A656",
-"**	c #56A756",
-"=*	c #56A856",
-"-*	c #56A956",
-";*	c #56AA56",
-">*	c #56AB56",
-",*	c #56AC56",
-"'*	c #56AD56",
-")*	c #56AE56",
-"!*	c #56AF56",
-"~*	c #56B056",
-"{*	c #56B156",
-"]*	c #56B256",
-"^*	c #56B356",
-"/*	c #56B456",
-"(*	c #56B556",
-"_*	c #51AA59",
-":*	c #1F4171",
-"<*	c #132877",
-"[*	c #499D5D",
-"}*	c #56BA56",
-"|*	c #56BB56",
-"1*	c #56BC56",
-"2*	c #56BD56",
-"3*	c #56BE56",
-"4*	c #56BF56",
-"5*	c #56C056",
-"6*	c #56C156",
-"7*	c #56C256",
-"8*	c #56C356",
-"9*	c #56C456",
-"0*	c #56C556",
-"a*	c #56C656",
-"b*	c #56C756",
-"c*	c #37BD37",
-"d*	c #00AC00",
-"e*	c #00AD00",
-"f*	c #359035",
-"g*	c #51A051",
-"h*	c #51A151",
-"i*	c #51A251",
-"j*	c #51A351",
-"k*	c #51A451",
-"l*	c #51A551",
-"m*	c #51A651",
-"n*	c #51A751",
-"o*	c #51A851",
-"p*	c #51A951",
-"q*	c #51AA51",
-"r*	c #51AB51",
-"s*	c #51AC51",
-"t*	c #51AD51",
-"u*	c #51AE51",
-"v*	c #51AF51",
-"w*	c #51B051",
-"x*	c #51B151",
-"y*	c #51B251",
-"z*	c #51B351",
-"A*	c #51B451",
-"B*	c #51B551",
-"C*	c #3A815F",
-"D*	c #224D6C",
-"E*	c #112676",
-"F*	c #02047F",
-"G*	c #01037F",
-"H*	c #0E2077",
-"I*	c #1E456E",
-"J*	c #327163",
-"K*	c #50B652",
-"L*	c #51B951",
-"M*	c #51BA51",
-"N*	c #51BB51",
-"O*	c #51BC51",
-"P*	c #51BE51",
-"Q*	c #51BF51",
-"R*	c #51C051",
-"S*	c #51C151",
-"T*	c #51C251",
-"U*	c #51C351",
-"V*	c #51C451",
-"W*	c #51C551",
-"X*	c #51C651",
-"Y*	c #50C750",
-"Z*	c #0DB10D",
-"`*	c #00AE00",
-" =	c #00AF00",
-".=	c #067706",
-"+=	c #4B9E4B",
-"@=	c #4D9F4D",
-"#=	c #4DA04D",
-"$=	c #4DA14D",
-"%=	c #4DA24D",
-"&=	c #4DA34D",
-"*=	c #4DA44D",
-"==	c #4DA54D",
-"-=	c #4DA64D",
-";=	c #4DA74D",
-">=	c #4DA84D",
-",=	c #4DA94D",
-"'=	c #4DAA4D",
-")=	c #4DAB4D",
-"!=	c #4DAC4D",
-"~=	c #4DAD4D",
-"{=	c #4DAE4D",
-"]=	c #4DAF4D",
-"^=	c #4DB04D",
-"/=	c #4DB14D",
-"(=	c #4DB24D",
-"_=	c #4DB34D",
-":=	c #4DB44D",
-"<=	c #4DB54D",
-"[=	c #4BB04F",
-"}=	c #409855",
-"|=	c #4AB04F",
-"1=	c #4DB64D",
-"2=	c #4DB74D",
-"3=	c #4DB84D",
-"4=	c #4DB94D",
-"5=	c #4DBA4D",
-"6=	c #4DBB4D",
-"7=	c #4DBC4D",
-"8=	c #4DBD4D",
-"9=	c #4DBE4D",
-"0=	c #4DBF4D",
-"a=	c #4DC04D",
-"b=	c #4DC14D",
-"c=	c #4DC24D",
-"d=	c #4DC34D",
-"e=	c #4DC44D",
-"f=	c #4DC54D",
-"g=	c #4DC64D",
-"h=	c #2CBD2C",
-"i=	c #00B000",
-"j=	c #218721",
-"k=	c #489D48",
-"l=	c #489E48",
-"m=	c #489F48",
-"n=	c #48A048",
-"o=	c #48A148",
-"p=	c #48A248",
-"q=	c #48A348",
-"r=	c #48A448",
-"s=	c #48A548",
-"t=	c #48A648",
-"u=	c #48A748",
-"v=	c #48A848",
-"w=	c #48A948",
-"x=	c #48AA48",
-"y=	c #48AB48",
-"z=	c #48AC48",
-"A=	c #48AD48",
-"B=	c #48AE48",
-"C=	c #48AF48",
-"D=	c #48B048",
-"E=	c #48B148",
-"F=	c #48B248",
-"G=	c #48B348",
-"H=	c #48B448",
-"I=	c #48B548",
-"J=	c #48B648",
-"K=	c #48B748",
-"L=	c #48B848",
-"M=	c #48B948",
-"N=	c #48BA48",
-"O=	c #48BB48",
-"P=	c #48BC48",
-"Q=	c #48BD48",
-"R=	c #48BE48",
-"S=	c #48BF48",
-"T=	c #48C048",
-"U=	c #48C148",
-"V=	c #48C248",
-"W=	c #48C348",
-"X=	c #48C448",
-"Y=	c #48C548",
-"Z=	c #48C648",
-"`=	c #43C543",
-" -	c #03B203",
-".-	c #00B100",
-"+-	c #00B200",
-"@-	c #399539",
-"#-	c #439B43",
-"$-	c #439C43",
-"%-	c #439D43",
-"&-	c #439E43",
-"*-	c #439F43",
-"=-	c #43A043",
-"--	c #43A143",
-";-	c #43A243",
-">-	c #43A343",
-",-	c #43A443",
-"'-	c #43A543",
-")-	c #43A643",
-"!-	c #43A743",
-"~-	c #43A843",
-"{-	c #43A943",
-"]-	c #43AA43",
-"^-	c #43AB43",
-"/-	c #43AC43",
-"(-	c #43AD43",
-"_-	c #43AE43",
-":-	c #43AF43",
-"<-	c #43B043",
-"[-	c #43B143",
-"}-	c #43B243",
-"|-	c #43B343",
-"1-	c #43B443",
-"2-	c #43B543",
-"3-	c #43B643",
-"4-	c #43B743",
-"5-	c #43B843",
-"6-	c #43B943",
-"7-	c #43BA43",
-"8-	c #43BB43",
-"9-	c #43BC43",
-"0-	c #43BD43",
-"a-	c #43BE43",
-"b-	c #43BF43",
-"c-	c #43C043",
-"d-	c #43C143",
-"e-	c #43C243",
-"f-	c #43C343",
-"g-	c #43C443",
-"h-	c #19BA19",
-"i-	c #00B300",
-"j-	c #107F10",
-"k-	c #3F993F",
-"l-	c #3F9A3F",
-"m-	c #3F9C3F",
-"n-	c #3F9D3F",
-"o-	c #3F9E3F",
-"p-	c #3F9F3F",
-"q-	c #3FA03F",
-"r-	c #3FA13F",
-"s-	c #3FA23F",
-"t-	c #3FA33F",
-"u-	c #3FA43F",
-"v-	c #3FA53F",
-"w-	c #3FA63F",
-"x-	c #3FA73F",
-"y-	c #3FA83F",
-"z-	c #3FA93F",
-"A-	c #3FAA3F",
-"B-	c #3FAB3F",
-"C-	c #3FAC3F",
-"D-	c #3FAD3F",
-"E-	c #3FAE3F",
-"F-	c #3FAF3F",
-"G-	c #3FB03F",
-"H-	c #3FB13F",
-"I-	c #3FB23F",
-"J-	c #3FB33F",
-"K-	c #3FB43F",
-"L-	c #3FB53F",
-"M-	c #3FB63F",
-"N-	c #3FB73F",
-"O-	c #3FB83F",
-"P-	c #3FB93F",
-"Q-	c #3FBA3F",
-"R-	c #3FBB3F",
-"S-	c #3FBC3F",
-"T-	c #3FBD3F",
-"U-	c #3FBE3F",
-"V-	c #3FBF3F",
-"W-	c #3FC03F",
-"X-	c #3FC13F",
-"Y-	c #3FC23F",
-"Z-	c #3FC33F",
-"`-	c #3FC43F",
-" ;	c #3FC53F",
-".;	c #3FC63F",
-"+;	c #31C231",
-"@;	c #00B400",
-"#;	c #00B500",
-"$;	c #228B22",
-"%;	c #3A973A",
-"&;	c #3A983A",
-"*;	c #3A993A",
-"=;	c #3A9A3A",
-"-;	c #3A9B3A",
-";;	c #3A9C3A",
-">;	c #3A9D3A",
-",;	c #3A9E3A",
-"';	c #3A9F3A",
-");	c #3AA13A",
-"!;	c #3AA23A",
-"~;	c #3AA33A",
-"{;	c #3AA43A",
-"];	c #3AA53A",
-"^;	c #3AA63A",
-"/;	c #3AA73A",
-"(;	c #3AA83A",
-"_;	c #3AA93A",
-":;	c #3AAA3A",
-"<;	c #3AAB3A",
-"[;	c #3AAC3A",
-"};	c #3AAD3A",
-"|;	c #3AAE3A",
-"1;	c #3AAF3A",
-"2;	c #3AB03A",
-"3;	c #3AB13A",
-"4;	c #3AB23A",
-"5;	c #3AB33A",
-"6;	c #3AB43A",
-"7;	c #3AB53A",
-"8;	c #3AB63A",
-"9;	c #3AB73A",
-"0;	c #3AB83A",
-"a;	c #3AB93A",
-"b;	c #3ABA3A",
-"c;	c #3ABB3A",
-"d;	c #3ABC3A",
-"e;	c #3ABD3A",
-"f;	c #3ABE3A",
-"g;	c #3ABF3A",
-"h;	c #3AC03A",
-"i;	c #3AC13A",
-"j;	c #3AC23A",
-"k;	c #3AC33A",
-"l;	c #3AC43A",
-"m;	c #3AC53A",
-"n;	c #3AC63A",
-"o;	c #07B707",
-"p;	c #00B600",
-"q;	c #2F922F",
-"r;	c #359635",
-"s;	c #359735",
-"t;	c #359835",
-"u;	c #359935",
-"v;	c #359A35",
-"w;	c #359B35",
-"x;	c #359C35",
-"y;	c #359D35",
-"z;	c #359E35",
-"A;	c #359F35",
-"B;	c #35A035",
-"C;	c #35A135",
-"D;	c #35A235",
-"E;	c #35A335",
-"F;	c #35A435",
-"G;	c #35A535",
-"H;	c #35A635",
-"I;	c #35A735",
-"J;	c #35A835",
-"K;	c #35A935",
-"L;	c #35AA35",
-"M;	c #35AB35",
-"N;	c #35AC35",
-"O;	c #35AD35",
-"P;	c #35AE35",
-"Q;	c #35AF35",
-"R;	c #35B035",
-"S;	c #35B135",
-"T;	c #35B235",
-"U;	c #35B335",
-"V;	c #35B535",
-"W;	c #35B635",
-"X;	c #35B735",
-"Y;	c #35B835",
-"Z;	c #35B935",
-"`;	c #35BA35",
-" >	c #35BB35",
-".>	c #35BC35",
-"+>	c #35BD35",
-"@>	c #35BE35",
-"#>	c #35BF35",
-"$>	c #35C035",
-"%>	c #35C135",
-"&>	c #35C235",
-"*>	c #35C335",
-"=>	c #35C435",
-"->	c #35C535",
-";>	c #15BD15",
-">>	c #00B700",
-",>	c #00B800",
-"'>	c #087F08",
-")>	c #319531",
-"!>	c #319631",
-"~>	c #319731",
-"{>	c #319831",
-"]>	c #319931",
-"^>	c #319A31",
-"/>	c #319B31",
-"(>	c #319C31",
-"_>	c #319D31",
-":>	c #319E31",
-"<>	c #319F31",
-"[>	c #31A031",
-"}>	c #31A131",
-"|>	c #31A231",
-"1>	c #31A331",
-"2>	c #31A431",
-"3>	c #31A531",
-"4>	c #31A631",
-"5>	c #31A731",
-"6>	c #31A831",
-"7>	c #31A931",
-"8>	c #31AA31",
-"9>	c #31AB31",
-"0>	c #31AC31",
-"a>	c #31AD31",
-"b>	c #31AE31",
-"c>	c #31AF31",
-"d>	c #31B031",
-"e>	c #31B131",
-"f>	c #31B231",
-"g>	c #31B331",
-"h>	c #31B431",
-"i>	c #31B531",
-"j>	c #31B631",
-"k>	c #31B731",
-"l>	c #31B831",
-"m>	c #31B931",
-"n>	c #31BA31",
-"o>	c #31BB31",
-"p>	c #31BC31",
-"q>	c #31BD31",
-"r>	c #31BE31",
-"s>	c #31BF31",
-"t>	c #31C031",
-"u>	c #31C131",
-"v>	c #31C331",
-"w>	c #31C431",
-"x>	c #31C531",
-"y>	c #22C122",
-"z>	c #00B900",
-"A>	c #00BA00",
-"B>	c #148614",
-"C>	c #2C932C",
-"D>	c #2C942C",
-"E>	c #2C952C",
-"F>	c #2C962C",
-"G>	c #2C972C",
-"H>	c #2C982C",
-"I>	c #2C992C",
-"J>	c #2C9A2C",
-"K>	c #2C9B2C",
-"L>	c #2C9C2C",
-"M>	c #2C9D2C",
-"N>	c #2C9E2C",
-"O>	c #2C9F2C",
-"P>	c #2CA02C",
-"Q>	c #2CA12C",
-"R>	c #2CA22C",
-"S>	c #2CA32C",
-"T>	c #2CA42C",
-"U>	c #2CA52C",
-"V>	c #2CA62C",
-"W>	c #2CA72C",
-"X>	c #2CA82C",
-"Y>	c #2CA92C",
-"Z>	c #2CAA2C",
-"`>	c #2CAB2C",
-" ,	c #2CAC2C",
-".,	c #2CAD2C",
-"+,	c #2CAE2C",
-"@,	c #2CAF2C",
-"#,	c #2CB02C",
-"$,	c #2CB12C",
-"%,	c #2CB22C",
-"&,	c #2CB32C",
-"*,	c #2CB42C",
-"=,	c #2CB52C",
-"-,	c #2CB62C",
-";,	c #2CB72C",
-">,	c #2CB82C",
-",,	c #2CB92C",
-"',	c #2CBA2C",
-"),	c #2CBB2C",
-"!,	c #2CBC2C",
-"~,	c #2CBE2C",
-"{,	c #2CBF2C",
-"],	c #2CC02C",
-"^,	c #2CC12C",
-"/,	c #2CC22C",
-"(,	c #2CC32C",
-"_,	c #2CC42C",
-":,	c #2CC52C",
-"<,	c #2AC42A",
-"[,	c #01BA01",
-"},	c #00BB00",
-"|,	c #1D8D1D",
-"1,	c #279227",
-"2,	c #279327",
-"3,	c #279427",
-"4,	c #279527",
-"5,	c #279627",
-"6,	c #279727",
-"7,	c #279827",
-"8,	c #279927",
-"9,	c #279A27",
-"0,	c #279B27",
-"a,	c #279C27",
-"b,	c #279D27",
-"c,	c #279E27",
-"d,	c #279F27",
-"e,	c #27A027",
-"f,	c #27A127",
-"g,	c #27A227",
-"h,	c #27A327",
-"i,	c #27A427",
-"j,	c #27A527",
-"k,	c #27A627",
-"l,	c #27A727",
-"m,	c #27A827",
-"n,	c #27A927",
-"o,	c #27AA27",
-"p,	c #27AB27",
-"q,	c #27AC27",
-"r,	c #27AD27",
-"s,	c #27AE27",
-"t,	c #27AF27",
-"u,	c #27B027",
-"v,	c #27B127",
-"w,	c #27B227",
-"x,	c #27B327",
-"y,	c #27B427",
-"z,	c #27B527",
-"A,	c #27B627",
-"B,	c #27B727",
-"C,	c #27B827",
-"D,	c #27B927",
-"E,	c #27BA27",
-"F,	c #27BB27",
-"G,	c #27BC27",
-"H,	c #27BD27",
-"I,	c #27BE27",
-"J,	c #27BF27",
-"K,	c #27C027",
-"L,	c #27C127",
-"M,	c #27C227",
-"N,	c #27C327",
-"O,	c #27C427",
-"P,	c #27C527",
-"Q,	c #09BE09",
-"R,	c #00BC00",
-"S,	c #00BD00",
-"T,	c #219021",
-"U,	c #239123",
-"V,	c #239223",
-"W,	c #239323",
-"X,	c #239423",
-"Y,	c #239523",
-"Z,	c #239623",
-"`,	c #239723",
-" '	c #239823",
-".'	c #239923",
-"+'	c #239A23",
-"@'	c #239B23",
-"#'	c #239C23",
-"$'	c #239D23",
-"%'	c #239E23",
-"&'	c #239F23",
-"*'	c #23A023",
-"='	c #23A123",
-"-'	c #23A223",
-";'	c #23A323",
-">'	c #23A423",
-",'	c #23A523",
-"''	c #23A623",
-")'	c #23A723",
-"!'	c #23A823",
-"~'	c #23A923",
-"{'	c #23AA23",
-"]'	c #23AB23",
-"^'	c #23AC23",
-"/'	c #23AD23",
-"('	c #23AE23",
-"_'	c #23AF23",
-":'	c #23B023",
-"<'	c #23B123",
-"['	c #23B223",
-"}'	c #23B323",
-"|'	c #23B423",
-"1'	c #23B523",
-"2'	c #23B623",
-"3'	c #23B723",
-"4'	c #23B823",
-"5'	c #23B923",
-"6'	c #23BA23",
-"7'	c #23BB23",
-"8'	c #23BC23",
-"9'	c #23BD23",
-"0'	c #23BE23",
-"a'	c #23BF23",
-"b'	c #23C023",
-"c'	c #23C123",
-"d'	c #23C223",
-"e'	c #23C323",
-"f'	c #23C423",
-"g'	c #23C523",
-"h'	c #0FC10F",
-"i'	c #00BE00",
-"j'	c #038203",
-"k'	c #1E8F1E",
-"l'	c #1E901E",
-"m'	c #1E911E",
-"n'	c #1E921E",
-"o'	c #1E931E",
-"p'	c #1E941E",
-"q'	c #1E951E",
-"r'	c #1E961E",
-"s'	c #1E971E",
-"t'	c #1E981E",
-"u'	c #1E991E",
-"v'	c #1E9A1E",
-"w'	c #1E9B1E",
-"x'	c #1E9C1E",
-"y'	c #1E9D1E",
-"z'	c #1E9E1E",
-"A'	c #1E9F1E",
-"B'	c #1EA01E",
-"C'	c #1EA11E",
-"D'	c #1EA21E",
-"E'	c #1EA31E",
-"F'	c #1EA41E",
-"G'	c #1EA51E",
-"H'	c #1EA61E",
-"I'	c #1EA71E",
-"J'	c #1EA81E",
-"K'	c #1EA91E",
-"L'	c #1EAA1E",
-"M'	c #1EAB1E",
-"N'	c #1EAC1E",
-"O'	c #1EAD1E",
-"P'	c #1EAE1E",
-"Q'	c #1EAF1E",
-"R'	c #1EB01E",
-"S'	c #1EB11E",
-"T'	c #1EB21E",
-"U'	c #1EB31E",
-"V'	c #1EB41E",
-"W'	c #1EB51E",
-"X'	c #1EB61E",
-"Y'	c #1EB71E",
-"Z'	c #1EB81E",
-"`'	c #1EB91E",
-" )	c #1EBA1E",
-".)	c #1EBB1E",
-"+)	c #1EBC1E",
-"@)	c #1EBD1E",
-"#)	c #1EBE1E",
-"$)	c #1EBF1E",
-"%)	c #1EC01E",
-"&)	c #1EC11E",
-"*)	c #1EC21E",
-"=)	c #1EC31E",
-"-)	c #1EC41E",
-";)	c #1EC51E",
-">)	c #1EC61E",
-",)	c #12C312",
-"')	c #00BF00",
-"))	c #00C000",
-"!)	c #078407",
-"~)	c #198E19",
-"{)	c #198F19",
-"])	c #199019",
-"^)	c #199119",
-"/)	c #199219",
-"()	c #199319",
-"_)	c #199419",
-":)	c #199519",
-"<)	c #199619",
-"[)	c #199719",
-"})	c #199819",
-"|)	c #199919",
-"1)	c #199A19",
-"2)	c #199B19",
-"3)	c #199C19",
-"4)	c #199D19",
-"5)	c #199E19",
-"6)	c #199F19",
-"7)	c #19A019",
-"8)	c #19A119",
-"9)	c #19A219",
-"0)	c #19A319",
-"a)	c #19A419",
-"b)	c #19A519",
-"c)	c #19A619",
-"d)	c #19A719",
-"e)	c #19A819",
-"f)	c #19A71A",
-"g)	c #189F1F",
-"h)	c #169624",
-"i)	c #158E2A",
-"j)	c #148530",
-"k)	c #127D34",
-"l)	c #11743A",
-"m)	c #106C40",
-"n)	c #0E6245",
-"o)	c #0D5A4A",
-"p)	c #0C5150",
-"q)	c #0A4855",
-"r)	c #093F5B",
-"s)	c #083660",
-"t)	c #062D65",
-"u)	c #05246B",
-"v)	c #041A71",
-"w)	c #031375",
-"x)	c #18A720",
-"y)	c #19B219",
-"z)	c #19B319",
-"A)	c #19B419",
-"B)	c #19B519",
-"C)	c #19B619",
-"D)	c #19B719",
-"E)	c #19B819",
-"F)	c #19B919",
-"G)	c #19BB19",
-"H)	c #19BC19",
-"I)	c #19BD19",
-"J)	c #19BE19",
-"K)	c #19BF19",
-"L)	c #19C019",
-"M)	c #19C119",
-"N)	c #19C219",
-"O)	c #19C319",
-"P)	c #19C419",
-"Q)	c #19C519",
-"R)	c #13C413",
-"S)	c #00C100",
-"T)	c #098709",
-"U)	c #158D15",
-"V)	c #158E15",
-"W)	c #158F15",
-"X)	c #159015",
-"Y)	c #159115",
-"Z)	c #159215",
-"`)	c #159315",
-" !	c #159415",
-".!	c #159515",
-"+!	c #159615",
-"@!	c #159715",
-"#!	c #159815",
-"$!	c #159915",
-"%!	c #159A15",
-"&!	c #159B15",
-"*!	c #159C15",
-"=!	c #159D15",
-"-!	c #159E15",
-";!	c #159F15",
-">!	c #15A015",
-",!	c #13921E",
-"'!	c #0F7631",
-")!	c #0E6E37",
-"!!	c #0D663C",
-"~!	c #0C5D42",
-"{!	c #0B5548",
-"]!	c #0A4D4E",
-"^!	c #094453",
-"/!	c #083C59",
-"(!	c #07345F",
-"_!	c #052B64",
-":!	c #042369",
-"<!	c #03196F",
-"[!	c #021175",
-"}!	c #01087B",
-"|!	c #00017F",
-"1!	c #052A67",
-"2!	c #15B115",
-"3!	c #15B215",
-"4!	c #15B315",
-"5!	c #15B415",
-"6!	c #15B515",
-"7!	c #15B615",
-"8!	c #15B715",
-"9!	c #15B815",
-"0!	c #15B915",
-"a!	c #15BA15",
-"b!	c #15BB15",
-"c!	c #15BC15",
-"d!	c #15BE15",
-"e!	c #15BF15",
-"f!	c #15C015",
-"g!	c #15C115",
-"h!	c #15C215",
-"i!	c #15C315",
-"j!	c #15C415",
-"k!	c #15C515",
-"l!	c #14C614",
-"m!	c #00C200",
-"n!	c #00C300",
-"o!	c #098909",
-"p!	c #108D10",
-"q!	c #108E10",
-"r!	c #108F10",
-"s!	c #109010",
-"t!	c #109110",
-"u!	c #109210",
-"v!	c #109310",
-"w!	c #109410",
-"x!	c #109510",
-"y!	c #109610",
-"z!	c #109710",
-"A!	c #109810",
-"B!	c #109910",
-"C!	c #109A10",
-"D!	c #109B10",
-"E!	c #109C10",
-"F!	c #109D10",
-"G!	c #109E10",
-"H!	c #085246",
-"I!	c #095E45",
-"J!	c #10B110",
-"K!	c #10B210",
-"L!	c #10B310",
-"M!	c #10B410",
-"N!	c #10B510",
-"O!	c #10B610",
-"P!	c #10B710",
-"Q!	c #10B810",
-"R!	c #10B910",
-"S!	c #10BA10",
-"T!	c #10BB10",
-"U!	c #10BC10",
-"V!	c #10BD10",
-"W!	c #10BE10",
-"X!	c #10BF10",
-"Y!	c #10C010",
-"Z!	c #10C110",
-"`!	c #10C210",
-" ~	c #10C310",
-".~	c #10C410",
-"+~	c #10C510",
-"@~	c #10C610",
-"#~	c #01C301",
-"$~	c #00C400",
-"%~	c #078907",
-"&~	c #0B8B0B",
-"*~	c #0B8C0B",
-"=~	c #0B8D0B",
-"-~	c #0B8E0B",
-";~	c #0B8F0B",
-">~	c #0B900B",
-",~	c #0B910B",
-"'~	c #0B920B",
-")~	c #0B930B",
-"!~	c #0B940B",
-"~~	c #0B950B",
-"{~	c #0B960B",
-"]~	c #0B970B",
-"^~	c #0B980B",
-"/~	c #0B990B",
-"(~	c #0B9A0B",
-"_~	c #0B9B0B",
-":~	c #0B9C0B",
-"<~	c #0B9E0B",
-"[~	c #043B54",
-"}~	c #09921F",
-"|~	c #0BB10B",
-"1~	c #0BB20B",
-"2~	c #0BB30B",
-"3~	c #0BB40B",
-"4~	c #0BB50B",
-"5~	c #0BB60B",
-"6~	c #0BB70B",
-"7~	c #0BB80B",
-"8~	c #0BB90B",
-"9~	c #0BBA0B",
-"0~	c #0BBB0B",
-"a~	c #0BBC0B",
-"b~	c #0BBD0B",
-"c~	c #0BBE0B",
-"d~	c #0BBF0B",
-"e~	c #0BC00B",
-"f~	c #0BC10B",
-"g~	c #0BC20B",
-"h~	c #0BC30B",
-"i~	c #0BC40B",
-"j~	c #0BC50B",
-"k~	c #0BC60B",
-"l~	c #0BC70B",
-"m~	c #02C402",
-"n~	c #00C500",
-"o~	c #00C600",
-"p~	c #058905",
-"q~	c #078A07",
-"r~	c #078B07",
-"s~	c #078C07",
-"t~	c #078D07",
-"u~	c #078E07",
-"v~	c #078F07",
-"w~	c #079007",
-"x~	c #079107",
-"y~	c #079207",
-"z~	c #079307",
-"A~	c #079407",
-"B~	c #079507",
-"C~	c #079607",
-"D~	c #079707",
-"E~	c #079807",
-"F~	c #079907",
-"G~	c #079A07",
-"H~	c #079B07",
-"I~	c #079C07",
-"J~	c #079D07",
-"K~	c #079E07",
-"L~	c #022365",
-"M~	c #011571",
-"N~	c #07B007",
-"O~	c #07B107",
-"P~	c #07B207",
-"Q~	c #07B307",
-"R~	c #07B407",
-"S~	c #07B507",
-"T~	c #07B607",
-"U~	c #07B807",
-"V~	c #07B907",
-"W~	c #07BA07",
-"X~	c #07BB07",
-"Y~	c #07BC07",
-"Z~	c #07BD07",
-"`~	c #07BE07",
-" {	c #07BF07",
-".{	c #07C007",
-"+{	c #07C107",
-"@{	c #07C207",
-"#{	c #07C307",
-"${	c #07C407",
-"%{	c #07C507",
-"&{	c #07C607",
-"*{	c #07C707",
-"={	c #02C502",
-"-{	c #00C700",
-";{	c #028902",
-">{	c #028A02",
-",{	c #028B02",
-"'{	c #028C02",
-"){	c #028D02",
-"!{	c #028E02",
-"~{	c #028F02",
-"{{	c #029002",
-"]{	c #029102",
-"^{	c #029202",
-"/{	c #029302",
-"({	c #029402",
-"_{	c #029502",
-":{	c #029602",
-"<{	c #029702",
-"[{	c #029802",
-"}{	c #029902",
-"|{	c #029A02",
-"1{	c #029B02",
-"2{	c #029C02",
-"3{	c #029D02",
-"4{	c #000C76",
-"5{	c #01494C",
-"6{	c #02B002",
-"7{	c #02B102",
-"8{	c #02B202",
-"9{	c #02B302",
-"0{	c #02B402",
-"a{	c #02B502",
-"b{	c #02B602",
-"c{	c #02B702",
-"d{	c #02B802",
-"e{	c #02B902",
-"f{	c #02BA02",
-"g{	c #02BB02",
-"h{	c #02BC02",
-"i{	c #02BD02",
-"j{	c #02BE02",
-"k{	c #02BF02",
-"l{	c #02C002",
-"m{	c #02C102",
-"n{	c #02C202",
-"o{	c #02C302",
-"p{	c #02C602",
-"q{	c #01C701",
-"r{	c #00C800",
-"s{	c #00C900",
-"t{	c #009C00",
-"u{	c #009309",
-"v{	c #007E25",
-"w{	c #00CA00",
-"x{	c #00CB00",
-"y{	c #009E00",
-"z{	c #00910C",
-"A{	c #005040",
-"B{	c #004B44",
-"C{	c #00454A",
-"D{	c #003E4F",
-"E{	c #00305A",
-"F{	c #000A78",
-"G{	c #00077B",
-"H{	c #00AB04",
-"I{	c #00CC00",
-"J{	c #00A302",
-"K{	c #007C20",
-"L{	c #000E75",
-"M{	c #003659",
-"N{	c #00CD00",
-"O{	c #00801E",
-"P{	c #006B34",
-"Q{	c #00CE00",
-"R{	c #00CF00",
-"S{	c #00A602",
-"T{	c #00057C",
-"U{	c #00A10E",
-"V{	c #00D000",
-"W{	c #00AA00",
-"X{	c #000F74",
-"Y{	c #002268",
-"Z{	c #00D100",
-"`{	c #00980F",
-" ]	c #005842",
-".]	c #00D200",
-"+]	c #00D300",
-"@]	c #00722C",
-"#]	c #008F1D",
-"$]	c #00D400",
-"%]	c #004B49",
-"&]	c #000F76",
-"*]	c #00B901",
-"=]	c #00D500",
-"-]	c #002466",
-";]	c #004451",
-">]	c #00D600",
-",]	c #00D700",
-"']	c #00AA05",
-")]	c #00037E",
-"!]	c #007D2B",
-"~]	c #00D800",
-"{]	c #00871F",
-"]]	c #00B208",
-"^]	c #00D900",
-"/]	c #00DA00",
-"(]	c #005F3C",
-"_]	c #003060",
-":]	c #00DB00",
-"<]	c #00355A",
-"[]	c #00683A",
-"}]	c #00DC00",
-"|]	c #00AF05",
-"1]	c #00A314",
-"2]	c #00DD00",
-"3]	c #00DE00",
-"4]	c #008126",
-"5]	c #001A6F",
-"6]	c #00DF00",
-"7]	c #004A4C",
-"8]	c #005449",
-"9]	c #00E000",
-"0]	c #001472",
-"a]	c #008E23",
-"b]	c #009619",
-"c]	c #00097A",
-"d]	c #00C103",
-"e]	c #005F3F",
-"f]	c #003E58",
-"g]	c #002766",
-"h]	c #007A32",
-"i]	c #00AB0D",
-"j]	c #00B50D",
-"k]	c #007432",
-"l]	c #002866",
-"m]	c #003B59",
-"n]	c #006441",
-"o]	c #00BB04",
-"p]	c #00087B",
-"q]	c #010180",
-"r]	c #020281",
-"s]	c #02A31D",
-"t]	c #01CD01",
-"u]	c #01CE01",
-"v]	c #01CF01",
-"w]	c #01D001",
-"x]	c #01C101",
-"y]	c #01C201",
-"z]	c #028B28",
-"A]	c #030381",
-"B]	c #040482",
-"C]	c #050582",
-"D]	c #060683",
-"E]	c #051877",
-"F]	c #05CE06",
-"G]	c #05D005",
-"H]	c #05D105",
-"I]	c #04D104",
-"J]	c #04D204",
-"K]	c #04D304",
-"L]	c #03D403",
-"M]	c #02D402",
-"N]	c #01D501",
-"O]	c #01D601",
-"P]	c #01BF01",
-"Q]	c #01C001",
-"R]	c #03C203",
-"S]	c #03C303",
-"T]	c #04C304",
-"U]	c #04C404",
-"V]	c #05C405",
-"W]	c #05534F",
-"X]	c #070783",
-"Y]	c #080884",
-"Z]	c #090984",
-"`]	c #095555",
-" ^	c #09D109",
-".^	c #09D209",
-"+^	c #09D309",
-"@^	c #08D208",
-"#^	c #08D308",
-"$^	c #07D407",
-"%^	c #07D507",
-"&^	c #06D606",
-"*^	c #05D705",
-"=^	c #04D804",
-"-^	c #04D904",
-";^	c #03D803",
-">^	c #03D903",
-",^	c #02D902",
-"'^	c #01DA01",
-")^	c #01BE01",
-"!^	c #03C103",
-"~^	c #04C204",
-"{^	c #05C205",
-"]^	c #05C305",
-"^^	c #06C306",
-"/^	c #08C608",
-"(^	c #08C708",
-"_^	c #091E77",
-":^	c #0A0A85",
-"<^	c #0B0B85",
-"[^	c #0C0C86",
-"}^	c #0D0D86",
-"|^	c #0D9235",
-"1^	c #0DD30D",
-"2^	c #0CD30C",
-"3^	c #0CD40C",
-"4^	c #0CD50C",
-"5^	c #0BD60B",
-"6^	c #0BD70B",
-"7^	c #0AD70A",
-"8^	c #0AD80A",
-"9^	c #09D809",
-"0^	c #08D908",
-"a^	c #07DA07",
-"b^	c #06DB06",
-"c^	c #06DC06",
-"d^	c #05DC05",
-"e^	c #04DD04",
-"f^	c #03DC03",
-"g^	c #03DD03",
-"h^	c #02DD02",
-"i^	c #01DE01",
-"j^	c #01BD01",
-"k^	c #03C003",
-"l^	c #04C104",
-"m^	c #05C105",
-"n^	c #06C206",
-"o^	c #08C508",
-"p^	c #09C509",
-"q^	c #0AC60A",
-"r^	c #0BC80B",
-"s^	c #0CA423",
-"t^	c #0E0E87",
-"u^	c #0F0F87",
-"v^	c #0F1087",
-"w^	c #0F1585",
-"x^	c #0FCB16",
-"y^	c #0FD50F",
-"z^	c #0FD60F",
-"A^	c #0FD70F",
-"B^	c #0FD80F",
-"C^	c #0ED80E",
-"D^	c #0ED90E",
-"E^	c #0DD90D",
-"F^	c #0DDA0D",
-"G^	c #0CDB0C",
-"H^	c #0BDC0B",
-"I^	c #0ADC0A",
-"J^	c #09DD09",
-"K^	c #08DE08",
-"L^	c #07DF07",
-"M^	c #06DF06",
-"N^	c #05E005",
-"O^	c #04E004",
-"P^	c #03E003",
-"Q^	c #02E002",
-"R^	c #01E001",
-"S^	c #005600",
-"T^	c #03BF03",
-"U^	c #04C004",
-"V^	c #05C005",
-"W^	c #06C106",
-"X^	c #08C308",
-"Y^	c #08C408",
-"Z^	c #09C409",
-"`^	c #0AC50A",
-" /	c #0CC70C",
-"./	c #0CC80C",
-"+/	c #0DC80D",
-"@/	c #0EC90E",
-"#/	c #0FCA0F",
-"$/	c #0F6E4A",
-"%/	c #101188",
-"&/	c #111288",
-"*/	c #121389",
-"=/	c #131489",
-"-/	c #13476A",
-";/	c #13D613",
-">/	c #13D713",
-",/	c #12D812",
-"'/	c #12D912",
-")/	c #11DA11",
-"!/	c #11DB11",
-"~/	c #10DB10",
-"{/	c #10DC10",
-"]/	c #0FDC0F",
-"^/	c #0FDD0F",
-"//	c #0EDE0E",
-"(/	c #0DDF0D",
-"_/	c #0CDF0C",
-":/	c #0CE00C",
-"</	c #0BDF0B",
-"[/	c #0AE00A",
-"}/	c #09E109",
-"|/	c #08E108",
-"1/	c #07E107",
-"2/	c #06E106",
-"3/	c #05E105",
-"4/	c #04BF04",
-"5/	c #09C309",
-"6/	c #0AC40A",
-"7/	c #0CC60C",
-"8/	c #0DC70D",
-"9/	c #0EC80E",
-"0/	c #0FC80F",
-"a/	c #0FCB0F",
-"b/	c #10CB10",
-"c/	c #11CC11",
-"d/	c #123A70",
-"e/	c #14158A",
-"f/	c #15168A",
-"g/	c #16178A",
-"h/	c #17188B",
-"i/	c #17844A",
-"j/	c #17D817",
-"k/	c #16D916",
-"l/	c #16DA16",
-"m/	c #16DB16",
-"n/	c #15DA15",
-"o/	c #15DB15",
-"p/	c #14DC14",
-"q/	c #14DD14",
-"r/	c #14D41A",
-"s/	c #13DE13",
-"t/	c #12DE12",
-"u/	c #12DF12",
-"v/	c #11DE11",
-"w/	c #11DF11",
-"x/	c #10E010",
-"y/	c #0FE00F",
-"z/	c #0FE10F",
-"A/	c #0EE20E",
-"B/	c #0DE20D",
-"C/	c #0CE10C",
-"D/	c #0BE10B",
-"E/	c #0AE10A",
-"F/	c #03BE03",
-"G/	c #08C208",
-"H/	c #0DC60D",
-"I/	c #0EC70E",
-"J/	c #0FC70F",
-"K/	c #0FC90F",
-"L/	c #10CA10",
-"M/	c #11CA11",
-"N/	c #11CB11",
-"O/	c #12CB12",
-"P/	c #13CC13",
-"Q/	c #14CD14",
-"R/	c #15BD20",
-"S/	c #151789",
-"T/	c #18198B",
-"U/	c #191A8C",
-"V/	c #1A1B8C",
-"W/	c #1ABE2B",
-"X/	c #1ADA1A",
-"Y/	c #1ADB1A",
-"Z/	c #19DC19",
-"`/	c #19DD19",
-" (	c #18DE18",
-".(	c #17C526",
-"+(	c #172782",
-"@(	c #17854B",
-"#(	c #16DF17",
-"$(	c #15E015",
-"%(	c #15E115",
-"&(	c #14E114",
-"*(	c #13E213",
-"=(	c #12E212",
-"-(	c #11E211",
-";(	c #10E210",
-">(	c #0FE20F",
-",(	c #0AC30A",
-"'(	c #0CC50C",
-")(	c #0EC60E",
-"!(	c #10C910",
-"~(	c #12CA12",
-"{(	c #13CB13",
-"](	c #15CD15",
-"^(	c #15CE15",
-"/(	c #16CE16",
-"((	c #17CF17",
-"_(	c #18CF18",
-":(	c #188845",
-"<(	c #1A1C8C",
-"[(	c #1B1D8D",
-"}(	c #1C1E8D",
-"|(	c #1D1F8D",
-"1(	c #1D3B7D",
-"2(	c #1DDB1D",
-"3(	c #1DDC1D",
-"4(	c #1DDD1D",
-"5(	c #1CDD1C",
-"6(	c #1CDE1C",
-"7(	c #1BDF1B",
-"8(	c #1ADD1C",
-"9(	c #1A4773",
-"0(	c #19506C",
-"a(	c #19CF24",
-"b(	c #18E218",
-"c(	c #18E318",
-"d(	c #17E317",
-"e(	c #16E316",
-"f(	c #15E315",
-"g(	c #14E314",
-"h(	c #05BF05",
-"i(	c #12C912",
-"j(	c #13CA13",
-"k(	c #14CC14",
-"l(	c #16CD16",
-"m(	c #17CE17",
-"n(	c #18CE18",
-"o(	c #19CF19",
-"p(	c #1AD11A",
-"q(	c #1AD21A",
-"r(	c #1B5569",
-"s(	c #1E208E",
-"t(	c #1F218E",
-"u(	c #20228F",
-"v(	c #21238F",
-"w(	c #21755E",
-"x(	c #21DD21",
-"y(	c #20DD20",
-"z(	c #20DE20",
-"A(	c #20DF20",
-"B(	c #20E020",
-"C(	c #1FE01F",
-"D(	c #1FE11F",
-"E(	c #1EE01E",
-"F(	c #1E7E57",
-"G(	c #1B2D84",
-"H(	c #1BA83D",
-"I(	c #1AE31A",
-"J(	c #19E319",
-"K(	c #09C209",
-"L(	c #10C810",
-"M(	c #11C911",
-"N(	c #14CB14",
-"O(	c #15CC15",
-"P(	c #16CC16",
-"Q(	c #17CD17",
-"R(	c #18CD18",
-"S(	c #1AD01A",
-"T(	c #1BD11B",
-"U(	c #1CD21C",
-"V(	c #1DD31D",
-"W(	c #1DCF20",
-"X(	c #1E2889",
-"Y(	c #21248F",
-"Z(	c #222590",
-"`(	c #232690",
-" _	c #23AF3F",
-"._	c #23DF23",
-"+_	c #23E023",
-"@_	c #22E122",
-"#_	c #22E222",
-"$_	c #21E221",
-"%_	c #21B53C",
-"&_	c #21278E",
-"*_	c #1E2F85",
-"=_	c #1DDA23",
-"-_	c #1DE41D",
-";_	c #1CE41C",
-">_	c #1BE41B",
-",_	c #0DC50D",
-"'_	c #1ACF1A",
-")_	c #1BD01B",
-"!_	c #1CD11C",
-"~_	c #1DD21D",
-"{_	c #1ED21E",
-"]_	c #1ED31E",
-"^_	c #1FD31F",
-"/_	c #20D520",
-"(_	c #21AA3B",
-"__	c #242790",
-":_	c #252891",
-"<_	c #262991",
-"[_	c #272A91",
-"}_	c #27348C",
-"|_	c #27DD29",
-"1_	c #27E127",
-"2_	c #26E226",
-"3_	c #25E325",
-"4_	c #25D82C",
-"5_	c #253E84",
-"6_	c #21A346",
-"7_	c #21E421",
-"8_	c #20E420",
-"9_	c #1FE41F",
-"0_	c #1EE41E",
-"a_	c #1DD11D",
-"b_	c #20D420",
-"c_	c #21D521",
-"d_	c #22D622",
-"e_	c #237D5A",
-"f_	c #262A91",
-"g_	c #272B92",
-"h_	c #282C92",
-"i_	c #292D92",
-"j_	c #2A2E93",
-"k_	c #2A6970",
-"l_	c #2AE12A",
-"m_	c #29E229",
-"n_	c #29E329",
-"o_	c #29E429",
-"p_	c #28E528",
-"q_	c #286B6F",
-"r_	c #24686B",
-"s_	c #24E524",
-"t_	c #23E523",
-"u_	c #22E422",
-"v_	c #04E104",
-"w_	c #1CD01C",
-"x_	c #21D421",
-"y_	c #22D522",
-"z_	c #23D623",
-"A_	c #24D624",
-"B_	c #25D725",
-"C_	c #26D826",
-"D_	c #275179",
-"E_	c #2B2F93",
-"F_	c #2B3093",
-"G_	c #2C3194",
-"H_	c #2C9F54",
-"I_	c #2CE42C",
-"J_	c #2BE52B",
-"K_	c #2BE62B",
-"L_	c #2BA053",
-"M_	c #283F87",
-"N_	c #27D92F",
-"O_	c #27E527",
-"P_	c #26E526",
-"Q_	c #25E525",
-"R_	c #20D320",
-"S_	c #26D926",
-"T_	c #27D927",
-"U_	c #28D02E",
-"V_	c #292F91",
-"W_	c #2D3294",
-"X_	c #2E3394",
-"Y_	c #2F3495",
-"Z_	c #2E3494",
-"`_	c #2F3595",
-" :	c #2FCD3E",
-".:	c #2FE52F",
-"+:	c #2FE62F",
-"@:	c #2ECD3C",
-"#:	c #2E3C8F",
-"$:	c #2BB248",
-"%:	c #2AE62A",
-"&:	c #29E529",
-"*:	c #23D523",
-"=:	c #28DA28",
-"-:	c #29DA29",
-";:	c #2ADB2A",
-">:	c #2BA64A",
-",:	c #303695",
-"':	c #313795",
-"):	c #323896",
-"!:	c #334A8C",
-"~:	c #33E633",
-"{:	c #32E732",
-"]:	c #31E433",
-"^:	c #315C80",
-"/:	c #2E7C6B",
-"(:	c #2DE62D",
-"_:	c #2CE62C",
-"::	c #06C606",
-"<:	c #27D827",
-"[:	c #28D928",
-"}:	c #2ADA2A",
-"|:	c #2BDB2B",
-"1:	c #2BDC2B",
-"2:	c #2CDC2C",
-"3:	c #2D8D5D",
-"4:	c #333996",
-"5:	c #333A96",
-"6:	c #343B96",
-"7:	c #353C97",
-"8:	c #357676",
-"9:	c #35E735",
-"0:	c #34E734",
-"a:	c #348C68",
-"b:	c #314F87",
-"c:	c #30DF35",
-"d:	c #30E730",
-"e:	c #2EE62E",
-"f:	c #29D929",
-"g:	c #2DDC2D",
-"h:	c #2FDE2F",
-"i:	c #2FDF2F",
-"j:	c #307E6A",
-"k:	c #363D97",
-"l:	c #363E97",
-"m:	c #373F97",
-"n:	c #384098",
-"o:	c #38A160",
-"p:	c #38E838",
-"q:	c #37E837",
-"r:	c #37A85C",
-"s:	c #364097",
-"t:	c #343D96",
-"u:	c #33BF4A",
-"v:	c #33E733",
-"w:	c #31E731",
-"x:	c #0CCB0C",
-"y:	c #2CDB2C",
-"z:	c #2EDD2E",
-"A:	c #31DF31",
-"B:	c #32E032",
-"C:	c #336F75",
-"D:	c #394198",
-"E:	c #394298",
-"F:	c #3A4398",
-"G:	c #3AC250",
-"H:	c #3AE83A",
-"I:	c #3A9E64",
-"J:	c #394398",
-"K:	c #378E6A",
-"L:	c #36E836",
-"M:	c #36E736",
-"N:	c #05CB05",
-"O:	c #19D019",
-"P:	c #24D724",
-"Q:	c #30DF30",
-"R:	c #33E133",
-"S:	c #34E134",
-"T:	c #356B7B",
-"U:	c #3B4499",
-"V:	c #3C4599",
-"W:	c #3C4699",
-"X:	c #3D4799",
-"Y:	c #3D966D",
-"Z:	c #3DE93D",
-"`:	c #3DE241",
-" <	c #3D936E",
-".<	c #3A707F",
-"+<	c #39E43C",
-"@<	c #39E839",
-"#<	c #14D014",
-"$<	c #1CD31C",
-"%<	c #1FD41F",
-"&<	c #21D621",
-"*<	c #23D723",
-"=<	c #27DA27",
-"-<	c #31E031",
-";<	c #33E033",
-"><	c #36E236",
-",<	c #36E336",
-"'<	c #377F72",
-")<	c #3E489A",
-"!<	c #3E499A",
-"~<	c #3F4A9A",
-"{<	c #404B9A",
-"]<	c #404E99",
-"^<	c #407C7E",
-"/<	c #408B76",
-"(<	c #3F5395",
-"_<	c #3F499A",
-":<	c #3D7182",
-"<<	c #3CE340",
-"[<	c #3CE83C",
-"}<	c #3BE83B",
-"|<	c #05CE05",
-"1<	c #1BD41B",
-"2<	c #1ED41E",
-"3<	c #22D722",
-"4<	c #24D824",
-"5<	c #25D825",
-"6<	c #29DB29",
-"7<	c #2CDD2C",
-"8<	c #2EDE2E",
-"9<	c #34E234",
-"0<	c #37E337",
-"a<	c #39E439",
-"b<	c #399767",
-"c<	c #414C9B",
-"d<	c #414D9B",
-"e<	c #424E9B",
-"f<	c #407184",
-"g<	c #3FE343",
-"h<	c #3EE93E",
-"i<	c #3CE93C",
-"j<	c #0ED20E",
-"k<	c #20D620",
-"l<	c #22D822",
-"m<	c #26DA26",
-"n<	c #28DB28",
-"o<	c #29DC29",
-"p<	c #2DDD2D",
-"q<	c #32E132",
-"r<	c #37E437",
-"s<	c #39E539",
-"t<	c #3AE53A",
-"u<	c #3CCC4B",
-"v<	c #434F9B",
-"w<	c #43509B",
-"x<	c #44519B",
-"y<	c #45529C",
-"z<	c #44519C",
-"A<	c #437386",
-"B<	c #42E246",
-"C<	c #41E941",
-"D<	c #42E942",
-"E<	c #40E940",
-"F<	c #3FE93F",
-"G<	c #1AD61A",
-"H<	c #22D922",
-"I<	c #24D924",
-"J<	c #2ADC2A",
-"K<	c #2BDD2B",
-"L<	c #2CDE2C",
-"M<	c #35E335",
-"N<	c #3AE63A",
-"O<	c #3CE63C",
-"P<	c #3CE73C",
-"Q<	c #3DE73D",
-"R<	c #3E6987",
-"S<	c #46539C",
-"T<	c #45539C",
-"U<	c #46549C",
-"V<	c #47559C",
-"W<	c #47569C",
-"X<	c #457389",
-"Y<	c #45E34A",
-"Z<	c #45EA45",
-"`<	c #44EA44",
-" [	c #43EA43",
-".[	c #05D305",
-"+[	c #26DB26",
-"@[	c #28DC28",
-"#[	c #2ADD2A",
-"$[	c #2BDE2B",
-"%[	c #2EDF2E",
-"&[	c #2FE02F",
-"*[	c #30E030",
-"=[	c #33E233",
-"-[	c #34E334",
-";[	c #36E436",
-">[	c #38E538",
-",[	c #3BE63B",
-"'[	c #3EE83E",
-")[	c #41D04F",
-"![	c #415496",
-"~[	c #48579D",
-"{[	c #48579C",
-"][	c #49589D",
-"^[	c #4A599D",
-"/[	c #49599D",
-"([	c #48758B",
-"_[	c #47E24D",
-":[	c #47EA47",
-"<[	c #46EA46",
-"[[	c #0ED70E",
-"}[	c #26DC26",
-"|[	c #2BDF2B",
-"1[	c #2CDF2C",
-"2[	c #2EE02E",
-"3[	c #30E130",
-"4[	c #37E537",
-"5[	c #39E639",
-"6[	c #3BE73B",
-"7[	c #3DE83D",
-"8[	c #43B263",
-"9[	c #4A5A9D",
-"0[	c #4B5B9D",
-"a[	c #4B5C9D",
-"b[	c #4C5D9E",
-"c[	c #4C5D9D",
-"d[	c #4B8286",
-"e[	c #4AE150",
-"f[	c #4AEB4A",
-"g[	c #49EB49",
-"h[	c #48EB48",
-"i[	c #1CDB1C",
-"j[	c #2ADE2A",
-"k[	c #2EE12E",
-"l[	c #2FE12F",
-"m[	c #30E230",
-"n[	c #32E232",
-"o[	c #33E333",
-"p[	c #39E739",
-"q[	c #458E7A",
-"r[	c #4D5E9D",
-"s[	c #4D5F9E",
-"t[	c #4E609E",
-"u[	c #4F619E",
-"v[	c #4E669A",
-"w[	c #4DB16E",
-"x[	c #4DEB4E",
-"y[	c #4DEB4D",
-"z[	c #4CEB4C",
-"A[	c #4BEB4B",
-"B[	c #02D802",
-"C[	c #2CE02C",
-"D[	c #2DE02D",
-"E[	c #2FE22F",
-"F[	c #32E332",
-"G[	c #33E433",
-"H[	c #34E434",
-"I[	c #36E536",
-"J[	c #47E749",
-"K[	c #48A570",
-"L[	c #4A6098",
-"M[	c #4F629E",
-"N[	c #50639E",
-"O[	c #50649E",
-"P[	c #50659E",
-"Q[	c #508D87",
-"R[	c #50D95B",
-"S[	c #50EC50",
-"T[	c #4FEC4F",
-"U[	c #4EEC4E",
-"V[	c #4DEC4D",
-"W[	c #02DA02",
-"X[	c #30E330",
-"Y[	c #31E431",
-"Z[	c #34E534",
-"`[	c #36E636",
-" }	c #37E637",
-".}	c #38E738",
-"+}	c #4BDE52",
-"@}	c #4C937E",
-"#}	c #4D5F9D",
-"$}	c #51659E",
-"%}	c #52669E",
-"&}	c #52679F",
-"*}	c #52679E",
-"=}	c #53689F",
-"-}	c #536A9D",
-";}	c #539982",
-">}	c #53D660",
-",}	c #52ED52",
-"'}	c #52EC52",
-")}	c #51EC51",
-"!}	c #01DB01",
-"~}	c #20E120",
-"{}	c #33E533",
-"]}	c #35E635",
-"^}	c #4FD15E",
-"/}	c #4FA677",
-"(}	c #509284",
-"_}	c #517D91",
-":}	c #52699D",
-"<}	c #53699E",
-"[}	c #546B9E",
-"}}	c #557A96",
-"|}	c #559C83",
-"1}	c #54C16E",
-"2}	c #54E35A",
-"3}	c #54ED54",
-"4}	c #55ED55",
-"5}	c #53ED53",
-"6}	c #01DD01",
-"7}	c #1FE31F",
-"8}	c #34E634",
-"9}	c #54EB55",
-"0}	c #54DA5F",
-"a}	c #54D661",
-"b}	c #55E25B",
-"c}	c #55EC57",
-"d}	c #56ED56",
-"e}	c #57ED57",
-"f}	c #58EE58",
-"g}	c #59EE59",
-"h}	c #57EE57",
-"i}	c #19E419",
-"j}	c #5AEE5A",
-"k}	c #5BEE5B",
-"l}	c #5CEF5C",
-"m}	c #5DEF5D",
-"n}	c #5EEF5E",
-"o}	c #5FEF5F",
-"p}	c #1AE41A",
-"q}	c #12E312",
-"r}	c #2FE72F",
-"s}	c #27E627",
-"t}	c #42EA42",
-"u}	c #41EA41",
-"v}	c #2EE72E",
-"w}	c #39E939",
-"x}	c #3FEA3F",
-"y}	c #46EB46",
-"z}	c #4CEC4C",
-"A}	c #32E832",
-"B}	c #003F00",
-"C}	c #003D00",
-"D}	c #003A00",
-"E}	c #003E00",
-"F}	c #003900",
-"G}	c #002E00",
-"H}	c #003500",
-"I}	c #003B00",
-"J}	c #003C00",
-"                                                                                                                . . . . . . . . . . . . . . . .                                                                                                                 ",
-"                                                                                                    . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                                                     ",
-"                                                                                            . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                                             ",
-"                                                                                      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                                       ",
-"                                                                                  . . . . . . . . . . . . . + @ # $ % & * = - ; > , ' ) ! * % ~ { + . . . . . . . . . . . . .                                                                                   ",
-"                                                                            . . . . . . . . . . . ] ^ / * ' ( ( ( _ _ : < < [ [ } | | 1 1 2 2 3 4 4 | > ! 5 ] . . . . . . . . . . .                                                                             ",
-"                                                                        . . . . . . . . . + 6 / = > ( ( ( ( _ _ : : < < [ } } | | 1 1 2 3 3 4 4 7 7 8 9 9 0 9 [ = ~ + . . . . . . . . .                                                                         ",
-"                                                                    . . . . . . . . . @ a , ( ( ( ( ( ( _ b c d e f g h i j k l m n o p q r s t u v w 0 x x y y z z 0 , A . . . . . . . . .                                                                     ",
-"                                                                . . . . . . . . B C - ( ( ( ( ( ( D E F G H H H H H H H H H H H I I I I I I I I I I J K L M z N N O O P Q 8 = R . . . . . . . .                                                                 ",
-"                                                              . . . . . . . S % > ( ( ( ( ( T U V W X X X X X X X X X Y Y Y Y Y Y Y Y Y Y Y Z Z Z Z Z Z Z Z `  ...+.Q Q @. at .#.#._ { . . . . . . .                                                               ",
-"                                                          . . . . . . . R $.> ( ( ( %.E &.*.=.=.=.=.=.=.-.-.-.-.-.-.-.-.-.;.;.;.;.;.;.;.;.;.;.>.>.>.>.>.>.>.>.>.,.'.).!.~.{.{.].^.].} ^ . . . . . . .                                                           ",
-"                                                      . . . . . . . B & ( ( ( ( /.(._.:.:.:.:.:.:.:.<.<.<.<.<.<.<.<.[.[.[.[.[.[.[.[.[.}.}.}.}.}.}.}.}.}.|.|.|.|.|.|.|.|.1.2.3.4.5.6.6.7.1 { . . . . . . .                                                       ",
-"                                                    . . . . . . + 8.; ( ( ( 9.0.a.b.b.b.b.b.b.c.c.c.c.c.c.c.c.c.d.d.d.d.d.d.d.e.e.e.e.e.e.e.e.f.f.f.f.f.f.f.g.g.g.g.g.g.g.g.g.h.i.j.7.k.l.6., + . . . . . .                                                     ",
-"                                                  . . . . . . { ) ( ( ( m.n.o._._.p.p.p.p.p.p.p.q.q.q.q.q.q.q.r.r.r.r.r.r.r.s.s.s.s.s.s.s.t.t.t.t.t.t.t.t.t.u.u.u.u.u.u.u.v.v.v.v.w.x.y.z.A.A. at .C . . . . . .                                                   ",
-"                                              . . . . . . + % ( ( ( B.C.D.o.o.E.E.E.E.E.E.E.F.F.F.F.F.F.F.G.G.G.G.G.G.G.H.H.H.H.H.I.I.I.I.I.I.I.J.J.J.J.J.J.J.K.K.K.K.K.K.K.L.L.L.L.L.M.N.O.P.Q.R.2 ] . . . . . .                                               ",
-"                                            . . . . . . R ) ( ( S.C.T.*.*.U.U.U.U.U.U.U.V.V.V.V.V.W.W.W.W.W.W.W.X.X.X.X.X.X.X.Y.Y.Y.Y.Y.Z.Z.Z.Z.Z.Z.Z.`.`.`.`.`. + + + + + + +.+.+.+.+.+.+++ at +R.#+$+].# . . . . . .                                             ",
-"                                          . . . . . . 5 > ( ( %+&+*+=+=+=+=+=+=+=+-+-+-+-+-+;+;+;+;+;+;+;+>+>+>+>+>+>+,+,+,+,+,+'+'+'+'+'+'+'+)+)+)+)+)+!+!+!+!+!+~+~+~+~+~+~+~+{+{+{+{+{+]+]+^+/+(+_+#+- . . . . . .                                           ",
-"                                        . . . . . + $.( _ _ :+<+[+[+[+}+}+}+}+}+}+|+|+|+|+|+1+1+1+1+1+2+2+2+2+2+2+2+3+3+3+3+3+4+4+4+4+4+5+6+7+8+9+0+a+b+b+b+b+c+c+c+c+c+c+c+d+d+d+d+d+e+e+e+e+e+f+g+h+h+i+x B . . . . .                                         ",
-"                                      . . . . . ] = _ _ j+k+l+l+l+m+m+m+m+m+n+n+n+n+n+o+o+o+o+o+o+p+p+p+p+p+q+q+q+q+q+r+r+r+r+r+s+s+t+u+v+w+w+w+w+w+x+y+z+A+A+A+B+B+B+B+B+C+C+C+C+C+D+D+D+D+D+E+E+F+G+H+H+I+6.R . . . . .                                       ",
-"                                    . . . . . S ' : : J+K+L+L+M+M+M+M+M+N+N+N+N+N+O+O+O+O+O+P+P+P+P+Q+Q+Q+Q+Q+R+R+R+R+R+S+S+S+S+S+T+U+w+w+w+w+w+w+w+w+w+V+W+X+Y+Y+Y+Y+Y+Z+Z+Z+Z+Z+Z+`+`+`+`+`+ @ @ @ @. at +@@@#@A.^ . . . . .                                     ",
-"                                  . . . . . R ; : < $@%@&@&@*@*@*@*@*@q q q q q =@=@=@=@- at -@- at -@-@;@;@;@;@;@>@>@>@>@>@,@,@,@,@'@)@w+w+w+w+w+w+w+w+w+w+w+w+w+!@~@{@{@]@]@]@]@]@^@^@^@^@/@/@/@/@/@(@(@(@(@_@:@<@[@(+~ . . . . .                                   ",
-"                                . . . . . { _ < }@|@g g 1 at 1@1 at 1@1 at 2@2 at 2@3 at 3@3 at 3@3 at 4@4 at 4@4 at 4@4 at 5@5 at 5@6 at 6@6 at 6@6@).).).).7 at 7@7 at 7@8 at w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+9@0 at a@a at a@a at a@a at b@b at b@c at c@c at c@c at d@d at d@d at e@e at f@g at h@i at I+/ . . . . .                                 ",
-"                              . . . . . @ _ [ j at k@l at l@l at l@l at m@m at m@m at n@n at n@n at n@o at o@o at o@p at p@p at p@p at q@q at q@r at r@r at r@s at s@s at s@s at t@t at u@v at w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w@x at x@x at x@x at y@y at y@z at z@z at z@A at A@A at A@A at B@B at B@B at C@D at E@F@#@8.. . . . .                               ",
-"                            . . . . . S ( } } G at H@I at I@I at I@I at r r r J at J@J at J@K at K@K at K@K at L@L at L@M at M@M at M@N at N@N at N@N at O@O at O@O at P@P at P@Q at R@w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+S at T@U at U@U at U@U at V@V at V@V at W@W at W@X at X@X at X@X at Y@Y at Y@Y at Z@`@ #.#I+A . . . . .                             ",
-"                            . . . . B > | | +#@#@#@###########$#$#$#%#%#%#%#&#&#&#*#*#*#*#*#*#=#=#=#-#-#-#;#;#;#;#>#>#>#>#,#w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+'#)#)#)#!#!#!#!#!#~#~#~#{#{#{#{#]#]#]#^#^#^#^#/#(#_#:#i+@ . . . .                             ",
-"                          . . . . + ; | 1 <#[#}#}#}#}#|#|#|#|#|#1#1#1#2#2#2#2#3#3#3#4#4#4#4#5#5#5#6#6#6#6#6#6#7#7#7#8#8#8#9#w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+0#a#a#b#b#b#b#c#c#c#d#d#d#d#e#e#e#e#e#f#f#f#g#g#h#i#j#k#$+B . . . .                           ",
-"                        . . . . . ! 1 2 l#m#n#o#o#o#p#p#p#p#q#q#q#r#r#r#r#s#s#s#s#s#t#t#t#u#u#u#u#v#v#v#w#w#w#w#x#x#x#y#y#z#w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+A#B#B#B#C#C#C#C#D#D#D#E#E#E#E#F#F#F#G#G#G#G#H#H#H#I#J#K#K#].. . . . .                         ",
-"                      . . . . . 8.2 2 L#M#N#N#N#O#O#O#P#P#P#P#Q#Q#Q#R#R#R#R#S#S#S#T#T#T#T#U#U#U#V#V#V#V#W#W#W#X#X#X#X#Y#Y#Z#w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+`# $.$.$.$+$+$+$+$@$@$@$#$#$#$#$/#/#/#$$$$$$$$%$%$%$&$*$=$=$: . . . . .                       ",
-"                      . . . . @ 1 3 -$;$>$,$,$,$,$'$'$'$)$)$)$)$!$!$~$~$~${${${${$]$]$]$^$^$^$/$/$/$/$($($($_$_$_$_$:$:$:$<$w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+[$}$}$|$|$|$1$1$1$1$2$2$2$3$3$3$3$4$4$4$5$5$5$5$6$6$6$7$8$9$K#C . . . .                       ",
-"                    . . . . + : 4 0$a$b$b$b$b$c$c$c$d$d$d$e$e$e$e$f$f$f$g$g$g$g$h$h$i$i$i$j$j$j$j$k$k$k$l$l$l$l$m$m$m$n$n$o$w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+p$q$q$q$r$r$r$r$s$s$s$t$t$u$u$u$v$v$v$v$w$w$w$x$x$x$x$y$z$A$B$[@B . . . .                     ",
-"                    . . . . = 7 7 C$D$D$E$E$E$E$F$F$F$G$G$H$H$H$I$I$I$I$J$J$J$K$K$K$K$L$M$M$M$M$N$N$N$O$O$O$O$P$P$P$Q$Q$R$S$w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+T$U$V$V$V$W$W$W$W$X$X$X$Y$Y$Z$Z$Z$`$`$`$`$ % % %.%.%.%.%+%@%#%$%^.. . . .                     ",
-"                  . . . . A 8 8 %%&%*%*%=%=%=%-%-%-%;%;%;%;%>%>%,%,%,%'%'%'%'%)%)%)%!%!%~%~%~%{%{%{%{%]%]%]%^%^%/%/%/%(%(%_%:%w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+<%[%[%}%}%}%|%|%|%|%1%2%2%2%2%3%3%3%4%4%4%4%5%5%6%6%6%7%7%8%9%0%a%* . . . .                   ",
-"                . . . . + [ 9 b%c%d%d%e%e%e%f%f%g%g%g%g%h%h%h%i%i%j%j%j%k%k%k%k%l%m%m%m%m%n%n%n%o%o%o%o%p%p%q%q%q%r%r%r%r%s%t%w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+u%v%v%w%w%w%w%x%x%x%y%y%z%z%z%A%A%A%A%B%B%C%C%C%D%D%D%E%E%E%E%F%a%G%F@] . . . .                 ",
-"                . . . . $.0 0 H%I%J%K%K%K%K%L%M%M%M%M%N%N%N%O%O%P%P%P%P%Q%Q%Q%R%R%S%S%S%T%T%T%T%U%U%V%V%V%W%W%W%X%X%Y%Y%Y%Y%Z%`%w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+ &.&+&+&+&@&@&@&@&#&$&$&$&$&%&%&%&&&&&*&*&*&*&=&=&=&-&-&;&;&;&>&,&'&)&!&0 . . . .                 ",
-"              . . . . R 9 x ~&{&]&]&^&^&^&/&/&/&/&(&_&_&_&_&:&:&<&<&<&[&[&[&}&}&|&|&|&|&1&2&2&2&2&3&3&3&4&4&5&5&5&5&6&7&7&7&7&8&9&w+w+w+w+w+w+w+w+w+w+w+w+w+w+0&a&a&b&b&b&c&c&d&d&d&d&e&f&f&f&f&g&g&g&h&h&i&i&i&j&j&k&k&k&k&l&l&m&n&n&a%# . . . .               ",
-"              . . . . ; y y o&p&p&q&q&r&r&r&s&s&t&t&t&u&u&u&u&v&v&w&w&w&x&x&y&y&y&z&z&A&A&A&A&B&C&C&C&C&D&D&D&E&E&F&F&F&G&G&H&H&I&J&w+w+w+w+w+w+w+w+w+w+w+:%K&L&M&N&N&N&N&O&P&P&P&P&Q&Q&R&R&R&S&S&T&T&T&U&U&U&U&V&V&W&W&W&X&X&Y&Z&`& * *$+. . . .               ",
-"            . . . . { z z .*+*@*#*#*$*$*$*$*%*&*&*&*&*****=*=*=*-*-*;*;*;*>*>*>*>*,*'*'*'*'*)*)*!*!*!*~*~*{*{*{*]*]*^*^*^*^*/*(*(*_*:*w+w+w+w+w+w+w+w+w+<*[*}*|*|*|*1*1*2*2*2*2*3*4*4*4*4*5*5*6*6*6*7*7*8*8*8*9*9*0*0*0*a*a*b*b*b*c*d*e*d*$ . . . .             ",
-"            . . . . > N O f*g*g*h*i*i*i*i*j*j*k*k*k*l*l*m*m*m*n*n*o*o*o*o*p*q*q*q*q*r*r*s*s*s*t*t*u*u*u*v*v*w*w*x*x*x*y*y*z*z*z*A*A*B*C*D*E*F*w+G*H*I*J*K*L*L*L*M*M*N*N*N*O*O*7$7$7$P*P*Q*Q*R*R*R*S*S*T*T*T*T*U*V*V*V*V*W*W*X*X*X*Y*Z*`* =$+. . . .             ",
-"          . . . . @ N O .=+=@=@=@=#=#=$=$=$=%=%=&=&=*=*=*=====-=-=-=;=;=>=>=>=,=,='='=)=)=)=!=!=~=~=~=~={=]=]=]=]=^=^=/=(=(=(=(=_=:=:=:=:=<=[=}=|=1=2=2=3=3=3=4=4=5=5=6=6=6=7=7=8=8=8=8=9=0=0=0=0=a=b=b=c=c=c=c=d=e=e=e=e=f=f=g=g=g=h= =i=`*8.. . . .           ",
-"          . . . . > P Q j=k=k=k=l=l=m=m=n=n=n=o=o=p=p=p=q=q=r=r=s=s=s=t=t=u=u=u=u=v=w=w=x=x=x=y=y=z=z=z=z=A=B=B=C=C=C=C=D=E=E=E=E=F=F=G=H=H=H=H=I=I=J=K=K=K=K=L=M=M=M=M=N=N=O=P=P=P=P=Q=Q=R=R=R=S=S=T=T=U=U=U=V=V=W=W=W=X=X=Y=Y=Z=Z=`= -.-+-R.. . . .           ",
-"          . . . R P @. at .@-#-#-#-$-%-%-&-&-&-&-*-=-=-------;-;->->-,-,-,-'-'-)-)-!-!-!-~-~-{-{-{-{-]-^-^-/-/-/-/-(-_-_-:-:-:-<-<-[-[-}-}-}-|-|-1-1-2-2-2-3-3-4-4-4-4-5-6-6-7-7-7-7-8-9-9-0-0-0-a-a-b-b-c-c-c-d-d-e-e-f-f-f-g-g-`=`=`=`=h-i-i-.-# . . .           ",
-"        . . . . = @.#.j-k-l-l-3.3.m-m-m-n-n-o-o-p-p-p-q-q-r-r-s-s-s-t-t-u-u-v-v-v-w-w-x-y-y-y-y-z-z-A-B-B-B-B-C-C-D-E-E-E-E-F-F-G-H-H-H-H-I-I-J-K-K-K-K-L-M-M-N-N-N-N-O-P-P-Q-Q-Q-Q-R-S-S-T-T-T-T-U-V-V-W-W-X-X-X-Y-Y-Z-Z-`-`-`- ; ;.;+;@;#;#;@.. . . .         ",
-"        . . . . 0 {.{.$;%;&;*;*;=;=;-;-;-;;;;;>;>;,;,;,;';';@+ at +);!;!;!;!;~;~;{;];];];];^;^;/;(;(;(;(;_;_;:;<;<;[;[;[;};};|;|;1;1;1;2;2;3;3;4;4;5;5;5;6;6;7;7;8;8;8;9;9;0;0;a;a;a;b;b;c;d;d;e;e;e;e;f;g;g;h;h;h;h;i;j;j;k;k;l;l;l;m;m;n;o;p;p;$%. . . .         ",
-"      . . . . # {.].^.q;r;r;s;t;t;u;u;v;v;v;w;w;x;x;y;y;z;z;z;A;A;B;B;C;D;D;D;D;E;F;F;G;G;G;G;H;I;I;J;J;K;K;K;L;L;M;M;N;N;O;O;O;P;P;Q;Q;R;S;S;S;S;T;U;U;z$z$V;V;V;W;W;X;X;Y;Y;Y;Z;Z;`;`; > >.>.>.>+>+>@>@>#>$>$>$>$>%>&>&>*>*>=>=>=>->->;>>>,>,>! . . . .       ",
-"      . . . . ( ^.^.'>)>)>!>!>~>~>{>{>{>]>]>^>/>/>(>(>(>(>_>:>:><><>[>[>[>}>}>|>|>1>1>2>3>3>3>3>4>4>5>6>6>7>7>7>8>8>9>9>0>0>a>a>a>b>b>c>c>d>e>e>e>e>f>f>g>h>h>i>i>i>i>j>k>k>l>l>m>n>n>n>n>o>o>p>q>q>r>r>r>r>s>t>t>u>u>+;+;+;v>v>w>w>x>x>y>z>z>A>#+. . . .       ",
-"      . . . + @.5.6.B>C>D>D>E>E>F>F>G>H>H>H>H>I>I>J>K>K>L>L>M>M>M>N>N>O>O>P>Q>Q>Q>Q>R>R>S>T>T>U>U>V>V>V>W>W>X>X>Y>Y>Z>`>`>`>`> , ,.,+,+,@,@,#,#,#,$,$,%,%,&,*,*,=,=,=,=,-,;,;,>,>,,,,,,,',',),),!,!,h=~,~,~,~,{,],],^,^,/,/,(,(,(,_,_,:,<,[,},},+-] . . .       ",
-"    . . . . $ 6.7.7.|,1,2,2,2,3,3,4,4,5,6,6,7,7,8,8,8,9,9,0,0,a,a,b,c,c,c,c,d,d,e,f,f,g,g,h,h,i,i,i,j,j,k,l,l,m,m,n,n,n,o,o,p,p,q,q,r,s,s,t,t,t,t,u,v,v,w,w,x,x,y,y,y,z,z,A,B,B,C,C,D,D,E,E,E,F,F,G,G,H,I,I,J,J,J,J,K,L,L,M,M,N,N,O,P,P,P,Q,R,S,S,_ . . . .     ",
-"    . . . . ( 7.k.l.T,U,U,V,V,W,X,X,Y,Y,Z,Z,`,`,`, ' '.'.'+'@'@'#'#'$'%'%'%'%'&'&'*'='='-'-';';'>'>'>',',''''')'!'!'~'~'{'{'{']']'^'^'/'('('_'_':':':'<'<'['['}'}'|'1'1'2'2'3'3'3'4'4'5'5'6'6'7'8'8'9'9'9'0'0'a'a'b'b'c'd'd'e'e'e'e'f'g'g'h'S,i'i'P.. . . .     ",
-"    . . . . y l.l.j'k'l'm'm'n'n'n'n'o'p'p'q'q'r's's't't'u'u'v'v'v'w'w'x'x'y'z'z'A'A'B'B'C'C'C'D'D'E'F'F'G'G'H'H'I'J'J'K'K'K'K'L'M'M'N'N'O'O'P'Q'Q'R'R'R'R'S'T'T'U'U'V'W'W'X'X'Y'Y'Z'Z'Z'`'`' ) ).)+)+)@)@)#)#)$)$)$)%)%)&)&)*)=)=)-)-);)>),)')')))$%. . . .     ",
-"    . . . B l.z.A.!)~)~){)])])^)^)/)/)()_)_):):):):)<)[)[)})})|)1)1)2)2)3)3)4)5)5)5)5)6)6)7)8)8)9)9)0)0)a)b)b)c)c)d)d)e)f)g)h)i)j)k)l)m)n)o)p)q)r)s)t)u)v)w)x)y)y)z)z)A)A)B)C)C)D)D)E)E)F)h-h-h-h-G)H)H)I)I)J)J)K)L)L)M)M)N)N)O)O)O)P)P)Q)R)))S)S)))@ . . .     ",
-"  . . . . a A.A.P.T)U)V)V)W)W)X)Y)Y)Z)Z)`) ! !.!.!.!.!+!@!@!#!#!$!$!%!&!&!*!*!=!=!-!;!;!>!,!'!)!!!~!{!]!^!/!(!_!:!<![!}!|!w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+1!2!3!4!4!5!5!6!6!7!8!8!8!8!9!9!0!a!a!b!b!c!c!;>d!d!e!e!f!f!g!h!h!h!h!i!j!j!k!k!l!S)m!n!n!} . . . .   ",
-"  . . . . < P.Q.Q.o!p!p!q!q!r!r!r!s!s!t!t!u!u!v!w!w!x!x!y!z!z!A!A!B!B!C!D!D!E!E!F!F!G!G!G!H!w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+I!J!J!K!K!L!M!M!N!N!O!O!P!Q!Q!R!R!S!T!T!U!U!U!U!V!W!W!X!X!Y!Y!Z!`!`! ~ ~.~.~+~@~@~#~n!$~$~(+. . . .   ",
-"  . . . . z R.R.#+%~&~&~*~=~=~-~-~;~>~>~,~,~'~'~)~!~!~~~~~{~{~]~^~^~/~/~(~(~_~_~_~:~:~i#<~[~w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+}~|~|~|~1~1~2~3~3~4~4~5~5~6~7~7~8~8~9~9~0~a~a~b~b~c~c~d~e~e~f~f~g~h~h~i~i~j~j~k~l~m~n~n~o~B$. . . .   ",
-"  . . . . 6.#+$+$+p~q~r~r~s~t~t~u~u~v~v~w~x~x~y~y~z~A~A~B~B~C~C~D~E~E~F~F~G~G~H~I~I~J~J~K~L~w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+M~N~N~O~P~P~Q~Q~R~R~S~T~T~o;o;U~V~V~W~W~X~X~Y~Z~Z~`~`~ { {.{+{+{@{@{#{#{${%{%{&{&{*{={o~-{-{>>. . . .   ",
-"  . . . ] $+$+(+(+;{>{>{,{,{'{){){!{!{~{~{{{]{]{^{^{/{/{({_{_{:{:{<{<{[{}{}{|{|{1{2{2{3{3{4{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+5{6{7{7{8{9{9{0{0{a{a{b{c{c{d{d{e{e{f{g{g{h{h{i{i{j{k{k{l{l{l{m{m{n{n{o{o{m~={={p{p{q{-{r{s{r{R . . .   ",
-"  . . . ~ (+_+_+h+h+i+H+H+I+I+@@@@#@<@<@[@[@h at i@i at E@E at F@F@ #.#.#_#_#:#:#j#k#k#K#K#t{t{=$u{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+v{.-.-+-+-i-i-@;#;#;p;p;>>,>,>z>z>A>A>},R,R,S,S,i'i'')))))S)S)m!m!n!$~$~n~n~o~o~-{r{r{s{s{w{x{) . . .   ",
-". . . . ! _+h+i+i+H+H+I+@@@@#@#@<@<@[@h at h@i at i@E at E@F@ # #.#.#_#_#:#j#j#k#k#K#t{t{=$=$y{y{z{A{A{A{B{C{D{E{F{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+G{H{+-i-i-@;@;#;#;p;>>>>,>,>z>z>A>},},R,R,S,S,i'')')))))S)m!m!n!n!$~$~n~o~o~-{-{r{r{s{w{w{x{x{I{x . . . . ",
-". . . . [ i+i+H+I+I+@@@@#@#@<@[@[@h at h@i at i@E at F@F@ # #.#_#_#:#:#j#j#k#K#K#t{t{=$=$y{9$9$A$A$B$B$#%$%$%0%0%J{K{L{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+M{i-i-@;@;#;p;p;>>>>,>z>z>A>A>},},R,S,S,i'i'')')))S)S)m!m!n!n!$~n~n~o~o~-{-{r{s{s{w{w{x{I{I{N{N{$+. . . . ",
-". . . . 8 H+I+I+@@#@#@<@<@[@[@h at i@i at E@E at F@F@ #.#.#_#_#:#:#j#k#k#K#K#t{=$=$y{y{9$9$A$B$B$#%#%$%$%0%a%a%G%G%)&O{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+P{@;#;#;p;p;>>,>,>z>z>A>A>},R,R,S,S,i'i'')))))S)S)m!n!n!$~$~n~n~o~-{-{r{r{s{s{w{x{x{I{I{N{N{Q{R{ #. . . . ",
-". . . . z @@@@#@#@<@<@[@h at h@i at i@E at E@F@ # #.#.#_#:#:#j#j#k#k#K#t{t{=$=$y{y{9$A$A$B$B$#%#%$%0%0%a%a%G%)&)&!&!&S{T{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+U{#;p;>>>>,>,>z>A>A>},},R,R,S,i'i'')')))))S)m!m!n!n!$~$~n~o~o~-{-{r{r{s{w{w{x{x{I{N{N{Q{Q{R{R{V{=$. . . . ",
-". . . . @.#@<@<@[@[@h at h@i at E@E at F@F@ # #.#_#_#:#:#j#j#k#K#K#t{t{=$y{y{9$9$A$A$B$#%#%$%$%0%0%a%G%G%)&)&!&!&n&W{W{X{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+Y{p;>>>>,>z>z>A>A>},},R,S,S,i'i'')')))S)S)m!m!n!$~$~n~n~o~o~-{r{r{s{s{w{w{x{I{I{N{N{Q{Q{R{V{V{Z{Z{G%. . . . ",
-". . . . 5.<@[@[@h at i@i at E@E at F@F@ #.#.#_#_#:#j#j#k#k#K#K#t{=$=$y{y{9$9$A$B$B$#%#%$%$%0%a%a%G%G%)&!&!&n&n&W{W{ *`{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+ ],>,>z>z>A>},},R,R,S,S,i'')')))))S)S)m!n!n!$~$~n~n~o~-{-{r{r{s{s{w{x{x{I{I{N{Q{Q{R{R{V{V{Z{.].]+]`*. . . . ",
-". . . . z.h at h@i at i@E at F@F@ # #.#.#_#:#:#j#j#k#k#K#t{t{=$=$y{9$9$A$A$B$B$#%$%$%0%0%a%a%G%)&)&!&!&n&n&W{ * *d*d*@]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+#]z>A>A>},},R,R,S,i'i'')')))))S)m!m!n!n!$~n~n~o~o~-{-{r{s{s{w{w{x{x{I{N{N{Q{Q{R{R{V{Z{Z{.].]+]+]$],>. . . . ",
-". . . . #+i at E@E at F@F@ # #.#_#_#:#:#j#k#k#K#K#t{t{=$y{y{9$9$A$A$B$#%#%$%$%0%0%a%G%G%)&)&!&n&n&W{W{ * *d*e*e*`*%]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+&]*]A>},R,R,S,S,i'i'')))))S)S)m!m!n!$~$~n~n~o~o~-{r{r{s{s{w{w{x{I{I{N{N{Q{R{R{V{V{Z{Z{.]+]+]$]$]=]=])). . . . ",
-". . . . (+E at F@ # #.#.#_#_#:#j#j#k#k#K#K#t{=$=$y{y{9$9$A$B$B$#%#%$%0%0%a%a%G%G%)&!&!&n&n&W{W{ *d*d*e*e*`*`* =-]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+;]},R,R,S,S,i'')')))))S)S)m!n!n!$~$~n~o~o~-{-{r{r{s{w{w{x{x{I{I{N{Q{Q{R{R{V{V{Z{.].]+]+]$]$]=]>]>],]S). . . . ",
-". . . . R. # #.#.#_#:#:#j#j#k#K#K#t{t{=$=$y{9$9$A$A$B$B$#%$%$%0%0%a%a%G%)&)&!&!&n&W{W{ * *d*d*e*`*`* = =i='])]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+!]S,S,i'i'')')))S)S)m!m!n!n!$~n~n~o~o~-{-{r{s{s{w{w{x{x{I{N{N{Q{Q{R{V{V{Z{Z{.].]+]$]$]=]=]>]>],]~]~]},. . . . ",
-". . . . z..#_#_#:#:#j#k#k#K#K#t{t{=$y{y{9$9$A$A$B$#%#%$%$%0%a%a%G%G%)&)&!&n&n&W{W{ * *d*e*e*`*`* = =i=.-.-{]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+)]]]i'i'')))))S)S)m!m!n!$~$~n~n~o~-{-{r{r{s{s{w{x{x{I{I{N{N{Q{R{R{V{V{Z{Z{.]+]+]$]$]=]=]>],],]~]~]^]/]i-. . . . ",
-". . . . 7._#:#j#j#k#k#K#t{t{=$=$y{y{9$A$A$B$B$#%#%$%0%0%a%a%G%G%)&!&!&n&n&W{ * *d*d*e*e*`* = =i=i=.-.-+-i-(]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+_]')')))))S)m!m!n!n!$~$~n~o~o~-{-{r{r{s{w{w{x{x{I{I{N{Q{Q{R{R{V{Z{Z{.].]+]+]$]=]=]>]>],],]~]^]^]/]/]:]d*. . . . ",
-". . . . ].j#j#k#K#K#t{t{=$=$y{9$9$A$A$B$B$#%$%$%0%0%a%G%G%)&)&!&!&n&W{W{ * *d*d*e*`*`* = =i=i=.-+-+-i-i-@;<]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+[]))S)S)m!m!n!n!$~n~n~o~o~-{r{r{s{s{w{w{x{I{I{N{N{Q{Q{R{V{V{Z{Z{.].]+]$]$]=]=]>]>],]~]~]^]^]/]:]:]}]}]a%. . . . ",
-". . . . Q k#K#K#t{=$=$y{y{9$9$A$B$B$#%#%$%$%0%a%a%G%G%)&)&!&n&n&W{W{ *d*d*e*e*`*`* =i=i=.-.-+-+-i-@;@;#;|]G{w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+1]S)m!n!n!$~$~n~n~o~-{-{r{r{s{s{w{x{x{I{I{N{N{Q{R{R{V{V{Z{.].]+]+]$]$]=]>]>],],]~]~]^]/]/]:]:]}]}]2]3]y{. . . . ",
-". . . . 9 t{t{=$=$y{y{9$A$A$B$B$#%#%$%0%0%a%a%G%)&)&!&!&n&n&W{ * *d*d*e*e*`* = =i=i=.-.-+-i-i-@;@;#;p;p;4]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+5]m!n!n!$~$~n~o~o~-{-{r{s{s{w{w{x{x{I{N{N{Q{Q{R{R{V{Z{Z{.].]+]+]$]=]=]>]>],],]~]^]^]/]/]:]}]}]2]2]3]3]6]#@. . . . ",
-". . . . > =$y{y{9$9$A$A$B$#%#%$%$%0%0%a%G%G%)&)&!&!&n&W{W{ * *d*e*e*`*`* = =i=.-.-+-+-i-i-@;#;#;p;p;>>>>7]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+8]$~$~n~n~o~o~-{r{r{s{s{w{w{x{I{I{N{N{Q{Q{R{V{V{Z{Z{.]+]+]$]$]=]=]>],],]~]~]^]^]/]:]:]}]}]2]2]3]6]6]9]9]@.. . . . ",
-"  . . . / y{9$9$A$B$B$#%#%$%$%0%a%a%G%G%)&!&!&n&n&W{W{ *d*d*e*e*`*`* =i=i=.-.-+-+-i-@;@;#;#;p;>>>>,>,>z>0]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+a]n~n~o~-{-{r{r{s{w{w{x{x{I{I{N{Q{Q{R{R{V{V{Z{.].]+]+]$]$]=]>]>],],]~]~]^]/]/]:]:]}]2]2]3]3]6]9]9]9]9]9], . . .   ",
-"  . . . B A$A$B$B$#%$%$%0%0%a%a%G%)&)&!&!&n&n&W{ * *d*d*e*e*`* = =i=i=.-+-+-i-i-@;@;#;p;p;>>>>,>,>z>A>b]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+c]d]o~-{-{r{s{s{w{w{x{x{I{N{N{Q{Q{R{R{V{Z{Z{.].]+]$]$]=]=]>]>],]~]~]^]^]/]/]:]}]}]2]2]3]3]6]9]9]9]9]9]9]6]@ . . .   ",
-"  . . . .  ##%#%$%$%0%0%a%G%G%)&)&!&n&n&W{W{ * *d*e*e*`*`* = =i=.-.-+-+-i-i-@;#;#;p;p;>>,>,>z>z>A>A>},e]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+f]-{r{r{s{s{w{x{x{I{I{N{N{Q{R{R{V{V{Z{Z{.]+]+]$]$]=]=]>],],]~]~]^]^]/]:]:]}]}]2]3]3]6]6]9]9]9]9]9]9]9]9]N{. . . .   ",
-"  . . . . (+$%0%0%a%a%G%G%)&!&!&n&n&W{W{ *d*d*e*e*`*`* =i=i=.-.-+-i-i-@;@;#;#;p;>>>>,>,>z>z>A>},},R,R,g]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+h]r{s{w{w{x{x{I{I{N{Q{Q{R{R{V{V{Z{.].]+]+]$]=]=]>]>],],]~]^]^]/]/]:]:]}]2]2]3]3]6]9]9]9]9]9]9]9]9]9]9]9]@;. . . .   ",
-"  . . . . @.0%a%a%G%)&)&!&!&n&W{W{ * *d*d*e*`*`* = =i=i=.-+-+-i-i-@;@;#;p;p;>>>>,>z>z>A>A>},},R,S,S,i]|!w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+|!j]w{w{x{I{I{N{N{Q{Q{R{V{V{Z{Z{.].]+]$]$]=]=]>]>],]~]~]^]^]/]/]:]}]}]2]2]3]6]6]9]9]9]9]9]9]9]9]9]9]9]9]9].#. . . .   ",
-"  . . . . , G%G%)&)&!&n&n&W{W{ * *d*e*e*`*`* = =i=.-.-+-+-i-@;@;#;#;p;p;>>,>,>z>z>A>A>},R,R,S,S,i'i'k]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+l]x{x{I{I{N{N{Q{R{R{V{V{Z{Z{.]+]+]$]$]=]>]>],],]~]~]^]/]/]:]:]}]}]2]3]3]6]6]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9 . . . .   ",
-"    . . . R a%!&!&n&n&W{ * *d*d*e*e*`* = =i=i=.-.-+-i-i-@;@;#;#;p;>>>>,>,>z>A>A>},},R,R,S,i'i'')')))m]w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+w+n]I{N{N{Q{Q{R{R{V{Z{Z{.].]+]+]$]=]=]>]>],],]~]^]^]/]/]:]:]}]2]2]3]3]6]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]2]6 . . .     ",
-"    . . . . h at n&W{W{ * *d*d*e*`*`* = =i=i=.-+-+-i-i-@;#;#;p;p;>>>>,>z>z>A>A>},},R,S,S,i'i'')')))S)o]p]w+w+w+w+q]q]q]q]q]r]r]r]r]r]r]r]r]r]s]t]u]u]v]w]V{Z{Z{.].]+]$]$]=]=]>],],]~]~]^]^]/]:]:]}]}]2]2]3]6]6]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]R,. . . .     ",
-"    . . . . #.W{ *d*d*e*e*`*`* =i=i=.-.-+-+-i-@;@;#;#;p;p;>>,>,>z>z>A>},},R,R,S,S,i'')')))))S)x]y]z]r]A]A]B]B]B]B]C]C]C]C]C]C]D]D]D]D]C]E]F]G]G]H]I]J]K]K]L]L]M]M]N]O]>],],]~]~]^]/]/]:]:]}]}]2]3]3]6]6]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]E at . . . .     ",
-"    . . . . ' d*d*e*e*`* = =i=i=.-.-+-i-i-@;@;#;p;p;>>>>,>,>z>A>A>},},R,R,S,i'i'')P]Q]l{R]S]T]U]V]W]D]D]X]X]X]Y]Y]Y]Z]Z]Z]Z]Z]Z]Z]Z]Z]Z]`] ^.^+^@^#^#^$^$^%^&^&^*^*^=^-^;^>^,^'^'^:]}]}]2]2]3]3]6]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]4 . . . .     ",
-"      . . . ] 0%`*`* = =i=.-.-+-+-i-i-@;#;#;p;p;>>>>,>z>z>A>A>},},R,S,S,i')^l{!^!^~^{^]^^^%{&{/^(^_^Z]:^:^<^<^<^[^[^[^[^[^}^}^}^}^}^}^}^|^1^2^3^4^4^5^5^6^7^8^9^9^0^0^a^a^b^c^d^e^f^g^h^i^6]6]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]+]B . . .       ",
-"      . . . . l. =i=i=.-.-+-+-i-@;@;#;#;p;>>>>,>,>z>z>A>},},R,R,S,j^k{k^k^l^m^n^#{${o^p^q^q^r^r^s^[^}^}^t^t^u^u^u^v^v^v^v^v^v^v^v^v^v^w^x^y^z^z^A^A^A^B^C^D^E^F^G^G^H^H^I^I^J^K^K^L^M^N^O^P^P^Q^R^9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]K#. . . .       ",
-"      . . . . S^i=.-+-+-i-i-@;@;#;p;p;>>>>,>,>z>A>A>},},R,R,j^k{T^U^V^W^#{X^Y^Z^`^k~ /./+/@/@/#/$/v^v^%/%/&/&/*/*/*/*/=/=/=/=/=/=/=/=/-/;/>/>/,/,/'/'/)/!/~/{/{/]/]/^/////(/_/:/</[/}/|/|/1/2/3/O^P^Q^R^9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]> . . . .       ",
-"        . . . . 9$+-i-i-@;#;#;p;p;>>,>,>z>z>A>A>},R,R,j^j{T^4/V^W^@{X^5/6/j~7/8/8/9/0/#/a/b/c/c/d/*/=/e/e/e/f/f/f/g/g/g/g/h/h/h/h/h/h/i/j/k/k/l/m/n/o/o/p/q/r/s/t/u/v/w/x/y/z/z/A/B/B/C/D/E/}/|/1/2/3/O^P^Q^R^9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]9]n~. . . .         ",
-"        . . . . Q @;@;#;#;p;>>>>,>,>z>z>A>},},R,R,j^F/4/V^W^@{G/5/6/j~7/H/I/J/K/L/M/N/O/P/P/Q/R/S/g/h/h/T/T/T/U/U/U/V/V/V/V/V/V/V/V/V/W/X/X/Y/Y/Z/`/`/ ( (.(+(@(#($(%(&(*(*(=(-(;(;(>(>(A/B/C/D/E/}/|/1/2/3/O^P^R^9]9]9]9]9]9]9]9]9]9]9]9]9]9]h+. . . .         ",
-"          . . . # +-p;p;>>>>,>z>z>A>A>},},R,j^j{T^4/W^+{G/5/,(j~'(H/)(J/K/!(M/~({(Q/](^(/(((_(:(U/U/V/<(<([([([(}(}(}(}(|(|(|(|(|(|(1(2(3(4(5(5(5(6(7(7(8(9(<(V/0(a(b(c(d(e(f(f(g(*(=(-(;(>(>(A/B/C/D/E/}/|/1/3/O^P^Q^R^9]9]9]9]9]9]9]9]9]9]}]C . . .           ",
-"          . . . . $+>>,>,>z>z>A>A>},R,R,j^j{T^h(W^@{G/,(i~'(H/)(J/0/!(i(j({(k(](l(m(n(o(p(p(q(r([(}(|(|(s(s(s(t(t(u(u(u(u(u(v(v(v(v(w(x(y(z(A(A(B(C(D(E(F(s(|(}(}(G(H(I(I(J(J(c(d(e(f(g(*(=(-(;(>(>(A/B/C/D/}/|/1/2/3/P^Q^R^9]9]9]9]9]9]9]9]9$. . . .           ",
-"          . . . . C p;z>A>A>},},R,R,j^k{T^V^W^@{K(,(j~'()(J/0/L(M(~(N(O(P(Q(R(o(S(S(p(T(U(V(W(X(t(t(u(v(v(Y(Y(Y(Z(Z(Z(`(`(`(`(`(`(`( _._+_+_+_ at _@_#_$_%_&_v(v(u(t(t(*_=_-_;_>_I(I(J(c(d(e(f(g(*(=(-(;(>(>(A/C/D/E/}/1/2/3/P^Q^9]9]9]9]9]9]2]$.. . . .           ",
-"            . . . . @@A>},},R,S,S,j{T^V^W^@{5/,(j~,_)(J/L(M(i(j(N(O(Q(R(o('_S()_!_~_{_]_^_/_(_Y(Y(Z(`(`(____:_:_:_<_<_<_[_[_[_[_[_}_|_1_1_2_2_2_2_3_4_5_____`(Z(Z(Y(6_7_8_9_0_-_;_;_>_I(I(J(d(e(f(g(*(=(-(>(>(A/B/D/E/}/1/2/P^9]9]9]9]9]9]0%. . . .             ",
-"            . . . . a },R,S,S,i'')k^W^@{5/,(j~H/)(J/L(M(i(N(O(P(Q(R('_'_)_!_a_{_^_b_c_c_d_d_e___:_:_<_[_f_g_g_h_h_h_i_i_i_i_i_j_j_k_l_m_n_n_o_o_p_p_q_g_g_[_<_<_:_r_s_t_u_7_7_7_8_9_0_-_;_>_I(J(c(d(e(f(*(=(-(>(>(A/C/D/E/|/v_9]9]9]9]9]6]! . . . .             ",
-"              . . . . h at i'i'')')))l^X^6/j~H/)(J/!(M(~(N(O(P(R(o('_S(w_a_{_^_b_x_c_y_z_A_B_C_D_f_g_h_h_i_j_j_E_E_F_F_F_G_G_G_G_G_G_H_I_I_I_I_J_K_K_L_E_E_j_i_i_h_M_N_O_P_Q_Q_s_t_u_7_7_8_9_0_;_>_I(I(J(d(e(f(*(=(-(>(>(A/C/D/v_9]9]9]9]9]!&. . . .               ",
-"              . . . . ~ z>))))S)S)n{j~7/I/J/K/M(~(N(O(l(R(o('_)_w_a_{_R_x_x_y_z_A_B_C_S_T_U_V_j_j_E_F_G_G_W_W_X_X_Y_Y_Y_Z_`_`_`_`_ :.:+:+:+:+:+:@:#:X_W_W_G_F_F_$:%:&:&:p_O_O_P_Q_s_t_u_7_8_9_0_-_;_I(I(J(d(e(f(*(=(;(>(>(B/Q^9]9]9]9]~]/ . . . .               ",
-"                . . . . ].S)S)m!n!n!q^I/K/L/~({(O(l(R(o(S()_!_a_^_R_x_y_*:A_B_C_C_T_=:-:;:>:F_G_W_X_X_Y_`_`_,:,:':':':):):):):):!:~:{:{:{:{:{:]:^:':,:,:`_Z_Y_/:(:_:_:K_K_%:&:p_O_O_P_Q_t_u_7_7_8_0_-_;_I(I(J(d(e(g(*(-(;(D/9]9]9]9]9]_+. . . .                 ",
-"                . . . . ]  *n!n!$~n~::L/M/{(k(l(m(o(S()_!_a_^_b_x_y_*:A_C_<:T_[:-:}:|:1:2:3:X_Y_`_,:':':):4:4:5:5:6:6:6:7:7:7:7:8:9:9:9:9:9:0:a:6:5:5:4:):):b:c:d:+:+:e:(:_:K_K_%:&:p_O_P_Q_s_t_7_7_8_0_-_;_I(I(c(d(f(g(=(2/9]9]9]9]n!B . . . .                 ",
-"                  . . . . ; n!n~n~o~q{N/Q/](m(n(S(p(!_~_^_b_x_y_z_A_C_<:T_f:}:|:|:2:g:h:i:j:':':):4:5:6:6:7:k:k:l:l:m:m:m:m:n:n:o:p:p:p:q:q:r:s:l:l:k:7:7:t:u:v:v:{:w:d:+:+:e:(:_:K_K_&:p_O_O_Q_s_t_7_7_9_0_;_>_I(J(c(e(*(R^9]9]9]6][ . . . .                   ",
-"                    . . . . #@o~-{-{r{x:/(((o(p(T(U({_^_c_c_z_A_C_T_T_-:}:|:y:g:z:h:i:A:B:C:5:6:7:k:k:l:m:n:n:D:D:E:E:F:F:F:F:F:G:H:H:H:H:I:J:E:E:D:D:n:m:K:L:M:9:0:v:v:{:w:d:+:+:e:_:K_K_%:p_O_P_Q_s_u_7_8_9_-_;_I(I(c(B/9]9]9]9]=$. . . .                     ",
-"                    . . . . S  =r{s{s{N:_(O:q(U(V(^_/_c_d_P:B_T_T_-:}:|:2:g:z:h:Q:A:B:R:S:T:k:l:m:n:D:D:E:F:U:U:V:V:W:W:W:X:X:X:Y:Z:Z:`: <W:W:W:V:V:U:F:.<+<@<p:q:L:M:9:0:v:v:{:w:+:+:e:(:K_K_&:p_O_P_Q_t_u_7_9_0_;_>_I(v_9]9]9]n!R . . . .                     ",
-"                      . . . . & n!w{x{x{#<q($<]_%<&<&<*<B_C_=<=:;:|:2:g:z:i:Q:-<;<R:S:><,<'<n:D:E:F:U:V:W:W:X:)<)<!<!<~<~<~<{<{<]<^</<(<~<~<~<!<_<)<X::<<<[<}<H:@<@<p:q:L:M:9:0:v:{:w:+:+:e:_:K_%:&:O_O_Q_s_u_7_8_0_-_f(9]9]9]^]! . . . .                       ",
-"                      . . . . . O x{I{N{|<1<2</_&<3<4<5<T_=<6<;:1:7<z:8<Q:-<;<R:9<><,<0<a<b<F:U:V:W:X:)<!<~<{<{<c<c<d<d<e<e<e<e<e<e<e<e<e<d<d<d<c<{<f<g<h<h<h<Z:i<[<H:@<@<p:q:M:9:0:v:{:w:+:+:(:_:K_%:p_P_P_s_t_7_8_0_3/9]9]9]^.. . . . .                       ",
-"                        . . . . . :#N{Q{Q{j<k<&<l<4<S_m<n<o<1:7<p<h:i:-<q<R:9<><,<r<a<s<t<u<W:X:)<!<~<{<c<d<e<v<v<w<w<x<x<y<y<y<y<y<y<y<x<x<z<w<w<A<B<C<D<C<E<F<h<h<i<[<}<H:@<p:q:M:9:v:v:w:d:e:e:_:K_%:p_O_P_Q_t_7_A/9]9]9]0%. . . . .                         ",
-"                          . . . . R  =R{V{V{G<H<I<m<m<n<J<K<L<8<i:Q:q<R:9<M<,<r<a<s<N<O<P<Q<R<~<{<c<d<e<v<w<x<y<S<T<U<U<V<V<V<W<W<W<V<V<V<V<U<U<X<Y<Z<`< [ [D<C<C<F<h<h<Z:[<}<H:@<p:L:M:0:v:{:w:+:e:(:K_%:&:O_P_Q_I(9]9]9]R,@ . . . .                           ",
-"                            . . . . A z>Z{.].[H<+[+[@[#[$[L<%[&[*[q<=[-[,<;[>[s<N<,[P<Q<'[F<)[![e<v<w<y<S<U<U<V<W<~[{[][][^[/[/[/[/[/[/[^[][][([_[:[:[<[Z<Z<`< [D<C<C<E<h<h<i<[<H:@<p:q:M:9:v:{:w:+:+:(:K_%:&:O_t_v_9]9]o~# . . . .                             ",
-"                            . . . . . $ m!+]$][[}[@[#[|[1[2[&[3[q<=[M<;[4[>[5[6[P<7['[F<E<C<D<8[x<y<T<V<W<~[][^[/[9[0[a[a[a[b[b[c[c[b[a[a[a[d[e[f[g[g[h[:[:[<[Z<`< [ [C<C<F<h<Z:i<}<H:@<q:L:9:v:v:w:+:+:(:K_%:&:B/9]9]Q{a . . . . .                             ",
-"                              . . . . . ! w{=]>]i[j[$[1[k[l[m[n[o[M<;[4[5[p[6[[<Z:h<E<C<D< [`<Z<q[V<W<{[^[9[0[a[b[r[r[s[t[t[t[t[u[u[t[t[v[w[x[y[z[A[A[f[g[g[:[:[<[Z<`< [D<D<E<h<h<i<[<H:@<q:L:9:v:v:w:+:e:(:K_>_9]9]=]) . . . . .                               ",
-"                                . . . . . > x{,]B[y(C[D[E[m[F[G[H[I[4[5[p[}<i<h<h<E<C<D< [`<Z<:[J[K[L[9[0[b[r[s[t[u[M[M[N[O[O[O[O[O[P[Q[R[S[T[U[U[V[y[z[A[f[g[g[:[:[Z<Z< [ [C<E<F<h<i<[<H:@<q:L:9:v:{:d:+:e:8_Q^9]=]_ . . . . .                                 ",
-"                                  . . . . . ! -{^]W[A(E[X[Y[G[Z[`[ }.}p[}<i<h<h<E<C< [ [Z<<[:[h[g[f[+}@}#}t[u[M[N[O[$}%}&}&}*}=}-};}>},},}'})}S[S[T[U[U[y[z[A[f[f[h[:[<[Z<`< [C<E<F<h<i<}<H:@<q:M:0:v:{:d:9_R^9]Q{) . . . . .                                   ",
-"                                    . . . . . / S):]!}~}Y[{}~:]}M:p:@<}<[<Z:h<E<C<D< [Z<<[:[h[f[f[A[y[V[^}/}(}_}:}*}=}<}[}}}|}1}2}3}3}4}3}5}5},}'})}S[T[T[V[y[A[A[g[h[:[<[Z< [ [C<E<h<h<i<}<@<p:L:M:0:v:9_R^9]o~a . . . . .                                     ",
-"                                      . . . . . # z>2]6}7}~:8}M:q:@<H:[<Z:F<F<C<D< [Z<Z<:[h[f[A[A[y[U[U[S[)}'},}9}0}a}b}c}d}e}e}e}e}e}d}4}d}3}3}3}5}'})}S[T[U[y[A[A[g[h[:[<[Z< [D<C<E<h<Z:[<H:@<q:M:9:-_9]9]R,# . . . . .                                       ",
-"                                        . . . . . @ $%6]6]0_9:L:p:@<}<i<h<F<E<C< [`<Z<:[h[g[f[A[y[U[U[S[)},}5}3}3}d}d}e}f}f}g}g}g}g}g}g}f}h}d}d}3}3}5},})}S[T[U[y[A[f[f[h[:[Z<`< [C<C<F<h<i<}<@<p:L:;_9]9]0%@ . . . . .                                         ",
-"                                          . . . . . . ^.^]9]i}M:@<H:[<i<h<F<C<D< [Z<<[:[g[g[A[z[V[T[S[)}'}5}3}4}4}e}f}g}j}j}k}k}k}k}k}j}j}g}f}e}d}4}3}5},})}S[U[V[z[A[f[g[:[<[Z< [D<C<F<h<Z:[<H:q:d(9]^]^.. . . . . .                                           ",
-"                                            . . . . . . ! n!9]}/_:H:[<Z:h<E<C< [`<<[<[:[g[f[A[y[U[T[S['}5}5}3}4}e}f}g}j}k}l}m}m}m}m}m}l}k}j}g}f}e}4}3}5}5}'}S[T[U[y[A[f[g[:[<[<[`< [C<E<h<Z:[<K_|/9]n!! . . . . . .                                             ",
-"                                              . . . . . . R =$6]9]i}@<Z:h<E<C< [`<Z<:[h[f[A[z[y[U[T[S['}5}3}4}d}h}g}j}k}l}l}n}o}o}o}n}m}k}k}j}g}h}d}4}3}5}'}S[T[U[y[A[A[f[h[:[Z<`< [C<E<h<@<d(9]6]=$R . . . . . .                                               ",
-"                                                  . . . . . . [ n!9]1/_:h<E<C< [`<Z<:[h[f[A[z[V[U[T[S['}5}3}4}d}h}g}j}k}l}l}n}o}o}o}n}m}k}k}j}g}h}d}4}3}5}'}S[T[U[y[A[A[f[h[:[Z<`< [C<E<K_2/9]n![ . . . . . .                                                   ",
-"                                                    . . . . . . B _+~]9]d(}<C< [`<<[:[:[g[f[A[y[U[T[S['}5}3}3}4}e}f}g}j}k}l}m}m}m}m}m}k}k}j}g}f}e}d}3}5},}'}S[T[U[y[A[f[g[:[<[Z< [ [}<f(9]~]_+B . . . . . .                                                     ",
-"                                                      . . . . . . . / !&6]P^>_p: [Z<<[:[g[f[A[z[V[U[S[)},}5}3}4}d}e}f}g}j}j}k}k}k}k}k}j}g}g}f}e}4}4}3}5}'})}S[T[V[z[A[g[h[:[<[Z<q:p}Q^6]!&/ . . . . . . .                                                       ",
-"                                                          . . . . . . . ! 0%2]9]q}d:Z<:[h[f[f[A[y[U[T[S[)},}5}3}4}d}d}h}f}g}g}g}g}g}g}f}h}e}d}d}3}3}5}'})}S[U[U[y[A[f[g[:[<[r}-(9]2]0%! . . . . . . .                                                           ",
-"                                                              . . . . . . . $.9$}]9]}/s} [h[g[A[z[y[U[T[S[)}'}5}3}3}4}d}4}d}e}e}e}e}e}d}4}4}3}3}3},}'}S[S[U[U[y[A[f[f[t}Q_|/9]}]9$$.. . . . . . .                                                               ",
-"                                                                . . . . . . . . C h+n~9]P^>_r}u}A[A[y[V[T[T[S[)}'},}5}5}3}4}3}3}3}3}4}4}3}5}5},}'})}S[T[T[V[y[A[u}r}p}Q^9]n~h+C . . . . . . . .                                                                 ",
-"                                                                    . . . . . . . . . > K#+]9]9]E/;_v}u}V[U[U[T[S[S[)}'},},}5}5}5}5},},},}'})}S[S[T[T[V[u}v}>_}/9]9]+]K#> . . . . . . . . .                                                                     ",
-"                                                                        . . . . . . . . . B 4 E at R,2]9]9]|/p}K_{:w}x}y}V[S[S[S[S[S[S[S[S[z}<[x}w}A}K_i}1/9]9]2]R,E at 4 B . . . . . . . . .                                                                         ",
-"                                                                            B}. . . . . . . . . . 6 9 .#@;N{6]9]9]9]9]9]P^}/>(e(f(>(}/P^9]9]9]9]9]6]N{@;.#9 6 . . . . . . . . . . B}                                                                            ",
-"                                                                                C}. . . . . . . . . . . . . @ , @.#@9$)&i=,>S)s{s{S),>i=)&9$#@@., @ . . . . . . . . . . . . . C}                                                                                ",
-"                                                                                      C}. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C}                                                                                      ",
-"                                                                                            D}E}. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E}D}                                                                                            ",
-"                                                                                                    F}C}B}. . . . . . . . . . . . . . . . . . . . . . B}C}F}                                                                                                    ",
-"                                                                                                              G}H}F}I}J}C}E}B}. . B}E}C}J}I}F}H}G}                                                                                                              "};
diff --git a/ima/dialogs/ClientSettingsDialog.ui b/ima/dialogs/ClientSettingsDialog.ui
deleted file mode 100644
index e941c53..0000000
--- a/ima/dialogs/ClientSettingsDialog.ui
+++ /dev/null
@@ -1,250 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <author>Tobias Doerffel</author>
- <class>ClientSettingsDialog</class>
- <widget class="QDialog" name="ClientSettingsDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>388</width>
-    <height>288</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Client settings</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../italc.qrc">
-    <normaloff>:/resources/client_settings.png</normaloff>:/resources/client_settings.png</iconset>
-  </property>
-  <property name="modal">
-   <bool>true</bool>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="spacing">
-    <number>16</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout" name="_2">
-     <property name="spacing">
-      <number>10</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/client_settings.png</pixmap>
-       </property>
-       <property name="scaledContents">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>14</pointsize>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Client settings</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QGridLayout" name="gridLayout">
-     <property name="verticalSpacing">
-      <number>4</number>
-     </property>
-     <property name="margin">
-      <number>5</number>
-     </property>
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_4">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>IP/hostname</string>
-       </property>
-       <property name="textFormat">
-        <enum>Qt::PlainText</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="hostnameEdit">
-       <property name="toolTip">
-        <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':' for specif [...]
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label_3">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>Name</string>
-       </property>
-       <property name="textFormat">
-        <enum>Qt::PlainText</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLineEdit" name="nameEdit">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="toolTip">
-        <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_5">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>MAC address</string>
-       </property>
-       <property name="textFormat">
-        <enum>Qt::PlainText</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="QLineEdit" name="macEdit">
-       <property name="toolTip">
-        <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="label_7">
-       <property name="text">
-        <string>Classroom</string>
-       </property>
-       <property name="textFormat">
-        <enum>Qt::PlainText</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <widget class="QComboBox" name="classRoomComboBox"/>
-     </item>
-     <item row="4" column="0">
-      <widget class="QLabel" name="label_9">
-       <property name="text">
-        <string>Type</string>
-       </property>
-       <property name="textFormat">
-        <enum>Qt::PlainText</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <widget class="QComboBox" name="typeComboBox">
-       <item>
-        <property name="text">
-         <string>Student computer</string>
-        </property>
-       </item>
-       <item>
-        <property name="text">
-         <string>Teacher computer</string>
-        </property>
-       </item>
-       <item>
-        <property name="text">
-         <string>Other/undefined computer</string>
-        </property>
-       </item>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>ClientSettingsDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>193</x>
-     <y>265</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>193</x>
-     <y>143</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>ClientSettingsDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>193</x>
-     <y>265</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>193</x>
-     <y>143</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/Config.ui b/ima/dialogs/Config.ui
deleted file mode 100644
index 0bd5f13..0000000
--- a/ima/dialogs/Config.ui
+++ /dev/null
@@ -1,735 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Config</class>
- <widget class="QWidget" name="Config">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>300</width>
-    <height>586</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="spacing">
-    <number>24</number>
-   </property>
-   <item>
-    <layout class="QVBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="label_2">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-         <property name="pixmap">
-          <pixmap resource="../italc.qrc">:/resources/clock.png</pixmap>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>Interval between updates</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QDoubleSpinBox" name="updateIntervalSB">
-         <property name="whatsThis">
-          <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower  [...]
-         </property>
-         <property name="suffix">
-          <string> seconds</string>
-         </property>
-         <property name="decimals">
-          <number>1</number>
-         </property>
-         <property name="minimum">
-          <double>0.100000000000000</double>
-         </property>
-         <property name="maximum">
-          <double>10.000000000000000</double>
-         </property>
-         <property name="singleStep">
-          <double>0.500000000000000</double>
-         </property>
-         <property name="value">
-          <double>0.500000000000000</double>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout">
-     <property name="spacing">
-      <number>3</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="label_6">
-         <property name="text">
-          <string/>
-         </property>
-         <property name="pixmap">
-          <pixmap resource="../italc.qrc">:/resources/userinterface.png</pixmap>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_5">
-         <property name="text">
-          <string>User interface</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="balloonToolTips">
-         <property name="toolTip">
-          <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></string>
-         </property>
-         <property name="whatsThis">
-          <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mouse- [...]
-         </property>
-         <property name="text">
-          <string>No balloon-tooltips</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="iconOnlyToolButtons">
-         <property name="toolTip">
-          <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></string>
-         </property>
-         <property name="text">
-          <string>No texts on toolbar-buttons</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_3">
-         <property name="text">
-          <string>Language:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QComboBox" name="languageCB">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <item>
-          <property name="text">
-           <string>System default</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>ar - العربية</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>cs - Česky</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>de - Deutsch</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>el - Ελληνικά</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>es - Español</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>fi - Suomi</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>fr - Français</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>he - עִבְרִית</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>hu - Magyar</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>it - Italiano</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>nl - Nederlands</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>nn - Norsk</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>pl - Polski</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>pt_br - Brasileiro</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>pt_pt - Português</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>ru - Русский</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>sk - Slovenský</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>sl - Slovenčina</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>sv - Svenska</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>tr - Türkçe</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>uk - Українська</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>zh_cn - 简体字</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>zh_tw - 簡體字</string>
-          </property>
-         </item>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="label_12">
-         <property name="pixmap">
-          <pixmap resource="../../lib/ItalcCore.qrc">:/resources/authors.png</pixmap>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_13">
-         <property name="text">
-          <string>Your role (needs according keys!)</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>10</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QComboBox" name="roleCB">
-         <property name="whatsThis">
-          <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></string>
-         </property>
-         <item>
-          <property name="text">
-           <string>Teacher</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Administrator</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Supporter</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Other</string>
-          </property>
-         </item>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="label_10">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="pixmap">
-          <pixmap resource="../italc.qrc">:/resources/remotelogon_22.png</pixmap>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_11">
-         <property name="text">
-          <string>Settings for multi-logon</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_15">
-         <property name="text">
-          <string>Domain</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLineEdit" name="domainEdit"/>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="label_16">
-         <property name="pixmap">
-          <pixmap resource="../italc.qrc">:/resources/thinclient.png</pixmap>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_17">
-         <property name="text">
-          <string>Double-click action for client-window</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>10</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer>
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QComboBox" name="clientDoubleClickActionCB">
-         <property name="whatsThis">
-          <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></string>
-         </property>
-         <item>
-          <property name="text">
-           <string>Remote control</string>
-          </property>
-          <property name="icon">
-           <iconset resource="../italc.qrc">
-            <normaloff>:/resources/remote_control.png</normaloff>:/resources/remote_control.png</iconset>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>View live in fullscreen</string>
-          </property>
-          <property name="icon">
-           <iconset resource="../italc.qrc">
-            <normaloff>:/resources/viewmag.png</normaloff>:/resources/viewmag.png</iconset>
-          </property>
-         </item>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label_8">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/info_22.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_7">
-       <property name="text">
-        <string><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
-  <include location="../../lib/ItalcCore.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/ima/dialogs/MainWindow.ui b/ima/dialogs/MainWindow.ui
deleted file mode 100644
index b90e157..0000000
--- a/ima/dialogs/MainWindow.ui
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>990</width>
-    <height>693</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>MainWindow</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../../lib/ItalcCore.qrc">
-    <normaloff>:/resources/icon64.png</normaloff>:/resources/icon64.png</iconset>
-  </property>
-  <widget class="QWidget" name="m_centralWidget">
-   <layout class="QHBoxLayout" name="m_centralLayout">
-    <property name="spacing">
-     <number>0</number>
-    </property>
-    <property name="margin">
-     <number>0</number>
-    </property>
-    <item>
-     <widget class="QScrollArea" name="m_scrollArea">
-      <property name="frameShape">
-       <enum>QFrame::NoFrame</enum>
-      </property>
-      <widget class="QWidget" name="scrollAreaWidgetContents"/>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="SideBar" name="m_sideBar">
-   <property name="windowTitle">
-    <string>toolBar</string>
-   </property>
-   <property name="movable">
-    <bool>false</bool>
-   </property>
-   <property name="iconSize">
-    <size>
-     <width>16</width>
-     <height>16</height>
-    </size>
-   </property>
-   <property name="floatable">
-    <bool>false</bool>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>LeftToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
-  <widget class="MainToolBar" name="m_toolBar">
-   <property name="windowTitle">
-    <string>toolBar</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>SideBar</class>
-   <extends>QToolBar</extends>
-   <header>SideBar.h</header>
-  </customwidget>
-  <customwidget>
-   <class>MainToolBar</class>
-   <extends>QToolBar</extends>
-   <header>MainToolBar.h</header>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="../italc.qrc"/>
-  <include location="../../lib/ItalcCore.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/ima/dialogs/Overview.ui b/ima/dialogs/Overview.ui
deleted file mode 100644
index f2c6d46..0000000
--- a/ima/dialogs/Overview.ui
+++ /dev/null
@@ -1,214 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Overview</class>
- <widget class="QWidget" name="Overview">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>289</width>
-    <height>571</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="spacing">
-    <number>20</number>
-   </property>
-   <item>
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>15</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label6">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/back.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label1">
-       <property name="text">
-        <string>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>15</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label7">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/classroom_manager_48.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label2">
-       <property name="text">
-        <string>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>15</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label9">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/snapshot_48.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label4">
-       <property name="text">
-        <string>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>15</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label10">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/config_48.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label5">
-       <property name="text">
-        <string>Of course you can configure iTALC. This is usually done using the configuration-workspace.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="QPushButton" name="aboutButton">
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>32</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>About iTALC</string>
-     </property>
-     <property name="icon">
-      <iconset resource="../italc.qrc">
-       <normaloff>:/resources/info_22.png</normaloff>:/resources/info_22.png</iconset>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>46</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/ima/dialogs/RemoteLogonDialog.ui b/ima/dialogs/RemoteLogonDialog.ui
deleted file mode 100644
index 01bbaf2..0000000
--- a/ima/dialogs/RemoteLogonDialog.ui
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <author>Tobias Doerffel</author>
- <class>RemoteLogonDialog</class>
- <widget class="QDialog" name="RemoteLogonDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>394</width>
-    <height>302</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Remote logon</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../italc.qrc">
-    <normaloff>:/resources/remotelogon_48.png</normaloff>:/resources/remotelogon_48.png</iconset>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>16</number>
-   </property>
-   <property name="margin">
-    <number>9</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>10</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/remotelogon_48.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <property name="font">
-        <font>
-         <pointsize>16</pointsize>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Remote logon</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QLabel" name="label_3">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>64</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QGridLayout">
-     <property name="horizontalSpacing">
-      <number>16</number>
-     </property>
-     <property name="verticalSpacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="userNameEdit"/>
-     </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_4">
-       <property name="text">
-        <string>Username</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label_5">
-       <property name="text">
-        <string>Password</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_6">
-       <property name="text">
-        <string>Domain</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="QLineEdit" name="domainEdit"/>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLineEdit" name="passwordEdit">
-       <property name="echoMode">
-        <enum>QLineEdit::Password</enum>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <tabstops>
-  <tabstop>userNameEdit</tabstop>
-  <tabstop>passwordEdit</tabstop>
-  <tabstop>domainEdit</tabstop>
- </tabstops>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>RemoteLogonDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>323</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>172</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>RemoteLogonDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>323</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>172</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/RunCommandsDialog.ui b/ima/dialogs/RunCommandsDialog.ui
deleted file mode 100644
index 3d8aa97..0000000
--- a/ima/dialogs/RunCommandsDialog.ui
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <author>Tobias Doerffel</author>
- <class>RunCommandsDialog</class>
- <widget class="QDialog" name="RunCommandsDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>353</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Run commands</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../italc.qrc">
-    <normaloff>:/resources/text_message_48.png</normaloff>:/resources/text_message_48.png</iconset>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>16</number>
-   </property>
-   <property name="margin">
-    <number>15</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>10</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/run.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <property name="font">
-        <font>
-         <pointsize>16</pointsize>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Run commands</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QTextEdit" name="cmdInputTextEdit"/>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>RunCommandsDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>384</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>206</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>RunCommandsDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>384</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>206</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/Snapshots.ui b/ima/dialogs/Snapshots.ui
deleted file mode 100644
index d0a8d0c..0000000
--- a/ima/dialogs/Snapshots.ui
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Snapshots</class>
- <widget class="QWidget" name="Snapshots">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>236</width>
-    <height>448</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QListView" name="list">
-     <property name="whatsThis">
-      <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QLabel" name="previewLbl">
-     <property name="scaledContents">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QGridLayout" columnstretch="0,1">
-     <property name="horizontalSpacing">
-      <number>10</number>
-     </property>
-     <property name="verticalSpacing">
-      <number>4</number>
-     </property>
-     <property name="margin">
-      <number>10</number>
-     </property>
-     <item row="1" column="1">
-      <widget class="QLabel" name="dateLbl"/>
-     </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="userDescLbl">
-       <property name="font">
-        <font>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>User:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLabel" name="userLbl"/>
-     </item>
-     <item row="2" column="1">
-      <widget class="QLabel" name="timeLbl"/>
-     </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="hostDescLbl">
-       <property name="font">
-        <font>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Host:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="dateDescLbl">
-       <property name="font">
-        <font>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Date:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <widget class="QLabel" name="hostLbl"/>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="timeDescLbl">
-       <property name="font">
-        <font>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Time:</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QPushButton" name="showBtn">
-       <property name="text">
-        <string>Show</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../italc.qrc">
-         <normaloff>:/resources/client_show.png</normaloff>:/resources/client_show.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="deleteBtn">
-       <property name="text">
-        <string>Delete</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../italc.qrc">
-         <normaloff>:/resources/cancel.png</normaloff>:/resources/cancel.png</iconset>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>16</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/ima/dialogs/SupportDialog.ui b/ima/dialogs/SupportDialog.ui
deleted file mode 100644
index 52168e4..0000000
--- a/ima/dialogs/SupportDialog.ui
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <author>Tobias Doerffel</author>
- <class>SupportDialog</class>
- <widget class="QDialog" name="SupportDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>215</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Support</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../italc.qrc">
-    <normaloff>:/resources/remote_control_48.png</normaloff>:/resources/remote_control_48.png</iconset>
-  </property>
-  <property name="modal">
-   <bool>true</bool>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>16</number>
-   </property>
-   <property name="margin">
-    <number>15</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>10</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/remote_control_48.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <property name="font">
-        <font>
-         <pointsize>16</pointsize>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Support</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QLabel" name="label_3">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text">
-      <string>Please enter the IP address or the name of the host to which you want to connect.</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QLineEdit" name="hostEdit"/>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>SupportDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>239</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>133</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>SupportDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>239</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>133</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/TextMessageDialog.ui b/ima/dialogs/TextMessageDialog.ui
deleted file mode 100644
index 8e5a617..0000000
--- a/ima/dialogs/TextMessageDialog.ui
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <author>Tobias Doerffel</author>
- <class>TextMessageDialog</class>
- <widget class="QDialog" name="TextMessageDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>353</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Send text message</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../italc.qrc">
-    <normaloff>:/resources/text_message_48.png</normaloff>:/resources/text_message_48.png</iconset>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>16</number>
-   </property>
-   <property name="margin">
-    <number>15</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>10</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/text_message_48.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <property name="font">
-        <font>
-         <pointsize>16</pointsize>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>Send text message</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Use the field below to type your message which will be sent to all selected users.</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QTextEdit" name="textEdit"/>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>TextMessageDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>384</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>206</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>TextMessageDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>384</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>206</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/italc.1 b/ima/italc.1
deleted file mode 100644
index a695c33..0000000
--- a/ima/italc.1
+++ /dev/null
@@ -1,32 +0,0 @@
-.\"                                      Hey, EMACS: -*- nroff -*-
-.\" First parameter, NAME, should be all caps
-.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
-.\" other parameters are allowed: see man(7), man(1)
-.TH ITALC 1 2013-08-12 iTALC
-.SH NAME
-italc \- iTALC Master Application
-.SH SYNOPSIS
-.B italc
-.SH DESCRIPTION
-.B iTALC
-is the actual software to control iTALC clients. Using its GUI you can remote control, lock, shutdown/reboot computers as well as show a demo, send text messages to users and much more.
-.
-.SH OPTIONS
-.IP "\fB\-rctrl\fP \fIhost:[port]\fP
-.IP
-Directly remote control the specified host. You can omit port if the server is running at the default port (11100).
-.
-.IP "\fB\-screen\fP \fI<screen-number>\fP
-.IP
-Place the remote control window on another screen if running on a multi-headed workstation.
-.
-.PP
-.SH SEE ALSO
-.IR ica (1), imc (8), italc_auth_helper(1)
-.PP
-.IR http://italc.sf.net
-.SH AUTHOR
-iTALC has been written by Tobias Doerffel. See AUTHORS for details.
-.PP
-This manual page has been written by Steffen Joeris
-and Tobias Doerffel and updated by Mike Gabriel. It was originally written for the Debian project (but may be used by others).
diff --git a/ima/italc.qrc b/ima/italc.qrc
deleted file mode 100644
index 4227448..0000000
--- a/ima/italc.qrc
+++ /dev/null
@@ -1,66 +0,0 @@
-<RCC>
-    <qresource prefix="/" >
-	<file>resources/no_mouse.png</file>
-	<file>resources/fullscreen.png</file>
-	<file>resources/quit.png</file>
-        <file>resources/adjust_size.png</file>
-        <file>resources/auto_arrange.png</file>
-        <file>resources/back.png</file>
-        <file>resources/cancel.png</file>
-        <file>resources/classroom_add.png</file>
-        <file>resources/classroom_remove.png</file>
-        <file>resources/classroom_show.png</file>
-        <file>resources/client_settings.png</file>
-        <file>resources/client.png</file>
-        <file>resources/client_add.png</file>
-        <file>resources/client_demo.png</file>
-        <file>resources/client_hidden.png</file>
-        <file>resources/classroom_manager.png</file>
-        <file>resources/classroom_manager_48.png</file>
-        <file>resources/client_remove.png</file>
-        <file>resources/client_show.png</file>
-        <file>resources/client_visible.png</file>
-        <file>resources/clock.png</file>
-        <file>resources/config.png</file>
-        <file>resources/config_48.png</file>
-        <file>resources/error.png</file>
-        <file>resources/filesave.png</file>
-        <file>resources/fullscreen_demo.png</file>
-        <file>resources/help.png</file>
-        <file>resources/host_unreachable.png</file>
-        <file>resources/info.png</file>
-        <file>resources/info_22.png</file>
-        <file>resources/locked.png</file>
-        <file>resources/logout.png</file>
-        <file>resources/remotelogon.png</file>
-        <file>resources/remotelogon_22.png</file>
-        <file>resources/remotelogon_48.png</file>
-        <file>resources/network.png</file>
-        <file>resources/no_user.png</file>
-        <file>resources/overview.png</file>
-        <file>resources/overview_mode.png</file>
-        <file>resources/power_off.png</file>
-        <file>resources/power_on.png</file>
-        <file>resources/reboot.png</file>
-        <file>resources/remote_control.png</file>
-        <file>resources/remote_control_48.png</file>
-        <file>resources/run.png</file>
-        <file>resources/snapshot.png</file>
-        <file>resources/snapshot_48.png</file>
-        <file>resources/splash.png</file>
-        <file>resources/stop.png</file>
-        <file>resources/text_message.png</file>
-        <file>resources/text_message_48.png</file>
-        <file>resources/tray-menu-bg.png</file>
-        <file>resources/thinclient.png</file>
-        <file>resources/toolbar.png</file>
-        <file>resources/classroom.png</file>
-        <file>resources/userinterface.png</file>
-        <file>resources/users.png</file>
-        <file>resources/users_48.png</file>
-        <file>resources/viewmag.png</file>
-        <file>resources/window_demo.png</file>
-        <file>resources/greenled.png</file>
-        <file>resources/toolbar-background.png</file>
-    </qresource>
-</RCC>
diff --git a/ima/italc.rc b/ima/italc.rc
deleted file mode 100644
index fece217..0000000
--- a/ima/italc.rc
+++ /dev/null
@@ -1,26 +0,0 @@
-italcicon ICON data/italc.ico
-#include <windows.h>
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	2,0,2,0
-  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-  FILEOS	VOS_NT_WINDOWS32
-  FILETYPE	VFT_APP
-  FILESUBTYPE	VFT2_UNKNOWN
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, charset = Windows, Multilingual
-    BEGIN
-      VALUE "Comments",		"Intelligent Teaching And Learning with Computers (http://italc.sf.net)\0"
-      VALUE "CompanyName",	"iTALC Solutions\0"
-      VALUE "FileDescription",	"iTALC Master Application\0"
-      VALUE "FileVersion",	"\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2004-2014 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"italc.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"\0"
-    END
-  END
-END
diff --git a/ima/italc.rc.in b/ima/italc.rc.in
deleted file mode 100644
index d84ebf1..0000000
--- a/ima/italc.rc.in
+++ /dev/null
@@ -1,26 +0,0 @@
-italcicon ICON data/italc.ico
-#include <windows.h>
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	2,0,2,0
-  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-  FILEOS	VOS_NT_WINDOWS32
-  FILETYPE	VFT_APP
-  FILESUBTYPE	VFT2_UNKNOWN
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, charset = Windows, Multilingual
-    BEGIN
-      VALUE "Comments",		"Intelligent Teaching And Learning with Computers (http://italc.sf.net)\0"
-      VALUE "CompanyName",	"iTALC Solutions\0"
-      VALUE "FileDescription",	"iTALC Master Application\0"
-      VALUE "FileVersion",	"@PACKAGE_VERSION@\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2004-2014 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"italc.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"@PACKAGE_VERSION@\0"
-    END
-  END
-END
diff --git a/ima/resources/adjust_size.png b/ima/resources/adjust_size.png
deleted file mode 100644
index 29b2083..0000000
Binary files a/ima/resources/adjust_size.png and /dev/null differ
diff --git a/ima/resources/auto_arrange.png b/ima/resources/auto_arrange.png
deleted file mode 100644
index b5abc95..0000000
Binary files a/ima/resources/auto_arrange.png and /dev/null differ
diff --git a/ima/resources/back.png b/ima/resources/back.png
deleted file mode 100644
index 2741394..0000000
Binary files a/ima/resources/back.png and /dev/null differ
diff --git a/ima/resources/cancel.png b/ima/resources/cancel.png
deleted file mode 100644
index 351659b..0000000
Binary files a/ima/resources/cancel.png and /dev/null differ
diff --git a/ima/resources/classroom.png b/ima/resources/classroom.png
deleted file mode 100644
index f396c07..0000000
Binary files a/ima/resources/classroom.png and /dev/null differ
diff --git a/ima/resources/classroom_add.png b/ima/resources/classroom_add.png
deleted file mode 100644
index 409d839..0000000
Binary files a/ima/resources/classroom_add.png and /dev/null differ
diff --git a/ima/resources/classroom_manager.png b/ima/resources/classroom_manager.png
deleted file mode 100644
index 7431dd1..0000000
Binary files a/ima/resources/classroom_manager.png and /dev/null differ
diff --git a/ima/resources/classroom_manager_48.png b/ima/resources/classroom_manager_48.png
deleted file mode 100644
index bd85129..0000000
Binary files a/ima/resources/classroom_manager_48.png and /dev/null differ
diff --git a/ima/resources/classroom_remove.png b/ima/resources/classroom_remove.png
deleted file mode 100644
index af4f58e..0000000
Binary files a/ima/resources/classroom_remove.png and /dev/null differ
diff --git a/ima/resources/classroom_show.png b/ima/resources/classroom_show.png
deleted file mode 100644
index 1ddf34f..0000000
Binary files a/ima/resources/classroom_show.png and /dev/null differ
diff --git a/ima/resources/client.png b/ima/resources/client.png
deleted file mode 100644
index e2659fc..0000000
Binary files a/ima/resources/client.png and /dev/null differ
diff --git a/ima/resources/client_add.png b/ima/resources/client_add.png
deleted file mode 100644
index 7a68b01..0000000
Binary files a/ima/resources/client_add.png and /dev/null differ
diff --git a/ima/resources/client_demo.png b/ima/resources/client_demo.png
deleted file mode 100644
index 0736ed0..0000000
Binary files a/ima/resources/client_demo.png and /dev/null differ
diff --git a/ima/resources/client_hidden.png b/ima/resources/client_hidden.png
deleted file mode 100644
index 9f8aba3..0000000
Binary files a/ima/resources/client_hidden.png and /dev/null differ
diff --git a/ima/resources/client_remove.png b/ima/resources/client_remove.png
deleted file mode 100644
index edc0406..0000000
Binary files a/ima/resources/client_remove.png and /dev/null differ
diff --git a/ima/resources/client_settings.png b/ima/resources/client_settings.png
deleted file mode 100644
index f761763..0000000
Binary files a/ima/resources/client_settings.png and /dev/null differ
diff --git a/ima/resources/client_show.png b/ima/resources/client_show.png
deleted file mode 100644
index 536e07d..0000000
Binary files a/ima/resources/client_show.png and /dev/null differ
diff --git a/ima/resources/client_visible.png b/ima/resources/client_visible.png
deleted file mode 100644
index d596d20..0000000
Binary files a/ima/resources/client_visible.png and /dev/null differ
diff --git a/ima/resources/clock.png b/ima/resources/clock.png
deleted file mode 100644
index 136dadb..0000000
Binary files a/ima/resources/clock.png and /dev/null differ
diff --git a/ima/resources/config.png b/ima/resources/config.png
deleted file mode 100644
index b6c1a80..0000000
Binary files a/ima/resources/config.png and /dev/null differ
diff --git a/ima/resources/config_48.png b/ima/resources/config_48.png
deleted file mode 100644
index ce853b1..0000000
Binary files a/ima/resources/config_48.png and /dev/null differ
diff --git a/ima/resources/error.png b/ima/resources/error.png
deleted file mode 100644
index e4ddd42..0000000
Binary files a/ima/resources/error.png and /dev/null differ
diff --git a/ima/resources/filesave.png b/ima/resources/filesave.png
deleted file mode 100644
index b593aea..0000000
Binary files a/ima/resources/filesave.png and /dev/null differ
diff --git a/ima/resources/fullscreen.png b/ima/resources/fullscreen.png
deleted file mode 100644
index 68e5c0d..0000000
Binary files a/ima/resources/fullscreen.png and /dev/null differ
diff --git a/ima/resources/fullscreen_demo.png b/ima/resources/fullscreen_demo.png
deleted file mode 100644
index 4f34228..0000000
Binary files a/ima/resources/fullscreen_demo.png and /dev/null differ
diff --git a/ima/resources/greenled.png b/ima/resources/greenled.png
deleted file mode 100644
index 0e10788..0000000
Binary files a/ima/resources/greenled.png and /dev/null differ
diff --git a/ima/resources/help.png b/ima/resources/help.png
deleted file mode 100644
index 403c27d..0000000
Binary files a/ima/resources/help.png and /dev/null differ
diff --git a/ima/resources/host_unreachable.png b/ima/resources/host_unreachable.png
deleted file mode 100644
index 6c94fac..0000000
Binary files a/ima/resources/host_unreachable.png and /dev/null differ
diff --git a/ima/resources/info.png b/ima/resources/info.png
deleted file mode 100644
index 8f3a936..0000000
Binary files a/ima/resources/info.png and /dev/null differ
diff --git a/ima/resources/info_22.png b/ima/resources/info_22.png
deleted file mode 100644
index a5607bc..0000000
Binary files a/ima/resources/info_22.png and /dev/null differ
diff --git a/ima/resources/locked.png b/ima/resources/locked.png
deleted file mode 100644
index 8ababa1..0000000
Binary files a/ima/resources/locked.png and /dev/null differ
diff --git a/ima/resources/logout.png b/ima/resources/logout.png
deleted file mode 100644
index ee9cd60..0000000
Binary files a/ima/resources/logout.png and /dev/null differ
diff --git a/ima/resources/network.png b/ima/resources/network.png
deleted file mode 100644
index 92f0509..0000000
Binary files a/ima/resources/network.png and /dev/null differ
diff --git a/ima/resources/no_mouse.png b/ima/resources/no_mouse.png
deleted file mode 100644
index 4dbe19e..0000000
Binary files a/ima/resources/no_mouse.png and /dev/null differ
diff --git a/ima/resources/no_user.png b/ima/resources/no_user.png
deleted file mode 100644
index 9056090..0000000
Binary files a/ima/resources/no_user.png and /dev/null differ
diff --git a/ima/resources/overview.png b/ima/resources/overview.png
deleted file mode 100644
index 1424ff6..0000000
Binary files a/ima/resources/overview.png and /dev/null differ
diff --git a/ima/resources/overview_mode.png b/ima/resources/overview_mode.png
deleted file mode 100644
index 87fbd1c..0000000
Binary files a/ima/resources/overview_mode.png and /dev/null differ
diff --git a/ima/resources/power_off.png b/ima/resources/power_off.png
deleted file mode 100644
index 2196355..0000000
Binary files a/ima/resources/power_off.png and /dev/null differ
diff --git a/ima/resources/power_on.png b/ima/resources/power_on.png
deleted file mode 100644
index 0dbfa94..0000000
Binary files a/ima/resources/power_on.png and /dev/null differ
diff --git a/ima/resources/quit.png b/ima/resources/quit.png
deleted file mode 100644
index dd76354..0000000
Binary files a/ima/resources/quit.png and /dev/null differ
diff --git a/ima/resources/reboot.png b/ima/resources/reboot.png
deleted file mode 100644
index d84366b..0000000
Binary files a/ima/resources/reboot.png and /dev/null differ
diff --git a/ima/resources/remote_control.png b/ima/resources/remote_control.png
deleted file mode 100644
index 19df791..0000000
Binary files a/ima/resources/remote_control.png and /dev/null differ
diff --git a/ima/resources/remote_control_48.png b/ima/resources/remote_control_48.png
deleted file mode 100644
index 5365b91..0000000
Binary files a/ima/resources/remote_control_48.png and /dev/null differ
diff --git a/ima/resources/remotelogon.png b/ima/resources/remotelogon.png
deleted file mode 100644
index f6022cc..0000000
Binary files a/ima/resources/remotelogon.png and /dev/null differ
diff --git a/ima/resources/remotelogon_22.png b/ima/resources/remotelogon_22.png
deleted file mode 100644
index 9dc25b2..0000000
Binary files a/ima/resources/remotelogon_22.png and /dev/null differ
diff --git a/ima/resources/remotelogon_48.png b/ima/resources/remotelogon_48.png
deleted file mode 100644
index 5c387da..0000000
Binary files a/ima/resources/remotelogon_48.png and /dev/null differ
diff --git a/ima/resources/run.png b/ima/resources/run.png
deleted file mode 100644
index 0fc52ba..0000000
Binary files a/ima/resources/run.png and /dev/null differ
diff --git a/ima/resources/snapshot.png b/ima/resources/snapshot.png
deleted file mode 100644
index e5250ae..0000000
Binary files a/ima/resources/snapshot.png and /dev/null differ
diff --git a/ima/resources/snapshot_48.png b/ima/resources/snapshot_48.png
deleted file mode 100644
index 8152005..0000000
Binary files a/ima/resources/snapshot_48.png and /dev/null differ
diff --git a/ima/resources/splash.png b/ima/resources/splash.png
deleted file mode 100644
index eea8cf6..0000000
Binary files a/ima/resources/splash.png and /dev/null differ
diff --git a/ima/resources/stop.png b/ima/resources/stop.png
deleted file mode 100644
index 32626f0..0000000
Binary files a/ima/resources/stop.png and /dev/null differ
diff --git a/ima/resources/text_message.png b/ima/resources/text_message.png
deleted file mode 100644
index f2e1c17..0000000
Binary files a/ima/resources/text_message.png and /dev/null differ
diff --git a/ima/resources/text_message_48.png b/ima/resources/text_message_48.png
deleted file mode 100644
index 5f48da8..0000000
Binary files a/ima/resources/text_message_48.png and /dev/null differ
diff --git a/ima/resources/thinclient.png b/ima/resources/thinclient.png
deleted file mode 100644
index 3e1794b..0000000
Binary files a/ima/resources/thinclient.png and /dev/null differ
diff --git a/ima/resources/toolbar-background.png b/ima/resources/toolbar-background.png
deleted file mode 100644
index c6c5bf5..0000000
Binary files a/ima/resources/toolbar-background.png and /dev/null differ
diff --git a/ima/resources/toolbar.png b/ima/resources/toolbar.png
deleted file mode 100644
index c15de4e..0000000
Binary files a/ima/resources/toolbar.png and /dev/null differ
diff --git a/ima/resources/tray-menu-bg.png b/ima/resources/tray-menu-bg.png
deleted file mode 100644
index 807108a..0000000
Binary files a/ima/resources/tray-menu-bg.png and /dev/null differ
diff --git a/ima/resources/userinterface.png b/ima/resources/userinterface.png
deleted file mode 100644
index 973b409..0000000
Binary files a/ima/resources/userinterface.png and /dev/null differ
diff --git a/ima/resources/users.png b/ima/resources/users.png
deleted file mode 100644
index 0154cc7..0000000
Binary files a/ima/resources/users.png and /dev/null differ
diff --git a/ima/resources/users_48.png b/ima/resources/users_48.png
deleted file mode 100644
index 4bd2e35..0000000
Binary files a/ima/resources/users_48.png and /dev/null differ
diff --git a/ima/resources/viewmag.png b/ima/resources/viewmag.png
deleted file mode 100644
index d1a6c56..0000000
Binary files a/ima/resources/viewmag.png and /dev/null differ
diff --git a/ima/resources/window.png b/ima/resources/window.png
deleted file mode 100644
index 68e5c0d..0000000
Binary files a/ima/resources/window.png and /dev/null differ
diff --git a/ima/resources/window_demo.png b/ima/resources/window_demo.png
deleted file mode 100644
index 004a519..0000000
Binary files a/ima/resources/window_demo.png and /dev/null differ
diff --git a/ima/src/ClassroomManager.cpp b/ima/src/ClassroomManager.cpp
deleted file mode 100644
index 2956fa4..0000000
--- a/ima/src/ClassroomManager.cpp
+++ /dev/null
@@ -1,2187 +0,0 @@
-/*
- * ClassroomManager.cpp - implementation of classroom-manager
- *
- * Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-#include <math.h>
-
-#include <QtCore/QDateTime>
-#include <QtCore/QTextStream>
-#include <QtCore/QTimer>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QCloseEvent>
-#include <QtGui/QFileDialog>
-#include <QtGui/QHeaderView>
-#include <QtGui/QInputDialog>
-#include <QtGui/QLabel>
-#include <QtGui/QMenu>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPixmap>
-#include <QtGui/QPushButton>
-#include <QtGui/QSplashScreen>
-#include <QtGui/QSplitter>
-#include <QtGui/QPainter>
-
-
-#include "MainWindow.h"
-#include "ClassroomManager.h"
-#include "Client.h"
-#include "Dialogs.h"
-#include "RunCommandsDialog.h"
-#include "ItalcConfiguration.h"
-#include "LocalSystem.h"
-#include "ToolButton.h"
-#include "DecoratedMessageBox.h"
-
-#define DEFAULT_WINDOW_WIDTH	1005
-#define DEFAULT_WINDOW_HEIGHT	700
-
-
-template<typename T>
-inline T roundCorrect( T _val )
-{
-	if( _val - floor( _val ) < 0.5 )
-	{
-		return( floor( _val ) );
-	}
-	return( ceil( _val ) );
-}
-
-
-
-
-const int widths[] = { 128, 192, 256, 320, 384, 448, 512, 0 };
-
-
-
-QPixmap * classRoomItem::s_clientPixmap = NULL;
-QPixmap * classRoomItem::s_clientObservedPixmap = NULL;
-
-
-
-ClassroomManager::ClassroomManager( MainWindow * _main_window,
-							QWidget * _parent ) :
-	SideBarWidget( QPixmap( ":/resources/classroom_manager.png" ),
-			tr( "Classroom-Manager" ),
-			tr( "Use this workspace to manage your computers and "
-				"classrooms in an easy way." ),
-			_main_window, _parent ),
-	m_personalConfiguration( LocalSystem::Path::expand( ItalcCore::config->personalConfigurationPath() ) ),
-	m_globalClientConfiguration( LocalSystem::Path::expand( ItalcCore::config->globalConfigurationPath() ) ),
-	m_quickSwitchMenu( new QMenu( this ) ),
-	m_qsmClassRoomSeparator( m_quickSwitchMenu->addSeparator() ),
-	m_globalClientMode( Client::Mode_Overview ),
-	m_clientUpdateInterval( 500 ),
-	m_autoArranged( false )
-{
-	// some code called out of this function relies on m_classroomManager
-	// which actually is assigned after this function returns
-	_main_window->m_classroomManager = this;
-
-	QVBoxLayout * l = new QVBoxLayout( contentParent() );
-
-	m_view = new classTreeWidget( contentParent() );
-	l->addWidget( m_view );
-	m_view->setWhatsThis( tr( "This is where computers and classrooms are "
-					"managed. You can add computers or "
-					"classrooms by clicking right "
-					"in this list." ) );
-
-	QStringList columns;
-	columns << tr( "Classrooms/computers" ) << tr( "IP-address" ) << tr( "Usernames" );
-	m_view->setHeaderLabels( columns );
-	m_view->hideColumn( 2 );
-	m_view->setSelectionMode( QTreeWidget::ExtendedSelection );
-	m_view->setIconSize( QSize( 22, 22 ) );
-	m_view->header()->resizeSection( m_view->header()->logicalIndex( 0 ),
-									200 );
-	m_view->setSortingEnabled( TRUE );
-	m_view->setRootIsDecorated( TRUE );
-	m_view->sortItems( 0, Qt::AscendingOrder );
-//	m_view->setShowToolTips( TRUE );
-	m_view->setWindowTitle( tr( "Classroom-Manager" ) );
-	m_view->setContextMenuPolicy( Qt::CustomContextMenu );
-	connect( m_view, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ),
-		this, SLOT( itemDoubleClicked( QTreeWidgetItem *, int ) ) );
-	connect( m_view, SIGNAL( customContextMenuRequested( const QPoint & ) ),
-		this, SLOT( contextMenuRequest( const QPoint & ) ) );
-
-	QFont f;
-	f.setPixelSize( 12 );
-
-	m_showUsernameCheckBox = new QCheckBox( tr( "Show usernames" ), contentParent() );
-	m_showUsernameCheckBox->setFont( f );
-	l->addWidget( m_showUsernameCheckBox );
-	connect( m_showUsernameCheckBox, SIGNAL( stateChanged( int ) ),
-			this, SLOT( showUserColumn( int ) ) );
-
-	l->addSpacing( 5 );
-	QLabel * help_txt = new QLabel(
-		tr( "Use the context-menu (right mouse-button) to add/remove "
-			"computers and/or classrooms." ), contentParent() );
-	l->addWidget( help_txt );
-	help_txt->setWordWrap( TRUE );
-	help_txt->setFont( f );
-
-	l->addSpacing( 16 );
-
-	m_exportToFileBtn = new QPushButton(
-				QPixmap( ":/resources/filesave.png" ),
-						tr( "Export to text-file" ),
-							contentParent() );
-	l->addWidget( m_exportToFileBtn );
-	connect( m_exportToFileBtn, SIGNAL( clicked() ),
-			this, SLOT( clickedExportToFile() ) );
-	m_exportToFileBtn->setWhatsThis( tr( "Use this button for exporting "
-				"this list of computers and usernames into "
-				"a text-file. You can use this file "
-				"later for collecting files "
-				"after an exam has finished. "
-				"This is sometimes neccessary, "
-				"because some users might have "
-				"finished and logged out "
-				"earlier and so you cannot "
-				"collect their files at the "
-				"end of the exam." ) );
-
-	setupMenus();
-
-	loadGlobalClientConfig();
-	loadPersonalConfig();
-
-	show();
-}
-
-
-
-
-void ClassroomManager::setupMenus()
-{
-	QAction * act;
-	QAction * separator = new QAction( this );
-	separator->setSeparator( TRUE );
-
-	/*** quick workspace menu ***/
-
-	m_quickSwitchMenu->addAction( tr( "Hide teacher computers" ),
-					this, SLOT( hideTeacherClients() ) );
-
-/*	m_quickSwitchMenu->addSeparator();
-
-	m_quickSwitchMenu->addAction( QPixmap( ":/resources/adjust_size.png" ),
-				tr( "Adjust windows and their size" ),
-						this, SLOT( adjustWindows() ) );
-
-	m_quickSwitchMenu->addAction(
-				QPixmap( ":/resources/auto_arrange.png" ),
-				tr( "Auto re-arrange windows" ),
-					this, SLOT( arrangeWindows() ) );*/
-
-	/*** actions for single client in context Menu ***/
-
-	m_classRoomItemActionGroup = new QActionGroup( this );
-
-	act = m_classRoomItemActionGroup->addAction( 
-			QPixmap( ":/resources/client_show.png" ),
-			tr( "Show/hide" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( showHideClient() ) );
-
-	act = m_classRoomItemActionGroup->addAction( 
-			QPixmap( ":/resources/config.png" ),
-			tr( "Edit settings" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( editClientSettings() ) );
-
-	act = m_classRoomItemActionGroup->addAction(
-			QPixmap( ":/resources/client_remove.png" ),
-			tr( "Remove" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( removeClient() ) );
-
-	m_classRoomItemActionGroup->addAction( "" )->setSeparator( TRUE );
-
-	/*** actions for single classroom in context Menu ***/
-
-	m_classRoomActionGroup = new QActionGroup( this );
-
-	act = m_classRoomActionGroup->addAction(
-			QPixmap( ":/resources/classroom_show.png" ),
-			tr( "Show all computers in classroom" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( showSelectedClassRooms() ) );
-
-	act = m_classRoomActionGroup->addAction(
-			QPixmap( ":/resources/classroom_closed.png" ),
-			tr( "Hide all computers in classroom" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( hideSelectedClassRooms() ) );
-
-	act = m_classRoomActionGroup->addAction(
-			QPixmap( ":/resources/no_user.png" ),
-			tr( "Hide teacher computers" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( hideTeacherClients() ) );
-
-	act = m_classRoomActionGroup->addAction(
-			QPixmap( ":/resources/config.png" ),
-			tr( "Edit name" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( editClassRoomName() ) );
-
-	act = m_classRoomActionGroup->addAction(
-			QPixmap( ":/resources/classroom_remove.png" ),
-			tr("Remove classroom" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( removeClassRoom() ) );
-
-	m_classRoomActionGroup->addAction( "" )->setSeparator( TRUE );
-
-	/*** common actions in context menu ***/
-
-	m_contextActionGroup = new QActionGroup( this );
-
-	act = m_contextActionGroup->addAction(
-			QPixmap( ":/resources/client_add.png" ),
-			tr( "Add computer" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( addClient() ) );
-
-	act = m_contextActionGroup->addAction(
-			QPixmap( ":/resources/classroom_add.png" ),
-			tr( "Add classroom" ) );
-	connect( act, SIGNAL( triggered() ), this, SLOT( addClassRoom() ) );
-
-	/*** Default client Menu ***/
-
-	m_clientMenu = clientMenu::createDefault( this );
-	
-}
-
-
-
-
-ClassroomManager::~ClassroomManager()
-{
-}
-
-
-
-
-void ClassroomManager::doCleanupWork( void )
-{
-	while( m_clientsToRemove.size() )
-	{
-		delete m_clientsToRemove.first();
-		m_clientsToRemove.erase( m_clientsToRemove.begin() );
-	}
-
-	while( m_classRoomsToRemove.size() )
-	{
-		QVector<classRoom *>::iterator it =
-				qFind( m_classRooms.begin(), m_classRooms.end(),
-						m_classRoomsToRemove.first() );
-		if( it != m_classRooms.end() )
-		{
-			m_classRooms.erase( it );
-		}
-		delete m_classRoomsToRemove.first();
-		m_classRoomsToRemove.erase( m_classRoomsToRemove.begin() );
-	}
-}
-
-
-
-
-void ClassroomManager::saveGlobalClientConfig( void )
-{
-	QDomDocument doc( "italc-config-file" );
-
-	QDomElement italc_config = doc.createElement( "globalclientconfig" );
-	italc_config.setAttribute( "version", ITALC_VERSION );
-	doc.appendChild( italc_config );
-
-	QDomElement root = doc.createElement( "body" );
-	italc_config.appendChild( root );
-
-	for( int i = 0; i < m_view->topLevelItemCount(); ++i )
-	{
-		saveSettingsOfChildren( doc, root, m_view->topLevelItem( i ),
-									TRUE );
-	}
-
-	QString xml = "<?xml version=\"1.0\"?>\n" + doc.toString( 2 );
-/*	if( MainWindow::ensureConfigPathExists() == FALSE )
-	{
-		qFatal( QString( "Could not read/write or create directory %1!"
-					"For running iTALC, make sure you have "
-					"write-access to your home-directory "
-					"and to %1 (if already existing)."
-					).arg( ITALC_CONFIG_PATH
-						).toUtf8().constData() );
-	}*/
-
-	QFile( m_globalClientConfiguration + ".bak" ).remove();
-	QFile( m_globalClientConfiguration ).copy( m_globalClientConfiguration +
-									".bak" );
-	QFile outfile( m_globalClientConfiguration );
-	outfile.open( QFile::WriteOnly | QFile::Truncate );
-
-	outfile.write( xml.toUtf8() );
-	outfile.close();
-}
-
-
-
-
-void ClassroomManager::savePersonalConfig( void )
-{
-	QDomDocument doc( "italc-config-file" );
-
-	QDomElement italc_config = doc.createElement( "personalconfig" );
-	italc_config.setAttribute( "version", ITALC_VERSION );
-	doc.appendChild( italc_config );
-
-	QDomElement head = doc.createElement( "head" );
-	italc_config.appendChild( head );
-
-	QDomElement globalsettings = doc.createElement( "globalsettings" );
-	globalsettings.setAttribute( "client-update-interval",
-						m_clientUpdateInterval );
-	globalsettings.setAttribute( "win-width", mainWindow()->width() );
-	globalsettings.setAttribute( "win-height", mainWindow()->height() );
-	globalsettings.setAttribute( "win-x", mainWindow()->x() );
-	globalsettings.setAttribute( "win-y", mainWindow()->y() );	
-	globalsettings.setAttribute( "ismaximized",
-					mainWindow()->isMaximized() );
-	globalsettings.setAttribute( "opened-tab",
-				mainWindow()->sideBar()->activeTab() );
-
-	globalsettings.setAttribute( "wincfg", QString(
-				mainWindow()->saveState().toBase64() ) );
-
-	globalsettings.setAttribute( "defaultdomain", __default_domain );
-	globalsettings.setAttribute( "role", ItalcCore::role );
-	globalsettings.setAttribute( "notooltips",
-					ToolButton::toolTipsDisabled() );
-	globalsettings.setAttribute( "icononlymode",
-					ToolButton::iconOnlyMode() );
-	globalsettings.setAttribute( "clientdoubleclickaction",
-						m_clientDblClickAction );
-	globalsettings.setAttribute( "showUserColumn",
-						m_showUsernameCheckBox->isChecked() );
-	globalsettings.setAttribute( "autoarranged",
-					isAutoArranged() );
-
-	QStringList hidden_buttons;
-	foreach( QAction * a, mainWindow()->toolBar()->actions() )
-	{
-		if( !a->isVisible() )
-		{
-			hidden_buttons += a->text();
-		}
-	}
-	foreach( QAbstractButton * btn, mainWindow()->sideBar()->tabs() )
-	{
-		if( !btn->isVisible() )
-		{
-			hidden_buttons += btn->text();
-		}
-	}
-	globalsettings.setAttribute( "toolbarcfg", hidden_buttons.join( "#" ) );
-
-	head.appendChild( globalsettings );
-
-
-
-	QDomElement root = doc.createElement( "body" );
-	italc_config.appendChild( root );
-
-	for( int i = 0; i < m_view->topLevelItemCount(); ++i )
-	{
-		saveSettingsOfChildren( doc, root, m_view->topLevelItem( i ),
-									FALSE );
-	}
-
-	foreach ( QDomNode node, m_customMenuConfiguration )
-	{
-		root.appendChild( node.cloneNode() );
-	}
-
-	QString xml = "<?xml version=\"1.0\"?>\n" + doc.toString( 2 );
-	QFile( m_personalConfiguration + ".bak" ).remove();
-	QFile( m_personalConfiguration ).copy( m_personalConfiguration +
-								".bak" );
-	QFile outfile( m_personalConfiguration );
-	outfile.open( QFile::WriteOnly | QFile::Truncate );
-
-	outfile.write( xml.toUtf8() );
-	outfile.close();
-}
-
-
-
-
-void ClassroomManager::saveSettingsOfChildren( QDomDocument & _doc,
-						QDomElement & _root,
-						QTreeWidgetItem * _parent,
-							bool _is_global_config )
-{
-	QDomElement classroom = _doc.createElement( "classroom" );
-	classroom.setAttribute( "name", _parent->text( 0 ) );
-	_root.appendChild( classroom );
-
-
-	for( int i = 0; i < _parent->childCount(); ++i )
-	{
-		QTreeWidgetItem * lvi = _parent->child( i );
-		if( lvi->childCount() ||
-				dynamic_cast<classRoom *>( lvi ) != NULL )
-		{
-			saveSettingsOfChildren( _doc, classroom, lvi,
-							_is_global_config );
-		}
-		else
-		{
-			if( dynamic_cast<classRoomItem *>( lvi ) != NULL )
-			{
-				Client * c = dynamic_cast<classRoomItem *>(
-							lvi )->getClient();
-				QDomElement client_element = _doc.createElement(
-								"client" );
-				client_element.setAttribute( "id", c->id() );
-				if( _is_global_config )
-				{
-					client_element.setAttribute( "hostname",
-								c->hostname() );
-					client_element.setAttribute( "name",
-								c->nickname() );
-					client_element.setAttribute( "mac",
-								c->mac() );
-					client_element.setAttribute( "type",
-								c->type() );
-				}
-				else
-				{
-					client_element.setAttribute( "visible",
-						c->isVisible() ? "yes" : "no" );
-						client_element.setAttribute(
-			"x", QString::number( c->pos().x() ) );
- 						client_element.setAttribute(
-			"y", QString::number( c->pos().y() ) );
-						client_element.setAttribute(
-			"w", QString::number( c->width() ) );
- 						client_element.setAttribute(
-			"h", QString::number( c->height() ) );
-				}
-				classroom.appendChild( client_element );
-			}
-		}
-	}
-}
-
-
-
-
-// routine that returns m_view of all visible clients
-QVector<Client *> ClassroomManager::visibleClients( void ) const
-{
-	QVector<Client *> vc;
-	for( int i = 0; i < m_view->topLevelItemCount(); ++i )
-	{
-		getVisibleClients( m_view->topLevelItem( i ), vc );
-	}
-
-	return( vc );
-}
-
-
-
-
-QVector<Client *> ClassroomManager::getLoggedInClients( void ) const
-{
-	QVector<Client *> loggedClients;
-
-	// loop through all clients
-	foreach( Client * it, visibleClients() )
-	{
-		const QString user = it->user();
-		if( user != "none" && !user.isEmpty() )
-		{
-			loggedClients.push_back( it );
-		}
-	}
-	return( loggedClients );
-}
-
-
-
-
-void ClassroomManager::getVisibleClients( QTreeWidgetItem * _p,
-						QVector<Client *> & _vc )
-{
-	classRoomItem * l = NULL;
-
-	for( int i = 0; i < _p->childCount(); ++i )
-	{
-		QTreeWidgetItem * lvi = _p->child( i );
-		if( lvi->childCount() )
-		{
-			getVisibleClients( lvi, _vc );
-		}
-		else if( ( l = dynamic_cast<classRoomItem *>( lvi ) ) != NULL &&
-								l->isVisible() )
-		{
-			_vc.push_back( l->getClient() );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::getHeaderInformation( const QDomElement & _header )
-{
-	QDomNode node = _header.firstChild();
-
-	while( !node.isNull() )
-	{
-		if( node.isElement() && node.nodeName() == "globalsettings" )
-		{
-			m_clientUpdateInterval = node.toElement().attribute(
-					"client-update-interval" ).toInt();
-			// convert old settings
-			if( m_clientUpdateInterval < 100 )
-			{
-				if( m_clientUpdateInterval > 0 )
-				{
-					m_clientUpdateInterval = m_clientUpdateInterval*100;
-				}
-				else
-				{
-					m_clientUpdateInterval = 1000;
-				}
-			}
-			if( m_clientUpdateInterval > 10000 )
-			{
-				m_clientUpdateInterval = 10000;
-			}
-			if( node.toElement().attribute( "win-width" ) !=
-								QString::null &&
-				node.toElement().attribute( "win-height" ) !=
-								QString::null &&
-				node.toElement().attribute( "win-x" ) !=
-								QString::null &&
-				node.toElement().attribute( "win-y" ) !=
-								QString::null )
-			{
-mainWindow()->resize( node.toElement().attribute( "win-width" ).toInt(),
-			node.toElement().attribute("win-height" ).toInt() );
-
-mainWindow()->move( node.toElement().attribute( "win-x" ).toInt(),
-				node.toElement().attribute( "win-y" ).toInt() );
-			}
-			else
-			{
-				setDefaultWindowsSizeAndPosition();
- 			}
-			if( node.toElement().attribute( "opened-tab" ) !=
-								QString::null )
-			{
-				mainWindow()->m_openedTabInSideBar =
-						node.toElement().attribute(
-							"opened-tab" ).toInt();
-			}
-			if( node.toElement().attribute( "ismaximized" ).
-								toInt() > 0 )
-			{
-	mainWindow()->setWindowState( mainWindow()->windowState() |
-							Qt::WindowMaximized );
-			}
-			if( node.toElement().attribute( "wincfg" ) !=
-								QString::null )
-			{
-				m_winCfg = node.toElement().attribute(
-								"wincfg" );
-			}
-			if( node.toElement().attribute( "toolbarcfg" ) !=
-								QString::null )
-			{
-				m_toolBarCfg = node.toElement().attribute(
-								"toolbarcfg" );
-			}
-			if( node.toElement().attribute( "autoarranged" ).
-								toInt() > 0 )
-			{
-				m_autoArranged = true;
-			}
-
-			__default_domain = node.toElement().
-						attribute( "defaultdomain" );
-
-			ItalcCore::role = static_cast<ItalcCore::UserRoles>(
-				node.toElement().attribute( "role" ).toInt() );
-			if( ItalcCore::role <= ItalcCore::RoleNone ||
-				ItalcCore::role >= ItalcCore::RoleCount )
-			{
-				ItalcCore::role = ItalcCore::RoleTeacher;
-			}
-			ToolButton::setToolTipsDisabled(
-				node.toElement().attribute( "notooltips" ).
-								toInt() );
-			ToolButton::setIconOnlyMode(
-				node.toElement().attribute( "icononlymode" ).
-								toInt() );
-			m_clientDblClickAction = node.toElement().attribute(
-					"clientdoubleclickaction" ).toInt();
-			m_showUsernameCheckBox->setChecked(
-				node.toElement().attribute( "showUserColumn" ).toInt() );
-		}
-		node = node.nextSibling();
-        }
-}
-
-
-
-
-void ClassroomManager::loadTree( classRoom * _parent_item,
-					const QDomElement & _parent_element,
-						bool _is_global_config )
-{
-	for( QDomNode node = _parent_element.firstChild();
-						node.isNull() == FALSE;
-						node = node.nextSibling() )
-	{
-		if( node.isElement() == FALSE )
-		{
-			continue;
-		}
-
-		if( node.nodeName() == "classroom" )
-		{
-			classRoom * cur_item = NULL;
-			if( _is_global_config )
-			{
-				// add new classroom
-				QDomElement e = node.toElement();
-				QString name = e.attribute( "name" );
-				if( _parent_item == NULL )
-				{
-					cur_item = new classRoom( name, this,
-								m_view );
-				}
-				else
-				{
-					cur_item = new classRoom( name, this,
-								_parent_item );
-				}
-
-				m_classRooms.push_back( cur_item );
-			}
-
-			// recursive build of the tree
-			loadTree( cur_item, node.toElement(),
-							_is_global_config );
-		}
-		else if( node.nodeName() == "client" )
-		{
-			if( _is_global_config )
-			{
-				QDomElement e = node.toElement();
-				QString hostname = e.hasAttribute( "hostname" )
-					? e.attribute( "hostname" )
-					: e.attribute( "localip" );
-				QString mac = e.attribute( "mac" );
-				QString nickname = e.attribute( "name" );
-
-				// add new client
-                                Client * c = new Client( hostname,
-						mac,
-						nickname,
-						(Client::Types)e.attribute(
-							"type" ).toInt(),
-						_parent_item,
-						mainWindow(),
-						e.attribute( "id" ).toInt() );
-				c->hide();
-			}
-			else
-			{
-				QDomElement e = node.toElement();
-				Client * c = Client::clientFromID(
-						e.attribute( "id" ).toInt() );
-				if( c == NULL )
-				{
-					continue;
-				}
-				c->move( e.attribute( "x" ).toInt(),
-					e.attribute( "y" ).toInt() );
-				c->m_rasterX = e.attribute( "x" ).toInt();
-				c->m_rasterY = e.attribute( "y" ).toInt();
-				c->setFixedSize( e.attribute( "w" ).toInt(),
-						e.attribute( "h" ).toInt() );
-
-				if( e.attribute( "visible" ) == "yes" )
-				{
-					c->show();
-				}
-				else
-				{
-					c->hide();
-				}
-			}
-		}
-		else if( node.nodeName() == "menu" )
-		{
-			m_customMenuConfiguration.append( node.cloneNode() );
-			loadMenuElement( node.toElement() );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::loadMenuElement( QDomElement _e )
-{
-	if ( _e.hasAttribute( "hide" ) )
-	{
-		foreach( QAction * act, m_clientMenu->actions() )
-		{
-			if ( act->text() == _e.attribute( "hide" ) )
-			{
-				act->setVisible( FALSE );
-			}
-		}
-	}
-	else
-	{
-		QString name = _e.attribute( "remote-cmd",
-				_e.attribute( "local-cmd" ) );
-		QString icon = _e.attribute( "icon", ":resources/run.png" );
-		QString before = _e.attribute( "before" );
-
-		if ( name.isEmpty() )
-		{
-			return;
-		}
-
-		ClientAction::Type type = _e.hasAttribute( "remote-cmd" ) ?
-			ClientAction::RemoteScript : ClientAction::LocalScript;
-
-		QAction * act = new ClientAction( type,
-				QIcon( icon ), name, m_clientMenu );
-
-		QString cmd;
-		for( QDomNode n = _e.firstChild(); ! n.isNull();
-			n = n.nextSibling() )
-		{
-			if ( n.isCharacterData() )
-			{
-				cmd.append( n.toCharacterData().data() );
-			}
-		}
-		act->setData( cmd );
-
-		QAction * before_act = 0;
-		if ( ! before.isEmpty() )
-		{
-			foreach( QAction * a, m_clientMenu->actions() )
-			{
-				if ( a->text() == before )
-				{
-					before_act = a;
-					break;
-				}
-			}
-		}
-
-		/* equal to addAction if before_act = 0 */
-		m_clientMenu->insertAction( before_act, act );
-	}
-}
-
-
-
-
-void ClassroomManager::loadGlobalClientConfig( void )
-{
-	m_view->clear();
-
-	if( !QFileInfo( m_globalClientConfiguration ).exists() &&
-		QFileInfo( m_globalClientConfiguration + ".bak" ).exists() )
-	{
-		QFile( m_globalClientConfiguration + ".bak" ).copy(
-						m_globalClientConfiguration );
-	}
-
-	// read the XML file and create DOM tree
-	QFile cfg_file( m_globalClientConfiguration );
-	if( !cfg_file.open( QIODevice::ReadOnly ) )
-	{
-		if( splashScreen != NULL )
-		{
-			splashScreen->close();
-		}
-		DecoratedMessageBox::information(
-					tr( "No configuration-file found" ),
-					tr( "Could not open configuration "
-						"file %1.\nYou will have to "
-						"add at least one classroom "
-						"and computers using the "
-						"classroom-manager which "
-						"you'll find inside the "
-						"program in the sidebar on the "
-						"left side."
-					).arg( m_globalClientConfiguration ) );
-		return;
-	}
-
-	QDomDocument domTree;
-
-	if( !domTree.setContent( &cfg_file ) )
-	{
-		if( splashScreen != NULL )
-		{
-			splashScreen->close();
-		}
-		DecoratedMessageBox::information(
-					tr( "Error in configuration-file" ),
-					tr( "Error while parsing configuration-"
-						"file %1.\nPlease edit it. "
-						"Otherwise you should delete "
-						"this file and have to add all "
-						"classrooms and computers "
-						"again."
-					).arg( m_globalClientConfiguration ),
-					QPixmap( ":/resources/error.png" ) );
-		cfg_file.close();
-		return;
-	}
-	cfg_file.close();
-
-
-	// get the head information from the DOM
-	QDomElement root = domTree.documentElement();
-	QDomNode node = root.firstChild();
-
-	// create the tree view out of the DOM
-	node = root.firstChild();
-	while( !node.isNull() )
-	{
-		if( node.isElement() && node.nodeName() == "body" )
-		{
-			loadTree( NULL, node.toElement(), TRUE );
-			break;
-		}
-		node = node.nextSibling();
-	}
-}
-
-
-
-
-void ClassroomManager::setDefaultWindowsSizeAndPosition( void )
-{
-	mainWindow()->resize( DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT );
-	mainWindow()->move( QPoint( 0, 0 ) );	
-}
-
-
-
-
-void ClassroomManager::loadPersonalConfig( void )
-{
-	if( !QFileInfo( m_personalConfiguration ).exists() &&
-		QFileInfo( m_personalConfiguration + ".bak" ).exists() )
-	{
-		QFile( m_personalConfiguration + ".bak" ).copy(
-						m_personalConfiguration );
-	}
-
-	// read the XML file and create DOM tree
-	QFile cfg_file( m_personalConfiguration );
-	if( !cfg_file.open( QIODevice::ReadOnly ) )
-	{
-		setDefaultWindowsSizeAndPosition();
-		return;
-	}
-
-	QDomDocument domTree;
-
-	if( !domTree.setContent( &cfg_file ) )
-	{
-		if( splashScreen != NULL )
-		{
-			splashScreen->close();
-		}
-		DecoratedMessageBox::information(
-					tr( "Error in configuration-file" ),
-					tr( "Error while parsing configuration-"
-						"file %1.\nPlease edit it. "
-						"Otherwise you should delete "
-						"this file."
-					).arg( m_personalConfiguration ),
-					QPixmap( ":/resources/error.png" ) );
-		cfg_file.close();
-		setDefaultWindowsSizeAndPosition();
-		return;
-	}
-	cfg_file.close();
-
-
-	// get the head information from the DOM
-	QDomElement root = domTree.documentElement();
-	QDomNode node = root.firstChild();
-
-	while( !node.isNull() )
-	{
-		if( node.isElement() && node.nodeName() == "head" )
-		{
-			getHeaderInformation( node.toElement() );
-			break;
-		}
-		node = node.nextSibling();
-	}
-
-	// create the tree view out of the DOM
-	node = root.firstChild();
-	while( !node.isNull() )
-	{
-		if( node.isElement() && node.nodeName() == "body" )
-		{
-			loadTree( NULL, node.toElement(), FALSE );
-			break;
-		}
-		node = node.nextSibling();
-	}
-}
-
-
-
-
-void ClassroomManager::updateClients( void )
-{
-	QVector<Client *> vc = visibleClients();
-
-	foreach( Client * cl, vc )
-	{
-		// update current client
-		cl->update();
-	}
-
-	QTimer::singleShot( m_clientUpdateInterval, this, SLOT( updateClients() ) );
-}
-
-
-
-
-void ClassroomManager::clickedExportToFile( void )
-{
-	QString outfn = QFileDialog::getSaveFileName( this,
-			tr( "Select output-file" ),
-			QDir::homePath(),
-			tr( "Text files (*.txt)" ) );
-	if( outfn == "" )
-	{
-		return;
-	}
-
-	QString output = "# " + QDateTime::currentDateTime().toString() + "\n";
-
-	QVector<Client *> clients = getLoggedInClients();
-	foreach( Client * cl, clients )
-	{
-		output += cl->user() + "\t@ " + cl->name() + " [" + cl->hostname() + "]\n";
-	}
-
-	QFile outfile( outfn );
-	outfile.open( QFile::WriteOnly );
-	outfile.write( output.toUtf8() );
-	outfile.close();
-}
-
-
-
-
-void ClassroomManager::changeGlobalClientMode( int _mode )
-{
-	Client::Modes new_mode = static_cast<Client::Modes>( _mode );
-	if( new_mode != m_globalClientMode ||
-					new_mode == Client::Mode_Overview )
-	{
-		m_globalClientMode = new_mode;
-		QVector<Client *> vc = visibleClients();
-
-		foreach( Client * cl, vc )
-		{
-			cl->changeMode( m_globalClientMode );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::powerOnClients( void )
-{
-	ClientAction action( ClientAction::PowerOn, this );
-	action.process( visibleClients(), ClientAction::VisibleClients );
-}
-
-
-
-
-/*void ClassroomManager::remoteLogon( void )
-{
-	ClientAction action( ClientAction::LogonUser, this );
-	action.process( visibleClients(), ClientAction::VisibleClients );
-}*/
-
-
-
-
-void ClassroomManager::powerDownClients( void )
-{
-	ClientAction action( ClientAction::PowerDown, this );
-	action.process( visibleClients(), ClientAction::VisibleClients );
-}
-
-
-
-
-void ClassroomManager::directSupport( void )
-{
-	const QString h = SupportDialog::getHost( this );
-	if( !h.isEmpty() )
-	{
-		mainWindow()->remoteControlDisplay( h );
-	}
-}
-
-
-
-
-void ClassroomManager::sendMessage( void )
-{
-	ClientAction action( ClientAction::SendTextMessage, this );
-	action.process( visibleClients(), ClientAction::VisibleClients );
-}
-
-
-
-
-const int decor_w = 2;
-const int decor_h = 2;
-
-
-void ClassroomManager::adjustWindows( void )
-{
-	QVector<Client *> vc = visibleClients();
-	if( vc.size() )
-	{
-		const int avail_w = mainWindow()->workspace()->
-						parentWidget()->width();
-		const int avail_h = mainWindow()->workspace()->
-						parentWidget()->height();
-		float cw = vc[0]->width() + decor_w;// add width of decoration
-		float ch = vc[0]->height() + decor_h;// add height of titlebar
-
-		// later we divide by cw, so assume standard-value if zero
-		if( static_cast<int>( cw ) == 0 )
-		{
-			cw = 256.0f;
-		}
-		// later we divide by ch, so assume standard-value if zero
-		if( static_cast<int>( ch ) == 0 )
-		{
-			ch = 192.0f;
-		}
-		int x_offset = vc[0]->pos().x();
-		int y_offset = vc[0]->pos().y();
-
-		foreach( Client * cl, vc )
-		{
-			if( cl->pos().x() < x_offset )
-			{
-				x_offset = cl->pos().x();
-			}
-			if( cl->pos().y() < y_offset )
-			{
-				y_offset = cl->pos().y();
-			}
-		}
-
-		float max_rx = 0.0;
-		float max_ry = 0.0;
-		foreach( Client * cl, vc )
-		{
-			cl->m_rasterX = roundCorrect( (
-					cl->pos().x()-x_offset ) / cw );
-			cl->m_rasterY = roundCorrect( (
-					cl->pos().y()-y_offset ) / ch );
-			if( cl->m_rasterX > max_rx )
-			{
-				max_rx = cl->m_rasterX;
-			}
-			if( cl->m_rasterY > max_ry )
-			{
-				max_ry = cl->m_rasterY;
-			}
-		}
-		++max_rx;
-		++max_ry;
-
-		// now we have length of col and length of row and can
-		// calculate a width and a height (independent from each other)
-
-		// divide available width by max length of rows
-		int nw = static_cast<int>( floor( avail_w / max_rx ) );
-		// calculate according height
-		int nh = ( nw - decor_w ) * 3 / 4 + decor_h;
-		// is this height fit max_ry times into available height?
-		if( nh * max_ry >= avail_h )
-		{
-			// no then divide available height by max length of cols
-			nh = static_cast<int>( floor( avail_h / max_ry ) );
-			// and calculate according width
-			nw = ( nh - decor_h ) * 4 / 3 + decor_w;
-		}
-
-		foreach( Client * cl, vc )
-		{
-			cl->setFixedSize( nw - decor_w, nh - decor_h );
-			cl->move( static_cast<int>( cl->m_rasterX * nw )+1,
-				static_cast<int>( cl->m_rasterY * nh )+1 );
-		}
-		mainWindow()->workspace()->updateGeometry();
-	}
-}
-
-
-
-
-void ClassroomManager::arrangeWindowsToggle( bool _on )
-{
-	m_autoArranged = _on;
-	if( _on == true )
-	{
-		arrangeWindows();
-	}
-}
-
-
-
-
-void ClassroomManager::arrangeWindows( void )
-{
-	QVector<Client *> vc = visibleClients();
-	if( vc.size() )
-	{
-		const int avail_w = mainWindow()->workspace()->
-						parentWidget()->width();
-		const int avail_h = mainWindow()->workspace()->
-						parentWidget()->height();
-		const int w = avail_w;
-		const int h = avail_h;
-		const float s = sqrt( vc.size() *3* w / (float) (4*h) );
-		int win_per_row = (int) ceil( vc.size() / s );
-		int win_per_line = (int) ceil( s );
-		const int ww = avail_w / win_per_line;
-		const int wh = avail_h / win_per_row;
-
-		int i = 0;
-		foreach( Client * cl, vc )
-		{
-			cl->move( ( i % win_per_line ) * ( ww + decor_w ),
-						( i / win_per_line ) *
-							( wh + decor_h ) );
-			cl->setFixedSize( ww, wh );
-			++i;
-		}
-		adjustWindows();
-	}
-}
-
-
-
-
-void ClassroomManager::resizeClients( const int _new_width )
-{
-	QVector<Client *> vc = visibleClients();
-
-	if( vc.size() )
-	{
-		const int _new_height = _new_width * 3 / 4;
-		float cw = vc[0]->width() + decor_w;	// add width of
-							// decoration
-		float ch = vc[0]->height() + decor_h;	// add height of
-							// titlebar
-		// later we divide by cw, so assume standard-value if zero
-		if( static_cast<int>( cw ) == 0 )
-		{
-			cw = 256.0f;
-		}
-		// later we divide by ch, so assume standard-value if zero
-		if( static_cast<int>( ch  )== 0 )
-		{
-			ch = 192.0f;
-		}
-
-		int x_offset = vc[0]->pos().x();
-		int y_offset = vc[0]->pos().y();
-
-		foreach( Client * cl, vc )
-		{
-			if( cl->pos().x() < x_offset )
-			{
-				x_offset = cl->pos().x();
-			}
-			if( cl->pos().y() < y_offset )
-			{
-				y_offset = cl->pos().y();
-			}
-		}
-
-		foreach( Client * cl, vc )
-		{
-			cl->setFixedSize( _new_width, _new_height );
-			const int xp = static_cast<int>( (
-				cl->pos().x() - x_offset ) /
-				cw * ( _new_width + decor_w ) ) + x_offset;
-			const int yp = static_cast<int>( (
-				cl->pos().y() - y_offset ) /
-				ch * ( _new_height + decor_h ) ) + y_offset;
-			cl->move( xp, yp );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::increaseClientSize( void )
-{
-	QVector<Client *> vc = visibleClients();
-
-	if( vc.size() )
-	{
-		const int cw = vc[0]->width();
-		int i = 0;
-		// seek to first width which is greater than current
-		// client-width
-		while( widths[i] > 0 && cw >= widths[i] )
-		{
-			++i;
-		}
-
-		if( widths[i] > 0 )
-		{
-			resizeClients( widths[i] );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::decreaseClientSize( void )
-{
-	QVector<Client *> vc = visibleClients();
-
-	if( vc.size() )
-	{
-		const int cw = vc[0]->width();
-		int i = 0;
-		// seek to last width
-		while( widths[i] > 0 )
-		{
-			++i;
-		}
-		--i;
-		// seek to first width which is smaller than current
-		// client-width
-		while( i > 0 && cw <= widths[i] )
-		{
-			--i;
-		}
-
-		if( i >= 0 && widths[i] > 0 )
-		{
-			resizeClients( widths[i] );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::updateIntervalChanged( double seconds )
-{
-	m_clientUpdateInterval = qRound( seconds * 1000 );
-}
-
-
-
-
-void ClassroomManager::itemDoubleClicked( QTreeWidgetItem * _i, int )
-{
-	classRoomItem * cri = dynamic_cast<classRoomItem *>( _i );
-
-	if( cri != NULL )
-	{
-		if( cri->getClient()->isVisible() )
-		{
-			cri->getClient()->hide();
-		}
-		else
-		{
-			cri->getClient()->show();
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::contextMenuRequest( const QPoint & _pos )
-{
-	QTreeWidgetItem * i = m_view->itemAt( _pos );
-	classRoomItem * cri = dynamic_cast<classRoomItem *>( i );
-	classRoom * cr = dynamic_cast<classRoom *>( i );
-
-	QMenu * contextMenu = new QMenu( this );
-	QMenu * subMenu;
-
-	if ( m_view->selectedItems().size() > 1 )
-	{
-		/* multiselection */
-		subMenu = new clientMenu( tr( "Actions for selected" ),
-			m_clientMenu->actions(), contextMenu );
-		connect( subMenu, SIGNAL( triggered( QAction * ) ),
-			this, SLOT( clientMenuTriggered( QAction * ) ) );
-		contextMenu->addMenu( subMenu );
-		contextMenu->addSeparator();
-	}
-	else if( cri != NULL )
-	{
-		/* single Client */
-		subMenu = new clientMenu( tr( "Actions" ),
-			m_clientMenu->actions(), contextMenu, clientMenu::FullMenu );
-		connect( subMenu, SIGNAL( triggered( QAction * ) ),
-			this, SLOT( clientMenuTriggered( QAction * ) ) );
-		contextMenu->addMenu( subMenu );
-		contextMenu->addSeparator();
-		contextMenu->addActions( m_classRoomItemActionGroup->actions() );
-	}
-	else if( cr != NULL )
-	{
-		/* single classroom */
-		subMenu = new clientMenu( tr( "Actions for %1" ).arg( cr->text(0) ),
-			m_clientMenu->actions(), contextMenu );
-		connect( subMenu, SIGNAL( triggered( QAction * ) ),
-			cr, SLOT( clientMenuTriggered( QAction * ) ) );
-		contextMenu->addMenu( subMenu );
-		contextMenu->addSeparator();
-		contextMenu->addActions( m_classRoomActionGroup->actions() );
-	}
-	else
-	{ 
-		/* no items */
-		foreach ( classRoom * cr, m_classRooms )
-		{
-			subMenu = new clientMenu( tr( "Actions for %1" ).arg( cr->text(0) ),
-				m_clientMenu->actions(), contextMenu );
-			connect( subMenu, SIGNAL( triggered( QAction * ) ),
-				cr, SLOT( clientMenuTriggered( QAction * ) ) );
-			contextMenu->addMenu( subMenu );
-		}
-
-		contextMenu->addSeparator();
-	}
-
-	contextMenu->addActions( m_contextActionGroup->actions() );
-
-	contextMenu->exec( QCursor::pos() );
-
-	delete contextMenu;
-}
-
-
-
-void ClassroomManager::clientMenuRequest()
-{
-	bool fullMenu = ( selectedItems().size() == 1 );
-
-	QMenu * menu = new clientMenu( tr( "Actions" ), m_clientMenu->actions(),
-					this, fullMenu );
-	connect( menu, SIGNAL( triggered( QAction * ) ),
-		this, SLOT( clientMenuTriggered( QAction * ) ) );
-
-	menu->exec( QCursor::pos() );
-
-	delete menu;
-}
-
-
-
-
-void ClassroomManager::clientMenuTriggered( QAction * _action )
-{
-	QVector<Client *> clients;
-
-	foreach ( classRoomItem * cri, selectedItems() )
-	{
-		clients.append( cri->getClient() );
-	}
-
-	ClientAction::process( _action, clients );
-}
-
-
-
-
-QVector<classRoomItem *> ClassroomManager::selectedItems( void )
-{
-	QVector<classRoomItem *> vc;
-
-	for( int i = 0; i < m_view->topLevelItemCount(); ++i )
-	{
-		getSelectedItems( m_view->topLevelItem( i ), vc );
-	}
-
-	/* Move the currentItem to the beginning of the list */
-	classRoomItem * current = dynamic_cast<classRoomItem *>( m_view->currentItem() );
-	if ( vc.contains( current ) )
-	{
-		vc.remove( vc.indexOf( current ));
-		vc.push_front( current );
-	}
-
-	return( vc );
-}
-
-
-
-
-void ClassroomManager::getSelectedItems( QTreeWidgetItem * _p,
-					QVector<classRoomItem *> & _vc,
-					bool _add_all )
-{
-	bool select = _add_all || _p->isSelected();
-	if( _p->childCount() )
-	{
-		for( int i = 0; i < _p->childCount(); ++i )
-		{
-			getSelectedItems( _p->child( i ), _vc, select );
-		}
-	}
-	else if( dynamic_cast<classRoomItem *>( _p ) && select )
-	{
-		_vc.push_back( dynamic_cast<classRoomItem *>( _p ) );
-	}
-}
-
-
-
-
-// slots for client-actions in context-menu
-void ClassroomManager::showHideClient( void )
-{
-	QVector<classRoomItem *> si = selectedItems();
-
-	if( si.size() > 0 )
-	{
-		bool all_shown = TRUE;
-		foreach( classRoomItem * cri, si )
-		{
-			if( cri->getClient()->isVisible() )
-			{
-				all_shown = FALSE;
-				break;
-			}
-		}
-		foreach( classRoomItem * cri, si )
-		{
-			cri->getClient()->setVisible( all_shown );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::editClientSettings( void )
-{
-	QVector<classRoomItem *> si = selectedItems();
-
-	if( si.size() > 0 )
-	{
-		foreach( classRoomItem * cri, si )
-		{
-			ClientSettingsDialog settingsDlg( cri->getClient(),
-					mainWindow(),
-						cri->parent()->text( 0 ) );
-			settingsDlg.exec();
-		}
-		saveGlobalClientConfig();
-		savePersonalConfig();
-	}
-}
-
-
-
-
-void ClassroomManager::removeClient( void )
-{
-	QVector<classRoomItem *> si = selectedItems();
-
-	if( si.size() > 0 )
-	{
-		foreach( classRoomItem * cri, si )
-		{
-			cri->getClient()->hide();
-			m_view->setItemHidden( cri, TRUE );
-			m_clientsToRemove.push_back( cri->getClient() );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::setStateOfClassRoom( classRoom * _cr, bool _shown )
-{
-	if( _shown )
-	{
-		_cr->setMenuItemIcon( QIcon( ":/resources/greenled.png" ) );
-	}
-	else
-	{
-		_cr->setMenuItemIcon( QIcon() );
-	}
-
-	// If all clients are shown, we hide them all. Otherwise we show all.
-	for( int i = 0; i < _cr->childCount(); ++i )
-	{
-		QTreeWidgetItem * cri = _cr->child( i );
-		if( dynamic_cast<classRoomItem *>( cri ) != NULL )
-		{
-			dynamic_cast<classRoomItem *>( cri )->getClient()->
-							setVisible( _shown );
-		}
-	}
-}
-
-
-
-
-QAction * ClassroomManager::addClassRoomToQuickSwitchMenu( classRoom * _cr )
-{
-	QAction * a = new QAction( _cr->text( 0 ), m_quickSwitchMenu );
-	connect( a, SIGNAL( triggered( bool ) ), _cr,
-						SLOT( switchToClassRoom() ) );
-	m_quickSwitchMenu->insertAction( m_qsmClassRoomSeparator, a );
-	return( a );
-}
-
-
-
-
-void ClassroomManager::showSelectedClassRooms( void )
-{
-	foreach( classRoom * cr, m_classRooms )
-	{
-		if( m_view->isItemSelected( cr ) && cr->childCount() )
-		{
-			setStateOfClassRoom( cr, TRUE );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::hideSelectedClassRooms( void )
-{
-	foreach( classRoom * cr, m_classRooms )
-	{
-		if( m_view->isItemSelected( cr ) && ( cr )->childCount() )
-		{
-			setStateOfClassRoom( cr, FALSE );
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::hideAllClassRooms( void )
-{
-	foreach( classRoom * cr, m_classRooms )
-	{
-		setStateOfClassRoom( cr, FALSE );
-	}
-}
-
-
-
-
-void ClassroomManager::editClassRoomName( void )
-{
-	foreach( classRoom * cr, m_classRooms )
-	{
-		if( m_view->isItemSelected( cr ) == FALSE )
-		{
-			continue;
-		}
-		QString classroom_name = cr->text( 0 );
-
-		bool ok;
-		classroom_name = QInputDialog::getText( this,
-			tr( "New name for classroom" ),
-			tr( "Please enter a new name for classroom \"%1\"." ).
-				arg( classroom_name ), QLineEdit::Normal,
-							classroom_name, &ok );
-		if( ok && !classroom_name.isEmpty() )
-		{
-			cr->setText( 0, classroom_name );
-		}
-		saveGlobalClientConfig();
-		savePersonalConfig();
-	}
-}
-
-
-
-
-void ClassroomManager::removeClassRoom( void )
-{
-	foreach( classRoom * cr, m_classRooms )
-	{
-		if( m_view->isItemSelected( cr ) == FALSE )
-		{
-			continue;
-		}
-		if( QMessageBox::question( window(), tr( "Remove classroom" ),
-			tr( "Are you sure want to remove classroom \"%1\"?\n"
-				"All computers in it will be removed as well!" ).
-							arg( cr->text( 0 ) ),
-							QMessageBox::Yes,
-							QMessageBox::No ) ==
-					QMessageBox::No )
-		{
-			continue;
-		}
-
-		removeClassRoom( cr );
-	}
-}
-
-
-
-
-void ClassroomManager::removeClassRoom( classRoom * cr )
-{
-		m_view->setItemHidden( cr, TRUE );
-
-		for ( int i = 0 ; i < cr->childCount(); ++i )
-		{
-			if ( classRoomItem * cri =
-					dynamic_cast<classRoomItem *>( cr->child( i ) ) )
-			{
-				Client * cl = cri->getClient();
-				cl->hide();
-				m_clientsToRemove.push_back( cl );
-			}
-			else if ( classRoom * childCr =
-					dynamic_cast<classRoom *>( cr->child( i ) ) )
-			{
-				removeClassRoom( childCr );
-			}
-		}
-
-		m_classRoomsToRemove.push_back( cr );
-}
-
-
-
-
-// slots for general actions in context-menu
-void ClassroomManager::addClient( void )
-{
-	if( m_classRooms.size() == 0 )
-	{
-		if( QMessageBox::question( window(), tr( "Missing classroom" ),
-						tr( "Before adding computers "
-							"you have to "
-							"create at least one "
-							"classroom.\nDo you "
-							"want to create a new "
-							"classrom now?" ),
-						QMessageBox::Yes,
-						QMessageBox::No ) ==
-							QMessageBox::No )
-		{
-			return;
-		}
-		addClassRoom();
-		if( m_classRooms.size() == 0 )
-		{
-			return;
-		}
-	}
-
-	QString classroom_name = "";
-
-	foreach( classRoom * cr, m_classRooms )
-	{
-		if( m_view->isItemSelected( cr ) )
-		{
-			classroom_name = ( cr )->text( 0 );
-			break;
-		}
-	}
-
-	ClientSettingsDialog settingsDlg( NULL, mainWindow(), classroom_name );
-	settingsDlg.setWindowTitle( tr( "Add computer" ) );
-	settingsDlg.exec();
-	saveGlobalClientConfig();
-	savePersonalConfig();
-}
-
-
-
-
-void ClassroomManager::addClassRoom( void )
-{
-	bool ok;
-	QString classroom_name = QInputDialog::getText( this,
-			tr( "New classroom" ),
-			tr( "Please enter the name of the classroom you "
-							"want to create." ),
-			QLineEdit::Normal, tr( "New classroom" ), &ok );
-	if( ok && !classroom_name.isEmpty() )
-	{
-		classRoom * sel_cr = NULL;
-		foreach( QTreeWidgetItem * item, m_view->selectedItems() )
-		{
-			sel_cr = dynamic_cast<classRoom *>( item );
-
-			if ( !sel_cr && dynamic_cast<classRoomItem *>( item ) )
-			{
-				sel_cr = dynamic_cast<classRoom *>( 
-					item->parent() );
-			}
-
-			if ( sel_cr )
-			{
-				break;
-			}
-		}
-
-		if( sel_cr != NULL )
-		{
-			m_classRooms.push_back( new classRoom( classroom_name,
-							this, sel_cr ) );
-		}
-		else
-		{
-			m_classRooms.push_back( new classRoom( classroom_name,
-							this, m_view ) );
-		}
-		saveGlobalClientConfig();
-	}
-}
-
-
-
-
-void ClassroomManager::hideTeacherClients( void )
-{
-	QVector<Client *> vc = visibleClients();
-
-	foreach( Client * cl, vc )
-	{
-		if( cl->type() == Client::Type_Teacher )
-		{
-			cl->hide();
-		}
-	}
-}
-
-
-
-
-void ClassroomManager::showUserColumn( int _show )
-{
-	m_view->showColumn( _show ? 2 : 1 );
-	m_view->hideColumn( _show ? 1 : 2 );
-}
-
-
-
-
-void ClassroomManager::clientVisibleChanged( void )
-{
-	if( m_autoArranged == true )
-	{
-		arrangeWindows();
-	}
-}
-
-
-
-
-
-
-
-
-classTreeWidget::classTreeWidget( QWidget * _parent ) :
-	QTreeWidget( _parent ),
-	m_clientPressed( NULL )
-{
-	setDragEnabled( true );
-	setAcceptDrops( true );
-	setDropIndicatorShown( true ); 
-	setDragDropMode( QAbstractItemView::InternalMove );
-
-	connect( this, SIGNAL( itemSelectionChanged( void ) ),
-		this, SLOT( itemSelectionChanged( void ) ) );
-}
-
-
-
-
-void classTreeWidget::mousePressEvent( QMouseEvent * _me )
-{
-	classRoomItem * item = dynamic_cast<classRoomItem *>( itemAt( _me->pos() ) );
-
-	if( item && _me->button() == Qt::LeftButton )
-	{
-		m_clientPressed = item->getClient();
-		m_clientPressed->zoom();
-	}
-
-	if( item && _me->button() == Qt::RightButton )
-	{
-		if ( ! item->isSelected() )
-		{
-			clearSelection();
-			item->setSelected( TRUE );
-		}
-	}
-
-	QTreeWidget::mousePressEvent( _me );
-}
-
-
-
-
-void classTreeWidget::mouseMoveEvent( QMouseEvent * _me )
-{
-	if ( m_clientPressed ) 
-	{
-		m_clientPressed->zoomBack();
-		m_clientPressed = NULL;
-	}
-
-	QTreeWidget::mouseMoveEvent( _me );
-}
-
-
-
-
-void classTreeWidget::mouseReleaseEvent( QMouseEvent * _me )
-{
-	if ( m_clientPressed ) 
-	{
-		m_clientPressed->zoomBack();
-		m_clientPressed = NULL;
-	}
-
-	QTreeWidget::mouseReleaseEvent( _me );
-}
-
-
-
-
-bool classTreeWidget::droppingOnItself( QTreeWidgetItem * _target )
-{
-    QList<QTreeWidgetItem *> selected = selectedItems();
-    while ( _target )
-    {
-	    if ( selected.contains( _target ) )
-		    return true;
-	    _target = dynamic_cast<QTreeWidgetItem * >( _target->parent() );
-    }
-    return false;
-}
-
-
-
-
-void classTreeWidget::dragMoveEvent( QDragMoveEvent * _e )
-{
-	if ( _e->source() == this ) 
-	{
-		int clients_selected = 0;
-		foreach( QTreeWidgetItem * item, selectedItems() )
-		{
-			if ( dynamic_cast<classRoomItem *>( item ) )
-			{
-				clients_selected++;
-			}
-		}
-
-		QTreeWidgetItem * target = itemAt( _e->pos() );
-		
-		/* Don't drop clients to the root nor
-		 * classroom to its own child */
-		if ( ( clients_selected && ! target ) ||
-			droppingOnItself( target ) )
-		{
-			_e->ignore();
-		}
-		else
-		{
-			_e->setDropAction( Qt::MoveAction );
-			_e->accept();
-		}
-	}
-}
-
-
-
-
-void classTreeWidget::dropEvent( QDropEvent * _e )
-{
-    if ( _e->source() == this &&
-    	dragDropMode() == QAbstractItemView::InternalMove )
-    {
-		QTreeWidgetItem * target = itemAt( _e->pos() );
-
-		/* Use client's parent as target */
-		if ( dynamic_cast<classRoomItem *>( target ))
-		{
-			target = target->parent();
-		}
-
-		/* Workaround for Qt bug #155700 (fixed in Qt 4.3.4) */
-		bool sortingEnabled = isSortingEnabled();
-		setSortingEnabled( false );
-
-		/* Move selected items */
-		foreach ( QTreeWidgetItem * item, selectedItems() )
-		{
-			if ( item != target )
-			{
-				QTreeWidgetItem * parent = item->parent();
-				if ( parent )
-				{
-					parent->takeChild( parent->indexOfChild( item ) );
-				}
-				else
-				{
-					takeTopLevelItem( indexOfTopLevelItem( item ) );
-				}
-
-				if ( target ) 
-				{
-					target->addChild( item );
-				}
-				else
-				{
-					addTopLevelItem( item );
-				}
-			}
-		}
-
-		setSortingEnabled( sortingEnabled );
-
-		_e->accept();
-    }
-}
-
-
-
-
-/* Update client windows quickly after selections have changed */
-void classTreeWidget::itemSelectionChanged( void )
-{
-
-	/* update old selections */
-	foreach( QTreeWidgetItem * item, m_selectedItems )
-	{
-		classRoomItem * cri = dynamic_cast<classRoomItem *>( item );
-		if ( cri )
-		{
-			cri->getClient()->update();
-		}
-	}
-
-	m_selectedItems = selectedItems();
-
-	/* update new selections - some clients may belong to both
-	 * lists and are updated here twice. */
-	foreach( QTreeWidgetItem * item, m_selectedItems )
-	{
-		classRoomItem * cri = dynamic_cast<classRoomItem *>( item );
-		if ( cri )
-		{
-			cri->getClient()->update();
-		}
-	}
-}
-
-
-
-
-/* Set to current but don't select it automatically */
-void classTreeWidget::setCurrentItem( QTreeWidgetItem * _item )
-{
-	QModelIndex index = indexFromItem( _item );
-
-	if ( index.isValid() )
-	{
-		selectionModel()->setCurrentIndex( index,
-				QItemSelectionModel::NoUpdate );
-	}
-}
-
-
-
-
-
-
-
-
-classRoom::classRoom( const QString & _name,
-					ClassroomManager * _classroom_manager,
-						QTreeWidgetItem * _parent ) :
-	QTreeWidgetItem( _parent, QStringList( _name ) ),
-	m_classroomManager( _classroom_manager ),
-	m_qsMenuAction( m_classroomManager->addClassRoomToQuickSwitchMenu(
-									this ) )
-{
-}
-
-
-
-
-classRoom::classRoom( const QString & _name,
-					ClassroomManager * _classroom_manager,
-						QTreeWidget * _parent ) :
-	QTreeWidgetItem( _parent, QStringList( _name ) ),
-	m_classroomManager( _classroom_manager ),
-	m_qsMenuAction( m_classroomManager->addClassRoomToQuickSwitchMenu(
-									this ) )
-{
-}
-
-
-
-
-classRoom::~classRoom()
-{
-	delete m_qsMenuAction;
-}
-
-
-
-
-void classRoom::clientMenuTriggered( QAction * _action )
-{
-	QVector<Client *> clients;
-	ClassroomManager::getVisibleClients( this, clients );
-
-	ClientAction::process( _action, clients );
-}
-
-
-
-
-void classRoom::switchToClassRoom( void )
-{
-	m_classroomManager->hideAllClassRooms();
-	m_classroomManager->setStateOfClassRoom( this, TRUE );
-}
-
-
-
-
-
-
-
-
-
-
-classRoomItem::classRoomItem( Client * _client, QTreeWidgetItem * _parent ) :
-	QTreeWidgetItem( _parent, QStringList( _client->name() ) ),
-	m_visible( FALSE ),
-	m_client( _client )
-{
-	if( s_clientPixmap == NULL )
-	{
-		s_clientPixmap = new QPixmap( ":/resources/client_hidden.png" );
-	}
-
-	if( s_clientObservedPixmap == NULL )
-	{
-		s_clientObservedPixmap = new QPixmap(
-					":/resources/client_visible.png" );
-	}
-
-	setFlags( Qt::ItemIsSelectable | Qt::ItemIsDragEnabled |
-		Qt::ItemIsEnabled );
-
-	setVisible( m_client->isVisible() );
-	setText( 1, m_client->hostname() );
-	setUser( m_client->user() );
-}
-
-
-
-
-classRoomItem::~classRoomItem()
-{
-	m_client->m_classRoomItem = NULL;
-}
-
-
-
-
-void classRoomItem::setVisible( const bool _obs )
-{
-	m_visible = _obs;
-	if( _obs == FALSE )
-	{
-		setIcon( 0, *s_clientPixmap );
-	}
-	else
-	{
-		setIcon( 0, *s_clientObservedPixmap );
-	}
-}
-
-
-
-
-void classRoomItem::setUser( const QString & _name )
-{
-	setText( 2, _name );
-}
-
-
-
diff --git a/ima/src/ClassroomManager.h b/ima/src/ClassroomManager.h
deleted file mode 100644
index e507fdf..0000000
--- a/ima/src/ClassroomManager.h
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
-* ClassroomManager.h - include file for classroom-manager
-*
- * Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef CLASSROOM_MANAGER_H
-#define CLASSROOM_MANAGER_H
-
-#include <QtCore/QString>
-#include <QtCore/QVector>
-#include <QtGui/QDoubleSpinBox>
-#include <QtGui/QPixmap>
-#include <QtGui/QMenu>
-#include <QtGui/QTreeWidget>
-#include <QtGui/QCheckBox>
-#include <QtXml/QtXml>
-
-#include "Client.h"
-#include "SideBarWidget.h"
-
-
-
-class QButtonGroup;
-class QMenu;
-class QPushButton;
-
-class classTreeWidget;
-class classRoom;
-class classRoomItem;
-class ClientSettingsDialog;
-class ConfigWidget;
-class MainWindow;
-
-
-class ClassroomManager : public SideBarWidget
-{
-	Q_OBJECT
-public:
-	ClassroomManager( MainWindow * _main_window, QWidget * _parent );
-	virtual ~ClassroomManager();
-
-
-	void doCleanupWork( void );
-
-	void loadGlobalClientConfig( void );
-	void saveGlobalClientConfig( void );
-	void loadPersonalConfig( void );
-	void savePersonalConfig( void );
-	void setDefaultWindowsSizeAndPosition( void );
-
-	QVector<Client *> visibleClients( void ) const;
-	static void getVisibleClients( QTreeWidgetItem * _p,
-						QVector<Client *> & _vv );
-
-	QVector<Client *> getLoggedInClients( void ) const;
-
-	inline int updateInterval( void ) const
-	{
-		return( m_clientUpdateInterval );
-	}
-
-	inline const QString & winCfg( void ) const
-	{
-		return( m_winCfg );
-	}
-
-	inline const QString & toolBarCfg( void ) const
-	{
-		return( m_toolBarCfg );
-	}
-
-	Client::Modes globalClientMode( void ) const
-	{
-		return( m_globalClientMode );
-	}
-
-	int clientDblClickAction( void ) const
-	{
-		return( m_clientDblClickAction );
-	}
-
-	inline void setUpdateIntervalSpinBox( QDoubleSpinBox * _update_interval_sb )
-	{
-		m_updateIntervalSpinBox = _update_interval_sb;
-		m_updateIntervalSpinBox->setValue( m_clientUpdateInterval / 1000.0f );
-	}
-
-	inline QMenu * quickSwitchMenu( void )
-	{
-		return( m_quickSwitchMenu );
-	}
-
-	bool showUsername( void ) const
-	{
-		return( m_showUsernameCheckBox->isChecked() );
-	}
-
-	void setStateOfClassRoom( classRoom * _cr, bool _shown );
-	QAction * addClassRoomToQuickSwitchMenu( classRoom * _cr );
-
-	void clientVisibleChanged( void );
-
-	void arrangeWindows( void );
-	bool isAutoArranged ( )
-	{
-		return m_autoArranged;
-	}
-
-public slots:
-	void updateClients( void );
-
-	// slots for context menu
-	void clientMenuRequest( void );
-	void clientMenuTriggered( QAction * _action );
-
-	// slots for toolbar-actions
-	void changeGlobalClientMode( int );
-	void sendMessage( void );
-	void powerOnClients( void );
-	void powerDownClients( void );
-	//void remoteLogon( void );
-	void directSupport( void );
-
-	// slots for actions in view-menu
-	void adjustWindows( void );
-	void arrangeWindowsToggle( bool _on );
-	void increaseClientSize( void );
-	void decreaseClientSize( void );
-
-	// slots for config-widget in side-bar
-	void updateIntervalChanged( double seconds );
-
-	void hideAllClassRooms( void );
-
-	void setClientDblClickAction( int _a )
-	{
-		m_clientDblClickAction = _a;
-	}
-
-	void showUserColumn( int _show );
-
-	// Export user list to file
-	void clickedExportToFile( void );
-
-private slots:
-	void itemDoubleClicked( QTreeWidgetItem * _i, int );
-	void contextMenuRequest( const QPoint & _pos );
-
-	// slots for client-actions in context-menu
-	void showHideClient( void );
-	void editClientSettings( void );
-	void removeClient( void );
-
-	// slots for classroom-actions in context-menu
-	void showSelectedClassRooms( void );
-	void hideSelectedClassRooms( void );
-	void editClassRoomName( void );
-	void removeClassRoom( void );
-
-	// slots for general actions in context-menu
-	void addClient( void );
-	void addClassRoom( void );
-
-	void hideTeacherClients( void );
-
-
-private:
-	void setupMenus( void );
-
-	void saveSettingsOfChildren( QDomDocument & _doc, QDomElement & _root,
-						QTreeWidgetItem * _lvi,
-						bool _is_global_config );
-
-	void getHeaderInformation( const QDomElement & _header );
-	void loadTree( classRoom * _parentItem,
-					const QDomElement & _parentElement,
-					bool _is_global_config );
-	void loadMenuElement( QDomElement _e );
-
-	QVector<classRoomItem *> selectedItems( void );
-	void getSelectedItems( QTreeWidgetItem * _p,
-						QVector<classRoomItem *> & _vv,
-						bool _add_all = FALSE );
-
-	void resizeClients( const int _new_width );
-
-	void removeClassRoom( classRoom * _cr );
-
-	classTreeWidget * m_view;
-
-	QVector<classRoom *> m_classRooms;
-	QVector<Client *> m_clientsToRemove;
-	QVector<classRoom *> m_classRoomsToRemove;
-
-	const QString m_personalConfiguration;
-	const QString m_globalClientConfiguration;
-
-	/* context menu: */
-	QActionGroup * m_classRoomItemActionGroup;
-	QActionGroup * m_classRoomActionGroup;
-	QActionGroup * m_contextActionGroup;
-
-	QMenu * m_clientMenu; /* template */
-	QVector<QDomNode> m_customMenuConfiguration;
-
-	QDoubleSpinBox * m_updateIntervalSpinBox;
-	QMenu * m_quickSwitchMenu;
-	QAction * m_qsmClassRoomSeparator;
-	Client::Modes m_globalClientMode;
-
-	int m_clientUpdateInterval;
-	QString m_winCfg;
-	QString m_toolBarCfg;
-
-	int m_clientDblClickAction;
-
-	friend class ClientSettingsDialog;
-	friend class ConfigWidget;
-
-	QPushButton * m_exportToFileBtn;
-	QCheckBox * m_showUsernameCheckBox;
-
-	bool m_autoArranged;
-} ;
-
-
-
-
-
-
-class classTreeWidget : public QTreeWidget
-{
-	Q_OBJECT
-public:
-	classTreeWidget( QWidget * _parent );
-	virtual ~classTreeWidget() { } ;
-
-	void setCurrentItem( QTreeWidgetItem * _item );
-
-private:
-	virtual void mousePressEvent( QMouseEvent * _me );
-	virtual void mouseMoveEvent( QMouseEvent * _me );
-	virtual void mouseReleaseEvent( QMouseEvent * _me );
-	virtual void dragMoveEvent( QDragMoveEvent * _e );
-	virtual void dropEvent( QDropEvent * _e );
-
-	bool droppingOnItself( QTreeWidgetItem * _target );
-
-	Client * m_clientPressed;
-	QList<QTreeWidgetItem *> m_selectedItems;
-
-private slots:
-	void itemSelectionChanged( void );
-
-} ;
-
-
-
-
-
-
-class classRoom : public QObject, public QTreeWidgetItem
-{
-	Q_OBJECT
-public:
-	classRoom( const QString & _name, ClassroomManager * _classroom_manager,
-							QTreeWidget * _parent );
-	classRoom( const QString & _name, ClassroomManager * _classroom_manager,
-						QTreeWidgetItem * _parent );
-	virtual ~classRoom();
-
-	void setMenuItemIcon( const QIcon & _icon )
-	{
-		m_qsMenuAction->setIcon( _icon );
-		QFont f = m_qsMenuAction->font();
-		f.setBold( !_icon.isNull() );
-		m_qsMenuAction->setFont( f );
-	}
-
-public slots:
-	void switchToClassRoom( void );
-	void clientMenuTriggered( QAction * _action );
-
-
-private slots:
-
-
-private:
-	ClassroomManager * m_classroomManager;
-	QAction * m_qsMenuAction;
-
-} ;
-
-
-
-
-class classRoomItem : public QTreeWidgetItem
-{
-public:
-	classRoomItem( Client * _client, QTreeWidgetItem * _parent );
-	virtual ~classRoomItem();
-
-	inline Client * getClient( void )
-	{
-		return( m_client );
-	}
-
-	void setVisible( const bool _obs );
-	void setUser( const QString & _name );
-
-	inline bool isVisible( void ) const
-	{
-		return( m_visible );
-	}
-
-
-private:
-	bool m_visible;
-	Client * m_client;
-
-	static QPixmap * s_clientPixmap;
-	static QPixmap * s_clientObservedPixmap;
-
-} ;
-
-
-#endif
diff --git a/ima/src/Client.cpp b/ima/src/Client.cpp
deleted file mode 100644
index e3303cb..0000000
--- a/ima/src/Client.cpp
+++ /dev/null
@@ -1,1205 +0,0 @@
-/*
- * Client.cpp - code for client-windows, which are displayed in several
- *              instances in the main-window of iTALC
- *
- * Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QCloseEvent>
-#include <QtGui/QLinearGradient>
-#include <QtGui/QMenu>
-#include <QtGui/QPainter>
-#include <QtGui/QPixmap>
-#include <QtGui/QScrollArea>
-#include <QtGui/QMessageBox>
-
-#include "MainWindow.h"
-#include "Client.h"
-#include "ItalcVncConnection.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCoreConnection.h"
-#include "ClassroomManager.h"
-#include "RunCommandsDialog.h"
-#include "LocalSystem.h"
-#include "Snapshot.h"
-#include "Dialogs.h"
-#include "DecoratedMessageBox.h"
-
-
-
-const QSize DEFAULT_CLIENT_SIZE( 256, 192 );
-const int DECO_WIDTH = 4;
-const int TITLE_HEIGHT = 23;
-const QPoint CONTENT_OFFSET( DECO_WIDTH, DECO_WIDTH + TITLE_HEIGHT ); 
-const QSize CONTENT_SIZE_SUB( 2*DECO_WIDTH, 2*DECO_WIDTH + TITLE_HEIGHT ); 
-
-
-// resolve static symbols...
-QHash<int, Client *> Client::s_clientIDs;
-
-
-class closeButton : public QWidget
-{
-public:
-	closeButton( QWidget * _parent ) :
-		QWidget( _parent ),
-		m_mouseOver( FALSE )
-	{
-		setFixedSize( 18, 18 );
-	}
-	virtual ~closeButton()
-	{
-	}
-
-	virtual void enterEvent( QEvent * _fe )
-	{
-		m_mouseOver = TRUE;
-		QWidget::enterEvent( _fe );
-		update();
-	}
-	virtual void leaveEvent( QEvent * _fe )
-	{
-		m_mouseOver = FALSE;
-		QWidget::leaveEvent( _fe );
-		update();
-	}
-	virtual void paintEvent( QPaintEvent * _pe )
-	{
-		QPainter p( this );
-		p.setRenderHint( QPainter::Antialiasing, TRUE );
-		p.setPen( QColor( 128, 128, 128 ) );
-		p.setBrush( m_mouseOver ? Qt::gray : Qt::white );
-		p.drawRoundRect( QRectF( 0.5, 0.5, 16, 16 ), 20, 20 );
-		QPen pen( QColor( 64, 64, 64 ) );
-
-		pen.setWidth( 3 );
-		p.setPen( pen );
-		p.drawLine( QLineF( 4.5, 4.5,  12.5, 12.5 ) );
-		p.drawLine( QLineF( 4.5, 12.5, 12.5, 4.5 ) );
-	}
-
-	virtual void mousePressEvent( QMouseEvent * )
-	{
-	}
-
-	virtual void mouseReleaseEvent( QMouseEvent * _me )
-	{
-		if( rect().contains( _me->pos() ) )
-		{
-			parentWidget()->close();
-		}
-	}
-
-private:
-	bool m_mouseOver;
-
-} ;
-
-
-
-
-ClientAction::ClientAction( Type _type, QObject * _parent, int _flags ) :
-	QAction( _parent ),
-	m_type( _type ),
-	m_flags( _flags )
-{
-}
-
-
-
-
-ClientAction::ClientAction( Type _type, const QIcon & _icon, const QString & _text,
-				QObject * _parent, int _flags ) :
-	QAction( _icon, _text, _parent ),
-	m_type( _type ),
-	m_flags( _flags )
-{
-}
-
-
-
-
-void ClientAction::process( QVector<Client *> _clients, TargetGroup _target )
-{
-	switch ( m_type )
-	{
-		case Overview:
-			foreach( Client * cl, _clients )
-			{
-				cl->changeMode( Client::Mode_Overview );
-			}
-			break;
-			
-		case FullscreenDemo:
-			foreach( Client * cl, _clients )
-			{
-				cl->changeMode( Client::Mode_FullscreenDemo );
-			}
-			break;
-			
-		case WindowDemo:
-			foreach( Client * cl, _clients )
-			{
-				cl->changeMode( Client::Mode_WindowDemo );
-			}
-			break;
-			
-		case Locked:
-			foreach( Client * cl, _clients )
-			{
-				cl->changeMode( Client::Mode_Locked );
-			}
-			break;
-			
-		case ViewLive:
-			foreach( Client * cl, _clients )
-			{
-				cl->viewLive();
-			}
-			break;
-			
-		case RemoteControl:
-			foreach( Client * cl, _clients )
-			{
-				cl->remoteControl();
-			}
-			break;
-			
-		case ClientDemo:
-			foreach( Client * cl, _clients )
-			{
-				cl->clientDemo();
-			}
-			break;
-			
-		case SendTextMessage:
-			{
-				QString msg;
-				TextMessageDialog tmd( msg, NULL );
-
-				if( tmd.exec() == QDialog::Accepted &&
-					!msg.isEmpty() )
-				{ 
-					foreach( Client * cl, _clients )
-					{
-						cl->sendTextMessage( msg );
-					}
-				}
-			}
-
-			break;
-
-#if 0
-		case LogonUser:
-			{
-				RemoteLogonDialog mld( NULL );
-
-				if( mld.exec() == QDialog::Accepted &&
-					!mld.userName().isEmpty()/* &&
-					!mld.password().isEmpty()*/ )
-				{
-					foreach( Client * cl, _clients )
-					{
-						cl->logonUser( mld.userName(),
-							mld.password(), mld.domain() );
-					}
-				}
-
-			}
-			break;
-#endif
-
-		case LogoutUser:
-			if ( confirmLogout( _target ) )
-			{
-				foreach( Client * cl, _clients )
-				{
-					cl->logoutUser();
-				}
-			}
-			break;
-
-		case Snapshot:
-			foreach( Client * cl, _clients )
-			{
-				cl->snapshot();
-			}
-			break;
-
-		case PowerOn:
-			foreach( Client * cl, _clients )
-			{
-				cl->powerOn();
-			}
-			break;
-
-		case Reboot:
-			if ( confirmReboot( _target ) )
-			{
-				foreach( Client * cl, _clients )
-				{
-					cl->reboot();
-				}
-			}
-			break;
-
-		case PowerDown:
-			if ( confirmPowerDown( _target ) )
-			{
-				foreach( Client * cl, _clients )
-				{
-					cl->powerDown();
-				}
-			}
-			break;
-
-		case ExecCmds:
-			{
-				QString cmds;
-				RunCommandsDialog cmd_input_dialog( cmds, NULL );
-
-				if( cmd_input_dialog.exec() == QDialog::Accepted &&
-					!cmds.isEmpty() )
-				{
-					foreach( Client * cl, _clients )
-					{
-						cl->execCmds( cmds );
-					}
-				}
-			}
-			break;
-
-		case RemoteScript:
-			{
-				QString script = dataExpanded( _clients );
-				foreach( Client * cl, _clients )
-				{
-					cl->execCmds( script );
-				}
-				break;
-			}
-
-		case LocalScript:
-			{
-				QString script = dataExpanded( _clients );
-				QProcess::startDetached( script );
-				break;
-			}
-	}
-}
-
-
-
-
-QString ClientAction::dataExpanded( QVector<Client *> _clients ) const
-{
-	static QRegExp s_reITALC_HOSTS( "\\$ITALC_HOSTS\\b" );
-
-	QString script = data().toString();
-
-	if ( script.contains( s_reITALC_HOSTS ) )
-	{
-		QStringList hosts;
-		foreach ( Client *cl, _clients )
-		{
-			hosts << cl->hostname();
-		}
-		script.replace( s_reITALC_HOSTS, hosts.join( " " ) );
-	}
-
-	return script;
-}
-
-
-
-
-void ClientAction::process( QAction * _action, QVector<Client *> _clients,
-			TargetGroup _target )
-{
-	ClientAction * action = dynamic_cast<ClientAction *>( _action );
-	if ( action )
-	{
-		action->process( _clients, _target );
-	}
-}
-
-
-
-
-bool ClientAction::confirmLogout( TargetGroup _target ) const
-{
-	QString question = ( _target == VisibleClients ?
-		tr( "Are you sure want logout all users on all visible computers ?" ) :
-		tr( "Are you sure want logout all users on all selected computers ?" ) );
-	
-	return QMessageBox::question( NULL, tr( "Logout user" ),
-				question, QMessageBox::Yes, QMessageBox::No )
-		== QMessageBox::Yes;
-}
-
-
-
-
-bool ClientAction::confirmReboot( TargetGroup _target ) const
-{
-	QString question = ( _target == VisibleClients ?
-		tr( "Are you sure want to reboot all visible computers?" ) :
-		tr( "Are you sure want to reboot all selected computers?" ) );
-
-	return QMessageBox::question( NULL, tr( "Reboot computers" ),
-				question, QMessageBox::Yes, QMessageBox::No )
-		== QMessageBox::Yes;
-}
-
-
-
-
-bool ClientAction::confirmPowerDown( TargetGroup _target ) const
-{
-	QString question = ( _target == VisibleClients ?
-		tr( "Are you sure want to power down all visible computers?" ) :
-		tr( "Are you sure want to power down all selected computers?" ) );
-
-	return QMessageBox::question( NULL, tr( "Reboot computers" ),
-				question, QMessageBox::Yes, QMessageBox::No )
-		== QMessageBox::Yes;
-}
-
-
-
-
-clientMenu::clientMenu( const QString & _title, const QList<QAction *> _actions,
-			QWidget * _parent, const bool _fullMenu ) :
-	QMenu( _title, _parent )
-{
-	setIcon( scaledIcon( "client.png" ) );
-
-	foreach ( QAction * action, _actions )
-	{
-		ClientAction * act = dynamic_cast<ClientAction *>( action );
-		if ( act && act->flags( ClientAction::FullMenu ) && ! _fullMenu )
-		{
-			continue;
-		}
-
-		addAction( action );
-	}
-}
-
-
-
-QMenu * clientMenu::createDefault( QWidget * _parent )
-{
-	QMenu * menu = new QMenu( _parent );
-
-	menu->addAction( new ClientAction( ClientAction::Overview,
-		scaledIcon( "overview_mode.png" ), tr( "Overview" ), menu ) );
-	menu->addAction( new ClientAction( ClientAction::FullscreenDemo,
-		scaledIcon( "fullscreen_demo.png" ), tr( "Fullscreen demo" ), menu ) );
-	menu->addAction( new ClientAction( ClientAction::WindowDemo,
-		scaledIcon( "window_demo.png" ), tr( "Window demo" ), menu ) );
-	menu->addAction( new ClientAction(	ClientAction::Locked,
-		scaledIcon( "locked.png" ), tr( "Locked display" ), menu ) );
-	menu->addSeparator();
-
-	menu->addAction( new ClientAction( ClientAction::ViewLive,
-		scaledIcon( "viewmag.png" ), tr( "View live" ), menu,
-		ClientAction::FullMenu ) );
-	menu->addAction( new ClientAction( ClientAction::RemoteControl,
-		scaledIcon( "remote_control.png" ), tr( "Remote control" ), menu,
-		ClientAction::FullMenu ) );
-	menu->addAction( new ClientAction( ClientAction::ClientDemo,
-		scaledIcon( "client_demo.png" ), tr( "Let student show demo" ), menu,
-		ClientAction::FullMenu ) );
-
-	menu->addAction( new ClientAction( ClientAction::SendTextMessage,
-		scaledIcon( "text_message.png" ), tr( "Send text message" ), menu ) );
-	menu->addSeparator();
-
-/*	menu->addAction( new ClientAction( ClientAction::LogonUser,
-		scaledIcon( "remotelogon.png" ), tr( "Logon user" ), menu ) );*/
-	menu->addAction( new ClientAction( ClientAction::LogoutUser,
-		scaledIcon( "logout.png" ), tr( "Logout user" ), menu ) );
-	menu->addSeparator();
-
-	menu->addAction( new ClientAction( ClientAction::Snapshot,
-		scaledIcon( "snapshot.png" ), tr( "Take a snapshot" ), menu ) );
-	menu->addSeparator();
-
-	menu->addAction( new ClientAction( ClientAction::PowerOn,
-		scaledIcon( "power_on.png" ), tr( "Power on" ), menu ) );
-	menu->addAction( new ClientAction( ClientAction::Reboot,
-		scaledIcon( "reboot.png" ), tr( "Reboot" ), menu ) );
-	menu->addAction( new ClientAction( ClientAction::PowerDown,
-		scaledIcon( "power_off.png" ), tr( "Power down" ), menu ) );
-	menu->addAction( new ClientAction( ClientAction::ExecCmds,
-		scaledIcon( "run.png" ), tr( "Execute commands" ), menu ) );
-
-	return menu;
-}
-
-
-
-
-
-
-
-
-Client::Client( const QString & _hostname,
-		const QString & _mac, const QString & _nickname,
-		Types _type, classRoom * _class_room,
-					MainWindow * mainWindow, int _id ) :
-	QWidget( mainWindow->workspace() ),
-	m_mainWindow( mainWindow ),
-	m_connection( NULL ),
-	m_vncConn( NULL ),
-	m_framebufferUpdated( false ),
-	m_clickPoint( -1, -1 ),
-	m_origPos( -1, -1 ),
-	m_hostname( _hostname ),
-	m_nickname( _nickname ),
-	m_mac( _mac ),
-	m_type( _type ),
-	m_mode( Mode_Overview ),
-	m_user(),
-	m_takeSnapshot( false ),
-	m_state( State_Unkown ),
-	m_classRoomItem( NULL )
-{
-	new closeButton( this );
-
-	if( _id <= 0 || clientFromID( _id ) != NULL )
-	{
-		_id = freeID();
-	}
-	s_clientIDs[_id] = this;
-
-
-	m_classRoomItem = new classRoomItem( this, _class_room );
-
-	m_vncConn = new ItalcVncConnection( this );
-	m_vncConn->setHost( m_hostname );
-	m_vncConn->setQuality( ItalcVncConnection::ThumbnailQuality );
-	m_vncConn->setFramebufferUpdateInterval(
-				m_mainWindow->getClassroomManager()->updateInterval() );
-
-	// set a flag so we only update the view if there were some updates
-	connect( m_vncConn, SIGNAL( imageUpdated( int, int, int, int ) ),
-				this, SLOT( setUpdateFlag() ) );
-
-	m_connection = new ItalcCoreConnection( m_vncConn );
-
-	setAttribute( Qt::WA_OpaquePaintEvent );
-	setWindowIcon( QPixmap( ":/resources/classroom_manager.png" ) );
-
-/*	setWhatsThis( tr( "This is a client-window. It either displays the "
-				"screen of the according client or a message "
-				"about the state of this client (no user "
-				"logged in/powered off) is shown. You can "
-				"click with the right mouse-button and an "
-				"action-menu for this client will appear. "
-				"You can also close this client-window. "
-				"To open it again, open the classroom-manager-"
-				"workspace and search this client and double-"
-				"click it.\nYou can change the size of this "
-				"(and all other visible) client-windows by "
-				"using the functions for increasing, "
-				"decreasing or optimizing the client-window-"
-								"size." ) );*/
-
-	setFixedSize( DEFAULT_CLIENT_SIZE );
-	//resize( DEFAULT_CLIENT_SIZE );
-
-	reload();
-}
-
-
-
-
-Client::~Client()
-{
-	changeMode( Mode_Overview );
-
-	delete m_connection;
-	m_connection = NULL;
-
-	delete m_vncConn;
-	m_vncConn = NULL;
-
-	delete m_classRoomItem;
-}
-
-
-
-
-int Client::id( void ) const
-{
-	QHash<int, Client *>::const_iterator it;
-	for( it = s_clientIDs.begin(); it != s_clientIDs.end(); ++it )
-	{
-		if( it.value() == this )
-		{
-			return( it.key() );
-		}
-	}
-	return( 0 );
-}
-
-
-
-
-Client * Client::clientFromID( int _id )
-{
-	if( s_clientIDs.contains( _id ) )
-	{
-		return( s_clientIDs[_id] );
-	}
-	return( NULL );
-}
-
-
-
-
-int Client::freeID( void )
-{
-	const int ID_MAX = 1 << 20;
-
-	int id;
-	while( s_clientIDs.contains( id = static_cast<int>( (float) rand() /
-						RAND_MAX * ID_MAX + 1 ) ) )
-	{
-	}
-	return( id );
-}
-
-
-
-
-void Client::changeMode( const Modes _new_mode )
-{
-	if( _new_mode != m_mode )
-	{
-		switch( m_mode )
-		{
-			case Mode_Overview:
-			case Mode_Unknown:
-				break;
-			case Mode_FullscreenDemo:
-			case Mode_WindowDemo:
-				m_mainWindow->localICA()->demoServerUnallowHost( m_hostname );
-				m_connection->stopDemo();
-				break;
-			case Mode_Locked:
-				m_connection->unlockScreen();
-				break;
-		}
-		switch( m_mode = _new_mode )
-		{
-			case Mode_Overview:
-			case Mode_Unknown:
-				break;
-			case Mode_FullscreenDemo:
-			case Mode_WindowDemo:
-				m_mainWindow->localICA()->demoServerAllowHost( m_hostname );
-				m_connection->startDemo(
-								QString(),// let client guess IP from connection
-								ItalcCore::config->demoServerPort(),
-								m_mode == Mode_FullscreenDemo );
-				break;
-			case Mode_Locked:
-				m_connection->lockScreen();
-				break;
-		}
-	}
-	// if connection was lost while sending commands such as stop-demo,
-	// there should be a way for switching back into normal mode, that's
-	// why we offer this lines
-	else if( m_mode == Mode_Overview )
-	{
-	/*	if( conn != NULL )
-		{
-			conn->demoServerDenyClient( m_hostname );
-		}*/
-		m_connection->stopDemo();
-		m_connection->unlockScreen();
-	}
-}
-
-
-
-
-void Client::setClassRoom( classRoom * _cr )
-{
-	delete m_classRoomItem;
-
-	m_classRoomItem = new classRoomItem( this, _cr );
-}
-
-
-
-
-void Client::resetConnection( void )
-{
-	m_connection->vncConnection()->reset( m_hostname );
-}
-
-
-
-
-void Client::update( void )
-{
-	// at least set tooltip with user-name if it is not displayed
-	// in title-bar
-	if( m_connection->isConnected() &&
-		!m_mainWindow->getClassroomManager()->showUsername() )
-	{
-		if( toolTip() != m_user )
-		{
-			setToolTip( m_user );
-		}
-	}
-	else
-	{
-		setToolTip( QString() );
-	}
-
-	m_state = currentState();
-	QWidget::update();
-}
-
-
-
-
-bool Client::userLoggedIn( void )
-{
-	if( m_connection->isConnected() )
-	{
-		return true;
-	}
-	m_connection->vncConnection()->reset( m_hostname );
-	return false;
-}
-
-
-
-
-void Client::closeEvent( QCloseEvent * _ce )
-{
-	// make sure, client isn't forgotten by teacher after being hidden
-	changeMode( Mode_Overview );
-	hide();
-	_ce->ignore();
-}
-
-
-
-
-void Client::contextMenuEvent( QContextMenuEvent * )
-{
-	/* classRoomManager handles clientMenu */
-	m_mainWindow->getClassroomManager()->clientMenuRequest();
-}
-
-
-
-
-void Client::hideEvent( QHideEvent * )
-{
-	if( isMinimized() )
-	{
-		hide();
-	}
-
-	if( m_classRoomItem != NULL && m_mainWindow->isVisible() &&
-						!m_mainWindow->isMinimized() )
-	{
-		m_classRoomItem->setVisible( FALSE );
-	}
-
-	m_mainWindow->getClassroomManager()->clientVisibleChanged();
-}
-
-
-
-
-void Client::enlarge()
-{
-	if ( m_origSize.isValid() ) 
-	{
-		QWidget * workspace = m_mainWindow->workspace();
-		QSize s = QSize( m_origSize );
-		
-		s.scale( workspace->parentWidget()->size(),
-							Qt::KeepAspectRatio );
-		setFixedSize( s );
-
-		/* centralize */
-		QSize offset = ( workspace->parentWidget()->size() - s ) / 2;
-		move( offset.width() - workspace->x(),
-			offset.height() - workspace->y() );
-
-		raise();
-	}
-}
-
-
-
-
-void Client::zoom()
-{
-	m_origPos = pos();
-	m_origSize = size();
-	/* Delay zooming before we are sure that
-	 * this is not just a fast click.
-	 */
-	QTimer::singleShot( 300, this, SLOT( enlarge() ) );
-}
-
-
-
-
-void Client::zoomBack()
-{
-	if ( m_origSize.isValid() )
-	{	
-		move( m_origPos );
-		setFixedSize( m_origSize );
-		/* reset value: */
-		m_origSize = QSize();
-	}
-}
-
-
-
-
-void Client::mousePressEvent( QMouseEvent * _me )
-{
-	classTreeWidget * tree = static_cast<classTreeWidget *>(
-				m_classRoomItem->treeWidget() );
-
-	tree->setCurrentItem( m_classRoomItem );
-
-	if( _me->button() == Qt::LeftButton )
-	{
-		raise();
-		m_clickPoint = _me->globalPos();
-		m_origPos = pos();
-
-		if ( ! ( _me->modifiers() & ( Qt::ControlModifier | Qt::ShiftModifier ) ))
-		{
-			tree->clearSelection();
-		}
-		m_classRoomItem->setSelected( ! m_classRoomItem->isSelected() );
-
-		zoom();
-
-		_me->ignore();
-	}
-	else if ( _me->button() == Qt::RightButton )
-	{
-		if ( ! m_classRoomItem->isSelected() ) {
-			tree->clearSelection();
-			m_classRoomItem->setSelected( TRUE );
-		}
-	}
-
-	QWidget::mousePressEvent( _me );
-}
-
-
-
-
-void Client::mouseMoveEvent( QMouseEvent * _me )
-{
-	if( m_clickPoint.x() >= 0 )
-	{
-		zoomBack();
-		move( m_origPos + _me->globalPos() - m_clickPoint );
-		parentWidget()->updateGeometry();
-	}
-	else
-	{
-		QWidget::mouseMoveEvent( _me );
-	}
-}
-
-
-
-
-void Client::mouseReleaseEvent( QMouseEvent * _me )
-{
-	zoomBack();
-	m_clickPoint = QPoint( -1, -1 );
-	QWidget::mouseReleaseEvent( _me );
-}
-
-
-
-
-void Client::mouseDoubleClickEvent( QMouseEvent * _me )
-{
-	if( m_mainWindow->getClassroomManager()->clientDblClickAction() == 0 )
-	{
-		remoteControl();
-	}
-	else
-	{
-		viewLive();
-	}
-}
-
-
-
-
-void Client::paintEvent( QPaintEvent * _pe )
-{
-	static QImage * img_unknown = NULL;
-	static QImage * img_no_user = NULL;
-	static QImage * img_host_unreachable = NULL;
-	static QImage * img_demo = NULL;
-	static QImage * img_locked = NULL;
-
-	if( img_unknown == NULL )
-		img_unknown = new QImage( ":/resources/error.png" );
-	if( img_no_user == NULL )
-		img_no_user = new QImage( ":/resources/no_user.png" );
-	if( img_host_unreachable == NULL )
-		img_host_unreachable = new QImage( ":/resources/host_unreachable.png" );
-	if( img_demo == NULL )
-		img_demo = new QImage( ":/resources/window_demo.png" );
-	if( img_locked == NULL )
-		img_locked = new QImage( ":/resources/locked.png" );
-
-	QPainter p( this );
-	p.setBrush( Qt::white );
-	p.setPen( Qt::black );
-	p.drawRect( QRect( 0, 0, width()-1, height()-1 ) );
-	p.setRenderHint( QPainter::Antialiasing, TRUE );
-
-	p.fillRect( 1, 1, width()-2, TITLE_HEIGHT-2,
-			m_classRoomItem->isSelected() ?
-				QColor( 96, 96, 96 ) :
-						QColor( 224, 224, 224 ) );
-
-	bool showUsername = m_mainWindow->getClassroomManager()->showUsername();
-	const QString s = (showUsername && m_user != "") ? m_user :
-		( name() + " (" + m_classRoomItem->parent()->text( 0 ) +
-									")" );
-	QFont f = p.font();
-	f.setBold( TRUE );
-	p.setFont( f );
-	p.setPen( m_classRoomItem->isSelected() ? Qt::white : Qt::black );
-	p.drawText( 10, TITLE_HEIGHT-7, s );
-
-	if( m_mode == Mode_Overview && m_connection->isConnected() &&
-			m_connection->vncConnection()->framebufferInitialized() )
-	{
-		p.drawImage( CONTENT_OFFSET, m_connection->
-					vncConnection()->scaledScreen() );
-	}
-	else
-	{
-	const int aw = width() - 2*DECO_WIDTH;
-	const int ah = height() - CONTENT_SIZE_SUB.height() - DECO_WIDTH;
-
-	QImage * pm = img_unknown;
-	QString msg = tr( "Unknown state" );
-
-	switch( m_state )
-	{
-		case State_Overview:
-			return;
-		case State_NoUserLoggedIn:
-			pm = img_no_user;
-			msg = tr( "No user logged in" );
-			break;
-		case State_Unreachable:
-			pm = img_host_unreachable;
-			msg = tr( "Host unreachable" );
-			break;
-		case State_Demo:
-			pm = img_demo;
-			msg = tr( "Demo running" );
-			break;
-		case State_Locked:
-			pm = img_locked;
-			msg = tr( "Desktop locked" );
-			break;
-		default:
-			break;
-	}
-
-	QFont f = p.font();
-	f.setBold( TRUE );
-	f.setPointSize( f.pointSize() + 1 );
-	p.setFont( f );
-
-	QRect r = p.boundingRect( QRect( 5, 0, aw-10, 10 ),
-				Qt::TextWordWrap | Qt::AlignCenter, msg );
-	QSize s( pm->size() );
-	s.scale( aw-10, ah-r.height()-20, Qt::KeepAspectRatio );
-	p.drawImage( ( aw-s.width() ) / 2, height()-ah,
-						FastQImage( *pm ).scaled( s ) );
-
-	p.setPen( QColor( 0, 0, 0 ) );
-	p.drawText( QRect( 5, height()-r.height()-10, aw - 10,
-						r.height() ),
-				Qt::TextWordWrap | Qt::AlignCenter, msg );
-	}
-
-	if( m_takeSnapshot )
-	{
-		Snapshot().take( m_connection->vncConnection(), m_user );
-		m_takeSnapshot = false;
-	}
-
-}
-
-
-
-
-void Client::resizeEvent( QResizeEvent * _re )
-{
-	findChild<closeButton*>()->move( width()-21, 3 );
-	m_connection->vncConnection()->setScaledSize( size() -
-							CONTENT_SIZE_SUB );
-	m_connection->vncConnection()->rescaleScreen();
-	QWidget::resizeEvent( _re );
-}
-
-
-
-
-
-void Client::showEvent( QShowEvent * )
-{
-	if( m_classRoomItem != NULL )
-	{
-		m_classRoomItem->setVisible( TRUE );
-	}
-
-	m_mainWindow->getClassroomManager()->clientVisibleChanged();
-}
-
-
-
-
-void Client::reload()
-{
-	QTimer::singleShot(
-				m_mainWindow->getClassroomManager()->updateInterval(),
-				this,
-				SLOT( reload() ) );
-	if( !isVisible() )
-	{
-		if( m_connection->vncConnection()->isRunning() )
-		{
-			m_connection->vncConnection()->stop();
-			update();
-		}
-		return;
-	}
-
-	if( userLoggedIn() )
-	{
-		m_connection->sendGetUserInformationRequest();
-		if( m_connection->user() != m_user )
-		{
-			m_user = m_connection->user();
-			update();
-		}
-		if( m_framebufferUpdated )
-		{
-			m_framebufferUpdated = false;
-			update();
-		}
-	}
-	else
-	{
-		if( !m_user.isEmpty() )
-		{
-			m_user = QString();
-			update();
-		}
-	}
-
-	if( m_classRoomItem )
-	{
-		m_classRoomItem->setUser( m_user );
-	}
-}
-
-
-
-
-void Client::setUpdateFlag()
-{
-	m_framebufferUpdated = true;
-}
-
-
-
-
-void Client::clientDemo()
-{
-	ClassroomManager * cm = m_mainWindow->getClassroomManager();
-	cm->changeGlobalClientMode( Mode_Overview );
-
-	QVector<Client *> vc = cm->visibleClients();
-
-	foreach( Client * cl, vc )
-	{
-		if( cl != this )
-		{
-			cl->changeMode( Mode_FullscreenDemo );
-		}
-	}
-
-	//m_mainWindow->checkModeButton( Client::Mode_FullscreenDemo );
-
-	m_mainWindow->remoteControlDisplay( m_hostname, TRUE, TRUE );
-}
-
-
-
-
-void Client::viewLive()
-{
-	changeMode( Mode_Overview );
-
-	m_mainWindow->remoteControlDisplay( m_hostname, TRUE );
-}
-
-
-
-
-void Client::remoteControl()
-{
-	changeMode( Mode_Overview );
-
-	m_mainWindow->remoteControlDisplay( m_hostname );
-}
-
-
-
-
-void Client::sendTextMessage( const QString & _msg )
-{
-	m_connection->displayTextMessage( _msg );
-}
-
-
-
-
-/*void Client::logonUser( const QString & _username, const QString & _password,
-			const QString & _domain )
-{
-	m_connection->logonUser( _username, _password, _domain );
-}*/
-
-
-
-
-void Client::logoutUser()
-{
-	m_connection->logoutUser();
-}
-
-
-
-
-void Client::snapshot()
-{
-	m_takeSnapshot = true;
-}
-
-
-
-
-
-void Client::powerOn()
-{
-	// we have to send the wake-on-LAN packets with root privileges,
-	// therefore let the local ICA do the job (as it usually is running
-	// with higher privileges)
-	m_mainWindow->localICA()->powerOnComputer( m_mac );
-}
-
-
-
-
-void Client::reboot()
-{
-	m_connection->restartComputer();
-}
-
-
-
-
-
-void Client::powerDown()
-{
-	m_connection->powerDownComputer();
-}
-
-
-
-
-void Client::execCmds( const QString & _cmds )
-{
-	m_connection->execCmds( _cmds );
-}
-
-
-
-
-Client::States Client::currentState( void ) const
-{
-	switch( m_mode )
-	{
-		case Mode_Overview:
-			if( m_connection->isConnected() )
-			{
-				return State_Overview;
-			}
-		/*	else if( m_connection->state() ==
-					ivsConnection::ConnectionRefused )
-			{
-				return( State_NoUserLoggedIn );
-			}*/
-			return State_Unreachable;
-
-		case Mode_FullscreenDemo:
-		case Mode_WindowDemo:
-			return State_Demo;
-
-		case Mode_Locked:
-			return State_Locked;
-
-		default:
-			break;
-	}
-
-	return State_Unkown;
-}
-
-
-
diff --git a/ima/src/Client.h b/ima/src/Client.h
deleted file mode 100644
index ec75094..0000000
--- a/ima/src/Client.h
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Client.h - declaration of class Client which represents a client, shows its
- *            display and allows controlling it in several ways
- *
- * Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CLIENT_H
-#define CLIENT_H
-
-#include <italcconfig.h>
-
-#include <QtCore/QHash>
-#include <QtCore/QThread>
-#include <QtCore/QQueue>
-#include <QtCore/QVector>
-#include <QtGui/QWidget>
-#include <QtGui/QImage>
-#include <QtGui/QMenu>
-
-#include "FastQImage.h"
-
-class classRoom;
-class classRoomItem;
-class Client;
-class MainWindow;
-class ItalcCoreConnection;
-class ItalcVncConnection;
-
-typedef void( Client:: * execCmd )( const QString & );
-
-const QString CONFIRM_NO = "n";
-const QString CONFIRM_YES = "y";
-
-
-class ClientAction : public QAction
-{
-	Q_OBJECT
-public:
-	enum Type
-	{
-		Overview,
-		FullscreenDemo,
-		WindowDemo,
-		Locked,
-		ViewLive,
-		RemoteControl,
-		ClientDemo,
-		SendTextMessage,
-		//LogonUser,
-		LogoutUser,
-		Snapshot,
-		PowerOn,
-		Reboot,
-		PowerDown,
-		ExecCmds,
-		RemoteScript,
-		LocalScript
-	} ;
-
-	enum TargetGroup
-	{
-		Default,
-		SelectedClients,
-		VisibleClients
-	} ;
-
-	enum Flags
-	{
-		None = 0,
-		FullMenu = 1
-	} ;
-
-	ClientAction( Type _type, QObject * _parent = 0, int _flags = 0 );
-	ClientAction( Type _type, const QIcon & _icon, const QString & _text,
-			QObject * _parent = 0, int _flags = 0 );
-	~ClientAction() {};
-
-	void process( QVector<Client *> _clients, TargetGroup _target = Default );
-	static void process( QAction * _action,
-			QVector<Client *> _clients, TargetGroup _target = Default );
-
-	inline bool flags( int _mask = -1 )
-	{
-		return ( m_flags & _mask );
-	}
-
-private:
-	Type m_type;
-	int m_flags;
-
-	bool confirmLogout( TargetGroup _target ) const;
-	bool confirmReboot( TargetGroup _target ) const;
-	bool confirmPowerDown( TargetGroup _target ) const;
-	QString dataExpanded( QVector<Client *> _clients ) const;
-
-} ;
-
-
-
-
-class clientMenu : public QMenu
-{
-	Q_OBJECT
-public:
-	static const bool FullMenu = TRUE;
-
-	clientMenu( const QString & _title, const QList<QAction *> _actions,
-			QWidget * _parent = 0, const bool _fullMenu = FALSE );
-
-	virtual ~clientMenu() {};
-
-	static QMenu * createDefault( QWidget * _parent );
-} ;
-
-
-
-
-inline QPixmap scaledIcon( const char * _name )
-{
-	return scaled( QString( ":/resources/" ) + _name, 16, 16 );
-}
-
-
-
-
-class Client : public QWidget
-{
-	Q_OBJECT
-public:
-	enum Modes
-	{
-		Mode_Overview,
-		Mode_FullscreenDemo,
-		Mode_WindowDemo,
-		Mode_Locked,
-		Mode_Unknown
-	} ;
-
-	enum States
-	{
-		State_Unreachable,
-		State_NoUserLoggedIn,
-		State_Overview,
-		State_Demo,
-		State_Locked,
-		State_Unkown
-	} ;
-
-	enum Types
-	{
-		Type_Student,
-		Type_Teacher,
-		Type_Other
-	} ;
-
-	Client( const QString & _hostname,
-		const QString & _mac, const QString & _name, Types _type,
-		classRoom * _class_room, MainWindow * _main_window,
-								int _id = -1 );
-
-	virtual ~Client();
-
-
-	int id( void ) const;
-	static Client * clientFromID( int _id );
-
-
-	inline Modes mode( void ) const
-	{
-		return( m_mode );
-	}
-
-	// action-handlers
-	void changeMode( const Modes _new_mode );
-	void viewLive( void );
-	void remoteControl( void );
-	void clientDemo( void );
-	void sendTextMessage( const QString & _msg );
-/*	void logonUser( const QString & _username, const QString & _password,
-			const QString & _domain );*/
-	void logoutUser( void );
-	void snapshot( void );
-	void powerOn( void );
-	void reboot( void );
-	void powerDown( void );
-	void execCmds( const QString & _cmds );
-
-
-	inline QString name( void ) const
-	{
-		return( m_nickname.isEmpty() ? m_hostname : m_nickname );
-	}
-
-	inline const QString & hostname( void ) const
-	{
-		return( m_hostname );
-	}
-
-	inline const QString & nickname( void ) const
-	{
-		return( m_nickname );
-	}
-
-	inline const QString & mac( void ) const
-	{
-		return( m_mac );
-	}
-
-	inline Types type( void ) const
-	{
-		return( m_type );
-	}
-
-	inline const QString & user( void ) const
-	{
-		return( m_user );
-	}
-
-	inline void setNickname( const QString & _nickname )
-	{
-		m_nickname = _nickname;
-	}
-
-	inline void setHostname( const QString & _hostname )
-	{
-		m_hostname = _hostname;
-	}
-
-	inline void setMac( const QString & _mac )
-	{
-		m_mac = _mac;
-	}
-
-	inline void setType( Types _type )
-	{
-		if( _type >= Type_Student && _type <= Type_Other )
-		{
-			m_type = _type;
-		}
-	}
-
-	void setClassRoom( classRoom * _cr );
-
-	void resetConnection( void );
-
-	virtual void update( void );
-
-
-	void zoom( void );
-	void zoomBack( void );
-
-
-	float m_rasterX;
-	float m_rasterY;
-
-
-public slots:
-
-
-private slots:
-	void enlarge( void );
-	void reload( void );
-	void setUpdateFlag();
-
-
-private:
-	bool userLoggedIn( void );
-
-	virtual void contextMenuEvent( QContextMenuEvent * _cme );
-	virtual void closeEvent( QCloseEvent * _ce );
-	virtual void hideEvent( QHideEvent * _he );
-	virtual void mousePressEvent( QMouseEvent * _me );
-	virtual void mouseMoveEvent( QMouseEvent * _me );
-	virtual void mouseReleaseEvent( QMouseEvent * _me );
-	virtual void mouseDoubleClickEvent( QMouseEvent * _me );
-	virtual void paintEvent( QPaintEvent * _pe );
-	virtual void resizeEvent( QResizeEvent * _re );
-	virtual void showEvent( QShowEvent * _se );
-
-
-	States currentState( void ) const;
-
-
-	MainWindow * m_mainWindow;
-	ItalcCoreConnection *m_connection;
-	ItalcVncConnection *m_vncConn;
-	bool m_framebufferUpdated;
-	QPoint m_clickPoint;
-	QPoint m_origPos;
-	QSize m_origSize;
-
-	QString m_hostname;
-	QString m_nickname;
-	QString m_mac;
-	Types m_type;
-
-	Modes m_mode;
-	QString m_user;
-	volatile bool m_takeSnapshot;
-
-	States m_state;
-
-	classRoomItem * m_classRoomItem;
-
-
-	// static data
-	static QHash<int, Client *> s_clientIDs;
-
-	// static members
-	static int freeID( void );
-
-
-	friend class classRoomItem;
-
-} ;
-
-
-#endif
diff --git a/ima/src/ConfigWidget.cpp b/ima/src/ConfigWidget.cpp
deleted file mode 100644
index 9c63814..0000000
--- a/ima/src/ConfigWidget.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * ConfigWidget.cpp - implementation of configuration-widget for side-bar
- *
- * Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
-#include <QtGui/QCheckBox>
-#include <QtGui/QComboBox>
-#include <QtGui/QMessageBox>
-
-#include "ConfigWidget.h"
-#include "ClassroomManager.h"
-#include "ItalcCore.h"
-#include "MainWindow.h"
-#include "ToolButton.h"
-#ifdef ITALC3
-#include "MasterCore.h"
-#include "PersonalConfig.h"
-#endif
-
-
-ConfigWidget::ConfigWidget( MainWindow * _main_window, QWidget * _parent ) :
-	SideBarWidget( QPixmap( ":/resources/config.png" ),
-			tr( "Your iTALC-configuration" ),
-			tr( "In this workspace you can customize iTALC to "
-				"fit your needs." ),
-			_main_window, _parent )
-{
-	setupUi( contentParent() );
-
-#ifdef ITALC3
-
-#define LOAD_AND_CONNECT_PROPERTY(property,type,widget,setvalue,signal,slot) \
-		widget->setvalue( MasterCore::personalConfig->property() );  \
-		connect( widget, SIGNAL(signal(type)),                       \
-			MasterCore::personalConfig, SLOT(slot(type)) );
-
-	LOAD_AND_CONNECT_PROPERTY(clientUpdateInterval,
-					int,
-					updateIntervalSB,
-					setValue,
-					valueChanged,
-					setClientUpdateInterval);
-
-	LOAD_AND_CONNECT_PROPERTY(demoQuality,
-					int,
-					demoQualityCB,
-					setCurrentIndex,
-					activated,
-					setDemoQuality);
-
-	LOAD_AND_CONNECT_PROPERTY(defaultRole,
-					int,
-					roleCB,
-					setCurrentIndex,
-					activated,
-					setDefaultRole);
-
-	LOAD_AND_CONNECT_PROPERTY(defaultDomain,
-					const QString &,
-					domainEdit,
-					setText,
-					textChanged,
-					setDefaultDomain);
-
-	LOAD_AND_CONNECT_PROPERTY(clientDoubleClickAction,
-					int,
-					clientDoubleClickActionCB,
-					setCurrentIndex,
-					activated,
-					setClientDoubleClickAction);
-
-	LOAD_AND_CONNECT_PROPERTY(toolButtonIconOnlyMode,
-					bool,
-					iconOnlyToolButtons,
-					setChecked,
-					toggled,
-					setToolButtonIconOnlyMode);
-
-	LOAD_AND_CONNECT_PROPERTY(noToolTips,
-					bool,
-					balloonToolTips,
-					setChecked,
-					toggled,
-					setNoToolTips);
-#else
-	connect( updateIntervalSB, SIGNAL( valueChanged( double ) ),
-				mainWindow()->getClassroomManager(),
-					SLOT( updateIntervalChanged( double ) ) );
-	mainWindow()->getClassroomManager()->setUpdateIntervalSpinBox( updateIntervalSB );
-
-
-	roleCB->setCurrentIndex( ItalcCore::role - 1 );
-
-	connect( roleCB, SIGNAL( activated( int ) ), this,
-						SLOT( roleSelected( int ) ) );
-
-
-	balloonToolTips->setChecked( ToolButton::toolTipsDisabled() );
-	connect( balloonToolTips, SIGNAL( toggled( bool ) ),
-			this, SLOT( toggleToolButtonTips( bool ) ) );
-
-	iconOnlyToolButtons->setChecked( ToolButton::iconOnlyMode() );
-	connect( iconOnlyToolButtons, SIGNAL( toggled( bool ) ),
-			this, SLOT( toggleIconOnlyToolButtons( bool ) ) );
-
-	domainEdit->setText( __default_domain );
-	connect( domainEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( domainChanged( const QString & ) ) );
-
-	clientDoubleClickActionCB->setCurrentIndex( mainWindow()->
-				getClassroomManager()->clientDblClickAction() );
-	connect( clientDoubleClickActionCB, SIGNAL( activated( int ) ),
-				mainWindow()->getClassroomManager(),
-				SLOT( setClientDblClickAction( int ) ) );
-#endif
-}
-
-
-
-
-ConfigWidget::~ConfigWidget()
-{
-}
-
-
-
-
-void ConfigWidget::roleSelected( int _role )
-{
-	ItalcCore::role = static_cast<ItalcCore::UserRole>( _role );
-}
-
-
-
-
-#ifndef ITALC3
-void ConfigWidget::toggleToolButtonTips( bool _on )
-{
-	ToolButton::setToolTipsDisabled( _on );
-}
-
-
-
-
-void ConfigWidget::toggleIconOnlyToolButtons( bool _on )
-{
-	ToolButton::setIconOnlyMode( _on );
-}
-
-
-
-
-void ConfigWidget::domainChanged( const QString & _domain )
-{
-	__default_domain = _domain;
-}
-
-#endif
-
-
-
-
diff --git a/ima/src/ConfigWidget.h b/ima/src/ConfigWidget.h
deleted file mode 100644
index 79e4d52..0000000
--- a/ima/src/ConfigWidget.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * ConfigWidget.h - configuration-widget for side-bar
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CONFIG_WIDGET_H
-#define CONFIG_WIDGET_H
-
-#include "SideBarWidget.h"
-#include "ui_Config.h"
-
-
-class ConfigWidget : public SideBarWidget, private Ui::Config
-{
-	Q_OBJECT
-public:
-	ConfigWidget( MainWindow * _main_window, QWidget * _parent );
-	virtual ~ConfigWidget();
-
-
-protected slots:
-	void roleSelected( int );
-#ifndef ITALC3
-	void toggleToolButtonTips( bool _on );
-	void toggleIconOnlyToolButtons( bool _on );
-	void domainChanged( const QString & _domain );
-#endif
-
-} ;
-
-
-#endif
diff --git a/ima/src/Dialogs.cpp b/ima/src/Dialogs.cpp
deleted file mode 100644
index db1131f..0000000
--- a/ima/src/Dialogs.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Dialogs.cpp - implementation of dialogs
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QRegExp>
-
-#include "Dialogs.h"
-#include "Client.h"
-#include "ClassroomManager.h"
-#include "MainWindow.h"
-#include "DecoratedMessageBox.h"
-
-#include "ui_ClientSettingsDialog.h"
-#include "ui_TextMessageDialog.h"
-#include "ui_SupportDialog.h"
-#include "ui_RemoteLogonDialog.h"
-
-
-#ifdef ITALC3
-#include "GlobalConfig.h"
-#include "MasterCore.h"
-#include "MasterUI.h"
-#endif
-
-
-
-ClientSettingsDialog::ClientSettingsDialog( Client * _client,
-#ifndef ITALC3
-						MainWindow * _main_window,
-#endif
-						const QString & _classroom ) :
-#ifdef ITALC3
-	QDialog( MasterUI::mainWindow ),
-#else
-	QDialog( _main_window ),
-#endif
-	ui( new Ui::ClientSettingsDialog ),
-	m_client( _client )
-#ifndef ITALC3
-	,m_mainWindow( _main_window )
-#endif
-{
-	ui->setupUi( this );
-
-	ui->hostnameEdit->setFocus();
-	int classroomIndex = 0;
-
-#ifdef ITALC3
-	int i = 0;
-	ClassroomManager * cm = MasterCore::classroomManager;
-	foreach( const Classroom * cr,
-			MasterCore::classroomManager->classrooms() )
-	{
-		classRoomComboBox->addItem( cr->name() );
-		if( _classroom == cr->name() )
-		{
-			classroomIndex = i;
-		}
-		++i;
-	}
-#else
-	ClassroomManager * cm = m_mainWindow->getClassroomManager();
-	for( int i = 0; i < cm->m_classRooms.size(); ++i )
-	{
-		ui->classRoomComboBox->addItem( cm->m_classRooms[i]->text( 0 ) );
-		if( _classroom == cm->m_classRooms[i]->text( 0 ) )
-		{
-			classroomIndex = i;
-		}
-	}
-#endif
-
-	ui->classRoomComboBox->setCurrentIndex( classroomIndex );
-
-	if( m_client != NULL )
-	{
-		ui->macEdit->setText( m_client->mac() );
-#ifdef ITALC3
-		ui->hostnameEdit->setText( m_client->host() );
-		ui->nameEdit->setText( m_client->displayName() );
-#else
-		ui->hostnameEdit->setText( m_client->hostname() );
-		ui->nameEdit->setText( m_client->nickname() );
-#endif
-		ui->typeComboBox->setCurrentIndex( m_client->type() );
-	}
-}
-
-
-
-
-void ClientSettingsDialog::accept()
-{
-	if( ui->hostnameEdit->text().isEmpty() )
-	{
-		DecoratedMessageBox::information(
-			tr( "Missing IP address/hostname" ),
-			tr( "You didn't specify an IP address or hostname for "
-							"the computer!" ),
-					QPixmap( ":/resources/stop.png" ) );
-		return;
-	}
-
-	// check whether mac-address is valid
-	if( !ui->macEdit->text().isEmpty() &&
-		QString( ui->macEdit->text().toUpper() + ":" ).
-					indexOf( QRegExp( "^([\\dA-F]{2}:){6}$" ) ) != 0 )
-	{
-		DecoratedMessageBox::information(
-			tr( "Invalid MAC-address" ),
-			tr( "You specified an invalid MAC-address. Either "
-				"leave the field blank or enter a valid MAC-"
-				"address (use \":\" as separator!)." ),
-					QPixmap( ":/resources/stop.png" ) );
-		return;
-	}
-
-	if( m_client == NULL )
-	{
-#ifdef ITALC3
-		m_client = new Client( ui->hostnameEdit->text(),
-								ui->macEdit->text(),
-								ui->nameEdit->text(),
-				(Client::Types) ui->typeComboBox->currentIndex() );
-#else
-		m_client = new Client( ui->hostnameEdit->text(),
-								ui->macEdit->text(),
-								ui->nameEdit->text(),
-				(Client::Types) ui->typeComboBox->currentIndex(),
-m_mainWindow->getClassroomManager()->m_classRooms[ui->classRoomComboBox->currentIndex()],
-					m_mainWindow );
-#endif
-	}
-	else
-	{
-		m_client->setMac( ui->macEdit->text() );
-		m_client->setType( (Client::Types) ui->typeComboBox->currentIndex() );
-#ifdef ITALC3
-		m_client->setHost( ui->hostnameEdit->text() );
-		m_client->setDisplayName( ui->nameEdit->text() );
-		m_client->closeConnection();
-		m_client->openConnection();
-#else
-		m_client->setHostname( ui->hostnameEdit->text() );
-		m_client->setNickname( ui->nameEdit->text() );
-		m_client->setClassRoom(
-m_mainWindow->getClassroomManager()->m_classRooms[ui->classRoomComboBox->currentIndex()] );
-		m_client->resetConnection();
-#endif
-	}
-
-	QDialog::accept();
-}
-
-
-
-
-
-SupportDialog::SupportDialog( QWidget *parent ) :
-	QDialog( parent ),
-	ui( new Ui::SupportDialog )
-{
-	ui->setupUi( this );
-}
-
-
-
-QString SupportDialog::getHost( QWidget *parent )
-{
-	SupportDialog sd( parent );
-	if( sd.exec() == Accepted )
-	{
-		return sd.ui->hostEdit->text();
-	}
-
-	return QString();
-}
-
-
-
-
-
-TextMessageDialog::TextMessageDialog( QString &msgStr, QWidget *parent ) :
-	QDialog( parent ),
-	ui( new Ui::TextMessageDialog ),
-	m_msgStr( msgStr )
-{
-	ui->setupUi( this );
-}
-
-
-
-
-void TextMessageDialog::accept()
-{
-	m_msgStr = ui->textEdit->toPlainText();
-	QDialog::accept();
-}
-
-
-
-
-
-
-RemoteLogonDialog::RemoteLogonDialog( QWidget *parent ) :
-	QDialog( parent ),
-	ui( new Ui::RemoteLogonDialog )
-{
-	ui->setupUi( this );
-
-#ifdef ITALC3
-	ui->domainEdit->setText( MasterCore::globalConfig->defaultDomain() );
-#else
-	ui->domainEdit->setText( __default_domain );
-#endif
-	connect( ui->userNameEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( userNameChanged( const QString & ) ) );
-	connect( ui->passwordEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( passwordChanged( const QString & ) ) );
-	connect( ui->domainEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( domainChanged( const QString & ) ) );
-}
-
-
-
diff --git a/ima/src/Dialogs.h b/ima/src/Dialogs.h
deleted file mode 100644
index 8a8fd0b..0000000
--- a/ima/src/Dialogs.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Dialogs.h - declaration of dialog classes
- *
- * Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DIALOGS_H
-#define DIALOGS_H
-
-#include <QtGui/QDialog>
-
-namespace Ui
-{
-	class ClientSettingsDialog;
-	class TextMessageDialog;
-	class SupportDialog;
-	class RemoteLogonDialog;
-}
-
-class Client;
-#ifndef ITALC3
-class MainWindow;
-#endif
-
-
-class ClientSettingsDialog : public QDialog
-{
-	Q_OBJECT
-public:
-	ClientSettingsDialog( Client *c,
-#ifndef ITALC3
-				MainWindow * _main_window,
-#endif
-				const QString &classroom );
-
-private:
-	virtual void accept();
-
-	Ui::ClientSettingsDialog *ui;
-	Client *m_client;
-#ifndef ITALC3
-	MainWindow * m_mainWindow;
-#endif
-
-} ;
-
-
-
-
-class SupportDialog : public QDialog
-{
-public:
-	SupportDialog( QWidget *parent );
-
-	static QString getHost( QWidget *parent );
-
-
-private:
-	Ui::SupportDialog *ui;
-
-} ;
-
-
-
-
-class TextMessageDialog : public QDialog
-{
-	Q_OBJECT
-public:
-	TextMessageDialog( QString &msgStr, QWidget *parent );
-
-
-private slots:
-	virtual void accept();
-
-
-private:
-	Ui::TextMessageDialog *ui;
-	QString &m_msgStr;
-
-} ;
-
-
-
-
-class RemoteLogonDialog : public QDialog
-{
-	Q_OBJECT
-public:
-	RemoteLogonDialog( QWidget *parent );
-
-	const QString &userName() const
-	{
-		return m_userName;
-	}
-
-	const QString &password() const
-	{
-		return m_password;
-	}
-
-	const QString &domain() const
-	{
-		return m_domain;
-	}
-
-
-private slots:
-	void userNameChanged( const QString &un )
-	{
-		m_userName = un;
-	}
-
-	void passwordChanged( const QString &pw )
-	{
-		m_password = pw;
-	}
-
-	void domainChanged( const QString &domain )
-	{
-		m_domain = domain;
-	}
-
-
-private:
-	Ui::RemoteLogonDialog *ui;
-	QString m_userName;
-	QString m_password;
-	QString m_domain;
-
-} ;
-
-
-#endif
diff --git a/ima/src/MainToolBar.cpp b/ima/src/MainToolBar.cpp
deleted file mode 100644
index 95e084e..0000000
--- a/ima/src/MainToolBar.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *  MainToolBar.cpp - MainToolBar for MainWindow
- *
- *  Copyright (c) 2007-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-
-#include <QtGui/QMenu>
-#include <QtGui/QPainter>
-#include <QtGui/QPaintEvent>
-
-#include "MainToolBar.h"
-
-
-
-MainToolBar::MainToolBar( QWidget * _parent ) :
-	QToolBar( tr( "Actions" ), _parent )
-{
-	QPalette pal = palette();
-	pal.setBrush( QPalette::Window, QPixmap( ":/resources/toolbar-background.png" ) );
-	setPalette( pal );
-}
-
-
-
-
-MainToolBar::~MainToolBar()
-{
-}
-
-
-
-
-void MainToolBar::contextMenuEvent( QContextMenuEvent * _e )
-{
-	QMenu m( this );
-	foreach( QAction * a, actions() )
-	{
-		QAction * ma = m.addAction( a->text() );
-		ma->setCheckable( TRUE );
-		ma->setChecked( a->isVisible() );
-	}
-	connect( &m, SIGNAL( triggered( QAction * ) ),
-				this, SLOT( toggleButton( QAction * ) ) );
-	m.exec( _e->globalPos() );
-
-}
-
-
-
-
-void MainToolBar::paintEvent( QPaintEvent * _pe )
-{
-	QPainter p( this );
-	p.setPen( QColor( 48, 48, 48 ) );
-	p.fillRect( _pe->rect(), palette().brush( QPalette::Window ) );
-	p.drawLine( 0, 0, width(), 0 );
-	p.drawLine( 0, height()-1, width(), height()-1 );
-}
-
-
-
-
-void MainToolBar::toggleButton( QAction * _a )
-{
-	foreach( QAction * a, actions() )
-	{
-		if( a->text() == _a->text() )
-		{
-			a->setVisible( !a->isVisible() );
-			break;
-		}
-	}
-}
-
-
-
diff --git a/ima/src/MainToolBar.h b/ima/src/MainToolBar.h
deleted file mode 100644
index 235de9e..0000000
--- a/ima/src/MainToolBar.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * MainToolBar.h - MainToolBar for MainWindow
- *
- * Copyright (c) 2007-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#ifndef MAIN_TOOL_BAR_H
-#define MAIN_TOOL_BAR_H
-
-#include <QtGui/QToolBar>
-
-
-class MainToolBar : public QToolBar
-{
-	Q_OBJECT
-public:
-	MainToolBar( QWidget * _parent );
-	virtual ~MainToolBar();
-
-
-private:
-	virtual void contextMenuEvent( QContextMenuEvent * _e );
-	virtual void paintEvent( QPaintEvent * _pe );
-
-
-private slots:
-	void toggleButton( QAction * );
-
-} ;
-
-#endif
-
diff --git a/ima/src/MainWindow.cpp b/ima/src/MainWindow.cpp
deleted file mode 100644
index 77bd667..0000000
--- a/ima/src/MainWindow.cpp
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
- * MainWindow.cpp - implementation of MainWindow class
- *
- * Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QDir>
-#include <QtCore/QDateTime>
-#include <QtCore/QTimer>
-#include <QtGui/QApplication>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QCloseEvent>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QMenu>
-#include <QtGui/QMenuBar>
-#include <QtGui/QMessageBox>
-#include <QtGui/QScrollArea>
-#include <QtGui/QSplashScreen>
-#include <QtGui/QToolBar>
-#include <QtGui/QToolButton>
-#include <QtGui/QWorkspace>
-#include <QtNetwork/QHostAddress>
-
-#include "MainWindow.h"
-#include "AboutDialog.h"
-#include "AuthenticationCredentials.h"
-#include "ClassroomManager.h"
-#include "Dialogs.h"
-#include "PasswordDialog.h"
-#include "OverviewWidget.h"
-#include "SnapshotList.h"
-#include "ConfigWidget.h"
-#include "ToolButton.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCoreConnection.h"
-#include "ItalcVncConnection.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "RemoteControlWidget.h"
-
-
-
-MainWindow::MainWindow( int _rctrl_screen ) :
-	QMainWindow(/* 0, Qt::FramelessWindowHint*/ ),
-	m_systemTrayIcon( this ),
-	m_openedTabInSideBar( 1 ),
-	m_localICA( NULL ),
-	m_rctrlLock(),
-	m_remoteControlWidget( NULL ),
-	m_stopDemo( FALSE ),
-	m_remoteControlScreen( _rctrl_screen > -1 ?
-				qMin( _rctrl_screen,
-					QApplication::desktop()->numScreens() )
-				:
-				QApplication::desktop()->screenNumber( this ) )
-{
-	setupUi( this );
-
-	setWindowTitle( tr( "iTALC" ) + " " + ITALC_VERSION );
-
-	if( LocalSystem::Path::ensurePathExists(
-						LocalSystem::Path::personalConfigDataPath() ) == false )
-	{
-		if( splashScreen != NULL )
-		{
-			splashScreen->hide();
-		}
-		QMessageBox::information( this, tr( "No write access" ),
-			tr( "Could not read/write or create directory %1! "
-			"For running iTALC, make sure you're permitted to "
-			"create or write this directory." ).arg(
-					LocalSystem::Path::personalConfigDataPath() ) );
-		return;
-	}
-
-	// configure side bar
-	m_sideBar->setOrientation( Qt::Vertical );
-
-	// configure scroll area
-	m_scrollArea->setBackgroundRole( QPalette::Dark );
-	m_workspace = new clientWorkspace( m_scrollArea );
-
-
-	// now create all sidebar-workspaces
-	m_overviewWidget = new OverviewWidget( this, m_centralWidget );
-	m_classroomManager = new ClassroomManager( this, m_centralWidget );
-	m_snapshotList = new SnapshotList( this, m_centralWidget );
-	m_configWidget = new ConfigWidget( this, m_centralWidget );
-
-	m_workspace->m_contextMenu = m_classroomManager->quickSwitchMenu();
-
-	// append sidebar-workspaces to sidebar
-	m_sideBar->appendTab( m_overviewWidget );
-	m_sideBar->appendTab( m_classroomManager );
-	m_sideBar->appendTab( m_snapshotList );
-	m_sideBar->appendTab( m_configWidget );
-
-	m_centralLayout->insertWidget( 0, m_overviewWidget );
-	m_centralLayout->insertWidget( 0, m_classroomManager );
-	m_centralLayout->insertWidget( 0, m_snapshotList );
-	m_centralLayout->insertWidget( 0, m_configWidget );
-/*	setCentralWidget( hbox );
-	hbox_layout->addWidget( m_sideBar );
-	hbox_layout->addWidget( m_splitter );*/
-
-
-
-
-	// create the action-toolbar
-	m_toolBar->layout()->setSpacing( 4 );
-	m_toolBar->setObjectName( "maintoolbar" );
-	m_toolBar->toggleViewAction()->setEnabled( FALSE );
-
-	addToolBar( Qt::TopToolBarArea, m_toolBar );
-
-	ToolButton * scr = new ToolButton(
-			QPixmap( ":/resources/classroom.png" ),
-			tr( "Classroom" ), QString::null,
-			tr( "Switch classroom" ),
-			tr( "Click this button to open a menu where you can "
-				"choose the active classroom." ),
-			NULL, NULL, m_toolBar );
-	scr->setMenu( m_classroomManager->quickSwitchMenu() );
-	scr->setPopupMode( ToolButton::InstantPopup );
-	scr->setWhatsThis( tr( "Click on this button, to switch between "
-							"classrooms." ) );
-
-	m_modeGroup = new QButtonGroup( this );
-
-	QAction * a;
-
-	a = new QAction( QIcon( ":/resources/overview_mode.png" ),
-						tr( "Overview mode" ), this );
-	m_sysTrayActions << a;
-	ToolButton * overview_mode = new ToolButton(
-			a, tr( "Overview" ), QString::null,
-			tr( "This is the default mode in iTALC and allows you "
-				"to have an overview over all visible "
-				"computers. Also click on this button for "
-				"unlocking locked workstations or for leaving "
-				"demo-mode." ),
-			this, SLOT( mapOverview() ), m_toolBar );
-
-
-	a = new QAction( QIcon( ":/resources/fullscreen_demo.png" ),
-						tr( "Fullscreen demo" ), this );
-	m_sysTrayActions << a;
-	ToolButton * fsdemo_mode = new ToolButton(
-			a, tr( "Fullscreen Demo" ), tr( "Stop Demo" ),
-			tr( "In this mode your screen is being displayed on "
-				"all shown computers. Furthermore the users "
-				"aren't able to do something else as all input "
-				"devices are locked in this mode." ),
-			this, SLOT( mapFullscreenDemo() ), m_toolBar );
-
-	a = new QAction( QIcon( ":/resources/window_demo.png" ),
-						tr( "Window demo" ), this );
-	m_sysTrayActions << a;
-	ToolButton * windemo_mode = new ToolButton(
-			a, tr( "Window Demo" ), tr( "Stop Demo" ),
-			tr( "In this mode your screen being displayed in a "
-				"window on all shown computers. The users are "
-				"able to switch to other windows and thus "
-				"can continue to work." ),
-			this, SLOT( mapWindowDemo() ), m_toolBar );
-
-	a = new QAction( QIcon( ":/resources/locked.png" ),
-					tr( "Lock/unlock desktops" ), this );
-	m_sysTrayActions << a;
-	ToolButton * lock_mode = new ToolButton(
-			a, tr( "Lock all" ), tr( "Unlock all" ),
-			tr( "To have all user's full attention you can lock "
-				"their desktops using this button. "
-				"In this mode all input devices are locked and "
-				"the screen is black." ),
-			this, SLOT( mapScreenLock() ), m_toolBar );
-
-	overview_mode->setCheckable( TRUE );
-	fsdemo_mode->setCheckable( TRUE );
-	windemo_mode->setCheckable( TRUE );
-	lock_mode->setCheckable( TRUE );
-
-	m_modeGroup->addButton( overview_mode, Client::Mode_Overview );
-	m_modeGroup->addButton( fsdemo_mode, Client::Mode_FullscreenDemo );
-	m_modeGroup->addButton( windemo_mode, Client::Mode_WindowDemo );
-	m_modeGroup->addButton( lock_mode, Client::Mode_Locked );
-
-	overview_mode->setChecked( TRUE );
-
-
-
-	a = new QAction( QIcon( ":/resources/text_message.png" ),
-					tr( "Send text message" ), this );
-//	m_sysTrayActions << a;
-	ToolButton * text_msg = new ToolButton(
-			a, tr( "Text message" ), QString::null,
-			tr( "Use this button to send a text message to all "
-				"users e.g. to tell them new tasks etc." ),
-			m_classroomManager, SLOT( sendMessage() ), m_toolBar );
-
-
-	a = new QAction( QIcon( ":/resources/power_on.png" ),
-					tr( "Power on computers" ), this );
-	m_sysTrayActions << a;
-	ToolButton * power_on = new ToolButton(
-			a, tr( "Power on" ), QString::null,
-			tr( "Click this button to power on all visible "
-				"computers. This way you do not have to turn "
-				"on each computer by hand." ),
-			m_classroomManager, SLOT( powerOnClients() ),
-								m_toolBar );
-
-	a = new QAction( QIcon( ":/resources/power_off.png" ),
-					tr( "Power down computers" ), this );
-	m_sysTrayActions << a;
-	ToolButton * power_off = new ToolButton(
-			a, tr( "Power down" ), QString::null,
-			tr( "To power down all shown computers (e.g. after "
-				"the lesson has finished) you can click this "
-				"button." ),
-			m_classroomManager,
-					SLOT( powerDownClients() ), m_toolBar );
-
-/*	ToolButton * remotelogon = new ToolButton(
-			QPixmap( ":/resources/remotelogon.png" ),
-			tr( "Logon" ), QString::null,
-			tr( "Remote logon" ),
-			tr( "After clicking this button you can enter a "
-				"username and password to log on the "
-				"according user on all visible computers." ),
-			m_classroomManager, SLOT( remoteLogon() ), m_toolBar );*/
-
-	ToolButton * directsupport = new ToolButton(
-			QPixmap( ":/resources/remote_control.png" ),
-			tr( "Support" ), QString::null,
-			tr( "Direct support" ),
-			tr( "If you need to support someone at a certain "
-				"computer you can click this button and enter "
-				"the according hostname or IP afterwards." ),
-			m_classroomManager, SLOT( directSupport() ), m_toolBar );
-
-	ToolButton * adjust_size = new ToolButton(
-			QPixmap( ":/resources/adjust_size.png" ),
-			tr( "Adjust/align" ), QString::null,
-			tr( "Adjust windows and their size" ),
-			tr( "When clicking this button the biggest possible "
-				"size for the client-windows is adjusted. "
-				"Furthermore all windows are aligned." ),
-			m_classroomManager, SLOT( adjustWindows() ), m_toolBar );
-
-	ToolButton * auto_arrange = new ToolButton(
-			QPixmap( ":/resources/auto_arrange.png" ),
-			tr( "Auto view" ), QString::null,
-			tr( "Auto re-arrange windows and their size" ),
-			tr( "When clicking this button all visible windows "
-					"are re-arranged and adjusted." ),
-			NULL, NULL, m_toolBar );
-	auto_arrange->setCheckable( true );
-	auto_arrange->setChecked( m_classroomManager->isAutoArranged() );
-	connect( auto_arrange, SIGNAL( toggled( bool ) ), m_classroomManager,
-						 SLOT( arrangeWindowsToggle ( bool ) ) );
-
-	scr->addTo( m_toolBar );
-	overview_mode->addTo( m_toolBar );
-	fsdemo_mode->addTo( m_toolBar );
-	windemo_mode->addTo( m_toolBar );
-	lock_mode->addTo( m_toolBar );
-	text_msg->addTo( m_toolBar );
-	power_on->addTo( m_toolBar );
-	power_off->addTo( m_toolBar );
-	//remotelogon->addTo( m_toolBar );
-	directsupport->addTo( m_toolBar );
-	adjust_size->addTo( m_toolBar );
-	auto_arrange->addTo( m_toolBar );
-
-	restoreState( QByteArray::fromBase64(
-				m_classroomManager->winCfg().toUtf8() ) );
-	QStringList hidden_buttons = m_classroomManager->toolBarCfg().
-								split( '#' );
-	foreach( QAction * a, m_toolBar->actions() )
-	{
-		if( hidden_buttons.contains( a->text() ) )
-		{
-			a->setVisible( FALSE );
-		}
-	}
-
-	foreach( QAbstractButton * btn, m_sideBar->tabs() )
-	{
-		if( hidden_buttons.contains( btn->text() ) )
-		{
-			btn->setVisible( false );
-		}
-	}
-
-	ItalcVncConnection * conn = new ItalcVncConnection( this );
-	// attach ItalcCoreConnection to it so we can send extended iTALC commands
-	m_localICA = new ItalcCoreConnection( conn );
-
-	conn->setHost( QHostAddress( QHostAddress::LocalHost ).toString() );
-	conn->setPort( ItalcCore::config->coreServerPort() );
-	conn->setFramebufferUpdateInterval( -1 );
-	conn->start();
-
-	if( !conn->waitForConnected( 5000 ) )
-	{
-		QMessageBox::information( this,
-			tr( "Could not contact iTALC service" ),
-			tr( "Could not contact the local iTALC service. It is likely "
-				"that you entered wrong credentials or key files are "
-				"not set up properly. Try again or contact your "
-				"administrator for solving this problem using the iTALC "
-				"Management Console." ) );
-		if( ItalcCore::config->logLevel() < Logger::LogLevelDebug )
-		{
-			return;
-		}
-	}
-
-	// update the role under which ICA is running
-	m_localICA->setRole( ItalcCore::role );
-	m_localICA->startDemoServer( ItalcCore::config->coreServerPort(),
-									ItalcCore::config->demoServerPort() );
-
-//	##ITALC2: m_localISD->hideTrayIcon();
-
-	// setup system tray icon
-	QIcon icon( ":/resources/icon16.png" );
-	icon.addFile( ":/resources/icon22.png" );
-	icon.addFile( ":/resources/icon32.png" );
-
-	m_systemTrayIcon.setIcon( icon );
-	m_systemTrayIcon.setToolTip( tr( "iTALC Master Control" ) );
-	m_systemTrayIcon.show();
-	connect( &m_systemTrayIcon, SIGNAL( activated(
-					QSystemTrayIcon::ActivationReason ) ),
-		this, SLOT( handleSystemTrayEvent(
-					QSystemTrayIcon::ActivationReason ) ) );
-
-
-	QTimer::singleShot( 2000, m_classroomManager, SLOT( updateClients() ) );
-
-	m_updateThread = new MainWindowUpdateThread( this );
-}
-
-
-
-
-MainWindow::~MainWindow()
-{
-	m_classroomManager->doCleanupWork();
-
-	// also delets clients
-	delete m_workspace;
-
-	m_localICA->stopDemoServer();
-
-	delete m_localICA;
-	m_localICA = NULL;
-
-	m_systemTrayIcon.hide();
-}
-
-
-
-
-bool MainWindow::initAuthentication()
-{
-	if( ItalcCore::initAuthentication() )
-	{
-		return true;
-	}
-
-	if( ItalcCore::role != ItalcCore::RoleTeacher )
-	{
-		ItalcCore::role = ItalcCore::RoleTeacher;
-		return initAuthentication();
-	}
-
-	// if we have logon credentials, assume they are fine and continue
-	if( ItalcCore::authenticationCredentials->hasCredentials(
-									AuthenticationCredentials::UserLogon ) )
-	{
-		return true;
-	}
-
-	QMessageBox::information( NULL,
-			tr( "Authentication impossible" ),
-			tr(	"No authentication key files were found or your current ones "
-				"are outdated. Please create new key files using the iTALC "
-				"Management Console. Alternatively set up logon authentication "
-				"using the iTALC Management Console. Otherwise you won't be "
-				"able to access computers using iTALC." ) );
-
-	return false;
-}
-
-
-
-
-void MainWindow::keyPressEvent( QKeyEvent * _e )
-{
-	if( _e->key() == Qt::Key_F11 )
-	{
-		QWidget::setWindowState( QWidget::windowState() ^
-							Qt::WindowFullScreen );
-	}
-	else
-	{
-		QMainWindow::keyPressEvent( _e );
-	}
-}
-
-
-
-
-void MainWindow::closeEvent( QCloseEvent * _ce )
-{
-	m_updateThread->quit();
-	m_updateThread->wait();
-	delete m_updateThread;
-	m_updateThread = NULL;
-
-	m_classroomManager->savePersonalConfig();
-	m_classroomManager->saveGlobalClientConfig();
-
-	_ce->accept();
-}
-
-
-
-
-void MainWindow::handleSystemTrayEvent( QSystemTrayIcon::ActivationReason _r )
-{
-	switch( _r )
-	{
-		case QSystemTrayIcon::Trigger:
-			setVisible( !isVisible() );
-			break;
-		case QSystemTrayIcon::Context:
-		{
-			QMenu m( this );
-			m.addAction( m_systemTrayIcon.toolTip() )->setEnabled( FALSE );
-			foreach( QAction * a, m_sysTrayActions )
-			{
-				m.addAction( a );
-			}
-
-			m.addSeparator();
-
-			QMenu rcm( this );
-			QAction * rc = m.addAction( tr( "Remote control" ) );
-			rc->setMenu( &rcm );
-			foreach( Client * c,
-					m_classroomManager->visibleClients() )
-			{
-				rcm.addAction( c->name() )->
-						setData( c->hostname() );
-			}
-			connect( &rcm, SIGNAL( triggered( QAction * ) ),
-				this,
-				SLOT( remoteControlClient( QAction * ) ) );
-
-			m.addSeparator();
-
-			QAction * qa = m.addAction(
-					QIcon( ":/resources/quit.png" ),
-					tr( "Quit" ) );
-			connect( qa, SIGNAL( triggered( bool ) ),
-					this, SLOT( close() ) );
-			m.exec( QCursor::pos() );
-			break;
-		}
-		default:
-			break;
-	}
-}
-
-
-
-
-void MainWindow::remoteControlClient( QAction * _a )
-{
-	show();
-	remoteControlDisplay( _a->data().toString(),
-				m_classroomManager->clientDblClickAction() );
-}
-
-
-
-
-void MainWindow::remoteControlDisplay( const QString & _hostname,
-						bool _view_only,
-						bool _stop_demo_afterwards )
-{
-	QWriteLocker wl( &m_rctrlLock );
-	if( m_remoteControlWidget )
-	{
-		return;
-	}
-	m_remoteControlWidget = new RemoteControlWidget( _hostname, _view_only );
-	int x = 0;
-	for( int i = 0; i < m_remoteControlScreen; ++i )
-	{
-		x += QApplication::desktop()->screenGeometry( i ).width();
-	}
-	m_remoteControlWidget->move( x, 0 );
-	m_stopDemo = _stop_demo_afterwards;
-	connect( m_remoteControlWidget, SIGNAL( destroyed( QObject * ) ),
-			this, SLOT( remoteControlWidgetClosed( QObject * ) ) );
-}
-
-
-
-
-void MainWindow::remoteControlWidgetClosed( QObject * )
-{
-	m_rctrlLock.lockForWrite();
-	m_remoteControlWidget = NULL;
-	m_rctrlLock.unlock();
-	if( m_stopDemo )
-	{
-		m_classroomManager->changeGlobalClientMode(
-							Client::Mode_Overview );
-		m_stopDemo = FALSE;
-	}
-}
-
-
-
-
-void MainWindow::aboutITALC( void )
-{
-	AboutDialog( this ).exec();
-}
-
-
-
-
-void MainWindow::changeGlobalClientMode( int _mode )
-{
-	Client::Modes new_mode = static_cast<Client::Modes>( _mode );
-	if( new_mode == m_classroomManager->globalClientMode()/* &&
-					new_mode != Client::Mode_Overview*/ )
-	{
-		m_classroomManager->changeGlobalClientMode(
-							Client::Mode_Overview );
-		m_modeGroup->button( Client::Mode_Overview )->setChecked(
-									TRUE );
-	}
-	else
-	{
-		m_classroomManager->changeGlobalClientMode( _mode );
-	}
-}
-
-
-
-
-
-
-
-MainWindowUpdateThread::MainWindowUpdateThread( MainWindow * _main_window ) :
-	QThread(),
-	m_mainWindow( _main_window )
-{
-	start( QThread::LowestPriority );
-}
-
-
-
-
-void MainWindowUpdateThread::update()
-{
-	// now do cleanup-work
-	m_mainWindow->getClassroomManager()->doCleanupWork();
-}
-
-
-void MainWindowUpdateThread::run( void )
-{
-	QTimer t;
-	connect( &t, SIGNAL( timeout() ), this, SLOT( update() ) );
-	t.start( m_mainWindow->getClassroomManager()->updateInterval() );
-	exec();
-}
-
-
-
-
-
-clientWorkspace::clientWorkspace( QScrollArea * _parent ) :
-	QWidget( _parent ),
-	m_contextMenu( NULL )
-{
-	setStyleSheet( "background-image: url(:/resources/toolbar-background.png);" );
-
-	_parent->setWidget( this );
-	_parent->setWidgetResizable( TRUE );
-	setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding,
-					QSizePolicy::MinimumExpanding ) );
-	show();
-
-}
-
-
-
-QSize clientWorkspace::sizeHint( void ) const
-{
-	return( childrenRect().size() );
-}
-
-
-
-
-void clientWorkspace::contextMenuEvent( QContextMenuEvent * _event )
-{
-	m_contextMenu->exec( _event->globalPos() );
-	_event->accept();
-}
-
-
-
diff --git a/ima/src/MainWindow.h b/ima/src/MainWindow.h
deleted file mode 100644
index 26fdbd7..0000000
--- a/ima/src/MainWindow.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * MainWindow.h - main-window of iTALC
- *
- * Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef MAIN_WINDOW_H
-#define MAIN_WINDOW_H
-
-#include <QtCore/QReadWriteLock>
-#include <QtCore/QThread>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QMainWindow>
-#include <QtGui/QSystemTrayIcon>
-#include <QtGui/QToolButton>
-
-#include "ui_MainWindow.h"
-
-#include "Client.h"
-#include "SnapshotList.h"
-
-
-class QMenu;
-class QScrollArea;
-class QSplashScreen;
-class QSplitter;
-class ClassroomManager;
-class ConfigWidget;
-class OverviewWidget;
-class RemoteControlWidget;
-class UserList;
-class ItalcCoreConnection;
-class ItalcVncConnection;
-
-extern QString __default_domain;
-
-
-class MainWindow;
-
-
-class MainWindowUpdateThread : public QThread
-{
-	Q_OBJECT
-public:
-	MainWindowUpdateThread( MainWindow * _main_window );
-
-private slots:
-	void update( void );
-
-private:
-	virtual void run( void );
-
-	MainWindow * m_mainWindow;
-
-} ;
-
-
-class clientWorkspace : public QWidget
-{
-public:
-	clientWorkspace( QScrollArea * _parent );
-	virtual ~clientWorkspace()
-	{
-	}
-
-	virtual QSize sizeHint( void ) const;
-
-
-private:
-	virtual void contextMenuEvent( QContextMenuEvent * _event );
-
-	QMenu * m_contextMenu;
-
-	friend class MainWindow;
-
-} ;
-
-
-
-class MainWindow : public QMainWindow, public Ui::MainWindow
-{
-	Q_OBJECT
-public:
-	MainWindow( int _screen );
-	virtual ~MainWindow();
-
-	static bool initAuthentication();
-
-	QWidget * workspace()
-	{
-		return m_workspace;
-	}
-
-	ClassroomManager *getClassroomManager()
-	{
-		return m_classroomManager;
-	}
-
-	ItalcCoreConnection *localICA()
-	{
-		return m_localICA;
-	}
-
-	void checkModeButton( int _id )
-	{
-		QToolButton * btn = dynamic_cast<QToolButton *>(
-						m_modeGroup->button( _id ) );
-		if( btn != NULL )
-		{
-			btn->setChecked( TRUE );
-		}
-	}
-
-	inline MainToolBar * toolBar()
-	{
-		return m_toolBar;
-	}
-
-	inline SideBar * sideBar()
-	{
-		return m_sideBar;
-	}
-
-	void remoteControlDisplay( const QString & _hostname,
-					bool _view_only = FALSE,
-					bool _stop_demo_afterwards = FALSE );
-
-	inline bool remoteControlRunning( void )
-	{
-		QReadLocker rl( &m_rctrlLock );
-		return( m_remoteControlWidget != NULL );
-	}
-
-protected:
-	void keyPressEvent( QKeyEvent *e );
-
-
-private slots:
-	void handleSystemTrayEvent( QSystemTrayIcon::ActivationReason _r );
-	void remoteControlClient( QAction * _c );
-	void remoteControlWidgetClosed( QObject * );
-
-	void aboutITALC( void );
-
-	void changeGlobalClientMode( int );
-
-	void mapOverview( void )
-	{
-		changeGlobalClientMode( Client::Mode_Overview );
-	}
-	void mapFullscreenDemo( void )
-	{
-		changeGlobalClientMode( Client::Mode_FullscreenDemo );
-	}
-	void mapWindowDemo( void )
-	{
-		changeGlobalClientMode( Client::Mode_WindowDemo );
-	}
-	void mapScreenLock( void )
-	{
-		changeGlobalClientMode( Client::Mode_Locked );
-	}
-
-
-private:
-	virtual void closeEvent( QCloseEvent * _ce );
-
-	MainWindowUpdateThread * m_updateThread;
-
-	clientWorkspace * m_workspace;
-
-	QButtonGroup * m_modeGroup;
-
-	QSystemTrayIcon m_systemTrayIcon;
-	QList<QAction *> m_sysTrayActions;
-
-	QWidget * m_sideBarWidget;
-	int m_openedTabInSideBar;
-
-	ItalcCoreConnection * m_localICA;
-
-	QReadWriteLock m_rctrlLock;
-	RemoteControlWidget * m_remoteControlWidget;
-	bool m_stopDemo;
-	int m_remoteControlScreen;
-
-	OverviewWidget * m_overviewWidget;
-	ClassroomManager * m_classroomManager;
-	UserList * m_userList;
-	SnapshotList * m_snapshotList;
-	ConfigWidget * m_configWidget;
-
-	friend class MainWindowUpdateThread;
-	friend class ClassroomManager;
-
-} ;
-
-
-extern QSplashScreen * splashScreen;
-
-
-#endif
diff --git a/ima/src/OverviewWidget.cpp b/ima/src/OverviewWidget.cpp
deleted file mode 100644
index 6c68514..0000000
--- a/ima/src/OverviewWidget.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * OverviewWidget.cpp - implementation of overview-widget for side-bar
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
-#include <QtGui/QPushButton>
-
-#include "OverviewWidget.h"
-#include "MainWindow.h"
-
-
-
-OverviewWidget::OverviewWidget( MainWindow * _main_window, QWidget * _parent ) :
-	SideBarWidget( QPixmap( ":/resources/overview.png" ),
-			tr( "Overview" ),
-			tr( "Some basic information on iTALC and how to use "
-				"it." ), _main_window, _parent )
-{
-	setupUi( contentParent() );
-
-	connect( aboutButton, SIGNAL( clicked() ), mainWindow(),
-							SLOT( aboutITALC() ) );
-}
-
-
-
diff --git a/ima/src/OverviewWidget.h b/ima/src/OverviewWidget.h
deleted file mode 100644
index fb1084e..0000000
--- a/ima/src/OverviewWidget.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * OverviewWidget.h - declaration of overview-widget for side-bar
- *
- * Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef OVERVIEW_WIDGET_H
-#define OVERVIEW_WIDGET_H
-
-#include "SideBarWidget.h"
-#include "ui_Overview.h"
-
-
-class OverviewWidget : public SideBarWidget, private Ui::Overview
-{
-	Q_OBJECT
-public:
-	OverviewWidget( MainWindow * _main_window, QWidget * _parent );
-
-} ;
-
-
-#endif
diff --git a/ima/src/RemoteControlWidget.cpp b/ima/src/RemoteControlWidget.cpp
deleted file mode 100644
index 2ca5072..0000000
--- a/ima/src/RemoteControlWidget.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- *  RemoteControlWidget.cpp - widget containing a VNC-view and controls for it
- *
- *  Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include "RemoteControlWidget.h"
-#include "VncView.h"
-#include "ItalcCoreConnection.h"
-#include "LocalSystem.h"
-#include "ToolButton.h"
-#include "Snapshot.h"
-
-#include <math.h>
-
-#include <QtCore/QTimer>
-#include <QtGui/QBitmap>
-#include <QtGui/QLayout>
-#include <QtGui/QPainter>
-#include <QtGui/QPaintEvent>
-
-
-
-// toolbar for remote-control-widget
-RemoteControlWidgetToolBar::RemoteControlWidgetToolBar(
-			RemoteControlWidget * _parent, bool viewOnly ) :
-	QWidget( _parent ),
-	m_parent( _parent ),
-	m_showHideTimeLine(),
-	m_iconStateTimeLine(),
-	m_connecting( false ),
-	m_icon( FastQImage( QImage( ":/resources/icon64.png" ) ).
-					scaled( QSize( 48, 48 ) ) ),
-	m_iconGray( FastQImage( m_icon ).toGray().darken( 50 ) )
-{
-	QPalette pal = palette();
-	pal.setBrush( QPalette::Window, QPixmap( ":/resources/toolbar-background.png" ) );
-	setPalette( pal );
-
-	setAttribute( Qt::WA_NoSystemBackground, true );
-	move( 0, 0 );
-	show();
-	startConnection();
-
-	ToolButton * vo_btn = new ToolButton(
-				QPixmap( ":/resources/overview_mode.png" ),
-				tr( "View only" ), tr( "Remote control" ),
-				QString::null, QString::null, 0, 0,
-				this );
-	ToolButton * ls_btn = new ToolButton(
-				QPixmap( ":/resources/no_mouse.png" ),
-				tr( "Lock student" ), tr( "Unlock student" ),
-				QString::null, QString::null, 0, 0,
-				this );
-	ToolButton * ss_btn = new ToolButton(
-				QPixmap( ":/resources/snapshot.png" ),
-				tr( "Snapshot" ), QString::null,
-				QString::null, QString::null, 0, 0,
-				this );
-	ToolButton * fs_btn = new ToolButton(
-				QPixmap( ":/resources/fullscreen.png" ),
-				tr( "Fullscreen" ), tr( "Window" ),
-				QString::null, QString::null, 0, 0,
-				this );
-	ToolButton * quit_btn = new ToolButton(
-				QPixmap( ":/resources/quit.png" ),
-				tr( "Quit" ), QString::null,
-				QString::null, QString::null, 0, 0,
-				this );
-	vo_btn->setCheckable( true );
-	ls_btn->setCheckable( true );
-	fs_btn->setCheckable( true );
-	vo_btn->setChecked( viewOnly );
-	fs_btn->setChecked( false );
-
-	connect( vo_btn, SIGNAL( toggled( bool ) ),
-				_parent, SLOT( toggleViewOnly( bool ) ) );
-	connect( ls_btn, SIGNAL( toggled( bool ) ),
-				_parent, SLOT( lockStudent( bool ) ) );
-	connect( fs_btn, SIGNAL( toggled( bool ) ),
-				_parent, SLOT( toggleFullScreen( bool ) ) );
-	connect( ss_btn, SIGNAL( clicked() ), _parent, SLOT( takeSnapshot() ) );
-	connect( quit_btn, SIGNAL( clicked() ), _parent, SLOT( close() ) );
-
-	QHBoxLayout * layout = new QHBoxLayout( this );
-	layout->setMargin( 1 );
-	layout->setSpacing( 1 );
-	layout->addStretch( 0 );
-	layout->addWidget( vo_btn );
-	layout->addWidget( ls_btn );
-	layout->addWidget( ss_btn );
-	layout->addWidget( fs_btn );
-	layout->addWidget( quit_btn );
-	layout->addSpacing( 5 );
-	connect( m_parent->m_vncView, SIGNAL( startConnection() ),
-					this, SLOT( startConnection() ) );
-	connect( m_parent->m_vncView, SIGNAL( connectionEstablished() ),
-					this, SLOT( connectionEstablished() ) );
-
-	setFixedHeight( 52 );
-
-	m_showHideTimeLine.setFrameRange( 0, height() );
-	m_showHideTimeLine.setDuration( 800 );
-	m_showHideTimeLine.setCurveShape( QTimeLine::EaseInCurve );
-	connect( &m_showHideTimeLine, SIGNAL( valueChanged( qreal ) ),
-				this, SLOT( updatePosition() ) );
-
-	m_iconStateTimeLine.setFrameRange( 0, 100 );
-	m_iconStateTimeLine.setDuration( 1500 );
-	m_iconStateTimeLine.setUpdateInterval( 60 );
-	m_iconStateTimeLine.setCurveShape( QTimeLine::SineCurve );
-	connect( &m_iconStateTimeLine, SIGNAL( valueChanged( qreal ) ),
-				this, SLOT( updateConnectionAnimation() ) );
-	connect( &m_iconStateTimeLine, SIGNAL( finished() ),
-				&m_iconStateTimeLine, SLOT( start() ) );
-}
-
-
-
-
-RemoteControlWidgetToolBar::~RemoteControlWidgetToolBar()
-{
-}
-
-
-
-
-void RemoteControlWidgetToolBar::appear()
-{
-	m_showHideTimeLine.setDirection( QTimeLine::Backward );
-	if( m_showHideTimeLine.state() != QTimeLine::Running )
-	{
-		m_showHideTimeLine.resume();
-	}
-}
-
-
-
-
-void RemoteControlWidgetToolBar::disappear()
-{
-	if( !m_connecting && !rect().contains( mapFromGlobal( QCursor::pos() ) ) )
-	{
-		if( m_showHideTimeLine.state() != QTimeLine::Running )
-		{
-			m_showHideTimeLine.setDirection( QTimeLine::Forward );
-			m_showHideTimeLine.resume();
-		}
-	}
-}
-
-
-
-
-void RemoteControlWidgetToolBar::leaveEvent( QEvent *event )
-{
-	QTimer::singleShot( 500, this, SLOT( disappear() ) );
-	QWidget::leaveEvent( event );
-}
-
-
-
-
-void RemoteControlWidgetToolBar::paintEvent( QPaintEvent *paintEv )
-{
-	QPainter p( this );
-	QFont f = p.font();
-
-	p.setOpacity( 0.8-0.8*m_showHideTimeLine.currentValue() );
-	p.fillRect( paintEv->rect(), palette().brush( QPalette::Window ) );
-	p.setOpacity( 1 );
-
-	p.drawImage( 5, 2, m_icon );
-
-	f.setPointSize( 12 );
-	f.setBold( true );
-	p.setFont( f );
-
-	p.setPen( Qt::white );
-	m_parent->updateWindowTitle();
-	p.drawText( 64, 22, m_parent->windowTitle() );
-
-	p.setPen( QColor( 192, 192, 192 ) );
-	f.setPointSize( 10 );
-	p.setFont( f );
-
-	if( m_connecting )
-	{
-		FastQImage tmp = m_iconGray;
-		tmp.alphaFillMax( (int)( 120 - 120.0 *
-				m_iconStateTimeLine.currentValue() ) );
-		p.drawImage( 5, 2, tmp );
-
-		QString dots;
-		for( int i = 0; i < ( m_iconStateTimeLine.currentTime() / 120 ) % 6; ++i )
-		{
-			dots += ".";
-		}
-		p.drawText( 64, 40, tr( "Connecting %1" ).arg( dots ) );
-	}
-	else
-	{
-		p.drawText( 64, 40, tr( "Connected." ) );
-	}
-}
-
-
-
-
-void RemoteControlWidgetToolBar::updateConnectionAnimation()
-{
-	update( 0, 0, 200, 63 );
-}
-
-
-
-
-void RemoteControlWidgetToolBar::updatePosition()
-{
-	const int newY = m_showHideTimeLine.currentFrame();
-	if( newY != -y() )
-	{
-		move( x(), qMax( -height(), -newY ) );
-	}
-}
-
-
-
-
-void RemoteControlWidgetToolBar::startConnection()
-{
-	m_connecting = true;
-	m_iconStateTimeLine.start();
-	appear();
-	update();
-}
-
-
-
-
-void RemoteControlWidgetToolBar::connectionEstablished()
-{
-	m_parent->m_coreConnection->sendGetUserInformationRequest();
-
-	m_connecting = false;
-	m_iconStateTimeLine.stop();
-	QTimer::singleShot( 3000, this, SLOT( disappear() ) );
-	// within the next 1000ms the username should be known and therefore
-	// we update
-	QTimer::singleShot( 1000, this, SLOT( update() ) );
-}
-
-
-
-
-
-
-
-
-
-
-RemoteControlWidget::RemoteControlWidget( const QString &host,
-											bool viewOnly ) :
-	QWidget( 0 ),
-	m_vncView( new VncView( host, this, VncView::RemoteControlMode ) ),
-	m_coreConnection( new ItalcCoreConnection( m_vncView->vncConnection() ) ),
-	m_toolBar( new RemoteControlWidgetToolBar( this, viewOnly ) ),
-	m_host( host )
-{
-	setWindowIcon( QPixmap( ":/resources/remote_control.png" ) );
-	setAttribute( Qt::WA_DeleteOnClose, true );
-
-	m_vncView->move( 0, 0 );
-	connect( m_vncView, SIGNAL( mouseAtTop() ), m_toolBar,
-							SLOT( appear() ) );
-	connect( m_vncView, SIGNAL( keyEvent( int, bool ) ),
-				this, SLOT( checkKeyEvent( int, bool ) ) );
-	connect( m_vncView, SIGNAL( connectionEstablished() ),
-					this, SLOT( lateInit() ) );
-
-	show();
-	LocalSystem::activateWindow( this );
-
-	toggleViewOnly( viewOnly );
-}
-
-
-
-
-RemoteControlWidget::~RemoteControlWidget()
-{
-	delete m_coreConnection;
-	delete m_vncView;
-}
-
-
-
-
-void RemoteControlWidget::updateWindowTitle()
-{
-	const QString s = m_vncView->isViewOnly() ?
-			tr( "View live (%1 @ %2)" )
-		:
-			tr( "Remote control (%1 @ %2)" );
-	QString u = m_coreConnection->user();
-	if( u.isEmpty() )
-	{
-		u = tr( "unknown user" );
-	}
-	else
-	{
-		if( u.contains( '(' ) && u.contains( ')' ) )
-		{
-			u = u.section( '(', 1 ).section( ')', 0, 0 );
-		}
-	}
-	setWindowTitle( s.arg( u ).arg( host() ) );
-}
-
-
-
-
-void RemoteControlWidget::enterEvent( QEvent * )
-{
-	QTimer::singleShot( 500, m_toolBar, SLOT( disappear() ) );
-}
-
-
-
-
-void RemoteControlWidget::leaveEvent( QEvent * )
-{
-	m_toolBar->appear();
-}
-
-
-
-
-void RemoteControlWidget::resizeEvent( QResizeEvent * )
-{
-	m_vncView->resize( size() );
-	m_toolBar->setFixedSize( width(), m_toolBar->height() );
-}
-
-
-
-
-void RemoteControlWidget::checkKeyEvent( int key, bool pressed )
-{
-	if( pressed && key == XK_Escape && !m_coreConnection->isConnected() )
-	{
-		close();
-	}
-}
-
-
-
-
-void RemoteControlWidget::lateInit()
-{
-	if( !( windowState() & Qt::WindowFullScreen ) )
-	{
-		resize( m_vncView->sizeHint() );
-	}
-}
-
-
-
-
-void RemoteControlWidget::lockStudent( bool _on )
-{
-	//m_vncView->m_connection->disableLocalInputs( _on );
-}
-
-
-
-
-void RemoteControlWidget::toggleFullScreen( bool _on )
-{
-	if( _on )
-	{
-		setWindowState( windowState() | Qt::WindowFullScreen );
-	}
-	else
-	{
-		setWindowState( windowState() & ~Qt::WindowFullScreen );
-	}
-}
-
-
-
-
-void RemoteControlWidget::toggleViewOnly( bool _on )
-{
-	m_vncView->setViewOnly( _on );
-	m_toolBar->update();
-}
-
-
-
-
-void RemoteControlWidget::takeSnapshot()
-{
-	Snapshot().take( m_vncView->vncConnection(), m_coreConnection->user() );
-}
-
-
diff --git a/ima/src/RemoteControlWidget.h b/ima/src/RemoteControlWidget.h
deleted file mode 100644
index 781c729..0000000
--- a/ima/src/RemoteControlWidget.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *  RemoteControlWidget.h - widget containing a VNC-view and controls for it
- *
- *  Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifndef REMOTE_CONTROL_WIDGET_H
-#define REMOTE_CONTROL_WIDGET_H
-
-#include <QtCore/QTimeLine>
-#include <QtGui/QWidget>
-
-#include "FastQImage.h"
-
-class VncView;
-class ItalcCoreConnection;
-class RemoteControlWidget;
-
-
-class RemoteControlWidgetToolBar : public QWidget
-{
-	Q_OBJECT
-public:
-	RemoteControlWidgetToolBar( RemoteControlWidget * _parent,
-							bool _view_only );
-	virtual ~RemoteControlWidgetToolBar();
-
-
-public slots:
-	void appear();
-	void disappear();
-
-
-protected:
-	virtual void leaveEvent( QEvent * _e );
-	virtual void paintEvent( QPaintEvent * _pe );
-
-
-private slots:
-	void updateConnectionAnimation();
-	void updatePosition();
-	void startConnection();
-	void connectionEstablished();
-
-
-private:
-	RemoteControlWidget * m_parent;
-	QTimeLine m_showHideTimeLine;
-	QTimeLine m_iconStateTimeLine;
-
-	bool m_connecting;
-	QImage m_icon;
-	FastQImage m_iconGray;
-
-} ;
-
-
-
-
-
-class RemoteControlWidget : public QWidget
-{
-	Q_OBJECT
-public:
-	RemoteControlWidget( const QString & _host, bool _view_only = false );
-	virtual ~RemoteControlWidget();
-
-	const QString &host() const
-	{
-		return m_host;
-	}
-
-
-public slots:
-	void lockStudent( bool );
-	void toggleFullScreen( bool );
-	void toggleViewOnly( bool );
-	void takeSnapshot();
-
-
-protected:
-	void updateWindowTitle();
-	virtual void enterEvent( QEvent * );
-	virtual void leaveEvent( QEvent * );
-	virtual void resizeEvent( QResizeEvent * );
-
-
-private slots:
-	void checkKeyEvent( int, bool );
-	void lateInit();
-
-
-private:
-	VncView * m_vncView;
-	ItalcCoreConnection *m_coreConnection;
-	RemoteControlWidgetToolBar * m_toolBar;
-
-	QString m_host;
-
-	friend class RemoteControlWidgetToolBar;
-
-} ;
-
-
-#endif
-
diff --git a/ima/src/RunCommandsDialog.cpp b/ima/src/RunCommandsDialog.cpp
deleted file mode 100644
index a2c0901..0000000
--- a/ima/src/RunCommandsDialog.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * RunCommandsDialog.cpp - implementation of command-input-dialog
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "RunCommandsDialog.h"
-
-#include "ui_RunCommandsDialog.h"
-
-RunCommandsDialog::RunCommandsDialog( QString &cmdStr, QWidget * _parent ) :
-	QDialog( _parent ),
-	ui( new Ui::RunCommandsDialog ),
-	m_cmdsStr( cmdStr )
-{
-	ui->setupUi( this );
-}
-
-
-
-
-RunCommandsDialog::~RunCommandsDialog()
-{
-}
-
-
-
-
-void RunCommandsDialog::accept()
-{
-	m_cmdsStr = ui->cmdInputTextEdit->toPlainText();
-	QDialog::accept();
-}
-
-
diff --git a/ima/src/RunCommandsDialog.h b/ima/src/RunCommandsDialog.h
deleted file mode 100644
index d77138d..0000000
--- a/ima/src/RunCommandsDialog.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * RunCommandsDialog.h - declaration of class RunCommandsDialog
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef RUN_COMMANDS_DIALOG_H
-#define RUN_COMMANDS_DIALOG_H
-
-#include <QtGui/QDialog>
-
-namespace Ui { class RunCommandsDialog; }
-
-class RunCommandsDialog : public QDialog
-{
-	Q_OBJECT
-public:
-	RunCommandsDialog( QString &cmdStr, QWidget *parent );
-	virtual ~RunCommandsDialog();
-
-
-private slots:
-	virtual void accept();
-
-
-private:
-	Ui::RunCommandsDialog *ui;
-	QString & m_cmdsStr;
-
-} ;
-
-#endif
diff --git a/ima/src/SideBar.cpp b/ima/src/SideBar.cpp
deleted file mode 100644
index 357f0be..0000000
--- a/ima/src/SideBar.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * SideBar.cpp - side bar in MainWindow
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
- *
- * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- */
-
-#include <QtGui/QContextMenuEvent>
-#include <QtGui/QMenu>
-#include <QtGui/QPainter>
-#include <QtGui/QPaintEvent>
-#include <QtGui/QToolButton>
-
-#include "SideBar.h"
-#include "SideBarWidget.h"
-
-
-// internal helper class allowing to create QToolButtons with
-// vertical orientation
-class SideBarButton : public QToolButton
-{
-public:
-	SideBarButton( Qt::Orientation _orientation, QWidget * _parent ) :
-		QToolButton( _parent ),
-		m_orientation( _orientation )
-	{
-	}
-	virtual ~SideBarButton()
-	{
-	}
-
-	Qt::Orientation orientation() const
-	{
-		return m_orientation;
-	}
-
-	virtual QSize sizeHint() const
-	{
-		QSize s = QToolButton::sizeHint();
-		s.setWidth( s.width() + 12 );
-		s.setHeight( 24 );
-		if( orientation() == Qt::Horizontal )
-		{
-			return s;
-		}
-		return QSize( s.height(), s.width() );
-	}
-
-
-protected:
-	virtual void paintEvent( QPaintEvent * )
-	{
-		QPainter painter( this );
-		QRect r = rect();
-		if( orientation() == Qt::Vertical )
-		{
-			const QSize s = sizeHint();
-			painter.rotate( 270 );
-			painter.translate( -s.height(), 0 );
-			r = QRect( 0, 0, s.height(), s.width() );
-		}
-
-        painter.setRenderHint(QPainter::SmoothPixmapTransform);
-        painter.setRenderHint(QPainter::Antialiasing);
-        painter.setPen(Qt::NoPen);
-
-		QLinearGradient outlinebrush(0, 0, 0, height());
-		QLinearGradient brush(0, 0, 0, height());
-
-		brush.setSpread(QLinearGradient::PadSpread);
-		QColor highlight(255, 255, 255, 70);
-		QColor shadow(0, 0, 0, 70);
-		QColor sunken(220, 220, 220, 30);
-		QColor normal1(255, 255, 245, 60);
-		QColor normal2(255, 255, 235, 10);
-
-		if( isDown() || isChecked() )
-		{
-			outlinebrush.setColorAt(0.0f, shadow);
-			outlinebrush.setColorAt(1.0f, highlight);
-			brush.setColorAt(0.0f, sunken);
-			painter.setPen(Qt::NoPen);
-		}
-		else
-		{
-			outlinebrush.setColorAt(1.0f, shadow);
-			outlinebrush.setColorAt(0.0f, highlight);
-			brush.setColorAt(0.0f, normal1);
-			if( !underMouse() )
-			{
-				brush.setColorAt(1.0f, normal2);
-			}
-			painter.setPen(QPen(outlinebrush, 1));
-		}
-		painter.setBrush(brush);
-
-		painter.drawRoundedRect(0, 0, r.width(), r.height(), 5, 5);
-
-		painter.drawPixmap( 10, 5, icon().pixmap( iconSize() ) );
-
-		if( isChecked() )
-		{
-			const QString l = text();
-			painter.setPen( Qt::black );
-			painter.drawText( 18 + iconSize().width() + 1, 19, l );
-			painter.setPen( Qt::white );
-			painter.drawText( 18 + iconSize().width(), 18, l );
-		}
-	}
-
-
-private:
-	Qt::Orientation m_orientation;
-
-} ;
-
-
-
-
-SideBar::SideBar( QWidget * _parent ) :
-	QToolBar( _parent ),
-	m_btnGroup( this )
-{
-	m_btnGroup.setExclusive( false );
-	connect( &m_btnGroup, SIGNAL( buttonClicked( QAbstractButton * ) ),
-				this, SLOT( toggleButton( QAbstractButton * ) ) );
-
-	QPalette pal = palette();
-	pal.setBrush( QPalette::Window, QPixmap( ":/resources/toolbar-background.png" ) );
-	setPalette( pal );
-}
-
-
-
-
-SideBar::~SideBar()
-{
-}
-
-
-
-
-void SideBar::appendTab( SideBarWidget * _sbw )
-{
-	SideBarButton * btn = new SideBarButton( orientation(), this );
-	btn->setText( _sbw->title() );
-	btn->setIcon( _sbw->icon() );
-	btn->setCheckable( true );
-	m_widgets[btn] = _sbw;
-	m_btnGroup.addButton( btn );
-	addWidget( btn );
-
-	_sbw->hide();
-	_sbw->setMinimumWidth( 200 );
-}
-
-
-
-
-int SideBar::activeTab() const
-{
-	int i = 0;
-	for( ButtonMap::ConstIterator it = m_widgets.begin();
-							it != m_widgets.end(); ++it, ++i )
-	{
-		if( it.key()->isChecked() )
-		{
-			return i;
-		}
-	}
-	return 0;
-}
-
-
-
-
-void SideBar::toggleButton( QAction * _a )
-{
-	foreach( QAbstractButton * btn, tabs() )
-	{
-		if( btn->text() == _a->text() )
-		{
-			if( btn->isVisible() )
-			{
-				btn->setVisible( false );
-			}
-			else
-			{
-				btn->setVisible( false );
-			}
-			break;
-		}
-	}
-}
-
-
-
-
-void SideBar::toggleButton( QAbstractButton * _btn )
-{
-	QToolButton * toolButton = NULL;
-	QWidget * activeWidget = NULL;
-	for( ButtonMap::Iterator it = m_widgets.begin();
-							it != m_widgets.end(); ++it )
-	{
-		QToolButton * curBtn = it.key();
-		if( curBtn != _btn )
-		{
-			curBtn->setChecked( false );
-			curBtn->setToolButtonStyle( Qt::ToolButtonIconOnly );
-		}
-		else
-		{
-			toolButton = it.key();
-			activeWidget = it.value();
-		}
-		if( it.value() )
-		{
-			it.value()->hide();
-		}
-	}
-
-	if( toolButton && activeWidget )
-	{
-		activeWidget->setVisible( _btn->isChecked() );
-		toolButton->setToolButtonStyle( _btn->isChecked() ?
-				Qt::ToolButtonTextBesideIcon : Qt::ToolButtonIconOnly );
-	}
-}
-
-
-
-
-void SideBar::contextMenuEvent( QContextMenuEvent * _e )
-{
-	QMenu m( this );
-	foreach( QAbstractButton * btn, tabs() )
-	{
-		QAction * ma = m.addAction( btn->text() );
-		ma->setCheckable( true );
-		ma->setChecked( btn->isVisible() );
-	}
-	connect( &m, SIGNAL( triggered( QAction * ) ),
-				this, SLOT( toggleButton( QAction * ) ) );
-	m.exec( _e->globalPos() );
-}
-
-
-
-
-void SideBar::paintEvent( QPaintEvent * _pe )
-{
-	QPainter p( this );
-	p.fillRect( _pe->rect(), palette().brush( QPalette::Window ) );
-
-	p.setPen( QColor( 48, 48, 48 ) );
-	if( orientation() == Qt::Vertical )
-	{
-		p.drawLine( 0, 0, 0, height() );
-		p.drawLine( width()-1, 0, width()-1, height() );
-	}
-	else
-	{
-		p.drawLine( 0, 0, width(), 0 );
-		p.drawLine( 0, height()-1, width(), height()-1 );
-	}
-}
-
-
diff --git a/ima/src/SideBar.h b/ima/src/SideBar.h
deleted file mode 100644
index 5bdc19f..0000000
--- a/ima/src/SideBar.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SideBar.h - side bar in MainWindow
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
- *
- * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- */
-
-#ifndef SIDE_BAR_H
-#define SIDE_BAR_H
-
-#include <QtCore/QMap>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QToolBar>
-
-class QToolButton;
-class SideBarWidget;
-
-
-class SideBar : public QToolBar
-{
-	Q_OBJECT
-public:
-	SideBar( QWidget * _parent );
-	virtual ~SideBar();
-
-	void appendTab( SideBarWidget * _sbw );
-	int activeTab() const;
-
-	QList<QAbstractButton *> tabs() const
-	{
-		return m_btnGroup.buttons();
-	}
-
-
-private slots:
-	void toggleButton( QAction * _a );
-	void toggleButton( QAbstractButton * _btn );
-
-
-private:
-	virtual void contextMenuEvent( QContextMenuEvent * _e );
-	virtual void paintEvent( QPaintEvent * _pe );
-
-	QButtonGroup m_btnGroup;
-	typedef QMap<QToolButton *, QWidget *> ButtonMap;
-	ButtonMap m_widgets;
-
-} ;
-
-#endif
diff --git a/ima/src/SideBarWidget.cpp b/ima/src/SideBarWidget.cpp
deleted file mode 100644
index d1b26d3..0000000
--- a/ima/src/SideBarWidget.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * SideBarWidget.cpp - implementation of SideBarWidget
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QPainter>
-#include <QtGui/QFontMetrics>
-#include <QtGui/QPixmap>
-#include <QtGui/QResizeEvent>
-#include <QtGui/QPaintEvent>
-#include <QtGui/QLayout>
-
-
-#include "SideBarWidget.h"
-#include "FastQImage.h"
-
-
-
-SideBarWidget::SideBarWidget( const QPixmap & _icon,
-				const QString & _title,
-				const QString & _description,
-				MainWindow * _main_window, QWidget * _parent ) :
-	QWidget( _parent ),
-	m_mainWindow( _main_window ),
-	m_icon( _icon ),
-	m_title( _title ),
-	m_description( _description )
-{
-	QPixmap bg( ":/resources/toolbar-background.png" );
-	QPainter painter( &bg );
-	painter.fillRect( bg.rect(), QColor( 255, 255, 255, 160 ) );
-
-	QPalette pal = palette();
-	pal.setBrush( backgroundRole(), bg );
-	setPalette( pal );
-
-	QVBoxLayout * layout = new QVBoxLayout( this );
-	layout->setSpacing( 10 );
-	layout->setMargin( 5 );
-	layout->addSpacing( 60 );
-
-	m_contents = new QWidget;
-	layout->addWidget( m_contents );
-
-	setMinimumWidth( 200 );
-	setMaximumWidth( 330 );
-}
-
-
-
-
-SideBarWidget::~SideBarWidget()
-{
-}
-
-
-
-
-void SideBarWidget::paintEvent( QPaintEvent * )
-{
-	const int TITLE_FONT_HEIGHT = 16;
-
-	QPainter p( this );
-	p.fillRect( rect(), palette().brush( backgroundRole() ) );
-
-	QFont f;
-	f.setBold( true );
-	f.setPixelSize( TITLE_FONT_HEIGHT );
-
-	p.setFont( f );
-	p.setPen( Qt::black );
-	const int tx = /*m_icon.width()*/48 + 8;
-	const int ty = 2 + TITLE_FONT_HEIGHT;
-	p.drawText( tx, ty, m_title );
-	p.drawLine( tx, ty + 4, width() - 4, ty + 4 );
-
-	p.drawImage( 2, 2, FastQImage( m_icon ).scaled( 48, 48 ) );
-}
-
-
diff --git a/ima/src/SideBarWidget.h b/ima/src/SideBarWidget.h
deleted file mode 100644
index 2cb0b17..0000000
--- a/ima/src/SideBarWidget.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * SideBarWidget.h - base-class for all side-bar-widgets
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SIDE_BAR_WIDGET_H
-#define SIDE_BAR_WIDGET_H
-
-#include <QtGui/QWidget>
-#include <QtGui/QPixmap>
-
-
-class MainWindow;
-
-
-class SideBarWidget : public QWidget
-{
-public:
-	SideBarWidget( const QPixmap & _icon, const QString & _title,
-			const QString & _description,
-				MainWindow * _main_window, QWidget * _parent );
-	virtual ~SideBarWidget();
-
-	inline const QPixmap & icon( void ) const
-	{
-		return m_icon;
-	}
-
-	inline const QString & title( void ) const
-	{
-		return m_title;
-	}
-
-	inline const QString & description( void ) const
-	{
-		return m_description;
-	}
-
-
-protected:
-	virtual void paintEvent( QPaintEvent * _pe );
-
-	inline QWidget * contentParent()
-	{
-		return m_contents;
-	}
-
-	inline MainWindow * mainWindow()
-	{
-		return m_mainWindow;
-	}
-
-
-private:
-	MainWindow * m_mainWindow;
-	QWidget * m_contents;
-	QPixmap m_icon;
-	QString m_title;
-	QString m_description;
-
-} ;
-
-
-#endif
diff --git a/ima/src/SnapshotList.cpp b/ima/src/SnapshotList.cpp
deleted file mode 100644
index ea61401..0000000
--- a/ima/src/SnapshotList.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * snapshot_list.cpp - implementation of snapshot-list for side-bar
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QDir>
-#include <QtCore/QDate>
-#include <QtGui/QFileSystemModel>
-#include <QtGui/QScrollArea>
-
-#include "SnapshotList.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "LocalSystem.h"
-#include "Snapshot.h"
-
-#include "ui_Snapshots.h"
-
-
-SnapshotList::SnapshotList( MainWindow *mainWindow, QWidget *parent ) :
-	SideBarWidget( QPixmap( ":/resources/snapshot.png" ),
-			tr( "Snapshots" ),
-			tr( "Simply manage the snapshots you made using this workspace." ),
-			mainWindow, parent ),
-	ui( new Ui::Snapshots ),
-	m_fsModel( new QFileSystemModel( this ) )
-{
-	ui->setupUi( contentParent() );
-
-	LocalSystem::Path::ensurePathExists( ItalcCore::config->snapshotDirectory() );
-
-	m_fsModel->setNameFilters( QStringList() << "*.png" );
-	m_fsModel->setFilter( QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Files );
-	m_fsModel->setRootPath( LocalSystem::Path::expand(
-									ItalcCore::config->snapshotDirectory() ) );
-
-	ui->list->setModel( m_fsModel );
-	ui->list->setRootIndex( m_fsModel->index( m_fsModel->rootPath() ) );
-
-	connect( ui->list, SIGNAL( clicked( const QModelIndex & ) ),
-				this, SLOT( snapshotSelected( const QModelIndex & ) ) );
-	connect( ui->list, SIGNAL( doubleClicked( const QModelIndex & ) ),
-				this, SLOT( showSnapshot() ) );
-
-	connect( ui->showBtn, SIGNAL( clicked() ), this, SLOT( showSnapshot() ) );
-	connect( ui->deleteBtn, SIGNAL( clicked() ), this, SLOT( deleteSnapshot() ) );
-}
-
-
-
-
-SnapshotList::~SnapshotList()
-{
-}
-
-
-
-
-void SnapshotList::snapshotSelected( const QModelIndex &idx )
-{
-	Snapshot s( m_fsModel->filePath( idx ) );
-
-	ui->previewLbl->setPixmap( s.pixmap() );
-	ui->previewLbl->setFixedHeight( ui->previewLbl->width() * 3 / 4 );
-
-	ui->userLbl->setText( s.user() );
-	ui->hostLbl->setText( s.host() );
-	ui->dateLbl->setText( s.date() );
-	ui->timeLbl->setText( s.time() );
-}
-
-
-
-
-void SnapshotList::snapshotDoubleClicked( const QModelIndex &idx )
-{
-	QLabel * imgLabel = new QLabel;
-	imgLabel->setPixmap( m_fsModel->filePath( idx ) );
-	if( imgLabel->pixmap() != NULL )
-	{
-		imgLabel->setFixedSize( imgLabel->pixmap()->width(),
-								imgLabel->pixmap()->height() );
-	}
-
-	QScrollArea * sa = new QScrollArea;
-	sa->setAttribute( Qt::WA_DeleteOnClose, true );
-	sa->move( 0, 0 );
-	sa->setWidget( imgLabel );
-	sa->setWindowTitle( m_fsModel->fileName( idx ) );
-	sa->show();
-}
-
-
-
-
-void SnapshotList::showSnapshot()
-{
-	if( ui->list->currentIndex().isValid() )
-	{
-		snapshotDoubleClicked( ui->list->currentIndex() );
-	}
-}
-
-
-
-
-void SnapshotList::deleteSnapshot()
-{
-	if( ui->list->currentIndex().isValid() )
-	{
-		m_fsModel->remove( ui->list->currentIndex() );
-	}
-}
-
-
-
diff --git a/ima/src/SnapshotList.h b/ima/src/SnapshotList.h
deleted file mode 100644
index 778ef0e..0000000
--- a/ima/src/SnapshotList.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SnapshotList.h - declaration of snapshot-list for side-bar
- *
- * Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef SNAPSHOT_LIST_H
-#define SNAPSHOT_LIST_H
-
-#include <QtGui/QWidget>
-
-#include "SideBarWidget.h"
-
-class QModelIndex;
-class QFileSystemModel;
-
-namespace Ui { class Snapshots; }
-
-class SnapshotList : public SideBarWidget
-{
-	Q_OBJECT
-public:
-	SnapshotList( MainWindow *mainWindow, QWidget *parent );
-	virtual ~SnapshotList();
-
-
-private slots:
-	void snapshotSelected( const QModelIndex &idx );
-	void snapshotDoubleClicked( const QModelIndex &idx );
-
-	void showSnapshot();
-	void deleteSnapshot();
-
-
-private:
-	Ui::Snapshots *ui;
-	QFileSystemModel *m_fsModel;
-
-} ;
-
-
-#endif
diff --git a/ima/src/ToolButton.cpp b/ima/src/ToolButton.cpp
deleted file mode 100644
index e50a9f5..0000000
--- a/ima/src/ToolButton.cpp
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * ToolButton.cpp - implementation of iTALC-tool-button
- *
- * Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
- 
-
-#include <QtCore/QTimer>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
-#include <QtGui/QBitmap>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
-#include <QtGui/QLinearGradient>
-#include <QtGui/QPainter>
-#include <QtGui/QToolBar>
-
-#include "ToolButton.h"
-
-
-const int MARGIN = 10;
-const int ROUNDED = 2000;
-
-#ifndef ITALC3
-bool ToolButton::s_toolTipsDisabled = FALSE;
-bool ToolButton::s_iconOnlyMode = FALSE;
-#endif
-
-
-ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _label,
-				const QString & _alt_label,
-				const QString & _title, 
-				const QString & _desc, QObject * _receiver, 
-				const char * _slot, QWidget * _parent ) :
-	QToolButton( _parent ),
-	m_pixmap( _pixmap ),
-	m_img( FastQImage( _pixmap.toImage() ).scaled( 32, 32 ) ),
-	m_mouseOver( false ),
-	m_label( _label ),
-	m_altLabel( _alt_label ),
-	m_title( _title ),
-	m_descr( _desc )
-{
-	setAttribute( Qt::WA_NoSystemBackground, true );
-
-	updateSize();
-
-	if( _receiver != NULL && _slot != NULL )
-	{
-		connect( this, SIGNAL( clicked() ), _receiver, _slot );
-	}
-
-}
-
-
-
-
-ToolButton::ToolButton( QAction * _a, const QString & _label,
-				const QString & _alt_label,
-				const QString & _desc, QObject * _receiver, 
-				const char * _slot, QWidget * _parent ) :
-	QToolButton( _parent ),
-	m_pixmap( _a->icon().pixmap( 128, 128 ) ),
-	m_img( FastQImage( m_pixmap.toImage() ).scaled( 32, 32 ) ),
-	m_mouseOver( false ),
-	m_label( _label ),
-	m_altLabel( _alt_label ),
-	m_title( _a->text() ),
-	m_descr( _desc )
-{
-	setAttribute( Qt::WA_NoSystemBackground, true );
-
-	updateSize();
-
-	if( _receiver != NULL && _slot != NULL )
-	{
-		connect( this, SIGNAL( clicked() ), _receiver, _slot );
-		connect( _a, SIGNAL( triggered( bool ) ), _receiver, _slot );
-	}
-
-}
-
-
-
-
-ToolButton::~ToolButton()
-{
-}
-
-
-
-
-#ifndef ITALC3
-void ToolButton::setIconOnlyMode( bool _enabled )
-{
-        s_iconOnlyMode = _enabled;
-        QList<ToolButton *> tbl = QApplication::activeWindow()->findChildren<ToolButton *>();
-        foreach( ToolButton * tb, tbl )
-        {
-                tb->updateSize();
-        }
-}
-#endif
-
-
-
-
-void ToolButton::addTo( QToolBar * _tb )
-{
-	QAction * a = _tb->addWidget( this );
-	a->setText( m_title );
-}
-
-
-
-
-void ToolButton::enterEvent( QEvent * _e )
-{
-	m_mouseOver = true;
-	if( !s_toolTipsDisabled && !m_title.isEmpty() && !m_descr.isEmpty() )
-	{
-		QPoint p = mapToGlobal( QPoint( 0, 0 ) );
-		int scr = QApplication::desktop()->isVirtualDesktop() ?
-				QApplication::desktop()->screenNumber( p ) :
-				QApplication::desktop()->screenNumber( this );
-
-#ifdef Q_WS_MAC
-		QRect screen = QApplication::desktop()->availableGeometry(
-									scr );
-#else
-		QRect screen = QApplication::desktop()->screenGeometry( scr );
-#endif
-
-		ToolButtonTip * tbt = new ToolButtonTip( m_pixmap, m_title,
-							m_descr,
-				QApplication::desktop()->screen( scr ), this );
-		connect( this, SIGNAL( mouseLeftButton() ),
-							tbt, SLOT( close() ) );
-
-		if( p.x() + tbt->width() > screen.x() + screen.width() )
-			p.rx() -= 4;// + tbt->width();
-		if( p.y() + tbt->height() > screen.y() + screen.height() )
-			p.ry() -= 30 + tbt->height();
-		if( p.y() < screen.y() )
-			p.setY( screen.y() );
-		if( p.x() + tbt->width() > screen.x() + screen.width() )
-			p.setX( screen.x() + screen.width() - tbt->width() );
-		if( p.x() < screen.x() )
-			p.setX( screen.x() );
-		if( p.y() + tbt->height() > screen.y() + screen.height() )
-			p.setY( screen.y() + screen.height() - tbt->height() );
-		tbt->move( p += QPoint( -4, height() ) );
-		tbt->show();
-	}
-
-	QToolButton::enterEvent( _e );
-}
-
-
-
-
-void ToolButton::leaveEvent( QEvent * _e )
-{
-	if( checkForLeaveEvent() )
-	{
-		QToolButton::leaveEvent( _e );
-	}
-}
-
-
-
-
-void ToolButton::mousePressEvent( QMouseEvent * _me )
-{
-	emit mouseLeftButton();
-	QToolButton::mousePressEvent( _me );
-}
-
-
-
-
-void ToolButton::paintEvent( QPaintEvent * _pe )
-{
-	const bool active = isDown() || isChecked();
-
-	QPainter painter(this);
-	painter.setRenderHint(QPainter::SmoothPixmapTransform);
-	painter.setRenderHint(QPainter::Antialiasing);
-	painter.setPen(Qt::NoPen);
-
-	QLinearGradient outlinebrush(0, 0, 0, height());
-	QLinearGradient brush(0, 0, 0, height());
-
-	brush.setSpread(QLinearGradient::PadSpread);
-	QColor highlight(255, 255, 255, 70);
-	QColor shadow(0, 0, 0, 70);
-	QColor sunken(220, 220, 220, 30);
-	QColor normal1(255, 255, 245, 60);
-	QColor normal2(255, 255, 235, 10);
-
-	if( active )
-	{
-		outlinebrush.setColorAt(0.0f, shadow);
-		outlinebrush.setColorAt(1.0f, highlight);
-		brush.setColorAt(0.0f, sunken);
-		painter.setPen(Qt::NoPen);
-	}
-	else
-	{
-		outlinebrush.setColorAt(1.0f, shadow);
-		outlinebrush.setColorAt(0.0f, highlight);
-		brush.setColorAt(0.0f, normal1);
-		if( m_mouseOver == false )
-		{
-			brush.setColorAt(1.0f, normal2);
-		}
-		painter.setPen(QPen(outlinebrush, 1));
-	}
-
-	painter.setBrush(brush);
-
-	painter.drawRoundedRect( 0, 0, width(), height(), 5, 5 );
-
-	const int dd = active ? 1 : 0;
-	QPoint pt = QPoint( ( width() - m_img.width() ) / 2 + dd, 3 + dd );
-	if( s_iconOnlyMode )
-	{
-		pt.setY( ( height() - m_img.height() ) / 2 - 1 + dd );
-	}
-	painter.drawImage( pt, m_img );
-
-	if( s_iconOnlyMode == false )
-	{
-		const QString l = ( active && m_altLabel.isEmpty() == FALSE ) ?
-								m_altLabel : m_label;
-		const int w = painter.fontMetrics().width( l );
-		painter.setPen( Qt::black );
-		painter.drawText( ( width() - w ) / 2 +1+dd, height() - 4+dd, l );
-		painter.setPen( Qt::white );
-		painter.drawText( ( width() - w ) / 2 +dd, height() - 5+dd, l );
-	}
-}
-
-
-
-
-bool ToolButton::checkForLeaveEvent()
-{
-	if( QRect( mapToGlobal( QPoint( 0, 0 ) ), size() ).
-					contains( QCursor::pos() ) )
-	{
-		QTimer::singleShot( 20, this, SLOT( checkForLeaveEvent() ) );
-	}
-	else
-	{
-		emit mouseLeftButton();
-		m_mouseOver = false;
-
-		return true;
-	}
-	return false;
-}
-
-
-
-
-void ToolButton::updateSize()
-{
-	QFont f = font();
-	f.setPointSizeF( 8 );
-	setFont( f );
-
-	if( s_iconOnlyMode )
-	{
-		setFixedSize( 52, 48 );
-	}
-	else if( m_label.size() > 14 || m_altLabel.size() > 14 )
-	{
-		setFixedSize( 96, 48 );
-	}
-	else
-	{
-		setFixedSize( 88, 48 );
-	}
-}
-
-
-
-
-
-
-
-ToolButtonTip::ToolButtonTip( const QPixmap & _pixmap, const QString & _title,
-				const QString & _description,
-				QWidget * _parent, QWidget * _tool_btn ) :
-	QWidget( _parent, Qt::ToolTip ),
-	m_icon( FastQImage( _pixmap ).scaled( 72, 72 ) ),
-	m_title( _title ),
-	m_description( _description ),
-	m_toolButton( _tool_btn )
-{
-	setAttribute( Qt::WA_DeleteOnClose, TRUE );
-	setAttribute( Qt::WA_NoSystemBackground, TRUE );
-
-	resize( sizeHint() );
-	updateMask();
-}
-
-
-
-
-QSize ToolButtonTip::sizeHint( void ) const
-{
-	QFont f = font();
-	f.setBold( TRUE );
-	int title_w = QFontMetrics( f ).width( m_title );
-	QRect desc_rect = fontMetrics().boundingRect( QRect( 0, 0, 250, 100 ),
-					Qt::TextWordWrap, m_description );
-
-	return QSize( MARGIN + m_icon.width() + MARGIN +
-				qMax( title_w, desc_rect.width() ) + MARGIN,
-			MARGIN + qMax( m_icon.height(), fontMetrics().height() +
-						MARGIN + desc_rect.height() ) +
-								MARGIN );
-}
-
-
-
-
-void ToolButtonTip::paintEvent( QPaintEvent * _pe )
-{
-	QPainter p( this );
-	p.drawImage( 0, 0, m_bg );
-}
-
-
-
-
-void ToolButtonTip::resizeEvent( QResizeEvent * _re )
-{
-	const QColor color_frame = QColor( 48, 48, 48 );
-	m_bg = QImage( size(), QImage::Format_ARGB32 );
-	m_bg.fill( color_frame.rgba() );
-	QPainter p( &m_bg );
-	p.setRenderHint( QPainter::Antialiasing );
-	QPen pen( color_frame );
-	pen.setWidthF( 1.5 );
-	p.setPen( pen );
-	QLinearGradient grad( 0, 0, 0, height() );
-	const QColor color_top = palette().color( QPalette::Active,
-						QPalette::Window ).light( 120 );
-	grad.setColorAt( 0, color_top );
-	grad.setColorAt( 1, palette().color( QPalette::Active,
-						QPalette::Window ).
-							light( 80 ) );
-	p.setBrush( grad );
-	p.drawRoundRect( 0, 0, width() - 1, height() - 1,
-					ROUNDED / width(), ROUNDED / height() );
-	if( m_toolButton )
-	{
-		QPoint pt = m_toolButton->mapToGlobal( QPoint( 0, 0 ) );
-		p.setPen( color_top );
-		p.setBrush( color_top );
-		p.setRenderHint( QPainter::Antialiasing, FALSE );
-		p.drawLine( pt.x() - x(), 0,
-				pt.x() + m_toolButton->width() - x() - 2, 0 );
-		const int dx = pt.x() - x();
-		p.setRenderHint( QPainter::Antialiasing, TRUE );
-		if( dx < 10 && dx >= 0 )
-		{
-			p.setPen( pen );
-			p.drawImage( dx+1, 0, m_bg.copy( 20, 0, 10-dx, 10 ) );
-			p.drawImage( dx, 0, m_bg.copy( 0, 10, 1, 10-dx*2 ) );
-		}
-	}
-	p.setPen( Qt::black );
-
-	p.drawImage( MARGIN, MARGIN, m_icon );
-	QFont f = p.font();
-	f.setBold( TRUE );
-	p.setFont( f );
-	const int title_x = MARGIN + m_icon.width() + MARGIN;
-	const int title_y = MARGIN + fontMetrics().height() - 2;
-	p.drawText( title_x, title_y, m_title );
-
-	f.setBold( FALSE );
-	p.setFont( f );
-	p.drawText( QRect( title_x, title_y + MARGIN,
-					width() - MARGIN - title_x,
-					height() - MARGIN - title_y ),
-					Qt::TextWordWrap, m_description );
-
-	updateMask();
-	QWidget::resizeEvent( _re );
-}
-
-
-
-
-void ToolButtonTip::updateMask( void )
-{
-	// as this widget has not a rectangular shape AND is a top
-	// level widget (which doesn't allow painting only particular
-	// regions), we have to set a mask for it
-	QBitmap b( size() );
-	b.clear();
-
-	QPainter p( &b );
-	p.setBrush( Qt::color1 );
-	p.setPen( Qt::color1 );
-	p.drawRoundRect( 0, 0, width() - 1, height() - 1,
-					ROUNDED / width(), ROUNDED / height() );
-
-	if( m_toolButton )
-	{
-		QPoint pt = m_toolButton->mapToGlobal( QPoint( 0, 0 ) );
-		const int dx = pt.x()-x();
-		if( dx < 10 && dx >= 0 )
-		{
-			p.fillRect( dx, 0, 10, 10, Qt::color1 );
-		}
-	}
-
-	setMask( b );
-}
-
-
diff --git a/ima/src/ToolButton.h b/ima/src/ToolButton.h
deleted file mode 100644
index b631bc9..0000000
--- a/ima/src/ToolButton.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * ToolButton.h - declaration of class ToolButton
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef TOOL_BUTTON_H
-#define TOOL_BUTTON_H
-
-#include <QtGui/QToolButton>
-
-#include "FastQImage.h"
-
-
-class QToolBar;
-
-
-class ToolButton : public QToolButton
-{
-	Q_OBJECT
-public:
-	ToolButton( const QPixmap & _pixmap, const QString & _label,
-				const QString & _alt_label,
-				const QString & _title, 
-				const QString & _desc, QObject * _receiver, 
-				const char * _slot, QWidget * _parent );
-	ToolButton( QAction * _a, const QString & _label,
-				const QString & _alt_label,
-				const QString & _desc, QObject * _receiver, 
-				const char * _slot, QWidget * _parent );
-	virtual ~ToolButton();
-
-
-#ifndef ITALC3
-	static void setIconOnlyMode( bool _enabled );
-
-	static bool iconOnlyMode( void )
-	{
-		return( s_iconOnlyMode );
-	}
-
-	static void setToolTipsDisabled( bool _disabled )
-	{
-		s_toolTipsDisabled = _disabled;
-	}
-
-	static bool toolTipsDisabled( void )
-	{
-		return( s_toolTipsDisabled );
-	}
-#endif
-
-	void addTo( QToolBar * );
-
-
-protected:
-	virtual void enterEvent( QEvent * _e );
-	virtual void leaveEvent( QEvent * _e );
-	virtual void mousePressEvent( QMouseEvent * _me );
-	virtual void paintEvent( QPaintEvent * _pe );
-
-
-signals:
-	void mouseLeftButton();
-
-
-private slots:
-	bool checkForLeaveEvent();
-
-
-private:
-	void updateSize();
-
-
-#ifndef ITALC3
-	static bool s_toolTipsDisabled;
-	static bool s_iconOnlyMode;
-#endif
-
-	QPixmap m_pixmap;
-	FastQImage m_img;
-	bool m_mouseOver;
-
-	QString m_label;
-	QString m_altLabel;
-	QString m_title;
-	QString m_descr;
-
-} ;
-
-
-
-
-class ToolButtonTip : public QWidget
-{
-public:
-	ToolButtonTip( const QPixmap & _pixmap, const QString & _title,
-				const QString & _description,
-				QWidget * _parent, QWidget * _tool_btn = 0 );
-
-	virtual QSize sizeHint( void ) const;
-
-
-protected:
-	virtual void paintEvent( QPaintEvent * _pe );
-	virtual void resizeEvent( QResizeEvent * _re );
-
-
-private:
-	void updateMask( void );
-
-	QImage m_icon;
-	QString m_title;
-	QString m_description;
-
-	QImage m_bg;
-
-	QWidget * m_toolButton;
-
-} ;
-
-
-
-#endif
-
diff --git a/ima/src/main.cpp b/ima/src/main.cpp
deleted file mode 100644
index d4c63db..0000000
--- a/ima/src/main.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * main.cpp - main-file for iTALC Master Application
- *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include <QtCore/QModelIndex>
-#include <QtGui/QApplication>
-#include <QtGui/QSplashScreen>
-
-#ifdef ITALC3
-#include "MasterCore.h"
-#endif
-#include "MainWindow.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCoreConnection.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "RemoteControlWidget.h"
-
-
-
-QSplashScreen * splashScreen = NULL;
-
-#ifndef ITALC3
-QString __default_domain;
-#endif
-
-
-// good old main-function... initializes qt-app and starts iTALC
-int main( int argc, char * * argv )
-{
-	QApplication app( argc, argv );
-
-	ItalcCore::init();
-
-	Logger l( "ItalcMaster" );
-
-	app.connect( &app, SIGNAL( lastWindowClosed() ), SLOT( quit() ) );
-
-	app.setStyleSheet(
-		"QMenu { border:1px solid black; background-color: white; "
-			"background-image:url(:/resources/tray-menu-bg.png); "
-			"background-repeat:no-repeat; "
-			"background-position: bottom right; }"
-		"QMenu::separator { height: 1px; background: rgb(128,128,128); "
-					"margin-left: 5px; margin-right: 5px; }"
-		"QMenu::item { padding: 2px 32px 2px 20px; "
-						"margin:3px; }"
-		"QMenu::item:selected { color: white; font-weight:bold; "
-			"background-color: rgba(0, 0, 0, 160); "
-						"margin:3px; }"
-		"QMenu::item:disabled { color: white;  margin:0px; "
-			"background-color: rgba(0,0,0,192); font-size:14px;"
-			"font-weight:bold; padding: 4px 32px 4px 20px; }" );
-
-	// load translations
-	qRegisterMetaType<QModelIndex>( "QModelIndex" );
-	qRegisterMetaType<quint16>( "quint16" );
-
-
-	ItalcCore::role = ItalcCore::RoleTeacher;
-
-	// parse arguments
-	QStringListIterator arg_it( QCoreApplication::arguments() );
-	arg_it.next();
-	int screen = -1;
-	while( argc > 1 && arg_it.hasNext() )
-	{
-		const QString & a = arg_it.next();
-		if( a == "-rctrl" && arg_it.hasNext() )
-		{
-			if( !ItalcCore::initAuthentication() )
-			{
-				ilog_failed( "ItalcCore::initAuthentication()" );
-				return -1;
-			}
-
-			const QString host = arg_it.next();
-			bool view_only = arg_it.hasNext() ?
-						arg_it.next().toInt()
-					:
-						false;
-			new RemoteControlWidget( host, view_only );
-			return app.exec();
-		}
-		else if( a == "-screen" && arg_it.hasNext() )
-		{
-			screen = arg_it.next().toInt();
-		}
-		else if( a == "-role" )
-		{
-			if( arg_it.hasNext() )
-			{
-				const QString role = arg_it.next();
-				if( role == "teacher" )
-				{
-					ItalcCore::role = ItalcCore::RoleTeacher;
-				}
-				else if( role == "admin" )
-				{
-					ItalcCore::role = ItalcCore::RoleAdmin;
-				}
-				else if( role == "supporter" )
-				{
-					ItalcCore::role = ItalcCore::RoleSupporter;
-				}
-			}
-			else
-			{
-				printf( "-role needs an argument:\n"
-					"	teacher\n"
-					"	admin\n"
-					"	supporter\n\n" );
-				return -1;
-			}
-		}
-	}
-
-
-	QSplashScreen splashScreen( QPixmap( ":/resources/splash.png" ) );
-	splashScreen.show();
-
-	if( !MainWindow::initAuthentication() )
-	{
-		return -1;
-	}
-	// now create the main-window
-	MainWindow mainWindow( screen );
-
-	if( !mainWindow.localICA() ||
-		!mainWindow.localICA()->isConnected() )
-	{
-		qCritical( "No connection to local ICA - terminating now" );
-		if( ItalcCore::config->logLevel() < Logger::LogLevelDebug )
-		{
-			return -1;
-		}
-	}
-
-	// hide splash-screen as soon as main-window is shown
-	splashScreen.finish( &mainWindow );
-
-	mainWindow.show();
-
-	ilog( Info, "Exec" );
-
-	// let's rock!!
-	return app.exec();
-}
-
diff --git a/ima/src/moc_ClassroomManager.cxx_parameters b/ima/src/moc_ClassroomManager.cxx_parameters
deleted file mode 100644
index 69ab259..0000000
--- a/ima/src/moc_ClassroomManager.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_ClassroomManager.cxx
-/tmp/foo/ima/src/ClassroomManager.h
diff --git a/ima/src/moc_Client.cxx_parameters b/ima/src/moc_Client.cxx_parameters
deleted file mode 100644
index 925e278..0000000
--- a/ima/src/moc_Client.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_Client.cxx
-/tmp/foo/ima/src/Client.h
diff --git a/ima/src/moc_ConfigWidget.cxx_parameters b/ima/src/moc_ConfigWidget.cxx_parameters
deleted file mode 100644
index 0c0d39c..0000000
--- a/ima/src/moc_ConfigWidget.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_ConfigWidget.cxx
-/tmp/foo/ima/src/ConfigWidget.h
diff --git a/ima/src/moc_Dialogs.cxx_parameters b/ima/src/moc_Dialogs.cxx_parameters
deleted file mode 100644
index 17fde9e..0000000
--- a/ima/src/moc_Dialogs.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_Dialogs.cxx
-/tmp/foo/ima/src/Dialogs.h
diff --git a/ima/src/moc_MainToolBar.cxx_parameters b/ima/src/moc_MainToolBar.cxx_parameters
deleted file mode 100644
index 017bf88..0000000
--- a/ima/src/moc_MainToolBar.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_MainToolBar.cxx
-/tmp/foo/ima/src/MainToolBar.h
diff --git a/ima/src/moc_MainWindow.cxx_parameters b/ima/src/moc_MainWindow.cxx_parameters
deleted file mode 100644
index c8c7c8f..0000000
--- a/ima/src/moc_MainWindow.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_MainWindow.cxx
-/tmp/foo/ima/src/MainWindow.h
diff --git a/ima/src/moc_OverviewWidget.cxx_parameters b/ima/src/moc_OverviewWidget.cxx_parameters
deleted file mode 100644
index 3e8c452..0000000
--- a/ima/src/moc_OverviewWidget.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_OverviewWidget.cxx
-/tmp/foo/ima/src/OverviewWidget.h
diff --git a/ima/src/moc_RemoteControlWidget.cxx_parameters b/ima/src/moc_RemoteControlWidget.cxx_parameters
deleted file mode 100644
index 0a98b17..0000000
--- a/ima/src/moc_RemoteControlWidget.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_RemoteControlWidget.cxx
-/tmp/foo/ima/src/RemoteControlWidget.h
diff --git a/ima/src/moc_RunCommandsDialog.cxx_parameters b/ima/src/moc_RunCommandsDialog.cxx_parameters
deleted file mode 100644
index 3f840e0..0000000
--- a/ima/src/moc_RunCommandsDialog.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_RunCommandsDialog.cxx
-/tmp/foo/ima/src/RunCommandsDialog.h
diff --git a/ima/src/moc_SideBar.cxx_parameters b/ima/src/moc_SideBar.cxx_parameters
deleted file mode 100644
index f00b321..0000000
--- a/ima/src/moc_SideBar.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_SideBar.cxx
-/tmp/foo/ima/src/SideBar.h
diff --git a/ima/src/moc_SideBarWidget.cxx_parameters b/ima/src/moc_SideBarWidget.cxx_parameters
deleted file mode 100644
index 7abad79..0000000
--- a/ima/src/moc_SideBarWidget.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_SideBarWidget.cxx
-/tmp/foo/ima/src/SideBarWidget.h
diff --git a/ima/src/moc_SnapshotList.cxx_parameters b/ima/src/moc_SnapshotList.cxx_parameters
deleted file mode 100644
index dd33e25..0000000
--- a/ima/src/moc_SnapshotList.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_SnapshotList.cxx
-/tmp/foo/ima/src/SnapshotList.h
diff --git a/ima/src/moc_ToolButton.cxx_parameters b/ima/src/moc_ToolButton.cxx_parameters
deleted file mode 100644
index 5da0d20..0000000
--- a/ima/src/moc_ToolButton.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/ima/src/moc_ToolButton.cxx
-/tmp/foo/ima/src/ToolButton.h
diff --git a/imc/CMakeLists.txt b/imc/CMakeLists.txt
deleted file mode 100644
index 6a59a4a..0000000
--- a/imc/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-FILE(GLOB imc_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
-FILE(GLOB imc_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
-FILE(GLOB imc_UI ${CMAKE_CURRENT_SOURCE_DIR}/Forms/*.ui)
-SET(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/imc.qrc)
-QT4_WRAP_CPP(imc_MOC_out ${imc_INCLUDES})
-QT4_WRAP_UI(imc_UIC_out ${imc_UI})
-QT4_ADD_RESOURCES(imc_RCC_out ${QRC_FILE})
-QT4_TRANSLATIONS_FOR_QRC(${QRC_FILE} ${imc_SOURCES} ${imc_INCLUDES})
-
-IF(ITALC_BUILD_WIN32)
-	SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/imcrc.obj")
-	ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
-	ADD_CUSTOM_COMMAND(OUTPUT ${WINRC}
-						COMMAND ${WINDRES}
-							-I${CMAKE_CURRENT_SOURCE_DIR}
-							-o${WINRC}
-							-i${CMAKE_CURRENT_BINARY_DIR}/imc.rc
-						DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/imc.rc)
-	LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/ica/win32)
-	LINK_LIBRARIES(-ladvapi32 -laclui -lcomctl32 -lauthSSP)
-ENDIF(ITALC_BUILD_WIN32)
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
-ADD_EXECUTABLE(imc ${imc_UIC_out} ${imc_SOURCES} ${imc_INCLUDES} ${imc_MOC_out} ${imc_RCC_out} ${WINRC})
-TARGET_LINK_LIBRARIES(imc ItalcCore)
-
-INSTALL(TARGETS imc RUNTIME DESTINATION bin)
-
-IF(ITALC_BUILD_WIN32)
-	SET_TARGET_PROPERTIES(imc PROPERTIES LINK_FLAGS -mwindows)
-ENDIF(ITALC_BUILD_WIN32)
-
diff --git a/imc/Forms/KeyFileAssistant.ui b/imc/Forms/KeyFileAssistant.ui
deleted file mode 100644
index b5a4a76..0000000
--- a/imc/Forms/KeyFileAssistant.ui
+++ /dev/null
@@ -1,973 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>KeyFileAssistant</class>
- <widget class="QWizard" name="KeyFileAssistant">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>520</width>
-    <height>345</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>iTALC Access Key Assistant</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../imc.qrc">
-    <normaloff>:/Resources/Authentication.png</normaloff>:/Resources/Authentication.png</iconset>
-  </property>
-  <property name="sizeGripEnabled">
-   <bool>true</bool>
-  </property>
-  <property name="wizardStyle">
-   <enum>QWizard::ModernStyle</enum>
-  </property>
-  <widget class="QWizardPage" name="welcomePage">
-   <property name="title">
-    <string>Create/import iTALC access keys</string>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <property name="leftMargin">
-     <number>24</number>
-    </property>
-    <property name="rightMargin">
-     <number>24</number>
-    </property>
-    <property name="bottomMargin">
-     <number>24</number>
-    </property>
-    <item>
-     <widget class="QLabel" name="label">
-      <property name="text">
-       <string>This assistant will help you to create or import iTALC access keys.</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <spacer name="verticalSpacer">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>16</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item>
-     <widget class="QLabel" name="label_2">
-      <property name="font">
-       <font>
-        <weight>75</weight>
-        <bold>true</bold>
-       </font>
-      </property>
-      <property name="text">
-       <string>How does it work?</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QLabel" name="label_3">
-      <property name="text">
-       <string>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="KeyFileAssistantModePage" name="assistantModePage">
-   <property name="title">
-    <string>Assistant mode</string>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout_2">
-    <property name="spacing">
-     <number>16</number>
-    </property>
-    <property name="leftMargin">
-     <number>24</number>
-    </property>
-    <property name="rightMargin">
-     <number>24</number>
-    </property>
-    <item>
-     <widget class="QLabel" name="label_8">
-      <property name="text">
-       <string>Please choose whether to create new access keys or import a public key on a client.</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <spacer name="verticalSpacer_6">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item>
-     <widget class="QRadioButton" name="modeCreateKeys">
-      <property name="text">
-       <string>Create new access keys (master computer)</string>
-      </property>
-      <attribute name="buttonGroup">
-       <string>assistantModeButtonGroup</string>
-      </attribute>
-     </widget>
-    </item>
-    <item>
-     <widget class="QRadioButton" name="modeImportPublicKey">
-      <property name="text">
-       <string>Import public key (client computer)</string>
-      </property>
-      <attribute name="buttonGroup">
-       <string>assistantModeButtonGroup</string>
-      </attribute>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QWizardPage" name="userRolePage">
-   <property name="title">
-    <string>Select user role</string>
-   </property>
-   <property name="subTitle">
-    <string/>
-   </property>
-   <layout class="QGridLayout" name="gridLayout">
-    <property name="leftMargin">
-     <number>24</number>
-    </property>
-    <property name="rightMargin">
-     <number>24</number>
-    </property>
-    <property name="verticalSpacing">
-     <number>16</number>
-    </property>
-    <item row="0" column="0" colspan="4">
-     <widget class="QLabel" name="label_5">
-      <property name="text">
-       <string>Please select a user role for which to create or import the access keys:</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item row="4" column="2">
-     <widget class="QComboBox" name="userRole">
-      <item>
-       <property name="text">
-        <string>Teacher</string>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>Administrator</string>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>Support team member</string>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>Other</string>
-       </property>
-      </item>
-     </widget>
-    </item>
-    <item row="4" column="3">
-     <spacer name="horizontalSpacer">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Expanding</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>40</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="4" column="0" colspan="2">
-     <spacer name="horizontalSpacer_2">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Preferred</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>40</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="8" column="1" colspan="3">
-     <widget class="QLabel" name="label_4">
-      <property name="text">
-       <string>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item row="7" column="1" colspan="3">
-     <spacer name="verticalSpacer_4">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>40</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="9" column="1" colspan="3">
-     <spacer name="verticalSpacer_5">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>40</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="8" column="0">
-     <widget class="QLabel" name="label_6">
-      <property name="maximumSize">
-       <size>
-        <width>48</width>
-        <height>48</height>
-       </size>
-      </property>
-      <property name="pixmap">
-       <pixmap resource="../imc.qrc">:/Resources/help-hint.png</pixmap>
-      </property>
-     </widget>
-    </item>
-    <item row="1" column="0" colspan="4">
-     <spacer name="verticalSpacer_2">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>10</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-   </layout>
-  </widget>
-  <widget class="KeyDirectoriesPage" name="directoriesPage">
-   <property name="title">
-    <string>Directories</string>
-   </property>
-   <layout class="QGridLayout" name="gridLayout_2">
-    <property name="leftMargin">
-     <number>24</number>
-    </property>
-    <property name="rightMargin">
-     <number>24</number>
-    </property>
-    <property name="verticalSpacing">
-     <number>10</number>
-    </property>
-    <item row="0" column="0" colspan="2">
-     <widget class="QCheckBox" name="exportPublicKey">
-      <property name="text">
-       <string>Export public key part (master computer)</string>
-      </property>
-      <property name="checked">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="0">
-     <spacer name="horizontalSpacer_4">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>24</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="2" column="1">
-     <widget class="QLineEdit" name="publicKeyDir"/>
-    </item>
-    <item row="2" column="2">
-     <widget class="QToolButton" name="openPubKeyDir">
-      <property name="text">
-       <string>...</string>
-      </property>
-      <property name="icon">
-       <iconset resource="../imc.qrc">
-        <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-      </property>
-     </widget>
-    </item>
-    <item row="3" column="1" colspan="2">
-     <spacer name="verticalSpacer_8">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>32</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="4" column="0" colspan="2">
-     <widget class="QCheckBox" name="useCustomDestDir">
-      <property name="text">
-       <string>Use custom destination directory for access keys</string>
-      </property>
-     </widget>
-    </item>
-    <item row="5" column="0">
-     <spacer name="horizontalSpacer_3">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="5" column="1">
-     <widget class="QLineEdit" name="destDirEdit">
-      <property name="enabled">
-       <bool>false</bool>
-      </property>
-     </widget>
-    </item>
-    <item row="5" column="2">
-     <widget class="QToolButton" name="openDestDir">
-      <property name="enabled">
-       <bool>false</bool>
-      </property>
-      <property name="text">
-       <string>...</string>
-      </property>
-      <property name="icon">
-       <iconset resource="../imc.qrc">
-        <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-      </property>
-     </widget>
-    </item>
-    <item row="1" column="0" colspan="2">
-     <widget class="QLabel" name="importKeyLabel">
-      <property name="text">
-       <string>Please specify the location of the public access key to be imported.</string>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QWizardPage" name="summaryPage">
-   <property name="title">
-    <string>Summary</string>
-   </property>
-   <layout class="QGridLayout" name="gridLayout_3">
-    <property name="leftMargin">
-     <number>24</number>
-    </property>
-    <property name="rightMargin">
-     <number>24</number>
-    </property>
-    <property name="verticalSpacing">
-     <number>10</number>
-    </property>
-    <item row="0" column="0" colspan="2">
-     <widget class="QLabel" name="label_9">
-      <property name="text">
-       <string>The following actions will be taken:</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item row="1" column="0">
-     <spacer name="verticalSpacer_3">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>10</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="2" column="0">
-     <spacer name="horizontalSpacer_5">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType">
-       <enum>QSizePolicy::Fixed</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>24</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item row="2" column="1">
-     <layout class="QVBoxLayout" name="verticalLayout_3">
-      <item>
-       <widget class="QLabel" name="actionCreateKeys">
-        <property name="text">
-         <string>• Create new access keys</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <item>
-         <widget class="QLabel" name="actionImportPublicKey">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="text">
-           <string>• Import public access key from</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="importKeySourceDisplayLabel">
-          <property name="text">
-           <string><unknown></string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_4">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <item>
-         <widget class="QLabel" name="actionWriteKeyFile">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="text">
-           <string>• Write access key(s) to</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="destDirDisplayLabel">
-          <property name="text">
-           <string><unknown></string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <item>
-         <widget class="QLabel" name="actionExportPublicKey">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="text">
-           <string>• Export public key to</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="exportKeyDestDisplayLabel">
-          <property name="text">
-           <string><unknown></string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <item>
-         <widget class="QLabel" name="actionUserRoleLabel">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="text">
-           <string>• Configure for user role</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="userRoleDisplayLabel">
-          <property name="font">
-           <font>
-            <weight>75</weight>
-            <bold>true</bold>
-           </font>
-          </property>
-          <property name="text">
-           <string>Teacher</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </item>
-    <item row="2" column="2">
-     <spacer name="horizontalSpacer_6">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>40</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-   </layout>
-  </widget>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KeyFileAssistantModePage</class>
-   <extends>QWizardPage</extends>
-   <header>KeyFileAssistantModePage.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>KeyDirectoriesPage</class>
-   <extends>QWizardPage</extends>
-   <header>KeyDirectoriesPage.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="../imc.qrc"/>
-  <include location="../../../.designer/imc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>useCustomDestDir</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>destDirEdit</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>217</x>
-     <y>97</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>230</x>
-     <y>128</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useCustomDestDir</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>openDestDir</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>217</x>
-     <y>97</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>443</x>
-     <y>127</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeImportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>exportPublicKey</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>263</x>
-     <y>181</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>248</x>
-     <y>58</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeCreateKeys</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>importKeyLabel</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>262</x>
-     <y>143</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>248</x>
-     <y>84</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeImportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>actionCreateKeys</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>263</x>
-     <y>181</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>277</x>
-     <y>95</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeCreateKeys</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>actionImportPublicKey</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>262</x>
-     <y>143</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>141</x>
-     <y>148</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>exportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>actionExportPublicKey</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>248</x>
-     <y>58</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>108</x>
-     <y>120</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeCreateKeys</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>exportPublicKey</receiver>
-   <slot>setChecked(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>262</x>
-     <y>143</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>248</x>
-     <y>58</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeImportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>exportKeyDestDisplayLabel</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>263</x>
-     <y>181</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>221</x>
-     <y>120</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeCreateKeys</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>importKeySourceDisplayLabel</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>262</x>
-     <y>143</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>287</x>
-     <y>148</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>destDirEdit</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>destDirDisplayLabel</receiver>
-   <slot>setText(QString)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>261</x>
-     <y>231</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>235</x>
-     <y>176</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>userRole</sender>
-   <signal>currentIndexChanged(QString)</signal>
-   <receiver>userRoleDisplayLabel</receiver>
-   <slot>setText(QString)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>173</x>
-     <y>120</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>279</x>
-     <y>203</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeImportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>publicKeyDir</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>263</x>
-     <y>181</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>262</x>
-     <y>120</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>exportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>publicKeyDir</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>58</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>262</x>
-     <y>120</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>exportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>openPubKeyDir</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>58</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>492</x>
-     <y>119</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeImportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>openPubKeyDir</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>263</x>
-     <y>181</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>492</x>
-     <y>119</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>exportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>exportKeyDestDisplayLabel</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>58</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>270</x>
-     <y>128</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>publicKeyDir</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>importKeySourceDisplayLabel</receiver>
-   <slot>setText(QString)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>262</x>
-     <y>120</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>303</x>
-     <y>153</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>publicKeyDir</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>exportKeyDestDisplayLabel</receiver>
-   <slot>setText(QString)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>262</x>
-     <y>120</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>270</x>
-     <y>128</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>modeImportPublicKey</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>actionExportPublicKey</receiver>
-   <slot>setHidden(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>263</x>
-     <y>181</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>124</x>
-     <y>178</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
- <buttongroups>
-  <buttongroup name="assistantModeButtonGroup"/>
- </buttongroups>
-</ui>
diff --git a/imc/Forms/LogonGroupEditor.ui b/imc/Forms/LogonGroupEditor.ui
deleted file mode 100644
index 1b8f06f..0000000
--- a/imc/Forms/LogonGroupEditor.ui
+++ /dev/null
@@ -1,214 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>LogonGroupEditor</class>
- <widget class="QDialog" name="LogonGroupEditor">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>452</width>
-    <height>279</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Logon group editor</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="sizeConstraint">
-    <enum>QLayout::SetMinimumSize</enum>
-   </property>
-   <item row="0" column="0" colspan="3">
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Please add the groups whose members should be allowed to access computers in your iTALC network.</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" colspan="3">
-    <spacer name="verticalSpacer_3">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::MinimumExpanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>431</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QLabel" name="label_4">
-     <property name="text">
-      <string>All groups</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <layout class="QVBoxLayout" name="verticalLayout_3">
-     <item>
-      <spacer name="verticalSpacer_4">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QToolButton" name="addLogonGroup">
-       <property name="text">
-        <string>...</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/go-next.png</normaloff>:/Resources/go-next.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QToolButton" name="removeLogonGroup">
-       <property name="text">
-        <string>...</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/go-previous.png</normaloff>:/Resources/go-previous.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="verticalSpacer_5">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="2" column="2">
-    <widget class="QLabel" name="label_6">
-     <property name="text">
-      <string>Groups with iTALC privileges</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="0">
-    <widget class="QListWidget" name="allGroups">
-     <property name="selectionMode">
-      <enum>QAbstractItemView::MultiSelection</enum>
-     </property>
-     <property name="sortingEnabled">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="2">
-    <widget class="QListWidget" name="logonGroups">
-     <property name="selectionMode">
-      <enum>QAbstractItemView::MultiSelection</enum>
-     </property>
-     <property name="sortingEnabled">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="0" colspan="3">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../imc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>LogonGroupEditor</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>225</x>
-     <y>256</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>225</x>
-     <y>139</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>LogonGroupEditor</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>225</x>
-     <y>256</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>225</x>
-     <y>139</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>addLogonGroup</sender>
-   <signal>clicked()</signal>
-   <receiver>LogonGroupEditor</receiver>
-   <slot>addLogonGroup()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>225</x>
-     <y>146</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>225</x>
-     <y>139</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>removeLogonGroup</sender>
-   <signal>clicked()</signal>
-   <receiver>LogonGroupEditor</receiver>
-   <slot>removeLogonGroup()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>225</x>
-     <y>176</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>225</x>
-     <y>139</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
- <slots>
-  <slot>addLogonGroup()</slot>
-  <slot>removeLogonGroup()</slot>
- </slots>
-</ui>
diff --git a/imc/Forms/MainWindow.ui b/imc/Forms/MainWindow.ui
deleted file mode 100644
index b26ca55..0000000
--- a/imc/Forms/MainWindow.ui
+++ /dev/null
@@ -1,1633 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>715</width>
-    <height>565</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>iTALC Management Console</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../imc.qrc">
-    <normaloff>:/Resources/imc.png</normaloff>:/Resources/imc.png</iconset>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <layout class="QGridLayout" name="gridLayout_4">
-    <item row="0" column="0">
-     <widget class="QListWidget" name="pageSelector">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>200</width>
-        <height>200</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>200</width>
-        <height>16777215</height>
-       </size>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">::item { width:120; height:50 }
-</string>
-      </property>
-      <property name="verticalScrollBarPolicy">
-       <enum>Qt::ScrollBarAlwaysOff</enum>
-      </property>
-      <property name="horizontalScrollBarPolicy">
-       <enum>Qt::ScrollBarAlwaysOff</enum>
-      </property>
-      <property name="iconSize">
-       <size>
-        <width>48</width>
-        <height>48</height>
-       </size>
-      </property>
-      <property name="spacing">
-       <number>4</number>
-      </property>
-      <property name="viewMode">
-       <enum>QListView::ListMode</enum>
-      </property>
-      <property name="currentRow">
-       <number>0</number>
-      </property>
-      <item>
-       <property name="text">
-        <string>General</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/General.png</normaloff>:/Resources/General.png</iconset>
-       </property>
-       <property name="flags">
-        <set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>iTALC Server</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/Vnc.png</normaloff>:/Resources/Vnc.png</iconset>
-       </property>
-       <property name="flags">
-        <set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>Paths</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/Paths.png</normaloff>:/Resources/Paths.png</iconset>
-       </property>
-       <property name="flags">
-        <set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>Authentication</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/Authentication.png</normaloff>:/Resources/Authentication.png</iconset>
-       </property>
-       <property name="flags">
-        <set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
-       </property>
-      </item>
-      <item>
-       <property name="text">
-        <string>Debugging</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../imc.qrc">
-         <normaloff>:/Resources/kbugbuster.png</normaloff>:/Resources/kbugbuster.png</iconset>
-       </property>
-      </item>
-     </widget>
-    </item>
-    <item row="0" column="1">
-     <widget class="QStackedWidget" name="configPages">
-      <property name="currentIndex">
-       <number>0</number>
-      </property>
-      <widget class="QWidget" name="generalSettingsPage">
-       <layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0,1">
-        <property name="spacing">
-         <number>10</number>
-        </property>
-        <item>
-         <widget class="QGroupBox" name="groupBox_3">
-          <property name="title">
-           <string>iTALC Service</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_10">
-           <item row="0" column="0" colspan="5">
-            <widget class="QCheckBox" name="isTrayIconHidden">
-             <property name="text">
-              <string>Hide tray icon</string>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0" colspan="5">
-            <widget class="QCheckBox" name="autostartService">
-             <property name="text">
-              <string>Autostart</string>
-             </property>
-            </widget>
-           </item>
-           <item row="3" column="0" colspan="5">
-            <layout class="QHBoxLayout" name="horizontalLayout_2">
-             <item>
-              <spacer name="horizontalSpacer_4">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>24</width>
-                 <height>10</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_9">
-               <property name="text">
-                <string>Additional arguments</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="serviceArguments"/>
-             </item>
-            </layout>
-           </item>
-           <item row="4" column="3">
-            <widget class="QPushButton" name="startService">
-             <property name="text">
-              <string>Start service</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/arrow-right.png</normaloff>:/Resources/arrow-right.png</iconset>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="4">
-            <widget class="QPushButton" name="stopService">
-             <property name="text">
-              <string>Stop service</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/system-shutdown.png</normaloff>:/Resources/system-shutdown.png</iconset>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="2">
-            <spacer name="horizontalSpacer_8">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item row="4" column="0">
-            <widget class="QLabel" name="label_15">
-             <property name="text">
-              <string>State:</string>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="1">
-            <widget class="QLabel" name="serviceState">
-             <property name="font">
-              <font>
-               <weight>75</weight>
-               <bold>true</bold>
-              </font>
-             </property>
-             <property name="text">
-              <string>Stopped</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="0" colspan="5">
-            <widget class="QCheckBox" name="lockWithDesktopSwitching">
-             <property name="text">
-              <string>Enable desktop switching for screen lock (experimental)</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="groupBox_7">
-          <property name="title">
-           <string>Logging</string>
-          </property>
-          <layout class="QVBoxLayout" name="verticalLayout_8">
-           <item>
-            <layout class="QGridLayout" name="gridLayout_9">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_10">
-               <property name="text">
-                <string>Log file directory</string>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="1">
-              <widget class="QLineEdit" name="logFileDirectory"/>
-             </item>
-             <item row="0" column="2">
-              <widget class="QToolButton" name="openLogFileDirectory">
-               <property name="text">
-                <string>...</string>
-               </property>
-               <property name="icon">
-                <iconset resource="../imc.qrc">
-                 <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="0">
-              <widget class="QLabel" name="label_11">
-               <property name="text">
-                <string>Log level</string>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="1">
-              <widget class="QComboBox" name="logLevel">
-               <item>
-                <property name="text">
-                 <string>Nothing</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Only critical messages</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Errors and critical messages</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Warnings and errors</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Information, warnings and errors</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Debug messages and everything else</string>
-                </property>
-               </item>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_3">
-             <item>
-              <widget class="QCheckBox" name="limittedLogFileSize">
-               <property name="text">
-                <string>Limit log file size</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_6">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>20</width>
-                 <height>10</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QSpinBox" name="logFileSizeLimit">
-               <property name="enabled">
-                <bool>false</bool>
-               </property>
-               <property name="value">
-                <number>10</number>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_14">
-               <property name="text">
-                <string>MB</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_5">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="logToStdErr">
-             <property name="text">
-              <string>Log to standard error output</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="logToWindowsEventLog">
-             <property name="text">
-              <string>Log to Windows event log</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout">
-             <item>
-              <spacer name="horizontalSpacer">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>281</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="clearLogFiles">
-               <property name="text">
-                <string>Clear all log files</string>
-               </property>
-               <property name="icon">
-                <iconset resource="../imc.qrc">
-                 <normaloff>:/Resources/edit-clear.png</normaloff>:/Resources/edit-clear.png</iconset>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <spacer name="verticalSpacer_2">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>10</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="italcServerSettingsPage">
-       <layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,0,0,1">
-        <property name="spacing">
-         <number>10</number>
-        </property>
-        <item>
-         <widget class="QGroupBox" name="groupBox_6">
-          <property name="title">
-           <string>Desktop capturing</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_7">
-           <item row="0" column="0">
-            <widget class="QCheckBox" name="vncCaptureLayeredWindows">
-             <property name="text">
-              <string>Enable capturing of layered (semi-transparent) windows</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <widget class="QCheckBox" name="vncPollFullScreen">
-             <property name="text">
-              <string>Poll full screen (leave this enabled per default)</string>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0">
-            <widget class="QCheckBox" name="vncLowAccuracy">
-             <property name="text">
-              <string>Low accuracy (turbo mode)</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="groupBox_9">
-          <property name="title">
-           <string>Demo server</string>
-          </property>
-          <layout class="QVBoxLayout" name="verticalLayout_7">
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_11" stretch="0,1,2">
-             <property name="spacing">
-              <number>16</number>
-             </property>
-             <item>
-              <widget class="QLabel" name="label_6">
-               <property name="text">
-                <string>Backend</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QComboBox" name="demoServerBackend">
-               <item>
-                <property name="text">
-                 <string>VNC reflector</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>iTALC 1 demo server</string>
-                </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_15">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="isDemoServerMultithreaded">
-             <property name="text">
-              <string>Multithreading (can be enabled when using the VNC reflector backend)</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="groupBox_8">
-          <property name="title">
-           <string>Network</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_11">
-           <item row="0" column="0">
-            <widget class="QLabel" name="label_12">
-             <property name="text">
-              <string>Core server port</string>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="1">
-            <widget class="QSpinBox" name="coreServerPort">
-             <property name="minimum">
-              <number>1024</number>
-             </property>
-             <property name="maximum">
-              <number>65535</number>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <widget class="QLabel" name="label_13">
-             <property name="text">
-              <string>Demo server port</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <widget class="QSpinBox" name="demoServerPort">
-             <property name="minimum">
-              <number>1024</number>
-             </property>
-             <property name="maximum">
-              <number>65535</number>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0" colspan="2">
-            <widget class="QCheckBox" name="isFirewallExceptionEnabled">
-             <property name="text">
-              <string>Enable firewall exception</string>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="0" colspan="2">
-            <widget class="QCheckBox" name="isHttpServerEnabled">
-             <property name="text">
-              <string>Enable HTTP server which provides a JavaViewer applet</string>
-             </property>
-            </widget>
-           </item>
-           <item row="5" column="0" colspan="2">
-            <layout class="QHBoxLayout" name="horizontalLayout_5">
-             <item>
-              <spacer name="horizontalSpacer_10">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>20</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="httpServerPortLabel">
-               <property name="enabled">
-                <bool>false</bool>
-               </property>
-               <property name="text">
-                <string>HTTP server port</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QSpinBox" name="httpServerPort">
-               <property name="enabled">
-                <bool>false</bool>
-               </property>
-               <property name="minimum">
-                <number>1024</number>
-               </property>
-               <property name="maximum">
-                <number>65535</number>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_11">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item row="3" column="0" colspan="2">
-            <widget class="QCheckBox" name="localConnectOnly">
-             <property name="text">
-              <string>Allow connections from localhost only</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <spacer name="verticalSpacer_6">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>40</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="pathSettingsPage">
-       <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
-        <property name="spacing">
-         <number>10</number>
-        </property>
-        <item>
-         <widget class="QGroupBox" name="groupBox">
-          <property name="title">
-           <string>Configuration files</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_3">
-           <property name="leftMargin">
-            <number>10</number>
-           </property>
-           <property name="horizontalSpacing">
-            <number>10</number>
-           </property>
-           <item row="0" column="1">
-            <widget class="QLineEdit" name="globalConfigurationPath"/>
-           </item>
-           <item row="0" column="0">
-            <widget class="QLabel" name="label_5">
-             <property name="text">
-              <string>Global configuration</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <widget class="QLabel" name="label_2">
-             <property name="text">
-              <string>Personal configuration</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <widget class="QLineEdit" name="personalConfigurationPath"/>
-           </item>
-           <item row="0" column="2">
-            <widget class="QToolButton" name="openGlobalConfig">
-             <property name="text">
-              <string>...</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="2">
-            <widget class="QToolButton" name="openPersonalConfig">
-             <property name="text">
-              <string>...</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="groupBox_2">
-          <property name="title">
-           <string>Data directories</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_2">
-           <property name="leftMargin">
-            <number>10</number>
-           </property>
-           <property name="horizontalSpacing">
-            <number>10</number>
-           </property>
-           <item row="0" column="1">
-            <spacer name="horizontalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item row="1" column="1">
-            <widget class="QLineEdit" name="snapshotDirectory"/>
-           </item>
-           <item row="1" column="0">
-            <widget class="QLabel" name="label">
-             <property name="text">
-              <string>Snapshots</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="2">
-            <widget class="QToolButton" name="openSnapshotDirectory">
-             <property name="text">
-              <string>...</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <spacer name="verticalSpacer">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>0</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="authSettingsPage">
-       <layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0,0,0,1">
-        <property name="spacing">
-         <number>4</number>
-        </property>
-        <property name="bottomMargin">
-         <number>0</number>
-        </property>
-        <item>
-         <widget class="QGroupBox" name="groupBox_5">
-          <property name="title">
-           <string>Authentication methods</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_6">
-           <property name="leftMargin">
-            <number>10</number>
-           </property>
-           <property name="horizontalSpacing">
-            <number>6</number>
-           </property>
-           <property name="verticalSpacing">
-            <number>2</number>
-           </property>
-           <item row="0" column="0">
-            <widget class="QCheckBox" name="isKeyAuthenticationEnabled">
-             <property name="text">
-              <string>Key file authentication</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <widget class="QCheckBox" name="isLogonAuthenticationEnabled">
-             <property name="text">
-              <string>ACL-based logon authentication</string>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="1">
-            <spacer name="horizontalSpacer_7">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="keyManagement">
-          <property name="enabled">
-           <bool>false</bool>
-          </property>
-          <property name="title">
-           <string>Access key management</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout_12">
-           <property name="verticalSpacing">
-            <number>2</number>
-           </property>
-           <item row="0" column="0" colspan="2">
-            <layout class="QGridLayout" name="gridLayout_8">
-             <property name="horizontalSpacing">
-              <number>10</number>
-             </property>
-             <property name="verticalSpacing">
-              <number>7</number>
-             </property>
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_7">
-               <property name="text">
-                <string>Public key file base directory</string>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="1">
-              <widget class="QLineEdit" name="publicKeyBaseDir"/>
-             </item>
-             <item row="1" column="0">
-              <widget class="QLabel" name="label_8">
-               <property name="text">
-                <string>Private key file base directory</string>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="1">
-              <widget class="QLineEdit" name="privateKeyBaseDir"/>
-             </item>
-             <item row="0" column="2">
-              <widget class="QToolButton" name="openPublicKeyBaseDir">
-               <property name="text">
-                <string>...</string>
-               </property>
-               <property name="icon">
-                <iconset resource="../imc.qrc">
-                 <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="2">
-              <widget class="QToolButton" name="openPrivateKeyBaseDir">
-               <property name="text">
-                <string>...</string>
-               </property>
-               <property name="icon">
-                <iconset resource="../imc.qrc">
-                 <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item row="1" column="0">
-            <widget class="QPushButton" name="launchKeyFileAssistant">
-             <property name="text">
-              <string>Launch key file assistant</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/tools-wizard.png</normaloff>:/Resources/tools-wizard.png</iconset>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <spacer name="horizontalSpacer_2">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="logonManagement">
-          <property name="enabled">
-           <bool>false</bool>
-          </property>
-          <property name="title">
-           <string>Logon settings</string>
-          </property>
-          <layout class="QGridLayout" name="gridLayout">
-           <property name="horizontalSpacing">
-            <number>10</number>
-           </property>
-           <item row="0" column="0">
-            <widget class="QPushButton" name="manageACLs">
-             <property name="text">
-              <string>Manage permissions</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/preferences-other.png</normaloff>:/Resources/preferences-other.png</iconset>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="1">
-            <widget class="QPushButton" name="testLogonAuthentication">
-             <property name="text">
-              <string>Test</string>
-             </property>
-             <property name="icon">
-              <iconset resource="../imc.qrc">
-               <normaloff>:/Resources/task-accepted.png</normaloff>:/Resources/task-accepted.png</iconset>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="2">
-            <spacer name="horizontalSpacer_9">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>209</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <widget class="QGroupBox" name="groupBox_4">
-          <property name="title">
-           <string>Access confirmation</string>
-          </property>
-          <layout class="QVBoxLayout" name="verticalLayout_4">
-           <item>
-            <widget class="QLabel" name="label_3">
-             <property name="minimumSize">
-              <size>
-               <width>0</width>
-               <height>36</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="isPermissionRequiredWithKeyAuthentication">
-             <property name="text">
-              <string>Key file authentication</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QCheckBox" name="isPermissionRequiredWithLogonAuthentication">
-             <property name="text">
-              <string>Logon authentication</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_6">
-             <item>
-              <spacer name="horizontalSpacer_12">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Fixed</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>24</width>
-                 <height>16</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="isSameUserConfirmationDisabled">
-               <property name="enabled">
-                <bool>false</bool>
-               </property>
-               <property name="text">
-                <string>Allow same user to access desktop without confirmation</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <spacer name="verticalSpacer_7">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>0</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="debugPage">
-       <layout class="QVBoxLayout" name="verticalLayout_9" stretch="0,1">
-        <property name="spacing">
-         <number>4</number>
-        </property>
-        <property name="bottomMargin">
-         <number>0</number>
-        </property>
-        <item>
-         <widget class="QGroupBox" name="groupBox_10">
-          <property name="title">
-           <string>Debugging iTALC</string>
-          </property>
-          <layout class="QVBoxLayout" name="verticalLayout_12" stretch="0,0,0,0,0,0,0">
-           <property name="spacing">
-            <number>16</number>
-           </property>
-           <item>
-            <widget class="QLabel" name="label_4">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="text">
-              <string>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,1">
-             <item>
-              <widget class="QLabel" name="label_17">
-               <property name="font">
-                <font>
-                 <weight>75</weight>
-                 <bold>true</bold>
-                </font>
-               </property>
-               <property name="text">
-                <string>1)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_18">
-               <property name="text">
-                <string>Clear the logfiles in the "General" section.</string>
-               </property>
-               <property name="wordWrap">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_10" stretch="0,1">
-             <item>
-              <layout class="QVBoxLayout" name="verticalLayout_10">
-               <property name="spacing">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="QLabel" name="label_25">
-                 <property name="font">
-                  <font>
-                   <weight>75</weight>
-                   <bold>true</bold>
-                  </font>
-                 </property>
-                 <property name="text">
-                  <string>2)</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="verticalSpacer_5">
-                 <property name="orientation">
-                  <enum>Qt::Vertical</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>0</width>
-                   <height>0</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_26">
-               <property name="text">
-                <string>In the "General" section set the log level to "Debug messages and everything else".</string>
-               </property>
-               <property name="wordWrap">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,1">
-             <item>
-              <widget class="QLabel" name="label_19">
-               <property name="font">
-                <font>
-                 <weight>75</weight>
-                 <bold>true</bold>
-                </font>
-               </property>
-               <property name="text">
-                <string>3)</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_20">
-               <property name="text">
-                <string>Repeat the actions leading to the bug or misbehaviour.</string>
-               </property>
-               <property name="wordWrap">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_8" stretch="0,1">
-             <item>
-              <layout class="QVBoxLayout" name="verticalLayout_11">
-               <property name="spacing">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="QLabel" name="label_21">
-                 <property name="font">
-                  <font>
-                   <weight>75</weight>
-                   <bold>true</bold>
-                  </font>
-                 </property>
-                 <property name="text">
-                  <string>4)</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="verticalSpacer_8">
-                 <property name="orientation">
-                  <enum>Qt::Vertical</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>0</width>
-                   <height>0</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_22">
-               <property name="text">
-                <string>Click the following button and save the file to a known location.</string>
-               </property>
-               <property name="wordWrap">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0,0,1">
-             <item>
-              <spacer name="horizontalSpacer_13">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="generateBugReportArchive">
-               <property name="text">
-                <string>Generate bug report archive</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_14">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QGridLayout" name="gridLayout_5" rowstretch="1,0" columnstretch="0,1">
-             <item row="0" column="0" rowspan="2">
-              <layout class="QVBoxLayout" name="verticalLayout_3">
-               <property name="spacing">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="QLabel" name="label_23">
-                 <property name="font">
-                  <font>
-                   <weight>75</weight>
-                   <bold>true</bold>
-                  </font>
-                 </property>
-                 <property name="text">
-                  <string>5)</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="verticalSpacer_4">
-                 <property name="orientation">
-                  <enum>Qt::Vertical</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>0</width>
-                   <height>0</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-             <item row="0" column="1">
-              <widget class="QLabel" name="label_24">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="text">
-                <string>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</string>
-               </property>
-               <property name="wordWrap">
-                <bool>true</bool>
-               </property>
-               <property name="openExternalLinks">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="1">
-              <spacer name="verticalSpacer_3">
-               <property name="orientation">
-                <enum>Qt::Vertical</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>0</width>
-                 <height>0</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </item>
-        <item>
-         <spacer name="verticalSpacer_9">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>0</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-     </widget>
-    </item>
-    <item row="1" column="0" colspan="2">
-     <widget class="Line" name="line">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="1">
-     <widget class="QDialogButtonBox" name="buttonBox">
-      <property name="standardButtons">
-       <set>QDialogButtonBox::Apply|QDialogButtonBox::Reset</set>
-      </property>
-      <property name="centerButtons">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>715</width>
-     <height>25</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menu_File">
-    <property name="title">
-     <string>&File</string>
-    </property>
-    <addaction name="actionLoadSettings"/>
-    <addaction name="actionSaveSettings"/>
-    <addaction name="separator"/>
-    <addaction name="actionQuit"/>
-   </widget>
-   <widget class="QMenu" name="menu_Help">
-    <property name="title">
-     <string>&Help</string>
-    </property>
-    <addaction name="actionAboutItalc"/>
-    <addaction name="actionAboutQt"/>
-   </widget>
-   <addaction name="menu_File"/>
-   <addaction name="menu_Help"/>
-  </widget>
-  <action name="actionQuit">
-   <property name="text">
-    <string>&Quit</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Q</string>
-   </property>
-  </action>
-  <action name="actionSaveSettings">
-   <property name="icon">
-    <iconset resource="../imc.qrc">
-     <normaloff>:/Resources/document-save.png</normaloff>:/Resources/document-save.png</iconset>
-   </property>
-   <property name="text">
-    <string>&Save settings into file</string>
-   </property>
-   <property name="toolTip">
-    <string>Save settings into file</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+S</string>
-   </property>
-  </action>
-  <action name="actionLoadSettings">
-   <property name="icon">
-    <iconset resource="../imc.qrc">
-     <normaloff>:/Resources/document-open.png</normaloff>:/Resources/document-open.png</iconset>
-   </property>
-   <property name="text">
-    <string>L&oad settings from file</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+O</string>
-   </property>
-  </action>
-  <action name="actionAboutItalc">
-   <property name="icon">
-    <iconset resource="../../lib/ItalcCore.qrc">
-     <normaloff>:/resources/info.png</normaloff>:/resources/info.png</iconset>
-   </property>
-   <property name="text">
-    <string>About iTALC</string>
-   </property>
-  </action>
-  <action name="actionAboutQt">
-   <property name="text">
-    <string>About Qt</string>
-   </property>
-  </action>
- </widget>
- <resources>
-  <include location="../imc.qrc"/>
-  <include location="../../lib/ItalcCore.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>pageSelector</sender>
-   <signal>currentRowChanged(int)</signal>
-   <receiver>configPages</receiver>
-   <slot>setCurrentIndex(int)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>108</x>
-     <y>301</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>502</x>
-     <y>301</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>limittedLogFileSize</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>logFileSizeLimit</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>308</x>
-     <y>376</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>408</x>
-     <y>377</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>isKeyAuthenticationEnabled</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>keyManagement</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>441</x>
-     <y>78</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>455</x>
-     <y>190</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>isLogonAuthenticationEnabled</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>logonManagement</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>441</x>
-     <y>102</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>455</x>
-     <y>372</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>isHttpServerEnabled</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>httpServerPort</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>367</x>
-     <y>364</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>413</x>
-     <y>396</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>isHttpServerEnabled</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>httpServerPortLabel</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>367</x>
-     <y>364</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>320</x>
-     <y>396</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>isPermissionRequiredWithLogonAuthentication</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>isSameUserConfirmationDisabled</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>458</x>
-     <y>322</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>473</x>
-     <y>345</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>actionAboutItalc</sender>
-   <signal>triggered()</signal>
-   <receiver>MainWindow</receiver>
-   <slot>aboutItalc()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>357</x>
-     <y>282</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>actionQuit</sender>
-   <signal>triggered()</signal>
-   <receiver>MainWindow</receiver>
-   <slot>close()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>357</x>
-     <y>282</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
- <slots>
-  <slot>aboutItalc()</slot>
- </slots>
-</ui>
diff --git a/imc/Resources/Authentication.png b/imc/Resources/Authentication.png
deleted file mode 100644
index 494980e..0000000
Binary files a/imc/Resources/Authentication.png and /dev/null differ
diff --git a/imc/Resources/General.png b/imc/Resources/General.png
deleted file mode 100644
index 06740ba..0000000
Binary files a/imc/Resources/General.png and /dev/null differ
diff --git a/imc/Resources/Paths.png b/imc/Resources/Paths.png
deleted file mode 100644
index 3f55aa6..0000000
Binary files a/imc/Resources/Paths.png and /dev/null differ
diff --git a/imc/Resources/Vnc.png b/imc/Resources/Vnc.png
deleted file mode 100644
index 0ceb476..0000000
Binary files a/imc/Resources/Vnc.png and /dev/null differ
diff --git a/imc/Resources/arrow-right.png b/imc/Resources/arrow-right.png
deleted file mode 100644
index 0acee70..0000000
Binary files a/imc/Resources/arrow-right.png and /dev/null differ
diff --git a/imc/Resources/document-open.png b/imc/Resources/document-open.png
deleted file mode 100644
index b225e9a..0000000
Binary files a/imc/Resources/document-open.png and /dev/null differ
diff --git a/imc/Resources/document-save.png b/imc/Resources/document-save.png
deleted file mode 100644
index 8072aea..0000000
Binary files a/imc/Resources/document-save.png and /dev/null differ
diff --git a/imc/Resources/edit-clear.png b/imc/Resources/edit-clear.png
deleted file mode 100644
index 19a1665..0000000
Binary files a/imc/Resources/edit-clear.png and /dev/null differ
diff --git a/imc/Resources/go-next.png b/imc/Resources/go-next.png
deleted file mode 100644
index a04c99e..0000000
Binary files a/imc/Resources/go-next.png and /dev/null differ
diff --git a/imc/Resources/go-previous.png b/imc/Resources/go-previous.png
deleted file mode 100644
index 940797b..0000000
Binary files a/imc/Resources/go-previous.png and /dev/null differ
diff --git a/imc/Resources/help-hint.png b/imc/Resources/help-hint.png
deleted file mode 100644
index fac7493..0000000
Binary files a/imc/Resources/help-hint.png and /dev/null differ
diff --git a/imc/Resources/imc.ico b/imc/Resources/imc.ico
deleted file mode 100644
index 81e633c..0000000
Binary files a/imc/Resources/imc.ico and /dev/null differ
diff --git a/imc/Resources/imc.png b/imc/Resources/imc.png
deleted file mode 100644
index fa379d8..0000000
Binary files a/imc/Resources/imc.png and /dev/null differ
diff --git a/imc/Resources/kbugbuster.png b/imc/Resources/kbugbuster.png
deleted file mode 100644
index 239a43e..0000000
Binary files a/imc/Resources/kbugbuster.png and /dev/null differ
diff --git a/imc/Resources/preferences-other.png b/imc/Resources/preferences-other.png
deleted file mode 100644
index 13395f0..0000000
Binary files a/imc/Resources/preferences-other.png and /dev/null differ
diff --git a/imc/Resources/system-shutdown.png b/imc/Resources/system-shutdown.png
deleted file mode 100644
index 201353e..0000000
Binary files a/imc/Resources/system-shutdown.png and /dev/null differ
diff --git a/imc/Resources/task-accepted.png b/imc/Resources/task-accepted.png
deleted file mode 100644
index 225abbf..0000000
Binary files a/imc/Resources/task-accepted.png and /dev/null differ
diff --git a/imc/Resources/tools-wizard.png b/imc/Resources/tools-wizard.png
deleted file mode 100644
index f67fb4c..0000000
Binary files a/imc/Resources/tools-wizard.png and /dev/null differ
diff --git a/imc/imc.1 b/imc/imc.1
deleted file mode 100644
index e0e6e97..0000000
--- a/imc/imc.1
+++ /dev/null
@@ -1,77 +0,0 @@
-.TH IMC 1 2013-08-12 iTALC
-.SH NAME
-imc \- iTALC Management Console
-.SH SYNOPSIS
-\fBimc\fP [\fIoptions\fP]
-.SH DESCRIPTION
-
-imc is a graphical program to modify the various settings used by italc-client and italc-master.
-
-imc is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems.
-
-Most of the functionality of imc is provided by its graphical user interface however a few things can be changed from the command line as well.
-
-In the paragraphs below, find a short description for each command line option. If you are just getting acquainted with imc, start the program without any options.
-.
-.SH OPTIONS
-.B -l, -ListConfig
-
-The current configuration with all keys and values will be listed. This will give an output like
-   ...
-   Logging/LogLevel=1
-   Network/CoreServerPort=11100
-   Network/DemoServerPort=11400
-   ...
-
-.TP
-.B -s, -SetConfigValue
-
-The value of a configuration property can be changed with this option.
-Examples:
-  imc -s Logging/LogLevel=4
-  imc -SetConfigValue Logging/LogFileDirectory /tmp/italc
-
-.TP
-.B -a, -ApplySettings
-
-You can apply the settings previously saved in a settings file using this command.
-Examples:
-  imc -ApplySettings MyCustomSettings.xml
-
-.TP
-.B -i, -ImportPublicKey
-
-You can import a public key file which has been exported during the installation
-of the iTALC master computer using this command or its abbreviation.
-
-You can omit the the second parameter which specifies the public key file if it
-is located in the directory from which you launch IMC. IMC will automatically
-search for a *.key.txt file. If it finds exactly one, it'll import this one.
-Examples:
-  imc -ImportPublicKey MyPublicKey.key.txt
-  imc -i
-
-.TP
-.B -CreateKeypair <path>
-
-creates a new key pair for the default role (teacher) with the specified "path" as base dir. If "path" is omitted 
-the path is taken from the settings file. This is used in conjunction with role. If role is omitted the default
-role is "teacher".
-
-.TP
-.B -role [supporter|teacher|admin]
-
-in connection with "CreateKeypair" creates a key pair for the specified role.
-
-.PP
-For more information about the imc, point your browser to file:///usr/share/doc/packages/imc or http://italc.sourceforge.net/.
-.SH SEE ALSO
-ica(1), italc(1)
-
-.PP
-.IR http://italc.sf.net/
-
-.SH AUTHOR
-iTALC has been written by Tobias Doerffel. See AUTHORS for details.
-.PP
-This manual page has been written by Frank Schütte and updated by Tobias Doerffel.
diff --git a/imc/imc.qrc b/imc/imc.qrc
deleted file mode 100644
index 6a98e9c..0000000
--- a/imc/imc.qrc
+++ /dev/null
@@ -1,21 +0,0 @@
-<RCC>
-  <qresource prefix="/">
-    <file>Resources/kbugbuster.png</file>
-    <file>Resources/task-accepted.png</file>
-    <file>Resources/preferences-other.png</file>
-    <file>Resources/imc.png</file>
-    <file>Resources/help-hint.png</file>
-    <file>Resources/arrow-right.png</file>
-    <file>Resources/system-shutdown.png</file>
-    <file>Resources/Authentication.png</file>
-    <file>Resources/document-open.png</file>
-    <file>Resources/document-save.png</file>
-    <file>Resources/edit-clear.png</file>
-    <file>Resources/General.png</file>
-    <file>Resources/go-next.png</file>
-    <file>Resources/go-previous.png</file>
-    <file>Resources/Paths.png</file>
-    <file>Resources/tools-wizard.png</file>
-    <file>Resources/Vnc.png</file>
-  </qresource>
-</RCC>
diff --git a/imc/imc.rc b/imc/imc.rc
deleted file mode 100644
index 7beaa04..0000000
--- a/imc/imc.rc
+++ /dev/null
@@ -1,26 +0,0 @@
-imcicon ICON Resources/imc.ico
-#include <windows.h>
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	2,0,2,0
-  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-  FILEOS	VOS_NT_WINDOWS32
-  FILETYPE	VFT_APP
-  FILESUBTYPE	VFT2_UNKNOWN
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, charset = Windows, Multilingual
-    BEGIN
-      VALUE "Comments",		"Intelligent Teaching And Learning with Computers (http://italc.sf.net)\0"
-      VALUE "CompanyName",	"iTALC Solutions\0"
-      VALUE "FileDescription",	"iTALC Management Console\0"
-      VALUE "FileVersion",	"\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2010-2014 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"imc.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"\0"
-    END
-  END
-END
diff --git a/imc/imc.rc.in b/imc/imc.rc.in
deleted file mode 100644
index 8afe1a4..0000000
--- a/imc/imc.rc.in
+++ /dev/null
@@ -1,26 +0,0 @@
-imcicon ICON Resources/imc.ico
-#include <windows.h>
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	2,0,2,0
-  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-  FILEOS	VOS_NT_WINDOWS32
-  FILETYPE	VFT_APP
-  FILESUBTYPE	VFT2_UNKNOWN
-BEGIN
-  BLOCK "StringFileInfo"
-  BEGIN
-    BLOCK "040904E4"
-    //language ID = U.S. English, charset = Windows, Multilingual
-    BEGIN
-      VALUE "Comments",		"Intelligent Teaching And Learning with Computers (http://italc.sf.net)\0"
-      VALUE "CompanyName",	"iTALC Solutions\0"
-      VALUE "FileDescription",	"iTALC Management Console\0"
-      VALUE "FileVersion",	"@PACKAGE_VERSION@\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2010-2014 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"imc.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"@PACKAGE_VERSION@\0"
-    END
-  END
-END
diff --git a/imc/src/FileSystemBrowser.cpp b/imc/src/FileSystemBrowser.cpp
deleted file mode 100644
index a8aa5fa..0000000
--- a/imc/src/FileSystemBrowser.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * FileSystemBrowser.cpp - a wrapper class for easily browsing the file system
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QFileDialog>
-#include <QtGui/QLineEdit>
-
-#include "FileSystemBrowser.h"
-#include "LocalSystem.h"
-
-
-QString FileSystemBrowser::exec( const QString &path,
-									const QString &title,
-									const QString &filter )
-{
-	QString browsePath = path;
-	if( m_expandPath )
-	{
-		browsePath = LocalSystem::Path::expand( browsePath );
-	}
-
-	switch( m_browseMode )
-	{
-		case ExistingDirectory:
-			if( !QFileInfo( browsePath ).isDir() )
-			{
-				browsePath = QDir::homePath();
-			}
-			break;
-		case ExistingFile:
-		case SaveFile:
-			if( QFileInfo( browsePath ).isFile() )
-			{
-				browsePath = QFileInfo( browsePath ).absolutePath();
-			}
-			else
-			{
-				browsePath = QDir::homePath();
-			}
-			break;
-
-		default: break;
-	}
-
-	QString chosenPath;
-	switch( m_browseMode )
-	{
-		case ExistingDirectory:
-			chosenPath = QFileDialog::getExistingDirectory( NULL, title,
-								browsePath,
-		                		QFileDialog::ShowDirsOnly |
-									QFileDialog::DontResolveSymlinks );
-			break;
-		case ExistingFile:
-			chosenPath = QFileDialog::getOpenFileName( NULL, title,
-														browsePath, filter );
-			break;
-		case SaveFile:
-			chosenPath = QFileDialog::getSaveFileName( NULL, title,
-														browsePath, filter );
-			break;
-
-		default: break;
-	}
-
-	if( !chosenPath.isEmpty() )
-	{
-		if( m_shrinkPath )
-		{
-			return LocalSystem::Path::shrink( chosenPath );
-		}
-		return chosenPath;
-	}
-
-	return path;
-}
-
-
-
-void FileSystemBrowser::exec( QLineEdit *lineEdit, const QString &title,
-								const QString & filter )
-{
-	lineEdit->setText( exec( lineEdit->text(), title, filter ) );
-}
-
diff --git a/imc/src/FileSystemBrowser.h b/imc/src/FileSystemBrowser.h
deleted file mode 100644
index 2842ac1..0000000
--- a/imc/src/FileSystemBrowser.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * FileSystemBrowser.h - a wrapper class for easily browsing the file system
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef FILE_SYSTEM_BROWSER_H
-#define FILE_SYSTEM_BROWSER_H
-
-#include <QtCore/QString>
-
-class QLineEdit;
-
-class FileSystemBrowser
-{
-public:
-	enum BrowseModes
-	{
-		ExistingDirectory,
-		ExistingFile,
-		SaveFile,
-		NumBrowseModes
-	} ;
-	typedef BrowseModes BrowseMode;
-
-	FileSystemBrowser( BrowseMode m ) :
-		m_browseMode( m ),
-		m_expandPath( true ),
-		m_shrinkPath( true )
-	{
-	}
-
-	void setExpandPath( bool enabled )
-	{
-		m_expandPath = enabled;
-	}
-
-	void setShrinkPath( bool enabled )
-	{
-		m_shrinkPath = enabled;
-	}
-
-	QString exec( const QString &path, const QString &title = QString(),
-					const QString &filter = QString() );
-	void exec( QLineEdit *lineEdit, const QString &title = QString(),
-					const QString &filter = QString() );
-
-
-private:
-	BrowseMode m_browseMode;
-	bool m_expandPath;
-	bool m_shrinkPath;
-
-} ;
-
-#endif
diff --git a/imc/src/ImcCore.cpp b/imc/src/ImcCore.cpp
deleted file mode 100644
index 1487d98..0000000
--- a/imc/src/ImcCore.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * ImcCore.cpp - global instances for the iTALC Management Console
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QApplication>
-#include <QtGui/QMessageBox>
-
-#include <italcconfig.h>
-
-#include "Configuration/LocalStore.h"
-#include "DsaKey.h"
-#include "ImcCore.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "LogonAclSettings.h"
-#include "MainWindow.h"
-#include "SystemConfigurationModifier.h"
-
-
-namespace ImcCore
-{
-
-// static data initialization
-MainWindow *mainWindow = NULL;
-bool silent = false;
-
-
-static void configApplyError( const QString &msg )
-{
-	criticalMessage( MainWindow::tr( "iTALC Management Console" ), msg );
-}
-
-
-bool applyConfiguration( const ItalcConfiguration &c )
-{
-	// merge configuration
-	*ItalcCore::config += c;
-
-	// do neccessary modifications of system configuration
-	if( !SystemConfigurationModifier::setServiceAutostart(
-									ItalcCore::config->autostartService() ) )
-	{
-		configApplyError(
-			MainWindow::tr( "Could not modify the autostart property "
-										"for the iTALC Service." ) );
-	}
-
-	if( !SystemConfigurationModifier::setServiceArguments(
-									ItalcCore::config->serviceArguments() ) )
-	{
-		configApplyError(
-			MainWindow::tr( "Could not modify the service arguments "
-									"for the iTALC Service." ) );
-	}
-	if( !SystemConfigurationModifier::enableFirewallException(
-							ItalcCore::config->isFirewallExceptionEnabled() ) )
-	{
-		configApplyError(
-			MainWindow::tr( "Could not change the firewall configuration "
-									"for the iTALC Service." ) );
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	ItalcCore::config->removeValue( "LogonACL", "Authentication" );
-
-	// if EncodedLogonACL is empty, nothing is done in setACL()
-	LogonAclSettings().setACL(
-		ItalcCore::config->value( "EncodedLogonACL", "Authentication" ) );
-#endif
-
-	// write global configuration
-	Configuration::LocalStore localStore( Configuration::LocalStore::System );
-	localStore.flush( ItalcCore::config );
-
-	return true;
-}
-
-
-
-
-static void listConfiguration( const ItalcConfiguration::DataMap &map,
-									const QString &parentKey )
-{
-	for( ItalcConfiguration::DataMap::ConstIterator it = map.begin();
-												it != map.end(); ++it )
-	{
-		QString curParentKey = parentKey.isEmpty() ?
-									it.key() : parentKey + "/" + it.key();
-		if( it.value().type() == QVariant::Map )
-		{
-			listConfiguration( it.value().toMap(), curParentKey );
-		}
-		else if( it.value().type() == QVariant::String )
-		{
-			QTextStream( stdout ) << curParentKey << "="
-									<< it.value().toString() << endl;
-		}
-		else
-		{
-			qWarning( "unknown value in configuration data map" );
-		}
-	}
-}
-
-
-
-void listConfiguration( const ItalcConfiguration &config )
-{
-	listConfiguration( config.data(), QString() );
-}
-
-
-
-
-bool createKeyPair( ItalcCore::UserRole role, const QString &destDir )
-{
-	QString priv = LocalSystem::Path::privateKeyPath( role, destDir );
-	QString pub = LocalSystem::Path::publicKeyPath( role, destDir );
-	LogStream() << "ImcCore: creating new key pair in" << priv << "and" << pub;
-
-	PrivateDSAKey pkey( 1024 );
-	if( !pkey.isValid() )
-	{
-		ilog_failed( "key generation" );
-		return false;
-	}
-	if( !pkey.save( priv ) )
-	{
-		ilog_failed( "saving private key" );
-		return false;
-	}
-
-	if( !PublicDSAKey( pkey ).save( pub ) )
-	{
-		ilog_failed( "saving public key" );
-		return false;
-	}
-
-	printf( "...done, saved key-pair in\n\n%s\n\nand\n\n%s",
-						priv.toUtf8().constData(),
-						pub.toUtf8().constData() );
-	printf( "\n\n\nFor now the file is only readable by "
-				"root and members of group root (if you\n"
-				"didn't ran this command as non-root).\n"
-				"I suggest changing the ownership of the "
-				"private key so that the file is\nreadable "
-				"by all members of a special group to which "
-				"all users belong who are\nallowed to use "
-				"iTALC.\n\n\n" );
-	return true;
-}
-
-
-
-
-bool importPublicKey( ItalcCore::UserRole role,
-							const QString &pubKey, const QString &destDir )
-{
-	// look whether the public key file is valid
-	PublicDSAKey dsaKey( pubKey );
-	if( !dsaKey.isValid() )
-	{
-		qCritical() << "ImcCore::importPublicKey(): file" << pubKey
-					<< "is not a valid public key file";
-		return false;
-	}
-
-	QString pub = LocalSystem::Path::publicKeyPath( role, destDir );
-	QFile destFile( pub );
-	if( destFile.exists() )
-	{
-		destFile.setPermissions( QFile::WriteOwner );
-		if( !destFile.remove() )
-		{
-			qCritical() << "ImcCore::importPublicKey(): could not remove "
-							"existing public key file" << destFile.fileName();
-			return false;
-		}
-	}
-
-	// now try to copy it
-	return dsaKey.save( pub );
-}
-
-
-
-QString icaFilePath()
-{
-	QString path = QCoreApplication::applicationDirPath() + QDir::separator() + "ica";
-#ifdef ITALC_BUILD_WIN32
-	path += ".exe";
-#endif
-	return QDTNS( path );
-}
-
-
-
-
-void informationMessage( const QString &title, const QString &msg )
-{
-	LogStream( Logger::LogLevelInfo ) << title.toUtf8().constData()
-								<< ":" << msg.toUtf8().constData();
-	if( QApplication::type() != QApplication::Tty && !silent )
-	{
-		QMessageBox::information( NULL, title, msg );
-	}
-}
-
-
-
-void criticalMessage( const QString &title, const QString &msg )
-{
-	LogStream( Logger::LogLevelCritical ) << title.toUtf8().constData()
-								<< ":" << msg.toUtf8().constData();
-	if( QApplication::type() != QApplication::Tty && !silent )
-	{
-		QMessageBox::critical( NULL, title, msg );
-	}
-}
-
-
-
-}
-
-
diff --git a/imc/src/ImcCore.h b/imc/src/ImcCore.h
deleted file mode 100644
index 0a59bb6..0000000
--- a/imc/src/ImcCore.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * ImcCore.h - global instances for the iTALC Management Console
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef IMC_CORE_H
-#define IMC_CORE_H
-
-#include <QtCore/QDir>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QString>
-
-#include "ItalcCore.h"
-
-class ItalcConfiguration;
-class MainWindow;
-
-namespace ImcCore
-{
-	bool applyConfiguration( const ItalcConfiguration &config );
-	void listConfiguration( const ItalcConfiguration &config );
-
-	bool createKeyPair( ItalcCore::UserRole role, const QString &destDir );
-	bool importPublicKey( ItalcCore::UserRole role,
-							const QString &pubKey, const QString &destDir );
-
-	QString icaFilePath();
-
-	void informationMessage( const QString &title, const QString &msg );
-	void criticalMessage( const QString &title, const QString &msg );
-
-	extern bool silent;
-
-	// UI objects
-	extern MainWindow * mainWindow;
-
-} ;
-
-
-#endif
diff --git a/imc/src/KeyDirectoriesPage.cpp b/imc/src/KeyDirectoriesPage.cpp
deleted file mode 100644
index 27eb4d4..0000000
--- a/imc/src/KeyDirectoriesPage.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * KeyDirectoriesPage.cpp - QWizardPage for key directory selection
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QFileInfo>
-
-#include "KeyFileAssistant.h"
-#include "KeyDirectoriesPage.h"
-#include "LocalSystem.h"
-#include "ui_KeyFileAssistant.h"
-
-
-KeyDirectoriesPage::KeyDirectoriesPage() :
-	QWizardPage(),
-	m_ui( NULL )
-{
-}
-
-
-
-void KeyDirectoriesPage::setUi( Ui::KeyFileAssistant *ui )
-{
-	m_ui = ui;
-
-	connect( m_ui->exportPublicKey, SIGNAL( toggled( bool ) ),
-				this, SIGNAL( completeChanged() ) );
-	connect( m_ui->publicKeyDir, SIGNAL( textChanged( const QString & ) ),
-				this, SIGNAL( completeChanged() ) );
-	connect( m_ui->useCustomDestDir, SIGNAL( toggled( bool ) ),
-				this, SIGNAL( completeChanged() ) );
-	connect( m_ui->destDirEdit, SIGNAL( textChanged( const QString & ) ),
-				this, SIGNAL( completeChanged() ) );
-}
-
-
-
-bool KeyDirectoriesPage::isComplete() const
-{
-	if( !m_ui )
-	{
-		return false;
-	}
-	if ( m_ui->modeCreateKeys->isChecked() &&
-			m_ui->exportPublicKey->isChecked() )
-	{
-		if( m_ui->publicKeyDir->text().isEmpty() ||
-				!QFileInfo( LocalSystem::Path::expand(
-									m_ui->publicKeyDir->text() ) ).isDir() )
-		{
-			return false;
-		}
-	}
-	else if( m_ui->modeImportPublicKey->isChecked() )
-	{
-		if( m_ui->publicKeyDir->text().isEmpty() ||
-				!QFileInfo( LocalSystem::Path::expand(
-									m_ui->publicKeyDir->text() ) ).isFile() )
-		{
-			return false;
-		}
-	}
-
-	if( m_ui->useCustomDestDir->isChecked() )
-	{
-		if( m_ui->destDirEdit->text().isEmpty() ||
-				!QFileInfo( LocalSystem::Path::expand(
-									m_ui->destDirEdit->text() ) ).isDir() )
-		{
-			return false;
-		}
-	}
-
-	return true;
-}
-
-
diff --git a/imc/src/KeyDirectoriesPage.h b/imc/src/KeyDirectoriesPage.h
deleted file mode 100644
index a4a87c2..0000000
--- a/imc/src/KeyDirectoriesPage.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * KeyDirectoriesPage.h - QWizardPage for key directory selection
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef KEY_DIRECTORIES_PAGE_H
-#define KEY_DIRECTORIES_PAGE_H
-
-#include <QtGui/QWizardPage>
-
-namespace Ui { class KeyFileAssistant; }
-
-class KeyDirectoriesPage : public QWizardPage
-{
-	Q_OBJECT
-public:
-	KeyDirectoriesPage();
-	virtual ~KeyDirectoriesPage()
-	{
-	}
-
-	void setUi( Ui::KeyFileAssistant *ui );
-	virtual bool isComplete() const;
-
-
-private:
-	Ui::KeyFileAssistant *m_ui;
-
-} ;
-
-#endif
diff --git a/imc/src/KeyFileAssistant.cpp b/imc/src/KeyFileAssistant.cpp
deleted file mode 100644
index a6fecfa..0000000
--- a/imc/src/KeyFileAssistant.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * KeyFileAssistant.cpp - a wizard assisting in managing key files
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QDir>
-#include <QtGui/QMessageBox>
-
-#include "KeyFileAssistant.h"
-#include "DsaKey.h"
-#include "FileSystemBrowser.h"
-#include "ImcCore.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "ui_KeyFileAssistant.h"
-
-
-KeyFileAssistant::KeyFileAssistant() :
-	QWizard(),
-	m_ui( new Ui::KeyFileAssistant )
-{
-	m_ui->setupUi( this );
-
-	m_ui->assistantModePage->setUi( m_ui );
-	m_ui->directoriesPage->setUi( m_ui );
-
-	// init destination directory line edit
-	QDir d( LocalSystem::Path::expand( ItalcCore::config->privateKeyBaseDir() ) );
-	d.cdUp();
-	m_ui->destDirEdit->setText( QDTNS( d.absolutePath() ) );
-
-	connect( m_ui->openDestDir, SIGNAL( clicked() ),
-				this, SLOT( openDestDir() ) );
-
-	connect( m_ui->openPubKeyDir, SIGNAL( clicked() ),
-				this, SLOT( openPubKeyDir() ) );
-}
-
-
-
-KeyFileAssistant::~KeyFileAssistant()
-{
-}
-
-
-
-
-void KeyFileAssistant::openPubKeyDir()
-{
-	if( m_ui->modeCreateKeys->isChecked() )
-	{
-		FileSystemBrowser b( FileSystemBrowser::ExistingDirectory );
-		b.setShrinkPath( false );
-		b.exec( m_ui->publicKeyDir,
-				tr( "Select directory in which to export the public key" ) );
-	}
-	else if( m_ui->modeImportPublicKey->isChecked() )
-	{
-		QString origPath = m_ui->publicKeyDir->text();
-
-		FileSystemBrowser b( FileSystemBrowser::ExistingFile );
-		b.setShrinkPath( false );
-		b.exec( m_ui->publicKeyDir,
-				tr( "Select directory in which to export the public key" ),
-				tr( "Key files (*.key.txt)" ) );
-
-		if( !PublicDSAKey( m_ui->publicKeyDir->text() ).isValid() )
-		{
-			m_ui->publicKeyDir->setText( origPath );
-			QMessageBox::critical( this, tr( "Invalid public key" ),
-					tr( "The selected file does not contain a valid public "
-						"iTALC access key!" ) );
-		}
-	}
-}
-
-
-
-
-void KeyFileAssistant::openDestDir()
-{
-	FileSystemBrowser b( FileSystemBrowser::ExistingDirectory );
-	b.setShrinkPath( false );
-	b.exec( m_ui->destDirEdit, tr( "Select destination directory" ) );
-}
-
-
-
-
-void KeyFileAssistant::accept()
-{
-	ItalcCore::UserRole role =
-			static_cast<ItalcCore::UserRole>(
-					m_ui->userRole->currentIndex() + ItalcCore::RoleTeacher );
-
-	QString destDir;
-	if( m_ui->useCustomDestDir->isChecked() ||
-				// trap the case public and private key path are equal
-				LocalSystem::Path::publicKeyPath( role ) ==
-					LocalSystem::Path::privateKeyPath( role ) )
-	{
-		destDir = m_ui->destDirEdit->text();
-	}
-
-	if( m_ui->modeCreateKeys->isChecked() )
-	{
-		if( ImcCore::createKeyPair( role, destDir ) )
-		{
-			if( m_ui->exportPublicKey->isChecked() )
-			{
-				QFile src( LocalSystem::Path::publicKeyPath( role, destDir ) );
-				QFile dst( QDTNS( m_ui->publicKeyDir->text() +
-										"/italc_public_key.key.txt" ) );
-				if( dst.exists() )
-				{
-					dst.setPermissions( QFile::WriteOwner );
-					if( !dst.remove() )
-					{
-						QMessageBox::critical( this, tr( "Access key creation" ),
-							tr( "Could not remove previously existing file %1." ).
-								arg( dst.fileName() ) );
-						return;
-					}
-				}
-				if( !src.copy( dst.fileName() ) )
-				{
-					QMessageBox::critical( this, tr( "Access key creation" ),
-							tr( "Failed exporting public access key from %1 to %2." ).
-								arg( src.fileName() ).arg( dst.fileName() ) );
-					return;
-				}
-			}
-			QMessageBox::information( this, tr( "Access key creation" ),
-				tr( "Access keys were created and written successfully to %1 and %2." ).
-					arg( LocalSystem::Path::privateKeyPath( role, destDir ) ).
-					arg( LocalSystem::Path::publicKeyPath( role, destDir ) ) );
-		}
-		else
-		{
-			QMessageBox::critical( this, tr( "Access key creation" ),
-					tr( "An error occured while creating the access keys. "
-						"You probably are not permitted to write to the "
-						"selected directories." ) );
-			return;
-		}
-
-	}
-	else if( m_ui->modeImportPublicKey->isChecked() )
-	{
-		if( !ImcCore::importPublicKey( role, m_ui->publicKeyDir->text(), destDir ) )
-		{
-			QMessageBox::critical( this, tr( "Public key import" ),
-					tr( "An error occured while importing the public access "
-						"key. You probably are not permitted to read the "
-						"source key or to write the destination file." ) );
-			return;
-		}
-		QMessageBox::information( this, tr( "Public key import" ),
-				tr( "The public key was successfully imported to %1." ).
-					arg( LocalSystem::Path::publicKeyPath( role, destDir ) ) );
-	}
-
-	QWizard::accept();
-}
-
diff --git a/imc/src/KeyFileAssistant.h b/imc/src/KeyFileAssistant.h
deleted file mode 100644
index ca15f6a..0000000
--- a/imc/src/KeyFileAssistant.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * KeyFileAssistant.h - a wizard assisting in managing key files
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef KEY_FILE_ASSISTANT_H
-#define KEY_FILE_ASSISTANT_H
-
-#include <QtGui/QWizard>
-
-namespace Ui { class KeyFileAssistant; }
-
-class KeyFileAssistant : public QWizard
-{
-	Q_OBJECT
-public:
-	KeyFileAssistant();
-	virtual ~KeyFileAssistant();
-
-
-private slots:
-	void openPubKeyDir();
-	void openDestDir();
-
-
-private:
-	virtual void accept();
-
-	Ui::KeyFileAssistant *m_ui;
-
-} ;
-
-#endif
diff --git a/imc/src/KeyFileAssistantModePage.cpp b/imc/src/KeyFileAssistantModePage.cpp
deleted file mode 100644
index 09a712b..0000000
--- a/imc/src/KeyFileAssistantModePage.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * KeyFileAssistantModePage.cpp - QWizardPage for assistant mode selection
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtGui/QButtonGroup>
-
-#include "KeyFileAssistant.h"
-#include "KeyFileAssistantModePage.h"
-#include "ui_KeyFileAssistant.h"
-
-
-KeyFileAssistantModePage::KeyFileAssistantModePage() :
-	QWizardPage(),
-	m_modeButtonGroup( NULL )
-{
-}
-
-
-
-void KeyFileAssistantModePage::setUi( Ui::KeyFileAssistant *ui )
-{
-	m_modeButtonGroup = ui->assistantModeButtonGroup;
-	connect( m_modeButtonGroup, SIGNAL( buttonClicked( int ) ),
-					this, SIGNAL( completeChanged() ) );
-}
-
-
-
-bool KeyFileAssistantModePage::isComplete() const
-{
-	return m_modeButtonGroup && m_modeButtonGroup->checkedButton() != NULL;
-}
-
-
diff --git a/imc/src/KeyFileAssistantModePage.h b/imc/src/KeyFileAssistantModePage.h
deleted file mode 100644
index ec6a9b2..0000000
--- a/imc/src/KeyFileAssistantModePage.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * KeyFileAssistantModePage.h - QWizardPage for assistant mode selection
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef KEY_FILE_ASSISTANT_MODE_PAGE_H
-#define KEY_FILE_ASSISTANT_MODE_PAGE_H
-
-#include <QtGui/QWizardPage>
-
-class QButtonGroup;
-namespace Ui { class KeyFileAssistant; }
-
-class KeyFileAssistantModePage : public QWizardPage
-{
-	Q_OBJECT
-public:
-	KeyFileAssistantModePage();
-	virtual ~KeyFileAssistantModePage()
-	{
-	}
-
-	void setUi( Ui::KeyFileAssistant *ui );
-	virtual bool isComplete() const;
-
-
-private:
-	QButtonGroup *m_modeButtonGroup;
-
-} ;
-
-#endif
diff --git a/imc/src/LogonAclSettings.h b/imc/src/LogonAclSettings.h
deleted file mode 100644
index c2f8fdd..0000000
--- a/imc/src/LogonAclSettings.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * LogonAclSettings.h - helper class for reading and setting logon ACLs
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef LOGON_ACL_SETTINGS_H
-#define LOGON_ACL_SETTINGS_H
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-
-#include <windows.h>
-
-#include <QtCore/QByteArray>
-
-class LogonAclSettings
-{
-public:
-	LogonAclSettings()
-	{
-	}
-
-	QString acl() const
-	{
-		HKEY hk = NULL;
-		QString r;
-		if( RegOpenKeyEx( HKEY_LOCAL_MACHINE,
-							"Software\\iTALC Solutions\\iTALC\\Authentication",
-							0, KEY_QUERY_VALUE, &hk ) != ERROR_SUCCESS )
-		{
-			qCritical( "Could not open ACL key for reading" );
-			return r;
-		}
-
-		DWORD buflen;
-		if( RegQueryValueEx( hk, "LogonACL", 0, 0, NULL, &buflen ) != ERROR_SUCCESS )
-		{
-			qCritical( "Could not read ACL key" );
-			RegCloseKey( hk );
-			return r;
-		}
-
-		BYTE *data = new BYTE[buflen];
-		if( RegQueryValueEx( hk, "LogonACL", 0, 0, data, &buflen ) == ERROR_SUCCESS )
-		{
-			r = QByteArray( (const char *) data, buflen ).toBase64();
-		}
-		else
-		{
-			qCritical( "Could not read ACL key" );
-		}
-
-		RegCloseKey( hk );
-		delete[] data;
-
-		return r;
-	}
-
-	void setACL( const QString &base64ACL )
-	{
-		if( base64ACL.isEmpty() )
-		{
-			return;
-		}
-
-		QByteArray d = QByteArray::fromBase64( base64ACL.toAscii() );
-		HKEY hk = NULL;
-		if( RegOpenKeyEx( HKEY_LOCAL_MACHINE,
-							"Software\\iTALC Solutions\\iTALC\\Authentication",
-							0, KEY_SET_VALUE, &hk ) != ERROR_SUCCESS )
-		{
-			qCritical( "Could not open ACL key for writing" );
-			return;
-		}
-
-		if( RegSetValueEx( hk, "LogonACL", 0, REG_BINARY, (LPBYTE) d.constData(),
-							d.size() ) != ERROR_SUCCESS )
-		{
-			qCritical( "Could not set ACL key" );
-		}
-
-		RegCloseKey( hk );
-	}
-
-} ;
-
-#endif
-
-#endif
diff --git a/imc/src/LogonGroupEditor.cpp b/imc/src/LogonGroupEditor.cpp
deleted file mode 100644
index d24ebfe..0000000
--- a/imc/src/LogonGroupEditor.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * LogonGroupEditor.cpp - a dialog for editing logon groups
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QProcess>
-
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "LogonGroupEditor.h"
-
-#include "ui_LogonGroupEditor.h"
-
-
-
-LogonGroupEditor::LogonGroupEditor( QWidget *parent ) :
-	QDialog( parent ),
-	ui( new Ui::LogonGroupEditor ),
-	m_logonGroups( ItalcCore::config->logonGroups() )
-{
-	ui->setupUi( this );
-
-	updateLogonGroupsUI();
-}
-
-
-
-
-LogonGroupEditor::~LogonGroupEditor()
-{
-}
-
-
-
-
-void LogonGroupEditor::accept()
-{
-	ItalcCore::config->setLogonGroups( m_logonGroups );
-	QDialog::accept();
-}
-
-
-
-
-void LogonGroupEditor::addLogonGroup()
-{
-	foreach( QListWidgetItem *item, ui->allGroups->selectedItems() )
-	{
-		m_logonGroups.removeAll( item->text() );
-		m_logonGroups += item->text();
-	}
-	m_logonGroups.removeAll( "" );
-
-	updateLogonGroupsUI();
-}
-
-
-
-
-void LogonGroupEditor::removeLogonGroup()
-{
-	foreach( QListWidgetItem *item, ui->logonGroups->selectedItems() )
-	{
-		m_logonGroups.removeAll( item->text() );
-	}
-	m_logonGroups.removeAll( "" );
-
-	updateLogonGroupsUI();
-}
-
-
-
-
-void LogonGroupEditor::updateLogonGroupsUI()
-{
-	QStringList groupNames;
-#ifdef ITALC_BUILD_LINUX
-	QProcess p;
-	p.start( "getent", QStringList() << "group" );
-	p.waitForFinished();
-
-	QStringList groups = QString( p.readAll() ).split( '\n' );
-	foreach( const QString &group, groups )
-	{
-		groupNames += group.split( ':' ).first();
-	}
-	static const char *ignoredGroups[] = {
-		"root",
-		"daemon",
-		"bin",
-		"tty",
-		"disk",
-		"lp",
-		"mail",
-		"news",
-		"uucp",
-		"man",
-		"proxy",
-		"kmem",
-		"dialout",
-		"fax",
-		"voice",
-		"cdrom",
-		"tape",
-		"audio",
-		"dip",
-		"www-data",
-		"backup",
-		"list",
-		"irc",
-		"src",
-		"gnats",
-		"shadow",
-		"utmp",
-		"video",
-		"sasl",
-		"plugdev",
-		"games",
-		"users",
-		"nogroup",
-		"libuuid",
-		"syslog",
-		"fuse",
-		"lpadmin",
-		"ssl-cert",
-		"messagebus",
-		"crontab",
-		"mlocate",
-		"avahi-autoipd",
-		"netdev",
-		"saned",
-		"sambashare",
-		"haldaemon",
-		"polkituser",
-		"mysql",
-		"avahi",
-		"klog",
-		"floppy",
-		"oprofile",
-		"netdev",
-		"dirmngr",
-		"vboxusers",
-		"",
-		NULL };
-	for( int i = 0; ignoredGroups[i] != NULL; ++i )
-	{
-		groupNames.removeAll( ignoredGroups[i] );
-	}
-#endif
-
-	ui->logonGroups->setUpdatesEnabled( false );
-
-	ui->allGroups->clear();
-	ui->logonGroups->clear();
-
-	const QStringList logonGroups = m_logonGroups;
-	foreach( const QString &g, groupNames )
-	{
-		if( logonGroups.contains( g ) )
-		{
-			ui->logonGroups->addItem( g );
-		}
-		else
-		{
-			ui->allGroups->addItem( g );
-		}
-	}
-
-	ui->logonGroups->setUpdatesEnabled( true );
-}
-
diff --git a/imc/src/LogonGroupEditor.h b/imc/src/LogonGroupEditor.h
deleted file mode 100644
index c5a831b..0000000
--- a/imc/src/LogonGroupEditor.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * LogonGroupEditor.h - a dialog for editing logon groups
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef LOGON_GROUP_EDITOR_H
-#define LOGON_GROUP_EDITOR_H
-
-#include <QtGui/QDialog>
-
-namespace Ui { class LogonGroupEditor; } ;
-
-class LogonGroupEditor : public QDialog
-{
-	Q_OBJECT
-public:
-	LogonGroupEditor( QWidget *parent );
-	virtual ~LogonGroupEditor();
-
-	virtual void accept();
-
-
-private slots:
-	void addLogonGroup();
-	void removeLogonGroup();
-
-
-private:
-	void updateLogonGroupsUI();
-
-	Ui::LogonGroupEditor *ui;
-
-	QStringList m_logonGroups;
-
-} ;
-
-#endif
diff --git a/imc/src/MainWindow.cpp b/imc/src/MainWindow.cpp
deleted file mode 100644
index 80ada0a..0000000
--- a/imc/src/MainWindow.cpp
+++ /dev/null
@@ -1,676 +0,0 @@
-/*
- * MainWindow.cpp - implementation of MainWindow class
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-void Win32AclEditor( HWND hwnd );
-#endif
-
-#include <QtCore/QDir>
-#include <QtCore/QProcess>
-#include <QtCore/QTimer>
-#include <QtGui/QCloseEvent>
-#include <QtGui/QFileDialog>
-#include <QtGui/QMessageBox>
-#include <QtGui/QProgressBar>
-#include <QtGui/QProgressDialog>
-
-#include "Configuration/XmlStore.h"
-#include "Configuration/UiMapping.h"
-
-#include "AboutDialog.h"
-#include "KeyFileAssistant.h"
-#include "FileSystemBrowser.h"
-#include "ImcCore.h"
-#include "ItalcConfiguration.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "LogonAclSettings.h"
-#include "LogonAuthentication.h"
-#include "LogonGroupEditor.h"
-#include "MainWindow.h"
-#include "PasswordDialog.h"
-
-#include "ui_MainWindow.h"
-
-
-
-MainWindow::MainWindow() :
-	QMainWindow(),
-	ui( new Ui::MainWindow ),
-	m_configChanged( false )
-{
-	ui->setupUi( this );
-
-	setWindowTitle( tr( "iTALC Management Console %1" ).arg( ITALC_VERSION ) );
-
-	// reset all widget's values to current configuration
-	reset();
-
-	// if local configuration is incomplete, re-enable the apply button
-	if( ItalcConfiguration(
-			Configuration::Store::LocalBackend ).data().size() <
-										ItalcCore::config->data().size() )
-	{
-		configurationChanged();
-	}
-
-	// connect widget signals to configuration property write methods
-	FOREACH_ITALC_CONFIG_PROPERTY(CONNECT_WIDGET_TO_PROPERTY)
-
-#define CONNECT_BUTTON_SLOT(name) \
-			connect( ui->name, SIGNAL( clicked() ), this, SLOT( name() ) );
-
-	CONNECT_BUTTON_SLOT( startService );
-	CONNECT_BUTTON_SLOT( stopService );
-
-	CONNECT_BUTTON_SLOT( openLogFileDirectory );
-	CONNECT_BUTTON_SLOT( clearLogFiles );
-
-	CONNECT_BUTTON_SLOT( openGlobalConfig );
-	CONNECT_BUTTON_SLOT( openPersonalConfig );
-	CONNECT_BUTTON_SLOT( openSnapshotDirectory );
-
-	CONNECT_BUTTON_SLOT( openPublicKeyBaseDir );
-	CONNECT_BUTTON_SLOT( openPrivateKeyBaseDir );
-
-	CONNECT_BUTTON_SLOT( launchKeyFileAssistant );
-	CONNECT_BUTTON_SLOT( manageACLs );
-	CONNECT_BUTTON_SLOT( testLogonAuthentication );
-
-	CONNECT_BUTTON_SLOT( generateBugReportArchive );
-
-	connect( ui->buttonBox, SIGNAL( clicked( QAbstractButton * ) ),
-				this, SLOT( resetOrApply( QAbstractButton * ) ) );
-
-	connect( ui->actionLoadSettings, SIGNAL( triggered() ),
-				this, SLOT( loadSettingsFromFile() ) );
-	connect( ui->actionSaveSettings, SIGNAL( triggered() ),
-				this, SLOT( saveSettingsToFile() ) );
-
-	connect( ui->actionAboutQt, SIGNAL( triggered() ),
-				QApplication::instance(), SLOT( aboutQt() ) );
-
-	updateServiceControl();
-
-	QTimer *serviceUpdateTimer = new QTimer( this );
-	serviceUpdateTimer->start( 2000 );
-
-	connect( serviceUpdateTimer, SIGNAL( timeout() ),
-				this, SLOT( updateServiceControl() ) );
-
-	connect( ItalcCore::config, SIGNAL( configurationChanged() ),
-				this, SLOT( configurationChanged() ) );
-
-#ifndef ITALC_BUILD_WIN32
-	ui->logToWindowsEventLog->hide();
-#endif
-}
-
-
-
-
-MainWindow::~MainWindow()
-{
-}
-
-
-
-void MainWindow::reset( bool onlyUI )
-{
-	if( onlyUI == false )
-	{
-		ItalcCore::config->clear();
-		*ItalcCore::config += ItalcConfiguration::defaultConfiguration();
-		*ItalcCore::config += ItalcConfiguration( Configuration::Store::LocalBackend );
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	// always make sure we do not have a LogonACL string in our config
-	ItalcCore::config->removeValue( "LogonACL", "Authentication" );
-
-	// revert LogonACL to what has been saved in the encoded logon ACL
-	LogonAclSettings().setACL(
-		ItalcCore::config->value( "EncodedLogonACL", "Authentication" ) );
-#endif
-
-	FOREACH_ITALC_CONFIG_PROPERTY(INIT_WIDGET_FROM_PROPERTY)
-
-	ui->buttonBox->setEnabled( false );
-	m_configChanged = false;
-}
-
-
-
-
-void MainWindow::apply()
-{
-#ifdef ITALC_BUILD_WIN32
-	ItalcCore::config->setValue( "EncodedLogonACL", LogonAclSettings().acl(),
-															"Authentication" );
-#endif
-	if( ImcCore::applyConfiguration( *ItalcCore::config ) )
-	{
-#ifdef ITALC_BUILD_WIN32
-		if( isServiceRunning() &&
-			QMessageBox::question( this, tr( "Restart iTALC Service" ),
-				tr( "All settings were saved successfully. In order to take "
-					"effect the iTALC service needs to be restarted. "
-					"Restart it now?" ), QMessageBox::Yes | QMessageBox::No,
-				QMessageBox::Yes ) == QMessageBox::Yes )
-		{
-			stopService();
-			startService();
-		}
-#endif
-		ui->buttonBox->setEnabled( false );
-		m_configChanged = false;
-	}
-}
-
-
-
-
-void MainWindow::configurationChanged()
-{
-	ui->buttonBox->setEnabled( true );
-	m_configChanged = true;
-}
-
-
-
-
-void MainWindow::resetOrApply( QAbstractButton *btn )
-{
-	if( ui->buttonBox->standardButton( btn ) & QDialogButtonBox::Apply )
-	{
-		apply();
-	}
-	else if( ui->buttonBox->standardButton( btn ) & QDialogButtonBox::Reset )
-	{
-		reset();
-	}
-}
-
-
-
-
-void MainWindow::startService()
-{
-	serviceControlWithProgressBar( tr( "Starting iTALC service" ), "-startservice" );
-}
-
-
-
-
-void MainWindow::stopService()
-{
-	serviceControlWithProgressBar( tr( "Stopping iTALC service" ), "-stopservice" );
-}
-
-
-
-
-void MainWindow::updateServiceControl()
-{
-	bool running = isServiceRunning();
-#ifdef ITALC_BUILD_WIN32
-	ui->startService->setEnabled( !running );
-	ui->stopService->setEnabled( running );
-#else
-	ui->startService->setEnabled( false );
-	ui->stopService->setEnabled( false );
-#endif
-	ui->serviceState->setText( running ? tr( "Running" ) : tr( "Stopped" ) );
-}
-
-
-
-
-void MainWindow::openLogFileDirectory()
-{
-	FileSystemBrowser( FileSystemBrowser::ExistingDirectory ).
-												exec( ui->logFileDirectory );
-}
-
-
-
-
-void MainWindow::clearLogFiles()
-{
-#ifdef ITALC_BUILD_WIN32
-	bool stopped = false;
-	if( isServiceRunning() )
-	{
-		if( QMessageBox::question( this, tr( "iTALC Service" ),
-				tr( "The iTALC service needs to be stopped temporarily "
-					"in order to remove the log files. Continue?"
-					), QMessageBox::Yes | QMessageBox::No,
-				QMessageBox::Yes ) == QMessageBox::Yes )
-		{
-			stopService();
-			stopped = true;
-		}
-		else
-		{
-			return;
-		}
-	}
-#endif
-
-	bool success = true;
-	QDir d( LocalSystem::Path::expand( ItalcCore::config->logFileDirectory() ) );
-	foreach( const QString &f, d.entryList( QStringList() << "Italc*.log" ) )
-	{
-		if( f != "ItalcManagementConsole.log" )
-		{
-			success &= d.remove( f );
-		}
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	d = QDir( "C:\\Windows\\Temp" );
-#else
-	d = QDir( "/tmp" );
-#endif
-
-	foreach( const QString &f, d.entryList( QStringList() << "Italc*.log" ) )
-	{
-		if( f != "ItalcManagementConsole.log" )
-		{
-			success &= d.remove( f );
-		}
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	if( stopped )
-	{
-		startService();
-	}
-#endif
-
-	if( success )
-	{
-		QMessageBox::information( this, tr( "Log files cleared" ),
-			tr( "All log files were cleared successfully." ) );
-	}
-	else
-	{
-		QMessageBox::critical( this, tr( "Error" ),
-			tr( "Could not remove all log files." ) );
-	}
-}
-
-
-
-
-void MainWindow::openGlobalConfig()
-{
-	FileSystemBrowser( FileSystemBrowser::ExistingFile ).
-										exec( ui->globalConfigurationPath );
-}
-
-
-
-
-void MainWindow::openPersonalConfig()
-{
-	FileSystemBrowser( FileSystemBrowser::ExistingFile ).
-										exec( ui->personalConfigurationPath );
-}
-
-
-
-
-void MainWindow::openSnapshotDirectory()
-{
-	FileSystemBrowser( FileSystemBrowser::ExistingDirectory ).
-												exec( ui->snapshotDirectory );
-}
-
-
-
-
-void MainWindow::openPublicKeyBaseDir()
-{
-	FileSystemBrowser( FileSystemBrowser::ExistingDirectory ).
-												exec( ui->publicKeyBaseDir );
-}
-
-
-
-
-void MainWindow::openPrivateKeyBaseDir()
-{
-	FileSystemBrowser( FileSystemBrowser::ExistingDirectory ).
-												exec( ui->privateKeyBaseDir );
-}
-
-
-
-
-void MainWindow::loadSettingsFromFile()
-{
-	QString fileName = QFileDialog::getOpenFileName( this, tr( "Load settings from file" ),
-											QDir::homePath(), tr( "XML files (*.xml)" ) );
-	if( !fileName.isEmpty() )
-	{
-		// write current configuration to output file
-		Configuration::XmlStore( Configuration::XmlStore::System,
-										fileName ).load( ItalcCore::config );
-		reset( true );
-		configurationChanged();	// give user a chance to apply possible changes
-	}
-}
-
-
-
-
-void MainWindow::saveSettingsToFile()
-{
-	QString fileName = QFileDialog::getSaveFileName( this, tr( "Save settings to file" ),
-											QDir::homePath(), tr( "XML files (*.xml)" ) );
-	if( !fileName.isEmpty() )
-	{
-		if( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) )
-		{
-			fileName += ".xml";
-		}
-
-		bool configChangedPrevious = m_configChanged;
-
-#ifdef ITALC_BUILD_WIN32
-		ItalcCore::config->removeValue( "LogonACL", "Authentication" );
-		ItalcCore::config->setValue( "EncodedLogonACL",
-								LogonAclSettings().acl(), "Authentication" );
-#endif
-
-		// write current configuration to output file
-		Configuration::XmlStore( Configuration::XmlStore::System,
-										fileName ).flush( ItalcCore::config );
-
-		m_configChanged = configChangedPrevious;
-		ui->buttonBox->setEnabled( m_configChanged );
-	}
-}
-
-
-
-
-void MainWindow::launchKeyFileAssistant()
-{
-	KeyFileAssistant().exec();
-}
-
-
-
-
-void MainWindow::manageACLs()
-{
-#ifdef ITALC_BUILD_WIN32
-	Win32AclEditor( winId() );
-
-	if( LogonAclSettings().acl() !=
-				ItalcCore::config->value( "EncodedLogonACL", "Authentication" ) )
-	{
-		configurationChanged();
-	}
-#else
-	LogonGroupEditor( this ).exec();
-#endif
-}
-
-
-
-
-void MainWindow::testLogonAuthentication()
-{
-	PasswordDialog dlg( this );
-	if( dlg.exec() )
-	{
-		bool result = LogonAuthentication::authenticateUser( dlg.credentials() );
-		if( result )
-		{
-			QMessageBox::information( this, tr( "Logon authentication test" ),
-							tr( "Authentication with provided credentials "
-								"was successful." ) );
-		}
-		else
-		{
-			QMessageBox::critical( this, tr( "Logon authentication test" ),
-							tr( "Authentication with provided credentials "
-								"failed!" ) );
-		}
-	}
-}
-
-
-
-
-void MainWindow::generateBugReportArchive()
-{
-	FileSystemBrowser fsb( FileSystemBrowser::SaveFile );
-	fsb.setShrinkPath( false );
-	fsb.setExpandPath( false );
-	QString outfile = fsb.exec( QDir::homePath(),
-								tr( "Save bug report archive" ),
-								tr( "iTALC bug report archive (*.ibra.xml)" ) );
-	if( outfile.isEmpty() )
-	{
-		return;
-	}
-
-	if( !outfile.endsWith( ".ibra.xml" ) )
-	{
-		outfile += ".ibra.xml";
-	}
-
-	Configuration::XmlStore bugReportXML(
-							Configuration::Store::BugReportArchive, outfile );
-	Configuration::Object obj( &bugReportXML );
-
-
-	// retrieve some basic system information
-
-#ifdef ITALC_BUILD_WIN32
-
-	OSVERSIONINFOEX ovi;
-	ovi.dwOSVersionInfoSize = sizeof( ovi );
-	GetVersionEx( (LPOSVERSIONINFO) &ovi );
-
-	QString os = "Windows %1 SP%2 (%3.%4.%5)";
-	switch( QSysInfo::windowsVersion() )
-	{
-		case QSysInfo::WV_NT: os = os.arg( "NT 4.0" ); break;
-		case QSysInfo::WV_2000: os = os.arg( "2000" ); break;
-		case QSysInfo::WV_XP: os = os.arg( "XP" ); break;
-		case QSysInfo::WV_VISTA: os = os.arg( "Vista" ); break;
-		case QSysInfo::WV_WINDOWS7: os = os.arg( "7" ); break;
-		default: os = os.arg( "<unknown>" );
-	}
-
-	os = os.arg( ovi.wServicePackMajor ).
-			arg( ovi.dwMajorVersion ).
-			arg( ovi.dwMinorVersion ).
-			arg( ovi.dwBuildNumber );
-
-	const QString machineInfo =
-		QProcessEnvironment::systemEnvironment().value( "PROCESSOR_IDENTIFIER" );
-
-#elif defined( ITALC_BUILD_LINUX )
-
-	QFile f( "/etc/lsb-release" );
-	f.open( QFile::ReadOnly );
-
-	const QString os = "Linux\n" + f.readAll().trimmed();
-
-	QProcess p;
-	p.start( "uname", QStringList() << "-a" );
-	p.waitForFinished();
-	const QString machineInfo = p.readAll().trimmed();
-
-#endif
-
-#ifdef ITALC_HOST_X86
-	const QString buildType = "x86";
-#elif defined( ITALC_HOST_X86_64 )
-	const QString buildType = "x86_64";
-#else
-	const QString buildType = "unknown";
-#endif
-	obj.setValue( "OS", os, "General" );
-	obj.setValue( "MachineInfo", machineInfo, "General" );
-	obj.setValue( "BuildType", buildType, "General" );
-	obj.setValue( "Version", ITALC_VERSION, "General" );
-
-
-	// add current iTALC configuration
-	obj.addSubObject( ItalcCore::config, "Configuration" );
-
-
-	// compress all log files and encode them as base64
-	QStringList paths;
-	paths << LocalSystem::Path::expand( ItalcCore::config->logFileDirectory() );
-#ifdef ITALC_BUILD_WIN32
-	paths << "C:\\Windows\\Temp";
-#else
-	paths << "/tmp";
-#endif
-	foreach( const QString &p, paths )
-	{
-		QDir d( p );
-		foreach( const QString &f, d.entryList( QStringList() << "Italc*.log" ) )
-		{
-			QFile logfile( d.absoluteFilePath( f ) );
-			logfile.open( QFile::ReadOnly );
-			QByteArray data = qCompress( logfile.readAll() ).toBase64();
-			obj.setValue( QFileInfo( logfile ).baseName(), data, "LogFiles" );
-		}
-	}
-
-	// write the file
-	obj.flushStore();
-
-	QMessageBox::information( this, tr( "iTALC bug report archive saved" ),
-			tr( "An iTALC bug report archive has been saved to %1. "
-				"It includes iTALC log files and information about your "
-				"operating system. You can attach it to a bug report." ).
-				arg( QDTNS( outfile ) ) );
-}
-
-
-
-void MainWindow::aboutItalc()
-{
-	AboutDialog( this ).exec();
-}
-
-
-
-void MainWindow::closeEvent( QCloseEvent *closeEvent )
-{
-	if( m_configChanged &&
-			QMessageBox::question( this, tr( "Unsaved settings" ),
-									tr( "There are unsaved settings. "
-										"Quit anyway?" ),
-									QMessageBox::Yes | QMessageBox::No ) !=
-															QMessageBox::Yes )
-	{
-		closeEvent->ignore();
-		return;
-	}
-
-	// make sure to revert the LogonACL
-	reset();
-
-	closeEvent->accept();
-	QMainWindow::closeEvent( closeEvent );
-}
-
-
-
-
-void MainWindow::serviceControlWithProgressBar( const QString &title,
-												const QString &arg )
-{
-	QProcess p;
-	p.start( ImcCore::icaFilePath(), QStringList() << arg );
-	p.waitForStarted();
-
-	QProgressDialog pd( title, QString(), 0, 0, this );
-	pd.setWindowTitle( windowTitle() );
-
-	QProgressBar *b = new QProgressBar( &pd );
-	b->setMaximum( 100 );
-	b->setTextVisible( false );
-	pd.setBar( b );
-	b->show();
-	pd.setWindowModality( Qt::WindowModal );
-	pd.show();
-
-	int j = 0;
-	while( p.state() == QProcess::Running )
-	{
-		QApplication::processEvents();
-		b->setValue( ++j % 100 );
-		LocalSystem::sleep( 10 );
-	}
-
-	updateServiceControl();
-}
-
-
-
-
-bool MainWindow::isServiceRunning()
-{
-#ifdef ITALC_BUILD_WIN32
-	SC_HANDLE hsrvmanager = OpenSCManager( NULL, NULL, SC_MANAGER_CONNECT );
-	if( !hsrvmanager )
-	{
-		ilog_failed( "OpenSCManager()" );
-		return false;
-	}
-
-	SC_HANDLE hservice = OpenService( hsrvmanager, "icas", SERVICE_QUERY_STATUS );
-	if( !hservice )
-	{
-		ilog_failed( "OpenService()" );
-		CloseServiceHandle( hsrvmanager );
-		return false;
-	}
-
-	SERVICE_STATUS status;
-	QueryServiceStatus( hservice, &status );
-
-	CloseServiceHandle( hservice );
-	CloseServiceHandle( hsrvmanager );
-
-	return( status.dwCurrentState == SERVICE_RUNNING );
-#else
-	return false;
-#endif
-}
diff --git a/imc/src/MainWindow.h b/imc/src/MainWindow.h
deleted file mode 100644
index 85304f9..0000000
--- a/imc/src/MainWindow.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * MainWindow.h - main window of the iTALC Management Console
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef MAIN_WINDOW_H
-#define MAIN_WINDOW_H
-
-#include <QtGui/QMainWindow>
-
-class QAbstractButton;
-
-namespace Ui { class MainWindow; } ;
-
-class MainWindow : public QMainWindow
-{
-	Q_OBJECT
-public:
-	MainWindow();
-	virtual ~MainWindow();
-
-	void reset( bool onlyUI = false );
-	void apply();
-
-
-public slots:
-	void manageACLs();
-
-
-private slots:
-	void configurationChanged();
-	void resetOrApply( QAbstractButton *btn );
-	void startService();
-	void stopService();
-	void updateServiceControl();
-	void openLogFileDirectory();
-	void clearLogFiles();
-	void openGlobalConfig();
-	void openPersonalConfig();
-	void openSnapshotDirectory();
-	void openPublicKeyBaseDir();
-	void openPrivateKeyBaseDir();
-	void loadSettingsFromFile();
-	void saveSettingsToFile();
-	void launchKeyFileAssistant();
-	void testLogonAuthentication();
-	void generateBugReportArchive();
-	void aboutItalc();
-
-
-private:
-	virtual void closeEvent( QCloseEvent *closeEvent );
-	void serviceControlWithProgressBar( const QString &title,
-										const QString &arg );
-
-	bool isServiceRunning();
-
-	Ui::MainWindow *ui;
-	bool m_configChanged;
-
-} ;
-
-#endif
diff --git a/imc/src/SystemConfigurationModifier.cpp b/imc/src/SystemConfigurationModifier.cpp
deleted file mode 100644
index 90fd32d..0000000
--- a/imc/src/SystemConfigurationModifier.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * SystemConfigurationModifier.cpp - class for easy modification of iTALC-related
- *                                   settings in the operating system
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-#define INITGUID
-#include <windows.h>
-#include <netfw.h>
-#endif
-
-#include "SystemConfigurationModifier.h"
-#include "ImcCore.h"
-#include "Logger.h"
-
-
-bool SystemConfigurationModifier::setServiceAutostart( bool enabled )
-{
-#ifdef ITALC_BUILD_WIN32
-	SC_HANDLE hsrvmanager = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
-	if( !hsrvmanager )
-	{
-		ilog_failed( "OpenSCManager()" );
-		return false;
-	}
-
-	SC_HANDLE hservice = OpenService( hsrvmanager, "icas", SERVICE_ALL_ACCESS );
-	if( !hservice )
-	{
-		ilog_failed( "OpenService()" );
-		CloseServiceHandle( hsrvmanager );
-		return false;
-	}
-
-	if( !ChangeServiceConfig( hservice,
-					SERVICE_NO_CHANGE,	// dwServiceType
-					enabled ? SERVICE_AUTO_START : SERVICE_DEMAND_START,
-					SERVICE_NO_CHANGE,	// dwErrorControl
-					NULL,	// lpBinaryPathName
-					NULL,	// lpLoadOrderGroup
-					NULL,	// lpdwTagId
-					NULL,	// lpDependencies
-					NULL,	// lpServiceStartName
-					NULL,	// lpPassword
-					NULL	// lpDisplayName
-				) )
-	{
-		ilog_failed( "ChangeServiceConfig()" );
-		CloseServiceHandle( hservice );
-		CloseServiceHandle( hsrvmanager );
-
-		return false;
-	}
-
-	CloseServiceHandle( hservice );
-	CloseServiceHandle( hsrvmanager );
-#endif
-
-	return true;
-}
-
-
-
-
-bool SystemConfigurationModifier::setServiceArguments( const QString &serviceArgs )
-{
-	bool err = false;
-#ifdef ITALC_BUILD_WIN32
-	SC_HANDLE hsrvmanager = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
-	if( !hsrvmanager )
-	{
-		ilog_failed( "OpenSCManager()" );
-		return false;
-	}
-
-	SC_HANDLE hservice = OpenService( hsrvmanager, "icas", SERVICE_ALL_ACCESS );
-	if( !hservice )
-	{
-		ilog_failed( "OpenService()" );
-		CloseServiceHandle( hsrvmanager );
-		return false;
-	}
-
-	QString binaryPath = QString( "\"%1\" -service %2" ).
-								arg( ImcCore::icaFilePath() ).
-								arg( serviceArgs );
-
-	if( !ChangeServiceConfig( hservice,
-					SERVICE_NO_CHANGE,	// dwServiceType
-					SERVICE_NO_CHANGE,	// dwStartType
-					SERVICE_NO_CHANGE,	// dwErrorControl
-					binaryPath.toUtf8().constData(),	// lpBinaryPathName
-					NULL,	// lpLoadOrderGroup
-					NULL,	// lpdwTagId
-					NULL,	// lpDependencies
-					NULL,	// lpServiceStartName
-					NULL,	// lpPassword
-					NULL	// lpDisplayName
-				) )
-	{
-		ilog_failed( "ChangeServiceConfig()" );
-		err = true;
-	}
-
-	CloseServiceHandle( hservice );
-	CloseServiceHandle( hsrvmanager );
-#endif
-
-	return !err;
-}
-
-
-
-#ifdef ITALC_BUILD_WIN32
-HRESULT WindowsFirewallInitialize( INetFwProfile **fwProfile )
-{
-	HRESULT hr = S_OK;
-	INetFwMgr* fwMgr = NULL;
-	INetFwPolicy* fwPolicy = NULL;
-
-	*fwProfile = NULL;
-
-	// Create an instance of the firewall settings manager.
-	hr = CoCreateInstance( CLSID_NetFwMgr, NULL, CLSCTX_INPROC_SERVER,
-							IID_INetFwMgr, (void**)&fwMgr );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "CoCreateInstance()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Retrieve the local firewall policy.
-	hr = fwMgr->get_LocalPolicy(&fwPolicy);
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "get_LocalPolicy()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Retrieve the firewall profile currently in effect.
-	hr = fwPolicy->get_CurrentProfile(fwProfile);
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "get_CurrentProfile()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-error:
-	if( fwPolicy != NULL )
-	{
-		fwPolicy->Release();
-	}
-
-	if( fwMgr != NULL )
-	{
-		fwMgr->Release();
-	}
-
-	return hr;
-}
-
-
-void WindowsFirewallCleanup( INetFwProfile *fwProfile )
-{
-	if( fwProfile != NULL )
-	{
-		fwProfile->Release();
-	}
-}
-
-
-
-HRESULT WindowsFirewallAddApp( INetFwProfile* fwProfile,
-								const wchar_t* fwProcessImageFileName,
-								const wchar_t* fwName )
-{
-	HRESULT hr = S_OK;
-	BSTR fwBstrName = NULL;
-	BSTR fwBstrProcessImageFileName = NULL;
-	INetFwAuthorizedApplication* fwApp = NULL;
-	INetFwAuthorizedApplications* fwApps = NULL;
-
-	// Retrieve the authorized application collection.
-	hr = fwProfile->get_AuthorizedApplications( &fwApps );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "get_AuthorizedApplications()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Create an instance of an authorized application.
-	hr = CoCreateInstance( CLSID_NetFwAuthorizedApplication, NULL,
-							CLSCTX_INPROC_SERVER,
-							IID_INetFwAuthorizedApplication, (void**)&fwApp );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "CoCreateInstance()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Allocate a BSTR for the process image file name.
-	fwBstrProcessImageFileName = SysAllocString( fwProcessImageFileName );
-	if( fwBstrProcessImageFileName == NULL )
-	{
-		hr = E_OUTOFMEMORY;
-		ilog_failedf( "SysAllocString()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Set the process image file name.
-	hr = fwApp->put_ProcessImageFileName( fwBstrProcessImageFileName );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "put_ProcessImageFileName()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Allocate a BSTR for the application friendly name.
-	fwBstrName = SysAllocString( fwName );
-	if( SysStringLen( fwBstrName ) == 0 )
-	{
-		hr = E_OUTOFMEMORY;
-		ilog_failedf( "SysAllocString()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Set the application friendly name.
-	hr = fwApp->put_Name( fwBstrName );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "put_Name()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Add the application to the collection.
-	hr = fwApps->Add( fwApp );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "Add()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-error:
-	// Free the BSTRs.
-	SysFreeString( fwBstrName );
-	SysFreeString( fwBstrProcessImageFileName );
-
-	// Release the authorized application instance.
-	if( fwApp != NULL )
-	{
-		fwApp->Release();
-	}
-
-	// Release the authorized application collection.
-	if( fwApps != NULL )
-	{
-		fwApps->Release();
-	}
-
-	return hr;
-}
-
-
-
-HRESULT WindowsFirewallRemoveApp( INetFwProfile* fwProfile,
-								const wchar_t* fwProcessImageFileName )
-{
-	HRESULT hr = S_OK;
-	BSTR fwBstrProcessImageFileName = NULL;
-	INetFwAuthorizedApplications* fwApps = NULL;
-
-	// Retrieve the authorized application collection.
-	hr = fwProfile->get_AuthorizedApplications( &fwApps );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "get_AuthorizedApplications()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Allocate a BSTR for the process image file name.
-	fwBstrProcessImageFileName = SysAllocString( fwProcessImageFileName );
-	if( fwBstrProcessImageFileName == NULL )
-	{
-		hr = E_OUTOFMEMORY;
-		ilog_failedf( "SysAllocString()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-	// Remove the application from the collection.
-	hr = fwApps->Remove( fwBstrProcessImageFileName );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "Remove()", "0x%08lx\n", hr );
-		goto error;
-	}
-
-error:
-	// Free the BSTRs.
-	SysFreeString( fwBstrProcessImageFileName );
-
-	// Release the authorized application collection.
-	if( fwApps != NULL )
-	{
-		fwApps->Release();
-	}
-
-	return hr;
-}
-
-
-
-HRESULT WindowsFirewallInitialize2( INetFwPolicy2 **fwPolicy2 )
-{
-	HRESULT hr = S_OK;
-
-	// Create an instance of the firewall settings manager.
-	hr = CoCreateInstance( CLSID_NetFwPolicy2, NULL, CLSCTX_INPROC_SERVER,
-							IID_INetFwPolicy2, (void**)fwPolicy2 );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "CoCreateInstance()", "0x%08lx\n", hr );
-	}
-
-	return hr;
-}
-
-
-void WindowsFirewallCleanup2( INetFwPolicy2 *fwPolicy2 )
-{
-	if( fwPolicy2 != NULL )
-	{
-		fwPolicy2->Release();
-	}
-}
-
-
-
-HRESULT WindowsFirewallAddApp2( INetFwPolicy2* fwPolicy2,
-								const wchar_t* fwApplicationPath,
-								const wchar_t* fwName )
-{
-	HRESULT hr = S_OK;
-	BSTR fwBstrRuleName = NULL;
-	BSTR fwBstrApplicationPath = NULL;
-	BSTR fwBstrRuleDescription = NULL;
-	BSTR fwBstrRuleGrouping = NULL;
-
-	INetFwRules *pFwRules = NULL;
-	INetFwRule *pFwRule = NULL;
-
-	// Retrieve INetFwRules
-	hr = fwPolicy2->get_Rules( &pFwRules );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "get_Rules()", "0x%08lx\n", hr );
-		goto cleanup;
-	}
-
-	// Create an instance of an authorized application.
-	hr = CoCreateInstance( CLSID_NetFwRule, NULL,
-							CLSCTX_INPROC_SERVER,
-							IID_INetFwRule, (void**)&pFwRule );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "CoCreateInstance()", "0x%08lx\n", hr );
-		goto cleanup;
-	}
-
-	fwBstrRuleName = SysAllocString( fwName );
-	fwBstrApplicationPath = SysAllocString( fwApplicationPath );
-	fwBstrRuleDescription = SysAllocString( fwName );
-	fwBstrRuleGrouping = SysAllocString( fwName );
-
-	// Set the rule
-	pFwRule->put_Name( fwBstrRuleName );
-	pFwRule->put_ApplicationName( fwBstrApplicationPath );
-	pFwRule->put_Description( fwBstrRuleDescription );
-	pFwRule->put_Grouping( fwBstrRuleGrouping );
-
-	pFwRule->put_Action( NET_FW_ACTION_ALLOW );
-	pFwRule->put_Enabled( VARIANT_TRUE );
-	pFwRule->put_Protocol( NET_FW_IP_PROTOCOL_TCP );
-	pFwRule->put_Profiles( NET_FW_PROFILE2_ALL );
-
-
-	// Add the application to the collection.
-	hr = pFwRules->Add( pFwRule );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "Add()", "0x%08lx\n", hr );
-		goto cleanup;
-	}
-
-cleanup:
-	// Free the BSTRs.
-	SysFreeString( fwBstrRuleName );
-	SysFreeString( fwBstrApplicationPath );
-	SysFreeString( fwBstrRuleDescription );
-	SysFreeString( fwBstrRuleGrouping );
-
-	if( pFwRule != NULL )
-	{
-		pFwRule->Release();
-	}
-
-	if( pFwRules != NULL )
-	{
-		pFwRules->Release();
-	}
-
-	return hr;
-}
-
-
-
-HRESULT WindowsFirewallRemoveApp2( INetFwPolicy2 * fwPolicy2,
-									const wchar_t* fwName )
-{
-	HRESULT hr = S_OK;
-	BSTR fwBstrRuleName = SysAllocString( fwName );
-
-	INetFwRules *pFwRules = NULL;
-
-	// Retrieve INetFwRules
-	hr = fwPolicy2->get_Rules( &pFwRules );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "get_Rules()", "0x%08lx\n", hr );
-		goto cleanup;
-	}
-
-	// Remove rule
-	hr = pFwRules->Remove( fwBstrRuleName );
-	if( FAILED( hr ) )
-	{
-		ilog_failedf( "Remove()", "0x%08lx\n", hr );
-		goto cleanup;
-	}
-
-cleanup:
-	// Free the BSTRs.
-	SysFreeString( fwBstrRuleName );
-
-	if( pFwRules != NULL )
-	{
-		pFwRules->Release();
-	}
-
-	return hr;
-}
-
-
-#endif
-
-
-
-
-bool SystemConfigurationModifier::enableFirewallException( bool enabled )
-{
-#ifdef ITALC_BUILD_WIN32
-	HRESULT hr = S_OK;
-
-	// initialize COM
-	HRESULT comInit = CoInitializeEx( 0, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE );
-
-	// Ignore RPC_E_CHANGED_MODE; this just means that COM has already been
-	// initialized with a different mode. Since we don't care what the mode is,
-	// we'll just use the existing mode.
-	if( comInit != RPC_E_CHANGED_MODE )
-	{
-		hr = comInit;
-		if( FAILED( hr ) )
-		{
-			ilog_failedf( "CoInitializeEx()"," 0x%08lx\n", hr );
-			return false;
-		}
-	}
-
-	static const wchar_t *fwRuleName = L"iTALC Client Application";
-
-	const QString p = ImcCore::icaFilePath().replace( '/', '\\' );
-
-	wchar_t icaPath[MAX_PATH];
-	p.toWCharArray( icaPath );
-	icaPath[p.size()] = 0;
-
-	OSVERSIONINFO ovi;
-	ovi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
-	GetVersionEx( &ovi );
-
-	// Windows >= Vista ?
-	if( ovi.dwMajorVersion >= 6 )
-	{
-		// code for advanced firewall API
-
-		// retrieve current firewall profile
-		INetFwPolicy2 *fwPolicy2 = NULL;
-		hr = WindowsFirewallInitialize2( &fwPolicy2 );
-		if( FAILED( hr ) )
-		{
-			ilog_failedf( "WindowsFirewallInitialize2()", "0x%08lx\n", hr );
-			return false;
-		}
-
-		// always remove firewall exception first
-		hr = WindowsFirewallRemoveApp2( fwPolicy2, fwRuleName );
-
-		if( enabled )
-		{
-			// add ICA to the list of authorized applications
-			hr = WindowsFirewallAddApp2( fwPolicy2, icaPath, fwRuleName );
-			if( FAILED( hr ) )
-			{
-				// failed because firewall service not running / disabled?
-				if( (DWORD) hr == 0x800706D9 )
-				{
-					// then assume this is intended, log a warning and
-					// pretend everything went well
-					qWarning() << "Windows Firewall service not running or disabled - can't add or remove firewall exception!";
-					return true;
-				}
-
-				ilog_failedf( "WindowsFirewallAddApp2()", "0x%08lx\n", hr );
-				return false;
-			}
-		}
-
-		WindowsFirewallCleanup2( fwPolicy2 );
-	}
-	else
-	{
-		// code for old firewall API
-
-		// retrieve current firewall profile
-		INetFwProfile *fwProfile = NULL;
-		hr = WindowsFirewallInitialize( &fwProfile );
-		if( FAILED( hr ) )
-		{
-			// failed because firewall service not running / disabled?
-			if( (DWORD) hr == 0x800706D9 )
-			{
-				// then assume this is intended, log a warning and
-				// pretend everything went well
-				qWarning() << "Windows Firewall service not running or disabled - can't add or remove firewall exception!";
-				return true;
-			}
-
-			ilog_failedf( "WindowsFirewallInitialize()", "0x%08lx\n", hr );
-			return false;
-		}
-
-		// always remove firewall exception first
-		hr = WindowsFirewallRemoveApp( fwProfile, icaPath );
-
-		if( enabled )
-		{
-			// add ICA to the list of authorized applications
-			hr = WindowsFirewallAddApp( fwProfile, icaPath, fwRuleName );
-			if( FAILED( hr ) )
-			{
-				ilog_failedf( "WindowsFirewallAddApp()", "0x%08lx\n", hr );
-				return false;
-			}
-		}
-
-		WindowsFirewallCleanup( fwProfile );
-	}
-
-	// Uninitialize COM.
-	if( SUCCEEDED( comInit ) )
-	{
-		CoUninitialize();
-	}
-#endif
-
-	return true;
-}
-
diff --git a/imc/src/SystemConfigurationModifier.h b/imc/src/SystemConfigurationModifier.h
deleted file mode 100644
index fde304a..0000000
--- a/imc/src/SystemConfigurationModifier.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SystemConfigurationModifier.h - class for easy modification of iTALC-related
- *                                 settings in the operating system
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SYSTEM_CONFIGURATION_MODIFIER_H
-#define SYSTEM_CONFIGURATION_MODIFIER_H
-
-#include <QtCore/QString>
-
-class SystemConfigurationModifier
-{
-public:
-	static bool setServiceAutostart( bool enabled );
-	static bool setServiceArguments( const QString &serviceArgs );
-
-	static bool enableFirewallException( bool enabled );
-
-} ;
-
-#endif
diff --git a/imc/src/Win32AclEditor.cpp b/imc/src/Win32AclEditor.cpp
deleted file mode 100644
index 5718c76..0000000
--- a/imc/src/Win32AclEditor.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-//  Copyright (C) 2004 Martin Scharpf. All Rights Reserved.
-//
-//  This program is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-// If the source code for the program is not available from the place from
-// which you received this file, check
-// http://ultravnc.sourceforge.net/
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-
-#include "Win32AclEditor.h"
-#include "../ica/win32/addon/ms-logon/authSSP/vncAccessControl.h"
-
-SI_ACCESS g_vncAccess[] = {
-	// these are a easy-to-swallow listing of basic rights for VNC
-	{ &GUID_NULL, 0x00000003, L"Full control", SI_ACCESS_GENERAL  }
-};
-
-// Here's my crufted-up mapping for VNC generic rights
-GENERIC_MAPPING g_vncGenericMapping = {
-	STANDARD_RIGHTS_READ,
-	STANDARD_RIGHTS_WRITE,
-	STANDARD_RIGHTS_EXECUTE,
-	STANDARD_RIGHTS_REQUIRED
-};
-
-
-HINSTANCE g_hInst;
-
-STDMETHODIMP ItalcSecurityInfo::QueryInterface( REFIID iid, void** ppv )
-{
-	if ( IID_IUnknown == iid || IID_ISecurityInformation == iid )
-		*ppv = static_cast<ISecurityInformation*>(this);
-	else return (*ppv = 0), E_NOINTERFACE;
-	reinterpret_cast<IUnknown*>( *ppv )->AddRef();
-	return S_OK;
-}
-STDMETHODIMP_(ULONG) ItalcSecurityInfo::AddRef()
-{
-	return ++m_cRefs;
-}
-STDMETHODIMP_(ULONG) ItalcSecurityInfo::Release()
-{
-	ULONG n = --m_cRefs;
-	if ( 0 == n )
-		delete this;
-	return n;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::GetObjectInformation( SI_OBJECT_INFO* poi ){
-	// We want to edit the DACL (PERMS).
-	poi->dwFlags = SI_EDIT_PERMS | SI_NO_ACL_PROTECT;
-
-	// this determines the module used to discover stringtable entries
-	poi->hInstance		= g_hInst;
-	poi->pszServerName	= (WCHAR *) L""; // Todo(?): Here we need the DC??
-	// then also set dwFlags |= SI_SERVER_IS_DC
-	poi->pszObjectName	= const_cast<wchar_t*>( m_pszObjectName );
-	poi->pszPageTitle	= const_cast<wchar_t*>( m_pszPageTitle );
-
-	if ( m_pszPageTitle )
-		poi->dwFlags |= SI_PAGE_TITLE;
-
-	return S_OK;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::GetSecurity(SECURITY_INFORMATION ri,
-							 PSECURITY_DESCRIPTOR *ppsd,
-							 BOOL bDefault){
-	vncAccessControl vncAC;
-	return (*ppsd = vncAC.GetSD()) ? S_OK : E_FAIL;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::SetSecurity(SECURITY_INFORMATION ri, void* psd){
-	vncAccessControl vncAC;
-	return vncAC.SetSD((PSECURITY_DESCRIPTOR) psd) ? S_OK : E_FAIL;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::PropertySheetPageCallback(HWND hwnd, UINT msg, SI_PAGE_TYPE pt){
-	// this is effectively a pass-through from the PropertySheet callback,
-	// which we don't care about here.
-	return S_OK;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::GetAccessRights(const GUID*,
-								 DWORD dwFlags,
-								 SI_ACCESS** ppAccess,
-								 ULONG* pcAccesses,
-								 ULONG* piDefaultAccess){
-	// here's where we hand back the permissions->strings mapping
-	*ppAccess = const_cast<SI_ACCESS*>( g_vncAccess );
-	*pcAccesses = sizeof g_vncAccess / sizeof *g_vncAccess;
-	*piDefaultAccess = 0;
-	return S_OK;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::MapGeneric(const GUID*, UCHAR* pAceFlags, ACCESS_MASK* pMask){
-	// here's where we hand back the generic permissions mapping
-	MapGenericMask(pMask, const_cast<GENERIC_MAPPING*>(&g_vncGenericMapping));
-	return S_OK;
-}
-
-STDMETHODIMP
-ItalcSecurityInfo::GetInheritTypes(SI_INHERIT_TYPE** ppInheritTypes, ULONG* pcInheritTypes){
-	// We don't need inheritance here.
-	*ppInheritTypes = NULL;
-	*pcInheritTypes = 0;
-	return S_OK;
-}
-
-
-void Win32AclEditor( HWND hwnd )
-{
-	g_hInst = GetModuleHandle( NULL );
-	// Convert ISecurityInformation implementation into property pages
-	ItalcSecurityInfo* psi = new ItalcSecurityInfo(L"iTALC Server", L"iTALC Server");
-	psi->AddRef();
-
-	HPROPSHEETPAGE hpsp[1];
-	hpsp[0] = CreateSecurityPage(psi);
-	psi->Release(); // does "delete this"!
-
-	// Wrap the property page in a modal dialog by calling PropertySheet
-	PROPSHEETHEADER psh;
-	ZeroMemory(&psh, sizeof psh);
-	psh.dwSize		= sizeof psh;
-	psh.hwndParent	= hwnd;
-	psh.pszCaption	= _T("iTALC Logon Authentication");
-	psh.nPages		= sizeof hpsp / sizeof *hpsp;
-	psh.phpage		= hpsp;
-
-	PropertySheet(&psh);
-}
-
-#endif
diff --git a/imc/src/Win32AclEditor.h b/imc/src/Win32AclEditor.h
deleted file mode 100644
index 734ce16..0000000
--- a/imc/src/Win32AclEditor.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
-//
-//  This program is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
-//  USA.
-//
-// If the source code for the program is not available from the place from
-// which you received this file, check
-// http://ultravnc.sourceforge.net/
-
-#ifndef WIN32_ACL_EDITOR_H
-#define WIN32_ACL_EDITOR_H
-
-#include <windows.h>
-#include <aclui.h>
-#include <aclapi.h>
-
-struct ItalcSecurityInfo : ISecurityInformation
-{
-	long  m_cRefs;
-	const wchar_t* const m_pszObjectName;
-	const wchar_t* const m_pszPageTitle;
-
-	ItalcSecurityInfo(const wchar_t* pszObjectName,
-		const wchar_t* pszPageTitle = 0 )
-		: m_cRefs(0),
-		m_pszObjectName(pszObjectName),
-		m_pszPageTitle(pszPageTitle) {}
-
-	virtual ~ItalcSecurityInfo()
-	{
-	}
-
-	STDMETHODIMP QueryInterface( REFIID iid, void** ppv );
-	STDMETHODIMP_(ULONG) AddRef();
-	STDMETHODIMP_(ULONG) Release();
-	STDMETHODIMP GetObjectInformation( SI_OBJECT_INFO* poi );
-	STDMETHODIMP GetSecurity(SECURITY_INFORMATION ri, PSECURITY_DESCRIPTOR * ppsd, BOOL bDefault);
-	STDMETHODIMP SetSecurity(SECURITY_INFORMATION ri, void* psd);
-	STDMETHODIMP PropertySheetPageCallback(HWND hwnd, UINT msg, SI_PAGE_TYPE pt);
-	STDMETHODIMP GetAccessRights(const GUID*,
-								 DWORD dwFlags,
-								 SI_ACCESS** ppAccess,
-								 ULONG* pcAccesses,
-								 ULONG* piDefaultAccess);
-	STDMETHODIMP MapGeneric(const GUID*, UCHAR* pAceFlags, ACCESS_MASK* pMask);
-	STDMETHODIMP GetInheritTypes(SI_INHERIT_TYPE** ppInheritTypes, ULONG* pcInheritTypes);
-};
-
-#endif
diff --git a/imc/src/main.cpp b/imc/src/main.cpp
deleted file mode 100644
index 9b84b9a..0000000
--- a/imc/src/main.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * main.cpp - main file for iTALC Management Console
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QProcessEnvironment>
-#include <QtGui/QApplication>
-
-#include "Configuration/XmlStore.h"
-#include "ImcCore.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "MainWindow.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-
-
-int main( int argc, char **argv )
-{
-
-	// make sure to run as admin
-	if( !LocalSystem::Process::isRunningAsAdmin() )
-	{
-		QCoreApplication app( argc, argv );
-		QStringList args = app.arguments();
-		args.removeFirst();
-		LocalSystem::Process::runAsAdmin(
-				QCoreApplication::applicationFilePath(),
-				args.join( " " ) );
-		return 0;
-	}
-
-#ifdef ITALC_BUILD_LINUX
-	QApplication app( argc, argv,
-			QProcessEnvironment::systemEnvironment().contains( "DISPLAY" ) );
-#else
-	QApplication app( argc, argv );
-#endif
-
-	ItalcCore::init();
-
-	ImcCore::silent = app.arguments().contains( "-quiet" ) ||
-						app.arguments().contains( "-silent" ) ||
-						app.arguments().contains( "-q" );
-
-
-	// default to teacher role for various command line operations
-	ItalcCore::role = ItalcCore::RoleTeacher;
-
-	Logger l( "ItalcManagementConsole" );
-
-	if( !ItalcConfiguration().isStoreWritable() &&
-			ItalcCore::config->logLevel() < Logger::LogLevelDebug )
-	{
-		ImcCore::criticalMessage( MainWindow::tr( "Configuration not writable" ),
-			MainWindow::tr( "The local configuration backend reported that the "
-							"configuration is not writable! Please run the iTALC "
-							"Management Console with higher privileges." ) );
-		return -1;
-	}
-
-	if( app.type() != QApplication::Tty )
-	{
-		app.connect( &app, SIGNAL( lastWindowClosed() ), SLOT( quit() ) );
-	}
-
-	// parse arguments
-	QStringListIterator argIt( app.arguments() );
-	argIt.next();
-
-	while( argc > 1 && argIt.hasNext() )
-	{
-		const QString a = argIt.next().toLower();
-		if( ( a == "-applysettings" || a == "-a" ) && argIt.hasNext() )
-		{
-			const QString file = argIt.next();
-			Configuration::XmlStore xs( Configuration::XmlStore::System, file );
-
-			if( ImcCore::applyConfiguration( ItalcConfiguration( &xs ) ) )
-			{
-				ImcCore::informationMessage(
-					MainWindow::tr( "iTALC Management Console" ),
-					MainWindow::tr( "All settings were applied successfully." ) );
-			}
-			else
-			{
-				ImcCore::criticalMessage(
-					MainWindow::tr( "iTALC Management Console" ),
-					MainWindow::tr( "An error occured while applying settings!" ) );
-			}
-
-			return 0;
-		}
-		else if( a == "-listconfig" || a == "-l" )
-		{
-			ImcCore::listConfiguration( *ItalcCore::config );
-
-			return 0;
-		}
-		else if( a == "-setconfigvalue" || a == "-s" )
-		{
-			if( !argIt.hasNext() )
-			{
-				qCritical( "No configuration property specified!" );
-				return -1;
-			}
-			QString prop = argIt.next();
-			QString value;
-			if( !argIt.hasNext() )
-			{
-				if( !prop.contains( '=' ) )
-				{
-					qCritical() << "No value for property" << prop << "specified!";
-					return -1;
-				}
-				else
-				{
-					value = prop.section( '=', -1, -1 );
-					prop = prop.section( '=', 0, -2 );
-				}
-			}
-			else
-			{
-				value = argIt.next();
-			}
-			const QString key = prop.section( '/', -1, -1 );
-			const QString parentKey = prop.section( '/', 0, -2 );
-
-			ItalcCore::config->setValue( key, value, parentKey );
-
-			ImcCore::applyConfiguration( *ItalcCore::config );
-
-			return 0;
-		}
-		else if( a == "-role" )
-		{
-			if( argIt.hasNext() )
-			{
-				const QString role = argIt.next();
-				if( role == "teacher" )
-				{
-					ItalcCore::role = ItalcCore::RoleTeacher;
-				}
-				else if( role == "admin" )
-				{
-					ItalcCore::role = ItalcCore::RoleAdmin;
-				}
-				else if( role == "supporter" )
-				{
-					ItalcCore::role = ItalcCore::RoleSupporter;
-				}
-			}
-			else
-			{
-				qCritical( "-role needs an argument:\n"
-					"	teacher\n"
-					"	admin\n"
-					"	supporter\n\n" );
-				return -1;
-			}
-		}
-		else if( a == "-createkeypair" )
-		{
-			const QString destDir = argIt.hasNext() ? argIt.next() : QString();
-			ImcCore::createKeyPair( ItalcCore::role, destDir );
-			return 0;
-		}
-		else if( a == "-importpublickey" || a == "-i" )
-		{
-			QString pubKeyFile;
-			if( !argIt.hasNext() )
-			{
-				QStringList l =
-					QDir::current().entryList( QStringList() << "*.key.txt",
-												QDir::Files | QDir::Readable );
-				if( l.size() != 1 )
-				{
-					qCritical( "Please specify location of the public key "
-								"to import" );
-					return -1;
-				}
-				pubKeyFile = QDir::currentPath() + QDir::separator() +
-													l.first();
-				qWarning() << "No public key file specified. Trying to import "
-								"the public key file found at" << pubKeyFile;
-			}
-			else
-			{
-				pubKeyFile = argIt.next();
-			}
-
-			if( !ImcCore::importPublicKey( ItalcCore::role, pubKeyFile, QString() ) )
-			{
-				LogStream( Logger::LogLevelInfo ) << "Public key import "
-													"failed";
-				return -1;
-			}
-			LogStream( Logger::LogLevelInfo ) << "Public key successfully "
-													"imported";
-			return 0;
-		}
-	}
-
-	// now create the main window
-	MainWindow *mainWindow = new MainWindow;
-
-	mainWindow->show();
-
-	if( app.arguments().contains( "-manageACLs" ) )
-	{
-		mainWindow->manageACLs();
-	}
-
-	ilog( Info, "App.Exec" );
-
-	int ret = app.exec();
-
-	ItalcCore::destroy();
-
-	return ret;
-}
-
diff --git a/imc/src/moc_FileSystemBrowser.cxx_parameters b/imc/src/moc_FileSystemBrowser.cxx_parameters
deleted file mode 100644
index 4ae6f97..0000000
--- a/imc/src/moc_FileSystemBrowser.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_FileSystemBrowser.cxx
-/tmp/foo/imc/src/FileSystemBrowser.h
diff --git a/imc/src/moc_ImcCore.cxx_parameters b/imc/src/moc_ImcCore.cxx_parameters
deleted file mode 100644
index 37c6a8f..0000000
--- a/imc/src/moc_ImcCore.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_ImcCore.cxx
-/tmp/foo/imc/src/ImcCore.h
diff --git a/imc/src/moc_KeyDirectoriesPage.cxx_parameters b/imc/src/moc_KeyDirectoriesPage.cxx_parameters
deleted file mode 100644
index 54b8721..0000000
--- a/imc/src/moc_KeyDirectoriesPage.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_KeyDirectoriesPage.cxx
-/tmp/foo/imc/src/KeyDirectoriesPage.h
diff --git a/imc/src/moc_KeyFileAssistant.cxx_parameters b/imc/src/moc_KeyFileAssistant.cxx_parameters
deleted file mode 100644
index 292406e..0000000
--- a/imc/src/moc_KeyFileAssistant.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_KeyFileAssistant.cxx
-/tmp/foo/imc/src/KeyFileAssistant.h
diff --git a/imc/src/moc_KeyFileAssistantModePage.cxx_parameters b/imc/src/moc_KeyFileAssistantModePage.cxx_parameters
deleted file mode 100644
index 2cbbc84..0000000
--- a/imc/src/moc_KeyFileAssistantModePage.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_KeyFileAssistantModePage.cxx
-/tmp/foo/imc/src/KeyFileAssistantModePage.h
diff --git a/imc/src/moc_LogonAclSettings.cxx_parameters b/imc/src/moc_LogonAclSettings.cxx_parameters
deleted file mode 100644
index 3f315e7..0000000
--- a/imc/src/moc_LogonAclSettings.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_LogonAclSettings.cxx
-/tmp/foo/imc/src/LogonAclSettings.h
diff --git a/imc/src/moc_LogonGroupEditor.cxx_parameters b/imc/src/moc_LogonGroupEditor.cxx_parameters
deleted file mode 100644
index fb8214f..0000000
--- a/imc/src/moc_LogonGroupEditor.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_LogonGroupEditor.cxx
-/tmp/foo/imc/src/LogonGroupEditor.h
diff --git a/imc/src/moc_MainWindow.cxx_parameters b/imc/src/moc_MainWindow.cxx_parameters
deleted file mode 100644
index 200fbda..0000000
--- a/imc/src/moc_MainWindow.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_MainWindow.cxx
-/tmp/foo/imc/src/MainWindow.h
diff --git a/imc/src/moc_SystemConfigurationModifier.cxx_parameters b/imc/src/moc_SystemConfigurationModifier.cxx_parameters
deleted file mode 100644
index 52e7feb..0000000
--- a/imc/src/moc_SystemConfigurationModifier.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_SystemConfigurationModifier.cxx
-/tmp/foo/imc/src/SystemConfigurationModifier.h
diff --git a/imc/src/moc_Win32AclEditor.cxx_parameters b/imc/src/moc_Win32AclEditor.cxx_parameters
deleted file mode 100644
index 351f534..0000000
--- a/imc/src/moc_Win32AclEditor.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_Win32AclEditor.cxx
-/tmp/foo/imc/src/Win32AclEditor.h
diff --git a/imc/src/moc_netfw.cxx_parameters b/imc/src/moc_netfw.cxx_parameters
deleted file mode 100644
index d5532ae..0000000
--- a/imc/src/moc_netfw.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/imc/src/moc_netfw.cxx
-/tmp/foo/imc/src/netfw.h
diff --git a/imc/src/netfw.h b/imc/src/netfw.h
deleted file mode 100644
index ea36056..0000000
--- a/imc/src/netfw.h
+++ /dev/null
@@ -1,4563 +0,0 @@
-/*** Autogenerated by WIDL 1.2.2 from netfw.idl - Do not edit ***/
-
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifndef __WIDL_NETFW_H
-#define __WIDL_NETFW_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Headers for imported files */
-
-#include <icftypes.h>
-#include <oaidl.h>
-
-/* Forward declarations */
-
-#ifndef __INetFwIcmpSettings_FWD_DEFINED__
-#define __INetFwIcmpSettings_FWD_DEFINED__
-typedef interface INetFwIcmpSettings INetFwIcmpSettings;
-#endif
-
-#ifndef __INetFwOpenPort_FWD_DEFINED__
-#define __INetFwOpenPort_FWD_DEFINED__
-typedef interface INetFwOpenPort INetFwOpenPort;
-#endif
-
-#ifndef __INetFwOpenPorts_FWD_DEFINED__
-#define __INetFwOpenPorts_FWD_DEFINED__
-typedef interface INetFwOpenPorts INetFwOpenPorts;
-#endif
-
-#ifndef __INetFwService_FWD_DEFINED__
-#define __INetFwService_FWD_DEFINED__
-typedef interface INetFwService INetFwService;
-#endif
-
-#ifndef __INetFwServices_FWD_DEFINED__
-#define __INetFwServices_FWD_DEFINED__
-typedef interface INetFwServices INetFwServices;
-#endif
-
-#ifndef __INetFwAuthorizedApplication_FWD_DEFINED__
-#define __INetFwAuthorizedApplication_FWD_DEFINED__
-typedef interface INetFwAuthorizedApplication INetFwAuthorizedApplication;
-#endif
-
-#ifndef __INetFwRule_FWD_DEFINED__
-#define __INetFwRule_FWD_DEFINED__
-typedef interface INetFwRule INetFwRule;
-#endif
-
-#ifndef __INetFwRule2_FWD_DEFINED__
-#define __INetFwRule2_FWD_DEFINED__
-typedef interface INetFwRule2 INetFwRule2;
-#endif
-
-#ifndef __INetFwRules_FWD_DEFINED__
-#define __INetFwRules_FWD_DEFINED__
-typedef interface INetFwRules INetFwRules;
-#endif
-
-#ifndef __INetFwRemoteAdminSettings_FWD_DEFINED__
-#define __INetFwRemoteAdminSettings_FWD_DEFINED__
-typedef interface INetFwRemoteAdminSettings INetFwRemoteAdminSettings;
-#endif
-
-#ifndef __INetFwAuthorizedApplications_FWD_DEFINED__
-#define __INetFwAuthorizedApplications_FWD_DEFINED__
-typedef interface INetFwAuthorizedApplications INetFwAuthorizedApplications;
-#endif
-
-#ifndef __INetFwServiceRestriction_FWD_DEFINED__
-#define __INetFwServiceRestriction_FWD_DEFINED__
-typedef interface INetFwServiceRestriction INetFwServiceRestriction;
-#endif
-
-#ifndef __INetFwProfile_FWD_DEFINED__
-#define __INetFwProfile_FWD_DEFINED__
-typedef interface INetFwProfile INetFwProfile;
-#endif
-
-#ifndef __INetFwPolicy_FWD_DEFINED__
-#define __INetFwPolicy_FWD_DEFINED__
-typedef interface INetFwPolicy INetFwPolicy;
-#endif
-
-#ifndef __INetFwPolicy2_FWD_DEFINED__
-#define __INetFwPolicy2_FWD_DEFINED__
-typedef interface INetFwPolicy2 INetFwPolicy2;
-#endif
-
-#ifndef __INetFwMgr_FWD_DEFINED__
-#define __INetFwMgr_FWD_DEFINED__
-typedef interface INetFwMgr INetFwMgr;
-#endif
-
-#ifndef __NetFwRule_FWD_DEFINED__
-#define __NetFwRule_FWD_DEFINED__
-typedef struct NetFwRule NetFwRule;
-#endif /* defined __NetFwRule_FWD_DEFINED__ */
-
-#ifndef __NetFwOpenPort_FWD_DEFINED__
-#define __NetFwOpenPort_FWD_DEFINED__
-typedef struct NetFwOpenPort NetFwOpenPort;
-#endif /* defined __NetFwOpenPort_FWD_DEFINED__ */
-
-#ifndef __NetFwAuthorizedApplication_FWD_DEFINED__
-#define __NetFwAuthorizedApplication_FWD_DEFINED__
-typedef struct NetFwAuthorizedApplication NetFwAuthorizedApplication;
-#endif /* defined __NetFwAuthorizedApplication_FWD_DEFINED__ */
-
-#ifndef __NetFwPolicy2_FWD_DEFINED__
-#define __NetFwPolicy2_FWD_DEFINED__
-typedef struct NetFwPolicy2 NetFwPolicy2;
-#endif /* defined __NetFwPolicy2_FWD_DEFINED__ */
-
-#ifndef __NetFwMgr_FWD_DEFINED__
-#define __NetFwMgr_FWD_DEFINED__
-typedef struct NetFwMgr NetFwMgr;
-#endif /* defined __NetFwMgr_FWD_DEFINED__ */
-
-
-/*****************************************************************************
- * INetFwIcmpSettings interface
- */
-#ifndef __INetFwIcmpSettings_INTERFACE_DEFINED__
-#define __INetFwIcmpSettings_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwIcmpSettings, 0xa6207b2e, 0x7cdd, 0x426a, 0x95,0x1e, 0x5e,0x1c,0xbc,0x5a,0xfe,0xad);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwIcmpSettings : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_AllowOutboundDestinationUnreachable(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowOutboundDestinationUnreachable(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowRedirect(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowRedirect(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowInboundEchoRequest(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowInboundEchoRequest(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowOutboundTimeExceeded(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowOutboundTimeExceeded(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowOutboundParameterProblem(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowOutboundParameterProblem(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowOutboundSourceQuench(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowOutboundSourceQuench(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowInboundRouterRequest(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowInboundRouterRequest(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowInboundTimestampRequest(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowInboundTimestampRequest(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowInboundMaskRequest(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowInboundMaskRequest(
-        VARIANT_BOOL allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AllowOutboundPacketTooBig(
-        VARIANT_BOOL *allow) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_AllowOutboundPacketTooBig(
-        VARIANT_BOOL allow) = 0;
-
-};
-#else
-typedef struct INetFwIcmpSettingsVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwIcmpSettings* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwIcmpSettings* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwIcmpSettings* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwIcmpSettings* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwIcmpSettings* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwIcmpSettings* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwIcmpSettings* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwIcmpSettings methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_AllowOutboundDestinationUnreachable)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowOutboundDestinationUnreachable)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowRedirect)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowRedirect)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowInboundEchoRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowInboundEchoRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowOutboundTimeExceeded)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowOutboundTimeExceeded)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowOutboundParameterProblem)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowOutboundParameterProblem)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowOutboundSourceQuench)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowOutboundSourceQuench)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowInboundRouterRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowInboundRouterRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowInboundTimestampRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowInboundTimestampRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowInboundMaskRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowInboundMaskRequest)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    HRESULT (STDMETHODCALLTYPE *get_AllowOutboundPacketTooBig)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL *allow);
-
-    HRESULT (STDMETHODCALLTYPE *put_AllowOutboundPacketTooBig)(
-        INetFwIcmpSettings* This,
-        VARIANT_BOOL allow);
-
-    END_INTERFACE
-} INetFwIcmpSettingsVtbl;
-interface INetFwIcmpSettings {
-    CONST_VTBL INetFwIcmpSettingsVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwIcmpSettings_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwIcmpSettings_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwIcmpSettings_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwIcmpSettings_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwIcmpSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwIcmpSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwIcmpSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwIcmpSettings methods ***/
-#define INetFwIcmpSettings_get_AllowOutboundDestinationUnreachable(This,allow) (This)->lpVtbl->get_AllowOutboundDestinationUnreachable(This,allow)
-#define INetFwIcmpSettings_put_AllowOutboundDestinationUnreachable(This,allow) (This)->lpVtbl->put_AllowOutboundDestinationUnreachable(This,allow)
-#define INetFwIcmpSettings_get_AllowRedirect(This,allow) (This)->lpVtbl->get_AllowRedirect(This,allow)
-#define INetFwIcmpSettings_put_AllowRedirect(This,allow) (This)->lpVtbl->put_AllowRedirect(This,allow)
-#define INetFwIcmpSettings_get_AllowInboundEchoRequest(This,allow) (This)->lpVtbl->get_AllowInboundEchoRequest(This,allow)
-#define INetFwIcmpSettings_put_AllowInboundEchoRequest(This,allow) (This)->lpVtbl->put_AllowInboundEchoRequest(This,allow)
-#define INetFwIcmpSettings_get_AllowOutboundTimeExceeded(This,allow) (This)->lpVtbl->get_AllowOutboundTimeExceeded(This,allow)
-#define INetFwIcmpSettings_put_AllowOutboundTimeExceeded(This,allow) (This)->lpVtbl->put_AllowOutboundTimeExceeded(This,allow)
-#define INetFwIcmpSettings_get_AllowOutboundParameterProblem(This,allow) (This)->lpVtbl->get_AllowOutboundParameterProblem(This,allow)
-#define INetFwIcmpSettings_put_AllowOutboundParameterProblem(This,allow) (This)->lpVtbl->put_AllowOutboundParameterProblem(This,allow)
-#define INetFwIcmpSettings_get_AllowOutboundSourceQuench(This,allow) (This)->lpVtbl->get_AllowOutboundSourceQuench(This,allow)
-#define INetFwIcmpSettings_put_AllowOutboundSourceQuench(This,allow) (This)->lpVtbl->put_AllowOutboundSourceQuench(This,allow)
-#define INetFwIcmpSettings_get_AllowInboundRouterRequest(This,allow) (This)->lpVtbl->get_AllowInboundRouterRequest(This,allow)
-#define INetFwIcmpSettings_put_AllowInboundRouterRequest(This,allow) (This)->lpVtbl->put_AllowInboundRouterRequest(This,allow)
-#define INetFwIcmpSettings_get_AllowInboundTimestampRequest(This,allow) (This)->lpVtbl->get_AllowInboundTimestampRequest(This,allow)
-#define INetFwIcmpSettings_put_AllowInboundTimestampRequest(This,allow) (This)->lpVtbl->put_AllowInboundTimestampRequest(This,allow)
-#define INetFwIcmpSettings_get_AllowInboundMaskRequest(This,allow) (This)->lpVtbl->get_AllowInboundMaskRequest(This,allow)
-#define INetFwIcmpSettings_put_AllowInboundMaskRequest(This,allow) (This)->lpVtbl->put_AllowInboundMaskRequest(This,allow)
-#define INetFwIcmpSettings_get_AllowOutboundPacketTooBig(This,allow) (This)->lpVtbl->get_AllowOutboundPacketTooBig(This,allow)
-#define INetFwIcmpSettings_put_AllowOutboundPacketTooBig(This,allow) (This)->lpVtbl->put_AllowOutboundPacketTooBig(This,allow)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowOutboundDestinationUnreachable_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowOutboundDestinationUnreachable_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowOutboundDestinationUnreachable_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowOutboundDestinationUnreachable_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowRedirect_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowRedirect_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowRedirect_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowRedirect_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowInboundEchoRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowInboundEchoRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowInboundEchoRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowInboundEchoRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowOutboundTimeExceeded_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowOutboundTimeExceeded_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowOutboundTimeExceeded_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowOutboundTimeExceeded_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowOutboundParameterProblem_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowOutboundParameterProblem_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowOutboundParameterProblem_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowOutboundParameterProblem_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowOutboundSourceQuench_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowOutboundSourceQuench_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowOutboundSourceQuench_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowOutboundSourceQuench_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowInboundRouterRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowInboundRouterRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowInboundRouterRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowInboundRouterRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowInboundTimestampRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowInboundTimestampRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowInboundTimestampRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowInboundTimestampRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowInboundMaskRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowInboundMaskRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowInboundMaskRequest_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowInboundMaskRequest_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_get_AllowOutboundPacketTooBig_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL *allow);
-void __RPC_STUB INetFwIcmpSettings_get_AllowOutboundPacketTooBig_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwIcmpSettings_put_AllowOutboundPacketTooBig_Proxy(
-    INetFwIcmpSettings* This,
-    VARIANT_BOOL allow);
-void __RPC_STUB INetFwIcmpSettings_put_AllowOutboundPacketTooBig_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwIcmpSettings_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwOpenPort interface
- */
-#ifndef __INetFwOpenPort_INTERFACE_DEFINED__
-#define __INetFwOpenPort_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwOpenPort, 0xe0483ba0, 0x47ff, 0x4d9c, 0xa6,0xd6, 0x77,0x41,0xd0,0xb1,0x95,0xf7);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwOpenPort : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Name(
-        BSTR *name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Name(
-        BSTR name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_IpVersion(
-        NET_FW_IP_VERSION *ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_IpVersion(
-        NET_FW_IP_VERSION ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Protocol(
-        NET_FW_IP_PROTOCOL *ipProtocol) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Protocol(
-        NET_FW_IP_PROTOCOL ipProtocol) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Port(
-        LONG *portNumber) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Port(
-        LONG portNumber) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Scope(
-        NET_FW_SCOPE *scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Scope(
-        NET_FW_SCOPE scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemoteAddresses(
-        BSTR *remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_RemoteAddresses(
-        BSTR remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Enabled(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Enabled(
-        VARIANT_BOOL enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_BuiltIn(
-        VARIANT_BOOL *builtIn) = 0;
-
-};
-#else
-typedef struct INetFwOpenPortVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwOpenPort* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwOpenPort* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwOpenPort* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwOpenPort* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwOpenPort* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwOpenPort* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwOpenPort* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwOpenPort methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Name)(
-        INetFwOpenPort* This,
-        BSTR *name);
-
-    HRESULT (STDMETHODCALLTYPE *put_Name)(
-        INetFwOpenPort* This,
-        BSTR name);
-
-    HRESULT (STDMETHODCALLTYPE *get_IpVersion)(
-        INetFwOpenPort* This,
-        NET_FW_IP_VERSION *ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *put_IpVersion)(
-        INetFwOpenPort* This,
-        NET_FW_IP_VERSION ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *get_Protocol)(
-        INetFwOpenPort* This,
-        NET_FW_IP_PROTOCOL *ipProtocol);
-
-    HRESULT (STDMETHODCALLTYPE *put_Protocol)(
-        INetFwOpenPort* This,
-        NET_FW_IP_PROTOCOL ipProtocol);
-
-    HRESULT (STDMETHODCALLTYPE *get_Port)(
-        INetFwOpenPort* This,
-        LONG *portNumber);
-
-    HRESULT (STDMETHODCALLTYPE *put_Port)(
-        INetFwOpenPort* This,
-        LONG portNumber);
-
-    HRESULT (STDMETHODCALLTYPE *get_Scope)(
-        INetFwOpenPort* This,
-        NET_FW_SCOPE *scope);
-
-    HRESULT (STDMETHODCALLTYPE *put_Scope)(
-        INetFwOpenPort* This,
-        NET_FW_SCOPE scope);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAddresses)(
-        INetFwOpenPort* This,
-        BSTR *remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemoteAddresses)(
-        INetFwOpenPort* This,
-        BSTR remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_Enabled)(
-        INetFwOpenPort* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_Enabled)(
-        INetFwOpenPort* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_BuiltIn)(
-        INetFwOpenPort* This,
-        VARIANT_BOOL *builtIn);
-
-    END_INTERFACE
-} INetFwOpenPortVtbl;
-interface INetFwOpenPort {
-    CONST_VTBL INetFwOpenPortVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwOpenPort_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwOpenPort_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwOpenPort_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwOpenPort_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwOpenPort_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwOpenPort_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwOpenPort_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwOpenPort methods ***/
-#define INetFwOpenPort_get_Name(This,name) (This)->lpVtbl->get_Name(This,name)
-#define INetFwOpenPort_put_Name(This,name) (This)->lpVtbl->put_Name(This,name)
-#define INetFwOpenPort_get_IpVersion(This,ipVersion) (This)->lpVtbl->get_IpVersion(This,ipVersion)
-#define INetFwOpenPort_put_IpVersion(This,ipVersion) (This)->lpVtbl->put_IpVersion(This,ipVersion)
-#define INetFwOpenPort_get_Protocol(This,ipProtocol) (This)->lpVtbl->get_Protocol(This,ipProtocol)
-#define INetFwOpenPort_put_Protocol(This,ipProtocol) (This)->lpVtbl->put_Protocol(This,ipProtocol)
-#define INetFwOpenPort_get_Port(This,portNumber) (This)->lpVtbl->get_Port(This,portNumber)
-#define INetFwOpenPort_put_Port(This,portNumber) (This)->lpVtbl->put_Port(This,portNumber)
-#define INetFwOpenPort_get_Scope(This,scope) (This)->lpVtbl->get_Scope(This,scope)
-#define INetFwOpenPort_put_Scope(This,scope) (This)->lpVtbl->put_Scope(This,scope)
-#define INetFwOpenPort_get_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->get_RemoteAddresses(This,remoteAddrs)
-#define INetFwOpenPort_put_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->put_RemoteAddresses(This,remoteAddrs)
-#define INetFwOpenPort_get_Enabled(This,enabled) (This)->lpVtbl->get_Enabled(This,enabled)
-#define INetFwOpenPort_put_Enabled(This,enabled) (This)->lpVtbl->put_Enabled(This,enabled)
-#define INetFwOpenPort_get_BuiltIn(This,builtIn) (This)->lpVtbl->get_BuiltIn(This,builtIn)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_Name_Proxy(
-    INetFwOpenPort* This,
-    BSTR *name);
-void __RPC_STUB INetFwOpenPort_get_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_Name_Proxy(
-    INetFwOpenPort* This,
-    BSTR name);
-void __RPC_STUB INetFwOpenPort_put_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_IpVersion_Proxy(
-    INetFwOpenPort* This,
-    NET_FW_IP_VERSION *ipVersion);
-void __RPC_STUB INetFwOpenPort_get_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_IpVersion_Proxy(
-    INetFwOpenPort* This,
-    NET_FW_IP_VERSION ipVersion);
-void __RPC_STUB INetFwOpenPort_put_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_Protocol_Proxy(
-    INetFwOpenPort* This,
-    NET_FW_IP_PROTOCOL *ipProtocol);
-void __RPC_STUB INetFwOpenPort_get_Protocol_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_Protocol_Proxy(
-    INetFwOpenPort* This,
-    NET_FW_IP_PROTOCOL ipProtocol);
-void __RPC_STUB INetFwOpenPort_put_Protocol_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_Port_Proxy(
-    INetFwOpenPort* This,
-    LONG *portNumber);
-void __RPC_STUB INetFwOpenPort_get_Port_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_Port_Proxy(
-    INetFwOpenPort* This,
-    LONG portNumber);
-void __RPC_STUB INetFwOpenPort_put_Port_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_Scope_Proxy(
-    INetFwOpenPort* This,
-    NET_FW_SCOPE *scope);
-void __RPC_STUB INetFwOpenPort_get_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_Scope_Proxy(
-    INetFwOpenPort* This,
-    NET_FW_SCOPE scope);
-void __RPC_STUB INetFwOpenPort_put_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_RemoteAddresses_Proxy(
-    INetFwOpenPort* This,
-    BSTR *remoteAddrs);
-void __RPC_STUB INetFwOpenPort_get_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_RemoteAddresses_Proxy(
-    INetFwOpenPort* This,
-    BSTR remoteAddrs);
-void __RPC_STUB INetFwOpenPort_put_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_Enabled_Proxy(
-    INetFwOpenPort* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwOpenPort_get_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_put_Enabled_Proxy(
-    INetFwOpenPort* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwOpenPort_put_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPort_get_BuiltIn_Proxy(
-    INetFwOpenPort* This,
-    VARIANT_BOOL *builtIn);
-void __RPC_STUB INetFwOpenPort_get_BuiltIn_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwOpenPort_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwOpenPorts interface
- */
-#ifndef __INetFwOpenPorts_INTERFACE_DEFINED__
-#define __INetFwOpenPorts_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwOpenPorts, 0xc0e9d7fa, 0xe07e, 0x430a, 0xb1,0x9a, 0x09,0x0c,0xe8,0x2d,0x92,0xe2);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwOpenPorts : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Count(
-        LONG *count) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Add(
-        INetFwOpenPort *port) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Remove(
-        LONG portNumber,
-        NET_FW_IP_PROTOCOL ipProtocol) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Item(
-        LONG portNumber,
-        NET_FW_IP_PROTOCOL ipProtocol,
-        INetFwOpenPort **openPort) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
-        IUnknown **newEnum) = 0;
-
-};
-#else
-typedef struct INetFwOpenPortsVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwOpenPorts* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwOpenPorts* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwOpenPorts* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwOpenPorts* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwOpenPorts* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwOpenPorts* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwOpenPorts* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwOpenPorts methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Count)(
-        INetFwOpenPorts* This,
-        LONG *count);
-
-    HRESULT (STDMETHODCALLTYPE *Add)(
-        INetFwOpenPorts* This,
-        INetFwOpenPort *port);
-
-    HRESULT (STDMETHODCALLTYPE *Remove)(
-        INetFwOpenPorts* This,
-        LONG portNumber,
-        NET_FW_IP_PROTOCOL ipProtocol);
-
-    HRESULT (STDMETHODCALLTYPE *Item)(
-        INetFwOpenPorts* This,
-        LONG portNumber,
-        NET_FW_IP_PROTOCOL ipProtocol,
-        INetFwOpenPort **openPort);
-
-    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
-        INetFwOpenPorts* This,
-        IUnknown **newEnum);
-
-    END_INTERFACE
-} INetFwOpenPortsVtbl;
-interface INetFwOpenPorts {
-    CONST_VTBL INetFwOpenPortsVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwOpenPorts_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwOpenPorts_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwOpenPorts_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwOpenPorts_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwOpenPorts_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwOpenPorts_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwOpenPorts_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwOpenPorts methods ***/
-#define INetFwOpenPorts_get_Count(This,count) (This)->lpVtbl->get_Count(This,count)
-#define INetFwOpenPorts_Add(This,port) (This)->lpVtbl->Add(This,port)
-#define INetFwOpenPorts_Remove(This,portNumber,ipProtocol) (This)->lpVtbl->Remove(This,portNumber,ipProtocol)
-#define INetFwOpenPorts_Item(This,portNumber,ipProtocol,openPort) (This)->lpVtbl->Item(This,portNumber,ipProtocol,openPort)
-#define INetFwOpenPorts_get__NewEnum(This,newEnum) (This)->lpVtbl->get__NewEnum(This,newEnum)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwOpenPorts_get_Count_Proxy(
-    INetFwOpenPorts* This,
-    LONG *count);
-void __RPC_STUB INetFwOpenPorts_get_Count_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPorts_Add_Proxy(
-    INetFwOpenPorts* This,
-    INetFwOpenPort *port);
-void __RPC_STUB INetFwOpenPorts_Add_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPorts_Remove_Proxy(
-    INetFwOpenPorts* This,
-    LONG portNumber,
-    NET_FW_IP_PROTOCOL ipProtocol);
-void __RPC_STUB INetFwOpenPorts_Remove_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPorts_Item_Proxy(
-    INetFwOpenPorts* This,
-    LONG portNumber,
-    NET_FW_IP_PROTOCOL ipProtocol,
-    INetFwOpenPort **openPort);
-void __RPC_STUB INetFwOpenPorts_Item_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwOpenPorts_get__NewEnum_Proxy(
-    INetFwOpenPorts* This,
-    IUnknown **newEnum);
-void __RPC_STUB INetFwOpenPorts_get__NewEnum_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwOpenPorts_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwService interface
- */
-#ifndef __INetFwService_INTERFACE_DEFINED__
-#define __INetFwService_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwService, 0x79fd57c8, 0x908e, 0x4a36, 0x98,0x88, 0xd5,0xb3,0xf0,0xa4,0x44,0xcf);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwService : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Name(
-        BSTR *name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Type(
-        NET_FW_SERVICE_TYPE *type) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Customized(
-        VARIANT_BOOL *customized) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_IpVersion(
-        NET_FW_IP_VERSION *ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_IpVersion(
-        NET_FW_IP_VERSION ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Scope(
-        NET_FW_SCOPE *scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Scope(
-        NET_FW_SCOPE scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemoteAddresses(
-        BSTR *remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_RemoteAddresses(
-        BSTR remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Enabled(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Enabled(
-        VARIANT_BOOL enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_GloballyOpenPorts(
-        INetFwOpenPorts **openPorts) = 0;
-
-};
-#else
-typedef struct INetFwServiceVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwService* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwService* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwService* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwService* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwService* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwService* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwService* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwService methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Name)(
-        INetFwService* This,
-        BSTR *name);
-
-    HRESULT (STDMETHODCALLTYPE *get_Type)(
-        INetFwService* This,
-        NET_FW_SERVICE_TYPE *type);
-
-    HRESULT (STDMETHODCALLTYPE *get_Customized)(
-        INetFwService* This,
-        VARIANT_BOOL *customized);
-
-    HRESULT (STDMETHODCALLTYPE *get_IpVersion)(
-        INetFwService* This,
-        NET_FW_IP_VERSION *ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *put_IpVersion)(
-        INetFwService* This,
-        NET_FW_IP_VERSION ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *get_Scope)(
-        INetFwService* This,
-        NET_FW_SCOPE *scope);
-
-    HRESULT (STDMETHODCALLTYPE *put_Scope)(
-        INetFwService* This,
-        NET_FW_SCOPE scope);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAddresses)(
-        INetFwService* This,
-        BSTR *remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemoteAddresses)(
-        INetFwService* This,
-        BSTR remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_Enabled)(
-        INetFwService* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_Enabled)(
-        INetFwService* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_GloballyOpenPorts)(
-        INetFwService* This,
-        INetFwOpenPorts **openPorts);
-
-    END_INTERFACE
-} INetFwServiceVtbl;
-interface INetFwService {
-    CONST_VTBL INetFwServiceVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwService_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwService_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwService_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwService_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwService_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwService_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwService_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwService methods ***/
-#define INetFwService_get_Name(This,name) (This)->lpVtbl->get_Name(This,name)
-#define INetFwService_get_Type(This,type) (This)->lpVtbl->get_Type(This,type)
-#define INetFwService_get_Customized(This,customized) (This)->lpVtbl->get_Customized(This,customized)
-#define INetFwService_get_IpVersion(This,ipVersion) (This)->lpVtbl->get_IpVersion(This,ipVersion)
-#define INetFwService_put_IpVersion(This,ipVersion) (This)->lpVtbl->put_IpVersion(This,ipVersion)
-#define INetFwService_get_Scope(This,scope) (This)->lpVtbl->get_Scope(This,scope)
-#define INetFwService_put_Scope(This,scope) (This)->lpVtbl->put_Scope(This,scope)
-#define INetFwService_get_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->get_RemoteAddresses(This,remoteAddrs)
-#define INetFwService_put_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->put_RemoteAddresses(This,remoteAddrs)
-#define INetFwService_get_Enabled(This,enabled) (This)->lpVtbl->get_Enabled(This,enabled)
-#define INetFwService_put_Enabled(This,enabled) (This)->lpVtbl->put_Enabled(This,enabled)
-#define INetFwService_get_GloballyOpenPorts(This,openPorts) (This)->lpVtbl->get_GloballyOpenPorts(This,openPorts)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwService_get_Name_Proxy(
-    INetFwService* This,
-    BSTR *name);
-void __RPC_STUB INetFwService_get_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_Type_Proxy(
-    INetFwService* This,
-    NET_FW_SERVICE_TYPE *type);
-void __RPC_STUB INetFwService_get_Type_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_Customized_Proxy(
-    INetFwService* This,
-    VARIANT_BOOL *customized);
-void __RPC_STUB INetFwService_get_Customized_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_IpVersion_Proxy(
-    INetFwService* This,
-    NET_FW_IP_VERSION *ipVersion);
-void __RPC_STUB INetFwService_get_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_put_IpVersion_Proxy(
-    INetFwService* This,
-    NET_FW_IP_VERSION ipVersion);
-void __RPC_STUB INetFwService_put_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_Scope_Proxy(
-    INetFwService* This,
-    NET_FW_SCOPE *scope);
-void __RPC_STUB INetFwService_get_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_put_Scope_Proxy(
-    INetFwService* This,
-    NET_FW_SCOPE scope);
-void __RPC_STUB INetFwService_put_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_RemoteAddresses_Proxy(
-    INetFwService* This,
-    BSTR *remoteAddrs);
-void __RPC_STUB INetFwService_get_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_put_RemoteAddresses_Proxy(
-    INetFwService* This,
-    BSTR remoteAddrs);
-void __RPC_STUB INetFwService_put_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_Enabled_Proxy(
-    INetFwService* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwService_get_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_put_Enabled_Proxy(
-    INetFwService* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwService_put_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwService_get_GloballyOpenPorts_Proxy(
-    INetFwService* This,
-    INetFwOpenPorts **openPorts);
-void __RPC_STUB INetFwService_get_GloballyOpenPorts_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwService_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwServices interface
- */
-#ifndef __INetFwServices_INTERFACE_DEFINED__
-#define __INetFwServices_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwServices, 0x79649bb4, 0x903e, 0x421b, 0x94,0xc9, 0x79,0x84,0x8e,0x79,0xf6,0xee);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwServices : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Count(
-        LONG *count) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Item(
-        NET_FW_SERVICE_TYPE svcType,
-        INetFwService **service) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
-        IUnknown **newEnum) = 0;
-
-};
-#else
-typedef struct INetFwServicesVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwServices* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwServices* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwServices* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwServices* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwServices* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwServices* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwServices* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwServices methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Count)(
-        INetFwServices* This,
-        LONG *count);
-
-    HRESULT (STDMETHODCALLTYPE *Item)(
-        INetFwServices* This,
-        NET_FW_SERVICE_TYPE svcType,
-        INetFwService **service);
-
-    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
-        INetFwServices* This,
-        IUnknown **newEnum);
-
-    END_INTERFACE
-} INetFwServicesVtbl;
-interface INetFwServices {
-    CONST_VTBL INetFwServicesVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwServices_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwServices_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwServices_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwServices_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwServices_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwServices_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwServices_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwServices methods ***/
-#define INetFwServices_get_Count(This,count) (This)->lpVtbl->get_Count(This,count)
-#define INetFwServices_Item(This,svcType,service) (This)->lpVtbl->Item(This,svcType,service)
-#define INetFwServices_get__NewEnum(This,newEnum) (This)->lpVtbl->get__NewEnum(This,newEnum)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwServices_get_Count_Proxy(
-    INetFwServices* This,
-    LONG *count);
-void __RPC_STUB INetFwServices_get_Count_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwServices_Item_Proxy(
-    INetFwServices* This,
-    NET_FW_SERVICE_TYPE svcType,
-    INetFwService **service);
-void __RPC_STUB INetFwServices_Item_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwServices_get__NewEnum_Proxy(
-    INetFwServices* This,
-    IUnknown **newEnum);
-void __RPC_STUB INetFwServices_get__NewEnum_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwServices_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwAuthorizedApplication interface
- */
-#ifndef __INetFwAuthorizedApplication_INTERFACE_DEFINED__
-#define __INetFwAuthorizedApplication_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwAuthorizedApplication, 0xb5e64ffa, 0xc2c5, 0x444e, 0xa3,0x01, 0xfb,0x5e,0x00,0x01,0x80,0x50);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwAuthorizedApplication : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Name(
-        BSTR *name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Name(
-        BSTR name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_ProcessImageFileName(
-        BSTR *imageFileName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_ProcessImageFileName(
-        BSTR imageFileName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_IpVersion(
-        NET_FW_IP_VERSION *ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_IpVersion(
-        NET_FW_IP_VERSION ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Scope(
-        NET_FW_SCOPE *scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Scope(
-        NET_FW_SCOPE scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemoteAddresses(
-        BSTR *remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_RemoteAddresses(
-        BSTR remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Enabled(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Enabled(
-        VARIANT_BOOL enabled) = 0;
-
-};
-#else
-typedef struct INetFwAuthorizedApplicationVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwAuthorizedApplication* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwAuthorizedApplication* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwAuthorizedApplication* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwAuthorizedApplication* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwAuthorizedApplication* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwAuthorizedApplication* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwAuthorizedApplication* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwAuthorizedApplication methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Name)(
-        INetFwAuthorizedApplication* This,
-        BSTR *name);
-
-    HRESULT (STDMETHODCALLTYPE *put_Name)(
-        INetFwAuthorizedApplication* This,
-        BSTR name);
-
-    HRESULT (STDMETHODCALLTYPE *get_ProcessImageFileName)(
-        INetFwAuthorizedApplication* This,
-        BSTR *imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *put_ProcessImageFileName)(
-        INetFwAuthorizedApplication* This,
-        BSTR imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *get_IpVersion)(
-        INetFwAuthorizedApplication* This,
-        NET_FW_IP_VERSION *ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *put_IpVersion)(
-        INetFwAuthorizedApplication* This,
-        NET_FW_IP_VERSION ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *get_Scope)(
-        INetFwAuthorizedApplication* This,
-        NET_FW_SCOPE *scope);
-
-    HRESULT (STDMETHODCALLTYPE *put_Scope)(
-        INetFwAuthorizedApplication* This,
-        NET_FW_SCOPE scope);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAddresses)(
-        INetFwAuthorizedApplication* This,
-        BSTR *remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemoteAddresses)(
-        INetFwAuthorizedApplication* This,
-        BSTR remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_Enabled)(
-        INetFwAuthorizedApplication* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_Enabled)(
-        INetFwAuthorizedApplication* This,
-        VARIANT_BOOL enabled);
-
-    END_INTERFACE
-} INetFwAuthorizedApplicationVtbl;
-interface INetFwAuthorizedApplication {
-    CONST_VTBL INetFwAuthorizedApplicationVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwAuthorizedApplication_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwAuthorizedApplication_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwAuthorizedApplication_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwAuthorizedApplication_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwAuthorizedApplication_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwAuthorizedApplication_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwAuthorizedApplication_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwAuthorizedApplication methods ***/
-#define INetFwAuthorizedApplication_get_Name(This,name) (This)->lpVtbl->get_Name(This,name)
-#define INetFwAuthorizedApplication_put_Name(This,name) (This)->lpVtbl->put_Name(This,name)
-#define INetFwAuthorizedApplication_get_ProcessImageFileName(This,imageFileName) (This)->lpVtbl->get_ProcessImageFileName(This,imageFileName)
-#define INetFwAuthorizedApplication_put_ProcessImageFileName(This,imageFileName) (This)->lpVtbl->put_ProcessImageFileName(This,imageFileName)
-#define INetFwAuthorizedApplication_get_IpVersion(This,ipVersion) (This)->lpVtbl->get_IpVersion(This,ipVersion)
-#define INetFwAuthorizedApplication_put_IpVersion(This,ipVersion) (This)->lpVtbl->put_IpVersion(This,ipVersion)
-#define INetFwAuthorizedApplication_get_Scope(This,scope) (This)->lpVtbl->get_Scope(This,scope)
-#define INetFwAuthorizedApplication_put_Scope(This,scope) (This)->lpVtbl->put_Scope(This,scope)
-#define INetFwAuthorizedApplication_get_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->get_RemoteAddresses(This,remoteAddrs)
-#define INetFwAuthorizedApplication_put_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->put_RemoteAddresses(This,remoteAddrs)
-#define INetFwAuthorizedApplication_get_Enabled(This,enabled) (This)->lpVtbl->get_Enabled(This,enabled)
-#define INetFwAuthorizedApplication_put_Enabled(This,enabled) (This)->lpVtbl->put_Enabled(This,enabled)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_get_Name_Proxy(
-    INetFwAuthorizedApplication* This,
-    BSTR *name);
-void __RPC_STUB INetFwAuthorizedApplication_get_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_put_Name_Proxy(
-    INetFwAuthorizedApplication* This,
-    BSTR name);
-void __RPC_STUB INetFwAuthorizedApplication_put_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_get_ProcessImageFileName_Proxy(
-    INetFwAuthorizedApplication* This,
-    BSTR *imageFileName);
-void __RPC_STUB INetFwAuthorizedApplication_get_ProcessImageFileName_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_put_ProcessImageFileName_Proxy(
-    INetFwAuthorizedApplication* This,
-    BSTR imageFileName);
-void __RPC_STUB INetFwAuthorizedApplication_put_ProcessImageFileName_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_get_IpVersion_Proxy(
-    INetFwAuthorizedApplication* This,
-    NET_FW_IP_VERSION *ipVersion);
-void __RPC_STUB INetFwAuthorizedApplication_get_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_put_IpVersion_Proxy(
-    INetFwAuthorizedApplication* This,
-    NET_FW_IP_VERSION ipVersion);
-void __RPC_STUB INetFwAuthorizedApplication_put_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_get_Scope_Proxy(
-    INetFwAuthorizedApplication* This,
-    NET_FW_SCOPE *scope);
-void __RPC_STUB INetFwAuthorizedApplication_get_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_put_Scope_Proxy(
-    INetFwAuthorizedApplication* This,
-    NET_FW_SCOPE scope);
-void __RPC_STUB INetFwAuthorizedApplication_put_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_get_RemoteAddresses_Proxy(
-    INetFwAuthorizedApplication* This,
-    BSTR *remoteAddrs);
-void __RPC_STUB INetFwAuthorizedApplication_get_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_put_RemoteAddresses_Proxy(
-    INetFwAuthorizedApplication* This,
-    BSTR remoteAddrs);
-void __RPC_STUB INetFwAuthorizedApplication_put_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_get_Enabled_Proxy(
-    INetFwAuthorizedApplication* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwAuthorizedApplication_get_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplication_put_Enabled_Proxy(
-    INetFwAuthorizedApplication* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwAuthorizedApplication_put_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwAuthorizedApplication_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwRule interface
- */
-#ifndef __INetFwRule_INTERFACE_DEFINED__
-#define __INetFwRule_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwRule, 0xaf230d27, 0xbaba, 0x4e42, 0xac,0xed, 0xf5,0x24,0xf2,0x2c,0xfc,0xe2);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwRule : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Name(
-        BSTR *name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Name(
-        BSTR name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Description(
-        BSTR *desc) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Description(
-        BSTR desc) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_ApplicationName(
-        BSTR *imageFileName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_ApplicationName(
-        BSTR imageFileName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_ServiceName(
-        BSTR *serviceName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_ServiceName(
-        BSTR serviceName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Protocol(
-        LONG *protocol) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Protocol(
-        LONG protocol) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_LocalPorts(
-        BSTR *portNumbers) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_LocalPorts(
-        BSTR portNumbers) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemotePorts(
-        BSTR *portNumbers) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_RemotePorts(
-        BSTR portNumbers) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_LocalAddresses(
-        BSTR *localAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_LocalAddresses(
-        BSTR localAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemoteAddresses(
-        BSTR *remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_RemoteAddresses(
-        BSTR remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_IcmpTypesAndCodes(
-        BSTR *icmpTypesAndCodes) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_IcmpTypesAndCodes(
-        BSTR icmpTypesAndCodes) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Direction(
-        NET_FW_RULE_DIRECTION *dir) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Direction(
-        NET_FW_RULE_DIRECTION dir) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Interfaces(
-        VARIANT *interfaces) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Interfaces(
-        VARIANT interfaces) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_InterfaceTypes(
-        BSTR *interfaceTypes) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_InterfaceTypes(
-        BSTR interfaceTypes) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Enabled(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Enabled(
-        VARIANT_BOOL enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Grouping(
-        BSTR *context) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Grouping(
-        BSTR context) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Profiles(
-        LONG *profileTypesBitmask) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Profiles(
-        LONG profileTypesBitmask) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_EdgeTraversal(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_EdgeTraversal(
-        VARIANT_BOOL enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Action(
-        NET_FW_ACTION *action) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Action(
-        NET_FW_ACTION action) = 0;
-
-};
-#else
-typedef struct INetFwRuleVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwRule* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwRule* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwRule* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwRule* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwRule* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwRule* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwRule* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwRule methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Name)(
-        INetFwRule* This,
-        BSTR *name);
-
-    HRESULT (STDMETHODCALLTYPE *put_Name)(
-        INetFwRule* This,
-        BSTR name);
-
-    HRESULT (STDMETHODCALLTYPE *get_Description)(
-        INetFwRule* This,
-        BSTR *desc);
-
-    HRESULT (STDMETHODCALLTYPE *put_Description)(
-        INetFwRule* This,
-        BSTR desc);
-
-    HRESULT (STDMETHODCALLTYPE *get_ApplicationName)(
-        INetFwRule* This,
-        BSTR *imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *put_ApplicationName)(
-        INetFwRule* This,
-        BSTR imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *get_ServiceName)(
-        INetFwRule* This,
-        BSTR *serviceName);
-
-    HRESULT (STDMETHODCALLTYPE *put_ServiceName)(
-        INetFwRule* This,
-        BSTR serviceName);
-
-    HRESULT (STDMETHODCALLTYPE *get_Protocol)(
-        INetFwRule* This,
-        LONG *protocol);
-
-    HRESULT (STDMETHODCALLTYPE *put_Protocol)(
-        INetFwRule* This,
-        LONG protocol);
-
-    HRESULT (STDMETHODCALLTYPE *get_LocalPorts)(
-        INetFwRule* This,
-        BSTR *portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *put_LocalPorts)(
-        INetFwRule* This,
-        BSTR portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemotePorts)(
-        INetFwRule* This,
-        BSTR *portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemotePorts)(
-        INetFwRule* This,
-        BSTR portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *get_LocalAddresses)(
-        INetFwRule* This,
-        BSTR *localAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_LocalAddresses)(
-        INetFwRule* This,
-        BSTR localAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAddresses)(
-        INetFwRule* This,
-        BSTR *remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemoteAddresses)(
-        INetFwRule* This,
-        BSTR remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_IcmpTypesAndCodes)(
-        INetFwRule* This,
-        BSTR *icmpTypesAndCodes);
-
-    HRESULT (STDMETHODCALLTYPE *put_IcmpTypesAndCodes)(
-        INetFwRule* This,
-        BSTR icmpTypesAndCodes);
-
-    HRESULT (STDMETHODCALLTYPE *get_Direction)(
-        INetFwRule* This,
-        NET_FW_RULE_DIRECTION *dir);
-
-    HRESULT (STDMETHODCALLTYPE *put_Direction)(
-        INetFwRule* This,
-        NET_FW_RULE_DIRECTION dir);
-
-    HRESULT (STDMETHODCALLTYPE *get_Interfaces)(
-        INetFwRule* This,
-        VARIANT *interfaces);
-
-    HRESULT (STDMETHODCALLTYPE *put_Interfaces)(
-        INetFwRule* This,
-        VARIANT interfaces);
-
-    HRESULT (STDMETHODCALLTYPE *get_InterfaceTypes)(
-        INetFwRule* This,
-        BSTR *interfaceTypes);
-
-    HRESULT (STDMETHODCALLTYPE *put_InterfaceTypes)(
-        INetFwRule* This,
-        BSTR interfaceTypes);
-
-    HRESULT (STDMETHODCALLTYPE *get_Enabled)(
-        INetFwRule* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_Enabled)(
-        INetFwRule* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_Grouping)(
-        INetFwRule* This,
-        BSTR *context);
-
-    HRESULT (STDMETHODCALLTYPE *put_Grouping)(
-        INetFwRule* This,
-        BSTR context);
-
-    HRESULT (STDMETHODCALLTYPE *get_Profiles)(
-        INetFwRule* This,
-        LONG *profileTypesBitmask);
-
-    HRESULT (STDMETHODCALLTYPE *put_Profiles)(
-        INetFwRule* This,
-        LONG profileTypesBitmask);
-
-    HRESULT (STDMETHODCALLTYPE *get_EdgeTraversal)(
-        INetFwRule* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_EdgeTraversal)(
-        INetFwRule* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_Action)(
-        INetFwRule* This,
-        NET_FW_ACTION *action);
-
-    HRESULT (STDMETHODCALLTYPE *put_Action)(
-        INetFwRule* This,
-        NET_FW_ACTION action);
-
-    END_INTERFACE
-} INetFwRuleVtbl;
-interface INetFwRule {
-    CONST_VTBL INetFwRuleVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwRule_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwRule_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwRule_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwRule_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwRule_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwRule_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwRule_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwRule methods ***/
-#define INetFwRule_get_Name(This,name) (This)->lpVtbl->get_Name(This,name)
-#define INetFwRule_put_Name(This,name) (This)->lpVtbl->put_Name(This,name)
-#define INetFwRule_get_Description(This,desc) (This)->lpVtbl->get_Description(This,desc)
-#define INetFwRule_put_Description(This,desc) (This)->lpVtbl->put_Description(This,desc)
-#define INetFwRule_get_ApplicationName(This,imageFileName) (This)->lpVtbl->get_ApplicationName(This,imageFileName)
-#define INetFwRule_put_ApplicationName(This,imageFileName) (This)->lpVtbl->put_ApplicationName(This,imageFileName)
-#define INetFwRule_get_ServiceName(This,serviceName) (This)->lpVtbl->get_ServiceName(This,serviceName)
-#define INetFwRule_put_ServiceName(This,serviceName) (This)->lpVtbl->put_ServiceName(This,serviceName)
-#define INetFwRule_get_Protocol(This,protocol) (This)->lpVtbl->get_Protocol(This,protocol)
-#define INetFwRule_put_Protocol(This,protocol) (This)->lpVtbl->put_Protocol(This,protocol)
-#define INetFwRule_get_LocalPorts(This,portNumbers) (This)->lpVtbl->get_LocalPorts(This,portNumbers)
-#define INetFwRule_put_LocalPorts(This,portNumbers) (This)->lpVtbl->put_LocalPorts(This,portNumbers)
-#define INetFwRule_get_RemotePorts(This,portNumbers) (This)->lpVtbl->get_RemotePorts(This,portNumbers)
-#define INetFwRule_put_RemotePorts(This,portNumbers) (This)->lpVtbl->put_RemotePorts(This,portNumbers)
-#define INetFwRule_get_LocalAddresses(This,localAddrs) (This)->lpVtbl->get_LocalAddresses(This,localAddrs)
-#define INetFwRule_put_LocalAddresses(This,localAddrs) (This)->lpVtbl->put_LocalAddresses(This,localAddrs)
-#define INetFwRule_get_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->get_RemoteAddresses(This,remoteAddrs)
-#define INetFwRule_put_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->put_RemoteAddresses(This,remoteAddrs)
-#define INetFwRule_get_IcmpTypesAndCodes(This,icmpTypesAndCodes) (This)->lpVtbl->get_IcmpTypesAndCodes(This,icmpTypesAndCodes)
-#define INetFwRule_put_IcmpTypesAndCodes(This,icmpTypesAndCodes) (This)->lpVtbl->put_IcmpTypesAndCodes(This,icmpTypesAndCodes)
-#define INetFwRule_get_Direction(This,dir) (This)->lpVtbl->get_Direction(This,dir)
-#define INetFwRule_put_Direction(This,dir) (This)->lpVtbl->put_Direction(This,dir)
-#define INetFwRule_get_Interfaces(This,interfaces) (This)->lpVtbl->get_Interfaces(This,interfaces)
-#define INetFwRule_put_Interfaces(This,interfaces) (This)->lpVtbl->put_Interfaces(This,interfaces)
-#define INetFwRule_get_InterfaceTypes(This,interfaceTypes) (This)->lpVtbl->get_InterfaceTypes(This,interfaceTypes)
-#define INetFwRule_put_InterfaceTypes(This,interfaceTypes) (This)->lpVtbl->put_InterfaceTypes(This,interfaceTypes)
-#define INetFwRule_get_Enabled(This,enabled) (This)->lpVtbl->get_Enabled(This,enabled)
-#define INetFwRule_put_Enabled(This,enabled) (This)->lpVtbl->put_Enabled(This,enabled)
-#define INetFwRule_get_Grouping(This,context) (This)->lpVtbl->get_Grouping(This,context)
-#define INetFwRule_put_Grouping(This,context) (This)->lpVtbl->put_Grouping(This,context)
-#define INetFwRule_get_Profiles(This,profileTypesBitmask) (This)->lpVtbl->get_Profiles(This,profileTypesBitmask)
-#define INetFwRule_put_Profiles(This,profileTypesBitmask) (This)->lpVtbl->put_Profiles(This,profileTypesBitmask)
-#define INetFwRule_get_EdgeTraversal(This,enabled) (This)->lpVtbl->get_EdgeTraversal(This,enabled)
-#define INetFwRule_put_EdgeTraversal(This,enabled) (This)->lpVtbl->put_EdgeTraversal(This,enabled)
-#define INetFwRule_get_Action(This,action) (This)->lpVtbl->get_Action(This,action)
-#define INetFwRule_put_Action(This,action) (This)->lpVtbl->put_Action(This,action)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Name_Proxy(
-    INetFwRule* This,
-    BSTR *name);
-void __RPC_STUB INetFwRule_get_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Name_Proxy(
-    INetFwRule* This,
-    BSTR name);
-void __RPC_STUB INetFwRule_put_Name_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Description_Proxy(
-    INetFwRule* This,
-    BSTR *desc);
-void __RPC_STUB INetFwRule_get_Description_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Description_Proxy(
-    INetFwRule* This,
-    BSTR desc);
-void __RPC_STUB INetFwRule_put_Description_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_ApplicationName_Proxy(
-    INetFwRule* This,
-    BSTR *imageFileName);
-void __RPC_STUB INetFwRule_get_ApplicationName_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_ApplicationName_Proxy(
-    INetFwRule* This,
-    BSTR imageFileName);
-void __RPC_STUB INetFwRule_put_ApplicationName_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_ServiceName_Proxy(
-    INetFwRule* This,
-    BSTR *serviceName);
-void __RPC_STUB INetFwRule_get_ServiceName_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_ServiceName_Proxy(
-    INetFwRule* This,
-    BSTR serviceName);
-void __RPC_STUB INetFwRule_put_ServiceName_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Protocol_Proxy(
-    INetFwRule* This,
-    LONG *protocol);
-void __RPC_STUB INetFwRule_get_Protocol_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Protocol_Proxy(
-    INetFwRule* This,
-    LONG protocol);
-void __RPC_STUB INetFwRule_put_Protocol_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_LocalPorts_Proxy(
-    INetFwRule* This,
-    BSTR *portNumbers);
-void __RPC_STUB INetFwRule_get_LocalPorts_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_LocalPorts_Proxy(
-    INetFwRule* This,
-    BSTR portNumbers);
-void __RPC_STUB INetFwRule_put_LocalPorts_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_RemotePorts_Proxy(
-    INetFwRule* This,
-    BSTR *portNumbers);
-void __RPC_STUB INetFwRule_get_RemotePorts_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_RemotePorts_Proxy(
-    INetFwRule* This,
-    BSTR portNumbers);
-void __RPC_STUB INetFwRule_put_RemotePorts_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_LocalAddresses_Proxy(
-    INetFwRule* This,
-    BSTR *localAddrs);
-void __RPC_STUB INetFwRule_get_LocalAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_LocalAddresses_Proxy(
-    INetFwRule* This,
-    BSTR localAddrs);
-void __RPC_STUB INetFwRule_put_LocalAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_RemoteAddresses_Proxy(
-    INetFwRule* This,
-    BSTR *remoteAddrs);
-void __RPC_STUB INetFwRule_get_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_RemoteAddresses_Proxy(
-    INetFwRule* This,
-    BSTR remoteAddrs);
-void __RPC_STUB INetFwRule_put_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_IcmpTypesAndCodes_Proxy(
-    INetFwRule* This,
-    BSTR *icmpTypesAndCodes);
-void __RPC_STUB INetFwRule_get_IcmpTypesAndCodes_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_IcmpTypesAndCodes_Proxy(
-    INetFwRule* This,
-    BSTR icmpTypesAndCodes);
-void __RPC_STUB INetFwRule_put_IcmpTypesAndCodes_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Direction_Proxy(
-    INetFwRule* This,
-    NET_FW_RULE_DIRECTION *dir);
-void __RPC_STUB INetFwRule_get_Direction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Direction_Proxy(
-    INetFwRule* This,
-    NET_FW_RULE_DIRECTION dir);
-void __RPC_STUB INetFwRule_put_Direction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Interfaces_Proxy(
-    INetFwRule* This,
-    VARIANT *interfaces);
-void __RPC_STUB INetFwRule_get_Interfaces_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Interfaces_Proxy(
-    INetFwRule* This,
-    VARIANT interfaces);
-void __RPC_STUB INetFwRule_put_Interfaces_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_InterfaceTypes_Proxy(
-    INetFwRule* This,
-    BSTR *interfaceTypes);
-void __RPC_STUB INetFwRule_get_InterfaceTypes_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_InterfaceTypes_Proxy(
-    INetFwRule* This,
-    BSTR interfaceTypes);
-void __RPC_STUB INetFwRule_put_InterfaceTypes_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Enabled_Proxy(
-    INetFwRule* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwRule_get_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Enabled_Proxy(
-    INetFwRule* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwRule_put_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Grouping_Proxy(
-    INetFwRule* This,
-    BSTR *context);
-void __RPC_STUB INetFwRule_get_Grouping_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Grouping_Proxy(
-    INetFwRule* This,
-    BSTR context);
-void __RPC_STUB INetFwRule_put_Grouping_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Profiles_Proxy(
-    INetFwRule* This,
-    LONG *profileTypesBitmask);
-void __RPC_STUB INetFwRule_get_Profiles_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Profiles_Proxy(
-    INetFwRule* This,
-    LONG profileTypesBitmask);
-void __RPC_STUB INetFwRule_put_Profiles_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_EdgeTraversal_Proxy(
-    INetFwRule* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwRule_get_EdgeTraversal_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_EdgeTraversal_Proxy(
-    INetFwRule* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwRule_put_EdgeTraversal_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_get_Action_Proxy(
-    INetFwRule* This,
-    NET_FW_ACTION *action);
-void __RPC_STUB INetFwRule_get_Action_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule_put_Action_Proxy(
-    INetFwRule* This,
-    NET_FW_ACTION action);
-void __RPC_STUB INetFwRule_put_Action_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwRule_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwRule2 interface
- */
-#ifndef __INetFwRule2_INTERFACE_DEFINED__
-#define __INetFwRule2_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwRule2, 0x9c27c8da, 0x189b, 0x4dde, 0x89,0xf7, 0x8b,0x39,0xa3,0x16,0x78,0x2c);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwRule2 : public INetFwRule
-{
-    virtual HRESULT STDMETHODCALLTYPE get_EdgeTraversalOptions(
-        LONG *lOptions) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_EdgeTraversalOptions(
-        LONG lOptions) = 0;
-
-};
-#else
-typedef struct INetFwRule2Vtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwRule2* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwRule2* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwRule2* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwRule2* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwRule2* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwRule2* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwRule2* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwRule methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Name)(
-        INetFwRule2* This,
-        BSTR *name);
-
-    HRESULT (STDMETHODCALLTYPE *put_Name)(
-        INetFwRule2* This,
-        BSTR name);
-
-    HRESULT (STDMETHODCALLTYPE *get_Description)(
-        INetFwRule2* This,
-        BSTR *desc);
-
-    HRESULT (STDMETHODCALLTYPE *put_Description)(
-        INetFwRule2* This,
-        BSTR desc);
-
-    HRESULT (STDMETHODCALLTYPE *get_ApplicationName)(
-        INetFwRule2* This,
-        BSTR *imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *put_ApplicationName)(
-        INetFwRule2* This,
-        BSTR imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *get_ServiceName)(
-        INetFwRule2* This,
-        BSTR *serviceName);
-
-    HRESULT (STDMETHODCALLTYPE *put_ServiceName)(
-        INetFwRule2* This,
-        BSTR serviceName);
-
-    HRESULT (STDMETHODCALLTYPE *get_Protocol)(
-        INetFwRule2* This,
-        LONG *protocol);
-
-    HRESULT (STDMETHODCALLTYPE *put_Protocol)(
-        INetFwRule2* This,
-        LONG protocol);
-
-    HRESULT (STDMETHODCALLTYPE *get_LocalPorts)(
-        INetFwRule2* This,
-        BSTR *portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *put_LocalPorts)(
-        INetFwRule2* This,
-        BSTR portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemotePorts)(
-        INetFwRule2* This,
-        BSTR *portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemotePorts)(
-        INetFwRule2* This,
-        BSTR portNumbers);
-
-    HRESULT (STDMETHODCALLTYPE *get_LocalAddresses)(
-        INetFwRule2* This,
-        BSTR *localAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_LocalAddresses)(
-        INetFwRule2* This,
-        BSTR localAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAddresses)(
-        INetFwRule2* This,
-        BSTR *remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemoteAddresses)(
-        INetFwRule2* This,
-        BSTR remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_IcmpTypesAndCodes)(
-        INetFwRule2* This,
-        BSTR *icmpTypesAndCodes);
-
-    HRESULT (STDMETHODCALLTYPE *put_IcmpTypesAndCodes)(
-        INetFwRule2* This,
-        BSTR icmpTypesAndCodes);
-
-    HRESULT (STDMETHODCALLTYPE *get_Direction)(
-        INetFwRule2* This,
-        NET_FW_RULE_DIRECTION *dir);
-
-    HRESULT (STDMETHODCALLTYPE *put_Direction)(
-        INetFwRule2* This,
-        NET_FW_RULE_DIRECTION dir);
-
-    HRESULT (STDMETHODCALLTYPE *get_Interfaces)(
-        INetFwRule2* This,
-        VARIANT *interfaces);
-
-    HRESULT (STDMETHODCALLTYPE *put_Interfaces)(
-        INetFwRule2* This,
-        VARIANT interfaces);
-
-    HRESULT (STDMETHODCALLTYPE *get_InterfaceTypes)(
-        INetFwRule2* This,
-        BSTR *interfaceTypes);
-
-    HRESULT (STDMETHODCALLTYPE *put_InterfaceTypes)(
-        INetFwRule2* This,
-        BSTR interfaceTypes);
-
-    HRESULT (STDMETHODCALLTYPE *get_Enabled)(
-        INetFwRule2* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_Enabled)(
-        INetFwRule2* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_Grouping)(
-        INetFwRule2* This,
-        BSTR *context);
-
-    HRESULT (STDMETHODCALLTYPE *put_Grouping)(
-        INetFwRule2* This,
-        BSTR context);
-
-    HRESULT (STDMETHODCALLTYPE *get_Profiles)(
-        INetFwRule2* This,
-        LONG *profileTypesBitmask);
-
-    HRESULT (STDMETHODCALLTYPE *put_Profiles)(
-        INetFwRule2* This,
-        LONG profileTypesBitmask);
-
-    HRESULT (STDMETHODCALLTYPE *get_EdgeTraversal)(
-        INetFwRule2* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_EdgeTraversal)(
-        INetFwRule2* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_Action)(
-        INetFwRule2* This,
-        NET_FW_ACTION *action);
-
-    HRESULT (STDMETHODCALLTYPE *put_Action)(
-        INetFwRule2* This,
-        NET_FW_ACTION action);
-
-    /*** INetFwRule2 methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_EdgeTraversalOptions)(
-        INetFwRule2* This,
-        LONG *lOptions);
-
-    HRESULT (STDMETHODCALLTYPE *put_EdgeTraversalOptions)(
-        INetFwRule2* This,
-        LONG lOptions);
-
-    END_INTERFACE
-} INetFwRule2Vtbl;
-interface INetFwRule2 {
-    CONST_VTBL INetFwRule2Vtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwRule2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwRule2_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwRule2_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwRule2_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwRule2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwRule2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwRule2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwRule methods ***/
-#define INetFwRule2_get_Name(This,name) (This)->lpVtbl->get_Name(This,name)
-#define INetFwRule2_put_Name(This,name) (This)->lpVtbl->put_Name(This,name)
-#define INetFwRule2_get_Description(This,desc) (This)->lpVtbl->get_Description(This,desc)
-#define INetFwRule2_put_Description(This,desc) (This)->lpVtbl->put_Description(This,desc)
-#define INetFwRule2_get_ApplicationName(This,imageFileName) (This)->lpVtbl->get_ApplicationName(This,imageFileName)
-#define INetFwRule2_put_ApplicationName(This,imageFileName) (This)->lpVtbl->put_ApplicationName(This,imageFileName)
-#define INetFwRule2_get_ServiceName(This,serviceName) (This)->lpVtbl->get_ServiceName(This,serviceName)
-#define INetFwRule2_put_ServiceName(This,serviceName) (This)->lpVtbl->put_ServiceName(This,serviceName)
-#define INetFwRule2_get_Protocol(This,protocol) (This)->lpVtbl->get_Protocol(This,protocol)
-#define INetFwRule2_put_Protocol(This,protocol) (This)->lpVtbl->put_Protocol(This,protocol)
-#define INetFwRule2_get_LocalPorts(This,portNumbers) (This)->lpVtbl->get_LocalPorts(This,portNumbers)
-#define INetFwRule2_put_LocalPorts(This,portNumbers) (This)->lpVtbl->put_LocalPorts(This,portNumbers)
-#define INetFwRule2_get_RemotePorts(This,portNumbers) (This)->lpVtbl->get_RemotePorts(This,portNumbers)
-#define INetFwRule2_put_RemotePorts(This,portNumbers) (This)->lpVtbl->put_RemotePorts(This,portNumbers)
-#define INetFwRule2_get_LocalAddresses(This,localAddrs) (This)->lpVtbl->get_LocalAddresses(This,localAddrs)
-#define INetFwRule2_put_LocalAddresses(This,localAddrs) (This)->lpVtbl->put_LocalAddresses(This,localAddrs)
-#define INetFwRule2_get_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->get_RemoteAddresses(This,remoteAddrs)
-#define INetFwRule2_put_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->put_RemoteAddresses(This,remoteAddrs)
-#define INetFwRule2_get_IcmpTypesAndCodes(This,icmpTypesAndCodes) (This)->lpVtbl->get_IcmpTypesAndCodes(This,icmpTypesAndCodes)
-#define INetFwRule2_put_IcmpTypesAndCodes(This,icmpTypesAndCodes) (This)->lpVtbl->put_IcmpTypesAndCodes(This,icmpTypesAndCodes)
-#define INetFwRule2_get_Direction(This,dir) (This)->lpVtbl->get_Direction(This,dir)
-#define INetFwRule2_put_Direction(This,dir) (This)->lpVtbl->put_Direction(This,dir)
-#define INetFwRule2_get_Interfaces(This,interfaces) (This)->lpVtbl->get_Interfaces(This,interfaces)
-#define INetFwRule2_put_Interfaces(This,interfaces) (This)->lpVtbl->put_Interfaces(This,interfaces)
-#define INetFwRule2_get_InterfaceTypes(This,interfaceTypes) (This)->lpVtbl->get_InterfaceTypes(This,interfaceTypes)
-#define INetFwRule2_put_InterfaceTypes(This,interfaceTypes) (This)->lpVtbl->put_InterfaceTypes(This,interfaceTypes)
-#define INetFwRule2_get_Enabled(This,enabled) (This)->lpVtbl->get_Enabled(This,enabled)
-#define INetFwRule2_put_Enabled(This,enabled) (This)->lpVtbl->put_Enabled(This,enabled)
-#define INetFwRule2_get_Grouping(This,context) (This)->lpVtbl->get_Grouping(This,context)
-#define INetFwRule2_put_Grouping(This,context) (This)->lpVtbl->put_Grouping(This,context)
-#define INetFwRule2_get_Profiles(This,profileTypesBitmask) (This)->lpVtbl->get_Profiles(This,profileTypesBitmask)
-#define INetFwRule2_put_Profiles(This,profileTypesBitmask) (This)->lpVtbl->put_Profiles(This,profileTypesBitmask)
-#define INetFwRule2_get_EdgeTraversal(This,enabled) (This)->lpVtbl->get_EdgeTraversal(This,enabled)
-#define INetFwRule2_put_EdgeTraversal(This,enabled) (This)->lpVtbl->put_EdgeTraversal(This,enabled)
-#define INetFwRule2_get_Action(This,action) (This)->lpVtbl->get_Action(This,action)
-#define INetFwRule2_put_Action(This,action) (This)->lpVtbl->put_Action(This,action)
-/*** INetFwRule2 methods ***/
-#define INetFwRule2_get_EdgeTraversalOptions(This,lOptions) (This)->lpVtbl->get_EdgeTraversalOptions(This,lOptions)
-#define INetFwRule2_put_EdgeTraversalOptions(This,lOptions) (This)->lpVtbl->put_EdgeTraversalOptions(This,lOptions)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwRule2_get_EdgeTraversalOptions_Proxy(
-    INetFwRule2* This,
-    LONG *lOptions);
-void __RPC_STUB INetFwRule2_get_EdgeTraversalOptions_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRule2_put_EdgeTraversalOptions_Proxy(
-    INetFwRule2* This,
-    LONG lOptions);
-void __RPC_STUB INetFwRule2_put_EdgeTraversalOptions_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwRule2_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwRules interface
- */
-#ifndef __INetFwRules_INTERFACE_DEFINED__
-#define __INetFwRules_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwRules, 0x9c4c6277, 0x5027, 0x441e, 0xaf,0xae, 0xca,0x1f,0x54,0x2d,0xa0,0x09);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwRules : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Count(
-        LONG *count) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Add(
-        INetFwRule *rule) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Remove(
-        BSTR name) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Item(
-        BSTR name,
-        INetFwRule **rule) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
-        IUnknown **newEnum) = 0;
-
-};
-#else
-typedef struct INetFwRulesVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwRules* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwRules* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwRules* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwRules* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwRules* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwRules* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwRules* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwRules methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Count)(
-        INetFwRules* This,
-        LONG *count);
-
-    HRESULT (STDMETHODCALLTYPE *Add)(
-        INetFwRules* This,
-        INetFwRule *rule);
-
-    HRESULT (STDMETHODCALLTYPE *Remove)(
-        INetFwRules* This,
-        BSTR name);
-
-    HRESULT (STDMETHODCALLTYPE *Item)(
-        INetFwRules* This,
-        BSTR name,
-        INetFwRule **rule);
-
-    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
-        INetFwRules* This,
-        IUnknown **newEnum);
-
-    END_INTERFACE
-} INetFwRulesVtbl;
-interface INetFwRules {
-    CONST_VTBL INetFwRulesVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwRules_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwRules_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwRules_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwRules_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwRules_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwRules_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwRules_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwRules methods ***/
-#define INetFwRules_get_Count(This,count) (This)->lpVtbl->get_Count(This,count)
-#define INetFwRules_Add(This,rule) (This)->lpVtbl->Add(This,rule)
-#define INetFwRules_Remove(This,name) (This)->lpVtbl->Remove(This,name)
-#define INetFwRules_Item(This,name,rule) (This)->lpVtbl->Item(This,name,rule)
-#define INetFwRules_get__NewEnum(This,newEnum) (This)->lpVtbl->get__NewEnum(This,newEnum)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwRules_get_Count_Proxy(
-    INetFwRules* This,
-    LONG *count);
-void __RPC_STUB INetFwRules_get_Count_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRules_Add_Proxy(
-    INetFwRules* This,
-    INetFwRule *rule);
-void __RPC_STUB INetFwRules_Add_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRules_Remove_Proxy(
-    INetFwRules* This,
-    BSTR name);
-void __RPC_STUB INetFwRules_Remove_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRules_Item_Proxy(
-    INetFwRules* This,
-    BSTR name,
-    INetFwRule **rule);
-void __RPC_STUB INetFwRules_Item_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRules_get__NewEnum_Proxy(
-    INetFwRules* This,
-    IUnknown **newEnum);
-void __RPC_STUB INetFwRules_get__NewEnum_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwRules_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwRemoteAdminSettings interface
- */
-#ifndef __INetFwRemoteAdminSettings_INTERFACE_DEFINED__
-#define __INetFwRemoteAdminSettings_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwRemoteAdminSettings, 0xd4becddf, 0x6f73, 0x4a83, 0xb8,0x32, 0x9c,0x66,0x87,0x4c,0xd2,0x0e);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwRemoteAdminSettings : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_IpVersion(
-        NET_FW_IP_VERSION *ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_IpVersion(
-        NET_FW_IP_VERSION ipVersion) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Scope(
-        NET_FW_SCOPE *scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Scope(
-        NET_FW_SCOPE scope) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemoteAddresses(
-        BSTR *remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_RemoteAddresses(
-        BSTR remoteAddrs) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Enabled(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_Enabled(
-        VARIANT_BOOL enabled) = 0;
-
-};
-#else
-typedef struct INetFwRemoteAdminSettingsVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwRemoteAdminSettings* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwRemoteAdminSettings* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwRemoteAdminSettings* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwRemoteAdminSettings* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwRemoteAdminSettings* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwRemoteAdminSettings* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwRemoteAdminSettings* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwRemoteAdminSettings methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_IpVersion)(
-        INetFwRemoteAdminSettings* This,
-        NET_FW_IP_VERSION *ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *put_IpVersion)(
-        INetFwRemoteAdminSettings* This,
-        NET_FW_IP_VERSION ipVersion);
-
-    HRESULT (STDMETHODCALLTYPE *get_Scope)(
-        INetFwRemoteAdminSettings* This,
-        NET_FW_SCOPE *scope);
-
-    HRESULT (STDMETHODCALLTYPE *put_Scope)(
-        INetFwRemoteAdminSettings* This,
-        NET_FW_SCOPE scope);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAddresses)(
-        INetFwRemoteAdminSettings* This,
-        BSTR *remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *put_RemoteAddresses)(
-        INetFwRemoteAdminSettings* This,
-        BSTR remoteAddrs);
-
-    HRESULT (STDMETHODCALLTYPE *get_Enabled)(
-        INetFwRemoteAdminSettings* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_Enabled)(
-        INetFwRemoteAdminSettings* This,
-        VARIANT_BOOL enabled);
-
-    END_INTERFACE
-} INetFwRemoteAdminSettingsVtbl;
-interface INetFwRemoteAdminSettings {
-    CONST_VTBL INetFwRemoteAdminSettingsVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwRemoteAdminSettings_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwRemoteAdminSettings_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwRemoteAdminSettings_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwRemoteAdminSettings_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwRemoteAdminSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwRemoteAdminSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwRemoteAdminSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwRemoteAdminSettings methods ***/
-#define INetFwRemoteAdminSettings_get_IpVersion(This,ipVersion) (This)->lpVtbl->get_IpVersion(This,ipVersion)
-#define INetFwRemoteAdminSettings_put_IpVersion(This,ipVersion) (This)->lpVtbl->put_IpVersion(This,ipVersion)
-#define INetFwRemoteAdminSettings_get_Scope(This,scope) (This)->lpVtbl->get_Scope(This,scope)
-#define INetFwRemoteAdminSettings_put_Scope(This,scope) (This)->lpVtbl->put_Scope(This,scope)
-#define INetFwRemoteAdminSettings_get_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->get_RemoteAddresses(This,remoteAddrs)
-#define INetFwRemoteAdminSettings_put_RemoteAddresses(This,remoteAddrs) (This)->lpVtbl->put_RemoteAddresses(This,remoteAddrs)
-#define INetFwRemoteAdminSettings_get_Enabled(This,enabled) (This)->lpVtbl->get_Enabled(This,enabled)
-#define INetFwRemoteAdminSettings_put_Enabled(This,enabled) (This)->lpVtbl->put_Enabled(This,enabled)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_get_IpVersion_Proxy(
-    INetFwRemoteAdminSettings* This,
-    NET_FW_IP_VERSION *ipVersion);
-void __RPC_STUB INetFwRemoteAdminSettings_get_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_put_IpVersion_Proxy(
-    INetFwRemoteAdminSettings* This,
-    NET_FW_IP_VERSION ipVersion);
-void __RPC_STUB INetFwRemoteAdminSettings_put_IpVersion_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_get_Scope_Proxy(
-    INetFwRemoteAdminSettings* This,
-    NET_FW_SCOPE *scope);
-void __RPC_STUB INetFwRemoteAdminSettings_get_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_put_Scope_Proxy(
-    INetFwRemoteAdminSettings* This,
-    NET_FW_SCOPE scope);
-void __RPC_STUB INetFwRemoteAdminSettings_put_Scope_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_get_RemoteAddresses_Proxy(
-    INetFwRemoteAdminSettings* This,
-    BSTR *remoteAddrs);
-void __RPC_STUB INetFwRemoteAdminSettings_get_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_put_RemoteAddresses_Proxy(
-    INetFwRemoteAdminSettings* This,
-    BSTR remoteAddrs);
-void __RPC_STUB INetFwRemoteAdminSettings_put_RemoteAddresses_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_get_Enabled_Proxy(
-    INetFwRemoteAdminSettings* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwRemoteAdminSettings_get_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwRemoteAdminSettings_put_Enabled_Proxy(
-    INetFwRemoteAdminSettings* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwRemoteAdminSettings_put_Enabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwRemoteAdminSettings_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwAuthorizedApplications interface
- */
-#ifndef __INetFwAuthorizedApplications_INTERFACE_DEFINED__
-#define __INetFwAuthorizedApplications_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwAuthorizedApplications, 0x644efd52, 0xccf9, 0x486c, 0x97,0xa2, 0x39,0xf3,0x52,0x57,0x0b,0x30);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwAuthorizedApplications : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Count(
-        LONG *count) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Add(
-        INetFwAuthorizedApplication *app) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Remove(
-        BSTR imageFileName) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE Item(
-        BSTR imageFileName,
-        INetFwAuthorizedApplication **app) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
-        IUnknown **newEnum) = 0;
-
-};
-#else
-typedef struct INetFwAuthorizedApplicationsVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwAuthorizedApplications* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwAuthorizedApplications* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwAuthorizedApplications* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwAuthorizedApplications* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwAuthorizedApplications* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwAuthorizedApplications* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwAuthorizedApplications* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwAuthorizedApplications methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Count)(
-        INetFwAuthorizedApplications* This,
-        LONG *count);
-
-    HRESULT (STDMETHODCALLTYPE *Add)(
-        INetFwAuthorizedApplications* This,
-        INetFwAuthorizedApplication *app);
-
-    HRESULT (STDMETHODCALLTYPE *Remove)(
-        INetFwAuthorizedApplications* This,
-        BSTR imageFileName);
-
-    HRESULT (STDMETHODCALLTYPE *Item)(
-        INetFwAuthorizedApplications* This,
-        BSTR imageFileName,
-        INetFwAuthorizedApplication **app);
-
-    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
-        INetFwAuthorizedApplications* This,
-        IUnknown **newEnum);
-
-    END_INTERFACE
-} INetFwAuthorizedApplicationsVtbl;
-interface INetFwAuthorizedApplications {
-    CONST_VTBL INetFwAuthorizedApplicationsVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwAuthorizedApplications_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwAuthorizedApplications_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwAuthorizedApplications_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwAuthorizedApplications_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwAuthorizedApplications_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwAuthorizedApplications_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwAuthorizedApplications_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwAuthorizedApplications methods ***/
-#define INetFwAuthorizedApplications_get_Count(This,count) (This)->lpVtbl->get_Count(This,count)
-#define INetFwAuthorizedApplications_Add(This,app) (This)->lpVtbl->Add(This,app)
-#define INetFwAuthorizedApplications_Remove(This,imageFileName) (This)->lpVtbl->Remove(This,imageFileName)
-#define INetFwAuthorizedApplications_Item(This,imageFileName,app) (This)->lpVtbl->Item(This,imageFileName,app)
-#define INetFwAuthorizedApplications_get__NewEnum(This,newEnum) (This)->lpVtbl->get__NewEnum(This,newEnum)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplications_get_Count_Proxy(
-    INetFwAuthorizedApplications* This,
-    LONG *count);
-void __RPC_STUB INetFwAuthorizedApplications_get_Count_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplications_Add_Proxy(
-    INetFwAuthorizedApplications* This,
-    INetFwAuthorizedApplication *app);
-void __RPC_STUB INetFwAuthorizedApplications_Add_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplications_Remove_Proxy(
-    INetFwAuthorizedApplications* This,
-    BSTR imageFileName);
-void __RPC_STUB INetFwAuthorizedApplications_Remove_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplications_Item_Proxy(
-    INetFwAuthorizedApplications* This,
-    BSTR imageFileName,
-    INetFwAuthorizedApplication **app);
-void __RPC_STUB INetFwAuthorizedApplications_Item_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwAuthorizedApplications_get__NewEnum_Proxy(
-    INetFwAuthorizedApplications* This,
-    IUnknown **newEnum);
-void __RPC_STUB INetFwAuthorizedApplications_get__NewEnum_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwAuthorizedApplications_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwServiceRestriction interface
- */
-#ifndef __INetFwServiceRestriction_INTERFACE_DEFINED__
-#define __INetFwServiceRestriction_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwServiceRestriction, 0x8267bbe3, 0xf890, 0x491c, 0xb7,0xb6, 0x2d,0xb1,0xef,0x0e,0x5d,0x2b);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwServiceRestriction : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE RestrictService(
-        BSTR serviceName,
-        BSTR appName,
-        VARIANT_BOOL restrictService,
-        VARIANT_BOOL serviceSidRestricted) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE ServiceRestricted(
-        BSTR serviceName,
-        BSTR appName,
-        VARIANT_BOOL *serviceRestricted) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Rules(
-        INetFwRules **rules) = 0;
-
-};
-#else
-typedef struct INetFwServiceRestrictionVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwServiceRestriction* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwServiceRestriction* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwServiceRestriction* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwServiceRestriction* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwServiceRestriction* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwServiceRestriction* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwServiceRestriction* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwServiceRestriction methods ***/
-    HRESULT (STDMETHODCALLTYPE *RestrictService)(
-        INetFwServiceRestriction* This,
-        BSTR serviceName,
-        BSTR appName,
-        VARIANT_BOOL restrictService,
-        VARIANT_BOOL serviceSidRestricted);
-
-    HRESULT (STDMETHODCALLTYPE *ServiceRestricted)(
-        INetFwServiceRestriction* This,
-        BSTR serviceName,
-        BSTR appName,
-        VARIANT_BOOL *serviceRestricted);
-
-    HRESULT (STDMETHODCALLTYPE *get_Rules)(
-        INetFwServiceRestriction* This,
-        INetFwRules **rules);
-
-    END_INTERFACE
-} INetFwServiceRestrictionVtbl;
-interface INetFwServiceRestriction {
-    CONST_VTBL INetFwServiceRestrictionVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwServiceRestriction_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwServiceRestriction_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwServiceRestriction_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwServiceRestriction_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwServiceRestriction_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwServiceRestriction_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwServiceRestriction_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwServiceRestriction methods ***/
-#define INetFwServiceRestriction_RestrictService(This,serviceName,appName,restrictService,serviceSidRestricted) (This)->lpVtbl->RestrictService(This,serviceName,appName,restrictService,serviceSidRestricted)
-#define INetFwServiceRestriction_ServiceRestricted(This,serviceName,appName,serviceRestricted) (This)->lpVtbl->ServiceRestricted(This,serviceName,appName,serviceRestricted)
-#define INetFwServiceRestriction_get_Rules(This,rules) (This)->lpVtbl->get_Rules(This,rules)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwServiceRestriction_RestrictService_Proxy(
-    INetFwServiceRestriction* This,
-    BSTR serviceName,
-    BSTR appName,
-    VARIANT_BOOL restrictService,
-    VARIANT_BOOL serviceSidRestricted);
-void __RPC_STUB INetFwServiceRestriction_RestrictService_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwServiceRestriction_ServiceRestricted_Proxy(
-    INetFwServiceRestriction* This,
-    BSTR serviceName,
-    BSTR appName,
-    VARIANT_BOOL *serviceRestricted);
-void __RPC_STUB INetFwServiceRestriction_ServiceRestricted_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwServiceRestriction_get_Rules_Proxy(
-    INetFwServiceRestriction* This,
-    INetFwRules **rules);
-void __RPC_STUB INetFwServiceRestriction_get_Rules_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwServiceRestriction_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwProfile interface
- */
-#ifndef __INetFwProfile_INTERFACE_DEFINED__
-#define __INetFwProfile_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwProfile, 0x174a0dda, 0xe9f9, 0x449d, 0x99,0x3b, 0x21,0xab,0x66,0x7c,0xa4,0x56);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwProfile : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_Type(
-        NET_FW_PROFILE_TYPE *type) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_FirewallEnabled(
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_FirewallEnabled(
-        VARIANT_BOOL enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_ExceptionsNotAllowed(
-        VARIANT_BOOL *notAllowed) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_ExceptionsNotAllowed(
-        VARIANT_BOOL notAllowed) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_NotificationsDisabled(
-        VARIANT_BOOL *disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_NotificationsDisabled(
-        VARIANT_BOOL disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_UnicastResponsesToMulticastBroadcastDisabled(
-        VARIANT_BOOL *disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_UnicastResponsesToMulticastBroadcastDisabled(
-        VARIANT_BOOL disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_RemoteAdminSettings(
-        INetFwRemoteAdminSettings **remoteAdminSettings) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_IcmpSettings(
-        INetFwIcmpSettings **icmpSettings) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_GloballyOpenPorts(
-        INetFwOpenPorts **openPorts) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Services(
-        INetFwServices **services) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_AuthorizedApplications(
-        INetFwAuthorizedApplications **apps) = 0;
-
-};
-#else
-typedef struct INetFwProfileVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwProfile* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwProfile* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwProfile* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwProfile* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwProfile* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwProfile* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwProfile* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwProfile methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_Type)(
-        INetFwProfile* This,
-        NET_FW_PROFILE_TYPE *type);
-
-    HRESULT (STDMETHODCALLTYPE *get_FirewallEnabled)(
-        INetFwProfile* This,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_FirewallEnabled)(
-        INetFwProfile* This,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_ExceptionsNotAllowed)(
-        INetFwProfile* This,
-        VARIANT_BOOL *notAllowed);
-
-    HRESULT (STDMETHODCALLTYPE *put_ExceptionsNotAllowed)(
-        INetFwProfile* This,
-        VARIANT_BOOL notAllowed);
-
-    HRESULT (STDMETHODCALLTYPE *get_NotificationsDisabled)(
-        INetFwProfile* This,
-        VARIANT_BOOL *disabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_NotificationsDisabled)(
-        INetFwProfile* This,
-        VARIANT_BOOL disabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_UnicastResponsesToMulticastBroadcastDisabled)(
-        INetFwProfile* This,
-        VARIANT_BOOL *disabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_UnicastResponsesToMulticastBroadcastDisabled)(
-        INetFwProfile* This,
-        VARIANT_BOOL disabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_RemoteAdminSettings)(
-        INetFwProfile* This,
-        INetFwRemoteAdminSettings **remoteAdminSettings);
-
-    HRESULT (STDMETHODCALLTYPE *get_IcmpSettings)(
-        INetFwProfile* This,
-        INetFwIcmpSettings **icmpSettings);
-
-    HRESULT (STDMETHODCALLTYPE *get_GloballyOpenPorts)(
-        INetFwProfile* This,
-        INetFwOpenPorts **openPorts);
-
-    HRESULT (STDMETHODCALLTYPE *get_Services)(
-        INetFwProfile* This,
-        INetFwServices **services);
-
-    HRESULT (STDMETHODCALLTYPE *get_AuthorizedApplications)(
-        INetFwProfile* This,
-        INetFwAuthorizedApplications **apps);
-
-    END_INTERFACE
-} INetFwProfileVtbl;
-interface INetFwProfile {
-    CONST_VTBL INetFwProfileVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwProfile_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwProfile_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwProfile_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwProfile_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwProfile_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwProfile_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwProfile_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwProfile methods ***/
-#define INetFwProfile_get_Type(This,type) (This)->lpVtbl->get_Type(This,type)
-#define INetFwProfile_get_FirewallEnabled(This,enabled) (This)->lpVtbl->get_FirewallEnabled(This,enabled)
-#define INetFwProfile_put_FirewallEnabled(This,enabled) (This)->lpVtbl->put_FirewallEnabled(This,enabled)
-#define INetFwProfile_get_ExceptionsNotAllowed(This,notAllowed) (This)->lpVtbl->get_ExceptionsNotAllowed(This,notAllowed)
-#define INetFwProfile_put_ExceptionsNotAllowed(This,notAllowed) (This)->lpVtbl->put_ExceptionsNotAllowed(This,notAllowed)
-#define INetFwProfile_get_NotificationsDisabled(This,disabled) (This)->lpVtbl->get_NotificationsDisabled(This,disabled)
-#define INetFwProfile_put_NotificationsDisabled(This,disabled) (This)->lpVtbl->put_NotificationsDisabled(This,disabled)
-#define INetFwProfile_get_UnicastResponsesToMulticastBroadcastDisabled(This,disabled) (This)->lpVtbl->get_UnicastResponsesToMulticastBroadcastDisabled(This,disabled)
-#define INetFwProfile_put_UnicastResponsesToMulticastBroadcastDisabled(This,disabled) (This)->lpVtbl->put_UnicastResponsesToMulticastBroadcastDisabled(This,disabled)
-#define INetFwProfile_get_RemoteAdminSettings(This,remoteAdminSettings) (This)->lpVtbl->get_RemoteAdminSettings(This,remoteAdminSettings)
-#define INetFwProfile_get_IcmpSettings(This,icmpSettings) (This)->lpVtbl->get_IcmpSettings(This,icmpSettings)
-#define INetFwProfile_get_GloballyOpenPorts(This,openPorts) (This)->lpVtbl->get_GloballyOpenPorts(This,openPorts)
-#define INetFwProfile_get_Services(This,services) (This)->lpVtbl->get_Services(This,services)
-#define INetFwProfile_get_AuthorizedApplications(This,apps) (This)->lpVtbl->get_AuthorizedApplications(This,apps)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_Type_Proxy(
-    INetFwProfile* This,
-    NET_FW_PROFILE_TYPE *type);
-void __RPC_STUB INetFwProfile_get_Type_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_FirewallEnabled_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwProfile_get_FirewallEnabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_put_FirewallEnabled_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwProfile_put_FirewallEnabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_ExceptionsNotAllowed_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL *notAllowed);
-void __RPC_STUB INetFwProfile_get_ExceptionsNotAllowed_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_put_ExceptionsNotAllowed_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL notAllowed);
-void __RPC_STUB INetFwProfile_put_ExceptionsNotAllowed_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_NotificationsDisabled_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL *disabled);
-void __RPC_STUB INetFwProfile_get_NotificationsDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_put_NotificationsDisabled_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL disabled);
-void __RPC_STUB INetFwProfile_put_NotificationsDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_UnicastResponsesToMulticastBroadcastDisabled_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL *disabled);
-void __RPC_STUB INetFwProfile_get_UnicastResponsesToMulticastBroadcastDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_put_UnicastResponsesToMulticastBroadcastDisabled_Proxy(
-    INetFwProfile* This,
-    VARIANT_BOOL disabled);
-void __RPC_STUB INetFwProfile_put_UnicastResponsesToMulticastBroadcastDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_RemoteAdminSettings_Proxy(
-    INetFwProfile* This,
-    INetFwRemoteAdminSettings **remoteAdminSettings);
-void __RPC_STUB INetFwProfile_get_RemoteAdminSettings_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_IcmpSettings_Proxy(
-    INetFwProfile* This,
-    INetFwIcmpSettings **icmpSettings);
-void __RPC_STUB INetFwProfile_get_IcmpSettings_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_GloballyOpenPorts_Proxy(
-    INetFwProfile* This,
-    INetFwOpenPorts **openPorts);
-void __RPC_STUB INetFwProfile_get_GloballyOpenPorts_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_Services_Proxy(
-    INetFwProfile* This,
-    INetFwServices **services);
-void __RPC_STUB INetFwProfile_get_Services_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwProfile_get_AuthorizedApplications_Proxy(
-    INetFwProfile* This,
-    INetFwAuthorizedApplications **apps);
-void __RPC_STUB INetFwProfile_get_AuthorizedApplications_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwProfile_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwPolicy interface
- */
-#ifndef __INetFwPolicy_INTERFACE_DEFINED__
-#define __INetFwPolicy_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwPolicy, 0xd46d2478, 0x9ac9, 0x4008, 0x9d,0xc7, 0x55,0x63,0xce,0x55,0x36,0xcc);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwPolicy : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_CurrentProfile(
-        INetFwProfile **profile) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE GetProfileByType(
-        NET_FW_PROFILE_TYPE profileType,
-        INetFwProfile **profile) = 0;
-
-};
-#else
-typedef struct INetFwPolicyVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwPolicy* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwPolicy* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwPolicy* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwPolicy* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwPolicy* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwPolicy* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwPolicy* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwPolicy methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_CurrentProfile)(
-        INetFwPolicy* This,
-        INetFwProfile **profile);
-
-    HRESULT (STDMETHODCALLTYPE *GetProfileByType)(
-        INetFwPolicy* This,
-        NET_FW_PROFILE_TYPE profileType,
-        INetFwProfile **profile);
-
-    END_INTERFACE
-} INetFwPolicyVtbl;
-interface INetFwPolicy {
-    CONST_VTBL INetFwPolicyVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwPolicy_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwPolicy_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwPolicy_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwPolicy_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwPolicy_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwPolicy_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwPolicy_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwPolicy methods ***/
-#define INetFwPolicy_get_CurrentProfile(This,profile) (This)->lpVtbl->get_CurrentProfile(This,profile)
-#define INetFwPolicy_GetProfileByType(This,profileType,profile) (This)->lpVtbl->GetProfileByType(This,profileType,profile)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwPolicy_get_CurrentProfile_Proxy(
-    INetFwPolicy* This,
-    INetFwProfile **profile);
-void __RPC_STUB INetFwPolicy_get_CurrentProfile_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy_GetProfileByType_Proxy(
-    INetFwPolicy* This,
-    NET_FW_PROFILE_TYPE profileType,
-    INetFwProfile **profile);
-void __RPC_STUB INetFwPolicy_GetProfileByType_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwPolicy_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwPolicy2 interface
- */
-#ifndef __INetFwPolicy2_INTERFACE_DEFINED__
-#define __INetFwPolicy2_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwPolicy2, 0x98325047, 0xc671, 0x4174, 0x8d,0x81, 0xde,0xfc,0xd3,0xf0,0x31,0x86);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwPolicy2 : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_CurrentProfileTypes(
-        LONG *profileTypesBitmask) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_FirewallEnabled(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_FirewallEnabled(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_ExcludedInterfaces(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT *interfaces) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_ExcludedInterfaces(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT interfaces) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_BlockAllInboundTraffic(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *Block) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_BlockAllInboundTraffic(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL Block) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_NotificationsDisabled(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_NotificationsDisabled(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_UnicastResponsesToMulticastBroadcastDisabled(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_UnicastResponsesToMulticastBroadcastDisabled(
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL disabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_Rules(
-        INetFwRules **rules) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_ServiceRestriction(
-        INetFwServiceRestriction **ServiceRestriction) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE EnableRuleGroup(
-        LONG profileTypesBitmask,
-        BSTR group,
-        VARIANT_BOOL enable) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE IsRuleGroupEnabled(
-        LONG profileTypesBitmask,
-        BSTR group,
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE RestoreLocalFirewallDefaults(
-        ) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_DefaultInboundAction(
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION *action) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_DefaultInboundAction(
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION action) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_DefaultOutboundAction(
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION *action) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE put_DefaultOutboundAction(
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION action) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_IsRuleGroupCurrentlyEnabled(
-        BSTR group,
-        VARIANT_BOOL *enabled) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_LocalPolicyModifyState(
-        NET_FW_MODIFY_STATE *modifyState) = 0;
-
-};
-#else
-typedef struct INetFwPolicy2Vtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwPolicy2* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwPolicy2* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwPolicy2* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwPolicy2* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwPolicy2* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwPolicy2* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwPolicy2* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwPolicy2 methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_CurrentProfileTypes)(
-        INetFwPolicy2* This,
-        LONG *profileTypesBitmask);
-
-    HRESULT (STDMETHODCALLTYPE *get_FirewallEnabled)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_FirewallEnabled)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_ExcludedInterfaces)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT *interfaces);
-
-    HRESULT (STDMETHODCALLTYPE *put_ExcludedInterfaces)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT interfaces);
-
-    HRESULT (STDMETHODCALLTYPE *get_BlockAllInboundTraffic)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *Block);
-
-    HRESULT (STDMETHODCALLTYPE *put_BlockAllInboundTraffic)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL Block);
-
-    HRESULT (STDMETHODCALLTYPE *get_NotificationsDisabled)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *disabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_NotificationsDisabled)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL disabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_UnicastResponsesToMulticastBroadcastDisabled)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL *disabled);
-
-    HRESULT (STDMETHODCALLTYPE *put_UnicastResponsesToMulticastBroadcastDisabled)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        VARIANT_BOOL disabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_Rules)(
-        INetFwPolicy2* This,
-        INetFwRules **rules);
-
-    HRESULT (STDMETHODCALLTYPE *get_ServiceRestriction)(
-        INetFwPolicy2* This,
-        INetFwServiceRestriction **ServiceRestriction);
-
-    HRESULT (STDMETHODCALLTYPE *EnableRuleGroup)(
-        INetFwPolicy2* This,
-        LONG profileTypesBitmask,
-        BSTR group,
-        VARIANT_BOOL enable);
-
-    HRESULT (STDMETHODCALLTYPE *IsRuleGroupEnabled)(
-        INetFwPolicy2* This,
-        LONG profileTypesBitmask,
-        BSTR group,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *RestoreLocalFirewallDefaults)(
-        INetFwPolicy2* This);
-
-    HRESULT (STDMETHODCALLTYPE *get_DefaultInboundAction)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION *action);
-
-    HRESULT (STDMETHODCALLTYPE *put_DefaultInboundAction)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION action);
-
-    HRESULT (STDMETHODCALLTYPE *get_DefaultOutboundAction)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION *action);
-
-    HRESULT (STDMETHODCALLTYPE *put_DefaultOutboundAction)(
-        INetFwPolicy2* This,
-        NET_FW_PROFILE_TYPE2 profileType,
-        NET_FW_ACTION action);
-
-    HRESULT (STDMETHODCALLTYPE *get_IsRuleGroupCurrentlyEnabled)(
-        INetFwPolicy2* This,
-        BSTR group,
-        VARIANT_BOOL *enabled);
-
-    HRESULT (STDMETHODCALLTYPE *get_LocalPolicyModifyState)(
-        INetFwPolicy2* This,
-        NET_FW_MODIFY_STATE *modifyState);
-
-    END_INTERFACE
-} INetFwPolicy2Vtbl;
-interface INetFwPolicy2 {
-    CONST_VTBL INetFwPolicy2Vtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwPolicy2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwPolicy2_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwPolicy2_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwPolicy2_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwPolicy2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwPolicy2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwPolicy2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwPolicy2 methods ***/
-#define INetFwPolicy2_get_CurrentProfileTypes(This,profileTypesBitmask) (This)->lpVtbl->get_CurrentProfileTypes(This,profileTypesBitmask)
-#define INetFwPolicy2_get_FirewallEnabled(This,profileType,enabled) (This)->lpVtbl->get_FirewallEnabled(This,profileType,enabled)
-#define INetFwPolicy2_put_FirewallEnabled(This,profileType,enabled) (This)->lpVtbl->put_FirewallEnabled(This,profileType,enabled)
-#define INetFwPolicy2_get_ExcludedInterfaces(This,profileType,interfaces) (This)->lpVtbl->get_ExcludedInterfaces(This,profileType,interfaces)
-#define INetFwPolicy2_put_ExcludedInterfaces(This,profileType,interfaces) (This)->lpVtbl->put_ExcludedInterfaces(This,profileType,interfaces)
-#define INetFwPolicy2_get_BlockAllInboundTraffic(This,profileType,Block) (This)->lpVtbl->get_BlockAllInboundTraffic(This,profileType,Block)
-#define INetFwPolicy2_put_BlockAllInboundTraffic(This,profileType,Block) (This)->lpVtbl->put_BlockAllInboundTraffic(This,profileType,Block)
-#define INetFwPolicy2_get_NotificationsDisabled(This,profileType,disabled) (This)->lpVtbl->get_NotificationsDisabled(This,profileType,disabled)
-#define INetFwPolicy2_put_NotificationsDisabled(This,profileType,disabled) (This)->lpVtbl->put_NotificationsDisabled(This,profileType,disabled)
-#define INetFwPolicy2_get_UnicastResponsesToMulticastBroadcastDisabled(This,profileType,disabled) (This)->lpVtbl->get_UnicastResponsesToMulticastBroadcastDisabled(This,profileType,disabled)
-#define INetFwPolicy2_put_UnicastResponsesToMulticastBroadcastDisabled(This,profileType,disabled) (This)->lpVtbl->put_UnicastResponsesToMulticastBroadcastDisabled(This,profileType,disabled)
-#define INetFwPolicy2_get_Rules(This,rules) (This)->lpVtbl->get_Rules(This,rules)
-#define INetFwPolicy2_get_ServiceRestriction(This,ServiceRestriction) (This)->lpVtbl->get_ServiceRestriction(This,ServiceRestriction)
-#define INetFwPolicy2_EnableRuleGroup(This,profileTypesBitmask,group,enable) (This)->lpVtbl->EnableRuleGroup(This,profileTypesBitmask,group,enable)
-#define INetFwPolicy2_IsRuleGroupEnabled(This,profileTypesBitmask,group,enabled) (This)->lpVtbl->IsRuleGroupEnabled(This,profileTypesBitmask,group,enabled)
-#define INetFwPolicy2_RestoreLocalFirewallDefaults(This) (This)->lpVtbl->RestoreLocalFirewallDefaults(This)
-#define INetFwPolicy2_get_DefaultInboundAction(This,profileType,action) (This)->lpVtbl->get_DefaultInboundAction(This,profileType,action)
-#define INetFwPolicy2_put_DefaultInboundAction(This,profileType,action) (This)->lpVtbl->put_DefaultInboundAction(This,profileType,action)
-#define INetFwPolicy2_get_DefaultOutboundAction(This,profileType,action) (This)->lpVtbl->get_DefaultOutboundAction(This,profileType,action)
-#define INetFwPolicy2_put_DefaultOutboundAction(This,profileType,action) (This)->lpVtbl->put_DefaultOutboundAction(This,profileType,action)
-#define INetFwPolicy2_get_IsRuleGroupCurrentlyEnabled(This,group,enabled) (This)->lpVtbl->get_IsRuleGroupCurrentlyEnabled(This,group,enabled)
-#define INetFwPolicy2_get_LocalPolicyModifyState(This,modifyState) (This)->lpVtbl->get_LocalPolicyModifyState(This,modifyState)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_CurrentProfileTypes_Proxy(
-    INetFwPolicy2* This,
-    LONG *profileTypesBitmask);
-void __RPC_STUB INetFwPolicy2_get_CurrentProfileTypes_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_FirewallEnabled_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwPolicy2_get_FirewallEnabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_FirewallEnabled_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL enabled);
-void __RPC_STUB INetFwPolicy2_put_FirewallEnabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_ExcludedInterfaces_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT *interfaces);
-void __RPC_STUB INetFwPolicy2_get_ExcludedInterfaces_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_ExcludedInterfaces_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT interfaces);
-void __RPC_STUB INetFwPolicy2_put_ExcludedInterfaces_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_BlockAllInboundTraffic_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL *Block);
-void __RPC_STUB INetFwPolicy2_get_BlockAllInboundTraffic_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_BlockAllInboundTraffic_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL Block);
-void __RPC_STUB INetFwPolicy2_put_BlockAllInboundTraffic_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_NotificationsDisabled_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL *disabled);
-void __RPC_STUB INetFwPolicy2_get_NotificationsDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_NotificationsDisabled_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL disabled);
-void __RPC_STUB INetFwPolicy2_put_NotificationsDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_UnicastResponsesToMulticastBroadcastDisabled_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL *disabled);
-void __RPC_STUB INetFwPolicy2_get_UnicastResponsesToMulticastBroadcastDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_UnicastResponsesToMulticastBroadcastDisabled_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    VARIANT_BOOL disabled);
-void __RPC_STUB INetFwPolicy2_put_UnicastResponsesToMulticastBroadcastDisabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_Rules_Proxy(
-    INetFwPolicy2* This,
-    INetFwRules **rules);
-void __RPC_STUB INetFwPolicy2_get_Rules_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_ServiceRestriction_Proxy(
-    INetFwPolicy2* This,
-    INetFwServiceRestriction **ServiceRestriction);
-void __RPC_STUB INetFwPolicy2_get_ServiceRestriction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_EnableRuleGroup_Proxy(
-    INetFwPolicy2* This,
-    LONG profileTypesBitmask,
-    BSTR group,
-    VARIANT_BOOL enable);
-void __RPC_STUB INetFwPolicy2_EnableRuleGroup_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_IsRuleGroupEnabled_Proxy(
-    INetFwPolicy2* This,
-    LONG profileTypesBitmask,
-    BSTR group,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwPolicy2_IsRuleGroupEnabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_RestoreLocalFirewallDefaults_Proxy(
-    INetFwPolicy2* This);
-void __RPC_STUB INetFwPolicy2_RestoreLocalFirewallDefaults_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_DefaultInboundAction_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    NET_FW_ACTION *action);
-void __RPC_STUB INetFwPolicy2_get_DefaultInboundAction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_DefaultInboundAction_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    NET_FW_ACTION action);
-void __RPC_STUB INetFwPolicy2_put_DefaultInboundAction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_DefaultOutboundAction_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    NET_FW_ACTION *action);
-void __RPC_STUB INetFwPolicy2_get_DefaultOutboundAction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_put_DefaultOutboundAction_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_PROFILE_TYPE2 profileType,
-    NET_FW_ACTION action);
-void __RPC_STUB INetFwPolicy2_put_DefaultOutboundAction_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_IsRuleGroupCurrentlyEnabled_Proxy(
-    INetFwPolicy2* This,
-    BSTR group,
-    VARIANT_BOOL *enabled);
-void __RPC_STUB INetFwPolicy2_get_IsRuleGroupCurrentlyEnabled_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwPolicy2_get_LocalPolicyModifyState_Proxy(
-    INetFwPolicy2* This,
-    NET_FW_MODIFY_STATE *modifyState);
-void __RPC_STUB INetFwPolicy2_get_LocalPolicyModifyState_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwPolicy2_INTERFACE_DEFINED__ */
-
-/*****************************************************************************
- * INetFwMgr interface
- */
-#ifndef __INetFwMgr_INTERFACE_DEFINED__
-#define __INetFwMgr_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_INetFwMgr, 0xf7898af5, 0xcac4, 0x4632, 0xa2,0xec, 0xda,0x06,0xe5,0x11,0x1a,0xf2);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-interface INetFwMgr : public IDispatch
-{
-    virtual HRESULT STDMETHODCALLTYPE get_LocalPolicy(
-        INetFwPolicy **localPolicy) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE get_CurrentProfileType(
-        NET_FW_PROFILE_TYPE *profileType) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE RestoreDefaults(
-        ) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE IsPortAllowed(
-        BSTR imageFileName,
-        NET_FW_IP_VERSION ipVersion,
-        LONG portNumber,
-        BSTR localAddress,
-        NET_FW_IP_PROTOCOL ipProtocol,
-        VARIANT *allowed,
-        VARIANT *restricted) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE IsIcmpTypeAllowed(
-        NET_FW_IP_VERSION ipVersion,
-        BSTR localAddress,
-        BYTE type,
-        VARIANT *allowed,
-        VARIANT *restricted) = 0;
-
-};
-#else
-typedef struct INetFwMgrVtbl {
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        INetFwMgr* This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        INetFwMgr* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        INetFwMgr* This);
-
-    /*** IDispatch methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
-        INetFwMgr* This,
-        UINT *pctinfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
-        INetFwMgr* This,
-        UINT iTInfo,
-        LCID lcid,
-        ITypeInfo **ppTInfo);
-
-    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
-        INetFwMgr* This,
-        REFIID riid,
-        LPOLESTR *rgszNames,
-        UINT cNames,
-        LCID lcid,
-        DISPID *rgDispId);
-
-    HRESULT (STDMETHODCALLTYPE *Invoke)(
-        INetFwMgr* This,
-        DISPID dispIdMember,
-        REFIID riid,
-        LCID lcid,
-        WORD wFlags,
-        DISPPARAMS *pDispParams,
-        VARIANT *pVarResult,
-        EXCEPINFO *pExcepInfo,
-        UINT *puArgErr);
-
-    /*** INetFwMgr methods ***/
-    HRESULT (STDMETHODCALLTYPE *get_LocalPolicy)(
-        INetFwMgr* This,
-        INetFwPolicy **localPolicy);
-
-    HRESULT (STDMETHODCALLTYPE *get_CurrentProfileType)(
-        INetFwMgr* This,
-        NET_FW_PROFILE_TYPE *profileType);
-
-    HRESULT (STDMETHODCALLTYPE *RestoreDefaults)(
-        INetFwMgr* This);
-
-    HRESULT (STDMETHODCALLTYPE *IsPortAllowed)(
-        INetFwMgr* This,
-        BSTR imageFileName,
-        NET_FW_IP_VERSION ipVersion,
-        LONG portNumber,
-        BSTR localAddress,
-        NET_FW_IP_PROTOCOL ipProtocol,
-        VARIANT *allowed,
-        VARIANT *restricted);
-
-    HRESULT (STDMETHODCALLTYPE *IsIcmpTypeAllowed)(
-        INetFwMgr* This,
-        NET_FW_IP_VERSION ipVersion,
-        BSTR localAddress,
-        BYTE type,
-        VARIANT *allowed,
-        VARIANT *restricted);
-
-    END_INTERFACE
-} INetFwMgrVtbl;
-interface INetFwMgr {
-    CONST_VTBL INetFwMgrVtbl* lpVtbl;
-};
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define INetFwMgr_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
-#define INetFwMgr_AddRef(This) (This)->lpVtbl->AddRef(This)
-#define INetFwMgr_Release(This) (This)->lpVtbl->Release(This)
-/*** IDispatch methods ***/
-#define INetFwMgr_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
-#define INetFwMgr_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
-#define INetFwMgr_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
-#define INetFwMgr_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
-/*** INetFwMgr methods ***/
-#define INetFwMgr_get_LocalPolicy(This,localPolicy) (This)->lpVtbl->get_LocalPolicy(This,localPolicy)
-#define INetFwMgr_get_CurrentProfileType(This,profileType) (This)->lpVtbl->get_CurrentProfileType(This,profileType)
-#define INetFwMgr_RestoreDefaults(This) (This)->lpVtbl->RestoreDefaults(This)
-#define INetFwMgr_IsPortAllowed(This,imageFileName,ipVersion,portNumber,localAddress,ipProtocol,allowed,restricted) (This)->lpVtbl->IsPortAllowed(This,imageFileName,ipVersion,portNumber,localAddress,ipProtocol,allowed,restricted)
-#define INetFwMgr_IsIcmpTypeAllowed(This,ipVersion,localAddress,type,allowed,restricted) (This)->lpVtbl->IsIcmpTypeAllowed(This,ipVersion,localAddress,type,allowed,restricted)
-#endif
-
-#endif
-
-HRESULT STDMETHODCALLTYPE INetFwMgr_get_LocalPolicy_Proxy(
-    INetFwMgr* This,
-    INetFwPolicy **localPolicy);
-void __RPC_STUB INetFwMgr_get_LocalPolicy_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwMgr_get_CurrentProfileType_Proxy(
-    INetFwMgr* This,
-    NET_FW_PROFILE_TYPE *profileType);
-void __RPC_STUB INetFwMgr_get_CurrentProfileType_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwMgr_RestoreDefaults_Proxy(
-    INetFwMgr* This);
-void __RPC_STUB INetFwMgr_RestoreDefaults_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwMgr_IsPortAllowed_Proxy(
-    INetFwMgr* This,
-    BSTR imageFileName,
-    NET_FW_IP_VERSION ipVersion,
-    LONG portNumber,
-    BSTR localAddress,
-    NET_FW_IP_PROTOCOL ipProtocol,
-    VARIANT *allowed,
-    VARIANT *restricted);
-void __RPC_STUB INetFwMgr_IsPortAllowed_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-HRESULT STDMETHODCALLTYPE INetFwMgr_IsIcmpTypeAllowed_Proxy(
-    INetFwMgr* This,
-    NET_FW_IP_VERSION ipVersion,
-    BSTR localAddress,
-    BYTE type,
-    VARIANT *allowed,
-    VARIANT *restricted);
-void __RPC_STUB INetFwMgr_IsIcmpTypeAllowed_Stub(
-    IRpcStubBuffer* This,
-    IRpcChannelBuffer* pRpcChannelBuffer,
-    PRPC_MESSAGE pRpcMessage,
-    DWORD* pdwStubPhase);
-
-#endif  /* __INetFwMgr_INTERFACE_DEFINED__ */
-
-
-DEFINE_GUID(LIBID_NetFwPublicTypeLib, 0xdb4f3345, 0x3ef8, 0x45ed, 0xb9,0x76, 0x25,0xa6,0xd3,0xb8,0x1b,0x71);
-
-#ifndef __INetFwRemoteAdminSettings_FWD_DEFINED__
-#define __INetFwRemoteAdminSettings_FWD_DEFINED__
-typedef interface INetFwRemoteAdminSettings INetFwRemoteAdminSettings;
-#endif
-
-#ifndef __INetFwIcmpSettings_FWD_DEFINED__
-#define __INetFwIcmpSettings_FWD_DEFINED__
-typedef interface INetFwIcmpSettings INetFwIcmpSettings;
-#endif
-
-#ifndef __INetFwOpenPort_FWD_DEFINED__
-#define __INetFwOpenPort_FWD_DEFINED__
-typedef interface INetFwOpenPort INetFwOpenPort;
-#endif
-
-#ifndef __INetFwOpenPorts_FWD_DEFINED__
-#define __INetFwOpenPorts_FWD_DEFINED__
-typedef interface INetFwOpenPorts INetFwOpenPorts;
-#endif
-
-#ifndef __INetFwService_FWD_DEFINED__
-#define __INetFwService_FWD_DEFINED__
-typedef interface INetFwService INetFwService;
-#endif
-
-#ifndef __INetFwServices_FWD_DEFINED__
-#define __INetFwServices_FWD_DEFINED__
-typedef interface INetFwServices INetFwServices;
-#endif
-
-#ifndef __INetFwAuthorizedApplication_FWD_DEFINED__
-#define __INetFwAuthorizedApplication_FWD_DEFINED__
-typedef interface INetFwAuthorizedApplication INetFwAuthorizedApplication;
-#endif
-
-#ifndef __INetFwAuthorizedApplications_FWD_DEFINED__
-#define __INetFwAuthorizedApplications_FWD_DEFINED__
-typedef interface INetFwAuthorizedApplications INetFwAuthorizedApplications;
-#endif
-
-#ifndef __INetFwRule_FWD_DEFINED__
-#define __INetFwRule_FWD_DEFINED__
-typedef interface INetFwRule INetFwRule;
-#endif
-
-#ifndef __INetFwRules_FWD_DEFINED__
-#define __INetFwRules_FWD_DEFINED__
-typedef interface INetFwRules INetFwRules;
-#endif
-
-#ifndef __INetFwProfile_FWD_DEFINED__
-#define __INetFwProfile_FWD_DEFINED__
-typedef interface INetFwProfile INetFwProfile;
-#endif
-
-#ifndef __INetFwPolicy_FWD_DEFINED__
-#define __INetFwPolicy_FWD_DEFINED__
-typedef interface INetFwPolicy INetFwPolicy;
-#endif
-
-#ifndef __INetFwPolicy2_FWD_DEFINED__
-#define __INetFwPolicy2_FWD_DEFINED__
-typedef interface INetFwPolicy2 INetFwPolicy2;
-#endif
-
-#ifndef __INetFwMgr_FWD_DEFINED__
-#define __INetFwMgr_FWD_DEFINED__
-typedef interface INetFwMgr INetFwMgr;
-#endif
-
-/*****************************************************************************
- * NetFwRule coclass
- */
-
-DEFINE_GUID(CLSID_NetFwRule, 0x2c5bc43e, 0x3369, 0x4c33, 0xab,0x0c, 0xbe,0x94,0x69,0x67,0x7a,0xf4);
-
-/*****************************************************************************
- * NetFwOpenPort coclass
- */
-
-DEFINE_GUID(CLSID_NetFwOpenPort, 0x0ca545c6, 0x37ad, 0x4a6c, 0xbf,0x92, 0x9f,0x76,0x10,0x06,0x7e,0xf5);
-
-/*****************************************************************************
- * NetFwAuthorizedApplication coclass
- */
-
-DEFINE_GUID(CLSID_NetFwAuthorizedApplication, 0xec9846b3, 0x2762, 0x4a6b, 0xa2,0x14, 0x6a,0xcb,0x60,0x34,0x62,0xd2);
-
-/*****************************************************************************
- * NetFwPolicy2 coclass
- */
-
-DEFINE_GUID(CLSID_NetFwPolicy2, 0xe2b3c97f, 0x6ae1, 0x41ac, 0x81,0x7a, 0xf6,0xf9,0x21,0x66,0xd7,0xdd);
-
-/*****************************************************************************
- * NetFwMgr coclass
- */
-
-DEFINE_GUID(CLSID_NetFwMgr, 0x304ce942, 0x6e39, 0x40d8, 0x94,0x3a, 0xb9,0x13,0xc4,0x0c,0x9c,0xd4);
-
-/* Begin additional prototypes for all interfaces */
-
-ULONG           __RPC_USER BSTR_UserSize     (ULONG *, ULONG, BSTR *);
-unsigned char * __RPC_USER BSTR_UserMarshal  (ULONG *, unsigned char *, BSTR *);
-unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
-void            __RPC_USER BSTR_UserFree     (ULONG *, BSTR *);
-ULONG           __RPC_USER VARIANT_UserSize     (ULONG *, ULONG, VARIANT *);
-unsigned char * __RPC_USER VARIANT_UserMarshal  (ULONG *, unsigned char *, VARIANT *);
-unsigned char * __RPC_USER VARIANT_UserUnmarshal(ULONG *, unsigned char *, VARIANT *);
-void            __RPC_USER VARIANT_UserFree     (ULONG *, VARIANT *);
-
-/* End additional prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __WIDL_NETFW_H */
diff --git a/italc.spec.in b/italc.spec.in
deleted file mode 100644
index 18b14e7..0000000
--- a/italc.spec.in
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-Name:		@PACKAGE@
-Version:	@VERSION@
-Release:	0
-Summary:	didactical software for teachers etc.
-Summary(de):	Didaktische Software fuer Lehrer usw.
-License:	GPL
-URL:		http://italc.sourceforge.net/
-Group:		Applications/Networking
-Packager:	Tobias Doerffel <tobydox at users.sourceforge.net>
-%if 0%{?suse_version} 
-BuildRequires:	gcc gcc-c++ libstdc++-devel autoconf automake make openssl openssl-devel zlib zlib-devel libjpeg libjpeg-devel
-BuildRequires:	libqt4-devel
-Requires:	libqt4 libqt4-x11 openssl zlib libjpeg
-%endif
-Source:		%{name}-%{version}.tar.bz2
-BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot
-Prefix:		%{_prefix}
-
-%description
-iTALC is a use- and powerful didactical tool for teachers. It lets you view and control other computers in your network in several ways. It supports Linux and Windows 2000/XP/Vista.
-
-Features:
-
-* see what's going on in computer-labs by using overview mode and make snapshots
-* remote-control computers to support and help other people
-* show a demo (either in fullscreen or in a window) - the teacher's screen is shown on all student's computers in realtime
-* lock workstations for moving undivided attention to teacher
-* send text-messages to students
-* powering on/off and rebooting computers per remote
-* remote logon and logoff and remote execution of arbitrary commands/scripts
-* home-schooling - iTALC's network-technology is not restricted to a subnet and therefore students at home can join lessons via VPN-connections just by installing iTALC client
-
-Furthermore iTALC is optimized for usage on multi-core systems (by making
-heavy use of threads). No matter how many cores you have, iTALC can make use
-of all of them. 
-
-
-%description -l de
-iTALC ist ein nuetzliches und leistungsfaehiges didaktisches Werkzeug f�r
-Lehrer, mit dem man andere Computer im Netzwerk auf verschiedene Art und Weise
-beobachten und fernsteuern kann.
-
-iTALC unterstuetzt derzeit Linux und Windows 2000/XP/Vista.
-
-Funktionen:
-
-* sehen, was in Computerkabinetten los ist (Uebersichtsmodus) und Schnapsschuesse erstellen
-* Computern fernsteuern, um anderen Leuten zu unterstuetzen
-* eine Demo zeigen (entweder als Vollbild oder in einem Fenster) - der Lehrer-Bildschirm wird auf alle Schuelercomputer in Echtzeit uebertragen
-* Schuelercomputer sperren um Aufmerksamkeit zu erlangen
-* Textnachrichten an Schueler senden
-* Computer uebers Netzwerk an- und ausschalten sowie neustarten
-* Remote-Anmeldung sowie Ausfuehrung beliebiger Befehle/Skripte
-* Anbindung zu Hause sitzender Schueler ueber VPN moeglich
-
-Weiterhin ist iTALC optimiert auf die Nutzung auf Mehrkern-Systemen (indem es in grossen Umfang Threads benutzt). Egal wie viele Kerne sie haben, iTALC kann von allen Gebrauch machen.
-
-
-%package client
-Summary:	software for iTALC-clients
-Summary(de):	Software fuer iTALC-Clients
-Group:		Applications/Networking
-Requires:	italc = %{version}
-
-%description client
-This package contains the software, needed by iTALC-clients.
-
-See /usr/share/italc/doc/INSTALL for details on how to install and setup iTALC
-in your network.
-
-%description client -l de
-Dieses Paket beinhaltet die Software, die auf iTALC-Clients benoetigt wird.
-
-Weitere Details ueber die Installation und Einrichtung von iTALC in Ihrem
-Netzwerk finden Sie in /usr/share/italc/doc/INSTALL.
-
-
-%package master
-Summary:	iTALC master software
-Summary(de):	iTALC-Master-Software
-Group:		Applications/Networking
-Requires:	italc = %{version}
-Requires:	italc-client = %{version}
-
-%description master
-This package contains the actual master-software for accessing clients.
-
-See /usr/share/italc/doc/INSTALL for details on how to install and setup iTALC
-in your network.
-
-%description master -l de
-Dieses Paket beinhaltet die eigentliche Master-Software, um auf Clients
-zuzugreifen.
-
-Weitere Details ueber die Installation und Einrichtung von iTALC in Ihrem
-Netzwerk finden Sie in /usr/share/italc/doc/INSTALL.
-
-
-
-%prep
-%setup -q
-
-
-%build
-CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
-
-make %{?jobs:-j%jobs}
-
-
-%install
-make DESTDIR=$RPM_BUILD_ROOT install
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-%{_datadir}/italc/
-
-
-%files client
-%defattr(-,root,root)
-%{_bindir}/ica
-%{_libdir}/italc/libitalc_core.so
-%doc %{_mandir}/man1/ica.1.gz
-
-
-%files master
-%defattr(-,root,root)
-%{_bindir}/italc
-%doc %{_mandir}/man1/italc.1.gz
-%{_datadir}/applications/italc.desktop
-%{_datadir}/menu/italc
-%{_datadir}/pixmaps/italc.xpm
-%{_datadir}/icons/italc.png
-
-
-%changelog
-* Mon Mar 03 2008 Tobias Doerffel
-- added missing library
-
-* Sat Apr 12 2007 Tobias Doerffel
-- lot of updates for "new" iTALC
-
-* Sat Jun 25 2005 Tobias Doerffel
-- updated project-homepage and email-address of packager
-
-* Sat May 5 2005 Tobias Doerffel
-- created italc.spec.in
-
diff --git a/italcconfig.h.in b/italcconfig.h.in
deleted file mode 100644
index 02a00e1..0000000
--- a/italcconfig.h.in
+++ /dev/null
@@ -1,107 +0,0 @@
-#cmakedefine ITALC_BUILD_LINUX 1
-#cmakedefine ITALC_BUILD_WIN32 1
-#cmakedefine ITALC_BUILD_APPLE 1
-
-#cmakedefine ITALC_HOST_X86 1
-#cmakedefine ITALC_HOST_X86_64 1
-
-#cmakedefine ITALC_HAVE_ARPA_INET_H 1
-#cmakedefine ITALC_HAVE_FCNTL_H 1
-#cmakedefine ITALC_HAVE_FCNTL_H 1
-#cmakedefine ITALC_HAVE_LIMITS_H 1
-#cmakedefine ITALC_HAVE_MEMORY_H 1
-#cmakedefine ITALC_HAVE_NETDB_H 1
-#cmakedefine ITALC_HAVE_NETINET_IN_H 1
-#cmakedefine ITALC_HAVE_STDINT_H 1
-#cmakedefine ITALC_HAVE_STDLIB_H 1
-#cmakedefine ITALC_HAVE_STDBOOL_H 1
-#cmakedefine ITALC_HAVE_STRING_H 1
-#cmakedefine ITALC_HAVE_STRINGS_H 1
-#cmakedefine ITALC_HAVE_SYS_IOCTL_H 1
-#cmakedefine ITALC_HAVE_SYS_SOCKET_H 1
-#cmakedefine ITALC_HAVE_SYS_TIME_H 1
-#cmakedefine ITALC_HAVE_SYS_TIMEB_H 1
-#cmakedefine ITALC_HAVE_SYS_STAT_H 1
-#cmakedefine ITALC_HAVE_SYSLOG_H 1
-#cmakedefine ITALC_HAVE_UNISTD_H 1
-#cmakedefine ITALC_HAVE_PWD_H 1
-#cmakedefine ITALC_HAVE_SYS_TYPES_H 1
-#cmakedefine ITALC_HAVE_UTMPX_H 1
-#cmakedefine ITALC_HAVE_SYS_WAIT_H 1
-#cmakedefine ITALC_HAVE_TIME_H 1
-#cmakedefine ITALC_HAVE_ERRNO_H 1
-#cmakedefine ITALC_HAVE_PTHREAD_H 1
-#cmakedefine ITALC_HAVE_SYS_IPC_H 1
-#cmakedefine ITALC_HAVE_SYS_SHM_H 1
-#cmakedefine ITALC_HAVE_STDARG_H 1
-#cmakedefine ITALC_HAVE_SIGNAL_H 1
-#cmakedefine ITALC_HAVE_CTYPE_H 1
-#cmakedefine ITALC_HAVE_PROCESS_H 1
-#cmakedefine ITALC_HAVE_DLFCN_H 1
-#cmakedefine ITALC_HAVE_INTTYPES_H 1
-#cmakedefine ITALC_HAVE_VFORK_H 1
-#cmakedefine ITALC_HAVE_LINUX_FB_H 1
-#cmakedefine ITALC_HAVE_LINUX_INPUT_H 1
-#cmakedefine ITALC_HAVE_LINUX_UINPUT_H 1
-#cmakedefine ITALC_HAVE_LINUX_VIDEODEV_H 1
-
-
-#cmakedefine ITALC_HAVE_FTIME 1
-#cmakedefine ITALC_HAVE_MKFIFO 1
-#cmakedefine ITALC_HAVE_DUP2 1
-#cmakedefine ITALC_HAVE_FLOOR 1
-#cmakedefine ITALC_HAVE_GETHOSTBYNAME 1
-#cmakedefine ITALC_HAVE_GETHOSTNAME 1
-#cmakedefine ITALC_HAVE_GETTIMEOFDAY 1
-#cmakedefine ITALC_HAVE_INET_NTOA 1
-#cmakedefine ITALC_HAVE_MEMCMP 1
-#cmakedefine ITALC_HAVE_MEMMOVE 1
-#cmakedefine ITALC_HAVE_MEMCPY 1
-#cmakedefine ITALC_HAVE_MEMSET 1
-#cmakedefine ITALC_HAVE_MMAP 1
-#cmakedefine ITALC_HAVE_POW 1
-#cmakedefine ITALC_HAVE_PUTENV 1
-#cmakedefine ITALC_HAVE_SELECT 1
-#cmakedefine ITALC_HAVE_SOCKET 1
-#cmakedefine ITALC_HAVE_STRCHR 1
-#cmakedefine ITALC_HAVE_STRDUP 1
-#cmakedefine ITALC_HAVE_STRERROR 1
-#cmakedefine ITALC_HAVE_STRPBRK 1
-#cmakedefine ITALC_HAVE_STRRCHR 1
-#cmakedefine ITALC_HAVE_STRSTR 1
-#cmakedefine ITALC_HAVE_UNAME 1
-#cmakedefine ITALC_HAVE_SETSID 1
-#cmakedefine ITALC_HAVE_GETPWUID 1
-#cmakedefine ITALC_HAVE_GETPWNAM 1
-#cmakedefine ITALC_HAVE_GETUID 1
-#cmakedefine ITALC_HAVE_GETEUID 1
-#cmakedefine ITALC_HAVE_WAITPID 1
-#cmakedefine ITALC_HAVE_SETUTXENT 1
-#cmakedefine ITALC_HAVE_SETPGRP 1
-#cmakedefine ITALC_HAVE_SETEUID 1
-#cmakedefine ITALC_HAVE_GRANTPT 1
-#cmakedefine ITALC_HAVE_GETSPNAM 1
-#cmakedefine ITALC_HAVE_INITGROUPS 1
-
-
-/* x11vnc configuration */
-#cmakedefine ITALC_ALLOW24BPP
-#cmakedefine ITALC_BACKCHANNEL
-#cmakedefine ITALC_HAVE_X11 1
-#cmakedefine ITALC_HAVE_XSHM 1
-#cmakedefine ITALC_HAVE_XTEST 1
-#cmakedefine ITALC_HAVE_LIBXINERAMA 1
-#cmakedefine ITALC_HAVE_LIBXRANDR 1
-#cmakedefine ITALC_HAVE_LIBXFIXES 1
-#cmakedefine ITALC_HAVE_LIBXDAMAGE 1
-#cmakedefine ITALC_HAVE_SOLARIS_XREADSCREEN 1
-#cmakedefine ITALC_HAVE_FBPM 1
-#cmakedefine ITALC_HAVE_DPMS 1
-#cmakedefine ITALC_HAVE_XTESTGRABCONTROL 1
-#cmakedefine ITALC_HAVE_RECORD 1
-#cmakedefine ITALC_HAVE_IRIX_XREADDISPLAY 1
-#cmakedefine ITALC_HAVE_XKBLIB_H 1
-#cmakedefine ITALC_HAVE_XKEYBOARD 1
-#cmakedefine ITALC_HAVE_LIBCRYPT 1
-#cmakedefine ITALC_HAVE_LIBPTHREAD 1
-#cmakedefine ITALC_HAVE_TLS 1
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
deleted file mode 100644
index 4165168..0000000
--- a/lib/CMakeLists.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-FILE(GLOB ic_INCLUDES
-						${CMAKE_CURRENT_SOURCE_DIR}/include/*.h
-						${CMAKE_CURRENT_SOURCE_DIR}/include/Ipc/*.h
-						${CMAKE_CURRENT_SOURCE_DIR}/include/Configuration/*.h)
-FILE(GLOB ic_SOURCES
-						${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
-						${CMAKE_CURRENT_SOURCE_DIR}/src/Ipc/*.cpp
-						${CMAKE_CURRENT_SOURCE_DIR}/src/Configuration/*.cpp)
-FILE(GLOB ic_UI ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/*.ui)
-
-SET(LIBVNCCLIENT_SOURCES
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/common/minilzo.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/common/turbojpeg.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/libvncclient/cursor.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/libvncclient/listen.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/libvncclient/rfbproto.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/libvncclient/sockets.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/libvncclient/tls_none.c
-${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/libvncclient/vncviewer.c)
-
-
-SET(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ItalcCore.qrc)
-QT4_WRAP_CPP(ic_MOC_out ${ic_INCLUDES})
-QT4_WRAP_UI(ic_UIC_out ${ic_UI})
-QT4_ADD_RESOURCES(ic_RCC_out ${QRC_FILE})
-IF(WIN32)
-	QT4_ADD_RESOURCES(ic_qt_qm_out ${CMAKE_CURRENT_BINARY_DIR}/qt_qm.qrc)
-ENDIF()
-QT4_TRANSLATIONS_FOR_QRC(${QRC_FILE} ${ic_SOURCES} ${ic_INCLUDES})
-
-ADD_DEFINITIONS(-DBUILD_ICA -DBUILD_LIBRARY)
-IF(ITALC_BUILD_WIN32)
-	LINK_LIBRARIES(-lws2_32 -lwtsapi32 -lnetapi32 -luserenv -ladvapi32)
-	SET(CMAKE_MODULE_LINKER_FLAGS -Wl,-export-all-symbols)
-ENDIF(ITALC_BUILD_WIN32)
-
-INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../ica/x11/common/)
-ADD_LIBRARY(ItalcCore SHARED ${ic_SOURCES} ${ic_INCLUDES} ${ic_MOC_out} ${ic_UIC_out} ${ic_RCC_out} ${ic_qt_qm_out} ${LIBVNCCLIENT_SOURCES})
-
-IF(ITALC_BUILD_WIN32)
-	SET_TARGET_PROPERTIES(ItalcCore PROPERTIES PREFIX "")
-	SET_SOURCE_FILES_PROPERTIES(src/Inject.cpp PROPERTIES COMPILE_FLAGS "-O0")
-	INSTALL(TARGETS ItalcCore RUNTIME DESTINATION ${LIB_DIR})
-ELSE()
-	INSTALL(TARGETS ItalcCore LIBRARY DESTINATION ${LIB_DIR})
-ENDIF(ITALC_BUILD_WIN32)
-
diff --git a/lib/ItalcCore.qrc b/lib/ItalcCore.qrc
deleted file mode 100644
index 6703249..0000000
--- a/lib/ItalcCore.qrc
+++ /dev/null
@@ -1,56 +0,0 @@
-<RCC>
-  <qresource>
-    <file>resources/icon64.png</file>
-    <file>resources/manage-with-imc.png</file>
-    <file>resources/dialog-password.png</file>
-    <file>../COPYING</file>
-    <file>resources/license.png</file>
-    <file>../AUTHORS</file>
-    <file>resources/authors.png</file>
-    <file>resources/locale.png</file>
-    <file>resources/info.png</file>
-    <file>resources/message.png</file>
-    <file>resources/ok.png</file>
-    <file>resources/de.qm</file>
-    <file>resources/ar.qm</file>
-    <file>resources/cs.qm</file>
-    <file>resources/it.qm</file>
-    <file>resources/es.qm</file>
-    <file>resources/fr.qm</file>
-    <file>resources/hu.qm</file>
-    <file>resources/nn.qm</file>
-    <file>resources/pl.qm</file>
-    <file>resources/sl.qm</file>
-    <file>resources/sv.qm</file>
-    <file>resources/uk.qm</file>
-    <file>resources/zh_cn.qm</file>
-    <file>resources/zh_tw.qm</file>
-    <file>resources/fi.qm</file>
-    <file>resources/ru.qm</file>
-    <file>resources/sk.qm</file>
-    <file>resources/pt_br.qm</file>
-    <file>resources/el.qm</file>
-    <file>resources/tr.qm</file>
-    <file>resources/he.qm</file>
-    <file>resources/locked_bg.png</file>
-    <file>resources/icon16.png</file>
-    <file>resources/icon22.png</file>
-    <file>resources/icon32.png</file>
-    <file>resources/watch1.png</file>
-    <file>resources/watch2.png</file>
-    <file>resources/watch3.png</file>
-    <file>resources/watch4.png</file>
-    <file>resources/watch5.png</file>
-    <file>resources/watch6.png</file>
-    <file>resources/watch7.png</file>
-    <file>resources/watch8.png</file>
-    <file>resources/watch9.png</file>
-    <file>resources/watch10.png</file>
-    <file>resources/watch11.png</file>
-    <file>resources/watch12.png</file>
-    <file>resources/watch13.png</file>
-    <file>resources/watch14.png</file>
-    <file>resources/watch15.png</file>
-    <file>resources/watch16.png</file>
-  </qresource>
-</RCC>
diff --git a/lib/dialogs/AboutDialog.ui b/lib/dialogs/AboutDialog.ui
deleted file mode 100644
index 0d10fe5..0000000
--- a/lib/dialogs/AboutDialog.ui
+++ /dev/null
@@ -1,262 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <author>Tobias Doerffel</author>
- <class>AboutDialog</class>
- <widget class="QDialog" name="AboutDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>571</width>
-    <height>390</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>About iTALC</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../ItalcCore.qrc">
-    <normaloff>:/resources/info.png</normaloff>:/resources/info.png</iconset>
-  </property>
-  <property name="modal">
-   <bool>true</bool>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>10</number>
-   </property>
-   <property name="margin">
-    <number>15</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout">
-     <property name="spacing">
-      <number>20</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../ItalcCore.qrc">:/resources/icon64.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <property name="font">
-        <font>
-         <pointsize>14</pointsize>
-         <weight>75</weight>
-         <bold>true</bold>
-        </font>
-       </property>
-       <property name="text">
-        <string>About iTALC</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="icon">
-       <iconset resource="../ItalcCore.qrc">
-        <normaloff>:/resources/info.png</normaloff>:/resources/info.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>About</string>
-      </attribute>
-      <layout class="QGridLayout">
-       <property name="leftMargin">
-        <number>24</number>
-       </property>
-       <property name="topMargin">
-        <number>24</number>
-       </property>
-       <property name="rightMargin">
-        <number>9</number>
-       </property>
-       <property name="bottomMargin">
-        <number>9</number>
-       </property>
-       <property name="verticalSpacing">
-        <number>16</number>
-       </property>
-       <item row="0" column="0">
-        <widget class="QLabel" name="label_3">
-         <property name="text">
-          <string>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0">
-        <widget class="QLabel" name="label_4">
-         <property name="text">
-          <string><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></string>
-         </property>
-         <property name="openExternalLinks">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0">
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="icon">
-       <iconset resource="../ItalcCore.qrc">
-        <normaloff>:/resources/authors.png</normaloff>:/resources/authors.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>Authors</string>
-      </attribute>
-      <layout class="QGridLayout">
-       <property name="margin">
-        <number>9</number>
-       </property>
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <item row="0" column="0">
-        <widget class="QPlainTextEdit" name="authors">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="readOnly">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_3">
-      <attribute name="icon">
-       <iconset resource="../ItalcCore.qrc">
-        <normaloff>:/resources/locale.png</normaloff>:/resources/locale.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>Translation</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>24</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="label_5">
-         <property name="text">
-          <string>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</string>
-         </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_4">
-      <attribute name="icon">
-       <iconset resource="../ItalcCore.qrc">
-        <normaloff>:/resources/license.png</normaloff>:/resources/license.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>License</string>
-      </attribute>
-      <layout class="QGridLayout">
-       <property name="bottomMargin">
-        <number>9</number>
-       </property>
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <item row="0" column="0">
-        <widget class="QPlainTextEdit" name="license">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="readOnly">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../ItalcCore.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>AboutDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>285</x>
-     <y>361</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>285</x>
-     <y>194</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/lib/dialogs/PasswordDialog.ui b/lib/dialogs/PasswordDialog.ui
deleted file mode 100644
index 5e404af..0000000
--- a/lib/dialogs/PasswordDialog.ui
+++ /dev/null
@@ -1,239 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PasswordDialog</class>
- <widget class="QDialog" name="PasswordDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>499</width>
-    <height>166</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>iTALC Logon</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../ItalcCore.qrc">
-    <normaloff>:/resources/dialog-password.png</normaloff>:/resources/dialog-password.png</iconset>
-  </property>
-  <layout class="QGridLayout" name="gridLayout_2">
-   <item row="0" column="0" rowspan="5">
-    <widget class="QLabel" name="label_4">
-     <property name="text">
-      <string/>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="../ItalcCore.qrc">:/resources/dialog-password.png</pixmap>
-     </property>
-     <property name="margin">
-      <number>10</number>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="QLabel" name="label">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text">
-      <string>Please enter your username and password in order to access iTALC clients.</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="1">
-    <layout class="QGridLayout" name="gridLayout">
-     <property name="horizontalSpacing">
-      <number>16</number>
-     </property>
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_2">
-       <property name="text">
-        <string>Username</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="username"/>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string>Password</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLineEdit" name="password">
-       <property name="echoMode">
-        <enum>QLineEdit::Password</enum>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="4" column="1">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QDialogButtonBox" name="buttonBox">
-       <property name="standardButtons">
-        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="manageButton">
-       <property name="text">
-        <string>Manage</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../ItalcCore.qrc">
-         <normaloff>:/resources/manage-with-imc.png</normaloff>:/resources/manage-with-imc.png</iconset>
-       </property>
-       <property name="iconSize">
-        <size>
-         <width>16</width>
-         <height>16</height>
-        </size>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="3" column="1">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>10</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="1">
-    <spacer name="verticalSpacer_2">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>10</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../ItalcCore.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>PasswordDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>206</x>
-     <y>137</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>169</x>
-     <y>79</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>PasswordDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>206</x>
-     <y>137</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>169</x>
-     <y>79</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>password</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>PasswordDialog</receiver>
-   <slot>updateOkButton()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>204</x>
-     <y>107</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>169</x>
-     <y>78</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>username</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>PasswordDialog</receiver>
-   <slot>updateOkButton()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>204</x>
-     <y>76</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>169</x>
-     <y>78</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>manageButton</sender>
-   <signal>clicked()</signal>
-   <receiver>PasswordDialog</receiver>
-   <slot>manage()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>444</x>
-     <y>147</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>249</x>
-     <y>82</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
- <slots>
-  <slot>updateOkButton()</slot>
-  <slot>manage()</slot>
- </slots>
-</ui>
diff --git a/lib/include/AboutDialog.h b/lib/include/AboutDialog.h
deleted file mode 100644
index 6c26293..0000000
--- a/lib/include/AboutDialog.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * AboutDialog.h - declaration of AboutDialog class
- *
- * Copyright (c) 2011-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ABOUT_DIALOG_H
-#define ABOUT_DIALOG_H
-
-#include <QtGui/QDialog>
-
-namespace Ui
-{
-	class AboutDialog;
-}
-
-
-class AboutDialog : public QDialog
-{
-public:
-	AboutDialog( QWidget *parent );
-
-
-private:
-	Ui::AboutDialog *ui;
-} ;
-
-
-#endif
diff --git a/lib/include/AuthenticationCredentials.h b/lib/include/AuthenticationCredentials.h
deleted file mode 100644
index e869d72..0000000
--- a/lib/include/AuthenticationCredentials.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * AuthenticationCredentials.h - class holding credentials for authentication
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef AUTHENTICATION_CREDENTIALS_H
-#define AUTHENTICATION_CREDENTIALS_H
-
-#include <QtCore/QString>
-
-class PrivateDSAKey;
-
-class AuthenticationCredentials
-{
-public:
-	enum TypeFlags
-	{
-		PrivateKey = 0x01,
-		UserLogon = 0x02,
-		CommonSecret = 0x04,
-		AllTypes = PrivateKey | UserLogon | CommonSecret
-	} ;
-	typedef int TypeFlag;
-
-	AuthenticationCredentials();
-	AuthenticationCredentials( const AuthenticationCredentials &other );
-
-	bool hasCredentials( TypeFlags credentialType ) const;
-
-	// private key auth
-	bool loadPrivateKey( const QString &path );
-	const PrivateDSAKey *privateKey() const
-	{
-		return m_privateKey;
-	}
-
-	// user logon auth
-	void setLogonUsername( const QString &username );
-	void setLogonPassword( const QString &password );
-
-	const QString &logonUsername() const
-	{
-		return m_logonUsername;
-	}
-
-	const QString &logonPassword() const
-	{
-		return m_logonPassword;
-	}
-
-	// common secret auth
-	void setCommonSecret( const QString &secret )
-	{
-		m_commonSecret = secret;
-	}
-
-	const QString &commonSecret() const
-	{
-		return m_commonSecret;
-	}
-
-
-private:
-	PrivateDSAKey *m_privateKey;
-
-	QString m_logonUsername;
-	QString m_logonPassword;
-
-	QString m_commonSecret;
-
-} ;
-
-#endif
diff --git a/lib/include/Configuration/LocalStore.h b/lib/include/Configuration/LocalStore.h
deleted file mode 100644
index 14c6933..0000000
--- a/lib/include/Configuration/LocalStore.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Configuration/LocalStore.h - LocalStore class
- *
- * Copyright (c) 2009-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CONFIGURATION_LOCAL_STORE_H
-#define CONFIGURATION_LOCAL_STORE_H
-
-#include "Configuration/Store.h"
-
-class QSettings;
-
-namespace Configuration
-{
-
-class LocalStore : public Store
-{
-public:
-	LocalStore( Scope scope );
-
-	virtual void load( Object *obj );
-	virtual void flush( Object *obj );
-	virtual bool isWritable() const;
-
-	QSettings *createSettingsObject() const;
-
-} ;
-
-}
-
-#endif
diff --git a/lib/include/Configuration/Object.h b/lib/include/Configuration/Object.h
deleted file mode 100644
index 55fa938..0000000
--- a/lib/include/Configuration/Object.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Configuration/Object.h - ConfigurationObject class
- *
- * Copyright (c) 2009-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CONFIGURATION_OBJECT_H
-#define CONFIGURATION_OBJECT_H
-
-#include <QtCore/QObject>
-
-#include "Configuration/Store.h"
-
-namespace Configuration
-{
-
-class Object : public QObject
-{
-	Q_OBJECT
-public:
-	typedef QMap<QString, QVariant> DataMap;
-
-	Object( Store::Backend backend, Store::Scope scope );
-	Object( Store *store );
-	Object( const Object & );
-	~Object();
-
-	Object &operator=( const Object &ref );
-	Object &operator+=( const Object &ref );
-
-	QString value( const QString & _key,
-			const QString & _parentKey = QString() ) const;
-
-	void setValue( const QString & _key,
-			const QString & _value,
-			const QString & _parentKey = QString() );
-
-	void removeValue( const QString &key, const QString &parentKey );
-
-	void addSubObject( Object *obj, const QString &parentKey );
-
-	void reloadFromStore()
-	{
-		if( m_store )
-		{
-			m_store->load( this );
-		}
-	}
-
-	void flushStore()
-	{
-		if( m_store )
-		{
-			m_store->flush( this );
-		}
-	}
-
-	bool isStoreWritable() const
-	{
-		return m_store->isWritable();
-	}
-
-	void clear()
-	{
-		m_data.clear();
-	}
-
-	const DataMap & data() const
-	{
-		return m_data;
-	}
-
-
-signals:
-	void configurationChanged();
-
-
-private:
-	Configuration::Store *m_store;
-	bool m_customStore;
-	DataMap m_data;
-
-} ;
-
-
-#define DECLARE_CONFIG_STRING_PROPERTY(get,key,parentKey)\
-	public:											\
-		inline QString get() const					\
-		{											\
-			return value( key, parentKey );			\
-		}
-
-#define DECLARE_CONFIG_STRINGLIST_PROPERTY(get,key,parentKey)\
-	public:													\
-		inline QStringList get() const						\
-		{													\
-			return value( key, parentKey ).split( ',' );	\
-		}
-
-#define DECLARE_CONFIG_INT_PROPERTY(get,key,parentKey)	\
-	public:												\
-		inline int get() const							\
-		{												\
-			return value( key, parentKey ).toInt();		\
-		}
-
-#define DECLARE_CONFIG_BOOL_PROPERTY(get,key,parentKey)	\
-	public:												\
-		bool get() const								\
-		{												\
-			return value( key, parentKey ).toInt() ?	\
-										true : false;	\
-		}
-
-#define DECLARE_CONFIG_PROPERTY(className,config,type, get, set, key, parentKey)			\
-			DECLARE_CONFIG_##type##_PROPERTY(get,key,parentKey)
-
-
-#define IMPLEMENT_CONFIG_SET_STRING_PROPERTY(className,set,key,parentKey)\
-		void className::set( const QString &val )						\
-		{																\
-			setValue( key, val,	parentKey );							\
-		}
-
-#define IMPLEMENT_CONFIG_SET_STRINGLIST_PROPERTY(className,set,key,parentKey)\
-		void className::set( const QStringList &val )					\
-		{																\
-			setValue( key, val.join( "," ),	parentKey );				\
-		}
-
-#define IMPLEMENT_CONFIG_SET_INT_PROPERTY(className,set,key,parentKey)	\
-		void className::set( int val )									\
-		{																\
-			setValue( key, QString::number( val ), parentKey );			\
-		}
-
-#define IMPLEMENT_CONFIG_SET_BOOL_PROPERTY(className,set,key,parentKey)	\
-		void className::set( bool val )									\
-		{																\
-			setValue( key, QString::number( val ), parentKey );			\
-		}
-
-#define IMPLEMENT_CONFIG_SET_PROPERTY(className, config,type, get, set, key, parentKey)	\
-			IMPLEMENT_CONFIG_SET_##type##_PROPERTY(className,set,key,parentKey)
-
-
-}
-
-#endif
diff --git a/lib/include/Configuration/Store.h b/lib/include/Configuration/Store.h
deleted file mode 100644
index d522a6c..0000000
--- a/lib/include/Configuration/Store.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Configuration/Store.h - ConfigurationStore class
- *
- * Copyright (c) 2009-2012 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CONFIGURATION_STORE_H
-#define CONFIGURATION_STORE_H
-
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QVariant>
-
-namespace Configuration
-{
-
-class Object;
-
-class Store
-{
-public:
-	enum Backends
-	{
-		LocalBackend,	// registry or similiar
-		XmlFile,
-		NoBackend
-	} ;
-	typedef Backends Backend;
-
-	enum Scopes
-	{
-		Personal,	// for current user
-		Global,		// for all users
-		System,		// system-wide (service settings etc.)
-		BugReportArchive
-	} ;
-	typedef Scopes Scope;
-
-
-	Store( Backend backend, Scope scope ) :
-		m_backend( backend ),
-		m_scope( scope )
-	{
-	}
-
-	virtual ~Store()
-	{
-	}
-
-	Backend backend() const
-	{
-		return m_backend;
-	}
-
-	Scope scope() const
-	{
-		return m_scope;
-	}
-
-	QString configurationNameFromScope() const
-	{
-		switch( scope() )
-		{
-			case Global: return "GlobalConfig";
-			case Personal: return "PersonalConfig";
-			case System: return "SystemConfig";
-			case BugReportArchive: return "BugReportArchive";
-		}
-
-		return QString();
-	}
-
-	virtual void load( Object *obj ) = 0;
-	virtual void flush( Object *obj ) = 0;
-	virtual bool isWritable() const = 0;
-
-
-private:
-	const Backend m_backend;
-	const Scope m_scope;
-
-} ;
-
-}
-
-#endif
diff --git a/lib/include/Configuration/UiMapping.h b/lib/include/Configuration/UiMapping.h
deleted file mode 100644
index 1a01bc5..0000000
--- a/lib/include/Configuration/UiMapping.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Configuration/UiMapping.h - helper macros for connecting config with UI
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CONFIGURATION_UI_MAPPING_H
-#define CONFIGURATION_UI_MAPPING_H
-
-// widget initialization
-#define _INIT_WIDGET_FROM_PROPERTY(config,property,widgetType,setvalue)				\
-			qobject_cast<widgetType *>( ui->property )->setvalue( config->property() );
-
-#define INIT_WIDGET_FROM_BOOL_PROPERTY(config,property,slot)							\
-			_INIT_WIDGET_FROM_PROPERTY(config,property,QAbstractButton,setChecked)
-
-#define INIT_WIDGET_FROM_STRING_PROPERTY(config,property,slot)							\
-			_INIT_WIDGET_FROM_PROPERTY(config,property,QLineEdit,setText)
-
-#define INIT_WIDGET_FROM_STRINGLIST_PROPERTY(config,property,slot)							\
-/*			if(ui->property->inherits("QListWidget")) {					\
-				qobject_cast<QListWidget *>( ui->property )->clear();			\
-				qobject_cast<QListWidget *>( ui->property )->addItems( config->property() );	\
-			}*/
-
-#define INIT_WIDGET_FROM_INT_PROPERTY(config,property,slot)							\
-			if(ui->property->inherits("QComboBox"))	{							\
-				_INIT_WIDGET_FROM_PROPERTY(config,property,QComboBox,setCurrentIndex)	\
-			} else {															\
-				_INIT_WIDGET_FROM_PROPERTY(config,property,QSpinBox,setValue)			\
-			}
-
-#define INIT_WIDGET_FROM_PROPERTY(className, config, type, get, set, key, parentKey)	\
-			INIT_WIDGET_FROM_##type##_PROPERTY(config,get,set)
-
-
-// allow connecting widget signals to configuration property write methods
-#define CONNECT_WIDGET_TO_BOOL_PROPERTY(config,property,slot)							\
-			connect( ui->property, SIGNAL(toggled(bool)),						\
-						config, SLOT(slot(bool)) );
-
-#define CONNECT_WIDGET_TO_STRINGLIST_PROPERTY(config,property,slot)
-
-#define CONNECT_WIDGET_TO_STRING_PROPERTY(config,property,slot)						\
-			connect( ui->property, SIGNAL(textChanged(const QString &)),		\
-						config, SLOT(slot(const QString &)) );
-
-#define CONNECT_WIDGET_TO_INT_PROPERTY(config,property,slot)							\
-			if(ui->property->inherits("QComboBox"))	{							\
-				connect( ui->property, SIGNAL(currentIndexChanged(int)),		\
-							config, SLOT(slot(int)) );				\
-			} else {															\
-				connect( ui->property, SIGNAL(valueChanged(int)),				\
-							config, SLOT(slot(int)) );				\
-			}
-
-#define CONNECT_WIDGET_TO_PROPERTY(className, config, type, get, set, key, parentKey)	\
-			CONNECT_WIDGET_TO_##type##_PROPERTY(config,get,set)
-
-#endif
diff --git a/lib/include/Configuration/XmlStore.h b/lib/include/Configuration/XmlStore.h
deleted file mode 100644
index 4d46ded..0000000
--- a/lib/include/Configuration/XmlStore.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Configuration/XmlStore.h - XmlStore class
- *
- * Copyright (c) 2009-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CONFIGURATION_XML_STORE_H
-#define CONFIGURATION_XML_STORE_H
-
-#include "Configuration/Store.h"
-
-
-namespace Configuration
-{
-
-class XmlStore : public Store
-{
-public:
-	XmlStore( Scope scope, const QString & file = QString() );
-
-	virtual void load( Object *obj );
-	virtual void flush( Object *obj );
-	virtual bool isWritable() const;
-
-
-private:
-	QString configurationFilePath() const;
-
-	QString m_file;
-
-} ;
-
-}
-
-#endif
diff --git a/lib/include/Configuration/moc_LocalStore.cxx_parameters b/lib/include/Configuration/moc_LocalStore.cxx_parameters
deleted file mode 100644
index 47a9096..0000000
--- a/lib/include/Configuration/moc_LocalStore.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Configuration/moc_LocalStore.cxx
-/tmp/foo/lib/include/Configuration/LocalStore.h
diff --git a/lib/include/Configuration/moc_Object.cxx_parameters b/lib/include/Configuration/moc_Object.cxx_parameters
deleted file mode 100644
index d2586e0..0000000
--- a/lib/include/Configuration/moc_Object.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Configuration/moc_Object.cxx
-/tmp/foo/lib/include/Configuration/Object.h
diff --git a/lib/include/Configuration/moc_Store.cxx_parameters b/lib/include/Configuration/moc_Store.cxx_parameters
deleted file mode 100644
index a57abe0..0000000
--- a/lib/include/Configuration/moc_Store.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Configuration/moc_Store.cxx
-/tmp/foo/lib/include/Configuration/Store.h
diff --git a/lib/include/Configuration/moc_UiMapping.cxx_parameters b/lib/include/Configuration/moc_UiMapping.cxx_parameters
deleted file mode 100644
index 48eea37..0000000
--- a/lib/include/Configuration/moc_UiMapping.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Configuration/moc_UiMapping.cxx
-/tmp/foo/lib/include/Configuration/UiMapping.h
diff --git a/lib/include/Configuration/moc_XmlStore.cxx_parameters b/lib/include/Configuration/moc_XmlStore.cxx_parameters
deleted file mode 100644
index 623eee7..0000000
--- a/lib/include/Configuration/moc_XmlStore.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Configuration/moc_XmlStore.cxx
-/tmp/foo/lib/include/Configuration/XmlStore.h
diff --git a/lib/include/DecoratedMessageBox.h b/lib/include/DecoratedMessageBox.h
deleted file mode 100644
index 82befd9..0000000
--- a/lib/include/DecoratedMessageBox.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * DecoratedMessageBox.h - decorated messagebox
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DECORATED_MESSAGEBOX_H
-#define DECORATED_MESSAGEBOX_H
-
-#include <QtGui/QDialog>
-#include <QtGui/QPixmap>
-
-class DecoratedMessageBox : public QDialog
-{
-	Q_OBJECT
-public:
-	enum MessageIcon
-	{
-		NoIcon,
-		Information,
-		Warning,
-		Critical
-	} ;
-
-	DecoratedMessageBox( const QString & _title, const QString & _msg,
-					const QPixmap & _pixmap = QPixmap() );
-
-	static void information( const QString & _title, const QString & _msg,
-					const QPixmap & _pixmap = QPixmap() );
-
-	static void trySysTrayMessage( const QString & _title,
-							const QString & _msg,
-							MessageIcon _msg_icon );
-} ;
-
-#endif
-
diff --git a/lib/include/DsaKey.h b/lib/include/DsaKey.h
deleted file mode 100644
index 3056473..0000000
--- a/lib/include/DsaKey.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * DsaKey.h - easy to use C++ classes for dealing with DSA-keys, -signatures
- *            etc.
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
- /****************************************************************************
- *
- * In addition, as a special exception, Tobias Doerffel gives permission to link
- * the code of its release of iTALC with the OpenSSL project's "OpenSSL" library
- * (or modified versions of the "OpenSSL" library that use the same license
- * as the original version), and distribute the linked executables.
- *
- * You must comply with the GNU General Public License version 2 in all
- * respects for all of the code used other than the "OpenSSL" code.  If you
- * modify this file, you may extend this exception to your version of the file,
- * but you are not obligated to do so.  If you do not wish to do so, delete
- * this exception statement from your version of this file.
- *
- ****************************************************************************/
-
-#ifndef DSA_KEY_H
-#define DSA_KEY_H
-
-#include <QtCore/QByteArray>
-#include <QtCore/QString>
-
-#include <openssl/dsa.h>
-
-
-class DsaKey
-{
-public:
-	enum KeyType
-	{
-		Public,
-		Private
-	} ;
-
-	static const int DefaultChallengeSize;
-
-	// constructor
-	DsaKey( const KeyType _type ) :
-		m_dsa( NULL ),
-		m_type( _type )
-	{
-	}
-
-	// destructor
-	virtual ~DsaKey()
-	{
-		if( isValid() )
-		{
-			DSA_free( m_dsa );
-		}
-	}
-
-	// return key-type
-	inline KeyType type( void ) const
-	{
-		return m_type;
-	}
-
-	inline bool isValid( void ) const
-	{
-		return ( m_dsa != NULL );
-	}
-
-	virtual bool load( const QString & _file,
-					QString _passphrase = QString::null ) = 0;
-	virtual bool save( const QString & _file,
-					QString _passphrase = QString::null ) const = 0;
-
-	bool verifySignature( const QByteArray & _data,
-					const QByteArray & _signature ) const;
-
-	const DSA * dsaData( void ) const
-	{
-		return m_dsa;
-	}
-
-	static QByteArray generateChallenge( void );
-
-
-protected:
-	DSA * m_dsa;
-	KeyType m_type;
-
-} ;
-
-
-
-
-class PrivateDSAKey : public DsaKey
-{
-public:
-	// constructor - load private key from file
-	PrivateDSAKey( const QString & _file,
-				const QString & _passphrase = QString::null ) :
-		DsaKey( Private )
-	{
-		load( _file, _passphrase );
-	}
-
-	// constructor - generate new private key with given number of bits
-	PrivateDSAKey( const unsigned int _bits );
-
-	// returns signature for data
-	QByteArray sign( const QByteArray & _data ) const;
-
-	virtual bool load( const QString & _file,
-						QString _passphrase = QString::null );
-	virtual bool save( const QString & _file,
-						QString _passphrase = QString::null ) const;
-
-} ;
-
-
-
-
-class PublicDSAKey : public DsaKey
-{
-public:
-	// constructor - load public key from file
-	PublicDSAKey( const QString & _file ) :
-		DsaKey( Public )
-	{
-		load( _file );
-	}
-
-	// constructor - derive public key from private key
-	explicit PublicDSAKey( const PrivateDSAKey & _pkey );
-
-	virtual bool load( const QString & _file,
-						QString _passphrase = QString::null );
-	virtual bool save( const QString & _file,
-						QString _passphrase = QString::null ) const;
-
-} ;
-
-
-#endif
diff --git a/lib/include/FastQImage.h b/lib/include/FastQImage.h
deleted file mode 100644
index c05ef97..0000000
--- a/lib/include/FastQImage.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * FastQImage.h - class FastQImage providing fast inline-QImage-manips
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef FAST_QIMAGE_H
-#define FAST_QIMAGE_H
-
-#include <stdint.h>
-
-#include <QtGui/QImage>
-#include <QtGui/QPixmap>
-
-
-class FastQImage : public QImage
-{
-public:
-	FastQImage() : QImage() { }
-	FastQImage( const QImage & _img ) : QImage( _img ) { }
-	FastQImage( const QPixmap & _pm ) : QImage( _pm.toImage() ) { }
-
-
-	QPixmap toPixmap( void ) const
-	{
-		return( QPixmap().fromImage( *this ) );
-	}
-
-
-	inline void fillRect( const uint16_t rx, const uint16_t ry,
-				const uint16_t rw, const uint16_t rh,
-				const QRgb pix )
-	{
-		const uint16_t img_width = width();
-		QRgb * dst = (QRgb *) scanLine( ry ) + rx;
-		// TODO: is it faster to fill first line and then memcpy()
-		//       this line?
-		for( uint16_t y = 0; y < rh; ++y )
-		{
-			//QRgb * dest = dst_base;
-			for( uint16_t x = 0; x < rw; ++x )
-			{
-				dst[x] = pix;
-			}
-			dst += img_width;
-		}
-	}
-
-
-
-	inline void copyRect( const uint16_t rx, const uint16_t ry,
-				const uint16_t rw, const uint16_t rh,
-				const QRgb * buf )
-	{
-		if( rh > 0 )
-		{
-			const uint16_t img_width = width();
-			QRgb * dst = (QRgb *) scanLine( ry ) + rx;
-			for( uint16_t y = 0; y < rh; ++y )
-			{
-				memcpy( dst, buf, rw * sizeof( QRgb ) );
-				buf += rw;
-				dst += img_width;
-			}
-		}
-		else
-		{
-			qWarning( "FastQImage::copyRect(): tried to copy a rect with zero-height - ignoring" );
-		}
-	}
-
-
-
-	inline void copyExistingRect( const uint16_t src_x,
-					const uint16_t src_y,
-					const uint16_t rw,
-					const uint16_t rh,
-					const uint16_t dest_x,
-					const uint16_t dest_y )
-	{
-		// TODO: check whether we need to handle if dest-rect is inside
-		//       src-rect
-		const uint16_t img_width = width();
-		const QRgb * src = (const QRgb *) scanLine( src_y ) + src_x;
-		QRgb * dst = (QRgb *) scanLine( dest_y ) + dest_x;
-		for( uint16_t y = 0; y < rh; ++y )
-		{
-			// TODO: vectorize
-			memcpy( dst, src, rw * sizeof( QRgb ) );
-			src += img_width;
-			dst += img_width;
-		}
-	}
-
-	// scales this image to the size, _dst has
-	QImage & scaleTo( QImage & _dst ) const;
-
-	// overload horribly slow scaled()-method
-	inline QImage scaled( const QSize & size,
-			Qt::AspectRatioMode arm = Qt::IgnoreAspectRatio,
-			Qt::TransformationMode tm = Qt::SmoothTransformation )
-									const
-	{
-		if( tm == Qt::SmoothTransformation &&
-			arm == Qt::IgnoreAspectRatio &&
-			size.isEmpty() == false )
-		{
-			QImage tmp( size, format() );
-			scaleTo( tmp );
-			return( tmp );
-		}
-		return( QImage::scaled( size, arm, tm ) );
-	}
-
-
-	inline QImage scaled( int width, int height,
-			Qt::AspectRatioMode arm = Qt::IgnoreAspectRatio,
-			Qt::TransformationMode tm = Qt::SmoothTransformation )
-									const
-	{
-		return( scaled( QSize( width, height ), arm, tm ) );
-	}
-
-
-	// fill alpha-channel of image with certain value
-	inline FastQImage & alphaFill( const unsigned char _alpha )
-	{
-		QRgb * ptr = (QRgb *) bits();
-		const unsigned int pixels = width() * height();
-		const QRgb mask = ((unsigned int) _alpha ) << 24;
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			*ptr = ( *ptr & 0x00ffffff ) | mask;
-			++ptr;
-		}
-		return *this;
-	}
-
-
-	// set alpha-value of all pixels to a certain value it it is greater
-	// then it (something like max<..>(...) for QImage ;-)
-	inline FastQImage & alphaFillMax( const unsigned char _alpha )
-	{
-		unsigned char * ptr = bits() + 3;
-		const unsigned int pixels = width() * height();
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			if( *ptr > _alpha )
-			{
-				*ptr = _alpha;
-			}
-			ptr += 4;
-		}
-		return( *this );
-	}
-
-
-	// darken whole image by _coeff (_coeff = [0;256])
-	inline FastQImage & darken( const uint16_t _coeff )
-	{
-		unsigned char * ptr = bits();
-		const unsigned int pixels = width() * height();
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			ptr[0] = ( ptr[0] * _coeff ) >> 8;
-			ptr[1] = ( ptr[1] * _coeff ) >> 8;
-			ptr[2] = ( ptr[2] * _coeff ) >> 8;
-			ptr[3] = ( ptr[3] * 256 ) >> 8;
-			ptr += 4;
-		}
-		return *this;
-	}
-
-
-	inline FastQImage & toGray( void )
-	{
-		QRgb * ptr = (QRgb *) bits();
-		const unsigned int pixels = width() * height();
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			const QRgb gray = qGray( *ptr );
-			const QRgb g = gray | ( gray << 8 ) | ( gray << 16 ) |
-													( qAlpha(*ptr) << 24 );
-			*ptr = g;
-			++ptr;
-		}
-		return *this;
-	}
-
-
-} ;
-
-
-
-
-inline QPixmap scaled( const QString & _file, const int _w, const int _h )
-{
-	return( QPixmap::fromImage( FastQImage( QPixmap( _file ) ).
-							scaled( _w, _h ) ) );
-}
-
-
-
-#endif
-
diff --git a/lib/include/Inject.h b/lib/include/Inject.h
deleted file mode 100644
index c3ae87a..0000000
--- a/lib/include/Inject.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Inject.h - functions for injecting code into winlogon.exe for disabling
- *            SAS (Alt+Ctrl+Del)
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef INJECT_H
-#define INJECT_H
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-
-#include <windows.h>
-
-BOOL Inject( void );
-BOOL Eject( void );
-
-#endif
-
-#endif
-
diff --git a/lib/include/Ipc/Core.h b/lib/include/Ipc/Core.h
deleted file mode 100644
index c2df199..0000000
--- a/lib/include/Ipc/Core.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * IpcCore.h - core definitions for the IPC framework
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef IPC_CORE_H
-#define IPC_CORE_H
-
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QVariant>
-
-namespace Ipc
-{
-	typedef QString Command;
-	typedef QString Id;
-	typedef QString Argument;
-	typedef QMap<Argument, QVariant> CommandArgs;
-
-	namespace Commands
-	{
-		extern const Command Identify;
-		extern const Command UnknownCommand;
-		extern const Command Ping;
-		extern const Command Quit;
-	}
-
-	namespace Arguments
-	{
-		extern const Argument Id;
-		extern const Argument Command;
-	}
-
-	class Msg
-	{
-	public:
-		Msg( const Command &cmd = Command() ) :
-			m_cmd( cmd )
-		{
-		}
-
-		Msg( const Msg & msg ) :
-			m_cmd( msg.m_cmd ),
-			m_args( msg.m_args )
-		{
-		}
-
-		bool isValid() const
-		{
-			return !cmd().isEmpty();
-		}
-
-		const Command & cmd() const
-		{
-			return m_cmd;
-		}
-
-		const CommandArgs & args() const
-		{
-			return m_args;
-		}
-
-		Msg & addArg( const QString &key, const QVariant &value )
-		{
-			m_args[key] = value;
-			return *this;
-		}
-
-		Msg & addArg( const QString &key, const int value )
-		{
-			m_args[key] = QString::number( value );
-			return *this;
-		}
-
-		QString arg( const QString &key ) const
-		{
-			return m_args[key].toString();
-		}
-
-		QVariant argV( const QString &key ) const
-		{
-			return m_args[key];
-		}
-
-		template<class QIOD>
-		bool send( QIOD *d ) const
-		{
-			QDataStream ds( d );
-			ds << m_cmd;
-			ds << m_args;
-			d->flush();
-			return true;
-		}
-
-		template<class QIOD>
-		Msg & receive( QIOD *d )
-		{
-			QDataStream ds( d );
-			ds >> m_cmd;
-			ds >> m_args;
-			return *this;
-		}
-
-
-	private:
-		Command m_cmd;
-		CommandArgs m_args;
-
-	} ;
-
-}
-
-#endif // _IPC_CORE_H
diff --git a/lib/include/Ipc/Master.h b/lib/include/Ipc/Master.h
deleted file mode 100644
index 58a541e..0000000
--- a/lib/include/Ipc/Master.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * IpcMaster.h - class Ipc::Master which manages Ipc::Slaves
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef IPC_MASTER_H
-#define IPC_MASTER_H
-
-#include "Ipc/Core.h"
-
-#include <QtCore/QMutex>
-#include <QtCore/QProcess>
-#include <QtCore/QSignalMapper>
-#include <QtNetwork/QTcpServer>
-
-
-namespace Ipc
-{
-
-class SlaveLauncher;
-
-class Master : public QTcpServer
-{
-	Q_OBJECT
-public:
-	Master( const QString &applicationFilePath );
-	virtual ~Master();
-
-	const QString & applicationFilePath() const
-	{
-		return m_applicationFilePath;
-	}
-
-	virtual void createSlave( const Ipc::Id &id, SlaveLauncher *slaveLauncher = NULL );
-	void stopSlave( const Ipc::Id &id );
-	bool isSlaveRunning( const Ipc::Id &id );
-
-	void sendMessage( const Ipc::Id &id, const Ipc::Msg &msg );
-	Ipc::Msg receiveMessage( const Ipc::Id &id );
-
-	virtual bool handleMessage( const Ipc::Id &id, const Ipc::Msg &msg ) = 0;
-
-
-private slots:
-	void acceptConnection();
-	void receiveMessage( QObject *sock );
-	void sendPendingMessages();
-
-
-private:
-	QString m_applicationFilePath;
-	QSignalMapper m_socketReceiveMapper;
-
-	struct ProcessInformation
-	{
-		QTcpSocket *sock;
-		SlaveLauncher *slaveLauncher;
-		QVector<Ipc::Msg> pendingMessages;
-
-		ProcessInformation() :
-			sock( NULL ),
-			slaveLauncher( NULL ),
-			pendingMessages()
-		{
-		}
-
-		ProcessInformation( const ProcessInformation &ref ) :
-			sock( ref.sock ),
-			slaveLauncher( ref.slaveLauncher ),
-			pendingMessages( ref.pendingMessages )
-		{
-		}
-	};
-
-	typedef QMap<Ipc::Id, ProcessInformation> ProcessMap;
-	ProcessMap m_processes;
-
-	QMutex m_processMapMutex;
-
-
-signals:
-	void messagesPending();
-
-};
-
-}
-
-#endif // _IPC_MASTER_H
diff --git a/lib/include/Ipc/QtSlaveLauncher.h b/lib/include/Ipc/QtSlaveLauncher.h
deleted file mode 100644
index 412c832..0000000
--- a/lib/include/Ipc/QtSlaveLauncher.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * QtSlaveLauncher.h - class Ipc::QtSlaveLauncher providing mechanisms for
- *                     launching a slave application
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef IPC_QT_SLAVE_LAUNCHER_H
-#define IPC_QT_SLAVE_LAUNCHER_H
-
-#include <QtCore/QMutex>
-
-#include "Ipc/SlaveLauncher.h"
-
-class QProcess;
-
-namespace Ipc
-{
-
-class QtSlaveLauncher : public SlaveLauncher
-{
-public:
-	QtSlaveLauncher( const QString &applicationFilePath = QString() );
-	~QtSlaveLauncher();
-
-	virtual void start( const QStringList &arguments );
-	virtual void stop();
-	virtual bool isRunning();
-
-
-private:
-	QMutex m_processMutex;
-	QProcess *m_process;
-
-};
-
-}
-
-#endif // _IPC_QT_SLAVE_LAUNCHER_H
diff --git a/lib/include/Ipc/Slave.h b/lib/include/Ipc/Slave.h
deleted file mode 100644
index 812d462..0000000
--- a/lib/include/Ipc/Slave.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * IpcSlave.h - class Ipc::Slave providing communication with Ipc::Master
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef IPC_SLAVE_H
-#define IPC_SLAVE_H
-
-#include <QtCore/QTime>
-#include <QtCore/QTimer>
-#include <QtNetwork/QTcpSocket>
-
-#include "Ipc/Core.h"
-
-namespace Ipc
-{
-
-class Slave : public QTcpSocket
-{
-	Q_OBJECT
-public:
-	Slave( const Ipc::Id &masterId, const Ipc::Id &slaveId );
-
-	virtual bool handleMessage( const Ipc::Msg &msg ) = 0;
-
-
-private slots:
-	void receiveMessage();
-	void masterPing();
-
-
-private:
-	const QString m_slaveId;
-	QTimer m_pingTimer;
-	QTime m_lastPingResponse;
-
-} ;
-
-}
-
-#endif // _IPC_SLAVE_H
diff --git a/lib/include/Ipc/SlaveLauncher.h b/lib/include/Ipc/SlaveLauncher.h
deleted file mode 100644
index 3c1059d..0000000
--- a/lib/include/Ipc/SlaveLauncher.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * IpcSlaveLauncher.h - class Ipc::SlaveLauncher providing mechanisms for
- *                      launching a slave application
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef IPC_SLAVE_LAUNCHER_H
-#define IPC_SLAVE_LAUNCHER_H
-
-#include "Ipc/Core.h"
-
-namespace Ipc
-{
-
-class SlaveLauncher
-{
-public:
-	SlaveLauncher( const QString &applicationFilePath = QString() );
-	virtual ~SlaveLauncher();
-
-	virtual void start( const QStringList &arguments );
-	virtual void stop();
-	virtual bool isRunning() = 0;
-
-	const QString & applicationFilePath() const
-	{
-		return m_applicationFilePath;
-	}
-
-
-private:
-	QString m_applicationFilePath;
-
-};
-
-}
-
-#endif // _IPC_SLAVE_LAUNCHER_H
diff --git a/lib/include/Ipc/moc_Core.cxx_parameters b/lib/include/Ipc/moc_Core.cxx_parameters
deleted file mode 100644
index db2aada..0000000
--- a/lib/include/Ipc/moc_Core.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Ipc/moc_Core.cxx
-/tmp/foo/lib/include/Ipc/Core.h
diff --git a/lib/include/Ipc/moc_Master.cxx_parameters b/lib/include/Ipc/moc_Master.cxx_parameters
deleted file mode 100644
index 2a90d70..0000000
--- a/lib/include/Ipc/moc_Master.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Ipc/moc_Master.cxx
-/tmp/foo/lib/include/Ipc/Master.h
diff --git a/lib/include/Ipc/moc_QtSlaveLauncher.cxx_parameters b/lib/include/Ipc/moc_QtSlaveLauncher.cxx_parameters
deleted file mode 100644
index faa6d41..0000000
--- a/lib/include/Ipc/moc_QtSlaveLauncher.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Ipc/moc_QtSlaveLauncher.cxx
-/tmp/foo/lib/include/Ipc/QtSlaveLauncher.h
diff --git a/lib/include/Ipc/moc_Slave.cxx_parameters b/lib/include/Ipc/moc_Slave.cxx_parameters
deleted file mode 100644
index 276cf23..0000000
--- a/lib/include/Ipc/moc_Slave.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Ipc/moc_Slave.cxx
-/tmp/foo/lib/include/Ipc/Slave.h
diff --git a/lib/include/Ipc/moc_SlaveLauncher.cxx_parameters b/lib/include/Ipc/moc_SlaveLauncher.cxx_parameters
deleted file mode 100644
index 4144ec8..0000000
--- a/lib/include/Ipc/moc_SlaveLauncher.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/Ipc/moc_SlaveLauncher.cxx
-/tmp/foo/lib/include/Ipc/SlaveLauncher.h
diff --git a/lib/include/ItalcConfiguration.h b/lib/include/ItalcConfiguration.h
deleted file mode 100644
index f2f414e..0000000
--- a/lib/include/ItalcConfiguration.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * ItalcConfiguration.h - a Configuration object storing system wide
- *                        configuration values
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_CONFIGURATION_H
-#define ITALC_CONFIGURATION_H
-
-#include <QtCore/QStringList>
-
-#include "Configuration/Object.h"
-
-class ItalcConfiguration : public Configuration::Object
-{
-	Q_OBJECT
-public:
-	ItalcConfiguration( Configuration::Store::Backend backend =
-										Configuration::Store::LocalBackend );
-	ItalcConfiguration( Configuration::Store *store );
-	ItalcConfiguration( const ItalcConfiguration &ref );
-
-	static ItalcConfiguration defaultConfiguration();
-
-	static QString expandPath( QString path );
-
-
-#define FOREACH_ITALC_CONFIG_PROPERTY(OP)												\
-		/* iTALC Service */																\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isTrayIconHidden, setTrayIconHidden, "HideTrayIcon", "Service" );			\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, lockWithDesktopSwitching, setLockWithDesktopSwitching, "LockWithDesktopSwitching", "Service" );			\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, autostartService, setServiceAutostart, "Autostart", "Service" );			\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, serviceArguments, setServiceArguments, "Arguments", "Service" );			\
-		/* Logging */																	\
-		OP( ItalcConfiguration, ItalcCore::config, INT, logLevel, setLogLevel, "LogLevel", "Logging" );								\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, limittedLogFileSize, setLimittedLogFileSize, "LimittedLogFileSize", "Logging" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, logToStdErr, setLogToStdErr, "LogToStdErr", "Logging" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, logToWindowsEventLog, setLogToWindowsEventLog, "LogToWindowsEventLog", "Logging" );	\
-		OP( ItalcConfiguration, ItalcCore::config, INT, logFileSizeLimit, setLogFileSizeLimit, "LogFileSizeLimit", "Logging" );		\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, logFileDirectory, setLogFileDirectory, "LogFileDirectory", "Logging" );		\
-		/* VNC Server */																\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, vncCaptureLayeredWindows, setVncCaptureLayeredWindows, "CaptureLayeredWindows", "VNC" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, vncPollFullScreen, setVncPollFullScreen, "PollFullScreen", "VNC" );			\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, vncLowAccuracy, setVncLowAccuracy, "LowAccuracy", "VNC" );					\
-		/* Demo server */																\
-		OP( ItalcConfiguration, ItalcCore::config, INT, demoServerBackend, setDemoServerBackend, "Backend", "DemoServer" );		\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isDemoServerMultithreaded, setDemoServerMultithreaded, "Multithreaded", "DemoServer" );		\
-		/* Network */																	\
-		OP( ItalcConfiguration, ItalcCore::config, INT, coreServerPort, setCoreServerPort, "CoreServerPort", "Network" );			\
-		OP( ItalcConfiguration, ItalcCore::config, INT, httpServerPort, setHttpServerPort, "HttpServerPort", "Network" );			\
-		OP( ItalcConfiguration, ItalcCore::config, INT, demoServerPort, setDemoServerPort, "DemoServerPort", "Network" );			\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isHttpServerEnabled, setHttpServerEnabled, "HttpServerEnabled", "Network" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isFirewallExceptionEnabled, setFirewallExceptionEnabled, "FirewallExceptionEnabled", "Network" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, localConnectOnly, setLocalConnectOnly, "LocalConnectOnly", "Network" );					\
-		/* Configuration file paths */													\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, globalConfigurationPath, setGlobalConfigurationPath, "GlobalConfiguration", "Paths" );	\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, personalConfigurationPath, setPersonalConfigurationPath, "PersonalConfiguration", "Paths" );	\
-		/* Data directories */															\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, snapshotDirectory, setSnapshotDirectory, "SnapshotDirectory", "Paths" );	\
-		/* Authentication */															\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isKeyAuthenticationEnabled, setKeyAuthenticationEnabled, "KeyAuthenticationEnabled", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isLogonAuthenticationEnabled, setLogonAuthenticationEnabled, "LogonAuthenticationEnabled", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isPermissionRequiredWithKeyAuthentication, setPermissionRequiredWithKeyAuthentication, "PermissionRequiredWithKeyAuthentication", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, privateKeyBaseDir, setPrivateKeyBaseDir, "PrivateKeyBaseDir", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, STRING, publicKeyBaseDir, setPublicKeyBaseDir, "PublicKeyBaseDir", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isPermissionRequiredWithLogonAuthentication, setPermissionRequiredWithLogonAuthentication, "PermissionRequiredWithLogonAuthentication", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, BOOL, isSameUserConfirmationDisabled, setSameUserConfirmationDisabled, "SameUserConfirmationDisabled", "Authentication" );	\
-		OP( ItalcConfiguration, ItalcCore::config, STRINGLIST, logonGroups, setLogonGroups, "LogonGroups", "Authentication" );	\
-
-	FOREACH_ITALC_CONFIG_PROPERTY(DECLARE_CONFIG_PROPERTY)
-
-	// unluckily we have to declare slots manually as Qt's MOC doesn't do any
-	// macro expansion :-(
-public slots:
-	void setTrayIconHidden( bool );
-	void setLockWithDesktopSwitching( bool );
-	void setServiceAutostart( bool );
-	void setServiceArguments( const QString & );
-	void setLogLevel( int );
-	void setLogToStdErr( bool );
-	void setLogToWindowsEventLog( bool );
-	void setLimittedLogFileSize( bool );
-	void setLogFileSizeLimit( int );
-	void setLogFileDirectory( const QString & );
-	void setVncCaptureLayeredWindows( bool );
-	void setVncPollFullScreen( bool );
-	void setVncLowAccuracy( bool );
-	void setDemoServerBackend( int );
-	void setDemoServerMultithreaded( bool );
-	void setCoreServerPort( int );
-	void setDemoServerPort( int );
-	void setHttpServerPort( int );
-	void setFirewallExceptionEnabled( bool );
-	void setLocalConnectOnly( bool );
-	void setHttpServerEnabled( bool );
-	void setGlobalConfigurationPath( const QString & );
-	void setPersonalConfigurationPath( const QString & );
-	void setSnapshotDirectory( const QString & );
-	void setKeyAuthenticationEnabled( bool );
-	void setLogonAuthenticationEnabled( bool );
-	void setPermissionRequiredWithKeyAuthentication( bool );
-	void setPrivateKeyBaseDir( const QString & );
-	void setPublicKeyBaseDir( const QString & );
-	void setPermissionRequiredWithLogonAuthentication( bool );
-	void setSameUserConfirmationDisabled( bool );
-	void setLogonGroups( const QStringList & );
-
-} ;
-
-#endif
diff --git a/lib/include/ItalcCore.h b/lib/include/ItalcCore.h
deleted file mode 100644
index 6cb1ea7..0000000
--- a/lib/include/ItalcCore.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * ItalcCore.h - definitions for iTALC Core
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_CORE_H
-#define ITALC_CORE_H
-
-#include <QtCore/QPair>
-#include <QtCore/QString>
-#include <QtCore/QVariant>
-
-#include "Ipc/Core.h"
-
-#include "AuthenticationCredentials.h"
-
-
-class ItalcConfiguration;
-class SocketDevice;
-
-namespace ItalcCore
-{
-	bool init();
-	bool initAuthentication( int credentialTypes =
-										AuthenticationCredentials::AllTypes );
-	void destroy();
-
-	extern ItalcConfiguration *config;
-	extern AuthenticationCredentials *authenticationCredentials;
-
-	typedef QString Command;
-	typedef QMap<QString, QVariant> CommandArgs;
-	typedef QList<QPair<ItalcCore::Command, ItalcCore::CommandArgs> >
-								CommandList;
-
-	// static commands
-	extern const Command GetUserInformation;
-	extern const Command UserInformation;
-	extern const Command StartDemo;
-	extern const Command StopDemo;
-	extern const Command LockScreen;
-	extern const Command UnlockScreen;
-	extern const Command LockInput;
-	extern const Command UnlockInput;
-	extern const Command LogonUserCmd;
-	extern const Command LogoutUser;
-	extern const Command DisplayTextMessage;
-	extern const Command AccessDialog;
-	extern const Command ExecCmds;
-	extern const Command PowerOnComputer;
-	extern const Command PowerDownComputer;
-	extern const Command RestartComputer;
-	extern const Command DisableLocalInputs;
-	extern const Command SetRole;
-	extern const Command StartDemoServer;
-	extern const Command StopDemoServer;
-	extern const Command DemoServerAllowHost;
-	extern const Command DemoServerUnallowHost;
-	extern const Command ReportSlaveStateFlags;
-
-	class Msg
-	{
-	public:
-		Msg( SocketDevice *sockDev, const Command &cmd = Command() ) :
-			m_socketDevice( sockDev ),
-			m_cmd( cmd )
-		{
-		}
-
-		Msg( const Command &cmd ) :
-			m_socketDevice( NULL ),
-			m_cmd( cmd )
-		{
-		}
-
-		const Command &cmd() const
-		{
-			return m_cmd;
-		}
-
-		const CommandArgs &args() const
-		{
-			return m_args;
-		}
-
-		void setSocketDevice( SocketDevice *sockDev )
-		{
-			m_socketDevice = sockDev;
-		}
-
-		Msg &addArg( const QString &key, const QString &value )
-		{
-			m_args[key.toLower()] = value;
-			return *this;
-		}
-
-		Msg &addArg( const QString &key, const int value )
-		{
-			m_args[key.toLower()] = QString::number( value );
-			return *this;
-		}
-
-		QString arg( const QString &key ) const
-		{
-			return m_args[key.toLower()].toString();
-		}
-
-		bool send();
-		Msg &receive();
-
-
-	private:
-		SocketDevice *m_socketDevice;
-
-		Command m_cmd;
-		CommandArgs m_args;
-
-	} ;
-
-	enum UserRoles
-	{
-		RoleNone,
-		RoleTeacher,
-		RoleAdmin,
-		RoleSupporter,
-		RoleOther,
-		RoleCount
-	} ;
-	typedef UserRoles UserRole;
-
-	enum SlaveStateFlags
-	{
-		AccessDialogRunning 	= 1,
-		DemoServerRunning 		= 2,
-		DemoClientRunning 		= 4,
-		ScreenLockRunning 		= 8,
-		InputLockRunning 		= 16,
-		SystemTrayIconRunning 	= 32,
-		MessageBoxRunning 		= 64
-	} ;
-
-	QString userRoleName( UserRole role );
-
-
-	extern int serverPort;
-	extern UserRoles role;
-
-}
-
-#endif
diff --git a/lib/include/ItalcCoreConnection.h b/lib/include/ItalcCoreConnection.h
deleted file mode 100644
index ba52e4b..0000000
--- a/lib/include/ItalcCoreConnection.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * ItalcCoreConnection.h - declaration of class ItalcCoreConnection
- *
- * Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_CORE_CONNECTION_H
-#define ITALC_CORE_CONNECTION_H
-
-#include "ItalcCore.h"
-#include "ItalcVncConnection.h"
-
-
-class ItalcCoreConnection : public QObject
-{
-	Q_OBJECT
-public:
-	ItalcCoreConnection( ItalcVncConnection *vncConnection );
-	~ItalcCoreConnection();
-
-	ItalcVncConnection *vncConnection()
-	{
-		return m_vncConn;
-	}
-
-	ItalcVncConnection::State state() const
-	{
-		return m_vncConn->state();
-	}
-
-	inline bool isConnected() const
-	{
-		return m_vncConn->isConnected();
-	}
-
-	inline const QString & user() const
-	{
-		return m_user;
-	}
-
-	inline const QString & userHomeDir() const
-	{
-		return m_userHomeDir;
-	}
-
-	int slaveStateFlags() const
-	{
-		return m_slaveStateFlags;
-	}
-
-#define GEN_SLAVE_STATE_HELPER(x)							\
-			bool is##x() const								\
-			{												\
-				return slaveStateFlags() & ItalcCore::x;	\
-			}
-
-	GEN_SLAVE_STATE_HELPER(DemoServerRunning)
-	GEN_SLAVE_STATE_HELPER(DemoClientRunning)
-	GEN_SLAVE_STATE_HELPER(ScreenLockRunning)
-	GEN_SLAVE_STATE_HELPER(InputLockRunning)
-	GEN_SLAVE_STATE_HELPER(SystemTrayIconRunning)
-	GEN_SLAVE_STATE_HELPER(MessageBoxRunning)
-
-	void sendGetUserInformationRequest();
-	void execCmds( const QString &cmd );
-	void startDemo( const QString &host, int port, bool fullscreen = false );
-	void stopDemo();
-	void lockScreen();
-	void unlockScreen();
-	void lockInput();
-	void unlockInput();
-	void logonUser( const QString &uname, const QString &pw,
-						const QString &domain );
-	void logoutUser();
-	void displayTextMessage( const QString &msg );
-
-	void powerOnComputer( const QString &mac );
-	void powerDownComputer();
-	void restartComputer();
-	void disableLocalInputs( bool disabled );
-
-	void setRole( const ItalcCore::UserRole role );
-
-	void startDemoServer( int sourcePort, int destinationPort );
-	void stopDemoServer();
-	void demoServerAllowHost( const QString &host );
-	void demoServerUnallowHost( const QString &host );
-
-	void reportSlaveStateFlags();
-
-signals:
-	void receivedUserInfo( const QString &, const QString & );
-	void receivedSlaveStateFlags( const int );
-
-private slots:
-	void initNewClient( rfbClient *client );
-
-
-private:
-	static rfbBool handleItalcMessage( rfbClient *cl,
-						rfbServerToClientMsg *msg );
-
-	bool handleServerMessage( rfbClient *cl, uint8_t msg );
-	void enqueueMessage( const ItalcCore::Msg &msg );
-
-
-	ItalcVncConnection *m_vncConn;
-
-	QString m_user;
-	QString m_userHomeDir;
-
-	int m_slaveStateFlags;
-
-} ;
-
-
-#endif
diff --git a/lib/include/ItalcRfbExt.h b/lib/include/ItalcRfbExt.h
deleted file mode 100644
index a12d8ae..0000000
--- a/lib/include/ItalcRfbExt.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * ItalcRfbExt.h - an extension of the RFB-protocol, used for communication
- *                 between master and clients
- *
- * Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_RFB_EXT_H
-#define ITALC_RFB_EXT_H
-
-#include <rfb/rfbproto.h>
-#include <rfb/rfbclient.h>
-
-// new rfb-command which tells server or client that an italc-request/response
-// is following
-#define rfbItalcCoreRequest		40
-#define rfbItalcCoreResponse		rfbItalcCoreRequest
-
-
-#define rfbSecTypeItalc 40
-
-
-enum PortOffsets
-{
-	PortOffsetVncServer = 11100,
-	PortOffsetDemoServer = PortOffsetVncServer + 300,
-	PortOffsetHttpServer = 5800
-} ;
-
-
-enum ItalcAuthTypes
-{
-	// no authentication needed
-	ItalcAuthNone,
-
-	// only hosts in internal host-list are allowed
-	ItalcAuthHostBased,
-
-	// client has to sign some data to verify it's authority
-	ItalcAuthDSA,
-
-	// client has to prove its authenticity by knowing an application-internal
-	// secret
-	ItalcAuthCommonSecret,
-
-	NumItalcAuthTypes
-
-} ;
-
-typedef enum ItalcAuthTypes ItalcAuthType;
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-int isLogonAuthenticationEnabled( rfbClient *client );
-void handleSecTypeItalc( rfbClient *client );
-void handleMsLogonIIAuth( rfbClient *client );
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/lib/include/ItalcVncConnection.h b/lib/include/ItalcVncConnection.h
deleted file mode 100644
index 5ea6b17..0000000
--- a/lib/include/ItalcVncConnection.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * ItalcVncConnection.h - declaration of ItalcVncConnection class
- *
- * Copyright (c) 2008-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * code partly taken from KRDC / vncclientthread.h:
- * Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALC_VNC_CONNECTION_H
-#define ITALC_VNC_CONNECTION_H
-
-#include <QtCore/QMutex>
-#include <QtCore/QQueue>
-#include <QtCore/QReadWriteLock>
-#include <QtCore/QThread>
-#include <QtCore/QWaitCondition>
-
-#include "ItalcCore.h"
-#include "ItalcRfbExt.h"
-#include "FastQImage.h"
-
-class PrivateDSAKey;
-
-extern "C"
-{
-	#include <rfb/rfbclient.h>
-}
-
-
-class ClientEvent
-{
-public:
-	virtual ~ClientEvent()
-	{
-	}
-
-	virtual void fire( rfbClient *c ) = 0;
-} ;
-
-
-class ItalcVncConnection: public QThread
-{
-	Q_OBJECT
-public:
-	enum QualityLevels
-	{
-		ThumbnailQuality,
-		SnapshotQuality,
-		RemoteControlQuality,
-		DemoServerQuality,
-		DemoClientQuality,
-		NumQualityLevels
-	} ;
-
-	enum States
-	{
-		Disconnected,
-		HostUnreachable,
-		AuthenticationFailed,
-		ConnectionFailed,
-		Connected
-	} ;
-	typedef States State;
-
-	explicit ItalcVncConnection( QObject *parent = 0 );
-	virtual ~ItalcVncConnection();
-
-	const QImage image( int x = 0, int y = 0, int w = 0, int h = 0 ) const;
-	void setImage( const QImage &img );
-	void stop();
-	void reset( const QString &host );
-	void setHost( const QString &host );
-	void setPort( int port );
-
-	State state() const
-	{
-		return m_state;
-	}
-
-	bool isConnected() const
-	{
-		return state() == Connected && isRunning();
-	}
-
-	bool waitForConnected( int timeout = 10000 ) const;
-
-	const QString &host() const
-	{
-		return m_host;
-	}
-
-	void setItalcAuthType( ItalcAuthType t )
-	{
-		m_italcAuthType = t;
-	}
-
-	ItalcAuthType italcAuthType() const
-	{
-		return m_italcAuthType;
-	}
-
-	void setQuality( QualityLevels qualityLevel )
-	{
-		m_quality = qualityLevel;
-	}
-
-	QualityLevels quality() const
-	{
-		return m_quality;
-	}
-
-	void enqueueEvent( ClientEvent *e );
-
-	const rfbClient *getRfbClient() const
-	{
-		return m_cl;
-	}
-
-	rfbClient *getRfbClient()
-	{
-		return m_cl;
-	}
-
-	QSize framebufferSize() const
-	{
-		return m_image.size();
-	}
-
-	bool framebufferInitialized() const
-	{
-		return m_framebufferInitialized;
-	}
-
-	void setScaledSize( const QSize &s )
-	{
-		if( m_scaledSize != s )
-		{
-			m_scaledSize = s;
-			m_scaledScreenNeedsUpdate = true;
-		}
-	}
-
-	FastQImage scaledScreen()
-	{
-		rescaleScreen();
-		return m_scaledScreen;
-	}
-
-	void setFramebufferUpdateInterval( int interval );
-
-	void rescaleScreen();
-
-	// authentication
-	static void handleSecTypeItalc( rfbClient *client );
-	static void handleMsLogonIIAuth( rfbClient *client );
-
-	void cursorShapeUpdatedExternal( const QImage &cursorShape, int xh, int yh )
-	{
-		cursorShapeUpdated( cursorShape, xh, yh );
-	}
-
-
-signals:
-	void newClient( rfbClient *c );
-	void imageUpdated( int x, int y, int w, int h );
-	void framebufferUpdateComplete();
-	void framebufferSizeChanged( int w, int h );
-	void cursorPosChanged( int x, int y );
-	void cursorShapeUpdated( const QImage &cursorShape, int xh, int yh );
-	void gotCut( const QString &text );
-	void passwordRequest();
-	void outputErrorMessage( const QString &message );
-	void connected();
-	void stateChanged( const int );
-
-
-public slots:
-	void mouseEvent( int x, int y, int buttonMask );
-	void keyEvent( unsigned int key, bool pressed );
-	void clientCut( const QString &text );
-
-
-protected:
-	virtual void run();
-	void doConnection();
-
-
-private:
-	// hooks for LibVNCClient
-	static rfbBool hookNewClient( rfbClient *cl );
-	static void hookUpdateFB( rfbClient *cl, int x, int y, int w, int h );
-	static void hookFinishFrameBufferUpdate( rfbClient *cl );
-	static rfbBool hookHandleCursorPos( rfbClient *cl, int x, int y );
-	static void hookCursorShape( rfbClient *cl, int xh, int yh, int w, int h, int bpp );
-	static void hookCutText( rfbClient *cl, const char *text, int textlen );
-	static void hookOutputHandler( const char *format, ... );
-	static rfbBool hookHandleItalcMessage( rfbClient *cl,
-						rfbServerToClientMsg *msg );
-
-	uint8_t *m_frameBuffer;
-	bool m_framebufferInitialized;
-	rfbClient *m_cl;
-	ItalcAuthType m_italcAuthType;
-	QualityLevels m_quality;
-	QString m_host;
-	int m_port;
-	QWaitCondition m_updateIntervalSleeper;
-	int m_framebufferUpdateInterval;
-	QMutex m_mutex;
-	mutable QReadWriteLock m_imgLock;
-	QQueue<ClientEvent *> m_eventQueue;
-
-	FastQImage m_image;
-	bool m_scaledScreenNeedsUpdate;
-	FastQImage m_scaledScreen;
-	QSize m_scaledSize;
-
-	volatile State m_state;
-	volatile bool m_stopped;
-
-
-} ;
-
-#endif
-
diff --git a/lib/include/LocalSystem.h b/lib/include/LocalSystem.h
deleted file mode 100644
index f05120c..0000000
--- a/lib/include/LocalSystem.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * LocalSystem.h - misc. platform-specific stuff
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef LOCAL_SYSTEM_H
-#define LOCAL_SYSTEM_H
-
-#include "ItalcCore.h"
-
-#ifdef ITALC_BUILD_WIN32
-#include <windef.h>
-#endif
-
-#define QDTNS(x)	QDir::toNativeSeparators(x)
-
-class QWidget;
-
-
-namespace LocalSystem
-{
-
-	class Desktop
-	{
-	public:
-		Desktop( const QString &name = QString() );
-		Desktop( const Desktop &desktop );
-
-		const QString &name() const
-		{
-			return m_name;
-		}
-
-		bool isActive() const
-		{
-			return name() == activeDesktop().name();
-		}
-
-		static Desktop activeDesktop();
-		static Desktop screenLockDesktop();
-
-
-	private:
-		QString m_name;
-	} ;
-
-	class User
-	{
-	public:
-#ifdef ITALC_BUILD_WIN32
-		typedef PSID Token;
-#else
-		typedef int Token;
-#endif
-		User( const QString &name, const QString &domain = QString(),
-									const QString &fullname = QString() );
-		User( Token token );
-		User( const User &user );
-		~User();
-
-		static User loggedOnUser();
-
-		const Token &userToken() const
-		{
-			return m_userToken;
-		}
-
-		Token userToken()
-		{
-			return m_userToken;
-		}
-
-		const QString &name() const
-		{
-			return m_name;
-		}
-
-		const QString &domain() const
-		{
-			return m_domain;
-		}
-
-		const QString &fullName()
-		{
-			// full name lookups are quite expensive, therefore do them
-			// on-demand and only if not done before
-			if( m_fullName.isEmpty() )
-			{
-				lookupFullName();
-				if( m_fullName.isEmpty() )
-				{
-					m_fullName = name();
-				}
-			}
-			return m_fullName;
-		}
-
-		QString homePath() const;
-
-
-	private:
-		void lookupNameAndDomain();
-		void lookupFullName();
-
-		Token m_userToken;
-		QString m_name;
-		QString m_domain;
-		QString m_fullName;
-
-	} ;
-
-	class Process
-	{
-	public:
-#ifdef ITALC_BUILD_WIN32
-		typedef HANDLE Handle;
-#else
-		typedef int Handle;
-#endif
-		Process( int pid = -1 );
-		~Process();
-
-		static int findProcessId( const QString &processName,
-									int sessionId = -1,
-									const User *processOwner = NULL );
-
-		User *getProcessOwner();
-
-		Handle processHandle()
-		{
-			return m_processHandle;
-		}
-
-		Handle runAsUser( const QString &proc,
-									const QString &desktop = QString() );
-		static bool isRunningAsAdmin();
-		static bool runAsAdmin( const QString &proc, const QString &parameters );
-
-	private:
-		Handle m_processHandle;
-
-	} ;
-
-
-	class Path
-	{
-	public:
-		static QString expand( QString path );
-		static QString shrink( QString path );
-		static bool ensurePathExists( const QString &path );
-
-		static QString personalConfigDataPath();
-		static QString systemConfigDataPath();
-
-		static QString privateKeyPath( ItalcCore::UserRoles role,
-												QString baseDir = QString() );
-		static QString publicKeyPath( ItalcCore::UserRoles role,
-												QString baseDir = QString() );
-	} ;
-
-
-	void sleep( const int _ms );
-
-	void broadcastWOLPacket( const QString & _mac );
-
-	void powerDown();
-	void reboot();
-
-	void logonUser( const QString & _uname, const QString & _pw,
-						const QString & _domain );
-	void logoutUser();
-
-#ifdef ITALC_BUILD_WIN32
-	BOOL enablePrivilege( LPCTSTR lpszPrivilegeName, BOOL bEnable );
-#endif
-
-	void activateWindow( QWidget * _window );
-
-}
-
-#endif
diff --git a/lib/include/LockWidget.h b/lib/include/LockWidget.h
deleted file mode 100644
index d95acff..0000000
--- a/lib/include/LockWidget.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *  LockWidget.h - widget for locking a client
- *
- *  Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifndef LOCK_WIDGET_H
-#define LOCK_WIDGET_H
-
-#include <italcconfig.h>
-
-#include <QtGui/QWidget>
-#include <QtGui/QPixmap>
-
-#include "SystemKeyTrapper.h"
-
-
-class LockWidget : public QWidget
-{
-	Q_OBJECT
-public:
-	enum Modes
-	{
-		DesktopVisible,
-		Black,
-		NoBackground
-	} ;
-
-	LockWidget( Modes _mode = Black );
-	virtual ~LockWidget();
-
-
-private:
-	virtual void paintEvent( QPaintEvent * );
-#ifdef ITALC_BUILD_LINUX
-	virtual bool x11Event( XEvent * _e );
-#endif
-
-	QPixmap m_background;
-	Modes m_mode;
-	SystemKeyTrapper m_sysKeyTrapper;
-
-} ;
-
-#endif
-
diff --git a/lib/include/Logger.h b/lib/include/Logger.h
deleted file mode 100644
index 2a04734..0000000
--- a/lib/include/Logger.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Logger.h - a global clas for easily logging messages to log files
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef ITALCCORE_LOGGER_H
-#define ITALCCORE_LOGGER_H
-
-#include <italcconfig.h>
-
-#include <QtCore/QDebug>
-#include <QtCore/QTextStream>
-#include <QtCore/QMutex>
-
-class QFile;
-class CXEventLog;
-
-class Logger
-{
-public:
-	enum LogLevels
-	{
-		LogLevelNothing,
-		LogLevelCritical,
-		LogLevelError,
-		LogLevelWarning,
-		LogLevelInfo,
-		LogLevelDebug,
-		NumLogLevels,
-		LogLevelMin = LogLevelNothing+1,
-		LogLevelMax = NumLogLevels-1,
-		LogLevelDefault = LogLevelInfo
-	} ;
-
-	typedef LogLevels LogLevel;
-
-	Logger( const QString &appName );
-	~Logger();
-
-	static void log( LogLevel ll, const QString &msg );
-	static void log( LogLevel ll, const char *format, ... );
-
-
-private:
-	void initLogFile();
-	void outputMessage( const QString &msg );
-
-	static QString formatMessage( LogLevel ll, const QString &msg );
-	static void qtMsgHandler( QtMsgType msgType, const char *msg );
-
-	static LogLevel logLevel;
-	static Logger *instance;
-	static QMutex logMutex;
-
-	static LogLevel lastMsgLevel;
-	static QString lastMsg;
-	static int lastMsgCount;
-
-	QString m_appName;
-
-#ifdef ITALC_BUILD_WIN32
-	static CXEventLog *winEventLog;
-#endif
-
-	QFile *m_logFile;
-
-} ;
-
-#define ilog(ll, msg) Logger::log(Logger::LogLevel##ll, msg )
-#define ilogf(ll, format, ...) Logger::log(Logger::LogLevel##ll, format, __VA_ARGS__)
-#define ilog_failed(what) ilogf( Warning, "%s: %s failed", __PRETTY_FUNCTION__, what )
-#define ilog_failedf(what, format, ...) ilogf( Warning, "%s: %s failed: " format, __PRETTY_FUNCTION__, what, __VA_ARGS__ )
-
-
-// helper class for easily streaming Qt datatypes into logfiles
-class LogStream : public QTextStream
-{
-public:
-	LogStream( Logger::LogLevel ll = Logger::LogLevelInfo ) :
-		QTextStream(),
-		m_logLevel( ll ),
-		m_out()
-	{
-		setString( &m_out );
-	}
-
-	~LogStream()
-	{
-		flush();
-		Logger::log( m_logLevel, m_out );
-	}
-
-	// allows to stream advanced data types such as lists, maps etc. by
-	// using QDebug's stream operator
-	template<class QDEBUG_STREAMABLE>
-	LogStream &operator<<( const QDEBUG_STREAMABLE &s )
-	{
-		QDebug( &m_out ) << s;
-		return *this;
-	}
-
-
-private:
-	Logger::LogLevel m_logLevel;
-	QString m_out;
-
-} ;
-
-#endif
diff --git a/lib/include/LogonAuthentication.h b/lib/include/LogonAuthentication.h
deleted file mode 100644
index 116f258..0000000
--- a/lib/include/LogonAuthentication.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * LogonAuthentication.h - a global class providing logon authentication
- *
- * Copyright (c) 2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef LOGON_AUTHENTICATION_H
-#define LOGON_AUTHENTICATION_H
-
-#include "AuthenticationCredentials.h"
-
-class LogonAuthentication
-{
-public:
-	static bool authenticateUser( const AuthenticationCredentials &cred );
-
-} ;
-
-#endif
diff --git a/lib/include/PasswordDialog.h b/lib/include/PasswordDialog.h
deleted file mode 100644
index dfd9f24..0000000
--- a/lib/include/PasswordDialog.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * PasswordDialog.h - declaration of password dialog
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef PASSWORD_DIALOG_H
-#define PASSWORD_DIALOG_H
-
-#include "AuthenticationCredentials.h"
-
-#include <QtGui/QDialog>
-
-namespace Ui { class PasswordDialog; }
-
-class PasswordDialog : public QDialog
-{
-	Q_OBJECT
-public:
-	PasswordDialog( QWidget *parent );
-	virtual ~PasswordDialog();
-
-	QString username() const;
-	QString password() const;
-
-	AuthenticationCredentials credentials() const;
-
-
-private slots:
-	void updateOkButton();
-	void manage();
-
-
-private:
-	Ui::PasswordDialog *ui;
-
-} ;
-
-#endif
diff --git a/lib/include/ProgressWidget.h b/lib/include/ProgressWidget.h
deleted file mode 100644
index 0805074..0000000
--- a/lib/include/ProgressWidget.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  ProgressWidget.h - widget with animated progress-indicator
- *
- *  Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-
-#ifndef PROGRESS_WIDGET_H
-#define PROGRESS_WIDGET_H
-
-#include <QtCore/QVector>
-#include <QtGui/QPixmap>
-#include <QtGui/QWidget>
-
-
-class ProgressWidget : public QWidget
-{
-	Q_OBJECT
-public:
-	ProgressWidget( const QString & _txt,
-			const QString & _anim, int _frames,
-			QWidget * _parent = 0 );
-	virtual ~ProgressWidget();
-
-
-private slots:
-	void nextAnim( void );
-
-
-private:
-	virtual void paintEvent( QPaintEvent * );
-
-	QString m_txt;
-	QString m_anim;
-	int m_frames;
-	int m_curFrame;
-
-	QVector<QPixmap> m_pixmaps;
-
-} ;
-
-
-#endif
-
diff --git a/lib/include/QuadTree.h b/lib/include/QuadTree.h
deleted file mode 100644
index aacc4b3..0000000
--- a/lib/include/QuadTree.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * QuadTree.h - QuadTree, a data structure for fast fuzzy rectangle merging
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef QUAD_TREE_H
-#define QUAD_TREE_H
-
-#include <stdint.h>
-#include <QtCore/QList>
-#include <QtCore/QRect>
-#include <QtCore/QVector>
-
-typedef QList<QRect> RectList;
-
-struct QuadTreeRect
-{
-	QuadTreeRect( uint16_t x1 = 0, uint16_t y1 = 0, uint16_t x2 = 0, uint16_t y2 = 0 ) :
-		m_x1( x1 ),
-		m_x2( x2 ),
-		m_y1( y1 ),
-		m_y2( y2 )
-	{
-	}
-
-	uint16_t x1() const
-	{
-		return m_x1;
-	}
-
-	uint16_t y1() const
-	{
-		return m_y1;
-	}
-
-	uint16_t x2() const
-	{
-		return m_x2;
-	}
-
-	uint16_t y2() const
-	{
-		return m_y2;
-	}
-
-	uint16_t m_x1, m_x2, m_y1, m_y2;
-} ;
-
-
-class QuadTree
-{
-public:
-	QuadTree( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t level, bool topLevel = true ) :
-		m_x1( x1 ),
-		m_y1( y1 ),
-		m_x2( x2 ),
-		m_y2( y2 ),
-		m_level( level ),
-		m_topLevel( topLevel ),
-		m_marked( false )
-	{
-		if( m_level > 0 )
-		{
-			uint16_t wh = (m_x2-m_x1+1)/2;
-			uint16_t hh = (m_y2-m_y1+1)/2;
-			m_subRects[0][0] = new QuadTree( x1, y1, x1+wh-1, y1+hh-1, level-1, false );
-			m_subRects[1][0] = new QuadTree( x1+wh, y1, x2, y1+hh-1, level-1, false );
-			m_subRects[0][1] = new QuadTree( x1, y1+hh, x1+wh-1, y2, level-1, false );
-			m_subRects[1][1] = new QuadTree( x1+wh, y1+hh, x2, y2, level-1, false );
-		}
-	}
-
-	~QuadTree()
-	{
-		if( m_level > 0 )
-		{
-			delete m_subRects[0][0];
-			delete m_subRects[0][1];
-			delete m_subRects[1][0];
-			delete m_subRects[1][1];
-		}
-	}
-
-	void reset()
-	{
-		m_marked = false;
-		if( m_level > 0 )
-		{
-			m_subRects[0][0]->reset();
-			m_subRects[0][1]->reset();
-			m_subRects[1][0]->reset();
-			m_subRects[1][1]->reset();
-		}
-	}
-
-	bool isMarked() const
-	{
-		return m_marked;
-	}
-
-#define likely(x)	__builtin_expect((x),1)
-#define unlikely(x)	__builtin_expect((x),0)
-
-	bool intersects( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) const
-	{
-		if ( m_x1 > x2 || x1 > m_x2 ) return false;
-		if ( m_y1 > y2 || y1 > m_y2 ) return false;
-		return true;
-	}
-
-	void addRects( const QList<QRect> &qrects )
-	{
-		foreach( const QRect &r, qrects )
-		{
-			addRect( r.x(), r.y(), r.x()+r.width()-1, r.y()+r.height()-1 );
-		}
-	}
-
-	bool addRect( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 )
-	{
-		if( isMarked() )
-		{
-			return true;
-		}
-		else if( intersects( x1, y1, x2, y2 ) )
-		{
-			if( likely( m_level > 0 ) )
-			{
-				bool x = true;
-				x &= m_subRects[0][0]->addRect( x1, y1, x2, y2 );
-				x &= m_subRects[0][1]->addRect( x1, y1, x2, y2 );
-				x &= m_subRects[1][0]->addRect( x1, y1, x2, y2 );
-				x &= m_subRects[1][1]->addRect( x1, y1, x2, y2 );
-				m_marked = x;
-			}
-			else
-			{
-				//printf("mark %d:%d - %d:%d\n", m_x1, m_y1, m_x2, m_y2 );
-				m_marked = true;
-			}
-		}
-		return isMarked();
-	}
-
-	int numMarkedAllSubRects() const
-	{
-		if( unlikely( m_level == 0 ) )
-		{
-			return isMarked() ? 1 : 0;
-		}
-		return m_subRects[0][0]->numMarkedAllSubRects() +
-				m_subRects[0][1]->numMarkedAllSubRects() +
-				m_subRects[1][0]->numMarkedAllSubRects() +
-				m_subRects[1][1]->numMarkedAllSubRects();
-	}
-
-	int numMarkedSubRects() const
-	{
-		if( unlikely( m_level == 0 ) )
-		{
-			return 0;
-		}
-		return ( m_subRects[0][0]->isMarked() ? 1 : 0 ) +
-				( m_subRects[0][1]->isMarked() ? 1 : 0 ) +
-				( m_subRects[1][0]->isMarked() ? 1 : 0 ) +
-				( m_subRects[1][1]->isMarked() ? 1 : 0 );
-	}
-
-	inline int totalSubRects() const
-	{
-		int n = 1 << m_level;
-		return n*n;
-	}
-
-	operator QuadTreeRect() const
-	{
-		return QuadTreeRect( m_x1, m_y1, m_x2, m_y2 );
-	}
-
-	QVector<QuadTreeRect> rects() const
-	{
-		if( isMarked() )
-		{
-			return QVector<QuadTreeRect>( 1 , (QuadTreeRect)*this);
-		}
-		else if( m_level == 0 )
-		{
-			return QVector<QuadTreeRect>();
-		}
-		const int x = 1<<(m_level+1);
-		if( numMarkedAllSubRects() >= totalSubRects()*(x-1)/x )
-		{
-			return QVector<QuadTreeRect>( 1, (QuadTreeRect)*this );
-		}
-
-		if( numMarkedSubRects() == 2 )
-		{
-			for( int i = 0; i < 2; ++i )
-			{
-				// subrects at same row?
-				if( m_subRects[0][i]->isMarked() && m_subRects[1][i]->isMarked() )
-				{
-					QVector<QuadTreeRect> l( m_subRects[0][i ? 0 : 1]->rects() +
-								m_subRects[1][i ? 0 : 1]->rects() );
-					l += QuadTreeRect( m_x1, m_subRects[0][i]->m_y1,
-												m_x2, m_subRects[0][i]->m_y2 );
-					return l;
-				}
-				// subrects at same col?
-				if( m_subRects[i][0]->isMarked() && m_subRects[i][1]->isMarked() )
-				{
-					QVector<QuadTreeRect> l( m_subRects[i ? 0 : 1][0]->rects() +
-										m_subRects[i ? 0 : 1][1]->rects() );
-					l += QuadTreeRect( m_subRects[i][0]->m_x1, m_y1,
-												m_subRects[i][0]->m_x2, m_y2 );
-					return l;
-				}
-			}
-		}
-
-		QVector<QuadTreeRect> l( m_subRects[0][0]->rects() +
-				m_subRects[0][1]->rects() +
-				m_subRects[1][0]->rects() +
-				m_subRects[1][1]->rects() );
-
-		// merge all adjacent rectangles
-		if( m_topLevel )
-		{
-			bool found = true;
-			while( found )
-			{
-				found = false;
-				for( QVector<QuadTreeRect>::Iterator it = l.begin(); it != l.end(); ++it )
-				{
-					for( QVector<QuadTreeRect>::Iterator jt = it+1; jt != l.end(); )
-					{
-						if( ( it->y1() == jt->y1() && it->y2() == jt->y2() &&
-								( it->x2()+1 == jt->x1() || it->x1() == jt->x2()+1 ) ) ||
-							( it->x1() == jt->x1() && it->x2() == jt->x2() &&
-								( it->y2()+1 == jt->y1() || it->y1() == jt->y2()+1 ) ) )
-						{
-							*it = QuadTreeRect( qMin( it->x1(), jt->x1() ), qMin( it->y1(), jt->y1() ),
-											qMax( it->x2(), jt->x2() ), qMax( it->y2(), jt->y2() ) );
-							jt = l.erase( jt );
-							found = true;
-						}
-						else
-						{
-							++jt;
-						}
-					}
-				}
-			}
-		}
-		return l;
-	}
-
-private:
-	const uint16_t m_x1, m_y1, m_x2, m_y2;
-	const uint8_t m_level;
-	const bool m_topLevel;
-	bool m_marked;
-	QuadTree *m_subRects[2][2];
-} ;
-
-#endif
-
diff --git a/lib/include/Snapshot.h b/lib/include/Snapshot.h
deleted file mode 100644
index 94ff87f..0000000
--- a/lib/include/Snapshot.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *  Snapshot.h - class representing a screen snapshot
- *
- *  Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#ifndef SNAPSHOT_H
-#define SNAPSHOT_H
-
-#include <QtGui/QImage>
-#include <QtGui/QPixmap>
-
-class ItalcVncConnection;
-
-class Snapshot : public QObject
-{
-	Q_OBJECT
-public:
-	Snapshot( const QString &fileName = QString() );
-
-	void take( ItalcVncConnection *vncConn, const QString &user );
-
-	bool isValid() const
-	{
-		return !fileName().isEmpty() && !image().isNull();
-	}
-
-	const QString &fileName() const
-	{
-		return m_fileName;
-	}
-
-	const QImage &image() const
-	{
-		return m_image;
-	}
-
-	QPixmap pixmap() const
-	{
-		return QPixmap::fromImage( image() );
-	}
-
-	QString user() const;
-	QString host() const;
-	QString date() const;
-	QString time() const;
-
-
-private:
-	QString m_fileName;
-	QImage m_image;
-
-} ;
-
-#endif
-
diff --git a/lib/include/SocketDevice.h b/lib/include/SocketDevice.h
deleted file mode 100644
index 268b74c..0000000
--- a/lib/include/SocketDevice.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * SocketDevice.h - SocketDevice abstraction
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SOCKET_DEVICE_H
-#define SOCKET_DEVICE_H
-
-#include <QtCore/QIODevice>
-#include <QtCore/QString>
-#include <QtCore/QVariant>
-
-
-typedef enum
-{
-	SocketRead,
-	SocketWrite,
-	SocketGetPeerAddress
-} SocketOpCodes;
-
-
-typedef qint64 ( * socketDispatcher )( char *buffer, const qint64 bytes,
-									const SocketOpCodes opCode, void *user );
-
-
-extern qint64 libvncClientDispatcher( char *buffer, const qint64 bytes,
-									const SocketOpCodes opCode, void *user );
-
-
-class SocketDevice : public QIODevice
-{
-public:
-	SocketDevice( socketDispatcher sockDisp, void *user = NULL ) :
-		QIODevice(),
-		m_socketDispatcher( sockDisp ),
-		m_user( user )
-	{
-		open( ReadWrite | Unbuffered );
-	}
-
-	QVariant read()
-	{
-		QDataStream d( this );
-		return d;
-	}
-
-	void write( const QVariant &v )
-	{
-		QDataStream d( this );
-		d << v;
-	}
-
-	socketDispatcher sockDispatcher()
-	{
-		return m_socketDispatcher;
-	}
-
-	void *user()
-	{
-		return m_user;
-	}
-
-	void setUser( void *user )
-	{
-		m_user = user;
-	}
-
-	qint64 read( char *buf, qint64 bytes )
-	{
-		return readData( buf, bytes );
-	}
-
-	qint64 write( const char *buf, qint64 bytes )
-	{
-		return writeData( buf, bytes );
-	}
-
-
-protected:
-	qint64 readData( char *buf, qint64 bytes )
-	{
-		return m_socketDispatcher( buf, bytes, SocketRead, m_user );
-	}
-
-	qint64 writeData( const char *buf, qint64 bytes )
-	{
-		return m_socketDispatcher( const_cast<char *>( buf ), bytes,
-												SocketWrite, m_user );
-	}
-
-
-private:
-	socketDispatcher m_socketDispatcher;
-	void * m_user;
-
-} ;
-
-#endif
diff --git a/lib/include/SystemKeyTrapper.h b/lib/include/SystemKeyTrapper.h
deleted file mode 100644
index e9a879c..0000000
--- a/lib/include/SystemKeyTrapper.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * SystemKeyTrapper.h - class for trapping system-keys and -key-sequences
- *                      such as Alt+Ctrl+Del, Alt+Tab etc.
- *
- * Copyright (c) 2006-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef SYSTEM_KEY_TRAPPER_H
-#define SYSTEM_KEY_TRAPPER_H
-
-#include <italcconfig.h>
-
-#include "ItalcRfbExt.h"
-
-#include <QtCore/QMutex>
-#include <QtCore/QObject>
-
-
-class SystemKeyTrapper : public QObject
-{
-	Q_OBJECT
-public:
-	enum TrappedKeys
-	{
-		None,
-		AltCtrlDel,
-		AltTab,
-		AltEsc,
-		AltSpace,
-		AltF4,
-		CtrlEsc,
-		SuperKeyDown,
-		SuperKeyUp
-	} ;
-
-
-	SystemKeyTrapper( bool enable = true );
-	~SystemKeyTrapper();
-
-	void setEnabled( bool on );
-	bool isEnabled() const
-	{
-		return m_enabled;
-	}
-
-	void setTaskBarHidden( bool on );
-
-	void setAllKeysDisabled( bool on );
-
-
-private:
-	static QMutex s_refCntMutex;
-	static int s_refCnt;
-
-	bool m_enabled;
-	bool m_taskBarHidden;
-#ifdef ITALC_BUILD_LINUX
-	QByteArray m_origKeyTable;
-#endif
-
-
-private slots:
-	void checkForTrappedKeys();
-
-
-signals:
-	void keyEvent( unsigned int, bool );
-
-} ;
-
-#endif
-
diff --git a/lib/include/VncView.h b/lib/include/VncView.h
deleted file mode 100644
index 542839f..0000000
--- a/lib/include/VncView.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * VncView.h - VNC viewer widget
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef VNC_VIEW_H
-#define VNC_VIEW_H
-
-#include <italcconfig.h>
-
-#include <QtCore/QEvent>
-#include <QtCore/QThread>
-#include <QtGui/QWidget>
-
-#include "ItalcVncConnection.h"
-#include "FastQImage.h"
-
-
-class ProgressWidget;
-class RemoteControlWidget;
-class SystemKeyTrapper;
-
-
-class VncView : public QWidget
-{
-	Q_OBJECT
-public:
-	enum Modes
-	{
-		RemoteControlMode,
-		DemoMode,
-		NumModes
-	} ;
-	typedef Modes Mode;
-
-	VncView( const QString &host, QWidget *parent, Mode mode );
-	virtual ~VncView();
-
-	inline bool isViewOnly() const
-	{
-		return m_viewOnly;
-	}
-
-	inline bool isScaledView() const
-	{
-		return m_scaledView;
-	}
-
-	ItalcVncConnection * vncConnection()
-	{
-		return &m_vncConn;
-	}
-
-	QSize scaledSize() const;
-	QSize framebufferSize() const
-	{
-		return m_framebufferSize;
-	}
-	QSize sizeHint() const;
-
-
-public slots:
-	void setViewOnly( bool _vo );
-	void setScaledView( bool _sv );
-
-
-signals:
-	void mouseAtTop();
-	void keyEvent( int, bool );
-	void startConnection();
-	void connectionEstablished();
-	void sizeHintChanged();
-
-
-private slots:
-	void checkKeyEvent( unsigned int key, bool pressed );
-	void updateCursorPos( int x, int y );
-	void updateCursorShape( const QImage &cursorShape, int xh, int yh );
-	void updateImage( int x, int y, int w, int h );
-	void updateSizeHint( int w, int h );
-
-
-private:
-	virtual bool eventFilter( QObject * _obj, QEvent * _event );
-	virtual bool event( QEvent * _ev );
-	virtual void focusInEvent( QFocusEvent * );
-	virtual void focusOutEvent( QFocusEvent * );
-	virtual void paintEvent( QPaintEvent * );
-	virtual void resizeEvent( QResizeEvent * );
-
-	void keyEventHandler( QKeyEvent * );
-	void mouseEventHandler( QMouseEvent * );
-	void wheelEventHandler( QWheelEvent * );
-	void unpressModifiers();
-
-	QPoint mapToFramebuffer( const QPoint & _pos );
-	QRect mapFromFramebuffer( const QRect & _rect );
-
-	void updateLocalCursor();
-
-
-	ItalcVncConnection m_vncConn;
-
-	Mode m_mode;
-	int m_x, m_y, m_w, m_h;
-	bool m_repaint;
-	FastQImage m_frame;
-	QImage m_cursorShape;
-	int m_cursorX;
-	int m_cursorY;
-	QSize m_framebufferSize;
-	int m_cursorHotX;
-	int m_cursorHotY;
-	bool m_viewOnly;
-	bool m_viewOnlyFocus;
-	bool m_scaledView;
-	bool m_initDone;
-
-	int m_buttonMask;
-	QMap<unsigned int, bool> m_mods;
-
-	ProgressWidget * m_establishingConnection;
-
-	SystemKeyTrapper * m_sysKeyTrapper;
-
-
-	friend class remoteControlWidget;
-
-} ;
-
-#endif
-
diff --git a/lib/include/moc_AboutDialog.cxx_parameters b/lib/include/moc_AboutDialog.cxx_parameters
deleted file mode 100644
index f86f692..0000000
--- a/lib/include/moc_AboutDialog.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_AboutDialog.cxx
-/tmp/foo/lib/include/AboutDialog.h
diff --git a/lib/include/moc_AuthenticationCredentials.cxx_parameters b/lib/include/moc_AuthenticationCredentials.cxx_parameters
deleted file mode 100644
index 55fe301..0000000
--- a/lib/include/moc_AuthenticationCredentials.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_AuthenticationCredentials.cxx
-/tmp/foo/lib/include/AuthenticationCredentials.h
diff --git a/lib/include/moc_DecoratedMessageBox.cxx_parameters b/lib/include/moc_DecoratedMessageBox.cxx_parameters
deleted file mode 100644
index 0c9f211..0000000
--- a/lib/include/moc_DecoratedMessageBox.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_DecoratedMessageBox.cxx
-/tmp/foo/lib/include/DecoratedMessageBox.h
diff --git a/lib/include/moc_DsaKey.cxx_parameters b/lib/include/moc_DsaKey.cxx_parameters
deleted file mode 100644
index dbbfb5d..0000000
--- a/lib/include/moc_DsaKey.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_DsaKey.cxx
-/tmp/foo/lib/include/DsaKey.h
diff --git a/lib/include/moc_FastQImage.cxx_parameters b/lib/include/moc_FastQImage.cxx_parameters
deleted file mode 100644
index 5a3f196..0000000
--- a/lib/include/moc_FastQImage.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_FastQImage.cxx
-/tmp/foo/lib/include/FastQImage.h
diff --git a/lib/include/moc_Inject.cxx_parameters b/lib/include/moc_Inject.cxx_parameters
deleted file mode 100644
index 2a2d7f3..0000000
--- a/lib/include/moc_Inject.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_Inject.cxx
-/tmp/foo/lib/include/Inject.h
diff --git a/lib/include/moc_ItalcConfiguration.cxx_parameters b/lib/include/moc_ItalcConfiguration.cxx_parameters
deleted file mode 100644
index 5141c0f..0000000
--- a/lib/include/moc_ItalcConfiguration.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_ItalcConfiguration.cxx
-/tmp/foo/lib/include/ItalcConfiguration.h
diff --git a/lib/include/moc_ItalcCore.cxx_parameters b/lib/include/moc_ItalcCore.cxx_parameters
deleted file mode 100644
index f405a4a..0000000
--- a/lib/include/moc_ItalcCore.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_ItalcCore.cxx
-/tmp/foo/lib/include/ItalcCore.h
diff --git a/lib/include/moc_ItalcCoreConnection.cxx_parameters b/lib/include/moc_ItalcCoreConnection.cxx_parameters
deleted file mode 100644
index af9c28b..0000000
--- a/lib/include/moc_ItalcCoreConnection.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_ItalcCoreConnection.cxx
-/tmp/foo/lib/include/ItalcCoreConnection.h
diff --git a/lib/include/moc_ItalcRfbExt.cxx_parameters b/lib/include/moc_ItalcRfbExt.cxx_parameters
deleted file mode 100644
index c6f02cd..0000000
--- a/lib/include/moc_ItalcRfbExt.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_ItalcRfbExt.cxx
-/tmp/foo/lib/include/ItalcRfbExt.h
diff --git a/lib/include/moc_ItalcVncConnection.cxx_parameters b/lib/include/moc_ItalcVncConnection.cxx_parameters
deleted file mode 100644
index d26510e..0000000
--- a/lib/include/moc_ItalcVncConnection.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_ItalcVncConnection.cxx
-/tmp/foo/lib/include/ItalcVncConnection.h
diff --git a/lib/include/moc_LocalSystem.cxx_parameters b/lib/include/moc_LocalSystem.cxx_parameters
deleted file mode 100644
index ceeda94..0000000
--- a/lib/include/moc_LocalSystem.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_LocalSystem.cxx
-/tmp/foo/lib/include/LocalSystem.h
diff --git a/lib/include/moc_LockWidget.cxx_parameters b/lib/include/moc_LockWidget.cxx_parameters
deleted file mode 100644
index b1a9176..0000000
--- a/lib/include/moc_LockWidget.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_LockWidget.cxx
-/tmp/foo/lib/include/LockWidget.h
diff --git a/lib/include/moc_Logger.cxx_parameters b/lib/include/moc_Logger.cxx_parameters
deleted file mode 100644
index ec368e0..0000000
--- a/lib/include/moc_Logger.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_Logger.cxx
-/tmp/foo/lib/include/Logger.h
diff --git a/lib/include/moc_LogonAuthentication.cxx_parameters b/lib/include/moc_LogonAuthentication.cxx_parameters
deleted file mode 100644
index 1a0ce78..0000000
--- a/lib/include/moc_LogonAuthentication.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_LogonAuthentication.cxx
-/tmp/foo/lib/include/LogonAuthentication.h
diff --git a/lib/include/moc_PasswordDialog.cxx_parameters b/lib/include/moc_PasswordDialog.cxx_parameters
deleted file mode 100644
index f5f6573..0000000
--- a/lib/include/moc_PasswordDialog.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_PasswordDialog.cxx
-/tmp/foo/lib/include/PasswordDialog.h
diff --git a/lib/include/moc_ProgressWidget.cxx_parameters b/lib/include/moc_ProgressWidget.cxx_parameters
deleted file mode 100644
index 2783554..0000000
--- a/lib/include/moc_ProgressWidget.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_ProgressWidget.cxx
-/tmp/foo/lib/include/ProgressWidget.h
diff --git a/lib/include/moc_QuadTree.cxx_parameters b/lib/include/moc_QuadTree.cxx_parameters
deleted file mode 100644
index a2d713c..0000000
--- a/lib/include/moc_QuadTree.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_QuadTree.cxx
-/tmp/foo/lib/include/QuadTree.h
diff --git a/lib/include/moc_Snapshot.cxx_parameters b/lib/include/moc_Snapshot.cxx_parameters
deleted file mode 100644
index ea1a614..0000000
--- a/lib/include/moc_Snapshot.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_Snapshot.cxx
-/tmp/foo/lib/include/Snapshot.h
diff --git a/lib/include/moc_SocketDevice.cxx_parameters b/lib/include/moc_SocketDevice.cxx_parameters
deleted file mode 100644
index 0c7274d..0000000
--- a/lib/include/moc_SocketDevice.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_SocketDevice.cxx
-/tmp/foo/lib/include/SocketDevice.h
diff --git a/lib/include/moc_SystemKeyTrapper.cxx_parameters b/lib/include/moc_SystemKeyTrapper.cxx_parameters
deleted file mode 100644
index ca51709..0000000
--- a/lib/include/moc_SystemKeyTrapper.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_SystemKeyTrapper.cxx
-/tmp/foo/lib/include/SystemKeyTrapper.h
diff --git a/lib/include/moc_VncView.cxx_parameters b/lib/include/moc_VncView.cxx_parameters
deleted file mode 100644
index 51e5589..0000000
--- a/lib/include/moc_VncView.cxx_parameters
+++ /dev/null
@@ -1,22 +0,0 @@
--I/usr/include/qt4
--I/usr/include/qt4/QtGui
--I/usr/include/qt4/QtXml
--I/usr/include/qt4/QtNetwork
--I/usr/include/qt4/QtCore
--I/tmp/foo
--I/tmp/foo/lib/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--I/usr/include
--DQT_GUI_LIB
--DQT_XML_LIB
--DQT_NETWORK_LIB
--DQT_CORE_LIB
--DLIBVNCSERVER_HAVE_LIBZ
--DLIBVNCSERVER_HAVE_LIBJPEG
--DLIBVNCSERVER_HAVE_LIBPNG
--o
-/tmp/foo/lib/include/moc_VncView.cxx
-/tmp/foo/lib/include/VncView.h
diff --git a/lib/include/rfb/dh.h b/lib/include/rfb/dh.h
deleted file mode 100644
index ed82e51..0000000
--- a/lib/include/rfb/dh.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// CRYPTO LIBRARY FOR EXCHANGING KEYS
-// USING THE DIFFIE-HELLMAN KEY EXCHANGE PROTOCOL
-
-// The diffie-hellman can be used to securely exchange keys
-// between parties, where a third party eavesdropper given
-// the values being transmitted cannot determine the key.
-
-// Implemented by Lee Griffiths, Jan 2004.
-// This software is freeware, you may use it to your discretion,
-// however by doing so you take full responsibility for any damage
-// it may cause.
-
-// Hope you find it useful, even if you just use some of the functions
-// out of it like the prime number generator and the XtoYmodN function.
-
-// It would be great if you could send me emails to: lee.griffiths at first4internet.co.uk
-// with any suggestions, comments, or questions!
-
-// Enjoy.
-
-// Adopted to ms-logon for ultravnc by marscha, 2006.
-
-#ifndef __RFB_DH_H__
-#define __RFB_DH_H__
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-#include <stdint.h>
-
-#define DH_MAX_BITS 31
-#define DH_RANGE 100
-
-#define DH_CLEAN_ALL_MEMORY				1
-#define DH_CLEAN_ALL_MEMORY_EXCEPT_KEY		2
-
-#define DH_MOD	1
-#define DH_GEN	2
-#define DH_PRIV	3
-#define DH_PUB	4
-#define DH_KEY	5
-
-#ifdef ULTRAVNC_ITALC_SUPPORT
-#define DH DiffieHellman
-#endif
-
-class DiffieHellman
-{
-public:
-	DiffieHellman();
-	DiffieHellman(uint64_t generator, uint64_t modulus);
-	~DiffieHellman();
-
-	void createKeys();
-	uint64_t createInterKey();
-	uint64_t createEncryptionKey(uint64_t interKey);
-	
-	uint64_t getValue(int flags = DH_KEY);
-
-private:
-	uint64_t XpowYmodN(uint64_t x, uint64_t y, uint64_t N);
-	uint64_t generatePrime();
-	uint64_t tryToGeneratePrime(uint64_t start);
-	bool millerRabin (uint64_t n, unsigned int trials);
-	void cleanMem(int flags=DH_CLEAN_ALL_MEMORY);
-
-
-	uint64_t gen;
-	uint64_t mod;
-	uint64_t priv;
-	uint64_t pub;
-	uint64_t key;
-	uint64_t maxNum;
-
-};
-
-int bits(int64_t number);
-bool int64ToBytes(const uint64_t integer, char* const bytes);
-uint64_t bytesToInt64(const char* const bytes);
-
-#endif // __RFB_DH_H__
diff --git a/lib/include/rfb/keysym.h b/lib/include/rfb/keysym.h
deleted file mode 100644
index 219f95b..0000000
--- a/lib/include/rfb/keysym.h
+++ /dev/null
@@ -1,1638 +0,0 @@
-#ifndef XK_0
-
-/* $XConsortium: keysym.h,v 1.15 94/04/17 20:10:55 rws Exp $ */
-
-/***********************************************************
-
-Copyright (c) 1987  X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* default keysyms */
-#define XK_MISCELLANY
-#define XK_XKB_KEYS
-#define XK_LATIN1
-#define XK_LATIN2
-#define XK_LATIN3
-#define XK_LATIN4
-#define XK_GREEK
-
-/* $TOG: keysymdef.h /main/25 1997/06/21 10:54:51 kaleb $ */
-
-/***********************************************************
-Copyright (c) 1987, 1994  X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#define XK_VoidSymbol		0xFFFFFF	/* void symbol */
-
-#ifdef XK_MISCELLANY
-/*
- * TTY Functions, cleverly chosen to map to ascii, for convenience of
- * programming, but could have been arbitrary (at the cost of lookup
- * tables in client code.
- */
-
-#define XK_BackSpace		0xFF08	/* back space, back char */
-#define XK_Tab			0xFF09
-#define XK_Linefeed		0xFF0A	/* Linefeed, LF */
-#define XK_Clear		0xFF0B
-#define XK_Return		0xFF0D	/* Return, enter */
-#define XK_Pause		0xFF13	/* Pause, hold */
-#define XK_Scroll_Lock		0xFF14
-#define XK_Sys_Req		0xFF15
-#define XK_Escape		0xFF1B
-#define XK_Delete		0xFFFF	/* Delete, rubout */
-
-
-
-/* International & multi-key character composition */
-
-#define XK_Multi_key		0xFF20  /* Multi-key character compose */
-#define XK_SingleCandidate	0xFF3C
-#define XK_MultipleCandidate	0xFF3D
-#define XK_PreviousCandidate	0xFF3E
-
-/* Japanese keyboard support */
-
-#define XK_Kanji		0xFF21	/* Kanji, Kanji convert */
-#define XK_Muhenkan		0xFF22  /* Cancel Conversion */
-#define XK_Henkan_Mode		0xFF23  /* Start/Stop Conversion */
-#define XK_Henkan		0xFF23  /* Alias for Henkan_Mode */
-#define XK_Romaji		0xFF24  /* to Romaji */
-#define XK_Hiragana		0xFF25  /* to Hiragana */
-#define XK_Katakana		0xFF26  /* to Katakana */
-#define XK_Hiragana_Katakana	0xFF27  /* Hiragana/Katakana toggle */
-#define XK_Zenkaku		0xFF28  /* to Zenkaku */
-#define XK_Hankaku		0xFF29  /* to Hankaku */
-#define XK_Zenkaku_Hankaku	0xFF2A  /* Zenkaku/Hankaku toggle */
-#define XK_Touroku		0xFF2B  /* Add to Dictionary */
-#define XK_Massyo		0xFF2C  /* Delete from Dictionary */
-#define XK_Kana_Lock		0xFF2D  /* Kana Lock */
-#define XK_Kana_Shift		0xFF2E  /* Kana Shift */
-#define XK_Eisu_Shift		0xFF2F  /* Alphanumeric Shift */
-#define XK_Eisu_toggle		0xFF30  /* Alphanumeric toggle */
-#define XK_Zen_Koho		0xFF3D	/* Multiple/All Candidate(s) */
-#define XK_Mae_Koho		0xFF3E	/* Previous Candidate */
-
-/* 0xFF31 thru 0xFF3F are under XK_KOREAN */
-
-/* Cursor control & motion */
-
-#define XK_Home			0xFF50
-#define XK_Left			0xFF51	/* Move left, left arrow */
-#define XK_Up			0xFF52	/* Move up, up arrow */
-#define XK_Right		0xFF53	/* Move right, right arrow */
-#define XK_Down			0xFF54	/* Move down, down arrow */
-#define XK_Prior		0xFF55	/* Prior, previous */
-#define XK_Page_Up		0xFF55
-#define XK_Next			0xFF56	/* Next */
-#define XK_Page_Down		0xFF56
-#define XK_End			0xFF57	/* EOL */
-#define XK_Begin		0xFF58	/* BOL */
-
-
-/* Misc Functions */
-
-#define XK_Select		0xFF60	/* Select, mark */
-#define XK_Print		0xFF61
-#define XK_Execute		0xFF62	/* Execute, run, do */
-#define XK_Insert		0xFF63	/* Insert, insert here */
-#define XK_Undo			0xFF65	/* Undo, oops */
-#define XK_Redo			0xFF66	/* redo, again */
-#define XK_Menu			0xFF67
-#define XK_Find			0xFF68	/* Find, search */
-#define XK_Cancel		0xFF69	/* Cancel, stop, abort, exit */
-#define XK_Help			0xFF6A	/* Help */
-#define XK_Break		0xFF6B
-#define XK_Mode_switch		0xFF7E	/* Character set switch */
-#define XK_script_switch        0xFF7E  /* Alias for mode_switch */
-#define XK_Num_Lock		0xFF7F
-
-/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */
-
-#define XK_KP_Space		0xFF80	/* space */
-#define XK_KP_Tab		0xFF89
-#define XK_KP_Enter		0xFF8D	/* enter */
-#define XK_KP_F1		0xFF91	/* PF1, KP_A, ... */
-#define XK_KP_F2		0xFF92
-#define XK_KP_F3		0xFF93
-#define XK_KP_F4		0xFF94
-#define XK_KP_Home		0xFF95
-#define XK_KP_Left		0xFF96
-#define XK_KP_Up		0xFF97
-#define XK_KP_Right		0xFF98
-#define XK_KP_Down		0xFF99
-#define XK_KP_Prior		0xFF9A
-#define XK_KP_Page_Up		0xFF9A
-#define XK_KP_Next		0xFF9B
-#define XK_KP_Page_Down		0xFF9B
-#define XK_KP_End		0xFF9C
-#define XK_KP_Begin		0xFF9D
-#define XK_KP_Insert		0xFF9E
-#define XK_KP_Delete		0xFF9F
-#define XK_KP_Equal		0xFFBD	/* equals */
-#define XK_KP_Multiply		0xFFAA
-#define XK_KP_Add		0xFFAB
-#define XK_KP_Separator		0xFFAC	/* separator, often comma */
-#define XK_KP_Subtract		0xFFAD
-#define XK_KP_Decimal		0xFFAE
-#define XK_KP_Divide		0xFFAF
-
-#define XK_KP_0			0xFFB0
-#define XK_KP_1			0xFFB1
-#define XK_KP_2			0xFFB2
-#define XK_KP_3			0xFFB3
-#define XK_KP_4			0xFFB4
-#define XK_KP_5			0xFFB5
-#define XK_KP_6			0xFFB6
-#define XK_KP_7			0xFFB7
-#define XK_KP_8			0xFFB8
-#define XK_KP_9			0xFFB9
-
-
-
-/*
- * Auxilliary Functions; note the duplicate definitions for left and right
- * function keys;  Sun keyboards and a few other manufactures have such
- * function key groups on the left and/or right sides of the keyboard.
- * We've not found a keyboard with more than 35 function keys total.
- */
-
-#define XK_F1			0xFFBE
-#define XK_F2			0xFFBF
-#define XK_F3			0xFFC0
-#define XK_F4			0xFFC1
-#define XK_F5			0xFFC2
-#define XK_F6			0xFFC3
-#define XK_F7			0xFFC4
-#define XK_F8			0xFFC5
-#define XK_F9			0xFFC6
-#define XK_F10			0xFFC7
-#define XK_F11			0xFFC8
-#define XK_L1			0xFFC8
-#define XK_F12			0xFFC9
-#define XK_L2			0xFFC9
-#define XK_F13			0xFFCA
-#define XK_L3			0xFFCA
-#define XK_F14			0xFFCB
-#define XK_L4			0xFFCB
-#define XK_F15			0xFFCC
-#define XK_L5			0xFFCC
-#define XK_F16			0xFFCD
-#define XK_L6			0xFFCD
-#define XK_F17			0xFFCE
-#define XK_L7			0xFFCE
-#define XK_F18			0xFFCF
-#define XK_L8			0xFFCF
-#define XK_F19			0xFFD0
-#define XK_L9			0xFFD0
-#define XK_F20			0xFFD1
-#define XK_L10			0xFFD1
-#define XK_F21			0xFFD2
-#define XK_R1			0xFFD2
-#define XK_F22			0xFFD3
-#define XK_R2			0xFFD3
-#define XK_F23			0xFFD4
-#define XK_R3			0xFFD4
-#define XK_F24			0xFFD5
-#define XK_R4			0xFFD5
-#define XK_F25			0xFFD6
-#define XK_R5			0xFFD6
-#define XK_F26			0xFFD7
-#define XK_R6			0xFFD7
-#define XK_F27			0xFFD8
-#define XK_R7			0xFFD8
-#define XK_F28			0xFFD9
-#define XK_R8			0xFFD9
-#define XK_F29			0xFFDA
-#define XK_R9			0xFFDA
-#define XK_F30			0xFFDB
-#define XK_R10			0xFFDB
-#define XK_F31			0xFFDC
-#define XK_R11			0xFFDC
-#define XK_F32			0xFFDD
-#define XK_R12			0xFFDD
-#define XK_F33			0xFFDE
-#define XK_R13			0xFFDE
-#define XK_F34			0xFFDF
-#define XK_R14			0xFFDF
-#define XK_F35			0xFFE0
-#define XK_R15			0xFFE0
-
-/* Modifiers */
-
-#define XK_Shift_L		0xFFE1	/* Left shift */
-#define XK_Shift_R		0xFFE2	/* Right shift */
-#define XK_Control_L		0xFFE3	/* Left control */
-#define XK_Control_R		0xFFE4	/* Right control */
-#define XK_Caps_Lock		0xFFE5	/* Caps lock */
-#define XK_Shift_Lock		0xFFE6	/* Shift lock */
-
-#define XK_Meta_L		0xFFE7	/* Left meta */
-#define XK_Meta_R		0xFFE8	/* Right meta */
-#define XK_Alt_L		0xFFE9	/* Left alt */
-#define XK_Alt_R		0xFFEA	/* Right alt */
-#define XK_Super_L		0xFFEB	/* Left super */
-#define XK_Super_R		0xFFEC	/* Right super */
-#define XK_Hyper_L		0xFFED	/* Left hyper */
-#define XK_Hyper_R		0xFFEE	/* Right hyper */
-#endif /* XK_MISCELLANY */
-
-/*
- * ISO 9995 Function and Modifier Keys
- * Byte 3 = 0xFE
- */
-
-#ifdef XK_XKB_KEYS
-#define	XK_ISO_Lock					0xFE01
-#define	XK_ISO_Level2_Latch				0xFE02
-#define	XK_ISO_Level3_Shift				0xFE03
-#define	XK_ISO_Level3_Latch				0xFE04
-#define	XK_ISO_Level3_Lock				0xFE05
-#define	XK_ISO_Group_Shift		0xFF7E	/* Alias for mode_switch */
-#define	XK_ISO_Group_Latch				0xFE06
-#define	XK_ISO_Group_Lock				0xFE07
-#define	XK_ISO_Next_Group				0xFE08
-#define	XK_ISO_Next_Group_Lock				0xFE09
-#define	XK_ISO_Prev_Group				0xFE0A
-#define	XK_ISO_Prev_Group_Lock				0xFE0B
-#define	XK_ISO_First_Group				0xFE0C
-#define	XK_ISO_First_Group_Lock				0xFE0D
-#define	XK_ISO_Last_Group				0xFE0E
-#define	XK_ISO_Last_Group_Lock				0xFE0F
-
-#define	XK_ISO_Left_Tab					0xFE20
-#define	XK_ISO_Move_Line_Up				0xFE21
-#define	XK_ISO_Move_Line_Down				0xFE22
-#define	XK_ISO_Partial_Line_Up				0xFE23
-#define	XK_ISO_Partial_Line_Down			0xFE24
-#define	XK_ISO_Partial_Space_Left			0xFE25
-#define	XK_ISO_Partial_Space_Right			0xFE26
-#define	XK_ISO_Set_Margin_Left				0xFE27
-#define	XK_ISO_Set_Margin_Right				0xFE28
-#define	XK_ISO_Release_Margin_Left			0xFE29
-#define	XK_ISO_Release_Margin_Right			0xFE2A
-#define	XK_ISO_Release_Both_Margins			0xFE2B
-#define	XK_ISO_Fast_Cursor_Left				0xFE2C
-#define	XK_ISO_Fast_Cursor_Right			0xFE2D
-#define	XK_ISO_Fast_Cursor_Up				0xFE2E
-#define	XK_ISO_Fast_Cursor_Down				0xFE2F
-#define	XK_ISO_Continuous_Underline			0xFE30
-#define	XK_ISO_Discontinuous_Underline			0xFE31
-#define	XK_ISO_Emphasize				0xFE32
-#define	XK_ISO_Center_Object				0xFE33
-#define	XK_ISO_Enter					0xFE34
-
-#define	XK_dead_grave					0xFE50
-#define	XK_dead_acute					0xFE51
-#define	XK_dead_circumflex				0xFE52
-#define	XK_dead_tilde					0xFE53
-#define	XK_dead_macron					0xFE54
-#define	XK_dead_breve					0xFE55
-#define	XK_dead_abovedot				0xFE56
-#define	XK_dead_diaeresis				0xFE57
-#define	XK_dead_abovering				0xFE58
-#define	XK_dead_doubleacute				0xFE59
-#define	XK_dead_caron					0xFE5A
-#define	XK_dead_cedilla					0xFE5B
-#define	XK_dead_ogonek					0xFE5C
-#define	XK_dead_iota					0xFE5D
-#define	XK_dead_voiced_sound				0xFE5E
-#define	XK_dead_semivoiced_sound			0xFE5F
-#define	XK_dead_belowdot				0xFE60
-
-#define	XK_First_Virtual_Screen				0xFED0
-#define	XK_Prev_Virtual_Screen				0xFED1
-#define	XK_Next_Virtual_Screen				0xFED2
-#define	XK_Last_Virtual_Screen				0xFED4
-#define	XK_Terminate_Server				0xFED5
-
-#define	XK_AccessX_Enable				0xFE70
-#define	XK_AccessX_Feedback_Enable			0xFE71
-#define	XK_RepeatKeys_Enable				0xFE72
-#define	XK_SlowKeys_Enable				0xFE73
-#define	XK_BounceKeys_Enable				0xFE74
-#define	XK_StickyKeys_Enable				0xFE75
-#define	XK_MouseKeys_Enable				0xFE76
-#define	XK_MouseKeys_Accel_Enable			0xFE77
-#define	XK_Overlay1_Enable				0xFE78
-#define	XK_Overlay2_Enable				0xFE79
-#define	XK_AudibleBell_Enable				0xFE7A
-
-#define	XK_Pointer_Left					0xFEE0
-#define	XK_Pointer_Right				0xFEE1
-#define	XK_Pointer_Up					0xFEE2
-#define	XK_Pointer_Down					0xFEE3
-#define	XK_Pointer_UpLeft				0xFEE4
-#define	XK_Pointer_UpRight				0xFEE5
-#define	XK_Pointer_DownLeft				0xFEE6
-#define	XK_Pointer_DownRight				0xFEE7
-#define	XK_Pointer_Button_Dflt				0xFEE8
-#define	XK_Pointer_Button1				0xFEE9
-#define	XK_Pointer_Button2				0xFEEA
-#define	XK_Pointer_Button3				0xFEEB
-#define	XK_Pointer_Button4				0xFEEC
-#define	XK_Pointer_Button5				0xFEED
-#define	XK_Pointer_DblClick_Dflt			0xFEEE
-#define	XK_Pointer_DblClick1				0xFEEF
-#define	XK_Pointer_DblClick2				0xFEF0
-#define	XK_Pointer_DblClick3				0xFEF1
-#define	XK_Pointer_DblClick4				0xFEF2
-#define	XK_Pointer_DblClick5				0xFEF3
-#define	XK_Pointer_Drag_Dflt				0xFEF4
-#define	XK_Pointer_Drag1				0xFEF5
-#define	XK_Pointer_Drag2				0xFEF6
-#define	XK_Pointer_Drag3				0xFEF7
-#define	XK_Pointer_Drag4				0xFEF8
-#define	XK_Pointer_Drag5				0xFEFD
-
-#define	XK_Pointer_EnableKeys				0xFEF9
-#define	XK_Pointer_Accelerate				0xFEFA
-#define	XK_Pointer_DfltBtnNext				0xFEFB
-#define	XK_Pointer_DfltBtnPrev				0xFEFC
-
-#endif
-
-/*
- * 3270 Terminal Keys
- * Byte 3 = 0xFD
- */
-
-#ifdef XK_3270
-#define XK_3270_Duplicate      0xFD01
-#define XK_3270_FieldMark      0xFD02
-#define XK_3270_Right2         0xFD03
-#define XK_3270_Left2          0xFD04
-#define XK_3270_BackTab        0xFD05
-#define XK_3270_EraseEOF       0xFD06
-#define XK_3270_EraseInput     0xFD07
-#define XK_3270_Reset          0xFD08
-#define XK_3270_Quit           0xFD09
-#define XK_3270_PA1            0xFD0A
-#define XK_3270_PA2            0xFD0B
-#define XK_3270_PA3            0xFD0C
-#define XK_3270_Test           0xFD0D
-#define XK_3270_Attn           0xFD0E
-#define XK_3270_CursorBlink    0xFD0F
-#define XK_3270_AltCursor      0xFD10
-#define XK_3270_KeyClick       0xFD11
-#define XK_3270_Jump           0xFD12
-#define XK_3270_Ident          0xFD13
-#define XK_3270_Rule           0xFD14
-#define XK_3270_Copy           0xFD15
-#define XK_3270_Play           0xFD16
-#define XK_3270_Setup          0xFD17
-#define XK_3270_Record         0xFD18
-#define XK_3270_ChangeScreen   0xFD19
-#define XK_3270_DeleteWord     0xFD1A
-#define XK_3270_ExSelect       0xFD1B
-#define XK_3270_CursorSelect   0xFD1C
-#define XK_3270_PrintScreen    0xFD1D
-#define XK_3270_Enter          0xFD1E
-#endif
-
-/*
- *  Latin 1
- *  Byte 3 = 0
- */
-#ifdef XK_LATIN1
-#define XK_space               0x020
-#define XK_exclam              0x021
-#define XK_quotedbl            0x022
-#define XK_numbersign          0x023
-#define XK_dollar              0x024
-#define XK_percent             0x025
-#define XK_ampersand           0x026
-#define XK_apostrophe          0x027
-#define XK_quoteright          0x027	/* deprecated */
-#define XK_parenleft           0x028
-#define XK_parenright          0x029
-#define XK_asterisk            0x02a
-#define XK_plus                0x02b
-#define XK_comma               0x02c
-#define XK_minus               0x02d
-#define XK_period              0x02e
-#define XK_slash               0x02f
-#define XK_0                   0x030
-#define XK_1                   0x031
-#define XK_2                   0x032
-#define XK_3                   0x033
-#define XK_4                   0x034
-#define XK_5                   0x035
-#define XK_6                   0x036
-#define XK_7                   0x037
-#define XK_8                   0x038
-#define XK_9                   0x039
-#define XK_colon               0x03a
-#define XK_semicolon           0x03b
-#define XK_less                0x03c
-#define XK_equal               0x03d
-#define XK_greater             0x03e
-#define XK_question            0x03f
-#define XK_at                  0x040
-#define XK_A                   0x041
-#define XK_B                   0x042
-#define XK_C                   0x043
-#define XK_D                   0x044
-#define XK_E                   0x045
-#define XK_F                   0x046
-#define XK_G                   0x047
-#define XK_H                   0x048
-#define XK_I                   0x049
-#define XK_J                   0x04a
-#define XK_K                   0x04b
-#define XK_L                   0x04c
-#define XK_M                   0x04d
-#define XK_N                   0x04e
-#define XK_O                   0x04f
-#define XK_P                   0x050
-#define XK_Q                   0x051
-#define XK_R                   0x052
-#define XK_S                   0x053
-#define XK_T                   0x054
-#define XK_U                   0x055
-#define XK_V                   0x056
-#define XK_W                   0x057
-#define XK_X                   0x058
-#define XK_Y                   0x059
-#define XK_Z                   0x05a
-#define XK_bracketleft         0x05b
-#define XK_backslash           0x05c
-#define XK_bracketright        0x05d
-#define XK_asciicircum         0x05e
-#define XK_underscore          0x05f
-#define XK_grave               0x060
-#define XK_quoteleft           0x060	/* deprecated */
-#define XK_a                   0x061
-#define XK_b                   0x062
-#define XK_c                   0x063
-#define XK_d                   0x064
-#define XK_e                   0x065
-#define XK_f                   0x066
-#define XK_g                   0x067
-#define XK_h                   0x068
-#define XK_i                   0x069
-#define XK_j                   0x06a
-#define XK_k                   0x06b
-#define XK_l                   0x06c
-#define XK_m                   0x06d
-#define XK_n                   0x06e
-#define XK_o                   0x06f
-#define XK_p                   0x070
-#define XK_q                   0x071
-#define XK_r                   0x072
-#define XK_s                   0x073
-#define XK_t                   0x074
-#define XK_u                   0x075
-#define XK_v                   0x076
-#define XK_w                   0x077
-#define XK_x                   0x078
-#define XK_y                   0x079
-#define XK_z                   0x07a
-#define XK_braceleft           0x07b
-#define XK_bar                 0x07c
-#define XK_braceright          0x07d
-#define XK_asciitilde          0x07e
-
-#define XK_nobreakspace        0x0a0
-#define XK_exclamdown          0x0a1
-#define XK_cent        	       0x0a2
-#define XK_sterling            0x0a3
-#define XK_currency            0x0a4
-#define XK_yen                 0x0a5
-#define XK_brokenbar           0x0a6
-#define XK_section             0x0a7
-#define XK_diaeresis           0x0a8
-#define XK_copyright           0x0a9
-#define XK_ordfeminine         0x0aa
-#define XK_guillemotleft       0x0ab	/* left angle quotation mark */
-#define XK_notsign             0x0ac
-#define XK_hyphen              0x0ad
-#define XK_registered          0x0ae
-#define XK_macron              0x0af
-#define XK_degree              0x0b0
-#define XK_plusminus           0x0b1
-#define XK_twosuperior         0x0b2
-#define XK_threesuperior       0x0b3
-#define XK_acute               0x0b4
-#define XK_mu                  0x0b5
-#define XK_paragraph           0x0b6
-#define XK_periodcentered      0x0b7
-#define XK_cedilla             0x0b8
-#define XK_onesuperior         0x0b9
-#define XK_masculine           0x0ba
-#define XK_guillemotright      0x0bb	/* right angle quotation mark */
-#define XK_onequarter          0x0bc
-#define XK_onehalf             0x0bd
-#define XK_threequarters       0x0be
-#define XK_questiondown        0x0bf
-#define XK_Agrave              0x0c0
-#define XK_Aacute              0x0c1
-#define XK_Acircumflex         0x0c2
-#define XK_Atilde              0x0c3
-#define XK_Adiaeresis          0x0c4
-#define XK_Aring               0x0c5
-#define XK_AE                  0x0c6
-#define XK_Ccedilla            0x0c7
-#define XK_Egrave              0x0c8
-#define XK_Eacute              0x0c9
-#define XK_Ecircumflex         0x0ca
-#define XK_Ediaeresis          0x0cb
-#define XK_Igrave              0x0cc
-#define XK_Iacute              0x0cd
-#define XK_Icircumflex         0x0ce
-#define XK_Idiaeresis          0x0cf
-#define XK_ETH                 0x0d0
-#define XK_Eth                 0x0d0	/* deprecated */
-#define XK_Ntilde              0x0d1
-#define XK_Ograve              0x0d2
-#define XK_Oacute              0x0d3
-#define XK_Ocircumflex         0x0d4
-#define XK_Otilde              0x0d5
-#define XK_Odiaeresis          0x0d6
-#define XK_multiply            0x0d7
-#define XK_Ooblique            0x0d8
-#define XK_Ugrave              0x0d9
-#define XK_Uacute              0x0da
-#define XK_Ucircumflex         0x0db
-#define XK_Udiaeresis          0x0dc
-#define XK_Yacute              0x0dd
-#define XK_THORN               0x0de
-#define XK_Thorn               0x0de	/* deprecated */
-#define XK_ssharp              0x0df
-#define XK_agrave              0x0e0
-#define XK_aacute              0x0e1
-#define XK_acircumflex         0x0e2
-#define XK_atilde              0x0e3
-#define XK_adiaeresis          0x0e4
-#define XK_aring               0x0e5
-#define XK_ae                  0x0e6
-#define XK_ccedilla            0x0e7
-#define XK_egrave              0x0e8
-#define XK_eacute              0x0e9
-#define XK_ecircumflex         0x0ea
-#define XK_ediaeresis          0x0eb
-#define XK_igrave              0x0ec
-#define XK_iacute              0x0ed
-#define XK_icircumflex         0x0ee
-#define XK_idiaeresis          0x0ef
-#define XK_eth                 0x0f0
-#define XK_ntilde              0x0f1
-#define XK_ograve              0x0f2
-#define XK_oacute              0x0f3
-#define XK_ocircumflex         0x0f4
-#define XK_otilde              0x0f5
-#define XK_odiaeresis          0x0f6
-#define XK_division            0x0f7
-#define XK_oslash              0x0f8
-#define XK_ugrave              0x0f9
-#define XK_uacute              0x0fa
-#define XK_ucircumflex         0x0fb
-#define XK_udiaeresis          0x0fc
-#define XK_yacute              0x0fd
-#define XK_thorn               0x0fe
-#define XK_ydiaeresis          0x0ff
-#endif /* XK_LATIN1 */
-
-/*
- *   Latin 2
- *   Byte 3 = 1
- */
-
-#ifdef XK_LATIN2
-#define XK_Aogonek             0x1a1
-#define XK_breve               0x1a2
-#define XK_Lstroke             0x1a3
-#define XK_Lcaron              0x1a5
-#define XK_Sacute              0x1a6
-#define XK_Scaron              0x1a9
-#define XK_Scedilla            0x1aa
-#define XK_Tcaron              0x1ab
-#define XK_Zacute              0x1ac
-#define XK_Zcaron              0x1ae
-#define XK_Zabovedot           0x1af
-#define XK_aogonek             0x1b1
-#define XK_ogonek              0x1b2
-#define XK_lstroke             0x1b3
-#define XK_lcaron              0x1b5
-#define XK_sacute              0x1b6
-#define XK_caron               0x1b7
-#define XK_scaron              0x1b9
-#define XK_scedilla            0x1ba
-#define XK_tcaron              0x1bb
-#define XK_zacute              0x1bc
-#define XK_doubleacute         0x1bd
-#define XK_zcaron              0x1be
-#define XK_zabovedot           0x1bf
-#define XK_Racute              0x1c0
-#define XK_Abreve              0x1c3
-#define XK_Lacute              0x1c5
-#define XK_Cacute              0x1c6
-#define XK_Ccaron              0x1c8
-#define XK_Eogonek             0x1ca
-#define XK_Ecaron              0x1cc
-#define XK_Dcaron              0x1cf
-#define XK_Dstroke             0x1d0
-#define XK_Nacute              0x1d1
-#define XK_Ncaron              0x1d2
-#define XK_Odoubleacute        0x1d5
-#define XK_Rcaron              0x1d8
-#define XK_Uring               0x1d9
-#define XK_Udoubleacute        0x1db
-#define XK_Tcedilla            0x1de
-#define XK_racute              0x1e0
-#define XK_abreve              0x1e3
-#define XK_lacute              0x1e5
-#define XK_cacute              0x1e6
-#define XK_ccaron              0x1e8
-#define XK_eogonek             0x1ea
-#define XK_ecaron              0x1ec
-#define XK_dcaron              0x1ef
-#define XK_dstroke             0x1f0
-#define XK_nacute              0x1f1
-#define XK_ncaron              0x1f2
-#define XK_odoubleacute        0x1f5
-#define XK_udoubleacute        0x1fb
-#define XK_rcaron              0x1f8
-#define XK_uring               0x1f9
-#define XK_tcedilla            0x1fe
-#define XK_abovedot            0x1ff
-#endif /* XK_LATIN2 */
-
-/*
- *   Latin 3
- *   Byte 3 = 2
- */
-
-#ifdef XK_LATIN3
-#define XK_Hstroke             0x2a1
-#define XK_Hcircumflex         0x2a6
-#define XK_Iabovedot           0x2a9
-#define XK_Gbreve              0x2ab
-#define XK_Jcircumflex         0x2ac
-#define XK_hstroke             0x2b1
-#define XK_hcircumflex         0x2b6
-#define XK_idotless            0x2b9
-#define XK_gbreve              0x2bb
-#define XK_jcircumflex         0x2bc
-#define XK_Cabovedot           0x2c5
-#define XK_Ccircumflex         0x2c6
-#define XK_Gabovedot           0x2d5
-#define XK_Gcircumflex         0x2d8
-#define XK_Ubreve              0x2dd
-#define XK_Scircumflex         0x2de
-#define XK_cabovedot           0x2e5
-#define XK_ccircumflex         0x2e6
-#define XK_gabovedot           0x2f5
-#define XK_gcircumflex         0x2f8
-#define XK_ubreve              0x2fd
-#define XK_scircumflex         0x2fe
-#endif /* XK_LATIN3 */
-
-
-/*
- *   Latin 4
- *   Byte 3 = 3
- */
-
-#ifdef XK_LATIN4
-#define XK_kra                 0x3a2
-#define XK_kappa               0x3a2	/* deprecated */
-#define XK_Rcedilla            0x3a3
-#define XK_Itilde              0x3a5
-#define XK_Lcedilla            0x3a6
-#define XK_Emacron             0x3aa
-#define XK_Gcedilla            0x3ab
-#define XK_Tslash              0x3ac
-#define XK_rcedilla            0x3b3
-#define XK_itilde              0x3b5
-#define XK_lcedilla            0x3b6
-#define XK_emacron             0x3ba
-#define XK_gcedilla            0x3bb
-#define XK_tslash              0x3bc
-#define XK_ENG                 0x3bd
-#define XK_eng                 0x3bf
-#define XK_Amacron             0x3c0
-#define XK_Iogonek             0x3c7
-#define XK_Eabovedot           0x3cc
-#define XK_Imacron             0x3cf
-#define XK_Ncedilla            0x3d1
-#define XK_Omacron             0x3d2
-#define XK_Kcedilla            0x3d3
-#define XK_Uogonek             0x3d9
-#define XK_Utilde              0x3dd
-#define XK_Umacron             0x3de
-#define XK_amacron             0x3e0
-#define XK_iogonek             0x3e7
-#define XK_eabovedot           0x3ec
-#define XK_imacron             0x3ef
-#define XK_ncedilla            0x3f1
-#define XK_omacron             0x3f2
-#define XK_kcedilla            0x3f3
-#define XK_uogonek             0x3f9
-#define XK_utilde              0x3fd
-#define XK_umacron             0x3fe
-#endif /* XK_LATIN4 */
-
-/*
- * Katakana
- * Byte 3 = 4
- */
-
-#ifdef XK_KATAKANA
-#define XK_overline				       0x47e
-#define XK_kana_fullstop                               0x4a1
-#define XK_kana_openingbracket                         0x4a2
-#define XK_kana_closingbracket                         0x4a3
-#define XK_kana_comma                                  0x4a4
-#define XK_kana_conjunctive                            0x4a5
-#define XK_kana_middledot                              0x4a5  /* deprecated */
-#define XK_kana_WO                                     0x4a6
-#define XK_kana_a                                      0x4a7
-#define XK_kana_i                                      0x4a8
-#define XK_kana_u                                      0x4a9
-#define XK_kana_e                                      0x4aa
-#define XK_kana_o                                      0x4ab
-#define XK_kana_ya                                     0x4ac
-#define XK_kana_yu                                     0x4ad
-#define XK_kana_yo                                     0x4ae
-#define XK_kana_tsu                                    0x4af
-#define XK_kana_tu                                     0x4af  /* deprecated */
-#define XK_prolongedsound                              0x4b0
-#define XK_kana_A                                      0x4b1
-#define XK_kana_I                                      0x4b2
-#define XK_kana_U                                      0x4b3
-#define XK_kana_E                                      0x4b4
-#define XK_kana_O                                      0x4b5
-#define XK_kana_KA                                     0x4b6
-#define XK_kana_KI                                     0x4b7
-#define XK_kana_KU                                     0x4b8
-#define XK_kana_KE                                     0x4b9
-#define XK_kana_KO                                     0x4ba
-#define XK_kana_SA                                     0x4bb
-#define XK_kana_SHI                                    0x4bc
-#define XK_kana_SU                                     0x4bd
-#define XK_kana_SE                                     0x4be
-#define XK_kana_SO                                     0x4bf
-#define XK_kana_TA                                     0x4c0
-#define XK_kana_CHI                                    0x4c1
-#define XK_kana_TI                                     0x4c1  /* deprecated */
-#define XK_kana_TSU                                    0x4c2
-#define XK_kana_TU                                     0x4c2  /* deprecated */
-#define XK_kana_TE                                     0x4c3
-#define XK_kana_TO                                     0x4c4
-#define XK_kana_NA                                     0x4c5
-#define XK_kana_NI                                     0x4c6
-#define XK_kana_NU                                     0x4c7
-#define XK_kana_NE                                     0x4c8
-#define XK_kana_NO                                     0x4c9
-#define XK_kana_HA                                     0x4ca
-#define XK_kana_HI                                     0x4cb
-#define XK_kana_FU                                     0x4cc
-#define XK_kana_HU                                     0x4cc  /* deprecated */
-#define XK_kana_HE                                     0x4cd
-#define XK_kana_HO                                     0x4ce
-#define XK_kana_MA                                     0x4cf
-#define XK_kana_MI                                     0x4d0
-#define XK_kana_MU                                     0x4d1
-#define XK_kana_ME                                     0x4d2
-#define XK_kana_MO                                     0x4d3
-#define XK_kana_YA                                     0x4d4
-#define XK_kana_YU                                     0x4d5
-#define XK_kana_YO                                     0x4d6
-#define XK_kana_RA                                     0x4d7
-#define XK_kana_RI                                     0x4d8
-#define XK_kana_RU                                     0x4d9
-#define XK_kana_RE                                     0x4da
-#define XK_kana_RO                                     0x4db
-#define XK_kana_WA                                     0x4dc
-#define XK_kana_N                                      0x4dd
-#define XK_voicedsound                                 0x4de
-#define XK_semivoicedsound                             0x4df
-#define XK_kana_switch          0xFF7E  /* Alias for mode_switch */
-#endif /* XK_KATAKANA */
-
-/*
- *  Arabic
- *  Byte 3 = 5
- */
-
-#ifdef XK_ARABIC
-#define XK_Arabic_comma                                0x5ac
-#define XK_Arabic_semicolon                            0x5bb
-#define XK_Arabic_question_mark                        0x5bf
-#define XK_Arabic_hamza                                0x5c1
-#define XK_Arabic_maddaonalef                          0x5c2
-#define XK_Arabic_hamzaonalef                          0x5c3
-#define XK_Arabic_hamzaonwaw                           0x5c4
-#define XK_Arabic_hamzaunderalef                       0x5c5
-#define XK_Arabic_hamzaonyeh                           0x5c6
-#define XK_Arabic_alef                                 0x5c7
-#define XK_Arabic_beh                                  0x5c8
-#define XK_Arabic_tehmarbuta                           0x5c9
-#define XK_Arabic_teh                                  0x5ca
-#define XK_Arabic_theh                                 0x5cb
-#define XK_Arabic_jeem                                 0x5cc
-#define XK_Arabic_hah                                  0x5cd
-#define XK_Arabic_khah                                 0x5ce
-#define XK_Arabic_dal                                  0x5cf
-#define XK_Arabic_thal                                 0x5d0
-#define XK_Arabic_ra                                   0x5d1
-#define XK_Arabic_zain                                 0x5d2
-#define XK_Arabic_seen                                 0x5d3
-#define XK_Arabic_sheen                                0x5d4
-#define XK_Arabic_sad                                  0x5d5
-#define XK_Arabic_dad                                  0x5d6
-#define XK_Arabic_tah                                  0x5d7
-#define XK_Arabic_zah                                  0x5d8
-#define XK_Arabic_ain                                  0x5d9
-#define XK_Arabic_ghain                                0x5da
-#define XK_Arabic_tatweel                              0x5e0
-#define XK_Arabic_feh                                  0x5e1
-#define XK_Arabic_qaf                                  0x5e2
-#define XK_Arabic_kaf                                  0x5e3
-#define XK_Arabic_lam                                  0x5e4
-#define XK_Arabic_meem                                 0x5e5
-#define XK_Arabic_noon                                 0x5e6
-#define XK_Arabic_ha                                   0x5e7
-#define XK_Arabic_heh                                  0x5e7  /* deprecated */
-#define XK_Arabic_waw                                  0x5e8
-#define XK_Arabic_alefmaksura                          0x5e9
-#define XK_Arabic_yeh                                  0x5ea
-#define XK_Arabic_fathatan                             0x5eb
-#define XK_Arabic_dammatan                             0x5ec
-#define XK_Arabic_kasratan                             0x5ed
-#define XK_Arabic_fatha                                0x5ee
-#define XK_Arabic_damma                                0x5ef
-#define XK_Arabic_kasra                                0x5f0
-#define XK_Arabic_shadda                               0x5f1
-#define XK_Arabic_sukun                                0x5f2
-#define XK_Arabic_switch        0xFF7E  /* Alias for mode_switch */
-#endif /* XK_ARABIC */
-
-/*
- * Cyrillic
- * Byte 3 = 6
- */
-#ifdef XK_CYRILLIC
-#define XK_Serbian_dje                                 0x6a1
-#define XK_Macedonia_gje                               0x6a2
-#define XK_Cyrillic_io                                 0x6a3
-#define XK_Ukrainian_ie                                0x6a4
-#define XK_Ukranian_je                                 0x6a4  /* deprecated */
-#define XK_Macedonia_dse                               0x6a5
-#define XK_Ukrainian_i                                 0x6a6
-#define XK_Ukranian_i                                  0x6a6  /* deprecated */
-#define XK_Ukrainian_yi                                0x6a7
-#define XK_Ukranian_yi                                 0x6a7  /* deprecated */
-#define XK_Cyrillic_je                                 0x6a8
-#define XK_Serbian_je                                  0x6a8  /* deprecated */
-#define XK_Cyrillic_lje                                0x6a9
-#define XK_Serbian_lje                                 0x6a9  /* deprecated */
-#define XK_Cyrillic_nje                                0x6aa
-#define XK_Serbian_nje                                 0x6aa  /* deprecated */
-#define XK_Serbian_tshe                                0x6ab
-#define XK_Macedonia_kje                               0x6ac
-#define XK_Byelorussian_shortu                         0x6ae
-#define XK_Cyrillic_dzhe                               0x6af
-#define XK_Serbian_dze                                 0x6af  /* deprecated */
-#define XK_numerosign                                  0x6b0
-#define XK_Serbian_DJE                                 0x6b1
-#define XK_Macedonia_GJE                               0x6b2
-#define XK_Cyrillic_IO                                 0x6b3
-#define XK_Ukrainian_IE                                0x6b4
-#define XK_Ukranian_JE                                 0x6b4  /* deprecated */
-#define XK_Macedonia_DSE                               0x6b5
-#define XK_Ukrainian_I                                 0x6b6
-#define XK_Ukranian_I                                  0x6b6  /* deprecated */
-#define XK_Ukrainian_YI                                0x6b7
-#define XK_Ukranian_YI                                 0x6b7  /* deprecated */
-#define XK_Cyrillic_JE                                 0x6b8
-#define XK_Serbian_JE                                  0x6b8  /* deprecated */
-#define XK_Cyrillic_LJE                                0x6b9
-#define XK_Serbian_LJE                                 0x6b9  /* deprecated */
-#define XK_Cyrillic_NJE                                0x6ba
-#define XK_Serbian_NJE                                 0x6ba  /* deprecated */
-#define XK_Serbian_TSHE                                0x6bb
-#define XK_Macedonia_KJE                               0x6bc
-#define XK_Byelorussian_SHORTU                         0x6be
-#define XK_Cyrillic_DZHE                               0x6bf
-#define XK_Serbian_DZE                                 0x6bf  /* deprecated */
-#define XK_Cyrillic_yu                                 0x6c0
-#define XK_Cyrillic_a                                  0x6c1
-#define XK_Cyrillic_be                                 0x6c2
-#define XK_Cyrillic_tse                                0x6c3
-#define XK_Cyrillic_de                                 0x6c4
-#define XK_Cyrillic_ie                                 0x6c5
-#define XK_Cyrillic_ef                                 0x6c6
-#define XK_Cyrillic_ghe                                0x6c7
-#define XK_Cyrillic_ha                                 0x6c8
-#define XK_Cyrillic_i                                  0x6c9
-#define XK_Cyrillic_shorti                             0x6ca
-#define XK_Cyrillic_ka                                 0x6cb
-#define XK_Cyrillic_el                                 0x6cc
-#define XK_Cyrillic_em                                 0x6cd
-#define XK_Cyrillic_en                                 0x6ce
-#define XK_Cyrillic_o                                  0x6cf
-#define XK_Cyrillic_pe                                 0x6d0
-#define XK_Cyrillic_ya                                 0x6d1
-#define XK_Cyrillic_er                                 0x6d2
-#define XK_Cyrillic_es                                 0x6d3
-#define XK_Cyrillic_te                                 0x6d4
-#define XK_Cyrillic_u                                  0x6d5
-#define XK_Cyrillic_zhe                                0x6d6
-#define XK_Cyrillic_ve                                 0x6d7
-#define XK_Cyrillic_softsign                           0x6d8
-#define XK_Cyrillic_yeru                               0x6d9
-#define XK_Cyrillic_ze                                 0x6da
-#define XK_Cyrillic_sha                                0x6db
-#define XK_Cyrillic_e                                  0x6dc
-#define XK_Cyrillic_shcha                              0x6dd
-#define XK_Cyrillic_che                                0x6de
-#define XK_Cyrillic_hardsign                           0x6df
-#define XK_Cyrillic_YU                                 0x6e0
-#define XK_Cyrillic_A                                  0x6e1
-#define XK_Cyrillic_BE                                 0x6e2
-#define XK_Cyrillic_TSE                                0x6e3
-#define XK_Cyrillic_DE                                 0x6e4
-#define XK_Cyrillic_IE                                 0x6e5
-#define XK_Cyrillic_EF                                 0x6e6
-#define XK_Cyrillic_GHE                                0x6e7
-#define XK_Cyrillic_HA                                 0x6e8
-#define XK_Cyrillic_I                                  0x6e9
-#define XK_Cyrillic_SHORTI                             0x6ea
-#define XK_Cyrillic_KA                                 0x6eb
-#define XK_Cyrillic_EL                                 0x6ec
-#define XK_Cyrillic_EM                                 0x6ed
-#define XK_Cyrillic_EN                                 0x6ee
-#define XK_Cyrillic_O                                  0x6ef
-#define XK_Cyrillic_PE                                 0x6f0
-#define XK_Cyrillic_YA                                 0x6f1
-#define XK_Cyrillic_ER                                 0x6f2
-#define XK_Cyrillic_ES                                 0x6f3
-#define XK_Cyrillic_TE                                 0x6f4
-#define XK_Cyrillic_U                                  0x6f5
-#define XK_Cyrillic_ZHE                                0x6f6
-#define XK_Cyrillic_VE                                 0x6f7
-#define XK_Cyrillic_SOFTSIGN                           0x6f8
-#define XK_Cyrillic_YERU                               0x6f9
-#define XK_Cyrillic_ZE                                 0x6fa
-#define XK_Cyrillic_SHA                                0x6fb
-#define XK_Cyrillic_E                                  0x6fc
-#define XK_Cyrillic_SHCHA                              0x6fd
-#define XK_Cyrillic_CHE                                0x6fe
-#define XK_Cyrillic_HARDSIGN                           0x6ff
-#endif /* XK_CYRILLIC */
-
-/*
- * Greek
- * Byte 3 = 7
- */
-
-#ifdef XK_GREEK
-#define XK_Greek_ALPHAaccent                           0x7a1
-#define XK_Greek_EPSILONaccent                         0x7a2
-#define XK_Greek_ETAaccent                             0x7a3
-#define XK_Greek_IOTAaccent                            0x7a4
-#define XK_Greek_IOTAdieresis                          0x7a5
-#define XK_Greek_OMICRONaccent                         0x7a7
-#define XK_Greek_UPSILONaccent                         0x7a8
-#define XK_Greek_UPSILONdieresis                       0x7a9
-#define XK_Greek_OMEGAaccent                           0x7ab
-#define XK_Greek_accentdieresis                        0x7ae
-#define XK_Greek_horizbar                              0x7af
-#define XK_Greek_alphaaccent                           0x7b1
-#define XK_Greek_epsilonaccent                         0x7b2
-#define XK_Greek_etaaccent                             0x7b3
-#define XK_Greek_iotaaccent                            0x7b4
-#define XK_Greek_iotadieresis                          0x7b5
-#define XK_Greek_iotaaccentdieresis                    0x7b6
-#define XK_Greek_omicronaccent                         0x7b7
-#define XK_Greek_upsilonaccent                         0x7b8
-#define XK_Greek_upsilondieresis                       0x7b9
-#define XK_Greek_upsilonaccentdieresis                 0x7ba
-#define XK_Greek_omegaaccent                           0x7bb
-#define XK_Greek_ALPHA                                 0x7c1
-#define XK_Greek_BETA                                  0x7c2
-#define XK_Greek_GAMMA                                 0x7c3
-#define XK_Greek_DELTA                                 0x7c4
-#define XK_Greek_EPSILON                               0x7c5
-#define XK_Greek_ZETA                                  0x7c6
-#define XK_Greek_ETA                                   0x7c7
-#define XK_Greek_THETA                                 0x7c8
-#define XK_Greek_IOTA                                  0x7c9
-#define XK_Greek_KAPPA                                 0x7ca
-#define XK_Greek_LAMDA                                 0x7cb
-#define XK_Greek_LAMBDA                                0x7cb
-#define XK_Greek_MU                                    0x7cc
-#define XK_Greek_NU                                    0x7cd
-#define XK_Greek_XI                                    0x7ce
-#define XK_Greek_OMICRON                               0x7cf
-#define XK_Greek_PI                                    0x7d0
-#define XK_Greek_RHO                                   0x7d1
-#define XK_Greek_SIGMA                                 0x7d2
-#define XK_Greek_TAU                                   0x7d4
-#define XK_Greek_UPSILON                               0x7d5
-#define XK_Greek_PHI                                   0x7d6
-#define XK_Greek_CHI                                   0x7d7
-#define XK_Greek_PSI                                   0x7d8
-#define XK_Greek_OMEGA                                 0x7d9
-#define XK_Greek_alpha                                 0x7e1
-#define XK_Greek_beta                                  0x7e2
-#define XK_Greek_gamma                                 0x7e3
-#define XK_Greek_delta                                 0x7e4
-#define XK_Greek_epsilon                               0x7e5
-#define XK_Greek_zeta                                  0x7e6
-#define XK_Greek_eta                                   0x7e7
-#define XK_Greek_theta                                 0x7e8
-#define XK_Greek_iota                                  0x7e9
-#define XK_Greek_kappa                                 0x7ea
-#define XK_Greek_lamda                                 0x7eb
-#define XK_Greek_lambda                                0x7eb
-#define XK_Greek_mu                                    0x7ec
-#define XK_Greek_nu                                    0x7ed
-#define XK_Greek_xi                                    0x7ee
-#define XK_Greek_omicron                               0x7ef
-#define XK_Greek_pi                                    0x7f0
-#define XK_Greek_rho                                   0x7f1
-#define XK_Greek_sigma                                 0x7f2
-#define XK_Greek_finalsmallsigma                       0x7f3
-#define XK_Greek_tau                                   0x7f4
-#define XK_Greek_upsilon                               0x7f5
-#define XK_Greek_phi                                   0x7f6
-#define XK_Greek_chi                                   0x7f7
-#define XK_Greek_psi                                   0x7f8
-#define XK_Greek_omega                                 0x7f9
-#define XK_Greek_switch         0xFF7E  /* Alias for mode_switch */
-#endif /* XK_GREEK */
-
-/*
- * Technical
- * Byte 3 = 8
- */
-
-#ifdef XK_TECHNICAL
-#define XK_leftradical                                 0x8a1
-#define XK_topleftradical                              0x8a2
-#define XK_horizconnector                              0x8a3
-#define XK_topintegral                                 0x8a4
-#define XK_botintegral                                 0x8a5
-#define XK_vertconnector                               0x8a6
-#define XK_topleftsqbracket                            0x8a7
-#define XK_botleftsqbracket                            0x8a8
-#define XK_toprightsqbracket                           0x8a9
-#define XK_botrightsqbracket                           0x8aa
-#define XK_topleftparens                               0x8ab
-#define XK_botleftparens                               0x8ac
-#define XK_toprightparens                              0x8ad
-#define XK_botrightparens                              0x8ae
-#define XK_leftmiddlecurlybrace                        0x8af
-#define XK_rightmiddlecurlybrace                       0x8b0
-#define XK_topleftsummation                            0x8b1
-#define XK_botleftsummation                            0x8b2
-#define XK_topvertsummationconnector                   0x8b3
-#define XK_botvertsummationconnector                   0x8b4
-#define XK_toprightsummation                           0x8b5
-#define XK_botrightsummation                           0x8b6
-#define XK_rightmiddlesummation                        0x8b7
-#define XK_lessthanequal                               0x8bc
-#define XK_notequal                                    0x8bd
-#define XK_greaterthanequal                            0x8be
-#define XK_integral                                    0x8bf
-#define XK_therefore                                   0x8c0
-#define XK_variation                                   0x8c1
-#define XK_infinity                                    0x8c2
-#define XK_nabla                                       0x8c5
-#define XK_approximate                                 0x8c8
-#define XK_similarequal                                0x8c9
-#define XK_ifonlyif                                    0x8cd
-#define XK_implies                                     0x8ce
-#define XK_identical                                   0x8cf
-#define XK_radical                                     0x8d6
-#define XK_includedin                                  0x8da
-#define XK_includes                                    0x8db
-#define XK_intersection                                0x8dc
-#define XK_union                                       0x8dd
-#define XK_logicaland                                  0x8de
-#define XK_logicalor                                   0x8df
-#define XK_partialderivative                           0x8ef
-#define XK_function                                    0x8f6
-#define XK_leftarrow                                   0x8fb
-#define XK_uparrow                                     0x8fc
-#define XK_rightarrow                                  0x8fd
-#define XK_downarrow                                   0x8fe
-#endif /* XK_TECHNICAL */
-
-/*
- *  Special
- *  Byte 3 = 9
- */
-
-#ifdef XK_SPECIAL
-#define XK_blank                                       0x9df
-#define XK_soliddiamond                                0x9e0
-#define XK_checkerboard                                0x9e1
-#define XK_ht                                          0x9e2
-#define XK_ff                                          0x9e3
-#define XK_cr                                          0x9e4
-#define XK_lf                                          0x9e5
-#define XK_nl                                          0x9e8
-#define XK_vt                                          0x9e9
-#define XK_lowrightcorner                              0x9ea
-#define XK_uprightcorner                               0x9eb
-#define XK_upleftcorner                                0x9ec
-#define XK_lowleftcorner                               0x9ed
-#define XK_crossinglines                               0x9ee
-#define XK_horizlinescan1                              0x9ef
-#define XK_horizlinescan3                              0x9f0
-#define XK_horizlinescan5                              0x9f1
-#define XK_horizlinescan7                              0x9f2
-#define XK_horizlinescan9                              0x9f3
-#define XK_leftt                                       0x9f4
-#define XK_rightt                                      0x9f5
-#define XK_bott                                        0x9f6
-#define XK_topt                                        0x9f7
-#define XK_vertbar                                     0x9f8
-#endif /* XK_SPECIAL */
-
-/*
- *  Publishing
- *  Byte 3 = a
- */
-
-#ifdef XK_PUBLISHING
-#define XK_emspace                                     0xaa1
-#define XK_enspace                                     0xaa2
-#define XK_em3space                                    0xaa3
-#define XK_em4space                                    0xaa4
-#define XK_digitspace                                  0xaa5
-#define XK_punctspace                                  0xaa6
-#define XK_thinspace                                   0xaa7
-#define XK_hairspace                                   0xaa8
-#define XK_emdash                                      0xaa9
-#define XK_endash                                      0xaaa
-#define XK_signifblank                                 0xaac
-#define XK_ellipsis                                    0xaae
-#define XK_doubbaselinedot                             0xaaf
-#define XK_onethird                                    0xab0
-#define XK_twothirds                                   0xab1
-#define XK_onefifth                                    0xab2
-#define XK_twofifths                                   0xab3
-#define XK_threefifths                                 0xab4
-#define XK_fourfifths                                  0xab5
-#define XK_onesixth                                    0xab6
-#define XK_fivesixths                                  0xab7
-#define XK_careof                                      0xab8
-#define XK_figdash                                     0xabb
-#define XK_leftanglebracket                            0xabc
-#define XK_decimalpoint                                0xabd
-#define XK_rightanglebracket                           0xabe
-#define XK_marker                                      0xabf
-#define XK_oneeighth                                   0xac3
-#define XK_threeeighths                                0xac4
-#define XK_fiveeighths                                 0xac5
-#define XK_seveneighths                                0xac6
-#define XK_trademark                                   0xac9
-#define XK_signaturemark                               0xaca
-#define XK_trademarkincircle                           0xacb
-#define XK_leftopentriangle                            0xacc
-#define XK_rightopentriangle                           0xacd
-#define XK_emopencircle                                0xace
-#define XK_emopenrectangle                             0xacf
-#define XK_leftsinglequotemark                         0xad0
-#define XK_rightsinglequotemark                        0xad1
-#define XK_leftdoublequotemark                         0xad2
-#define XK_rightdoublequotemark                        0xad3
-#define XK_prescription                                0xad4
-#define XK_minutes                                     0xad6
-#define XK_seconds                                     0xad7
-#define XK_latincross                                  0xad9
-#define XK_hexagram                                    0xada
-#define XK_filledrectbullet                            0xadb
-#define XK_filledlefttribullet                         0xadc
-#define XK_filledrighttribullet                        0xadd
-#define XK_emfilledcircle                              0xade
-#define XK_emfilledrect                                0xadf
-#define XK_enopencircbullet                            0xae0
-#define XK_enopensquarebullet                          0xae1
-#define XK_openrectbullet                              0xae2
-#define XK_opentribulletup                             0xae3
-#define XK_opentribulletdown                           0xae4
-#define XK_openstar                                    0xae5
-#define XK_enfilledcircbullet                          0xae6
-#define XK_enfilledsqbullet                            0xae7
-#define XK_filledtribulletup                           0xae8
-#define XK_filledtribulletdown                         0xae9
-#define XK_leftpointer                                 0xaea
-#define XK_rightpointer                                0xaeb
-#define XK_club                                        0xaec
-#define XK_diamond                                     0xaed
-#define XK_heart                                       0xaee
-#define XK_maltesecross                                0xaf0
-#define XK_dagger                                      0xaf1
-#define XK_doubledagger                                0xaf2
-#define XK_checkmark                                   0xaf3
-#define XK_ballotcross                                 0xaf4
-#define XK_musicalsharp                                0xaf5
-#define XK_musicalflat                                 0xaf6
-#define XK_malesymbol                                  0xaf7
-#define XK_femalesymbol                                0xaf8
-#define XK_telephone                                   0xaf9
-#define XK_telephonerecorder                           0xafa
-#define XK_phonographcopyright                         0xafb
-#define XK_caret                                       0xafc
-#define XK_singlelowquotemark                          0xafd
-#define XK_doublelowquotemark                          0xafe
-#define XK_cursor                                      0xaff
-#endif /* XK_PUBLISHING */
-
-/*
- *  APL
- *  Byte 3 = b
- */
-
-#ifdef XK_APL
-#define XK_leftcaret                                   0xba3
-#define XK_rightcaret                                  0xba6
-#define XK_downcaret                                   0xba8
-#define XK_upcaret                                     0xba9
-#define XK_overbar                                     0xbc0
-#define XK_downtack                                    0xbc2
-#define XK_upshoe                                      0xbc3
-#define XK_downstile                                   0xbc4
-#define XK_underbar                                    0xbc6
-#define XK_jot                                         0xbca
-#define XK_quad                                        0xbcc
-#define XK_uptack                                      0xbce
-#define XK_circle                                      0xbcf
-#define XK_upstile                                     0xbd3
-#define XK_downshoe                                    0xbd6
-#define XK_rightshoe                                   0xbd8
-#define XK_leftshoe                                    0xbda
-#define XK_lefttack                                    0xbdc
-#define XK_righttack                                   0xbfc
-#endif /* XK_APL */
-
-/*
- * Hebrew
- * Byte 3 = c
- */
-
-#ifdef XK_HEBREW
-#define XK_hebrew_doublelowline                        0xcdf
-#define XK_hebrew_aleph                                0xce0
-#define XK_hebrew_bet                                  0xce1
-#define XK_hebrew_beth                                 0xce1  /* deprecated */
-#define XK_hebrew_gimel                                0xce2
-#define XK_hebrew_gimmel                               0xce2  /* deprecated */
-#define XK_hebrew_dalet                                0xce3
-#define XK_hebrew_daleth                               0xce3  /* deprecated */
-#define XK_hebrew_he                                   0xce4
-#define XK_hebrew_waw                                  0xce5
-#define XK_hebrew_zain                                 0xce6
-#define XK_hebrew_zayin                                0xce6  /* deprecated */
-#define XK_hebrew_chet                                 0xce7
-#define XK_hebrew_het                                  0xce7  /* deprecated */
-#define XK_hebrew_tet                                  0xce8
-#define XK_hebrew_teth                                 0xce8  /* deprecated */
-#define XK_hebrew_yod                                  0xce9
-#define XK_hebrew_finalkaph                            0xcea
-#define XK_hebrew_kaph                                 0xceb
-#define XK_hebrew_lamed                                0xcec
-#define XK_hebrew_finalmem                             0xced
-#define XK_hebrew_mem                                  0xcee
-#define XK_hebrew_finalnun                             0xcef
-#define XK_hebrew_nun                                  0xcf0
-#define XK_hebrew_samech                               0xcf1
-#define XK_hebrew_samekh                               0xcf1  /* deprecated */
-#define XK_hebrew_ayin                                 0xcf2
-#define XK_hebrew_finalpe                              0xcf3
-#define XK_hebrew_pe                                   0xcf4
-#define XK_hebrew_finalzade                            0xcf5
-#define XK_hebrew_finalzadi                            0xcf5  /* deprecated */
-#define XK_hebrew_zade                                 0xcf6
-#define XK_hebrew_zadi                                 0xcf6  /* deprecated */
-#define XK_hebrew_qoph                                 0xcf7
-#define XK_hebrew_kuf                                  0xcf7  /* deprecated */
-#define XK_hebrew_resh                                 0xcf8
-#define XK_hebrew_shin                                 0xcf9
-#define XK_hebrew_taw                                  0xcfa
-#define XK_hebrew_taf                                  0xcfa  /* deprecated */
-#define XK_Hebrew_switch        0xFF7E  /* Alias for mode_switch */
-#endif /* XK_HEBREW */
-
-/*
- * Thai
- * Byte 3 = d
- */
-
-#ifdef XK_THAI
-#define XK_Thai_kokai					0xda1
-#define XK_Thai_khokhai					0xda2
-#define XK_Thai_khokhuat				0xda3
-#define XK_Thai_khokhwai				0xda4
-#define XK_Thai_khokhon					0xda5
-#define XK_Thai_khorakhang			        0xda6  
-#define XK_Thai_ngongu					0xda7  
-#define XK_Thai_chochan					0xda8  
-#define XK_Thai_choching				0xda9   
-#define XK_Thai_chochang				0xdaa  
-#define XK_Thai_soso					0xdab
-#define XK_Thai_chochoe					0xdac
-#define XK_Thai_yoying					0xdad
-#define XK_Thai_dochada					0xdae
-#define XK_Thai_topatak					0xdaf
-#define XK_Thai_thothan					0xdb0
-#define XK_Thai_thonangmontho			        0xdb1
-#define XK_Thai_thophuthao			        0xdb2
-#define XK_Thai_nonen					0xdb3
-#define XK_Thai_dodek					0xdb4
-#define XK_Thai_totao					0xdb5
-#define XK_Thai_thothung				0xdb6
-#define XK_Thai_thothahan				0xdb7
-#define XK_Thai_thothong	 			0xdb8
-#define XK_Thai_nonu					0xdb9
-#define XK_Thai_bobaimai				0xdba
-#define XK_Thai_popla					0xdbb
-#define XK_Thai_phophung				0xdbc
-#define XK_Thai_fofa					0xdbd
-#define XK_Thai_phophan					0xdbe
-#define XK_Thai_fofan					0xdbf
-#define XK_Thai_phosamphao			        0xdc0
-#define XK_Thai_moma					0xdc1
-#define XK_Thai_yoyak					0xdc2
-#define XK_Thai_rorua					0xdc3
-#define XK_Thai_ru					0xdc4
-#define XK_Thai_loling					0xdc5
-#define XK_Thai_lu					0xdc6
-#define XK_Thai_wowaen					0xdc7
-#define XK_Thai_sosala					0xdc8
-#define XK_Thai_sorusi					0xdc9
-#define XK_Thai_sosua					0xdca
-#define XK_Thai_hohip					0xdcb
-#define XK_Thai_lochula					0xdcc
-#define XK_Thai_oang					0xdcd
-#define XK_Thai_honokhuk				0xdce
-#define XK_Thai_paiyannoi				0xdcf
-#define XK_Thai_saraa					0xdd0
-#define XK_Thai_maihanakat				0xdd1
-#define XK_Thai_saraaa					0xdd2
-#define XK_Thai_saraam					0xdd3
-#define XK_Thai_sarai					0xdd4   
-#define XK_Thai_saraii					0xdd5   
-#define XK_Thai_saraue					0xdd6    
-#define XK_Thai_sarauee					0xdd7    
-#define XK_Thai_sarau					0xdd8    
-#define XK_Thai_sarauu					0xdd9   
-#define XK_Thai_phinthu					0xdda
-#define XK_Thai_maihanakat_maitho   			0xdde
-#define XK_Thai_baht					0xddf
-#define XK_Thai_sarae					0xde0    
-#define XK_Thai_saraae					0xde1
-#define XK_Thai_sarao					0xde2
-#define XK_Thai_saraaimaimuan				0xde3   
-#define XK_Thai_saraaimaimalai				0xde4  
-#define XK_Thai_lakkhangyao				0xde5
-#define XK_Thai_maiyamok				0xde6
-#define XK_Thai_maitaikhu				0xde7
-#define XK_Thai_maiek					0xde8   
-#define XK_Thai_maitho					0xde9
-#define XK_Thai_maitri					0xdea
-#define XK_Thai_maichattawa				0xdeb
-#define XK_Thai_thanthakhat				0xdec
-#define XK_Thai_nikhahit				0xded
-#define XK_Thai_leksun					0xdf0 
-#define XK_Thai_leknung					0xdf1  
-#define XK_Thai_leksong					0xdf2 
-#define XK_Thai_leksam					0xdf3
-#define XK_Thai_leksi					0xdf4  
-#define XK_Thai_lekha					0xdf5  
-#define XK_Thai_lekhok					0xdf6  
-#define XK_Thai_lekchet					0xdf7  
-#define XK_Thai_lekpaet					0xdf8  
-#define XK_Thai_lekkao					0xdf9 
-#endif /* XK_THAI */
-
-/*
- *   Korean
- *   Byte 3 = e
- */
-
-#ifdef XK_KOREAN
-
-#define XK_Hangul		0xff31    /* Hangul start/stop(toggle) */
-#define XK_Hangul_Start		0xff32    /* Hangul start */
-#define XK_Hangul_End		0xff33    /* Hangul end, English start */
-#define XK_Hangul_Hanja		0xff34    /* Start Hangul->Hanja Conversion */
-#define XK_Hangul_Jamo		0xff35    /* Hangul Jamo mode */
-#define XK_Hangul_Romaja	0xff36    /* Hangul Romaja mode */
-#define XK_Hangul_Codeinput	0xff37    /* Hangul code input mode */
-#define XK_Hangul_Jeonja	0xff38    /* Jeonja mode */
-#define XK_Hangul_Banja		0xff39    /* Banja mode */
-#define XK_Hangul_PreHanja	0xff3a    /* Pre Hanja conversion */
-#define XK_Hangul_PostHanja	0xff3b    /* Post Hanja conversion */
-#define XK_Hangul_SingleCandidate	0xff3c    /* Single candidate */
-#define XK_Hangul_MultipleCandidate	0xff3d    /* Multiple candidate */
-#define XK_Hangul_PreviousCandidate	0xff3e    /* Previous candidate */
-#define XK_Hangul_Special	0xff3f    /* Special symbols */
-#define XK_Hangul_switch	0xFF7E    /* Alias for mode_switch */
-
-/* Hangul Consonant Characters */
-#define XK_Hangul_Kiyeog				0xea1
-#define XK_Hangul_SsangKiyeog				0xea2
-#define XK_Hangul_KiyeogSios				0xea3
-#define XK_Hangul_Nieun					0xea4
-#define XK_Hangul_NieunJieuj				0xea5
-#define XK_Hangul_NieunHieuh				0xea6
-#define XK_Hangul_Dikeud				0xea7
-#define XK_Hangul_SsangDikeud				0xea8
-#define XK_Hangul_Rieul					0xea9
-#define XK_Hangul_RieulKiyeog				0xeaa
-#define XK_Hangul_RieulMieum				0xeab
-#define XK_Hangul_RieulPieub				0xeac
-#define XK_Hangul_RieulSios				0xead
-#define XK_Hangul_RieulTieut				0xeae
-#define XK_Hangul_RieulPhieuf				0xeaf
-#define XK_Hangul_RieulHieuh				0xeb0
-#define XK_Hangul_Mieum					0xeb1
-#define XK_Hangul_Pieub					0xeb2
-#define XK_Hangul_SsangPieub				0xeb3
-#define XK_Hangul_PieubSios				0xeb4
-#define XK_Hangul_Sios					0xeb5
-#define XK_Hangul_SsangSios				0xeb6
-#define XK_Hangul_Ieung					0xeb7
-#define XK_Hangul_Jieuj					0xeb8
-#define XK_Hangul_SsangJieuj				0xeb9
-#define XK_Hangul_Cieuc					0xeba
-#define XK_Hangul_Khieuq				0xebb
-#define XK_Hangul_Tieut					0xebc
-#define XK_Hangul_Phieuf				0xebd
-#define XK_Hangul_Hieuh					0xebe
-
-/* Hangul Vowel Characters */
-#define XK_Hangul_A					0xebf
-#define XK_Hangul_AE					0xec0
-#define XK_Hangul_YA					0xec1
-#define XK_Hangul_YAE					0xec2
-#define XK_Hangul_EO					0xec3
-#define XK_Hangul_E					0xec4
-#define XK_Hangul_YEO					0xec5
-#define XK_Hangul_YE					0xec6
-#define XK_Hangul_O					0xec7
-#define XK_Hangul_WA					0xec8
-#define XK_Hangul_WAE					0xec9
-#define XK_Hangul_OE					0xeca
-#define XK_Hangul_YO					0xecb
-#define XK_Hangul_U					0xecc
-#define XK_Hangul_WEO					0xecd
-#define XK_Hangul_WE					0xece
-#define XK_Hangul_WI					0xecf
-#define XK_Hangul_YU					0xed0
-#define XK_Hangul_EU					0xed1
-#define XK_Hangul_YI					0xed2
-#define XK_Hangul_I					0xed3
-
-/* Hangul syllable-final (JongSeong) Characters */
-#define XK_Hangul_J_Kiyeog				0xed4
-#define XK_Hangul_J_SsangKiyeog				0xed5
-#define XK_Hangul_J_KiyeogSios				0xed6
-#define XK_Hangul_J_Nieun				0xed7
-#define XK_Hangul_J_NieunJieuj				0xed8
-#define XK_Hangul_J_NieunHieuh				0xed9
-#define XK_Hangul_J_Dikeud				0xeda
-#define XK_Hangul_J_Rieul				0xedb
-#define XK_Hangul_J_RieulKiyeog				0xedc
-#define XK_Hangul_J_RieulMieum				0xedd
-#define XK_Hangul_J_RieulPieub				0xede
-#define XK_Hangul_J_RieulSios				0xedf
-#define XK_Hangul_J_RieulTieut				0xee0
-#define XK_Hangul_J_RieulPhieuf				0xee1
-#define XK_Hangul_J_RieulHieuh				0xee2
-#define XK_Hangul_J_Mieum				0xee3
-#define XK_Hangul_J_Pieub				0xee4
-#define XK_Hangul_J_PieubSios				0xee5
-#define XK_Hangul_J_Sios				0xee6
-#define XK_Hangul_J_SsangSios				0xee7
-#define XK_Hangul_J_Ieung				0xee8
-#define XK_Hangul_J_Jieuj				0xee9
-#define XK_Hangul_J_Cieuc				0xeea
-#define XK_Hangul_J_Khieuq				0xeeb
-#define XK_Hangul_J_Tieut				0xeec
-#define XK_Hangul_J_Phieuf				0xeed
-#define XK_Hangul_J_Hieuh				0xeee
-
-/* Ancient Hangul Consonant Characters */
-#define XK_Hangul_RieulYeorinHieuh			0xeef
-#define XK_Hangul_SunkyeongeumMieum			0xef0
-#define XK_Hangul_SunkyeongeumPieub			0xef1
-#define XK_Hangul_PanSios				0xef2
-#define XK_Hangul_KkogjiDalrinIeung			0xef3
-#define XK_Hangul_SunkyeongeumPhieuf			0xef4
-#define XK_Hangul_YeorinHieuh				0xef5
-
-/* Ancient Hangul Vowel Characters */
-#define XK_Hangul_AraeA					0xef6
-#define XK_Hangul_AraeAE				0xef7
-
-/* Ancient Hangul syllable-final (JongSeong) Characters */
-#define XK_Hangul_J_PanSios				0xef8
-#define XK_Hangul_J_KkogjiDalrinIeung			0xef9
-#define XK_Hangul_J_YeorinHieuh				0xefa
-
-/* Korean currency symbol */
-#define XK_Korean_Won					0xeff
-
-#endif /* XK_KOREAN */
-
-/* Euro currency symbol */
-#define XK_EuroSign 0x20ac
-
-#endif
diff --git a/lib/include/rfb/rfb.h b/lib/include/rfb/rfb.h
deleted file mode 100644
index 45d5223..0000000
--- a/lib/include/rfb/rfb.h
+++ /dev/null
@@ -1,1273 +0,0 @@
-#ifndef RFB_H
-#define RFB_H
-/**
- * @defgroup libvncserver_api LibVNCServer API Reference
- * @{
- */
-
-/**
- * @file rfb.h
- */
-
-/*
- *  Copyright (C) 2005 Rohit Kumar <rokumar at novell.com>,
- *                     Johannes E. Schindelin <johannes.schindelin at gmx.de>
- *  Copyright (C) 2002 RealVNC Ltd.
- *  OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk at incompleteness.net>.
- *  Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge.  
- *  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#if(defined __cplusplus)
-extern "C"
-{
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <rfb/rfbproto.h>
-
-#if defined(ANDROID) || defined(LIBVNCSERVER_HAVE_ANDROID)
-#include <arpa/inet.h>
-#include <sys/select.h>
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef __MINGW32__
-#undef SOCKET
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
-#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)))
-#define UNLOCK(mutex) (rfbLog("%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex)))
-#define MUTEX(mutex) pthread_mutex_t (mutex)
-#define INIT_MUTEX(mutex) (rfbLog("%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL))
-#define TINI_MUTEX(mutex) (rfbLog("%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex)))
-#define TSIGNAL(cond) (rfbLog("%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond)))
-#define WAIT(cond,mutex) (rfbLog("%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex)))
-#define COND(cond) pthread_cond_t (cond)
-#define INIT_COND(cond) (rfbLog("%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL))
-#define TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond)))
-#define IF_PTHREADS(x) x
-#else
-#if !NONETWORK
-#define LOCK(mutex) pthread_mutex_lock(&(mutex));
-#define UNLOCK(mutex) pthread_mutex_unlock(&(mutex));
-#endif
-#define MUTEX(mutex) pthread_mutex_t (mutex)
-#define INIT_MUTEX(mutex) pthread_mutex_init(&(mutex),NULL)
-#define TINI_MUTEX(mutex) pthread_mutex_destroy(&(mutex))
-#define TSIGNAL(cond) pthread_cond_signal(&(cond))
-#define WAIT(cond,mutex) pthread_cond_wait(&(cond),&(mutex))
-#define COND(cond) pthread_cond_t (cond)
-#define INIT_COND(cond) pthread_cond_init(&(cond),NULL)
-#define TINI_COND(cond) pthread_cond_destroy(&(cond))
-#define IF_PTHREADS(x) x
-#endif
-#else
-#define LOCK(mutex)
-#define UNLOCK(mutex)
-#define MUTEX(mutex)
-#define INIT_MUTEX(mutex)
-#define TINI_MUTEX(mutex)
-#define TSIGNAL(cond)
-#define WAIT(cond,mutex) this_is_unsupported
-#define COND(cond)
-#define INIT_COND(cond)
-#define TINI_COND(cond)
-#define IF_PTHREADS(x)
-#endif
-
-/* end of stuff for autoconf */
-
-/* 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 LIBVNCSERVER_HAVE_LIBPTHREAD
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#define rfbInitServer rfbInitServerWithPthreadsAndZRLE
-#else
-#define rfbInitServer rfbInitServerWithPthreadsButWithoutZRLE
-#endif
-#else
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#define rfbInitServer rfbInitServerWithoutPthreadsButWithZRLE
-#else
-#define rfbInitServer rfbInitServerWithoutPthreadsAndZRLE
-#endif
-#endif
-
-struct _rfbClientRec;
-struct _rfbScreenInfo;
-struct rfbCursor;
-
-enum rfbNewClientAction {
-	RFB_CLIENT_ACCEPT,
-	RFB_CLIENT_ON_HOLD,
-	RFB_CLIENT_REFUSE
-};
-
-enum rfbSocketState {
-	RFB_SOCKET_INIT,
-	RFB_SOCKET_READY,
-	RFB_SOCKET_SHUTDOWN
-};
-
-typedef void (*rfbKbdAddEventProcPtr) (rfbBool down, rfbKeySym keySym, struct _rfbClientRec* cl);
-typedef void (*rfbKbdReleaseAllKeysProcPtr) (struct _rfbClientRec* cl);
-typedef void (*rfbPtrAddEventProcPtr) (int buttonMask, int x, int y, struct _rfbClientRec* cl);
-typedef void (*rfbSetXCutTextProcPtr) (char* str,int len, struct _rfbClientRec* cl);
-typedef struct rfbCursor* (*rfbGetCursorProcPtr) (struct _rfbClientRec* pScreen);
-typedef rfbBool (*rfbSetTranslateFunctionProcPtr)(struct _rfbClientRec* cl);
-typedef rfbBool (*rfbPasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len);
-typedef enum rfbNewClientAction (*rfbNewClientHookPtr)(struct _rfbClientRec* cl);
-typedef void (*rfbDisplayHookPtr)(struct _rfbClientRec* cl);
-typedef void (*rfbDisplayFinishedHookPtr)(struct _rfbClientRec* cl, int result);
-/** support the capability to view the caps/num/scroll states of the X server */
-typedef int  (*rfbGetKeyboardLedStateHookPtr)(struct _rfbScreenInfo* screen);
-typedef rfbBool (*rfbXvpHookPtr)(struct _rfbClientRec* cl, uint8_t, uint8_t);
-/**
- * If x==1 and y==1 then set the whole display
- * else find the window underneath x and y and set the framebuffer to the dimensions
- * of that window
- */
-typedef void (*rfbSetSingleWindowProcPtr) (struct _rfbClientRec* cl, int x, int y);
-/**
- * Status determines if the X11 server permits input from the local user
- * status==0 or 1
- */
-typedef void (*rfbSetServerInputProcPtr) (struct _rfbClientRec* cl, int status);
-/**
- * Permit the server to allow or deny filetransfers.   This is defaulted to deny
- * It is called when a client initiates a connection to determine if it is permitted.
- */
-typedef int  (*rfbFileTransferPermitted) (struct _rfbClientRec* cl);
-/** Handle the textchat messages */
-typedef void (*rfbSetTextChat) (struct _rfbClientRec* cl, int length, char *string);
-
-typedef struct {
-  uint32_t count;
-  rfbBool is16; /**< is the data format short? */
-  union {
-    uint8_t* bytes;
-    uint16_t* shorts;
-  } data; /**< there have to be count*3 entries */
-} rfbColourMap;
-
-/**
- * Security handling (RFB protocol version 3.7)
- */
-
-typedef struct _rfbSecurity {
-	uint8_t type;
-	void (*handler)(struct _rfbClientRec* cl);
-	struct _rfbSecurity* next;
-} rfbSecurityHandler;
-
-/**
- * Protocol extension handling.
- */
-
-typedef struct _rfbProtocolExtension {
-	/** returns FALSE if extension should be deactivated for client.
-	   if newClient == NULL, it is always deactivated. */
-	rfbBool (*newClient)(struct _rfbClientRec* client, void** data);
-	/** returns FALSE if extension should be deactivated for client.
-	   if init == NULL, it stays activated. */
-	rfbBool (*init)(struct _rfbClientRec* client, void* data);
-	/** if pseudoEncodings is not NULL, it contains a 0 terminated
-	   list of the pseudo encodings handled by this extension. */
-	int *pseudoEncodings;
-	/** returns TRUE if that pseudo encoding is handled by the extension.
-	   encodingNumber==0 means "reset encodings". */
-	rfbBool (*enablePseudoEncoding)(struct _rfbClientRec* client,
-			void** data, int encodingNumber);
-	/** returns TRUE if message was handled */
-	rfbBool (*handleMessage)(struct _rfbClientRec* client,
-				void* data,
-				const rfbClientToServerMsg* message);
-	void (*close)(struct _rfbClientRec* client, void* data);
-	void (*usage)(void);
-	/** processArguments returns the number of handled arguments */
-	int (*processArgument)(int argc, char *argv[]);
-	struct _rfbProtocolExtension* next;
-} rfbProtocolExtension;
-
-typedef struct _rfbExtensionData {
-	rfbProtocolExtension* extension;
-	void* data;
-	struct _rfbExtensionData* next;
-} rfbExtensionData;
-
-/**
- * Per-screen (framebuffer) structure.  There can be as many as you wish,
- * each serving different clients. However, you have to call
- * rfbProcessEvents for each of these.
- */
-
-typedef struct _rfbScreenInfo
-{
-    /** this structure has children that are scaled versions of this screen */
-    struct _rfbScreenInfo *scaledScreenNext;
-    int scaledScreenRefCount;
-
-    int width;
-    int paddedWidthInBytes;
-    int height;
-    int depth;
-    int bitsPerPixel;
-    int sizeInBytes;
-
-    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
-     * same time while using the same functions.
-     */
-    void* screenData;
-
-    /* additions by libvncserver */
-
-    rfbPixelFormat serverFormat;
-    rfbColourMap colourMap; /**< set this if rfbServerFormat.trueColour==FALSE */
-    const char* desktopName;
-    char thisHost[255];
-
-    rfbBool autoPort;
-    int port;
-    SOCKET listenSock;
-    int maxSock;
-    int maxFd;
-#ifdef __MINGW32__
-    struct fd_set allFds;
-#else
-    fd_set allFds;
-#endif
-
-    enum rfbSocketState socketState;
-    SOCKET inetdSock;
-    rfbBool inetdInitDone;
-
-    int udpPort;
-    SOCKET udpSock;
-    struct _rfbClientRec* udpClient;
-    rfbBool udpSockConnected;
-    struct sockaddr_in udpRemoteAddr;
-
-    int maxClientWait;
-
-    /* http stuff */
-    rfbBool httpInitDone;
-    rfbBool httpEnableProxyConnect;
-    int httpPort;
-    char* httpDir;
-    SOCKET httpListenSock;
-    SOCKET httpSock;
-
-    rfbPasswordCheckProcPtr passwordCheck;
-    void* authPasswdData;
-    /** If rfbAuthPasswdData is given a list, this is the first
-        view only password. */
-    int authPasswdFirstViewOnly;
-
-    /** send only this many rectangles in one update */
-    int maxRectsPerUpdate;
-    /** this is the amount of milliseconds to wait at least before sending
-     * an update. */
-    int deferUpdateTime;
-#ifdef TODELETE
-    char* screen;
-#endif
-    rfbBool alwaysShared;
-    rfbBool neverShared;
-    rfbBool dontDisconnect;
-    struct _rfbClientRec* clientHead;
-    struct _rfbClientRec* pointerClient;  /**< "Mutex" for pointer events */
-
-
-    /* cursor */
-    int cursorX, cursorY,underCursorBufferLen;
-    char* underCursorBuffer;
-    rfbBool dontConvertRichCursorToXCursor;
-    struct rfbCursor* cursor;
-
-    /**
-     * the frameBuffer has to be supplied by the serving process.
-     * The buffer will not be freed by
-     */
-    char* frameBuffer;
-    rfbKbdAddEventProcPtr kbdAddEvent;
-    rfbKbdReleaseAllKeysProcPtr kbdReleaseAllKeys;
-    rfbPtrAddEventProcPtr ptrAddEvent;
-    rfbSetXCutTextProcPtr setXCutText;
-    rfbGetCursorProcPtr getCursorPtr;
-    rfbSetTranslateFunctionProcPtr setTranslateFunction;
-    rfbSetSingleWindowProcPtr setSingleWindow;
-    rfbSetServerInputProcPtr  setServerInput;
-    rfbFileTransferPermitted  getFileTransferPermission;
-    rfbSetTextChat            setTextChat;
-
-    /** newClientHook is called just after a new client is created */
-    rfbNewClientHookPtr newClientHook;
-    /** displayHook is called just before a frame buffer update */
-    rfbDisplayHookPtr displayHook;
-
-    /** These hooks are called to pass keyboard state back to the client */
-    rfbGetKeyboardLedStateHookPtr getKeyboardLedStateHook;
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-    MUTEX(cursorMutex);
-    rfbBool backgroundLoop;
-#endif
-
-    /** if TRUE, an ignoring signal handler is installed for SIGPIPE */
-    rfbBool ignoreSIGPIPE;
-
-    /** if not zero, only a slice of this height is processed every time
-     * an update should be sent. This should make working on a slow
-     * link more interactive. */
-    int progressiveSliceHeight;
-
-    in_addr_t listenInterface;
-    int deferPtrUpdateTime;
-
-    /** handle as many input events as possible (default off) */
-    rfbBool handleEventsEagerly;
-
-    /** rfbEncodingServerIdentity */
-    char *versionString;
-
-    /** What does the server tell the new clients which version it supports */
-    int protocolMajorVersion;
-    int protocolMinorVersion;
-
-    /** command line authorization of file transfers */
-    rfbBool permitFileTransfer;
-
-    /** displayFinishedHook is called just after a frame buffer update */
-    rfbDisplayFinishedHookPtr displayFinishedHook;
-    /** xvpHook is called to handle an xvp client message */
-    rfbXvpHookPtr xvpHook;
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-    char *sslkeyfile;
-    char *sslcertfile;
-#endif
-    int ipv6port; /**< The port to listen on when using IPv6.  */
-    char* listen6Interface;
-    /* We have an additional IPv6 listen socket since there are systems that
-       don't support dual binding sockets under *any* circumstances, for
-       instance OpenBSD */
-    SOCKET listen6Sock;
-    int http6Port;
-    SOCKET httpListen6Sock;
-} rfbScreenInfo, *rfbScreenInfoPtr;
-
-
-/**
- * rfbTranslateFnType is the type of translation functions.
- */
-
-typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in,
-                                   rfbPixelFormat *out,
-                                   char *iptr, char *optr,
-                                   int bytesBetweenInputLines,
-                                   int width, int height);
-
-
-/* region stuff */
-
-struct sraRegion;
-typedef struct sraRegion* sraRegionPtr;
-
-/*
- * Per-client structure.
- */
-
-typedef void (*ClientGoneHookPtr)(struct _rfbClientRec* cl);
-
-typedef struct _rfbFileTransferData {
-  int fd;
-  int compressionEnabled;
-  int fileSize;
-  int numPackets;
-  int receiving;
-  int sending;
-} rfbFileTransferData;
-
-
-typedef struct _rfbStatList {
-    uint32_t type;
-    uint32_t sentCount;
-    uint32_t bytesSent;
-    uint32_t bytesSentIfRaw;
-    uint32_t rcvdCount;
-    uint32_t bytesRcvd;
-    uint32_t bytesRcvdIfRaw;
-    struct _rfbStatList *Next;
-} rfbStatList;
-
-typedef struct _rfbSslCtx rfbSslCtx;
-typedef struct _wsCtx wsCtx;
-
-typedef struct _rfbClientRec {
-
-    /** back pointer to the screen */
-    rfbScreenInfoPtr screen;
-
-     /** points to a scaled version of the screen buffer in cl->scaledScreenList */
-     rfbScreenInfoPtr scaledScreen;
-     /** how did the client tell us it wanted the screen changed?  Ultra style or palm style? */
-     rfbBool PalmVNC;
-
-
-    /** private data. You should put any application client specific data
-     * into a struct and let clientData point to it. Don't forget to
-     * free the struct via clientGoneHook!
-     *
-     * This is useful if the IO functions have to behave client specific.
-     */
-    void* clientData;
-    ClientGoneHookPtr clientGoneHook;
-
-    SOCKET sock;
-    char *host;
-
-    /* RFB protocol minor version number */
-    int protocolMajorVersion;
-    int protocolMinorVersion;
-
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-    pthread_t client_thread;
-#endif
-
-    /* Note that the RFB_INITIALISATION_SHARED state is provided to support
-       clients that under some circumstances do not send a ClientInit message.
-       In particular the Mac OS X built-in VNC client (with protocolMinorVersion
-       == 889) is one of those.  However, it only requires this support under
-       special circumstances that can only be determined during the initial
-       authentication.  If the right conditions are met this state will be
-       set (see the auth.c file) when rfbProcessClientInitMessage is called.
-
-       If the state is RFB_INITIALISATION_SHARED we should not expect to recieve
-       any ClientInit message, but instead should proceed to the next stage
-       of initialisation as though an implicit ClientInit message was received
-       with a shared-flag of true.  (There is currently no corresponding
-       RFB_INITIALISATION_NOTSHARED state to represent an implicit ClientInit
-       message with a shared-flag of false because no known existing client
-       requires such support at this time.)
-
-       Note that software using LibVNCServer to provide a VNC server will only
-       ever have a chance to see the state field set to
-       RFB_INITIALISATION_SHARED if the software is multi-threaded and manages
-       to examine the state field during the extremely brief window after the
-       'None' authentication type selection has been received from the built-in
-       OS X VNC client and before the rfbProcessClientInitMessage function is
-       called -- control cannot return to the caller during this brief window
-       while the state field is set to RFB_INITIALISATION_SHARED. */
-
-                                /** Possible client states: */
-    enum {
-        RFB_PROTOCOL_VERSION,   /**< establishing protocol version */
-	RFB_SECURITY_TYPE,      /**< negotiating security (RFB v.3.7) */
-        RFB_AUTHENTICATION,     /**< authenticating */
-        RFB_INITIALISATION,     /**< sending initialisation messages */
-        RFB_NORMAL,             /**< normal protocol messages */
-
-        /* Ephemeral internal-use states that will never be seen by software
-         * using LibVNCServer to provide services: */
-
-        RFB_INITIALISATION_SHARED /**< sending initialisation messages with implicit shared-flag already true */
-    } state;
-
-    rfbBool reverseConnection;
-    rfbBool onHold;
-    rfbBool readyForSetColourMapEntries;
-    rfbBool useCopyRect;
-    int preferredEncoding;
-    int correMaxWidth, correMaxHeight;
-
-    rfbBool viewOnly;
-
-    /* The following member is only used during VNC authentication */
-    uint8_t authChallenge[CHALLENGESIZE];
-
-    /* The following members represent the update needed to get the client's
-       framebuffer from its present state to the current state of our
-       framebuffer.
-
-       If the client does not accept CopyRect encoding then the update is
-       simply represented as the region of the screen which has been modified
-       (modifiedRegion).
-
-       If the client does accept CopyRect encoding, then the update consists of
-       two parts.  First we have a single copy from one region of the screen to
-       another (the destination of the copy is copyRegion), and second we have
-       the region of the screen which has been modified in some other way
-       (modifiedRegion).
-
-       Although the copy is of a single region, this region may have many
-       rectangles.  When sending an update, the copyRegion is always sent
-       before the modifiedRegion.  This is because the modifiedRegion may
-       overlap parts of the screen which are in the source of the copy.
-
-       In fact during normal processing, the modifiedRegion may even overlap
-       the destination copyRegion.  Just before an update is sent we remove
-       from the copyRegion anything in the modifiedRegion. */
-
-    sraRegionPtr copyRegion;	/**< the destination region of the copy */
-    int copyDX, copyDY;		/**< the translation by which the copy happens */
-
-    sraRegionPtr modifiedRegion;
-
-    /** As part of the FramebufferUpdateRequest, a client can express interest
-       in a subrectangle of the whole framebuffer.  This is stored in the
-       requestedRegion member.  In the normal case this is the whole
-       framebuffer if the client is ready, empty if it's not. */
-
-    sraRegionPtr requestedRegion;
-
-    /** The following member represents the state of the "deferred update" timer
-       - when the framebuffer is modified and the client is ready, in most
-       cases it is more efficient to defer sending the update by a few
-       milliseconds so that several changes to the framebuffer can be combined
-       into a single update. */
-
-      struct timeval startDeferring;
-      struct timeval startPtrDeferring;
-      int lastPtrX;
-      int lastPtrY;
-      int lastPtrButtons;
-
-    /** translateFn points to the translation function which is used to copy
-       and translate a rectangle from the framebuffer to an output buffer. */
-
-    rfbTranslateFnType translateFn;
-    char *translateLookupTable;
-    rfbPixelFormat format;
-
-    /**
-     * UPDATE_BUF_SIZE must be big enough to send at least one whole line of the
-     * framebuffer.  So for a max screen width of say 2K with 32-bit pixels this
-     * means 8K minimum.
-     */
-
-#define UPDATE_BUF_SIZE 30000
-
-    char updateBuf[UPDATE_BUF_SIZE];
-    int ublen;
-
-    /* statistics */
-    struct _rfbStatList *statEncList;
-    struct _rfbStatList *statMsgList;
-    int rawBytesEquivalent;
-    int bytesSent;
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    /* zlib encoding -- necessary compression state info per client */
-
-    struct z_stream_s compStream;
-    rfbBool compStreamInited;
-    uint32_t zlibCompressLevel;
-#endif
-#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
-    /** the quality level is also used by ZYWRLE and TightPng */
-    int tightQualityLevel;
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-    /* tight encoding -- preserve zlib streams' state for each client */
-    z_stream zsStruct[4];
-    rfbBool zsActive[4];
-    int zsLevel[4];
-    int tightCompressLevel;
-#endif
-#endif
-
-    /* Ultra Encoding support */
-    rfbBool compStreamInitedLZO;
-    char *lzoWrkMem;
-
-    rfbFileTransferData fileTransfer;
-
-    int     lastKeyboardLedState;     /**< keep track of last value so we can send *change* events */
-    rfbBool enableSupportedMessages;  /**< client supports SupportedMessages encoding */
-    rfbBool enableSupportedEncodings; /**< client supports SupportedEncodings encoding */
-    rfbBool enableServerIdentity;     /**< client supports ServerIdentity encoding */
-    rfbBool enableKeyboardLedState;   /**< client supports KeyboardState encoding */
-    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 */
-    int cursorX,cursorY;	      /**< the coordinates of the cursor,
-					 if enableCursorShapeUpdates = FALSE */
-
-    rfbBool useNewFBSize;             /**< client supports NewFBSize encoding */
-    rfbBool newFBSizePending;         /**< framebuffer size was changed */
-
-    struct _rfbClientRec *prev;
-    struct _rfbClientRec *next;
-
-#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.
-       Use the functions rfbIncrClientRef(cl) and rfbDecrClientRef(cl);
-    */
-    int refCount;
-    MUTEX(refCountMutex);
-    COND(deleteCond);
-
-    MUTEX(outputMutex);
-    MUTEX(updateMutex);
-    COND(updateCond);
-#endif
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-    void* zrleData;
-    int zywrleLevel;
-    int zywrleBuf[rfbZRLETileWidth * rfbZRLETileHeight];
-#endif
-
-    /** if progressive updating is on, this variable holds the current
-     * y coordinate of the progressive slice. */
-    int progressiveSliceY;
-
-    rfbExtensionData* extensions;
-
-    /** for threaded zrle */
-    char *zrleBeforeBuf;
-    void *paletteHelper;
-
-    /** for thread safety for rfbSendFBUpdate() */
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
-#define LIBVNCSERVER_SEND_MUTEX
-    MUTEX(sendMutex);
-#endif
-
-  /* buffers to hold pixel data before and after encoding.
-     per-client for thread safety */
-  char *beforeEncBuf;
-  int beforeEncBufSize;
-  char *afterEncBuf;
-  int afterEncBufSize;
-  int afterEncBufLen;
-#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
-    uint32_t tightEncoding;  /* rfbEncodingTight or rfbEncodingTightPng */
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-    /* TurboVNC Encoding support (extends TightVNC) */
-    int turboSubsampLevel;
-    int turboQualityLevel;  /* 1-100 scale */
-#endif
-#endif
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-    rfbSslCtx *sslctx;
-    wsCtx     *wsctx;
-    char *wspath;                          /* Requests path component */
-#endif
-} rfbClientRec, *rfbClientPtr;
-
-/**
- * This macro is used to test whether there is a framebuffer update needing to
- * be sent to the client.
- */
-
-#define FB_UPDATE_PENDING(cl)                                              \
-     (((cl)->enableCursorShapeUpdates && (cl)->cursorWasChanged) ||        \
-     (((cl)->enableCursorShapeUpdates == FALSE &&                          \
-       ((cl)->cursorX != (cl)->screen->cursorX ||                          \
-	(cl)->cursorY != (cl)->screen->cursorY))) ||                       \
-     ((cl)->useNewFBSize && (cl)->newFBSizePending) ||                     \
-     ((cl)->enableCursorPosUpdates && (cl)->cursorWasMoved) ||             \
-     !sraRgnEmpty((cl)->copyRegion) || !sraRgnEmpty((cl)->modifiedRegion))
-
-/*
- * Macros for endian swapping.
- */
-
-#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
-
-#define Swap24(l) ((((l) & 0xff) << 16) | (((l) >> 16) & 0xff) | \
-                   (((l) & 0x00ff00)))
-
-#define Swap32(l) (((l) >> 24) | \
-                   (((l) & 0x00ff0000) >> 8)  | \
-                   (((l) & 0x0000ff00) << 8)  | \
-                   ((l) << 24))
-
-
-extern char rfbEndianTest;
-
-#define Swap16IfLE(s) (rfbEndianTest ? Swap16(s) : (s))
-#define Swap24IfLE(l) (rfbEndianTest ? Swap24(l) : (l))
-#define Swap32IfLE(l) (rfbEndianTest ? Swap32(l) : (l))
-
-/* UltraVNC uses some windows structures unmodified, so the viewer expects LittleEndian Data */
-#define Swap16IfBE(s) (rfbEndianTest ? (s) : Swap16(s))
-#define Swap24IfBE(l) (rfbEndianTest ? (l) : Swap24(l))
-#define Swap32IfBE(l) (rfbEndianTest ? (l) : Swap32(l))
-
-/* sockets.c */
-
-extern int rfbMaxClientWait;
-
-extern void rfbInitSockets(rfbScreenInfoPtr rfbScreen);
-extern void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen);
-extern void rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen);
-extern void rfbCloseClient(rfbClientPtr cl);
-extern int rfbReadExact(rfbClientPtr cl, char *buf, int len);
-extern int rfbReadExactTimeout(rfbClientPtr cl, char *buf, int len,int timeout);
-extern int rfbPeekExactTimeout(rfbClientPtr cl, char *buf, int len,int timeout);
-extern int rfbWriteExact(rfbClientPtr cl, const char *buf, int len);
-extern int rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec);
-extern int rfbConnect(rfbScreenInfoPtr rfbScreen, char* host, int port);
-extern int rfbConnectToTcpAddr(char* host, int port);
-extern int rfbListenOnTCPPort(int port, in_addr_t iface);
-extern int rfbListenOnTCP6Port(int port, const char* iface);
-extern int rfbListenOnUDPPort(int port, in_addr_t iface);
-extern int rfbStringToAddr(char* string,in_addr_t* addr);
-extern rfbBool rfbSetNonBlocking(int sock);
-
-#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
-/* websockets.c */
-
-extern rfbBool webSocketsCheck(rfbClientPtr cl);
-extern rfbBool webSocketCheckDisconnect(rfbClientPtr cl);
-extern int webSocketsEncode(rfbClientPtr cl, const char *src, int len, char **dst);
-extern int webSocketsDecode(rfbClientPtr cl, char *dst, int len);
-#endif
-
-/* rfbserver.c */
-
-/* Routines to iterate over the client list in a thread-safe way.
-   Only a single iterator can be in use at a time process-wide. */
-typedef struct rfbClientIterator *rfbClientIteratorPtr;
-
-extern void rfbClientListInit(rfbScreenInfoPtr rfbScreen);
-extern rfbClientIteratorPtr rfbGetClientIterator(rfbScreenInfoPtr rfbScreen);
-extern rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr iterator);
-extern void rfbReleaseClientIterator(rfbClientIteratorPtr iterator);
-extern void rfbIncrClientRef(rfbClientPtr cl);
-extern void rfbDecrClientRef(rfbClientPtr cl);
-
-extern void rfbNewClientConnection(rfbScreenInfoPtr rfbScreen,int sock);
-extern rfbClientPtr rfbNewClient(rfbScreenInfoPtr rfbScreen,int sock);
-extern rfbClientPtr rfbNewUDPClient(rfbScreenInfoPtr rfbScreen);
-extern rfbClientPtr rfbReverseConnection(rfbScreenInfoPtr rfbScreen,char *host, int port);
-extern void rfbClientConnectionGone(rfbClientPtr cl);
-extern void rfbProcessClientMessage(rfbClientPtr cl);
-extern void rfbClientConnFailed(rfbClientPtr cl, const char *reason);
-extern void rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,int sock);
-extern void rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen);
-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 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);
-
-extern char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length);
-extern rfbBool rfbSendFileTransferChunk(rfbClientPtr cl);
-extern rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer);
-extern rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, const char *buffer);
-extern char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length);
-extern rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length);
-
-void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len);
-
-/* translate.c */
-
-extern rfbBool rfbEconomicTranslate;
-
-extern void rfbTranslateNone(char *table, rfbPixelFormat *in,
-                             rfbPixelFormat *out,
-                             char *iptr, char *optr,
-                             int bytesBetweenInputLines,
-                             int width, int height);
-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 */
-
-extern void rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen);
-extern void rfbHttpShutdownSockets(rfbScreenInfoPtr rfbScreen);
-extern void rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen);
-
-
-
-/* auth.c */
-
-extern void rfbAuthNewClient(rfbClientPtr cl);
-extern void rfbProcessClientSecurityType(rfbClientPtr cl);
-extern void rfbAuthProcessClientMessage(rfbClientPtr cl);
-extern void rfbRegisterSecurityHandler(rfbSecurityHandler* handler);
-extern void rfbUnregisterSecurityHandler(rfbSecurityHandler* handler);
-
-/* rre.c */
-
-extern rfbBool rfbSendRectEncodingRRE(rfbClientPtr cl, int x,int y,int w,int h);
-
-
-/* corre.c */
-
-extern rfbBool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x,int y,int w,int h);
-
-
-/* hextile.c */
-
-extern rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
-                                       int h);
-
-/* ultra.c */
-
-/* Set maximum ultra rectangle size in pixels.  Always allow at least
- * two scan lines.
- */
-#define ULTRA_MAX_RECT_SIZE (128*256)
-#define ULTRA_MAX_SIZE(min) ((( min * 2 ) > ULTRA_MAX_RECT_SIZE ) ? \
-                            ( min * 2 ) : ULTRA_MAX_RECT_SIZE )
-
-extern rfbBool rfbSendRectEncodingUltra(rfbClientPtr cl, int x,int y,int w,int h);
-
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-/* zlib.c */
-
-/** Minimum zlib rectangle size in bytes.  Anything smaller will
- * not compress well due to overhead.
- */
-#define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17)
-
-/* Set maximum zlib rectangle size in pixels.  Always allow at least
- * two scan lines.
- */
-#define ZLIB_MAX_RECT_SIZE (128*256)
-#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \
-			    ( min * 2 ) : ZLIB_MAX_RECT_SIZE )
-
-extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,
-				    int h);
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-/* tight.c */
-
-#define TIGHT_DEFAULT_COMPRESSION  6
-#define TURBO_DEFAULT_SUBSAMP 0
-
-extern rfbBool rfbTightDisableGradient;
-
-extern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h);
-
-extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);
-
-#if defined(LIBVNCSERVER_HAVE_LIBPNG)
-extern rfbBool rfbSendRectEncodingTightPng(rfbClientPtr cl, int x,int y,int w,int h);
-#endif
-
-#endif
-#endif
-
-
-/* cursor.c */
-
-typedef struct rfbCursor {
-    /** set this to true if LibVNCServer has to free this cursor */
-    rfbBool cleanup, cleanupSource, cleanupMask, cleanupRichSource;
-    unsigned char *source;			/**< points to bits */
-    unsigned char *mask;			/**< points to bits */
-    unsigned short width, height, xhot, yhot;	/**< metrics */
-    unsigned short foreRed, foreGreen, foreBlue; /**< device-independent colour */
-    unsigned short backRed, backGreen, backBlue; /**< device-independent colour */
-    unsigned char *richSource; /**< source bytes for a rich cursor */
-    unsigned char *alphaSource; /**< source for alpha blending info */
-    rfbBool alphaPreMultiplied; /**< if richSource already has alpha applied */
-} rfbCursor, *rfbCursorPtr;
-extern unsigned char rfbReverseByte[0x100];
-
-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);
-extern char* rfbMakeMaskFromAlphaSource(int width,int height,unsigned char* alphaSource);
-extern void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor);
-extern void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor);
-extern void rfbFreeCursor(rfbCursorPtr cursor);
-extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c);
-
-/** cursor handling for the pointer */
-extern void rfbDefaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl);
-
-/* zrle.c */
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,int h);
-#endif
-
-/* stats.c */
-
-extern void rfbResetStats(rfbClientPtr cl);
-extern void rfbPrintStats(rfbClientPtr cl);
-
-/* font.c */
-
-typedef struct rfbFontData {
-  unsigned char* data;
-  /**
-    metaData is a 256*5 array:
-    for each character
-    (offset,width,height,x,y)
-  */
-  int* metaData;
-} rfbFontData,* rfbFontDataPtr;
-
-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,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);
-/** this returns the smallest box enclosing any character of font. */
-void rfbWholeFontBBox(rfbFontDataPtr font,int *x1, int *y1, int *x2, int *y2);
-
-/** dynamically load a linux console font (4096 bytes, 256 glyphs a 8x16 */
-rfbFontDataPtr rfbLoadConsoleFont(char *filename);
-/** free a dynamically loaded font */
-void rfbFreeFont(rfbFontDataPtr font);
-
-/* draw.c */
-
-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 */
-
-/** this opens a modal select box. list is an array of strings, the end marked
-   with a NULL.
-   It returns the index in the list or -1 if cancelled or something else
-   wasn't kosher. */
-typedef void (*SelectionChangedHookPtr)(int _index);
-extern int rfbSelectBox(rfbScreenInfoPtr rfbScreen,
-			rfbFontDataPtr font, char** list,
-			int x1, int y1, int x2, int y2,
-			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 rfbBool rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]);
-extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[]);
-
-/* main.c */
-
-extern void rfbLogEnable(int enabled);
-typedef void (*rfbLogProc)(const char *format, ...);
-extern rfbLogProc rfbLog, rfbErr;
-extern void rfbLogPerror(const char *str);
-
-void rfbScheduleCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy);
-void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy);
-
-void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy);
-void rfbDoCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy);
-
-void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2);
-void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion);
-void rfbDoNothingWithClient(rfbClientPtr cl);
-enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl);
-void rfbRegisterProtocolExtension(rfbProtocolExtension* extension);
-void rfbUnregisterProtocolExtension(rfbProtocolExtension* extension);
-struct _rfbProtocolExtension* rfbGetExtensionIterator();
-void rfbReleaseExtensionIterator();
-rfbBool rfbEnableExtension(rfbClientPtr cl, rfbProtocolExtension* extension,
-	void* data);
-rfbBool rfbDisableExtension(rfbClientPtr cl, rfbProtocolExtension* extension);
-void* rfbGetExtensionClientData(rfbClientPtr cl, rfbProtocolExtension* extension);
-
-/** to check against plain passwords */
-rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len);
-
-/* functions to make a vnc server */
-extern rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
- int width,int height,int bitsPerSample,int samplesPerPixel,
- int bytesPerPixel);
-extern void rfbInitServer(rfbScreenInfoPtr rfbScreen);
-extern void rfbShutdownServer(rfbScreenInfoPtr rfbScreen,rfbBool disconnectClients);
-extern void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen,char *framebuffer,
- int width,int height, int bitsPerSample,int samplesPerPixel,
- int bytesPerPixel);
-
-extern void rfbScreenCleanup(rfbScreenInfoPtr screenInfo);
-extern void rfbSetServerVersionIdentity(rfbScreenInfoPtr screen, char *fmt, ...);
-
-/* functions to accept/refuse a client that has been put on hold
-   by a NewClientHookPtr function. Must not be called in other
-   situations. */
-extern void rfbStartOnHoldClient(rfbClientPtr cl);
-extern void rfbRefuseOnHoldClient(rfbClientPtr cl);
-
-/* call one of these two functions to service the vnc clients.
- usec are the microseconds the select on the fds waits.
- 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.
- rfbProcessEvents() returns TRUE if an update was pending. */
-
-extern void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, rfbBool runInBackground);
-extern rfbBool rfbProcessEvents(rfbScreenInfoPtr screenInfo,long usec);
-extern rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo);
-
-/* TightVNC file transfer extension */
-void rfbRegisterTightVNCFileTransferExtension();
-void rfbUnregisterTightVNCFileTransferExtension();
-
-/* Statistics */
-extern char *messageNameServer2Client(uint32_t type, char *buf, int len);
-extern char *messageNameClient2Server(uint32_t type, char *buf, int len);
-extern char *encodingName(uint32_t enc, char *buf, int len);
-
-extern rfbStatList *rfbStatLookupEncoding(rfbClientPtr cl, uint32_t type);
-extern rfbStatList *rfbStatLookupMessage(rfbClientPtr cl, uint32_t type);
-
-/* Each call to rfbStatRecord* adds one to the rect count for that type */
-extern void rfbStatRecordEncodingSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-extern void rfbStatRecordEncodingSentAdd(rfbClientPtr cl, uint32_t type, int byteCount); /* Specifically for tight encoding */
-extern void rfbStatRecordEncodingRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-extern void rfbStatRecordMessageSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-extern void rfbStatRecordMessageRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw);
-extern void rfbResetStats(rfbClientPtr cl);
-extern void rfbPrintStats(rfbClientPtr cl);
-
-extern int rfbStatGetSentBytes(rfbClientPtr cl);
-extern int rfbStatGetSentBytesIfRaw(rfbClientPtr cl);
-extern int rfbStatGetRcvdBytes(rfbClientPtr cl);
-extern int rfbStatGetRcvdBytesIfRaw(rfbClientPtr cl);
-extern int rfbStatGetMessageCountSent(rfbClientPtr cl, uint32_t type);
-extern int rfbStatGetMessageCountRcvd(rfbClientPtr cl, uint32_t type);
-extern int rfbStatGetEncodingCountSent(rfbClientPtr cl, uint32_t type);
-extern int rfbStatGetEncodingCountRcvd(rfbClientPtr cl, uint32_t type);
-
-/** Set which version you want to advertise 3.3, 3.6, 3.7 and 3.8 are currently supported*/
-extern void rfbSetProtocolVersion(rfbScreenInfoPtr rfbScreen, int major_, int minor_);
-
-/** send a TextChat message to a client */
-extern rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer);
-
-
-/*
- * Additions for Qt event loop integration
- * Original idea taken from vino.
- */
-rfbBool rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen);
-rfbBool rfbUpdateClient(rfbClientPtr cl);
-
-
-#if(defined __cplusplus)
-}
-#endif
-
-/**
- * @}
- */
-
-
-/**
- @page libvncserver_doc LibVNCServer Documentation
- @section create_server Creating a server instance
- To make a server, you just have to initialise a server structure using the
- function rfbGetScreen(), like
- @code
-   rfbScreenInfoPtr screen =
-     rfbGetScreen(argc,argv,screenwidth,screenheight,8,3,bpp);
- @endcode
- where byte per pixel should be 1, 2 or 4. If performance doesn't matter,
- you may try bpp=3 (internally one cannot use native data types in this
- case; if you want to use this, look at pnmshow24.c).
-
- You then can set hooks and io functions (see @ref making_it_interactive) or other
- options (see @ref server_options).
-
- And you allocate the frame buffer like this:
- @code
-     screen->frameBuffer = (char*)malloc(screenwidth*screenheight*bpp);
- @endcode
- After that, you initialize the server, like
- @code
-   rfbInitServer(screen);
- @endcode
- You can use a blocking event loop, a background (pthread based) event loop,
- or implement your own using the rfbProcessEvents() function.
-
- @subsection server_options Optional Server Features
-
- These options have to be set between rfbGetScreen() and rfbInitServer().
-
- If you already have a socket to talk to, just set rfbScreenInfo::inetdSock
- (originally this is for inetd handling, but why not use it for your purpose?).
-
- To also start an HTTP server (running on port 5800+display_number), you have
- to set rfbScreenInfo::httpDir to a directory containing vncviewer.jar and
- index.vnc (like the included "webclients" directory).
-
- @section making_it_interactive Making it interactive
-
- Whenever you draw something, you have to call
- @code
-  rfbMarkRectAsModified(screen,x1,y1,x2,y2).
- @endcode
- This tells LibVNCServer to send updates to all connected clients.
-
- There exist the following IO functions as members of rfbScreen:
- rfbScreenInfo::kbdAddEvent(), rfbScreenInfo::kbdReleaseAllKeys(), rfbScreenInfo::ptrAddEvent() and rfbScreenInfo::setXCutText()
-
- rfbScreenInfo::kbdAddEvent()
-   is called when a key is pressed.
- rfbScreenInfo::kbdReleaseAllKeys()
-   is not called at all (maybe in the future).
- rfbScreenInfo::ptrAddEvent()
-   is called when the mouse moves or a button is pressed.
-   WARNING: if you want to have proper cursor handling, call
-	rfbDefaultPtrAddEvent()
-   in your own function. This sets the coordinates of the cursor.
- rfbScreenInfo::setXCutText()
-   is called when the selection changes.
-
- There are only two hooks:
- rfbScreenInfo::newClientHook()
-   is called when a new client has connected.
- rfbScreenInfo::displayHook()
-   is called just before a frame buffer update is sent.
-
- You can also override the following methods:
- rfbScreenInfo::getCursorPtr()
-   This could be used to make an animated cursor (if you really want ...)
- rfbScreenInfo::setTranslateFunction()
-   If you insist on colour maps or something more obscure, you have to
-   implement this. Default is a trueColour mapping.
-
- @section cursor_handling Cursor handling
-
- The screen holds a pointer
-  rfbScreenInfo::cursor
- to the current cursor. Whenever you set it, remember that any dynamically
- created cursor (like return value from rfbMakeXCursor()) is not free'd!
-
- The rfbCursor structure consists mainly of a mask and a source. The rfbCursor::mask
- describes, which pixels are drawn for the cursor (a cursor needn't be
- rectangular). The rfbCursor::source describes, which colour those pixels should have.
-
- The standard is an XCursor: a cursor with a foreground and a background
- colour (stored in backRed,backGreen,backBlue and the same for foreground
- in a range from 0-0xffff). Therefore, the arrays "mask" and "source"
- contain pixels as single bits stored in bytes in MSB order. The rows are
- padded, such that each row begins with a new byte (i.e. a 10x4
- cursor's mask has 2x4 bytes, because 2 bytes are needed to hold 10 bits).
-
- It is however very easy to make a cursor like this:
- @code
- char* cur="    "
-           " xx "
-	   " x  "
-	   "    ";
- char* mask="xxxx"
-            "xxxx"
-            "xxxx"
-            "xxx ";
- rfbCursorPtr c=rfbMakeXCursor(4,4,cur,mask);
- @endcode
- You can even set rfbCursor::mask to NULL in this call and LibVNCServer will calculate
- a mask for you (dynamically, so you have to free it yourself).
-
- There is also an array named rfbCursor::richSource for colourful cursors. They have
- the same format as the frameBuffer (i.e. if the server is 32 bit,
- a 10x4 cursor has 4x10x4 bytes).
-
- @section screen_client_difference What is the difference between rfbScreenInfoPtr and rfbClientPtr?
-
- The rfbScreenInfoPtr is a pointer to a rfbScreenInfo structure, which
- holds information about the server, like pixel format, io functions,
- frame buffer etc. The rfbClientPtr is a pointer to an rfbClientRec structure, which holds
- information about a client, like pixel format, socket of the
- connection, etc. A server can have several clients, but needn't have any. So, if you
- have a server and three clients are connected, you have one instance
- of a rfbScreenInfo and three instances of rfbClientRec's.
-
- The rfbClientRec structure holds a member rfbClientRec::screen which points to the server.
- So, to access the server from the client structure, you use client->screen.
-
- To access all clients from a server be sure to use the provided iterator
-  rfbGetClientIterator()
- with
-  rfbClientIteratorNext()
- and
-  rfbReleaseClientIterator()
- to prevent thread clashes.
-
- @section example_code Example Code
-
- There are two documented examples included:
-  - example.c, a shared scribble sheet
-  - pnmshow.c, a program to show PNMs (pictures) over the net.
-
- The examples are not too well documented, but easy straight forward and a
- good starting point.
-
- Try example.c: it outputs on which port it listens (default: 5900), so it is
- display 0. To view, call @code	vncviewer :0 @endcode
- You should see a sheet with a gradient and "Hello World!" written on it. Try
- to paint something. Note that everytime you click, there is some bigger blot,
- whereas when you drag the mouse while clicked you draw a line. The size of the
- blot depends on the mouse button you click. Open a second vncviewer with
- the same parameters and watch it as you paint in the other window. This also
- works over internet. You just have to know either the name or the IP of your
- machine. Then it is @code vncviewer machine.where.example.runs.com:0 @endcode
- or similar for the remote client. Now you are ready to type something. Be sure
- that your mouse sits still, because everytime the mouse moves, the cursor is
- reset to the position of the pointer! If you are done with that demo, press
- the down or up arrows. If your viewer supports it, then the dimensions of the
- sheet change. Just press Escape in the viewer. Note that the server still
- runs, even if you closed both windows. When you reconnect now, everything you
- painted and wrote is still there. You can press "Page Up" for a blank page.
-
- The demo pnmshow.c is much simpler: you either provide a filename as argument
- or pipe a file through stdin. Note that the file has to be a raw pnm/ppm file,
- i.e. a truecolour graphics. Only the Escape key is implemented. This may be
- the best starting point if you want to learn how to use LibVNCServer. You
- are confronted with the fact that the bytes per pixel can only be 8, 16 or 32.
-*/
-
-#endif
diff --git a/lib/include/rfb/rfbclient.h b/lib/include/rfb/rfbclient.h
deleted file mode 100644
index 4ea0dd1..0000000
--- a/lib/include/rfb/rfbclient.h
+++ /dev/null
@@ -1,652 +0,0 @@
-#ifndef RFBCLIENT_H
-#define RFBCLIENT_H
-
-/**
- * @defgroup libvncclient_api LibVNCClient API Reference
- * @{
- */
-
-/*
- *  Copyright (C) 2000, 2001 Const Kaplinsky.  All Rights Reserved.
- *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/**
- * @file rfbclient.h
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <rfb/rfbproto.h>
-#include <rfb/keysym.h>
-
-#define rfbClientSwap16IfLE(s) \
-    (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
-
-#define rfbClientSwap32IfLE(l) \
-    (*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \
-			     (((l) & 0x00ff0000) >> 8)  | \
-			     (((l) & 0x0000ff00) << 8)  | \
-			     (((l) & 0x000000ff) << 24))  : (l))
-
-#define rfbClientSwap64IfLE(l) \
-    (*(char *)&client->endianTest ? ((((l) & 0xff00000000000000ULL) >> 56) | \
-			     (((l) & 0x00ff000000000000ULL) >> 40)  | \
-			     (((l) & 0x0000ff0000000000ULL) >> 24)  | \
-			     (((l) & 0x000000ff00000000ULL) >> 8)  | \
-			     (((l) & 0x00000000ff000000ULL) << 8)  | \
-			     (((l) & 0x0000000000ff0000ULL) << 24)  | \
-			     (((l) & 0x000000000000ff00ULL) << 40)  | \
-			     (((l) & 0x00000000000000ffULL) << 56))  : (l))
-
-#define FLASH_PORT_OFFSET 5400
-#define LISTEN_PORT_OFFSET 5500
-#define TUNNEL_PORT_OFFSET 5500
-#define SERVER_PORT_OFFSET 11100
-
-#define DEFAULT_SSH_CMD "/usr/bin/ssh"
-#define DEFAULT_TUNNEL_CMD  \
-  (DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20")
-#define DEFAULT_VIA_CMD     \
-  (DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20")
-
-#if(defined __cplusplus)
-extern "C"
-{
-#endif
-
-/** vncrec */
-
-typedef struct {
-  FILE* file;
-  struct timeval tv;
-  rfbBool readTimestamp;
-  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;
-  rfbBool viewOnly;
-
-  const char* encodingsString;
-
-  rfbBool useBGR233;
-  int nColours;
-  rfbBool forceOwnCmap;
-  rfbBool forceTrueColour;
-  int requestedDepth;
-
-  int compressLevel;
-  int qualityLevel;
-  rfbBool enableJPEG;
-  rfbBool useRemoteCursor;
-  rfbBool palmVNC;  /**< use palmvnc specific SetScale (vs ultravnc) */
-  int scaleSetting; /**< 0 means no scale set, else 1/scaleSetting */
-} AppData;
-
-/** For GetCredentialProc callback function to return */
-typedef union _rfbCredential
-{
-  /** X509 (VeNCrypt) */
-  struct
-  {
-    char *x509CACertFile;
-    char *x509CACrlFile;
-    char *x509ClientCertFile;
-    char *x509ClientKeyFile;
-  } x509Credential;
-  /** Plain (VeNCrypt), MSLogon (UltraVNC) */
-  struct
-  {
-    char *username;
-    char *password;
-  } userCredential;
-} rfbCredential;
-
-#define rfbCredentialTypeX509 1
-#define rfbCredentialTypeUser 2
-
-struct _rfbClient;
-
-/**
- * Handles a text chat message. If your application should accept text messages
- * from the server, define a function with this prototype and set
- * client->HandleTextChat to a pointer to that function subsequent to your
- * rfbGetClient() call.
- * @param client The client which called the text chat handler
- * @param value  text length if text != NULL, or one of rfbTextChatOpen,
- * rfbTextChatClose, rfbTextChatFinished if text == NULL
- * @param text The text message from the server
- */
-typedef void (*HandleTextChatProc)(struct _rfbClient* client, int value, char *text);
-/**
- * Handles XVP server messages. If your application sends XVP messages to the
- * server, you'll want to handle the server's XVP_FAIL and XVP_INIT responses.
- * Define a function with this prototype and set client->HandleXvpMsg to a
- * pointer to that function subsequent to your rfbGetClient() call.
- * @param client The client which called the XVP message handler
- * @param version The highest XVP extension version that the server supports
- * @param opcode The opcode. 0 is XVP_FAIL, 1 is XVP_INIT
- */
-typedef void (*HandleXvpMsgProc)(struct _rfbClient* client, uint8_t version, uint8_t opcode);
-typedef void (*HandleKeyboardLedStateProc)(struct _rfbClient* client, int value, int pad);
-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 void (*FinishedFrameBufferUpdateProc)(struct _rfbClient* client);
-typedef char* (*GetPasswordProc)(struct _rfbClient* client);
-typedef rfbCredential* (*GetCredentialProc)(struct _rfbClient* client, int credentialType);
-typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
-typedef void (*GotXCutTextProc)(struct _rfbClient* client, const char *text, int textlen);
-typedef void (*BellProc)(struct _rfbClient* client);
-
-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 struct _rfbClient {
-	uint8_t* frameBuffer;
-	int width, height;
-
-	int endianTest;
-
-	AppData appData;
-
-	const char* programName;
-	char* serverHost;
-	int serverPort; /**< if -1, then use file recorded by vncrec */
-	rfbBool listenSpecified;
-	int listenPort, flashPort;
-
-	struct {
-		int x, y, w, h;
-	} updateRect;
-
-	/** 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.
-	   Hextile also assumes it is big enough to hold 16 * 16 * 32 bits.
-	   Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */
-
-#define RFB_BUFFER_SIZE (640*480)
-	char buffer[RFB_BUFFER_SIZE];
-
-	/* rfbproto.c */
-
-	int sock;
-	rfbBool canUseCoRRE;
-	rfbBool canUseHextile;
-	char *desktopName;
-	rfbPixelFormat format;
-	rfbServerInitMsg si;
-
-	/* sockets.c */
-#define RFB_BUF_SIZE 8192
-	char buf[RFB_BUF_SIZE];
-	char *bufoutptr;
-	int buffered;
-
-	/* The zlib encoding requires expansion/decompression/deflation of the
-	   compressed data in the "buffer" above into another, result buffer.
-	   However, the size of the result buffer can be determined precisely
-	   based on the bitsPerPixel, height and width of the rectangle.  We
-	   allocate this buffer one time to be the full size of the buffer. */
-
-	/* Ultra Encoding uses this buffer too */
-	
-	int ultra_buffer_size;
-	char *ultra_buffer;
-
-	int raw_buffer_size;
-	char *raw_buffer;
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-	z_stream decompStream;
-	rfbBool decompStreamInited;
-#endif
-
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-	/*
-	 * Variables for the ``tight'' encoding implementation.
-	 */
-
-	/** Separate buffer for compressed data. */
-#define ZLIB_BUFFER_SIZE 30000
-	char zlib_buffer[ZLIB_BUFFER_SIZE];
-
-	/* Four independent compression streams for zlib library. */
-	z_stream zlibStream[4];
-	rfbBool zlibStreamActive[4];
-
-	/* Filter stuff. Should be initialized by filter initialization code. */
-	rfbBool cutZeros;
-	int rectWidth, rectColors;
-	char tightPalette[256*4];
-	uint8_t tightPrevRow[2048*3*sizeof(uint16_t)];
-
-#ifdef LIBVNCSERVER_HAVE_LIBJPEG
-	/** JPEG decoder state. */
-	rfbBool jpegError;
-
-	struct jpeg_source_mgr* jpegSrcManager;
-	void* jpegBufferPtr;
-	size_t jpegBufferLen;
-
-#endif
-#endif
-
-
-	/* cursor.c */
-	uint8_t *rcSource, *rcMask;
-
-	/** private data pointer */
-	rfbClientData* clientData;
-
-	rfbVNCRec* vncRec;
-
-	/* Keyboard State support (is 'Caps Lock' set on the remote display???) */
-	int KeyboardLedStateEnabled;
-	int CurrentKeyboardLedState;
-
-	int canHandleNewFBSize;
-
-	/* hooks */
-	HandleTextChatProc         HandleTextChat;
-	HandleKeyboardLedStateProc HandleKeyboardLedState;
-	HandleCursorPosProc HandleCursorPos;
-	SoftCursorLockAreaProc SoftCursorLockArea;
-	SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
-	GotFrameBufferUpdateProc GotFrameBufferUpdate;
-	/** the pointer returned by GetPassword will be freed after use! */
-	GetPasswordProc GetPassword;
-	MallocFrameBufferProc MallocFrameBuffer;
-	GotXCutTextProc GotXCutText;
-	BellProc Bell;
-
-	GotCursorShapeProc GotCursorShape;
-	GotCopyRectProc GotCopyRect;
-
-	/** Which messages are supported by the server
-	 * This is a *guess* for most servers.
-	 * (If we can even detect the type of server)
-	 *
-	 * If the server supports the "rfbEncodingSupportedMessages"
-	 * then this will be updated when the encoding is received to
-	 * accurately reflect the servers capabilities.
-	 */
-	rfbSupportedMessages supportedMessages;
-
-	/** negotiated protocol version */
-	int major, minor;
-
-	/** The selected security types */
-	uint32_t authScheme, subAuthScheme;
-
-	/** The TLS session for Anonymous TLS and VeNCrypt */
-	void* tlsSession;
-
-	/** To support security types that requires user input (except VNC password
-	 * authentication), for example VeNCrypt and MSLogon, this callback function
-	 * must be set before the authentication. Otherwise, it implicates that the
-	 * caller application does not support it and related security types should
-	 * be bypassed.
-	 */
-	GetCredentialProc GetCredential;
-
-	/** The 0-terminated security types supported by the client.
-	 * Set by function SetClientAuthSchemes() */
-	uint32_t *clientAuthSchemes;
-
-	/** When the server is a repeater, this specifies the final destination */
-	char *destHost;
-	int destPort;
-
-        /** the QoS IP DSCP for this client */
-        int QoS_DSCP;
-
-        /** hook to handle xvp server messages */
-	HandleXvpMsgProc           HandleXvpMsg;
-
-	/* listen.c */
-        int listenSock;
-
-	FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate;
-
-	char *listenAddress;
-        /* IPv6 listen socket, address and port*/
-        int listen6Sock;
-        char* listen6Address;
-        int listen6Port;
-
-        /* Output Window ID. When set, client application enables libvncclient to perform direct rendering in its window */
-        unsigned long outputWindow;
-
-} rfbClient;
-
-/* cursor.c */
-
-extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc);
-
-/* listen.c */
-
-extern void listenForIncomingConnections(rfbClient* viewer);
-extern int listenForIncomingConnectionsNoFork(rfbClient* viewer, int usec_timeout);
-
-/* rfbproto.c */
-
-extern rfbBool rfbEnableClientLogging;
-typedef void (*rfbClientLogProc)(const char *format, ...);
-extern rfbClientLogProc rfbClientLog,rfbClientErr;
-extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
-extern rfbBool ConnectToRFBRepeater(rfbClient* client,const char *repeaterHost, int repeaterPort, const char *destHost, int destPort);
-extern void SetClientAuthSchemes(rfbClient* client,const uint32_t *authSchemes, int size);
-extern rfbBool InitialiseRFBConnection(rfbClient* client);
-/**
- * Sends format and encoding parameters to the server. Your application can
- * modify the 'client' data structure directly. However some changes to this
- * structure must be communicated back to the server. For instance, if you
- * change the encoding to hextile, the server needs to know that it should send
- * framebuffer updates in hextile format. Likewise if you change the pixel
- * format of the framebuffer, the server must be notified about this as well.
- * Call this function to propagate your changes of the local 'client' structure
- * over to the server.
- * @li Encoding type
- * @li RFB protocol extensions announced via pseudo-encodings
- * @li Framebuffer pixel format (like RGB vs ARGB)
- * @li Remote cursor support
- * @param client The client in which the format or encodings have been changed
- * @return true if the format or encodings were sent to the server successfully,
- * false otherwise
- */
-extern rfbBool SetFormatAndEncodings(rfbClient* client);
-extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
-/**
- * Sends a framebuffer update request to the server. A VNC client may request an
- * update from the server at any time. You can also specify which portions of
- * the screen you want updated. This can be handy if a pointer is at certain
- * location and the user pressed a mouse button, for instance. Then you can
- * immediately request an update of the region around the pointer from the
- * server.
- * @note The coordinate system is a left-handed Cartesian coordinate system with
- * the Z axis (unused) pointing out of the screen. Alternately you can think of
- * it as a right-handed Cartesian coordinate system with the Z axis pointing
- * into the screen. The origin is at the upper left corner of the framebuffer.
- * @param client The client through which to send the request
- * @param x The horizontal position of the update request rectangle
- * @param y The vertical position of the update request rectangle
- * @param w The width of the update request rectangle
- * @param h The height of the update request rectangle
- * @param incremental false: server sends rectangle even if nothing changed.
- * true: server only sends changed parts of rectangle.
- * @return true if the update request was sent successfully, false otherwise
- */
-extern rfbBool SendFramebufferUpdateRequest(rfbClient* client,
-					 int x, int y, int w, int h,
-					 rfbBool incremental);
-extern rfbBool SendScaleSetting(rfbClient* client,int scaleSetting);
-/**
- * Sends a pointer event to the server. A pointer event includes a cursor
- * location and a button mask. The button mask indicates which buttons on the
- * pointing device are pressed. Each button is represented by a bit in the
- * button mask. A 1 indicates the button is pressed while a 0 indicates that it
- * is not pressed. You may use these pre-defined button masks by ORing them
- * together: rfbButton1Mask, rfbButton2Mask, rfbButton3Mask, rfbButton4Mask
- * rfbButton5Mask
- * @note  The cursor location is relative to the client's framebuffer, not the
- * client's screen itself.
- * @note The coordinate system is a left-handed Cartesian coordinate system with
- * the Z axis (unused) pointing out of the screen. Alternately you can think of
- * it as a right-handed Cartesian coordinate system with the Z axis pointing
- * into the screen. The origin is at the upper left corner of the screen.
- * @param client The client through which to send the pointer event
- * @param x the horizontal location of the cursor
- * @param y the vertical location of the cursor
- * @param buttonMask the button mask indicating which buttons are pressed
- * @return true if the pointer event was sent successfully, false otherwise
- */
-extern rfbBool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask);
-/**
- * Sends a key event to the server. If your application is not merely a VNC
- * viewer (i.e. it controls the server), you'll want to send the keys that the
- * user presses to the server. Use this function to do that.
- * @param client The client through which to send the key event
- * @param key An rfbKeySym defined in rfb/keysym.h
- * @param down true if this was a key down event, false otherwise
- * @return true if the key event was send successfully, false otherwise
- */
-extern rfbBool SendKeyEvent(rfbClient* client,uint32_t key, rfbBool down);
-/**
- * Places a string on the server's clipboard. Use this function if you want to
- * be able to copy and paste between the server and your application. For
- * instance, when your application is notified that the user copied some text
- * onto the clipboard, you would call this function to synchronize the server's
- * clipboard with your local clipboard.
- * @param client The client structure through which to send the client cut text
- * message
- * @param str The string to send (doesn't need to be NULL terminated)
- * @param len The length of the string
- * @return true if the client cut message was sent successfully, false otherwise
- */
-extern rfbBool SendClientCutText(rfbClient* client,const char *str, int len);
-/**
- * Handles messages from the RFB server. You must call this function
- * intermittently so LibVNCClient can parse messages from the server. For
- * example, if your app has a draw loop, you could place a call to this
- * function within that draw loop.
- * @note You must call WaitForMessage() before you call this function.
- * @param client The client which will handle the RFB server messages
- * @return true if the client was able to handle the RFB server messages, false
- * otherwise
- */
-extern rfbBool HandleRFBServerMessage(rfbClient* client);
-
-/**
- * Sends a text chat message to the server.
- * @param client The client through which to send the message
- * @param text The text to send
- * @return true if the text was sent successfully, false otherwise
- */
-extern rfbBool TextChatSend(rfbClient* client, char *text);
-/**
- * Opens a text chat window on the server.
- * @param client The client through which to send the message
- * @return true if the window was opened successfully, false otherwise
- */
-extern rfbBool TextChatOpen(rfbClient* client);
-/**
- * Closes the text chat window on the server.
- * @param client The client through which to send the message
- * @return true if the window was closed successfully, false otherwise
- */
-extern rfbBool TextChatClose(rfbClient* client);
-extern rfbBool TextChatFinish(rfbClient* client);
-extern rfbBool PermitServerInput(rfbClient* client, int enabled);
-extern rfbBool SendXvpMsg(rfbClient* client, uint8_t version, uint8_t code);
-
-extern void PrintPixelFormat(rfbPixelFormat *format);
-
-extern rfbBool SupportsClient2Server(rfbClient* client, int messageType);
-extern rfbBool SupportsServer2Client(rfbClient* client, int messageType);
-
-/* client data */
-
-/**
- * Associates a client data tag with the given pointer. LibVNCClient has
- * several events to which you can associate your own handlers. These handlers
- * have the client structure as one of their parameters. Sometimes, you may want
- * to make data from elsewhere in your application available to these handlers
- * without using a global variable. To do this, you call
- * rfbClientSetClientData() and associate the data with a tag. Then, your
- * handler can call rfbClientGetClientData() and get the a pointer to the data
- * associated with that tag.
- * @param client The client in which to set the client data
- * @param tag A unique tag which identifies the data
- * @param data A pointer to the data to associate with the tag
- */
-void rfbClientSetClientData(rfbClient* client, void* tag, void* data);
-/**
- * Returns a pointer to the client data associated with the given tag. See the
- * the documentation for rfbClientSetClientData() for a discussion of how you
- * can use client data.
- * @param client The client from which to get the client data
- * @param tag The tag which identifies the client data
- * @return a pointer to the client 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;
-
-extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
-extern rfbBool WriteToRFBServer(rfbClient* client, const char *buf, int n);
-extern int FindFreeTcpPort(void);
-extern int ListenAtTcpPort(int port);
-extern int ListenAtTcpPortAndAddress(int port, const char *address);
-extern int ConnectClientToTcpAddr(unsigned int host, int port);
-extern int ConnectClientToTcpAddr6(const char *hostname, int port);
-extern int ConnectClientToUnixSock(const char *sockFile);
-extern int AcceptTcpConnection(int listenSock);
-extern rfbBool SetNonBlocking(int sock);
-extern rfbBool SetDSCP(int sock, int dscp);
-
-extern rfbBool StringToIPAddr(const char *str, unsigned int *addr);
-extern rfbBool SameMachine(int sock);
-/**
- * Waits for an RFB message to arrive from the server. Before handling a message
- * with HandleRFBServerMessage(), you must wait for your client to receive one.
- * This function blocks until a message is received. You may specify a timeout
- * in microseconds. Once this number of microseconds have elapsed, the function
- * will return.
- * @param client The client to cause to wait until a message is received
- * @param usecs The timeout in microseconds
- * @return the return value of the underlying select() call
- */
-extern int WaitForMessage(rfbClient* client,unsigned int usecs);
-
-/* vncviewer.c */
-/**
- * Allocates and returns a pointer to an rfbClient structure. This will probably
- * be the first LibVNCClient function your client code calls. Most libVNCClient
- * functions operate on an rfbClient structure, and this function allocates
- * memory for that structure. When you're done with the rfbClient structure
- * pointer this function returns, you should free the memory rfbGetClient()
- * allocated by calling rfbClientCleanup().
- *
- * A pixel is one dot on the screen. The number of bytes in a pixel will depend
- * on the number of samples in that pixel and the number of bits in each sample.
- * A sample represents one of the primary colors in a color model. The RGB
- * color model uses red, green, and blue samples respectively. Suppose you
- * wanted to use 16-bit RGB color: You would have three samples per pixel (one
- * for each primary color), five bits per sample (the quotient of 16 RGB bits
- * divided by three samples), and two bytes per pixel (the smallest multiple of
- * eight bits in which the 16-bit pixel will fit). If you wanted 32-bit RGB
- * color, you would have three samples per pixel again, eight bits per sample
- * (since that's how 32-bit color is defined), and four bytes per pixel (the
- * smallest multiple of eight bits in which the 32-bit pixel will fit.
- * @param bitsPerSample The number of bits in a sample
- * @param samplesPerPixel The number of samples in a pixel
- * @param bytesPerPixel The number of bytes in a pixel
- * @return a pointer to the allocated rfbClient structure
- */
-rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
-/**
- * Initializes the client. The format is {PROGRAM_NAME, [OPTIONS]..., HOST}. This
- * function does not initialize the program name if the rfbClient's program
- * name is set already. The options are as follows:
- * <table>
- * <tr><th>Option</th><th>Description</th></tr>
- * <tr><td>-listen</td><td>Listen for incoming connections.</td></tr>
- * <tr><td>-listennofork</td><td>Listen for incoming connections without forking.
- * </td></tr>
- * <tr><td>-play</td><td>Set this client to replay a previously recorded session.</td></tr>
- * <tr><td>-encodings</td><td>Set the encodings to use. The next item in the
- * argv array is the encodings string, consisting of comma separated encodings like 'tight,ultra,raw'.</td></tr>
- * <tr><td>-compress</td><td>Set the compression level. The next item in the
- * argv array is the compression level as an integer. Ranges from 0 (lowest) to 9 (highest).
- * </td></tr>
- * <tr><td>-scale</td><td>Set the scaling level. The next item in the
- * argv array is the scaling level as an integer. The screen will be scaled down by this factor.</td></tr>
- * <tr><td>-qosdscp</td><td>Set the Quality of Service Differentiated Services
- * Code Point (QoS DSCP). The next item in the argv array is the code point as
- * an integer.</td></tr>
- * <tr><td>-repeaterdest</td><td>Set a VNC repeater address. The next item in the argv array is
- * the repeater's address as a string.</td></tr>
- * </table>
- *
- * The host may include a port number (delimited by a ':').
- * @param client The client to initialize
- * @param argc The number of arguments to the initializer
- * @param argv The arguments to the initializer as an array of NULL terminated
- * strings
- * @return true if the client was initialized successfully, false otherwise.
- */
-rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
-/**
- * Cleans up the client structure and releases the memory allocated for it. You
- * should call this when you're done with the rfbClient structure that you
- * allocated with rfbGetClient().
- * @note rfbClientCleanup() does not touch client->frameBuffer.
- * @param client The client to clean up
- */
-void rfbClientCleanup(rfbClient* client);
-
-#if(defined __cplusplus)
-}
-#endif
-
-/**
- * @}
- */
-
-/**
- @page libvncclient_doc LibVNCClient Documentation
- @section example_code Example Code
- See SDLvncviewer.c for a rather complete client example.
-*/
-
-#endif
diff --git a/lib/include/rfb/rfbint.h b/lib/include/rfb/rfbint.h
deleted file mode 100644
index 1b81a43..0000000
--- a/lib/include/rfb/rfbint.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _LIB_INCLUDE_RFB_RFBINT_H
-#define _LIB_INCLUDE_RFB_RFBINT_H 1
-#ifndef _GENERATED_STDINT_H
-#define _GENERATED_STDINT_H "italc 1.0.9"
-/* generated using a gnu compiler version gcc (Ubuntu 4.3.1-7ubuntu1) 4.3.1 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
-
-#include <stdint.h>
-
-
-/* system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#endif
-
-  /* once */
-#endif
-#endif
diff --git a/lib/include/rfb/rfbproto.h b/lib/include/rfb/rfbproto.h
deleted file mode 100644
index 9bfd2d2..0000000
--- a/lib/include/rfb/rfbproto.h
+++ /dev/null
@@ -1,1555 +0,0 @@
-#ifndef RFBPROTO_H
-#define RFBPROTO_H
-
-/*
- *  Copyright (C) 2009-2010 D. R. Commander. All Rights Reserved.
- *  Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
- *  Copyright (C) 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
- *  Copyright (C) 2000-2002 Constantin Kaplinsky.  All Rights Reserved.
- *  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
- *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-/*
- * rfbproto.h - header file for the RFB protocol version 3.3
- *
- * Uses types CARD<n> for an n-bit unsigned integer, INT<n> for an n-bit signed
- * integer (for n = 8, 16 and 32).
- *
- * All multiple byte integers are in big endian (network) order (most
- * significant byte first).  Unless noted otherwise there is no special
- * alignment of protocol structures.
- *
- *
- * Once the initial handshaking is done, all messages start with a type byte,
- * (usually) followed by message-specific data.  The order of definitions in
- * this file is as follows:
- *
- *  (1) Structures used in several types of message.
- *  (2) Structures used in the initial handshaking.
- *  (3) Message types.
- *  (4) Encoding types.
- *  (5) For each message type, the form of the data following the type byte.
- *      Sometimes this is defined by a single structure but the more complex
- *      messages have to be explained by comments.
- */
-
-
-#if defined(WIN32) && !defined(__MINGW32__)
-#define LIBVNCSERVER_WORDS_BIGENDIAN
-#define rfbBool int
-#include <sys/timeb.h>
-#include <winsock.h>
-#undef SOCKET
-#define SOCKET int
-#else
-#include <rfb/rfbconfig.h>
-#include <rfb/rfbint.h>
-#endif
-#include <rfb/keysym.h>
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-#include <zlib.h>
-#ifdef __CHECKER__
-#undef Z_NULL
-#define Z_NULL NULL
-#endif
-#endif
-
-/* some autotool versions do not properly prefix
-   WORDS_BIGENDIAN, so do that manually */
-#ifdef WORDS_BIGENDIAN
-#define LIBVNCSERVER_WORDS_BIGENDIAN
-#endif
-
-#if !defined(WIN32) || defined(__MINGW32__)
-#ifndef __cplusplus
-#ifndef max
-#define max(a,b) (((a)>(b))?(a):(b))
-#endif
-#endif
-#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifndef WIN32
-#ifndef SOCKET
-#define SOCKET int
-#endif
-#endif
-typedef int8_t rfbBool;
-#undef FALSE
-#define FALSE 0
-#undef TRUE
-#define TRUE -1
-#endif
-
-typedef uint32_t rfbKeySym;
-typedef uint32_t rfbPixel;
-
-#ifdef LIBVNCSERVER_NEED_INADDR_T
-typedef uint32_t in_addr_t;
-#endif
-
-#ifndef INADDR_NONE
-#define                INADDR_NONE     ((in_addr_t) 0xffffffff)
-#endif
-
-#define MAX_ENCODINGS 32
-
-/*****************************************************************************
- *
- * Structures used in several messages
- *
- *****************************************************************************/
-
-/*-----------------------------------------------------------------------------
- * Structure used to specify a rectangle.  This structure is a multiple of 4
- * bytes so that it can be interspersed with 32-bit pixel data without
- * affecting alignment.
- */
-
-typedef struct {
-    uint16_t x;
-    uint16_t y;
-    uint16_t w;
-    uint16_t h;
-} rfbRectangle;
-
-#define sz_rfbRectangle 8
-
-
-/*-----------------------------------------------------------------------------
- * Structure used to specify pixel format.
- */
-
-typedef struct {
-
-    uint8_t bitsPerPixel;		/* 8,16,32 only */
-
-    uint8_t depth;		/* 8 to 32 */
-
-    uint8_t bigEndian;		/* True if multi-byte pixels are interpreted
-				   as big endian, or if single-bit-per-pixel
-				   has most significant bit of the byte
-				   corresponding to first (leftmost) pixel. Of
-				   course this is meaningless for 8 bits/pix */
-
-    uint8_t trueColour;		/* If false then we need a "colour map" to
-				   convert pixels to RGB.  If true, xxxMax and
-				   xxxShift specify bits used for red, green
-				   and blue */
-
-    /* the following fields are only meaningful if trueColour is true */
-
-    uint16_t redMax;		/* maximum red value (= 2^n - 1 where n is the
-				   number of bits used for red). Note this
-				   value is always in big endian order. */
-
-    uint16_t greenMax;		/* similar for green */
-
-    uint16_t blueMax;		/* and blue */
-
-    uint8_t redShift;		/* number of shifts needed to get the red
-				   value in a pixel to the least significant
-				   bit. To find the red value from a given
-				   pixel, do the following:
-				   1) Swap pixel value according to bigEndian
-				      (e.g. if bigEndian is false and host byte
-				      order is big endian, then swap).
-				   2) Shift right by redShift.
-				   3) AND with redMax (in host byte order).
-				   4) You now have the red value between 0 and
-				      redMax. */
-
-    uint8_t greenShift;		/* similar for green */
-
-    uint8_t blueShift;		/* and blue */
-
-    uint8_t pad1;
-    uint16_t pad2;
-
-} rfbPixelFormat;
-
-#define sz_rfbPixelFormat 16
-
-/* UltraVNC: Color settings values */
-#define rfbPFFullColors		0
-#define rfbPF256Colors		1
-#define rfbPF64Colors		2
-#define rfbPF8Colors		3
-#define rfbPF8GreyColors	4
-#define rfbPF4GreyColors	5
-#define rfbPF2GreyColors	6
-
-
-/*****************************************************************************
- *
- * Initial handshaking messages
- *
- *****************************************************************************/
-
-/*-----------------------------------------------------------------------------
- * Protocol Version
- *
- * The server always sends 12 bytes to start which identifies the latest RFB
- * protocol version number which it supports.  These bytes are interpreted
- * as a string of 12 ASCII characters in the format "RFB xxx.yyy\n" where
- * xxx and yyy are the major and minor version numbers (for version 3.3
- * this is "RFB 003.003\n").
- *
- * The client then replies with a similar 12-byte message giving the version
- * number of the protocol which should actually be used (which may be different
- * to that quoted by the server).
- *
- * It is intended that both clients and servers may provide some level of
- * backwards compatibility by this mechanism.  Servers in particular should
- * attempt to provide backwards compatibility, and even forwards compatibility
- * to some extent.  For example if a client demands version 3.1 of the
- * protocol, a 3.0 server can probably assume that by ignoring requests for
- * encoding types it doesn't understand, everything will still work OK.  This
- * will probably not be the case for changes in the major version number.
- *
- * The format string below can be used in sprintf or sscanf to generate or
- * decode the version string respectively.
- */
-
-#define rfbProtocolVersionFormat "RFB %03d.%03d\n"
-#define rfbProtocolMajorVersion 3
-#define rfbProtocolMinorVersion 8
-/* UltraVNC Viewer examines rfbProtocolMinorVersion number (4, and 6)
- * to identify if the server supports File Transfer
- */
-
-typedef char rfbProtocolVersionMsg[13];	/* allow extra byte for null */
-
-#define sz_rfbProtocolVersionMsg 12
-
-/*
- * Negotiation of the security type (protocol version 3.7)
- *
- * Once the protocol version has been decided, the server either sends a list
- * of supported security types, or informs the client about an error (when the
- * number of security types is 0).  Security type rfbSecTypeTight is used to
- * enable TightVNC-specific protocol extensions.  The value rfbSecTypeVncAuth
- * stands for classic VNC authentication.
- *
- * The client selects a particular security type from the list provided by the
- * server.
- */
-
-#define rfbSecTypeInvalid 0
-#define rfbSecTypeNone 1
-#define rfbSecTypeVncAuth 2
-
-
-/*-----------------------------------------------------------------------------
- * Authentication
- *
- * Once the protocol version has been decided, the server then sends a 32-bit
- * word indicating whether any authentication is needed on the connection.
- * The value of this word determines the authentication scheme in use.  For
- * version 3.0 of the protocol this may have one of the following values:
- */
-
-#define rfbConnFailed 0
-#define rfbNoAuth 1
-#define rfbVncAuth 2
-
-#define rfbRA2 5
-#define rfbRA2ne 6
-#define rfbSSPI 7
-#define rfbSSPIne 8
-#define rfbTight 16
-#define rfbUltra 17
-#define rfbTLS 18
-#define rfbVeNCrypt 19
-#define rfbARD 30
-#define rfbUltraVNC_MsLogonIIAuth 0x71
-#define rfbMSLogon 0xfffffffa
-
-#define rfbVeNCryptPlain 256
-#define rfbVeNCryptTLSNone 257
-#define rfbVeNCryptTLSVNC 258
-#define rfbVeNCryptTLSPlain 259
-#define rfbVeNCryptX509None 260
-#define rfbVeNCryptX509VNC 261
-#define rfbVeNCryptX509Plain 262
-#define rfbVeNCryptX509SASL 263
-#define rfbVeNCryptTLSSASL 264
-
-/*
- * rfbConnFailed:	For some reason the connection failed (e.g. the server
- *			cannot support the desired protocol version).  This is
- *			followed by a string describing the reason (where a
- *			string is specified as a 32-bit length followed by that
- *			many ASCII characters).
- *
- * rfbNoAuth:		No authentication is needed.
- *
- * rfbVncAuth:		The VNC authentication scheme is to be used.  A 16-byte
- *			challenge follows, which the client encrypts as
- *			appropriate using the password and sends the resulting
- *			16-byte response.  If the response is correct, the
- *			server sends the 32-bit word rfbVncAuthOK.  If a simple
- *			failure happens, the server sends rfbVncAuthFailed and
- *			closes the connection. If the server decides that too
- *			many failures have occurred, it sends rfbVncAuthTooMany
- *			and closes the connection.  In the latter case, the
- *			server should not allow an immediate reconnection by
- *			the client.
- */
-
-#define rfbVncAuthOK 0
-#define rfbVncAuthFailed 1
-#define rfbVncAuthTooMany 2
-
-
-/*-----------------------------------------------------------------------------
- * Client Initialisation Message
- *
- * Once the client and server are sure that they're happy to talk to one
- * another, the client sends an initialisation message.  At present this
- * message only consists of a boolean indicating whether the server should try
- * to share the desktop by leaving other clients connected, or give exclusive
- * access to this client by disconnecting all other clients.
- */
-
-typedef union {
-    uint8_t shared;
-    uint8_t flags;
-} rfbClientInitMsg;
-
-#define sz_rfbClientInitMsg 1
-
-
-/*-----------------------------------------------------------------------------
- * Server Initialisation Message
- *
- * After the client initialisation message, the server sends one of its own.
- * This tells the client the width and height of the server's framebuffer,
- * its pixel format and the name associated with the desktop.
- */
-
-typedef struct {
-    uint16_t framebufferWidth;
-    uint16_t framebufferHeight;
-    rfbPixelFormat format;	/* the server's preferred pixel format */
-    uint32_t nameLength;
-    /* followed by char name[nameLength] */
-} rfbServerInitMsg;
-
-#define sz_rfbServerInitMsg (8 + sz_rfbPixelFormat)
-
-
-/*
- * Following the server initialisation message it's up to the client to send
- * whichever protocol messages it wants.  Typically it will send a
- * SetPixelFormat message and a SetEncodings message, followed by a
- * FramebufferUpdateRequest.  From then on the server will send
- * FramebufferUpdate messages in response to the client's
- * FramebufferUpdateRequest messages.  The client should send
- * FramebufferUpdateRequest messages with incremental set to true when it has
- * finished processing one FramebufferUpdate and is ready to process another.
- * With a fast client, the rate at which FramebufferUpdateRequests are sent
- * should be regulated to avoid hogging the network.
- */
-
-
-
-/*****************************************************************************
- *
- * Message types
- *
- *****************************************************************************/
-
-/* server -> client */
-
-#define rfbFramebufferUpdate 0
-#define rfbSetColourMapEntries 1
-#define rfbBell 2
-#define rfbServerCutText 3
-/* Modif sf at 2002 */
-#define rfbResizeFrameBuffer 4
-#define rfbPalmVNCReSizeFrameBuffer 0xF
-
-/* client -> server */
-
-#define rfbSetPixelFormat 0
-#define rfbFixColourMapEntries 1	/* not currently supported */
-#define rfbSetEncodings 2
-#define rfbFramebufferUpdateRequest 3
-#define rfbKeyEvent 4
-#define rfbPointerEvent 5
-#define rfbClientCutText 6
-/* Modif sf at 2002 - actually bidirectionnal */
-#define rfbFileTransfer 7
-/* Modif sf at 2002 */
-#define rfbSetScale 8
-/* Modif rdv at 2002 */
-#define rfbSetServerInput	9
-/* Modif rdv at 2002 */
-#define rfbSetSW	10
-/* Modif sf at 2002 - TextChat - Bidirectionnal */
-#define rfbTextChat	11
-/* Modif cs at 2005 */
-/* PalmVNC 1.4 & 2.0 SetScale Factor message */
-#define rfbPalmVNCSetScaleFactor 0xF
-/* Xvp message - bidirectional */
-#define rfbXvp 250
-
-
-
-
-/*****************************************************************************
- *
- * Encoding types
- *
- *****************************************************************************/
-
-#define rfbEncodingRaw 0
-#define rfbEncodingCopyRect 1
-#define rfbEncodingRRE 2
-#define rfbEncodingCoRRE 4
-#define rfbEncodingHextile 5
-#define rfbEncodingZlib 6
-#define rfbEncodingTight 7
-#define rfbEncodingTightPng 0xFFFFFEFC /* -260 */
-#define rfbEncodingZlibHex 8
-#define rfbEncodingUltra 9
-#define rfbEncodingUltra2   10
-#define rfbEncodingZRLE 16
-#define rfbEncodingZYWRLE 17
-
-#define rfbEncodingH264               0x48323634
-
-/* Cache & XOR-Zlib - rdv at 2002 */
-#define rfbEncodingCache                 0xFFFF0000
-#define rfbEncodingCacheEnable           0xFFFF0001
-#define rfbEncodingXOR_Zlib              0xFFFF0002
-#define rfbEncodingXORMonoColor_Zlib     0xFFFF0003
-#define rfbEncodingXORMultiColor_Zlib    0xFFFF0004
-#define rfbEncodingSolidColor            0xFFFF0005
-#define rfbEncodingXOREnable             0xFFFF0006
-#define rfbEncodingCacheZip              0xFFFF0007
-#define rfbEncodingSolMonoZip            0xFFFF0008
-#define rfbEncodingUltraZip              0xFFFF0009
-
-/* Xvp pseudo-encoding */
-#define rfbEncodingXvp 			 0xFFFFFECB
-
-/*
- * Special encoding numbers:
- *   0xFFFFFD00 .. 0xFFFFFD05 -- subsampling level
- *   0xFFFFFE00 .. 0xFFFFFE64 -- fine-grained quality level (0-100 scale)
- *   0xFFFFFF00 .. 0xFFFFFF0F -- encoding-specific compression levels;
- *   0xFFFFFF10 .. 0xFFFFFF1F -- mouse cursor shape data;
- *   0xFFFFFF20 .. 0xFFFFFF2F -- various protocol extensions;
- *   0xFFFFFF30 .. 0xFFFFFFDF -- not allocated yet;
- *   0xFFFFFFE0 .. 0xFFFFFFEF -- quality level for JPEG compressor;
- *   0xFFFFFFF0 .. 0xFFFFFFFF -- cross-encoding compression levels.
- */
-
-#define rfbEncodingFineQualityLevel0   0xFFFFFE00
-#define rfbEncodingFineQualityLevel100 0xFFFFFE64
-#define rfbEncodingSubsamp1X           0xFFFFFD00
-#define rfbEncodingSubsamp4X           0xFFFFFD01
-#define rfbEncodingSubsamp2X           0xFFFFFD02
-#define rfbEncodingSubsampGray         0xFFFFFD03
-#define rfbEncodingSubsamp8X           0xFFFFFD04
-#define rfbEncodingSubsamp16X          0xFFFFFD05
-
-#define rfbEncodingCompressLevel0  0xFFFFFF00
-#define rfbEncodingCompressLevel1  0xFFFFFF01
-#define rfbEncodingCompressLevel2  0xFFFFFF02
-#define rfbEncodingCompressLevel3  0xFFFFFF03
-#define rfbEncodingCompressLevel4  0xFFFFFF04
-#define rfbEncodingCompressLevel5  0xFFFFFF05
-#define rfbEncodingCompressLevel6  0xFFFFFF06
-#define rfbEncodingCompressLevel7  0xFFFFFF07
-#define rfbEncodingCompressLevel8  0xFFFFFF08
-#define rfbEncodingCompressLevel9  0xFFFFFF09
-
-#define rfbEncodingXCursor         0xFFFFFF10
-#define rfbEncodingRichCursor      0xFFFFFF11
-#define rfbEncodingPointerPos      0xFFFFFF18
-
-#define rfbEncodingLastRect           0xFFFFFF20
-#define rfbEncodingNewFBSize          0xFFFFFF21
-
-#define rfbEncodingQualityLevel0   0xFFFFFFE0
-#define rfbEncodingQualityLevel1   0xFFFFFFE1
-#define rfbEncodingQualityLevel2   0xFFFFFFE2
-#define rfbEncodingQualityLevel3   0xFFFFFFE3
-#define rfbEncodingQualityLevel4   0xFFFFFFE4
-#define rfbEncodingQualityLevel5   0xFFFFFFE5
-#define rfbEncodingQualityLevel6   0xFFFFFFE6
-#define rfbEncodingQualityLevel7   0xFFFFFFE7
-#define rfbEncodingQualityLevel8   0xFFFFFFE8
-#define rfbEncodingQualityLevel9   0xFFFFFFE9
-
-// adzm - 2010-07 - Extended clipboard support
-// Havn't heard from the RealVNC folk; this will do for now.
-#define rfbEncodingExtendedClipboard  0xC0A1E5CE
-
-/* LibVNCServer additions.   We claim 0xFFFE0000 - 0xFFFE00FF */
-#define rfbEncodingKeyboardLedState   0xFFFE0000
-#define rfbEncodingSupportedMessages  0xFFFE0001
-#define rfbEncodingSupportedEncodings 0xFFFE0002
-#define rfbEncodingServerIdentity     0xFFFE0003
-
-
-/*****************************************************************************
- *
- * Server -> client message definitions
- *
- *****************************************************************************/
-
-
-/*-----------------------------------------------------------------------------
- * FramebufferUpdate - a block of rectangles to be copied to the framebuffer.
- *
- * This message consists of a header giving the number of rectangles of pixel
- * data followed by the rectangles themselves.  The header is padded so that
- * together with the type byte it is an exact multiple of 4 bytes (to help
- * with alignment of 32-bit pixels):
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbFramebufferUpdate */
-    uint8_t pad;
-    uint16_t nRects;
-    /* followed by nRects rectangles */
-} rfbFramebufferUpdateMsg;
-
-#define sz_rfbFramebufferUpdateMsg 4
-
-/*
- * Each rectangle of pixel data consists of a header describing the position
- * and size of the rectangle and a type word describing the encoding of the
- * pixel data, followed finally by the pixel data.  Note that if the client has
- * not sent a SetEncodings message then it will only receive raw pixel data.
- * Also note again that this structure is a multiple of 4 bytes.
- */
-
-typedef struct {
-    rfbRectangle r;
-    uint32_t encoding;	/* one of the encoding types rfbEncoding... */
-} rfbFramebufferUpdateRectHeader;
-
-#define sz_rfbFramebufferUpdateRectHeader (sz_rfbRectangle + 4)
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * Supported Messages Encoding.  This encoding does not contain any pixel data.
- * Instead, it contains 2 sets of bitflags.  These bitflags indicate what messages
- * are supported by the server.
- * rect->w contains byte count
- */
-
-typedef struct {
-  uint8_t client2server[32]; /* maximum of 256 message types (256/8)=32 */
-  uint8_t server2client[32]; /* maximum of 256 message types (256/8)=32 */
-} rfbSupportedMessages;
-
-#define sz_rfbSupportedMessages 64
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * Supported Encodings Encoding.  This encoding does not contain any pixel data.
- * Instead, it contains a list of (uint32_t) Encodings supported by this server.
- * rect->w contains byte count
- * rect->h contains encoding count
- */
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * Server Identity Encoding.  This encoding does not contain any pixel data.
- * Instead, it contains a text string containing information about the server.
- * ie: "x11vnc: 0.8.1 lastmod: 2006-04-25 (libvncserver 0.9pre)\0"
- * rect->w contains byte count
- */
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * Raw Encoding.  Pixels are sent in top-to-bottom scanline order,
- * left-to-right within a scanline with no padding in between.
- */
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * KeyboardLedState Encoding.  The X coordinate contains the Locked Modifiers
- * so that a remote troubleshooter can identify that the users 'Caps Lock' 
- * is set...   (It helps a *lot* when the users are untrained)
- */
-#define rfbKeyboardMaskShift        1
-#define rfbKeyboardMaskCapsLock     2
-#define rfbKeyboardMaskControl      4
-#define rfbKeyboardMaskAlt          8
-#define rfbKeyboardMaskMeta        16
-#define rfbKeyboardMaskSuper       32
-#define rfbKeyboardMaskHyper       64
-#define rfbKeyboardMaskNumLock    128
-#define rfbKeyboardMaskScrollLock 256
-#define rfbKeyboardMaskAltGraph   512
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * CopyRect Encoding.  The pixels are specified simply by the x and y position
- * of the source rectangle.
- */
-
-typedef struct {
-    uint16_t srcX;
-    uint16_t srcY;
-} rfbCopyRect;
-
-#define sz_rfbCopyRect 4
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * RRE - Rise-and-Run-length Encoding.  We have an rfbRREHeader structure
- * giving the number of subrectangles following.  Finally the data follows in
- * the form [<bgpixel><subrect><subrect>...] where each <subrect> is
- * [<pixel><rfbRectangle>].
- */
-
-typedef struct {
-    uint32_t nSubrects;
-} rfbRREHeader;
-
-#define sz_rfbRREHeader 4
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * CoRRE - Compact RRE Encoding.  We have an rfbRREHeader structure giving
- * the number of subrectangles following.  Finally the data follows in the form
- * [<bgpixel><subrect><subrect>...] where each <subrect> is
- * [<pixel><rfbCoRRERectangle>].  This means that
- * the whole rectangle must be at most 255x255 pixels.
- */
-
-typedef struct {
-    uint8_t x;
-    uint8_t y;
-    uint8_t w;
-    uint8_t h;
-} rfbCoRRERectangle;
-
-#define sz_rfbCoRRERectangle 4
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * Hextile Encoding.  The rectangle is divided up into "tiles" of 16x16 pixels,
- * starting at the top left going in left-to-right, top-to-bottom order.  If
- * the width of the rectangle is not an exact multiple of 16 then the width of
- * the last tile in each row will be correspondingly smaller.  Similarly if the
- * height is not an exact multiple of 16 then the height of each tile in the
- * final row will also be smaller.  Each tile begins with a "subencoding" type
- * byte, which is a mask made up of a number of bits.  If the Raw bit is set
- * then the other bits are irrelevant; w*h pixel values follow (where w and h
- * are the width and height of the tile).  Otherwise the tile is encoded in a
- * similar way to RRE, except that the position and size of each subrectangle
- * can be specified in just two bytes.  The other bits in the mask are as
- * follows:
- *
- * BackgroundSpecified - if set, a pixel value follows which specifies
- *    the background colour for this tile.  The first non-raw tile in a
- *    rectangle must have this bit set.  If this bit isn't set then the
- *    background is the same as the last tile.
- *
- * ForegroundSpecified - if set, a pixel value follows which specifies
- *    the foreground colour to be used for all subrectangles in this tile.
- *    If this bit is set then the SubrectsColoured bit must be zero.
- *
- * AnySubrects - if set, a single byte follows giving the number of
- *    subrectangles following.  If not set, there are no subrectangles (i.e.
- *    the whole tile is just solid background colour).
- *
- * SubrectsColoured - if set then each subrectangle is preceded by a pixel
- *    value giving the colour of that subrectangle.  If not set, all
- *    subrectangles are the same colour, the foreground colour;  if the
- *    ForegroundSpecified bit wasn't set then the foreground is the same as
- *    the last tile.
- *
- * The position and size of each subrectangle is specified in two bytes.  The
- * Pack macros below can be used to generate the two bytes from x, y, w, h,
- * and the Extract macros can be used to extract the x, y, w, h values from
- * the two bytes.
- */
-
-#define rfbHextileRaw			(1 << 0)
-#define rfbHextileBackgroundSpecified	(1 << 1)
-#define rfbHextileForegroundSpecified	(1 << 2)
-#define rfbHextileAnySubrects		(1 << 3)
-#define rfbHextileSubrectsColoured	(1 << 4)
-
-#define rfbHextilePackXY(x,y) (((x) << 4) | (y))
-#define rfbHextilePackWH(w,h) ((((w)-1) << 4) | ((h)-1))
-#define rfbHextileExtractX(byte) ((byte) >> 4)
-#define rfbHextileExtractY(byte) ((byte) & 0xf)
-#define rfbHextileExtractW(byte) (((byte) >> 4) + 1)
-#define rfbHextileExtractH(byte) (((byte) & 0xf) + 1)
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * zlib - zlib compressed Encoding.  We have an rfbZlibHeader structure
- * giving the number of bytes following.  Finally the data follows is
- * zlib compressed version of the raw pixel data as negotiated.
- * (NOTE: also used by Ultra Encoding)
- */
-
-typedef struct {
-    uint32_t nBytes;
-} rfbZlibHeader;
-
-#define sz_rfbZlibHeader 4
-
-#ifdef LIBVNCSERVER_HAVE_LIBZ
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * Tight and TightPng Encoding.
- *
- *-- TightPng is like Tight but basic compression is not used, instead PNG
- *   data is sent.
- *
- *-- The first byte of each Tight-encoded rectangle is a "compression control
- *   byte". Its format is as follows (bit 0 is the least significant one):
- *
- *   bit 0:    if 1, then compression stream 0 should be reset;
- *   bit 1:    if 1, then compression stream 1 should be reset;
- *   bit 2:    if 1, then compression stream 2 should be reset;
- *   bit 3:    if 1, then compression stream 3 should be reset;
- *   bits 7-4: if 1000 (0x08), then the compression type is "fill",
- *             if 1001 (0x09), then the compression type is "jpeg",
- *             (Tight only) if 1010 (0x0A), then the compression type is
- *               "basic" and no Zlib compression was used,
- *             (Tight only) if 1110 (0x0E), then the compression type is
- *               "basic", no Zlib compression was used, and a "filter id" byte
- *               follows this byte,
- *             (TightPng only) if 1010 (0x0A), then the compression type is
- *               "png",
- *             if 0xxx, then the compression type is "basic" and Zlib
- *               compression was used,
- *             values greater than 1010 are not valid.
- *
- * If the compression type is "basic" and Zlib compression was used, then bits
- * 6..4 of the compression control byte (those xxx in 0xxx) specify the
- * following:
- *
- *   bits 5-4:  decimal representation is the index of a particular zlib
- *              stream which should be used for decompressing the data;
- *   bit 6:     if 1, then a "filter id" byte is following this byte.
- *
- *-- The data that follows after the compression control byte described
- * above depends on the compression type ("fill", "jpeg", "png" or "basic").
- *
- *-- If the compression type is "fill", then the only pixel value follows, in
- * client pixel format (see NOTE 1). This value applies to all pixels of the
- * rectangle.
- *
- *-- If the compression type is "jpeg" or "png", the following data stream
- * looks like this:
- *
- *   1..3 bytes:  data size (N) in compact representation;
- *   N bytes:     JPEG or PNG image.
- *
- * Data size is compactly represented in one, two or three bytes, according
- * to the following scheme:
- *
- *  0xxxxxxx                    (for values 0..127)
- *  1xxxxxxx 0yyyyyyy           (for values 128..16383)
- *  1xxxxxxx 1yyyyyyy zzzzzzzz  (for values 16384..4194303)
- *
- * Here each character denotes one bit, xxxxxxx are the least significant 7
- * bits of the value (bits 0-6), yyyyyyy are bits 7-13, and zzzzzzzz are the
- * most significant 8 bits (bits 14-21). For example, decimal value 10000
- * should be represented as two bytes: binary 10010000 01001110, or
- * hexadecimal 90 4E.
- *
- *-- If the compression type is "basic" and bit 6 of the compression control
- * byte was set to 1, then the next (second) byte specifies "filter id" which
- * tells the decoder what filter type was used by the encoder to pre-process
- * pixel data before the compression. The "filter id" byte can be one of the
- * following:
- *
- *   0:  no filter ("copy" filter);
- *   1:  "palette" filter;
- *   2:  "gradient" filter.
- *
- *-- If bit 6 of the compression control byte is set to 0 (no "filter id"
- * byte), or if the filter id is 0, then raw pixel values in the client
- * format (see NOTE 1) will be compressed. See below details on the
- * compression.
- *
- *-- The "gradient" filter pre-processes pixel data with a simple algorithm
- * which converts each color component to a difference between a "predicted"
- * intensity and the actual intensity. Such a technique does not affect
- * uncompressed data size, but helps to compress photo-like images better. 
- * Pseudo-code for converting intensities to differences is the following:
- *
- *   P[i,j] := V[i-1,j] + V[i,j-1] - V[i-1,j-1];
- *   if (P[i,j] < 0) then P[i,j] := 0;
- *   if (P[i,j] > MAX) then P[i,j] := MAX;
- *   D[i,j] := V[i,j] - P[i,j];
- *
- * Here V[i,j] is the intensity of a color component for a pixel at
- * coordinates (i,j). MAX is the maximum value of intensity for a color
- * component.
- *
- *-- The "palette" filter converts true-color pixel data to indexed colors
- * and a palette which can consist of 2..256 colors. If the number of colors
- * is 2, then each pixel is encoded in 1 bit, otherwise 8 bits is used to
- * encode one pixel. 1-bit encoding is performed such way that the most
- * significant bits correspond to the leftmost pixels, and each raw of pixels
- * is aligned to the byte boundary. When "palette" filter is used, the
- * palette is sent before the pixel data. The palette begins with an unsigned
- * byte which value is the number of colors in the palette minus 1 (i.e. 1
- * means 2 colors, 255 means 256 colors in the palette). Then follows the
- * palette itself which consist of pixel values in client pixel format (see
- * NOTE 1).
- *
- *-- The pixel data is compressed using the zlib library. But if the data
- * size after applying the filter but before the compression is less then 12,
- * then the data is sent as is, uncompressed. Four separate zlib streams
- * (0..3) can be used and the decoder should read the actual stream id from
- * the compression control byte (see NOTE 2).
- *
- * If the compression is not used, then the pixel data is sent as is,
- * otherwise the data stream looks like this:
- *
- *   1..3 bytes:  data size (N) in compact representation;
- *   N bytes:     zlib-compressed data.
- *
- * Data size is compactly represented in one, two or three bytes, just like
- * in the "jpeg" compression method (see above).
- *
- *-- NOTE 1. If the color depth is 24, and all three color components are
- * 8-bit wide, then one pixel in Tight encoding is always represented by
- * three bytes, where the first byte is red component, the second byte is
- * green component, and the third byte is blue component of the pixel color
- * value. This applies to colors in palettes as well.
- *
- *-- NOTE 2. The decoder must reset compression streams' states before
- * decoding the rectangle, if some of bits 0,1,2,3 in the compression control
- * byte are set to 1. Note that the decoder must reset zlib streams even if
- * the compression type is "fill", "jpeg" or "png".
- *
- *-- NOTE 3. The "gradient" filter and "jpeg" compression may be used only
- * when bits-per-pixel value is either 16 or 32, not 8.
- *
- *-- NOTE 4. The width of any Tight-encoded rectangle cannot exceed 2048
- * pixels. If a rectangle is wider, it must be split into several rectangles
- * and each one should be encoded separately.
- *
- */
-
-#define rfbTightExplicitFilter         0x04
-#define rfbTightFill                   0x08
-#define rfbTightJpeg                   0x09
-#define rfbTightNoZlib                 0x0A
-#define rfbTightPng                    0x0A
-#define rfbTightMaxSubencoding         0x0A
-
-/* Filters to improve compression efficiency */
-#define rfbTightFilterCopy             0x00
-#define rfbTightFilterPalette          0x01
-#define rfbTightFilterGradient         0x02
-
-#endif
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * h264 - h264 encoding.  We have an rfbH264Header structure
- * giving the number of bytes following.  Finally the data follows is
- * h264 encoded frame.
- */
-
-typedef struct {
-    uint32_t nBytes;
-	uint32_t slice_type;
-	uint32_t width;
-	uint32_t height;
-} rfbH264Header;
-
-#define sz_rfbH264Header 16
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * XCursor encoding. This is a special encoding used to transmit X-style
- * cursor shapes from server to clients. Note that for this encoding,
- * coordinates in rfbFramebufferUpdateRectHeader structure hold hotspot
- * position (r.x, r.y) and cursor size (r.w, r.h). If (w * h != 0), two RGB
- * samples are sent after header in the rfbXCursorColors structure. They
- * denote foreground and background colors of the cursor. If a client
- * supports only black-and-white cursors, it should ignore these colors and
- * assume that foreground is black and background is white. Next, two bitmaps
- * (1 bits per pixel) follow: first one with actual data (value 0 denotes
- * background color, value 1 denotes foreground color), second one with
- * transparency data (bits with zero value mean that these pixels are
- * transparent). Both bitmaps represent cursor data in a byte stream, from
- * left to right, from top to bottom, and each row is byte-aligned. Most
- * significant bits correspond to leftmost pixels. The number of bytes in
- * each row can be calculated as ((w + 7) / 8). If (w * h == 0), cursor
- * should be hidden (or default local cursor should be set by the client).
- */
-
-typedef struct {
-    uint8_t foreRed;
-    uint8_t foreGreen;
-    uint8_t foreBlue;
-    uint8_t backRed;
-    uint8_t backGreen;
-    uint8_t backBlue;
-} rfbXCursorColors;
-
-#define sz_rfbXCursorColors 6
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * RichCursor encoding. This is a special encoding used to transmit cursor
- * shapes from server to clients. It is similar to the XCursor encoding but
- * uses client pixel format instead of two RGB colors to represent cursor
- * image. For this encoding, coordinates in rfbFramebufferUpdateRectHeader
- * structure hold hotspot position (r.x, r.y) and cursor size (r.w, r.h).
- * After header, two pixmaps follow: first one with cursor image in current
- * client pixel format (like in raw encoding), second with transparency data
- * (1 bit per pixel, exactly the same format as used for transparency bitmap
- * in the XCursor encoding). If (w * h == 0), cursor should be hidden (or
- * default local cursor should be set by the client).
- */
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * ZRLE - encoding combining Zlib compression, tiling, palettisation and
- * run-length encoding.
- */
-
-typedef struct {
-    uint32_t length;
-} rfbZRLEHeader;
-
-#define sz_rfbZRLEHeader 4
-
-#define rfbZRLETileWidth 64
-#define rfbZRLETileHeight 64
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * ZLIBHEX - zlib compressed Hextile Encoding.  Essentially, this is the
- * hextile encoding with zlib compression on the tiles that can not be
- * efficiently encoded with one of the other hextile subencodings.  The
- * new zlib subencoding uses two bytes to specify the length of the
- * compressed tile and then the compressed data follows.  As with the
- * raw sub-encoding, the zlib subencoding invalidates the other
- * values, if they are also set.
- */
-
-#define rfbHextileZlibRaw		(1 << 5)
-#define rfbHextileZlibHex		(1 << 6)
-#define rfbHextileZlibMono		(1 << 7)
-
-
-/*-----------------------------------------------------------------------------
- * SetColourMapEntries - these messages are only sent if the pixel
- * format uses a "colour map" (i.e. trueColour false) and the client has not
- * fixed the entire colour map using FixColourMapEntries.  In addition they
- * will only start being sent after the client has sent its first
- * FramebufferUpdateRequest.  So if the client always tells the server to use
- * trueColour then it never needs to process this type of message.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbSetColourMapEntries */
-    uint8_t pad;
-    uint16_t firstColour;
-    uint16_t nColours;
-
-    /* Followed by nColours * 3 * uint16_t
-       r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */
-
-} rfbSetColourMapEntriesMsg;
-
-#define sz_rfbSetColourMapEntriesMsg 6
-
-
-
-/*-----------------------------------------------------------------------------
- * Bell - ring a bell on the client if it has one.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbBell */
-} rfbBellMsg;
-
-#define sz_rfbBellMsg 1
-
-
-
-/*-----------------------------------------------------------------------------
- * ServerCutText - the server has new text in its cut buffer.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbServerCutText */
-    uint8_t pad1;
-    uint16_t pad2;
-    uint32_t length;
-    /* followed by char text[length] */
-} rfbServerCutTextMsg;
-
-#define sz_rfbServerCutTextMsg 8
-
-
-// adzm - 2010-07 - Extended clipboard support
-// this struct is used as the data within an rfbServerCutTextMsg or rfbClientCutTextMsg.
-typedef struct {
-	uint32_t flags;       // see rfbExtendedClipboardDataFlags
-
-	// followed by unsigned char data[(rfbServerCutTextMsg|rfbClientCutTextMsg).length - sz_rfbExtendedClipboardData]
-} rfbExtendedClipboardData;
-
-#define sz_rfbExtendedClipboardData 4
-
-typedef enum {
-	// formats
-	clipText		= 0x00000001,	// Unicode text (UTF-8 encoding)
-	clipRTF			= 0x00000002,	// Microsoft RTF format
-	clipHTML		= 0x00000004,	// Microsoft HTML clipboard format
-	clipDIB			= 0x00000008,	// Microsoft DIBv5
-	// line endings are not touched and remain as \r\n for Windows machines. Terminating NULL characters are preserved.
-
-	// Complex formats
-	// These formats should also have 3 more CARD32 values after rfbExtendedClipboardData.flags. This will allow them
-	// to set up more complex messages (such as preview) or subformats (such as lossless, png, jpeg, lossy) etc.
-	// The rest should follow the standard format of a 32-bit length of the uncompressed data, followed by the data.
-	//
-	// Please note none of these are implemented yet, but seem obvious enough that their values are reserved here
-	// for posterity.
-	clipFiles		= 0x00000010,	// probably also more than one file
-	clipFormatMask	= 0x0000FFFF,
-
-	// reserved
-	clipReservedMask= 0x00FF0000,	// more than likely will be used for more formats, but may be used for more actions
-									// or remain unused for years to come.
-
-	// actions
-	clipCaps		= 0x01000000,	// which formats are supported / desired.
-									// Message data should include limits on maximum automatic uncompressed data size for each format
-									// in 32-bit values (in order of enum value). If the data exceeds that value, it must be requested.
-									// This can be used to disable the clipboard entirely by setting no supported formats, or to
-									// only enable manual clipboard transfers by setting the maximum sizes to 0.
-									// can be combined with other actions to denote actions that are supported
-									// The server must send this to the client to notify that it understands the new clipboard format.
-									// The client may respond with its own clipCaps; otherwise the server should use the defaults.
-									// Currently, the defaults are the messages and formats defined in this initial implementation
-									// that are common to both server and viewer:
-									//    clipCaps | clipRequest | clipProvide | (clipNotify if viewer, clipPeek if server)
-									//    clipText | clipRTF | clipHTML | clipDIB
-									//    (Note that clipNotify is only relevant from server->viewer, and clipPeek is only relevant
-									//     from viewer->server. Therefore they are left out of the defaults but can be set with the
-									//     rest of the caps if desired.)
-									// It is also strongly recommended to set up maximum sizes for the formats since currently
-									// the data is sent synchronously and cannot be interrupted. If data exceeds the maximum size,
-									// then the server should send the clipNotify so the client may send clipRequest. Current default 
-									// limits were somewhat arbitrarily chosen as 2mb (10mb for text) and 0 for image
-									// Note that these limits are referring to the length of uncompressed data.
-	clipRequest		= 0x02000000,	// request clipboard data (should be combined with desired formats)
-									// Message should be empty
-									// Response should be a clipProvide message with appropriate formats. This should ignore any
-									// maximum size limitations specified in clipCaps.
-	clipPeek		= 0x04000000,	// Peek at what is currently available in the clipboard.
-									// Message should be empty
-									// Respond with clipNotify including all available formats in the flags
-	clipNotify		= 0x08000000,	// notify that the formats combined with the flags are available for transfer.
-									// Message should be empty
-									// When a clipProvide message is received, then all formats notified as being available are 
-									// invalidated. Therefore, when implementing, ensure that clipProvide messages are sent before
-									// clipNotify messages, specifically when in response to a change in the clipboard
-	clipProvide		= 0x10000000,	// send clipboard data (should be combined with sent formats)
-									// All message data including the length is compressed by a single zlib stream.
-									// First is the 32-bit length of the uncompressed data, followed by the data itself
-									// Repeat for each format listed in order of enum value
-									// Invalidate any formats that were notified as being available.
-	clipActionMask	= 0xFF000000,
-
-	clipInvalid		= 0xFFFFFFFF,
-
-} rfbExtendedClipboardDataFlags;
-
-
-
-
-
-/*-----------------------------------------------------------------------------
- * //  Modif sf at 2002
- * FileTransferMsg - The client sends FileTransfer message.
- * Bidirectional message - Files can be sent from client to server & vice versa
- */
-
-typedef struct _rfbFileTransferMsg {
-    uint8_t type;			/* always rfbFileTransfer */
-    uint8_t contentType;  /*  See defines below */
-    uint8_t contentParam;/*  Other possible content classification (Dir or File name, etc..) */
-    uint8_t pad;         /* It appears that UltraVNC *forgot* to Swap16IfLE(contentParam) */
-    uint32_t size;		/*  FileSize or packet index or error or other  */
-/*  uint32_t sizeH;		 Additional 32Bits params to handle big values. Only for V2 (we want backward compatibility between all V1 versions) */
-    uint32_t length;
-    /* followed by data char text[length] */
-} rfbFileTransferMsg;
-
-#define sz_rfbFileTransferMsg	12
-
-#define rfbFileTransferVersion  2 /*  v1 is the old FT version ( <= 1.0.0 RC18 versions) */
-
-/*  FileTransfer Content types and Params defines */
-#define rfbDirContentRequest	1 /*  Client asks for the content of a given Server directory */
-#define rfbDirPacket			2 /*  Full directory name or full file name. */
-								  /*  Null content means end of Directory */
-#define rfbFileTransferRequest	3 /*  Client asks the server for the transfer of a given file */
-#define rfbFileHeader			4 /*  First packet of a file transfer, containing file's features */
-#define rfbFilePacket			5 /*  One chunk of the file */
-#define rfbEndOfFile			6 /*  End of file transfer (the file has been received or error) */
-#define rfbAbortFileTransfer	7 /*  The file transfer must be aborted, whatever the state */
-#define rfbFileTransferOffer	8 /*  The client offers to send a file to the server */
-#define rfbFileAcceptHeader		9 /*  The server accepts or rejects the file */
-#define rfbCommand				10 /*  The Client sends a simple command (File Delete, Dir create etc...) */
-#define rfbCommandReturn		11 /*  The Client receives the server's answer about a simple command */
-#define rfbFileChecksums		12 /*  The zipped checksums of the destination file (Delta Transfer) */
-#define rfbFileTransferAccess	14 /*  Request FileTransfer authorization */
-
-								/*  rfbDirContentRequest client Request - content params  */
-#define rfbRDirContent			1 /*  Request a Server Directory contents */
-#define rfbRDrivesList			2 /*  Request the server's drives list */
-#define rfbRDirRecursiveList	3 /*  Request a server directory content recursive sorted list */
-#define rfbRDirRecursiveSize	4 /*  Request a server directory content recursive size */
-
-								/*  rfbDirPacket & rfbCommandReturn  server Answer - content params */
-#define rfbADirectory			1 /*  Reception of a directory name */
-#define rfbAFile				2 /*  Reception of a file name  */
-#define rfbADrivesList			3 /*  Reception of a list of drives */
-#define rfbADirCreate			4 /*  Response to a create dir command  */
-#define rfbADirDelete			5 /*  Response to a delete dir command  */
-#define rfbAFileCreate			6 /*  Response to a create file command  */
-#define rfbAFileDelete			7 /*  Response to a delete file command  */
-#define rfbAFileRename			8 /*  Response to a rename file command  */
-#define rfbADirRename			9 /*  Response to a rename dir command  */
-#define rfbADirRecursiveListItem	10 
-#define rfbADirRecursiveSize		11 
-
-								/*  rfbCommand Command - content params */
-#define rfbCDirCreate			1 /*  Request the server to create the given directory */
-#define rfbCDirDelete			2 /*  Request the server to delete the given directory */
-#define rfbCFileCreate			3 /*  Request the server to create the given file */
-#define rfbCFileDelete			4 /*  Request the server to delete the given file */
-#define rfbCFileRename			5 /*  Request the server to rename the given file  */
-#define rfbCDirRename			6 /*  Request the server to rename the given directory */
-
-								/*  Errors - content params or "size" field */
-#define rfbRErrorUnknownCmd     1  /*  Unknown FileTransfer command. */
-#define rfbRErrorCmd			0xFFFFFFFF/*  Error when a command fails on remote side (ret in "size" field) */
-
-#define sz_rfbBlockSize			8192  /*  Size of a File Transfer packet (before compression) */
-#define rfbZipDirectoryPrefix   "!UVNCDIR-\0" /*  Transfered directory are zipped in a file with this prefix. Must end with "-" */
-#define sz_rfbZipDirectoryPrefix 9 
-#define rfbDirPrefix			"[ "
-#define rfbDirSuffix			" ]"		
-
-
-
-/*-----------------------------------------------------------------------------
- * Modif sf at 2002
- * TextChatMsg - Utilized to order the TextChat mode on server or client
- * Bidirectional message
- */
-
-typedef struct _rfbTextChatMsg {
-    uint8_t type;			/* always rfbTextChat */
-    uint8_t pad1;         /*  Could be used later as an additionnal param */
-    uint16_t pad2;		/*  Could be used later as text offset, for instance */
-    uint32_t length;      /*  Specific values for Open, close, finished (-1, -2, -3) */
-    /* followed by char text[length] */
-} rfbTextChatMsg;
-
-#define sz_rfbTextChatMsg 8
-
-#define rfbTextMaxSize		4096
-#define rfbTextChatOpen		0xFFFFFFFF 
-#define rfbTextChatClose	0xFFFFFFFE  
-#define rfbTextChatFinished 0xFFFFFFFD  
-
-
-/*-----------------------------------------------------------------------------
- * Xvp Message
- * Bidirectional message
- * A server which supports the xvp extension declares this by sending a message
- * with an Xvp_INIT xvp-message-code when it receives a request from the client
- * to use the xvp Pseudo-encoding. The server must specify in this message the
- * highest xvp-extension-version it supports: the client may assume that the
- * server supports all versions from 1 up to this value. The client is then
- * free to use any supported version. Currently, only version 1 is defined.
- *
- * A server which subsequently receives an xvp Client Message requesting an
- * operation which it is unable to perform, informs the client of this by
- * sending a message with an Xvp_FAIL xvp-message-code, and the same
- * xvp-extension-version as included in the client's operation request.
- *
- * A client supporting the xvp extension sends this to request that the server
- * initiate a clean shutdown, clean reboot or abrupt reset of the system whose
- * framebuffer the client is displaying.
- */
-
-
-typedef struct {
-    uint8_t type;			/* always rfbXvp */
-	uint8_t pad;
-	uint8_t version;	/* xvp extension version */
-	uint8_t code;      	/* xvp message code */
-} rfbXvpMsg;
-
-#define sz_rfbXvpMsg (4)
-
-/* server message codes */
-#define rfbXvp_Fail 0
-#define rfbXvp_Init 1
-/* client message codes */
-#define rfbXvp_Shutdown 2
-#define rfbXvp_Reboot 3
-#define rfbXvp_Reset 4
-
-
-/*-----------------------------------------------------------------------------
- * Modif sf at 2002
- * ResizeFrameBuffer - The Client must change the size of its framebuffer  
- */
-
-typedef struct _rfbResizeFrameBufferMsg {
-    uint8_t type;			/* always rfbResizeFrameBuffer */
-	uint8_t pad1;
-	uint16_t framebufferWidth;	/*  FrameBuffer width */
-	uint16_t framebufferHeigth;	/*  FrameBuffer height */
-} rfbResizeFrameBufferMsg;
-
-#define sz_rfbResizeFrameBufferMsg 6
-
-
-/*-----------------------------------------------------------------------------
- * Copyright (C) 2001 Harakan Software
- * PalmVNC 1.4 & 2.? ResizeFrameBuffer message
- * ReSizeFrameBuffer - tell the RFB client to alter its framebuffer, either
- * due to a resize of the server desktop or a client-requested scaling factor.
- * The pixel format remains unchanged.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbReSizeFrameBuffer */
-	uint8_t pad1;
-	uint16_t desktop_w;	/* Desktop width */
-	uint16_t desktop_h;	/* Desktop height */
-	uint16_t buffer_w;	/* FrameBuffer width */
-	uint16_t buffer_h;	/* Framebuffer height */
-    uint16_t pad2;
-
-} rfbPalmVNCReSizeFrameBufferMsg;
-
-#define sz_rfbPalmVNCReSizeFrameBufferMsg (12)
-
-
-
-
-/*-----------------------------------------------------------------------------
- * Union of all server->client messages.
- */
-
-typedef union {
-    uint8_t type;
-    rfbFramebufferUpdateMsg fu;
-    rfbSetColourMapEntriesMsg scme;
-    rfbBellMsg b;
-    rfbServerCutTextMsg sct;
-	rfbResizeFrameBufferMsg rsfb;
-	rfbPalmVNCReSizeFrameBufferMsg prsfb; 
-	rfbFileTransferMsg ft;
-	rfbTextChatMsg tc;
-        rfbXvpMsg xvp;
-} rfbServerToClientMsg;
-
-
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * RDV Cache Encoding.  
- * special is not used at this point, can be used to reset cache or other specials
- * just put it to make sure we don't have to change the encoding again.  
- */
-
-typedef struct {
-    uint16_t special;
-} rfbCacheRect;
-
-#define sz_rfbCacheRect 2
-
-
-
-
-/*****************************************************************************
- *
- * Message definitions (client -> server)
- *
- *****************************************************************************/
-
-
-/*-----------------------------------------------------------------------------
- * SetPixelFormat - tell the RFB server the format in which the client wants
- * pixels sent.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbSetPixelFormat */
-    uint8_t pad1;
-    uint16_t pad2;
-    rfbPixelFormat format;
-} rfbSetPixelFormatMsg;
-
-#define sz_rfbSetPixelFormatMsg (sz_rfbPixelFormat + 4)
-
-
-/*-----------------------------------------------------------------------------
- * FixColourMapEntries - when the pixel format uses a "colour map", fix
- * read-only colour map entries.
- *
- *    ***************** NOT CURRENTLY SUPPORTED *****************
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbFixColourMapEntries */
-    uint8_t pad;
-    uint16_t firstColour;
-    uint16_t nColours;
-
-    /* Followed by nColours * 3 * uint16_t
-       r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */
-
-} rfbFixColourMapEntriesMsg;
-
-#define sz_rfbFixColourMapEntriesMsg 6
-
-
-/*-----------------------------------------------------------------------------
- * SetEncodings - tell the RFB server which encoding types we accept.  Put them
- * in order of preference, if we have any.  We may always receive raw
- * encoding, even if we don't specify it here.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbSetEncodings */
-    uint8_t pad;
-    uint16_t nEncodings;
-    /* followed by nEncodings * uint32_t encoding types */
-} rfbSetEncodingsMsg;
-
-#define sz_rfbSetEncodingsMsg 4
-
-
-/*-----------------------------------------------------------------------------
- * FramebufferUpdateRequest - request for a framebuffer update.  If incremental
- * is true then the client just wants the changes since the last update.  If
- * false then it wants the whole of the specified rectangle.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbFramebufferUpdateRequest */
-    uint8_t incremental;
-    uint16_t x;
-    uint16_t y;
-    uint16_t w;
-    uint16_t h;
-} rfbFramebufferUpdateRequestMsg;
-
-#define sz_rfbFramebufferUpdateRequestMsg 10
-
-
-/*-----------------------------------------------------------------------------
- * KeyEvent - key press or release
- *
- * Keys are specified using the "keysym" values defined by the X Window System.
- * For most ordinary keys, the keysym is the same as the corresponding ASCII
- * value.  Other common keys are:
- *
- * BackSpace		0xff08
- * Tab			0xff09
- * Return or Enter	0xff0d
- * Escape		0xff1b
- * Insert		0xff63
- * Delete		0xffff
- * Home			0xff50
- * End			0xff57
- * Page Up		0xff55
- * Page Down		0xff56
- * Left			0xff51
- * Up			0xff52
- * Right		0xff53
- * Down			0xff54
- * F1			0xffbe
- * F2			0xffbf
- * ...			...
- * F12			0xffc9
- * Shift		0xffe1
- * Control		0xffe3
- * Meta			0xffe7
- * Alt			0xffe9
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbKeyEvent */
-    uint8_t down;			/* true if down (press), false if up */
-    uint16_t pad;
-    uint32_t key;			/* key is specified as an X keysym */
-} rfbKeyEventMsg;
-
-#define sz_rfbKeyEventMsg 8
-
-
-/*-----------------------------------------------------------------------------
- * PointerEvent - mouse/pen move and/or button press.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbPointerEvent */
-    uint8_t buttonMask;		/* bits 0-7 are buttons 1-8, 0=up, 1=down */
-    uint16_t x;
-    uint16_t y;
-} rfbPointerEventMsg;
-
-#define rfbButton1Mask 1
-#define rfbButton2Mask 2
-#define rfbButton3Mask 4
-#define rfbButton4Mask 8
-#define rfbButton5Mask 16
-/* RealVNC 335 method */
-#define rfbWheelUpMask rfbButton4Mask
-#define rfbWheelDownMask rfbButton5Mask
-
-#define sz_rfbPointerEventMsg 6
-
-
-
-/*-----------------------------------------------------------------------------
- * ClientCutText - the client has new text in its cut buffer.
- */
-
-typedef struct {
-    uint8_t type;			/* always rfbClientCutText */
-    uint8_t pad1;
-    uint16_t pad2;
-    uint32_t length;
-    /* followed by char text[length] */
-} rfbClientCutTextMsg;
-
-#define sz_rfbClientCutTextMsg 8
-
-
-
-/*-----------------------------------------------------------------------------
- * sf at 2002 - Set Server Scale
- * SetServerScale - Server must change the scale of the client buffer.
- */
-
-typedef struct _rfbSetScaleMsg {
-    uint8_t type;			/* always rfbSetScale */
-    uint8_t scale;		/* Scale value 1<sv<n */
-    uint16_t pad;
-} rfbSetScaleMsg;
-
-#define sz_rfbSetScaleMsg 4
-
-
-/*-----------------------------------------------------------------------------
- * Copyright (C) 2001 Harakan Software
- * PalmVNC 1.4 & 2.? SetScale Factor message 
- * SetScaleFactor - tell the RFB server to alter the scale factor for the
- * client buffer.
- */
-typedef struct {
-    uint8_t type;			/* always rfbPalmVNCSetScaleFactor */
-
-    uint8_t scale;		/* Scale factor (positive non-zero integer) */
-    uint16_t pad2;
-} rfbPalmVNCSetScaleFactorMsg;
-
-#define sz_rfbPalmVNCSetScaleFactorMsg (4)
-
-
-/*-----------------------------------------------------------------------------
- * rdv at 2002 - Set input status
- * SetServerInput - Server input is dis/enabled
- */
-
-typedef struct _rfbSetServerInputMsg {
-    uint8_t type;			/* always rfbSetScale */
-    uint8_t status;		/* Scale value 1<sv<n */
-    uint16_t pad;
-} rfbSetServerInputMsg;
-
-#define sz_rfbSetServerInputMsg 4
-
-/*-----------------------------------------------------------------------------
- * rdv at 2002 - Set SW
- * SetSW - Server SW/full desktop
- */
-
-typedef struct _rfbSetSWMsg {
-    uint8_t type;			/* always rfbSetSW */
-    uint8_t status;		
-    uint16_t x;
-    uint16_t y;
-} rfbSetSWMsg;
-
-#define sz_rfbSetSWMsg 6
-
-
-
-/*-----------------------------------------------------------------------------
- * Union of all client->server messages.
- */
-
-typedef union {
-    uint8_t type;
-    rfbSetPixelFormatMsg spf;
-    rfbFixColourMapEntriesMsg fcme;
-    rfbSetEncodingsMsg se;
-    rfbFramebufferUpdateRequestMsg fur;
-    rfbKeyEventMsg ke;
-    rfbPointerEventMsg pe;
-    rfbClientCutTextMsg cct;
-	rfbSetScaleMsg ssc;
-	rfbPalmVNCSetScaleFactorMsg pssf;
-	rfbSetServerInputMsg sim;
-	rfbFileTransferMsg ft;
-	rfbSetSWMsg sw;
-	rfbTextChatMsg tc;
-        rfbXvpMsg xvp;
-} rfbClientToServerMsg;
-
-/* 
- * vncauth.h - describes the functions provided by the vncauth library.
- */
-
-#define MAXPWLEN 8
-#define CHALLENGESIZE 16
-
-extern int rfbEncryptAndStorePasswd(char *passwd, char *fname);
-extern char *rfbDecryptPasswdFromFile(char *fname);
-extern void rfbRandomBytes(unsigned char *bytes);
-extern void rfbEncryptBytes(unsigned char *bytes, char *passwd);
-
-
-#endif
diff --git a/lib/resources/ar.qm b/lib/resources/ar.qm
deleted file mode 100644
index 431bd8b..0000000
Binary files a/lib/resources/ar.qm and /dev/null differ
diff --git a/lib/resources/ar.ts b/lib/resources/ar.ts
deleted file mode 100644
index 04ed40c..0000000
--- a/lib/resources/ar.ts
+++ /dev/null
@@ -1,1762 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="ar_SA">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>حول "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>حول</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>المؤلفون</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>ترجمة </translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation>لم تتم ترجمة اللغة الحالية بعد (أو اللغة الأم هي الإنجليزية)‏
-إذا رغبت في ترجمة "آيتالك" إلى لغتك المحلية أو لغة أخرى أو إذا رغبت في تحسين الترجمة الحالية، يرجى الإتصال بمطور "آيتالك" !‏</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>ترخيص</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished">‏"آيتالك" - التعليم والتعلم الذكي بواسطة الحاسب {2004-2013 ?}</translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation>ليس لهذه الحلقة </translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>دائما لهذه الحلقة </translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation>تأكيد أمكانية الوصول لسطح المكتب</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation>المستخدم 1% عند  المضيف 2% يريد الوصول إلى سطح مكتبك. هل ترغب في منح صلاحية الوصول؟</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>مدير - غرفة الدراسة </translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>استخدم مكان العمل هذا لإدارة حاسباتك وغرف الدراسة بطريقة سهلة </translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>هنا تتم إدارة الحاسبات وغرف الدراسة. يمكنك إضافة حاسبات وغرف دراسة بالنقر على يمين هذه القائمة </translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>غرف دراسة/ حاسبات</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>عنوان آي بيه</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>أسماء المستخدمين</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>عرض أسماء المستخدمين</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>استخدم قائمة السياق (زر الفأرة الأيمن) لإضافة أو إزالة الحاسبات او غرف الدراسة</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>تصدير إلى ملف نصي </translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>استخدم هذا الزر لتصدير قائمة الحاسبات وأسماء المستخدمين الحالية إلى ملف نصي. يمكنك استخدام هذا الملف لاحقا لجمع الملفات بعد إنتهاء الإختبار. يكون هذا الإجراء ضروريا، في بعض الأحيان، إذ أن بعض المستخدمين قد </translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>إخفاء حاسب المعلِّم</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>عرض أو إخفاء</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>تحرير الإعدادات</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>إزالة </translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>عرض كافة الحاسبات في غرفة الدراسة  </translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>إخفاء كافة الحاسبات في غرفة الدراسة </translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>تحرير الاسم</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>إزالة غرفة دراسة </translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>إضافة حاسب</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>إضافة غرفة دراسة</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>تعذر العثور على ملف التهيئة </translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>تعذر فتح ملف تهيئة 1%‏
-يلزم إضافة غرفة دراسة واحدة على الأقل وحاسبات باستخدام واجهة مدير غرفة الدراسة التي يمكنك الوصول إليها من الشريط الجانبي الأيسر </translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>خطأ في ملف التهيئة </translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>حدث خطأ أثناء التحليل اللغوي لملف التهيئة 1%‏ 
-يرجى تحريره وإلا سيلزم حذف هذا الملف وسيتعين عليك إضافة كافة غرف الدراسة والحاسبات مرة أخرى.‏  </translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>حدث خطأ أثناء التحليل اللغوي لملف التهيئة 1%‏ 
-يرجى تحريره وإلا سيلزم حذف الملف </translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>إختيار ملف الخرج</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>(*.txt) ملفات نصية</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>عمليات لـلمختار</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>عمليات</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>عمليات لـ 1%‏</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>اسم جديد لغرفة الدراسة </translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>يرجى إدخال اسم جديد لغرفة الدراسة "1%".‏</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>هل ترغب فعلا في إزالة غرفة الدراسة "1%"؟
-ستتم أيضا إزالة كافة الحاسبات التي بالغرفة</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>غرفة دراسة مفقودة</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>قبل إضافة حاسب، يلزم إنشاء غرفة دراسة
-هل ترغب في إنشاء غرفة دراسة الآن؟</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>غرفة دراسة جديدة</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>يرجى إدخال اسم غرفة الدراسة التي ترغب في إنشائها.‏</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>حالة غير معروفة </translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>لم يسجل مستخدم دخول على النظام </translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>لا يمكن الوصول إلى الجهاز المضيف </translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>تشغيل العرض التعريفي</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>سطح المكتب مغلق</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>هل ترغب فعلا في إخراج كافة المستخدمين من كافة الحاسبات الظاهرة </translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>هل ترغب فعلا في إخراج كافة المستخدمين من كافة الحاسبات المختارة </translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>إخراج المستخدم</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>هل ترغب فعلا في إعادة تشغيل كافة الحاسبات الظاهرة  </translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>هل ترغب فعلا في إعادة تشغيل كافة الحاسبات المختارة  </translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>إعادة تشغيل الحاسبات </translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>هل ترغب فعلا في إغلاق كافة الحاسبات الظاهرة  </translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>هل ترغب فعلا في إغلاق كافة الحاسبات المختارة  </translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>عنوان ماك غير صحيح</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>لقد أدخلت عنوان ماك غير صحيح. أترك الحقل خاليا أو أدخل عنوان ماك صحيح (استخدم علامة ":" كفاصل)‏ </translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation>إعدادات الحاسب الفرعي</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>عنوانIP أو اسم المضيف</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation>قم بادخال عنوانIP أو اسم مضيف يمكن لنظام "آيتالك" من خلاله الوصول إلى الحاسب الفرعي (استخدم العلامة ":" لتعريف رقم منفذ إختياري).</translation>
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>الاسم</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation>كنية إختيارية للمضيف تعرض على نظام "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation>IPعنوان</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation>عنوان ماك لجهاز الحاسب الفرعي - يستخدم فقط لتشغيل الحاسب الفرعي</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>غرفة دراسة</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>النوع</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>حاسب الطالب</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>حاسب المدرِّس</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>حاسب آخرغير معرّف</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation>عنوان IP أو مضيف مفقود</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation>لم تحدد عنوان IP أو مضيف لهذا الحاسب</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>الفترات الفاصلة بين التحديثات</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation>يمكنك هنا ضبط الفترة الفاصلة بين عمليات تحديث الأجهزة الفرعية. القيم العالية يترتب عليها حركة أقل على الشبكة واستخدام أقل لمعالج هذا الحاسب </translation>
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation>ثواني</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>واجهة المستخدم</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation>عدم إظهار تلميحات بالونية لازر شريط الأدوات</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation>أشِّرعلى هذا الخيار إن كنت لا ترغب في ظهور تلميحات بالونية عن تمرير مؤشر الفأرة فوق لازر شريط الأدوات</translation>
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>تعطيل تلميحات البالونة</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation>عدم إظهار النصوص على لازر شريط الأدوات</translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>تعطيل النصوص على أزر شريط الادوات </translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>دورك (الحاجة وفق المفاتيح)‏</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation>يمكنك هنا إختيار دورك. قم بتغيير هذا الاعداد فقط إن كنت تعرف ما تفعله؛ وإلا سوف لن تتمكن من الوصول الى أي أجهزة فرعية حتى تستعيد دورك القديم.  </translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>مدرِّس</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>المدير</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>معاون</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>أخرى</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>إعدادات للدخول المتعدد</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>النطاق</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>النقر المزدوج على نافذة حاسب فرعي</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation>يمكنك هنا تحديد ما سيحدث في حالة النقر المزدوج على نافذة حاسب فرعي</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>تحكم من بُعد</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>معاينة حيّة ملء الشاشة</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation>يرجى ملاحظة أن بعض التغييرات لن يتم تفعيلها إلا بعد إعادة تشغيل نظام "آيتالك"‏</translation>
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>تهيئة نظام "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>على هذه الشاشة يمكنك تخصيص "آيتالك" وفق إحتياجاتك</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>موافق</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>عرض تعريفي لـ "آيتالك"‏</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>خطأ في عملية التوثيق</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>حاول أحد ( 1IP%) الوصول إلى هذا الحاسب ولكن لم يتمكن من توثيق هويته بنجاح</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>ثعذر التحقق بسبب كثرة المحاولات.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>أخفقت عملية توثيق الدخول بسبب المحاولات المتعددة .‏</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>قام خادم شبكة الحوسبة الإلكترونية بقطع التوصيل</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation>مساعد مفتاح وصول "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation>إنشاء أو استيراد مفاتيح وصول لـ "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation>سيقوم المساعد بمساعدتك في إنشاء او استيراد مفتاح وصول لنظام "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation>كيف يعمل؟</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation>يتألف مفتاح وصول "آيتالك" من جزئين مترابطين، جزء خاص وجزء عام
-باستخدام الجزء الخاص من المفتاح، يمكن لمستخدم الحاسب الرئيسي الوصول إلى الحاسب الفرعي. من الضروري منح صلاحية قراءة ملف المفاتيح الخاصة فقط للمستخدمين المصرح لهم.   
-يستخدم الجزء العام من المفتاح على الحاسب الفرعي للتأكد من أن أي طلب اتصال وارد مصرح به </translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation>حالة المساعد</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation>يرجى إختيار إما إنشاء مفاتيح وصول جديدة أو استيراد مفتاح عام إلى الحاسب الفرعي</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation>إنشاء مفاتيح وصول جديدة (الحاسب الرئيسي)‏</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation>مجموعة أزر حالة المساعد</translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation>استيراد مفتاح عام (حاسب فرعي)‏</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation>إختيار دور المستخدم</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation>يرجى إختيار دور المستخدم الذي ترغب في إنشاء أو استيراد مفاتيح وصول له. </translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>مدرِّس</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>المدير</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation>عضو فريق الدعم</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>آخر</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation>تسمح أدوار المستخدم باستخدام عدة مفاتيح وصول بالتوازي. مثلا، يمكن تخصيص مفاتيح مختلفة لوصول المدرس لكل غرفة دراسة بينما تكون مفاتيح الوصول للدعم متشابهة لكل أعضاء المدرسة.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation>أدلة </translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation>تصدير جزء المفتاح العام (الحاسب الرئيسي)‏</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation>استخدم دليل وجهة مخصص لمفاتيح الوصول </translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation>يرجى تحديد موقع مفاتيح الوصول المطلوب استيرادها</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation>ملخص</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation>سيتم إتخاذ الإجراءات التالية</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation>إنشاء مفاتيح وصول جديدة</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation>استيراد مفتاح وصول عام من</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation><غير معروف></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>مفتاح أو مفاتيح الوصول إلى الكتابة إلى </translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>تصدير مفتاح عام إلى</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation>تهيئة دور المستخدم</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation>إختيار الدليل الذي سيتم تصدير الملف إليه</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation> (*.key.txt) ملفات رئيسية</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation>مفتاح عام غير صحيح</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation>الملف المختار لا يحتوي مفتاح وصول عام صحيح لنظام "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation>اختيار دليل الوجهة</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation>إنشاء مفتاح وصول</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation>تعذر إزالة الملف 1% الموجود مسبقا</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation>أخفقت عملية تصدير مفتاح الوصول العام من 1% إلى 2%‏</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation>تم إنشاء مفاتيح الوصول بنجاح وكتابتها في 1% و 2%.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation>حدث خطأ أثناء عملية إنشاء مفاتيح الوصول. من المرجح أنه غير مسموح لك بالكتابة على الأدلة المختارة</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation>استيراد مفتاح عام</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation>حدث خطأ أثناء عملية استيراد مفاتيح الوصول العام. من المرجح أنه غير مسموح لك بقراءة مفتاح المصدر أو الكتابة إلى ملف الوجهة. </translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation>تم استيراد المفتاح العام إلى 1% بنجاح</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>قفل الشاشة</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation>الدخول إلى محرر المجموعة</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation>يرجى إضافة المجموعات التي يجب السماح لأعضائها بالوصول إلى الحاسبات على شبكة "آيتالك" </translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation>جميع المجموعات</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation>مجموعات ذات صلاحيات على "آيتالك"</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>عمليات</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation>عام</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>خروج</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation>كونسولة إدارة نظام "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>خادم "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>مسارات</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>توثيق</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>خدمة "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>إخفاء أيقونة الصينية</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>التشغيل آليا</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>حجج إضافية</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>بدء الخدمة </translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>إيقاف الخدمة</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>بيان:‏</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>توقف</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation>دخول</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>دليل ملف الدخول</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>مستوى الدخول</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>لا شيء</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>فقط الرسائل الحرجة</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>أخطاء ورسائل حرجة </translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>تحذيرات وأخطاء </translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>المعلومات، والتحذيرات والأخطاء</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>رسائل الأخطاء وما عداها</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>تحديد حجم ملف الدخول</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>ام بي</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>مسح كافة ملفات الدخول</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>إلتقاط صورة سطح المكتب</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>تمكين إلتقاط صورة نوافذ طبقية (شبه شفافة)‏</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>دقة منخفضة (وضعية تيربو)‏</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>خادم العرض</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>شبكة</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>منفذ الخادم الأساسي</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>منفذ خادم العرض </translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>تمكين إستثناء الجدار الناري</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>ملفات التهيئة</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>تهيئة عامة </translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>تهيئة شخصية </translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>أدلة البيانات</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>لقطات</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>طرق التوثيق</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>إدارة مفاتيح الوصول</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>إعدادات الدخول</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation>‎‏&‏ملف‏‎</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>‏&مساعدة</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>‏&خروج</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation>Ctrl+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>‏&حفظ الاعدادات في الملف‎‏‏</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>حفظ الاعدادات في الملف</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation>Ctrl+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>تحميل الاعدادات من الملف</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation>Ctrl+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>حول "آيتالك"</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>حول"كيو تي"</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation>الشاشة الرئيسية</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation>شريط الأدوات</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>كونسولة إدارة نظام "آيتالك" 1%‏</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>تشغيل</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>تحميل الاعدادات من الملف</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation>(*.xml) XML ملفات </translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>حفظ الاعدادات إلى الملف</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>إعدادات لم يتم حفظها</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>هنالك إعدادات لم يتم حفظها. هل ترغب في الخروج على أي حال؟</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>تعيئة غير قابلة للكتابة</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>يبدو ان ملف التهيئة المحلية الخلفي أن التهيئة غير قابلة للكتابة! يرجى تشغيل كونسولة إدارة "آيتالك" بصلاحيات عالية </translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>تم تطبيق كافة الإعدادات بنجاح</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>حدث خطأ أثناء عملية تطبيق الإعدادات</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>"آيتالك"</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>لا يوجد وصول للكتابة </translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>تعذر قراءة أوكتابة أو إنشاء دليل لـ 1%! لتشغيل "آيتالك" يرجى التأكد من أن لديك صلاحية إنشاء أو كتابة هذا الدليل. </translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>غرفة دراسة</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>تحويل غرفة الدراسة</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>أنقر على هذا المفتاح، لفتح قائمة يمكنك منها إختيار الفصل النشط   </translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>أنقر على هذا المفتاح، للتحول بين الفصول</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>وضع اللمحة العامة</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>لمحة عامة</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>هذه هي الوضعية الافتراضية لنظام "آيتالك" وتمكنك من الاطلاع على كافة الحاسبات الظاهرة. أيضا أنقر على هذا الزر لفتح محطات العمل المغلقة أو الخروج من وضعية العرض التعريفي.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>عرض تعريفي ملء الشاشة</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>عرض تعريفي ملء الشاشة</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>إيقاف العرض التعريفي</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>بهذا الوضع، يتم عرض شاشتك على نافذة على كافة الحاسبات الظاهرة. كما أنه لا يمكن للمستخدمين أداء عمل آخر إذ أن جميع الأجهزة تكون مغلقة في هذا الوضع.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>نافذة عرض تعريفي</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>نافذة عرض تعريفي</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>بهذا الوضع، يتم عرض شاشتك على نافذة على كافة الحاسبات الظاهرة. يمكن للمستخدمين التحول إلى نوافذ أخرى ومواصلة عملهم </translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>إغلاق أو فتح أسطح المكاتب</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>إغلاق الجميع</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>فتح الجميع</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>للفت إنتباه كافة المستخدمين، يمكنك إغلاق سطح المكتب لديهم باستخدام هذا الزر. في هذا الوضع، يتم قفل جميع أجهزة الإدخال وتصبح الشاشات سوداء.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>إرسال رسالة نصية</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>رسالة نصيِّة</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>استخدم هذا الزر لإرسال رسالة نصية لجميع المستخدمين، مثلا لإخطارهم بمهمة جديدة أو ما شابه.‏</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>تشغيل الحاسبات</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>تشغيل</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>أنقر هذا الزر لتشغيل جميع الحاسبات الظاهرة. بهذه الآلية، لن تحتاج إلى تشغيل كل حاسب يدويا </translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>إطفاء الحاسبات</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>إطفاء</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>لإطفاء كافة الحاسبات الظاهرة (مثلا، بعد إنتهاء الدرس) يمكنك النقر على هذا الزر.‏</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>الدعم</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>دعم مباشر</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>إذا رغبت في دعم أحد المستخدمين لحاسب معين يمكنك النقر على هذا الزر وادخال اسم المضيف أو عنوان IP بعد ذلك.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>ضبط  أو محاذاة</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>قم بضبط النوافذ ومقاسها</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>عند النقر على هذا الزر، يتم ضبط نوافذ الحاسب الفرعي على أكبر مقاس ممكن لها. كما تتم محاذاة جميع النوافذ.‏</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>معاينة آلية</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>إعادة ترتيب النوافذ ومقاساتها آليا</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>عند النقر على هذا الزر، تتم إعادة ترتيب وضبط كافة النوافذ الظاهرة.‏</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>التحكم الرئيسي في "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>تحكم من بُعد</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>تعذر تعديل خاصية التشغيل الآلي لنظام "آيتالك"</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>تعذر تعديل خاصية حجج الخدمة لنظام "آيتالك"</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>تعذر تغيير تهيئة الجدار الناري لنظام "آيتالك" </translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation>إزالة الأخطاء </translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation>تمكين تحويل سطح المكتب لقفل الشاشة (تجريبي)‏</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation>الدخول إلى خرج الاخطاء القياسية</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation>الدخول إلى نافذة احداث وندوز</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation>خلفي</translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation>VNC عاكس</translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation>خادم العرض 1 "آيتالك"</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation>مسارات تنفيذ متعددة (يمكن تفعيلها عند استخدام ملف شبكة الحوسبة الإلكترونية الخلفي)‏</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation>تمكين خادم HTTP الذي يوفر عارض تطبيقات جافا </translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation>تقرير خادم HTTP</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation>السماح بالتوصيل من المضيف المحلي فقط</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation>توثيق ملف المفاتيح</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation>توثيق الدخول استنادا على قائمة التحكم في الوصول</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation>دليل ملفات المفاتيح العامة الأساسي </translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation>دليل ملفات المفاتيح الخاصة الأساسي </translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation>تشغيل مساعد  ملف المفاتيح</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation>صلاحيات الإدارة </translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation>إختبار</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation>تأكيد الوصول</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation>يمكن تهيئة "آيتالك" بحيث يمكنك طلب السماح من المستخدم للوصول إلى سطح مكتبه عند استخدام طرق توثيق معينة.‏</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation>توثيق الدخول</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation>السماح لذات المستخدم من الوصول إلى  سطح المكتب دون تأكيد. </translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation>إزالة الأخطاء من "آيتالك"</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation>عند مواجهة أخطاء أو سوء تشغيل في "آيتالك" فمن الضروري إخطار المطورين عنهاحتى تتم معالجة الاخطاء في الإصدارات اللاحقة. هذه الصفحة تمكنك من رفع تقرير أخطاء مفيد بكل سهولة.
-
-إذا كان الخطأ غير قابل للنسخ، تجاوز الخطوة 1 الى 3</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation>1)</translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation> مسح ملفات الدخول في القسم "عام"‏</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation>2)</translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation> في قسم "عام" قم بضبط مستوى الدخول عند "رسائل إزالة الأخطاء وغيرها"‏‎‍‎‏‎</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation>3)</translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation> تكرار الإجراءات المؤدية إلى الخطأ أو سوء الأداء  </translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation>4)</translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation> أنقر هذا الزر لحفظ الملف في وجهة معروفة</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation>إنتاج ارشيف تقارير أخطاء</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation>5)</translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation>اذهب إلى http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375" للوصول إلى راصد أخطاء"آيتالك"، افتح ملف أخطاء جديد، صف ما قمت به في الخطوة 3 ثم أرفق الملف الذي حفظته في 
-
-
-ملحوظة: إذا كان الخطأ يشمل حاسب رئيسي وحاسب فرعي، قم بإلحاق أرشيف تقرير الأخطاء لكلا الحاسبين. </translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation>إعادة تشغيل خدمة "آيتالك" </translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation>تم حفظ كافة الإعدادات بنجاح. لتفعيلها يلزم إعادة تشغيل آيتالك". هل ترغب في إعادة التشغيل الآن؟</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation>بدء خدمة "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation>إيقاف خدمة "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation>تحتاج خدمة "آيتالك" للإيقاف الموقت لأجل إزالة ملفات الدخول. هل ترغب في الاستمرار</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation>مسح ملفات الدخول</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation>تمت إزالة جميع ملفات الدخول بنجاح</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation>تعذرت إزالة كافة ملفات الدخول</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation>إختبار توثيق الدخول</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation>نجحت عملية التوثيق عبر بيانات التوثيق المقدمة </translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation>أخفقت عملية التوثيق عبر بيانات التوثيق المقدمة </translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation>حفظ أرشيف تقارير الأخطاء </translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation> لنظام "آيتالك"‏(*.ibra.xml) أرشيف تقارير الاخطاء  </translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation>تم حفظ أرشيف تقارير الاخطاء لنظام "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation>تم حفظ تقرير أرشيفي لأخطاء "آيتالك" على 1%. وهو يحتوي على ملفات دخول "آيتالك" ومعلومات عن نظام التشغيل لديك. يمكنك إلحاقه بتقرير أخطاء. </translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation>تعذر الاتصال بنظام "آيتالك"</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation>تعذر الاتصال بنظام "آيتالك" المحلي. من المرجح إنك أدخلت بيانات توثيق خاطئة، او أن الملفات لم يتم إنشاؤها بطريقة صحيحة. حاول ثانية أو اتصل بمدير النظام لحل هذه المشكلة باستخدام كنسولة إدارة "آيتالك". ‏</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation>يتعذر التوثيق</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>تعذر العثور على ملفات مفاتيح التوثيق أو أن ملفاتك الحالية قديمة. يرجى إنشاء ملفات مفاتيح جديدة باستخدام كونسولة إدارة نظام "آيتالك". عوضا عن ذلك، قم باعداد توثيق الدخول باستخدام كونسولة إدارة نظام "آيتالك"، وإلا سوف </translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>رسالة من المدرس </translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation>مرحبا بك إلى "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>هنا يمكنك رؤية شريط العمل الذي يحتوي على عدة أزر. كل زر متصل بمساحة عمل معينة. يمكنك معاينة مساحات العمل المتاحة عبر النقر على الزر المقابل.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>باستخدام مدير غرفة الدراسة يمكنك إدارة غرفك الدراسية وحاسباتها. كما يمكنك أيضا معاينة المستخدمين الداخلين على النظام.‏</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>إن مساحة عمل اللقطات هي أداة هامة. فهي تمكنك  من إدارة اللقطات التي أخذتها.‏</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>يمكنك، بالطبع، تهيئة "آيتالك". يتم القيام عادة بذلك باستخدام مساحة عمل التهيئة.‏</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>حول "آيتالك"‏</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>لمحة عامة</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>بعض المعلومات الأساسية حول "آيتالك" وكيفية استخدامه.‏</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>يرجى إدخالك اسم المستخدم وكلمة السر الخاصين بك للوصول إلى الحاسبات الفرعية لنظام "آيتالك".‏</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>اسم المستخدم </translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>كلمة السر</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation>الدخول إلى "آيتالك"‏</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>غير قادر على تسجيل الخدمة 1%‏</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>تعذر الاتصال بمدير التحكم في الخدمة (هل لديك الصلاحيات اللازمة؟) - لم يتم تسجيل الخدمة 1%.‏</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>الخدمة 1% مسجلة مسبقا</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>تعذر تسجيل الخدمة 1% ‏</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>تم تسجيل الخدمة 1% بنجاح</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>تعذر إيقاف الخدمة 1% ‏</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>تم إلغاء تسجيل الخدمة 1% ‏</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>الخدمة 1% غير مسجلة وبالتالي لا يمكن إلغاء تسجيلها</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>تعذر إلغاء تسجيل الخدمة 1% ‏</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>تعذر العثور على الخدمة 1% </translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>تعذر الاتصال بمدير التحكم في الخدمة (هل لديك الصلاحيات اللازمة؟) - لم يتم إلغاءتسجيل الخدمة 1%.‏</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>تعذر الاتصال بمدير التحكم في الخدمة (هل لديك الصلاحيات اللازمة؟) - لم يتم إيقاف الخدمة 1%.‏</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>الحاسب الفرعي 1% لنظام "آيتالك" على 2% و3%‏</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>معاينة حية (1% @ 2%)‏</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>تحكم من بُعد (1% @ 2%)‏</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>مستخدم غير معروف</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>معاينة فقط</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>تحكم من بُعد</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>غلق الطالب</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>فتح الطالب</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>لقطة</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>ملء الشاشة</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>نافذة</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>خروج</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>توصيل 1%‏</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>متصل</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation>دخول من بُعد</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation>استخدم هذا الحقل لادخال اسم المستخدم وكلمة السر وإختياريا اسم النطاق. سيتم استخدام هذه المعلومات للدخول إلى الحاسب أو الحاسبات</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>اسم المستخدم </translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>كلمة السر</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>النطاق</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation>تشغيل الأوامر</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation>يرجى إدخال الأوامر المطلوب تشغيلها على الحاسب أو الحاسبات الفرعية. يمكنك الفصل بين الأوامر المتعددة باستخدام أسطر متعددة</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>غير معروف</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>تعذر أخذ لقطة إذ أن الدليل 1% غير موجود ولا يمكن إنشاؤه </translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>لقطة</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>لقطات</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>قم ببساطة بمعالجة اللقطات التي أخذتها باستخدام مساحة العمل هذه.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation>كافة اللقطات التي أخذتها موجودة هنا. يمكنك أخذ لقطات باختيار الدخول الملائم من قائمة السياق على نافذة الحاسب الفرعي. هذه اللقطات يمكن إدارتها باستخدام الأزرار أدناه. </translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>المستخدم</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>مضيف</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>التاريخ</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>الزمن</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>عرض</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>حذف</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation>دعم</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation>يرجى إدخال عنوان IP أو اسم المضيف الذي ترغب في الاتصال به</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>إرسال رسالة نصية</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>استخدم الحقل أدناه لطباعة رسالتك التي سيتم ارسالها الى كافة المستخدمين المختارين</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>انشاء اتصال بـ 1%</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>لمحة عامة</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>عرض على كامل الشاشة</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>عرض على نافذة</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>شاشة مغلقة</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>معاينة حيّة</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>تحكم من بُعد</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>السماح للطالب بالعرض</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>إرسال رسالة نصية</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>إخراج المستخدم</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>أخذ لقطة</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>تشغيل </translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>إعادة تشغيل الحاسب </translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>إطفاء </translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>تنفيذ الأوامر </translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/authors.png b/lib/resources/authors.png
deleted file mode 100644
index 6d9b72f..0000000
Binary files a/lib/resources/authors.png and /dev/null differ
diff --git a/lib/resources/cs.qm b/lib/resources/cs.qm
deleted file mode 100644
index 7869328..0000000
Binary files a/lib/resources/cs.qm and /dev/null differ
diff --git a/lib/resources/cs.ts b/lib/resources/cs.ts
deleted file mode 100644
index 70acd72..0000000
--- a/lib/resources/cs.ts
+++ /dev/null
@@ -1,1766 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="cs_CZ">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">O iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">O programu</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Autoři</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Překlad</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Licence</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Nikdy pro toto sezení</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Vždy pro toto sezení</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Správce třídy</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">V tomto rozhraní můžete snadno spravovat počítače a třídy.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Zde se spravují počítače a učebny. Počítače přidáte kliknutím pravého tlačítka myši v seznamu.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Počítače/třídy</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP-adresa</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Exportovat do textového souboru</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Skrýt učitelské počítače</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Zobrazit/skrýt</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Upravit nastavení</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Odstranit</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Zobrazit všechny počítače ve třídě</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Skrýt všechny počítače ve třídě</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Upravit jméno</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Odstranit třídu</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Přidat počítač</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Přidat třídu</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Nebyl nalezen žádný konfigurační soubor</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Nemohu otevřít konfigurační soubor %1.
-Budete muset přidat alespoň jednu učebny a počítače pomocí Správce tříd, kterého naleznete v programu na levém panelu.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Chyba v konfiguračním souboru</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Chyba při analýze konfiguračního souboru %1.
-Upravte ho prosím ručně. Nebo také můžete tento soubor smazat a přidat všechny třídy a počítače znovu.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Chyba při analýze konfiguračního souboru %1.
-Upravte ho prosím. Jinak byste tento soubor měli smazat.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Vybrat výstupní soubor</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Textové soubory (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Akce</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Akce pro %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Nové jméno třídy</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Zadejte prosím nové jméno pro třídu "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Opravdu si přejete odstranit třídu "%1"?
-Všechny počítače ve třídě budou odstraněny též!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Chybí třída</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Před přidáním počítačů musíte vytvořit alespoň jednu třídu.
-Přejete si nyní vytvořit novou třídu?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nová třída</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Zadejte prosím jméno nové třídy, kterou si přejete vytvořit.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Neznámý stav</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Žádný uživatel není přihlášen</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Počítač není  k dispozici</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Běžící demo</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Desktop zamknut</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Opravdu chcete odhlásit uživatele všech zobrazených počítačů?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odhlásit uživatele</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Opravdu si přejete restartovat všechny zobrazené počítače?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Restartovat počítače</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Opravdu si přejete vypnout všechny zobrazené počítače?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Neplatná MAC-adresa</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Musíte zadat platnou MAC-adresu. Buď zadejte platnou MAC-adresu (oddělovačem je ":"), nebo nechte políčko prázdné.</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Nastavení klienta</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/jméno</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">zadejte IP-adresu nebo jméno počítače, na kterém běží klient iTALC  [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Jméno</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardwarová/MAC-adresa klienta - používá se pouze pro zapínání klien [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Třída</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Typ</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Studentský počítač</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Učitelský počítač</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Jiný/nedefinovaný počítač</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Interval mezi aktualizacemi</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Zde se zadává interval mezi jednotlivými aktualizacemi klientů. Vyš [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">(sp) sekund</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Uživatelské rozhraní</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nezobrazovat tipy v panelu nástrojů</p></body></html [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tuto volbu zaškrněte, pokud se vám nelíbí zobrazování nápovědy v pa [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Bez tipů panelu nástrojů</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Vaše role (vyžaduje odpovídající klíče!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Zde můžete vybrat vaši roli. Volbu měňte pouze pokud skutečně víte co děláte. Jinak se může stát, že nebudete schopni přistupovat k žádným klientům až dokud neobnovíte svou roli.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Učitel</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrátor</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Jiná</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Nastavení pro vícenásobné přihlášení</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Doména</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Dvojklik v okně klienta</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Zde se nastavuje co se má stát, pokud provedete dvojklik v okně klienta.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdálené ovládání</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Zobrazení naživo v celé obrazovce</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Pa [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Konfigurace iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">V tomto praconím prostředí můžete upravit iTALC vašim potřebám.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">Demo iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Chyba autentizace</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Někdo (IP: %1) se pokouší přistupovat k tomuto počítači, ale nedaří se ho autentizovat!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Učitel</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrátor</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Jiná</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">zamknutí obrazovky</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Akce</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Obecné</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Ukončit</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Snímky</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">O iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Nemohu číst/zapisovat nebo vytvořit adresář %1! Pro spuštění iTALC je nutné, abyste měli oprávnění vytvářet a zapisovat do tohoto adresáře.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Třída</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Přepnout třídu</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Kliknutím na toto tlačítko se zobrazí nabídka, kde si budete moci zvolit aktivní třídu.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Klikněte na toto tlačítko a přepněte se mezi třídami.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Přehledový mód</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Přehled</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Toto je výchozí mód iTALC, který vám umožní zobrazit přehled dostupných počítačů. Kliknutím na toto tlačítko odemknete zamknuté stanice nebo opustíte ukázkový mód.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">V tomto módu bude vaše obrazovka zobrazena na všech dostupných počítačích. Mimo to, uživatelé nebudou schopni dělat nic jiného, protože budou jejich vstupní zařízení uzamčeny.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">V tomto módu se vaše obrazovka zobrazí na všech počítačích. Uživatelé přitom budou moci přepínat mezi dalšími oknami a tak může vaše práce pokračovat.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Zamknout/odemknout počítače</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Zamknout vše</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Odemknout vše</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Abyste upoutali pozornost všech uživatelů, můžete jim pomocí tohoto tlačítka uzamknout všechny počítače. V tomto módu budou všechna vstupní zařízení uzamčena a obrazovky budou černé.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslat textovou zprávu</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Textová zpráva</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Pomocí tohoto tlačítka můžete poslat zprávu všem uživatelům, např. zadat jim tak nové úkoly, atd.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Zapne počítače</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Zapnout</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Kliknutím na toto tlačítko zapnete všechny viditelné počítače. Tímto způsobem nebudete muset zapínat každý počítač ručně.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Vypnout</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Pro vypnutí všech zobrazených počítačů (např. na konci hodiny), stačí kliknout na toto tlačítko.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Seřadit/uspořádat</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Uspořádá okna a nastaví jejich velikosti</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Kliknutím na toto tlačítko bude nastavena ta největší možná velikost oken klientů. Kromě toho budou všechna okna srovnána.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Automatický pohled</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automaticky přenastaví okna a jejich velikosti</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Kliknutím na toto tlačítko budou všechna okna přeuspořádána a přizpůsobena.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdálené ovládání</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Zpráva od učitele</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;"> Vítejte v iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Na pracovní ploše jsou vidět různá tlačítka. Každé tlačítko je připojeno k nějaké pracovní ploše. Jednoduše se kliknutím na odpovídající tlačítko podívejte na dostupné pracovní plochy.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Plocha se snímky obrazovky je velmi užitečná. Umožní vám spravovat snímky, které provedete.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Samozřejmě, že můžete nastavovat iTALC. To se obvykle provádí pomocí konfigurační plochy.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">O iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Přehled</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Některé základní informace o iTALC a použití programu.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Uživatelské jméno</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Klient iTALC %1 na %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Nemohu zaregistrovat službu '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Nemohu kontaktovat Správce služeb (máte potřebná oprávnění?!) - služba '%1' nebyla zaregistrována.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Služba '%1' je již registrována.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Nemohu zaregistrovat službu '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Služba '%1' byla úspěšně registrována.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Službu '%1' není možno zastavit.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Služba '%1' byla odregistrována.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Služba '%1' není registrována a z tohoto jí nelze odregistrovat.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Službu '%1' nebylo možno odregistrovat.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Službu '%1' nelze najít.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Nemohu kontakovat Správce služeb (máte potřebná oprávnění?!) - službu '%1' nelze odregistrovat.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Nemohu kontaktovat Správce služeb (máte potřebná oprávnění?!) - služba '%1' nebyla zastavena.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">neznámý uživatel</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Pouze prohlížet</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdálené ovládání</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Zamknout studenta</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Odemknout studenta</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Snímek</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Celá obrazovka</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Okno</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Ukončit</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Připojuji %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Připojeno.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Vzdálené odhlášení</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Uživatelské jméno</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Doména</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Nemohu získat snímek, protože adresář %1 neexistuje a nelze ho vytvořit.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Snímek</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Snímky</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Jednoduše spravuje vámi provedené snímky ploch.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Všechny pořízené snímky se uchovávají zde. Snímky můžete provádět výběrem odpovídající položky v kontextové nabídce klientského okna. Tyto snímky je možno spravovat pomocí tlačítek níže.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Uživatel:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Počítač:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Datum:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Čas:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslat textovou zprávu</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Do políčka níže zadejte vaši zprávu, která bude poslána vybraným uživatelům.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Připojuji se k %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Přehled</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Obrazovka zamknuta</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Zobrazit naživo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdálené ovládání</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Zobrazit studentům demo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslat textovou zprávu</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odhlásit uživatele</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Sejmout obrazovku</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Zapnout</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Restartovat</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Vypnout</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Vykonat příkaz</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/de.qm b/lib/resources/de.qm
deleted file mode 100644
index 9276e1f..0000000
Binary files a/lib/resources/de.qm and /dev/null differ
diff --git a/lib/resources/de.ts b/lib/resources/de.ts
deleted file mode 100644
index 182ad4a..0000000
--- a/lib/resources/de.ts
+++ /dev/null
@@ -1,1762 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="de_DE">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>Über iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>Über</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>Autoren</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Übersetzung</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Lizenz</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation>Nie für diese Sitzung</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Immer für diese Sitzung</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation>Arbeitsflächenzugriff bestätigen</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation>Der Nutzer %1 am Rechner %2 möchte auf Ihre Arbeitsfläche zugreifen. Wollen Sie ihm Zugriff gewähren?</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Klassenraum-Verwaltung</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Nutzen Sie diesen Arbeitsbereich, um Ihre Computer und Klassenräume auf eine einfache Art und Weise zu verwalten.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>An dieser Stelle werden Computer und Klassenräume verwaltet. Sie können Computer oder Klassenräume hinzufügen, indem Sie mit der rechten Maustaste in die Liste klicken.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Klassenräume/Computer</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>IP-Adresse</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Nutzernamen</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>Nutzernamen anzeigen</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Benutzen Sie das Kontextmenü (rechte Maustaste), um Computer und Klassenräume hinzuzufügen/zu entfernen.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>In Text-Datei exportieren</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>Benutzen Sie diesen Button, um diese Liste mit Computern und Nutzernamen in eine Textdatei zu exportieren. Sie können diese Datei später verwenden, um z.B. nach einer Leistungsüberprüfung Dateien einzusammeln. Das ist manchmal nötig, da einige Benutzer möglicherweise früher fertig waren und sich abgemeldet haben, so dass Sie deren Dateien nicht am Ende der Leistungsüberprüfung einsammeln können.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Lehrercomputer ausblenden</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Zeigen/verstecken</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Einstellungen bearbeiten</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Entfernen</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Zeige alle Computer im Klassenraum</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Verstecke alle Computer im Klassenraum</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Name bearbeiten</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Klassenraum entfernen</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Computer hinzufügen</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Klassenraum hinzufügen</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>Keine Konfigurationsdatei gefunden</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>Konnte die Konfigurationsdatei %1 nicht finden. Sie werden mindestens einen Klassenraum sowie Computer mit Hilfe der Klassenraum-Verwaltung hinzufügen müssen. Sie finden die Klassenraum-Verwaltung innerhalb des Programms in der Seitenleiste auf der linken Seite.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Fehler in der Konfigurationsdatei</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>Fehler beim Parsen der Konfigurationsdatei %1.Bitte bearbeiten Sie sie. Andernfalls müssen Sie die Datei löschen und alle Klassenräume und Computer erneut hinzufügen.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Fehler beim Parsen der Konfigurationsdatei %1.
-Bitte bearbeiten Sie diese Datei. Andernfalls sollten Sie sie löschen.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Ausgabe-Datei wählen</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Textdateien (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>Aktionen für ausgewählte</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>Aktionen</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>Aktionen für %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Neuer Name für Klassenraum</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Bitte geben Sie einen neuen Namen für den Klassenraum "%1" ein.</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Sind Sie sicher, dass Sie den Klassenraum "%1" entfernen wollen?
-Alle darin befindlichen Computer werden ebenfalls gelöscht!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>Fehlender Klassenraum</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>Bevor Sie Computer hinzufügen können, müssen Sie mindestens einen Klassenraum erstellen.
-Möchten Sie jetzt einen neuen Klassenraum erstellen?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Neuer Klassenraum</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Bitten geben Sie den Namen des zu erstellenden Klassenraums ein.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>Unbekannter Zustand</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Kein Benutzer angemeldet</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>Rechner nicht erreichbar</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>Demo läuft</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>Arbeitsfläche gesperrt</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Sind Sie sicher, dass Sie alle Nutzer an allen sichtbaren Computern abmelden wollen?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Sind Sie sicher, dass Sie alle Nutzer auf allen markierten Computern abmelden wollen?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Nutzer abmelden</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Sind Sie sicher, dass Sie alle sichtbaren Computer neustarten wollen?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Sind Sie sicher, dass Sie alle gewählten Computer neustarten wollen?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>Computer neustarten</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Sind Sie sicher, dass Sie alle sichtbaren Computer ausschalten wollen?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Sind Sie sicher, dass Sie alle gewählten Computer ausschalten wollen?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>Ungültige MAC-Adresse</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>Sie haben eine ungültige MAC-Adresse angegeben. Entweder Sie lassen das Feld frei oder geben eine gültige MAC-Adresse ein (verwenden Sie ":" als Trennzeichen!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation>Rechner-Einstellungen</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>IP/Rechnername</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Geben Sie eine IP-Adresse oder den Rechnernamen an, unter dem iTALC den Client erreic [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>Name</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation>MAC-Adresse</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-Adresse des Rechners - wird nur zum Anschalten des Rechners benötigt< [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Klassenraum</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>Typ</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>Schülerrechner</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>Lehrercomputer</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>Anderer/undefinierter Computer</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation>Fehlende IP-Adresse/Rechnername</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation>Sie haben keine IP-Adresse oder keinen Rechnernamen für den Rechner angegeben!</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>Aktualisierungsintervall</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier können Sie den Aktualisierungsinterval für die Clients setzen. Höhere Werte resu [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation> Sekunden</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>Benutzeroberfläche</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>Keine Ballon-Tooltips</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Kein Text auf Buttons der Werkzeugleiste</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Ihre Rolle (entspr. Schlüssel nötig!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier können Sie Ihre Rolle setzen. Ändern Sie diese nur, wenn Sie wissen, was sie tun! Anderenfalls werden Sie auf keine Computer zugreifen können, bis Sie ihre alte Rolle wieder hergestellt haben.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Lehrer</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Administrator</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>Support-Mitarbeiter</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Andere</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>Einstellungen für Mehrfach-Anmeldung</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domäne</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>Doppelklick-Aktion für Client-Fenster</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fernsteuern</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>Live im Vollbild anschauen</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Bitte beachten Sie,  [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Ihre iTALC-Konfiguration</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>In diesem Arbeitsbereich können Sie iTALC Ihren Bedürfnissen anpassen.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>Authentifizierungsfehler</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Jemand (IP:%1) hat versucht, auf diesen Computer zuzugreifen, konnte sich jedoch nicht erfolgreich authentifizieren!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>VNC-Authentifizierung aufgrund zu häufiger Versuche fehlgeschlagen.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>VNC-Authentifizierung fehlgeschlagen.</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>VNC-Server hat die Verbindung geschlossen.</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation>iTALC-Schlüsselassistent</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation>iTALC-Schlüssel erzeugen/importieren</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation>Dieser Assistent wird Ihnen dabei helfen, iTALC-Schlüssel zu erstellen oder importieren.</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation>Wie funktioniert's?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation>iTALC-Zugriffsschlüssel bestehen aus zwei zueinander gehörigen Teilen, einem privaten und einem öffentlichen Schlüsselteil.
-
-Mit Hilfe des privaten Schlüssels können Nutzer auf dem Mastercomputer auf Clientcomputer zugreifen. Es ist wichtig, dass nur autorisierte Nutzer Lesezugriff auf die private Schlüsseldatei besitzen.
-
-Der öffentliche Schlüssel wird auf den Clientcomputern genutzt, um für jede eingehende Verbindungsanfrage zu prüfen, ob diese autorisiert ist.</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation>Assistentmodus</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation>Bitte wählen Sie, ob neue Schlüssel erzeugt oder ein öffentlicher Schlüssel auf einen Client importiert werden soll.</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation>Neue Schlüssel erzeugen (Master-Computer)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation>Öffentlichen Schlüssel importieren (Client-Computer)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation>Nutzerrolle auswählen</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation>Bitte wählen Sie eine Nutzerrolle, für die die Schlüssel erzeugt oder importiert werden sollen:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Lehrer</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Administrator</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation>Supportmitarbeiter</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Andere</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation>Nutzerrollen erlauben die gleichzeitige Verwendung von mehreren Zugriffsschlüsseln. Beispielsweise können verschiedene Lehrerschlüssel für jeden Klassenraum eingerichtet werden, während die Zugriffsschlüssel für den Support schulweit einmalig sind.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation>Verzeichnisse</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation>Öffentlichen Schlüssel exportieren (Mastercomputer)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation>Benutzerdefiniertes Zielverzeichnis für Zugriffsschlüssel verwenden</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation>Bitte geben Sie den Ort des öffentlichen Zugriffsschlüssels an, der importiert werden soll.</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation>Zusammenfassung</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation>Die folgenden Aktionen werden durchgeführt:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation>• Neue Zugriffsschlüssel erzeugen</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation>• Öffentlichen Zugriffsschlüssel exportieren aus</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation><unbekannt></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>• Zugriffsschlüssel schreiben nach</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>• Öffentlichen Schlüssel exportieren nach</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation>• Konfigurieren für Nutzerrolle</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation>Verzeichnis wählen, in welches der öffentliche Schlüssel exportiert werden soll</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation>Schlüsseldateien (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation>Ungültiger öffentlicher Schlüssel</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation>Die gewählte Datei beinhaltet keinen gültigen öffentliche iTALC-Zugrifsschlüssel!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation>Zielverzeichnis auswählen</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation>Erstellung des Zugriffschlüssels</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation>Konnte bereits existierende Datei %1 nicht löschen.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation>Der Export des öffentlichen Zugrifsschlüssels von %1 nach %2 ist fehlgeschlagen.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation>Zugrifsschlüssel wurden erfolgreich erstellt und nach %1 und %2 geschrieben.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation>Beim erstellen der Zugrifsschlüssel ist ein Fehler aufgetreten. Sie sind wahrscheinlich nicht berechtigt, in die gewählten Verzeichnisse zu schreiben.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation>Import des öffentlichen Schlüssels</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation>Beim importieren des öffentlichen Zugrifsschlüssels ist ein Fehler aufgetreten. Sie sind wahrscheinlich nicht berechtigt, den Quellschlüssel zu lesen oder die Zieldatei zu schreiben.</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation>Der öffentliche Schlüssel wurde erfolgreich nach %1 importiert.</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>Bildschirmsperre</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation>Anmeldungsgruppeneditor</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation>Bitte fügen Sie die Gruppen hinzu, deren Mitgliedern der Zugriff auf Computern in Ihrem iTALC-Netzwerk gestattet sein soll.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation>Alle Gruppen</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation>Gruppen mit iTALC-Privilegien</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>Aktionen</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation>Allgemein</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Beenden</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation>iTALC Management Console</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>iTALC-Server</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>Pfade</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>Authentifizierung</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>iTALC-Dienst</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>Icon im Systemabschnitt verstecken</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>Autostart</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>Zusätzliche Argumente</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>Dienst starten</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>Dienst stoppen</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>Status:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>Beendet</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation>Logaufzeichnung</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>Logdateiverzeichnis</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>Loglevel</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>Nichts</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>Nur kritische Nachrichten</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>Fehler und kritische Nachrichten</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>Warnungen und Fehler</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>Informationen, Warnungen und Fehler</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>Debugmeldungen und alles andere</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>Logdateigröße begrenzen</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>MB</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>Alle Logdateien leeren</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>Bildschirmaufzeichnung</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>Halbdurchsichtige Fenster (layered windows) aufzeichnen</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>Niedrige Genauigkeit (Turbomodus)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>Demoserver</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>Netzwerk</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>Core-Server-Port</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>Demoserver-Port</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>Firewall-Ausnahme aktivieren</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>Konfigurationsdateien</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>Globale Konfiguration</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>Persönliche Konfiguration</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>Datenverzeichnisse</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Schnappschüsse</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>Authentifizierungsmethoden</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>Schlüsselverwaltung</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>Anmeldeeinstellungen</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation>&Datei</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>&Hilfe</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>&Beenden</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation>Strg+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>Einstellungen in Datei &speichern</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>Einstellungen in Datei speichern</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation>Strg+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>Einstellungen aus Datei &laden</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation>Strg+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Über iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>Über Qt</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>iTALC Management Console %1</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>Läuft</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>Einstellungen aus Datei laden</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation>XML-Dateien (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>Einstellungen in Datei speichern</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>Ungespeicherte Einstellungen</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>Einige Einstellungen sind nicht gespeichert. Trotzdem beenden?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>Konfiguration nicht schreibbar</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>Laut lokalem Konfigurationsbackend ist die Konfiguration nicht scheibbar! Bitte führen Sie die iTALC-Management-Console mit höheren Privilegien aus.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>Alle Einstellungen wurden erfolgreich angewendet.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>Beim Anwenden der Einstellungen ist ein Fehler aufgetreten!</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>Kein Schreibzugriff</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>Konnte das Verzeichnis %1 nicht lesen/schreiben oder erstellen. Um iTALC auszuführen, stellen Sie sicher, dass Sie berechtigt sind, dieses Verzeichnis zu erzeugen oder zu beschreiben.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Klassenraum</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>Klassenraum wechseln</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>Klicken Sie auf diesen Knopf, um ein Menü zu öffnen, in dem sie den aktiven Klassenraum wählen können.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>Klicken Sie auf diesen Knopf, um zwischen Klassenräumen zu wechseln.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>Übersichtsmodus</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>Übersicht</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>Dies ist der Standardmodus in iTALC und ermöglicht es, einen Überblick über alle sichtbaren Computer zu bekommen. Weiterhin werden gesperrte Bildschirme entsperrt oder der Demo-Modus verlassen, wenn Sie auf diesen Knopf klicken.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Vollbild-Demo</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>Vollbild-Demo</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>Demo beenden</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>In diesem Modus wird Ihr Bildschirm auf alle angezeigte Computer übertragen. Weiterhin können die Nutzer nichts anderes machen, da in diesem Modus sämtliche Eingabegeräte gesperrt sind.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Fenster-Demo</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>Fenster-Demo</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>In diesem Modus wird Ihr Bildschirm auf alle angezeigte Computer in einem Fenster übertragen. Die Nutzer sind in der Lage, zu anderen Fenstern zu wechseln und somit ihre Arbeiten fortzusetzen.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>Arbeitsflächen sperren/freigeben</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>Alle sperren</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>Alle freigeben</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>Um die volle Aufmerksamkeit der Nutzer zu erlangen können Sie deren Arbeitsflächen mit Hilfe dieses Knopfes sperren. In diesem Modus werden alle Eingabegeräte gesperrt und der Bildschirm ist schwarz.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Text-Nachricht schicken</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>Text-Nachricht</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>Nutzen Sie diesen Knopf, um an alle Nutzer eine Text-Nachricht zu schicken, beispielsweise um ihnen neue Aufgaben mitzuteilen.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>Computer anschalten</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Anschalten</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>Klicken Sie auf diesen Knopf, um alle angezeigten Computer anzuschalten. Auf diese Weise müssen Sie nicht jeden Computer einzeln per Hand einschalten.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>Computer ausschalten</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Ausschalten</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>Um alle angezeigten Computer herunterzufahren (z.B. nach Stundenende) klicken Sie einfach auf diesen Knopf.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>Unterstützung</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>Direkte Unterstützung</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>Wenn Sie jemanden an einem bestimmten Computer unterstützen wollen, können Sie diesen Button anklicken und anschließend den entsprechenden Rechnernamen oder die IP eingeben.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>Ausrichtung</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>Fenster und deren Größe ausrichten</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>Wenn Sie diesen Knopf anklicken, wird die größt-mögliche Größe für die Fenster eingestellt. Weiterhin werden alle Fenster ausgerichtet.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>Anordnung</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>Automatische Neuanordnung der Fenster und deren Größe</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>Wenn Sie diesen Knopf anklicken werden alle sichtbaren Fenster neu angeordnet und ausgerichtet.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>iTALC Master Steuerung</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fernsteuern</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>Die Autostarteinstellung für den iTALC-Dienst konnte nicht geändert werden.</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>Die zusätzlichen Argumente für den iTALC-Dienst konnten nicht geändert werden.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>Die Firewallkonfiguration für den iTALC-Dienst konnte nicht geändert werden.</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation>Fehlersuche</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation>Desktopwechsel für Bildschirmsperre aktivieren (experimentell)</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation>Nach Standardfehlerausgabe loggen</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation>In Windows-Ereignisanzeige loggen</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation>Backend</translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation>VNC-Reflektor</translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation>iTALC 1 Demoserver</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation>Multithreading (kann aktiviert werden, wenn das VNC-Reflektor-Backend genutzt wird)</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation>HTTP-Server aktivieren, um JavaViewer-Applet bereitzustellen</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation>HTTP-Serverport</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation>Nur Verbindungen vom lokalen Rechner erlauben</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation>Schlüsseldatei-Authentifizierung</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation>ACL-basierte Anmelde-Authentifizierung</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation>Basisverzeichnis der öffentlichen Schlüsseldatei</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation>Basisverzeichnis der privaten Schlüsseldatei</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation>Schlüsseldatei-Assistent starten</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation>Berechtigungen verwalten</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation>Testen</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation>Zugriffsbestätigung</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation>Sie können iTALC so konfigurieren, dass der Nutzer bei bestimmten Authentifizierungsmethoden um Zugriffsbestätigung gebeten wird.</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation>Anmelde-Authentifizierung</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation>Gleichen Nutzer erlauben, ohne Bestätigung auf Arbeitsfläche zuzugreifen</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation>iTALC-Fehlersuche</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation>1)</translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation>Löschen Sie die Logdateien im Abschnitt "Allgemein".</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation>2)</translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation>Setzen Sie den Loglevel im Abschnitt "Allgemein" auf "Debugmeldungen und alles andere".</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation>3)</translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation>Wiederholen Sie die Handlungen, die den Fehler oder das Fehlverhalten hevorrufen.</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation>4)</translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation>Klicken Sie auf den folgenden Knopf und speichern die Datei an eine bekannte Stelle.</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation>Fehlerberichtsarchiv erstellen</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation>5)</translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation>iTALC-Dienst neustarten</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation>Alle Einstellungen wurden erfolgreich gespeichert. Um die Änderungen anzuwenden muss der iTALC-Dienst neugestartet werden. Dienst jetzt neustarten?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation>Starte iTALC-Dienst</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation>Stoppe iTALC-Dienst</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation>Der iTALC-Dienst muss temporär gestoppt werden, um die Logdateien zu entfernen. Fortfahren?</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation>Logdateien gelösch</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation>Alle Logdateien wurden erfolgreich gelöscht.</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation>Konnte nicht alle Logdateien entfernen.</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation>Test der Anmelde-Authentifizierung</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation>Die Authentifizierung mit den angegebenen Anmeldedaten war erfolgreich.</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation>Die Authentifizierung mit den angegebenen Anmeldedaten ist fehlgeschlagen!</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation>Fehlerberichtsarchiv speichern</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation>iTALC-Fehlerberichtsarchiv (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation>iTALC-Fehlerberichtsarchiv gespeichert</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation>Ein iTALC-Fehlerberichtsarchiv wurde nach %1 gespeichert. Es beinhaltet iTALC-Logdateien und Informationen über Ihre Betriebssystem. Sie können es an einen Fehlerbericht anhängen.</translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation>Kein Kontakt zum iTALC-Dienst</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation>Es konnte keine Verbindung zum lokalen iTALC-Dienst hergestellt werden. Wahrscheinlich haben Sie falsche Anmeldedaten eingegeben oder die Schlüsseldateien sind nicht richtig eingerichtet. Versuchen SIe es erneut oder konktaktieren Sie Ihren Administrator, um das Problem mit Hilfe der iTALC-Management-Console zu lösen.</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation>Authentifizierung nicht möglich</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>Es wurden keine Authentifizierungsschlüsseldateien gefunden oder sie sind veraltet. Bitte erstellen Sie neue Schlüsseldateien mit Hilfe der iTALC-Management-Console. Alternativ können Sie die Anmelde-Authentifizierung mit Hilfe der iTALC-Management-Console einrichten. Andernfalls werden Sie nicht in der Lage sein, mit iTALC auf andere Rechner zuzugreifen.</translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Nachricht vom Lehrer</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Willkommen bei iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>Hier sehen Sie die Arbeitsleiste mit ihren verschiedenen Knöpfe. Jeder Knopf ist mit einem Arbeitsbereich verbunden. Schauen Sie sich einfach einmal die verfügbaren Arbeitsbereiche an, indem Sie auf den entsprechenden Knopf klicken.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>Mit Hilfe der Klassenraum-Verwaltung können Sie Ihre Klassenräume und Computer verwalten. Sie können außerdem sehen, welche Nutzer angemeldet sind.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>Der Schnappschuss-Arbeitsbereich ist ein sehr nützliches Werzeug, mit dem Sie ihre Schnappschüsse verwalten können.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Natürlich können Sie iTALC auch einrichten. Dies wird in der Regel mit dem Konfigurations-Arbeitsbereich erledigt.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Über iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>Übersicht</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Grundlegende Informationen über iTALC und dessen Benutzung.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>Bitte geben Sie Ihren Nutzernamen und Ihr Passwort ein, um auf iTALC-Clients zugreifen zu können.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nutzername</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Passwort</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation>iTALC-Anmeldung</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Der Dienst '%1' konnte nicht registriert werden.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Es konnte keine Verbindung zum Service-Control-Manager hergestellt werden (haben Sie die nötigen Rechte?!) - der Dienst '%1' wurde nicht registriert.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Der Dienst '%1' ist bereits registriert.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Der Dienst '%1' konnte nicht registriert werden.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Der Dienst '%1' wurde erfolgreich registriert.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Der Dienst '%1' konnte nicht gestoppt werden.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Der Dienst '%1' wurde entfernt.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Der Dienst '%1' ist nicht registriert und kann daher nicht entfernt werden.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Der Dienst '%1' konnte nicht entfernt werden.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Der Dienst '%1' wurde nicht gefunden.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Es konnte keine Verbindung zum Service-Control-Manager hergestellt werden (haben Sie die nötigen Rechte?!) - der Dienst '%1' wurde nicht entfernt.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Es konnte keine Verbindung zum Service-Control-Manager hergestellt werden (haben Sie die nötigen Rechte?!) - der Dienst '%1' wurde nicht beendet.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Client %1 auf %2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>Live anschauen (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>Fernsteuerung (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>unbekannter Nutzer</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>Nur beobachten</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fernsteuern</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>Schüler sperren</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Schüler freigeben</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Schnappschuss</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>Vollbild</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>Fenster</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Beenden</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>Verbindung wird hergestellt %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>Verbindung hergestellt.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation>Ferngesteuerte Anmeldung</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nutzername</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Passwort</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domäne</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation>Befehle ausführen</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation>Bitte geben Sie die Befehle ein, die auf den gewählten Clients ausgeführt werden sollen. Sie können mehre Befehle zeilenweise trennen.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>unbekannt</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Konnte keinen Schnappschuss erstellen, da das Verzeichnis %1 nicht existiert und nicht erstellt werden konnte.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Schnappschuss</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>Schnappschüsse</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Verwalten Sie Ihre Schnappschüsse mit Hilfe dieses Arbeitsbereiches.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier sind a [...]
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>Benutzer:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Rechner:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>Datum:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>Zeit:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>Anzeigen</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>Löschen</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation>Unterstützung</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation>Bitte geben Sie die IP-Adresse oder den Namen des Rechners an, mit dem Sie sich verbinden möchten.</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>Text-Nachricht schicken</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Nutzen Sie das Feld unterhalb, um Ihre Nachricht zu tippen, die an alle Nutzer geschickt wird.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Verbindung zu %1 wird hergestellt ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Übersicht</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Vollbild-Demo</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Fenster-Demo</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Bildschirm gesperrt</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Live anschauen</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fernsteuern</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Schüler Demo zeigen lassen</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Text-Nachricht schicken</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Nutzer abmelden</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Einen Schnappschuss machen</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Anschalten</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Neustarten</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Ausschalten</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Befehle ausführen</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/dialog-password.png b/lib/resources/dialog-password.png
deleted file mode 100644
index d34ab70..0000000
Binary files a/lib/resources/dialog-password.png and /dev/null differ
diff --git a/lib/resources/el.qm b/lib/resources/el.qm
deleted file mode 100644
index d91f076..0000000
Binary files a/lib/resources/el.qm and /dev/null differ
diff --git a/lib/resources/el.ts b/lib/resources/el.ts
deleted file mode 100644
index 66cc2c1..0000000
--- a/lib/resources/el.ts
+++ /dev/null
@@ -1,1763 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="el_GR">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Σχετικά με την εφαρμογή iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Σχετικά</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Συγγραφείς</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Μετάφραση</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Άδεια</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Πότε για αυτή τη συνεδρία (session)</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Πάντα για αυτή τη συνεδρία (session)</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Διαχείριση Τάξης</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Χρησιμοποιήστε αυτό το χώρο για να διαχειριστείτε εύκολα τους υπολογιστές και τις τάξεις.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Εδώ διαχειριζόσαστε υπολογιστές και τάξεις. Μπορείτε να προσθέσετε υπολογιστές και τάξεις με δεξί κλικ στη λίστα.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Τάξεις/υπολογιστές</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">Διεύθυνση IP</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">Ονόματα χρηστών</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Εμφάνιση ονομάτων χρηστών</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">Χρησιμοποιήστε το context-menu (δεξί κλικ ποντικιού) για να προσθέσετε/διαγράψετε υπολογιστές και/ή τάξεις.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">Πατήστε αυτό το κουμπί για εξαγωγή λίστας υπολογιστών και ονομάτων χρηστών σε ένα αρχείο κειμένου. Μπορείτε να χρησιμοποιήσετε αυτό το αρχείο αργότερα για να συλλέξετε αρχεία μετά τη λήξη μιας εξέτασης. Αυτό είναι αναγκαίο ορισμένες φορές, επειδή κάποιοι χρήστες μπορεί να έχουν τελειώσει και αποσυνδεθεί νωρίτερα και έτσι δε μπορείτε να συλλέξετε τα αρχεία τους στο τέλος της εξέτασης.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Απόκρυψη υπολογιστών Δάσκαλου</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Εμφάνιση/Απόκρυψη</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Επεξεργασία ρυθμίσεων</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Διαγραφή</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Εμφάνιση όλων των υπολογιστών της τάξης</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Απόκρυψη όλων των υπολογιστών της τάξης</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Επεξεργασία ονόματος</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Διαγραφή τάξης</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Πρόσθεση υπολογιστή</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Πρόσθεση τάξης</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Δε βρέθηκε αρχείο εγκατάστασης</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Αδύνατο το άνοιγμα αρχείου εγκατάστασης %1.
-Πρέπει να προσθέσετε τουλάχιστον μία τάξη και υπολογιστές με τη Διαχείριση Τάξης που θα βρείτε στην αριστερή μπάρα του προγράμματος.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Σφάλμα στο αρχείο εγκατάστασης</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Σφάλμα κατά την επεξεργασία του αρχείου εγκατάστασης %1.
-Παρακαλώ διορθώστε το. Διαφορετικά, θα πρέπει να διαγράψετε το αρχείο και να προσθέσετε όλες τις τάξεις και υπολογιστές πάλι.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Σφάλμα κατά την επεξεργασία του αρχείου εγκατάστασης %1.
-Παρακαλώ διορθώστε το. Διαφορετικά, θα πρέπει να διαγράψετε το αρχείο.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Ενέργειες</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Ενέργειες για %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Νέο όνομα για τάξη</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Παρακαλώ εισάγετε νέο όνομα για την τάξη "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Είστε σίγουρος/η ότι θέλετε να διαγράψετε την τάξη "%1";
-Προσοχή! Όλοι οι υπολογιστές της τάξης θα διαγραφούν!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Κενή τάξη</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Πριν την πρόσθεση υπολογιστών πρέπει να δημιουργήσετε τουλάχιστον μία τάξη.
-Θέλετε να δημιουργήσετε μία νέα τάξη τώρα;</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Νέα τάξη</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Παρακαλώ εισάγετε το όνομα της τάξης που θέλετε να δημιουργήσετε.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Άγνωστη κατάσταση</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Κανείς χρήστης συνδεδεμένος</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Υπολογιστής εκτός σύνδεσης</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Επίδειξη σε εκτέλεση</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Επιφάνεια εργασίας κλειδωμένη</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Είστε σίγουρος/η ότι θέλετε να αποσυνδεθούν οι χρήστες στους ορατούς υπολογιστές;</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Αποσύνδεση χρήστη</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Είστε σίγουρος/η ότι θέλετε να επανεκκινήσετε όλους τους ορατούς υπολογιστές;</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Επανεκκίνηση υπολογιστών</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Είστε σίγουρος/η ότι θέλετε να τερματίσουν όλοι οι ορατοί υπολογιστές;</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Άκυρη MAC-Διεύθυνση</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Ορίσατε μια άκυρη MAC-Διεύθυνση. Αφήστε το πεδίο κενό ή εισάγετε μια έγκυρη MAC-Διεύθυνση (χρησιμοποιήστε ":" για διαχωρισμό!)</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Ρυθμίσεις Μαθητή</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">Διεύθυνση IP/Όνομα υπολογιστή</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">εισάγετε μια διεύθυνση IP ή ένα όνομα υπολογιστή με το οποίο θα ανα [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Όνομα</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Προαιρετικό ψευδώνυμο του υπολογιστή που εμφανίζεται στο iTALC.< [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Υλικό/MAC-διεύθυνση ενός μαθητή - χρησιμοποιείτε μόνο για εκκίνηση  [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Τάξη</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Τύπος</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Υπολογιστής Μαθητή</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Υπολογιστής Δάσκαλου</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Άλλος/απροσδιόριστος υπολογιστής</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Διάστημα μεταξύ ενημερώσεων</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ορίστε το διάστημα μεταξύ ενημερώσεων των μαθητών. Υψηλότερες τιμές [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">δευτερόλεπτα</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Διεπαφή χρήστη</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Απόκρυψη επεξηγήσεων για κουμπιά γραμμών εργαλείων</p></bo [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Επιλέξτε εδώ αν σας ενοχλεί η εμφάνιση επεξηγήσεων όταν μετακινείτε [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Απόκρυψη επεξηγήσεων</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Απόκρυψη κειμένου στα κουμπιά γραμμής εργαλείων</p></body& [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished">Απόκρυψη κειμένου στα κουμπιά γραμμών εργαλείων</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Ο ρόλος σας (απαιτεί σχετικά κλειδιά!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Επιλέξτε το ρόλο σας. Κάντε αλλαγές εφόσον είστε βέβαιοι. Διαφορετικά δε θα μπορείτε να προσπελάσετε μαθητές μέχρι να επαναφέρετε τον προηγούμενο ρόλο σας.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Δάσκαλος</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Διαχειριστής</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Βοηθός</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Άλλος</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Ρυθμίσεις για πολλαπλή σύνδεση</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Τομέας</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Ενέργεια διπλού κλικ σε παράθυρο μαθητή</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">(new line)p, li { white-space: pre-wrap; }(new line)</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">(new line)<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block [...]
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Ζωντανή παρακολούθηση σε πλήρη οθόνη</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Πρ [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Οι Ρυθμίσεις σας</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Εδώ μπορείτε να παραμετροποίησετε την εφαρμογή iTALC ώστε να ικανοποιεί τις ανάγκες σας.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC Επίδειξη</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Σφάλμα ταυτοποίησης</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Κάποιος/α (IP: %1) προσπάθησε να εισέλθει στον υπολογιστή αλλά δεν ταυτοποιήθηκε επιτυχώς!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Δάσκαλος</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Διαχειριστής</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Άλλος</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">Κλείδωμα οθόνης</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Ενέργειες</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Γενικά</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Τερματισμός</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Στιγμιότυπα</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Σχετικά με την εφαρμογή iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Αδύνατη η ανάγνωση/εγγραφή ή δημιουργία φακέλου στο %1! Για να εκτελέσετε την εφαρμογή iTALC, παρακαλώ βεβαιωθείτε ότι επιτρέπεται να δημιουργήσετε/γράψετε αρχεία σε αυτό τον φάκελο.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Τάξη</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Αλλαγη τάξης</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Πατήστε αυτό το κουμπί για να επιλέξετε την ενεργή τάξη.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Πατήστε το κουμπί για να μεταβείτε σε άλλες τάξεις.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Κατάσταση επισκόπησης</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Αυτή είναι η προεπιλεγμένη κατάσταση στην εφαρμογή iTALC και σας επιτρέπει να έχετε μια επισκόπηση όλων των ορατών υπολογιστών. Πατήστε αυτό το κουμπί για να ξεκλειδώσετε κλειδωμένους υπολογιστές ή να τερματίσετε την κατάσταση επίδειξης.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Επίδειξη Πλήρους Οθόνης</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Τερματισμός Επίδειξης</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">Σε αυτή την κατάσταση η οθόνη σας παρουσιάζεται σε όλους τους ορατούς υπολογιστές. Επιπλέον οι χρήστες δε μπορούν να κάνουν τίποτα άλλο καθώς οι συσκευές εισόδου είναι κλειδωμένες.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Επίδειξη Παραθύρου</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">Σε αυτή την κατάσταση η οθόνη σας παρουσίαζεται σε όλους τους ορατούς υπολογιστές. Οι χρήστες μπορούν να μεταβούν σε άλλα παράθυρα και να συνεχίσουν την εργασία τους.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Κλείδωμα/Ξεκλείδωμα επιφάνειας εργασίας</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Κλείδωμα όλων</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Ξεκλείδωμα όλων</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Για να έχετε την προσοχή των χρηστών μπορείτε να κλειδώσετε την επιφάνεια εργασίας με αυτό το κουμπί. Όλες οι συσκευές εισόδου κλειδώνονται και η οθόνη γίνεται μαύρη.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Μήνυμα κειμένου</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Χρησιμοποιήστε αυτό το κουμπί για να στείλετε ένα μήνυμα κειμένου σε όλους τους χρήστες, π.χ. για να τους ανακοινώσετε μια νέα εργασία κλπ.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Εκκίνηση υπολογιστών</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Εκκίνηση</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Πατήστε αυτό το κουμπί για να εκκινήσετε όλους τους ορατούς υπολογιστές. Έτσι αποφεύγετε να εκκινήσετε κάθε υπολογιστή χειροκίνητα.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Τερματισμός υπολογιστών</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Τερματισμός</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Πατήστε αυτό το κουμπί για να τερματίσετε όλους τους υπολογιστές που εμφανίζονται (π.χ. μετά τη λήξη του μαθήματος).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Άμεση βοήθεια</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">Αν πρέπει να βοηθήσετε κάποιον/α σε ένα συγκεκριμένο υπολογιστή, πατήστε αυτό το κουμπί και εισάγετε το όνομα ή τηn IP διεύθυνση υπολογιστή.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Προσαρμογή/Ευθυγράμμιση</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Πατώντας αυτό το κουμπί προσαρμόζεται το παράθυρο των μαθητών στο μεγαλύτερο δυνατό μέγεθος. Επιπλέον, όλα τα παράθυρα ευθυγραμμίζονται.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Αυτόματη προβολή</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Αυτόματη αναπροσαρμογή παραθύρων και του μεγέθους τους</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Πατώντας αυτό το κουμπί όλα τα παράθυρα των μαθητών αναπροσαρμόζονται στο προεπιλεγμένο μέγεθος και ευθυγραμμίζονται.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Πίνακας Ελέγχου</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Μήνυμα από τον Δάσκαλο</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Καλώσήλθατε στο iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Εδώ φαίνεται η γραμμή εργασίας με αρκετά κουμπιά. Κάθε κουμπί συνδέεται με μια περιοχή εργασίας. Δείτε τις διαθέσιμες περιοχές πατώντας τα αντίστοιχα κουμπιά.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">Χρησιμοποιώντας το διαχειριστή τάξης μπορείτε να διαχειριστείτε τάξεις και υπολογιστές, καθώς επίσης να δείτε ποιοι χρήστες συνδέθηκαν.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Η περιοχή στιγμιοτύπων είναι ένα πολύ χρήσιμο εργαλείο για τη διαχείριση των φωτογραφιών που δημιουργήσατε.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Φυσικά μπορείτε να ρυθμίσετε την εφαρμογή iTALC από την περιοχή ρυθμίσεων.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Σχετικά με την εφαρμογή iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Βασικές πληροφορίες για την εφαρμογή iTALC και πως να τη χρησιμοποιήσετε.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Όνομα χρήστη</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Κωδικός</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Αδυναμία καταχώρισης της υπηρεσίας '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Η Διαχείριση Υπηρεσιών (Service Control Manager) δεν ανταποκρίνεται (έχετε τα απαραίτητα δικαιώματα;!) - Η υπηρεσία '%1' δεν καταχωρήθηκε.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Η υπηρεσία '%1' έχει ήδη καταχωρηθεί.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Η υπηρεσία '%1' δε μπορεί να καταχωρηθεί.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Η υπηρεσία '%1' καταχωρήθηκε επιτυχώς.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Η υπηρεσία '%1' δε μπορεί να τερματιστεί.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Η υπηρεσία '%1' έχει αποκαταχωρηθεί.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Η υπηρεσία '%1' δεν είναι καταχωρημένη και για αυτό δε μπορεί να αποκαταχωρηθεί.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Η υπηρεσία '%1' δε μπορεί να αποκαταχωρηθεί.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Η υπηρεσία '%1' δε βρέθηκε.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Η Διαχείριση Υπηρεσιών (Service Control Manager) δεν ανταποκρίνεται (έχετε τα απαραίτητα δικαιώματα;!) - Η υπηρεσία '%1' δεν αποκαταχωρήθηκε.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Η Διαχείριση Υπηρεσιών (Service Control Manager) δεν ανταποκρίνεται (έχετε τα απαραίτητα δικαιώματα;!) - Η υπηρεσία '%1' δεν τερματίστηκε.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Μαθητής %1:%2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">Άγνωστος χρήστης</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Προβολή μόνο</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Κλείδωμα μαθητή</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Ξεκλείδωμα μαθητή</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Στιγμιότυπο</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Πλήρης οθόνη</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Παράθυρο</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Τερματισμός</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Σύνδεση με %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Συνδέθηκε.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Όνομα χρήστη</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Κωδικός</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Τομέας</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Αδύνατη η δημιουργία στιγμιοτύπου. Ο φάκελος %1 δεν υπάρχει και δε μπορεί να δημιουργηθεί.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Στιγμιότυπο</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Στιγμιότυπα</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Διαχειριστείτε τις φωτογραφίες που δημιουργήσατε σε αυτή την περιοχή εργασίας.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Όλες οι φωτογραφίες που δημιουργήσατε φαίνονται εδώ. Μπορείτε να δημιουργήσετε φωτογραφίες επιλέγοντας τη σχετική εντολή στο μενού συντόμευσης ενός παραθύρου μαθητή. Οι φωτογραφίες διαχειρίζονται με τα ακόλουθα κουμπιά.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Χρήστης:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Υπολογιστής:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Ημερομηνία:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Ώρα:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Γράψτε το μήνυμά σας στο παρακάτω πεδίο για να το στείλετε στους επιλεγμένους χρήστες.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Σύνδεση με %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Κλειδωμένη οθόνη</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Ζωντανή παρακολούθηση</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Επίδειξη οθόνης μαθητή</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Αποσύνδεση χρήστη</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Βγάλε ένα στιγμιότυπο</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Εκκίνηση</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Επανεκκίνηση</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Τερματισμός</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Εκτέλεση εντολών</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/es.qm b/lib/resources/es.qm
deleted file mode 100644
index f7181d6..0000000
Binary files a/lib/resources/es.qm and /dev/null differ
diff --git a/lib/resources/es.ts b/lib/resources/es.ts
deleted file mode 100644
index e797a87..0000000
--- a/lib/resources/es.ts
+++ /dev/null
@@ -1,1760 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="es_ES">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Acerca de iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Acerca</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Autores</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Traducción</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Licencia</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Nunca para esta sesión</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Siempre para esta sesión</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Administrador de Clases</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Utilice este espacio para administrar sus computadoras y clases de una manera fácil.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Aquí es donde las computadoras y las clases son administradas. Puedes agregar computadoras o clases apretando el botón derecho en esta lista.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Clases/computadoras</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">Dirección IP</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Exportar a archivo de texto</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Ocultar computadora del Profesor</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Mostrar/ocultar</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Editar configuración</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Borrar</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Mostrar todas las computadoras en el aula</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Ocultar todas las computadoras en el aula</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Editar nombre</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Borrar clase</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Agregar computadora</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Añadir clase</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">No se ha encontrado el archivo de configuración</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">No se ha encontrado el archivo de configuración %1.
-Deberás agregar al menos una clase y una computadora usando el Administrador de las Clases el cual lo encontraras dentro del programa en la barra lateral del lado izquierdo.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Error en el archivo de configuración</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Error durante el análisis del archivo de configuración %1.
-Por favor editelo. De otra forma deberá borrar este archivo y tendrá que agregar todas las clases y computadoras de nuevo.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Error al leer archivo de configuración %1.
-Por favor, edítelo o en otro caso, bórrelo.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Seleccionar archivo de salida</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Archivos de texto (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Acciones</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Acciones para %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Nuevo nombre para la clase</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Por favor introduzca el nuevo nombre para la clase "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">¿Esta seguro que desea remover la clase "%1"?
-Todas las computadoras tambien serán removidas!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Clase no encontrada</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Antes de agregar computadoras se debe crear al menos una clase.
-¿Desea crear una clase ahora?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nueva clase</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Por favor ingrese el nombre de la clase que desea crear.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Estado desconocido</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Usuario no conectado</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Equipo no disponible</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Modo demo funcionando</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Escritorio bloqueado</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">¿Esta seguro que desea desconectar a todos los usuarios de las computadoras visibles?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Desconectar usuario</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">¿Esta seguro que desea reiniciar todas las computadoras visibles?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Reiniciar computadoras</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">¿Esta seguro que desea apagar todas las computadoras visibles?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Dirección MAC inválida</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Ha especificado una dirección MAC invalida. Deje el campo en blanco o ingrese una dirección MAC valida (¡Utilice ":" como separador!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Configuración de los clientes</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/nombre de equipo</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> introduzca una dirección IP o nombre de equipo para que iTALC se c [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Nombre</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección MAC - sólo usada para encender los equipos</p></ [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Clase</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Tipo</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Computadora Estudiante</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Computadora Profesor</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Computadora: Otra o indefinida</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Intervalo entre actualizaciones</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Aquí puede asignar un intervalo entre la actualización de los clien [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">segundos</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Interfaz de usuario</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">No mostrar los globos de ayuda para la barra de botones.</p>& [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tilde esta opción si es molestado por la aparición de los globos de [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Desactivar ayudas en globos</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Su rol (¡se necesitan las claves correctas!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Profesor</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrador</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Soporte técnico</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Otro</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Configuración para multi entrada</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Dominio</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Acción 'Doble Click' para ventana del cliente</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Control remoto</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Ver en vivo en Pantalla Completa</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Fa [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Tu Configuración iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">En esta zona puede configurar iTALC a sus necesidades.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC Demo</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Error de autentificacion</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Alguien (IP: %1) esta intentando acceder a este ordenador pero no puede autentificarse correctamente!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Profesor</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrador</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Otro</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Acciones</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">General</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Salir</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Capturas</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Acerca de iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">No puedo leer, escribir o crear el directorio %1! Para ejecutar iTALC asegúrese que tiene permitido crear o escribir en este directorio.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Clase</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Cambiar de clase</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Haga click en este botón para abrir un menú donde puede seleccionar la clase activa.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Haga Click en  este botón, para cambiar entre clases.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Modo ayuda</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Este es el modo por defecto de iTALC que le permite tener una visión general de todas las computadoras visibles. También use este botón para desbloquear estaciones bloqueadas o dejar el modo Demo.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">En este modo tu pantalla se verá en una ventana en todas las computadoras visibles. Además los usuarios no son capaces de hacer nada más dado que todos los dispositivos de entrada son bloqueados en este modo.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo en ventana</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">En este modo tu pantalla se verá en una ventana en todas las computadoras visibles. Los usuarios son capaces de cambiar a otras ventanas y así seguir trabajando.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Bloquear y desbloquear escritorios</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Bloquear todas</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Desbloquear todas</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Utilizando este botón usted puede tener la atención completa de todos los usuarios bloqueando sus escritorios. En este modo todos los dispositivos de entrada se bloquean y la pantalla queda en negro.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Enviar mensaje de texto</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Mensaje</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Utilice este botón para enviar un mensaje de texto a todos los usuarios, por ejemplo para informarles nuevas tareas, etc.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Arrancar computadoras</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Encender</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Apreta este botón para encender todas las computadoras visibles. De esta forma no tienes que encender cada computadora manualmente.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Apagar</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Utilice este botón para apagar todas las computadoras visializadas (por ejemplo luego de finalizar la lección).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Soporte técnico</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Ajustar/Alinear</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Ajustar tamaño de ventanas</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Con este botón se ajustan los tamaños de las ventanas al mayor posible.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Auto juste</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Reacomoda ventanas y su tamaño</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Presionando este botón todos las ventanas visibles se ajustan y se reorganizan automáticamente.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Control remoto</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Mensaje del profesor</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Bienvenido a iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Aquí puede ver la barra de trabajo la cual contiene varios botones. Cada botón esta conectado a un espacio de trabajo. Simplemente mire los espacios de trabajo disponibles cliqueando en el botón correspondiente.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">El espacio de trabajo de Captura es una herramienta muy útil. Le permite administrar las capturas que hace.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Por supuesto que puede configurar iTALC. Esto se realiza usualmente con la configuración del espacio de trabajo.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Acerca de iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Alguna información básica sobre iTALC y como usarlo.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Nombre de usuario</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Contraseña</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation type="unfinished">No se puede registrar el servicio '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation type="unfinished">El gestor de control de servicios no puedo ser contactado (¿tiene privilegios suficientes?) - el servicio '%1' no se ha registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation type="unfinished">El servicio '%1' ya está registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation type="unfinished">El servicio '%1' no se pudo registrar.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation type="unfinished">El servicio '%1' no se pudo parar.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation type="unfinished">El servicio '%1' se ha des-registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation type="unfinished">El servicio '%1' no está registrado por lo que no se puede des-egistrar.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation type="unfinished">El servicio '%1' no se pudo des-registrar.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation type="unfinished">El servicio '%1' no se ha encontrado.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation type="unfinished">El gestor de control de servicios no puedo ser contactado (¿tiene privilegios suficientes?) - el servicio '%1' no se ha des-registrado.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation type="unfinished">El gestor de control de servicios no puedo ser contactado (¿tiene privilegios suficientes?) - el servicio '%1' no se ha parado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation type="unfinished">El servicio '%1' se ha registrado correctamente.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Cliente iTALC %1 en %2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">usuario desconocido</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Solo mirar</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Control remoto</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Bloquear</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Desbloquear</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Captura</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Pantalla Completa</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Ventana</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Salir</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Conectando %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Conectado.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Logueo remoto</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Nombre de usuario</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Contraseña</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Dominio</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Captura</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Capturas</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Utilizando este lugar de trabajo maneje fácilmente las capturas de pantalla realizadas.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Se listan aquí todas las capturas de pantalla realizadas. Ud. puede hacer capturas seleccionando la opción correspondiente en el menú contextual de cada ventana cliente. Estas capturas se pueden manejar usando los botones de aquí abajo.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Usuario:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Equipo:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Fecha:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Hora:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Soporte técnico</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Enviar mensaje de texto</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Use el campo de más abajo para escribir tu mensaje que será enviado a todos los usuarios seleccionados.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Estableciendo conexión con %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo en ventana</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Bloquear pantalla</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Ver en vivo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Control remoto</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Permitir al alumno mostrar demo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Enviar mensaje de texto</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Desconectar usuario</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Tomar una Captura</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Encender</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Reiniciar</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Apagar</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Ejecutar comandos</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/fi.qm b/lib/resources/fi.qm
deleted file mode 100644
index afa2c57..0000000
Binary files a/lib/resources/fi.qm and /dev/null differ
diff --git a/lib/resources/fi.ts b/lib/resources/fi.ts
deleted file mode 100644
index 52f4175..0000000
--- a/lib/resources/fi.ts
+++ /dev/null
@@ -1,1766 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="fi_FI">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Tietoja</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Tekijät</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Käännös</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Lisenssi</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Ei koskaan tälle istunnolle</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Aina tälle istunnolle</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Hallinta</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Käytä tätä näkymää tietokoneiden ja luokkahuoneiden hallintaan.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Tällä hallitset tietokoneita ja luokkahuoneita. Voit lisätä uusia koneita tai luokkahuoneita painamalla hiiren oikeaa näppäintä listassa.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Luokkahuoneet/koneet</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP-osoite</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">Käyttäjänimet</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Näytä kayttäjänimet</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">Käytä ponnahdusvalikkoa (hiiren oikea näppäin) lisätäksesi tai poistaaksesi luokkahuoneita ja tietokoneita.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Vie tekstitiedostoksi</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">Käytä tätä luodaksesi tekstitiedoston tietokoneista ja käyttäjistä. Voit käyttää tiedostoa myöhemmin kerätäksesi tiedostoja kokeen loputtua. Tätä tarvitaan, jos jotkut käyttäjät kirjautuvat ulos muita aikaisemmin ja tiedostojen suora kopiointi ei enää onnistu.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Piilota opettajan koneet</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Näytä/piilota</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Muokkaa asetuksia</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Poista</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Näytä kaikki luokkahuoneen koneet</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Piilota kaikki luokkahuoneen koneet</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Muokkaa nimeä</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Poista luokkahuone</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Lisää tietokone</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Lisää luokkahuone</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Asetustiedostoa ei löytynyt</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Asetustiedoston %1 avaaminen epäonnistui.
-Sinun tulee lisätä ainakin yksi luokkahuone ja yksi tietokone käyttämällä hallintanäkymää, jonka löydät iTALC:n vasemmasta sivupalkista.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Virhe asetustiedostossa</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Virhe asetustiedostossa %1.
-Ole hyvä ja korjaa se. Vaihtoehtoisesta voit poistaa tiedoston ja luoda uudestaan luokkahuoneet ja tietokoneet.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Virhe asetustiedossa %1.
-Ole hyvä ja korjaa se. Vaihtoehtoisesti voit poistaa tiedoston.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Tallenna tiedostoksi</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Tekstitiedostot (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Toiminnot</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Suorita %1:lle</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Nimeä luokkahuone</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Kirjoita luokkahuoneen "%1" uusi nimi.</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Haluatko varmasti poistaa luokkahuoneen "%1"?
-Samalla poistuvat kaikki luokkahuoneen sisältämät tietokoneet!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Luokkahuone puuttuu</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Sinun tulee luoda vähintään yksi luokkahuone ennen tietokoneiden lisäämistä.
-Haluatko luoda uuden luokkahuoneen?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Uusi luokkahuone</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Kirjoita uuden luokkahuoneen nimi.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Tuntematon tila</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Ei käyttäjää</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Ei yhteyttä koneeseen</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Esitys käynnissä</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Työpöytä lukittu</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Haluatko varmasti kirjata käyttäjät ulos kaikilta näkyviltä tietokoneilta?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Haluatko varmasti uudelleenkäynnistää kaikki näkyvät tietokoneet?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Uudelleenkäynnistä tietokoneet</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Halutako varmasti sammuttaa kaikki näkyvät tietokoneet?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Virheellinen MAC-osoite</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Annoit virheellisen MAC-osoitteen. Jätä kenttä tyhjäksi tai kirjoita oikea MAC-osoite (muotoa 12:34:56:78:9A:BC).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Tietokoneen asetukset</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/verkkonimi</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Kirjoita koneen verkkonimi tai IP-osoite (käytä ':' jos h [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Nimi</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vaihtoehtoinen nimi koneelle iTALC:ssa.</p></body></ [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tietokoneen verkkokortin MAC-osoite - tarvitaan vain koneen etäkäyn [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Luokkahuone</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Konetyyppi</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Oppilaan kone</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Opettajan kone</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Muu/määrittelemätön kone</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Näytön päivitysväli</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tällä määrittelet koneiden näyttöjen päivitysvälin. Suurempi arvo v [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> sekuntia</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Käyttöliittymä</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Estä  opastetekstien näyttäminen</p></body></html&gt [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Valitse tämä jos opastetekstit häiritsevät hiiren osoittimen osuess [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Ei opastetekstejä</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Piilota painikkeiden tekstit työkalupalkissa</p></body> [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished">Piilota työkalupalkin tekstit</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Roolisi (tarvitset kyseisen avaimen!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tällä valitset oman roolisi. Muuta tätä vain, jos tiedät varmsti mitä teet. Muuten saatat menettää yhteyden muihin koneisiin, kunnes palautat alkuperäisen roolisi.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Opettaja</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Ylläpitäjä</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Tuki</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Muu</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Toimialue</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Ikkunan kaksoispainallus</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tällä valitset mitä tapahtuu kaksoispainamalla hiiren näppäintä tietokoneiden näkymäikkunan kohdalla.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Avaa näkymä</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Jo [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">iTALC-asetukset</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Tässä tilassa voit muokata iTALC:a mieleiseksesi.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC esitys</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Autentikointivirhe</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Joku (IP: %1) yritti päästä näkemään kuvaruutusi, mutta ei onnistunut autentikoimaan itseään!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Opettaja</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Ylläpitäjä</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Muu</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">Lukitse</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Toiminnot</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Yleistä</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Kuvaruutukopiot</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Hakemiston %1 luku/kirjoitus tai luonti ei onnistu. Käyttääksesi iTALC:ia varmista, että sinulla on oikeudet luoda ja kirjoittaa tähän hakemistoon.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Luokkahuone</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Vaihda luokkahuonetta</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Painamalla tätä voit valita käytettävän luokkahuoneen.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Painamalla tätä valitset eri luokkahuoneiden välillä.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Yleisnäkymä</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Tämä on iTALC:n oletustila. Siinä näet kaikkien aktiivisten koneiden kuvaruudut. Painamalla tätä vapautat myös lukitut tietokoneet tai poistut esitystilasta.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Esitys koko näytöllä</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Esitys koko näytöllä</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Lopeta esitys</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">Tässä tilassa näyttösi pakotetaan kaikkien muiden koneiden näytölle. Tällöin muiden käyttäjien laitteet lukkiutuvat.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Esitys ikkunassa</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Esitys ikkunassa</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">Tässä tilassa näyttösi näytetään muiden koneilla omassa ikkunassaan. Käyttäjät voivat samanaikaisesti työskennellä muissa ikkunoissa.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Lukitse/vapauta työtilat</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Lukitse kaikki</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Vapauta kaikki</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Saadaksesi käyttäjien täyden huomion, voit lukita heidän työtilansa painamalla tätä. Tässä tilassa käyttäjien koneet on lukittu ja näyttö pimennetty.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Viesti</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Käytä tätä lähettääksesi viestin kaikille käyttäjille, esim. antaaksesi heille tehtävän, tms.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Käynnistä tietokone</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Painamalla tätä käynnistät kaikki näkyvät tietokoneet. Tällä tavalla sinun ei tarvitse käydä käynnistämässä niitä jokaista käsin (MAC-osoite tulee olla määritetty koneen asetuksissa!).</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Painamalla tätä voit sammuttaa kaikki näkyvät tietokoneet (esim. oppitunnin päättyessä).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Tukitoiminto</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Etätuki koneelle</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">Tällä voit etähallita jotain vierasta konetta antamalla sen verkkonimi tai IP-osoite.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Sovita</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Sovita ikkunat</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Painamalla tätä kaikki ikkunat sovitetaan ruudulle mahdollisimman isokokoisina.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Järjestä</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Järjestä ja sovita ikkunat</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Painamalla tätä uudelleenjärjestetään ja sovitetaaan kaikki näkyvät ikkunat.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Viesti opettajalta</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Tervetuloa iTALC:n pariin!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Viereisen työkalupalkin avulla valitset sen, mitä tässä työtilassa näytetään. Kokeile eri tiloja painamalla kuvakkeita. Painamalla valitun työtilan kuvaketta uudestaan piilotat tämän työtilan.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">Luokkahuoneiden hallinnassa kontrolloit eri luokkahuoneita ja tietokoneita. Siinä näet myös käyttäjät, jotka ovat kirjautuneina koneille.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Kuvaruutukopioiden hallinta on hyvin hyödyllinen työkalu. Sillä hallitset ottamiasi kuvaruutukopioita.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Tässä tilassa voit muokata iTALC:a mieleiseksesi.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Perustietoja iTALC:sta ja sen käytöstä.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Käyttäjätunnus</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Salasana</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>ICA %1 portissa %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Rekisteröityminen palveluun '%1' epäonnistui.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Kytkeytyminen Service Control Manageriin epäonnistui (ovatko käyttöoikeutesi riittävät?) - palvelua '%1' ei rekisteröity.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Palvelu '%1' on jo rekisteröity.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Palvelua '%1' ei voitu rekisteröidä.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Palvelu '%1' rekisteröity onnistuneesti.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Palvelua '%1' ei voitu pysäyttää.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Palvelu '%1' poistettu.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Palvelua '%1' ei ole rekisteröity, joten sitä ei voida poistaa.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Palvelua '%1' ei voitu poistaa.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Palvelua '%1' ei löydy.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Kytkeytyminen Service Control Manageriin epäonnistui (ovatko käyttöoikeutesi riittävät?!) - palvelua '%1' ei poistettu.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Kytkeytyminen Service Control Manageriin epäonnistui (ovatko käyttöoikeutesi riittävät?!) - palvelua '%1' ei pysäytetty.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">tuntematon käyttäjä</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Etänäkymä</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Lukitse</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Vapauta</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Koko ruutu</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Ikkunoitu</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Muodostaa yhteyttä %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Yhteys muodostettu.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Kirjaudu</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Käyttäjätunnus</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Salasana</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Toimialue</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Kuvaruutukopion ottaminen epäonnistui, koska hakemistoa %1 ei ole olemassa eikä sitä pystytty luomaan.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Kuvaruutukopiot</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Hallitse ottamiasi kuvaruutukopioita.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tässä on lueteltu kaikki ottamasti kuvaruutukopiot. Kuvaruutukopion saat otettua painamalla haluamasi koneen ikkunassa hiiren oikeaa näppäintä ja valitsemalla alivalikosta "Ota kuvaruutukopio". Näitä kuvia voidaan hallita alla olevilla painikkeilla.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Käyttäjä:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Tietokone:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Pvm:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Aika:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Tukitoiminto</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Kirjoita viesti alla olevaan kentään. Viesti lähetetään kaikille valituille koneille.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Luodaan yhteyttä %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Esitys koko näytöllä</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Esitys ikkunassa</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Lukitse</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Avaa näkymä</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Oppilaan esitys</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Ota kuvaruutukopio</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Uudelleenkäynnistä tietokone</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Suorita komento</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/fr.qm b/lib/resources/fr.qm
deleted file mode 100644
index d7b7e72..0000000
Binary files a/lib/resources/fr.qm and /dev/null differ
diff --git a/lib/resources/fr.ts b/lib/resources/fr.ts
deleted file mode 100644
index 535aaa7..0000000
--- a/lib/resources/fr.ts
+++ /dev/null
@@ -1,1767 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">À propos d'iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">À propos</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Auteurs</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Traduction </translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Licence</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Jamais pour cette session</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Toujours pour cette session</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Gestionnaire de salle</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Utilisez cet espace pour gérer facilement vos ordinateurs et vos salles.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">C'est d'ici que vous gérez les ordinateurs et les salles. Vous pouvez ajouter des ordinateurs ou des salles par un clic droit sur cette liste.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Salles/ordinateurs</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">Adresse IP</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">Noms</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Afficher les noms d'utilisateurs</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">Utilisez le menu contextuel (bouton droit) pour ajouter/enlever des ordinateurs ou des salles.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Export�fichier texte</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">Utilisez ce bouton pour exporter cette liste d'ordinateurs et de noms d'utilisateurs dans un fichier texte. 
-Vous pourrez utiliser ensuite ce fichier pour collecter des fichiers à la fin d'un examen. C'est parfois nécessaires, car certains étudiants peuvent terminer et se déconnecter en avance, ce qui vous empêche de collecter leurs fichiers.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Cacher les ordinateurs des professeurs</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Afficher/cacher</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Modifier les réglages</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Supprimer</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Afficher tous les ordinateurs de cette salle</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Cacher tous les ordinateurs de cette salle</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Modifier le nom </translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Supprimer la salle </translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Ajouter un ordinateur</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Ajouter une salle</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Aucun fichier de configuration trouvé</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Impossible d'ouvrir le fichier de configuration %1. 
-Vous devez ajouter au moins une salle et un ordinateur, en utilisant le gestionnaire de salle dans la barre latérale gauche.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Erreur dans le fichier de configuration
-</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Erreur pendant la lecture du fichier de configuration. 
-Veuillez le modifier, ou bien supprimer le fichier puis re-créer les salles et les ordinateurs.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Erreur pendant la lecture du fichier de configuration %1. 
-Veuillez le modifier ou le supprimer.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Choisir le fichier de sortie</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Fichiers texte (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Actions</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Actions pour %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Nouveau nom pour la salle</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Veuillez entrer un nouveau nom pour la salle "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Voulez-vous vraiment supprimer la salle "%1" ? 
-Tous les ordinateurs lui appartenant seront supprimés également !</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Salle manquante</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Avant d'ajouter des ordinateurs, vous devez créer au moins une salle. 
-Voulez-vous en créer une maintenant ?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nouvelle salle</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Veuillez entrer le nom de la salle que vous voulez créer.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">État inconnu</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Aucun utilisateur connecté</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Hôte impossible à atteindre</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Démo en cours</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Bureau verrouillé</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Voulez-vous vraiment déconnecter tous les utilisateurs de tous les ordinateurs visibles ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Déconnecter l'utilisateur</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Voulez-vous vraiment redémarrer tous les ordinateurs visibles ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Redémarrer les ordinateurs</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Voulez-vous vraiment éteindre tous les ordinateurs visibiles ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Adresse MAC invalide</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Vous avez entré une adresse MAC invalide. Laissez le champ vide ou entrez une adresse valide (séparateur = ":").</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Réglages client</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/nom d'hôte</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Entrez une adresse IP ou un nom d'hôte pour le client (utilise [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Nom</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Surnom optionnel de l'hôte affiché dans iTALC.</p></b [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adresse MAC du client  - utilisée seulement pour l'arrêt de la [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Salle</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Type</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Ordinateur étudiant</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Ordinateur professeur</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Ordinateur autre/indéfini</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Intervalle entre les mises à jour</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vous réglez ici l'intervalle de temps entre les mises à jour d [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> secondes</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Interface utilisateur</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ne pas afficher les infobulles pour les boutons de la barre d' [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Cochez cette option si vous voulez supprimer les infobulles qui app [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Pas d'infobulles</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Votre rôle (nécessite les clés correspondantes)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vous pouvez choisir votre rôle. Ne modifiez ce champ que si vous savez parfaitement ce que vous faites, sans quoi il vous sera impossible d'accéder aux clients à moins de restaurer votre ancien rôle.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Professeur</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrateur</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Assistant</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Autre</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Réglages pour connexion multiple</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domaine</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Action double-clic sur fenêtre client</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ici, paramétrez l'action à effectuer lors d'un double-clic sur une fenêtre client.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Contrôle à distance</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Voir en direct en plein écran</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">At [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Votre configuration iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Dans cet espace, vous pouvez paramétrer iTALC pour vos besoins.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">Démo iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Erreur d'authentification</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Quelqu'un (IP %1) a essayé d'accéder à cet ordinateur, mais n'a pas réussi à s'authentifier !</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Professeur</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrateur</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Autre</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">ver. écran</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Actions</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Général</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Quitter</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Captures</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">À propos d'iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Impossible de lire/écrire dans le répertoire %1, ou de le créer. Assurez-vous que vous avez les permissions nécessaires.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Salle</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Changer de salle 
-</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Ce bouton ouvre un menu dans lequel vous pouvez choisir la salle active.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Cliquez sur ce bouton pour changer de salle.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Mode aperçu</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Aperçu</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">C'est le mode par défaut d'iTALC, qui vous fournit un aperçu de tous les ordinateurs visibles. Cliquez sur ce bouton pour déverrouiller les clients verrouillés ou pour quitter le mode démo.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Démo plein écran</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Démo plein écran</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Arrêter la démo</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">Dans ce mode, votre écran est affiché sur tous les ordinateurs visibles. De plus, les périphériques d'entrée des clients sont verrouillés.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Démo fenêtre</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Démo fenêtre</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">Dans ce mode, votre écran est affiché dans une fenêtre sur tous les ordinateurs visibles. Les utilisateurs peuvent changer de fenêtre, et continuer à travailler.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">(Dé-)verrouiller les bureaux</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Tout verrouiller</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Tout déverrouiller</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Pour retenir l'attention de tous les utilisateurs, vous pouvez verrouiller leurs bureaux avec ce bouton. 
-Dans ce mode, l'écran est noir et les périphériques d'entrée sont verrouillés.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Message texte</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Utilisez ce bouton pour envoyer un message à tous les utilisateurs, p. ex. pour leur donner une nouvelle tâche.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Démarrer les ordinateurs</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Allumer</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Cliquez sur ce bouton pour démarrer tous les ordinateurs visibles. Ainsi, vous n'avez pas à le faire à la main pour chacun.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Éteindre les ordinateurs</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Pour éteindre tous les ordinateurs allumés (p. ex. à la fin du cours) vous pouvez utiliser ce bouton.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Assistance</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Assistance directe</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">Si vous voulez assister quelqu'un sur un ordinateur, cliquez sur ce bouton puis entrez le nom d'hôte ou son adresse IP.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Ajuster/aligner</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Ajuster les fenêtres et leurs tailles</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Les fenêtres clientes sont ajustées pour utiliser la place maximale, et sont alignées.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Auto-vue</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Réordonne automatiquement les fenêtres</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Toutes les fenêtres visibles sont ré-ordonnées et leurs tailles sont ajustées.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Contrôle à distance</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Message du professeur</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Bienvenue dans iTALC !</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Voici la barre de travail qui contient plusieurs boutons. Chaque bouton ouvre un espace de travail. Parcourez tous les espaces disponibles en cliquant sur les boutons successifs.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">Avec le gestionnaire de salle, vous pouvez gérer les salles et les ordinateurs, et également voir qui est connecté.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">L'espace Capture vous permet de gérer toutes les captures d'écran que vous avez effectuées.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Vous pouvez bien sûr configurer iTALC. Cela se fait généralement dans l'espace Configuration.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">À propos d'iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Aperçu</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Quelques informations de base sur iTALC et la manière de l'utiliser.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Nom d'utilisateur</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Mot de passe</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Impossible d'enregistrer le service '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Le contrôleur de services (SCM) ne répond pas (avez-vous les permissions nécessaires ?) - le service '%1' n'a pas été enregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Le service '%1' est déjà enregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Le service '%1' n'a pas pu être enregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Le service '%1' a bien été enregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Le service '%1' ne peut pas être arrêté.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Le service '%1' a été désenregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Le service '%1' n'est pas enregistré et ne peut donc pas être désenregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Le service '%1' ne peut pas être désenregistré.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Le service '%1' est introuvable.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Le contrôleur de service (SCM) ne répond pas (avez-vous les permissions nécessaires ?) - le service '%1' n'a pas été désenregistré.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Le contrôleur de services (SCM) ne répond pas (avez-vous les permissions nécessaires ?) - le service '%1' n'a pas été arrêté.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">utilisateur inconnu</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Voir seulement</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Contrôle à distance</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Verrouiller l'étudiant</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Déverrouiller l'étudiant</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Capture</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Plein écran</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Fenêtre</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Quitter</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Connexion à %1...</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Connecté.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Connexion distante</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Nom d'utilisateur</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Mot de passe</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domaine</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Impossible de prendre une capture : le répertoire %1 n'existe pas et ne peut être créé.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Capture</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Captures</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Cet espace vous permet de gérer les captures que vous avez faites.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Utilisateur :</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Hôte :</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Date :</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Heure :</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Assistance</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Tapez votre message dans le champ ci-dessous. Il sera envoyé à tous les utilisateurs sélectionnés.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Établissement de la connexion à %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Aperçu</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Démo plein écran</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Démo fenêtre</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Affichage verrouillé</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Voir en direct</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Contrôle à distance</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Laisser l'étudiant faire une démo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Déconnecter l'utilisateur</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Prendre une capture</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Allumer</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Redémarrer</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Exécuter des commandes</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/he.qm b/lib/resources/he.qm
deleted file mode 100644
index b7e28cb..0000000
Binary files a/lib/resources/he.qm and /dev/null differ
diff --git a/lib/resources/he.ts b/lib/resources/he.ts
deleted file mode 100644
index 8dfb4b2..0000000
--- a/lib/resources/he.ts
+++ /dev/null
@@ -1,1786 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="he_IL" sourcelanguage="en">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">אודות</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">יוצרים</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Translation</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">רישיון</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">לעולם לא בהתחברות זו</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">תמיד בהתחברות זו</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">ניהול כיתה</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">כפתור זה משמש לניהול המחשבים והכיתות בצורה נוחה</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">באיזור זה מנוהלים מחשבים וכיתות. ניתן להוסיף מחשבים ו/או כיתות על ידי לחיצה ברשימה זו .</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">כיתות\מחשבים</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">כתובת רשת</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">שמות משתמשים</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">הצג שמות משתמשים</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">קליק ימני עם העכבר על אחד הפריטים ברשימה שלעיל מאפשר להסיר ו/או להוסיף כיתות ו/או מחשבים</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">ייצא לקובץ טקסט</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">כפתור זה מאפשר ייצוא רשימה זו של מחשבים ושמות משתמשים לקובץ טקסט. רשימה זו יכולה לשמש לאיסוף קבצים בסיום של מבחן. לעיתים איסוף זה הוא הכרחי, מאחר ויהיו משתמשים שיבצעו ניתוק לפני שנאספו קיבצי המבחן שלהם</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">הסתר את מחשבי המורה</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">הצג\הסתר</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">עריכת הגדרות</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">הסר</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">הצג את כל המחשבים בכיתה</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">הסתר את כל המחשבים בכיתה</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">ערוך שם</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">הסר כיתה</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">הוסף מחשב</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">הוסף כיתה</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">לא נמצא קובץ תצורה</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">%1
-קובץ תצורה לא ניתן לפתיחה
-יש להוסיף לפחות כיתה אחת ומחשבים תוך שימוש בניהול-כיתה הזמין לשימוש בתוך התוכנית בסרגל הצדדי בצד שמאל</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">שגיאה בקובץ תצורה</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">%1
-שגיאה במהלך ניתוח קובץ תצורה
-נא לבצע עריכה לקובץ. אחרת, יש לבצע מחיקה לקובץ ולהוסיף את כל הכיתות והמחשבים שנית</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">%1
-שגיאה במהלך ניתוח קובץ תצורה, נא לבצע מחיקה לקובץ</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">בחרו קובץ לאיחסון המידע</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished">הפעולות שנבחרו</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">פעולות</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">פעולות עבור
-%1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">שם חדש לכיתה</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">נא להכניס שם חדש עבור כיתה : 
-%1</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">האם אתם בטוחים בהסרת כיתה : 
-%1
-כל המחשבים בכיתה זו ימחקו גם הם ! </translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">חסרה כיתה</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">לפני שניתן להוסיף מחשבים יש ליצור לפחות כיתה אחת .
-האם ליצור אחת ברגע זה ?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">כיתה חדשה</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">נא להכניס את שם הכיתה אותה רוצים ליצור</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">לא מוגדר</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">אין משתמש מחובר</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">עמדה לא מחוברת</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">הדגמה מופעלת</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">שולחן העבודה נעול</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">אתם עומדים לבצע ניתוק לכל המחשבים המחוברים. האם אתם בטוחים ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished">אתם עומדים לבצע ניתוק לכל המשתמשים על גבי כל המחשבים שניבחרו. האם אתם בטוחים ?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">נתק משתמש</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">האם אתם בטוחים ברצונכם לאתחל את כל המחשבים המחוברים ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished">האם אתם בטוחים ברצונכם לאתחל את כל המחשבים שניבחרו ?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">איתחול מחשבים</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">האם אתם בטוחים ברצונכם לכבות את כל המחשבים המחוברים ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished">האם אתם בטוחים ברצונכם לכבות את כל המחשבים שניבחרו ?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">הגדרות עמדת תלמיד</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP\שם מחשב</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">הכניסו את שם המחשב או כתובת הרשת להתקשרות מול התוכנה (השתמשו ב- &ap [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">שם</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">כינוי אופציונאלי למחשב כפי שיוצג בתוכנה</p></body></ [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">כתובת ה- MAC - משמשת לצרכי הדלקת מחשב תלמיד בלבד</p></body [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">כיתה</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">סוג</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">מחשב תלמיד</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">מחשב מורה</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">מחשב אחר\לא מוגדר</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">כתובת פיזית שגוייה</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">צויינה כתובת פיזית שגוייה. יש להשאיר את השדה ריק או להכניס כתובת נכונה (השתמש ב ":" כמפריד ! ) </translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">מרווחי זמן בין עידכוני מסך</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">כאן ניתן לקבוע את גודל המרווח בין עידכוני המסך המועבר למחשבים. ככל  [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">שניות</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">ממשק משתמש</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">אל תציג את חלונית העזרה של כפתורי סרגל הכלים</p></body> [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">בדוק אופצייה זו אם חלונית העזרה קופצת בכל פעם שסמן העכבר חולף על-פנ [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">ללא חלונית העזרה</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">אל תציג טקסט על גבי כפתורי סרגל הכלים</p></body></ht [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished">ללא טקסט על גבי כפתורי סרגל הכלים</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">התפקיד שלך - יש צורך במפתחות מתאימים</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">כאן ניתן לקבוע תפקידכם. יש לשנות שדה זה רק במידה ואכן ברורות ההשלכות, אחרת לא ניתן יהיה לגשת לכלל המחשבים עד אשר ישוחזרו הגדרות התפקיד הישן</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">מורה</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">מנהל מערכת</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">תמיכה</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">אחר</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">הגדרות להתחברות מספר משתמשים</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">דומיין</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">הקשה כפולה על חלון המחשב המחובר</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">כאן ניתן להגדיר את הפעולה שתתבצע ברגע שמקישים הקשה כפולה על גבי חלון התלמיד</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">שליטה מרחוק</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">צפייה ישירה במסך מלא</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">שי [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">הגדרות תוכנה</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">באיזור זה ניתן להגדיר את התוכנה על פי צרכי העבודה</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">הדגמה</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">שגיאת זיהוי</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">משתמש (%1) ניסה לקבל גישה למחשב זה אך כשל בתהליך הזיהוי !</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">מורה</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">מנהל מערכת</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">אחר</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">נעל מסך</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">פעולות</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">לא ניתן לקרוא, לכתוב או ליצור את התיקייה הבאה. על מנת להריץ את התוכנה,וודאו כי יש ברשותכם הרשאות מתאימות ליצירת תיקייה זו
-%1</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">כיתה</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">החלף כיתה</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">לחיצה על כפתור זה תפתח תפריט שם ניתן לבחור את הכיתה הפעילה</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">לחיצה על כפתור זה תאפשר בחירה בין הכיתות</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">מצב צפייה ובקרה</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">סקירה</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">זהו מצב ברירת מחדל בתוכנה ומאפשר סקירה של כלל העמדות המחוברות. בנוסף, לחיצה על כפתור זה תאפשר פתיחה של עמדות נעולות או לצורך יציאה ממצב הדגמה</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">הדגמה במסך מלא</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">הצגת מסך המורה</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">הפסק הצגה</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">במצב זה, המסך שלך מוקרן על גבי כל העמדות המחוברות. יתרה מזו, המשתמשים נעולים ואינם יכולים לבצע כל פעולה במחשב</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">חלון הדגמה</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">הצגה בחלון</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">במצב זה, המסך שלך מוקרן בחלון הניתן למיזעור על גבי מסכי העמדות המחוברות. המשתמשים יכולים לעבור לחלונות אחרים ובכך להמשיך בעבודתם</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">נעל/שחרר שולחנות עבודה</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">נעל הכל</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">שחרר הכל</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">על מנת לקבל את מלוא תשומת הלב של המשתמשים ניתן לנעול את שולחן העבודה שלהם על ידי לחיצה על כפתור זה. במצב זה, המשתמשים נעולים, אינם יכולים לבצע כל פעולה במחשב והמסך יוחשך</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">שלחו הודעת טקסט</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">הודעת טקסט</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">לחיצה על כפתור זה מאפשרת שליחת הודעת טקסט לכל המשתמשים. למשל: הוראות למטלה חדשה וכדומה</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">הדלקת מחשבים</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">הדלקה</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">לחיצה על כפתור זה תדליק את כל המחשבים הנשלטים בתוכנה. כך נחסך הצורך להדליק כל מחשב ידנית ובניפרד</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">כבה מחשבים</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">כיבוי</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">לחיצה על כפתור זה תכבה את כל המחשבים. למשל: בסיום שיעור</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">תמיכה</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">תמיכה ישירה</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">אם נידרשת תמיכה במשתמש ספציפי, יש ללחוץ על כפתור זה ולהזין את שם המחשב או כתובתו</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">התאם/ישר</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">התאם חלונות וגודלם</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">בלחיצה על כפתור זה, חלונות התצוגה של עמדות התלמידים יותאמו לגודל המרבי במסך</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">סידור אוטומטי</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">כיוון וסידור מחדש של החלונות</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">בלחיצה על כפתור זה, כל החלונות המוצגים יסודרו מחדש באופן אוטומטי</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">שליטה ראשית בתוכנה</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">שליטה מרחוק</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">יציאה</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">כללי</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">צילומי מסך</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">הודעה מהמורה</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">ברוכים הבאים !</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">כאן ניתן לראות את סרגל העבודה המכיל מספר כפתורים. כל כפתור מחובר לעמדת עבודה. ניתן להציץ בעמדות העבודה פשוט על ידי לחיצה על על אחד החלונות</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">בעזרת ניהול כיתה, אתם יכולים לנהל את הכיתות ואת המחשבים שלכם. ניתן גם לראות אילו משתמשים מחוברים</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">מנהל תמונות המצב הוא כלי מאוד שימושי המאפשר ניהול של תמונות המצב שנילקחו</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">שינוי הגדרות התוכנה יבוצע דרך מנהל ההגדרות</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">סקירה</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">קצת מידע בסיסי על התוכנה והשימוש בה</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">שם משתמש</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">סיסמא</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>תלמיד %1 ב- %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>לא ניתן לבצע רישום לשירות 
-%1</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>לא ניתן לבצע התקשרות לאפלקציית ניהול השירות. (האם יש בידך הרשאות מתאימות?!) השירות הבא לא נירשם
-%1</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>%1
-שירות זה כבר רשום</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>לא ניתן לבצע רישום לשירות 
-%1</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>%1
-שירות זה נירשם בהצלחה</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>%1
-שירות זה לא ניתן לעצירה</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>%1
-בוטל רישום של שירות זה</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>%1
-לא ניתן להוציא שירות זה מרישום מאחר ואינו רשום</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>%1
-לא ניתן להוציא שירות זה מרישום</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>%1
-לא ניתן למצוא שירות זה</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>לא ניתן לבצע התקשרות לאפלקציית ניהול השירות. (האם יש בידך הרשאות מתאימות?!) - השירות הבא לא הוצא מרישום
-%1</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>לא ניתן לבצע התקשרות לאפלקציית ניהול השירות. (האם יש בידך הרשאות מתאימות?!) - השירות הבא לא הופסק
-%1</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">משתמש לא מוכר</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">צפייה בלבד</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">שליטה מרחוק</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">נעל תלמיד</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">שחרר תלמיד</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">צילום מסך</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">מסך מלא</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">מזער</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">יציאה</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">מתחבר %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">מחובר</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">התחברות</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">שם משתמש</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">סיסמא</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">דומיין</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">לא ניתן היה לבצע צילום מסך מאחר והתיקייה הבאה אינה קיימת או שאינה ניתנת ליצירה
-%1</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">צילום מסך</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">צילומי מסך</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">בלחיצה על כפתור זה מתאפשר ניהול צילומי המסך שנלקחו</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">כל צילומי המסך שנעשו רשומים כאן. ניתן לעשות צילום על ידי בחירה מתאימה בחלון התלמיד. ניהול צילומים אלו יתבצע בעזרת שני כפתורים שלמטה</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">משתמש:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">שם מחשב :</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">תאריך :</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">שעה :</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">תמיכה</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">שלחו הודעת טקסט</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">בשדה למטה יש להכניס את תוכן ההודעה שתישלח לרשימת משתמשים ניבחרים</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">מבצע התחברות ל
-%1</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>סקירה</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>הדגמה במסך מלא</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>חלון הדגמה</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>תצוגה נעולה</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>צפייה ישירה</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>שליטה מרחוק</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>אפשרו לתלמיד להציג הדגמה</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>שלחו הודעת טקסט</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>נתק משתמש</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>צילום מסך</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>הדלקה</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>איתחול</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>כיבוי</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>בצע פקודות</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/hu.qm b/lib/resources/hu.qm
deleted file mode 100644
index daaad4f..0000000
Binary files a/lib/resources/hu.qm and /dev/null differ
diff --git a/lib/resources/hu.ts b/lib/resources/hu.ts
deleted file mode 100644
index 09fc86d..0000000
--- a/lib/resources/hu.ts
+++ /dev/null
@@ -1,1794 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="hu_HU">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Az iTALC névjegye</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Névjegy</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Szerzők</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Fordítás</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished">A magyar fordítást készítették a Novell PSH Kft. munkatársai:
-Maxi Attila, Kovács Lajos és Óvári Ákos
-
-Amennyiben hibát talál a magyar fordításban, kérem mielőbb jelezze a Novell PSH Kft. munkatársai felé: huedudl at npsh.hu e-mail címen.
-
-Ha szeretné lefordítani másik nyelvre is, kérem jelezze az iTALC fejlesztőcsapatának.</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Licence</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished">iTALC - Intelligent Teaching And Learning with Computer
-
-Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions
- {2004-2013 ?}</translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Ebben a munkamenetben soha</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Ebben a munkamenetben mindig</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished">Hozzáférés megerősítése a munkaasztalhoz</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished">%1 felhasználó a(z) %2 gépről hozzáférést kezdeményezett az Ön munkaasztalához. Engedélyezi?</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Osztályterem-Kezelés</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Ezen a munkaasztalon kezelheti a számítógépeket és az osztálytermeket</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>Itt tudja kezelni a számítógépeit és az osztálytermeit. Számítógép vagy osztályterem hozzáadásához kattintson az egér jobb gombjával a listára.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Osztálytermek/Számítógépek</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>IP-Cím</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Felhasználók</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Felhasználók megjelenítése</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">A lenyíló menü segítségével (egér jobb gomb megnyomásával) hozzáadhatja, törölheti a számítógépeket vagy osztálytermeket.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Exportálás fájlba</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">A gomb segítségével exportálhatja a számítógépeket és a felhasználókat a szöveges állományba. A vizsga befejeztével egyszerűen begyűjtheti ezeket a fájlokat. Néhány alkalommal szükséges lehet, mert a vizsgával már korábban végzett és kijelentkezett felhasználók már nem érhetőek el a rendszerben.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Tanári számítógépek elrejtése</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Megtekint/Elrejt</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Beállítások szerkesztése</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Törlés</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Összes számítógép megtekintése az osztályteremben</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Összes számítógép elrejtése az osztályteremben</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Név szerkesztése</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Osztályterem törlése</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Számítógép hozzáadása</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Osztályterem hozzáadása</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>Nem található a konfigurációs fájl</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translatorcomment>Legalább egy számítógépterem csoportot definiálnunk kell ahhoz, hogy a számítógép(ek)et megfelelően tudjuk kezelni a bal oldalsávon.</translatorcomment>
-        <translation type="unfinished">Nem nyitható meg a %1 konfigurációs fájl.
-Legalább egy számítógépterem csoportot definiálnunk kell ahhoz, hogy a számítógép(ek)et megfelelően tudjuk kezelni a bal oldalsávon.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Hiba a konfigurációs fájlban</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Hiba történt a %1 konfigurációs fájl feldogozása közben.
-Kérem módosítsa, máskülönben törlésre kerülhet a fájl és újból létre kell hozni az összes osztályterme(ke)t és számítógépe(ke)t.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Hiba történt a %1 konfigurációs fájl feldogozása közben.
-Kérem módosítsa, máskülönben törlésre kerülhet a fájl.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Kimeneti fájl kiválasztása</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Szöveges fájlok (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished">Kiválasztottak műveletei</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>Műveletek</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">%1 terem műveletei</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Új név hozzáadása az osztályteremhez</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Kérem írja be az új osztály terem nevét "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Biztos benne, hogy törli a "%1" osztálytermet?
-Az összes számítógép törlésre kerül!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>Hiányzó osztályterem</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Új számítógép hozzáadása előtt, hozzon létre egy osztálytermet.
-Szeretne létrehozni új osztálytermet?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Új osztályterem</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Kérem írja be az osztályterem nevét, amit létre szeretne hozni.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>Ismeretlen állapot</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Nincsen felhasználó bejelentkezve</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>A számítógép nem érhető el</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Aktuális bemutatói futás</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Blokkolt asztal</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translatorcomment>Biztosan ki szeretné jelentkeztetni az összes felhasználót a kijelölt számítógépekről?</translatorcomment>
-        <translation type="unfinished">Biztosan szeretné,hogy az összes felhasználó kijelentkezzen a számítógépekről?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translatorcomment>Biztosan ki szeretné jelentkeztetni az összes felhasználót a kijelölt számítógépekről?</translatorcomment>
-        <translation type="unfinished">Biztosan szeretné,hogy az összes felhasználó kijelentkezzen a kijelölt számítógépekről?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Felhasználói kijelentkezés</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Biztos benne, hogy újra szeretné indítani az összes számítógépet?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished">Biztos benne, hogy újra szeretné indítani az összes kijelölt számítógépet?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Számítógépek újraindítása</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Biztos benne, hogy ki szeretné kapcsolni az összes számítógépet?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished">Biztos benne, hogy ki szeretné kapcsolni az összes kijelölt számítógépet?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Érvénytelen MAC azonosító</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Érvénytelen MAC azonosítót adott meg. Hagyja üresen a mezőt vagy adjon meg egy érvényes MAC azonosítót (használjon ":" az elválasztáshoz!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Kliens beállítások</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP cím vagy gépnév</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adja meg az IP címet vagy gépnevet, amivel iTALC elérheti a kliens  [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Név</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adjon meg egy becenevet a géphez, amit szeretne hogy az iTALC-ban m [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished">MAC azonosító</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardver/MAC azonosítója a kliensnek - csak a számítógép bekapcsolás [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Osztályterem</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Típus</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Diák számítógép</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Tanári számítógép</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Hozzá nem rendelt számítógép</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished">Hiányzó IP cím/gépnév</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished">Még nem adta hozzá az IP címet vagy a gépnevet a számítógéphez!</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Képfrissítés gyakorisága</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher va [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> másodperc</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Felhasználói felület</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Felugró üzenetek tiltása</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished">Felirat nélküli eszköztár</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Szerepkörök (hozzáférési kulcsok szerint)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Itt választhatja ki a szerepköröket. Csak akkor változtassa meg, ha biztosan tudja, hogy mit csinál. Az is előfordulhat máskülönben, hogy nem fog tudni hozzáférni a kliens gépekhez, csak akkor ha visszaállítja az eredeti beállításokat.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Tanár</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Adminisztrátor</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Támogató</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Más</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Tartomány beállításai</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domain</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Dupla kattintás a kliens ablakhoz</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Távoli hozzáférés</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Teljes képernyős élő nézet</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Fe [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">iTALC konfiguráció</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Ezen a munkaterületen szabhatja testre az iTALC-t az Ön igényeinek megfelelően.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC Bemutató</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Bejelentkezési probléma</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translatorcomment>Valaki (IP: %1) megpróbálta elérni ezt a számítógéphez, de nem tudta hitelesíteni magát!</translatorcomment>
-        <translation type="unfinished">Valaki (IP: %1) megpróbált hozzáférni ehhez a számítógéphez, de nem tudta megfelelően hitelesíteni magát!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished">Túl sok próbálkozás miatt a VNC bejelentkezések száma hibára futott.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished">VNC bejelentkezési probléma.</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished">VNC szerver lezárta a kapcsolatot.</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished">iTALC hozzáférési kulcs Varázsló</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished">Hozzáférési kulcs Készítése/Importálása</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished">A Varázsló segítségével létrehozhatunk vagy importálhatunk hozzáférési kulcsokat.</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished">Hogyan működik ?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished">A hozzáférési azonosítás egy kulcspár segítségével valósul meg, ami a privát kulcs és publikus kulcsból áll.
-
-A privát kulcs a master (tanári) számítógépen azonosítja a kliens gépeket. Nagyon fontos, hogy csak azonosított felhasználóknak legyen joga a privát kulcs olvasásához!
-
-A publikus kulcs a kliens (diák) számítógépein azonosítja a bejövő kérések hitelességét.</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished">Varázsló mód</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished">Kérjük válassza ki, hogy létrehozni vagy importálni szeretne egy új hozzáférési kulcsot a kliens számára.</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished">Új hozzáférési kulcsok készítése (tanári számítógép)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished">assistantModeButtonGroup</translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished">Publikus kulcs importálás (kliens számítógép)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished">Szerepkör kiválasztása</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished">Kérjük válassza ki azt a felhasználót, aki számára létrehonzi vagy importálni szeretné a hozzáférési kulcsot:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Tanár</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Adminisztrátor</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished">Támogatók</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Más</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished">A felhasználói szerepkörökhöz rendelt hozzáférési kulcsok lehetővé teszik a párhuzamos hozzáférést. Például: Minden osztályteremhez különböző tanári kulcsok tartozhatnak, de az iskolára nézve elegendő egy támogatói (support) kulcs készítése.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished">Könyvtárak</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished">Publikus kulcspár exportálása (tanári számítógép)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished">A hozzáférési kulcsok mentése egyéni könyvtárba</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished">Kérem határozza meg a publikus kulcs importálásához az elérési útvonalat.</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished">Összefoglalás</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished">A következő műveletekre kerül sor:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished">• Új hozzáférési kulcs elkészítése</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished">• Publikus kulcs importálás</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"><unknown></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>• Hozzáférési kulcs(ok) másolása ide:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>• Publikus kulcs exportálás ide:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished">• Felhasználói szerepkör beállítása:</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished">Válassza ki azt a könyvtárat, ahonnan exportálni szeretné a publikus kulcsot</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished">Kulcs fájlok (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished">Érvénytelen publikus kulcs</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished">A kiválasztott fájl nem tartalmaz érvényes hozzáférési publikus kulcs adatokat az iTALC-hoz!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished">Cél könyvtár megadása</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished">Hozzáférési kulcs készítése</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished">Nem sikerült eltávolítani,a létező fájlt: %1.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished">Sikertelen volt a publikus kulcs exportálás a %1-ról a %2-re.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished">Sikeresen létrehozta a hozzáférési kulcspárt. A mentése helye: %1 és %2 könvytárban.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished">A hozzáférési kulcs készítése közben probléma történt. Valószínűleg nincsen írási joga a kiválasztott könyvtárba.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished">Publikus kulcs importálása</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished">A publikus kulcs importálás közben hiba lépett fel. Önnek valószínűleg nincsen olvasási joga a forrás fájlból, vagy írási joga a cél fájlba.</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished">A publikus kulcs importálása sikeresen végrehajtódott a %1-ba.</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">Képernyő blokkolása</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished">Bejelentkezési csoport szerkesztő</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished">Kérjük a csoportokhoz rendelje hozzá azokat, akiknek engedélyezi az iTALC hálózati a hozzáférést.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished">Minden csoport</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished">Csoportok iTALC jogosultságokkal</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Műveletek</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Általános</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Kilépés</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished">iTALC Kezelő Konzol</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished">iTALC-Szerver</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished">Útvonalak</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished">Hitelesítés</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished">iTALC-Szolgáltatás</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translatorcomment>Tálca icon elrejtése</translatorcomment>
-        <translation type="unfinished">Icon elrejtése a tálcáról</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished">Automatikus indítása</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished">További paraméterek</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished">Szolgáltatás indítása</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished">Szolgáltatás leállítása</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished">Státusz:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished">Leállítva</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished">Bejelentkezés</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished">Naplófájlok helye</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished">Naplózási szint</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished">Semmi</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished">Csak a kritikus üzenetek</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished">Hiba és kritikus üzenetek</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished">Figyelmeztető és kritikus üzenetek</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished">Tájékoztató, figyelmeztető és hiba üzenetek</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished">Az összes hiba üzenet</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished">Naplófájl maximális mérete</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>MB</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished">Naplófájlok ürítése</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished">Az asztal rögzítése</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translatorcomment>A réteg rögzítésének engedélyezése az ablakban (félig átlátszó)</translatorcomment>
-        <translation type="unfinished">Átfedő ablakok rögzítése (félig átlátszó)</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished">Alacsony felbontás (turbó mód)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished">Bemutató szerver</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished">Hálózat</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished">Elsődleges szerver port</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished">Bemutató szerver port</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished">Hozzáadás a tűzfal kivételekhez</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished">Konfigurációs fájlok</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished">Globális beállítások</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished">Személyes beállítások</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished">Mentett képernyőképek könyvtára</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Képernyóképek</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished">Hitelesítési eljárás</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished">Hozzáférési kulcs kezelő</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished">Bejelentkezési beállítások</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished">&Fájl</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished">&Segítség</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished">&Kilépés</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished">Ctrl+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished">Beállítások &mentése fájlba</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished">Beállítások mentése fájlba</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished">Ctrl+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translatorcomment>Beállítások be&töltése fájlból</translatorcomment>
-        <translation type="unfinished">Beállítások be&töltése fájlból</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished">Ctrl+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Az iTALC névjegye</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished">Qt-ról</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished">Főablak</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished">toolBar</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished">iTALC Management Konzol %1</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished">Futtatás</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished">Beállítások betöltése fájlból</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished">XML-fájlok (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished">Beállítások mentése fájlba</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished">Nem mentett beállítások</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished">A beállítások még nincsenek mentve. Biztosan kilép?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished">Nem írhatóak ki a beállítások</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished">A konfigurációs kezelő visszajelzése alapján nem írható a konfiguráció. Kérlek indítsd el adminisztrátorként az iTALC Management Konzolt.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished">Az összes beállítást sikeresen végrehajtottuk.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished">Hiba lépett fel a beállítások érvényre juttatása közben!</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished">Nincsen írási engedélye</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Nem olvasható/írható vagy hozható létre a %1 könyvtár! Győződjön meg róla, hogy engedélyezett-e az iTALC számára létrehozni vagy írni ebben a  könyvtárba.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Osztályterem</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Osztályterem választás</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">A gombra kattintva kiválasztható, hogy melyik legyen az aktív osztályterem.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Az osztálytermek között váltáshoz kattintson a gombra.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Áttekintési mód</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Áttekintés</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translatorcomment>Ezzel az alapbeállítással megtekintheti az elérhető gépek listáját az iTALC-ban. A gombra kattintva feloldhatja a munkaállomások blokkolását vagy kiléphet az oktatói bemutató üzemmódból.</translatorcomment>
-        <translation type="unfinished">A menü segítségével megtekintheti az elérhető gépeket. A gombra kattintva feloldhatja a munkaállomások blokkolását vagy kiléphet az oktatói bemutató üzemmódból.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Oktatói bemutató a teljes képernyőn</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Bemutató</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Bemutató vége</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">Ebben az üzemmódban az oktató megoszthatja a képernyőjének a tartalmát. A megosztott képernyő teljes méretben fog megjelenni a tanulók számítógépein. A bemutató közben a tanulók nem foglalkozhatnak mással, mert a beviteli eszközök (egér, billentyűzet) blokkolásra kerülnek.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Oktatói bemutató ablak méretben</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Bemutató ablak</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">Ebben az üzemmódban az oktató megoszthatja a képernyőjének a tartalmát. A megosztott képernyő ablak méretben fog megjelenni a tanulók számítógépein.
-A bemutató közben a felhasználók mással is foglalkozhatnak.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Képernyő Blokkolása/feloldása</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Blokkolás</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Feloldás</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Ezzel a gombbal az összes diák gépét blokkolhatja. Ebben az üzemmóddal az összes bemeneti eszközt blokkolja és a képernyők elsötétülnek.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Üzenet küldése</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Szöveges üzenet</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">A gomb segítségével üzenet küldhet minden felhasználónak. (például: "Kezdhetitek az új feladatot megoldani", stb..).</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Számítógépek bekapcsolása</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Bekapcsolás</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">A számítógépek bekapcsolásához kattintsunk a gombra. Így nem kell minden gépet egyesével bekapcsolnunk. (A hardvernek is támogatnia kell a "Wake-on-Lan funkciót")</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Számítógépek kikapcsolása</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Kikapcsolás</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Az összes elérhető számítógép kikapcsolásához kattintson a gombra. (az óra végeztével kikapcsolhatja az összes számítógépet).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Támogatás</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Közvetlen támogatás</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">Ha egy diáknak szüksége van támogatásra, a gombra kattintva a gép nevét vagy az IP címét beírva csatlakozhat és segítséget nyújthat.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Elrendezés</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Ablak méretének beállítása</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">A gombra kattintva a lehető legnagyobb méretben tekinthetjük meg a felhasználók asztalát. Továbbá az összes ablakot ehhez igazíthatjuk.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Automatikus nézet</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Az ablakok automatikus újrarendezése és átméretezése</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Ide kattintva az elérhető ablakok sorrendét módosíthatjuk vagy rendezhetjük át.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Tanár kontroll</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Távoligép kezelés</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished">Az iTALC nem tudta modosítani a Windows "autostart" beállításait.</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished">Az iTALC nem tudta modosítani a Windows szolgáltatás argumentumait.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished">Az iTALC nem tudta megváltoztatni a Windows tűzfal konfigurációját.</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished">Hibakeresés</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished">Képernyő blokkolása asztalváltáskor (kísérleti)</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translatorcomment>Hibanaplózás az elsődleges kimenetre /Standard error output-ra történő naplózás</translatorcomment>
-        <translation type="unfinished">Naplózás az elsődleges hiba kimenetre</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translatorcomment>Naplózás a rendszer esemény naplójába / A (Windows )rendszer eseménynapló használata</translatorcomment>
-        <translation type="unfinished">Naplózás a Windows eseménynaplóba</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished">Backend</translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished">VNC reflektor</translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished">iTALC 1 Bemutató szerver</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished">Többszálú futtatás (ajánlott a VNC reflektor használatánál)</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished">A HTTP szerver futásának engedélyezése a JavaViewer alkalmazáshoz</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished">HTTP-Szerver port</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished">Kapcsolatok engedélyezése kizárólag a helyi gépről</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished">Kulcsos azonosítás</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished">ACL-alapú bejelentkezés</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished">Publikus kulcs könyvtára</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished">Privát kulcs könyvtára</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished">Hozzáférési kulcs Varázsló</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished">Engedélyek kezelése</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished">Teszt</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished">Hozzáférés megerősítése</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translatorcomment>Beállíthatja az iTalcot, hogy felhasználói engedélyt kérjen a számítógéphez való hozzáféréshez, amikor bizonyos hitelesítési módszereket alkalmaz.</translatorcomment>
-        <translation type="unfinished">A számítógépek hozzáférésének hitelesítés-módszereinek beállításai.</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished">Bejelentkezés hitelesítéssel</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished">Megerősítés nélkül engedélyezzük a hozzáférést ugyan annak a felhasználónak</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished">Hibakeresés az iTALC-ban</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished">Amennyiben rendellenes működést tapasztal az iTALC használata közben, kérem hogy mielőbb tájékoztassa a fejlesztőket a problémáról. Az útmutató segítségével könnyedén elkészítheti a hibajelentést. A visszajelzések segítségével elkerülhetőek lesznek a működésebeli problémák, és hozzájárulhat a program tökéletesítéséhez is.
-
-Ha a hiba nem reprodukálható, akkor hagyja ki a 1) -3) lépéseket.</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation>1)</translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished">Törölje a naplófájlokat. Az "Általános" menüpont alatt találja a "Naplófájlok ürítése" gombot.</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation>2)</translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished">Az "Általános" menüpontban válassza ki a naplózási szintnek: "Az összes hiba üzenet".</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation>3)</translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished">Ismételje meg azokat a lépéseket, amik a hibához vagy a rendellenes működéshez vezettek.</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation>4)</translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished">A gombra kattintva készíthet-, és mentheti el a hibajelentést.</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished">Hibajelentés készítése</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation>5)</translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished">Kérem látogasson el <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">az iTALC hibajelentő weboldalára</a>, majd nyisson egy hibajegyet. A 3) lépésben leírtakat hajtsa végre, és a 4) lépésnek megfelelően mentse el az elkészült hibajelentést.</p>
-<br/>
-<br/>
-Megjegyzés: amennyiben a hiba mind  a master (tanári) és a kliens (diák) számítógépeken is előfordult, akkor csatolja mind a két számítógéphez tartoró hibajelentését.</translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished">iTALC szolgáltatás újraindítása</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished">Az összes beállítást sikeren elmentettük. Annak érdekében, hogy a beállítások érvényre jussanak, újra kell indítani az iTALC szolgáltatást. Újraindítja ?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished">iTALC szolgáltatás indítása</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished">iTALC szolgáltatás leállítása</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished">Az iTALC szolgáltatást arra az átmeneti időre le kell állítani, amíg a naplófájlt eltávolítjuk. Folytassuk?</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished">A naplófájl törölve</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished">Az naplófájlok ürítése sikeresen megtörtént.</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished">Hiba</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished">Nem törölhető az összes naplófájl.</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished">Bejelentkezési hitelesítés vizsgálata</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished">A hozzáférési hitelesítés sikeresen megtörtént.</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished">A hozzáférési hitelesítés sikertelenül fejeződött be!</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished">Bug jelentés elmentése</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished">iTALC bug report archiválás (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished">Az iTALC "bug" hibajelentések mentése megtörtént</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished">Az iTALC hiba jelentése mentésre került a %1 -ba. A jelentés tartalmazza az iTALC naplófájlt és egyéb információkat az operációs rendszerről. Ezt csatolhatja a hibajelentéshez.</translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished">Az iTALC szolgáltatás kapcsolata megszakadt</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished">Nem létesíthető kapcsolat a helyi iTALC szolgáltatással. Feltehetően rossz hitelesítési adatokkal vagy kulcs azonosítással próbálkozik. Próbálja meg ismét vagy lépjen kapcsolatba a rendszer adminisztrátorral a probléma megoldása érdekében, ehhez használja az iTALC Management Konzolt.</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished">Lehetetlen a hitelesítés</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Nem találhatóak vagy már lejártak a hitelességet érvényesítő kulcsok. Kérem hozzon létre új hitelesítő kulcsokat az iTALC Management Konzol segítségével. Az iTALC Management Konzol segítségével választhat más azonosítási eljárások közül. Nem megfelelő azonosítási eljárási esetében az iTALC nem fog megfelelően működni.</translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Üzenet a tanártól</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Üdvözlöm az iTALC-ban!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translatorcomment>Ezen a munkaterületen található vezérlő gombok segítségével végezhetjük el az alapvető adminisztrációs műveleteket. Segítségével tudunk csatlakozni különböző munkaasztalokhoz. Az elérhető munkaterület(ek) megjelölése a megfelelő gombra kattintva választható ki.
-vagy Az elérhető munkaterület(ek) / munkaasztal(ok) kiválasztásához kattintson a megfelelő gombra.</translatorcomment>
-        <translation type="unfinished">A munkafelületen található vezérlő gombok segítségével végezhetjük el az alapvető adminisztrációs műveleteket. Ennek segítségével tudunk csatlakozni más munkaállomásokhoz. Az elérhető munkaterület(ek)et / munkaasztalok(at) a megfelelő gombra kattintva választhatjuk ki.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">Csak a felügyelő személy kezelheti az osztálytermeket és a számítógépeket. Ezenkívül a bejelentkezett felhasználókat tudja megtekinteni.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translatorcomment>Nagyon hasznos a képernyőkép készítő eszköz. /A képernyőkép készítő eszköz nagyon hasznos</translatorcomment>
-        <translation type="unfinished">Nagyon hasznos a képernyőkép készítő eszköz. Segítségével könnyedén kezelhetjük a különböző munkaasztalokról elkészült képeket.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translatorcomment>A testreszabáshoz a konfigurációs használjuk.</translatorcomment>
-        <translation type="unfinished">Természetesen az iTALC is testreszabható. A munkaasztalok beállítását a konfigurációs menüből érhetjük el.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Az iTALC névjegye</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Áttekintés</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Néhány alapvető információt megtalál az iTALC-ról és arról, hogy, hogyan használjuk.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished">Kérem írja be a felhasználó nevét és a jelszavát a iTALC kliens indításához.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Felhasználó</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Jelszó</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished">iTALC bejelentkezés</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation type="unfinished">Nem sikerült regisztrálni a %1 szolgáltatást.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation type="unfinished">A Service Control Manager nem tudott kapcsolódni (rendelkezik Ön a megfelelő jogosultságokkal?!) - a '%1' szolgáltatás nem volt regisztrálva.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation type="unfinished">A %1 szolgáltatás már regisztrálva van.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation type="unfinished">Nem regisztrálódott a %1 szolgáltatás.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation type="unfinished">A %1 szolgáltatás sikeresen regisztrálódott.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation type="unfinished">Nem sikerült leállítani a %1 szolgáltatást.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation type="unfinished">A %1 szolgáltatás már nincsen regisztrálva.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation type="unfinished">Ez a %1 szolgáltatás nem regisztrált ezért nem lehet törölni.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation type="unfinished">A %1 szolgáltatást nem lehetett regisztrálni.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation type="unfinished">Nem található a '%1' szolgáltatás.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation type="unfinished">A Service Control Manager nem tudott kapcsolódni (rendelkezik Ön a megfelelő jogosultságokkal?!) - a '%1' szolgáltatás még nem volt regisztrálva.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation type="unfinished">A Service Control Manager nem tudott kapcsolódni (rendelkezik Ön a megfelelő jogosultságokkal?!) - a '%1' szolgáltatás nem állt meg.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation type="unfinished">Az iTALC kliens %1 elérhető %2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished">Elöl nézet (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished">Távoli hozzáférés (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">ismeretlen felhasználó</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Csak nézet</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Távoli hozzáférés</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Diák gép blokkolása</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Diák gép feloldása</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Képernyőképek</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Teljes képernyő</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Ablak</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Kilépés</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">A kapcsolódás folyamatban %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Kapcsolódva.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Távoli bejelentkezés</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished">Töltse ki az alábbi mezőket, adja meg a felhasználói nevét, jelszavát vagy domain név alapú azonosítást is használhatja. Ezeket az információkat fogják használni a számítógép bejelentkezéséhez.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Felhasználó</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Jelszó</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domain</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished">Parancs futtatása</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished">Kérem adja meg a parancsokat amiket futtatni szeretne a kijelölt kliens gépeken. Több parancs futtatásához használjon új sorokat.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished">ismeretlen</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Nem lehet képernyőképeket készíteni, ,mert a %1 könyvtár még nem létezik, és nem is hozható létre.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Képernyőkép</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Képernyőképek</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">A munkaterület segítségével egyszerűen kezelheti a képernyőképeket.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translatorcomment>You can make snapshots by selecting the according entry in the context-menu of a client-window. =? Csinálhat pillanatképet a felhasználói felület (képernyő) megfelelő szövegének a kiválasztásával.</translatorcomment>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Felhasználó:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Gépnév:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Dátum:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Idő:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished">Nézet</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished">Törlés</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Támogatás</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished">Kérem írja be annak a gépnek az IP címét vagy a nevét amihez csatlakozni szeretne.</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>Szöveges üzenet küldése</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Ide írhatja be azt az üzenetet, amit elszeretne küldeni a kijelölt tanulóknak.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Kapcsolat létrehozása a %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Áttekintés</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Bemutató a teljes képernyőn</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Bemutató ablakban</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Képernyő blokkolása</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Távoli gép követése (teljes képernyőn)</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Távoli számítógép átvétele</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Oktatói bemutató indítása a tanulói gépen</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Szöveges üzenet küldése</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Kijelentkezés</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Képernyőkép készítése</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Bekapcsolás</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Újraindítás</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Kikapcsolás</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Parancs futtatása</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/icon16.png b/lib/resources/icon16.png
deleted file mode 100644
index 2e7d2b5..0000000
Binary files a/lib/resources/icon16.png and /dev/null differ
diff --git a/lib/resources/icon22.png b/lib/resources/icon22.png
deleted file mode 100644
index a8977ab..0000000
Binary files a/lib/resources/icon22.png and /dev/null differ
diff --git a/lib/resources/icon32.png b/lib/resources/icon32.png
deleted file mode 100644
index 4dafe35..0000000
Binary files a/lib/resources/icon32.png and /dev/null differ
diff --git a/lib/resources/icon64.png b/lib/resources/icon64.png
deleted file mode 100644
index b03c8c5..0000000
Binary files a/lib/resources/icon64.png and /dev/null differ
diff --git a/lib/resources/info.png b/lib/resources/info.png
deleted file mode 100644
index c65f616..0000000
Binary files a/lib/resources/info.png and /dev/null differ
diff --git a/lib/resources/it.qm b/lib/resources/it.qm
deleted file mode 100644
index e59c8e1..0000000
Binary files a/lib/resources/it.qm and /dev/null differ
diff --git a/lib/resources/it.ts b/lib/resources/it.ts
deleted file mode 100644
index 98e5525..0000000
--- a/lib/resources/it.ts
+++ /dev/null
@@ -1,1773 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="it_IT">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>Informazioni su iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>Informazioni su</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>Autori</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Traduzione</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation>Rino Andriano <rino/dot/andriano/at/istruzione/dot/it></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Licenza</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation>Conferma l'accesso</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation>L'utente %1 sul computer %2 cerca di accedere alla tua videata. Consenti l'accesso?</translation>
-    </message>
-    <message>
-        <source>Never for this session</source>
-        <translation>Mai per questa sessione</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Sempre per questa sessione</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Gestione Aule</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Usa quest'area di lavoro per configurare e gestire le aule e i computer.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>Qui si possono gestire le aule e i computer. Puoi aggiungere computer e/o aule utilizzando il pulsante destro del mouse.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Aule/computer</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>Indirizzo-IP</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Nomi Utente</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>Mostra nomi utente</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Usa il menù contestuale (pulsante-destro del mouse) per aggiungere/rimuovere computer o aule.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>Esporta su file di testo</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>Usa questo pulsante per esportare l'elenco degli utenti in un file di testo. Puoi utilizzare questo file, ad esempio, dopo l'esecuzione di un esame. Ciò può essere necessario, ad esempio, se alcuni utenti hanno terminato,  si sono disconnessi troppo presto e non è possibile recuperare i loro file alla fine dell'esame.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Nascondi i computer di tipo Insegnante</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Mostra/nascondi</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Modifica Impostazioni</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Rimuovi</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Mostra tutti i computer dell'aula</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Nascondi tutti i computer dell'aula</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Modifica nome</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Rimuovi l'aula</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Aggiungi un computer</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Aggiungi un'aula</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>Non è stato trovato un file di configurazione</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>Non è possibile aprire il file di configurazione %1.
-E' necessario configurare almeno un'aula con i relativi computer utilizzando il menù contestuale nell'area di lavoro Gestione-computer. Gestione-computer è disponibile nella barra applicazioni situata a sinistra all'interno della finestra  del programma.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Errore nel file di configurazione</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>Si è verificato un errore nell'interpretazione del file di configurazione %1.
-Bisogna modificarlo con un editor. In alternativa, dovresti cancellarlo e riconfigurare aule e computer nuovamente.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Si è verificato un errore nell'interpretazione del file di configurazione %1.
-Bisogna modificarlo con un editor. In alternativa, dovresti cancellarlo e riconfigurare aule e computer nuovamente.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Indica il file di output</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>File di testo (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>Azioni per i selezionati</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>Azioni</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>Azioni per %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Nuovo nome per l'aula</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Inserisci un nuovo nome per la aula "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Sei sicuro di voler rimuovere l'aula "%1"?.
-Attenzione: saranno rimossi anche i computer dell'aula!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>Aula non presente</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>Prima di aggiungere un computer, bisogna configurare almeno un'aula.
-Vuoi creare un'aula adesso?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Nuova aula</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Inserisci il nome dell'aula che vuoi creare.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>Stato sconosciuto</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Nessun utente in linea</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>PC non raggiungibile</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>Presentazione in corso</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>Desktop bloccato</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Sei sicuro di voler disconnettere gli utenti su tutti i computer visibili?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Sei sicuro di voler disconnettere gli utenti su tutti i computer selezionati?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Disconnetti utente</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Sei sicuro di volere riavviare tutti i computer visibili?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Sei sicuro di volere riavviare tutti i computer selezionati?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>Riavvia i computer</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Sei sicuro di voler spegnere tutti i computer visibili?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Sei sicuro di voler spegnere tutti i computer selezionati?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Client settings</source>
-        <translation>Impostazioni client</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>Indirizzo IP/Nome Computer</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">inserisci un indirizzo IP o il nome letterale con il quale iTALC può raggiungere il c [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>Nome</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nickname facoltativo del computer visualizzato in iTALC.</p></body></h [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Indirizzo MAC-address del client - utilizzato solo per accendere il computer gestito& [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Aula</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>Tipo</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>Computer Studente</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>Computer Insegnante</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>Altro computer/non definito</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation>Manca Indirizzo IP/Nome Computer</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation>Non è stato specificato l'indirizzo IP o il nome del computer!</translation>
-    </message>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>Indirizzo MAC-address non valido</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>E' stato specificato un MAC-address non valido. Lasciare il campo vuoto o inserire un indirizzo MAC-address valido (utilizza":" come separatore!)</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>Intervallo tra gli aggiornamenti</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qui è possibile indicare l'intervallo di aggiornamento dei computer client. Un v [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation> secondi</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>Interfaccia Utente</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Non mostrare i suggerimenti (balloon-tooltips) per i pulsanti della barra</p>&l [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Seleziona questa opzione se ti infastidiscono i suggerimenti (balloon-tooltips) quand [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>Nessun suggerimento (ballon-tooltips)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Non mostrare il testo nella barra degli strumenti</p></body></html> [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Barra strumenti senza testo</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Il tuo ruolo (necessita di chiavi adeguate!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qui si può impostare il tuo ruolo. Cambialo solo se sai ciò che stai facendo! Altrimenti non sarai più in grado di accedere ai computer client fino al ripristino del ruolo.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Insegnante</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Amministratore</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>Assistente</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Altro</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>Impostazioni per il multi-logon</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Dominio</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>Azione del doppio-click sulla finestra client</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">(new line)p, li { white-space: pre-wrap; }(new line)</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">(new line)<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-in [...]
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlla</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>Osserva</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Attenzione: alcune i [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Opzioni</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>In questo spazio di lavoro puoi personalizzare iTALC secondo le tue esigenze.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Presentazione</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>Errore di autenticazione</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Qualcuno (IP: %1) cerca di accedere a questo computer ma non riesce ad autenticarsi!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>L'autenticazione di VNC non è riuscita -effettuati numerosi tentativi</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>L'autenticazione di VNC non è riuscita</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>Il server VNC ha chiuso la connessione</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation>Assistente Chiavi di accesso per iTALC</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation>Crea/Importa chiavi di accesso per iTALC</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation>Questo programma ti aiuterà a creare o importare le chiavi di accesso per iTALC</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation>Come funziona?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation>Le chiavi (crittografiche) di accesso per iTALC sono composte da due parti: una privata, l'altra pubblica.
-
-Utilizzando la chiave privata, gli utenti del computer docente saranno in grado di accedere a tutti i computer studente (client). E' importante che solo gli utenti autorizzati abbiano accesso al file della chiave privata.
-
-La chiave pubblica, invece, è utilizzata dai computer studente per verificare che ogni richiesta di connesione sia  autorizzata.
-</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation>Modalità assistente</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation>Scegli se vuoi creare una nuova coppia di chiavi o importare la chiave pubblica sul client</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation>Crea una nuova coppia di chiavi (solo sul computer master/docente)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation>Importa la chiave pubblica (computer client/studente)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation>Scegli il ruolo utente</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation>Scegli un ruolo utente per cui creare o importare le chiavi di accesso:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Insegnante</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Amministratore</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation>Assistente</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Altro</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation>I ruoli utente permettono l'utilizzo parallelo di chiavi multiple. Per esempio si potrebbero avere chiavi di accesso per ciascuna Aula, mentre gli Assistenti utilizzano la stessa chiave per tutta la scuola (tutte le Aule).</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation>Cartelle</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation>Cartella in cui esportare la chiave pubblica (del computer master/docente)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation>Personalizza le cartelle per le chiavi di accesso</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation>Specifica la destinazione per l'importazione della chiave pubblica</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation>Riepilogo</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation>Le seguenti azioni saranno eseguite:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation>• Crea nuove Chiavi di accesso</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation>• Importa la chiave pubblica da</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation><sconosciuto></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>• Salva la/e chiavi in</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>• Esporta la chiave pubblica in</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation>• Configura le chiavi per il ruolo utente di </translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation>Scegli la cartella in cui esportare la chiave pubblica</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation>File Chiavi (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation>Chiave pubblica non valida</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation>Il file selezionato non contiene una chiave pubblica valida per iTALC!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation>Indica la cartela di destinazione</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation>Creazione chiavi di accesso</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation>Non posso rimuovere il file già esistente %1.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation>Non è riuscita 'esportazione della chiave pubblica da %1 a %2.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation>Le chiavi di accesso sono state create e salvate in %1 e %2.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation>Si è verificato un errore durante la creazione delle chiavi di accesso. Probabilmente non si dispone dei diritti di accesso alle cartelle indicate.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation>Importa la chiave pubblica</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation>Si è verificato un errore durente l'importazione della chiave pubblica. Probabilmente non si dispone dei diritti di accesso in lettura alla chiave o in scrittura al file di destinazione.</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation>La chiave pubblica è stata importata in %1.</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>Schermo Bloccato</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation>Editor Gruppi di Accesso</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation>Aggiungi i gruppi ai cui membri sarà autorizzato l'accesso al computer nella rete iTALC.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation>Tutti i gruppi</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation>Gruppi con privilegi di accesso per iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>Azioni</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>MainWindow</source>
-        <translation>FinestraPrincipale</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation>BarraStrumenti</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>Non è possibile leggere/scrivere o creare la cartella %1! Per autorizzare iTALC, devi essere sicuro di avere i permessi per modificare questa cartella.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Aula</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>Cambia aula</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>Puoi usare questo pulsante per cambiare l'aula da gestire.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>Clicca su questo pulsante, per cambiare aula.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>Panoramica</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>Panoramica</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>Questa è la modalità predefinita di iTALC e permette di avere una panoramica completa (in miniature) di tutti i computer gestiti. Si può anche utilizzare questo pulsante per sbloccare le postazioni o per uscire dalla modalità presentazione.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Presenta su schermo intero</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>Presenta</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>Ferma Presentazione</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>In questa modalità il tuo schermo sarà visualizzato su tutti i computer client. Inoltre gli utenti non saranno in grado di svolgere altre azioni, in quanto le periferiche di input (mouse-tastiera) saranno bloccate.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Presenta in finestra</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>Presenta in finestra</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>In questa modalità il tuo schermo sarà visualizzato in una finestra su tutti i computer client. Gli utenti, pertanto, potranno cambiare finestra e continuare il loro lavoro.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>Blocca/Sblocca i desktop</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>Blocca tutti</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>Sblocca tutti</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>Per ottenere l'attenzione dagli studenti si possono bloccare i desktop utilizzando questo pulsante. In questa modalità sui computer client le periferiche di input (mouse-tastiera) sono bloccate e lo schermo è nero (visualizza un lucchetto).</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Invia un messaggio di testo</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>Invia messaggio</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>Utilizza questo pulsante per inviare un messaggio di testo a tutti gli utenti. Ad esempio per avvisarli dell'avvio di un nuovo lavoro, ecc.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>Accendi i computer</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Accendi</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>Clicca su questo pulsante per accendere tutti i computer gestiti. In tal modo non sarà necessario accendere a mano ogni singolo PC dell'aula.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>Spegni i computer</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Spegni</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>Puoi usare questo pulsante per spegnere tutti i computer gestiti (ad esempio a lezione terminata) . </translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>Assisti/Aiuta</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>Assisti/Aiuta</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>Con questo pulsante, hai la possibilità di indicare il nome (hostname) o l'indirizzo IP del computer dove si trova la persona che necessita di assistenza/aiuto.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>Adatta</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>Adatta le finestre</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>Cliccando su questo pulsante saranno ottimizzate automaticamente le dimensioni delle finestre-miniature dei computer client utilizzando tutto lo spazio disponibile. Inoltre le finestre saranno allineate.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>Ordina</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>Ordina e adatta finestre</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>Utilizzando questo pulsante tutte le finestre visibili saranno ordinate e la loro dimensione ottimizzata per lo spazio disponibile.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>Gestione iTALC Master</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlla</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Esci</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>General</source>
-        <translation>Generale</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>Servizio ITALC</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>Percorsi</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>Autenticazione</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>Servizio iTALC</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>Nascondi l'icona tray</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>Avvio automatico</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>Parametri aggiuntivi</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>Avvia il servizio</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>ferma il servizio</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>Stato:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>Fermato</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>Cartella per il Log file</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>Livello di Log</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>Nessun log</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>Solo i messaggi critici</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>Errori e messaggi critici</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>Avvisi (warnings) ed errori</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>Informazioni, avvisi e errori</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>Messaggi di debug e quant'altro</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>Limite per il file di log</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation>Log su Gestore eventi di Windows</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>Cancella tutti i file di log</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>Cattura schermo</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>Abilita cattura di finestre in livelli (semi-trasparente)</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>Bassa qualità (modalità turbo)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>Server per la modalità Presentazione</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation>Multithreading (può essere abilitato quando si utilizza il VNC reflector backend)</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>Rete</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>Porta principale del Servizio</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>Porta per la modalità Presentazione</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>Abilita le eccezioni del firewall</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation>Abilita il server HTTP che fornisce una applet JavaViewer</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation>Porta del server HTTP</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>File di configurazione</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>Configurazione universale</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>Configurazione personale</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>Cartelle dati</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Foto</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>Metodi di autenticazione</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation>Autenticazione con File chiave</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation>Autenticazione basata sul Logon (Credenziali di accesso)</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>Gestione chiavi di accesso</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation>Cartella chiave Pubblica</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation>Cartella chiave Privata</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation>Lancia l'Assistente per la gestione delle chiavi</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>Impostazioni di Accesso (Logon)</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation>Gestisci permessi</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation>Conferma accesso</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation>Puoi configurare iTALC per chiedere all'utente il permesso di accedere al computer quando viene utilizzato un determinato metodo di accesso.</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation>Autenticazione di accesso (Logon)</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation>Permetti ad alcuni utenti di accedere al computer senza conferma</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation>Quando riscontri errori o un funzionamento anomalo di iTALC è importante informare gli sviluppatori su quanto rilevato, così gli errori possono essere corretti nelle versioni successive. Questa pagina ti permette di inviare una relazione sugli errori.
-
-Se l'errore non è riproducibile, salta i passaggi 1) -3).</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation>Pulisci i file di LOG nella sezione Generale.</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation>Nella sezione "Generale" imposta il livello di Log a "Debug messaggi e quant'altro".</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation>Ripeti le azioni che hanno prodotto l'errore o il comportamento anomalo.</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation>Clicca sul seguente pulsante e salva il file in una cartella conosciuta.</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation>Genera l'archivio Rapporto Errori</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation>Vai all'indirizzo<a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, Apri un nuovo bug (open a new bug), descrivi (in inglese) cosa hai fatto nel passo 3) e allega il file che hai preparato al passaggio 4).</p>
-<br/>
-<br/>
-Nota: Se l'errore si verifica sia sul computer docente(master) che sul computer studente(client), allega l'archivio Rapporto Errori per entrambi i computer.</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>&Aiuto</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>&Esci</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>&Salva impostazioni nel file</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>Salva impostazioni nel file</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>C&arica impostazioni dal file</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Informazioni su iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>Informazioni su Qt</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>Nessun accesso in scrittura</translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation>Non riesco a contattare il servizio iTALC</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation>Non riesco a contattare il servizio iTALC. Probabilmente hai inserito credenziali sbagliate o le chiavi non sono impostate correttamente. Riprova o contatta il tuo amministratore per risolvere il problema nell'utilizzo di iTALC</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation>Autenticazione impossibile</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>I file delle chiavi di autenticazione non sono stati trovati o sono scaduti. Crea nuovi file chiavi utilizzando "iTALC Management Console". In alternativa si può utilizzare il metodo di autenticazione basato sul Logn (Credenziali di accesso). Altrimenti non avrai modo di accedere ai computer client attraverso iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>Impossibile modificare la proprietà di Avvio automatico del Servizio iTALC</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>Impossibile modificare i parametri del servizio iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>Impossibile modificare la configurazione delle eccezioni del firewall per il servizio iTALC</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>iTALC Management Console %1</translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation>Riavvia il servizio iTALC</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation>Tutte le impostazioni sono state salvate. Affinché abbiano effetto è necessario riavviare il servizio iTALC. Lo riavvio adesso?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation>Sto avviando il servizio iTALC</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation>Sto fermando il servizio iTALC</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>In esecuzione</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation>Il servizio iTALC deve essere fermato temporanemente al fine di cancellare i file di log. Continuo?</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation>File di Log cancellati</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation>Tutti i file di Log sono stati cancellati.</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation>Impossibile cancellare tutti i file di Log.</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>Carica impostazioni da file</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>Salva impostazioni su file</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation>Test di autenticazione basato sul Logon</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation>L'autenticazione con le credenziali di Logon è riuscita.</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation>Non è riuscita l'autenticazione con le credenziali di Logon.</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation>Salva l'archivio Rapporto Errori</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation>Archivio Rapporto Errori (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation>L'archivio Rapporto Errori è stato salvato</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation>L'archivio Rapporto Errori è stato salvato in %1. Esso include i file di Log di iTALC ed informazioni sul tuo sistema operativo. Puoi allegarlo alla tua Segnalazione di errori.</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>Impostazioni non salvate</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>Alcune impostazioni non sono state salvate. Esco comunque?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>Il file di configurazione non è scrivibile</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>Il file di configurazione non è scrivibile! Eseguire iTALC con privilegi adeguati.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>Tutte le impostazioni sono state applicate.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>Si è verificato un errore nell'applicazioni delle impostazioni!</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Messaggio dall'insegnante</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Benvenuto in iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>Come vedi la barra di lavoro contiene diversi pulsanti. Ciascun pulsante è associato ad un'area di lavoro. Dai un'occhiata a tutte le are di lavoro disponibili cliccando sui rispettivi pulsanti.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>Utilizza Gestione-aule per gestire le tue aule e i computer. Puoi anche conoscere quali utenti sono al lavoro.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>L'album delle foto ti consente di gestire tutte le foto fatte ai computer client.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>iTALC naturalmente si può configurare. Utilizza questa area di lavoro per farlo.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Informazioni su iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>Panoramica</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Alcune infomazioni di base su iTALC e sul suo utilizzo.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>iTALC Logon</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>Inserisci Nome utente e password per accedere ai clients di iTALC</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nome Utente</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Password</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Non è possibile registrare il servizio '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Il gestore dei servizi (Service Control Manger) non può essere contattato (hai i diritti sufficienti?!) - il servizio '%1' non è stato registrato.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Il servizio '%1' è già registrato.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Il servizio '%1' non può essere registrato.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Il servizio '%1' è stato registrato correttamente.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Il servizio '%1' non può essere fermato.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Il servizio '%1' è stato rimosso.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Il servizio '%1' non è registrato, pertanto non può essere rimosso.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Il servizio '%1' non può essere rimosso.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Il servizio '%1' non è stato trovato.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Il gestore dei servizi (Service Control Manger) non può essere contattato (hai i diritti sufficienti?!) - il servizio '%1' non è stato rimosso.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Il gestore dei servizi (Service Control Manger) non può essere contattato (hai i diritti sufficienti?!) - il servizio '%1' non è stato fermato.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Client su %1:%2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>Osservato (%1@%2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>Controllo remoto (%1@%2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>Utente sconosciuto</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>Osserva solo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlla</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>Blocca studente</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Sblocca studente</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Scatta una foto</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>Schermo intero</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>Finestra</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Esci</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>Connessione con %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>Connesso.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation>Accedi come</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation>Utilizza i campi qui sotto per inserire nome-utente, password e l'eventuale dominio. Queste informazioni saranno utilizzate per l'autenticazione sul/i computer client.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nome Utente</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Password</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Dominio</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation>Esegui comandi sul/i computer</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation>Inserisci i comandi/programmi da eseguire sul/i computer selezionati. Puoi eseguire comandi multipli separandoli in linee.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>Stato sconosciuto</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Non è possibile scattare una foto perché la cartella %1 non esiste e non è possibile crearla.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Foto</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>Foto</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Gestisci le foto fatte ai computer client utilizzando quest'area di lavoro.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tutte le foto scattate solo elencate qui. Puoi scattare una foto utilizzando l'apposito comando disponibile nel menù contestuale (pulsante destro) sulle miniature dei client. Le foto scattate possono essere gestite utilizzando i pulsanti disponibili qui sotto.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>Utente:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Computer:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>Data:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>Ora:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>Mostra</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>Cancella</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation>Assisti/Aiuta</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation>Inserisci l'indirizzo IP o il nome del computer con vuoi collegarti.</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>Invia un messaggio di testo</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Utilizza il campo qui sotto per scrivere il messaggio che vuoi inviare agli utenti selezionati.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Connessione con %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Panoramica</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Presenta su schermo intero</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Presenta in finestra</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Blocca postazione</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Osserva</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlla</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Mostra studente</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Invia un messaggio di testo</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Disconnetti utente</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Scatta una foto</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Accendi</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Riavvia il PC</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Spegni</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Esegui comandi</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/license.png b/lib/resources/license.png
deleted file mode 100644
index c60375f..0000000
Binary files a/lib/resources/license.png and /dev/null differ
diff --git a/lib/resources/locale.png b/lib/resources/locale.png
deleted file mode 100644
index 553e683..0000000
Binary files a/lib/resources/locale.png and /dev/null differ
diff --git a/lib/resources/locked_bg.png b/lib/resources/locked_bg.png
deleted file mode 100644
index 65fe1ae..0000000
Binary files a/lib/resources/locked_bg.png and /dev/null differ
diff --git a/lib/resources/manage-with-imc.png b/lib/resources/manage-with-imc.png
deleted file mode 100644
index dd51949..0000000
Binary files a/lib/resources/manage-with-imc.png and /dev/null differ
diff --git a/lib/resources/message.png b/lib/resources/message.png
deleted file mode 100644
index f4fe3a6..0000000
Binary files a/lib/resources/message.png and /dev/null differ
diff --git a/lib/resources/nl.qm b/lib/resources/nl.qm
deleted file mode 100644
index be651ee..0000000
--- a/lib/resources/nl.qm
+++ /dev/null
@@ -1 +0,0 @@
-<�d��!
�`���
\ No newline at end of file
diff --git a/lib/resources/nl.ts b/lib/resources/nl.ts
deleted file mode 100644
index d0c0fec..0000000
--- a/lib/resources/nl.ts
+++ /dev/null
@@ -1,1749 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/nn.qm b/lib/resources/nn.qm
deleted file mode 100644
index 65ea34c..0000000
Binary files a/lib/resources/nn.qm and /dev/null differ
diff --git a/lib/resources/nn.ts b/lib/resources/nn.ts
deleted file mode 100644
index d3645ad..0000000
--- a/lib/resources/nn.ts
+++ /dev/null
@@ -1,1754 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="nn">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Om iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Om</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Forfattarar</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Omsetjing</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Lisens</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Aldri for denne økta</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Alltid denne økta</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Klasseromshandterar</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Bruk dette området til å handtere maskinar og klasserom.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Her handterar du maskinar og klasserom. Bruk høgre musetast i lista for å legge til maskinar eller klasserom.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Klasserom / maskiner</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP-adresse</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Eksporter til tekstfil</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Vis / Gøym</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Endre innstillingar</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Fjern</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Vis alle maskinane i klasseromet</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Gøym alle maskinane frå klasseromet</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Endre namn</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Fjern klasserom</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Legg til maskin</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Legg til klasserom</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Klarte ikkje finna oppsettsfila</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Klarte ikkje opne oppsettfila %1. 
-Du må leggje til minst eit klasserom og ein maskin i klasseromshandteraren.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Oppsettsfila inneheld feil</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Feil med gjennomgang av oppsetts-fila %1. 
-Endre den eller slett den og legg til maskinar og klasserom igjen.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Feil med gjennomgang av oppsetts-fila %1. 
-Endre den eller slett.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Vel filnamn</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Tekstfil (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Handlingar</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Handlingar for %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Endre namn på klasserom</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Skriv inn nytt namn for klasserom "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Vil du verkeleg slette klasserom "%1"?
-Alle maskiner i klasserom blir også fjerna!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Mangler klasserom</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Før du kan leggje til maskiner må du ha minst eit klasserom.
-Vil du lage eit klasserom no?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nytt klasserom</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Skriv inn namn på klasserommet du lager.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Ukjend status</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Ingen brukarar logga på</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Verten er utilgjengeleg</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Køyrer demonstrasjon</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Skrivebordet er låst</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Er du sikker på at du vil logge av brukarane på dei synlege maskinane ?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Vil du starte alle dei synlege maskinane om at?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Start maskinane om at</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Er du sikker på at du vil skru av alle dei synlege maskinane?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Ugyldig MAC-adresse</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Klient oppsett</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP / Vertnamn</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Namn</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Klasserom</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Intervall for oppdateringar</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> sekunder</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Brukergrensesnitt</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ikkje vis ballongtips for arbeidslinjeknappar</p></body&gt [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Kontroller denne instillinga hvis du er plaga av ballongtips som kj [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Ingen ballongtips</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Din rolle (treng tilsvarande nøklar!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Lærar</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrator</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Støtte</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Anna</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Oppsett for pålogging av fleire brukarar om gongen</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domene</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Dobbelklikk handling for klient-vindauge</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Fjernkontroll</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Vis sanntidsbilete i fullskjerm</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">No [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">iTALC oppsett</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">I dette arbeidsområdet endrar du iTALC etter eige behov.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC Demo</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Autentiseringsfeil</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Nokon (IP: %1) prøvde å få tilgang til denne maskina men kunne ikkje autentisera seg!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Lærar</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrator</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Anna</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Handlingar</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Avslutt</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Skjermskot</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Om iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Klarte ikkje lesa/skriva eller lage katalog %1! Kontroller at du har nødvendig tilgang for å lage eller skrive til denne katalogen før du køyrer iTALC.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Klasserom</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Bytt klasserom</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Trykk her for å opne meny med val av aktivt klasserom.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Trykk denne knappen for å byte mellom klasserom.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Oversiktsmodus</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Oversikt</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Fullskjerm demonstrasjon</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demonstrasjon i vindauge</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Send tekstmelding</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Tekstmelding</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Bruk denne knappen for å sende tekstmeldingar til alle brukarane td. gje beskjed om ei ny oppgåve.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Skru på maskinar</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Skru på</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Trykk denne knappen for å skru på alle dei synlege maskinane på ein gong.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Skru av</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Trykk her for å skru av alle synlege maskinar (td. etter ein time eller i slutten av dagen).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Støtte</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Fjernkontroll</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Beskjed frå lærar</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Dette er dei forskjellege arbeidsråda. Kvar knapp er kobla opp mot eit arbeidsområde. Trykk på knappane for å sjå gjennom dei.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Skjermskot arbeidsområdet lar deg behandle og sjå skjermskot du har laga.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Endringar i oppsettet til iTALC blir for det meste gjort i arbeidsområdet for oppsett.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Om iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Oversikt</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Grunnleggjande informasjon om iTALC og korleis det kan brukast.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Brukarnamn</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Passord</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Klarte ikkje registrere tenesta '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Klarte ikkje å kontakte tenestebehandlaren (har du dei nødvendige rettighetene ?) - Tenesta '%1' blei ikkje registrert.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Tenesta '%1' er allereie registrert.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Klarte ikkje registrere tenesta '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Tenesta '%1' er no registrert.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Klarte ikkje stoppe tenesten '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Tenesta '%1' er fjerna.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Tenesta '%1' er ikkje registrert og kan difor ikkje fernast.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Klarte ikkje fjerne tenesta '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Klarte ikkje finne tenesta '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Klarte ikkje å kontakte tenestebehandlaren (har du dei nødvendige rettighetene ?) - Tenesta '%1' blei ikkje fjerna.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Klarte ikkje å kontakte tenestebehandlaren (har du dei nødvendige rettighetene ?) - Tenesta '%1' blei ikkje stoppa.</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">Ukjent brukar</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Berre vis bilete</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Fjernkontroll</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Lås elev/student</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Skjermskot</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Fullskjerm</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Avslutt</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Koplar til %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Tilkobla.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Brukarnamn</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Passord</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domene</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Klarte ikkje lage skjermskot då katalogen %1 verken finnes eller kunne opprettast.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Skjermskot</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Skjermskot</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Dette arbeidsområdet er til å handtere skjermskot.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&qu [...]
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Brukar:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Vert:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Dato:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Tid:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Støtte</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Send tekstmelding</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Skriv beskjed til alle valte brukarar i feltet under her.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Kobler til %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Oversikt</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Fullskjerm demonstrasjon</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demonstrasjon i vindauge</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Lås skjermbilete</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Fjernkontroll</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">La elev vise demonstrasjon</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Send tekstmelding</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Skru på</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Start om att</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Skru av</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Køyr kommando</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/ok.png b/lib/resources/ok.png
deleted file mode 100644
index 4f75346..0000000
Binary files a/lib/resources/ok.png and /dev/null differ
diff --git a/lib/resources/pl.qm b/lib/resources/pl.qm
deleted file mode 100644
index 3835193..0000000
Binary files a/lib/resources/pl.qm and /dev/null differ
diff --git a/lib/resources/pl.ts b/lib/resources/pl.ts
deleted file mode 100644
index 6b22892..0000000
--- a/lib/resources/pl.ts
+++ /dev/null
@@ -1,1766 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="pl_PL">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Informacje o iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Informacje o</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Autorzy</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Tłumaczenie</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Licencja</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Nigdy w czasie tej sesji</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Zawsze w czasie tej sesji</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Zarządzanie pracownią</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Z tego miejsca możesz łatwo zarządzać swoimi komputerami i pracowniami.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">To stąd zarządzasz komputerami i pracowniami. Możesz dodać komputery lub pracownie klikając prawym klawiszem na tej liście.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Pracownie/komputery</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">Adres IP</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">Użytkownicy</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Pokaż użytkowników</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">Użyj menu kontekstowego (prawy przycisk myszy) aby dodać/usunąć pracownie.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">Użyj tego przycisku aby wyeksportować widoczną listę komputerów i użytkowników do pliku tekstowego. Możesz użyć tego pliku po skończonych zajęciach aby sprawdzić, kto w nich brał udział. Pamiętaj, że niektórzy użytkownicy mogą wylogować się przed końcem zajęć, więc zrób listę w ich trakcie lub na początku.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Ukryj komputery personelu</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Pokaż/ukryj</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Edycja</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Usuń</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Pokaż wszystkie komputery w pracowni</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Ukryj wszystkie komputery w pracowni</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Zmień nazwę</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Usuń pracownię</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Dodaj komputer</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Dodaj pracownię</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Brak pliku konfiguracji</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Nie można otworzyć pliku konfiguracji %1. 
-Musisz dodać co najmniej jedną pracownię i komputery używając zarządzania pracownią, które znajdziesz na pasku bocznym z lewej strony.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Błąd w pliku konfiguracji</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Błąd w czasie przetwarzania pliku konfiguracji %1. 
-Albo popraw go ręcznie, albo skasuj go i dodaj wszystkie pracownie i komputery na nowo.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Błąd w czasie przetwarzania pliku konfiguracji %1. 
-Popraw go lub usuń.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Wybierz plik wyjściowy</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Pliki tekstowe (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Polecenia</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Polecenia dla %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Nowa nazwa dla pracowni</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Wprowadź nową nazwę dla pracowni "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Usunąć pracownię "%1" ? 
-Skasujesz również wszystkie komputery w niej!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Brak pracowni</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Aby dodać komputery musisz stworzyć co najmniej jedną pracownię. 
-Chcesz stworzyć pracownię teraz?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nowa pracownia</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Wprowadz nazwę nowej pracowni.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Stan nieznany</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Brak zalogowanego użytkownika</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Komputer niedostępny</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Demo w trakcie</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Pulpit zablokowany</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Czy chcesz wylogować użytkowników na wszystkich widocznych komputerach?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Wyloguj użytkownika</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Czy chcesz usunąć wszystkie widoczne komputery?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Zrestartuj komputery</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Czy chcesz wyłączyć wszystkie widoczne komputery?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Błędny adres MAC</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Podałeś niepoprawny adres MAC. Pozostaw puste pole lub wprowadź adres MAC w postaci "0A:1B:2C:3D:4E:5F".</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Edycja klienta</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/nazwa komputera</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">wprowadź adres IP lub nazwę komputera aby podłączyć się do klienta  [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Nazwa</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adres MAC komputera  - potrzebny wyłącznie do zdalnego włączenia ko [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Pracownia</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Typ</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Komputer użytkownika</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Komputer personelu</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Inny/niezdefiniowany komputer</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Częstotliwość aktualizacji</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tutaj możesz ustawić częstotliwość aktualizacji klientów. Wyższe wa [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> second/y</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Interfejs użytkownika</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nie pokazuj podpowiedzi dla przycisków paska narzędzi</p>< [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Zaznacz tą opcję aby wyłączyć podpowiedzi pojawiające się gdy kurso [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Wyłącz podpowiedzi</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Twoja rola (wymaga odpowiednich kluczy)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Możesz określić swoją rolę. Nie zmieniaj niczego jeżeli nie wiesz co robisz. W przeciwnym przypadku nie podłączysz się do klinetów, przynajmniej do czasu aż przywrócisz swoją poprzednią rolę.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Personel</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrator</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Asystent</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Inna</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Ustawienia wielokrotnego logowania</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domena</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Polecenie podwójne kliknięcie na okienku klienta</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tutaj ustawisz co ma się stać gdy klikniesz da razy na okienku klienta.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Ni [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Twoja konfiguracja iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Tutaj dostosujesz iTALC do swoich potrzeb.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">Demo iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Błąd uwierzytelnienia</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Ktoś (IP %1) próbował uzyskać dostęp do tego komputera, ale nie mógł uwierzytelnić się!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Personel</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrator</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Inna</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">blokada ekranu</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Polecenia</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Ogólne</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Wyjdź</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Zdjęcia</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Informacje o iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Odczyt/zapis do katalogu %1 niemożliwy, Aby iTALC działał musisz mieć uprawnienia aby go założyć lub przynajmniej prawo do zapisu.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Pracownia</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Zmień pracownię</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Kliknij aby otworzyć menu umożliwiające wybór i zmianę pracowni.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Kliknij ten przycisk aby zmienić pracownię.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Tryb przeglądu</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Przegląd</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">To jest domyślny tryb w iTALC. Pozwala on na podgląd wszystkich widocznych komputerów. Kliknij ten przycisk również aby odblokować zablokowane komputery lub przerwać tryb demo.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Demo</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">WYŁĄCZ DEMO</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">W tym trybie Twój ekran jest wyświetlany na wszystkich widocznych komputerach a obraz zajmuje cały dostępny pulpit. Użytkownicy nie mogą nic zrobić ponieważ ich klawiatury i myszki są zablokowane.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demo (okno)</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">W tym trybie Twój ekran jest wyświetlany w oknie na wszystkich widocznych komputerach. Użytkownicy mogą przełączyć się na inne okno i kontynuować swoją pracę.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">(Od)Blokuj pulpity</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Blokuj wszystkie</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">ODBLOKUJ</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Aby przyciągnąć uwagę możesz zablokować pulpity użytkowników naciskając ten przycisk. W tym trybie ich ekrany będą czarne, a klawiatury i myszy nie będą działały.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Wiadomość</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Użyj tego przycisku aby wysłać wiadomość tekstową do wszystkich użytkowników, np. aby zwrócić im uwagę lub przekazać zadanie do wykonania.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Włącz komputery</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Kliknij ten przycisk aby włączyć wszystkie widoczne komputery. Dzięki temu nie musisz włączać każdego z osobna.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Wyłącz komputery</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Wyłącz</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Aby wyłączyć wszystkie widoczne komputery kliknij ten przycisk.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Obsługa</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Pomoc zdalna</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">Wpisz adres IP lub nazwę komputera, przy którym znajduje się osoba, której chcesz udzielić pomocy.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Dopasuj/rozmieść</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Dopasuj okna i ich wielkość</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Kliknięcie tego przycisku ustawi największy możliwy rozmiar okien dla komputerów-klientów. Wszystkie okna zostaną wyrównane.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Widok auto</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automatycznie rozmieść okna i dopasuj ich wielkość</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Wszystkie widoczne okna są automatycznie rozmieszczane i wyrównywane.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Wiadomość od personelu</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Witaj w iTALC !</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Oto domyślna belka robocza zawierająca wiele przycisków. Każdy przycisk jest połączony z obszarem roboczym. Przejrzyj dostępne obszary robocze klikając na odpowiednie przyciski.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">To stąd zarządzasz komputerami i pracowniami. Możesz też sprawdzić, kto jest zalogowany.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Obszar zdjęć jest bardzo użytecznym narzędziem. Pozwala zarządzać ci zdjęciami ekranów, które zrobiłeś.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Oczywiście możesz skonfigurować iTALC. Zasadniczo odbywa się to w obszarze konfiguracyjnym.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Informacje o iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Przegląd</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Kilka podstawowych onformacji o iTALC i o tym, jak go używać.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Hasło</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Klient iTALC %1 na %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Nie można zarejestrować usługi '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Manager usług nie odpowiada (masz odpowiednie uprawnienia?) - usługa '%1' nie została zarejestrowana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Usługa '%1' jest już zarejestrowana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Usługa '%1' nie mogła zostać zarejestrowana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Pomyślnie zarejestrowano usługę '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Usługa '%1' nie może zostać zatrzymana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Usługa '%1' została wyrejestrowana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Usługa '%1' nie jest zarejestrowana więc nie można jej wyrejestrować.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Usługa '%1' nie może zostać wyrejestrowana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Nie można znaleźć usługi '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Manager usług nie odpowiada (masz odpowiednie uprawnienia?) - usługa '%1' nie została wyrejestrowana.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Manager usług nie odpowiada (masz odpowiednie uprawnienia?) - usługa '%1' nie została zatrzymana.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">nieznany użytkownik</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Tylko podgląd</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Zablokuj użytk</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Odblokuj użytk</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Zdjęcie</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Pełny ekran</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Okno</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Wyjdź</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Łączę z %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Połączony.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Zdalne logowanie</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Hasło</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domena</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Nie można wykonać zdjęcia ponieważ katalog %1 nie istanieje i nie można go stwożyć.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Zdjęcie</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Zdjęcia</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Ten obszar pozwala zarządzać zdjęciami ekranów użytkowników.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Wszystkie zdjęcia (przechwycone ekrany użytkowników) które wykonałeś znajdują się w tym miejscu. Zdjęcia możesz zrobić wybierając odpowiedznią pozycję w menu kontekstowym okna klienta. Do zarządzania nimi użyj poniższych przycisków.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Użytkownik :</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Komputer :</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Data :</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Godzina :</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Obsługa</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Wprowadź wiadomość, którą chcesz wysłać do wybranych użytkowników.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Ustanawiam połączenie z %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Przegląd</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Zablokuj wyświetlanie</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Widok na żywo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Demo od użytkownika</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Wyloguj użytkownika</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Zrób zdjęcie</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Zrestartuj</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Wyłącz</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Wykonaj polecenie</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/pointcursor.png b/lib/resources/pointcursor.png
deleted file mode 100644
index cf32d9c..0000000
Binary files a/lib/resources/pointcursor.png and /dev/null differ
diff --git a/lib/resources/pointcursormask.png b/lib/resources/pointcursormask.png
deleted file mode 100644
index ceb6afa..0000000
Binary files a/lib/resources/pointcursormask.png and /dev/null differ
diff --git a/lib/resources/pt_br.qm b/lib/resources/pt_br.qm
deleted file mode 100644
index bcdae1d..0000000
Binary files a/lib/resources/pt_br.qm and /dev/null differ
diff --git a/lib/resources/pt_br.ts b/lib/resources/pt_br.ts
deleted file mode 100644
index a9477fb..0000000
--- a/lib/resources/pt_br.ts
+++ /dev/null
@@ -1,1779 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="pt_BR">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>Sobre iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>Sobre</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>Autores</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Tradução</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation>Idioma atual não traduzido ainda (ou está em Inglês nativo).
-
-Se você estiver interessado em traduzir o iTALC em seu idioma local ou outro idioma ou quer melhorar uma tradução existente, entre em contato com um desenvolvedor iTALC!</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Licença</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished">iTALC -Ensino e Aprendizagem Inteligente com Computadores
-
-Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions {2004-2013 ?}</translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation>Nunca para esta sessão</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Sempre para esta sessão</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation>Confirmar acesso ao desktop</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation>O usuário %1 do computador %2 deseja acessar o seu desktop. Você quer conceder o acesso?</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Gerente de Sala de Aula</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Use este espaço para gerenciar seus computadores e salas de aula de uma forma fácil.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>Este é o lugar onde os computadores e salas de aula são gerenciados. Você pode adicionar computadores e salas de aula clicando à direita nesta lista.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Salas de aual/computadores</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>Endereço IP</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Nomes de usuários</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>Mostrar nomes de usuários</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Use o menu de contexto (botão direito do mouse) para adicionar/remover computadores e/ou salas de aula.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>Exportar para um arquivo texto</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>Use este botão para exportar esta lista de computadores e nomes de usuários para um arquivo texto. Você pode usar este arquivo mais tarde para recolher os arquivos dos usuários depois que um exame terminou. As vezes isso é necessário, porque alguns usuários podem ter terminado o exame mais cedo e ter feito logoff do computador e por isso impedindo você de recolher seus arquivos no final do exame.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Ocultar computadores do professor</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Mostrar/ocultar</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Editar configurações</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Remover</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Mostrar todos os computadores da sala de aula</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Ocultar todos os computadores da sala de aula</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Editar nome</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Remover sala de aula</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Adicionar computador</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Adicionar sala de aula</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>Arquivo de configuração não encontrado</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>Não foi possível abrir arquivo de configuração %1.
-É necessário adicionar no mínimo uma sala de aula e computadores usando o gerenciador de salas de aula que você encontra no lado esquerdo do programa.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Erro no arquivo de configuração</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>Erro ao analisar o arquivo de configuração %1.
-Por favor, edite-o. Caso contrário, você deve excluir este arquivo e terá que adicionar todas as salas de aula e computadores novamente.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Erro ao analisar o arquivo de configuração %1.
-Por favor, edite-o. Caso contrário, você deve excluir este arquivo.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Selecionar arquivo de saida</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Arquivos de texto (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>Ações para selecionados</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>Ações</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>Ações para %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Novo nome para a sala de aula</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Por favor, digite um novo nome para a sala de aula "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Tem certeza que quer remover a sala de aula "%1"?
-Todos os computadores desta sala serão removidos também!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>Sala de aula não encontrada</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>Antes de adicionar computadores, você tem que criar pelo menos uma sala de aula.
-Quer criar uma nova sala agora?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Nova sala de aula</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Por favor, digite o nome da sala de aula que você deseja criar.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>Estado desconhecido</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Nenhum usuário logado</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>Computador inacessível</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>Demonstração em execução</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>Desktop bloqueado</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Tem certeza que quer fazer logoff de todos os usuários em todos os computadores visíveis?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Tem certeza que quer fazer logoff de todos os usuários em todos os computadores selecionados?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Fazer logoff do usuário</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Tem certeza que quer reiniciar todos os computadores visíveis?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Tem certeza que quer reiniciar todos os computadores selecionados?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>Reiniciar computadores</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Tem certeza que quer desligar todos os computadores visíveis?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Tem certeza que quer desligar todos os computadores selecionados?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>Endereço MAC inválido</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>Você especificou um endereço MAC inválido. Deixe este campo em branco ou digite um endereço MAC válido (use ":" como separador!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation>Configurações do cliente</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>IP/nome do computador</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Digite um endereço IP ou nome do computador para que o iTALC possa acessar o cliente  [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>Nome</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Apelido opcional do computador que é exibido no iTALC.</p></body></htm [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation>Endereço MAC</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Endereço de Hardware (MAC) do cliente - somente usado para ligar o computador remotam [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Sala de aula</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>Tipo</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>Computador do aluno</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>Computador do professor</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>Outro computador (indefinido)</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation>Faltando endereço IP/nome do computador</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation>Você não especificou um endereço IP ou nome para o computador!</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>Intervalo entre as atualizações</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Aqui, você pode determinar o intervalo entre as atualizações dos computadores. Valore [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation> segundos</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>Interface do usuário</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Não mostrar dicas de balão para os botões da barra de ferramentas</p></body& [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Marque esta opção se você deseja desabilitar as dicas de balão que aparecem ao mover  [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>Sem dicas de balão</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Não mostrar textos nos botões da barra de ferramentas</p></body></html [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Sem textos nos botões da barra de ferramentas</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Sua função (necessário as chaves estarem de acordo!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Aqui, você pode selecionar sua função. Somente modifique isto, se você conhece o que está fazendo. Caso contrário, você não será capaz de acessar todos os computadores clientes até que você restaure sua antiga função.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Professor</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Administrador</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>Ajudante</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Outro</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>Configurações para logon múltiplo</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domínio</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>Duplo clique na janela cliente</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Aqui, você pode definir o que deve acontecer se você clicar duas vezes em uma janela do cliente.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlar remotamente</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>Ver ao vivo em tela cheia</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Por favor, note que  [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Sua configuração do iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Neste espaço, você pode personalizar o iTALC para atender as suas necessidades.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>Demonstrar iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>Erro na autenticação</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Alguém (IP: %1) tentou acessar este computador mas não se autenticou com sucesso!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>A autenticação do VNC falhou devido a muitas tentativas de autenticação.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>A autenticação do VNC falhou.</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>O servidor VNC fechou a conexão.</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation>Assistente Da Chave De Acesso Do iTALC</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation>Criar/importar chaves de acesso do iTALC</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation>Este assistente irá ajudá-lo a criar ou importar as chaves de acesso do iTALC.</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation>Como isso funciona?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation>As chaves de acesso do iTALC consistem em duas partes pertencentes em conjunto, uma chave pública e uma privada.
-
-Usando a chave privada, os usuários no computador mestre serão capazes de acessar os computadores clientes. É importante que somente usuários autorizados tenham acesso de leitura para o arquivo da chave privada.
-
-A chave pública é usada nos computadores clientes para verificar que qualquer entrada de solicitação de conexão está autorizada.</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation>Modo assistente</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation>Por favor, escolha se deseja criar novas chaves de acesso ou importar uma chave pública de um cliente.</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation>Criar novas chaves de acesso (computador mestre)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation>assistantModeButtonGroup</translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation>Importar chave pública (computador cliente)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation>Selecionar a função do usuário</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation>Por favor, selecione uma função para o usuário para criar ou importar as chaves de acesso:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Professor</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Administrador</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation>Membro da equipe de apoio</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Outro</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation>Funções de usuário permitem usar múltiplas chaves de acesso em paralelo. Por exemplo, pode haver diferentes chaves de acesso do professor para cada sala de aula, enquanto que as chaves de acesso são as mesmas para toda a escola.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation>Diretórios</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation>Exportar parte de chave pública (computador mestre)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation>Usar um diretório de destino personalizado para as chaves de acesso</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation>Por favor, especifique a localização da chave de acesso pública para ser importada.</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation>Resumo</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation>As seguintes ações serão tomadas:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation>• Criar novas chaves de acesso</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation>• Importar chave de acesso pública de</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation><desconhecida></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>• Salvar chave(s) de acesso em</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>• Exportar chave pública para</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation>• Configurar para a função de usuário</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation>Selecionar o diretório para o qual a chave pública será exportada</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation>Chaves de acesso (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation>Chave pública inválida</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation>O arquivo selecionado não contém uma válida chave de acesso pública do iTALC!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation>Selecionar diretório de destino</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation>Criação da chave de acesso</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation>Não foi possível remover arquivo %1 previamente existente.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation>Falha ao exportar chave pública de acesso de %1 para %2.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation>Chaves de acesso foram criadas e escritas com sucesso para %1 e %2.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation>Um erro ocorreu ao criar as chaves de acesso. Você provavalmente não tem permissão para escrever no diretório selecionado.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation>Chave pública importada</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation>Um erro ocorreu ao importa a chave pública de acesso. Você provavelmente não tem permissão para ler a chave de origem ou escrever no arquivo de destino.</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation>A chave pública foi importada com sucesso de %1.</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>bloquear tela</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation>Editor de grupo de acesso</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation>Por favor, adicione os grupos cujos membros devem ser autorizados a acessar os computadores em sua rede iTALC.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation>Todos os grupos</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation>Grupos com privilégios do iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>Ações</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation>Geral</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Sair</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation>Console de gerenciamento do iTALC</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>Servidor iTALC</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>Caminhos</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>Autenticação</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>Serviço iTALC</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>Ocultar ícone da área de notificação</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>Iniciar automaticamente</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>Argumentos adicionais</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>Iniciar serviço</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>Parar serviço</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>Estado:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>Parado</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation>Registrando</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>Diretório de arquivo de log</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>Nível de log</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>Nada</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>Somente mensagens críticas</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>Mensagens críticas e de erros</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>Avisos e erros</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>Informações, avisos e erros</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>Mensagens de depuração e tudo o mais</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>Limite do tamanho do arquivo de log</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>MB</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>Remover todos os arquivos de log</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>Capturando desktop</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>Habilitar captura de janelas em camadas (semi-transparente)</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>Baixa precisão (modo turbo)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>Demonstrar servidor</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>Rede</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>Porta do servidor</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>Demonstrar porta do servidor</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>Habilitar exceção de firewall</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>Arquivos de configuração</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>Configuração global</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>Configuração pessoal</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>Diretórios de dados</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Capturas</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>Métodos de autenticação</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>Gerenciamento de chaves de acesso</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>Configurações de logon</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation>&Arquivo</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>A&juda</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>&Sair</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation>Ctrl+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>&Salvar configurações em arquivo</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>Salvar configurações em arquivo</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation>Ctrl+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>Carregar c&onfigurações do arquivo</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation>Ctrl+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Sobre iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>Sobre o QT</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation>Janela principal</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation>toolBar</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>Console %1 de Gerenciamento do iTALC</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>Em execução</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>Carregar configurações de um arquivo</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation>Arquivos XML (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>Salvar configurações para arquivo</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>Configurações não salva</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>Existem configurações não salvas. Sair de qualquer maneira?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>Configuração não gravável</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>O backend de configuração local informou que a configuração não é gravável! Por favor, execute o Console de Gerenciamento do iTALC com privilégios mais elevados.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>Todas as configurações foram aplicadas com sucesso.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>Um erro ocorreu ao aplicar as configurações!</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>Sem acesso de escrita</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>Não foi possível ler/gravar ou criar o diretório %1! Para executar iTALC, verifique se você tem permissão de criar ou gravar nesse diretório.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Sala de aula</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>Mudar de sala de aula</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>Clique neste botão para abrir um menu onde você pode escolher a sala de aula ativa.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>Clique neste botão, para alternar entre as salas de aula.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>Modo visão geral</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>Visão geral</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>Este é o modo padrão do iTALC e permite que você tenha uma visão geral sobre todos os computadores visíveis. Também clique neste boão para desbloquear os computadores ou para sair do modo de demonstração (demo).</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Demonstração em tela cheia</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>Demonstração em tela cheia</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>Parar demonstração</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>Neste modo, a sua tela será exibida em todos os computadores. Além disso, os usuários não serão capazes de fazer outra coisa, pois todos os dispositivos de entrada (teclados e mouses) serão bloqueados neste modo.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Demonstração em janela</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>Demonstração em janela</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>Neste modo, a sua tela será exibida em uma janela em todos os computadores. Os usuários serão capazes de alternar para outras janelas e assim podem continuar a trabalhar.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>Bloquear/desbloquear os desktops</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>Bloquear todos</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>Desbloquear todos</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>Para ter a atenção de todos os usuários, você pode bloquear seus desktops usando este botão. Neste modo, todos os dispositivos de entrada (teclados e mouses) serão bloqueados e a tela ficará preta.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Enviar mensagem de texto</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>Mensagen de texto</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>Use este botão para enviar uma mensagem de texto para todos os usuários, por exemplo, para comunicar a nova tarefa etc.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>Ligar computadores</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Ligar</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>Clique neste botão para ligar todos os computadores visíveis. Desta forma, você não tem que ligar cada computador manualmente.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>Desligar computadores</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Desligar</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>Para desligar todos os computadores visíveis (por exemplo, depois que terminou a aula), você pode clicar neste botão.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>Ajuda</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>Ajuda direta</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>Se você precisa ajudar alguém em um determinado computador, clique neste botão e digite o nome ou o endereço IP do seu computador.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>Ajustar/alinhar</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>Ajustar janelas e seus tamanhos</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>Ao clicar neste botão, o maior tamanho possível para as janelas do cliente será ajustada. Além disso, todas as janelas serão alinhadas.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>Visualizar automaticamente</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>Rearranjar automaticamente o tamanho da janela</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>Ao clicar neste botão, todos as janelas visíveis serão rearranjadas e ajustadas.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>Controle Mestre Do iTALC</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlar remotamente</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>Não foi possível modificar a propriedade iniciar automaticamente para o Serviço iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>Não foi possível modificar os argumentos do serviço para o Serviço iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>Não foi possível alterar a configuração do firewall para o Serviço iTALC.</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation>Depuração</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation>Habilitar alternando desktop para bloquear tela (experimental)</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation>Log para a saída de erro padrão</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation>Log para registro de eventos de Janelas</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation>Backend</translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation>Refletor VNC</translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation>Servidor de demonstração iTALC</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation>Multithreading (pode ser habilitado ao usar o backend refletor VNC)</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation>Habilitar servidor HTTP que fornece um applet JavaViewer</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation>Porta do servidor HTTP</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation>Permitir conexões de localhost apenas</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation>Autenticação de arquivo de chave</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation>Autenticação de logon baseado em ACL</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation>Diretório base do arquivo de chave pública</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation>Diretório base do arquivo de chave privada</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation>Lançar assistente de arquivo de chave</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation>Gerenciar permissões</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation>Teste</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation>Confirmação de acesso</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation>Você pode configurar iTALC para pedir a permissão do usuário para acessar o desktop ao usar determinados métodos de autenticação.</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation>Autenticação de logon</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation>Permitir que o mesmo usuário acesse o desktop sem confirmação</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation>Depurando iTALC</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation>Ao encontrar falhas ou outro mau comportamento em iTALC é importante informar os desenvolvedores sobre eles, de modo que as falhas possam ser corrigidas em versões futuras. Esta página permite que você envie um relatório de falha útil facilmente.
-
-Se a falha não é reproduzível, pule o passo1) - 3).</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation>1)</translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation>Limpar os arquivos de log na seção "Geral".</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation>2)</translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation>Na seção "Geral" defina o nível do log para "Mensagens de depuração e tudo mais".</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation>3)</translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation>Repita as ações que conduzem ao erro ou mau comportamento.</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation>4)</translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation>Clique no botão abaixo e salve o arquivo em um local conhecido.</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation>Gerar arquivo de relatório de falha</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation>5)</translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation>Ir para o <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, abra um novo bug, descrever o que você fez no passo 3) e anexe o arquivo que você salvou no passo 4).</p>
-<br/>
-<br/>
-Nota: se o erro envolve ambos os computadores mestre e cliente, anexe os arquivos de relatório de erro para ambos os computadores.</translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation>Reiniciar Servidor iTALC</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation>Todas as configurações foram salvas com sucesso. A fim de ter efeito, o serviço iTALC precisa ser reiniciado. Reiniciá-lo agora?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation>Iniciando serviço iTALC</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation>Parando serviço iTALC</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation>O serviço iTALC precisa ser parado temporariamente, a fim de remover os arquivos de log. Continuar?</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation>Arquivos de log limpos</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation>Todos os arquivos de log foram limpos com sucesso.</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation>Não foi possível remover todos os arquivos de log.</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation>Teste de autenticação de logon</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation>A autenticação com credenciais fornecidas foi bem sucedida.</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation>A autenticação com credenciais fornecidas falhou!</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation>Salvar arquivo de relatório de bug</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation>Arquivo de relatório de bug iTALC (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation>Arquivo de relatório de bug iTALC salvo</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation>Um arquivo de relatório de bug do iTALC foi salvo em %1.Ele inclui arquivos de log do iTALC e informações sobre seu sistema operacional. Você pode atachá-lo a um relatório de bug.</translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation>Não foi possível contactar o serviço iTALC</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation>Não foi possível contactar o serviço local iTALC. É provável que você inseriu as credenciais erradas ou arquivos de chaves não estão configurados corretamente. Tente novamente ou contate o administrador para resolver esse problema usando o Console De Gerenciamento Do iTALC. </translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation>Autenticação impossível</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>Nenhum arquivos de chave de autenticação foram encontrados ou seus atuais estão desatualizados. Por favor, crie novos arquivos de chave usando o Console De Gerenciamento Do iTALC. Alternativamente, configure a autenticação do usuário no Console De Gerenciamento Do iTALC. Caso contrário, você não será capaz de acessar computadores usando o iTALC.</translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Mensagem do professor</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Bem vindo ao iTALC</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>Aqui, você vê a barra de ferramentas que contém vários botões. Cada botão está conectado a um espaço de trabalho. Para dar uma olhada nos espaços de trabalho disponíveis, basta clicar no botão correspondente.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>Usando o gerenciador de salas de aula, você pode gerenciar suas salas de aula e computadores. Você também pode ver qual usuário está logado.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>A captura do espaço de trabalho é uma ferramenta muito útil. Ela permite que você gerencie as capturas que você fez.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Claro que você pode configurar o iTALC. Isso geralmente é feito usando a configuração do espaço de trabalho.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Sobre iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>Visão geral</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Algumas informações básicas sobre iTALC e como usá-lo.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>Por favor, digite seu nome de usuário e senha para acessar os clientes iTALC.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nome de usuário</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Senha</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation>Acessar iTALC</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Cliente iTALC %1 no %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Não foi possível registrar o serviço  '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>O Gerenciador de Controle de Servicos não pode ser contatado (você tem os direitos necessários?!) - o serviço '%1' não foi registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>O serviço '%1' já está registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>O serviço '%1' não pode se registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>O serviço '%1' foi registrado com sucesso.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>O serviço '%1' não pode ser parado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>O serviço '%1' tem sido registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>O serviço '%1' não tem sido registrado e por isso não pode ser registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>O serviço '%1' não pode ser registrado.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>O serviço '%1' não pode ser encontrado.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>O Gerenciador de Controle de Servicos não pode ser contatado (você tem os direitos necessários?!) - o serviço '%1' não foi registrado.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>O Gerenciador de Controle de Servicos não pode ser contatado (você tem os direitos necessários?!) - o serviço '%1' não foi parado.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>Ver ao vivo (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>Controlar remotamente (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>usuário desconhecido</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>Visualizar somente</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlar remotamente</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>Bloquear aluno</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Desbloquear aluno</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Captura</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>Tela cheia</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>Janela</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Sair</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>Conectando %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>Conectado.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation>Acessar remotamente</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation>Use os campos abaixo para digitar o nome de usuário, senha e nome de domínio opcional. Estas informações serão usadas para fazer acessar o(s) computador(es).</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nome de usuário</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Senha</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domínio</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation>Executar comandos</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation>Por favor, digite os comandos para executar no(s) cliente(s) selecionado(s). Você pode separar vários comandos por linha.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>desconhecido</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Não foi possível tirar uma captura. O diretório %1 não existe ou não pode ser criado.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Captura</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>Capturas</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Simplesmente gerencie as capturas que você fez usando este espaço de trabalho.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Todas as capturas que você fez, estão listadas aqui. Você pode fazer capturas selecionando a referente opção no menu de contexto (botão direito do mouse) de uma janela cliente. Estas capturas podem ser gerenciadas usando os botões abaixo.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>Usuário:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Computador:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>Data:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>Hora:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>Mostrar</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>Excluir</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation>Ajuda</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation>Por favor, digite o endereço IP ou nome do computador para o qual você deseja se conectar.</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>Enviar mensagem de texto</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Use o campo abaixo para digitar sua mensagem que será enviada para todos os usuários selecionados.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Estabelecendo conexão para %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Visão geral</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Demonstrar em tela cheia</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Demonstrar em uma janela</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Bloquear tela</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Ver ao vivo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Controlar remotamente</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Deixar o aluno exibir uma demonstração</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Enviar mensagem de texto</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Fazer logoff do usuário</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Capturar uma tela</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Ligar</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Reiniciar</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Desligar</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Executar comandos</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/ru.qm b/lib/resources/ru.qm
deleted file mode 100644
index 66d01c9..0000000
Binary files a/lib/resources/ru.qm and /dev/null differ
diff --git a/lib/resources/ru.ts b/lib/resources/ru.ts
deleted file mode 100644
index 85bc4cf..0000000
--- a/lib/resources/ru.ts
+++ /dev/null
@@ -1,1777 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="ru_RU">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">О программе iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">О программе</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Авторы</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Перевод</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished">Перевод на данный язык еще не осуществлен.
-
-Если Вы желаете добавить перевод программы iTALC на новый язык или улучшить уже существующий, пожалуйста, свяжитесь с разработчиками iTALC!</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Лицензия</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Никогда в этом сеансе</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Всегда в этом сеансе</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished">Подтверждать доступ к рабочему столу</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished">Пользователь %1 компьютера %2 пытается подключиться к Вашему рабочему столу. Разрешить ему доступ к Вашему рабочему столу?</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Менеджер Классов</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Используйте это пространство для управления вашими компьютерами и классами самым простым способом.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Здесь можно управлять компьютерами и классами. Вы можете добавить компьютеры или классы кликнув правой кнопкой по этому списку.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Классы/компьютеры</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP-адреса</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">Имена пользователей</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Показать имена пользователей</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">Используйте контекстное меню (правая кнопка мышки) для добавления/удаления компьютеров и/или классов.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Экспортировать в текстовый файл</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">Используйте эту кнопку для экспорта этого списока компьютеров и пользователей в текстовый файл. Вы можете использовать этот файл позже для сбора файлов после завершения экзамена. Иногда это необходимо, потому что некоторые пользователи могли завершить работу и выполнить выход раньше и поэтому вы не сможете собрать их файлы в конце экзамена.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Скрыть компьютер учителя</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Показать/скрыть</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Редактировать параметры</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Удалить</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Показать все компьютеры в классе</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Скрыть все компьютеры в классе</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Редактировать имя</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Удалить класс</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Добавить компьютер</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Добавить класс</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Не найден файл конфигурации</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Не могу открыть файл конфигурации  %1.
-Вы должны добавить хотя бы один класс и компьютеры используя менеджер классов, который можно найти в программе не панели слева.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Ошибка в файле конфигурации</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Ошибка обработки файла конфигурации %1.
-Отредактируйте его. Иначе вы должны его удалить и добавить все классы и компьютеры снова.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Ошибка обработки файла конфигурации %1.
-Отредактируйте его. Иначе вы должны его удалить.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Выберите выходной файл</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Текстовые файлы (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished">Действия для выбранных элементов</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Действия</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Действия для %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Новое имя для класса</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Пожалуйста введите новое имя для класса "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Вы уверены, что хотите удалить класс "%1"?
-Все компьютеры в нем будут также удалены!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Отсутствующий класс</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Перед добавление компьютеров вы должны создать хотя бы один класс
-Вы хотите создать класс сейчас?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Новый класс</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Пожалуйста введите имя класса, который хотите создать.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Неизвестное состояние</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Нет начавших работу пользователей</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Компьютер недоступен</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Запущенное демо</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Рабочий стол заблокирован</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Вы действительно хотите завершить работу пользователей на всех видимых компьютерах?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished">Вы действительно хотите завершить работу пользователей на всех выбранных компьютерах?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Завершить работу</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Вы действительно хотите перезагрузить все видимые компьютеры?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished">Вы действительно хотите перезагрузить все выбранные компьютеры?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Перезагрузить компьютеры</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Вы действительно хотите завершить работу всех видимых компьютеров?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished">Вы действительно хотите завершить работу всех выбранных компьютеров?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Некорректный MAC-адрес</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Вы задали некорректный MAC-адрес. Вы можете оставить это поле пустым или ввести корректный MAC-адрес (используйте ":" как разделитель!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Параметры клиента</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/имя компьютера</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Введите IP-адрес или имя компьютера, который iTALC сможет определит [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Имя</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Опциональное имя компьютера, которое должно отображаться в iTALC.&l [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Аппаратный/MAC-адреса клиента - используются только для включения к [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Класс</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Тип</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Компьютер учащегося</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Компьютер учителя</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Другой/незаданный компьютер</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Интервал между обновлениями</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Здесь вы можете установить интервал между обновлениями клиентов. Вы [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">секунд</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Интерфейс пользователя</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Не показывать всплывающие подсказки к кнопкам</p></body&gt [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Отметьте эту опцию, если вас раздражают всплывающие подсказки, появ [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Нет всплывающих подсказок</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Не показывать подписи к кнопкам</p></body></html> [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished">Нет подписей к кнопкам</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Ваша роль (требует соответствующего ключа!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Здесь вы можете выбрать вашу роль. Меняйте что либо здесь если только уверены в этом. Иначе вы можете потерять доступ к любым клиентам до восстановления старой роли.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Учитель</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Администратор</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Сторонник</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Другой</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Установки для мульти-входа</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Домен</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Действие по двойному щелчку в окне клиента</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Здесь вы можете установить действие по двойному клику на окне клиента</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Удаленное управление</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Показать трансляцию на полном экране</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Вс [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Ваша конфигурация iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">В этой области вы можете настроить  iTALC под себя.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">ОК</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">Демо iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Ошибка аутенфикации</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Кто-то (IP: %1) пытается получить доступ к этому компьютеру, но не прошел аутенфикацию!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished">Превышено количество попыток VNC аутентификации.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished">VNC аутентификация не удалась.</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished">VNC сервер закрыл соединение.</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished">Помощник операций с ключем доступа к iTALC</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished">Создать/Импортировать ключи доступа к iTALC</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished">Помощник поможет Вам создать или импортировать ключи доступа к iTALC</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished">Как он работает?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished">Ключи доступа к iTALC состоят из двух частей - закрытого и открытого ключа.
-
-С помощью закрытого ключа пользователи главного компьютера смогут получить доступ к клиентским компьютерам. Обязательно необходимо убедиться, что только авторизованные пользователи имеют доступ на чтение файла, содержащего закрытый ключ.
-
-Открытый ключ используется на клиентских компьютерах для проверки, что все входящие запросы посылаются главным компьютером.</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished">Режим работы помощника</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished">Пожалуйста, выберите, нужно ли создавать новые ключи доступа или импортировать уже существующий открытый ключ на клиентскую машину.</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished">Создать новые ключи доступа (главный компьютер)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished">Импортировать открытый ключ (для клиентских машин)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished">Пожалуйста, выберите роль пользователя, который будет создавать или импортировать ключи доступа:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Учитель</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Администратор</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished">Член службы поддержки</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Другой</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished">Роли пользователей позволяют использовать несколько ключей доступа одновременно. Например, можно создать различные ключи доступа учителям для каждого класса, а ключи доступа для технической поддержки будут одинаковы для всего учебного заведения.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished">Каталоги</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished">Экспортировать открытый ключ (главный компьютер)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished">Использовать пользовательский каталог для хранения ключей доступа</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished">Пожалуйста, укажите расположение открытого ключа доступа для его импорта</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished">Основная информация</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished">Будут выполнены следующие действия:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished">• Созданы новые ключи доступа</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished">• Импортирован открытый ключ из</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished">• Записаны ключи в</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished">• Экспортирован открытый ключ в</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished">• Выполнена настройка для роли пользователя</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished">Выберите каталог, в который будет осуществлен экспорт открытого ключа</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished">Файлы ключей (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished">Неправильный формат открытого ключа</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished">Выбранный файл не содержит открытый ключ доступа к iTALC</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished">Выберите каталог назначения</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished">Создание ключа доступа</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished">Не удается удалить ранее существующий файл %1.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished">Ошибка экспорта открытых ключей доступа из %1 в %2.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished">Ключи доступа были успешно созданы в %1 и %2.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished">Произошла ошибка при создании ключей доступа. Возможно, у выбранного каталога установлен запрет на запись.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished">Импорт открытого ключа</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished">Произошла ошибка при импорте открытого ключа доступа. Возможно, у файла, содержащего исходный ключ, установлен запрет на чтение или существует запрет на запись в каталоге, содержащем ключи (конечном каталоге).</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished">Открытый ключ был успешно импортирован в %1.</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">блокировка экрана</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished">Пожалуйста, добавьте группы, члены которых могут иметь доступ к компьютерам в сети iTALC.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished">Все группы</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished">Группы с привилегиями iTALC</translation>
-    </message>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Действия</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Главное</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Выход</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished">Сервер iTALC</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished">Пути</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished">Аутентификация</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished">Сервис iTALC</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished">Скрыть иконку в трее</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished">Автозапуск</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished">Дополнительные параметры</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished">Запустить сервис</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished">Остановить сервис</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished">Состояние:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished">Остановлен</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished">Ведение журнала</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished">Каталог, содержащий файл журнала</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished">Уровень журналирования</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished">Отключить журналирование</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished">Только критические ошибки</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished">Все ошибки</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished">Предупреждения и ошибки</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished">Информационные сообщения, предупреждения и ошибки</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished">Все сообщения вместе с отладочной информацией</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished">Ограничить размер файла журнала</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished">Мб</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished">Очистить все файлы журналов</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished">Захват рабочего стола</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished">Включить захват с помощью полупрозрачного окна</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished">Низкая четкость (высокая скорость)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished">Демонстрационный сервер</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished">Сеть</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished">Основной порт сервера</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished">Порт демонстрационного сервера</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished">Включить исключения рандмауэра</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished">Конфигурационные файлы</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished">Общие настройки</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished">Персональные настройки</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished">Каталоги с данными</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Снимки экрана</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished">Методы аутентификации</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished">Управление ключами доступа</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished">Настройки входа в систему</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished">&Файл</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished">&Помощь</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished">&Выход</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished">&Сохранить настройки в файл</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished">Сохранить настройки в файл</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished">Загрузить настройки из файла</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">О программе iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished">О пакете Qt</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished">Консоль управления iTALC %1</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished">Работает</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished">Загрузить настройки из файла</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished">Файлы XML (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished">Сохранить настройки в файл</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished">Несохраненные настройки</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished">Существуют несохраненные настройки. Выйти, не сохранив их?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished">Файл конфигурации не доступен для записи</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished">Локальный сервер сообщил, что конфигурация защищена от записи. Запустите консоль управления iTALC с более высокими привилегиями.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished">Все настройки были успешно применены.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished">Ошибка в применении параметров!</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished">Нет доступа на запись</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Невозможно читать/писать или создать директорию %1! Для запуска iTALC убедитесь что у вас есть права на создания или запись в эту директорию.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Класс</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Переключить класс</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Нажмите эту кнопку для открытия меню в котором можно выбрать активную классную комнату.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Нажмите эту кнопку для переключения между классами.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Режим обзора</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Обзор</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Это режим iTALC по умолчанию и он позволяет выполнять обзор всех видимых компьютеров. Также нажатие на эту кнопку разблокирует блокированные рабочие станции или покинет демо-режим.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Полноэкранное демо</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Полноэкранное Демо</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Остановить Демо</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">В этом режиме ваш экран будет отображаться на всех видимых компьютерах. Пользователи будут заблокированы и не смогут ничего делать.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Демо в окне</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Демо в окне</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">В этом режиме ваш экран будет отображаться на экране всех выбранных компьютеров. Пользователи могут переключаться на другие окна, но этот режим будет продолжать работать.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Блокировать/разблокировать компьютеры</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Заблокировать все</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Разблокировать все</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Вы можете использовать эту кнопку для привлечения полного внимания всех пользователей и блокировки их настольных компьютеров. В этом режиме блокируются все устройства ввода и гасится экран монитора.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Послать текстовое сообщение</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Текстовое сообщение</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Используйте эту кнопку для посылки текстового сообщения всем пользователям, например сказав им о новых задачах.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Включить компьютеры</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Включить</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Нажмите эту кнопку для включения всех видимых компьютеров. Это позволит вам не включать каждый компьютер вручную.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Выключить компьютеры</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Выключить</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Вы должны нажать эту кнопку для выключения всех отображаемых компьютеров (например после завершения урока).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Поддержка</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Прямая поддержка</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">Если вам нужно поддерживать какой-нибудь пользователя на определенном компьютере, вы можете нажать на эту кнопку и ввести соответствующее имя компьютера или IP.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Подогнать/выровнять</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Подогнать окно под его размер</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">При нажатии этой кнопки окна клиентов станут максимально возможного размера. Также все окна будут перерасположены.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Авто вид</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Автоматическая расстановка окон и подгонка размеров</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">При нажатии на эту кнопку все видимые окна будут перераспределены и подогнаны по размеру.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">Основной Контроль iTALC</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Удаленное управление</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished">Не удалось изменить настройки автозапуска службы iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished">Не удалось изменить параметры для службы iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished">Невозможно изменить настройки брандмауэра для службы iTALC.</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished">Отладка</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished">Включение переключения рабочего стола для блокировки экрана (экспериментальная функция)</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished">Обычное журналирование</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished">Журналирование в системный журнал событий</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished">iTALC 1 - демонстрационный сервер</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished">Многопоточность (может быть включена при использовании VNC reflector backend)</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished">Включить HTTP-сервер, предоставляющий апплет JavaViewer</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished">Порт HTTP-сервера</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished">Разрешить только локальные подключения</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished">Аутентификация с помощью ключа доступа</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished">Аутентификация с помощью списков доступа (ACL)</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished">Каталог, содержащий открытые ключи</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished">Каталог, содержащий закрытые ключи</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished">Запустить помощник операций с ключем доступа</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished">Управление разрешениями</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished">Тестировать</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished">Подтверждение доступа</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished">Вы можете настроить iTALC так, что он будет спрашивать у пользователя разрешение на доступ к рабочему столу, используя определенные методы аутентификации.</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished">Аутентификация при входе в систему</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished">Предоставить пользователю доступ к рабочему столу без повторного подтверждения</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished">Отладка iTALC</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished">При возникновении ошибки или другого неожиданного поведения iTALC желательно сообщить об этом разработчикам. В этом случае ошибки могут быть исправлены в будущих версиях. На этой странице можно создать отчет об ошибке.
-
-Если ошибка повторно не воспроизводится, пропустите шаг 1) - 3).</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished">Очистите файлы журналов в разделе "Общие настройки".</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished">В разделе "Общие настройки" установите уровень журналирования в "Все сообщения вместе с отладочной информацией".</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished">Повторите действия, ведущие к ошибке или неправильному поведению программы.</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished">Нажмите следующую кнопку и сохраните файл</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished">Создать архив, содержащий отчет об ошибке</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished">Откройте <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">трекер ошибок iTALC</a>, откройте новую запись с ошибкой, опишите шаги, приводящие к ней (шаг 3) и прикрепите файл с отладочной информацией (шаг 4).</p>
-<br/>
-<br/>
-Замечание: Если ошибка возникает на главном комьютере и клиентском компьютере одновременно, отправьте оба отчета об ошибке.</translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished">Перезапуск сервиса iTALC</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished">Все настройки были успешно сохранены. Для того чтобы они вступили в силу необходимо перезапустить службу iTALC. Перезапустить ее сейчас?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished">Запуск сервиса iTALC</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished">Остановка сервиса iTALC</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished">Файлы журналов были очищены</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished">Все файлы журналов были успешно очищены.</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished">Ошибка</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished">Невозможно удалить все файлы журналов.</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished">Тестирования аутентификации входа в систему</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished">Аутентификация учетных данных прошла успешно.</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished">При прохождении аутентификации учетных данных возникли ошибки!</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished">Сохранить архив, содрежащий отчет об ошибках</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished">Архив отчета об ошибках iTALC (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished">Архив, содержащий отчет об ошибках iTALC, сохранен</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished">Невозможно соединиться с сервисом iTALC</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished">Невозможно соединиться с локальным сервисом iTALC. Возможно, Вы неправильно указали учетные данные или не установили файлы, содержащие ключи доступа. Попробуйте повторить попытку соединения. В случае, если ошибка повториться вновь, обратитесь к Вашему администратору для ее решения с помощью консоли управления iTALC.</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished">Невозможно выполнить аутентификацию</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Не найдены файлы ключей аутентификации или они устарели. Пожалуйста, создайте новые файлы, используя консоль управления iTALC. Иначе Вы не сможете получить доступ к компьютерам с помощью iTALC.</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Сообщение для учителя</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Добро пожаловать в iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Здесь вы видите на рабочую панель, которая содержит несколько кнопок. Каждая кнопка ведет к рабочей области. Просто взгляните на имеющиеся рабочие  области, нажав на соответствующую кнопку.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">С помощью менеджера классов вы можете управлять классами и компьютерами. Вы также можете видеть подключенных пользователей.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Рабочая область снимков очень мощный инструмент. Он позволяет управлять сделанными вами снимками.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Конечно же вы можете настроить iTALC. Это можно сделать в соответствующей области.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">О программе iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Обзор</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Начальная информация о iTALC и его использовании.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished">Пожалуйста, введите имя пользователя и пароль для доступа клиентских компьютеров к iTALC.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Имя пользователя</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Пароль</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished">Вход в систему iTALC</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Клиент iTALC %1 на %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Не удалось зарегистрировать службу '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Невозможно связаться с Service Control Manager (может у Вас недостаточно прав?!) - служба '%1' не зарегистрирована.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Служба '%1' уже зарегистрирована.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Служба '%1' невозможно зарегистрировать.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Служба '%1' была успешно зарегистрирована.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Службу '%1' невозможно остановить.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Регистрация службы '%1' была отменена.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Служба '%1' не была зарегистрирована и поэтому невозможно ее отменить.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Отмена регистрации службы '%1' невозможна.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Службу '%1' нельзя найти.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Невозможно связаться с Service Control Manager (может у Вас недостаточно прав?!) - отмена регистрации службы '%1' не выполнена.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Невозможно связаться с Service Control Manager (может у Вас недостаточно прав?!) - служба '%1' не остановлена.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished">Живой просмотр (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished">Удаленное управление (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">неизвестный пользователь</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Только обзор</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Удаленное управление</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Заблокировать студента</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Разблокировать студента</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Снимок экрана</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">На весь экран</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">В окне</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Выход</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Соединение с %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Подключен.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Удаленный вход</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished">Используйте приведенные ниже поля для ввода имени пользователя, пароля и необязательного названия домена. Эта информация будет использована для входа в систему(ы).</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Имя пользователя</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Пароль</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Домен</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished">Выполнить команды</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished">Пожалуйста, введите команды для их выполнения на выбранных клиентских компьютерах. Вы можете записать несколько команд, по одной в строке.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Невозможно сделать снимок экрана, так как директория %1 не существует и не может быть создана.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Снимок экрана</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Снимки экрана</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Вы можете легко управлять снимками, используя эту рабочую область.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Здесь перечислены все сделанные вами снимки. Вы можете делать снимки, выбрав соответствующую запись в  контекстном меню окна клиента. Этими снимками можно управлять с помощью расположенных ниже кнопок.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Пользователь:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Компьютер:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Дата:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Время:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished">Показать</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished">Удалить</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Поддержка</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished">Пожалуйста, введите IP-адрес или имя хоста, к которому вы хотите подключиться.</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Послать текстовое сообщение</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Используйте это поле снизу для набора сообщения, которое хотите послать всем выбранным пользователям.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Восстановление соединения с %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Обзор</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Полноэкранное демо</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Демо в окне</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Заблокированный дисплей</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Прямая трансляция</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Удаленное управление</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Разрешить учащемуся показать демо</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Послать текстовое сообщение</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Завершить работу</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Сделать снимок экрана</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Включить</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Перезагрузить</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Выключить</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Запустить команду</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/sk.qm b/lib/resources/sk.qm
deleted file mode 100644
index 52eb07f..0000000
Binary files a/lib/resources/sk.qm and /dev/null differ
diff --git a/lib/resources/sk.ts b/lib/resources/sk.ts
deleted file mode 100644
index 5401661..0000000
--- a/lib/resources/sk.ts
+++ /dev/null
@@ -1,1766 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="sk_SK">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">O programe</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Autori</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Preklad</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Licencia</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Nikdy pre toto sedenie</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Vždy pre toto sedenie</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Správca triedy</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Tu môžete ľahko spravovať počítače a triedy.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Tu sa ovládajú počítače a učebne. Počítače pridáte kliknutím pravého tlačidla myši v zozname.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Počítače/triedy</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP-adresa</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Exportovat do textového súbora</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Skryť učiteľské počítače</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Zobraziť/skryť</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Upraviť nastavenie</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Odstraniť</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Zobraziť všetky počítače v triede</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Skryť všetky počítače v triede</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Upraviť meno</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Odstraniť triedu</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Pridať počítač</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Pridať triedu</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Nebol nájdený žiadny konfiguračný súbor</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Nemôžem otvoriť konfiguračný súbor %1.
-Budete musieť pridať aspoň jednu učebnu a počítač pomocov Správcu tried, kterého nájdete v programe na ľavom paneli.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Chyba v konfiguračnom súbore</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Chyba pri analýze konfiguračného súboru %1.
-Upravte ho prosím ručne. Tiež môžete tento súbor zmazať a pridať všetky triedy a počítače znova.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Chyba pri analýze konfiguračného súboru %1.
-Upravte ho prosím. Inak byste tento súbor mali zmazať.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Vybrať výstupný súbor</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Textové súbory (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Akcia</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Akcia pre %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Nové meno triedy</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Zadajte prosím nové meno pre triedu "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Naozaj si prajete odstrániť triedu "%1"?
-Všetky počítače v triede budú odstránené!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Chýba trieda</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Pred pridaním počítačov musíte vytvoriť aspoň jednu triedu.
-Prajete si teraz vytvoriť novú triedu?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nová trieda</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Zadajte prosím meno novej triedy, ktorú si prajete vytvoriť.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Neznámy stav</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Žiadny užívateľ nie je prihlásení</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Počítač nie je  k dispozícii</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Bežiace predvádzanie</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Desktop zamknutí</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Opravdu chcete odhlásiť všetkých užívateľou?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odhlásiť užívateľa</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Naozaj si prajete reštartovať všetky zobrazené počítače?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Reštartovať počítače</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Naozaj si prajete vypnúť všetky zobrazené počítače?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Neplatná MAC-adresa</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Musíte zadat platnú MAC-adresu. Zadejte platnú MAC-adresu (oddelovačom je ":"), alebo nechajte pole prázdne.</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Nastavenie klienta</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/meno</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">zadejte IP-adresu alebo meno počítača, na ktorom beží klient iTALC  [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Jméno</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardwarová/MAC-adresa klienta - používá sa len pre zapnutie klients [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Trieda</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Typ</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Študentský počítač</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Učiteľský počítač</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Iný/nedefinovaný počítač</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Interval medzi aktualizáciami</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tu sa zadává interval medzi jednotlivými aktualizáciami klientov. V [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">(sp) sekúnd</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Užívateľské rozhranie</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nezobrazovat tipy v panelu nástrojů</p></body></html [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Túto voľbu zaškrtnite, pokiaľ sa vám nepáči zobrazovanie pomoci v p [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Nepoužívať bublinovú pomoc.</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Vaša rola (vyžaduje odpovedajúce kľúče!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tu môžete vybrať vašu rolu. Voľbu zmente len pokiaľ skutočne viete čo robíte. Inak sa môže stat, že nebudete môct pristupovať k žiadnym klientom až pokiaľ neobnovíte svoju rolu.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Učiteľ</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrátor</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Iná</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Nastavenia pre viacnásobné prihlásenie</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Doména</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Dvojklik v okne klienta</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tu sa nastavuje čo sa má stat, pokiaľ urobíte dvojklik v okne klienta.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdialené ovládanie</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Zobrazenie na celej obrazovke</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Za [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Konfigurácia iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">V tomto pracovnom prostredí môžete upraviť iTALC vašim potrebám.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">Predvádzanie iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Chyba autentifikácie</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Niekto (IP: %1) sa pokúša pristupovať k tomuto počítaču, ale nie je ho možné autentifikovať!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Učiteľ</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrátor</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Iná</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">uzamknutie obrazovky</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Akcia</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Vlastné</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Ukončiť</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Zábery</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Nemôžem čítať/zapisovať alebo vytvoriť adresár %1! Pre spustenie iTALC je potrebné, abyste mali oprávnenie vytvárať a zapisovať do tohoto adresára.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Trieda</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Prepnúť triedu</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Kliknutím na toto tlačidlo sa zobrazí ponuka, kde si budete môct zvoliť aktívnu triedu.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Kliknite na toto tlačidlo a prepnete sa medzi triedami.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Mód prezerania</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Prehľad</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Toto je výchozí mód iTALC, ktorý vám umožní zobraziť prehľad dostupných počítačov. Kliknutím na toto tlačidlo odomknete zamknuté počítače alebo opustíte ukážkový mód.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Predvádzanie cez celú obrazovku</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">V tomto móde bude vaša obrazovka zobrazená na všetkých dostupných počítačoch. Okrem toho, užívatelia budú mať uzamknuté vstupné zariadenia.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">V tomto móde sa vaša obrazovka zobrazí na všetkých počítačoch. Užívatelia pritom budú môct prepínať medzi daľšími oknami a tak môže vaša práca pokračovať.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Zamknúť/odomknúť počítače</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Zamknúť všetko</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Odomknúť všetko</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Pomocou tohoto tlačidla môžete uzamknúť všetky počítače. V tomto móde budú všetky vstupné zariadenia uzamknuté a obrazovky budú čierne.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslať textovú správu</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Textová správa</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Pomocou tohoto tlačidla môžete poslať správu všetkým užívateľom, napr. zadať im nové úlohy, atd.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Zapne počítače</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Zapnúť</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Kliknutím na toto tlačidlo zapnete všetky viditeľné počítače. Takto nemusíte zapínať každý počítač ručne.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Vypnúť</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Pre vypnutie všetkých zobrazených počítačov (napr. na konci hodiny), stačí kliknút na toto tlačidlo.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Usporiadať/zarovnať</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Usporiada okná a nastaví ich veľkosť</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Kliknutím na toto tlačidlo bude nastavená ta najväčšia možná veľkosť okien klientov. Okrem toho budú všetky okná usporiadané.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Automatický pohľad</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automaticky prispôsobí okná aj ich veľkosť</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Kliknutím na toto tlačidlo budú všetky okná preusporiadané a prispôsobené.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdialené ovládanie</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Správa od učiteľa</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;"> Vítajte v iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Na pracovnej ploche sú vidieť rôzne tlačidlá. Každé tlačítko je pripojené k nejakej pracovnej ploche. Kliknutím na odpovedajúce tlačidlo sa pozrite na dostupnú pracovnú plochu.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Plocha zo záberom obrazovky je veľmi užitočná. Umožní vám vytvárať zábery.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Samozrejme, že môžete nastavovať iTALC. To sa obyčajne robí pomocou konfiguračnej plochy.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Prehľad</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Niektoré základné informácie o iTALC a práce s programom.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Uživateľské meno</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Klient iTALC %1 na %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Nemôžem kontaktovat Správcu služieb (máte potrebné oprávnenie?!) - služba '%1' nebola zaregistrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Služba '%1' je už registrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Služba '%1' bola úspešne registrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Službu '%1' nie je možné zastaviť.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Služba '%1' bola odregistrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Služba '%1' nie je registrovaná a preto ju nemôžeme odregistrovať.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Službu '%1' nebolo možné odregistrovať.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Služba '%1' sa nedá nájsť.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Nemôžem kontaktovať Správcu služieb (máte potrebné oprávnenie?!) - služba '%1' sa nedá odregistrovať.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Nemôžem kontaktovať Správcu služieb (máte potrebné oprávnenie?!) - služba '%1' nebola zastavená.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">neznámý užívateľ</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Len prezerať</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdialené ovládanie</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Zamknúť študenta</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Odomknúť študenta</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Záber</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Celá obrazovka</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Okno</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Ukončiť</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Pripájam %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Pripojené.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Vzdialené prihlásenie</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Uživateľské meno</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Doména</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Nemôžem získať snímok, pretože adresár %1 neexistuje a nedá sa vytvoriť.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Záber</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Zábery</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Jednoducho spravuje vami vytvorené zábery plôch.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Všetky vytvorené zábery sa uložia tu. Zábery môžete urobiť výberom odpovedajúcej položky v kontextovej ponuke klientského okna. Tieto zábery je možné zpracovať pomocou tlačidiel nižšie.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Užívateľ:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Počítač:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Dátum:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Čas:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslať textovú správu</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Do pola nižšie zadajte vašu správu, ktorá bude poslaná vybraním užívateľom.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Pripájam sa k %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Prehľad</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Predvádzanie cez celú obrazovku</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Obrazovka zamknutá</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Zobraziť naživo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdialené ovládanie</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Zobraziť študentom demo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslať textovú správu</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odhlásiť užívateľa</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Zoskenovať obrazovku</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Zapnúť</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Reštartovať</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Vypnúť</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Vykonať príkaz</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/sl.qm b/lib/resources/sl.qm
deleted file mode 100644
index 12929e6..0000000
Binary files a/lib/resources/sl.qm and /dev/null differ
diff --git a/lib/resources/sl.ts b/lib/resources/sl.ts
deleted file mode 100644
index f5b4d5f..0000000
--- a/lib/resources/sl.ts
+++ /dev/null
@@ -1,1767 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">O</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Avtorji</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Prevod</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Dovoljenja</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Nikoli za to sejo</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Zmeraj za to sejo</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Upravitelj učilnice</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Uporabite to mesto za enostavno upravljanje računalnikov in učilnic.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Tukaj lahko upravljate učilnice in računalnike. S klikom v desnem seznamu lahko dodajate učilnice ali računalnike.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Učilnice/računalniki</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP-naslov</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Izvozi v besedilno datoteko</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Skrij učiteljeve računalnike</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Prikaži/skrij</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Uredi nastavitve</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Odstrani</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Prikaži vse računalnike v učilnici</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Skrij vse računalnike v učilnici</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">Uredi ime</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Odstrani učilnico</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Dodaj računalnik</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Dodaj učilnico</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Ne najdem nastavitvene datoteke</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">Ne morem odpreti nastavitvene datoteke %1.
-Z uporabo upravitelja učilnice, ki ga najdete v levi stranski orodni vrstici, boste morali dodati najmanj eno učilnico in računalnike.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Napaka v nastavitveni datoteki</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Napaka pri anlizi nastavitvene datoteke %1.
-Prosim, uredite jo. Sicer boste morali to datoteko izbrisati in ponovno dodati vse učilnice in računalnike.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">Napaka pri anlizi nastavitvene datoteke %1.
-Prosim, uredite jo. Sicer bi morali to datoteko izbrisati.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Izberite izhodno datoteko</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Besedilne datoteke (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Dejanja</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">Dejanja za %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Novo ime učilnice</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Prosim, vpišite novo ime učilnice "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Ste prepričani, da želite odstraniti učilnico "%1"?
-
-Z njo bodo odstranjeni tudi vsi računalniki v njej!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Manjka učilnica</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Pred dodajanjem računalnikov morate ustvariti vsaj eno učilnico.
-Jo želite ustvariti zdaj?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Nova učilnica</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Prosim, vnesite ime učilnice, ki jo želite ustvariti.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Neznano stanje</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Noben uporabnik ni prijavljen</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">Gostitelj ni dosegljiv</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Demo je zagnan</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Namizje je zaklenjeno</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Ste prepričani, da želite odjaviti vse uporabnike na vseh vidnih računalnikih?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odjavi uporabnika</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Ste prepričani, da želite ponovno zagnati vse vidne računalnike?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Ponovno zaženi računalnike</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Ste prepričani, da želite izključiti vse vidne računalnike?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Neveljaven MAC-naslov</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Navedli ste neveljaven MAC-naslov. Ali pustite polje prazno ali vnesite veljaven MAC-naslov (uporabite ":" kot ločilo!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Nastavitve odjemalca</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/ime gostitelja</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">vnesite IP-naslov ali ime gostitelja pod katerim bo iTALC lahko dos [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Ime</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Strojni/MAC-naslov gostitelja - uporabljeno le pri zagonu odjemalca [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Učilnica</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Tip</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Učenčev računalnik</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Učiteljev računalnik</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Drug/nedoločen računalnik</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Časovni interval med posodobitvami</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tukaj lahko vnesete časovni interval med posodobitvami odjemalcev.  [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished">(sp)sekund</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Uporabniški vmesnik</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ne prikaži namigov za gumbe orodne vrstice</p></body>&l [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Označite to možnost, če vas namigi, ki se prikazujejo, ko z miško p [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">Brez namigov</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Vaša vloga (zahteva ustrezne ključe!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">(new line)
-p, li { white-space: pre-wrap; }(new line)
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">(new line)
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tukaj lahko izberete svojo vlogo. Spreminjajte, če resnično veste, kaj delate. Sicer ne boste mogli dostopati do odjemalcev dokler ne boste obnovili svoje stare vloge.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Učitelj</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrator</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Pomočnik</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Drugo</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Nastavitve za prijavo na več računalnikov</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domena</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Dvjno kliknite dejanje za okno odjemalca</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">(new line)
-p, li { white-space: pre-wrap; }(new line)
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">(new line)
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Tukaj lahko vidite, kaj naj bi se zgodilo ob dvojnem kliku na okno odjemalca.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Pogled v živo celozaslonsko</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Ne [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">Vaše iTALC nastavitve</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Tukaj lahko prilagodite iTALC vašim potrebam.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">V redu</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC Demo</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Napaka verodostojnosti</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">Nekdo iz (IP: %1) poskuša dostopati do tega računalnika, vendar ne more potrditi svoje verodostojnosti!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Učitelj</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administrator</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Drugo</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">zaklenjeno namizje</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Dejanja</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Splošno</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Zapusti</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Posnetki</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">Ne morem brati/zapisati ali ustvariti mape %1! Za delovanje iTALC morate imeti dovoljenja za ustvarjanje ali pisanje v to mapo.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Učilnica</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Zamenjaj učilnico</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Kliknite ta gumb, da bi odprli meni, kjer lahko izberete aktivno učilnico.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Kliknite ta gumb za zamenjavo učilnic.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Pregledni način</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Pregled</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">To je privzeti način iTALC in vam omogoča imeti pregled nad vsemi vidnimi računalniki. Ta gumb kliknite tudi za odklepanje zaklenjenih delovnih postaj ali zapuščanje demo načina.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Celozaslonski demo</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">V tem načinu je vaš zaslon prikazan na vseh prikazanih računalnikih. Še več, uporabniki ne morejo delati ničesar, ker so vse vhodne naprave zaklenjene.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">V tem načinu je na vseh prikazanih računalnikih prikazan vaš zaslon v oknu. Uporabniki lahko zamenjajo okno in nadaljujejo z delom.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Zakleni/odkleni namizja</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Zakleni vse</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Odkleni vse</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Da bi dosegli pozornost vseh uporabnikov lahko zaklenete njihova namizja z uporabo tega gumba. Vse njihove vhodne naprave so tedaj zaklenjene in njihovi zasloni črni.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Besedilno sporočilo</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Uporabite ta gumb za pošiljanje besedilnih sporočil vsem uporabnikom, npr. da jim pojasnite nova opravila itd.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Vključi računalnike</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Vključi</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Kliknite ta gumb za vključitev vseh vidnih računalnikov. Na ta način vam ni potrebno ročno vključevati vsakega računalnika posebej.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Izključi računalnike</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Izključi</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Za zaustavitev vseh prikazanih računalnikov (npr. ko je ura končana) lahko kliknete ta gumb.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Prilagodi/poravnaj</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Poravnaji okna in prilagodi njihovo velikost</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Po kliku tega gumba bo velikost oken odjemalca nastavljena na največjo mogočo. Vsa okna bodo poravnana.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Samodejni pogled</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Preuredi okna in njihovo velikost</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Po kliku tega gumba bodo vsa vidna okna preurejena in ponovno nastavljena.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Sporočilo predavatelja</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">(new line)
-p, li { white-space: pre-wrap; }(new line)
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">(new line)
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Dobrodošli v iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Tukaj vidite delovno vrstico, ki vsebuje več gumbov. Vsak gumb pripada delovnemu prostoru. Preglejte delovne prostore s kliki na ustrezne gumbe.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Posnetek delovnega prostora je zelo uporabno orodje. Tukaj lahko upravljate s posnetki, ki ste jih naredili.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">Seveda lahko nastavite iTALC. To navadno naredite z uporabo nastavitvenega delovnega prostora.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Pregled</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">Osnovne informacije o iTALC in uporabi.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Uporabniško ime</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Geslo</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC odjemalec %1 na %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Ne morem registrirati storitve '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Storitev urejevalnika nadzora ne more biti povezana (imate ustrezne pravice?!) - storitev  '%1'  ni bila registrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Storitev '%1' je že registrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Storitev '%1' ne more biti registrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Storitev '%1' je bila uspešno registrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Storitve '%1' ni možno ustaviti.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Storitev '%1' je bila neregistrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Storitev '%1' ni registrirana in zato ne more biti neregistrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Storitev '%1' ne more biti neregistrirana.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Storitve '%1' ni mogoče najti.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Storitev urejevalnika nadzora ne more biti povezana (imate ustrezne pravice?!) - storitevi  '%1'  ni bila neregistrirana.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Storitev urejevalnika nadzora ne more biti povezana (imate ustrezne pravice?!) - storitev  '%1'  ni bila ustavljena..</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">neznan uporabnik</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Samo pogled</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Zakleni učenca</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Odkleni učenca</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Posnetek</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Celozaslonsko</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Okno</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Zapusti</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">Povezujem %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Povezan.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Oddaljena prijava</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Uporabniško ime</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Geslo</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domena</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">Ne morem vzeti posnetka ker mapa %1 ne obstaja in ne more biti ustvarjena.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">Posnetek</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Posnetki</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Enostavno upravljajte s posnetki, ki ste jih naredili, z uporabo tega prostora.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">(new line)
-p, li { white-space: pre-wrap; }(new line)
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">(new line)
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vsi posnetki, ki ste jih naredili, so našteti tukaj. Posnetke lahko naredite z ustrezno izbiro v kontekstnem meniju v oknu odjemalca. S temi posnetki lahko upravljate z uporabo spodnjih gumbov.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Uporabnik:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Gostitelj:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Datum:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Ura:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Uporabite spodnje polje za vpis sporočila, ki ga želite poslati vsem izbranim uporabnikom.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Vspostavljam povezavo na %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Pregled</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Celozaslonski demo</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Zaklenjen zaslon</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">Pogled v živo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Dovoli učencu vpogled v demo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odjavi uporabnika</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Posnemi trnutno stanje</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Vključi</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Ponovno zaženi</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Izključi</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Izvedi ukaze</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/sv.qm b/lib/resources/sv.qm
deleted file mode 100644
index 7d58928..0000000
Binary files a/lib/resources/sv.qm and /dev/null differ
diff --git a/lib/resources/sv.ts b/lib/resources/sv.ts
deleted file mode 100644
index 5ab525e..0000000
--- a/lib/resources/sv.ts
+++ /dev/null
@@ -1,1770 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="sv">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">Om iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Om</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Upphovsmän</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Översättning</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Licens</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation>Aldrig för denna session</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Alltid för denna session</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Klassrumshanterare</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Använd denna arbetsyta för att hantera dina datorer och klassrum på ett enkelt sätt.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>Detta är där datorer och klassrum hanteras. Du kan lägga till datorer eller klassrum genom att klicka till i listan.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Klassrum/datorer</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>IP-adress</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Användarnamn</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>Visa användarnamn</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Använd sammanhangsmenyn (höger musknapp) för att lägga till/ta bort datorer och/eller klassrum.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>Exportera till textfil</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>Använd denna knapp för att exportera denna lista över datorer och användarnamn till en textfil. Du kan använda denna fil senare för att samla in filer efter ett prov har avslutats. Detta är ibland nödvändigt därför att vissa användare kanske har gjort färdigt provet tidigt och loggat ut och på sätt kan du inte samla in deras filer när provet avslutas.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Dölj lärardatorer</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Visa/dölj</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Redigera inställningar</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Ta bort</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Visa alla datorer i klassrummet</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Dölj alla datorer i klassrummet</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Redigera namn</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Ta bort klassrum</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Lägg till dator</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Lägg till klassrum</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>Ingen konfigurationsfil hittades</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>Kunde inte öppna konfigurationsfilen %1.
-Du måste lägga till minst ett klassrum och datorer med hjälp av klassrumshanteraren som du hittar inuti programmet i vänstra sidopanelen.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Fel i konfigurationsfilen</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>Fel vid tolkning av konfigurationsfilen %1.
-Du måste redigera den. Om inte så bör du ta bort denna fil och lägga till alla klassrum och datorer igen.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Fel vid tolkning av konfigurationsfilen %1.
-Du måste redigera den. Om inte så bör du ta bort denna fil.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Välj utdatafil</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Textfiler (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>Åtgärder för markerade</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>Åtgärder</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>Åtgärder för %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Nytt namn för klassrum</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Ange ett nytt namn för klassrummet "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Är du säker på att du vill ta bort klassrummet "%1"?
-Alla datorer i det kommer även att tas bort!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>Saknar klassrum</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>Du måste skapa minst ett klassrum innan du kan lägga till datorer.
-Vill du skapa ett nytt klassrum nu?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Nytt klassrum</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Ange namnet på det klassrum som du vill skapa.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>Okänt tillstånd</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Ingen användare inloggad</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>Värddatorn är inte nåbar</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>Demonstration körs</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>Skrivbordet är låst</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Är du säker på att du vill logga ut alla användare på alla synliga datorer?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Är du säker på att du vill logga ut alla användare på alla markerade datorer?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Logga ut användare</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Är du säker på att du vill starta om alla synliga datorer?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Är du säker på att du vill starta om alla markerade datorer?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>Starta om datorer</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Är du säker på att du vill stänga av alla synliga datorer?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Är du säker på att du vill stänga av alla markerade datorer?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>Ogiltig MAC-adress</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>Du angav en ogiltig MAC-adress. Lämna fältet tomt eller ange en giltig MAC-adress (använd ":" som avgränsare!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">Klientinställningar</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/värdnamn</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">ange en IP-adress eller värdnamn med vilket iTALC kan nå klienten ( [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">Namn</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Valfritt smeknamn på värddatorn som kommer att visas i iTALC.</p [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maskinvaru-/MAC-adress för klienten - används endast för att starta [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Klassrum</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Typ</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Studentdator</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Lärardator</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Annan/odefinierad dator</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>Intervall mellan uppdateringar</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Här kan du ställa in intervallet mellan uppdateringar av klienter. Högre värden resul [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation>sekunder</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>Användargränssnitt</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Visa inte ballongtips för verktygsradsknappar</p></body></html></tr [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Använd detta alternativ om du blir besvärad av ballongtips som visas när muspekaren r [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>Inga ballongtips</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Visa inte text på verktygsradsknappar</p></body></html></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Ingen text på verktygsradsknappar</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Din roll (kräver motsvarande nycklar!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Här kan du välja din roll. Ändra endast detta om du vet vad du gör. Om du gör fel så kanske du inte kan komma åt några klienter förrän du har återställt till din gamla roll.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Lärare</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Administratör</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>Supportperson</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Annan</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>Inställningar för flerinloggning</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domän</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>Dubbelklicksåtgärd för klientfönster</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Här kan du ställa in vad som ska hända när du dubbelklickar i ett klientfönster.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fjärrstyrning</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>Visa live i helskärm</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Observera att vissa  [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Din iTALC-konfiguration</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>I denna arbetsyta kan du anpassa iTALC till att passa dina behov.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC-demo</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>Autentiseringsfel</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Någon (IP: %1) försökte komma åt denna dator men kunde inte autentisera sig korrekt!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>VNC-autentisering misslyckades på grund av för många autentiseringsförsök.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>VNC-autentisering misslyckades.</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>VNC-servern stängde anslutningen.</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished">Guide för iTALC-åtkomstnycklar</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished">Skapa/importera iTALC-åtkomstnycklar</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished">Denna guide hjälper dig att skapa eller importera iTALC-åtkomstnycklar.</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished">Hur fungerar det?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished">iTALC-åtkomstnycklar består av två delar som tillhör varandra, en privat och en publik nyckeldel.
-
-Användare på huvuddatorn kan komma åt klientdatorer med den privata nyckeldelen. Det är viktigt att endast behöriga användare har läsrättigheter till den privata nyckeldelen.
-
-Den publika delen används på klientdatorerna för att verifiera att inkommande anslutningar är behöriga.</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished">Guideläge</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished">Välj huruvida du vill skapa nya åtkomstnycklar eller importera en publik nyckel på en klient.</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished">Skapa nya åtkomstnycklar (huvuddator)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished">assistantModeButtonGroup</translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished">Importera publik nyckel (klientdator)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished">Välj användarroll</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished">Välj en användarroll för vilken åtkomstnycklarna ska skapas eller importeras:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Lärare</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Administratör</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished">Medlem av supportgrupp</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Annan</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished">Användarroller tillåter att man använder flera åtkomstnycklar samtidigt. Till exempel kan det finnas olika åtkomstnycklar för lärare för varje klassrum men åtkomstnycklar för supportpersoner kan gälla för hela skolan.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished">Kataloger</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished">Exportera publik nyckeldel (huvuddator)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished">...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished">Använd anpassad målkatalog för åtkomstnycklar</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished">Ange platsen för den publika åtkomstnyckeln som ska importeras.</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished">Sammandrag</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished">Följande åtgärder kommer att genomföras:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished">• Skapa nya åtkomstnycklar</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished">• Importera publik åtkomstnyckel från</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"><okänt></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished">• Skriv åtkomstnycklar till</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished">• Exportera publik nyckel till</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished">• Konfigurera för användarrollen</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished">Välj katalog att exportera den publika nyckeln till</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished">Nyckelfiler (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished">Ogiltig publik nyckel</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished">Det valda filen innehåller inte någon giltig publik iTALC-åtkomstnyckel!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished">Välj målkatalog</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished">Skapa åtkomstnyckel</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished">Kunde inte ta bort befintliga filen %1.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished">Misslyckades med att exportera publik åtkomstnyckel från %1 till %2.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished">Åtkomstnycklar skapades och skrevs till %1 och %2.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished">Ett fel inträffade vid skapandet av åtkomstnycklar. Du har antagligen inte behörighet att skriva till de valda katalogerna.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished">Import av publik nyckel</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished">Ett fel inträffade vid import av publik åtkomstnyckel. Du har antagligen inte behörighet att läsa källnyckeln eller skriva till målfilen.</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>skärmlås</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished">Lägg till grupperna vars medlemmar ska tillåtas att komma åt datorer i ditt iTALC-nätverk.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished">Alla grupper</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished">...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished">Grupper med iTALC-behörighet</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>Åtgärder</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation>Allmänt</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Avsluta</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation>Hanteringskonsoll för iTALC</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>iTALC-server</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>Sökvägar</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>Autentisering</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>iTALC-tjänst</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>Dölj aktivitetsikonen</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>Automatisk start</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>Ytterligare argument</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>Starta tjänst</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>Stoppa tjänst</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>Tillstånd:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>Stoppad</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation>Loggning</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>Loggfilskatalog</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>Loggnivå</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>Ingenting</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>Endast kritiska meddelanden</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>Fel och kritiska meddelanden</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>Varningar och fel</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>Information, varningar och fel</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>Felsökningsmeddelanden och allting annat</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>Begränsa storlek på loggfil</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>MB</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>Töm alla loggfiler</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>Skrivbordsfångst</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>Aktivera fångst av flerskiktade fönster (semi-transparant)</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>Låg precision (turboläge)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>Demoserver</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>Nätverk</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>Serverport för core</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>Serverport för demo</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>Aktivera brandväggsundantag</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>Konfigurationsfiler</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>Allmän konfiguration</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>Personlig konfiguration</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>Datakataloger</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Skärmbilder</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>Autentiseringsmetoder</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>Hantering av åtkomstnycklar</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>Inloggningsinställningar</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation>&Arkiv</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>&Hjälp</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>A&vsluta</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation>Ctrl+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>&Spara inställningar till fil</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>Spara inställningar till fil</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation>Ctrl+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>&Läs in inställningar från fil</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation>Ctrl+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Om iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>Om Qt</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation>Huvudfönster</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation>verktygsrad</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>Hanteringskonsoll för iTALC %1</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>Kör</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>Läs in inställningar från fil</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation>XML-filer (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>Spara inställningar till fil</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>Osparade inställningar</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>Det finns osparade inställningar. Avsluta ändå?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>Konfigurationen är inte skrivbar</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>Den lokala konfigurationsbakänden rapporterade att konfigurationen är inte skrivbar. Kör hanteringskonsollen för iTALC med högre behörighet.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>Alla inställningar verkställdes.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>Ett fel inträffade vid verkställandet av inställningar!</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>Ingen skrivåtkomst</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>Kunde inte läsa/skriva eller skapa katalogen %1! Försäkra dig om att du har behörighet att skapa eller skriva till denna katalog för att kunna köra iTALC.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Klassrum</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>Växla klassrum</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>Klicka på denna knapp för att öppna en meny där du kan välja det aktiva klassrummet.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>Klicka på denna knapp för att växla mellan klassrum.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>Översiktsläge</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>Översikt</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>Detta är standardläget i iTALC och låter dig få en översikt över alla synliga datorer. Klicka även på denna knapp för att låsa upp låsta arbetsstationer eller för att lämna demoläget.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Helskärmsdemo</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>Helskärmsdemo</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>Stoppa demo</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>I detta läge kommer din skärm att visas på alla visade datorer. Användarna kommer dock inte att kunna göra något annat eftersom alla inmatningsenheter blir låsta i denna läge.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Fönsterdemo</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>Fönsterdemo</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>I detta läge kommer din skärm att visas i ett fönster på alla visade datorer. Användarna kommer att kunna växla till andra fönster och därför kunna fortsätta att arbeta samtidigt.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>Lås/lås upp skrivbord</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>Lås alla</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>Lås upp alla</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>Du kan med denna knapp låsa alla användares skrivbord för att få deras fulla uppmärksamhet. I detta läge kommer alla inmatningsenheter att låsas och skärmen blir svart.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Skicka textmeddelande</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>Textmeddelande</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>Använd denna knapp för att skicka ett textmeddelande till alla användare, t.ex. för att ge dem nya aktiviteter etc.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>Starta datorer</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Starta</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>Klicka på denna knapp för att starta alla synliga datorer. Med denna funktion så slipper du starta var och en av datorerna för hand.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>Stäng av datorer</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Stäng av</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>Du kan klicka på denna knapp för att stänga av alla visade datorer (t.ex. när lektionen är över).</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>Support</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>Direktsupport</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>Klicka på denna knapp om du behöver ge support till någon på en specifik dator och ange värdnamn eller IP-adress.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>Justera/rada upp</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>Justera fönster och deras storlek</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>Den största möjliga storleken för klientfönstret kommer att justeras när du klickar på denna knapp. Alla fönster kommer även att radas upp.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>Automatisk vy</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>Arrangera automatiskt om fönster och deras storlek</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>Alla synliga fönster kommer att arrangeras om och justeras när du klickar på denna knapp.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>Huvudstyrning - iTALC</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fjärrstyrning</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>Kunde inte ändra autostartsegenskaper för iTALC-tjänsten.</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>Kunde inte ändra tjänsteargumenten för iTALC-tjänsten.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>Kunde inte ändra brandväggskonfigurationen för iTALC-tjänsten.</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Meddelande från lärare</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Välkommen till iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>Här kan du se arbetsfältet som innehåller flera knappar. Varje knapp är ansluten till en arbetsyta. Ta en titt på de tillgängliga arbetsytorna genom att klicka på de motsvarande knapparna.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>Du kan hantera dina klassrum och datorer med klassrumshanteraren. Du kan även se vilka användare som är inloggade.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>Arbetsytan för skärmbilder är ett mycket användbart verktyg. Det låter dig hantera de skärmbilder som du har tagit.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Du kan så klart även konfigurera iTALC. Detta sker oftast i arbetsytan för konfiguration.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Om iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>Översikt</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Grundläggande information om iTALC och hur man använder det.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>Ange ditt användarnamn och lösenord för att komma åt iTALC-klienter.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Användarnamn</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Lösenord</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Klient iTALC %1 na %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Nemôžem kontaktovat Správcu služieb (máte potrebné oprávnenie?!) - služba '%1' nebola zaregistrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Služba '%1' je už registrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Služba '%1' bola úspešne registrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Službu '%1' nie je možné zastaviť.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Služba '%1' bola odregistrovaná.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Služba '%1' nie je registrovaná a preto ju nemôžeme odregistrovať.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Službu '%1' nebolo možné odregistrovať.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Služba '%1' sa nedá nájsť.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Nemôžem kontaktovať Správcu služieb (máte potrebné oprávnenie?!) - služba '%1' sa nedá odregistrovať.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Nemôžem kontaktovať Správcu služieb (máte potrebné oprávnenie?!) - služba '%1' nebola zastavená.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>Visa live (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>Fjärrstyrning (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>okänd användare</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>Visa endast</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fjärrstyrning</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>Lås student</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Lås upp student</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Skärmbild</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>Helskärm</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>Fönster</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Avsluta</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>Ansluter %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>Ansluten.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Fjärrinloggning</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Användarnamn</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Lösenord</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">Domän</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>okänd</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Kunde inte ta en skärmbild eftersom katalogen %1 inte finns och inte kunde skapas.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Skärmbild</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>Skärmbilder</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Hantera enkelt de skärmbilder som du skapat med denna arbetsyta.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. Du kan skapa skärmbilder genom att välja lämpligt objekt i sammanhangsmenyn för ett klientfönster. Dessa skärmbilder kan sedan hanteras med nedanstående knappar.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>Användare:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Värd:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>Datum:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>Tid:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>Visa</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>Ta bort</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Support</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Skicka textmeddelande</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Använd fältet nedan för att skriva ditt meddelande som ska skickas till alla markerade användare.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Etablerar anslutning till %1...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Översikt</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Demo i helskärm</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Demo i fönster</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Låst skärm</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Visa live</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Fjärrstyrning</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Låt student visa demo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Skicka textmeddelande</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Logga ut användare</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Ta en skärmbild</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Starta</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Starta om</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Stäng av</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Kör kommandon</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/tr.qm b/lib/resources/tr.qm
deleted file mode 100644
index 4fd2868..0000000
Binary files a/lib/resources/tr.qm and /dev/null differ
diff --git a/lib/resources/tr.ts b/lib/resources/tr.ts
deleted file mode 100644
index 7afc406..0000000
--- a/lib/resources/tr.ts
+++ /dev/null
@@ -1,1763 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">Hakkında</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">Program Geliştiricileri</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">Çeviri</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">Lisans</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">Bu oturum için asla</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">Bu oturum için herzaman</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">Sınıf Yönetimi</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">Bu çalışma alanını bilgisayarları ve sınıfınızı kolay yoldan yönetmek için kullanın</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">Bilgisayarların ve sınıfların yönetildiği bölümdesiniz. Bu listeye sağ tıklayarak bilgisayarlar ve sınıflar ekleyebilirsiniz.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">Sınıflar/Bilgisayarlar</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP Adresleri</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished">Kullanıcı Adları</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished">Kullanıcı adlarını göster</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished">Bilgisayarları ve/veya sınıfları silmek veya eklemek için bu menüyü kullanın (Farenin sağ tuşu)</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Dosyaların dışa aktarımı</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished">Bu düğme bilgisayarların ve kullanıcı adlarının dosya olarak dışa aktarımı için kullanılır. Bu dosyayı yazılıların sonunda dosyaları toplamak için kullanabilirsiniz. Bu işlem zaman zaman gerekli olabilir çünkü bazı kullanıcılar sınavı daha erken bitirip sistemin dışına çıkabilir ve bu nedenden ötürü sınav sonunda dosyaları toplayamayabilirsiniz. </translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">Öğretmen Bilgisayarını Gizle</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">Göster/Gizle</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">Ayarları düzenle</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">Sil</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">Bu sınıftaki tüm bilgisayarları göster</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">Bu sınıftaki tüm bilgisayarları gizle</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">İsmi Düzenle</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">Sınıfı Sil</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">Bilgisayar Ekle</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">Sınıf ekle</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">Konfigürasyon dosyası bulunamadı</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">%1 Konfigürasyon dosyası açılamadı. Sol taraftaki kenar çubuğundaki sınıf-yönetimini kullanarak en az bir tane sınıf ve bilgisayar eklemek zorundasınız.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">Konfigürasyon dosyasında HATA var</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">Düzenleyin ya da bu dosyayı silerek bütün sınıfları ve bilgisayarları tekrar ekleyin.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">%1 dosyasını incelemede hata var. Lütfen düzenleyin ya da bu dosyayı siliniz.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Çıkış dosyası seçiniz</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Metin Dosyaları (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished">Seçilmiş öğeler için eylemler</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Eylemler</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">%1 için Eylemler</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">Sınıf için yeni isim</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">Lütfen sınıf için yeni bir isim giriniz "%1"</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">Sınıf silinecek Emin misiniz "%1"?
-Bu işlem sonucunda bütün bilgisayarlar silinecek</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">Eksik Sınıf</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">Bilgisayarları eklemeden önce enaz bir tane sınıf eklemek zorundasınız.
-Şu anda yeni bir sınıf oluşturmak ister misiniz?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">Yeni Sınıf</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">Oluşturmak istediğiniz sınıf için lütfen bir isim giriniz</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">Bilinmeyen durum</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">Hiçbir kullanıcı giriş yapmadı</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished"> Sunucuya Erişilemedi</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">Demo modu</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">Masaüstü Kilitlendi</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Görünen tüm bilgisayarların oturumları sonlandırılacak. Emin misiniz?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished">Seçtiğiniz bilgisayarların oturumları sonlandırılacak. Emin misiniz?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Kullanıcı çıkışı</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Görünen tüm bilgisayarların sistemi yeniden başlatılacak. Emin misiniz?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished">Seçilen tüm bilgisayarların sistemi yeniden başlatılacak. Emin misiniz?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Bilgisayarları yeniden başlat</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Görünen tüm bilgisayarlar kapatılacak. Emin misiniz?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished">Seçilen tüm bilgisayarlar kapatılacak. Emin misiniz? </translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">Geçersiz MAC adresi</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">Geçersiz bir MAC adresi girdiniz. Lütfen geçerli bir adres giriniz. (ayraç olarak ":" giriniz.</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished"> Kullanıcı ayarları</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/sunucu adı</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">İsim</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">iTALC de görünen sunucuya verilmiş takma isim</p></body&gt [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Terminallerin fiziksel adresleri sadece sistemi açmak için kullanıl [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Sınıf</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">Tür</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">Öğrenci bilgisayarı</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">Öğretmen bilgisayarı</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">Diğer/tanımlanmamış bilgisayar</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">Yenileme Sıklığı</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Burada yenileme sıklığı ayarlaması yapılır. Yüksek değerlerin düşük [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> saniye</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">Kullanıcı arayüzü</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Araç çubuğu ve düğmeler için ipucu balonlarını gösterme</p>&l [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Araç çubuğu ve düğmeler üzerinde gezerken ipucu balonlarının görünm [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">İpucu baloncuğu yok</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Araç çubuğu ve düğmelerin metinlerini gösterme</p></body&g [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished">Araç çubuğu ve Butonlarda metin yok</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">Rolünüz (uygun anahtarlar gerekir)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Bu bölümde rolünüzü seçebilirsiniz. Eğer ne yaptığınızdan emin iseniz değiştiriniz. Aksi taktirde eski duruma geri dönene kadar öğrenci bilgisayarlarına erişemeyebilirsiniz.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Öğretmen</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Yönetici</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">Destekleyici</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Diğer</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">Çoklu giriş için ayarlar</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">Öğrenci penceresi eylemleri için çift tıklayın</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Çift tıklama sonucunda öğrenci bilgisayarında oluşacak eylem için ayarlama yapabilirsiniz.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Uzaktan Kontrol</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">Tam ekran modunda canlı bağlantı</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Un [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">iTALC ayarları</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">Bu çalışma alanında iTALC programını kendiniz için uygun bir hale getirebilirsiniz</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">TAMAM</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC Demo</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">Uygulama Hatası</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">(IP: %1) de birisi bu bilgisayara erişmeye çalıştı fakat gerekli izni düzgün bir şekilde alamadı</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">Öğretmen</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">Yönetici</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">Diğer</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished">Ekranı kilitle</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Eylemler</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">Genel</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Çıkış</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Ekran görüntüsünü Yakala</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">%1 Dizinini yaratmak için yazma/okuma hakkınız yok. iTALC programını çalıştırmak için yazma/okuma izinlerini almanız gerek.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Sınıf</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Sınıf değiştirme</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Aktif hale getirmek istediğiniz sınıfı seçerek bu düğmeye tıklayınız</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Sınıflar arası geçiş yapmak için bu düğmeye tıklayınız</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Genel Bakış modu</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Genel Bakış</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">Bu mod iTALC programının varsayılan görünüm modudur. Bu mod ile bütün görünebilir bilgisayarları genel olarak izleyebilrsiniz. Ayrıca bu düğme ile kilitli tüm bilgisayarların kilidini açmak ve gösterim modundan çıkarmak için kullanılabilir</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Tam Ekran Modunda Gösterim</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Tamekran Gösterim</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Gösterimi Durdur</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">Bu mod ile sizin ekranınız görünür durumdaki tüm bilgisayar ekranlarında görünecek. Bu durumda öğrencilerin giriş birimleri kilitlenmiş olacaktır.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Pencere modunda gösterim</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Pencere Gösterimi</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">Bu modda sizin pencereniz görünen tüm bilgisayarların ekranında pencere olarak görünür. Kullanıcılar diğer pencerelere geçip çalışmalarına devam edebilirler.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Masaüstlerini Kilitle/Aç </translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Hepsini kilitle</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Hepsinin kilidini aç</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">Tüm kullanıcıların masaüstlerini kilitlemek için bu düğmeyi kullanınız. Bu modda bütün giriş birimleri kilitlenir ve masaüstünün kilitlendiğini belirten bir ekran gösterilir.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Metin Mesajı gönder </translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Metin mesajı</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Bu düğmeyi tüm öğrencilere metin mesajı göndermek için kullanınız.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Bilgisayarları aç</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Sistemi aç</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">Bu düğmeyi görünür bilgisayarı açmak için kullanınız. Bu yöntemle bilgisayarları elle açmaktan kurtulmuş olacaksınız.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Bilgisayarları kapat</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Sistemi kapat</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Örneğin ders sonunda bilgisayarları kapatmak için bu düğmeyi kullanabilirsiniz</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Destek</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Doğrudan Destek</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished">ihtiyaç duyarsanız birine destek vermek için Uygun IP ve sunucu adını girdikten sonra bu düğmeyi kullanabilirsiniz</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Düzenleme/ayarlama</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Pencere boyutunu düzenle</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Bu düğmeye tıkladığınızda büyük bir ihtimalle öğrenci bilgisayar pencerelerinin boyutları ayarlanacaktır. Böylelikle bütün pencereler kendiliğinden boyutlandırılacaktır.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Otomatik görüntü</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Otomatikmen pencerelerin boyutlandırılması</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Bu düğmeye tıkladığımızda bütün görünür pencereler yeniden boyutlandırılır.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Master Kontrol</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Uzaktan Kontrol</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">Öğretmenden Mesaj Var</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">iTALC programına hoşegeldiniz, Sefalar getirdiniz!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">Burada çalışma alanlarını kullanmak çin hazırlanmış düğmeler bulunmakta. Her düğme kendisi ile ilgili çalışma alanına bağlatı kurmakta. Alanlara gözatmak için ilgili düğmeyi kullanın.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished">Sınıfları ve bilgisayarları yönetmek için Sınıf Yönetimini kullanabilirsiniz. Ayrıca hangi kullanıcıların sistemde olduğunu da görmeniz mümkün.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">Ekran Görüntüsü yakalama özelliği oldukça yararlıdır. Yakaladığınız ekran görüntülerini buradan yönetebilirsiniz.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">iTALC programının ayarlamalarını yapabilirsiniz. Bu ayarlamalar Ayarlama Penceresi ile yapılabilir.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">Genel Bakış</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">iTALC programını nasıl kullanacağınıza dair basit bilgiler</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Kullanıcı adı</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Şifre</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Terminal %1 on %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>servis çalıştırılamadı</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Servis Kontrol Yöneticisi ile bağlantı kurulamadı (Geçerli haklara sahip misiniz?!) - Servis kayıtlı değil.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Servis '%1' zaten kayıtlı.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Servis '%1' kaydedilemedi.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Servis '%1' sorunsuz bir şekilde kaydedildi.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Servis '%1' durdurulamadı.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Servis '%1' kaydı silindi.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Servis '%1' kaydedilemediğinden dolayı kaydı da silinemedi.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Servisin '%1' kaydı silinemedi.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Servis '%1' bulunamadı.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Servis Kontrol Yöneticisi ile bağlantı kurulamadı (Geçerli haklara sahip misiniz?!) - Servis kayıtlı değil.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Servis Kontrol Yöneticisi ile bağlantı kurulamadı (Geçerli haklara sahip misiniz?!) - Servis durdurulamadı.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">Bilinmeyen kullanıcı</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">Sadece izle</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Uzaktan Kontrol</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">Öğrenci Ekranını kilitle</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">Öğrenci ekran kilidini aç</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">Tam ekran</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">Pencere</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Çıkış</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished"> %1 Bağlanıyor</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">Bağlantı kuruldu</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Uzaktan oturum aç</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">Kullanıcı adı</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Şifre</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">%1 dizin varolmadığından ekran görüntüsü oluşturulamadı</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">Ekran görüntüsünü Yakala</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">Bu alanı kullanarak ekran görüntüsünü yakalama özelliğini kullanabilirsiniz.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Bütün ekran görüntüleri burada listelenmektedir. Ekran görüntülerini düğmeleri kullanarak yönetebilirsiniz.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">Kullanıcı:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">Alan Adı:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">Tarih:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">Zaman</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Destek</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Metin Mesajı gönder </translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">Seçilen kullanıcılara mesaj göndermek için metin kutusuna mesajınızı yazın.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">Bağlantı kuruluyor %1...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Genel Bakış</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Tam Ekran Modunda Gösterim</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Pencere modunda gösterim</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Görüntü kilitlendi</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Canlı Bağlantı</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Uzaktan Kontrol</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Öğrenci Gösterimine izin ver</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Metin Mesajı gönder </translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Kullanıcı çıkışı</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Ekran görüntüsü al</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Sistemi aç</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Yeniden başlat</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Sistemi kapat</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Komut çalıştır</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/uk.qm b/lib/resources/uk.qm
deleted file mode 100644
index 717cb4b..0000000
Binary files a/lib/resources/uk.qm and /dev/null differ
diff --git a/lib/resources/uk.ts b/lib/resources/uk.ts
deleted file mode 100644
index bb6713a..0000000
--- a/lib/resources/uk.ts
+++ /dev/null
@@ -1,1777 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="uk_UA">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>Про програму iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>Про програму</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>Автори</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Переклад</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation>Програму ще не перекладено поточною мовою (або ви користуєтеся англійською версією).
-
-Якщо ви хочете перекласти iTALC вашою рідною або іншою мовою чи хочете покращити поточний переклад, зв’яжіться з розробником iTALC!</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Ліцензування</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation>Ніколи протягом цього сеансу</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Завжди протягом цього сеансу</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation>Підтвердження доступу</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation>Користувач %1 з вузла %2 бажає отримати доступ до вашої системи. Надасте йому доступ?</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Керування класами</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Використовуйте цей робочий простір для того, щоб керувати вашими комп’ютерами та класами з легкістю.</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>Тут можна керувати комп’ютерами і класами. Ви можете додавати комп’ютери або класи за допомогою клацання правою кнопкою миші у списку.</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Класи/Комп’ютери</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>IP-адреса</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Імена користувачів</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>Показати імена користувачів</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Щоб додати або вилучити комп’ютери і/або класи, скористайтеся контекстним меню (клацання правою кнопкою).</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>Експорт до текстового файла</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>Скористайтеся цієї кнопкою, щоб експортувати список комп’ютерів і імен користувачів до текстового файла. Пізніше ви можете використати цей файл для збирання файлів після завершення контрольної. Іноді це просто необхідно, оскільки деякі користувачі можуть завершити роботу і вийти з системи раніше за інших, і ви не зможете зібрати їх роботи після завершення контрольної.</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Ховати комп’ютери вчителів</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Показати/Сховати</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Змінити параметри</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Вилучити</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Показати всі комп’ютери у класі</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Сховати всі комп’ютери у класі</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Змінити назву</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Вилучити клас</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Додати комп’ютер</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Додати клас</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>Не знайдено файла налаштувань</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>Не вдалося відкрити файл налаштувань %1.
-Вам слід додати хоча б один клас та його комп’ютери за допомогою керування класами на бічній панелі програми ліворуч.</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Помилка у файлі налаштувань</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>Помилка під час обробки файла налаштувань %1.
-Будь ласка, змініть його. Якщо ви не можете цього зробити, вам слід вилучити цей файл і виконати додавання всіх класів та комп’ютерів знову.</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Помилка під час розбору файла налаштувань %1.
-Будь ласка, змініть його. Якщо ви не можете цього зробити, вам слід вилучити цей файл.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Вибір файла виводу</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Текстові файли (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>Дії для позначеного</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>Дії</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>Дії для %1</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Нова назва класу</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Будь ласка, введіть нову назву для класу "%1".</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Ви справді бажаєте вилучити клас "%1"?
-Якщо ви це зробите, буде також вилучено всі комп’ютери класу!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>Немає класу</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>Перш ніж додавати комп’ютери, ви маєте створити хоча б один клас.
-Чи бажаєте ви створити новий клас зараз?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Новий клас</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Будь ласка, введіть назву класу, який ви бажаєте створити.</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>Стан невідомий</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Жоден користувач не почав роботу</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>Комп’ютер недоступний</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>Виконання демо</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>Стільницю заблоковано</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Ви справді бажаєте завершити роботу всіх користувачів на всіх видимих комп’ютерах?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Ви справді бажаєте завершити роботу всіх користувачів на всіх позначених комп’ютерах?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Завершити роботу</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Ви справді бажаєте перезавантажити всі видимі комп’ютери?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Ви справді бажаєте перезавантажити всі позначені комп’ютери?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>Перезавантажити комп’ютери</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Ви справді бажаєте вимкнути всі видимі комп’ютери?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Ви справді бажаєте вимкнути всі позначені комп’ютери?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>Некоректна MAC-адреса</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>Вами вказано некоректну MAC-адресу. Ви можете або залишити це поле порожнім, або ввести коректну MAC-адресу (використовуйте ":" для відокремлення її частин!).</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation>Параметри клієнта</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>IP/Назва вузла</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Введіть IP-адресу або ім’я комп’ютера, за яким iTALC зможе отримати доступ до клієнта [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>Назва</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Додатковий псевдонім вузла, який показуватиме iTALC.</p></body></html& [...]
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation>MAC-адреса</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Апаратна/MAC-адреса клієнта - використовується лише для вмикання клієнта</p>&lt [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Клас</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>Тип</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>Комп’ютер учня</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>Комп’ютер вчителя</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>Інший/Невизначений комп’ютер</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation>Не вказано IP-адреси або назви вузла</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation>Вами не вказано IP-адреси або назви вузла комп’ютера!</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>Період між оновленнями</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Тут Ви можете встановити період між оновленнями зображень з клієнтів. Вищі значення з [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation> секунд</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>Інтерфейс користувача</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Не показувати контекстні підказки для кнопок панелі інструментів</p></body&g [...]
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Позначте цей пункт, якщо вас дратують контекстні підказки, що з’являються, коли ви пе [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>Без контекстних підказок</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Не показувати текст на кнопках панелі інструментів</p></body></html&gt [...]
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Без тексту на кнопках інструментів</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Ваша роль (потрібні відповідні ключі!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Тут ви можете вибрати вашу роль. Змінюйте цей параметр, лише якщо ви розумієте, що робите. У разі неправильного вибору ви не зможете отримати доступ до будь-яких клієнтів до того часу, коли ви повернетеся до вашої попередньої ролі.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Вчитель</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Адміністратор</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>Супровідник</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Інша</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>Параметри для одночасного входження</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Домен</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>Дія за подвійним клацанням на вікні клієнта</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Тут ви можете визначити дію, яку буде виконано, якщо ви двічі клацнете на віконечку клієнта.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Віддалене керування</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>Перегляд наживо на весь екран</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Будь ласка, зауважте [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Ваші налаштування iTALC</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>У цьому робочому просторі ви можете налаштувати iTALC для ваших потреб.</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>Гаразд</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>Демо iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>Помилка розпізнавання</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Хтось (IP: %1) намагався отримати доступ до цього комп’ютера, але не зміг пройти розпізнавання!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>Перевищення граничної кількості спроб під час розпізнавання у VNC.</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>Помилка під час спроби розпізнавання у VNC.</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>З’єднання розірвано сервером VNC.</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation>Помічник обробки ключів доступу iTALC</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation>Створення/Імпортування ключів доступу iTALC</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation>Ця допоміжна програма полегшує створення та імпортування ключів доступу iTALC.</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation>Як це працює?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation>Ключі доступу iTALC складаються з двох пов’язаних між собою частин: закритого і відкритого ключа.
-
-За допомогою закритого ключа користувачі головного комп’ютера зможуть отримувати доступ до клієнтських комп’ютерів. Важливо забезпечити доступність файла закритого ключа лише для уповноважених користувачів.
-
-Відкритий ключ використовується на клієнтських комп’ютерах для перевірки того, чи є уповноваженим на виконання певних дій будь-яке вхідне з’єднання.</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation>Режим помічника</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation>Будь ласка, вкажіть дію: створити ключі доступу чи імпортувати відкритий ключ на клієнтський комп’ютер.</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation>Створити ключі доступу (головний комп’ютер)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation>assistantModeButtonGroup</translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation>Імпортувати відкритий ключ (клієнтський комп’ютер)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation>Виберіть роль користувача</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation>Будь ласка, вкажіть роль користувача, для якого слід створити або імпортувати ключі доступу:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Вчитель</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Адміністратор</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation>Учасник команди супроводу</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Інший</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation>За допомогою визначення ролей користувачів можна використовувати декілька ключів доступу одночасно. Наприклад, можна створити різні ключі доступу вчителів для різних класів, а ключі доступу супроводу будуть однаковими для всієї школи.</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation>Каталоги</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation>Експортувати відкритий ключ (головний комп’ютер)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation>Нетиповий каталог призначення для ключів доступу</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation>Будь ласка, вкажіть розташування відкритого ключа доступу для імпортування.</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation>Резюме</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation>Буде виконано такі дії:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation>• Створено нові ключі доступу</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation>• Імпортовано відкритий ключ доступу з</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation><невідомо></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>• Записано ключі доступу до</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>• Експортовано відкритий ключ до</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation>• Налаштовано роль користувача</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation>Виберіть каталог для експортування відкритого ключа</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation>Файли ключів (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation>Некоректний відкритий ключ</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation>Вказаний файл не містить коректного відкритого ключа доступу iTALC!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation>Виберіть каталог призначення</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation>Створення ключа доступу</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation>Не вдалося вилучити вже створений файл %1.</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation>Не вдалося експортувати відкритий ключ доступу з %1 до %2.</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation>Було успішно створено і записано ключі доступу до %1 і %2.</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation>Під час спроби створення ключів доступу сталася помилка. Ймовірно, у вас не має права запису до вказаних каталогів.</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation>Імпортування відкритого ключа</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation>Під час спроби імпортування відкритого ключа доступу сталася помилка. Ймовірно, у вас немає права читання початкового файла ключа або запису файла призначення.</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation>Відкритий ключ було успішно імпортовано до %1.</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>блокування екрана</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation>Редактор групового входу</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation>Будь ласка, додайте групи, учасникам яких буде дозволено доступ до комп’ютерів у вашій мережі iTALC.</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation>Всі групи</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation>Групи з правами доступу до iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>Дії</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation>Загальні</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Вийти</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation>Консоль керування iTALC</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>Сервер iTALC</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>Шляхи</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>Розпізнавання</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>Служба iTALC</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>Сховати піктограму у лотку</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>Автозапуск</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>Додаткові параметри</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>Запустити службу</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>Зупинити службу</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>Стан:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>Зупинено</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation>Ведення журналу</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>Каталог файла журналу</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>Рівень журналювання</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>Нічого не записувати</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>Лише критичні повідомлення</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>Помилки і критичні повідомлення</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>Попередження і помилки</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>Сповіщення, попередження і помилки</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>Діагностичні повідомлення та все інше</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>Обмежити розмір файла журналу</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>МБ</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>Спорожнити всі файли журналу</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>Захоплення стільниці</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>Увімкнути захоплення шарів (напівпрозорих) вікон</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>Низька точність (турбо-режим)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>Демосервер</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>Мережа</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>Основний порт сервера</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>Порт демосервера</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>Увімкнути виключення брандмауера</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>Файли налаштувань</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>Загальне налаштування</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>Особисте налаштування</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>Каталоги даних</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Знімки екрана</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>Способи розпізнавання</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>Керування ключами доступу</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>Параметри входу</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation>&Файл</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>&Довідка</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>Ви&йти</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation>Ctrl+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>&Зберегти параметри до файла</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>Зберегти параметри до файла</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation>Ctrl+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>З&авантажити параметри з файла</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation>Ctrl+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Про програму iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>Про Qt</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation>Головне вікно</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation>Панель інструментів</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>Консоль керування iTALC %1</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>Запущено</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>Завантажити параметри з файла</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation>Файли XML (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>Зберегти параметри до файла</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>Незбережені параметри</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>Деякі з параметрів не збережено. Завершити роботу попри це?</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>Не вдалося записати налаштування</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>Локальним модулем налаштувань було повідомлено про неможливість запису налаштувань! Будь ласка, запустіть консоль керування iTALC з розширеними правами доступу.</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>Всі значення параметрів успішно застосовано.</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>Під час спроби застосування параметрів сталася помилка!</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>Немає доступу на запис</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>Не вдалося виконати читання/запис або створити теку %1! Щоб запустити iTALC, переконайтеся, що ви можете створити теку або виконати запис до цієї теки.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Клас</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>Перемкнути клас</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>Натисніть на цю кнопку, щоб відкрити меню, у якому ви зможете вибрати активний клас.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>Натисніть цю кнопку, щоб перемикатися між класами.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>Режим огляду</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>Огляд</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>Це типовий режим iTALC, від надає вам змогу вести спостереження за всіма видимими комп’ютерами. Також цю кнопку можна використовувати для розблокування заблокованих робочих станцій або для виходу з режиму демо.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Повноекранне демо</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>Повноекранне демо</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>Завершити демонстрацію</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>У цьому режимі зображення з вашого екрана буде показано на всіх видимих комп’ютерах. Крім того, користувачі не зможуть виконувати інших дій, оскільки у цьому режимі всі пристрої введення буде заблоковано.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Демо у вікні</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>Демо у вікні</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>У цьому режимі зображення з вашого екрана буде показано у вікні на всіх видимих комп’ютерах. Користувачі матимуть змогу перемикатися на інші вікна і, таким чином, продовжувати роботу.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>Заблокувати/Розблокувати стільниці</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>Заблокувати всі</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>Розблокувати всі</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>Щоб заволодіти увагою учнів, ви можете заблокувати їхні стільниці за допомогою цієї кнопки. У цьому режимі всі пристрої вводу буде заблоковано, а екран стане чорним.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Надіслати текстове повідомлення</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>Текстове повідомлення</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>Використовуйте цю кнопку, щоб надіслати текстове повідомлення для всіх користувачів, наприклад, щоб повідомити їм про нове завдання та інше.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>Увімкнути комп’ютери</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Увімкнути</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>Натисніть цю кнопку, щоб увімкнути всі видимі комп’ютери. Таким чином, вам не потрібно буде вмикати кожен комп’ютер вручну.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>Вимкнути комп’ютери</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Вимкнути</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>Щоб вимкнути комп’ютери (наприклад, по завершенню уроку), ви можете натиснути цю кнопку.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>Супровід</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>Прямий супровід</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>Якщо вам потрібно супроводжувати чиїсь дії на одному з комп’ютерів, ви можете натиснути цю кнопку і ввести назву вузла або IP-адресу відповідного комп’ютера.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>Підібрати/Вирівняти</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>Підібрати розмір вікон та їх розташування</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>Якщо ви натиснете цю кнопку, буде вибрано найбільший можливий розмір вікна клієнта. Крім того, всі вікна буде вирівняно.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>Автовигляд</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>Автоматично перевпорядкувати вікна та підібрати їх розмір</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>Якщо ви натиснете цю кнопку, всі видимі вікна буде перевпорядковано з підбиранням розміру.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>Головне керування iTALC</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Віддалене керування</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>Не вдалося змінити параметр автоматичного запуску служби iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>Не вдалося змінити параметри служби iTALC.</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>Не вдалося змінити налаштування брандмауера для служби iTALC.</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation>Діагностика</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation>Увімкнути перемикання стільниць для блокування екрана (експериментальне)</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation>Виводити повідомлення до стандартного виводу помилок</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation>Вести журнал у журналі подій Windows</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation>Сервер</translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation>VNC reflector</translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation>Демосервер iTALC 1</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation>Обробка у декілька потоків (можна скористатися, якщо використано сервер VNC reflector)</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation>Увімкнути HTTP-сервер, який надає доступ до аплету JavaViewer</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation>Порт HTTP-сервера</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation>Дозволити з’єднання лише з локального вузла</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation>Розпізнавання за файлами ключів</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation>Розпізнавання під час входу на основі ACL</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation>Основний каталог файлів відкритих ключів</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation>Основний каталог файлів закритих ключів</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation>Запустити помічника файлів ключів</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation>Керування правами доступу</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation>Перевірити</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation>Підтвердження доступу</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation>Ви можете налаштувати iTALC так, щоб програма запитувала користувача про права доступу до стільниці у разі використання певних способів розпізнавання.</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation>Розпізнавання під час входу</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation>Дозволити користувачеві доступ до стільниці без підтвердження</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation>Діагностика iTALC</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation>Якщо у вас виникли проблеми або якісь інші негаразди з iTALC, важливо повідомити про них розробникам, щоб ці проблеми було вирішено у наступних випусках. За допомогою цієї сторінки ви зможете без проблем створити якісний звіт щодо вади.
-
-Якщо ваду не вдається відтворити, пропустіть кроки 1) — 3).</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation>1)</translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation>Спорожніть файли журналів у розділі «Загальні».</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation>2)</translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation>У розділі «Загальні» встановіть рівень ведення журналу у значення «Діагностичні повідомлення та все інше».</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation>3)</translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation>Повторіть послідовність дій, яка призвела до проблеми або некоректної поведінки.</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation>4)</translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation>Натисніть наведену нижче кнопку і збережіть файл до якоїсь з ваших тек.</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation>Створити архів звіту щодо вади</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation>5)</translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation>Перейдіть на сторінку <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">стеження за вадами у iTALC</a>, створіть повідомлення щодо вади, опишіть ваші дії на кроці 3) і долучіть файл, збережений на кроці 4).</p>
-<br/>
-<br/>
-Зауваження: якщо ваду виявлено на головному і клієнтському комп’ютерах одночасно, долучіть архіви звітів щодо вади для обох комп’ютерів.</translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation>Перезапуск служби iTALC</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation>Всі параметри було збережено. З метою набуття чинності нових параметрів слід перезапустити службу iTALC. Перезапусти службу зараз?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation>Запуск служби iTALC</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation>Зупиняється служба iTALC</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation>З метою вилучення файлів журналу роботу служби iTALC слід тимчасово зупинити. Зробити це?</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation>Файли журналу вилучено</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation>Всі файли журналу було успішно вилучено.</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation>Не вдалося вилучити всі файли журналу.</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation>Перевірка розпізнавання під час входу</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation>Розпізнавання за вказаними реєстраційними даними пройдено.</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation>Не вдалося пройти розпізнавання за вказаними реєстраційними даними!</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation>Зберегти архів звіту щодо вади</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation>Архів звіту щодо вади iTALC (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation>Архів звіту щодо вади iTALC збережено</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation>Архів звіту щодо вади iTALC було збережено до %1. До архіву включено файли журналу iTALC та дані щодо вашої операційної системи. Ви можете долучити архів до вашого звіту щодо вади.</translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation>Не вдалося встановити зв’язок зі службою iTALC</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation>Не вдалося встановити зв’язок з локальною службою iTALC. Ймовірно, вами було вказано помилкові реєстраційні дані або файли ключів встановлено з помилками. Повторіть спробу або повідомте адміністратору вашої системи про те, що слід вирішити проблему з використанням консолі керування iTALC.</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation>Розпізнавання неможливе</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>Не було знайдено файлів ключів розпізнавання або поточні файли є застарілими. Будь ласка, створіть нові файли ключів за допомогою консолі керування iTALC. Крім того, ви можете налаштувати розпізнавання під час входу до системи за допомогою консолі керування iTALC. Якщо ви не налаштуйте розпізнавання, ви не зможете отримати доступ до комп’ютерів за допомогою iTALC.</translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Повідомлення від вчителя</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Ласкаво просимо до iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>Тут ви бачите робочу панель, що містить декілька кнопок. Кожну кнопку з’єднано з робочим простором. Просто понатискайте кнопки, щоб побачити всі доступні робочі простори.</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>За допомогою керування класом ви можете керувати комп’ютерами і класами. Також ви можете переглядати список користувачів, що працюють у системі.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>Робочий простір знімків екрана є дуже корисним інструментом. Він надає змогу керувати зробленими вами знімками екрана.</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Звичайно, ви можете налаштувати iTALC. Це можна зробити за допомогою робочого простору налаштування.</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Про програму iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>Огляд</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Деякі основна відомості про iTALC і його використання.</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>Будь ласка, вкажіть ваше ім’я користувача та пароль, щоб отримати доступ до клієнтів iTALC.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Ім’я користувача</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation>Вхід до iTALC</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Клієнт iTALC %1 на %2:%3</translation>
-    </message>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Не вдалося зареєструвати службу '%1'.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Неможливо зв’язатися з Керуванням службою (можливо, у Вас недостатньо прав?!) - службу '%1' не зареєстровано.</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Службу '%1' вже було зареєстровано.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Службу '%1' неможливо зареєструвати.</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Службу '%1' було успішно зареєстровано.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Службу '%1' неможливо зупинити.</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Реєстрацію служби '%1' було скасовано.</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Службу '%1' не було зареєстровано і тому її реєстрацію неможливо скасувати.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Реєстрацію служби '%1' неможливо скасувати.</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Службу '%1' неможливо знайти.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>Неможливо зв’язатися з Керуванням службою (можливо, у Вас недостатньо прав?!) - реєстрацію служби '%1' не було скасовано.</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>Неможливо зв’язатися з Керуванням службою (можливо, у Вас недостатньо прав?!) - службу '%1' не було зупинено.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>Перегляд наживо (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>Віддалене керування (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>невідомий користувач</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>Лише перегляд</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Віддалене керування</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>Блокувати учня</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Розблокувати учня</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Знімок екрана</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>На весь екран</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>У вікні</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Вийти</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>З’єднання з %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>З’єднано.</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation>Віддалений вхід</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation>Скористайтеся наведеними нижче полями для визначення імені користувача, пароля та назви домену (необов’язково). Ці дані буде використано для входу до систем комп’ютерів.</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Ім’я користувача</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Домен</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation>Виконання команд</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation>Будь ласка, вкажіть команди, які слід виконати на вказаних клієнтах. Для кожної з команд слід використовувати окремий рядок.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>невідомо</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Не вдалося зробити знімок екрана, оскільки теки %1 не існує або її неможливо створити.</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Знімок екрана</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>Знімки екрана</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Ви можете легко керувати зробленими вами знімками екрана за допомогою цього робочого простору.</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Тут показано список всіх зроблених вами знімків екрана. Ви можете робити знімки екрана, вибираючи відповідний пункт з контекстного меню вікна клієнта. Керувати цими знімками екрана можна за допомогою кнопок, розташованих нижче.</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>Користувач:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Комп’ютер:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>Дата:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>Час:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>Показати</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>Вилучити</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation>Супровід</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation>Будь ласка, вкажіть IP-адресу або назву вузла комп’ютера, з яким слід встановити з’єднання.</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>Надіслати текстове повідомлення</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Використовуйте це поле, щоб набрати текст повідомлення, яке буде надіслано всім позначеним користувачам.</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Встановлення зв’язку з %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Огляд</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Повноекранне демо</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Демо у вікні</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Заблокований дисплей</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Перегляд наживо</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Віддалене керування</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Дозволити учню показати демо</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Надіслати текстове повідомлення</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Завершити роботу</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Зробити знімок екрана</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Увімкнути</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Перезавантажити</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Вимкнути</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Виконати команди</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/watch1.png b/lib/resources/watch1.png
deleted file mode 100644
index a3e5fc1..0000000
Binary files a/lib/resources/watch1.png and /dev/null differ
diff --git a/lib/resources/watch10.png b/lib/resources/watch10.png
deleted file mode 100644
index 28763ea..0000000
Binary files a/lib/resources/watch10.png and /dev/null differ
diff --git a/lib/resources/watch11.png b/lib/resources/watch11.png
deleted file mode 100644
index aeda642..0000000
Binary files a/lib/resources/watch11.png and /dev/null differ
diff --git a/lib/resources/watch12.png b/lib/resources/watch12.png
deleted file mode 100644
index d3b37cc..0000000
Binary files a/lib/resources/watch12.png and /dev/null differ
diff --git a/lib/resources/watch13.png b/lib/resources/watch13.png
deleted file mode 100644
index 4010c1b..0000000
Binary files a/lib/resources/watch13.png and /dev/null differ
diff --git a/lib/resources/watch14.png b/lib/resources/watch14.png
deleted file mode 100644
index 1b17692..0000000
Binary files a/lib/resources/watch14.png and /dev/null differ
diff --git a/lib/resources/watch15.png b/lib/resources/watch15.png
deleted file mode 100644
index af32f98..0000000
Binary files a/lib/resources/watch15.png and /dev/null differ
diff --git a/lib/resources/watch16.png b/lib/resources/watch16.png
deleted file mode 100644
index e8ef8c3..0000000
Binary files a/lib/resources/watch16.png and /dev/null differ
diff --git a/lib/resources/watch2.png b/lib/resources/watch2.png
deleted file mode 100644
index 51b5fb6..0000000
Binary files a/lib/resources/watch2.png and /dev/null differ
diff --git a/lib/resources/watch3.png b/lib/resources/watch3.png
deleted file mode 100644
index 989e782..0000000
Binary files a/lib/resources/watch3.png and /dev/null differ
diff --git a/lib/resources/watch4.png b/lib/resources/watch4.png
deleted file mode 100644
index 630b1a9..0000000
Binary files a/lib/resources/watch4.png and /dev/null differ
diff --git a/lib/resources/watch5.png b/lib/resources/watch5.png
deleted file mode 100644
index 9ef66cc..0000000
Binary files a/lib/resources/watch5.png and /dev/null differ
diff --git a/lib/resources/watch6.png b/lib/resources/watch6.png
deleted file mode 100644
index f164930..0000000
Binary files a/lib/resources/watch6.png and /dev/null differ
diff --git a/lib/resources/watch7.png b/lib/resources/watch7.png
deleted file mode 100644
index add3df3..0000000
Binary files a/lib/resources/watch7.png and /dev/null differ
diff --git a/lib/resources/watch8.png b/lib/resources/watch8.png
deleted file mode 100644
index 1ed91a2..0000000
Binary files a/lib/resources/watch8.png and /dev/null differ
diff --git a/lib/resources/watch9.png b/lib/resources/watch9.png
deleted file mode 100644
index b255da8..0000000
Binary files a/lib/resources/watch9.png and /dev/null differ
diff --git a/lib/resources/zh_cn.qm b/lib/resources/zh_cn.qm
deleted file mode 100644
index d702f79..0000000
Binary files a/lib/resources/zh_cn.qm and /dev/null differ
diff --git a/lib/resources/zh_cn.ts b/lib/resources/zh_cn.ts
deleted file mode 100644
index 63496d1..0000000
--- a/lib/resources/zh_cn.ts
+++ /dev/null
@@ -1,1766 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="zh_CN">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">关于 iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation type="unfinished">关于</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation type="unfinished">作者</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation type="unfinished">翻译</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation type="unfinished">许可</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Never for this session</source>
-        <translation type="unfinished">从不使用这个会话</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation type="unfinished">一直使用这个会话</translation>
-    </message>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished">班级管理</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished">使用这个工作空间简便地管理计算机和班级。</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation type="unfinished">这是管理计算机和班级的地方。你可以通过点击鼠标右键在列表中添加计算机或班级。</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished">班级/计算机</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation type="unfinished">IP地址</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">导出到文本文件</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished">隐藏教师计算机</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation type="unfinished">显示/隐藏</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation type="unfinished">编辑设置</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation type="unfinished">删除</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished">显示班级中的全部计算机</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished">隐藏班级中的全部计算机</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation type="unfinished">编辑名称</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished">删除班级</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation type="unfinished">添加计算机</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation type="unfinished">添加班级</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished">配置文件没找到</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation type="unfinished">不能打开配置文件 %1 。
-你必须在班级管理中至少添加一个班级和计算机。班级管理在程序的左侧栏中。</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished">错误在配置文件中</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation type="unfinished">分析配置文件 %1 时出错。
-请编辑它。否则,你将不得不删除该文件并重新添加所有的班级和计算机。</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished">分析配置文件 %1 时出错。
-请编辑它。否则,你将不得不删除该文件。</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">选择输出文件</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">文本文件(*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">动作</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished">%1 动作</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished">班级新名称</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished">请为班级 "%1" 输入一个新名称。</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation type="unfinished">你确定要删除班级 "%1" 吗?
-该班级中的所有计算机也将被删除!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished">缺少班级</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation type="unfinished">在添加计算机之前你必须至少创建一个班级。
-你现在要创建新班级吗?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation type="unfinished">新班级</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished">请输入要创建班级的名称。</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation type="unfinished">未知状态</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation type="unfinished">无用户登录</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished">主机不可到达</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation type="unfinished">演示进行中</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished">桌面锁定</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">你确定要所有用户登出全部可见的计算机吗?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">用户登出</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">你确定要重新启动全部可见的计算机吗?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">重新启动计算机</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">你确定要关闭全部可见的计算机吗?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation type="unfinished">无效的 MAC地址</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation type="unfinished">你指定的 MAC地址无效。该项放空或者输入有效的MAC地址(用 "." 做分隔符!)。</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation type="unfinished">客户端设置</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished">IP/主机名</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">输入一个 iTALC 可到达客户端的IP地址或主机名(用':'指定可选的端口号)</p></bo [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation type="unfinished">名称</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">客户端的硬件/MAC地址 - 只有在需要远程开机的客户端上使用</p></body></html> [...]
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">班级</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation type="unfinished">类型</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation type="unfinished">学生计算机</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation type="unfinished">教师计算机</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished">其他/未定义计算机</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation type="unfinished">更新间隔时间</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">在这你可以设置客户端的更新间隔时间。数值越高网络传输越低,这台计算机的CPU占用越低。</p></body>& [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation type="unfinished"> 秒</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation type="unfinished">用户界面</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">工具栏按钮不显示 冒泡提示</p></body></html></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果你对鼠标移动到工具栏按钮上显示冒泡提示很生气,请选择该项。</p></body></html> [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation type="unfinished">禁用 冒泡提示</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation type="unfinished">你的角色</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">在这你可以选择你的角色。只有在你知道你要做什么时才能改变,否则你将有可能无法访问客户端直到你恢复旧的角色。</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">教师</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">管理员</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation type="unfinished">协助者</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">其他</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation type="unfinished">多用户登录设置</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">域</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation type="unfinished">客户端窗口双击动作</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">在这你可以设置双击客户端窗口时要发生的动作。</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">远程控制</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation type="unfinished">全屏现场直播</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">请注 [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation type="unfinished">你的 iTALC 配置</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation type="unfinished">在这个工作空间中你可以定制 iTALC 适合你的需要。</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">确定</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation type="unfinished">iTALC 演示</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation type="unfinished">验证错误</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation type="unfinished">有人(IP: %1 )试图访问这台计算机但未能通过验证!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation type="unfinished">教师</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation type="unfinished">管理员</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation type="unfinished">其他</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">动作</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>General</source>
-        <translation type="unfinished">常规</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">退出</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">快照</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">关于 iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation type="unfinished">不能读/写或创建目录 %1 !为了运行 iTALC ,请确认你有创建或写该目录的权限。</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">班级</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">切换班级</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">点击按钮在菜单中选择要激活的班级。</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">点击按钮,切换班级。</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">概览模式</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">概览</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation type="unfinished">这是 iTALC 的默认模式,让你对所有可见的计算机有一个概览。点击这个按钮也能为工作站解锁或退出演示模式。</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">全屏演示</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation type="unfinished">在这个模式下你的屏幕将在所有可见的客户端计算机中显示,而且在该模式下客户端的所有输入设备都将被锁定,客户端用户不能做任何事。</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">窗口演示</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation type="unfinished">在这个模式下你的屏幕将在所有可见的客户端计算机的一个窗口中显示。客户端用户可以切换到其他窗口,因此可以继续工作。</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">锁定/解锁桌面</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">全部锁定</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">全部解锁</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation type="unfinished">为了聚拢用户的注意力,你可以用这个按钮锁定他们的桌面。在该模式下客户端所有的输入设备将被锁定同时屏幕黑屏。</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">发送文字消息</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">文字消息</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">使用这个按钮发送文字消息给全部用户。例如,告诉他们新的任务等等。</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">开启计算机</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">开机</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation type="unfinished">点击这个按钮开启全部可见的计算机。这使你不必手工开启每一台计算机。</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">关闭计算机</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">关机</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">你可以点击这个按钮关闭全部可见的计算机(例如,下课时)。</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">协助</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">调整/对齐</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">调整窗口和它们的大小</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">点击这个按钮将以最大可能尺寸调整客户端窗口,同时对齐全部窗口。</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">自动视图</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">自动重新排列窗口和调整大小</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">点击这个按钮重新安排和调整所有可见的窗口。</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">远程控制</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation type="unfinished">来自教师的消息</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">欢迎进入 iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation type="unfinished">请看这个包含多个按钮的工作栏。每个按钮联结一个工作空间。要使用那个工作空间点击对应的按钮即可。</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation type="unfinished">快照工作空间是一个非常有用的工具。它能让你管理你所拍的快照。</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation type="unfinished">当然你可以配置 iTALC 。这是个常用的配置工作空间。</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation type="unfinished">关于 iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">概览</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished">一些基本的 iTALC 信息和使用方法。</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">用户名</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">密码</translation>
-    </message>
-    <message>
-        <source>iTALC Logon</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>不能注册服务 '%1'。</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>无法连接 Service Control Manager(您是否拥有所需的权限?)-服务 '%1' 未被注册。</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>服务 '%1' 已经注册。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>服务 '%1' 未能注册。</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>服务 '%1' 注册成功。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>服务 '%1' 不能停止。</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>服务 '%1' 已取消注册。</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>服务 '%1' 未注册,因此不能被取消注册。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>服务 '%1' 不能被取消注册。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>服务 '%1' 未发现。</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>无法连接 Service Control Manager(您是否拥有所需的权限?)-服务 '%1' 未能被取消注册。</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>无法连接 Service Control Manager(您是否拥有所需的权限?)-服务 '%1' 不能停止。</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation type="unfinished">未知用户</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation type="unfinished">仅可视</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">远程控制</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation type="unfinished">锁定学生</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation type="unfinished">解锁学生</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">快照</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation type="unfinished">全屏</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation type="unfinished">窗口</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">退出</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation type="unfinished">正在连接 %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation type="unfinished">已连接。</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">远程登录</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation type="unfinished">用户名</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">密码</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation type="unfinished">域</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation type="unfinished">不能拍快照,目录 %1 不存在并且不能创建。</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation type="unfinished">快照</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation type="unfinished">快照</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished">使用这个工作空间方便地管理你的快照。</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation type="unfinished"><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">你拍的所有快照都列在这儿。你可以使用客户端窗口的右键菜单拍张快照。可以用下列的按钮来管理这些快照。</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation type="unfinished">用户:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation type="unfinished">主机:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation type="unfinished">日期:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation type="unfinished">时间:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">协助</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">发送文字消息</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation type="unfinished">在下面的文本框中输入你要发送给所选用户的消息。</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished">正在建立连接到 %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation type="unfinished">概览</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">全屏演示</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">窗口演示</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation type="unfinished">锁定显示</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation type="unfinished">现场直播</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished">远程控制</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">展示学生演示</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished">发送文字消息</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation type="unfinished">用户登出</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">拍张快照</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">开机</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation type="unfinished">重启</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">关机</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">执行命令</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/zh_tw.qm b/lib/resources/zh_tw.qm
deleted file mode 100644
index fa68a15..0000000
Binary files a/lib/resources/zh_tw.qm and /dev/null differ
diff --git a/lib/resources/zh_tw.ts b/lib/resources/zh_tw.ts
deleted file mode 100644
index eb74923..0000000
--- a/lib/resources/zh_tw.ts
+++ /dev/null
@@ -1,1777 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="zh_TW">
-<context>
-    <name>AboutDialog</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>關於 iTALC</translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>關於</translation>
-    </message>
-    <message>
-        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
-        <translation><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>作者</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>翻譯</translation>
-    </message>
-    <message>
-        <source>Current language not translated yet (or native English).
-
-If you're interested in translating iTALC into your local or another language or want to improve an existing translation, please contact an iTALC developer!</source>
-        <translation>您目前使用的語言尚未翻譯。
-
-若您想參與翻譯 iTALC,或是想修正目前的翻譯,請與 iTALC 開發者聯絡。</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>授權條款</translation>
-    </message>
-    <message utf8="true">
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright © 2004-2013 Tobias Doerffel / iTALC Solutions</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>AccessDialogSlave</name>
-    <message>
-        <source>Confirm desktop access</source>
-        <translation>確認桌面存取</translation>
-    </message>
-    <message>
-        <source>The user %1 at host %2 wants to access your desktop. Do you want to grant access?</source>
-        <translation>於主機 %2 的使用者 %1 要存取您的桌面。您要給予對方權限嗎?</translation>
-    </message>
-    <message>
-        <source>Never for this session</source>
-        <translation>在這個作業階段中永遠不要</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>在這個作業階段中都要</translation>
-    </message>
-</context>
-<context>
-    <name>ClassroomManager</name>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>教室管理程式</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>使用這個工作區以簡單的方式來管理您的電腦和教室。</translation>
-    </message>
-    <message>
-        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
-        <translation>這是管理電腦與教室的地方。您可以在這個清單中按右鍵加入電腦或教室。</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>教室/電腦</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>IP-位址</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>使用者名稱</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>顯示使用者名稱</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>使用快顯功能表(滑鼠右鍵)來加入/移除電腦和/或教室。</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>匯出為純文字檔案</translation>
-    </message>
-    <message>
-        <source>Use this button for exporting this list of computers and usernames into a text-file. You can use this file later for collecting files after an exam has finished. This is sometimes neccessary, because some users might have finished and logged out earlier and so you cannot collect their files at the end of the exam.</source>
-        <translation>使用這個按鈕將這份電腦與使用者名稱的清單匯出為純文字檔案。稍後您可以在測驗結束後使用這個檔案來收集相關檔案。這在某些時候是必要的,因為有些使用者可能早已完成測驗並且登出,這麼一來您就不能在測驗結束後收集到他們的檔案。</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>隱藏老師電腦</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>顯示/隱藏</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>編輯設定值</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>移除</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>顯示教室中的所有電腦</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>隱藏教室中的所有電腦</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>編輯名稱</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>移除教室</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>加入電腦</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>加入教室</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>找不到組態檔案</translation>
-    </message>
-    <message>
-        <source>Could not open configuration file %1.
-You will have to add at least one classroom and computers using the classroom-manager which you'll find inside the program in the sidebar on the left side.</source>
-        <translation>無法開啟組態檔案 %1。
-您必須先使用位於程式中左側的側邊列的教室管理程式加入至少一個教室與電腦。</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>組態檔案中有錯誤</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file and have to add all classrooms and computers again.</source>
-        <translation>解析組態檔案 %1 時發生錯誤。
-請編輯它。否則您應該刪除這個檔案並且須要重新加入所有的教室和電腦。</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>解析組態檔案 %1 時發生錯誤。
-請編輯它。否則您應該刪除這個檔案。</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>選擇輸出檔案</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>純文字檔案 (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>可選擇的動作</translation>
-    </message>
-    <message>
-        <source>Actions</source>
-        <translation>動作</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>對 %1 的動作</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>教室的新名稱</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>請輸入教室 "%1" 的新名稱。</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>您確定要移除教室 "%1"?
-所有在此教室中的電腦也會被移除!</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>遺失教室</translation>
-    </message>
-    <message>
-        <source>Before adding computers you have to create at least one classroom.
-Do you want to create a new classrom now?</source>
-        <translation>在加入電腦前您必須先至少建立一個教室。
-您是否要立刻建立一個新的教室?</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>新增教室</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>請輸入您要建立教室的名稱。</translation>
-    </message>
-</context>
-<context>
-    <name>Client</name>
-    <message>
-        <source>Unknown state</source>
-        <translation>未知的狀態</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>沒有使用者登入</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>無法連接主機</translation>
-    </message>
-    <message>
-        <source>Demo running</source>
-        <translation>正在示範</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>桌面已鎖定</translation>
-    </message>
-</context>
-<context>
-    <name>ClientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>您確定要登出所有可見電腦上的所有使用者?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>您確定要登出所有已選取電腦上的所有使用者?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>登出使用者</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>您確定要讓所有可見的電腦重新開機?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>您確定要讓所有選取的電腦重新開機?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>重新啟動電腦</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>您確定要讓所有可見的電腦關機?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>您確定要讓所有選取的電腦關機?</translation>
-    </message>
-</context>
-<context>
-    <name>ClientSettingsDialog</name>
-    <message>
-        <source>Client settings</source>
-        <translation>客戶端設定值</translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>IP/主機名稱</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">enter an IP-address or hostname under which iTALC can reach the client (use ':'  [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">輸入讓 iTALC 可以到達客戶端的 IP-位址或主機名稱(使用 ':' 以指定選擇性的連接埠)</p></body>< [...]
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>名稱</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Optional nickname of the host which is displayed in iTALC.</p></body></html [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">這個主機在 iTALC 中顯示的選用性暱稱。</p></body></html></translation>
-    </message>
-    <message>
-        <source>MAC address</source>
-        <translation>MAC 硬體位址</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware/MAC-address of client - only used for powering on client</p></body>&l [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">用來讓客戶端開機的客戶端硬體/MAC-位址 - 只用於讓客戶端開機</p></body></html></translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>教室</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>類型</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>學生電腦</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>老師電腦</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>其他/未定義的電腦</translation>
-    </message>
-    <message>
-        <source>Missing IP address/hostname</source>
-        <translation>遺失 IP 位址/主機名稱</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP address or hostname for the computer!</source>
-        <translation>您沒有指定此電腦的 IP 位址或主機名稱!</translation>
-    </message>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>無效的 MAC-位址</translation>
-    </message>
-    <message>
-        <source>You specified an invalid MAC-address. Either leave the field blank or enter a valid MAC-address (use ":" as separator!).</source>
-        <translation>您指定了無效的 MAC-位址。您可以讓此欄位留空或輸入有效的 MAC-位址(使用 ":" 分隔!)。.</translation>
-    </message>
-</context>
-<context>
-    <name>Config</name>
-    <message>
-        <source>Interval between updates</source>
-        <translation>更新的間隔</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set the interval between updates of clients. Higher values result in lower ne [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">您可以在這裡設定客戶端更新的問隔。較高的數值可使這台電腦有較低的網路流量和 CPU 使用率。</p></body></html></t [...]
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation> 秒</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>使用者介面</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show balloon-tooltips for toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">不要顯示工具列按鈕的氣泡式工具提示</p></body></html></translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Check this option if you're annoyed by the balloon-tooltips appearing when moving mou [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果您覺得在工具列按鈕上移動滑鼠指標時出現的氣泡式工具提示很煩人的話可以核取這個選項。</p></body></html></tran [...]
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>無氣泡式工具提示</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Do not show texts on toolbar-buttons</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">不要在工具列按鈕上顯示文字。</p></body></html></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>工具列按鈕不顯示文字</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>您的角色(需要對應的鍵值!)</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can select your role. Only change this if you know what you're doing. Otherwise you won't be able to access any clients until you restore your old role.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">您可以在這裡選擇您的角色。請只在您了解自己在做什麼時才改變此選項。否則在您回復舊的角色前將可能無法存取任何客戶端。</p></body></html></translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>教師</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>管理者</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>協助者</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>其他</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>多重登入的設定值</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>網域</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>對客戶端視窗使用雙擊動作</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Here you can set what should happen if you double-click a client-window.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">您可以在這裡設定雙擊客戶端視窗時會發生什麼事。</p></body></html></translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>遠端控制</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>全螢幕現場直播</translation>
-    </message>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">Please note, that some ch [...]
-        <translation><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-style:italic;">請注意,有些變更要在您重新啟動 iTAL [...]
-    </message>
-</context>
-<context>
-    <name>ConfigWidget</name>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>您的 iTALC-組態</translation>
-    </message>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>在這個工作區中您可以自訂 iTALC 以符合您的需求。</translation>
-    </message>
-</context>
-<context>
-    <name>DecoratedMessageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>確定</translation>
-    </message>
-</context>
-<context>
-    <name>DemoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC 示範</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcCoreServer</name>
-    <message>
-        <source>Authentication error</source>
-        <translation>驗證錯誤</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>某人 (IP: %1) 嘗試存取這台電腦,但是無法成功的通過驗證!</translation>
-    </message>
-</context>
-<context>
-    <name>ItalcVncConnection</name>
-    <message>
-        <source>VNC authentication failed because of too many authentication tries.</source>
-        <translation>VNC 驗證失敗,因為嘗試過太多次了。</translation>
-    </message>
-    <message>
-        <source>VNC authentication failed.</source>
-        <translation>VNC 驗證失敗。</translation>
-    </message>
-    <message>
-        <source>VNC server closed connection.</source>
-        <translation>VNC 伺服器已關閉連線。</translation>
-    </message>
-</context>
-<context>
-    <name>KeyFileAssistant</name>
-    <message>
-        <source>iTALC Access Key Assistant</source>
-        <translation>iTALC 存取金鑰小助手</translation>
-    </message>
-    <message>
-        <source>Create/import iTALC access keys</source>
-        <translation>建立/匯入 iTALC 存取金鑰</translation>
-    </message>
-    <message>
-        <source>This assistant will help you to create or import iTALC access keys.</source>
-        <translation>此小助手會協助您建立或匯入 iTALC 存取金鑰。</translation>
-    </message>
-    <message>
-        <source>How does it work?</source>
-        <translation>它是怎麼運作的?</translation>
-    </message>
-    <message>
-        <source>iTALC access keys consist of two parts belonging together, a private and a public key part.
-
-Using the private key part, users on the master computer will be able to access client computers. It is important that only authorized users have read access to the private key file.
-
-The public key part is used on the client computers to verify that any incoming connection request is authorized.</source>
-        <translation>iTALC 存取金鑰包含兩個部份,私密金鑰與公開金鑰。
-
-主電腦上的使用者可以透過私密金鑰存取客戶端的電腦。所以很重要的是,只有經過授權的使用者才能存取私密金鑰檔。
-
-公開金鑰是用於客戶端電腦,以便驗證前來存取該電腦的要求。</translation>
-    </message>
-    <message>
-        <source>Assistant mode</source>
-        <translation>小助手模式</translation>
-    </message>
-    <message>
-        <source>Please choose whether to create new access keys or import a public key on a client.</source>
-        <translation>請選擇是要建立新的存取金鑰,還是匯入某個客戶端裡的公開金鑰。</translation>
-    </message>
-    <message>
-        <source>Create new access keys (master computer)</source>
-        <translation>建立新的存取金鑰(主電腦)</translation>
-    </message>
-    <message>
-        <source>assistantModeButtonGroup</source>
-        <translation>assistantModeButtonGroup</translation>
-    </message>
-    <message>
-        <source>Import public key (client computer)</source>
-        <translation>匯入公開金鑰(客戶端電腦)</translation>
-    </message>
-    <message>
-        <source>Select user role</source>
-        <translation>請選擇使用者角色</translation>
-    </message>
-    <message>
-        <source>Please select a user role for which to create or import the access keys:</source>
-        <translation>請選擇使用者角色,用於建立或匯入存取金鑰:</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>教師</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>管理者</translation>
-    </message>
-    <message>
-        <source>Support team member</source>
-        <translation>支援團隊成員</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>其他</translation>
-    </message>
-    <message>
-        <source>User roles allow using multiple access keys in parallel. For example there can be different teacher access keys for each classroom while the support access keys are the same for the whole school.</source>
-        <translation>多個使用者角色可以同時使用多個存取金鑰。例如,可能每間教室有不同的教師的存取金鑰,而支援者的存取金鑰則整間學校都相同。</translation>
-    </message>
-    <message>
-        <source>Directories</source>
-        <translation>目錄</translation>
-    </message>
-    <message>
-        <source>Export public key part (master computer)</source>
-        <translation>匯出公開金鑰(主電腦)</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Use custom destination directory for access keys</source>
-        <translation>使用自訂的目的地目錄存放金鑰</translation>
-    </message>
-    <message>
-        <source>Please specify the location of the public access key to be imported.</source>
-        <translation>請指定公開金鑰要被匯入到哪個位置。</translation>
-    </message>
-    <message>
-        <source>Summary</source>
-        <translation>摘要</translation>
-    </message>
-    <message>
-        <source>The following actions will be taken:</source>
-        <translation>將會進行以下的動作:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Create new access keys</source>
-        <translation>• 建立新的存取金鑰</translation>
-    </message>
-    <message utf8="true">
-        <source>• Import public access key from</source>
-        <translation>• 從以下來源匯入公開存取金鑰:</translation>
-    </message>
-    <message>
-        <source><unknown></source>
-        <translation><未知></translation>
-    </message>
-    <message utf8="true">
-        <source>• Write access key(s) to</source>
-        <translation>• 將存取金鑰寫到:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Export public key to</source>
-        <translation>• 將公開金鑰匯出到:</translation>
-    </message>
-    <message utf8="true">
-        <source>• Configure for user role</source>
-        <translation>• 設定使用者角色</translation>
-    </message>
-    <message>
-        <source>Select directory in which to export the public key</source>
-        <translation>選擇您要將公開金鑰匯出到哪個目錄</translation>
-    </message>
-    <message>
-        <source>Key files (*.key.txt)</source>
-        <translation>金鑰檔 (*.key.txt)</translation>
-    </message>
-    <message>
-        <source>Invalid public key</source>
-        <translation>不合法的公開金鑰</translation>
-    </message>
-    <message>
-        <source>The selected file does not contain a valid public iTALC access key!</source>
-        <translation>選取的檔案裡並沒有包含合法的公開 iTALC 存取金鑰!</translation>
-    </message>
-    <message>
-        <source>Select destination directory</source>
-        <translation>選擇目的地目錄</translation>
-    </message>
-    <message>
-        <source>Access key creation</source>
-        <translation>建立存取金鑰</translation>
-    </message>
-    <message>
-        <source>Could not remove previously existing file %1.</source>
-        <translation>無法移除已存在的檔案 %1。</translation>
-    </message>
-    <message>
-        <source>Failed exporting public access key from %1 to %2.</source>
-        <translation>無法將公開存取金鑰從 %1 匯出到 %2。</translation>
-    </message>
-    <message>
-        <source>Access keys were created and written successfully to %1 and %2.</source>
-        <translation>存取金鑰已建立,並已寫入 %1 與 %2。</translation>
-    </message>
-    <message>
-        <source>An error occured while creating the access keys. You probably are not permitted to write to the selected directories.</source>
-        <translation>建立存取金鑰時發生錯誤。您可能不允許寫入您所選擇的目錄。</translation>
-    </message>
-    <message>
-        <source>Public key import</source>
-        <translation>匯入公開金鑰</translation>
-    </message>
-    <message>
-        <source>An error occured while importing the public access key. You probably are not permitted to read the source key or to write the destination file.</source>
-        <translation>匯入公開金鑰時發生錯誤。您可能不允許讀取金鑰來源檔,或是不允許寫入目的檔。</translation>
-    </message>
-    <message>
-        <source>The public key was successfully imported to %1.</source>
-        <translation>公開金鑰已成功匯入到 %1。</translation>
-    </message>
-</context>
-<context>
-    <name>LockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>鎖定螢幕</translation>
-    </message>
-</context>
-<context>
-    <name>LogonGroupEditor</name>
-    <message>
-        <source>Logon group editor</source>
-        <translation>登入群組編輯器</translation>
-    </message>
-    <message>
-        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
-        <translation>請新增可以存取您的 iTALC 網路裡的電腦的成員群組。</translation>
-    </message>
-    <message>
-        <source>All groups</source>
-        <translation>所有群組</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Groups with iTALC privileges</source>
-        <translation>有 iTALC 權限的群組</translation>
-    </message>
-</context>
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>動作</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>Quit</source>
-        <translation>離開</translation>
-    </message>
-    <message>
-        <source>MainWindow</source>
-        <translation>主視窗</translation>
-    </message>
-    <message>
-        <source>toolBar</source>
-        <translation>工具列</translation>
-    </message>
-    <message>
-        <source>iTALC</source>
-        <translation>iTALC</translation>
-    </message>
-    <message>
-        <source>Could not read/write or create directory %1! For running iTALC, make sure you're permitted to create or write this directory.</source>
-        <translation>無法讀取/寫入或建立目錄 %1!為了執行 iTALC,請確定您被允許建立或寫入這個目錄。</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>教室</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation>切換教室</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation>按下這個按鈕會開啟一個選單讓您選擇使用中的教室。</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation>按下這個按鈕在教室間切換。</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation>概覽模式</translation>
-    </message>
-    <message>
-        <source>Overview</source>
-        <translation>概覽</translation>
-    </message>
-    <message>
-        <source>This is the default mode in iTALC and allows you to have an overview over all visible computers. Also click on this button for unlocking locked workstations or for leaving demo-mode.</source>
-        <translation>這是 iTALC 的預設模式,讓您可以概覽所有可見的電腦。同時按下這個按鈕可以解鎖被鎖定的工作站或離開示範模式。</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>全螢幕示範</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation>全螢幕示範</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation>停止示範</translation>
-    </message>
-    <message>
-        <source>In this mode your screen is being displayed on all shown computers. Furthermore the users aren't able to do something else as all input devices are locked in this mode.</source>
-        <translation>在這個模式中您的螢幕會在所有出現的電腦中。同時使用者將無法進行其他操作,因為所有的輸入裝置在這個模式中都會被鎖定。</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>視窗示範</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation>視窗示範</translation>
-    </message>
-    <message>
-        <source>In this mode your screen being displayed in a window on all shown computers. The users are able to switch to other windows and thus can continue to work.</source>
-        <translation>在這個模式中您的螢幕會以視窗的形式顯示在所有出現的電腦中。使用者可以切換到其他視窗以繼續他們的操作。</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation>鎖定/解鎖桌面</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation>鎖定全部</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation>鎖定全部</translation>
-    </message>
-    <message>
-        <source>To have all user's full attention you can lock their desktops using this button. In this mode all input devices are locked and the screen is black.</source>
-        <translation>要讓所有的使用者全心注意您可以使用這個按鈕鎖定他們的桌面。在這個模式中所有的輸入裝置都會被鎖定而畫面都會變成黑色。</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>傳送文字訊息</translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation>文字訊息</translation>
-    </message>
-    <message>
-        <source>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation>使用這個按鈕傳送文字訊息給所有的使用者,例如告訴他們新的工作等等。</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation>讓電腦開機</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>開機</translation>
-    </message>
-    <message>
-        <source>Click this button to power on all visible computers. This way you do not have to turn on each computer by hand.</source>
-        <translation>按下這個按鈕讓所有可視的電腦開機。這樣您可以不用親自開啟每一台電腦。</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation>關閉電腦</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>關機</translation>
-    </message>
-    <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation>要讓所有顯示的電腦關機(例如在課程結束後)您可以按這個按鈕。</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>支援</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation>直接協助</translation>
-    </message>
-    <message>
-        <source>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
-        <translation>如果您需要協助使用某台電腦的人,可以按下這個按鈕,然後輸入對應的主機名稱或 IP。</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation>調整/對齊</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation>調整視窗和他們的大小</translation>
-    </message>
-    <message>
-        <source>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation>當按下這個按鈕會調整客戶端視窗為最大可能的大小。同時所有的視窗也會被調整。</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation>自動檢視</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation>自動重新排列視窗和他們的大小</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation>當按下這個按鈕所有可見的視窗會重新排列並調整。</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>iTALC 主要控制</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>遠端控制</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console</source>
-        <translation>iTALC 管理主控台</translation>
-    </message>
-    <message>
-        <source>General</source>
-        <translation>一般</translation>
-    </message>
-    <message>
-        <source>iTALC Server</source>
-        <translation>iTALC 伺服器</translation>
-    </message>
-    <message>
-        <source>Paths</source>
-        <translation>路徑</translation>
-    </message>
-    <message>
-        <source>Authentication</source>
-        <translation>驗證</translation>
-    </message>
-    <message>
-        <source>Debugging</source>
-        <translation>除錯</translation>
-    </message>
-    <message>
-        <source>iTALC Service</source>
-        <translation>iTALC 服務</translation>
-    </message>
-    <message>
-        <source>Hide tray icon</source>
-        <translation>隱藏系統匣圖示</translation>
-    </message>
-    <message>
-        <source>Autostart</source>
-        <translation>自動開始</translation>
-    </message>
-    <message>
-        <source>Additional arguments</source>
-        <translation>額外的參數</translation>
-    </message>
-    <message>
-        <source>Start service</source>
-        <translation>開始服務</translation>
-    </message>
-    <message>
-        <source>Stop service</source>
-        <translation>結束服務</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation>狀態:</translation>
-    </message>
-    <message>
-        <source>Stopped</source>
-        <translation>已停止</translation>
-    </message>
-    <message>
-        <source>Enable desktop switching for screen lock (experimental)</source>
-        <translation>開啟螢幕鎖定的桌面切換(實驗性功能)</translation>
-    </message>
-    <message>
-        <source>Logging</source>
-        <translation>紀錄</translation>
-    </message>
-    <message>
-        <source>Log file directory</source>
-        <translation>紀錄檔目錄</translation>
-    </message>
-    <message>
-        <source>...</source>
-        <translation>...</translation>
-    </message>
-    <message>
-        <source>Log level</source>
-        <translation>紀錄等級</translation>
-    </message>
-    <message>
-        <source>Nothing</source>
-        <translation>無</translation>
-    </message>
-    <message>
-        <source>Only critical messages</source>
-        <translation>只紀錄嚴重錯誤的訊息</translation>
-    </message>
-    <message>
-        <source>Errors and critical messages</source>
-        <translation>錯誤與嚴重錯誤訊息</translation>
-    </message>
-    <message>
-        <source>Warnings and errors</source>
-        <translation>警告與所有錯誤訊息</translation>
-    </message>
-    <message>
-        <source>Information, warnings and errors</source>
-        <translation>資訊,警告與所有錯誤</translation>
-    </message>
-    <message>
-        <source>Debug messages and everything else</source>
-        <translation>所有訊息,包含除錯訊息</translation>
-    </message>
-    <message>
-        <source>Limit log file size</source>
-        <translation>限制紀錄檔大小</translation>
-    </message>
-    <message>
-        <source>MB</source>
-        <translation>MB</translation>
-    </message>
-    <message>
-        <source>Log to standard error output</source>
-        <translation>紀錄到標準錯誤輸出</translation>
-    </message>
-    <message>
-        <source>Log to Windows event log</source>
-        <translation>紀錄到 Windows 事件紀錄</translation>
-    </message>
-    <message>
-        <source>Clear all log files</source>
-        <translation>清除所有的紀錄檔</translation>
-    </message>
-    <message>
-        <source>Desktop capturing</source>
-        <translation>桌面擷取</translation>
-    </message>
-    <message>
-        <source>Enable capturing of layered (semi-transparent) windows</source>
-        <translation>開啟多層次(半透明)視窗擷取</translation>
-    </message>
-    <message>
-        <source>Low accuracy (turbo mode)</source>
-        <translation>低精確度(快速模式)</translation>
-    </message>
-    <message>
-        <source>Demo server</source>
-        <translation>展示伺服器</translation>
-    </message>
-    <message>
-        <source>Backend</source>
-        <translation>後端介面</translation>
-    </message>
-    <message>
-        <source>VNC reflector</source>
-        <translation>VNC reflector</translation>
-    </message>
-    <message>
-        <source>iTALC 1 demo server</source>
-        <translation>iTALC 1 展示伺服器</translation>
-    </message>
-    <message>
-        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
-        <translation>多執行緒(若是使用 VNC reflector 後端介面時可以開啟)</translation>
-    </message>
-    <message>
-        <source>Network</source>
-        <translation>網路</translation>
-    </message>
-    <message>
-        <source>Core server port</source>
-        <translation>核心伺服器連接埠</translation>
-    </message>
-    <message>
-        <source>Demo server port</source>
-        <translation>展示伺服器連接埠</translation>
-    </message>
-    <message>
-        <source>Enable firewall exception</source>
-        <translation>開啟防火牆例外設定</translation>
-    </message>
-    <message>
-        <source>Enable HTTP server which provides a JavaViewer applet</source>
-        <translation>開啟提供 JavaViewer applet 的 HTTP 伺服器</translation>
-    </message>
-    <message>
-        <source>HTTP server port</source>
-        <translation>HTTP 伺服器連接埠</translation>
-    </message>
-    <message>
-        <source>Allow connections from localhost only</source>
-        <translation>只允許 localhost 來的連線</translation>
-    </message>
-    <message>
-        <source>Configuration files</source>
-        <translation>設定檔</translation>
-    </message>
-    <message>
-        <source>Global configuration</source>
-        <translation>全域設定檔</translation>
-    </message>
-    <message>
-        <source>Personal configuration</source>
-        <translation>個人設定檔</translation>
-    </message>
-    <message>
-        <source>Data directories</source>
-        <translation>資料目錄</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>螢幕截圖</translation>
-    </message>
-    <message>
-        <source>Authentication methods</source>
-        <translation>認證方式</translation>
-    </message>
-    <message>
-        <source>Key file authentication</source>
-        <translation>金鑰檔認證</translation>
-    </message>
-    <message>
-        <source>ACL-based logon authentication</source>
-        <translation>存取控制清單式的登入認證</translation>
-    </message>
-    <message>
-        <source>Access key management</source>
-        <translation>存取金鑰管理</translation>
-    </message>
-    <message>
-        <source>Public key file base directory</source>
-        <translation>公開金鑰檔的基底目錄</translation>
-    </message>
-    <message>
-        <source>Private key file base directory</source>
-        <translation>私密金鑰檔的基底目錄</translation>
-    </message>
-    <message>
-        <source>Launch key file assistant</source>
-        <translation>啟動金鑰小助手</translation>
-    </message>
-    <message>
-        <source>Logon settings</source>
-        <translation>登入設定</translation>
-    </message>
-    <message>
-        <source>Manage permissions</source>
-        <translation>管理權限</translation>
-    </message>
-    <message>
-        <source>Test</source>
-        <translation>測試</translation>
-    </message>
-    <message>
-        <source>Access confirmation</source>
-        <translation>存取確認</translation>
-    </message>
-    <message>
-        <source>You can configure iTALC to ask the user for permission to access the desktop when using certain authentication methods.</source>
-        <translation>使用特定認證方式時,您可以設定讓 iTALC 要求使用者通過權限認證才能存取桌面。</translation>
-    </message>
-    <message>
-        <source>Logon authentication</source>
-        <translation>登入認證</translation>
-    </message>
-    <message>
-        <source>Allow same user to access desktop without confirmation</source>
-        <translation>允許相同使用者不需再經過確認即可存取桌面</translation>
-    </message>
-    <message>
-        <source>Debugging iTALC</source>
-        <translation>除錯 iTALC</translation>
-    </message>
-    <message>
-        <source>When encountering bugs or other misbehaviour in iTALC it is important to inform the developers about them, so that the bugs can be fixed in future releases. This page allows you to submit a helpful bug report easily.
-
-If the bug is not reproducible, skip step 1) - 3).</source>
-        <translation>當在 iTALC 下遇到問題或其他不正常的行為時,我們希望您能回報給開發者知道,這樣才能在將來的版本中修正。此頁面讓您可以輕鬆提交錯誤報告。
-
-如果這個問題無法重現,請跳過步驟 1 到 3。</translation>
-    </message>
-    <message>
-        <source>1)</source>
-        <translation>1)</translation>
-    </message>
-    <message>
-        <source>Clear the logfiles in the "General" section.</source>
-        <translation>清除在「一般」區的紀錄檔。</translation>
-    </message>
-    <message>
-        <source>2)</source>
-        <translation>2)</translation>
-    </message>
-    <message>
-        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
-        <translation>在「一般」區中設定紀錄等級為「所有訊息,包含除錯訊息」。</translation>
-    </message>
-    <message>
-        <source>3)</source>
-        <translation>3)</translation>
-    </message>
-    <message>
-        <source>Repeat the actions leading to the bug or misbehaviour.</source>
-        <translation>重新執行會出問題的動作。</translation>
-    </message>
-    <message>
-        <source>4)</source>
-        <translation>4)</translation>
-    </message>
-    <message>
-        <source>Click the following button and save the file to a known location.</source>
-        <translation>點擊下方的按鍵來儲存檔案。</translation>
-    </message>
-    <message>
-        <source>Generate bug report archive</source>
-        <translation>產生錯誤回報的檔案</translation>
-    </message>
-    <message>
-        <source>5)</source>
-        <translation>5)</translation>
-    </message>
-    <message>
-        <source>Go to the <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC bug tracker</a>, open a new bug, describe what you did in step 3) and attach the file you saved in step 4).</p>
-<br/>
-<br/>
-Note: if the bug involves both a master and client computer, attach bug report archives for both computers.</source>
-        <translation>前往 <a href="http://sourceforge.net/tracker/?group_id=132465&amp;atid=724375">iTALC 錯誤回報站台</a>,建立一個新的錯誤報告,描述一下您在 3) 做了些什麼,並附上您在 4) 所儲存的檔案。</p>
-<br/>
-<br/>
-若是此問題需要在主電腦與客戶端電腦上同時使用時才會產生,請記得附上兩台電腦所產生的檔案。</translation>
-    </message>
-    <message>
-        <source>&File</source>
-        <translation>檔案(&F)</translation>
-    </message>
-    <message>
-        <source>&Help</source>
-        <translation>說明(&H)</translation>
-    </message>
-    <message>
-        <source>&Quit</source>
-        <translation>離開(&Q)</translation>
-    </message>
-    <message>
-        <source>Ctrl+Q</source>
-        <translation>Ctrl+Q</translation>
-    </message>
-    <message>
-        <source>&Save settings into file</source>
-        <translation>將設定存到檔案(&S)</translation>
-    </message>
-    <message>
-        <source>Save settings into file</source>
-        <translation>將設定存到檔案</translation>
-    </message>
-    <message>
-        <source>Ctrl+S</source>
-        <translation>Ctrl+S</translation>
-    </message>
-    <message>
-        <source>L&oad settings from file</source>
-        <translation>從檔案載入設定(&O)</translation>
-    </message>
-    <message>
-        <source>Ctrl+O</source>
-        <translation>Ctrl+O</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>關於 iTALC</translation>
-    </message>
-    <message>
-        <source>About Qt</source>
-        <translation>關於 Qt</translation>
-    </message>
-    <message>
-        <source>No write access</source>
-        <translation>沒有寫入權限</translation>
-    </message>
-    <message>
-        <source>Could not contact iTALC service</source>
-        <translation>無法與 iTALC 服務聯繫</translation>
-    </message>
-    <message>
-        <source>Could not contact the local iTALC service. It is likely that you entered wrong credentials or key files are not set up properly. Try again or contact your administrator for solving this problem using the iTALC Management Console.</source>
-        <translation>無法與本地端的 iTALC 服務聯繫。您有可能是輸入了錯誤的密碼或是金鑰檔並未正確安裝。請與您的站台管理員聯絡,以便使用 iTALC 管理主控台來解決此問題。</translation>
-    </message>
-    <message>
-        <source>Authentication impossible</source>
-        <translation>無法認證</translation>
-    </message>
-    <message>
-        <source>No authentication key files were found or your current ones are outdated. Please create new key files using the iTALC Management Console. Alternatively set up logon authentication using the iTALC Management Console. Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>找不到認證金鑰檔,或是您目前使用的金鑰檔已過期。請使用 iTALC 管理主控台建立新的金鑰檔。此外您也可以在 iTALC 管理主控台裡設定登入認證方式。不然您將無法使用iTALC 存取電腦。</translation>
-    </message>
-    <message>
-        <source>Configuration not writable</source>
-        <translation>設定檔無法寫入</translation>
-    </message>
-    <message>
-        <source>The local configuration backend reported that the configuration is not writable! Please run the iTALC Management Console with higher privileges.</source>
-        <translation>本地端的設定後端回報,您的設定無法寫入。請以較高的權限執行 iTALC 管理主控台。</translation>
-    </message>
-    <message>
-        <source>All settings were applied successfully.</source>
-        <translation>所有設定均已成功套用。</translation>
-    </message>
-    <message>
-        <source>An error occured while applying settings!</source>
-        <translation>當套用設定時發生錯誤!</translation>
-    </message>
-    <message>
-        <source>Could not modify the autostart property for the iTALC Service.</source>
-        <translation>無法變更 iTALC 服務的自動開始屬性。</translation>
-    </message>
-    <message>
-        <source>Could not modify the service arguments for the iTALC Service.</source>
-        <translation>無法變更 iTALC 服務的參數。</translation>
-    </message>
-    <message>
-        <source>Could not change the firewall configuration for the iTALC Service.</source>
-        <translation>無法變更 iTALC 服務的防火牆設定。</translation>
-    </message>
-    <message>
-        <source>iTALC Management Console %1</source>
-        <translation>iTALC 管理主控台 %1</translation>
-    </message>
-    <message>
-        <source>Restart iTALC Service</source>
-        <translation>重新啟動 iTALC 服務</translation>
-    </message>
-    <message>
-        <source>All settings were saved successfully. In order to take effect the iTALC service needs to be restarted. Restart it now?</source>
-        <translation>所有設定均已成功儲存。要讓變更的設定生效,iTALC 服務必須重新啟動。您現在要重新啟動它嗎?</translation>
-    </message>
-    <message>
-        <source>Starting iTALC service</source>
-        <translation>重新啟動 iTALC 服務</translation>
-    </message>
-    <message>
-        <source>Stopping iTALC service</source>
-        <translation>停止 iTALC 服務</translation>
-    </message>
-    <message>
-        <source>Running</source>
-        <translation>執行中</translation>
-    </message>
-    <message>
-        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
-        <translation>iTALC 需要暫時停止以便移除紀錄檔。要繼續嗎?</translation>
-    </message>
-    <message>
-        <source>Log files cleared</source>
-        <translation>紀錄檔已清除</translation>
-    </message>
-    <message>
-        <source>All log files were cleared successfully.</source>
-        <translation>所有紀錄檔都已成功清除。</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>Could not remove all log files.</source>
-        <translation>無法移除所有的紀錄檔。</translation>
-    </message>
-    <message>
-        <source>Load settings from file</source>
-        <translation>從檔案載入設定</translation>
-    </message>
-    <message>
-        <source>XML files (*.xml)</source>
-        <translation>XML 檔 (*.xml)</translation>
-    </message>
-    <message>
-        <source>Save settings to file</source>
-        <translation>將設定存到檔案</translation>
-    </message>
-    <message>
-        <source>Logon authentication test</source>
-        <translation>登入認證測試</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials was successful.</source>
-        <translation>認證成功。</translation>
-    </message>
-    <message>
-        <source>Authentication with provided credentials failed!</source>
-        <translation>認證失敗!</translation>
-    </message>
-    <message>
-        <source>Save bug report archive</source>
-        <translation>儲存錯誤回報檔案</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive (*.ibra.xml)</source>
-        <translation>iTALC 錯誤回報檔 (*.ibra.xml)</translation>
-    </message>
-    <message>
-        <source>iTALC bug report archive saved</source>
-        <translation>iTALC 錯誤回報檔已儲存</translation>
-    </message>
-    <message>
-        <source>An iTALC bug report archive has been saved to %1. It includes iTALC log files and information about your operating system. You can attach it to a bug report.</source>
-        <translation>iTALC 錯誤回報檔已儲存到 %1。它包含了 iTALC 紀錄檔與您的作業系統的資訊。您可以將它附在錯誤報告中。</translation>
-    </message>
-    <message>
-        <source>Unsaved settings</source>
-        <translation>未儲存的設定</translation>
-    </message>
-    <message>
-        <source>There are unsaved settings. Quit anyway?</source>
-        <translation>有尚未儲存的設定。還是要離開嗎?</translation>
-    </message>
-    <message>
-        <source>Poll full screen (leave this enabled per default)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>MessageBoxSlave</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>來自老師的訊息</translation>
-    </message>
-</context>
-<context>
-    <name>Overview</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">Welcome to iTALC!</span></p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600; font-style:italic;">歡迎使用 iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Here you see the working-bar which contains several buttons. Each button is connected to a workspace. Just take a look at the available workspaces by clicking on the corresponding button.</source>
-        <translation>在這裡您可以看到含有許多按鈕的工作列。每個按鈕都連接到一個工作區。要看看可用的工作區只要按下對應的按鈕即可。</translation>
-    </message>
-    <message>
-        <source>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>使用教室管理程式讓您可以管理教室和電腦。您也可以看到哪個使用者已經登入。</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>畫面快照-工作區是很有用的工具。它讓您管理您所拍下的畫面快照。</translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>您當然可以設定 iTALC。這通常可以使用組態-工作區來完成。</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>關於 iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>OverviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>概覽</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>一些關於 iTALC 的基本資訊及如何使用它。</translation>
-    </message>
-</context>
-<context>
-    <name>PasswordDialog</name>
-    <message>
-        <source>iTALC Logon</source>
-        <translation>iTALC 登入</translation>
-    </message>
-    <message>
-        <source>Please enter your username and password in order to access iTALC clients.</source>
-        <translation>請輸入您的使用者名稱與密碼,以便存取 iTALC 客戶端程式。</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>使用者名稱</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>密碼</translation>
-    </message>
-    <message>
-        <source>Manage</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>QApplication</name>
-    <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>無法註冊服務 '%1'。</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>無法連接服務控制管理程式(您是否有需要的權限?!)- 服務 '%1' 尚未註冊。</translation>
-    </message>
-    <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>服務 '%1' 已經註冊。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>服務 '%1' 無法註冊。</translation>
-    </message>
-    <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>服務 '%1' 成功的註冊了。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>服務 '%1' 無法停止。</translation>
-    </message>
-    <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>服務 '%1' 已經註銷。</translation>
-    </message>
-    <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>服務 '%1' 尚未註冊因此無法註銷。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>服務 '%1' 無法註銷。</translation>
-    </message>
-    <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>找不到服務 '%1'。</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not unregistered.</source>
-        <translation>無法連接服務控制管理程式(您是否有需要的權限?!)- 服務 '%1' 尚未註銷。</translation>
-    </message>
-    <message>
-        <source>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not stopped.</source>
-        <translation>無法連接服務控制管理程式(您是否有需要的權限?!)- 服務 '%1' 尚未停止。</translation>
-    </message>
-    <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC 客戶端 %1 於 %2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidget</name>
-    <message>
-        <source>View live (%1 @ %2)</source>
-        <translation>檢視現場直播 (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 @ %2)</source>
-        <translation>遠端控制 (%1 @ %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>未知的使用者</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteControlWidgetToolBar</name>
-    <message>
-        <source>View only</source>
-        <translation>只有觀看</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>遠端控制</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>鎖定學生</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>解鎖學生</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>螢幕截圖</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>全螢幕</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>視窗</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>離開</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>正在連線 %1</translation>
-    </message>
-    <message>
-        <source>Connected.</source>
-        <translation>已連線。</translation>
-    </message>
-</context>
-<context>
-    <name>RemoteLogonDialog</name>
-    <message>
-        <source>Remote logon</source>
-        <translation>遠端登入</translation>
-    </message>
-    <message>
-        <source>Use the fields below to enter the username, password and optional the domain name. These information will be used to logon the computer(s).</source>
-        <translation>使用以下的欄位輸入使用者名稱、密碼與網域名稱。這些資訊會用於登入電腦。</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>使用者名稱</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>密碼</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>網域</translation>
-    </message>
-</context>
-<context>
-    <name>RunCommandsDialog</name>
-    <message>
-        <source>Run commands</source>
-        <translation>執行指令</translation>
-    </message>
-    <message>
-        <source>Please enter the commands to run on the selected client(s). You can separate multiple commands by line.</source>
-        <translation>請輸入要執行在選取的客戶端電腦上的指令。多個指令可以用不同行。</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshot</name>
-    <message>
-        <source>unknown</source>
-        <translation>未知</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>無法拍下畫面快照,因為目錄 %1 不存在而且無法建立。</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>螢幕截圖</translation>
-    </message>
-</context>
-<context>
-    <name>SnapshotList</name>
-    <message>
-        <source>Snapshots</source>
-        <translation>螢幕截圖</translation>
-    </message>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>使用這個工作區簡單的管理您拍下的畫面快照。</translation>
-    </message>
-</context>
-<context>
-    <name>Snapshots</name>
-    <message>
-        <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">All snapshots you made are listed here. You can make snapshots by selecting the according entry in the context-menu of a client-window. These snapshosts can be managed using the buttons below.</p></body></html></source>
-        <translation><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">所有您拍下的畫面快照都列在此處。您可以在客戶端視窗的快顯功能表中選擇對應的項目來拍下畫面快照。這些畫面快照可以使用下列按鈕來管理。</p></body></html></translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>使用者:</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>主機:</translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>日期:</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>時刻:</translation>
-    </message>
-    <message>
-        <source>Show</source>
-        <translation>顯示</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>刪除</translation>
-    </message>
-</context>
-<context>
-    <name>SupportDialog</name>
-    <message>
-        <source>Support</source>
-        <translation>支援</translation>
-    </message>
-    <message>
-        <source>Please enter the IP address or the name of the host to which you want to connect.</source>
-        <translation>請輸入您要連線的 IP 位址或主機名稱。</translation>
-    </message>
-</context>
-<context>
-    <name>TextMessageDialog</name>
-    <message>
-        <source>Send text message</source>
-        <translation>傳送文字訊息</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>使用下列欄位輸入您要傳送給所有選取使用者的訊息。</translation>
-    </message>
-</context>
-<context>
-    <name>VncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>建立連線到 %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>概覽</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>全螢幕示範</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>視窗示範</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>鎖定顯示</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>即時檢視</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>遠端控制</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>讓學生示範</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>傳送文字訊息</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>登出使用者</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>拍下畫面快照</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>開機</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>重新開機</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>關機</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>執行指令</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/src/3rdparty/XEventLog.cpp b/lib/src/3rdparty/XEventLog.cpp
deleted file mode 100644
index ae3a654..0000000
--- a/lib/src/3rdparty/XEventLog.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-// XEventLog.cpp  Version 1.0
-//
-// Author:  Hans Dietrich
-//          hdietrich2 at hotmail.com
-//
-// This software is released into the public domain.
-// You are free to use it in any way you like.
-//
-// This software is provided "as is" with no expressed
-// or implied warranty.  I accept no liability for any
-// damage or loss of business that this software may cause.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-//
-//                                  NOTE
-//              Change  C/C++ Precompiled Headers settings to 
-//              "Not using precompiled headers" for this file.
-//
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// this file does not need any MFC 
-//#include "stdafx.h"
-
-// if you are not using MFC, you must have the following three includes:
-#include <windows.h>
-#include <tchar.h>
-#include <crtdbg.h>
-
-
-#include "XEventLog.h"
-
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// ctor
-// 
-// Purpose:     Construct CXEventLog object.
-// 
-// Parameters:  lpszApp             - name of app (event log source).  This 
-//                                    parameter is optional. If it is not
-//                                    specified, Init() must be called separately.
-//              lpszEventMessageDll - fully-qualified name of event message
-//                                    dll. Includes complete path and file 
-//                                    name. Example: "C:\\bin\\MyMessage.dll".
-//                                    This parameter is optional.
-// 
-// Returns:     None
-//
-CXEventLog::CXEventLog(LPCTSTR lpszApp /* = NULL*/,
-					   LPCTSTR lpszEventMessageDll /* = NULL*/)
-{
-#ifdef _DEBUG
-	if ((lpszApp == NULL) || (lpszApp[0] == _T('\0')))
-	{
-		TRACE(_T("=== No app specified in CXEventLog ctor. ")
-			  _T("Be sure to call Init() before calling Write(). ===\n"));
-	}
-#endif
-
-	m_hEventLog = NULL;
-	m_pszAppName = NULL;
-
-	// open event log
-	if (lpszApp && (lpszApp[0] != _T('\0')))
-		Init(lpszApp, lpszEventMessageDll);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// dtor
-// 
-// Purpose:     Destroy CXEventLog object.
-// 
-// Parameters:  none
-// 
-// Returns:     none
-// 
-CXEventLog::~CXEventLog()
-{
-	Close();
-	if (m_pszAppName)
-		delete [] m_pszAppName;
-	m_pszAppName = NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// Close()
-// 
-// Purpose:     Close event log handle.  Called automatically by dtor.
-// 
-// Parameters:  none
-// 
-// Returns:     none
-// 
-void CXEventLog::Close()
-{
-	if (m_hEventLog)
-		::DeregisterEventSource(m_hEventLog);
-	m_hEventLog = NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// GetAppName()
-// 
-// Purpose:     Get name of currently registered app.
-// 
-// Parameters:  none
-// 
-// Returns:     LPTSTR - app name
-// 
-LPTSTR CXEventLog::GetAppName()
-{
-	return m_pszAppName;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// Init()
-// 
-// Purpose:     Initialize the registry for event logging from this app.
-//              Normally Init() is called from ctor.  If default ctor (no args)
-//              is used, then Init() must be called before Write() is called.
-//              Sets class variable m_hEventLog.
-// 
-// Parameters:  lpszApp             - name of app (event log source).  
-//                                    MUST BE SPECIFIED.
-//              lpszEventMessageDll - fully-qualified name of event message
-//                                    dll. Includes complete path and file 
-//                                    name. Example: "C:\\bin\\MyMessage.dll".
-//                                    This parameter is optional.
-// 
-// Returns:     BOOL - TRUE = success
-//
-BOOL CXEventLog::Init(LPCTSTR lpszApp, LPCTSTR lpszEventMessageDll /* = NULL*/)
-{
-	_ASSERTE((lpszApp != NULL) && (lpszApp[0] != _T('\0')));
-	if (!lpszApp || lpszApp[0] == _T('\0'))
-		return FALSE;
-
-	Close();		// close event log if already open
-
-	SetAppName(lpszApp);
-
-	BOOL bRet = RegisterSource(lpszApp, lpszEventMessageDll);
-	_ASSERTE(bRet);
-
-	if (bRet)
-	{
-		m_hEventLog = ::RegisterEventSource(NULL, lpszApp);
-	}
-	else
-	{
-		ilog_failed("RegisterSource()");
-	}
-
-	_ASSERTE(m_hEventLog != NULL);
-
-	return (m_hEventLog != NULL);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// Write()
-// 
-// Purpose:     Write string to event log
-// 
-// Parameters:  wType - event type.  See ReportEvent() in MSDN for complete list.
-//              lpszMessage - string to log
-// 
-// Returns:     BOOL - TRUE = success
-// 
-BOOL CXEventLog::Write(WORD wType, LPCTSTR lpszMessage)
-{
-	BOOL bRet = TRUE;
-
-	_ASSERTE(m_hEventLog != NULL);
-	if (!m_hEventLog)
-	{
-		// Init() not called
-		return FALSE;
-	}
-
-	_ASSERTE(lpszMessage != NULL);
-	if (!lpszMessage)
-		return FALSE;
-
-	_ASSERTE((wType == EVENTLOG_ERROR_TYPE)       ||
-			 (wType == EVENTLOG_WARNING_TYPE)     ||
-			 (wType == EVENTLOG_INFORMATION_TYPE) ||
-			 (wType == EVENTLOG_AUDIT_SUCCESS)    ||
-			 (wType == EVENTLOG_AUDIT_FAILURE));
-
-	// get our user name information
-	PSID pSid = GetUserSid();
-
-	LPCTSTR* lpStrings = &lpszMessage;
-
-	bRet = ::ReportEvent(m_hEventLog,		// event log source handle
-						 wType,				// event type to log
-						 0,					// event category
-						 0x20000001L,		// event identifier (GENERIC_MESSAGE)
-						 pSid,				// user security identifier (optional)
-						 1,					// number of strings to merge with message
-						 0,					// size of binary data, in bytes
-						 lpStrings,			// array of strings to merge with message
-						 NULL);				// address of binary data
-
-	if (pSid)
-		HeapFree(GetProcessHeap(), 0, pSid);
-
-	return bRet;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-//
-//                          INTERNAL METHODS
-//
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// RegisterSource() - INTERNAL METHOD
-// 
-// Purpose:     Create entry in registry for message DLL.  This method will
-//              create the following registry keys:
-//                 HKLM
-//                    SYSTEM
-//                       CurrentControlSet
-//                          Services
-//                             Eventlog
-//                                Application
-//                                   <app name>
-//                                       EventMessageFile = <complete path to message DLL>
-//                                       TypesSupported   = 0x0000001f (31)
-//                
-//              Note that <app name> is the lpszApp parameter, and 
-//              <complete path to message DLL> is the lpszEventMessageDll 
-//              parameter.
-//  
-// Parameters:  lpszApp             - name of app (event log source).  
-//              lpszEventMessageDll - fully-qualified name of event message
-//                                    DLL. Includes complete path and file 
-//                                    name. Example: "C:\\bin\\MyMessage.dll".
-//                                    If this parameter is NULL, default is to
-//                                    use exe's path + "XEventMessage.dll".
-// 
-// Returns:     BOOL - TRUE = success
-//
-BOOL CXEventLog::RegisterSource(LPCTSTR lpszApp,
-								LPCTSTR lpszEventMessageDll)
-{
-	_ASSERTE((lpszApp != NULL) && (lpszApp[0] != _T('\0')));
-	if (!lpszApp || lpszApp[0] == _T('\0'))
-		return FALSE;
-
-	TCHAR szRegPath[] = 
-		_T("SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\");
-
-	TCHAR szKey[_MAX_PATH*2];
-	memset(szKey, 0, _MAX_PATH*2*sizeof(TCHAR));
-	_tcscpy(szKey, szRegPath);
-	_tcscat(szKey, lpszApp);
-
-	// open the registry event source key
-	DWORD dwResult = 0;
-	HKEY hKey = NULL;
-	LONG lRet = ::RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL,
-					REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwResult);
-
-	if (lRet == ERROR_SUCCESS)
-	{
-		// registry key was opened or created -
-
-		// === write EventMessageFile key ===
-
-		TCHAR szPathName[_MAX_PATH*2];
-		memset(szPathName, 0, _MAX_PATH*2*sizeof(TCHAR));
-
-		if (lpszEventMessageDll)
-		{
-			// if dll path was specified use that - note that this
-			// must be complete path + dll filename
-			_tcsncpy(szPathName, lpszEventMessageDll, _MAX_PATH*2-2);
-		}
-		else
-		{
-			// use app's directory + "XEventMessage.dll"
-			::GetModuleFileName(NULL, szPathName, MAX_PATH*2-2);
-
-#if 0
-			TCHAR *cp = _tcsrchr(szPathName, _T('\\'));
-			if (cp != NULL)
-				*cp = _T('\0');
-
-			_tcscat(szPathName, _T("\\XEventMessage.dll"));
-#endif
-		}
-
-		::RegSetValueEx(hKey,  _T("EventMessageFile"), 0, REG_SZ,
-			(const BYTE *) szPathName, (_tcslen(szPathName) + 1)*sizeof(TCHAR));
-
-		// === write TypesSupported key ===
-
-		// message DLL supports all types
-		DWORD dwSupportedTypes = EVENTLOG_ERROR_TYPE		|
-								 EVENTLOG_WARNING_TYPE		|
-								 EVENTLOG_INFORMATION_TYPE	|
-								 EVENTLOG_AUDIT_SUCCESS		|
-								 EVENTLOG_AUDIT_FAILURE;
-
-		::RegSetValueEx(hKey, _T("TypesSupported"), 0, REG_DWORD,
-			(const BYTE *) &dwSupportedTypes, sizeof(DWORD));
-
-		::RegCloseKey(hKey);
-
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// GetUserSid() - INTERNAL METHOD
-// 
-// Purpose:     Get SID of current user
-// 
-// Parameters:  none
-// 
-// Returns:     PSID - pointer to alloc'd SID; must be freed by caller.
-//              Example:  HeapFree(GetProcessHeap(), 0, pSid);
-// 
-PSID CXEventLog::GetUserSid()
-{
-	HANDLE       hToken   = NULL;
-	PTOKEN_USER  ptiUser  = NULL;
-	DWORD        cbti     = 0;
-
-	// get calling thread's access token
-	if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE,	&hToken)) 
-	{
-		if (GetLastError() != ERROR_NO_TOKEN)
-			return NULL;
-
-		// retry for process token if no thread token exists
-		if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
-			return NULL;
-	}
-
-	// get size of the user information in the token
-	if (GetTokenInformation(hToken, TokenUser, NULL, 0, &cbti)) 
-	{
-		// call should have failed due to zero-length buffer.
-		return NULL;
-	} 
-	else 
-	{
-		// call should have failed due to zero-length buffer
-		if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
-			return NULL;
-	}
-
-	// allocate buffer for user information in the token
-	ptiUser = (PTOKEN_USER) HeapAlloc(GetProcessHeap(), 0, cbti);
-	if (!ptiUser)
-		return NULL;
-
-	// retrieve the user information from the token
-	if (!GetTokenInformation(hToken, TokenUser, ptiUser, cbti, &cbti))
-		return NULL;
-
-	DWORD dwLen = ::GetLengthSid(ptiUser->User.Sid);
-
-	// allocate buffer for SID
-	PSID psid = (PSID) HeapAlloc(GetProcessHeap(), 0, dwLen);
-	if (!psid)
-		return NULL;
-
-	BOOL bRet = ::CopySid(dwLen, psid, ptiUser->User.Sid);
-	if (!bRet)
-		return NULL;
-
-	// close access token
-	if (hToken)
-		CloseHandle(hToken);
-
-	if (ptiUser)
-		HeapFree(GetProcessHeap(), 0, ptiUser);
-
-	return psid;
-} 
-
-///////////////////////////////////////////////////////////////////////////////
-// 
-// SetAppName() - INTERNAL METHOD
-// 
-// Purpose:     Stores name of current app
-// 
-// Parameters:  lpszApp - app name
-// 
-// Returns:     none
-// 
-void CXEventLog::SetAppName(LPCTSTR lpszApp)
-{
-	if (!lpszApp)
-		return;
-	if (!m_pszAppName)
-		m_pszAppName = new TCHAR [_MAX_PATH*2];
-	if (m_pszAppName)
-	{
-		memset(m_pszAppName, 0, _MAX_PATH*2*sizeof(TCHAR));
-		_tcsncpy(m_pszAppName, lpszApp, _MAX_PATH*2-2);
-	}
-}
-
diff --git a/lib/src/3rdparty/XEventLog.h b/lib/src/3rdparty/XEventLog.h
deleted file mode 100644
index 3b3bdd8..0000000
--- a/lib/src/3rdparty/XEventLog.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// XEventLog.h  Version 1.0
-//
-// Author:  Hans Dietrich
-//          hdietrich2 at hotmail.com
-//
-// This software is released into the public domain.
-// You are free to use it in any way you like.
-//
-// This software is provided "as is" with no expressed
-// or implied warranty.  I accept no liability for any
-// damage or loss of business that this software may cause.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef XEVENTLOG_H
-#define XEVENTLOG_H
-
-class CXEventLog
-{
-// Construction
-public:
-	CXEventLog(LPCTSTR lpszApp = NULL, LPCTSTR lpszEventMessageDll = NULL);
-	~CXEventLog();
-
-// Attributes
-public:
-	LPTSTR	GetAppName();
-
-// Operations
-public:
-	void	Close();
-	BOOL	Init(LPCTSTR lpszApp, LPCTSTR lpszEventMessageDll = NULL);
-	BOOL	Write(WORD wType, LPCTSTR lpszMessage);
-
-// Implementation
-protected:
-	HANDLE	m_hEventLog;
-	LPTSTR	m_pszAppName;
-	PSID	GetUserSid();
-	BOOL	RegisterSource(LPCTSTR lpszApp, LPCTSTR lpszEventMessageDll);
-	void	SetAppName(LPCTSTR lpszApp);
-};
-
-#endif //XEVENTLOG_H
diff --git a/lib/src/AboutDialog.cpp b/lib/src/AboutDialog.cpp
deleted file mode 100644
index 17ff08b..0000000
--- a/lib/src/AboutDialog.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * AboutDialog.cpp - implementation of AboutDialog
- *
- * Copyright (c) 2011-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QFile>
-
-#include "AboutDialog.h"
-
-#include "ui_AboutDialog.h"
-
-
-AboutDialog::AboutDialog( QWidget *parent ) :
-	QDialog( parent ),
-	ui( new Ui::AboutDialog )
-{
-	ui->setupUi( this );
-
-	QFile authors( ":/AUTHORS" );
-	authors.open( QFile::ReadOnly );
-	ui->authors->setPlainText( authors.readAll() );
-
-	QFile license( ":/COPYING" );
-	license.open( QFile::ReadOnly );
-	ui->license->setPlainText( license.readAll() );
-}
-
-
-
diff --git a/lib/src/AuthenticationCredentials.cpp b/lib/src/AuthenticationCredentials.cpp
deleted file mode 100644
index dbb5807..0000000
--- a/lib/src/AuthenticationCredentials.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * AuthenticationCredentials.cpp - class holding credentials for authentication
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#include "AuthenticationCredentials.h"
-#include "DsaKey.h"
-#include "Logger.h"
-
-
-AuthenticationCredentials::AuthenticationCredentials() :
-	m_privateKey( NULL ),
-	m_logonUsername(),
-	m_logonPassword(),
-	m_commonSecret()
-{
-}
-
-
-
-AuthenticationCredentials::AuthenticationCredentials( const AuthenticationCredentials &other ) :
-	m_privateKey( NULL ),
-	m_logonUsername( other.logonUsername() ),
-	m_logonPassword( other.logonPassword() ),
-	m_commonSecret( other.commonSecret() )
-{
-}
-
-
-
-bool AuthenticationCredentials::hasCredentials( TypeFlags credentialType ) const
-{
-	if( credentialType & PrivateKey )
-	{
-		return m_privateKey && m_privateKey->isValid();
-	}
-
-	if( credentialType & UserLogon )
-	{
-		return m_logonUsername.isEmpty() == false &&
-				m_logonPassword.isEmpty() == false;
-	}
-
-	if( credentialType & CommonSecret )
-	{
-		return !m_commonSecret.isEmpty() &&
-				QByteArray::fromBase64( m_commonSecret.toAscii() ).size() ==
-												DsaKey::DefaultChallengeSize;
-	}
-
-	ilog_failedf( "credential type check", "%d", credentialType );
-
-	return false;
-}
-
-
-
-bool AuthenticationCredentials::loadPrivateKey( const QString &privKeyFile )
-{
-	if( m_privateKey )
-	{
-		delete m_privateKey;
-		m_privateKey = NULL;
-	}
-
-	if( privKeyFile.isEmpty() )
-	{
-		return false;
-	}
-
-	m_privateKey = new PrivateDSAKey( privKeyFile );
-
-	return m_privateKey->isValid();
-}
-
-
-
-void AuthenticationCredentials::setLogonUsername( const QString &username )
-{
-	m_logonUsername = username;
-}
-
-
-
-void AuthenticationCredentials::setLogonPassword( const QString &password )
-{
-	m_logonPassword = password;
-}
-
diff --git a/lib/src/Configuration/LocalStore.cpp b/lib/src/Configuration/LocalStore.cpp
deleted file mode 100644
index a6618f6..0000000
--- a/lib/src/Configuration/LocalStore.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * ConfigurationLocalStore.cpp - implementation of LocalStore
- *
- * Copyright (c) 2009 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QSettings>
-#include <QtCore/QStringList>
-
-#include "Configuration/LocalStore.h"
-#include "Configuration/Object.h"
-#include "Logger.h"
-
-
-namespace Configuration
-{
-
-LocalStore::LocalStore( Scope _scope ) :
-	Store( Store::LocalBackend, _scope )
-{
-}
-
-
-
-
-static void loadSettingsTree( Object *obj, QSettings *s,
-								const QString &parentKey )
-{
-	foreach( const QString &g, s->childGroups() )
-	{
-		const QString subParentKey = parentKey +
-									( parentKey.isEmpty() ? "" : "/" ) + g;
-		s->beginGroup( g );
-		loadSettingsTree( obj, s, subParentKey );
-		s->endGroup();
-	}
-
-	foreach( const QString &k, s->childKeys() )
-	{
-		obj->setValue( k, s->value( k ).toString(), parentKey );
-	}
-}
-
-
-
-void LocalStore::load( Object *obj )
-{
-	QSettings *s = createSettingsObject();
-	loadSettingsTree( obj, s, QString() );
-	delete s;
-}
-
-
-
-
-static void saveSettingsTree( const Object::DataMap &dataMap,
-								QSettings *s )
-{
-	for( Object::DataMap::ConstIterator it = dataMap.begin();
-						it != dataMap.end(); ++it )
-	{
-		if( it.value().type() == QVariant::Map )
-		{
-			s->beginGroup( it.key() );
-			saveSettingsTree( it.value().toMap(), s );
-			s->endGroup();
-		}
-		else if( it.value().type() == QVariant::String )
-		{
-			s->setValue( it.key(), it.value().toString() );
-		}
-	}
-}
-
-
-
-void LocalStore::flush( Object *obj )
-{
-	QSettings *s = createSettingsObject();
-	saveSettingsTree( obj->data(), s );
-	delete s;
-}
-
-
-
-bool LocalStore::isWritable() const
-{
-	QSettings *s = createSettingsObject();
-	bool ret = s->isWritable();
-	delete s;
-
-	return ret;
-}
-
-
-
-QSettings *LocalStore::createSettingsObject() const
-{
-	return new QSettings( scope() == System ?
-							QSettings::SystemScope : QSettings::UserScope,
-						QSettings().organizationName(),
-						QSettings().applicationName() );
-}
-
-
-}
-
diff --git a/lib/src/Configuration/Object.cpp b/lib/src/Configuration/Object.cpp
deleted file mode 100644
index 64e86be..0000000
--- a/lib/src/Configuration/Object.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * ConfigurationObject.cpp - implementation of ConfigurationObject
- *
- * Copyright (c) 2009 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QStringList>
-
-#include "Configuration/Object.h"
-#include "Configuration/LocalStore.h"
-#include "Configuration/XmlStore.h"
-
-#include "Logger.h"
-
-
-namespace Configuration
-{
-
-
-Object::Object( Store::Backend _backend, Store::Scope _scope ) :
-	m_store( NULL ),
-	m_customStore( false )
-{
-	switch( _backend )
-	{
-		case Store::LocalBackend:
-			m_store = new LocalStore( _scope );
-			break;
-		case Store::XmlFile:
-			m_store = new XmlStore( _scope );
-			break;
-		case Store::NoBackend:
-			break;
-		default:
-			qCritical( "Invalid Store::Backend %d selected in "
-					"Object::Object()", _backend );
-			break;
-	}
-
-	reloadFromStore();
-}
-
-
-
-
-Object::Object( Store *store ) :
-	m_store( store ),
-	m_customStore( true )
-{
-	reloadFromStore();
-}
-
-
-
-
-Object::Object( const Object &obj ) :
-	m_store( NULL ),
-	m_customStore( false )
-{
-	*this = obj;
-}
-
-
-
-
-Object::~Object()
-{
-	if( !m_customStore )
-	{
-		delete m_store;
-	}
-}
-
-
-
-
-Object &Object::operator=( const Object &ref )
-{
-	if( !m_customStore && ref.m_store && !ref.m_customStore )
-	{
-		delete m_store;
-
-		switch( ref.m_store->backend() )
-		{
-			case Store::LocalBackend:
-				m_store = new LocalStore( ref.m_store->scope() );
-				break;
-			case Store::XmlFile:
-				m_store = new XmlStore( ref.m_store->scope() );
-				break;
-			case Store::NoBackend:
-				break;
-			default:
-				qCritical( "Invalid Store::Backend %d selected in "
-							"Object::operator=()", ref.m_store->backend() );
-			break;
-		}
-	}
-
-	m_data = ref.data();
-
-	return *this;
-}
-
-
-
-
-// allow easy merging of two data maps - source is dominant over destination
-static Object::DataMap operator+( Object::DataMap dst, Object::DataMap src )
-{
-	for( Object::DataMap::ConstIterator it = src.begin(); it != src.end(); ++it )
-	{
-		if( it.value().type() == QVariant::Map && dst.contains( it.key() ) )
-		{
-			dst[it.key()] = dst[it.key()].toMap() + it.value().toMap();
-		}
-		else
-		{
-			dst[it.key()] = it.value();
-		}
-	}
-	return dst;
-}
-
-
-
-
-Object &Object::operator+=( const Object &ref )
-{
-	m_data = m_data + ref.data();
-
-	return *this;
-}
-
-
-
-
-QString Object::value( const QString & _key, const QString & _parentKey ) const
-{
-	// empty parentKey?
-	if( _parentKey.isEmpty() )
-	{
-		// search for key in toplevel data map
-		if( m_data.contains( _key ) )
-		{
-			return m_data[_key].toString();
-		}
-		return QString();
-	}
-
-	// recursively search through data maps and sub data-maps until
-	// all levels of the parentKey are processed
-	const QStringList subLevels = _parentKey.split( '/' );
-	DataMap currentMap = m_data;
-	foreach( const QString & _level, subLevels )
-	{
-		if( currentMap.contains( _level ) &&
-			currentMap[_level].type() == QVariant::Map )
-		{
-			currentMap = currentMap[_level].toMap();
-		}
-		else
-		{
-			return QString();
-		}
-	}
-
-	// ok, we're there - does the current submap then contain our key?
-	if( currentMap.contains( _key ) )
-	{
-		return currentMap[_key].toString();
-	}
-	return QString();
-}
-
-
-
-
-static Object::DataMap setValueRecursive( Object::DataMap data,
-											QStringList subLevels,
-											const QString &key,
-											const QString &value )
-{
-	if( subLevels.isEmpty() )
-	{
-		// search for key in toplevel data map
-		if( !data.contains( key ) || data[key].type() == QVariant::String )
-		{
-			data[key] = value;
-		}
-		else
-		{
-			qWarning( "cannot replace sub data map with a "
-						"string value!" );
-		}
-
-		return data;
-	}
-
-	const QString level = subLevels.takeFirst();
-	if( data.contains( level ) )
-	{
-		if( data[level].type() != QVariant::Map )
-		{
-			qWarning( "parent key points doesn't point to a data map!" );
-			return data;
-		}
-	}
-	else
-	{
-		data[level] = Object::DataMap();
-	}
-
-	data[level] = setValueRecursive( data[level].toMap(), subLevels, key, value );
-
-	return data;
-}
-
-
-
-
-void Object::setValue( const QString & key,
-			const QString & value,
-			const QString & parentKey )
-{
-	// recursively search through data maps and sub data-maps until
-	// all levels of the parentKey are processed
-	QStringList subLevels = parentKey.split( '/' );
-	DataMap data = setValueRecursive( m_data, subLevels, key, value );
-	if( data != m_data )
-	{
-		m_data = data;
-		emit configurationChanged();
-	}
-}
-
-
-
-
-static Object::DataMap removeValueRecursive( Object::DataMap data,
-											QStringList subLevels,
-											const QString &key )
-{
-	if( subLevels.isEmpty() )
-	{
-		// search for key in toplevel data map
-		if( data.contains( key ) )
-		{
-			data.remove( key );
-		}
-
-		return data;
-	}
-
-	const QString level = subLevels.takeFirst();
-	if( data.contains( level ) && data[level].type() == QVariant::Map )
-	{
-		data[level] = removeValueRecursive( data[level].toMap(), subLevels, key );
-	}
-
-	return data;
-}
-
-
-
-
-
-void Object::removeValue( const QString &key, const QString &parentKey )
-{
-	QStringList subLevels = parentKey.split( '/' );
-	DataMap data = removeValueRecursive( m_data, subLevels, key );
-	if( data != m_data )
-	{
-		m_data = data;
-		emit configurationChanged();
-	}
-}
-
-
-
-
-static void addSubObjectRecursive( const Object::DataMap &dataMap,
-									Object *_this,
-									const QString &parentKey )
-{
-	for( Object::DataMap::ConstIterator it = dataMap.begin();
-										it != dataMap.end(); ++it )
-	{
-		if( it.value().type() == QVariant::Map )
-		{
-			QString newParentKey = it.key();
-			if( !parentKey.isEmpty() )
-			{
-				newParentKey = parentKey + "/" + newParentKey;
-			}
-			addSubObjectRecursive( it.value().toMap(), _this, newParentKey );
-		}
-		else if( it.value().type() == QVariant::String )
-		{
-			_this->setValue( it.key(), it.value().toString(), parentKey );
-		}
-	}
-}
-
-
-
-void Object::addSubObject( Object *obj,
-								const QString &parentKey )
-{
-	addSubObjectRecursive( obj->data(), this, parentKey );
-}
-
-
-
-}
-
diff --git a/lib/src/Configuration/XmlStore.cpp b/lib/src/Configuration/XmlStore.cpp
deleted file mode 100644
index 4ab2295..0000000
--- a/lib/src/Configuration/XmlStore.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * ConfigurationXmlStore.cpp - implementation of XmlStore
- *
- * Copyright (c) 2009-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QDir>
-#include <QtCore/QFile>
-#include <QtXml/QDomDocument>
-
-#include "Configuration/XmlStore.h"
-#include "Configuration/Object.h"
-#include "ItalcConfiguration.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-
-namespace Configuration
-{
-
-XmlStore::XmlStore( Scope scope, const QString &file ) :
-	Store( Store::XmlFile, scope ),
-	m_file( file )
-{
-}
-
-
-
-
-static void loadXmlTree( Object * _obj, QDomNode & _parentNode,
-				const QString & _parentKey )
-{
-	QDomNode node = _parentNode.firstChild();
-
-	while( !node.isNull() )
-	{
-		if( !node.firstChildElement().isNull() )
-		{
-			const QString subParentKey = _parentKey +
-				( _parentKey.isEmpty() ? "" : "/" ) +
-					node.nodeName();
-			loadXmlTree( _obj, node, subParentKey );
-		}
-		else
-		{
-			_obj->setValue( node.nodeName(),
-					node.toElement().text(),
-					_parentKey );
-		}
-		node = node.nextSibling();
-	}
-}
-
-
-
-void XmlStore::load( Object * _obj )
-{
-	QDomDocument doc;
-	QFile xmlFile( m_file.isEmpty() ? configurationFilePath() : m_file );
-	if( !xmlFile.open( QFile::ReadOnly ) || !doc.setContent( &xmlFile ) )
-	{
-		qWarning() << "Could not open" << xmlFile.fileName();
-		return;
-	}
-
-	QDomElement root = doc.documentElement();
-	loadXmlTree( _obj, root, QString() );
-}
-
-
-
-
-static void saveXmlTree( const Object::DataMap & _dataMap,
-				QDomDocument & _doc,
-				QDomNode & _parentNode )
-{
-	for( Object::DataMap::ConstIterator it = _dataMap.begin();
-						it != _dataMap.end(); ++it )
-	{
-		if( it.value().type() == QVariant::Map )
-		{
-			// create a new element with current key as tagname
-			QDomNode node = _doc.createElement( it.key() );
-
-			saveXmlTree( it.value().toMap(), _doc, node );
-			_parentNode.appendChild( node );
-		}
-		else if( it.value().type() == QVariant::String )
-		{
-			QDomElement e = _doc.createElement( it.key() );
-			QDomText t = _doc.createTextNode( it.value().toString() );
-			e.appendChild( t );
-			_parentNode.appendChild( e );
-		}
-	}
-}
-
-
-
-
-void XmlStore::flush( Object * _obj )
-{
-	QDomDocument doc( "ItalcXmlStore" );
-	const Object::DataMap & data = _obj->data();
-
-	QDomElement root = doc.createElement( configurationNameFromScope() );
-	saveXmlTree( data, doc, root );
-	doc.appendChild( root );
-
-	QFile outfile( m_file.isEmpty() ? configurationFilePath() : m_file );
-	if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
-	{
-		qCritical() << "XmlStore::flush(): could not write to configuration file"
-					<< configurationFilePath();
-		return;
-	}
-
-	QTextStream( &outfile ) << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-	outfile.write( doc.toByteArray( 2 ) );
-	//qDebug() << doc.toString( 2 );
-}
-
-
-
-
-bool XmlStore::isWritable() const
-{
-	return QFileInfo( m_file.isEmpty() ?
-							configurationFilePath() : m_file ).isWritable();
-
-}
-
-
-
-
-QString XmlStore::configurationFilePath() const
-{
-	QString base;
-	switch( scope() )
-	{
-		case Global:
-			base = ItalcConfiguration::defaultConfiguration().globalConfigurationPath();
-			break;
-		case Personal:
-			base = ItalcConfiguration::defaultConfiguration().personalConfigurationPath();
-			break;
-		case System:
-			base = LocalSystem::Path::systemConfigDataPath();
-			break;
-		default:
-			base = QDir::homePath();
-			break;
-	}
-
-	base = LocalSystem::Path::expand( base );
-
-	LocalSystem::Path::ensurePathExists( base );
-
-	return QDTNS( base + QDir::separator() + configurationNameFromScope() + ".xml" );
-}
-
-
-
-
-
-}
-
diff --git a/lib/src/DecoratedMessageBox.cpp b/lib/src/DecoratedMessageBox.cpp
deleted file mode 100644
index e43cc9b..0000000
--- a/lib/src/DecoratedMessageBox.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * DecoratedMessageBox.cpp - simple message-box
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "DecoratedMessageBox.h"
-#include "LocalSystem.h"
-
-#include <QtCore/QThread>
-#include <QtGui/QApplication>
-#include <QtGui/QWidget>
-#include <QtGui/QPixmap>
-#include <QtGui/QIcon>
-#include <QtGui/QLabel>
-#include <QtGui/QBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QSystemTrayIcon>
-
-QSystemTrayIcon * __systray_icon = NULL;
-
-
-DecoratedMessageBox::DecoratedMessageBox( const QString & _title,
-						const QString & _msg,
-						const QPixmap & _pixmap ) :
-	QDialog()
-{
-	QVBoxLayout * vl = new QVBoxLayout( this );
-
-	QWidget * content = new QWidget( this );
-
-	QHBoxLayout * hl1 = new QHBoxLayout( content );
-	hl1->setSpacing( 20 );
-
-	QLabel * icon_lbl = new QLabel( content );
-	if( _pixmap.isNull() == FALSE )
-	{
-		icon_lbl->setPixmap( _pixmap );
-	}
-	else
-	{
-		icon_lbl->setPixmap( QPixmap( ":/resources/info.png" ) );
-	}
-	icon_lbl->setFixedSize( icon_lbl->pixmap()->size() );
-
-	QLabel * txt_lbl = new QLabel( _msg, content );
-	txt_lbl->setMinimumWidth( 400 );
-	txt_lbl->setWordWrap( TRUE );
-
-	hl1->addWidget( icon_lbl );
-	hl1->addWidget( txt_lbl );
-
-	QWidget * btn_area = new QWidget( this );
-	QHBoxLayout * hl2 = new QHBoxLayout( btn_area );
-
-	QPushButton * ok_btn = new QPushButton( QPixmap( ":/resources/ok.png" ),
-						tr( "OK" ), btn_area );
-	connect( ok_btn, SIGNAL( clicked() ), this, SLOT( accept() ) );
-
-	hl2->addStretch();
-	hl2->addWidget( ok_btn );
-	hl2->addStretch();
-
-	vl->addWidget( content );
-	vl->addWidget( btn_area );
-
-	setWindowTitle( _title );
-	setWindowIcon( *icon_lbl->pixmap() );
-	setAttribute( Qt::WA_DeleteOnClose, TRUE );
-	setModal( TRUE );
-	show();
-	LocalSystem::activateWindow( this );
-}
-
-
-
-
-void DecoratedMessageBox::information( const QString & _title,
-						const QString & _msg,
-						const QPixmap & _pixmap )
-{
-	DecoratedMessageBox * m =
-			new DecoratedMessageBox( _title, _msg, _pixmap );
-	m->exec();
-}
-
-
-
-void DecoratedMessageBox::trySysTrayMessage( const QString & _title,
-					const QString & _msg,
-					MessageIcon _msg_icon )
-{
-	qWarning( "%s", _msg.toUtf8().constData() );
-	if( QThread::currentThreadId() !=
-		QCoreApplication::instance()->thread()->currentThreadId() )
-	{
-		return;
-	}
-
-	// OS X does not support messages
-	if( QSystemTrayIcon::supportsMessages() && __systray_icon )
-	{
-		__systray_icon->showMessage( _title, _msg,
-				(QSystemTrayIcon::MessageIcon) _msg_icon, -1 );
-		return;
-	}
-
-	QPixmap p;
-	switch( _msg_icon )
-	{
-		case Information:
-		case Warning:
-			p = QPixmap( ":/resources/info.png" );
-			break;
-		case Critical:
-			p = QPixmap( ":/resources/stop.png" );
-			break;
-
-		default: break;
-	}
-
-	new DecoratedMessageBox( _title, _msg, p );
-
-}
-
-
diff --git a/lib/src/DsaKey.cpp b/lib/src/DsaKey.cpp
deleted file mode 100644
index 2eb84c8..0000000
--- a/lib/src/DsaKey.cpp
+++ /dev/null
@@ -1,849 +0,0 @@
-/*
- * DsaKey.cpp - easy to use C++ classes for dealing with DSA-keys, -signatures
- *              etc.
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
- /****************************************************************************
- *
- * In addition, as a special exception, Tobias Doerffel gives permission to link
- * the code of its release of iTALC with the OpenSSL project's "OpenSSL" library
- * (or modified versions of the "OpenSSL" library that use the same license
- * as the original version), and distribute the linked executables.
- *
- * You must comply with the GNU General Public License version 2 in all
- * respects for all of the code used other than the "OpenSSL" code.  If you
- * modify this file, you may extend this exception to your version of the file,
- * but you are not obligated to do so.  If you do not wish to do so, delete
- * this exception statement from your version of this file.
- *
- ****************************************************************************/
-
-#include <italcconfig.h>
-
-// project-headers
-#include "DsaKey.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-
-// OpenSSL-headers
-#include <openssl/evp.h>
-#include <openssl/pem.h>
-#include <openssl/bn.h>
-
-// stdlib-headers
-#include <memory.h>
-#include <cstdlib>
-#include <cstdio>
-
-// Qt-headers
-#include <QtCore/QByteArray>
-#include <QtCore/QDir>
-#include <QtCore/QFile>
-#include <QtCore/QFileInfo>
-#include <QtCore/QTextStream>
-
-
-
-
-/*	$OpenBSD: buffer.h,v 1.11 2002/03/04 17:27:39 stevesk Exp $	*/
-
-/*
- * Author: Tatu Ylonen <ylo at cs.hut.fi>
- * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
- *                    All rights reserved
- * Code for manipulating FIFO buffers.
- *
- * As far as I am concerned, the code I have written for this software
- * can be used freely for any purpose.  Any derived versions of this
- * software must be clearly marked as such, and if the derived work is
- * incompatible with the protocol description in the RFC file, it must be
- * called by a name other than "ssh" or "Secure Shell".
- */
-
-
-
-typedef struct {
-	unsigned char	*buf;		/* Buffer for data. */
-	unsigned int	 alloc;		/* Number of bytes allocated for data. */
-	unsigned int	 offset;	/* Offset of first byte containing data. */
-	unsigned int	 end;		/* Offset of last byte containing data. */
-}       Buffer;
-
-/*
- * Author: Tatu Ylonen <ylo at cs.hut.fi>
- * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
- *                    All rights reserved
- * Functions for manipulating fifo buffers (that can grow if needed).
- *
- * As far as I am concerned, the code I have written for this software
- * can be used freely for any purpose.  Any derived versions of this
- * software must be clearly marked as such, and if the derived work is
- * incompatible with the protocol description in the RFC file, it must be
- * called by a name other than "ssh" or "Secure Shell".
- */
-
-#define PUT_32BIT(cp, value) do { \
-  (cp)[0] = (value) >> 24; \
-  (cp)[1] = (value) >> 16; \
-  (cp)[2] = (value) >> 8; \
-  (cp)[3] = (value); } while (0)
-
-#define GET_32BIT(cp) (((unsigned long)(unsigned char)(cp)[0] << 24) | \
-		       ((unsigned long)(unsigned char)(cp)[1] << 16) | \
-		       ((unsigned long)(unsigned char)(cp)[2] << 8) | \
-		       ((unsigned long)(unsigned char)(cp)[3]))
-
-
-/* Initializes the buffer structure. */
-
-void
-buffer_init(Buffer *buffer)
-{
-	const unsigned int len = 4096;
-
-	buffer->alloc = 0;
-	buffer->buf = new unsigned char[len];
-	buffer->alloc = len;
-	buffer->offset = 0;
-	buffer->end = 0;
-}
-
-/* Frees any memory used for the buffer. */
-
-void
-buffer_free(Buffer *buffer)
-{
-	if (buffer->alloc > 0) {
-		memset(buffer->buf, 0, buffer->alloc);
-		buffer->alloc = 0;
-		delete[] buffer->buf;
-	}
-}
-
-/*
- * Clears any data from the buffer, making it empty.  This does not actually
- * zero the memory.
- */
-
-void
-buffer_clear(Buffer *buffer)
-{
-	buffer->offset = 0;
-	buffer->end = 0;
-}
-
-
-void *
-buffer_append_space(Buffer *buffer, unsigned int len)
-{
-	if (len > 0x100000)
-	{
-		qCritical( "buffer_append_space: len %u not supported", len );
-		exit( -1 );
-	}
-
-	/* If the buffer is empty, start using it from the beginning. */
-	if (buffer->offset == buffer->end) {
-		buffer->offset = 0;
-		buffer->end = 0;
-	}
-restart:
-	void *p;
-	/* If there is enough space to store all data, store it now. */
-	if (buffer->end + len < buffer->alloc) {
-		p = buffer->buf + buffer->end;
-		buffer->end += len;
-		return p;
-	}
-	/*
-	 * If the buffer is quite empty, but all data is at the end, move the
-	 * data to the beginning and retry.
-	 */
-	if (buffer->offset > buffer->alloc / 2) {
-		memmove(buffer->buf, buffer->buf + buffer->offset,
-			buffer->end - buffer->offset);
-		buffer->end -= buffer->offset;
-		buffer->offset = 0;
-		goto restart;
-	}
-	/* Increase the size of the buffer and retry. */
-
-	unsigned int newlen = buffer->alloc + len + 32768;
-	if (newlen > 0xa00000)
-	{
-		qCritical( "buffer_append_space: alloc %u not supported",
-								newlen );
-		exit( -1 );
-	}
-	buffer->buf = (unsigned char *)realloc(buffer->buf, newlen);
-	buffer->alloc = newlen;
-	goto restart;
-	/* NOTREACHED */
-}
-
-/* Appends data to the buffer, expanding it if necessary. */
-
-void
-buffer_append(Buffer *buffer, const void *data, unsigned int len)
-{
-	void *p = buffer_append_space(buffer, len);
-	memcpy(p, data, len);
-}
-
-/* Returns the number of bytes of data in the buffer. */
-
-unsigned int
-buffer_len(Buffer *buffer)
-{
-	return buffer->end - buffer->offset;
-}
-
-/* Gets data from the beginning of the buffer. */
-
-bool
-buffer_get(Buffer *buffer, void *buf, unsigned int len)
-{
-	if (len > buffer->end - buffer->offset)
-	{
-		qCritical( "buffer_get: trying to get more bytes %d than in "
-			"buffer %d", len, buffer->end - buffer->offset );
-		return false;
-		//exit( -1 );
-	}
-	memcpy(buf, buffer->buf + buffer->offset, len);
-	buffer->offset += len;
-	return true;
-}
-
-
-/* Returns a pointer to the first used byte in the buffer. */
-
-void *
-buffer_ptr(Buffer *buffer)
-{
-	return buffer->buf + buffer->offset;
-}
-
-void
-buffer_put_int(Buffer *buffer, unsigned int value)
-{
-	char buf[4];
-
-	PUT_32BIT(buf, value);
-	buffer_append(buffer, buf, 4);
-}
-
-unsigned int
-buffer_get_int(Buffer *buffer)
-{
-	unsigned char buf[4];
-
-	if(buffer_get(buffer, (char *) buf, 4))
-		return GET_32BIT(buf);
-	return 0;
-}
-
-/*
- * Stores and arbitrary binary string in the buffer.
- */
-void
-buffer_put_string(Buffer *buffer, const void *buf, unsigned int len)
-{
-	buffer_put_int(buffer, len);
-	buffer_append(buffer, buf, len);
-}
-void
-buffer_put_cstring(Buffer *buffer, const char *s)
-{
-	if (s == NULL)
-	{
-		qCritical( "buffer_put_cstring: s == NULL" );
-		exit( -1 );
-	}
-	buffer_put_string(buffer, s, strlen(s));
-}
-
-
-/*
- * Returns an arbitrary binary string from the buffer.  The string cannot
- * be longer than 256k.  The returned value points to memory allocated
- * with xmalloc; it is the responsibility of the calling function to free
- * the data.  If length_ptr is non-NULL, the length of the returned data
- * will be stored there.  A null character will be automatically appended
- * to the returned string, and is not counted in length.
- */
-void *
-buffer_get_string(Buffer *buffer, unsigned int *length_ptr)
-{
-	unsigned char *value;
-	unsigned int len;
-
-	/* Get the length. */
-	len = buffer_get_int(buffer);
-	if (len > 256 * 1024)
-	{
-		qCritical( "buffer_get_string: bad string length %u", len );
-		exit( -1 );
-	}
-	/* Allocate space for the string.  Add one byte for a null character. */
-	value = new unsigned char[len + 1];
-	/* Get the string. */
-	buffer_get(buffer, value, len);
-	/* Append a null character to make processing easier. */
-	value[len] = 0;
-	/* Optionally return the length of the string. */
-	if (length_ptr)
-		*length_ptr = len;
-	return value;
-}
-
-
-void buffer_get_bignum2(Buffer *buffer, BIGNUM *value)
-{
-	unsigned int len;
-	unsigned char *bin = (unsigned char*)buffer_get_string(buffer, &len);
-
-	if (len > 8 * 1024)
-	{
-		qCritical( "buffer_get_bignum2: cannot handle BN of size %d",
-									len );
-		exit( -1 );
-	}
-	BN_bin2bn(bin, len, value);
-	delete[] bin;
-}
-
-void
-buffer_put_bignum2(Buffer *buffer, BIGNUM *value)
-{
-	int bytes = BN_num_bytes(value) + 1;
-	unsigned char *buf = new unsigned char[bytes];
-	int oi;
-	int hasnohigh = 0;
-
-	buf[0] = '\0';
-	/* Get the value of in binary */
-	oi = BN_bn2bin(value, buf+1);
-	if (oi != bytes-1)
-	{
-		qCritical( "buffer_put_bignum: BN_bn2bin() failed: oi %d "
-						"!= bin_size %d", oi, bytes );
-		exit( -1 );
-	}
-	hasnohigh = (buf[1] & 0x80) ? 0 : 1;
-	if (value->neg) {
-		/**XXX should be two's-complement */
-		int i, carry;
-		unsigned char *uc = buf;
-		for (i = bytes-1, carry = 1; i>=0; i--) {
-			uc[i] ^= 0xff;
-			if (carry)
-				carry = !++uc[i];
-		}
-	}
-	buffer_put_string(buffer, buf+hasnohigh, bytes-hasnohigh);
-	memset(buf, 0, bytes);
-	delete[] buf;
-}
-
-
-#define INTBLOB_LEN	20
-#define SIGBLOB_LEN	(2*INTBLOB_LEN)
-
-const int DsaKey::DefaultChallengeSize = 64;
-
-
-bool DsaKey::verifySignature( const QByteArray & _data,
-					const QByteArray & _sig ) const
-{
-	if( !isValid() )
-	{
-		qCritical( "DsaKey::verifySignature(): invalid key" );
-		return false;
-	}
-
-	// ietf-drafts
-	Buffer b;
-	buffer_init( &b );
-	buffer_append( &b, _sig.data(), _sig.size() );
-	char * ktype = (char*) buffer_get_string( &b, NULL );
-	if( strcmp( "italc-dss", ktype ) != 0 && strcmp( "ssh-dss", ktype ) != 0)
-	{
-		qCritical( "DsaKey::verifySignature(): cannot handle type %s", ktype );
-		buffer_free( &b );
-		delete[] ktype;
-		return false;
-	}
-	delete[] ktype;
-
-	unsigned int len;
-	unsigned char * sigblob = (unsigned char *) buffer_get_string( &b,
-									&len );
-	const unsigned int rlen = buffer_len( &b );
-	buffer_free( &b );
-	if( rlen != 0 )
-	{
-		qWarning( "DsaKey::verifySignature(): remaining bytes in signature %d", rlen );
-		delete[] sigblob;
-		return false;
-	}
-
-	if( len != SIGBLOB_LEN )
-	{
-		qCritical( "bad sigbloblen %u != SIGBLOB_LEN", len );
-		return false;
-	}
-
-	DSA_SIG * sig = DSA_SIG_new();
-
-	// parse signature
-	if( sig == NULL )
-	{
-		qCritical( "DsaKey::verifySignature(): DSA_SIG_new failed" );
-		return false;
-	}
-
-	if( ( sig->r = BN_new() ) == NULL )
-	{
-		qCritical( "DsaKey::verifySignature(): BN_new failed" );
-		return false;
-	}
-
-	if( ( sig->s = BN_new() ) == NULL )
-	{
-		qCritical( "DsaKey::verifySignature(): BN_new failed" );
-		return false;
-	}
-
-	BN_bin2bn( sigblob, INTBLOB_LEN, sig->r );
-	BN_bin2bn( sigblob+ INTBLOB_LEN, INTBLOB_LEN, sig->s );
-
-	memset( sigblob, 0, len );
-	delete[] sigblob;
-
-	// sha1 the data
-	const EVP_MD * evp_md = EVP_sha1();
-	EVP_MD_CTX md;
-	unsigned char digest[EVP_MAX_MD_SIZE];
-	unsigned int dlen;
-	EVP_DigestInit( &md, evp_md );
-	EVP_DigestUpdate( &md, _data.constData(), _data.size() );
-	EVP_DigestFinal( &md, digest, &dlen );
-
-	int ret = DSA_do_verify( digest, dlen, sig, m_dsa );
-	memset( digest, 'd', sizeof( digest ) );
-
-	DSA_SIG_free( sig );
-
-	qDebug( "dsa_verify: signature %s", ret == 1 ? "correct" : ret == 0 ?
-							"incorrect" : "error" );
-	return ( ret == 1 );
-}
-
-
-
-
-QByteArray DsaKey::generateChallenge()
-{
-	BIGNUM * challenge_bn = BN_new();
-
-	if( challenge_bn == NULL )
-	{
-		qCritical( "DsaKey::generateChallenge(): BN_new() failed" );
-		return QByteArray();
-	}
-
-	// generate a random challenge
-	BN_rand( challenge_bn, DefaultChallengeSize * 8, 0, 0 );
-	QByteArray chall( BN_num_bytes( challenge_bn ), 0 );
-	BN_bn2bin( challenge_bn, (unsigned char *) chall.data() );
-	BN_free( challenge_bn );
-
-	return chall;
-}
-
-
-
-
-
-
-
-PrivateDSAKey::PrivateDSAKey( const unsigned int _bits) :
-	DsaKey( Private )
-{
-	m_dsa = DSA_generate_parameters( _bits, NULL, 0, NULL, NULL, NULL,
-									NULL );
-	if( m_dsa == NULL)
-	{
-		qCritical( "PrivateDSAKey::PrivateDSAKey(): DSA_generate_parameters failed" );
-		return;
-	}
-
-	if( !DSA_generate_key( m_dsa ) )
-	{
-		qCritical( "PrivateDSAKey::PrivateDSAKey(): DSA_generate_key failed" );
-		m_dsa = NULL;
-		return;
-	}
-}
-
-
-
-
-QByteArray PrivateDSAKey::sign( const QByteArray & _data ) const
-{
-	if( !isValid() )
-	{
-		qCritical( "PrivateDSAKey::sign(): invalid key" );
-		return QByteArray();
-	}
-
-	const EVP_MD * evp_md = EVP_sha1();
-	EVP_MD_CTX md;
-	unsigned char digest[EVP_MAX_MD_SIZE];
-	unsigned int dlen;
-
-	EVP_DigestInit( &md, evp_md );
-	EVP_DigestUpdate( &md, _data.constData(), _data.size() );
-	EVP_DigestFinal( &md, digest, &dlen );
-
-	DSA_SIG * sig = DSA_do_sign( digest, dlen, m_dsa );
-	memset( digest, 'd', sizeof( digest ) );
-
-	if( sig == NULL )
-	{
-		qCritical( "PrivateDSAKey::sign(): DSA_do_sign() failed" );
-		return QByteArray();
-	}
-
-	unsigned int rlen = BN_num_bytes( sig->r );
-	unsigned int slen = BN_num_bytes( sig->s );
-	if( rlen > INTBLOB_LEN || slen > INTBLOB_LEN )
-	{
-		qCritical( "bad sig size %u %u", rlen, slen );
-		DSA_SIG_free( sig );
-		return QByteArray();
-	}
-
-	unsigned char sigblob[SIGBLOB_LEN];
-	memset( sigblob, 0, SIGBLOB_LEN );
-	BN_bn2bin( sig->r, sigblob + SIGBLOB_LEN - INTBLOB_LEN - rlen );
-	BN_bn2bin( sig->s, sigblob + SIGBLOB_LEN - slen );
-	DSA_SIG_free( sig );
-
-	// ietf-drafts
-	Buffer b;
-	buffer_init( &b ) ;
-	buffer_put_cstring( &b, "italc-dss" );
-	buffer_put_string( &b, sigblob, SIGBLOB_LEN );
-
-	QByteArray final_sig( (const char *) buffer_ptr( &b ),
-							buffer_len( &b ) );
-	buffer_free( &b );
-
-	return final_sig;
-}
-
-
-
-
-bool PrivateDSAKey::load( const QString & _file, QString _passphrase )
-{
-	if( isValid() )
-	{
-		DSA_free( m_dsa );
-		m_dsa = NULL;
-	}
-
-	// QFile::handle() of Qt >= 4.3.0 returns -1 under win32
-//#if QT_VERSION < 0x040300 || !BUILD_WIN32
-	QFile infile( _file );
-	if( !QFileInfo( _file ).exists() || !infile.open( QFile::ReadOnly ) )
-	{
-		qCritical() << "PrivateDSAKey::load(): could not open file" << _file;
-		return false;
-	}
-	FILE * fp = fdopen( infile.handle(), "r" );
-/*#else
-	FILE * fp = fopen( _file.toAscii().constData(), "r" );
-#endif*/
-	if( fp == NULL )
-	{
-		qCritical( "PrivateDSAKey::load(): fdopen failed" );
-		return false;
-	}
-
-	EVP_PKEY * pk = PEM_read_PrivateKey( fp, NULL, NULL,
-						_passphrase.toAscii().data() );
-	if( pk == NULL )
-	{
-		qCritical( "PEM_read_PrivateKey failed" );
-		fclose( fp );
-		return false;
-	}
-	else if( pk->type == EVP_PKEY_DSA )
-	{
-		m_dsa = EVP_PKEY_get1_DSA( pk );
-	}
-	else
-	{
-		qCritical( "PEM_read_PrivateKey: mismatch or "
-			    "unknown EVP_PKEY save_type %d", pk->save_type );
-		EVP_PKEY_free( pk );
-		return false;
-	}
-	fclose( fp );
-	EVP_PKEY_free( pk );
-
-	return true;
-}
-
-
-
-
-bool PrivateDSAKey::save( const QString & _file, QString _passphrase ) const
-{
-	if( _passphrase.length() > 0 && _passphrase.length() <= 4 )
-	{
-		qWarning( "passphrase too short: need more than 4 bytes - "
-						"using empty passphrase now" );
-		_passphrase = QString::null;
-	}
-
-	LocalSystem::Path::ensurePathExists( QFileInfo( _file ).path() );
-
-	QFile outfile( _file );
-	if( outfile.exists() )
-	{
-		outfile.setPermissions( QFile::WriteOwner );
-		if( !outfile.remove() )
-		{
-			qCritical() << "PrivateDSAKey::save(): could not remove existing" << _file;
-			return false;
-		}
-	}
-	// QFile::handle() of Qt >= 4.3.0 returns -1 under win32
-//#if QT_VERSION < 0x040300 || !BUILD_WIN32
-	if( !outfile.open( QFile::WriteOnly | QFile::Truncate ) )
-	{
-		qCritical() << "PrivateDSAKey::save(): could not save private key in" << _file;
-		return false;
-	}
-	FILE * fp = fdopen( outfile.handle(), "w" );
-/*#else
-	FILE * fp = fopen( _file.toAscii().constData(), "w" );
-#endif*/
-	if( fp == NULL )
-	{
-		qCritical( "PrivateDSAKey::save(): fdopen failed" );
-		return false;
-	}
-
-	const EVP_CIPHER * cipher = _passphrase.isEmpty() ?
-						NULL : EVP_des_ede3_cbc();
-
-	PEM_write_DSAPrivateKey( fp, m_dsa, cipher, _passphrase.isEmpty() ?
-			NULL : (unsigned char *) _passphrase.toAscii().data(),
-					_passphrase.length(), NULL, NULL );
-	fclose( fp );
-	outfile.close();
-	outfile.setPermissions( QFile::ReadOwner | QFile::ReadUser | QFile::ReadGroup );
-
-	return true;
-}
-
-
-
-
-
-DSA * createNewDSA()
-{
-	DSA * dsa = DSA_new();
-	if( dsa == NULL )
-	{
-		qCritical( "createNewDSA(): DSA_new failed" );
-		return NULL;
-	}
-	if( ( dsa->p = BN_new() ) == NULL ||
-		( dsa->q = BN_new() ) == NULL ||
-		( dsa->g = BN_new() ) == NULL ||
-		( dsa->pub_key = BN_new() ) == NULL )
-	{
-		qCritical( "createNewDSA(): BN_new failed" );
-		return NULL;
-	}
-	return dsa;
-}
-
-
-
-
-DSA * keyFromBlob( const QByteArray & _ba )
-{
-	Buffer b;
-	DSA * dsa = NULL;
-
-	buffer_init( &b );
-	buffer_append( &b, _ba.constData(), _ba.size() );
-	char * ktype = (char*)buffer_get_string( &b, NULL );
-
-	if( strcmp(ktype, "dsa") == 0 || strcmp(ktype, "italc-dss" ) == 0 || strcmp(ktype, "ssh-dss" ) == 0 )
-	{
-		dsa = createNewDSA();
-		buffer_get_bignum2(&b, dsa->p);
-		buffer_get_bignum2(&b, dsa->q);
-		buffer_get_bignum2(&b, dsa->g);
-		buffer_get_bignum2(&b, dsa->pub_key);
-	}
-	else
-	{
-		qCritical( "keyFromBlob: cannot handle type %s", ktype );
-		return NULL;
-	}
-	//int rlen = buffer_len( &b );
-	//if(key != NULL && rlen != 0)
-	//	error("key_from_blob: remaining bytes in key blob %d", rlen);
-	delete[] ktype;
-	buffer_free( &b );
-	return dsa;
-}
-
-
-
-
-PublicDSAKey::PublicDSAKey( const PrivateDSAKey & _pk ) :
-	DsaKey( Public )
-{
-	if( !_pk.isValid() )
-	{
-		qCritical( "PublicDSAKey::PublicDSAKey(): invalid private key to derive from!" );
-	}
-	m_dsa = createNewDSA();
-	if( m_dsa != NULL )
-	{
-		BN_copy( m_dsa->p, _pk.dsaData()->p );
-		BN_copy( m_dsa->q, _pk.dsaData()->q );
-		BN_copy( m_dsa->g, _pk.dsaData()->g );
-		BN_copy( m_dsa->pub_key, _pk.dsaData()->pub_key );
-	}
-}
-
-
-
-
-bool PublicDSAKey::load( const QString & _file, QString )
-{
-	if( isValid() )
-	{
-		DSA_free( m_dsa );
-		m_dsa = NULL;
-	}
-
-	QFile infile( _file );
-	if( !QFileInfo( _file ).exists() || !infile.open( QFile::ReadOnly ) )
-	{
-		qCritical() << "PublicDSAKey::load(): could not open file" << _file;
-		return false;
-	}
-
-	QTextStream ts( &infile );
-	QString line;
-
-	while( !( line = ts.readLine() ).isNull() )
-	{
-		line = line.trimmed();
-		if( line[0] != '#' )
-		{
-			if( line.section( ' ', 0, 0 ) != "italc-dss" && line.section( ' ', 0, 0 ) != "ssh-dss")
-			{
-				qCritical( "PublicDSAKey::load(): missing keytype" );
-				continue;
-			}
-			m_dsa = keyFromBlob( QByteArray::fromBase64(
-					line.section( ' ', 1, 1 ).toAscii() ) );
-			if( m_dsa == NULL )
-			{
-				qCritical( "PublicDSAKey::load(): keyFromBlob failed" );
-				continue;
-			}
-			return true;
-		}
-	}
-
-	qCritical( "PublicDSAKey::load(): error while reading public key!" );
-
-	return false;
-}
-
-
-
-
-bool PublicDSAKey::save( const QString & _file, QString ) const
-{
-	if( !isValid() )
-	{
-		qCritical( "PublicDSAKey::save(): key not valid!" );
-		return false;
-	}
-
-	LocalSystem::Path::ensurePathExists( QFileInfo( _file ).path() );
-
-	QFile outfile( _file );
-	if( outfile.exists() )
-	{
-		outfile.setPermissions( QFile::WriteOwner );
-		if( !outfile.remove() )
-		{
-			qCritical() << "PublicDSAKey::save(): could remove existing file" << _file;
-			return false;
-		}
-	}
-	if( !outfile.open( QFile::WriteOnly | QFile::Truncate ) )
-	{
-		qCritical() << "PublicDSAKey::save(): could not save public key in" << _file;
-		return false;
-	}
-
-	Buffer b;
-	buffer_init( &b );
-	buffer_put_cstring( &b, "italc-dss" );
-	buffer_put_bignum2( &b, m_dsa->p );
-	buffer_put_bignum2( &b, m_dsa->q );
-	buffer_put_bignum2( &b, m_dsa->g );
-	buffer_put_bignum2( &b, m_dsa->pub_key );
-
-	char * p = (char *) buffer_ptr( &b );
-	const int len = buffer_len( &b );
-	QTextStream( &outfile ) << QString( "italc-dss %1" ).
-							arg( QString( QByteArray( p, len ).toBase64() ) );
-	memset( p, 0, len );
-	buffer_free( &b );
-	outfile.close();
-	outfile.setPermissions( QFile::ReadOwner | QFile::ReadUser |
-							QFile::ReadGroup | QFile::ReadOther );
-
-	return true;
-}
-
-
diff --git a/lib/src/FastQImage.cpp b/lib/src/FastQImage.cpp
deleted file mode 100644
index 0f092c3..0000000
--- a/lib/src/FastQImage.cpp
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- * FastQImage.cpp - class FastQImage providing fast inline-QImage-manips
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License aint with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include "FastQImage.h"
-
-// the following code has been taken from pygame-library and and modified
-// by Tobias Doerffel, 2008
-
-/*
-  pygame - Python Game Library
-  Copyright (C) 2000-2001  Pete Shinners
-  Copyright (C) 2007  Rene Dudfield, Richard Goedeken
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-
-  You should have received a copy of the GNU Library General Public
-  License along with this library; if not, write to the Free
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-  Pete Shinners
-  pete at shinners.org
-*/
-
-
-#define ALIGN_SIZE 16
-
-void aligned_free( void * _buf )
-{
-	if( _buf != NULL )
-	{
-		int *ptr2=(int *)_buf - 1;
-		_buf = (char *)_buf- *ptr2;
-		free(_buf);
-	}
-}
-
-
-
-
-void * aligned_malloc( uint32_t _bytes )
-{
-	char *ptr,*ptr2,*aligned_ptr;
-	int align_mask = ALIGN_SIZE- 1;
-	ptr=(char *)malloc(_bytes +ALIGN_SIZE+ sizeof(int));
-	if(ptr==NULL) return NULL;
-
-	ptr2 = ptr + sizeof(int);
-	aligned_ptr = ptr2 + (ALIGN_SIZE- ((size_t)ptr2 & align_mask));
-
-
-	ptr2 = aligned_ptr - sizeof(int);
-	*((int *)ptr2)=(int)(aligned_ptr - ptr);
-
-	return aligned_ptr;
-}
-
-
-
-/* this function implements an area-averaging shrinking filter in the X-dimension */
-static void filter_shrink_X_C(uint8_t *srcpix, uint8_t *dstpix, unsigned int height, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcwidth, unsigned int dstwidth)
-{
-    const unsigned int srcdiff = srcpitch - (srcwidth * 4);
-    const unsigned int dstdiff = dstpitch - (dstwidth * 4);
-
-    const unsigned int xspace = 0x10000 * srcwidth / dstwidth; /* must be > 1 */
-    const unsigned int xrecip = (int) ((long long) 0x100000000LL / xspace);
-    for (unsigned int y = 0; y < height; y++)
-    {
-        uint32_t accumulate[4] = {0,0,0,0};
-        unsigned int xcounter = xspace;
-        for (unsigned int x = 0; x < srcwidth; x++)
-        {
-            if (xcounter > 0x10000)
-            {
-                accumulate[0] += (uint32_t) *srcpix++;
-                accumulate[1] += (uint32_t) *srcpix++;
-                accumulate[2] += (uint32_t) *srcpix++;
-                accumulate[3] += (uint32_t) *srcpix++;
-                xcounter -= 0x10000;
-            }
-            else
-            {
-                /* write out a destination pixel */
-                *dstpix++ = (uint8_t) (((accumulate[0] + ((srcpix[0] * xcounter) >> 16)) * xrecip) >> 16);
-                *dstpix++ = (uint8_t) (((accumulate[1] + ((srcpix[1] * xcounter) >> 16)) * xrecip) >> 16);
-                *dstpix++ = (uint8_t) (((accumulate[2] + ((srcpix[2] * xcounter) >> 16)) * xrecip) >> 16);
-                *dstpix++ = (uint8_t) (((accumulate[3] + ((srcpix[3] * xcounter) >> 16)) * xrecip) >> 16);
-                /* reload the accumulator with the remainder of this pixel */
-                const unsigned int xfrac = 0x10000 - xcounter;
-                accumulate[0] = (uint32_t) ((*srcpix++ * xfrac) >> 16);
-                accumulate[1] = (uint32_t) ((*srcpix++ * xfrac) >> 16);
-                accumulate[2] = (uint32_t) ((*srcpix++ * xfrac) >> 16);
-                accumulate[3] = (uint32_t) ((*srcpix++ * xfrac) >> 16);
-                xcounter = xspace - xfrac;
-            }
-        }
-        srcpix += srcdiff;
-        dstpix += dstdiff;
-    }
-}
-
-/* this function implements an area-averaging shrinking filter in the Y-dimension */
-static void filter_shrink_Y_C(uint8_t *srcpix, uint8_t *dstpix, unsigned int width, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcheight, unsigned int dstheight)
-{
-    uint16_t *templine;
-    const unsigned int srcdiff = srcpitch - (width * 4);
-    const unsigned int dstdiff = dstpitch - (width * 4);
-
-    /* allocate and clear a memory area for storing the accumulator line */
-    templine = (uint16_t *) aligned_malloc(dstpitch * 2);
-    if (templine == NULL) return;
-    memset(templine, 0, dstpitch * 2);
-
-    const unsigned int yspace = 0x10000 * srcheight / dstheight; /* must be > 1 */
-    const unsigned int yrecip = (unsigned int) ((long long) 0x100000000LL / yspace);
-    unsigned int ycounter = yspace;
-    for (unsigned int y = 0; y < srcheight; y++)
-    {
-        uint16_t *accumulate = templine;
-        if (ycounter > 0x10000)
-        {
-            for (unsigned int x = 0; x < width; x++)
-            {
-                *accumulate++ += (uint16_t) *srcpix++;
-                *accumulate++ += (uint16_t) *srcpix++;
-                *accumulate++ += (uint16_t) *srcpix++;
-                *accumulate++ += (uint16_t) *srcpix++;
-            }
-            ycounter -= 0x10000;
-        }
-        else
-        {
-            /* write out a destination line */
-            for (unsigned int x = 0; x < width; x++)
-            {
-                *dstpix++ = (uint8_t) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-                *dstpix++ = (uint8_t) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-                *dstpix++ = (uint8_t) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-                *dstpix++ = (uint8_t) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-            }
-            dstpix += dstdiff;
-            /* reload the accumulator with the remainder of this line */
-            accumulate = templine;
-            srcpix -= 4 * width;
-            const unsigned int yfrac = 0x10000 - ycounter;
-            for (unsigned int x = 0; x < width; x++)
-            {
-                *accumulate++ = (uint16_t) ((*srcpix++ * yfrac) >> 16);
-                *accumulate++ = (uint16_t) ((*srcpix++ * yfrac) >> 16);
-                *accumulate++ = (uint16_t) ((*srcpix++ * yfrac) >> 16);
-                *accumulate++ = (uint16_t) ((*srcpix++ * yfrac) >> 16);
-            }
-            ycounter = yspace - yfrac;
-        }
-        srcpix += srcdiff;
-    } /* for (int y = 0; y < srcheight; y++) */
-
-    /* free the temporary memory */
-    aligned_free(templine);
-}
-
-
-/* this function implements a bilinear filter in the X-dimension */
-static void filter_expand_X_C(uint8_t *srcpix, uint8_t *dstpix, unsigned int height, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcwidth, unsigned int dstwidth)
-{
-    int dstdiff = dstpitch - (dstwidth * 4);
-    int *xidx0, *xmult0, *xmult1;
-    unsigned int x, y;
-
-    /* Allocate memory for factors */
-    xidx0 = (int*)aligned_malloc(dstwidth * 4);
-    if (xidx0 == NULL) return;
-    xmult0 = (int *) aligned_malloc(dstwidth * 4);
-    xmult1 = (int *) aligned_malloc(dstwidth * 4);
-    if (xmult0 == NULL || xmult1 == NULL)
-    {
-        aligned_free(xidx0);
-        if (xmult0) aligned_free(xmult0);
-        if (xmult1) aligned_free(xmult1);
-    }
-
-    /* Create multiplier factors and starting indices and put them in arrays */
-    for (x = 0; x < dstwidth; x++)
-    {
-        xidx0[x] = x * (srcwidth - 1) / dstwidth;
-        xmult1[x] = 0x10000 * ((x * (srcwidth - 1)) % dstwidth) / dstwidth;
-        xmult0[x] = 0x10000 - xmult1[x];
-    }
-
-    /* Do the scaling in raster order so we don't trash the cache */
-    for (y = 0; y < height; y++)
-    {
-        uint8_t *srcrow0 = srcpix + y * srcpitch;
-        for (x = 0; x < dstwidth; x++)
-        {
-            uint8_t *src = srcrow0 + xidx0[x] * 4;
-            int xm0 = xmult0[x];
-            int xm1 = xmult1[x];
-            *dstpix++ = (uint8_t) (((src[0] * xm0) + (src[4] * xm1)) >> 16);
-            *dstpix++ = (uint8_t) (((src[1] * xm0) + (src[5] * xm1)) >> 16);
-            *dstpix++ = (uint8_t) (((src[2] * xm0) + (src[6] * xm1)) >> 16);
-            *dstpix++ = (uint8_t) (((src[3] * xm0) + (src[7] * xm1)) >> 16);
-        }
-        dstpix += dstdiff;
-    }
-
-    /* free memory */
-    aligned_free(xidx0);
-    aligned_free(xmult0);
-    aligned_free(xmult1);
-}
-
-/* this function implements a bilinear filter in the Y-dimension */
-static void filter_expand_Y_C(uint8_t *srcpix, uint8_t *dstpix, unsigned int width, int unsigned srcpitch, unsigned int/* dstpitch*/, unsigned int srcheight, unsigned int dstheight)
-{
-    for (unsigned int y = 0; y < dstheight; y++)
-    {
-        const unsigned int yidx0 = y * (srcheight - 1) / dstheight;
-        uint8_t *srcrow0 = srcpix + yidx0 * srcpitch;
-        uint8_t *srcrow1 = srcrow0 + srcpitch;
-        unsigned int ymult1 = 0x10000 * ((y * (srcheight - 1)) % dstheight) / dstheight;
-        unsigned int ymult0 = 0x10000 - ymult1;
-        for (unsigned int x = 0; x < width; x++)
-        {
-            *dstpix++ = (uint8_t) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-            *dstpix++ = (uint8_t) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-            *dstpix++ = (uint8_t) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-            *dstpix++ = (uint8_t) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-        }
-    }
-}
-
-
-#if defined(__GNUC__) && defined(__i386__) /* || defined(__x86_64__))*/
-#define USE_MMX
-#endif
-
-#ifdef USE_MMX
-
-/* this function implements an area-averaging shrinking filter in the X-dimension */
-static void filter_shrink_X_MMX(uint8_t *srcpix, uint8_t *dstpix, unsigned int height, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcwidth, unsigned int dstwidth)
-{
-    const unsigned int srcdiff = srcpitch - (srcwidth * 4);
-    const unsigned int dstdiff = dstpitch - (dstwidth * 4);
-
-#if defined(__x86_64__)
-    const unsigned int xspace = 0x04000 * srcwidth / dstwidth; /* must be > 1 */
-    const unsigned int xrecip = (int) ((long long) 0x040000000 / xspace);
-    long long srcdiff64 = srcdiff;
-    long long dstdiff64 = dstdiff;
-    long long One64 = 0x4000400040004000LL;
-    asm(" /* MMX code for X-shrink area average filter */ "
-        " pxor          %%mm0,      %%mm0;           "
-        " movd             %6,      %%mm7;           " /* mm7 == xrecipmmx */
-        " movq             %2,      %%mm6;           " /* mm6 = 2^14  */
-        " pshufw    $0, %%mm7,      %%mm7;           "
-        "1:                                          " /* outer Y-loop */
-        " movl             %5,      %%ecx;           " /* ecx == xcounter */
-        " pxor          %%mm1,      %%mm1;           " /* mm1 == accumulator */
-        " movl             %4,      %%edx;           " /* edx == width */
-        "2:                                          " /* inner X-loop */
-        " cmpl        $0x4000,      %%ecx;           "
-        " jbe              3f;                       "
-        " movd           (%0),      %%mm2;           " /* mm2 = srcpix */
-        " add              $4,         %0;           "
-        " punpcklbw     %%mm0,      %%mm2;           "
-        " paddw         %%mm2,      %%mm1;           " /* accumulator += srcpix */
-        " subl        $0x4000,      %%ecx;           "
-        " jmp              4f;                       "
-        "3:                                          " /* prepare to output a pixel */
-        " movd          %%ecx,      %%mm2;           "
-        " movq          %%mm6,      %%mm3;           " /* mm3 = 2^14  */
-        " pshufw    $0, %%mm2,      %%mm2;           "
-        " movd           (%0),      %%mm4;           " /* mm4 = srcpix */
-        " add              $4,         %0;           "
-        " punpcklbw     %%mm0,      %%mm4;           "
-        " psubw         %%mm2,      %%mm3;           " /* mm3 = xfrac */
-        " psllw            $2,      %%mm4;           "
-        " pmulhuw       %%mm4,      %%mm2;           " /* mm2 = (srcpix * xcounter >> 16) */
-        " pmulhuw       %%mm4,      %%mm3;           " /* mm3 = (srcpix * xfrac) >> 16 */
-        " paddw         %%mm1,      %%mm2;           "
-        " movq          %%mm3,      %%mm1;           " /* accumulator = (srcpix * xfrac) >> 16 */
-        " pmulhuw       %%mm7,      %%mm2;           "
-        " packuswb      %%mm0,      %%mm2;           "
-        " movd          %%mm2,       (%1);           "
-        " add              %5,      %%ecx;           "
-        " add              $4,         %1;           "
-        " subl        $0x4000,      %%ecx;           "
-        "4:                                          " /* tail of inner X-loop */
-        " decl          %%edx;                       "
-        " jne              2b;                       "
-        " add              %7,         %0;           " /* srcpix += srcdiff */
-        " add              %8,         %1;           " /* dstpix += dstdiff */
-        " decl             %3;                       "
-        " jne              1b;                       "
-        " emms;                                      "
-        :                   /* no outputs */
-        : "r"(srcpix), "r"(dstpix), "m"(One64),     "m"(height),   "m"(srcwidth),
-          "m"(xspace), "m"(xrecip), "m"(srcdiff64), "m"(dstdiff64)                /* input */
-        : "%ecx","%edx"     /* clobbered */
-        );
-#elif defined(__i386__)
-    const unsigned int xspace = 0x04000 * srcwidth / dstwidth; /* must be > 1 */
-    const unsigned int xrecip = (int) ((long long) 0x040000000 / xspace);
-    long long One64 = 0x4000400040004000LL;
-
-    asm(" /* MMX code for X-shrink area average filter */ "
-        " pxor          %%mm0,      %%mm0;           "
-        " movd             %6,      %%mm7;           " /* mm7 == xrecipmmx */
-        " movq             %2,      %%mm6;           " /* mm6 = 2^14  */
-        " pshufw    $0, %%mm7,      %%mm7;           "
-        "1:                                          " /* outer Y-loop */
-        " movl             %5,      %%ecx;           " /* ecx == xcounter */
-        " pxor          %%mm1,      %%mm1;           " /* mm1 == accumulator */
-        " movl             %4,      %%edx;           " /* edx == width */
-        "2:                                          " /* inner X-loop */
-        " cmpl        $0x4000,      %%ecx;           "
-        " jbe              3f;                       "
-        " movd           (%0),      %%mm2;           " /* mm2 = srcpix */
-        " add              $4,         %0;           "
-        " punpcklbw     %%mm0,      %%mm2;           "
-        " paddw         %%mm2,      %%mm1;           " /* accumulator += srcpix */
-        " subl        $0x4000,      %%ecx;           "
-        " jmp              4f;                       "
-        "3:                                          " /* prepare to output a pixel */
-        " movd          %%ecx,      %%mm2;           "
-        " movq          %%mm6,      %%mm3;           " /* mm3 = 2^14  */
-        " pshufw    $0, %%mm2,      %%mm2;           "
-        " movd           (%0),      %%mm4;           " /* mm4 = srcpix */
-        " add              $4,         %0;           "
-        " punpcklbw     %%mm0,      %%mm4;           "
-        " psubw         %%mm2,      %%mm3;           " /* mm3 = xfrac */
-        " psllw            $2,      %%mm4;           "
-        " pmulhuw       %%mm4,      %%mm2;           " /* mm2 = (srcpix * xcounter >> 16) */
-        " pmulhuw       %%mm4,      %%mm3;           " /* mm3 = (srcpix * xfrac) >> 16 */
-        " paddw         %%mm1,      %%mm2;           "
-        " movq          %%mm3,      %%mm1;           " /* accumulator = (srcpix * xfrac) >> 16 */
-        " pmulhuw       %%mm7,      %%mm2;           "
-        " packuswb      %%mm0,      %%mm2;           "
-        " movd          %%mm2,       (%1);           "
-        " add              %5,      %%ecx;           "
-        " add              $4,         %1;           "
-        " subl        $0x4000,      %%ecx;           "
-        "4:                                          " /* tail of inner X-loop */
-        " decl          %%edx;                       "
-        " jne              2b;                       "
-        " add              %7,         %0;           " /* srcpix += srcdiff */
-        " add              %8,         %1;           " /* dstpix += dstdiff */
-        " decl             %3;                       "
-        " jne              1b;                       "
-        :                   /* no outputs */
-        : "S"(srcpix), "D"(dstpix), "m"(One64),     "m"(height),   "m"(srcwidth),
-          "m"(xspace), "m"(xrecip), "m"(srcdiff),   "m"(dstdiff)                  /* input */
-        : "%ecx","%edx"     /* clobbered */
-        );
-        asm(" emms;                                      "
-            :
-            :
-            : "%esi", "%edi");
-#endif
-}
-
-/* this function implements an area-averaging shrinking filter in the Y-dimension */
-static void filter_shrink_Y_MMX(uint8_t *srcpix, uint8_t *dstpix, unsigned int width, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcheight, unsigned int dstheight)
-{
-    uint16_t *templine;
-    int srcdiff = srcpitch - (width * 4);
-    int dstdiff = dstpitch - (width * 4);
-
-    /* allocate and clear a memory area for storing the accumulator line */
-    templine = (uint16_t *) aligned_malloc(dstpitch * 2);
-    if (templine == NULL) return;
-    memset(templine, 0, dstpitch * 2);
-
-#if defined(__x86_64__)
-    int yspace = 0x4000 * srcheight / dstheight; /* must be > 1 */
-    int yrecip = (int) ((long long) 0x040000000 / yspace);
-    long long srcdiff64 = srcdiff;
-    long long dstdiff64 = dstdiff;
-    long long One64 = 0x4000400040004000LL;
-    asm(" /* MMX code for Y-shrink area average filter */ "
-        " movl             %5,      %%ecx;           " /* ecx == ycounter */
-        " pxor          %%mm0,      %%mm0;           "
-        " movd             %6,      %%mm7;           " /* mm7 == yrecipmmx */
-        " pshufw    $0, %%mm7,      %%mm7;           "
-        "1:                                          " /* outer Y-loop */
-        " mov              %2,      %%rax;           " /* rax == accumulate */
-        " cmpl        $0x4000,      %%ecx;           "
-        " jbe              3f;                       "
-        " movl             %4,      %%edx;           " /* edx == width */
-        "2:                                          "
-        " movd           (%0),      %%mm1;           "
-        " add              $4,         %0;           "
-        " movq        (%%rax),      %%mm2;           "
-        " punpcklbw     %%mm0,      %%mm1;           "
-        " paddw         %%mm1,      %%mm2;           "
-        " movq          %%mm2,    (%%rax);           "
-        " add              $8,      %%rax;           "
-        " decl          %%edx;                       "
-        " jne              2b;                       "
-        " subl        $0x4000,      %%ecx;           "
-        " jmp              6f;                       "
-        "3:                                          " /* prepare to output a line */
-        " movd          %%ecx,      %%mm1;           "
-        " movl             %4,      %%edx;           " /* edx = width */
-        " movq             %9,      %%mm6;           " /* mm6 = 2^14  */
-        " pshufw    $0, %%mm1,      %%mm1;           "
-        " psubw         %%mm1,      %%mm6;           " /* mm6 = yfrac */
-        "4:                                          "
-        " movd           (%0),      %%mm4;           " /* mm4 = srcpix */
-        " add              $4,         %0;           "
-        " punpcklbw     %%mm0,      %%mm4;           "
-        " movq        (%%rax),      %%mm5;           " /* mm5 = accumulate */
-        " movq          %%mm6,      %%mm3;           "
-        " psllw            $2,      %%mm4;           "
-        " pmulhuw       %%mm4,      %%mm3;           " /* mm3 = (srcpix * yfrac) >> 16 */
-        " pmulhuw       %%mm1,      %%mm4;           " /* mm4 = (srcpix * ycounter >> 16) */
-        " movq          %%mm3,    (%%rax);           "
-        " paddw         %%mm5,      %%mm4;           "
-        " add              $8,      %%rax;           "
-        " pmulhuw       %%mm7,      %%mm4;           "
-        " packuswb      %%mm0,      %%mm4;           "
-        " movd          %%mm4,       (%1);           "
-        " add              $4,         %1;           "
-        " decl          %%edx;                       "
-        " jne              4b;                       "
-        " add              %8,         %1;           " /* dstpix += dstdiff */
-        " addl             %5,      %%ecx;           "
-        " subl        $0x4000,      %%ecx;           "
-        "6:                                          " /* tail of outer Y-loop */
-        " add              %7,         %0;           " /* srcpix += srcdiff */
-        " decl             %3;                       "
-        " jne              1b;                       "
-        " emms;                                      "
-        :                   /* no outputs */
-        : "r"(srcpix), "r"(dstpix), "m"(templine),  "m"(srcheight), "m"(width),
-          "m"(yspace), "m"(yrecip), "m"(srcdiff64), "m"(dstdiff64), "m"(One64)  /* input */
-        : "%ecx","%edx","%rax"     /* clobbered */
-        );
-#elif defined(__i386__)
-    int yspace = 0x4000 * srcheight / dstheight; /* must be > 1 */
-    int yrecip = (int) ((long long) 0x040000000 / yspace);
-    long long One64 = 0x4000400040004000LL;
-    asm(" /* MMX code for Y-shrink area average filter */ "
-        " movl             %5,      %%ecx;           " /* ecx == ycounter */
-        " pxor          %%mm0,      %%mm0;           "
-        " movd             %6,      %%mm7;           " /* mm7 == yrecipmmx */
-        " pshufw    $0, %%mm7,      %%mm7;           "
-        "1:                                          " /* outer Y-loop */
-        " movl             %2,      %%eax;           " /* rax == accumulate */
-        " cmpl        $0x4000,      %%ecx;           "
-        " jbe              3f;                       "
-        " movl             %4,      %%edx;           " /* edx == width */
-        "2:                                          "
-        " movd           (%0),      %%mm1;           "
-        " add              $4,         %0;           "
-        " movq        (%%eax),      %%mm2;           "
-        " punpcklbw     %%mm0,      %%mm1;           "
-        " paddw         %%mm1,      %%mm2;           "
-        " movq          %%mm2,    (%%eax);           "
-        " add              $8,      %%eax;           "
-        " decl          %%edx;                       "
-        " jne              2b;                       "
-        " subl        $0x4000,      %%ecx;           "
-        " jmp              6f;                       "
-        "3:                                          " /* prepare to output a line */
-        " movd          %%ecx,      %%mm1;           "
-        " movl             %4,      %%edx;           " /* edx = width */
-        " movq             %9,      %%mm6;           " /* mm6 = 2^14  */
-        " pshufw    $0, %%mm1,      %%mm1;           "
-        " psubw         %%mm1,      %%mm6;           " /* mm6 = yfrac */
-        "4:                                          "
-        " movd           (%0),      %%mm4;           " /* mm4 = srcpix */
-        " add              $4,         %0;           "
-        " punpcklbw     %%mm0,      %%mm4;           "
-        " movq        (%%eax),      %%mm5;           " /* mm5 = accumulate */
-        " movq          %%mm6,      %%mm3;           "
-        " psllw            $2,      %%mm4;           "
-        " pmulhuw       %%mm4,      %%mm3;           " /* mm3 = (srcpix * yfrac) >> 16 */
-        " pmulhuw       %%mm1,      %%mm4;           " /* mm4 = (srcpix * ycounter >> 16) */
-        " movq          %%mm3,    (%%eax);           "
-        " paddw         %%mm5,      %%mm4;           "
-        " add              $8,      %%eax;           "
-        " pmulhuw       %%mm7,      %%mm4;           "
-        " packuswb      %%mm0,      %%mm4;           "
-        " movd          %%mm4,       (%1);           "
-        " add              $4,         %1;           "
-        " decl          %%edx;                       "
-        " jne              4b;                       "
-        " add              %8,         %1;           " /* dstpix += dstdiff */
-        " addl             %5,      %%ecx;           "
-        " subl        $0x4000,      %%ecx;           "
-        "6:                                          " /* tail of outer Y-loop */
-        " add              %7,         %0;           " /* srcpix += srcdiff */
-        " decl             %3;                       "
-        " jne              1b;                       "
-        " emms;                                      "
-        :                   /* no outputs */
-        : "S"(srcpix), "D"(dstpix), "m"(templine),  "m"(srcheight), "m"(width),
-          "m"(yspace), "m"(yrecip), "m"(srcdiff),   "m"(dstdiff),   "m"(One64)  /* input */
-        : "%ecx","%edx","%rax"     /* clobbered */
-        );
-        asm(" emms;                                      "
-            :
-            :
-            : "%esi", "%edi");
-#endif
-    /* free the temporary memory */
-    aligned_free(templine);
-}
-
-
-/* this function implements a bilinear filter in the X-dimension */
-static void filter_expand_X_MMX(uint8_t *srcpix, uint8_t *dstpix, unsigned int height, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcwidth, unsigned int dstwidth)
-{
-    int *xidx0, *xmult0, *xmult1;
-    unsigned int x, y;
-
-    /* Allocate memory for factors */
-    xidx0 = (int*)aligned_malloc(dstwidth * 4);
-    if (xidx0 == NULL) return;
-    xmult0 = (int *) aligned_malloc(dstwidth * 8);
-    xmult1 = (int *) aligned_malloc(dstwidth * 8);
-    if (xmult0 == NULL || xmult1 == NULL)
-    {
-        aligned_free(xidx0);
-        if (xmult0) aligned_free(xmult0);
-        if (xmult1) aligned_free(xmult1);
-    }
-
-    /* Create multiplier factors and starting indices and put them in arrays */
-    for (x = 0; x < dstwidth; x++)
-    {
-        xidx0[x] = x * (srcwidth - 1) / dstwidth;
-        const unsigned int xm1 = 0x100 * ((x * (srcwidth - 1)) % dstwidth) / dstwidth;
-        const unsigned int xm0 = 0x100 - xm1;
-        xmult1[x*2]   = xm1 | (xm1 << 16);
-        xmult1[x*2+1] = xm1 | (xm1 << 16);
-        xmult0[x*2]   = xm0 | (xm0 << 16);
-        xmult0[x*2+1] = xm0 | (xm0 << 16);
-    }
-
-    /* Do the scaling in raster order so we don't trash the cache */
-    for (y = 0; y < height; y++)
-    {
-        uint8_t *srcrow0 = srcpix + y * srcpitch;
-        uint8_t *dstrow = dstpix + y * dstpitch;
-        int *xm0 = xmult0;
-        int *x0 = xidx0;
-#if defined(__x86_64__)
-        int *xm1 = xmult1;
-        asm( " /* MMX code for inner loop of Y bilinear filter */ "
-             " movl             %3,      %%ecx;           "
-             " pxor          %%mm0,      %%mm0;           "
-             "1:                                          "
-             " movsxl         (%5),      %%rax;           " /* get xidx0[x] */
-             " add              $4,         %5;           "
-             " movq           (%1),      %%mm1;           " /* load mult0 */
-             " add              $8,         %1;           "
-             " movq           (%2),      %%mm2;           " /* load mult1 */
-             " add              $8,         %2;           "
-             " movd   (%0,%%rax,4),      %%mm4;           "
-             " movd  4(%0,%%rax,4),      %%mm5;           "
-             " punpcklbw     %%mm0,      %%mm4;           "
-             " punpcklbw     %%mm0,      %%mm5;           "
-             " pmullw        %%mm1,      %%mm4;           "
-             " pmullw        %%mm2,      %%mm5;           "
-             " paddw         %%mm4,      %%mm5;           "
-             " psrlw            $8,      %%mm5;           "
-             " packuswb      %%mm0,      %%mm5;           "
-             " movd          %%mm5,       (%4);           "
-             " add              $4,         %4;           "
-             " decl          %%ecx;                       "
-             " jne              1b;                       "
-             " emms;                                      "
-             :                   /* no outputs */
-             : "r"(srcrow0), "r"(xm0), "r"(xm1), "m"(dstwidth), "r"(dstrow), "r"(x0)  /* input */
-             : "%ecx","%rax"     /* clobbered */
-             );
-#elif defined(__i386__)
-	int width = dstwidth;
-	long long One64 = 0x0100010001000100LL;
-        asm( " /* MMX code for inner loop of Y bilinear filter */ "
-             " pxor          %%mm0,      %%mm0;           "
-             " movq             %2,      %%mm7;           "
-             "1:                                          "
-             " movl           (%5),      %%eax;           " /* get xidx0[x] */
-             " add              $4,         %5;           "
-             " movq          %%mm7,      %%mm2;           "
-             " movq           (%1),      %%mm1;           " /* load mult0 */
-             " add              $8,         %1;           "
-             " psubw         %%mm1,      %%mm2;           " /* load mult1 */
-             " movd   (%0,%%eax,4),      %%mm4;           "
-             " movd  4(%0,%%eax,4),      %%mm5;           "
-             " punpcklbw     %%mm0,      %%mm4;           "
-             " punpcklbw     %%mm0,      %%mm5;           "
-             " pmullw        %%mm1,      %%mm4;           "
-             " pmullw        %%mm2,      %%mm5;           "
-             " paddw         %%mm4,      %%mm5;           "
-             " psrlw            $8,      %%mm5;           "
-             " packuswb      %%mm0,      %%mm5;           "
-             " movd          %%mm5,       (%4);           "
-             " add              $4,         %4;           "
-             " decl             %3;                       "
-             " jne              1b;                       "
-             :                   /* no outputs */
-             : "S"(srcrow0), "c"(xm0), "m"(One64), "m"(width), "D"(dstrow), "d"(x0)  /* input */
-             : "%eax"     /* clobbered */
-             );
-        asm(" emms;                                      "
-            :
-            :
-            : "%ecx", "%esi", "%edi", "%edx");
-#endif
-    }
-
-    /* free memory */
-    aligned_free(xidx0);
-    aligned_free(xmult0);
-    aligned_free(xmult1);
-}
-
-/* this function implements a bilinear filter in the Y-dimension */
-static void filter_expand_Y_MMX(uint8_t *srcpix, uint8_t *dstpix, unsigned int width, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcheight, unsigned int dstheight)
-{
-    for (unsigned int y = 0; y < dstheight; y++)
-    {
-        int yidx0 = y * (srcheight - 1) / dstheight;
-        uint8_t *srcrow0 = srcpix + yidx0 * srcpitch;
-        uint8_t *srcrow1 = srcrow0 + srcpitch;
-        int ymult1 = 0x0100 * ((y * (srcheight - 1)) % dstheight) / dstheight;
-        int ymult0 = 0x0100 - ymult1;
-        uint8_t *dstrow = dstpix + y * dstpitch;
-#if defined(__x86_64__)
-        asm( " /* MMX code for inner loop of Y bilinear filter */ "
-             " movl          %4,      %%ecx;                      "
-             " movd          %2,      %%mm1;                      "
-             " movd          %3,      %%mm2;                      "
-             " pxor       %%mm0,      %%mm0;                      "
-             " pshufw      $0, %%mm1, %%mm1;                      "
-             " pshufw      $0, %%mm2, %%mm2;                      "
-             "1:                                                  "
-             " movd        (%0),      %%mm4;                      "
-             " add           $4,         %0;                      "
-             " movd        (%1),      %%mm5;                      "
-             " add           $4,         %1;                      "
-             " punpcklbw  %%mm0,     %%mm4;                       "
-             " punpcklbw  %%mm0,     %%mm5;                       "
-             " pmullw     %%mm1,     %%mm4;                       "
-             " pmullw     %%mm2,     %%mm5;                       "
-             " paddw      %%mm4,     %%mm5;                       "
-             " psrlw         $8,     %%mm5;                       "
-             " packuswb   %%mm0,     %%mm5;                       "
-             " movd       %%mm5,      (%5);                       "
-             " add           $4,        %5;                       "
-             " decl       %%ecx;                                  "
-             " jne           1b;                                  "
-             " emms;                                              "
-             :                /* no outputs */
-             : "r"(srcrow0), "r"(srcrow1), "m"(ymult0), "m"(ymult1), "m"(width), "r"(dstrow)  /* input */
-             : "%ecx"         /* clobbered */
-             );
-#elif defined(__i386__)
-        asm( " /* MMX code for inner loop of Y bilinear filter */ "
-             " movl          %4,      %%eax;                      "
-             " movd          %2,      %%mm1;                      "
-             " movd          %3,      %%mm2;                      "
-             " pxor       %%mm0,      %%mm0;                      "
-             " pshufw      $0, %%mm1, %%mm1;                      "
-             " pshufw      $0, %%mm2, %%mm2;                      "
-             "1:                                                  "
-             " movd        (%0),      %%mm4;                      "
-             " add           $4,         %0;                      "
-             " movd        (%1),      %%mm5;                      "
-             " add           $4,         %1;                      "
-             " punpcklbw  %%mm0,     %%mm4;                       "
-             " punpcklbw  %%mm0,     %%mm5;                       "
-             " pmullw     %%mm1,     %%mm4;                       "
-             " pmullw     %%mm2,     %%mm5;                       "
-             " paddw      %%mm4,     %%mm5;                       "
-             " psrlw         $8,     %%mm5;                       "
-             " packuswb   %%mm0,     %%mm5;                       "
-             " movd       %%mm5,      (%5);                       "
-             " add           $4,        %5;                       "
-             " decl       %%eax;                                  "
-             " jne           1b;                                  "
-             :                /* no outputs */
-             : "S"(srcrow0), "c"(srcrow1), "m"(ymult0), "m"(ymult1), "m"(width), "D"(dstrow)  /* input */
-             : "%eax"         /* clobbered */
-             );
-        asm(" emms;                                      "
-            :
-            :
-            : "%esi", "%edi", "%ecx");
-#endif
-    }
-}
-#endif
-
-
-typedef void (*filter_fn)(uint8_t*, uint8_t*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
-
-static filter_fn filter_shrink_X = filter_shrink_X_C;
-static filter_fn filter_shrink_Y = filter_shrink_Y_C;
-static filter_fn filter_expand_X = filter_expand_X_C;
-static filter_fn filter_expand_Y = filter_expand_Y_C;
-
-QImage & FastQImage::scaleTo( QImage & _dst ) const
-{
-	if( size() == _dst.size() )
-	{
-		return _dst = *this;
-	}
-	if( !_dst.size().isValid() )
-	{
-		return _dst = QImage();
-	}
-	if( format() == Format_Invalid )
-	{
-		return _dst;
-	}
-	if( format() != Format_ARGB32 && format() != Format_RGB32 &&
-				format() != Format_ARGB32_Premultiplied )
-	{
-		qWarning( "FastQImage::scaleTo(...): converting source-image "
-							"to Format_ARGB32" );
-		return FastQImage( convertToFormat( Format_ARGB32 ) ).
-							scaleTo( _dst );
-	}
-
-#ifdef USE_MMX
-#if !defined(__x86_64__)
-	static bool MMX_checked = false;
-	if( MMX_checked == false )
-	{
-		int features = 0;
-		asm(	"pushl	%%ebx;		\n"
-			"mov	$1,%%eax;	\n"
-			"cpuid;			\n"
-			"popl	%%ebx;		\n"
-			: "=d"( features ) : : "%eax", "%ecx" );
-		if( features & 0x00800000 )
-		{
-#endif
-			filter_shrink_X = filter_shrink_X_MMX;
-			filter_shrink_Y = filter_shrink_Y_MMX;
-			filter_expand_X = filter_expand_X_MMX;
-			filter_expand_Y = filter_expand_Y_MMX;
-#if !defined(__x86_64__)
-		}
-
-		MMX_checked = true;
-	}
-#endif
-#endif
-	uint8_t* srcpix = (uint8_t*)bits();
-	uint8_t* dstpix = (uint8_t*)_dst.bits();
-	int srcpitch = width()*4;
-	int dstpitch = _dst.width()*4;
-
-	const int srcwidth = width();
-	const int srcheight = height();
-	const int dstwidth = _dst.width();
-	const int dstheight = _dst.height();
-
-	// Create a temporary processing buffer if we will be scaling both X and Y
-	uint8_t *temppix = NULL;
-	int tempwidth=0, temppitch=0, tempheight=0;
-	if (srcwidth != dstwidth && srcheight != dstheight)
-	{
-		tempwidth = dstwidth;
-		temppitch = tempwidth << 2;
-		tempheight = srcheight;
-		temppix = (uint8_t *) aligned_malloc(temppitch * tempheight);
-		if (temppix == NULL)
-		{
-			return _dst;
-		}
-	}
-
-	/* Start the filter by doing X-scaling */
-	if (dstwidth < srcwidth) /* shrink */
-	{
-		if (srcheight != dstheight)
-		{
-		    filter_shrink_X(srcpix, temppix, srcheight, srcpitch, temppitch, srcwidth, dstwidth);
-		}
-		else
-		{
-		    filter_shrink_X(srcpix, dstpix, srcheight, srcpitch, dstpitch, srcwidth, dstwidth);
-		}
-	}
-	else if (dstwidth > srcwidth) /* expand */
-	{
-		if (srcheight != dstheight)
-		{
-		    filter_expand_X(srcpix, temppix, srcheight, srcpitch, temppitch, srcwidth, dstwidth);
-		}
-		else
-		{
-		    filter_expand_X(srcpix, dstpix, srcheight, srcpitch, dstpitch, srcwidth, dstwidth);
-		}
-	}
-
-	/* Now do the Y scale */
-	if (dstheight < srcheight) /* shrink */
-	{
-		if (srcwidth != dstwidth)
-		{
-		    filter_shrink_Y(temppix, dstpix, tempwidth, temppitch, dstpitch, srcheight, dstheight);
-		}
-		else
-		{
-		    filter_shrink_Y(srcpix, dstpix, srcwidth, srcpitch, dstpitch, srcheight, dstheight);
-		}
-	}
-	else if (dstheight > srcheight)  /* expand */
-	{
-		if (srcwidth != dstwidth)
-		{
-		    filter_expand_Y(temppix, dstpix, tempwidth, temppitch, dstpitch, srcheight, dstheight);
-		}
-		else
-		{
-		    filter_expand_Y(srcpix, dstpix, srcwidth, srcpitch, dstpitch, srcheight, dstheight);
-		}
-	}
-
-	aligned_free( temppix );
-
-	return _dst;
-}
-
-
diff --git a/lib/src/Inject.cpp b/lib/src/Inject.cpp
deleted file mode 100644
index 6884cd8..0000000
--- a/lib/src/Inject.cpp
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * Inject.cpp - functions for injecting code into winlogon.exe for disabling
- *              SAS (Alt+Ctrl+Del)
- *
- * Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include "Inject.h"
-#include "LocalSystem.h"
-
-#ifdef ITALC_BUILD_WIN32
-
-#include <ctype.h>
-#include <windows.h>
-#include <tlhelp32.h>
-
-
-
-DWORD GetPIDFromName( char *szProcessName )
-{
-	typedef HANDLE (WINAPI *CREATESNAPSHOT) (DWORD, DWORD);
-	typedef BOOL   (WINAPI *PROCESSWALK)    (HANDLE, LPPROCESSENTRY32);
-
-	HINSTANCE       hKernel;
-	CREATESNAPSHOT  CreateToolhelp32Snapshot;
-	PROCESSWALK     Process32First;
-	PROCESSWALK     Process32Next;
-
-	HANDLE          hSnapshot;
-	PROCESSENTRY32  pe32;
-	BOOL            bRes;
-	char            *p;
-	DWORD           dwPID = -1;
-
-	// Check szProcessName
-	if( !szProcessName )
-		return -1;
-
-	// Get Kernel32 handle
-	if( !( hKernel = GetModuleHandle( "Kernel32.dll" ) ) )
-		return -1;
-
-	// We must link to these functions explicitly.
-	// Otherwise it will fail on Windows NT which doesn't have Toolhelp
-	// functions defined in Kernel32.
-	CreateToolhelp32Snapshot = (CREATESNAPSHOT) GetProcAddress( hKernel,
-						"CreateToolhelp32Snapshot" );
-	Process32First = (PROCESSWALK) GetProcAddress( hKernel,
-							"Process32First" );
-	Process32Next = (PROCESSWALK) GetProcAddress( hKernel,
-							"Process32Next" );
-	if (!CreateToolhelp32Snapshot || !Process32First || !Process32Next)
-	{
-		FreeLibrary( hKernel );
-		SetLastError( ERROR_PROC_NOT_FOUND );
-		return -1;
-	}
-
-	hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
-	if( hSnapshot == INVALID_HANDLE_VALUE )
-		return -1;
-
-	pe32.dwSize = sizeof( pe32 );
-	bRes = Process32First( hSnapshot, &pe32 );
-
-	while( bRes )
-	{
-		// Strip off full path
-		p = strrchr( pe32.szExeFile, '\\' );
-		if( p )
-		{
-			p++;
-		}
-		else
-		{
-			p = pe32.szExeFile;
-		}
-
-		for( char * ptr = p; *ptr; ++ptr )
-		{
-			*ptr = tolower( *ptr );
-		}
-		// Process found ?
-		if( strcmp( p, szProcessName ) == 0 )
-		{
-			dwPID = pe32.th32ProcessID;
-			break;
-		}
-
-		bRes = Process32Next( hSnapshot, &pe32 );
-	}
-
-	CloseHandle( hSnapshot );
-	return dwPID;
-}
-
-
-
-
-
-extern		HINSTANCE	hInst;			// Instance handle
-char		szProcessName[] = "winlogon.exe";	// Process to inject
-
-
-// Global variables
-DWORD	PID;			// PID of injected process
-BYTE	*pDataRemote;		// Address of INJDATA in the remote process
-BYTE	*pSASWinProcRemote;	// The address of SASWindowProc() in the
-				// remote process
-
-#define	DUMMY_ADDR	0x12345678		// Dummy addr of INJDATA
-
-// INJDATA: Memory block passed to each remote injected function.
-// We pass every function address or string data in this block.
-typedef LONG	(WINAPI *SETWINDOWLONG)	  (HWND, int, LONG);
-typedef LONG_PTR	(WINAPI *SETWINDOWLONGPTR)	  (HWND, int, LONG_PTR);
-typedef LRESULT	(WINAPI *CALLWINDOWPROC)  (WNDPROC, HWND, UINT, WPARAM, LPARAM);
-typedef HWND	(WINAPI *FINDWINDOW)	  (LPCTSTR, LPCTSTR);
-
-typedef struct
-{
-#ifdef _WIN64
-	SETWINDOWLONGPTR	fnSetWindowLongPtr;// Addr. of SetWindowLongPtr()
-#else
-	SETWINDOWLONG	fnSetWindowLong;// Addr. of SetWindowLongPtr()
-#endif
-	CALLWINDOWPROC	fnCallWindowProc;// Addr. of CallWindowProc()
-	FINDWINDOW	fnFindWindow;	// Addr. of FindWindow()
-	char		szClassName[50];// Class name = "SAS Window class"
-	char		szWindowName[50];// Window name = "SAS window"
-	HWND		hwnd;		// Window handle of injected process
-	WNDPROC		fnSASWndProc;	// Addr. of remote SASWindowProc
-	WNDPROC 	fnOldSASWndProc;// Addr. of old SASWindowProc
-} INJDATA, *PINJDATA;
-
-
-/*****************************************************************
- * Subclassed window procedure handler for the injected process. *
- *****************************************************************/
-
-
-LRESULT CALLBACK SASWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
-								LPARAM lParam )
-{
-	// INJDATA pointer.
-	// Must be patched at runtime !
-	INJDATA* pData = (INJDATA *)DUMMY_ADDR;
-
-	if( uMsg == WM_HOTKEY )
-	{
-		// Ctrl+Alt+Del
-		if( lParam == MAKELONG( MOD_CONTROL | MOD_ALT, VK_DELETE ) )
-		{
-			return 1;
-		}
-
-		// Ctrl+Shift+Esc
-		if( lParam == MAKELONG( MOD_CONTROL | MOD_SHIFT, VK_ESCAPE ) )
-			return 1;
-	}
-
-	// Call the original window procedure
-	return( (INJDATA*)pData)->fnCallWindowProc( ( (INJDATA*)pData )->
-			fnOldSASWndProc, hwnd, uMsg, wParam, lParam );
-}
-
-
-static int AfterSASWindowProc( void )
-{
-	return 1;
-}
-
-
-
-/*************************************************
- * Subclass the remote process window procedure. *
- * Return: 0=failure, 1=success                  *
- *************************************************/
-
-
-static DWORD WINAPI InjectFunc( INJDATA *pData )
-{
-	// Subclass window procedure
-#ifdef _WIN64
-	pData->fnOldSASWndProc = (WNDPROC) pData->fnSetWindowLongPtr( pData->hwnd,
-				GWLP_WNDPROC, (LONG_PTR)pData->fnSASWndProc );
-#else
-	pData->fnOldSASWndProc = (WNDPROC) pData->fnSetWindowLong( pData->hwnd,
-				GWL_WNDPROC, (long)pData->fnSASWndProc );
-#endif
-
-	return( pData->fnOldSASWndProc != NULL );
-}
-
-
-static int AfterInjectFunc( void )
-{
-	return 2;
-}
-
-
-/***********************************************************
- * Restore the subclassed remote process window procedure. *
- * Return: 0=failure, 1=success                            *
- ***********************************************************/
-
-
-static DWORD WINAPI EjectFunc (INJDATA *pData)
-{
-#ifdef _WIN64
-	return( pData->fnSetWindowLongPtr( pData->hwnd, GWLP_WNDPROC,
-					(LONG_PTR) pData->fnOldSASWndProc ) != 0 );
-#else
-	return( pData->fnSetWindowLong( pData->hwnd, GWL_WNDPROC,
-					(long)pData->fnOldSASWndProc ) != 0 );
-#endif
-}
-
-
-static int AfterEjectFunc( void )
-{
-	return 3;
-}
-
-
-
-/**************************************************************
- * Return the window handle of the remote process (Winlogon). *
- **************************************************************/
-
-
-static HWND WINAPI GetSASWnd( INJDATA *pData )
-{
-	return( pData->fnFindWindow( pData->szClassName,
-							pData->szWindowName ) );
-}
-
-
-static int AfterGetSASWnd( void )
-{
-	return 4;
-}
-
-
-
-/***************************************************************************
- * Copies InjectFunc(), GetSASWnd() , SASWindowProc() and INJDATA to the   *
- * remote process.                                                         *
- * Starts the execution of the remote InjectFunc(), which subclasses the   *
- * remote process default window procedure handler.                        *
- *                                                                         *
- * Return value: 0=failure, 1=success                                      *
- ***************************************************************************/
-
-int InjectCode ()
-{
-	HANDLE		hProcess = 0;		// Process handle
-	HMODULE		hUser32  = 0;		// Handle of user32.dll
-	BYTE		*pCodeRemote;		// Address of InjectFunc() in
-						// the remote process.
-	BYTE		*pGetSASWndRemote;	// Address of GetSASWnd() in
-						// the remote process.
-	HANDLE		hThread	= 0;		// The handle and ID of the
-						// thread executing
-	DWORD		dwThreadId = 0;		// the remote InjectFunc().
-	INJDATA		DataLocal;		// INJDATA structure
-	BOOL		fUnicode;		// TRUE if remote process is
-						// Unicode
-	int		nSuccess = 0;		// Subclassing succeded?
-	SIZE_T dwNumBytesCopied = 0;	// Number of bytes written to
-						// the remote process.
-	DWORD		size;			// Calculated function size
-						// (= AfterFunc() - Func())
-	int		SearchSize;		// SASWindowProc() dummy addr.
-						// search size
-	int		nDummyOffset;		// Offset in SASWindowProc() of
-						// dummy addr.
-	BOOL		FoundDummyAddr;		// Dummy INJDATA reference
-						// found in SASWindowProc() ?
-	HWND		hSASWnd;		// Window handle of Winlogon
-						// process
-	BYTE		*p;
-
-	// Enable Debug privilege (needed for some processes)
-	if( !LocalSystem::enablePrivilege( SE_DEBUG_NAME, TRUE ) )
-		return 0;
-
-	// Get handle of "USER32.DLL"
-	hUser32 = GetModuleHandle( "user32" );
-	if( !hUser32 )
-		return 0;
-
-	// Get remote process ID
-	PID = GetPIDFromName( szProcessName );
-	if( PID == (DWORD) -1 )
-		return 0;
-
-	// Open remote process
-	hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, PID );
-	if( !hProcess )
-		return 0;
-
-	switch( 1 )
-	{
-	default:
-	{
-		// Initialize INJDATA for GetSASWnd() call
-		strcpy( DataLocal.szClassName, "SAS Window class" );
-		strcpy( DataLocal.szWindowName, "SAS window" );
-		DataLocal.fnFindWindow = (FINDWINDOW) GetProcAddress( hUser32,
-								"FindWindowA" );
-		if( DataLocal.fnFindWindow == NULL )
-			break;
-
-		// Allocate memory in the remote process and write a copy of
-		// initialized INJDATA into it
-		size = sizeof( INJDATA );
-		pDataRemote = (PBYTE) VirtualAllocEx( hProcess, 0, size,
-					MEM_COMMIT, PAGE_EXECUTE_READWRITE);
-		if( !pDataRemote )
-			break;
-		if( !WriteProcessMemory( hProcess, pDataRemote, &DataLocal,
-			size, &dwNumBytesCopied ) || dwNumBytesCopied != size )
-			break;
-
-		// Allocate memory in remote process and write a copy of
-		// GetSASWnd() into it
-		size = (PBYTE)AfterGetSASWnd - (PBYTE)GetSASWnd;
-		pGetSASWndRemote = (PBYTE) VirtualAllocEx( hProcess, 0, size,
-					MEM_COMMIT, PAGE_EXECUTE_READWRITE );
-		if( !pGetSASWndRemote )
-			break;
-		if( !WriteProcessMemory( hProcess, pGetSASWndRemote,
-					(const void *) &GetSASWnd, size,
-						&dwNumBytesCopied ) ||
-						dwNumBytesCopied != size )
-			break;
-
-		// Start execution of remote GetSASWnd()
-		hThread = CreateRemoteThread(	hProcess,
-						NULL,
-						0,
-				(LPTHREAD_START_ROUTINE) pGetSASWndRemote,
-						pDataRemote,
-						0,
-						&dwThreadId );
-		// Failed
-		if( !hThread )
-			break;
-
-		// Wait for GetSASWnd() to terminate and get return code
-		// (SAS Wnd handle)
-		WaitForSingleObject( hThread, INFINITE );
-		GetExitCodeThread( hThread, (PDWORD) &hSASWnd );
-
-		// Didn't found "SAS window"
-		if( !hSASWnd )
-			break;
-
-		// Cleanup
-		VirtualFreeEx( hProcess, pGetSASWndRemote, 0, MEM_RELEASE );
-		VirtualFreeEx( hProcess, pDataRemote, 0, MEM_RELEASE );
-		pGetSASWndRemote = NULL;
-		pDataRemote = NULL;
-
-		// Allocate memory in remote process and write a copy of
-		// SASWindowProc() into it
-		size = (PBYTE)AfterSASWindowProc - (PBYTE)SASWindowProc;
-		pSASWinProcRemote = (PBYTE) VirtualAllocEx( hProcess, 0, size,
-					MEM_COMMIT, PAGE_EXECUTE_READWRITE );
-		if( !pSASWinProcRemote )
-			break;
-		if( !WriteProcessMemory( hProcess, pSASWinProcRemote,
-				(const void *) &SASWindowProc, size,
-						&dwNumBytesCopied ) ||
-					dwNumBytesCopied != size )
-			break;
-
-		// Is remote process unicode ?
-		fUnicode = IsWindowUnicode( hSASWnd );
-
-		// Initialize the INJDATA structure
-#ifdef _WIN64
-		DataLocal.fnSetWindowLongPtr = (SETWINDOWLONGPTR)
-				GetProcAddress( hUser32, fUnicode ?
-					"SetWindowLongPtrW" : "SetWindowLongPtrA" );
-#else
-		DataLocal.fnSetWindowLong = (SETWINDOWLONG)
-				GetProcAddress( hUser32, fUnicode ?
-					"SetWindowLongW" : "SetWindowLongA" );
-#endif
-		DataLocal.fnCallWindowProc = (CALLWINDOWPROC)
-				GetProcAddress( hUser32, fUnicode ?
-					"CallWindowProcW" : "CallWindowProcA" );
-
-		DataLocal.fnSASWndProc = (WNDPROC) pSASWinProcRemote;
-		DataLocal.hwnd = hSASWnd;
-
-		if(
-#ifdef _WIN64
-					DataLocal.fnSetWindowLongPtr == NULL ||
-#else
-					DataLocal.fnSetWindowLong == NULL ||
-#endif
-					DataLocal.fnCallWindowProc == NULL )
-		{
-			break;
-		}
-
-		// Allocate memory in the remote process and write a copy of
-		// initialized INJDATA into it
-		size = sizeof( INJDATA );
-		pDataRemote = (PBYTE) VirtualAllocEx( hProcess, 0, size,
-					MEM_COMMIT, PAGE_EXECUTE_READWRITE );
-		if( !pDataRemote )
-			break;
-		if( !WriteProcessMemory( hProcess, pDataRemote, &DataLocal,
-					size, &dwNumBytesCopied ) ||
-						dwNumBytesCopied != size )
-			break;
-
-		// Change dummy INJDATA address in SASWindowProc() by the real
-		// INJDATA pointer
-		p = (PBYTE)&SASWindowProc;
-		size = (PBYTE)AfterSASWindowProc - (PBYTE)SASWindowProc;
-		SearchSize = size - sizeof( DWORD ) + 1;
-		FoundDummyAddr = FALSE;
-
-		for( ; SearchSize > 0; p++, SearchSize-- )
-		{
-			if( *(DWORD *)p == DUMMY_ADDR )	// Found
-			{
-				nDummyOffset = p - (PBYTE)&SASWindowProc;
-				if( !WriteProcessMemory( hProcess,
-					pSASWinProcRemote + nDummyOffset,
-					&pDataRemote, sizeof( pDataRemote ),
-					&dwNumBytesCopied ) ||
-					dwNumBytesCopied !=
-						sizeof( pDataRemote ) )
-				{
-					break;
-				}
-				FoundDummyAddr = TRUE;
-				break;
-			}
-		}
-
-		// Couldn't change the dummy INJDATA addr. by the real addr. in
-		// SASWindowProc() !?! Don't execute the remote copy of
-		// SASWindowProc() because the pData pointer is invalid !
-		if( !FoundDummyAddr )
-		{
-			break;
-		}
-
-		// Allocate memory in the remote process and write a copy of
-		// InjectFunc() to the allocated memory
-		size = (PBYTE)AfterInjectFunc - (PBYTE)InjectFunc;
-		pCodeRemote = (PBYTE) VirtualAllocEx( hProcess, 0, size,
-					MEM_COMMIT, PAGE_EXECUTE_READWRITE );
-		if( !pCodeRemote )
-			break;
-		if( !WriteProcessMemory( hProcess, pCodeRemote,
-			(const void *) &InjectFunc, size, &dwNumBytesCopied ) ||
-						dwNumBytesCopied != size )
-			break;
-
-		// Start execution of remote InjectFunc()
-		hThread = CreateRemoteThread(	hProcess,
-						NULL,
-						0,
-						(LPTHREAD_START_ROUTINE)
-								pCodeRemote,
-						pDataRemote,
-						0,
-						&dwThreadId );
-		if( !hThread )
-			break;
-
-		// Wait for InjectFunc() to terminate and get return code
-		WaitForSingleObject( hThread, INFINITE );
-		GetExitCodeThread( hThread, (PDWORD) &nSuccess );
-
-		// Failed ?
-		if( !nSuccess )
-		{
-			// Release memory for INJDATA and SASWindowProc()
-			if( pDataRemote )
-				VirtualFreeEx( hProcess, pDataRemote, 0,
-								MEM_RELEASE );
-			if( pSASWinProcRemote )
-				VirtualFreeEx( hProcess, pSASWinProcRemote, 0,
-								MEM_RELEASE );
-			pDataRemote = NULL;
-			pSASWinProcRemote = NULL;
-		}
-
-		// Release remote GetSASWnd()
-		if( pGetSASWndRemote )
-			VirtualFreeEx( hProcess, pGetSASWndRemote, 0,
-								MEM_RELEASE );
-
-		// Release remote InjectFunc() (no longer needed)
-		if( pCodeRemote )
-			VirtualFreeEx( hProcess, pCodeRemote, 0, MEM_RELEASE );
-
-		if( hThread )
-			CloseHandle( hThread );
-	}
-	}
-
-	CloseHandle( hProcess );
-
-	// Disable the DEBUG privilege
-	LocalSystem::enablePrivilege( SE_DEBUG_NAME, FALSE );
-
-	return nSuccess;	// 0=failure; 1=success
-}
-
-
-/**********************************************************************
- * Copies EjectFunc() to the remote process and starts its execution. *
- * The remote EjectFunc() restores the old window procedure.          *
- *                                                                    *
- *	Return value: 0=failure, 1=success                                *
- **********************************************************************/
-
-int EjectCode( void )
-{
-	HANDLE		hProcess;		// Remote process handle
-	DWORD		*pCodeRemote;		// Address of EjectFunc() in the
-						// remote process
-	HANDLE		hThread = NULL;		// The handle and ID of the
-						// thread executing
-	DWORD		dwThreadId = 0;		// the remote EjectFunc().
-	int		nSuccess	= 0;	// EjectFunc() success ?
-	SIZE_T dwNumBytesCopied = 0;	// Number of bytes written to
-						// the remote process.
-	DWORD		size;			// Calculated function size
-						// (= AfterFunc() - Func())
-
-	// Enable Debug privilege (needed for some processes)
-	LocalSystem::enablePrivilege( SE_DEBUG_NAME, TRUE );
-
-	// Remote INDATA and SASWindowProc() must exist
-	if( !pDataRemote || !pSASWinProcRemote )
-		return 0;
-
-	// Open the process
-	hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, PID );
-	if( hProcess == NULL )
-		return 0;
-
-	// Allocate memory in the remote process and write a copy of
-	// EjectFunc() to the allocated memory
-	size = (PBYTE)AfterEjectFunc - (PBYTE)EjectFunc;
-	pCodeRemote = (PDWORD) VirtualAllocEx( hProcess, 0, size, MEM_COMMIT,
-						PAGE_EXECUTE_READWRITE );
-	if( !pCodeRemote )
-	{
-		CloseHandle( hProcess );
-		return 0;
-	}
-	if( !WriteProcessMemory( hProcess, pCodeRemote,
-					(const void *) &EjectFunc, size,
-					&dwNumBytesCopied ) ||
-						dwNumBytesCopied != size )
-	{
-		VirtualFreeEx( hProcess, pCodeRemote, 0, MEM_RELEASE );
-		CloseHandle( hProcess );
-		return 0;
-	}
-
-	// Start execution of the remote EjectFunc()
-	hThread = CreateRemoteThread(	hProcess,
-					NULL,
-					0,
-					(LPTHREAD_START_ROUTINE) pCodeRemote,
-					pDataRemote,
-					0,
-					&dwThreadId );
-	// Failed
-	if( !hThread )
-	{
-		goto END;
-	}
-
-	// Wait for EjectFunc() to terminate and get return code
-	WaitForSingleObject( hThread, INFINITE );
-	GetExitCodeThread( hThread, (PDWORD) &nSuccess );
-
-	// Failed to restore old window procedure ?
-	// Then leave INJDATA and the SASWindowProc()
-	if( nSuccess == 0 )
-		goto END;
-
-	// Release memory for remote INJDATA and SASWindowProc()
-	if( pDataRemote )
-		VirtualFreeEx( hProcess, pDataRemote, 0, MEM_RELEASE );
-	if( pSASWinProcRemote )
-		VirtualFreeEx( hProcess, pSASWinProcRemote, 0, MEM_RELEASE );
-	pDataRemote = NULL;
-	pSASWinProcRemote = NULL;
-
-END:
-	if( hThread )
-		CloseHandle( hThread );
-
-	// Release EjectFunc() memory
-	if( pCodeRemote )
-		VirtualFreeEx( hProcess, pCodeRemote, 0, MEM_RELEASE );
-
-	CloseHandle( hProcess );
-
-	// Disable the DEBUG privilege
-	LocalSystem::enablePrivilege( SE_DEBUG_NAME, FALSE );
-
-	return nSuccess;	// 0=failure; 1=success
-}
-
-
-
-BOOL Inject( void )
-{
-	return( InjectCode() != 0 );
-}
-
-
-BOOL Eject( void )
-{
-	return( EjectCode() != 0 );
-}
-
-
-#endif
-
diff --git a/lib/src/Ipc/Core.cpp b/lib/src/Ipc/Core.cpp
deleted file mode 100644
index 7d019bf..0000000
--- a/lib/src/Ipc/Core.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * IpcCore.cpp - core definitions for the IPC framework
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "Ipc/Core.h"
-
-
-namespace Ipc
-{
-	namespace Commands
-	{
-		const Command Identify = "IpcCommandIdentify";
-		const Command UnknownCommand = "IpcCommandUnknownCommand";
-		const Command Ping = "IpcCommandPing";
-		const Command Quit = "IpcCommandQuit";
-
-	}
-
-	namespace Arguments
-	{
-		const Argument Id = "IpcArgumentId";
-		const Argument Command = "IpcArgumentCommand";
-	}
-
-}
-
diff --git a/lib/src/Ipc/Master.cpp b/lib/src/Ipc/Master.cpp
deleted file mode 100644
index 19dcaa1..0000000
--- a/lib/src/Ipc/Master.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * IpcMaster.cpp - class Ipc::Master which manages IpcSlaves
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QCoreApplication>
-#include <QtNetwork/QTcpSocket>
-
-#include "Ipc/Master.h"
-#include "Ipc/QtSlaveLauncher.h"
-#include "Logger.h"
-
-namespace Ipc
-{
-
-Master::Master( const QString &applicationFilePath ) :
-	QTcpServer(),
-	m_applicationFilePath( applicationFilePath ),
-	m_socketReceiveMapper( this ),
-	m_processes(),
-	m_processMapMutex( QMutex::Recursive )
-{
-	if( !listen( QHostAddress::LocalHost ) )
-	{
-		qCritical( "Error in listen() in Ipc::Master::Master()" );
-	}
-
-	ilogf( Info, "Ipc::Master: listening at port %d", serverPort() );
-
-	connect( &m_socketReceiveMapper, SIGNAL( mapped( QObject *) ),
-				this, SLOT( receiveMessage( QObject * ) ) );
-
-	connect( this, SIGNAL( newConnection() ),
-			 this, SLOT( acceptConnection() ) );
-
-	connect( this, SIGNAL( messagesPending() ),
-				this, SLOT( sendPendingMessages() ), Qt::QueuedConnection );
-}
-
-
-
-
-Master::~Master()
-{
-	QMutexLocker l( &m_processMapMutex );
-
-	const QList<Ipc::Id> processIds = m_processes.keys();
-	foreach( const Ipc::Id &id, processIds )
-	{
-		stopSlave( id );
-	}
-
-	ilog( Info, "Stopped Ipc::Master" );
-}
-
-
-
-
-void Master::createSlave( const Ipc::Id &id, SlaveLauncher *slaveLauncher )
-{
-	// make sure to stop a slave with the same id
-	stopSlave( id );
-
-	if( slaveLauncher == NULL )
-	{
-		slaveLauncher = new QtSlaveLauncher( applicationFilePath() );
-	}
-
-	ProcessInformation pi;
-
-	pi.slaveLauncher = slaveLauncher;
-
-	m_processMapMutex.lock();
-	m_processes[id] = pi;
-	m_processMapMutex.unlock();
-
-	LogStream() << "Starting slave" << id << "at port" << serverPort();
-	pi.slaveLauncher->start( QStringList() << "-slave" << id <<
-											QString::number( serverPort() ) );
-
-}
-
-
-
-
-void Master::stopSlave( const Ipc::Id &id )
-{
-	QMutexLocker l( &m_processMapMutex );
-
-	if( m_processes.contains( id ) )
-	{
-		LogStream() << "Stopping slave" << id;
-		if( isSlaveRunning( id ) )
-		{
-			l.unlock();
-			sendMessage( id, Ipc::Commands::Quit );
-			m_processes[id].slaveLauncher->stop();
-			l.relock();
-		}
-
-		delete m_processes[id].slaveLauncher;
-
-		if( m_processes[id].sock != NULL )
-		{
-			// schedule deletion of socket - can't delete it here as this
-			// crashes Qt on Win32
-			m_processes[id].sock->deleteLater();
-		}
-
-		m_processes.remove( id );
-	}
-	else
-	{
-		qDebug() << "Ipc::Master: can't stop slave" << id
-					<< "as it does not exist";
-	}
-}
-
-
-
-
-bool Master::isSlaveRunning( const Ipc::Id &id )
-{
-	QMutexLocker l( &m_processMapMutex );
-
-	if( m_processes.contains( id ) )
-	{
-		return m_processes[id].slaveLauncher->isRunning();
-	}
-
-	return false;
-}
-
-
-
-
-void Master::sendMessage( const Ipc::Id &id, const Ipc::Msg &msg )
-{
-	QMutexLocker l( &m_processMapMutex );
-
-	if( m_processes.contains( id ) )
-	{
-		qDebug() << "Ipc::Master: queuing message" << msg.cmd()
-					<< "for slave" << id;
-		m_processes[id].pendingMessages << msg;
-		if( m_processes[id].sock )
-		{
-			emit messagesPending();
-		}
-	}
-	else
-	{
-		qWarning() << "Ipc::Master: can't send message" << msg.cmd()
-					<< "to non-existing slave" << id;
-	}
-}
-
-
-
-
-Ipc::Msg Master::receiveMessage( const Ipc::Id &id )
-{
-	QMutexLocker l( &m_processMapMutex );
-
-	Ipc::Msg m;
-	if( m_processes.contains( id ) && m_processes[id].sock )
-	{
-		m.receive( m_processes[id].sock );
-		qDebug() << "Ipc::Master: received message" << m.cmd()
-					<< "from slave" << id;
-	}
-
-	return m;
-}
-
-
-
-
-void Master::acceptConnection()
-{
-	qDebug( "Ipc::Master: accepting connection" );
-
-	QTcpSocket *s = nextPendingConnection();
-
-	// connect to readyRead() signal of new connection
-	connect( s, SIGNAL( readyRead() ),
-				&m_socketReceiveMapper, SLOT( map() ) );
-
-	// add mapping so we can identify the socket later
-	m_socketReceiveMapper.setMapping( s, s );
-
-	Ipc::Msg( Ipc::Commands::Identify ).send( s );
-
-}
-
-
-
-
-void Master::receiveMessage( QObject *sockObj )
-{
-	QTcpSocket *sock = qobject_cast<QTcpSocket *>( sockObj );
-	if( !sock )
-	{
-		return;
-	}
-
-	while( sock->bytesAvailable() > 0 )
-	{
-		// receive and handle message
-		Ipc::Msg m;
-		if( m.receive( sock ).isValid() )
-		{
-			QMutexLocker l( &m_processMapMutex );
-
-			// search for slave ID
-			Ipc::Id slaveId;
-			for( ProcessMap::ConstIterator it = m_processes.begin();
-							it != m_processes.end(); ++it )
-			{
-				if( it->sock == sock )
-				{
-					slaveId = it.key();
-				}
-			}
-
-			if( m.cmd() != Ipc::Commands::Ping )
-			{
-				qDebug() << "Ipc::Master: received message" << m.cmd()
-							<< "from slave" << slaveId;
-			}
-
-			if( m.cmd() == Ipc::Commands::UnknownCommand )
-			{
-				qWarning() << "Slave" << slaveId
-						<< "could not handle command"
-						<< m.arg( Ipc::Arguments::Command );
-			}
-			else if( m.cmd() == Ipc::Commands::Ping )
-			{
-				// send message back
-				m.send( sock );
-			}
-			else if( m.cmd() == Ipc::Commands::Identify )
-			{
-				// check whether we got a proper identification message
-				const Ipc::Id id = m.arg( Ipc::Arguments::Id );
-				if( m_processes.contains( id ) &&
-						m_processes[id].sock == NULL )
-				{
-					m_processes[id].sock = sock;
-					// send all pending messages that were queued before the
-					// connection was established completely
-					sendPendingMessages();
-				}
-				else
-				{
-					qWarning() << "Slave not existing or already registered" << id;
-					delete sock;
-					break;
-				}
-			}
-			else
-			{
-				handleMessage( slaveId, m );
-			}
-		}
-	}
-}
-
-
-
-void Master::sendPendingMessages()
-{
-	qDebug() << "Master::sendPendingMessages()";
-	QMutexLocker l( &m_processMapMutex );
-
-	for( ProcessMap::Iterator it = m_processes.begin();
-							it != m_processes.end(); ++it )
-	{
-		if( it->sock && !it->pendingMessages.isEmpty() )
-		{
-			foreach( const Ipc::Msg &m, it->pendingMessages )
-			{
-				qDebug() << "Ipc::Master: sending message" << m.cmd()
-							<< "to slave" << it.key()
-							<< "with arguments" << m.args();
-				m.send( it->sock );
-			}
-			it->pendingMessages.clear();
-		}
-	}
-}
-
-
-
-}
diff --git a/lib/src/Ipc/QtSlaveLauncher.cpp b/lib/src/Ipc/QtSlaveLauncher.cpp
deleted file mode 100644
index 9010c69..0000000
--- a/lib/src/Ipc/QtSlaveLauncher.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * QtSlaveLauncher.cpp - class Ipc::QtSlaveLauncher providing mechanisms for
- *                       launching a slave application via QProcess
- *
- * Copyright (c) 2010-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QProcess>
-#include <QtCore/QTime>
-
-#include "Ipc/QtSlaveLauncher.h"
-
-#include "ItalcCore.h"
-#include "ItalcConfiguration.h"
-#include "Logger.h"
-
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-#endif
-
-namespace Ipc
-{
-
-QtSlaveLauncher::QtSlaveLauncher( const QString &applicationFilePath ) :
-	SlaveLauncher( applicationFilePath ),
-	m_processMutex(),
-	m_process( NULL )
-{
-}
-
-
-
-QtSlaveLauncher::~QtSlaveLauncher()
-{
-	// base class destructor calls stop()
-}
-
-
-
-void QtSlaveLauncher::start( const QStringList &arguments )
-{
-	stop();
-
-	m_processMutex.lock();
-	m_process = new QProcess;
-
-	// forward stdout from slave to master when in debug mode
-	if( ItalcCore::config->logLevel() >= Logger::LogLevelDebug )
-	{
-		m_process->setProcessChannelMode( QProcess::ForwardedChannels );
-	}
-
-#ifndef DEBUG
-	m_process->start( applicationFilePath(), arguments );
-#else
-	qWarning() << applicationFilePath() << arguments;
-#endif
-	m_processMutex.unlock();
-}
-
-
-
-void QtSlaveLauncher::stop()
-{
-	m_processMutex.lock();
-	if( m_process )
-	{
-		QTime t;
-		t.start();
-
-		while( t.elapsed() < 5000 && m_process->state() != QProcess::NotRunning )
-		{
-			QCoreApplication::processEvents();
-#ifdef ITALC_BUILD_WIN32
-			// Silvio 2012-01-07: I don't know why this works and why this "Sleep" helps
-			// but after adding these two lines taskbar returns and screen unlocks almost
-			// instantly (before it took few seconds). Same is true for demo mode.
-			Sleep( 500 );
-			QCoreApplication::processEvents();
-#endif
-		}
-
-		if( m_process->state() != QProcess::NotRunning )
-		{
-			qWarning( "Slave still running, terminating it now." );
-			m_process->terminate();
-			m_process->kill();
-		}
-
-		delete m_process;
-		m_process = NULL;
-	}
-	m_processMutex.unlock();
-}
-
-
-
-bool QtSlaveLauncher::isRunning()
-{
-	QMutexLocker l( &m_processMutex );
-	if( m_process )
-	{
-		// we have to call this in order to update the state if the
-		// process has finished already
-		m_process->waitForFinished( 0 );
-
-		return m_process->state() != QProcess::NotRunning;
-	}
-
-	return false;
-}
-
-
-}
diff --git a/lib/src/Ipc/Slave.cpp b/lib/src/Ipc/Slave.cpp
deleted file mode 100644
index d23f78a..0000000
--- a/lib/src/Ipc/Slave.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * IpcSlave.cpp - class Ipc::Slave providing communication with Ipc::Master
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QCoreApplication>
-#include <QtNetwork/QHostAddress>
-
-#include "Ipc/Slave.h"
-#include "Logger.h"
-
-namespace Ipc
-{
-
-Slave::Slave( const Ipc::Id &masterId, const Ipc::Id &slaveId ) :
-	QTcpSocket(),
-	m_slaveId( slaveId ),
-	m_pingTimer( this ),
-	m_lastPingResponse( QTime::currentTime() )
-{
-	connect( this, SIGNAL( readyRead() ),
-				this, SLOT( receiveMessage() ) );
-	connect( this, SIGNAL( error( QAbstractSocket::SocketError ) ),
-				QCoreApplication::instance(), SLOT( quit() ) );
-
-	m_pingTimer.setInterval( 1000 );
-	connect( &m_pingTimer, SIGNAL( timeout() ),
-				this, SLOT( masterPing() ) );
-	connect( this, SIGNAL( connected() ),
-				&m_pingTimer, SLOT( start() ) );
-
-	connectToHost( QHostAddress::LocalHost, masterId.toInt() );
-}
-
-
-
-
-void Slave::receiveMessage()
-{
-	while( bytesAvailable() > 0 )
-	{
-		Ipc::Msg m;
-		if( m.receive( this ).isValid() )
-		{
-			if( m.cmd() != Ipc::Commands::Ping )
-			{
-				qDebug() << "Slave" << m_slaveId << "received message" << m.cmd();
-			}
-
-			bool handled = false;
-			if( handleMessage( m ) )
-			{
-				handled = true;
-			}
-
-			if( m.cmd() == Ipc::Commands::Quit )
-			{
-				handled = true;
-				QCoreApplication::quit();
-			}
-			else if( m.cmd() == Ipc::Commands::Identify )
-			{
-				Ipc::Msg( Ipc::Commands::Identify ).
-					addArg( Ipc::Arguments::Id, m_slaveId ).
-						send( this );
-				handled = true;
-			}
-			else if( m.cmd() == Ipc::Commands::Ping )
-			{
-				m_lastPingResponse = QTime::currentTime();
-				handled = true;
-			}
-
-			if( !handled )
-			{
-				Ipc::Msg( Ipc::Commands::UnknownCommand ).
-						addArg( Ipc::Arguments::Command, m.cmd() ).send( this );
-			}
-		}
-		else
-		{
-			LogStream( Logger::LogLevelError )
-								<< "Slave" << m_slaveId
-								<< "received invalid message from master";
-		}
-	}
-}
-
-
-
-
-void Slave::masterPing()
-{
-	Ipc::Msg( Ipc::Commands::Ping ).send( this );
-
-	if( m_lastPingResponse.msecsTo( QTime::currentTime() ) > 10000 )
-	{
-		qWarning() << "Ping timeout for slave" << m_slaveId;
-		//QCoreApplication::quit();
-	}
-}
-
-
-
-
-}
diff --git a/lib/src/Ipc/SlaveLauncher.cpp b/lib/src/Ipc/SlaveLauncher.cpp
deleted file mode 100644
index ea7d28e..0000000
--- a/lib/src/Ipc/SlaveLauncher.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * IpcSlaveLauncher.cpp - class Ipc::SlaveLauncher providing mechanisms for
- *                        launching a slave application
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- * Copyright (c) 2010 Univention GmbH
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QCoreApplication>
-
-#include "Ipc/SlaveLauncher.h"
-
-namespace Ipc
-{
-
-SlaveLauncher::SlaveLauncher( const QString &applicationFilePath ) :
-	m_applicationFilePath( applicationFilePath )
-{
-	if( m_applicationFilePath.isEmpty() )
-	{
-		m_applicationFilePath = QCoreApplication::applicationFilePath();
-	}
-}
-
-
-
-SlaveLauncher::~SlaveLauncher()
-{
-	stop();
-}
-
-
-
-void SlaveLauncher::start( const QStringList & )
-{
-}
-
-
-
-void SlaveLauncher::stop()
-{
-}
-
-
-}
diff --git a/lib/src/ItalcConfiguration.cpp b/lib/src/ItalcConfiguration.cpp
deleted file mode 100644
index f10e1a7..0000000
--- a/lib/src/ItalcConfiguration.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * ItalcConfiguration.cpp - a Configuration object storing system wide
- *                          configuration values
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <QtCore/QDir>
-#include <QtCore/QProcessEnvironment>
-#include <QtCore/QSysInfo>
-
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-#include "ItalcRfbExt.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-
-ItalcConfiguration::ItalcConfiguration(
-									Configuration::Store::Backend backend ) :
-	Configuration::Object( backend, Configuration::Store::System )
-{
-}
-
-
-
-ItalcConfiguration::ItalcConfiguration( Configuration::Store *store ) :
-	Configuration::Object( store )
-{
-}
-
-
-
-ItalcConfiguration::ItalcConfiguration( const ItalcConfiguration &ref ) :
-	Configuration::Object( Configuration::Store::NoBackend,
-							Configuration::Store::System )
-{
-	*this += ref;	// copy data
-}
-
-
-
-
-ItalcConfiguration ItalcConfiguration::defaultConfiguration()
-{
-	ItalcConfiguration c( Configuration::Store::NoBackend );
-
-	c.setTrayIconHidden( false );
-	c.setServiceAutostart( true );
-	c.setServiceArguments( QString() );
-
-	c.setLogLevel( Logger::LogLevelDefault );
-	c.setLimittedLogFileSize( false );
-	c.setLogToStdErr( true );
-	c.setLogToWindowsEventLog( false );
-	c.setLogFileSizeLimit( -1 );
-	c.setLogFileDirectory(
-#ifdef ITALC_BUILD_WIN32
-		"%TEMP%"
-#else
-		"$TEMP"
-#endif
-				);
-
-	c.setVncCaptureLayeredWindows(
-#ifdef ITALC_BUILD_WIN32
-						QSysInfo::windowsVersion() == QSysInfo::WV_VISTA ||
-						QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7
-#else
-						false
-#endif
-								);
-	c.setVncPollFullScreen( true );
-	c.setVncLowAccuracy( true );
-
-	c.setDemoServerBackend( 0 );
-	c.setDemoServerMultithreaded( true );
-
-	c.setCoreServerPort( PortOffsetVncServer );
-	c.setDemoServerPort( PortOffsetDemoServer );
-	c.setHttpServerPort( PortOffsetHttpServer );
-	c.setHttpServerEnabled( false );
-	c.setFirewallExceptionEnabled( true );
-
-	c.setGlobalConfigurationPath( QDTNS( "$APPDATA/GlobalConfig.xml" ) );
-	c.setPersonalConfigurationPath( QDTNS( "$APPDATA/PersonalConfig.xml" ) );
-
-	c.setSnapshotDirectory( QDTNS( "$APPDATA/Snapshots" ) );
-
-	c.setKeyAuthenticationEnabled( true );
-	c.setLogonAuthenticationEnabled( true );
-
-	c.setPermissionRequiredWithKeyAuthentication( false );
-	c.setPrivateKeyBaseDir( QDTNS( "$GLOBALAPPDATA/keys/private" ) );
-	c.setPublicKeyBaseDir( QDTNS( "$GLOBALAPPDATA/keys/public" ) );
-
-	c.setPermissionRequiredWithLogonAuthentication( false );
-	c.setSameUserConfirmationDisabled( false );
-	c.setLogonGroups( QStringList() );
-
-	return c;
-}
-
-
-
-FOREACH_ITALC_CONFIG_PROPERTY(IMPLEMENT_CONFIG_SET_PROPERTY)
-
diff --git a/lib/src/ItalcCore.cpp b/lib/src/ItalcCore.cpp
deleted file mode 100644
index e1eddc5..0000000
--- a/lib/src/ItalcCore.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * ItalcCore.cpp - implementation of iTALC Core
- *
- * Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-#endif
-
-#include <QtCore/QDir>
-#include <QtCore/QFileInfo>
-#include <QtCore/QLocale>
-#include <QtCore/QTranslator>
-#include <QtGui/QApplication>
-
-#include "ItalcCore.h"
-#include "ItalcConfiguration.h"
-#include "ItalcRfbExt.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "PasswordDialog.h"
-#include "SocketDevice.h"
-
-#include <rfb/rfbclient.h>
-
-#include "minilzo.h"
-
-
-
-ItalcConfiguration *ItalcCore::config = NULL;
-AuthenticationCredentials *ItalcCore::authenticationCredentials = NULL;
-
-int ItalcCore::serverPort = PortOffsetVncServer;
-ItalcCore::UserRoles ItalcCore::role = ItalcCore::RoleOther;
-
-
-void initResources()
-{
-	Q_INIT_RESOURCE(ItalcCore);
-#ifndef QT_TRANSLATIONS_DIR
-	Q_INIT_RESOURCE(qt_qm);
-#endif
-}
-
-
-
-qint64 libvncClientDispatcher( char * _buf, const qint64 _len,
-				const SocketOpCodes _op_code, void * _user )
-{
-	rfbClient * cl = (rfbClient *) _user;
-	switch( _op_code )
-	{
-		case SocketRead:
-			return ReadFromRFBServer( cl, _buf, _len ) != 0 ?
-								_len : 0;
-		case SocketWrite:
-			return WriteToRFBServer( cl, _buf, _len ) != 0 ?
-								_len : 0;
-		case SocketGetPeerAddress:
-//			strncpy( _buf, cl->host, _len );
-			break;
-	}
-	return 0;
-
-}
-
-
-
-static void killWisPtis()
-{
-#ifdef ITALC_BUILD_WIN32
-	int pid = -1;
-	while( ( pid = LocalSystem::Process::findProcessId( "wisptis.exe" ) ) >= 0 )
-	{
-		HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
-										PROCESS_TERMINATE |
-										PROCESS_VM_READ,
-										false, pid );
-		if( !TerminateProcess( hProcess, 0 ) )
-		{
-			CloseHandle( hProcess );
-			break;
-		}
-		CloseHandle( hProcess );
-	}
-
-	if( pid >= 0 )
-	{
-		LocalSystem::User user = LocalSystem::User::loggedOnUser();
-		while( ( pid = LocalSystem::Process::findProcessId( "wisptis.exe", -1, &user ) ) >= 0 )
-		{
-			HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
-											PROCESS_TERMINATE |
-											PROCESS_VM_READ,
-											false, pid );
-			if( !TerminateProcess( hProcess, 0 ) )
-			{
-				CloseHandle( hProcess );
-				break;
-			}
-			CloseHandle( hProcess );
-		}
-	}
-#endif
-}
-
-
-bool ItalcCore::init()
-{
-	if( config )
-	{
-		return false;
-	}
-
-	killWisPtis();
-
-	lzo_init();
-
-	QCoreApplication::setOrganizationName( "iTALC Solutions" );
-	QCoreApplication::setOrganizationDomain( "italcsolutions.org" );
-	QCoreApplication::setApplicationName( "iTALC" );
-
-	initResources();
-
-	const QString loc = QLocale::system().name();
-
-	QTranslator *tr = new QTranslator;
-	tr->load( QString( ":/resources/%1.qm" ).arg( loc ) );
-	QCoreApplication::installTranslator( tr );
-
-	QTranslator *qtTr = new QTranslator;
-#ifdef QT_TRANSLATIONS_DIR
-	qtTr->load( QString( "qt_%1.qm" ).arg( loc ), QT_TRANSLATIONS_DIR );
-#else
-	qtTr->load( QString( ":/qt_%1.qm" ).arg( loc ) );
-#endif
-	QCoreApplication::installTranslator( qtTr );
-
-	if( QLocale::system().language() == QLocale::Hebrew ||
-		QLocale::system().language() == QLocale::Arabic )
-	{
-		QApplication::setLayoutDirection( Qt::RightToLeft );
-	}
-
-	config = new ItalcConfiguration( ItalcConfiguration::defaultConfiguration() );
-	*config += ItalcConfiguration( Configuration::Store::LocalBackend );
-
-	serverPort = config->coreServerPort();
-
-	return true;
-}
-
-
-
-
-bool ItalcCore::initAuthentication( int credentialTypes )
-{
-	if( authenticationCredentials )
-	{
-		delete authenticationCredentials;
-		authenticationCredentials = NULL;
-	}
-
-	authenticationCredentials = new AuthenticationCredentials;
-
-	bool success = true;
-
-	if( credentialTypes & AuthenticationCredentials::UserLogon &&
-			config->isLogonAuthenticationEnabled() )
-	{
-		if( QApplication::type() != QApplication::Tty )
-		{
-			PasswordDialog dlg( QApplication::activeWindow() );
-			if( dlg.exec() &&
-				dlg.credentials().hasCredentials( AuthenticationCredentials::UserLogon ) )
-			{
-				authenticationCredentials->setLogonUsername( dlg.username() );
-				authenticationCredentials->setLogonPassword( dlg.password() );
-
-				success &= true;
-			}
-			else
-			{
-				success = false;
-			}
-		}
-		else
-		{
-			success = false;
-		}
-	}
-
-	if( credentialTypes & AuthenticationCredentials::PrivateKey &&
-			config->isKeyAuthenticationEnabled() )
-	{
-		const QString privKeyFile = LocalSystem::Path::privateKeyPath( ItalcCore::role );
-		qDebug() << "Loading private key" << privKeyFile << "for role" << ItalcCore::role;
-		if( authenticationCredentials->loadPrivateKey( privKeyFile ) )
-		{
-			success &= true;
-		}
-		else
-		{
-			success = false;
-		}
-	}
-
-	return success;
-}
-
-
-
-
-void ItalcCore::destroy()
-{
-	delete authenticationCredentials;
-	authenticationCredentials = NULL;
-
-	delete config;
-	config = NULL;
-}
-
-
-
-static const char *userRoleNames[] =
-{
-	"none",
-	"teacher",
-	"admin",
-	"supporter",
-	"other"
-} ;
-
-
-
-QString ItalcCore::userRoleName( UserRole role )
-{
-	return userRoleNames[role];
-}
-
-
-
-
-namespace ItalcCore
-{
-
-
-bool Msg::send()
-{
-	QDataStream d( m_socketDevice );
-	d << (uint8_t) rfbItalcCoreRequest;
-	d << m_cmd;
-	d << m_args;
-
-	return true;
-}
-
-
-
-Msg &Msg::receive()
-{
-	QDataStream d( m_socketDevice );
-	d >> m_cmd;
-	d >> m_args;
-
-	return *this;
-}
-
-
-
-const Command GetUserInformation = "GetUserInformation";
-const Command UserInformation = "UserInformation";
-const Command StartDemo = "StartDemo";
-const Command StopDemo = "StopDemo";
-const Command LockScreen = "LockScreen";
-const Command UnlockScreen = "UnlockScreen";
-const Command LockInput = "LockInput";
-const Command UnlockInput = "UnlockInput";
-const Command LogonUserCmd = "LogonUser";
-const Command LogoutUser = "LogoutUser";
-const Command DisplayTextMessage = "DisplayTextMessage";
-const Command AccessDialog = "AccessDialog";
-const Command ExecCmds = "ExecCmds";
-const Command PowerOnComputer = "PowerOnComputer";
-const Command PowerDownComputer = "PowerDownComputer";
-const Command RestartComputer = "RestartComputer";
-const Command DisableLocalInputs = "DisableLocalInputs";
-const Command SetRole = "SetRole";
-
-const Command DemoServerAllowHost = "DemoServerAllowHost";
-const Command DemoServerUnallowHost = "DemoServerUnallowHost";
-const Command StartDemoServer = "StartDemoServer";
-const Command StopDemoServer = "StopDemoServer";
-
-const Command ReportSlaveStateFlags = "ReportSlaveStateFlags";
-
-
-} ;
-
diff --git a/lib/src/ItalcCoreConnection.cpp b/lib/src/ItalcCoreConnection.cpp
deleted file mode 100644
index 76ab24b..0000000
--- a/lib/src/ItalcCoreConnection.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * ItalcCoreConnection.cpp - implementation of ItalcCoreConnection
- *
- * Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "ItalcCoreConnection.h"
-#include "Logger.h"
-#include "SocketDevice.h"
-
-
-class ItalcMessageEvent : public ClientEvent
-{
-public:
-	ItalcMessageEvent( const ItalcCore::Msg &m ) :
-		m_msg( m )
-	{
-	}
-
-	virtual void fire( rfbClient *client )
-	{
-		SocketDevice socketDev( libvncClientDispatcher, client );
-		m_msg.setSocketDevice( &socketDev );
-		qDebug() << "ItalcMessageEvent::fire(): sending message" << m_msg.cmd()
-					<< "with arguments" << m_msg.args();
-		m_msg.send();
-	}
-
-
-private:
-	ItalcCore::Msg m_msg;
-
-} ;
-
-
-
-static rfbClientProtocolExtension * __italcProtocolExt = NULL;
-static void * ItalcCoreConnectionTag = (void *) PortOffsetVncServer; // an unique ID
-
-
-
-ItalcCoreConnection::ItalcCoreConnection( ItalcVncConnection *vncConn ):
-	m_vncConn( vncConn ),
-	m_user(),
-	m_userHomeDir(),
-	m_slaveStateFlags( 0 )
-{
-	if( __italcProtocolExt == NULL )
-	{
-		__italcProtocolExt = new rfbClientProtocolExtension;
-		__italcProtocolExt->encodings = NULL;
-		__italcProtocolExt->handleEncoding = NULL;
-		__italcProtocolExt->handleMessage = handleItalcMessage;
-
-		rfbClientRegisterExtension( __italcProtocolExt );
-	}
-
-	connect( m_vncConn, SIGNAL( newClient( rfbClient * ) ),
-			this, SLOT( initNewClient( rfbClient * ) ),
-							Qt::DirectConnection );
-}
-
-
-
-
-ItalcCoreConnection::~ItalcCoreConnection()
-{
-	if( m_vncConn )
-	{
-		m_vncConn->stop();
-		m_vncConn = NULL;
-	}
-}
-
-
-
-
-void ItalcCoreConnection::initNewClient( rfbClient *cl )
-{
-	rfbClientSetClientData( cl, ItalcCoreConnectionTag, this );
-}
-
-
-
-
-rfbBool ItalcCoreConnection::handleItalcMessage( rfbClient *cl,
-						rfbServerToClientMsg * msg )
-{
-	ItalcCoreConnection * icc = (ItalcCoreConnection *)
-				rfbClientGetClientData( cl, ItalcCoreConnectionTag );
-	if( icc )
-	{
-		return icc->handleServerMessage( cl, msg->type );
-	}
-
-	return false;
-}
-
-
-
-
-bool ItalcCoreConnection::handleServerMessage( rfbClient *cl, uint8_t msg )
-{
-	if( msg == rfbItalcCoreResponse )
-	{
-		SocketDevice socketDev( libvncClientDispatcher, cl );
-		ItalcCore::Msg m( &socketDev );
-
-		m.receive();
-		qDebug() << "ItalcCoreConnection: received message" << m.cmd()
-					<< "with arguments" << m.args();
-
-		if( m.cmd() == ItalcCore::UserInformation )
-		{
-			m_user = m.arg( "username" );
-			m_userHomeDir = m.arg( "homedir" );
-			emit receivedUserInfo( m_user, m_userHomeDir );
-		}
-		else if( m.cmd() == ItalcCore::ReportSlaveStateFlags )
-		{
-			m_slaveStateFlags = m.arg( "slavestateflags" ).toInt();
-			emit receivedSlaveStateFlags( m_slaveStateFlags );
-		}
-		// TODO: plugin hook
-		else
-		{
-			qCritical() << "ItalcCoreConnection::"
-				"handleServerMessage(): unknown server "
-				"response" << m.cmd();
-			return false;
-		}
-	}
-	else
-	{
-		qCritical( "ItalcCoreConnection::handleServerMessage(): "
-				"unknown message type %d from server. Closing "
-				"connection. Will re-open it later.", msg );
-		return false;
-	}
-
-	return true;
-}
-
-
-
-
-void ItalcCoreConnection::sendGetUserInformationRequest()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::GetUserInformation ) );
-}
-
-
-
-
-void ItalcCoreConnection::execCmds( const QString &cmd )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::ExecCmds ).
-						addArg( "cmds", cmd ) );
-}
-
-
-
-
-void ItalcCoreConnection::startDemo( const QString &host, int port,
-										bool fullscreen )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::StartDemo ).
-					addArg( "host", host ).
-					addArg( "port", port ).
-					addArg( "fullscreen", fullscreen ) );
-}
-
-
-
-
-void ItalcCoreConnection::stopDemo()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::StopDemo ) );
-}
-
-
-
-
-void ItalcCoreConnection::lockScreen()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::LockScreen ) );
-}
-
-
-
-
-void ItalcCoreConnection::unlockScreen()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::UnlockScreen ) );
-}
-
-
-
-
-void ItalcCoreConnection::lockInput()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::LockInput ) );
-}
-
-
-
-
-void ItalcCoreConnection::unlockInput()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::UnlockInput ) );
-}
-
-
-
-
-void ItalcCoreConnection::logonUser( const QString &uname,
-						const QString &pw,
-						const QString &domain )
-{
-/*	enqueueMessage( ItalcCore::Msg( ItalcCore::LogonUserCmd ).
-						addArg( "uname", uname ).
-						addArg( "passwd", pw ).
-						addArg( "domain", domain ) );*/
-}
-
-
-
-
-void ItalcCoreConnection::logoutUser()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::LogoutUser ) );
-}
-
-
-
-
-void ItalcCoreConnection::displayTextMessage( const QString &msg )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::DisplayTextMessage ).
-						addArg( "text", msg ) );
-}
-
-
-
-
-void ItalcCoreConnection::powerOnComputer( const QString &mac )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::PowerOnComputer ).
-						addArg( "mac",mac ) );
-}
-
-
-
-
-void ItalcCoreConnection::powerDownComputer()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::PowerDownComputer ) );
-}
-
-
-
-
-void ItalcCoreConnection::restartComputer()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::RestartComputer ) );
-}
-
-
-
-
-void ItalcCoreConnection::disableLocalInputs( bool disabled )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::DisableLocalInputs ).
-					addArg( "disabled", disabled ) );
-}
-
-
-
-
-void ItalcCoreConnection::setRole( const ItalcCore::UserRole role )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::SetRole ).
-						addArg( "role", role ) );
-}
-
-
-
-
-void ItalcCoreConnection::startDemoServer( int sourcePort, int destinationPort )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::StartDemoServer ).
-						addArg( "sourceport", sourcePort ).
-						addArg( "destinationport", destinationPort ) );
-}
-
-
-
-
-void ItalcCoreConnection::stopDemoServer()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::StopDemoServer ) );
-}
-
-
-
-
-void ItalcCoreConnection::demoServerAllowHost( const QString &host )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::DemoServerAllowHost ).
-						addArg( "host", host ) );
-}
-
-
-
-
-void ItalcCoreConnection::demoServerUnallowHost( const QString &host )
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::DemoServerUnallowHost ).
-						addArg( "host", host ) );
-}
-
-
-
-
-void ItalcCoreConnection::reportSlaveStateFlags()
-{
-	enqueueMessage( ItalcCore::Msg( ItalcCore::ReportSlaveStateFlags ) );
-}
-
-
-
-void ItalcCoreConnection::enqueueMessage( const ItalcCore::Msg &msg )
-{
-	ItalcCore::Msg m( msg );
-	m_vncConn->enqueueEvent( new ItalcMessageEvent( m ) );
-}
-
-
diff --git a/lib/src/ItalcVncConnection.cpp b/lib/src/ItalcVncConnection.cpp
deleted file mode 100644
index 1eb9e00..0000000
--- a/lib/src/ItalcVncConnection.cpp
+++ /dev/null
@@ -1,867 +0,0 @@
-/*
- * ItalcVncConnection.cpp - implementation of ItalcVncConnection class
- *
- * Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * code partly taken from KRDC / vncclientthread.cpp:
- * Copyright (C) 2007-2008 Urs Wolfer <uwolfer @ kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "AuthenticationCredentials.h"
-#include "DsaKey.h"
-#include "ItalcConfiguration.h"
-#include "ItalcVncConnection.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-#include "SocketDevice.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QMutexLocker>
-#include <QtCore/QTime>
-
-#include <rfb/dh.h>
-
-extern "C" void rfbClientEncryptBytes2( unsigned char *where, const int length, unsigned char *key );
-
-
-
-
-class KeyClientEvent : public ClientEvent
-{
-public:
-	KeyClientEvent( unsigned int key, bool pressed ) :
-		m_key( key ),
-		m_pressed( pressed )
-	{
-	}
-
-	virtual void fire( rfbClient *cl )
-	{
-		SendKeyEvent( cl, m_key, m_pressed );
-	}
-
-private:
-	unsigned int m_key;
-	bool m_pressed;
-} ;
-
-
-
-class PointerClientEvent : public ClientEvent
-{
-public:
-	PointerClientEvent( int x, int y, int buttonMask ) :
-		m_x( x ),
-		m_y( y ),
-		m_buttonMask( buttonMask )
-	{
-	}
-
-	virtual void fire( rfbClient *cl )
-	{
-		SendPointerEvent( cl, m_x, m_y, m_buttonMask );
-	}
-
-private:
-	int m_x;
-	int m_y;
-	int m_buttonMask;
-} ;
-
-
-
-class ClientCutEvent : public ClientEvent
-{
-public:
-	ClientCutEvent( const QString& text ) :
-		m_text( text.toUtf8() )
-	{
-	}
-
-	virtual void fire( rfbClient *cl )
-	{
-		SendClientCutText( cl, m_text.constData(), m_text.size() );
-	}
-
-private:
-	QByteArray m_text;
-} ;
-
-
-
-
-
-rfbBool ItalcVncConnection::hookNewClient( rfbClient *cl )
-{
-	ItalcVncConnection * t = (ItalcVncConnection *)
-					rfbClientGetClientData( cl, 0) ;
-
-	const int size = (int) cl->width * cl->height *
-					( cl->format.bitsPerPixel / 8 );
-	if( t->m_frameBuffer )
-	{
-		// do not leak if we get a new framebuffer size
-		delete [] t->m_frameBuffer;
-	}
-	t->m_frameBuffer = new uint8_t[size];
-	t->m_framebufferInitialized = false;
-	cl->frameBuffer = t->m_frameBuffer;
-	memset( cl->frameBuffer, '\0', size );
-	cl->format.bitsPerPixel = 32;
-	cl->format.redShift = 16;
-	cl->format.greenShift = 8;
-	cl->format.blueShift = 0;
-	cl->format.redMax = 0xff;
-	cl->format.greenMax = 0xff;
-	cl->format.blueMax = 0xff;
-
-	// only use remote cursor for remote control
-	cl->appData.useRemoteCursor = false;
-	cl->appData.compressLevel = 0;
-	cl->appData.useBGR233 = 0;
-	cl->appData.qualityLevel = 9;
-	cl->appData.enableJPEG = false;
-
-	switch( t->quality() )
-	{
-		case SnapshotQuality:
-			cl->appData.encodingsString = "raw";
-			break;
-		case RemoteControlQuality:
-			cl->appData.encodingsString = "copyrect hextile raw";
-			cl->appData.useRemoteCursor = true;
-			break;
-		case ThumbnailQuality:
-			cl->appData.useBGR233 = 1;
-			cl->appData.encodingsString = "tight zrle ultra "
-							"copyrect hextile zlib "
-							"corre rre raw";
-			cl->appData.compressLevel = 9;
-			cl->appData.qualityLevel = 5;
-			cl->appData.enableJPEG = true;
-			break;
-		case DemoServerQuality:
-			cl->appData.encodingsString = "copyrect corre rre raw";
-			//cl->appData.useRemoteCursor = true;
-			break;
-		case DemoClientQuality:
-			//cl->appData.useRemoteCursor = true;
-			cl->appData.encodingsString = "tight ultra copyrect "
-									"hextile zlib corre rre raw";
-			cl->appData.compressLevel = 9;
-			cl->appData.qualityLevel = 9;
-			cl->appData.enableJPEG = true;
-			break;
-		default:
-			cl->appData.encodingsString = "zrle ultra copyrect "
-							"hextile zlib corre rre raw";
-			break;
-	}
-
-	SetFormatAndEncodings( cl );
-
-	return true;
-}
-
-
-
-
-void ItalcVncConnection::hookUpdateFB( rfbClient *cl, int x, int y, int w, int h )
-{
-	QImage img( cl->frameBuffer, cl->width, cl->height, QImage::Format_RGB32 );
-
-	if( img.isNull() )
-	{
-		qWarning( "image not loaded" );
-		return;
-	}
-
-	ItalcVncConnection * t = (ItalcVncConnection *) rfbClientGetClientData( cl, 0 );
-
-	if( t->quality() == DemoServerQuality )
-	{
-		// if we're providing data for demo server, perform a simple
-		// color-reduction for better compression-results
-		for( int ry = y; ry < y+h; ++ry )
-		{
-			QRgb *data = ( (QRgb *) img.scanLine( ry ) );
-			for( int rx = x; rx < x+w; ++rx )
-			{
-				data[rx] &= 0xfcfcfc;
-			}
-		}
-	}
-
-	t->setImage( img );
-	t->m_framebufferInitialized = true;
-	t->imageUpdated( x, y, w, h );
-}
-
-
-
-
-void ItalcVncConnection::hookFinishFrameBufferUpdate( rfbClient *cl )
-{
-	ItalcVncConnection *t = (ItalcVncConnection *)
-					rfbClientGetClientData( cl, 0 );
-	t->m_scaledScreenNeedsUpdate = true;
-
-	t->framebufferUpdateComplete();
-}
-
-
-
-
-rfbBool ItalcVncConnection::hookHandleCursorPos( rfbClient *cl, int x, int y )
-{
-	ItalcVncConnection * t = (ItalcVncConnection *) rfbClientGetClientData( cl, 0 );
-	if( t )
-	{
-		t->cursorPosChanged( x, y );
-	}
-
-	return true;
-}
-
-
-
-
-void ItalcVncConnection::hookCursorShape( rfbClient *cl, int xh, int yh, int w, int h, int bpp )
-{
-	for( int i = 0; i < w*h;++i )
-	{
-		if( cl->rcMask[i] )
-		{
-			cl->rcMask[i] = 255;
-		}
-	}
-	QImage alpha( cl->rcMask, w, h, QImage::Format_Indexed8 );
-
-	QImage cursorShape = QImage( cl->rcSource, w, h, QImage::Format_RGB32 ).convertToFormat( QImage::Format_ARGB32 );
-	cursorShape.setAlphaChannel( alpha );
-
-	ItalcVncConnection* t = (ItalcVncConnection *) rfbClientGetClientData( cl, 0 );
-	t->cursorShapeUpdated( cursorShape, xh, yh );
-}
-
-
-
-void ItalcVncConnection::hookCutText( rfbClient *cl, const char *text,
-										int textlen )
-{
-	QString cutText = QString::fromUtf8( text, textlen );
-	if( !cutText.isEmpty() )
-	{
-		ItalcVncConnection *t = (ItalcVncConnection *)
-										rfbClientGetClientData( cl, 0 );
-		t->gotCut( cutText );
-	}
-}
-
-
-
-
-void ItalcVncConnection::hookOutputHandler( const char *format, ... )
-{
-	va_list args;
-	va_start( args, format );
-
-	QString message;
-	message.vsprintf( format, args );
-
-	va_end(args);
-
-	message = message.trimmed();
-	ilog( Warning, "ItalcVncConnection: " + message );
-
-#if 0
-	if( ( message.contains( "Couldn't convert " ) ) ||
-		( message.contains( "Unable to connect to VNC server" ) ) )
-	{
-		outputErrorMessageString = "Server not found.";
-	}
-
-	if( ( message.contains( "VNC connection failed: Authentication failed, "
-							"too many tries")) ||
-		( message.contains( "VNC connection failed: Too many "
-						"authentication failures" ) ) )
-	{
-		outputErrorMessageString = tr( "VNC authentication failed "
-				"because of too many authentication tries." );
-	}
-
-	if (message.contains("VNC connection failed: Authentication failed"))
-		outputErrorMessageString = tr("VNC authentication failed.");
-
-	if (message.contains("VNC server closed connection"))
-		outputErrorMessageString = tr("VNC server closed connection.");
-
-	// internal messages, not displayed to user
-	if (message.contains("VNC server supports protocol version 3.889")) // see http://bugs.kde.org/162640
-		outputErrorMessageString = "INTERNAL:APPLE_VNC_COMPATIBILTY";
-#endif
-}
-
-
-
-
-ItalcVncConnection::ItalcVncConnection( QObject *parent ) :
-	QThread( parent ),
-	m_frameBuffer( NULL ),
-	m_framebufferInitialized( false ),
-	m_cl( NULL ),
-	m_italcAuthType( ItalcAuthDSA ),
-	m_quality( DemoClientQuality ),
-	m_port( PortOffsetVncServer ),
-	m_framebufferUpdateInterval( 0 ),
-	m_image(),
-	m_scaledScreenNeedsUpdate( false ),
-	m_scaledScreen(),
-	m_scaledSize(),
-	m_state( Disconnected ),
-	m_stopped( false )
-{
-}
-
-
-
-ItalcVncConnection::~ItalcVncConnection()
-{
-	stop();
-
-	delete [] m_frameBuffer;
-}
-
-
-
-
-void ItalcVncConnection::stop()
-{
-	if( isRunning() )
-	{
-		m_stopped = true;
-		m_updateIntervalSleeper.wakeAll();
-
-		if( !wait( 1000 ) )
-		{
-			qWarning( "ItalcVncConnection::stop(): terminating thread" );
-			terminate();
-
-			while( !wait( 1000 ) )
-			{
-				qWarning( "ItalcVncConnection::stop(): terminated thread is still alive!" );
-			}
-		}
-	}
-}
-
-
-
-
-void ItalcVncConnection::reset( const QString &host )
-{
-	if( m_state != Connected && isRunning() )
-	{
-		setHost( host );
-	}
-	else
-	{
-		stop();
-		setHost( host );
-		start();
-	}
-}
-
-
-
-
-void ItalcVncConnection::setHost( const QString &host )
-{
-	QMutexLocker locker( &m_mutex );
-	m_host = host;
-	if( m_host.contains( ':' ) )
-	{
-		m_port = m_host.section( ':', 1, 1 ).toInt();
-		m_host = m_host.section( ':', 0, 0 );
-	}
-}
-
-
-
-
-void ItalcVncConnection::setPort( int port )
-{
-	QMutexLocker locker( &m_mutex );
-	m_port = port;
-}
-
-
-
-
-bool ItalcVncConnection::waitForConnected( int timeout ) const
-{
-	QTime startTime;
-	startTime.start();
-
-	while( !isConnected() && startTime.elapsed() < timeout )
-	{
-		if( QCoreApplication::instance() )
-		{
-			QCoreApplication::processEvents();
-		}
-	}
-
-	return isConnected();
-}
-
-
-
-
-void ItalcVncConnection::setImage( const QImage & img )
-{
-	m_imgLock.lockForWrite();
-	const QSize oldSize = m_image.size();
-	m_image = img;
-	m_imgLock.unlock();
-
-	if( img.size() != oldSize )
-	{
-		emit framebufferSizeChanged( img.width(), img.height() );
-	}
-}
-
-
-
-
-const QImage ItalcVncConnection::image( int x, int y, int w, int h ) const
-{
-	QReadLocker locker( &m_imgLock );
-
-	if( w == 0 || h == 0 ) // full image requested
-	{
-		return m_image;
-	}
-	return m_image.copy( x, y, w, h );
-}
-
-
-
-
-void ItalcVncConnection::setFramebufferUpdateInterval( int interval )
-{
-	m_framebufferUpdateInterval = interval;
-}
-
-
-
-
-void ItalcVncConnection::rescaleScreen()
-{
-	if( m_scaledSize.isNull() )
-	{
-		return;
-	}
-
-	if( m_scaledScreen.isNull() || m_scaledScreen.size() != m_scaledSize )
-	{
-		m_scaledScreen = QImage( m_scaledSize, QImage::Format_RGB32 );
-		m_scaledScreen.fill( Qt::black );
-	}
-
-	if( m_scaledScreenNeedsUpdate )
-	{
-		QReadLocker locker( &m_imgLock );
-		if( m_image.size().isValid() )
-		{
-			m_scaledScreenNeedsUpdate = false;
-			m_image.scaleTo( m_scaledScreen );
-		}
-	}
-}
-
-
-
-
-void ItalcVncConnection::run()
-{
-	m_state = Disconnected;
-	emit stateChanged( m_state );
-	m_stopped = false;
-
-	rfbClientLog = hookOutputHandler;
-	rfbClientErr = hookOutputHandler;
-
-	while( m_stopped == false )
-	{
-		doConnection();
-	}
-}
-
-
-
-void ItalcVncConnection::doConnection()
-{
-	QMutex sleeperMutex;
-
-	while( !m_stopped && m_state != Connected ) // try to connect as long as the server allows
-	{
-		m_cl = rfbGetClient( 8, 3, 4 );
-		m_cl->MallocFrameBuffer = hookNewClient;
-		m_cl->canHandleNewFBSize = true;
-		m_cl->GotFrameBufferUpdate = hookUpdateFB;
-		m_cl->FinishedFrameBufferUpdate = hookFinishFrameBufferUpdate;
-		m_cl->HandleCursorPos = hookHandleCursorPos;
-		m_cl->GotCursorShape = hookCursorShape;
-		m_cl->GotXCutText = hookCutText;
-		rfbClientSetClientData( m_cl, 0, this );
-
-		m_mutex.lock();
-
-		if( m_port < 0 ) // port is invalid or empty...
-		{
-			m_port = PortOffsetVncServer;
-		}
-
-		if( m_port >= 0 && m_port < 100 )
-		{
-			 // the user most likely used the short form (e.g. :1)
-			m_port += PortOffsetVncServer;
-		}
-
-		free( m_cl->serverHost );
-		m_cl->serverHost = strdup( m_host.toUtf8().constData() );
-		m_cl->serverPort = m_port;
-
-		m_mutex.unlock();
-
-		emit newClient( m_cl );
-
-		int argc = 0;
-		if( rfbInitClient( m_cl, &argc, NULL ) )
-		{
-			emit connected();
-
-			m_state = Connected;
-			emit stateChanged( m_state );
-			if( m_framebufferUpdateInterval < 0 )
-			{
-				rfbClientSetClientData( m_cl, (void *) 0x555, (void *) 1 );
-			}
-		}
-		else
-		{
-			// guess reason why connection failed based on the state,
-			// libvncclient left the rfbClient structure
-			if( argc < 0 )
-			{
-				m_state = HostUnreachable;
-				emit stateChanged( m_state );
-			}
-			else if( argc > 0 )
-			{
-				m_state = AuthenticationFailed;
-				emit stateChanged( m_state );
-			}
-			else
-			{
-				// failed for an unknown reason
-				m_state = ConnectionFailed;
-				emit stateChanged( m_state );
-			}
-
-			// do not sleep when already requested to stop
-			if( m_stopped )
-			{
-				break;
-			}
-
-			// wait a bit until next connect
-			sleeperMutex.lock();
-			if( m_framebufferUpdateInterval > 0 )
-			{
-				m_updateIntervalSleeper.wait( &sleeperMutex,
-												m_framebufferUpdateInterval );
-			}
-			else
-			{
-				// default: retry every second
-				m_updateIntervalSleeper.wait( &sleeperMutex, 1000 );
-			}
-			sleeperMutex.unlock();
-		}
-	}
-
-	//QTime lastFullUpdate = QTime::currentTime();
-
-	// Main VNC event loop
-	while( !m_stopped )
-	{
-		int timeout = 500;
-		if( m_framebufferUpdateInterval < 0 )
-		{
-			timeout = 100*1000;	// 100 ms
-		}
-		const int i = WaitForMessage( m_cl, timeout );
-		if( m_stopped || i < 0 )
-		{
-			break;
-		}
-		else if( i )
-		{
-			// handle all available messages
-			bool handledOkay = true;
-			do {
-				if( !HandleRFBServerMessage( m_cl ) )
-				{
-					handledOkay = false;
-				}
-			} while( handledOkay && WaitForMessage( m_cl, 0 ) );
-
-			if( handledOkay == false )
-			{
-				break;
-			}
-		}
-		else
-		{
-		/*	// work around a bug in UltraVNC on Win7 where it does not handle
-			// incremental updates correctly
-			int msecs = lastFullUpdate.msecsTo( QTime::currentTime() );
-			if( ( m_framebufferUpdateInterval > 0 &&
-					msecs > 10*m_framebufferUpdateInterval ) ||
-				( m_framebufferUpdateInterval == 0 && msecs > 1000 ) )
-			{
-				SendFramebufferUpdateRequest( m_cl, 0, 0,
-						framebufferSize().width(), framebufferSize().height(),
-						false );
-				lastFullUpdate = QTime::currentTime();
-			}*/
-		}
-
-		m_mutex.lock();
-
-		while( !m_eventQueue.isEmpty() )
-		{
-			ClientEvent * clientEvent = m_eventQueue.dequeue();
-
-			// unlock the queue mutex during the runtime of ClientEvent::fire()
-			m_mutex.unlock();
-
-			clientEvent->fire( m_cl );
-			delete clientEvent;
-
-			// and lock it again
-			m_mutex.lock();
-		}
-
-		m_mutex.unlock();
-
-		if( m_framebufferUpdateInterval > 0 && m_stopped == false )
-		{
-			sleeperMutex.lock();
-			m_updateIntervalSleeper.wait( &sleeperMutex,
-												m_framebufferUpdateInterval );
-			sleeperMutex.unlock();
-		}
-	}
-
-	if( m_state == Connected && m_cl )
-	{
-		rfbClientCleanup( m_cl );
-	}
-
-	m_state = Disconnected;
-	emit stateChanged( m_state );
-}
-
-
-
-
-void ItalcVncConnection::enqueueEvent( ClientEvent *e )
-{
-	QMutexLocker lock( &m_mutex );
-	if( m_state != Connected )
-	{
-		return;
-	}
-
-	m_eventQueue.enqueue( e );
-}
-
-
-
-
-void ItalcVncConnection::mouseEvent( int x, int y, int buttonMask )
-{
-	enqueueEvent( new PointerClientEvent( x, y, buttonMask ) );
-}
-
-
-
-
-void ItalcVncConnection::keyEvent( unsigned int key, bool pressed )
-{
-	enqueueEvent( new KeyClientEvent( key, pressed ) );
-}
-
-
-
-
-void ItalcVncConnection::clientCut( const QString &text )
-{
-	enqueueEvent( new ClientCutEvent( text ) );
-}
-
-
-
-
-void ItalcVncConnection::handleSecTypeItalc( rfbClient *client )
-{
-	SocketDevice socketDev( libvncClientDispatcher, client );
-
-	// read list of supported authentication types
-	QMap<QString, QVariant> supportedAuthTypes = socketDev.read().toMap();
-
-	int chosenAuthType = ItalcAuthCommonSecret;
-	if( !supportedAuthTypes.isEmpty() )
-	{
-		chosenAuthType = supportedAuthTypes.values().first().toInt();
-
-		// look whether the ItalcVncConnection recommends a specific
-		// authentication type (e.g. ItalcAuthHostBased when running as
-		// demo client)
-		ItalcVncConnection *t = (ItalcVncConnection *)
-										rfbClientGetClientData( client, 0 );
-
-		if( t != NULL )
-		{
-			foreach( const QVariant &v, supportedAuthTypes )
-			{
-				if( t->italcAuthType() == v.toInt() )
-				{
-					chosenAuthType = v.toInt();
-				}
-			}
-		}
-	}
-
-	socketDev.write( QVariant( chosenAuthType ) );
-	// send username which is used when displaying an access confirm dialog
-	if( ItalcCore::authenticationCredentials->hasCredentials(
-									AuthenticationCredentials::UserLogon ) )
-	{
-		socketDev.write( ItalcCore::authenticationCredentials->logonUsername() );
-	}
-	else
-	{
-		socketDev.write( LocalSystem::User::loggedOnUser().name() );
-	}
-
-	if( chosenAuthType == ItalcAuthDSA )
-	{
-		if( ItalcCore::authenticationCredentials->hasCredentials(
-				AuthenticationCredentials::PrivateKey ) )
-		{
-			QByteArray chall = socketDev.read().toByteArray();
-			socketDev.write( QVariant( (int) ItalcCore::role ) );
-			socketDev.write( ItalcCore::authenticationCredentials->
-													privateKey()->sign( chall ) );
-		}
-	}
-	else if( chosenAuthType == ItalcAuthHostBased )
-	{
-		// nothing to do - we just get accepted if our IP is in the list of
-		// allowed hosts
-	}
-	else if( chosenAuthType == ItalcAuthCommonSecret )
-	{
-		socketDev.write( ItalcCore::authenticationCredentials->commonSecret() );
-	}
-	else if( chosenAuthType == ItalcAuthNone )
-	{
-		// nothing to do - we just get accepted
-	}
-}
-
-
-
-
-void ItalcVncConnection::handleMsLogonIIAuth( rfbClient *client )
-{
-	char gen[8], mod[8], pub[8], resp[8];
-	char user[256], passwd[64];
-	unsigned char key[8];
-
-	ReadFromRFBServer(client, gen, sizeof(gen));
-	ReadFromRFBServer(client, mod, sizeof(mod));
-	ReadFromRFBServer(client, resp, sizeof(resp));
-
-	DiffieHellman dh(bytesToInt64(gen), bytesToInt64(mod));
-	int64ToBytes(dh.createInterKey(), pub);
-
-	WriteToRFBServer(client, pub, sizeof(pub));
-
-	int64ToBytes(dh.createEncryptionKey(bytesToInt64(resp)), (char*) key);
-
-	strcpy( user, ItalcCore::authenticationCredentials->
-										logonUsername().toUtf8().constData() );
-	strcpy( passwd, ItalcCore::authenticationCredentials->
-										logonPassword().toUtf8().constData() );
-
-	rfbClientEncryptBytes2((unsigned char*) user, sizeof(user), key);
-	rfbClientEncryptBytes2((unsigned char*) passwd, sizeof(passwd), key);
-
-	WriteToRFBServer(client, user, sizeof(user));
-	WriteToRFBServer(client, passwd, sizeof(passwd));
-}
-
-
-
-
-
-// global auth handlers used in modified libvncclient
-
-int isLogonAuthenticationEnabled( rfbClient *client )
-{
-	if( ItalcCore::config->isLogonAuthenticationEnabled() &&
-			ItalcCore::authenticationCredentials->hasCredentials(
-										AuthenticationCredentials::UserLogon ) )
-	{
-
-		return 1;
-	}
-
-	return 0;
-}
-
-
-void handleSecTypeItalc( rfbClient *client )
-{
-	ItalcVncConnection::handleSecTypeItalc( client );
-}
-
-
-void handleMsLogonIIAuth( rfbClient *client )
-{
-	ItalcVncConnection::handleMsLogonIIAuth( client );
-}
-
-
diff --git a/lib/src/LocalSystem.cpp b/lib/src/LocalSystem.cpp
deleted file mode 100644
index 467cb98..0000000
--- a/lib/src/LocalSystem.cpp
+++ /dev/null
@@ -1,1183 +0,0 @@
-/*
- * LocalSystem.cpp - namespace LocalSystem, providing an interface for
- *				   transparent usage of operating-system-specific functions
- *
- * Copyright (c) 2006-2012 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QDir>
-#include <QtCore/QProcess>
-#include <QtGui/QWidget>
-#include <QtNetwork/QHostInfo>
-
-
-#ifdef ITALC_BUILD_WIN32
-
-#include <QtCore/QLibrary>
-
-#include <windows.h>
-#include <shlobj.h>
-#include <wtsapi32.h>
-#include <sddl.h>
-#include <userenv.h>
-#include <lm.h>
-
-
-namespace LocalSystem
-{
-
-// taken from qt-win-opensource-src-4.2.2/src/corelib/io/qsettings.cpp
-QString windowsConfigPath( int _type )
-{
-	QString result;
-
-	QLibrary library( "shell32" );
-	typedef BOOL( WINAPI* GetSpecialFolderPath )( HWND, char *, int, BOOL );
-	GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath)
-				library.resolve( "SHGetSpecialFolderPathA" );
-	if( SHGetSpecialFolderPath )
-	{
-		char path[MAX_PATH];
-		SHGetSpecialFolderPath( 0, path, _type, FALSE );
-		result = QString::fromLocal8Bit( path );
-	}
-	return( result );
-}
-
-}
-
-#endif
-
-
-#ifdef ITALC_HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef ITALC_HAVE_PWD_H
-#include <pwd.h>
-#endif
-
-#ifdef ITALC_HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef ITALC_HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef ITALC_HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef ITALC_HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include "ItalcConfiguration.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-
-
-
-namespace LocalSystem
-{
-
-
-Desktop::Desktop( const QString &name ) :
-	m_name( name )
-{
-#ifdef ITALC_BUILD_WIN32
-	if( m_name.isEmpty() )
-	{
-		m_name = "winsta0\\default";
-	}
-#endif
-}
-
-
-
-Desktop::Desktop( const Desktop &desktop ) :
-	m_name( desktop.name() )
-{
-}
-
-
-
-Desktop Desktop::activeDesktop()
-{
-	QString deskName;
-
-#ifdef ITALC_BUILD_WIN32
-	HDESK desktopHandle = OpenInputDesktop( 0, TRUE, DESKTOP_READOBJECTS );
-
-	char dname[256];
-	dname[0] = 0;
-	if( GetUserObjectInformation( desktopHandle, UOI_NAME, dname,
-									sizeof( dname ), NULL ) )
-	{
-		deskName = QString( "winsta0\\%1" ).arg( dname );
-	}
-	CloseDesktop( desktopHandle );
-#endif
-
-	return Desktop( deskName );
-}
-
-
-
-Desktop Desktop::screenLockDesktop()
-{
-	return Desktop( "ScreenLockSlaveDesktop" );
-}
-
-
-
-
-User::User( const QString &name, const QString &dom, const QString &fullname ) :
-	m_userToken( 0 ),
-	m_name( name ),
-	m_domain( dom ),
-	m_fullName( fullname )
-{
-#ifdef ITALC_BUILD_WIN32
-	// try to look up the user -> domain
-	DWORD sidLen = 256;
-	char domainName[MAX_PATH];
-	domainName[0] = 0;
-	char *sid = new char[sidLen];
-	DWORD domainLen = MAX_PATH;
-	SID_NAME_USE snu;
-	m_userToken = sid;
-
-	if( !LookupAccountName( NULL,		// system name
-							m_name.toAscii().constData(),
-							m_userToken,		// SID
-							&sidLen,
-							domainName,
-							&domainLen,
-							&snu ) )
-	{
-		qCritical( "Could not look up SID structure" );
-		return;
-	}
-
-	if( m_domain.isEmpty() )
-	{
-		CHAR computerName[MAX_PATH];
-		DWORD size = MAX_PATH;
-		GetComputerName( computerName, &size );
-
-		if( QString( domainName ) != computerName )
-		{
-			m_domain = domainName;
-		}
-	}
-
-#else
-	m_userToken = getuid();
-#endif
-}
-
-
-#ifdef ITALC_BUILD_WIN32
-static void copySid( const PSID &src, PSID &dst )
-{
-	if( src )
-	{
-		const int sidLen = GetLengthSid( src );
-		if( sidLen )
-		{
-			dst = new char[sidLen];
-			CopySid( sidLen, dst, src );
-		}
-	}
-}
-
-#endif
-
-User::User( Token userToken ) :
-	m_userToken( userToken ),
-	m_name(),
-	m_domain(),
-	m_fullName()
-{
-#ifdef ITALC_BUILD_WIN32
-	copySid( userToken, m_userToken );
-#endif
-
-	lookupNameAndDomain();
-}
-
-
-
-User::User( const User &user ) :
-	m_userToken( user.userToken() ),
-	m_name( user.name() ),
-	m_domain( user.domain() ),
-	m_fullName( user.m_fullName )
-{
-#ifdef ITALC_BUILD_WIN32
-	copySid( user.userToken(), m_userToken );
-#endif
-}
-
-
-
-User::~User()
-{
-#ifdef ITALC_BUILD_WIN32
-	if( m_userToken )
-	{
-		delete[] (char *) m_userToken;
-	}
-#endif
-}
-
-
-#ifdef ITALC_BUILD_WIN32
-static QString querySessionInformation( DWORD sessionId,
-										WTS_INFO_CLASS infoClass )
-{
-	QString result;
-	LPTSTR pBuffer = NULL;
-	DWORD dwBufferLen;
-	if( WTSQuerySessionInformation(
-					WTS_CURRENT_SERVER_HANDLE,
-					sessionId,
-					infoClass,
-					&pBuffer,
-					&dwBufferLen ) )
-	{
-		result = pBuffer;
-	}
-	WTSFreeMemory( pBuffer );
-
-	return result;
-}
-#endif
-
-
-
-User User::loggedOnUser()
-{
-	QString userName = "unknown";
-	QString domainName = QHostInfo::localDomainName();
-
-#ifdef ITALC_BUILD_WIN32
-
-	DWORD sessionId = WTSGetActiveConsoleSessionId();
-
-	userName = querySessionInformation( sessionId, WTSUserName );
-	domainName = querySessionInformation( sessionId, WTSDomainName );
-
-	// check whether we just got the name of the local computer
-	if( !domainName.isEmpty() )
-	{
-		CHAR computerName[MAX_PATH];
-		DWORD size = MAX_PATH;
-		GetComputerName( computerName, &size );
-
-		if( domainName == computerName )
-		{
-			// reset domain name as storing the local computer's name
-			// doesn't help here
-			domainName = QString();
-		}
-	}
-
-#else
-
-	char * envUser = getenv( "USER" );
-
-#ifdef ITALC_HAVE_PWD_H
-	struct passwd * pw_entry = NULL;
-	if( envUser )
-	{
-		pw_entry = getpwnam( envUser );
-	}
-	if( !pw_entry )
-	{
-		pw_entry = getpwuid( getuid() );
-	}
-	if( pw_entry )
-	{
-		QString shell( pw_entry->pw_shell );
-
-		// Skip not real users
-		if ( !( shell.endsWith( "/false" ) ||
-				shell.endsWith( "/true" ) ||
-				shell.endsWith( "/null" ) ||
-				shell.endsWith( "/nologin") ) )
-		{
-			userName = QString::fromUtf8( pw_entry->pw_name );
-		}
-	}
-#endif	/* ITALC_HAVE_PWD_H */
-
-	if( userName.isEmpty() )
-	{
-		userName = QString::fromUtf8( envUser );
-	}
-
-#endif
-
-	return User( userName, domainName );
-}
-
-
-
-
-QString User::homePath() const
-{
-	QString homePath = QDir::homePath();
-
-#ifdef ITALC_BUILD_WIN32
-	LocalSystem::Process userProcess(
-				LocalSystem::Process::findProcessId( QString(), -1, this ) );
-	HANDLE hToken;
-	if( OpenProcessToken( userProcess.processHandle(),
-									MAXIMUM_ALLOWED, &hToken ) )
-	{
-		CHAR userProfile[MAX_PATH];
-		DWORD size = MAX_PATH;
-		if( GetUserProfileDirectory( hToken, userProfile, &size ) )
-		{
-			homePath = userProfile;
-			CloseHandle( hToken );
-		}
-		else
-		{
-			ilog_failedf( "GetUserProfileDirectory()", "%d", GetLastError() );
-		}
-	}
-	else
-	{
-		ilog_failedf( "OpenProcessToken()", "%d", GetLastError() );
-	}
-#endif
-
-	return homePath;
-}
-
-
-
-
-void User::lookupNameAndDomain()
-{
-	if( !m_name.isEmpty() && !m_domain.isEmpty() )
-	{
-		return;
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	DWORD accNameLen = 0;
-	DWORD domainNameLen = 0;
-	SID_NAME_USE snu;
-	LookupAccountSid( NULL, userToken(), NULL, &accNameLen, NULL,
-							&domainNameLen, &snu );
-	if( accNameLen == 0 || domainNameLen == 0 )
-	{
-		return;
-	}
-
-	char * accName = new char[accNameLen];
-	char * domainName = new char[domainNameLen];
-	LookupAccountSid( NULL, userToken(), accName, &accNameLen,
-						domainName, &domainNameLen, &snu );
-
-	if( m_name.isEmpty() )
-	{
-		m_name = accName;
-	}
-
-	if( m_domain.isEmpty() )
-	{
-		CHAR computerName[MAX_PATH];
-		DWORD size = MAX_PATH;
-		GetComputerName( computerName, &size );
-
-		if( QString( domainName ) != computerName )
-		{
-			m_domain = domainName;
-		}
-	}
-
-	delete[] accName;
-	delete[] domainName;
-
-#else	/* ITALC_BUILD_WIN32 */
-
-	struct passwd * pw_entry = getpwuid( m_userToken );
-	if( pw_entry )
-	{
-		QString shell( pw_entry->pw_shell );
-
-		// Skip not real users
-		if ( !( shell.endsWith( "/false" ) ||
-				shell.endsWith( "/true" ) ||
-				shell.endsWith( "/null" ) ||
-				shell.endsWith( "/nologin") ) )
-		{
-			m_name = QString::fromUtf8( pw_entry->pw_name );
-		}
-	}
-
-	m_domain = QHostInfo::localDomainName();
-#endif
-}
-
-
-
-
-void User::lookupFullName()
-{
-	lookupNameAndDomain();
-
-#ifdef ITALC_BUILD_WIN32
-	char * accName = qstrdup( m_name.toAscii().constData() );
-	char * domainName = qstrdup( m_domain.toAscii().constData() );
-
-	// try to retrieve user's full name from domain
-	WCHAR wszDomain[256];
-	MultiByteToWideChar( CP_ACP, 0, domainName,
-			strlen( domainName ) + 1, wszDomain, sizeof( wszDomain ) /
-											sizeof( wszDomain[0] ) );
-	WCHAR wszUser[256];
-	MultiByteToWideChar( CP_ACP, 0, accName,
-			strlen( accName ) + 1, wszUser, sizeof( wszUser ) /
-											sizeof( wszUser[0] ) );
-
-	PBYTE dc = NULL;	// domain controller
-	if( NetGetDCName( NULL, wszDomain, &dc ) != NERR_Success )
-	{
-		dc = NULL;
-	}
-
-	LPUSER_INFO_2 pBuf = NULL;
-	NET_API_STATUS nStatus = NetUserGetInfo( (LPWSTR)dc, wszUser, 2,
-												(LPBYTE *) &pBuf );
-	if( nStatus == NERR_Success && pBuf != NULL )
-	{
-		int len = WideCharToMultiByte( CP_ACP, 0, pBuf->usri2_full_name,
-											-1, NULL, 0, NULL, NULL );
-		if( len > 0 )
-		{
-			char *mbstr = new char[len];
-			len = WideCharToMultiByte( CP_ACP, 0, pBuf->usri2_full_name,
-										-1, mbstr, len, NULL, NULL );
-			if( strlen( mbstr ) >= 1 )
-			{
-				m_fullName = mbstr;
-			}
-			delete[] mbstr;
-		}
-	}
-
-	if( pBuf != NULL )
-	{
-		NetApiBufferFree( pBuf );
-	}
-	if( dc != NULL )
-	{
-		NetApiBufferFree( dc );
-	}
-
-	delete[] accName;
-	delete[] domainName;
-
-#else
-
-#ifdef ITALC_HAVE_PWD_H
-	struct passwd * pw_entry = getpwnam( m_name.toUtf8().constData() );
-	if( !pw_entry )
-	{
-		pw_entry = getpwuid( m_userToken );
-	}
-	if( pw_entry )
-	{
-		QString shell( pw_entry->pw_shell );
-
-		// Skip not real users
-		if ( !( shell.endsWith( "/false" ) ||
-				shell.endsWith( "/true" ) ||
-				shell.endsWith( "/null" ) ||
-				shell.endsWith( "/nologin") ) )
-		{
-			m_fullName = QString::fromUtf8( pw_entry->pw_gecos );
-		}
-	}
-#endif
-
-#endif
-}
-
-
-
-
-
-Process::Process( int pid ) :
-	m_processHandle( 0 )
-{
-#ifdef ITALC_BUILD_WIN32
-	if( pid >= 0 )
-	{
-		m_processHandle = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pid );
-	}
-#endif
-}
-
-
-
-Process::~Process()
-{
-#ifdef ITALC_BUILD_WIN32
-	if( m_processHandle )
-	{
-		CloseHandle( m_processHandle );
-	}
-#endif
-}
-
-
-
-#ifdef ITALC_BUILD_WIN32
-static DWORD findProcessId_WTS( const QString &processName, DWORD sessionId,
-													const User *processOwner )
-{
-	PWTS_PROCESS_INFO pProcessInfo = NULL;
-	DWORD processCount = 0;
-	DWORD pid = -1;
-
-	if( !WTSEnumerateProcesses( WTS_CURRENT_SERVER_HANDLE, 0, 1, &pProcessInfo,
-								&processCount ) )
-	{
-		return pid;
-	}
-
-	for( DWORD proc = 0; (int)pid < 0 && proc < processCount; ++proc )
-	{
-		if( pProcessInfo[proc].ProcessId == 0 )
-		{
-			continue;
-		}
-		if( processName.isEmpty() ||
-				processName.compare( pProcessInfo[proc].pProcessName,
-												Qt::CaseInsensitive	) == 0 )
-		{
-			if( (int) sessionId < 0 ||
-						sessionId == pProcessInfo[proc].SessionId )
-			{
-				if( processOwner == NULL )
-				{
-					pid = pProcessInfo[proc].ProcessId;
-				}
-				else if( pProcessInfo[proc].pUserSid != NULL )
-				{
-					if( EqualSid( pProcessInfo[proc].pUserSid,
-									processOwner->userToken() ) )
-					{
-						pid = pProcessInfo[proc].ProcessId;
-					}
-				}
-			}
-		}
-	}
-
-	WTSFreeMemory( pProcessInfo );
-
-	return pid;
-}
-
-
-#include <tlhelp32.h>
-
-static DWORD findProcessId_TH32( const QString &processName, DWORD sessionId,
-													const User *processOwner )
-{
-	DWORD pid = -1;
-	PROCESSENTRY32 procEntry;
-
-	HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
-	if( hSnap == INVALID_HANDLE_VALUE )
-	{
-		return -1;
-	}
-
-	procEntry.dwSize = sizeof( PROCESSENTRY32 );
-
-	if( !Process32First( hSnap, &procEntry ) )
-	{
-		CloseHandle( hSnap );
-		return -1;
-	}
-
-	do
-	{
-		if( processName.isEmpty() ||
-				processName.compare( procEntry.szExeFile,
-									Qt::CaseInsensitive ) == 0 )
-		{
-			if( processOwner == NULL )
-			{
-				pid = procEntry.th32ProcessID;
-				break;
-			}
-			else
-			{
-				User *u = Process( procEntry.th32ProcessID ).getProcessOwner();
-				if( u && EqualSid( u->userToken(), processOwner->userToken() ) )
-				{
-					pid = procEntry.th32ProcessID;
-					break;
-				}
-				delete u;
-			}
-		}
-	}
-	while( Process32Next( hSnap, &procEntry ) );
-
-	CloseHandle( hSnap );
-
-	return pid;
-}
-#endif
-
-
-
-int Process::findProcessId( const QString &processName,
-							int sessionId, const User *processOwner )
-{
-	LogStream( Logger::LogLevelDebug )
-			<< "Process::findProcessId("
-				<< processName
-				<< sessionId
-				<< processOwner
-			<< ")";
-
-	int pid = -1;
-#ifdef ITALC_BUILD_WIN32
-	pid = findProcessId_WTS( processName, sessionId, processOwner );
-	ilogf( Debug, "findProcessId_WTS(): %d", pid );
-	if( pid < 0 )
-	{
-		pid = findProcessId_TH32( processName, sessionId, processOwner );
-		ilogf( Debug, "findProcessId_TH32(): %d", pid );
-	}
-#endif
-	return pid;
-}
-
-
-
-
-User *Process::getProcessOwner()
-{
-#ifdef ITALC_BUILD_WIN32
-	HANDLE hToken;
-	OpenProcessToken( m_processHandle, TOKEN_READ, &hToken );
-
-	DWORD len = 0;
-
-	GetTokenInformation( hToken, TokenUser, NULL, 0, &len ) ;
-	if( len <= 0 )
-	{
-		ilog_failedf( "GetTokenInformation()", "%d", GetLastError() );
-		CloseHandle( hToken );
-		return NULL;
-	}
-
-	char *buf = new char[len];
-	if( buf == NULL )
-	{
-		CloseHandle( hToken );
-		return NULL;
-	}
-
-	if ( !GetTokenInformation( hToken, TokenUser, buf, len, &len ) )
-	{
-		ilog_failedf( "GetTokenInformation() (2)", "%d", GetLastError() );
-		delete[] buf;
-		CloseHandle( hToken );
-		return NULL;
-	}
-
-	User *user = new User( ((TOKEN_USER*) buf)->User.Sid );
-
-	delete[] buf;
-	CloseHandle( hToken );
-
-	return user;
-#else
-	return NULL;
-#endif
-}
-
-
-
-
-Process::Handle Process::runAsUser( const QString &proc,
-									const QString &desktop )
-{
-#ifdef ITALC_BUILD_WIN32
-	enablePrivilege( SE_ASSIGNPRIMARYTOKEN_NAME, true );
-	enablePrivilege( SE_INCREASE_QUOTA_NAME, true );
-	HANDLE hToken = NULL;
-
-	if( !OpenProcessToken( processHandle(), MAXIMUM_ALLOWED, &hToken ) )
-	{
-		ilog_failedf( "OpenProcessToken()", "%d", GetLastError() );
-		return NULL;
-	}
-
-	if( !ImpersonateLoggedOnUser( hToken ) )
-	{
-		ilog_failedf( "ImpersonateLoggedOnUser()", "%d", GetLastError() );
-		return NULL;
-	}
-
-	STARTUPINFO si;
-	PROCESS_INFORMATION pi;
-	ZeroMemory( &si, sizeof( STARTUPINFO ) );
-	si.cb = sizeof( STARTUPINFO );
-	if( !desktop.isEmpty() )
-	{
-		si.lpDesktop = (CHAR *) qstrdup( desktop.toAscii().constData() );
-	}
-	HANDLE hNewToken = NULL;
-
-	DuplicateTokenEx( hToken, TOKEN_ASSIGN_PRIMARY|TOKEN_ALL_ACCESS, NULL,
-						SecurityImpersonation, TokenPrimary, &hNewToken );
-
-	if( !CreateProcessAsUser(
-				hNewToken,			// client's access token
-				NULL,			  // file to execute
-				(CHAR *) proc.toUtf8().constData(),	 // command line
-				NULL,			  // pointer to process SECURITY_ATTRIBUTES
-				NULL,			  // pointer to thread SECURITY_ATTRIBUTES
-				FALSE,			 // handles are not inheritable
-				NORMAL_PRIORITY_CLASS,   // creation flags
-				NULL,			  // pointer to new environment block
-				NULL,			  // name of current directory
-				&si,			   // pointer to STARTUPINFO structure
-				&pi				// receives information about new process
-				) )
-	{
-		ilog_failedf( "CreateProcessAsUser()", "%d", GetLastError() );
-		return NULL;
-	}
-
-	delete[] si.lpDesktop;
-
-	CloseHandle( hNewToken );
-	RevertToSelf();
-	CloseHandle( hToken );
-
-	return pi.hProcess;
-#else
-	QProcess::startDetached( proc );
-	return 0;
-#endif
-}
-
-
-
-
-bool Process::isRunningAsAdmin()
-{
-#ifdef ITALC_BUILD_WIN32
-	BOOL runningAsAdmin = false;
-	PSID adminGroupSid = NULL;
-
-	// allocate and initialize a SID of the administrators group.
-	SID_IDENTIFIER_AUTHORITY NtAuthority = { SECURITY_NT_AUTHORITY };
-	if( AllocateAndInitializeSid(
-		&NtAuthority,
-		2,
-		SECURITY_BUILTIN_DOMAIN_RID,
-		DOMAIN_ALIAS_RID_ADMINS,
-		0, 0, 0, 0, 0, 0,
-		&adminGroupSid ) )
-	{
-		// determine whether the SID of administrators group is enabled in
-		// the primary access token of the process.
-		CheckTokenMembership( NULL, adminGroupSid, &runningAsAdmin );
-	}
-
-	if( adminGroupSid )
-	{
-		FreeSid( adminGroupSid );
-	}
-
-	return runningAsAdmin;
-#else
-	return true;
-#endif
-}
-
-
-
-
-bool Process::runAsAdmin( const QString &appPath, const QString &parameters )
-{
-#ifdef ITALC_BUILD_WIN32
-	SHELLEXECUTEINFO sei = { sizeof(sei) };
-	sei.lpVerb = "runas";
-	sei.lpFile = appPath.toUtf8().constData();
-	sei.hwnd = GetForegroundWindow();
-	sei.lpParameters = parameters.toUtf8().constData();
-	sei.nShow = SW_NORMAL;
-
-	if( !ShellExecuteEx( &sei ) )
-	{
-		if( GetLastError() == ERROR_CANCELLED )
-		{
-			// the user refused the elevation - do nothing
-		}
-		return false;
-	}
-#endif
-
-	return true;
-}
-
-
-
-
-
-void sleep( const int _ms )
-{
-#ifdef ITALC_BUILD_WIN32
-	Sleep( static_cast<unsigned int>( _ms ) );
-#else
-	struct timespec ts = { _ms / 1000, ( _ms % 1000 ) * 1000 * 1000 } ;
-	nanosleep( &ts, NULL );
-#endif
-}
-
-
-
-
-void broadcastWOLPacket( const QString & _mac )
-{
-	const int PORT_NUM = 65535;
-	const int MAC_SIZE = 6;
-	const int OUTBUF_SIZE = MAC_SIZE*17;
-	unsigned char mac[MAC_SIZE];
-	char out_buf[OUTBUF_SIZE];
-
-	if( sscanf( _mac.toAscii().constData(),
-				"%2x:%2x:%2x:%2x:%2x:%2x",
-				(unsigned int *) &mac[0],
-				(unsigned int *) &mac[1],
-				(unsigned int *) &mac[2],
-				(unsigned int *) &mac[3],
-				(unsigned int *) &mac[4],
-				(unsigned int *) &mac[5] ) != MAC_SIZE )
-	{
-		qWarning( "invalid MAC-address" );
-		return;
-	}
-
-	for( int i = 0; i < MAC_SIZE; ++i )
-	{
-		out_buf[i] = 0xff;
-	}
-
-	for( int i = 1; i < 17; ++i )
-	{
-		for(int j = 0; j < MAC_SIZE; ++j )
-		{
-			out_buf[i*MAC_SIZE+j] = mac[j];
-		}
-	}
-
-#ifdef ITALC_BUILD_WIN32
-	WSADATA info;
-	if( WSAStartup( MAKEWORD( 2, 0 ), &info ) != 0 )
-	{
-		qCritical( "cannot initialize WinSock!" );
-		return;
-	}
-#endif
-
-	// UDP-broadcast the MAC-address
-	unsigned int sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
-	struct sockaddr_in my_addr;
-	my_addr.sin_family	  = AF_INET;			// Address family to use
-	my_addr.sin_port		= htons( PORT_NUM );	// Port number to use
-	my_addr.sin_addr.s_addr = inet_addr( "255.255.255.255" ); // send to
-								  // IP_ADDR
-
-	int optval = 1;
-	if( setsockopt( sock, SOL_SOCKET, SO_BROADCAST, (char *) &optval,
-							sizeof( optval ) ) < 0 )
-	{
-		qCritical( "can't set sockopt (%d).", errno );
-		return;
-	}
-
-	sendto( sock, out_buf, sizeof( out_buf ), 0,
-			(struct sockaddr*) &my_addr, sizeof( my_addr ) );
-#ifdef ITALC_BUILD_WIN32
-	closesocket( sock );
-	WSACleanup();
-#else
-	close( sock );
-#endif
-
-
-#if 0
-#ifdef ITALC_BUILD_LINUX
-	QProcess::startDetached( "etherwake " + _mac );
-#endif
-#endif
-}
-
-
-
-static inline void pressAndReleaseKey( int _key )
-{
-}
-
-
-void logonUser( const QString & _uname, const QString & _passwd,
-						const QString & _domain )
-{
-	// TODO
-}
-
-
-
-
-QString Path::expand( QString path )
-{
-	QString p = QDTNS( path.replace( "$HOME", QDir::homePath() ).
-						replace( "%HOME%", QDir::homePath() ).
-						replace( "$PROFILE", QDir::homePath() ).
-						replace( "%PROFILE%", QDir::homePath() ).
-						replace( "$APPDATA", personalConfigDataPath() ).
-						replace( "%APPDATA%", personalConfigDataPath() ).
-						replace( "$GLOBALAPPDATA", systemConfigDataPath() ).
-						replace( "%GLOBALAPPDATA%", systemConfigDataPath() ).
-						replace( "$TMP", QDir::tempPath() ).
-						replace( "$TEMP", QDir::tempPath() ).
-						replace( "%TMP%", QDir::tempPath() ).
-						replace( "%TEMP%", QDir::tempPath() ) );
-	// remove duplicate directory separators - however skip the first two chars
-	// as they might specify an UNC path on Windows
-	if( p.length() > 3 )
-	{
-		return p.left( 2 ) + p.mid( 2 ).replace(
-									QString( "%1%1" ).arg( QDir::separator() ),
-									QDir::separator() );
-	}
-	return p;
-}
-
-
-
-
-QString Path::shrink( QString path )
-{
-	if( QFileInfo( path ).isDir() )
-	{
-		// we replace parts of the path with strings returned by
-		// personalConfigDataPath() & friends which always return a path with
-		// a trailing dir separator - therefore add one so we don't miss a
-		// replace
-		path += QDir::separator();
-	}
-	path = QDTNS( path );
-#ifdef ITALC_BUILD_WIN32
-	const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
-	const QString envVar = "%%1%\\";
-#else
-	const Qt::CaseSensitivity cs = Qt::CaseSensitive;
-	const QString envVar = "$%1/";
-#endif
-	if( path.startsWith( personalConfigDataPath(), cs ) )
-	{
-		path.replace( personalConfigDataPath(), envVar.arg( "APPDATA" ) );
-	}
-	else if( path.startsWith( systemConfigDataPath(), cs ) )
-	{
-		path.replace( systemConfigDataPath(), envVar.arg( "GLOBALAPPDATA" ) );
-	}
-	else if( path.startsWith( QDTNS( QDir::homePath() ), cs ) )
-	{
-		path.replace( QDTNS( QDir::homePath() ), envVar.arg( "HOME" ) );
-	}
-	else if( path.startsWith( QDTNS( QDir::tempPath() ), cs ) )
-	{
-		path.replace( QDTNS( QDir::tempPath() ), envVar.arg( "TEMP" ) );
-	}
-
-	return QDTNS( path.replace( QString( "%1%1" ).
-								arg( QDir::separator() ), QDir::separator() ) );
-}
-
-
-
-
-bool Path::ensurePathExists( const QString &path )
-{
-	const QString expandedPath = expand( path );
-
-	if( path.isEmpty() || QDir( expandedPath ).exists() )
-	{
-		return true;
-	}
-
-	qDebug() << "LocalSystem::Path::ensurePathExists(): creating "
-				<< path << "=>" << expandedPath;
-
-	QString p = expandedPath;
-
-	QStringList dirs;
-	while( !QDir( p ).exists() && !p.isEmpty() )
-	{
-		dirs.push_front( QDir( p ).dirName() );
-		p.chop( dirs.front().size() + 1 );
-	}
-
-	if( !p.isEmpty() )
-	{
-		return QDir( p ).mkpath( dirs.join( QDir::separator() ) );
-	}
-
-	return false;
-}
-
-
-
-QString Path::personalConfigDataPath()
-{
-	const QString appData = 
-#ifdef ITALC_BUILD_WIN32
-		LocalSystem::windowsConfigPath( CSIDL_APPDATA ) + QDir::separator() + "iTALC";
-#else
-		QDir::homePath() + QDir::separator() + ".italc";
-#endif
-
-	return QDTNS( appData + QDir::separator() );
-}
-
-
-
-QString Path::privateKeyPath( ItalcCore::UserRoles role, QString baseDir )
-{
-	if( baseDir.isEmpty() )
-	{
-		baseDir = expand( ItalcCore::config->privateKeyBaseDir() );
-	}
-	else
-	{
-		baseDir += "/private";
-	}
-	QString d = baseDir + QDir::separator() + ItalcCore::userRoleName( role ) +
-					QDir::separator() + "key";
-	return QDTNS( d );
-}
-
-
-
-QString Path::publicKeyPath( ItalcCore::UserRoles role, QString baseDir )
-{
-	if( baseDir.isEmpty() )
-	{
-		baseDir = expand( ItalcCore::config->publicKeyBaseDir() );
-	}
-	else
-	{
-		baseDir += "/public";
-	}
-	QString d = baseDir + QDir::separator() + ItalcCore::userRoleName( role ) +
-					QDir::separator() + "key";
-	return QDTNS( d );
-}
-
-
-
-
-QString Path::systemConfigDataPath()
-{
-#ifdef ITALC_BUILD_WIN32
-	return QDTNS( windowsConfigPath( CSIDL_COMMON_APPDATA ) + QDir::separator() + "iTALC/" );
-#else
-	return "/etc/italc/";
-#endif
-}
-
-
-
-
-
-#ifdef ITALC_BUILD_WIN32
-BOOL enablePrivilege( LPCTSTR lpszPrivilegeName, BOOL bEnable )
-{
-	HANDLE			hToken;
-	TOKEN_PRIVILEGES	tp;
-	LUID			luid;
-	BOOL			ret;
-
-	if( !OpenProcessToken( GetCurrentProcess(),
-		TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY | TOKEN_READ, &hToken ) )
-	{
-		return FALSE;
-	}
-
-	if( !LookupPrivilegeValue( NULL, lpszPrivilegeName, &luid ) )
-	{
-		return FALSE;
-	}
-
-	tp.PrivilegeCount		   = 1;
-	tp.Privileges[0].Luid	   = luid;
-	tp.Privileges[0].Attributes = bEnable ? SE_PRIVILEGE_ENABLED : 0;
-
-	ret = AdjustTokenPrivileges( hToken, FALSE, &tp, 0, NULL, NULL );
-
-	CloseHandle( hToken );
-
-	return ret;
-}
-#endif
-
-
-
-void activateWindow( QWidget * _w )
-{
-	_w->activateWindow();
-	_w->raise();
-#ifdef ITALC_BUILD_WIN32
-	SetWindowPos( _w->winId(), HWND_TOPMOST, 0, 0, 0, 0,
-						SWP_NOMOVE | SWP_NOSIZE );
-	SetWindowPos( _w->winId(), HWND_NOTOPMOST, 0, 0, 0, 0,
-						SWP_NOMOVE | SWP_NOSIZE );
-#endif
-}
-
-
-} // end of namespace LocalSystem
-
diff --git a/lib/src/LockWidget.cpp b/lib/src/LockWidget.cpp
deleted file mode 100644
index fec9f20..0000000
--- a/lib/src/LockWidget.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *  LockWidget.cpp - widget for locking a client
- *
- *  Copyright (c) 2006-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <italcconfig.h>
-#ifdef ITALC_BUILD_WIN32
-#include <windows.h>
-#endif
-
-#include "LockWidget.h"
-#include "LocalSystem.h"
-
-#include <QtGui/QApplication>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QIcon>
-#include <QtGui/QPainter>
-
-
-
-#ifdef ITALC_BUILD_LINUX
-
-#include <X11/Xlib.h>
-
-#elif ITALC_BUILD_WIN32
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-static const UINT __ss_get_list[] = { SPI_GETLOWPOWERTIMEOUT,
-						SPI_GETPOWEROFFTIMEOUT,
-						SPI_GETSCREENSAVETIMEOUT };
-static const UINT __ss_set_list[] = { SPI_SETLOWPOWERTIMEOUT,
-						SPI_SETPOWEROFFTIMEOUT,
-						SPI_SETSCREENSAVETIMEOUT };
-static int __ss_val[3];
-
-#endif
-
-
-
-LockWidget::LockWidget( Modes _mode ) :
-	QWidget( 0, Qt::X11BypassWindowManagerHint ),
-	m_background(
-		_mode == Black ?
-			QPixmap( ":/resources/locked_bg.png" )
-		:
-			_mode == DesktopVisible ?
-				QPixmap::grabWindow( qApp->desktop()->winId() )
-			:
-				QPixmap() ),
-	m_mode( _mode ),
-	m_sysKeyTrapper()
-{
-	m_sysKeyTrapper.setAllKeysDisabled( true );
-	m_sysKeyTrapper.setTaskBarHidden( true );
-
-	setWindowTitle( tr( "screen lock" ) );
-	setWindowIcon( QIcon( ":/resources/icon32.png" ) );
-	showFullScreen();
-	move( 0, 0 );
-	//setFixedSize( QApplication::desktop()->screenGeometry( this ).size() );
-	setFixedSize( qApp->desktop()->size() );
-	setCursor( Qt::BlankCursor );
-	LocalSystem::activateWindow( this );
-	setFocusPolicy( Qt::StrongFocus );
-	setFocus();
-	grabMouse();
-	grabKeyboard();
-	setCursor( Qt::BlankCursor );
-
-#ifdef ITALC_BUILD_WIN32
-	// disable screensaver
-	for( int x = 0; x < 3; ++x )
-	{
-		SystemParametersInfo( __ss_get_list[x], 0, &__ss_val[x], 0 );
-		SystemParametersInfo( __ss_set_list[x], 0, NULL, 0 );
-	}
-#endif
-}
-
-
-
-
-LockWidget::~LockWidget()
-{
-#ifdef ITALC_BUILD_WIN32
-	// revert screensaver-settings
-	for( int x = 0; x < 3; ++x )
-	{
-		SystemParametersInfo( __ss_set_list[x], __ss_val[x], NULL, 0 );
-	}
-#endif
-	m_sysKeyTrapper.setAllKeysDisabled( false );
-}
-
-
-
-
-void LockWidget::paintEvent( QPaintEvent * )
-{
-	QPainter p( this );
-	switch( m_mode )
-	{
-		case DesktopVisible:
-			p.drawPixmap( 0, 0, m_background );
-			break;
-
-		case Black:
-			p.fillRect( rect(), QColor( 64, 64, 64 ) );
-			p.drawPixmap( ( width() - m_background.width() ) / 2,
-				( height() - m_background.height() ) / 2,
-								m_background );
-			break;
-
-		default:
-			break;
-	}
-}
-
-
-
-#ifdef ITALC_BUILD_LINUX
-bool LockWidget::x11Event( XEvent * _e )
-{
-	switch( _e->type )
-	{
-		case KeyPress:
-		case ButtonPress:
-		case MotionNotify:
-			return true;
-		default:
-			break;
-	}
-	return false;
-}
-#endif
-
-
diff --git a/lib/src/Logger.cpp b/lib/src/Logger.cpp
deleted file mode 100644
index 5c38700..0000000
--- a/lib/src/Logger.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Logger.cpp - a global clas for easily logging messages to log files
- *
- * Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDateTime>
-#include <QtCore/QDir>
-#include <QtCore/QFile>
-
-#include "ItalcConfiguration.h"
-#include "Logger.h"
-#include "LocalSystem.h"
-
-#ifdef ITALC_BUILD_WIN32
-#include "3rdparty/XEventLog.h"
-#include "3rdparty/XEventLog.cpp"
-#endif
-
-Logger::LogLevel Logger::logLevel = Logger::LogLevelDefault;
-Logger *Logger::instance = NULL;
-QMutex Logger::logMutex( QMutex::Recursive );
-Logger::LogLevel Logger::lastMsgLevel = Logger::LogLevelNothing;
-QString Logger::lastMsg;
-int Logger::lastMsgCount = 0;
-#ifdef ITALC_BUILD_WIN32
-CXEventLog *Logger::winEventLog = NULL;
-#endif
-
-Logger::Logger( const QString &appName ) :
-	m_appName( appName ),
-	m_logFile( NULL )
-{
-	instance = this;
-
-	int ll = ItalcCore::config->logLevel();
-	logLevel = qBound( LogLevelMin, static_cast<LogLevel>( ll ), LogLevelMax );
-	initLogFile();
-
-	qInstallMsgHandler( qtMsgHandler );
-
-#ifdef ITALC_BUILD_WIN32
-	if( ItalcCore::config->logToWindowsEventLog() )
-	{
-		winEventLog = new CXEventLog( appName.toUtf8().constData() );
-	}
-#endif
-
-	QString user = LocalSystem::User::loggedOnUser().name();
-
-	if( QCoreApplication::instance() )
-	{
-		// log current application start up
-		LogStream() << "Startup for user" << user
-					<< "with arguments" << QCoreApplication::arguments();
-	}
-	else
-	{
-		LogStream() << "Startup for user" << user
-					<< "without QCoreApplication instance";
-	}
-}
-
-
-
-
-Logger::~Logger()
-{
-	LogStream() << "Shutdown";
-
-	instance = NULL;
-
-	delete m_logFile;
-}
-
-
-
-
-void Logger::initLogFile()
-{
-	QString logPath = LocalSystem::Path::expand( ItalcCore::config->logFileDirectory() );
-
-	if( !QDir( logPath ).exists() )
-	{
-		if( QDir( QDir::rootPath() ).mkdir( logPath ) )
-		{
-			QFile::setPermissions( logPath,
-						QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |
-						QFile::ReadUser | QFile::WriteUser | QFile::ExeUser |
-						QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup |
-						QFile::ReadOther | QFile::WriteOther | QFile::ExeOther );
-		}
-	}
-
-	logPath = logPath + QDir::separator();
-	m_logFile = new QFile( logPath + QString( "%1.log" ).arg( m_appName ) );
-	m_logFile->open( QFile::WriteOnly | QFile::Append | QFile::Unbuffered );
-	m_logFile->setPermissions( QFile::ReadOwner | QFile::WriteOwner );
-}
-
-
-
-
-QString Logger::formatMessage( LogLevel ll, const QString &msg )
-{
-#ifdef ITALC_BUILD_WIN32
-	static const char *linebreak = "\r\n";
-#else
-	static const char *linebreak = "\n";
-#endif
-
-	QString msgType;
-	switch( ll )
-	{
-		case LogLevelDebug: msgType = "DEBUG"; break;
-		case LogLevelInfo: msgType = "INFO"; break;
-		case LogLevelWarning: msgType = "WARN"; break;
-		case LogLevelError: msgType = "ERR"; break;
-		case LogLevelCritical: msgType = "CRIT"; break;
-		default: break;
-	}
-
-	return QString( "%1: [%2] %3%4" ).
-				arg( QDateTime::currentDateTime().toString() ).
-				arg( msgType ).
-				arg( msg.trimmed() ).
-				arg( linebreak );
-}
-
-
-
-
-void Logger::qtMsgHandler( QtMsgType msgType, const char *msg )
-{
-	LogLevel ll = LogLevelDefault;
-
-	switch( msgType )
-	{
-		case QtDebugMsg: ll = LogLevelDebug; break;
-		case QtWarningMsg: ll = LogLevelWarning; break;
-		case QtCriticalMsg: ll = LogLevelError; break;
-		case QtFatalMsg: ll = LogLevelCritical; break;
-		default:
-			break;
-	}
-
-	log( ll, msg );
-}
-
-
-
-
-void Logger::log( LogLevel ll, const QString &msg )
-{
-	if( instance != NULL && logLevel >= ll )
-	{
-		QMutexLocker l( &logMutex );
-		if( msg == lastMsg && ll == lastMsgLevel )
-		{
-			++lastMsgCount;
-		}
-		else
-		{
-			if( lastMsgCount )
-			{
-				instance->outputMessage( formatMessage( lastMsgLevel, "---" ) );
-				instance->outputMessage( formatMessage( lastMsgLevel,
-				QString( "Last message repeated %1 times" ).
-					arg( lastMsgCount ) ) );
-				instance->outputMessage( formatMessage( lastMsgLevel, "---" ) );
-				lastMsgCount = 0;
-			}
-			instance->outputMessage( formatMessage( ll, msg ) );
-#ifdef ITALC_BUILD_WIN32
-			WORD wtype = -1;
-			switch( ll )
-			{
-				case LogLevelCritical:
-				case LogLevelError: wtype = EVENTLOG_ERROR_TYPE; break;
-				case LogLevelWarning: wtype = EVENTLOG_WARNING_TYPE; break;
-				//case LogLevelInfo: wtype = EVENTLOG_INFORMATION_TYPE; break;
-				default:
-					break;
-			}
-			if( winEventLog != NULL && wtype > 0 )
-			{
-				winEventLog->Write( wtype, msg.toUtf8().constData() );
-			}
-#endif
-			lastMsg = msg;
-			lastMsgLevel = ll;
-		}
-	}
-}
-
-
-
-
-void Logger::log( LogLevel ll, const char *format, ... )
-{
-	va_list args;
-	va_start( args, format );
-
-	QString message;
-	message.vsprintf( format, args );
-
-	va_end(args);
-
-	log( ll, message );
-}
-
-
-
-
-void Logger::outputMessage( const QString &msg )
-{
-	QMutexLocker l( &logMutex );
-
-	if( m_logFile )
-	{
-		m_logFile->write( msg.toUtf8() );
-		m_logFile->flush();
-	}
-
-	if( !ItalcCore::config || ItalcCore::config->logToStdErr() )
-	{
-		fprintf( stderr, "%s", msg.toUtf8().constData() );
-		fflush( stderr );
-	}
-}
-
-
diff --git a/lib/src/LogonAuthentication.cpp b/lib/src/LogonAuthentication.cpp
deleted file mode 100644
index 2713ef6..0000000
--- a/lib/src/LogonAuthentication.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * LogonAuthentication.cpp - class doing logon authentication
- *
- * Copyright (c) 2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QDebug>
-#include <QtCore/QLibrary>
-#include <QtCore/QProcess>
-
-#include "LogonAuthentication.h"
-#include "ItalcConfiguration.h"
-#include "ItalcCore.h"
-
-
-bool LogonAuthentication::authenticateUser( const AuthenticationCredentials &cred )
-{
-	bool result = false;
-#ifdef ITALC_BUILD_WIN32
-	typedef int(*cupsdPtr_t)(const char * userin, const char *password, const char *machine);
-
-	QLibrary authSSP( "authSSP" );
-	if( authSSP.load() )
-	{
-		cupsdPtr_t cupsdPtr = (cupsdPtr_t) authSSP.resolve( "CUPSD" );
-		if( cupsdPtr )
-		{
-			result = cupsdPtr( cred.logonUsername().toUtf8().constData(),
-								cred.logonPassword().toUtf8().constData(),
-											"127.0.0.1" ) > 0 ? true : false;
-		}
-	}
-#endif
-
-#ifdef ITALC_BUILD_LINUX
-	QProcess p;
-	p.start( "italc_auth_helper" );
-	p.waitForStarted();
-
-	QDataStream ds( &p );
-	ds << cred.logonUsername();
-	ds << cred.logonPassword();
-
-	p.closeWriteChannel();
-	p.waitForFinished();
-
-	if( p.exitCode() == 0 )
-	{
-		QProcess p;
-		p.start( "getent", QStringList() << "group" );
-		p.waitForFinished();
-
-		QStringList groups = QString( p.readAll() ).split( '\n' );
-		foreach( const QString &group, groups )
-		{
-			QStringList groupComponents = group.split( ':' );
-			if( groupComponents.size() == 4 &&
-				ItalcCore::config->logonGroups().
-										contains( groupComponents.first() ) &&
-				groupComponents.last().split( ',' ).contains( cred.logonUsername() ) )
-			{
-				result = true;
-			}
-		}
-		qCritical() << "User not in a privileged group";
-	}
-	else
-	{
-		qCritical() << "ItalcAuthHelper failed:" << p.readAll().trimmed();
-	}
-#endif
-
-	return result;
-}
-
diff --git a/lib/src/PasswordDialog.cpp b/lib/src/PasswordDialog.cpp
deleted file mode 100644
index fb74729..0000000
--- a/lib/src/PasswordDialog.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * PasswordDialog.cpp - dialog for querying logon credentials
- *
- * Copyright (c) 2010-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <italcconfig.h>
-
-#include <QtCore/QDir>
-#include <QtCore/QProcess>
-#include <QtGui/QPushButton>
-
-#include "PasswordDialog.h"
-#include "LocalSystem.h"
-
-#include "ui_PasswordDialog.h"
-
-
-PasswordDialog::PasswordDialog( QWidget *parent ) :
-	QDialog( parent ),
-	ui( new Ui::PasswordDialog )
-{
-	ui->setupUi( this );
-
-	const LocalSystem::User loggedOnUser = LocalSystem::User::loggedOnUser();
-	QString userName = loggedOnUser.name();
-#ifdef ITALC_BUILD_WIN32
-	if( !userName.isEmpty() && !loggedOnUser.domain().isEmpty() )
-	{
-		userName = loggedOnUser.domain() + "\\" + userName;
-	}
-#endif
-
-	ui->username->setText( userName );
-
-	if( !userName.isEmpty() )
-	{
-		ui->password->setFocus();
-	}
-
-	updateOkButton();
-}
-
-
-
-
-PasswordDialog::~PasswordDialog()
-{
-}
-
-
-
-QString PasswordDialog::username() const
-{
-	return ui->username->text();
-}
-
-
-
-QString PasswordDialog::password() const
-{
-	return ui->password->text();
-}
-
-
-
-
-AuthenticationCredentials PasswordDialog::credentials() const
-{
-	AuthenticationCredentials cred;
-	cred.setLogonUsername( username() );
-	cred.setLogonPassword( password() );
-
-	return cred;
-}
-
-
-
-void PasswordDialog::updateOkButton()
-{
-	ui->buttonBox->button( QDialogButtonBox::Ok )->
-					setEnabled( !username().isEmpty() && !password().isEmpty() );
-}
-
-
-
-void PasswordDialog::manage()
-{
-	QProcess::startDetached( QCoreApplication::applicationDirPath() +
-								QDir::separator() + "imc",
-									QStringList( "-manageACLs" ) );
-}
-
diff --git a/lib/src/ProgressWidget.cpp b/lib/src/ProgressWidget.cpp
deleted file mode 100644
index f7572f4..0000000
--- a/lib/src/ProgressWidget.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *  ProgressWidget.cpp - widget for locking a client
- *
- *  Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-
-#include "ProgressWidget.h"
-
-#include <QtCore/QTimer>
-#include <QtGui/QPainter>
-
-
-
-ProgressWidget::ProgressWidget(  const QString & _txt,
-					const QString & _anim, int _frames,
-					QWidget * _parent ) :
-	QWidget( _parent ),
-	m_txt( _txt ),
-	m_anim( _anim ),
-	m_frames( _frames ),
-	m_curFrame( 0 )
-{
-	for( int i = 1; i <= m_frames; ++i )
-	{
-		m_pixmaps.push_back( QPixmap( m_anim.arg(
-						QString::number( i ) ) ) );
-	}
-
-	QFont f = font();
-	f.setPointSize( 12 );
-	setFont( f );
-
-	setFixedSize( 30 + m_pixmaps[0].width() +
-			fontMetrics().width( m_txt ),
-			m_pixmaps[0].height() * 5 / 4 );
-
-	QTimer * t = new QTimer( this );
-	connect( t, SIGNAL( timeout() ), this, SLOT( nextAnim() ) );
-	t->start( 150 );
-}
-
-
-
-
-ProgressWidget::~ProgressWidget()
-{
-}
-
-
-
-
-void ProgressWidget::nextAnim()
-{
-	m_curFrame = ( m_curFrame+1 ) % m_frames;
-	update();
-}
-
-
-
-const int ROUNDED = 2000;
-
-void ProgressWidget::paintEvent( QPaintEvent * )
-{
-	QPainter p( this );
-	p.setRenderHint( QPainter::Antialiasing );
-	p.setPen( Qt::black );
-
-	QLinearGradient grad( 0, 0, 0, height() );
-	QColor g1( 224, 224, 224 );
-	//g1.setAlpha( 204 );
-	QColor g2( 160, 160, 160 );
-	//g2.setAlpha( 204 );
-	grad.setColorAt( 0, g1 );
-	grad.setColorAt( 1, g2 );
-	p.setBrush( grad );
-	p.drawRoundRect( 0, 0, width() - 1, height() - 1,
-					ROUNDED / width(), ROUNDED / height() );
-	p.drawPixmap( 6, ( height() - m_pixmaps[m_curFrame].height() ) / 2 - 1,
-							m_pixmaps[m_curFrame] );
-	p.setPen( Qt::black );
-	p.drawText( 14 + m_pixmaps[m_curFrame].width(), 25, m_txt );
-}
-
-
diff --git a/lib/src/Snapshot.cpp b/lib/src/Snapshot.cpp
deleted file mode 100644
index acdb64f..0000000
--- a/lib/src/Snapshot.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *  Snapshot.cpp - class representing a screen snapshot
- *
- *  Copyright (c) 2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- *  This file is part of iTALC - http://italc.sourceforge.net
- *
- *  This is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This software is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this software; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- *  USA.
- */
-
-#include <QtCore/QDateTime>
-#include <QtCore/QDir>
-#include <QtCore/QFileInfo>
-#include <QtGui/QApplication>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPainter>
-
-#include "Snapshot.h"
-#include "ItalcConfiguration.h"
-#include "ItalcVncConnection.h"
-#include "LocalSystem.h"
-#include "Logger.h"
-
-
-Snapshot::Snapshot( const QString &fileName ) :
-	m_fileName( fileName ),
-	m_image()
-{
-	if( !m_fileName.isEmpty() && QFileInfo( m_fileName ).isFile() )
-	{
-		m_image.load( m_fileName );
-	}
-}
-
-
-
-
-void Snapshot::take( ItalcVncConnection *vncConn, const QString &user )
-{
-	QString u = user;
-	if( u.isEmpty() )
-	{
-		u = tr( "unknown" );
-	}
-	if( !u.contains( '(' ) )
-	{
-		u = QString( "%1 (%2)" ).arg( u ).arg( u );
-	}
-
-	// construct text
-	QString txt = u + "@" + vncConn->host() + " " +
-			QDate( QDate::currentDate() ).toString( Qt::ISODate ) +
-			" " + QTime( QTime::currentTime() ).
-							toString( Qt::ISODate );
-	const QString dir = LocalSystem::Path::expand(
-									ItalcCore::config->snapshotDirectory() );
-	if( !LocalSystem::Path::ensurePathExists( dir ) )
-	{
-		QString msg = tr( "Could not take a snapshot as directory %1 "
-								"doesn't exist and couldn't be "
-								"created." ).arg( dir );
-		qCritical() << msg.toUtf8().constData();
-		if( QApplication::type() != QApplication::Tty )
-		{
-			QMessageBox::critical( NULL, tr( "Snapshot" ), msg );
-		}
-
-		return;
-	}
-
-	// construct filename
-	m_fileName =  QString( "_%1_%2_%3.png" ).
-						arg( vncConn->host() ).
-						arg( QDate( QDate::currentDate() ).toString( Qt::ISODate ) ).
-						arg( QTime( QTime::currentTime() ).toString( Qt::ISODate ) ).
-					replace( ':', '-' );
-
-	m_fileName = dir + QDir::separator() +
-					u.section( '(', 1, 1 ).section( ')', 0, 0 ) + m_fileName;
-
-	const int FONT_SIZE = 14;
-	const int RECT_MARGIN = 10;
-	const int RECT_INNER_MARGIN = 5;
-
-	m_image = QImage( vncConn->image() );
-
-	QPixmap icon( QPixmap( ":/resources/icon16.png" ) );
-
-	QPainter p( &m_image );
-	QFont fnt = p.font();
-	fnt.setPointSize( FONT_SIZE );
-	fnt.setBold( true );
-	p.setFont( fnt );
-
-	QFontMetrics fm( p.font() );
-
-	const int rx = RECT_MARGIN;
-	const int ry = m_image.height() - RECT_MARGIN - 2 * RECT_INNER_MARGIN - FONT_SIZE;
-	const int rw = RECT_MARGIN + 4 * RECT_INNER_MARGIN +
-					fm.size( Qt::TextSingleLine, txt ).width() + icon.width();
-	const int rh = 2 * RECT_INNER_MARGIN + FONT_SIZE;
-	const int ix = rx + RECT_INNER_MARGIN + 1;
-	const int iy = ry + RECT_INNER_MARGIN - 2;
-	const int tx = ix + icon.width() + 2 * RECT_INNER_MARGIN;
-	const int ty = ry + RECT_INNER_MARGIN + FONT_SIZE - 2;
-
-	p.fillRect( rx, ry, rw, rh, QColor( 255, 255, 255, 160 ) );
-	p.drawPixmap( ix, iy, icon );
-	p.drawText( tx, ty, txt );
-
-	m_image.save( m_fileName, "PNG", 50 );
-}
-
-
-
-
-QString Snapshot::user() const
-{
-	return QFileInfo( fileName() ).fileName().section( '_', 0, 0 );
-}
-
-
-
-
-QString Snapshot::host() const
-{
-	return fileName().section( '_', 1, 1 );
-}
-
-
-
-
-QString Snapshot::date() const
-{
-	return QDate::fromString( fileName().section( '_', 2, 2 ),
-										Qt::ISODate ).toString( Qt::LocalDate );
-}
-
-
-
-
-QString Snapshot::time() const
-{
-	return fileName().section( '_', 3, 3 ).section( '.', 0, 0 ).replace( '-', ':' );
-}
-
-
diff --git a/lib/src/SystemKeyTrapper.cpp b/lib/src/SystemKeyTrapper.cpp
deleted file mode 100644
index 0d3d3e2..0000000
--- a/lib/src/SystemKeyTrapper.cpp
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * SystemKeyTrapper.cpp - class for trapping system-keys and -key-sequences
- *                        such as Alt+Ctrl+Del, Alt+Tab etc.
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include <italcconfig.h>
-
-#ifdef ITALC_BUILD_WIN32
-
-#define _WIN32_WINNT 0x0500 // for KBDLLHOOKSTRUCT
-
-#include <windows.h>
-
-#include "Inject.h"
-
-#endif
-
-
-#define XK_KOREAN
-#include "rfb/keysym.h"
-#include "SystemKeyTrapper.h"
-
-#include <QtCore/QList>
-#include <QtCore/QProcess>
-#include <QtCore/QTimer>
-
-static QMutex __trapped_keys_mutex;
-static QList<SystemKeyTrapper::TrappedKeys> __trapped_keys;
-static bool __disable_all_keys = false;
-
-QMutex SystemKeyTrapper::s_refCntMutex;
-int SystemKeyTrapper::s_refCnt = 0;
-
-
-#ifdef ITALC_BUILD_WIN32
-
-
-// some code for disabling system's hotkeys such as Alt+Ctrl+Del, Alt+Tab,
-// Ctrl+Esc, Alt+Esc, Windows-key etc. - otherwise locking wouldn't be very
-// effective... ;-)
-
-
-HHOOK g_hHookKbdLL = NULL; // hook handle
-
-
-LRESULT CALLBACK TaskKeyHookLL( int nCode, WPARAM wp, LPARAM lp )
-{
-	KBDLLHOOKSTRUCT *pkh = (KBDLLHOOKSTRUCT *) lp;
-	static QList<SystemKeyTrapper::TrappedKeys> pressed;
-	if( nCode == HC_ACTION )
-	{
-		BOOL bCtrlKeyDown = GetAsyncKeyState( VK_CONTROL ) >>
-						( ( sizeof( SHORT ) * 8 ) - 1 );
-		QMutexLocker m( &__trapped_keys_mutex );
-
-		SystemKeyTrapper::TrappedKeys key = SystemKeyTrapper::None;
-		if( pkh->vkCode == VK_ESCAPE && bCtrlKeyDown )
-		{
-			key = SystemKeyTrapper::CtrlEsc;
-		}
-		else if( pkh->vkCode == VK_TAB && pkh->flags & LLKHF_ALTDOWN )
-		{
-			key = SystemKeyTrapper::AltTab;
-		}
-		else if( pkh->vkCode == VK_ESCAPE &&
-						pkh->flags & LLKHF_ALTDOWN )
-		{
-			key = SystemKeyTrapper::AltEsc;
-		}
-		else if( pkh->vkCode == VK_SPACE && pkh->flags & LLKHF_ALTDOWN )
-		{
-			key = SystemKeyTrapper::AltSpace;
-		}
-		else if( pkh->vkCode == VK_F4 && pkh->flags & LLKHF_ALTDOWN )
-		{
-			key = SystemKeyTrapper::AltF4;
-		}
-		else if( pkh->vkCode == VK_LWIN || pkh->vkCode == VK_RWIN )
-		{
-			pressed.removeAll( SystemKeyTrapper::SuperKeyDown );
-			pressed.removeAll( SystemKeyTrapper::SuperKeyUp );
-			if( wp == WM_KEYDOWN )
-			{
-				key = SystemKeyTrapper::SuperKeyDown;
-			}
-			else
-			{
-				key = SystemKeyTrapper::SuperKeyUp;
-			}
-		}
-		else if( pkh->vkCode == VK_DELETE && bCtrlKeyDown &&
-						pkh->flags && LLKHF_ALTDOWN )
-		{
-			key = SystemKeyTrapper::AltCtrlDel;
-		}
-		if( key != SystemKeyTrapper::None )
-		{
-			if( !pressed.contains( key ) )
-			{
-				__trapped_keys.push_back( key );
-				pressed << key;
-			}
-			else
-			{
-				pressed.removeAll( key );
-			}
-			return 1;
-		}
-		if( __disable_all_keys )
-		{
-			return 1;
-		}
-	}
-	return CallNextHookEx( g_hHookKbdLL, nCode, wp, lp );
-}
-
-
-
-
-static STICKYKEYS settings_sk = { sizeof( STICKYKEYS ), 0 };
-static TOGGLEKEYS settings_tk = { sizeof( TOGGLEKEYS ), 0 };
-static FILTERKEYS settings_fk = { sizeof( FILTERKEYS ), 0 };
-
-
-void enableStickyKeys( bool _enable )
-{
-	if( _enable )
-	{
-		SystemParametersInfo( SPI_SETSTICKYKEYS, sizeof( STICKYKEYS ),
-							&settings_sk, 0 );
-		SystemParametersInfo( SPI_SETTOGGLEKEYS, sizeof( TOGGLEKEYS ),
-							&settings_tk, 0 );
-		SystemParametersInfo( SPI_SETFILTERKEYS, sizeof( FILTERKEYS ),
-							&settings_fk, 0 );
-	}
-	else
-	{
-		SystemParametersInfo( SPI_GETSTICKYKEYS, sizeof( STICKYKEYS ),
-							&settings_sk, 0 );
-		SystemParametersInfo( SPI_GETTOGGLEKEYS, sizeof( TOGGLEKEYS ),
-							&settings_tk, 0 );
-		SystemParametersInfo( SPI_GETFILTERKEYS, sizeof( FILTERKEYS ),
-							&settings_fk, 0 );
-
-		STICKYKEYS skOff = settings_sk;
-		skOff.dwFlags &= ~SKF_HOTKEYACTIVE;
-		skOff.dwFlags &= ~SKF_CONFIRMHOTKEY;
-		SystemParametersInfo( SPI_SETSTICKYKEYS, sizeof( STICKYKEYS ),
-								&skOff, 0 );
-
-		TOGGLEKEYS tkOff = settings_tk;
-		tkOff.dwFlags &= ~TKF_HOTKEYACTIVE;
-		tkOff.dwFlags &= ~TKF_CONFIRMHOTKEY;
-		SystemParametersInfo( SPI_SETTOGGLEKEYS, sizeof( TOGGLEKEYS ),
-								&tkOff, 0 );
-
-		FILTERKEYS fkOff = settings_fk;
-		fkOff.dwFlags &= ~FKF_HOTKEYACTIVE;
-		fkOff.dwFlags &= ~FKF_CONFIRMHOTKEY;
-		SystemParametersInfo( SPI_SETFILTERKEYS, sizeof( FILTERKEYS ),
-								&fkOff, 0 );
-	}
-}
-
-
-#endif
-
-
-SystemKeyTrapper::SystemKeyTrapper( bool _enabled ) :
-	QObject(),
-	m_enabled( false ),
-	m_taskBarHidden( false )
-{
-	setEnabled( _enabled );
-}
-
-
-
-
-SystemKeyTrapper::~SystemKeyTrapper()
-{
-	setEnabled( false );
-	if( m_taskBarHidden )
-	{
-		setTaskBarHidden( false );
-	}
-}
-
-
-
-
-void SystemKeyTrapper::setTaskBarHidden( bool on )
-{
-	m_taskBarHidden = on;
-#ifdef ITALC_BUILD_WIN32
-	if( on )
-	{
-		EnableWindow( FindWindow( "Shell_traywnd", NULL ), false );
-		//ShowWindow( FindWindow( "Shell_traywnd", NULL ), SW_HIDE );
-	}
-	else
-	{
-		EnableWindow( FindWindow( "Shell_traywnd", NULL ), true );
-		// causes hang on Win7
-		//ShowWindow( FindWindow( "Shell_traywnd", NULL ), SW_NORMAL );
-	}
-#endif
-}
-
-
-
-
-void SystemKeyTrapper::setEnabled( bool on )
-{
-	if( on == m_enabled )
-	{
-		return;
-	}
-
-	s_refCntMutex.lock();
-
-	m_enabled = on;
-	if( on )
-	{
-#ifdef ITALC_BUILD_WIN32
-		if( !s_refCnt )
-		{
-			if( !g_hHookKbdLL )
-			{
-				HINSTANCE hAppInstance =
-							GetModuleHandle( NULL );
-				// set lowlevel-keyboard-hook
-				g_hHookKbdLL =
-					SetWindowsHookEx( WH_KEYBOARD_LL,
-								TaskKeyHookLL,
-								hAppInstance,
-								0 );
-			}
-
-			enableStickyKeys( false );
-
-			if( !Inject() )
-			{
-				qWarning( "SystemKeyTrapper: Inject() failed");
-			}
-		}
-
-		QTimer * t = new QTimer( this );
-		connect( t, SIGNAL( timeout() ),
-					this, SLOT( checkForTrappedKeys() ) );
-		t->start( 10 );
-#endif
-#ifdef ITALC_BUILD_LINUX
-		// read original keymap
-		QProcess p;
-		p.start( "xmodmap", QStringList() << "-pke" );	// print keymap
-		p.waitForFinished();
-		m_origKeyTable = p.readAll();
-
-		// remove all Switch_VT and Terminate_Server references
-		QString keyTableModified = QString( m_origKeyTable ).
-					replace( QRegExp( "XF86_Switch_VT_\\d+" ), QString() ).
-					replace( "Terminate_Server", QString() );
-
-		// start new xmodmap process and dump our modified keytable from stdin
-		p.start( "xmodmap", QStringList() << "-" );
-		p.waitForStarted();
-		p.write( keyTableModified.toAscii() );
-		p.closeWriteChannel();
-		p.waitForFinished();
-#endif
-		++s_refCnt;
-	}
-	else
-	{
-		--s_refCnt;
-#ifdef ITALC_BUILD_WIN32
-		if( !s_refCnt )
-		{
-			UnhookWindowsHookEx( g_hHookKbdLL );
-			g_hHookKbdLL = NULL;
-
-			if( !Eject() )
-			{
-				qWarning( "SystemKeyTrapper: Eject() failed");
-			}
-
-			enableStickyKeys( true );
-		}
-#endif
-#ifdef ITALC_BUILD_LINUX
-		// start xmodmap process and dump our original keytable from stdin
-		QProcess p;
-		p.start( "xmodmap", QStringList() << "-" );
-		p.waitForStarted();
-		p.write( m_origKeyTable );
-		p.closeWriteChannel();
-		p.waitForFinished();
-#endif
-	}
-	s_refCntMutex.unlock();
-}
-
-
-
-
-void SystemKeyTrapper::setAllKeysDisabled( bool on )
-{
-	__disable_all_keys = on;
-}
-
-
-
-
-void SystemKeyTrapper::checkForTrappedKeys()
-{
-	QMutexLocker m( &__trapped_keys_mutex );
-
-	while( !__trapped_keys.isEmpty() )
-	{
-		unsigned int key = 0;
-		bool toggle = true;
-		bool stateToSet = false;
-		switch( __trapped_keys.front() )
-		{
-			case None: break;
-			case AltCtrlDel: key = XK_Delete; break;
-			case AltTab: key = XK_Tab; break;
-			case AltEsc: key = XK_Escape; break;
-			case AltSpace: key = XK_KP_Space; break;
-			case AltF4: key = XK_F4; break;
-			case CtrlEsc: key = XK_Escape; break;
-			case SuperKeyDown: key = XK_Super_L; toggle = false; stateToSet = true; break;
-			case SuperKeyUp: key = XK_Super_L; toggle = false; stateToSet = false; break;
-		}
-
-		if( key )
-		{
-			if( toggle )
-			{
-				emit keyEvent( key, true );
-				emit keyEvent( key, false );
-			}
-			else
-			{
-				emit keyEvent( key, stateToSet );
-			}
-		}
-
-		__trapped_keys.removeFirst();
-
-	}
-}
-
-
diff --git a/lib/src/VncView.cpp b/lib/src/VncView.cpp
deleted file mode 100644
index 8546931..0000000
--- a/lib/src/VncView.cpp
+++ /dev/null
@@ -1,818 +0,0 @@
-/*
- * VncView.cpp - VNC viewer widget
- *
- * Copyright (c) 2006-2013 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *
- * This file is part of iTALC - http://italc.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program (see COPYING); if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#define XK_KOREAN
-#include "rfb/keysym.h"
-
-#include "VncView.h"
-#include "ProgressWidget.h"
-#include "SystemKeyTrapper.h"
-
-#include <QtGui/QApplication>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QMouseEvent>
-#include <QtGui/QPainter>
-
-
-
-VncView::VncView( const QString &host, QWidget *parent, Mode mode ) :
-	QWidget( parent ),
-	m_vncConn( this ),
-	m_mode( mode ),
-	m_frame(),
-	m_cursorShape(),
-	m_cursorX( 0 ),
-	m_cursorY( 0 ),
-	m_framebufferSize( 0, 0 ),
-	m_cursorHotX( 0 ),
-	m_cursorHotY( 0 ),
-	m_viewOnly( true ),
-	m_viewOnlyFocus( true ),
-	m_scaledView( true ),
-	m_initDone( false ),
-	m_buttonMask( 0 ),
-	m_establishingConnection( NULL ),
-	m_sysKeyTrapper( new SystemKeyTrapper( false ) )
-{
-	m_vncConn.setHost( host );
-	if( m_mode == DemoMode )
-	{
-		m_vncConn.setQuality( ItalcVncConnection::DemoClientQuality );
-		m_vncConn.setItalcAuthType( ItalcAuthHostBased );
-		m_establishingConnection = new ProgressWidget(
-			tr( "Establishing connection to %1 ..." ).arg( host ),
-					":/resources/watch%1.png", 16, this );
-		connect( &m_vncConn, SIGNAL( connected() ),
-					m_establishingConnection, SLOT( hide() ) );
-
-	}
-	else if( m_mode == RemoteControlMode )
-	{
-		m_vncConn.setQuality( ItalcVncConnection::RemoteControlQuality );
-	}
-
-	connect( &m_vncConn, SIGNAL( imageUpdated( int, int, int, int ) ),
-			this, SLOT( updateImage( int, int, int, int ) ),
-						Qt::BlockingQueuedConnection );
-
-	connect( &m_vncConn, SIGNAL( framebufferSizeChanged( int, int ) ),
-				this, SLOT( updateSizeHint( int, int ) ), Qt::QueuedConnection );
-
-	connect( &m_vncConn, SIGNAL( cursorPosChanged( int, int ) ),
-				this, SLOT( updateCursorPos( int, int ) ) );
-
-	connect( &m_vncConn, SIGNAL( cursorShapeUpdated( const QImage &, int, int ) ),
-				this, SLOT( updateCursorShape( const QImage &, int, int ) ) );
-
-	// forward trapped special keys
-	connect( m_sysKeyTrapper, SIGNAL( keyEvent( unsigned int, bool ) ),
-				&m_vncConn, SLOT( keyEvent( unsigned int, bool ) ) );
-	connect( m_sysKeyTrapper, SIGNAL( keyEvent( unsigned int, bool ) ),
-				this, SLOT( checkKeyEvent( unsigned int, bool ) ) );
-
-
-	// set up background color
-	if( parent == NULL )
-	{
-		parent = this;
-	}
-	QPalette pal = parent->palette();
-	pal.setColor( parent->backgroundRole(), Qt::black );
-	parent->setPalette( pal );
-
-	show();
-
-	resize( QApplication::desktop()->
-						availableGeometry( this ).size() - QSize( 10, 30 ) );
-
-	setFocusPolicy( Qt::StrongFocus );
-	setFocus();
-
-	m_vncConn.start();
-}
-
-
-
-
-VncView::~VncView()
-{
-	disconnect( &m_vncConn, SIGNAL( imageUpdated( int, int, int, int ) ),
-			this, SLOT( updateImage( int, int, int, int ) ) );
-
-	unpressModifiers();
-	delete m_sysKeyTrapper;
-
-	m_vncConn.stop();
-	m_vncConn.wait( 500 );
-}
-
-
-
-
-bool VncView::eventFilter(QObject *obj, QEvent *event)
-{
-	if( m_viewOnly )
-	{
-		if( event->type() == QEvent::KeyPress ||
-			event->type() == QEvent::KeyRelease ||
-			event->type() == QEvent::MouseButtonDblClick ||
-			event->type() == QEvent::MouseButtonPress ||
-			event->type() == QEvent::MouseButtonRelease ||
-			event->type() == QEvent::Wheel )
-		return true;
-	}
-
-	return QWidget::eventFilter(obj, event);
-}
-
-
-
-
-QSize VncView::sizeHint() const
-{
-	if( m_scaledView )
-	{
-		return scaledSize();
-	}
-	return framebufferSize();
-}
-
-
-
-
-QSize VncView::scaledSize() const
-{
-	const QSize s = size();
-	QSize fbs = framebufferSize();
-	if( ( s.width() >= fbs.width() && s.height() >= fbs.height() ) ||
-							m_scaledView == false )
-	{
-		return fbs;
-	}
-	fbs.scale( s, Qt::KeepAspectRatio );
-	return fbs;
-}
-
-
-
-
-void VncView::setViewOnly( bool _vo )
-{
-	if( _vo == m_viewOnly )
-	{
-		return;
-	}
-	m_viewOnly = _vo;
-
-	if( m_viewOnly )
-	{
-		releaseKeyboard();
-		m_sysKeyTrapper->setEnabled( false );
-		setCursor( Qt::ArrowCursor );
-	}
-	else
-	{
-		grabKeyboard();
-		updateLocalCursor();
-		m_sysKeyTrapper->setEnabled( true );
-	}
-}
-
-
-
-
-void VncView::setScaledView( bool scaledView )
-{
-	m_scaledView = scaledView;
-	m_vncConn.setScaledSize( scaledSize() );
-	update();
-}
-
-
-
-
-void VncView::checkKeyEvent( unsigned int key, bool pressed )
-{
-	if( key == XK_Super_L )
-	{
-		if( pressed )
-		{
-			m_mods[key] = true;
-		}
-		else if( m_mods.contains( key ) )
-		{
-			m_mods.remove( key );
-		}
-	}
-}
-
-
-
-
-void VncView::updateCursorPos( int x, int y )
-{
-	if( isViewOnly() )
-	{
-		if( !m_cursorShape.isNull() )
-		{
-			update( m_cursorX, m_cursorY,
-					m_cursorShape.width(), m_cursorShape.height() );
-		}
-		m_cursorX = x;
-		m_cursorY = y;
-		if( !m_cursorShape.isNull() )
-		{
-			update( m_cursorX, m_cursorY,
-					m_cursorShape.width(), m_cursorShape.height() );
-		}
-	}
-}
-
-
-
-
-void VncView::updateCursorShape( const QImage &cursorShape, int xh, int yh )
-{
-	float scale = 1;
-	if( !scaledSize().isEmpty() && !framebufferSize().isEmpty() )
-	{
-		scale = (float) scaledSize().width() / framebufferSize().width();
-	}
-	m_cursorHotX = xh*scale;
-	m_cursorHotY = yh*scale;
-	m_cursorShape = cursorShape.scaled( m_cursorShape.width()*scale,
-										m_cursorShape.height()*scale );
-
-	if( isViewOnly() )
-	{
-		update( m_cursorX, m_cursorY,
-					m_cursorShape.width(), m_cursorShape.height() );
-	}
-
-	updateLocalCursor();
-}
-
-
-
-
-void VncView::focusInEvent( QFocusEvent * _e )
-{
-	if( !m_viewOnlyFocus )
-	{
-		setViewOnly( false );
-	}
-	QWidget::focusInEvent( _e );
-}
-
-
-
-
-void VncView::focusOutEvent( QFocusEvent * _e )
-{
-	m_viewOnlyFocus = isViewOnly();
-	if( !isViewOnly() )
-	{
-		setViewOnly( true );
-	}
-	QWidget::focusOutEvent( _e );
-}
-
-
-
-
-// our builtin keyboard-handler
-void VncView::keyEventHandler( QKeyEvent * _ke )
-{
-	bool pressed = _ke->type() == QEvent::KeyPress;
-
-#ifdef ITALC_BUILD_LINUX
-	// Starting with Qt 4.2 there's a nice function returning the key-code
-	// of the key-event (platform-dependent) so when operating under Linux/X11,
-	// key-codes are equal to the ones used by RFB protocol
-	int key = _ke->nativeVirtualKey();
-
-	// we do not handle Key_Backtab separately as the Shift-modifier
-	// is already enabled
-	if( _ke->key() == Qt::Key_Backtab )
-	{
-		key = XK_Tab;
-	}
-
-#else
-	// hmm, either Win32-platform or too old Qt so we have to handle and
-	// translate Qt-key-codes to X-keycodes
-	unsigned int key = 0;
-	switch( _ke->key() )
-	{
-		// modifiers are handled separately
-		case Qt::Key_Shift: key = XK_Shift_L; break;
-		case Qt::Key_Control: key = XK_Control_L; break;
-		case Qt::Key_Meta: key = XK_Meta_L; break;
-		case Qt::Key_Alt: key = XK_Alt_L; break;
-		case Qt::Key_Escape: key = XK_Escape; break;
-		case Qt::Key_Tab: key = XK_Tab; break;
-		case Qt::Key_Backtab: key = XK_Tab; break;
-		case Qt::Key_Backspace: key = XK_BackSpace; break;
-		case Qt::Key_Return: key = XK_Return; break;
-		case Qt::Key_Insert: key = XK_Insert; break;
-		case Qt::Key_Delete: key = XK_Delete; break;
-		case Qt::Key_Pause: key = XK_Pause; break;
-		case Qt::Key_Print: key = XK_Print; break;
-		case Qt::Key_Home: key = XK_Home; break;
-		case Qt::Key_End: key = XK_End; break;
-		case Qt::Key_Left: key = XK_Left; break;
-		case Qt::Key_Up: key = XK_Up; break;
-		case Qt::Key_Right: key = XK_Right; break;
-		case Qt::Key_Down: key = XK_Down; break;
-		case Qt::Key_PageUp: key = XK_Prior; break;
-		case Qt::Key_PageDown: key = XK_Next; break;
-		case Qt::Key_CapsLock: key = XK_Caps_Lock; break;
-		case Qt::Key_NumLock: key = XK_Num_Lock; break;
-		case Qt::Key_ScrollLock: key = XK_Scroll_Lock; break;
-		case Qt::Key_Super_L: key = XK_Super_L; break;
-		case Qt::Key_Super_R: key = XK_Super_R; break;
-		case Qt::Key_Menu: key = XK_Menu; break;
-		case Qt::Key_Hyper_L: key = XK_Hyper_L; break;
-		case Qt::Key_Hyper_R: key = XK_Hyper_R; break;
-		case Qt::Key_Help: key = XK_Help; break;
-		case Qt::Key_AltGr: key = XK_ISO_Level3_Shift; break;
-		case Qt::Key_Multi_key: key = XK_Multi_key; break;
-		case Qt::Key_SingleCandidate: key = XK_SingleCandidate; break;
-		case Qt::Key_MultipleCandidate: key = XK_MultipleCandidate; break;
-		case Qt::Key_PreviousCandidate: key = XK_PreviousCandidate; break;
-		case Qt::Key_Mode_switch: key = XK_Mode_switch; break;
-		case Qt::Key_Kanji: key = XK_Kanji; break;
-		case Qt::Key_Muhenkan: key = XK_Muhenkan; break;
-		case Qt::Key_Henkan: key = XK_Henkan; break;
-		case Qt::Key_Romaji: key = XK_Romaji; break;
-		case Qt::Key_Hiragana: key = XK_Hiragana; break;
-		case Qt::Key_Katakana: key = XK_Katakana; break;
-		case Qt::Key_Hiragana_Katakana: key = XK_Hiragana_Katakana; break;
-		case Qt::Key_Zenkaku: key = XK_Zenkaku; break;
-		case Qt::Key_Hankaku: key = XK_Hankaku; break;
-		case Qt::Key_Zenkaku_Hankaku: key = XK_Zenkaku_Hankaku; break;
-		case Qt::Key_Touroku: key = XK_Touroku; break;
-		case Qt::Key_Massyo: key = XK_Massyo; break;
-		case Qt::Key_Kana_Lock: key = XK_Kana_Lock; break;
-		case Qt::Key_Kana_Shift: key = XK_Kana_Shift; break;
-		case Qt::Key_Eisu_Shift: key = XK_Eisu_Shift; break;
-		case Qt::Key_Eisu_toggle: key = XK_Eisu_toggle; break;
-		case Qt::Key_Hangul: key = XK_Hangul; break;
-		case Qt::Key_Hangul_Start: key = XK_Hangul_Start; break;
-		case Qt::Key_Hangul_End: key = XK_Hangul_End; break;
-		case Qt::Key_Hangul_Hanja: key = XK_Hangul_Hanja; break;
-		case Qt::Key_Hangul_Jamo: key = XK_Hangul_Jamo; break;
-		case Qt::Key_Hangul_Romaja: key = XK_Hangul_Romaja; break;
-		case Qt::Key_Hangul_Jeonja: key = XK_Hangul_Jeonja; break;
-		case Qt::Key_Hangul_Banja: key = XK_Hangul_Banja; break;
-		case Qt::Key_Hangul_PreHanja: key = XK_Hangul_PreHanja; break;
-		case Qt::Key_Hangul_PostHanja: key = XK_Hangul_PostHanja; break;
-		case Qt::Key_Hangul_Special: key = XK_Hangul_Special; break;
-		case Qt::Key_Dead_Grave: key = XK_dead_grave; break;
-		case Qt::Key_Dead_Acute: key = XK_dead_acute; break;
-		case Qt::Key_Dead_Circumflex: key = XK_dead_circumflex; break;
-		case Qt::Key_Dead_Tilde: key = XK_dead_tilde; break;
-		case Qt::Key_Dead_Macron: key = XK_dead_macron; break;
-		case Qt::Key_Dead_Breve: key = XK_dead_breve; break;
-		case Qt::Key_Dead_Abovedot: key = XK_dead_abovedot; break;
-		case Qt::Key_Dead_Diaeresis: key = XK_dead_diaeresis; break;
-		case Qt::Key_Dead_Abovering: key = XK_dead_abovering; break;
-		case Qt::Key_Dead_Doubleacute: key = XK_dead_doubleacute; break;
-		case Qt::Key_Dead_Caron: key = XK_dead_caron; break;
-		case Qt::Key_Dead_Cedilla: key = XK_dead_cedilla; break;
-		case Qt::Key_Dead_Ogonek: key = XK_dead_ogonek; break;
-		case Qt::Key_Dead_Iota: key = XK_dead_iota; break;
-		case Qt::Key_Dead_Voiced_Sound: key = XK_dead_voiced_sound; break;
-		case Qt::Key_Dead_Semivoiced_Sound: key = XK_dead_semivoiced_sound; break;
-		case Qt::Key_Dead_Belowdot: key = XK_dead_belowdot; break;
-	}
-
-	if( _ke->key() >= Qt::Key_F1 && _ke->key() <= Qt::Key_F35 )
-	{
-		key = XK_F1 + _ke->key() - Qt::Key_F1;
-	}
-	else if( key == 0 )
-	{
-		if( m_mods.contains( XK_Control_L ) &&
-			QKeySequence( _ke->key() ).toString().length() == 1 )
-		{
-			QString s = QKeySequence( _ke->key() ).toString();
-			if( !m_mods.contains( XK_Shift_L ) )
-			{
-				s = s.toLower();
-			}
-			key = s.utf16()[0];
-		}
-		else
-		{
-			key = _ke->text().utf16()[0];
-		}
-	}
-	// correct translation of AltGr+<character key> (non-US-keyboard layout
-	// such as German keyboard layout)
-	if( m_mods.contains( XK_Alt_L ) && m_mods.contains( XK_Control_L ) &&
-						key >= 64 && key < 0xF000 )
-	{
-		unpressModifiers();
-		m_vncConn.keyEvent( XK_ISO_Level3_Shift, true );
-	}
-#endif
-
-	// handle Ctrl+Alt+Del replacement (Meta/Super key+Del)
-	if( ( m_mods.contains( XK_Super_L ) ||
-			m_mods.contains( XK_Super_R ) ||
-			m_mods.contains( XK_Meta_L ) ) &&
-				_ke->key() == Qt::Key_Delete )
-	{
-		if( pressed )
-		{
-			unpressModifiers();
-			m_vncConn.keyEvent( XK_Control_L, true );
-			m_vncConn.keyEvent( XK_Alt_L, true );
-			m_vncConn.keyEvent( XK_Delete, true );
-			m_vncConn.keyEvent( XK_Delete, false );
-			m_vncConn.keyEvent( XK_Alt_L, false );
-			m_vncConn.keyEvent( XK_Control_L, false );
-			key = 0;
-		}
-	}
-
-	// handle modifiers
-	if( key == XK_Shift_L || key == XK_Control_L || key == XK_Meta_L ||
-			key == XK_Alt_L || key == XK_Super_L || key == XK_Super_R )
-	{
-		if( pressed )
-		{
-			m_mods[key] = true;
-		}
-		else if( m_mods.contains( key ) )
-		{
-			m_mods.remove( key );
-		}
-		else
-		{
-			unpressModifiers();
-		}
-	}
-
-	if( key )
-	{
-		// forward key event to the VNC connection
-		m_vncConn.keyEvent( key, pressed );
-
-		// signal key event - used by RemoteControlWidget to close itself
-		// when pressing Esc
-		emit keyEvent( key, pressed );
-
-		// inform Qt that we handled the key event
-		_ke->accept();
-	}
-}
-
-
-
-
-void VncView::unpressModifiers()
-{
-	QList<unsigned int> keys = m_mods.keys();
-	QList<unsigned int>::const_iterator it = keys.begin();
-	while( it != keys.end() )
-	{
-		m_vncConn.keyEvent( *it, false );
-		it++;
-	}
-	m_mods.clear();
-}
-
-
-
-
-QPoint VncView::mapToFramebuffer( const QPoint &pos )
-{
-	const QSize fbs = framebufferSize();
-	if( fbs.isEmpty() )
-	{
-		return QPoint( 0, 0 );
-	}
-
-	if( m_scaledView )
-	{
-		return QPoint( pos.x() * fbs.width() / scaledSize().width(),
-						pos.y() * fbs.height() / scaledSize().height() );
-	}
-
-	return pos;
-}
-
-
-
-
-QRect VncView::mapFromFramebuffer( const QRect &r )
-{
-	if( framebufferSize().isEmpty() )
-	{
-		return QRect();
-	}
-	if( m_scaledView )
-	{
-		const float dx = width() / (float) framebufferSize().width();
-		const float dy = height() / (float) framebufferSize().height();
-		return( QRect( (int)(r.x()*dx), (int)(r.y()*dy),
-					(int)(r.width()*dx), (int)(r.height()*dy) ) );
-	}
-	return r;
-}
-
-
-
-void VncView::updateLocalCursor()
-{
-	if( !isViewOnly() && !m_cursorShape.isNull() )
-	{
-		setCursor( QCursor( QPixmap::fromImage( m_cursorShape ),
-								m_cursorHotX, m_cursorHotY ) );
-	}
-	else
-	{
-		setCursor( Qt::ArrowCursor );
-	}
-}
-
-
-
-bool VncView::event( QEvent * event )
-{
-	switch( event->type() )
-	{
-		case QEvent::KeyPress:
-		case QEvent::KeyRelease:
-			keyEventHandler( static_cast<QKeyEvent*>( event ) );
-			return true;
-			break;
-		case QEvent::MouseButtonDblClick:
-		case QEvent::MouseButtonPress:
-		case QEvent::MouseButtonRelease:
-		case QEvent::MouseMove:
-			mouseEventHandler( static_cast<QMouseEvent*>( event ) );
-			return true;
-			break;
-		case QEvent::Wheel:
-			wheelEventHandler( static_cast<QWheelEvent*>( event ) );
-			return true;
-			break;
-		default:
-			return QWidget::event(event);
-	}
-}
-
-
-
-
-void VncView::paintEvent( QPaintEvent *paintEvent )
-{
-	paintEvent->accept();
-
-	QPainter p( this );
-
-	p.fillRect( paintEvent->rect(), Qt::black );
-	if( m_frame.isNull() || m_frame.format() == QImage::Format_Invalid )
-	{
-		return;
-	}
-
-	const QSize sSize = scaledSize();
-	const float scale = sSize.isEmpty() ? 1 :
-			(float) sSize.width() / framebufferSize().width();
-	if( m_repaint )
-	{
-		if( sSize.isEmpty() )
-		{
-			p.drawImage( QRect( m_x, m_y, m_w, m_h ),
-					m_frame.copy( m_x, m_y, m_w, m_h ) );
-		}
-		else
-		{
-			FastQImage i = m_frame;
-			p.drawImage( 0, 0, m_frame.scaled( sSize ) );
-		}
-	}
-	else
-	{
-		QRect rect = paintEvent->rect();
-		if( rect.width() != m_frame.width() || rect.height() != m_frame.height() )
-		{
-			int sx = qRound( rect.x()/scale );
-			int sy = qRound( rect.y()/scale );
-			int sw = qRound( rect.width()/scale );
-			int sh = qRound( rect.height()/scale );
-			p.drawImage( rect, m_frame.copy( sx, sy, sw, sh ).
-				scaled( rect.width(), rect.height(),
-						Qt::IgnoreAspectRatio,
-						Qt::SmoothTransformation ) );
-		}
-		else
-		{
-			// even we just have to update a part of the screen, update
-			// everything when in scaled mode as otherwise there're annoying
-			// artifacts
-			p.drawImage( QPoint( 0, 0 ),
-		m_frame.scaled( qRound( m_frame.width() * scale ),
-					qRound( m_frame.height()*scale ),
-			Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
-		}
-	}
-
-	if( isViewOnly() && !m_cursorShape.isNull() )
-	{
-		const QRect cursorRect = mapFromFramebuffer(
-			QRect( QPoint( m_cursorX - m_cursorHotX,
-							m_cursorY - m_cursorHotY ),
-					m_cursorShape.size() ) );
-		// parts of cursor within updated region?
-		if( paintEvent->region().intersects( cursorRect ) )
-		{
-			// then repaint it
-			p.drawImage( cursorRect.topLeft(), m_cursorShape );
-		}
-	}
-
-
-
-	// draw black borders if neccessary
-	const int fbw = sSize.isValid() ? sSize.width() :
-				m_vncConn.framebufferSize().width();
-	if( fbw < width() )
-	{
-		p.fillRect( fbw, 0, width() - fbw, height(), Qt::black );
-	}
-	const int fbh = sSize.isValid() ? sSize.height() :
-				m_vncConn.framebufferSize().height();
-	if( fbh < height() )
-	{
-		p.fillRect( 0, fbh, fbw, height() - fbh, Qt::black );
-	}
-
-}
-
-
-
-
-void VncView::resizeEvent( QResizeEvent *event )
-{
-	m_vncConn.setScaledSize( scaledSize() );
-
-	update();
-
-	if( m_establishingConnection )
-	{
-		m_establishingConnection->move( 10, 10 );
-	}
-
-	updateLocalCursor();
-
-	QWidget::resizeEvent( event );
-}
-
-
-
-
-void VncView::wheelEventHandler( QWheelEvent * _we )
-{
-	const QPoint p = mapToFramebuffer( _we->pos() );
-	m_vncConn.mouseEvent( p.x(), p.y(), m_buttonMask |
-		( ( _we->delta() < 0 ) ? rfbButton5Mask : rfbButton4Mask ) );
-	m_vncConn.mouseEvent( p.x(), p.y(), m_buttonMask );
-}
-
-
-
-
-void VncView::mouseEventHandler( QMouseEvent * _me )
-{
-	struct buttonXlate
-	{
-		Qt::MouseButton qt;
-		int rfb;
-	} const map[] =
-		{
-			{ Qt::LeftButton, rfbButton1Mask },
-			{ Qt::MidButton, rfbButton2Mask },
-			{ Qt::RightButton, rfbButton3Mask }
-		} ;
-
-	if( _me->type() != QEvent::MouseMove )
-	{
-		for( uint8_t i = 0; i < sizeof(map)/sizeof(buttonXlate); ++i )
-		{
-			if( _me->button() == map[i].qt )
-			{
-				if( _me->type() == QEvent::MouseButtonPress ||
-				_me->type() == QEvent::MouseButtonDblClick )
-				{
-					m_buttonMask |= map[i].rfb;
-				}
-				else
-				{
-					m_buttonMask &= ~map[i].rfb;
-				}
-			}
-		}
-	}
-	else
-	{
-		if( _me->pos().y() < 2 )
-		{
-			// special signal for allowing parent-widgets to
-			// show a toolbar etc.
-			emit mouseAtTop();
-		}
-	}
-
-	if( !m_viewOnly )
-	{
-		const QPoint p = mapToFramebuffer( _me->pos() );
-		m_vncConn.mouseEvent( p.x(), p.y(), m_buttonMask );
-	}
-}
-
-
-
-
-
-void VncView::updateImage(int x, int y, int w, int h)
-{
-	m_x = x;
-	m_y = y;
-	m_w = w;
-	m_h = h;
-
-	const QSize sSize = scaledSize();
-	const float scale = sSize.isEmpty() ? 1 :
-			(float) sSize.width() / framebufferSize().width();
-	if( !sSize.isEmpty() )
-	{
-		m_x-=1;
-		m_y-=1;
-		m_w+=2;
-		m_h+=2;
-	}
-
-	m_frame = m_vncConn.image();
-
-	if( !m_initDone )
-	{
-		setAttribute( Qt::WA_StaticContents );
-		setAttribute( Qt::WA_OpaquePaintEvent );
-		installEventFilter( this );
-
-		setMouseTracking( true ); // get mouse events even when there is no mousebutton pressed
-		setFocusPolicy( Qt::WheelFocus );
-
-		resize( sizeHint() );
-		m_vncConn.setScaledSize( scaledSize() );
-
-		emit connectionEstablished();
-		m_initDone = true;
-
-	}
-
-	m_repaint = true;
-	repaint( qRound( m_x*scale ), qRound( m_y*scale ),
-			qRound( m_w*scale ), qRound( m_h*scale ) );
-	m_repaint = false;
-}
-
-
-
-void VncView::updateSizeHint( int w, int h )
-{
-	m_framebufferSize = QSize( w, h );
-	if( isScaledView() )
-	{
-		resize( w, h );
-	}
-	emit sizeHintChanged();
-}
-
-
diff --git a/lib/src/dh.cpp b/lib/src/dh.cpp
deleted file mode 100644
index 784b9b8..0000000
--- a/lib/src/dh.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-// CRYPTO LIBRARY FOR EXCHANGING KEYS
-// USING THE DIFFIE-HELLMAN KEY EXCHANGE PROTOCOL
-
-// The diffie-hellman can be used to securely exchange keys
-// between parties, where a third party eavesdropper given
-// the values being transmitted cannot determine the key.
-
-// Implemented by Lee Griffiths, Jan 2004.
-// This software is freeware, you may use it to your discretion,
-// however by doing so you take full responsibility for any damage
-// it may cause.
-
-// Hope you find it useful, even if you just use some of the functions
-// out of it like the prime number generator and the XtoYmodN function.
-
-// It would be great if you could send me emails to: lee.griffiths at first4internet.co.uk
-// with any suggestions, comments, or questions!
-
-// Enjoy.
-
-// Adopted to ms-logon for ultravnc by marscha, 2006.
-
-#include "rfb/dh.h"
-#include "Logger.h"
-
-#define throw
-#define Except(x) qCritical(x)
-
-DiffieHellman::DiffieHellman() : maxNum(((uint64_t) 1) << DH_MAX_BITS) {
-	srand((unsigned) time(NULL));
-}
-
-DiffieHellman::DiffieHellman(uint64_t generator, uint64_t modulus)
-	: gen(generator), mod(modulus),
-	  maxNum(((uint64_t) 1) << DH_MAX_BITS) {
-	if (gen > maxNum || mod > maxNum)
-		throw Except("Input exceeds maxNum");
-	if (gen > mod)
-		throw Except("Generator is larger than modulus");
-	srand((unsigned) time(NULL));
-}
-
-DiffieHellman::~DiffieHellman() { cleanMem(); }
-
-uint64_t rng(uint64_t limit) {
-	return ((((uint64_t) rand()) * rand() * rand ()) % limit);
-}
-
-//Performs the miller-rabin primality test on a guessed prime n.
-//trials is the number of attempts to verify this, because the function
-//is not 100% accurate it may be a composite.  However setting the trial
-//value to around 5 should guarantee success even with very large primes
-bool DiffieHellman::millerRabin (uint64_t n, unsigned int trials) { 
-	uint64_t a = 0; 
-
-	for (unsigned int i = 0; i < trials; i++) { 
-		a = rng(n - 3) + 2;// gets random value in [2..n-1] 
-		if (XpowYmodN(a, n - 1, n) != 1) return false; //n composite, return false 
-	}
-	return true; // n probably prime 
-} 
-
-//Generates a large prime number by
-//choosing a randomly large integer, and ensuring the value is odd
-//then uses the miller-rabin primality test on it to see if it is prime
-//if not the value gets increased until it is prime
-uint64_t DiffieHellman::generatePrime() {
-	uint64_t prime = 0;
-
-	do {
-		uint64_t start = rng(maxNum);
-		prime = tryToGeneratePrime(start);
-	} while (!prime);
-	return prime;
-}
- 
-uint64_t DiffieHellman::tryToGeneratePrime(uint64_t prime) {
-	//ensure it is an odd number
-	if ((prime & 1) == 0)
-		prime += 1;
-
-	uint64_t cnt = 0;
-	while (!millerRabin(prime, 25) && (cnt++ < DH_RANGE) && prime < maxNum) {
-		prime += 2;
-		if ((prime % 3) == 0) prime += 2;
-	}
-	return (cnt >= DH_RANGE || prime >= maxNum) ? 0 : prime;
-}
- 
-//Raises X to the power Y in modulus N
-//the values of X, Y, and N can be massive, and this can be 
-//achieved by first calculating X to the power of 2 then 
-//using power chaining over modulus N
-uint64_t DiffieHellman::XpowYmodN(uint64_t x, uint64_t y, uint64_t N) {
-	uint64_t result = 1;
-	const uint64_t oneShift63 = ((uint64_t) 1) << 63;
-	
-	for (int i = 0; i < 64; y <<= 1, i++){
-		result = result * result % N;
-		if (y & oneShift63)
-			result = result * x % N;
-	}
-	return result;
-}
-
-void DiffieHellman::createKeys() {
-	gen = generatePrime();
-	mod = generatePrime();
-
-	if (gen > mod) {
-		uint64_t swap = gen;
-		gen  = mod;
-		mod  = swap;
-	}
-}
-
-uint64_t DiffieHellman::createInterKey() {
-	priv = rng(maxNum);
-	return pub = XpowYmodN(gen,priv,mod);
-}
-
-uint64_t DiffieHellman::createEncryptionKey(uint64_t interKey) {
-	if (interKey >= maxNum)
-		throw Except("interKey larger than maxNum");
-	return key = XpowYmodN(interKey,priv,mod);
-}
-
-void DiffieHellman::cleanMem(int flags) { // marscha (TODO): SecureZeroMemory?
-	gen  = 0;
-	mod  = 0;
-	priv = 0;
-	pub  = 0;
-	
-	if (flags != DH_CLEAN_ALL_MEMORY_EXCEPT_KEY)
-		key = 0;
-}
-
-uint64_t DiffieHellman::getValue(int flags) {
-	switch (flags) {
-		case DH_MOD:
-			return mod;
-		case DH_GEN:
-			return gen;
-		case DH_PRIV:
-			return priv;
-		case DH_PUB:
-			return pub;
-		case DH_KEY:
-			return key;
-		default:
-			return (uint64_t) 0;
-	}
-}
-
-int bits(int64_t number){
-	for (unsigned int i = 0; i < 64; i++){
-		number /= 2;
-		if (number < 2) return i;
-	}
-	return 0;
-}
-
-bool int64ToBytes(const uint64_t integer, char* const bytes) {
-	for (int i = 0; i < 8; i++) {
-		bytes[i] = (unsigned char) (integer >> (8 * (7 - i)));
-	}
-	return true;
-}
-
-uint64_t bytesToInt64(const char* const bytes) {
-	uint64_t result = 0;
-	for (int i = 0; i < 8; i++) {
-		result <<= 8;
-		result += (unsigned char) bytes[i];
-	}
-	return result;
-}
-
diff --git a/nsis/header.bmp b/nsis/header.bmp
deleted file mode 100644
index b59a2b7..0000000
Binary files a/nsis/header.bmp and /dev/null differ
diff --git a/nsis/welcome-page.bmp b/nsis/welcome-page.bmp
deleted file mode 100644
index f00c14e..0000000
Binary files a/nsis/welcome-page.bmp and /dev/null differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/italc.git



More information about the debian-edu-commits mailing list